diff --git a/dist/phaser-arcade-physics.js b/dist/phaser-arcade-physics.js index 9d1f40552..eed074c24 100644 --- a/dist/phaser-arcade-physics.js +++ b/dist/phaser-arcade-physics.js @@ -7,7 +7,7 @@ exports["Phaser"] = factory(); else root["Phaser"] = factory(); -})(this, function() { +})(this, () => { return /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ @@ -360,7 +360,7 @@ if (true) { /** * @author samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -409,7 +409,7 @@ module.exports = AlignTo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -451,7 +451,7 @@ module.exports = Angle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -491,7 +491,7 @@ module.exports = Call; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -550,7 +550,7 @@ module.exports = GetFirst; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -609,7 +609,7 @@ module.exports = GetLast; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -729,7 +729,7 @@ module.exports = GridAlign; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -771,7 +771,7 @@ module.exports = IncAlpha; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -813,7 +813,7 @@ module.exports = IncX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -861,7 +861,7 @@ module.exports = IncXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -903,7 +903,7 @@ module.exports = IncY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -953,7 +953,7 @@ module.exports = PlaceOnCircle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1006,7 +1006,7 @@ module.exports = PlaceOnEllipse; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1051,7 +1051,7 @@ module.exports = PlaceOnLine; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1110,7 +1110,7 @@ module.exports = PlaceOnRectangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1172,7 +1172,7 @@ module.exports = PlaceOnTriangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1217,7 +1217,7 @@ module.exports = PlayAnimation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1285,7 +1285,7 @@ module.exports = PropertyValueInc; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1353,7 +1353,7 @@ module.exports = PropertyValueSet; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1394,7 +1394,7 @@ module.exports = RandomCircle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1435,7 +1435,7 @@ module.exports = RandomEllipse; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1476,7 +1476,7 @@ module.exports = RandomLine; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1515,7 +1515,7 @@ module.exports = RandomRectangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1556,7 +1556,7 @@ module.exports = RandomTriangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1598,7 +1598,7 @@ module.exports = Rotate; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1645,7 +1645,7 @@ module.exports = RotateAround; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1695,7 +1695,7 @@ module.exports = RotateAroundDistance; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1737,7 +1737,7 @@ module.exports = ScaleX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1785,7 +1785,7 @@ module.exports = ScaleXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1827,7 +1827,7 @@ module.exports = ScaleY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1869,7 +1869,7 @@ module.exports = SetAlpha; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1910,7 +1910,7 @@ module.exports = SetBlendMode; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1952,7 +1952,7 @@ module.exports = SetDepth; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1992,7 +1992,7 @@ module.exports = SetHitArea; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2046,7 +2046,7 @@ module.exports = SetOrigin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2088,7 +2088,7 @@ module.exports = SetRotation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2136,7 +2136,7 @@ module.exports = SetScale; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2178,7 +2178,7 @@ module.exports = SetScaleX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2220,7 +2220,7 @@ module.exports = SetScaleY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2268,7 +2268,7 @@ module.exports = SetScrollFactor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2310,7 +2310,7 @@ module.exports = SetScrollFactorX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2352,7 +2352,7 @@ module.exports = SetScrollFactorY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2392,7 +2392,7 @@ module.exports = SetTint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2431,7 +2431,7 @@ module.exports = SetVisible; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2473,7 +2473,7 @@ module.exports = SetX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2521,7 +2521,7 @@ module.exports = SetXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2563,7 +2563,7 @@ module.exports = SetY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2694,7 +2694,7 @@ module.exports = ShiftPosition; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2728,7 +2728,7 @@ module.exports = Shuffle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2787,7 +2787,7 @@ module.exports = SmoothStep; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2846,7 +2846,7 @@ module.exports = SmootherStep; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2910,7 +2910,7 @@ module.exports = Spread; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2948,7 +2948,7 @@ module.exports = ToggleVisible; /** * @author Richard Davey * @author samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2997,7 +2997,7 @@ module.exports = WrapInRectangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -3071,7 +3071,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -3987,7 +3987,7 @@ module.exports = Animation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -4175,7 +4175,7 @@ module.exports = AnimationFrame; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -4567,10 +4567,11 @@ var AnimationManager = new Class({ * * @param {string} key - The key of the loaded Aseprite atlas. It must have been loaded prior to calling this method. * @param {string[]} [tags] - An array of Tag names. If provided, only animations found in this array will be created. + * @param {(Phaser.Animations.AnimationManager|Phaser.GameObjects.GameObject)} [target] - Create the animations on this target Sprite. If not given, they will be created globally in this Animation Manager. * * @return {Phaser.Animations.Animation[]} An array of Animation instances that were successfully created. */ - createFromAseprite: function (key, tags) + createFromAseprite: function (key, tags, target) { var output = []; @@ -4607,10 +4608,8 @@ var AnimationManager = new Class({ if (!tags || (tags && tags.indexOf(name) > -1)) { - // Get all the frames for this tag - var tempFrames = []; - var minDuration = Number.MAX_SAFE_INTEGER; - + // Get all the frames for this tag and calculate the total duration in milliseconds. + var totalDuration = 0; for (var i = from; i <= to; i++) { var frameKey = i.toString(); @@ -4619,26 +4618,18 @@ var AnimationManager = new Class({ if (frame) { var frameDuration = GetFastValue(frame, 'duration', Number.MAX_SAFE_INTEGER); - - if (frameDuration < minDuration) - { - minDuration = frameDuration; - } - - tempFrames.push({ frame: frameKey, duration: frameDuration }); + animFrames.push({ key: key, frame: frameKey, duration: frameDuration }); + totalDuration += frameDuration; } } - tempFrames.forEach(function (entry) - { - animFrames.push({ - key: key, - frame: entry.frame, - duration: (entry.duration - minDuration) - }); - }); + // Fix duration to play nice with how the next tick is calculated. + var msPerFrame = totalDuration / animFrames.length; - var totalDuration = (minDuration * animFrames.length); + animFrames.forEach(function (entry) + { + entry.duration -= msPerFrame; + }); if (direction === 'reverse') { @@ -4653,7 +4644,19 @@ var AnimationManager = new Class({ yoyo: (direction === 'pingpong') }; - var result = _this.create(createConfig); + var result; + + if (target) + { + if (target.anims) + { + result = target.anims.create(createConfig); + } + } + else + { + result = _this.create(createConfig); + } if (result) { @@ -4765,14 +4768,15 @@ var AnimationManager = new Class({ * Generates objects with string based frame names, as configured by the given {@link Phaser.Types.Animations.GenerateFrameNames}. * * It's a helper method, designed to make it easier for you to extract all of the frame names from texture atlases. + * * If you're working with a sprite sheet, see the `generateFrameNumbers` method instead. * * Example: * * If you have a texture atlases loaded called `gems` and it contains 6 frames called `ruby_0001`, `ruby_0002`, and so on, - * then you can call this method using: `this.anims.generateFrameNames('gems', { prefix: 'ruby_', end: 6, zeroPad: 4 })`. + * then you can call this method using: `this.anims.generateFrameNames('gems', { prefix: 'ruby_', start: 1, end: 6, zeroPad: 4 })`. * - * The `end` value tells it to look for 6 frames, incrementally numbered, all starting with the prefix `ruby_`. The `zeroPad` + * The `end` value tells it to select frames 1 through 6, incrementally numbered, all starting with the prefix `ruby_`. The `zeroPad` * value tells it how many zeroes pad out the numbers. To create an animation using this method, you can do: * * ```javascript @@ -4859,7 +4863,6 @@ var AnimationManager = new Class({ * If you're working with a texture atlas, see the `generateFrameNames` method instead. * * It's a helper method, designed to make it easier for you to extract frames from sprite sheets. - * If you're working with a texture atlas, see the `generateFrameNames` method instead. * * Example: * @@ -5188,7 +5191,7 @@ module.exports = AnimationManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -5660,7 +5663,7 @@ var AnimationState = new Class({ * @method Phaser.Animations.AnimationState#chain * @since 3.16.0 * - * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig|string[]|Phaser.Animations.Animation[]|Phaser.Types.Animations.PlayAnimationConfig[])} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object, or an array of them. + * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig|string[]|Phaser.Animations.Animation[]|Phaser.Types.Animations.PlayAnimationConfig[])} [key] - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object, or an array of them. * * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. */ @@ -6889,6 +6892,93 @@ var AnimationState = new Class({ return anim; }, + /** + * Create one, or more animations from a loaded Aseprite JSON file. + * + * Aseprite is a powerful animated sprite editor and pixel art tool. + * + * You can find more details at https://www.aseprite.org/ + * + * To export a compatible JSON file in Aseprite, please do the following: + * + * 1. Go to "File - Export Sprite Sheet" + * + * 2. On the **Layout** tab: + * 2a. Set the "Sheet type" to "Packed" + * 2b. Set the "Constraints" to "None" + * 2c. Check the "Merge Duplicates" checkbox + * + * 3. On the **Sprite** tab: + * 3a. Set "Layers" to "Visible layers" + * 3b. Set "Frames" to "All frames", unless you only wish to export a sub-set of tags + * + * 4. On the **Borders** tab: + * 4a. Check the "Trim Sprite" and "Trim Cells" options + * 4b. Ensure "Border Padding", "Spacing" and "Inner Padding" are all > 0 (1 is usually enough) + * + * 5. On the **Output** tab: + * 5a. Check "Output File", give your image a name and make sure you choose "png files" as the file type + * 5b. Check "JSON Data" and give your json file a name + * 5c. The JSON Data type can be either a Hash or Array, Phaser doesn't mind. + * 5d. Make sure "Tags" is checked in the Meta options + * 5e. In the "Item Filename" input box, make sure it says just "{frame}" and nothing more. + * + * 6. Click export + * + * This was tested with Aseprite 1.2.25. + * + * This will export a png and json file which you can load using the Aseprite Loader, i.e.: + * + * ```javascript + * function preload () + * { + * this.load.path = 'assets/animations/aseprite/'; + * this.load.aseprite('paladin', 'paladin.png', 'paladin.json'); + * } + * ``` + * + * Once loaded, you can call this method on a Sprite with the 'atlas' key: + * + * ```javascript + * const sprite = this.add.sprite(400, 300); + * + * sprite.anims.createFromAseprite('paladin'); + * ``` + * + * Any animations defined in the JSON will now be available to use on this Sprite and you play them + * via their Tag name. For example, if you have an animation called 'War Cry' on your Aseprite timeline, + * you can play it on the Sprite using that Tag name: + * + * ```javascript + * const sprite = this.add.sprite(400, 300); + * + * sprite.anims.createFromAseprite('paladin'); + * + * sprite.play('War Cry'); + * ``` + * + * When calling this method you can optionally provide an array of tag names, and only those animations + * will be created. For example: + * + * ```javascript + * sprite.anims.createFromAseprite('paladin', [ 'step', 'War Cry', 'Magnum Break' ]); + * ``` + * + * This will only create the 3 animations defined. Note that the tag names are case-sensitive. + * + * @method Phaser.Animations.AnimationState#createFromAseprite + * @since 3.60.0 + * + * @param {string} key - The key of the loaded Aseprite atlas. It must have been loaded prior to calling this method. + * @param {string[]} [tags] - An array of Tag names. If provided, only animations found in this array will be created. + * + * @return {Phaser.Animations.Animation[]} An array of Animation instances that were successfully created. + */ + createFromAseprite: function (key, tags) + { + return this.animationManager.createFromAseprite(key, tags, this.parent); + }, + /** * Generate an array of {@link Phaser.Types.Animations.AnimationFrame} objects from a texture key and configuration object. * @@ -7066,7 +7156,7 @@ module.exports = AnimationState; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7094,7 +7184,7 @@ module.exports = 'add'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7141,7 +7231,7 @@ module.exports = 'animationcomplete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7192,7 +7282,7 @@ module.exports = 'animationcomplete-'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7236,7 +7326,7 @@ module.exports = 'animationrepeat'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7278,7 +7368,7 @@ module.exports = 'animationrestart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7321,7 +7411,7 @@ module.exports = 'animationstart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7364,7 +7454,7 @@ module.exports = 'animationstop'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7411,7 +7501,7 @@ module.exports = 'animationupdate'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7436,7 +7526,7 @@ module.exports = 'pauseall'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7461,7 +7551,7 @@ module.exports = 'remove'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7485,7 +7575,7 @@ module.exports = 'resumeall'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7517,7 +7607,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7543,7 +7633,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7730,7 +7820,7 @@ module.exports = BaseCache; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7965,7 +8055,7 @@ module.exports = CacheManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7991,7 +8081,7 @@ module.exports = 'add'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -8017,7 +8107,7 @@ module.exports = 'remove'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -8040,7 +8130,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -8064,7 +8154,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -10043,7 +10133,7 @@ module.exports = BaseCamera; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -10851,7 +10941,7 @@ module.exports = Camera; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -11469,7 +11559,7 @@ var CameraManager = new Class({ * @since 3.50.0 * * @param {Phaser.GameObjects.GameObject[]} children - An array of Game Objects to be checked against the camera. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera to filte the Game Objects against. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera to filter the Game Objects against. * * @return {Phaser.GameObjects.GameObject[]} A filtered list of only Game Objects within the Scene that will render against the given Camera. */ @@ -11636,7 +11726,7 @@ module.exports = CameraManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -12025,7 +12115,7 @@ module.exports = Fade; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -12388,7 +12478,7 @@ module.exports = Flash; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -13148,7 +13238,7 @@ module.exports = RotateTo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -13468,7 +13558,7 @@ module.exports = Shake; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -13762,7 +13852,7 @@ module.exports = Zoom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -13789,7 +13879,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -13813,7 +13903,7 @@ module.exports = 'cameradestroy'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -13840,7 +13930,7 @@ module.exports = 'camerafadeincomplete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -13871,7 +13961,7 @@ module.exports = 'camerafadeinstart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -13898,7 +13988,7 @@ module.exports = 'camerafadeoutcomplete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -13929,7 +14019,7 @@ module.exports = 'camerafadeoutstart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -13954,7 +14044,7 @@ module.exports = 'cameraflashcomplete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -13983,7 +14073,7 @@ module.exports = 'cameraflashstart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14012,7 +14102,7 @@ module.exports = 'followupdate'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14037,7 +14127,7 @@ module.exports = 'camerapancomplete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14065,7 +14155,7 @@ module.exports = 'camerapanstart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14092,7 +14182,7 @@ module.exports = 'postrender'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14119,7 +14209,7 @@ module.exports = 'prerender'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14144,7 +14234,7 @@ module.exports = 'camerarotatecomplete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14171,7 +14261,7 @@ module.exports = 'camerarotatestart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14196,7 +14286,7 @@ module.exports = 'camerashakecomplete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14223,7 +14313,7 @@ module.exports = 'camerashakestart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14248,7 +14338,7 @@ module.exports = 'camerazoomcomplete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14275,7 +14365,7 @@ module.exports = 'camerazoomstart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14314,7 +14404,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14340,7 +14430,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14672,7 +14762,7 @@ module.exports = FixedKeyControl; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -15180,7 +15270,7 @@ module.exports = SmoothedKeyControl; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -15203,7 +15293,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -15230,7 +15320,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -15250,7 +15340,7 @@ var CONST = { * @type {string} * @since 3.0.0 */ - VERSION: '3.60.0-beta.3', + VERSION: '3.60.0-beta.10', BlendModes: __webpack_require__(95723), @@ -15375,7 +15465,7 @@ module.exports = CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -15421,97 +15511,79 @@ var Config = new Class({ var defaultBannerTextColor = '#ffffff'; + // Scale Manager - Anything set in here over-rides anything set in the core game config + + var scaleConfig = GetValue(config, 'scale', null); + /** * @const {(number|string)} Phaser.Core.Config#width - The width of the underlying canvas, in pixels. */ - this.width = GetValue(config, 'width', 1024); + this.width = GetValue(scaleConfig, 'width', 1024, config); /** * @const {(number|string)} Phaser.Core.Config#height - The height of the underlying canvas, in pixels. */ - this.height = GetValue(config, 'height', 768); + this.height = GetValue(scaleConfig, 'height', 768, config); /** * @const {(Phaser.Scale.ZoomType|number)} Phaser.Core.Config#zoom - The zoom factor, as used by the Scale Manager. */ - this.zoom = GetValue(config, 'zoom', 1); + this.zoom = GetValue(scaleConfig, 'zoom', 1, config); /** * @const {?*} Phaser.Core.Config#parent - A parent DOM element into which the canvas created by the renderer will be injected. */ - this.parent = GetValue(config, 'parent', undefined); + this.parent = GetValue(scaleConfig, 'parent', undefined, config); /** * @const {Phaser.Scale.ScaleModeType} Phaser.Core.Config#scaleMode - The scale mode as used by the Scale Manager. The default is zero, which is no scaling. */ - this.scaleMode = GetValue(config, 'scaleMode', 0); + this.scaleMode = GetValue(scaleConfig, (scaleConfig) ? 'mode' : 'scaleMode', 0, config); /** * @const {boolean} Phaser.Core.Config#expandParent - Is the Scale Manager allowed to adjust the CSS height property of the parent to be 100%? */ - this.expandParent = GetValue(config, 'expandParent', true); + this.expandParent = GetValue(scaleConfig, 'expandParent', true, config); /** * @const {boolean} Phaser.Core.Config#autoRound - Automatically round the display and style sizes of the canvas. This can help with performance in lower-powered devices. */ - this.autoRound = GetValue(config, 'autoRound', false); + this.autoRound = GetValue(scaleConfig, 'autoRound', false, config); /** * @const {Phaser.Scale.CenterType} Phaser.Core.Config#autoCenter - Automatically center the canvas within the parent? */ - this.autoCenter = GetValue(config, 'autoCenter', 0); + this.autoCenter = GetValue(scaleConfig, 'autoCenter', 0, config); /** * @const {number} Phaser.Core.Config#resizeInterval - How many ms should elapse before checking if the browser size has changed? */ - this.resizeInterval = GetValue(config, 'resizeInterval', 500); + this.resizeInterval = GetValue(scaleConfig, 'resizeInterval', 500, config); /** * @const {?(HTMLElement|string)} Phaser.Core.Config#fullscreenTarget - The DOM element that will be sent into full screen mode, or its `id`. If undefined Phaser will create its own div and insert the canvas into it when entering fullscreen mode. */ - this.fullscreenTarget = GetValue(config, 'fullscreenTarget', null); + this.fullscreenTarget = GetValue(scaleConfig, 'fullscreenTarget', null, config); /** * @const {number} Phaser.Core.Config#minWidth - The minimum width, in pixels, the canvas will scale down to. A value of zero means no minimum. */ - this.minWidth = GetValue(config, 'minWidth', 0); + this.minWidth = GetValue(scaleConfig, 'minWidth', 0, config); /** * @const {number} Phaser.Core.Config#maxWidth - The maximum width, in pixels, the canvas will scale up to. A value of zero means no maximum. */ - this.maxWidth = GetValue(config, 'maxWidth', 0); + this.maxWidth = GetValue(scaleConfig, 'maxWidth', 0, config); /** * @const {number} Phaser.Core.Config#minHeight - The minimum height, in pixels, the canvas will scale down to. A value of zero means no minimum. */ - this.minHeight = GetValue(config, 'minHeight', 0); + this.minHeight = GetValue(scaleConfig, 'minHeight', 0, config); /** * @const {number} Phaser.Core.Config#maxHeight - The maximum height, in pixels, the canvas will scale up to. A value of zero means no maximum. */ - this.maxHeight = GetValue(config, 'maxHeight', 0); - - // Scale Manager - Anything set in here over-rides anything set above - - var scaleConfig = GetValue(config, 'scale', null); - - if (scaleConfig) - { - this.width = GetValue(scaleConfig, 'width', this.width); - this.height = GetValue(scaleConfig, 'height', this.height); - this.zoom = GetValue(scaleConfig, 'zoom', this.zoom); - this.parent = GetValue(scaleConfig, 'parent', this.parent); - this.scaleMode = GetValue(scaleConfig, 'mode', this.scaleMode); - this.expandParent = GetValue(scaleConfig, 'expandParent', this.expandParent); - this.autoRound = GetValue(scaleConfig, 'autoRound', this.autoRound); - this.autoCenter = GetValue(scaleConfig, 'autoCenter', this.autoCenter); - this.resizeInterval = GetValue(scaleConfig, 'resizeInterval', this.resizeInterval); - this.fullscreenTarget = GetValue(scaleConfig, 'fullscreenTarget', this.fullscreenTarget); - this.minWidth = GetValue(scaleConfig, 'min.width', this.minWidth); - this.maxWidth = GetValue(scaleConfig, 'max.width', this.maxWidth); - this.minHeight = GetValue(scaleConfig, 'min.height', this.minHeight); - this.maxHeight = GetValue(scaleConfig, 'max.height', this.maxHeight); - } + this.maxHeight = GetValue(scaleConfig, 'maxHeight', 0, config); /** * @const {number} Phaser.Core.Config#renderType - Force Phaser to use a specific renderer. Can be `CONST.CANVAS`, `CONST.WEBGL`, `CONST.HEADLESS` or `CONST.AUTO` (default) @@ -15711,45 +15783,44 @@ var Config = new Class({ */ this.fps = GetValue(config, 'fps', null); - // Renderer Settings - // These can either be in a `render` object within the Config, or specified on their own + // Render Settings - Anything set in here over-rides anything set in the core game config - var renderConfig = GetValue(config, 'render', config); + var renderConfig = GetValue(config, 'render', null); /** * @const {Phaser.Types.Core.PipelineConfig} Phaser.Core.Config#pipeline - An object mapping WebGL names to WebGLPipeline classes. These should be class constructors, not instances. */ - this.pipeline = GetValue(renderConfig, 'pipeline', null); + this.pipeline = GetValue(renderConfig, 'pipeline', null, config); /** * @const {boolean} Phaser.Core.Config#antialias - When set to `true`, WebGL uses linear interpolation to draw scaled or rotated textures, giving a smooth appearance. When set to `false`, WebGL uses nearest-neighbor interpolation, giving a crisper appearance. `false` also disables antialiasing of the game canvas itself, if the browser supports it, when the game canvas is scaled. */ - this.antialias = GetValue(renderConfig, 'antialias', true); + this.antialias = GetValue(renderConfig, 'antialias', true, config); /** * @const {boolean} Phaser.Core.Config#antialiasGL - Sets the `antialias` property when the WebGL context is created. Setting this value does not impact any subsequent textures that are created, or the canvas style attributes. */ - this.antialiasGL = GetValue(renderConfig, 'antialiasGL', true); + this.antialiasGL = GetValue(renderConfig, 'antialiasGL', true, config); /** * @const {string} Phaser.Core.Config#mipmapFilter - Sets the `mipmapFilter` property when the WebGL renderer is created. */ - this.mipmapFilter = GetValue(renderConfig, 'mipmapFilter', 'LINEAR'); + this.mipmapFilter = GetValue(renderConfig, 'mipmapFilter', 'LINEAR', config); /** * @const {boolean} Phaser.Core.Config#desynchronized - When set to `true` it will create a desynchronized context for both 2D and WebGL. See https://developers.google.com/web/updates/2019/05/desynchronized for details. */ - this.desynchronized = GetValue(renderConfig, 'desynchronized', false); + this.desynchronized = GetValue(renderConfig, 'desynchronized', false, config); /** * @const {boolean} Phaser.Core.Config#roundPixels - Draw texture-based Game Objects at only whole-integer positions. Game Objects without textures, like Graphics, ignore this property. */ - this.roundPixels = GetValue(renderConfig, 'roundPixels', false); + this.roundPixels = GetValue(renderConfig, 'roundPixels', false, config); /** * @const {boolean} Phaser.Core.Config#pixelArt - Prevent pixel art from becoming blurred when scaled. It will remain crisp (tells the WebGL renderer to automatically create textures using a linear filter mode). */ - this.pixelArt = GetValue(renderConfig, 'pixelArt', this.zoom !== 1); + this.pixelArt = GetValue(renderConfig, 'pixelArt', this.zoom !== 1, config); if (this.pixelArt) { @@ -15761,47 +15832,47 @@ var Config = new Class({ /** * @const {boolean} Phaser.Core.Config#transparent - Whether the game canvas will have a transparent background. */ - this.transparent = GetValue(renderConfig, 'transparent', false); + this.transparent = GetValue(renderConfig, 'transparent', false, config); /** * @const {boolean} Phaser.Core.Config#clearBeforeRender - Whether the game canvas will be cleared between each rendering frame. You can disable this if you have a full-screen background image or game object. */ - this.clearBeforeRender = GetValue(renderConfig, 'clearBeforeRender', true); + this.clearBeforeRender = GetValue(renderConfig, 'clearBeforeRender', true, config); /** * @const {boolean} Phaser.Core.Config#preserveDrawingBuffer - If the value is true the WebGL buffers will not be cleared and will preserve their values until cleared or overwritten by the author. */ - this.preserveDrawingBuffer = GetValue(renderConfig, 'preserveDrawingBuffer', false); + this.preserveDrawingBuffer = GetValue(renderConfig, 'preserveDrawingBuffer', false, config); /** * @const {boolean} Phaser.Core.Config#premultipliedAlpha - In WebGL mode, sets the drawing buffer to contain colors with pre-multiplied alpha. */ - this.premultipliedAlpha = GetValue(renderConfig, 'premultipliedAlpha', true); + this.premultipliedAlpha = GetValue(renderConfig, 'premultipliedAlpha', true, config); /** * @const {boolean} Phaser.Core.Config#failIfMajorPerformanceCaveat - Let the browser abort creating a WebGL context if it judges performance would be unacceptable. */ - this.failIfMajorPerformanceCaveat = GetValue(renderConfig, 'failIfMajorPerformanceCaveat', false); + this.failIfMajorPerformanceCaveat = GetValue(renderConfig, 'failIfMajorPerformanceCaveat', false, config); /** * @const {string} Phaser.Core.Config#powerPreference - "high-performance", "low-power" or "default". A hint to the browser on how much device power the game might use. */ - this.powerPreference = GetValue(renderConfig, 'powerPreference', 'default'); + this.powerPreference = GetValue(renderConfig, 'powerPreference', 'default', config); /** * @const {number} Phaser.Core.Config#batchSize - The default WebGL Batch size. Represents the number of _quads_ that can be added to a single batch. */ - this.batchSize = GetValue(renderConfig, 'batchSize', 4096); + this.batchSize = GetValue(renderConfig, 'batchSize', 4096, config); /** * @const {number} Phaser.Core.Config#maxTextures - When in WebGL mode, this sets the maximum number of GPU Textures to use. The default, -1, will use all available units. The WebGL1 spec says all browsers should provide a minimum of 8. */ - this.maxTextures = GetValue(renderConfig, 'maxTextures', -1); + this.maxTextures = GetValue(renderConfig, 'maxTextures', -1, config); /** * @const {number} Phaser.Core.Config#maxLights - The maximum number of lights allowed to be visible within range of a single Camera in the LightManager. */ - this.maxLights = GetValue(renderConfig, 'maxLights', 10); + this.maxLights = GetValue(renderConfig, 'maxLights', 10, config); var bgc = GetValue(config, 'backgroundColor', 0); @@ -15849,9 +15920,7 @@ var Config = new Class({ /** * @const {number} Phaser.Core.Config#loaderMaxParallelDownloads - Maximum parallel downloads allowed for resources (Default to 32). */ - var defaultParallel = (Device.os.android) ? 6 : 32; - - this.loaderMaxParallelDownloads = GetValue(config, 'loader.maxParallelDownloads', defaultParallel); + this.loaderMaxParallelDownloads = GetValue(config, 'loader.maxParallelDownloads', (Device.os.android) ? 6 : 32); /** * @const {(string|undefined)} Phaser.Core.Config#loaderCrossOrigin - 'anonymous', 'use-credentials', or `undefined`. If you're not making cross-origin requests, leave this as `undefined`. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes}. @@ -15893,6 +15962,14 @@ var Config = new Class({ */ this.loaderImageLoadType = GetValue(config, 'loader.imageLoadType', 'XHR'); + // On iOS, Capacitor often runs on a capacitor:// protocol, meaning local files are served from capacitor:// rather than file:// + // See: https://github.com/photonstorm/phaser/issues/5685 + + /** + * @const {string[]} Phaser.Core.Config#loaderLocalScheme - An array of schemes that the Loader considers as being 'local' files. Defaults to: `[ 'file://', 'capacitor://' ]`. + */ + this.loaderLocalScheme = GetValue(config, 'loader.localScheme', [ 'file://', 'capacitor://' ]); + /* * Allows `plugins` property to either be an array, in which case it just replaces * the default plugins like previously, or a config object. @@ -15995,7 +16072,7 @@ module.exports = Config; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -16124,7 +16201,7 @@ module.exports = CreateRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -16255,7 +16332,7 @@ module.exports = DebugHeader; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -16802,6 +16879,22 @@ var Game = new Class({ this.events.emit(Events.PAUSE); }, + /** + * This will pause the entire game and emit a `PAUSE` event. + * + * All of Phaser's internal systems will be paused and the game will not re-render. + * + * Note that it does not pause any Loader requests that are currently in-flight. + * + * @method Phaser.Game#pause + * @fires Phaser.Core.Events#PAUSE + * @since 3.60.0 + */ + pause: function () + { + this.onHidden(); + }, + /** * Called automatically by the Visibility Handler. * This will resume the main loop and then emit a resume event. @@ -16818,6 +16911,20 @@ var Game = new Class({ this.events.emit(Events.RESUME); }, + /** + * This will resume the entire game and emit a `RESUME` event. + * + * All of Phaser's internal systems will be resumed and the game will start rendering again. + * + * @method Phaser.Game#resume + * @fires Phaser.Core.Events#RESUME + * @since 3.60.0 + */ + resume: function () + { + this.onVisible(); + }, + /** * Called automatically by the Visibility Handler. * This will set the main loop into a 'blurred' state, which pauses it. @@ -16959,7 +17066,7 @@ module.exports = Game; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -16974,11 +17081,11 @@ var RequestAnimationFrame = __webpack_require__(27385); * @classdesc * The core runner class that Phaser uses to handle the game loop. It can use either Request Animation Frame, * or SetTimeout, based on browser support and config settings, to create a continuous loop within the browser. - * + * * Each time the loop fires, `TimeStep.step` is called and this is then passed onto the core Game update loop, * it is the core heartbeat of your game. It will fire as often as Request Animation Frame is capable of handling * on the target device. - * + * * Note that there are lots of situations where a browser will stop updating your game. Such as if the player * switches tabs, or covers up the browser window with another application. In these cases, the 'heartbeat' * of your game will pause, and only resume when focus is returned to it by the player. There is no way to avoid @@ -17047,6 +17154,9 @@ var TimeStep = new Class({ /** * The minimum fps rate you want the Time Step to run at. * + * Setting this cannot guarantee the browser runs at this rate, it merely influences + * the internal timing values to help the Timestep know when it has gone out of sync. + * * @name Phaser.Core.TimeStep#minFps * @type {number} * @default 5 @@ -17069,7 +17179,57 @@ var TimeStep = new Class({ this.targetFps = GetValue(config, 'target', 60); /** - * The minFps value in ms. + * Enforce a frame rate limit. This forces how often the Game step will run. By default it is zero, + * which means it will run at whatever limit the browser (via RequestAnimationFrame) can handle, which + * is the optimum rate for fast-action or responsive games. + * + * However, if you are building a non-game app, like a graphics generator, or low-intensity game that doesn't + * require 60fps, then you can lower the step rate via this Game Config value: + * + * ```js + * fps: { + * limit: 30 + * } + * ``` + * + * Setting this _beyond_ the rate of RequestAnimationFrame will make no difference at all. + * + * Use it purely to _restrict_ updates in low-intensity situations only. + * + * @name Phaser.Core.TimeStep#fpsLimit + * @type {number} + * @default 0 + * @since 3.60.0 + */ + this.fpsLimit = GetValue(config, 'limit', 0); + + /** + * Is the FPS rate limited? + * + * This is set by setting the Game Config `limit` value to a value above zero. + * + * Consider this property as read-only. + * + * @name Phaser.Core.TimeStep#hasFpsLimit + * @type {boolean} + * @default false + * @since 3.60.0 + */ + this.hasFpsLimit = (this.fpsLimit > 0); + + /** + * Internal value holding the fps rate limit in ms. + * + * @name Phaser.Core.TimeStep#_limitRate + * @type {number} + * @private + * @since 3.60.0 + */ + this._limitRate = (this.hasFpsLimit) ? (1000 / this.fpsLimit) : 0; + + /** + * The minimum fps value in ms. + * * Defaults to 200ms between frames (i.e. super slow!) * * @name Phaser.Core.TimeStep#_min @@ -17080,7 +17240,8 @@ var TimeStep = new Class({ this._min = 1000 / this.minFps; /** - * The targetFps value in ms. + * The target fps value in ms. + * * Defaults to 16.66ms between frames (i.e. normal) * * @name Phaser.Core.TimeStep#_target @@ -17103,6 +17264,7 @@ var TimeStep = new Class({ /** * The time at which the next fps rate update will take place. + * * When an fps update happens, the `framesThisSecond` value is reset. * * @name Phaser.Core.TimeStep#nextFpsUpdate @@ -17125,7 +17287,7 @@ var TimeStep = new Class({ this.framesThisSecond = 0; /** - * A callback to be invoked each time the Time Step steps. + * A callback to be invoked each time the TimeStep steps. * * @name Phaser.Core.TimeStep#callback * @type {Phaser.Types.Core.TimeStepCallback} @@ -17135,7 +17297,7 @@ var TimeStep = new Class({ this.callback = NOOP; /** - * You can force the Time Step to use Set Timeout instead of Request Animation Frame by setting + * You can force the TimeStep to use SetTimeOut instead of Request Animation Frame by setting * the `forceSetTimeOut` property to `true` in the Game Configuration object. It cannot be changed at run-time. * * @name Phaser.Core.TimeStep#forceSetTimeOut @@ -17147,7 +17309,10 @@ var TimeStep = new Class({ this.forceSetTimeOut = GetValue(config, 'forceSetTimeOut', false); /** - * The time, calculated at the start of the current step, as smoothed by the delta value. + * The time, updated each step by adding the elapsed delta time to the previous value. + * + * This differs from the `TimeStep.now` value, which is the high resolution time value + * as provided by Request Animation Frame. * * @name Phaser.Core.TimeStep#time * @type {number} @@ -17157,8 +17322,9 @@ var TimeStep = new Class({ this.time = 0; /** - * The time at which the game started running. This value is adjusted if the game is then - * paused and resumes. + * The time at which the game started running. + * + * This value is adjusted if the game is then paused and resumes. * * @name Phaser.Core.TimeStep#startTime * @type {number} @@ -17168,7 +17334,9 @@ var TimeStep = new Class({ this.startTime = 0; /** - * The time, as returned by `performance.now` of the previous step. + * The time of the previous step. + * + * This is typically a high resolution timer value, as provided by Request Animation Frame. * * @name Phaser.Core.TimeStep#lastTime * @type {number} @@ -17191,6 +17359,7 @@ var TimeStep = new Class({ /** * Is the browser currently considered in focus by the Page Visibility API? + * * This value is set in the `blur` method, which is called automatically by the Game instance. * * @name Phaser.Core.TimeStep#inFocus @@ -17254,7 +17423,7 @@ var TimeStep = new Class({ /** * The maximum number of delta values that are retained in order to calculate a smoothed moving average. - * + * * This can be changed in the Game Config via the `fps.deltaHistory` property. The default is 10. * * @name Phaser.Core.TimeStep#deltaSmoothingMax @@ -17267,7 +17436,7 @@ var TimeStep = new Class({ /** * The number of frames that the cooldown is set to after the browser panics over the FPS rate, usually * as a result of switching tabs and regaining focus. - * + * * This can be changed in the Game Config via the `fps.panicMax` property. The default is 120. * * @name Phaser.Core.TimeStep#panicMax @@ -17279,7 +17448,7 @@ var TimeStep = new Class({ /** * The actual elapsed time in ms between one update and the next. - * + * * Unlike with `delta`, no smoothing, capping, or averaging is applied to this value. * So please be careful when using this value in math calculations. * @@ -17291,7 +17460,10 @@ var TimeStep = new Class({ this.rawDelta = 0; /** - * The time, as returned by `performance.now` at the very start of the current step. + * The time, set at the start of the current step. + * + * This is typically a high resolution timer value, as provided by Request Animation Frame. + * * This can differ from the `time` value in that it isn't calculated based on the delta value. * * @name Phaser.Core.TimeStep#now @@ -17303,9 +17475,9 @@ var TimeStep = new Class({ /** * Apply smoothing to the delta value used within Phasers internal calculations? - * + * * This can be changed in the Game Config via the `fps.smoothStep` property. The default is `true`. - * + * * Smoothing helps settle down the delta values after browser tab switches, or other situations * which could cause significant delta spikes or dips. By default it has been enabled in Phaser 3 * since the first version, but is now exposed under this property (and the corresponding game config @@ -17425,7 +17597,159 @@ var TimeStep = new Class({ this.callback = callback; - this.raf.start(this.step.bind(this), this.forceSetTimeOut, this._target); + var step = (this.hasFpsLimit) ? this.stepLimitFPS.bind(this) : this.step.bind(this); + + this.raf.start(step, this.forceSetTimeOut, this._target); + }, + + /** + * Takes the delta value and smooths it based on the previous frames. + * + * Called automatically as part of the step. + * + * @method Phaser.Core.TimeStep#smoothDelta + * @since 3.60.0 + * + * @param {number} delta - The delta value for this step. + * + * @return {number} The smoothed delta value. + */ + smoothDelta: function (delta) + { + var idx = this.deltaIndex; + var history = this.deltaHistory; + var max = this.deltaSmoothingMax; + + if (this._coolDown > 0 || !this.inFocus) + { + this._coolDown--; + + delta = Math.min(delta, this._target); + } + + if (delta > this._min) + { + // Probably super bad start time or browser tab context loss, + // so use the last 'sane' delta value + + delta = history[idx]; + + // Clamp delta to min (in case history has become corrupted somehow) + delta = Math.min(delta, this._min); + } + + // Smooth out the delta over the previous X frames + + // add the delta to the smoothing array + history[idx] = delta; + + // adjusts the delta history array index based on the smoothing count + // this stops the array growing beyond the size of deltaSmoothingMax + this.deltaIndex++; + + if (this.deltaIndex >= max) + { + this.deltaIndex = 0; + } + + // Loop the history array, adding the delta values together + var avg = 0; + + for (var i = 0; i < max; i++) + { + avg += history[i]; + } + + // Then divide by the array length to get the average delta + avg /= max; + + return avg; + }, + + /** + * Update the estimate of the frame rate, `fps`. Every second, the number + * of frames that occurred in that second are included in an exponential + * moving average of all frames per second, with an alpha of 0.25. This + * means that more recent seconds affect the estimated frame rate more than + * older seconds. + * + * When a browser window is NOT minimized, but is covered up (i.e. you're using + * another app which has spawned a window over the top of the browser), then it + * will start to throttle the raf callback time. It waits for a while, and then + * starts to drop the frame rate at 1 frame per second until it's down to just over 1fps. + * So if the game was running at 60fps, and the player opens a new window, then + * after 60 seconds (+ the 'buffer time') it'll be down to 1fps, so rafin'g at 1Hz. + * + * When they make the game visible again, the frame rate is increased at a rate of + * approx. 8fps, back up to 60fps (or the max it can obtain) + * + * There is no easy way to determine if this drop in frame rate is because the + * browser is throttling raf, or because the game is struggling with performance + * because you're asking it to do too much on the device. + * + * Compute the new exponential moving average with an alpha of 0.25. + * + * @method Phaser.Core.TimeStep#updateFPS + * @since 3.60.0 + * + * @param {number} time - The timestamp passed in from RequestAnimationFrame or setTimeout. + */ + updateFPS: function (time) + { + this.actualFps = 0.25 * this.framesThisSecond + 0.75 * this.actualFps; + this.nextFpsUpdate = time + 1000; + this.framesThisSecond = 0; + }, + + /** + * The main step method with an fps limiter. This is called each time the browser updates, either by Request Animation Frame, + * or by Set Timeout. It is responsible for calculating the delta values, frame totals, cool down history and more. + * You generally should never call this method directly. + * + * @method Phaser.Core.TimeStep#stepLimitFPS + * @since 3.60.0 + * + * @param {number} time - The timestamp passed in from RequestAnimationFrame or setTimeout. + */ + stepLimitFPS: function (time) + { + this.now = time; + + // delta time (time is in ms) + // Math.max because Chrome will sometimes give negative deltas + var delta = Math.max(0, time - this.lastTime); + + this.rawDelta = delta; + + // Real-world timer advance + this.time += this.rawDelta; + + if (this.smoothStep) + { + delta = this.smoothDelta(delta); + } + + // Set as the world delta value (after smoothing, if applied) + this.delta += delta; + + if (time >= this.nextFpsUpdate) + { + this.updateFPS(time); + } + + this.framesThisSecond++; + + if (this.delta >= this._limitRate) + { + this.callback(time, this.delta); + + this.delta = 0; + } + + // Shift time value over + this.lastTime = time; + + this.frame++; }, /** @@ -17435,127 +17759,38 @@ var TimeStep = new Class({ * * @method Phaser.Core.TimeStep#step * @since 3.0.0 + * + * @param {number} time - The timestamp passed in from RequestAnimationFrame or setTimeout. */ - step: function () + step: function (time) { - // Because the timestamp passed in from raf represents the beginning of the main thread frame that we’re currently in, - // not the actual time now, and as we want to compare this time value against Event timeStamps and the like, we need a - // more accurate one: - - var time = window.performance.now(); - this.now = time; - var before = time - this.lastTime; - - if (before < 0) - { - // Because, Chrome. - before = 0; - } - - this.rawDelta = before; - - var idx = this.deltaIndex; - var history = this.deltaHistory; - var max = this.deltaSmoothingMax; - // delta time (time is in ms) - var dt = before; + // Math.max because Chrome will sometimes give negative deltas + var delta = Math.max(0, time - this.lastTime); - // Delta Average - var avg = before; - - // When a browser switches tab, then comes back again, it takes around 10 frames before - // the delta time settles down so we employ a 'cooling down' period before we start - // trusting the delta values again, to avoid spikes flooding through our delta average - - if (this.smoothStep) - { - if (this._coolDown > 0 || !this.inFocus) - { - this._coolDown--; - - dt = Math.min(dt, this._target); - } - - if (dt > this._min) - { - // Probably super bad start time or browser tab context loss, - // so use the last 'sane' dt value - - dt = history[idx]; - - // Clamp delta to min (in case history has become corrupted somehow) - dt = Math.min(dt, this._min); - } - - // Smooth out the delta over the previous X frames - - // add the delta to the smoothing array - history[idx] = dt; - - // adjusts the delta history array index based on the smoothing count - // this stops the array growing beyond the size of deltaSmoothingMax - this.deltaIndex++; - - if (this.deltaIndex > max) - { - this.deltaIndex = 0; - } - - // Loop the history array, adding the delta values together - avg = 0; - - for (var i = 0; i < max; i++) - { - avg += history[i]; - } - - // Then divide by the array length to get the average delta - avg /= max; - } - - // Set as the world delta value - this.delta = avg; + this.rawDelta = delta; // Real-world timer advance this.time += this.rawDelta; - // Update the estimate of the frame rate, `fps`. Every second, the number - // of frames that occurred in that second are included in an exponential - // moving average of all frames per second, with an alpha of 0.25. This - // means that more recent seconds affect the estimated frame rate more than - // older seconds. - // - // When a browser window is NOT minimized, but is covered up (i.e. you're using - // another app which has spawned a window over the top of the browser), then it - // will start to throttle the raf callback time. It waits for a while, and then - // starts to drop the frame rate at 1 frame per second until it's down to just over 1fps. - // So if the game was running at 60fps, and the player opens a new window, then - // after 60 seconds (+ the 'buffer time') it'll be down to 1fps, so rafin'g at 1Hz. - // - // When they make the game visible again, the frame rate is increased at a rate of - // approx. 8fps, back up to 60fps (or the max it can obtain) - // - // There is no easy way to determine if this drop in frame rate is because the - // browser is throttling raf, or because the game is struggling with performance - // because you're asking it to do too much on the device. - - if (time > this.nextFpsUpdate) + if (this.smoothStep) { - // Compute the new exponential moving average with an alpha of 0.25. - this.actualFps = 0.25 * this.framesThisSecond + 0.75 * this.actualFps; - this.nextFpsUpdate = time + 1000; - this.framesThisSecond = 0; + delta = this.smoothDelta(delta); + } + + // Set as the world delta value (after smoothing, if applied) + this.delta = delta; + + if (time >= this.nextFpsUpdate) + { + this.updateFPS(time); } this.framesThisSecond++; - // Interpolation - how far between what is expected and where we are? - var interpolation = avg / this._target; - - this.callback(time, avg, interpolation); + this.callback(time, delta); // Shift time value over this.lastTime = time; @@ -17571,7 +17806,16 @@ var TimeStep = new Class({ */ tick: function () { - this.step(); + var now = window.performance.now(); + + if (this.hasFpsLimit) + { + this.stepLimitFPS(now); + } + else + { + this.step(now); + } }, /** @@ -17601,20 +17845,30 @@ var TimeStep = new Class({ */ wake: function (seamless) { + if (seamless === undefined) { seamless = false; } + + var now = window.performance.now(); + if (this.running) { return; } else if (seamless) { - this.startTime += -this.lastTime + (this.lastTime + window.performance.now()); + this.startTime += -this.lastTime + (this.lastTime + now); } - this.raf.start(this.step.bind(this), this.useRAF); + var step = (this.hasFpsLimit) ? this.stepLimitFPS.bind(this) : this.step.bind(this); + + this.raf.start(step, this.forceSetTimeOut, this._target); this.running = true; - this.step(); + this.nextFpsUpdate = now + 1000; + this.framesThisSecond = 0; + this.fpsLimitTriggered = false; + + this.tick(); }, /** @@ -17672,10 +17926,11 @@ var TimeStep = new Class({ { this.stop(); - this.callback = NOOP; + this.raf.destroy(); this.raf = null; this.game = null; + this.callback = null; } }); @@ -17690,7 +17945,7 @@ module.exports = TimeStep; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -17782,7 +18037,7 @@ module.exports = VisibilityHandler; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -17806,7 +18061,7 @@ module.exports = 'blur'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -17829,7 +18084,7 @@ module.exports = 'boot'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -17853,7 +18108,7 @@ module.exports = 'contextlost'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -17877,7 +18132,7 @@ module.exports = 'contextrestored'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -17901,7 +18156,7 @@ module.exports = 'destroy'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -17924,7 +18179,7 @@ module.exports = 'focus'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -17951,13 +18206,13 @@ module.exports = 'hidden'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Pause Event. - * + * * This event is dispatched when the Game loop enters a paused state, usually as a result of the Visibility Handler. * * @event Phaser.Core.Events#PAUSE @@ -17973,7 +18228,7 @@ module.exports = 'pause'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18000,7 +18255,7 @@ module.exports = 'postrender'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18026,7 +18281,7 @@ module.exports = 'poststep'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18052,7 +18307,7 @@ module.exports = 'prerender'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18078,13 +18333,13 @@ module.exports = 'prestep'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Ready Event. - * + * * This event is dispatched when the Phaser Game instance has finished booting, the Texture Manager is fully ready, * and all local systems are now able to start. * @@ -18101,13 +18356,13 @@ module.exports = 'ready'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Resume Event. - * + * * This event is dispatched when the game loop leaves a paused state and resumes running. * * @event Phaser.Core.Events#RESUME @@ -18123,7 +18378,7 @@ module.exports = 'resume'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18149,7 +18404,7 @@ module.exports = 'step'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18174,7 +18429,7 @@ module.exports = 'visible'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18211,7 +18466,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18238,7 +18493,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18361,7 +18616,7 @@ module.exports = GenerateTexture; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18370,7 +18625,7 @@ module.exports = GenerateTexture; */ module.exports = { - + GenerateTexture: __webpack_require__(52780), Palettes: __webpack_require__(25235) @@ -18384,7 +18639,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18423,7 +18678,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18462,7 +18717,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18501,7 +18756,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18540,7 +18795,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18579,7 +18834,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18605,7 +18860,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18833,7 +19088,7 @@ module.exports = CubicBezierCurve; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -19451,7 +19706,7 @@ module.exports = Curve; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -20076,7 +20331,7 @@ module.exports = EllipseCurve; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -20383,7 +20638,7 @@ module.exports = LineCurve; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -20414,7 +20669,7 @@ var QuadraticBezier = new Class({ function QuadraticBezier (p0, p1, p2) { - Curve.call(this, 'QuadraticBezier'); + Curve.call(this, 'QuadraticBezierCurve'); if (Array.isArray(p0)) { @@ -20601,7 +20856,7 @@ module.exports = QuadraticBezier; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -20827,7 +21082,7 @@ module.exports = SplineCurve; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -20855,7 +21110,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -20995,7 +21250,7 @@ module.exports = MoveTo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -21464,6 +21719,35 @@ var Path = new Class({ return lengths; }, + /** + * Returns the Curve that forms the Path at the given normalized location (between 0 and 1). + * + * @method Phaser.Curves.Path#getCurveAt + * @since 3.60.0 + * + * @param {number} t - The normalized location on the Path, between 0 and 1. + * + * @return {?Phaser.Curves.Curve} The Curve that is part of this Path at a given location, or `null` if no curve was found. + */ + getCurveAt: function (t) + { + var d = t * this.getLength(); + var curveLengths = this.getCurveLengths(); + var i = 0; + + while (i < curveLengths.length) + { + if (curveLengths[i] >= d) + { + return this.curves[i]; + } + + i++; + } + + return null; + }, + /** * Returns the ending point of the Path. * @@ -21885,7 +22169,7 @@ module.exports = Path; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -22593,7 +22877,7 @@ module.exports = DataManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -22721,7 +23005,7 @@ module.exports = DataManagerPlugin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -22754,7 +23038,7 @@ module.exports = 'changedata'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -22785,7 +23069,7 @@ module.exports = 'changedata-'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -22807,7 +23091,7 @@ module.exports = 'destroy'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -22836,7 +23120,7 @@ module.exports = 'removedata'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -22865,7 +23149,7 @@ module.exports = 'setdata'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -22891,7 +23175,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -22915,7 +23199,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -22933,6 +23217,8 @@ var Browser = __webpack_require__(1350); * @property {boolean} audioData - Can this device play HTML Audio tags? * @property {boolean} dolby - Can this device play EC-3 Dolby Digital Plus files? * @property {boolean} m4a - Can this device can play m4a files. + * @property {boolean} aac - Can this device can play aac files. + * @property {boolean} flac - Can this device can play flac files. * @property {boolean} mp3 - Can this device play mp3 files? * @property {boolean} ogg - Can this device play ogg files? * @property {boolean} opus - Can this device play opus files? @@ -22942,6 +23228,8 @@ var Browser = __webpack_require__(1350); */ var Audio = { + flac: false, + aac: false, audioData: false, dolby: false, m4a: false, @@ -22966,46 +23254,39 @@ function init () Audio.webAudio = !!(window['AudioContext'] || window['webkitAudioContext']); var audioElement = document.createElement('audio'); - var result = !!audioElement.canPlayType; try { if (result) { - if (audioElement.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, '')) + var CanPlay = function (type1, type2) { - Audio.ogg = true; - } + var canPlayType1 = audioElement.canPlayType('audio/' + type1).replace(/^no$/, ''); - if (audioElement.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/, '') || audioElement.canPlayType('audio/opus;').replace(/^no$/, '')) - { - Audio.opus = true; - } + if (type2) + { + return Boolean(canPlayType1 || audioElement.canPlayType('audio/' + type2).replace(/^no$/, '')); + } + else + { + return Boolean(canPlayType1); + } + }; - if (audioElement.canPlayType('audio/mpeg;').replace(/^no$/, '')) - { - Audio.mp3 = true; - } - - // Mimetypes accepted: + // wav Mimetypes accepted: // developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements - if (audioElement.canPlayType('audio/wav').replace(/^no$/, '')) - { - Audio.wav = true; - } - if (audioElement.canPlayType('audio/x-m4a;') || audioElement.canPlayType('audio/aac;').replace(/^no$/, '')) - { - Audio.m4a = true; - } + Audio.ogg = CanPlay('ogg; codecs="vorbis"'); + Audio.opus = CanPlay('ogg; codecs="opus"', 'opus'); + Audio.mp3 = CanPlay('mpeg'); + Audio.wav = CanPlay('wav'); + Audio.m4a = CanPlay('x-m4a'); + Audio.aac = CanPlay('aac'); + Audio.flac = CanPlay('flac', 'x-flac'); + Audio.webm = CanPlay('webm; codecs="vorbis"'); - if (audioElement.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/, '')) - { - Audio.webm = true; - } - - if (audioElement.canPlayType('audio/mp4;codecs="ec-3"') !== '') + if (audioElement.canPlayType('audio/mp4; codecs="ec-3"') !== '') { if (Browser.edge) { @@ -23045,7 +23326,7 @@ module.exports = init(); /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -23156,7 +23437,7 @@ module.exports = init(); /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -23194,8 +23475,8 @@ function checkBlendMode () yellow.onload = function () { - var canvas = CanvasPool.create(yellow, 6, 1); - var context = canvas.getContext('2d'); + var canvas = CanvasPool.create2D(yellow, 6); + var context = canvas.getContext('2d', { willReadFrequently: true }); context.globalCompositeOperation = 'multiply'; @@ -23224,8 +23505,8 @@ function checkBlendMode () function checkInverseAlpha () { - var canvas = CanvasPool.create(this, 2, 1); - var context = canvas.getContext('2d'); + var canvas = CanvasPool.create2D(this, 2); + var context = canvas.getContext('2d', { willReadFrequently: true }); context.fillStyle = 'rgba(10, 20, 30, 0.5)'; @@ -23246,8 +23527,12 @@ function checkInverseAlpha () // Get those values var s2 = context.getImageData(1, 0, 1, 1); + var result = (s2.data[0] === s1.data[0] && s2.data[1] === s1.data[1] && s2.data[2] === s1.data[2] && s2.data[3] === s1.data[3]); + + CanvasPool.remove(this); + // Compare and return - return (s2.data[0] === s1.data[0] && s2.data[1] === s1.data[1] && s2.data[2] === s1.data[2] && s2.data[3] === s1.data[3]); + return result; } function init () @@ -23271,7 +23556,7 @@ module.exports = init(); /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -23469,7 +23754,7 @@ module.exports = init(); /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -23579,7 +23864,7 @@ module.exports = init(); /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -23660,7 +23945,7 @@ module.exports = init(); /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -23853,7 +24138,7 @@ module.exports = init(); /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -23871,6 +24156,7 @@ module.exports = init(); * @property {boolean} h264 - Can this device play h264 mp4 video files? * @property {boolean} hls - Can this device play hls video files? * @property {boolean} mp4 - Can this device play h264 mp4 video files? + * @property {boolean} m4v - Can this device play m4v (typically mp4) video files? * @property {boolean} ogg - Can this device play ogg video files? * @property {boolean} vp9 - Can this device play vp9 video files? * @property {boolean} webm - Can this device play webm video files? @@ -23880,6 +24166,7 @@ var Video = { h264: false, hls: false, mp4: false, + m4v: false, ogg: false, vp9: false, webm: false @@ -23895,34 +24182,40 @@ function init () var videoElement = document.createElement('video'); var result = !!videoElement.canPlayType; + var no = /^no$/; try { if (result) { - if (videoElement.canPlayType('video/ogg; codecs="theora"').replace(/^no$/, '')) + if (videoElement.canPlayType('video/ogg; codecs="theora"').replace(no, '')) { Video.ogg = true; } - if (videoElement.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/, '')) + if (videoElement.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(no, '')) { // Without QuickTime, this value will be `undefined`. github.com/Modernizr/Modernizr/issues/546 Video.h264 = true; Video.mp4 = true; } - if (videoElement.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/, '')) + if (videoElement.canPlayType('video/x-m4v').replace(no, '')) + { + Video.m4v = true; + } + + if (videoElement.canPlayType('video/webm; codecs="vp8, vorbis"').replace(no, '')) { Video.webm = true; } - if (videoElement.canPlayType('video/webm; codecs="vp9"').replace(/^no$/, '')) + if (videoElement.canPlayType('video/webm; codecs="vp9"').replace(no, '')) { Video.vp9 = true; } - if (videoElement.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/, '')) + if (videoElement.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(no, '')) { Video.hls = true; } @@ -23946,7 +24239,7 @@ module.exports = init(); /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -23994,7 +24287,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -24645,7 +24938,7 @@ module.exports = ColorMatrix; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -24748,7 +25041,7 @@ var RGB = new Class({ { var rgb = this._rgb; - return (rgb.r === red && rgb.g === green && rgb.b === blue); + return (rgb[0] === red && rgb[1] === green && rgb[2] === blue); }, /** @@ -24866,7 +25159,7 @@ module.exports = RGB; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25001,7 +25294,7 @@ module.exports = ALIGN_CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25046,7 +25339,7 @@ module.exports = BottomCenter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25091,7 +25384,7 @@ module.exports = BottomLeft; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25136,7 +25429,7 @@ module.exports = BottomRight; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25179,7 +25472,7 @@ module.exports = Center; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25224,7 +25517,7 @@ module.exports = LeftCenter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25278,7 +25571,7 @@ module.exports = QuickSet; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25323,7 +25616,7 @@ module.exports = RightCenter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25368,7 +25661,7 @@ module.exports = TopCenter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25413,7 +25706,7 @@ module.exports = TopLeft; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25458,7 +25751,7 @@ module.exports = TopRight; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25489,7 +25782,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25520,7 +25813,7 @@ module.exports = Align; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25565,7 +25858,7 @@ module.exports = BottomCenter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25610,7 +25903,7 @@ module.exports = BottomLeft; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25655,7 +25948,7 @@ module.exports = BottomRight; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25700,7 +25993,7 @@ module.exports = LeftBottom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25745,7 +26038,7 @@ module.exports = LeftCenter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25790,7 +26083,7 @@ module.exports = LeftTop; /** * @author samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25843,7 +26136,7 @@ module.exports = QuickSet; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25888,7 +26181,7 @@ module.exports = RightBottom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25933,7 +26226,7 @@ module.exports = RightCenter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25978,7 +26271,7 @@ module.exports = RightTop; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26023,7 +26316,7 @@ module.exports = TopCenter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26068,7 +26361,7 @@ module.exports = TopLeft; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26113,7 +26406,7 @@ module.exports = TopRight; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26147,7 +26440,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26185,7 +26478,7 @@ module.exports = CenterOn; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26214,7 +26507,7 @@ module.exports = GetBottom; /** * @author samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26259,7 +26552,7 @@ module.exports = GetBounds; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26288,7 +26581,7 @@ module.exports = GetCenterX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26317,7 +26610,7 @@ module.exports = GetCenterY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26346,7 +26639,7 @@ module.exports = GetLeft; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26377,7 +26670,7 @@ module.exports = GetOffsetX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26408,7 +26701,7 @@ module.exports = GetOffsetY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26437,7 +26730,7 @@ module.exports = GetRight; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26466,7 +26759,7 @@ module.exports = GetTop; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26500,7 +26793,7 @@ module.exports = SetBottom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26536,7 +26829,7 @@ module.exports = SetCenterX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26572,7 +26865,7 @@ module.exports = SetCenterY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26606,7 +26899,7 @@ module.exports = SetLeft; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26640,7 +26933,7 @@ module.exports = SetRight; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26674,7 +26967,7 @@ module.exports = SetTop; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26711,7 +27004,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26775,7 +27068,7 @@ module.exports = CanvasInterpolation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26790,7 +27083,7 @@ var _disableContextSmoothing = false; /** * The CanvasPool is a global static object, that allows Phaser to recycle and pool 2D Context Canvas DOM elements. - * It does not pool WebGL Contexts, because once the context options are set they cannot be modified again, + * It does not pool WebGL Contexts, because once the context options are set they cannot be modified again, * which is useless for some of the Phaser pipelines / renderer. * * This singleton is instantiated as soon as Phaser loads, before a Phaser.Game instance has even been created. @@ -27037,7 +27330,7 @@ module.exports = CanvasPool(); /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -27170,7 +27463,7 @@ module.exports = Smoothing(); /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -27206,7 +27499,7 @@ module.exports = TouchAction; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -27254,7 +27547,7 @@ module.exports = UserSelect; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -27269,7 +27562,7 @@ module.exports = { Smoothing: __webpack_require__(8213), TouchAction: __webpack_require__(59271), UserSelect: __webpack_require__(36505) - + }; @@ -27280,7 +27573,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28144,7 +28437,7 @@ module.exports = Color; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28242,7 +28535,7 @@ module.exports = ColorSpectrum; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28283,7 +28576,7 @@ module.exports = ColorToRGBA; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28314,7 +28607,7 @@ module.exports = ComponentToHex; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28345,7 +28638,7 @@ module.exports = GetColor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28377,7 +28670,7 @@ module.exports = GetColor32; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28428,14 +28721,14 @@ module.exports = HSLToColor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var HSVToRGB = __webpack_require__(24650); /** - * Get HSV color wheel values in an array which will be 360 elements in size. + * Generates an HSV color wheel which is an array of 360 Color objects, for each step of the wheel. * * @function Phaser.Display.Color.HSVColorWheel * @since 3.0.0 @@ -28443,7 +28736,7 @@ var HSVToRGB = __webpack_require__(24650); * @param {number} [s=1] - The saturation, in the range 0 - 1. * @param {number} [v=1] - The value, in the range 0 - 1. * - * @return {Phaser.Types.Display.ColorObject[]} An array containing 360 elements, where each contains a single numeric value corresponding to the color at that point in the HSV color wheel. + * @return {Phaser.Types.Display.ColorObject[]} An array containing 360 ColorObject elements, where each element contains a Color object corresponding to the color at that point in the HSV color wheel. */ var HSVColorWheel = function (s, v) { @@ -28470,7 +28763,7 @@ module.exports = HSVColorWheel; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28552,7 +28845,7 @@ module.exports = HSVToRGB; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28606,7 +28899,7 @@ module.exports = HexStringToColor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28663,7 +28956,7 @@ module.exports = HueToComponent; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28697,7 +28990,7 @@ module.exports = IntegerToColor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28746,7 +29039,7 @@ module.exports = IntegerToRGB; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28855,7 +29148,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28886,7 +29179,7 @@ module.exports = ObjectToColor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28933,7 +29226,7 @@ module.exports = RGBStringToColor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -29014,7 +29307,7 @@ module.exports = RGBToHSV; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -29059,7 +29352,7 @@ module.exports = RGBToString; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -29096,7 +29389,7 @@ module.exports = RandomRGB; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -29153,7 +29446,7 @@ module.exports = ValueToColor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -29189,7 +29482,7 @@ module.exports = Color; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -29218,7 +29511,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -29553,7 +29846,7 @@ module.exports = BitmapMask; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -29874,7 +30167,7 @@ module.exports = GeometryMask; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -29897,7 +30190,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30024,7 +30317,7 @@ module.exports = BaseShader; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30083,7 +30376,7 @@ module.exports = AddToDOM; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30128,7 +30421,7 @@ module.exports = CreateDOMContainer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30192,7 +30485,7 @@ module.exports = DOMContentLoaded; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30218,7 +30511,7 @@ var GetInnerHeight = function (iOS) var axis = Math.abs(window.orientation); var size = { w: 0, h: 0 }; - + var ruler = document.createElement('div'); ruler.setAttribute('style', 'position: fixed; height: 100vh; width: 0; top: 0'); @@ -30252,7 +30545,7 @@ module.exports = GetInnerHeight; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30318,7 +30611,7 @@ module.exports = GetScreenOrientation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30370,7 +30663,7 @@ module.exports = GetTarget; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30428,7 +30721,7 @@ module.exports = ParseXML; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30458,7 +30751,7 @@ module.exports = RemoveFromDOM; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30468,6 +30761,7 @@ var NOOP = __webpack_require__(72283); /** * @classdesc * Abstracts away the use of RAF or setTimeOut for the core game update loop. + * * This is invoked automatically by the Phaser.Game instance. * * @class RequestAnimationFrame @@ -30500,16 +30794,6 @@ var RequestAnimationFrame = new Class({ */ this.callback = NOOP; - /** - * The most recent timestamp. Either a DOMHighResTimeStamp under RAF or `Date.now` under SetTimeout. - * - * @name Phaser.DOM.RequestAnimationFrame#tick - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.tick = 0; - /** * True if the step is using setTimeout instead of RAF. * @@ -30531,54 +30815,42 @@ var RequestAnimationFrame = new Class({ this.timeOutID = null; /** - * The previous time the step was called. + * The delay rate in ms for setTimeOut. * - * @name Phaser.DOM.RequestAnimationFrame#lastTime + * @name Phaser.DOM.RequestAnimationFrame#delay * @type {number} * @default 0 - * @since 3.0.0 + * @since 3.60.0 */ - this.lastTime = 0; - - /** - * The target FPS rate in ms. - * Only used when setTimeout is used instead of RAF. - * - * @name Phaser.DOM.RequestAnimationFrame#target - * @type {number} - * @default 0 - * @since 3.21.0 - */ - this.target = 0; + this.delay = 0; var _this = this; /** * The RAF step function. - * Updates the local tick value, invokes the callback and schedules another call to requestAnimationFrame. + * + * Invokes the callback and schedules another call to requestAnimationFrame. * * @name Phaser.DOM.RequestAnimationFrame#step * @type {FrameRequestCallback} * @since 3.0.0 + * + * @param {number} time - The timestamp passed in from RequestAnimationFrame. */ - this.step = function step () + this.step = function step (time) { - // Because we cannot trust the time passed to this callback from the browser and need it kept in sync with event times - var timestamp = window.performance.now(); + _this.callback(time); - // DOMHighResTimeStamp - _this.lastTime = _this.tick; - - _this.tick = timestamp; - - _this.callback(timestamp); - - _this.timeOutID = window.requestAnimationFrame(step); + if (_this.isRunning) + { + _this.timeOutID = window.requestAnimationFrame(step); + } }; /** * The SetTimeout step function. - * Updates the local tick value, invokes the callback and schedules another call to setTimeout. + * + * Invokes the callback and schedules another call to setTimeout. * * @name Phaser.DOM.RequestAnimationFrame#stepTimeout * @type {function} @@ -30586,17 +30858,13 @@ var RequestAnimationFrame = new Class({ */ this.stepTimeout = function stepTimeout () { - var d = Date.now(); + if (_this.isRunning) + { + // Make the next request before the callback, so that timing is maintained + _this.timeOutID = window.setTimeout(stepTimeout, _this.delay); + } - var delay = Math.min(Math.max(_this.target * 2 + _this.tick - d, 0), _this.target); - - _this.lastTime = _this.tick; - - _this.tick = d; - - _this.callback(d); - - _this.timeOutID = window.setTimeout(stepTimeout, delay); + _this.callback(window.performance.now()); }; }, @@ -30608,9 +30876,9 @@ var RequestAnimationFrame = new Class({ * * @param {FrameRequestCallback} callback - The callback to invoke each step. * @param {boolean} forceSetTimeOut - Should it use SetTimeout, even if RAF is available? - * @param {number} targetFPS - The target fps rate (in ms). Only used when setTimeout is used. + * @param {number} delay - The setTimeout delay rate in ms. */ - start: function (callback, forceSetTimeOut, targetFPS) + start: function (callback, forceSetTimeOut, delay) { if (this.isRunning) { @@ -30621,7 +30889,7 @@ var RequestAnimationFrame = new Class({ this.isSetTimeOut = forceSetTimeOut; - this.target = targetFPS; + this.delay = delay; this.isRunning = true; @@ -30673,7 +30941,7 @@ module.exports = RequestAnimationFrame; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30704,7 +30972,7 @@ module.exports = Dom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30889,7 +31157,7 @@ module.exports = EventEmitter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30907,7 +31175,7 @@ module.exports = { EventEmitter: __webpack_require__(78491) }; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -31036,7 +31304,7 @@ module.exports = BuildGameObject; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -31134,7 +31402,7 @@ module.exports = BuildGameObjectAnimation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -31247,6 +31515,11 @@ var DisplayList = new Class({ gameObject.removeFromDisplayList(); } + if (gameObject.parentContainer) + { + gameObject.parentContainer.remove(gameObject); + } + if (!gameObject.displayList) { this.queueDepthSort(); @@ -31365,15 +31638,11 @@ var DisplayList = new Class({ { var list = this.list; - var i = list.length; - - while (i--) + while (list.length) { - list[i].destroy(true); + list[0].destroy(true); } - list.length = 0; - this.events.off(SceneEvents.SHUTDOWN, this.shutdown, this); }, @@ -31410,7 +31679,7 @@ module.exports = DisplayList; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -31914,10 +32183,7 @@ var GameObject = new Class({ */ disableInteractive: function () { - if (this.input) - { - this.input.enabled = false; - } + this.scene.sys.input.disable(this); return this; }, @@ -32024,7 +32290,9 @@ var GameObject = new Class({ */ willRender: function (camera) { - return !(GameObject.RENDER_MASK !== this.renderFlags || (this.cameraFilter !== 0 && (this.cameraFilter & camera.id))); + var listWillRender = (this.displayList && this.displayList.active) ? this.displayList.willRender(camera) : true; + + return !(!listWillRender || GameObject.RENDER_MASK !== this.renderFlags || (this.cameraFilter !== 0 && (this.cameraFilter & camera.id))); }, /** @@ -32310,7 +32578,7 @@ module.exports = GameObject; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -32514,7 +32782,7 @@ module.exports = GameObjectCreator; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -32748,7 +33016,7 @@ module.exports = GameObjectFactory; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -32820,7 +33088,7 @@ module.exports = GetCalcMatrix; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -33125,7 +33393,7 @@ module.exports = UpdateList; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -33185,7 +33453,7 @@ module.exports = BatchChar; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -33571,7 +33839,7 @@ var GetBitmapTextSize = function (src, round, updateOrigin, out) i: charIndex, char: text[i], code: charCode, - x: (glyph.xOffset + xAdvance) * scale, + x: (glyph.xOffset + x) * scale, y: (glyph.yOffset + yAdvance) * scale, w: glyph.width * scale, h: glyph.height * scale, @@ -33582,7 +33850,7 @@ var GetBitmapTextSize = function (src, round, updateOrigin, out) glyph: glyph }); - xAdvance += glyph.xAdvance + letterSpacing; + xAdvance += glyph.xAdvance + letterSpacing + ((kerningOffset !== undefined) ? kerningOffset : 0); lastGlyph = glyph; lastCharCode = charCode; currentLineWidth = gw * scale; @@ -33708,7 +33976,7 @@ module.exports = GetBitmapTextSize; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -33763,7 +34031,7 @@ module.exports = ParseFromAtlas; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -33896,7 +34164,7 @@ module.exports = ParseRetroFont; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -34058,7 +34326,7 @@ module.exports = ParseXMLBitmapFont; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -34085,7 +34353,7 @@ module.exports = RetroFont; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -34202,7 +34470,7 @@ module.exports = RETRO_FONT_CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -34233,7 +34501,8 @@ var Render = __webpack_require__(88899); * * BMFont (Windows, free): {@link http://www.angelcode.com/products/bmfont/|http://www.angelcode.com/products/bmfont/} * Glyph Designer (OS X, commercial): {@link http://www.71squared.com/en/glyphdesigner|http://www.71squared.com/en/glyphdesigner} - * Littera (Web-based, free): {@link http://kvazars.com/littera/|http://kvazars.com/littera/} + * Snow BMF (Web-based, free): {@link https://snowb.org//|https://snowb.org/} + * Littera (Flash-based, free): {@link http://kvazars.com/littera/|http://kvazars.com/littera/} * * For most use cases it is recommended to use XML. If you wish to use JSON, the formatting should be equal to the result of * converting a valid XML file through the popular X2JS library. An online tool for conversion can be found here: {@link http://codebeautify.org/xmltojson|http://codebeautify.org/xmltojson} @@ -34436,7 +34705,7 @@ module.exports = DynamicBitmapText; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -34609,7 +34878,7 @@ var DynamicBitmapTextCanvasRenderer = function (renderer, src, camera, parentMat x += lineOffsetX; - xAdvance += glyph.xAdvance + letterSpacing; + xAdvance += glyph.xAdvance + letterSpacing + ((kerningOffset !== undefined) ? kerningOffset : 0); lastGlyph = glyph; lastCharCode = charCode; @@ -34651,7 +34920,7 @@ module.exports = DynamicBitmapTextCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -34703,7 +34972,7 @@ GameObjectCreator.register('dynamicBitmapText', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -34773,12 +35042,13 @@ GameObjectFactory.register('dynamicBitmapText', function (x, y, font, text, size /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -34805,7 +35075,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -35094,7 +35364,7 @@ module.exports = DynamicBitmapTextWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -35125,7 +35395,8 @@ var Render = __webpack_require__(84557); * * BMFont (Windows, free): {@link http://www.angelcode.com/products/bmfont/|http://www.angelcode.com/products/bmfont/} * Glyph Designer (OS X, commercial): {@link http://www.71squared.com/en/glyphdesigner|http://www.71squared.com/en/glyphdesigner} - * Littera (Web-based, free): {@link http://kvazars.com/littera/|http://kvazars.com/littera/} + * Snow BMF (Web-based, free): {@link https://snowb.org//|https://snowb.org/} + * Littera (Flash-based, free): {@link http://kvazars.com/littera/|http://kvazars.com/littera/} * * For most use cases it is recommended to use XML. If you wish to use JSON, the formatting should be equal to the result of * converting a valid XML file through the popular X2JS library. An online tool for conversion can be found here: {@link http://codebeautify.org/xmltojson|http://codebeautify.org/xmltojson} @@ -36195,7 +36466,7 @@ module.exports = BitmapText; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -36341,7 +36612,7 @@ var BitmapTextCanvasRenderer = function (renderer, src, camera, parentMatrix) x += lineOffsetX; - xAdvance += glyph.xAdvance + letterSpacing; + xAdvance += glyph.xAdvance + letterSpacing + ((kerningOffset !== undefined) ? kerningOffset : 0); lastGlyph = glyph; lastCharCode = charCode; @@ -36381,7 +36652,7 @@ module.exports = BitmapTextCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -36435,7 +36706,7 @@ GameObjectCreator.register('bitmapText', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -36500,12 +36771,13 @@ GameObjectFactory.register('bitmapText', function (x, y, font, text, size, align /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -36532,7 +36804,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -36672,7 +36944,7 @@ module.exports = BitmapTextWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -36972,7 +37244,7 @@ module.exports = Blitter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -37014,7 +37286,7 @@ var BlitterCanvasRenderer = function (renderer, src, camera, parentMatrix) // Blend Mode + Scale Mode ctx.globalCompositeOperation = renderer.blendModes[src.blendMode]; - ctx.imageSmoothingEnabled = !(!renderer.antialias || src.frame.source.scaleMode); + ctx.imageSmoothingEnabled = !src.frame.source.scaleMode; var cameraScrollX = src.x - camera.scrollX * src.scrollFactorX; var cameraScrollY = src.y - camera.scrollY * src.scrollFactorY; @@ -37057,17 +37329,20 @@ var BlitterCanvasRenderer = function (renderer, src, camera, parentMatrix) dy = Math.round(dy); } - ctx.drawImage( - frame.source.image, - cd.x, - cd.y, - cd.width, - cd.height, - dx + bob.x + cameraScrollX, - dy + bob.y + cameraScrollY, - cd.width, - cd.height - ); + if (cd.width > 0 && cd.height > 0) + { + ctx.drawImage( + frame.source.image, + cd.x, + cd.y, + cd.width, + cd.height, + dx + bob.x + cameraScrollX, + dy + bob.y + cameraScrollY, + cd.width, + cd.height + ); + } } else { @@ -37083,11 +37358,14 @@ var BlitterCanvasRenderer = function (renderer, src, camera, parentMatrix) dy -= cd.height; } - ctx.save(); - ctx.translate(bob.x + cameraScrollX, bob.y + cameraScrollY); - ctx.scale(fx, fy); - ctx.drawImage(frame.source.image, cd.x, cd.y, cd.width, cd.height, dx, dy, cd.width, cd.height); - ctx.restore(); + if (cd.width > 0 && cd.height > 0) + { + ctx.save(); + ctx.translate(bob.x + cameraScrollX, bob.y + cameraScrollY); + ctx.scale(fx, fy); + ctx.drawImage(frame.source.image, cd.x, cd.y, cd.width, cd.height, dx, dy, cd.width, cd.height); + ctx.restore(); + } } } @@ -37104,7 +37382,7 @@ module.exports = BlitterCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -37155,7 +37433,7 @@ GameObjectCreator.register('blitter', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -37198,12 +37476,13 @@ GameObjectFactory.register('blitter', function (x, y, key, frame) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -37230,7 +37509,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -37372,7 +37651,7 @@ module.exports = BlitterWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -37803,7 +38082,7 @@ module.exports = Bob; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -38099,7 +38378,7 @@ module.exports = Alpha; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -38210,7 +38489,7 @@ module.exports = AlphaSingle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -38228,7 +38507,7 @@ var BlendMode = { /** * Private internal value. Holds the current blend mode. - * + * * @name Phaser.GameObjects.Components.BlendMode#_blendMode * @type {number} * @private @@ -38333,14 +38612,14 @@ module.exports = BlendMode; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Provides methods used for calculating and setting the size of a non-Frame based Game Object. * Should be applied as a mixin and not used directly. - * + * * @namespace Phaser.GameObjects.Components.ComputedSize * @since 3.0.0 */ @@ -38349,11 +38628,11 @@ var ComputedSize = { /** * The native (un-scaled) width of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayWidth` property. - * + * * @name Phaser.GameObjects.Components.ComputedSize#width * @type {number} * @since 3.0.0 @@ -38362,11 +38641,11 @@ var ComputedSize = { /** * The native (un-scaled) height of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayHeight` property. - * + * * @name Phaser.GameObjects.Components.ComputedSize#height * @type {number} * @since 3.0.0 @@ -38375,11 +38654,11 @@ var ComputedSize = { /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. - * + * * @name Phaser.GameObjects.Components.ComputedSize#displayWidth * @type {number} * @since 3.0.0 @@ -38400,11 +38679,11 @@ var ComputedSize = { /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. - * + * * @name Phaser.GameObjects.Components.ComputedSize#displayHeight * @type {number} * @since 3.0.0 @@ -38425,21 +38704,21 @@ var ComputedSize = { /** * Sets the internal size of this Game Object, as used for frame or physics body creation. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. - * + * * @method Phaser.GameObjects.Components.ComputedSize#setSize * @since 3.4.0 * * @param {number} width - The width of this Game Object. * @param {number} height - The height of this Game Object. - * + * * @return {this} This Game Object instance. */ setSize: function (width, height) @@ -38452,15 +38731,15 @@ var ComputedSize = { /** * Sets the display size of this Game Object. - * + * * Calling this will adjust the scale. - * + * * @method Phaser.GameObjects.Components.ComputedSize#setDisplaySize * @since 3.4.0 * * @param {number} width - The width of this Game Object. * @param {number} height - The height of this Game Object. - * + * * @return {this} This Game Object instance. */ setDisplaySize: function (width, height) @@ -38483,7 +38762,7 @@ module.exports = ComputedSize; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -38527,24 +38806,24 @@ var Crop = { /** * Applies a crop to a texture based Game Object, such as a Sprite or Image. - * + * * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. - * + * * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just * changes what is shown when rendered. - * + * * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. - * + * * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left * half of it, you could call `setCrop(0, 0, 400, 600)`. - * + * * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop * an area of 200x100 when applied to a Game Object that had a scale factor of 2. - * + * * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. - * + * * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. - * + * * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow * the renderer to skip several internal calculations. * @@ -38589,7 +38868,7 @@ var Crop = { * @method Phaser.GameObjects.Components.Crop#resetCropObject * @private * @since 3.12.0 - * + * * @return {object} The crop object. */ resetCropObject: function () @@ -38609,7 +38888,7 @@ module.exports = Crop; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -38635,7 +38914,7 @@ var Depth = { _depth: 0, /** - * The depth of this Game Object within the Scene. + * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. @@ -38682,7 +38961,7 @@ var Depth = { * @method Phaser.GameObjects.Components.Depth#setDepth * @since 3.0.0 * - * @param {number} value - The depth of this Game Object. + * @param {number} value - The depth of this Game Object. Ensure this value is only ever a number data-type. * * @return {this} This Game Object instance. */ @@ -38707,7 +38986,7 @@ module.exports = Depth; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -38727,7 +39006,7 @@ var FX = { * when it is being rendered by a SpriteFX Pipeline. * * Lots of FX require additional spacing added to the texture the - * Game Object uses, for example a glow or shaddow effect, and this + * Game Object uses, for example a glow or shadow effect, and this * method allows you to control how much extra padding is included * in addition to the texture size. * @@ -38743,7 +39022,7 @@ var FX = { * when it is being rendered by a SpriteFX Pipeline. * * Lots of FX require additional spacing added to the texture the - * Game Object uses, for example a glow or shaddow effect, and this + * Game Object uses, for example a glow or shadow effect, and this * method allows you to control how much extra padding is included * in addition to the texture size. * @@ -38810,14 +39089,14 @@ module.exports = FX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Provides methods used for visually flipping a Game Object. * Should be applied as a mixin and not used directly. - * + * * @namespace Phaser.GameObjects.Components.Flip * @since 3.0.0 */ @@ -38826,11 +39105,11 @@ var Flip = { /** * The horizontally flipped state of the Game Object. - * + * * A Game Object that is flipped horizontally will render inversed on the horizontal axis. * Flipping always takes place from the middle of the texture and does not impact the scale value. * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * + * * @name Phaser.GameObjects.Components.Flip#flipX * @type {boolean} * @default false @@ -38840,11 +39119,11 @@ var Flip = { /** * The vertically flipped state of the Game Object. - * + * * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) * Flipping always takes place from the middle of the texture and does not impact the scale value. * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * + * * @name Phaser.GameObjects.Components.Flip#flipY * @type {boolean} * @default false @@ -38854,14 +39133,14 @@ var Flip = { /** * Toggles the horizontal flipped state of this Game Object. - * + * * A Game Object that is flipped horizontally will render inversed on the horizontal axis. * Flipping always takes place from the middle of the texture and does not impact the scale value. * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * + * * @method Phaser.GameObjects.Components.Flip#toggleFlipX * @since 3.0.0 - * + * * @return {this} This Game Object instance. */ toggleFlipX: function () @@ -38873,10 +39152,10 @@ var Flip = { /** * Toggles the vertical flipped state of this Game Object. - * + * * @method Phaser.GameObjects.Components.Flip#toggleFlipY * @since 3.0.0 - * + * * @return {this} This Game Object instance. */ toggleFlipY: function () @@ -38888,16 +39167,16 @@ var Flip = { /** * Sets the horizontal flipped state of this Game Object. - * + * * A Game Object that is flipped horizontally will render inversed on the horizontal axis. * Flipping always takes place from the middle of the texture and does not impact the scale value. * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * + * * @method Phaser.GameObjects.Components.Flip#setFlipX * @since 3.0.0 * * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped. - * + * * @return {this} This Game Object instance. */ setFlipX: function (value) @@ -38909,12 +39188,12 @@ var Flip = { /** * Sets the vertical flipped state of this Game Object. - * + * * @method Phaser.GameObjects.Components.Flip#setFlipY * @since 3.0.0 * * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped. - * + * * @return {this} This Game Object instance. */ setFlipY: function (value) @@ -38926,17 +39205,17 @@ var Flip = { /** * Sets the horizontal and vertical flipped state of this Game Object. - * + * * A Game Object that is flipped will render inversed on the flipped axis. * Flipping always takes place from the middle of the texture and does not impact the scale value. * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * + * * @method Phaser.GameObjects.Components.Flip#setFlip * @since 3.0.0 * * @param {boolean} x - The horizontal flipped state. `false` for no flip, or `true` to be flipped. * @param {boolean} y - The horizontal flipped state. `false` for no flip, or `true` to be flipped. - * + * * @return {this} This Game Object instance. */ setFlip: function (x, y) @@ -38949,7 +39228,7 @@ var Flip = { /** * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. - * + * * @method Phaser.GameObjects.Components.Flip#resetFlip * @since 3.0.0 * @@ -38975,7 +39254,7 @@ module.exports = Flip; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -39262,7 +39541,7 @@ var GetBounds = { var TLx, TLy, TRx, TRy, BLx, BLy, BRx, BRy; - // Instead of doing a check if parent container is + // Instead of doing a check if parent container is // defined per corner we only do it once. if (this.parentContainer) { @@ -39335,7 +39614,7 @@ module.exports = GetBounds; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -39458,13 +39737,13 @@ var Mask = { * @method Phaser.GameObjects.Components.Mask#createGeometryMask * @since 3.6.2 * - * @param {Phaser.GameObjects.Graphics} [graphics] - A Graphics Game Object. The geometry within it will be used as the mask. + * @param {Phaser.GameObjects.Graphics|Phaser.GameObjects.Shape} [graphics] - A Graphics Game Object, or any kind of Shape Game Object. The geometry within it will be used as the mask. * * @return {Phaser.Display.Masks.GeometryMask} This Geometry Mask that was created. */ createGeometryMask: function (graphics) { - if (graphics === undefined && this.type === 'Graphics') + if (graphics === undefined && (this instanceof Phaser.GameObjects.Graphics || this instanceof Phaser.GameObjects.Shape)) { // eslint-disable-next-line consistent-this graphics = this; @@ -39485,7 +39764,7 @@ module.exports = Mask; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -39689,7 +39968,7 @@ module.exports = Origin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -40056,7 +40335,7 @@ var PathFollower = { if (tweenData.state === TWEEN_CONST.COMPLETE) { - this.path.getPoint(1, pathVector); + this.path.getPoint(tweenData.end, pathVector); pathDelta.add(pathVector); pathVector.add(this.pathOffset); @@ -40117,7 +40396,7 @@ module.exports = PathFollower; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -40299,7 +40578,7 @@ var Pipeline = { * If you call this method multiple times, the new pipelines will be appended to any existing * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. * - * You can optionally also sets the `pipelineData` property, if the parameter is given. + * You can optionally also set the `pipelineData` property, if the parameter is given. * * Both the pipeline and post pipelines share the pipeline data object together. * @@ -40541,7 +40820,7 @@ module.exports = Pipeline; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -40565,7 +40844,7 @@ var ScrollFactor = { * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. - * + * * Please be aware that scroll factor values other than 1 are not taken in to consideration when * calculating physics collisions. Bodies always collide based on their world position, but changing * the scroll factor is a visual adjustment to where the textures are rendered, which can offset @@ -40589,7 +40868,7 @@ var ScrollFactor = { * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. - * + * * Please be aware that scroll factor values other than 1 are not taken in to consideration when * calculating physics collisions. Bodies always collide based on their world position, but changing * the scroll factor is a visual adjustment to where the textures are rendered, which can offset @@ -40613,7 +40892,7 @@ var ScrollFactor = { * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. - * + * * Please be aware that scroll factor values other than 1 are not taken in to consideration when * calculating physics collisions. Bodies always collide based on their world position, but changing * the scroll factor is a visual adjustment to where the textures are rendered, which can offset @@ -40649,13 +40928,13 @@ module.exports = ScrollFactor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Provides methods used for getting and setting the size of a Game Object. - * + * * @namespace Phaser.GameObjects.Components.Size * @since 3.0.0 */ @@ -40664,7 +40943,7 @@ var Size = { /** * A property indicating that a Game Object has this component. - * + * * @name Phaser.GameObjects.Components.Size#_sizeComponent * @type {boolean} * @private @@ -40675,11 +40954,11 @@ var Size = { /** * The native (un-scaled) width of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayWidth` property. - * + * * @name Phaser.GameObjects.Components.Size#width * @type {number} * @since 3.0.0 @@ -40688,11 +40967,11 @@ var Size = { /** * The native (un-scaled) height of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayHeight` property. - * + * * @name Phaser.GameObjects.Components.Size#height * @type {number} * @since 3.0.0 @@ -40701,11 +40980,11 @@ var Size = { /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. - * + * * @name Phaser.GameObjects.Components.Size#displayWidth * @type {number} * @since 3.0.0 @@ -40726,11 +41005,11 @@ var Size = { /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. - * + * * @name Phaser.GameObjects.Components.Size#displayHeight * @type {number} * @since 3.0.0 @@ -40751,20 +41030,20 @@ var Size = { /** * Sets the size of this Game Object to be that of the given Frame. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. - * + * * @method Phaser.GameObjects.Components.Size#setSizeToFrame * @since 3.0.0 * * @param {Phaser.Textures.Frame} frame - The frame to base the size of this Game Object on. - * + * * @return {this} This Game Object instance. */ setSizeToFrame: function (frame) @@ -40774,26 +41053,34 @@ var Size = { this.width = frame.realWidth; this.height = frame.realHeight; + var input = this.input; + + if (input && !input.customHitArea) + { + input.hitArea.width = this.width; + input.hitArea.height = this.height; + } + return this; }, /** * Sets the internal size of this Game Object, as used for frame or physics body creation. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. - * + * * @method Phaser.GameObjects.Components.Size#setSize * @since 3.0.0 * * @param {number} width - The width of this Game Object. * @param {number} height - The height of this Game Object. - * + * * @return {this} This Game Object instance. */ setSize: function (width, height) @@ -40806,15 +41093,15 @@ var Size = { /** * Sets the display size of this Game Object. - * + * * Calling this will adjust the scale. - * + * * @method Phaser.GameObjects.Components.Size#setDisplaySize * @since 3.0.0 * * @param {number} width - The width of this Game Object. * @param {number} height - The height of this Game Object. - * + * * @return {this} This Game Object instance. */ setDisplaySize: function (width, height) @@ -40837,7 +41124,7 @@ module.exports = Size; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -40968,7 +41255,7 @@ module.exports = Texture; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -41177,7 +41464,7 @@ module.exports = TextureCrop; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -41415,7 +41702,7 @@ module.exports = Tint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -41477,7 +41764,7 @@ module.exports = ToJSON; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -41500,6 +41787,17 @@ var _FLAG = 4; // 0100 var Transform = { + /** + * A property indicating that a Game Object has this component. + * + * @name Phaser.GameObjects.Components.Transform#hasTransformComponent + * @type {boolean} + * @readonly + * @default true + * @since 3.60.0 + */ + hasTransformComponent: true, + /** * Private internal value. Holds the horizontal scale value. * @@ -42089,7 +42387,7 @@ module.exports = Transform; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -42644,16 +42942,16 @@ var TransformMatrix = new Class({ }, /** - * Transform a point using this Matrix. + * Transform a point in to the local space of this Matrix. * * @method Phaser.GameObjects.Components.TransformMatrix#transformPoint * @since 3.0.0 * * @param {number} x - The x coordinate of the point to transform. * @param {number} y - The y coordinate of the point to transform. - * @param {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} point - The Point object to store the transformed coordinates. + * @param {Phaser.Types.Math.Vector2Like} [point] - Optional Point object to store the transformed coordinates in. * - * @return {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} The Point containing the transformed coordinates. + * @return {Phaser.Types.Math.Vector2Like} The Point containing the transformed coordinates. */ transformPoint: function (x, y, point) { @@ -43110,7 +43408,7 @@ module.exports = TransformMatrix; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -43120,7 +43418,7 @@ var _FLAG = 1; // 0001 /** * Provides methods used for setting the visibility of a Game Object. * Should be applied as a mixin and not used directly. - * + * * @namespace Phaser.GameObjects.Components.Visible * @since 3.0.0 */ @@ -43129,7 +43427,7 @@ var Visible = { /** * Private internal value. Holds the visible value. - * + * * @name Phaser.GameObjects.Components.Visible#_visible * @type {boolean} * @private @@ -43140,9 +43438,9 @@ var Visible = { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. - * + * * @name Phaser.GameObjects.Components.Visible#visible * @type {boolean} * @since 3.0.0 @@ -43172,14 +43470,14 @@ var Visible = { /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * * @method Phaser.GameObjects.Components.Visible#setVisible * @since 3.0.0 * * @param {boolean} value - The visible state of the Game Object. - * + * * @return {this} This Game Object instance. */ setVisible: function (value) @@ -43200,7 +43498,7 @@ module.exports = Visible; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -43244,7 +43542,7 @@ module.exports = { /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -43692,9 +43990,11 @@ var Container = new Class({ gameObject.parentContainer.remove(gameObject); } + gameObject.parentContainer = this; + gameObject.removeFromDisplayList(); - gameObject.parentContainer = this; + gameObject.addedToScene(); } }, @@ -43709,12 +44009,14 @@ var Container = new Class({ */ removeHandler: function (gameObject) { - gameObject.off(Events.DESTROY, this.remove); + gameObject.off(Events.DESTROY, this.remove, this); if (this.exclusive) { gameObject.parentContainer = null; + gameObject.removedFromScene(); + gameObject.addToDisplayList(); } }, @@ -43741,7 +44043,8 @@ var Container = new Class({ } else { - output = new Vector2(source.x, source.y); + output.x = source.x; + output.y = source.y; } var tempMatrix = this.tempTransformMatrix; @@ -44169,14 +44472,25 @@ var Container = new Class({ */ removeAll: function (destroyChild) { - var removed = ArrayUtils.RemoveBetween(this.list, 0, this.list.length, this.removeHandler, this); + var list = this.list; if (destroyChild) { - for (var i = 0; i < removed.length; i++) + for (var i = 0; i < list.length; i++) { - removed[i].destroy(); + if (list[i] && list[i].scene) + { + list[i].off(Events.DESTROY, this.remove, this); + + list[i].destroy(); + } } + + this.list = []; + } + else + { + ArrayUtils.RemoveBetween(list, 0, list.length, this.removeHandler, this); } return this; @@ -44639,7 +44953,7 @@ module.exports = Container; /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -44748,7 +45062,7 @@ module.exports = ContainerCanvasRenderer; /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -44799,7 +45113,7 @@ GameObjectCreator.register('container', function (config, addToScene) /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -44834,12 +45148,13 @@ GameObjectFactory.register('container', function (x, y, children) /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -44867,7 +45182,7 @@ module.exports = { /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -44990,7 +45305,7 @@ var ContainerWebGLRenderer = function (renderer, container, camera, parentMatrix child.setAlpha(childAlphaTopLeft * alpha, childAlphaTopRight * alpha, childAlphaBottomLeft * alpha, childAlphaBottomRight * alpha); // Render - child.renderWebGL(renderer, child, camera, transformMatrix); + child.renderWebGL(renderer, child, camera, transformMatrix, container); // Restore original values @@ -45019,7 +45334,7 @@ module.exports = ContainerWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -45062,7 +45377,7 @@ module.exports = [ /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -46058,7 +46373,7 @@ module.exports = DOMElement; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -46186,7 +46501,7 @@ module.exports = DOMElementCSSRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -46276,12 +46591,13 @@ GameObjectFactory.register('dom', function (x, y, element, style, innerText) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -46308,7 +46624,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -46335,7 +46651,7 @@ module.exports = 'addedtoscene'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -46362,7 +46678,7 @@ module.exports = 'destroy'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -46389,27 +46705,27 @@ module.exports = 'removedfromscene'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Video Game Object Complete Event. - * + * * This event is dispatched when a Video finishes playback by reaching the end of its duration. It * is also dispatched if a video marker sequence is being played and reaches the end. - * + * * Note that not all videos can fire this event. Live streams, for example, have no fixed duration, * so never technically 'complete'. - * + * * If a video is stopped from playback, via the `Video.stop` method, it will emit the * `VIDEO_STOP` event instead of this one. - * + * * Listen for it from a Video Game Object instance using `Video.on('complete', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_COMPLETE * @since 3.20.0 - * + * * @param {Phaser.GameObjects.Video} video - The Video Game Object which completed playback. */ module.exports = 'complete'; @@ -46422,22 +46738,22 @@ module.exports = 'complete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Video Game Object Created Event. - * + * * This event is dispatched when the texture for a Video has been created. This happens * when enough of the video source has been loaded that the browser is able to render a * frame from it. - * + * * Listen for it from a Video Game Object instance using `Video.on('created', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_CREATED * @since 3.20.0 - * + * * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event. * @param {number} width - The width of the video. * @param {number} height - The height of the video. @@ -46452,20 +46768,20 @@ module.exports = 'created'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Video Game Object Error Event. - * + * * This event is dispatched when a Video tries to play a source that does not exist, or is the wrong file type. - * + * * Listen for it from a Video Game Object instance using `Video.on('error', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_ERROR * @since 3.20.0 - * + * * @param {Phaser.GameObjects.Video} video - The Video Game Object which threw the error. * @param {Event} event - The native DOM event the browser raised during playback. */ @@ -46479,27 +46795,27 @@ module.exports = 'error'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Video Game Object Loop Event. - * + * * This event is dispatched when a Video that is currently playing has looped. This only * happens if the `loop` parameter was specified, or the `setLoop` method was called, * and if the video has a fixed duration. Video streams, for example, cannot loop, as * they have no duration. - * + * * Looping is based on the result of the Video `timeupdate` event. This event is not * frame-accurate, due to the way browsers work, so please do not rely on this loop * event to be time or frame precise. - * + * * Listen for it from a Video Game Object instance using `Video.on('loop', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_LOOP * @since 3.20.0 - * + * * @param {Phaser.GameObjects.Video} video - The Video Game Object which has looped. */ module.exports = 'loop'; @@ -46512,23 +46828,23 @@ module.exports = 'loop'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Video Game Object Play Event. - * + * * This event is dispatched when a Video begins playback. For videos that do not require * interaction unlocking, this is usually as soon as the `Video.play` method is called. * However, for videos that require unlocking, it is fired once playback begins after * they've been unlocked. - * + * * Listen for it from a Video Game Object instance using `Video.on('play', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_PLAY * @since 3.20.0 - * + * * @param {Phaser.GameObjects.Video} video - The Video Game Object which started playback. */ module.exports = 'play'; @@ -46541,20 +46857,20 @@ module.exports = 'play'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Video Game Object Seeked Event. - * + * * This event is dispatched when a Video completes seeking to a new point in its timeline. - * + * * Listen for it from a Video Game Object instance using `Video.on('seeked', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_SEEKED * @since 3.20.0 - * + * * @param {Phaser.GameObjects.Video} video - The Video Game Object which completed seeking. */ module.exports = 'seeked'; @@ -46567,21 +46883,21 @@ module.exports = 'seeked'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Video Game Object Seeking Event. - * + * * This event is dispatched when a Video _begins_ seeking to a new point in its timeline. * When the seek is complete, it will dispatch the `VIDEO_SEEKED` event to conclude. - * + * * Listen for it from a Video Game Object instance using `Video.on('seeking', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_SEEKING * @since 3.20.0 - * + * * @param {Phaser.GameObjects.Video} video - The Video Game Object which started seeking. */ module.exports = 'seeking'; @@ -46594,21 +46910,21 @@ module.exports = 'seeking'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Video Game Object Stopped Event. - * + * * This event is dispatched when a Video is stopped from playback via a call to the `Video.stop` method, * either directly via game code, or indirectly as the result of changing a video source or destroying it. - * + * * Listen for it from a Video Game Object instance using `Video.on('stop', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_STOP * @since 3.20.0 - * + * * @param {Phaser.GameObjects.Video} video - The Video Game Object which stopped playback. */ module.exports = 'stop'; @@ -46621,21 +46937,21 @@ module.exports = 'stop'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Video Game Object Timeout Event. - * + * * This event is dispatched when a Video has exhausted its allocated time while trying to connect to a video * source to start playback. - * + * * Listen for it from a Video Game Object instance using `Video.on('timeout', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_TIMEOUT * @since 3.20.0 - * + * * @param {Phaser.GameObjects.Video} video - The Video Game Object which timed out. */ module.exports = 'timeout'; @@ -46648,21 +46964,21 @@ module.exports = 'timeout'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Video Game Object Unlocked Event. - * + * * This event is dispatched when a Video that was prevented from playback due to the browsers * Media Engagement Interaction policy, is unlocked by a user gesture. - * + * * Listen for it from a Video Game Object instance using `Video.on('unlocked', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_UNLOCKED * @since 3.20.0 - * + * * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event. */ module.exports = 'unlocked'; @@ -46675,7 +46991,7 @@ module.exports = 'unlocked'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -46709,7 +47025,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -46829,7 +47145,7 @@ module.exports = Extern; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -46871,12 +47187,13 @@ GameObjectFactory.register('extern', function () /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -46903,7 +47220,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -46944,7 +47261,7 @@ module.exports = ExternWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -46980,7 +47297,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -47215,7 +47532,7 @@ var Graphics = new Class({ }, /** - * Set the current line style. + * Set the current line style. Used for all 'stroke' related functions. * * @method Phaser.GameObjects.Graphics#lineStyle * @since 3.0.0 @@ -47241,7 +47558,7 @@ var Graphics = new Class({ }, /** - * Set the current fill style. + * Set the current fill style. Used for all 'fill' related functions. * * @method Phaser.GameObjects.Graphics#fillStyle * @since 3.0.0 @@ -47690,6 +48007,8 @@ var Graphics = new Class({ var tr = radius; var bl = radius; var br = radius; + + var maxRadius = Math.min(width, height) / 2; if (typeof radius !== 'number') { @@ -47698,7 +48017,12 @@ var Graphics = new Class({ bl = GetFastValue(radius, 'bl', 20); br = GetFastValue(radius, 'br', 20); } - + + tl = Math.min(tl, maxRadius); + tr = Math.min(tr, maxRadius); + bl = Math.min(bl, maxRadius); + br = Math.min(br, maxRadius); + this.beginPath(); this.moveTo(x + tl, y); this.lineTo(x + width - tr, y); @@ -48457,7 +48781,7 @@ module.exports = Graphics; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -48705,7 +49029,7 @@ module.exports = GraphicsCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -48740,7 +49064,7 @@ GameObjectCreator.register('graphics', function (config, addToScene) { this.scene.sys.displayList.add(graphics); } - + return graphics; }); @@ -48754,7 +49078,7 @@ GameObjectCreator.register('graphics', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -48794,12 +49118,13 @@ GameObjectFactory.register('graphics', function (config) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -48829,7 +49154,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -49185,7 +49510,7 @@ module.exports = GraphicsWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -49310,7 +49635,7 @@ var Group = new Class({ * The class to create new group members from. * * @name Phaser.GameObjects.Group#classType - * @type {Function} + * @type {Phaser.Types.GameObjects.Group.GroupClassTypeConstructor} * @since 3.0.0 * @default Phaser.GameObjects.Sprite */ @@ -50915,7 +51240,7 @@ module.exports = Group; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -50949,7 +51274,7 @@ GameObjectCreator.register('group', function (config) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -50964,7 +51289,7 @@ var GameObjectFactory = __webpack_require__(61286); * @method Phaser.GameObjects.GameObjectFactory#group * @since 3.0.0 * - * @param {(Phaser.GameObjects.GameObject[]|Phaser.Types.GameObjects.Group.GroupConfig|Phaser.Types.GameObjects.Group.GroupConfig[])} [children] - Game Objects to add to this Group; or the `config` argument. + * @param {(Phaser.GameObjects.GameObject[]|Phaser.Types.GameObjects.Group.GroupConfig|Phaser.Types.GameObjects.Group.GroupConfig[]|Phaser.Types.GameObjects.Group.GroupCreateConfig)} [children] - Game Objects to add to this Group; or the `config` argument. * @param {Phaser.Types.GameObjects.Group.GroupConfig|Phaser.Types.GameObjects.Group.GroupCreateConfig} [config] - A Group Configuration object. * * @return {Phaser.GameObjects.Group} The Game Object that was created. @@ -50982,7 +51307,7 @@ GameObjectFactory.register('group', function (children, config) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -51086,7 +51411,7 @@ module.exports = Image; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -51121,7 +51446,7 @@ module.exports = ImageCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -51172,7 +51497,7 @@ GameObjectCreator.register('image', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -51215,12 +51540,13 @@ GameObjectFactory.register('image', function (x, y, key, frame) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -51247,7 +51573,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -51282,7 +51608,7 @@ module.exports = ImageWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -51435,7 +51761,7 @@ module.exports = GameObjects; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -52368,8 +52694,10 @@ var Layer = new Class({ * @method Phaser.GameObjects.Layer#destroy * @fires Phaser.GameObjects.Events#DESTROY * @since 3.50.0 + * + * @param {boolean} [fromScene=false] - `True` if this Game Object is being destroyed by the Scene, `false` if not. */ - destroy: function () + destroy: function (fromScene) { // This Game Object has already been destroyed if (!this.scene || this.ignoreDestroy) @@ -52379,11 +52707,11 @@ var Layer = new Class({ this.emit(GameObjectEvents.DESTROY, this); - var i = this.list.length; + var list = this.list; - while (i--) + while (list.length) { - this.list[i].destroy(); + list[0].destroy(fromScene); } this.removeAllListeners(); @@ -52426,7 +52754,7 @@ module.exports = Layer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -52442,7 +52770,6 @@ module.exports = Layer; * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Layer} layer - The Game Object being rendered in this call. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ var LayerCanvasRenderer = function (renderer, layer, camera) { @@ -52513,7 +52840,7 @@ module.exports = LayerCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -52561,7 +52888,7 @@ GameObjectCreator.register('layer', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -52593,12 +52920,13 @@ GameObjectFactory.register('layer', function (children) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -52625,7 +52953,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -52749,7 +53077,7 @@ module.exports = LayerWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -52769,13 +53097,19 @@ var Utils = __webpack_require__(75512); * * They can also simply be used to represent a point light for your own purposes. * + * As of Phaser 3.60 this Game Object now has the Transform and Origin components. However, changing the scale, + * rotation or origin properties will not make any difference to the Light. They are simply present to allow you + * to add this Light to a Container, or enable it for Physics. + * * @class Light * @extends Phaser.Geom.Circle * @memberof Phaser.GameObjects * @constructor * @since 3.0.0 * + * @extends Phaser.GameObjects.Components.Origin * @extends Phaser.GameObjects.Components.ScrollFactor + * @extends Phaser.GameObjects.Components.Transform * @extends Phaser.GameObjects.Components.Visible * * @param {number} x - The horizontal position of the light. @@ -52791,7 +53125,9 @@ var Light = new Class({ Extends: Circle, Mixins: [ + Components.Origin, Components.ScrollFactor, + Components.Transform, Components.Visible ], @@ -52847,6 +53183,92 @@ var Light = new Class({ this.cameraFilter = 0; this.setScrollFactor(1, 1); + this.setOrigin(); + this.setDisplayOrigin(radius); + }, + + /** + * The width of this Light Game Object. This is the same as `Light.diameter`. + * + * @name Phaser.GameObjects.Light#displayWidth + * @type {number} + * @since 3.60.0 + */ + displayWidth: { + + get: function () + { + return this.diameter; + }, + + set: function (value) + { + this.diameter = value; + } + + }, + + /** + * The height of this Light Game Object. This is the same as `Light.diameter`. + * + * @name Phaser.GameObjects.Light#displayHeight + * @type {number} + * @since 3.60.0 + */ + displayHeight: { + + get: function () + { + return this.diameter; + }, + + set: function (value) + { + this.diameter = value; + } + + }, + + /** + * The width of this Light Game Object. This is the same as `Light.diameter`. + * + * @name Phaser.GameObjects.Light#width + * @type {number} + * @since 3.60.0 + */ + width: { + + get: function () + { + return this.diameter; + }, + + set: function (value) + { + this.diameter = value; + } + + }, + + /** + * The height of this Light Game Object. This is the same as `Light.diameter`. + * + * @name Phaser.GameObjects.Light#height + * @type {number} + * @since 3.60.0 + */ + height: { + + get: function () + { + return this.diameter; + }, + + set: function (value) + { + this.diameter = value; + } + }, /** @@ -52939,7 +53361,7 @@ module.exports = Light; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -53301,7 +53723,7 @@ module.exports = LightsManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -53420,7 +53842,7 @@ module.exports = LightsPlugin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -53969,10 +54391,16 @@ var Mesh = new Class({ addVerticesFromObj: function (key, scale, x, y, z, rotateX, rotateY, rotateZ, zIsUp) { var data = this.scene.sys.cache.obj.get(key); + var parsedData; if (data) { - GenerateObjVerts(data, this, scale, x, y, z, rotateX, rotateY, rotateZ, zIsUp); + parsedData = GenerateObjVerts(data, this, scale, x, y, z, rotateX, rotateY, rotateZ, zIsUp); + } + + if (!parsedData || parsedData.verts.length === 0) + { + console.warn('Mesh.addVerticesFromObj data empty:', key); } return this; @@ -54136,6 +54564,10 @@ var Mesh = new Class({ this.faces = this.faces.concat(result.faces); this.vertices = this.vertices.concat(result.vertices); } + else + { + console.warn('Mesh.addVertices data empty or invalid'); + } this.dirtyCache[9] = -1; @@ -54474,8 +54906,74 @@ var Mesh = new Class({ this.debugCallback = null; this.debugGraphic = null; - } + }, + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff on all vertices, + * which results in no visible change to the texture. + * + * @method Phaser.GameObjects.Mesh#clearTint + * @webglOnly + * @since 3.60.0 + * + * @return {this} This Game Object instance. + */ + clearTint: function () + { + return this.setTint(); + }, + + /** + * Sets an additive tint on all vertices of this Mesh Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. + * + * To remove a tint call `clearTint`. + * + * @method Phaser.GameObjects.Mesh#setTint + * @webglOnly + * @since 3.60.0 + * + * @param {number} [tint=0xffffff] - The tint being applied to all vertices of this Mesh Game Object. + * + * @return {this} This Game Object instance. + */ + setTint: function (tint) + { + if (tint === undefined) { tint = 0xffffff; } + + var vertices = this.vertices; + + for (var i = 0; i < vertices.length; i++) + { + vertices[i].color = tint; + } + + return this; + }, + + /** + * The tint value being applied to the whole of the Game Object. + * This property is a setter-only. + * + * @method Phaser.GameObjects.Mesh#tint + * @type {number} + * @webglOnly + * @since 3.60.0 + */ + tint: { + + set: function (value) + { + this.setTint(value); + } + } }); module.exports = Mesh; @@ -54488,7 +54986,7 @@ module.exports = Mesh; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -54517,7 +55015,7 @@ module.exports = MeshCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -54574,7 +55072,7 @@ GameObjectCreator.register('mesh', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -54620,12 +55118,13 @@ if (true) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -54652,7 +55151,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -54765,7 +55264,7 @@ module.exports = MeshWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -55003,6 +55502,12 @@ var EmitterOp = new Class({ this.onEmit = this.defaultEmit; this.onUpdate = this.defaultUpdate; + // `moveToX` and `moveToY` are null by default + if (value === null) + { + return; + } + if (t === 'number') { // Explicit static value: @@ -55369,7 +55874,7 @@ module.exports = EmitterOp; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -55379,9 +55884,9 @@ var GetFastValue = __webpack_require__(72632); /** * @classdesc * The GravityWell action applies a force on the particle to draw it towards, or repel it from, a single point. - * + * * The force applied is inversely proportional to the square of the distance from the particle to the point, in accordance with Newton's law of gravity. - * + * * This simulates the effect of gravity over large distances (as between planets, for example). * * @class GravityWell @@ -55589,13 +56094,12 @@ module.exports = GravityWell; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var Class = __webpack_require__(56694); var DegToRad = __webpack_require__(75606); -var DistanceBetween = __webpack_require__(53996); /** * @classdesc @@ -55929,16 +56433,10 @@ var Particle = new Class({ { var mx = emitter.moveToX.onEmit(this, 'moveToX'); var my = (emitter.moveToY) ? emitter.moveToY.onEmit(this, 'moveToY') : mx; + var lifeS = this.life / 1000; - var angle = Math.atan2(my - this.y, mx - this.x); - - var speed = DistanceBetween(this.x, this.y, mx, my) / (this.life / 1000); - - // We know how many pixels we need to move, but how fast? - // var speed = this.distanceToXY(displayObject, x, y) / (maxTime / 1000); - - this.velocityX = Math.cos(angle) * speed; - this.velocityY = Math.sin(angle) * speed; + this.velocityX = (mx - this.x) / lifeS; + this.velocityY = (my - this.y) / lifeS; } else { @@ -55958,7 +56456,7 @@ var Particle = new Class({ this.delayCurrent = emitter.delay.onEmit(this, 'delay'); this.scaleX = emitter.scaleX.onEmit(this, 'scaleX'); - this.scaleY = (emitter.scaleY) ? emitter.scaleY.onEmit(this, 'scaleY') : this.scaleX; + this.scaleY = emitter.scaleY.onEmit(this, 'scaleY'); this.angle = emitter.rotate.onEmit(this, 'rotate'); this.rotation = DegToRad(this.angle); @@ -56120,15 +56618,7 @@ var Particle = new Class({ } this.scaleX = emitter.scaleX.onUpdate(this, 'scaleX', t, this.scaleX); - - if (emitter.scaleY) - { - this.scaleY = emitter.scaleY.onUpdate(this, 'scaleY', t, this.scaleY); - } - else - { - this.scaleY = this.scaleX; - } + this.scaleY = emitter.scaleY.onUpdate(this, 'scaleY', t, this.scaleY); this.angle = emitter.rotate.onUpdate(this, 'rotate', t, this.angle); this.rotation = DegToRad(this.angle); @@ -56154,7 +56644,7 @@ module.exports = Particle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -56265,6 +56755,7 @@ var ParticleEmitter = new Class({ 'gravityX', 'gravityY', 'maxParticles', + 'maxAliveParticles', 'name', 'on', 'particleBringToTop', @@ -56321,7 +56812,7 @@ var ParticleEmitter = new Class({ * The Particle Class which will be emitted by this Emitter. * * @name Phaser.GameObjects.Particles.ParticleEmitter#particleClass - * @type {Phaser.GameObjects.Particles.Particle} + * @type {Phaser.Types.GameObjects.Particles.ParticleClassConstructor} * @default Phaser.GameObjects.Particles.Particle * @since 3.0.0 */ @@ -56457,7 +56948,10 @@ var ParticleEmitter = new Class({ this.speedY = new EmitterOp(config, 'speedY', 0, true); /** - * Whether moveToX and moveToY are nonzero. Set automatically during configuration. + * Whether moveToX and moveToY are set. Set automatically during configuration. + * + * When true the particles move toward the moveToX and moveToY coordinates and arrive at the end of their life. + * Emitter angle, speedX, and speedY are ignored. * * @name Phaser.GameObjects.Particles.ParticleEmitter#moveTo * @type {boolean} @@ -56474,7 +56968,7 @@ var ParticleEmitter = new Class({ * @default 0 * @since 3.0.0 */ - this.moveToX = new EmitterOp(config, 'moveToX', 0, true); + this.moveToX = new EmitterOp(config, 'moveToX', null, true); /** * The y-coordinate emitted particles move toward, when {@link Phaser.GameObjects.Particles.ParticleEmitter#moveTo} is true. @@ -56484,7 +56978,7 @@ var ParticleEmitter = new Class({ * @default 0 * @since 3.0.0 */ - this.moveToY = new EmitterOp(config, 'moveToY', 0, true); + this.moveToY = new EmitterOp(config, 'moveToY', null, true); /** * Whether particles will rebound when they meet the emitter bounds. @@ -56624,6 +57118,19 @@ var ParticleEmitter = new Class({ */ this.maxParticles = 0; + /** + * The maximum number of alive (and rendering) particles this emitter will update. + * When this limit is reached, a particle needs to die before another can be emitted. + * + * 0 means no limits. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#maxAliveParticles + * @type {number} + * @default 0 + * @since 3.60.0 + */ + this.maxAliveParticles = 0; + /** * How many particles are emitted each time particles are emitted (one explosion or one flow cycle). * @@ -56960,7 +57467,7 @@ var ParticleEmitter = new Class({ this.acceleration = (this.accelerationX.propertyValue !== 0 || this.accelerationY.propertyValue !== 0); - this.moveTo = (this.moveToX.propertyValue !== 0 || this.moveToY.propertyValue !== 0); + this.moveTo = (this.moveToX.propertyValue !== null && this.moveToY.propertyValue !== null); // Special 'speed' override @@ -56981,7 +57488,7 @@ var ParticleEmitter = new Class({ if (HasValue(config, 'scale')) { this.scaleX.loadConfig(config, 'scale'); - this.scaleY = null; + this.scaleY.loadConfig(config, 'scale'); } if (HasValue(config, 'callbackScope')) @@ -57066,9 +57573,10 @@ var ParticleEmitter = new Class({ output.speed = this.speedX.toJSON(); } - if (!this.scaleY) + if (this.scaleX === this.scaleY) { delete output.scaleX; + delete output.scaleY; output.scale = this.scaleX.toJSON(); } @@ -57395,7 +57903,7 @@ var ParticleEmitter = new Class({ }, /** - * Sets the scale of emitted particles. + * Sets the scale of emitted particles. This updates both the scaleX and scaleY values. * * @method Phaser.GameObjects.Particles.ParticleEmitter#setScale * @since 3.0.0 @@ -57407,7 +57915,7 @@ var ParticleEmitter = new Class({ setScale: function (value) { this.scaleX.onChange(value); - this.scaleY = null; + this.scaleY.onChange(value); return this; }, @@ -57744,7 +58252,8 @@ var ParticleEmitter = new Class({ }, /** - * Whether this emitter is at its limit (if set). + * Whether this emitter is at either its hard-cap limit (maxParticles), if set, or + * the max allowed number of 'alive' particles (maxAliveParticles). * * @method Phaser.GameObjects.Particles.ParticleEmitter#atLimit * @since 3.0.0 @@ -57753,7 +58262,12 @@ var ParticleEmitter = new Class({ */ atLimit: function () { - return (this.maxParticles > 0 && this.getParticleCount() === this.maxParticles); + if (this.maxParticles > 0 && this.getParticleCount() >= this.maxParticles) + { + return true; + } + + return (this.maxAliveParticles > 0 && this.getAliveParticleCount() >= this.maxAliveParticles); }, /** @@ -58018,9 +58532,9 @@ var ParticleEmitter = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitter#explode * @since 3.0.0 * - * @param {number} count - The amount of Particles to emit. - * @param {number} x - The x coordinate to emit the Particles from. - * @param {number} y - The y coordinate to emit the Particles from. + * @param {number} [count=this.quantity] - The number of Particles to emit. + * @param {number} [x=this.x] - The x coordinate to emit the Particles from. + * @param {number} [y=this.x] - The y coordinate to emit the Particles from. * * @return {Phaser.GameObjects.Particles.Particle} The most recently emitted Particle. */ @@ -58196,12 +58710,12 @@ var ParticleEmitter = new Class({ { this._counter -= delta; - if (this._counter <= 0) + while (this._counter <= 0) { this.emitParticle(); // counter = frequency - remained from previous delta - this._counter = (this.frequency - Math.abs(this._counter)); + this._counter += this.frequency; } } }, @@ -58234,7 +58748,7 @@ module.exports = ParticleEmitter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -58742,7 +59256,7 @@ module.exports = ParticleEmitterManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -58845,26 +59359,29 @@ var ParticleManagerCanvasRenderer = function (renderer, emitterManager, camera, var frame = particle.frame; var cd = frame.canvasData; - var x = -(frame.halfWidth); - var y = -(frame.halfHeight); - - ctx.globalAlpha = alpha; - - ctx.save(); - - calcMatrix.setToContext(ctx); - - if (roundPixels) + if (cd.width > 0 && cd.height > 0) { - x = Math.round(x); - y = Math.round(y); + var x = -(frame.halfWidth); + var y = -(frame.halfHeight); + + ctx.globalAlpha = alpha; + + ctx.save(); + + calcMatrix.setToContext(ctx); + + if (roundPixels) + { + x = Math.round(x); + y = Math.round(y); + } + + ctx.imageSmoothingEnabled = !frame.source.scaleMode; + + ctx.drawImage(frame.source.image, cd.x, cd.y, cd.width, cd.height, x, y, cd.width, cd.height); + + ctx.restore(); } - - ctx.imageSmoothingEnabled = !(!renderer.antialias || frame.source.scaleMode); - - ctx.drawImage(frame.source.image, cd.x, cd.y, cd.width, cd.height, x, y, cd.width, cd.height); - - ctx.restore(); } ctx.restore(); @@ -58881,7 +59398,7 @@ module.exports = ParticleManagerCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -58941,7 +59458,7 @@ GameObjectCreator.register('particles', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -58975,12 +59492,13 @@ GameObjectFactory.register('particles', function (key, frame, emitters) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -59007,7 +59525,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -59165,7 +59683,7 @@ module.exports = ParticleManagerWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -59192,7 +59710,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -59271,7 +59789,7 @@ module.exports = DeathZone; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -59516,7 +60034,7 @@ module.exports = EdgeZone; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -59590,7 +60108,7 @@ module.exports = RandomZone; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -59614,7 +60132,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -59697,7 +60215,7 @@ module.exports = PathFollower; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -59746,7 +60264,7 @@ GameObjectFactory.register('follower', function (path, x, y, key, frame) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -59815,7 +60333,6 @@ var PointLight = new Class({ Components.AlphaSingle, Components.BlendMode, Components.Depth, - Components.GetBounds, Components.Mask, Components.Pipeline, Components.ScrollFactor, @@ -59952,7 +60469,7 @@ module.exports = PointLight; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -60003,7 +60520,7 @@ GameObjectCreator.register('pointlight', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -60064,12 +60581,13 @@ GameObjectFactory.register('pointlight', function (x, y, color, radius, intensit /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -60091,7 +60609,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -60160,7 +60678,7 @@ module.exports = PointLightWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -60192,6 +60710,10 @@ var UUID = __webpack_require__(76583); * is a technical limitation of WebGL. To get around it, create your shape as a texture in an art package, then draw that * to the Render Texture. * + * If you are planning on using this Render Texture as a base texture for Sprite + * Game Objects, then you should call `RenderTexture.setIsSpriteTexture()` _before_ + * calling any `draw` methods, otherwise you will get inverted frames in WebGL. + * * @class RenderTexture * @extends Phaser.GameObjects.GameObject * @memberof Phaser.GameObjects @@ -60350,6 +60872,23 @@ var RenderTexture = new Class({ */ this._saved = false; + /** + * Is this Render Texture being used as the base texture for a Sprite Game Object? + * + * To enable this, call `RenderTexture.setIsSpriteTexture(true)`. + * + * You should do this _before_ drawing to this RenderTexture, so that it correctly + * inverses the frames for WebGL rendering. Not doing so will result in inverted frames. + * + * This property is used in the `endDraw` method. + * + * @name Phaser.GameObjects.RenderTexture#isSpriteTexture + * @type {boolean} + * @readonly + * @since 3.60.0 + */ + this.isSpriteTexture = false; + if (key === undefined) { this.canvas = CanvasPool.create2D(this, width, height); @@ -60430,6 +60969,8 @@ var RenderTexture = new Class({ this.drawGameObject = this.batchGameObjectWebGL; this.renderTarget = new RenderTarget(renderer, width, height, 1, 0, false); + + this.setFlipY(this.isSpriteTexture); } else if (renderer.type === CONST.CANVAS) { @@ -60466,6 +61007,27 @@ var RenderTexture = new Class({ return this.resize(width, height); }, + /** + * If you are planning on using this Render Texture as a base texture for Sprite + * Game Objects, then you should call this method with a value of `true` before + * calling drawing anything to it, otherwise you will get inverted frames in WebGL. + * + * @method Phaser.GameObjects.RenderTexture#setIsSpriteTexture + * @since 3.60.0 + * + * @param {boolean} value - Is this Render Target being used as a Sprite Texture, or not? + * + * @return {this} This Game Object instance. + */ + setIsSpriteTexture: function (value) + { + this.isSpriteTexture = value; + + this.setFlipY(value); + + return this; + }, + /** * Resizes the Render Texture to the new dimensions given. * @@ -60518,6 +61080,7 @@ var RenderTexture = new Class({ frame.source.isRenderTexture = true; frame.source.isGLTexture = true; frame.source.glTexture = renderTarget.texture; + frame.source.glTexture.flipY = true; } this.camera.setSize(width, height); @@ -60668,9 +61231,9 @@ var RenderTexture = new Class({ if (width === undefined) { width = frame.cutWidth; } if (height === undefined) { height = frame.cutHeight; } - var r = (rgb >> 16 & 0xFF) / 255; - var g = (rgb >> 8 & 0xFF) / 255; - var b = (rgb & 0xFF) / 255; + var r = (rgb >> 16 & 0xFF); + var g = (rgb >> 8 & 0xFF); + var b = (rgb & 0xFF); var renderTarget = this.renderTarget; @@ -60695,7 +61258,7 @@ var RenderTexture = new Class({ pipeline.drawFillRect( x * sx, y * sy, width * sx, height * sy, - Utils.getTintFromFloats(b, g, r, 1), + Utils.getTintFromFloats(b / 255, g / 255, r / 255, 1), alpha ); @@ -60824,7 +61387,10 @@ var RenderTexture = new Class({ * * A Texture Frame instance. * * A string. This is used to look-up a texture from the Texture Manager. * - * Note: You cannot draw a Render Texture to itself. + * Note 1: You cannot draw a Render Texture to itself. + * + * Note 2: For Game Objects that have Post FX Pipelines, the pipeline _cannot_ be + * used when drawn to this Render Texture. * * If passing in a Group or Container it will only draw children that return `true` * when their `willRender()` method is called. I.e. a Container with 10 children, @@ -60851,6 +61417,10 @@ var RenderTexture = new Class({ * try and pass them in an array in one single call, rather than making lots of * separate calls. * + * If you are planning on using this Render Texture as a base texture for Sprite + * Game Objects, then you should set `RenderTexture.isSpriteTexture = true` before + * calling this method, otherwise you will get inverted frames in WebGL. + * * @method Phaser.GameObjects.RenderTexture#draw * @since 3.2.0 * @@ -60889,11 +61459,15 @@ var RenderTexture = new Class({ * * If you need to draw a Sprite to this Render Texture, use the `draw` method instead. * + * If you are planning on using this Render Texture as a base texture for Sprite + * Game Objects, then you should set `RenderTexture.isSpriteTexture = true` before + * calling this method, otherwise you will get inverted frames in WebGL. + * * @method Phaser.GameObjects.RenderTexture#drawFrame * @since 3.12.0 * * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. - * @param {(string|number)} [frame] - The name or index of the frame within the Texture. + * @param {(string|number)} [frame] - The name or index of the frame within the Texture. Set to `null` to skip this argument if not required. * @param {number} [x=0] - The x position to draw the frame at. * @param {number} [y=0] - The y position to draw the frame at. * @param {number} [alpha] - The alpha to use. If not specified it uses the `globalAlpha` property. @@ -60910,6 +61484,65 @@ var RenderTexture = new Class({ return this; }, + /** + * Takes the given Texture Frame and draws it to this Render Texture + * as a fill pattern, i.e. in a grid-layout based on the frame dimensions. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * + * ```javascript + * var rt = this.add.renderTexture(0, 0, 800, 600); + * rt.fillFrame(key, frame); + * ``` + * + * You can optionally provide a position, alpha and tint value to apply to the frames + * before they are drawn. The position controls the offset of the first frame to be drawn + * and can be negative if required. + * + * Calling this method will cause a batch flush, so if you've got a stack of things to draw + * in a tight loop, try using the `draw` method instead. + * + * If you are planning on using this Render Texture as a base texture for Sprite + * Game Objects, then you should set `RenderTexture.isSpriteTexture = true` before + * calling this method, otherwise you will get inverted frames in WebGL. + * + * @method Phaser.GameObjects.RenderTexture#fillFrame + * @since 3.60.0 + * + * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. + * @param {(string|number)} [frame] - The name or index of the frame within the Texture. Set to `null` to skip this argument if not required. + * @param {number} [x=0] - The x position to start drawing the frames from (can be negative to offset). + * @param {number} [y=0] - The y position to start drawing the frames from (can be negative to offset). + * @param {number} [alpha] - The alpha to use. If not specified it uses the `globalAlpha` property. + * @param {number} [tint] - WebGL only. The tint color to use. If not specified it uses the `globalTint` property. + * + * @return {this} This Render Texture instance. + */ + fillFrame: function (key, frame, x, y, alpha, tint) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + + var textureFrame = this.textureManager.getFrame(key, frame); + + if (textureFrame) + { + this.beginDraw(); + + for (var sy = y; sy < this.height; sy += textureFrame.height) + { + for (var sx = x; sx < this.width; sx += textureFrame.width) + { + this.batchDrawFrame(key, frame, sx, sy, alpha, tint); + } + } + + this.endDraw(); + } + + return this; + }, + /** * Use this method if you need to batch draw a large number of Game Objects to * this Render Texture in a single go, or on a frequent basis. @@ -61202,7 +61835,7 @@ var RenderTexture = new Class({ var util = renderer.pipelines.setUtility(); - util.blitFrame(canvasTarget, renderTarget, 1, false, false, erase); + util.blitFrame(canvasTarget, renderTarget, 1, false, false, erase, this.isSpriteTexture); renderer.resetScissor(); renderer.resetViewport(); @@ -61329,6 +61962,11 @@ var RenderTexture = new Class({ } else { + if (!this._eraseMode) + { + this.renderer.setBlendMode(gameObject.blendMode); + } + gameObject.renderWebGL(this.renderer, gameObject, this.camera); } @@ -61439,7 +62077,10 @@ var RenderTexture = new Class({ matrix.setToContext(ctx); - ctx.drawImage(source, cd.x, cd.y, cd.width, cd.height, x, y, cd.width, cd.height); + if (cd.width > 0 && cd.height > 0) + { + ctx.drawImage(source, cd.x, cd.y, cd.width, cd.height, x, y, cd.width, cd.height); + } ctx.restore(); } @@ -61592,7 +62233,7 @@ module.exports = RenderTexture; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -61627,7 +62268,7 @@ module.exports = RenderTextureCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -61680,7 +62321,7 @@ GameObjectCreator.register('renderTexture', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -61691,7 +62332,7 @@ var RenderTexture = __webpack_require__(15996); * Creates a new Render Texture Game Object and adds it to the Scene. * * Note: This method will only be available if the Render Texture Game Object has been built into Phaser. - * + * * A Render Texture is a special texture that allows any number of Game Objects to be drawn to it. You can take many complex objects and * draw them all to this one texture, which can they be used as the texture for other Game Object's. It's a way to generate dynamic * textures at run-time that are WebGL friendly and don't invoke expensive GPU uploads. @@ -61705,7 +62346,7 @@ var RenderTexture = __webpack_require__(15996); * @param {number} [height=32] - The height of the Render Texture. * @property {string} [key] - The texture key to make the RenderTexture from. * @property {string} [frame] - the frame to make the RenderTexture from. - * + * * @return {Phaser.GameObjects.RenderTexture} The Game Object that was created. */ GameObjectFactory.register('renderTexture', function (x, y, width, height, key, frame) @@ -61721,12 +62362,13 @@ GameObjectFactory.register('renderTexture', function (x, y, width, height, key, /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -61753,7 +62395,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -61826,7 +62468,7 @@ module.exports = RenderTextureWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -62952,7 +63594,7 @@ module.exports = Rope; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -62981,7 +63623,7 @@ module.exports = RopeCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -63024,11 +63666,6 @@ GameObjectCreator.register('rope', function (config, addToScene) BuildGameObject(this.scene, rope, config); - if (!config.add) - { - this.updateList.add(rope); - } - return rope; }); @@ -63042,7 +63679,7 @@ GameObjectCreator.register('rope', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -63085,12 +63722,13 @@ if (true) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -63117,7 +63755,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -63232,7 +63870,7 @@ module.exports = RopeWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -64465,7 +65103,7 @@ module.exports = Shader; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -64494,7 +65132,7 @@ module.exports = ShaderCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -64548,7 +65186,7 @@ GameObjectCreator.register('shader', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -64590,12 +65228,13 @@ if (true) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -64622,7 +65261,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -64685,7 +65324,7 @@ module.exports = ShaderWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -64748,7 +65387,7 @@ module.exports = FillPathWebGL; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -64786,7 +65425,7 @@ module.exports = FillStyleCanvas; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -64825,7 +65464,7 @@ module.exports = LineStyleCanvas; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -65249,7 +65888,7 @@ module.exports = Shape; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -65323,7 +65962,7 @@ module.exports = StrokePathWebGL; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -65341,14 +65980,14 @@ var Shape = __webpack_require__(91461); * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * When it renders it displays an arc shape. You can control the start and end angles of the arc, * as well as if the angles are winding clockwise or anti-clockwise. With the default settings * it renders as a complete circle. By changing the angles you can create other arc shapes, * such as half-circles. - * + * * Arcs also have an `iterations` property and corresponding `setIterations` method. This allows * you to control how smooth the shape renders in WebGL, by controlling the number of iterations * that take place during construction. @@ -65572,7 +66211,7 @@ var Arc = new Class({ * * @method Phaser.GameObjects.Arc#setRadius * @since 3.13.0 - * + * * @param {number} value - The value to set the radius to. * * @return {this} This Game Object instance. @@ -65592,7 +66231,7 @@ var Arc = new Class({ * * @method Phaser.GameObjects.Arc#setIterations * @since 3.13.0 - * + * * @param {number} value - The value to set the iterations to. * * @return {this} This Game Object instance. @@ -65612,7 +66251,7 @@ var Arc = new Class({ * * @method Phaser.GameObjects.Arc#setStartAngle * @since 3.13.0 - * + * * @param {number} value - The value to set the starting angle to. * * @return {this} This Game Object instance. @@ -65635,7 +66274,7 @@ var Arc = new Class({ * * @method Phaser.GameObjects.Arc#setEndAngle * @since 3.13.0 - * + * * @param {number} value - The value to set the ending angle to. * * @return {this} This Game Object instance. @@ -65733,7 +66372,7 @@ module.exports = Arc; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -65811,7 +66450,7 @@ module.exports = ArcCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -65822,14 +66461,14 @@ var GameObjectFactory = __webpack_require__(61286); * Creates a new Arc Shape Game Object and adds it to the Scene. * * Note: This method will only be available if the Arc Game Object has been built into Phaser. - * + * * The Arc Shape is a Game Object that can be added to a Scene, Group or Container. You can * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * When it renders it displays an arc shape. You can control the start and end angles of the arc, * as well as if the angles are winding clockwise or anti-clockwise. With the default settings * it renders as a complete circle. By changing the angles you can create other arc shapes, @@ -65856,7 +66495,7 @@ GameObjectFactory.register('arc', function (x, y, radius, startAngle, endAngle, /** * Creates a new Circle Shape Game Object and adds it to the Scene. - * + * * A Circle is an Arc with no defined start and end angle, making it render as a complete circle. * * Note: This method will only be available if the Arc Game Object has been built into Phaser. @@ -65885,12 +66524,13 @@ GameObjectFactory.register('circle', function (x, y, radius, fillColor, fillAlph /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -65917,7 +66557,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -65979,7 +66619,7 @@ module.exports = ArcWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -65995,12 +66635,12 @@ var Shape = __webpack_require__(91461); * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * To render a Curve Shape you must first create a `Phaser.Curves.Curve` object, then pass it to * the Curve Shape in the constructor. - * + * * The Curve shape also has a `smoothness` property and corresponding `setSmoothness` method. * This allows you to control how smooth the shape renders in WebGL, by controlling the number of iterations * that take place during construction. Increase and decrease the default value for smoother, or more @@ -66102,7 +66742,7 @@ var Curve = new Class({ * * @method Phaser.GameObjects.Curve#setSmoothness * @since 3.13.0 - * + * * @param {number} value - The value to set the smoothness to. * * @return {this} This Game Object instance. @@ -66162,7 +66802,7 @@ module.exports = Curve; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -66252,7 +66892,7 @@ module.exports = CurveCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -66263,17 +66903,17 @@ var Curve = __webpack_require__(15220); * Creates a new Curve Shape Game Object and adds it to the Scene. * * Note: This method will only be available if the Curve Game Object has been built into Phaser. - * + * * The Curve Shape is a Game Object that can be added to a Scene, Group or Container. You can * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * To render a Curve Shape you must first create a `Phaser.Curves.Curve` object, then pass it to * the Curve Shape in the constructor. - * + * * The Curve shape also has a `smoothness` property and corresponding `setSmoothness` method. * This allows you to control how smooth the shape renders in WebGL, by controlling the number of iterations * that take place during construction. Increase and decrease the default value for smoother, or more @@ -66303,12 +66943,13 @@ GameObjectFactory.register('curve', function (x, y, curve, fillColor, fillAlpha) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -66335,7 +66976,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -66397,7 +67038,7 @@ module.exports = CurveWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -66413,13 +67054,13 @@ var Shape = __webpack_require__(91461); * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * When it renders it displays an ellipse shape. You can control the width and height of the ellipse. * If the width and height match it will render as a circle. If the width is less than the height, * it will look more like an egg shape. - * + * * The Ellipse shape also has a `smoothness` property and corresponding `setSmoothness` method. * This allows you to control how smooth the shape renders in WebGL, by controlling the number of iterations * that take place during construction. Increase and decrease the default value for smoother, or more @@ -66514,7 +67155,7 @@ var Ellipse = new Class({ * * @method Phaser.GameObjects.Ellipse#setSize * @since 3.13.0 - * + * * @param {number} width - The width of the ellipse. * @param {number} height - The height of the ellipse. * @@ -66537,7 +67178,7 @@ var Ellipse = new Class({ * * @method Phaser.GameObjects.Ellipse#setSmoothness * @since 3.13.0 - * + * * @param {number} value - The value to set the smoothness to. * * @return {this} This Game Object instance. @@ -66588,7 +67229,7 @@ module.exports = Ellipse; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -66675,7 +67316,7 @@ module.exports = EllipseCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -66686,18 +67327,18 @@ var GameObjectFactory = __webpack_require__(61286); * Creates a new Ellipse Shape Game Object and adds it to the Scene. * * Note: This method will only be available if the Ellipse Game Object has been built into Phaser. - * + * * The Ellipse Shape is a Game Object that can be added to a Scene, Group or Container. You can * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * When it renders it displays an ellipse shape. You can control the width and height of the ellipse. * If the width and height match it will render as a circle. If the width is less than the height, * it will look more like an egg shape. - * + * * The Ellipse shape also has a `smoothness` property and corresponding `setSmoothness` method. * This allows you to control how smooth the shape renders in WebGL, by controlling the number of iterations * that take place during construction. Increase and decrease the default value for smoother, or more @@ -66728,12 +67369,13 @@ GameObjectFactory.register('ellipse', function (x, y, width, height, fillColor, /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -66760,7 +67402,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -66822,7 +67464,7 @@ module.exports = EllipseWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -67102,7 +67744,7 @@ module.exports = Grid; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -67293,7 +67935,7 @@ module.exports = GridCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -67304,14 +67946,14 @@ var Grid = __webpack_require__(39169); * Creates a new Grid Shape Game Object and adds it to the Scene. * * Note: This method will only be available if the Grid Game Object has been built into Phaser. - * + * * The Grid Shape is a Game Object that can be added to a Scene, Group or Container. You can * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports only fill colors and cannot be stroked. - * + * * A Grid Shape allows you to display a grid in your game, where you can control the size of the * grid as well as the width and height of the grid cells. You can set a fill color for each grid * cell as well as an alternate fill color. When the alternate fill color is set then the grid @@ -67349,12 +67991,13 @@ GameObjectFactory.register('grid', function (x, y, width, height, cellWidth, cel /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -67381,7 +68024,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -67583,7 +68226,7 @@ module.exports = GridWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -67597,13 +68240,13 @@ var Shape = __webpack_require__(91461); * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports only fill colors and cannot be stroked. - * + * * An IsoBox is an 'isometric' rectangle. Each face of it has a different fill color. You can set * the color of the top, left and right faces of the rectangle respectively. You can also choose * which of the faces are rendered via the `showTop`, `showLeft` and `showRight` properties. - * + * * You cannot view an IsoBox from under-neath, however you can change the 'angle' by setting * the `projection` property. * @@ -67725,7 +68368,7 @@ var IsoBox = new Class({ * * @method Phaser.GameObjects.IsoBox#setProjection * @since 3.13.0 - * + * * @param {number} value - The value to set the projection to. * * @return {this} This Game Object instance. @@ -67743,7 +68386,7 @@ var IsoBox = new Class({ * * @method Phaser.GameObjects.IsoBox#setFaces * @since 3.13.0 - * + * * @param {boolean} [showTop=true] - Show the top-face of the iso box. * @param {boolean} [showLeft=true] - Show the left-face of the iso box. * @param {boolean} [showRight=true] - Show the right-face of the iso box. @@ -67769,7 +68412,7 @@ var IsoBox = new Class({ * * @method Phaser.GameObjects.IsoBox#setFillStyle * @since 3.13.0 - * + * * @param {number} [fillTop] - The color used to fill the top of the iso box. * @param {number} [fillLeft] - The color used to fill in the left-facing side of the iso box. * @param {number} [fillRight] - The color used to fill in the right-facing side of the iso box. @@ -67799,7 +68442,7 @@ module.exports = IsoBox; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -67902,7 +68545,7 @@ module.exports = IsoBoxCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -67913,18 +68556,18 @@ var IsoBox = __webpack_require__(4415); * Creates a new IsoBox Shape Game Object and adds it to the Scene. * * Note: This method will only be available if the IsoBox Game Object has been built into Phaser. - * + * * The IsoBox Shape is a Game Object that can be added to a Scene, Group or Container. You can * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports only fill colors and cannot be stroked. - * + * * An IsoBox is an 'isometric' rectangle. Each face of it has a different fill color. You can set * the color of the top, left and right faces of the rectangle respectively. You can also choose * which of the faces are rendered via the `showTop`, `showLeft` and `showRight` properties. - * + * * You cannot view an IsoBox from under-neath, however you can change the 'angle' by setting * the `projection` property. * @@ -67954,12 +68597,13 @@ GameObjectFactory.register('isobox', function (x, y, size, height, fillTop, fill /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -67986,7 +68630,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -68123,7 +68767,7 @@ module.exports = IsoBoxWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -68137,13 +68781,13 @@ var Shape = __webpack_require__(91461); * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports only fill colors and cannot be stroked. - * + * * An IsoTriangle is an 'isometric' triangle. Think of it like a pyramid. Each face has a different * fill color. You can set the color of the top, left and right faces of the triangle respectively * You can also choose which of the faces are rendered via the `showTop`, `showLeft` and `showRight` properties. - * + * * You cannot view an IsoTriangle from under-neath, however you can change the 'angle' by setting * the `projection` property. The `reversed` property controls if the IsoTriangle is rendered upside * down or not. @@ -68278,7 +68922,7 @@ var IsoTriangle = new Class({ * * @method Phaser.GameObjects.IsoTriangle#setProjection * @since 3.13.0 - * + * * @param {number} value - The value to set the projection to. * * @return {this} This Game Object instance. @@ -68296,7 +68940,7 @@ var IsoTriangle = new Class({ * * @method Phaser.GameObjects.IsoTriangle#setReversed * @since 3.13.0 - * + * * @param {boolean} reversed - Sets if the iso triangle will be rendered upside down or not. * * @return {this} This Game Object instance. @@ -68314,7 +68958,7 @@ var IsoTriangle = new Class({ * * @method Phaser.GameObjects.IsoTriangle#setFaces * @since 3.13.0 - * + * * @param {boolean} [showTop=true] - Show the top-face of the iso triangle (only if `reversed` is true) * @param {boolean} [showLeft=true] - Show the left-face of the iso triangle. * @param {boolean} [showRight=true] - Show the right-face of the iso triangle. @@ -68340,7 +68984,7 @@ var IsoTriangle = new Class({ * * @method Phaser.GameObjects.IsoTriangle#setFillStyle * @since 3.13.0 - * + * * @param {number} [fillTop] - The color used to fill the top of the iso triangle. * @param {number} [fillLeft] - The color used to fill in the left-facing side of the iso triangle. * @param {number} [fillRight] - The color used to fill in the right-facing side of the iso triangle. @@ -68370,7 +69014,7 @@ module.exports = IsoTriangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -68486,7 +69130,7 @@ module.exports = IsoTriangleCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -68497,18 +69141,18 @@ var IsoTriangle = __webpack_require__(65159); * Creates a new IsoTriangle Shape Game Object and adds it to the Scene. * * Note: This method will only be available if the IsoTriangle Game Object has been built into Phaser. - * + * * The IsoTriangle Shape is a Game Object that can be added to a Scene, Group or Container. You can * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports only fill colors and cannot be stroked. - * + * * An IsoTriangle is an 'isometric' triangle. Think of it like a pyramid. Each face has a different * fill color. You can set the color of the top, left and right faces of the triangle respectively * You can also choose which of the faces are rendered via the `showTop`, `showLeft` and `showRight` properties. - * + * * You cannot view an IsoTriangle from under-neath, however you can change the 'angle' by setting * the `projection` property. The `reversed` property controls if the IsoTriangle is rendered upside * down or not. @@ -68540,12 +69184,13 @@ GameObjectFactory.register('isotriangle', function (x, y, size, height, reversed /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -68572,7 +69217,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -68729,7 +69374,7 @@ module.exports = IsoTriangleWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -68897,7 +69542,7 @@ module.exports = Line; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -68956,7 +69601,7 @@ module.exports = LineCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -68967,18 +69612,18 @@ var Line = __webpack_require__(579); * Creates a new Line Shape Game Object and adds it to the Scene. * * Note: This method will only be available if the Line Game Object has been built into Phaser. - * + * * The Line Shape is a Game Object that can be added to a Scene, Group or Container. You can * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports only stroke colors and cannot be filled. - * + * * A Line Shape allows you to draw a line between two points in your game. You can control the * stroke color and thickness of the line. In WebGL only you can also specify a different * thickness for the start and end of the line, allowing you to render lines that taper-off. - * + * * If you need to draw multiple lines in a sequence you may wish to use the Polygon Shape instead. * * @method Phaser.GameObjects.GameObjectFactory#line @@ -69008,12 +69653,13 @@ GameObjectFactory.register('line', function (x, y, x1, y1, x2, y2, strokeColor, /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -69040,7 +69686,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -69118,7 +69764,7 @@ module.exports = LineWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -69136,9 +69782,9 @@ var Smooth = __webpack_require__(18974); * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * The Polygon Shape is created by providing a list of points, which are then used to create an * internal Polygon geometry object. The points can be set from a variety of formats: * @@ -69147,7 +69793,7 @@ var Smooth = __webpack_require__(18974); * - An array of objects with public x/y properties: `[obj1, obj2, ...]` * - An array of paired numbers that represent point coordinates: `[x1,y1, x2,y2, ...]` * - An array of arrays with two elements representing x/y coordinates: `[[x1, y1], [x2, y2], ...]` - * + * * By default the `x` and `y` coordinates of this Shape refer to the center of it. However, depending * on the coordinates of the points provided, the final shape may be rendered offset from its origin. * @@ -69202,7 +69848,7 @@ var Polygon = new Class({ * * @method Phaser.GameObjects.Polygon#smooth * @since 3.13.0 - * + * * @param {number} [iterations=1] - The number of times to apply the polygon smoothing. * * @return {this} This Game Object instance. @@ -69219,6 +69865,42 @@ var Polygon = new Class({ return this.updateData(); }, + /** + * Sets this Polygon to the given points. + * + * The points can be set from a variety of formats: + * + * - A string containing paired values separated by a single space: `'40 0 40 20 100 20 100 80 40 80 40 100 0 50'` + * - An array of Point objects: `[new Phaser.Point(x1, y1), ...]` + * - An array of objects with public x/y properties: `[obj1, obj2, ...]` + * - An array of paired numbers that represent point coordinates: `[x1,y1, x2,y2, ...]` + * - An array of arrays with two elements representing x/y coordinates: `[[x1, y1], [x2, y2], ...]` + * + * Calling this method will reset the size (width, height) and display origin of this Shape. + * + * It also runs both GetAABB and EarCut on the given points, so please be careful not to do this + * at a high frequency, or with too many points. + * + * @method Phaser.GameObjects.Polygon#setTo + * @since 3.60.0 + * + * @param {(string|number[]|Phaser.Types.Math.Vector2Like[])} [points] - Points defining the perimeter of this polygon. Please check function description above for the different supported formats. + * + * @return {this} This Game Object instance. + */ + setTo: function (points) + { + this.geom.setTo(points); + + var bounds = GetAABB(this.geom); + + this.setSize(bounds.width, bounds.height); + + this.updateDisplayOrigin(); + + return this.updateData(); + }, + /** * Internal method that updates the data and path values. * @@ -69258,7 +69940,7 @@ module.exports = Polygon; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -69314,7 +69996,10 @@ var PolygonCanvasRenderer = function (renderer, src, camera, parentMatrix) ctx.lineTo(px2, py2); } - ctx.closePath(); + if (src.closePath) + { + ctx.closePath(); + } if (src.isFilled) { @@ -69345,7 +70030,7 @@ module.exports = PolygonCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -69354,16 +70039,16 @@ var Polygon = __webpack_require__(91249); /** * Creates a new Polygon Shape Game Object and adds it to the Scene. - * + * * Note: This method will only be available if the Polygon Game Object has been built into Phaser. - * + * * The Polygon Shape is a Game Object that can be added to a Scene, Group or Container. You can * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * The Polygon Shape is created by providing a list of points, which are then used to create an * internal Polygon geometry object. The points can be set from a variety of formats: * @@ -69371,7 +70056,7 @@ var Polygon = __webpack_require__(91249); * - An array of objects with public x/y properties: `[obj1, obj2, ...]` * - An array of paired numbers that represent point coordinates: `[x1,y1, x2,y2, ...]` * - An array of arrays with two elements representing x/y coordinates: `[[x1, y1], [x2, y2], ...]` - * + * * By default the `x` and `y` coordinates of this Shape refer to the center of it. However, depending * on the coordinates of the points provided, the final shape may be rendered offset from its origin. * @@ -69399,12 +70084,13 @@ GameObjectFactory.register('polygon', function (x, y, points, fillColor, fillAlp /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -69431,7 +70117,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -69493,7 +70179,7 @@ module.exports = PolygonWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -69559,14 +70245,9 @@ var Rectangle = new Class({ }, /** - * Sets the internal size of this Game Object, as used for frame or physics body creation. + * Sets the internal size of this Rectangle, as used for frame or physics body creation. * - * This will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or call the - * `setDisplaySize` method, which is the same thing as changing the scale but allows you - * to do so by giving pixel values. - * - * If you have enabled this Game Object for input, changing the size will _not_ change the + * If you have assigned a custom input hit area for this Rectangle, changing the Rectangle size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * * @method Phaser.GameObjects.Rectangle#setSize @@ -69647,7 +70328,7 @@ module.exports = Rectangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -69723,7 +70404,7 @@ module.exports = RectangleCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -69734,14 +70415,14 @@ var Rectangle = __webpack_require__(517); * Creates a new Rectangle Shape Game Object and adds it to the Scene. * * Note: This method will only be available if the Rectangle Game Object has been built into Phaser. - * + * * The Rectangle Shape is a Game Object that can be added to a Scene, Group or Container. You can * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * You can change the size of the rectangle by changing the `width` and `height` properties. * * @method Phaser.GameObjects.GameObjectFactory#rectangle @@ -69769,12 +70450,13 @@ GameObjectFactory.register('rectangle', function (x, y, width, height, fillColor /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -69801,7 +70483,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -69875,7 +70557,7 @@ module.exports = RectangleWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -69890,14 +70572,14 @@ var Shape = __webpack_require__(91461); * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * As the name implies, the Star shape will display a star in your game. You can control several * aspects of it including the number of points that constitute the star. The default is 5. If * you change it to 4 it will render as a diamond. If you increase them, you'll get a more spiky * star shape. - * + * * You can also control the inner and outer radius, which is how 'long' each point of the star is. * Modify these values to create more interesting shapes. * @@ -69987,7 +70669,7 @@ var Star = new Class({ * * @method Phaser.GameObjects.Star#setPoints * @since 3.13.0 - * + * * @param {number} value - The amount of points the Star will have. * * @return {this} This Game Object instance. @@ -70005,7 +70687,7 @@ var Star = new Class({ * * @method Phaser.GameObjects.Star#setInnerRadius * @since 3.13.0 - * + * * @param {number} value - The amount to set the inner radius to. * * @return {this} This Game Object instance. @@ -70023,7 +70705,7 @@ var Star = new Class({ * * @method Phaser.GameObjects.Star#setOuterRadius * @since 3.13.0 - * + * * @param {number} value - The amount to set the outer radius to. * * @return {this} This Game Object instance. @@ -70130,7 +70812,7 @@ var Star = new Class({ // So origin 0.5 = the center of the star var x = outerRadius; var y = outerRadius; - + path.push(x, y + -outerRadius); for (var i = 0; i < points; i++) @@ -70140,7 +70822,7 @@ var Star = new Class({ rot += step; path.push(x + Math.cos(rot) * innerRadius, y + Math.sin(rot) * innerRadius); - + rot += step; } @@ -70164,7 +70846,7 @@ module.exports = Star; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -70251,7 +70933,7 @@ module.exports = StarCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -70262,19 +70944,19 @@ var GameObjectFactory = __webpack_require__(61286); * Creates a new Star Shape Game Object and adds it to the Scene. * * Note: This method will only be available if the Star Game Object has been built into Phaser. - * + * * The Star Shape is a Game Object that can be added to a Scene, Group or Container. You can * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * As the name implies, the Star shape will display a star in your game. You can control several * aspects of it including the number of points that constitute the star. The default is 5. If * you change it to 4 it will render as a diamond. If you increase them, you'll get a more spiky * star shape. - * + * * You can also control the inner and outer radius, which is how 'long' each point of the star is. * Modify these values to create more interesting shapes. * @@ -70304,12 +70986,13 @@ GameObjectFactory.register('star', function (x, y, points, innerRadius, outerRad /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -70336,7 +71019,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -70398,7 +71081,7 @@ module.exports = StarWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -70413,9 +71096,9 @@ var TriangleRender = __webpack_require__(70498); * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * The Triangle consists of 3 lines, joining up to form a triangular shape. You can control the * position of each point of these lines. The triangle is always closed and cannot have an open * face. If you require that, consider using a Polygon instead. @@ -70542,7 +71225,7 @@ module.exports = Triangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -70619,7 +71302,7 @@ module.exports = TriangleCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -70630,14 +71313,14 @@ var Triangle = __webpack_require__(21873); * Creates a new Triangle Shape Game Object and adds it to the Scene. * * Note: This method will only be available if the Triangle Game Object has been built into Phaser. - * + * * The Triangle Shape is a Game Object that can be added to a Scene, Group or Container. You can * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * The Triangle consists of 3 lines, joining up to form a triangular shape. You can control the * position of each point of these lines. The triangle is always closed and cannot have an open * face. If you require that, consider using a Polygon instead. @@ -70671,12 +71354,13 @@ GameObjectFactory.register('triangle', function (x, y, x1, y1, x2, y2, x3, y3, f /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -70703,7 +71387,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -70788,7 +71472,7 @@ module.exports = TriangleWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -71134,7 +71818,7 @@ var Sprite = new Class({ * @method Phaser.GameObjects.Sprite#chain * @since 3.50.0 * - * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig|string[]|Phaser.Animations.Animation[]|Phaser.Types.Animations.PlayAnimationConfig[])} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object, or an array of them. + * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig|string[]|Phaser.Animations.Animation[]|Phaser.Types.Animations.PlayAnimationConfig[])} [key] - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object, or an array of them. * * @return {this} This Game Object. */ @@ -71270,7 +71954,7 @@ module.exports = Sprite; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -71305,7 +71989,7 @@ module.exports = SpriteCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -71359,7 +72043,7 @@ GameObjectCreator.register('sprite', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -71406,12 +72090,13 @@ GameObjectFactory.register('sprite', function (x, y, key, frame) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -71438,7 +72123,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -71473,7 +72158,7 @@ module.exports = SpriteWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -71556,7 +72241,7 @@ module.exports = GetTextSize; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -71706,7 +72391,7 @@ module.exports = MeasureText; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -72321,6 +73006,47 @@ var Text = new Class({ return this; }, + /** + * Appends the given text to the content already being displayed by this Text object. + * + * An array of strings will be joined with `\n` line breaks. + * + * @method Phaser.GameObjects.Text#appendText + * @since 3.60.0 + * + * @param {(string|string[])} value - The string, or array of strings, to be appended to the existing content of this Text object. + * @param {boolean} [addCR=true] - Insert a carriage-return before the string value. + * + * @return {this} This Text object. + */ + appendText: function (value, addCR) + { + if (addCR === undefined) { addCR = true; } + + if (!value && value !== 0) + { + value = ''; + } + + if (Array.isArray(value)) + { + value = value.join('\n'); + } + + value = value.toString(); + + var newText = this._text.concat((addCR) ? '\n' + value : value); + + if (newText !== this._text) + { + this._text = newText; + + this.updateText(); + } + + return this; + }, + /** * Set the text style. * @@ -72922,7 +73648,7 @@ var Text = new Class({ if (style.rtl) { - linePositionX = w - linePositionX; + linePositionX = w - linePositionX - padding.left - padding.right; } else if (style.align === 'right') { @@ -73137,7 +73863,7 @@ module.exports = Text; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -73177,7 +73903,7 @@ module.exports = TextCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -73265,7 +73991,7 @@ GameObjectCreator.register('text', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -73331,12 +74057,13 @@ GameObjectFactory.register('text', function (x, y, text, style) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -73363,7 +74090,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -73721,23 +74448,6 @@ var TextStyle = new Class({ // Set to defaults + user style this.setStyle(style, false, true); - - var metrics = GetValue(style, 'metrics', false); - - // Provide optional TextMetrics in the style object to avoid the canvas look-up / scanning - // Doing this is reset if you then change the font of this TextStyle after creation - if (metrics) - { - this.metrics = { - ascent: GetValue(metrics, 'ascent', 0), - descent: GetValue(metrics, 'descent', 0), - fontSize: GetValue(metrics, 'fontSize', 0) - }; - } - else - { - this.metrics = MeasureText(this); - } }, /** @@ -73806,9 +74516,26 @@ var TextStyle = new Class({ this.color = fill; } + var metrics = GetValue(style, 'metrics', false); + + // Provide optional TextMetrics in the style object to avoid the canvas look-up / scanning + // Doing this is reset if you then change the font of this TextStyle after creation + if (metrics) + { + this.metrics = { + ascent: GetValue(metrics, 'ascent', 0), + descent: GetValue(metrics, 'descent', 0), + fontSize: GetValue(metrics, 'fontSize', 0) + }; + } + else if (updateText || !this.metrics) + { + this.metrics = MeasureText(this); + } + if (updateText) { - return this.update(true); + return this.parent.updateText(); } else { @@ -74470,7 +75197,7 @@ module.exports = TextStyle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -74542,7 +75269,7 @@ module.exports = TextWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -74646,6 +75373,13 @@ var TileSprite = new Class({ var displayTexture = scene.sys.textures.get(textureKey); var displayFrame = displayTexture.get(frameKey); + if (displayFrame.source.compressionAlgorithm) + { + console.warn('TileSprite cannot use compressed textures'); + displayTexture = scene.sys.textures.get('__MISSING'); + displayFrame = displayTexture.get(); + } + if (!width || !height) { width = displayFrame.width; @@ -75075,7 +75809,6 @@ var TileSprite = new Class({ this.dirty = true; this.fillPattern = null; this.fillPattern = renderer.createTexture2D(0, gl.LINEAR, gl.LINEAR, gl.REPEAT, gl.REPEAT, gl.RGBA, this.fillCanvas, this.potWidth, this.potHeight); - }, /** @@ -75213,7 +75946,7 @@ module.exports = TileSprite; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -75250,7 +75983,7 @@ module.exports = TileSpriteCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -75303,7 +76036,7 @@ GameObjectCreator.register('tileSprite', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -75348,12 +76081,13 @@ GameObjectFactory.register('tileSprite', function (x, y, width, height, key, fra /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -75380,7 +76114,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -75456,7 +76190,7 @@ module.exports = TileSpriteWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -75533,6 +76267,7 @@ var MATH_CONST = __webpack_require__(83392); * @extends Phaser.GameObjects.Components.BlendMode * @extends Phaser.GameObjects.Components.Depth * @extends Phaser.GameObjects.Components.Flip + * @extends Phaser.GameObjects.Components.FX * @extends Phaser.GameObjects.Components.GetBounds * @extends Phaser.GameObjects.Components.Mask * @extends Phaser.GameObjects.Components.Origin @@ -75558,6 +76293,7 @@ var Video = new Class({ Components.BlendMode, Components.Depth, Components.Flip, + Components.FX, Components.GetBounds, Components.Mask, Components.Origin, @@ -77311,7 +78047,7 @@ module.exports = Video; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -77349,7 +78085,7 @@ module.exports = VideoCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -77386,11 +78122,6 @@ GameObjectCreator.register('video', function (config, addToScene) BuildGameObject(this.scene, video, config); - if (!config.add) - { - this.updateList.add(video); - } - return video; }); @@ -77404,7 +78135,7 @@ GameObjectCreator.register('video', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -77438,12 +78169,13 @@ GameObjectFactory.register('video', function (x, y, key) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -77470,7 +78202,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -77508,7 +78240,7 @@ module.exports = VideoWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -77830,7 +78562,7 @@ module.exports = Zone; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -77870,7 +78602,7 @@ GameObjectCreator.register('zone', function (config) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -77889,7 +78621,7 @@ var GameObjectFactory = __webpack_require__(61286); * @param {number} y - The vertical position of this Game Object in the world. * @param {number} width - The width of the Game Object. * @param {number} height - The height of the Game Object. - * + * * @return {Phaser.GameObjects.Zone} The Game Object that was created. */ GameObjectFactory.register('zone', function (x, y, width, height) @@ -77898,9 +78630,9 @@ GameObjectFactory.register('zone', function (x, y, width, height) }); // When registering a factory function 'this' refers to the GameObjectFactory context. -// +// // There are several properties available to use: -// +// // this.scene - a reference to the Scene that owns the GameObjectFactory // this.displayList - a reference to the Display List the Scene owns // this.updateList - a reference to the Update List the Scene owns @@ -77913,7 +78645,7 @@ GameObjectFactory.register('zone', function (x, y, width, height) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -77942,7 +78674,7 @@ module.exports = Area; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78318,7 +79050,7 @@ module.exports = Circle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78347,7 +79079,7 @@ module.exports = Circumference; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78387,7 +79119,7 @@ module.exports = CircumferencePoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78418,7 +79150,7 @@ module.exports = Clone; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78460,7 +79192,7 @@ module.exports = Contains; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78492,7 +79224,7 @@ module.exports = ContainsPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78529,7 +79261,7 @@ module.exports = ContainsRect; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78562,7 +79294,7 @@ module.exports = CopyFrom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78597,7 +79329,7 @@ module.exports = Equals; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78638,7 +79370,7 @@ module.exports = GetBounds; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78682,7 +79414,7 @@ module.exports = GetPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78735,7 +79467,7 @@ module.exports = GetPoints; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78771,7 +79503,7 @@ module.exports = Offset; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78806,7 +79538,7 @@ module.exports = OffsetPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78851,7 +79583,7 @@ module.exports = Random; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78883,7 +79615,7 @@ module.exports = Circle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78891,7 +79623,7 @@ var GEOM_CONST = { /** * A Circle Geometry object type. - * + * * @name Phaser.Geom.CIRCLE * @type {number} * @since 3.19.0 @@ -78900,7 +79632,7 @@ var GEOM_CONST = { /** * An Ellipse Geometry object type. - * + * * @name Phaser.Geom.ELLIPSE * @type {number} * @since 3.19.0 @@ -78909,7 +79641,7 @@ var GEOM_CONST = { /** * A Line Geometry object type. - * + * * @name Phaser.Geom.LINE * @type {number} * @since 3.19.0 @@ -78918,7 +79650,7 @@ var GEOM_CONST = { /** * A Point Geometry object type. - * + * * @name Phaser.Geom.POINT * @type {number} * @since 3.19.0 @@ -78927,7 +79659,7 @@ var GEOM_CONST = { /** * A Polygon Geometry object type. - * + * * @name Phaser.Geom.POLYGON * @type {number} * @since 3.19.0 @@ -78936,7 +79668,7 @@ var GEOM_CONST = { /** * A Rectangle Geometry object type. - * + * * @name Phaser.Geom.RECTANGLE * @type {number} * @since 3.19.0 @@ -78945,7 +79677,7 @@ var GEOM_CONST = { /** * A Triangle Geometry object type. - * + * * @name Phaser.Geom.TRIANGLE * @type {number} * @since 3.19.0 @@ -78964,7 +79696,7 @@ module.exports = GEOM_CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78999,7 +79731,7 @@ module.exports = Area; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79032,7 +79764,7 @@ module.exports = Circumference; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79075,7 +79807,7 @@ module.exports = CircumferencePoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79106,7 +79838,7 @@ module.exports = Clone; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79149,7 +79881,7 @@ module.exports = Contains; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79181,7 +79913,7 @@ module.exports = ContainsPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79218,7 +79950,7 @@ module.exports = ContainsRect; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79251,7 +79983,7 @@ module.exports = CopyFrom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79634,7 +80366,7 @@ module.exports = Ellipse; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79670,7 +80402,7 @@ module.exports = Equals; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79711,7 +80443,7 @@ module.exports = GetBounds; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79755,7 +80487,7 @@ module.exports = GetPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79810,7 +80542,7 @@ module.exports = GetPoints; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79846,7 +80578,7 @@ module.exports = Offset; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79881,7 +80613,7 @@ module.exports = OffsetPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79923,7 +80655,7 @@ module.exports = Random; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79955,7 +80687,7 @@ module.exports = Ellipse; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79993,7 +80725,7 @@ module.exports = Geom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80025,7 +80757,7 @@ module.exports = CircleToCircle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80081,7 +80813,7 @@ module.exports = CircleToRectangle; /** * @author Florian Vazelle * @author Geoffrey Glaive - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80176,7 +80908,7 @@ module.exports = GetCircleToCircle; /** * @author Florian Vazelle * @author Geoffrey Glaive - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80227,7 +80959,7 @@ module.exports = GetCircleToRectangle; /** * @author Florian Vazelle * @author Geoffrey Glaive - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80319,15 +81051,15 @@ module.exports = GetLineToCircle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var Vector3 = __webpack_require__(70015); /** - * Checks for intersection between the two line segments and returns the intersection point as a Vector3, - * or `null` if the lines are parallel, or do not intersect. + * Checks for intersection between the two line segments, or a ray and a line segment, + * and returns the intersection point as a Vector3, or `null` if the lines are parallel, or do not intersect. * * The `z` property of the Vector3 contains the intersection distance, which can be used to find * the closest intersecting point from a group of line segments. @@ -80335,14 +81067,17 @@ var Vector3 = __webpack_require__(70015); * @function Phaser.Geom.Intersects.GetLineToLine * @since 3.50.0 * - * @param {Phaser.Geom.Line} line1 - The first line segment to check. + * @param {Phaser.Geom.Line} line1 - The first line segment, or a ray, to check. * @param {Phaser.Geom.Line} line2 - The second line segment to check. + * @param {boolean} [isRay=false] - Is `line1` a ray or a line segment? * @param {Phaser.Math.Vector3} [out] - A Vector3 to store the intersection results in. * * @return {Phaser.Math.Vector3} A Vector3 containing the intersection results, or `null`. */ -var GetLineToLine = function (line1, line2, out) +var GetLineToLine = function (line1, line2, isRay, out) { + if (isRay === undefined) { isRay = false; } + var x1 = line1.x1; var y1 = line1.y1; var x2 = line1.x2; @@ -80370,13 +81105,35 @@ var GetLineToLine = function (line1, line2, out) return false; } - var t = ((x3 - x1) * dy2 - (y3 - y1) * dx2) / denom; - var u = ((y1 - y3) * dx1 - (x1 - x3) * dy1) / denom; + var t; + var u; + var s; - // Intersects? - if (t < 0 || t > 1 || u < 0 || u > 1) + if (isRay) { - return null; + t = (dx1 * (y3 - y1) + dy1 * (x1 - x3)) / (dx2 * dy1 - dy2 * dx1); + u = (x3 + dx2 * t - x1) / dx1; + + // Intersects? + if (u < 0 || t < 0 || t > 1) + { + return null; + } + + s = u; + } + else + { + t = ((x3 - x1) * dy2 - (y3 - y1) * dx2) / denom; + u = ((y1 - y3) * dx1 - (x1 - x3) * dy1) / denom; + + // Intersects? + if (t < 0 || t > 1 || u < 0 || u > 1) + { + return null; + } + + s = t; } if (out === undefined) @@ -80385,9 +81142,9 @@ var GetLineToLine = function (line1, line2, out) } return out.set( - x1 + dx1 * t, - y1 + dy1 * t, - t + x1 + dx1 * s, + y1 + dy1 * s, + s ); }; @@ -80401,13 +81158,13 @@ module.exports = GetLineToLine; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Vector3 = __webpack_require__(70015); var GetLineToLine = __webpack_require__(96537); var Line = __webpack_require__(88829); +var Vector3 = __webpack_require__(70015); // Temp calculation segment var segment = new Line(); @@ -80429,14 +81186,16 @@ var tempIntersect = new Vector3(); * @function Phaser.Geom.Intersects.GetLineToPoints * @since 3.50.0 * - * @param {Phaser.Geom.Line} line - The line segment to check. + * @param {Phaser.Geom.Line} line - The line segment, or ray, to check. If a ray, set the `isRay` parameter to `true`. * @param {Phaser.Math.Vector2[] | Phaser.Geom.Point[]} points - An array of points to check. + * @param {boolean} [isRay=false] - Is `line` a ray or a line segment? * @param {Phaser.Math.Vector3} [out] - A Vector3 to store the intersection results in. * * @return {Phaser.Math.Vector3} A Vector3 containing the intersection results, or `null`. */ -var GetLineToPoints = function (line, points, out) +var GetLineToPoints = function (line, points, isRay, out) { + if (isRay === undefined) { isRay = false; } if (out === undefined) { out = new Vector3(); } var closestIntersect = false; @@ -80455,7 +81214,7 @@ var GetLineToPoints = function (line, points, out) prev = current; - if (GetLineToLine(line, segment, tempIntersect)) + if (GetLineToLine(line, segment, isRay, tempIntersect)) { if (!closestIntersect || tempIntersect.z < out.z) { @@ -80479,7 +81238,7 @@ module.exports = GetLineToPoints; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80504,13 +81263,14 @@ var tempIntersect = new Vector3(); * @function Phaser.Geom.Intersects.GetLineToPolygon * @since 3.50.0 * - * @param {Phaser.Geom.Line} line - The line segment to check. + * @param {Phaser.Geom.Line} line - The line segment, or ray, to check. If a ray, set the `isRay` parameter to `true`. * @param {Phaser.Geom.Polygon | Phaser.Geom.Polygon[]} polygons - A single polygon, or array of polygons, to check. + * @param {boolean} [isRay=false] - Is `line` a ray or a line segment? * @param {Phaser.Math.Vector4} [out] - A Vector4 to store the intersection results in. * * @return {Phaser.Math.Vector4} A Vector4 containing the intersection results, or `null`. */ -var GetLineToPolygon = function (line, polygons, out) +var GetLineToPolygon = function (line, polygons, isRay, out) { if (out === undefined) { out = new Vector4(); } @@ -80527,7 +81287,7 @@ var GetLineToPolygon = function (line, polygons, out) for (var i = 0; i < polygons.length; i++) { - if (GetLineToPoints(line, polygons[i].points, tempIntersect)) + if (GetLineToPoints(line, polygons[i].points, isRay, tempIntersect)) { if (!closestIntersect || tempIntersect.z < out.z) { @@ -80552,7 +81312,7 @@ module.exports = GetLineToPolygon; /** * @author Florian Vazelle * @author Geoffrey Glaive - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80612,7 +81372,7 @@ module.exports = GetLineToRectangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80633,7 +81393,7 @@ function CheckIntersects (angle, x, y, polygons, intersects) segment.setTo(x, y, x + dx, y + dy); - var closestIntersect = GetLineToPolygon(segment, polygons); + var closestIntersect = GetLineToPolygon(segment, polygons, true); if (closestIntersect) { @@ -80715,7 +81475,7 @@ module.exports = GetRaysFromPointToPolygon; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80724,9 +81484,9 @@ var RectangleToRectangle = __webpack_require__(90205); /** * Checks if two Rectangle shapes intersect and returns the area of this intersection as Rectangle object. - * + * * If optional `output` parameter is omitted, new Rectangle object is created and returned. If there is intersection, it will contain intersection area. If there is no intersection, it wil be empty Rectangle (all values set to zero). - * + * * If Rectangle object is passed as `output` and there is intersection, then intersection area data will be loaded into it and it will be returned. If there is no intersection, it will be returned without any change. * * @function Phaser.Geom.Intersects.GetRectangleIntersection @@ -80766,7 +81526,7 @@ module.exports = GetRectangleIntersection; /** * @author Florian Vazelle * @author Geoffrey Glaive - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80818,7 +81578,7 @@ module.exports = GetRectangleToRectangle; /** * @author Florian Vazelle * @author Geoffrey Glaive - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80867,7 +81627,7 @@ module.exports = GetRectangleToTriangle; /** * @author Florian Vazelle * @author Geoffrey Glaive - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80917,7 +81677,7 @@ module.exports = GetTriangleToCircle; /** * @author Florian Vazelle * @author Geoffrey Glaive - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80977,7 +81737,7 @@ module.exports = GetTriangleToLine; /** * @author Florian Vazelle * @author Geoffrey Glaive - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81026,7 +81786,7 @@ module.exports = GetTriangleToTriangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81090,10 +81850,10 @@ var LineToCircle = function (line, circle, nearest) nearest.x = line.x1 + px; nearest.y = line.y1 + py; - + // len2 of p var pLen2 = (px * px) + (py * py); - + return ( pLen2 <= dLen2 && ((px * dx) + (py * dy)) >= 0 && @@ -81111,7 +81871,7 @@ module.exports = LineToCircle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81188,7 +81948,7 @@ module.exports = LineToLine; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81291,13 +82051,13 @@ module.exports = LineToRectangle; /** * @author Richard Davey * @author Florian Mertens - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Checks if the a Point falls between the two end-points of a Line, based on the given line thickness. - * + * * Assumes that the line end points are circular, not square. * * @function Phaser.Geom.Intersects.PointToLine @@ -81361,7 +82121,7 @@ module.exports = PointToLine; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81403,7 +82163,7 @@ module.exports = PointToLineSegment; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81442,7 +82202,7 @@ module.exports = RectangleToRectangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81536,7 +82296,7 @@ module.exports = RectangleToTriangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81577,7 +82337,7 @@ module.exports = RectangleToValues; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81643,7 +82403,7 @@ module.exports = TriangleToCircle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81699,7 +82459,7 @@ module.exports = TriangleToLine; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81790,7 +82550,7 @@ module.exports = TriangleToTriangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81838,7 +82598,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81867,7 +82627,7 @@ module.exports = Angle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81942,7 +82702,7 @@ module.exports = BresenhamPoints; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81983,7 +82743,7 @@ module.exports = CenterOn; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82014,7 +82774,7 @@ module.exports = Clone; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82046,7 +82806,7 @@ module.exports = CopyFrom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82081,7 +82841,7 @@ module.exports = Equals; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82140,7 +82900,7 @@ module.exports = Extend; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82261,7 +83021,7 @@ module.exports = GetEasedPoints; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82301,7 +83061,7 @@ module.exports = GetMidPoint; /** * @author Richard Davey * @author Florian Mertens - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82356,7 +83116,7 @@ module.exports = GetNearestPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82401,7 +83161,7 @@ module.exports = GetNormal; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82441,7 +83201,7 @@ module.exports = GetPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82508,7 +83268,7 @@ module.exports = GetPoints; /** * @author Richard Davey * @author Florian Mertens - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82555,7 +83315,7 @@ module.exports = GetShortestDistance; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82584,7 +83344,7 @@ module.exports = Height; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82613,7 +83373,7 @@ module.exports = Length; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82951,7 +83711,7 @@ module.exports = Line; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82986,7 +83746,7 @@ module.exports = NormalAngle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83018,7 +83778,7 @@ module.exports = NormalX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83051,7 +83811,7 @@ module.exports = NormalY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83090,7 +83850,7 @@ module.exports = Offset; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83119,7 +83879,7 @@ module.exports = PerpSlope; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83160,7 +83920,7 @@ module.exports = Random; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83195,7 +83955,7 @@ module.exports = ReflectAngle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83232,7 +83992,7 @@ module.exports = Rotate; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83267,7 +84027,7 @@ module.exports = RotateAroundPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83316,7 +84076,7 @@ module.exports = RotateAroundXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83357,7 +84117,7 @@ module.exports = SetToAngle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83386,7 +84146,7 @@ module.exports = Slope; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83415,7 +84175,7 @@ module.exports = Width; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83461,7 +84221,7 @@ module.exports = Line; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -84026,7 +84786,7 @@ module.exports = Face; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -84269,7 +85029,7 @@ module.exports = GenerateGridVerts; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -84414,7 +85174,7 @@ module.exports = GenerateObjVerts; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -84606,7 +85366,7 @@ module.exports = GenerateVerts; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -84923,7 +85683,7 @@ module.exports = ParseObj; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85002,7 +85762,7 @@ module.exports = ParseObjMaterial; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85068,7 +85828,7 @@ module.exports = RotateFace; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85365,7 +86125,7 @@ module.exports = Vertex; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85396,7 +86156,7 @@ module.exports = Mesh; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85427,7 +86187,7 @@ module.exports = Ceil; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85458,7 +86218,7 @@ module.exports = Clone; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85490,7 +86250,7 @@ module.exports = CopyFrom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85520,7 +86280,7 @@ module.exports = Equals; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85551,7 +86311,7 @@ module.exports = Floor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85616,7 +86376,7 @@ module.exports = GetCentroid; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85645,7 +86405,7 @@ module.exports = GetMagnitude; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85674,7 +86434,7 @@ module.exports = GetMagnitudeSq; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85745,7 +86505,7 @@ module.exports = GetRectangleFromPoints; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85787,7 +86547,7 @@ module.exports = Interpolate; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85818,7 +86578,7 @@ module.exports = Invert; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85854,7 +86614,7 @@ module.exports = Negative; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85948,7 +86708,7 @@ module.exports = Point; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85996,7 +86756,7 @@ module.exports = Project; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -86042,7 +86802,7 @@ module.exports = ProjectUnit; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -86087,7 +86847,7 @@ module.exports = SetMagnitude; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -86119,7 +86879,7 @@ module.exports = Point; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -86150,7 +86910,7 @@ module.exports = Clone; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -86200,7 +86960,7 @@ module.exports = Contains; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -86233,7 +86993,7 @@ module.exports = ContainsPoint; "use strict"; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -86997,7 +87757,7 @@ module.exports = earcut; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87054,7 +87814,7 @@ module.exports = GetAABB; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87098,7 +87858,7 @@ module.exports = GetNumberArray; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87176,7 +87936,7 @@ module.exports = GetPoints; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87225,7 +87985,7 @@ module.exports = Perimeter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87460,7 +88220,7 @@ module.exports = Polygon; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87700,7 +88460,7 @@ module.exports = Simplify; /** * @author Richard Davey * @author Igor Ognichenko - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87711,7 +88471,7 @@ var copy = function (out, a) { out[0] = a[0]; out[1] = a[1]; - + return out; }; @@ -87739,12 +88499,12 @@ var Smooth = function (polygon) } var output = []; - + if (points.length > 0) { output.push(copy([ 0, 0 ], points[0])); } - + for (i = 0; i < points.length - 1; i++) { var p0 = points[i]; @@ -87757,12 +88517,12 @@ var Smooth = function (polygon) output.push([ 0.85 * p0x + 0.15 * p1x, 0.85 * p0y + 0.15 * p1y ]); output.push([ 0.15 * p0x + 0.85 * p1x, 0.15 * p0y + 0.85 * p1y ]); } - + if (points.length > 1) { output.push(copy([ 0, 0 ], points[points.length - 1])); } - + return polygon.setTo(output); }; @@ -87776,7 +88536,7 @@ module.exports = Smooth; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87817,7 +88577,7 @@ module.exports = Translate; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87846,7 +88606,7 @@ module.exports = Polygon; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87875,7 +88635,7 @@ module.exports = Area; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87909,7 +88669,7 @@ module.exports = Ceil; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87945,7 +88705,7 @@ module.exports = CeilAll; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87983,7 +88743,7 @@ module.exports = CenterOn; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88014,7 +88774,7 @@ module.exports = Clone; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88050,7 +88810,7 @@ module.exports = Contains; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88082,7 +88842,7 @@ module.exports = ContainsPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88123,7 +88883,7 @@ module.exports = ContainsRect; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88155,7 +88915,7 @@ module.exports = CopyFrom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88193,7 +88953,7 @@ module.exports = Decompose; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88228,7 +88988,7 @@ module.exports = Equals; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88238,7 +88998,7 @@ var GetAspectRatio = __webpack_require__(6700); * Adjusts the target rectangle, changing its width, height and position, * so that it fits inside the area of the source rectangle, while maintaining its original * aspect ratio. - * + * * Unlike the `FitOutside` function, there may be some space inside the source area not covered. * * @function Phaser.Geom.Rectangle.FitInside @@ -88282,7 +89042,7 @@ module.exports = FitInside; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88292,7 +89052,7 @@ var GetAspectRatio = __webpack_require__(6700); * Adjusts the target rectangle, changing its width, height and position, * so that it fully covers the area of the source rectangle, while maintaining its original * aspect ratio. - * + * * Unlike the `FitInside` function, the target rectangle may extend further out than the source. * * @function Phaser.Geom.Rectangle.FitOutside @@ -88336,7 +89096,7 @@ module.exports = FitOutside; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88370,7 +89130,7 @@ module.exports = Floor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88406,7 +89166,7 @@ module.exports = FloorAll; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88493,7 +89253,7 @@ module.exports = FromPoints; /** * @author samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88537,7 +89297,7 @@ module.exports = FromXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88566,7 +89326,7 @@ module.exports = GetAspectRatio; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88605,7 +89365,7 @@ module.exports = GetCenter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88614,9 +89374,9 @@ var Point = __webpack_require__(79967); /** * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. - * + * * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. - * + * * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side. * * @function Phaser.Geom.Rectangle.GetPoint @@ -88687,7 +89447,7 @@ module.exports = GetPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88742,7 +89502,7 @@ module.exports = GetPoints; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88783,7 +89543,7 @@ module.exports = GetSize; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88826,7 +89586,7 @@ module.exports = Inflate; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88878,7 +89638,7 @@ module.exports = Intersection; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88998,7 +89758,7 @@ module.exports = MarchingAnts; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -89048,7 +89808,7 @@ module.exports = MergePoints; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -89096,7 +89856,7 @@ module.exports = MergeRect; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -89141,7 +89901,7 @@ module.exports = MergeXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -89177,7 +89937,7 @@ module.exports = Offset; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -89212,7 +89972,7 @@ module.exports = OffsetPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -89247,7 +90007,7 @@ module.exports = Overlaps; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -89276,7 +90036,7 @@ module.exports = Perimeter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -89334,7 +90094,7 @@ module.exports = PerimeterPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -89373,7 +90133,7 @@ module.exports = Random; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -89445,7 +90205,7 @@ module.exports = RandomOutside; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -89552,9 +90312,9 @@ var Rectangle = new Class({ /** * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. - * + * * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. - * + * * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side. * * @method Phaser.Geom.Rectangle#getPoint @@ -89957,7 +90717,7 @@ module.exports = Rectangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -89987,7 +90747,7 @@ module.exports = SameDimensions; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90027,7 +90787,7 @@ module.exports = Scale; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90070,7 +90830,7 @@ module.exports = Union; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90125,7 +90885,7 @@ module.exports = Rectangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90165,7 +90925,7 @@ module.exports = Area; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90210,7 +90970,7 @@ module.exports = BuildEquilateral; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90287,7 +91047,7 @@ module.exports = BuildFromPolygon; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90337,7 +91097,7 @@ module.exports = BuildRight; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90391,7 +91151,7 @@ module.exports = CenterOn; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90436,7 +91196,7 @@ module.exports = Centroid; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90513,7 +91273,7 @@ module.exports = CircumCenter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90597,7 +91357,7 @@ module.exports = CircumCircle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90628,7 +91388,7 @@ module.exports = Clone; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90682,7 +91442,7 @@ module.exports = Contains; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90745,7 +91505,7 @@ var ContainsArray = function (triangle, points, returnFirst, out) u = ((dot11 * dot02) - (dot01 * dot12)) * inv; v = ((dot00 * dot12) - (dot01 * dot02)) * inv; - + if (u >= 0 && v >= 0 && (u + v < 1)) { out.push({ x: points[i].x, y: points[i].y }); @@ -90770,7 +91530,7 @@ module.exports = ContainsArray; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90802,7 +91562,7 @@ module.exports = ContainsPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90834,7 +91594,7 @@ module.exports = CopyFrom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90870,7 +91630,7 @@ module.exports = Decompose; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90907,7 +91667,7 @@ module.exports = Equals; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90995,7 +91755,7 @@ module.exports = GetPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -91089,7 +91849,7 @@ module.exports = GetPoints; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -91155,7 +91915,7 @@ module.exports = InCenter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -91197,7 +91957,7 @@ module.exports = Offset; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -91233,7 +91993,7 @@ module.exports = Perimeter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -91290,7 +92050,7 @@ module.exports = Random; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -91327,7 +92087,7 @@ module.exports = Rotate; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -91362,7 +92122,7 @@ module.exports = RotateAroundPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -91417,7 +92177,7 @@ module.exports = RotateAroundXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -91865,7 +92625,7 @@ module.exports = Triangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -91906,13 +92666,13 @@ module.exports = Triangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Creates a new Interactive Object. - * + * * This is called automatically by the Input Manager when you enable a Game Object for input. * * The resulting Interactive Object is mapped to the Game Object's `input` property. @@ -91978,7 +92738,7 @@ module.exports = CreateInteractiveObject; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -92015,7 +92775,7 @@ module.exports = CreatePixelPerfectHandler; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -92330,15 +93090,18 @@ var InputManager = new Class({ */ boot: function () { - this.canvas = this.game.canvas; + var game = this.game; + var events = game.events; - this.scaleManager = this.game.scale; + this.canvas = game.canvas; + + this.scaleManager = game.scale; this.events.emit(Events.MANAGER_BOOT); - this.game.events.on(GameEvents.PRE_RENDER, this.preRender, this); + events.on(GameEvents.PRE_RENDER, this.preRender, this); - this.game.events.once(GameEvents.DESTROY, this.destroy, this); + events.once(GameEvents.DESTROY, this.destroy, this); }, /** @@ -92626,11 +93389,26 @@ var InputManager = new Class({ if (pointer.active && pointer.identifier === changedTouch.identifier) { - pointer.touchmove(changedTouch, event); + var element = document.elementFromPoint(changedTouch.pageX, changedTouch.pageY); + var overCanvas = element === this.canvas; - this.activePointer = pointer; + if (!this.isOver && overCanvas) + { + this.setCanvasOver(event); + } + else if (this.isOver && !overCanvas) + { + this.setCanvasOut(event); + } - changed.push(pointer); + if (this.isOver) + { + pointer.touchmove(changedTouch, event); + + this.activePointer = pointer; + + changed.push(pointer); + } break; } @@ -93108,7 +93886,7 @@ module.exports = InputManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -93885,12 +94663,20 @@ var InputPlugin = new Class({ { if (skipQueue === undefined) { skipQueue = false; } + this.disable(gameObject); + var input = gameObject.input; // If GameObject.input already cleared from higher class - if (!input) + if (input) { - return; + input.gameObject = undefined; + input.target = undefined; + input.hitArea = undefined; + input.hitAreaCallback = undefined; + input.callbackContext = undefined; + + gameObject.input = null; } if (!skipQueue) @@ -93898,15 +94684,6 @@ var InputPlugin = new Class({ this.queueForRemoval(gameObject); } - input.gameObject = undefined; - input.target = undefined; - input.hitArea = undefined; - input.hitAreaCallback = undefined; - input.callbackContext = undefined; - - gameObject.input = null; - - // Clear from _draggable, _drag and _over var index = this._draggable.indexOf(gameObject); if (index > -1) @@ -93914,22 +94691,6 @@ var InputPlugin = new Class({ this._draggable.splice(index, 1); } - index = this._drag[0].indexOf(gameObject); - - if (index > -1) - { - this._drag[0].splice(index, 1); - } - - index = this._over[0].indexOf(gameObject); - - if (index > -1) - { - this._over[0].splice(index, 1); - - this.manager.resetCursor(input); - } - return gameObject; }, @@ -93943,10 +94704,52 @@ var InputPlugin = new Class({ * @since 3.0.0 * * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to have its input system disabled. + * + * @return {this} This Input Plugin. */ disable: function (gameObject) { - gameObject.input.enabled = false; + var input = gameObject.input; + + if (input) + { + input.enabled = false; + input.dragState = 0; + } + + // Clear from _temp, _drag and _over + var temp = this._temp; + var drag = this._drag; + var over = this._over; + var manager = this.manager; + + var index = temp.indexOf(gameObject); + + if (index > -1) + { + temp.splice(index, 1); + } + + for (var i = 0; i < manager.pointersTotal; i++) + { + index = drag[i].indexOf(gameObject); + + if (index > -1) + { + drag[i].splice(index, 1); + } + + index = over[i].indexOf(gameObject); + + if (index > -1) + { + over[i].splice(index, 1); + + manager.resetCursor(input); + } + } + + return this; }, /** @@ -95532,6 +96335,7 @@ var InputPlugin = new Class({ var offsetx = 0; var offsety = 0; + switch (shapeType) { case GEOM_CONST.CIRCLE: @@ -95568,10 +96372,11 @@ var InputPlugin = new Class({ if (debug) { debug.isFilled = false; + debug.strokeColor = color; debug.preUpdate = function () { - debug.setStrokeStyle(1 / gameObject.scale, color); + debug.setStrokeStyle(1 / gameObject.scale, debug.strokeColor); debug.setDisplayOrigin(gameObject.displayOriginX, gameObject.displayOriginY); @@ -95745,7 +96550,7 @@ var InputPlugin = new Class({ */ sortGameObjects: function (gameObjects, pointer) { - if (gameObjects.length < 2) + if (gameObjects.length < 2 || !pointer.camera) { return gameObjects; } @@ -95754,7 +96559,10 @@ var InputPlugin = new Class({ return gameObjects.sort(function (childA, childB) { - return list.indexOf(childB) - list.indexOf(childA); + var indexA = Math.max(list.indexOf(childA), 0); + var indexB = Math.max(list.indexOf(childB), 0); + + return indexB - indexA; }); }, @@ -96320,7 +97128,7 @@ module.exports = InputPlugin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -96429,7 +97237,7 @@ module.exports = InputPluginCache; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -97716,7 +98524,7 @@ module.exports = Pointer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -97724,7 +98532,7 @@ var INPUT_CONST = { /** * The mouse pointer is being held down. - * + * * @name Phaser.Input.MOUSE_DOWN * @type {number} * @since 3.10.0 @@ -97733,7 +98541,7 @@ var INPUT_CONST = { /** * The mouse pointer is being moved. - * + * * @name Phaser.Input.MOUSE_MOVE * @type {number} * @since 3.10.0 @@ -97742,7 +98550,7 @@ var INPUT_CONST = { /** * The mouse pointer is released. - * + * * @name Phaser.Input.MOUSE_UP * @type {number} * @since 3.10.0 @@ -97751,7 +98559,7 @@ var INPUT_CONST = { /** * A touch pointer has been started. - * + * * @name Phaser.Input.TOUCH_START * @type {number} * @since 3.10.0 @@ -97760,7 +98568,7 @@ var INPUT_CONST = { /** * A touch pointer has been started. - * + * * @name Phaser.Input.TOUCH_MOVE * @type {number} * @since 3.10.0 @@ -97769,7 +98577,7 @@ var INPUT_CONST = { /** * A touch pointer has been started. - * + * * @name Phaser.Input.TOUCH_END * @type {number} * @since 3.10.0 @@ -97778,7 +98586,7 @@ var INPUT_CONST = { /** * The pointer lock has changed. - * + * * @name Phaser.Input.POINTER_LOCK_CHANGE * @type {number} * @since 3.10.0 @@ -97787,7 +98595,7 @@ var INPUT_CONST = { /** * A touch pointer has been been cancelled by the browser. - * + * * @name Phaser.Input.TOUCH_CANCEL * @type {number} * @since 3.15.0 @@ -97796,7 +98604,7 @@ var INPUT_CONST = { /** * The mouse wheel changes. - * + * * @name Phaser.Input.MOUSE_WHEEL * @type {number} * @since 3.18.0 @@ -97815,13 +98623,13 @@ module.exports = INPUT_CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Input Plugin Boot Event. - * + * * This internal event is dispatched by the Input Plugin when it boots, signalling to all of its systems to create themselves. * * @event Phaser.Input.Events#BOOT @@ -97837,13 +98645,13 @@ module.exports = 'boot'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Input Plugin Destroy Event. - * + * * This internal event is dispatched by the Input Plugin when it is destroyed, signalling to all of its systems to destroy themselves. * * @event Phaser.Input.Events#DESTROY @@ -97859,22 +98667,22 @@ module.exports = 'destroy'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Drag End Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer stops dragging a Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('dragend', listener)`. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_END]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_END} event instead. * * @event Phaser.Input.Events#DRAG_END * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object that this pointer stopped dragging. */ @@ -97888,24 +98696,24 @@ module.exports = 'dragend'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Drag Enter Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer drags a Game Object into a Drag Target. - * + * * Listen to this event from within a Scene using: `this.input.on('dragenter', listener)`. - * + * * A Pointer can only drag a single Game Object at once. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_ENTER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_ENTER} event instead. * * @event Phaser.Input.Events#DRAG_ENTER * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object that this pointer is dragging. * @param {Phaser.GameObjects.GameObject} target - The drag target that this pointer has moved into. @@ -97920,24 +98728,24 @@ module.exports = 'dragenter'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Drag Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves while dragging a Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('drag', listener)`. - * + * * A Pointer can only drag a single Game Object at once. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG} event instead. * * @event Phaser.Input.Events#DRAG * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object that this pointer is dragging. * @param {number} dragX - The x coordinate where the Pointer is currently dragging the Game Object, in world space. @@ -97953,24 +98761,24 @@ module.exports = 'drag'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Drag Leave Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer drags a Game Object out of a Drag Target. - * + * * Listen to this event from within a Scene using: `this.input.on('dragleave', listener)`. - * + * * A Pointer can only drag a single Game Object at once. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_LEAVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_LEAVE} event instead. * * @event Phaser.Input.Events#DRAG_LEAVE * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object that this pointer is dragging. * @param {Phaser.GameObjects.GameObject} target - The drag target that this pointer has left. @@ -97985,27 +98793,27 @@ module.exports = 'dragleave'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Drag Over Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer drags a Game Object over a Drag Target. - * + * * When the Game Object first enters the drag target it will emit a `dragenter` event. If it then moves while within * the drag target, it will emit this event instead. - * + * * Listen to this event from within a Scene using: `this.input.on('dragover', listener)`. - * + * * A Pointer can only drag a single Game Object at once. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_OVER} event instead. * * @event Phaser.Input.Events#DRAG_OVER * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object that this pointer is dragging. * @param {Phaser.GameObjects.GameObject} target - The drag target that this pointer has moved over. @@ -98020,24 +98828,24 @@ module.exports = 'dragover'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Drag Start Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer starts to drag any Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('dragstart', listener)`. - * + * * A Pointer can only drag a single Game Object at once. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_START]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_START} event instead. * * @event Phaser.Input.Events#DRAG_START * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object that this pointer is dragging. */ @@ -98051,22 +98859,22 @@ module.exports = 'dragstart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Drop Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer drops a Game Object on a Drag Target. - * + * * Listen to this event from within a Scene using: `this.input.on('drop', listener)`. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DROP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DROP} event instead. * * @event Phaser.Input.Events#DROP * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object that this pointer was dragging. * @param {Phaser.GameObjects.GameObject} target - The Drag Target the `gameObject` has been dropped on. @@ -98081,34 +98889,34 @@ module.exports = 'drop'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Down Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is pressed down on _any_ interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('gameobjectdown', listener)`. - * + * * To receive this event, the Game Objects must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} event instead. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} * 2. [GAMEOBJECT_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DOWN} * 3. [POINTER_DOWN]{@linkcode Phaser.Input.Events#event:POINTER_DOWN} or [POINTER_DOWN_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_DOWN_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_DOWN * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the pointer was pressed down on. * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow. @@ -98123,24 +98931,24 @@ module.exports = 'gameobjectdown'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Drag End Event. - * + * * This event is dispatched by an interactive Game Object if a pointer stops dragging it. - * + * * Listen to this event from a Game Object using: `gameObject.on('dragend', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive and enabled for drag. * See [GameObject.setInteractive](Phaser.GameObjects.GameObject#setInteractive) for more details. * * @event Phaser.Input.Events#GAMEOBJECT_DRAG_END * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {number} dragX - The x coordinate where the Pointer stopped dragging the Game Object, in world space. * @param {number} dragY - The y coordinate where the Pointer stopped dragging the Game Object, in world space. @@ -98155,24 +98963,24 @@ module.exports = 'dragend'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Drag Enter Event. - * + * * This event is dispatched by an interactive Game Object if a pointer drags it into a drag target. - * + * * Listen to this event from a Game Object using: `gameObject.on('dragenter', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive and enabled for drag. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. * * @event Phaser.Input.Events#GAMEOBJECT_DRAG_ENTER * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} target - The drag target that this pointer has moved into. */ @@ -98186,24 +98994,24 @@ module.exports = 'dragenter'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Drag Event. - * + * * This event is dispatched by an interactive Game Object if a pointer moves while dragging it. - * + * * Listen to this event from a Game Object using: `gameObject.on('drag', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive and enabled for drag. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. * * @event Phaser.Input.Events#GAMEOBJECT_DRAG * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {number} dragX - The x coordinate where the Pointer is currently dragging the Game Object, in world space. * @param {number} dragY - The y coordinate where the Pointer is currently dragging the Game Object, in world space. @@ -98218,24 +99026,24 @@ module.exports = 'drag'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Drag Leave Event. - * + * * This event is dispatched by an interactive Game Object if a pointer drags it out of a drag target. - * + * * Listen to this event from a Game Object using: `gameObject.on('dragleave', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive and enabled for drag. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. * * @event Phaser.Input.Events#GAMEOBJECT_DRAG_LEAVE * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} target - The drag target that this pointer has left. */ @@ -98249,27 +99057,27 @@ module.exports = 'dragleave'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Drag Over Event. - * + * * This event is dispatched by an interactive Game Object if a pointer drags it over a drag target. - * + * * When the Game Object first enters the drag target it will emit a `dragenter` event. If it then moves while within * the drag target, it will emit this event instead. - * + * * Listen to this event from a Game Object using: `gameObject.on('dragover', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive and enabled for drag. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. * * @event Phaser.Input.Events#GAMEOBJECT_DRAG_OVER * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} target - The drag target that this pointer has moved over. */ @@ -98283,27 +99091,27 @@ module.exports = 'dragover'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Drag Start Event. - * + * * This event is dispatched by an interactive Game Object if a pointer starts to drag it. - * + * * Listen to this event from a Game Object using: `gameObject.on('dragstart', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive and enabled for drag. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * There are lots of useful drag related properties that are set within the Game Object when dragging occurs. * For example, `gameObject.input.dragStartX`, `dragStartY` and so on. * * @event Phaser.Input.Events#GAMEOBJECT_DRAG_START * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {number} dragX - The x coordinate where the Pointer is currently dragging the Game Object, in world space. * @param {number} dragY - The y coordinate where the Pointer is currently dragging the Game Object, in world space. @@ -98318,24 +99126,24 @@ module.exports = 'dragstart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Drop Event. - * + * * This event is dispatched by an interactive Game Object if a pointer drops it on a Drag Target. - * + * * Listen to this event from a Game Object using: `gameObject.on('drop', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive and enabled for drag. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. * * @event Phaser.Input.Events#GAMEOBJECT_DROP * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} target - The Drag Target the `gameObject` has been dropped on. */ @@ -98349,34 +99157,34 @@ module.exports = 'drop'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Move Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is moved across _any_ interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('gameobjectmove', listener)`. - * + * * To receive this event, the Game Objects must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_MOVE} event instead. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_MOVE} * 2. [GAMEOBJECT_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_MOVE} * 3. [POINTER_MOVE]{@linkcode Phaser.Input.Events#event:POINTER_MOVE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_MOVE * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the pointer was moved on. * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow. @@ -98391,34 +99199,37 @@ module.exports = 'gameobjectmove'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Out Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves out of _any_ interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('gameobjectout', listener)`. - * + * * To receive this event, the Game Objects must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OUT} event instead. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OUT} * 2. [GAMEOBJECT_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OUT} * 3. [POINTER_OUT]{@linkcode Phaser.Input.Events#event:POINTER_OUT} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * + * If the pointer leaves the game canvas itself, it will not trigger an this event. To handle those cases, + * please listen for the [GAME_OUT]{@linkcode Phaser.Input.Events#event:GAME_OUT} event. + * * @event Phaser.Input.Events#GAMEOBJECT_OUT * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the pointer moved out of. * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow. @@ -98433,34 +99244,34 @@ module.exports = 'gameobjectout'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Over Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves over _any_ interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('gameobjectover', listener)`. - * + * * To receive this event, the Game Objects must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OVER} event instead. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OVER} * 2. [GAMEOBJECT_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OVER} * 3. [POINTER_OVER]{@linkcode Phaser.Input.Events#event:POINTER_OVER} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_OVER * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the pointer moved over. * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow. @@ -98475,33 +99286,33 @@ module.exports = 'gameobjectover'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Pointer Down Event. - * + * * This event is dispatched by an interactive Game Object if a pointer is pressed down on it. - * + * * Listen to this event from a Game Object using: `gameObject.on('pointerdown', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} * 2. [GAMEOBJECT_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DOWN} * 3. [POINTER_DOWN]{@linkcode Phaser.Input.Events#event:POINTER_DOWN} or [POINTER_DOWN_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_DOWN_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_POINTER_DOWN * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {number} localX - The x coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. * @param {number} localY - The y coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. @@ -98517,33 +99328,33 @@ module.exports = 'pointerdown'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Pointer Move Event. - * + * * This event is dispatched by an interactive Game Object if a pointer is moved while over it. - * + * * Listen to this event from a Game Object using: `gameObject.on('pointermove', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_MOVE} * 2. [GAMEOBJECT_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_MOVE} * 3. [POINTER_MOVE]{@linkcode Phaser.Input.Events#event:POINTER_MOVE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_POINTER_MOVE * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {number} localX - The x coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. * @param {number} localY - The y coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. @@ -98559,33 +99370,36 @@ module.exports = 'pointermove'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Pointer Out Event. - * + * * This event is dispatched by an interactive Game Object if a pointer moves out of it. - * + * * Listen to this event from a Game Object using: `gameObject.on('pointerout', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OUT} * 2. [GAMEOBJECT_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OUT} * 3. [POINTER_OUT]{@linkcode Phaser.Input.Events#event:POINTER_OUT} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * + * If the pointer leaves the game canvas itself, it will not trigger an this event. To handle those cases, + * please listen for the [GAME_OUT]{@linkcode Phaser.Input.Events#event:GAME_OUT} event. + * * @event Phaser.Input.Events#GAMEOBJECT_POINTER_OUT * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow. */ @@ -98599,33 +99413,33 @@ module.exports = 'pointerout'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Pointer Over Event. - * + * * This event is dispatched by an interactive Game Object if a pointer moves over it. - * + * * Listen to this event from a Game Object using: `gameObject.on('pointerover', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OVER} * 2. [GAMEOBJECT_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OVER} * 3. [POINTER_OVER]{@linkcode Phaser.Input.Events#event:POINTER_OVER} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_POINTER_OVER * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {number} localX - The x coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. * @param {number} localY - The y coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. @@ -98641,33 +99455,33 @@ module.exports = 'pointerover'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Pointer Up Event. - * + * * This event is dispatched by an interactive Game Object if a pointer is released while over it. - * + * * Listen to this event from a Game Object using: `gameObject.on('pointerup', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} * 2. [GAMEOBJECT_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_UP} * 3. [POINTER_UP]{@linkcode Phaser.Input.Events#event:POINTER_UP} or [POINTER_UP_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_UP_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_POINTER_UP * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {number} localX - The x coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. * @param {number} localY - The y coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. @@ -98683,33 +99497,33 @@ module.exports = 'pointerup'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Pointer Wheel Event. - * + * * This event is dispatched by an interactive Game Object if a pointer has its wheel moved while over it. - * + * * Listen to this event from a Game Object using: `gameObject.on('wheel', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_WHEEL} * 2. [GAMEOBJECT_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_WHEEL} * 3. [POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:POINTER_WHEEL} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_POINTER_WHEEL * @since 3.18.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {number} deltaX - The horizontal scroll amount that occurred due to the user moving a mouse wheel or similar input device. * @param {number} deltaY - The vertical scroll amount that occurred due to the user moving a mouse wheel or similar input device. This value will typically be less than 0 if the user scrolls up and greater than zero if scrolling down. @@ -98726,34 +99540,34 @@ module.exports = 'wheel'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Up Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is released while over _any_ interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('gameobjectup', listener)`. - * + * * To receive this event, the Game Objects must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} event instead. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} * 2. [GAMEOBJECT_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_UP} * 3. [POINTER_UP]{@linkcode Phaser.Input.Events#event:POINTER_UP} or [POINTER_UP_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_UP_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_UP * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the pointer was over when released. * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow. @@ -98768,34 +99582,34 @@ module.exports = 'gameobjectup'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Wheel Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer has its wheel moved while over _any_ interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('gameobjectwheel', listener)`. - * + * * To receive this event, the Game Objects must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_WHEEL} event instead. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_WHEEL} * 2. [GAMEOBJECT_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_WHEEL} * 3. [POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:POINTER_WHEEL} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_WHEEL * @since 3.18.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the pointer was over when the wheel changed. * @param {number} deltaX - The horizontal scroll amount that occurred due to the user moving a mouse wheel or similar input device. @@ -98813,21 +99627,21 @@ module.exports = 'gameobjectwheel'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Input Plugin Game Out Event. - * + * * This event is dispatched by the Input Plugin if the active pointer leaves the game canvas and is now * outside of it, elsewhere on the web page. - * + * * Listen to this event from within a Scene using: `this.input.on('gameout', listener)`. * * @event Phaser.Input.Events#GAME_OUT * @since 3.16.1 - * + * * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. * @param {(MouseEvent|TouchEvent)} event - The DOM Event that triggered the canvas out. */ @@ -98841,21 +99655,21 @@ module.exports = 'gameout'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Input Plugin Game Over Event. - * + * * This event is dispatched by the Input Plugin if the active pointer enters the game canvas and is now * over of it, having previously been elsewhere on the web page. - * + * * Listen to this event from within a Scene using: `this.input.on('gameover', listener)`. * * @event Phaser.Input.Events#GAME_OVER * @since 3.16.1 - * + * * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. * @param {(MouseEvent|TouchEvent)} event - The DOM Event that triggered the canvas over. */ @@ -98869,13 +99683,13 @@ module.exports = 'gameover'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Input Manager Boot Event. - * + * * This internal event is dispatched by the Input Manager when it boots. * * @event Phaser.Input.Events#MANAGER_BOOT @@ -98891,19 +99705,19 @@ module.exports = 'boot'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Input Manager Process Event. - * + * * This internal event is dispatched by the Input Manager when not using the legacy queue system, * and it wants the Input Plugins to update themselves. * * @event Phaser.Input.Events#MANAGER_PROCESS * @since 3.0.0 - * + * * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. */ @@ -98917,13 +99731,13 @@ module.exports = 'process'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Input Manager Update Event. - * + * * This internal event is dispatched by the Input Manager as part of its update step. * * @event Phaser.Input.Events#MANAGER_UPDATE @@ -98939,18 +99753,18 @@ module.exports = 'update'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Input Manager Pointer Lock Change Event. - * + * * This event is dispatched by the Input Manager when it is processing a native Pointer Lock Change DOM Event. * * @event Phaser.Input.Events#POINTERLOCK_CHANGE * @since 3.0.0 - * + * * @param {Event} event - The native DOM Event. * @param {boolean} locked - The locked state of the Mouse Pointer. */ @@ -98964,29 +99778,29 @@ module.exports = 'pointerlockchange'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Down Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is pressed down anywhere. - * + * * Listen to this event from within a Scene using: `this.input.on('pointerdown', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} * 2. [GAMEOBJECT_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DOWN} * 3. [POINTER_DOWN]{@linkcode Phaser.Input.Events#event:POINTER_DOWN} or [POINTER_DOWN_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_DOWN_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#POINTER_DOWN * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject[]} currentlyOver - An array containing all interactive Game Objects that the pointer was over when the event was created. */ @@ -99000,29 +99814,29 @@ module.exports = 'pointerdown'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Down Outside Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is pressed down anywhere outside of the game canvas. - * + * * Listen to this event from within a Scene using: `this.input.on('pointerdownoutside', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} * 2. [GAMEOBJECT_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DOWN} * 3. [POINTER_DOWN]{@linkcode Phaser.Input.Events#event:POINTER_DOWN} or [POINTER_DOWN_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_DOWN_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#POINTER_DOWN_OUTSIDE * @since 3.16.1 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. */ module.exports = 'pointerdownoutside'; @@ -99035,29 +99849,29 @@ module.exports = 'pointerdownoutside'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Move Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is moved anywhere. - * + * * Listen to this event from within a Scene using: `this.input.on('pointermove', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_MOVE} * 2. [GAMEOBJECT_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_MOVE} * 3. [POINTER_MOVE]{@linkcode Phaser.Input.Events#event:POINTER_MOVE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#POINTER_MOVE * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject[]} currentlyOver - An array containing all interactive Game Objects that the pointer was over when the event was created. */ @@ -99071,29 +99885,32 @@ module.exports = 'pointermove'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Out Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves out of any interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('pointerout', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OUT} * 2. [GAMEOBJECT_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OUT} * 3. [POINTER_OUT]{@linkcode Phaser.Input.Events#event:POINTER_OUT} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * + * If the pointer leaves the game canvas itself, it will not trigger an this event. To handle those cases, + * please listen for the [GAME_OUT]{@linkcode Phaser.Input.Events#event:GAME_OUT} event. + * * @event Phaser.Input.Events#POINTER_OUT * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject[]} justOut - An array containing all interactive Game Objects that the pointer moved out of when the event was created. */ @@ -99107,29 +99924,29 @@ module.exports = 'pointerout'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Over Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves over any interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('pointerover', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OVER} * 2. [GAMEOBJECT_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OVER} * 3. [POINTER_OVER]{@linkcode Phaser.Input.Events#event:POINTER_OVER} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#POINTER_OVER * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject[]} justOver - An array containing all interactive Game Objects that the pointer moved over when the event was created. */ @@ -99143,29 +99960,29 @@ module.exports = 'pointerover'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Up Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is released anywhere. - * + * * Listen to this event from within a Scene using: `this.input.on('pointerup', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} * 2. [GAMEOBJECT_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_UP} * 3. [POINTER_UP]{@linkcode Phaser.Input.Events#event:POINTER_UP} or [POINTER_UP_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_UP_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#POINTER_UP * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject[]} currentlyOver - An array containing all interactive Game Objects that the pointer was over when the event was created. */ @@ -99179,29 +99996,29 @@ module.exports = 'pointerup'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Up Outside Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is released anywhere outside of the game canvas. - * + * * Listen to this event from within a Scene using: `this.input.on('pointerupoutside', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} * 2. [GAMEOBJECT_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_UP} * 3. [POINTER_UP]{@linkcode Phaser.Input.Events#event:POINTER_UP} or [POINTER_UP_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_UP_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#POINTER_UP_OUTSIDE * @since 3.16.1 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. */ module.exports = 'pointerupoutside'; @@ -99214,29 +100031,29 @@ module.exports = 'pointerupoutside'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Wheel Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer has its wheel updated. - * + * * Listen to this event from within a Scene using: `this.input.on('wheel', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_WHEEL} * 2. [GAMEOBJECT_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_WHEEL} * 3. [POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:POINTER_WHEEL} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#POINTER_WHEEL * @since 3.18.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject[]} currentlyOver - An array containing all interactive Game Objects that the pointer was over when the event was created. * @param {number} deltaX - The horizontal scroll amount that occurred due to the user moving a mouse wheel or similar input device. @@ -99253,13 +100070,13 @@ module.exports = 'wheel'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Input Plugin Pre-Update Event. - * + * * This internal event is dispatched by the Input Plugin at the start of its `preUpdate` method. * This hook is designed specifically for input plugins, but can also be listened to from user-land code. * @@ -99276,13 +100093,13 @@ module.exports = 'preupdate'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Input Plugin Shutdown Event. - * + * * This internal event is dispatched by the Input Plugin when it shuts down, signalling to all of its systems to shut themselves down. * * @event Phaser.Input.Events#SHUTDOWN @@ -99298,13 +100115,13 @@ module.exports = 'shutdown'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Input Plugin Start Event. - * + * * This internal event is dispatched by the Input Plugin when it has finished setting-up, * signalling to all of its internal systems to start. * @@ -99321,19 +100138,19 @@ module.exports = 'start'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Input Plugin Update Event. - * + * * This internal event is dispatched by the Input Plugin at the start of its `update` method. * This hook is designed specifically for input plugins, but can also be listened to from user-land code. * * @event Phaser.Input.Events#UPDATE * @since 3.0.0 - * + * * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. */ @@ -99347,7 +100164,7 @@ module.exports = 'update'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -99414,7 +100231,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -99540,7 +100357,7 @@ module.exports = Axis; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -99687,7 +100504,7 @@ module.exports = Button; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -100461,7 +101278,7 @@ module.exports = Gamepad; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -101108,7 +101925,7 @@ module.exports = GamepadPlugin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -101124,7 +101941,7 @@ module.exports = { /** * D-Pad up - * + * * @name Phaser.Input.Gamepad.Configs.SNES_USB.UP * @const * @type {number} @@ -101134,7 +101951,7 @@ module.exports = { /** * D-Pad down - * + * * @name Phaser.Input.Gamepad.Configs.SNES_USB.DOWN * @const * @type {number} @@ -101144,7 +101961,7 @@ module.exports = { /** * D-Pad left - * + * * @name Phaser.Input.Gamepad.Configs.SNES_USB.LEFT * @const * @type {number} @@ -101154,7 +101971,7 @@ module.exports = { /** * D-Pad right - * + * * @name Phaser.Input.Gamepad.Configs.SNES_USB.RIGHT * @const * @type {number} @@ -101164,7 +101981,7 @@ module.exports = { /** * Select button - * + * * @name Phaser.Input.Gamepad.Configs.SNES_USB.SELECT * @const * @type {number} @@ -101174,7 +101991,7 @@ module.exports = { /** * Start button - * + * * @name Phaser.Input.Gamepad.Configs.SNES_USB.START * @const * @type {number} @@ -101184,7 +102001,7 @@ module.exports = { /** * B Button (Bottom) - * + * * @name Phaser.Input.Gamepad.Configs.SNES_USB.B * @const * @type {number} @@ -101194,7 +102011,7 @@ module.exports = { /** * A Button (Right) - * + * * @name Phaser.Input.Gamepad.Configs.SNES_USB.A * @const * @type {number} @@ -101204,7 +102021,7 @@ module.exports = { /** * Y Button (Left) - * + * * @name Phaser.Input.Gamepad.Configs.SNES_USB.Y * @const * @type {number} @@ -101214,7 +102031,7 @@ module.exports = { /** * X Button (Top) - * + * * @name Phaser.Input.Gamepad.Configs.SNES_USB.X * @const * @type {number} @@ -101224,7 +102041,7 @@ module.exports = { /** * Left bumper - * + * * @name Phaser.Input.Gamepad.Configs.SNES_USB.LEFT_SHOULDER * @const * @type {number} @@ -101234,7 +102051,7 @@ module.exports = { /** * Right bumper - * + * * @name Phaser.Input.Gamepad.Configs.SNES_USB.RIGHT_SHOULDER * @const * @type {number} @@ -101252,7 +102069,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -101268,7 +102085,7 @@ module.exports = { /** * D-Pad up - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.UP * @const * @type {number} @@ -101278,7 +102095,7 @@ module.exports = { /** * D-Pad down - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.DOWN * @const * @type {number} @@ -101288,7 +102105,7 @@ module.exports = { /** * D-Pad left - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.LEFT * @const * @type {number} @@ -101298,7 +102115,7 @@ module.exports = { /** * D-Pad up - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.RIGHT * @const * @type {number} @@ -101308,7 +102125,7 @@ module.exports = { /** * Share button - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.SHARE * @const * @type {number} @@ -101318,7 +102135,7 @@ module.exports = { /** * Options button - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.OPTIONS * @const * @type {number} @@ -101328,7 +102145,7 @@ module.exports = { /** * PlayStation logo button - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.PS * @const * @type {number} @@ -101338,7 +102155,7 @@ module.exports = { /** * Touchpad click - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.TOUCHBAR * @const * @type {number} @@ -101348,7 +102165,7 @@ module.exports = { /** * Cross button (Bottom) - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.X * @const * @type {number} @@ -101358,7 +102175,7 @@ module.exports = { /** * Circle button (Right) - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.CIRCLE * @const * @type {number} @@ -101368,7 +102185,7 @@ module.exports = { /** * Square button (Left) - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.SQUARE * @const * @type {number} @@ -101378,7 +102195,7 @@ module.exports = { /** * Triangle button (Top) - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.TRIANGLE * @const * @type {number} @@ -101388,7 +102205,7 @@ module.exports = { /** * Left bumper (L1) - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.L1 * @const * @type {number} @@ -101398,7 +102215,7 @@ module.exports = { /** * Right bumper (R1) - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.R1 * @const * @type {number} @@ -101408,7 +102225,7 @@ module.exports = { /** * Left trigger (L2) - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.L2 * @const * @type {number} @@ -101418,7 +102235,7 @@ module.exports = { /** * Right trigger (R2) - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.R2 * @const * @type {number} @@ -101428,7 +102245,7 @@ module.exports = { /** * Left stick click (L3) - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.L3 * @const * @type {number} @@ -101438,7 +102255,7 @@ module.exports = { /** * Right stick click (R3) - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.R3 * @const * @type {number} @@ -101448,7 +102265,7 @@ module.exports = { /** * Left stick horizontal - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.LEFT_STICK_H * @const * @type {number} @@ -101458,7 +102275,7 @@ module.exports = { /** * Left stick vertical - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.LEFT_STICK_V * @const * @type {number} @@ -101468,7 +102285,7 @@ module.exports = { /** * Right stick horizontal - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.RIGHT_STICK_H * @const * @type {number} @@ -101478,7 +102295,7 @@ module.exports = { /** * Right stick vertical - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.RIGHT_STICK_V * @const * @type {number} @@ -101496,7 +102313,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -101511,7 +102328,7 @@ module.exports = { /** * D-Pad up - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.UP * @const * @type {number} @@ -101521,7 +102338,7 @@ module.exports = { /** * D-Pad down - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.DOWN * @const * @type {number} @@ -101531,7 +102348,7 @@ module.exports = { /** * D-Pad left - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.LEFT * @const * @type {number} @@ -101541,7 +102358,7 @@ module.exports = { /** * D-Pad right - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.RIGHT * @const * @type {number} @@ -101551,7 +102368,7 @@ module.exports = { /** * XBox menu button - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.MENU * @const * @type {number} @@ -101561,7 +102378,7 @@ module.exports = { /** * A button (Bottom) - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.A * @const * @type {number} @@ -101571,7 +102388,7 @@ module.exports = { /** * B button (Right) - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.B * @const * @type {number} @@ -101581,7 +102398,7 @@ module.exports = { /** * X button (Left) - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.X * @const * @type {number} @@ -101591,7 +102408,7 @@ module.exports = { /** * Y button (Top) - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.Y * @const * @type {number} @@ -101601,7 +102418,7 @@ module.exports = { /** * Left Bumper - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.LB * @const * @type {number} @@ -101611,7 +102428,7 @@ module.exports = { /** * Right Bumper - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.RB * @const * @type {number} @@ -101621,7 +102438,7 @@ module.exports = { /** * Left Trigger - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.LT * @const * @type {number} @@ -101631,7 +102448,7 @@ module.exports = { /** * Right Trigger - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.RT * @const * @type {number} @@ -101641,7 +102458,7 @@ module.exports = { /** * Back / Change View button - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.BACK * @const * @type {number} @@ -101651,7 +102468,7 @@ module.exports = { /** * Start button - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.START * @const * @type {number} @@ -101661,7 +102478,7 @@ module.exports = { /** * Left Stick press - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.LS * @const * @type {number} @@ -101671,7 +102488,7 @@ module.exports = { /** * Right stick press - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.RS * @const * @type {number} @@ -101681,7 +102498,7 @@ module.exports = { /** * Left Stick horizontal - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.LEFT_STICK_H * @const * @type {number} @@ -101691,7 +102508,7 @@ module.exports = { /** * Left Stick vertical - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.LEFT_STICK_V * @const * @type {number} @@ -101701,7 +102518,7 @@ module.exports = { /** * Right Stick horizontal - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.RIGHT_STICK_H * @const * @type {number} @@ -101711,7 +102528,7 @@ module.exports = { /** * Right Stick vertical - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.RIGHT_STICK_V * @const * @type {number} @@ -101729,7 +102546,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -101753,22 +102570,22 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Gamepad Button Down Event. - * + * * This event is dispatched by the Gamepad Plugin when a button has been pressed on any active Gamepad. - * + * * Listen to this event from within a Scene using: `this.input.gamepad.on('down', listener)`. - * + * * You can also listen for a DOWN event from a Gamepad instance. See the [GAMEPAD_BUTTON_DOWN]{@linkcode Phaser.Input.Gamepad.Events#event:GAMEPAD_BUTTON_DOWN} event for details. * * @event Phaser.Input.Gamepad.Events#BUTTON_DOWN * @since 3.10.0 - * + * * @param {Phaser.Input.Gamepad} pad - A reference to the Gamepad on which the button was pressed. * @param {Phaser.Input.Gamepad.Button} button - A reference to the Button which was pressed. * @param {number} value - The value of the button at the time it was pressed. Between 0 and 1. Some Gamepads have pressure-sensitive buttons. @@ -101783,22 +102600,22 @@ module.exports = 'down'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Gamepad Button Up Event. - * + * * This event is dispatched by the Gamepad Plugin when a button has been released on any active Gamepad. - * + * * Listen to this event from within a Scene using: `this.input.gamepad.on('up', listener)`. - * + * * You can also listen for an UP event from a Gamepad instance. See the [GAMEPAD_BUTTON_UP]{@linkcode Phaser.Input.Gamepad.Events#event:GAMEPAD_BUTTON_UP} event for details. * * @event Phaser.Input.Gamepad.Events#BUTTON_UP * @since 3.10.0 - * + * * @param {Phaser.Input.Gamepad} pad - A reference to the Gamepad on which the button was released. * @param {Phaser.Input.Gamepad.Button} button - A reference to the Button which was released. * @param {number} value - The value of the button at the time it was released. Between 0 and 1. Some Gamepads have pressure-sensitive buttons. @@ -101813,17 +102630,17 @@ module.exports = 'up'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Gamepad Connected Event. - * + * * This event is dispatched by the Gamepad Plugin when a Gamepad has been connected. - * + * * Listen to this event from within a Scene using: `this.input.gamepad.once('connected', listener)`. - * + * * Note that the browser may require you to press a button on a gamepad before it will allow you to access it, * this is for security reasons. However, it may also trust the page already, in which case you won't get the * 'connected' event and instead should check `GamepadPlugin.total` to see if it thinks there are any gamepads @@ -101831,7 +102648,7 @@ module.exports = 'up'; * * @event Phaser.Input.Gamepad.Events#CONNECTED * @since 3.0.0 - * + * * @param {Phaser.Input.Gamepad} pad - A reference to the Gamepad which was connected. * @param {Event} event - The native DOM Event that triggered the connection. */ @@ -101845,20 +102662,20 @@ module.exports = 'connected'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Gamepad Disconnected Event. - * + * * This event is dispatched by the Gamepad Plugin when a Gamepad has been disconnected. - * + * * Listen to this event from within a Scene using: `this.input.gamepad.once('disconnected', listener)`. * * @event Phaser.Input.Gamepad.Events#DISCONNECTED * @since 3.0.0 - * + * * @param {Phaser.Input.Gamepad} pad - A reference to the Gamepad which was disconnected. * @param {Event} event - The native DOM Event that triggered the disconnection. */ @@ -101872,25 +102689,25 @@ module.exports = 'disconnected'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Gamepad Button Down Event. - * + * * This event is dispatched by a Gamepad instance when a button has been pressed on it. - * + * * Listen to this event from a Gamepad instance. Once way to get this is from the `pad1`, `pad2`, etc properties on the Gamepad Plugin: * `this.input.gamepad.pad1.on('down', listener)`. - * + * * Note that you will not receive any Gamepad button events until the browser considers the Gamepad as being 'connected'. - * + * * You can also listen for a DOWN event from the Gamepad Plugin. See the [BUTTON_DOWN]{@linkcode Phaser.Input.Gamepad.Events#event:BUTTON_DOWN} event for details. * * @event Phaser.Input.Gamepad.Events#GAMEPAD_BUTTON_DOWN * @since 3.10.0 - * + * * @param {number} index - The index of the button that was pressed. * @param {number} value - The value of the button at the time it was pressed. Between 0 and 1. Some Gamepads have pressure-sensitive buttons. * @param {Phaser.Input.Gamepad.Button} button - A reference to the Button which was pressed. @@ -101905,25 +102722,25 @@ module.exports = 'down'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Gamepad Button Up Event. - * + * * This event is dispatched by a Gamepad instance when a button has been released on it. - * + * * Listen to this event from a Gamepad instance. Once way to get this is from the `pad1`, `pad2`, etc properties on the Gamepad Plugin: * `this.input.gamepad.pad1.on('up', listener)`. - * + * * Note that you will not receive any Gamepad button events until the browser considers the Gamepad as being 'connected'. - * + * * You can also listen for an UP event from the Gamepad Plugin. See the [BUTTON_UP]{@linkcode Phaser.Input.Gamepad.Events#event:BUTTON_UP} event for details. * * @event Phaser.Input.Gamepad.Events#GAMEPAD_BUTTON_UP * @since 3.10.0 - * + * * @param {number} index - The index of the button that was released. * @param {number} value - The value of the button at the time it was released. Between 0 and 1. Some Gamepads have pressure-sensitive buttons. * @param {Phaser.Input.Gamepad.Button} button - A reference to the Button which was released. @@ -101938,7 +102755,7 @@ module.exports = 'up'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -101965,7 +102782,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -101980,7 +102797,7 @@ module.exports = { Events: __webpack_require__(43200), Gamepad: __webpack_require__(75956), GamepadPlugin: __webpack_require__(1379), - + Configs: __webpack_require__(4898) }; @@ -101992,7 +102809,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -102032,7 +102849,7 @@ module.exports = Input; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -102477,7 +103294,7 @@ module.exports = KeyboardManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -102526,7 +103343,8 @@ var SnapFloor = __webpack_require__(84314); * Scene to stop all input, or `this.input.keyboard.preventDefault = false` to stop a Scene halting input on another Scene. * * _Note_: Many keyboards are unable to process certain combinations of keys due to hardware limitations known as ghosting. - * See http://www.html5gamedevs.com/topic/4876-impossible-to-use-more-than-2-keyboard-input-buttons-at-the-same-time/ for more details. + * See http://www.html5gamedevs.com/topic/4876-impossible-to-use-more-than-2-keyboard-input-buttons-at-the-same-time/ for more details + * and use the site https://w3c.github.io/uievents/tools/key-event-viewer.html to test your n-key support in browser. * * Also please be aware that certain browser extensions can disable or override Phaser keyboard handling. * For example the Chrome extension vimium is known to disable Phaser from using the D key, while EverNote disables the backtick key. @@ -103024,12 +103842,14 @@ var KeyboardPlugin = new Class({ * * @param {(Phaser.Input.Keyboard.Key|string|number)} key - Either a Key object, a string, such as `A` or `SPACE`, or a key code value. * @param {boolean} [destroy=false] - Call `Key.destroy` on the removed Key object? + * @param {boolean} [removeCapture=false] - Remove this Key from being captured? Only applies if set to capture when created. * * @return {this} This KeyboardPlugin object. */ - removeKey: function (key, destroy) + removeKey: function (key, destroy, removeCapture) { if (destroy === undefined) { destroy = false; } + if (removeCapture === undefined) { removeCapture = false; } var keys = this.keys; var ref; @@ -103061,6 +103881,11 @@ var KeyboardPlugin = new Class({ { ref.plugin = null; + if (removeCapture) + { + this.removeCapture(ref.keyCode); + } + if (destroy) { ref.destroy(); @@ -103077,11 +103902,15 @@ var KeyboardPlugin = new Class({ * @since 3.24.0 * * @param {boolean} [destroy=false] - Call `Key.destroy` on each removed Key object? + * @param {boolean} [removeCapture=false] - Remove all key captures for Key objects owened by this plugin? * * @return {this} This KeyboardPlugin object. */ - removeAllKeys: function (destroy) + removeAllKeys: function (destroy, removeCapture) { + if (destroy === undefined) { destroy = false; } + if (removeCapture === undefined) { removeCapture = false; } + var keys = this.keys; for (var i = 0; i < keys.length; i++) @@ -103092,6 +103921,11 @@ var KeyboardPlugin = new Class({ { keys[i] = undefined; + if (removeCapture) + { + this.removeCapture(key.keyCode); + } + if (destroy) { key.destroy(); @@ -103423,7 +104257,7 @@ module.exports = KeyboardPlugin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -103466,7 +104300,7 @@ module.exports = AdvanceKeyCombo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -103760,7 +104594,7 @@ module.exports = KeyCombo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -103842,7 +104676,7 @@ module.exports = ProcessKeyCombo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -103878,21 +104712,21 @@ module.exports = ResetKeyCombo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Global Key Down Event. - * + * * This event is dispatched by the Keyboard Plugin when any key on the keyboard is pressed down. - * + * * Listen to this event from within a Scene using: `this.input.keyboard.on('keydown', listener)`. - * + * * You can also listen for a specific key being pressed. See [Keyboard.Events.KEY_DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:KEY_DOWN} for details. - * + * * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:DOWN} for details. - * + * * _Note_: Many keyboards are unable to process certain combinations of keys due to hardware limitations known as ghosting. * Read [this article on ghosting]{@link http://www.html5gamedevs.com/topic/4876-impossible-to-use-more-than-2-keyboard-input-buttons-at-the-same-time/} for details. * @@ -103902,7 +104736,7 @@ module.exports = ResetKeyCombo; * * @event Phaser.Input.Keyboard.Events#ANY_KEY_DOWN * @since 3.0.0 - * + * * @param {KeyboardEvent} event - The native DOM Keyboard Event. You can inspect this to learn more about the key that was pressed, any modifiers, etc. */ module.exports = 'keydown'; @@ -103915,24 +104749,24 @@ module.exports = 'keydown'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Global Key Up Event. - * + * * This event is dispatched by the Keyboard Plugin when any key on the keyboard is released. - * + * * Listen to this event from within a Scene using: `this.input.keyboard.on('keyup', listener)`. - * + * * You can also listen for a specific key being released. See [Keyboard.Events.KEY_UP]{@linkcode Phaser.Input.Keyboard.Events#event:KEY_UP} for details. - * + * * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.UP]{@linkcode Phaser.Input.Keyboard.Events#event:UP} for details. * * @event Phaser.Input.Keyboard.Events#ANY_KEY_UP * @since 3.0.0 - * + * * @param {KeyboardEvent} event - The native DOM Keyboard Event. You can inspect this to learn more about the key that was released, any modifiers, etc. */ module.exports = 'keyup'; @@ -103945,17 +104779,17 @@ module.exports = 'keyup'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Key Combo Match Event. - * + * * This event is dispatched by the Keyboard Plugin when a [Key Combo]{@link Phaser.Input.Keyboard.KeyCombo} is matched. - * + * * Listen for this event from the Key Plugin after a combo has been created: - * + * * ```javascript * this.input.keyboard.createCombo([ 38, 38, 40, 40, 37, 39, 37, 39, 66, 65, 13 ], { resetOnMatch: true }); * @@ -103966,7 +104800,7 @@ module.exports = 'keyup'; * * @event Phaser.Input.Keyboard.Events#COMBO_MATCH * @since 3.0.0 - * + * * @param {Phaser.Input.Keyboard.KeyCombo} keycombo - The Key Combo object that was matched. * @param {KeyboardEvent} event - The native DOM Keyboard Event of the final key in the combo. You can inspect this to learn more about any modifiers, etc. */ @@ -103980,28 +104814,28 @@ module.exports = 'keycombomatch'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Key Down Event. - * + * * This event is dispatched by a [Key]{@link Phaser.Input.Keyboard.Key} object when it is pressed. - * + * * Listen for this event from the Key object instance directly: - * + * * ```javascript * var spaceBar = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE); - * + * * spaceBar.on('down', listener) * ``` - * + * * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_DOWN} for details. * * @event Phaser.Input.Keyboard.Events#DOWN * @since 3.0.0 - * + * * @param {Phaser.Input.Keyboard.Key} key - The Key object that was pressed. * @param {KeyboardEvent} event - The native DOM Keyboard Event. You can inspect this to learn more about any modifiers, etc. */ @@ -104015,24 +104849,24 @@ module.exports = 'down'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Key Down Event. - * + * * This event is dispatched by the Keyboard Plugin when any key on the keyboard is pressed down. - * + * * Unlike the `ANY_KEY_DOWN` event, this one has a special dynamic event name. For example, to listen for the `A` key being pressed * use the following from within a Scene: `this.input.keyboard.on('keydown-A', listener)`. You can replace the `-A` part of the event - * name with any valid [Key Code string]{@link Phaser.Input.Keyboard.KeyCodes}. For example, this will listen for the space bar: + * name with any valid [Key Code string]{@link Phaser.Input.Keyboard.KeyCodes}. For example, this will listen for the space bar: * `this.input.keyboard.on('keydown-SPACE', listener)`. - * + * * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_DOWN} for details. - * + * * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:DOWN} for details. - * + * * _Note_: Many keyboards are unable to process certain combinations of keys due to hardware limitations known as ghosting. * Read [this article on ghosting]{@link http://www.html5gamedevs.com/topic/4876-impossible-to-use-more-than-2-keyboard-input-buttons-at-the-same-time/} for details. * @@ -104042,7 +104876,7 @@ module.exports = 'down'; * * @event Phaser.Input.Keyboard.Events#KEY_DOWN * @since 3.0.0 - * + * * @param {KeyboardEvent} event - The native DOM Keyboard Event. You can inspect this to learn more about the key that was pressed, any modifiers, etc. */ module.exports = 'keydown-'; @@ -104055,27 +104889,27 @@ module.exports = 'keydown-'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Key Up Event. - * + * * This event is dispatched by the Keyboard Plugin when any key on the keyboard is released. - * + * * Unlike the `ANY_KEY_UP` event, this one has a special dynamic event name. For example, to listen for the `A` key being released * use the following from within a Scene: `this.input.keyboard.on('keyup-A', listener)`. You can replace the `-A` part of the event - * name with any valid [Key Code string]{@link Phaser.Input.Keyboard.KeyCodes}. For example, this will listen for the space bar: + * name with any valid [Key Code string]{@link Phaser.Input.Keyboard.KeyCodes}. For example, this will listen for the space bar: * `this.input.keyboard.on('keyup-SPACE', listener)`. - * + * * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_UP]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_UP} for details. - * + * * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.UP]{@linkcode Phaser.Input.Keyboard.Events#event:UP} for details. * * @event Phaser.Input.Keyboard.Events#KEY_UP * @since 3.0.0 - * + * * @param {KeyboardEvent} event - The native DOM Keyboard Event. You can inspect this to learn more about the key that was released, any modifiers, etc. */ module.exports = 'keyup-'; @@ -104088,28 +104922,28 @@ module.exports = 'keyup-'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Key Up Event. - * + * * This event is dispatched by a [Key]{@link Phaser.Input.Keyboard.Key} object when it is released. - * + * * Listen for this event from the Key object instance directly: - * + * * ```javascript * var spaceBar = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE); - * + * * spaceBar.on('up', listener) * ``` - * + * * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_UP]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_UP} for details. * * @event Phaser.Input.Keyboard.Events#UP * @since 3.0.0 - * + * * @param {Phaser.Input.Keyboard.Key} key - The Key object that was released. * @param {KeyboardEvent} event - The native DOM Keyboard Event. You can inspect this to learn more about any modifiers, etc. */ @@ -104123,7 +104957,7 @@ module.exports = 'up'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -104151,7 +104985,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -104190,7 +105024,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -104225,15 +105059,15 @@ module.exports = DownDuration; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The justDown value allows you to test if this Key has just been pressed down or not. - * + * * When you check this value it will return `true` if the Key is down, otherwise `false`. - * + * * You can only call justDown once per key press. It will only return `true` once, until the Key is released and pressed down again. * This allows you to use it in situations where you want to check if this key is down without using an event, such as in a core game loop. * @@ -104268,15 +105102,15 @@ module.exports = JustDown; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The justUp value allows you to test if this Key has just been released or not. - * + * * When you check this value it will return `true` if the Key is up, otherwise `false`. - * + * * You can only call JustUp once per key release. It will only return `true` once, until the Key is pressed down and released again. * This allows you to use it in situations where you want to check if this key is up without using an event, such as in a core game loop. * @@ -104311,7 +105145,7 @@ module.exports = JustUp; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -104485,7 +105319,7 @@ var Key = new Class({ /** * When a key is held down should it continuously fire the `down` event each time it repeats? - * + * * By default it will emit the `down` event just once, but if you wish to receive the event * for each repeat as well, enable this property. * @@ -104545,9 +105379,9 @@ var Key = new Class({ * * @method Phaser.Input.Keyboard.Key#setEmitOnRepeat * @since 3.16.0 - * + * * @param {boolean} value - Emit `down` events on repeated key down actions, or just once? - * + * * @return {this} This Key instance. */ setEmitOnRepeat: function (value) @@ -104564,7 +105398,7 @@ var Key = new Class({ * @method Phaser.Input.Keyboard.Key#onDown * @fires Phaser.Input.Keyboard.Events#DOWN * @since 3.16.0 - * + * * @param {KeyboardEvent} event - The native DOM Keyboard event. */ onDown: function (event) @@ -104581,7 +105415,7 @@ var Key = new Class({ this.shiftKey = event.shiftKey; this.metaKey = event.metaKey; this.location = event.location; - + this.repeats++; if (!this.isDown) @@ -104608,7 +105442,7 @@ var Key = new Class({ * @method Phaser.Input.Keyboard.Key#onUp * @fires Phaser.Input.Keyboard.Events#UP * @since 3.16.0 - * + * * @param {KeyboardEvent} event - The native DOM Keyboard event. */ onUp: function (event) @@ -104619,32 +105453,32 @@ var Key = new Class({ { return; } - + this.isDown = false; this.isUp = true; this.timeUp = event.timeStamp; this.duration = this.timeUp - this.timeDown; this.repeats = 0; - + this._justDown = false; this._justUp = true; this._tick = -1; - + this.emit(Events.UP, this, event); }, /** * Resets this Key object back to its default un-pressed state. * + * As of version 3.60.0 it no longer resets the `enabled` or `preventDefault` flags. + * * @method Phaser.Input.Keyboard.Key#reset * @since 3.6.0 - * + * * @return {this} This Key instance. */ reset: function () { - this.preventDefault = true; - this.enabled = true; this.isDown = false; this.isUp = true; this.altKey = false; @@ -104664,15 +105498,15 @@ var Key = new Class({ /** * Returns the duration, in ms, that the Key has been held down for. - * + * * If the key is not currently down it will return zero. - * - * The get the duration the Key was held down for in the previous up-down cycle, + * + * To get the duration the Key was held down for in the previous up-down cycle, * use the `Key.duration` property value instead. * * @method Phaser.Input.Keyboard.Key#getDuration * @since 3.17.0 - * + * * @return {number} The duration, in ms, that the Key has been held down for if currently down. */ getDuration: function () @@ -104714,7 +105548,7 @@ module.exports = Key; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -104730,7 +105564,7 @@ var KeyCodes = { /** * The BACKSPACE key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.BACKSPACE * @type {number} * @since 3.0.0 @@ -104739,7 +105573,7 @@ var KeyCodes = { /** * The TAB key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.TAB * @type {number} * @since 3.0.0 @@ -104748,7 +105582,7 @@ var KeyCodes = { /** * The ENTER key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.ENTER * @type {number} * @since 3.0.0 @@ -104757,7 +105591,7 @@ var KeyCodes = { /** * The SHIFT key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.SHIFT * @type {number} * @since 3.0.0 @@ -104766,7 +105600,7 @@ var KeyCodes = { /** * The CTRL key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.CTRL * @type {number} * @since 3.0.0 @@ -104775,7 +105609,7 @@ var KeyCodes = { /** * The ALT key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.ALT * @type {number} * @since 3.0.0 @@ -104784,7 +105618,7 @@ var KeyCodes = { /** * The PAUSE key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.PAUSE * @type {number} * @since 3.0.0 @@ -104793,7 +105627,7 @@ var KeyCodes = { /** * The CAPS_LOCK key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.CAPS_LOCK * @type {number} * @since 3.0.0 @@ -104802,7 +105636,7 @@ var KeyCodes = { /** * The ESC key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.ESC * @type {number} * @since 3.0.0 @@ -104811,7 +105645,7 @@ var KeyCodes = { /** * The SPACE key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.SPACE * @type {number} * @since 3.0.0 @@ -104820,7 +105654,7 @@ var KeyCodes = { /** * The PAGE_UP key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.PAGE_UP * @type {number} * @since 3.0.0 @@ -104829,7 +105663,7 @@ var KeyCodes = { /** * The PAGE_DOWN key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.PAGE_DOWN * @type {number} * @since 3.0.0 @@ -104838,7 +105672,7 @@ var KeyCodes = { /** * The END key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.END * @type {number} * @since 3.0.0 @@ -104847,7 +105681,7 @@ var KeyCodes = { /** * The HOME key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.HOME * @type {number} * @since 3.0.0 @@ -104856,7 +105690,7 @@ var KeyCodes = { /** * The LEFT key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.LEFT * @type {number} * @since 3.0.0 @@ -104865,7 +105699,7 @@ var KeyCodes = { /** * The UP key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.UP * @type {number} * @since 3.0.0 @@ -104874,7 +105708,7 @@ var KeyCodes = { /** * The RIGHT key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.RIGHT * @type {number} * @since 3.0.0 @@ -104883,7 +105717,7 @@ var KeyCodes = { /** * The DOWN key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.DOWN * @type {number} * @since 3.0.0 @@ -104892,7 +105726,7 @@ var KeyCodes = { /** * The PRINT_SCREEN key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.PRINT_SCREEN * @type {number} * @since 3.0.0 @@ -104901,7 +105735,7 @@ var KeyCodes = { /** * The INSERT key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.INSERT * @type {number} * @since 3.0.0 @@ -104910,7 +105744,7 @@ var KeyCodes = { /** * The DELETE key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.DELETE * @type {number} * @since 3.0.0 @@ -104919,7 +105753,7 @@ var KeyCodes = { /** * The ZERO key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.ZERO * @type {number} * @since 3.0.0 @@ -104928,7 +105762,7 @@ var KeyCodes = { /** * The ONE key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.ONE * @type {number} * @since 3.0.0 @@ -104937,7 +105771,7 @@ var KeyCodes = { /** * The TWO key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.TWO * @type {number} * @since 3.0.0 @@ -104946,7 +105780,7 @@ var KeyCodes = { /** * The THREE key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.THREE * @type {number} * @since 3.0.0 @@ -104955,7 +105789,7 @@ var KeyCodes = { /** * The FOUR key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.FOUR * @type {number} * @since 3.0.0 @@ -104964,7 +105798,7 @@ var KeyCodes = { /** * The FIVE key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.FIVE * @type {number} * @since 3.0.0 @@ -104973,7 +105807,7 @@ var KeyCodes = { /** * The SIX key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.SIX * @type {number} * @since 3.0.0 @@ -104982,7 +105816,7 @@ var KeyCodes = { /** * The SEVEN key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.SEVEN * @type {number} * @since 3.0.0 @@ -104991,7 +105825,7 @@ var KeyCodes = { /** * The EIGHT key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.EIGHT * @type {number} * @since 3.0.0 @@ -105000,7 +105834,7 @@ var KeyCodes = { /** * The NINE key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NINE * @type {number} * @since 3.0.0 @@ -105009,7 +105843,7 @@ var KeyCodes = { /** * The NUMPAD_ZERO key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_ZERO * @type {number} * @since 3.0.0 @@ -105018,7 +105852,7 @@ var KeyCodes = { /** * The NUMPAD_ONE key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_ONE * @type {number} * @since 3.0.0 @@ -105027,7 +105861,7 @@ var KeyCodes = { /** * The NUMPAD_TWO key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_TWO * @type {number} * @since 3.0.0 @@ -105036,7 +105870,7 @@ var KeyCodes = { /** * The NUMPAD_THREE key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_THREE * @type {number} * @since 3.0.0 @@ -105045,7 +105879,7 @@ var KeyCodes = { /** * The NUMPAD_FOUR key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_FOUR * @type {number} * @since 3.0.0 @@ -105054,7 +105888,7 @@ var KeyCodes = { /** * The NUMPAD_FIVE key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_FIVE * @type {number} * @since 3.0.0 @@ -105063,7 +105897,7 @@ var KeyCodes = { /** * The NUMPAD_SIX key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_SIX * @type {number} * @since 3.0.0 @@ -105072,7 +105906,7 @@ var KeyCodes = { /** * The NUMPAD_SEVEN key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_SEVEN * @type {number} * @since 3.0.0 @@ -105081,7 +105915,7 @@ var KeyCodes = { /** * The NUMPAD_EIGHT key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_EIGHT * @type {number} * @since 3.0.0 @@ -105090,7 +105924,7 @@ var KeyCodes = { /** * The NUMPAD_NINE key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_NINE * @type {number} * @since 3.0.0 @@ -105099,7 +105933,7 @@ var KeyCodes = { /** * The Numpad Addition (+) key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_ADD * @type {number} * @since 3.21.0 @@ -105108,7 +105942,7 @@ var KeyCodes = { /** * The Numpad Subtraction (-) key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_SUBTRACT * @type {number} * @since 3.21.0 @@ -105117,7 +105951,7 @@ var KeyCodes = { /** * The A key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.A * @type {number} * @since 3.0.0 @@ -105126,7 +105960,7 @@ var KeyCodes = { /** * The B key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.B * @type {number} * @since 3.0.0 @@ -105135,7 +105969,7 @@ var KeyCodes = { /** * The C key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.C * @type {number} * @since 3.0.0 @@ -105144,7 +105978,7 @@ var KeyCodes = { /** * The D key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.D * @type {number} * @since 3.0.0 @@ -105153,7 +105987,7 @@ var KeyCodes = { /** * The E key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.E * @type {number} * @since 3.0.0 @@ -105162,7 +105996,7 @@ var KeyCodes = { /** * The F key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F * @type {number} * @since 3.0.0 @@ -105171,7 +106005,7 @@ var KeyCodes = { /** * The G key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.G * @type {number} * @since 3.0.0 @@ -105180,7 +106014,7 @@ var KeyCodes = { /** * The H key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.H * @type {number} * @since 3.0.0 @@ -105189,7 +106023,7 @@ var KeyCodes = { /** * The I key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.I * @type {number} * @since 3.0.0 @@ -105198,7 +106032,7 @@ var KeyCodes = { /** * The J key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.J * @type {number} * @since 3.0.0 @@ -105207,7 +106041,7 @@ var KeyCodes = { /** * The K key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.K * @type {number} * @since 3.0.0 @@ -105216,7 +106050,7 @@ var KeyCodes = { /** * The L key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.L * @type {number} * @since 3.0.0 @@ -105225,7 +106059,7 @@ var KeyCodes = { /** * The M key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.M * @type {number} * @since 3.0.0 @@ -105234,7 +106068,7 @@ var KeyCodes = { /** * The N key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.N * @type {number} * @since 3.0.0 @@ -105243,7 +106077,7 @@ var KeyCodes = { /** * The O key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.O * @type {number} * @since 3.0.0 @@ -105252,7 +106086,7 @@ var KeyCodes = { /** * The P key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.P * @type {number} * @since 3.0.0 @@ -105261,7 +106095,7 @@ var KeyCodes = { /** * The Q key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.Q * @type {number} * @since 3.0.0 @@ -105270,7 +106104,7 @@ var KeyCodes = { /** * The R key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.R * @type {number} * @since 3.0.0 @@ -105279,7 +106113,7 @@ var KeyCodes = { /** * The S key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.S * @type {number} * @since 3.0.0 @@ -105288,7 +106122,7 @@ var KeyCodes = { /** * The T key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.T * @type {number} * @since 3.0.0 @@ -105297,7 +106131,7 @@ var KeyCodes = { /** * The U key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.U * @type {number} * @since 3.0.0 @@ -105306,7 +106140,7 @@ var KeyCodes = { /** * The V key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.V * @type {number} * @since 3.0.0 @@ -105315,7 +106149,7 @@ var KeyCodes = { /** * The W key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.W * @type {number} * @since 3.0.0 @@ -105324,7 +106158,7 @@ var KeyCodes = { /** * The X key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.X * @type {number} * @since 3.0.0 @@ -105333,7 +106167,7 @@ var KeyCodes = { /** * The Y key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.Y * @type {number} * @since 3.0.0 @@ -105342,7 +106176,7 @@ var KeyCodes = { /** * The Z key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.Z * @type {number} * @since 3.0.0 @@ -105351,7 +106185,7 @@ var KeyCodes = { /** * The F1 key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F1 * @type {number} * @since 3.0.0 @@ -105360,7 +106194,7 @@ var KeyCodes = { /** * The F2 key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F2 * @type {number} * @since 3.0.0 @@ -105369,7 +106203,7 @@ var KeyCodes = { /** * The F3 key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F3 * @type {number} * @since 3.0.0 @@ -105378,7 +106212,7 @@ var KeyCodes = { /** * The F4 key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F4 * @type {number} * @since 3.0.0 @@ -105387,7 +106221,7 @@ var KeyCodes = { /** * The F5 key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F5 * @type {number} * @since 3.0.0 @@ -105396,7 +106230,7 @@ var KeyCodes = { /** * The F6 key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F6 * @type {number} * @since 3.0.0 @@ -105405,7 +106239,7 @@ var KeyCodes = { /** * The F7 key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F7 * @type {number} * @since 3.0.0 @@ -105414,7 +106248,7 @@ var KeyCodes = { /** * The F8 key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F8 * @type {number} * @since 3.0.0 @@ -105423,7 +106257,7 @@ var KeyCodes = { /** * The F9 key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F9 * @type {number} * @since 3.0.0 @@ -105432,7 +106266,7 @@ var KeyCodes = { /** * The F10 key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F10 * @type {number} * @since 3.0.0 @@ -105441,7 +106275,7 @@ var KeyCodes = { /** * The F11 key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F11 * @type {number} * @since 3.0.0 @@ -105450,7 +106284,7 @@ var KeyCodes = { /** * The F12 key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F12 * @type {number} * @since 3.0.0 @@ -105459,7 +106293,7 @@ var KeyCodes = { /** * The SEMICOLON key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.SEMICOLON * @type {number} * @since 3.0.0 @@ -105468,7 +106302,7 @@ var KeyCodes = { /** * The PLUS key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.PLUS * @type {number} * @since 3.0.0 @@ -105477,7 +106311,7 @@ var KeyCodes = { /** * The COMMA key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.COMMA * @type {number} * @since 3.0.0 @@ -105486,7 +106320,7 @@ var KeyCodes = { /** * The MINUS key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.MINUS * @type {number} * @since 3.0.0 @@ -105495,7 +106329,7 @@ var KeyCodes = { /** * The PERIOD key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.PERIOD * @type {number} * @since 3.0.0 @@ -105504,7 +106338,7 @@ var KeyCodes = { /** * The FORWARD_SLASH key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.FORWARD_SLASH * @type {number} * @since 3.0.0 @@ -105513,7 +106347,7 @@ var KeyCodes = { /** * The BACK_SLASH key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.BACK_SLASH * @type {number} * @since 3.0.0 @@ -105522,7 +106356,7 @@ var KeyCodes = { /** * The QUOTES key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.QUOTES * @type {number} * @since 3.0.0 @@ -105531,7 +106365,7 @@ var KeyCodes = { /** * The BACKTICK key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.BACKTICK * @type {number} * @since 3.0.0 @@ -105540,7 +106374,7 @@ var KeyCodes = { /** * The OPEN_BRACKET key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.OPEN_BRACKET * @type {number} * @since 3.0.0 @@ -105549,7 +106383,7 @@ var KeyCodes = { /** * The CLOSED_BRACKET key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.CLOSED_BRACKET * @type {number} * @since 3.0.0 @@ -105558,7 +106392,7 @@ var KeyCodes = { /** * The SEMICOLON_FIREFOX key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.SEMICOLON_FIREFOX * @type {number} * @since 3.0.0 @@ -105567,7 +106401,7 @@ var KeyCodes = { /** * The COLON key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.COLON * @type {number} * @since 3.0.0 @@ -105576,7 +106410,7 @@ var KeyCodes = { /** * The COMMA_FIREFOX_WINDOWS key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.COMMA_FIREFOX_WINDOWS * @type {number} * @since 3.0.0 @@ -105585,7 +106419,7 @@ var KeyCodes = { /** * The COMMA_FIREFOX key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.COMMA_FIREFOX * @type {number} * @since 3.0.0 @@ -105594,7 +106428,7 @@ var KeyCodes = { /** * The BRACKET_RIGHT_FIREFOX key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.BRACKET_RIGHT_FIREFOX * @type {number} * @since 3.0.0 @@ -105603,7 +106437,7 @@ var KeyCodes = { /** * The BRACKET_LEFT_FIREFOX key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.BRACKET_LEFT_FIREFOX * @type {number} * @since 3.0.0 @@ -105621,7 +106455,7 @@ module.exports = KeyCodes; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -105644,7 +106478,7 @@ module.exports = KeyMap; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -105679,7 +106513,7 @@ module.exports = UpDuration; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -105949,11 +106783,11 @@ var MouseManager = new Class({ }, /** - * Attempts to disable the context menu from appearing if you right-click on the browser. + * Attempts to disable the context menu from appearing if you right-click on the game canvas, or specified input target. * * Works by listening for the `contextmenu` event and prevent defaulting it. * - * Use this if you need to enable right-button mouse support in your game, and the browser + * Use this if you need to enable right-button mouse support in your game, and the context * menu keeps getting in the way. * * @method Phaser.Input.Mouse.MouseManager#disableContextMenu @@ -105963,7 +106797,7 @@ var MouseManager = new Class({ */ disableContextMenu: function () { - document.body.addEventListener('contextmenu', function (event) + this.target.addEventListener('contextmenu', function (event) { event.preventDefault(); return false; @@ -106246,7 +107080,7 @@ module.exports = MouseManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -106258,7 +107092,7 @@ module.exports = MouseManager; module.exports = { MouseManager: __webpack_require__(7905) - + }; /* eslint-enable */ @@ -106270,7 +107104,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -106285,9 +107119,9 @@ var NOOP = __webpack_require__(72283); /** * @classdesc * The Touch Manager is a helper class that belongs to the Input Manager. - * + * * Its role is to listen for native DOM Touch Events and then pass them onto the Input Manager for further processing. - * + * * You do not need to create this class directly, the Input Manager will create an instance of it automatically. * * @class TouchManager @@ -106414,24 +107248,18 @@ var TouchManager = new Class({ this.onTouchCancelWindow = NOOP; /** - * The Touch Over event handler function. - * Initially empty and bound in the `startListeners` method. + * Are the event listeners hooked into `window.top` or `window`? * - * @name Phaser.Input.Touch.TouchManager#onTouchOver - * @type {function} - * @since 3.16.0 - */ - this.onTouchOver = NOOP; - - /** - * The Touch Out event handler function. - * Initially empty and bound in the `startListeners` method. + * This is set during the `boot` sequence. If the browser does not have access to `window.top`, + * such as in cross-origin iframe environments, this property gets set to `false` and the events + * are hooked into `window` instead. * - * @name Phaser.Input.Touch.TouchManager#onTouchOut - * @type {function} - * @since 3.16.0 + * @name Phaser.Input.Touch.TouchManager#isTop + * @type {boolean} + * @readonly + * @since 3.60.0 */ - this.onTouchOut = NOOP; + this.isTop = true; inputManager.events.once(InputEvents.MANAGER_BOOT, this.boot, this); }, @@ -106455,6 +107283,10 @@ var TouchManager = new Class({ { this.target = this.manager.game.canvas; } + else if (typeof this.target === 'string') + { + this.target = document.getElementById(this.target); + } if (config.disableContextMenu) { @@ -106469,9 +107301,9 @@ var TouchManager = new Class({ /** * Attempts to disable the context menu from appearing if you touch-hold on the browser. - * + * * Works by listening for the `contextmenu` event and prevent defaulting it. - * + * * Use this if you need to disable the OS context menu on mobile. * * @method Phaser.Input.Touch.TouchManager#disableContextMenu @@ -106481,7 +107313,7 @@ var TouchManager = new Class({ */ disableContextMenu: function () { - document.body.addEventListener('contextmenu', function (event) + this.target.addEventListener('contextmenu', function (event) { event.preventDefault(); return false; @@ -106492,7 +107324,7 @@ var TouchManager = new Class({ /** * Starts the Touch Event listeners running as long as an input target is set. - * + * * This method is called automatically if Touch Input is enabled in the game config, * which it is by default. However, you can call it manually should you need to * delay input capturing until later in the game. @@ -106502,9 +107334,30 @@ var TouchManager = new Class({ */ startListeners: function () { + var target = this.target; + + if (!target) + { + return; + } + var _this = this; - var canvas = this.manager.canvas; - var autoFocus = (window && window.focus && this.manager.game.config.autoFocus); + var manager = this.manager; + var canvas = manager.canvas; + var autoFocus = (window && window.focus && manager.game.config.autoFocus); + + this.onTouchMove = function (event) + { + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled) + { + manager.onTouchMove(event); + + if (_this.capture && event.cancelable) + { + event.preventDefault(); + } + } + }; this.onTouchStart = function (event) { @@ -106513,10 +107366,10 @@ var TouchManager = new Class({ window.focus(); } - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled) { - _this.manager.onTouchStart(event); - + manager.onTouchStart(event); + if (_this.capture && event.cancelable && event.target === canvas) { event.preventDefault(); @@ -106526,32 +107379,19 @@ var TouchManager = new Class({ this.onTouchStartWindow = function (event) { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled && event.target !== canvas) + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled && event.target !== canvas) { // Only process the event if the target isn't the canvas - _this.manager.onTouchStart(event); - } - }; - - this.onTouchMove = function (event) - { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) - { - _this.manager.onTouchMove(event); - - if (_this.capture && event.cancelable) - { - event.preventDefault(); - } + manager.onTouchStart(event); } }; this.onTouchEnd = function (event) { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled) { - _this.manager.onTouchEnd(event); - + manager.onTouchEnd(event); + if (_this.capture && event.cancelable && event.target === canvas) { event.preventDefault(); @@ -106561,19 +107401,19 @@ var TouchManager = new Class({ this.onTouchEndWindow = function (event) { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled && event.target !== canvas) + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled && event.target !== canvas) { // Only process the event if the target isn't the canvas - _this.manager.onTouchEnd(event); + manager.onTouchEnd(event); } }; this.onTouchCancel = function (event) { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled) { - _this.manager.onTouchCancel(event); - + manager.onTouchCancel(event); + if (_this.capture) { event.preventDefault(); @@ -106583,50 +107423,37 @@ var TouchManager = new Class({ this.onTouchCancelWindow = function (event) { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled) { - _this.manager.onTouchCancel(event); + manager.onTouchCancel(event); } }; - this.onTouchOver = function (event) - { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) - { - _this.manager.setCanvasOver(event); - } - }; - - this.onTouchOut = function (event) - { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) - { - _this.manager.setCanvasOut(event); - } - }; - - var target = this.target; - - if (!target) - { - return; - } - + var capture = this.capture; var passive = { passive: true }; var nonPassive = { passive: false }; - target.addEventListener('touchstart', this.onTouchStart, (this.capture) ? nonPassive : passive); - target.addEventListener('touchmove', this.onTouchMove, (this.capture) ? nonPassive : passive); - target.addEventListener('touchend', this.onTouchEnd, (this.capture) ? nonPassive : passive); - target.addEventListener('touchcancel', this.onTouchCancel, (this.capture) ? nonPassive : passive); - target.addEventListener('touchover', this.onTouchOver, (this.capture) ? nonPassive : passive); - target.addEventListener('touchout', this.onTouchOut, (this.capture) ? nonPassive : passive); + target.addEventListener('touchstart', this.onTouchStart, (capture) ? nonPassive : passive); + target.addEventListener('touchmove', this.onTouchMove, (capture) ? nonPassive : passive); + target.addEventListener('touchend', this.onTouchEnd, (capture) ? nonPassive : passive); + target.addEventListener('touchcancel', this.onTouchCancel, (capture) ? nonPassive : passive); - if (window && this.manager.game.config.inputWindowEvents) + if (window && manager.game.config.inputWindowEvents) { - window.addEventListener('touchstart', this.onTouchStartWindow, nonPassive); - window.addEventListener('touchend', this.onTouchEndWindow, nonPassive); - window.addEventListener('touchcancel', this.onTouchCancelWindow, nonPassive); + try + { + window.top.addEventListener('touchstart', this.onTouchStartWindow, nonPassive); + window.top.addEventListener('touchend', this.onTouchEndWindow, nonPassive); + window.top.addEventListener('touchcancel', this.onTouchCancelWindow, nonPassive); + } + catch (exception) + { + window.addEventListener('touchstart', this.onTouchStartWindow, nonPassive); + window.addEventListener('touchend', this.onTouchEndWindow, nonPassive); + window.addEventListener('touchcancel', this.onTouchCancelWindow, nonPassive); + + this.isTop = false; + } } this.enabled = true; @@ -106647,13 +107474,14 @@ var TouchManager = new Class({ target.removeEventListener('touchmove', this.onTouchMove); target.removeEventListener('touchend', this.onTouchEnd); target.removeEventListener('touchcancel', this.onTouchCancel); - target.removeEventListener('touchover', this.onTouchOver); - target.removeEventListener('touchout', this.onTouchOut); if (window) { - window.removeEventListener('touchstart', this.onTouchStartWindow); - window.removeEventListener('touchend', this.onTouchEndWindow); + target = (this.isTop) ? window.top : window; + + target.removeEventListener('touchstart', this.onTouchStartWindow); + target.removeEventListener('touchend', this.onTouchEndWindow); + target.removeEventListener('touchcancel', this.onTouchCancelWindow); } }, @@ -106684,7 +107512,7 @@ module.exports = TouchManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -106696,7 +107524,7 @@ module.exports = TouchManager; module.exports = { TouchManager: __webpack_require__(37579) - + }; /* eslint-enable */ @@ -106708,7 +107536,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -106767,6 +107595,11 @@ var File = new Class({ */ this.type = GetFastValue(fileConfig, 'type', false); + if (!this.type) + { + throw new Error('Invalid File type: ' + this.type); + } + /** * Unique cache key (unique within its file type) * @@ -106783,9 +107616,9 @@ var File = new Class({ this.key = loader.prefix + loadKey; } - if (!this.type || !this.key) + if (!this.key) { - throw new Error('Invalid Loader.' + this.type + ' key'); + throw new Error('Invalid File key: ' + this.key); } var url = GetFastValue(fileConfig, 'url'); @@ -107018,10 +107851,10 @@ var File = new Class({ */ onLoad: function (xhr, event) { - // On iOS, Capacitor often runs on a capacitor:// protocol, meaning local files are served from capacitor:// rather than file:// - // See: https://github.com/photonstorm/phaser/issues/5685 - - var isLocalFile = xhr.responseURL && (xhr.responseURL.indexOf('file://') === 0 || xhr.responseURL.indexOf('capacitor://') === 0); + var isLocalFile = xhr.responseURL && this.loader.localSchemes.some(function (scheme) + { + return xhr.responseURL.indexOf(scheme) === 0; + }); var localFileOk = (isLocalFile && event.target.status === 0); @@ -107157,12 +107990,10 @@ var File = new Class({ */ addToCache: function () { - if (this.cache) + if (this.cache && this.data) { this.cache.add(this.key, this.data); } - - this.pendingDestroy(); }, /** @@ -107176,6 +108007,11 @@ var File = new Class({ */ pendingDestroy: function (data) { + if (this.state === CONST.FILE_PENDING_DESTROY) + { + return; + } + if (data === undefined) { data = this.data; } var key = this.key; @@ -107185,6 +108021,8 @@ var File = new Class({ this.loader.emit(Events.FILE_KEY_COMPLETE + type + '-' + key, key, type, data); this.loader.flagForRemoval(this); + + this.state = CONST.FILE_PENDING_DESTROY; }, /** @@ -107267,7 +108105,7 @@ module.exports = File; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -107281,13 +108119,13 @@ var FileTypesManager = { /** * Static method called when a LoaderPlugin is created. - * + * * Loops through the local types object and injects all of them as * properties into the LoaderPlugin instance. * * @method Phaser.Loader.FileTypesManager.install * @since 3.0.0 - * + * * @param {Phaser.Loader.LoaderPlugin} loader - The LoaderPlugin to install the types into. */ install: function (loader) @@ -107300,12 +108138,12 @@ var FileTypesManager = { /** * Static method called directly by the File Types. - * + * * The key is a reference to the function used to load the files via the Loader, i.e. `image`. * * @method Phaser.Loader.FileTypesManager.register * @since 3.0.0 - * + * * @param {string} key - The key that will be used as the method name in the LoaderPlugin. * @param {function} factoryFunction - The function that will be called when LoaderPlugin.key is invoked. */ @@ -107337,7 +108175,7 @@ module.exports = FileTypesManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -107379,7 +108217,7 @@ module.exports = GetURL; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -107390,6 +108228,7 @@ var EventEmitter = __webpack_require__(6659); var Events = __webpack_require__(683); var FileTypesManager = __webpack_require__(76846); var GetFastValue = __webpack_require__(72632); +var GetValue = __webpack_require__(10850); var PluginCache = __webpack_require__(91963); var SceneEvents = __webpack_require__(7599); var XHRSettings = __webpack_require__(33868); @@ -107595,6 +108434,18 @@ var LoaderPlugin = new Class({ */ this.imageLoadType = GetFastValue(sceneConfig, 'imageLoadType', gameConfig.loaderImageLoadType); + /** + * An array of all schemes that the Loader considers as being 'local'. + * + * This is populated by the `Phaser.Core.Config#loaderLocalScheme` game configuration setting and defaults to + * `[ 'file://', 'capacitor://' ]`. Additional local schemes can be added to this array as needed. + * + * @name Phaser.Loader.LoaderPlugin#localSchemes + * @type {string[]} + * @since 3.60.0 + */ + this.localSchemes = GetFastValue(sceneConfig, 'localScheme', gameConfig.loaderLocalScheme); + /** * The total number of files to load. It may not always be accurate because you may add to the Loader during the process * of loading, especially if you load a Pack File. Therefore this value can change, but in most cases remains static. @@ -107982,9 +108833,13 @@ var LoaderPlugin = new Class({ addPack: function (pack, packKey) { // if no packKey provided we'll add everything to the queue - if (packKey && pack.hasOwnProperty(packKey)) + if (typeof(packKey) === 'string') { - pack = { packKey: pack[packKey] }; + var subPack = GetValue(pack, packKey); + if (subPack) + { + pack = { packKey: subPack }; + } } var total = 0; @@ -108268,12 +109123,14 @@ var LoaderPlugin = new Class({ { // If we got here then all files the link file needs are ready to add to the cache file.multiFile.addToCache(); + file.multiFile.pendingDestroy(); } } else { // If we got here, then the file processed, so let it add itself to its cache file.addToCache(); + file.pendingDestroy(); } } @@ -108472,7 +109329,7 @@ module.exports = LoaderPlugin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -108521,11 +109378,13 @@ module.exports = MergeXHRSettings; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var Class = __webpack_require__(56694); +var CONST = __webpack_require__(12117); +var Events = __webpack_require__(683); /** * @classdesc @@ -108607,6 +109466,15 @@ var MultiFile = new Class({ */ this.files = finalFiles; + /** + * The current state of the file. One of the FILE_CONST values. + * + * @name Phaser.Loader.MultiFile#state + * @type {number} + * @since 3.60.0 + */ + this.state = CONST.FILE_PENDING; + /** * The completion status of this MultiFile. * @@ -108756,6 +109624,53 @@ var MultiFile = new Class({ // eslint-disable-next-line no-console console.error('File failed: %s "%s" (via %s "%s")', this.type, this.key, file.type, file.key); } + }, + + /** + * Called once all children of this multi file have been added to their caches and is now + * ready for deletion from the Loader. + * + * It will emit a `filecomplete` event from the LoaderPlugin. + * + * @method Phaser.Loader.MultiFile#pendingDestroy + * @fires Phaser.Loader.Events#FILE_COMPLETE + * @fires Phaser.Loader.Events#FILE_KEY_COMPLETE + * @since 3.60.0 + */ + pendingDestroy: function () + { + if (this.state === CONST.FILE_PENDING_DESTROY) + { + return; + } + + var key = this.key; + var type = this.type; + + this.loader.emit(Events.FILE_COMPLETE, key, type); + this.loader.emit(Events.FILE_KEY_COMPLETE + type + '-' + key, key, type); + + this.loader.flagForRemoval(this); + + for (var i = 0; i < this.files.length; i++) + { + this.files[i].pendingDestroy(); + } + + this.state = CONST.FILE_PENDING_DESTROY; + }, + + /** + * Destroy this Multi File and any references it holds. + * + * @method Phaser.Loader.MultiFile#destroy + * @since 3.60.0 + */ + destroy: function () + { + this.loader = null; + this.files = null; + this.config = null; } }); @@ -108770,7 +109685,7 @@ module.exports = MultiFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -108852,7 +109767,7 @@ module.exports = XHRLoader; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -108923,7 +109838,7 @@ module.exports = XHRSettings; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -108931,7 +109846,7 @@ var FILE_CONST = { /** * The Loader is idle. - * + * * @name Phaser.Loader.LOADER_IDLE * @type {number} * @since 3.0.0 @@ -108940,7 +109855,7 @@ var FILE_CONST = { /** * The Loader is actively loading. - * + * * @name Phaser.Loader.LOADER_LOADING * @type {number} * @since 3.0.0 @@ -108949,7 +109864,7 @@ var FILE_CONST = { /** * The Loader is processing files is has loaded. - * + * * @name Phaser.Loader.LOADER_PROCESSING * @type {number} * @since 3.0.0 @@ -108958,7 +109873,7 @@ var FILE_CONST = { /** * The Loader has completed loading and processing. - * + * * @name Phaser.Loader.LOADER_COMPLETE * @type {number} * @since 3.0.0 @@ -108967,7 +109882,7 @@ var FILE_CONST = { /** * The Loader is shutting down. - * + * * @name Phaser.Loader.LOADER_SHUTDOWN * @type {number} * @since 3.0.0 @@ -108976,7 +109891,7 @@ var FILE_CONST = { /** * The Loader has been destroyed. - * + * * @name Phaser.Loader.LOADER_DESTROYED * @type {number} * @since 3.0.0 @@ -108984,8 +109899,8 @@ var FILE_CONST = { LOADER_DESTROYED: 5, /** - * File is in the load queue but not yet started - * + * File is in the load queue but not yet started. + * * @name Phaser.Loader.FILE_PENDING * @type {number} * @since 3.0.0 @@ -108994,7 +109909,7 @@ var FILE_CONST = { /** * File has been started to load by the loader (onLoad called) - * + * * @name Phaser.Loader.FILE_LOADING * @type {number} * @since 3.0.0 @@ -109002,8 +109917,8 @@ var FILE_CONST = { FILE_LOADING: 11, /** - * File has loaded successfully, awaiting processing - * + * File has loaded successfully, awaiting processing. + * * @name Phaser.Loader.FILE_LOADED * @type {number} * @since 3.0.0 @@ -109011,8 +109926,8 @@ var FILE_CONST = { FILE_LOADED: 12, /** - * File failed to load - * + * File failed to load. + * * @name Phaser.Loader.FILE_FAILED * @type {number} * @since 3.0.0 @@ -109021,7 +109936,7 @@ var FILE_CONST = { /** * File is being processed (onProcess callback) - * + * * @name Phaser.Loader.FILE_PROCESSING * @type {number} * @since 3.0.0 @@ -109030,7 +109945,7 @@ var FILE_CONST = { /** * The File has errored somehow during processing. - * + * * @name Phaser.Loader.FILE_ERRORED * @type {number} * @since 3.0.0 @@ -109039,7 +109954,7 @@ var FILE_CONST = { /** * File has finished processing. - * + * * @name Phaser.Loader.FILE_COMPLETE * @type {number} * @since 3.0.0 @@ -109047,8 +109962,8 @@ var FILE_CONST = { FILE_COMPLETE: 17, /** - * File has been destroyed - * + * File has been destroyed. + * * @name Phaser.Loader.FILE_DESTROYED * @type {number} * @since 3.0.0 @@ -109056,13 +109971,22 @@ var FILE_CONST = { FILE_DESTROYED: 18, /** - * File was populated from local data and doesn't need an HTTP request - * + * File was populated from local data and doesn't need an HTTP request. + * * @name Phaser.Loader.FILE_POPULATED * @type {number} * @since 3.0.0 */ - FILE_POPULATED: 19 + FILE_POPULATED: 19, + + /** + * File is pending being destroyed. + * + * @name Phaser.Loader.FILE_PENDING_DESTROY + * @type {number} + * @since 3.60.0 + */ + FILE_PENDING_DESTROY: 20 }; @@ -109076,7 +110000,7 @@ module.exports = FILE_CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -109107,7 +110031,7 @@ module.exports = 'addfile'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -109136,25 +110060,27 @@ module.exports = 'complete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The File Load Complete Event. - * - * This event is dispatched by the Loader Plugin when any file in the queue finishes loading. - * + * + * This event is dispatched by the Loader Plugin when _any_ file in the queue finishes loading. + * * Listen to it from a Scene using: `this.load.on('filecomplete', listener)`. - * + * + * Make sure you remove this listener when you have finished, or it will continue to fire if the Scene reloads. + * * You can also listen for the completion of a specific file. See the [FILE_KEY_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_KEY_COMPLETE} event. * * @event Phaser.Loader.Events#FILE_COMPLETE * @since 3.0.0 - * + * * @param {string} key - The key of the file that just loaded and finished processing. * @param {string} type - The [file type]{@link Phaser.Loader.File#type} of the file that just loaded, i.e. `image`. - * @param {any} data - The raw data the file contained. + * @param {any} [data] - The raw data the file contained. If the file was a multi-file, like an atlas or bitmap font, this parameter will be undefined. */ module.exports = 'filecomplete'; @@ -109166,17 +110092,17 @@ module.exports = 'filecomplete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The File Load Complete Event. - * + * * This event is dispatched by the Loader Plugin when any file in the queue finishes loading. - * + * * It uses a special dynamic event name constructed from the key and type of the file. - * + * * For example, if you have loaded an `image` with a key of `monster`, you can listen for it * using the following: * @@ -109187,29 +110113,31 @@ module.exports = 'filecomplete'; * ``` * * Or, if you have loaded a texture `atlas` with a key of `Level1`: - * + * * ```javascript * this.load.on('filecomplete-atlas-Level1', function (key, type, data) { * // Your handler code * }); * ``` - * + * * Or, if you have loaded a sprite sheet with a key of `Explosion` and a prefix of `GAMEOVER`: - * + * * ```javascript * this.load.on('filecomplete-spritesheet-GAMEOVERExplosion', function (key, type, data) { * // Your handler code * }); * ``` - * + * + * Make sure you remove your listeners when you have finished, or they will continue to fire if the Scene reloads. + * * You can also listen for the generic completion of files. See the [FILE_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_COMPLETE} event. * * @event Phaser.Loader.Events#FILE_KEY_COMPLETE * @since 3.0.0 - * + * * @param {string} key - The key of the file that just loaded and finished processing. * @param {string} type - The [file type]{@link Phaser.Loader.File#type} of the file that just loaded, i.e. `image`. - * @param {any} data - The raw data the file contained. + * @param {any} [data] - The raw data the file contained. If the file was a multi-file, like an atlas or bitmap font, this parameter will be undefined. */ module.exports = 'filecomplete-'; @@ -109221,7 +110149,7 @@ module.exports = 'filecomplete-'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -109247,7 +110175,7 @@ module.exports = 'loaderror'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -109274,7 +110202,7 @@ module.exports = 'load'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -109302,7 +110230,7 @@ module.exports = 'fileprogress'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -109332,7 +110260,7 @@ module.exports = 'postprocess'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -109358,22 +110286,22 @@ module.exports = 'progress'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Loader Plugin Start Event. - * + * * This event is dispatched when the Loader starts running. At this point load progress is zero. - * + * * This event is dispatched even if there aren't any files in the load queue. - * + * * Listen to it from a Scene using: `this.load.on('start', listener)`. * * @event Phaser.Loader.Events#START * @since 3.0.0 - * + * * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. */ module.exports = 'start'; @@ -109386,7 +110314,7 @@ module.exports = 'start'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -109417,7 +110345,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -109619,7 +110547,7 @@ module.exports = AnimationJSONFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -109890,7 +110818,7 @@ module.exports = AsepriteFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -109990,8 +110918,6 @@ var AtlasJSONFile = new Class({ this.loader.textureManager.addAtlas(image.key, image.data, json.data, normalMap); - json.pendingDestroy(); - this.complete = true; } } @@ -110022,7 +110948,16 @@ var AtlasJSONFile = new Class({ * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details. * * Phaser expects the atlas data to be provided in a JSON file, using either the JSON Hash or JSON Array format. - * These files are created by software such as Texture Packer, Shoebox and Adobe Flash / Animate. + * + * These files are created by software such as: + * + * * [Texture Packer](https://www.codeandweb.com/texturepacker/tutorials/how-to-create-sprite-sheets-for-phaser3?source=photonstorm) + * * [Shoebox](https://renderhjs.net/shoebox/) + * * [Gamma Texture Packer](https://gammafp.com/tool/atlas-packer/) + * * [Adobe Flash / Animate](https://www.adobe.com/uk/products/animate.html) + * * [Free Texture Packer](http://free-tex-packer.com/) + * * [Leshy SpriteSheet Tool](https://www.leshylabs.com/apps/sstool/) + * * If you are using Texture Packer and have enabled multi-atlas support, then please use the Phaser Multi Atlas loader * instead of this one. * @@ -110140,7 +111075,7 @@ module.exports = AtlasJSONFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -110238,8 +111173,6 @@ var AtlasXMLFile = new Class({ this.loader.textureManager.addAtlasXML(image.key, image.data, xml.data, normalMap); - xml.pendingDestroy(); - this.complete = true; } } @@ -110384,7 +111317,7 @@ module.exports = AtlasXMLFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -110412,7 +111345,7 @@ var IsPlainObject = __webpack_require__(42911); * * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. * @param {(string|Phaser.Types.Loader.FileTypes.AudioFileConfig)} key - The key to use for this file, or a file configuration object. - * @param {any} [urlConfig] - The absolute or relative URL to load this file from in a config object. + * @param {Phaser.Types.Loader.FileTypes.AudioFileURLConfig} [urlConfig] - The absolute or relative URL to load this file from in a config object. * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. * @param {AudioContext} [audioContext] - The AudioContext this file will use to process itself. */ @@ -110603,7 +111536,7 @@ AudioFile.getAudioURL = function (game, urls) * @since 3.0.0 * * @param {(string|Phaser.Types.Loader.FileTypes.AudioFileConfig|Phaser.Types.Loader.FileTypes.AudioFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. - * @param {(string|string[])} [urls] - The absolute or relative URL to load the audio files from. + * @param {(string|string[]|Phaser.Types.Loader.FileTypes.AudioFileURLConfig|Phaser.Types.Loader.FileTypes.AudioFileURLConfig[])} [urls] - The absolute or relative URL to load the audio files from. * @param {any} [config] - An object containing an `instances` property for HTML5Audio. Defaults to 1. * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. * @@ -110659,7 +111592,7 @@ module.exports = AudioFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -110950,7 +111883,7 @@ FileTypesManager.register('audioSprite', function (key, jsonURL, audioURL, audio /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -111133,7 +112066,7 @@ module.exports = BinaryFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -111230,7 +112163,6 @@ var BitmapFontFile = new Class({ var xml = this.files[1]; image.addToCache(); - xml.pendingDestroy(); var texture = image.cache.get(image.key); @@ -111381,7 +112313,7 @@ module.exports = BitmapFontFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -111560,6 +112492,7 @@ var Class = __webpack_require__(56694); var FileTypesManager = __webpack_require__(76846); var GetFastValue = __webpack_require__(72632); var ImageFile = __webpack_require__(42927); +var IsPlainObject = __webpack_require__(42911); var JSONFile = __webpack_require__(70806); var KTXParser = __webpack_require__(67409); var Merge = __webpack_require__(30657); @@ -111773,11 +112706,6 @@ var CompressedTextureFile = new Class({ textureManager.addCompressedTexture(image.key, textureData, atlasData); } - - if (json) - { - json.pendingDestroy(); - } } this.complete = true; @@ -111860,11 +112788,6 @@ var CompressedTextureFile = new Class({ textureManager.addAtlasJSONArray(this.key, images, data, normalMaps); this.complete = true; - - for (i = 0; i < this.files.length; i++) - { - this.files[i].pendingDestroy(); - } } }); @@ -111924,6 +112847,22 @@ var CompressedTextureFile = new Class({ * * When loading a Multi Atlas you do not need to specify the `textureURL` property as it will be read from the JSON file. * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.texture({ + * key: 'yourPic', + * url: { + * ASTC: { type: 'PVR', textureURL: 'pic-astc-4x4.pvr' }, + * PVRTC: { type: 'PVR', textureURL: 'pic-pvrtc-4bpp-rgba.pvr' }, + * S3TC: { type: 'PVR', textureURL: 'pic-dxt5.pvr' }, + * IMG: { textureURL: 'pic.png' } + * } + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.CompressedTextureFileConfig` for more details. + * * The number of formats you provide to this function is up to you, but you should ensure you * cover the primary platforms where appropriate. * @@ -111986,71 +112925,102 @@ var CompressedTextureFile = new Class({ * @fires Phaser.Loader.LoaderPlugin#ADD * @since 3.60.0 * - * @param {string} key - The key to use for this file within the Texture Manager. - * @param {Phaser.Types.Loader.FileTypes.CompressedTextureFileConfig} urls - The compressed texture configuration object. + * @param {(string|Phaser.Types.Loader.FileTypes.CompressedTextureFileConfig|Phaser.Types.Loader.FileTypes.CompressedTextureFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {Phaser.Types.Loader.FileTypes.CompressedTextureFileConfig} [url] - The compressed texture configuration object. Not required if passing a config object as the `key` parameter. * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. * * @return {this} The Loader instance. */ -FileTypesManager.register('texture', function (key, urls, xhrSettings) +FileTypesManager.register('texture', function (key, url, xhrSettings) { - var entry = { - format: null, - type: null, - textureURL: null, - atlasURL: null, - multiAtlasURL: null, - multiPath: null, - multiBaseURL: null - }; - var renderer = this.systems.renderer; - for (var textureBaseFormat in urls) + var AddEntry = function (loader, key, urls, xhrSettings) { - if (renderer.supportsCompressedTexture(textureBaseFormat)) - { - var urlEntry = urls[textureBaseFormat]; + var entry = { + format: null, + type: null, + textureURL: undefined, + atlasURL: undefined, + multiAtlasURL: undefined, + multiPath: undefined, + multiBaseURL: undefined + }; - if (typeof urlEntry === 'string') + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + urls = GetFastValue(config, 'url'), + xhrSettings = GetFastValue(config, 'xhrSettings'); + } + + var matched = false; + + for (var textureBaseFormat in urls) + { + if (renderer.supportsCompressedTexture(textureBaseFormat)) { - entry.textureURL = urlEntry; + var urlEntry = urls[textureBaseFormat]; + + if (typeof urlEntry === 'string') + { + entry.textureURL = urlEntry; + } + else + { + entry = Merge(urlEntry, entry); + } + + entry.format = textureBaseFormat.toUpperCase(); + + matched = true; + + break; + } + } + + if (!matched) + { + console.warn('No supported compressed texture format or IMG fallback', key); + } + else if (entry.format === 'IMG') + { + var multifile; + if (entry.multiAtlasURL) + { + multifile = new MultiAtlasFile(this, key, entry.multiAtlasURL, entry.multiPath, entry.multiBaseURL, xhrSettings); + loader.addFile(multifile.files); + } + else if (entry.atlasURL) + { + multifile = new AtlasJSONFile(loader, key, entry.textureURL, entry.atlasURL, xhrSettings); + loader.addFile(multifile.files); } else { - entry = Merge(urlEntry, entry); + loader.addFile(new ImageFile(loader, key, entry.textureURL, xhrSettings)); } - - entry.format = textureBaseFormat.toUpperCase(); - - break; - } - } - - if (!entry) - { - console.warn('No supported texture format or IMG fallback', key); - } - else if (entry.format === 'IMG') - { - if (entry.multiAtlasURL) - { - this.addFile(new MultiAtlasFile(this, key, entry.multiAtlasURL, entry.multiPath, entry.multiBaseURL, xhrSettings)); - } - else if (entry.atlasURL) - { - this.addFile(new AtlasJSONFile(this, key, entry.textureURL, entry.atlasURL, xhrSettings)); } else { - this.addFile(new ImageFile(this, key, entry.textureURL, xhrSettings)); + var texture = new CompressedTextureFile(loader, key, entry, xhrSettings); + + loader.addFile(texture.files); + } + }; + + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + AddEntry(this, key[i]); } } else { - var texture = new CompressedTextureFile(this, key, entry, xhrSettings); - - this.addFile(texture.files); + AddEntry(this, key, url, xhrSettings); } return this; @@ -112066,7 +113036,7 @@ module.exports = CompressedTextureFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -112216,8 +113186,6 @@ var GLSLFile = new Class({ { this.cache.add(this.key, new Shader(this.key, '', this.data)); } - - this.pendingDestroy(); }, /** @@ -112478,7 +113446,7 @@ module.exports = GLSLFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -112494,7 +113462,7 @@ var IsPlainObject = __webpack_require__(42911); * A single Audio File suitable for loading by the Loader. * * These are created when you use the Phaser.Loader.LoaderPlugin#audio method and are not typically created directly. - * + * * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#audio. * * @class HTML5AudioFile @@ -112682,7 +113650,7 @@ module.exports = HTML5AudioFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -112858,7 +113826,7 @@ module.exports = HTMLFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -113001,9 +113969,7 @@ var HTMLTextureFile = new Class({ */ addToCache: function () { - var texture = this.cache.addImage(this.key, this.data); - - this.pendingDestroy(texture); + this.cache.addImage(this.key, this.data); } }); @@ -113117,7 +114083,7 @@ module.exports = HTMLTextureFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -113318,29 +114284,22 @@ var ImageFile = new Class({ */ addToCache: function () { - var texture; var linkFile = this.linkFile; - if (linkFile && linkFile.state === CONST.FILE_COMPLETE) + if (linkFile && linkFile.state >= CONST.FILE_COMPLETE) { if (this.type === 'image') { - texture = this.cache.addImage(this.key, this.data, linkFile.data); + this.cache.addImage(this.key, this.data, linkFile.data); } else { - texture = this.cache.addImage(linkFile.key, linkFile.data, this.data); + this.cache.addImage(linkFile.key, linkFile.data, this.data); } - - this.pendingDestroy(texture); - - linkFile.pendingDestroy(texture); } else if (!linkFile) { - texture = this.cache.addImage(this.key, this.data); - - this.pendingDestroy(texture); + this.cache.addImage(this.key, this.data); } } @@ -113469,7 +114428,7 @@ module.exports = ImageFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -113709,7 +114668,7 @@ module.exports = JSONFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -113913,11 +114872,6 @@ var MultiAtlasFile = new Class({ this.loader.textureManager.addAtlasJSONArray(this.key, images, data, normalMaps); this.complete = true; - - for (i = 0; i < this.files.length; i++) - { - this.files[i].pendingDestroy(); - } } } @@ -114043,7 +114997,7 @@ module.exports = MultiAtlasFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -114261,7 +115215,7 @@ module.exports = MultiScriptFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -114516,7 +115470,7 @@ module.exports = OBJFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -114735,7 +115689,7 @@ module.exports = PackFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -114948,7 +115902,7 @@ module.exports = PluginFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -115135,9 +116089,7 @@ var SVGFile = new Class({ */ addToCache: function () { - var texture = this.cache.addImage(this.key, this.data); - - this.pendingDestroy(texture); + this.cache.addImage(this.key, this.data); } }); @@ -115288,7 +116240,7 @@ module.exports = SVGFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -115509,7 +116461,7 @@ module.exports = SceneFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -115716,7 +116668,7 @@ module.exports = ScenePluginFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -115744,6 +116696,7 @@ var IsPlainObject = __webpack_require__(42911); * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. * @param {(string|Phaser.Types.Loader.FileTypes.ScriptFileConfig)} key - The key to use for this file, or a file configuration object. * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". + * @param {string} [type='script'] - The script type. Should be either 'script' for classic JavaScript, or 'module' if the file contains an exported module. * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. */ var ScriptFile = new Class({ @@ -115752,7 +116705,7 @@ var ScriptFile = new Class({ initialize: - function ScriptFile (loader, key, url, xhrSettings) + function ScriptFile (loader, key, url, type, xhrSettings) { var extension = 'js'; @@ -115762,12 +116715,17 @@ var ScriptFile = new Class({ key = GetFastValue(config, 'key'); url = GetFastValue(config, 'url'); + type = GetFastValue(config, 'type', 'script'); xhrSettings = GetFastValue(config, 'xhrSettings'); extension = GetFastValue(config, 'extension', extension); } + else if (type === undefined) + { + type = 'script'; + } var fileConfig = { - type: 'script', + type: type, cache: false, extension: extension, responseType: 'text', @@ -115815,6 +116773,15 @@ var ScriptFile = new Class({ * } * ``` * + * If the script file contains a module, then you should specify that using the 'type' parameter: + * + * ```javascript + * function preload () + * { + * this.load.script('aliens', 'lib/aliens.js', 'module'); + * } + * ``` + * * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, * or if it's already running, when the next free load slot becomes available. This happens automatically if you * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued @@ -115830,7 +116797,8 @@ var ScriptFile = new Class({ * ```javascript * this.load.script({ * key: 'aliens', - * url: 'lib/aliens.js' + * url: 'lib/aliens.js', + * type: 'script' // or 'module' * }); * ``` * @@ -115856,11 +116824,12 @@ var ScriptFile = new Class({ * * @param {(string|Phaser.Types.Loader.FileTypes.ScriptFileConfig|Phaser.Types.Loader.FileTypes.ScriptFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". + * @param {string} [type='script'] - The script type. Should be either 'script' for classic JavaScript, or 'module' if the file contains an exported module. * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. * * @return {this} The Loader instance. */ -FileTypesManager.register('script', function (key, url, xhrSettings) +FileTypesManager.register('script', function (key, url, type, xhrSettings) { if (Array.isArray(key)) { @@ -115872,7 +116841,7 @@ FileTypesManager.register('script', function (key, url, xhrSettings) } else { - this.addFile(new ScriptFile(this, key, url, xhrSettings)); + this.addFile(new ScriptFile(this, key, url, type, xhrSettings)); } return this; @@ -115888,7 +116857,7 @@ module.exports = ScriptFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -115901,7 +116870,7 @@ var ImageFile = __webpack_require__(42927); * A single Sprite Sheet Image File suitable for loading by the Loader. * * These are created when you use the Phaser.Loader.LoaderPlugin#spritesheet method and are not typically created directly. - * + * * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#spritesheet. * * @class SpriteSheetFile @@ -115937,9 +116906,7 @@ var SpriteSheetFile = new Class({ */ addToCache: function () { - var texture = this.cache.addSpriteSheet(this.key, this.data, this.config); - - this.pendingDestroy(texture); + this.cache.addSpriteSheet(this.key, this.data, this.config); } }); @@ -115954,7 +116921,7 @@ var SpriteSheetFile = new Class({ * what sort of file you're actually trying to load. * * You can call this method from within your Scene's `preload`, along with any other files you wish to load: - * + * * ```javascript * function preload () * { @@ -115969,7 +116936,7 @@ var SpriteSheetFile = new Class({ * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been * loaded. - * + * * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle. * If you try to load an animated gif only the first frame will be rendered. Browsers do not natively support playback * of animated gifs to Canvas elements. @@ -115980,7 +116947,7 @@ var SpriteSheetFile = new Class({ * then remove it from the Texture Manager first, before loading a new one. * * Instead of passing arguments you can pass a configuration object, such as: - * + * * ```javascript * this.load.spritesheet({ * key: 'bot', @@ -115997,7 +116964,7 @@ var SpriteSheetFile = new Class({ * See the documentation for `Phaser.Types.Loader.FileTypes.SpriteSheetFileConfig` for more details. * * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key: - * + * * ```javascript * this.load.spritesheet('bot', 'images/robot.png', { frameWidth: 32, frameHeight: 38 }); * // and later in your game ... @@ -116016,13 +116983,13 @@ var SpriteSheetFile = new Class({ * * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image, * then you can specify it by providing an array as the `url` where the second element is the normal map: - * + * * ```javascript * this.load.spritesheet('logo', [ 'images/AtariLogo.png', 'images/AtariLogo-n.png' ], { frameWidth: 256, frameHeight: 80 }); * ``` * * Or, if you are using a config object use the `normalMap` property: - * + * * ```javascript * this.load.spritesheet({ * key: 'logo', @@ -116037,7 +117004,7 @@ var SpriteSheetFile = new Class({ * * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings. * Normal maps are a WebGL only feature. - * + * * Note: The ability to load this type of file will only be available if the Sprite Sheet File type has been built into Phaser. * It is available in the default build but can be excluded from custom builds. * @@ -116080,7 +117047,7 @@ module.exports = SpriteSheetFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -116260,7 +117227,7 @@ module.exports = TextFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -116353,8 +117320,6 @@ var TilemapCSVFile = new Class({ var tiledata = { format: this.tilemapFormat, data: this.data }; this.cache.add(this.key, tiledata); - - this.pendingDestroy(tiledata); } }); @@ -116456,7 +117421,7 @@ module.exports = TilemapCSVFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -116510,8 +117475,6 @@ var TilemapImpactFile = new Class({ var tiledata = { format: TILEMAP_FORMATS.WELTMEISTER, data: this.data }; this.cache.add(this.key, tiledata); - - this.pendingDestroy(tiledata); } }); @@ -116613,7 +117576,7 @@ module.exports = TilemapImpactFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -116667,8 +117630,6 @@ var TilemapJSONFile = new Class({ var tiledata = { format: TILEMAP_FORMATS.TILED_JSON, data: this.data }; this.cache.add(this.key, tiledata); - - this.pendingDestroy(tiledata); } }); @@ -116770,7 +117731,7 @@ module.exports = TilemapJSONFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -116868,8 +117829,6 @@ var UnityAtlasFile = new Class({ this.loader.textureManager.addUnityAtlas(image.key, image.data, text.data, normalMap); - text.pendingDestroy(); - this.complete = true; } } @@ -117013,7 +117972,7 @@ module.exports = UnityAtlasFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -117041,7 +118000,7 @@ var IsPlainObject = __webpack_require__(42911); * * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. * @param {(string|Phaser.Types.Loader.FileTypes.VideoFileConfig)} key - The key to use for this file, or a file configuration object. - * @param {any} [urlConfig] - The absolute or relative URL to load this file from in a config object. + * @param {Phaser.Types.Loader.FileTypes.VideoFileURLConfig} [urlConfig] - The absolute or relative URL to load this file from in a config object. * @param {string} [loadEvent] - The load event to listen for when _not_ loading as a blob. Either 'loadeddata', 'canplay' or 'canplaythrough'. * @param {boolean} [asBlob] - Load the video as a data blob, or via the Video element? * @param {boolean} [noAudio] - Does the video have an audio track? If not you can enable auto-playing on it. @@ -117361,7 +118320,7 @@ VideoFile.getVideoURL = function (game, urls) * @since 3.20.0 * * @param {(string|Phaser.Types.Loader.FileTypes.VideoFileConfig|Phaser.Types.Loader.FileTypes.VideoFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. - * @param {(string|string[])} [urls] - The absolute or relative URL to load the video files from. + * @param {(string|string[]|Phaser.Types.Loader.FileTypes.VideoFileURLConfig|Phaser.Types.Loader.FileTypes.VideoFileURLConfig[])} [urls] - The absolute or relative URL to load the video files from. * @param {string} [loadEvent='loadeddata'] - The load event to listen for when _not_ loading as a blob. Either `loadeddata`, `canplay` or `canplaythrough`. * @param {boolean} [asBlob=false] - Load the video as a data blob, or stream it via the Video element? * @param {boolean} [noAudio=false] - Does the video have an audio track? If not you can enable auto-playing on it. @@ -117409,7 +118368,7 @@ module.exports = VideoFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -117593,7 +118552,7 @@ module.exports = XMLFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -117647,7 +118606,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -117688,7 +118647,7 @@ module.exports = Loader; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -117724,7 +118683,7 @@ module.exports = Average; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -117756,7 +118715,7 @@ module.exports = Bernstein; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -117786,7 +118745,7 @@ module.exports = Between; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -117824,7 +118783,7 @@ module.exports = CatmullRom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -117862,7 +118821,7 @@ module.exports = CeilTo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -117893,7 +118852,7 @@ module.exports = Clamp; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -117924,7 +118883,7 @@ module.exports = DegToRad; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -117954,7 +118913,7 @@ module.exports = Difference; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -118238,7 +119197,7 @@ module.exports = Euler; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -118279,7 +119238,7 @@ module.exports = Factorial; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -118309,7 +119268,7 @@ module.exports = FloatBetween; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -118347,7 +119306,7 @@ module.exports = FloorTo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -118382,7 +119341,7 @@ module.exports = FromPercent; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -118416,7 +119375,7 @@ module.exports = GetSpeed; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -118448,7 +119407,7 @@ module.exports = IsEven; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -118478,7 +119437,7 @@ module.exports = IsEvenStrict; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -118502,6 +119461,41 @@ var Linear = function (p0, p1, t) module.exports = Linear; +/***/ }), + +/***/ 61072: +/***/ ((module) => { + +/** + * @author Greg McLean + * @copyright 2021 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Interpolates two given Vectors and returns a new Vector between them. + * + * Does not modify either of the passed Vectors. + * + * @function Phaser.Math.LinearXY + * @since 3.60.0 + * + * @param {Phaser.Math.Vector2} vector1 - Starting vector + * @param {Phaser.Math.Vector2} vector2 - Ending vector + * @param {number} [t=0] - The percentage between vector1 and vector2 to return, represented as a number between 0 and 1. + * + * @return {Phaser.Math.Vector2} The step t% of the way between vector1 and vector2. + */ +var LinearXY = function (vector1, vector2, t) +{ + if (t === undefined) { t = 0; } + + return vector1.clone().lerp(vector2, t); +}; + +module.exports = LinearXY; + + /***/ }), /***/ 5341: @@ -118509,7 +119503,7 @@ module.exports = Linear; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -119103,7 +120097,7 @@ module.exports = Matrix3; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -120897,7 +121891,7 @@ module.exports = Matrix4; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -120970,7 +121964,7 @@ module.exports = Median; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -121001,7 +121995,7 @@ module.exports = MinSub; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -121061,7 +122055,7 @@ module.exports = Percent; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122111,7 +123105,7 @@ module.exports = Quaternion; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122142,7 +123136,7 @@ module.exports = RadToDeg; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122183,7 +123177,7 @@ module.exports = RandomXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122223,7 +123217,7 @@ module.exports = RandomXYZ; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122260,7 +123254,7 @@ module.exports = RandomXYZW; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122296,7 +123290,7 @@ module.exports = Rotate; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122341,7 +123335,7 @@ module.exports = RotateAround; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122383,7 +123377,7 @@ module.exports = RotateAroundDistance; /** * @author samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122421,7 +123415,7 @@ module.exports = RotateTo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122470,7 +123464,7 @@ module.exports = RotateVec3; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122500,23 +123494,23 @@ module.exports = RoundAwayFromZero; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Round a value to the given precision. - * + * * For example: - * + * * ```javascript * RoundTo(123.456, 0) = 123 * RoundTo(123.456, 1) = 120 * RoundTo(123.456, 2) = 100 * ``` - * + * * To round the decimal, i.e. to round to precision, pass in a negative `place`: - * + * * ```javascript * RoundTo(123.456789, 0) = 123 * RoundTo(123.456789, -1) = 123.5 @@ -122553,7 +123547,7 @@ module.exports = RoundTo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122607,7 +123601,7 @@ module.exports = SinCosTableGenerator; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122655,7 +123649,7 @@ module.exports = SmoothStep; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122695,7 +123689,7 @@ module.exports = SmootherStep; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122703,9 +123697,9 @@ var Vector2 = __webpack_require__(93736); /** * Returns a Vector2 containing the x and y position of the given index in a `width` x `height` sized grid. - * + * * For example, in a 6 x 4 grid, index 16 would equal x: 4 y: 2. - * + * * If the given index is out of range an empty Vector2 is returned. * * @function Phaser.Math.ToXY @@ -122752,7 +123746,7 @@ module.exports = ToXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122808,7 +123802,7 @@ module.exports = TransformXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -123499,6 +124493,23 @@ var Vector2 = new Class({ var sin = Math.sin(delta); return this.set(cos * this.x - sin * this.y, sin * this.x + cos * this.y); + }, + + /** + * Project this Vector onto another. + * + * @method Phaser.Math.Vector2#project + * @since 3.60.0 + * + * @param {Phaser.Math.Vector2} src - The vector to project onto. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + project: function (src) + { + var scalar = this.dot(src) / src.dot(src); + + return this.copy(src).scale(scalar); } }); @@ -123585,7 +124596,7 @@ module.exports = Vector2; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -124632,7 +125643,7 @@ module.exports = Vector3; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125174,7 +126185,7 @@ module.exports = Vector4; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125205,12 +126216,12 @@ module.exports = Within; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** - * Wrap the given `value` between `min` and `max. + * Wrap the given `value` between `min` and `max`. * * @function Phaser.Math.Wrap * @since 3.0.0 @@ -125238,7 +126249,7 @@ module.exports = Wrap; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125270,7 +126281,7 @@ module.exports = Between; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125302,7 +126313,7 @@ module.exports = BetweenPoints; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125335,7 +126346,7 @@ module.exports = BetweenPointsY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125370,7 +126381,7 @@ module.exports = BetweenY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125416,7 +126427,7 @@ module.exports = CounterClockwise; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125455,7 +126466,7 @@ module.exports = Normalize; /** * @author Richard Davey * @author @samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125485,7 +126496,7 @@ module.exports = Random; /** * @author Richard Davey * @author @samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125514,7 +126525,7 @@ module.exports = RandomDegrees; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125545,7 +126556,7 @@ module.exports = Reverse; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125613,7 +126624,7 @@ module.exports = RotateTo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125661,7 +126672,7 @@ module.exports = ShortestBetween; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125694,7 +126705,7 @@ module.exports = Wrap; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125727,7 +126738,7 @@ module.exports = WrapDegrees; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125761,7 +126772,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125769,7 +126780,7 @@ var MATH_CONST = { /** * The value of PI * 2. - * + * * @name Phaser.Math.PI2 * @type {number} * @since 3.0.0 @@ -125778,7 +126789,7 @@ var MATH_CONST = { /** * The value of PI * 0.5. - * + * * @name Phaser.Math.TAU * @type {number} * @since 3.0.0 @@ -125787,7 +126798,7 @@ var MATH_CONST = { /** * An epsilon value (1.0e-6) - * + * * @name Phaser.Math.EPSILON * @type {number} * @since 3.0.0 @@ -125796,7 +126807,7 @@ var MATH_CONST = { /** * For converting degrees to radians (PI / 180) - * + * * @name Phaser.Math.DEG_TO_RAD * @type {number} * @since 3.0.0 @@ -125805,7 +126816,7 @@ var MATH_CONST = { /** * For converting radians to degrees (180 / PI) - * + * * @name Phaser.Math.RAD_TO_DEG * @type {number} * @since 3.0.0 @@ -125815,7 +126826,7 @@ var MATH_CONST = { /** * An instance of the Random Number Generator. * This is not set until the Game boots. - * + * * @name Phaser.Math.RND * @type {Phaser.Math.RandomDataGenerator} * @since 3.0.0 @@ -125825,7 +126836,7 @@ var MATH_CONST = { /** * The minimum safe integer this browser supports. * We use a const for backward compatibility with Internet Explorer. - * + * * @name Phaser.Math.MIN_SAFE_INTEGER * @type {number} * @since 3.21.0 @@ -125835,7 +126846,7 @@ var MATH_CONST = { /** * The maximum safe integer this browser supports. * We use a const for backward compatibility with Internet Explorer. - * + * * @name Phaser.Math.MAX_SAFE_INTEGER * @type {number} * @since 3.21.0 @@ -125854,7 +126865,7 @@ module.exports = MATH_CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125889,7 +126900,7 @@ module.exports = DistanceBetween; /** * @author samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125922,7 +126933,7 @@ module.exports = DistanceBetweenPoints; /** * @author samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125955,7 +126966,7 @@ module.exports = DistanceBetweenPointsSquared; /** * @author samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125990,7 +127001,7 @@ module.exports = ChebyshevDistance; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126025,7 +127036,7 @@ module.exports = DistancePower; /** * @author samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126060,7 +127071,7 @@ module.exports = SnakeDistance; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126095,7 +127106,7 @@ module.exports = DistanceSquared; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126123,7 +127134,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126205,7 +127216,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126237,7 +127248,7 @@ module.exports = In; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126278,7 +127289,7 @@ module.exports = InOut; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126310,7 +127321,7 @@ module.exports = Out; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126334,7 +127345,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126380,7 +127391,7 @@ module.exports = In; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126445,7 +127456,7 @@ module.exports = InOut; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126489,7 +127500,7 @@ module.exports = Out; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126513,7 +127524,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126542,7 +127553,7 @@ module.exports = In; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126578,7 +127589,7 @@ module.exports = InOut; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126607,7 +127618,7 @@ module.exports = Out; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126631,7 +127642,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126660,7 +127671,7 @@ module.exports = In; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126696,7 +127707,7 @@ module.exports = InOut; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126725,7 +127736,7 @@ module.exports = Out; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126749,7 +127760,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126805,7 +127816,7 @@ module.exports = In; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126868,7 +127879,7 @@ module.exports = InOut; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126924,7 +127935,7 @@ module.exports = Out; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126948,7 +127959,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126977,7 +127988,7 @@ module.exports = In; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127013,7 +128024,7 @@ module.exports = InOut; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127042,7 +128053,7 @@ module.exports = Out; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127066,7 +128077,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127099,7 +128110,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127128,7 +128139,7 @@ module.exports = Linear; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127142,7 +128153,7 @@ module.exports = __webpack_require__(43927); /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127171,7 +128182,7 @@ module.exports = In; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127207,7 +128218,7 @@ module.exports = InOut; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127236,7 +128247,7 @@ module.exports = Out; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127260,7 +128271,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127289,7 +128300,7 @@ module.exports = In; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127325,7 +128336,7 @@ module.exports = InOut; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127354,7 +128365,7 @@ module.exports = Out; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127378,7 +128389,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127407,7 +128418,7 @@ module.exports = In; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127443,7 +128454,7 @@ module.exports = InOut; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127472,7 +128483,7 @@ module.exports = Out; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127496,7 +128507,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127536,7 +128547,7 @@ module.exports = In; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127576,7 +128587,7 @@ module.exports = InOut; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127616,7 +128627,7 @@ module.exports = Out; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127640,7 +128651,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127683,7 +128694,7 @@ module.exports = Stepped; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127701,7 +128712,7 @@ module.exports = __webpack_require__(52770); /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127733,7 +128744,7 @@ module.exports = Ceil; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127768,7 +128779,7 @@ module.exports = Equal; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127800,7 +128811,7 @@ module.exports = Floor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127835,7 +128846,7 @@ module.exports = GreaterThan; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127870,7 +128881,7 @@ module.exports = LessThan; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127896,7 +128907,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127939,6 +128950,7 @@ var PhaserMath = { IsEven: __webpack_require__(43776), IsEvenStrict: __webpack_require__(58442), Linear: __webpack_require__(42798), + LinearXY: __webpack_require__(61072), MaxAdd: __webpack_require__(69635), Median: __webpack_require__(37394), MinSub: __webpack_require__(17259), @@ -127988,7 +129000,7 @@ module.exports = PhaserMath; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128028,7 +129040,7 @@ module.exports = BezierInterpolation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128086,7 +129098,7 @@ module.exports = CatmullRomInterpolation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128157,7 +129169,7 @@ module.exports = CubicBezierInterpolation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128205,7 +129217,7 @@ module.exports = LinearInterpolation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128265,7 +129277,7 @@ module.exports = QuadraticBezierInterpolation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128299,7 +129311,7 @@ module.exports = SmoothStepInterpolation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128333,7 +129345,7 @@ module.exports = SmootherStepInterpolation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128361,7 +129373,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128392,7 +129404,7 @@ module.exports = GetPowerOfTwo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128423,7 +129435,7 @@ module.exports = IsSizePowerOfTwo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128452,7 +129464,7 @@ module.exports = IsValuePowerOfTwo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128476,7 +129488,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128485,13 +129497,13 @@ var Class = __webpack_require__(56694); /** * @classdesc * A seeded Random Data Generator. - * + * * Access via `Phaser.Math.RND` which is an instance of this class pre-defined * by Phaser. Or, create your own instance to use as you require. - * + * * The `Math.RND` generator is seeded by the Game Config property value `seed`. * If no such config property exists, a random number is used. - * + * * If you create your own instance of this class you should provide a seed for it. * If no seed is given it will use a 'random' one based on Date.now. * @@ -128823,7 +129835,7 @@ var RandomDataGenerator = new Class({ * * @method Phaser.Math.RandomDataGenerator#pick * @since 3.0.0 - * + * * @generic T * @genericUse {T[]} - [array] * @genericUse {T} - [$return] @@ -128987,7 +129999,7 @@ module.exports = RandomDataGenerator; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -129032,7 +130044,7 @@ module.exports = SnapCeil; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -129077,7 +130089,7 @@ module.exports = SnapFloor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -129121,7 +130133,7 @@ module.exports = SnapTo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -129145,7 +130157,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -129239,7 +130251,7 @@ __webpack_require__.g.Phaser = Phaser; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -129342,7 +130354,7 @@ module.exports = ArcadeImage; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -129539,8 +130551,8 @@ var ArcadePhysics = new Class({ * * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object or array of objects to check. * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`. - * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they overlap. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [overlapCallback] - An optional callback function that is called if the objects overlap. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they overlap. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {*} [callbackContext] - The context in which to run the callbacks. * * @return {boolean} True if at least one Game Object overlaps another. @@ -129581,8 +130593,8 @@ var ArcadePhysics = new Class({ * * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object or array of objects to check. * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`. - * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {*} [callbackContext] - The context in which to run the callbacks. * * @return {boolean} True if any overlapping Game Objects were separated, otherwise false. @@ -129620,8 +130632,8 @@ var ArcadePhysics = new Class({ * * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision. * @param {Phaser.Tilemaps.Tile[]} tiles - An array of Tiles to check for collision against. - * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} [callbackContext] - The context in which to run the callbacks. * * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated. @@ -129648,8 +130660,8 @@ var ArcadePhysics = new Class({ * * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision. * @param {Phaser.Tilemaps.Tile[]} tiles - An array of Tiles to check for collision against. - * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects overlap. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects overlap. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} [callbackContext] - The context in which to run the callbacks. * * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated. @@ -130068,7 +131080,7 @@ module.exports = ArcadePhysics; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -130173,7 +131185,7 @@ module.exports = ArcadeSprite; /** * @author Richard Davey * @author Benjamin D. Richards - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -130197,7 +131209,7 @@ var Vector2 = __webpack_require__(93736); * @since 3.0.0 * * @param {Phaser.Physics.Arcade.World} world - The Arcade Physics simulation this Body belongs to. - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object this Body belongs to. + * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object this Body belongs to. As of Phaser 3.60 this is now optional. */ var Body = new Class({ @@ -130205,8 +131217,32 @@ var Body = new Class({ function Body (world, gameObject) { - var width = (gameObject.displayWidth) ? gameObject.displayWidth : 64; - var height = (gameObject.displayHeight) ? gameObject.displayHeight : 64; + var width = 64; + var height = 64; + + var dummyGameObject = { + x: 0, + y: 0, + angle: 0, + rotation: 0, + scaleX: 1, + scaleY: 1, + displayOriginX: 0, + displayOriginY: 0 + }; + + var hasGameObject = (gameObject !== undefined); + + if (hasGameObject && gameObject.displayWidth) + { + width = gameObject.displayWidth; + height = gameObject.displayHeight; + } + + if (!hasGameObject) + { + gameObject = dummyGameObject; + } /** * The Arcade Physics simulation this Body belongs to. @@ -130220,11 +131256,23 @@ var Body = new Class({ /** * The Game Object this Body belongs to. * + * As of Phaser 3.60 this is now optional and can be undefined. + * * @name Phaser.Physics.Arcade.Body#gameObject * @type {Phaser.GameObjects.GameObject} * @since 3.0.0 */ - this.gameObject = gameObject; + this.gameObject = (hasGameObject) ? gameObject : undefined; + + /** + * A quick-test flag that signifies this is a Body, used in the World collision handler. + * + * @name Phaser.Physics.Arcade.Body#isBody + * @type {boolean} + * @readonly + * @since 3.60.0 + */ + this.isBody = true; /** * Transformations applied to this Body. @@ -131196,7 +132244,10 @@ var Body = new Class({ this.resetFlags(); } - this.updateFromGameObject(); + if (this.gameObject) + { + this.updateFromGameObject(); + } this.rotation = this.transform.rotation; this.preRotation = this.rotation; @@ -131274,6 +132325,7 @@ var Body = new Class({ { var dx = this.position.x - this.prevFrame.x; var dy = this.position.y - this.prevFrame.y; + var gameObject = this.gameObject; if (this.moves) { @@ -131304,8 +132356,11 @@ var Body = new Class({ } } - this.gameObject.x += dx; - this.gameObject.y += dy; + if (gameObject) + { + gameObject.x += dx; + gameObject.y += dy; + } } if (dx < 0) @@ -131326,9 +132381,9 @@ var Body = new Class({ this.facing = CONST.FACING_DOWN; } - if (this.allowRotation) + if (this.allowRotation && gameObject) { - this.gameObject.angle += this.deltaZ(); + gameObject.angle += this.deltaZ(); } this._tx = dx; @@ -131432,6 +132487,53 @@ var Body = new Class({ return this; }, + /** + * Assign this Body to a new Game Object. + * + * Removes this body from the Physics World, assigns to the new Game Object, calls `setSize` and then + * adds this body back into the World again, setting it enabled, unless the `enable` argument is set to `false`. + * + * If this body already has a Game Object, then it will remove itself from that Game Object first. + * + * Only if the given `gameObject` has a `body` property will this Body be assigned to it. + * + * @method Phaser.Physics.Arcade.Body#setGameObject + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object this Body belongs to. + * @param {boolean} [enable=true] - Automatically enable this Body for physics. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setGameObject: function (gameObject, enable) + { + if (enable === undefined) { enable = true; } + + // Remove from the World + this.world.remove(this); + + if (this.gameObject && this.gameObject.body) + { + // Disconnect the current Game Object + this.gameObject.body = null; + } + + this.gameObject = gameObject; + + if (gameObject.body) + { + gameObject.body = this; + } + + this.setSize(); + + this.world.add(this); + + this.enable = enable; + + return this; + }, + /** * Sizes and positions this Body, as a rectangle. * Modifies the Body `offset` if `center` is true (the default). @@ -131452,14 +132554,17 @@ var Body = new Class({ var gameObject = this.gameObject; - if (!width && gameObject.frame) + if (gameObject) { - width = gameObject.frame.realWidth; - } + if (!width && gameObject.frame) + { + width = gameObject.frame.realWidth; + } - if (!height && gameObject.frame) - { - height = gameObject.frame.realHeight; + if (!height && gameObject.frame) + { + height = gameObject.frame.realHeight; + } } this.sourceWidth = width; @@ -131473,7 +132578,7 @@ var Body = new Class({ this.updateCenter(); - if (center && gameObject.getCenter) + if (center && gameObject && gameObject.getCenter) { var ox = (gameObject.width - width) / 2; var oy = (gameObject.height - height) / 2; @@ -131546,25 +132651,35 @@ var Body = new Class({ var gameObject = this.gameObject; - gameObject.setPosition(x, y); - - if (gameObject.getTopLeft) + if (gameObject) { - gameObject.getTopLeft(this.position); + gameObject.setPosition(x, y); + + this.rotation = gameObject.angle; + this.preRotation = gameObject.angle; + } + + var pos = this.position; + + if (gameObject && gameObject.getTopLeft) + { + gameObject.getTopLeft(pos); } else { - this.position.set(x, y); + pos.set(x, y); } - this.prev.copy(this.position); - this.prevFrame.copy(this.position); + this.prev.copy(pos); + this.prevFrame.copy(pos); - this.rotation = gameObject.angle; - this.preRotation = gameObject.angle; + if (gameObject) + { + this.updateBounds(); + } - this.updateBounds(); this.updateCenter(); + this.checkWorldBounds(); this.resetFlags(true); }, @@ -131928,6 +133043,16 @@ var Body = new Class({ return this; }, + setValue: function (vec2, x, y) + { + if (x === undefined) { x = vec2.x; } + if (y === undefined) { y = vec2.y; } + + vec2.set(x, y); + + return this; + }, + /** * Sets the Body's velocity. * @@ -131963,14 +133088,7 @@ var Body = new Class({ */ setVelocityX: function (value) { - this.velocity.x = value; - - var x = value; - var y = this.velocity.y; - - this.speed = Math.sqrt(x * x + y * y); - - return this; + return this.setVelocity(value, this.velocity.y); }, /** @@ -131985,14 +133103,7 @@ var Body = new Class({ */ setVelocityY: function (value) { - this.velocity.y = value; - - var x = this.velocity.x; - var y = value; - - this.speed = Math.sqrt(x * x + y * y); - - return this; + return this.setVelocity(this.velocity.x, value); }, /** @@ -132709,7 +133820,7 @@ module.exports = Body; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -132729,8 +133840,8 @@ var Class = __webpack_require__(56694); * @param {boolean} overlapOnly - Whether to check for collisions or overlap. * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object to check for collision. * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object2 - The second object to check for collision. - * @param {ArcadePhysicsCallback} collideCallback - The callback to invoke when the two objects collide. - * @param {ArcadePhysicsCallback} processCallback - The callback to invoke when the two objects collide. Must return a boolean. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} collideCallback - The callback to invoke when the two objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} processCallback - The callback to invoke when the two objects collide. Must return a boolean. * @param {any} callbackContext - The scope in which to call the callbacks. */ var Collider = new Class({ @@ -132798,7 +133909,7 @@ var Collider = new Class({ * The callback to invoke when the two objects collide. * * @name Phaser.Physics.Arcade.Collider#collideCallback - * @type {ArcadePhysicsCallback} + * @type {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} * @since 3.0.0 */ this.collideCallback = collideCallback; @@ -132807,7 +133918,7 @@ var Collider = new Class({ * If a processCallback exists it must return true or collision checking will be skipped. * * @name Phaser.Physics.Arcade.Collider#processCallback - * @type {ArcadePhysicsCallback} + * @type {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} * @since 3.0.0 */ this.processCallback = processCallback; @@ -132893,15 +134004,17 @@ module.exports = Collider; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var ArcadeImage = __webpack_require__(62832); var ArcadeSprite = __webpack_require__(25084); +var Body = __webpack_require__(97602); var Class = __webpack_require__(56694); var CONST = __webpack_require__(47401); var PhysicsGroup = __webpack_require__(10481); +var StaticBody = __webpack_require__(66634); var StaticPhysicsGroup = __webpack_require__(46346); /** @@ -132956,10 +134069,10 @@ var Factory = new Class({ * @method Phaser.Physics.Arcade.Factory#collider * @since 3.0.0 * - * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]|Phaser.GameObjects.Group|Phaser.GameObjects.Group[])} object1 - The first object to check for collision. - * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]|Phaser.GameObjects.Group|Phaser.GameObjects.Group[])} object2 - The second object to check for collision. - * @param {ArcadePhysicsCallback} [collideCallback] - The callback to invoke when the two objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - The callback to invoke when the two objects collide. Must return a boolean. + * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object to check for collision. + * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object2 - The second object to check for collision. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - The callback to invoke when the two objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - The callback to invoke when the two objects collide. Must return a boolean. * @param {*} [callbackContext] - The scope in which to call the callbacks. * * @return {Phaser.Physics.Arcade.Collider} The Collider that was created. @@ -132975,10 +134088,10 @@ var Factory = new Class({ * @method Phaser.Physics.Arcade.Factory#overlap * @since 3.0.0 * - * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]|Phaser.GameObjects.Group|Phaser.GameObjects.Group[])} object1 - The first object to check for overlap. - * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]|Phaser.GameObjects.Group|Phaser.GameObjects.Group[])} object2 - The second object to check for overlap. - * @param {ArcadePhysicsCallback} [collideCallback] - The callback to invoke when the two objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - The callback to invoke when the two objects collide. Must return a boolean. + * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object to check for overlap. + * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object2 - The second object to check for overlap. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - The callback to invoke when the two objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - The callback to invoke when the two objects collide. Must return a boolean. * @param {*} [callbackContext] - The scope in which to call the callbacks. * * @return {Phaser.Physics.Arcade.Collider} The Collider that was created. @@ -133142,6 +134255,70 @@ var Factory = new Class({ return this.sys.updateList.add(new PhysicsGroup(this.world, this.world.scene, children, config)); }, + /** + * Creates a new physics Body with the given position and size. + * + * This Body is not associated with any Game Object, but still exists within the world + * and can be tested for collision, have velocity, etc. + * + * @method Phaser.Physics.Arcade.Factory#body + * @since 3.60.0 + * + * @param {number} x - The horizontal position of this Body in the physics world. + * @param {number} y - The vertical position of this Body in the physics world. + * @param {number} [width=64] - The width of the Body in pixels. Cannot be negative or zero. + * @param {number} [height=64] - The height of the Body in pixels. Cannot be negative or zero. + * + * @return {Phaser.Physics.Arcade.Body} The Body that was created. + */ + body: function (x, y, width, height) + { + var body = new Body(this.world); + + body.position.set(x, y); + + if (width && height) + { + body.setSize(width, height); + } + + this.world.add(body, CONST.DYNAMIC_BODY); + + return body; + }, + + /** + * Creates a new static physics Body with the given position and size. + * + * This Body is not associated with any Game Object, but still exists within the world + * and can be tested for collision, etc. + * + * @method Phaser.Physics.Arcade.Factory#staticBody + * @since 3.60.0 + * + * @param {number} x - The horizontal position of this Body in the physics world. + * @param {number} y - The vertical position of this Body in the physics world. + * @param {number} [width=64] - The width of the Body in pixels. Cannot be negative or zero. + * @param {number} [height=64] - The height of the Body in pixels. Cannot be negative or zero. + * + * @return {Phaser.Physics.Arcade.Body} The Body that was created. + */ + staticBody: function (x, y, width, height) + { + var body = new StaticBody(this.world); + + body.position.set(x, y); + + if (width && height) + { + body.setSize(width, height); + } + + this.world.add(body, CONST.STATIC_BODY); + + return body; + }, + /** * Destroys this Factory. * @@ -133167,7 +134344,7 @@ module.exports = Factory; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -133276,7 +134453,7 @@ module.exports = GetOverlapX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -133385,7 +134562,7 @@ module.exports = GetOverlapY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -133488,7 +134665,7 @@ var PhysicsGroup = new Class({ * This should be either `Phaser.Physics.Arcade.Image`, `Phaser.Physics.Arcade.Sprite`, or a class extending one of those. * * @name Phaser.Physics.Arcade.Group#classType - * @type {Function} + * @type {Phaser.Types.GameObjects.Group.GroupClassTypeConstructor} * @default ArcadeSprite * @since 3.0.0 */ @@ -133682,7 +134859,7 @@ module.exports = PhysicsGroup; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -134100,7 +135277,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -134518,7 +135695,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -134590,7 +135767,7 @@ module.exports = SeparateX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -134662,7 +135839,7 @@ module.exports = SeparateY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -134689,7 +135866,7 @@ var Vector2 = __webpack_require__(93736); * @since 3.0.0 * * @param {Phaser.Physics.Arcade.World} world - The Arcade Physics simulation this Static Body belongs to. - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object this Static Body belongs to. + * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object this Body belongs to. As of Phaser 3.60 this is now optional. */ var StaticBody = new Class({ @@ -134697,8 +135874,32 @@ var StaticBody = new Class({ function StaticBody (world, gameObject) { - var width = (gameObject.displayWidth) ? gameObject.displayWidth : 64; - var height = (gameObject.displayHeight) ? gameObject.displayHeight : 64; + var width = 64; + var height = 64; + + var dummyGameObject = { + x: 0, + y: 0, + angle: 0, + rotation: 0, + scaleX: 1, + scaleY: 1, + displayOriginX: 0, + displayOriginY: 0 + }; + + var hasGameObject = (gameObject !== undefined); + + if (hasGameObject && gameObject.displayWidth) + { + width = gameObject.displayWidth; + height = gameObject.displayHeight; + } + + if (!hasGameObject) + { + gameObject = dummyGameObject; + } /** * The Arcade Physics simulation this Static Body belongs to. @@ -134712,11 +135913,24 @@ var StaticBody = new Class({ /** * The Game Object this Static Body belongs to. * + * As of Phaser 3.60 this is now optional and can be undefined. + * * @name Phaser.Physics.Arcade.StaticBody#gameObject * @type {Phaser.GameObjects.GameObject} * @since 3.0.0 */ - this.gameObject = gameObject; + this.gameObject = (hasGameObject) ? gameObject : undefined; + + + /** + * A quick-test flag that signifies this is a Body, used in the World collision handler. + * + * @name Phaser.Physics.Arcade.StaticBody#isBody + * @type {boolean} + * @readonly + * @since 3.60.0 + */ + this.isBody = true; /** * Whether the Static Body's boundary is drawn to the debug display. @@ -135675,7 +136889,7 @@ module.exports = StaticBody; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -135875,7 +137089,7 @@ module.exports = StaticPhysicsGroup; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -136274,6 +137488,15 @@ var World = new Class({ */ this._tempMatrix2 = new TransformMatrix(); + /** + * The Filtering Options passed to `GetTilesWithinWorldXY` as part of the `collideSpriteVsTilemapLayer` check. + * + * @name Phaser.Physics.Arcade.World#tileFilterOptions + * @type {Phaser.Types.Tilemaps.FilteringOptions} + * @since 3.60.0 + */ + this.tileFilterOptions = { isColliding: true, isNotEmpty: true, hasInterestingFace: true }; + if (this.drawDebug) { this.createDebugGraphic(); @@ -136382,19 +137605,22 @@ var World = new Class({ { if (bodyType === undefined) { bodyType = CONST.DYNAMIC_BODY; } - if (!object.body) + if (object.hasTransformComponent) { - if (bodyType === CONST.DYNAMIC_BODY) + if (!object.body) { - object.body = new Body(this, object); + if (bodyType === CONST.DYNAMIC_BODY) + { + object.body = new Body(this, object); + } + else if (bodyType === CONST.STATIC_BODY) + { + object.body = new StaticBody(this, object); + } } - else if (bodyType === CONST.STATIC_BODY) - { - object.body = new StaticBody(this, object); - } - } - this.add(object.body); + this.add(object.body); + } return object; }, @@ -136677,8 +137903,8 @@ var World = new Class({ * * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object to check for collision. * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object2 - The second object to check for collision. - * @param {ArcadePhysicsCallback} [collideCallback] - The callback to invoke when the two objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - The callback to invoke when the two objects collide. Must return a boolean. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - The callback to invoke when the two objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - The callback to invoke when the two objects collide. Must return a boolean. * @param {*} [callbackContext] - The scope in which to call the callbacks. * * @return {Phaser.Physics.Arcade.Collider} The Collider that was created. @@ -136712,8 +137938,8 @@ var World = new Class({ * * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object to check for overlap. * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object2 - The second object to check for overlap. - * @param {ArcadePhysicsCallback} [collideCallback] - The callback to invoke when the two objects overlap. - * @param {ArcadePhysicsCallback} [processCallback] - The callback to invoke when the two objects overlap. Must return a boolean. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - The callback to invoke when the two objects overlap. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - The callback to invoke when the two objects overlap. Must return a boolean. * @param {*} [callbackContext] - The scope in which to call the callbacks. * * @return {Phaser.Physics.Arcade.Collider} The Collider that was created. @@ -137218,17 +138444,15 @@ var World = new Class({ * * @param {Phaser.Physics.Arcade.Body} body1 - The first Body to be separated. * @param {Phaser.Physics.Arcade.Body} body2 - The second Body to be separated. - * @param {ArcadePhysicsCallback} [processCallback] - The process callback. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - The process callback. * @param {*} [callbackContext] - The context in which to invoke the callback. * @param {boolean} [overlapOnly] - If this a collide or overlap check? - * @param {boolean} [intersects] - Assert that the bodies intersect and should not be tested before separation. * * @return {boolean} True if separation occurred, otherwise false. */ - separate: function (body1, body2, processCallback, callbackContext, overlapOnly, intersects) + separate: function (body1, body2, processCallback, callbackContext, overlapOnly) { if ( - !intersects && !body1.enable || !body2.enable || body1.checkCollision.none || @@ -137555,8 +138779,8 @@ var World = new Class({ * * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object or array of objects to check. * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`. - * @param {ArcadePhysicsCallback} [overlapCallback] - An optional callback function that is called if the objects overlap. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they overlap. If this is set then `overlapCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [overlapCallback] - An optional callback function that is called if the objects overlap. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they overlap. If this is set then `overlapCallback` will only be called if this callback returns `true`. * @param {*} [callbackContext] - The context in which to run the callbacks. * * @return {boolean} True if at least one Game Object overlaps another. @@ -137598,8 +138822,8 @@ var World = new Class({ * * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object or array of objects to check. * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`. - * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} [callbackContext] - The context in which to run the callbacks. * * @return {boolean} `true` if any overlapping Game Objects were separated, otherwise `false`. @@ -137622,8 +138846,8 @@ var World = new Class({ * * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object to check for collision. * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} [object2] - The second object to check for collision. - * @param {ArcadePhysicsCallback} collideCallback - The callback to invoke when the two objects collide. - * @param {ArcadePhysicsCallback} processCallback - The callback to invoke when the two objects collide. Must return a boolean. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} collideCallback - The callback to invoke when the two objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} processCallback - The callback to invoke when the two objects collide. Must return a boolean. * @param {any} callbackContext - The scope in which to call the callbacks. * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * @@ -137715,8 +138939,8 @@ var World = new Class({ * * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object or array of objects to check. * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object2 - The second object or array of objects to check, or `undefined`. - * @param {ArcadePhysicsCallback} collideCallback - An optional callback function that is called if the objects collide. - * @param {ArcadePhysicsCallback} processCallback - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} collideCallback - An optional callback function that is called if the objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} processCallback - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} callbackContext - The context in which to run the callbacks. * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * @@ -137737,10 +138961,12 @@ var World = new Class({ return false; } - // A Body - if (object1.body) + // TODO - Convert to fast-path index for Collider + + // SPRITE + if (object1.body || object1.isBody) { - if (object2.body) + if (object2.body || object2.isBody) { return this.collideSpriteVsSprite(object1, object2, collideCallback, processCallback, callbackContext, overlapOnly); } @@ -137757,7 +138983,7 @@ var World = new Class({ // GROUPS else if (object1.isParent) { - if (object2.body) + if (object2.body || object2.isBody) { return this.collideSpriteVsGroup(object2, object1, collideCallback, processCallback, callbackContext, overlapOnly); } @@ -137774,7 +139000,7 @@ var World = new Class({ // TILEMAP LAYERS else if (object1.isTilemap) { - if (object2.body) + if (object2.body || object2.isBody) { return this.collideSpriteVsTilemapLayer(object2, object1, collideCallback, processCallback, callbackContext, overlapOnly); } @@ -137795,8 +139021,8 @@ var World = new Class({ * * @param {Phaser.GameObjects.GameObject} sprite1 - The first object to check for collision. * @param {Phaser.GameObjects.GameObject} sprite2 - The second object to check for collision. - * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} [callbackContext] - The context in which to run the callbacks. * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * @@ -137804,12 +139030,15 @@ var World = new Class({ */ collideSpriteVsSprite: function (sprite1, sprite2, collideCallback, processCallback, callbackContext, overlapOnly) { - if (!sprite1.body || !sprite2.body) + var body1 = (sprite1.isBody) ? sprite1 : sprite1.body; + var body2 = (sprite2.isBody) ? sprite2 : sprite2.body; + + if (!body1 || !body2) { return false; } - if (this.separate(sprite1.body, sprite2.body, processCallback, callbackContext, overlapOnly)) + if (this.separate(body1, body2, processCallback, callbackContext, overlapOnly)) { if (collideCallback) { @@ -137832,8 +139061,8 @@ var World = new Class({ * * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision. * @param {Phaser.GameObjects.Group} group - The second object to check for collision. - * @param {ArcadePhysicsCallback} collideCallback - The callback to invoke when the two objects collide. - * @param {ArcadePhysicsCallback} processCallback - The callback to invoke when the two objects collide. Must return a boolean. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} collideCallback - The callback to invoke when the two objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} processCallback - The callback to invoke when the two objects collide. Must return a boolean. * @param {any} callbackContext - The scope in which to call the callbacks. * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * @@ -137841,7 +139070,7 @@ var World = new Class({ */ collideSpriteVsGroup: function (sprite, group, collideCallback, processCallback, callbackContext, overlapOnly) { - var bodyA = sprite.body; + var bodyA = (sprite.isBody) ? sprite : sprite.body; if (group.length === 0 || !bodyA || !bodyA.enable || bodyA.checkCollision.none) { @@ -137877,7 +139106,7 @@ var World = new Class({ continue; } - if (this.separate(bodyA, bodyB, processCallback, callbackContext, overlapOnly, true)) + if (this.separate(bodyA, bodyB, processCallback, callbackContext, overlapOnly)) { if (collideCallback) { @@ -137927,8 +139156,8 @@ var World = new Class({ * * @param {Phaser.GameObjects.Group} group - The first object to check for collision. * @param {Phaser.Tilemaps.TilemapLayer} tilemapLayer - The second object to check for collision. - * @param {ArcadePhysicsCallback} collideCallback - An optional callback function that is called if the objects collide. - * @param {ArcadePhysicsCallback} processCallback - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} collideCallback - An optional callback function that is called if the objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} processCallback - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} callbackContext - The context in which to run the callbacks. * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * @@ -137947,7 +139176,7 @@ var World = new Class({ for (var i = 0; i < children.length; i++) { - if (children[i].body) + if (children[i].body || children[i].isBody) { if (this.collideSpriteVsTilemapLayer(children[i], tilemapLayer, collideCallback, processCallback, callbackContext, overlapOnly)) { @@ -137981,15 +139210,15 @@ var World = new Class({ * * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision. * @param {Phaser.Tilemaps.Tile[]} tiles - An array of Tiles to check for collision against. - * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} [callbackContext] - The context in which to run the callbacks. * * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated. */ collideTiles: function (sprite, tiles, collideCallback, processCallback, callbackContext) { - if (!sprite.body.enable || tiles.length === 0) + if (tiles.length === 0 || (sprite.body && !sprite.body.enable) || (sprite.isBody && !sprite.enable)) { return false; } @@ -138016,15 +139245,15 @@ var World = new Class({ * * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision. * @param {Phaser.Tilemaps.Tile[]} tiles - An array of Tiles to check for collision against. - * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects overlap. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects overlap. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} [callbackContext] - The context in which to run the callbacks. * * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated. */ overlapTiles: function (sprite, tiles, collideCallback, processCallback, callbackContext) { - if (!sprite.body.enable || tiles.length === 0) + if (tiles.length === 0 || (sprite.body && !sprite.body.enable) || (sprite.isBody && !sprite.enable)) { return false; } @@ -138045,8 +139274,8 @@ var World = new Class({ * * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision. * @param {Phaser.Tilemaps.TilemapLayer} tilemapLayer - The second object to check for collision. - * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} [callbackContext] - The context in which to run the callbacks. * @param {boolean} [overlapOnly] - Whether this is a collision or overlap check. * @@ -138054,7 +139283,7 @@ var World = new Class({ */ collideSpriteVsTilemapLayer: function (sprite, tilemapLayer, collideCallback, processCallback, callbackContext, overlapOnly) { - var body = sprite.body; + var body = (sprite.isBody) ? sprite : sprite.body; if (!body.enable || body.checkCollision.none) { @@ -138083,7 +139312,9 @@ var World = new Class({ h += yDiff; } - var mapData = GetTilesWithinWorldXY(x, y, w, h, null, tilemapLayer.scene.cameras.main, tilemapLayer.layer); + var options = (overlapOnly) ? null : this.tileFilterOptions; + + var mapData = GetTilesWithinWorldXY(x, y, w, h, options, tilemapLayer.scene.cameras.main, tilemapLayer.layer); if (mapData.length === 0) { @@ -138107,8 +139338,8 @@ var World = new Class({ * * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision. * @param {Phaser.Tilemaps.TilemapLayer} tilemapLayer - The second object to check for collision. - * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} [callbackContext] - The context in which to run the callbacks. * @param {boolean} [overlapOnly] - Whether this is a collision or overlap check. * @param {boolean} [isLayer] - Is this check coming from a TilemapLayer or an array of tiles? @@ -138117,7 +139348,7 @@ var World = new Class({ */ collideSpriteVsTilesHandler: function (sprite, tiles, collideCallback, processCallback, callbackContext, overlapOnly, isLayer) { - var body = sprite.body; + var body = (sprite.isBody) ? sprite : sprite.body; var tile; var tileWorldRect = { left: 0, right: 0, top: 0, bottom: 0 }; @@ -138183,8 +139414,8 @@ var World = new Class({ * * @param {Phaser.GameObjects.Group} group1 - The first object to check for collision. * @param {Phaser.GameObjects.Group} group2 - The second object to check for collision. - * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} [callbackContext] - The context in which to run the callbacks. * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * @@ -138298,6 +139529,12 @@ var World = new Class({ this.shutdown(); this.scene = null; + + if (this.debugGraphic) + { + this.debugGraphic.destroy(); + this.debugGraphic = null; + } } }); @@ -138312,7 +139549,7 @@ module.exports = World; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -138388,7 +139625,7 @@ module.exports = Acceleration; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -138402,7 +139639,7 @@ var Angular = { /** * Sets the angular velocity of the body. - * + * * In Arcade Physics, bodies cannot rotate. They are always axis-aligned. * However, they can have angular motion, which is passed on to the Game Object bound to the body, * causing them to visually rotate, even though the body remains axis-aligned. @@ -138423,7 +139660,7 @@ var Angular = { /** * Sets the angular acceleration of the body. - * + * * In Arcade Physics, bodies cannot rotate. They are always axis-aligned. * However, they can have angular motion, which is passed on to the Game Object bound to the body, * causing them to visually rotate, even though the body remains axis-aligned. @@ -138471,7 +139708,7 @@ module.exports = Angular; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -138485,7 +139722,7 @@ var Bounce = { /** * Sets the bounce values of this body. - * + * * Bounce is the amount of restitution, or elasticity, the body has when it collides with another object. * A value of 1 means that it will retain its full velocity after the rebound. A value of 0 means it will not rebound at all. * @@ -138540,7 +139777,7 @@ var Bounce = { /** * Sets whether this Body collides with the world boundary. - * + * * Optionally also sets the World Bounce values. If the `Body.worldBounce` is null, it's set to a new Phaser.Math.Vector2 first. * * @method Phaser.Physics.Arcade.Components.Bounce#setCollideWorldBounds @@ -138549,12 +139786,13 @@ var Bounce = { * @param {boolean} [value=true] - `true` if this body should collide with the world bounds, otherwise `false`. * @param {number} [bounceX] - If given this will be replace the `worldBounce.x` value. * @param {number} [bounceY] - If given this will be replace the `worldBounce.y` value. + * @param {boolean} [onWorldBounds] - If given this replaces the Body's `onWorldBounds` value. * * @return {this} This Game Object. */ - setCollideWorldBounds: function (value, bounceX, bounceY) + setCollideWorldBounds: function (value, bounceX, bounceY, onWorldBounds) { - this.body.setCollideWorldBounds(value, bounceX, bounceY); + this.body.setCollideWorldBounds(value, bounceX, bounceY, onWorldBounds); return this; } @@ -138571,7 +139809,7 @@ module.exports = Bounce; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -138585,7 +139823,7 @@ var Debug = { /** * Sets the debug values of this body. - * + * * Bodies will only draw their debug if debug has been enabled for Arcade Physics as a whole. * Note that there is a performance cost in drawing debug displays. It should never be used in production. * @@ -138699,7 +139937,7 @@ module.exports = Debug; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -138833,7 +140071,7 @@ module.exports = Drag; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -138958,7 +140196,7 @@ module.exports = Enable; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -139047,7 +140285,7 @@ module.exports = Friction; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -139062,7 +140300,7 @@ var Gravity = { /** * Set the X and Y values of the gravitational pull to act upon this Arcade Physics Game Object. Values can be positive or negative. Larger values result in a stronger effect. - * + * * If only one value is provided, this value will be used for both the X and Y axis. * * @method Phaser.Physics.Arcade.Components.Gravity#setGravity @@ -139126,7 +140364,7 @@ module.exports = Gravity; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -139173,7 +140411,7 @@ module.exports = Immovable; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -139369,7 +140607,7 @@ module.exports = OverlapRect; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -139418,7 +140656,7 @@ module.exports = Pushable; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -139522,7 +140760,7 @@ module.exports = Size; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -139622,7 +140860,7 @@ module.exports = Velocity; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -139658,7 +140896,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -139788,25 +141026,25 @@ module.exports = CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Arcade Physics World Collide Event. - * + * * This event is dispatched by an Arcade Physics World instance if two bodies collide _and_ at least * one of them has their [onCollide]{@link Phaser.Physics.Arcade.Body#onCollide} property set to `true`. - * + * * It provides an alternative means to handling collide events rather than using the callback approach. - * + * * Listen to it from a Scene using: `this.physics.world.on('collide', listener)`. - * + * * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. * * @event Phaser.Physics.Arcade.Events#COLLIDE * @since 3.0.0 - * + * * @param {Phaser.GameObjects.GameObject} gameObject1 - The first Game Object involved in the collision. This is the parent of `body1`. * @param {Phaser.GameObjects.GameObject} gameObject2 - The second Game Object involved in the collision. This is the parent of `body2`. * @param {Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody} body1 - The first Physics Body involved in the collision. @@ -139822,25 +141060,25 @@ module.exports = 'collide'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Arcade Physics World Overlap Event. - * + * * This event is dispatched by an Arcade Physics World instance if two bodies overlap _and_ at least * one of them has their [onOverlap]{@link Phaser.Physics.Arcade.Body#onOverlap} property set to `true`. - * + * * It provides an alternative means to handling overlap events rather than using the callback approach. - * + * * Listen to it from a Scene using: `this.physics.world.on('overlap', listener)`. - * + * * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. * * @event Phaser.Physics.Arcade.Events#OVERLAP * @since 3.0.0 - * + * * @param {Phaser.GameObjects.GameObject} gameObject1 - The first Game Object involved in the overlap. This is the parent of `body1`. * @param {Phaser.GameObjects.GameObject} gameObject2 - The second Game Object involved in the overlap. This is the parent of `body2`. * @param {Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody} body1 - The first Physics Body involved in the overlap. @@ -139856,15 +141094,15 @@ module.exports = 'overlap'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Arcade Physics World Pause Event. - * + * * This event is dispatched by an Arcade Physics World instance when it is paused. - * + * * Listen to it from a Scene using: `this.physics.world.on('pause', listener)`. * * @event Phaser.Physics.Arcade.Events#PAUSE @@ -139880,15 +141118,15 @@ module.exports = 'pause'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Arcade Physics World Resume Event. - * + * * This event is dispatched by an Arcade Physics World instance when it resumes from a paused state. - * + * * Listen to it from a Scene using: `this.physics.world.on('resume', listener)`. * * @event Phaser.Physics.Arcade.Events#RESUME @@ -139904,25 +141142,25 @@ module.exports = 'resume'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Arcade Physics Tile Collide Event. - * + * * This event is dispatched by an Arcade Physics World instance if a body collides with a Tile _and_ * has its [onCollide]{@link Phaser.Physics.Arcade.Body#onCollide} property set to `true`. - * + * * It provides an alternative means to handling collide events rather than using the callback approach. - * + * * Listen to it from a Scene using: `this.physics.world.on('tilecollide', listener)`. - * + * * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. * * @event Phaser.Physics.Arcade.Events#TILE_COLLIDE * @since 3.16.1 - * + * * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object involved in the collision. This is the parent of `body`. * @param {Phaser.Tilemaps.Tile} tile - The tile the body collided with. * @param {Phaser.Physics.Arcade.Body} body - The Arcade Physics Body of the Game Object involved in the collision. @@ -139937,25 +141175,25 @@ module.exports = 'tilecollide'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Arcade Physics Tile Overlap Event. - * + * * This event is dispatched by an Arcade Physics World instance if a body overlaps with a Tile _and_ * has its [onOverlap]{@link Phaser.Physics.Arcade.Body#onOverlap} property set to `true`. - * + * * It provides an alternative means to handling overlap events rather than using the callback approach. - * + * * Listen to it from a Scene using: `this.physics.world.on('tileoverlap', listener)`. - * + * * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. * * @event Phaser.Physics.Arcade.Events#TILE_OVERLAP * @since 3.16.1 - * + * * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object involved in the overlap. This is the parent of `body`. * @param {Phaser.Tilemaps.Tile} tile - The tile the body overlapped. * @param {Phaser.Physics.Arcade.Body} body - The Arcade Physics Body of the Game Object involved in the overlap. @@ -139970,23 +141208,23 @@ module.exports = 'tileoverlap'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Arcade Physics World Bounds Event. - * + * * This event is dispatched by an Arcade Physics World instance if a body makes contact with the world bounds _and_ * it has its [onWorldBounds]{@link Phaser.Physics.Arcade.Body#onWorldBounds} property set to `true`. - * + * * It provides an alternative means to handling collide events rather than using the callback approach. - * + * * Listen to it from a Scene using: `this.physics.world.on('worldbounds', listener)`. * * @event Phaser.Physics.Arcade.Events#WORLD_BOUNDS * @since 3.0.0 - * + * * @param {Phaser.Physics.Arcade.Body} body - The Arcade Physics Body that hit the world bounds. * @param {boolean} up - Is the Body blocked up? I.e. collided with the top of the world bounds. * @param {boolean} down - Is the Body blocked down? I.e. collided with the bottom of the world bounds. @@ -140003,7 +141241,7 @@ module.exports = 'worldbounds'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140032,7 +141270,7 @@ module.exports = 'worldstep'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140061,7 +141299,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140107,7 +141345,7 @@ module.exports = Arcade; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140149,7 +141387,7 @@ module.exports = ProcessTileCallbacks; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140198,7 +141436,7 @@ module.exports = ProcessTileSeparationX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140247,7 +141485,7 @@ module.exports = ProcessTileSeparationY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140368,7 +141606,7 @@ module.exports = SeparateTile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140459,7 +141697,7 @@ module.exports = TileCheckX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140550,7 +141788,7 @@ module.exports = TileCheckY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140587,7 +141825,7 @@ module.exports = TileIntersectsBody; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140617,7 +141855,7 @@ module.exports = Tilemap; /** * @author Richard Davey -* @copyright 2020 Photon Storm Ltd. +* @copyright 2022 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} */ @@ -140748,13 +141986,13 @@ module.exports = BasePlugin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Default Plugins. - * + * * @namespace Phaser.Plugins.DefaultPlugins * @memberof Phaser.Plugins * @since 3.0.0 @@ -140851,7 +142089,7 @@ module.exports = DefaultPlugins; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140877,7 +142115,7 @@ var PluginCache = {}; * * @method Phaser.Plugins.PluginCache.register * @since 3.8.0 - * + * * @param {string} key - A reference used to get this plugin from the plugin cache. * @param {function} plugin - The plugin to be stored. Should be the core object, not instantiated. * @param {string} mapping - If this plugin is to be injected into the Scene Systems, this is the property key map used. @@ -140896,7 +142134,7 @@ PluginCache.register = function (key, plugin, mapping, custom) * * @method Phaser.Plugins.PluginCache.registerCustom * @since 3.8.0 - * + * * @param {string} key - A reference used to get this plugin from the plugin cache. * @param {function} plugin - The plugin to be stored. Should be the core object, not instantiated. * @param {string} mapping - If this plugin is to be injected into the Scene Systems, this is the property key map used. @@ -140912,7 +142150,7 @@ PluginCache.registerCustom = function (key, plugin, mapping, data) * * @method Phaser.Plugins.PluginCache.hasCore * @since 3.8.0 - * + * * @param {string} key - The key to check for. * * @return {boolean} `true` if the key is already in use in the core cache, otherwise `false`. @@ -140927,7 +142165,7 @@ PluginCache.hasCore = function (key) * * @method Phaser.Plugins.PluginCache.hasCustom * @since 3.8.0 - * + * * @param {string} key - The key to check for. * * @return {boolean} `true` if the key is already in use in the custom cache, otherwise `false`. @@ -140942,7 +142180,7 @@ PluginCache.hasCustom = function (key) * * @method Phaser.Plugins.PluginCache.getCore * @since 3.8.0 - * + * * @param {string} key - The key of the core plugin to get. * * @return {Phaser.Types.Plugins.CorePluginContainer} The core plugin object. @@ -140957,7 +142195,7 @@ PluginCache.getCore = function (key) * * @method Phaser.Plugins.PluginCache.getCustom * @since 3.8.0 - * + * * @param {string} key - The key of the custom plugin to get. * * @return {Phaser.Types.Plugins.CustomPluginContainer} The custom plugin object. @@ -140972,7 +142210,7 @@ PluginCache.getCustom = function (key) * * @method Phaser.Plugins.PluginCache.getCustomClass * @since 3.8.0 - * + * * @param {string} key - The key of the custom plugin to get. * * @return {function} The custom plugin object. @@ -140987,7 +142225,7 @@ PluginCache.getCustomClass = function (key) * * @method Phaser.Plugins.PluginCache.remove * @since 3.8.0 - * + * * @param {string} key - The key of the core plugin to remove. */ PluginCache.remove = function (key) @@ -141003,7 +142241,7 @@ PluginCache.remove = function (key) * * @method Phaser.Plugins.PluginCache.removeCustom * @since 3.8.0 - * + * * @param {string} key - The key of the custom plugin to remove. */ PluginCache.removeCustom = function (key) @@ -141016,7 +142254,7 @@ PluginCache.removeCustom = function (key) /** * Removes all Core Plugins. - * + * * This includes all of the internal system plugins that Phaser needs, like the Input Plugin and Loader Plugin. * So be sure you only call this if you do not wish to run Phaser again. * @@ -141061,7 +142299,7 @@ module.exports = PluginCache; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -141969,7 +143207,7 @@ module.exports = PluginManager; /** * @author Richard Davey -* @copyright 2020 Photon Storm Ltd. +* @copyright 2022 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} */ @@ -142112,7 +143350,7 @@ module.exports = ScenePlugin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -142138,13 +143376,13 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Phaser Blend Modes. - * + * * @namespace Phaser.BlendModes * @since 3.0.0 */ @@ -142153,7 +143391,7 @@ module.exports = { /** * Skips the Blend Mode check in the renderer. - * + * * @name Phaser.BlendModes.SKIP_CHECK * @type {number} * @const @@ -142164,7 +143402,7 @@ module.exports = { /** * Normal blend mode. For Canvas and WebGL. * This is the default setting and draws new shapes on top of the existing canvas content. - * + * * @name Phaser.BlendModes.NORMAL * @type {number} * @const @@ -142175,7 +143413,7 @@ module.exports = { /** * Add blend mode. For Canvas and WebGL. * Where both shapes overlap the color is determined by adding color values. - * + * * @name Phaser.BlendModes.ADD * @type {number} * @const @@ -142186,7 +143424,7 @@ module.exports = { /** * Multiply blend mode. For Canvas and WebGL. * The pixels are of the top layer are multiplied with the corresponding pixel of the bottom layer. A darker picture is the result. - * + * * @name Phaser.BlendModes.MULTIPLY * @type {number} * @const @@ -142197,7 +143435,7 @@ module.exports = { /** * Screen blend mode. For Canvas and WebGL. * The pixels are inverted, multiplied, and inverted again. A lighter picture is the result (opposite of multiply) - * + * * @name Phaser.BlendModes.SCREEN * @type {number} * @const @@ -142208,7 +143446,7 @@ module.exports = { /** * Overlay blend mode. For Canvas only. * A combination of multiply and screen. Dark parts on the base layer become darker, and light parts become lighter. - * + * * @name Phaser.BlendModes.OVERLAY * @type {number} * @const @@ -142219,7 +143457,7 @@ module.exports = { /** * Darken blend mode. For Canvas only. * Retains the darkest pixels of both layers. - * + * * @name Phaser.BlendModes.DARKEN * @type {number} * @const @@ -142230,7 +143468,7 @@ module.exports = { /** * Lighten blend mode. For Canvas only. * Retains the lightest pixels of both layers. - * + * * @name Phaser.BlendModes.LIGHTEN * @type {number} * @const @@ -142241,7 +143479,7 @@ module.exports = { /** * Color Dodge blend mode. For Canvas only. * Divides the bottom layer by the inverted top layer. - * + * * @name Phaser.BlendModes.COLOR_DODGE * @type {number} * @const @@ -142252,7 +143490,7 @@ module.exports = { /** * Color Burn blend mode. For Canvas only. * Divides the inverted bottom layer by the top layer, and then inverts the result. - * + * * @name Phaser.BlendModes.COLOR_BURN * @type {number} * @const @@ -142263,7 +143501,7 @@ module.exports = { /** * Hard Light blend mode. For Canvas only. * A combination of multiply and screen like overlay, but with top and bottom layer swapped. - * + * * @name Phaser.BlendModes.HARD_LIGHT * @type {number} * @const @@ -142274,7 +143512,7 @@ module.exports = { /** * Soft Light blend mode. For Canvas only. * A softer version of hard-light. Pure black or white does not result in pure black or white. - * + * * @name Phaser.BlendModes.SOFT_LIGHT * @type {number} * @const @@ -142285,7 +143523,7 @@ module.exports = { /** * Difference blend mode. For Canvas only. * Subtracts the bottom layer from the top layer or the other way round to always get a positive value. - * + * * @name Phaser.BlendModes.DIFFERENCE * @type {number} * @const @@ -142296,7 +143534,7 @@ module.exports = { /** * Exclusion blend mode. For Canvas only. * Like difference, but with lower contrast. - * + * * @name Phaser.BlendModes.EXCLUSION * @type {number} * @const @@ -142307,7 +143545,7 @@ module.exports = { /** * Hue blend mode. For Canvas only. * Preserves the luma and chroma of the bottom layer, while adopting the hue of the top layer. - * + * * @name Phaser.BlendModes.HUE * @type {number} * @const @@ -142318,7 +143556,7 @@ module.exports = { /** * Saturation blend mode. For Canvas only. * Preserves the luma and hue of the bottom layer, while adopting the chroma of the top layer. - * + * * @name Phaser.BlendModes.SATURATION * @type {number} * @const @@ -142329,7 +143567,7 @@ module.exports = { /** * Color blend mode. For Canvas only. * Preserves the luma of the bottom layer, while adopting the hue and chroma of the top layer. - * + * * @name Phaser.BlendModes.COLOR * @type {number} * @const @@ -142340,7 +143578,7 @@ module.exports = { /** * Luminosity blend mode. For Canvas only. * Preserves the hue and chroma of the bottom layer, while adopting the luma of the top layer. - * + * * @name Phaser.BlendModes.LUMINOSITY * @type {number} * @const @@ -142350,7 +143588,7 @@ module.exports = { /** * Alpha erase blend mode. For Canvas and WebGL. - * + * * @name Phaser.BlendModes.ERASE * @type {number} * @const @@ -142361,7 +143599,7 @@ module.exports = { /** * Source-in blend mode. For Canvas only. * The new shape is drawn only where both the new shape and the destination canvas overlap. Everything else is made transparent. - * + * * @name Phaser.BlendModes.SOURCE_IN * @type {number} * @const @@ -142372,7 +143610,7 @@ module.exports = { /** * Source-out blend mode. For Canvas only. * The new shape is drawn where it doesn't overlap the existing canvas content. - * + * * @name Phaser.BlendModes.SOURCE_OUT * @type {number} * @const @@ -142383,7 +143621,7 @@ module.exports = { /** * Source-out blend mode. For Canvas only. * The new shape is only drawn where it overlaps the existing canvas content. - * + * * @name Phaser.BlendModes.SOURCE_ATOP * @type {number} * @const @@ -142394,7 +143632,7 @@ module.exports = { /** * Destination-over blend mode. For Canvas only. * New shapes are drawn behind the existing canvas content. - * + * * @name Phaser.BlendModes.DESTINATION_OVER * @type {number} * @const @@ -142405,7 +143643,7 @@ module.exports = { /** * Destination-in blend mode. For Canvas only. * The existing canvas content is kept where both the new shape and existing canvas content overlap. Everything else is made transparent. - * + * * @name Phaser.BlendModes.DESTINATION_IN * @type {number} * @const @@ -142416,7 +143654,7 @@ module.exports = { /** * Destination-out blend mode. For Canvas only. * The existing content is kept where it doesn't overlap the new shape. - * + * * @name Phaser.BlendModes.DESTINATION_OUT * @type {number} * @const @@ -142427,7 +143665,7 @@ module.exports = { /** * Destination-out blend mode. For Canvas only. * The existing canvas is only kept where it overlaps the new shape. The new shape is drawn behind the canvas content. - * + * * @name Phaser.BlendModes.DESTINATION_ATOP * @type {number} * @const @@ -142438,7 +143676,7 @@ module.exports = { /** * Lighten blend mode. For Canvas only. * Where both shapes overlap the color is determined by adding color values. - * + * * @name Phaser.BlendModes.LIGHTER * @type {number} * @const @@ -142449,7 +143687,7 @@ module.exports = { /** * Copy blend mode. For Canvas only. * Only the new shape is shown. - * + * * @name Phaser.BlendModes.COPY * @type {number} * @const @@ -142460,7 +143698,7 @@ module.exports = { /** * Xor blend mode. For Canvas only. * Shapes are made transparent where both overlap and drawn normal everywhere else. - * + * * @name Phaser.BlendModes.XOR * @type {number} * @const @@ -142478,13 +143716,13 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Phaser Scale Modes. - * + * * @namespace Phaser.ScaleModes * @since 3.0.0 */ @@ -142493,7 +143731,7 @@ var ScaleModes = { /** * Default Scale Mode (Linear). - * + * * @name Phaser.ScaleModes.DEFAULT * @type {number} * @readonly @@ -142503,7 +143741,7 @@ var ScaleModes = { /** * Linear Scale Mode. - * + * * @name Phaser.ScaleModes.LINEAR * @type {number} * @readonly @@ -142513,7 +143751,7 @@ var ScaleModes = { /** * Nearest Scale Mode. - * + * * @name Phaser.ScaleModes.NEAREST * @type {number} * @readonly @@ -142534,7 +143772,7 @@ module.exports = ScaleModes; /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -142647,7 +143885,8 @@ var CanvasRenderer = new Class({ var contextOptions = { alpha: game.config.transparent, - desynchronized: game.config.desynchronized + desynchronized: game.config.desynchronized, + willReadFrequently: false }; /** @@ -143344,14 +144583,17 @@ var CanvasRenderer = new Class({ ctx.globalAlpha = alpha; - ctx.imageSmoothingEnabled = !(!this.antialias || frame.source.scaleMode); + ctx.imageSmoothingEnabled = !frame.source.scaleMode; if (sprite.mask) { sprite.mask.preRenderCanvas(this, sprite, camera); } - ctx.drawImage(frame.source.image, frameX, frameY, frameWidth, frameHeight, x, y, frameWidth / res, frameHeight / res); + if (frameWidth > 0 && frameHeight > 0) + { + ctx.drawImage(frame.source.image, frameX, frameY, frameWidth, frameHeight, x, y, frameWidth / res, frameHeight / res); + } if (sprite.mask) { @@ -143388,7 +144630,7 @@ module.exports = CanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -143412,7 +144654,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -143477,7 +144719,7 @@ module.exports = GetBlendModes; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -143493,7 +144735,8 @@ var GetCalcMatrix = __webpack_require__(73329); * 4. Sets the alpha value of the context to be that used by the Game Object combined with the Camera. * 5. Saves the context state. * 6. Sets the final matrix values into the context via setTransform. - * 7. If Renderer.antialias, or the frame.source.scaleMode is set, then imageSmoothingEnabled is set. + * 7. If the Game Object has a texture frame, imageSmoothingEnabled is set based on frame.source.scaleMode. + * 8. If the Game Object does not have a texture frame, imageSmoothingEnabled is set based on Renderer.antialias. * * This function is only meant to be used internally. Most of the Canvas Renderer classes use it. * @@ -143530,7 +144773,7 @@ var SetTransform = function (renderer, ctx, src, camera, parentMatrix) calcMatrix.setToContext(ctx); - ctx.imageSmoothingEnabled = !(!renderer.antialias || (src.frame && src.frame.source.scaleMode)); + ctx.imageSmoothingEnabled = src.frame ? !src.frame.source.scaleMode : renderer.antialias; return true; }; @@ -143545,7 +144788,7 @@ module.exports = SetTransform; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -143568,7 +144811,7 @@ module.exports = 'postrender'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -143592,7 +144835,7 @@ module.exports = 'prerender'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -143619,7 +144862,7 @@ module.exports = 'render'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -143645,7 +144888,7 @@ module.exports = 'resize'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -143670,7 +144913,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -143699,7 +144942,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -143709,7 +144952,7 @@ var GetFastValue = __webpack_require__(72632); /** * Takes a snapshot of an area from the current frame displayed by a canvas. - * + * * This is then copied to an Image object. When this loads, the results are sent * to the callback provided in the Snapshot Configuration object. * @@ -143726,8 +144969,8 @@ var CanvasSnapshot = function (canvas, config) var encoderOptions = GetFastValue(config, 'encoder', 0.92); var x = Math.abs(Math.round(GetFastValue(config, 'x', 0))); var y = Math.abs(Math.round(GetFastValue(config, 'y', 0))); - var width = GetFastValue(config, 'width', canvas.width); - var height = GetFastValue(config, 'height', canvas.height); + var width = Math.floor(GetFastValue(config, 'width', canvas.width)); + var height = Math.floor(GetFastValue(config, 'height', canvas.height)); var getPixel = GetFastValue(config, 'getPixel', false); if (getPixel) @@ -143736,7 +144979,7 @@ var CanvasSnapshot = function (canvas, config) var imageData = context.getImageData(x, y, 1, 1); var data = imageData.data; - callback.call(null, new Color(data[0], data[1], data[2], data[3] / 255)); + callback.call(null, new Color(data[0], data[1], data[2], data[3])); } else if (x !== 0 || y !== 0 || width !== canvas.width || height !== canvas.height) { @@ -143744,10 +144987,13 @@ var CanvasSnapshot = function (canvas, config) var copyCanvas = CanvasPool.createWebGL(this, width, height); var ctx = copyCanvas.getContext('2d'); - ctx.drawImage(canvas, x, y, width, height, 0, 0, width, height); + if (width > 0 && height > 0) + { + ctx.drawImage(canvas, x, y, width, height, 0, 0, width, height); + } var image1 = new Image(); - + image1.onerror = function () { callback.call(null); @@ -143768,7 +145014,7 @@ var CanvasSnapshot = function (canvas, config) { // Full Grab var image2 = new Image(); - + image2.onerror = function () { callback.call(null); @@ -143793,7 +145039,7 @@ module.exports = CanvasSnapshot; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -143810,18 +145056,18 @@ var GetFastValue = __webpack_require__(72632); * @function Phaser.Renderer.Snapshot.WebGL * @since 3.0.0 * - * @param {HTMLCanvasElement} sourceCanvas - The canvas to take a snapshot of. + * @param {WebGLRenderingContext} sourceContext - The WebGL context to take a snapshot of. * @param {Phaser.Types.Renderer.Snapshot.SnapshotState} config - The snapshot configuration object. */ -var WebGLSnapshot = function (sourceCanvas, config) +var WebGLSnapshot = function (sourceContext, config) { - var gl = sourceCanvas.getContext('experimental-webgl'); + var gl = sourceContext; var callback = GetFastValue(config, 'callback'); var type = GetFastValue(config, 'type', 'image/png'); var encoderOptions = GetFastValue(config, 'encoder', 0.92); - var x = GetFastValue(config, 'x', 0); - var y = GetFastValue(config, 'y', 0); + var x = Math.abs(Math.round(GetFastValue(config, 'x', 0))); + var y = Math.abs(Math.round(GetFastValue(config, 'y', 0))); var getPixel = GetFastValue(config, 'getPixel', false); @@ -143838,12 +145084,12 @@ var WebGLSnapshot = function (sourceCanvas, config) gl.readPixels(x, destY, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixel); - callback.call(null, new Color(pixel[0], pixel[1], pixel[2], pixel[3] / 255)); + callback.call(null, new Color(pixel[0], pixel[1], pixel[2], pixel[3])); } else { - var width = GetFastValue(config, 'width', bufferWidth); - var height = GetFastValue(config, 'height', bufferHeight); + var width = Math.floor(GetFastValue(config, 'width', bufferWidth)); + var height = Math.floor(GetFastValue(config, 'height', bufferHeight)); var total = width * height * 4; @@ -143906,7 +145152,7 @@ module.exports = WebGLSnapshot; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -143929,7 +145175,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -143942,7 +145188,6 @@ var SnapCeil = __webpack_require__(82127); // Default Phaser 3 Pipelines var BitmapMaskPipeline = __webpack_require__(5583); -var GraphicsPipeline = __webpack_require__(67589); var LightPipeline = __webpack_require__(66901); var MultiPipeline = __webpack_require__(77310); var PointLightPipeline = __webpack_require__(10919); @@ -143958,16 +145203,15 @@ var UtilityPipeline = __webpack_require__(60848); * The `WebGLRenderer` owns a single instance of the Pipeline Manager, which you can access * via the `WebGLRenderer.pipelines` property. * - * By default, there are 8 pipelines installed into the Pipeline Manager when Phaser boots: + * By default, there are 7 pipelines installed into the Pipeline Manager when Phaser boots: * * 1. The Multi Pipeline. Responsible for all multi-texture rendering, i.e. Sprites and Tilemaps. - * 2. The Graphics Pipeline. Responsible for rendering Graphics and Shape objects. - * 3. The Rope Pipeline. Responsible for rendering the Rope Game Object. - * 4. The Light Pipeline. Responsible for rendering the Light Game Object. - * 5. The Point Light Pipeline. Responsible for rendering the Point Light Game Object. - * 6. The Single Pipeline. Responsible for rendering Game Objects that explicitly require one bound texture. - * 7. The Bitmap Mask Pipeline. Responsible for Bitmap Mask rendering. - * 8. The Utility Pipeline. Responsible for providing lots of handy texture manipulation functions. + * 2. The Rope Pipeline. Responsible for rendering the Rope Game Object. + * 3. The Light Pipeline. Responsible for rendering the Light Game Object. + * 4. The Point Light Pipeline. Responsible for rendering the Point Light Game Object. + * 5. The Single Pipeline. Responsible for rendering Game Objects that explicitly require one bound texture. + * 6. The Bitmap Mask Pipeline. Responsible for Bitmap Mask rendering. + * 7. The Utility Pipeline. Responsible for providing lots of handy texture manipulation functions. * * You can add your own custom pipeline via the `PipelineManager.add` method. Pipelines are * identified by unique string-based keys. @@ -144019,8 +145263,7 @@ var PipelineManager = new Class({ [ CONST.SINGLE_PIPELINE, SinglePipeline ], [ CONST.ROPE_PIPELINE, RopePipeline ], [ CONST.LIGHT_PIPELINE, LightPipeline ], - [ CONST.POINTLIGHT_PIPELINE, PointLightPipeline ], - [ CONST.GRAPHICS_PIPELINE, GraphicsPipeline ] + [ CONST.POINTLIGHT_PIPELINE, PointLightPipeline ] ]); /** @@ -145198,7 +146441,7 @@ module.exports = PipelineManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -145571,7 +146814,7 @@ module.exports = RenderTarget; * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> * @author Matthew Groves <@doormat> - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -145695,8 +146938,9 @@ module.exports = { }, /** - * Checks the given Fragment Shader Source for `%count%` declarations and - * replaces those with GLSL code for setting `texture = texture2D(uMainSampler[i], outTexCoord)`. + * Checks the given Fragment Shader Source for `%count%` and `%getSampler%` declarations and + * replaces those with GLSL code for setting `texture = texture2D(uMainSampler[i], outTexCoord)` + * and injecting the `getSampler` glsl function. * * @function Phaser.Renderer.WebGL.Utils.parseFragmentShaderMaxTextures * @since 3.50.0 @@ -145713,6 +146957,22 @@ module.exports = { return ''; } + var src = 'vec4 getSampler (int index, vec2 uv) {'; + + for (var i = 0; i < maxTextures; i++) + { + if (i > 0 && i < maxTextures) + { + src += '\nelse '; + } + + src += 'if (index == ' + i + ') { return texture2D(uMainSampler[' + i + '], uv); }'; + } + + src += '\nreturn vec4(0);\n}'; + + fragmentShaderSource = fragmentShaderSource.replace(/%getSampler%/gi, src); + return fragmentShaderSource.replace(/%count%/gi, maxTextures.toString()); } }; @@ -145725,7 +146985,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -147333,6 +148593,33 @@ var WebGLPipeline = new Class({ return this; }, + /** + * Sets a boolean uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setBoolean + * @since 3.60.0 + * + * @param {string} name - The name of the uniform to set. + * @param {boolean} value - The new value of the `boolean` uniform. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + setBoolean: function (name, value, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.setBoolean(name, value); + + return this; + }, + /** * Sets a 1f uniform value based on the given name on the currently set shader. * @@ -147932,7 +149219,7 @@ module.exports = WebGLPipeline; /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -147998,7 +149285,8 @@ var WebGLRenderer = new Class({ stencil: true, failIfMajorPerformanceCaveat: gameConfig.failIfMajorPerformanceCaveat, powerPreference: gameConfig.powerPreference, - preserveDrawingBuffer: gameConfig.preserveDrawingBuffer + preserveDrawingBuffer: gameConfig.preserveDrawingBuffer, + willReadFrequently: false }; /** @@ -148481,7 +149769,7 @@ var WebGLRenderer = new Class({ * * You can specify this as a string in the game config, i.e.: * - * `renderer: { mipmapFilter: 'NEAREST_MIPMAP_LINEAR' }` + * `render: { mipmapFilter: 'NEAREST_MIPMAP_LINEAR' }` * * The 6 options for WebGL1 are, in order from least to most computationally expensive: * @@ -149510,6 +150798,7 @@ var WebGLRenderer = new Class({ gl.bindTexture(gl.TEXTURE_2D, texture); this.textureZero = texture; + this.isTextureClean = false; } }, @@ -150003,7 +151292,11 @@ var WebGLRenderer = new Class({ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, wrapT); gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, pma); - gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY); + + if (flipY) + { + gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true); + } var generateMipmap = false; @@ -150103,7 +151396,7 @@ var WebGLRenderer = new Class({ 36061: 'Framebuffer Unsupported' }; - throw new Error('Framebuffer status: ' + errors[complete]); + throw new Error('Framebuffer status: ' + (errors[complete] || complete)); } framebuffer.renderTexture = renderTexture; @@ -150581,7 +151874,7 @@ var WebGLRenderer = new Class({ if (state.callback) { - WebGLSnapshot(this.canvas, state); + WebGLSnapshot(this.gl, state); state.callback = null; } @@ -150741,7 +152034,7 @@ var WebGLRenderer = new Class({ this.setFramebuffer(framebuffer); - WebGLSnapshot(this.canvas, state); + WebGLSnapshot(this.gl, state); this.setFramebuffer(currentFramebuffer); @@ -150850,7 +152143,11 @@ var WebGLRenderer = new Class({ var currentTexture = gl.getParameter(gl.TEXTURE_BINDING_2D); gl.bindTexture(gl.TEXTURE_2D, dstTexture); - gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY); + if (flipY) + { + gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true); + } + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, srcCanvas); @@ -151049,7 +152346,7 @@ module.exports = WebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -151126,6 +152423,24 @@ var WebGLShader = new Class({ */ this.gl = this.renderer.gl; + /** + * The fragment shader source code. + * + * @name Phaser.Renderer.WebGL.WebGLShader#fragSrc + * @type {string} + * @since 3.60.0 + */ + this.fragSrc = fragmentShader; + + /** + * The vertex shader source code. + * + * @name Phaser.Renderer.WebGL.WebGLShader#vertSrc + * @type {string} + * @since 3.60.0 + */ + this.vertSrc = vertexShader; + /** * The WebGLProgram created from the vertex and fragment shaders. * @@ -151690,6 +153005,28 @@ var WebGLShader = new Class({ return this; }, + /** + * Sets a boolean uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#setBoolean + * @since 3.60.0 + * + * @param {string} name - The name of the uniform to set. + * @param {boolean} value - The new value of the `boolean` uniform. + * + * @return {this} This WebGLShader instance. + */ + setBoolean: function (name, value) + { + return this.setUniform1(this.gl.uniform1i, name, Number(value)); + }, + /** * Sets a 1f uniform value based on the given name on this shader. * @@ -152123,6 +153460,51 @@ var WebGLShader = new Class({ return this.setUniform2(this.gl.uniformMatrix4fv, name, transpose, matrix, true); }, + /** + * This method will create the Shader Program on the current GL context. + * + * If a program already exists, it will be destroyed and the new one will take its place. + * + * After the program is created the uniforms will be reset and + * this shader will be rebound. + * + * This is a very expensive process and if your shader is referenced elsewhere in + * your game those references may then be lost, so be sure to use this carefully. + * + * However, if you need to update say the fragment shader source, then you can pass + * the new source into this method and it'll rebuild the program using it. If you + * don't want to change the vertex shader src, pass `undefined` as the parameter. + * + * @method Phaser.Renderer.WebGL.WebGLShader#createProgram + * @since 3.60.0 + * + * @param {string} [vertSrc] - The source code of the vertex shader. If not given, uses the source already defined in this Shader. + * @param {string} [fragSrc] - The source code of the fragment shader. If not given, uses the source already defined in this Shader. + * + * @return {this} This WebGLShader instance. + */ + createProgram: function (vertSrc, fragSrc) + { + if (vertSrc === undefined) { vertSrc = this.vertSrc; } + if (fragSrc === undefined) { fragSrc = this.fragSrc; } + + var gl = this.gl; + + if (this.program) + { + gl.deleteProgram(this.program); + } + + this.vertSrc = vertSrc; + this.fragSrc = fragSrc; + + this.program = this.renderer.createProgram(vertSrc, fragSrc); + + this.createUniforms(); + + return this.rebind(); + }, + /** * Removes all external references from this class and deletes the WebGL program from the WebGL context. * @@ -152155,7 +153537,7 @@ module.exports = WebGLShader; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -152236,7 +153618,7 @@ module.exports = WEBGL_CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -152276,7 +153658,7 @@ module.exports = WebGL; /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -152467,690 +153849,6 @@ var BitmapMaskPipeline = new Class({ module.exports = BitmapMaskPipeline; -/***/ }), - -/***/ 67589: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(56694); -var Earcut = __webpack_require__(11117); -var GetFastValue = __webpack_require__(72632); -var ShaderSourceFS = __webpack_require__(37699); -var ShaderSourceVS = __webpack_require__(28739); -var TransformMatrix = __webpack_require__(69360); -var WEBGL_CONST = __webpack_require__(71402); -var WebGLPipeline = __webpack_require__(44775); - -/** - * @classdesc - * The Graphics Pipeline is the rendering pipeline used by Phaser in WebGL when drawing - * primitive geometry objects, such as the Graphics Game Object, or the Shape Game Objects - * such as Arc, Line, Rectangle and Star. It handles the preperation and batching of related vertices. - * - * Prior to Phaser v3.50 the functions of this pipeline were merged with the `TextureTintPipeline`. - * - * The fragment shader it uses can be found in `shaders/src/Graphics.frag`. - * The vertex shader it uses can be found in `shaders/src/Graphics.vert`. - * - * The default shader attributes for this pipeline are: - * - * `inPosition` (vec2) - * `inColor` (vec4, normalized) - * - * The default shader uniforms for this pipeline are: - * - * `uProjectionMatrix` (mat4) - * - * @class GraphicsPipeline - * @extends Phaser.Renderer.WebGL.WebGLPipeline - * @memberof Phaser.Renderer.WebGL.Pipelines - * @constructor - * @since 3.50.0 - * - * @param {Phaser.Types.Renderer.WebGL.WebGLPipelineConfig} config - The configuration options for this pipeline. - */ -var GraphicsPipeline = new Class({ - - Extends: WebGLPipeline, - - initialize: - - function GraphicsPipeline (config) - { - config.fragShader = GetFastValue(config, 'fragShader', ShaderSourceFS); - config.vertShader = GetFastValue(config, 'vertShader', ShaderSourceVS); - config.attributes = GetFastValue(config, 'attributes', [ - { - name: 'inPosition', - size: 2 - }, - { - name: 'inColor', - size: 4, - type: WEBGL_CONST.UNSIGNED_BYTE, - normalized: true - } - ]); - - WebGLPipeline.call(this, config); - - /** - * A temporary Transform Matrix, re-used internally during batching by the - * Shape Game Objects. - * - * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#calcMatrix - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.50.0 - */ - this.calcMatrix = new TransformMatrix(); - - /** - * Used internally to draw stroked triangles. - * - * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#tempTriangle - * @type {array} - * @private - * @since 3.50.0 - */ - this.tempTriangle = [ - { x: 0, y: 0, width: 0 }, - { x: 0, y: 0, width: 0 }, - { x: 0, y: 0, width: 0 }, - { x: 0, y: 0, width: 0 } - ]; - - /** - * Cached stroke tint. - * - * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#strokeTint - * @type {object} - * @private - * @since 3.50.0 - */ - this.strokeTint = { TL: 0, TR: 0, BL: 0, BR: 0 }; - - /** - * Cached fill tint. - * - * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#fillTint - * @type {object} - * @private - * @since 3.50.0 - */ - this.fillTint = { TL: 0, TR: 0, BL: 0, BR: 0 }; - - /** - * Internal texture frame reference. - * - * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#currentFrame - * @type {Phaser.Textures.Frame} - * @private - * @since 3.50.0 - */ - this.currentFrame = { u0: 0, v0: 0, u1: 1, v1: 1 }; - - /** - * Internal path quad cache. - * - * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#firstQuad - * @type {number[]} - * @private - * @since 3.50.0 - */ - this.firstQuad = [ 0, 0, 0, 0, 0 ]; - - /** - * Internal path quad cache. - * - * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#prevQuad - * @type {number[]} - * @private - * @since 3.50.0 - */ - this.prevQuad = [ 0, 0, 0, 0, 0 ]; - - /** - * Used internally for triangulating a polygon. - * - * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#polygonCache - * @type {array} - * @private - * @since 3.50.0 - */ - this.polygonCache = []; - }, - - /** - * Pushes a filled rectangle into the vertex batch. - * - * Rectangle factors in the given transform matrices before adding to the batch. - * - * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchFillRect - * @since 3.50.0 - * - * @param {number} x - Horizontal top left coordinate of the rectangle. - * @param {number} y - Vertical top left coordinate of the rectangle. - * @param {number} width - Width of the rectangle. - * @param {number} height - Height of the rectangle. - * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. - */ - batchFillRect: function (x, y, width, height, currentMatrix, parentMatrix) - { - this.renderer.pipelines.set(this); - - var calcMatrix = this.calcMatrix; - - // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix - if (parentMatrix) - { - parentMatrix.multiply(currentMatrix, calcMatrix); - } - - var xw = x + width; - var yh = y + height; - - var x0 = calcMatrix.getX(x, y); - var y0 = calcMatrix.getY(x, y); - - var x1 = calcMatrix.getX(x, yh); - var y1 = calcMatrix.getY(x, yh); - - var x2 = calcMatrix.getX(xw, yh); - var y2 = calcMatrix.getY(xw, yh); - - var x3 = calcMatrix.getX(xw, y); - var y3 = calcMatrix.getY(xw, y); - - var tint = this.fillTint; - - this.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, tint.TL, tint.TR, tint.BL, tint.BR); - }, - - /** - * Pushes a filled triangle into the vertex batch. - * - * Triangle factors in the given transform matrices before adding to the batch. - * - * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchFillTriangle - * @since 3.50.0 - * - * @param {number} x0 - Point 0 x coordinate. - * @param {number} y0 - Point 0 y coordinate. - * @param {number} x1 - Point 1 x coordinate. - * @param {number} y1 - Point 1 y coordinate. - * @param {number} x2 - Point 2 x coordinate. - * @param {number} y2 - Point 2 y coordinate. - * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. - */ - batchFillTriangle: function (x0, y0, x1, y1, x2, y2, currentMatrix, parentMatrix) - { - this.renderer.pipelines.set(this); - - var calcMatrix = this.calcMatrix; - - // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix - if (parentMatrix) - { - parentMatrix.multiply(currentMatrix, calcMatrix); - } - - var tx0 = calcMatrix.getX(x0, y0); - var ty0 = calcMatrix.getY(x0, y0); - - var tx1 = calcMatrix.getX(x1, y1); - var ty1 = calcMatrix.getY(x1, y1); - - var tx2 = calcMatrix.getX(x2, y2); - var ty2 = calcMatrix.getY(x2, y2); - - var tint = this.fillTint; - - this.batchTri(tx0, ty0, tx1, ty1, tx2, ty2, tint.TL, tint.TR, tint.BL); - }, - - /** - * Pushes a stroked triangle into the vertex batch. - * - * Triangle factors in the given transform matrices before adding to the batch. - * - * The triangle is created from 3 lines and drawn using the `batchStrokePath` method. - * - * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchStrokeTriangle - * @since 3.50.0 - * - * @param {number} x0 - Point 0 x coordinate. - * @param {number} y0 - Point 0 y coordinate. - * @param {number} x1 - Point 1 x coordinate. - * @param {number} y1 - Point 1 y coordinate. - * @param {number} x2 - Point 2 x coordinate. - * @param {number} y2 - Point 2 y coordinate. - * @param {number} lineWidth - The width of the line in pixels. - * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. - */ - batchStrokeTriangle: function (x0, y0, x1, y1, x2, y2, lineWidth, currentMatrix, parentMatrix) - { - var tempTriangle = this.tempTriangle; - - tempTriangle[0].x = x0; - tempTriangle[0].y = y0; - tempTriangle[0].width = lineWidth; - - tempTriangle[1].x = x1; - tempTriangle[1].y = y1; - tempTriangle[1].width = lineWidth; - - tempTriangle[2].x = x2; - tempTriangle[2].y = y2; - tempTriangle[2].width = lineWidth; - - tempTriangle[3].x = x0; - tempTriangle[3].y = y0; - tempTriangle[3].width = lineWidth; - - this.batchStrokePath(tempTriangle, lineWidth, false, currentMatrix, parentMatrix); - }, - - /** - * Adds the given path to the vertex batch for rendering. - * - * It works by taking the array of path data and then passing it through Earcut, which - * creates a list of polygons. Each polygon is then added to the batch. - * - * The path is always automatically closed because it's filled. - * - * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchFillPath - * @since 3.50.0 - * - * @param {Phaser.Types.Math.Vector2Like[]} path - Collection of points that represent the path. - * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. - */ - batchFillPath: function (path, currentMatrix, parentMatrix) - { - this.renderer.pipelines.set(this); - - var calcMatrix = this.calcMatrix; - - // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix - if (parentMatrix) - { - parentMatrix.multiply(currentMatrix, calcMatrix); - } - - var length = path.length; - var polygonCache = this.polygonCache; - var polygonIndexArray; - var point; - - var tintTL = this.fillTint.TL; - var tintTR = this.fillTint.TR; - var tintBL = this.fillTint.BL; - - for (var pathIndex = 0; pathIndex < length; ++pathIndex) - { - point = path[pathIndex]; - polygonCache.push(point.x, point.y); - } - - polygonIndexArray = Earcut(polygonCache); - length = polygonIndexArray.length; - - for (var index = 0; index < length; index += 3) - { - var p0 = polygonIndexArray[index + 0] * 2; - var p1 = polygonIndexArray[index + 1] * 2; - var p2 = polygonIndexArray[index + 2] * 2; - - var x0 = polygonCache[p0 + 0]; - var y0 = polygonCache[p0 + 1]; - var x1 = polygonCache[p1 + 0]; - var y1 = polygonCache[p1 + 1]; - var x2 = polygonCache[p2 + 0]; - var y2 = polygonCache[p2 + 1]; - - var tx0 = calcMatrix.getX(x0, y0); - var ty0 = calcMatrix.getY(x0, y0); - - var tx1 = calcMatrix.getX(x1, y1); - var ty1 = calcMatrix.getY(x1, y1); - - var tx2 = calcMatrix.getX(x2, y2); - var ty2 = calcMatrix.getY(x2, y2); - - this.batchTri(tx0, ty0, tx1, ty1, tx2, ty2, tintTL, tintTR, tintBL); - } - - polygonCache.length = 0; - }, - - /** - * Adds the given path to the vertex batch for rendering. - * - * It works by taking the array of path data and calling `batchLine` for each section - * of the path. - * - * The path is optionally closed at the end. - * - * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchStrokePath - * @since 3.50.0 - * - * @param {Phaser.Types.Math.Vector2Like[]} path - Collection of points that represent the path. - * @param {number} lineWidth - The width of the line segments in pixels. - * @param {boolean} pathOpen - Indicates if the path should be closed or left open. - * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. - */ - batchStrokePath: function (path, lineWidth, pathOpen, currentMatrix, parentMatrix) - { - this.renderer.pipelines.set(this); - - // Reset the closePath booleans - this.prevQuad[4] = 0; - this.firstQuad[4] = 0; - - var pathLength = path.length - 1; - - for (var pathIndex = 0; pathIndex < pathLength; pathIndex++) - { - var point0 = path[pathIndex]; - var point1 = path[pathIndex + 1]; - - this.batchLine( - point0.x, - point0.y, - point1.x, - point1.y, - point0.width / 2, - point1.width / 2, - lineWidth, - pathIndex, - !pathOpen && (pathIndex === pathLength - 1), - currentMatrix, - parentMatrix - ); - } - }, - - /** - * Creates a line out of 4 quads and adds it to the vertex batch based on the given line values. - * - * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchLine - * @since 3.50.0 - * - * @param {number} ax - x coordinate of the start of the line. - * @param {number} ay - y coordinate of the start of the line. - * @param {number} bx - x coordinate of the end of the line. - * @param {number} by - y coordinate of the end of the line. - * @param {number} aLineWidth - Width of the start of the line. - * @param {number} bLineWidth - Width of the end of the line. - * @param {number} index - If this line is part of a multi-line draw, the index of the line in the draw. - * @param {boolean} closePath - Does this line close a multi-line path? - * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. - */ - batchLine: function (ax, ay, bx, by, aLineWidth, bLineWidth, lineWidth, index, closePath, currentMatrix, parentMatrix) - { - this.renderer.pipelines.set(this); - - var calcMatrix = this.calcMatrix; - - // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix - if (parentMatrix) - { - parentMatrix.multiply(currentMatrix, calcMatrix); - } - - var dx = bx - ax; - var dy = by - ay; - - var len = Math.sqrt(dx * dx + dy * dy); - var al0 = aLineWidth * (by - ay) / len; - var al1 = aLineWidth * (ax - bx) / len; - var bl0 = bLineWidth * (by - ay) / len; - var bl1 = bLineWidth * (ax - bx) / len; - - var lx0 = bx - bl0; - var ly0 = by - bl1; - var lx1 = ax - al0; - var ly1 = ay - al1; - var lx2 = bx + bl0; - var ly2 = by + bl1; - var lx3 = ax + al0; - var ly3 = ay + al1; - - // tx0 = bottom right - var brX = calcMatrix.getX(lx0, ly0); - var brY = calcMatrix.getY(lx0, ly0); - - // tx1 = bottom left - var blX = calcMatrix.getX(lx1, ly1); - var blY = calcMatrix.getY(lx1, ly1); - - // tx2 = top right - var trX = calcMatrix.getX(lx2, ly2); - var trY = calcMatrix.getY(lx2, ly2); - - // tx3 = top left - var tlX = calcMatrix.getX(lx3, ly3); - var tlY = calcMatrix.getY(lx3, ly3); - - var tint = this.strokeTint; - - var tintTL = tint.TL; - var tintTR = tint.TR; - var tintBL = tint.BL; - var tintBR = tint.BR; - - // TL, BL, BR, TR - this.batchQuad(tlX, tlY, blX, blY, brX, brY, trX, trY, tintTL, tintTR, tintBL, tintBR); - - if (lineWidth <= 2) - { - // No point doing a linejoin if the line isn't thick enough - return; - } - - var prev = this.prevQuad; - var first = this.firstQuad; - - if (index > 0 && prev[4]) - { - this.batchQuad(tlX, tlY, blX, blY, prev[0], prev[1], prev[2], prev[3], tintTL, tintTR, tintBL, tintBR); - } - else - { - first[0] = tlX; - first[1] = tlY; - first[2] = blX; - first[3] = blY; - first[4] = 1; - } - - if (closePath && first[4]) - { - // Add a join for the final path segment - this.batchQuad(brX, brY, trX, trY, first[0], first[1], first[2], first[3], tintTL, tintTR, tintBL, tintBR); - } - else - { - // Store it - - prev[0] = brX; - prev[1] = brY; - prev[2] = trX; - prev[3] = trY; - prev[4] = 1; - } - }, - - /** - * Adds a single vertex to the current vertex buffer and increments the - * `vertexCount` property by 1. - * - * This method is called directly by `batchTri` and `batchQuad`. - * - * It does not perform any batch limit checking itself, so if you need to call - * this method directly, do so in the same way that `batchQuad` does, for example. - * - * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchVert - * @since 3.50.0 - * - * @param {number} x - The vertex x position. - * @param {number} y - The vertex y position. - * @param {number} tint - The tint color value. - */ - batchVert: function (x, y, tint) - { - var vertexViewF32 = this.vertexViewF32; - var vertexViewU32 = this.vertexViewU32; - - var vertexOffset = (this.vertexCount * this.currentShader.vertexComponentCount) - 1; - - vertexViewF32[++vertexOffset] = x; - vertexViewF32[++vertexOffset] = y; - vertexViewU32[++vertexOffset] = tint; - - this.vertexCount++; - }, - - /** - * Adds the vertices data into the batch and flushes if full. - * - * Assumes 6 vertices in the following arrangement: - * - * ``` - * 0----3 - * |\ B| - * | \ | - * | \ | - * | A \| - * | \ - * 1----2 - * ``` - * - * Where tx0/ty0 = 0, tx1/ty1 = 1, tx2/ty2 = 2 and tx3/ty3 = 3 - * - * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchQuad - * @override - * @since 3.50.0 - * - * @param {number} x0 - The top-left x position. - * @param {number} y0 - The top-left y position. - * @param {number} x1 - The bottom-left x position. - * @param {number} y1 - The bottom-left y position. - * @param {number} x2 - The bottom-right x position. - * @param {number} y2 - The bottom-right y position. - * @param {number} x3 - The top-right x position. - * @param {number} y3 - The top-right y position. - * @param {number} tintTL - The top-left tint color value. - * @param {number} tintTR - The top-right tint color value. - * @param {number} tintBL - The bottom-left tint color value. - * @param {number} tintBR - The bottom-right tint color value. - * - * @return {boolean} `true` if this method caused the batch to flush, otherwise `false`. - */ - batchQuad: function (x0, y0, x1, y1, x2, y2, x3, y3, tintTL, tintTR, tintBL, tintBR) - { - var hasFlushed = false; - - if (this.shouldFlush(6)) - { - this.flush(); - - hasFlushed = true; - } - - this.batchVert(x0, y0, tintTL); - this.batchVert(x1, y1, tintBL); - this.batchVert(x2, y2, tintBR); - this.batchVert(x0, y0, tintTL); - this.batchVert(x2, y2, tintBR); - this.batchVert(x3, y3, tintTR); - - return hasFlushed; - }, - - /** - * Adds the vertices data into the batch and flushes if full. - * - * Assumes 3 vertices in the following arrangement: - * - * ``` - * 0 - * |\ - * | \ - * | \ - * | \ - * | \ - * 1-----2 - * ``` - * - * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchTri - * @override - * @since 3.50.0 - * - * @param {number} x1 - The bottom-left x position. - * @param {number} y1 - The bottom-left y position. - * @param {number} x2 - The bottom-right x position. - * @param {number} y2 - The bottom-right y position. - * @param {number} x3 - The top-right x position. - * @param {number} y3 - The top-right y position. - * @param {number} tintTL - The top-left tint color value. - * @param {number} tintTR - The top-right tint color value. - * @param {number} tintBL - The bottom-left tint color value. - * - * @return {boolean} `true` if this method caused the batch to flush, otherwise `false`. - */ - batchTri: function (x0, y0, x1, y1, x2, y2, tintTL, tintTR, tintBL) - { - var hasFlushed = false; - - if (this.shouldFlush(3)) - { - this.flush(); - - hasFlushed = true; - } - - this.batchVert(x0, y0, tintTL); - this.batchVert(x1, y1, tintTR); - this.batchVert(x2, y2, tintBL); - - return hasFlushed; - }, - - /** - * Destroys all shader instances, removes all object references and nulls all external references. - * - * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#destroy - * @since 3.50.0 - * - * @return {this} This WebGLPipeline instance. - */ - destroy: function () - { - WebGLPipeline.prototype.destroy.call(this); - - this.polygonCache = null; - - return this; - } - -}); - -module.exports = GraphicsPipeline; - - /***/ }), /***/ 66901: @@ -153159,7 +153857,7 @@ module.exports = GraphicsPipeline; /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -153686,7 +154384,7 @@ module.exports = LightPipeline; /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -153731,9 +154429,12 @@ var WebGLPipeline = __webpack_require__(44775); * * If you wish to create a custom pipeline extending from this one, you should use the string * declaration `%count%` in your fragment shader source, which is used to set the number of - * `sampler2Ds` available to the `getSampler` function. + * `sampler2Ds` available. Also add `%getSampler%` so Phaser can inject the getSampler glsl function. + * This function can be used to get the pixel vec4 from the texture: * - * This pipeline will automatically inject that code for you, should those values exist + * `vec4 texture = getSampler(int(outTexId), outTexCoord);` + * + * This pipeline will automatically inject the getSampler function for you, should the value exist * in your shader source. If you wish to handle this yourself, you can also use the * function `Utils.parseFragmentShaderMaxTextures`. * @@ -154686,7 +155387,7 @@ module.exports = MultiPipeline; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -154861,7 +155562,7 @@ module.exports = PointLightPipeline; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -155356,7 +156057,7 @@ module.exports = PostFXPipeline; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -155424,7 +156125,7 @@ module.exports = RopePipeline; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -155502,7 +156203,7 @@ module.exports = SinglePipeline; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -155910,7 +156611,7 @@ var SpriteFXPipeline = new Class({ // batchQuad will intercept the rendering // Needed for Text & TileSprite - how about others? - flipY = true; + // flipY = true; MultiPipeline.prototype.batchTexture.call(this, gameObject, texture, textureWidth, textureHeight, srcX, srcY, srcWidth, srcHeight, scaleX, scaleY, rotation, flipX, flipY, scrollFactorX, scrollFactorY, displayOriginX, displayOriginY, frameX, frameY, frameWidth, frameHeight, tintTL, tintTR, tintBL, tintBR, tintEffect, uOffset, vOffset, camera, parentTransformMatrix, skipFlip, textureUnit); }, @@ -156041,7 +156742,7 @@ var SpriteFXPipeline = new Class({ // Set this here, so we can immediately call the set uniform functions and it'll work on the correct shader this.currentShader = this.copyShader; - this.onDraw(target, this.manager.getSwapRenderTarget()); + this.onDraw(target, this.manager.getSwapRenderTarget(), this.manager.getAltSwapRenderTarget()); return true; }, @@ -156341,6 +157042,7 @@ var SpriteFXPipeline = new Class({ * * @param {Phaser.Renderer.WebGL.RenderTarget} target - The Render Target to draw to the game. * @param {Phaser.Renderer.WebGL.RenderTarget} [swapTarget] - The Swap Render Target, useful for double-buffer effects. + * @param {Phaser.Renderer.WebGL.RenderTarget} [altSwapTarget] - The Swap Render Target, useful for double-buffer effects. */ onDraw: function (target) { @@ -156475,7 +157177,7 @@ module.exports = SpriteFXPipeline; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -156814,13 +157516,15 @@ var UtilityPipeline = new Class({ * @param {boolean} [clear=true] - Clear the target before copying? * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? * @param {boolean} [eraseMode=false] - Erase source from target using ERASE Blend Mode? + * @param {boolean} [flipY=false] - Flip the UV on the Y axis before drawing? */ - blitFrame: function (source, target, brightness, clear, clearAlpha, eraseMode) + blitFrame: function (source, target, brightness, clear, clearAlpha, eraseMode, flipY) { if (brightness === undefined) { brightness = 1; } if (clear === undefined) { clear = true; } if (clearAlpha === undefined) { clearAlpha = true; } if (eraseMode === undefined) { eraseMode = false; } + if (flipY === undefined) { flipY = false; } var gl = this.gl; @@ -156869,6 +157573,11 @@ var UtilityPipeline = new Class({ this.renderer.setBlendMode(BlendModes.ERASE); } + if (flipY) + { + this.flipY(); + } + gl.bufferData(gl.ARRAY_BUFFER, this.vertexData, gl.STATIC_DRAW); gl.drawArrays(gl.TRIANGLES, 0, 6); @@ -157267,7 +157976,7 @@ module.exports = UtilityPipeline; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -157375,7 +158084,7 @@ module.exports = PIPELINE_CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -157401,7 +158110,7 @@ module.exports = 'pipelineafterflush'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -157427,7 +158136,7 @@ module.exports = 'pipelinebeforeflush'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -157452,7 +158161,7 @@ module.exports = 'pipelinebind'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -157476,7 +158185,7 @@ module.exports = 'pipelineboot'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -157500,7 +158209,7 @@ module.exports = 'pipelinedestroy'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -157525,7 +158234,7 @@ module.exports = 'pipelinerebind'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -157552,7 +158261,7 @@ module.exports = 'pipelineresize'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -157580,7 +158289,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -157595,7 +158304,6 @@ var Pipelines = { BitmapMaskPipeline: __webpack_require__(5583), Events: __webpack_require__(18970), - GraphicsPipeline: __webpack_require__(67589), LightPipeline: __webpack_require__(66901), MultiPipeline: __webpack_require__(77310), PointLightPipeline: __webpack_require__(10919), @@ -157661,20 +158369,20 @@ module.exports = [ 'void main ()', '{', ' vec2 uv = gl_FragCoord.xy / uResolution;', + '', ' vec4 mainColor = texture2D(uMainSampler, uv);', ' vec4 maskColor = texture2D(uMaskSampler, uv);', - ' float alpha = mainColor.a;', '', ' if (!uInvertMaskAlpha)', ' {', - ' alpha *= (maskColor.a);', + ' mainColor *= maskColor.a;', ' }', ' else', ' {', - ' alpha *= (1.0 - maskColor.a);', + ' mainColor *= (1.0 - maskColor.a);', ' }', '', - ' gl_FragColor = vec4(mainColor.rgb * alpha, alpha);', + ' gl_FragColor = mainColor;', '}', '' ].join('\n'); @@ -157772,53 +158480,6 @@ module.exports = [ ].join('\n'); -/***/ }), - -/***/ 37699: -/***/ ((module) => { - -module.exports = [ - '#define SHADER_NAME PHASER_GRAPHICS_FS', - '', - 'precision mediump float;', - '', - 'varying vec4 outColor;', - '', - 'void main ()', - '{', - ' gl_FragColor = vec4(outColor.bgr * outColor.a, outColor.a);', - '}', - '' -].join('\n'); - - -/***/ }), - -/***/ 28739: -/***/ ((module) => { - -module.exports = [ - '#define SHADER_NAME PHASER_GRAPHICS_VS', - '', - 'precision mediump float;', - '', - 'uniform mat4 uProjectionMatrix;', - '', - 'attribute vec2 inPosition;', - 'attribute vec4 inColor;', - '', - 'varying vec4 outColor;', - '', - 'void main ()', - '{', - ' gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);', - '', - ' outColor = inColor;', - '}', - '' -].join('\n'); - - /***/ }), /***/ 65045: @@ -157912,7 +158573,7 @@ module.exports = [ /***/ ((module) => { module.exports = [ - '#define SHADER_NAME PHASER_MULTI_FS', + '#define SHADER_NAME PHASER_MULTI_V2_FS', '#define numTextures %count%', '', 'precision highp float;', @@ -157924,19 +158585,7 @@ module.exports = [ 'varying float outTintEffect;', 'varying vec4 outTint;', '', - 'vec4 getSampler (int index, vec2 uv)', - '{', - ' for (int i = 0; i < numTextures; ++i)', - ' {', - ' if (i == index)', - ' {', - ' return texture2D(uMainSampler[i], uv);', - ' }', - ' }', - '', - ' // Return black', - ' return vec4(0);', - '}', + '%getSampler%', '', 'void main ()', '{', @@ -158203,7 +158852,7 @@ module.exports = [ /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -159689,7 +160338,7 @@ var ScaleManager = new Class({ * Get Rectange of visible area, this Rectange does NOT factor in camera scroll. * * @method Phaser.Scale.ScaleManager#getViewPort - * @since 3.56.0 + * @since 3.60.0 * * @param {Phaser.Geom.Rectangle} [out] - The Rectangle of visible area. * @@ -159960,13 +160609,13 @@ module.exports = ScaleManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Phaser Scale Manager constants for centering the game canvas. - * + * * @namespace Phaser.Scale.Center * @memberof Phaser.Scale * @since 3.16.0 @@ -159974,9 +160623,9 @@ module.exports = ScaleManager; /** * Phaser Scale Manager constants for centering the game canvas. - * + * * To find out what each mode does please see [Phaser.Scale.Center]{@link Phaser.Scale.Center}. - * + * * @typedef {Phaser.Scale.Center} Phaser.Scale.CenterType * @memberof Phaser.Scale * @since 3.16.0 @@ -159987,7 +160636,7 @@ module.exports = { /** * The game canvas is not centered within the parent by Phaser. * You can still center it yourself via CSS. - * + * * @name Phaser.Scale.Center.NO_CENTER * @type {number} * @const @@ -159998,10 +160647,10 @@ module.exports = { /** * The game canvas is centered both horizontally and vertically within the parent. * To do this, the parent has to have a bounds that can be calculated and not be empty. - * + * * Centering is achieved by setting the margin left and top properties of the * game canvas, and does not factor in any other CSS styles you may have applied. - * + * * @name Phaser.Scale.Center.CENTER_BOTH * @type {number} * @const @@ -160012,10 +160661,10 @@ module.exports = { /** * The game canvas is centered horizontally within the parent. * To do this, the parent has to have a bounds that can be calculated and not be empty. - * + * * Centering is achieved by setting the margin left and top properties of the * game canvas, and does not factor in any other CSS styles you may have applied. - * + * * @name Phaser.Scale.Center.CENTER_HORIZONTALLY * @type {number} * @const @@ -160026,10 +160675,10 @@ module.exports = { /** * The game canvas is centered both vertically within the parent. * To do this, the parent has to have a bounds that can be calculated and not be empty. - * + * * Centering is achieved by setting the margin left and top properties of the * game canvas, and does not factor in any other CSS styles you may have applied. - * + * * @name Phaser.Scale.Center.CENTER_VERTICALLY * @type {number} * @const @@ -160047,13 +160696,13 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Phaser Scale Manager constants for orientation. - * + * * @namespace Phaser.Scale.Orientation * @memberof Phaser.Scale * @since 3.16.0 @@ -160061,9 +160710,9 @@ module.exports = { /** * Phaser Scale Manager constants for orientation. - * + * * To find out what each mode does please see [Phaser.Scale.Orientation]{@link Phaser.Scale.Orientation}. - * + * * @typedef {Phaser.Scale.Orientation} Phaser.Scale.OrientationType * @memberof Phaser.Scale * @since 3.16.0 @@ -160073,7 +160722,7 @@ module.exports = { /** * A landscape orientation. - * + * * @name Phaser.Scale.Orientation.LANDSCAPE * @type {string} * @const @@ -160083,7 +160732,7 @@ module.exports = { /** * A portrait orientation. - * + * * @name Phaser.Scale.Orientation.PORTRAIT * @type {string} * @const @@ -160101,13 +160750,13 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Phaser Scale Manager constants for the different scale modes available. - * + * * @namespace Phaser.Scale.ScaleModes * @memberof Phaser.Scale * @since 3.16.0 @@ -160115,9 +160764,9 @@ module.exports = { /** * Phaser Scale Manager constants for the different scale modes available. - * + * * To find out what each mode does please see [Phaser.Scale.ScaleModes]{@link Phaser.Scale.ScaleModes}. - * + * * @typedef {Phaser.Scale.ScaleModes} Phaser.Scale.ScaleModeType * @memberof Phaser.Scale * @since 3.16.0 @@ -160129,7 +160778,7 @@ module.exports = { * No scaling happens at all. The canvas is set to the size given in the game config and Phaser doesn't change it * again from that point on. If you change the canvas size, either via CSS, or directly via code, then you need * to call the Scale Managers `resize` method to give the new dimensions, or input events will stop working. - * + * * @name Phaser.Scale.ScaleModes.NONE * @type {number} * @const @@ -160139,7 +160788,7 @@ module.exports = { /** * The height is automatically adjusted based on the width. - * + * * @name Phaser.Scale.ScaleModes.WIDTH_CONTROLS_HEIGHT * @type {number} * @const @@ -160149,7 +160798,7 @@ module.exports = { /** * The width is automatically adjusted based on the height. - * + * * @name Phaser.Scale.ScaleModes.HEIGHT_CONTROLS_WIDTH * @type {number} * @const @@ -160161,7 +160810,7 @@ module.exports = { * The width and height are automatically adjusted to fit inside the given target area, * while keeping the aspect ratio. Depending on the aspect ratio there may be some space * inside the area which is not covered. - * + * * @name Phaser.Scale.ScaleModes.FIT * @type {number} * @const @@ -160172,7 +160821,7 @@ module.exports = { /** * The width and height are automatically adjusted to make the size cover the entire target * area while keeping the aspect ratio. This may extend further out than the target size. - * + * * @name Phaser.Scale.ScaleModes.ENVELOP * @type {number} * @const @@ -160182,7 +160831,7 @@ module.exports = { /** * The Canvas is resized to fit all available _parent_ space, regardless of aspect ratio. - * + * * @name Phaser.Scale.ScaleModes.RESIZE * @type {number} * @const @@ -160200,13 +160849,13 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Phaser Scale Manager constants for zoom modes. - * + * * @namespace Phaser.Scale.Zoom * @memberof Phaser.Scale * @since 3.16.0 @@ -160214,9 +160863,9 @@ module.exports = { /** * Phaser Scale Manager constants for zoom modes. - * + * * To find out what each mode does please see [Phaser.Scale.Zoom]{@link Phaser.Scale.Zoom}. - * + * * @typedef {Phaser.Scale.Zoom} Phaser.Scale.ZoomType * @memberof Phaser.Scale * @since 3.16.0 @@ -160226,7 +160875,7 @@ module.exports = { /** * The game canvas will not be zoomed by Phaser. - * + * * @name Phaser.Scale.Zoom.NO_ZOOM * @type {number} * @const @@ -160236,7 +160885,7 @@ module.exports = { /** * The game canvas will be 2x zoomed by Phaser. - * + * * @name Phaser.Scale.Zoom.ZOOM_2X * @type {number} * @const @@ -160246,7 +160895,7 @@ module.exports = { /** * The game canvas will be 4x zoomed by Phaser. - * + * * @name Phaser.Scale.Zoom.ZOOM_4X * @type {number} * @const @@ -160257,7 +160906,7 @@ module.exports = { /** * Calculate the zoom value based on the maximum multiplied game size that will * fit into the parent, or browser window if no parent is set. - * + * * @name Phaser.Scale.Zoom.MAX_ZOOM * @type {number} * @const @@ -160275,7 +160924,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -160298,7 +160947,7 @@ module.exports = CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -160318,7 +160967,7 @@ module.exports = 'enterfullscreen'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -160338,7 +160987,7 @@ module.exports = 'fullscreenfailed'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -160358,7 +161007,7 @@ module.exports = 'fullscreenunsupported'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -160379,7 +161028,7 @@ module.exports = 'leavefullscreen'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -160403,7 +161052,7 @@ module.exports = 'orientationchange'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -160434,7 +161083,7 @@ module.exports = 'resize'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -160461,7 +161110,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -160470,22 +161119,22 @@ var CONST = __webpack_require__(55301); /** * @namespace Phaser.Scale - * + * * @borrows Phaser.Scale.Center.NO_CENTER as NO_CENTER * @borrows Phaser.Scale.Center.CENTER_BOTH as CENTER_BOTH * @borrows Phaser.Scale.Center.CENTER_HORIZONTALLY as CENTER_HORIZONTALLY * @borrows Phaser.Scale.Center.CENTER_VERTICALLY as CENTER_VERTICALLY - * + * * @borrows Phaser.Scale.Orientation.LANDSCAPE as LANDSCAPE * @borrows Phaser.Scale.Orientation.PORTRAIT as PORTRAIT - * + * * @borrows Phaser.Scale.ScaleModes.NONE as NONE * @borrows Phaser.Scale.ScaleModes.WIDTH_CONTROLS_HEIGHT as WIDTH_CONTROLS_HEIGHT * @borrows Phaser.Scale.ScaleModes.HEIGHT_CONTROLS_WIDTH as HEIGHT_CONTROLS_WIDTH * @borrows Phaser.Scale.ScaleModes.FIT as FIT * @borrows Phaser.Scale.ScaleModes.ENVELOP as ENVELOP * @borrows Phaser.Scale.ScaleModes.RESIZE as RESIZE - * + * * @borrows Phaser.Scale.Zoom.NO_ZOOM as NO_ZOOM * @borrows Phaser.Scale.Zoom.ZOOM_2X as ZOOM_2X * @borrows Phaser.Scale.Zoom.ZOOM_4X as ZOOM_4X @@ -160518,7 +161167,7 @@ module.exports = Scale; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -160581,7 +161230,7 @@ module.exports = GetPhysicsPlugins; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -160629,7 +161278,7 @@ module.exports = GetScenePlugins; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -160692,7 +161341,7 @@ module.exports = InjectionMap; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -161012,7 +161661,7 @@ module.exports = Scene; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -161524,6 +162173,13 @@ var SceneManager = new Class({ */ loadComplete: function (loader) { + // TODO - Remove. This should *not* be handled here + // Try to unlock HTML5 sounds every time any loader completes + if (this.game.sound && this.game.sound.onBlurPausedSounds) + { + this.game.sound.unlock(); + } + this.create(loader.scene); }, @@ -162130,7 +162786,9 @@ var SceneManager = new Class({ }, /** - * Starts the given Scene. + * Starts the given Scene, if it is not starting, loading, or creating. + * + * If the Scene is running, paused, or sleeping, it will be shutdown and then started. * * @method Phaser.Scenes.SceneManager#start * @since 3.0.0 @@ -162162,10 +162820,18 @@ var SceneManager = new Class({ } var sys = scene.sys; + var status = sys.settings.status; - // If the Scene is already running (perhaps they called start from a launched sub-Scene?) - // then we close it down before starting it again. - if (sys.isActive() || sys.isPaused()) + // If the scene is already started but not yet running, + // let it continue. + if (status >= CONST.START && status <= CONST.CREATING) + { + return this; + } + + // If the Scene is already running, paused, or sleeping, + // close it down before starting it again. + else if (status >= CONST.RUNNING && status <= CONST.SLEEPING) { sys.shutdown(); @@ -162173,6 +162839,9 @@ var SceneManager = new Class({ sys.start(data); } + + // If the Scene is INIT or SHUTDOWN, + // start it directly. else { sys.sceneUpdate = NOOP; @@ -162226,6 +162895,11 @@ var SceneManager = new Class({ if (scene && !scene.sys.isTransitioning() && scene.sys.settings.status !== CONST.SHUTDOWN) { + var loader = scene.sys.load; + + loader.off(LoaderEvents.COMPLETE, this.loadComplete, this); + loader.off(LoaderEvents.COMPLETE, this.payloadComplete, this); + scene.sys.shutdown(data); } @@ -162462,7 +163136,7 @@ var SceneManager = new Class({ var indexA = this.getIndex(keyA); var indexB = this.getIndex(keyB); - if (indexA !== -1 && indexB !== -1) + if (indexA !== -1 && indexB !== -1 && indexB < indexA) { var tempScene = this.getAt(indexB); @@ -162470,7 +163144,7 @@ var SceneManager = new Class({ this.scenes.splice(indexB, 1); // Add in new location - this.scenes.splice(indexA + 1, 0, tempScene); + this.scenes.splice(indexA + (indexB > indexA), 0, tempScene); } } @@ -162485,7 +163159,7 @@ var SceneManager = new Class({ * @method Phaser.Scenes.SceneManager#moveBelow * @since 3.2.0 * - * @param {(string|Phaser.Scene)} keyA - The Scene that Scene B will be moved above. + * @param {(string|Phaser.Scene)} keyA - The Scene that Scene B will be moved below. * @param {(string|Phaser.Scene)} keyB - The Scene to be moved. * * @return {this} This Scene Manager instance. @@ -162506,7 +163180,7 @@ var SceneManager = new Class({ var indexA = this.getIndex(keyA); var indexB = this.getIndex(keyB); - if (indexA !== -1 && indexB !== -1) + if (indexA !== -1 && indexB !== -1 && indexB > indexA) { var tempScene = this.getAt(indexB); @@ -162520,7 +163194,7 @@ var SceneManager = new Class({ else { // Add in new location - this.scenes.splice(indexA, 0, tempScene); + this.scenes.splice(indexA - (indexB < indexA), 0, tempScene); } } } @@ -162653,7 +163327,7 @@ module.exports = SceneManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -162855,7 +163529,7 @@ var ScenePlugin = new Class({ * @since 3.0.0 * * @param {(string|Phaser.Scene)} [key] - The Scene to start. - * @param {object} [data] - The Scene data. + * @param {object} [data] - The Scene data. If no value is given it will not overwrite any previous data that may exist. * * @return {this} This Scene Plugin instance. */ @@ -162877,7 +163551,7 @@ var ScenePlugin = new Class({ * @method Phaser.Scenes.ScenePlugin#restart * @since 3.4.0 * - * @param {object} [data] - The Scene data. + * @param {object} [data] - The Scene data. If no value is given it will not overwrite any previous data that may exist. * * @return {this} This Scene Plugin instance. */ @@ -162894,6 +163568,8 @@ var ScenePlugin = new Class({ /** * This will start a transition from the current Scene to the target Scene given. * + * The target Scene cannot be the same as the current Scene. + * * The transition will last for the duration specified in milliseconds. * * You can have the target Scene moved above or below this one in the display list. @@ -163604,6 +164280,26 @@ var ScenePlugin = new Class({ return this.manager.getScene(key); }, + /** + * Return the status of the Scene. + * + * @method Phaser.Scenes.ScenePlugin#getStatus + * @since 3.60.0 + * + * @param {(string|Phaser.Scene)} key - The Scene to get the status from. + * + * @return {number} The Scene status. This maps to the `Phaser.Scene` constants, such as `Phaser.Scene.LOADING`. + */ + getStatus: function (key) + { + var scene = this.manager.getScene(key); + + if (scene) + { + return scene.sys.getStatus(); + } + }, + /** * Retrieves the numeric index of a Scene in the Scenes list. * @@ -163674,7 +164370,7 @@ module.exports = ScenePlugin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -163771,7 +164467,7 @@ module.exports = Settings; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -164177,7 +164873,8 @@ var Systems = new Class({ /** * Pause this Scene. - * A paused Scene still renders, it just doesn't run ANY of its update handlers or systems. + * + * A paused Scene still renders, it just doesn't run any of its update handlers or systems. * * @method Phaser.Scenes.Systems#pause * @fires Phaser.Scenes.Events#PAUSE @@ -164189,16 +164886,20 @@ var Systems = new Class({ */ pause: function (data) { - var events = this.events; var settings = this.settings; + var status = this.getStatus(); - if (this.settings.active) + if (status !== CONST.CREATING && status !== CONST.RUNNING) + { + console.warn('Cannot pause non-running Scene', settings.key); + } + else if (this.settings.active) { settings.status = CONST.PAUSED; settings.active = false; - events.emit(Events.PAUSE, this, data); + this.events.emit(Events.PAUSE, this, data); } return this; @@ -164250,15 +164951,22 @@ var Systems = new Class({ */ sleep: function (data) { - var events = this.events; var settings = this.settings; + var status = this.getStatus(); - settings.status = CONST.SLEEPING; + if (status !== CONST.CREATING && status !== CONST.RUNNING) + { + console.warn('Cannot sleep non-running Scene', settings.key); + } + else + { + settings.status = CONST.SLEEPING; - settings.active = false; - settings.visible = false; + settings.active = false; + settings.visible = false; - events.emit(Events.SLEEP, this, data); + this.events.emit(Events.SLEEP, this, data); + } return this; }, @@ -164303,13 +165011,26 @@ var Systems = new Class({ * @method Phaser.Scenes.Systems#getData * @since 3.22.0 * - * @return {any} + * @return {any} The Scene Data. */ getData: function () { return this.settings.data; }, + /** + * Returns the current status of this Scene. + * + * @method Phaser.Scenes.Systems#getStatus + * @since 3.60.0 + * + * @return {number} The status of this Scene. One of the `Phaser.Scene` constants. + */ + getStatus: function () + { + return this.settings.status; + }, + /** * Is this Scene sleeping? * @@ -164557,13 +165278,13 @@ module.exports = Systems; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Scene consts. - * + * * @ignore */ @@ -164571,7 +165292,7 @@ var CONST = { /** * Scene state. - * + * * @name Phaser.Scenes.PENDING * @readonly * @type {number} @@ -164581,7 +165302,7 @@ var CONST = { /** * Scene state. - * + * * @name Phaser.Scenes.INIT * @readonly * @type {number} @@ -164591,7 +165312,7 @@ var CONST = { /** * Scene state. - * + * * @name Phaser.Scenes.START * @readonly * @type {number} @@ -164601,7 +165322,7 @@ var CONST = { /** * Scene state. - * + * * @name Phaser.Scenes.LOADING * @readonly * @type {number} @@ -164611,7 +165332,7 @@ var CONST = { /** * Scene state. - * + * * @name Phaser.Scenes.CREATING * @readonly * @type {number} @@ -164621,7 +165342,7 @@ var CONST = { /** * Scene state. - * + * * @name Phaser.Scenes.RUNNING * @readonly * @type {number} @@ -164631,7 +165352,7 @@ var CONST = { /** * Scene state. - * + * * @name Phaser.Scenes.PAUSED * @readonly * @type {number} @@ -164641,7 +165362,7 @@ var CONST = { /** * Scene state. - * + * * @name Phaser.Scenes.SLEEPING * @readonly * @type {number} @@ -164651,7 +165372,7 @@ var CONST = { /** * Scene state. - * + * * @name Phaser.Scenes.SHUTDOWN * @readonly * @type {number} @@ -164661,7 +165382,7 @@ var CONST = { /** * Scene state. - * + * * @name Phaser.Scenes.DESTROYED * @readonly * @type {number} @@ -164681,7 +165402,7 @@ module.exports = CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -164708,7 +165429,7 @@ module.exports = 'addedtoscene'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -164734,7 +165455,7 @@ module.exports = 'boot'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -164764,7 +165485,7 @@ module.exports = 'create'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -164792,7 +165513,7 @@ module.exports = 'destroy'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -164820,7 +165541,7 @@ module.exports = 'pause'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -164898,7 +165619,7 @@ module.exports = 'prerender'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -164937,7 +165658,7 @@ module.exports = 'preupdate'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -164966,7 +165687,7 @@ module.exports = 'ready'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -164993,7 +165714,7 @@ module.exports = 'removedfromscene'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -165032,7 +165753,7 @@ module.exports = 'render'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -165060,7 +165781,7 @@ module.exports = 'resume'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -165091,7 +165812,7 @@ module.exports = 'shutdown'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -165119,7 +165840,7 @@ module.exports = 'sleep'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -165145,7 +165866,7 @@ module.exports = 'start'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -165182,7 +165903,7 @@ module.exports = 'transitioncomplete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -165220,7 +165941,7 @@ module.exports = 'transitioninit'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -165255,7 +165976,7 @@ module.exports = 'transitionout'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -165296,7 +166017,7 @@ module.exports = 'transitionstart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -165332,7 +166053,7 @@ module.exports = 'transitionwake'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -165345,7 +166066,7 @@ module.exports = 'transitionwake'; * * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} - * 3. The `Scene.update` method is called, if it exists + * 3. The `Scene.update` method is called, if it exists and the Scene is in a Running state, otherwise this is skipped. * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} @@ -165371,7 +166092,7 @@ module.exports = 'update'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -165399,7 +166120,7 @@ module.exports = 'wake'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -165442,7 +166163,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -165479,7 +166200,7 @@ module.exports = Scene; /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -165518,7 +166239,6 @@ var BaseSound = new Class({ * * @name Phaser.Sound.BaseSound#manager * @type {Phaser.Sound.BaseSoundManager} - * @private * @since 3.0.0 */ this.manager = manager; @@ -165652,7 +166372,6 @@ var BaseSound = new Class({ * * @name Phaser.Sound.BaseSound#pendingRemove * @type {boolean} - * @private * @default false * @since 3.0.0 */ @@ -165888,7 +166607,6 @@ var BaseSound = new Class({ * Method used internally for applying config values to some of the sound properties. * * @method Phaser.Sound.BaseSound#applyConfig - * @protected * @since 3.0.0 */ applyConfig: function () @@ -165905,7 +166623,6 @@ var BaseSound = new Class({ * Method used internally for resetting values of some of the config properties. * * @method Phaser.Sound.BaseSound#resetConfig - * @protected * @since 3.0.0 */ resetConfig: function () @@ -165918,8 +166635,6 @@ var BaseSound = new Class({ * Update method called automatically by sound manager on every game step. * * @method Phaser.Sound.BaseSound#update - * @override - * @protected * @since 3.0.0 * * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. @@ -165931,7 +166646,6 @@ var BaseSound = new Class({ * Method used internally to calculate total playback rate of the sound. * * @method Phaser.Sound.BaseSound#calculateRate - * @protected * @since 3.0.0 */ calculateRate: function () @@ -165958,12 +166672,12 @@ var BaseSound = new Class({ } this.emit(Events.DESTROY, this); - this.pendingRemove = true; - this.manager = null; - this.key = ''; + this.removeAllListeners(); - this.isPlaying = false; - this.isPaused = false; + + this.pendingRemove = true; + + this.manager = null; this.config = null; this.currentConfig = null; this.markers = null; @@ -165983,7 +166697,7 @@ module.exports = BaseSound; /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -166161,7 +166875,7 @@ var BaseSoundManager = new Class({ * @param {string} key - Asset key for the sound. * @param {Phaser.Types.Sound.SoundConfig} [config] - An optional config object containing default sound settings. * - * @return {(Phaser.Sound.HTML5AudioSound|Phaser.Sound.WebAudioSound)} The new audio sprite sound instance. + * @return {(Phaser.Sound.NoAudioSound|Phaser.Sound.HTML5AudioSound|Phaser.Sound.WebAudioSound)} The new audio sprite sound instance. */ addAudioSprite: function (key, config) { @@ -166315,7 +167029,6 @@ var BaseSoundManager = new Class({ return false; }, - /** * Removes all sounds from the manager, destroying the sounds. * @@ -166415,7 +167128,6 @@ var BaseSoundManager = new Class({ this.emit(Events.STOP_ALL, this); }, - /** * Stops any sounds matching the given key. * @@ -166596,7 +167308,7 @@ var BaseSoundManager = new Class({ * * @param {number} value - Global playback rate at which all the sounds will be played. * - * @return {Phaser.Sound.BaseSoundManager} This Sound Manager. + * @return {this} This Sound Manager. */ setRate: function (value) { @@ -166646,7 +167358,7 @@ var BaseSoundManager = new Class({ * * @param {number} value - The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). * - * @return {Phaser.Sound.BaseSoundManager} This Sound Manager. + * @return {this} This Sound Manager. */ setDetune: function (value) { @@ -166698,7 +167410,7 @@ module.exports = BaseSoundManager; /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -166750,17 +167462,17 @@ module.exports = SoundManagerCreator; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Complete Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they complete playback. - * + * * Listen to it from a Sound instance using `Sound.on('complete', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('complete', listener); @@ -166769,7 +167481,7 @@ module.exports = SoundManagerCreator; * * @event Phaser.Sound.Events#COMPLETE * @since 3.16.1 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. */ module.exports = 'complete'; @@ -166782,21 +167494,21 @@ module.exports = 'complete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Audio Data Decoded All Event. - * + * * This event is dispatched by the Web Audio Sound Manager as a result of calling the `decodeAudio` method, * once all files passed to the method have been decoded (or errored). - * + * * Use `Phaser.Sound.Events#DECODED` to listen for single sounds being decoded, and `DECODED_ALL` to * listen for them all completing. - * + * * Listen to it from the Sound Manager in a Scene using `this.sound.on('decodedall', listener)`, i.e.: - * + * * ```javascript * this.sound.once('decodedall', handler); * this.sound.decodeAudio([ audioFiles ]); @@ -166815,17 +167527,17 @@ module.exports = 'decodedall'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Audio Data Decoded Event. - * + * * This event is dispatched by the Web Audio Sound Manager as a result of calling the `decodeAudio` method. - * + * * Listen to it from the Sound Manager in a Scene using `this.sound.on('decoded', listener)`, i.e.: - * + * * ```javascript * this.sound.on('decoded', handler); * this.sound.decodeAudio(key, audioData); @@ -166833,7 +167545,7 @@ module.exports = 'decodedall'; * * @event Phaser.Sound.Events#DECODED * @since 3.18.0 - * + * * @param {string} key - The key of the audio file that was decoded and added to the audio cache. */ module.exports = 'decoded'; @@ -166846,18 +167558,18 @@ module.exports = 'decoded'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Destroy Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are destroyed, either * directly or via a Sound Manager. - * + * * Listen to it from a Sound instance using `Sound.on('destroy', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('destroy', listener); @@ -166866,7 +167578,7 @@ module.exports = 'decoded'; * * @event Phaser.Sound.Events#DESTROY * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. */ module.exports = 'destroy'; @@ -166879,17 +167591,17 @@ module.exports = 'destroy'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Detune Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their detune value changes. - * + * * Listen to it from a Sound instance using `Sound.on('detune', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('detune', listener); @@ -166899,7 +167611,7 @@ module.exports = 'destroy'; * * @event Phaser.Sound.Events#DETUNE * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. * @param {number} detune - The new detune value of the Sound. */ @@ -166913,22 +167625,22 @@ module.exports = 'detune'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Manager Global Detune Event. - * + * * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, * or the HTML5 Audio Manager. It is dispatched when the `detune` property of the Sound Manager is changed, which globally * adjusts the detuning of all active sounds. - * + * * Listen to it from a Scene using: `this.sound.on('rate', listener)`. * * @event Phaser.Sound.Events#GLOBAL_DETUNE * @since 3.0.0 - * + * * @param {Phaser.Sound.BaseSoundManager} soundManager - A reference to the sound manager that emitted the event. * @param {number} detune - The updated detune value. */ @@ -166942,21 +167654,21 @@ module.exports = 'detune'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Manager Global Mute Event. - * + * * This event is dispatched by the Sound Manager when its `mute` property is changed, either directly * or via the `setMute` method. This changes the mute state of all active sounds. - * + * * Listen to it from a Scene using: `this.sound.on('mute', listener)`. * * @event Phaser.Sound.Events#GLOBAL_MUTE * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSoundManager|Phaser.Sound.HTML5AudioSoundManager)} soundManager - A reference to the Sound Manager that emitted the event. * @param {boolean} mute - The mute value. `true` if the Sound Manager is now muted, otherwise `false`. */ @@ -166970,22 +167682,22 @@ module.exports = 'mute'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Manager Global Rate Event. - * + * * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, * or the HTML5 Audio Manager. It is dispatched when the `rate` property of the Sound Manager is changed, which globally * adjusts the playback rate of all active sounds. - * + * * Listen to it from a Scene using: `this.sound.on('rate', listener)`. * * @event Phaser.Sound.Events#GLOBAL_RATE * @since 3.0.0 - * + * * @param {Phaser.Sound.BaseSoundManager} soundManager - A reference to the sound manager that emitted the event. * @param {number} rate - The updated rate value. */ @@ -166999,21 +167711,21 @@ module.exports = 'rate'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Manager Global Volume Event. - * + * * This event is dispatched by the Sound Manager when its `volume` property is changed, either directly * or via the `setVolume` method. This changes the volume of all active sounds. - * + * * Listen to it from a Scene using: `this.sound.on('volume', listener)`. * * @event Phaser.Sound.Events#GLOBAL_VOLUME * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSoundManager|Phaser.Sound.HTML5AudioSoundManager)} soundManager - A reference to the sound manager that emitted the event. * @param {number} volume - The new global volume of the Sound Manager. */ @@ -167027,29 +167739,29 @@ module.exports = 'volume'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Looped Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they loop during playback. - * + * * Listen to it from a Sound instance using `Sound.on('looped', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('looped', listener); * music.setLoop(true); * music.play(); * ``` - * + * * This is not to be confused with the [LOOP]{@linkcode Phaser.Sound.Events#event:LOOP} event, which only emits when the loop state of a Sound is changed. * * @event Phaser.Sound.Events#LOOPED * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. */ module.exports = 'looped'; @@ -167062,28 +167774,28 @@ module.exports = 'looped'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Loop Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their loop state is changed. - * + * * Listen to it from a Sound instance using `Sound.on('loop', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('loop', listener); * music.setLoop(true); * ``` - * + * * This is not to be confused with the [LOOPED]{@linkcode Phaser.Sound.Events#event:LOOPED} event, which emits each time a Sound loops during playback. * * @event Phaser.Sound.Events#LOOP * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. * @param {boolean} loop - The new loop value. `true` if the Sound will loop, otherwise `false`. */ @@ -167097,17 +167809,17 @@ module.exports = 'loop'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Mute Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their mute state changes. - * + * * Listen to it from a Sound instance using `Sound.on('mute', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('mute', listener); @@ -167117,7 +167829,7 @@ module.exports = 'loop'; * * @event Phaser.Sound.Events#MUTE * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. * @param {boolean} mute - The mute value. `true` if the Sound is now muted, otherwise `false`. */ @@ -167131,7 +167843,7 @@ module.exports = 'mute'; /** * @author pi-kei - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -167165,22 +167877,22 @@ module.exports = 'pan'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pause All Sounds Event. - * + * * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, * or the HTML5 Audio Manager. It is dispatched when the `pauseAll` method is invoked and after all current Sounds * have been paused. - * + * * Listen to it from a Scene using: `this.sound.on('pauseall', listener)`. * * @event Phaser.Sound.Events#PAUSE_ALL * @since 3.0.0 - * + * * @param {Phaser.Sound.BaseSoundManager} soundManager - A reference to the sound manager that emitted the event. */ module.exports = 'pauseall'; @@ -167193,17 +167905,17 @@ module.exports = 'pauseall'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Pause Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are paused. - * + * * Listen to it from a Sound instance using `Sound.on('pause', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('pause', listener); @@ -167213,7 +167925,7 @@ module.exports = 'pauseall'; * * @event Phaser.Sound.Events#PAUSE * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. */ module.exports = 'pause'; @@ -167226,17 +167938,17 @@ module.exports = 'pause'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Play Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are played. - * + * * Listen to it from a Sound instance using `Sound.on('play', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('play', listener); @@ -167245,7 +167957,7 @@ module.exports = 'pause'; * * @event Phaser.Sound.Events#PLAY * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. */ module.exports = 'play'; @@ -167258,17 +167970,17 @@ module.exports = 'play'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Rate Change Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their rate changes. - * + * * Listen to it from a Sound instance using `Sound.on('rate', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('rate', listener); @@ -167278,7 +167990,7 @@ module.exports = 'play'; * * @event Phaser.Sound.Events#RATE * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. * @param {number} rate - The new rate of the Sound. */ @@ -167292,22 +168004,22 @@ module.exports = 'rate'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Resume All Sounds Event. - * + * * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, * or the HTML5 Audio Manager. It is dispatched when the `resumeAll` method is invoked and after all current Sounds * have been resumed. - * + * * Listen to it from a Scene using: `this.sound.on('resumeall', listener)`. * * @event Phaser.Sound.Events#RESUME_ALL * @since 3.0.0 - * + * * @param {Phaser.Sound.BaseSoundManager} soundManager - A reference to the sound manager that emitted the event. */ module.exports = 'resumeall'; @@ -167320,17 +168032,17 @@ module.exports = 'resumeall'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Resume Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are resumed from a paused state. - * + * * Listen to it from a Sound instance using `Sound.on('resume', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('resume', listener); @@ -167341,7 +168053,7 @@ module.exports = 'resumeall'; * * @event Phaser.Sound.Events#RESUME * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. */ module.exports = 'resume'; @@ -167354,17 +168066,17 @@ module.exports = 'resume'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Seek Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are seeked to a new position. - * + * * Listen to it from a Sound instance using `Sound.on('seek', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('seek', listener); @@ -167374,7 +168086,7 @@ module.exports = 'resume'; * * @event Phaser.Sound.Events#SEEK * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. * @param {number} detune - The new detune value of the Sound. */ @@ -167388,22 +168100,22 @@ module.exports = 'seek'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Stop All Sounds Event. - * + * * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, * or the HTML5 Audio Manager. It is dispatched when the `stopAll` method is invoked and after all current Sounds * have been stopped. - * + * * Listen to it from a Scene using: `this.sound.on('stopall', listener)`. * * @event Phaser.Sound.Events#STOP_ALL * @since 3.0.0 - * + * * @param {Phaser.Sound.BaseSoundManager} soundManager - A reference to the sound manager that emitted the event. */ module.exports = 'stopall'; @@ -167416,17 +168128,17 @@ module.exports = 'stopall'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Stop Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are stopped. - * + * * Listen to it from a Sound instance using `Sound.on('stop', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('stop', listener); @@ -167436,7 +168148,7 @@ module.exports = 'stopall'; * * @event Phaser.Sound.Events#STOP * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. */ module.exports = 'stop'; @@ -167449,22 +168161,22 @@ module.exports = 'stop'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Manager Unlocked Event. - * + * * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, * or the HTML5 Audio Manager. It is dispatched during the update loop when the Sound Manager becomes unlocked. For * Web Audio this is on the first user gesture on the page. - * + * * Listen to it from a Scene using: `this.sound.on('unlocked', listener)`. * * @event Phaser.Sound.Events#UNLOCKED * @since 3.0.0 - * + * * @param {Phaser.Sound.BaseSoundManager} soundManager - A reference to the sound manager that emitted the event. */ module.exports = 'unlocked'; @@ -167477,17 +168189,17 @@ module.exports = 'unlocked'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Volume Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their volume changes. - * + * * Listen to it from a Sound instance using `Sound.on('volume', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('volume', listener); @@ -167497,7 +168209,7 @@ module.exports = 'unlocked'; * * @event Phaser.Sound.Events#VOLUME * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. * @param {number} volume - The new volume of the Sound. */ @@ -167511,7 +168223,7 @@ module.exports = 'volume'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -167557,7 +168269,7 @@ module.exports = { /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -167592,19 +168304,18 @@ var HTML5AudioSound = new Class({ /** * An array containing all HTML5 Audio tags that could be used for individual - * sound's playback. Number of instances depends on the config value passed - * to the Loader#audio method call, default is 1. + * sound playback. Number of instances depends on the config value passed + * to the `Loader#audio` method call, default is 1. * * @name Phaser.Sound.HTML5AudioSound#tags * @type {HTMLAudioElement[]} - * @private * @since 3.0.0 */ this.tags = manager.game.cache.audio.get(key); if (!this.tags) { - throw new Error('There is no audio asset with key "' + key + '" in the audio cache'); + throw new Error('No cached audio asset with key "' + key); } /** @@ -167612,7 +168323,6 @@ var HTML5AudioSound = new Class({ * * @name Phaser.Sound.HTML5AudioSound#audio * @type {HTMLAudioElement} - * @private * @default null * @since 3.0.0 */ @@ -167625,7 +168335,6 @@ var HTML5AudioSound = new Class({ * * @name Phaser.Sound.HTML5AudioSound#startTime * @type {number} - * @private * @default 0 * @since 3.0.0 */ @@ -167637,7 +168346,6 @@ var HTML5AudioSound = new Class({ * * @name Phaser.Sound.HTML5AudioSound#previousTime * @type {number} - * @private * @default 0 * @since 3.0.0 */ @@ -167790,10 +168498,9 @@ var HTML5AudioSound = new Class({ }, /** - * Used internally to do what the name says. + * This method is used internally to pick and play the next available audio tag. * * @method Phaser.Sound.HTML5AudioSound#pickAndPlayAudioTag - * @private * @since 3.0.0 * * @return {boolean} Whether the sound was assigned an audio tag successfully. @@ -167803,6 +168510,7 @@ var HTML5AudioSound = new Class({ if (!this.pickAudioTag()) { this.reset(); + return false; } @@ -167846,7 +168554,6 @@ var HTML5AudioSound = new Class({ * does nothing. * * @method Phaser.Sound.HTML5AudioSound#pickAudioTag - * @private * @since 3.0.0 * * @return {boolean} Whether the sound was assigned an audio tag successfully. @@ -167912,7 +168619,6 @@ var HTML5AudioSound = new Class({ * thrown from rejected Promise returned from play method call. * * @method Phaser.Sound.HTML5AudioSound#playCatchPromise - * @private * @since 3.0.0 */ playCatchPromise: function () @@ -167930,10 +168636,9 @@ var HTML5AudioSound = new Class({ }, /** - * Used internally to do what the name says. + * This method is used internally to stop and release the current audio tag. * * @method Phaser.Sound.HTML5AudioSound#stopAndReleaseAudioTag - * @private * @since 3.0.0 */ stopAndReleaseAudioTag: function () @@ -167954,7 +168659,6 @@ var HTML5AudioSound = new Class({ * or when hijacking audio tag from another sound. * * @method Phaser.Sound.HTML5AudioSound#reset - * @private * @since 3.0.0 */ reset: function () @@ -167967,7 +168671,6 @@ var HTML5AudioSound = new Class({ * Phaser.Sound.HTML5AudioSoundManager#pauseOnBlur is set to true. * * @method Phaser.Sound.HTML5AudioSoundManager#onBlur - * @private * @since 3.0.0 */ onBlur: function () @@ -167987,7 +168690,6 @@ var HTML5AudioSound = new Class({ * Phaser.Sound.HTML5AudioSoundManager#pauseOnBlur is set to true. * * @method Phaser.Sound.HTML5AudioSound#onFocus - * @private * @since 3.0.0 */ onFocus: function () @@ -168003,7 +168705,6 @@ var HTML5AudioSound = new Class({ * @method Phaser.Sound.HTML5AudioSound#update * @fires Phaser.Sound.Events#COMPLETE * @fires Phaser.Sound.Events#LOOPED - * @protected * @since 3.0.0 * * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. @@ -168086,10 +168787,9 @@ var HTML5AudioSound = new Class({ }, /** - * Method used internally to determine mute setting of the sound. + * This method is used internally to update the mute setting of this sound. * * @method Phaser.Sound.HTML5AudioSound#updateMute - * @private * @since 3.0.0 */ updateMute: function () @@ -168101,10 +168801,9 @@ var HTML5AudioSound = new Class({ }, /** - * Method used internally to calculate total volume of the sound. + * This method is used internally to update the volume of this sound. * * @method Phaser.Sound.HTML5AudioSound#updateVolume - * @private * @since 3.0.0 */ updateVolume: function () @@ -168116,10 +168815,9 @@ var HTML5AudioSound = new Class({ }, /** - * Method used internally to calculate total playback rate of the sound. + * This method is used internally to update the playback rate of this sound. * * @method Phaser.Sound.HTML5AudioSound#calculateRate - * @protected * @since 3.0.0 */ calculateRate: function () @@ -168532,7 +169230,7 @@ module.exports = HTML5AudioSound; /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -169002,7 +169700,7 @@ module.exports = HTML5AudioSoundManager; /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -169039,7 +169737,7 @@ module.exports = { /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -169047,6 +169745,7 @@ var BaseSound = __webpack_require__(25798); var Class = __webpack_require__(56694); var EventEmitter = __webpack_require__(6659); var Extend = __webpack_require__(98611); +var NOOP = __webpack_require__(72283); var returnFalse = function () { @@ -169073,6 +169772,7 @@ var returnThis = function () * breaking on devices that don't support any audio playback technologies. * * @class NoAudioSound + * @extends Phaser.Events.EventEmitter * @memberof Phaser.Sound * @constructor * @since 3.0.0 @@ -169093,14 +169793,89 @@ var NoAudioSound = new Class({ EventEmitter.call(this); + /** + * Local reference to the sound manager. + * + * @name Phaser.Sound.NoAudioSound#manager + * @type {Phaser.Sound.BaseSoundManager} + * @since 3.0.0 + */ this.manager = manager; + + /** + * Asset key for the sound. + * + * @name Phaser.Sound.NoAudioSound#key + * @type {string} + * @readonly + * @since 3.0.0 + */ this.key = key; + + /** + * Flag indicating if sound is currently playing. + * + * @name Phaser.Sound.NoAudioSound#isPlaying + * @type {boolean} + * @default false + * @readonly + * @since 3.0.0 + */ this.isPlaying = false; + + /** + * Flag indicating if sound is currently paused. + * + * @name Phaser.Sound.NoAudioSound#isPaused + * @type {boolean} + * @default false + * @readonly + * @since 3.0.0 + */ this.isPaused = false; + + /** + * A property that holds the value of sound's actual playback rate, + * after its rate and detune values has been combined with global + * rate and detune values. + * + * @name Phaser.Sound.NoAudioSound#totalRate + * @type {number} + * @default 1 + * @readonly + * @since 3.0.0 + */ this.totalRate = 1; + + /** + * A value representing the duration, in seconds. + * It could be total sound duration or a marker duration. + * + * @name Phaser.Sound.NoAudioSound#duration + * @type {number} + * @readonly + * @since 3.0.0 + */ this.duration = 0; + + /** + * The total duration of the sound in seconds. + * + * @name Phaser.Sound.NoAudioSound#totalDuration + * @type {number} + * @readonly + * @since 3.0.0 + */ this.totalDuration = 0; + /** + * A config object used to store default sound settings' values. + * Default values will be set by properties' setters. + * + * @name Phaser.Sound.NoAudioSound#config + * @type {Phaser.Types.Sound.SoundConfig} + * @since 3.0.0 + */ this.config = Extend({ mute: false, volume: 1, @@ -169112,16 +169887,132 @@ var NoAudioSound = new Class({ pan: 0 }, config); + /** + * Reference to the currently used config. + * It could be default config or marker config. + * + * @name Phaser.Sound.NoAudioSound#currentConfig + * @type {Phaser.Types.Sound.SoundConfig} + * @since 3.0.0 + */ this.currentConfig = this.config; + + /** + * Boolean indicating whether the sound is muted or not. + * Gets or sets the muted state of this sound. + * + * @name Phaser.Sound.NoAudioSound#mute + * @type {boolean} + * @default false + * @fires Phaser.Sound.Events#MUTE + * @since 3.0.0 + */ this.mute = false; + + /** + * Gets or sets the volume of this sound, a value between 0 (silence) and 1 (full volume). + * + * @name Phaser.Sound.NoAudioSound#volume + * @type {number} + * @default 1 + * @fires Phaser.Sound.Events#VOLUME + * @since 3.0.0 + */ this.volume = 1; + + /** + * Rate at which this Sound will be played. + * Value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed + * and 2.0 doubles the audios playback speed. + * + * @name Phaser.Sound.NoAudioSound#rate + * @type {number} + * @default 1 + * @fires Phaser.Sound.Events#RATE + * @since 3.0.0 + */ this.rate = 1; + + /** + * The detune value of this Sound, given in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29). + * The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + * + * @name Phaser.Sound.NoAudioSound#detune + * @type {number} + * @default 0 + * @fires Phaser.Sound.Events#DETUNE + * @since 3.0.0 + */ this.detune = 0; + + /** + * Property representing the position of playback for this sound, in seconds. + * Setting it to a specific value moves current playback to that position. + * The value given is clamped to the range 0 to current marker duration. + * Setting seek of a stopped sound has no effect. + * + * @name Phaser.Sound.NoAudioSound#seek + * @type {number} + * @fires Phaser.Sound.Events#SEEK + * @since 3.0.0 + */ this.seek = 0; + + /** + * Flag indicating whether or not the sound or current sound marker will loop. + * + * @name Phaser.Sound.NoAudioSound#loop + * @type {boolean} + * @default false + * @fires Phaser.Sound.Events#LOOP + * @since 3.0.0 + */ this.loop = false; + + /** + * Gets or sets the pan of this sound, a value between -1 (full left pan) and 1 (full right pan). + * + * Always returns zero on iOS / Safari as it doesn't support the stereo panner node. + * + * @name Phaser.Sound.NoAudioSound#pan + * @type {number} + * @default 0 + * @fires Phaser.Sound.Events#PAN + * @since 3.50.0 + */ this.pan = 0; + + /** + * Object containing markers definitions. + * + * @name Phaser.Sound.NoAudioSound#markers + * @type {Object.} + * @default {} + * @readonly + * @since 3.0.0 + */ this.markers = {}; + + /** + * Currently playing marker. + * 'null' if whole sound is playing. + * + * @name Phaser.Sound.NoAudioSound#currentMarker + * @type {Phaser.Types.Sound.SoundMarker} + * @default null + * @readonly + * @since 3.0.0 + */ this.currentMarker = null; + + /** + * Flag indicating if destroy method was called on this sound. + * + * @name Phaser.Sound.NoAudioSound#pendingRemove + * @type {boolean} + * @default false + * @since 3.0.0 + */ this.pendingRemove = false; }, @@ -169194,6 +170085,132 @@ var NoAudioSound = new Class({ */ stop: returnFalse, + /** + * Sets the muted state of this Sound. + * + * @method Phaser.Sound.NoAudioSound#setMute + * @since 3.4.0 + * + * @param {boolean} value - `true` to mute this sound, `false` to unmute it. + * + * @return {this} This Sound instance. + */ + setMute: returnThis, + + /** + * Sets the volume of this Sound. + * + * @method Phaser.Sound.NoAudioSound#setVolume + * @since 3.4.0 + * + * @param {number} value - The volume of the sound. + * + * @return {this} This Sound instance. + */ + setVolume: returnThis, + + /** + * Sets the playback rate of this Sound. + * + * For example, a value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed + * and 2.0 doubles the audios playback speed. + * + * @method Phaser.Sound.NoAudioSound#setRate + * @since 3.3.0 + * + * @param {number} value - The playback rate at of this Sound. + * + * @return {this} This Sound instance. + */ + setRate: returnThis, + + /** + * Sets the detune value of this Sound, given in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29). + * The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + * + * @method Phaser.Sound.NoAudioSound#setDetune + * @since 3.3.0 + * + * @param {number} value - The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + * + * @return {this} This Sound instance. + */ + setDetune: returnThis, + + /** + * Seeks to a specific point in this sound. + * + * @method Phaser.Sound.NoAudioSound#setSeek + * @since 3.4.0 + * + * @param {number} value - The point in the sound to seek to. + * + * @return {this} This Sound instance. + */ + setSeek: returnThis, + + /** + * Sets the loop state of this Sound. + * + * @method Phaser.Sound.NoAudioSound#setLoop + * @since 3.4.0 + * + * @param {boolean} value - `true` to loop this sound, `false` to not loop it. + * + * @return {this} This Sound instance. + */ + setLoop: returnThis, + + /** + * Sets the pan of this sound, a value between -1 (full left pan) and 1 (full right pan). + * + * Note: iOS / Safari doesn't support the stereo panner node. + * + * @method Phaser.Sound.NoAudioSound#setPan + * @since 3.50.0 + * + * @param {number} value - The pan of the sound. A value between -1 (full left pan) and 1 (full right pan). + * + * @return {this} This Sound instance. + */ + setPan: returnThis, + + /** + * Method used internally for applying config values to some of the sound properties. + * + * @method Phaser.Sound.NoAudioSound#applyConfig + * @since 3.0.0 + */ + applyConfig: returnNull, + + /** + * Method used internally for resetting values of some of the config properties. + * + * @method Phaser.Sound.NoAudioSound#resetConfig + * @since 3.0.0 + */ + resetConfig: returnNull, + + /** + * Update method called automatically by sound manager on every game step. + * + * @method Phaser.Sound.NoAudioSound#update + * @override + * @since 3.0.0 + * + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} delta - The delta time elapsed since the last frame. + */ + update: NOOP, + + /** + * Method used internally to calculate total playback rate of the sound. + * + * @method Phaser.Sound.NoAudioSound#calculateRate + * @since 3.0.0 + */ + calculateRate: returnNull, + /** * Destroys this sound and all associated events and marks it for removal from the sound manager. * @@ -169204,21 +170221,7 @@ var NoAudioSound = new Class({ destroy: function () { BaseSound.prototype.destroy.call(this); - }, - - setMute: returnThis, - - setVolume: returnThis, - - setRate: returnThis, - - setDetune: returnThis, - - setSeek: returnThis, - - setLoop: returnThis, - - setPan: returnThis + } }); @@ -169233,7 +170236,7 @@ module.exports = NoAudioSound; /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -169280,6 +170283,17 @@ var NoAudioSoundManager = new Class({ this.locked = false; }, + /** + * Adds a new sound into the sound manager. + * + * @method Phaser.Sound.NoAudioSoundManager#add + * @since 3.60.0 + * + * @param {string} key - Asset key for the sound. + * @param {Phaser.Types.Sound.SoundConfig} [config] - An optional config object containing default sound settings. + * + * @return {Phaser.Sound.NoAudioSound} The new sound instance. + */ add: function (key, config) { var sound = new NoAudioSound(this, key, config); @@ -169289,6 +170303,19 @@ var NoAudioSoundManager = new Class({ return sound; }, + /** + * Adds a new audio sprite sound into the sound manager. + * Audio Sprites are a combination of audio files and a JSON configuration. + * The JSON follows the format of that created by https://github.com/tonistiigi/audiosprite + * + * @method Phaser.Sound.NoAudioSoundManager#addAudioSprite + * @since 3.60.0 + * + * @param {string} key - Asset key for the sound. + * @param {Phaser.Types.Sound.SoundConfig} [config] - An optional config object containing default sound settings. + * + * @return {Phaser.Sound.NoAudioSound} The new audio sprite sound instance. + */ addAudioSprite: function (key, config) { var sound = this.add(key, config); @@ -169298,42 +170325,260 @@ var NoAudioSoundManager = new Class({ return sound; }, + /** + * Gets the first sound in the manager matching the given key, if any. + * + * @method Phaser.Sound.NoAudioSoundManager#get + * @since 3.23.0 + * + * @param {string} key - Sound asset key. + * + * @return {?Phaser.Sound.BaseSound} - The sound, or null. + */ + get: function (key) + { + return BaseSoundManager.prototype.get.call(this, key); + }, + + /** + * Gets any sounds in the manager matching the given key. + * + * @method Phaser.Sound.NoAudioSoundManager#getAll + * @since 3.23.0 + * + * @param {string} key - Sound asset key. + * + * @return {Phaser.Sound.BaseSound[]} - The sounds, or an empty array. + */ + getAll: function (key) + { + return BaseSoundManager.prototype.getAll.call(this, key); + }, + + /** + * This method does nothing but return 'false' for the No Audio Sound Manager, to maintain + * compatibility with the other Sound Managers. + * + * @method Phaser.Sound.NoAudioSoundManager#play + * @since 3.0.0 + * + * @param {string} key - Asset key for the sound. + * @param {(Phaser.Types.Sound.SoundConfig|Phaser.Types.Sound.SoundMarker)} [extra] - An optional additional object containing settings to be applied to the sound. It could be either config or marker object. + * + * @return {boolean} Always 'false' for the No Audio Sound Manager. + */ // eslint-disable-next-line no-unused-vars play: function (key, extra) { return false; }, + /** + * This method does nothing but return 'false' for the No Audio Sound Manager, to maintain + * compatibility with the other Sound Managers. + * + * @method Phaser.Sound.NoAudioSoundManager#playAudioSprite + * @since 3.0.0 + * + * @param {string} key - Asset key for the sound. + * @param {string} spriteName - The name of the sound sprite to play. + * @param {Phaser.Types.Sound.SoundConfig} [config] - An optional config object containing default sound settings. + * + * @return {boolean} Always 'false' for the No Audio Sound Manager. + */ // eslint-disable-next-line no-unused-vars playAudioSprite: function (key, spriteName, config) { return false; }, + /** + * Removes a sound from the sound manager. + * The removed sound is destroyed before removal. + * + * @method Phaser.Sound.NoAudioSoundManager#remove + * @since 3.0.0 + * + * @param {Phaser.Sound.BaseSound} sound - The sound object to remove. + * + * @return {boolean} True if the sound was removed successfully, otherwise false. + */ remove: function (sound) { return BaseSoundManager.prototype.remove.call(this, sound); }, + /** + * Removes all sounds from the manager, destroying the sounds. + * + * @method Phaser.Sound.NoAudioSoundManager#removeAll + * @since 3.23.0 + */ + removeAll: function () + { + return BaseSoundManager.prototype.removeAll.call(this); + }, + + /** + * Removes all sounds from the sound manager that have an asset key matching the given value. + * The removed sounds are destroyed before removal. + * + * @method Phaser.Sound.NoAudioSoundManager#removeByKey + * @since 3.0.0 + * + * @param {string} key - The key to match when removing sound objects. + * + * @return {number} The number of matching sound objects that were removed. + */ removeByKey: function (key) { return BaseSoundManager.prototype.removeByKey.call(this, key); }, + /** + * Stops any sounds matching the given key. + * + * @method Phaser.Sound.NoAudioSoundManager#stopByKey + * @since 3.23.0 + * + * @param {string} key - Sound asset key. + * + * @return {number} - How many sounds were stopped. + */ + stopByKey: function (key) + { + return BaseSoundManager.prototype.stopByKey.call(this, key); + }, + + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#onBlur + * @since 3.0.0 + */ + onBlur: NOOP, + + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#onFocus + * @since 3.0.0 + */ + onFocus: NOOP, + + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#onGameBlur + * @since 3.0.0 + */ + onGameBlur: NOOP, + + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#onGameFocus + * @since 3.0.0 + */ + onGameFocus: NOOP, + + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#pauseAll + * @since 3.0.0 + */ pauseAll: NOOP, + + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#resumeAll + * @since 3.0.0 + */ resumeAll: NOOP, + + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#stopAll + * @since 3.0.0 + */ stopAll: NOOP, + + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#update + * @since 3.0.0 + */ update: NOOP, + + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#setRate + * @since 3.0.0 + * + * @return {this} This Sound Manager. + */ setRate: NOOP, + + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#setDetune + * @since 3.0.0 + * + * @return {this} This Sound Manager. + */ setDetune: NOOP, + + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#setMute + * @since 3.0.0 + */ setMute: NOOP, + + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#setVolume + * @since 3.0.0 + */ setVolume: NOOP, + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#unlock + * @since 3.0.0 + */ + unlock: NOOP, + + /** + * Method used internally for iterating only over active sounds and skipping sounds that are marked for removal. + * + * @method Phaser.Sound.NoAudioSoundManager#forEachActiveSound + * @private + * @since 3.0.0 + * + * @param {Phaser.Types.Sound.EachActiveSoundCallback} callback - Callback function. (manager: Phaser.Sound.BaseSoundManager, sound: Phaser.Sound.BaseSound, index: number, sounds: Phaser.Manager.BaseSound[]) => void + * @param {*} [scope] - Callback context. + */ forEachActiveSound: function (callbackfn, scope) { BaseSoundManager.prototype.forEachActiveSound.call(this, callbackfn, scope); }, + /** + * Destroys all the sounds in the game and all associated events. + * + * @method Phaser.Sound.NoAudioSoundManager#destroy + * @since 3.0.0 + */ destroy: function () { BaseSoundManager.prototype.destroy.call(this); @@ -169352,7 +170597,7 @@ module.exports = NoAudioSoundManager; /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -169450,11 +170695,13 @@ var WebAudioSound = new Class({ /** * The time at which the sound should have started playback from the beginning. - * Based on BaseAudioContext.currentTime value. + * + * Treat this property as read-only. + * + * Based on `BaseAudioContext.currentTime` value. * * @name Phaser.Sound.WebAudioSound#playTime * @type {number} - * @private * @default 0 * @since 3.0.0 */ @@ -169462,11 +170709,13 @@ var WebAudioSound = new Class({ /** * The time at which the sound source should have actually started playback. - * Based on BaseAudioContext.currentTime value. + * + * Treat this property as read-only. + * + * Based on `BaseAudioContext.currentTime` value. * * @name Phaser.Sound.WebAudioSound#startTime * @type {number} - * @private * @default 0 * @since 3.0.0 */ @@ -169474,11 +170723,11 @@ var WebAudioSound = new Class({ /** * The time at which the sound loop source should actually start playback. - * Based on BaseAudioContext.currentTime value. + * + * Based on `BaseAudioContext.currentTime` value. * * @name Phaser.Sound.WebAudioSound#loopTime * @type {number} - * @private * @default 0 * @since 3.0.0 */ @@ -169486,11 +170735,13 @@ var WebAudioSound = new Class({ /** * An array where we keep track of all rate updates during playback. - * Array of object types: { time: number, rate: number } + * + * Treat this property as read-only. + * + * Array of object types: `{ time: number, rate: number }` * * @name Phaser.Sound.WebAudioSound#rateUpdates * @type {array} - * @private * @default [] * @since 3.0.0 */ @@ -169683,10 +170934,9 @@ var WebAudioSound = new Class({ }, /** - * Used internally. + * This method is only used internally and it creates a looping buffer source. * * @method Phaser.Sound.WebAudioSound#createAndStartLoopBufferSource - * @private * @since 3.0.0 */ createAndStartLoopBufferSource: function () @@ -169702,10 +170952,9 @@ var WebAudioSound = new Class({ }, /** - * Used internally. + * This method is only used internally and it creates a buffer source. * * @method Phaser.Sound.WebAudioSound#createBufferSource - * @private * @since 3.0.0 * * @return {AudioBufferSourceNode} @@ -169741,10 +170990,9 @@ var WebAudioSound = new Class({ }, /** - * Used internally. + * This method is only used internally and it stops and removes a buffer source. * * @method Phaser.Sound.WebAudioSound#stopAndRemoveBufferSource - * @private * @since 3.0.0 */ stopAndRemoveBufferSource: function () @@ -169763,10 +171011,9 @@ var WebAudioSound = new Class({ }, /** - * Used internally. + * This method is only used internally and it stops and removes a looping buffer source. * * @method Phaser.Sound.WebAudioSound#stopAndRemoveLoopBufferSource - * @private * @since 3.0.0 */ stopAndRemoveLoopBufferSource: function () @@ -169785,7 +171032,6 @@ var WebAudioSound = new Class({ * Method used internally for applying config values to some of the sound properties. * * @method Phaser.Sound.WebAudioSound#applyConfig - * @protected * @since 3.0.0 */ applyConfig: function () @@ -169806,7 +171052,6 @@ var WebAudioSound = new Class({ * @method Phaser.Sound.WebAudioSound#update * @fires Phaser.Sound.Events#COMPLETE * @fires Phaser.Sound.Events#LOOPED - * @protected * @since 3.0.0 */ update: function () @@ -169849,6 +171094,11 @@ var WebAudioSound = new Class({ */ destroy: function () { + if (this.pendingRemove) + { + return; + } + BaseSound.prototype.destroy.call(this); this.audioBuffer = null; @@ -169872,7 +171122,6 @@ var WebAudioSound = new Class({ * Method used internally to calculate total playback rate of the sound. * * @method Phaser.Sound.WebAudioSound#calculateRate - * @protected * @since 3.0.0 */ calculateRate: function () @@ -169905,7 +171154,6 @@ var WebAudioSound = new Class({ * Method used internally for calculating current playback time of a playing sound. * * @method Phaser.Sound.WebAudioSound#getCurrentTime - * @private * @since 3.0.0 */ getCurrentTime: function () @@ -169936,7 +171184,6 @@ var WebAudioSound = new Class({ * at witch the loop source should start playing. * * @method Phaser.Sound.WebAudioSound#getLoopTime - * @private * @since 3.0.0 */ getLoopTime: function () @@ -170337,7 +171584,7 @@ module.exports = WebAudioSound; /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -170836,7 +172083,7 @@ module.exports = WebAudioSoundManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -171685,7 +172932,7 @@ module.exports = List; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -172061,7 +173308,7 @@ module.exports = Map; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -172160,6 +173407,60 @@ var ProcessQueue = new Class({ this.checkQueue = false; }, + /** + * Checks the given item to see if it is already active within this Process Queue. + * + * @method Phaser.Structs.ProcessQueue#isActive + * @since 3.60.0 + * + * @genericUse {T} - [item] + * @genericUse {Phaser.Structs.ProcessQueue.} - [$return] + * + * @param {*} item - The item to check. + * + * @return {boolean} `true` if the item is active, otherwise `false`. + */ + isActive: function (item) + { + return (this._active.indexOf(item) > -1); + }, + + /** + * Checks the given item to see if it is already pending addition to this Process Queue. + * + * @method Phaser.Structs.ProcessQueue#isPending + * @since 3.60.0 + * + * @genericUse {T} - [item] + * @genericUse {Phaser.Structs.ProcessQueue.} - [$return] + * + * @param {*} item - The item to check. + * + * @return {boolean} `true` if the item is pending insertion, otherwise `false`. + */ + isPending: function (item) + { + return (this._toProcess > 0 && this._pending.indexOf(item) > -1); + }, + + /** + * Checks the given item to see if it is already pending destruction from this Process Queue. + * + * @method Phaser.Structs.ProcessQueue#isDestroying + * @since 3.60.0 + * + * @genericUse {T} - [item] + * @genericUse {Phaser.Structs.ProcessQueue.} - [$return] + * + * @param {*} item - The item to check. + * + * @return {boolean} `true` if the item is pending destruction, otherwise `false`. + */ + isDestroying: function (item) + { + return (this._destroy.indexOf(item) > -1); + }, + /** * Adds a new item to the Process Queue. * @@ -172177,6 +173478,12 @@ var ProcessQueue = new Class({ */ add: function (item) { + // Don't add if already active or pending + if (this.checkQueue && (this.isActive(item) || this.isPending(item))) + { + return item; + } + this._pending.push(item); this._toProcess++; @@ -172187,7 +173494,7 @@ var ProcessQueue = new Class({ /** * Removes an item from the Process Queue. * - * The item is added to the pending destroy and fully removed in the next update. + * The item is added to the 'destroy' list and is fully removed in the next update. * * @method Phaser.Structs.ProcessQueue#remove * @since 3.0.0 @@ -172201,9 +173508,29 @@ var ProcessQueue = new Class({ */ remove: function (item) { - this._destroy.push(item); + // Check if it's in the _pending list + if (this.isPending(item)) + { + var pending = this._pending; - this._toProcess++; + var idx = pending.indexOf(item); + + if (idx !== -1) + { + // Remove directly, no need to wait for an update loop + pending.splice(idx, 1); + } + } + else if (this.isActive(item)) + { + // Item is actively running? Queue it for deletion + this._destroy.push(item); + + this._toProcess++; + } + + // If neither of the above conditions pass, then the item is either already in the destroy list, + // or isn't pending or active, so cannot be removed anyway return item; }, @@ -172366,7 +173693,7 @@ module.exports = ProcessQueue; /** * @author Vladimir Agafonkin * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -172382,7 +173709,7 @@ var quickselect = __webpack_require__(53466); * * This version of RBush uses a fixed min/max accessor structure of `[ '.left', '.top', '.right', '.bottom' ]`. * This is to avoid the eval like function creation that the original library used, which caused CSP policy violations. - * + * * rbush is forked from https://github.com/mourner/rbush by Vladimir Agafonkin * * @class RTree @@ -172970,6 +174297,7 @@ function multiSelect (arr, left, right, n, compare) module.exports = rbush; + /***/ }), /***/ 58403: @@ -172977,7 +174305,7 @@ module.exports = rbush; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -173427,7 +174755,7 @@ module.exports = Set; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -173439,7 +174767,7 @@ var Vector2 = __webpack_require__(93736); /** * @classdesc * The Size component allows you to set `width` and `height` properties and define the relationship between them. - * + * * The component can automatically maintain the aspect ratios between the two values, and clamp them * to a defined min-max range. You can also control the dominant axis. When dimensions are given to the Size component * that would cause it to exceed its min-max range, the dimensions are adjusted based on the dominant axis. @@ -173508,7 +174836,7 @@ var Size = new Class({ /** * The proportional relationship between the width and height. - * + * * This property is read-only and is updated automatically when either the `width` or `height` properties are changed, * depending on the aspect mode. * @@ -173567,9 +174895,9 @@ var Size = new Class({ /** * A Vector2 containing the horizontal and vertical snap values, which the width and height are snapped to during resizing. - * + * * By default this is disabled. - * + * * This property is read-only. To change it see the `setSnap` method. * * @name Phaser.Structs.Size#snapTo @@ -173582,19 +174910,19 @@ var Size = new Class({ /** * Sets the aspect mode of this Size component. - * + * * The aspect mode controls what happens when you modify the `width` or `height` properties, or call `setSize`. - * + * * It can be a number from 0 to 4, or a Size constant: - * + * * 0. NONE = Do not make the size fit the aspect ratio. Change the ratio when the size changes. * 1. WIDTH_CONTROLS_HEIGHT = The height is automatically adjusted based on the width. * 2. HEIGHT_CONTROLS_WIDTH = The width is automatically adjusted based on the height. * 3. FIT = The width and height are automatically adjusted to fit inside the given target area, while keeping the aspect ratio. Depending on the aspect ratio there may be some space inside the area which is not covered. * 4. ENVELOP = The width and height are automatically adjusted to make the size cover the entire target area while keeping the aspect ratio. This may extend further out than the target size. - * + * * Calling this method automatically recalculates the `width` and the `height`, if required. - * + * * @method Phaser.Structs.Size#setAspectMode * @since 3.16.0 * @@ -173615,14 +174943,14 @@ var Size = new Class({ * By setting a Snap To value when this Size component is modified its dimensions will automatically * by snapped to the nearest grid slice, using floor. For example, if you have snap value of 16, * and the width changes to 68, then it will snap down to 64 (the closest multiple of 16 when floored) - * + * * Note that snapping takes place before adjustments by the parent, or the min / max settings. If these * values are not multiples of the given snap values, then this can result in un-snapped dimensions. - * + * * Call this method with no arguments to reset the snap values. - * + * * Calling this method automatically recalculates the `width` and the `height`, if required. - * + * * @method Phaser.Structs.Size#setSnap * @since 3.16.0 * @@ -173643,18 +174971,18 @@ var Size = new Class({ /** * Sets, or clears, the parent of this Size component. - * + * * To clear the parent call this method with no arguments. - * + * * The parent influences the maximum extents to which this Size component can expand, * based on the aspect mode: - * + * * NONE - The parent clamps both the width and height. * WIDTH_CONTROLS_HEIGHT - The parent clamps just the width. * HEIGHT_CONTROLS_WIDTH - The parent clamps just the height. * FIT - The parent clamps whichever axis is required to ensure the size fits within it. * ENVELOP - The parent is used to ensure the size fully envelops the parent. - * + * * Calling this method automatically calls `setSize`. * * @method Phaser.Structs.Size#setParent @@ -173673,11 +175001,11 @@ var Size = new Class({ /** * Set the minimum width and height values this Size component will allow. - * + * * The minimum values can never be below zero, or greater than the maximum values. - * + * * Setting this will automatically adjust both the `width` and `height` properties to ensure they are within range. - * + * * Note that based on the aspect mode, and if this Size component has a parent set or not, the minimums set here * _can_ be exceed in some situations. * @@ -173702,9 +175030,9 @@ var Size = new Class({ /** * Set the maximum width and height values this Size component will allow. - * + * * Setting this will automatically adjust both the `width` and `height` properties to ensure they are within range. - * + * * Note that based on the aspect mode, and if this Size component has a parent set or not, the maximums set here * _can_ be exceed in some situations. * @@ -173729,16 +175057,16 @@ var Size = new Class({ /** * Sets the width and height of this Size component based on the aspect mode. - * + * * If the aspect mode is 'none' then calling this method will change the aspect ratio, otherwise the current * aspect ratio is honored across all other modes. - * + * * If snapTo values have been set then the given width and height are snapped first, prior to any further * adjustment via min/max values, or a parent. - * + * * If minimum and/or maximum dimensions have been specified, the values given to this method will be clamped into * that range prior to adjustment, but may still exceed them depending on the aspect mode. - * + * * If this Size component has a parent set, and the aspect mode is `fit` or `envelop`, then the given sizes will * be clamped to the range specified by the parent. * @@ -173754,7 +175082,7 @@ var Size = new Class({ { if (width === undefined) { width = 0; } if (height === undefined) { height = width; } - + switch (this.aspectMode) { case Size.NONE: @@ -173787,7 +175115,7 @@ var Size = new Class({ /** * Sets a new aspect ratio, overriding what was there previously. - * + * * It then calls `setSize` immediately using the current dimensions. * * @method Phaser.Structs.Size#setAspectRatio @@ -173806,7 +175134,7 @@ var Size = new Class({ /** * Sets a new width and height for this Size component and updates the aspect ratio based on them. - * + * * It _doesn't_ change the `aspectMode` and still factors in size limits such as the min max and parent bounds. * * @method Phaser.Structs.Size#resize @@ -173840,7 +175168,7 @@ var Size = new Class({ getNewWidth: function (value, checkParent) { if (checkParent === undefined) { checkParent = true; } - + value = Clamp(value, this.minWidth, this.maxWidth); if (checkParent && this._parent && value > this._parent.width) @@ -173878,10 +175206,10 @@ var Size = new Class({ /** * The current `width` and `height` are adjusted to fit inside the given dimensions, while keeping the aspect ratio. - * + * * If `fit` is true there may be some space inside the target area which is not covered if its aspect ratio differs. * If `fit` is false the size may extend further out than the target area if the aspect ratios differ. - * + * * If this Size component has a parent set, then the width and height passed to this method will be clamped so * it cannot exceed that of the parent. * @@ -173947,9 +175275,9 @@ var Size = new Class({ /** * The current `width` and `height` are adjusted to fit inside the given dimensions, while keeping the aspect ratio. - * + * * There may be some space inside the target area which is not covered if its aspect ratio differs. - * + * * If this Size component has a parent set, then the width and height passed to this method will be clamped so * it cannot exceed that of the parent. * @@ -173968,9 +175296,9 @@ var Size = new Class({ /** * The current `width` and `height` are adjusted so that they fully envelope the given dimensions, while keeping the aspect ratio. - * + * * The size may extend further out than the target area if the aspect ratios differ. - * + * * If this Size component has a parent set, then the values are clamped so that it never exceeds the parent * on the longest axis. * @@ -173989,7 +175317,7 @@ var Size = new Class({ /** * Sets the width of this Size component. - * + * * Depending on the aspect mode, changing the width may also update the height and aspect ratio. * * @method Phaser.Structs.Size#setWidth @@ -174006,7 +175334,7 @@ var Size = new Class({ /** * Sets the height of this Size component. - * + * * Depending on the aspect mode, changing the height may also update the width and aspect ratio. * * @method Phaser.Structs.Size#setHeight @@ -174058,7 +175386,7 @@ var Size = new Class({ * * @method Phaser.Structs.Size#copy * @since 3.16.0 - * + * * @param {Phaser.Structs.Size} destination - The Size component to copy the values to. * * @return {Phaser.Structs.Size} The updated destination Size component. @@ -174074,9 +175402,9 @@ var Size = new Class({ /** * Destroys this Size component. - * + * * This clears the local properties and any parent object, if set. - * + * * A destroyed Size component cannot be re-used. * * @method Phaser.Structs.Size#destroy @@ -174090,11 +175418,11 @@ var Size = new Class({ /** * The width of this Size component. - * + * * This value is clamped to the range specified by `minWidth` and `maxWidth`, if enabled. - * + * * A width can never be less than zero. - * + * * Changing this value will automatically update the `height` if the aspect ratio lock is enabled. * You can also use the `setWidth` and `getWidth` methods. * @@ -174118,11 +175446,11 @@ var Size = new Class({ /** * The height of this Size component. - * + * * This value is clamped to the range specified by `minHeight` and `maxHeight`, if enabled. - * + * * A height can never be less than zero. - * + * * Changing this value will automatically update the `width` if the aspect ratio lock is enabled. * You can also use the `setHeight` and `getHeight` methods. * @@ -174148,7 +175476,7 @@ var Size = new Class({ /** * Do not make the size fit the aspect ratio. Change the ratio when the size changes. - * + * * @name Phaser.Structs.Size.NONE * @constant * @type {number} @@ -174158,7 +175486,7 @@ Size.NONE = 0; /** * The height is automatically adjusted based on the width. - * + * * @name Phaser.Structs.Size.WIDTH_CONTROLS_HEIGHT * @constant * @type {number} @@ -174168,7 +175496,7 @@ Size.WIDTH_CONTROLS_HEIGHT = 1; /** * The width is automatically adjusted based on the height. - * + * * @name Phaser.Structs.Size.HEIGHT_CONTROLS_WIDTH * @constant * @type {number} @@ -174178,7 +175506,7 @@ Size.HEIGHT_CONTROLS_WIDTH = 2; /** * The width and height are automatically adjusted to fit inside the given target area, while keeping the aspect ratio. Depending on the aspect ratio there may be some space inside the area which is not covered. - * + * * @name Phaser.Structs.Size.FIT * @constant * @type {number} @@ -174188,7 +175516,7 @@ Size.FIT = 3; /** * The width and height are automatically adjusted to make the size cover the entire target area while keeping the aspect ratio. This may extend further out than the target size. - * + * * @name Phaser.Structs.Size.ENVELOP * @constant * @type {number} @@ -174206,22 +175534,22 @@ module.exports = Size; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Process Queue Add Event. - * + * * This event is dispatched by a Process Queue when a new item is successfully moved to its active list. - * + * * You will most commonly see this used by a Scene's Update List when a new Game Object has been added. - * + * * In that instance, listen to this event from within a Scene using: `this.sys.updateList.on('add', listener)`. * * @event Phaser.Structs.Events#PROCESS_QUEUE_ADD * @since 3.20.0 - * + * * @param {*} item - The item that was added to the Process Queue. */ module.exports = 'add'; @@ -174234,22 +175562,22 @@ module.exports = 'add'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Process Queue Remove Event. - * + * * This event is dispatched by a Process Queue when a new item is successfully removed from its active list. - * + * * You will most commonly see this used by a Scene's Update List when a Game Object has been removed. - * + * * In that instance, listen to this event from within a Scene using: `this.sys.updateList.on('remove', listener)`. * * @event Phaser.Structs.Events#PROCESS_QUEUE_REMOVE * @since 3.20.0 - * + * * @param {*} item - The item that was removed from the Process Queue. */ module.exports = 'remove'; @@ -174262,7 +175590,7 @@ module.exports = 'remove'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -174285,7 +175613,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -174313,7 +175641,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -174949,7 +176277,7 @@ module.exports = CanvasTexture; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -175807,7 +177135,7 @@ module.exports = Frame; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -176336,7 +177664,7 @@ module.exports = Texture; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -176424,7 +177752,7 @@ var TextureManager = new Class({ * @private * @since 3.0.0 */ - this._tempCanvas = CanvasPool.create2D(this, 1, 1); + this._tempCanvas = CanvasPool.create2D(this); /** * The context of the temporary canvas element made to save an pixel data in getPixel() and getPixelAlpha() method. @@ -176434,7 +177762,7 @@ var TextureManager = new Class({ * @private * @since 3.0.0 */ - this._tempContext = this._tempCanvas.getContext('2d'); + this._tempContext = this._tempCanvas.getContext('2d', { willReadFrequently: true }); /** * An counting value used for emitting 'ready' event after all of managers in game is loaded. @@ -176495,6 +177823,7 @@ var TextureManager = new Class({ /** * Checks the given texture key and throws a console.warn if the key is already in use, then returns false. + * * If you wish to avoid the console.warn then use `TextureManager.exists` instead. * * @method Phaser.Textures.TextureManager#checkKey @@ -176555,6 +177884,7 @@ var TextureManager = new Class({ key.destroy(); this.emit(Events.REMOVE, key.key); + this.emit(Events.REMOVE_KEY + key.key); } return this; @@ -176618,7 +177948,7 @@ var TextureManager = new Class({ Parser.Image(texture, 0); _this.emit(Events.ADD, key, texture); - + _this.emit(Events.ADD_KEY + key, texture); _this.emit(Events.LOAD, key, texture); }; @@ -176667,17 +177997,20 @@ var TextureManager = new Class({ var canvas = CanvasPool.create2D(this, cd.width, cd.height); var ctx = canvas.getContext('2d'); - ctx.drawImage( - textureFrame.source.image, - cd.x, - cd.y, - cd.width, - cd.height, - 0, - 0, - cd.width, - cd.height - ); + if (cd.width > 0 && cd.height > 0) + { + ctx.drawImage( + textureFrame.source.image, + cd.x, + cd.y, + cd.width, + cd.height, + 0, + 0, + cd.width, + cd.height + ); + } data = canvas.toDataURL(type, encoderOptions); @@ -176716,6 +178049,7 @@ var TextureManager = new Class({ } this.emit(Events.ADD, key, texture); + this.emit(Events.ADD_KEY + key, texture); } return texture; @@ -176756,6 +178090,7 @@ var TextureManager = new Class({ texture.add('__BASE', 0, 0, 0, width, height); this.emit(Events.ADD, key, texture); + this.emit(Events.ADD_KEY + key, texture); } return texture; @@ -176806,6 +178141,7 @@ var TextureManager = new Class({ } this.emit(Events.ADD, key, texture); + this.emit(Events.ADD_KEY + key, texture); } return texture; @@ -176835,6 +178171,7 @@ var TextureManager = new Class({ texture.add('__BASE', 0, 0, 0, renderTexture.width, renderTexture.height); this.emit(Events.ADD, key, texture); + this.emit(Events.ADD_KEY + key, texture); } return texture; @@ -176962,6 +178299,7 @@ var TextureManager = new Class({ this.list[key] = texture; this.emit(Events.ADD, key, texture); + this.emit(Events.ADD_KEY + key, texture); } return texture; @@ -177042,6 +178380,7 @@ var TextureManager = new Class({ } this.emit(Events.ADD, key, texture); + this.emit(Events.ADD_KEY + key, texture); } return texture; @@ -177089,6 +178428,7 @@ var TextureManager = new Class({ } this.emit(Events.ADD, key, texture); + this.emit(Events.ADD_KEY + key, texture); } return texture; @@ -177125,6 +178465,7 @@ var TextureManager = new Class({ } this.emit(Events.ADD, key, texture); + this.emit(Events.ADD_KEY + key, texture); } return texture; @@ -177161,6 +178502,7 @@ var TextureManager = new Class({ } this.emit(Events.ADD, key, texture); + this.emit(Events.ADD_KEY + key, texture); } return texture; @@ -177170,32 +178512,45 @@ var TextureManager = new Class({ * Adds a Sprite Sheet to this Texture Manager. * * In Phaser terminology a Sprite Sheet is a texture containing different frames, but each frame is the exact - * same size and cannot be trimmed or rotated. + * same size and cannot be trimmed or rotated. This is different to a Texture Atlas, created by tools such as + * Texture Packer, and more akin with the fixed-frame exports you get from apps like Aseprite or old arcade + * games. + * + * As of Phaser 3.60 you can use this method to add a sprite sheet to an existing Phaser Texture. * * @method Phaser.Textures.TextureManager#addSpriteSheet * @fires Phaser.Textures.Events#ADD * @since 3.0.0 * - * @param {string} key - The unique string-based key of the Texture. - * @param {HTMLImageElement} source - The source Image element. + * @param {string} key - The unique string-based key of the Texture. Give an empty string if you provide a Phaser Texture as the 2nd argument. + * @param {(HTMLImageElement|Phaser.Textures.Texture)} source - The source Image element, or a Phaser Texture. * @param {Phaser.Types.Textures.SpriteSheetConfig} config - The configuration object for this Sprite Sheet. * - * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use. + * @return {?Phaser.Textures.Texture} The Texture that was created or updated, or `null` if the key is already in use. */ addSpriteSheet: function (key, source, config) { var texture = null; - if (this.checkKey(key)) + if (source instanceof Texture) + { + key = texture.key; + texture = source; + } + else if (this.checkKey(key)) { texture = this.create(key, source); + } + if (texture) + { var width = texture.source[0].width; var height = texture.source[0].height; Parser.SpriteSheet(texture, 0, 0, 0, width, height, config); this.emit(Events.ADD, key, texture); + this.emit(Events.ADD_KEY + key, texture); } return texture; @@ -177249,6 +178604,7 @@ var TextureManager = new Class({ } this.emit(Events.ADD, key, texture); + this.emit(Events.ADD_KEY + key, texture); return texture; } @@ -177370,7 +178726,7 @@ var TextureManager = new Class({ /** * Returns an array with all of the keys of all Textures in this Texture Manager. - * The output array will exclude the `__DEFAULT` and `__MISSING` keys. + * The output array will exclude the `__DEFAULT`, `__MISSING`, and `__WHITE` keys. * * @method Phaser.Textures.TextureManager#getTextureKeys * @since 3.0.0 @@ -177383,7 +178739,7 @@ var TextureManager = new Class({ for (var key in this.list) { - if (key !== '__DEFAULT' && key !== '__MISSING') + if (key !== '__DEFAULT' && key !== '__MISSING' && key !== '__WHITE') { output.push(key); } @@ -177602,7 +178958,7 @@ module.exports = TextureManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -177976,7 +179332,7 @@ module.exports = TextureSource; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -177991,7 +179347,7 @@ var CONST = { /** * Linear filter type. - * + * * @name Phaser.Textures.FilterMode.LINEAR * @type {number} * @const @@ -178001,14 +179357,14 @@ var CONST = { /** * Nearest neighbor filter type. - * + * * @name Phaser.Textures.FilterMode.NEAREST * @type {number} * @const * @since 3.0.0 */ NEAREST: 1 - + }; module.exports = CONST; @@ -178021,26 +179377,52 @@ module.exports = CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Texture Add Event. - * + * * This event is dispatched by the Texture Manager when a texture is added to it. - * + * * Listen to this event from within a Scene using: `this.textures.on('addtexture', listener)`. * * @event Phaser.Textures.Events#ADD * @since 3.0.0 - * + * * @param {string} key - The key of the Texture that was added to the Texture Manager. * @param {Phaser.Textures.Texture} texture - A reference to the Texture that was added to the Texture Manager. */ module.exports = 'addtexture'; +/***/ }), + +/***/ 29569: +/***/ ((module) => { + +/** + * @author samme + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Texture Add Key Event. + * + * This event is dispatched by the Texture Manager when a texture with the given key is added to it. + * + * Listen to this event from within a Scene using: `this.textures.on('addtexture-key', listener)`. + * + * @event Phaser.Textures.Events#ADD_KEY + * @since 3.60.0 + * + * @param {Phaser.Textures.Texture} texture - A reference to the Texture that was added to the Texture Manager. + */ +module.exports = 'addtexture-'; + + /***/ }), /***/ 60079: @@ -178048,21 +179430,21 @@ module.exports = 'addtexture'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Texture Load Error Event. - * + * * This event is dispatched by the Texture Manager when a texture it requested to load failed. * This only happens when base64 encoded textures fail. All other texture types are loaded via the Loader Plugin. - * + * * Listen to this event from within a Scene using: `this.textures.on('onerror', listener)`. * * @event Phaser.Textures.Events#ERROR * @since 3.0.0 - * + * * @param {string} key - The key of the Texture that failed to load into the Texture Manager. */ module.exports = 'onerror'; @@ -178075,23 +179457,23 @@ module.exports = 'onerror'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Texture Load Event. - * + * * This event is dispatched by the Texture Manager when a texture has finished loading on it. * This only happens for base64 encoded textures. All other texture types are loaded via the Loader Plugin. - * + * * Listen to this event from within a Scene using: `this.textures.on('onload', listener)`. - * + * * This event is dispatched after the [ADD]{@linkcode Phaser.Textures.Events#event:ADD} event. * * @event Phaser.Textures.Events#LOAD * @since 3.0.0 - * + * * @param {string} key - The key of the Texture that was loaded by the Texture Manager. * @param {Phaser.Textures.Texture} texture - A reference to the Texture that was loaded by the Texture Manager. */ @@ -178105,13 +179487,13 @@ module.exports = 'onload'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * This internal event signifies that the Texture Manager is now ready and the Game can continue booting. - * + * * When a Phaser Game instance is booting for the first time, the Texture Manager has to wait on a couple of non-blocking * async events before it's fully ready to carry on. When those complete the Texture Manager emits this event via the Game * instance, which tells the Game to carry on booting. @@ -178129,28 +179511,55 @@ module.exports = 'ready'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Texture Remove Event. - * + * * This event is dispatched by the Texture Manager when a texture is removed from it. - * + * * Listen to this event from within a Scene using: `this.textures.on('removetexture', listener)`. - * + * * If you have any Game Objects still using the removed texture, they will start throwing * errors the next time they try to render. Be sure to clear all use of the texture in this event handler. * * @event Phaser.Textures.Events#REMOVE * @since 3.0.0 - * + * * @param {string} key - The key of the Texture that was removed from the Texture Manager. */ module.exports = 'removetexture'; +/***/ }), + +/***/ 85549: +/***/ ((module) => { + +/** + * @author samme + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Texture Remove Key Event. + * + * This event is dispatched by the Texture Manager when a texture with the given key is removed from it. + * + * Listen to this event from within a Scene using: `this.textures.on('removetexture-key', listener)`. + * + * If you have any Game Objects still using the removed texture, they will start throwing + * errors the next time they try to render. Be sure to clear all use of the texture in this event handler. + * + * @event Phaser.Textures.Events#REMOVE_KEY + * @since 3.60.0 + */ +module.exports = 'removetexture-'; + + /***/ }), /***/ 38203: @@ -178158,7 +179567,7 @@ module.exports = 'removetexture'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -178169,10 +179578,12 @@ module.exports = 'removetexture'; module.exports = { ADD: __webpack_require__(49644), + ADD_KEY: __webpack_require__(29569), ERROR: __webpack_require__(60079), LOAD: __webpack_require__(72665), READY: __webpack_require__(93006), - REMOVE: __webpack_require__(69018) + REMOVE: __webpack_require__(69018), + REMOVE_KEY: __webpack_require__(85549) }; @@ -178184,7 +179595,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -178197,7 +179608,7 @@ var FilterMode = __webpack_require__(65154); /** * Linear filter type. - * + * * @name Phaser.Textures.LINEAR * @type {number} * @const @@ -178206,7 +179617,7 @@ var FilterMode = __webpack_require__(65154); /** * Nearest Neighbor filter type. - * + * * @name Phaser.Textures.NEAREST * @type {number} * @const @@ -178238,7 +179649,7 @@ module.exports = Textures; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -178320,7 +179731,7 @@ module.exports = AtlasXML; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -178356,7 +179767,7 @@ module.exports = Canvas; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -178392,7 +179803,7 @@ module.exports = Image; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -178439,6 +179850,13 @@ var JSONArray = function (texture, sourceIndex, json) // The frame values are the exact coordinates to cut the frame out of the atlas from newFrame = texture.add(src.filename, sourceIndex, src.frame.x, src.frame.y, src.frame.w, src.frame.h); + if (!newFrame) + { + console.warn('Invalid atlas json, frame already exists: ' + src.filename); + + continue; + } + // These are the original (non-trimmed) sprite values if (src.trimmed) { @@ -178502,7 +179920,7 @@ module.exports = JSONArray; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -178553,6 +179971,13 @@ var JSONHash = function (texture, sourceIndex, json) // The frame values are the exact coordinates to cut the frame out of the atlas from newFrame = texture.add(key, sourceIndex, src.frame.x, src.frame.y, src.frame.w, src.frame.h); + if (!newFrame) + { + console.warn('Invalid atlas json, frame already exists: ' + key); + + continue; + } + // These are the original (non-trimmed) sprite values if (src.trimmed) { @@ -179015,7 +180440,7 @@ module.exports = PVRParser; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -179141,7 +180566,7 @@ module.exports = SpriteSheet; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -179333,7 +180758,7 @@ module.exports = SpriteSheetFromAtlas; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -179504,7 +180929,7 @@ TextureImporter: /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -179535,7 +180960,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -179547,7 +180972,7 @@ module.exports = { /** * CSV Map Type - * + * * @name Phaser.Tilemaps.Formats.CSV * @type {number} * @since 3.0.0 @@ -179556,7 +180981,7 @@ module.exports = { /** * Tiled JSON Map Type - * + * * @name Phaser.Tilemaps.Formats.TILED_JSON * @type {number} * @since 3.0.0 @@ -179565,7 +180990,7 @@ module.exports = { /** * 2D Array Map Type - * + * * @name Phaser.Tilemaps.Formats.ARRAY_2D * @type {number} * @since 3.0.0 @@ -179574,7 +180999,7 @@ module.exports = { /** * Weltmeister (Impact.js) Map Type - * + * * @name Phaser.Tilemaps.Formats.WELTMEISTER * @type {number} * @since 3.0.0 @@ -179591,7 +181016,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -179607,7 +181032,7 @@ var Class = __webpack_require__(56694); * @memberof Phaser.Tilemaps * @constructor * @since 3.0.0 - * + * * @param {string} name - The name of the image collection in the map data. * @param {number} firstgid - The first image index this image collection contains. * @param {number} [width=32] - Width of widest image (in pixels). @@ -179629,7 +181054,7 @@ var ImageCollection = new Class({ /** * The name of the Image Collection. - * + * * @name Phaser.Tilemaps.ImageCollection#name * @type {string} * @since 3.0.0 @@ -179639,7 +181064,7 @@ var ImageCollection = new Class({ /** * The Tiled firstgid value. * This is the starting index of the first image index this Image Collection contains. - * + * * @name Phaser.Tilemaps.ImageCollection#firstgid * @type {number} * @since 3.0.0 @@ -179648,7 +181073,7 @@ var ImageCollection = new Class({ /** * The width of the widest image (in pixels). - * + * * @name Phaser.Tilemaps.ImageCollection#imageWidth * @type {number} * @readonly @@ -179658,7 +181083,7 @@ var ImageCollection = new Class({ /** * The height of the tallest image (in pixels). - * + * * @name Phaser.Tilemaps.ImageCollection#imageHeight * @type {number} * @readonly @@ -179669,7 +181094,7 @@ var ImageCollection = new Class({ /** * The margin around the images in the collection (in pixels). * Use `setSpacing` to change. - * + * * @name Phaser.Tilemaps.ImageCollection#imageMarge * @type {number} * @readonly @@ -179680,7 +181105,7 @@ var ImageCollection = new Class({ /** * The spacing between each image in the collection (in pixels). * Use `setSpacing` to change. - * + * * @name Phaser.Tilemaps.ImageCollection#imageSpacing * @type {number} * @readonly @@ -179690,7 +181115,7 @@ var ImageCollection = new Class({ /** * Image Collection-specific properties that are typically defined in the Tiled editor. - * + * * @name Phaser.Tilemaps.ImageCollection#properties * @type {object} * @since 3.0.0 @@ -179699,7 +181124,7 @@ var ImageCollection = new Class({ /** * The cached images that are a part of this collection. - * + * * @name Phaser.Tilemaps.ImageCollection#images * @type {array} * @readonly @@ -179709,7 +181134,7 @@ var ImageCollection = new Class({ /** * The total number of images in the image collection. - * + * * @name Phaser.Tilemaps.ImageCollection#total * @type {number} * @readonly @@ -179723,9 +181148,9 @@ var ImageCollection = new Class({ * * @method Phaser.Tilemaps.ImageCollection#containsImageIndex * @since 3.0.0 - * + * * @param {number} imageIndex - The image index to search for. - * + * * @return {boolean} True if this Image Collection contains the given index. */ containsImageIndex: function (imageIndex) @@ -179738,7 +181163,7 @@ var ImageCollection = new Class({ * * @method Phaser.Tilemaps.ImageCollection#addImage * @since 3.0.0 - * + * * @param {number} gid - The gid of the image in the Image Collection. * @param {string} image - The the key of the image in the Image Collection and in the cache. * @@ -179998,7 +181423,7 @@ module.exports = ObjectHelper; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -180085,7 +181510,7 @@ module.exports = ParseToTilemap; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -180535,9 +181960,14 @@ var Tile = new Class({ // Tiled places tiles on a grid of baseWidth x baseHeight. The origin for a tile in grid // units is the bottom left, so the y coordinate needs to be adjusted by the difference // between the base size and this tile's size. - return tilemapLayer - ? tilemapLayer.tileToWorldY(this.y, camera) - (this.height - this.baseHeight) * tilemapLayer.scaleY - : this.y * this.baseHeight - (this.height - this.baseHeight); + if (tilemapLayer) + { + var point = tilemapLayer.tileToWorldXY(this.x, this.y, undefined, camera); + + return point.y; + } + + return this.y * this.baseWidth - (this.height - this.baseHeight); }, /** @@ -180560,7 +181990,6 @@ var Tile = new Class({ : this.getTop(camera) + this.height; }, - /** * Gets the world rectangle bounding box for the tile, factoring in the layers position, * scale and scroll. @@ -181014,7 +182443,7 @@ module.exports = Tile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -181314,36 +182743,6 @@ var Tilemap = new Class({ }; }, - /** - * @ignore - */ - createBlankDynamicLayer: function (name, tileset, x, y, width, height, tileWidth, tileHeight) - { - console.warn('createBlankDynamicLayer is deprecated. Use createBlankLayer'); - - return this.createBlankLayer(name, tileset, x, y, width, height, tileWidth, tileHeight); - }, - - /** - * @ignore - */ - createDynamicLayer: function (layerID, tileset, x, y) - { - console.warn('createDynamicLayer is deprecated. Use createLayer'); - - return this.createLayer(layerID, tileset, x, y); - }, - - /** - * @ignore - */ - createStaticLayer: function (layerID, tileset, x, y) - { - console.warn('createStaticLayer is deprecated. Use createLayer'); - - return this.createLayer(layerID, tileset, x, y); - }, - /** * Sets the rendering (draw) order of the tiles in this map. * @@ -181608,7 +183007,7 @@ var Tilemap = new Class({ if (typeof layerID === 'string') { - console.warn('Valid tilelayer names:\n\t' + this.getTileLayerNames().join(',\n\t')); + console.warn('Valid tilelayer names: %o', this.getTileLayerNames()); } return null; @@ -181616,7 +183015,7 @@ var Tilemap = new Class({ var layerData = this.layers[index]; - // Check for an associated static or dynamic tilemap layer + // Check for an associated tilemap layer if (layerData.tilemapLayer) { console.warn('Tilemap Layer ID already exists:' + layerID); @@ -183657,7 +185056,7 @@ module.exports = Tilemap; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -183672,9 +185071,9 @@ var ParseToTilemap = __webpack_require__(15043); * * @method Phaser.GameObjects.GameObjectCreator#tilemap * @since 3.0.0 - * + * * @param {Phaser.Types.Tilemaps.TilemapConfig} [config] - The config options for the Tilemap. - * + * * @return {Phaser.Tilemaps.Tilemap} */ GameObjectCreator.register('tilemap', function (config) @@ -183702,7 +185101,7 @@ GameObjectCreator.register('tilemap', function (config) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -183735,7 +185134,7 @@ var ParseToTilemap = __webpack_require__(15043); * the tile data doesn't need to change then setting this value to `true` will help with memory * consumption. However if your map is small or you need to update the tiles dynamically, then leave * the default value set. - * + * * @return {Phaser.Tilemaps.Tilemap} */ GameObjectFactory.register('tilemap', function (key, tileWidth, tileHeight, width, height, data, insertNull) @@ -183769,7 +185168,7 @@ GameObjectFactory.register('tilemap', function (key, tileWidth, tileHeight, widt /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -183796,6 +185195,7 @@ var TilemapLayerRender = __webpack_require__(96193); * @extends Phaser.GameObjects.Components.Depth * @extends Phaser.GameObjects.Components.Flip * @extends Phaser.GameObjects.Components.GetBounds + * @extends Phaser.GameObjects.Components.Mask * @extends Phaser.GameObjects.Components.Origin * @extends Phaser.GameObjects.Components.Pipeline * @extends Phaser.GameObjects.Components.ScrollFactor @@ -183820,6 +185220,7 @@ var TilemapLayer = new Class({ Components.Depth, Components.Flip, Components.GetBounds, + Components.Mask, Components.Origin, Components.Pipeline, Components.Transform, @@ -184010,10 +185411,50 @@ var TilemapLayer = new Class({ */ this.gidMap = []; + /** + * The horizontal origin of this Tilemap Layer. + * + * @name Phaser.Tilemaps.TilemapLayer#originX + * @type {number} + * @default 0 + * @readOnly + * @since 3.0.0 + */ + + /** + * The vertical origin of this Tilemap Layer. + * + * @name Phaser.Tilemaps.TilemapLayer#originY + * @type {number} + * @default 0 + * @readOnly + * @since 3.0.0 + */ + + /** + * The horizontal display origin of this Tilemap Layer. + * + * @name Phaser.Tilemaps.TilemapLayer#displayOriginX + * @type {number} + * @default 0 + * @readOnly + * @since 3.0.0 + */ + + /** + * The vertical display origin of this Tilemap Layer. + * + * @name Phaser.Tilemaps.TilemapLayer#displayOriginY + * @type {number} + * @default 0 + * @readOnly + * @since 3.0.0 + */ + this.setTilesets(tileset); this.setAlpha(this.layer.alpha); this.setPosition(x, y); - this.setOrigin(); + this.setOrigin(0, 0); this.setSize(tilemap.tileWidth * this.layer.width, tilemap.tileHeight * this.layer.height); this.initPipeline(); @@ -184332,6 +185773,43 @@ var TilemapLayer = new Class({ return this; }, + /** + * Sets an additive tint on each Tile within the given area. + * + * The tint works by taking the pixel color values from the tileset texture, and then + * multiplying it by the color value of the tint. + * + * If no area values are given then all tiles will be tinted to the given color. + * + * To remove a tint call this method with either no parameters, or by passing white `0xffffff` as the tint color. + * + * If a tile already has a tint set then calling this method will override that. + * + * @method Phaser.Tilemaps.TilemapLayer#setTint + * @webglOnly + * @since 3.60.0 + * + * @param {number} [tint=0xffffff] - The tint color being applied to each tile within the region. Given as a hex value, i.e. `0xff0000` for red. Set to white (`0xffffff`) to reset the tint. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. + * + * @return {this} This Tilemap Layer object. + */ + setTint: function (tint, tileX, tileY, width, height, filteringOptions) + { + if (tint === undefined) { tint = 0xffffff; } + + var tintTile = function (tile) + { + tile.tint = tint; + }; + + return this.forEachTile(tintTile, this, tileX, tileY, width, height, filteringOptions); + }, + /** * Gets a tile at the given tile coordinates from the given layer. * @@ -185085,7 +186563,7 @@ module.exports = TilemapLayer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -185175,15 +186653,14 @@ var TilemapLayerCanvasRenderer = function (renderer, src, camera, parentMatrix) var image = tileset.image.getSourceImage(); var tileTexCoords = tileset.getTileTextureCoordinates(tile.index); + var tileWidth = tileset.tileWidth; + var tileHeight = tileset.tileHeight; - if (tileTexCoords === null) + if (tileTexCoords === null || tileWidth === 0 || tileHeight === 0) { continue; } - var tileWidth = tileset.tileWidth; - var tileHeight = tileset.tileHeight; - var halfWidth = tileWidth * 0.5; var halfHeight = tileHeight * 0.5; @@ -185230,12 +186707,13 @@ module.exports = TilemapLayerCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -185262,7 +186740,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -185379,7 +186857,7 @@ module.exports = TilemapLayerWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -185800,7 +187278,7 @@ module.exports = Tileset; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -185895,7 +187373,7 @@ module.exports = CalculateFacesAt; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -185961,7 +187439,7 @@ module.exports = CalculateFacesWithin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -186008,7 +187486,7 @@ module.exports = CheckIsoBounds; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -186075,7 +187553,7 @@ module.exports = Copy; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -186163,7 +187641,7 @@ module.exports = CreateFromTiles; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -186220,7 +187698,7 @@ module.exports = CullBounds; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -186276,7 +187754,7 @@ module.exports = CullTiles; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -186330,7 +187808,7 @@ module.exports = Fill; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -186374,7 +187852,7 @@ module.exports = FilterTiles; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -186461,7 +187939,7 @@ module.exports = FindByIndex; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -186513,7 +187991,7 @@ module.exports = FindTile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -186560,7 +188038,7 @@ module.exports = ForEachTile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -186615,7 +188093,7 @@ module.exports = GetCullTilesFunction; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -186671,7 +188149,7 @@ module.exports = GetTileAt; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -186711,7 +188189,7 @@ module.exports = GetTileAtWorldXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -186751,7 +188229,7 @@ module.exports = GetTileToWorldXFunction; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -186806,7 +188284,7 @@ module.exports = GetTileToWorldXYFunction; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -186856,7 +188334,7 @@ module.exports = GetTileToWorldYFunction; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -186956,7 +188434,7 @@ module.exports = GetTilesWithin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -187020,7 +188498,7 @@ var GetTilesWithinShape = function (shape, filteringOptions, camera, layer) var yStart = pointStart.y; // Bottom right corner of the shapes's bounding box, rounded up to include partial tiles - layer.tilemapLayer.worldToTileXY(shape.right, shape.bottom, true, pointEnd, camera); + layer.tilemapLayer.worldToTileXY(shape.right, shape.bottom, false, pointEnd, camera); var xEnd = Math.ceil(pointEnd.x); var yEnd = Math.ceil(pointEnd.y); @@ -187072,7 +188550,7 @@ module.exports = GetTilesWithinShape; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -187127,7 +188605,7 @@ module.exports = GetTilesWithinWorldXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -187167,7 +188645,7 @@ module.exports = GetWorldToTileXFunction; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -187222,7 +188700,7 @@ module.exports = GetWorldToTileXYFunction; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -187272,7 +188750,7 @@ module.exports = GetWorldToTileYFunction; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -187315,7 +188793,7 @@ module.exports = HasTileAt; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -187358,7 +188836,7 @@ module.exports = HasTileAtWorldXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -187415,7 +188893,7 @@ module.exports = HexagonalCullBounds; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -187467,7 +188945,7 @@ module.exports = HexagonalCullTiles; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -187533,7 +189011,7 @@ module.exports = HexagonalTileToWorldXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -187582,7 +189060,7 @@ module.exports = HexagonalTileToWorldY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -187652,7 +189130,7 @@ module.exports = HexagonalWorldToTileXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -187704,7 +189182,7 @@ module.exports = HexagonalWorldToTileY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -187735,7 +189213,7 @@ module.exports = IsInLayerBounds; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -187884,7 +189362,7 @@ module.exports = IsometricCullTiles; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -187946,7 +189424,7 @@ module.exports = IsometricTileToWorldXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -188012,7 +189490,7 @@ module.exports = IsometricWorldToTileXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -188048,6 +189526,7 @@ var PutTileAt = function (tile, tileX, tileY, recalculateFaces, layer) return null; } + var index; var oldTile = layer.data[tileY][tileX]; var oldTileCollides = oldTile && oldTile.collides; @@ -188062,7 +189541,7 @@ var PutTileAt = function (tile, tileX, tileY, recalculateFaces, layer) } else { - var index = tile; + index = tile; if (layer.data[tileY][tileX] === null) { @@ -188080,7 +189559,8 @@ var PutTileAt = function (tile, tileX, tileY, recalculateFaces, layer) // Copy properties from tileset to tiles. var tiles = BuildTilesetIndex(layer.tilemapLayer.tilemap); - var index = tile instanceof Tile ? tile.index : tile; + + index = tile instanceof Tile ? tile.index : tile; var sid = tiles[index][2]; var set = layer.tilemapLayer.tileset[sid]; @@ -188109,7 +189589,7 @@ module.exports = PutTileAt; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -188153,7 +189633,7 @@ module.exports = PutTileAtWorldXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -188221,7 +189701,7 @@ module.exports = PutTilesAt; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -188280,7 +189760,7 @@ module.exports = Randomize; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -188343,7 +189823,7 @@ module.exports = RemoveTileAt; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -188385,7 +189865,7 @@ module.exports = RemoveTileAtWorldXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -188468,7 +189948,7 @@ module.exports = RenderDebug; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -188513,7 +189993,7 @@ module.exports = ReplaceByIndex; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -188640,7 +190120,7 @@ module.exports = RunCull; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -188712,7 +190192,7 @@ module.exports = SetCollision; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -188789,7 +190269,7 @@ module.exports = SetCollisionBetween; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -188851,7 +190331,7 @@ module.exports = SetCollisionByExclusion; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -188927,7 +190407,7 @@ module.exports = SetCollisionByProperty; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -188987,7 +190467,7 @@ module.exports = SetCollisionFromCollisionGroup; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -189026,7 +190506,7 @@ module.exports = SetLayerCollisionIndex; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -189062,7 +190542,7 @@ module.exports = SetTileCollision; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -189109,7 +190589,7 @@ module.exports = SetTileIndexCallback; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -189151,7 +190631,7 @@ module.exports = SetTileLocationCallback; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -189197,7 +190677,7 @@ module.exports = Shuffle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -189251,7 +190731,7 @@ module.exports = StaggeredCullBounds; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -189303,7 +190783,7 @@ module.exports = StaggeredCullTiles; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -189365,7 +190845,7 @@ module.exports = StaggeredTileToWorldXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -189410,7 +190890,7 @@ module.exports = StaggeredTileToWorldY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -189476,7 +190956,7 @@ module.exports = StaggeredWorldToTileXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -189524,7 +191004,7 @@ module.exports = StaggeredWorldToTileY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -189576,7 +191056,7 @@ module.exports = SwapByIndex; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -189621,7 +191101,7 @@ module.exports = TileToWorldX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -189665,7 +191145,7 @@ module.exports = TileToWorldXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -189710,7 +191190,7 @@ module.exports = TileToWorldY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -189794,7 +191274,7 @@ module.exports = WeightedRandomize; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -189843,7 +191323,7 @@ module.exports = WorldToTileX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -189889,7 +191369,7 @@ module.exports = WorldToTileXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -189938,7 +191418,7 @@ module.exports = WorldToTileY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -190028,13 +191508,13 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Phaser Tilemap constants for orientation. - * + * * @namespace Phaser.Tilemaps.Orientation * @memberof Phaser.Tilemaps * @since 3.50.0 @@ -190042,9 +191522,9 @@ module.exports = { /** * Phaser Tilemap constants for orientation. - * + * * To find out what each mode does please see [Phaser.Tilemaps.Orientation]{@link Phaser.Tilemaps.Orientation}. - * + * * @typedef {Phaser.Tilemaps.Orientation} Phaser.Tilemaps.OrientationType * @memberof Phaser.Tilemaps * @since 3.50.0 @@ -190054,7 +191534,7 @@ module.exports = { /** * Orthogonal Tilemap orientation constant. - * + * * @name Phaser.Tilemaps.Orientation.ORTHOGONAL * @type {number} * @const @@ -190102,7 +191582,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -190122,7 +191602,7 @@ module.exports = CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -190172,7 +191652,7 @@ module.exports = Tilemaps; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -190413,7 +191893,7 @@ module.exports = LayerData; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -190650,7 +192130,7 @@ module.exports = MapData; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -190773,7 +192253,7 @@ module.exports = ObjectLayer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -190821,7 +192301,7 @@ module.exports = FromOrientationString; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -190892,7 +192372,7 @@ module.exports = Parse; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -190926,7 +192406,7 @@ var Parse2DArray = function (name, data, tileWidth, tileHeight, insertNull) tileWidth: tileWidth, tileHeight: tileHeight }); - + var mapData = new MapData({ name: name, tileWidth: tileWidth, @@ -190985,7 +192465,7 @@ module.exports = Parse2DArray; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -191034,7 +192514,7 @@ module.exports = ParseCSV; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -191121,7 +192601,7 @@ module.exports = ParseTileLayers; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -191173,7 +192653,7 @@ module.exports = ParseTilesets; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -191241,7 +192721,7 @@ module.exports = ParseWeltmeister; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -191265,7 +192745,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -191293,7 +192773,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -191367,7 +192847,7 @@ module.exports = AssignTileProperties; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -191411,7 +192891,7 @@ module.exports = Base64Decode; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -191506,7 +192986,7 @@ module.exports = BuildTilesetIndex; /** * @author Seth Berrier - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -191519,20 +192999,19 @@ var GetFastValue = __webpack_require__(72632); * @since 3.21.0 * * @param {object} json - The Tiled JSON object. - * @param {object} [currentl] - The current group layer from the Tiled JSON file. - * @param {object} [parentstate] - The state of the parent group (if any). + * @param {object} [group] - The current group layer from the Tiled JSON file. + * @param {object} [parentState] - The state of the parent group (if any). * * @return {object} A group state object with proper values for updating children layers. */ -var CreateGroupLayer = function (json, groupl, parentstate) +var CreateGroupLayer = function (json, group, parentState) { - if (!groupl) + if (!group) { // Return a default group state object return { i: 0, // Current layer array iterator layers: json.layers, // Current array of layers - // Values inherited from parent group name: '', opacity: 1, @@ -191543,18 +193022,18 @@ var CreateGroupLayer = function (json, groupl, parentstate) } // Compute group layer x, y - var layerX = groupl.x + GetFastValue(groupl, 'startx', 0) * json.tilewidth + GetFastValue(groupl, 'offsetx', 0); - var layerY = groupl.y + GetFastValue(groupl, 'starty', 0) * json.tileheight + GetFastValue(groupl, 'offsety', 0); + var layerX = group.x + GetFastValue(group, 'startx', 0) * json.tilewidth + GetFastValue(group, 'offsetx', 0); + var layerY = group.y + GetFastValue(group, 'starty', 0) * json.tileheight + GetFastValue(group, 'offsety', 0); // Compute next state inherited from group return { i: 0, - layers: groupl.layers, - name: parentstate.name + groupl.name + '/', - opacity: parentstate.opacity * groupl.opacity, - visible: parentstate.visible && groupl.visible, - x: parentstate.x + layerX, - y: parentstate.y + layerY + layers: group.layers, + name: parentState.name + group.name + '/', + opacity: parentState.opacity * group.opacity, + visible: parentState.visible && group.visible, + x: parentState.x + layerX, + y: parentState.y + layerY }; }; @@ -191568,7 +193047,7 @@ module.exports = CreateGroupLayer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -191659,7 +193138,7 @@ module.exports = ParseGID; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -191748,7 +193227,7 @@ module.exports = ParseImageLayers; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -191829,7 +193308,7 @@ module.exports = ParseJSONTiled; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -191910,7 +193389,7 @@ module.exports = ParseObject; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -192010,7 +193489,7 @@ module.exports = ParseObjectLayers; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -192281,7 +193760,7 @@ module.exports = ParseTileLayers; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -192477,7 +193956,7 @@ module.exports = ParseTilesets; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -192619,7 +194098,7 @@ module.exports = ParseWangsets; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -192651,7 +194130,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -193128,7 +194607,7 @@ module.exports = Clock; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -193494,7 +194973,7 @@ module.exports = TimerEvent; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -193510,912 +194989,6 @@ module.exports = { }; -/***/ }), - -/***/ 28860: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(56694); -var EventEmitter = __webpack_require__(6659); -var Events = __webpack_require__(54272); -var TweenBuilder = __webpack_require__(68061); -var TWEEN_CONST = __webpack_require__(55303); - -/** - * @classdesc - * A Timeline combines multiple Tweens into one. Its overall behavior is otherwise similar to a single Tween. - * - * The Timeline updates all of its Tweens simultaneously. Its methods allow you to easily build a sequence - * of Tweens (each one starting after the previous one) or run multiple Tweens at once during given parts of the Timeline. - * - * @class Timeline - * @memberof Phaser.Tweens - * @extends Phaser.Events.EventEmitter - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Tweens.TweenManager} manager - The Tween Manager which owns this Timeline. - */ -var Timeline = new Class({ - - Extends: EventEmitter, - - initialize: - - function Timeline (manager) - { - EventEmitter.call(this); - - /** - * The Tween Manager which owns this Timeline. - * - * @name Phaser.Tweens.Timeline#manager - * @type {Phaser.Tweens.TweenManager} - * @since 3.0.0 - */ - this.manager = manager; - - /** - * A constant value which allows this Timeline to be easily identified as one. - * - * @name Phaser.Tweens.Timeline#isTimeline - * @type {boolean} - * @default true - * @since 3.0.0 - */ - this.isTimeline = true; - - /** - * An array of Tween objects, each containing a unique property and target being tweened. - * - * @name Phaser.Tweens.Timeline#data - * @type {array} - * @default [] - * @since 3.0.0 - */ - this.data = []; - - /** - * The cached size of the data array. - * - * @name Phaser.Tweens.Timeline#totalData - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.totalData = 0; - - /** - * If true then duration, delay, etc values are all frame totals, rather than ms. - * - * @name Phaser.Tweens.Timeline#useFrames - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.useFrames = false; - - /** - * Scales the time applied to this Timeline. A value of 1 runs in real-time. A value of 0.5 runs 50% slower, and so on. - * Value isn't used when calculating total duration of the Timeline, it's a run-time delta adjustment only. - * - * @name Phaser.Tweens.Timeline#timeScale - * @type {number} - * @default 1 - * @since 3.0.0 - */ - this.timeScale = 1; - - /** - * Loop this Timeline? Can be -1 for an infinite loop, or an integer. - * When enabled it will play through ALL Tweens again (use Tween.repeat to loop a single tween) - * - * @name Phaser.Tweens.Timeline#loop - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.loop = 0; - - /** - * Time in ms/frames before this Timeline loops. - * - * @name Phaser.Tweens.Timeline#loopDelay - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.loopDelay = 0; - - /** - * How many loops are left to run? - * - * @name Phaser.Tweens.Timeline#loopCounter - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.loopCounter = 0; - - /** - * Time in ms/frames before the 'onComplete' event fires. This never fires if loop = true (as it never completes) - * - * @name Phaser.Tweens.Timeline#completeDelay - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.completeDelay = 0; - - /** - * Countdown timer value, as used by `loopDelay` and `completeDelay`. - * - * @name Phaser.Tweens.Timeline#countdown - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.countdown = 0; - - /** - * The current state of the Timeline. - * - * @name Phaser.Tweens.Timeline#state - * @type {number} - * @since 3.0.0 - */ - this.state = TWEEN_CONST.PENDING_ADD; - - /** - * The state of the Timeline when it was paused (used by Resume) - * - * @name Phaser.Tweens.Timeline#_pausedState - * @type {number} - * @private - * @since 3.0.0 - */ - this._pausedState = TWEEN_CONST.PENDING_ADD; - - /** - * Does the Timeline start off paused? (if so it needs to be started with Timeline.play) - * - * @name Phaser.Tweens.Timeline#paused - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.paused = false; - - /** - * Elapsed time in ms/frames of this run through of the Timeline. - * - * @name Phaser.Tweens.Timeline#elapsed - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.elapsed = 0; - - /** - * Total elapsed time in ms/frames of the entire Timeline, including looping. - * - * @name Phaser.Tweens.Timeline#totalElapsed - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.totalElapsed = 0; - - /** - * Time in ms/frames for the whole Timeline to play through once, excluding loop amounts and loop delays. - * - * @name Phaser.Tweens.Timeline#duration - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.duration = 0; - - /** - * Value between 0 and 1. The amount of progress through the Timeline, _excluding loops_. - * - * @name Phaser.Tweens.Timeline#progress - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.progress = 0; - - /** - * Time in ms/frames for all Tweens in this Timeline to complete (including looping) - * - * @name Phaser.Tweens.Timeline#totalDuration - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.totalDuration = 0; - - /** - * Value between 0 and 1. The amount through the entire Timeline, including looping. - * - * @name Phaser.Tweens.Timeline#totalProgress - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.totalProgress = 0; - - /** - * An object containing the different Tween callback functions. - * - * You can either set these in the Tween config, or by calling the `Tween.setCallback` method. - * - * `onComplete` When the Timeline finishes playback fully or `Timeline.stop` is called. Never invoked if timeline is set to repeat infinitely. - * `onLoop` When a Timeline loops. - * `onStart` When the Timeline starts playing. - * `onUpdate` When a Timeline updates a child Tween. - * `onYoyo` When a Timeline starts a yoyo. - * - * @name Phaser.Tweens.Timeline#callbacks - * @type {object} - * @since 3.0.0 - */ - this.callbacks = { - onComplete: null, - onLoop: null, - onStart: null, - onUpdate: null, - onYoyo: null - }; - - /** - * The context in which all callbacks are invoked. - * - * @name Phaser.Tweens.Timeline#callbackScope - * @type {any} - * @since 3.0.0 - */ - this.callbackScope; - }, - - /** - * Internal method that will emit a Timeline based Event and invoke the given callback. - * - * @method Phaser.Tweens.Timeline#dispatchTimelineEvent - * @since 3.19.0 - * - * @param {Phaser.Types.Tweens.Event} event - The Event to be dispatched. - * @param {function} callback - The callback to be invoked. Can be `null` or `undefined` to skip invocation. - */ - dispatchTimelineEvent: function (event, callback) - { - this.emit(event, this); - - if (callback) - { - callback.func.apply(callback.scope, callback.params); - } - }, - - /** - * Sets the value of the time scale applied to this Timeline. A value of 1 runs in real-time. - * A value of 0.5 runs 50% slower, and so on. - * - * The value isn't used when calculating total duration of the tween, it's a run-time delta adjustment only. - * - * @method Phaser.Tweens.Timeline#setTimeScale - * @since 3.0.0 - * - * @param {number} value - The time scale value to set. - * - * @return {this} This Timeline object. - */ - setTimeScale: function (value) - { - this.timeScale = value; - - return this; - }, - - /** - * Gets the value of the time scale applied to this Timeline. A value of 1 runs in real-time. - * A value of 0.5 runs 50% slower, and so on. - * - * @method Phaser.Tweens.Timeline#getTimeScale - * @since 3.0.0 - * - * @return {number} The value of the time scale applied to this Timeline. - */ - getTimeScale: function () - { - return this.timeScale; - }, - - /** - * Check whether or not the Timeline is playing. - * - * @method Phaser.Tweens.Timeline#isPlaying - * @since 3.0.0 - * - * @return {boolean} `true` if this Timeline is active, otherwise `false`. - */ - isPlaying: function () - { - return (this.state === TWEEN_CONST.ACTIVE); - }, - - /** - * Creates a new Tween, based on the given Tween Config, and adds it to this Timeline. - * - * @method Phaser.Tweens.Timeline#add - * @since 3.0.0 - * - * @param {(Phaser.Types.Tweens.TweenBuilderConfig|object)} config - The configuration object for the Tween. - * - * @return {this} This Timeline object. - */ - add: function (config) - { - return this.queue(TweenBuilder(this, config)); - }, - - /** - * Adds an existing Tween to this Timeline. - * - * @method Phaser.Tweens.Timeline#queue - * @since 3.0.0 - * - * @param {Phaser.Tweens.Tween} tween - The Tween to be added to this Timeline. - * - * @return {this} This Timeline object. - */ - queue: function (tween) - { - if (!this.isPlaying()) - { - tween.parent = this; - tween.parentIsTimeline = true; - - this.data.push(tween); - - this.totalData = this.data.length; - } - - return this; - }, - - /** - * Checks whether a Tween has an offset value. - * - * @method Phaser.Tweens.Timeline#hasOffset - * @since 3.0.0 - * - * @param {Phaser.Tweens.Tween} tween - The Tween to check. - * - * @return {boolean} `true` if the tween has a non-null offset. - */ - hasOffset: function (tween) - { - return (tween.offset !== null); - }, - - /** - * Checks whether the offset value is a number or a directive that is relative to previous tweens. - * - * @method Phaser.Tweens.Timeline#isOffsetAbsolute - * @since 3.0.0 - * - * @param {number} value - The offset value to be evaluated. - * - * @return {boolean} `true` if the result is a number, `false` if it is a directive like " -= 1000". - */ - isOffsetAbsolute: function (value) - { - return (typeof(value) === 'number'); - }, - - /** - * Checks if the offset is a relative value rather than an absolute one. - * If the value is just a number, this returns false. - * - * @method Phaser.Tweens.Timeline#isOffsetRelative - * @since 3.0.0 - * - * @param {string} value - The offset value to be evaluated. - * - * @return {boolean} `true` if the value is relative, i.e " -= 1000". If `false`, the offset is absolute. - */ - isOffsetRelative: function (value) - { - var t = typeof(value); - - if (t === 'string') - { - var op = value[0]; - - if (op === '-' || op === '+') - { - return true; - } - } - - return false; - }, - - /** - * Parses the relative offset value, returning a positive or negative number. - * - * @method Phaser.Tweens.Timeline#getRelativeOffset - * @since 3.0.0 - * - * @param {string} value - The relative offset, in the format of '-=500', for example. The first character determines whether it will be a positive or negative number. Spacing matters here. - * @param {number} base - The value to use as the offset. - * - * @return {number} The parsed offset value. - */ - getRelativeOffset: function (value, base) - { - var op = value[0]; - var num = parseFloat(value.substr(2)); - var result = base; - - switch (op) - { - case '+': - result += num; - break; - - case '-': - result -= num; - break; - } - - // Cannot ever be < 0 - return Math.max(0, result); - }, - - /** - * Calculates the total duration of the timeline. - * - * Computes all tween durations and returns the full duration of the timeline. - * - * The resulting number is stored in the timeline, not as a return value. - * - * @method Phaser.Tweens.Timeline#calcDuration - * @since 3.0.0 - */ - calcDuration: function () - { - var prevEnd = 0; - var totalDuration = 0; - var offsetDuration = 0; - - for (var i = 0; i < this.totalData; i++) - { - var tween = this.data[i]; - - tween.init(); - - if (this.hasOffset(tween)) - { - if (this.isOffsetAbsolute(tween.offset)) - { - // An actual number, so it defines the start point from the beginning of the timeline - tween.calculatedOffset = tween.offset; - - if (tween.offset === 0) - { - offsetDuration = 0; - } - } - else if (this.isOffsetRelative(tween.offset)) - { - // A relative offset (i.e. '-=1000', so starts at 'offset' ms relative to the PREVIOUS Tweens ending time) - tween.calculatedOffset = this.getRelativeOffset(tween.offset, prevEnd); - } - } - else - { - // Sequential - tween.calculatedOffset = offsetDuration; - } - - prevEnd = tween.totalDuration + tween.calculatedOffset; - - totalDuration += tween.totalDuration; - offsetDuration += tween.totalDuration; - } - - // Excludes loop values - this.duration = totalDuration; - - this.loopCounter = (this.loop === -1) ? 999999999999 : this.loop; - - if (this.loopCounter > 0) - { - this.totalDuration = this.duration + this.completeDelay + ((this.duration + this.loopDelay) * this.loopCounter); - } - else - { - this.totalDuration = this.duration + this.completeDelay; - } - }, - - /** - * Initializes the timeline, which means all Tweens get their init() called, and the total duration will be computed. - * Returns a boolean indicating whether the timeline is auto-started or not. - * - * @method Phaser.Tweens.Timeline#init - * @since 3.0.0 - * - * @return {boolean} `true` if the Timeline is started. `false` if it is paused. - */ - init: function () - { - this.calcDuration(); - - this.progress = 0; - this.totalProgress = 0; - - if (this.paused) - { - this.state = TWEEN_CONST.PAUSED; - - return false; - } - else - { - return true; - } - }, - - /** - * Resets all of the timeline's tweens back to their initial states. - * The boolean parameter indicates whether tweens that are looping should reset as well, or not. - * - * @method Phaser.Tweens.Timeline#resetTweens - * @since 3.0.0 - * - * @param {boolean} resetFromLoop - If `true`, resets all looping tweens to their initial values. - */ - resetTweens: function (resetFromLoop) - { - for (var i = 0; i < this.totalData; i++) - { - var tween = this.data[i]; - - tween.play(resetFromLoop); - } - }, - - /** - * Sets a callback for the Timeline. - * - * @method Phaser.Tweens.Timeline#setCallback - * @since 3.0.0 - * - * @param {string} type - The internal type of callback to set. - * @param {function} callback - Timeline allows multiple tweens to be linked together to create a streaming sequence. - * @param {array} [params] - The parameters to pass to the callback. - * @param {object} [scope] - The context scope of the callback. - * - * @return {this} This Timeline object. - */ - setCallback: function (type, callback, params, scope) - { - if (Timeline.TYPES.indexOf(type) !== -1) - { - this.callbacks[type] = { func: callback, scope: scope, params: [ this ].concat(params) }; - } - - return this; - }, - - /** - * Passed a Tween to the Tween Manager and requests it be made active. - * - * @method Phaser.Tweens.Timeline#makeActive - * @since 3.3.0 - * - * @param {Phaser.Tweens.Tween} tween - The tween object to make active. - * - * @return {Phaser.Tweens.TweenManager} The Timeline's Tween Manager reference. - */ - makeActive: function (tween) - { - return this.manager.makeActive(tween); - }, - - /** - * Starts playing the Timeline. - * - * @method Phaser.Tweens.Timeline#play - * @fires Phaser.Tweens.Events#TIMELINE_START - * @since 3.0.0 - */ - play: function () - { - if (this.state === TWEEN_CONST.ACTIVE) - { - return; - } - - if (this.paused) - { - this.paused = false; - - this.manager.makeActive(this); - - return; - } - else - { - this.resetTweens(false); - - this.state = TWEEN_CONST.ACTIVE; - } - - this.dispatchTimelineEvent(Events.TIMELINE_START, this.callbacks.onStart); - }, - - /** - * Updates the Timeline's `state` and fires callbacks and events. - * - * @method Phaser.Tweens.Timeline#nextState - * @fires Phaser.Tweens.Events#TIMELINE_COMPLETE - * @fires Phaser.Tweens.Events#TIMELINE_LOOP - * @since 3.0.0 - * - * @see Phaser.Tweens.Timeline#update - */ - nextState: function () - { - if (this.loopCounter > 0) - { - // Reset the elapsed time - this.elapsed = 0; - this.progress = 0; - - this.loopCounter--; - - this.resetTweens(true); - - if (this.loopDelay > 0) - { - this.countdown = this.loopDelay; - - this.state = TWEEN_CONST.LOOP_DELAY; - } - else - { - this.state = TWEEN_CONST.ACTIVE; - - this.dispatchTimelineEvent(Events.TIMELINE_LOOP, this.callbacks.onLoop); - } - } - else if (this.completeDelay > 0) - { - this.state = TWEEN_CONST.COMPLETE_DELAY; - - this.countdown = this.completeDelay; - } - else - { - this.state = TWEEN_CONST.PENDING_REMOVE; - - this.dispatchTimelineEvent(Events.TIMELINE_COMPLETE, this.callbacks.onComplete); - } - }, - - /** - * Returns 'true' if this Timeline has finished and should be removed from the Tween Manager. - * Otherwise, returns false. - * - * @method Phaser.Tweens.Timeline#update - * @fires Phaser.Tweens.Events#TIMELINE_COMPLETE - * @fires Phaser.Tweens.Events#TIMELINE_UPDATE - * @since 3.0.0 - * - * @param {number} timestamp - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. - * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. - * - * @return {boolean} Returns `true` if this Timeline has finished and should be removed from the Tween Manager. - */ - update: function (timestamp, delta) - { - if (this.state === TWEEN_CONST.PAUSED) - { - return; - } - - if (this.useFrames) - { - delta = 1 * this.manager.timeScale; - } - - delta *= this.timeScale; - - this.elapsed += delta; - this.progress = Math.min(this.elapsed / this.duration, 1); - - this.totalElapsed += delta; - this.totalProgress = Math.min(this.totalElapsed / this.totalDuration, 1); - - switch (this.state) - { - case TWEEN_CONST.ACTIVE: - - var stillRunning = this.totalData; - - for (var i = 0; i < this.totalData; i++) - { - var tween = this.data[i]; - - if (tween.update(timestamp, delta)) - { - stillRunning--; - } - } - - this.dispatchTimelineEvent(Events.TIMELINE_UPDATE, this.callbacks.onUpdate); - - // Anything still running? If not, we're done - if (stillRunning === 0) - { - this.nextState(); - } - - break; - - case TWEEN_CONST.LOOP_DELAY: - - this.countdown -= delta; - - if (this.countdown <= 0) - { - this.state = TWEEN_CONST.ACTIVE; - - this.dispatchTimelineEvent(Events.TIMELINE_LOOP, this.callbacks.onLoop); - } - - break; - - case TWEEN_CONST.COMPLETE_DELAY: - - this.countdown -= delta; - - if (this.countdown <= 0) - { - this.state = TWEEN_CONST.PENDING_REMOVE; - - this.dispatchTimelineEvent(Events.TIMELINE_COMPLETE, this.callbacks.onComplete); - } - - break; - } - - return (this.state === TWEEN_CONST.PENDING_REMOVE); - }, - - /** - * Stops the Timeline immediately, whatever stage of progress it is at and flags it for removal by the TweenManager. - * - * @method Phaser.Tweens.Timeline#stop - * @since 3.0.0 - */ - stop: function () - { - this.state = TWEEN_CONST.PENDING_REMOVE; - }, - - /** - * Pauses the Timeline, retaining its internal state. - * - * Calling this on a Timeline that is already paused has no effect and fires no event. - * - * @method Phaser.Tweens.Timeline#pause - * @fires Phaser.Tweens.Events#TIMELINE_PAUSE - * @since 3.0.0 - * - * @return {this} This Timeline object. - */ - pause: function () - { - if (this.state === TWEEN_CONST.PAUSED) - { - return; - } - - this.paused = true; - - this._pausedState = this.state; - - this.state = TWEEN_CONST.PAUSED; - - this.emit(Events.TIMELINE_PAUSE, this); - - return this; - }, - - /** - * Resumes a paused Timeline from where it was when it was paused. - * - * Calling this on a Timeline that isn't paused has no effect and fires no event. - * - * @method Phaser.Tweens.Timeline#resume - * @fires Phaser.Tweens.Events#TIMELINE_RESUME - * @since 3.0.0 - * - * @return {this} This Timeline object. - */ - resume: function () - { - if (this.state === TWEEN_CONST.PAUSED) - { - this.paused = false; - - this.state = this._pausedState; - - this.emit(Events.TIMELINE_RESUME, this); - } - - return this; - }, - - /** - * Checks if any of the Tweens in this Timeline as operating on the target object. - * - * Returns `false` if no Tweens operate on the target object. - * - * @method Phaser.Tweens.Timeline#hasTarget - * @since 3.0.0 - * - * @param {object} target - The target to check all Tweens against. - * - * @return {boolean} `true` if there is at least a single Tween that operates on the target object, otherwise `false`. - */ - hasTarget: function (target) - { - for (var i = 0; i < this.data.length; i++) - { - if (this.data[i].hasTarget(target)) - { - return true; - } - } - - return false; - }, - - /** - * Stops all the Tweens in the Timeline immediately, whatever stage of progress they are at and flags - * them for removal by the TweenManager. - * - * @method Phaser.Tweens.Timeline#destroy - * @since 3.0.0 - */ - destroy: function () - { - for (var i = 0; i < this.data.length; i++) - { - this.data[i].stop(); - } - } - -}); - -Timeline.TYPES = [ 'onStart', 'onUpdate', 'onLoop', 'onComplete', 'onYoyo' ]; - -module.exports = Timeline; - - /***/ }), /***/ 64532: @@ -194423,23 +194996,25 @@ module.exports = Timeline; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var ArrayRemove = __webpack_require__(66458); var Class = __webpack_require__(56694); +var Flatten = __webpack_require__(5454); var NumberTweenBuilder = __webpack_require__(68710); var PluginCache = __webpack_require__(91963); var SceneEvents = __webpack_require__(7599); var StaggerBuilder = __webpack_require__(91944); -var TimelineBuilder = __webpack_require__(32981); -var TWEEN_CONST = __webpack_require__(55303); +var Tween = __webpack_require__(39366); var TweenBuilder = __webpack_require__(68061); +var TweenChain = __webpack_require__(45641); +var TweenChainBuilder = __webpack_require__(56034); /** * @classdesc - * The Tween Manager is a default Scene Plugin which controls and updates Tweens and Timelines. + * The Tween Manager is a default Scene Plugin which controls and updates Tweens. * * @class TweenManager * @memberof Phaser.Tweens @@ -194485,55 +195060,111 @@ var TweenManager = new Class({ this.timeScale = 1; /** - * An array of Tweens and Timelines which will be added to the Tween Manager at the start of the frame. + * This toggles the updating state of this Tween Manager. * - * @name Phaser.Tweens.TweenManager#_add - * @type {array} - * @private - * @since 3.0.0 + * Setting `paused` to `true` (or calling the `pauseAll` method) will + * stop this Tween Manager from updating any of its tweens, including + * newly created ones. Set back to `false` to resume playback. + * + * @name Phaser.Tweens.TweenManager#paused + * @type {boolean} + * @default false + * @since 3.60.0 */ - this._add = []; + this.paused = false; /** - * An array of Tweens and Timelines pending to be later added to the Tween Manager. + * Is this Tween Manager currently processing the tweens as part of + * its 'update' loop? This is set to 'true' at the start of 'update' + * and reset to 'false' at the end of the function. Allows you to trap + * Tween Manager status during tween callbacks. * - * @name Phaser.Tweens.TweenManager#_pending - * @type {array} - * @private - * @since 3.0.0 + * @name Phaser.Tweens.TweenManager#processing + * @type {boolean} + * @default false + * @since 3.60.0 */ - this._pending = []; + this.processing = false; /** - * An array of Tweens and Timelines which are still incomplete and are actively processed by the Tween Manager. + * An array of Tweens which are actively being processed by the Tween Manager. * - * @name Phaser.Tweens.TweenManager#_active - * @type {array} - * @private - * @since 3.0.0 + * @name Phaser.Tweens.TweenManager#tweens + * @type {Phaser.Tweens.Tween[]} + * @since 3.60.0 */ - this._active = []; + this.tweens = []; /** - * An array of Tweens and Timelines which will be removed from the Tween Manager at the start of the frame. + * The time the Tween Manager was updated. * - * @name Phaser.Tweens.TweenManager#_destroy - * @type {array} - * @private - * @since 3.0.0 - */ - this._destroy = []; - - /** - * The number of Tweens and Timelines which need to be processed by the Tween Manager at the start of the frame. - * - * @name Phaser.Tweens.TweenManager#_toProcess + * @name Phaser.Tweens.TweenManager#time * @type {number} - * @private - * @default 0 - * @since 3.0.0 + * @since 3.60.0 */ - this._toProcess = 0; + this.time = 0; + + /** + * The time the Tween Manager was started. + * + * @name Phaser.Tweens.TweenManager#startTime + * @type {number} + * @since 3.60.0 + */ + this.startTime = 0; + + /** + * The time the Tween Manager should next update. + * + * @name Phaser.Tweens.TweenManager#nextTime + * @type {number} + * @since 3.60.0 + */ + this.nextTime = 0; + + /** + * The time the Tween Manager previously updated. + * + * @name Phaser.Tweens.TweenManager#prevTime + * @type {number} + * @since 3.60.0 + */ + this.prevTime = 0; + + /** + * The maximum amount of time, in milliseconds, the browser can + * lag for, before lag smoothing is applied. + * + * See the `TweenManager.setLagSmooth` method for further details. + * + * @name Phaser.Tweens.TweenManager#maxLag + * @type {number} + * @default 500 + * @since 3.60.0 + */ + this.maxLag = 500; + + /** + * The amount of time, in milliseconds, that is used to set the + * delta when lag smoothing is applied. + * + * See the `TweenManager.setLagSmooth` method for further details. + * + * @name Phaser.Tweens.TweenManager#lagSkip + * @type {number} + * @default 33 + * @since 3.60.0 + */ + this.lagSkip = 33; + + /** + * An internal value that holds the fps rate. + * + * @name Phaser.Tweens.TweenManager#gap + * @type {number} + * @since 3.60.0 + */ + this.gap = 1000 / 240; scene.sys.events.once(SceneEvents.BOOT, this.boot, this); scene.sys.events.on(SceneEvents.START, this.start, this); @@ -194565,105 +195196,242 @@ var TweenManager = new Class({ { var eventEmitter = this.systems.events; - eventEmitter.on(SceneEvents.PRE_UPDATE, this.preUpdate, this); eventEmitter.on(SceneEvents.UPDATE, this.update, this); eventEmitter.once(SceneEvents.SHUTDOWN, this.shutdown, this); this.timeScale = 1; + this.paused = false; + + this.startTime = Date.now(); + this.prevTime = this.startTime; + this.nextTime = this.gap; }, /** - * Create a Tween Timeline and return it, but do NOT add it to the active or pending Tween lists. + * Create a Tween and return it, but does not add it to this Tween Manager. * - * @method Phaser.Tweens.TweenManager#createTimeline - * @since 3.0.0 + * Please note that a Tween will not manipulate any target property that begins with an underscore. * - * @param {Phaser.Types.Tweens.TimelineBuilderConfig} [config] - The configuration object for the Timeline and its Tweens. + * In order to play this tween, you'll need to add it to a Tween Manager via + * the `TweenManager.existing` method. * - * @return {Phaser.Tweens.Timeline} The created Timeline object. - */ - createTimeline: function (config) - { - return TimelineBuilder(this, config); - }, - - /** - * Create a Tween Timeline and add it to the active Tween list. - * - * @method Phaser.Tweens.TweenManager#timeline - * @since 3.0.0 - * - * @param {Phaser.Types.Tweens.TimelineBuilderConfig} [config] - The configuration object for the Timeline and its Tweens. - * - * @return {Phaser.Tweens.Timeline} The created Timeline object. - */ - timeline: function (config) - { - var timeline = TimelineBuilder(this, config); - - if (!timeline.paused) - { - this._add.push(timeline); - - this._toProcess++; - } - - return timeline; - }, - - /** - * Create a Tween and return it, but do NOT add it to the active or pending Tween lists. + * You can optionally pass an **array** of Tween Configuration objects to this method and it will create + * one Tween per entry in the array. If an array is given, an array of tweens is returned. * * @method Phaser.Tweens.TweenManager#create * @since 3.0.0 * - * @param {Phaser.Types.Tweens.TweenBuilderConfig|object} config - The configuration object for the Tween. + * @param {Phaser.Types.Tweens.TweenBuilderConfig|Phaser.Types.Tweens.TweenBuilderConfig[]|object|object[]} config - A Tween Configuration object. Or an array of Tween Configuration objects. * - * @return {Phaser.Tweens.Tween} The created Tween object. + * @return {Phaser.Tweens.Tween|Phaser.Tweens.Tween[]} The created Tween, or an array of Tweens if an array of tween configs was provided. */ create: function (config) { - return TweenBuilder(this, config); + if (!Array.isArray(config)) + { + config = [ config ]; + } + + var result = []; + + for (var i = 0; i < config.length; i++) + { + var tween = config[i]; + + if (tween instanceof Tween || tween instanceof TweenChain) + { + // Allow them to send an array of mixed instances and configs + result.push(tween); + } + else if (Array.isArray(tween.tweens)) + { + result.push(TweenChainBuilder(this, tween)); + } + else + { + result.push(TweenBuilder(this, tween)); + } + } + + return (result.length === 1) ? result[0] : result; }, /** - * Create a Tween and add it to the active Tween list. + * Create a Tween and add it to this Tween Manager by passing a Tween Configuration object. * - * Please note that a Tween will not manipulate any property that begins with an underscore. + * Example, run from within a Scene: + * + * ```js + * const logo = this.add.image(100, 100, 'logo'); + * + * this.tweens.add({ + * targets: logo, + * x: 600, + * ease: 'Power1', + * duration: 2000 + * }); + * ``` + * + * See the `TweenBuilderConfig` for all of the options you have available. + * + * Playback will start immediately unless the tween has been configured to be paused. + * + * Please note that a Tween will not manipulate any target property that begins with an underscore. + * + * Tweens are designed to be 'fire-and-forget'. They automatically destroy themselves once playback + * is complete, to free-up memory and resources. If you wish to keep a tween after playback, i.e. to + * play it again at a later time, then you should set the `persist` property to `true` in the config. + * However, doing so means it's entirely up to _you_ to destroy the tween when you're finished with it, + * otherwise it will linger in memory forever. + * + * You can optionally pass an **array** of Tween Configuration objects to this method and it will create + * one Tween per entry in the array. If an array is given, an array of tweens is returned. + * + * If you wish to chain Tweens together for sequential playback, see the `TweenManager.chain` method. * * @method Phaser.Tweens.TweenManager#add * @since 3.0.0 * - * @param {Phaser.Types.Tweens.TweenBuilderConfig|object} config - The configuration object for the Tween. + * @param {Phaser.Types.Tweens.TweenBuilderConfig|Phaser.Types.Tweens.TweenBuilderConfig[]|object|object[]} config - A Tween Configuration object. Or an array of Tween Configuration objects. * - * @return {Phaser.Tweens.Tween} The created Tween. + * @return {Phaser.Tweens.Tween|Phaser.Tweens.Tween[]} The created Tween, or an array of Tweens if an array of tween configs was provided. */ add: function (config) { - var tween = TweenBuilder(this, config); + var tween; + var result = []; + var tweens = this.tweens; - this._add.push(tween); + if (!Array.isArray(config)) + { + config = [ config ]; + } - this._toProcess++; + for (var i = 0; i < config.length; i++) + { + tween = config[i]; - return tween; + if (tween instanceof Tween || tween instanceof TweenChain) + { + tweens.push(tween.init()); + } + else + { + if (Array.isArray(tween.tweens)) + { + tween = TweenChainBuilder(this, tween); + } + else + { + tween = TweenBuilder(this, tween); + } + + tweens.push(tween.init()); + } + + result.push(tween); + } + + return (result.length === 1) ? result[0] : result; }, /** - * Add an existing tween into the active Tween list. + * Create a sequence of Tweens, chained to one-another, and add them to this Tween Manager. + * + * The tweens are played in order, from start to finish. You can optionally set the chain + * to repeat as many times as you like. Once the chain has finished playing, or repeating if set, + * all tweens in the chain will be destroyed automatically. To override this, set the 'persists' + * argument to 'true'. + * + * Playback will start immediately unless the _first_ Tween has been configured to be paused. + * + * Please note that Tweens will not manipulate any target property that begins with an underscore. + * + * @method Phaser.Tweens.TweenManager#chain + * @since 3.60.0 + * + * @param {Phaser.Types.Tweens.TweenBuilderConfig[]|object[]} tweens - A Tween Chain configuration object, or an array of them to create multiple chains at once. + * + * @return {(Phaser.Tweens.TweenChain|Phaser.Tweens.TweenChain[])} The Tween Chain instance, or an array of them if you passed in an array of configs. + */ + chain: function (config) + { + if (!Array.isArray(config)) + { + config = [ config ]; + } + + var chain; + var result = []; + var tweens = this.tweens; + + for (var i = 0; i < config.length; i++) + { + chain = TweenChainBuilder(this, config[i]); + + tweens.push(chain.init()); + + result.push(chain); + } + + return (result.length === 1) ? result[0] : result; + }, + + /** + * Returns an array containing this Tween and all Tweens chained to it, + * in the order in which they will be played. + * + * If there are no chained Tweens an empty array is returned. + * + * @method Phaser.Tweens.TweenManager#getChainedTweens + * @since 3.60.0 + * + * @param {Phaser.Tweens.Tween} tween - The Tween to return the chain from. + * + * @return {Phaser.Tweens.Tween[]} An array of the chained tweens, or an empty array if there aren't any. + */ + getChainedTweens: function (tween) + { + return tween.getChainedTweens(); + }, + + /** + * Check to see if the given Tween instance exists within this Tween Manager. + * + * Will return `true` as long as the Tween is being processed by this Tween Manager. + * + * Will return `false` if not present, or has a state of `REMOVED` or `DESTROYED`. + * + * @method Phaser.Tweens.TweenManager#has + * @since 3.60.0 + * + * @param {Phaser.Tweens.Tween} tween - The Tween instance to check. + * + * @return {boolean} `true` if the Tween exists within this Tween Manager, otherwise `false`. + */ + has: function (tween) + { + return (this.tweens.indexOf(tween) > -1); + }, + + /** + * Add an existing Tween to this Tween Manager. + * + * Playback will start immediately unless the tween has been configured to be paused. * * @method Phaser.Tweens.TweenManager#existing * @since 3.0.0 * * @param {Phaser.Tweens.Tween} tween - The Tween to add. * - * @return {Phaser.Tweens.TweenManager} This Tween Manager object. + * @return {this} This Tween Manager instance. */ existing: function (tween) { - this._add.push(tween); - - this._toProcess++; + if (!this.has(tween)) + { + this.tweens.push(tween.init()); + } return this; }, @@ -194671,6 +195439,10 @@ var TweenManager = new Class({ /** * Create a Number Tween and add it to the active Tween list. * + * Playback will start immediately unless the tween has been configured to be paused. + * + * Please note that a Tween will not manipulate any target property that begins with an underscore. + * * @method Phaser.Tweens.TweenManager#addCounter * @since 3.0.0 * @@ -194682,9 +195454,7 @@ var TweenManager = new Class({ { var tween = NumberTweenBuilder(this, config); - this._add.push(tween); - - this._toProcess++; + this.tweens.push(tween.init()); return tween; }, @@ -194736,168 +195506,279 @@ var TweenManager = new Class({ }, /** - * Updates the Tween Manager's internal lists at the start of the frame. + * Set the limits that are used when a browser encounters lag, or delays that cause the elapsed + * time between two frames to exceed the expected amount. If this occurs, the Tween Manager will + * act as if the 'skip' amount of times has passed, in order to maintain strict tween sequencing. * - * This method will return immediately if no changes have been indicated. + * This is enabled by default with the values 500ms for the lag limit and 33ms for the skip. * - * @method Phaser.Tweens.TweenManager#preUpdate - * @since 3.0.0 + * You should not set these to low values, as it won't give time for the browser to ever + * catch-up with itself and reclaim sync. + * + * Call this method with no arguments to disable smoothing. + * + * Call it with the arguments `500` and `33` to reset to the defaults. + * + * @method Phaser.Tweens.TweenManager#setLagSmooth + * @since 3.60.0 + * + * @param {number} [limit=0] - If the browser exceeds this amount, in milliseconds, it will act as if the 'skip' amount has elapsed instead. + * @param {number} [skip=0] - The amount, in milliseconds, to use as the step delta should the browser lag beyond the 'limit'. + * + * @return {this} This Tween Manager instance. */ - preUpdate: function () + setLagSmooth: function (limit, skip) { - if (this._toProcess === 0) - { - // Quick bail - return; - } + if (limit === undefined) { limit = 1 / 1e-8; } + if (skip === undefined) { skip = 0; } - var list = this._destroy; - var active = this._active; - var pending = this._pending; - var i; - var tween; + this.maxLag = limit; + this.lagSkip = Math.min(skip, this.maxLag); - // Clear the 'destroy' list - for (i = 0; i < list.length; i++) - { - tween = list[i]; - - // Remove from the 'active' array - var idx = active.indexOf(tween); - - if (idx === -1) - { - // Not in the active array, is it in pending instead? - idx = pending.indexOf(tween); - - if (idx > -1) - { - tween.state = TWEEN_CONST.REMOVED; - pending.splice(idx, 1); - } - } - else - { - tween.state = TWEEN_CONST.REMOVED; - active.splice(idx, 1); - } - } - - list.length = 0; - - // Process the addition list - // This stops callbacks and out of sync events from populating the active array mid-way during the update - - list = this._add; - - for (i = 0; i < list.length; i++) - { - tween = list[i]; - - if (tween.state === TWEEN_CONST.PENDING_ADD) - { - // Return true if the Tween should be started right away, otherwise false - if (tween.init()) - { - tween.play(); - - this._active.push(tween); - } - else - { - this._pending.push(tween); - } - } - } - - list.length = 0; - - this._toProcess = 0; + return this; }, /** - * Updates all Tweens and Timelines of the Tween Manager. + * Limits the Tween system to run at a particular frame rate. + * + * You should not set this _above_ the frequency of the browser, + * but instead can use it to throttle the frame rate lower, should + * you need to in certain situations. + * + * @method Phaser.Tweens.TweenManager#setFps + * @since 3.60.0 + * + * @param {number} [fps=240] - The frame rate to tick at. + * + * @return {this} This Tween Manager instance. + */ + setFps: function (fps) + { + if (fps === undefined) { fps = 240; } + + this.gap = 1000 / fps; + this.nextTime = this.time * 1000 + this.gap; + + return this; + }, + + /** + * Internal method that calculates the delta value, along with the other timing values, + * and returns the new delta. + * + * You should not typically call this method directly. + * + * @method Phaser.Tweens.TweenManager#getDelta + * @since 3.60.0 + * + * @param {boolean} [tick=false] - Is this a manual tick, or an automated tick? + * + * @return {number} The new delta value. + */ + getDelta: function (tick) + { + var elapsed = Date.now() - this.prevTime; + + if (elapsed > this.maxLag) + { + this.startTime += elapsed - this.lagSkip; + } + + this.prevTime += elapsed; + + var time = this.prevTime - this.startTime; + var overlap = time - this.nextTime; + var delta = time - this.time * 1000; + + if (overlap > 0 || tick) + { + time /= 1000; + this.time = time; + this.nextTime += overlap + (overlap >= this.gap ? 4 : this.gap - overlap); + } + else + { + delta = 0; + } + + return delta; + }, + + /** + * Manually advance the Tween system by one step. + * + * This will update all Tweens even if the Tween Manager is currently + * paused. + * + * @method Phaser.Tweens.TweenManager#tick + * @since 3.60.0 + * + * @return {this} This Tween Manager instance. + */ + tick: function () + { + this.step(true); + + return this; + }, + + /** + * Internal update handler. + * + * Calls `TweenManager.step` as long as the Tween Manager has not + * been paused. * * @method Phaser.Tweens.TweenManager#update * @since 3.0.0 - * - * @param {number} timestamp - The current time in milliseconds. - * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. */ - update: function (timestamp, delta) + update: function () { - // Process active tweens - var list = this._active; + if (!this.paused) + { + this.step(false); + } + }, + + /** + * Updates all Tweens belonging to this Tween Manager. + * + * Called automatically by `update` and `tick`. + * + * @method Phaser.Tweens.TweenManager#step + * @since 3.60.0 + * + * @param {boolean} [tick=false] - Is this a manual tick, or an automated tick? + */ + step: function (tick) + { + if (tick === undefined) { tick = false; } + + var delta = this.getDelta(tick); + + if (delta === 0) + { + return; + } + + this.processing = true; + + var i; var tween; + var toDestroy = []; + var list = this.tweens; - // Scale the delta - delta *= this.timeScale; - - for (var i = 0; i < list.length; i++) + // By not caching the length we can immediately update tweens added + // this frame (such as chained tweens) + for (i = 0; i < list.length; i++) { tween = list[i]; // If Tween.update returns 'true' then it means it has completed, // so move it to the destroy list - if (tween.update(timestamp, delta)) + if (tween.update(delta)) { - this._destroy.push(tween); - this._toProcess++; + toDestroy.push(tween); } } + + // Clean-up the 'toDestroy' list + var count = toDestroy.length; + + if (count && list.length > 0) + { + for (i = 0; i < count; i++) + { + tween = toDestroy[i]; + + var idx = list.indexOf(tween); + + if (idx > -1 && (tween.isPendingRemove() || tween.isDestroyed())) + { + list.splice(idx, 1); + + tween.destroy(); + } + } + + toDestroy.length = 0; + } + + this.processing = false; }, /** - * Removes the given tween from the Tween Manager, regardless of its state (pending or active). + * Removes the given Tween from this Tween Manager, even if it hasn't started + * playback yet. If this method is called while the Tween Manager is processing + * an update loop, then the tween will be flagged for removal at the start of + * the next frame. Otherwise, it is removed immediately. + * + * The removed tween is _not_ destroyed. It is just removed from this Tween Manager. * * @method Phaser.Tweens.TweenManager#remove * @since 3.17.0 * * @param {Phaser.Tweens.Tween} tween - The Tween to be removed. * - * @return {Phaser.Tweens.TweenManager} This Tween Manager object. + * @return {this} This Tween Manager instance. */ remove: function (tween) { - ArrayRemove(this._add, tween); - ArrayRemove(this._pending, tween); - ArrayRemove(this._active, tween); - ArrayRemove(this._destroy, tween); + if (this.processing) + { + // Remove it on the next frame + tween.setPendingRemoveState(); + } + else + { + // Remove it immediately + ArrayRemove(this.tweens, tween); - tween.state = TWEEN_CONST.REMOVED; + tween.setRemovedState(); + } return this; }, /** - * Checks if a Tween or Timeline is active and adds it to the Tween Manager at the start of the frame if it isn't. + * Resets the given Tween. + * + * If the Tween does not belong to this Tween Manager, it will first be added. + * + * Then it will seek to position 0 and playback will start on the next frame. + * + * @method Phaser.Tweens.TweenManager#reset + * @since 3.60.0 + * + * @param {Phaser.Tweens.Tween} tween - The Tween to be reset. + * + * @return {this} This Tween Manager instance. + */ + reset: function (tween) + { + this.existing(tween); + + tween.seek(); + + tween.setActiveState(); + + return this; + }, + + /** + * Checks if a Tween is active and adds it to the Tween Manager at the start of the frame if it isn't. * * @method Phaser.Tweens.TweenManager#makeActive * @since 3.0.0 * * @param {Phaser.Tweens.Tween} tween - The Tween to check. * - * @return {Phaser.Tweens.TweenManager} This Tween Manager object. + * @return {this} This Tween Manager instance. */ makeActive: function (tween) { - if (this._add.indexOf(tween) !== -1 || this._active.indexOf(tween) !== -1) - { - return this; - } + this.existing(tween); - var idx = this._pending.indexOf(tween); - - if (idx !== -1) - { - this._pending.splice(idx, 1); - } - - this._add.push(tween); - - tween.state = TWEEN_CONST.PENDING_ADD; - - this._toProcess++; + tween.setActiveState(); return this; }, @@ -194911,47 +195792,89 @@ var TweenManager = new Class({ * @param {function} callback - The function to call. * @param {object} [scope] - The scope (`this` object) to call the function with. * @param {...*} [args] - The arguments to pass into the function. Its first argument will always be the Tween currently being iterated. + * + * @return {this} This Tween Manager instance. */ each: function (callback, scope) { + var i; var args = [ null ]; - for (var i = 1; i < arguments.length; i++) + for (i = 1; i < arguments.length; i++) { args.push(arguments[i]); } - for (var texture in this.list) + this.tweens.forEach(function (tween) { - args[0] = this.list[texture]; + args[0] = tween; callback.apply(scope, args); - } + }); + + return this; }, /** - * Returns an array of all active Tweens and Timelines in the Tween Manager. + * Returns an array containing references to all Tweens in this Tween Manager. * - * @method Phaser.Tweens.TweenManager#getAllTweens + * It is safe to mutate the returned array. However, acting upon any of the Tweens + * within it, will adjust those stored in this Tween Manager, as they are passed + * by reference and not cloned. + * + * If you wish to get tweens for a specific target, see `getTweensOf`. + * + * @method Phaser.Tweens.TweenManager#getTweens * @since 3.0.0 * - * @return {Phaser.Tweens.Tween[]} A new array containing references to all active Tweens and Timelines. + * @return {Phaser.Tweens.Tween[]} A new array containing references to all Tweens. */ - getAllTweens: function () + getTweens: function () + { + return this.tweens.slice(); + }, + + /** + * Returns an array of all Tweens in the Tween Manager which affect the given target, or array of targets. + * + * It's possible for this method to return tweens that are about to be removed from + * the Tween Manager. You should check the state of the returned tween before acting + * upon it. + * + * @method Phaser.Tweens.TweenManager#getTweensOf + * @since 3.0.0 + * + * @param {object|array} target - The target to look for. Provide an array to look for multiple targets. + * + * @return {Phaser.Tweens.Tween[]} A new array containing all Tweens which affect the given target(s). + */ + getTweensOf: function (target) { - var list = this._active; var output = []; + var list = this.tweens; + + target = Flatten(target); + + var targetLen = target.length; for (var i = 0; i < list.length; i++) { - output.push(list[i]); + var tween = list[i]; + + for (var t = 0; t < targetLen; t++) + { + if (tween.hasTarget(target[t])) + { + output.push(tween); + } + } } return output; }, /** - * Returns the scale of the time delta for all Tweens and Timelines owned by this Tween Manager. + * Returns the scale of the time delta for all Tweens owned by this Tween Manager. * * @method Phaser.Tweens.TweenManager#getGlobalTimeScale * @since 3.0.0 @@ -194963,183 +195886,6 @@ var TweenManager = new Class({ return this.timeScale; }, - /** - * Returns an array of all Tweens or Timelines in the Tween Manager which affect the given target or array of targets. - * - * Only the currently active tweens are tested. A tween that has completed and is - * awaiting removal will not be included in the results. - * - * If you wish to also search pending tweens, use the `includePending` flag. - * - * @method Phaser.Tweens.TweenManager#getTweensOf - * @since 3.0.0 - * - * @param {(object|array)} target - The target to look for. Provide an array to look for multiple targets. - * @param {boolean} [includePending=false] - Also check for pending tweens, not just active ones? - * - * @return {Phaser.Tweens.Tween[]} A new array containing all Tweens and Timelines which affect the given target(s). - */ - getTweensOf: function (target, includePending) - { - if (includePending === undefined) { includePending = false; } - - var list = this._active; - var tween; - var output = []; - var i; - var t; - - if (!Array.isArray(target)) - { - target = [ target ]; - } - - for (i = 0; i < list.length; i++) - { - tween = list[i]; - - for (t = 0; t < target.length; t++) - { - if (tween.hasTarget(target[t])) - { - output.push(tween); - } - } - } - - if (includePending) - { - list = this._pending; - - for (i = 0; i < list.length; i++) - { - tween = list[i]; - - for (t = 0; t < target.length; t++) - { - if (tween.hasTarget(target[t])) - { - output.push(tween); - } - } - } - } - - return output; - }, - - /** - * Checks if the given object is being affected by a playing Tween. - * - * @method Phaser.Tweens.TweenManager#isTweening - * @since 3.0.0 - * - * @param {object} target - target Phaser.Tweens.Tween object - * - * @return {boolean} returns if target tween object is active or not - */ - isTweening: function (target) - { - var list = this._active; - var tween; - - for (var i = 0; i < list.length; i++) - { - tween = list[i]; - - if (tween.hasTarget(target) && tween.isPlaying()) - { - return true; - } - } - - return false; - }, - - /** - * Stops all Tweens in this Tween Manager. They will be removed at the start of the frame. - * - * @method Phaser.Tweens.TweenManager#killAll - * @since 3.0.0 - * - * @return {Phaser.Tweens.TweenManager} This Tween Manager. - */ - killAll: function () - { - var tweens = this.getAllTweens(); - - for (var i = 0; i < tweens.length; i++) - { - tweens[i].stop(); - } - - return this; - }, - - /** - * Stops all Tweens which affect the given target or array of targets. The Tweens will be removed from the Tween Manager at the start of the frame. - * - * @see {@link #getTweensOf} - * - * @method Phaser.Tweens.TweenManager#killTweensOf - * @since 3.0.0 - * - * @param {(object|array)} target - The target to look for. Provide an array to look for multiple targets. - * - * @return {Phaser.Tweens.TweenManager} This Tween Manager. - */ - killTweensOf: function (target) - { - var tweens = this.getTweensOf(target); - - for (var i = 0; i < tweens.length; i++) - { - tweens[i].stop(); - } - - return this; - }, - - /** - * Pauses all Tweens in this Tween Manager. - * - * @method Phaser.Tweens.TweenManager#pauseAll - * @since 3.0.0 - * - * @return {Phaser.Tweens.TweenManager} This Tween Manager. - */ - pauseAll: function () - { - var list = this._active; - - for (var i = 0; i < list.length; i++) - { - list[i].pause(); - } - - return this; - }, - - /** - * Resumes all Tweens in this Tween Manager. - * - * @method Phaser.Tweens.TweenManager#resumeAll - * @since 3.0.0 - * - * @return {Phaser.Tweens.TweenManager} This Tween Manager. - */ - resumeAll: function () - { - var list = this._active; - - for (var i = 0; i < list.length; i++) - { - list[i].resume(); - } - - return this; - }, - /** * Sets a new scale of the time delta for this Tween Manager. * @@ -195150,7 +195896,7 @@ var TweenManager = new Class({ * * @param {number} value - The new scale of the time delta, where 1 is the normal speed. * - * @return {Phaser.Tweens.TweenManager} This Tween Manager. + * @return {this} This Tween Manager instance. */ setGlobalTimeScale: function (value) { @@ -195159,8 +195905,144 @@ var TweenManager = new Class({ return this; }, + /** + * Checks if the given object is being affected by a _playing_ Tween. + * + * If the Tween is paused, this method will return false. + * + * @method Phaser.Tweens.TweenManager#isTweening + * @since 3.0.0 + * + * @param {object} target - The object to check if a tween is active for it, or not. + * + * @return {boolean} Returns `true` if a tween is active on the given target, otherwise `false`. + */ + isTweening: function (target) + { + var list = this.tweens; + var tween; + + for (var i = 0; i < list.length; i++) + { + tween = list[i]; + + if (tween.isPlaying() && tween.hasTarget(target)) + { + return true; + } + } + + return false; + }, + + /** + * Destroys all Tweens in this Tween Manager. + * + * The tweens will erase all references to any targets they hold + * and be stopped immediately. + * + * If this method is called while the Tween Manager is running its + * update process, then the tweens will be removed at the start of + * the next frame. Outside of this, they are removed immediately. + * + * @method Phaser.Tweens.TweenManager#killAll + * @since 3.0.0 + * + * @return {this} This Tween Manager instance. + */ + killAll: function () + { + var tweens = (this.processing) ? this.getAllTweens() : this.tweens; + + for (var i = 0; i < tweens.length; i++) + { + tweens[i].destroy(); + } + + if (!this.processing) + { + tweens.length = 0; + } + + return this; + }, + + /** + * Stops all Tweens which affect the given target or array of targets. + * + * The tweens will erase all references to any targets they hold + * and be stopped immediately. + * + * If this method is called while the Tween Manager is running its + * update process, then the tweens will be removed at the start of + * the next frame. Outside of this, they are removed immediately. + * + * @see {@link #getTweensOf} + * + * @method Phaser.Tweens.TweenManager#killTweensOf + * @since 3.0.0 + * + * @param {(object|array)} target - The target to kill the tweens of. Provide an array to use multiple targets. + * + * @return {this} This Tween Manager instance. + */ + killTweensOf: function (target) + { + var tweens = this.getTweensOf(target); + + for (var i = 0; i < tweens.length; i++) + { + tweens[i].destroy(); + } + + return this; + }, + + /** + * Pauses this Tween Manager. No Tweens will update while paused. + * + * This includes tweens created after this method was called. + * + * See `TweenManager#resumeAll` to resume the playback. + * + * As of Phaser 3.60 you can also toggle the boolean property `TweenManager.paused`. + * + * @method Phaser.Tweens.TweenManager#pauseAll + * @since 3.0.0 + * + * @return {this} This Tween Manager instance. + */ + pauseAll: function () + { + this.paused = true; + + return this; + }, + + /** + * Resumes playback of this Tween Manager. + * + * All active Tweens will continue updating. + * + * See `TweenManager#pauseAll` to pause the playback. + * + * As of Phaser 3.60 you can also toggle the boolean property `TweenManager.paused`. + * + * @method Phaser.Tweens.TweenManager#resumeAll + * @since 3.0.0 + * + * @return {this} This Tween Manager instance. + */ + resumeAll: function () + { + this.paused = false; + + return this; + }, + /** * The Scene that owns this plugin is shutting down. + * * We need to kill and reset all internal properties as well as stop listening to Scene events. * * @method Phaser.Tweens.TweenManager#shutdown @@ -195170,16 +196052,10 @@ var TweenManager = new Class({ { this.killAll(); - this._add = []; - this._pending = []; - this._active = []; - this._destroy = []; - - this._toProcess = 0; + this.tweens = []; var eventEmitter = this.systems.events; - eventEmitter.off(SceneEvents.PRE_UPDATE, this.preUpdate, this); eventEmitter.off(SceneEvents.UPDATE, this.update, this); eventEmitter.off(SceneEvents.SHUTDOWN, this.shutdown, this); }, @@ -195215,7 +196091,7 @@ module.exports = TweenManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -195227,9 +196103,9 @@ module.exports = TweenManager; * * @param {object} source - The object to retrieve the value from. * @param {string} key - The key to look for in the `source` object. - * @param {*} defaultValue - The default value to return if the `key` doesn't exist or if no `source` object is provided. + * @param {boolean} defaultValue - The default value to return if the `key` doesn't exist or if no `source` object is provided. * - * @return {*} The retrieved value. + * @return {boolean} The retrieved value. */ var GetBoolean = function (source, key, defaultValue) { @@ -195257,7 +196133,7 @@ module.exports = GetBoolean; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -195266,7 +196142,7 @@ var UppercaseFirst = __webpack_require__(40587); /** * This internal function is used to return the correct ease function for a Tween. - * + * * It can take a variety of input, including an EaseMap based string, or a custom function. * * @function Phaser.Tweens.Builders.GetEaseFunction @@ -195303,23 +196179,25 @@ var GetEaseFunction = function (ease, easeParams) // quad.out = Quad.easeOut // quad.inout = Quad.easeInOut - direction = ease.substr(ease.indexOf('.') + 1); + direction = ease.substring(ease.indexOf('.') + 1); - if (direction.toLowerCase() === 'in') + var directionLower = direction.toLowerCase(); + + if (directionLower === 'in') { direction = 'easeIn'; } - else if (direction.toLowerCase() === 'out') + else if (directionLower === 'out') { direction = 'easeOut'; } - else if (direction.toLowerCase() === 'inout') + else if (directionLower === 'inout') { direction = 'easeInOut'; } } - ease = UppercaseFirst(ease.substr(0, ease.indexOf('.') + 1) + direction); + ease = UppercaseFirst(ease.substring(0, ease.indexOf('.') + 1) + direction); if (EaseMap.hasOwnProperty(ease)) { @@ -195332,10 +196210,6 @@ var GetEaseFunction = function (ease, easeParams) // Custom function easeFunction = ease; } - else if (Array.isArray(ease) && ease.length === 4) - { - // Bezier function (TODO) - } // No custom ease parameters? if (!easeParams) @@ -195360,6 +196234,74 @@ var GetEaseFunction = function (ease, easeParams) module.exports = GetEaseFunction; +/***/ }), + +/***/ 4840: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Bezier = __webpack_require__(63210); +var CatmullRom = __webpack_require__(88332); +var Linear = __webpack_require__(47614); + +var FuncMap = { + bezier: Bezier, + catmull: CatmullRom, + catmullrom: CatmullRom, + linear: Linear +}; + +/** + * This internal function is used to return the correct interpolation function for a Tween. + * + * It can take a variety of input, including a string, or a custom function. + * + * @function Phaser.Tweens.Builders.GetInterpolationFunction + * @since 3.60.0 + * + * @param {(string|function|null)} interpolation - The interpolation function to find. This can be either a string, or a custom function, or null. + * + * @return {?function} The interpolation function to use, or `null`. + */ +var GetInterpolationFunction = function (interpolation) +{ + if (interpolation === null) + { + return null; + } + + // Default interpolation function + var interpolationFunction = FuncMap.linear; + + // Prepare interpolation function + if (typeof interpolation === 'string') + { + // String based look-up + + // 1) They specified it correctly + if (FuncMap.hasOwnProperty(interpolation)) + { + interpolationFunction = FuncMap[interpolation]; + } + } + else if (typeof interpolation === 'function') + { + // Custom function + interpolationFunction = interpolation; + } + + // Return interpolation function + return interpolationFunction; +}; + +module.exports = GetInterpolationFunction; + + /***/ }), /***/ 28348: @@ -195367,7 +196309,7 @@ module.exports = GetEaseFunction; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -195382,7 +196324,7 @@ module.exports = GetEaseFunction; * @param {string} key - The property to get from the source. * @param {any} defaultValue - A default value to return should the source not have the property set. * - * @return {function} A function which when called will return the property value from the source. + * @return {function} A function which, when called, will return the property value from the source. */ var GetNewValue = function (source, key, defaultValue) { @@ -195432,7 +196374,7 @@ module.exports = GetNewValue; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -195463,7 +196405,7 @@ var GetProps = function (config) for (key in config.props) { // Skip any property that starts with an underscore - if (key.substr(0, 1) !== '_') + if (key.substring(0, 1) !== '_') { keys.push({ key: key, value: config.props[key] }); } @@ -195474,7 +196416,7 @@ var GetProps = function (config) for (key in config) { // Skip any property that is in the ReservedProps list or that starts with an underscore - if (RESERVED.indexOf(key) === -1 && key.substr(0, 1) !== '_') + if (RESERVED.indexOf(key) === -1 && key.substring(0, 1) !== '_') { keys.push({ key: key, value: config[key] }); } @@ -195494,7 +196436,7 @@ module.exports = GetProps; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -195539,63 +196481,17 @@ module.exports = GetTargets; /***/ }), -/***/ 10365: +/***/ 9744: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetValue = __webpack_require__(10850); - -/** - * Internal function used by the Timeline Builder. - * - * It returns an array of all tweens in the given timeline config. - * - * @function Phaser.Tweens.Builders.GetTweens - * @since 3.0.0 - * - * @param {Phaser.Types.Tweens.TimelineBuilderConfig} config - The configuration object for the Timeline. - * - * @return {Phaser.Tweens.Tween[]} An array of Tween instances that the Timeline will manage. - */ -var GetTweens = function (config) -{ - var tweens = GetValue(config, 'tweens', null); - - if (tweens === null) - { - return []; - } - else if (typeof tweens === 'function') - { - tweens = tweens.call(); - } - - if (!Array.isArray(tweens)) - { - tweens = [ tweens ]; - } - - return tweens; -}; - -module.exports = GetTweens; - - -/***/ }), - -/***/ 9744: -/***/ ((module) => { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ +var Between = __webpack_require__(17489); +var FloatBetween = __webpack_require__(61616); /** * @ignore @@ -195631,7 +196527,7 @@ function hasGetters (def) /** * Returns `getActive`, `getStart` and `getEnd` functions for a TweenData based on a target property and end value. - * + * * `getActive` if not null, is invoked _immediately_ as soon as the TweenData is running, and is set on the target property. * `getEnd` is invoked once any start delays have expired and returns what the value should tween to. * `getStart` is invoked when the tween reaches the end and needs to either repeat or yoyo, it returns the value to go back to. @@ -195640,11 +196536,11 @@ function hasGetters (def) * A string can be provided to specify a relative end value which consists of an operation * (`+=` to add to the current value, `-=` to subtract from the current value, `*=` to multiply the current * value, or `/=` to divide the current value) followed by its operand. - * + * * A function can be provided to allow greater control over the end value; it will receive the target * object being tweened, the name of the property being tweened, and the current value of the property - * as its arguments. - * + * as its arguments and must return a value. + * * If both the starting and the ending values need to be controlled, an object with `getStart` and `getEnd` * callbacks, which will receive the same arguments, can be provided instead. If an object with a `value` * property is provided, the property will be used as the effective value under the same rules described here. @@ -195684,53 +196580,112 @@ var GetValueOp = function (key, propertyValue) return propertyValue; }; } + else if (Array.isArray(propertyValue)) + { + // props: { + // x: [ 400, 300, 200 ], + // y: [ 10, 500, 10 ] + // } + + getStart = function () + { + return propertyValue[0]; + }; + + getEnd = function () + { + return propertyValue[propertyValue.length - 1]; + }; + } else if (t === 'string') { // props: { // x: '+=400', // y: '-=300', // z: '*=2', - // w: '/=2' + // w: '/=2', + // p: 'random(10, 100)' - random float + // p: 'int(10, 100)' - random int // } - var op = propertyValue[0]; - var num = parseFloat(propertyValue.substr(2)); + var op = propertyValue.toLowerCase(); + var isRandom = (op.substring(0, 6) === 'random'); + var isInt = (op.substring(0, 3) === 'int'); - switch (op) + if (isRandom || isInt) { - case '+': - getEnd = function (target, key, value) - { - return value + num; - }; - break; + // random(0.5, 3.45) + // int(10, 100) + var brace1 = op.indexOf('('); + var brace2 = op.indexOf(')'); + var comma = op.indexOf(','); - case '-': - getEnd = function (target, key, value) - { - return value - num; - }; - break; + if (brace1 && brace2 && comma) + { + var value1 = parseFloat(op.substring(brace1 + 1, comma)); + var value2 = parseFloat(op.substring(comma + 1, brace2)); - case '*': - getEnd = function (target, key, value) + if (isRandom) { - return value * num; - }; - break; + getEnd = function () + { + return FloatBetween(value1, value2); + }; + } + else + { + getEnd = function () + { + return Between(value1, value2); + }; + } + } + else + { + throw new Error('invalid random() format'); + } + } + else + { + op = op[0]; + var num = parseFloat(propertyValue.substr(2)); - case '/': - getEnd = function (target, key, value) - { - return value / num; - }; - break; + switch (op) + { + case '+': + getEnd = function (target, key, value) + { + return value + num; + }; + break; - default: - getEnd = function () - { - return parseFloat(propertyValue); - }; + case '-': + getEnd = function (target, key, value) + { + return value - num; + }; + break; + + case '*': + getEnd = function (target, key, value) + { + return value * num; + }; + break; + + case '/': + getEnd = function (target, key, value) + { + return value / num; + }; + break; + + default: + getEnd = function () + { + return parseFloat(propertyValue); + }; + } } } else if (t === 'function') @@ -195738,7 +196693,7 @@ var GetValueOp = function (key, propertyValue) // The same as setting just the getEnd function and no getStart // props: { - // x: function (target, key, value, targetIndex, totalTargets, tween) { return value + 50); }, + // x: function (target, key, value, targetIndex, totalTargets, tween, tweenData) { return value + 50); }, // } getEnd = propertyValue; @@ -195750,19 +196705,19 @@ var GetValueOp = function (key, propertyValue) /* x: { // Called the moment Tween is active. The returned value sets the property on the target immediately. - getActive: function (target, key, value, targetIndex, totalTargets, tween) + getActive: function (target, key, value, targetIndex, totalTargets, tween, tweenData) { return value; }, // Called at the start of the Tween. The returned value sets what the property will be at the END of the Tween. - getEnd: function (target, key, value, targetIndex, totalTargets, tween) + getEnd: function (target, key, value, targetIndex, totalTargets, tween, tweenData) { return value; }, // Called at the end of the Tween. The returned value sets what the property will be at the START of the Tween. - getStart: function (target, key, value, targetIndex, totalTargets, tween) + getStart: function (target, key, value, targetIndex, totalTargets, tween, tweenData) { return value; } @@ -195825,14 +196780,14 @@ var GetValueOp = function (key, propertyValue) if (hasStart) { var startCallbacks = GetValueOp(key, propertyValue.start); - + callbacks.getActive = startCallbacks.getEnd; } - + if (hasFrom) { var fromCallbacks = GetValueOp(key, propertyValue.from); - + callbacks.getStart = fromCallbacks.getEnd; } } @@ -195862,10 +196817,11 @@ module.exports = GetValueOp; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var BaseTween = __webpack_require__(502); var Defaults = __webpack_require__(99730); var GetAdvancedValue = __webpack_require__(20494); var GetBoolean = __webpack_require__(63130); @@ -195873,8 +196829,8 @@ var GetEaseFunction = __webpack_require__(21902); var GetNewValue = __webpack_require__(28348); var GetValue = __webpack_require__(10850); var GetValueOp = __webpack_require__(9744); +var MergeRight = __webpack_require__(72066); var Tween = __webpack_require__(39366); -var TweenData = __webpack_require__(15718); /** * Creates a new Number Tween. @@ -195882,7 +196838,7 @@ var TweenData = __webpack_require__(15718); * @function Phaser.Tweens.Builders.NumberTweenBuilder * @since 3.0.0 * - * @param {(Phaser.Tweens.TweenManager|Phaser.Tweens.Timeline)} parent - The owner of the new Tween. + * @param {Phaser.Tweens.TweenManager} parent - The owner of the new Tween. * @param {Phaser.Types.Tweens.NumberTweenBuilderConfig} config - Configuration for the new Tween. * @param {Phaser.Types.Tweens.TweenConfigDefaults} defaults - Tween configuration defaults. * @@ -195890,10 +196846,21 @@ var TweenData = __webpack_require__(15718); */ var NumberTweenBuilder = function (parent, config, defaults) { + if (config instanceof Tween) + { + config.parent = parent; + + return config; + } + if (defaults === undefined) { defaults = Defaults; } + else + { + defaults = MergeRight(Defaults, defaults); + } // var tween = this.tweens.addCounter({ // from: 100, @@ -195910,56 +196877,46 @@ var NumberTweenBuilder = function (parent, config, defaults) var targets = [ { value: from } ]; - var delay = GetNewValue(config, 'delay', defaults.delay); - var duration = GetNewValue(config, 'duration', defaults.duration); + var delay = GetValue(config, 'delay', defaults.delay); var easeParams = GetValue(config, 'easeParams', defaults.easeParams); - var ease = GetEaseFunction(GetValue(config, 'ease', defaults.ease), easeParams); - var hold = GetNewValue(config, 'hold', defaults.hold); - var repeat = GetNewValue(config, 'repeat', defaults.repeat); - var repeatDelay = GetNewValue(config, 'repeatDelay', defaults.repeatDelay); - var yoyo = GetBoolean(config, 'yoyo', defaults.yoyo); - - var data = []; + var ease = GetValue(config, 'ease', defaults.ease); var ops = GetValueOp('value', to); - var tweenData = TweenData( - targets[0], + var tween = new Tween(parent, targets); + + // TODO - Needs tidying up + easeParams being used, etc + + var tweenData = tween.add( 0, 'value', ops.getEnd, ops.getStart, ops.getActive, - ease, - delay, - duration, - yoyo, - hold, - repeat, - repeatDelay, + GetEaseFunction(GetValue(config, 'ease', ease), GetValue(config, 'easeParams', easeParams)), + GetNewValue(config, 'delay', delay), + GetValue(config, 'duration', defaults.duration), + GetBoolean(config, 'yoyo', defaults.yoyo), + GetValue(config, 'hold', defaults.hold), + GetValue(config, 'repeat', defaults.repeat), + GetValue(config, 'repeatDelay', defaults.repeatDelay), false, false ); tweenData.start = from; tweenData.current = from; - tweenData.to = to; - data.push(tweenData); - - var tween = new Tween(parent, data, targets); - - tween.offset = GetAdvancedValue(config, 'offset', null); tween.completeDelay = GetAdvancedValue(config, 'completeDelay', 0); tween.loop = Math.round(GetAdvancedValue(config, 'loop', 0)); tween.loopDelay = Math.round(GetAdvancedValue(config, 'loopDelay', 0)); tween.paused = GetBoolean(config, 'paused', false); - tween.useFrames = GetBoolean(config, 'useFrames', false); + tween.persist = GetBoolean(config, 'persist', false); // Set the Callbacks - var scope = GetValue(config, 'callbackScope', tween); + tween.callbackScope = GetValue(config, 'callbackScope', tween); - var callbacks = Tween.TYPES; + var callbacks = BaseTween.TYPES; for (var i = 0; i < callbacks.length; i++) { @@ -195969,10 +196926,9 @@ var NumberTweenBuilder = function (parent, config, defaults) if (callback) { - var callbackScope = GetValue(config, type + 'Scope', scope); var callbackParams = GetValue(config, type + 'Params', []); - tween.setCallback(type, callback, callbackParams, callbackScope); + tween.setCallback(type, callback, callbackParams); } } @@ -195989,7 +196945,7 @@ module.exports = NumberTweenBuilder; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -195999,14 +196955,14 @@ var MATH_CONST = __webpack_require__(83392); /** * Creates a Stagger function to be used by a Tween property. - * + * * The stagger function will allow you to stagger changes to the value of the property across all targets of the tween. - * + * * This is only worth using if the tween has multiple targets. - * + * * The following will stagger the delay by 100ms across all targets of the tween, causing them to scale down to 0.2 * over the duration specified: - * + * * ```javascript * this.tweens.add({ * targets: [ ... ], @@ -196016,10 +196972,10 @@ var MATH_CONST = __webpack_require__(83392); * delay: this.tweens.stagger(100) * }); * ``` - * + * * The following will stagger the delay by 500ms across all targets of the tween using a 10 x 6 grid, staggering * from the center out, using a cubic ease. - * + * * ```javascript * this.tweens.add({ * targets: [ ... ], @@ -196067,7 +197023,7 @@ var StaggerBuilder = function (value, options) if (grid) { - // Pre-calc the grid to save doing it for ever tweendata update + // Pre-calc the grid to save doing it for every TweenData update var gridWidth = grid[0]; var gridHeight = grid[1]; @@ -196127,18 +197083,18 @@ var StaggerBuilder = function (value, options) var gridSpace = 0; var toX = index % gridWidth; var toY = Math.floor(index / gridWidth); - + if (toX >= 0 && toX < gridWidth && toY >= 0 && toY < gridHeight) { gridSpace = gridValues[toY][toX]; } var output; - + if (isRange) { var diff = (value2 - value1); - + if (easeFunction) { output = ((gridSpace / gridMax) * diff) * easeFunction(gridSpace / gridMax); @@ -196166,9 +197122,9 @@ var StaggerBuilder = function (value, options) { // zero offset total--; - + var fromIndex; - + if (fromFirst) { fromIndex = index; @@ -196185,9 +197141,9 @@ var StaggerBuilder = function (value, options) { fromIndex = Math.abs(from - index); } - + var output; - + if (isRange) { var spacing; @@ -196200,7 +197156,7 @@ var StaggerBuilder = function (value, options) { spacing = ((value2 - value1) / total) * fromIndex; } - + if (easeFunction) { output = spacing * easeFunction(fromIndex / total); @@ -196218,7 +197174,7 @@ var StaggerBuilder = function (value, options) { output = fromIndex * value1; } - + return output + start; }; } @@ -196229,158 +197185,6 @@ var StaggerBuilder = function (value, options) module.exports = StaggerBuilder; -/***/ }), - -/***/ 32981: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Clone = __webpack_require__(32742); -var Defaults = __webpack_require__(99730); -var GetAdvancedValue = __webpack_require__(20494); -var GetBoolean = __webpack_require__(63130); -var GetEaseFunction = __webpack_require__(21902); -var GetNewValue = __webpack_require__(28348); -var GetTargets = __webpack_require__(65868); -var GetTweens = __webpack_require__(10365); -var GetValue = __webpack_require__(10850); -var Timeline = __webpack_require__(28860); -var TweenBuilder = __webpack_require__(68061); - -/** - * Builds a Timeline of Tweens based on a configuration object. - * - * @function Phaser.Tweens.Builders.TimelineBuilder - * @since 3.0.0 - * - * @param {Phaser.Tweens.TweenManager} manager - The Tween Manager to which the Timeline will belong. - * @param {Phaser.Types.Tweens.TimelineBuilderConfig} config - The configuration object for the Timeline. - * - * @return {Phaser.Tweens.Timeline} The created Timeline. - */ -var TimelineBuilder = function (manager, config) -{ - var timeline = new Timeline(manager); - - timeline.completeDelay = GetAdvancedValue(config, 'completeDelay', 0); - timeline.loop = Math.round(GetAdvancedValue(config, 'loop', 0)); - timeline.loopDelay = Math.round(GetAdvancedValue(config, 'loopDelay', 0)); - timeline.paused = GetBoolean(config, 'paused', false); - timeline.useFrames = GetBoolean(config, 'useFrames', false); - - // Callbacks - - var scope = GetValue(config, 'callbackScope', timeline); - var onStart = GetValue(config, 'onStart', false); - - // The Start of the Timeline - if (onStart) - { - var onStartScope = GetValue(config, 'onStartScope', scope); - var onStartParams = GetValue(config, 'onStartParams', []); - - timeline.setCallback('onStart', onStart, onStartParams, onStartScope); - } - - var onUpdate = GetValue(config, 'onUpdate', false); - - // Every time the Timeline updates (regardless which Tweens are running) - if (onUpdate) - { - var onUpdateScope = GetValue(config, 'onUpdateScope', scope); - var onUpdateParams = GetValue(config, 'onUpdateParams', []); - - timeline.setCallback('onUpdate', onUpdate, onUpdateParams, onUpdateScope); - } - - var onLoop = GetValue(config, 'onLoop', false); - - // Called when the whole Timeline loops - if (onLoop) - { - var onLoopScope = GetValue(config, 'onLoopScope', scope); - var onLoopParams = GetValue(config, 'onLoopParams', []); - - timeline.setCallback('onLoop', onLoop, onLoopParams, onLoopScope); - } - - var onYoyo = GetValue(config, 'onYoyo', false); - - // Called when a Timeline yoyos - if (onYoyo) - { - var onYoyoScope = GetValue(config, 'onYoyoScope', scope); - var onYoyoParams = GetValue(config, 'onYoyoParams', []); - - timeline.setCallback('onYoyo', onYoyo, onYoyoParams, onYoyoScope); - } - - var onComplete = GetValue(config, 'onComplete', false); - - // Called when the Timeline completes, after the completeDelay, etc. - if (onComplete) - { - var onCompleteScope = GetValue(config, 'onCompleteScope', scope); - var onCompleteParams = GetValue(config, 'onCompleteParams', []); - - timeline.setCallback('onComplete', onComplete, onCompleteParams, onCompleteScope); - } - - // Tweens - - var tweens = GetTweens(config); - - if (tweens.length === 0) - { - timeline.paused = true; - - return timeline; - } - - var defaults = Clone(Defaults); - - defaults.targets = GetTargets(config); - - // totalDuration: If specified each tween in the Timeline is given an equal portion of the totalDuration - - var totalDuration = GetAdvancedValue(config, 'totalDuration', 0); - - if (totalDuration > 0) - { - defaults.duration = Math.floor(totalDuration / tweens.length); - } - else - { - defaults.duration = GetNewValue(config, 'duration', defaults.duration); - } - - defaults.delay = GetNewValue(config, 'delay', defaults.delay); - defaults.easeParams = GetValue(config, 'easeParams', defaults.easeParams); - defaults.ease = GetEaseFunction(GetValue(config, 'ease', defaults.ease), defaults.easeParams); - defaults.hold = GetNewValue(config, 'hold', defaults.hold); - defaults.repeat = GetNewValue(config, 'repeat', defaults.repeat); - defaults.repeatDelay = GetNewValue(config, 'repeatDelay', defaults.repeatDelay); - defaults.yoyo = GetBoolean(config, 'yoyo', defaults.yoyo); - defaults.flipX = GetBoolean(config, 'flipX', defaults.flipX); - defaults.flipY = GetBoolean(config, 'flipY', defaults.flipY); - - // Create the Tweens - for (var i = 0; i < tweens.length; i++) - { - timeline.queue(TweenBuilder(timeline, tweens[i], defaults)); - } - - return timeline; -}; - -module.exports = TimelineBuilder; - - /***/ }), /***/ 68061: @@ -196388,21 +197192,23 @@ module.exports = TimelineBuilder; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var BaseTween = __webpack_require__(502); var Defaults = __webpack_require__(99730); var GetAdvancedValue = __webpack_require__(20494); var GetBoolean = __webpack_require__(63130); var GetEaseFunction = __webpack_require__(21902); +var GetInterpolationFunction = __webpack_require__(4840); var GetNewValue = __webpack_require__(28348); var GetProps = __webpack_require__(92407); var GetTargets = __webpack_require__(65868); var GetValue = __webpack_require__(10850); var GetValueOp = __webpack_require__(9744); +var MergeRight = __webpack_require__(72066); var Tween = __webpack_require__(39366); -var TweenData = __webpack_require__(15718); /** * Creates a new Tween. @@ -196410,7 +197216,7 @@ var TweenData = __webpack_require__(15718); * @function Phaser.Tweens.Builders.TweenBuilder * @since 3.0.0 * - * @param {(Phaser.Tweens.TweenManager|Phaser.Tweens.Timeline)} parent - The owner of the new Tween. + * @param {Phaser.Tweens.TweenManager} parent - The owner of the new Tween. * @param {Phaser.Types.Tweens.TweenBuilderConfig|object} config - Configuration for the new Tween. * @param {Phaser.Types.Tweens.TweenConfigDefaults} defaults - Tween configuration defaults. * @@ -196418,30 +197224,110 @@ var TweenData = __webpack_require__(15718); */ var TweenBuilder = function (parent, config, defaults) { + if (config instanceof Tween) + { + config.parent = parent; + + return config; + } + if (defaults === undefined) { defaults = Defaults; } + else + { + defaults = MergeRight(Defaults, defaults); + } // Create arrays of the Targets and the Properties - var targets = (defaults.targets) ? defaults.targets : GetTargets(config); + var targets = GetTargets(config); + + if (!targets && defaults.targets) + { + targets = defaults.targets; + } - // var props = (defaults.props) ? defaults.props : GetProps(config); var props = GetProps(config); // Default Tween values - var delay = GetNewValue(config, 'delay', defaults.delay); - var duration = GetNewValue(config, 'duration', defaults.duration); + + var delay = GetValue(config, 'delay', defaults.delay); + var duration = GetValue(config, 'duration', defaults.duration); var easeParams = GetValue(config, 'easeParams', defaults.easeParams); - var ease = GetEaseFunction(GetValue(config, 'ease', defaults.ease), easeParams); - var hold = GetNewValue(config, 'hold', defaults.hold); - var repeat = GetNewValue(config, 'repeat', defaults.repeat); - var repeatDelay = GetNewValue(config, 'repeatDelay', defaults.repeatDelay); + var ease = GetValue(config, 'ease', defaults.ease); + var hold = GetValue(config, 'hold', defaults.hold); + var repeat = GetValue(config, 'repeat', defaults.repeat); + var repeatDelay = GetValue(config, 'repeatDelay', defaults.repeatDelay); var yoyo = GetBoolean(config, 'yoyo', defaults.yoyo); var flipX = GetBoolean(config, 'flipX', defaults.flipX); var flipY = GetBoolean(config, 'flipY', defaults.flipY); + var interpolation = GetValue(config, 'interpolation', defaults.interpolation); - var data = []; + var addTarget = function (tween, targetIndex, key, value) + { + if (key === 'texture') + { + var texture = value; + var frame = undefined; + + if (Array.isArray(value)) + { + texture = value[0]; + frame = value[1]; + } + else if (value.hasOwnProperty('value')) + { + texture = value.value; + + if (Array.isArray(value.value)) + { + texture = value.value[0]; + frame = value.value[1]; + } + } + + tween.addFrame( + targetIndex, + texture, + frame, + GetNewValue(value, 'delay', delay), + GetValue(value, 'duration', duration), + GetValue(value, 'hold', hold), + GetValue(value, 'repeat', repeat), + GetValue(value, 'repeatDelay', repeatDelay), + GetBoolean(value, 'flipX', flipX), + GetBoolean(value, 'flipY', flipY) + ); + } + else + { + var ops = GetValueOp(key, value); + + var interpolationFunc = GetInterpolationFunction(GetValue(value, 'interpolation', interpolation)); + + tween.add( + targetIndex, + key, + ops.getEnd, + ops.getStart, + ops.getActive, + GetEaseFunction(GetValue(value, 'ease', ease), GetValue(value, 'easeParams', easeParams)), + GetNewValue(value, 'delay', delay), + GetValue(value, 'duration', duration), + GetBoolean(value, 'yoyo', yoyo), + GetValue(value, 'hold', hold), + GetValue(value, 'repeat', repeat), + GetValue(value, 'repeatDelay', repeatDelay), + GetBoolean(value, 'flipX', flipX), + GetBoolean(value, 'flipY', flipY), + interpolationFunc, + (interpolationFunc) ? value : null + ); + } + }; + + var tween = new Tween(parent, targets); // Loop through every property defined in the Tween, i.e.: props { x, y, alpha } for (var p = 0; p < props.length; p++) @@ -196450,44 +197336,31 @@ var TweenBuilder = function (parent, config, defaults) var value = props[p].value; // Create 1 TweenData per target, per property - for (var t = 0; t < targets.length; t++) + for (var targetIndex = 0; targetIndex < targets.length; targetIndex++) { - var ops = GetValueOp(key, value); - - var tweenData = TweenData( - targets[t], - t, - key, - ops.getEnd, - ops.getStart, - ops.getActive, - GetEaseFunction(GetValue(value, 'ease', ease), GetValue(value, 'easeParams', easeParams)), - GetNewValue(value, 'delay', delay), - GetNewValue(value, 'duration', duration), - GetBoolean(value, 'yoyo', yoyo), - GetNewValue(value, 'hold', hold), - GetNewValue(value, 'repeat', repeat), - GetNewValue(value, 'repeatDelay', repeatDelay), - GetBoolean(value, 'flipX', flipX), - GetBoolean(value, 'flipY', flipY) - ); - - data.push(tweenData); + // Special-case for scale short-cut: + if (key === 'scale' && !targets[targetIndex].hasOwnProperty('scale')) + { + addTarget(tween, targetIndex, 'scaleX', value); + addTarget(tween, targetIndex, 'scaleY', value); + } + else + { + addTarget(tween, targetIndex, key, value); + } } } - var tween = new Tween(parent, data, targets); - - tween.offset = GetAdvancedValue(config, 'offset', null); tween.completeDelay = GetAdvancedValue(config, 'completeDelay', 0); tween.loop = Math.round(GetAdvancedValue(config, 'loop', 0)); tween.loopDelay = Math.round(GetAdvancedValue(config, 'loopDelay', 0)); tween.paused = GetBoolean(config, 'paused', false); - tween.useFrames = GetBoolean(config, 'useFrames', false); + tween.persist = GetBoolean(config, 'persist', false); // Set the Callbacks - var scope = GetValue(config, 'callbackScope', tween); - var callbacks = Tween.TYPES; + tween.callbackScope = GetValue(config, 'callbackScope', tween); + + var callbacks = BaseTween.TYPES; for (var i = 0; i < callbacks.length; i++) { @@ -196497,10 +197370,9 @@ var TweenBuilder = function (parent, config, defaults) if (callback) { - var callbackScope = GetValue(config, type + 'Scope', scope); var callbackParams = GetValue(config, type + 'Params', []); - tween.setCallback(type, callback, callbackParams, callbackScope); + tween.setCallback(type, callback, callbackParams); } } @@ -196510,6 +197382,105 @@ var TweenBuilder = function (parent, config, defaults) module.exports = TweenBuilder; +/***/ }), + +/***/ 56034: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BaseTween = __webpack_require__(502); +var GetAdvancedValue = __webpack_require__(20494); +var GetBoolean = __webpack_require__(63130); +var GetTargets = __webpack_require__(65868); +var GetValue = __webpack_require__(10850); +var TweenBuilder = __webpack_require__(68061); +var TweenChain = __webpack_require__(45641); + +/** + * Creates a new Tween Chain instance. + * + * @function Phaser.Tweens.Builders.TweenChainBuilder + * @since 3.60.0 + * + * @param {Phaser.Tweens.TweenManager} parent - The owner of the new Tween. + * @param {Phaser.Types.Tweens.TweenChainBuilderConfig|object} config - Configuration for the new Tween. + * + * @return {Phaser.Tweens.TweenChain} The new Tween Chain. + */ +var TweenChainBuilder = function (parent, config) +{ + if (config instanceof TweenChain) + { + config.parent = parent; + + return config; + } + + // Default TweenChain values + + var chain = new TweenChain(parent); + + chain.startDelay = GetValue(config, 'delay', 0); + chain.completeDelay = GetAdvancedValue(config, 'completeDelay', 0); + chain.loop = Math.round(GetAdvancedValue(config, 'loop', GetValue(config, 'repeat', 0))); + chain.loopDelay = Math.round(GetAdvancedValue(config, 'loopDelay', GetValue(config, 'repeatDelay', 0))); + chain.paused = GetBoolean(config, 'paused', false); + chain.persist = GetBoolean(config, 'persist', true); + + // Set the Callbacks + chain.callbackScope = GetValue(config, 'callbackScope', chain); + + var i; + var callbacks = BaseTween.TYPES; + + for (i = 0; i < callbacks.length; i++) + { + var type = callbacks[i]; + + var callback = GetValue(config, type, false); + + if (callback) + { + var callbackParams = GetValue(config, type + 'Params', []); + + chain.setCallback(type, callback, callbackParams); + } + } + + // Add in the Tweens + var tweens = GetValue(config, 'tweens', null); + + if (Array.isArray(tweens)) + { + var chainedTweens = []; + + var targets = GetTargets(config); + var defaults = undefined; + + if (targets) + { + defaults = { targets: targets }; + } + + for (i = 0; i < tweens.length; i++) + { + chainedTweens.push(TweenBuilder(chain, tweens[i], defaults)); + } + + chain.add(chainedTweens); + } + + return chain; +}; + +module.exports = TweenChainBuilder; + + /***/ }), /***/ 79619: @@ -196517,7 +197488,7 @@ module.exports = TweenBuilder; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -196529,245 +197500,18 @@ module.exports = { GetBoolean: __webpack_require__(63130), GetEaseFunction: __webpack_require__(21902), + GetInterpolationFunction: __webpack_require__(4840), GetNewValue: __webpack_require__(28348), GetProps: __webpack_require__(92407), GetTargets: __webpack_require__(65868), - GetTweens: __webpack_require__(10365), GetValueOp: __webpack_require__(9744), NumberTweenBuilder: __webpack_require__(68710), StaggerBuilder: __webpack_require__(91944), - TimelineBuilder: __webpack_require__(32981), TweenBuilder: __webpack_require__(68061) }; -/***/ }), - -/***/ 51910: -/***/ ((module) => { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Timeline Complete Event. - * - * This event is dispatched by a Tween Timeline when it completes playback. - * - * Listen to it from a Timeline instance using `Timeline.on('complete', listener)`, i.e.: - * - * ```javascript - * var timeline = this.tweens.timeline({ - * targets: image, - * ease: 'Power1', - * duration: 3000, - * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] - * }); - * timeline.on('complete', listener); - * timeline.play(); - * ``` - * - * @event Phaser.Tweens.Events#TIMELINE_COMPLETE - * @since 3.0.0 - * - * @param {Phaser.Tweens.Timeline} timeline - A reference to the Timeline instance that emitted the event. - */ -module.exports = 'complete'; - - -/***/ }), - -/***/ 76826: -/***/ ((module) => { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Timeline Loop Event. - * - * This event is dispatched by a Tween Timeline every time it loops. - * - * Listen to it from a Timeline instance using `Timeline.on('loop', listener)`, i.e.: - * - * ```javascript - * var timeline = this.tweens.timeline({ - * targets: image, - * ease: 'Power1', - * duration: 3000, - * loop: 4, - * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] - * }); - * timeline.on('loop', listener); - * timeline.play(); - * ``` - * - * @event Phaser.Tweens.Events#TIMELINE_LOOP - * @since 3.0.0 - * - * @param {Phaser.Tweens.Timeline} timeline - A reference to the Timeline instance that emitted the event. - */ -module.exports = 'loop'; - - -/***/ }), - -/***/ 59953: -/***/ ((module) => { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Timeline Pause Event. - * - * This event is dispatched by a Tween Timeline when it is paused. - * - * Listen to it from a Timeline instance using `Timeline.on('pause', listener)`, i.e.: - * - * ```javascript - * var timeline = this.tweens.timeline({ - * targets: image, - * ease: 'Power1', - * duration: 3000, - * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] - * }); - * timeline.on('pause', listener); - * // At some point later ... - * timeline.pause(); - * ``` - * - * @event Phaser.Tweens.Events#TIMELINE_PAUSE - * @since 3.0.0 - * - * @param {Phaser.Tweens.Timeline} timeline - A reference to the Timeline instance that emitted the event. - */ -module.exports = 'pause'; - - -/***/ }), - -/***/ 92495: -/***/ ((module) => { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Timeline Resume Event. - * - * This event is dispatched by a Tween Timeline when it is resumed from a paused state. - * - * Listen to it from a Timeline instance using `Timeline.on('resume', listener)`, i.e.: - * - * ```javascript - * var timeline = this.tweens.timeline({ - * targets: image, - * ease: 'Power1', - * duration: 3000, - * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] - * }); - * timeline.on('resume', listener); - * // At some point later ... - * timeline.resume(); - * ``` - * - * @event Phaser.Tweens.Events#TIMELINE_RESUME - * @since 3.0.0 - * - * @param {Phaser.Tweens.Timeline} timeline - A reference to the Timeline instance that emitted the event. - */ -module.exports = 'resume'; - - -/***/ }), - -/***/ 55493: -/***/ ((module) => { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Timeline Start Event. - * - * This event is dispatched by a Tween Timeline when it starts. - * - * Listen to it from a Timeline instance using `Timeline.on('start', listener)`, i.e.: - * - * ```javascript - * var timeline = this.tweens.timeline({ - * targets: image, - * ease: 'Power1', - * duration: 3000, - * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] - * }); - * timeline.on('start', listener); - * timeline.play(); - * ``` - * - * @event Phaser.Tweens.Events#TIMELINE_START - * @since 3.0.0 - * - * @param {Phaser.Tweens.Timeline} timeline - A reference to the Timeline instance that emitted the event. - */ -module.exports = 'start'; - - -/***/ }), - -/***/ 48224: -/***/ ((module) => { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Timeline Update Event. - * - * This event is dispatched by a Tween Timeline every time it updates, which can happen a lot of times per second, - * so be careful about listening to this event unless you absolutely require it. - * - * Listen to it from a Timeline instance using `Timeline.on('update', listener)`, i.e.: - * - * ```javascript - * var timeline = this.tweens.timeline({ - * targets: image, - * ease: 'Power1', - * duration: 3000, - * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] - * }); - * timeline.on('update', listener); - * timeline.play(); - * ``` - * - * @event Phaser.Tweens.Events#TIMELINE_UPDATE - * @since 3.0.0 - * - * @param {Phaser.Tweens.Timeline} timeline - A reference to the Timeline instance that emitted the event. - */ -module.exports = 'update'; - - /***/ }), /***/ 5570: @@ -196775,36 +197519,40 @@ module.exports = 'update'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Tween Active Event. - * + * * This event is dispatched by a Tween when it becomes active within the Tween Manager. - * + * * An 'active' Tween is one that is now progressing, although it may not yet be updating * any target properties, due to settings such as `delay`. If you need an event for when * the Tween starts actually updating its first property, see `TWEEN_START`. - * + * * Listen to it from a Tween instance using `Tween.on('active', listener)`, i.e.: - * + * * ```javascript - * var tween = this.tweens.add({ + * var tween = this.tweens.create({ * targets: image, * x: 500, * ease: 'Power1', * duration: 3000 * }); * tween.on('active', listener); + * this.tweens.existing(tween); * ``` * + * Note that this event is usually dispatched already by the time you call `this.tweens.add()`, and is + * meant for use with `tweens.create()` and/or `tweens.existing()`. + * * @event Phaser.Tweens.Events#TWEEN_ACTIVE * @since 3.19.0 - * + * * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. - * @param {any[]} targets - An array of references to the target/s the Tween is operating on. + * @param {(any|any[])} targets - The targets of the Tween. If this Tween has multiple targets this will be an array of the targets. */ module.exports = 'active'; @@ -196816,22 +197564,22 @@ module.exports = 'active'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Tween Complete Event. - * + * * This event is dispatched by a Tween when it completes playback entirely, factoring in repeats and loops. - * + * * If the Tween has been set to loop or repeat infinitely, this event will not be dispatched * unless the `Tween.stop` method is called. - * + * * If a Tween has a `completeDelay` set, this event will fire after that delay expires. - * + * * Listen to it from a Tween instance using `Tween.on('complete', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.add({ * targets: image, @@ -196844,9 +197592,9 @@ module.exports = 'active'; * * @event Phaser.Tweens.Events#TWEEN_COMPLETE * @since 3.19.0 - * + * * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. - * @param {any[]} targets - An array of references to the target/s the Tween is operating on. + * @param {(any|any[])} targets - The targets of the Tween. If this Tween has multiple targets this will be an array of the targets. */ module.exports = 'complete'; @@ -196858,24 +197606,24 @@ module.exports = 'complete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Tween Loop Event. - * + * * This event is dispatched by a Tween when it loops. - * + * * This event will only be dispatched if the Tween has a loop count set. - * + * * If a Tween has a `loopDelay` set, this event will fire after that delay expires. - * + * * The difference between `loop` and `repeat` is that `repeat` is a property setting, * where-as `loop` applies to the entire Tween. - * + * * Listen to it from a Tween instance using `Tween.on('loop', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.add({ * targets: image, @@ -196889,13 +197637,51 @@ module.exports = 'complete'; * * @event Phaser.Tweens.Events#TWEEN_LOOP * @since 3.19.0 - * + * * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. - * @param {any[]} targets - An array of references to the target/s the Tween is operating on. + * @param {(any|any[])} targets - The targets of the Tween. If this Tween has multiple targets this will be an array of the targets. */ module.exports = 'loop'; +/***/ }), + +/***/ 90281: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Tween Pause Event. + * + * This event is dispatched by a Tween when it is paused. + * + * Listen to it from a Tween instance using `Tween.on('pause', listener)`, i.e.: + * + * ```javascript + * var tween = this.tweens.add({ + * targets: image, + * ease: 'Power1', + * duration: 3000, + * x: 600 + * }); + * tween.on('pause', listener); + * // At some point later ... + * tween.pause(); + * ``` + * + * @event Phaser.Tweens.Events#TWEEN_PAUSE + * @since 3.60.0 + * + * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. + */ +module.exports = 'pause'; + + /***/ }), /***/ 80803: @@ -196903,24 +197689,24 @@ module.exports = 'loop'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Tween Repeat Event. - * + * * This event is dispatched by a Tween when one of the properties it is tweening repeats. - * + * * This event will only be dispatched if the Tween has a property with a repeat count set. - * + * * If a Tween has a `repeatDelay` set, this event will fire after that delay expires. - * + * * The difference between `loop` and `repeat` is that `repeat` is a property setting, * where-as `loop` applies to the entire Tween. - * + * * Listen to it from a Tween instance using `Tween.on('repeat', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.add({ * targets: image, @@ -196934,14 +197720,54 @@ module.exports = 'loop'; * * @event Phaser.Tweens.Events#TWEEN_REPEAT * @since 3.19.0 - * + * * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. - * @param {string} key - The key of the property that just repeated. - * @param {any} target - The target that the property just repeated on. + * @param {string} key - The property on the target that has just repeated, i.e. `x` or `scaleY`, or whatever property you are tweening. + * @param {any} target - The target object that was repeated. Usually a Game Object, but can be of any type. + * @param {number} current - The current value of the property being set on the target. + * @param {number} previous - The previous value of the property being set on the target. */ module.exports = 'repeat'; +/***/ }), + +/***/ 13640: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Tween Resume Event. + * + * This event is dispatched by a Tween when it is resumed from a paused state. + * + * Listen to it from a Tween instance using `Tween.on('resume', listener)`, i.e.: + * + * ```javascript + * var tween = this.tweens.add({ + * targets: image, + * ease: 'Power1', + * duration: 3000, + * x: 600 + * }); + * tween.on('resume', listener); + * // At some point later ... + * tween.resume(); + * ``` + * + * @event Phaser.Tweens.Events#TWEEN_RESUME + * @since 3.60.0 + * + * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. + */ +module.exports = 'resume'; + + /***/ }), /***/ 10472: @@ -196949,21 +197775,21 @@ module.exports = 'repeat'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Tween Start Event. - * + * * This event is dispatched by a Tween when it starts tweening its first property. - * + * * A Tween will only emit this event once, as it can only start once. - * + * * If a Tween has a `delay` set, this event will fire after that delay expires. - * + * * Listen to it from a Tween instance using `Tween.on('start', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.add({ * targets: image, @@ -196976,9 +197802,9 @@ module.exports = 'repeat'; * * @event Phaser.Tweens.Events#TWEEN_START * @since 3.19.0 - * + * * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. - * @param {any[]} targets - An array of references to the target/s the Tween is operating on. + * @param {(any|any[])} targets - The targets of the Tween. If this Tween has multiple targets this will be an array of the targets. */ module.exports = 'start'; @@ -196990,7 +197816,7 @@ module.exports = 'start'; /** * @author samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -197015,7 +197841,7 @@ module.exports = 'start'; * @since 3.24.0 * * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. - * @param {any[]} targets - An array of references to the target/s the Tween is operating on. + * @param {(any|any[])} targets - The targets of the Tween. If this Tween has multiple targets this will be an array of the targets. */ module.exports = 'stop'; @@ -197027,21 +197853,21 @@ module.exports = 'stop'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Tween Update Event. - * + * * This event is dispatched by a Tween every time it updates _any_ of the properties it is tweening. - * + * * A Tween that is changing 3 properties of a target will emit this event 3 times per change, once per property. - * + * * **Note:** This is a very high frequency event and may be dispatched multiple times, every single frame. - * + * * Listen to it from a Tween instance using `Tween.on('update', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.add({ * targets: image, @@ -197054,9 +197880,9 @@ module.exports = 'stop'; * * @event Phaser.Tweens.Events#TWEEN_UPDATE * @since 3.19.0 - * + * * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. - * @param {string} key - The property that was updated, i.e. `x` or `scale`. + * @param {string} key - The property on the target that has just updated, i.e. `x` or `scaleY`, or whatever property you are tweening. * @param {any} target - The target object that was updated. Usually a Game Object, but can be of any type. * @param {number} current - The current value of the property that was tweened. * @param {number} previous - The previous value of the property that was tweened, prior to this update. @@ -197071,25 +197897,25 @@ module.exports = 'update'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Tween Yoyo Event. - * + * * This event is dispatched by a Tween whenever a property it is tweening yoyos. - * + * * This event will only be dispatched if the Tween has a property with `yoyo` set. - * + * * If the Tween has a `hold` value, this event is dispatched when the hold expires. - * + * * This event is dispatched for every property, and for every target, that yoyos. * For example, if a Tween was updating 2 properties and had 10 targets, this event * would be dispatched 20 times (twice per target). So be careful how you use it! - * + * * Listen to it from a Tween instance using `Tween.on('yoyo', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.add({ * targets: image, @@ -197103,10 +197929,12 @@ module.exports = 'update'; * * @event Phaser.Tweens.Events#TWEEN_YOYO * @since 3.19.0 - * + * * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. - * @param {string} key - The property that yoyo'd, i.e. `x` or `scale`. + * @param {string} key - The property on the target that has just yoyo'd, i.e. `x` or `scaleY`, or whatever property you are tweening. * @param {any} target - The target object that was yoyo'd. Usually a Game Object, but can be of any type. + * @param {number} current - The current value of the property being set on the target. + * @param {number} previous - The previous value of the property being set on the target. */ module.exports = 'yoyo'; @@ -197118,7 +197946,7 @@ module.exports = 'yoyo'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -197128,15 +197956,11 @@ module.exports = 'yoyo'; module.exports = { - TIMELINE_COMPLETE: __webpack_require__(51910), - TIMELINE_LOOP: __webpack_require__(76826), - TIMELINE_PAUSE: __webpack_require__(59953), - TIMELINE_RESUME: __webpack_require__(92495), - TIMELINE_START: __webpack_require__(55493), - TIMELINE_UPDATE: __webpack_require__(48224), TWEEN_ACTIVE: __webpack_require__(5570), TWEEN_COMPLETE: __webpack_require__(6383), TWEEN_LOOP: __webpack_require__(72582), + TWEEN_PAUSE: __webpack_require__(90281), + TWEEN_RESUME: __webpack_require__(13640), TWEEN_REPEAT: __webpack_require__(80803), TWEEN_START: __webpack_require__(10472), TWEEN_STOP: __webpack_require__(5379), @@ -197153,35 +197977,1389 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(55303); -var Extend = __webpack_require__(98611); - /** * @namespace Phaser.Tweens */ var Tweens = { + States: __webpack_require__(55303), + Builders: __webpack_require__(79619), Events: __webpack_require__(54272), TweenManager: __webpack_require__(64532), Tween: __webpack_require__(39366), - TweenData: __webpack_require__(15718), - Timeline: __webpack_require__(28860) + TweenData: __webpack_require__(15718) }; -// Merge in the consts -Tweens = Extend(false, Tweens, CONST); - module.exports = Tweens; +/***/ }), + +/***/ 502: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(56694); +var EventEmitter = __webpack_require__(6659); +var Events = __webpack_require__(54272); +var TWEEN_CONST = __webpack_require__(55303); + +/** + * @classdesc + * As the name implies, this is the base Tween class that both the Tween and TweenChain + * inherit from. It contains shared properties and methods common to both types of Tween. + * + * Typically you would never instantiate this class directly, although you could certainly + * use it to create your own variation of Tweens from. + * + * @class BaseTween + * @memberof Phaser.Tweens + * @extends Phaser.Events.EventEmitter + * @constructor + * @since 3.60.0 + * + * @param {(Phaser.Tweens.TweenManager|Phaser.Tweens.TweenChain)} parent - A reference to the Tween Manager, or Tween Chain, that owns this Tween. + */ +var BaseTween = new Class({ + + Extends: EventEmitter, + + initialize: + + function BaseTween (parent) + { + EventEmitter.call(this); + + /** + * A reference to the Tween Manager, or Tween Chain, that owns this Tween. + * + * @name Phaser.Tweens.BaseTween#parent + * @type {(Phaser.Tweens.TweenManager|Phaser.Tweens.TweenChain)} + * @since 3.60.0 + */ + this.parent = parent; + + /** + * The main data array. For a Tween, this contains all of the `TweenData` objects, each + * containing a unique property and target that is being tweened. + * + * For a TweenChain, this contains an array of `Tween` instances, which are being played + * through in sequence. + * + * @name Phaser.Tweens.BaseTween#data + * @type {(Phaser.Tweens.TweenData[]|Phaser.Tweens.Tween[])} + * @since 3.60.0 + */ + this.data = []; + + /** + * The cached size of the data array. + * + * @name Phaser.Tweens.BaseTween#totalData + * @type {number} + * @since 3.60.0 + */ + this.totalData = 0; + + /** + * The time in milliseconds before the 'onStart' event fires. + * + * For a Tween, this is the shortest `delay` value across all of the TweenDatas it owns. + * For a TweenChain, it is whatever delay value was given in the configuration. + * + * @name Phaser.Tweens.BaseTween#startDelay + * @type {number} + * @default 0 + * @since 3.60.0 + */ + this.startDelay = 0; + + /** + * Has this Tween started playback yet? + * + * This boolean is toggled when the Tween leaves the 'start delayed' state and begins running. + * + * @name Phaser.Tweens.BaseTween#hasStarted + * @type {boolean} + * @readonly + * @since 3.60.0 + */ + this.hasStarted = false; + + /** + * Scales the time applied to this Tween. A value of 1 runs in real-time. A value of 0.5 runs 50% slower, and so on. + * + * The value isn't used when calculating total duration of the tween, it's a run-time delta adjustment only. + * + * This value is multiplied by the `TweenManager.timeScale`. + * + * @name Phaser.Tweens.BaseTween#timeScale + * @type {number} + * @default 1 + * @since 3.60.0 + */ + this.timeScale = 1; + + /** + * The number of times this Tween will loop. + * + * Can be -1 for an infinite loop, zero for none, or a positive integer. + * + * Typically this is set in the configuration object, but can also be set directly + * as long as this Tween is paused and hasn't started playback. + * + * When enabled it will play through ALL Tweens again. + * + * Use TweenData.repeat to loop a single element. + * + * @name Phaser.Tweens.BaseTween#loop + * @type {number} + * @default 0 + * @since 3.60.0 + */ + this.loop = 0; + + /** + * The time in milliseconds before the Tween loops. + * + * Only used if `loop` is > 0. + * + * @name Phaser.Tweens.BaseTween#loopDelay + * @type {number} + * @default 0 + * @since 3.60.0 + */ + this.loopDelay = 0; + + /** + * Internal counter recording how many loops are left to run. + * + * @name Phaser.Tweens.BaseTween#loopCounter + * @type {number} + * @default 0 + * @since 3.60.0 + */ + this.loopCounter = 0; + + /** + * The time in milliseconds before the 'onComplete' event fires. + * + * This never fires if `loop = -1` as it never completes because it has been + * set to loop forever. + * + * @name Phaser.Tweens.BaseTween#completeDelay + * @type {number} + * @default 0 + * @since 3.60.0 + */ + this.completeDelay = 0; + + /** + * An internal countdown timer (used by loopDelay and completeDelay) + * + * @name Phaser.Tweens.BaseTween#countdown + * @type {number} + * @default 0 + * @since 3.60.0 + */ + this.countdown = 0; + + /** + * The current state of the Tween. + * + * @name Phaser.Tweens.BaseTween#state + * @type {Phaser.Tweens.StateType} + * @since 3.60.0 + */ + this.state = TWEEN_CONST.PENDING; + + /** + * Is the Tween currently paused? + * + * A paused Tween needs to be started with the `play` method, or resumed with the `resume` method. + * + * This property can be toggled at runtime if required. + * + * @name Phaser.Tweens.BaseTween#paused + * @type {boolean} + * @default false + * @since 3.60.0 + */ + this.paused = false; + + /** + * An object containing the different Tween callback functions. + * + * You can either set these in the Tween config, or by calling the `Tween.setCallback` method. + * + * The types available are: + * + * `onActive` - When the Tween is first created it moves to an 'active' state when added to the Tween Manager. 'Active' does not mean 'playing'. + * `onStart` - When the Tween starts playing after a delayed or paused state. This will happen at the same time as `onActive` if the tween has no delay and isn't paused. + * `onLoop` - When a Tween loops, if it has been set to do so. This happens _after_ the `loopDelay` expires, if set. + * `onComplete` - When the Tween finishes playback fully. Never invoked if the Tween is set to repeat infinitely. + * `onStop` - Invoked only if the `Tween.stop` method is called. + * `onPause` - Invoked only if the `Tween.pause` method is called. Not invoked if the Tween Manager is paused. + * `onResume` - Invoked only if the `Tween.resume` method is called. Not invoked if the Tween Manager is resumed. + * + * The following types are also available and are invoked on a `TweenData` level - that is per-object, per-property, being tweened. + * + * `onYoyo` - When a TweenData starts a yoyo. This happens _after_ the `hold` delay expires, if set. + * `onRepeat` - When a TweenData repeats playback. This happens _after_ the `repeatDelay` expires, if set. + * `onUpdate` - When a TweenData updates a property on a source target during playback. + * + * @name Phaser.Tweens.BaseTween#callbacks + * @type {Phaser.Types.Tweens.TweenCallbacks} + * @since 3.60.0 + */ + this.callbacks = { + onActive: null, + onComplete: null, + onLoop: null, + onPause: null, + onRepeat: null, + onResume: null, + onStart: null, + onStop: null, + onUpdate: null, + onYoyo: null + }; + + /** + * The scope (or context) in which all of the callbacks are invoked. + * + * This defaults to be this Tween, but you can override this property + * to set it to whatever object you require. + * + * @name Phaser.Tweens.BaseTween#callbackScope + * @type {any} + * @since 3.60.0 + */ + this.callbackScope; + + /** + * Will this Tween persist after playback? A Tween that persists will _not_ be destroyed by the + * Tween Manager, or when calling `Tween.stop`, and can be re-played as required. You can either + * set this property when creating the tween in the tween config, or set it _prior_ to playback. + * + * However, it's up to you to ensure you destroy persistent tweens when you are finished with them, + * or they will retain references you may no longer require and waste memory. + * + * By default, `Tweens` are set to _not_ persist, so they are automatically cleaned-up by + * the Tween Manager. But `TweenChains` _do_ persist by default, unless overridden in their + * config. This is because the type of situations you use a chain for is far more likely to + * need to be replayed again in the future, rather than disposed of. + * + * @name Phaser.Tweens.BaseTween#persist + * @type {boolean} + * @since 3.60.0 + */ + this.persist = false; + }, + + /** + * Prepares this Tween for playback. + * + * Called automatically by the TweenManager. Should not be called directly. + * + * @method Phaser.Tweens.BaseTween#init + * @fires Phaser.Tweens.Events#TWEEN_ACTIVE + * @since 3.60.0 + * + * @return {this} This Tween instance. + */ + init: function () + { + this.initTweenData(); + + this.setActiveState(); + + this.dispatchEvent(Events.TWEEN_ACTIVE, 'onActive'); + + return this; + }, + + /** + * Sets the value of the time scale applied to this Tween. A value of 1 runs in real-time. + * A value of 0.5 runs 50% slower, and so on. + * + * The value isn't used when calculating total duration of the tween, it's a run-time delta adjustment only. + * + * This value is multiplied by the `TweenManager.timeScale`. + * + * @method Phaser.Tweens.BaseTween#setTimeScale + * @since 3.60.0 + * + * @param {number} value - The time scale value to set. + * + * @return {this} This Tween instance. + */ + setTimeScale: function (value) + { + this.timeScale = value; + + return this; + }, + + /** + * Gets the value of the time scale applied to this Tween. A value of 1 runs in real-time. + * A value of 0.5 runs 50% slower, and so on. + * + * @method Phaser.Tweens.BaseTween#getTimeScale + * @since 3.60.0 + * + * @return {number} The value of the time scale applied to this Tween. + */ + getTimeScale: function () + { + return this.timeScale; + }, + + /** + * Checks if this Tween is currently playing. + * + * If this Tween is paused, or not active, this method will return false. + * + * @method Phaser.Tweens.BaseTween#isPlaying + * @since 3.60.0 + * + * @return {boolean} `true` if the Tween is playing, otherwise `false`. + */ + isPlaying: function () + { + return (!this.paused && this.isActive()); + }, + + /** + * Checks if the Tween is currently paused. + * + * This is the same as inspecting the `BaseTween.paused` property directly. + * + * @method Phaser.Tweens.BaseTween#isPaused + * @since 3.60.0 + * + * @return {boolean} `true` if the Tween is paused, otherwise `false`. + */ + isPaused: function () + { + return this.paused; + }, + + /** + * Pauses the Tween immediately. Use `resume` to continue playback. + * + * You can also toggle the `Tween.paused` boolean property, but doing so will not trigger the PAUSE event. + * + * @method Phaser.Tweens.BaseTween#pause + * @fires Phaser.Tweens.Events#TWEEN_PAUSE + * @since 3.60.0 + * + * @return {this} This Tween instance. + */ + pause: function () + { + if (!this.paused) + { + this.paused = true; + + this.dispatchEvent(Events.TWEEN_PAUSE, 'onPause'); + } + + return this; + }, + + /** + * Resumes the playback of a previously paused Tween. + * + * You can also toggle the `Tween.paused` boolean property, but doing so will not trigger the RESUME event. + * + * @method Phaser.Tweens.BaseTween#resume + * @fires Phaser.Tweens.Events#TWEEN_RESUME + * @since 3.60.0 + * + * @return {this} This Tween instance. + */ + resume: function () + { + if (this.paused) + { + this.paused = false; + + this.dispatchEvent(Events.TWEEN_RESUME, 'onResume'); + } + + return this; + }, + + /** + * Internal method that makes this Tween active within the TweenManager + * and emits the onActive event and callback. + * + * @method Phaser.Tweens.BaseTween#makeActive + * @fires Phaser.Tweens.Events#TWEEN_ACTIVE + * @since 3.60.0 + */ + makeActive: function () + { + this.parent.makeActive(this); + + this.dispatchEvent(Events.TWEEN_ACTIVE, 'onActive'); + }, + + /** + * Internal method that handles this tween completing and emitting the onComplete event + * and callback. + * + * @method Phaser.Tweens.BaseTween#onCompleteHandler + * @since 3.60.0 + */ + onCompleteHandler: function () + { + this.setPendingRemoveState(); + + this.dispatchEvent(Events.TWEEN_COMPLETE, 'onComplete'); + }, + + /** + * Flags the Tween as being complete, whatever stage of progress it is at. + * + * If an `onComplete` callback has been defined it will automatically invoke it, unless a `delay` + * argument is provided, in which case the Tween will delay for that period of time before calling the callback. + * + * If you don't need a delay or don't have an `onComplete` callback then call `Tween.stop` instead. + * + * @method Phaser.Tweens.BaseTween#complete + * @fires Phaser.Tweens.Events#TWEEN_COMPLETE + * @since 3.2.0 + * + * @param {number} [delay=0] - The time to wait before invoking the complete callback. If zero it will fire immediately. + * + * @return {this} This Tween instance. + */ + complete: function (delay) + { + if (delay === undefined) { delay = 0; } + + if (delay) + { + this.setCompleteDelayState(); + + this.countdown = delay; + } + else + { + this.onCompleteHandler(); + } + + return this; + }, + + /** + * Flags the Tween as being complete only once the current loop has finished. + * + * This is a useful way to stop an infinitely looping tween once a complete cycle is over, + * rather than abruptly. + * + * If you don't have a loop then call `Tween.stop` instead. + * + * @method Phaser.Tweens.BaseTween#completeAfterLoop + * @fires Phaser.Tweens.Events#TWEEN_COMPLETE + * @since 3.60.0 + * + * @param {number} [loops=0] - The number of loops that should finish before this tween completes. Zero means complete just the current loop. + * + * @return {this} This Tween instance. + */ + completeAfterLoop: function (loops) + { + if (loops === undefined) { loops = 0; } + + if (this.loopCounter > loops) + { + this.loopCounter = loops; + } + + return this; + }, + + /** + * Immediately removes this Tween from the TweenManager and all of its internal arrays, + * no matter what stage it is at. Then sets the tween state to `REMOVED`. + * + * You should dispose of your reference to this tween after calling this method, to + * free it from memory. If you no longer require it, call `Tween.destroy()` on it. + * + * @method Phaser.Tweens.BaseTween#remove + * @since 3.60.0 + * + * @return {this} This Tween instance. + */ + remove: function () + { + this.parent.remove(this); + + return this; + }, + + /** + * Stops the Tween immediately, whatever stage of progress it is at. + * + * If not a part of a Tween Chain it is also flagged for removal by the Tween Manager. + * + * If an `onStop` callback has been defined it will automatically invoke it. + * + * The Tween will be removed during the next game frame, but should be considered 'destroyed' from this point on. + * + * Typically, you cannot play a Tween that has been stopped. If you just wish to pause the tween, not destroy it, + * then call the `pause` method instead and use `resume` to continue playback. If you wish to restart the Tween, + * use the `restart` or `seek` methods. + * + * @method Phaser.Tweens.BaseTween#stop + * @fires Phaser.Tweens.Events#TWEEN_STOP + * @since 3.60.0 + * + * @return {this} This Tween instance. + */ + stop: function () + { + if (!this.isRemoved() && !this.isPendingRemove()) + { + this.dispatchEvent(Events.TWEEN_STOP, 'onStop'); + + this.setPendingRemoveState(); + } + + return this; + }, + + /** + * Internal method that handles the processing of the loop delay countdown timer and + * the dispatch of related events. Called automatically by `Tween.update`. + * + * @method Phaser.Tweens.BaseTween#updateLoopCountdown + * @since 3.60.0 + * + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + updateLoopCountdown: function (delta) + { + this.countdown -= delta; + + if (this.countdown <= 0) + { + this.setActiveState(); + + this.dispatchEvent(Events.TWEEN_LOOP, 'onLoop'); + } + }, + + /** + * Internal method that handles the processing of the start delay countdown timer and + * the dispatch of related events. Called automatically by `Tween.update`. + * + * @method Phaser.Tweens.BaseTween#updateStartCountdown + * @since 3.60.0 + * + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + updateStartCountdown: function (delta) + { + this.countdown -= delta; + + if (this.countdown <= 0) + { + this.hasStarted = true; + + this.setActiveState(); + + this.dispatchEvent(Events.TWEEN_START, 'onStart'); + + // Reset the delta so we always start progress from zero + delta = 0; + } + + return delta; + }, + + /** + * Internal method that handles the processing of the complete delay countdown timer and + * the dispatch of related events. Called automatically by `Tween.update`. + * + * @method Phaser.Tweens.BaseTween#updateCompleteDelay + * @since 3.60.0 + * + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + updateCompleteDelay: function (delta) + { + this.countdown -= delta; + + if (this.countdown <= 0) + { + this.onCompleteHandler(); + } + }, + + /** + * Sets an event based callback to be invoked during playback. + * + * Calling this method will replace a previously set callback for the given type, if any exists. + * + * The types available are: + * + * `onActive` - When the Tween is first created it moves to an 'active' state when added to the Tween Manager. 'Active' does not mean 'playing'. + * `onStart` - When the Tween starts playing after a delayed or paused state. This will happen at the same time as `onActive` if the tween has no delay and isn't paused. + * `onLoop` - When a Tween loops, if it has been set to do so. This happens _after_ the `loopDelay` expires, if set. + * `onComplete` - When the Tween finishes playback fully. Never invoked if the Tween is set to repeat infinitely. + * `onStop` - Invoked only if the `Tween.stop` method is called. + * `onPause` - Invoked only if the `Tween.pause` method is called. Not invoked if the Tween Manager is paused. + * `onResume` - Invoked only if the `Tween.resume` method is called. Not invoked if the Tween Manager is resumed. + * + * The following types are also available and are invoked on a `TweenData` level - that is per-object, per-property, being tweened. + * + * `onYoyo` - When a TweenData starts a yoyo. This happens _after_ the `hold` delay expires, if set. + * `onRepeat` - When a TweenData repeats playback. This happens _after_ the `repeatDelay` expires, if set. + * `onUpdate` - When a TweenData updates a property on a source target during playback. + * + * @method Phaser.Tweens.BaseTween#setCallback + * @since 3.60.0 + * + * @param {Phaser.Types.Tweens.TweenCallbackTypes} type - The type of callback to set. One of: `onActive`, `onComplete`, `onLoop`, `onPause`, `onRepeat`, `onResume`, `onStart`, `onStop`, `onUpdate` or `onYoyo`. + * @param {function} callback - Your callback that will be invoked. + * @param {array} [params] - The parameters to pass to the callback. Pass an empty array if you don't want to define any, but do wish to set the scope. + * + * @return {this} This Tween instance. + */ + setCallback: function (type, callback, params) + { + if (params === undefined) { params = []; } + + if (this.callbacks.hasOwnProperty(type)) + { + this.callbacks[type] = { func: callback, params: params }; + } + + return this; + }, + + /** + * Sets this Tween state to PENDING. + * + * @method Phaser.Tweens.BaseTween#setPendingState + * @since 3.60.0 + */ + setPendingState: function () + { + this.state = TWEEN_CONST.PENDING; + }, + + /** + * Sets this Tween state to ACTIVE. + * + * @method Phaser.Tweens.BaseTween#setActiveState + * @since 3.60.0 + */ + setActiveState: function () + { + this.state = TWEEN_CONST.ACTIVE; + }, + + /** + * Sets this Tween state to LOOP_DELAY. + * + * @method Phaser.Tweens.BaseTween#setLoopDelayState + * @since 3.60.0 + */ + setLoopDelayState: function () + { + this.state = TWEEN_CONST.LOOP_DELAY; + }, + + /** + * Sets this Tween state to COMPLETE_DELAY. + * + * @method Phaser.Tweens.BaseTween#setCompleteDelayState + * @since 3.60.0 + */ + setCompleteDelayState: function () + { + this.state = TWEEN_CONST.COMPLETE_DELAY; + }, + + /** + * Sets this Tween state to START_DELAY. + * + * @method Phaser.Tweens.BaseTween#setStartDelayState + * @since 3.60.0 + */ + setStartDelayState: function () + { + this.state = TWEEN_CONST.START_DELAY; + + this.countdown = this.startDelay; + + this.hasStarted = false; + }, + + /** + * Sets this Tween state to PENDING_REMOVE. + * + * @method Phaser.Tweens.BaseTween#setPendingRemoveState + * @since 3.60.0 + */ + setPendingRemoveState: function () + { + this.state = TWEEN_CONST.PENDING_REMOVE; + }, + + /** + * Sets this Tween state to REMOVED. + * + * @method Phaser.Tweens.BaseTween#setRemovedState + * @since 3.60.0 + */ + setRemovedState: function () + { + this.state = TWEEN_CONST.REMOVED; + }, + + /** + * Sets this Tween state to FINISHED. + * + * @method Phaser.Tweens.BaseTween#setFinishedState + * @since 3.60.0 + */ + setFinishedState: function () + { + this.state = TWEEN_CONST.FINISHED; + }, + + /** + * Sets this Tween state to DESTROYED. + * + * @method Phaser.Tweens.BaseTween#setDestroyedState + * @since 3.60.0 + */ + setDestroyedState: function () + { + this.state = TWEEN_CONST.DESTROYED; + }, + + /** + * Returns `true` if this Tween has a _current_ state of PENDING, otherwise `false`. + * + * @method Phaser.Tweens.BaseTween#isPending + * @since 3.60.0 + * + * @return {boolean} `true` if this Tween has a _current_ state of PENDING, otherwise `false`. + */ + isPending: function () + { + return (this.state === TWEEN_CONST.PENDING); + }, + + /** + * Returns `true` if this Tween has a _current_ state of ACTIVE, otherwise `false`. + * + * @method Phaser.Tweens.BaseTween#isActive + * @since 3.60.0 + * + * @return {boolean} `true` if this Tween has a _current_ state of ACTIVE, otherwise `false`. + */ + isActive: function () + { + return (this.state === TWEEN_CONST.ACTIVE); + }, + + /** + * Returns `true` if this Tween has a _current_ state of LOOP_DELAY, otherwise `false`. + * + * @method Phaser.Tweens.BaseTween#isLoopDelayed + * @since 3.60.0 + * + * @return {boolean} `true` if this Tween has a _current_ state of LOOP_DELAY, otherwise `false`. + */ + isLoopDelayed: function () + { + return (this.state === TWEEN_CONST.LOOP_DELAY); + }, + + /** + * Returns `true` if this Tween has a _current_ state of COMPLETE_DELAY, otherwise `false`. + * + * @method Phaser.Tweens.BaseTween#isCompleteDelayed + * @since 3.60.0 + * + * @return {boolean} `true` if this Tween has a _current_ state of COMPLETE_DELAY, otherwise `false`. + */ + isCompleteDelayed: function () + { + return (this.state === TWEEN_CONST.COMPLETE_DELAY); + }, + + /** + * Returns `true` if this Tween has a _current_ state of START_DELAY, otherwise `false`. + * + * @method Phaser.Tweens.BaseTween#isStartDelayed + * @since 3.60.0 + * + * @return {boolean} `true` if this Tween has a _current_ state of START_DELAY, otherwise `false`. + */ + isStartDelayed: function () + { + return (this.state === TWEEN_CONST.START_DELAY); + }, + + /** + * Returns `true` if this Tween has a _current_ state of PENDING_REMOVE, otherwise `false`. + * + * @method Phaser.Tweens.BaseTween#isPendingRemove + * @since 3.60.0 + * + * @return {boolean} `true` if this Tween has a _current_ state of PENDING_REMOVE, otherwise `false`. + */ + isPendingRemove: function () + { + return (this.state === TWEEN_CONST.PENDING_REMOVE); + }, + + /** + * Returns `true` if this Tween has a _current_ state of REMOVED, otherwise `false`. + * + * @method Phaser.Tweens.BaseTween#isRemoved + * @since 3.60.0 + * + * @return {boolean} `true` if this Tween has a _current_ state of REMOVED, otherwise `false`. + */ + isRemoved: function () + { + return (this.state === TWEEN_CONST.REMOVED); + }, + + /** + * Returns `true` if this Tween has a _current_ state of FINISHED, otherwise `false`. + * + * @method Phaser.Tweens.BaseTween#isFinished + * @since 3.60.0 + * + * @return {boolean} `true` if this Tween has a _current_ state of FINISHED, otherwise `false`. + */ + isFinished: function () + { + return (this.state === TWEEN_CONST.FINISHED); + }, + + /** + * Returns `true` if this Tween has a _current_ state of DESTROYED, otherwise `false`. + * + * @method Phaser.Tweens.BaseTween#isDestroyed + * @since 3.60.0 + * + * @return {boolean} `true` if this Tween has a _current_ state of DESTROYED, otherwise `false`. + */ + isDestroyed: function () + { + return (this.state === TWEEN_CONST.DESTROYED); + }, + + /** + * Handles the destroy process of this Tween, clearing out the + * Tween Data and resetting the targets. A Tween that has been + * destroyed cannot ever be played or used again. + * + * @method Phaser.Tweens.BaseTween#destroy + * @since 3.60.0 + */ + destroy: function () + { + if (this.data) + { + this.data.forEach(function (tweenData) + { + tweenData.destroy(); + }); + } + + this.removeAllListeners(); + + this.callbacks = null; + this.data = null; + this.parent = null; + + this.setDestroyedState(); + } + +}); + +BaseTween.TYPES = [ + 'onActive', + 'onComplete', + 'onLoop', + 'onPause', + 'onRepeat', + 'onResume', + 'onStart', + 'onStop', + 'onUpdate', + 'onYoyo' +]; + +module.exports = BaseTween; + + +/***/ }), + +/***/ 65521: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(56694); +var TWEEN_CONST = __webpack_require__(55303); + +/** + * @classdesc + * BaseTweenData is the class that the TweenData and TweenFrameData classes + * extend from. You should not typically instantiate this class directly, but instead + * use it to form your own tween data classes from, should you require it. + * + * Prior to Phaser 3.60 the TweenData was just an object, but was refactored to a class, + * to make it responsible for its own state and updating. + * + * @class BaseTweenData + * @memberof Phaser.Tweens + * @constructor + * @since 3.60.0 + * + * @param {Phaser.Tweens.Tween} tween - The tween this TweenData instance belongs to. + * @param {number} targetIndex - The target index within the Tween targets array. + * @param {string} key - The property of the target to tween. + * @param {Phaser.Types.Tweens.GetEndCallback} getEnd - What the property will be at the END of the Tween. + * @param {Phaser.Types.Tweens.GetStartCallback} getStart - What the property will be at the START of the Tween. + * @param {?Phaser.Types.Tweens.GetActiveCallback} getActive - If not null, is invoked _immediately_ as soon as the TweenData is running, and is set on the target property. + * @param {function} ease - The ease function this tween uses. + * @param {function} delay - Function that returns the time in ms/frames before tween will start. + * @param {number} duration - The duration of the tween in ms/frames. + * @param {boolean} yoyo - Determines whether the tween should return back to its start value after hold has expired. + * @param {number} hold - Function that returns the time in ms/frames the tween will pause before repeating or returning to its starting value if yoyo is set to true. + * @param {number} repeat - Function that returns the number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. + * @param {number} repeatDelay - Function that returns the time in ms/frames before the repeat will start. + * @param {boolean} flipX - Should toggleFlipX be called when yoyo or repeat happens? + * @param {boolean} flipY - Should toggleFlipY be called when yoyo or repeat happens? + * @param {?function} interpolation - The interpolation function to be used for arrays of data. Defaults to 'null'. + * @param {?number[]} interpolationData - The array of interpolation data to be set. Defaults to 'null'. + */ +var BaseTweenData = new Class({ + + initialize: + + function BaseTweenData (tween, targetIndex, delay, duration, yoyo, hold, repeat, repeatDelay, flipX, flipY) + { + /** + * A reference to the Tween that this TweenData instance belongs to. + * + * @name Phaser.Tweens.BaseTweenData#tween + * @type {Phaser.Tweens.Tween} + * @since 3.60.0 + */ + this.tween = tween; + + /** + * The index of the target within the Tween `targets` array. + * + * @name Phaser.Tweens.BaseTweenData#targetIndex + * @type {number} + * @since 3.60.0 + */ + this.targetIndex = targetIndex; + + /** + * The duration of the tween in milliseconds, excluding any time required + * for yoyo or repeats. + * + * @name Phaser.Tweens.BaseTweenData#duration + * @type {number} + * @since 3.60.0 + */ + this.duration = duration; + + /** + * The total calculated duration, in milliseconds, of this TweenData. + * Factoring in the duration, repeats, delays and yoyos. + * + * @name Phaser.Tweens.BaseTweenData#totalDuration + * @type {number} + * @since 3.60.0 + */ + this.totalDuration = 0; + + /** + * The time, in milliseconds, before this tween will start playing. + * + * This value is generated by the `getDelay` function. + * + * @name Phaser.Tweens.BaseTweenData#delay + * @type {number} + * @since 3.60.0 + */ + this.delay = 0; + + /** + * This function returns the value to be used for `TweenData.delay`. + * + * @name Phaser.Tweens.BaseTweenData#getDelay + * @type {function} + * @since 3.60.0 + */ + this.getDelay = delay; + + /** + * Will the Tween ease back to its starting values, after reaching the end + * and any `hold` value that may be set? + * + * @name Phaser.Tweens.BaseTweenData#yoyo + * @type {boolean} + * @since 3.60.0 + */ + this.yoyo = yoyo; + + /** + * The time, in milliseconds, before this tween will start a yoyo to repeat. + * + * @name Phaser.Tweens.BaseTweenData#hold + * @type {number} + * @since 3.60.0 + */ + this.hold = hold; + + /** + * The number of times this tween will repeat. + * + * The tween will always run once regardless of this value, + * so a repeat value of '1' will play the tween twice: I.e. the original + * play-through and then it repeats that once (1). + * + * If this value is set to -1 this tween will repeat forever. + * + * @name Phaser.Tweens.BaseTweenData#repeat + * @type {number} + * @since 3.60.0 + */ + this.repeat = repeat; + + /** + * The time, in milliseconds, before the repeat will start. + * + * @name Phaser.Tweens.BaseTweenData#repeatDelay + * @type {number} + * @since 3.60.0 + */ + this.repeatDelay = repeatDelay; + + /** + * How many repeats are left to run? + * + * @name Phaser.Tweens.BaseTweenData#repeatCounter + * @type {number} + * @since 3.60.0 + */ + this.repeatCounter = 0; + + /** + * If `true` this Tween will call `toggleFlipX` on the Tween target + * whenever it yoyo's or repeats. It will only be called if the target + * has a function matching this name, like most Phaser GameObjects do. + * + * @name Phaser.Tweens.BaseTweenData#flipX + * @type {boolean} + * @since 3.60.0 + */ + this.flipX = flipX; + + /** + * If `true` this Tween will call `toggleFlipY` on the Tween target + * whenever it yoyo's or repeats. It will only be called if the target + * has a function matching this name, like most Phaser GameObjects do. + * + * @name Phaser.Tweens.BaseTweenData#flipY + * @type {boolean} + * @since 3.60.0 + */ + this.flipY = flipY; + + /** + * A value between 0 and 1 holding the progress of this TweenData. + * + * @name Phaser.Tweens.BaseTweenData#progress + * @type {number} + * @since 3.60.0 + */ + this.progress = 0; + + /** + * The amount of time, in milliseconds, that has elapsed since this + * TweenData was made active. + * + * @name Phaser.Tweens.BaseTweenData#elapsed + * @type {number} + * @since 3.60.0 + */ + this.elapsed = 0; + + /** + * The state of this TweenData. + * + * @name Phaser.Tweens.BaseTweenData#state + * @type {Phaser.Tweens.StateType} + * @since 3.60.0 + */ + this.state = 0; + + /** + * Is this Tween Data currently waiting for a countdown to elapse, or not? + * + * @name Phaser.Tweens.BaseTweenData#isCountdown + * @type {boolean} + * @since 3.60.0 + */ + this.isCountdown = false; + }, + + /** + * Sets this TweenData state to CREATED. + * + * @method Phaser.Tweens.BaseTweenData#setCreatedState + * @since 3.60.0 + */ + setCreatedState: function () + { + this.state = TWEEN_CONST.CREATED; + this.isCountdown = false; + }, + + /** + * Sets this TweenData state to DELAY. + * + * @method Phaser.Tweens.BaseTweenData#setDelayState + * @since 3.60.0 + */ + setDelayState: function () + { + this.state = TWEEN_CONST.DELAY; + this.isCountdown = true; + }, + + /** + * Sets this TweenData state to PENDING_RENDER. + * + * @method Phaser.Tweens.BaseTweenData#setPendingRenderState + * @since 3.60.0 + */ + setPendingRenderState: function () + { + this.state = TWEEN_CONST.PENDING_RENDER; + this.isCountdown = false; + }, + + /** + * Sets this TweenData state to PLAYING_FORWARD. + * + * @method Phaser.Tweens.BaseTweenData#setPlayingForwardState + * @since 3.60.0 + */ + setPlayingForwardState: function () + { + this.state = TWEEN_CONST.PLAYING_FORWARD; + this.isCountdown = false; + }, + + /** + * Sets this TweenData state to PLAYING_BACKWARD. + * + * @method Phaser.Tweens.BaseTweenData#setPlayingBackwardState + * @since 3.60.0 + */ + setPlayingBackwardState: function () + { + this.state = TWEEN_CONST.PLAYING_BACKWARD; + this.isCountdown = false; + }, + + /** + * Sets this TweenData state to HOLD_DELAY. + * + * @method Phaser.Tweens.BaseTweenData#setHoldState + * @since 3.60.0 + */ + setHoldState: function () + { + this.state = TWEEN_CONST.HOLD_DELAY; + this.isCountdown = true; + }, + + /** + * Sets this TweenData state to REPEAT_DELAY. + * + * @method Phaser.Tweens.BaseTweenData#setRepeatState + * @since 3.60.0 + */ + setRepeatState: function () + { + this.state = TWEEN_CONST.REPEAT_DELAY; + this.isCountdown = true; + }, + + /** + * Sets this TweenData state to COMPLETE. + * + * @method Phaser.Tweens.BaseTweenData#setCompleteState + * @since 3.60.0 + */ + setCompleteState: function () + { + this.state = TWEEN_CONST.COMPLETE; + this.isCountdown = false; + }, + + /** + * Returns `true` if this TweenData has a _current_ state of CREATED, otherwise `false`. + * + * @method Phaser.Tweens.BaseTweenData#isCreated + * @since 3.60.0 + * + * @return {boolean} `true` if this TweenData has a _current_ state of CREATED, otherwise `false`. + */ + isCreated: function () + { + return (this.state === TWEEN_CONST.CREATED); + }, + + /** + * Returns `true` if this TweenData has a _current_ state of DELAY, otherwise `false`. + * + * @method Phaser.Tweens.BaseTweenData#isDelayed + * @since 3.60.0 + * + * @return {boolean} `true` if this TweenData has a _current_ state of DELAY, otherwise `false`. + */ + isDelayed: function () + { + return (this.state === TWEEN_CONST.DELAY); + }, + + /** + * Returns `true` if this TweenData has a _current_ state of PENDING_RENDER, otherwise `false`. + * + * @method Phaser.Tweens.BaseTweenData#isPendingRender + * @since 3.60.0 + * + * @return {boolean} `true` if this TweenData has a _current_ state of PENDING_RENDER, otherwise `false`. + */ + isPendingRender: function () + { + return (this.state === TWEEN_CONST.PENDING_RENDER); + }, + + /** + * Returns `true` if this TweenData has a _current_ state of PLAYING_FORWARD, otherwise `false`. + * + * @method Phaser.Tweens.BaseTweenData#isPlayingForward + * @since 3.60.0 + * + * @return {boolean} `true` if this TweenData has a _current_ state of PLAYING_FORWARD, otherwise `false`. + */ + isPlayingForward: function () + { + return (this.state === TWEEN_CONST.PLAYING_FORWARD); + }, + + /** + * Returns `true` if this TweenData has a _current_ state of PLAYING_BACKWARD, otherwise `false`. + * + * @method Phaser.Tweens.BaseTweenData#isPlayingBackward + * @since 3.60.0 + * + * @return {boolean} `true` if this TweenData has a _current_ state of PLAYING_BACKWARD, otherwise `false`. + */ + isPlayingBackward: function () + { + return (this.state === TWEEN_CONST.PLAYING_BACKWARD); + }, + + /** + * Returns `true` if this TweenData has a _current_ state of HOLD_DELAY, otherwise `false`. + * + * @method Phaser.Tweens.BaseTweenData#isHolding + * @since 3.60.0 + * + * @return {boolean} `true` if this TweenData has a _current_ state of HOLD_DELAY, otherwise `false`. + */ + isHolding: function () + { + return (this.state === TWEEN_CONST.HOLD_DELAY); + }, + + /** + * Returns `true` if this TweenData has a _current_ state of REPEAT_DELAY, otherwise `false`. + * + * @method Phaser.Tweens.BaseTweenData#isRepeating + * @since 3.60.0 + * + * @return {boolean} `true` if this TweenData has a _current_ state of REPEAT_DELAY, otherwise `false`. + */ + isRepeating: function () + { + return (this.state === TWEEN_CONST.REPEAT_DELAY); + }, + + /** + * Returns `true` if this TweenData has a _current_ state of COMPLETE, otherwise `false`. + * + * @method Phaser.Tweens.BaseTweenData#isComplete + * @since 3.60.0 + * + * @return {boolean} `true` if this TweenData has a _current_ state of COMPLETE, otherwise `false`. + */ + isComplete: function () + { + return (this.state === TWEEN_CONST.COMPLETE); + }, + + /** + * Immediately destroys this TweenData, nulling of all its references. + * + * @method Phaser.Tweens.BaseTweenData#destroy + * @since 3.60.0 + */ + destroy: function () + { + this.tween = null; + this.getDelay = null; + this.setCompleteState(); + } + +}); + +module.exports = BaseTweenData; + + /***/ }), /***/ 99730: @@ -197189,14 +199367,14 @@ module.exports = Tweens; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * @typedef {object} Phaser.Types.Tweens.TweenConfigDefaults * @since 3.0.0 - * + * * @property {(object|object[])} targets - The object, or an array of objects, to run the tween on. * @property {number} [delay=0] - The number of milliseconds to delay before the tween will start. * @property {number} [duration=1000] - The duration of the tween in milliseconds. @@ -197208,6 +199386,8 @@ module.exports = Tweens; * @property {boolean} [yoyo=false] - Should the tween complete, then reverse the values incrementally to get back to the starting tween values? The reverse tweening will also take `duration` milliseconds to complete. * @property {boolean} [flipX=false] - Horizontally flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the `flipX` property. * @property {boolean} [flipY=false] - Vertically flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the `flipY` property. + * @property {boolean} [persist=false] - Retain the tween within the Tween Manager, even after playback completes? + * @property {function} [interpolation=null] - The interpolation function to use for array-based tween values. */ var TWEEN_DEFAULTS = { @@ -197221,7 +199401,9 @@ var TWEEN_DEFAULTS = { repeatDelay: 0, yoyo: false, flipX: false, - flipY: false + flipY: false, + persist: false, + interpolation: null }; module.exports = TWEEN_DEFAULTS; @@ -197234,7 +199416,7 @@ module.exports = TWEEN_DEFAULTS; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -197246,17 +199428,15 @@ module.exports = TWEEN_DEFAULTS; // ease: The ease function used by the tween // easeParams: The parameters to go with the ease function (if any) // flipX: flip X the GameObject on tween end -// flipY: flip Y the GameObject on tween end// hold: The time the tween will pause before running a yoyo +// flipY: flip Y the GameObject on tween end // hold: The time the tween will pause before running a yoyo // loop: The time the tween will pause before starting either a yoyo or returning to the start for a repeat // loopDelay: -// offset: Used when the Tween is part of a Timeline // paused: Does the tween start in a paused state, or playing? // props: The properties being tweened by the tween // repeat: The number of times the tween will repeat itself (a value of 1 means the tween will play twice, as it repeated once) // repeatDelay: The time the tween will pause for before starting a repeat. The tween holds in the start state. // targets: The targets the tween is updating. -// useFrames: Use frames or milliseconds? // yoyo: boolean - Does the tween reverse itself (yoyo) when it reaches the end? module.exports = [ @@ -197269,39 +199449,35 @@ module.exports = [ 'flipX', 'flipY', 'hold', + 'interpolation', 'loop', 'loopDelay', - 'offset', 'onActive', 'onActiveParams', - 'onActiveScope', 'onComplete', 'onCompleteParams', - 'onCompleteScope', 'onLoop', 'onLoopParams', - 'onLoopScope', + 'onPause', + 'onPauseParams', 'onRepeat', 'onRepeatParams', - 'onRepeatScope', + 'onResume', + 'onResumeParams', 'onStart', 'onStartParams', - 'onStartScope', 'onStop', 'onStopParams', - 'onStopScope', 'onUpdate', 'onUpdateParams', - 'onUpdateScope', 'onYoyo', 'onYoyoParams', - 'onYoyoScope', 'paused', + 'persist', 'props', 'repeat', 'repeatDelay', 'targets', - 'useFrames', 'yoyo' ]; @@ -197313,17 +199489,19 @@ module.exports = [ /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var BaseTween = __webpack_require__(502); var Class = __webpack_require__(56694); -var EventEmitter = __webpack_require__(6659); var Events = __webpack_require__(54272); var GameObjectCreator = __webpack_require__(99325); var GameObjectFactory = __webpack_require__(61286); -var TWEEN_CONST = __webpack_require__(55303); var MATH_CONST = __webpack_require__(83392); +var TWEEN_CONST = __webpack_require__(55303); +var TweenData = __webpack_require__(15718); +var TweenFrameData = __webpack_require__(96490); /** * @classdesc @@ -197335,60 +199513,22 @@ var MATH_CONST = __webpack_require__(83392); * * @class Tween * @memberof Phaser.Tweens - * @extends Phaser.Events.EventEmitter + * @extends Phaser.Tweens.BaseTween * @constructor * @since 3.0.0 * - * @param {(Phaser.Tweens.TweenManager|Phaser.Tweens.Timeline)} parent - A reference to the parent of this Tween. Either the Tween Manager or a Tween Timeline instance. - * @param {Phaser.Types.Tweens.TweenDataConfig[]} data - An array of TweenData objects, each containing a unique property to be tweened. + * @param {Phaser.Tweens.TweenManager} parent - A reference to the Tween Manager that owns this Tween. * @param {array} targets - An array of targets to be tweened. */ var Tween = new Class({ - Extends: EventEmitter, + Extends: BaseTween, initialize: - function Tween (parent, data, targets) + function Tween (parent, targets) { - EventEmitter.call(this); - - /** - * A reference to the parent of this Tween. - * Either the Tween Manager or a Tween Timeline instance. - * - * @name Phaser.Tweens.Tween#parent - * @type {(Phaser.Tweens.TweenManager|Phaser.Tweens.Timeline)} - * @since 3.0.0 - */ - this.parent = parent; - - /** - * Is the parent of this Tween a Timeline? - * - * @name Phaser.Tweens.Tween#parentIsTimeline - * @type {boolean} - * @since 3.0.0 - */ - this.parentIsTimeline = parent.hasOwnProperty('isTimeline'); - - /** - * An array of TweenData objects, each containing a unique property and target being tweened. - * - * @name Phaser.Tweens.Tween#data - * @type {Phaser.Types.Tweens.TweenDataConfig[]} - * @since 3.0.0 - */ - this.data = data; - - /** - * The cached length of the data array. - * - * @name Phaser.Tweens.Tween#totalData - * @type {number} - * @since 3.0.0 - */ - this.totalData = data.length; + BaseTween.call(this, parent); /** * An array of references to the target/s this Tween is operating on. @@ -197408,80 +199548,6 @@ var Tween = new Class({ */ this.totalTargets = targets.length; - /** - * If `true` then duration, delay, etc values are all frame totals. - * - * @name Phaser.Tweens.Tween#useFrames - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.useFrames = false; - - /** - * Scales the time applied to this Tween. A value of 1 runs in real-time. A value of 0.5 runs 50% slower, and so on. - * Value isn't used when calculating total duration of the tween, it's a run-time delta adjustment only. - * - * @name Phaser.Tweens.Tween#timeScale - * @type {number} - * @default 1 - * @since 3.0.0 - */ - this.timeScale = 1; - - /** - * Loop this tween? Can be -1 for an infinite loop, or an integer. - * When enabled it will play through ALL TweenDatas again. Use TweenData.repeat to loop a single element. - * - * @name Phaser.Tweens.Tween#loop - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.loop = 0; - - /** - * Time in ms/frames before the tween loops. - * - * @name Phaser.Tweens.Tween#loopDelay - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.loopDelay = 0; - - /** - * How many loops are left to run? - * - * @name Phaser.Tweens.Tween#loopCounter - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.loopCounter = 0; - - /** - * Time in ms/frames before the 'onStart' event fires. - * This is the shortest `delay` value across all of the TweenDatas of this Tween. - * - * @name Phaser.Tweens.Tween#startDelay - * @type {number} - * @default 0 - * @since 3.19.0 - */ - this.startDelay = 0; - - /** - * Has this Tween started playback yet? - * This boolean is toggled when the Tween leaves the 'delayed' state and starts running. - * - * @name Phaser.Tweens.Tween#hasStarted - * @type {boolean} - * @readonly - * @since 3.19.0 - */ - this.hasStarted = false; - /** * Is this Tween currently seeking? * This boolean is toggled in the `Tween.seek` method. @@ -197495,81 +199561,12 @@ var Tween = new Class({ this.isSeeking = false; /** - * Time in ms/frames before the 'onComplete' event fires. This never fires if loop = -1 (as it never completes) - * - * @name Phaser.Tweens.Tween#completeDelay - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.completeDelay = 0; - - /** - * Countdown timer (used by timeline offset, loopDelay and completeDelay) - * - * @name Phaser.Tweens.Tween#countdown - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.countdown = 0; - - /** - * Set only if this Tween is part of a Timeline. - * - * @name Phaser.Tweens.Tween#offset - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.offset = 0; - - /** - * Set only if this Tween is part of a Timeline. The calculated offset amount. - * - * @name Phaser.Tweens.Tween#calculatedOffset - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.calculatedOffset = 0; - - /** - * The current state of the tween - * - * @name Phaser.Tweens.Tween#state - * @type {number} - * @since 3.0.0 - */ - this.state = TWEEN_CONST.PENDING_ADD; - - /** - * The state of the tween when it was paused (used by Resume) - * - * @name Phaser.Tweens.Tween#_pausedState - * @type {number} - * @private - * @since 3.0.0 - */ - this._pausedState = TWEEN_CONST.INIT; - - /** - * Does the Tween start off paused? (if so it needs to be started with Tween.play) - * - * @name Phaser.Tweens.Tween#paused - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.paused = false; - - /** - * Elapsed time in ms/frames of this run through the Tween. + * Elapsed time in ms/frames of this run through of the Tween. * * @name Phaser.Tweens.Tween#elapsed * @type {number} * @default 0 - * @since 3.0.0 + * @since 3.60.0 */ this.elapsed = 0; @@ -197579,7 +199576,7 @@ var Tween = new Class({ * @name Phaser.Tweens.Tween#totalElapsed * @type {number} * @default 0 - * @since 3.0.0 + * @since 3.60.0 */ this.totalElapsed = 0; @@ -197589,27 +199586,27 @@ var Tween = new Class({ * @name Phaser.Tweens.Tween#duration * @type {number} * @default 0 - * @since 3.0.0 + * @since 3.60.0 */ this.duration = 0; /** - * Value between 0 and 1. The amount through the Tween, excluding loops. + * Value between 0 and 1. The amount of progress through the Tween, excluding loops. * * @name Phaser.Tweens.Tween#progress * @type {number} * @default 0 - * @since 3.0.0 + * @since 3.60.0 */ this.progress = 0; /** - * Time in ms/frames for the Tween to complete (including looping) + * Time in ms/frames it takes for the Tween to complete a full playthrough (including looping) * * @name Phaser.Tweens.Tween#totalDuration * @type {number} * @default 0 - * @since 3.0.0 + * @since 3.60.0 */ this.totalDuration = 0; @@ -197619,46 +199616,85 @@ var Tween = new Class({ * @name Phaser.Tweens.Tween#totalProgress * @type {number} * @default 0 - * @since 3.0.0 + * @since 3.60.0 */ this.totalProgress = 0; /** - * An object containing the different Tween callback functions. + * The delta used in the current update. * - * You can either set these in the Tween config, or by calling the `Tween.setCallback` method. - * - * `onActive` When the Tween is moved from the pending to the active list in the Tween Manager, even if playback paused. - * `onStart` When the Tween starts playing after a delayed state. Will happen at the same time as `onActive` if it has no delay. - * `onYoyo` When a TweenData starts a yoyo. This happens _after_ the `hold` delay expires, if set. - * `onRepeat` When a TweenData repeats playback. This happens _after_ the `repeatDelay` expires, if set. - * `onComplete` When the Tween finishes playback fully. Never invoked if tween is set to repeat infinitely. - * `onUpdate` When a TweenData updates a property on a source target during playback. - * `onLoop` When a Tween loops. This happens _after_ the `loopDelay` expires, if set. - * - * @name Phaser.Tweens.Tween#callbacks - * @type {object} - * @since 3.0.0 + * @name Phaser.Tweens.Tween#delta + * @type {number} + * @default 0 + * @since 3.60.0 */ - this.callbacks = { - onActive: null, - onComplete: null, - onLoop: null, - onRepeat: null, - onStart: null, - onStop: null, - onUpdate: null, - onYoyo: null - }; + this.delta = 0; + }, - /** - * The context in which all callbacks are invoked. - * - * @name Phaser.Tweens.Tween#callbackScope - * @type {any} - * @since 3.0.0 - */ - this.callbackScope; + /** + * Adds a new TweenData to this Tween. Typically, this method is called + * automatically by the TweenBuilder, however you can also invoke it + * yourself. + * + * @method Phaser.Tweens.Tween#add + * @since 3.60.0 + * + * @param {number} targetIndex - The target index within the Tween targets array. + * @param {string} key - The property of the target to tween. + * @param {Phaser.Types.Tweens.GetEndCallback} getEnd - What the property will be at the END of the Tween. + * @param {Phaser.Types.Tweens.GetStartCallback} getStart - What the property will be at the START of the Tween. + * @param {?Phaser.Types.Tweens.GetActiveCallback} getActive - If not null, is invoked _immediately_ as soon as the TweenData is running, and is set on the target property. + * @param {function} ease - The ease function this tween uses. + * @param {function} delay - Function that returns the time in ms/frames before tween will start. + * @param {number} duration - The duration of the tween in ms/frames. + * @param {boolean} yoyo - Determines whether the tween should return back to its start value after hold has expired. + * @param {number} hold - Function that returns the time in ms/frames the tween will pause before repeating or returning to its starting value if yoyo is set to true. + * @param {number} repeat - Function that returns the number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. + * @param {number} repeatDelay - Function that returns the time in ms/frames before the repeat will start. + * @param {boolean} flipX - Should toggleFlipX be called when yoyo or repeat happens? + * @param {boolean} flipY - Should toggleFlipY be called when yoyo or repeat happens? + * @param {?function} interpolation - The interpolation function to be used for arrays of data. Defaults to 'null'. + * @param {?number[]} interpolationData - The array of interpolation data to be set. Defaults to 'null'. + * + * @return {Phaser.Tweens.TweenData} The TweenData instance that was added. + */ + add: function (targetIndex, key, getEnd, getStart, getActive, ease, delay, duration, yoyo, hold, repeat, repeatDelay, flipX, flipY, interpolation, interpolationData) + { + var tweenData = new TweenData(this, targetIndex, key, getEnd, getStart, getActive, ease, delay, duration, yoyo, hold, repeat, repeatDelay, flipX, flipY, interpolation, interpolationData); + + this.totalData = this.data.push(tweenData); + + return tweenData; + }, + + /** + * Adds a new TweenFrameData to this Tween. Typically, this method is called + * automatically by the TweenBuilder, however you can also invoke it + * yourself. + * + * @method Phaser.Tweens.Tween#addFrame + * @since 3.60.0 + * + * @param {number} targetIndex - The target index within the Tween targets array. + * @param {string} texture - The texture to set on the target at the end of the tween. + * @param {string|number} frame - The texture frame to set on the target at the end of the tween. + * @param {function} delay - Function that returns the time in ms/frames before tween will start. + * @param {number} duration - The duration of the tween in ms/frames. + * @param {number} hold - Function that returns the time in ms/frames the tween will pause before repeating or returning to its starting value if yoyo is set to true. + * @param {number} repeat - Function that returns the number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. + * @param {number} repeatDelay - Function that returns the time in ms/frames before the repeat will start. + * @param {boolean} flipX - Should toggleFlipX be called when yoyo or repeat happens? + * @param {boolean} flipY - Should toggleFlipY be called when yoyo or repeat happens? + * + * @return {Phaser.Tweens.TweenFrameData} The TweenFrameData instance that was added. + */ + addFrame: function (targetIndex, texture, frame, delay, duration, hold, repeat, repeatDelay, flipX, flipY) + { + var tweenData = new TweenFrameData(this, targetIndex, texture, frame, delay, duration, hold, repeat, repeatDelay, flipX, flipY); + + this.totalData = this.data.push(tweenData); + + return tweenData; }, /** @@ -197678,62 +199714,6 @@ var Tween = new Class({ return this.data[index].current; }, - /** - * Set the scale the time applied to this Tween. A value of 1 runs in real-time. A value of 0.5 runs 50% slower, and so on. - * - * @method Phaser.Tweens.Tween#setTimeScale - * @since 3.0.0 - * - * @param {number} value - The scale factor for timescale. - * - * @return {this} - This Tween instance. - */ - setTimeScale: function (value) - { - this.timeScale = value; - - return this; - }, - - /** - * Returns the scale of the time applied to this Tween. - * - * @method Phaser.Tweens.Tween#getTimeScale - * @since 3.0.0 - * - * @return {number} The timescale of this tween (between 0 and 1) - */ - getTimeScale: function () - { - return this.timeScale; - }, - - /** - * Checks if the Tween is currently active. - * - * @method Phaser.Tweens.Tween#isPlaying - * @since 3.0.0 - * - * @return {boolean} `true` if the Tween is active, otherwise `false`. - */ - isPlaying: function () - { - return (this.state === TWEEN_CONST.ACTIVE); - }, - - /** - * Checks if the Tween is currently paused. - * - * @method Phaser.Tweens.Tween#isPaused - * @since 3.0.0 - * - * @return {boolean} `true` if the Tween is paused, otherwise `false`. - */ - isPaused: function () - { - return (this.state === TWEEN_CONST.PAUSED); - }, - /** * See if this Tween is currently acting upon the given target. * @@ -197763,7 +199743,7 @@ var Tween = new Class({ * @param {*} value - The new value of the property. * @param {boolean} [startToCurrent=false] - Should this change set the start value to be the current value? * - * @return {this} - This Tween instance. + * @return {this} This Tween instance. */ updateTo: function (key, value, startToCurrent) { @@ -197788,7 +199768,12 @@ var Tween = new Class({ }, /** - * Restarts the tween from the beginning. + * Restarts the Tween from the beginning. + * + * You can only restart a Tween that is currently playing. If the Tween has already been stopped, restarting + * it will throw an error. + * + * If you wish to restart the Tween from a specific point, use the `Tween.seek` method instead. * * @method Phaser.Tweens.Tween#restart * @since 3.0.0 @@ -197797,172 +199782,32 @@ var Tween = new Class({ */ restart: function () { - // Reset these so they're ready for the next update - this.elapsed = 0; - this.progress = 0; - this.totalElapsed = 0; - this.totalProgress = 0; - - if (this.state === TWEEN_CONST.ACTIVE) + switch (this.state) { - return this.seek(0); - } - else if (this.state === TWEEN_CONST.REMOVED) - { - this.seek(0); - this.parent.makeActive(this); + case TWEEN_CONST.REMOVED: + case TWEEN_CONST.FINISHED: + this.seek(); + this.parent.makeActive(this); + break; - return this; - } - else if (this.state === TWEEN_CONST.PENDING_ADD) - { - return this; - } - else - { - return this.play(); - } - }, + case TWEEN_CONST.PENDING: + case TWEEN_CONST.PENDING_REMOVE: + this.parent.reset(this); + break; - /** - * Internal method that calculates the overall duration of the Tween. - * - * @method Phaser.Tweens.Tween#calcDuration - * @since 3.0.0 - */ - calcDuration: function () - { - var maxDuration = 0; - var minDelay = MATH_CONST.MAX_SAFE_INTEGER; + case TWEEN_CONST.DESTROYED: + console.warn('Cannot restart destroyed Tweens', this); + break; - var data = this.data; - - for (var i = 0; i < this.totalData; i++) - { - var tweenData = data[i]; - - // Set t1 (duration + hold + yoyo) - tweenData.t1 = tweenData.duration + tweenData.hold; - - if (tweenData.yoyo) - { - tweenData.t1 += tweenData.duration; - } - - // Set t2 (repeatDelay + duration + hold + yoyo) - tweenData.t2 = tweenData.t1 + tweenData.repeatDelay; - - // Total Duration - tweenData.totalDuration = tweenData.delay + tweenData.t1; - - if (tweenData.repeat === -1) - { - tweenData.totalDuration += (tweenData.t2 * 999999999999); - } - else if (tweenData.repeat > 0) - { - tweenData.totalDuration += (tweenData.t2 * tweenData.repeat); - } - - if (tweenData.totalDuration > maxDuration) - { - // Get the longest TweenData from the Tween, used to calculate the Tween TD - maxDuration = tweenData.totalDuration; - } - - if (tweenData.delay < minDelay) - { - minDelay = tweenData.delay; - } + default: + this.seek(); + break; } - // Excludes loop values + this.paused = false; + this.hasStarted = false; - // If duration has been set to 0 then we give it a super-low value so that it always - // renders at least 1 frame, but no more, without causing divided by zero errors elsewhere. - this.duration = Math.max(maxDuration, 0.001); - - this.loopCounter = (this.loop === -1) ? 999999999999 : this.loop; - - if (this.loopCounter > 0) - { - this.totalDuration = this.duration + this.completeDelay + ((this.duration + this.loopDelay) * this.loopCounter); - } - else - { - this.totalDuration = this.duration + this.completeDelay; - } - - // How long before this Tween starts playback? - this.startDelay = minDelay; - }, - - /** - * Called by TweenManager.preUpdate as part of its loop to check pending and active tweens. - * Should not be called directly. - * - * @method Phaser.Tweens.Tween#init - * @since 3.0.0 - * - * @return {boolean} Returns `true` if this Tween should be moved from the pending list to the active list by the Tween Manager. - */ - init: function () - { - // You can't have a paused Tween if it's part of a Timeline - if (this.paused && !this.parentIsTimeline) - { - this.state = TWEEN_CONST.PENDING_ADD; - this._pausedState = TWEEN_CONST.INIT; - - return false; - } - - var data = this.data; - var totalTargets = this.totalTargets; - - for (var i = 0; i < this.totalData; i++) - { - var tweenData = data[i]; - var target = tweenData.target; - var gen = tweenData.gen; - var key = tweenData.key; - var targetIndex = tweenData.index; - - // Old function signature: i, totalTargets, target - // New function signature: target, key, value, index, total, tween - - tweenData.delay = gen.delay(target, key, 0, targetIndex, totalTargets, this); - tweenData.duration = Math.max(gen.duration(target, key, 0, targetIndex, totalTargets, this), 0.001); - tweenData.hold = gen.hold(target, key, 0, targetIndex, totalTargets, this); - tweenData.repeat = gen.repeat(target, key, 0, targetIndex, totalTargets, this); - tweenData.repeatDelay = gen.repeatDelay(target, key, 0, targetIndex, totalTargets, this); - } - - this.calcDuration(); - - this.progress = 0; - this.totalProgress = 0; - this.elapsed = 0; - this.totalElapsed = 0; - - this.state = TWEEN_CONST.INIT; - - return true; - }, - - /** - * Internal method that makes this Tween active within the TweenManager - * and emits the onActive event and callback. - * - * @method Phaser.Tweens.Tween#makeActive - * @fires Phaser.Tweens.Events#TWEEN_ACTIVE - * @since 3.19.0 - */ - makeActive: function () - { - this.parent.makeActive(this); - - this.dispatchTweenEvent(Events.TWEEN_ACTIVE, this.callbacks.onActive); + return this; }, /** @@ -197972,6 +199817,8 @@ var Tween = new Class({ * @fires Phaser.Tweens.Events#TWEEN_COMPLETE * @fires Phaser.Tweens.Events#TWEEN_LOOP * @since 3.0.0 + * + * @return {boolean} `true` if this Tween has completed, otherwise `false`. */ nextState: function () { @@ -197986,51 +199833,45 @@ var Tween = new Class({ if (this.loopDelay > 0) { this.countdown = this.loopDelay; - this.state = TWEEN_CONST.LOOP_DELAY; + + this.setLoopDelayState(); } else { - this.state = TWEEN_CONST.ACTIVE; + this.setActiveState(); - this.dispatchTweenEvent(Events.TWEEN_LOOP, this.callbacks.onLoop); + this.dispatchEvent(Events.TWEEN_LOOP, 'onLoop'); } } else if (this.completeDelay > 0) { - this.state = TWEEN_CONST.COMPLETE_DELAY; - this.countdown = this.completeDelay; + + this.setCompleteDelayState(); } else { - this.state = TWEEN_CONST.PENDING_REMOVE; + this.onCompleteHandler(); - this.dispatchTweenEvent(Events.TWEEN_COMPLETE, this.callbacks.onComplete); + return true; } + + return false; }, /** - * Pauses the Tween immediately. Use `resume` to continue playback. + * Internal method that handles this tween completing and starting + * the next tween in the chain, if any. * - * @method Phaser.Tweens.Tween#pause - * @since 3.0.0 - * - * @return {this} - This Tween instance. + * @method Phaser.Tweens.Tween#onCompleteHandler + * @since 3.60.0 */ - pause: function () + onCompleteHandler: function () { - if (this.state === TWEEN_CONST.PAUSED) - { - return this; - } + this.progress = 1; + this.totalProgress = 1; - this.paused = true; - - this._pausedState = this.state; - - this.state = TWEEN_CONST.PAUSED; - - return this; + BaseTween.prototype.onCompleteHandler.call(this); }, /** @@ -198041,71 +199882,32 @@ var Tween = new Class({ * If the Tween is already playing, calling this method again will have no effect. If you wish to * restart the Tween, use `Tween.restart` instead. * - * Calling this method after the Tween has completed will start the Tween playing again from the start. + * Calling this method after the Tween has completed will start the Tween playing again from the beginning. * This is the same as calling `Tween.seek(0)` and then `Tween.play()`. * * @method Phaser.Tweens.Tween#play * @since 3.0.0 * - * @param {boolean} [resetFromTimeline=false] - Is this Tween being played as part of a Timeline? - * * @return {this} This Tween instance. */ - play: function (resetFromTimeline) + play: function () { - if (resetFromTimeline === undefined) { resetFromTimeline = false; } - - var state = this.state; - - if (state === TWEEN_CONST.INIT && !this.parentIsTimeline) + if (this.isDestroyed()) { - this.resetTweenData(false); - - this.state = TWEEN_CONST.ACTIVE; - - return this; - } - else if (state === TWEEN_CONST.ACTIVE || (state === TWEEN_CONST.PENDING_ADD && this._pausedState === TWEEN_CONST.PENDING_ADD)) - { - return this; - } - else if (!this.parentIsTimeline && (state === TWEEN_CONST.PENDING_REMOVE || state === TWEEN_CONST.REMOVED)) - { - this.seek(0); - this.parent.makeActive(this); + console.warn('Cannot play destroyed Tween', this); return this; } - if (this.parentIsTimeline) + if (this.isPendingRemove() || this.isPending()) { - this.resetTweenData(resetFromTimeline); - - if (this.calculatedOffset === 0) - { - this.state = TWEEN_CONST.ACTIVE; - } - else - { - this.countdown = this.calculatedOffset; - - this.state = TWEEN_CONST.OFFSET_DELAY; - } + // This makes the tween active as well: + this.seek(); } - else if (this.paused) - { - this.paused = false; - this.makeActive(); - } - else - { - this.resetTweenData(resetFromTimeline); + this.paused = false; - this.state = TWEEN_CONST.ACTIVE; - - this.makeActive(); - } + this.setActiveState(); return this; }, @@ -198122,74 +199924,13 @@ var Tween = new Class({ { var data = this.data; var total = this.totalData; - var totalTargets = this.totalTargets; for (var i = 0; i < total; i++) { - var tweenData = data[i]; - - var target = tweenData.target; - var key = tweenData.key; - var targetIndex = tweenData.index; - - tweenData.progress = 0; - tweenData.elapsed = 0; - - tweenData.repeatCounter = (tweenData.repeat === -1) ? 999999999999 : tweenData.repeat; - - if (resetFromLoop) - { - tweenData.start = tweenData.getStartValue(target, key, tweenData.start, targetIndex, totalTargets, this); - - tweenData.end = tweenData.getEndValue(target, key, tweenData.end, targetIndex, totalTargets, this); - - tweenData.current = tweenData.start; - - tweenData.state = TWEEN_CONST.PLAYING_FORWARD; - } - else - { - tweenData.state = TWEEN_CONST.PENDING_RENDER; - } - - if (tweenData.delay > 0) - { - tweenData.elapsed = tweenData.delay; - - tweenData.state = TWEEN_CONST.DELAY; - } - - if (tweenData.getActiveValue) - { - target[key] = tweenData.getActiveValue(tweenData.target, tweenData.key, tweenData.start); - } + data[i].reset(resetFromLoop); } }, - /** - * Resumes the playback of a previously paused Tween. - * - * @method Phaser.Tweens.Tween#resume - * @since 3.0.0 - * - * @return {this} - This Tween instance. - */ - resume: function () - { - if (this.state === TWEEN_CONST.PAUSED) - { - this.paused = false; - - this.state = this._pausedState; - } - else - { - this.play(); - } - - return this; - }, - /** * Seeks to a specific point in the Tween. * @@ -198209,222 +199950,108 @@ var Tween = new Class({ * @method Phaser.Tweens.Tween#seek * @since 3.0.0 * - * @param {number} toPosition - A value between 0 and 1 which represents the progress point to seek to. - * @param {number} [delta=16.6] - The size of each step when seeking through the Tween. A higher value completes faster but at a cost of less precision. + * @param {number} [toPosition=0] - A value between 0 and 1 which represents the progress point to seek to. + * @param {number} [delta=16.6] - The size of each step when seeking through the Tween. A higher value completes faster but at the cost of less precision. * * @return {this} This Tween instance. */ seek: function (toPosition, delta) { + if (toPosition === undefined) { toPosition = 0; } if (delta === undefined) { delta = 16.6; } - if (this.state === TWEEN_CONST.REMOVED) + if (this.isRemoved() || this.isFinished()) { this.makeActive(); } + this.initTweenData(true); + + if (toPosition > 0) + { + this.isSeeking = true; + + do + { + this.update(delta); + + } while (this.totalProgress <= toPosition); + + this.isSeeking = false; + } + + return this; + }, + + /** + * Initialises all of the Tween Data and Tween values. + * + * This is called automatically and should not typically be invoked directly. + * + * @method Phaser.Tweens.Tween#initTweenData + * @since 3.60.0 + * + * @param {boolean} [isSeek=false] - Is this being called as part of a seek, or not? + */ + initTweenData: function (isSeek) + { + if (isSeek === undefined) { isSeek = false; } + + this.reset(true); + + // These two values are set directly during TweenData.init: + this.duration = 0; + this.startDelay = MATH_CONST.MAX_SAFE_INTEGER; + + var data = this.data; + + for (var i = 0; i < this.totalData; i++) + { + data[i].init(isSeek); + } + + // Clamp duration to ensure we never divide by zero + this.duration = Math.max(this.duration, 0.01); + + if (this.loopCounter > 0) + { + this.totalDuration = this.duration + this.completeDelay + ((this.duration + this.loopDelay) * this.loopCounter); + } + else + { + this.totalDuration = this.duration + this.completeDelay; + } + }, + + /** + * Resets this Tween ready for another play-through from the parent TweenChain. + * + * This is called automatically and should not typically be invoked directly. + * + * If you wish to restart this Tween, see `Tween.restart` or `Tween.seek` instead. + * + * @method Phaser.Tweens.Tween#reset + * @since 3.60.0 + * + * @param {boolean} [skipReset=false] - Skip resetting the TweenData and Active State? + */ + reset: function (skipReset) + { this.elapsed = 0; this.progress = 0; this.totalElapsed = 0; this.totalProgress = 0; - var data = this.data; - var totalTargets = this.totalTargets; + this.loopCounter = (this.loop === -1) ? 999999999999 : this.loop; - for (var i = 0; i < this.totalData; i++) + if (!skipReset) { - var tweenData = data[i]; - var target = tweenData.target; - var gen = tweenData.gen; - var key = tweenData.key; - var targetIndex = tweenData.index; + this.resetTweenData(true); - tweenData.progress = 0; - tweenData.elapsed = 0; + this.setActiveState(); - tweenData.repeatCounter = (tweenData.repeat === -1) ? 999999999999 : tweenData.repeat; - - // Old function signature: i, totalTargets, target - // New function signature: target, key, value, index, total, tween - - tweenData.delay = gen.delay(target, key, 0, targetIndex, totalTargets, this); - tweenData.duration = Math.max(gen.duration(target, key, 0, targetIndex, totalTargets, this), 0.001); - tweenData.hold = gen.hold(target, key, 0, targetIndex, totalTargets, this); - tweenData.repeat = gen.repeat(target, key, 0, targetIndex, totalTargets, this); - tweenData.repeatDelay = gen.repeatDelay(target, key, 0, targetIndex, totalTargets, this); - - tweenData.current = tweenData.start; - tweenData.state = TWEEN_CONST.PLAYING_FORWARD; - - this.updateTweenData(this, tweenData, 0, targetIndex, totalTargets); - - if (tweenData.delay > 0) - { - tweenData.elapsed = tweenData.delay; - tweenData.state = TWEEN_CONST.DELAY; - } + this.dispatchEvent(Events.TWEEN_ACTIVE, 'onActive'); } - - this.calcDuration(); - - var wasPaused = false; - - if (this.state === TWEEN_CONST.PAUSED) - { - wasPaused = true; - - this.state = TWEEN_CONST.ACTIVE; - } - - this.isSeeking = true; - - do - { - this.update(0, delta); - - } while (this.totalProgress < toPosition); - - this.isSeeking = false; - - if (wasPaused) - { - this.state = TWEEN_CONST.PAUSED; - } - - return this; - }, - - /** - * Sets an event based callback to be invoked during playback. - * - * Calling this method will replace a previously set callback for the given type, if any exists. - * - * The types available are: - * - * `onActive` When the Tween is moved from the pending to the active list in the Tween Manager, even if playback paused. - * `onStart` When the Tween starts playing after a delayed state. Will happen at the same time as `onActive` if it has no delay. - * `onYoyo` When a TweenData starts a yoyo. This happens _after_ the `hold` delay expires, if set. - * `onRepeat` When a TweenData repeats playback. This happens _after_ the `repeatDelay` expires, if set. - * `onComplete` When the Tween finishes playback fully or `Tween.stop` is called. Never invoked if tween is set to repeat infinitely. - * `onUpdate` When a TweenData updates a property on a source target during playback. - * `onLoop` When a Tween loops. This happens _after_ the `loopDelay` expires, if set. - * - * @method Phaser.Tweens.Tween#setCallback - * @since 3.0.0 - * - * @param {string} type - Type of the callback to set. - * @param {function} callback - The function to invoke when this callback happens. - * @param {array} [params] - An array of parameters for specified callbacks types. - * @param {any} [scope] - The context the callback will be invoked in. - * - * @return {this} This Tween instance. - */ - setCallback: function (type, callback, params, scope) - { - this.callbacks[type] = { func: callback, scope: scope, params: [ this, null ].concat(params) }; - - return this; - }, - - /** - * Flags the Tween as being complete, whatever stage of progress it is at. - * - * If an onComplete callback has been defined it will automatically invoke it, unless a `delay` - * argument is provided, in which case the Tween will delay for that period of time before calling the callback. - * - * If you don't need a delay, or have an onComplete callback, then call `Tween.stop` instead. - * - * @method Phaser.Tweens.Tween#complete - * @fires Phaser.Tweens.Events#TWEEN_COMPLETE - * @since 3.2.0 - * - * @param {number} [delay=0] - The time to wait before invoking the complete callback. If zero it will fire immediately. - * - * @return {this} This Tween instance. - */ - complete: function (delay) - { - if (delay === undefined) { delay = 0; } - - if (delay) - { - this.state = TWEEN_CONST.COMPLETE_DELAY; - - this.countdown = delay; - } - else - { - this.state = TWEEN_CONST.PENDING_REMOVE; - - this.dispatchTweenEvent(Events.TWEEN_COMPLETE, this.callbacks.onComplete); - } - - return this; - }, - - /** - * Immediately removes this Tween from the TweenManager and all of its internal arrays, - * no matter what stage it as it. Then sets the tween state to `REMOVED`. - * - * You should dispose of your reference to this tween after calling this method, to - * free it from memory. - * - * @method Phaser.Tweens.Tween#remove - * @since 3.17.0 - * - * @return {this} This Tween instance. - */ - remove: function () - { - this.parent.remove(this); - - return this; - }, - - /** - * Stops the Tween immediately, whatever stage of progress it is at and flags it for removal by the TweenManager. - * - * @method Phaser.Tweens.Tween#stop - * @since 3.0.0 - * - * @param {number} [resetTo] - If you want to seek the tween, provide a value between 0 and 1. - * - * @return {this} This Tween instance. - */ - stop: function (resetTo) - { - if (this.state === TWEEN_CONST.ACTIVE) - { - if (resetTo !== undefined) - { - this.seek(resetTo); - } - } - - if (this.state !== TWEEN_CONST.REMOVED) - { - if (this.state === TWEEN_CONST.PAUSED || this.state === TWEEN_CONST.PENDING_ADD) - { - if (this.parentIsTimeline) - { - this.parent.manager._destroy.push(this); - this.parent.manager._toProcess++; - } - else - { - this.parent._destroy.push(this); - this.parent._toProcess++; - } - } - - this.dispatchTweenEvent(Events.TWEEN_STOP, this.callbacks.onStop); - - this.removeAllListeners(); - - this.state = TWEEN_CONST.PENDING_REMOVE; - } - - return this; }, /** @@ -198436,24 +200063,62 @@ var Tween = new Class({ * @fires Phaser.Tweens.Events#TWEEN_START * @since 3.0.0 * - * @param {number} timestamp - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. * * @return {boolean} Returns `true` if this Tween has finished and should be removed from the Tween Manager, otherwise returns `false`. */ - update: function (timestamp, delta) + update: function (delta) { - if (this.state === TWEEN_CONST.PAUSED) + if (this.isPendingRemove() || this.isDestroyed()) + { + return true; + } + else if (this.isFinished() || (this.paused && !this.isSeeking)) { return false; } - if (this.useFrames) + delta *= this.timeScale * this.parent.timeScale; + + if (this.isLoopDelayed()) { - delta = 1 * this.parent.timeScale; + this.updateLoopCountdown(delta); + } + else if (this.isCompleteDelayed()) + { + this.updateCompleteDelay(delta); + } + else if (!this.hasStarted && !this.isSeeking) + { + this.startDelay -= delta; + + if (this.startDelay <= 0) + { + this.hasStarted = true; + + this.dispatchEvent(Events.TWEEN_START, 'onStart'); + + // Reset the delta so we always start progress from zero + delta = 0; + } } - delta *= this.timeScale; + var stillRunning = false; + + if (this.isActive()) + { + var data = this.data; + + for (var i = 0; i < this.totalData; i++) + { + if (data[i].update(delta)) + { + stillRunning = true; + } + } + } + + this.delta = delta; this.elapsed += delta; this.progress = Math.min(this.elapsed / this.duration, 1); @@ -198461,450 +200126,67 @@ var Tween = new Class({ this.totalElapsed += delta; this.totalProgress = Math.min(this.totalElapsed / this.totalDuration, 1); - switch (this.state) + // Anything still running? If not, we're done + if (!stillRunning) { - case TWEEN_CONST.ACTIVE: - - if (!this.hasStarted && !this.isSeeking) - { - this.startDelay -= delta; - - if (this.startDelay <= 0) - { - this.hasStarted = true; - - this.dispatchTweenEvent(Events.TWEEN_START, this.callbacks.onStart); - } - } - - var stillRunning = false; - - for (var i = 0; i < this.totalData; i++) - { - var tweenData = this.data[i]; - - if (this.updateTweenData(this, tweenData, delta)) - { - stillRunning = true; - } - } - - // Anything still running? If not, we're done - if (!stillRunning) - { - this.nextState(); - } - - break; - - case TWEEN_CONST.LOOP_DELAY: - - this.countdown -= delta; - - if (this.countdown <= 0) - { - this.state = TWEEN_CONST.ACTIVE; - - this.dispatchTweenEvent(Events.TWEEN_LOOP, this.callbacks.onLoop); - } - - break; - - case TWEEN_CONST.OFFSET_DELAY: - - this.countdown -= delta; - - if (this.countdown <= 0) - { - this.state = TWEEN_CONST.ACTIVE; - } - - break; - - case TWEEN_CONST.COMPLETE_DELAY: - - this.countdown -= delta; - - if (this.countdown <= 0) - { - this.state = TWEEN_CONST.PENDING_REMOVE; - - this.dispatchTweenEvent(Events.TWEEN_COMPLETE, this.callbacks.onComplete); - } - - break; + // This calls onCompleteHandler if this tween is over + this.nextState(); } - return (this.state === TWEEN_CONST.PENDING_REMOVE); - }, + // if nextState called onCompleteHandler then we're ready to be removed, unless we persist + var remove = this.isPendingRemove(); - /** - * Internal method that will emit a TweenData based Event and invoke the given callback. - * - * @method Phaser.Tweens.Tween#dispatchTweenDataEvent - * @since 3.19.0 - * - * @param {Phaser.Types.Tweens.Event} event - The Event to be dispatched. - * @param {function} callback - The callback to be invoked. Can be `null` or `undefined` to skip invocation. - * @param {Phaser.Types.Tweens.TweenDataConfig} tweenData - The TweenData object that caused this event. - */ - dispatchTweenDataEvent: function (event, callback, tweenData) - { - if (!this.isSeeking) + if (remove && this.persist) { - this.emit(event, this, tweenData.key, tweenData.target, tweenData.current, tweenData.previous); + this.setFinishedState(); - if (callback) - { - callback.params[1] = tweenData.target; - - callback.func.apply(callback.scope, callback.params); - } + remove = false; } + + return remove; }, /** * Internal method that will emit a Tween based Event and invoke the given callback. * - * @method Phaser.Tweens.Tween#dispatchTweenEvent - * @since 3.19.0 + * @method Phaser.Tweens.Tween#dispatchEvent + * @since 3.60.0 * * @param {Phaser.Types.Tweens.Event} event - The Event to be dispatched. - * @param {function} callback - The callback to be invoked. Can be `null` or `undefined` to skip invocation. + * @param {Phaser.Types.Tweens.TweenCallbackTypes} [callback] - The name of the callback to be invoked. Can be `null` or `undefined` to skip invocation. */ - dispatchTweenEvent: function (event, callback) + dispatchEvent: function (event, callback) { if (!this.isSeeking) { this.emit(event, this, this.targets); - if (callback) - { - callback.params[1] = this.targets; + var handler = this.callbacks[callback]; - callback.func.apply(callback.scope, callback.params); + if (handler) + { + handler.func.apply(handler.scope, [ this, this.targets ].concat(handler.params)); } } }, /** - * Internal method used as part of the playback process that sets a tween to play in reverse. + * Handles the destroy process of this Tween, clearing out the + * Tween Data and resetting the targets. A Tween that has been + * destroyed cannot ever be played or used again. * - * @method Phaser.Tweens.Tween#setStateFromEnd - * @fires Phaser.Tweens.Events#TWEEN_REPEAT - * @fires Phaser.Tweens.Events#TWEEN_YOYO - * @since 3.0.0 - * - * @param {Phaser.Tweens.Tween} tween - The Tween to update. - * @param {Phaser.Types.Tweens.TweenDataConfig} tweenData - The TweenData property to update. - * @param {number} diff - Any extra time that needs to be accounted for in the elapsed and progress values. - * - * @return {number} The state of this Tween. + * @method Phaser.Tweens.Tween#destroy + * @since 3.60.0 */ - setStateFromEnd: function (tween, tweenData, diff) + destroy: function () { - if (tweenData.yoyo) - { - // We've hit the end of a Playing Forward TweenData and we have a yoyo + BaseTween.prototype.destroy.call(this); - // Account for any extra time we got from the previous frame - tweenData.elapsed = diff; - tweenData.progress = diff / tweenData.duration; - - if (tweenData.flipX) - { - tweenData.target.toggleFlipX(); - } - - if (tweenData.flipY) - { - tweenData.target.toggleFlipY(); - } - - this.dispatchTweenDataEvent(Events.TWEEN_YOYO, tween.callbacks.onYoyo, tweenData); - - tweenData.start = tweenData.getStartValue(tweenData.target, tweenData.key, tweenData.start, tweenData.index, tween.totalTargets, tween); - - return TWEEN_CONST.PLAYING_BACKWARD; - } - else if (tweenData.repeatCounter > 0) - { - // We've hit the end of a Playing Forward TweenData and we have a Repeat. - // So we're going to go right back to the start to repeat it again. - - tweenData.repeatCounter--; - - // Account for any extra time we got from the previous frame - tweenData.elapsed = diff; - tweenData.progress = diff / tweenData.duration; - - if (tweenData.flipX) - { - tweenData.target.toggleFlipX(); - } - - if (tweenData.flipY) - { - tweenData.target.toggleFlipY(); - } - - tweenData.start = tweenData.getStartValue(tweenData.target, tweenData.key, tweenData.start, tweenData.index, tween.totalTargets, tween); - - tweenData.end = tweenData.getEndValue(tweenData.target, tweenData.key, tweenData.start, tweenData.index, tween.totalTargets, tween); - - // Delay? - if (tweenData.repeatDelay > 0) - { - tweenData.elapsed = tweenData.repeatDelay - diff; - - tweenData.current = tweenData.start; - - tweenData.target[tweenData.key] = tweenData.current; - - return TWEEN_CONST.REPEAT_DELAY; - } - else - { - this.dispatchTweenDataEvent(Events.TWEEN_REPEAT, tween.callbacks.onRepeat, tweenData); - - return TWEEN_CONST.PLAYING_FORWARD; - } - } - - return TWEEN_CONST.COMPLETE; - }, - - /** - * Internal method used as part of the playback process that sets a tween to play from the start. - * - * @method Phaser.Tweens.Tween#setStateFromStart - * @fires Phaser.Tweens.Events#TWEEN_REPEAT - * @since 3.0.0 - * - * @param {Phaser.Tweens.Tween} tween - The Tween to update. - * @param {Phaser.Types.Tweens.TweenDataConfig} tweenData - The TweenData property to update. - * @param {number} diff - Any extra time that needs to be accounted for in the elapsed and progress values. - * - * @return {number} The state of this Tween. - */ - setStateFromStart: function (tween, tweenData, diff) - { - if (tweenData.repeatCounter > 0) - { - tweenData.repeatCounter--; - - // Account for any extra time we got from the previous frame - tweenData.elapsed = diff; - tweenData.progress = diff / tweenData.duration; - - if (tweenData.flipX) - { - tweenData.target.toggleFlipX(); - } - - if (tweenData.flipY) - { - tweenData.target.toggleFlipY(); - } - - tweenData.end = tweenData.getEndValue(tweenData.target, tweenData.key, tweenData.start, tweenData.index, tween.totalTargets, tween); - - // Delay? - if (tweenData.repeatDelay > 0) - { - tweenData.elapsed = tweenData.repeatDelay - diff; - - tweenData.current = tweenData.start; - - tweenData.target[tweenData.key] = tweenData.current; - - return TWEEN_CONST.REPEAT_DELAY; - } - else - { - this.dispatchTweenDataEvent(Events.TWEEN_REPEAT, tween.callbacks.onRepeat, tweenData); - - return TWEEN_CONST.PLAYING_FORWARD; - } - } - - return TWEEN_CONST.COMPLETE; - }, - - /** - * Internal method that advances the TweenData based on the time value given. - * - * @method Phaser.Tweens.Tween#updateTweenData - * @fires Phaser.Tweens.Events#TWEEN_UPDATE - * @fires Phaser.Tweens.Events#TWEEN_REPEAT - * @since 3.0.0 - * - * @param {Phaser.Tweens.Tween} tween - The Tween to update. - * @param {Phaser.Types.Tweens.TweenDataConfig} tweenData - The TweenData property to update. - * @param {number} delta - Either a value in ms, or 1 if Tween.useFrames is true. - * - * @return {boolean} True if the tween is not complete (e.g., playing), or false if the tween is complete. - */ - updateTweenData: function (tween, tweenData, delta) - { - var target = tweenData.target; - - switch (tweenData.state) - { - case TWEEN_CONST.PLAYING_FORWARD: - case TWEEN_CONST.PLAYING_BACKWARD: - - if (!target) - { - tweenData.state = TWEEN_CONST.COMPLETE; - break; - } - - var elapsed = tweenData.elapsed; - var duration = tweenData.duration; - var diff = 0; - - elapsed += delta; - - if (elapsed > duration) - { - diff = elapsed - duration; - elapsed = duration; - } - - var forward = (tweenData.state === TWEEN_CONST.PLAYING_FORWARD); - var progress = elapsed / duration; - - tweenData.elapsed = elapsed; - tweenData.progress = progress; - tweenData.previous = tweenData.current; - - if (progress === 1) - { - if (forward) - { - tweenData.current = tweenData.end; - target[tweenData.key] = tweenData.end; - - if (tweenData.hold > 0) - { - tweenData.elapsed = tweenData.hold - diff; - - tweenData.state = TWEEN_CONST.HOLD_DELAY; - } - else - { - tweenData.state = this.setStateFromEnd(tween, tweenData, diff); - } - } - else - { - tweenData.current = tweenData.start; - target[tweenData.key] = tweenData.start; - - tweenData.state = this.setStateFromStart(tween, tweenData, diff); - } - } - else - { - var v = (forward) ? tweenData.ease(progress) : tweenData.ease(1 - progress); - - tweenData.current = tweenData.start + ((tweenData.end - tweenData.start) * v); - - target[tweenData.key] = tweenData.current; - } - - this.dispatchTweenDataEvent(Events.TWEEN_UPDATE, tween.callbacks.onUpdate, tweenData); - - break; - - case TWEEN_CONST.DELAY: - - tweenData.elapsed -= delta; - - if (tweenData.elapsed <= 0) - { - tweenData.elapsed = Math.abs(tweenData.elapsed); - - tweenData.state = TWEEN_CONST.PENDING_RENDER; - } - - break; - - case TWEEN_CONST.REPEAT_DELAY: - - tweenData.elapsed -= delta; - - if (tweenData.elapsed <= 0) - { - tweenData.elapsed = Math.abs(tweenData.elapsed); - - tweenData.state = TWEEN_CONST.PLAYING_FORWARD; - - this.dispatchTweenDataEvent(Events.TWEEN_REPEAT, tween.callbacks.onRepeat, tweenData); - } - - break; - - case TWEEN_CONST.HOLD_DELAY: - - tweenData.elapsed -= delta; - - if (tweenData.elapsed <= 0) - { - tweenData.state = this.setStateFromEnd(tween, tweenData, Math.abs(tweenData.elapsed)); - } - - break; - - case TWEEN_CONST.PENDING_RENDER: - - if (target) - { - tweenData.start = tweenData.getStartValue(target, tweenData.key, target[tweenData.key], tweenData.index, tween.totalTargets, tween); - - tweenData.end = tweenData.getEndValue(target, tweenData.key, tweenData.start, tweenData.index, tween.totalTargets, tween); - - tweenData.current = tweenData.start; - - target[tweenData.key] = tweenData.start; - - tweenData.state = TWEEN_CONST.PLAYING_FORWARD; - } - else - { - tweenData.state = TWEEN_CONST.COMPLETE; - } - - break; - } - - // Return TRUE if this TweenData still playing, otherwise return FALSE - return (tweenData.state !== TWEEN_CONST.COMPLETE); + this.targets = null; } }); -// onActive = 'active' event = When the Tween is moved from the pending to the active list in the manager, even if playback delayed -// onStart = 'start' event = When the Tween starts playing from a delayed state (will happen same time as onActive if no delay) -// onStop = 'stop' event = When the Tween is stopped -// onYoyo = 'yoyo' event = When the Tween starts a yoyo -// onRepeat = 'repeat' event = When a TweenData repeats playback (if any) -// onComplete = 'complete' event = When the Tween finishes all playback (can sometimes never happen if repeat -1), also when 'stop' called -// onUpdate = 'update' event = When the Tween updates a TweenData during playback (expensive!) -// onLoop = 'loop' event = Used to loop ALL TweenDatas in a Tween - -Tween.TYPES = [ - 'onActive', - 'onComplete', - 'onLoop', - 'onRepeat', - 'onStart', - 'onStop', - 'onUpdate', - 'onYoyo' -]; - /** * Creates a new Tween object. * @@ -198922,14 +200204,6 @@ GameObjectFactory.register('tween', function (config) return this.scene.sys.tweens.add(config); }); -// When registering a factory function 'this' refers to the GameObjectFactory context. -// -// There are several properties available to use: -// -// this.scene - a reference to the Scene that owns the GameObjectFactory -// this.displayList - a reference to the Display List the Scene owns -// this.updateList - a reference to the Update List the Scene owns - /** * Creates a new Tween object and returns it. * @@ -198947,139 +200221,1706 @@ GameObjectCreator.register('tween', function (config) return this.scene.sys.tweens.create(config); }); -// When registering a factory function 'this' refers to the GameObjectCreator context. - module.exports = Tween; /***/ }), -/***/ 15718: -/***/ ((module) => { +/***/ 45641: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var ArrayRemove = __webpack_require__(66458); +var BaseTween = __webpack_require__(502); +var Class = __webpack_require__(56694); +var Events = __webpack_require__(54272); +var GameObjectCreator = __webpack_require__(99325); +var GameObjectFactory = __webpack_require__(61286); + /** - * Returns a TweenDataConfig object that describes the tween data for a unique property of a unique target. - * A single Tween consists of multiple TweenDatas, depending on how many properties are being changed by the Tween. + * @classdesc + * TODO * - * This is an internal function used by the TweenBuilder and should not be accessed directly, instead, - * Tweens should be created using the GameObjectFactory or GameObjectCreator. + * @class TweenChain + * @memberof Phaser.Tweens + * @extends Phaser.Tweens.BaseTween + * @constructor + * @since 3.60.0 * - * @function Phaser.Tweens.TweenData - * @since 3.0.0 + * @param {(Phaser.Tweens.TweenManager|Phaser.Tweens.TweenChain)} parent - A reference to the Tween Manager, or TweenChain, that owns this TweenChain. + */ +var TweenChain = new Class({ + + Extends: BaseTween, + + initialize: + + function TweenChain (parent) + { + BaseTween.call(this, parent); + + /** + * A reference to the Tween that this TweenChain is currently playing. + * + * @name Phaser.Tweens.TweenChain#currentTween + * @type {Phaser.Tweens.Tween} + * @since 3.60.0 + */ + this.currentTween = null; + + /** + * A reference to the data array index of the currently playing tween. + * + * @name Phaser.Tweens.TweenChain#currentIndex + * @type {number} + * @since 3.60.0 + */ + this.currentIndex = 0; + }, + + /** + * Prepares this TweenChain for playback. + * + * Called automatically by the TweenManager. Should not be called directly. + * + * @method Phaser.Tweens.TweenChain#init + * @fires Phaser.Tweens.Events#TWEEN_ACTIVE + * @since 3.60.0 + * + * @return {this} This TweenChain instance. + */ + init: function () + { + this.loopCounter = (this.loop === -1) ? 999999999999 : this.loop; + + this.setCurrentTween(0); + + if (this.startDelay > 0 && !this.isStartDelayed()) + { + this.setStartDelayState(); + } + else + { + this.setActiveState(); + } + + this.dispatchEvent(Events.TWEEN_ACTIVE, 'onActive'); + + return this; + }, + + /** + * Create a sequence of Tweens, chained to one-another, and add them to this Tween Manager. + * + * The tweens are played in order, from start to finish. You can optionally set the chain + * to repeat as many times as you like. Once the chain has finished playing, or repeating if set, + * all tweens in the chain will be destroyed automatically. To override this, set the 'persists' + * argument to 'true'. + * + * Playback will start immediately unless the _first_ Tween has been configured to be paused. + * + * Please note that Tweens will not manipulate any target property that begins with an underscore. + * + * @method Phaser.Tweens.TweenChain#add + * @since 3.60.0 + * + * @param {Phaser.Types.Tweens.TweenBuilderConfig[]|object[]} tweens - An array of Tween configuration objects for the Tweens in this chain. + * + * @return {this} This TweenChain instance. + */ + add: function (tweens) + { + var newTweens = this.parent.create(tweens); + + if (!Array.isArray(newTweens)) + { + newTweens = [ newTweens ]; + } + + var data = this.data; + + for (var i = 0; i < newTweens.length; i++) + { + var tween = newTweens[i]; + + tween.parent = this; + + data.push(tween.init()); + } + + this.totalData = data.length; + + return this; + }, + + /** + * Removes the given Tween from this Tween Chain. + * + * The removed tween is _not_ destroyed. It is just removed from this Tween Chain. + * + * If the given Tween is currently playing then the chain will automatically move + * to the next tween in the chain. If there are no more tweens, this chain will complete. + * + * @method Phaser.Tweens.TweenChain#remove + * @since 3.60.0 + * @override + * + * @param {Phaser.Tweens.Tween} tween - The Tween to be removed. + * + * @return {this} This Tween Chain instance. + */ + remove: function (tween) + { + // Remove it immediately + ArrayRemove(this.data, tween); + + tween.setRemovedState(); + + if (tween === this.currentTween) + { + this.nextTween(); + } + + this.totalData = this.data.length; + + return this; + }, + + /** + * See if any of the tweens in this Tween Chain is currently acting upon the given target. + * + * @method Phaser.Tweens.TweenChain#hasTarget + * @since 3.60.0 + * + * @param {object} target - The target to check against this TweenChain. + * + * @return {boolean} `true` if the given target is a target of this TweenChain, otherwise `false`. + */ + hasTarget: function (target) + { + var data = this.data; + + for (var i = 0; i < this.totalData; i++) + { + if (data[i].hasTarget(target)) + { + return true; + } + } + + return false; + }, + + /** + * Restarts the TweenChain from the beginning. + * + * If this TweenChain was configured to have a loop, or start delay, those + * are reset to their initial values as well. It will also dispatch the + * `onActive` callback and event again. + * + * @method Phaser.Tweens.TweenChain#restart + * @since 3.60.0 + * + * @return {this} This TweenChain instance. + */ + restart: function () + { + if (this.isDestroyed()) + { + console.warn('Cannot restart destroyed TweenChain', this); + + return this; + } + + if (this.isRemoved()) + { + this.parent.makeActive(this); + } + + this.resetTweens(); + + this.paused = false; + + return this.init(); + }, + + /** + * Resets the given Tween. + * + * It will seek to position 0 and playback will start on the next frame. + * + * @method Phaser.Tweens.TweenChain#reset + * @since 3.60.0 + * + * @param {Phaser.Tweens.Tween} tween - The Tween to be reset. + * + * @return {this} This TweenChain instance. + */ + reset: function (tween) + { + tween.seek(); + + tween.setActiveState(); + + return this; + }, + + /** + * Re-initiases the given Tween and sets it to the Active state. + * + * @method Phaser.Tweens.TweenChain#makeActive + * @since 3.60.0 + * @override + * + * @param {Phaser.Tweens.Tween} tween - The Tween to check. + * + * @return {this} This TweenChain instance. + */ + makeActive: function (tween) + { + tween.init(); + + tween.setActiveState(); + + return this; + }, + + /** + * Internal method that advances to the next state of the TweenChain playback. + * + * @method Phaser.Tweens.TweenChain#nextState + * @fires Phaser.Tweens.Events#TWEEN_COMPLETE + * @fires Phaser.Tweens.Events#TWEEN_LOOP + * @since 3.60.0 + * + * @return {boolean} `true` if this TweenChain has completed, otherwise `false`. + */ + nextState: function () + { + if (this.loopCounter > 0) + { + this.loopCounter--; + + this.resetTweens(); + + if (this.loopDelay > 0) + { + this.countdown = this.loopDelay; + + this.setLoopDelayState(); + } + else + { + this.setActiveState(); + + this.dispatchEvent(Events.TWEEN_LOOP, 'onLoop'); + } + } + else if (this.completeDelay > 0) + { + this.countdown = this.completeDelay; + + this.setCompleteDelayState(); + } + else + { + this.onCompleteHandler(); + + return true; + } + + return false; + }, + + /** + * Starts this TweenChain playing. + * + * You only need to call this method if you have configured this TweenChain to be paused on creation. + * + * If the TweenChain is already playing, calling this method again will have no effect. If you wish to + * restart the chain, use `TweenChain.restart` instead. + * + * Calling this method after the TweenChain has completed will start the chain playing again from the beginning. + * + * @method Phaser.Tweens.TweenChain#play + * @since 3.60.0 + * + * @return {this} This TweenChain instance. + */ + play: function () + { + if (this.isDestroyed()) + { + console.warn('Cannot play destroyed TweenChain', this); + + return this; + } + + if (this.isPendingRemove() || this.isPending()) + { + this.resetTweens(); + } + + this.paused = false; + + if (this.startDelay > 0 && !this.isStartDelayed()) + { + this.setStartDelayState(); + } + else + { + this.setActiveState(); + } + + return this; + }, + + /** + * Internal method that resets all of the Tweens and the current index pointer. + * + * @method Phaser.Tweens.TweenChain#resetTweens + * @since 3.60.0 + */ + resetTweens: function () + { + var data = this.data; + var total = this.totalData; + + for (var i = 0; i < total; i++) + { + data[i].reset(false); + } + + this.currentIndex = 0; + this.currentTween = data[0]; + }, + + /** + * Internal method that advances the TweenChain based on the time values. + * + * @method Phaser.Tweens.TweenChain#update + * @fires Phaser.Tweens.Events#TWEEN_COMPLETE + * @fires Phaser.Tweens.Events#TWEEN_LOOP + * @fires Phaser.Tweens.Events#TWEEN_START + * @since 3.60.0 + * + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + * + * @return {boolean} Returns `true` if this TweenChain has finished and should be removed from the Tween Manager, otherwise returns `false`. + */ + update: function (delta) + { + if (this.isPendingRemove() || this.isDestroyed()) + { + return true; + } + else if (this.isFinished() || this.paused) + { + return false; + } + + // The TweehChain.timeScale is applied within Tween.update, so doesn't need including here + delta *= this.parent.timeScale; + + if (this.isLoopDelayed()) + { + this.updateLoopCountdown(delta); + } + else if (this.isCompleteDelayed()) + { + this.updateCompleteDelay(delta); + } + else if (this.isStartDelayed()) + { + // Reset the delta so we always start progress from zero + delta = this.updateStartCountdown(delta); + } + + var remove = false; + + if (this.isActive() && this.currentTween) + { + if (this.currentTween.update(delta)) + { + // This tween has finshed playback, so move to the next one + if (this.nextTween()) + { + this.nextState(); + } + } + + // if nextState called onCompleteHandler then we're ready to be removed, unless we persist + remove = this.isPendingRemove(); + + if (remove && this.persist) + { + this.setFinishedState(); + + remove = false; + } + } + + return remove; + }, + + /** + * Immediately advances to the next Tween in the chain. + * + * This is typically called internally, but can be used if you need to + * advance playback for some reason. + * + * @method Phaser.Tweens.TweenChain#nextTween + * @since 3.60.0 + * + * @return {boolean} `true` if there are no more Tweens in the chain, otherwise `false`. + */ + nextTween: function () + { + this.currentIndex++; + + if (this.currentIndex === this.totalData) + { + return true; + } + else + { + this.setCurrentTween(this.currentIndex); + } + + return false; + }, + + /** + * Sets the current active Tween to the given index, based on its + * entry in the TweenChain data array. + * + * @method Phaser.Tweens.TweenChain#setCurrentTween + * @since 3.60.0 + * + * @param {number} index - The index of the Tween to be made current. + */ + setCurrentTween: function (index) + { + this.currentIndex = index; + + this.currentTween = this.data[index]; + + this.currentTween.setActiveState(); + + this.currentTween.dispatchEvent(Events.TWEEN_ACTIVE, 'onActive'); + }, + + /** + * Internal method that will emit a TweenChain based Event and invoke the given callback. + * + * @method Phaser.Tweens.TweenChain#dispatchEvent + * @since 3.60.0 + * + * @param {Phaser.Types.Tweens.Event} event - The Event to be dispatched. + * @param {Phaser.Types.Tweens.TweenCallbackTypes} [callback] - The name of the callback to be invoked. Can be `null` or `undefined` to skip invocation. + */ + dispatchEvent: function (event, callback) + { + this.emit(event, this); + + var handler = this.callbacks[callback]; + + if (handler) + { + handler.func.apply(handler.scope, [ this ].concat(handler.params)); + } + }, + + /** + * Immediately destroys this TweenChain, nulling of all its references. + * + * @method Phaser.Tweens.TweenChain#destroy + * @since 3.60.0 + */ + destroy: function () + { + BaseTween.prototype.destroy.call(this); + + this.currentTween = null; + } + +}); + +/** + * Creates a new TweenChain object and adds it to the Tween Manager. * - * @param {any} target - The target to tween. - * @param {number} index - The target index within the Tween targets array. + * Note: This method will only be available if Tweens have been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectFactory#tweenchain + * @since 3.60.0 + * + * @param {Phaser.Types.Tweens.TweenBuilderConfig|object} config - The TweenChain configuration. + * + * @return {Phaser.Tweens.TweenChain} The TweenChain that was created. + */ +GameObjectFactory.register('tweenchain', function (config) +{ + return this.scene.sys.tweens.chain(config); +}); + +/** + * Creates a new TweenChain object and returns it, without adding it to the Tween Manager. + * + * Note: This method will only be available if Tweens have been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectCreator#tweenchain + * @since 3.60.0 + * + * @param {Phaser.Types.Tweens.TweenBuilderConfig|object} config - The TweenChain configuration. + * + * @return {Phaser.Tweens.TweenChain} The TweenChain that was created. + */ +GameObjectCreator.register('tweenchain', function (config) +{ + return this.scene.sys.tweens.create(config); +}); + +module.exports = TweenChain; + + +/***/ }), + +/***/ 15718: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BaseTweenData = __webpack_require__(65521); +var Class = __webpack_require__(56694); +var Events = __webpack_require__(54272); + +/** + * @classdesc + * The TweenData is a class that contains a single target and property that is being tweened. + * + * Tweens create TweenData instances when they are created, with one TweenData instance per + * target, per property. A Tween can own multiple TweenData instances, but a TweenData only + * ever belongs to a single Tween. + * + * You should not typically create these yourself, but rather use the TweenBuilder, + * or the `Tween.add` method. + * + * Prior to Phaser 3.60 the TweenData was just an object, but was refactored to a class, + * to make it responsible for its own state and updating. + * + * @class TweenData + * @memberof Phaser.Tweens + * @extends Phaser.Tweens.BaseTweenData + * @constructor + * @since 3.60.0 + * + * @param {Phaser.Tweens.Tween} tween - The tween this TweenData instance belongs to. + * @param {number} targetIndex - The target index within the Tween targets array. * @param {string} key - The property of the target to tween. - * @param {function} getEnd - What the property will be at the END of the Tween. - * @param {function} getStart - What the property will be at the START of the Tween. - * @param {?function} getActive - If not null, is invoked _immediately_ as soon as the TweenData is running, and is set on the target property. + * @param {Phaser.Types.Tweens.GetEndCallback} getEnd - What the property will be at the END of the Tween. + * @param {Phaser.Types.Tweens.GetStartCallback} getStart - What the property will be at the START of the Tween. + * @param {?Phaser.Types.Tweens.GetActiveCallback} getActive - If not null, is invoked _immediately_ as soon as the TweenData is running, and is set on the target property. * @param {function} ease - The ease function this tween uses. - * @param {number} delay - Time in ms/frames before tween will start. - * @param {number} duration - Duration of the tween in ms/frames. + * @param {function} delay - Function that returns the time in ms/frames before tween will start. + * @param {number} duration - The duration of the tween in ms/frames. * @param {boolean} yoyo - Determines whether the tween should return back to its start value after hold has expired. - * @param {number} hold - Time in ms/frames the tween will pause before repeating or returning to its starting value if yoyo is set to true. - * @param {number} repeat - Number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. - * @param {number} repeatDelay - Time in ms/frames before the repeat will start. + * @param {number} hold - Function that returns the time in ms/frames the tween will pause before repeating or returning to its starting value if yoyo is set to true. + * @param {number} repeat - Function that returns the number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. + * @param {number} repeatDelay - Function that returns the time in ms/frames before the repeat will start. * @param {boolean} flipX - Should toggleFlipX be called when yoyo or repeat happens? * @param {boolean} flipY - Should toggleFlipY be called when yoyo or repeat happens? - * - * @return {Phaser.Types.Tweens.TweenDataConfig} The config object describing this TweenData. + * @param {?function} interpolation - The interpolation function to be used for arrays of data. Defaults to 'null'. + * @param {?number[]} interpolationData - The array of interpolation data to be set. Defaults to 'null'. */ -var TweenData = function (target, index, key, getEnd, getStart, getActive, ease, delay, duration, yoyo, hold, repeat, repeatDelay, flipX, flipY) -{ - return { +var TweenData = new Class({ - // The target to tween - target: target, + Extends: BaseTweenData, - // The index of the target within the tween targets array - index: index, + initialize: - // The property of the target to tween - key: key, + function TweenData (tween, targetIndex, key, getEnd, getStart, getActive, ease, delay, duration, yoyo, hold, repeat, repeatDelay, flipX, flipY, interpolation, interpolationData) + { + BaseTweenData.call(this, tween, targetIndex, delay, duration, yoyo, hold, repeat, repeatDelay, flipX, flipY); - // What to set the property to the moment the TweenData is invoked. - getActiveValue: getActive, + /** + * The property of the target to be tweened. + * + * @name Phaser.Tweens.TweenData#key + * @type {string} + * @since 3.60.0 + */ + this.key = key; - // The returned value sets what the property will be at the END of the Tween. - getEndValue: getEnd, + /** + * A function that returns what to set the target property to, + * the moment the TweenData is invoked. + * + * This is called when this TweenData is inititalised or reset. + * + * @name Phaser.Tweens.TweenData#getActiveValue + * @type {?Phaser.Types.Tweens.GetActiveCallback} + * @since 3.60.0 + */ + this.getActiveValue = getActive; - // The returned value sets what the property will be at the START of the Tween. - getStartValue: getStart, + /** + * A function that returns what to set the target property to + * at the end of the tween. + * + * This is called when the tween starts playing, after any initial + * start delay, or if the tween is reset, or is set to repeat. + * + * @name Phaser.Tweens.TweenData#getEndValue + * @type {Phaser.Types.Tweens.GetEndCallback} + * @since 3.60.0 + */ + this.getEndValue = getEnd; - // The ease function this tween uses. - ease: ease, + /** + * A function that returns what to set the target property to + * at the start of the tween. + * + * This is called when the tween starts playing, after any initial + * start delay, or if the tween is reset, or is set to repeat. + * + * @name Phaser.Tweens.TweenData#getStartValue + * @type {Phaser.Types.Tweens.GetStartCallback} + * @since 3.60.0 + */ + this.getStartValue = getStart; - // Duration of the tween in ms/frames, excludes time for yoyo or repeats. - duration: 0, + /** + * The ease function this Tween uses to calculate the target value. + * + * @name Phaser.Tweens.TweenData#ease + * @type {function} + * @since 3.60.0 + */ + this.ease = ease; - // The total calculated duration of this TweenData (based on duration, repeat, delay and yoyo) - totalDuration: 0, + /** + * The target's starting value, as returned by `getStartValue`. + * + * @name Phaser.Tweens.TweenData#start + * @type {number} + * @since 3.60.0 + */ + this.start = 0; - // Time in ms/frames before tween will start. - delay: 0, + /** + * The target value from the previous step. + * + * @name Phaser.Tweens.TweenData#previous + * @type {number} + * @since 3.60.0 + */ + this.previous = 0; - // Cause the tween to return back to its start value after hold has expired. - yoyo: yoyo, + /** + * The target's current value, as recorded in the most recent step. + * + * @name Phaser.Tweens.TweenData#current + * @type {number} + * @since 3.60.0 + */ + this.current = 0; - // Time in ms/frames the tween will pause before running the yoyo or starting a repeat. - hold: 0, + /** + * The target's ending value, as returned by `getEndValue`. + * + * @name Phaser.Tweens.TweenData#end + * @type {number} + * @since 3.60.0 + */ + this.end = 0; - // Number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. - repeat: 0, + /** + * The interpolation function to be used for arrays of data. + * + * @name Phaser.Tweens.TweenData#interpolation + * @type {?function} + * @default null + * @since 3.60.0 + */ + this.interpolation = interpolation; - // Time in ms/frames before the repeat will start. - repeatDelay: 0, + /** + * The array of data to interpolate, if interpolation is being used. + * + * @name Phaser.Tweens.TweenData#interpolationData + * @type {?number[]} + * @since 3.60.0 + */ + this.interpolationData = interpolationData; + }, - // Automatically call toggleFlipX when the TweenData yoyos or repeats - flipX: flipX, + /** + * Prepares this TweenData for playback. + * + * Called automatically by the parent Tween. Should not be called directly. + * + * @method Phaser.Tweens.TweenData#init + * @since 3.60.0 + * + * @param {boolean} [isSeek=false] - Is the parent Tween currently seeking? + */ + init: function (isSeek) + { + var tween = this.tween; + var totalTargets = tween.totalTargets; - // Automatically call toggleFlipY when the TweenData yoyos or repeats - flipY: flipY, + var targetIndex = this.targetIndex; + var target = tween.targets[targetIndex]; + var key = this.key; - // Between 0 and 1 showing completion of this TweenData. - progress: 0, + // Function signature: target, key, value, index, total, tween - // Delta counter. - elapsed: 0, + this.delay = this.getDelay(target, key, 0, targetIndex, totalTargets, tween); - // How many repeats are left to run? - repeatCounter: 0, + this.repeatCounter = (this.repeat === -1) ? 999999999999 : this.repeat; - // Ease Value Data: + this.setPendingRenderState(); - start: 0, - previous: 0, - current: 0, - end: 0, + // calcDuration: - // Time Durations - t1: 0, - t2: 0, + // Set t1 (duration + hold + yoyo) + var t1 = this.duration + this.hold; - // LoadValue generation functions - gen: { - delay: delay, - duration: duration, - hold: hold, - repeat: repeat, - repeatDelay: repeatDelay - }, + if (this.yoyo) + { + t1 += this.duration; + } - // TWEEN_CONST.CREATED - state: 0 - }; -}; + // Set t2 (repeatDelay + duration + hold + yoyo) + var t2 = t1 + this.repeatDelay; + + // Total Duration + this.totalDuration = this.delay + t1; + + if (this.repeat === -1) + { + this.totalDuration += (t2 * 999999999999); + } + else if (this.repeat > 0) + { + this.totalDuration += (t2 * this.repeat); + } + + if (this.totalDuration > tween.duration) + { + // Set the longest duration in the parent Tween + tween.duration = this.totalDuration; + } + + if (this.delay < tween.startDelay) + { + tween.startDelay = this.delay; + } + + // seek specific: + if (isSeek) + { + this.current = this.start; + this.progress = 0; + this.elapsed = 0; + + this.setPlayingForwardState(); + + this.update(0); + } + + if (this.delay > 0) + { + this.elapsed = this.delay; + + this.setDelayState(); + } + + if (!isSeek && this.getActiveValue) + { + target[key] = this.getActiveValue(target, key, this.start); + } + }, + + /** + * Internal method that advances this TweenData based on the delta value given. + * + * @method Phaser.Tweens.TweenData#update + * @fires Phaser.Tweens.Events#TWEEN_UPDATE + * @fires Phaser.Tweens.Events#TWEEN_REPEAT + * @since 3.60.0 + * + * @param {number} delta - The elapsed delta time in ms. + * + * @return {boolean} `true` if this TweenData is still playing, or `false` if it has finished entirely. + */ + update: function (delta) + { + var tween = this.tween; + var totalTargets = tween.totalTargets; + + var targetIndex = this.targetIndex; + var target = tween.targets[targetIndex]; + var key = this.key; + + // Bail out if we don't have a target to act upon + if (!target) + { + this.setCompleteState(); + + return false; + } + + if (this.isCountdown) + { + this.elapsed -= delta; + + if (this.elapsed <= 0) + { + this.elapsed = 0; + + delta = 0; + + if (this.isDelayed()) + { + this.setPendingRenderState(); + } + else if (this.isRepeating()) + { + this.setPlayingForwardState(); + + this.dispatchEvent(Events.TWEEN_REPEAT, 'onRepeat'); + } + else if (this.isHolding()) + { + this.setStateFromEnd(0); + } + } + } + + // All of the above have the ability to change the state, so put this in its own check + + if (this.isPendingRender()) + { + this.start = this.getStartValue(target, key, target[key], targetIndex, totalTargets, tween); + + this.end = this.getEndValue(target, key, this.start, targetIndex, totalTargets, tween); + + this.current = this.start; + + target[key] = this.start; + + this.setPlayingForwardState(); + + return true; + } + + var forward = this.isPlayingForward(); + var backward = this.isPlayingBackward(); + + if (forward || backward) + { + var elapsed = this.elapsed; + var duration = this.duration; + var diff = 0; + var complete = false; + + elapsed += delta; + + if (elapsed >= duration) + { + diff = elapsed - duration; + elapsed = duration; + complete = true; + } + + var progress = elapsed / duration; + + this.elapsed = elapsed; + this.progress = progress; + this.previous = this.current; + + if (complete) + { + if (forward) + { + this.current = this.end; + + target[key] = this.end; + + if (this.hold > 0 && this.repeatCounter > 0) + { + this.elapsed = this.hold; + + this.setHoldState(); + } + else + { + this.setStateFromEnd(diff); + } + } + else + { + this.current = this.start; + + target[key] = this.start; + + this.setStateFromStart(diff); + } + } + else + { + if (!forward) + { + progress = 1 - progress; + } + + var v = this.ease(progress); + + if (this.interpolation) + { + this.current = this.interpolation(this.interpolationData, v); + } + else + { + this.current = this.start + ((this.end - this.start) * v); + } + + target[key] = this.current; + } + + this.dispatchEvent(Events.TWEEN_UPDATE, 'onUpdate'); + } + + // Return TRUE if this TweenData still playing, otherwise FALSE + return !this.isComplete(); + }, + + /** + * Internal method that resets this Tween Data, including the progress and elapsed values. + * + * @method Phaser.Tweens.TweenData#reset + * @since 3.60.0 + * + * @param {boolean} resetFromLoop - Has this method been called as part of a loop? + */ + reset: function (resetFromLoop) + { + var tween = this.tween; + var totalTargets = tween.totalTargets; + + var targetIndex = this.targetIndex; + var target = tween.targets[targetIndex]; + var key = this.key; + + this.progress = 0; + this.elapsed = 0; + + this.repeatCounter = (this.repeat === -1) ? 999999999999 : this.repeat; + + if (resetFromLoop) + { + this.start = this.getStartValue(target, key, this.start, targetIndex, totalTargets, tween); + + this.end = this.getEndValue(target, key, this.end, targetIndex, totalTargets, tween); + + this.current = this.start; + + this.setPlayingForwardState(); + } + else + { + this.setPendingRenderState(); + } + + if (this.delay > 0) + { + this.elapsed = this.delay; + + this.setDelayState(); + } + + if (this.getActiveValue) + { + target[key] = this.getActiveValue(target, key, this.start); + } + }, + + /** + * Internal method that will emit a TweenData based Event on the + * parent Tween and also invoke the given callback, if provided. + * + * @method Phaser.Tweens.TweenData#dispatchEvent + * @since 3.60.0 + * + * @param {Phaser.Types.Tweens.Event} event - The Event to be dispatched. + * @param {Phaser.Types.Tweens.TweenCallbackTypes} [callback] - The name of the callback to be invoked. Can be `null` or `undefined` to skip invocation. + */ + dispatchEvent: function (event, callback) + { + var tween = this.tween; + + if (!tween.isSeeking) + { + var target = tween.targets[this.targetIndex]; + var key = this.key; + + var current = this.current; + var previous = this.previoius; + + tween.emit(event, tween, key, target, current, previous); + + var handler = tween.callbacks[callback]; + + if (handler) + { + handler.func.apply(handler.scope, [ tween, target, key, current, previous ].concat(handler.params)); + } + } + }, + + /** + * Internal method used as part of the playback process that checks if this + * TweenData should yoyo, repeat, or has completed. + * + * @method Phaser.Tweens.TweenData#setStateFromEnd + * @fires Phaser.Tweens.Events#TWEEN_REPEAT + * @fires Phaser.Tweens.Events#TWEEN_YOYO + * @since 3.60.0 + * + * @param {number} diff - Any extra time that needs to be accounted for in the elapsed and progress values. + */ + setStateFromEnd: function (diff) + { + if (this.yoyo) + { + this.onRepeat(diff, true, true); + } + else if (this.repeatCounter > 0) + { + this.onRepeat(diff, true); + } + else + { + this.setCompleteState(); + } + }, + + /** + * Internal method used as part of the playback process that checks if this + * TweenData should repeat or has completed. + * + * @method Phaser.Tweens.TweenData#setStateFromStart + * @fires Phaser.Tweens.Events#TWEEN_REPEAT + * @since 3.60.0 + * + * @param {number} diff - Any extra time that needs to be accounted for in the elapsed and progress values. + */ + setStateFromStart: function (diff) + { + if (this.repeatCounter > 0) + { + this.onRepeat(diff, false); + } + else + { + this.setCompleteState(); + } + }, + + /** + * Internal method that handles repeating or yoyo'ing this TweenData. + * + * Called automatically by `setStateFromStart` and `setStateFromEnd`. + * + * @method Phaser.Tweens.TweenData#onRepeat + * @fires Phaser.Tweens.Events#TWEEN_REPEAT + * @fires Phaser.Tweens.Events#TWEEN_YOYO + * @since 3.60.0 + * + * @param {number} diff - Any extra time that needs to be accounted for in the elapsed and progress values. + * @param {boolean} setStart - Set the TweenData start values? + * @param {boolean} [isYoyo=false] - Is this call a Yoyo check? + */ + onRepeat: function (diff, setStart, isYoyo) + { + if (isYoyo === undefined) { isYoyo = false; } + + var tween = this.tween; + var totalTargets = tween.totalTargets; + + var targetIndex = this.targetIndex; + var target = tween.targets[targetIndex]; + var key = this.key; + + // Account for any extra time we got from the previous frame + this.elapsed = diff; + this.progress = diff / this.duration; + + if (this.flipX) + { + target.toggleFlipX(); + } + + if (this.flipY) + { + target.toggleFlipY(); + } + + if (setStart || isYoyo) + { + this.start = this.getStartValue(target, key, this.start, targetIndex, totalTargets, tween); + } + + if (isYoyo) + { + this.setPlayingBackwardState(); + + this.dispatchEvent(Events.TWEEN_YOYO, 'onYoyo'); + + return; + } + + this.repeatCounter--; + + this.end = this.getEndValue(target, key, this.start, targetIndex, totalTargets, tween); + + // Delay? + if (this.repeatDelay > 0) + { + this.elapsed = this.repeatDelay - diff; + + this.current = this.start; + + target[key] = this.current; + + this.setRepeatState(); + } + else + { + this.setPlayingForwardState(); + + this.dispatchEvent(Events.TWEEN_REPEAT, 'onRepeat'); + } + }, + + /** + * Immediately destroys this TweenData, nulling of all its references. + * + * @method Phaser.Tweens.TweenData#destroy + * @since 3.60.0 + */ + destroy: function () + { + BaseTweenData.prototype.destroy.call(this); + + this.getActiveValue = null; + this.getEndValue = null; + this.getStartValue = null; + this.ease = null; + } + +}); module.exports = TweenData; +/***/ }), + +/***/ 96490: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BaseTweenData = __webpack_require__(65521); +var Class = __webpack_require__(56694); +var Events = __webpack_require__(54272); + +/** + * @classdesc + * The TweenFrameData is a class that contains a single target that will change the texture frame + * and the conclusion of the tween. + * + * TweenFrameData instances are typically created by the TweenBuilder automatically, when it + * detects the prescence of a 'texture' property as the key being tweened. + * + * A Tween can own multiple TweenFrameData instances, but a TweenFrameData only + * ever belongs to a single Tween. + * + * You should not typically create these yourself, but rather use the TweenBuilder, + * or the `Tween.addFrame` method. + * + * @class TweenFrameData + * @memberof Phaser.Tweens + * @extends Phaser.Tweens.BaseTweenData + * @constructor + * @since 3.60.0 + * + * @param {Phaser.Tweens.Tween} tween - The tween this TweenData instance belongs to. + * @param {number} targetIndex - The target index within the Tween targets array. + * @param {string} texture - The texture key to set at the end of this tween. + * @param {(string|number)} frame - The texture frame to set at the end of this tween. + * @param {function} delay - Function that returns the time in ms/frames before tween will start. + * @param {number} duration - The duration of the tween in ms/frames. + * @param {number} hold - Function that returns the time in ms/frames the tween will pause before repeating or returning to its starting value if yoyo is set to true. + * @param {number} repeat - Function that returns the number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. + * @param {number} repeatDelay - Function that returns the time in ms/frames before the repeat will start. + * @param {boolean} flipX - Should toggleFlipX be called when yoyo or repeat happens? + * @param {boolean} flipY - Should toggleFlipY be called when yoyo or repeat happens? + */ +var TweenFrameData = new Class({ + + Extends: BaseTweenData, + + initialize: + + function TweenFrameData (tween, targetIndex, texture, frame, delay, duration, hold, repeat, repeatDelay, flipX, flipY) + { + BaseTweenData.call(this, tween, targetIndex, delay, duration, false, hold, repeat, repeatDelay, flipX, flipY); + + /** + * The texture to be set at the start of the tween. + * + * @name Phaser.Tweens.TweenFrameData#startTexture + * @type {string} + * @since 3.60.0 + */ + this.startTexture = null; + + /** + * The texture to be set at the end of the tween. + * + * @name Phaser.Tweens.TweenFrameData#endTexture + * @type {string} + * @since 3.60.0 + */ + this.endTexture = texture; + + /** + * The frame to be set at the start of the tween. + * + * @name Phaser.Tweens.TweenFrameData#startFrame + * @type {(string|number)} + * @since 3.60.0 + */ + this.startFrame = null; + + /** + * The frame to be set at the end of the tween. + * + * @name Phaser.Tweens.TweenFrameData#endFrame + * @type {(string|number)} + * @since 3.60.0 + */ + this.endFrame = frame; + + /** + * Will the Tween ease back to its starting values, after reaching the end + * and any `hold` value that may be set? + * + * @name Phaser.Tweens.TweenFrameData#yoyo + * @type {boolean} + * @since 3.60.0 + */ + this.yoyo = (repeat > 0) ? true : false; + }, + + /** + * Prepares this TweenData for playback. + * + * Called automatically by the parent Tween. Should not be called directly. + * + * @method Phaser.Tweens.TweenFrameData#init + * @since 3.60.0 + * + * @param {boolean} [isSeek=false] - Is the parent Tween currently seeking? + */ + init: function (isSeek) + { + var tween = this.tween; + var totalTargets = tween.totalTargets; + + var targetIndex = this.targetIndex; + var target = tween.targets[targetIndex]; + + // Function signature: target, key, value, index, total, tween + + this.delay = this.getDelay(target, 'texture', 0, targetIndex, totalTargets, tween); + + this.repeatCounter = (this.repeat === -1) ? 999999999999 : this.repeat; + + this.setPendingRenderState(); + + // calcDuration: + + // Set t1 (duration + hold + yoyo) + var t1 = this.duration + this.hold; + + if (this.yoyo) + { + t1 += this.duration; + } + + // Set t2 (repeatDelay + duration + hold + yoyo) + var t2 = t1 + this.repeatDelay; + + // Total Duration + this.totalDuration = this.delay + t1; + + if (this.repeat === -1) + { + this.totalDuration += (t2 * 999999999999); + } + else if (this.repeat > 0) + { + this.totalDuration += (t2 * this.repeat); + } + + if (this.totalDuration > tween.duration) + { + // Set the longest duration in the parent Tween + tween.duration = this.totalDuration; + } + + if (this.delay < tween.startDelay) + { + tween.startDelay = this.delay; + } + + if (!this.startTexture) + { + this.startTexture = target.texture.key; + this.startFrame = target.frame.name; + } + + // seek specific: + if (isSeek) + { + this.progress = 0; + this.elapsed = 0; + + this.setPlayingForwardState(); + + this.update(0); + } + + if (this.delay > 0) + { + this.elapsed = this.delay; + + this.setDelayState(); + } + }, + + /** + * Internal method that advances this TweenData based on the delta value given. + * + * @method Phaser.Tweens.TweenFrameData#update + * @fires Phaser.Tweens.Events#TWEEN_UPDATE + * @fires Phaser.Tweens.Events#TWEEN_REPEAT + * @since 3.60.0 + * + * @param {number} delta - The elapsed delta time in ms. + * + * @return {boolean} `true` if this TweenData is still playing, or `false` if it has finished entirely. + */ + update: function (delta) + { + var tween = this.tween; + var targetIndex = this.targetIndex; + var target = tween.targets[targetIndex]; + + // Bail out if we don't have a target to act upon + if (!target) + { + this.setCompleteState(); + + return false; + } + + if (this.isCountdown) + { + this.elapsed -= delta; + + if (this.elapsed <= 0) + { + this.elapsed = 0; + + delta = 0; + + if (this.isDelayed()) + { + this.setPendingRenderState(); + } + else if (this.isRepeating()) + { + this.setPlayingForwardState(); + + this.dispatchEvent(Events.TWEEN_REPEAT, 'onRepeat'); + } + else if (this.isHolding()) + { + this.setStateFromEnd(0); + } + } + } + + // All of the above have the ability to change the state, so put this in its own check + + if (this.isPendingRender()) + { + if (this.startTexture) + { + target.setTexture(this.startTexture, this.startFrame); + } + + this.setPlayingForwardState(); + + return true; + } + + var forward = this.isPlayingForward(); + var backward = this.isPlayingBackward(); + + if (forward || backward) + { + var elapsed = this.elapsed; + var duration = this.duration; + var diff = 0; + var complete = false; + + elapsed += delta; + + if (elapsed >= duration) + { + diff = elapsed - duration; + elapsed = duration; + complete = true; + } + + var progress = elapsed / duration; + + this.elapsed = elapsed; + this.progress = progress; + + if (complete) + { + if (forward) + { + target.setTexture(this.endTexture, this.endFrame); + + if (this.hold > 0 && this.repeatCounter > 0) + { + this.elapsed = this.hold; + + this.setHoldState(); + } + else + { + this.setStateFromEnd(diff); + } + } + else + { + target.setTexture(this.startTexture, this.startFrame); + + this.setStateFromStart(diff); + } + } + + this.dispatchEvent(Events.TWEEN_UPDATE, 'onUpdate'); + } + + // Return TRUE if this TweenData still playing, otherwise FALSE + return !this.isComplete(); + }, + + /** + * Internal method that resets this Tween Data, including the progress and elapsed values. + * + * @method Phaser.Tweens.TweenFrameData#reset + * @since 3.60.0 + * + * @param {boolean} resetFromLoop - Has this method been called as part of a loop? + */ + reset: function (resetFromLoop) + { + this.progress = 0; + this.elapsed = 0; + + this.repeatCounter = (this.repeat === -1) ? 999999999999 : this.repeat; + + if (resetFromLoop) + { + this.setPlayingForwardState(); + } + else + { + this.setPendingRenderState(); + } + + if (this.delay > 0) + { + this.elapsed = this.delay; + + this.setDelayState(); + } + }, + + /** + * Internal method that will emit a TweenData based Event on the + * parent Tween and also invoke the given callback, if provided. + * + * @method Phaser.Tweens.TweenFrameData#dispatchEvent + * @since 3.60.0 + * + * @param {Phaser.Types.Tweens.Event} event - The Event to be dispatched. + * @param {Phaser.Types.Tweens.TweenCallbackTypes} [callback] - The name of the callback to be invoked. Can be `null` or `undefined` to skip invocation. + */ + dispatchEvent: function (event, callback) + { + var tween = this.tween; + + if (!tween.isSeeking) + { + var target = tween.targets[this.targetIndex]; + + tween.emit(event, tween, 'texture', target); + + var handler = tween.callbacks[callback]; + + if (handler) + { + handler.func.apply(handler.scope, [ tween, target, 'texture' ].concat(handler.params)); + } + } + }, + + /** + * Internal method used as part of the playback process that checks if this + * TweenData should yoyo, repeat, or has completed. + * + * @method Phaser.Tweens.TweenFrameData#setStateFromEnd + * @fires Phaser.Tweens.Events#TWEEN_REPEAT + * @fires Phaser.Tweens.Events#TWEEN_YOYO + * @since 3.60.0 + * + * @param {number} diff - Any extra time that needs to be accounted for in the elapsed and progress values. + */ + setStateFromEnd: function (diff) + { + if (this.repeatCounter > 0) + { + this.onRepeat(diff, true); + } + else + { + this.setCompleteState(); + } + }, + + /** + * Internal method used as part of the playback process that checks if this + * TweenData should repeat or has completed. + * + * @method Phaser.Tweens.TweenFrameData#setStateFromStart + * @fires Phaser.Tweens.Events#TWEEN_REPEAT + * @since 3.60.0 + * + * @param {number} diff - Any extra time that needs to be accounted for in the elapsed and progress values. + */ + setStateFromStart: function (diff) + { + if (this.repeatCounter > 0) + { + this.onRepeat(diff, false); + } + else + { + this.setCompleteState(); + } + }, + + /** + * Internal method that handles repeating or yoyo'ing this TweenData. + * + * Called automatically by `setStateFromStart` and `setStateFromEnd`. + * + * @method Phaser.Tweens.TweenFrameData#onRepeat + * @fires Phaser.Tweens.Events#TWEEN_REPEAT + * @fires Phaser.Tweens.Events#TWEEN_YOYO + * @since 3.60.0 + * + * @param {number} diff - Any extra time that needs to be accounted for in the elapsed and progress values. + * @param {boolean} [isYoyo=false] - Is this call a Yoyo check? + */ + onRepeat: function (diff, isYoyo) + { + if (isYoyo === undefined) { isYoyo = false; } + + var tween = this.tween; + + var targetIndex = this.targetIndex; + var target = tween.targets[targetIndex]; + + // Account for any extra time we got from the previous frame + this.elapsed = diff; + this.progress = diff / this.duration; + + if (this.flipX) + { + target.toggleFlipX(); + } + + if (this.flipY) + { + target.toggleFlipY(); + } + + if (isYoyo) + { + this.setPlayingBackwardState(); + + this.dispatchEvent(Events.TWEEN_YOYO, 'onYoyo'); + + return; + } + + this.repeatCounter--; + + // Delay? + if (this.repeatDelay > 0) + { + this.elapsed = this.repeatDelay - diff; + + this.setRepeatState(); + } + else + { + this.setPlayingForwardState(); + + this.dispatchEvent(Events.TWEEN_REPEAT, 'onRepeat'); + } + } + +}); + +module.exports = TweenFrameData; + + /***/ }), /***/ 55303: @@ -199087,98 +201928,108 @@ module.exports = TweenData; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +/** + * Phaser Tween States. + * + * @namespace Phaser.Tweens.States + * @memberof Phaser.Tweens + * @since 3.60.0 + */ + +/** + * Phaser Tween state constants. + * + * @typedef {Phaser.Tweens.States} Phaser.Tweens.StateType + * @memberof Phaser.Tweens + * @since 3.60.0 + */ + var TWEEN_CONST = { /** * TweenData state. - * - * @name Phaser.Tweens.CREATED + * + * @name Phaser.Tweens.States.CREATED * @type {number} + * @const * @since 3.0.0 */ CREATED: 0, - /** - * TweenData state. - * - * @name Phaser.Tweens.INIT - * @type {number} - * @since 3.0.0 - */ - INIT: 1, + // 1 used to be INIT prior to 3.60 /** * TweenData state. - * - * @name Phaser.Tweens.DELAY + * + * @name Phaser.Tweens.States.DELAY * @type {number} + * @const * @since 3.0.0 */ DELAY: 2, - /** - * TweenData state. - * - * @name Phaser.Tweens.OFFSET_DELAY - * @type {number} - * @since 3.0.0 - */ - OFFSET_DELAY: 3, + // 3 used to be OFFSET_DELAY prior to 3.60 /** * TweenData state. - * - * @name Phaser.Tweens.PENDING_RENDER + * + * @name Phaser.Tweens.States.PENDING_RENDER * @type {number} + * @const * @since 3.0.0 */ PENDING_RENDER: 4, /** * TweenData state. - * - * @name Phaser.Tweens.PLAYING_FORWARD + * + * @name Phaser.Tweens.States.PLAYING_FORWARD * @type {number} + * @const * @since 3.0.0 */ PLAYING_FORWARD: 5, /** * TweenData state. - * - * @name Phaser.Tweens.PLAYING_BACKWARD + * + * @name Phaser.Tweens.States.PLAYING_BACKWARD * @type {number} + * @const * @since 3.0.0 */ PLAYING_BACKWARD: 6, /** * TweenData state. - * - * @name Phaser.Tweens.HOLD_DELAY + * + * @name Phaser.Tweens.States.HOLD_DELAY * @type {number} + * @const * @since 3.0.0 */ HOLD_DELAY: 7, /** * TweenData state. - * - * @name Phaser.Tweens.REPEAT_DELAY + * + * @name Phaser.Tweens.States.REPEAT_DELAY * @type {number} + * @const * @since 3.0.0 */ REPEAT_DELAY: 8, /** * TweenData state. - * - * @name Phaser.Tweens.COMPLETE + * + * @name Phaser.Tweens.States.COMPLETE * @type {number} + * @const * @since 3.0.0 */ COMPLETE: 9, @@ -199186,67 +202037,97 @@ var TWEEN_CONST = { // Tween specific (starts from 20 to cleanly allow extra TweenData consts in the future) /** - * Tween state. - * - * @name Phaser.Tweens.PENDING_ADD + * Tween state. The Tween has been created but has not yet been added to the Tween Manager. + * + * @name Phaser.Tweens.States.PENDING * @type {number} + * @const * @since 3.0.0 */ - PENDING_ADD: 20, + PENDING: 20, /** - * Tween state. - * - * @name Phaser.Tweens.PAUSED + * Tween state. The Tween is active within the Tween Manager. This means it is either playing, + * or was playing and is currently paused, but in both cases it's still being processed by + * the Tween Manager, so is considered 'active'. + * + * @name Phaser.Tweens.States.ACTIVE * @type {number} + * @const * @since 3.0.0 */ - PAUSED: 21, + ACTIVE: 21, /** - * Tween state. - * - * @name Phaser.Tweens.LOOP_DELAY + * Tween state. The Tween is waiting for a loop countdown to elapse. + * + * @name Phaser.Tweens.States.LOOP_DELAY * @type {number} + * @const * @since 3.0.0 */ LOOP_DELAY: 22, /** - * Tween state. - * - * @name Phaser.Tweens.ACTIVE + * Tween state. The Tween is waiting for a complete delay to elapse. + * + * @name Phaser.Tweens.States.COMPLETE_DELAY * @type {number} + * @const * @since 3.0.0 */ - ACTIVE: 23, + COMPLETE_DELAY: 23, /** - * Tween state. - * - * @name Phaser.Tweens.COMPLETE_DELAY + * Tween state. The Tween is waiting for a starting delay to elapse. + * + * @name Phaser.Tweens.States.START_DELAY * @type {number} + * @const * @since 3.0.0 */ - COMPLETE_DELAY: 24, + START_DELAY: 24, /** - * Tween state. - * - * @name Phaser.Tweens.PENDING_REMOVE + * Tween state. The Tween has finished playback and is waiting to be removed from the Tween Manager. + * + * @name Phaser.Tweens.States.PENDING_REMOVE * @type {number} + * @const * @since 3.0.0 */ PENDING_REMOVE: 25, /** - * Tween state. - * - * @name Phaser.Tweens.REMOVED + * Tween state. The Tween has been removed from the Tween Manager. + * + * @name Phaser.Tweens.States.REMOVED * @type {number} + * @const * @since 3.0.0 */ - REMOVED: 26 + REMOVED: 26, + + /** + * Tween state. The Tween has finished playback but was flagged as 'persistent' during creation, + * so will not be automatically removed by the Tween Manager. + * + * @name Phaser.Tweens.States.FINISHED + * @type {number} + * @const + * @since 3.60.0 + */ + FINISHED: 27, + + /** + * Tween state. The Tween has been destroyed and can no longer be played by a Tween Manager. + * + * @name Phaser.Tweens.States.DESTROYED + * @type {number} + * @const + * @since 3.60.0 + */ + DESTROYED: 28 }; @@ -199260,7 +202141,7 @@ module.exports = TWEEN_CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -199517,7 +202398,7 @@ module.exports = Class; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -199545,7 +202426,7 @@ module.exports = NOOP; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -199663,22 +202544,22 @@ module.exports = Add; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Adds the given item, or array of items, to the array starting at the index specified. - * + * * Each item must be unique within the array. - * + * * Existing elements in the array are shifted up. - * + * * The array is modified in-place and returned. - * + * * You can optionally specify a limit to the maximum size of the array. If the quantity of items being * added will take the array length over this limit, it will stop adding once the limit is reached. - * + * * You can optionally specify a callback to be invoked for each item successfully added to the array. * * @function Phaser.Utils.Array.AddAt @@ -199786,7 +202667,7 @@ module.exports = AddAt; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -199825,7 +202706,7 @@ module.exports = BringToTop; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -199878,7 +202759,7 @@ module.exports = CountAllMatching; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -199925,7 +202806,7 @@ module.exports = Each; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -199982,7 +202863,7 @@ module.exports = EachInRange; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -200060,6 +202941,50 @@ var FindClosestInSorted = function (value, array, key) module.exports = FindClosestInSorted; +/***/ }), + +/***/ 5454: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Takes an array and flattens it, returning a shallow-copy flattened array. + * + * @function Phaser.Utils.Array.Flatten + * @since 3.60.0 + * + * @param {array} array - The array to flatten. + * @param {array} [output] - An array to hold the results in. + * + * @return {array} The flattened output array. + */ +var Flatten = function (array, output) +{ + if (output === undefined) { output = []; } + + for (var i = 0; i < array.length; i++) + { + if (Array.isArray(array[i])) + { + Flatten(array[i], output); + } + else + { + output.push(array[i]); + } + } + + return output; +}; + +module.exports = Flatten; + + /***/ }), /***/ 71608: @@ -200067,7 +202992,7 @@ module.exports = FindClosestInSorted; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -200130,7 +203055,7 @@ module.exports = GetAll; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -200190,7 +203115,7 @@ module.exports = GetFirst; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -200226,7 +203151,7 @@ module.exports = GetRandom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -200240,7 +203165,7 @@ module.exports = GetRandom; * @param {array} array - The input array. * @param {*} item1 - The element to move above base element. * @param {*} item2 - The base element. - * + * * * @return {array} The input array. */ @@ -200291,7 +203216,7 @@ module.exports = MoveAbove; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -200305,7 +203230,7 @@ module.exports = MoveAbove; * @param {array} array - The input array. * @param {*} item1 - The element to move below base element. * @param {*} item2 - The base element. - * + * * * @return {array} The input array. */ @@ -200356,7 +203281,7 @@ module.exports = MoveBelow; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -200399,7 +203324,7 @@ module.exports = MoveDown; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -200447,7 +203372,7 @@ module.exports = MoveTo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -200490,7 +203415,7 @@ module.exports = MoveUp; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -200584,7 +203509,7 @@ module.exports = NumberArray; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -200598,7 +203523,7 @@ var RoundAwayFromZero = __webpack_require__(67233); * * Certain values for `start` and `end` (eg. NaN/undefined/null) are currently coerced to 0; * for forward compatibility make sure to pass in actual numbers. - * + * * @example * NumberArrayStep(4); * // => [0, 1, 2, 3] @@ -200662,7 +203587,7 @@ module.exports = NumberArrayStep; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -200785,7 +203710,7 @@ module.exports = QuickSelect; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -200815,29 +203740,29 @@ var BuildChunk = function (a, b, qty) * * Range ([a,b,c], [1,2,3]) = * a1, a2, a3, b1, b2, b3, c1, c2, c3 - * + * * Range ([a,b], [1,2,3], qty = 3) = * a1, a1, a1, a2, a2, a2, a3, a3, a3, b1, b1, b1, b2, b2, b2, b3, b3, b3 - * + * * Range ([a,b,c], [1,2,3], repeat x1) = * a1, a2, a3, b1, b2, b3, c1, c2, c3, a1, a2, a3, b1, b2, b3, c1, c2, c3 - * + * * Range ([a,b], [1,2], repeat -1 = endless, max = 14) = * Maybe if max is set then repeat goes to -1 automatically? * a1, a2, b1, b2, a1, a2, b1, b2, a1, a2, b1, b2, a1, a2 (capped at 14 elements) - * + * * Range ([a], [1,2,3,4,5], random = true) = * a4, a1, a5, a2, a3 - * + * * Range ([a, b], [1,2,3], random = true) = * b3, a2, a1, b1, a3, b2 - * + * * Range ([a, b, c], [1,2,3], randomB = true) = * a3, a1, a2, b2, b3, b1, c1, c3, c2 - * + * * Range ([a], [1,2,3,4,5], yoyo = true) = * a1, a2, a3, a4, a5, a5, a4, a3, a2, a1 - * + * * Range ([a, b], [1,2,3], yoyo = true) = * a1, a2, a3, b1, b2, b3, b3, b2, b1, a3, a2, a1 * @@ -200924,7 +203849,7 @@ module.exports = Range; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -201014,7 +203939,7 @@ module.exports = Remove; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -201022,9 +203947,9 @@ var SpliceOne = __webpack_require__(72677); /** * Removes the item from the given position in the array. - * + * * The array is modified in-place. - * + * * You can optionally specify a callback to be invoked for the item if it is successfully removed from the array. * * @function Phaser.Utils.Array.RemoveAt @@ -201066,7 +203991,7 @@ module.exports = RemoveAt; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -201074,9 +203999,9 @@ var SafeRange = __webpack_require__(45838); /** * Removes the item within the given range in the array. - * + * * The array is modified in-place. - * + * * You can optionally specify a callback to be invoked for the item/s successfully removed from the array. * * @function Phaser.Utils.Array.RemoveBetween @@ -201130,7 +204055,7 @@ module.exports = RemoveBetween; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -201169,7 +204094,7 @@ module.exports = RemoveRandomElement; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -201214,7 +204139,7 @@ module.exports = Replace; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -201255,7 +204180,7 @@ module.exports = RotateLeft; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -201296,13 +204221,13 @@ module.exports = RotateRight; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Tests if the start and end indexes are a safe range for the given array. - * + * * @function Phaser.Utils.Array.SafeRange * @since 3.4.0 * @@ -201320,8 +204245,7 @@ var SafeRange = function (array, startIndex, endIndex, throwError) if (startIndex < 0 || startIndex > len || startIndex >= endIndex || - endIndex > len || - startIndex + endIndex > len) + endIndex > len) { if (throwError) { @@ -201346,7 +204270,7 @@ module.exports = SafeRange; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -201385,7 +204309,7 @@ module.exports = SendToBack; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -201441,7 +204365,7 @@ module.exports = SetAll; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -201483,7 +204407,7 @@ module.exports = Shuffle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -201522,7 +204446,7 @@ module.exports = SortByDigits; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -201570,7 +204494,7 @@ module.exports = SpliceOne; /** * @author Richard Davey * @author Angry Bytes (and contributors) - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -201746,7 +204670,7 @@ module.exports = StableSort; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -201795,7 +204719,7 @@ module.exports = Swap; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -201814,6 +204738,7 @@ module.exports = { Each: __webpack_require__(36337), EachInRange: __webpack_require__(46208), FindClosestInSorted: __webpack_require__(2406), + Flatten: __webpack_require__(5454), GetAll: __webpack_require__(71608), GetFirst: __webpack_require__(51463), GetRandom: __webpack_require__(72861), @@ -201852,7 +204777,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -201915,7 +204840,7 @@ module.exports = CheckMatrix; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -202011,7 +204936,7 @@ module.exports = MatrixToString; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -202057,7 +204982,7 @@ module.exports = ReverseColumns; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -202108,7 +205033,7 @@ module.exports = ReverseRows; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -202156,7 +205081,7 @@ module.exports = Rotate180; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -202204,7 +205129,7 @@ module.exports = RotateLeft; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -202291,7 +205216,7 @@ module.exports = RotateMatrix; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -202339,7 +205264,7 @@ module.exports = RotateRight; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -202429,7 +205354,7 @@ module.exports = TranslateMatrix; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -202492,7 +205417,7 @@ module.exports = TransposeMatrix; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -202524,7 +205449,7 @@ module.exports = { /** * @author Niklas von Hertzen (https://github.com/niklasvh/base64-arraybuffer) * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -202532,17 +205457,17 @@ var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; /** * Converts an ArrayBuffer into a base64 string. - * + * * The resulting string can optionally be a data uri if the `mediaType` argument is provided. - * + * * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs for more details. * * @function Phaser.Utils.Base64.ArrayBufferToBase64 * @since 3.18.0 - * + * * @param {ArrayBuffer} arrayBuffer - The Array Buffer to encode. * @param {string} [mediaType] - An optional media type, i.e. `audio/ogg` or `image/jpeg`. If included the resulting string will be a data URI. - * + * * @return {string} The base64 encoded Array Buffer. */ var ArrayBufferToBase64 = function (arrayBuffer, mediaType) @@ -202568,7 +205493,7 @@ var ArrayBufferToBase64 = function (arrayBuffer, mediaType) { base64 = base64.substring(0, base64.length - 2) + '=='; } - + return base64; }; @@ -202583,7 +205508,7 @@ module.exports = ArrayBufferToBase64; /** * @author Niklas von Hertzen (https://github.com/niklasvh/base64-arraybuffer) * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -202602,9 +205527,9 @@ for (var i = 0; i < chars.length; i++) * * @function Phaser.Utils.Base64.Base64ToArrayBuffer * @since 3.18.0 - * + * * @param {string} base64 - The base64 string to be decoded. Can optionally contain a data URI header, which will be stripped out prior to decoding. - * + * * @return {ArrayBuffer} An ArrayBuffer decoded from the base64 data. */ var Base64ToArrayBuffer = function (base64) @@ -202658,7 +205583,7 @@ module.exports = Base64ToArrayBuffer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -202681,7 +205606,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -202707,7 +205632,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -202750,7 +205675,7 @@ module.exports = Clone; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -202800,7 +205725,7 @@ module.exports = DeepCopy; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -202902,7 +205827,7 @@ module.exports = Extend; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -202913,7 +205838,7 @@ var GetValue = __webpack_require__(10850); * Retrieves a value from an object. Allows for more advanced selection options, including: * * Allowed types: - * + * * Implicit * { * x: 4 @@ -202938,7 +205863,7 @@ var GetValue = __webpack_require__(10850); * { * x: { randFloat: [min, max] } * } - * + * * * @function Phaser.Utils.Objects.GetAdvancedValue * @since 3.0.0 @@ -202990,7 +205915,7 @@ module.exports = GetAdvancedValue; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -203034,7 +205959,7 @@ module.exports = GetFastValue; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -203074,61 +205999,108 @@ module.exports = GetMinMaxValue; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -// Source object -// The key as a string, or an array of keys, i.e. 'banner', or 'banner.hideBanner' -// The default value to use if the key doesn't exist - /** - * Retrieves a value from an object. + * Retrieves a value from an object, or an alternative object, falling to a back-up default value if not found. + * + * The key is a string, which can be split based on the use of the period character. + * + * For example: + * + * ```javascript + * const source = { + * lives: 3, + * render: { + * screen: { + * width: 1024 + * } + * } + * } + * + * const lives = GetValue(source, 'lives', 1); + * const width = GetValue(source, 'render.screen.width', 800); + * const height = GetValue(source, 'render.screen.height', 600); + * ``` + * + * In the code above, `lives` will be 3 because it's defined at the top level of `source`. + * The `width` value will be 1024 because it can be found inside the `render.screen` object. + * The `height` value will be 600, the default value, because it is missing from the `render.screen` object. * * @function Phaser.Utils.Objects.GetValue * @since 3.0.0 * - * @param {object} source - The object to retrieve the value from. + * @param {object} source - The primary object to try to retrieve the value from. If not found in here, `altSource` is checked. * @param {string} key - The name of the property to retrieve from the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`) - `banner.hideBanner` would return the value of the `hideBanner` property from the object stored in the `banner` property of the `source` object. * @param {*} defaultValue - The value to return if the `key` isn't found in the `source` object. + * @param {object} [altSource] - An alternative object to retrieve the value from. If the property exists in `source` then `altSource` will not be used. * * @return {*} The value of the requested key. */ -var GetValue = function (source, key, defaultValue) +var GetValue = function (source, key, defaultValue, altSource) { - if (!source || typeof source === 'number') + if ((!source && !altSource) || typeof source === 'number') { return defaultValue; } - else if (source.hasOwnProperty(key)) + else if (source && source.hasOwnProperty(key)) { return source[key]; } + else if (altSource && altSource.hasOwnProperty(key)) + { + return altSource[key]; + } else if (key.indexOf('.') !== -1) { var keys = key.split('.'); - var parent = source; - var value = defaultValue; + var parentA = source; + var parentB = altSource; + var valueA = defaultValue; + var valueB = defaultValue; + var valueAFound = true; + var valueBFound = true; // Use for loop here so we can break early for (var i = 0; i < keys.length; i++) { - if (parent.hasOwnProperty(keys[i])) + if (parentA && parentA.hasOwnProperty(keys[i])) { - // Yes it has a key property, let's carry on down - value = parent[keys[i]]; - - parent = parent[keys[i]]; + // Yes parentA has a key property, let's carry on down + valueA = parentA[keys[i]]; + parentA = parentA[keys[i]]; } else { - // Can't go any further, so reset to default - value = defaultValue; - break; + valueAFound = false; + } + + if (parentB && parentB.hasOwnProperty(keys[i])) + { + // Yes parentB has a key property, let's carry on down + valueB = parentB[keys[i]]; + parentB = parentB[keys[i]]; + } + else + { + valueBFound = false; } } - return value; + if (valueAFound) + { + return valueA; + } + else if (valueBFound) + { + return valueB; + } + else + { + return defaultValue; + } } else { @@ -203146,7 +206118,7 @@ module.exports = GetValue; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -203184,7 +206156,7 @@ module.exports = HasAll; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -203222,7 +206194,7 @@ module.exports = HasAny; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -203252,7 +206224,7 @@ module.exports = HasValue; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -203309,7 +206281,7 @@ module.exports = IsPlainObject; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -203318,7 +206290,7 @@ var Clone = __webpack_require__(32742); /** * Creates a new Object using all values from obj1 and obj2. * If a value exists in both obj1 and obj2, the value in obj1 is used. - * + * * This is only a shallow copy. Deeply nested objects are not cloned, so be sure to only use this * function on shallow objects. * @@ -203355,7 +206327,7 @@ module.exports = Merge; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -203363,7 +206335,7 @@ var Clone = __webpack_require__(32742); /** * Creates a new Object using all values from obj1. - * + * * Then scans obj2. If a property is found in obj2 that *also* exists in obj1, the value from obj2 is used, otherwise the property is skipped. * * @function Phaser.Utils.Objects.MergeRight @@ -203399,7 +206371,7 @@ module.exports = MergeRight; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -203444,15 +206416,15 @@ module.exports = Pick; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Sets a value in an object, allowing for dot notation to control the depth of the property. - * + * * For example: - * + * * ```javascript * var data = { * world: { @@ -203462,9 +206434,9 @@ module.exports = Pick; * } * } * }; - * + * * SetValue(data, 'world.position.y', 300); - * + * * console.log(data.world.position.y); // 300 * ``` * @@ -203514,7 +206486,7 @@ var SetValue = function (source, key, value) return true; } - + return false; }; @@ -203528,7 +206500,7 @@ module.exports = SetValue; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -203564,7 +206536,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -203600,7 +206572,7 @@ module.exports = Format; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -203613,13 +206585,13 @@ module.exports = Format; * This would return: `bob---` as it has padded it out to 6 characters, using the `-` on the right. * * You can also use it to pad numbers (they are always returned as strings): - * + * * `pad(512, 6, '0', 1)` * * Would return: `000512` with the string padded to the left. * * If you don't specify a direction it'll pad to both sides: - * + * * `pad('c64', 7, '*')` * * Would return: `**c64**` @@ -203631,7 +206603,7 @@ module.exports = Format; * @param {number} [len=0] - The number of characters to be added. * @param {string} [pad=" "] - The string to pad it out with (defaults to a space). * @param {number} [dir=3] - The direction dir = 1 (left), 2 (right), 3 (both). - * + * * @return {string} The padded string. */ var Pad = function (str, len, pad, dir) @@ -203677,7 +206649,7 @@ module.exports = Pad; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -203714,7 +206686,7 @@ module.exports = RemoveAt; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -203744,13 +206716,13 @@ module.exports = Reverse; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Creates and returns an RFC4122 version 4 compliant UUID. - * + * * The string is in the form: `xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx` where each `x` is replaced with a random * hexadecimal digit from 0 to f, and `y` is replaced with a random hexadecimal digit from 8 to b. * @@ -203780,7 +206752,7 @@ module.exports = UUID; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -203818,7 +206790,7 @@ module.exports = UppercaseFirst; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ diff --git a/dist/phaser-arcade-physics.min.js b/dist/phaser-arcade-physics.min.js index 22eff8fc0..957e06093 100644 --- a/dist/phaser-arcade-physics.min.js +++ b/dist/phaser-arcade-physics.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Phaser",[],e):"object"==typeof exports?exports.Phaser=e():t.Phaser=e()}(this,(function(){return(()=>{var t={6659:t=>{"use strict";var e=Object.prototype.hasOwnProperty,i="~";function s(){}function r(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function n(t,e,s,n,a){if("function"!=typeof s)throw new TypeError("The listener must be a function");var o=new r(s,n||t,a),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],o]:t._events[h].push(o):(t._events[h]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new s:delete t._events[e]}function o(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,s,r=[];if(0===this._eventsCount)return r;for(s in t=this._events)e.call(t,s)&&r.push(i?s.slice(1):s);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},o.prototype.listeners=function(t){var e=i?i+t:t,s=this._events[e];if(!s)return[];if(s.fn)return[s.fn];for(var r=0,n=s.length,a=new Array(n);r{var s=i(82590);t.exports=function(t,e,i,r){for(var n=t[0],a=1;a{var s=i(6124);t.exports=function(t,e,i,r,n){return s(t,"angle",e,i,r,n)}},22015:t=>{t.exports=function(t,e,i){for(var s=0;s{t.exports=function(t,e,i){void 0===i&&(i=0);for(var s=i;s{t.exports=function(t,e,i){void 0===i&&(i=0);for(var s=i;s{var s=i(40327),r=i(84093),n=i(72632),a=i(72283),o=new(i(71030))({sys:{queueDepthSort:a,events:{once:a}}},0,0,1,1);t.exports=function(t,e){void 0===e&&(e={});var i=e.hasOwnProperty("width"),a=e.hasOwnProperty("height"),h=n(e,"width",-1),l=n(e,"height",-1),u=n(e,"cellWidth",1),c=n(e,"cellHeight",u),d=n(e,"position",r.TOP_LEFT),f=n(e,"x",0),p=n(e,"y",0),v=0,g=0,m=h*u,y=l*c;o.setPosition(f,p),o.setSize(u,c);for(var x=0;x{var s=i(6124);t.exports=function(t,e,i,r,n){return s(t,"alpha",e,i,r,n)}},3877:(t,e,i)=>{var s=i(6124);t.exports=function(t,e,i,r,n){return s(t,"x",e,i,r,n)}},71020:(t,e,i)=>{var s=i(6124);t.exports=function(t,e,i,r,n,a,o){return null==i&&(i=e),s(t,"x",e,r,a,o),s(t,"y",i,n,a,o)}},28970:(t,e,i)=>{var s=i(6124);t.exports=function(t,e,i,r,n){return s(t,"y",e,i,r,n)}},82249:t=>{t.exports=function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=6.28);for(var r=i,n=(s-i)/t.length,a=0;a{t.exports=function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=6.28);for(var r=i,n=(s-i)/t.length,a=e.width/2,o=e.height/2,h=0;h{var s=i(8570);t.exports=function(t,e){for(var i=s(e,t.length),r=0;r{var s=i(40053),r=i(77640),n=i(38487);t.exports=function(t,e,i){void 0===i&&(i=0);var a=s(e,!1,t.length);i>0?r(a,i):i<0&&n(a,Math.abs(i));for(var o=0;o{var s=i(58813);t.exports=function(t,e,i){var r=s({x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2},i),n=s({x1:e.x2,y1:e.y2,x2:e.x3,y2:e.y3},i),a=s({x1:e.x3,y1:e.y3,x2:e.x1,y2:e.y1},i);r.pop(),n.pop(),a.pop();for(var o=(r=r.concat(n,a)).length/t.length,h=0,l=0;l{t.exports=function(t,e,i){for(var s=0;s{t.exports=function(t,e,i,s,r,n){var a;void 0===s&&(s=0),void 0===r&&(r=0),void 0===n&&(n=1);var o=0,h=t.length;if(1===n)for(a=r;a=0;a--)t[a][e]+=i+o*s,o++;return t}},23646:t=>{t.exports=function(t,e,i,s,r,n){var a;void 0===s&&(s=0),void 0===r&&(r=0),void 0===n&&(n=1);var o=0,h=t.length;if(1===n)for(a=r;a=0;a--)t[a][e]=i+o*s,o++;return t}},4392:(t,e,i)=>{var s=i(30977);t.exports=function(t,e){for(var i=0;i{var s=i(72006);t.exports=function(t,e){for(var i=0;i{var s=i(74077);t.exports=function(t,e){for(var i=0;i{var s=i(30001);t.exports=function(t,e){for(var i=0;i{var s=i(99761);t.exports=function(t,e){for(var i=0;i{var s=i(6124);t.exports=function(t,e,i,r,n){return s(t,"rotation",e,i,r,n)}},87299:(t,e,i)=>{var s=i(72395),r=i(53996);t.exports=function(t,e,i){for(var n=e.x,a=e.y,o=0;o{var s=i(72395);t.exports=function(t,e,i,r){var n=e.x,a=e.y;if(0===r)return t;for(var o=0;o{var s=i(6124);t.exports=function(t,e,i,r,n){return s(t,"scaleX",e,i,r,n)}},51449:(t,e,i)=>{var s=i(6124);t.exports=function(t,e,i,r,n,a,o){return null==i&&(i=e),s(t,"scaleX",e,r,a,o),s(t,"scaleY",i,n,a,o)}},64895:(t,e,i)=>{var s=i(6124);t.exports=function(t,e,i,r,n){return s(t,"scaleY",e,i,r,n)}},30329:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,r,n){return s(t,"alpha",e,i,r,n)}},43954:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,r){return s(t,"blendMode",e,0,i,r)}},70688:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,r,n){return s(t,"depth",e,i,r,n)}},8314:t=>{t.exports=function(t,e,i){for(var s=0;s{var s=i(23646);t.exports=function(t,e,i,r,n,a,o){return null==i&&(i=e),s(t,"originX",e,r,a,o),s(t,"originY",i,n,a,o),t.forEach((function(t){t.updateDisplayOrigin()})),t}},38767:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,r,n){return s(t,"rotation",e,i,r,n)}},18584:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,r,n,a,o){return null==i&&(i=e),s(t,"scaleX",e,r,a,o),s(t,"scaleY",i,n,a,o)}},17381:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,r,n){return s(t,"scaleX",e,i,r,n)}},74370:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,r,n){return s(t,"scaleY",e,i,r,n)}},27773:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,r,n,a,o){return null==i&&(i=e),s(t,"scrollFactorX",e,r,a,o),s(t,"scrollFactorY",i,n,a,o)}},75257:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,r,n){return s(t,"scrollFactorX",e,i,r,n)}},54512:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,r,n){return s(t,"scrollFactorY",e,i,r,n)}},69423:t=>{t.exports=function(t,e,i,s,r){for(var n=0;n{var s=i(23646);t.exports=function(t,e,i,r){return s(t,"visible",e,0,i,r)}},94833:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,r,n){return s(t,"x",e,i,r,n)}},14284:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,r,n,a,o){return null==i&&(i=e),s(t,"x",e,r,a,o),s(t,"y",i,n,a,o)}},96574:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,r,n){return s(t,"y",e,i,r,n)}},74086:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,r,n){var a,o,h,l,u,c;if(void 0===r&&(r=0),void 0===n&&(n=new s),t.length>1)if(0===r){var d=t.length-1;for(a=t[d].x,o=t[d].y,h=d-1;h>=0;h--)l=(c=t[h]).x,u=c.y,c.x=a,c.y=o,a=l,o=u;t[d].x=e,t[d].y=i}else{for(a=t[0].x,o=t[0].y,h=1;h{var s=i(18592);t.exports=function(t){return s(t)}},1558:(t,e,i)=>{var s=i(5514);t.exports=function(t,e,i,r,n){void 0===n&&(n=!1);var a,o=Math.abs(r-i)/t.length;if(n)for(a=0;a{var s=i(87736);t.exports=function(t,e,i,r,n){void 0===n&&(n=!1);var a,o=Math.abs(r-i)/t.length;if(n)for(a=0;a{t.exports=function(t,e,i,s,r){void 0===r&&(r=!1);var n,a=Math.abs(s-i)/t.length;if(r)for(n=0;n{t.exports=function(t){for(var e=0;e{var s=i(1071);t.exports=function(t,e,i){void 0===i&&(i=0);for(var r=0;r{t.exports={AlignTo:i(62270),Angle:i(61148),Call:i(22015),GetFirst:i(31060),GetLast:i(52367),GridAlign:i(12673),IncAlpha:i(691),IncX:i(3877),IncXY:i(71020),IncY:i(28970),PlaceOnCircle:i(82249),PlaceOnEllipse:i(30285),PlaceOnLine:i(61557),PlaceOnRectangle:i(63549),PlaceOnTriangle:i(51629),PlayAnimation:i(1045),PropertyValueInc:i(6124),PropertyValueSet:i(23646),RandomCircle:i(4392),RandomEllipse:i(94985),RandomLine:i(63305),RandomRectangle:i(90739),RandomTriangle:i(91417),Rotate:i(26182),RotateAround:i(87299),RotateAroundDistance:i(92194),ScaleX:i(30363),ScaleXY:i(51449),ScaleY:i(64895),SetAlpha:i(30329),SetBlendMode:i(43954),SetDepth:i(70688),SetHitArea:i(8314),SetOrigin:i(12894),SetRotation:i(38767),SetScale:i(18584),SetScaleX:i(17381),SetScaleY:i(74370),SetScrollFactor:i(27773),SetScrollFactorX:i(75257),SetScrollFactorY:i(54512),SetTint:i(69423),SetVisible:i(58291),SetX:i(94833),SetXY:i(14284),SetY:i(96574),ShiftPosition:i(74086),Shuffle:i(86347),SmootherStep:i(9938),SmoothStep:i(1558),Spread:i(71060),ToggleVisible:i(11207),WrapInRectangle:i(24404)}},85463:(t,e,i)=>{var s=i(82897),r=i(56694),n=i(16938),a=i(2406),o=i(71519),h=i(10850),l=i(28834),u=new r({initialize:function(t,e,i){this.manager=t,this.key=e,this.type="frame",this.frames=this.getFrames(t.textureManager,h(i,"frames",[]),h(i,"defaultTextureKey",null),h(i,"sortFrames",!0)),this.frameRate=h(i,"frameRate",null),this.duration=h(i,"duration",null),this.msPerFrame,this.skipMissedFrames=h(i,"skipMissedFrames",!0),this.delay=h(i,"delay",0),this.repeat=h(i,"repeat",0),this.repeatDelay=h(i,"repeatDelay",0),this.yoyo=h(i,"yoyo",!1),this.showOnStart=h(i,"showOnStart",!1),this.hideOnComplete=h(i,"hideOnComplete",!1),this.paused=!1,this.calculateDuration(this,this.getTotalFrames(),this.duration,this.frameRate),this.manager.on&&(this.manager.on(n.PAUSE_ALL,this.pause,this),this.manager.on(n.RESUME_ALL,this.resume,this))},getTotalFrames:function(){return this.frames.length},calculateDuration:function(t,e,i,s){null===i&&null===s?(t.frameRate=24,t.duration=24/e*1e3):i&&null===s?(t.duration=i,t.frameRate=e/(i/1e3)):(t.frameRate=s,t.duration=e/s*1e3),t.msPerFrame=1e3/t.frameRate},addFrame:function(t){return this.addFrameAt(this.frames.length,t)},addFrameAt:function(t,e){var i=this.getFrames(this.manager.textureManager,e);if(i.length>0){if(0===t)this.frames=i.concat(this.frames);else if(t===this.frames.length)this.frames=this.frames.concat(i);else{var s=this.frames.slice(0,t),r=this.frames.slice(t);this.frames=s.concat(i,r)}this.updateFrameSequence()}return this},checkFrame:function(t){return t>=0&&t0){n.isLast=!0,n.nextFrame=c[0],c[0].prevFrame=n;var y=1/(c.length-1);for(a=0;a0?t.inReverse&&t.forward?t.forward=!1:this.repeatAnimation(t):t.complete():this.updateAndGetNextTick(t,e.nextFrame)},handleYoyoFrame:function(t,e){if(e||(e=!1),t.inReverse===!e&&t.repeatCounter>0)return(0===t.repeatDelay||t.pendingRepeat)&&(t.forward=e),void this.repeatAnimation(t);if(t.inReverse===e||0!==t.repeatCounter){t.forward=e;var i=e?t.currentFrame.nextFrame:t.currentFrame.prevFrame;this.updateAndGetNextTick(t,i)}else t.complete()},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t.yoyo?this.handleYoyoFrame(t,!0):t.repeatCounter>0?(t.inReverse&&!t.forward||(t.forward=!0),this.repeatAnimation(t)):t.complete():this.updateAndGetNextTick(t,e.prevFrame)},updateAndGetNextTick:function(t,e){t.setCurrentFrame(e),this.getNextTick(t)},removeFrame:function(t){var e=this.frames.indexOf(t);return-1!==e&&this.removeFrameAt(e),this},removeFrameAt:function(t){return this.frames.splice(t,1),this.updateFrameSequence(),this},repeatAnimation:function(t){if(2===t._pendingStop){if(0===t._pendingStopValue)return t.stop();t._pendingStopValue--}t.repeatDelay>0&&!t.pendingRepeat?(t.pendingRepeat=!0,t.accumulator-=t.nextTick,t.nextTick+=t.repeatDelay):(t.repeatCounter--,t.forward?t.setCurrentFrame(t.currentFrame.nextFrame):t.setCurrentFrame(t.currentFrame.prevFrame),t.isPlaying&&(this.getNextTick(t),t.handleRepeat()))},toJSON:function(){var t={key:this.key,type:this.type,frames:[],frameRate:this.frameRate,duration:this.duration,skipMissedFrames:this.skipMissedFrames,delay:this.delay,repeat:this.repeat,repeatDelay:this.repeatDelay,yoyo:this.yoyo,showOnStart:this.showOnStart,hideOnComplete:this.hideOnComplete};return this.frames.forEach((function(e){t.frames.push(e.toJSON())})),t},updateFrameSequence:function(){for(var t,e=this.frames.length,i=1/(e-1),s=0;s1?(t.isLast=!0,t.prevFrame=this.frames[e-2],t.nextFrame=this.frames[0]):e>1&&(t.prevFrame=this.frames[s-1],t.nextFrame=this.frames[s+1]);return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.manager.off&&(this.manager.off(n.PAUSE_ALL,this.pause,this),this.manager.off(n.RESUME_ALL,this.resume,this)),this.manager.remove(this.key);for(var t=0;t{var s=new(i(56694))({initialize:function(t,e,i,s,r){void 0===r&&(r=!1),this.textureKey=t,this.textureFrame=e,this.index=i,this.frame=s,this.isFirst=!1,this.isLast=!1,this.prevFrame=null,this.nextFrame=null,this.duration=0,this.progress=0,this.isKeyFrame=r},toJSON:function(){return{key:this.textureKey,frame:this.textureFrame,duration:this.duration,keyframe:this.isKeyFrame}},destroy:function(){this.frame=void 0}});t.exports=s},90249:(t,e,i)=>{var s=i(85463),r=i(56694),n=i(33885),a=i(6659),o=i(16938),h=i(97081),l=i(72632),u=i(10850),c=i(76400),d=i(13401),f=new r({Extends:a,initialize:function(t){a.call(this),this.game=t,this.textureManager=null,this.globalTimeScale=1,this.anims=new n,this.mixes=new n,this.paused=!1,this.name="AnimationManager",t.events.once(h.BOOT,this.boot,this)},boot:function(){this.textureManager=this.game.textures,this.game.events.once(h.DESTROY,this.destroy,this)},addMix:function(t,e,i){var s=this.anims,r=this.mixes,n="string"==typeof t?t:t.key,a="string"==typeof e?e:e.key;if(s.has(n)&&s.has(a)){var o=r.get(n);o||(o={}),o[a]=i,r.set(n,o)}return this},removeMix:function(t,e){var i=this.mixes,s="string"==typeof t?t:t.key,r=i.get(s);if(r)if(e){var n="string"==typeof e?e:e.key;r.hasOwnProperty(n)&&delete r[n]}else e||i.delete(s);return this},getMix:function(t,e){var i=this.mixes,s="string"==typeof t?t:t.key,r="string"==typeof e?e:e.key,n=i.get(s);return n&&n.hasOwnProperty(r)?n[r]:0},add:function(t,e){return this.anims.has(t)?(console.warn("Animation key exists: "+t),this):(e.key=t,this.anims.set(t,e),this.emit(o.ADD_ANIMATION,t,e),this)},exists:function(t){return this.anims.has(t)},createFromAseprite:function(t,e){var i=[],s=this.game.cache.json.get(t);if(!s)return i;var r=this,n=u(s,"meta",null),a=u(s,"frames",null);n&&a&&u(n,"frameTags",[]).forEach((function(s){var n=[],o=l(s,"name",null),h=l(s,"from",0),u=l(s,"to",0),c=l(s,"direction","forward");if(o&&(!e||e&&e.indexOf(o)>-1)){for(var d=[],f=Number.MAX_SAFE_INTEGER,p=h;p<=u;p++){var v=p.toString(),g=a[v];if(g){var m=l(g,"duration",Number.MAX_SAFE_INTEGER);m{var s=i(56694),r=i(33885),n=i(72632),a=i(16938),o=i(85463),h=new s({initialize:function(t){this.parent=t,this.animationManager=t.scene.sys.anims,this.animationManager.on(a.REMOVE_ANIMATION,this.globalRemove,this),this.textureManager=this.animationManager.textureManager,this.anims=null,this.isPlaying=!1,this.hasStarted=!1,this.currentAnim=null,this.currentFrame=null,this.nextAnim=null,this.nextAnimsQueue=[],this.timeScale=1,this.frameRate=0,this.duration=0,this.msPerFrame=0,this.skipMissedFrames=!0,this.delay=0,this.repeat=0,this.repeatDelay=0,this.yoyo=!1,this.showOnStart=!1,this.hideOnComplete=!1,this.forward=!0,this.inReverse=!1,this.accumulator=0,this.nextTick=0,this.delayCounter=0,this.repeatCounter=0,this.pendingRepeat=!1,this._paused=!1,this._wasPlaying=!1,this._pendingStop=0,this._pendingStopValue},chain:function(t){var e=this.parent;if(void 0===t)return this.nextAnimsQueue.length=0,this.nextAnim=null,e;Array.isArray(t)||(t=[t]);for(var i=0;is.getTotalFrames()&&(h=0);var l=s.frames[h];0!==h||this.forward||(l=s.getLastFrame()),this.currentFrame=l}else console.warn("Missing animation: "+i);return this.parent},pause:function(t){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),void 0!==t&&this.setCurrentFrame(t),this.parent},resume:function(t){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),void 0!==t&&this.setCurrentFrame(t),this.parent},playAfterDelay:function(t,e){if(this.isPlaying){var i=this.nextAnim,s=this.nextAnimsQueue;i&&s.unshift(i),this.nextAnim=t,this._pendingStop=1,this._pendingStopValue=e}else this.delayCounter=e,this.play(t,!0);return this.parent},playAfterRepeat:function(t,e){if(void 0===e&&(e=1),this.isPlaying){var i=this.nextAnim,s=this.nextAnimsQueue;i&&s.unshift(i),-1!==this.repeatCounter&&e>this.repeatCounter&&(e=this.repeatCounter),this.nextAnim=t,this._pendingStop=2,this._pendingStopValue=e}else this.play(t);return this.parent},play:function(t,e){void 0===e&&(e=!1);var i=this.currentAnim,s=this.parent,r="string"==typeof t?t:t.key;if(e&&this.isPlaying&&i.key===r)return s;if(i&&this.isPlaying){var n=this.animationManager.getMix(i.key,t);if(n>0)return this.playAfterDelay(t,n)}return this.forward=!0,this.inReverse=!1,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t)},playReverse:function(t,e){void 0===e&&(e=!1);var i="string"==typeof t?t:t.key;return e&&this.isPlaying&&this.currentAnim.key===i?this.parent:(this.forward=!1,this.inReverse=!0,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t))},startAnimation:function(t){this.load(t);var e=this.currentAnim,i=this.parent;return e?(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat,e.getFirstTick(this),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!1,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.delayCounter+=this.delay,0===this.delayCounter&&this.handleStart(),i):i},handleStart:function(){this.showOnStart&&this.parent.setVisible(!0),this.setCurrentFrame(this.currentFrame),this.hasStarted=!0,this.emitEvents(a.ANIMATION_START)},handleRepeat:function(){this.pendingRepeat=!1,this.emitEvents(a.ANIMATION_REPEAT)},handleStop:function(){this._pendingStop=0,this.isPlaying=!1,this.emitEvents(a.ANIMATION_STOP)},handleComplete:function(){this._pendingStop=0,this.isPlaying=!1,this.hideOnComplete&&this.parent.setVisible(!1),this.emitEvents(a.ANIMATION_COMPLETE,a.ANIMATION_COMPLETE_KEY)},emitEvents:function(t,e){var i=this.currentAnim,s=this.currentFrame,r=this.parent,n=s.textureFrame;r.emit(t,i,s,r,n),e&&r.emit(e+i.key,i,s,r,n)},reverse:function(){return this.isPlaying&&(this.inReverse=!this.inReverse,this.forward=!this.forward),this.parent},getProgress:function(){var t=this.currentFrame;if(!t)return 0;var e=t.progress;return this.inReverse&&(e*=-1),e},setProgress:function(t){return this.forward||(t=1-t),this.setCurrentFrame(this.currentAnim.getFrameByProgress(t)),this.parent},setRepeat:function(t){return this.repeatCounter=-1===t?Number.MAX_VALUE:t,this.parent},globalRemove:function(t,e){void 0===e&&(e=this.currentAnim),this.isPlaying&&e.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},restart:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);var i=this.currentAnim,s=this.parent;return i?(e&&(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat),i.getFirstTick(this),this.emitEvents(a.ANIMATION_RESTART),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!t,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.setCurrentFrame(i.frames[0]),this.parent):s},complete:function(){if(this._pendingStop=0,this.isPlaying=!1,this.currentAnim&&this.handleComplete(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.length>0?this.nextAnimsQueue.shift():null,this.play(t)}return this.parent},stop:function(){if(this._pendingStop=0,this.isPlaying=!1,this.currentAnim&&this.handleStop(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.shift(),this.play(t)}return this.parent},stopAfterDelay:function(t){return this._pendingStop=1,this._pendingStopValue=t,this.parent},stopAfterRepeat:function(t){return void 0===t&&(t=1),-1!==this.repeatCounter&&t>this.repeatCounter&&(t=this.repeatCounter),this._pendingStop=2,this._pendingStopValue=t,this.parent},stopOnFrame:function(t){return this._pendingStop=3,this._pendingStopValue=t,this.parent},getTotalFrames:function(){return this.currentAnim?this.currentAnim.getTotalFrames():0},update:function(t,e){var i=this.currentAnim;if(this.isPlaying&&i&&!i.paused){if(this.accumulator+=e*this.timeScale,1===this._pendingStop&&(this._pendingStopValue-=e,this._pendingStopValue<=0))return this.stop();if(this.hasStarted){if(this.accumulator>=this.nextTick&&(this.forward?i.nextFrame(this):i.previousFrame(this),this.isPlaying&&0===this._pendingStop&&this.skipMissedFrames&&this.accumulator>this.nextTick)){var s=0;do{this.forward?i.nextFrame(this):i.previousFrame(this),s++}while(this.isPlaying&&this.accumulator>this.nextTick&&s<60)}}else this.accumulator>=this.delayCounter&&(this.accumulator-=this.delayCounter,this.handleStart())}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),t.setAlpha&&(e.alpha=t.alpha),e.setSizeToFrame(),e._originComponent&&(t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin()),this.isPlaying&&this.hasStarted&&(this.emitEvents(a.ANIMATION_UPDATE),3===this._pendingStop&&this._pendingStopValue===t&&this.stop()),e},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},get:function(t){return this.anims?this.anims.get(t):null},exists:function(t){return!!this.anims&&this.anims.has(t)},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))||(i=new o(this,e,t),this.anims||(this.anims=new r),this.anims.set(e,i))),i},generateFrameNames:function(t,e){return this.animationManager.generateFrameNames(t,e)},generateFrameNumbers:function(t,e){return this.animationManager.generateFrameNumbers(t,e)},remove:function(t){var e=this.get(t);return e&&(this.currentAnim===e&&this.stop(),this.anims.delete(t)),e},destroy:function(){this.animationManager.off(a.REMOVE_ANIMATION,this.globalRemove,this),this.anims&&this.anims.clear(),this.animationManager=null,this.parent=null,this.nextAnim=null,this.nextAnimsQueue.length=0,this.currentAnim=null,this.currentFrame=null},isPaused:{get:function(){return this._paused}}});t.exports=h},44509:t=>{t.exports="add"},84563:t=>{t.exports="animationcomplete"},61586:t=>{t.exports="animationcomplete-"},72175:t=>{t.exports="animationrepeat"},568:t=>{t.exports="animationrestart"},37690:t=>{t.exports="animationstart"},58525:t=>{t.exports="animationstop"},5243:t=>{t.exports="animationupdate"},10598:t=>{t.exports="pauseall"},4860:t=>{t.exports="remove"},31865:t=>{t.exports="resumeall"},16938:(t,e,i)=>{t.exports={ADD_ANIMATION:i(44509),ANIMATION_COMPLETE:i(84563),ANIMATION_COMPLETE_KEY:i(61586),ANIMATION_REPEAT:i(72175),ANIMATION_RESTART:i(568),ANIMATION_START:i(37690),ANIMATION_STOP:i(58525),ANIMATION_UPDATE:i(5243),PAUSE_ALL:i(10598),REMOVE_ANIMATION:i(4860),RESUME_ALL:i(31865)}},13517:(t,e,i)=>{t.exports={Animation:i(85463),AnimationFrame:i(71519),AnimationManager:i(90249),AnimationState:i(16569),Events:i(16938)}},23740:(t,e,i)=>{var s=i(56694),r=i(33885),n=i(6659),a=i(69773),o=new s({initialize:function(){this.entries=new r,this.events=new n},add:function(t,e){return this.entries.set(t,e),this.events.emit(a.ADD,this,t,e),this},has:function(t){return this.entries.has(t)},exists:function(t){return this.entries.has(t)},get:function(t){return this.entries.get(t)},remove:function(t){var e=this.get(t);return e&&(this.entries.delete(t),this.events.emit(a.REMOVE,this,t,e.data)),this},getKeys:function(){return this.entries.keys()},destroy:function(){this.entries.clear(),this.events.removeAllListeners(),this.entries=null,this.events=null}});t.exports=o},43474:(t,e,i)=>{var s=i(23740),r=i(56694),n=i(97081),a=new r({initialize:function(t){this.game=t,this.binary=new s,this.bitmapFont=new s,this.json=new s,this.physics=new s,this.shader=new s,this.audio=new s,this.video=new s,this.text=new s,this.html=new s,this.obj=new s,this.tilemap=new s,this.xml=new s,this.custom={},this.game.events.once(n.DESTROY,this.destroy,this)},addCustom:function(t){return this.custom.hasOwnProperty(t)||(this.custom[t]=new s),this.custom[t]},destroy:function(){for(var t=["binary","bitmapFont","json","physics","shader","audio","video","text","html","obj","tilemap","xml"],e=0;e{t.exports="add"},75968:t=>{t.exports="remove"},69773:(t,e,i)=>{t.exports={ADD:i(94762),REMOVE:i(75968)}},45820:(t,e,i)=>{t.exports={BaseCache:i(23740),CacheManager:i(43474),Events:i(69773)}},51052:(t,e,i)=>{var s=i(56694),r=i(64937),n=i(75606),a=i(6659),o=i(89787),h=i(74118),l=i(69360),u=i(93222),c=i(93736),d=new s({Extends:a,Mixins:[r.Alpha,r.Visible],initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),a.call(this),this.scene,this.sceneManager,this.scaleManager,this.cameraManager,this.id=0,this.name="",this.roundPixels=!1,this.useBounds=!1,this.worldView=new h,this.dirty=!0,this._x=t,this._y=e,this._width=i,this._height=s,this._bounds=new h,this._scrollX=0,this._scrollY=0,this._zoomX=1,this._zoomY=1,this._rotation=0,this.matrix=new l,this.transparent=!0,this.backgroundColor=u("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new c(i/2,s/2),this.originX=.5,this.originY=.5,this._customViewport=!1,this.mask=null,this._maskCamera=null,this.renderList=[]},addToRenderList:function(t){this.renderList.push(t)},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this},getScroll:function(t,e,i){void 0===i&&(i=new c);var s=.5*this.width,r=.5*this.height;return i.x=t-s,i.y=e-r,this.useBounds&&(i.x=this.clampX(i.x),i.y=this.clampY(i.y)),i},centerOnX:function(t){var e=.5*this.width;return this.midPoint.x=t,this.scrollX=t-e,this.useBounds&&(this.scrollX=this.clampX(this.scrollX)),this},centerOnY:function(t){var e=.5*this.height;return this.midPoint.y=t,this.scrollY=t-e,this.useBounds&&(this.scrollY=this.clampY(this.scrollY)),this},centerOn:function(t,e){return this.centerOnX(t),this.centerOnY(e),this},centerToBounds:function(){if(this.useBounds){var t=this._bounds,e=.5*this.width,i=.5*this.height;this.midPoint.set(t.centerX,t.centerY),this.scrollX=t.centerX-e,this.scrollY=t.centerY-i}return this},centerToSize:function(){return this.scrollX=.5*this.width,this.scrollY=.5*this.height,this},cull:function(t){if(this.disableCull)return t;var e=this.matrix.matrix,i=e[0],s=e[1],r=e[2],n=e[3],a=i*n-s*r;if(!a)return t;var o=e[4],h=e[5],l=this.scrollX,u=this.scrollY,c=this.width,d=this.height,f=this.y,p=f+d,v=this.x,g=v+c,m=this.culledObjects,y=t.length;a=1/a,m.length=0;for(var x=0;xv&&b*i+S*r+of&&b*s+S*n+hr&&(t=r),t},clampY:function(t){var e=this._bounds,i=this.displayHeight,s=e.y+(i-this.height)/2,r=Math.max(s,s+e.height-i);return tr&&(t=r),t},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(t){return void 0===t&&(t=0),this.rotation=n(t),this},setBackgroundColor:function(t){return void 0===t&&(t="rgba(0,0,0,0)"),this.backgroundColor=u(t),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(t,e,i,s,r){return void 0===r&&(r=!1),this._bounds.setTo(t,e,i,s),this.dirty=!0,this.useBounds=!0,r?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},getBounds:function(t){void 0===t&&(t=new h);var e=this._bounds;return t.setTo(e.x,e.y,e.width,e.height),t},setName:function(t){return void 0===t&&(t=""),this.name=t,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setRoundPixels:function(t){return this.roundPixels=t,this},setScene:function(t){this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=t;var e=t.sys;return this.sceneManager=e.game.scene,this.scaleManager=e.scale,this.cameraManager=e.cameras,this.updateSystem(),this},setScroll:function(t,e){return void 0===e&&(e=t),this.scrollX=t,this.scrollY=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},setViewport:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setZoom:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),0===t&&(t=.001),0===e&&(e=.001),this.zoomX=t,this.zoomY=e,this},setMask:function(t,e){return void 0===e&&(e=!0),this.mask=t,this._maskCamera=e?this.cameraManager.default:this,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},toJSON:function(){var t={name:this.name,x:this.x,y:this.y,width:this.width,height:this.height,zoom:this.zoom,rotation:this.rotation,roundPixels:this.roundPixels,scrollX:this.scrollX,scrollY:this.scrollY,backgroundColor:this.backgroundColor.rgba};return this.useBounds&&(t.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),t},update:function(){},updateSystem:function(){if(this.scaleManager){var t=0!==this._x||0!==this._y||this.scaleManager.width!==this._width||this.scaleManager.height!==this._height,e=this.sceneManager;t&&!this._customViewport?e.customViewports++:!t&&this._customViewport&&e.customViewports--,this.dirty=!0,this._customViewport=t}},destroy:function(){this.emit(o.DESTROY,this),this.removeAllListeners(),this.matrix.destroy(),this.culledObjects=[],this._customViewport&&this.sceneManager.customViewports--,this.renderList=[],this._bounds=null,this.scene=null,this.scaleManager=null,this.sceneManager=null,this.cameraManager=null},x:{get:function(){return this._x},set:function(t){this._x=t,this.updateSystem()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.updateSystem()}},width:{get:function(){return this._width},set:function(t){this._width=t,this.updateSystem()}},height:{get:function(){return this._height},set:function(t){this._height=t,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(t){this._scrollX=t,this.dirty=!0}},scrollY:{get:function(){return this._scrollY},set:function(t){this._scrollY=t,this.dirty=!0}},zoom:{get:function(){return(this._zoomX+this._zoomY)/2},set:function(t){this._zoomX=t,this._zoomY=t,this.dirty=!0}},zoomX:{get:function(){return this._zoomX},set:function(t){this._zoomX=t,this.dirty=!0}},zoomY:{get:function(){return this._zoomY},set:function(t){this._zoomY=t,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this.dirty=!0}},centerX:{get:function(){return this.x+.5*this.width}},centerY:{get:function(){return this.y+.5*this.height}},displayWidth:{get:function(){return this.width/this.zoomX}},displayHeight:{get:function(){return this.height/this.zoomY}}});t.exports=d},47751:(t,e,i)=>{var s=i(51052),r=i(79993),n=i(82897),a=i(56694),o=i(64937),h=i(53030),l=i(89787),u=i(42798),c=i(74118),d=i(93736),f=new a({Extends:s,Mixins:[o.Pipeline],initialize:function(t,e,i,r){s.call(this,t,e,i,r),this.postPipelines=[],this.pipelineData={},this.inputEnabled=!0,this.fadeEffect=new h.Fade(this),this.flashEffect=new h.Flash(this),this.shakeEffect=new h.Shake(this),this.panEffect=new h.Pan(this),this.rotateToEffect=new h.RotateTo(this),this.zoomEffect=new h.Zoom(this),this.lerp=new d(1,1),this.followOffset=new d,this.deadzone=null,this._follow=null},setDeadzone:function(t,e){if(void 0===t)this.deadzone=null;else{if(this.deadzone?(this.deadzone.width=t,this.deadzone.height=e):this.deadzone=new c(0,0,t,e),this._follow){var i=this.width/2,s=this.height/2,n=this._follow.x-this.followOffset.x,a=this._follow.y-this.followOffset.y;this.midPoint.set(n,a),this.scrollX=n-i,this.scrollY=a-s}r(this.deadzone,this.midPoint.x,this.midPoint.y)}return this},fadeIn:function(t,e,i,s,r,n){return this.fadeEffect.start(!1,t,e,i,s,!0,r,n)},fadeOut:function(t,e,i,s,r,n){return this.fadeEffect.start(!0,t,e,i,s,!0,r,n)},fadeFrom:function(t,e,i,s,r,n,a){return this.fadeEffect.start(!1,t,e,i,s,r,n,a)},fade:function(t,e,i,s,r,n,a){return this.fadeEffect.start(!0,t,e,i,s,r,n,a)},flash:function(t,e,i,s,r,n,a){return this.flashEffect.start(t,e,i,s,r,n,a)},shake:function(t,e,i,s,r){return this.shakeEffect.start(t,e,i,s,r)},pan:function(t,e,i,s,r,n,a){return this.panEffect.start(t,e,i,s,r,n,a)},rotateTo:function(t,e,i,s,r,n,a){return this.rotateToEffect.start(t,e,i,s,r,n,a)},zoomTo:function(t,e,i,s,r,n){return this.zoomEffect.start(t,e,i,s,r,n)},preRender:function(){this.renderList.length=0;var t=this.width,e=this.height,i=.5*t,s=.5*e,n=this.zoom,a=this.matrix,o=t*this.originX,h=e*this.originY,c=this._follow,d=this.deadzone,f=this.scrollX,p=this.scrollY;d&&r(d,this.midPoint.x,this.midPoint.y);var v=!1;if(c&&!this.panEffect.isRunning){var g=c.x-this.followOffset.x,m=c.y-this.followOffset.y;d?(gd.right&&(f=u(f,f+(g-d.right),this.lerp.x)),md.bottom&&(p=u(p,p+(m-d.bottom),this.lerp.y))):(f=u(f,g-o,this.lerp.x),p=u(p,m-h,this.lerp.y)),v=!0}this.useBounds&&(f=this.clampX(f),p=this.clampY(p)),this.roundPixels&&(o=Math.round(o),h=Math.round(h),f=Math.round(f),p=Math.round(p)),this.scrollX=f,this.scrollY=p;var y=f+i,x=p+s;this.midPoint.set(y,x);var T=t/n,w=e/n,E=y-T/2,b=x-w/2;this.roundPixels&&(E=Math.round(E),b=Math.round(b)),this.worldView.setTo(E,b,T,w),a.applyITRS(this.x+o,this.y+h,this.rotation,n,n),a.translate(-o,-h),this.shakeEffect.preRender(),v&&this.emit(l.FOLLOW_UPDATE,this,c)},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,s,r,a){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===s&&(s=i),void 0===r&&(r=0),void 0===a&&(a=r),this._follow=t,this.roundPixels=e,i=n(i,0,1),s=n(s,0,1),this.lerp.set(i,s),this.followOffset.set(r,a);var o=this.width/2,h=this.height/2,l=t.x-r,u=t.y-a;return this.midPoint.set(l,u),this.scrollX=l-o,this.scrollY=u-h,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.rotateToEffect.reset(),this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.rotateToEffect.update(t,e),this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.resetFX(),s.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=f},62382:(t,e,i)=>{var s=i(47751),r=i(56694),n=i(72632),a=i(91963),o=i(94287),h=i(40444),l=i(7599),u=new r({initialize:function(t){this.scene=t,this.systems=t.sys,this.roundPixels=t.sys.game.config.roundPixels,this.cameras=[],this.main,this.default,t.sys.events.once(l.BOOT,this.boot,this),t.sys.events.on(l.START,this.start,this)},boot:function(){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0],this.default=new s(0,0,t.scale.width,t.scale.height).setScene(this.scene),t.game.scale.on(h.RESIZE,this.onResize,this),this.systems.events.once(l.DESTROY,this.destroy,this)},start:function(){if(!this.main){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0]}var e=this.systems.events;e.on(l.UPDATE,this.update,this),e.once(l.SHUTDOWN,this.shutdown,this)},add:function(t,e,i,r,n,a){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===r&&(r=this.scene.sys.scale.height),void 0===n&&(n=!1),void 0===a&&(a="");var o=new s(t,e,i,r);return o.setName(a),o.setScene(this.scene),o.setRoundPixels(this.roundPixels),o.id=this.getNextID(),this.cameras.push(o),n&&(this.main=o),o},addExisting:function(t,e){return void 0===e&&(e=!1),-1===this.cameras.indexOf(t)?(t.id=this.getNextID(),t.setRoundPixels(this.roundPixels),this.cameras.push(t),e&&(this.main=t),t):null},getNextID:function(){for(var t=this.cameras,e=1,i=0;i<32;i++){for(var s=!1,r=0;r0){n.preRender();var a=this.getVisibleChildren(e.getChildren(),n);t.render(i,a,n)}}},getVisibleChildren:function(t,e){for(var i=[],s=0;s{var s=i(82897),r=i(56694),n=i(89787),a=new r({initialize:function(t){this.camera=t,this.isRunning=!1,this.isComplete=!1,this.direction=!0,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,r,a,o,h){if(void 0===t&&(t=!0),void 0===e&&(e=1e3),void 0===i&&(i=0),void 0===s&&(s=0),void 0===r&&(r=0),void 0===a&&(a=!1),void 0===o&&(o=null),void 0===h&&(h=this.camera.scene),!a&&this.isRunning)return this.camera;this.isRunning=!0,this.isComplete=!1,this.duration=e,this.direction=t,this.progress=0,this.red=i,this.green=s,this.blue=r,this.alpha=t?Number.MIN_VALUE:1,this._elapsed=0,this._onUpdate=o,this._onUpdateScope=h;var l=t?n.FADE_OUT_START:n.FADE_IN_START;return this.camera.emit(l,this.camera,this,e,i,s,r),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=s(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed{var s=i(82897),r=i(56694),n=i(89787),a=new r({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=1,this.progress=0,this._elapsed=0,this._alpha,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,r,a,o){return void 0===t&&(t=250),void 0===e&&(e=255),void 0===i&&(i=255),void 0===s&&(s=255),void 0===r&&(r=!1),void 0===a&&(a=null),void 0===o&&(o=this.camera.scene),!r&&this.isRunning||(this.isRunning=!0,this.duration=t,this.progress=0,this.red=e,this.green=i,this.blue=s,this._alpha=this.alpha,this._elapsed=0,this._onUpdate=a,this._onUpdateScope=o,this.camera.emit(n.FLASH_START,this.camera,this,t,e,i,s)),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=s(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed{var s=i(82897),r=i(56694),n=i(35060),a=i(89787),o=i(93736),h=new r({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=new o,this.current=new o,this.destination=new o,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,r,o,h){void 0===i&&(i=1e3),void 0===s&&(s=n.Linear),void 0===r&&(r=!1),void 0===o&&(o=null),void 0===h&&(h=this.camera.scene);var l=this.camera;return!r&&this.isRunning||(this.isRunning=!0,this.duration=i,this.progress=0,this.source.set(l.scrollX,l.scrollY),this.destination.set(t,e),l.getScroll(t,e,this.current),"string"==typeof s&&n.hasOwnProperty(s)?this.ease=n[s]:"function"==typeof s&&(this.ease=s),this._elapsed=0,this._onUpdate=o,this._onUpdateScope=h,this.camera.emit(a.PAN_START,this.camera,this,i,t,e)),l},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=s(this._elapsed/this.duration,0,1);this.progress=i;var r=this.camera;if(this._elapsed{var s=i(82897),r=i(56694),n=i(89787),a=i(35060),o=new r({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=0,this.current=0,this.destination=0,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope,this.clockwise=!0,this.shortestPath=!1},start:function(t,e,i,s,r,o,h){void 0===i&&(i=1e3),void 0===s&&(s=a.Linear),void 0===r&&(r=!1),void 0===o&&(o=null),void 0===h&&(h=this.camera.scene),void 0===e&&(e=!1),this.shortestPath=e;var l=t;t<0?(l=-1*t,this.clockwise=!1):this.clockwise=!0;var u=360*Math.PI/180;l-=Math.floor(l/u)*u;var c=this.camera;if(!r&&this.isRunning)return c;if(this.isRunning=!0,this.duration=i,this.progress=0,this.source=c.rotation,this.destination=l,"string"==typeof s&&a.hasOwnProperty(s)?this.ease=a[s]:"function"==typeof s&&(this.ease=s),this._elapsed=0,this._onUpdate=o,this._onUpdateScope=h,this.shortestPath){var d=0,f=0;(d=this.destination>this.source?Math.abs(this.destination-this.source):Math.abs(this.destination+u)-this.source)<(f=this.source>this.destination?Math.abs(this.source-this.destination):Math.abs(this.source+u)-this.destination)?this.clockwise=!0:d>f&&(this.clockwise=!1)}return this.camera.emit(n.ROTATE_START,this.camera,this,i,l),c},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=s(this._elapsed/this.duration,0,1);this.progress=i;var r=this.camera;if(this._elapsed=l?Math.abs(h-l):Math.abs(h+o)-l;var u=0;u=this.clockwise?r.rotation+a*n:r.rotation-a*n,r.rotation=u,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,r,i,u)}else r.rotation=this.destination,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,r,i,this.destination),this.effectComplete()}},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(n.ROTATE_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null,this.source=null,this.destination=null}});t.exports=o},3241:(t,e,i)=>{var s=i(82897),r=i(56694),n=i(89787),a=i(93736),o=new r({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.intensity=new a,this.progress=0,this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,r){return void 0===t&&(t=100),void 0===e&&(e=.05),void 0===i&&(i=!1),void 0===s&&(s=null),void 0===r&&(r=this.camera.scene),!i&&this.isRunning||(this.isRunning=!0,this.duration=t,this.progress=0,"number"==typeof e?this.intensity.set(e):this.intensity.set(e.x,e.y),this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate=s,this._onUpdateScope=r,this.camera.emit(n.SHAKE_START,this.camera,this,t,e)),this.camera},preRender:function(){this.isRunning&&this.camera.matrix.translate(this._offsetX,this._offsetY)},update:function(t,e){if(this.isRunning)if(this._elapsed+=e,this.progress=s(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed{var s=i(82897),r=i(56694),n=i(35060),a=i(89787),o=new r({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=1,this.destination=1,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,r,o){void 0===e&&(e=1e3),void 0===i&&(i=n.Linear),void 0===s&&(s=!1),void 0===r&&(r=null),void 0===o&&(o=this.camera.scene);var h=this.camera;return!s&&this.isRunning||(this.isRunning=!0,this.duration=e,this.progress=0,this.source=h.zoom,this.destination=t,"string"==typeof i&&n.hasOwnProperty(i)?this.ease=n[i]:"function"==typeof i&&(this.ease=i),this._elapsed=0,this._onUpdate=r,this._onUpdateScope=o,this.camera.emit(a.ZOOM_START,this.camera,this,e,t)),h},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=s(this._elapsed/this.duration,0,1),this._elapsed{t.exports={Fade:i(92522),Flash:i(22151),Pan:i(37551),Shake:i(3241),RotateTo:i(1771),Zoom:i(13383)}},39577:t=>{t.exports="cameradestroy"},85373:t=>{t.exports="camerafadeincomplete"},92057:t=>{t.exports="camerafadeinstart"},1903:t=>{t.exports="camerafadeoutcomplete"},96131:t=>{t.exports="camerafadeoutstart"},85409:t=>{t.exports="cameraflashcomplete"},25500:t=>{t.exports="cameraflashstart"},44071:t=>{t.exports="followupdate"},19818:t=>{t.exports="camerapancomplete"},80002:t=>{t.exports="camerapanstart"},87966:t=>{t.exports="postrender"},74217:t=>{t.exports="prerender"},34805:t=>{t.exports="camerarotatecomplete"},30408:t=>{t.exports="camerarotatestart"},49856:t=>{t.exports="camerashakecomplete"},69189:t=>{t.exports="camerashakestart"},67657:t=>{t.exports="camerazoomcomplete"},14229:t=>{t.exports="camerazoomstart"},89787:(t,e,i)=>{t.exports={DESTROY:i(39577),FADE_IN_COMPLETE:i(85373),FADE_IN_START:i(92057),FADE_OUT_COMPLETE:i(1903),FADE_OUT_START:i(96131),FLASH_COMPLETE:i(85409),FLASH_START:i(25500),FOLLOW_UPDATE:i(44071),PAN_COMPLETE:i(19818),PAN_START:i(80002),POST_RENDER:i(87966),PRE_RENDER:i(74217),ROTATE_COMPLETE:i(34805),ROTATE_START:i(30408),SHAKE_COMPLETE:i(49856),SHAKE_START:i(69189),ZOOM_COMPLETE:i(67657),ZOOM_START:i(14229)}},32356:(t,e,i)=>{t.exports={Camera:i(47751),BaseCamera:i(51052),CameraManager:i(62382),Effects:i(53030),Events:i(89787)}},84219:(t,e,i)=>{var s=i(56694),r=i(10850),n=new s({initialize:function(t){this.camera=r(t,"camera",null),this.left=r(t,"left",null),this.right=r(t,"right",null),this.up=r(t,"up",null),this.down=r(t,"down",null),this.zoomIn=r(t,"zoomIn",null),this.zoomOut=r(t,"zoomOut",null),this.zoomSpeed=r(t,"zoomSpeed",.01),this.minZoom=r(t,"minZoom",.001),this.maxZoom=r(t,"maxZoom",1e3),this.speedX=0,this.speedY=0;var e=r(t,"speed",null);"number"==typeof e?(this.speedX=e,this.speedY=e):(this.speedX=r(t,"speed.x",0),this.speedY=r(t,"speed.y",0)),this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this.up&&this.up.isDown?e.scrollY-=this.speedY*t|0:this.down&&this.down.isDown&&(e.scrollY+=this.speedY*t|0),this.left&&this.left.isDown?e.scrollX-=this.speedX*t|0:this.right&&this.right.isDown&&(e.scrollX+=this.speedX*t|0),this.zoomIn&&this.zoomIn.isDown?(e.zoom-=this.zoomSpeed,e.zoomthis.maxZoom&&(e.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=n},69370:(t,e,i)=>{var s=i(56694),r=i(10850),n=new s({initialize:function(t){this.camera=r(t,"camera",null),this.left=r(t,"left",null),this.right=r(t,"right",null),this.up=r(t,"up",null),this.down=r(t,"down",null),this.zoomIn=r(t,"zoomIn",null),this.zoomOut=r(t,"zoomOut",null),this.zoomSpeed=r(t,"zoomSpeed",.01),this.minZoom=r(t,"minZoom",.001),this.maxZoom=r(t,"maxZoom",1e3),this.accelX=0,this.accelY=0;var e=r(t,"acceleration",null);"number"==typeof e?(this.accelX=e,this.accelY=e):(this.accelX=r(t,"acceleration.x",0),this.accelY=r(t,"acceleration.y",0)),this.dragX=0,this.dragY=0;var i=r(t,"drag",null);"number"==typeof i?(this.dragX=i,this.dragY=i):(this.dragX=r(t,"drag.x",0),this.dragY=r(t,"drag.y",0)),this.maxSpeedX=0,this.maxSpeedY=0;var s=r(t,"maxSpeed",null);"number"==typeof s?(this.maxSpeedX=s,this.maxSpeedY=s):(this.maxSpeedX=r(t,"maxSpeed.x",0),this.maxSpeedY=r(t,"maxSpeed.y",0)),this._speedX=0,this._speedY=0,this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this._speedX>0?(this._speedX-=this.dragX*t,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*t,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*t,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*t,this._speedY>0&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoomthis.maxZoom&&(e.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=n},6524:(t,e,i)=>{t.exports={FixedKeyControl:i(84219),SmoothedKeyControl:i(69370)}},44143:(t,e,i)=>{t.exports={Controls:i(6524),Scene2D:i(32356)}},86459:(t,e,i)=>{var s={VERSION:"3.60.0-beta.3",BlendModes:i(95723),ScaleModes:i(27394),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=s},14033:(t,e,i)=>{var s=i(56694),r=i(86459),n=i(77290),a=i(72632),o=i(10850),h=i(42911),l=i(5923),u=i(72283),c=i(18360),d=i(93222),f=new s({initialize:function(t){void 0===t&&(t={});this.width=o(t,"width",1024),this.height=o(t,"height",768),this.zoom=o(t,"zoom",1),this.parent=o(t,"parent",void 0),this.scaleMode=o(t,"scaleMode",0),this.expandParent=o(t,"expandParent",!0),this.autoRound=o(t,"autoRound",!1),this.autoCenter=o(t,"autoCenter",0),this.resizeInterval=o(t,"resizeInterval",500),this.fullscreenTarget=o(t,"fullscreenTarget",null),this.minWidth=o(t,"minWidth",0),this.maxWidth=o(t,"maxWidth",0),this.minHeight=o(t,"minHeight",0),this.maxHeight=o(t,"maxHeight",0);var e=o(t,"scale",null);e&&(this.width=o(e,"width",this.width),this.height=o(e,"height",this.height),this.zoom=o(e,"zoom",this.zoom),this.parent=o(e,"parent",this.parent),this.scaleMode=o(e,"mode",this.scaleMode),this.expandParent=o(e,"expandParent",this.expandParent),this.autoRound=o(e,"autoRound",this.autoRound),this.autoCenter=o(e,"autoCenter",this.autoCenter),this.resizeInterval=o(e,"resizeInterval",this.resizeInterval),this.fullscreenTarget=o(e,"fullscreenTarget",this.fullscreenTarget),this.minWidth=o(e,"min.width",this.minWidth),this.maxWidth=o(e,"max.width",this.maxWidth),this.minHeight=o(e,"min.height",this.minHeight),this.maxHeight=o(e,"max.height",this.maxHeight)),this.renderType=o(t,"type",r.AUTO),this.canvas=o(t,"canvas",null),this.context=o(t,"context",null),this.canvasStyle=o(t,"canvasStyle",null),this.customEnvironment=o(t,"customEnvironment",!1),this.sceneConfig=o(t,"scene",null),this.seed=o(t,"seed",[(Date.now()*Math.random()).toString()]),l.RND=new l.RandomDataGenerator(this.seed),this.gameTitle=o(t,"title",""),this.gameURL=o(t,"url","https://phaser.io"),this.gameVersion=o(t,"version",""),this.autoFocus=o(t,"autoFocus",!0),this.domCreateContainer=o(t,"dom.createContainer",!1),this.domPointerEvents=o(t,"dom.pointerEvents","none"),this.inputKeyboard=o(t,"input.keyboard",!0),this.inputKeyboardEventTarget=o(t,"input.keyboard.target",window),this.inputKeyboardCapture=o(t,"input.keyboard.capture",[]),this.inputMouse=o(t,"input.mouse",!0),this.inputMouseEventTarget=o(t,"input.mouse.target",null),this.inputMousePreventDefaultDown=o(t,"input.mouse.preventDefaultDown",!0),this.inputMousePreventDefaultUp=o(t,"input.mouse.preventDefaultUp",!0),this.inputMousePreventDefaultMove=o(t,"input.mouse.preventDefaultMove",!0),this.inputMousePreventDefaultWheel=o(t,"input.mouse.preventDefaultWheel",!0),this.inputTouch=o(t,"input.touch",n.input.touch),this.inputTouchEventTarget=o(t,"input.touch.target",null),this.inputTouchCapture=o(t,"input.touch.capture",!0),this.inputActivePointers=o(t,"input.activePointers",1),this.inputSmoothFactor=o(t,"input.smoothFactor",0),this.inputWindowEvents=o(t,"input.windowEvents",!0),this.inputGamepad=o(t,"input.gamepad",!1),this.inputGamepadEventTarget=o(t,"input.gamepad.target",window),this.disableContextMenu=o(t,"disableContextMenu",!1),this.audio=o(t,"audio",{}),this.hideBanner=!1===o(t,"banner",null),this.hidePhaser=o(t,"banner.hidePhaser",!1),this.bannerTextColor=o(t,"banner.text","#ffffff"),this.bannerBackgroundColor=o(t,"banner.background",["#ff0000","#ffff00","#00ff00","#00ffff","#000000"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=o(t,"fps",null);var i=o(t,"render",t);this.pipeline=o(i,"pipeline",null),this.antialias=o(i,"antialias",!0),this.antialiasGL=o(i,"antialiasGL",!0),this.mipmapFilter=o(i,"mipmapFilter","LINEAR"),this.desynchronized=o(i,"desynchronized",!1),this.roundPixels=o(i,"roundPixels",!1),this.pixelArt=o(i,"pixelArt",1!==this.zoom),this.pixelArt&&(this.antialias=!1,this.antialiasGL=!1,this.roundPixels=!0),this.transparent=o(i,"transparent",!1),this.clearBeforeRender=o(i,"clearBeforeRender",!0),this.preserveDrawingBuffer=o(i,"preserveDrawingBuffer",!1),this.premultipliedAlpha=o(i,"premultipliedAlpha",!0),this.failIfMajorPerformanceCaveat=o(i,"failIfMajorPerformanceCaveat",!1),this.powerPreference=o(i,"powerPreference","default"),this.batchSize=o(i,"batchSize",4096),this.maxTextures=o(i,"maxTextures",-1),this.maxLights=o(i,"maxLights",10);var s=o(t,"backgroundColor",0);this.backgroundColor=d(s),this.transparent&&(this.backgroundColor=d(0),this.backgroundColor.alpha=0),this.preBoot=o(t,"callbacks.preBoot",u),this.postBoot=o(t,"callbacks.postBoot",u),this.physics=o(t,"physics",{}),this.defaultPhysicsSystem=o(this.physics,"default",!1),this.loaderBaseURL=o(t,"loader.baseURL",""),this.loaderPath=o(t,"loader.path","");var f=n.os.android?6:32;this.loaderMaxParallelDownloads=o(t,"loader.maxParallelDownloads",f),this.loaderCrossOrigin=o(t,"loader.crossOrigin",void 0),this.loaderResponseType=o(t,"loader.responseType",""),this.loaderAsync=o(t,"loader.async",!0),this.loaderUser=o(t,"loader.user",""),this.loaderPassword=o(t,"loader.password",""),this.loaderTimeout=o(t,"loader.timeout",0),this.loaderWithCredentials=o(t,"loader.withCredentials",!1),this.loaderImageLoadType=o(t,"loader.imageLoadType","XHR"),this.installGlobalPlugins=[],this.installScenePlugins=[];var p=o(t,"plugins",null),v=c.DefaultScene;p&&(Array.isArray(p)?this.defaultPlugins=p:h(p)&&(this.installGlobalPlugins=a(p,"global",[]),this.installScenePlugins=a(p,"scene",[]),Array.isArray(p.default)?v=p.default:Array.isArray(p.defaultMerge)&&(v=v.concat(p.defaultMerge)))),this.defaultPlugins=v;var g="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=o(t,"images.default",g+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=o(t,"images.missing",g+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),this.whiteImage=o(t,"images.white","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABdJREFUeNpi/P//PwMMMDEgAdwcgAADAJZuAwXJYZOzAAAAAElFTkSuQmCC"),window&&(window.FORCE_WEBGL?this.renderType=r.WEBGL:window.FORCE_CANVAS&&(this.renderType=r.CANVAS))}});t.exports=f},50150:(t,e,i)=>{var s=i(70616),r=i(61068),n=i(86459),a=i(90185);t.exports=function(t){var e=t.config;if((e.customEnvironment||e.canvas)&&e.renderType===n.AUTO)throw new Error("Must set explicit renderType in custom environment");if(!e.customEnvironment&&!e.canvas&&e.renderType!==n.HEADLESS)if(e.renderType===n.AUTO&&(e.renderType=a.webGL?n.WEBGL:n.CANVAS),e.renderType===n.WEBGL){if(!a.webGL)throw new Error("Cannot create WebGL context, aborting.")}else{if(e.renderType!==n.CANVAS)throw new Error("Unknown value for renderer type: "+e.renderType);if(!a.canvas)throw new Error("Cannot create Canvas context, aborting.")}e.antialias||r.disableSmoothing();var o,h,l=t.scale.baseSize,u=l.width,c=l.height;(e.canvas?(t.canvas=e.canvas,t.canvas.width=u,t.canvas.height=c):t.canvas=r.create(t,u,c,e.renderType),e.canvasStyle&&(t.canvas.style=e.canvasStyle),e.antialias||s.setCrisp(t.canvas),e.renderType!==n.HEADLESS)&&(o=i(91135),h=i(11857),e.renderType===n.WEBGL?t.renderer=new h(t):(t.renderer=new o(t),t.context=t.renderer.gameContext))}},77291:(t,e,i)=>{var s=i(86459);t.exports=function(t){var e=t.config;if(!e.hideBanner){var i="WebGL";e.renderType===s.CANVAS?i="Canvas":e.renderType===s.HEADLESS&&(i="Headless");var r,n=e.audio,a=t.device.audio;if(r=a.webAudio&&!n.disableWebAudio?"Web Audio":n.noAudio||!a.webAudio&&!a.audioData?"No Audio":"HTML5 Audio",t.device.browser.ie)window.console&&console.log("Phaser v"+s.VERSION+" / https://phaser.io");else{var o,h="",l=[h];if(Array.isArray(e.bannerBackgroundColor))e.bannerBackgroundColor.forEach((function(t){h=h.concat("%c "),l.push("background: "+t),o=t})),l[l.length-1]="color: "+e.bannerTextColor+"; background: "+o;else h=h.concat("%c "),l.push("color: "+e.bannerTextColor+"; background: "+e.bannerBackgroundColor);l.push("background: transparent"),e.gameTitle&&(h=h.concat(e.gameTitle),e.gameVersion&&(h=h.concat(" v"+e.gameVersion)),e.hidePhaser||(h=h.concat(" / ")));e.hidePhaser||(h=h.concat("Phaser v"+s.VERSION+" ("+i+" | "+r+")")),h=h.concat(" %c "+e.gameURL),l[0]=h,console.log.apply(console,l)}}}},15213:(t,e,i)=>{var s=i(99584),r=i(90249),n=i(43474),a=i(61068),o=i(56694),h=i(14033),l=i(85178),u=i(50150),c=i(81078),d=i(77291),f=i(77290),p=i(21546),v=i(6659),g=i(97081),m=i(69898),y=i(91963),x=i(49274),T=i(756),w=i(13553),E=i(38203),b=i(6237),S=i(26617),A=i(26493),_=i(84191),C=new o({initialize:function(t){this.config=new h(t),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new v,this.anims=new r(this),this.textures=new b(this),this.cache=new n(this),this.registry=new c(this),this.input=new m(this,this.config),this.scene=new w(this,this.config.sceneConfig),this.device=f,this.scale=new T(this,this.config),this.sound=null,this.sound=_.create(this),this.loop=new S(this,this.config.fps),this.plugins=new x(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,p(this.boot.bind(this))},boot:function(){y.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),u(this),l(this),d(this),s(this.canvas,this.config.parent),this.textures.once(E.READY,this.texturesReady,this),this.events.emit(g.BOOT)):console.warn("Aborting. Core Plugins missing.")},texturesReady:function(){this.events.emit(g.READY),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),A(this);var t=this.events;t.on(g.HIDDEN,this.onHidden,this),t.on(g.VISIBLE,this.onVisible,this),t.on(g.BLUR,this.onBlur,this),t.on(g.FOCUS,this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit(g.PRE_STEP,t,e),i.emit(g.STEP,t,e),this.scene.update(t,e),i.emit(g.POST_STEP,t,e);var s=this.renderer;s.preRender(),i.emit(g.PRE_RENDER,s,t,e),this.scene.render(s),s.postRender(),i.emit(g.POST_RENDER,s,t,e)},headlessStep:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit(g.PRE_STEP,t,e),i.emit(g.STEP,t,e),this.scene.update(t,e),i.emit(g.POST_STEP,t,e),i.emit(g.PRE_RENDER),i.emit(g.POST_RENDER)},onHidden:function(){this.loop.pause(),this.events.emit(g.PAUSE)},onVisible:function(){this.loop.resume(),this.events.emit(g.RESUME)},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},getFrame:function(){return this.loop.frame},getTime:function(){return this.loop.now},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.scene.destroy(),this.events.emit(g.DESTROY),this.events.removeAllListeners(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(a.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.domContainer&&this.domContainer.parentNode.removeChild(this.domContainer),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=C},26617:(t,e,i)=>{var s=i(56694),r=i(10850),n=i(72283),a=i(27385),o=new s({initialize:function(t,e){this.game=t,this.raf=new a,this.started=!1,this.running=!1,this.minFps=r(e,"min",5),this.targetFps=r(e,"target",60),this._min=1e3/this.minFps,this._target=1e3/this.targetFps,this.actualFps=this.targetFps,this.nextFpsUpdate=0,this.framesThisSecond=0,this.callback=n,this.forceSetTimeOut=r(e,"forceSetTimeOut",!1),this.time=0,this.startTime=0,this.lastTime=0,this.frame=0,this.inFocus=!0,this._pauseTime=0,this._coolDown=0,this.delta=0,this.deltaIndex=0,this.deltaHistory=[],this.deltaSmoothingMax=r(e,"deltaHistory",10),this.panicMax=r(e,"panicMax",120),this.rawDelta=0,this.now=0,this.smoothStep=r(e,"smoothStep",!0)},blur:function(){this.inFocus=!1},focus:function(){this.inFocus=!0,this.resetDelta()},pause:function(){this._pauseTime=window.performance.now()},resume:function(){this.resetDelta(),this.startTime+=this.time-this._pauseTime},resetDelta:function(){var t=window.performance.now();this.time=t,this.lastTime=t,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0;for(var e=0;e0||!this.inFocus)&&(this._coolDown--,n=Math.min(n,this._target)),n>this._min&&(n=s[i],n=Math.min(n,this._min)),s[i]=n,this.deltaIndex++,this.deltaIndex>r&&(this.deltaIndex=0),a=0;for(var o=0;othis.nextFpsUpdate&&(this.actualFps=.25*this.framesThisSecond+.75*this.actualFps,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0),this.framesThisSecond++;var h=a/this._target;this.callback(t,a,h),this.lastTime=t,this.frame++},tick:function(){this.step()},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){this.running||(t&&(this.startTime+=-this.lastTime+(this.lastTime+window.performance.now())),this.raf.start(this.step.bind(this),this.useRAF),this.running=!0,this.step())},getDuration:function(){return Math.round(this.lastTime-this.startTime)/1e3},getDurationMS:function(){return Math.round(this.lastTime-this.startTime)},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.callback=n,this.raf=null,this.game=null}});t.exports=o},26493:(t,e,i)=>{var s=i(97081);t.exports=function(t){var e,i=t.events;if(void 0!==document.hidden)e="visibilitychange";else{["webkit","moz","ms"].forEach((function(t){void 0!==document[t+"Hidden"]&&(document.hidden=function(){return document[t+"Hidden"]},e=t+"visibilitychange")}))}e&&document.addEventListener(e,(function(t){document.hidden||"pause"===t.type?i.emit(s.HIDDEN):i.emit(s.VISIBLE)}),!1),window.onblur=function(){i.emit(s.BLUR)},window.onfocus=function(){i.emit(s.FOCUS)},window.focus&&t.config.autoFocus&&window.focus()}},41651:t=>{t.exports="blur"},5520:t=>{t.exports="boot"},51673:t=>{t.exports="contextlost"},66336:t=>{t.exports="contextrestored"},25055:t=>{t.exports="destroy"},23767:t=>{t.exports="focus"},57564:t=>{t.exports="hidden"},38327:t=>{t.exports="pause"},43807:t=>{t.exports="postrender"},73652:t=>{t.exports="poststep"},780:t=>{t.exports="prerender"},13781:t=>{t.exports="prestep"},38247:t=>{t.exports="ready"},29129:t=>{t.exports="resume"},34994:t=>{t.exports="step"},98704:t=>{t.exports="visible"},97081:(t,e,i)=>{t.exports={BLUR:i(41651),BOOT:i(5520),CONTEXT_LOST:i(51673),CONTEXT_RESTORED:i(66336),DESTROY:i(25055),FOCUS:i(23767),HIDDEN:i(57564),PAUSE:i(38327),POST_RENDER:i(43807),POST_STEP:i(73652),PRE_RENDER:i(780),PRE_STEP:i(13781),READY:i(38247),RESUME:i(29129),STEP:i(34994),VISIBLE:i(98704)}},80293:(t,e,i)=>{t.exports={Config:i(14033),CreateRenderer:i(50150),DebugHeader:i(77291),Events:i(97081),TimeStep:i(26617),VisibilityHandler:i(26493)}},52780:(t,e,i)=>{var s=i(81543),r=i(61068),n=i(10850);t.exports=function(t){var e=n(t,"data",[]),i=n(t,"canvas",null),a=n(t,"palette",s),o=n(t,"pixelWidth",1),h=n(t,"pixelHeight",o),l=n(t,"resizeCanvas",!0),u=n(t,"clearCanvas",!0),c=n(t,"preRender",null),d=n(t,"postRender",null),f=Math.floor(Math.abs(e[0].length*o)),p=Math.floor(Math.abs(e.length*h));i||(i=r.create2D(this,f,p),l=!1,u=!1),l&&(i.width=f,i.height=p);var v=i.getContext("2d");u&&v.clearRect(0,0,f,p),c&&c(i,v);for(var g=0;g{t.exports={GenerateTexture:i(52780),Palettes:i(25235)}},81543:t=>{t.exports={0:"#000",1:"#9D9D9D",2:"#FFF",3:"#BE2633",4:"#E06F8B",5:"#493C2B",6:"#A46422",7:"#EB8931",8:"#F7E26B",9:"#2F484E",A:"#44891A",B:"#A3CE27",C:"#1B2632",D:"#005784",E:"#31A2F2",F:"#B2DCEF"}},75846:t=>{t.exports={0:"#000",1:"#fff",2:"#8b4131",3:"#7bbdc5",4:"#8b41ac",5:"#6aac41",6:"#3931a4",7:"#d5de73",8:"#945a20",9:"#5a4100",A:"#bd736a",B:"#525252",C:"#838383",D:"#acee8b",E:"#7b73de",F:"#acacac"}},83206:t=>{t.exports={0:"#000",1:"#2234d1",2:"#0c7e45",3:"#44aacc",4:"#8a3622",5:"#5c2e78",6:"#aa5c3d",7:"#b5b5b5",8:"#5e606e",9:"#4c81fb",A:"#6cd947",B:"#7be2f9",C:"#eb8a60",D:"#e23d69",E:"#ffd93f",F:"#fff"}},13194:t=>{t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#f5f4eb"}},50686:t=>{t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#fff"}},25235:(t,e,i)=>{t.exports={ARNE16:i(81543),C64:i(75846),CGA:i(83206),JMP:i(13194),MSX:i(50686)}},63120:(t,e,i)=>{var s=i(56694),r=i(34631),n=i(38517),a=i(93736),o=new s({Extends:n,initialize:function(t,e,i,s){n.call(this,"CubicBezierCurve"),Array.isArray(t)&&(s=new a(t[6],t[7]),i=new a(t[4],t[5]),e=new a(t[2],t[3]),t=new a(t[0],t[1])),this.p0=t,this.p1=e,this.p2=i,this.p3=s},getStartPoint:function(t){return void 0===t&&(t=new a),t.copy(this.p0)},getResolution:function(t){return t},getPoint:function(t,e){void 0===e&&(e=new a);var i=this.p0,s=this.p1,n=this.p2,o=this.p3;return e.set(r(t,i.x,s.x,n.x,o.x),r(t,i.y,s.y,n.y,o.y))},draw:function(t,e){void 0===e&&(e=32);var i=this.getPoints(e);t.beginPath(),t.moveTo(this.p0.x,this.p0.y);for(var s=1;s{var s=i(56694),r=i(80222),n=i(74118),a=i(93736),o=new s({initialize:function(t){this.type=t,this.defaultDivisions=5,this.arcLengthDivisions=100,this.cacheArcLengths=[],this.needsUpdate=!0,this.active=!0,this._tmpVec2A=new a,this._tmpVec2B=new a},draw:function(t,e){return void 0===e&&(e=32),t.strokePoints(this.getPoints(e))},getBounds:function(t,e){t||(t=new n),void 0===e&&(e=16);var i=this.getLength();e>i&&(e=i/2);var s=Math.max(1,Math.round(i/e));return r(this.getSpacedPoints(s),t)},getDistancePoints:function(t){var e=this.getLength(),i=Math.max(1,e/t);return this.getSpacedPoints(i)},getEndPoint:function(t){return void 0===t&&(t=new a),this.getPointAt(1,t)},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],s=this.getPoint(0,this._tmpVec2A),r=0;i.push(0);for(var n=1;n<=t;n++)r+=(e=this.getPoint(n/t,this._tmpVec2B)).distance(s),i.push(r),s.copy(e);return this.cacheArcLengths=i,i},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var s=0;s<=t;s++)i.push(this.getPoint(s/t));return i},getRandomPoint:function(t){return void 0===t&&(t=new a),this.getPoint(Math.random(),t)},getSpacedPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var s=0;s<=t;s++){var r=this.getUtoTmapping(s/t,null,t);i.push(this.getPoint(r))}return i},getStartPoint:function(t){return void 0===t&&(t=new a),this.getPointAt(0,t)},getTangent:function(t,e){void 0===e&&(e=new a);var i=1e-4,s=t-i,r=t+i;return s<0&&(s=0),r>1&&(r=1),this.getPoint(s,this._tmpVec2A),this.getPoint(r,e),e.subtract(this._tmpVec2A).normalize()},getTangentAt:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)},getTFromDistance:function(t,e){return t<=0?0:this.getUtoTmapping(0,t,e)},getUtoTmapping:function(t,e,i){var s,r=this.getLengths(i),n=0,a=r.length;s=e?Math.min(e,r[a-1]):t*r[a-1];for(var o,h=0,l=a-1;h<=l;)if((o=r[n=Math.floor(h+(l-h)/2)]-s)<0)h=n+1;else{if(!(o>0)){l=n;break}l=n-1}if(r[n=l]===s)return n/(a-1);var u=r[n];return(n+(s-u)/(r[n+1]-u))/(a-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});t.exports=o},48835:(t,e,i)=>{var s=i(56694),r=i(38517),n=i(75606),a=i(10850),o=i(23701),h=i(93736),l=new s({Extends:r,initialize:function(t,e,i,s,o,l,u,c){if("object"==typeof t){var d=t;t=a(d,"x",0),e=a(d,"y",0),i=a(d,"xRadius",0),s=a(d,"yRadius",i),o=a(d,"startAngle",0),l=a(d,"endAngle",360),u=a(d,"clockwise",!1),c=a(d,"rotation",0)}else void 0===s&&(s=i),void 0===o&&(o=0),void 0===l&&(l=360),void 0===u&&(u=!1),void 0===c&&(c=0);r.call(this,"EllipseCurve"),this.p0=new h(t,e),this._xRadius=i,this._yRadius=s,this._startAngle=n(o),this._endAngle=n(l),this._clockwise=u,this._rotation=n(c)},getStartPoint:function(t){return void 0===t&&(t=new h),this.getPoint(0,t)},getResolution:function(t){return 2*t},getPoint:function(t,e){void 0===e&&(e=new h);for(var i=2*Math.PI,s=this._endAngle-this._startAngle,r=Math.abs(s)i;)s-=i;s{var s=i(56694),r=i(38517),n=i(80222),a=i(74118),o=i(93736),h=new s({Extends:r,initialize:function(t,e){r.call(this,"LineCurve"),Array.isArray(t)&&(e=new o(t[2],t[3]),t=new o(t[0],t[1])),this.p0=t,this.p1=e,this.arcLengthDivisions=1},getBounds:function(t){return void 0===t&&(t=new a),n([this.p0,this.p1],t)},getStartPoint:function(t){return void 0===t&&(t=new o),t.copy(this.p0)},getResolution:function(t){return void 0===t&&(t=1),t},getPoint:function(t,e){return void 0===e&&(e=new o),1===t?e.copy(this.p1):(e.copy(this.p1).subtract(this.p0).scale(t).add(this.p0),e)},getPointAt:function(t,e){return this.getPoint(t,e)},getTangent:function(t,e){return void 0===e&&(e=new o),e.copy(this.p1).subtract(this.p0).normalize(),e},getUtoTmapping:function(t,e,i){var s;if(e){var r=this.getLengths(i),n=r[r.length-1];s=Math.min(e,n)/n}else s=t;return s},draw:function(t){return t.lineBetween(this.p0.x,this.p0.y,this.p1.x,this.p1.y),t},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y]}}});h.fromJSON=function(t){var e=t.points,i=new o(e[0],e[1]),s=new o(e[2],e[3]);return new h(i,s)},t.exports=h},64761:(t,e,i)=>{var s=i(56694),r=i(38517),n=i(16252),a=i(93736),o=new s({Extends:r,initialize:function(t,e,i){r.call(this,"QuadraticBezier"),Array.isArray(t)&&(i=new a(t[4],t[5]),e=new a(t[2],t[3]),t=new a(t[0],t[1])),this.p0=t,this.p1=e,this.p2=i},getStartPoint:function(t){return void 0===t&&(t=new a),t.copy(this.p0)},getResolution:function(t){return t},getPoint:function(t,e){void 0===e&&(e=new a);var i=this.p0,s=this.p1,r=this.p2;return e.set(n(t,i.x,s.x,r.x),n(t,i.y,s.y,r.y))},draw:function(t,e){void 0===e&&(e=32);var i=this.getPoints(e);t.beginPath(),t.moveTo(this.p0.x,this.p0.y);for(var s=1;s{var s=i(14976),r=i(56694),n=i(38517),a=i(93736),o=new r({Extends:n,initialize:function(t){void 0===t&&(t=[]),n.call(this,"SplineCurve"),this.points=[],this.addPoints(t)},addPoints:function(t){for(var e=0;ei.length-2?i.length-1:n+1],c=i[n>i.length-3?i.length-1:n+2];return e.set(s(o,h.x,l.x,u.x,c.x),s(o,h.y,l.y,u.y,c.y))},toJSON:function(){for(var t=[],e=0;e{t.exports={Path:i(12822),MoveTo:i(53639),CubicBezier:i(63120),Curve:i(38517),Ellipse:i(48835),Line:i(58084),QuadraticBezier:i(64761),Spline:i(11956)}},53639:(t,e,i)=>{var s=i(56694),r=i(93736),n=new s({initialize:function(t,e){this.active=!1,this.p0=new r(t,e)},getPoint:function(t,e){return void 0===e&&(e=new r),e.copy(this.p0)},getPointAt:function(t,e){return this.getPoint(t,e)},getResolution:function(){return 1},getLength:function(){return 0},toJSON:function(){return{type:"MoveTo",points:[this.p0.x,this.p0.y]}}});t.exports=n},12822:(t,e,i)=>{var s=i(56694),r=i(63120),n=i(48835),a=i(61286),o=i(58084),h=i(53639),l=i(64761),u=i(74118),c=i(11956),d=i(93736),f=i(83392),p=new s({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.name="",this.curves=[],this.cacheLengths=[],this.autoClose=!1,this.startPoint=new d,this._tmpVec2A=new d,this._tmpVec2B=new d,"object"==typeof t?this.fromJSON(t):this.startPoint.set(t,e)},add:function(t){return this.curves.push(t),this},circleTo:function(t,e,i){return void 0===e&&(e=!1),this.ellipseTo(t,t,0,360,e,i)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);return t.equals(e)||this.curves.push(new o(e,t)),this},cubicBezierTo:function(t,e,i,s,n,a){var o,h,l,u=this.getEndPoint();return t instanceof d?(o=t,h=e,l=i):(o=new d(i,s),h=new d(n,a),l=new d(t,e)),this.add(new r(u,o,h,l))},quadraticBezierTo:function(t,e,i,s){var r,n,a=this.getEndPoint();return t instanceof d?(r=t,n=e):(r=new d(i,s),n=new d(t,e)),this.add(new l(a,r,n))},draw:function(t,e){for(var i=0;i0?this.curves[this.curves.length-1].getPoint(1,t):t.copy(this.startPoint),t},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},getPoint:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),s=this.getCurveLengths(),r=0;r=i){var n=s[r]-i,a=this.curves[r],o=a.getLength(),h=0===o?0:1-n/o;return a.getPointAt(h,e)}r++}return null},getPoints:function(t){void 0===t&&(t=12);for(var e,i=[],s=0;s1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i},getRandomPoint:function(t){return void 0===t&&(t=new d),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getStartPoint:function(t){return void 0===t&&(t=new d),t.copy(this.startPoint)},getTangent:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),s=this.getCurveLengths(),r=0;r=i){var n=s[r]-i,a=this.curves[r],o=a.getLength(),h=0===o?0:1-n/o;return a.getTangentAt(h,e)}r++}return null},lineTo:function(t,e){t instanceof d?this._tmpVec2B.copy(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new o([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new c(t))},moveTo:function(t,e){return t instanceof d?this.add(new h(t.x,t.y)):this.add(new h(t,e))},toJSON:function(){for(var t=[],e=0;e{var s=i(56694),r=i(35026),n=new s({initialize:function(t,e){this.parent=t,this.events=e,e||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once(r.DESTROY,this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],s=0;s{var s=i(56694),r=i(81078),n=i(91963),a=i(7599),o=new s({Extends:r,initialize:function(t){r.call(this,t,t.sys.events),this.scene=t,this.systems=t.sys,t.sys.events.once(a.BOOT,this.boot,this),t.sys.events.on(a.START,this.start,this)},boot:function(){this.events=this.systems.events,this.events.once(a.DESTROY,this.destroy,this)},start:function(){this.events.once(a.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.systems.events.off(a.SHUTDOWN,this.shutdown,this)},destroy:function(){r.prototype.destroy.call(this),this.events.off(a.START,this.start,this),this.scene=null,this.systems=null}});n.register("DataManagerPlugin",o,"data"),t.exports=o},73569:t=>{t.exports="changedata"},15590:t=>{t.exports="changedata-"},37669:t=>{t.exports="destroy"},87090:t=>{t.exports="removedata"},90142:t=>{t.exports="setdata"},35026:(t,e,i)=>{t.exports={CHANGE_DATA:i(73569),CHANGE_DATA_KEY:i(15590),DESTROY:i(37669),REMOVE_DATA:i(87090),SET_DATA:i(90142)}},1999:(t,e,i)=>{t.exports={DataManager:i(81078),DataManagerPlugin:i(76508),Events:i(35026)}},10720:(t,e,i)=>{var s=i(1350),r={audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return r;r.audioData=!!window.Audio,r.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio"),e=!!t.canPlayType;try{if(e&&(t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,"")&&(r.ogg=!0),(t.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,"")||t.canPlayType("audio/opus;").replace(/^no$/,""))&&(r.opus=!0),t.canPlayType("audio/mpeg;").replace(/^no$/,"")&&(r.mp3=!0),t.canPlayType("audio/wav").replace(/^no$/,"")&&(r.wav=!0),(t.canPlayType("audio/x-m4a;")||t.canPlayType("audio/aac;").replace(/^no$/,""))&&(r.m4a=!0),t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")&&(r.webm=!0),""!==t.canPlayType('audio/mp4;codecs="ec-3"')))if(s.edge)r.dolby=!0;else if(s.safari&&s.safariVersion>=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var i=parseInt(RegExp.$1,10),n=parseInt(RegExp.$2,10);(10===i&&n>=11||i>10)&&(r.dolby=!0)}}catch(t){}return r}()},1350:(t,e,i)=>{var s,r=i(36580),n={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0};t.exports=(s=navigator.userAgent,/Edge\/\d+/.test(s)?n.edge=!0:/Chrome\/(\d+)/.test(s)&&!r.windowsPhone?(n.chrome=!0,n.chromeVersion=parseInt(RegExp.$1,10)):/Firefox\D+(\d+)/.test(s)?(n.firefox=!0,n.firefoxVersion=parseInt(RegExp.$1,10)):/AppleWebKit/.test(s)&&r.iOS?n.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(s)?(n.ie=!0,n.ieVersion=parseInt(RegExp.$1,10)):/Opera/.test(s)?n.opera=!0:/Safari/.test(s)&&!r.windowsPhone?n.safari=!0:/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(s)&&(n.ie=!0,n.trident=!0,n.tridentVersion=parseInt(RegExp.$1,10),n.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(s)&&(n.silk=!0),n)},98581:(t,e,i)=>{var s,r,n,a=i(61068),o={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=("function"!=typeof importScripts&&void 0!==document&&(o.supportNewBlendModes=(s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",r="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(n=new Image).onload=function(){var t=new Image;t.onload=function(){var e=a.create(t,6,1).getContext("2d");if(e.globalCompositeOperation="multiply",e.drawImage(n,0,0),e.drawImage(t,2,0),!e.getImageData(2,0,1,1))return!1;var i=e.getImageData(2,0,1,1).data;a.remove(t),o.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=s+"/wCKxvRF"+r},n.src=s+"AP804Oa6"+r,!1),o.supportInverseAlpha=function(){var t=a.create(this,2,1).getContext("2d");t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1);return i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3]}()),o)},90185:(t,e,i)=>{var s=i(36580),r=i(1350),n=i(61068),a={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){if("function"==typeof importScripts)return a;a.canvas=!!window.CanvasRenderingContext2D;try{a.localStorage=!!localStorage.getItem}catch(t){a.localStorage=!1}a.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),a.fileSystem=!!window.requestFileSystem;var t,e,i,o=!1;return a.webGL=function(){if(window.WebGLRenderingContext)try{var t=n.createWebGL(this),e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=n.create2D(this),s=i.getContext("2d").createImageData(1,1);return o=s.data instanceof Uint8ClampedArray,n.remove(t),n.remove(i),!!e}catch(t){return!1}return!1}(),a.worker=!!window.Worker,a.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,a.getUserMedia=a.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,r.firefox&&r.firefoxVersion<21&&(a.getUserMedia=!1),!s.iOS&&(r.ie||r.firefox||r.chrome)&&(a.canvasBitBltShift=!0),(r.safari||r.mobileSafari)&&(a.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(a.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(a.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),a.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==a.littleEndian&&o,a}()},33553:t=>{var e={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){if("function"==typeof importScripts)return e;var t,i="Fullscreen",s="FullScreen",r=["request"+i,"request"+s,"webkitRequest"+i,"webkitRequest"+s,"msRequest"+i,"msRequest"+s,"mozRequest"+s,"mozRequest"+i];for(t=0;t{var s=i(1350),r={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=("function"==typeof importScripts||(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(r.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(r.mspointer=!0),navigator.getGamepads&&(r.gamepads=!0),"onwheel"in window||s.ie&&"WheelEvent"in window?r.wheelEvent="wheel":"onmousewheel"in window?r.wheelEvent="mousewheel":s.firefox&&"MouseScrollEvent"in window&&(r.wheelEvent="DOMMouseScroll")),r)},36580:t=>{var e={android:!1,chromeOS:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};t.exports=function(){if("function"==typeof importScripts)return e;var t=navigator.userAgent;/Windows/.test(t)?e.windows=!0:/Mac OS/.test(t)&&!/like Mac OS/.test(t)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(e.iOS=!0,e.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),e.iOSVersion=parseInt(RegExp.$1,10)):e.macOS=!0:/Android/.test(t)?e.android=!0:/Linux/.test(t)?e.linux=!0:/iP[ao]d|iPhone/i.test(t)?(e.iOS=!0,navigator.appVersion.match(/OS (\d+)/),e.iOSVersion=parseInt(RegExp.$1,10),e.iPhone=-1!==t.toLowerCase().indexOf("iphone"),e.iPad=-1!==t.toLowerCase().indexOf("ipad")):/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?e.kindle=!0:/CrOS/.test(t)&&(e.chromeOS=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(e.android=!1,e.iOS=!1,e.macOS=!1,e.windows=!0,e.windowsPhone=!0);var i=/Silk/.test(t);return(e.windows||e.macOS||e.linux&&!i||e.chromeOS)&&(e.desktop=!0),(e.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(e.desktop=!1),navigator.standalone&&(e.webApp=!0),"function"!=typeof importScripts&&(void 0!==window.cordova&&(e.cordova=!0),void 0!==window.ejecta&&(e.ejecta=!0)),"undefined"!=typeof process&&process.versions&&process.versions.node&&(e.node=!0),e.node&&"object"==typeof process.versions&&(e.nodeWebkit=!!process.versions["node-webkit"],e.electron=!!process.versions.electron),/Crosswalk/.test(t)&&(e.crosswalk=!0),e.pixelRatio=window.devicePixelRatio||1,e}()},53861:t=>{var e={h264:!1,hls:!1,mp4:!1,ogg:!1,vp9:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return e;var t=document.createElement("video"),i=!!t.canPlayType;try{i&&(t.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,"")&&(e.ogg=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,"")&&(e.h264=!0,e.mp4=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")&&(e.webm=!0),t.canPlayType('video/webm; codecs="vp9"').replace(/^no$/,"")&&(e.vp9=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/,"")&&(e.hls=!0))}catch(t){}return e}()},77290:(t,e,i)=>{t.exports={os:i(36580),browser:i(1350),features:i(90185),input:i(95872),audio:i(10720),video:i(53861),fullscreen:i(33553),canvasFeatures:i(98581)}},65246:(t,e,i)=>{var s=new(i(56694))({initialize:function(){this._matrix=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],this.alpha=1,this._dirty=!0,this._data},set:function(t){return this._matrix=t,this._dirty=!0,this},reset:function(){var t=this._matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=1,t[13]=0,t[14]=0,t[15]=0,t[16]=0,t[17]=0,t[18]=1,t[19]=0,this._dirty=!0,this},getData:function(){if(this._dirty){var t=new Float32Array(this._matrix);t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,this._data=t,this._dirty=!1}return this._data},brightness:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t;return this.multiply([i,0,0,0,0,0,i,0,0,0,0,0,i,0,0,0,0,0,1,0],e)},saturate:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=2*t/3+1,s=-.5*(i-1);return this.multiply([i,s,s,0,0,s,i,s,0,0,s,s,i,0,0,0,0,0,1,0],e)},desaturate:function(t){return void 0===t&&(t=!1),this.saturate(-1,t)},hue:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1),t=t/180*Math.PI;var i=Math.cos(t),s=Math.sin(t),r=.213,n=.715,a=.072;return this.multiply([r+.787*i+s*-r,n+i*-n+s*-n,a+i*-a+.928*s,0,0,r+i*-r+.143*s,n+i*(1-n)+.14*s,a+i*-a+-.283*s,0,0,r+i*-r+-.787*s,n+i*-n+s*n,a+.928*i+s*a,0,0,0,0,0,1,0],e)},grayscale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=!1),this.saturate(-t,e)},blackWhite:function(t){return void 0===t&&(t=!1),this.multiply([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},contrast:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t+1,s=-.5*(i-1);return this.multiply([i,0,0,0,s,0,i,0,0,s,0,0,i,0,s,0,0,0,1,0],e)},negative:function(t){return void 0===t&&(t=!1),this.multiply([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},desaturateLuminance:function(t){return void 0===t&&(t=!1),this.multiply([.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0],t)},sepia:function(t){return void 0===t&&(t=!1),this.multiply([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},night:function(t,e){return void 0===t&&(t=.1),void 0===e&&(e=!1),this.multiply([-2*t,-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0],e)},lsd:function(t){return void 0===t&&(t=!1),this.multiply([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},brown:function(t){return void 0===t&&(t=!1),this.multiply([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},vintagePinhole:function(t){return void 0===t&&(t=!1),this.multiply([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},kodachrome:function(t){return void 0===t&&(t=!1),this.multiply([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],t)},technicolor:function(t){return void 0===t&&(t=!1),this.multiply([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],t)},polaroid:function(t){return void 0===t&&(t=!1),this.multiply([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},shiftToBGR:function(t){return void 0===t&&(t=!1),this.multiply([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},multiply:function(t,e){e||this.reset();for(var i=this._matrix,s=[],r=0;r<20;r++)s[r]=i[r];return i[0]=s[0]*t[0]+s[1]*t[5]+s[2]*t[10]+s[3]*t[15],i[1]=s[0]*t[1]+s[1]*t[6]+s[2]*t[11]+s[3]*t[16],i[2]=s[0]*t[2]+s[1]*t[7]+s[2]*t[12]+s[3]*t[17],i[3]=s[0]*t[3]+s[1]*t[8]+s[2]*t[13]+s[3]*t[18],i[4]=s[0]*t[4]+s[1]*t[9]+s[2]*t[14]+s[3]*t[19]+s[4],i[5]=s[5]*t[0]+s[6]*t[5]+s[7]*t[10]+s[8]*t[15],i[6]=s[5]*t[1]+s[6]*t[6]+s[7]*t[11]+s[8]*t[16],i[7]=s[5]*t[2]+s[6]*t[7]+s[7]*t[12]+s[8]*t[17],i[8]=s[5]*t[3]+s[6]*t[8]+s[7]*t[13]+s[8]*t[18],i[9]=s[5]*t[4]+s[6]*t[9]+s[7]*t[14]+s[8]*t[19]+s[9],i[10]=s[10]*t[0]+s[11]*t[5]+s[12]*t[10]+s[13]*t[15],i[11]=s[10]*t[1]+s[11]*t[6]+s[12]*t[11]+s[13]*t[16],i[12]=s[10]*t[2]+s[11]*t[7]+s[12]*t[12]+s[13]*t[17],i[13]=s[10]*t[3]+s[11]*t[8]+s[12]*t[13]+s[13]*t[18],i[14]=s[10]*t[4]+s[11]*t[9]+s[12]*t[14]+s[13]*t[19]+s[14],i[15]=s[15]*t[0]+s[16]*t[5]+s[17]*t[10]+s[18]*t[15],i[16]=s[15]*t[1]+s[16]*t[6]+s[17]*t[11]+s[18]*t[16],i[17]=s[15]*t[2]+s[16]*t[7]+s[17]*t[12]+s[18]*t[17],i[18]=s[15]*t[3]+s[16]*t[8]+s[17]*t[13]+s[18]*t[18],i[19]=s[15]*t[4]+s[16]*t[9]+s[17]*t[14]+s[18]*t[19]+s[19],this._dirty=!0,this}});t.exports=s},39298:(t,e,i)=>{var s=i(56694),r=i(72283),n=new s({initialize:function(t,e,i){this._rgb=[0,0,0],this.onChangeCallback=r,this.dirty=!1,this.set(t,e,i)},set:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this._rgb=[t,e,i],this.onChange(),this},equals:function(t,e,i){var s=this._rgb;return s.r===t&&s.g===e&&s.b===i},onChange:function(){this.dirty=!0;var t=this._rgb;this.onChangeCallback.call(this,t[0],t[1],t[2])},r:{get:function(){return this._rgb[0]},set:function(t){this._rgb[0]=t,this.onChange()}},g:{get:function(){return this._rgb[1]},set:function(t){this._rgb[1]=t,this.onChange()}},b:{get:function(){return this._rgb[2]},set:function(t){this._rgb[2]=t,this.onChange()}},destroy:function(){this.onChangeCallback=null}});t.exports=n},84093:t=>{t.exports={TOP_LEFT:0,TOP_CENTER:1,TOP_RIGHT:2,LEFT_TOP:3,LEFT_CENTER:4,LEFT_BOTTOM:5,CENTER:6,RIGHT_TOP:7,RIGHT_CENTER:8,RIGHT_BOTTOM:9,BOTTOM_LEFT:10,BOTTOM_CENTER:11,BOTTOM_RIGHT:12}},32058:(t,e,i)=>{var s=i(97328),r=i(59994),n=i(73174),a=i(28417);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)+i),n(t,s(e)+o),t}},85535:(t,e,i)=>{var s=i(97328),r=i(40163),n=i(73174),a=i(74465);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)-i),n(t,s(e)+o),t}},9605:(t,e,i)=>{var s=i(97328),r=i(70271),n=i(73174),a=i(19298);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)+i),n(t,s(e)+o),t}},22529:(t,e,i)=>{var s=i(21843),r=i(59994),n=i(29568);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),s(t,r(e)+i,n(e)+a),t}},5739:(t,e,i)=>{var s=i(29568),r=i(40163),n=i(81711),a=i(74465);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)-i),n(t,s(e)+o),t}},40327:(t,e,i)=>{var s=i(84093),r=[];r[s.BOTTOM_CENTER]=i(32058),r[s.BOTTOM_LEFT]=i(85535),r[s.BOTTOM_RIGHT]=i(9605),r[s.CENTER]=i(22529),r[s.LEFT_CENTER]=i(5739),r[s.RIGHT_CENTER]=i(27683),r[s.TOP_CENTER]=i(96439),r[s.TOP_LEFT]=i(81447),r[s.TOP_RIGHT]=i(47888),r[s.LEFT_BOTTOM]=r[s.BOTTOM_LEFT],r[s.LEFT_TOP]=r[s.TOP_LEFT],r[s.RIGHT_BOTTOM]=r[s.BOTTOM_RIGHT],r[s.RIGHT_TOP]=r[s.TOP_RIGHT];t.exports=function(t,e,i,s,n){return r[i](t,e,s,n)}},27683:(t,e,i)=>{var s=i(29568),r=i(70271),n=i(81711),a=i(19298);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)+i),n(t,s(e)+o),t}},96439:(t,e,i)=>{var s=i(59994),r=i(47196),n=i(28417),a=i(84349);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)+i),a(t,r(e)-o),t}},81447:(t,e,i)=>{var s=i(40163),r=i(47196),n=i(74465),a=i(84349);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)-i),a(t,r(e)-o),t}},47888:(t,e,i)=>{var s=i(70271),r=i(47196),n=i(19298),a=i(84349);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)+i),a(t,r(e)-o),t}},46997:(t,e,i)=>{t.exports={BottomCenter:i(32058),BottomLeft:i(85535),BottomRight:i(9605),Center:i(22529),LeftCenter:i(5739),QuickSet:i(40327),RightCenter:i(27683),TopCenter:i(96439),TopLeft:i(81447),TopRight:i(47888)}},93545:(t,e,i)=>{var s=i(84093),r=i(98611),n={In:i(46997),To:i(86639)};n=r(!1,n,s),t.exports=n},27118:(t,e,i)=>{var s=i(97328),r=i(59994),n=i(28417),a=i(84349);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,r(e)+i),a(t,s(e)+o),t}},84469:(t,e,i)=>{var s=i(97328),r=i(40163),n=i(74465),a=i(84349);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,r(e)-i),a(t,s(e)+o),t}},51577:(t,e,i)=>{var s=i(97328),r=i(70271),n=i(19298),a=i(84349);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,r(e)+i),a(t,s(e)+o),t}},90271:(t,e,i)=>{var s=i(97328),r=i(40163),n=i(73174),a=i(19298);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)-i),n(t,s(e)+o),t}},30466:(t,e,i)=>{var s=i(29568),r=i(40163),n=i(81711),a=i(19298);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)-i),n(t,s(e)+o),t}},50087:(t,e,i)=>{var s=i(40163),r=i(47196),n=i(19298),a=i(84349);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)-i),a(t,r(e)-o),t}},82590:(t,e,i)=>{var s=i(84093),r=[];r[s.BOTTOM_CENTER]=i(27118),r[s.BOTTOM_LEFT]=i(84469),r[s.BOTTOM_RIGHT]=i(51577),r[s.LEFT_BOTTOM]=i(90271),r[s.LEFT_CENTER]=i(30466),r[s.LEFT_TOP]=i(50087),r[s.RIGHT_BOTTOM]=i(13555),r[s.RIGHT_CENTER]=i(99049),r[s.RIGHT_TOP]=i(67788),r[s.TOP_CENTER]=i(78170),r[s.TOP_LEFT]=i(54145),r[s.TOP_RIGHT]=i(75548);t.exports=function(t,e,i,s,n){return r[i](t,e,s,n)}},13555:(t,e,i)=>{var s=i(97328),r=i(70271),n=i(73174),a=i(74465);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)+i),n(t,s(e)+o),t}},99049:(t,e,i)=>{var s=i(29568),r=i(70271),n=i(81711),a=i(74465);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)+i),n(t,s(e)+o),t}},67788:(t,e,i)=>{var s=i(70271),r=i(47196),n=i(74465),a=i(84349);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)+i),a(t,r(e)-o),t}},78170:(t,e,i)=>{var s=i(59994),r=i(47196),n=i(73174),a=i(28417);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)+i),n(t,r(e)-o),t}},54145:(t,e,i)=>{var s=i(40163),r=i(47196),n=i(73174),a=i(74465);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)-i),n(t,r(e)-o),t}},75548:(t,e,i)=>{var s=i(70271),r=i(47196),n=i(73174),a=i(19298);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)+i),n(t,r(e)-o),t}},86639:(t,e,i)=>{t.exports={BottomCenter:i(27118),BottomLeft:i(84469),BottomRight:i(51577),LeftBottom:i(90271),LeftCenter:i(30466),LeftTop:i(50087),QuickSet:i(82590),RightBottom:i(13555),RightCenter:i(99049),RightTop:i(67788),TopCenter:i(78170),TopLeft:i(54145),TopRight:i(75548)}},21843:(t,e,i)=>{var s=i(28417),r=i(81711);t.exports=function(t,e,i){return s(t,e),r(t,i)}},97328:t=>{t.exports=function(t){return t.y+t.height-t.height*t.originY}},7126:(t,e,i)=>{var s=i(97328),r=i(40163),n=i(70271),a=i(47196);t.exports=function(t,e){void 0===e&&(e={});var i=r(t),o=a(t);return e.x=i,e.y=o,e.width=n(t)-i,e.height=s(t)-o,e}},59994:t=>{t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},29568:t=>{t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},40163:t=>{t.exports=function(t){return t.x-t.width*t.originX}},52088:t=>{t.exports=function(t){return t.width*t.originX}},23379:t=>{t.exports=function(t){return t.height*t.originY}},70271:t=>{t.exports=function(t){return t.x+t.width-t.width*t.originX}},47196:t=>{t.exports=function(t){return t.y-t.height*t.originY}},73174:t=>{t.exports=function(t,e){return t.y=e-t.height+t.height*t.originY,t}},28417:t=>{t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},81711:t=>{t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},74465:t=>{t.exports=function(t,e){return t.x=e+t.width*t.originX,t}},19298:t=>{t.exports=function(t,e){return t.x=e-t.width+t.width*t.originX,t}},84349:t=>{t.exports=function(t,e){return t.y=e+t.height*t.originY,t}},15252:(t,e,i)=>{t.exports={CenterOn:i(21843),GetBottom:i(97328),GetBounds:i(7126),GetCenterX:i(59994),GetCenterY:i(29568),GetLeft:i(40163),GetOffsetX:i(52088),GetOffsetY:i(23379),GetRight:i(70271),GetTop:i(47196),SetBottom:i(73174),SetCenterX:i(28417),SetCenterY:i(81711),SetLeft:i(74465),SetRight:i(19298),SetTop:i(84349)}},70616:t=>{t.exports={setCrisp:function(t){return["optimizeSpeed","-moz-crisp-edges","-o-crisp-edges","-webkit-optimize-contrast","optimize-contrast","crisp-edges","pixelated"].forEach((function(e){t.style["image-rendering"]=e})),t.style.msInterpolationMode="nearest-neighbor",t},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},61068:(t,e,i)=>{var s,r,n,a=i(86459),o=i(8213),h=[],l=!1;t.exports=(n=function(){var t=0;return h.forEach((function(e){e.parent&&t++})),t},{create2D:function(t,e,i){return s(t,e,i,a.CANVAS)},create:s=function(t,e,i,s,n){var u;void 0===e&&(e=1),void 0===i&&(i=1),void 0===s&&(s=a.CANVAS),void 0===n&&(n=!1);var c=r(s);return null===c?(c={parent:t,canvas:document.createElement("canvas"),type:s},s===a.CANVAS&&h.push(c),u=c.canvas):(c.parent=t,u=c.canvas),n&&(c.parent=u),u.width=e,u.height=i,l&&s===a.CANVAS&&o.disable(u.getContext("2d")),u},createWebGL:function(t,e,i){return s(t,e,i,a.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:r=function(t){if(void 0===t&&(t=a.CANVAS),t===a.WEBGL)return null;for(var e=0;e{var e,i="";t.exports={disable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!1),t},enable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!0),t},getPrefix:e=function(t){for(var e=["i","webkitI","msI","mozI","oI"],i=0;i{t.exports=function(t,e){return void 0===e&&(e="none"),t.style.msTouchAction=e,t.style["ms-touch-action"]=e,t.style["touch-action"]=e,t}},36505:t=>{t.exports=function(t,e){void 0===e&&(e="none");return["-webkit-","-khtml-","-moz-","-ms-",""].forEach((function(i){t.style[i+"user-select"]=e})),t.style["-webkit-touch-callout"]=e,t.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",t}},23514:(t,e,i)=>{t.exports={CanvasInterpolation:i(70616),CanvasPool:i(61068),Smoothing:i(8213),TouchAction:i(59271),UserSelect:i(36505)}},27119:(t,e,i)=>{var s=i(56694),r=i(22946),n=i(5657),a=i(24650),o=i(68033),h=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=255),this.r=0,this.g=0,this.b=0,this.a=255,this._h=0,this._s=0,this._v=0,this._locked=!1,this.gl=[0,0,0,1],this._color=0,this._color32=0,this._rgba="",this.setTo(t,e,i,s)},transparent:function(){return this._locked=!0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this._locked=!1,this.update(!0)},setTo:function(t,e,i,s,r){return void 0===s&&(s=255),void 0===r&&(r=!0),this._locked=!0,this.red=t,this.green=e,this.blue=i,this.alpha=s,this._locked=!1,this.update(r)},setGLTo:function(t,e,i,s){return void 0===s&&(s=1),this._locked=!0,this.redGL=t,this.greenGL=e,this.blueGL=i,this.alphaGL=s,this._locked=!1,this.update(!0)},setFromRGB:function(t){return this._locked=!0,this.red=t.r,this.green=t.g,this.blue=t.b,t.hasOwnProperty("a")&&(this.alpha=t.a),this._locked=!1,this.update(!0)},setFromHSV:function(t,e,i){return a(t,e,i,this)},update:function(t){if(void 0===t&&(t=!1),this._locked)return this;var e=this.r,i=this.g,s=this.b,a=this.a;return this._color=r(e,i,s),this._color32=n(e,i,s,a),this._rgba="rgba("+e+","+i+","+s+","+a/255+")",t&&o(e,i,s,this),this},updateHSV:function(){var t=this.r,e=this.g,i=this.b;return o(t,e,i,this),this},clone:function(){return new h(this.r,this.g,this.b,this.a)},gray:function(t){return this.setTo(t,t,t)},random:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t)),s=Math.floor(t+Math.random()*(e-t)),r=Math.floor(t+Math.random()*(e-t));return this.setTo(i,s,r)},randomGray:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t));return this.setTo(i,i,i)},saturate:function(t){return this.s+=t/100,this},desaturate:function(t){return this.s-=t/100,this},lighten:function(t){return this.v+=t/100,this},darken:function(t){return this.v-=t/100,this},brighten:function(t){var e=this.r,i=this.g,s=this.b;return e=Math.max(0,Math.min(255,e-Math.round(-t/100*255))),i=Math.max(0,Math.min(255,i-Math.round(-t/100*255))),s=Math.max(0,Math.min(255,s-Math.round(-t/100*255))),this.setTo(e,i,s)},color:{get:function(){return this._color}},color32:{get:function(){return this._color32}},rgba:{get:function(){return this._rgba}},redGL:{get:function(){return this.gl[0]},set:function(t){this.gl[0]=Math.min(Math.abs(t),1),this.r=Math.floor(255*this.gl[0]),this.update(!0)}},greenGL:{get:function(){return this.gl[1]},set:function(t){this.gl[1]=Math.min(Math.abs(t),1),this.g=Math.floor(255*this.gl[1]),this.update(!0)}},blueGL:{get:function(){return this.gl[2]},set:function(t){this.gl[2]=Math.min(Math.abs(t),1),this.b=Math.floor(255*this.gl[2]),this.update(!0)}},alphaGL:{get:function(){return this.gl[3]},set:function(t){this.gl[3]=Math.min(Math.abs(t),1),this.a=Math.floor(255*this.gl[3]),this.update()}},red:{get:function(){return this.r},set:function(t){t=Math.floor(Math.abs(t)),this.r=Math.min(t,255),this.gl[0]=t/255,this.update(!0)}},green:{get:function(){return this.g},set:function(t){t=Math.floor(Math.abs(t)),this.g=Math.min(t,255),this.gl[1]=t/255,this.update(!0)}},blue:{get:function(){return this.b},set:function(t){t=Math.floor(Math.abs(t)),this.b=Math.min(t,255),this.gl[2]=t/255,this.update(!0)}},alpha:{get:function(){return this.a},set:function(t){t=Math.floor(Math.abs(t)),this.a=Math.min(t,255),this.gl[3]=t/255,this.update()}},h:{get:function(){return this._h},set:function(t){this._h=t,a(t,this._s,this._v,this)}},s:{get:function(){return this._s},set:function(t){this._s=t,a(this._h,t,this._v,this)}},v:{get:function(){return this._v},set:function(t){this._v=t,a(this._h,this._s,t,this)}}});t.exports=h},30245:(t,e,i)=>{var s=i(22946);t.exports=function(t){void 0===t&&(t=1024);var e,i=[],r=255,n=255,a=0,o=0;for(e=0;e<=r;e++)i.push({r:n,g:e,b:o,color:s(n,e,o)});for(a=255,e=r;e>=0;e--)i.push({r:e,g:a,b:o,color:s(e,a,o)});for(n=0,e=0;e<=r;e++,a--)i.push({r:n,g:a,b:e,color:s(n,a,e)});for(a=0,o=255,e=0;e<=r;e++,o--,n++)i.push({r:n,g:a,b:o,color:s(n,a,o)});if(1024===t)return i;var h=[],l=0,u=1024/t;for(e=0;e{t.exports=function(t){var e={r:t>>16&255,g:t>>8&255,b:255&t,a:255};return t>16777215&&(e.a=t>>>24),e}},25409:t=>{t.exports=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e}},22946:t=>{t.exports=function(t,e,i){return t<<16|e<<8|i}},5657:t=>{t.exports=function(t,e,i,s){return s<<24|t<<16|e<<8|i}},74777:(t,e,i)=>{var s=i(27119),r=i(59998);t.exports=function(t,e,i){var n=i,a=i,o=i;if(0!==e){var h=i<.5?i*(1+e):i+e-i*e,l=2*i-h;n=r(l,h,t+1/3),a=r(l,h,t),o=r(l,h,t-1/3)}return(new s).setGLTo(n,a,o,1)}},89263:(t,e,i)=>{var s=i(24650);t.exports=function(t,e){void 0===t&&(t=1),void 0===e&&(e=1);for(var i=[],r=0;r<=359;r++)i.push(s(r/359,t,e));return i}},24650:(t,e,i)=>{var s=i(22946);function r(t,e,i,s){var r=(t+6*e)%6,n=Math.min(r,4-r,1);return Math.round(255*(s-s*i*Math.max(0,n)))}t.exports=function(t,e,i,n){void 0===e&&(e=1),void 0===i&&(i=1);var a=r(5,t,e,i),o=r(3,t,e,i),h=r(1,t,e,i);return n?n.setTo?n.setTo(a,o,h,n.alpha,!1):(n.r=a,n.g=o,n.b=h,n.color=s(a,o,h),n):{r:a,g:o,b:h,color:s(a,o,h)}}},91487:(t,e,i)=>{var s=i(27119);t.exports=function(t){var e=new s;t=t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,i,s){return e+e+i+i+s+s}));var i=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(i){var r=parseInt(i[1],16),n=parseInt(i[2],16),a=parseInt(i[3],16);e.setTo(r,n,a)}return e}},59998:t=>{t.exports=function(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}},74853:(t,e,i)=>{var s=i(27119),r=i(15978);t.exports=function(t){var e=r(t);return new s(e.r,e.g,e.b,e.a)}},15978:t=>{t.exports=function(t){return t>16777215?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},53756:(t,e,i)=>{var s=i(42798),r=function(t,e,i,r,n,a,o,h){void 0===o&&(o=100),void 0===h&&(h=0);var l=h/o;return{r:s(t,r,l),g:s(e,n,l),b:s(i,a,l)}};t.exports={RGBWithRGB:r,ColorWithRGB:function(t,e,i,s,n,a){return void 0===n&&(n=100),void 0===a&&(a=0),r(t.r,t.g,t.b,e,i,s,n,a)},ColorWithColor:function(t,e,i,s){return void 0===i&&(i=100),void 0===s&&(s=0),r(t.r,t.g,t.b,e.r,e.g,e.b,i,s)}}},73904:(t,e,i)=>{var s=i(27119);t.exports=function(t){return new s(t.r,t.g,t.b,t.a)}},26841:(t,e,i)=>{var s=i(27119);t.exports=function(t){var e=new s,i=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(t.toLowerCase());if(i){var r=parseInt(i[1],10),n=parseInt(i[2],10),a=parseInt(i[3],10),o=void 0!==i[4]?parseFloat(i[4]):1;e.setTo(r,n,a,255*o)}return e}},68033:t=>{t.exports=function(t,e,i,s){void 0===s&&(s={h:0,s:0,v:0}),t/=255,e/=255,i/=255;var r=Math.min(t,e,i),n=Math.max(t,e,i),a=n-r,o=0,h=0===n?0:a/n,l=n;return n!==r&&(n===t?o=(e-i)/a+(e{var s=i(25409);t.exports=function(t,e,i,r,n){return void 0===r&&(r=255),void 0===n&&(n="#"),"#"===n?"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1,7):"0x"+s(r)+s(t)+s(e)+s(i)}},37243:(t,e,i)=>{var s=i(17489),r=i(27119);t.exports=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=255),new r(s(t,e),s(t,e),s(t,e))}},93222:(t,e,i)=>{var s=i(91487),r=i(74853),n=i(73904),a=i(26841);t.exports=function(t){switch(typeof t){case"string":return"rgb"===t.substr(0,3).toLowerCase()?a(t):s(t);case"number":return r(t);case"object":return n(t)}}},95509:(t,e,i)=>{var s=i(27119);s.ColorSpectrum=i(30245),s.ColorToRGBA=i(86672),s.ComponentToHex=i(25409),s.GetColor=i(22946),s.GetColor32=i(5657),s.HexStringToColor=i(91487),s.HSLToColor=i(74777),s.HSVColorWheel=i(89263),s.HSVToRGB=i(24650),s.HueToComponent=i(59998),s.IntegerToColor=i(74853),s.IntegerToRGB=i(15978),s.Interpolate=i(53756),s.ObjectToColor=i(73904),s.RandomRGB=i(37243),s.RGBStringToColor=i(26841),s.RGBToHSV=i(68033),s.RGBToString=i(4880),s.ValueToColor=i(93222),t.exports=s},24816:(t,e,i)=>{t.exports={Align:i(93545),BaseShader:i(31053),Bounds:i(15252),Canvas:i(23514),Color:i(95509),ColorMatrix:i(65246),Masks:i(93310),RGB:i(39298)}},76756:(t,e,i)=>{var s=i(56694),r=i(97081),n=i(81044),a=new s({initialize:function(t,e){var i=t.sys.renderer;this.renderer=i,this.bitmapMask=e,this.maskTexture=null,this.mainTexture=null,this.dirty=!0,this.mainFramebuffer=null,this.maskFramebuffer=null,this.invertAlpha=!1,this.isStencil=!1,this.scene=t,this.createMask(),t.sys.game.events.on(r.CONTEXT_RESTORED,this.createMask,this),i&&i.on(n.RESIZE,this.createMask,this)},createMask:function(){var t=this.renderer;if(t&&t.gl){this.mainTexture&&this.clearMask();var e=t.width,i=t.height,s=0==(e&e-1)&&0==(i&i-1),r=t.gl,n=s?r.REPEAT:r.CLAMP_TO_EDGE,a=r.LINEAR;this.mainTexture=t.createTexture2D(0,a,a,n,n,r.RGBA,null,e,i),this.maskTexture=t.createTexture2D(0,a,a,n,n,r.RGBA,null,e,i),this.mainFramebuffer=t.createFramebuffer(e,i,this.mainTexture,!0),this.maskFramebuffer=t.createFramebuffer(e,i,this.maskTexture,!0)}},clearMask:function(){var t=this.renderer;t&&t.gl&&this.mainTexture&&(t.deleteTexture(this.mainTexture),t.deleteTexture(this.maskTexture),t.deleteFramebuffer(this.mainFramebuffer),t.deleteFramebuffer(this.maskFramebuffer),this.mainTexture=null,this.maskTexture=null,this.mainFramebuffer=null,this.maskFramebuffer=null)},setBitmap:function(t){this.bitmapMask=t},preRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.beginMask(this,e,i)},postRenderWebGL:function(t,e){t.pipelines.BITMAPMASK_PIPELINE.endMask(this,e)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.clearMask(),this.scene.sys.game.events.off(r.CONTEXT_RESTORED,this.createMask,this),this.renderer&&this.renderer.off(n.RESIZE,this.createMask,this),this.bitmapMask=null,this.prevFramebuffer=null,this.renderer=null}});t.exports=a},63037:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e){this.geometryMask=e,this.invertAlpha=!1,this.isStencil=!0,this.level=0},setShape:function(t){return this.geometryMask=t,this},setInvertAlpha:function(t){return void 0===t&&(t=!0),this.invertAlpha=t,this},preRenderWebGL:function(t,e,i){var s=t.gl;t.flush(),0===t.maskStack.length&&(s.enable(s.STENCIL_TEST),s.clear(s.STENCIL_BUFFER_BIT),t.maskCount=0),t.currentCameraMask.mask!==this&&(t.currentMask.mask=this),t.maskStack.push({mask:this,camera:i}),this.applyStencil(t,i,!0),t.maskCount++},applyStencil:function(t,e,i){var s=t.gl,r=this.geometryMask,n=t.maskCount;s.colorMask(!1,!1,!1,!1),i?(s.stencilFunc(s.EQUAL,n,255),s.stencilOp(s.KEEP,s.KEEP,s.INCR)):(s.stencilFunc(s.EQUAL,n+1,255),s.stencilOp(s.KEEP,s.KEEP,s.DECR)),r.renderWebGL(t,r,e),t.flush(),s.colorMask(!0,!0,!0,!0),s.stencilOp(s.KEEP,s.KEEP,s.KEEP),i?this.invertAlpha?s.stencilFunc(s.NOTEQUAL,n+1,255):s.stencilFunc(s.EQUAL,n+1,255):this.invertAlpha?s.stencilFunc(s.NOTEQUAL,n,255):s.stencilFunc(s.EQUAL,n,255)},postRenderWebGL:function(t){var e=t.gl;t.maskStack.pop(),t.maskCount--,t.flush();var i=t.currentMask;if(0===t.maskStack.length)i.mask=null,e.disable(e.STENCIL_TEST);else{var s=t.maskStack[t.maskStack.length-1];s.mask.applyStencil(t,s.camera,!1),t.currentCameraMask.mask!==s.mask?(i.mask=s.mask,i.camera=s.camera):i.mask=null}},preRenderCanvas:function(t,e,i){var s=this.geometryMask;t.currentContext.save(),s.renderCanvas(t,s,i,null,null,!0),t.currentContext.clip()},postRenderCanvas:function(t){t.currentContext.restore()},destroy:function(){this.geometryMask=null}});t.exports=s},93310:(t,e,i)=>{t.exports={BitmapMask:i(76756),GeometryMask:i(63037)}},31053:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s){e&&""!==e||(e=["precision mediump float;","uniform vec2 resolution;","varying vec2 fragCoord;","void main () {"," vec2 uv = fragCoord / resolution.xy;"," gl_FragColor = vec4(uv.xyx, 1.0);","}"].join("\n")),i&&""!==i||(i=["precision mediump float;","uniform mat4 uProjectionMatrix;","uniform mat4 uViewMatrix;","uniform vec2 uResolution;","attribute vec2 inPosition;","varying vec2 fragCoord;","varying vec2 outTexCoord;","void main () {"," gl_Position = uProjectionMatrix * uViewMatrix * vec4(inPosition, 1.0, 1.0);"," fragCoord = vec2(inPosition.x, uResolution.y - inPosition.y);"," outTexCoord = vec2(inPosition.x / uResolution.x, fragCoord.y / uResolution.y);","}"].join("\n")),void 0===s&&(s=null),this.key=t,this.fragmentSrc=e,this.vertexSrc=i,this.uniforms=s}});t.exports=s},99584:t=>{t.exports=function(t,e){var i;if(e)"string"==typeof e?i=document.getElementById(e):"object"==typeof e&&1===e.nodeType&&(i=e);else if(t.parentElement||null===e)return t;return i||(i=document.body),i.appendChild(t),t}},85178:(t,e,i)=>{var s=i(99584);t.exports=function(t){var e=t.config;if(e.parent&&e.domCreateContainer){var i=document.createElement("div");i.style.cssText=["display: block;","width: "+t.scale.width+"px;","height: "+t.scale.height+"px;","padding: 0; margin: 0;","position: absolute;","overflow: hidden;","pointer-events: "+e.domPointerEvents+";","transform: scale(1);","transform-origin: left top;"].join(" "),t.domContainer=i,s(i,e.parent)}}},21546:(t,e,i)=>{var s=i(36580);t.exports=function(t){if("complete"!==document.readyState&&"interactive"!==document.readyState){var e=function(){document.removeEventListener("deviceready",e,!0),document.removeEventListener("DOMContentLoaded",e,!0),window.removeEventListener("load",e,!0),t()};document.body?s.cordova?document.addEventListener("deviceready",e,!1):(document.addEventListener("DOMContentLoaded",e,!0),window.addEventListener("load",e,!0)):window.setTimeout(e,20)}else t()}},74181:t=>{t.exports=function(t){if(!t)return window.innerHeight;var e=Math.abs(window.orientation),i={w:0,h:0},s=document.createElement("div");return s.setAttribute("style","position: fixed; height: 100vh; width: 0; top: 0"),document.documentElement.appendChild(s),i.w=90===e?s.offsetHeight:window.innerWidth,i.h=90===e?window.innerWidth:s.offsetHeight,document.documentElement.removeChild(s),s=null,90!==Math.abs(window.orientation)?i.h:i.w}},9229:(t,e,i)=>{var s=i(55301);t.exports=function(t,e){var i=window.screen,r=!!i&&(i.orientation||i.mozOrientation||i.msOrientation);return r&&"string"==typeof r.type?r.type:"string"==typeof r?r:"number"==typeof window.orientation?0===window.orientation||180===window.orientation?s.ORIENTATION.PORTRAIT:s.ORIENTATION.LANDSCAPE:window.matchMedia?window.matchMedia("(orientation: portrait)").matches?s.ORIENTATION.PORTRAIT:window.matchMedia("(orientation: landscape)").matches?s.ORIENTATION.LANDSCAPE:void 0:e>t?s.ORIENTATION.PORTRAIT:s.ORIENTATION.LANDSCAPE}},2893:t=>{t.exports=function(t){var e;return""!==t&&("string"==typeof t?e=document.getElementById(t):t&&1===t.nodeType&&(e=t)),e||(e=document.body),e}},89200:t=>{t.exports=function(t){var e="";try{if(window.DOMParser)e=(new DOMParser).parseFromString(t,"text/xml");else(e=new ActiveXObject("Microsoft.XMLDOM")).loadXML(t)}catch(t){e=null}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length?e:null}},55638:t=>{t.exports=function(t){t.parentNode&&t.parentNode.removeChild(t)}},27385:(t,e,i)=>{var s=i(56694),r=i(72283),n=new s({initialize:function(){this.isRunning=!1,this.callback=r,this.tick=0,this.isSetTimeOut=!1,this.timeOutID=null,this.lastTime=0,this.target=0;var t=this;this.step=function e(){var i=window.performance.now();t.lastTime=t.tick,t.tick=i,t.callback(i),t.timeOutID=window.requestAnimationFrame(e)},this.stepTimeout=function e(){var i=Date.now(),s=Math.min(Math.max(2*t.target+t.tick-i,0),t.target);t.lastTime=t.tick,t.tick=i,t.callback(i),t.timeOutID=window.setTimeout(e,s)}},start:function(t,e,i){this.isRunning||(this.callback=t,this.isSetTimeOut=e,this.target=i,this.isRunning=!0,this.timeOutID=e?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=r}});t.exports=n},3590:(t,e,i)=>{var s={AddToDOM:i(99584),DOMContentLoaded:i(21546),GetInnerHeight:i(74181),GetScreenOrientation:i(9229),GetTarget:i(2893),ParseXML:i(89200),RemoveFromDOM:i(55638),RequestAnimationFrame:i(27385)};t.exports=s},78491:(t,e,i)=>{var s=i(56694),r=i(6659),n=i(91963),a=new s({Extends:r,initialize:function(){r.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});n.register("EventEmitter",a,"events"),t.exports=a},95146:(t,e,i)=>{t.exports={EventEmitter:i(78491)}},88933:(t,e,i)=>{var s=i(95723),r=i(20494);t.exports=function(t,e,i){e.x=r(i,"x",0),e.y=r(i,"y",0),e.depth=r(i,"depth",0),e.flipX=r(i,"flipX",!1),e.flipY=r(i,"flipY",!1);var n=r(i,"scale",null);"number"==typeof n?e.setScale(n):null!==n&&(e.scaleX=r(n,"x",1),e.scaleY=r(n,"y",1));var a=r(i,"scrollFactor",null);"number"==typeof a?e.setScrollFactor(a):null!==a&&(e.scrollFactorX=r(a,"x",1),e.scrollFactorY=r(a,"y",1)),e.rotation=r(i,"rotation",0);var o=r(i,"angle",null);null!==o&&(e.angle=o),e.alpha=r(i,"alpha",1);var h=r(i,"origin",null);if("number"==typeof h)e.setOrigin(h);else if(null!==h){var l=r(h,"x",.5),u=r(h,"y",.5);e.setOrigin(l,u)}return e.blendMode=r(i,"blendMode",s.NORMAL),e.visible=r(i,"visible",!0),r(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},32291:(t,e,i)=>{var s=i(20494);t.exports=function(t,e){var i=s(e,"anims",null);if(null===i)return t;if("string"==typeof i)t.anims.play(i);else if("object"==typeof i){var r=t.anims,n=s(i,"key",void 0);if(n){var a=s(i,"startFrame",void 0),o=s(i,"delay",0),h=s(i,"repeat",0),l=s(i,"repeatDelay",0),u=s(i,"yoyo",!1),c=s(i,"play",!1),d=s(i,"delayedPlay",0),f={key:n,delay:o,repeat:h,repeatDelay:l,yoyo:u,startFrame:a};c?r.play(f):d>0?r.playAfterDelay(f,d):r.load(f)}}return t}},91713:(t,e,i)=>{var s=i(56694),r=i(71207),n=i(91963),a=i(56631),o=i(7599),h=i(17922),l=new s({Extends:r,initialize:function(t){r.call(this,t),this.sortChildrenFlag=!1,this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.events.once(o.BOOT,this.boot,this),this.events.on(o.START,this.start,this)},boot:function(){this.events.once(o.DESTROY,this.destroy,this)},addChildCallback:function(t){t.displayList&&t.displayList!==this&&t.removeFromDisplayList(),t.displayList||(this.queueDepthSort(),t.displayList=this,t.emit(a.ADDED_TO_SCENE,t,this.scene),this.events.emit(o.ADDED_TO_SCENE,t,this.scene))},removeChildCallback:function(t){this.queueDepthSort(),t.displayList=null,t.emit(a.REMOVED_FROM_SCENE,t,this.scene),this.events.emit(o.REMOVED_FROM_SCENE,t,this.scene)},start:function(){this.events.once(o.SHUTDOWN,this.shutdown,this)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(h(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},getChildren:function(){return this.list},shutdown:function(){for(var t=this.list,e=t.length;e--;)t[e].destroy(!0);t.length=0,this.events.off(o.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(o.START,this.start,this),this.scene=null,this.systems=null,this.events=null}});n.register("DisplayList",l,"displayList"),t.exports=l},89980:(t,e,i)=>{var s=i(56694),r=i(48129),n=i(81078),a=i(6659),o=i(56631),h=i(7599),l=new s({Extends:a,initialize:function(t,e){a.call(this),this.scene=t,this.displayList=null,this.type=e,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.on(o.ADDED_TO_SCENE,this.addedToScene,this),this.on(o.REMOVED_FROM_SCENE,this.removedFromScene,this),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new n(this)),this},setData:function(t,e){return this.data||(this.data=new n(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new n(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new n(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new n(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(){return this.input&&(this.input.enabled=!1),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return r(this)},willRender:function(t){return!(l.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return this.displayList?i.unshift(this.displayList.getIndex(t)):i.unshift(this.scene.sys.displayList.getIndex(t)),i},addToDisplayList:function(t){return void 0===t&&(t=this.scene.sys.displayList),this.displayList&&this.displayList!==t&&this.removeFromDisplayList(),t.exists(this)||(this.displayList=t,t.add(this,!0),t.queueDepthSort(),this.emit(o.ADDED_TO_SCENE,this,this.scene),t.events.emit(h.ADDED_TO_SCENE,this,this.scene)),this},addToUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.add(this),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(o.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(h.REMOVED_FROM_SCENE,this,this.scene)),this},removeFromUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.remove(this),this},destroy:function(t){this.scene&&!this.ignoreDestroy&&(void 0===t&&(t=!1),this.preDestroy&&this.preDestroy.call(this),this.emit(o.DESTROY,this,t),this.removeAllListeners(),this.postPipelines&&this.resetPostPipeline(!0),this.removeFromDisplayList(),this.removeFromUpdateList(),this.input&&(this.scene.sys.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0)}});l.RENDER_MASK=15,t.exports=l},99325:(t,e,i)=>{var s=i(56694),r=i(91963),n=i(7599),a=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(n.BOOT,this.boot,this),this.events.on(n.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(n.DESTROY,this.destroy,this)},start:function(){this.events.once(n.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.events.off(n.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(n.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(t,e){a.prototype.hasOwnProperty(t)||(a.prototype[t]=e)},a.remove=function(t){a.prototype.hasOwnProperty(t)&&delete a.prototype[t]},r.register("GameObjectCreator",a,"make"),t.exports=a},61286:(t,e,i)=>{var s=i(56694),r=i(91963),n=i(7599),a=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(n.BOOT,this.boot,this),this.events.on(n.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(n.DESTROY,this.destroy,this)},start:function(){this.events.once(n.SHUTDOWN,this.shutdown,this)},existing:function(t){return(t.renderCanvas||t.renderWebGL)&&this.displayList.add(t),t.preUpdate&&this.updateList.add(t),t},shutdown:function(){this.events.off(n.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(n.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(t,e){a.prototype.hasOwnProperty(t)||(a.prototype[t]=e)},a.remove=function(t){a.prototype.hasOwnProperty(t)&&delete a.prototype[t]},r.register("GameObjectFactory",a,"add"),t.exports=a},73329:(t,e,i)=>{var s=i(69360),r=new s,n=new s,a=new s,o={camera:r,sprite:n,calc:a};t.exports=function(t,e,i){var s=r,h=n,l=a;return h.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),s.copyFrom(e.matrix),i?(s.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),h.e=t.x,h.f=t.y):(h.e-=e.scrollX*t.scrollFactorX,h.f-=e.scrollY*t.scrollFactorY),s.multiply(h,l),o}},92034:(t,e,i)=>{var s=i(56694),r=i(74623),n=i(91963),a=i(7599),o=new s({Extends:r,initialize:function(t){r.call(this),this.checkQueue=!0,this.scene=t,this.systems=t.sys,t.sys.events.once(a.BOOT,this.boot,this),t.sys.events.on(a.START,this.start,this)},boot:function(){this.systems.events.once(a.DESTROY,this.destroy,this)},start:function(){var t=this.systems.events;t.on(a.PRE_UPDATE,this.update,this),t.on(a.UPDATE,this.sceneUpdate,this),t.once(a.SHUTDOWN,this.shutdown,this)},sceneUpdate:function(t,e){for(var i=this._active,s=i.length,r=0;r{t.exports=function(t,e,i,s,r,n,a,o,h,l,u,c,d,f,p){var v=i.x-e.displayOriginX+r,g=i.y-e.displayOriginY+n,m=v+i.w,y=g+i.h,x=a.getXRound(v,g,o),T=a.getYRound(v,g,o),w=a.getXRound(v,y,o),E=a.getYRound(v,y,o),b=a.getXRound(m,y,o),S=a.getYRound(m,y,o),A=a.getXRound(m,g,o),_=a.getYRound(m,g,o);t.batchQuad(e,x,T,w,E,b,S,A,_,s.u0,s.v0,s.u1,s.v1,h,l,u,c,d,f,p)}},82173:t=>{t.exports=function(t,e,i,s){if(void 0===i&&(i=!1),void 0===s)return s={local:{x:0,y:0,width:0,height:0},global:{x:0,y:0,width:0,height:0},lines:{shortest:0,longest:0,lengths:null,height:0},wrappedText:"",words:[],characters:[],scaleX:0,scaleY:0};var r,n,a,o,h=t.text,l=h.length,u=t.maxWidth,c=t.wordWrapCharCode,d=Number.MAX_VALUE,f=Number.MAX_VALUE,p=0,v=0,g=t.fontData.chars,m=t.fontData.lineHeight,y=t.letterSpacing,x=0,T=0,w=0,E=null,b=t._align,S=0,A=0,_=t.fontSize/t.fontData.size,C=_*t.scaleX,R=_*t.scaleY,M=null,P=0,O=[],L=Number.MAX_VALUE,F=0,D=0,k=0,I=[],B=[],N=null;if(u>0){for(r=0;ru||V-U>u?(z.push(G.i-1),G.cr?(z.push(G.i+G.word.length),U=0,X=null):X=G):G.cr&&(z.push(G.i+G.word.length),U=0,X=null)}for(r=z.length-1;r>=0;r--)n=h,a=z[r],o="\n",h=n.substr(0,a)+o+n.substr(a+1);s.wrappedText=h,l=h.length,I=[],N=null}var H=0;for(r=0;rS&&(d=S),f>A&&(f=A);var K=S+E.xAdvance,q=A+m;pF&&(F=k),kF&&(F=k),k0)for(var J=0;J{var s=i(31476);t.exports=function(t,e,i,r,n,a,o){var h=t.sys.textures.get(i),l=h.get(r),u=t.sys.cache.xml.get(n);if(l&&u){var c=s(u,l,a,o,h);return t.sys.cache.bitmapFont.add(e,{data:c,texture:i,frame:r,fromAtlas:!0}),!0}return!1}},39860:(t,e,i)=>{var s=i(10850);t.exports=function(t,e){var i=e.width,r=e.height,n=Math.floor(i/2),a=Math.floor(r/2),o=s(e,"chars","");if(""!==o){var h=s(e,"image",""),l=t.sys.textures.getFrame(h),u=l.cutX,c=l.cutY,d=l.source.width,f=l.source.height,p=s(e,"offset.x",0),v=s(e,"offset.y",0),g=s(e,"spacing.x",0),m=s(e,"spacing.y",0),y=s(e,"lineSpacing",0),x=s(e,"charsPerRow",null);null===x&&(x=d/i)>o.length&&(x=o.length);for(var T=p,w=v,E={retroFont:!0,font:h,size:i,lineHeight:r+y,chars:{}},b=0,S=0;S{function e(t,e){return parseInt(t.getAttribute(e),10)}t.exports=function(t,i,s,r,n){void 0===s&&(s=0),void 0===r&&(r=0);var a=i.cutX,o=i.cutY,h=i.source.width,l=i.source.height,u=i.sourceIndex,c={},d=t.getElementsByTagName("info")[0],f=t.getElementsByTagName("common")[0];c.font=d.getAttribute("face"),c.size=e(d,"size"),c.lineHeight=e(f,"lineHeight")+r,c.chars={};var p=t.getElementsByTagName("char"),v=void 0!==i&&i.trimmed;if(v)var g=i.height,m=i.width;for(var y=0;y{var s=i(66863),r=i(98611),n={Parse:i(39860)};n=r(!1,n,s),t.exports=n},66863:t=>{t.exports={TEXT_SET1:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},13468:(t,e,i)=>{var s=i(44616),r=i(56694),n=i(88899),a=new r({Extends:s,Mixins:[n],initialize:function(t,e,i,r,n,a,o){s.call(this,t,e,i,r,n,a,o),this.type="DynamicBitmapText",this.scrollX=0,this.scrollY=0,this.cropWidth=0,this.cropHeight=0,this.displayCallback,this.callbackData={parent:this,color:0,tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:0,charCode:0,x:0,y:0,scale:0,rotation:0,data:0}},setSize:function(t,e){return this.cropWidth=t,this.cropHeight=e,this},setDisplayCallback:function(t){return this.displayCallback=t,this},setScrollX:function(t){return this.scrollX=t,this},setScrollY:function(t){return this.scrollY=t,this}});t.exports=a},93438:(t,e,i)=>{var s=i(49584);t.exports=function(t,e,i,r){var n=e._text,a=n.length,o=t.currentContext;if(0!==a&&s(t,o,e,i,r)){i.addToRenderList(e);var h=e.fromAtlas?e.frame:e.texture.frames.__BASE,l=e.displayCallback,u=e.callbackData,c=e.fontData.chars,d=e.fontData.lineHeight,f=e._letterSpacing,p=0,v=0,g=0,m=null,y=0,x=0,T=0,w=0,E=0,b=0,S=null,A=0,_=e.frame.source.image,C=h.cutX,R=h.cutY,M=0,P=0,O=e._fontSize/e.fontData.size,L=e._align,F=0,D=0;e.getTextBounds(!1);var k=e._bounds.lines;1===L?D=(k.longest-k.lengths[0])/2:2===L&&(D=k.longest-k.lengths[0]),o.translate(-e.displayOriginX,-e.displayOriginY);var I=i.roundPixels;e.cropWidth>0&&e.cropHeight>0&&(o.beginPath(),o.rect(0,0,e.cropWidth,e.cropHeight),o.clip());for(var B=0;B{var s=i(13468),r=i(88933),n=i(99325),a=i(20494);n.register("dynamicBitmapText",(function(t,e){void 0===t&&(t={});var i=a(t,"font",""),n=a(t,"text",""),o=a(t,"size",!1),h=new s(this.scene,0,0,i,n,o);return void 0!==e&&(t.add=e),r(this.scene,h,t),h}))},94145:(t,e,i)=>{var s=i(13468);i(61286).register("dynamicBitmapText",(function(t,e,i,r,n){return this.displayList.add(new s(this.scene,t,e,i,r,n))}))},88899:(t,e,i)=>{var s=i(72283),r=i(72283);s=i(16873),r=i(93438),t.exports={renderWebGL:s,renderCanvas:r}},16873:(t,e,i)=>{var s=i(73329),r=i(69360),n=i(75512),a=new r;t.exports=function(t,e,i,r){var o=e.text,h=o.length;if(0!==h){i.addToRenderList(e);var l=t.pipelines.set(e.pipeline,e),u=s(e,i,r),c=u.sprite,d=u.calc,f=a,p=e.cropWidth>0||e.cropHeight>0;p&&(l.flush(),t.pushScissor(d.tx,d.ty,e.cropWidth*d.scaleX,e.cropHeight*d.scaleY));var v,g,m=e.frame.glTexture,y=e.tintFill,x=n.getTintAppendFloatAlpha(e.tintTopLeft,i.alpha*e._alphaTL),T=n.getTintAppendFloatAlpha(e.tintTopRight,i.alpha*e._alphaTR),w=n.getTintAppendFloatAlpha(e.tintBottomLeft,i.alpha*e._alphaBL),E=n.getTintAppendFloatAlpha(e.tintBottomRight,i.alpha*e._alphaBR),b=l.setGameObject(e),S=0,A=0,_=0,C=0,R=e.letterSpacing,M=0,P=0,O=e.scrollX,L=e.scrollY,F=e.fontData,D=F.chars,k=F.lineHeight,I=e.fontSize/F.size,B=0,N=e._align,Y=0,X=0,U=e.getTextBounds(!1);e.maxWidth>0&&(h=(o=U.wrappedText).length);var z=e._bounds.lines;1===N?X=(z.longest-z.lengths[0])/2:2===N&&(X=z.longest-z.lengths[0]);var G=i.roundPixels,W=e.displayCallback,V=e.callbackData;t.pipelines.preBatch(e);for(var H=0;H{var s=i(56694),r=i(82897),n=i(64937),a=i(89980),o=i(82173),h=i(68298),l=i(31476),u=i(74118),c=i(84557),d=new s({Extends:a,Mixins:[n.Alpha,n.BlendMode,n.Depth,n.Mask,n.Origin,n.Pipeline,n.ScrollFactor,n.Texture,n.Tint,n.Transform,n.Visible,c],initialize:function(t,e,i,s,r,n,h){void 0===r&&(r=""),void 0===h&&(h=0),a.call(this,t,"BitmapText"),this.font=s;var l=this.scene.sys.cache.bitmapFont.get(s);l||console.warn("Invalid BitmapText key: "+s),this.fontData=l.data,this._text="",this._fontSize=n||this.fontData.size,this._letterSpacing=0,this._align=h,this._bounds=o(),this._dirty=!0,this._maxWidth=0,this.wordWrapCharCode=32,this.charColors=[],this.dropShadowX=0,this.dropShadowY=0,this.dropShadowColor=0,this.dropShadowAlpha=.5,this.fromAtlas=l.fromAtlas,this.setTexture(l.texture,l.frame),this.setPosition(e,i),this.setOrigin(0,0),this.initPipeline(),this.setText(r)},setLeftAlign:function(){return this._align=d.ALIGN_LEFT,this._dirty=!0,this},setCenterAlign:function(){return this._align=d.ALIGN_CENTER,this._dirty=!0,this},setRightAlign:function(){return this._align=d.ALIGN_RIGHT,this._dirty=!0,this},setFontSize:function(t){return this._fontSize=t,this._dirty=!0,this},setLetterSpacing:function(t){return void 0===t&&(t=0),this._letterSpacing=t,this._dirty=!0,this},setText:function(t){return t||0===t||(t=""),Array.isArray(t)&&(t=t.join("\n")),t!==this.text&&(this._text=t.toString(),this._dirty=!0,this.updateDisplayOrigin()),this},setDropShadow:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=.5),this.dropShadowX=t,this.dropShadowY=e,this.dropShadowColor=i,this.dropShadowAlpha=s,this},setCharacterTint:function(t,e,i,s,n,a,o){void 0===t&&(t=0),void 0===e&&(e=1),void 0===i&&(i=!1),void 0===s&&(s=-1),void 0===n&&(n=s,a=s,o=s);var h=this.text.length;-1===e&&(e=h),t<0&&(t=h+t),t=r(t,0,h-1);for(var l=r(t+e,t,h),u=this.charColors,c=t;c{var s=i(49584);t.exports=function(t,e,i,r){var n=e._text,a=n.length,o=t.currentContext;if(0!==a&&s(t,o,e,i,r)){i.addToRenderList(e);var h=e.fromAtlas?e.frame:e.texture.frames.__BASE,l=e.fontData.chars,u=e.fontData.lineHeight,c=e._letterSpacing,d=0,f=0,p=0,v=null,g=0,m=0,y=0,x=0,T=0,w=0,E=null,b=0,S=h.source.image,A=h.cutX,_=h.cutY,C=e._fontSize/e.fontData.size,R=e._align,M=0,P=0,O=e.getTextBounds(!1);e.maxWidth>0&&(a=(n=O.wrappedText).length);var L=e._bounds.lines;1===R?P=(L.longest-L.lengths[0])/2:2===R&&(P=L.longest-L.lengths[0]),o.translate(-e.displayOriginX,-e.displayOriginY);for(var F=i.roundPixels,D=0;D{var s=i(44616),r=i(88933),n=i(99325),a=i(20494),o=i(10850);n.register("bitmapText",(function(t,e){void 0===t&&(t={});var i=o(t,"font",""),n=a(t,"text",""),h=a(t,"size",!1),l=o(t,"align",0),u=new s(this.scene,0,0,i,n,h,l);return void 0!==e&&(t.add=e),r(this.scene,u,t),u}))},21797:(t,e,i)=>{var s=i(44616);i(61286).register("bitmapText",(function(t,e,i,r,n,a){return this.displayList.add(new s(this.scene,t,e,i,r,n,a))}))},84557:(t,e,i)=>{var s=i(72283),r=i(72283);s=i(26372),r=i(97545),t.exports={renderWebGL:s,renderCanvas:r}},26372:(t,e,i)=>{var s=i(8810),r=i(73329),n=i(75512);t.exports=function(t,e,i,a){if(0!==e._text.length){i.addToRenderList(e);var o,h,l,u=t.pipelines.set(e.pipeline,e),c=r(e,i,a).calc,d=i.roundPixels,f=i.alpha,p=e.charColors,v=e.tintFill,g=n.getTintAppendFloatAlpha,m=g(e.tintTopLeft,f*e._alphaTL),y=g(e.tintTopRight,f*e._alphaTR),x=g(e.tintBottomLeft,f*e._alphaBL),T=g(e.tintBottomRight,f*e._alphaBR),w=e.frame.glTexture,E=u.setGameObject(e),b=e.getTextBounds(!1).characters,S=e.dropShadowX,A=e.dropShadowY,_=0!==S||0!==A;if(t.pipelines.preBatch(e),_){var C=e.dropShadowColor,R=e.dropShadowAlpha,M=g(C,f*R*e._alphaTL),P=g(C,f*R*e._alphaTR),O=g(C,f*R*e._alphaBL),L=g(C,f*R*e._alphaBR);for(o=0;o{var s=i(92246),r=i(41664),n=i(56694),a=i(64937),o=i(82047),h=i(89980),l=i(71207),u=new n({Extends:h,Mixins:[a.Alpha,a.BlendMode,a.Depth,a.Mask,a.Pipeline,a.ScrollFactor,a.Size,a.Texture,a.Transform,a.Visible,s],initialize:function(t,e,i,s,r){h.call(this,t,"Blitter"),this.setTexture(s,r),this.setPosition(e,i),this.initPipeline(),this.children=new l,this.renderList=[],this.dirty=!1},create:function(t,e,i,s,n){void 0===s&&(s=!0),void 0===n&&(n=this.children.length),void 0===i?i=this.frame:i instanceof o||(i=this.texture.get(i));var a=new r(this,t,e,i,s);return this.children.addAt(a,n,!1),this.dirty=!0,a},createFromCallback:function(t,e,i,s){for(var r=this.createMultiple(e,i,s),n=0;n0},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(){this.children.removeAll(),this.dirty=!0},preDestroy:function(){this.children.destroy(),this.renderList=[]}});t.exports=u},33177:t=>{t.exports=function(t,e,i,s){var r=e.getRenderList();if(0!==r.length){var n=t.currentContext,a=i.alpha*e.alpha;if(0!==a){i.addToRenderList(e),n.globalCompositeOperation=t.blendModes[e.blendMode],n.imageSmoothingEnabled=!(!t.antialias||e.frame.source.scaleMode);var o=e.x-i.scrollX*e.scrollFactorX,h=e.y-i.scrollY*e.scrollFactorY;n.save(),s&&s.copyToContext(n);for(var l=i.roundPixels,u=0;u{var s=i(52816),r=i(88933),n=i(99325),a=i(20494);n.register("blitter",(function(t,e){void 0===t&&(t={});var i=a(t,"key",null),n=a(t,"frame",null),o=new s(this.scene,0,0,i,n);return void 0!==e&&(t.add=e),r(this.scene,o,t),o}))},38906:(t,e,i)=>{var s=i(52816);i(61286).register("blitter",(function(t,e,i,r){return this.displayList.add(new s(this.scene,t,e,i,r))}))},92246:(t,e,i)=>{var s=i(72283),r=i(72283);s=i(89165),r=i(33177),t.exports={renderWebGL:s,renderCanvas:r}},89165:(t,e,i)=>{var s=i(69360),r=i(75512),n=new s;t.exports=function(t,e,i,s){var a=e.getRenderList();if(0!==a.length){var o=i.alpha*e.alpha;if(0!==o){i.addToRenderList(e);var h=t.pipelines.set(this.pipeline,e),l=i.scrollX*e.scrollFactorX,u=i.scrollY*e.scrollFactorY,c=n.copyFrom(i.matrix);s&&(c.multiplyWithOffset(s,-l,-u),l=0,u=0);var d=e.x-l,f=e.y-u,p=-1,v=i.roundPixels;t.pipelines.preBatch(e);for(var g=0;g{var s=i(56694),r=i(82047),n=new s({initialize:function(t,e,i,s,r){this.parent=t,this.x=e,this.y=i,this.frame=s,this.data={},this.tint=16777215,this._visible=r,this._alpha=1,this.flipX=!1,this.flipY=!1},setFrame:function(t){return void 0===t?this.frame=this.parent.frame:t instanceof r&&t.texture===this.parent.texture?this.frame=t:this.frame=this.parent.texture.get(t),this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this},reset:function(t,e,i){return this.x=t,this.y=e,this.flipX=!1,this.flipY=!1,this._alpha=1,this._visible=!0,this.parent.dirty=!0,i&&this.setFrame(i),this},setPosition:function(t,e){return this.x=t,this.y=e,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},setVisible:function(t){return this.visible=t,this},setAlpha:function(t){return this.alpha=t,this},setTint:function(t){return this.tint=t,this},destroy:function(){this.parent.dirty=!0,this.parent.children.remove(this),this.parent=void 0,this.frame=void 0,this.data=void 0},visible:{get:function(){return this._visible},set:function(t){this.parent.dirty|=this._visible!==t,this._visible=t}},alpha:{get:function(){return this._alpha},set:function(t){this.parent.dirty|=this._alpha>0!=t>0,this._alpha=t}}});t.exports=n},97123:(t,e,i)=>{var s=i(82897),r={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,r){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=s(t,0,1),this._alphaTR=s(e,0,1),this._alphaBL=s(i,0,1),this._alphaBR=s(r,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=s(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=s(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=s(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=s(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=r},15720:(t,e,i)=>{var s=i(82897),r={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t){return void 0===t&&(t=1),this.alpha=t,this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}}};t.exports=r},69732:(t,e,i)=>{var s=i(95723),r={_blendMode:s.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=s[t]),(t|=0)>=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=r},28284:t=>{t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},85293:t=>{var e={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,s){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,s,this.flipX,this.flipY);else{var r=t;this.frame.setCropUVs(this._crop,r.x,r.y,r.width,r.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=e},14975:t=>{var e={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.displayList&&this.displayList.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=e},88677:t=>{var e={fxPadding:0,setFXPadding:function(t){return void 0===t&&(t=0),this.fxPadding=t,this},onFXCopy:function(){},onFX:function(){}};t.exports=e},92972:t=>{t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},80693:(t,e,i)=>{var s=i(74118),r=i(2386),n=i(93736),a={prepareBoundsOutput:function(t,e){(void 0===e&&(e=!1),0!==this.rotation&&r(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getCenter:function(t){return void 0===t&&(t=new n),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,t},getTopLeft:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopCenter:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopRight:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getLeftCenter:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getRightCenter:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getBottomLeft:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomCenter:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomRight:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBounds:function(t){var e,i,r,n,a,o,h,l;if(void 0===t&&(t=new s),this.parentContainer){var u=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(t),u.transformPoint(t.x,t.y,t),e=t.x,i=t.y,this.getTopRight(t),u.transformPoint(t.x,t.y,t),r=t.x,n=t.y,this.getBottomLeft(t),u.transformPoint(t.x,t.y,t),a=t.x,o=t.y,this.getBottomRight(t),u.transformPoint(t.x,t.y,t),h=t.x,l=t.y}else this.getTopLeft(t),e=t.x,i=t.y,this.getTopRight(t),r=t.x,n=t.y,this.getBottomLeft(t),a=t.x,o=t.y,this.getBottomRight(t),h=t.x,l=t.y;return t.x=Math.min(e,r,a,h),t.y=Math.min(i,n,o,l),t.width=Math.max(e,r,a,h)-t.x,t.height=Math.max(i,n,o,l)-t.y,t}};t.exports=a},39171:(t,e,i)=>{var s=i(76756),r=i(63037),n={mask:null,setMask:function(t){return this.mask=t,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},createBitmapMask:function(t){return void 0===t&&(this.texture||this.shader)&&(t=this),new s(this.scene,t)},createGeometryMask:function(t){return void 0===t&&"Graphics"===this.type&&(t=this),new r(this.scene,t)}};t.exports=n},28072:t=>{var e={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(t){this._displayOriginX=t,this.originX=t/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(t){this._displayOriginY=t,this.originY=t/this.height}},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this.updateDisplayOrigin()},setOriginFromFrame:function(){return this.frame&&this.frame.customPivot?(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin()):this.setOrigin()},setDisplayOrigin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displayOriginX=t,this.displayOriginY=e,this},updateDisplayOrigin:function(){return this._displayOriginX=this.originX*this.width,this._displayOriginY=this.originY*this.height,this}};t.exports=e},54211:(t,e,i)=>{var s=i(75606),r=i(63130),n=i(10850),a=i(55303),o=i(93736),h={path:null,rotateToPath:!1,pathRotationOffset:0,pathOffset:null,pathVector:null,pathDelta:null,pathTween:null,pathConfig:null,_prevDirection:a.PLAYING_FORWARD,setPath:function(t,e){void 0===e&&(e=this.pathConfig);var i=this.pathTween;return i&&i.isPlaying()&&i.stop(),this.path=t,e&&this.startFollow(e),this},setRotateToPath:function(t,e){return void 0===e&&(e=0),this.rotateToPath=t,this.pathRotationOffset=e,this},isFollowing:function(){var t=this.pathTween;return t&&t.isPlaying()},startFollow:function(t,e){void 0===t&&(t={}),void 0===e&&(e=0);var i=this.pathTween;i&&i.isPlaying()&&i.stop(),"number"==typeof t&&(t={duration:t}),t.from=n(t,"from",0),t.to=n(t,"to",1);var h=r(t,"positionOnPath",!1);this.rotateToPath=r(t,"rotateToPath",!1),this.pathRotationOffset=n(t,"rotationOffset",0);var l=n(t,"startAt",e);if(l&&(t.onStart=function(t){var e=t.data[0];e.progress=l,e.elapsed=e.duration*l;var i=e.ease(e.progress);e.current=e.start+(e.end-e.start)*i,e.target[e.key]=e.current}),this.pathOffset||(this.pathOffset=new o(this.x,this.y)),this.pathVector||(this.pathVector=new o),this.pathDelta||(this.pathDelta=new o),this.pathDelta.reset(),this.pathTween=this.scene.sys.tweens.addCounter(t),this.path.getStartPoint(this.pathOffset),h&&(this.x=this.pathOffset.x,this.y=this.pathOffset.y),this.pathOffset.x=this.x-this.pathOffset.x,this.pathOffset.y=this.y-this.pathOffset.y,this._prevDirection=a.PLAYING_FORWARD,this.rotateToPath){var u=this.path.getPoint(.1);this.rotation=Math.atan2(u.y-this.y,u.x-this.x)+s(this.pathRotationOffset)}return this.pathConfig=t,this},pauseFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.pause(),this},resumeFollow:function(){var t=this.pathTween;return t&&t.isPaused()&&t.resume(),this},stopFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.stop(),this},pathUpdate:function(){var t=this.pathTween;if(t){var e=t.data[0],i=this.pathDelta,r=this.pathVector;if(i.copy(r).negate(),e.state===a.COMPLETE)return this.path.getPoint(1,r),i.add(r),r.add(this.pathOffset),void this.setPosition(r.x,r.y);if(e.state!==a.PLAYING_FORWARD&&e.state!==a.PLAYING_BACKWARD)return;this.path.getPoint(t.getValue(),r),i.add(r),r.add(this.pathOffset);var n=this.x,o=this.y;this.setPosition(r.x,r.y);var h=this.x-n,l=this.y-o;if(0===h&&0===l)return;if(e.state!==this._prevDirection)return void(this._prevDirection=e.state);this.rotateToPath&&(this.rotation=Math.atan2(l,h)+s(this.pathRotationOffset))}}};t.exports=h},58210:(t,e,i)=>{var s=i(28699),r=i(65641),n=i(72677),a={defaultPipeline:null,pipeline:null,hasPostPipeline:!1,postPipelines:null,pipelineData:null,initPipeline:function(t){void 0===t&&(t=r.MULTI_PIPELINE);var e=this.scene.sys.renderer;if(!e)return!1;var i=e.pipelines;if(this.postPipelines=[],this.pipelineData={},i){var s=i.get(t);if(s)return this.defaultPipeline=s,this.pipeline=s,!0}return!1},setPipeline:function(t,e,i){var r=this.scene.sys.renderer;if(!r)return this;var n=r.pipelines;if(n){var a=n.get(t);a&&(this.pipeline=a),e&&(this.pipelineData=i?s(e):e)}return this},setPostPipeline:function(t,e,i){var r=this.scene.sys.renderer;if(!r)return this;var n=r.pipelines;if(n){Array.isArray(t)||(t=[t]);for(var a=0;a0,this},setPipelineData:function(t,e){var i=this.pipelineData;return void 0===e?delete i[t]:i[t]=e,this},getPostPipeline:function(t){for(var e=this.postPipelines,i=[],s=0;s=0;i--){var s=e[i];("string"==typeof t&&s.name===t||"string"!=typeof t&&s instanceof t)&&(s.destroy(),n(e,i))}return this.hasPostPipeline=this.postPipelines.length>0,this},getPipelineName:function(){return this.pipeline.name}};t.exports=a},45900:t=>{var e={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=e},31654:t=>{var e={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return Math.abs(this.scaleX*this.frame.realWidth)},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return Math.abs(this.scaleY*this.frame.realHeight)},set:function(t){this.scaleY=t/this.frame.realHeight}},setSizeToFrame:function(t){return void 0===t&&(t=this.frame),this.width=t.realWidth,this.height=t.realHeight,this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}};t.exports=e},82081:t=>{var e={texture:null,frame:null,isCropped:!1,setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};t.exports=e},21850:t=>{var e={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,s){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,s,this.flipX,this.flipY);else{var r=t;this.frame.setCropUVs(this._crop,r.x,r.y,r.width,r.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=e},58072:t=>{var e={tintTopLeft:16777215,tintTopRight:16777215,tintBottomLeft:16777215,tintBottomRight:16777215,tintFill:!1,clearTint:function(){return this.setTint(16777215),this},setTint:function(t,e,i,s){return void 0===t&&(t=16777215),void 0===e&&(e=t,i=t,s=t),this.tintTopLeft=t,this.tintTopRight=e,this.tintBottomLeft=i,this.tintBottomRight=s,this.tintFill=!1,this},setTintFill:function(t,e,i,s){return this.setTint(t,e,i,s),this.tintFill=!0,this},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){var t=16777215;return this.tintFill||this.tintTopLeft!==t||this.tintTopRight!==t||this.tintBottomLeft!==t||this.tintBottomRight!==t}}};t.exports=e},48129:t=>{t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},56584:(t,e,i)=>{var s=i(83392),r=i(69360),n=i(64462),a=i(35786),o=i(62138),h=i(93736),l={_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(t){this._scaleX=t,this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},angle:{get:function(){return o(this._rotation*s.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*s.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=a(t)}},setPosition:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===s&&(s=0),this.x=t,this.y=e,this.z=i,this.w=s,this},copyPosition:function(t){return void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.z&&(this.z=t.z),void 0!==t.w&&(this.w=t.w),this},setRandomPosition:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===s&&(s=this.scene.sys.scale.height),this.x=t+Math.random()*i,this.y=e+Math.random()*s,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new r),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new r),void 0===e&&(e=new r);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);for(t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return t},getLocalPoint:function(t,e,i,s){i||(i=new h),s||(s=this.scene.sys.cameras.main);var r=s.scrollX,a=s.scrollY,o=t+r*this.scrollFactorX-r,l=e+a*this.scrollFactorY-a;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(o,l,i):n(o,l,this.x,this.y,this.rotation,this.scaleX,this.scaleY,i),this._originComponent&&(i.x+=this._displayOriginX,i.y+=this._displayOriginY),i},getParentRotation:function(){for(var t=0,e=this.parentContainer;e;)t+=e.rotation,e=e.parentContainer;return t}};t.exports=l},69360:(t,e,i)=>{var s=i(56694),r=i(83392),n=i(93736),a=new s({initialize:function(t,e,i,s,r,n){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=1),void 0===r&&(r=0),void 0===n&&(n=0),this.matrix=new Float32Array([t,e,i,s,r,n,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0}},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var t=this.matrix,e=t[0],i=t[1],s=t[2],n=t[3];return e||i?i>0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):s||n?r.TAU-(n>0?Math.acos(-s/this.scaleY):-Math.acos(s/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),s=this.matrix,r=s[0],n=s[1],a=s[2],o=s[3];return s[0]=r*i+a*e,s[1]=n*i+o*e,s[2]=r*-e+a*i,s[3]=n*-e+o*i,this},multiply:function(t,e){var i=this.matrix,s=t.matrix,r=i[0],n=i[1],a=i[2],o=i[3],h=i[4],l=i[5],u=s[0],c=s[1],d=s[2],f=s[3],p=s[4],v=s[5],g=void 0===e?this:e;return g.a=u*r+c*a,g.b=u*n+c*o,g.c=d*r+f*a,g.d=d*n+f*o,g.e=p*r+v*a+h,g.f=p*n+v*o+l,g},multiplyWithOffset:function(t,e,i){var s=this.matrix,r=t.matrix,n=s[0],a=s[1],o=s[2],h=s[3],l=e*n+i*o+s[4],u=e*a+i*h+s[5],c=r[0],d=r[1],f=r[2],p=r[3],v=r[4],g=r[5];return s[0]=c*n+d*o,s[1]=c*a+d*h,s[2]=f*n+p*o,s[3]=f*a+p*h,s[4]=v*n+g*o+l,s[5]=v*a+g*h+u,this},transform:function(t,e,i,s,r,n){var a=this.matrix,o=a[0],h=a[1],l=a[2],u=a[3],c=a[4],d=a[5];return a[0]=t*o+e*l,a[1]=t*h+e*u,a[2]=i*o+s*l,a[3]=i*h+s*u,a[4]=r*o+n*l+c,a[5]=r*h+n*u+d,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var s=this.matrix,r=s[0],n=s[1],a=s[2],o=s[3],h=s[4],l=s[5];return i.x=t*r+e*a+h,i.y=t*n+e*o+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=e*r-i*s;return t[0]=r/o,t[1]=-i/o,t[2]=-s/o,t[3]=e/o,t[4]=(s*a-r*n)/o,t[5]=-(e*a-i*n)/o,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){var e=this.matrix;return t.setTransform(e[0],e[1],e[2],e[3],e[4],e[5]),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,s,r,n){var a=this.matrix;return a[0]=t,a[1]=e,a[2]=i,a[3]=s,a[4]=r,a[5]=n,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],s=e[1],r=e[2],n=e[3],a=i*n-s*r;if(t.translateX=e[4],t.translateY=e[5],i||s){var o=Math.sqrt(i*i+s*s);t.rotation=s>0?Math.acos(i/o):-Math.acos(i/o),t.scaleX=o,t.scaleY=a/o}else if(r||n){var h=Math.sqrt(r*r+n*n);t.rotation=.5*Math.PI-(n>0?Math.acos(-r/h):-Math.acos(r/h)),t.scaleX=a/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,i,s,r){var n=this.matrix,a=Math.sin(i),o=Math.cos(i);return n[4]=t,n[5]=e,n[0]=o*s,n[1]=a*s,n[2]=-a*r,n[3]=o*r,this},applyInverse:function(t,e,i){void 0===i&&(i=new n);var s=this.matrix,r=s[0],a=s[1],o=s[2],h=s[3],l=s[4],u=s[5],c=1/(r*h+o*-a);return i.x=h*c*t+-o*c*e+(u*o-l*h)*c,i.y=r*c*e+-a*c*t+(-u*r+l*a)*c,i},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getXRound:function(t,e,i){var s=this.getX(t,e);return i&&(s=Math.round(s)),s},getYRound:function(t,e,i){var s=this.getY(t,e);return i&&(s=Math.round(s)),s},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.decomposedMatrix=null}});t.exports=a},59694:t=>{var e={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=e},64937:(t,e,i)=>{t.exports={Alpha:i(97123),AlphaSingle:i(15720),BlendMode:i(69732),ComputedSize:i(28284),Crop:i(85293),Depth:i(14975),Flip:i(92972),FX:i(88677),GetBounds:i(80693),Mask:i(39171),Origin:i(28072),PathFollower:i(54211),Pipeline:i(58210),ScrollFactor:i(45900),Size:i(31654),Texture:i(82081),TextureCrop:i(21850),Tint:i(58072),ToJSON:i(48129),Transform:i(56584),TransformMatrix:i(69360),Visible:i(59694)}},70339:(t,e,i)=>{var s=i(59959),r=i(95723),n=i(56694),a=i(64937),o=i(56631),h=i(89980),l=i(74118),u=i(98524),c=i(58795),d=i(93736),f=new n({Extends:h,Mixins:[a.AlphaSingle,a.BlendMode,a.ComputedSize,a.Depth,a.Mask,a.Pipeline,a.Transform,a.Visible,u],initialize:function(t,e,i,s){h.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new a.TransformMatrix,this.tempTransformMatrix=new a.TransformMatrix,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.initPipeline(),this.setPosition(e,i),this.clearAlpha(),this.setBlendMode(r.SKIP_CHECK),s&&this.add(s)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new l),t.setTo(this.x,this.y,0,0),this.parentContainer){var e=this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x,this.y);t.setTo(e.x,e.y,0,0)}if(this.list.length>0){var i=this.list,s=new l,r=!1;t.setEmpty();for(var n=0;n-1},setAll:function(t,e,i,r){return s.SetAll(this.list,t,e,i,r),this},each:function(t,e){var i,s=[null],r=this.list.slice(),n=r.length;for(i=2;i0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[]}});t.exports=f},13916:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e);var r=e.list;if(0!==r.length){var n=e.localTransform;s?(n.loadIdentity(),n.multiply(s),n.translate(e.x,e.y),n.rotate(e.rotation),n.scale(e.scaleX,e.scaleY)):n.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var a=-1!==e.blendMode;a||t.setBlendMode(0);var o=e._alpha,h=e.scrollFactorX,l=e.scrollFactorY;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var u=0;u{var s=i(88933),r=i(70339),n=i(99325),a=i(20494);n.register("container",(function(t,e){void 0===t&&(t={});var i=a(t,"x",0),n=a(t,"y",0),o=a(t,"children",null),h=new r(this.scene,i,n,o);return void 0!==e&&(t.add=e),s(this.scene,h,t),h}))},23400:(t,e,i)=>{var s=i(70339);i(61286).register("container",(function(t,e,i){return this.displayList.add(new s(this.scene,t,e,i))}))},98524:(t,e,i)=>{var s=i(72283),r=i(72283);s=i(36934),r=i(13916),t.exports={renderWebGL:s,renderCanvas:r}},36934:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e);var r=e.list,n=r.length;if(0!==n){var a=e.localTransform;s?(a.loadIdentity(),a.multiply(s),a.translate(e.x,e.y),a.rotate(e.rotation),a.scale(e.scaleX,e.scaleY)):a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),t.pipelines.preBatch(e);var o=-1!==e.blendMode;o||t.setBlendMode(0);for(var h=e.alpha,l=e.scrollFactorX,u=e.scrollFactorY,c=0;c{t.exports=["normal","multiply","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]},38943:(t,e,i)=>{var s=i(56694),r=i(64937),n=i(11603),a=i(89980),o=i(42911),h=i(55638),l=i(7599),u=i(51729),c=new s({Extends:a,Mixins:[r.AlphaSingle,r.BlendMode,r.Depth,r.Origin,r.ScrollFactor,r.Transform,r.Visible,n],initialize:function(t,e,i,s,r,n){a.call(this,t,"DOMElement"),this.parent=t.sys.game.domContainer,this.cache=t.sys.cache.html,this.node,this.transformOnly=!1,this.skewX=0,this.skewY=0,this.rotate3d=new u,this.rotate3dAngle="deg",this.pointerEvents="auto",this.width=0,this.height=0,this.displayWidth=0,this.displayHeight=0,this.handler=this.dispatchNativeEvent.bind(this),this.setPosition(e,i),"string"==typeof s?"#"===s[0]?this.setElement(s.substr(1),r,n):this.createElement(s,r,n):s&&this.setElement(s,r,n),t.sys.events.on(l.SLEEP,this.handleSceneEvent,this),t.sys.events.on(l.WAKE,this.handleSceneEvent,this),t.sys.events.on(l.PRE_RENDER,this.preRender,this)},handleSceneEvent:function(t){var e=this.node,i=e.style;e&&(i.display=t.settings.visible?"block":"none")},setSkew:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.skewX=t,this.skewY=e,this},setPerspective:function(t){return this.parent.style.perspective=t+"px",this},perspective:{get:function(){return parseFloat(this.parent.style.perspective)},set:function(t){this.parent.style.perspective=t+"px"}},addListener:function(t){if(this.node){t=t.split(" ");for(var e=0;e{var s=i(2452),r=i(89980),n=i(69360),a=new n,o=new n,h=new n;t.exports=function(t,e,i,n){if(e.node){var l=e.node.style,u=e.scene.sys.settings;if(!l||!u.visible||r.RENDER_MASK!==e.renderFlags||0!==e.cameraFilter&&e.cameraFilter&i.id||e.parentContainer&&!e.parentContainer.willRender())l.display="none";else{var c=e.parentContainer,d=i.alpha*e.alpha;c&&(d*=c.alpha);var f=a,p=o,v=h,g=0,m=0,y="0%",x="0%";n?(g=e.width*e.scaleX*e.originX,m=e.height*e.scaleY*e.originY,p.applyITRS(e.x-g,e.y-m,e.rotation,e.scaleX,e.scaleY),f.copyFrom(i.matrix),f.multiplyWithOffset(n,-i.scrollX*e.scrollFactorX,-i.scrollY*e.scrollFactorY),p.e=e.x-g,p.f=e.y-m,f.multiply(p,v)):(g=e.width*e.originX,m=e.height*e.originY,p.applyITRS(e.x-g,e.y-m,e.rotation,e.scaleX,e.scaleY),f.copyFrom(i.matrix),y=100*e.originX+"%",x=100*e.originY+"%",p.e-=i.scrollX*e.scrollFactorX,p.f-=i.scrollY*e.scrollFactorY,f.multiply(p,v)),e.transformOnly||(l.display="block",l.opacity=d,l.zIndex=e._depth,l.pointerEvents=e.pointerEvents,l.mixBlendMode=s[e._blendMode]),l.transform=v.getCSSMatrix()+" skew("+e.skewX+"rad, "+e.skewY+"rad) rotate3d("+e.rotate3d.x+","+e.rotate3d.y+","+e.rotate3d.z+","+e.rotate3d.w+e.rotate3dAngle+")",l.transformOrigin=y+" "+x}}}},66788:(t,e,i)=>{var s=i(38943);i(61286).register("dom",(function(t,e,i,r,n){var a=new s(this.scene,t,e,i,r,n);return this.displayList.add(a),a}))},11603:(t,e,i)=>{var s=i(72283),r=i(72283);s=i(66070),r=i(66070),t.exports={renderWebGL:s,renderCanvas:r}},65492:t=>{t.exports="addedtoscene"},98398:t=>{t.exports="destroy"},40239:t=>{t.exports="removedfromscene"},17286:t=>{t.exports="complete"},31496:t=>{t.exports="created"},89587:t=>{t.exports="error"},96342:t=>{t.exports="loop"},49614:t=>{t.exports="play"},24418:t=>{t.exports="seeked"},87318:t=>{t.exports="seeking"},61922:t=>{t.exports="stop"},13991:t=>{t.exports="timeout"},4052:t=>{t.exports="unlocked"},56631:(t,e,i)=>{t.exports={ADDED_TO_SCENE:i(65492),DESTROY:i(98398),REMOVED_FROM_SCENE:i(40239),VIDEO_COMPLETE:i(17286),VIDEO_CREATED:i(31496),VIDEO_ERROR:i(89587),VIDEO_LOOP:i(96342),VIDEO_PLAY:i(49614),VIDEO_SEEKED:i(24418),VIDEO_SEEKING:i(87318),VIDEO_STOP:i(61922),VIDEO_TIMEOUT:i(13991),VIDEO_UNLOCKED:i(4052)}},39419:(t,e,i)=>{var s=i(56694),r=i(64937),n=i(89980),a=i(79394),o=new s({Extends:n,Mixins:[r.Alpha,r.BlendMode,r.Depth,r.Flip,r.Origin,r.ScrollFactor,r.Size,r.Texture,r.Tint,r.Transform,r.Visible,a],initialize:function(t){n.call(this,t,"Extern")},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(){},render:function(){}});t.exports=o},96699:()=>{},41155:(t,e,i)=>{var s=i(39419);i(61286).register("extern",(function(){var t=new s(this.scene);return this.displayList.add(t),t}))},79394:(t,e,i)=>{var s=i(72283),r=i(72283);s=i(81410),r=i(96699),t.exports={renderWebGL:s,renderCanvas:r}},81410:(t,e,i)=>{var s=i(73329);t.exports=function(t,e,i,r){t.pipelines.clear();var n=s(e,i,r).calc;e.render.call(e,t,i,n),t.pipelines.rebind()}},36266:t=>{t.exports={ARC:0,BEGIN_PATH:1,CLOSE_PATH:2,FILL_RECT:3,LINE_TO:4,MOVE_TO:5,LINE_STYLE:6,FILL_STYLE:7,FILL_PATH:8,STROKE_PATH:9,FILL_TRIANGLE:10,STROKE_TRIANGLE:11,SAVE:14,RESTORE:15,TRANSLATE:16,SCALE:17,ROTATE:18,GRADIENT_FILL_STYLE:21,GRADIENT_LINE_STYLE:22}},33182:(t,e,i)=>{var s=i(51052),r=i(56694),n=i(36266),a=i(15720),o=i(69732),h=i(14975),l=i(39171),u=i(58210),c=i(45900),d=i(56584),f=i(59694),p=i(95669),v=i(89980),g=i(72632),m=i(10850),y=i(83392),x=i(60898),T=new r({Extends:v,Mixins:[a,o,h,l,u,d,f,c,x],initialize:function(t,e){var i=m(e,"x",0),s=m(e,"y",0);v.call(this,t,"Graphics"),this.setPosition(i,s),this.initPipeline(),this.displayOriginX=0,this.displayOriginY=0,this.commandBuffer=[],this.defaultFillColor=-1,this.defaultFillAlpha=1,this.defaultStrokeWidth=1,this.defaultStrokeColor=-1,this.defaultStrokeAlpha=1,this._lineWidth=1,this.setDefaultStyles(e)},setDefaultStyles:function(t){return m(t,"lineStyle",null)&&(this.defaultStrokeWidth=m(t,"lineStyle.width",1),this.defaultStrokeColor=m(t,"lineStyle.color",16777215),this.defaultStrokeAlpha=m(t,"lineStyle.alpha",1),this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha)),m(t,"fillStyle",null)&&(this.defaultFillColor=m(t,"fillStyle.color",16777215),this.defaultFillAlpha=m(t,"fillStyle.alpha",1),this.fillStyle(this.defaultFillColor,this.defaultFillAlpha)),this},lineStyle:function(t,e,i){return void 0===i&&(i=1),this.commandBuffer.push(n.LINE_STYLE,t,e,i),this._lineWidth=t,this},fillStyle:function(t,e){return void 0===e&&(e=1),this.commandBuffer.push(n.FILL_STYLE,t,e),this},fillGradientStyle:function(t,e,i,s,r,a,o,h){return void 0===r&&(r=1),void 0===a&&(a=r),void 0===o&&(o=r),void 0===h&&(h=r),this.commandBuffer.push(n.GRADIENT_FILL_STYLE,r,a,o,h,t,e,i,s),this},lineGradientStyle:function(t,e,i,s,r,a){return void 0===a&&(a=1),this.commandBuffer.push(n.GRADIENT_LINE_STYLE,t,a,e,i,s,r),this},beginPath:function(){return this.commandBuffer.push(n.BEGIN_PATH),this},closePath:function(){return this.commandBuffer.push(n.CLOSE_PATH),this},fillPath:function(){return this.commandBuffer.push(n.FILL_PATH),this},fill:function(){return this.commandBuffer.push(n.FILL_PATH),this},strokePath:function(){return this.commandBuffer.push(n.STROKE_PATH),this},stroke:function(){return this.commandBuffer.push(n.STROKE_PATH),this},fillCircleShape:function(t){return this.fillCircle(t.x,t.y,t.radius)},strokeCircleShape:function(t){return this.strokeCircle(t.x,t.y,t.radius)},fillCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,y.PI2),this.fillPath(),this},strokeCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,y.PI2),this.strokePath(),this},fillRectShape:function(t){return this.fillRect(t.x,t.y,t.width,t.height)},strokeRectShape:function(t){return this.strokeRect(t.x,t.y,t.width,t.height)},fillRect:function(t,e,i,s){return this.commandBuffer.push(n.FILL_RECT,t,e,i,s),this},strokeRect:function(t,e,i,s){var r=this._lineWidth/2,n=t-r,a=t+r;return this.beginPath(),this.moveTo(t,e),this.lineTo(t,e+s),this.strokePath(),this.beginPath(),this.moveTo(t+i,e),this.lineTo(t+i,e+s),this.strokePath(),this.beginPath(),this.moveTo(n,e),this.lineTo(a+i,e),this.strokePath(),this.beginPath(),this.moveTo(n,e+s),this.lineTo(a+i,e+s),this.strokePath(),this},fillRoundedRect:function(t,e,i,s,r){void 0===r&&(r=20);var n=r,a=r,o=r,h=r;return"number"!=typeof r&&(n=g(r,"tl",20),a=g(r,"tr",20),o=g(r,"bl",20),h=g(r,"br",20)),this.beginPath(),this.moveTo(t+n,e),this.lineTo(t+i-a,e),this.arc(t+i-a,e+a,a,-y.TAU,0),this.lineTo(t+i,e+s-h),this.arc(t+i-h,e+s-h,h,0,y.TAU),this.lineTo(t+o,e+s),this.arc(t+o,e+s-o,o,y.TAU,Math.PI),this.lineTo(t,e+n),this.arc(t+n,e+n,n,-Math.PI,-y.TAU),this.fillPath(),this},strokeRoundedRect:function(t,e,i,s,r){void 0===r&&(r=20);var n=r,a=r,o=r,h=r;return"number"!=typeof r&&(n=g(r,"tl",20),a=g(r,"tr",20),o=g(r,"bl",20),h=g(r,"br",20)),this.beginPath(),this.moveTo(t+n,e),this.lineTo(t+i-a,e),this.moveTo(t+i-a,e),this.arc(t+i-a,e+a,a,-y.TAU,0),this.lineTo(t+i,e+s-h),this.moveTo(t+i,e+s-h),this.arc(t+i-h,e+s-h,h,0,y.TAU),this.lineTo(t+o,e+s),this.moveTo(t+o,e+s),this.arc(t+o,e+s-o,o,y.TAU,Math.PI),this.lineTo(t,e+n),this.moveTo(t,e+n),this.arc(t+n,e+n,n,-Math.PI,-y.TAU),this.strokePath(),this},fillPointShape:function(t,e){return this.fillPoint(t.x,t.y,e)},fillPoint:function(t,e,i){return!i||i<1?i=1:(t-=i/2,e-=i/2),this.commandBuffer.push(n.FILL_RECT,t,e,i,i),this},fillTriangleShape:function(t){return this.fillTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},strokeTriangleShape:function(t){return this.strokeTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},fillTriangle:function(t,e,i,s,r,a){return this.commandBuffer.push(n.FILL_TRIANGLE,t,e,i,s,r,a),this},strokeTriangle:function(t,e,i,s,r,a){return this.commandBuffer.push(n.STROKE_TRIANGLE,t,e,i,s,r,a),this},strokeLineShape:function(t){return this.lineBetween(t.x1,t.y1,t.x2,t.y2)},lineBetween:function(t,e,i,s){return this.beginPath(),this.moveTo(t,e),this.lineTo(i,s),this.strokePath(),this},lineTo:function(t,e){return this.commandBuffer.push(n.LINE_TO,t,e),this},moveTo:function(t,e){return this.commandBuffer.push(n.MOVE_TO,t,e),this},strokePoints:function(t,e,i,s){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===s&&(s=t.length),this.beginPath(),this.moveTo(t[0].x,t[0].y);for(var r=1;r-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(t,e,i){var s,r,n=this.scene.sys,a=n.game.renderer;if(void 0===e&&(e=n.scale.width),void 0===i&&(i=n.scale.height),T.TargetCamera.setScene(this.scene),T.TargetCamera.setViewport(0,0,e,i),T.TargetCamera.scrollX=this.x,T.TargetCamera.scrollY=this.y,"string"==typeof t)if(n.textures.exists(t)){var o=(s=n.textures.get(t)).getSourceImage();o instanceof HTMLCanvasElement&&(r=o.getContext("2d"))}else r=(s=n.textures.createCanvas(t,e,i)).getSourceImage().getContext("2d");else t instanceof HTMLCanvasElement&&(r=t.getContext("2d"));return r&&(this.renderCanvas(a,this,T.TargetCamera,null,r,!1),s&&s.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});T.TargetCamera=new s,t.exports=T},91543:(t,e,i)=>{var s=i(36266),r=i(49584);t.exports=function(t,e,i,n,a,o){var h=e.commandBuffer,l=h.length,u=a||t.currentContext;if(0!==l&&r(t,u,e,i,n)){i.addToRenderList(e);var c=1,d=1,f=0,p=0,v=1,g=0,m=0,y=0;u.beginPath();for(var x=0;x>>16,m=(65280&f)>>>8,y=255&f,u.strokeStyle="rgba("+g+","+m+","+y+","+c+")",u.lineWidth=v,x+=3;break;case s.FILL_STYLE:p=h[x+1],d=h[x+2],g=(16711680&p)>>>16,m=(65280&p)>>>8,y=255&p,u.fillStyle="rgba("+g+","+m+","+y+","+d+")",x+=2;break;case s.BEGIN_PATH:u.beginPath();break;case s.CLOSE_PATH:u.closePath();break;case s.FILL_PATH:o||u.fill();break;case s.STROKE_PATH:o||u.stroke();break;case s.FILL_RECT:o?u.rect(h[x+1],h[x+2],h[x+3],h[x+4]):u.fillRect(h[x+1],h[x+2],h[x+3],h[x+4]),x+=4;break;case s.FILL_TRIANGLE:u.beginPath(),u.moveTo(h[x+1],h[x+2]),u.lineTo(h[x+3],h[x+4]),u.lineTo(h[x+5],h[x+6]),u.closePath(),o||u.fill(),x+=6;break;case s.STROKE_TRIANGLE:u.beginPath(),u.moveTo(h[x+1],h[x+2]),u.lineTo(h[x+3],h[x+4]),u.lineTo(h[x+5],h[x+6]),u.closePath(),o||u.stroke(),x+=6;break;case s.LINE_TO:u.lineTo(h[x+1],h[x+2]),x+=2;break;case s.MOVE_TO:u.moveTo(h[x+1],h[x+2]),x+=2;break;case s.LINE_FX_TO:u.lineTo(h[x+1],h[x+2]),x+=5;break;case s.MOVE_FX_TO:u.moveTo(h[x+1],h[x+2]),x+=5;break;case s.SAVE:u.save();break;case s.RESTORE:u.restore();break;case s.TRANSLATE:u.translate(h[x+1],h[x+2]),x+=2;break;case s.SCALE:u.scale(h[x+1],h[x+2]),x+=2;break;case s.ROTATE:u.rotate(h[x+1]),x+=1;break;case s.GRADIENT_FILL_STYLE:x+=5;break;case s.GRADIENT_LINE_STYLE:x+=6}}u.restore()}}},41286:(t,e,i)=>{var s=i(99325),r=i(33182);s.register("graphics",(function(t,e){void 0===t&&(t={}),void 0!==e&&(t.add=e);var i=new r(this.scene,t);return t.add&&this.scene.sys.displayList.add(i),i}))},13122:(t,e,i)=>{var s=i(33182);i(61286).register("graphics",(function(t){return this.displayList.add(new s(this.scene,t))}))},60898:(t,e,i)=>{var s=i(72283),r=i(72283);s=i(34429),r=i(91543),r=i(91543),t.exports={renderWebGL:s,renderCanvas:r}},34429:(t,e,i)=>{var s=i(36266),r=i(73329),n=i(69360),a=i(75512),o=function(t,e,i){this.x=t,this.y=e,this.width=i},h=function(t,e,i){this.points=[],this.pointsLength=1,this.points[0]=new o(t,e,i)},l=[],u=new n;t.exports=function(t,e,i,n){if(0!==e.commandBuffer.length){i.addToRenderList(e);var c=t.pipelines.set(e.pipeline,e);t.pipelines.preBatch(e);for(var d=r(e,i,n).calc,f=u.loadIdentity(),p=e.commandBuffer,v=i.alpha*e.alpha,g=1,m=c.fillTint,y=c.strokeTint,x=0,T=0,w=0,E=2*Math.PI,b=[],S=0,A=!0,_=null,C=a.getTintAppendFloatAlpha,R=0;R0&&(U=U%E-E):U>E?U=E:U<0&&(U=E+U%E),null===_&&(_=new h(B+Math.cos(X)*Y,N+Math.sin(X)*Y,g),b.push(_),I+=.01);I<1+G;)w=U*I+X,x=B+Math.cos(w)*Y,T=N+Math.sin(w)*Y,_.points.push(new o(x,T,g)),I+=.01;w=U+X,x=B+Math.cos(w)*Y,T=N+Math.sin(w)*Y,_.points.push(new o(x,T,g));break;case s.FILL_RECT:c.batchFillRect(p[++R],p[++R],p[++R],p[++R],f,d);break;case s.FILL_TRIANGLE:c.batchFillTriangle(p[++R],p[++R],p[++R],p[++R],p[++R],p[++R],f,d);break;case s.STROKE_TRIANGLE:c.batchStrokeTriangle(p[++R],p[++R],p[++R],p[++R],p[++R],p[++R],g,f,d);break;case s.LINE_TO:null!==_?_.points.push(new o(p[++R],p[++R],g)):(_=new h(p[++R],p[++R],g),b.push(_));break;case s.MOVE_TO:_=new h(p[++R],p[++R],g),b.push(_);break;case s.SAVE:l.push(f.copyToArray());break;case s.RESTORE:f.copyFromArray(l.pop());break;case s.TRANSLATE:B=p[++R],N=p[++R],f.translate(B,N);break;case s.SCALE:B=p[++R],N=p[++R],f.scale(B,N);break;case s.ROTATE:f.rotate(p[++R])}t.pipelines.postBatch(e)}}},59192:(t,e,i)=>{var s=i(83979),r=i(56694),n=i(56631),a=i(6659),o=i(71608),h=i(72632),l=i(10850),u=i(42911),c=i(75757),d=i(58403),f=i(13747),p=new r({Extends:a,initialize:function(t,e,i){a.call(this),i?e&&!Array.isArray(e)&&(e=[e]):Array.isArray(e)?u(e[0])&&(i=e,e=null):u(e)&&(i=e,e=null),this.scene=t,this.children=new d,this.isParent=!0,this.type="Group",this.classType=h(i,"classType",f),this.name=h(i,"name",""),this.active=h(i,"active",!0),this.maxSize=h(i,"maxSize",-1),this.defaultKey=h(i,"defaultKey",null),this.defaultFrame=h(i,"defaultFrame",null),this.runChildUpdate=h(i,"runChildUpdate",!1),this.createCallback=h(i,"createCallback",null),this.removeCallback=h(i,"removeCallback",null),this.createMultipleCallback=h(i,"createMultipleCallback",null),this.internalCreateCallback=h(i,"internalCreateCallback",null),this.internalRemoveCallback=h(i,"internalRemoveCallback",null),e&&this.addMultiple(e),i&&this.createMultiple(i),this.on(n.ADDED_TO_SCENE,this.addedToScene,this),this.on(n.REMOVED_FROM_SCENE,this.removedFromScene,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},create:function(t,e,i,s,r,n){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.defaultKey),void 0===s&&(s=this.defaultFrame),void 0===r&&(r=!0),void 0===n&&(n=!0),this.isFull())return null;var a=new this.classType(this.scene,t,e,i,s);return a.addToDisplayList(this.scene.sys.displayList),a.addToUpdateList(),a.visible=r,a.setActive(n),this.add(a),a},createMultiple:function(t){if(this.isFull())return[];Array.isArray(t)||(t=[t]);var e=[];if(t[0].key)for(var i=0;i=0;u--)if((l=d[u]).active===i){if(++c===e)break}else l=null;return l?("number"==typeof r&&(l.x=r),"number"==typeof n&&(l.y=n),l):s?this.create(r,n,a,o,h):null},get:function(t,e,i,s,r){return this.getFirst(!1,!0,t,e,i,s,r)},getFirstAlive:function(t,e,i,s,r,n){return this.getFirst(!0,t,e,i,s,r,n)},getFirstDead:function(t,e,i,s,r,n){return this.getFirst(!1,t,e,i,s,r,n)},playAnimation:function(t,e){return s.PlayAnimation(this.children.entries,t,e),this},isFull:function(){return-1!==this.maxSize&&this.children.size>=this.maxSize},countActive:function(t){void 0===t&&(t=!0);for(var e=0,i=0;i{var s=i(99325),r=i(59192);s.register("group",(function(t){return new r(this.scene,null,t)}))},62598:(t,e,i)=>{var s=i(59192);i(61286).register("group",(function(t,e){return this.updateList.add(new s(this.scene,t,e))}))},1539:(t,e,i)=>{var s=i(56694),r=i(64937),n=i(89980),a=i(57322),o=new s({Extends:n,Mixins:[r.Alpha,r.BlendMode,r.Depth,r.Flip,r.FX,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.ScrollFactor,r.Size,r.TextureCrop,r.Tint,r.Transform,r.Visible,a],initialize:function(t,e,i,s,r){n.call(this,t,"Image"),this._crop=this.resetCropObject(),this.setTexture(s,r),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline()}});t.exports=o},57786:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),t.batchSprite(e,e.frame,i,s)}},83556:(t,e,i)=>{var s=i(88933),r=i(99325),n=i(20494),a=i(1539);r.register("image",(function(t,e){void 0===t&&(t={});var i=n(t,"key",null),r=n(t,"frame",null),o=new a(this.scene,0,0,i,r);return void 0!==e&&(t.add=e),s(this.scene,o,t),o}))},20927:(t,e,i)=>{var s=i(1539);i(61286).register("image",(function(t,e,i,r){return this.displayList.add(new s(this.scene,t,e,i,r))}))},57322:(t,e,i)=>{var s=i(72283),r=i(72283);s=i(59390),r=i(57786),t.exports={renderWebGL:s,renderCanvas:r}},59390:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),this.pipeline.batchSprite(e,i,s)}},48013:(t,e,i)=>{var s={Events:i(56631),DisplayList:i(91713),GameObjectCreator:i(99325),GameObjectFactory:i(61286),UpdateList:i(92034),Components:i(64937),GetCalcMatrix:i(73329),BuildGameObject:i(88933),BuildGameObjectAnimation:i(32291),GameObject:i(89980),BitmapText:i(44616),Blitter:i(52816),Bob:i(41664),Container:i(70339),DOMElement:i(38943),DynamicBitmapText:i(13468),Extern:i(39419),Graphics:i(33182),Group:i(59192),Image:i(1539),Layer:i(85305),Particles:i(27684),PathFollower:i(29598),RenderTexture:i(15996),RetroFont:i(55873),Rope:i(79968),Sprite:i(13747),Text:i(76555),GetTextSize:i(32979),MeasureText:i(27030),TextStyle:i(74744),TileSprite:i(35856),Zone:i(71030),Video:i(8630),Shape:i(91461),Arc:i(28593),Curve:i(15220),Ellipse:i(28591),Grid:i(39169),IsoBox:i(4415),IsoTriangle:i(65159),Line:i(579),Polygon:i(91249),Rectangle:i(517),Star:i(77843),Triangle:i(21873),Factories:{Blitter:i(38906),Container:i(23400),DOMElement:i(66788),DynamicBitmapText:i(94145),Extern:i(41155),Graphics:i(13122),Group:i(62598),Image:i(20927),Layer:i(17676),Particles:i(30439),PathFollower:i(19626),RenderTexture:i(29599),Rope:i(31982),Sprite:i(66135),StaticBitmapText:i(21797),Text:i(94627),TileSprite:i(20509),Zone:i(34546),Video:i(215),Arc:i(10369),Curve:i(10147),Ellipse:i(99869),Grid:i(9326),IsoBox:i(88154),IsoTriangle:i(67765),Line:i(85665),Polygon:i(88203),Rectangle:i(94355),Star:i(23962),Triangle:i(79296)},Creators:{Blitter:i(68452),Container:i(44516),DynamicBitmapText:i(67513),Graphics:i(41286),Group:i(61295),Image:i(83556),Layer:i(56378),Particles:i(38842),RenderTexture:i(85692),Rope:i(96027),Sprite:i(89219),StaticBitmapText:i(95499),Text:i(75397),TileSprite:i(63950),Zone:i(24067),Video:i(65601)}};s.Shader=i(27902),s.Mesh=i(83321),s.PointLight=i(13171),s.Factories.Shader=i(51979),s.Factories.Mesh=i(8767),s.Factories.PointLight=i(91201),s.Creators.Shader=i(13908),s.Creators.Mesh=i(41839),s.Creators.PointLight=i(162),s.Light=i(14455),s.LightsManager=i(26193),s.LightsPlugin=i(50296),t.exports=s},85305:(t,e,i)=>{var s=i(95723),r=i(56694),n=i(64937),a=i(48129),o=i(81078),h=i(6659),l=i(56631),u=i(71207),c=i(58010),d=i(7599),f=i(17922),p=new r({Extends:u,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Mask,n.Pipeline,n.Visible,h,c],initialize:function(t,e){u.call(this,t),h.call(this),this.scene=t,this.displayList=null,this.type="Layer",this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.systems=t.sys,this.events=t.sys.events,this.sortChildrenFlag=!1,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.initPipeline(),this.clearAlpha(),this.setBlendMode(s.SKIP_CHECK),e&&this.add(e),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new o(this)),this},setData:function(t,e){return this.data||(this.data=new o(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new o(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new o(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new o(this)),this.data.get(t)},setInteractive:function(){return this},disableInteractive:function(){return this},removeInteractive:function(){return this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return a(this)},willRender:function(t){return!(15!==this.renderFlags||0===this.list.length||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return i.unshift(this.displayList.getIndex(t)),i},addChildCallback:function(t){t.displayList&&t.displayList!==this&&t.removeFromDisplayList(),t.displayList||(this.queueDepthSort(),t.displayList=this,t.emit(l.ADDED_TO_SCENE,t,this.scene),this.events.emit(d.ADDED_TO_SCENE,t,this.scene))},removeChildCallback:function(t){this.queueDepthSort(),t.displayList=null,t.emit(l.REMOVED_FROM_SCENE,t,this.scene),this.events.emit(d.REMOVED_FROM_SCENE,t,this.scene)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(f(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},getChildren:function(){return this.list},addToDisplayList:function(t){return void 0===t&&(t=this.scene.sys.displayList),this.displayList&&this.displayList!==t&&this.removeFromDisplayList(),t.exists(this)||(this.displayList=t,t.add(this,!0),t.queueDepthSort(),this.emit(l.ADDED_TO_SCENE,this,this.scene),t.events.emit(d.ADDED_TO_SCENE,this,this.scene)),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(l.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(d.REMOVED_FROM_SCENE,this,this.scene)),this},destroy:function(){if(this.scene&&!this.ignoreDestroy){this.emit(l.DESTROY,this);for(var t=this.list.length;t--;)this.list[t].destroy();this.removeAllListeners(),this.resetPostPipeline(!0),this.displayList&&(this.displayList.remove(this,!0),this.displayList.queueDepthSort()),this.data&&(this.data.destroy(),this.data=void 0),this.active=!1,this.visible=!1,this.list=void 0,this.scene=void 0,this.displayList=void 0,this.systems=void 0,this.events=void 0}}});t.exports=p},834:t=>{t.exports=function(t,e,i){var s=e.list;if(0!==s.length){e.depthSort();var r=-1!==e.blendMode;r||t.setBlendMode(0);var n=e._alpha;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var a=0;a{var s=i(88933),r=i(85305),n=i(99325),a=i(20494);n.register("layer",(function(t,e){void 0===t&&(t={});var i=a(t,"children",null),n=new r(this.scene,i);return void 0!==e&&(t.add=e),s(this.scene,n,t),n}))},17676:(t,e,i)=>{var s=i(85305);i(61286).register("layer",(function(t){return this.displayList.add(new s(this.scene,t))}))},58010:(t,e,i)=>{var s=i(72283),r=i(72283);s=i(17576),r=i(834),t.exports={renderWebGL:s,renderCanvas:r}},17576:t=>{t.exports=function(t,e,i){var s=e.list,r=s.length;if(0!==r){e.depthSort(),t.pipelines.preBatch(e);var n=-1!==e.blendMode;n||t.setBlendMode(0);for(var a=e.alpha,o=0;o{var s=i(26673),r=i(56694),n=i(64937),a=i(39298),o=i(75512),h=new r({Extends:s,Mixins:[n.ScrollFactor,n.Visible],initialize:function(t,e,i,r,n,o,h){s.call(this,t,e,i),this.color=new a(r,n,o),this.intensity=h,this.renderFlags=15,this.cameraFilter=0,this.setScrollFactor(1,1)},willRender:function(t){return!(h.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},setColor:function(t){var e=o.getFloatsFromUintRGB(t);return this.color.set(e[0],e[1],e[2]),this},setIntensity:function(t){return this.intensity=t,this},setRadius:function(t){return this.radius=t,this}});h.RENDER_MASK=15,t.exports=h},26193:(t,e,i)=>{var s=i(26535),r=i(56694),n=i(53996),a=i(14455),o=i(13171),h=i(39298),l=i(72677),u=i(17922),c=i(75512),d=new r({initialize:function(){this.lights=[],this.ambientColor=new h(.1,.1,.1),this.active=!1,this.maxLights=-1,this.visibleLights=0},addPointLight:function(t,e,i,s,r,n){return this.systems.displayList.add(new o(this.scene,t,e,i,s,r,n))},enable:function(){return-1===this.maxLights&&(this.maxLights=this.systems.renderer.config.maxLights),this.active=!0,this},disable:function(){return this.active=!1,this},getLights:function(t){for(var e=this.lights,i=t.worldView,r=[],a=0;athis.maxLights&&(u(r,this.sortByDistance),r=r.slice(0,this.maxLights)),this.visibleLights=r.length,r},sortByDistance:function(t,e){return t.distance>=e.distance},setAmbientColor:function(t){var e=c.getFloatsFromUintRGB(t);return this.ambientColor.set(e[0],e[1],e[2]),this},getMaxVisibleLights:function(){return this.maxLights},getLightCount:function(){return this.lights.length},addLight:function(t,e,i,s,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=128),void 0===s&&(s=16777215),void 0===r&&(r=1);var n=c.getFloatsFromUintRGB(s),o=new a(t,e,i,n[0],n[1],n[2],r);return this.lights.push(o),o},removeLight:function(t){var e=this.lights.indexOf(t);return e>=0&&l(this.lights,e),this},shutdown:function(){this.lights.length=0},destroy:function(){this.shutdown()}});t.exports=d},50296:(t,e,i)=>{var s=i(56694),r=i(26193),n=i(91963),a=i(7599),o=new s({Extends:r,initialize:function(t){this.scene=t,this.systems=t.sys,t.sys.settings.isBooted||t.sys.events.once(a.BOOT,this.boot,this),r.call(this)},boot:function(){var t=this.systems.events;t.on(a.SHUTDOWN,this.shutdown,this),t.on(a.DESTROY,this.destroy,this)},destroy:function(){this.shutdown(),this.scene=void 0,this.systems=void 0}});n.register("LightsPlugin",o,"lights"),t.exports=o},83321:(t,e,i)=>{var s=i(56694),r=i(64937),n=i(75606),a=i(18693),o=i(89980),h=i(67623),l=i(53267),u=i(73329),c=i(16650),d=i(23464),f=i(17922),p=i(70015),v=i(85769),g=new s({Extends:o,Mixins:[r.AlphaSingle,r.BlendMode,r.Depth,r.Mask,r.Pipeline,r.Size,r.Texture,r.Transform,r.Visible,r.ScrollFactor,d],initialize:function(t,e,i,s,r,n,a,h,l,u,d,f){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s="__WHITE"),o.call(this,t,"Mesh"),this.faces=[],this.vertices=[],this.tintFill=!1,this.debugCallback=null,this.debugGraphic=null,this.hideCCW=!0,this.modelPosition=new p,this.modelScale=new p(1,1,1),this.modelRotation=new p,this.dirtyCache=[0,0,0,0,0,0,0,0,0,0,0,0],this.transformMatrix=new c,this.viewPosition=new p,this.viewMatrix=new c,this.projectionMatrix=new c,this.totalRendered=0,this.totalFrame=0,this.ignoreDirtyCache=!1;var v=t.sys.renderer;this.setPosition(e,i),this.setTexture(s,r),this.setSize(v.width,v.height),this.initPipeline(),this.setPerspective(v.width,v.height),n&&this.addVertices(n,a,h,l,u,d,f)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},panX:function(t){return this.viewPosition.addScale(p.LEFT,t),this.dirtyCache[10]=1,this},panY:function(t){return this.viewPosition.y+=p.DOWN.y*t,this.dirtyCache[10]=1,this},panZ:function(t){return this.viewPosition.z+=t,this.dirtyCache[10]=1,this},setPerspective:function(t,e,i,s,r){return void 0===i&&(i=45),void 0===s&&(s=.01),void 0===r&&(r=1e3),this.projectionMatrix.perspective(n(i),t/e,s,r),this.dirtyCache[10]=1,this.dirtyCache[11]=0,this},setOrtho:function(t,e,i,s){return void 0===t&&(t=this.scene.sys.renderer.getAspectRatio()),void 0===e&&(e=1),void 0===i&&(i=-1e3),void 0===s&&(s=1e3),this.projectionMatrix.ortho(-t,t,-e,e,i,s),this.dirtyCache[10]=1,this.dirtyCache[11]=1,this},clear:function(){return this.faces.forEach((function(t){t.destroy()})),this.faces=[],this.vertices=[],this},addVerticesFromObj:function(t,e,i,s,r,n,a,o,h){var u=this.scene.sys.cache.obj.get(t);return u&&l(u,this,e,i,s,r,n,a,o,h),this},sortByDepth:function(t,e){return t.depth-e.depth},depthSort:function(){return f(this.faces,this.sortByDepth),this},addVertex:function(t,e,i,s,r,n,a){var o=new v(t,e,i,s,r,n,a);return this.vertices.push(o),o},addFace:function(t,e,i){var s=new a(t,e,i);return this.faces.push(s),this.dirtyCache[9]=-1,s},addVertices:function(t,e,i,s,r,n,a){var o=h(t,e,i,s,r,n,a);return o&&(this.faces=this.faces.concat(o.faces),this.vertices=this.vertices.concat(o.vertices)),this.dirtyCache[9]=-1,this},getFaceCount:function(){return this.faces.length},getVertexCount:function(){return this.vertices.length},getFace:function(t){return this.faces[t]},getFaceAt:function(t,e,i){void 0===i&&(i=this.scene.sys.cameras.main);for(var s=u(this,i).calc,r=this.faces,n=[],a=0;a{t.exports=function(){}},41839:(t,e,i)=>{var s=i(88933),r=i(99325),n=i(20494),a=i(10850),o=i(83321);r.register("mesh",(function(t,e){void 0===t&&(t={});var i=n(t,"key",null),r=n(t,"frame",null),h=a(t,"vertices",[]),l=a(t,"uvs",[]),u=a(t,"indicies",[]),c=a(t,"containsZ",!1),d=a(t,"normals",[]),f=a(t,"colors",16777215),p=a(t,"alphas",1),v=new o(this.scene,0,0,i,r,h,l,u,c,d,f,p);return void 0!==e&&(t.add=e),s(this.scene,v,t),v}))},8767:(t,e,i)=>{var s=i(83321);i(61286).register("mesh",(function(t,e,i,r,n,a,o,h,l,u,c){return this.displayList.add(new s(this.scene,t,e,i,r,n,a,o,h,l,u,c))}))},23464:(t,e,i)=>{var s=i(72283),r=i(72283);s=i(57410),r=i(6317),t.exports={renderWebGL:s,renderCanvas:r}},57410:(t,e,i)=>{var s=i(73329);t.exports=function(t,e,i,r){var n=e.faces,a=n.length;if(0!==a){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline,e),h=s(e,i,r).calc,l=o.setGameObject(e),u=o.vertexViewF32,c=o.vertexViewU32,d=o.vertexCount*o.currentShader.vertexComponentCount-1,f=e.tintFill,p=[],v=e.debugCallback,g=h.a,m=h.b,y=h.c,x=h.d,T=h.e,w=h.f,E=e.viewPosition.z,b=e.hideCCW,S=i.roundPixels,A=i.alpha*e.alpha,_=0;t.pipelines.preBatch(e);for(var C=0;C{var s=i(56694),r=i(61616),n=i(21902),a=i(72632),o=i(1071),h=new s({initialize:function(t,e,i,s){void 0===s&&(s=!1),this.propertyKey=e,this.propertyValue=i,this.defaultValue=i,this.steps=0,this.counter=0,this.start=0,this.end=0,this.ease,this.emitOnly=s,this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,this.loadConfig(t)},loadConfig:function(t,e){void 0===t&&(t={}),e&&(this.propertyKey=e),this.propertyValue=a(t,this.propertyKey,this.defaultValue),this.setMethods(),this.emitOnly&&(this.onUpdate=this.defaultUpdate)},toJSON:function(){return this.propertyValue},onChange:function(t){return this.propertyValue=t,this.setMethods()},setMethods:function(){var t=this.propertyValue,e=typeof t;if(this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,"number"===e)this.onEmit=this.staticValueEmit,this.onUpdate=this.staticValueUpdate;else if(Array.isArray(t))this.onEmit=this.randomStaticValueEmit;else if("function"===e)this.emitOnly?this.onEmit=t:this.onUpdate=t;else if("object"===e&&this.hasBoth(t,"start","end")){this.start=t.start,this.end=t.end;var i=this.has(t,"random");if(i&&(this.onEmit=this.randomRangedValueEmit),this.has(t,"steps"))this.steps=t.steps,this.counter=this.start,this.onEmit=this.steppedEmit;else{var s=this.has(t,"ease")?t.ease:"Linear";this.ease=n(s,t.easeParams),i||(this.onEmit=this.easedValueEmit),this.onUpdate=this.easeValueUpdate}}else if("object"===e&&this.hasBoth(t,"min","max"))this.start=t.min,this.end=t.max,this.onEmit=this.randomRangedValueEmit;else if("object"===e&&this.has(t,"random")){var r=t.random;Array.isArray(r)&&(this.start=r[0],this.end=r[1]),this.onEmit=this.randomRangedValueEmit}else"object"===e&&this.hasEither(t,"onEmit","onUpdate")&&(this.has(t,"onEmit")&&(this.onEmit=t.onEmit),this.has(t,"onUpdate")&&(this.onUpdate=t.onUpdate));return this},has:function(t,e){return t.hasOwnProperty(e)},hasBoth:function(t,e,i){return t.hasOwnProperty(e)&&t.hasOwnProperty(i)},hasEither:function(t,e,i){return t.hasOwnProperty(e)||t.hasOwnProperty(i)},defaultEmit:function(t,e,i){return i},defaultUpdate:function(t,e,i,s){return s},staticValueEmit:function(){return this.propertyValue},staticValueUpdate:function(){return this.propertyValue},randomStaticValueEmit:function(){var t=Math.floor(Math.random()*this.propertyValue.length);return this.propertyValue[t]},randomRangedValueEmit:function(t,e){var i=r(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i),i},steppedEmit:function(){var t=this.counter,e=this.counter+(this.end-this.start)/this.steps;return this.counter=o(e,this.start,this.end),t},easedValueEmit:function(t,e){if(t&&t.data[e]){var i=t.data[e];i.min=this.start,i.max=this.end}return this.start},easeValueUpdate:function(t,e,i){var s=t.data[e];return(s.max-s.min)*this.ease(i)+s.min}});t.exports=h},87811:(t,e,i)=>{var s=i(56694),r=i(72632),n=new s({initialize:function(t,e,i,s,n){if("object"==typeof t){var a=t;t=r(a,"x",0),e=r(a,"y",0),i=r(a,"power",0),s=r(a,"epsilon",100),n=r(a,"gravity",50)}else void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=100),void 0===n&&(n=50);this.x=t,this.y=e,this.active=!0,this._gravity=n,this._power=0,this._epsilon=0,this.power=i,this.epsilon=s},update:function(t,e){var i=this.x-t.x,s=this.y-t.y,r=i*i+s*s;if(0!==r){var n=Math.sqrt(r);r{var s=i(56694),r=i(75606),n=i(53996),a=new s({initialize:function(t){this.emitter=t,this.frame=null,this.x=0,this.y=0,this.velocityX=0,this.velocityY=0,this.accelerationX=0,this.accelerationY=0,this.maxVelocityX=1e4,this.maxVelocityY=1e4,this.bounce=0,this.scaleX=1,this.scaleY=1,this.alpha=1,this.angle=0,this.rotation=0,this.tint=16777215,this.life=1e3,this.lifeCurrent=1e3,this.delayCurrent=0,this.lifeT=0,this.data={tint:{min:16777215,max:16777215,current:16777215},alpha:{min:1,max:1},rotate:{min:0,max:0},scaleX:{min:1,max:1},scaleY:{min:1,max:1}}},isAlive:function(){return this.lifeCurrent>0},resetPosition:function(){this.x=0,this.y=0},fire:function(t,e){var i=this.emitter;if(this.frame=i.getFrame(),!this.frame)throw new Error("Particle has no texture frame");i.emitZone&&i.emitZone.getPoint(this),this.x+=void 0===t?i.x.onEmit(this,"x"):t,this.y+=void 0===e?i.y.onEmit(this,"y"):e,this.life=i.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0;var s=i.speedX.onEmit(this,"speedX"),a=i.speedY?i.speedY.onEmit(this,"speedY"):s;if(i.radial){var o=r(i.angle.onEmit(this,"angle"));this.velocityX=Math.cos(o)*Math.abs(s),this.velocityY=Math.sin(o)*Math.abs(a)}else if(i.moveTo){var h=i.moveToX.onEmit(this,"moveToX"),l=i.moveToY?i.moveToY.onEmit(this,"moveToY"):h,u=Math.atan2(l-this.y,h-this.x),c=n(this.x,this.y,h,l)/(this.life/1e3);this.velocityX=Math.cos(u)*c,this.velocityY=Math.sin(u)*c}else this.velocityX=s,this.velocityY=a;i.acceleration&&(this.accelerationX=i.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=i.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=i.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=i.maxVelocityY.onEmit(this,"maxVelocityY"),this.delayCurrent=i.delay.onEmit(this,"delay"),this.scaleX=i.scaleX.onEmit(this,"scaleX"),this.scaleY=i.scaleY?i.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=i.rotate.onEmit(this,"rotate"),this.rotation=r(this.angle),this.bounce=i.bounce.onEmit(this,"bounce"),this.alpha=i.alpha.onEmit(this,"alpha"),this.tint=i.tint.onEmit(this,"tint")},computeVelocity:function(t,e,i,s){var r=this.velocityX,n=this.velocityY,a=this.accelerationX,o=this.accelerationY,h=this.maxVelocityX,l=this.maxVelocityY;r+=t.gravityX*i,n+=t.gravityY*i,a&&(r+=a*i),o&&(n+=o*i),r>h?r=h:r<-h&&(r=-h),n>l?n=l:n<-l&&(n=-l),this.velocityX=r,this.velocityY=n;for(var u=0;ue.right&&t.collideRight&&(this.x=e.right,this.velocityX*=i),this.ye.bottom&&t.collideBottom&&(this.y=e.bottom,this.velocityY*=i)},update:function(t,e,i){if(this.delayCurrent>0)return this.delayCurrent-=t,!1;var s=this.emitter,n=1-this.lifeCurrent/this.life;return this.lifeT=n,this.computeVelocity(s,t,e,i),this.x+=this.velocityX*e,this.y+=this.velocityY*e,s.bounds&&this.checkBounds(s),s.deathZone&&s.deathZone.willKill(this)?(this.lifeCurrent=0,!0):(this.scaleX=s.scaleX.onUpdate(this,"scaleX",n,this.scaleX),s.scaleY?this.scaleY=s.scaleY.onUpdate(this,"scaleY",n,this.scaleY):this.scaleY=this.scaleX,this.angle=s.rotate.onUpdate(this,"rotate",n,this.angle),this.rotation=r(this.angle),this.alpha=s.alpha.onUpdate(this,"alpha",n,this.alpha),this.tint=s.tint.onUpdate(this,"tint",n,this.tint),this.lifeCurrent-=t,this.lifeCurrent<=0)}});t.exports=a},9216:(t,e,i)=>{var s=i(95723),r=i(56694),n=i(64937),a=i(69361),o=i(54213),h=i(93025),l=i(72632),u=i(72861),c=i(53523),d=i(19256),f=i(14909),p=i(68433),v=i(74118),g=i(17922),m=i(93736),y=i(1071),x=new r({Mixins:[n.BlendMode,n.Mask,n.ScrollFactor,n.Visible],initialize:function(t,e){this.manager=t,this.texture=t.texture,this.frames=[t.defaultFrame],this.defaultFrame=t.defaultFrame,this.configFastMap=["active","blendMode","collideBottom","collideLeft","collideRight","collideTop","deathCallback","deathCallbackScope","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxParticles","name","on","particleBringToTop","particleClass","radial","timeScale","trackVisible","visible"],this.configOpMap=["accelerationX","accelerationY","angle","alpha","bounce","delay","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],this.name="",this.particleClass=f,this.x=new h(e,"x",0,!0),this.y=new h(e,"y",0,!0),this.radial=!0,this.gravityX=0,this.gravityY=0,this.acceleration=!1,this.accelerationX=new h(e,"accelerationX",0,!0),this.accelerationY=new h(e,"accelerationY",0,!0),this.maxVelocityX=new h(e,"maxVelocityX",1e4,!0),this.maxVelocityY=new h(e,"maxVelocityY",1e4,!0),this.speedX=new h(e,"speedX",0,!0),this.speedY=new h(e,"speedY",0,!0),this.moveTo=!1,this.moveToX=new h(e,"moveToX",0,!0),this.moveToY=new h(e,"moveToY",0,!0),this.bounce=new h(e,"bounce",0,!0),this.scaleX=new h(e,"scaleX",1),this.scaleY=new h(e,"scaleY",1),this.tint=new h(e,"tint",16777215),this.alpha=new h(e,"alpha",1),this.lifespan=new h(e,"lifespan",1e3,!0),this.angle=new h(e,"angle",{min:0,max:360},!0),this.rotate=new h(e,"rotate",0),this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.maxParticles=0,this.quantity=new h(e,"quantity",1,!0),this.delay=new h(e,"delay",0,!0),this.frequency=0,this.on=!0,this.particleBringToTop=!0,this.timeScale=1,this.emitZone=null,this.deathZone=null,this.bounds=null,this.collideLeft=!0,this.collideRight=!0,this.collideTop=!0,this.collideBottom=!0,this.active=!0,this.visible=!0,this.blendMode=s.NORMAL,this.follow=null,this.followOffset=new m,this.trackVisible=!1,this.currentFrame=0,this.randomFrame=!0,this.frameQuantity=1,this.dead=[],this.alive=[],this._counter=0,this._frameCounter=0,e&&this.fromJSON(e)},fromJSON:function(t){if(!t)return this;var e=0,i="";for(e=0;e0&&this.getParticleCount()===this.maxParticles},onParticleEmit:function(t,e){return void 0===t?(this.emitCallback=null,this.emitCallbackScope=null):"function"==typeof t&&(this.emitCallback=t,e&&(this.emitCallbackScope=e)),this},onParticleDeath:function(t,e){return void 0===t?(this.deathCallback=null,this.deathCallbackScope=null):"function"==typeof t&&(this.deathCallback=t,e&&(this.deathCallbackScope=e)),this},killAll:function(){for(var t=this.dead,e=this.alive;e.length>0;)t.push(e.pop());return this},forEachAlive:function(t,e){for(var i=this.alive,s=i.length,r=0;r0){var u=this.deathCallback,c=this.deathCallbackScope;for(a=h-1;a>=0;a--){var d=o[a];r.splice(d.index,1),n.push(d.particle),u&&u.call(c,d.particle),d.particle.resetPosition()}}this.on&&(0===this.frequency?this.emitParticle():this.frequency>0&&(this._counter-=e,this._counter<=0&&(this.emitParticle(),this._counter=this.frequency-Math.abs(this._counter))))},depthSortCallback:function(t,e){return t.y-e.y}});t.exports=x},84622:(t,e,i)=>{var s=i(56694),r=i(64937),n=i(89980),a=i(87811),o=i(71207),h=i(9216),l=i(72745),u=new s({Extends:n,Mixins:[r.Depth,r.Mask,r.Pipeline,r.Transform,r.Visible,l],initialize:function(t,e,i,s){if(n.call(this,t,"ParticleEmitterManager"),this.blendMode=-1,this.timeScale=1,this.texture=null,this.frame=null,this.frameNames=[],null===i||"object"!=typeof i&&!Array.isArray(i)||(s=i,i=null),this.setTexture(e,i),this.initPipeline(),this.emitters=new o(this),this.wells=new o(this),s){Array.isArray(s)||(s=[s]);for(var r=0;r0?e.defaultFrame=i[0]:(console.warn("No texture frames were set"),e.defaultFrame=this.defaultFrame),this},addEmitter:function(t){return this.emitters.add(t)},createEmitter:function(t){return this.addEmitter(new h(this,t))},removeEmitter:function(t){return this.emitters.remove(t,!0)},addGravityWell:function(t){return this.wells.add(t)},createGravityWell:function(t){return this.addGravityWell(new a(t))},emitParticle:function(t,e,i){for(var s=this.emitters.list,r=0;r{var s=i(69360),r=new s,n=new s,a=new s,o=new s;t.exports=function(t,e,i,s){var h=e.emitters.list,l=h.length;if(0!==l){var u=r.copyFrom(i.matrix),c=n,d=a,f=o;s?(f.loadIdentity(),f.multiply(s),f.translate(e.x,e.y),f.rotate(e.rotation),f.scale(e.scaleX,e.scaleY)):f.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);for(var p=t.currentContext,v=i.roundPixels,g=0;g{var s=i(99325),r=i(20494),n=i(72632),a=i(84622);s.register("particles",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),s=r(t,"frame",null),o=n(t,"emitters",null),h=new a(this.scene,i,s,o);return void 0!==e&&(t.add=e),n(t,"add",!1)?this.displayList.add(h):this.updateList.add(h),h}))},30439:(t,e,i)=>{var s=i(61286),r=i(84622);s.register("particles",(function(t,e,i){return this.displayList.add(new r(this.scene,t,e,i))}))},72745:(t,e,i)=>{var s=i(72283),r=i(72283);s=i(58971),r=i(66545),t.exports={renderWebGL:s,renderCanvas:r}},58971:(t,e,i)=>{var s=i(69360),r=i(75512),n=new s,a=new s,o=new s,h=new s;t.exports=function(t,e,i,s){var l=e.emitters.list,u=l.length;if(0!==u){var c=t.pipelines.set(e.pipeline),d=n,f=a,p=o,v=h;s?(v.loadIdentity(),v.multiply(s),v.translate(e.x,e.y),v.rotate(e.rotation),v.scale(e.scaleX,e.scaleY)):v.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var g=i.roundPixels,m=e.defaultFrame.glTexture,y=r.getTintAppendFloatAlpha,x=c.setGameObject(e,e.defaultFrame);t.pipelines.preBatch(e);for(var T=0;T{t.exports={EmitterOp:i(93025),GravityWell:i(87811),Particle:i(14909),ParticleEmitter:i(9216),ParticleEmitterManager:i(84622),Zones:i(25962)}},69361:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e){this.source=t,this.killOnEnter=e},willKill:function(t){var e=this.source.contains(t.x,t.y);return e&&this.killOnEnter||!e&&!this.killOnEnter}});t.exports=s},54213:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s,r){void 0===s&&(s=!1),void 0===r&&(r=!0),this.source=t,this.points=[],this.quantity=e,this.stepRate=i,this.yoyo=s,this.counter=-1,this.seamless=r,this._length=0,this._direction=0,this.updateSource()},updateSource:function(){if(this.points=this.source.getPoints(this.quantity,this.stepRate),this.seamless){var t=this.points[0],e=this.points[this.points.length-1];t.x===e.x&&t.y===e.y&&this.points.pop()}var i=this._length;return this._length=this.points.length,this._lengththis._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=s},68433:(t,e,i)=>{var s=i(56694),r=i(93736),n=new s({initialize:function(t){this.source=t,this._tempVec=new r},getPoint:function(t){var e=this._tempVec;this.source.getRandomPoint(e),t.x=e.x,t.y=e.y}});t.exports=n},25962:(t,e,i)=>{t.exports={DeathZone:i(69361),EdgeZone:i(54213),RandomZone:i(68433)}},29598:(t,e,i)=>{var s=i(56694),r=i(64937),n=i(13747),a=new s({Extends:n,Mixins:[r.PathFollower],initialize:function(t,e,i,s,r,a){n.call(this,t,i,s,r,a),this.path=e},preUpdate:function(t,e){this.anims.update(t,e),this.pathUpdate(t)}});t.exports=a},19626:(t,e,i)=>{var s=i(61286),r=i(29598);s.register("follower",(function(t,e,i,s,n){var a=new r(this.scene,t,e,i,s,n);return this.displayList.add(a),this.updateList.add(a),a}))},13171:(t,e,i)=>{var s=i(56694),r=i(64937),n=i(89980),a=i(74853),o=i(65641),h=i(71606),l=new s({Extends:n,Mixins:[r.AlphaSingle,r.BlendMode,r.Depth,r.GetBounds,r.Mask,r.Pipeline,r.ScrollFactor,r.Transform,r.Visible,h],initialize:function(t,e,i,s,r,h,l){void 0===s&&(s=16777215),void 0===r&&(r=128),void 0===h&&(h=1),void 0===l&&(l=.1),n.call(this,t,"PointLight"),this.initPipeline(o.POINTLIGHT_PIPELINE),this.setPosition(e,i),this.color=a(s),this.intensity=h,this.attenuation=l,this.width=2*r,this.height=2*r,this._radius=r},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this.width=2*t,this.height=2*t}},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return this._radius}},displayOriginY:{get:function(){return this._radius}}});t.exports=l},162:(t,e,i)=>{var s=i(88933),r=i(99325),n=i(20494),a=i(13171);r.register("pointlight",(function(t,e){void 0===t&&(t={});var i=n(t,"color",16777215),r=n(t,"radius",128),o=n(t,"intensity",1),h=n(t,"attenuation",.1),l=new a(this.scene,0,0,i,r,o,h);return void 0!==e&&(t.add=e),s(this.scene,l,t),l}))},91201:(t,e,i)=>{var s=i(61286),r=i(13171);s.register("pointlight",(function(t,e,i,s,n,a){return this.displayList.add(new r(this.scene,t,e,i,s,n,a))}))},71606:(t,e,i)=>{var s=i(72283),r=i(72283);s=i(80590),t.exports={renderWebGL:s,renderCanvas:r}},80590:(t,e,i)=>{var s=i(73329);t.exports=function(t,e,i,r){i.addToRenderList(e);var n=t.pipelines.set(e.pipeline),a=s(e,i,r).calc,o=e.width,h=e.height,l=-e._radius,u=-e._radius,c=l+o,d=u+h,f=a.getX(0,0),p=a.getY(0,0),v=a.getX(l,u),g=a.getY(l,u),m=a.getX(l,d),y=a.getY(l,d),x=a.getX(c,d),T=a.getY(c,d),w=a.getX(c,u),E=a.getY(c,u);t.pipelines.preBatch(e),n.batchPointLight(e,i,v,g,m,y,x,T,w,E,f,p),t.pipelines.postBatch(e)}},15996:(t,e,i)=>{var s=i(95723),r=i(51052),n=i(61068),a=i(56694),o=i(64937),h=i(86459),l=i(82047),u=i(89980),c=i(72283),d=i(65641),f=i(92675),p=i(37410),v=i(75512),g=i(76583),m=new a({Extends:u,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Crop,o.Depth,o.Flip,o.FX,o.GetBounds,o.Mask,o.Origin,o.Pipeline,o.ScrollFactor,o.Tint,o.Transform,o.Visible,f],initialize:function(t,e,i,s,a,o,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=32),void 0===a&&(a=32),u.call(this,t,"RenderTexture"),this.renderer=t.sys.renderer,this.textureManager=t.sys.textures,this.globalTint=16777215,this.globalAlpha=1,this.canvas=null,this.dirty=!1,this._crop=this.resetCropObject(),this.texture=null,this.frame=null,this._saved=!1,void 0===o?(this.canvas=n.create2D(this,s,a),this.texture=t.sys.textures.addCanvas(g(),this.canvas),this.frame=this.texture.get()):(this.texture=t.sys.textures.get(o),this.frame=this.texture.get(l),this.canvas=this.frame.source.image,this._saved=!0,this.dirty=!0,this.width=this.frame.cutWidth,this.height=this.frame.cutHeight),this.context=this.canvas.getContext("2d"),this._eraseMode=!1,this.camera=new r(0,0,s,a),this.renderTarget=null;var f=this.renderer;f?f.type===h.WEBGL?(this.drawGameObject=this.batchGameObjectWebGL,this.renderTarget=new p(f,s,a,1,0,!1)):f.type===h.CANVAS&&(this.drawGameObject=this.batchGameObjectCanvas):this.drawGameObject=c,this.camera.setScene(t),this.setPosition(e,i),void 0===o&&this.setSize(s,a),this.setOrigin(0,0),this.initPipeline(d.SINGLE_PIPELINE)},setSize:function(t,e){return this.resize(t,e)},resize:function(t,e){void 0===e&&(e=t);var i=this.frame;if(t!==this.width||e!==this.height){if("__BASE"===i.name){this.canvas.width=t,this.canvas.height=e,this.texture.width=t,this.texture.height=e;var s=this.renderTarget;s&&(s.resize(t,e),i.glTexture=s.texture,i.source.isRenderTexture=!0,i.source.isGLTexture=!0,i.source.glTexture=s.texture),this.camera.setSize(t,e),i.source.width=t,i.source.height=e,i.setSize(t,e),this.width=t,this.height=e}}else{var r=this.texture.getSourceImage();i.cutX+t>r.width&&(t=r.width-i.cutX),i.cutY+e>r.height&&(e=r.height-i.cutY),i.setSize(t,e,i.cutX,i.cutY)}this.updateDisplayOrigin();var n=this.input;return n&&!n.customHitArea&&(n.hitArea.width=t,n.hitArea.height=e),this},setGlobalTint:function(t){return this.globalTint=t,this},setGlobalAlpha:function(t){return this.globalAlpha=t,this},saveTexture:function(t){return this.textureManager.renameTexture(this.texture.key,t),this._saved=!0,this.texture},fill:function(t,e,i,s,r,n){var a=this.frame,o=this.camera,h=this.renderer;void 0===e&&(e=1),void 0===i&&(i=0),void 0===s&&(s=0),void 0===r&&(r=a.cutWidth),void 0===n&&(n=a.cutHeight);var l=(t>>16&255)/255,u=(t>>8&255)/255,c=(255&t)/255,d=this.renderTarget;if(o.preRender(),d){d.bind(!0);var f=this.pipeline;f.manager.set(f);var p=d.width,g=d.height,m=h.width/p,y=h.height/g;f.drawFillRect(i*m,s*y,r*m,n*y,v.getTintFromFloats(c,u,l,1),e),d.unbind(!0)}else{var x=this.context;h.setContext(x),x.fillStyle="rgba("+l+","+u+","+c+","+e+")",x.fillRect(i+a.cutX,s+a.cutY,r,n),h.setContext()}return this.dirty=!0,this},clear:function(){if(this.dirty){var t=this.renderTarget;if(t)t.clear();else{var e=this.context;e.save(),e.setTransform(1,0,0,1,0,0),e.clearRect(this.frame.cutX,this.frame.cutY,this.frame.cutWidth,this.frame.cutHeight),e.restore()}this.dirty=!1}return this},erase:function(t,e,i){return this._eraseMode=!0,this.draw(t,e,i,1,16777215),this._eraseMode=!1,this},draw:function(t,e,i,s,r){return this.beginDraw(),this.batchDraw(t,e,i,s,r),this.endDraw(),this},drawFrame:function(t,e,i,s,r,n){return this.beginDraw(),this.batchDrawFrame(t,e,i,s,r,n),this.endDraw(),this},beginDraw:function(){var t=this.camera,e=this.renderer,i=this.renderTarget;return t.preRender(),i?e.beginCapture(i.width,i.height):e.setContext(this.context),this},batchDraw:function(t,e,i,s,r){return void 0===s&&(s=this.globalAlpha),r=void 0===r?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(r>>16)+(65280&r)+((255&r)<<16),Array.isArray(t)||(t=[t]),this.batchList(t,e,i,s,r),this},batchDrawFrame:function(t,e,i,s,r,n){void 0===i&&(i=0),void 0===s&&(s=0),void 0===r&&(r=this.globalAlpha),n=void 0===n?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(n>>16)+(65280&n)+((255&n)<<16);var a=this.textureManager.getFrame(t,e);return a&&(this.renderTarget?this.pipeline.batchTextureFrame(a,i,s,n,r,this.camera.matrix,null):this.batchTextureFrame(a,i+this.frame.cutX,s+this.frame.cutY,r,n)),this},endDraw:function(t){void 0===t&&(t=this._eraseMode);var e=this.renderer,i=this.renderTarget;if(i){var s=e.endCapture();e.pipelines.setUtility().blitFrame(s,i,1,!1,!1,t),e.resetScissor(),e.resetViewport()}else e.setContext();return this.dirty=!0,this},batchList:function(t,e,i,s,r){for(var n=0;n{t.exports=function(t,e,i,s){i.addToRenderList(e),t.batchSprite(e,e.frame,i,s)}},85692:(t,e,i)=>{var s=i(88933),r=i(99325),n=i(20494),a=i(15996);r.register("renderTexture",(function(t,e){void 0===t&&(t={});var i=n(t,"x",0),r=n(t,"y",0),o=n(t,"width",32),h=n(t,"height",32),l=n(t,"key",void 0),u=n(t,"frame",void 0),c=new a(this.scene,i,r,o,h,l,u);return void 0!==e&&(t.add=e),s(this.scene,c,t),c}))},29599:(t,e,i)=>{var s=i(61286),r=i(15996);s.register("renderTexture",(function(t,e,i,s,n,a){return this.displayList.add(new r(this.scene,t,e,i,s,n,a))}))},92675:(t,e,i)=>{var s=i(72283),r=i(72283);s=i(46823),r=i(43267),t.exports={renderWebGL:s,renderCanvas:r}},46823:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i,r){i.addToRenderList(e);var n=i.alpha,a=e.renderTarget,o=a.width,h=a.height,l=s.getTintAppendFloatAlpha,u=t.pipelines.set(e.pipeline),c=u.setTexture2D(a.texture);u.batchTexture(e,a.texture,o,h,e.x,e.y,o,h,e.scaleX,e.scaleY,e.rotation,e.flipX,!e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,o,h,l(e.tintTopLeft,n*e._alphaTL),l(e.tintTopRight,n*e._alphaTR),l(e.tintBottomLeft,n*e._alphaBL),l(e.tintBottomRight,n*e._alphaBR),e.tintFill,0,0,i,r,!0,c),t.resetTextures()}},79968:(t,e,i)=>{var s=i(16569),r=i(56694),n=i(64937),a=i(89980),o=i(65641),h=i(58912),l=i(93736),u=new r({Extends:a,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Flip,n.Mask,n.Pipeline,n.Size,n.Texture,n.Transform,n.Visible,n.ScrollFactor,h],initialize:function(t,e,i,r,n,h,u,c,d){void 0===r&&(r="__DEFAULT"),void 0===h&&(h=2),void 0===u&&(u=!0),a.call(this,t,"Rope"),this.anims=new s(this),this.points=h,this.vertices,this.uv,this.colors,this.alphas,this.tintFill="__DEFAULT"===r,this.dirty=!1,this.horizontal=u,this._flipX=!1,this._flipY=!1,this._perp=new l,this.debugCallback=null,this.debugGraphic=null,this.setTexture(r,n),this.setPosition(e,i),this.setSizeToFrame(),this.initPipeline(o.ROPE_PIPELINE),Array.isArray(h)&&this.resizeArrays(h.length),this.setPoints(h,c,d),this.updateVertices()},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){var i=this.anims.currentFrame;this.anims.update(t,e),this.anims.currentFrame!==i&&(this.updateUVs(),this.updateVertices())},play:function(t,e,i){return this.anims.play(t,e,i),this},setDirty:function(){return this.dirty=!0,this},setHorizontal:function(t,e,i){return void 0===t&&(t=this.points.length),this.horizontal?this:(this.horizontal=!0,this.setPoints(t,e,i))},setVertical:function(t,e,i){return void 0===t&&(t=this.points.length),this.horizontal?(this.horizontal=!1,this.setPoints(t,e,i)):this},setTintFill:function(t){return void 0===t&&(t=!1),this.tintFill=t,this},setAlphas:function(t,e){var i=this.points.length;if(i<1)return this;var s,r=this.alphas;void 0===t?t=[1]:Array.isArray(t)||void 0!==e||(t=[t]);var n=0;if(void 0!==e)for(s=0;sn&&(a=t[n]),r[n]=a,t.length>n+1&&(a=t[n+1]),r[n+1]=a}return this},setColors:function(t){var e=this.points.length;if(e<1)return this;var i,s=this.colors;void 0===t?t=[16777215]:Array.isArray(t)||(t=[t]);var r=0;if(t.length===e)for(i=0;ir&&(n=t[r]),s[r]=n,t.length>r+1&&(n=t[r+1]),s[r+1]=n}return this},setPoints:function(t,e,i){if(void 0===t&&(t=2),"number"==typeof t){var s,r,n,a=t;if(a<2&&(a=2),t=[],this.horizontal)for(n=-this.frame.halfWidth,r=this.frame.width/(a-1),s=0;s{t.exports=function(){}},96027:(t,e,i)=>{var s=i(88933),r=i(99325),n=i(20494),a=i(10850),o=i(79968);r.register("rope",(function(t,e){void 0===t&&(t={});var i=n(t,"key",null),r=n(t,"frame",null),h=n(t,"horizontal",!0),l=a(t,"points",void 0),u=a(t,"colors",void 0),c=a(t,"alphas",void 0),d=new o(this.scene,0,0,i,r,l,h,u,c);return void 0!==e&&(t.add=e),s(this.scene,d,t),t.add||this.updateList.add(d),d}))},31982:(t,e,i)=>{var s=i(79968);i(61286).register("rope",(function(t,e,i,r,n,a,o,h){return this.displayList.add(new s(this.scene,t,e,i,r,n,a,o,h))}))},58912:(t,e,i)=>{var s=i(72283),r=i(72283);s=i(49489),r=i(44598),t.exports={renderWebGL:s,renderCanvas:r}},49489:(t,e,i)=>{var s=i(73329),r=i(75512);t.exports=function(t,e,i,n){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline,e),o=s(e,i,n).calc,h=e.vertices,l=e.uv,u=e.colors,c=e.alphas,d=e.alpha,f=r.getTintAppendFloatAlpha,p=i.roundPixels,v=h.length,g=Math.floor(.5*v);a.flush(),t.pipelines.preBatch(e);var m=a.setGameObject(e),y=a.vertexViewF32,x=a.vertexViewU32,T=a.vertexCount*a.currentShader.vertexComponentCount-1,w=0,E=e.tintFill;e.dirty&&e.updateVertices();for(var b=e.debugCallback,S=[],A=0;A{var s=i(56694),r=i(64937),n=i(89980),a=i(72632),o=i(98611),h=i(22440),l=i(24252),u=i(69360),c=new s({Extends:n,Mixins:[r.ComputedSize,r.Depth,r.GetBounds,r.Mask,r.Origin,r.ScrollFactor,r.Transform,r.Visible,l],initialize:function(t,e,i,s,r,a,o,h){void 0===i&&(i=0),void 0===s&&(s=0),void 0===r&&(r=128),void 0===a&&(a=128),n.call(this,t,"Shader"),this.blendMode=-1,this.shader;var l=t.sys.renderer;this.renderer=l,this.gl=l.gl,this.vertexData=new ArrayBuffer(2*Float32Array.BYTES_PER_ELEMENT*6),this.vertexBuffer=l.createVertexBuffer(this.vertexData.byteLength,this.gl.STREAM_DRAW),this.program=null,this.bytes=new Uint8Array(this.vertexData),this.vertexViewF32=new Float32Array(this.vertexData),this._tempMatrix1=new u,this._tempMatrix2=new u,this._tempMatrix3=new u,this.viewMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.projectionMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.uniforms={},this.pointer=null,this._rendererWidth=l.width,this._rendererHeight=l.height,this._textureCount=0,this.framebuffer=null,this.glTexture=null,this.renderToTexture=!1,this.texture=null,this.setPosition(i,s),this.setSize(r,a),this.setOrigin(.5,.5),this.setShader(e,o,h)},willRender:function(t){return!!this.renderToTexture||!(n.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},setRenderToTexture:function(t,e){if(void 0===e&&(e=!1),!this.renderToTexture){var i=this.width,s=this.height,r=this.renderer;this.glTexture=r.createTextureFromSource(null,i,s,0),this.glTexture.flipY=e,this.framebuffer=r.createFramebuffer(i,s,this.glTexture,!1),this._rendererWidth=i,this._rendererHeight=s,this.renderToTexture=!0,this.projOrtho(0,this.width,this.height,0),t&&(this.texture=this.scene.sys.textures.addGLTexture(t,this.glTexture,i,s))}return this.shader&&(r.pipelines.clear(),this.load(),this.flush(),r.pipelines.rebind()),this},setShader:function(t,e,i){if(void 0===e&&(e=[]),"string"==typeof t){var s=this.scene.sys.cache.shader;if(!s.has(t))return console.warn("Shader missing: "+t),this;this.shader=s.get(t)}else this.shader=t;var r=this.gl,n=this.renderer;this.program&&r.deleteProgram(this.program);var a=n.createProgram(this.shader.vertexSrc,this.shader.fragmentSrc);r.uniformMatrix4fv(r.getUniformLocation(a,"uViewMatrix"),!1,this.viewMatrix),r.uniformMatrix4fv(r.getUniformLocation(a,"uProjectionMatrix"),!1,this.projectionMatrix),r.uniform2f(r.getUniformLocation(a,"uResolution"),this.width,this.height),this.program=a;var h=new Date,l={resolution:{type:"2f",value:{x:this.width,y:this.height}},time:{type:"1f",value:0},mouse:{type:"2f",value:{x:this.width/2,y:this.height/2}},date:{type:"4fv",value:[h.getFullYear(),h.getMonth(),h.getDate(),60*h.getHours()*60+60*h.getMinutes()+h.getSeconds()]},sampleRate:{type:"1f",value:44100},iChannel0:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel1:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel2:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel3:{type:"sampler2D",value:null,textureData:{repeat:!0}}};this.shader.uniforms?this.uniforms=o(!0,{},this.shader.uniforms,l):this.uniforms=l;for(var u=0;u<4;u++)e[u]&&this.setSampler2D("iChannel"+u,e[u],u,i);return this.initUniforms(),this.projOrtho(0,this._rendererWidth,this._rendererHeight,0),this},setPointer:function(t){return this.pointer=t,this},projOrtho:function(t,e,i,s){var r=1/(t-e),n=1/(i-s),a=this.projectionMatrix;a[0]=-2*r,a[5]=-2*n,a[10]=-.001,a[12]=(t+e)*r,a[13]=(s+i)*n,a[14]=-0;var o=this.program,h=this.gl;this.renderer.setProgram(o),h.uniformMatrix4fv(h.getUniformLocation(o,"uProjectionMatrix"),!1,this.projectionMatrix),this._rendererWidth=e,this._rendererHeight=i},initUniforms:function(){var t=this.gl,e=this.renderer.glFuncMap,i=this.program;for(var s in this._textureCount=0,this.uniforms){var r=this.uniforms[s],n=r.type,a=e[n];r.uniformLocation=t.getUniformLocation(i,s),"sampler2D"!==n&&(r.glMatrix=a.matrix,r.glValueLength=a.length,r.glFunc=a.func)}},setSampler2DBuffer:function(t,e,i,s,r,n){void 0===r&&(r=0),void 0===n&&(n={});var a=this.uniforms[t];return a.value=e,n.width=i,n.height=s,a.textureData=n,this._textureCount=r,this.initSampler2D(a),this},setSampler2D:function(t,e,i,s){void 0===i&&(i=0);var r=this.scene.sys.textures;if(r.exists(e)){var n=r.getFrame(e);if(n.glTexture&&n.glTexture.isRenderTexture)return this.setSampler2DBuffer(t,n.glTexture,n.width,n.height,i,s);var a=this.uniforms[t],o=n.source;a.textureKey=e,a.source=o.image,a.value=n.glTexture,o.isGLTexture&&(s||(s={}),s.width=o.width,s.height=o.height),s&&(a.textureData=s),this._textureCount=i,this.initSampler2D(a)}return this},setUniform:function(t,e){return h(this.uniforms,t,e),this},getUniform:function(t){return a(this.uniforms,t,null)},setChannel0:function(t,e){return this.setSampler2D("iChannel0",t,0,e)},setChannel1:function(t,e){return this.setSampler2D("iChannel1",t,1,e)},setChannel2:function(t,e){return this.setSampler2D("iChannel2",t,2,e)},setChannel3:function(t,e){return this.setSampler2D("iChannel3",t,3,e)},initSampler2D:function(t){if(t.value){var e=this.gl;e.activeTexture(e.TEXTURE0+this._textureCount),e.bindTexture(e.TEXTURE_2D,t.value);var i=t.textureData;if(i&&!t.value.isRenderTexture){var s=e[a(i,"magFilter","linear").toUpperCase()],r=e[a(i,"minFilter","linear").toUpperCase()],n=e[a(i,"wrapS","repeat").toUpperCase()],o=e[a(i,"wrapT","repeat").toUpperCase()],h=e[a(i,"format","rgba").toUpperCase()];if(i.repeat&&(n=e.REPEAT,o=e.REPEAT),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!!i.flipY),i.width){var l=a(i,"width",512),u=a(i,"height",2),c=a(i,"border",0);e.texImage2D(e.TEXTURE_2D,0,h,l,u,c,h,e.UNSIGNED_BYTE,null)}else e.texImage2D(e.TEXTURE_2D,0,h,e.RGBA,e.UNSIGNED_BYTE,t.source);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,s),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,n),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,o)}this.renderer.setProgram(this.program),e.uniform1i(t.uniformLocation,this._textureCount),this._textureCount++}},syncUniforms:function(){var t,e,i,s,r,n=this.gl,a=this.uniforms,o=0;for(var h in a)i=(t=a[h]).glFunc,e=t.glValueLength,s=t.uniformLocation,null!==(r=t.value)&&(1===e?t.glMatrix?i.call(n,s,t.transpose,r):i.call(n,s,r):2===e?i.call(n,s,r.x,r.y):3===e?i.call(n,s,r.x,r.y,r.z):4===e?i.call(n,s,r.x,r.y,r.z,r.w):"sampler2D"===t.type&&(n.activeTexture(n.TEXTURE0+o),n.bindTexture(n.TEXTURE_2D,r),n.uniform1i(s,o),o++))},load:function(t){var e=this.gl,i=this.width,s=this.height,r=this.renderer,n=this.program,a=this.viewMatrix;if(!this.renderToTexture){var o=-this._displayOriginX,h=-this._displayOriginY;a[0]=t[0],a[1]=t[1],a[4]=t[2],a[5]=t[3],a[8]=t[4],a[9]=t[5],a[12]=a[0]*o+a[4]*h,a[13]=a[1]*o+a[5]*h}e.useProgram(n),e.uniformMatrix4fv(e.getUniformLocation(n,"uViewMatrix"),!1,a),e.uniform2f(e.getUniformLocation(n,"uResolution"),this.width,this.height);var l=this.uniforms,u=l.resolution;u.value.x=i,u.value.y=s,l.time.value=r.game.loop.getDuration();var c=this.pointer;if(c){var d=l.mouse,f=c.x/i,p=1-c.y/s;d.value.x=f.toFixed(2),d.value.y=p.toFixed(2)}this.syncUniforms()},flush:function(){var t=this.width,e=this.height,i=this.program,s=this.gl,r=this.vertexBuffer,n=this.renderer,a=2*Float32Array.BYTES_PER_ELEMENT;this.renderToTexture&&(n.setFramebuffer(this.framebuffer),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT)),s.bindBuffer(s.ARRAY_BUFFER,r);var o=s.getAttribLocation(i,"inPosition");-1!==o&&(s.enableVertexAttribArray(o),s.vertexAttribPointer(o,2,s.FLOAT,!1,a,0));var h=this.vertexViewF32;h[3]=e,h[4]=t,h[5]=e,h[8]=t,h[9]=e,h[10]=t;s.bufferSubData(s.ARRAY_BUFFER,0,this.bytes.subarray(0,6*a)),s.drawArrays(s.TRIANGLES,0,6),this.renderToTexture&&n.setFramebuffer(null,!1)},setAlpha:function(){},setBlendMode:function(){},preDestroy:function(){var t=this.gl;t.deleteProgram(this.program),t.deleteBuffer(this.vertexBuffer),this.renderToTexture&&(this.renderer.deleteFramebuffer(this.framebuffer),this.texture.destroy(),this.framebuffer=null,this.glTexture=null,this.texture=null)}});t.exports=c},10612:t=>{t.exports=function(){}},13908:(t,e,i)=>{var s=i(88933),r=i(99325),n=i(20494),a=i(27902);r.register("shader",(function(t,e){void 0===t&&(t={});var i=n(t,"key",null),r=n(t,"x",0),o=n(t,"y",0),h=n(t,"width",128),l=n(t,"height",128),u=new a(this.scene,i,r,o,h,l);return void 0!==e&&(t.add=e),s(this.scene,u,t),u}))},51979:(t,e,i)=>{var s=i(27902);i(61286).register("shader",(function(t,e,i,r,n,a,o){return this.displayList.add(new s(this.scene,t,e,i,r,n,a,o))}))},24252:(t,e,i)=>{var s=i(72283),r=i(72283);s=i(19782),r=i(10612),t.exports={renderWebGL:s,renderCanvas:r}},19782:(t,e,i)=>{var s=i(73329);t.exports=function(t,e,i,r){if(e.shader){if(i.addToRenderList(e),t.pipelines.clear(),e.renderToTexture)e.load(),e.flush();else{var n=s(e,i,r).calc;t.width===e._rendererWidth&&t.height===e._rendererHeight||e.projOrtho(0,t.width,t.height,0),e.load(n.matrix),e.flush()}t.pipelines.rebind()}}},19543:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i,r,n,a){for(var o=s.getTintAppendFloatAlpha(i.fillColor,i.fillAlpha*r),h=i.pathData,l=i.pathIndexes,u=0;u{t.exports=function(t,e,i,s){var r=i||e.fillColor,n=s||e.fillAlpha,a=(16711680&r)>>>16,o=(65280&r)>>>8,h=255&r;t.fillStyle="rgba("+a+","+o+","+h+","+n+")"}},17876:t=>{t.exports=function(t,e,i,s){var r=i||e.strokeColor,n=s||e.strokeAlpha,a=(16711680&r)>>>16,o=(65280&r)>>>8,h=255&r;t.strokeStyle="rgba("+a+","+o+","+h+","+n+")",t.lineWidth=e.lineWidth}},91461:(t,e,i)=>{var s=i(56694),r=i(64937),n=i(89980),a=i(88829),o=new s({Extends:n,Mixins:[r.AlphaSingle,r.BlendMode,r.Depth,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.ScrollFactor,r.Transform,r.Visible],initialize:function(t,e,i){void 0===e&&(e="Shape"),n.call(this,t,e),this.geom=i,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new a,this.width=0,this.height=0,this.initPipeline()},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.isFilled=!1:(this.fillColor=t,this.fillAlpha=e,this.isFilled=!0),this},setStrokeStyle:function(t,e,i){return void 0===i&&(i=1),void 0===t?this.isStroked=!1:(this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this.isStroked=!0),this},setClosePath:function(t){return this.closePath=t,this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}}});t.exports=o},50262:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i,r,n){var a=t.strokeTint,o=s.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*i);a.TL=o,a.TR=o,a.BL=o,a.BR=o;var h=e.pathData,l=h.length-1,u=e.lineWidth,c=u/2,d=h[0]-r,f=h[1]-n;e.closePath||(l-=2);for(var p=2;p{var s=i(2213),r=i(56694),n=i(75606),a=i(11117),o=i(26673),h=i(83392),l=i(91461),u=new r({Extends:l,Mixins:[s],initialize:function(t,e,i,s,r,n,a,h,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===r&&(r=0),void 0===n&&(n=360),void 0===a&&(a=!1),l.call(this,t,"Arc",new o(0,0,s)),this._startAngle=r,this._endAngle=n,this._anticlockwise=a,this._iterations=.01,this.setPosition(e,i);var c=2*this.geom.radius;this.setSize(c,c),void 0!==h&&this.setFillStyle(h,u),this.updateDisplayOrigin(),this.updateData()},iterations:{get:function(){return this._iterations},set:function(t){this._iterations=t,this.updateData()}},radius:{get:function(){return this.geom.radius},set:function(t){this.geom.radius=t;var e=2*t;this.setSize(e,e),this.updateDisplayOrigin(),this.updateData()}},startAngle:{get:function(){return this._startAngle},set:function(t){this._startAngle=t,this.updateData()}},endAngle:{get:function(){return this._endAngle},set:function(t){this._endAngle=t,this.updateData()}},anticlockwise:{get:function(){return this._anticlockwise},set:function(t){this._anticlockwise=t,this.updateData()}},setRadius:function(t){return this.radius=t,this},setIterations:function(t){return void 0===t&&(t=.01),this.iterations=t,this},setStartAngle:function(t,e){return this._startAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},setEndAngle:function(t,e){return this._endAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},updateData:function(){var t=this._iterations,e=t,i=this.geom.radius,s=n(this._startAngle),r=n(this._endAngle),o=i,l=i;r-=s,this._anticlockwise?r<-h.PI2?r=-h.PI2:r>0&&(r=-h.PI2+r%h.PI2):r>h.PI2?r=h.PI2:r<0&&(r=h.PI2+r%h.PI2);for(var u,c=[o+Math.cos(s)*i,l+Math.sin(s)*i];e<1;)u=r*e+s,c.push(o+Math.cos(u)*i,l+Math.sin(u)*i),e+=t;return u=r+s,c.push(o+Math.cos(u)*i,l+Math.sin(u)*i),c.push(o+Math.cos(s)*i,l+Math.sin(s)*i),this.pathIndexes=a(c),this.pathData=c,this}});t.exports=u},23560:(t,e,i)=>{var s=i(75606),r=i(15608),n=i(17876),a=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var h=t.currentContext;if(a(t,h,e,i,o)){var l=e.radius;h.beginPath(),h.arc(l-e.originX*(2*l),l-e.originY*(2*l),l,s(e._startAngle),s(e._endAngle),e.anticlockwise),e.closePath&&h.closePath(),e.isFilled&&(r(h,e),h.fill()),e.isStroked&&(n(h,e),h.stroke()),h.restore()}}},10369:(t,e,i)=>{var s=i(28593),r=i(61286);r.register("arc",(function(t,e,i,r,n,a,o,h){return this.displayList.add(new s(this.scene,t,e,i,r,n,a,o,h))})),r.register("circle",(function(t,e,i,r,n){return this.displayList.add(new s(this.scene,t,e,i,0,360,!1,r,n))}))},2213:(t,e,i)=>{var s=i(72283),r=i(72283);s=i(58356),r=i(23560),t.exports={renderWebGL:s,renderCanvas:r}},58356:(t,e,i)=>{var s=i(73329),r=i(19543),n=i(50262);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),h=s(e,i,a),l=o.calcMatrix.copyFrom(h.calc),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&r(o,l,e,d,u,c),e.isStroked&&n(o,e,d,u,c),t.pipelines.postBatch(e)}},15220:(t,e,i)=>{var s=i(56694),r=i(87203),n=i(11117),a=i(74118),o=i(91461),h=new s({Extends:o,Mixins:[r],initialize:function(t,e,i,s,r,n){void 0===e&&(e=0),void 0===i&&(i=0),o.call(this,t,"Curve",s),this._smoothness=32,this._curveBounds=new a,this.closePath=!1,this.setPosition(e,i),void 0!==r&&this.setFillStyle(r,n),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){var t=this._curveBounds,e=this._smoothness;this.geom.getBounds(t,e),this.setSize(t.width,t.height),this.updateDisplayOrigin();for(var i=[],s=this.geom.getPoints(e),r=0;r{var s=i(15608),r=i(17876),n=i(49584);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.currentContext;if(n(t,o,e,i,a)){var h=e._displayOriginX+e._curveBounds.x,l=e._displayOriginY+e._curveBounds.y,u=e.pathData,c=u.length-1,d=u[0]-h,f=u[1]-l;o.beginPath(),o.moveTo(d,f),e.closePath||(c-=2);for(var p=2;p{var s=i(61286),r=i(15220);s.register("curve",(function(t,e,i,s,n){return this.displayList.add(new r(this.scene,t,e,i,s,n))}))},87203:(t,e,i)=>{var s=i(72283),r=i(72283);s=i(82958),r=i(4024),t.exports={renderWebGL:s,renderCanvas:r}},82958:(t,e,i)=>{var s=i(19543),r=i(73329),n=i(50262);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),h=r(e,i,a),l=o.calcMatrix.copyFrom(h.calc),u=e._displayOriginX+e._curveBounds.x,c=e._displayOriginY+e._curveBounds.y,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&s(o,l,e,d,u,c),e.isStroked&&n(o,e,d,u,c),t.pipelines.postBatch(e)}},28591:(t,e,i)=>{var s=i(56694),r=i(11117),n=i(84171),a=i(95669),o=i(91461),h=new s({Extends:o,Mixins:[n],initialize:function(t,e,i,s,r,n,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===r&&(r=128),o.call(this,t,"Ellipse",new a(s/2,r/2,s,r)),this._smoothness=64,this.setPosition(e,i),this.width=s,this.height=r,void 0!==n&&this.setFillStyle(n,h),this.updateDisplayOrigin(),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSize:function(t,e){return this.width=t,this.height=e,this.geom.setPosition(t/2,e/2),this.geom.setSize(t,e),this.updateData()},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){for(var t=[],e=this.geom.getPoints(this._smoothness),i=0;i{var s=i(15608),r=i(17876),n=i(49584);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.currentContext;if(n(t,o,e,i,a)){var h=e._displayOriginX,l=e._displayOriginY,u=e.pathData,c=u.length-1,d=u[0]-h,f=u[1]-l;o.beginPath(),o.moveTo(d,f),e.closePath||(c-=2);for(var p=2;p{var s=i(28591);i(61286).register("ellipse",(function(t,e,i,r,n,a){return this.displayList.add(new s(this.scene,t,e,i,r,n,a))}))},84171:(t,e,i)=>{var s=i(72283),r=i(72283);s=i(17554),r=i(55881),t.exports={renderWebGL:s,renderCanvas:r}},17554:(t,e,i)=>{var s=i(19543),r=i(73329),n=i(50262);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),h=r(e,i,a),l=o.calcMatrix.copyFrom(h.calc),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&s(o,l,e,d,u,c),e.isStroked&&n(o,e,d,u,c),t.pipelines.postBatch(e)}},39169:(t,e,i)=>{var s=i(56694),r=i(91461),n=i(88059),a=new s({Extends:r,Mixins:[n],initialize:function(t,e,i,s,n,a,o,h,l,u,c){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===n&&(n=128),void 0===a&&(a=32),void 0===o&&(o=32),r.call(this,t,"Grid",null),this.cellWidth=a,this.cellHeight=o,this.showCells=!0,this.outlineFillColor=0,this.outlineFillAlpha=0,this.showOutline=!0,this.showAltCells=!1,this.altFillColor,this.altFillAlpha,this.setPosition(e,i),this.setSize(s,n),this.setFillStyle(h,l),void 0!==u&&this.setOutlineStyle(u,c),this.updateDisplayOrigin()},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showCells=!1:(this.fillColor=t,this.fillAlpha=e,this.showCells=!0),this},setAltFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showAltCells=!1:(this.altFillColor=t,this.altFillAlpha=e,this.showAltCells=!0),this},setOutlineStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showOutline=!1:(this.outlineFillColor=t,this.outlineFillAlpha=e,this.showOutline=!0),this}});t.exports=a},95525:(t,e,i)=>{var s=i(15608),r=i(17876),n=i(49584);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.currentContext;if(n(t,o,e,i,a)){var h=-e._displayOriginX,l=-e._displayOriginY,u=i.alpha*e.alpha,c=e.width,d=e.height,f=e.cellWidth,p=e.cellHeight,v=Math.ceil(c/f),g=Math.ceil(d/p),m=f,y=p,x=f-(v*f-c),T=p-(g*p-d),w=e.showCells,E=e.showAltCells,b=e.showOutline,S=0,A=0,_=0,C=0,R=0;if(b&&(m--,y--,x===f&&x--,T===p&&T--),w&&e.fillAlpha>0)for(s(o,e),A=0;A0)for(s(o,e,e.altFillColor,e.altFillAlpha*u),A=0;A0){for(r(o,e,e.outlineFillColor,e.outlineFillAlpha*u),S=1;S{var s=i(61286),r=i(39169);s.register("grid",(function(t,e,i,s,n,a,o,h,l,u){return this.displayList.add(new r(this.scene,t,e,i,s,n,a,o,h,l,u))}))},88059:(t,e,i)=>{var s=i(72283),r=i(72283);s=i(50639),r=i(95525),t.exports={renderWebGL:s,renderCanvas:r}},50639:(t,e,i)=>{var s=i(73329),r=i(75512);t.exports=function(t,e,i,n){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),o=s(e,i,n);a.calcMatrix.copyFrom(o.calc).translate(-e._displayOriginX,-e._displayOriginY);var h,l,u=i.alpha*e.alpha,c=e.width,d=e.height,f=e.cellWidth,p=e.cellHeight,v=Math.ceil(c/f),g=Math.ceil(d/p),m=f,y=p,x=f-(v*f-c),T=p-(g*p-d),w=e.showCells,E=e.showAltCells,b=e.showOutline,S=0,A=0,_=0,C=0,R=0;if(b&&(m--,y--,x===f&&x--,T===p&&T--),t.pipelines.preBatch(e),w&&e.fillAlpha>0)for(h=a.fillTint,l=r.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*u),h.TL=l,h.TR=l,h.BL=l,h.BR=l,A=0;A0)for(h=a.fillTint,l=r.getTintAppendFloatAlpha(e.altFillColor,e.altFillAlpha*u),h.TL=l,h.TR=l,h.BL=l,h.BR=l,A=0;A0){var M=a.strokeTint,P=r.getTintAppendFloatAlpha(e.outlineFillColor,e.outlineFillAlpha*u);for(M.TL=P,M.TR=P,M.BL=P,M.BR=P,S=1;S{var s=i(72296),r=i(56694),n=i(91461),a=new r({Extends:n,Mixins:[s],initialize:function(t,e,i,s,r,a,o,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=48),void 0===r&&(r=32),void 0===a&&(a=15658734),void 0===o&&(o=10066329),void 0===h&&(h=13421772),n.call(this,t,"IsoBox",null),this.projection=4,this.fillTop=a,this.fillLeft=o,this.fillRight=h,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isFilled=!0,this.setPosition(e,i),this.setSize(s,r),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=a},32884:(t,e,i)=>{var s=i(15608),r=i(49584);t.exports=function(t,e,i,n){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,n)&&e.isFilled){var o=e.width,h=e.height,l=o/2,u=o/e.projection;e.showTop&&(s(a,e,e.fillTop),a.beginPath(),a.moveTo(-l,-h),a.lineTo(0,-u-h),a.lineTo(l,-h),a.lineTo(l,-1),a.lineTo(0,u-1),a.lineTo(-l,-1),a.lineTo(-l,-h),a.fill()),e.showLeft&&(s(a,e,e.fillLeft),a.beginPath(),a.moveTo(-l,0),a.lineTo(0,u),a.lineTo(0,u-h),a.lineTo(-l,-h),a.lineTo(-l,0),a.fill()),e.showRight&&(s(a,e,e.fillRight),a.beginPath(),a.moveTo(l,0),a.lineTo(0,u),a.lineTo(0,u-h),a.lineTo(l,-h),a.lineTo(l,0),a.fill()),a.restore()}}},88154:(t,e,i)=>{var s=i(61286),r=i(4415);s.register("isobox",(function(t,e,i,s,n,a,o){return this.displayList.add(new r(this.scene,t,e,i,s,n,a,o))}))},72296:(t,e,i)=>{var s=i(72283),r=i(72283);s=i(33101),r=i(32884),t.exports={renderWebGL:s,renderCanvas:r}},33101:(t,e,i)=>{var s=i(73329),r=i(75512);t.exports=function(t,e,i,n){i.addToRenderList(e);var a,o,h,l,u,c,d,f,p,v=t.pipelines.set(e.pipeline),g=s(e,i,n),m=v.calcMatrix.copyFrom(g.calc),y=e.width,x=e.height,T=y/2,w=y/e.projection,E=i.alpha*e.alpha;e.isFilled&&(t.pipelines.preBatch(e),e.showTop&&(a=r.getTintAppendFloatAlpha(e.fillTop,E),o=m.getX(-T,-x),h=m.getY(-T,-x),l=m.getX(0,-w-x),u=m.getY(0,-w-x),c=m.getX(T,-x),d=m.getY(T,-x),f=m.getX(0,w-x),p=m.getY(0,w-x),v.batchQuad(e,o,h,l,u,c,d,f,p,0,0,1,1,a,a,a,a,2)),e.showLeft&&(a=r.getTintAppendFloatAlpha(e.fillLeft,E),o=m.getX(-T,0),h=m.getY(-T,0),l=m.getX(0,w),u=m.getY(0,w),c=m.getX(0,w-x),d=m.getY(0,w-x),f=m.getX(-T,-x),p=m.getY(-T,-x),v.batchQuad(e,o,h,l,u,c,d,f,p,0,0,1,1,a,a,a,a,2)),e.showRight&&(a=r.getTintAppendFloatAlpha(e.fillRight,E),o=m.getX(T,0),h=m.getY(T,0),l=m.getX(0,w),u=m.getY(0,w),c=m.getX(0,w-x),d=m.getY(0,w-x),f=m.getX(T,-x),p=m.getY(T,-x),v.batchQuad(e,o,h,l,u,c,d,f,p,0,0,1,1,a,a,a,a,2)),t.pipelines.postBatch(e))}},65159:(t,e,i)=>{var s=i(56694),r=i(93387),n=i(91461),a=new s({Extends:n,Mixins:[r],initialize:function(t,e,i,s,r,a,o,h,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=48),void 0===r&&(r=32),void 0===a&&(a=!1),void 0===o&&(o=15658734),void 0===h&&(h=10066329),void 0===l&&(l=13421772),n.call(this,t,"IsoTriangle",null),this.projection=4,this.fillTop=o,this.fillLeft=h,this.fillRight=l,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isReversed=a,this.isFilled=!0,this.setPosition(e,i),this.setSize(s,r),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setReversed:function(t){return this.isReversed=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=a},9923:(t,e,i)=>{var s=i(15608),r=i(49584);t.exports=function(t,e,i,n){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,n)&&e.isFilled){var o=e.width,h=e.height,l=o/2,u=o/e.projection,c=e.isReversed;e.showTop&&c&&(s(a,e,e.fillTop),a.beginPath(),a.moveTo(-l,-h),a.lineTo(0,-u-h),a.lineTo(l,-h),a.lineTo(0,u-h),a.fill()),e.showLeft&&(s(a,e,e.fillLeft),a.beginPath(),c?(a.moveTo(-l,-h),a.lineTo(0,u),a.lineTo(0,u-h)):(a.moveTo(-l,0),a.lineTo(0,u),a.lineTo(0,u-h)),a.fill()),e.showRight&&(s(a,e,e.fillRight),a.beginPath(),c?(a.moveTo(l,-h),a.lineTo(0,u),a.lineTo(0,u-h)):(a.moveTo(l,0),a.lineTo(0,u),a.lineTo(0,u-h)),a.fill()),a.restore()}}},67765:(t,e,i)=>{var s=i(61286),r=i(65159);s.register("isotriangle",(function(t,e,i,s,n,a,o,h){return this.displayList.add(new r(this.scene,t,e,i,s,n,a,o,h))}))},93387:(t,e,i)=>{var s=i(72283),r=i(72283);s=i(54946),r=i(9923),t.exports={renderWebGL:s,renderCanvas:r}},54946:(t,e,i)=>{var s=i(73329),r=i(75512);t.exports=function(t,e,i,n){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),o=s(e,i,n),h=a.calcMatrix.copyFrom(o.calc),l=e.width,u=e.height,c=l/2,d=l/e.projection,f=e.isReversed,p=i.alpha*e.alpha;if(e.isFilled){var v,g,m,y,x,T,w;if(t.pipelines.preBatch(e),e.showTop&&f){v=r.getTintAppendFloatAlpha(e.fillTop,p),g=h.getX(-c,-u),m=h.getY(-c,-u),y=h.getX(0,-d-u),x=h.getY(0,-d-u),T=h.getX(c,-u),w=h.getY(c,-u);var E=h.getX(0,d-u),b=h.getY(0,d-u);a.batchQuad(e,g,m,y,x,T,w,E,b,0,0,1,1,v,v,v,v,2)}e.showLeft&&(v=r.getTintAppendFloatAlpha(e.fillLeft,p),f?(g=h.getX(-c,-u),m=h.getY(-c,-u),y=h.getX(0,d),x=h.getY(0,d),T=h.getX(0,d-u),w=h.getY(0,d-u)):(g=h.getX(-c,0),m=h.getY(-c,0),y=h.getX(0,d),x=h.getY(0,d),T=h.getX(0,d-u),w=h.getY(0,d-u)),a.batchTri(e,g,m,y,x,T,w,0,0,1,1,v,v,v,2)),e.showRight&&(v=r.getTintAppendFloatAlpha(e.fillRight,p),f?(g=h.getX(c,-u),m=h.getY(c,-u),y=h.getX(0,d),x=h.getY(0,d),T=h.getX(0,d-u),w=h.getY(0,d-u)):(g=h.getX(c,0),m=h.getY(c,0),y=h.getX(0,d),x=h.getY(0,d),T=h.getX(0,d-u),w=h.getY(0,d-u)),a.batchTri(e,g,m,y,x,T,w,0,0,1,1,v,v,v,2)),t.pipelines.postBatch(e)}}},579:(t,e,i)=>{var s=i(56694),r=i(91461),n=i(88829),a=i(52660),o=new s({Extends:r,Mixins:[a],initialize:function(t,e,i,s,a,o,h,l,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===a&&(a=0),void 0===o&&(o=128),void 0===h&&(h=0),r.call(this,t,"Line",new n(s,a,o,h));var c=Math.max(1,this.geom.right-this.geom.left),d=Math.max(1,this.geom.bottom-this.geom.top);this.lineWidth=1,this._startWidth=1,this._endWidth=1,this.setPosition(e,i),this.setSize(c,d),void 0!==l&&this.setStrokeStyle(1,l,u),this.updateDisplayOrigin()},setLineWidth:function(t,e){return void 0===e&&(e=t),this._startWidth=t,this._endWidth=e,this.lineWidth=t,this},setTo:function(t,e,i,s){return this.geom.setTo(t,e,i,s),this}});t.exports=o},52044:(t,e,i)=>{var s=i(17876),r=i(49584);t.exports=function(t,e,i,n){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,n)){var o=e._displayOriginX,h=e._displayOriginY;e.isStroked&&(s(a,e),a.beginPath(),a.moveTo(e.geom.x1-o,e.geom.y1-h),a.lineTo(e.geom.x2-o,e.geom.y2-h),a.stroke()),a.restore()}}},85665:(t,e,i)=>{var s=i(61286),r=i(579);s.register("line",(function(t,e,i,s,n,a,o,h){return this.displayList.add(new r(this.scene,t,e,i,s,n,a,o,h))}))},52660:(t,e,i)=>{var s=i(72283),r=i(72283);s=i(46952),r=i(52044),t.exports={renderWebGL:s,renderCanvas:r}},46952:(t,e,i)=>{var s=i(73329),r=i(75512);t.exports=function(t,e,i,n){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),o=s(e,i,n);a.calcMatrix.copyFrom(o.calc);var h=e._displayOriginX,l=e._displayOriginY,u=i.alpha*e.alpha;if(t.pipelines.preBatch(e),e.isStroked){var c=a.strokeTint,d=r.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*u);c.TL=d,c.TR=d,c.BL=d,c.BR=d;var f=e._startWidth,p=e._endWidth;a.batchLine(e.geom.x1-h,e.geom.y1-l,e.geom.x2-h,e.geom.y2-l,f,p,1,0,!1,o.sprite,o.camera)}t.pipelines.postBatch(e)}},91249:(t,e,i)=>{var s=i(70573),r=i(56694),n=i(11117),a=i(14045),o=i(8580),h=i(91461),l=i(18974),u=new r({Extends:h,Mixins:[s],initialize:function(t,e,i,s,r,n){void 0===e&&(e=0),void 0===i&&(i=0),h.call(this,t,"Polygon",new o(s));var l=a(this.geom);this.setPosition(e,i),this.setSize(l.width,l.height),void 0!==r&&this.setFillStyle(r,n),this.updateDisplayOrigin(),this.updateData()},smooth:function(t){void 0===t&&(t=1);for(var e=0;e{var s=i(15608),r=i(17876),n=i(49584);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.currentContext;if(n(t,o,e,i,a)){var h=e._displayOriginX,l=e._displayOriginY,u=e.pathData,c=u.length-1,d=u[0]-h,f=u[1]-l;o.beginPath(),o.moveTo(d,f),e.closePath||(c-=2);for(var p=2;p{var s=i(61286),r=i(91249);s.register("polygon",(function(t,e,i,s,n){return this.displayList.add(new r(this.scene,t,e,i,s,n))}))},70573:(t,e,i)=>{var s=i(72283),r=i(72283);s=i(72841),r=i(40834),t.exports={renderWebGL:s,renderCanvas:r}},72841:(t,e,i)=>{var s=i(19543),r=i(73329),n=i(50262);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),h=r(e,i,a),l=o.calcMatrix.copyFrom(h.calc),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&s(o,l,e,d,u,c),e.isStroked&&n(o,e,d,u,c),t.pipelines.postBatch(e)}},517:(t,e,i)=>{var s=i(56694),r=i(74118),n=i(91461),a=i(37673),o=new s({Extends:n,Mixins:[a],initialize:function(t,e,i,s,a,o,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===a&&(a=128),n.call(this,t,"Rectangle",new r(0,0,s,a)),this.setPosition(e,i),this.setSize(s,a),void 0!==o&&this.setFillStyle(o,h),this.updateDisplayOrigin(),this.updateData()},setSize:function(t,e){this.width=t,this.height=e,this.geom.setSize(t,e),this.updateData(),this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),e.getLineD(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=o},4091:(t,e,i)=>{var s=i(15608),r=i(17876),n=i(49584);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.currentContext;if(n(t,o,e,i,a)){var h=e._displayOriginX,l=e._displayOriginY;e.isFilled&&(s(o,e),o.fillRect(-h,-l,e.width,e.height)),e.isStroked&&(r(o,e),o.beginPath(),o.rect(-h,-l,e.width,e.height),o.stroke()),o.restore()}}},94355:(t,e,i)=>{var s=i(61286),r=i(517);s.register("rectangle",(function(t,e,i,s,n,a){return this.displayList.add(new r(this.scene,t,e,i,s,n,a))}))},37673:(t,e,i)=>{var s=i(72283),r=i(72283);s=i(43532),r=i(4091),t.exports={renderWebGL:s,renderCanvas:r}},43532:(t,e,i)=>{var s=i(73329),r=i(50262),n=i(75512);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),h=s(e,i,a);o.calcMatrix.copyFrom(h.calc);var l=e._displayOriginX,u=e._displayOriginY,c=i.alpha*e.alpha;if(t.pipelines.preBatch(e),e.isFilled){var d=o.fillTint,f=n.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*c);d.TL=f,d.TR=f,d.BL=f,d.BR=f,o.batchFillRect(-l,-u,e.width,e.height)}e.isStroked&&r(o,e,c,l,u),t.pipelines.postBatch(e)}},77843:(t,e,i)=>{var s=i(87956),r=i(56694),n=i(11117),a=i(91461),o=new r({Extends:a,Mixins:[s],initialize:function(t,e,i,s,r,n,o,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=5),void 0===r&&(r=32),void 0===n&&(n=64),a.call(this,t,"Star",null),this._points=s,this._innerRadius=r,this._outerRadius=n,this.setPosition(e,i),this.setSize(2*n,2*n),void 0!==o&&this.setFillStyle(o,h),this.updateDisplayOrigin(),this.updateData()},setPoints:function(t){return this._points=t,this.updateData()},setInnerRadius:function(t){return this._innerRadius=t,this.updateData()},setOuterRadius:function(t){return this._outerRadius=t,this.updateData()},points:{get:function(){return this._points},set:function(t){this._points=t,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this.updateData()}},updateData:function(){var t=[],e=this._points,i=this._innerRadius,s=this._outerRadius,r=Math.PI/2*3,a=Math.PI/e,o=s,h=s;t.push(o,h+-s);for(var l=0;l{var s=i(15608),r=i(17876),n=i(49584);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.currentContext;if(n(t,o,e,i,a)){var h=e._displayOriginX,l=e._displayOriginY,u=e.pathData,c=u.length-1,d=u[0]-h,f=u[1]-l;o.beginPath(),o.moveTo(d,f),e.closePath||(c-=2);for(var p=2;p{var s=i(77843);i(61286).register("star",(function(t,e,i,r,n,a,o){return this.displayList.add(new s(this.scene,t,e,i,r,n,a,o))}))},87956:(t,e,i)=>{var s=i(72283),r=i(72283);s=i(12037),r=i(11401),t.exports={renderWebGL:s,renderCanvas:r}},12037:(t,e,i)=>{var s=i(19543),r=i(73329),n=i(50262);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),h=r(e,i,a),l=o.calcMatrix.copyFrom(h.calc),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&s(o,l,e,d,u,c),e.isStroked&&n(o,e,d,u,c),t.pipelines.postBatch(e)}},21873:(t,e,i)=>{var s=i(56694),r=i(91461),n=i(66349),a=i(70498),o=new s({Extends:r,Mixins:[a],initialize:function(t,e,i,s,a,o,h,l,u,c,d){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===a&&(a=128),void 0===o&&(o=64),void 0===h&&(h=0),void 0===l&&(l=128),void 0===u&&(u=128),r.call(this,t,"Triangle",new n(s,a,o,h,l,u));var f=this.geom.right-this.geom.left,p=this.geom.bottom-this.geom.top;this.setPosition(e,i),this.setSize(f,p),void 0!==c&&this.setFillStyle(c,d),this.updateDisplayOrigin(),this.updateData()},setTo:function(t,e,i,s,r,n){return this.geom.setTo(t,e,i,s,r,n),this.updateData()},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=o},60213:(t,e,i)=>{var s=i(15608),r=i(17876),n=i(49584);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.currentContext;if(n(t,o,e,i,a)){var h=e._displayOriginX,l=e._displayOriginY,u=e.geom.x1-h,c=e.geom.y1-l,d=e.geom.x2-h,f=e.geom.y2-l,p=e.geom.x3-h,v=e.geom.y3-l;o.beginPath(),o.moveTo(u,c),o.lineTo(d,f),o.lineTo(p,v),o.closePath(),e.isFilled&&(s(o,e),o.fill()),e.isStroked&&(r(o,e),o.stroke()),o.restore()}}},79296:(t,e,i)=>{var s=i(61286),r=i(21873);s.register("triangle",(function(t,e,i,s,n,a,o,h,l,u){return this.displayList.add(new r(this.scene,t,e,i,s,n,a,o,h,l,u))}))},70498:(t,e,i)=>{var s=i(72283),r=i(72283);s=i(72291),r=i(60213),t.exports={renderWebGL:s,renderCanvas:r}},72291:(t,e,i)=>{var s=i(73329),r=i(50262),n=i(75512);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),h=s(e,i,a);o.calcMatrix.copyFrom(h.calc);var l=e._displayOriginX,u=e._displayOriginY,c=i.alpha*e.alpha;if(t.pipelines.preBatch(e),e.isFilled){var d=o.fillTint,f=n.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*c);d.TL=f,d.TR=f,d.BL=f,d.BR=f;var p=e.geom.x1-l,v=e.geom.y1-u,g=e.geom.x2-l,m=e.geom.y2-u,y=e.geom.x3-l,x=e.geom.y3-u;o.batchFillTriangle(p,v,g,m,y,x,h.sprite,h.camera)}e.isStroked&&r(o,e,c,l,u),t.pipelines.postBatch(e)}},13747:(t,e,i)=>{var s=i(16569),r=i(56694),n=i(64937),a=i(89980),o=i(20791),h=new r({Extends:a,Mixins:[n.Alpha,n.BlendMode,n.Depth,n.Flip,n.FX,n.GetBounds,n.Mask,n.Origin,n.Pipeline,n.ScrollFactor,n.Size,n.TextureCrop,n.Tint,n.Transform,n.Visible,o],initialize:function(t,e,i,r,n){a.call(this,t,"Sprite"),this._crop=this.resetCropObject(),this.anims=new s(this),this.setTexture(r,n),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline()},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){this.anims.update(t,e)},play:function(t,e){return this.anims.play(t,e)},playReverse:function(t,e){return this.anims.playReverse(t,e)},playAfterDelay:function(t,e){return this.anims.playAfterDelay(t,e)},playAfterRepeat:function(t,e){return this.anims.playAfterRepeat(t,e)},chain:function(t){return this.anims.chain(t)},stop:function(){return this.anims.stop()},stopAfterDelay:function(t){return this.anims.stopAfterDelay(t)},stopAfterRepeat:function(t){return this.anims.stopAfterRepeat(t)},stopOnFrame:function(t){return this.anims.stopOnFrame(t)},toJSON:function(){return n.ToJSON(this)},preDestroy:function(){this.anims.destroy(),this.anims=void 0}});t.exports=h},27573:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),t.batchSprite(e,e.frame,i,s)}},89219:(t,e,i)=>{var s=i(88933),r=i(32291),n=i(99325),a=i(20494),o=i(13747);n.register("sprite",(function(t,e){void 0===t&&(t={});var i=a(t,"key",null),n=a(t,"frame",null),h=new o(this.scene,0,0,i,n);return void 0!==e&&(t.add=e),s(this.scene,h,t),r(h,t),h}))},66135:(t,e,i)=>{var s=i(61286),r=i(13747);s.register("sprite",(function(t,e,i,s){var n=new r(this.scene,t,e,i,s);return this.displayList.add(n),n}))},20791:(t,e,i)=>{var s=i(72283),r=i(72283);s=i(21034),r=i(27573),t.exports={renderWebGL:s,renderCanvas:r}},21034:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),e.pipeline.batchSprite(e,i,s)}},32979:t=>{t.exports=function(t,e,i){var s=t.canvas,r=t.context,n=t.style,a=[],o=0,h=i.length;n.maxLines>0&&n.maxLines1&&(d+=f*(h-1)),{width:o,height:d,lines:h,lineWidths:a,lineSpacing:f,lineHeight:c}}},27030:(t,e,i)=>{var s=i(61068);t.exports=function(t){var e=s.create(this),i=e.getContext("2d");t.syncFont(e,i);var r=i.measureText(t.testString);if("actualBoundingBoxAscent"in r){var n=r.actualBoundingBoxAscent,a=r.actualBoundingBoxDescent;return s.remove(e),{ascent:n,descent:a,fontSize:n+a}}var o=Math.ceil(r.width*t.baselineX),h=o,l=2*h;h=h*t.baselineY|0,e.width=o,e.height=l,i.fillStyle="#f00",i.fillRect(0,0,o,l),i.font=t._font,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(t.testString,0,h);var u={ascent:0,descent:0,fontSize:0},c=i.getImageData(0,0,o,l);if(!c)return u.ascent=h,u.descent=h+6,u.fontSize=u.ascent+u.descent,s.remove(e),u;var d,f,p=c.data,v=p.length,g=4*o,m=0,y=!1;for(d=0;dh;d--){for(f=0;f{var s=i(99584),r=i(61068),n=i(56694),a=i(64937),o=i(97081),h=i(89980),l=i(32979),u=i(10850),c=i(55638),d=i(80032),f=i(74744),p=new n({Extends:h,Mixins:[a.Alpha,a.BlendMode,a.ComputedSize,a.Crop,a.Depth,a.Flip,a.FX,a.GetBounds,a.Mask,a.Origin,a.Pipeline,a.ScrollFactor,a.Tint,a.Transform,a.Visible,d],initialize:function(t,e,i,s,n){void 0===e&&(e=0),void 0===i&&(i=0),h.call(this,t,"Text"),this.renderer=t.sys.renderer,this.setPosition(e,i),this.setOrigin(0,0),this.initPipeline(),this.canvas=r.create(this),this.context=this.canvas.getContext("2d"),this.style=new f(this,n),this.autoRound=!0,this.splitRegExp=/(?:\r\n|\r|\n)/,this._text=void 0,this.padding={left:0,right:0,top:0,bottom:0},this.width=1,this.height=1,this.lineSpacing=0,this.dirty=!1,0===this.style.resolution&&(this.style.resolution=1),this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(null,this.canvas,!0),this.frame=this.texture.get(),this.frame.source.resolution=this.style.resolution,this.renderer&&this.renderer.gl&&(this.renderer.deleteTexture(this.frame.source.glTexture),this.frame.source.glTexture=null),this.initRTL(),this.setText(s),n&&n.padding&&this.setPadding(n.padding),n&&n.lineSpacing&&this.setLineSpacing(n.lineSpacing),t.sys.game.events.on(o.CONTEXT_RESTORED,this.onContextRestored,this)},initRTL:function(){this.style.rtl&&(this.canvas.dir="rtl",this.context.direction="rtl",this.canvas.style.display="none",s(this.canvas,this.scene.sys.canvas),this.originX=1)},runWordWrap:function(t){var e=this.style;if(e.wordWrapCallback){var i=e.wordWrapCallback.call(e.wordWrapCallbackScope,t,this);return Array.isArray(i)&&(i=i.join("\n")),i}return e.wordWrapWidth?e.wordWrapUseAdvanced?this.advancedWordWrap(t,this.context,this.style.wordWrapWidth):this.basicWordWrap(t,this.context,this.style.wordWrapWidth):t},advancedWordWrap:function(t,e,i){for(var s="",r=t.replace(/ +/gi," ").split(this.splitRegExp),n=r.length,a=0;al){if(0===c){for(var v=f;v.length&&(v=v.slice(0,-1),!((p=e.measureText(v).width)<=l)););if(!v.length)throw new Error("This text's wordWrapWidth setting is less than a single character!");var g=d.substr(v.length);u[c]=g,h+=v}var m=u[c].length?c:c+1,y=u.slice(m).join(" ").replace(/[ \n]*$/gi,"");r[a+1]=y+" "+(r[a+1]||""),n=r.length;break}h+=f,l-=p}s+=h.replace(/[ \n]*$/gi,"")+"\n"}}return s=s.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(t,e,i){for(var s="",r=t.split(this.splitRegExp),n=r.length-1,a=e.measureText(" ").width,o=0;o<=n;o++){for(var h=i,l=r[o].split(" "),u=l.length-1,c=0;c<=u;c++){var d=l[c],f=e.measureText(d).width,p=f;ch&&c>0&&(s+="\n",h=i),s+=d,c0&&(d+=h.lineSpacing*v),i.rtl)c=f-c;else if("right"===i.align)c+=a-h.lineWidths[v];else if("center"===i.align)c+=(a-h.lineWidths[v])/2;else if("justify"===i.align){if(h.lineWidths[v]/h.width>=.85){var g=h.width-h.lineWidths[v],m=e.measureText(" ").width,y=o[v].trim(),x=y.split(" ");g+=(o[v].length-y.length)*m;for(var T=Math.floor(g/m),w=0;T>0;)x[w]+=" ",w=(w+1)%(x.length-1||1),--T;o[v]=x.join(" ")}}this.autoRound&&(c=Math.round(c),d=Math.round(d)),i.strokeThickness&&(this.style.syncShadow(e,i.shadowStroke),e.strokeText(o[v],c,d)),i.color&&(this.style.syncShadow(e,i.shadowFill),e.fillText(o[v],c,d))}e.restore(),this.renderer&&this.renderer.gl&&(this.frame.source.glTexture=this.renderer.canvasToTexture(t,this.frame.source.glTexture,!0),this.frame.glTexture=this.frame.source.glTexture),this.dirty=!0;var E=this.input;return E&&!E.customHitArea&&(E.hitArea.width=this.width,E.hitArea.height=this.height),this},getTextMetrics:function(){return this.style.getTextMetrics()},text:{get:function(){return this._text},set:function(t){this.setText(t)}},toJSON:function(){var t=a.ToJSON(this),e={autoRound:this.autoRound,text:this._text,style:this.style.toJSON(),padding:{left:this.padding.left,right:this.padding.right,top:this.padding.top,bottom:this.padding.bottom}};return t.data=e,t},onContextRestored:function(){this.dirty=!0},preDestroy:function(){this.style.rtl&&c(this.canvas),r.remove(this.canvas),this.texture.destroy(),this.scene.sys.game.events.off(o.CONTEXT_RESTORED,this.onContextRestored,this)}});t.exports=p},71649:t=>{t.exports=function(t,e,i,s){0!==e.width&&0!==e.height&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,s))}},75397:(t,e,i)=>{var s=i(88933),r=i(99325),n=i(20494),a=i(76555);r.register("text",(function(t,e){void 0===t&&(t={});var i=n(t,"text",""),r=n(t,"style",null),o=n(t,"padding",null);null!==o&&(r.padding=o);var h=new a(this.scene,0,0,i,r);return void 0!==e&&(t.add=e),s(this.scene,h,t),h.autoRound=n(t,"autoRound",!0),h.resolution=n(t,"resolution",1),h}))},94627:(t,e,i)=>{var s=i(76555);i(61286).register("text",(function(t,e,i,r){return this.displayList.add(new s(this.scene,t,e,i,r))}))},80032:(t,e,i)=>{var s=i(72283),r=i(72283);s=i(76128),r=i(71649),t.exports={renderWebGL:s,renderCanvas:r}},74744:(t,e,i)=>{var s=i(56694),r=i(20494),n=i(10850),a=i(27030),o={fontFamily:["fontFamily","Courier"],fontSize:["fontSize","16px"],fontStyle:["fontStyle",""],backgroundColor:["backgroundColor",null],color:["color","#fff"],stroke:["stroke","#fff"],strokeThickness:["strokeThickness",0],shadowOffsetX:["shadow.offsetX",0],shadowOffsetY:["shadow.offsetY",0],shadowColor:["shadow.color","#000"],shadowBlur:["shadow.blur",0],shadowStroke:["shadow.stroke",!1],shadowFill:["shadow.fill",!1],align:["align","left"],maxLines:["maxLines",0],fixedWidth:["fixedWidth",0],fixedHeight:["fixedHeight",0],resolution:["resolution",0],rtl:["rtl",!1],testString:["testString","|MÉqgy"],baselineX:["baselineX",1.2],baselineY:["baselineY",1.4],wordWrapWidth:["wordWrap.width",null],wordWrapCallback:["wordWrap.callback",null],wordWrapCallbackScope:["wordWrap.callbackScope",null],wordWrapUseAdvanced:["wordWrap.useAdvancedWrap",!1]},h=new s({initialize:function(t,e){this.parent=t,this.fontFamily,this.fontSize,this.fontStyle,this.backgroundColor,this.color,this.stroke,this.strokeThickness,this.shadowOffsetX,this.shadowOffsetY,this.shadowColor,this.shadowBlur,this.shadowStroke,this.shadowFill,this.align,this.maxLines,this.fixedWidth,this.fixedHeight,this.resolution,this.rtl,this.testString,this.baselineX,this.baselineY,this.wordWrapWidth,this.wordWrapCallback,this.wordWrapCallbackScope,this.wordWrapUseAdvanced,this._font,this.setStyle(e,!1,!0);var i=n(e,"metrics",!1);this.metrics=i?{ascent:n(i,"ascent",0),descent:n(i,"descent",0),fontSize:n(i,"fontSize",0)}:a(this)},setStyle:function(t,e,i){for(var s in void 0===e&&(e=!0),void 0===i&&(i=!1),t&&t.hasOwnProperty("fontSize")&&"number"==typeof t.fontSize&&(t.fontSize=t.fontSize.toString()+"px"),o){var a=i?o[s][1]:this[s];this[s]="wordWrapCallback"===s||"wordWrapCallbackScope"===s?n(t,o[s][0],a):r(t,o[s][0],a)}var h=n(t,"font",null);null!==h&&this.setFont(h,!1),this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim();var l=n(t,"fill",null);return null!==l&&(this.color=l),e?this.update(!0):this.parent},syncFont:function(t,e){e.font=this._font},syncStyle:function(t,e){e.textBaseline="alphabetic",e.fillStyle=this.color,e.strokeStyle=this.stroke,e.lineWidth=this.strokeThickness,e.lineCap="round",e.lineJoin="round"},syncShadow:function(t,e){e?(t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur):(t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowColor=0,t.shadowBlur=0)},update:function(t){return t&&(this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim(),this.metrics=a(this)),this.parent.updateText()},setFont:function(t,e){void 0===e&&(e=!0);var i=t,s="",r="";if("string"!=typeof t)i=n(t,"fontFamily","Courier"),s=n(t,"fontSize","16px"),r=n(t,"fontStyle","");else{var a=t.split(" "),o=0;r=a.length>2?a[o++]:"",s=a[o++]||"16px",i=a[o++]||"Courier"}return i===this.fontFamily&&s===this.fontSize&&r===this.fontStyle||(this.fontFamily=i,this.fontSize=s,this.fontStyle=r,e&&this.update(!0)),this.parent},setFontFamily:function(t){return this.fontFamily!==t&&(this.fontFamily=t,this.update(!0)),this.parent},setFontStyle:function(t){return this.fontStyle!==t&&(this.fontStyle=t,this.update(!0)),this.parent},setFontSize:function(t){return"number"==typeof t&&(t=t.toString()+"px"),this.fontSize!==t&&(this.fontSize=t,this.update(!0)),this.parent},setTestString:function(t){return this.testString=t,this.update(!0)},setFixedSize:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(!1)},setBackgroundColor:function(t){return this.backgroundColor=t,this.update(!1)},setFill:function(t){return this.color=t,this.update(!1)},setColor:function(t){return this.color=t,this.update(!1)},setResolution:function(t){return this.resolution=t,this.update(!1)},setStroke:function(t,e){return void 0===e&&(e=this.strokeThickness),void 0===t&&0!==this.strokeThickness?(this.strokeThickness=0,this.update(!0)):this.stroke===t&&this.strokeThickness===e||(this.stroke=t,this.strokeThickness=e,this.update(!0)),this.parent},setShadow:function(t,e,i,s,r,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===s&&(s=0),void 0===r&&(r=!1),void 0===n&&(n=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=i,this.shadowBlur=s,this.shadowStroke=r,this.shadowFill=n,this.update(!1)},setShadowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)},setShadowColor:function(t){return void 0===t&&(t="#000"),this.shadowColor=t,this.update(!1)},setShadowBlur:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)},setShadowStroke:function(t){return this.shadowStroke=t,this.update(!1)},setShadowFill:function(t){return this.shadowFill=t,this.update(!1)},setWordWrapWidth:function(t,e){return void 0===e&&(e=!1),this.wordWrapWidth=t,this.wordWrapUseAdvanced=e,this.update(!1)},setWordWrapCallback:function(t,e){return void 0===e&&(e=null),this.wordWrapCallback=t,this.wordWrapCallbackScope=e,this.update(!1)},setAlign:function(t){return void 0===t&&(t="left"),this.align=t,this.update(!1)},setMaxLines:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)},getTextMetrics:function(){var t=this.metrics;return{ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}},toJSON:function(){var t={};for(var e in o)t[e]=this[e];return t.metrics=this.getTextMetrics(),t},destroy:function(){this.parent=void 0}});t.exports=h},76128:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i,r){if(0!==e.width&&0!==e.height){i.addToRenderList(e);var n=e.frame,a=n.width,o=n.height,h=s.getTintAppendFloatAlpha,l=t.pipelines.set(e.pipeline,e),u=l.setTexture2D(n.glTexture,e);l.batchTexture(e,n.glTexture,a,o,e.x,e.y,a/e.style.resolution,o/e.style.resolution,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,a,o,h(e.tintTopLeft,i.alpha*e._alphaTL),h(e.tintTopRight,i.alpha*e._alphaTR),h(e.tintBottomLeft,i.alpha*e._alphaBL),h(e.tintBottomRight,i.alpha*e._alphaBR),e.tintFill,0,0,i,r,!1,u)}}},35856:(t,e,i)=>{var s=i(61068),r=i(56694),n=i(64937),a=i(97081),o=i(89980),h=i(3504),l=i(8213),u=i(9271),c=i(93736),d=new r({Extends:o,Mixins:[n.Alpha,n.BlendMode,n.ComputedSize,n.Crop,n.Depth,n.Flip,n.FX,n.GetBounds,n.Mask,n.Origin,n.Pipeline,n.ScrollFactor,n.Tint,n.Transform,n.Visible,u],initialize:function(t,e,i,r,n,l,u){var d=t.sys.renderer;o.call(this,t,"TileSprite");var f=t.sys.textures.get(l),p=f.get(u);r&&n?(r=Math.floor(r),n=Math.floor(n)):(r=p.width,n=p.height),this._tilePosition=new c,this._tileScale=new c(1,1),this.dirty=!1,this.renderer=d,this.canvas=s.create(this,r,n),this.context=this.canvas.getContext("2d"),this.displayTexture=f,this.displayFrame=p,this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(null,this.canvas,!0),this.frame=this.texture.get(),this.potWidth=h(p.width),this.potHeight=h(p.height),this.fillCanvas=s.create2D(this,this.potWidth,this.potHeight),this.fillContext=this.fillCanvas.getContext("2d"),this.fillPattern=null,this.setPosition(e,i),this.setSize(r,n),this.setFrame(u),this.setOriginFromFrame(),this.initPipeline(),t.sys.game.events.on(a.CONTEXT_RESTORED,this.onContextRestored,this)},setTexture:function(t,e){return this.displayTexture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t){var e=this.displayTexture.get(t);return this.potWidth=h(e.width),this.potHeight=h(e.height),this.canvas.width=0,e.cutWidth&&e.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this.displayFrame=e,this.dirty=!0,this.updateTileTexture(),this},setTilePosition:function(t,e){return void 0!==t&&(this.tilePositionX=t),void 0!==e&&(this.tilePositionY=e),this},setTileScale:function(t,e){return void 0===t&&(t=this.tileScaleX),void 0===e&&(e=t),this.tileScaleX=t,this.tileScaleY=e,this},updateTileTexture:function(){if(this.dirty&&this.renderer){var t=this.displayFrame;if(t.source.isRenderTexture||t.source.isGLTexture)return console.warn("TileSprites can only use Image or Canvas based textures"),void(this.dirty=!1);var e=this.fillContext,i=this.fillCanvas,s=this.potWidth,r=this.potHeight;this.renderer&&this.renderer.gl||(s=t.cutWidth,r=t.cutHeight),e.clearRect(0,0,s,r),i.width=s,i.height=r,e.drawImage(t.source.image,t.cutX,t.cutY,t.cutWidth,t.cutHeight,0,0,s,r),this.renderer&&this.renderer.gl?this.fillPattern=this.renderer.canvasToTexture(i,this.fillPattern):this.fillPattern=e.createPattern(i,"repeat"),this.updateCanvas(),this.dirty=!1}},updateCanvas:function(){var t=this.canvas;if(t.width===this.width&&t.height===this.height||(t.width=this.width,t.height=this.height,this.frame.setSize(this.width,this.height),this.updateDisplayOrigin(),this.dirty=!0),!this.dirty||this.renderer&&this.renderer.gl)this.dirty=!1;else{var e=this.context;this.scene.sys.game.config.antialias||l.disable(e);var i=this._tileScale.x,s=this._tileScale.y,r=this._tilePosition.x,n=this._tilePosition.y;e.clearRect(0,0,this.width,this.height),e.save(),e.scale(i,s),e.translate(-r,-n),e.fillStyle=this.fillPattern,e.fillRect(r,n,this.width/i,this.height/s),e.restore(),this.dirty=!1}},onContextRestored:function(t){if(t){var e=t.gl;this.dirty=!0,this.fillPattern=null,this.fillPattern=t.createTexture2D(0,e.LINEAR,e.LINEAR,e.REPEAT,e.REPEAT,e.RGBA,this.fillCanvas,this.potWidth,this.potHeight)}},preDestroy:function(){this.renderer&&this.renderer.gl&&this.renderer.deleteTexture(this.fillPattern),s.remove(this.canvas),s.remove(this.fillCanvas),this.fillPattern=null,this.fillContext=null,this.fillCanvas=null,this.displayTexture=null,this.displayFrame=null,this.texture.destroy(),this.renderer=null,this.scene.sys.game.events.off(a.CONTEXT_RESTORED,this.onContextRestored,this)},tilePositionX:{get:function(){return this._tilePosition.x},set:function(t){this._tilePosition.x=t,this.dirty=!0}},tilePositionY:{get:function(){return this._tilePosition.y},set:function(t){this._tilePosition.y=t,this.dirty=!0}},tileScaleX:{get:function(){return this._tileScale.x},set:function(t){this._tileScale.x=t,this.dirty=!0}},tileScaleY:{get:function(){return this._tileScale.y},set:function(t){this._tileScale.y=t,this.dirty=!0}}});t.exports=d},93305:t=>{t.exports=function(t,e,i,s){e.updateCanvas(),i.addToRenderList(e),t.batchSprite(e,e.frame,i,s)}},63950:(t,e,i)=>{var s=i(88933),r=i(99325),n=i(20494),a=i(35856);r.register("tileSprite",(function(t,e){void 0===t&&(t={});var i=n(t,"x",0),r=n(t,"y",0),o=n(t,"width",512),h=n(t,"height",512),l=n(t,"key",""),u=n(t,"frame",""),c=new a(this.scene,i,r,o,h,l,u);return void 0!==e&&(t.add=e),s(this.scene,c,t),c}))},20509:(t,e,i)=>{var s=i(35856);i(61286).register("tileSprite",(function(t,e,i,r,n,a){return this.displayList.add(new s(this.scene,t,e,i,r,n,a))}))},9271:(t,e,i)=>{var s=i(72283),r=i(72283);s=i(74287),r=i(93305),t.exports={renderWebGL:s,renderCanvas:r}},74287:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i,r){e.updateCanvas();var n=e.width,a=e.height;if(0!==n&&0!==a){i.addToRenderList(e);var o=s.getTintAppendFloatAlpha,h=t.pipelines.set(e.pipeline,e),l=h.setTexture2D(e.fillPattern,e);h.batchTexture(e,e.fillPattern,e.displayFrame.width*e.tileScaleX,e.displayFrame.height*e.tileScaleY,e.x,e.y,n,a,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.originX*n,e.originY*a,0,0,n,a,o(e.tintTopLeft,i.alpha*e._alphaTL),o(e.tintTopRight,i.alpha*e._alphaTR),o(e.tintBottomLeft,i.alpha*e._alphaBL),o(e.tintBottomRight,i.alpha*e._alphaBR),e.tintFill,e.tilePositionX%e.displayFrame.width/e.displayFrame.width,e.tilePositionY%e.displayFrame.height/e.displayFrame.height,i,r,!1,l)}}},8630:(t,e,i)=>{var s=i(56694),r=i(82897),n=i(64937),a=i(56631),o=i(97081),h=i(33963),l=i(89980),u=i(76038),c=i(76583),d=i(77974),f=i(83392),p=new s({Extends:l,Mixins:[n.Alpha,n.BlendMode,n.Depth,n.Flip,n.GetBounds,n.Mask,n.Origin,n.Pipeline,n.ScrollFactor,n.Size,n.TextureCrop,n.Tint,n.Transform,n.Visible,d],initialize:function(t,e,i,s){l.call(this,t,"Video"),this.video=null,this.videoTexture=null,this.videoTextureSource=null,this.snapshotTexture=null,this.flipY=!1,this._key=c(),this.touchLocked=!0,this.playWhenUnlocked=!1,this.retryLimit=20,this.retry=0,this.retryInterval=500,this._retryID=null,this._systemMuted=!1,this._codeMuted=!1,this._systemPaused=!1,this._codePaused=!1,this._callbacks={play:this.playHandler.bind(this),error:this.loadErrorHandler.bind(this),end:this.completeHandler.bind(this),time:this.timeUpdateHandler.bind(this),seeking:this.seekingHandler.bind(this),seeked:this.seekedHandler.bind(this)},this._crop=this.resetCropObject(),this.markers={},this._markerIn=-1,this._markerOut=f.MAX_SAFE_INTEGER,this._lastUpdate=0,this._cacheKey="",this._isSeeking=!1,this.removeVideoElementOnDestroy=!1,this.setPosition(e,i),this.initPipeline(),s&&this.changeSource(s,!1);var r=t.sys.game.events;r.on(o.PAUSE,this.globalPause,this),r.on(o.RESUME,this.globalResume,this);var n=t.sys.sound;n&&n.on(u.GLOBAL_MUTE,this.globalMute,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},play:function(t,e,i){if(this.touchLocked&&this.playWhenUnlocked||this.isPlaying())return this;var s=this.video;if(!s)return console.warn("Video not loaded"),this;void 0===t&&(t=s.loop);var r=this.scene.sys.sound;r&&r.mute&&this.setMute(!0),isNaN(e)||(this._markerIn=e),!isNaN(i)&&i>e&&(this._markerOut=i),s.loop=t;var n=this._callbacks,a=s.play();return void 0!==a?a.then(this.playPromiseSuccessHandler.bind(this)).catch(this.playPromiseErrorHandler.bind(this)):(s.addEventListener("playing",n.play,!0),s.readyState<2&&(this.retry=this.retryLimit,this._retryID=window.setTimeout(this.checkVideoProgress.bind(this),this.retryInterval))),s.addEventListener("ended",n.end,!0),s.addEventListener("timeupdate",n.time,!0),s.addEventListener("seeking",n.seeking,!0),s.addEventListener("seeked",n.seeked,!0),this},changeSource:function(t,e,i,s,r){void 0===e&&(e=!0),this.video&&this.stop();var n=this.scene.sys.cache.video.get(t);return n?(this.video=n,this._cacheKey=t,this._codePaused=n.paused,this._codeMuted=n.muted,this.videoTexture?(this.scene.sys.textures.remove(this._key),this.videoTexture=this.scene.sys.textures.create(this._key,n,n.videoWidth,n.videoHeight),this.videoTextureSource=this.videoTexture.source[0],this.videoTexture.add("__BASE",0,0,0,n.videoWidth,n.videoHeight),this.setTexture(this.videoTexture),this.setSizeToFrame(),this.updateDisplayOrigin(),this.emit(a.VIDEO_CREATED,this,n.videoWidth,n.videoHeight)):this.updateTexture(),n.currentTime=0,this._lastUpdate=0,e&&this.play(i,s,r)):this.video=null,this},addMarker:function(t,e,i){return!isNaN(e)&&e>=0&&!isNaN(i)&&(this.markers[t]=[e,i]),this},playMarker:function(t,e){var i=this.markers[t];return i&&this.play(e,i[0],i[1]),this},removeMarker:function(t){return delete this.markers[t],this},snapshot:function(t,e){return void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.snapshotArea(0,0,this.width,this.height,t,e)},snapshotArea:function(t,e,i,s,r,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===s&&(s=this.height),void 0===r&&(r=i),void 0===n&&(n=s);var a=this.video,o=this.snapshotTexture;return o?(o.setSize(r,n),a&&o.context.drawImage(a,t,e,i,s,0,0,r,n)):(o=this.scene.sys.textures.createCanvas(c(),r,n),this.snapshotTexture=o,a&&o.context.drawImage(a,t,e,i,s,0,0,r,n)),o.update()},saveSnapshotTexture:function(t){return this.snapshotTexture?this.scene.sys.textures.renameTexture(this.snapshotTexture.key,t):this.snapshotTexture=this.scene.sys.textures.createCanvas(t,this.width,this.height),this.snapshotTexture},loadURL:function(t,e,i,s){void 0===e&&(e="loadeddata"),void 0===i&&(i=!1),this.video&&this.stop(),this.videoTexture&&this.scene.sys.textures.remove(this._key);var r=document.createElement("video");return r.controls=!1,i&&(r.muted=!0,r.defaultMuted=!0,r.setAttribute("autoplay","autoplay")),r.setAttribute("playsinline","playsinline"),r.setAttribute("preload","auto"),void 0!==s&&r.setAttribute("crossorigin",s),r.addEventListener("error",this._callbacks.error,!0),r.src=t,r.load(),this.video=r,this},loadMediaStream:function(t,e,i){void 0===e&&(e="loadeddata"),void 0===i&&(i=!1),this.video&&this.stop(),this.videoTexture&&this.scene.sys.textures.remove(this._key);var s=document.createElement("video");s.controls=!1,i&&(s.muted=!0,s.defaultMuted=!0,s.setAttribute("autoplay","autoplay")),s.setAttribute("playsinline","playsinline"),s.setAttribute("preload","auto"),s.addEventListener("error",this._callbacks.error,!0);try{s.srcObject=t}catch(e){s.src=window.URL.createObjectURL(t)}return s.load(),this.video=s,this},playPromiseSuccessHandler:function(){this._codePaused=!1,this.touchLocked=!1,this.emit(a.VIDEO_PLAY,this),this._markerIn>-1&&(this.video.currentTime=this._markerIn)},playPromiseErrorHandler:function(t){this.scene.sys.input.once(h.POINTER_DOWN,this.unlockHandler,this),this.touchLocked=!0,this.playWhenUnlocked=!0,this.emit(a.VIDEO_ERROR,this,t)},playHandler:function(){this._codePaused=!1,this.touchLocked=!1,this.emit(a.VIDEO_PLAY,this),this.video.removeEventListener("playing",this._callbacks.play,!0)},loadErrorHandler:function(t){this.stop(),this.emit(a.VIDEO_ERROR,this,t)},unlockHandler:function(){this.touchLocked=!1,this.playWhenUnlocked=!1,this.emit(a.VIDEO_UNLOCKED,this),this._markerIn>-1&&(this.video.currentTime=this._markerIn),this.video.play(),this.emit(a.VIDEO_PLAY,this)},completeHandler:function(){this.emit(a.VIDEO_COMPLETE,this)},timeUpdateHandler:function(){this.video&&this.video.currentTime=this._markerOut&&(t.loop?(t.currentTime=this._markerIn,this.updateTexture(),this._lastUpdate=e,this.emit(a.VIDEO_LOOP,this)):(this.emit(a.VIDEO_COMPLETE,this),this.stop())))}},checkVideoProgress:function(){this.video.readyState>=2?this.updateTexture():(this.retry--,this.retry>0?this._retryID=window.setTimeout(this.checkVideoProgress.bind(this),this.retryInterval):this.emit(a.VIDEO_TIMEOUT,this))},updateTexture:function(){var t=this.video,e=t.videoWidth,i=t.videoHeight;if(this.videoTexture){var s=this.videoTextureSource;s.source!==t&&(s.source=t,s.width=e,s.height=i),s.update()}else this.videoTexture=this.scene.sys.textures.create(this._key,t,e,i),this.videoTextureSource=this.videoTexture.source[0],this.videoTexture.add("__BASE",0,0,0,e,i),this.setTexture(this.videoTexture),this.setSizeToFrame(),this.updateDisplayOrigin(),this.emit(a.VIDEO_CREATED,this,e,i)},getVideoKey:function(){return this._cacheKey},seekTo:function(t){var e=this.video;if(e){var i=e.duration;if(i!==1/0&&!isNaN(i)){var s=i*t;this.setCurrentTime(s)}}return this},getCurrentTime:function(){return this.video?this.video.currentTime:0},setCurrentTime:function(t){var e=this.video;if(e){if("string"==typeof t){var i=t[0],s=parseFloat(t.substr(1));"+"===i?t=e.currentTime+s:"-"===i&&(t=e.currentTime-s)}e.currentTime=t,this._lastUpdate=t}return this},isSeeking:function(){return this._isSeeking},seekingHandler:function(){this._isSeeking=!0,this.emit(a.VIDEO_SEEKING,this)},seekedHandler:function(){this._isSeeking=!1,this.emit(a.VIDEO_SEEKED,this),this.video&&this.updateTexture()},getProgress:function(){var t=this.video;if(t){var e=t.currentTime,i=t.duration;if(i!==1/0&&!isNaN(i))return e/i}return 0},getDuration:function(){return this.video?this.video.duration:0},setMute:function(t){void 0===t&&(t=!0),this._codeMuted=t;var e=this.video;return e&&(e.muted=!!this._systemMuted||t),this},isMuted:function(){return this._codeMuted},globalMute:function(t,e){this._systemMuted=e;var i=this.video;i&&(i.muted=!!this._codeMuted||e)},globalPause:function(){this._systemPaused=!0,this.video&&this.video.pause()},globalResume:function(){this._systemPaused=!1,this.video&&!this._codePaused&&this.video.play()},setPaused:function(t){void 0===t&&(t=!0);var e=this.video;return this._codePaused=t,e&&(t?e.paused||e.pause():t||e.paused&&!this._systemPaused&&e.play()),this},getVolume:function(){return this.video?this.video.volume:1},setVolume:function(t){return void 0===t&&(t=1),this.video&&(this.video.volume=r(t,0,1)),this},getPlaybackRate:function(){return this.video?this.video.playbackRate:1},setPlaybackRate:function(t){return this.video&&(this.video.playbackRate=t),this},getLoop:function(){return!!this.video&&this.video.loop},setLoop:function(t){return void 0===t&&(t=!0),this.video&&(this.video.loop=t),this},isPlaying:function(){return!!this.video&&!(this.video.paused||this.video.ended)},isPaused:function(){return this.video&&this.video.paused||this._codePaused||this._systemPaused},saveTexture:function(t,e){return void 0===e&&(e=!1),this.videoTexture&&this.scene.sys.textures.renameTexture(this._key,t),this._key=t,this.flipY=e,this.videoTextureSource&&this.videoTextureSource.setFlipY(e),this.videoTexture},stop:function(){var t=this.video;if(t){var e=this._callbacks;for(var i in e)t.removeEventListener(i,e[i],!0);t.pause()}return this._retryID&&window.clearTimeout(this._retryID),this.emit(a.VIDEO_STOP,this),this},removeVideoElement:function(){var t=this.video;if(t){for(t.parentNode&&t.parentNode.removeChild(t);t.hasChildNodes();)t.removeChild(t.firstChild);t.removeAttribute("autoplay"),t.removeAttribute("src"),this.video=null}},preDestroy:function(){this.stop(),this.removeVideoElementOnDestroy&&this.removeVideoElement();var t=this.scene.sys.game.events;t.off(o.PAUSE,this.globalPause,this),t.off(o.RESUME,this.globalResume,this);var e=this.scene.sys.sound;e&&e.off(u.GLOBAL_MUTE,this.globalMute,this),this._retryID&&window.clearTimeout(this._retryID)}});t.exports=p},56933:t=>{t.exports=function(t,e,i,s){e.videoTexture&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,s))}},65601:(t,e,i)=>{var s=i(88933),r=i(99325),n=i(20494),a=i(8630);r.register("video",(function(t,e){void 0===t&&(t={});var i=n(t,"key",null),r=new a(this.scene,0,0,i);return void 0!==e&&(t.add=e),s(this.scene,r,t),t.add||this.updateList.add(r),r}))},215:(t,e,i)=>{var s=i(8630);i(61286).register("video",(function(t,e,i){return this.displayList.add(new s(this.scene,t,e,i))}))},77974:(t,e,i)=>{var s=i(72283),r=i(72283);s=i(83572),r=i(56933),t.exports={renderWebGL:s,renderCanvas:r}},83572:t=>{t.exports=function(t,e,i,s){e.videoTexture&&(i.addToRenderList(e),e.pipeline.batchSprite(e,i,s))}},71030:(t,e,i)=>{var s=i(95723),r=i(26673),n=i(65650),a=i(56694),o=i(64937),h=i(89980),l=i(74118),u=i(94287),c=new a({Extends:h,Mixins:[o.Depth,o.GetBounds,o.Origin,o.Transform,o.ScrollFactor,o.Visible],initialize:function(t,e,i,r,n){void 0===r&&(r=1),void 0===n&&(n=r),h.call(this,t,"Zone"),this.setPosition(e,i),this.width=r,this.height=n,this.blendMode=s.NORMAL,this.updateDisplayOrigin()},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e,i){void 0===i&&(i=!0),this.width=t,this.height=e,this.updateDisplayOrigin();var s=this.input;return i&&s&&!s.customHitArea&&(s.hitArea.width=t,s.hitArea.height=e),this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},setCircleDropZone:function(t){return this.setDropZone(new r(0,0,t),n)},setRectangleDropZone:function(t,e){return this.setDropZone(new l(0,0,t,e),u)},setDropZone:function(t,e){return this.input||this.setInteractive(t,e,!0),this},setAlpha:function(){},setBlendMode:function(){},renderCanvas:function(t,e,i){i.addToRenderList(e)},renderWebGL:function(t,e,i){i.addToRenderList(e)}});t.exports=c},24067:(t,e,i)=>{var s=i(99325),r=i(20494),n=i(71030);s.register("zone",(function(t){var e=r(t,"x",0),i=r(t,"y",0),s=r(t,"width",1),a=r(t,"height",s);return new n(this.scene,e,i,s,a)}))},34546:(t,e,i)=>{var s=i(71030);i(61286).register("zone",(function(t,e,i,r){return this.displayList.add(new s(this.scene,t,e,i,r))}))},95847:t=>{t.exports=function(t){return t.radius>0?Math.PI*t.radius*t.radius:0}},26673:(t,e,i)=>{var s=i(56694),r=i(65650),n=i(94026),a=i(62941),o=i(52394),h=i(30977),l=new s({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.type=o.CIRCLE,this.x=t,this.y=e,this._radius=i,this._diameter=2*i},contains:function(t,e){return r(this,t,e)},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i){return this.x=t,this.y=e,this._radius=i,this._diameter=2*i,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this._diameter=2*t}},diameter:{get:function(){return this._diameter},set:function(t){this._diameter=t,this._radius=.5*t}},left:{get:function(){return this.x-this._radius},set:function(t){this.x=t+this._radius}},right:{get:function(){return this.x+this._radius},set:function(t){this.x=t-this._radius}},top:{get:function(){return this.y-this._radius},set:function(t){this.y=t+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(t){this.y=t-this._radius}}});t.exports=l},37964:t=>{t.exports=function(t){return Math.PI*t.radius*2}},72233:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){return void 0===i&&(i=new s),i.x=t.x+t.radius*Math.cos(e),i.y=t.y+t.radius*Math.sin(e),i}},61761:(t,e,i)=>{var s=i(26673);t.exports=function(t){return new s(t.x,t.y,t.radius)}},65650:t=>{t.exports=function(t,e,i){return t.radius>0&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},39187:(t,e,i)=>{var s=i(65650);t.exports=function(t,e){return s(t,e.x,e.y)}},58672:(t,e,i)=>{var s=i(65650);t.exports=function(t,e){return s(t,e.x,e.y)&&s(t,e.right,e.y)&&s(t,e.x,e.bottom)&&s(t,e.right,e.bottom)}},42997:t=>{t.exports=function(t,e){return e.setTo(t.x,t.y,t.radius)}},94894:t=>{t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.radius===e.radius}},48027:(t,e,i)=>{var s=i(74118);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.left,e.y=t.top,e.width=t.diameter,e.height=t.diameter,e}},94026:(t,e,i)=>{var s=i(72233),r=i(91806),n=i(83392),a=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new a);var o=r(e,0,n.PI2);return s(t,o,i)}},62941:(t,e,i)=>{var s=i(37964),r=i(72233),n=i(91806),a=i(83392);t.exports=function(t,e,i,o){void 0===o&&(o=[]),!e&&i>0&&(e=s(t)/i);for(var h=0;h{t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},88665:t=>{t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},30977:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){void 0===e&&(e=new s);var i=2*Math.PI*Math.random(),r=Math.random()+Math.random(),n=r>1?2-r:r,a=n*Math.cos(i),o=n*Math.sin(i);return e.x=t.x+a*t.radius,e.y=t.y+o*t.radius,e}},6112:(t,e,i)=>{var s=i(26673);s.Area=i(95847),s.Circumference=i(37964),s.CircumferencePoint=i(72233),s.Clone=i(61761),s.Contains=i(65650),s.ContainsPoint=i(39187),s.ContainsRect=i(58672),s.CopyFrom=i(42997),s.Equals=i(94894),s.GetBounds=i(48027),s.GetPoint=i(94026),s.GetPoints=i(62941),s.Offset=i(34585),s.OffsetPoint=i(88665),s.Random=i(30977),t.exports=s},52394:t=>{t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},58605:t=>{t.exports=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI}},39507:t=>{t.exports=function(t){var e=t.width/2,i=t.height/2,s=Math.pow(e-i,2)/Math.pow(e+i,2);return Math.PI*(e+i)*(1+3*s/(10+Math.sqrt(4-3*s)))}},86998:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new s);var r=t.width/2,n=t.height/2;return i.x=t.x+r*Math.cos(e),i.y=t.y+n*Math.sin(e),i}},81773:(t,e,i)=>{var s=i(95669);t.exports=function(t){return new s(t.x,t.y,t.width,t.height)}},72313:t=>{t.exports=function(t,e,i){if(t.width<=0||t.height<=0)return!1;var s=(e-t.x)/t.width,r=(i-t.y)/t.height;return(s*=s)+(r*=r)<.25}},34368:(t,e,i)=>{var s=i(72313);t.exports=function(t,e){return s(t,e.x,e.y)}},71431:(t,e,i)=>{var s=i(72313);t.exports=function(t,e){return s(t,e.x,e.y)&&s(t,e.right,e.y)&&s(t,e.x,e.bottom)&&s(t,e.right,e.bottom)}},75459:t=>{t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},95669:(t,e,i)=>{var s=i(56694),r=i(72313),n=i(95340),a=i(54978),o=i(52394),h=i(72006),l=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.type=o.ELLIPSE,this.x=t,this.y=e,this.width=i,this.height=s},contains:function(t,e){return r(this,t,e)},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setEmpty:function(){return this.width=0,this.height=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getMinorRadius:function(){return Math.min(this.width,this.height)/2},getMajorRadius:function(){return Math.max(this.width,this.height)/2},left:{get:function(){return this.x-this.width/2},set:function(t){this.x=t+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(t){this.y=t+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=l},98068:t=>{t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},72897:(t,e,i)=>{var s=i(74118);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.left,e.y=t.top,e.width=t.width,e.height=t.height,e}},95340:(t,e,i)=>{var s=i(86998),r=i(91806),n=i(83392),a=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new a);var o=r(e,0,n.PI2);return s(t,o,i)}},54978:(t,e,i)=>{var s=i(39507),r=i(86998),n=i(91806),a=i(83392);t.exports=function(t,e,i,o){void 0===o&&(o=[]),!e&&i>0&&(e=s(t)/i);for(var h=0;h{t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},36233:t=>{t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},72006:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){void 0===e&&(e=new s);var i=Math.random()*Math.PI*2,r=Math.sqrt(Math.random());return e.x=t.x+r*Math.cos(i)*t.width/2,e.y=t.y+r*Math.sin(i)*t.height/2,e}},40652:(t,e,i)=>{var s=i(95669);s.Area=i(58605),s.Circumference=i(39507),s.CircumferencePoint=i(86998),s.Clone=i(81773),s.Contains=i(72313),s.ContainsPoint=i(34368),s.ContainsRect=i(71431),s.CopyFrom=i(75459),s.Equals=i(98068),s.GetBounds=i(72897),s.GetPoint=i(95340),s.GetPoints=i(54978),s.Offset=i(77951),s.OffsetPoint=i(36233),s.Random=i(72006),t.exports=s},84068:(t,e,i)=>{var s=i(52394),r=i(98611),n={Circle:i(6112),Ellipse:i(40652),Intersects:i(7563),Line:i(28482),Mesh:i(14293),Point:i(63472),Polygon:i(44359),Rectangle:i(66658),Triangle:i(87619)};n=r(!1,n,s),t.exports=n},22184:(t,e,i)=>{var s=i(53996);t.exports=function(t,e){return s(t.x,t.y,e.x,e.y)<=t.radius+e.radius}},26535:t=>{t.exports=function(t,e){var i=e.width/2,s=e.height/2,r=Math.abs(t.x-e.x-i),n=Math.abs(t.y-e.y-s),a=i+t.radius,o=s+t.radius;if(r>a||n>o)return!1;if(r<=i||n<=s)return!0;var h=r-i,l=n-s;return h*h+l*l<=t.radius*t.radius}},71145:(t,e,i)=>{var s=i(79967),r=i(22184);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e)){var n,a,o,h,l=t.x,u=t.y,c=t.radius,d=e.x,f=e.y,p=e.radius;if(u===f)0===(o=(a=-2*f)*a-4*(n=1)*(d*d+(h=(p*p-c*c-d*d+l*l)/(2*(l-d)))*h-2*d*h+f*f-p*p))?i.push(new s(h,-a/(2*n))):o>0&&(i.push(new s(h,(-a+Math.sqrt(o))/(2*n))),i.push(new s(h,(-a-Math.sqrt(o))/(2*n))));else{var v=(l-d)/(u-f),g=(p*p-c*c-d*d+l*l-f*f+u*u)/(2*(u-f));0===(o=(a=2*u*v-2*g*v-2*l)*a-4*(n=v*v+1)*(l*l+u*u+g*g-c*c-2*u*g))?(h=-a/(2*n),i.push(new s(h,g-h*v))):o>0&&(h=(-a+Math.sqrt(o))/(2*n),i.push(new s(h,g-h*v)),h=(-a-Math.sqrt(o))/(2*n),i.push(new s(h,g-h*v)))}}return i}},62508:(t,e,i)=>{var s=i(26111),r=i(26535);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e)){var n=e.getLineA(),a=e.getLineB(),o=e.getLineC(),h=e.getLineD();s(n,t,i),s(a,t,i),s(o,t,i),s(h,t,i)}return i}},26111:(t,e,i)=>{var s=i(79967),r=i(61472);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e)){var n,a,o=t.x1,h=t.y1,l=t.x2,u=t.y2,c=e.x,d=e.y,f=e.radius,p=l-o,v=u-h,g=o-c,m=h-d,y=p*p+v*v,x=2*(p*g+v*m),T=x*x-4*y*(g*g+m*m-f*f);if(0===T){var w=-x/(2*y);n=o+w*p,a=h+w*v,w>=0&&w<=1&&i.push(new s(n,a))}else if(T>0){var E=(-x-Math.sqrt(T))/(2*y);n=o+E*p,a=h+E*v,E>=0&&E<=1&&i.push(new s(n,a));var b=(-x+Math.sqrt(T))/(2*y);n=o+b*p,a=h+b*v,b>=0&&b<=1&&i.push(new s(n,a))}}return i}},96537:(t,e,i)=>{var s=i(70015);t.exports=function(t,e,i){var r=t.x1,n=t.y1,a=t.x2,o=t.y2,h=e.x1,l=e.y1,u=a-r,c=o-n,d=e.x2-h,f=e.y2-l,p=u*f-c*d;if(0===p)return!1;var v=((h-r)*f-(l-n)*d)/p,g=((n-l)*u-(r-h)*c)/p;return v<0||v>1||g<0||g>1?null:(void 0===i&&(i=new s),i.set(r+u*v,n+c*v,v))}},17647:(t,e,i)=>{var s=i(70015),r=i(96537),n=new(i(88829)),a=new s;t.exports=function(t,e,i){void 0===i&&(i=new s);var o=!1;i.set(),a.set();for(var h=e[0],l=1;l{var s=i(70015),r=i(51729),n=i(17647),a=new s;t.exports=function(t,e,i){void 0===i&&(i=new r),Array.isArray(e)||(e=[e]);var s=!1;i.set(),a.set();for(var o=0;o{var s=i(79967),r=i(25227),n=i(47910);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e))for(var a=e.getLineA(),o=e.getLineB(),h=e.getLineC(),l=e.getLineD(),u=[new s,new s,new s,new s],c=[r(a,t,u[0]),r(o,t,u[1]),r(h,t,u[2]),r(l,t,u[3])],d=0;d<4;d++)c[d]&&i.push(u[d]);return i}},7449:(t,e,i)=>{var s=i(51729),r=i(68439),n=new(i(88829));function a(t,e,i,a,o){var h=Math.cos(t),l=Math.sin(t);n.setTo(e,i,e+h,i+l);var u=r(n,a);u&&o.push(new s(u.x,u.y,t,u.w))}function o(t,e){return t.z-e.z}t.exports=function(t,e,i){Array.isArray(i)||(i=[i]);for(var s=[],r=[],n=0;n{var s=i(74118),r=i(90205);t.exports=function(t,e,i){return void 0===i&&(i=new s),r(t,e)&&(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y),i}},1946:(t,e,i)=>{var s=i(9569),r=i(90205);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e)){var n=t.getLineA(),a=t.getLineB(),o=t.getLineC(),h=t.getLineD();s(n,e,i),s(a,e,i),s(o,e,i),s(h,e,i)}return i}},34211:(t,e,i)=>{var s=i(20370),r=i(9569);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var n=e.getLineA(),a=e.getLineB(),o=e.getLineC();r(n,t,i),r(a,t,i),r(o,t,i)}return i}},80511:(t,e,i)=>{var s=i(26111),r=i(48411);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e)){var n=t.getLineA(),a=t.getLineB(),o=t.getLineC();s(n,e,i),s(a,e,i),s(o,e,i)}return i}},31343:(t,e,i)=>{var s=i(79967),r=i(86117),n=i(25227);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e))for(var a=t.getLineA(),o=t.getLineB(),h=t.getLineC(),l=[new s,new s,new s],u=[n(a,e,l[0]),n(o,e,l[1]),n(h,e,l[2])],c=0;c<3;c++)u[c]&&i.push(l[c]);return i}},70534:(t,e,i)=>{var s=i(23589),r=i(31343);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var n=e.getLineA(),a=e.getLineB(),o=e.getLineC();r(t,n,i),r(t,a,i),r(t,o,i)}return i}},61472:(t,e,i)=>{var s=i(65650),r=new(i(79967));t.exports=function(t,e,i){if(void 0===i&&(i=r),s(e,t.x1,t.y1))return i.x=t.x1,i.y=t.y1,!0;if(s(e,t.x2,t.y2))return i.x=t.x2,i.y=t.y2,!0;var n=t.x2-t.x1,a=t.y2-t.y1,o=e.x-t.x1,h=e.y-t.y1,l=n*n+a*a,u=n,c=a;if(l>0){var d=(o*n+h*a)/l;u*=d,c*=d}return i.x=t.x1+u,i.y=t.y1+c,u*u+c*c<=l&&u*n+c*a>=0&&s(e,i.x,i.y)}},25227:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new s);var r=t.x1,n=t.y1,a=t.x2,o=t.y2,h=e.x1,l=e.y1,u=e.x2,c=e.y2,d=(c-l)*(a-r)-(u-h)*(o-n);if(0===d)return!1;var f=((u-h)*(n-l)-(c-l)*(r-h))/d,p=((a-r)*(n-l)-(o-n)*(r-h))/d;return f>=0&&f<=1&&p>=0&&p<=1&&(i.x=r+f*(a-r),i.y=n+f*(o-n),!0)}},47910:t=>{t.exports=function(t,e){var i=t.x1,s=t.y1,r=t.x2,n=t.y2,a=e.x,o=e.y,h=e.right,l=e.bottom,u=0;if(i>=a&&i<=h&&s>=o&&s<=l||r>=a&&r<=h&&n>=o&&n<=l)return!0;if(i=a){if((u=s+(n-s)*(a-i)/(r-i))>o&&u<=l)return!0}else if(i>h&&r<=h&&(u=s+(n-s)*(h-i)/(r-i))>=o&&u<=l)return!0;if(s=o){if((u=i+(r-i)*(o-s)/(n-s))>=a&&u<=h)return!0}else if(s>l&&n<=l&&(u=i+(r-i)*(l-s)/(n-s))>=a&&u<=h)return!0;return!1}},34426:t=>{t.exports=function(t,e,i){void 0===i&&(i=1);var s=e.x1,r=e.y1,n=e.x2,a=e.y2,o=t.x,h=t.y,l=(n-s)*(n-s)+(a-r)*(a-r);if(0===l)return!1;var u=((o-s)*(n-s)+(h-r)*(a-r))/l;if(u<0)return Math.sqrt((s-o)*(s-o)+(r-h)*(r-h))<=i;if(u>=0&&u<=1){var c=((r-h)*(n-s)-(s-o)*(a-r))/l;return Math.abs(c)*Math.sqrt(l)<=i}return Math.sqrt((n-o)*(n-o)+(a-h)*(a-h))<=i}},81414:(t,e,i)=>{var s=i(34426);t.exports=function(t,e){if(!s(t,e))return!1;var i=Math.min(e.x1,e.x2),r=Math.max(e.x1,e.x2),n=Math.min(e.y1,e.y2),a=Math.max(e.y1,e.y2);return t.x>=i&&t.x<=r&&t.y>=n&&t.y<=a}},90205:t=>{t.exports=function(t,e){return!(t.width<=0||t.height<=0||e.width<=0||e.height<=0)&&!(t.righte.right||t.y>e.bottom)}},20370:(t,e,i)=>{var s=i(25227),r=i(94287),n=i(86875),a=i(87279);t.exports=function(t,e){if(e.left>t.right||e.rightt.bottom||e.bottom0}},8786:t=>{t.exports=function(t,e,i,s,r,n){return void 0===n&&(n=0),!(e>t.right+n||it.bottom+n||r{var s=i(61472),r=i(60689);t.exports=function(t,e){return!(t.left>e.right||t.righte.bottom||t.bottom{var s=i(25227);t.exports=function(t,e){return!(!t.contains(e.x1,e.y1)&&!t.contains(e.x2,e.y2))||(!!s(t.getLineA(),e)||(!!s(t.getLineB(),e)||!!s(t.getLineC(),e)))}},23589:(t,e,i)=>{var s=i(86875),r=i(18680),n=i(25227);t.exports=function(t,e){if(t.left>e.right||t.righte.bottom||t.bottom0||(c=r(e),(d=s(t,c,!0)).length>0)}},7563:(t,e,i)=>{t.exports={CircleToCircle:i(22184),CircleToRectangle:i(26535),GetCircleToCircle:i(71145),GetCircleToRectangle:i(62508),GetLineToCircle:i(26111),GetLineToLine:i(96537),GetLineToPoints:i(17647),GetLineToPolygon:i(68439),GetLineToRectangle:i(9569),GetRaysFromPointToPolygon:i(7449),GetRectangleIntersection:i(82931),GetRectangleToRectangle:i(1946),GetRectangleToTriangle:i(34211),GetTriangleToCircle:i(80511),GetTriangleToLine:i(31343),GetTriangleToTriangle:i(70534),LineToCircle:i(61472),LineToLine:i(25227),LineToRectangle:i(47910),PointToLine:i(34426),PointToLineSegment:i(81414),RectangleToRectangle:i(90205),RectangleToTriangle:i(20370),RectangleToValues:i(8786),TriangleToCircle:i(48411),TriangleToLine:i(86117),TriangleToTriangle:i(23589)}},50599:t=>{t.exports=function(t){return Math.atan2(t.y2-t.y1,t.x2-t.x1)}},58813:t=>{t.exports=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=[]);var s=Math.round(t.x1),r=Math.round(t.y1),n=Math.round(t.x2),a=Math.round(t.y2),o=Math.abs(n-s),h=Math.abs(a-r),l=s-h&&(c-=h,s+=l),f{t.exports=function(t,e,i){var s=e-(t.x1+t.x2)/2,r=i-(t.y1+t.y2)/2;return t.x1+=s,t.y1+=r,t.x2+=s,t.y2+=r,t}},26718:(t,e,i)=>{var s=i(88829);t.exports=function(t){return new s(t.x1,t.y1,t.x2,t.y2)}},88930:t=>{t.exports=function(t,e){return e.setTo(t.x1,t.y1,t.x2,t.y2)}},90656:t=>{t.exports=function(t,e){return t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2}},30897:(t,e,i)=>{var s=i(16028);t.exports=function(t,e,i){void 0===i&&(i=e);var r=s(t),n=t.x2-t.x1,a=t.y2-t.y1;return e&&(t.x1=t.x1-n/r*e,t.y1=t.y1-a/r*e),i&&(t.x2=t.x2+n/r*i,t.y2=t.y2+a/r*i),t}},30684:(t,e,i)=>{var s=i(92951),r=i(21902),n=i(79967);t.exports=function(t,e,i,a,o){void 0===a&&(a=0),void 0===o&&(o=[]);var h,l,u=[],c=t.x1,d=t.y1,f=t.x2-c,p=t.y2-d,v=r(e,o),g=i-1;for(h=0;h0){var m=u[0],y=[m];for(h=1;h=a&&(y.push(x),m=x)}var T=u[u.length-1];return s(m,T){var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=(t.x1+t.x2)/2,e.y=(t.y1+t.y2)/2,e}},11222:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new s);var r=t.x1,n=t.y1,a=t.x2,o=t.y2,h=(a-r)*(a-r)+(o-n)*(o-n);if(0===h)return i;var l=((e.x-r)*(a-r)+(e.y-n)*(o-n))/h;return i.x=r+l*(a-r),i.y=n+l*(o-n),i}},7377:(t,e,i)=>{var s=i(83392),r=i(50599),n=i(79967);t.exports=function(t,e){void 0===e&&(e=new n);var i=r(t)-s.TAU;return e.x=Math.cos(i),e.y=Math.sin(i),e}},66464:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){return void 0===i&&(i=new s),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},8570:(t,e,i)=>{var s=i(16028),r=i(79967);t.exports=function(t,e,i,n){void 0===n&&(n=[]),!e&&i>0&&(e=s(t)/i);for(var a=t.x1,o=t.y1,h=t.x2,l=t.y2,u=0;u{t.exports=function(t,e){var i=t.x1,s=t.y1,r=t.x2,n=t.y2,a=(r-i)*(r-i)+(n-s)*(n-s);if(0===a)return!1;var o=((s-e.y)*(r-i)-(i-e.x)*(n-s))/a;return Math.abs(o)*Math.sqrt(a)}},82996:t=>{t.exports=function(t){return Math.abs(t.y1-t.y2)}},16028:t=>{t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},88829:(t,e,i)=>{var s=i(56694),r=i(66464),n=i(8570),a=i(52394),o=i(74077),h=i(93736),l=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.type=a.LINE,this.x1=t,this.y1=e,this.x2=i,this.y2=s},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return n(this,t,e,i)},getRandomPoint:function(t){return o(this,t)},setTo:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.x1=t,this.y1=e,this.x2=i,this.y2=s,this},getPointA:function(t){return void 0===t&&(t=new h),t.set(this.x1,this.y1),t},getPointB:function(t){return void 0===t&&(t=new h),t.set(this.x2,this.y2),t},left:{get:function(){return Math.min(this.x1,this.x2)},set:function(t){this.x1<=this.x2?this.x1=t:this.x2=t}},right:{get:function(){return Math.max(this.x1,this.x2)},set:function(t){this.x1>this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},73273:(t,e,i)=>{var s=i(83392),r=i(1071),n=i(50599);t.exports=function(t){var e=n(t)-s.TAU;return r(e,-Math.PI,Math.PI)}},96936:(t,e,i)=>{var s=i(83392),r=i(50599);t.exports=function(t){return Math.cos(r(t)-s.TAU)}},43581:(t,e,i)=>{var s=i(83392),r=i(50599);t.exports=function(t){return Math.sin(r(t)-s.TAU)}},13990:t=>{t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t}},1298:t=>{t.exports=function(t){return-(t.x2-t.x1)/(t.y2-t.y1)}},74077:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){void 0===e&&(e=new s);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},30473:(t,e,i)=>{var s=i(50599),r=i(73273);t.exports=function(t,e){return 2*r(e)-Math.PI-s(t)}},25968:(t,e,i)=>{var s=i(1809);t.exports=function(t,e){var i=(t.x1+t.x2)/2,r=(t.y1+t.y2)/2;return s(t,i,r,e)}},24296:(t,e,i)=>{var s=i(1809);t.exports=function(t,e,i){return s(t,e.x,e.y,i)}},1809:t=>{t.exports=function(t,e,i,s){var r=Math.cos(s),n=Math.sin(s),a=t.x1-e,o=t.y1-i;return t.x1=a*r-o*n+e,t.y1=a*n+o*r+i,a=t.x2-e,o=t.y2-i,t.x2=a*r-o*n+e,t.y2=a*n+o*r+i,t}},88171:t=>{t.exports=function(t,e,i,s,r){return t.x1=e,t.y1=i,t.x2=e+Math.cos(s)*r,t.y2=i+Math.sin(s)*r,t}},82797:t=>{t.exports=function(t){return(t.y2-t.y1)/(t.x2-t.x1)}},41067:t=>{t.exports=function(t){return Math.abs(t.x1-t.x2)}},28482:(t,e,i)=>{var s=i(88829);s.Angle=i(50599),s.BresenhamPoints=i(58813),s.CenterOn=i(88513),s.Clone=i(26718),s.CopyFrom=i(88930),s.Equals=i(90656),s.Extend=i(30897),s.GetEasedPoints=i(30684),s.GetMidPoint=i(20487),s.GetNearestPoint=i(11222),s.GetNormal=i(7377),s.GetPoint=i(66464),s.GetPoints=i(8570),s.GetShortestDistance=i(65269),s.Height=i(82996),s.Length=i(16028),s.NormalAngle=i(73273),s.NormalX=i(96936),s.NormalY=i(43581),s.Offset=i(13990),s.PerpSlope=i(1298),s.Random=i(74077),s.ReflectAngle=i(30473),s.Rotate=i(25968),s.RotateAroundPoint=i(24296),s.RotateAroundXY=i(1809),s.SetToAngle=i(88171),s.Slope=i(82797),s.Width=i(41067),t.exports=s},18693:(t,e,i)=>{var s=i(56694),r=i(74118),n=i(93736);function a(t,e,i,s){var r=t-i,n=e-s,a=r*r+n*n;return Math.sqrt(a)}var o=new s({initialize:function(t,e,i){this.vertex1=t,this.vertex2=e,this.vertex3=i,this.bounds=new r,this._inCenter=new n},getInCenter:function(t){void 0===t&&(t=!0);var e,i,s,r,n,o,h=this.vertex1,l=this.vertex2,u=this.vertex3;t?(e=h.x,i=h.y,s=l.x,r=l.y,n=u.x,o=u.y):(e=h.vx,i=h.vy,s=l.vx,r=l.vy,n=u.vx,o=u.vy);var c=a(n,o,s,r),d=a(e,i,n,o),f=a(s,r,e,i),p=c+d+f;return this._inCenter.set((e*c+s*d+n*f)/p,(i*c+r*d+o*f)/p)},contains:function(t,e,i){var s=this.vertex1,r=this.vertex2,n=this.vertex3,a=s.vx,o=s.vy,h=r.vx,l=r.vy,u=n.vx,c=n.vy;if(i){var d=i.a,f=i.b,p=i.c,v=i.d,g=i.e,m=i.f;a=s.vx*d+s.vy*p+g,o=s.vx*f+s.vy*v+m,h=r.vx*d+r.vy*p+g,l=r.vx*f+r.vy*v+m,u=n.vx*d+n.vy*p+g,c=n.vx*f+n.vy*v+m}var y=u-a,x=c-o,T=h-a,w=l-o,E=t-a,b=e-o,S=y*y+x*x,A=y*T+x*w,_=y*E+x*b,C=T*T+w*w,R=T*E+w*b,M=S*C-A*A,P=0===M?0:1/M,O=(C*_-A*R)*P,L=(S*R-A*_)*P;return O>=0&&L>=0&&O+L<1},isCounterClockwise:function(t){var e=this.vertex1,i=this.vertex2,s=this.vertex3,r=(i.vx-e.vx)*(s.vy-e.vy)-(i.vy-e.vy)*(s.vx-e.vx);return t<=0?r>=0:r<0},load:function(t,e,i,s,r){return i=this.vertex1.load(t,e,i,s,r),i=this.vertex2.load(t,e,i,s,r),i=this.vertex3.load(t,e,i,s,r)},transformCoordinatesLocal:function(t,e,i,s){return this.vertex1.transformCoordinatesLocal(t,e,i,s),this.vertex2.transformCoordinatesLocal(t,e,i,s),this.vertex3.transformCoordinatesLocal(t,e,i,s),this},updateBounds:function(){var t=this.vertex1,e=this.vertex2,i=this.vertex3,s=this.bounds;return s.x=Math.min(t.vx,e.vx,i.vx),s.y=Math.min(t.vy,e.vy,i.vy),s.width=Math.max(t.vx,e.vx,i.vx)-s.x,s.height=Math.max(t.vy,e.vy,i.vy)-s.y,this},isInView:function(t,e,i,s,r,n,a,o,h,l,u){var c=this.vertex1.update(r,n,a,o,h,l,u,s),d=this.vertex2.update(r,n,a,o,h,l,u,s),f=this.vertex3.update(r,n,a,o,h,l,u,s);if(c.ta<=0&&d.ta<=0&&f.ta<=0)return!1;if(e&&!this.isCounterClockwise(i))return!1;var p=this.bounds;p.x=Math.min(c.tx,d.tx,f.tx),p.y=Math.min(c.ty,d.ty,f.ty),p.width=Math.max(c.tx,d.tx,f.tx)-p.x,p.height=Math.max(c.ty,d.ty,f.ty)-p.y;var v=t.x+t.width,g=t.y+t.height;return!(p.width<=0||p.height<=0||t.width<=0||t.height<=0)&&!(p.rightv||p.y>g)},translate:function(t,e){void 0===e&&(e=0);var i=this.vertex1,s=this.vertex2,r=this.vertex3;return i.x+=t,i.y+=e,s.x+=t,s.y+=e,r.x+=t,r.y+=e,this},x:{get:function(){return this.getInCenter().x},set:function(t){var e=this.getInCenter();this.translate(t-e.x,0)}},y:{get:function(){return this.getInCenter().y},set:function(t){var e=this.getInCenter();this.translate(0,t-e.y)}},alpha:{get:function(){var t=this.vertex1,e=this.vertex2,i=this.vertex3;return(t.alpha+e.alpha+i.alpha)/3},set:function(t){this.vertex1.alpha=t,this.vertex2.alpha=t,this.vertex3.alpha=t}},depth:{get:function(){var t=this.vertex1,e=this.vertex2,i=this.vertex3;return(t.vz+e.vz+i.vz)/3}},destroy:function(){this.vertex1=null,this.vertex2=null,this.vertex3=null}});t.exports=o},99425:(t,e,i)=>{var s=i(18693),r=i(72632),n=i(16650),a=i(70015),o=i(85769),h=new a,l=new a,u=new n;t.exports=function(t){var e=r(t,"mesh"),i=r(t,"texture",null),n=r(t,"frame"),a=r(t,"width",1),c=r(t,"height",a),d=r(t,"widthSegments",1),f=r(t,"heightSegments",d),p=r(t,"x",0),v=r(t,"y",0),g=r(t,"z",0),m=r(t,"rotateX",0),y=r(t,"rotateY",0),x=r(t,"rotateZ",0),T=r(t,"zIsUp",!0),w=r(t,"isOrtho",!!e&&e.dirtyCache[11]),E=r(t,"colors",[16777215]),b=r(t,"alphas",[1]),S=r(t,"tile",!1),A=r(t,"flipY",!1),_=r(t,"width",null),C={faces:[],verts:[]};if(h.set(p,v,g),l.set(m,y,x),u.fromRotationXYTranslation(l,h,T),!i&&e)i=e.texture;else{if(!e||"string"!=typeof i)return C;i=e.scene.sys.textures.get(i)}var R=i.get(n);!_&&w&&i&&e&&(a=R.width/e.height,c=R.height/e.height);var M,P,O=a/2,L=c/2,F=Math.floor(d),D=Math.floor(f),k=F+1,I=D+1,B=a/F,N=c/D,Y=[],X=[],U=0,z=1,G=0,W=1;R&&(U=R.u0,z=R.u1,A?(G=R.v1,W=R.v0):(G=R.v0,W=R.v1));var V=z-U,H=W-G;for(P=0;P{var s=i(18693),r=i(16650),n=i(70015),a=i(85769),o=new n,h=new n,l=new r;t.exports=function(t,e,i,r,n,u,c,d,f,p){void 0===i&&(i=1),void 0===r&&(r=0),void 0===n&&(n=0),void 0===u&&(u=0),void 0===c&&(c=0),void 0===d&&(d=0),void 0===f&&(f=0),void 0===p&&(p=!0);var v={faces:[],verts:[]},g=t.materials;o.set(r,n,u),h.set(c,d,f),l.fromRotationXYTranslation(h,o,p);for(var m=0;m{var s=i(18693),r=i(85769);t.exports=function(t,e,i,n,a,o,h){if(void 0===n&&(n=!1),void 0===o&&(o=16777215),void 0===h&&(h=1),t.length===e.length){var l,u,c,d,f,p,v,g,m,y,x,T={faces:[],vertices:[]},w=n?3:2,E=Array.isArray(o),b=Array.isArray(h);if(Array.isArray(i)&&i.length>0)for(l=0;l{var e=!0,i="untitled",s="",r="";function n(t){var e=t.indexOf("#");return e>-1?t.substring(0,e):t}function a(t){return 0===t.models.length&&t.models.push({faces:[],name:i,textureCoords:[],vertexNormals:[],vertices:[]}),s="",t.models[t.models.length-1]}function o(t,e){var r=t.length>=2?t[1]:i;e.models.push({faces:[],name:r,textureCoords:[],vertexNormals:[],vertices:[]}),s=""}function h(t){2===t.length&&(s=t[1])}function l(t,e){var i=t.length,s=i>=2?parseFloat(t[1]):0,r=i>=3?parseFloat(t[2]):0,n=i>=4?parseFloat(t[3]):0;a(e).vertices.push({x:s,y:r,z:n})}function u(t,i){var s=t.length,r=s>=2?parseFloat(t[1]):0,n=s>=3?parseFloat(t[2]):0,o=s>=4?parseFloat(t[3]):0;isNaN(r)&&(r=0),isNaN(n)&&(n=0),isNaN(o)&&(o=0),e&&(n=1-n),a(i).textureCoords.push({u:r,v:n,w:o})}function c(t,e){var i=t.length,s=i>=2?parseFloat(t[1]):0,r=i>=3?parseFloat(t[2]):0,n=i>=4?parseFloat(t[3]):0;a(e).vertexNormals.push({x:s,y:r,z:n})}function d(t,e){var i=t.length-1;if(!(i<3)){for(var n={group:s,material:r,vertices:[]},o=0;o3)){var u=0,c=0,d=0;u=parseInt(h[0],10),l>1&&""!==h[1]&&(c=parseInt(h[1],10)),l>2&&(d=parseInt(h[2],10)),0!==u&&(u<0&&(u=a(e).vertices.length+1+u),c-=1,u-=1,d-=1,n.vertices.push({textureCoordsIndex:c,vertexIndex:u,vertexNormalIndex:d}))}}a(e).faces.push(n)}}function f(t,e){t.length>=2&&e.materialLibraries.push(t[1])}function p(t){t.length>=2&&(r=t[1])}t.exports=function(t,i){void 0===i&&(i=!0),e=i;var a={materials:{},materialLibraries:[],models:[]};s="",r="";for(var v=t.split("\n"),g=0;g{var s=i(22946);t.exports=function(t){for(var e={},i=t.split("\n"),r="",n=0;n=2?Math.floor(255*o[2]):h,u=o.length>=3?Math.floor(255*o[3]):h;e[r]=s(h,l,u)}}}return e}},15313:t=>{t.exports=function(t,e,i,s){var r,n;if(void 0===i&&void 0===s){var a=t.getInCenter();r=a.x,n=a.y}var o=Math.cos(e),h=Math.sin(e),l=t.vertex1,u=t.vertex2,c=t.vertex3,d=l.x-r,f=l.y-n;l.set(d*o-f*h+r,d*h+f*o+n),d=u.x-r,f=u.y-n,u.set(d*o-f*h+r,d*h+f*o+n),d=c.x-r,f=c.y-n,c.set(d*o-f*h+r,d*h+f*o+n)}},85769:(t,e,i)=>{var s=i(56694),r=i(75512),n=i(70015),a=new s({Extends:n,initialize:function(t,e,i,s,r,a,o,h,l,u){void 0===a&&(a=16777215),void 0===o&&(o=1),void 0===h&&(h=0),void 0===l&&(l=0),void 0===u&&(u=0),n.call(this,t,e,i),this.vx=0,this.vy=0,this.vz=0,this.nx=h,this.ny=l,this.nz=u,this.u=s,this.v=r,this.color=a,this.alpha=o,this.tx=0,this.ty=0,this.ta=0},setUVs:function(t,e){return this.u=t,this.v=e,this},transformCoordinatesLocal:function(t,e,i,s){var r=this.x,n=this.y,a=this.z,o=t.val,h=r*o[0]+n*o[4]+a*o[8]+o[12],l=r*o[1]+n*o[5]+a*o[9]+o[13],u=r*o[2]+n*o[6]+a*o[10]+o[14],c=r*o[3]+n*o[7]+a*o[11]+o[15];this.vx=h/c*e,this.vy=-l/c*i,this.vz=s<=0?u/c:-u/c},update:function(t,e,i,s,r,n,a,o){var h=this.vx*t+this.vy*i+r,l=this.vx*e+this.vy*s+n;return a&&(h=Math.round(h),l=Math.round(l)),this.tx=h,this.ty=l,this.ta=this.alpha*o,this},load:function(t,e,i,s,n){return t[++i]=this.tx,t[++i]=this.ty,t[++i]=this.u,t[++i]=this.v,t[++i]=s,t[++i]=n,e[++i]=r.getTintAppendFloatAlpha(this.color,this.ta),i}});t.exports=a},14293:(t,e,i)=>{var s={Face:i(18693),GenerateGridVerts:i(99425),GenerateObjVerts:i(53267),GenerateVerts:i(67623),ParseObj:i(27291),ParseObjMaterial:i(76799),RotateFace:i(15313),Vertex:i(85769)};t.exports=s},77601:t=>{t.exports=function(t){return t.setTo(Math.ceil(t.x),Math.ceil(t.y))}},38933:(t,e,i)=>{var s=i(79967);t.exports=function(t){return new s(t.x,t.y)}},47103:t=>{t.exports=function(t,e){return e.setTo(t.x,t.y)}},13625:t=>{t.exports=function(t,e){return t.x===e.x&&t.y===e.y}},12536:t=>{t.exports=function(t){return t.setTo(Math.floor(t.x),Math.floor(t.y))}},54205:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){if(void 0===e&&(e=new s),!Array.isArray(t))throw new Error("GetCentroid points argument must be an array");var i=t.length;if(i<1)throw new Error("GetCentroid points array must not be empty");if(1===i)e.x=t[0].x,e.y=t[0].y;else{for(var r=0;r{t.exports=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)}},82712:t=>{t.exports=function(t){return t.x*t.x+t.y*t.y}},20052:(t,e,i)=>{var s=i(74118);t.exports=function(t,e){void 0===e&&(e=new s);for(var i=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,o=0;oi&&(i=h.x),h.xn&&(n=h.y),h.y{var s=i(79967);t.exports=function(t,e,i,r){return void 0===i&&(i=0),void 0===r&&(r=new s),r.x=t.x+(e.x-t.x)*i,r.y=t.y+(e.y-t.y)*i,r}},42397:t=>{t.exports=function(t){return t.setTo(t.y,t.x)}},59464:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.setTo(-t.x,-t.y)}},79967:(t,e,i)=>{var s=i(56694),r=i(52394),n=new s({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.type=r.POINT,this.x=t,this.y=e},setTo:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this}});t.exports=n},53581:(t,e,i)=>{var s=i(79967),r=i(82712);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=(t.x*e.x+t.y*e.y)/r(e);return 0!==n&&(i.x=n*e.x,i.y=n*e.y),i}},50817:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new s);var r=t.x*e.x+t.y*e.y;return 0!==r&&(i.x=r*e.x,i.y=r*e.y),i}},40525:(t,e,i)=>{var s=i(50083);t.exports=function(t,e){if(0!==t.x||0!==t.y){var i=s(t);t.x/=i,t.y/=i}return t.x*=e,t.y*=e,t}},63472:(t,e,i)=>{var s=i(79967);s.Ceil=i(77601),s.Clone=i(38933),s.CopyFrom=i(47103),s.Equals=i(13625),s.Floor=i(12536),s.GetCentroid=i(54205),s.GetMagnitude=i(50083),s.GetMagnitudeSq=i(82712),s.GetRectangleFromPoints=i(20052),s.Interpolate=i(77154),s.Invert=i(42397),s.Negative=i(59464),s.Project=i(53581),s.ProjectUnit=i(50817),s.SetMagnitude=i(40525),t.exports=s},19631:(t,e,i)=>{var s=i(8580);t.exports=function(t){return new s(t.points)}},45604:t=>{t.exports=function(t,e,i){for(var s=!1,r=-1,n=t.points.length-1;++r{var s=i(45604);t.exports=function(t,e){return s(t,e.x,e.y)}},11117:t=>{"use strict";function e(t,e,n){n=n||2;var a,o,h,c,d,p,v,g=e&&e.length,m=g?e[0]*n:t.length,y=i(t,0,m,n,!0),x=[];if(!y||y.next===y.prev)return x;if(g&&(y=function(t,e,r,n){var a,o,h,c=[];for(a=0,o=e.length;a80*n){a=h=t[0],o=c=t[1];for(var T=n;Th&&(h=d),p>c&&(c=p);v=0!==(v=Math.max(h-a,c-o))?1/v:0}return r(y,x,n,a,o,v),x}function i(t,e,i,s,r){var n,a;if(r===_(t,e,i,s)>0)for(n=e;n=e;n-=s)a=b(n,t[n],t[n+1],a);return a&&m(a,a.next)&&(S(a),a=a.next),a}function s(t,e){if(!t)return t;e||(e=t);var i,s=t;do{if(i=!1,s.steiner||!m(s,s.next)&&0!==g(s.prev,s,s.next))s=s.next;else{if(S(s),(s=e=s.prev)===s.next)break;i=!0}}while(i||s!==e);return e}function r(t,e,i,l,u,c,f){if(t){!f&&c&&function(t,e,i,s){var r=t;do{null===r.z&&(r.z=d(r.x,r.y,e,i,s)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,i,s,r,n,a,o,h,l=1;do{for(i=t,t=null,n=null,a=0;i;){for(a++,s=i,o=0,e=0;e0||h>0&&s;)0!==o&&(0===h||!s||i.z<=s.z)?(r=i,i=i.nextZ,o--):(r=s,s=s.nextZ,h--),n?n.nextZ=r:t=r,r.prevZ=n,n=r;i=s}n.nextZ=null,l*=2}while(a>1)}(r)}(t,l,u,c);for(var p,v,g=t;t.prev!==t.next;)if(p=t.prev,v=t.next,c?a(t,l,u,c):n(t))e.push(p.i/i),e.push(t.i/i),e.push(v.i/i),S(t),t=v.next,g=v.next;else if((t=v)===g){f?1===f?r(t=o(s(t),e,i),e,i,l,u,c,2):2===f&&h(t,e,i,l,u,c):r(s(t),e,i,l,u,c,1);break}}}function n(t){var e=t.prev,i=t,s=t.next;if(g(e,i,s)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(p(e.x,e.y,i.x,i.y,s.x,s.y,r.x,r.y)&&g(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function a(t,e,i,s){var r=t.prev,n=t,a=t.next;if(g(r,n,a)>=0)return!1;for(var o=r.xn.x?r.x>a.x?r.x:a.x:n.x>a.x?n.x:a.x,u=r.y>n.y?r.y>a.y?r.y:a.y:n.y>a.y?n.y:a.y,c=d(o,h,e,i,s),f=d(l,u,e,i,s),v=t.prevZ,m=t.nextZ;v&&v.z>=c&&m&&m.z<=f;){if(v!==t.prev&&v!==t.next&&p(r.x,r.y,n.x,n.y,a.x,a.y,v.x,v.y)&&g(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,m!==t.prev&&m!==t.next&&p(r.x,r.y,n.x,n.y,a.x,a.y,m.x,m.y)&&g(m.prev,m,m.next)>=0)return!1;m=m.nextZ}for(;v&&v.z>=c;){if(v!==t.prev&&v!==t.next&&p(r.x,r.y,n.x,n.y,a.x,a.y,v.x,v.y)&&g(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;m&&m.z<=f;){if(m!==t.prev&&m!==t.next&&p(r.x,r.y,n.x,n.y,a.x,a.y,m.x,m.y)&&g(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function o(t,e,i){var r=t;do{var n=r.prev,a=r.next.next;!m(n,a)&&y(n,r,r.next,a)&&w(n,a)&&w(a,n)&&(e.push(n.i/i),e.push(r.i/i),e.push(a.i/i),S(r),S(r.next),r=t=a),r=r.next}while(r!==t);return s(r)}function h(t,e,i,n,a,o){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&v(h,l)){var u=E(h,l);return h=s(h,h.next),u=s(u,u.next),r(h,e,i,n,a,o),void r(u,e,i,n,a,o)}l=l.next}h=h.next}while(h!==t)}function l(t,e){return t.x-e.x}function u(t,e){if(e=function(t,e){var i,s=e,r=t.x,n=t.y,a=-1/0;do{if(n<=s.y&&n>=s.next.y&&s.next.y!==s.y){var o=s.x+(n-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(o<=r&&o>a){if(a=o,o===r){if(n===s.y)return s;if(n===s.next.y)return s.next}i=s.x=s.x&&s.x>=u&&r!==s.x&&p(ni.x||s.x===i.x&&c(i,s)))&&(i=s,f=h)),s=s.next}while(s!==l);return i}(t,e),e){var i=E(e,t);s(e,e.next),s(i,i.next)}}function c(t,e){return g(t.prev,t,e.prev)<0&&g(e.next,t,t.next)<0}function d(t,e,i,s,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-s)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){var e=t,i=t;do{(e.x=0&&(t-a)*(s-o)-(i-a)*(e-o)>=0&&(i-a)*(n-o)-(r-a)*(s-o)>=0}function v(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&y(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(w(t,e)&&w(e,t)&&function(t,e){var i=t,s=!1,r=(t.x+e.x)/2,n=(t.y+e.y)/2;do{i.y>n!=i.next.y>n&&i.next.y!==i.y&&r<(i.next.x-i.x)*(n-i.y)/(i.next.y-i.y)+i.x&&(s=!s),i=i.next}while(i!==t);return s}(t,e)&&(g(t.prev,t,e.prev)||g(t,e.prev,e))||m(t,e)&&g(t.prev,t,t.next)>0&&g(e.prev,e,e.next)>0)}function g(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function m(t,e){return t.x===e.x&&t.y===e.y}function y(t,e,i,s){var r=T(g(t,e,i)),n=T(g(t,e,s)),a=T(g(i,s,t)),o=T(g(i,s,e));return r!==n&&a!==o||(!(0!==r||!x(t,i,e))||(!(0!==n||!x(t,s,e))||(!(0!==a||!x(i,t,s))||!(0!==o||!x(i,e,s)))))}function x(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function T(t){return t>0?1:t<0?-1:0}function w(t,e){return g(t.prev,t,t.next)<0?g(t,e,t.next)>=0&&g(t,t.prev,e)>=0:g(t,e,t.prev)<0||g(t,t.next,e)<0}function E(t,e){var i=new A(t.i,t.x,t.y),s=new A(e.i,e.x,e.y),r=t.next,n=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,s.next=i,i.prev=s,n.next=s,s.prev=n,s}function b(t,e,i,s){var r=new A(t,e,i);return s?(r.next=s.next,r.prev=s,s.next.prev=r,s.next=r):(r.prev=r,r.next=r),r}function S(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function A(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function _(t,e,i,s){for(var r=0,n=e,a=i-s;n0&&(s+=t[r-1].length,i.holes.push(s))}return i},t.exports=e},14045:(t,e,i)=>{var s=i(74118);t.exports=function(t,e){void 0===e&&(e=new s);for(var i,r=1/0,n=1/0,a=-r,o=-n,h=0;h{t.exports=function(t,e){void 0===e&&(e=[]);for(var i=0;i{var s=i(16028),r=i(88829),n=i(5159);t.exports=function(t,e,i,a){void 0===a&&(a=[]);var o=t.points,h=n(t);!e&&i>0&&(e=h/i);for(var l=0;lc+g)){var m=v.getPoint((u-c)/g);a.push(m);break}c+=g}return a}},5159:(t,e,i)=>{var s=i(16028),r=i(88829);t.exports=function(t){for(var e=t.points,i=0,n=0;n{var s=i(56694),r=i(45604),n=i(89294),a=i(52394),o=new s({initialize:function(t){this.type=a.POLYGON,this.area=0,this.points=[],t&&this.setTo(t)},contains:function(t,e){return r(this,t,e)},setTo:function(t){if(this.area=0,this.points=[],"string"==typeof t&&(t=t.split(" ")),!Array.isArray(t))return this;for(var e,i=Number.MAX_VALUE,s=0;s{t.exports=function(t){return t.points.reverse(),t}},95874:t=>{function e(t,e,i){var s=e.x,r=e.y,n=i.x-s,a=i.y-r;if(0!==n||0!==a){var o=((t.x-s)*n+(t.y-r)*a)/(n*n+a*a);o>1?(s=i.x,r=i.y):o>0&&(s+=n*o,r+=a*o)}return(n=t.x-s)*n+(a=t.y-r)*a}function i(t,s,r,n,a){for(var o,h=n,l=s+1;lh&&(o=l,h=u)}h>n&&(o-s>1&&i(t,s,o,n,a),a.push(t[o]),r-o>1&&i(t,o,r,n,a))}function s(t,e){var s=t.length-1,r=[t[0]];return i(t,0,s,e,r),r.push(t[s]),r}t.exports=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=!1);var r=t.points;if(r.length>2){var n=e*e;i||(r=function(t,e){for(var i,s,r,n,a,o=t[0],h=[o],l=1,u=t.length;le&&(h.push(i),o=i);return o!==i&&h.push(i),h}(r,n)),t.setTo(s(r,n))}return t}},18974:t=>{var e=function(t,e){return t[0]=e[0],t[1]=e[1],t};t.exports=function(t){var i,s=[],r=t.points;for(i=0;i0&&n.push(e([0,0],s[0])),i=0;i1&&n.push(e([0,0],s[s.length-1])),t.setTo(n)}},23490:t=>{t.exports=function(t,e,i){for(var s=t.points,r=0;r{var s=i(8580);s.Clone=i(19631),s.Contains=i(45604),s.ContainsPoint=i(87289),s.Earcut=i(11117),s.GetAABB=i(14045),s.GetNumberArray=i(98286),s.GetPoints=i(89294),s.Perimeter=i(5159),s.Reverse=i(32244),s.Simplify=i(95874),s.Smooth=i(18974),s.Translate=i(23490),t.exports=s},1653:t=>{t.exports=function(t){return t.width*t.height}},33943:t=>{t.exports=function(t){return t.x=Math.ceil(t.x),t.y=Math.ceil(t.y),t}},58662:t=>{t.exports=function(t){return t.x=Math.ceil(t.x),t.y=Math.ceil(t.y),t.width=Math.ceil(t.width),t.height=Math.ceil(t.height),t}},79993:t=>{t.exports=function(t,e,i){return t.x=e-t.width/2,t.y=i-t.height/2,t}},81572:(t,e,i)=>{var s=i(74118);t.exports=function(t){return new s(t.x,t.y,t.width,t.height)}},94287:t=>{t.exports=function(t,e,i){return!(t.width<=0||t.height<=0)&&(t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i)}},28687:(t,e,i)=>{var s=i(94287);t.exports=function(t,e){return s(t,e.x,e.y)}},73222:t=>{t.exports=function(t,e){return!(e.width*e.height>t.width*t.height)&&(e.x>t.x&&e.xt.x&&e.rightt.y&&e.yt.y&&e.bottom{t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},87279:t=>{t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x,y:t.y}),e.push({x:t.right,y:t.y}),e.push({x:t.right,y:t.bottom}),e.push({x:t.x,y:t.bottom}),e}},19989:t=>{t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},92628:(t,e,i)=>{var s=i(6700);t.exports=function(t,e){var i=s(t);return i{var s=i(6700);t.exports=function(t,e){var i=s(t);return i>s(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},71356:t=>{t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t}},21687:t=>{t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height),t}},80222:(t,e,i)=>{var s=i(74118),r=i(83392);t.exports=function(t,e){if(void 0===e&&(e=new s),0===t.length)return e;for(var i,n,a,o=Number.MAX_VALUE,h=Number.MAX_VALUE,l=r.MIN_SAFE_INTEGER,u=r.MIN_SAFE_INTEGER,c=0;c{var s=i(74118);t.exports=function(t,e,i,r,n){return void 0===n&&(n=new s),n.setTo(Math.min(t,i),Math.min(e,r),Math.abs(t-i),Math.abs(e-r))}},6700:t=>{t.exports=function(t){return 0===t.height?NaN:t.width/t.height}},35242:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.centerX,e.y=t.centerY,e}},47698:(t,e,i)=>{var s=i(85876),r=i(79967);t.exports=function(t,e,i){if(void 0===i&&(i=new r),e<=0||e>=1)return i.x=t.x,i.y=t.y,i;var n=s(t)*e;return e>.5?(n-=t.width+t.height)<=t.width?(i.x=t.right-n,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(n-t.width)):n<=t.width?(i.x=t.x+n,i.y=t.y):(i.x=t.right,i.y=t.y+(n-t.width)),i}},54932:(t,e,i)=>{var s=i(47698),r=i(85876);t.exports=function(t,e,i,n){void 0===n&&(n=[]),!e&&i>0&&(e=r(t)/i);for(var a=0;a{var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.width,e.y=t.height,e}},7782:(t,e,i)=>{var s=i(79993);t.exports=function(t,e,i){var r=t.centerX,n=t.centerY;return t.setSize(t.width+2*e,t.height+2*i),s(t,r,n)}},66217:(t,e,i)=>{var s=i(74118),r=i(90205);t.exports=function(t,e,i){return void 0===i&&(i=new s),r(t,e)?(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y):i.setEmpty(),i}},40053:(t,e,i)=>{var s=i(85876),r=i(79967);t.exports=function(t,e,i,n){if(void 0===n&&(n=[]),!e&&!i)return n;e?i=Math.round(s(t)/e):e=s(t)/i;for(var a=t.x,o=t.y,h=0,l=0;l=t.right&&(h=1,o+=a-t.right,a=t.right);break;case 1:(o+=e)>=t.bottom&&(h=2,a-=o-t.bottom,o=t.bottom);break;case 2:(a-=e)<=t.left&&(h=3,o-=t.left-a,a=t.left);break;case 3:(o-=e)<=t.top&&(h=0,o=t.top)}return n}},86673:t=>{t.exports=function(t,e){for(var i=t.x,s=t.right,r=t.y,n=t.bottom,a=0;a{t.exports=function(t,e){var i=Math.min(t.x,e.x),s=Math.max(t.right,e.right);t.x=i,t.width=s-i;var r=Math.min(t.y,e.y),n=Math.max(t.bottom,e.bottom);return t.y=r,t.height=n-r,t}},44755:t=>{t.exports=function(t,e,i){var s=Math.min(t.x,e),r=Math.max(t.right,e);t.x=s,t.width=r-s;var n=Math.min(t.y,i),a=Math.max(t.bottom,i);return t.y=n,t.height=a-n,t}},74466:t=>{t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},55946:t=>{t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},97474:t=>{t.exports=function(t,e){return t.xe.x&&t.ye.y}},85876:t=>{t.exports=function(t){return 2*(t.width+t.height)}},20243:(t,e,i)=>{var s=i(79967),r=i(75606);t.exports=function(t,e,i){void 0===i&&(i=new s),e=r(e);var n=Math.sin(e),a=Math.cos(e),o=a>0?t.width/2:t.width/-2,h=n>0?t.height/2:t.height/-2;return Math.abs(o*n){var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.x+Math.random()*t.width,e.y=t.y+Math.random()*t.height,e}},97691:(t,e,i)=>{var s=i(17489),r=i(73222),n=i(79967);t.exports=function(t,e,i){if(void 0===i&&(i=new n),r(t,e))switch(s(0,3)){case 0:i.x=t.x+Math.random()*(e.right-t.x),i.y=t.y+Math.random()*(e.top-t.y);break;case 1:i.x=e.x+Math.random()*(t.right-e.x),i.y=e.bottom+Math.random()*(t.bottom-e.bottom);break;case 2:i.x=t.x+Math.random()*(e.x-t.x),i.y=e.y+Math.random()*(t.bottom-e.y);break;case 3:i.x=e.right+Math.random()*(t.right-e.right),i.y=t.y+Math.random()*(e.bottom-t.y)}return i}},74118:(t,e,i)=>{var s=i(56694),r=i(94287),n=i(47698),a=i(54932),o=i(52394),h=i(88829),l=i(30001),u=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.type=o.RECTANGLE,this.x=t,this.y=e,this.width=i,this.height=s},contains:function(t,e){return r(this,t,e)},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.y,this.right,this.y),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.y,this.right,this.bottom),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.bottom,this.x,this.bottom),t},getLineD:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.bottom,this.x,this.y),t},left:{get:function(){return this.x},set:function(t){t>=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=u},51828:t=>{t.exports=function(t,e){return t.width===e.width&&t.height===e.height}},5691:t=>{t.exports=function(t,e,i){return void 0===i&&(i=e),t.width*=e,t.height*=i,t}},58795:(t,e,i)=>{var s=i(74118);t.exports=function(t,e,i){void 0===i&&(i=new s);var r=Math.min(t.x,e.x),n=Math.min(t.y,e.y),a=Math.max(t.right,e.right)-r,o=Math.max(t.bottom,e.bottom)-n;return i.setTo(r,n,a,o)}},66658:(t,e,i)=>{var s=i(74118);s.Area=i(1653),s.Ceil=i(33943),s.CeilAll=i(58662),s.CenterOn=i(79993),s.Clone=i(81572),s.Contains=i(94287),s.ContainsPoint=i(28687),s.ContainsRect=i(73222),s.CopyFrom=i(29538),s.Decompose=i(87279),s.Equals=i(19989),s.FitInside=i(92628),s.FitOutside=i(85028),s.Floor=i(71356),s.FloorAll=i(21687),s.FromPoints=i(80222),s.FromXY=i(75785),s.GetAspectRatio=i(6700),s.GetCenter=i(35242),s.GetPoint=i(47698),s.GetPoints=i(54932),s.GetSize=i(31591),s.Inflate=i(7782),s.Intersection=i(66217),s.MarchingAnts=i(40053),s.MergePoints=i(86673),s.MergeRect=i(14655),s.MergeXY=i(44755),s.Offset=i(74466),s.OffsetPoint=i(55946),s.Overlaps=i(97474),s.Perimeter=i(85876),s.PerimeterPoint=i(20243),s.Random=i(30001),s.RandomOutside=i(97691),s.SameDimensions=i(51828),s.Scale=i(5691),s.Union=i(58795),t.exports=s},19108:t=>{t.exports=function(t){var e=t.x1,i=t.y1,s=t.x2,r=t.y2,n=t.x3,a=t.y3;return Math.abs(((n-e)*(r-i)-(s-e)*(a-i))/2)}},41199:(t,e,i)=>{var s=i(66349);t.exports=function(t,e,i){var r=i*(Math.sqrt(3)/2);return new s(t,e,t+i/2,e+r,t-i/2,e+r)}},88730:(t,e,i)=>{var s=i(11117),r=i(66349);t.exports=function(t,e,i,n,a){void 0===e&&(e=null),void 0===i&&(i=1),void 0===n&&(n=1),void 0===a&&(a=[]);for(var o,h,l,u,c,d,f,p,v,g=s(t,e),m=0;m{var s=i(66349);t.exports=function(t,e,i,r){return void 0===r&&(r=i),new s(t,e,t,e-r,t+i,e)}},1882:(t,e,i)=>{var s=i(56595),r=i(9640);t.exports=function(t,e,i,n){void 0===n&&(n=s);var a=n(t),o=e-a.x,h=i-a.y;return r(t,o,h)}},56595:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=(t.x1+t.x2+t.x3)/3,e.y=(t.y1+t.y2+t.y3)/3,e}},91835:(t,e,i)=>{var s=i(93736);function r(t,e,i,s){return t*s-e*i}t.exports=function(t,e){void 0===e&&(e=new s);var i=t.x3,n=t.y3,a=t.x1-i,o=t.y1-n,h=t.x2-i,l=t.y2-n,u=2*r(a,o,h,l),c=r(o,a*a+o*o,l,h*h+l*l),d=r(a,a*a+o*o,h,h*h+l*l);return e.x=i-c/u,e.y=n+d/u,e}},97073:(t,e,i)=>{var s=i(26673);t.exports=function(t,e){void 0===e&&(e=new s);var i,r,n=t.x1,a=t.y1,o=t.x2,h=t.y2,l=t.x3,u=t.y3,c=o-n,d=h-a,f=l-n,p=u-a,v=c*(n+o)+d*(a+h),g=f*(n+l)+p*(a+u),m=2*(c*(u-h)-d*(l-o));if(Math.abs(m)<1e-6){var y=Math.min(n,o,l),x=Math.min(a,h,u);i=.5*(Math.max(n,o,l)-y),r=.5*(Math.max(a,h,u)-x),e.x=y+i,e.y=x+r,e.radius=Math.sqrt(i*i+r*r)}else e.x=(p*v-d*g)/m,e.y=(c*g-f*v)/m,i=e.x-n,r=e.y-a,e.radius=Math.sqrt(i*i+r*r);return e}},75974:(t,e,i)=>{var s=i(66349);t.exports=function(t){return new s(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}},60689:t=>{t.exports=function(t,e,i){var s=t.x3-t.x1,r=t.y3-t.y1,n=t.x2-t.x1,a=t.y2-t.y1,o=e-t.x1,h=i-t.y1,l=s*s+r*r,u=s*n+r*a,c=s*o+r*h,d=n*n+a*a,f=n*o+a*h,p=l*d-u*u,v=0===p?0:1/p,g=(d*c-u*f)*v,m=(l*f-u*c)*v;return g>=0&&m>=0&&g+m<1}},86875:t=>{t.exports=function(t,e,i,s){void 0===i&&(i=!1),void 0===s&&(s=[]);for(var r,n,a,o,h,l,u=t.x3-t.x1,c=t.y3-t.y1,d=t.x2-t.x1,f=t.y2-t.y1,p=u*u+c*c,v=u*d+c*f,g=d*d+f*f,m=p*g-v*v,y=0===m?0:1/m,x=t.x1,T=t.y1,w=0;w=0&&n>=0&&r+n<1&&(s.push({x:e[w].x,y:e[w].y}),i)));w++);return s}},51532:(t,e,i)=>{var s=i(60689);t.exports=function(t,e){return s(t,e.x,e.y)}},42538:t=>{t.exports=function(t,e){return e.setTo(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}},18680:t=>{t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x1,y:t.y1}),e.push({x:t.x2,y:t.y2}),e.push({x:t.x3,y:t.y3}),e}},29977:t=>{t.exports=function(t,e){return t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2&&t.x3===e.x3&&t.y3===e.y3}},56088:(t,e,i)=>{var s=i(79967),r=i(16028);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=t.getLineA(),a=t.getLineB(),o=t.getLineC();if(e<=0||e>=1)return i.x=n.x1,i.y=n.y1,i;var h=r(n),l=r(a),u=r(o),c=(h+l+u)*e,d=0;return ch+l?(d=(c-=h+l)/u,i.x=o.x1+(o.x2-o.x1)*d,i.y=o.y1+(o.y2-o.y1)*d):(d=(c-=h)/l,i.x=a.x1+(a.x2-a.x1)*d,i.y=a.y1+(a.y2-a.y1)*d),i}},24402:(t,e,i)=>{var s=i(16028),r=i(79967);t.exports=function(t,e,i,n){void 0===n&&(n=[]);var a=t.getLineA(),o=t.getLineB(),h=t.getLineC(),l=s(a),u=s(o),c=s(h),d=l+u+c;!e&&i>0&&(e=d/i);for(var f=0;fl+u?(v=(p-=l+u)/c,g.x=h.x1+(h.x2-h.x1)*v,g.y=h.y1+(h.y2-h.y1)*v):(v=(p-=l)/u,g.x=o.x1+(o.x2-o.x1)*v,g.y=o.y1+(o.y2-o.y1)*v),n.push(g)}return n}},83648:(t,e,i)=>{var s=i(79967);function r(t,e,i,s){var r=t-i,n=e-s,a=r*r+n*n;return Math.sqrt(a)}t.exports=function(t,e){void 0===e&&(e=new s);var i=t.x1,n=t.y1,a=t.x2,o=t.y2,h=t.x3,l=t.y3,u=r(h,l,a,o),c=r(i,n,h,l),d=r(a,o,i,n),f=u+c+d;return e.x=(i*u+a*c+h*d)/f,e.y=(n*u+o*c+l*d)/f,e}},9640:t=>{t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t.x3+=e,t.y3+=i,t}},95290:(t,e,i)=>{var s=i(16028);t.exports=function(t){var e=t.getLineA(),i=t.getLineB(),r=t.getLineC();return s(e)+s(i)+s(r)}},99761:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){void 0===e&&(e=new s);var i=t.x2-t.x1,r=t.y2-t.y1,n=t.x3-t.x1,a=t.y3-t.y1,o=Math.random(),h=Math.random();return o+h>=1&&(o=1-o,h=1-h),e.x=t.x1+(i*o+n*h),e.y=t.y1+(r*o+a*h),e}},21934:(t,e,i)=>{var s=i(19211),r=i(83648);t.exports=function(t,e){var i=r(t);return s(t,i.x,i.y,e)}},68454:(t,e,i)=>{var s=i(19211);t.exports=function(t,e,i){return s(t,e.x,e.y,i)}},19211:t=>{t.exports=function(t,e,i,s){var r=Math.cos(s),n=Math.sin(s),a=t.x1-e,o=t.y1-i;return t.x1=a*r-o*n+e,t.y1=a*n+o*r+i,a=t.x2-e,o=t.y2-i,t.x2=a*r-o*n+e,t.y2=a*n+o*r+i,a=t.x3-e,o=t.y3-i,t.x3=a*r-o*n+e,t.y3=a*n+o*r+i,t}},66349:(t,e,i)=>{var s=i(56694),r=i(60689),n=i(56088),a=i(24402),o=i(52394),h=i(88829),l=i(99761),u=new s({initialize:function(t,e,i,s,r,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===r&&(r=0),void 0===n&&(n=0),this.type=o.TRIANGLE,this.x1=t,this.y1=e,this.x2=i,this.y2=s,this.x3=r,this.y3=n},contains:function(t,e){return r(this,t,e)},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,s,r,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===r&&(r=0),void 0===n&&(n=0),this.x1=t,this.y1=e,this.x2=i,this.y2=s,this.x3=r,this.y3=n,this},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x1,this.y1,this.x2,this.y2),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.x2,this.y2,this.x3,this.y3),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.x3,this.y3,this.x1,this.y1),t},left:{get:function(){return Math.min(this.x1,this.x2,this.x3)},set:function(t){var e=0;e=this.x1<=this.x2&&this.x1<=this.x3?this.x1-t:this.x2<=this.x1&&this.x2<=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},right:{get:function(){return Math.max(this.x1,this.x2,this.x3)},set:function(t){var e=0;e=this.x1>=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=u},87619:(t,e,i)=>{var s=i(66349);s.Area=i(19108),s.BuildEquilateral=i(41199),s.BuildFromPolygon=i(88730),s.BuildRight=i(3635),s.CenterOn=i(1882),s.Centroid=i(56595),s.CircumCenter=i(91835),s.CircumCircle=i(97073),s.Clone=i(75974),s.Contains=i(60689),s.ContainsArray=i(86875),s.ContainsPoint=i(51532),s.CopyFrom=i(42538),s.Decompose=i(18680),s.Equals=i(29977),s.GetPoint=i(56088),s.GetPoints=i(24402),s.InCenter=i(83648),s.Perimeter=i(95290),s.Offset=i(9640),s.Random=i(99761),s.Rotate=i(21934),s.RotateAroundPoint=i(68454),s.RotateAroundXY=i(19211),t.exports=s},27395:t=>{t.exports=function(t,e,i){return{gameObject:t,enabled:!0,alwaysEnabled:!1,draggable:!1,dropZone:!1,cursor:!1,target:null,camera:null,hitArea:e,hitAreaCallback:i,hitAreaDebug:null,customHitArea:!1,localX:0,localY:0,dragState:0,dragStartX:0,dragStartY:0,dragStartXGlobal:0,dragStartYGlobal:0,dragX:0,dragY:0}}},18104:t=>{t.exports=function(t,e){return function(i,s,r,n){var a=t.getPixelAlpha(s,r,n.texture.key,n.frame.name);return a&&a>=e}}},69898:(t,e,i)=>{var s=i(56694),r=i(72687),n=i(6659),a=i(33963),o=i(97081),h=i(71064),l=i(7905),u=i(40398),c=i(37579),d=i(69360),f=i(64462),p=new s({initialize:function(t,e){this.game=t,this.scaleManager,this.canvas,this.config=e,this.enabled=!0,this.events=new n,this.isOver=!0,this.defaultCursor="",this.keyboard=e.inputKeyboard?new h(this):null,this.mouse=e.inputMouse?new l(this):null,this.touch=e.inputTouch?new c(this):null,this.pointers=[],this.pointersTotal=e.inputActivePointers,e.inputTouch&&1===this.pointersTotal&&(this.pointersTotal=2);for(var i=0;i<=this.pointersTotal;i++){var s=new u(this,i);s.smoothFactor=e.inputSmoothFactor,this.pointers.push(s)}this.mousePointer=e.inputMouse?this.pointers[0]:null,this.activePointer=this.pointers[0],this.globalTopOnly=!0,this.time=0,this._tempPoint={x:0,y:0},this._tempHitTest=[],this._tempMatrix=new d,this._tempMatrix2=new d,this._tempSkip=!1,this.mousePointerContainer=[this.mousePointer],t.events.once(o.BOOT,this.boot,this)},boot:function(){this.canvas=this.game.canvas,this.scaleManager=this.game.scale,this.events.emit(a.MANAGER_BOOT),this.game.events.on(o.PRE_RENDER,this.preRender,this),this.game.events.once(o.DESTROY,this.destroy,this)},setCanvasOver:function(t){this.isOver=!0,this.events.emit(a.GAME_OVER,t)},setCanvasOut:function(t){this.isOver=!1,this.events.emit(a.GAME_OUT,t)},preRender:function(){var t=this.game.loop.now,e=this.game.loop.delta,i=this.game.scene.getScenes(!0,!0);this.time=t,this.events.emit(a.MANAGER_UPDATE);for(var s=0;s10&&(t=10-this.pointersTotal);for(var i=0;i{var s=i(26673),r=i(65650),n=i(56694),a=i(72687),o=i(27395),h=i(18104),l=i(53996),u=i(95669),c=i(72313),d=i(33963),f=i(6659),p=i(72632),v=i(52394),g=i(63399),m=i(42911),y=i(91963),x=i(74118),T=i(94287),w=i(7599),E=i(66349),b=i(60689),S=new n({Extends:f,initialize:function(t){f.call(this),this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.manager=t.sys.game.input,this.pluginEvents=new f,this.enabled=!0,this.displayList,this.cameras,g.install(this),this.mouse=this.manager.mouse,this.topOnly=!0,this.pollRate=-1,this._pollTimer=0;var e={cancelled:!1};this._eventContainer={stopPropagation:function(){e.cancelled=!0}},this._eventData=e,this.dragDistanceThreshold=0,this.dragTimeThreshold=0,this._temp=[],this._tempZones=[],this._list=[],this._pendingInsertion=[],this._pendingRemoval=[],this._draggable=[],this._drag={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._dragState=[],this._over={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._validTypes=["onDown","onUp","onOver","onOut","onMove","onDragStart","onDrag","onDragEnd","onDragEnter","onDragLeave","onDragOver","onDrop"],this._updatedThisFrame=!1,t.sys.events.once(w.BOOT,this.boot,this),t.sys.events.on(w.START,this.start,this)},boot:function(){this.cameras=this.systems.cameras,this.displayList=this.systems.displayList,this.systems.events.once(w.DESTROY,this.destroy,this),this.pluginEvents.emit(d.BOOT)},start:function(){var t=this.systems.events;t.on(w.TRANSITION_START,this.transitionIn,this),t.on(w.TRANSITION_OUT,this.transitionOut,this),t.on(w.TRANSITION_COMPLETE,this.transitionComplete,this),t.on(w.PRE_UPDATE,this.preUpdate,this),t.once(w.SHUTDOWN,this.shutdown,this),this.manager.events.on(d.GAME_OUT,this.onGameOut,this),this.manager.events.on(d.GAME_OVER,this.onGameOver,this),this.enabled=!0,this._dragState=[0,0,0,0,0,0,0,0,0,0],this.pluginEvents.emit(d.START)},onGameOver:function(t){this.isActive()&&this.emit(d.GAME_OVER,t.timeStamp,t)},onGameOut:function(t){this.isActive()&&this.emit(d.GAME_OUT,t.timeStamp,t)},preUpdate:function(){this.pluginEvents.emit(d.PRE_UPDATE);var t=this._pendingRemoval,e=this._pendingInsertion,i=t.length,s=e.length;if(0!==i||0!==s){for(var r=this._list,n=0;n-1&&(r.splice(o,1),this.clear(a,!0))}t.length=0,this._pendingRemoval.length=0,this._list=r.concat(e.splice(0))}},isActive:function(){return this.enabled&&this.scene.sys.isActive()},updatePoll:function(t,e){if(!this.isActive())return!1;if(this.pluginEvents.emit(d.UPDATE,t,e),this._updatedThisFrame)return this._updatedThisFrame=!1,!1;var i,s=this.manager,r=s.pointers,n=s.pointersTotal;for(i=0;i0){if(this._pollTimer-=e,!(this._pollTimer<0))return!1;this._pollTimer=this.pollRate}var o=!1;for(i=0;i0&&(o=!0)}return o},update:function(t,e){if(!this.isActive())return!1;for(var i=e.length,s=!1,r=0;r0&&(s=!0)}return this._updatedThisFrame=!0,s},clear:function(t,e){void 0===e&&(e=!1);var i=t.input;if(i){e||this.queueForRemoval(t),i.gameObject=void 0,i.target=void 0,i.hitArea=void 0,i.hitAreaCallback=void 0,i.callbackContext=void 0,t.input=null;var s=this._draggable.indexOf(t);return s>-1&&this._draggable.splice(s,1),(s=this._drag[0].indexOf(t))>-1&&this._drag[0].splice(s,1),(s=this._over[0].indexOf(t))>-1&&(this._over[0].splice(s,1),this.manager.resetCursor(i)),t}},disable:function(t){t.input.enabled=!1},enable:function(t,e,i,s){return void 0===s&&(s=!1),t.input?t.input.enabled=!0:this.setHitArea(t,e,i),t.input&&s&&!t.input.dropZone&&(t.input.dropZone=s),this},hitTestPointer:function(t){for(var e=this.cameras.getCamerasBelowPointer(t),i=0;i0)return t.camera=s,r}return t.camera=e[0],[]},processDownEvents:function(t){var e=0,i=this._temp,s=this._eventData,r=this._eventContainer;s.cancelled=!1;for(var n=!1,a=0;a0&&l(t.x,t.y,t.downX,t.downY)>=r||s>0&&e>=t.downTime+s)&&(i=!0),i)return this.setDragState(t,3),this.processDragStartList(t)},processDragStartList:function(t){if(3!==this.getDragState(t))return 0;for(var e=this._drag[t.id],i=0;i1&&(this.sortGameObjects(i,t),this.topOnly&&i.splice(1)),this._drag[t.id]=i,0===this.dragDistanceThreshold&&0===this.dragTimeThreshold?(this.setDragState(t,3),this.processDragStartList(t)):(this.setDragState(t,2),0))},processDragMoveEvent:function(t){if(2===this.getDragState(t)&&this.processDragThresholdEvent(t,this.manager.game.loop.now),4!==this.getDragState(t))return 0;for(var e=this._tempZones,i=this._drag[t.id],s=0;s0?(a.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,a,h),o.target=e[0],h=o.target,a.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,a,h)):(a.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,a,h),e[0]?(o.target=e[0],h=o.target,a.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,a,h)):o.target=null)}else!h&&e[0]&&(o.target=e[0],h=o.target,a.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,a,h));if(a.parentContainer){var u=t.worldX-o.dragStartXGlobal,c=t.worldY-o.dragStartYGlobal,f=a.getParentRotation(),p=u*Math.cos(f)+c*Math.sin(f),v=c*Math.cos(f)-u*Math.sin(f);p*=1/a.parentContainer.scaleX,v*=1/a.parentContainer.scaleY,r=p+o.dragStartX,n=v+o.dragStartY}else r=t.worldX-o.dragX,n=t.worldY-o.dragY;a.emit(d.GAMEOBJECT_DRAG,t,r,n),this.emit(d.DRAG,t,a,r,n)}return i.length},processDragUpEvent:function(t){for(var e=this._drag[t.id],i=0;i0){var n=this.manager,a=this._eventData,o=this._eventContainer;a.cancelled=!1;for(var h=!1,l=0;l0){var r=this.manager,n=this._eventData,a=this._eventContainer;n.cancelled=!1;var o=!1;this.sortGameObjects(e,t);for(var h=0;h0){for(this.sortGameObjects(r,t),e=0;e0){for(this.sortGameObjects(n,t),e=0;e-1&&this._draggable.splice(r,1)}return this},makePixelPerfect:function(t){void 0===t&&(t=1);var e=this.systems.textures;return h(e,t)},setHitArea:function(t,e,i){if(void 0===e)return this.setHitAreaFromTexture(t);Array.isArray(t)||(t=[t]);var s=!1,r=!1,n=!1,a=!1,h=!1,l=!0;if(m(e)){var u=e;e=p(u,"hitArea",null),i=p(u,"hitAreaCallback",null),s=p(u,"draggable",!1),r=p(u,"dropZone",!1),n=p(u,"cursor",!1),a=p(u,"useHandCursor",!1),h=p(u,"pixelPerfect",!1);var c=p(u,"alphaTolerance",1);h&&(e={},i=this.makePixelPerfect(c)),e&&i||(this.setHitAreaFromTexture(t),l=!1)}else"function"!=typeof e||i||(i=e,e={});for(var d=0;d{var s=i(10850),r={},n={register:function(t,e,i,s,n){r[t]={plugin:e,mapping:i,settingsKey:s,configKey:n}},getPlugin:function(t){return r[t]},install:function(t){var e=t.scene.sys,i=e.settings.input,n=e.game.config;for(var a in r){var o=r[a].plugin,h=r[a].mapping,l=r[a].settingsKey,u=r[a].configKey;s(i,l,n[u])&&(t[h]=new o(t))}},remove:function(t){r.hasOwnProperty(t)&&delete r[t]}};t.exports=n},40398:(t,e,i)=>{var s=i(90447),r=i(56694),n=i(53996),a=i(88456),o=i(44521),h=i(93736),l=i(36580),u=new r({initialize:function(t,e){this.manager=t,this.id=e,this.event,this.downElement,this.upElement,this.camera=null,this.button=0,this.buttons=0,this.position=new h,this.prevPosition=new h,this.midPoint=new h(-1,-1),this.velocity=new h,this.angle=0,this.distance=0,this.smoothFactor=0,this.motionFactor=.2,this.worldX=0,this.worldY=0,this.moveTime=0,this.downX=0,this.downY=0,this.downTime=0,this.upX=0,this.upY=0,this.upTime=0,this.primaryDown=!1,this.isDown=!1,this.wasTouch=!1,this.wasCanceled=!1,this.movementX=0,this.movementY=0,this.identifier=0,this.pointerId=null,this.active=0===e,this.locked=!1,this.deltaX=0,this.deltaY=0,this.deltaZ=0},updateWorldPoint:function(t){var e=t.getWorldPoint(this.x,this.y);return this.worldX=e.x,this.worldY=e.y,this},positionToCamera:function(t,e){return t.getWorldPoint(this.x,this.y,e)},updateMotion:function(){var t=this.position.x,e=this.position.y,i=this.midPoint.x,r=this.midPoint.y;if(t!==i||e!==r){var n=o(this.motionFactor,i,t),h=o(this.motionFactor,r,e);a(n,t,.1)&&(n=t),a(h,e,.1)&&(h=e),this.midPoint.set(n,h);var l=t-n,u=e-h;this.velocity.set(l,u),this.angle=s(n,h,t,e),this.distance=Math.sqrt(l*l+u*u)}},up:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!1,this.upX=this.x,this.upY=this.y),0===this.buttons&&(this.isDown=!1,this.upTime=t.timeStamp,this.wasTouch=!1)},down:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!0,this.downX=this.x,this.downY=this.y),l.macOS&&t.ctrlKey&&(this.buttons=2,this.primaryDown=!1),this.isDown||(this.isDown=!0,this.downTime=t.timeStamp),this.wasTouch=!1},move:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.locked&&(this.movementX=t.movementX||t.mozMovementX||t.webkitMovementX||0,this.movementY=t.movementY||t.mozMovementY||t.webkitMovementY||0),this.moveTime=t.timeStamp,this.wasTouch=!1},wheel:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.deltaX=t.deltaX,this.deltaY=t.deltaY,this.deltaZ=t.deltaZ,this.wasTouch=!1},touchstart:function(t,e){t.pointerId&&(this.pointerId=t.pointerId),this.identifier=t.identifier,this.target=t.target,this.active=!0,this.buttons=1,this.event=e,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=e.timeStamp,this.isDown=!0,this.wasTouch=!0,this.wasCanceled=!1,this.updateMotion()},touchmove:function(t,e){this.event=e,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.moveTime=e.timeStamp,this.wasTouch=!0,this.updateMotion()},touchend:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!1,this.active=!1,this.updateMotion()},touchcancel:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!0,this.active=!1},noButtonDown:function(){return 0===this.buttons},leftButtonDown:function(){return!!(1&this.buttons)},rightButtonDown:function(){return!!(2&this.buttons)},middleButtonDown:function(){return!!(4&this.buttons)},backButtonDown:function(){return!!(8&this.buttons)},forwardButtonDown:function(){return!!(16&this.buttons)},leftButtonReleased:function(){return 0===this.button&&!this.isDown},rightButtonReleased:function(){return 2===this.button&&!this.isDown},middleButtonReleased:function(){return 1===this.button&&!this.isDown},backButtonReleased:function(){return 3===this.button&&!this.isDown},forwardButtonReleased:function(){return 4===this.button&&!this.isDown},getDistance:function(){return this.isDown?n(this.downX,this.downY,this.x,this.y):n(this.downX,this.downY,this.upX,this.upY)},getDistanceX:function(){return this.isDown?Math.abs(this.downX-this.x):Math.abs(this.downX-this.upX)},getDistanceY:function(){return this.isDown?Math.abs(this.downY-this.y):Math.abs(this.downY-this.upY)},getDuration:function(){return this.isDown?this.manager.time-this.downTime:this.upTime-this.downTime},getAngle:function(){return this.isDown?s(this.downX,this.downY,this.x,this.y):s(this.downX,this.downY,this.upX,this.upY)},getInterpolatedPosition:function(t,e){void 0===t&&(t=10),void 0===e&&(e=[]);for(var i=this.prevPosition.x,s=this.prevPosition.y,r=this.position.x,n=this.position.y,a=0;a{t.exports={MOUSE_DOWN:0,MOUSE_MOVE:1,MOUSE_UP:2,TOUCH_START:3,TOUCH_MOVE:4,TOUCH_END:5,POINTER_LOCK_CHANGE:6,TOUCH_CANCEL:7,MOUSE_WHEEL:8}},14874:t=>{t.exports="boot"},54168:t=>{t.exports="destroy"},526:t=>{t.exports="dragend"},81623:t=>{t.exports="dragenter"},94472:t=>{t.exports="drag"},9304:t=>{t.exports="dragleave"},34265:t=>{t.exports="dragover"},50151:t=>{t.exports="dragstart"},98134:t=>{t.exports="drop"},56773:t=>{t.exports="gameobjectdown"},45824:t=>{t.exports="dragend"},39578:t=>{t.exports="dragenter"},72072:t=>{t.exports="drag"},82569:t=>{t.exports="dragleave"},70833:t=>{t.exports="dragover"},81442:t=>{t.exports="dragstart"},32936:t=>{t.exports="drop"},99658:t=>{t.exports="gameobjectmove"},60515:t=>{t.exports="gameobjectout"},55254:t=>{t.exports="gameobjectover"},34782:t=>{t.exports="pointerdown"},41769:t=>{t.exports="pointermove"},65588:t=>{t.exports="pointerout"},61640:t=>{t.exports="pointerover"},49342:t=>{t.exports="pointerup"},82662:t=>{t.exports="wheel"},13058:t=>{t.exports="gameobjectup"},52426:t=>{t.exports="gameobjectwheel"},78072:t=>{t.exports="gameout"},1545:t=>{t.exports="gameover"},67137:t=>{t.exports="boot"},27678:t=>{t.exports="process"},22257:t=>{t.exports="update"},90379:t=>{t.exports="pointerlockchange"},88909:t=>{t.exports="pointerdown"},36548:t=>{t.exports="pointerdownoutside"},18483:t=>{t.exports="pointermove"},22355:t=>{t.exports="pointerout"},7997:t=>{t.exports="pointerover"},66318:t=>{t.exports="pointerup"},94812:t=>{t.exports="pointerupoutside"},37310:t=>{t.exports="wheel"},24196:t=>{t.exports="preupdate"},27053:t=>{t.exports="shutdown"},29413:t=>{t.exports="start"},25165:t=>{t.exports="update"},33963:(t,e,i)=>{t.exports={BOOT:i(14874),DESTROY:i(54168),DRAG_END:i(526),DRAG_ENTER:i(81623),DRAG:i(94472),DRAG_LEAVE:i(9304),DRAG_OVER:i(34265),DRAG_START:i(50151),DROP:i(98134),GAME_OUT:i(78072),GAME_OVER:i(1545),GAMEOBJECT_DOWN:i(56773),GAMEOBJECT_DRAG_END:i(45824),GAMEOBJECT_DRAG_ENTER:i(39578),GAMEOBJECT_DRAG:i(72072),GAMEOBJECT_DRAG_LEAVE:i(82569),GAMEOBJECT_DRAG_OVER:i(70833),GAMEOBJECT_DRAG_START:i(81442),GAMEOBJECT_DROP:i(32936),GAMEOBJECT_MOVE:i(99658),GAMEOBJECT_OUT:i(60515),GAMEOBJECT_OVER:i(55254),GAMEOBJECT_POINTER_DOWN:i(34782),GAMEOBJECT_POINTER_MOVE:i(41769),GAMEOBJECT_POINTER_OUT:i(65588),GAMEOBJECT_POINTER_OVER:i(61640),GAMEOBJECT_POINTER_UP:i(49342),GAMEOBJECT_POINTER_WHEEL:i(82662),GAMEOBJECT_UP:i(13058),GAMEOBJECT_WHEEL:i(52426),MANAGER_BOOT:i(67137),MANAGER_PROCESS:i(27678),MANAGER_UPDATE:i(22257),POINTER_DOWN:i(88909),POINTER_DOWN_OUTSIDE:i(36548),POINTER_MOVE:i(18483),POINTER_OUT:i(22355),POINTER_OVER:i(7997),POINTER_UP:i(66318),POINTER_UP_OUTSIDE:i(94812),POINTER_WHEEL:i(37310),POINTERLOCK_CHANGE:i(90379),PRE_UPDATE:i(24196),SHUTDOWN:i(27053),START:i(29413),UPDATE:i(25165)}},70848:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e){this.pad=t,this.events=t.events,this.index=e,this.value=0,this.threshold=.1},update:function(t){this.value=t},getValue:function(){return Math.abs(this.value){var s=i(56694),r=i(43200),n=new s({initialize:function(t,e){this.pad=t,this.events=t.manager,this.index=e,this.value=0,this.threshold=1,this.pressed=!1},update:function(t){this.value=t;var e=this.pad,i=this.index;t>=this.threshold?this.pressed||(this.pressed=!0,this.events.emit(r.BUTTON_DOWN,e,this,t),this.pad.emit(r.GAMEPAD_BUTTON_DOWN,i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit(r.BUTTON_UP,e,this,t),this.pad.emit(r.GAMEPAD_BUTTON_UP,i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=n},75956:(t,e,i)=>{var s=i(70848),r=i(21274),n=i(56694),a=i(6659),o=i(93736),h=new n({Extends:a,initialize:function(t,e){a.call(this),this.manager=t,this.pad=e,this.id=e.id,this.index=e.index;for(var i=[],n=0;n=2&&(this.leftStick.set(n[0].getValue(),n[1].getValue()),r>=4&&this.rightStick.set(n[2].getValue(),n[3].getValue()))}},destroy:function(){var t;for(this.removeAllListeners(),this.manager=null,this.pad=null,t=0;t{var s=i(56694),r=i(6659),n=i(43200),a=i(75956),o=i(10850),h=i(63399),l=i(33963),u=new s({Extends:r,initialize:function(t){r.call(this),this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.enabled=!0,this.target,this.gamepads=[],this.queue=[],this.onGamepadHandler,this._pad1,this._pad2,this._pad3,this._pad4,t.pluginEvents.once(l.BOOT,this.boot,this),t.pluginEvents.on(l.START,this.start,this)},boot:function(){var t=this.scene.sys.game,e=this.settings.input,i=t.config;this.enabled=o(e,"gamepad",i.inputGamepad)&&t.device.input.gamepads,this.target=o(e,"gamepad.target",i.inputGamepadEventTarget),this.sceneInputPlugin.pluginEvents.once(l.DESTROY,this.destroy,this)},start:function(){this.enabled&&(this.startListeners(),this.refreshPads()),this.sceneInputPlugin.pluginEvents.once(l.SHUTDOWN,this.shutdown,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},startListeners:function(){var t=this,e=this.target,i=function(e){!e.defaultPrevented&&t.isActive()&&(t.refreshPads(),t.queue.push(e))};this.onGamepadHandler=i,e.addEventListener("gamepadconnected",i,!1),e.addEventListener("gamepaddisconnected",i,!1),this.sceneInputPlugin.pluginEvents.on(l.UPDATE,this.update,this)},stopListeners:function(){this.target.removeEventListener("gamepadconnected",this.onGamepadHandler),this.target.removeEventListener("gamepaddisconnected",this.onGamepadHandler),this.sceneInputPlugin.pluginEvents.off(l.UPDATE,this.update);for(var t=0;t{t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,SELECT:8,START:9,B:0,A:1,Y:2,X:3,LEFT_SHOULDER:4,RIGHT_SHOULDER:5}},74982:t=>{t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,SHARE:8,OPTIONS:9,PS:16,TOUCHBAR:17,X:0,CIRCLE:1,SQUARE:2,TRIANGLE:3,L1:4,R1:5,L2:6,R2:7,L3:10,R3:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}},43247:t=>{t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,MENU:16,A:0,B:1,X:2,Y:3,LB:4,RB:5,LT:6,RT:7,BACK:8,START:9,LS:10,RS:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}},4898:(t,e,i)=>{t.exports={DUALSHOCK_4:i(74982),SNES_USB:i(33171),XBOX_360:i(43247)}},17344:t=>{t.exports="down"},36635:t=>{t.exports="up"},85724:t=>{t.exports="connected"},55832:t=>{t.exports="disconnected"},772:t=>{t.exports="down"},33608:t=>{t.exports="up"},43200:(t,e,i)=>{t.exports={BUTTON_DOWN:i(17344),BUTTON_UP:i(36635),CONNECTED:i(85724),DISCONNECTED:i(55832),GAMEPAD_BUTTON_DOWN:i(772),GAMEPAD_BUTTON_UP:i(33608)}},92636:(t,e,i)=>{t.exports={Axis:i(70848),Button:i(21274),Events:i(43200),Gamepad:i(75956),GamepadPlugin:i(1379),Configs:i(4898)}},20873:(t,e,i)=>{var s=i(72687),r=i(98611),n={CreatePixelPerfectHandler:i(18104),CreateInteractiveObject:i(27395),Events:i(33963),Gamepad:i(92636),InputManager:i(69898),InputPlugin:i(12499),InputPluginCache:i(63399),Keyboard:i(28388),Mouse:i(11343),Pointer:i(40398),Touch:i(77423)};n=r(!1,n,s),t.exports=n},71064:(t,e,i)=>{var s=i(66458),r=i(56694),n=i(97081),a=i(33963),o=i(11873),h=i(72283),l=new r({initialize:function(t){this.manager=t,this.queue=[],this.preventDefault=!0,this.captures=[],this.enabled=!1,this.target,this.onKeyDown=h,this.onKeyUp=h,t.events.once(a.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputKeyboard,this.target=t.inputKeyboardEventTarget,this.addCapture(t.inputKeyboardCapture),!this.target&&window&&(this.target=window),this.enabled&&this.target&&this.startListeners(),this.manager.game.events.on(n.POST_STEP,this.postUpdate,this)},startListeners:function(){var t=this;this.onKeyDown=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.events.emit(a.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}},this.onKeyUp=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.events.emit(a.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}};var e=this.target;e&&(e.addEventListener("keydown",this.onKeyDown,!1),e.addEventListener("keyup",this.onKeyUp,!1),this.enabled=!0)},stopListeners:function(){var t=this.target;t.removeEventListener("keydown",this.onKeyDown,!1),t.removeEventListener("keyup",this.onKeyUp,!1),this.enabled=!1},postUpdate:function(){this.queue=[]},addCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},removeCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},clearCaptures:function(){this.captures=[],this.preventDefault=!1},destroy:function(){this.stopListeners(),this.clearCaptures(),this.queue=[],this.manager.game.events.off(n.POST_RENDER,this.postUpdate,this),this.target=null,this.enabled=!1,this.manager=null}});t.exports=l},89666:(t,e,i)=>{var s=i(56694),r=i(6659),n=i(94030),a=i(97081),o=i(10850),h=i(33963),l=i(63399),u=i(50165),c=i(11873),d=i(95625),f=i(48044),p=i(7599),v=i(84314),g=new s({Extends:r,initialize:function(t){r.call(this),this.game=t.systems.game,this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.manager=t.manager.keyboard,this.enabled=!0,this.keys=[],this.combos=[],this.prevCode=null,this.prevTime=0,this.prevType=null,t.pluginEvents.once(h.BOOT,this.boot,this),t.pluginEvents.on(h.START,this.start,this)},boot:function(){var t=this.settings.input;this.enabled=o(t,"keyboard",!0);var e=o(t,"keyboard.capture",null);e&&this.addCaptures(e),this.sceneInputPlugin.pluginEvents.once(h.DESTROY,this.destroy,this)},start:function(){this.sceneInputPlugin.manager.events.on(h.MANAGER_PROCESS,this.update,this),this.sceneInputPlugin.pluginEvents.once(h.SHUTDOWN,this.shutdown,this),this.game.events.on(a.BLUR,this.resetKeys,this),this.scene.sys.events.on(p.PAUSE,this.resetKeys,this),this.scene.sys.events.on(p.SLEEP,this.resetKeys,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},addCapture:function(t){return this.manager.addCapture(t),this},removeCapture:function(t){return this.manager.removeCapture(t),this},getCaptures:function(){return this.manager.captures},enableGlobalCapture:function(){return this.manager.preventDefault=!0,this},disableGlobalCapture:function(){return this.manager.preventDefault=!1,this},clearCaptures:function(){return this.manager.clearCaptures(),this},createCursorKeys:function(){return this.addKeys({up:c.UP,down:c.DOWN,left:c.LEFT,right:c.RIGHT,space:c.SPACE,shift:c.SHIFT})},addKeys:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1);var s={};if("string"==typeof t){t=t.split(",");for(var r=0;r-1?s[r]=t:s[t.keyCode]=t,e&&this.addCapture(t.keyCode),t.setEmitOnRepeat(i),t}return"string"==typeof t&&(t=c[t.toUpperCase()]),s[t]||(s[t]=new u(this,t),e&&this.addCapture(t),s[t].setEmitOnRepeat(i)),s[t]},removeKey:function(t,e){void 0===e&&(e=!1);var i,s=this.keys;if(t instanceof u){var r=s.indexOf(t);r>-1&&(i=this.keys[r],this.keys[r]=void 0)}else"string"==typeof t&&(t=c[t.toUpperCase()]);return s[t]&&(i=s[t],s[t]=void 0),i&&(i.plugin=null,e&&i.destroy()),this},removeAllKeys:function(t){for(var e=this.keys,i=0;it._tick)return t._tick=i,!0}return!1},update:function(){var t=this.manager.queue,e=t.length;if(this.isActive()&&0!==e)for(var i=this.keys,s=0;s{t.exports=function(t,e){return e.timeLastMatched=t.timeStamp,e.index++,e.index===e.size||(e.current=e.keyCodes[e.index],!1)}},95625:(t,e,i)=>{var s=i(56694),r=i(94030),n=i(72632),a=i(2544),o=i(88754),h=new s({initialize:function(t,e,i){if(void 0===i&&(i={}),e.length<2)return!1;this.manager=t,this.enabled=!0,this.keyCodes=[];for(var s=0;s{var s=i(60258);t.exports=function(t,e){if(e.matched)return!0;var i=!1,r=!1;if(t.keyCode===e.current)if(e.index>0&&e.maxKeyDelay>0){var n=e.timeLastMatched+e.maxKeyDelay;t.timeStamp<=n&&(r=!0,i=s(t,e))}else r=!0,i=s(t,e);return!r&&e.resetOnWrongKey&&(e.index=0,e.current=e.keyCodes[0]),i&&(e.timeLastMatched=t.timeStamp,e.matched=!0,e.timeMatched=t.timeStamp),i}},88754:t=>{t.exports=function(t){return t.current=t.keyCodes[0],t.index=0,t.timeLastMatched=0,t.matched=!1,t.timeMatched=0,t}},5044:t=>{t.exports="keydown"},40813:t=>{t.exports="keyup"},89319:t=>{t.exports="keycombomatch"},76362:t=>{t.exports="down"},78595:t=>{t.exports="keydown-"},30056:t=>{t.exports="keyup-"},81939:t=>{t.exports="up"},94030:(t,e,i)=>{t.exports={ANY_KEY_DOWN:i(5044),ANY_KEY_UP:i(40813),COMBO_MATCH:i(89319),DOWN:i(76362),KEY_DOWN:i(78595),KEY_UP:i(30056),UP:i(81939)}},28388:(t,e,i)=>{t.exports={Events:i(94030),KeyboardManager:i(71064),KeyboardPlugin:i(89666),Key:i(50165),KeyCodes:i(11873),KeyCombo:i(95625),AdvanceKeyCombo:i(60258),ProcessKeyCombo:i(2544),ResetKeyCombo:i(88754),JustDown:i(42460),JustUp:i(53162),DownDuration:i(64964),UpDuration:i(70331)}},64964:t=>{t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeDown;return t.isDown&&i{t.exports=function(t){return!!t._justDown&&(t._justDown=!1,!0)}},53162:t=>{t.exports=function(t){return!!t._justUp&&(t._justUp=!1,!0)}},50165:(t,e,i)=>{var s=i(56694),r=i(6659),n=i(94030),a=new s({Extends:r,initialize:function(t,e){r.call(this),this.plugin=t,this.keyCode=e,this.originalEvent=void 0,this.enabled=!0,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.metaKey=!1,this.location=0,this.timeDown=0,this.duration=0,this.timeUp=0,this.emitOnRepeat=!1,this.repeats=0,this._justDown=!1,this._justUp=!1,this._tick=-1},setEmitOnRepeat:function(t){return this.emitOnRepeat=t,this},onDown:function(t){this.originalEvent=t,this.enabled&&(this.altKey=t.altKey,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.metaKey=t.metaKey,this.location=t.location,this.repeats++,this.isDown?this.emitOnRepeat&&this.emit(n.DOWN,this,t):(this.isDown=!0,this.isUp=!1,this.timeDown=t.timeStamp,this.duration=0,this._justDown=!0,this._justUp=!1,this.emit(n.DOWN,this,t)))},onUp:function(t){this.originalEvent=t,this.enabled&&(this.isDown=!1,this.isUp=!0,this.timeUp=t.timeStamp,this.duration=this.timeUp-this.timeDown,this.repeats=0,this._justDown=!1,this._justUp=!0,this._tick=-1,this.emit(n.UP,this,t))},reset:function(){return this.preventDefault=!0,this.enabled=!0,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.metaKey=!1,this.timeDown=0,this.duration=0,this.timeUp=0,this.repeats=0,this._justDown=!1,this._justUp=!1,this._tick=-1,this},getDuration:function(){return this.isDown?this.plugin.game.loop.time-this.timeDown:0},destroy:function(){this.removeAllListeners(),this.originalEvent=null,this.plugin=null}});t.exports=a},11873:t=>{t.exports={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:42,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,NUMPAD_ZERO:96,NUMPAD_ONE:97,NUMPAD_TWO:98,NUMPAD_THREE:99,NUMPAD_FOUR:100,NUMPAD_FIVE:101,NUMPAD_SIX:102,NUMPAD_SEVEN:103,NUMPAD_EIGHT:104,NUMPAD_NINE:105,NUMPAD_ADD:107,NUMPAD_SUBTRACT:109,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,SEMICOLON:186,PLUS:187,COMMA:188,MINUS:189,PERIOD:190,FORWARD_SLASH:191,BACK_SLASH:220,QUOTES:222,BACKTICK:192,OPEN_BRACKET:219,CLOSED_BRACKET:221,SEMICOLON_FIREFOX:59,COLON:58,COMMA_FIREFOX_WINDOWS:60,COMMA_FIREFOX:62,BRACKET_RIGHT_FIREFOX:174,BRACKET_LEFT_FIREFOX:175}},48044:(t,e,i)=>{var s=i(11873),r={};for(var n in s)r[s[n]]=n;t.exports=r},70331:t=>{t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeUp;return t.isUp&&i{var s=i(56694),r=i(90185),n=i(33963),a=i(72283),o=new s({initialize:function(t){this.manager=t,this.preventDefaultDown=!0,this.preventDefaultUp=!0,this.preventDefaultMove=!0,this.preventDefaultWheel=!1,this.enabled=!1,this.target,this.locked=!1,this.onMouseMove=a,this.onMouseDown=a,this.onMouseUp=a,this.onMouseDownWindow=a,this.onMouseUpWindow=a,this.onMouseOver=a,this.onMouseOut=a,this.onMouseWheel=a,this.pointerLockChange=a,this.isTop=!0,t.events.once(n.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputMouse,this.target=t.inputMouseEventTarget,this.passive=t.inputMousePassive,this.preventDefaultDown=t.inputMousePreventDefaultDown,this.preventDefaultUp=t.inputMousePreventDefaultUp,this.preventDefaultMove=t.inputMousePreventDefaultMove,this.preventDefaultWheel=t.inputMousePreventDefaultWheel,this.target?"string"==typeof this.target&&(this.target=document.getElementById(this.target)):this.target=this.manager.game.canvas,t.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return document.body.addEventListener("contextmenu",(function(t){return t.preventDefault(),!1})),this},requestPointerLock:function(){if(r.pointerLock){var t=this.target;t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock||t.webkitRequestPointerLock,t.requestPointerLock()}},releasePointerLock:function(){r.pointerLock&&(document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,document.exitPointerLock())},startListeners:function(){var t=this.target;if(t){var e=this,i=this.manager,s=i.canvas,n=window&&window.focus&&i.game.config.autoFocus;this.onMouseMove=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onMouseMove(t),e.preventDefaultMove&&t.preventDefault())},this.onMouseDown=function(t){n&&window.focus(),!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onMouseDown(t),e.preventDefaultDown&&t.target===s&&t.preventDefault())},this.onMouseDownWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==s&&i.onMouseDown(t)},this.onMouseUp=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onMouseUp(t),e.preventDefaultUp&&t.target===s&&t.preventDefault())},this.onMouseUpWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==s&&i.onMouseUp(t)},this.onMouseOver=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.setCanvasOver(t)},this.onMouseOut=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.setCanvasOut(t)},this.onMouseWheel=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.onMouseWheel(t),e.preventDefaultWheel&&t.target===s&&t.preventDefault()};var a={passive:!0};if(t.addEventListener("mousemove",this.onMouseMove),t.addEventListener("mousedown",this.onMouseDown),t.addEventListener("mouseup",this.onMouseUp),t.addEventListener("mouseover",this.onMouseOver,a),t.addEventListener("mouseout",this.onMouseOut,a),this.preventDefaultWheel?t.addEventListener("wheel",this.onMouseWheel,{passive:!1}):t.addEventListener("wheel",this.onMouseWheel,a),window&&i.game.config.inputWindowEvents)try{window.top.addEventListener("mousedown",this.onMouseDownWindow,a),window.top.addEventListener("mouseup",this.onMouseUpWindow,a)}catch(t){window.addEventListener("mousedown",this.onMouseDownWindow,a),window.addEventListener("mouseup",this.onMouseUpWindow,a),this.isTop=!1}r.pointerLock&&(this.pointerLockChange=function(t){var s=e.target;e.locked=document.pointerLockElement===s||document.mozPointerLockElement===s||document.webkitPointerLockElement===s,i.onPointerLockChange(t)},document.addEventListener("pointerlockchange",this.pointerLockChange,!0),document.addEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.addEventListener("webkitpointerlockchange",this.pointerLockChange,!0)),this.enabled=!0}},stopListeners:function(){var t=this.target;t.removeEventListener("mousemove",this.onMouseMove),t.removeEventListener("mousedown",this.onMouseDown),t.removeEventListener("mouseup",this.onMouseUp),t.removeEventListener("mouseover",this.onMouseOver),t.removeEventListener("mouseout",this.onMouseOut),window&&((t=this.isTop?window.top:window).removeEventListener("mousedown",this.onMouseDownWindow),t.removeEventListener("mouseup",this.onMouseUpWindow)),r.pointerLock&&(document.removeEventListener("pointerlockchange",this.pointerLockChange,!0),document.removeEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.removeEventListener("webkitpointerlockchange",this.pointerLockChange,!0))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});t.exports=o},11343:(t,e,i)=>{t.exports={MouseManager:i(7905)}},37579:(t,e,i)=>{var s=i(56694),r=i(33963),n=i(72283),a=new s({initialize:function(t){this.manager=t,this.capture=!0,this.enabled=!1,this.target,this.onTouchStart=n,this.onTouchStartWindow=n,this.onTouchMove=n,this.onTouchEnd=n,this.onTouchEndWindow=n,this.onTouchCancel=n,this.onTouchCancelWindow=n,this.onTouchOver=n,this.onTouchOut=n,t.events.once(r.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputTouch,this.target=t.inputTouchEventTarget,this.capture=t.inputTouchCapture,this.target||(this.target=this.manager.game.canvas),t.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return document.body.addEventListener("contextmenu",(function(t){return t.preventDefault(),!1})),this},startListeners:function(){var t=this,e=this.manager.canvas,i=window&&window.focus&&this.manager.game.config.autoFocus;this.onTouchStart=function(s){i&&window.focus(),!s.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onTouchStart(s),t.capture&&s.cancelable&&s.target===e&&s.preventDefault())},this.onTouchStartWindow=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&i.target!==e&&t.manager.onTouchStart(i)},this.onTouchMove=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onTouchMove(e),t.capture&&e.cancelable&&e.preventDefault())},this.onTouchEnd=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onTouchEnd(i),t.capture&&i.cancelable&&i.target===e&&i.preventDefault())},this.onTouchEndWindow=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&i.target!==e&&t.manager.onTouchEnd(i)},this.onTouchCancel=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onTouchCancel(e),t.capture&&e.preventDefault())},this.onTouchCancelWindow=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.onTouchCancel(e)},this.onTouchOver=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.setCanvasOver(e)},this.onTouchOut=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.setCanvasOut(e)};var s=this.target;if(s){var r={passive:!0},n={passive:!1};s.addEventListener("touchstart",this.onTouchStart,this.capture?n:r),s.addEventListener("touchmove",this.onTouchMove,this.capture?n:r),s.addEventListener("touchend",this.onTouchEnd,this.capture?n:r),s.addEventListener("touchcancel",this.onTouchCancel,this.capture?n:r),s.addEventListener("touchover",this.onTouchOver,this.capture?n:r),s.addEventListener("touchout",this.onTouchOut,this.capture?n:r),window&&this.manager.game.config.inputWindowEvents&&(window.addEventListener("touchstart",this.onTouchStartWindow,n),window.addEventListener("touchend",this.onTouchEndWindow,n),window.addEventListener("touchcancel",this.onTouchCancelWindow,n)),this.enabled=!0}},stopListeners:function(){var t=this.target;t.removeEventListener("touchstart",this.onTouchStart),t.removeEventListener("touchmove",this.onTouchMove),t.removeEventListener("touchend",this.onTouchEnd),t.removeEventListener("touchcancel",this.onTouchCancel),t.removeEventListener("touchover",this.onTouchOver),t.removeEventListener("touchout",this.onTouchOut),window&&(window.removeEventListener("touchstart",this.onTouchStartWindow),window.removeEventListener("touchend",this.onTouchEndWindow))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});t.exports=a},77423:(t,e,i)=>{t.exports={TouchManager:i(37579)}},98035:(t,e,i)=>{var s=i(56694),r=i(12117),n=i(683),a=i(72632),o=i(30750),h=i(43531),l=i(88490),u=i(33868),c=new s({initialize:function(t,e){this.loader=t,this.cache=a(e,"cache",!1),this.type=a(e,"type",!1),this.key=a(e,"key",!1);var i=this.key;if(t.prefix&&""!==t.prefix&&(this.key=t.prefix+i),!this.type||!this.key)throw new Error("Invalid Loader."+this.type+" key");var s=a(e,"url");void 0===s?s=t.path+i+"."+a(e,"extension",""):"string"!=typeof s||s.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)||(s=t.path+s),this.url=s,this.src="",this.xhrSettings=u(a(e,"responseType",void 0)),a(e,"xhrSettings",!1)&&(this.xhrSettings=h(this.xhrSettings,a(e,"xhrSettings",{}))),this.xhrLoader=null,this.state="function"==typeof this.url?r.FILE_POPULATED:r.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=a(e,"config",{}),this.multiFile,this.linkFile},setLink:function(t){this.linkFile=t,t.linkFile=this},resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){this.state===r.FILE_POPULATED?this.loader.nextFile(this,!0):(this.state=r.FILE_LOADING,this.src=o(this,this.loader.baseURL),0===this.src.indexOf("data:")?console.warn("Local data URIs are not supported: "+this.key):this.xhrLoader=l(this,this.loader.xhr))},onLoad:function(t,e){var i=t.responseURL&&(0===t.responseURL.indexOf("file://")||0===t.responseURL.indexOf("capacitor://"))&&0===e.target.status,s=!(e.target&&200!==e.target.status)||i;4===t.readyState&&t.status>=400&&t.status<=599&&(s=!1),this.state=r.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,s)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(n.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=r.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=r.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){console.error('Failed to process file: %s "%s"',this.type,this.key),this.state=r.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.cache.add(this.key,this.data),this.pendingDestroy()},pendingDestroy:function(t){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit(n.FILE_COMPLETE,e,i,t),this.loader.emit(n.FILE_KEY_COMPLETE+i+"-"+e,e,i,t),this.loader.flagForRemoval(this)},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});c.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var s=new FileReader;s.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+s.result.split(",")[1]},s.onerror=t.onerror,s.readAsDataURL(e)}},c.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=c},76846:t=>{var e={},i={install:function(t){for(var i in e)t[i]=e[i]},register:function(t,i){e[t]=i},destroy:function(){e={}}};t.exports=i},30750:t=>{t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},67285:(t,e,i)=>{var s=i(56694),r=i(12117),n=i(58403),a=i(6659),o=i(683),h=i(76846),l=i(72632),u=i(91963),c=i(7599),d=i(33868),f=new s({Extends:a,initialize:function(t){a.call(this);var e=t.sys.game.config,i=t.sys.settings.loader;this.scene=t,this.systems=t.sys,this.cacheManager=t.sys.cache,this.textureManager=t.sys.textures,this.sceneManager=t.sys.game.scene,h.install(this),this.prefix="",this.path="",this.baseURL="",this.setBaseURL(l(i,"baseURL",e.loaderBaseURL)),this.setPath(l(i,"path",e.loaderPath)),this.setPrefix(l(i,"prefix",e.loaderPrefix)),this.maxParallelDownloads=l(i,"maxParallelDownloads",e.loaderMaxParallelDownloads),this.xhr=d(l(i,"responseType",e.loaderResponseType),l(i,"async",e.loaderAsync),l(i,"user",e.loaderUser),l(i,"password",e.loaderPassword),l(i,"timeout",e.loaderTimeout),l(i,"withCredentials",e.loaderWithCredentials)),this.crossOrigin=l(i,"crossOrigin",e.loaderCrossOrigin),this.imageLoadType=l(i,"imageLoadType",e.loaderImageLoadType),this.totalToLoad=0,this.progress=0,this.list=new n,this.inflight=new n,this.queue=new n,this._deleteQueue=new n,this.totalFailed=0,this.totalComplete=0,this.state=r.LOADER_IDLE,this.multiKeyIndex=0,t.sys.events.once(c.BOOT,this.boot,this),t.sys.events.on(c.START,this.pluginStart,this)},boot:function(){this.systems.events.once(c.DESTROY,this.destroy,this)},pluginStart:function(){this.systems.events.once(c.SHUTDOWN,this.shutdown,this)},setBaseURL:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.baseURL=t,this},setPath:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.path=t,this},setPrefix:function(t){return void 0===t&&(t=""),this.prefix=t,this},setCORS:function(t){return this.crossOrigin=t,this},addFile:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e0},isLoading:function(){return this.state===r.LOADER_LOADING||this.state===r.LOADER_PROCESSING},isReady:function(){return this.state===r.LOADER_IDLE||this.state===r.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit(o.START,this),0===this.list.size?this.loadComplete():(this.state=r.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on(c.UPDATE,this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit(o.PROGRESS,this.progress)},update:function(){this.state===r.LOADER_LOADING&&this.list.size>0&&this.inflight.size{var s=i(98611),r=i(33868);t.exports=function(t,e){var i=void 0===t?r():s({},t);if(e)for(var n in e)void 0!==e[n]&&(i[n]=e[n]);return i}},45176:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s){var r=[];s.forEach((function(t){t&&r.push(t)})),this.loader=t,this.type=e,this.key=i,this.multiKeyIndex=t.multiKeyIndex++,this.files=r,this.complete=!1,this.pending=r.length,this.failed=0,this.config={},this.baseURL=t.baseURL,this.path=t.path,this.prefix=t.prefix;for(var n=0;n{var s=i(43531);t.exports=function(t,e){var i=s(e,t.xhrSettings),r=new XMLHttpRequest;if(r.open("GET",t.src,i.async,i.user,i.password),r.responseType=t.xhrSettings.responseType,r.timeout=i.timeout,i.headers)for(var n in i.headers)r.setRequestHeader(n,i.headers[n]);return i.header&&i.headerValue&&r.setRequestHeader(i.header,i.headerValue),i.requestedWith&&r.setRequestHeader("X-Requested-With",i.requestedWith),i.overrideMimeType&&r.overrideMimeType(i.overrideMimeType),i.withCredentials&&(r.withCredentials=!0),r.onload=t.onLoad.bind(t,r),r.onerror=t.onError.bind(t,r),r.onprogress=t.onProgress.bind(t),r.send(),r}},33868:t=>{t.exports=function(t,e,i,s,r,n){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===s&&(s=""),void 0===r&&(r=0),void 0===n&&(n=!1),{responseType:t,async:e,user:i,password:s,timeout:r,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:n}}},12117:t=>{t.exports={LOADER_IDLE:0,LOADER_LOADING:1,LOADER_PROCESSING:2,LOADER_COMPLETE:3,LOADER_SHUTDOWN:4,LOADER_DESTROYED:5,FILE_PENDING:10,FILE_LOADING:11,FILE_LOADED:12,FILE_FAILED:13,FILE_PROCESSING:14,FILE_ERRORED:16,FILE_COMPLETE:17,FILE_DESTROYED:18,FILE_POPULATED:19}},7398:t=>{t.exports="addfile"},52187:t=>{t.exports="complete"},36627:t=>{t.exports="filecomplete"},81925:t=>{t.exports="filecomplete-"},29774:t=>{t.exports="loaderror"},20943:t=>{t.exports="load"},74693:t=>{t.exports="fileprogress"},71176:t=>{t.exports="postprocess"},88984:t=>{t.exports="progress"},72753:t=>{t.exports="start"},683:(t,e,i)=>{t.exports={ADD:i(7398),COMPLETE:i(52187),FILE_COMPLETE:i(36627),FILE_KEY_COMPLETE:i(81925),FILE_LOAD_ERROR:i(29774),FILE_LOAD:i(20943),FILE_PROGRESS:i(74693),POST_PROCESS:i(71176),PROGRESS:i(88984),START:i(72753)}},46468:(t,e,i)=>{var s=i(56694),r=i(76846),n=i(70806),a=i(683),o=new s({Extends:n,initialize:function(t,e,i,s,r){n.call(this,t,e,i,s,r),this.type="animationJSON"},onProcess:function(){this.loader.once(a.POST_PROCESS,this.onLoadComplete,this),n.prototype.onProcess.call(this)},onLoadComplete:function(){this.loader.systems.anims.fromJSON(this.data)}});r.register("animation",(function(t,e,i,s){if(Array.isArray(t))for(var r=0;r{var s=i(56694),r=i(76846),n=i(72632),a=i(42927),o=i(42911),h=i(70806),l=i(45176),u=new s({Extends:l,initialize:function(t,e,i,s,r,u){var c,d;if(o(e)){var f=e;e=n(f,"key"),c=new a(t,{key:e,url:n(f,"textureURL"),extension:n(f,"textureExtension","png"),normalMap:n(f,"normalMap"),xhrSettings:n(f,"textureXhrSettings")}),d=new h(t,{key:e,url:n(f,"atlasURL"),extension:n(f,"atlasExtension","json"),xhrSettings:n(f,"atlasXhrSettings")})}else c=new a(t,e,i,r),d=new h(t,e,s,u);c.linkFile?l.call(this,t,"atlasjson",e,[c,d,c.linkFile]):l.call(this,t,"atlasjson",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(t.key,t.data,e.data,i),e.addToCache(),this.complete=!0}}});r.register("aseprite",(function(t,e,i,s,r){var n;if(Array.isArray(t))for(var a=0;a{var s=i(56694),r=i(76846),n=i(72632),a=i(42927),o=i(42911),h=i(70806),l=i(45176),u=new s({Extends:l,initialize:function(t,e,i,s,r,u){var c,d;if(o(e)){var f=e;e=n(f,"key"),c=new a(t,{key:e,url:n(f,"textureURL"),extension:n(f,"textureExtension","png"),normalMap:n(f,"normalMap"),xhrSettings:n(f,"textureXhrSettings")}),d=new h(t,{key:e,url:n(f,"atlasURL"),extension:n(f,"atlasExtension","json"),xhrSettings:n(f,"atlasXhrSettings")})}else c=new a(t,e,i,r),d=new h(t,e,s,u);c.linkFile?l.call(this,t,"atlasjson",e,[c,d,c.linkFile]):l.call(this,t,"atlasjson",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(t.key,t.data,e.data,i),e.pendingDestroy(),this.complete=!0}}});r.register("atlas",(function(t,e,i,s,r){var n;if(Array.isArray(t))for(var a=0;a{var s=i(56694),r=i(76846),n=i(72632),a=i(42927),o=i(42911),h=i(45176),l=i(15297),u=new s({Extends:h,initialize:function(t,e,i,s,r,u){var c,d;if(o(e)){var f=e;e=n(f,"key"),c=new a(t,{key:e,url:n(f,"textureURL"),extension:n(f,"textureExtension","png"),normalMap:n(f,"normalMap"),xhrSettings:n(f,"textureXhrSettings")}),d=new l(t,{key:e,url:n(f,"atlasURL"),extension:n(f,"atlasExtension","xml"),xhrSettings:n(f,"atlasXhrSettings")})}else c=new a(t,e,i,r),d=new l(t,e,s,u);c.linkFile?h.call(this,t,"atlasxml",e,[c,d,c.linkFile]):h.call(this,t,"atlasxml",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlasXML(t.key,t.data,e.data,i),e.pendingDestroy(),this.complete=!0}}});r.register("atlasXML",(function(t,e,i,s,r){var n;if(Array.isArray(t))for(var a=0;a{var s=i(56694),r=i(12117),n=i(98035),a=i(76846),o=i(72632),h=i(30929),l=i(42911),u=new s({Extends:n,initialize:function(t,e,i,s,r){if(l(e)){var a=e;e=o(a,"key"),s=o(a,"xhrSettings"),r=o(a,"context",r)}var h={type:"audio",cache:t.cacheManager.audio,extension:i.type,responseType:"arraybuffer",key:e,url:i.url,xhrSettings:s,config:{context:r}};n.call(this,t,h)},onProcess:function(){this.state=r.FILE_PROCESSING;var t=this;this.config.context.decodeAudioData(this.xhrLoader.response,(function(e){t.data=e,t.onProcessComplete()}),(function(e){console.error("Error decoding audio: "+t.key+" - ",e?e.message:null),t.onProcessError()})),this.config.context=null}});u.create=function(t,e,i,s,r){var n=t.systems.game,a=n.config.audio,c=n.device.audio;l(e)&&(i=o(e,"url",[]),s=o(e,"config",{}));var d=u.getAudioURL(n,i);return d?c.webAudio&&!a.disableWebAudio?new u(t,e,d,r,n.sound.context):new h(t,e,d,s):null},u.getAudioURL=function(t,e){Array.isArray(e)||(e=[e]);for(var i=0;i{var s=i(67448),r=i(56694),n=i(76846),a=i(72632),o=i(42911),h=i(70806),l=i(45176),u=new r({Extends:l,initialize:function(t,e,i,r,n,u,c){if(o(e)){var d=e;e=a(d,"key"),i=a(d,"jsonURL"),r=a(d,"audioURL"),n=a(d,"audioConfig"),u=a(d,"audioXhrSettings"),c=a(d,"jsonXhrSettings")}var f;if(r){var p=s.create(t,e,r,n,u);p&&(f=new h(t,e,i,c),l.call(this,t,"audiosprite",e,[p,f]),this.config.resourceLoad=!1)}else f=new h(t,e,i,c),l.call(this,t,"audiosprite",e,[f]),this.config.resourceLoad=!0,this.config.audioConfig=n,this.config.audioXhrSettings=u},onFileComplete:function(t){if(-1!==this.files.indexOf(t)&&(this.pending--,this.config.resourceLoad&&"json"===t.type&&t.data.hasOwnProperty("resources"))){var e=t.data.resources,i=a(this.config,"audioConfig"),r=a(this.config,"audioXhrSettings"),n=s.create(this.loader,t.key,e,i,r);n&&(this.addToMultiFile(n),this.loader.addFile(n))}},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1];t.addToCache(),e.addToCache(),this.complete=!0}}});n.register("audioSprite",(function(t,e,i,s,r,n){var a,o=this.systems.game,h=o.config.audio,l=o.device.audio;if(h&&h.noAudio||!l.webAudio&&!l.audioData)return this;if(Array.isArray(t))for(var c=0;c{var s=i(56694),r=i(12117),n=i(98035),a=i(76846),o=i(72632),h=i(42911),l=new s({Extends:n,initialize:function(t,e,i,s,r){var a="bin";if(h(e)){var l=e;e=o(l,"key"),i=o(l,"url"),s=o(l,"xhrSettings"),a=o(l,"extension",a),r=o(l,"dataType",r)}var u={type:"binary",cache:t.cacheManager.binary,extension:a,responseType:"arraybuffer",key:e,url:i,xhrSettings:s,config:{dataType:r}};n.call(this,t,u)},onProcess:function(){this.state=r.FILE_PROCESSING;var t=this.config.dataType;this.data=t?new t(this.xhrLoader.response):this.xhrLoader.response,this.onProcessComplete()}});a.register("binary",(function(t,e,i,s){if(Array.isArray(t))for(var r=0;r{var s=i(56694),r=i(76846),n=i(72632),a=i(42927),o=i(42911),h=i(45176),l=i(31476),u=i(15297),c=new s({Extends:h,initialize:function(t,e,i,s,r,l){var c,d;if(o(e)){var f=e;e=n(f,"key"),c=new a(t,{key:e,url:n(f,"textureURL"),extension:n(f,"textureExtension","png"),normalMap:n(f,"normalMap"),xhrSettings:n(f,"textureXhrSettings")}),d=new u(t,{key:e,url:n(f,"fontDataURL"),extension:n(f,"fontDataExtension","xml"),xhrSettings:n(f,"fontDataXhrSettings")})}else c=new a(t,e,i,r),d=new u(t,e,s,l);c.linkFile?h.call(this,t,"bitmapfont",e,[c,d,c.linkFile]):h.call(this,t,"bitmapfont",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1];t.addToCache(),e.pendingDestroy();var i=t.cache.get(t.key),s=l(e.data,t.cache.getFrame(t.key),0,0,i);this.loader.cacheManager.bitmapFont.add(t.key,{data:s,texture:t.key,frame:null}),this.complete=!0}}});r.register("bitmapFont",(function(t,e,i,s,r){var n;if(Array.isArray(t))for(var a=0;a{var s=i(56694),r=i(12117),n=i(98035),a=i(76846),o=i(72632),h=i(42911),l=new s({Extends:n,initialize:function(t,e,i,s){var r="css";if(h(e)){var a=e;e=o(a,"key"),i=o(a,"url"),s=o(a,"xhrSettings"),r=o(a,"extension",r)}var l={type:"script",cache:!1,extension:r,responseType:"text",key:e,url:i,xhrSettings:s};n.call(this,t,l)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=document.createElement("style"),this.data.defer=!1,this.data.innerHTML=this.xhrLoader.responseText,document.head.appendChild(this.data),this.onProcessComplete()}});a.register("css",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(73152),r=i(40612),n=i(56694),a=i(76846),o=i(72632),h=i(42927),l=i(70806),u=i(67409),c=i(30657),d=i(80802),f=i(45176),p=i(24904),v=new n({Extends:f,initialize:function(t,e,i,s){if(i.multiAtlasURL){var n=new l(t,{key:e,url:i.multiAtlasURL,xhrSettings:s,config:i});f.call(this,t,"texture",e,[n])}else{var a=i.textureURL.substr(i.textureURL.length-3);i.type||(i.type="ktx"===a.toLowerCase()?"KTX":"PVR");var o=new r(t,{key:e,url:i.textureURL,extension:a,xhrSettings:s,config:i});if(i.atlasURL){var h=new l(t,{key:e,url:i.atlasURL,xhrSettings:s,config:i});f.call(this,t,"texture",e,[o,h])}else f.call(this,t,"texture",e,[o])}this.config=i},onFileComplete:function(t){if(-1!==this.files.indexOf(t)){if(this.pending--,!this.config.multiAtlasURL)return;if("json"===t.type&&t.data.hasOwnProperty("textures")){var e=t.data.textures,i=this.config,s=this.loader,n=s.baseURL,a=s.path,h=s.prefix,l=o(i,"multiBaseURL",this.baseURL),u=o(i,"multiPath",this.path),c=o(i,"prefix",this.prefix),d=o(i,"textureXhrSettings");l&&s.setBaseURL(l),u&&s.setPath(u),c&&s.setPrefix(c);for(var f=0;f{var s=i(56694),r=i(12117),n=i(98035),a=i(76846),o=i(72632),h=i(42911),l=i(31053),u=new s({Extends:n,initialize:function(t,e,i,s,r){var a="glsl";if(h(e)){var l=e;e=o(l,"key"),i=o(l,"url"),s=o(l,"shaderType","fragment"),r=o(l,"xhrSettings"),a=o(l,"extension",a)}else void 0===s&&(s="fragment");var u={type:"glsl",cache:t.cacheManager.shader,extension:a,responseType:"text",key:e,url:i,config:{shaderType:s},xhrSettings:r};n.call(this,t,u)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t=this.data.split("\n"),e=this.extractBlock(t,0);if(e)for(;e;){var i=this.getShaderName(e.header),s=this.getShaderType(e.header),r=this.getShaderUniforms(e.header),n=e.shader;if(this.cache.has(i)){var a=this.cache.get(i);"fragment"===s?a.fragmentSrc=n:a.vertexSrc=n,a.uniforms||(a.uniforms=r)}else"fragment"===s?this.cache.add(i,new l(i,n,"",r)):this.cache.add(i,new l(i,"",n,r));e=this.extractBlock(t,e.offset)}else"fragment"===this.config.shaderType?this.cache.add(this.key,new l(this.key,this.data)):this.cache.add(this.key,new l(this.key,"",this.data));this.pendingDestroy()},getShaderName:function(t){for(var e=0;e{var s=i(56694),r=i(683),n=i(98035),a=i(72632),o=i(30750),h=i(42911),l=new s({Extends:n,initialize:function(t,e,i,s){if(h(e)){var r=e;e=a(r,"key"),s=a(r,"config",s)}var o={type:"audio",cache:t.cacheManager.audio,extension:i.type,key:e,url:i.url,config:s};n.call(this,t,o),this.locked="ontouchstart"in window,this.loaded=!1,this.filesLoaded=0,this.filesTotal=0},onLoad:function(){this.loaded||(this.loaded=!0,this.loader.nextFile(this,!0))},onError:function(){for(var t=0;t{var s=i(56694),r=i(12117),n=i(98035),a=i(76846),o=i(72632),h=i(42911),l=new s({Extends:n,initialize:function(t,e,i,s){var r="html";if(h(e)){var a=e;e=o(a,"key"),i=o(a,"url"),s=o(a,"xhrSettings"),r=o(a,"extension",r)}var l={type:"text",cache:t.cacheManager.html,extension:r,responseType:"text",key:e,url:i,xhrSettings:s};n.call(this,t,l)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});a.register("html",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),r=i(12117),n=i(98035),a=i(76846),o=i(72632),h=i(42911),l=new s({Extends:n,initialize:function(t,e,i,s,r,a){void 0===s&&(s=512),void 0===r&&(r=512);var l="html";if(h(e)){var u=e;e=o(u,"key"),i=o(u,"url"),a=o(u,"xhrSettings"),l=o(u,"extension",l),s=o(u,"width",s),r=o(u,"height",r)}var c={type:"html",cache:t.textureManager,extension:l,responseType:"text",key:e,url:i,xhrSettings:a,config:{width:s,height:r}};n.call(this,t,c)},onProcess:function(){this.state=r.FILE_PROCESSING;var t=this.config.width,e=this.config.height,i=[];i.push(''),i.push(''),i.push(''),i.push(this.xhrLoader.responseText),i.push(""),i.push(""),i.push("");var s=[i.join("\n")],a=this;try{var o=new window.Blob(s,{type:"image/svg+xml;charset=utf-8"})}catch(t){return a.state=r.FILE_ERRORED,void a.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){n.revokeObjectURL(a.data),a.onProcessComplete()},this.data.onerror=function(){n.revokeObjectURL(a.data),a.onProcessError()},n.createObjectURL(this.data,o,"image/svg+xml")},addToCache:function(){var t=this.cache.addImage(this.key,this.data);this.pendingDestroy(t)}});a.register("htmlTexture",(function(t,e,i,s,r){if(Array.isArray(t))for(var n=0;n{var s=i(56694),r=i(12117),n=i(98035),a=i(76846),o=i(72632),h=i(42911),l=i(30750),u=new s({Extends:n,initialize:function t(e,i,s,r,a){var l,u="png";if(h(i)){var c=i;i=o(c,"key"),s=o(c,"url"),l=o(c,"normalMap"),r=o(c,"xhrSettings"),u=o(c,"extension",u),a=o(c,"frameConfig")}Array.isArray(s)&&(l=s[1],s=s[0]);var d={type:"image",cache:e.textureManager,extension:u,responseType:"blob",key:i,url:s,xhrSettings:r,config:a};if(n.call(this,e,d),l){var f=new t(e,this.key,l,r,a);f.type="normalMap",this.setLink(f),e.addFile(f)}this.useImageElementLoad="HTMLImageElement"===e.imageLoadType,this.useImageElementLoad&&(this.load=this.loadImage,this.onProcess=this.onProcessImage)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){n.revokeObjectURL(t.data),t.onProcessComplete()},this.data.onerror=function(){n.revokeObjectURL(t.data),t.onProcessError()},n.createObjectURL(this.data,this.xhrLoader.response,"image/png")},onProcessImage:function(){var t=this.state;this.state=r.FILE_PROCESSING,t===r.FILE_LOADED?this.onProcessComplete():this.onProcessError()},loadImage:function(){if(this.state=r.FILE_LOADING,this.src=l(this,this.loader.baseURL),0===this.src.indexOf("data:"))console.warn("Local data URIs are not supported: "+this.key);else{this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){t.state=r.FILE_LOADED,t.loader.nextFile(t,!0)},this.data.onerror=function(){t.loader.nextFile(t,!1)},this.data.src=this.src}},addToCache:function(){var t,e=this.linkFile;e&&e.state===r.FILE_COMPLETE?(t="image"===this.type?this.cache.addImage(this.key,this.data,e.data):this.cache.addImage(e.key,e.data,this.data),this.pendingDestroy(t),e.pendingDestroy(t)):e||(t=this.cache.addImage(this.key,this.data),this.pendingDestroy(t))}});a.register("image",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),r=i(12117),n=i(98035),a=i(76846),o=i(72632),h=i(10850),l=i(42911),u=new s({Extends:n,initialize:function(t,e,i,s,a){var u="json";if(l(e)){var c=e;e=o(c,"key"),i=o(c,"url"),s=o(c,"xhrSettings"),u=o(c,"extension",u),a=o(c,"dataKey",a)}var d={type:"json",cache:t.cacheManager.json,extension:u,responseType:"text",key:e,url:i,xhrSettings:s,config:a};n.call(this,t,d),l(i)&&(this.data=a?h(i,a):i,this.state=r.FILE_POPULATED)},onProcess:function(){if(this.state!==r.FILE_POPULATED){this.state=r.FILE_PROCESSING;try{var t=JSON.parse(this.xhrLoader.responseText)}catch(t){throw this.onProcessError(),t}var e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});a.register("json",(function(t,e,i,s){if(Array.isArray(t))for(var r=0;r{var s=i(56694),r=i(76846),n=i(72632),a=i(42927),o=i(42911),h=i(70806),l=i(45176),u=new s({Extends:l,initialize:function(t,e,i,s,r,a,u){if(o(e)){var c=e;e=n(c,"key"),i=n(c,"url",!1)?n(c,"url"):n(c,"atlasURL"),a=n(c,"xhrSettings"),s=n(c,"path"),r=n(c,"baseURL"),u=n(c,"textureXhrSettings")}var d=new h(t,e,i,a);l.call(this,t,"multiatlas",e,[d]),this.config.path=s,this.config.baseURL=r,this.config.textureXhrSettings=u},onFileComplete:function(t){if(-1!==this.files.indexOf(t)&&(this.pending--,"json"===t.type&&t.data.hasOwnProperty("textures"))){var e=t.data.textures,i=this.config,s=this.loader,r=s.baseURL,o=s.path,h=s.prefix,l=n(i,"baseURL",this.baseURL),u=n(i,"path",this.path),c=n(i,"prefix",this.prefix),d=n(i,"textureXhrSettings");s.setBaseURL(l),s.setPath(u),s.setPrefix(c);for(var f=0;f{var s=i(56694),r=i(76846),n=i(72632),a=i(42911),o=i(45176),h=i(55188),l=new s({Extends:o,initialize:function(t,e,i,s){var r="js",l=[];if(a(e)){var u=e;e=n(u,"key"),i=n(u,"url"),s=n(u,"xhrSettings"),r=n(u,"extension",r)}Array.isArray(i)||(i=[i]);for(var c=0;c{var s=i(56694),r=i(76846),n=i(72632),a=i(42911),o=i(45176),h=i(27291),l=i(76799),u=i(86897),c=new s({Extends:o,initialize:function(t,e,i,s,r,h){var l,c,d=t.cacheManager.obj;if(a(e)){var f=e;e=n(f,"key"),l=new u(t,{key:e,type:"obj",cache:d,url:n(f,"url"),extension:n(f,"extension","obj"),xhrSettings:n(f,"xhrSettings"),config:{flipUV:n(f,"flipUV",r)}}),(s=n(f,"matURL"))&&(c=new u(t,{key:e,type:"mat",cache:d,url:s,extension:n(f,"matExtension","mat"),xhrSettings:n(f,"xhrSettings")}))}else l=new u(t,{key:e,url:i,type:"obj",cache:d,extension:"obj",xhrSettings:h,config:{flipUV:r}}),s&&(c=new u(t,{key:e,url:s,type:"mat",cache:d,extension:"mat",xhrSettings:h}));o.call(this,t,"obj",e,[l,c])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=h(t.data,t.config.flipUV);e&&(i.materials=l(e.data)),t.cache.add(t.key,i),this.complete=!0}}});r.register("obj",(function(t,e,i,s,r){var n;if(Array.isArray(t))for(var a=0;a{var s=i(56694),r=i(12117),n=i(76846),a=i(70806),o=new s({Extends:a,initialize:function(t,e,i,s,r){a.call(this,t,e,i,s,r),this.type="packfile"},onProcess:function(){this.state!==r.FILE_POPULATED&&(this.state=r.FILE_PROCESSING,this.data=JSON.parse(this.xhrLoader.responseText)),this.loader.addPack(this.data,this.config),this.onProcessComplete()}});n.register("pack",(function(t,e,i,s){if(Array.isArray(t))for(var r=0;r{var s=i(56694),r=i(12117),n=i(98035),a=i(76846),o=i(72632),h=i(42911),l=new s({Extends:n,initialize:function(t,e,i,s,a,l){var u="js";if(h(e)){var c=e;e=o(c,"key"),i=o(c,"url"),l=o(c,"xhrSettings"),u=o(c,"extension",u),s=o(c,"start"),a=o(c,"mapping")}var d={type:"plugin",cache:!1,extension:u,responseType:"text",key:e,url:i,xhrSettings:l,config:{start:s,mapping:a}};n.call(this,t,d),"function"==typeof i&&(this.data=i,this.state=r.FILE_POPULATED)},onProcess:function(){var t=this.loader.systems.plugins,e=this.config,i=o(e,"start",!1),s=o(e,"mapping",null);if(this.state===r.FILE_POPULATED)t.install(this.key,this.data,i,s);else{this.state=r.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data);var n=t.install(this.key,window[this.key],i,s);(i||s)&&(this.loader.systems[s]=n,this.loader.scene[s]=n)}this.onProcessComplete()}});a.register("plugin",(function(t,e,i,s,r){if(Array.isArray(t))for(var n=0;n{var s=i(56694),r=i(12117),n=i(98035),a=i(76846),o=i(72632),h=i(42911),l=new s({Extends:n,initialize:function(t,e,i,s,r){var a="svg";if(h(e)){var l=e;e=o(l,"key"),i=o(l,"url"),s=o(l,"svgConfig",{}),r=o(l,"xhrSettings"),a=o(l,"extension",a)}var u={type:"svg",cache:t.textureManager,extension:a,responseType:"text",key:e,url:i,xhrSettings:r,config:{width:o(s,"width"),height:o(s,"height"),scale:o(s,"scale")}};n.call(this,t,u)},onProcess:function(){this.state=r.FILE_PROCESSING;var t=this.xhrLoader.responseText,e=[t],i=this.config.width,s=this.config.height,a=this.config.scale;t:if(i&&s||a){var o=(new DOMParser).parseFromString(t,"text/xml").getElementsByTagName("svg")[0],h=o.hasAttribute("viewBox"),l=parseFloat(o.getAttribute("width")),u=parseFloat(o.getAttribute("height"));if(!h&&l&&u)o.setAttribute("viewBox","0 0 "+l+" "+u);else if(h&&!l&&!u){var c=o.getAttribute("viewBox").split(/\s+|,/);l=c[2],u=c[3]}if(a){if(!l||!u)break t;i=l*a,s=u*a}o.setAttribute("width",i.toString()+"px"),o.setAttribute("height",s.toString()+"px"),e=[(new XMLSerializer).serializeToString(o)]}try{var d=new window.Blob(e,{type:"image/svg+xml;charset=utf-8"})}catch(t){return void this.onProcessError()}this.data=new Image,this.data.crossOrigin=this.crossOrigin;var f=this,p=!1;this.data.onload=function(){p||n.revokeObjectURL(f.data),f.onProcessComplete()},this.data.onerror=function(){p?f.onProcessError():(p=!0,n.revokeObjectURL(f.data),f.data.src="data:image/svg+xml,"+encodeURIComponent(e.join("")))},n.createObjectURL(this.data,d,"image/svg+xml")},addToCache:function(){var t=this.cache.addImage(this.key,this.data);this.pendingDestroy(t)}});a.register("svg",(function(t,e,i,s){if(Array.isArray(t))for(var r=0;r{var s=i(56694),r=i(12117),n=i(98035),a=i(76846),o=i(72632),h=i(42911),l=new s({Extends:n,initialize:function(t,e,i,s){var r="js";if(h(e)){var a=e;e=o(a,"key"),i=o(a,"url"),s=o(a,"xhrSettings"),r=o(a,"extension",r)}var l={type:"text",extension:r,responseType:"text",key:e,url:i,xhrSettings:s};n.call(this,t,l)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t=this.data.concat("(function(){\nreturn new "+this.key+"();\n}).call(this);"),e=eval;this.loader.sceneManager.add(this.key,e(t)),this.complete=!0}});a.register("sceneFile",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),r=i(12117),n=i(98035),a=i(76846),o=i(72632),h=i(42911),l=new s({Extends:n,initialize:function(t,e,i,s,a,l){var u="js";if(h(e)){var c=e;e=o(c,"key"),i=o(c,"url"),l=o(c,"xhrSettings"),u=o(c,"extension",u),s=o(c,"systemKey"),a=o(c,"sceneKey")}var d={type:"scenePlugin",cache:!1,extension:u,responseType:"text",key:e,url:i,xhrSettings:l,config:{systemKey:s,sceneKey:a}};n.call(this,t,d),"function"==typeof i&&(this.data=i,this.state=r.FILE_POPULATED)},onProcess:function(){var t=this.loader.systems.plugins,e=this.config,i=this.key,s=o(e,"systemKey",i),n=o(e,"sceneKey",i);this.state===r.FILE_POPULATED?t.installScenePlugin(s,this.data,n,this.loader.scene,!0):(this.state=r.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data),t.installScenePlugin(s,window[this.key],n,this.loader.scene,!0)),this.onProcessComplete()}});a.register("scenePlugin",(function(t,e,i,s,r){if(Array.isArray(t))for(var n=0;n{var s=i(56694),r=i(12117),n=i(98035),a=i(76846),o=i(72632),h=i(42911),l=new s({Extends:n,initialize:function(t,e,i,s){var r="js";if(h(e)){var a=e;e=o(a,"key"),i=o(a,"url"),s=o(a,"xhrSettings"),r=o(a,"extension",r)}var l={type:"script",cache:!1,extension:r,responseType:"text",key:e,url:i,xhrSettings:s};n.call(this,t,l)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data),this.onProcessComplete()}});a.register("script",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),r=i(76846),n=i(42927),a=new s({Extends:n,initialize:function(t,e,i,s,r){n.call(this,t,e,i,r,s),this.type="spritesheet"},addToCache:function(){var t=this.cache.addSpriteSheet(this.key,this.data,this.config);this.pendingDestroy(t)}});r.register("spritesheet",(function(t,e,i,s){if(Array.isArray(t))for(var r=0;r{var s=i(56694),r=i(12117),n=i(98035),a=i(76846),o=i(72632),h=i(42911),l=new s({Extends:n,initialize:function(t,e,i,s){var r="text",a="txt",l=t.cacheManager.text;if(h(e)){var u=e;e=o(u,"key"),i=o(u,"url"),s=o(u,"xhrSettings"),a=o(u,"extension",a),r=o(u,"type",r),l=o(u,"cache",l)}var c={type:r,cache:l,extension:a,responseType:"text",key:e,url:i,xhrSettings:s};n.call(this,t,c)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});a.register("text",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),r=i(12117),n=i(98035),a=i(76846),o=i(72632),h=i(42911),l=i(93560),u=new s({Extends:n,initialize:function(t,e,i,s){var r="csv";if(h(e)){var a=e;e=o(a,"key"),i=o(a,"url"),s=o(a,"xhrSettings"),r=o(a,"extension",r)}var u={type:"tilemapCSV",cache:t.cacheManager.tilemap,extension:r,responseType:"text",key:e,url:i,xhrSettings:s};n.call(this,t,u),this.tilemapFormat=l.CSV},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t={format:this.tilemapFormat,data:this.data};this.cache.add(this.key,t),this.pendingDestroy(t)}});a.register("tilemapCSV",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),r=i(76846),n=i(70806),a=i(93560),o=new s({Extends:n,initialize:function(t,e,i,s){n.call(this,t,e,i,s),this.type="tilemapJSON",this.cache=t.cacheManager.tilemap},addToCache:function(){var t={format:a.WELTMEISTER,data:this.data};this.cache.add(this.key,t),this.pendingDestroy(t)}});r.register("tilemapImpact",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),r=i(76846),n=i(70806),a=i(93560),o=new s({Extends:n,initialize:function(t,e,i,s){n.call(this,t,e,i,s),this.type="tilemapJSON",this.cache=t.cacheManager.tilemap},addToCache:function(){var t={format:a.TILED_JSON,data:this.data};this.cache.add(this.key,t),this.pendingDestroy(t)}});r.register("tilemapTiledJSON",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),r=i(76846),n=i(72632),a=i(42927),o=i(42911),h=i(45176),l=i(86897),u=new s({Extends:h,initialize:function(t,e,i,s,r,u){var c,d;if(o(e)){var f=e;e=n(f,"key"),c=new a(t,{key:e,url:n(f,"textureURL"),extension:n(f,"textureExtension","png"),normalMap:n(f,"normalMap"),xhrSettings:n(f,"textureXhrSettings")}),d=new l(t,{key:e,url:n(f,"atlasURL"),extension:n(f,"atlasExtension","txt"),xhrSettings:n(f,"atlasXhrSettings")})}else c=new a(t,e,i,r),d=new l(t,e,s,u);c.linkFile?h.call(this,t,"unityatlas",e,[c,d,c.linkFile]):h.call(this,t,"unityatlas",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addUnityAtlas(t.key,t.data,e.data,i),e.pendingDestroy(),this.complete=!0}}});r.register("unityAtlas",(function(t,e,i,s,r){var n;if(Array.isArray(t))for(var a=0;a{var s=i(56694),r=i(12117),n=i(98035),a=i(76846),o=i(30750),h=i(72632),l=i(42911),u=new s({Extends:n,initialize:function(t,e,i,s,r,a,o){void 0===s&&(s="loadeddata"),void 0===r&&(r=!1),void 0===a&&(a=!1),"loadeddata"!==s&&"canplay"!==s&&"canplaythrough"!==s&&(s="loadeddata");var h={type:"video",cache:t.cacheManager.video,extension:i.type,responseType:"blob",key:e,url:i.url,xhrSettings:o,config:{loadEvent:s,asBlob:r,noAudio:a}};this.onLoadCallback=this.onVideoLoadHandler.bind(this),this.onErrorCallback=this.onVideoErrorHandler.bind(this),n.call(this,t,h)},onProcess:function(){if(this.state=r.FILE_PROCESSING,this.config.asBlob){var t=this.createVideoElement();this.data=t;var e=this;this.data.onloadeddata=function(){e.onProcessComplete()},this.data.onerror=function(){n.revokeObjectURL(e.data),e.onProcessError()},n.createObjectURL(t,this.xhrLoader.response,""),t.load()}else this.onProcessComplete()},createVideoElement:function(){var t=document.createElement("video");return t.controls=!1,t.crossOrigin=this.loader.crossOrigin,this.config.noAudio&&(t.muted=!0,t.defaultMuted=!0,t.setAttribute("autoplay","autoplay")),t.setAttribute("playsinline","playsinline"),t.setAttribute("preload","auto"),t},onVideoLoadHandler:function(t){var e=t.target;e.removeEventListener(this.config.loadEvent,this.onLoadCallback,!0),e.removeEventListener("error",this.onErrorCallback,!0),this.data=e,this.resetXHR(),this.loader.nextFile(this,!0)},onVideoErrorHandler:function(t){var e=t.target;e&&(e.removeEventListener(this.config.loadEvent,this.onLoadCallback,!0),e.removeEventListener("error",this.onErrorCallback,!0)),this.resetXHR(),this.loader.nextFile(this,!1)},load:function(){var t=this.config.loadEvent;if(this.config.asBlob)n.prototype.load.call(this);else{this.percentComplete=0;var e=this.createVideoElement();e.addEventListener(t,this.onLoadCallback,!0),e.addEventListener("error",this.onErrorCallback,!0),e.src=o(this,this.loader.baseURL),e.load()}}});u.create=function(t,e,i,s,r,n,a){var o=t.systems.game;l(e)&&(i=h(e,"url",[]),s=h(e,"loadEvent","loadeddata"),r=h(e,"asBlob",!1),n=h(e,"noAudio",!1),a=h(e,"xhrSettings"),e=h(e,"key"));var c=u.getVideoURL(o,i);if(c)return new u(t,e,c,s,r,n,a)},u.getVideoURL=function(t,e){Array.isArray(e)||(e=[e]);for(var i=0;i{var s=i(56694),r=i(12117),n=i(98035),a=i(76846),o=i(72632),h=i(42911),l=i(89200),u=new s({Extends:n,initialize:function(t,e,i,s){var r="xml";if(h(e)){var a=e;e=o(a,"key"),i=o(a,"url"),s=o(a,"xhrSettings"),r=o(a,"extension",r)}var l={type:"xml",cache:t.cacheManager.xml,extension:r,responseType:"text",key:e,url:i,xhrSettings:s};n.call(this,t,l)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=l(this.xhrLoader.responseText),this.data?this.onProcessComplete():this.onProcessError()}});a.register("xml",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{t.exports={AnimationJSONFile:i(46468),AsepriteFile:i(31648),AtlasJSONFile:i(73152),AtlasXMLFile:i(24616),AudioFile:i(67448),AudioSpriteFile:i(66109),BinaryFile:i(40612),BitmapFontFile:i(54565),CompressedTextureFile:i(47375),CSSFile:i(99898),GLSLFile:i(46568),HTML5AudioFile:i(30929),HTMLFile:i(77459),HTMLTextureFile:i(9755),ImageFile:i(42927),JSONFile:i(70806),MultiAtlasFile:i(80802),MultiScriptFile:i(39034),OBJFile:i(85527),PackFile:i(3616),PluginFile:i(12217),SceneFile:i(95171),ScenePluginFile:i(82458),ScriptFile:i(55188),SpriteSheetFile:i(33536),SVGFile:i(4474),TextFile:i(86897),TilemapCSVFile:i(58673),TilemapImpactFile:i(98896),TilemapJSONFile:i(50563),UnityAtlasFile:i(82857),VideoFile:i(22833),XMLFile:i(15297)}},95695:(t,e,i)=>{var s=i(12117),r=i(98611),n={Events:i(683),FileTypes:i(34034),File:i(98035),FileTypesManager:i(76846),GetURL:i(30750),LoaderPlugin:i(67285),MergeXHRSettings:i(43531),MultiFile:i(45176),XHRLoader:i(88490),XHRSettings:i(33868)};n=r(!1,n,s),t.exports=n},26042:t=>{t.exports=function(t){for(var e=0,i=0;i{var s=i(8034);t.exports=function(t,e){return s(t)/s(e)/s(t-e)}},17489:t=>{t.exports=function(t,e){return Math.floor(Math.random()*(e-t+1)+t)}},14976:t=>{t.exports=function(t,e,i,s,r){var n=.5*(s-e),a=.5*(r-i),o=t*t;return(2*i-2*s+n+a)*(t*o)+(-3*i+3*s-2*n-a)*o+n*t+i}},89129:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.ceil(t*s)/s}},82897:t=>{t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},75606:(t,e,i)=>{var s=i(83392);t.exports=function(t){return t*s.DEG_TO_RAD}},767:t=>{t.exports=function(t,e){return Math.abs(t-e)}},9849:(t,e,i)=>{var s=i(82897),r=i(56694),n=i(16650),a=i(72283),o=new n,h=new r({initialize:function t(e,i,s,r){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===r&&(r=t.DefaultOrder),this._x=e,this._y=i,this._z=s,this._order=r,this.onChangeCallback=a},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback(this)}},set:function(t,e,i,s){return void 0===s&&(s=this._order),this._x=t,this._y=e,this._z=i,this._order=s,this.onChangeCallback(this),this},copy:function(t){return this.set(t.x,t.y,t.z,t.order)},setFromQuaternion:function(t,e,i){return void 0===e&&(e=this._order),void 0===i&&(i=!1),o.fromQuat(t),this.setFromRotationMatrix(o,e,i)},setFromRotationMatrix:function(t,e,i){void 0===e&&(e=this._order),void 0===i&&(i=!1);var r=t.val,n=r[0],a=r[4],o=r[8],h=r[1],l=r[5],u=r[9],c=r[2],d=r[6],f=r[10],p=0,v=0,g=0,m=.99999;switch(e){case"XYZ":v=Math.asin(s(o,-1,1)),Math.abs(o){t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},61616:t=>{t.exports=function(t,e){return Math.random()*(e-t)+t}},60679:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.floor(t*s)/s}},91806:(t,e,i)=>{var s=i(82897);t.exports=function(t,e,i){return(i-e)*(t=s(t,0,1))+e}},79366:t=>{t.exports=function(t,e){return t/e/1e3}},43776:t=>{t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},58442:t=>{t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},42798:t=>{t.exports=function(t,e,i){return(e-t)*i+t}},5341:(t,e,i)=>{var s=new(i(56694))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new s(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=s,this},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=l*n-a*h,c=-l*r+a*o,d=h*r-n*o,f=e*u+i*c+s*d;return f?(f=1/f,t[0]=u*f,t[1]=(-l*i+s*h)*f,t[2]=(a*i-s*n)*f,t[3]=c*f,t[4]=(l*e-s*o)*f,t[5]=(-a*e+s*r)*f,t[6]=d*f,t[7]=(-h*e+i*o)*f,t[8]=(n*e-i*r)*f,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return t[0]=n*l-a*h,t[1]=s*h-i*l,t[2]=i*a-s*n,t[3]=a*o-r*l,t[4]=e*l-s*o,t[5]=s*r-e*a,t[6]=r*h-n*o,t[7]=i*o-e*h,t[8]=e*n-i*r,this},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return e*(l*n-a*h)+i*(-l*r+a*o)+s*(h*r-n*o)},multiply:function(t){var e=this.val,i=e[0],s=e[1],r=e[2],n=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],c=t.val,d=c[0],f=c[1],p=c[2],v=c[3],g=c[4],m=c[5],y=c[6],x=c[7],T=c[8];return e[0]=d*i+f*n+p*h,e[1]=d*s+f*a+p*l,e[2]=d*r+f*o+p*u,e[3]=v*i+g*n+m*h,e[4]=v*s+g*a+m*l,e[5]=v*r+g*o+m*u,e[6]=y*i+x*n+T*h,e[7]=y*s+x*a+T*l,e[8]=y*r+x*o+T*u,this},translate:function(t){var e=this.val,i=t.x,s=t.y;return e[6]=i*e[0]+s*e[3]+e[6],e[7]=i*e[1]+s*e[4]+e[7],e[8]=i*e[2]+s*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],s=e[1],r=e[2],n=e[3],a=e[4],o=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*n,e[1]=l*s+h*a,e[2]=l*r+h*o,e[3]=l*n-h*i,e[4]=l*a-h*s,e[5]=l*o-h*r,this},scale:function(t){var e=this.val,i=t.x,s=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=s*e[3],e[4]=s*e[4],e[5]=s*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,s=t.z,r=t.w,n=e+e,a=i+i,o=s+s,h=e*n,l=e*a,u=e*o,c=i*a,d=i*o,f=s*o,p=r*n,v=r*a,g=r*o,m=this.val;return m[0]=1-(c+f),m[3]=l+g,m[6]=u-v,m[1]=l-g,m[4]=1-(h+f),m[7]=d+p,m[2]=u+v,m[5]=d-p,m[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,i=this.val,s=e[0],r=e[1],n=e[2],a=e[3],o=e[4],h=e[5],l=e[6],u=e[7],c=e[8],d=e[9],f=e[10],p=e[11],v=e[12],g=e[13],m=e[14],y=e[15],x=s*h-r*o,T=s*l-n*o,w=s*u-a*o,E=r*l-n*h,b=r*u-a*h,S=n*u-a*l,A=c*g-d*v,_=c*m-f*v,C=c*y-p*v,R=d*m-f*g,M=d*y-p*g,P=f*y-p*m,O=x*P-T*M+w*R+E*C-b*_+S*A;return O?(O=1/O,i[0]=(h*P-l*M+u*R)*O,i[1]=(l*C-o*P-u*_)*O,i[2]=(o*M-h*C+u*A)*O,i[3]=(n*M-r*P-a*R)*O,i[4]=(s*P-n*C+a*_)*O,i[5]=(r*C-s*M-a*A)*O,i[6]=(g*S-m*b+y*E)*O,i[7]=(m*w-v*S-y*T)*O,i[8]=(v*b-g*w+y*x)*O,this):null}});t.exports=s},16650:(t,e,i)=>{var s=i(56694),r=i(70015),n=1e-6,a=new s({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new a(this)},set:function(t){return this.copy(t)},setValues:function(t,e,i,s,r,n,a,o,h,l,u,c,d,f,p,v){var g=this.val;return g[0]=t,g[1]=e,g[2]=i,g[3]=s,g[4]=r,g[5]=n,g[6]=a,g[7]=o,g[8]=h,g[9]=l,g[10]=u,g[11]=c,g[12]=d,g[13]=f,g[14]=p,g[15]=v,this},copy:function(t){var e=t.val;return this.setValues(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},fromArray:function(t){return this.setValues(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(t,e,i){var s=o.fromQuat(i).val,r=e.x,n=e.y,a=e.z;return this.setValues(s[0]*r,s[1]*r,s[2]*r,0,s[4]*n,s[5]*n,s[6]*n,0,s[8]*a,s[9]*a,s[10]*a,0,t.x,t.y,t.z,1)},xyz:function(t,e,i){this.identity();var s=this.val;return s[12]=t,s[13]=e,s[14]=i,this},scaling:function(t,e,i){this.zero();var s=this.val;return s[0]=t,s[5]=e,s[10]=i,s[15]=1,this},identity:function(){return this.setValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[3],r=t[6],n=t[7],a=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=r,t[11]=t[14],t[12]=s,t[13]=n,t[14]=a,this},getInverse:function(t){return this.copy(t),this.invert()},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],v=t[14],g=t[15],m=e*a-i*n,y=e*o-s*n,x=e*h-r*n,T=i*o-s*a,w=i*h-r*a,E=s*h-r*o,b=l*p-u*f,S=l*v-c*f,A=l*g-d*f,_=u*v-c*p,C=u*g-d*p,R=c*g-d*v,M=m*R-y*C+x*_+T*A-w*S+E*b;return M?(M=1/M,this.setValues((a*R-o*C+h*_)*M,(s*C-i*R-r*_)*M,(p*E-v*w+g*T)*M,(c*w-u*E-d*T)*M,(o*A-n*R-h*S)*M,(e*R-s*A+r*S)*M,(v*x-f*E-g*y)*M,(l*E-c*x+d*y)*M,(n*C-a*A+h*b)*M,(i*A-e*C-r*b)*M,(f*w-p*x+g*m)*M,(u*x-l*w-d*m)*M,(a*S-n*_-o*b)*M,(e*_-i*S+s*b)*M,(p*y-f*T-v*m)*M,(l*T-u*y+c*m)*M)):this},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],v=t[14],g=t[15];return this.setValues(a*(c*g-d*v)-u*(o*g-h*v)+p*(o*d-h*c),-(i*(c*g-d*v)-u*(s*g-r*v)+p*(s*d-r*c)),i*(o*g-h*v)-a*(s*g-r*v)+p*(s*h-r*o),-(i*(o*d-h*c)-a*(s*d-r*c)+u*(s*h-r*o)),-(n*(c*g-d*v)-l*(o*g-h*v)+f*(o*d-h*c)),e*(c*g-d*v)-l*(s*g-r*v)+f*(s*d-r*c),-(e*(o*g-h*v)-n*(s*g-r*v)+f*(s*h-r*o)),e*(o*d-h*c)-n*(s*d-r*c)+l*(s*h-r*o),n*(u*g-d*p)-l*(a*g-h*p)+f*(a*d-h*u),-(e*(u*g-d*p)-l*(i*g-r*p)+f*(i*d-r*u)),e*(a*g-h*p)-n*(i*g-r*p)+f*(i*h-r*a),-(e*(a*d-h*u)-n*(i*d-r*u)+l*(i*h-r*a)),-(n*(u*v-c*p)-l*(a*v-o*p)+f*(a*c-o*u)),e*(u*v-c*p)-l*(i*v-s*p)+f*(i*c-s*u),-(e*(a*v-o*p)-n*(i*v-s*p)+f*(i*o-s*a)),e*(a*c-o*u)-n*(i*c-s*u)+l*(i*o-s*a))},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],v=t[14],g=t[15];return(e*a-i*n)*(c*g-d*v)-(e*o-s*n)*(u*g-d*p)+(e*h-r*n)*(u*v-c*p)+(i*o-s*a)*(l*g-d*f)-(i*h-r*a)*(l*v-c*f)+(s*h-r*o)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],s=e[1],r=e[2],n=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],p=e[12],v=e[13],g=e[14],m=e[15],y=t.val,x=y[0],T=y[1],w=y[2],E=y[3];return e[0]=x*i+T*a+w*u+E*p,e[1]=x*s+T*o+w*c+E*v,e[2]=x*r+T*h+w*d+E*g,e[3]=x*n+T*l+w*f+E*m,x=y[4],T=y[5],w=y[6],E=y[7],e[4]=x*i+T*a+w*u+E*p,e[5]=x*s+T*o+w*c+E*v,e[6]=x*r+T*h+w*d+E*g,e[7]=x*n+T*l+w*f+E*m,x=y[8],T=y[9],w=y[10],E=y[11],e[8]=x*i+T*a+w*u+E*p,e[9]=x*s+T*o+w*c+E*v,e[10]=x*r+T*h+w*d+E*g,e[11]=x*n+T*l+w*f+E*m,x=y[12],T=y[13],w=y[14],E=y[15],e[12]=x*i+T*a+w*u+E*p,e[13]=x*s+T*o+w*c+E*v,e[14]=x*r+T*h+w*d+E*g,e[15]=x*n+T*l+w*f+E*m,this},multiplyLocal:function(t){var e=this.val,i=t.val;return this.setValues(e[0]*i[0]+e[1]*i[4]+e[2]*i[8]+e[3]*i[12],e[0]*i[1]+e[1]*i[5]+e[2]*i[9]+e[3]*i[13],e[0]*i[2]+e[1]*i[6]+e[2]*i[10]+e[3]*i[14],e[0]*i[3]+e[1]*i[7]+e[2]*i[11]+e[3]*i[15],e[4]*i[0]+e[5]*i[4]+e[6]*i[8]+e[7]*i[12],e[4]*i[1]+e[5]*i[5]+e[6]*i[9]+e[7]*i[13],e[4]*i[2]+e[5]*i[6]+e[6]*i[10]+e[7]*i[14],e[4]*i[3]+e[5]*i[7]+e[6]*i[11]+e[7]*i[15],e[8]*i[0]+e[9]*i[4]+e[10]*i[8]+e[11]*i[12],e[8]*i[1]+e[9]*i[5]+e[10]*i[9]+e[11]*i[13],e[8]*i[2]+e[9]*i[6]+e[10]*i[10]+e[11]*i[14],e[8]*i[3]+e[9]*i[7]+e[10]*i[11]+e[11]*i[15],e[12]*i[0]+e[13]*i[4]+e[14]*i[8]+e[15]*i[12],e[12]*i[1]+e[13]*i[5]+e[14]*i[9]+e[15]*i[13],e[12]*i[2]+e[13]*i[6]+e[14]*i[10]+e[15]*i[14],e[12]*i[3]+e[13]*i[7]+e[14]*i[11]+e[15]*i[15])},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.val,s=e.val,r=i[0],n=i[4],a=i[8],o=i[12],h=i[1],l=i[5],u=i[9],c=i[13],d=i[2],f=i[6],p=i[10],v=i[14],g=i[3],m=i[7],y=i[11],x=i[15],T=s[0],w=s[4],E=s[8],b=s[12],S=s[1],A=s[5],_=s[9],C=s[13],R=s[2],M=s[6],P=s[10],O=s[14],L=s[3],F=s[7],D=s[11],k=s[15];return this.setValues(r*T+n*S+a*R+o*L,h*T+l*S+u*R+c*L,d*T+f*S+p*R+v*L,g*T+m*S+y*R+x*L,r*w+n*A+a*M+o*F,h*w+l*A+u*M+c*F,d*w+f*A+p*M+v*F,g*w+m*A+y*M+x*F,r*E+n*_+a*P+o*D,h*E+l*_+u*P+c*D,d*E+f*_+p*P+v*D,g*E+m*_+y*P+x*D,r*b+n*C+a*O+o*k,h*b+l*C+u*O+c*k,d*b+f*C+p*O+v*k,g*b+m*C+y*O+x*k)},translate:function(t){return this.translateXYZ(t.x,t.y,t.z)},translateXYZ:function(t,e,i){var s=this.val;return s[12]=s[0]*t+s[4]*e+s[8]*i+s[12],s[13]=s[1]*t+s[5]*e+s[9]*i+s[13],s[14]=s[2]*t+s[6]*e+s[10]*i+s[14],s[15]=s[3]*t+s[7]*e+s[11]*i+s[15],this},scale:function(t){return this.scaleXYZ(t.x,t.y,t.z)},scaleXYZ:function(t,e,i){var s=this.val;return s[0]=s[0]*t,s[1]=s[1]*t,s[2]=s[2]*t,s[3]=s[3]*t,s[4]=s[4]*e,s[5]=s[5]*e,s[6]=s[6]*e,s[7]=s[7]*e,s[8]=s[8]*i,s[9]=s[9]*i,s[10]=s[10]*i,s[11]=s[11]*i,this},makeRotationAxis:function(t,e){var i=Math.cos(e),s=Math.sin(e),r=1-i,n=t.x,a=t.y,o=t.z,h=r*n,l=r*a;return this.setValues(h*n+i,h*a-s*o,h*o+s*a,0,h*a+s*o,l*a+i,l*o-s*n,0,h*o-s*a,l*o+s*n,r*o*o+i,0,0,0,0,1)},rotate:function(t,e){var i=this.val,s=e.x,r=e.y,a=e.z,o=Math.sqrt(s*s+r*r+a*a);if(Math.abs(o){t.exports=function(t,e,i){return Math.min(t+e,i)}},37394:t=>{t.exports=function(t){var e=t.length;if(0===e)return 0;t.sort((function(t,e){return t-e}));var i=Math.floor(e/2);return e%2==0?(t[i]+t[i-1])/2:t[i]}},17259:t=>{t.exports=function(t,e,i){return Math.max(t-e,i)}},61820:t=>{t.exports=function(t,e,i,s){void 0===i&&(i=e+1);var r=(t-e)/(i-e);return r>1?void 0!==s?(r=(s-t)/(s-i))<0&&(r=0):r=1:r<0&&(r=0),r}},75003:(t,e,i)=>{var s=i(56694),r=i(5341),n=i(72283),a=i(70015),o=1e-6,h=new Int8Array([1,2,0]),l=new Float32Array([0,0,0]),u=new a(1,0,0),c=new a(0,1,0),d=new a,f=new r,p=new s({initialize:function(t,e,i,s){this.onChangeCallback=n,this.set(t,e,i,s)},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback(this)}},copy:function(t){return this.set(t)},set:function(t,e,i,s,r){return void 0===r&&(r=!0),"object"==typeof t?(this._x=t.x||0,this._y=t.y||0,this._z=t.z||0,this._w=t.w||0):(this._x=t||0,this._y=e||0,this._z=i||0,this._w=s||0),r&&this.onChangeCallback(this),this},add:function(t){return this._x+=t.x,this._y+=t.y,this._z+=t.z,this._w+=t.w,this.onChangeCallback(this),this},subtract:function(t){return this._x-=t.x,this._y-=t.y,this._z-=t.z,this._w-=t.w,this.onChangeCallback(this),this},scale:function(t){return this._x*=t,this._y*=t,this._z*=t,this._w*=t,this.onChangeCallback(this),this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,r=t*t+e*e+i*i+s*s;return r>0&&(r=1/Math.sqrt(r),this._x=t*r,this._y=e*r,this._z=i*r,this._w=s*r),this.onChangeCallback(this),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,r=this.z,n=this.w;return this.set(i+e*(t.x-i),s+e*(t.y-s),r+e*(t.z-r),n+e*(t.w-n))},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(d.copy(u).cross(t).length().999999?this.set(0,0,0,1):(d.copy(t).cross(e),this._x=d.x,this._y=d.y,this._z=d.z,this._w=1+i,this.normalize())},setAxes:function(t,e,i){var s=f.val;return s[0]=e.x,s[3]=e.y,s[6]=e.z,s[1]=i.x,s[4]=i.y,s[7]=i.z,s[2]=-t.x,s[5]=-t.y,s[8]=-t.z,this.fromMat3(f).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.set(i*t.x,i*t.y,i*t.z,Math.cos(e))},multiply:function(t){var e=this.x,i=this.y,s=this.z,r=this.w,n=t.x,a=t.y,o=t.z,h=t.w;return this.set(e*h+r*n+i*o-s*a,i*h+r*a+s*n-e*o,s*h+r*o+e*a-i*n,r*h-e*n-i*a-s*o)},slerp:function(t,e){var i=this.x,s=this.y,r=this.z,n=this.w,a=t.x,h=t.y,l=t.z,u=t.w,c=i*a+s*h+r*l+n*u;c<0&&(c=-c,a=-a,h=-h,l=-l,u=-u);var d=1-e,f=e;if(1-c>o){var p=Math.acos(c),v=Math.sin(p);d=Math.sin((1-e)*p)/v,f=Math.sin(e*p)/v}return this.set(d*i+f*a,d*s+f*h,d*r+f*l,d*n+f*u)},invert:function(){var t=this.x,e=this.y,i=this.z,s=this.w,r=t*t+e*e+i*i+s*s,n=r?1/r:0;return this.set(-t*n,-e*n,-i*n,s*n)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,r=this.w,n=Math.sin(t),a=Math.cos(t);return this.set(e*a+r*n,i*a+s*n,s*a-i*n,r*a-e*n)},rotateY:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,r=this.w,n=Math.sin(t),a=Math.cos(t);return this.set(e*a-s*n,i*a+r*n,s*a+e*n,r*a-i*n)},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,r=this.w,n=Math.sin(t),a=Math.cos(t);return this.set(e*a+i*n,i*a-e*n,s*a+r*n,r*a-s*n)},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},setFromEuler:function(t,e){var i=t.x/2,s=t.y/2,r=t.z/2,n=Math.cos(i),a=Math.cos(s),o=Math.cos(r),h=Math.sin(i),l=Math.sin(s),u=Math.sin(r);switch(t.order){case"XYZ":this.set(h*a*o+n*l*u,n*l*o-h*a*u,n*a*u+h*l*o,n*a*o-h*l*u,e);break;case"YXZ":this.set(h*a*o+n*l*u,n*l*o-h*a*u,n*a*u-h*l*o,n*a*o+h*l*u,e);break;case"ZXY":this.set(h*a*o-n*l*u,n*l*o+h*a*u,n*a*u+h*l*o,n*a*o-h*l*u,e);break;case"ZYX":this.set(h*a*o-n*l*u,n*l*o+h*a*u,n*a*u-h*l*o,n*a*o+h*l*u,e);break;case"YZX":this.set(h*a*o+n*l*u,n*l*o+h*a*u,n*a*u-h*l*o,n*a*o-h*l*u,e);break;case"XZY":this.set(h*a*o-n*l*u,n*l*o-h*a*u,n*a*u+h*l*o,n*a*o+h*l*u,e)}return this},setFromRotationMatrix:function(t){var e,i=t.val,s=i[0],r=i[4],n=i[8],a=i[1],o=i[5],h=i[9],l=i[2],u=i[6],c=i[10],d=s+o+c;return d>0?(e=.5/Math.sqrt(d+1),this.set((u-h)*e,(n-l)*e,(a-r)*e,.25/e)):s>o&&s>c?(e=2*Math.sqrt(1+s-o-c),this.set(.25*e,(r+a)/e,(n+l)/e,(u-h)/e)):o>c?(e=2*Math.sqrt(1+o-s-c),this.set((r+a)/e,.25*e,(h+u)/e,(n-l)/e)):(e=2*Math.sqrt(1+c-s-o),this.set((n+l)/e,(h+u)/e,.25*e,(a-r)/e)),this},fromMat3:function(t){var e,i=t.val,s=i[0]+i[4]+i[8];if(s>0)e=Math.sqrt(s+1),this.w=.5*e,e=.5/e,this._x=(i[7]-i[5])*e,this._y=(i[2]-i[6])*e,this._z=(i[3]-i[1])*e;else{var r=0;i[4]>i[0]&&(r=1),i[8]>i[3*r+r]&&(r=2);var n=h[r],a=h[n];e=Math.sqrt(i[3*r+r]-i[3*n+n]-i[3*a+a]+1),l[r]=.5*e,e=.5/e,l[n]=(i[3*n+r]+i[3*r+n])*e,l[a]=(i[3*a+r]+i[3*r+a])*e,this._x=l[0],this._y=l[1],this._z=l[2],this._w=(i[3*a+n]-i[3*n+a])*e}return this.onChangeCallback(this),this}});t.exports=p},23701:(t,e,i)=>{var s=i(83392);t.exports=function(t){return t*s.RAD_TO_DEG}},16906:t=>{t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},52417:t=>{t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,s=2*Math.random()-1,r=Math.sqrt(1-s*s)*e;return t.x=Math.cos(i)*r,t.y=Math.sin(i)*r,t.z=s*e,t}},17915:t=>{t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},52257:t=>{t.exports=function(t,e){var i=t.x,s=t.y;return t.x=i*Math.cos(e)-s*Math.sin(e),t.y=i*Math.sin(e)+s*Math.cos(e),t}},2386:t=>{t.exports=function(t,e,i,s){var r=Math.cos(s),n=Math.sin(s),a=t.x-e,o=t.y-i;return t.x=a*r-o*n+e,t.y=a*n+o*r+i,t}},72395:t=>{t.exports=function(t,e,i,s,r){var n=s+Math.atan2(t.y-i,t.x-e);return t.x=e+r*Math.cos(n),t.y=i+r*Math.sin(n),t}},41061:t=>{t.exports=function(t,e,i,s,r){return t.x=e+r*Math.cos(s),t.y=i+r*Math.sin(s),t}},93709:(t,e,i)=>{var s=i(70015),r=i(16650),n=i(75003),a=new r,o=new n,h=new s;t.exports=function(t,e,i){return o.setAxisAngle(e,i),a.fromRotationTranslation(o,h.set(0,0,0)),t.transformMat4(a)}},67233:t=>{t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},64333:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.round(t*s)/s}},59533:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=1),void 0===i&&(i=1),void 0===s&&(s=1),s*=Math.PI/t;for(var r=[],n=[],a=0;a{t.exports=function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},87736:t=>{t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},55805:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,r){void 0===r&&(r=new s);var n=0,a=0;return t>0&&t<=e*i&&(n=t>e-1?t-(a=Math.floor(t/e))*e:t),r.set(n,a)}},64462:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,r,n,a,o,h){void 0===h&&(h=new s);var l=Math.sin(n),u=Math.cos(n),c=u*a,d=l*a,f=-l*o,p=u*o,v=1/(c*p+f*-d);return h.x=p*v*t+-f*v*e+(r*f-i*p)*v,h.y=c*v*e+-d*v*t+(-r*c+i*d)*v,h}},93736:(t,e,i)=>{var s=i(56694),r=i(88456),n=new s({initialize:function(t,e){this.x=0,this.y=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0):(void 0===e&&(e=t),this.x=t||0,this.y=e||0)},clone:function(){return new n(this.x,this.y)},copy:function(t){return this.x=t.x||0,this.y=t.y||0,this},setFromObject:function(t){return this.x=t.x||0,this.y=t.y||0,this},set:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setTo:function(t,e){return this.set(t,e)},setToPolar:function(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this},equals:function(t){return this.x===t.x&&this.y===t.y},fuzzyEquals:function(t,e){return r(this.x,t.x,e)&&r(this.y,t.y,e)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},setAngle:function(t){return this.setToPolar(t,this.length())},add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},length:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},setLength:function(t){return this.normalize().scale(t)},lengthSq:function(){var t=this.x,e=this.y;return t*t+e*e},normalize:function(){var t=this.x,e=this.y,i=t*t+e*e;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},normalizeLeftHand:function(){var t=this.x;return this.x=this.y,this.y=-1*t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this},transformMat3:function(t){var e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[3]*i+s[6],this.y=s[1]*e+s[4]*i+s[7],this},transformMat4:function(t){var e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[4]*i+s[12],this.y=s[1]*e+s[5]*i+s[13],this},reset:function(){return this.x=0,this.y=0,this},limit:function(t){var e=this.length();return e&&e>t&&this.scale(t/e),this},reflect:function(t){return t=t.clone().normalize(),this.subtract(t.scale(2*this.dot(t)))},mirror:function(t){return this.reflect(t).negate()},rotate:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e*this.x-i*this.y,i*this.x+e*this.y)}});n.ZERO=new n,n.RIGHT=new n(1,0),n.LEFT=new n(-1,0),n.UP=new n(0,-1),n.DOWN=new n(0,1),n.ONE=new n(1,1),t.exports=n},70015:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clone:function(){return new s(this.x,this.y,this.z)},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},crossVectors:function(t,e){var i=t.x,s=t.y,r=t.z,n=e.x,a=e.y,o=e.z;return this.x=s*o-r*a,this.y=r*n-i*o,this.z=i*a-s*n,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},setFromMatrixPosition:function(t){return this.fromArray(t.val,12)},setFromMatrixColumn:function(t,e){return this.fromArray(t.val,4*e)},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addScale:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return Math.sqrt(e*e+i*i+s*s)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return e*e+i*i+s*s},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,s=t*t+e*e+i*i;return s>0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,s=this.z,r=t.x,n=t.y,a=t.z;return this.x=i*a-s*n,this.y=s*r-e*a,this.z=e*n-i*r,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,r=this.z;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=r+e*(t.z-r),this},applyMatrix3:function(t){var e=this.x,i=this.y,s=this.z,r=t.val;return this.x=r[0]*e+r[3]*i+r[6]*s,this.y=r[1]*e+r[4]*i+r[7]*s,this.z=r[2]*e+r[5]*i+r[8]*s,this},applyMatrix4:function(t){var e=this.x,i=this.y,s=this.z,r=t.val,n=1/(r[3]*e+r[7]*i+r[11]*s+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*s+r[12])*n,this.y=(r[1]*e+r[5]*i+r[9]*s+r[13])*n,this.z=(r[2]*e+r[6]*i+r[10]*s+r[14])*n,this},transformMat3:function(t){var e=this.x,i=this.y,s=this.z,r=t.val;return this.x=e*r[0]+i*r[3]+s*r[6],this.y=e*r[1]+i*r[4]+s*r[7],this.z=e*r[2]+i*r[5]+s*r[8],this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*s+r[12],this.y=r[1]*e+r[5]*i+r[9]*s+r[13],this.z=r[2]*e+r[6]*i+r[10]*s+r[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,s=this.z,r=t.val,n=e*r[0]+i*r[4]+s*r[8]+r[12],a=e*r[1]+i*r[5]+s*r[9]+r[13],o=e*r[2]+i*r[6]+s*r[10]+r[14],h=e*r[3]+i*r[7]+s*r[11]+r[15];return this.x=n/h,this.y=a/h,this.z=o/h,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,r=t.x,n=t.y,a=t.z,o=t.w,h=o*e+n*s-a*i,l=o*i+a*e-r*s,u=o*s+r*i-n*e,c=-r*e-n*i-a*s;return this.x=h*o+c*-r+l*-a-u*-n,this.y=l*o+c*-n+u*-r-h*-a,this.z=u*o+c*-a+h*-n-l*-r,this},project:function(t){var e=this.x,i=this.y,s=this.z,r=t.val,n=r[0],a=r[1],o=r[2],h=r[3],l=r[4],u=r[5],c=r[6],d=r[7],f=r[8],p=r[9],v=r[10],g=r[11],m=r[12],y=r[13],x=r[14],T=1/(e*h+i*d+s*g+r[15]);return this.x=(e*n+i*l+s*f+m)*T,this.y=(e*a+i*u+s*p+y)*T,this.z=(e*o+i*c+s*v+x)*T,this},projectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unprojectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unproject:function(t,e){var i=t.x,s=t.y,r=t.z,n=t.w,a=this.x-i,o=n-this.y-1-s,h=this.z;return this.x=2*a/r-1,this.y=2*o/n-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});s.ZERO=new s,s.RIGHT=new s(1,0,0),s.LEFT=new s(-1,0,0),s.UP=new s(0,-1,0),s.DOWN=new s(0,1,0),s.FORWARD=new s(0,0,1),s.BACK=new s(0,0,-1),s.ONE=new s(1,1,1),t.exports=s},51729:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0)},clone:function(){return new s(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,s){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,r=t*t+e*e+i*i+s*s;return r>0&&(r=1/Math.sqrt(r),this.x=t*r,this.y=e*r,this.z=i*r,this.w=s*r),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,r=this.z,n=this.w;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=r+e*(t.z-r),this.w=n+e*(t.w-n),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,r=t.w-this.w||0;return Math.sqrt(e*e+i*i+s*s+r*r)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,r=t.w-this.w||0;return e*e+i*i+s*s+r*r},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,r=this.w,n=t.val;return this.x=n[0]*e+n[4]*i+n[8]*s+n[12]*r,this.y=n[1]*e+n[5]*i+n[9]*s+n[13]*r,this.z=n[2]*e+n[6]*i+n[10]*s+n[14]*r,this.w=n[3]*e+n[7]*i+n[11]*s+n[15]*r,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,r=t.x,n=t.y,a=t.z,o=t.w,h=o*e+n*s-a*i,l=o*i+a*e-r*s,u=o*s+r*i-n*e,c=-r*e-n*i-a*s;return this.x=h*o+c*-r+l*-a-u*-n,this.y=l*o+c*-n+u*-r-h*-a,this.z=u*o+c*-a+h*-n-l*-r,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});s.prototype.sub=s.prototype.subtract,s.prototype.mul=s.prototype.multiply,s.prototype.div=s.prototype.divide,s.prototype.dist=s.prototype.distance,s.prototype.distSq=s.prototype.distanceSq,s.prototype.len=s.prototype.length,s.prototype.lenSq=s.prototype.lengthSq,t.exports=s},9557:t=>{t.exports=function(t,e,i){return Math.abs(t-e)<=i}},1071:t=>{t.exports=function(t,e,i){var s=i-e;return e+((t-e)%s+s)%s}},90447:t=>{t.exports=function(t,e,i,s){return Math.atan2(s-e,i-t)}},94240:t=>{t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},84066:t=>{t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},9678:t=>{t.exports=function(t,e,i,s){return Math.atan2(i-t,s-e)}},76861:(t,e,i)=>{var s=i(83392);t.exports=function(t){return t>Math.PI&&(t-=s.PI2),Math.abs(((t+s.TAU)%s.PI2-s.PI2)%s.PI2)}},37570:t=>{t.exports=function(t){return(t%=2*Math.PI)>=0?t:t+2*Math.PI}},87597:(t,e,i)=>{var s=i(61616);t.exports=function(){return s(-Math.PI,Math.PI)}},74493:(t,e,i)=>{var s=i(61616);t.exports=function(){return s(-180,180)}},19049:(t,e,i)=>{var s=i(37570);t.exports=function(t){return s(t+Math.PI)}},90612:(t,e,i)=>{var s=i(83392);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=s.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e{t.exports=function(t,e){var i=e-t;return 0===i?0:i-360*Math.floor((i- -180)/360)}},35786:(t,e,i)=>{var s=i(1071);t.exports=function(t){return s(t,-Math.PI,Math.PI)}},62138:(t,e,i)=>{var s=i(1071);t.exports=function(t){return s(t,-180,180)}},22153:(t,e,i)=>{t.exports={Between:i(90447),BetweenPoints:i(94240),BetweenPointsY:i(84066),BetweenY:i(9678),CounterClockwise:i(76861),Normalize:i(37570),Random:i(87597),RandomDegrees:i(74493),Reverse:i(19049),RotateTo:i(90612),ShortestBetween:i(93954),Wrap:i(35786),WrapDegrees:i(62138)}},83392:t=>{var e={PI2:2*Math.PI,TAU:.5*Math.PI,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:null,MIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER||-9007199254740991,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991};t.exports=e},53996:t=>{t.exports=function(t,e,i,s){var r=t-i,n=e-s;return Math.sqrt(r*r+n*n)}},92951:t=>{t.exports=function(t,e){var i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)}},12161:t=>{t.exports=function(t,e){var i=t.x-e.x,s=t.y-e.y;return i*i+s*s}},38057:t=>{t.exports=function(t,e,i,s){return Math.max(Math.abs(t-i),Math.abs(e-s))}},33297:t=>{t.exports=function(t,e,i,s,r){return void 0===r&&(r=2),Math.sqrt(Math.pow(i-t,r)+Math.pow(s-e,r))}},90366:t=>{t.exports=function(t,e,i,s){return Math.abs(t-i)+Math.abs(e-s)}},35032:t=>{t.exports=function(t,e,i,s){var r=t-i,n=e-s;return r*r+n*n}},10130:(t,e,i)=>{t.exports={Between:i(53996),BetweenPoints:i(92951),BetweenPointsSquared:i(12161),Chebyshev:i(38057),Power:i(33297),Snake:i(90366),Squared:i(35032)}},35060:(t,e,i)=>{var s=i(25265),r=i(57428),n=i(73214),a=i(71778),o=i(36468),h=i(88258),l=i(52910),u=i(67799),c=i(74083),d=i(92284),f=i(28035),p=i(8754);t.exports={Power0:l,Power1:u.Out,Power2:a.Out,Power3:c.Out,Power4:d.Out,Linear:l,Quad:u.Out,Cubic:a.Out,Quart:c.Out,Quint:d.Out,Sine:f.Out,Expo:h.Out,Circ:n.Out,Elastic:o.Out,Back:s.Out,Bounce:r.Out,Stepped:p,"Quad.easeIn":u.In,"Cubic.easeIn":a.In,"Quart.easeIn":c.In,"Quint.easeIn":d.In,"Sine.easeIn":f.In,"Expo.easeIn":h.In,"Circ.easeIn":n.In,"Elastic.easeIn":o.In,"Back.easeIn":s.In,"Bounce.easeIn":r.In,"Quad.easeOut":u.Out,"Cubic.easeOut":a.Out,"Quart.easeOut":c.Out,"Quint.easeOut":d.Out,"Sine.easeOut":f.Out,"Expo.easeOut":h.Out,"Circ.easeOut":n.Out,"Elastic.easeOut":o.Out,"Back.easeOut":s.Out,"Bounce.easeOut":r.Out,"Quad.easeInOut":u.InOut,"Cubic.easeInOut":a.InOut,"Quart.easeInOut":c.InOut,"Quint.easeInOut":d.InOut,"Sine.easeInOut":f.InOut,"Expo.easeInOut":h.InOut,"Circ.easeInOut":n.InOut,"Elastic.easeInOut":o.InOut,"Back.easeInOut":s.InOut,"Bounce.easeInOut":r.InOut}},25860:t=>{t.exports=function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)}},45264:t=>{t.exports=function(t,e){void 0===e&&(e=1.70158);var i=1.525*e;return(t*=2)<1?t*t*((i+1)*t-i)*.5:.5*((t-=2)*t*((i+1)*t+i)+2)}},36699:t=>{t.exports=function(t,e){return void 0===e&&(e=1.70158),--t*t*((e+1)*t+e)+1}},25265:(t,e,i)=>{t.exports={In:i(25860),Out:i(36699),InOut:i(45264)}},62191:t=>{t.exports=function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}},24799:t=>{t.exports=function(t){var e=!1;return t<.5?(t=1-2*t,e=!0):t=2*t-1,t<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5}},60819:t=>{t.exports=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},57428:(t,e,i)=>{t.exports={In:i(62191),Out:i(60819),InOut:i(24799)}},86855:t=>{t.exports=function(t){return 1-Math.sqrt(1-t*t)}},7280:t=>{t.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},18058:t=>{t.exports=function(t){return Math.sqrt(1- --t*t)}},73214:(t,e,i)=>{t.exports={In:i(86855),Out:i(18058),InOut:i(7280)}},91532:t=>{t.exports=function(t){return t*t*t}},63180:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},16518:t=>{t.exports=function(t){return--t*t*t+1}},71778:(t,e,i)=>{t.exports={In:i(91532),Out:i(16518),InOut:i(63180)}},24729:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)}},50325:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)*.5+1}},84074:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-s)*(2*Math.PI)/i)+1}},36468:(t,e,i)=>{t.exports={In:i(24729),Out:i(84074),InOut:i(50325)}},95638:t=>{t.exports=function(t){return Math.pow(2,10*(t-1))-.001}},10357:t=>{t.exports=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))}},14894:t=>{t.exports=function(t){return 1-Math.pow(2,-10*t)}},88258:(t,e,i)=>{t.exports={In:i(95638),Out:i(14894),InOut:i(10357)}},33063:(t,e,i)=>{t.exports={Back:i(25265),Bounce:i(57428),Circular:i(73214),Cubic:i(71778),Elastic:i(36468),Expo:i(88258),Linear:i(52910),Quadratic:i(67799),Quartic:i(74083),Quintic:i(92284),Sine:i(28035),Stepped:i(8754)}},43927:t=>{t.exports=function(t){return t}},52910:(t,e,i)=>{t.exports=i(43927)},77471:t=>{t.exports=function(t){return t*t}},83863:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},44383:t=>{t.exports=function(t){return t*(2-t)}},67799:(t,e,i)=>{t.exports={In:i(77471),Out:i(44383),InOut:i(83863)}},48311:t=>{t.exports=function(t){return t*t*t*t}},55248:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},23135:t=>{t.exports=function(t){return 1- --t*t*t*t}},74083:(t,e,i)=>{t.exports={In:i(48311),Out:i(23135),InOut:i(55248)}},7313:t=>{t.exports=function(t){return t*t*t*t*t}},98759:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},26670:t=>{t.exports=function(t){return--t*t*t*t*t+1}},92284:(t,e,i)=>{t.exports={In:i(7313),Out:i(26670),InOut:i(98759)}},52929:t=>{t.exports=function(t){return 0===t?0:1===t?1:1-Math.cos(t*Math.PI/2)}},66333:t=>{t.exports=function(t){return 0===t?0:1===t?1:.5*(1-Math.cos(Math.PI*t))}},37255:t=>{t.exports=function(t){return 0===t?0:1===t?1:Math.sin(t*Math.PI/2)}},28035:(t,e,i)=>{t.exports={In:i(52929),Out:i(37255),InOut:i(66333)}},52770:t=>{t.exports=function(t,e){return void 0===e&&(e=1),t<=0?0:t>=1?1:1/e*(1+(e*t|0))}},8754:(t,e,i)=>{t.exports=i(52770)},17247:t=>{t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},88456:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.floor(t+e)}},41935:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t>e-i}},54726:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t{t.exports={Ceil:i(17247),Equal:i(88456),Floor:i(61824),GreaterThan:i(41935),LessThan:i(54726)}},5923:(t,e,i)=>{var s=i(83392),r=i(98611),n={Angle:i(22153),Distance:i(10130),Easing:i(33063),Fuzzy:i(52778),Interpolation:i(48528),Pow2:i(73773),Snap:i(23679),RandomDataGenerator:i(81429),Average:i(26042),Bernstein:i(22824),Between:i(17489),CatmullRom:i(14976),CeilTo:i(89129),Clamp:i(82897),DegToRad:i(75606),Difference:i(767),Euler:i(9849),Factorial:i(8034),FloatBetween:i(61616),FloorTo:i(60679),FromPercent:i(91806),GetSpeed:i(79366),IsEven:i(43776),IsEvenStrict:i(58442),Linear:i(42798),MaxAdd:i(69635),Median:i(37394),MinSub:i(17259),Percent:i(61820),RadToDeg:i(23701),RandomXY:i(16906),RandomXYZ:i(52417),RandomXYZW:i(17915),Rotate:i(52257),RotateAround:i(2386),RotateAroundDistance:i(72395),RotateTo:i(41061),RoundAwayFromZero:i(67233),RoundTo:i(64333),SinCosTableGenerator:i(59533),SmootherStep:i(87736),SmoothStep:i(5514),ToXY:i(55805),TransformXY:i(64462),Within:i(9557),Wrap:i(1071),Vector2:i(93736),Vector3:i(70015),Vector4:i(51729),Matrix3:i(5341),Matrix4:i(16650),Quaternion:i(75003),RotateVec3:i(93709)};n=r(!1,n,s),t.exports=n},63210:(t,e,i)=>{var s=i(22824);t.exports=function(t,e){for(var i=0,r=t.length-1,n=0;n<=r;n++)i+=Math.pow(1-e,r-n)*Math.pow(e,n)*t[n]*s(r,n);return i}},88332:(t,e,i)=>{var s=i(14976);t.exports=function(t,e){var i=t.length-1,r=i*e,n=Math.floor(r);return t[0]===t[i]?(e<0&&(n=Math.floor(r=i*(1+e))),s(r-n,t[(n-1+i)%i],t[n],t[(n+1)%i],t[(n+2)%i])):e<0?t[0]-(s(-r,t[0],t[0],t[1],t[1])-t[0]):e>1?t[i]-(s(r-i,t[i],t[i],t[i-1],t[i-1])-t[i]):s(r-n,t[n?n-1:0],t[n],t[i{t.exports=function(t,e,i,s,r){return function(t,e){var i=1-t;return i*i*i*e}(t,e)+function(t,e){var i=1-t;return 3*i*i*t*e}(t,i)+function(t,e){return 3*(1-t)*t*t*e}(t,s)+function(t,e){return t*t*t*e}(t,r)}},47614:(t,e,i)=>{var s=i(42798);t.exports=function(t,e){var i=t.length-1,r=i*e,n=Math.floor(r);return e<0?s(t[0],t[1],r):e>1?s(t[i],t[i-1],i-r):s(t[n],t[n+1>i?i:n+1],r-n)}},16252:t=>{t.exports=function(t,e,i,s){return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,s)}},44521:(t,e,i)=>{var s=i(5514);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},45507:(t,e,i)=>{var s=i(87736);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},48528:(t,e,i)=>{t.exports={Bezier:i(63210),CatmullRom:i(88332),CubicBezier:i(34631),Linear:i(47614),QuadraticBezier:i(16252),SmoothStep:i(44521),SmootherStep:i(45507)}},3504:t=>{t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<{t.exports=function(t,e){return t>0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},2018:t=>{t.exports=function(t){return t>0&&0==(t&t-1)}},73773:(t,e,i)=>{t.exports={GetNext:i(3504),IsSize:i(28621),IsValue:i(2018)}},81429:(t,e,i)=>{var s=new(i(56694))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,i=this.n;t=t.toString();for(var s=0;s>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e0;e--){var i=Math.floor(this.frac()*(e+1)),s=t[i];t[i]=t[e],t[e]=s}return t}});t.exports=s},82127:t=>{t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),s?(i+t)/e:i+t)}},84314:t=>{t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),s?(i+t)/e:i+t)}},88462:t=>{t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),s?(i+t)/e:i+t)}},23679:(t,e,i)=>{t.exports={Ceil:i(82127),Floor:i(84314),To:i(88462)}},85780:(t,e,i)=>{var s=i(86459),r=i(98611),n={Actions:i(83979),Animations:i(13517),BlendModes:i(95723),Cache:i(45820),Cameras:i(44143),Core:i(80293),Class:i(56694),Create:i(84106),Curves:i(73962),Data:i(1999),Display:i(24816),DOM:i(3590),Events:i(95146),Game:i(15213),GameObjects:i(48013),Geom:i(84068),Input:i(20873),Loader:i(95695),Math:i(5923),Physics:{Arcade:i(39977)},Plugins:i(45615),Renderer:i(42069),Scale:i(86754),ScaleModes:i(27394),Scene:i(87157),Scenes:i(20436),Structs:i(20010),Textures:i(87499),Tilemaps:i(52678),Time:i(97121),Tweens:i(75193),Utils:i(22178)};n.Sound=i(56751),n=r(!1,n,s),t.exports=n,i.g.Phaser=n},62832:(t,e,i)=>{var s=i(56694),r=i(7864),n=i(1539),a=new s({Extends:n,Mixins:[r.Acceleration,r.Angular,r.Bounce,r.Debug,r.Drag,r.Enable,r.Friction,r.Gravity,r.Immovable,r.Mass,r.Pushable,r.Size,r.Velocity],initialize:function(t,e,i,s,r){n.call(this,t,e,i,s,r),this.body=null}});t.exports=a},66150:(t,e,i)=>{var s=i(56694),r=i(75606),n=i(53996),a=i(35032),o=i(99523),h=i(72632),l=i(30657),u=i(2732),c=i(15147),d=i(91963),f=i(7599),p=i(93736),v=i(85233),g=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,t.sys.events.once(f.BOOT,this.boot,this),t.sys.events.on(f.START,this.start,this)},boot:function(){this.world=new v(this.scene,this.config),this.add=new o(this.world),this.systems.events.once(f.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new v(this.scene,this.config),this.add=new o(this.world));var t=this.systems.events;h(this.config,"customUpdate",!1)||t.on(f.UPDATE,this.world.update,this.world),t.on(f.POST_UPDATE,this.world.postUpdate,this.world),t.once(f.SHUTDOWN,this.shutdown,this)},enableUpdate:function(){this.systems.events.on(f.UPDATE,this.world.update,this.world)},disableUpdate:function(){this.systems.events.off(f.UPDATE,this.world.update,this.world)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return l(h(e,"arcade",{}),h(t,"arcade",{}))},overlap:function(t,e,i,s,r){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===r&&(r=i),this.world.collideObjects(t,e,i,s,r,!0)},collide:function(t,e,i,s,r){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===r&&(r=i),this.world.collideObjects(t,e,i,s,r,!1)},collideTiles:function(t,e,i,s,r){return this.world.collideTiles(t,e,i,s,r)},overlapTiles:function(t,e,i,s,r){return this.world.overlapTiles(t,e,i,s,r)},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},accelerateTo:function(t,e,i,s,r,n){void 0===s&&(s=60);var a=Math.atan2(i-t.y,e-t.x);return t.body.acceleration.setToPolar(a,s),void 0!==r&&void 0!==n&&t.body.maxVelocity.set(r,n),a},accelerateToObject:function(t,e,i,s,r){return this.accelerateTo(t,e.x,e.y,i,s,r)},closest:function(t,e){e||(e=this.world.bodies.entries);for(var i=Number.MAX_VALUE,s=null,r=t.x,n=t.y,o=e.length,h=0;hi&&(s=l,i=c)}}return s},moveTo:function(t,e,i,s,r){void 0===s&&(s=60),void 0===r&&(r=0);var a=Math.atan2(i-t.y,e-t.x);return r>0&&(s=n(t.x,t.y,e,i)/(r/1e3)),t.body.velocity.setToPolar(a,s),a},moveToObject:function(t,e,i,s){return this.moveTo(t,e.x,e.y,i,s)},velocityFromAngle:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new p),i.setToPolar(r(t),e)},velocityFromRotation:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new p),i.setToPolar(t,e)},overlapRect:function(t,e,i,s,r,n){return c(this.world,t,e,i,s,r,n)},overlapCirc:function(t,e,i,s,r){return u(this.world,t,e,i,s,r)},shutdown:function(){if(this.world){var t=this.systems.events;t.off(f.UPDATE,this.world.update,this.world),t.off(f.POST_UPDATE,this.world.postUpdate,this.world),t.off(f.SHUTDOWN,this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null}},destroy:function(){this.shutdown(),this.scene.sys.events.off(f.START,this.start,this),this.scene=null,this.systems=null}});d.register("ArcadePhysics",g,"arcadePhysics"),t.exports=g},25084:(t,e,i)=>{var s=i(56694),r=i(7864),n=i(13747),a=new s({Extends:n,Mixins:[r.Acceleration,r.Angular,r.Bounce,r.Debug,r.Drag,r.Enable,r.Friction,r.Gravity,r.Immovable,r.Mass,r.Pushable,r.Size,r.Velocity],initialize:function(t,e,i,s,r){n.call(this,t,e,i,s,r),this.body=null}});t.exports=a},97602:(t,e,i)=>{var s=i(56694),r=i(47401),n=i(27037),a=i(23701),o=i(74118),h=i(94287),l=i(93736),u=new s({initialize:function(t,e){var i=e.displayWidth?e.displayWidth:64,s=e.displayHeight?e.displayHeight:64;this.world=t,this.gameObject=e,this.transform={x:e.x,y:e.y,rotation:e.angle,scaleX:e.scaleX,scaleY:e.scaleY,displayOriginX:e.displayOriginX,displayOriginY:e.displayOriginY},this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new l,this.position=new l(e.x-e.scaleX*e.displayOriginX,e.y-e.scaleY*e.displayOriginY),this.prev=this.position.clone(),this.prevFrame=this.position.clone(),this.allowRotation=!0,this.rotation=e.angle,this.preRotation=e.angle,this.width=i,this.height=s,this.sourceWidth=i,this.sourceHeight=s,e.frame&&(this.sourceWidth=e.frame.realWidth,this.sourceHeight=e.frame.realHeight),this.halfWidth=Math.abs(i/2),this.halfHeight=Math.abs(s/2),this.center=new l(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=new l,this.newVelocity=new l,this.deltaMax=new l,this.acceleration=new l,this.allowDrag=!0,this.drag=new l,this.allowGravity=!0,this.gravity=new l,this.bounce=new l,this.worldBounce=null,this.customBoundsRectangle=t.bounds,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new l(1e4,1e4),this.maxSpeed=-1,this.friction=new l(1,0),this.useDamping=!1,this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=r.FACING_NONE,this.immovable=!1,this.pushable=!0,this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.syncBounds=!1,this.physicsType=r.DYNAMIC_BODY,this._sx=e.scaleX,this._sy=e.scaleY,this._dx=0,this._dy=0,this._tx=0,this._ty=0,this._bounds=new o},updateBounds:function(){var t=this.gameObject,e=this.transform;if(t.parentContainer){var i=t.getWorldTransformMatrix(this.world._tempMatrix,this.world._tempMatrix2);e.x=i.tx,e.y=i.ty,e.rotation=a(i.rotation),e.scaleX=i.scaleX,e.scaleY=i.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY}else e.x=t.x,e.y=t.y,e.rotation=t.angle,e.scaleX=t.scaleX,e.scaleY=t.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY;var s=!1;if(this.syncBounds){var r=t.getBounds(this._bounds);this.width=r.width,this.height=r.height,s=!0}else{var n=Math.abs(e.scaleX),o=Math.abs(e.scaleY);this._sx===n&&this._sy===o||(this.width=this.sourceWidth*n,this.height=this.sourceHeight*o,this._sx=n,this._sy=o,s=!0)}s&&(this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter())},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},updateFromGameObject:function(){this.updateBounds();var t=this.transform;this.position.x=t.x+t.scaleX*(this.offset.x-t.displayOriginX),this.position.y=t.y+t.scaleY*(this.offset.y-t.displayOriginY),this.updateCenter()},resetFlags:function(t){void 0===t&&(t=!1);var e=this.wasTouching,i=this.touching,s=this.blocked;t?(e.none=!0,e.up=!1,e.down=!1,e.left=!1,e.right=!1):(e.none=i.none,e.up=i.up,e.down=i.down,e.left=i.left,e.right=i.right),i.none=!0,i.up=!1,i.down=!1,i.left=!1,i.right=!1,s.none=!0,s.up=!1,s.down=!1,s.left=!1,s.right=!1,this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1},preUpdate:function(t,e){t&&this.resetFlags(),this.updateFromGameObject(),this.rotation=this.transform.rotation,this.preRotation=this.rotation,this.moves&&(this.prev.x=this.position.x,this.prev.y=this.position.y,this.prevFrame.x=this.position.x,this.prevFrame.y=this.position.y),t&&this.update(e)},update:function(t){if(this.prev.x=this.position.x,this.prev.y=this.position.y,this.moves){this.world.updateMotion(this,t);var e=this.velocity.x,i=this.velocity.y;this.newVelocity.set(e*t,i*t),this.position.add(this.newVelocity),this.updateCenter(),this.angle=Math.atan2(i,e),this.speed=Math.sqrt(e*e+i*i),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds&&this.world.emit(n.WORLD_BOUNDS,this,this.blocked.up,this.blocked.down,this.blocked.left,this.blocked.right)}this._dx=this.position.x-this.prev.x,this._dy=this.position.y-this.prev.y},postUpdate:function(){var t=this.position.x-this.prevFrame.x,e=this.position.y-this.prevFrame.y;if(this.moves){var i=this.deltaMax.x,s=this.deltaMax.y;0!==i&&0!==t&&(t<0&&t<-i?t=-i:t>0&&t>i&&(t=i)),0!==s&&0!==e&&(e<0&&e<-s?e=-s:e>0&&e>s&&(e=s)),this.gameObject.x+=t,this.gameObject.y+=e}t<0?this.facing=r.FACING_LEFT:t>0&&(this.facing=r.FACING_RIGHT),e<0?this.facing=r.FACING_UP:e>0&&(this.facing=r.FACING_DOWN),this.allowRotation&&(this.gameObject.angle+=this.deltaZ()),this._tx=t,this._ty=e},setBoundsRectangle:function(t){return this.customBoundsRectangle=t||this.world.bounds,this},checkWorldBounds:function(){var t=this.position,e=this.customBoundsRectangle,i=this.world.checkCollision,s=this.worldBounce?-this.worldBounce.x:-this.bounce.x,r=this.worldBounce?-this.worldBounce.y:-this.bounce.y,n=!1;return t.xe.right&&i.right&&(t.x=e.right-this.width,this.velocity.x*=s,this.blocked.right=!0,n=!0),t.ye.bottom&&i.down&&(t.y=e.bottom-this.height,this.velocity.y*=r,this.blocked.down=!0,n=!0),n&&(this.blocked.none=!1,this.updateCenter()),n},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this},setSize:function(t,e,i){void 0===i&&(i=!0);var s=this.gameObject;if(!t&&s.frame&&(t=s.frame.realWidth),!e&&s.frame&&(e=s.frame.realHeight),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&s.getCenter){var r=(s.width-t)/2,n=(s.height-e)/2;this.offset.set(r,n)}return this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.isCircle=!0,this.radius=t,this.sourceWidth=2*t,this.sourceHeight=2*t,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter()):this.isCircle=!1,this},reset:function(t,e){this.stop();var i=this.gameObject;i.setPosition(t,e),i.getTopLeft?i.getTopLeft(this.position):this.position.set(t,e),this.prev.copy(this.position),this.prevFrame.copy(this.position),this.rotation=i.angle,this.preRotation=i.angle,this.updateBounds(),this.updateCenter(),this.resetFlags(!0)},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?this.radius>0&&t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom&&(this.center.x-t)*(this.center.x-t)+(this.center.y-e)*(this.center.y-e)<=this.radius*this.radius:h(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this._dx>0?this._dx:-this._dx},deltaAbsY:function(){return this._dy>0?this._dy:-this._dy},deltaX:function(){return this._dx},deltaY:function(){return this._dy},deltaXFinal:function(){return this._tx},deltaYFinal:function(){return this._ty},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.enable=!1,this.world&&this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,s=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor),this.isCircle?t.strokeCircle(i,s,this.width/2):(this.checkCollision.up&&t.lineBetween(e.x,e.y,e.x+this.width,e.y),this.checkCollision.right&&t.lineBetween(e.x+this.width,e.y,e.x+this.width,e.y+this.height),this.checkCollision.down&&t.lineBetween(e.x,e.y+this.height,e.x+this.width,e.y+this.height),this.checkCollision.left&&t.lineBetween(e.x,e.y,e.x,e.y+this.height))),this.debugShowVelocity&&(t.lineStyle(t.defaultStrokeWidth,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,s,i+this.velocity.x/2,s+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setCollideWorldBounds:function(t,e,i,s){void 0===t&&(t=!0),this.collideWorldBounds=t;var r=void 0!==e,n=void 0!==i;return(r||n)&&(this.worldBounce||(this.worldBounce=new l),r&&(this.worldBounce.x=e),n&&(this.worldBounce.y=i)),void 0!==s&&(this.onWorldBounds=s),this},setVelocity:function(t,e){return this.velocity.set(t,e),t=this.velocity.x,e=this.velocity.y,this.speed=Math.sqrt(t*t+e*e),this},setVelocityX:function(t){this.velocity.x=t;var e=t,i=this.velocity.y;return this.speed=Math.sqrt(e*e+i*i),this},setVelocityY:function(t){this.velocity.y=t;var e=this.velocity.x,i=t;return this.speed=Math.sqrt(e*e+i*i),this},setMaxVelocity:function(t,e){return this.maxVelocity.set(t,e),this},setMaxVelocityX:function(t){return this.maxVelocity.x=t,this},setMaxVelocityY:function(t){return this.maxVelocity.y=t,this},setMaxSpeed:function(t){return this.maxSpeed=t,this},setBounce:function(t,e){return this.bounce.set(t,e),this},setBounceX:function(t){return this.bounce.x=t,this},setBounceY:function(t){return this.bounce.y=t,this},setAcceleration:function(t,e){return this.acceleration.set(t,e),this},setAccelerationX:function(t){return this.acceleration.x=t,this},setAccelerationY:function(t){return this.acceleration.y=t,this},setAllowDrag:function(t){return void 0===t&&(t=!0),this.allowDrag=t,this},setAllowGravity:function(t){return void 0===t&&(t=!0),this.allowGravity=t,this},setAllowRotation:function(t){return void 0===t&&(t=!0),this.allowRotation=t,this},setDrag:function(t,e){return this.drag.set(t,e),this},setDamping:function(t){return this.useDamping=t,this},setDragX:function(t){return this.drag.x=t,this},setDragY:function(t){return this.drag.y=t,this},setGravity:function(t,e){return this.gravity.set(t,e),this},setGravityX:function(t){return this.gravity.x=t,this},setGravityY:function(t){return this.gravity.y=t,this},setFriction:function(t,e){return this.friction.set(t,e),this},setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setAngularVelocity:function(t){return this.angularVelocity=t,this},setAngularAcceleration:function(t){return this.angularAcceleration=t,this},setAngularDrag:function(t){return this.angularDrag=t,this},setMass:function(t){return this.mass=t,this},setImmovable:function(t){return void 0===t&&(t=!0),this.immovable=t,this},setEnable:function(t){return void 0===t&&(t=!0),this.enable=t,this},processX:function(t,e,i,s){this.x+=t,this.updateCenter(),null!==e&&(this.velocity.x=e);var r=this.blocked;i&&(r.left=!0),s&&(r.right=!0)},processY:function(t,e,i,s){this.y+=t,this.updateCenter(),null!==e&&(this.velocity.y=e);var r=this.blocked;i&&(r.up=!0),s&&(r.down=!0)},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=u},3909:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s,r,n,a){this.world=t,this.name="",this.active=!0,this.overlapOnly=e,this.object1=i,this.object2=s,this.collideCallback=r,this.processCallback=n,this.callbackContext=a},setName:function(t){return this.name=t,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});t.exports=s},99523:(t,e,i)=>{var s=i(62832),r=i(25084),n=i(56694),a=i(47401),o=i(10481),h=i(46346),l=new n({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},collider:function(t,e,i,s,r){return this.world.addCollider(t,e,i,s,r)},overlap:function(t,e,i,s,r){return this.world.addOverlap(t,e,i,s,r)},existing:function(t,e){var i=e?a.STATIC_BODY:a.DYNAMIC_BODY;return this.world.enableBody(t,i),t},staticImage:function(t,e,i,r){var n=new s(this.scene,t,e,i,r);return this.sys.displayList.add(n),this.world.enableBody(n,a.STATIC_BODY),n},image:function(t,e,i,r){var n=new s(this.scene,t,e,i,r);return this.sys.displayList.add(n),this.world.enableBody(n,a.DYNAMIC_BODY),n},staticSprite:function(t,e,i,s){var n=new r(this.scene,t,e,i,s);return this.sys.displayList.add(n),this.sys.updateList.add(n),this.world.enableBody(n,a.STATIC_BODY),n},sprite:function(t,e,i,s){var n=new r(this.scene,t,e,i,s);return this.sys.displayList.add(n),this.sys.updateList.add(n),this.world.enableBody(n,a.DYNAMIC_BODY),n},staticGroup:function(t,e){return this.sys.updateList.add(new h(this.world,this.world.scene,t,e))},group:function(t,e){return this.sys.updateList.add(new o(this.world,this.world.scene,t,e))},destroy:function(){this.world=null,this.scene=null,this.sys=null}});t.exports=l},75671:(t,e,i)=>{var s=i(47401);t.exports=function(t,e,i,r){var n=0,a=t.deltaAbsX()+e.deltaAbsX()+r;return 0===t._dx&&0===e._dx?(t.embedded=!0,e.embedded=!0):t._dx>e._dx?(n=t.right-e.x)>a&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?n=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.right=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.left=!0)):t._dxa&&!i||!1===t.checkCollision.left||!1===e.checkCollision.right?n=0:(t.touching.none=!1,t.touching.left=!0,e.touching.none=!1,e.touching.right=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.left=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.right=!0))),t.overlapX=n,e.overlapX=n,n}},66185:(t,e,i)=>{var s=i(47401);t.exports=function(t,e,i,r){var n=0,a=t.deltaAbsY()+e.deltaAbsY()+r;return 0===t._dy&&0===e._dy?(t.embedded=!0,e.embedded=!0):t._dy>e._dy?(n=t.bottom-e.y)>a&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?n=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.down=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.up=!0)):t._dya&&!i||!1===t.checkCollision.up||!1===e.checkCollision.down?n=0:(t.touching.none=!1,t.touching.up=!0,e.touching.none=!1,e.touching.down=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.up=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.down=!0))),t.overlapY=n,e.overlapY=n,n}},10481:(t,e,i)=>{var s=i(25084),r=i(56694),n=i(47401),a=i(72632),o=i(59192),h=i(42911),l=new r({Extends:o,initialize:function(t,e,i,r){if(i||r)if(h(i))r=i,i=null,r.internalCreateCallback=this.createCallbackHandler,r.internalRemoveCallback=this.removeCallbackHandler;else if(Array.isArray(i)&&h(i[0])){r=i[0];var l=this;i.forEach((function(t){t.internalCreateCallback=l.createCallbackHandler,t.internalRemoveCallback=l.removeCallbackHandler})),i=null}else r={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};else r={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};this.world=t,r.classType=a(r,"classType",s),this.physicsType=n.DYNAMIC_BODY,this.defaults={setCollideWorldBounds:a(r,"collideWorldBounds",!1),setBoundsRectangle:a(r,"customBoundsRectangle",null),setAccelerationX:a(r,"accelerationX",0),setAccelerationY:a(r,"accelerationY",0),setAllowDrag:a(r,"allowDrag",!0),setAllowGravity:a(r,"allowGravity",!0),setAllowRotation:a(r,"allowRotation",!0),setBounceX:a(r,"bounceX",0),setBounceY:a(r,"bounceY",0),setDragX:a(r,"dragX",0),setDragY:a(r,"dragY",0),setEnable:a(r,"enable",!0),setGravityX:a(r,"gravityX",0),setGravityY:a(r,"gravityY",0),setFrictionX:a(r,"frictionX",0),setFrictionY:a(r,"frictionY",0),setMaxVelocityX:a(r,"maxVelocityX",1e4),setMaxVelocityY:a(r,"maxVelocityY",1e4),setVelocityX:a(r,"velocityX",0),setVelocityY:a(r,"velocityY",0),setAngularVelocity:a(r,"angularVelocity",0),setAngularAcceleration:a(r,"angularAcceleration",0),setAngularDrag:a(r,"angularDrag",0),setMass:a(r,"mass",1),setImmovable:a(r,"immovable",!1)},o.call(this,e,i,r),this.type="PhysicsGroup"},createCallbackHandler:function(t){t.body||this.world.enableBody(t,n.DYNAMIC_BODY);var e=t.body;for(var i in this.defaults)e[i](this.defaults[i])},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},setVelocity:function(t,e,i){void 0===i&&(i=0);for(var s=this.getChildren(),r=0;r{var e,i,s,r,n,a,o,h,l,u,c,d,f,p,v,g,m,y=function(){return u&&v&&i.blocked.right?(e.processX(-m,o,!1,!0),1):l&&g&&i.blocked.left?(e.processX(m,o,!0),1):f&&g&&e.blocked.right?(i.processX(-m,h,!1,!0),2):d&&v&&e.blocked.left?(i.processX(m,h,!0),2):0},x=function(t){if(s&&r)m*=.5,0===t||3===t?(e.processX(m,n),i.processX(-m,a)):(e.processX(-m,n),i.processX(m,a));else if(s&&!r)0===t||3===t?e.processX(m,o,!0):e.processX(-m,o,!1,!0);else if(!s&&r)0===t||3===t?i.processX(-m,h,!1,!0):i.processX(m,h,!0);else{var v=.5*m;0===t?p?(e.processX(m,0,!0),i.processX(0,null,!1,!0)):f?(e.processX(v,0,!0),i.processX(-v,0,!1,!0)):(e.processX(v,i.velocity.x,!0),i.processX(-v,null,!1,!0)):1===t?c?(e.processX(0,null,!1,!0),i.processX(m,0,!0)):u?(e.processX(-v,0,!1,!0),i.processX(v,0,!0)):(e.processX(-v,null,!1,!0),i.processX(v,e.velocity.x,!0)):2===t?p?(e.processX(-m,0,!1,!0),i.processX(0,null,!0)):d?(e.processX(-v,0,!1,!0),i.processX(v,0,!0)):(e.processX(-v,i.velocity.x,!1,!0),i.processX(v,null,!0)):3===t&&(c?(e.processX(0,null,!0),i.processX(-m,0,!1,!0)):l?(e.processX(v,0,!0),i.processX(-v,0,!1,!0)):(e.processX(v,i.velocity.y,!0),i.processX(-v,null,!1,!0)))}return!0};t.exports={BlockCheck:y,Check:function(){var t=e.velocity.x,s=i.velocity.x,r=Math.sqrt(s*s*i.mass/e.mass)*(s>0?1:-1),o=Math.sqrt(t*t*e.mass/i.mass)*(t>0?1:-1),h=.5*(r+o);return o-=h,n=h+(r-=h)*e.bounce.x,a=h+o*i.bounce.x,l&&g?x(0):d&&v?x(1):u&&v?x(2):!(!f||!g)&&x(3)},Set:function(t,n,a){i=n;var x=(e=t).velocity.x,T=i.velocity.x;return s=e.pushable,l=e._dx<0,u=e._dx>0,c=0===e._dx,v=Math.abs(e.right-i.x)<=Math.abs(i.right-e.x),o=T-x*e.bounce.x,r=i.pushable,d=i._dx<0,f=i._dx>0,p=0===i._dx,g=!v,h=x-T*i.bounce.x,m=Math.abs(a),y()},Run:x,RunImmovableBody1:function(t){1===t?i.velocity.x=0:v?i.processX(m,h,!0):i.processX(-m,h,!1,!0),e.moves&&(i.y+=(e.y-e.prev.y)*e.friction.y,i._dy=i.y-i.prev.y)},RunImmovableBody2:function(t){2===t?e.velocity.x=0:g?e.processX(m,o,!0):e.processX(-m,o,!1,!0),i.moves&&(e.y+=(i.y-i.prev.y)*i.friction.y,e._dy=e.y-e.prev.y)}}},67050:t=>{var e,i,s,r,n,a,o,h,l,u,c,d,f,p,v,g,m,y=function(){return u&&v&&i.blocked.down?(e.processY(-m,o,!1,!0),1):l&&g&&i.blocked.up?(e.processY(m,o,!0),1):f&&g&&e.blocked.down?(i.processY(-m,h,!1,!0),2):d&&v&&e.blocked.up?(i.processY(m,h,!0),2):0},x=function(t){if(s&&r)m*=.5,0===t||3===t?(e.processY(m,n),i.processY(-m,a)):(e.processY(-m,n),i.processY(m,a));else if(s&&!r)0===t||3===t?e.processY(m,o,!0):e.processY(-m,o,!1,!0);else if(!s&&r)0===t||3===t?i.processY(-m,h,!1,!0):i.processY(m,h,!0);else{var v=.5*m;0===t?p?(e.processY(m,0,!0),i.processY(0,null,!1,!0)):f?(e.processY(v,0,!0),i.processY(-v,0,!1,!0)):(e.processY(v,i.velocity.y,!0),i.processY(-v,null,!1,!0)):1===t?c?(e.processY(0,null,!1,!0),i.processY(m,0,!0)):u?(e.processY(-v,0,!1,!0),i.processY(v,0,!0)):(e.processY(-v,null,!1,!0),i.processY(v,e.velocity.y,!0)):2===t?p?(e.processY(-m,0,!1,!0),i.processY(0,null,!0)):d?(e.processY(-v,0,!1,!0),i.processY(v,0,!0)):(e.processY(-v,i.velocity.y,!1,!0),i.processY(v,null,!0)):3===t&&(c?(e.processY(0,null,!0),i.processY(-m,0,!1,!0)):l?(e.processY(v,0,!0),i.processY(-v,0,!1,!0)):(e.processY(v,i.velocity.y,!0),i.processY(-v,null,!1,!0)))}return!0};t.exports={BlockCheck:y,Check:function(){var t=e.velocity.y,s=i.velocity.y,r=Math.sqrt(s*s*i.mass/e.mass)*(s>0?1:-1),o=Math.sqrt(t*t*e.mass/i.mass)*(t>0?1:-1),h=.5*(r+o);return o-=h,n=h+(r-=h)*e.bounce.y,a=h+o*i.bounce.y,l&&g?x(0):d&&v?x(1):u&&v?x(2):!(!f||!g)&&x(3)},Set:function(t,n,a){i=n;var x=(e=t).velocity.y,T=i.velocity.y;return s=e.pushable,l=e._dy<0,u=e._dy>0,c=0===e._dy,v=Math.abs(e.bottom-i.y)<=Math.abs(i.bottom-e.y),o=T-x*e.bounce.y,r=i.pushable,d=i._dy<0,f=i._dy>0,p=0===i._dy,g=!v,h=x-T*i.bounce.y,m=Math.abs(a),y()},Run:x,RunImmovableBody1:function(t){1===t?i.velocity.y=0:v?i.processY(m,h,!0):i.processY(-m,h,!1,!0),e.moves&&(i.x+=(e.x-e.prev.x)*e.friction.x,i._dx=i.x-i.prev.x)},RunImmovableBody2:function(t){2===t?e.velocity.y=0:g?e.processY(m,o,!0):e.processY(-m,o,!1,!0),i.moves&&(e.x+=(i.x-i.prev.x)*i.friction.x,e._dx=e.x-e.prev.x)}}},61777:(t,e,i)=>{var s=i(75671),r=i(22916);t.exports=function(t,e,i,n){var a=s(t,e,i,n),o=t.immovable,h=e.immovable;if(i||0===a||o&&h||t.customSeparateX||e.customSeparateX)return 0!==a||t.embedded&&e.embedded;var l=r.Set(t,e,a);return o||h?(o?r.RunImmovableBody1(l):h&&r.RunImmovableBody2(l),!0):l>0||r.Check()}},25299:(t,e,i)=>{var s=i(66185),r=i(67050);t.exports=function(t,e,i,n){var a=s(t,e,i,n),o=t.immovable,h=e.immovable;if(i||0===a||o&&h||t.customSeparateY||e.customSeparateY)return 0!==a||t.embedded&&e.embedded;var l=r.Set(t,e,a);return o||h?(o?r.RunImmovableBody1(l):h&&r.RunImmovableBody2(l),!0):l>0||r.Check()}},66634:(t,e,i)=>{var s=i(65650),r=i(56694),n=i(47401),a=i(94287),o=i(93736),h=new r({initialize:function(t,e){var i=e.displayWidth?e.displayWidth:64,s=e.displayHeight?e.displayHeight:64;this.world=t,this.gameObject=e,this.debugShowBody=t.defaults.debugShowStaticBody,this.debugBodyColor=t.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new o,this.position=new o(e.x-i*e.originX,e.y-s*e.originY),this.width=i,this.height=s,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new o(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=o.ZERO,this.allowGravity=!1,this.gravity=o.ZERO,this.bounce=o.ZERO,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.mass=1,this.immovable=!0,this.pushable=!1,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.physicsType=n.STATIC_BODY,this._dx=0,this._dy=0},setGameObject:function(t,e){return t&&t!==this.gameObject&&(this.gameObject.body=null,t.body=this,this.gameObject=t),e&&this.updateFromGameObject(),this},updateFromGameObject:function(){this.world.staticTree.remove(this);var t=this.gameObject;return t.getTopLeft(this.position),this.width=t.displayWidth,this.height=t.displayHeight,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.world.staticTree.insert(this),this},setOffset:function(t,e){return void 0===e&&(e=t),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(t,e),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(t,e,i){void 0===i&&(i=!0);var s=this.gameObject;if(!t&&s.frame&&(t=s.frame.realWidth),!e&&s.frame&&(e=s.frame.realHeight),this.world.staticTree.remove(this),this.width=t,this.height=e,this.halfWidth=Math.floor(t/2),this.halfHeight=Math.floor(e/2),i&&s.getCenter){var r=s.displayWidth/2,n=s.displayHeight/2;this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(r-this.halfWidth,n-this.halfHeight),this.position.x+=this.offset.x,this.position.y+=this.offset.y}return this.updateCenter(),this.isCircle=!1,this.radius=0,this.world.staticTree.insert(this),this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=t,this.width=2*t,this.height=2*t,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(t,e){var i=this.gameObject;void 0===t&&(t=i.x),void 0===e&&(e=i.y),this.world.staticTree.remove(this),i.setPosition(t,e),i.getTopLeft(this.position),this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?s(this,t,e):a(this,t,e)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,s=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor,1),this.isCircle?t.strokeCircle(i,s,this.width/2):t.strokeRect(e.x,e.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(t){return t<=0&&(t=.1),this.mass=t,this},x:{get:function(){return this.position.x},set:function(t){this.world.staticTree.remove(this),this.position.x=t,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(t){this.world.staticTree.remove(this),this.position.y=t,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=h},46346:(t,e,i)=>{var s=i(25084),r=i(56694),n=i(47401),a=i(72632),o=i(59192),h=i(42911),l=new r({Extends:o,initialize:function(t,e,i,r){i||r?h(i)?(r=i,i=null,r.internalCreateCallback=this.createCallbackHandler,r.internalRemoveCallback=this.removeCallbackHandler,r.createMultipleCallback=this.createMultipleCallbackHandler,r.classType=a(r,"classType",s)):Array.isArray(i)&&h(i[0])?(r=i,i=null,r.forEach((function(t){t.internalCreateCallback=this.createCallbackHandler,t.internalRemoveCallback=this.removeCallbackHandler,t.createMultipleCallback=this.createMultipleCallbackHandler,t.classType=a(t,"classType",s)}))):r={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler}:r={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler,createMultipleCallback:this.createMultipleCallbackHandler,classType:s},this.world=t,this.physicsType=n.STATIC_BODY,o.call(this,e,i,r),this.type="StaticPhysicsGroup"},createCallbackHandler:function(t){t.body||this.world.enableBody(t,n.STATIC_BODY)},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},createMultipleCallbackHandler:function(){this.refresh()},refresh:function(){for(var t=this.children.entries,e=0;e{var s=i(94240),r=i(97602),n=i(82897),a=i(56694),o=i(3909),h=i(47401),l=i(53996),u=i(6659),c=i(27037),d=i(88456),f=i(41935),p=i(54726),v=i(75671),g=i(66185),m=i(44662),y=i(10850),x=i(83392),T=i(74623),w=i(25163),E=i(74118),b=i(68687),S=i(27354),A=i(61777),_=i(25299),C=i(58403),R=i(66634),M=i(28808),P=i(69360),O=i(93736),L=i(1071),F=new a({Extends:u,initialize:function(t,e){u.call(this),this.scene=t,this.bodies=new C,this.staticBodies=new C,this.pendingDestroy=new C,this.colliders=new T,this.gravity=new O(y(e,"gravity.x",0),y(e,"gravity.y",0)),this.bounds=new E(y(e,"x",0),y(e,"y",0),y(e,"width",t.sys.scale.width),y(e,"height",t.sys.scale.height)),this.checkCollision={up:y(e,"checkCollision.up",!0),down:y(e,"checkCollision.down",!0),left:y(e,"checkCollision.left",!0),right:y(e,"checkCollision.right",!0)},this.fps=y(e,"fps",60),this.fixedStep=y(e,"fixedStep",!0),this._elapsed=0,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this.stepsLastFrame=0,this.timeScale=y(e,"timeScale",1),this.OVERLAP_BIAS=y(e,"overlapBias",4),this.TILE_BIAS=y(e,"tileBias",16),this.forceX=y(e,"forceX",!1),this.isPaused=y(e,"isPaused",!1),this._total=0,this.drawDebug=y(e,"debug",!1),this.debugGraphic,this.defaults={debugShowBody:y(e,"debugShowBody",!0),debugShowStaticBody:y(e,"debugShowStaticBody",!0),debugShowVelocity:y(e,"debugShowVelocity",!0),bodyDebugColor:y(e,"debugBodyColor",16711935),staticBodyDebugColor:y(e,"debugStaticBodyColor",255),velocityDebugColor:y(e,"debugVelocityColor",65280)},this.maxEntries=y(e,"maxEntries",16),this.useTree=y(e,"useTree",!0),this.tree=new b(this.maxEntries),this.staticTree=new b(this.maxEntries),this.treeMinMax={minX:0,minY:0,maxX:0,maxY:0},this._tempMatrix=new P,this._tempMatrix2=new P,this.drawDebug&&this.createDebugGraphic()},enable:function(t,e){void 0===e&&(e=h.DYNAMIC_BODY),Array.isArray(t)||(t=[t]);for(var i=0;i=n;for(this.fixedStep||(r=.001*e,o=!0,this._elapsed=0),i=0;i=n;)this._elapsed-=n,this.step(r)}},step:function(t){var e,i,s=this.bodies.entries,r=s.length;for(e=0;e0){var l=this.tree,u=this.staticTree;for(s=(i=o.entries).length,t=0;t-1&&c>v&&(t.velocity.normalize().scale(v),c=v),t.speed=c},separate:function(t,e,i,s,r,n){if(!n&&!t.enable||!e.enable||t.checkCollision.none||e.checkCollision.none||!this.intersects(t,e))return!1;if(i&&!1===i.call(s,t.gameObject,e.gameObject))return!1;if(t.isCircle&&e.isCircle)return this.separateCircle(t,e,r);if(t.isCircle!==e.isCircle){var a=t.isCircle?e:t,o=t.isCircle?t:e,h={x:a.x,y:a.y,right:a.right,bottom:a.bottom},l=o.center;if((l.yh.bottom)&&(l.xh.right))return this.separateCircle(t,e,r)}var u=!1,d=!1;r?(u=A(t,e,r,this.OVERLAP_BIAS),d=_(t,e,r,this.OVERLAP_BIAS)):this.forceX||Math.abs(this.gravity.y+t.gravity.y)a.right&&(n=l(o.x,o.y,a.right,a.y)-o.radius):o.y>a.bottom&&(o.xa.right&&(n=l(o.x,o.y,a.right,a.bottom)-o.radius)),n*=-1}else n=t.halfWidth+e.halfWidth-l(t.center.x,t.center.y,e.center.x,e.center.y);if(t.overlapR=n,e.overlapR=n,i||0===n||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==n&&(t.onOverlap||e.onOverlap)&&this.emit(c.OVERLAP,t.gameObject,e.gameObject,t,e),0!==n;var h=t.center.x-e.center.x,u=t.center.y-e.center.y,d=Math.sqrt(Math.pow(h,2)+Math.pow(u,2)),f=(e.center.x-t.center.x)/d||0,p=(e.center.y-t.center.y)/d||0,m=2*(t.velocity.x*f+t.velocity.y*p-e.velocity.x*f-e.velocity.y*p)/(t.mass+e.mass);(t.immovable||e.immovable)&&(m*=2),t.immovable||(t.velocity.x=t.velocity.x-m/t.mass*f,t.velocity.y=t.velocity.y-m/t.mass*p),e.immovable||(e.velocity.x=e.velocity.x+m/e.mass*f,e.velocity.y=e.velocity.y+m/e.mass*p),t.immovable||e.immovable||(n/=2);var y=s(t.center,e.center),T=(n+x.EPSILON)*Math.cos(y),w=(n+x.EPSILON)*Math.sin(y);return t.immovable||(t.x-=T,t.y-=w,t.updateCenter()),e.immovable||(e.x+=T,e.y+=w,e.updateCenter()),t.velocity.x*=t.bounce.x,t.velocity.y*=t.bounce.y,e.velocity.x*=e.bounce.x,e.velocity.y*=e.bounce.y,(t.onCollide||e.onCollide)&&this.emit(c.COLLIDE,t.gameObject,e.gameObject,t,e),!0},intersects:function(t,e){return t!==e&&(t.isCircle||e.isCircle?t.isCircle?e.isCircle?l(t.center.x,t.center.y,e.center.x,e.center.y)<=t.halfWidth+e.halfWidth:this.circleBodyIntersects(t,e):this.circleBodyIntersects(e,t):!(t.right<=e.position.x||t.bottom<=e.position.y||t.position.x>=e.right||t.position.y>=e.bottom))},circleBodyIntersects:function(t,e){var i=n(t.center.x,e.left,e.right),s=n(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-s)*(t.center.y-s)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,s,r){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===r&&(r=i),this.collideObjects(t,e,i,s,r,!0)},collide:function(t,e,i,s,r){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===r&&(r=i),this.collideObjects(t,e,i,s,r,!1)},collideObjects:function(t,e,i,s,r,n){var a,o;!t.isParent||void 0!==t.physicsType&&void 0!==e&&t!==e||(t=t.children.entries),e&&e.isParent&&void 0===e.physicsType&&(e=e.children.entries);var h=Array.isArray(t),l=Array.isArray(e);if(this._total=0,h||l)if(!h&&l)for(a=0;a0},collideHandler:function(t,e,i,s,r,n){if(void 0===e&&t.isParent)return this.collideGroupVsGroup(t,t,i,s,r,n);if(!t||!e)return!1;if(t.body){if(e.body)return this.collideSpriteVsSprite(t,e,i,s,r,n);if(e.isParent)return this.collideSpriteVsGroup(t,e,i,s,r,n);if(e.isTilemap)return this.collideSpriteVsTilemapLayer(t,e,i,s,r,n)}else if(t.isParent){if(e.body)return this.collideSpriteVsGroup(e,t,i,s,r,n);if(e.isParent)return this.collideGroupVsGroup(t,e,i,s,r,n);if(e.isTilemap)return this.collideGroupVsTilemapLayer(t,e,i,s,r,n)}else if(t.isTilemap){if(e.body)return this.collideSpriteVsTilemapLayer(e,t,i,s,r,n);if(e.isParent)return this.collideGroupVsTilemapLayer(e,t,i,s,r,n)}},collideSpriteVsSprite:function(t,e,i,s,r,n){return!(!t.body||!e.body)&&(this.separate(t.body,e.body,s,r,n)&&(i&&i.call(r,t,e),this._total++),!0)},collideSpriteVsGroup:function(t,e,i,s,r,n){var a,o,l,u=t.body;if(0!==e.length&&u&&u.enable&&!u.checkCollision.none)if(this.useTree||e.physicsType===h.STATIC_BODY){var c=this.treeMinMax;c.minX=u.left,c.minY=u.top,c.maxX=u.right,c.maxY=u.bottom;var d=e.physicsType===h.DYNAMIC_BODY?this.tree.search(c):this.staticTree.search(c);for(o=d.length,a=0;ac.baseTileWidth){var d=(c.tileWidth-c.baseTileWidth)*e.scaleX;o-=d,l+=d}c.tileHeight>c.baseTileHeight&&(u+=(c.tileHeight-c.baseTileHeight)*e.scaleY);var f=m(o,h,l,u,null,e.scene.cameras.main,e.layer);return 0!==f.length&&this.collideSpriteVsTilesHandler(t,f,i,s,r,n,!0)},collideSpriteVsTilesHandler:function(t,e,i,s,r,n,a){for(var o,h,l=t.body,u={left:0,right:0,top:0,bottom:0},d=!1,f=0;f{t.exports={setAcceleration:function(t,e){return this.body.acceleration.set(t,e),this},setAccelerationX:function(t){return this.body.acceleration.x=t,this},setAccelerationY:function(t){return this.body.acceleration.y=t,this}}},29257:t=>{t.exports={setAngularVelocity:function(t){return this.body.angularVelocity=t,this},setAngularAcceleration:function(t){return this.body.angularAcceleration=t,this},setAngularDrag:function(t){return this.body.angularDrag=t,this}}},62122:t=>{t.exports={setBounce:function(t,e){return this.body.bounce.set(t,e),this},setBounceX:function(t){return this.body.bounce.x=t,this},setBounceY:function(t){return this.body.bounce.y=t,this},setCollideWorldBounds:function(t,e,i){return this.body.setCollideWorldBounds(t,e,i),this}}},99803:t=>{t.exports={setDebug:function(t,e,i){return this.debugShowBody=t,this.debugShowVelocity=e,this.debugBodyColor=i,this},setDebugBodyColor:function(t){return this.body.debugBodyColor=t,this},debugShowBody:{get:function(){return this.body.debugShowBody},set:function(t){this.body.debugShowBody=t}},debugShowVelocity:{get:function(){return this.body.debugShowVelocity},set:function(t){this.body.debugShowVelocity=t}},debugBodyColor:{get:function(){return this.body.debugBodyColor},set:function(t){this.body.debugBodyColor=t}}}},87145:t=>{t.exports={setDrag:function(t,e){return this.body.drag.set(t,e),this},setDragX:function(t){return this.body.drag.x=t,this},setDragY:function(t){return this.body.drag.y=t,this},setDamping:function(t){return this.body.useDamping=t,this}}},96174:t=>{var e={enableBody:function(t,e,i,s,r){return t&&this.body.reset(e,i),s&&(this.body.gameObject.active=!0),r&&(this.body.gameObject.visible=!0),this.body.enable=!0,this},disableBody:function(t,e){return void 0===t&&(t=!1),void 0===e&&(e=!1),this.body.stop(),this.body.enable=!1,t&&(this.body.gameObject.active=!1),e&&(this.body.gameObject.visible=!1),this},refreshBody:function(){return this.body.updateFromGameObject(),this}};t.exports=e},51702:t=>{t.exports={setFriction:function(t,e){return this.body.friction.set(t,e),this},setFrictionX:function(t){return this.body.friction.x=t,this},setFrictionY:function(t){return this.body.friction.y=t,this}}},25578:t=>{t.exports={setGravity:function(t,e){return this.body.gravity.set(t,e),this},setGravityX:function(t){return this.body.gravity.x=t,this},setGravityY:function(t){return this.body.gravity.y=t,this}}},72029:t=>{var e={setImmovable:function(t){return void 0===t&&(t=!0),this.body.immovable=t,this}};t.exports=e},34566:t=>{t.exports={setMass:function(t){return this.body.mass=t,this}}},2732:(t,e,i)=>{var s=i(15147),r=i(26673),n=i(22184),a=i(26535);t.exports=function(t,e,i,o,h,l){var u=s(t,e-o,i-o,2*o,2*o,h,l);if(0===u.length)return u;for(var c=new r(e,i,o),d=new r,f=[],p=0;p{t.exports=function(t,e,i,s,r,n,a){void 0===n&&(n=!0),void 0===a&&(a=!1);var o=[],h=[],l=t.treeMinMax;if(l.minX=e,l.minY=i,l.maxX=e+s,l.maxY=i+r,a&&(h=t.staticTree.search(l)),n&&t.useTree)o=t.tree.search(l);else if(n){var u=t.bodies,c={position:{x:e,y:i},left:e,top:i,right:e+s,bottom:i+r,isCircle:!1},d=t.intersects;u.iterate((function(t){d(t,c)&&o.push(t)}))}return h.concat(o)}},57527:t=>{var e={setPushable:function(t){return void 0===t&&(t=!0),this.body.pushable=t,this}};t.exports=e},77687:t=>{t.exports={setOffset:function(t,e){return this.body.setOffset(t,e),this},setSize:function(t,e,i){return this.body.setSize(t,e,i),this},setBodySize:function(t,e,i){return this.body.setSize(t,e,i),this},setCircle:function(t,e,i){return this.body.setCircle(t,e,i),this}}},66536:t=>{t.exports={setVelocity:function(t,e){return this.body.setVelocity(t,e),this},setVelocityX:function(t){return this.body.setVelocityX(t),this},setVelocityY:function(t){return this.body.setVelocityY(t),this},setMaxVelocity:function(t,e){return this.body.maxVelocity.set(t,e),this}}},7864:(t,e,i)=>{t.exports={Acceleration:i(5321),Angular:i(29257),Bounce:i(62122),Debug:i(99803),Drag:i(87145),Enable:i(96174),Friction:i(51702),Gravity:i(25578),Immovable:i(72029),Mass:i(34566),OverlapCirc:i(2732),OverlapRect:i(15147),Pushable:i(57527),Size:i(77687),Velocity:i(66536)}},47401:t=>{t.exports={DYNAMIC_BODY:0,STATIC_BODY:1,GROUP:2,TILEMAPLAYER:3,FACING_NONE:10,FACING_UP:11,FACING_DOWN:12,FACING_LEFT:13,FACING_RIGHT:14}},22346:t=>{t.exports="collide"},95092:t=>{t.exports="overlap"},15775:t=>{t.exports="pause"},74142:t=>{t.exports="resume"},22825:t=>{t.exports="tilecollide"},10851:t=>{t.exports="tileoverlap"},7543:t=>{t.exports="worldbounds"},1487:t=>{t.exports="worldstep"},27037:(t,e,i)=>{t.exports={COLLIDE:i(22346),OVERLAP:i(95092),PAUSE:i(15775),RESUME:i(74142),TILE_COLLIDE:i(22825),TILE_OVERLAP:i(10851),WORLD_BOUNDS:i(7543),WORLD_STEP:i(1487)}},39977:(t,e,i)=>{var s=i(47401),r=i(98611),n={ArcadePhysics:i(66150),Body:i(97602),Collider:i(3909),Components:i(7864),Events:i(27037),Factory:i(99523),GetOverlapX:i(75671),GetOverlapY:i(66185),SeparateX:i(61777),SeparateY:i(25299),Group:i(10481),Image:i(62832),Sprite:i(25084),StaticBody:i(66634),StaticGroup:i(46346),Tilemap:i(8413),World:i(85233)};n=r(!1,n,s),t.exports=n},25163:t=>{t.exports=function(t,e){return t.collisionCallback?!t.collisionCallback.call(t.collisionCallbackContext,e,t):!t.layer.callbacks[t.index]||!t.layer.callbacks[t.index].callback.call(t.layer.callbacks[t.index].callbackContext,e,t)}},98209:t=>{t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.left=!0):e>0&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=e,t.updateCenter(),0===t.bounce.x?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x}},72792:t=>{t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):e>0&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=e,t.updateCenter(),0===t.bounce.y?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y}},27354:(t,e,i)=>{var s=i(14405),r=i(52926),n=i(28808);t.exports=function(t,e,i,a,o,h,l){var u=a.left,c=a.top,d=a.right,f=a.bottom,p=i.faceLeft||i.faceRight,v=i.faceTop||i.faceBottom;if(l||(p=!0,v=!0),!p&&!v)return!1;var g=0,m=0,y=0,x=1;if(e.deltaAbsX()>e.deltaAbsY()?y=-1:e.deltaAbsX(){var s=i(98209);t.exports=function(t,e,i,r,n,a){var o=0,h=e.faceLeft,l=e.faceRight,u=e.collideLeft,c=e.collideRight;return a||(h=!0,l=!0,u=!0,c=!0),t.deltaX()<0&&c&&t.checkCollision.left?l&&t.x0&&u&&t.checkCollision.right&&h&&t.right>i&&(o=t.right-i)>n&&(o=0),0!==o&&(t.customSeparateX?t.overlapX=o:s(t,o)),o}},52926:(t,e,i)=>{var s=i(72792);t.exports=function(t,e,i,r,n,a){var o=0,h=e.faceTop,l=e.faceBottom,u=e.collideUp,c=e.collideDown;return a||(h=!0,l=!0,u=!0,c=!0),t.deltaY()<0&&c&&t.checkCollision.up?l&&t.y0&&u&&t.checkCollision.down&&h&&t.bottom>i&&(o=t.bottom-i)>n&&(o=0),0!==o&&(t.customSeparateY?t.overlapY=o:s(t,o)),o}},28808:t=>{t.exports=function(t,e){return!(e.right<=t.left||e.bottom<=t.top||e.position.x>=t.right||e.position.y>=t.bottom)}},8413:(t,e,i)=>{var s={ProcessTileCallbacks:i(25163),ProcessTileSeparationX:i(98209),ProcessTileSeparationY:i(72792),SeparateTile:i(27354),TileCheckX:i(14405),TileCheckY:i(52926),TileIntersectsBody:i(28808)};t.exports=s},88257:(t,e,i)=>{var s=new(i(56694))({initialize:function(t){this.pluginManager=t,this.game=t.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=s},18360:t=>{t.exports={Global:["game","anims","cache","plugins","registry","scale","sound","textures","renderer"],CoreScene:["EventEmitter","CameraManager","GameObjectCreator","GameObjectFactory","ScenePlugin","DisplayList","UpdateList"],DefaultScene:["Clock","DataManagerPlugin","InputPlugin","Loader","TweenManager","LightsPlugin"]}},91963:t=>{var e={},i={},s={register:function(t,i,s,r){void 0===r&&(r=!1),e[t]={plugin:i,mapping:s,custom:r}},registerCustom:function(t,e,s,r){i[t]={plugin:e,mapping:s,data:r}},hasCore:function(t){return e.hasOwnProperty(t)},hasCustom:function(t){return i.hasOwnProperty(t)},getCore:function(t){return e[t]},getCustom:function(t){return i[t]},getCustomClass:function(t){return i.hasOwnProperty(t)?i[t].plugin:null},remove:function(t){e.hasOwnProperty(t)&&delete e[t]},removeCustom:function(t){i.hasOwnProperty(t)&&delete i[t]},destroyCorePlugins:function(){for(var t in e)e.hasOwnProperty(t)&&delete e[t]},destroyCustomPlugins:function(){for(var t in i)i.hasOwnProperty(t)&&delete i[t]}};t.exports=s},49274:(t,e,i)=>{var s=i(56694),r=i(97081),n=i(6659),a=i(76846),o=i(99325),h=i(61286),l=i(72632),u=i(91963),c=i(66458),d=new s({Extends:n,initialize:function(t){n.call(this),this.game=t,this.plugins=[],this.scenePlugins=[],this._pendingGlobal=[],this._pendingScene=[],t.isBooted?this.boot():t.events.once(r.BOOT,this.boot,this)},boot:function(){var t,e,i,s,n,a,o,h=this.game.config,u=h.installGlobalPlugins;for(u=u.concat(this._pendingGlobal),t=0;t{var s=i(88257),r=i(56694),n=i(7599),a=new r({Extends:s,initialize:function(t,e,i){s.call(this,e),this.scene=t,this.systems=t.sys,this.pluginKey=i,t.sys.events.once(n.BOOT,this.boot,this)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=a},45615:(t,e,i)=>{t.exports={BasePlugin:i(88257),DefaultPlugins:i(18360),PluginCache:i(91963),PluginManager:i(49274),ScenePlugin:i(39283)}},95723:t=>{t.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,ERASE:17,SOURCE_IN:18,SOURCE_OUT:19,SOURCE_ATOP:20,DESTINATION_OVER:21,DESTINATION_IN:22,DESTINATION_OUT:23,DESTINATION_ATOP:24,LIGHTER:25,COPY:26,XOR:27}},27394:t=>{t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},91135:(t,e,i)=>{var s=i(89787),r=i(61840),n=i(56694),a=i(86459),o=i(6659),h=i(81044),l=i(32834),u=i(40444),c=i(38203),d=i(69360),f=new n({Extends:o,initialize:function(t){o.call(this);var e=t.config;this.config={clearBeforeRender:e.clearBeforeRender,backgroundColor:e.backgroundColor,antialias:e.antialias,roundPixels:e.roundPixels},this.game=t,this.type=a.CANVAS,this.drawCount=0,this.width=0,this.height=0,this.gameCanvas=t.canvas;var i={alpha:t.config.transparent,desynchronized:t.config.desynchronized};this.gameContext=e.context?e.context:this.gameCanvas.getContext("2d",i),this.currentContext=this.gameContext,this.antialias=t.config.antialias,this.blendModes=l(),this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this._tempMatrix1=new d,this._tempMatrix2=new d,this._tempMatrix3=new d,this.isBooted=!1,this.init()},init:function(){this.game.textures.once(c.READY,this.boot,this)},boot:function(){var t=this.game,e=t.scale.baseSize;this.width=e.width,this.height=e.height,this.isBooted=!0,t.scale.on(u.RESIZE,this.onResize,this),this.resize(e.width,e.height)},onResize:function(t,e){e.width===this.width&&e.height===this.height||this.resize(e.width,e.height)},resize:function(t,e){this.width=t,this.height=e,this.emit(h.RESIZE,t,e)},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(t){return this.currentContext.globalCompositeOperation=t,this},setContext:function(t){return this.currentContext=t||this.gameContext,this},setAlpha:function(t){return this.currentContext.globalAlpha=t,this},preRender:function(){var t=this.gameContext,e=this.config,i=this.width,s=this.height;t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),e.clearBeforeRender&&(t.clearRect(0,0,i,s),e.transparent||(t.fillStyle=e.backgroundColor.rgba,t.fillRect(0,0,i,s))),t.save(),this.drawCount=0,this.emit(h.PRE_RENDER)},render:function(t,e,i){var r=e.length;this.emit(h.RENDER,t,i);var n=i.x,a=i.y,o=i.width,l=i.height,u=i.renderToTexture?i.context:t.sys.context;u.save(),this.game.scene.customViewports&&(u.beginPath(),u.rect(n,a,o,l),u.clip()),i.emit(s.PRE_RENDER,i),this.currentContext=u;var c=i.mask;c&&c.preRenderCanvas(this,null,i._maskCamera),i.transparent||(u.fillStyle=i.backgroundColor.rgba,u.fillRect(n,a,o,l)),u.globalAlpha=i.alpha,u.globalCompositeOperation="source-over",this.drawCount+=r,i.renderToTexture&&i.emit(s.PRE_RENDER,i),i.matrix.copyToContext(u);for(var d=0;d=0?m=-(m+c):m<0&&(m=Math.abs(m)-c)),t.flipY&&(y>=0?y=-(y+d):y<0&&(y=Math.abs(y)-d))}var T=1,w=1;t.flipX&&(f||(m+=-e.realWidth+2*v),T=-1),t.flipY&&(f||(y+=-e.realHeight+2*g),w=-1),o.applyITRS(t.x,t.y,t.rotation,t.scaleX*T,t.scaleY*w),a.copyFrom(i.matrix),s?(a.multiplyWithOffset(s,-i.scrollX*t.scrollFactorX,-i.scrollY*t.scrollFactorY),o.e=t.x,o.f=t.y):(o.e-=i.scrollX*t.scrollFactorX,o.f-=i.scrollY*t.scrollFactorY),a.multiply(o),i.roundPixels&&(a.e=Math.round(a.e),a.f=Math.round(a.f)),n.save(),a.setToContext(n),n.globalCompositeOperation=this.blendModes[t.blendMode],n.globalAlpha=r,n.imageSmoothingEnabled=!(!this.antialias||e.source.scaleMode),t.mask&&t.mask.preRenderCanvas(this,t,i),n.drawImage(e.source.image,l,u,c,d,m,y,c/p,d/p),t.mask&&t.mask.postRenderCanvas(this,t,i),n.restore()}},destroy:function(){this.removeAllListeners(),this.game=null,this.gameCanvas=null,this.gameContext=null}});t.exports=f},6046:(t,e,i)=>{t.exports={CanvasRenderer:i(91135),GetBlendModes:i(32834),SetTransform:i(49584)}},32834:(t,e,i)=>{var s=i(95723),r=i(98581);t.exports=function(){var t=[],e=r.supportNewBlendModes,i="source-over";return t[s.NORMAL]=i,t[s.ADD]="lighter",t[s.MULTIPLY]=e?"multiply":i,t[s.SCREEN]=e?"screen":i,t[s.OVERLAY]=e?"overlay":i,t[s.DARKEN]=e?"darken":i,t[s.LIGHTEN]=e?"lighten":i,t[s.COLOR_DODGE]=e?"color-dodge":i,t[s.COLOR_BURN]=e?"color-burn":i,t[s.HARD_LIGHT]=e?"hard-light":i,t[s.SOFT_LIGHT]=e?"soft-light":i,t[s.DIFFERENCE]=e?"difference":i,t[s.EXCLUSION]=e?"exclusion":i,t[s.HUE]=e?"hue":i,t[s.SATURATION]=e?"saturation":i,t[s.COLOR]=e?"color":i,t[s.LUMINOSITY]=e?"luminosity":i,t[s.ERASE]="destination-out",t[s.SOURCE_IN]="source-in",t[s.SOURCE_OUT]="source-out",t[s.SOURCE_ATOP]="source-atop",t[s.DESTINATION_OVER]="destination-over",t[s.DESTINATION_IN]="destination-in",t[s.DESTINATION_OUT]="destination-out",t[s.DESTINATION_ATOP]="destination-atop",t[s.LIGHTER]="lighter",t[s.COPY]="copy",t[s.XOR]="xor",t}},49584:(t,e,i)=>{var s=i(73329);t.exports=function(t,e,i,r,n){var a=r.alpha*i.alpha;if(a<=0)return!1;var o=s(i,r,n).calc;return e.globalCompositeOperation=t.blendModes[i.blendMode],e.globalAlpha=a,e.save(),o.setToContext(e),e.imageSmoothingEnabled=!(!t.antialias||i.frame&&i.frame.source.scaleMode),!0}},70936:t=>{t.exports="postrender"},99298:t=>{t.exports="prerender"},7743:t=>{t.exports="render"},99519:t=>{t.exports="resize"},81044:(t,e,i)=>{t.exports={POST_RENDER:i(70936),PRE_RENDER:i(99298),RENDER:i(7743),RESIZE:i(99519)}},42069:(t,e,i)=>{t.exports={Canvas:i(6046),Events:i(81044),Snapshot:i(95528),WebGL:i(55478)}},61840:(t,e,i)=>{var s=i(61068),r=i(27119),n=i(72632);t.exports=function(t,e){var i=n(e,"callback"),a=n(e,"type","image/png"),o=n(e,"encoder",.92),h=Math.abs(Math.round(n(e,"x",0))),l=Math.abs(Math.round(n(e,"y",0))),u=n(e,"width",t.width),c=n(e,"height",t.height);if(n(e,"getPixel",!1)){var d=t.getContext("2d").getImageData(h,l,1,1).data;i.call(null,new r(d[0],d[1],d[2],d[3]/255))}else if(0!==h||0!==l||u!==t.width||c!==t.height){var f=s.createWebGL(this,u,c);f.getContext("2d").drawImage(t,h,l,u,c,0,0,u,c);var p=new Image;p.onerror=function(){i.call(null),s.remove(f)},p.onload=function(){i.call(null,p),s.remove(f)},p.src=f.toDataURL(a,o)}else{var v=new Image;v.onerror=function(){i.call(null)},v.onload=function(){i.call(null,v)},v.src=t.toDataURL(a,o)}}},1217:(t,e,i)=>{var s=i(61068),r=i(27119),n=i(72632);t.exports=function(t,e){var i=t.getContext("experimental-webgl"),a=n(e,"callback"),o=n(e,"type","image/png"),h=n(e,"encoder",.92),l=n(e,"x",0),u=n(e,"y",0),c=n(e,"getPixel",!1),d=n(e,"isFramebuffer",!1),f=d?n(e,"bufferWidth",1):i.drawingBufferWidth,p=d?n(e,"bufferHeight",1):i.drawingBufferHeight;if(c){var v=new Uint8Array(4),g=d?u:p-u;i.readPixels(l,g,1,1,i.RGBA,i.UNSIGNED_BYTE,v),a.call(null,new r(v[0],v[1],v[2],v[3]/255))}else{var m=n(e,"width",f),y=n(e,"height",p),x=new Uint8Array(m*y*4);i.readPixels(l,p-u-y,m,y,i.RGBA,i.UNSIGNED_BYTE,x);for(var T=s.createWebGL(this,m,y),w=T.getContext("2d"),E=w.getImageData(0,0,m,y),b=E.data,S=0;S{t.exports={Canvas:i(61840),WebGL:i(1217)}},35217:(t,e,i)=>{var s=i(56694),r=i(65641),n=i(33885),a=i(72632),o=i(37410),h=i(82127),l=i(5583),u=i(67589),c=i(66901),d=i(77310),f=i(10919),p=i(21213),v=i(51212),g=i(60848),m=new s({initialize:function(t){this.game=t.game,this.renderer=t,this.classes=new n([[r.UTILITY_PIPELINE,g],[r.MULTI_PIPELINE,d],[r.BITMAPMASK_PIPELINE,l],[r.SINGLE_PIPELINE,v],[r.ROPE_PIPELINE,p],[r.LIGHT_PIPELINE,c],[r.POINTLIGHT_PIPELINE,f],[r.GRAPHICS_PIPELINE,u]]),this.postPipelineClasses=new n,this.pipelines=new n,this.current=null,this.previous=null,this.MULTI_PIPELINE=null,this.BITMAPMASK_PIPELINE=null,this.UTILITY_PIPELINE=null,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2,this.renderTargets=[],this.maxDimension=0,this.frameInc=32,this.targetIndex=0},boot:function(t){var e=this.renderer,i=this.renderTargets;this.frameInc=Math.floor(a(t,"frameInc",32));for(var s,n,h=e.width,l=e.height,u=Math.min(h,l),c=Math.ceil(u/this.frameInc),d=1;d=0;i--){var s=e[i];s.active&&s.preBatch(t)}}},postBatch:function(t){if(t.hasPostPipeline){this.flush();for(var e=t.postPipelines,i=0;i=0;i--){var s=e[i];s.active&&s.preBatch(t)}}},postBatchCamera:function(t){if(t.hasPostPipeline){this.flush();for(var e=t.postPipelines,i=0;ithis.maxDimension)return this.targetIndex=e.length-3,e[this.targetIndex];var i=3*(h(t,this.frameInc,0,!0)-1);return this.targetIndex=i,e[i]},getSwapRenderTarget:function(){return this.renderTargets[this.targetIndex+1]},getAltSwapRenderTarget:function(){return this.renderTargets[this.targetIndex+2]},destroy:function(){this.flush(),this.classes.clear(),this.postPipelineClasses.clear(),this.pipelines.clear(),this.renderer=null,this.game=null,this.classes=null,this.postPipelineClasses=null,this.pipelines=null,this.current=null,this.previous=null}});t.exports=m},37410:(t,e,i)=>{var s=i(56694),r=i(81044),n=new s({initialize:function(t,e,i,s,r,n,a){void 0===s&&(s=1),void 0===r&&(r=0),void 0===n&&(n=!0),void 0===a&&(a=!1),this.renderer=t,this.framebuffer=null,this.texture=null,this.width=0,this.height=0,this.scale=s,this.minFilter=r,this.autoClear=n,this.autoResize=!1,this.resize(e,i),a&&this.setAutoResize(!0)},setAutoResize:function(t){return t&&!this.autoResize?(this.renderer.on(r.RESIZE,this.resize,this),this.autoResize=!0):!t&&this.autoResize&&(this.renderer.off(r.RESIZE,this.resize,this),this.autoResize=!1),this},resize:function(t,e){var i=t*this.scale,s=e*this.scale;if(i!==this.width||s!==this.height){var r=this.renderer;r.deleteFramebuffer(this.framebuffer),r.deleteTexture(this.texture),t*=this.scale,e*=this.scale,(t=Math.round(t))<=0&&(t=1),(e=Math.round(e))<=0&&(e=1),this.texture=r.createTextureFromSource(null,t,e,this.minFilter,!0),this.framebuffer=r.createFramebuffer(t,e,this.texture,!1),this.width=t,this.height=e}return this},bind:function(t,e,i){if(void 0===t&&(t=!1),t&&this.renderer.flush(),e&&i&&this.resize(e,i),this.renderer.pushFramebuffer(this.framebuffer,!1,!1,!1),t&&this.adjustViewport(),this.autoClear){var s=this.renderer.gl;s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT)}},adjustViewport:function(){var t=this.renderer.gl;t.viewport(0,0,this.width,this.height),t.disable(t.SCISSOR_TEST)},clear:function(){var t=this.renderer,e=t.gl;t.pushFramebuffer(this.framebuffer),e.disable(e.SCISSOR_TEST),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),t.popFramebuffer(),t.resetScissor()},unbind:function(t){void 0===t&&(t=!1);var e=this.renderer;return t&&e.flush(),e.popFramebuffer()},destroy:function(){var t=this.renderer;t.deleteFramebuffer(this.framebuffer),t.deleteTexture(this.texture),t.off(r.RESIZE,this.resize,this),this.renderer=null,this.framebuffer=null,this.texture=null}});t.exports=n},75512:t=>{t.exports={getTintFromFloats:function(t,e,i,s){return((255&(255*s|0))<<24|(255&(255*t|0))<<16|(255&(255*e|0))<<8|255&(255*i|0))>>>0},getTintAppendFloatAlpha:function(t,e){return((255&(255*e|0))<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255&(255*e|0))<<24|(255&(0|t))<<16|(255&(t>>8|0))<<8|255&(t>>16|0))>>>0},getFloatsFromUintRGB:function(t){return[(255&(t>>16|0))/255,(255&(t>>8|0))/255,(255&(0|t))/255]},checkShaderMax:function(t,e){var i=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);return e&&-1!==e?Math.min(i,e):i},parseFragmentShaderMaxTextures:function(t,e){return t?t.replace(/%count%/gi,e.toString()):""}}},44775:(t,e,i)=>{var s=i(56694),r=i(28699),n=i(6659),a=i(18970),o=i(72632),h=i(16650),l=i(81044),u=i(37410),c=i(75512),d=i(71305),f=new s({Extends:n,initialize:function(t){n.call(this);var e=t.game,i=e.renderer,s=i.gl;this.name=o(t,"name","WebGLPipeline"),this.game=e,this.renderer=i,this.manager,this.gl=s,this.view=e.canvas,this.width=0,this.height=0,this.vertexCount=0,this.vertexCapacity=0,this.vertexData,this.vertexBuffer,this.topology=o(t,"topology",s.TRIANGLES),this.bytes,this.vertexViewF32,this.vertexViewU32,this.active=!0,this.currentUnit=0,this.forceZero=o(t,"forceZero",!1),this.hasBooted=!1,this.isPostFX=!1,this.isSpriteFX=!1,this.renderTargets=[],this.currentRenderTarget,this.shaders=[],this.currentShader,this.projectionMatrix,this.projectionWidth=0,this.projectionHeight=0,this.config=t,this.glReset=!1},boot:function(){var t,e=this.gl,i=this.config,s=this.renderer;this.isPostFX||(this.projectionMatrix=(new h).identity());var r=this.renderTargets,n=o(i,"renderTarget",!1);"boolean"==typeof n&&n&&(n=1);var c=s.width,d=s.height;if("number"==typeof n)for(t=0;tx&&(x=y[t].vertexSize);var T=o(i,"batchSize",s.config.batchSize);this.vertexCapacity=6*T;var w=new ArrayBuffer(this.vertexCapacity*x);this.vertexData=w,this.bytes=new Uint8Array(w),this.vertexViewF32=new Float32Array(w),this.vertexViewU32=new Uint32Array(w);var E=o(i,"vertices",null);for(E?(this.vertexViewF32.set(E),this.vertexBuffer=s.createVertexBuffer(w,e.STATIC_DRAW)):this.vertexBuffer=s.createVertexBuffer(w.byteLength,e.DYNAMIC_DRAW),this.setVertexBuffer(),t=y.length-1;t>=0;t--)y[t].rebind();this.hasBooted=!0,s.on(l.RESIZE,this.resize,this),s.on(l.PRE_RENDER,this.onPreRender,this),s.on(l.RENDER,this.onRender,this),s.on(l.POST_RENDER,this.onPostRender,this),this.emit(a.BOOT,this),this.onBoot()},onBoot:function(){},onResize:function(){},setShader:function(t,e,i){var s=this.renderer;t===this.currentShader&&s.currentProgram===this.currentShader.program||(this.flush(),s.resetTextures(),this.setVertexBuffer(i)&&!e&&(e=!0),t.bind(e,!1),this.currentShader=t);return this},getShaderByName:function(t){for(var e=this.shaders,i=0;ithis.vertexCapacity},resize:function(t,e){t===this.width&&e===this.height||this.flush(),this.width=t,this.height=e;for(var i=this.renderTargets,s=0;s=0;i--){var s=e[i].rebind();t&&s!==t||(this.currentShader=s)}return this.emit(a.REBIND,this.currentShader),this.onActive(this.currentShader),this.onRebind(),this.glReset=!1,this},setVertexBuffer:function(t){void 0===t&&(t=this.vertexBuffer);var e=this.gl;return e.getParameter(e.ARRAY_BUFFER_BINDING)!==t&&(e.bindBuffer(e.ARRAY_BUFFER,t),!0)},preBatch:function(t){return this.currentRenderTarget&&this.currentRenderTarget.bind(),this.onPreBatch(t),this},postBatch:function(t){return this.onDraw(this.currentRenderTarget),this.onPostBatch(t),this},onDraw:function(){},unbind:function(){this.currentRenderTarget&&this.currentRenderTarget.unbind()},flush:function(t){if(void 0===t&&(t=!1),this.vertexCount>0){this.emit(a.BEFORE_FLUSH,this,t),this.onBeforeFlush(t);var e=this.gl,i=this.vertexCount,s=this.currentShader.vertexSize;this.active&&(this.setVertexBuffer(),i===this.vertexCapacity?e.bufferData(e.ARRAY_BUFFER,this.vertexData,e.DYNAMIC_DRAW):e.bufferSubData(e.ARRAY_BUFFER,0,this.bytes.subarray(0,i*s)),e.drawArrays(this.topology,0,i)),this.vertexCount=0,this.emit(a.AFTER_FLUSH,this,t),this.onAfterFlush(t)}return this},onActive:function(){},onBind:function(){},onRebind:function(){},onBatch:function(){},onPreBatch:function(){},onPostBatch:function(){},onPreRender:function(){},onRender:function(){},onPostRender:function(){},onBeforeFlush:function(){},onAfterFlush:function(){},batchVert:function(t,e,i,s,r,n,a){var o=this.vertexViewF32,h=this.vertexViewU32,l=this.vertexCount*this.currentShader.vertexComponentCount-1;o[++l]=t,o[++l]=e,o[++l]=i,o[++l]=s,o[++l]=r,o[++l]=n,h[++l]=a,this.vertexCount++},batchQuad:function(t,e,i,s,r,n,a,o,h,l,u,c,d,f,p,v,g,m,y,x){void 0===x&&(x=this.currentUnit);var T=!1;return this.shouldFlush(6)&&(this.flush(),T=!0,x=this.setTexture2D(y)),this.batchVert(e,i,l,u,x,m,f),this.batchVert(s,r,l,d,x,m,v),this.batchVert(n,a,c,d,x,m,g),this.batchVert(e,i,l,u,x,m,f),this.batchVert(n,a,c,d,x,m,g),this.batchVert(o,h,c,u,x,m,p),this.onBatch(t),T},batchTri:function(t,e,i,s,r,n,a,o,h,l,u,c,d,f,p,v,g){void 0===g&&(g=this.currentUnit);var m=!1;return this.shouldFlush(3)&&(this.flush(),m=!0,g=this.setTexture2D(v)),this.batchVert(e,i,o,h,g,p,c),this.batchVert(s,r,o,u,g,p,d),this.batchVert(n,a,l,u,g,p,f),this.onBatch(t),m},drawFillRect:function(t,e,i,s,r,n,a,o){void 0===a&&(a=this.renderer.whiteTexture.glTexture),void 0===o&&(o=!0),t=Math.floor(t),e=Math.floor(e);var h=Math.floor(t+i),l=Math.floor(e+s),u=this.setTexture2D(a),d=c.getTintAppendFloatAlphaAndSwap(r,n),f=0,p=1;o&&(f=1,p=0),this.batchQuad(null,t,e,t,l,h,l,h,e,0,f,1,p,d,d,d,d,0,a,u)},setTexture2D:function(t){return void 0===t&&(t=this.renderer.whiteTexture.glTexture),this.currentUnit=this.renderer.setTexture2D(t),this.currentUnit},bindTexture:function(t,e){void 0===e&&(e=0);var i=this.gl;return i.activeTexture(i.TEXTURE0+e),i.bindTexture(i.TEXTURE_2D,t),this},bindRenderTarget:function(t,e){return this.bindTexture(t.texture,e)},setTime:function(t){return this.set1f(t,this.game.loop.getDuration()),this},set1f:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set1f(t,e),this},set2f:function(t,e,i,s){return void 0===s&&(s=this.currentShader),s.set2f(t,e,i),this},set3f:function(t,e,i,s,r){return void 0===r&&(r=this.currentShader),r.set3f(t,e,i,s),this},set4f:function(t,e,i,s,r,n){return void 0===n&&(n=this.currentShader),n.set4f(t,e,i,s,r),this},set1fv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set1fv(t,e),this},set2fv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set2fv(t,e),this},set3fv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set3fv(t,e),this},set4fv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set4fv(t,e),this},set1iv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set1iv(t,e),this},set2iv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set2iv(t,e),this},set3iv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set3iv(t,e),this},set4iv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set4iv(t,e),this},set1i:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set1i(t,e),this},set2i:function(t,e,i,s){return void 0===s&&(s=this.currentShader),s.set2i(t,e,i),this},set3i:function(t,e,i,s,r){return void 0===r&&(r=this.currentShader),r.set3i(t,e,i,s),this},set4i:function(t,e,i,s,r,n){return void 0===n&&(n=this.currentShader),n.set4i(t,e,i,s,r),this},setMatrix2fv:function(t,e,i,s){return void 0===s&&(s=this.currentShader),s.setMatrix2fv(t,e,i),this},setMatrix3fv:function(t,e,i,s){return void 0===s&&(s=this.currentShader),s.setMatrix3fv(t,e,i),this},setMatrix4fv:function(t,e,i,s){return void 0===s&&(s=this.currentShader),s.setMatrix4fv(t,e,i),this},destroy:function(){var t;this.emit(a.DESTROY,this);var e=this.shaders;for(t=0;t{var s=i(66458),r=i(89787),n=i(56694),a=i(86459),o=i(6659),h=i(81044),l=i(97081),u=i(28621),c=i(16650),d=i(72283),f=i(35217),p=i(37410),v=i(40444),g=i(38203),m=i(75512),y=i(1217),x=new n({Extends:o,initialize:function(t){o.call(this);var e=t.config,i={alpha:e.transparent,desynchronized:e.desynchronized,depth:!1,antialias:e.antialiasGL,premultipliedAlpha:e.premultipliedAlpha,stencil:!0,failIfMajorPerformanceCaveat:e.failIfMajorPerformanceCaveat,powerPreference:e.powerPreference,preserveDrawingBuffer:e.preserveDrawingBuffer};this.config={clearBeforeRender:e.clearBeforeRender,antialias:e.antialias,backgroundColor:e.backgroundColor,contextCreation:i,roundPixels:e.roundPixels,maxTextures:e.maxTextures,maxTextureSize:e.maxTextureSize,batchSize:e.batchSize,maxLights:e.maxLights,mipmapFilter:e.mipmapFilter},this.game=t,this.type=a.WEBGL,this.pipelines=null,this.width=0,this.height=0,this.canvas=t.canvas,this.blendModes=[],this.contextLost=!1,this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92,isFramebuffer:!1,bufferWidth:0,bufferHeight:0},this.currentActiveTexture=0,this.startActiveTexture=0,this.maxTextures=0,this.textureIndexes,this.tempTextures,this.textureZero,this.normalTexture,this.currentFramebuffer=null,this.fboStack=[],this.currentProgram=null,this.currentBlendMode=1/0,this.currentScissorEnabled=!1,this.currentScissor=null,this.scissorStack=[],this.contextLostHandler=d,this.contextRestoredHandler=d,this.gl=null,this.supportedExtensions=null,this.instancedArraysExtension=null,this.vaoExtension=null,this.extensions={},this.glFormats=[],this.compression,this.drawingBufferHeight=0,this.blankTexture=null,this.whiteTexture=null,this.maskCount=0,this.maskStack=[],this.currentMask={mask:null,camera:null},this.currentCameraMask={mask:null,camera:null},this.glFuncMap=null,this.currentType="",this.newType=!1,this.nextTypeMatch=!1,this.finalType=!1,this.mipmapFilter=null,this.textureFlush=0,this.isTextureClean=!1,this.defaultScissor=[0,0,0,0],this.isBooted=!1,this.renderTarget=null,this.projectionMatrix,this.projectionWidth=0,this.projectionHeight=0,this.init(this.config)},init:function(t){var e,i=this.game,s=this.canvas,r=t.backgroundColor;if(!(e=i.config.context?i.config.context:s.getContext("webgl",t.contextCreation)||s.getContext("experimental-webgl",t.contextCreation))||e.isContextLost())throw this.contextLost=!0,new Error("WebGL unsupported");this.gl=e;var n=this;this.contextLostHandler=function(t){n.contextLost=!0,n.game.events.emit(l.CONTEXT_LOST,n),t.preventDefault()},this.contextRestoredHandler=function(){n.contextLost=!1,n.init(n.config),n.game.events.emit(l.CONTEXT_RESTORED,n)},s.addEventListener("webglcontextlost",this.contextLostHandler,!1),s.addEventListener("webglcontextrestored",this.contextRestoredHandler,!1),i.context=e;for(var o=0;o<=27;o++)this.blendModes.push({func:[e.ONE,e.ONE_MINUS_SRC_ALPHA],equation:e.FUNC_ADD});this.blendModes[1].func=[e.ONE,e.DST_ALPHA],this.blendModes[2].func=[e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA],this.blendModes[3].func=[e.ONE,e.ONE_MINUS_SRC_COLOR],this.blendModes[17]={func:[e.ZERO,e.ONE_MINUS_SRC_ALPHA],equation:e.FUNC_REVERSE_SUBTRACT},this.glFormats[0]=e.BYTE,this.glFormats[1]=e.SHORT,this.glFormats[2]=e.UNSIGNED_BYTE,this.glFormats[3]=e.UNSIGNED_SHORT,this.glFormats[4]=e.FLOAT,this.glFuncMap={mat2:{func:e.uniformMatrix2fv,length:1,matrix:!0},mat3:{func:e.uniformMatrix3fv,length:1,matrix:!0},mat4:{func:e.uniformMatrix4fv,length:1,matrix:!0},"1f":{func:e.uniform1f,length:1},"1fv":{func:e.uniform1fv,length:1},"1i":{func:e.uniform1i,length:1},"1iv":{func:e.uniform1iv,length:1},"2f":{func:e.uniform2f,length:2},"2fv":{func:e.uniform2fv,length:1},"2i":{func:e.uniform2i,length:2},"2iv":{func:e.uniform2iv,length:1},"3f":{func:e.uniform3f,length:3},"3fv":{func:e.uniform3fv,length:1},"3i":{func:e.uniform3i,length:3},"3iv":{func:e.uniform3iv,length:1},"4f":{func:e.uniform4f,length:4},"4fv":{func:e.uniform4fv,length:1},"4i":{func:e.uniform4i,length:4},"4iv":{func:e.uniform4iv,length:1}};var h=e.getSupportedExtensions();t.maxTextures&&-1!==t.maxTextures||(t.maxTextures=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),t.maxTextureSize||(t.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE)),this.compression=this.getCompressedTextures(),this.supportedExtensions=h;var u="ANGLE_instanced_arrays";this.instancedArraysExtension=h.indexOf(u)>-1?e.getExtension(u):null;var d="OES_vertex_array_object";this.vaoExtension=h.indexOf(d)>-1?e.getExtension(d):null,e.disable(e.DEPTH_TEST),e.disable(e.CULL_FACE),e.enable(e.BLEND),e.clearColor(r.redGL,r.greenGL,r.blueGL,r.alphaGL),this.mipmapFilter=e[t.mipmapFilter],this.maxTextures=m.checkShaderMax(e,t.maxTextures),this.textureIndexes=[];var p=this.tempTextures;if(Array.isArray(p))for(var v=0;o0&&s>0;if(a&&o){var h=a[0],l=a[1],u=a[2],c=a[3];o=h!==t||l!==e||u!==i||c!==s}o&&(this.flush(),n.scissor(t,r-e-s,i,s))},resetScissor:function(){var t=this.gl;t.enable(t.SCISSOR_TEST);var e=this.currentScissor;if(e){var i=e[0],s=e[1],r=e[2],n=e[3];r>0&&n>0&&t.scissor(i,this.drawingBufferHeight-s-n,r,n)}},popScissor:function(){var t=this.scissorStack;t.pop();var e=t[t.length-1];e&&this.setScissor(e[0],e[1],e[2],e[3]),this.currentScissor=e},hasActiveStencilMask:function(){var t=this.currentMask.mask,e=this.currentCameraMask.mask;return t&&t.isStencil||e&&e.isStencil},resetViewport:function(){var t=this.gl;t.viewport(0,0,this.width,this.height),this.drawingBufferHeight=t.drawingBufferHeight},setBlendMode:function(t,e){void 0===e&&(e=!1);var i=this.gl,s=this.blendModes[t];return!!(e||t!==a.BlendModes.SKIP_CHECK&&this.currentBlendMode!==t)&&(this.flush(),i.enable(i.BLEND),i.blendEquation(s.equation),s.func.length>2?i.blendFuncSeparate(s.func[0],s.func[1],s.func[2],s.func[3]):i.blendFunc(s.func[0],s.func[1]),this.currentBlendMode=t,!0)},addBlendMode:function(t,e){return this.blendModes.push({func:t,equation:e})-1},updateBlendMode:function(t,e,i){return this.blendModes[t]&&(this.blendModes[t].func=e,i&&(this.blendModes[t].equation=i)),this},removeBlendMode:function(t){return t>17&&this.blendModes[t]&&this.blendModes.splice(t,1),this},setBlankTexture:function(){this.setTexture2D(this.blankTexture.glTexture)},setTextureSource:function(t){if(this.pipelines.forceZero())return this.setTextureZero(t.glTexture,!0),0;var e=this.gl,i=this.currentActiveTexture;return t.glIndexCounter0)&&this.pipelines.setMulti().drawFillRect(e,i,s,n,m.getTintFromFloats(a.blueGL,a.greenGL,a.redGL,1),a.alphaGL)},getCurrentStencilMask:function(){var t=null,e=this.maskStack,i=this.currentCameraMask;return e.length>0?t=e[e.length-1]:i.mask&&i.mask.isStencil&&(t=i),t},postRenderCamera:function(t){var e=t.flashEffect,i=t.fadeEffect;if(e.isRunning||i.isRunning||i.isComplete){var s=this.pipelines.setMulti();e.postRenderWebGL(s,m.getTintFromFloats),i.postRenderWebGL(s,m.getTintFromFloats)}t.dirty=!1,this.popScissor(),t.mask&&(this.currentCameraMask.mask=null,t.mask.postRenderWebGL(this,t._maskCamera)),this.pipelines.postBatchCamera(t),t.emit(r.POST_RENDER,t)},preRender:function(){if(!this.contextLost){var t=this.gl;if(t.bindFramebuffer(t.FRAMEBUFFER,null),this.config.clearBeforeRender){var e=this.config.backgroundColor;t.clearColor(e.redGL,e.greenGL,e.blueGL,e.alphaGL),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT|t.STENCIL_BUFFER_BIT)}t.enable(t.SCISSOR_TEST),this.currentScissor=this.defaultScissor,this.scissorStack.length=0,this.scissorStack.push(this.currentScissor),this.game.scene.customViewports&&t.scissor(0,this.drawingBufferHeight-this.height,this.width,this.height),this.currentMask.mask=null,this.currentCameraMask.mask=null,this.maskStack.length=0,this.textureFlush=0,this.emit(h.PRE_RENDER)}},render:function(t,e,i){if(!this.contextLost){var s=e.length;if(this.emit(h.RENDER,t,i),this.preRenderCamera(i),0===s)return this.setBlendMode(a.BlendModes.NORMAL),void this.postRenderCamera(i);this.currentType="";for(var r=this.currentMask,n=0;n0&&(this.startActiveTexture++,this.currentActiveTexture=1)}},snapshot:function(t,e,i){return this.snapshotArea(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight,t,e,i)},snapshotArea:function(t,e,i,s,r,n,a){var o=this.snapshotState;return o.callback=r,o.type=n,o.encoder=a,o.getPixel=!1,o.x=t,o.y=e,o.width=Math.min(i,this.gl.drawingBufferWidth),o.height=Math.min(s,this.gl.drawingBufferHeight),this},snapshotPixel:function(t,e,i){return this.snapshotArea(t,e,1,1,i),this.snapshotState.getPixel=!0,this},snapshotFramebuffer:function(t,e,i,s,r,n,a,o,h,l,u){void 0===r&&(r=!1),void 0===n&&(n=0),void 0===a&&(a=0),void 0===o&&(o=e),void 0===h&&(h=i);var c=this.currentFramebuffer;this.snapshotArea(n,a,o,h,s,l,u);var d=this.snapshotState;return d.getPixel=r,d.isFramebuffer=!0,d.bufferWidth=e,d.bufferHeight=i,this.setFramebuffer(t),y(this.canvas,d),this.setFramebuffer(c),d.callback=null,d.isFramebuffer=!1,this},canvasToTexture:function(t,e,i,s){return void 0===i&&(i=!1),void 0===s&&(s=!1),e?this.updateCanvasTexture(t,e,s):this.createCanvasTexture(t,i,s)},createCanvasTexture:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var s=this.gl,r=s.NEAREST,n=s.NEAREST,a=t.width,o=t.height,h=s.CLAMP_TO_EDGE,l=u(a,o);return!e&&l&&(h=s.REPEAT),this.config.antialias&&(r=l?this.mipmapFilter:s.LINEAR,n=s.LINEAR),this.createTexture2D(0,r,n,h,h,s.RGBA,t,a,o,!0,!1,i)},updateCanvasTexture:function(t,e,i){void 0===i&&(i=!1);var s=this.gl,r=t.width,n=t.height;if(r>0&&n>0){s.activeTexture(s.TEXTURE0);var a=s.getParameter(s.TEXTURE_BINDING_2D);s.bindTexture(s.TEXTURE_2D,e),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,i),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,s.RGBA,s.UNSIGNED_BYTE,t),e.width=r,e.height=n,a&&s.bindTexture(s.TEXTURE_2D,a)}return e},createVideoTexture:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var s=this.gl,r=s.NEAREST,n=s.NEAREST,a=t.videoWidth,o=t.videoHeight,h=s.CLAMP_TO_EDGE,l=u(a,o);return!e&&l&&(h=s.REPEAT),this.config.antialias&&(r=l?this.mipmapFilter:s.LINEAR,n=s.LINEAR),this.createTexture2D(0,r,n,h,h,s.RGBA,t,a,o,!0,!0,i)},updateVideoTexture:function(t,e,i){void 0===i&&(i=!1);var s=this.gl,r=t.videoWidth,n=t.videoHeight;if(r>0&&n>0){s.activeTexture(s.TEXTURE0);var a=s.getParameter(s.TEXTURE_BINDING_2D);s.bindTexture(s.TEXTURE_2D,e),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,i),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,s.RGBA,s.UNSIGNED_BYTE,t),e.width=r,e.height=n,a&&s.bindTexture(s.TEXTURE_2D,a)}return e},setTextureFilter:function(t,e){var i=this.gl,s=[i.LINEAR,i.NEAREST][e];i.activeTexture(i.TEXTURE0);var r=i.getParameter(i.TEXTURE_BINDING_2D);return i.bindTexture(i.TEXTURE_2D,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,s),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,s),r&&i.bindTexture(i.TEXTURE_2D,r),this},getMaxTextureSize:function(){return this.config.maxTextureSize},destroy:function(){this.canvas.removeEventListener("webglcontextlost",this.contextLostHandler,!1),this.canvas.removeEventListener("webglcontextrestored",this.contextRestoredHandler,!1);for(var t=this.gl,e=this.tempTextures,i=0;i{var s=i(56694),r=i(72632),n=i(71402),a=new s({initialize:function(t,e,i,s,r){this.pipeline=t,this.name=e,this.renderer=t.renderer,this.gl=this.renderer.gl,this.program=this.renderer.createProgram(i,s),this.attributes,this.vertexComponentCount=0,this.vertexSize=0,this.uniforms={},this.createAttributes(r),this.createUniforms()},createAttributes:function(t){var e=0,i=0,s=[];this.vertexComponentCount=0;for(var a=0;a=0?(e.enableVertexAttribArray(f),e.vertexAttribPointer(f,o,h,d,i,l),a.enabled=!0,a.location=f):-1!==f&&e.disableVertexAttribArray(f)}else u?e.vertexAttribPointer(c,o,h,d,i,l):!u&&c>-1&&(e.disableVertexAttribArray(c),a.location=-1)}return this},createUniforms:function(){var t,e,i,s=this.gl,r=this.program,n=this.uniforms,a=s.getProgramParameter(r,s.ACTIVE_UNIFORMS);for(t=0;t0&&(e=e.substr(0,h),n.hasOwnProperty(e)||null!==(i=s.getUniformLocation(r,e))&&(n[e]={name:e,location:i,value1:null,value2:null,value3:null,value4:null}))}}return this},hasUniform:function(t){return this.uniforms.hasOwnProperty(t)},resetUniform:function(t){var e=this.uniforms[t];return e&&(e.value1=null,e.value2=null,e.value3=null,e.value4=null),this},setUniform1:function(t,e,i,s){var r=this.uniforms[e];return r?((s||r.value1!==i)&&(r.value1=i,this.renderer.setProgram(this.program),t.call(this.gl,r.location,i),this.pipeline.currentShader=this),this):this},setUniform2:function(t,e,i,s,r){var n=this.uniforms[e];return n?((r||n.value1!==i||n.value2!==s)&&(n.value1=i,n.value2=s,this.renderer.setProgram(this.program),t.call(this.gl,n.location,i,s),this.pipeline.currentShader=this),this):this},setUniform3:function(t,e,i,s,r,n){var a=this.uniforms[e];return a?((n||a.value1!==i||a.value2!==s||a.value3!==r)&&(a.value1=i,a.value2=s,a.value3=r,this.renderer.setProgram(this.program),t.call(this.gl,a.location,i,s,r),this.pipeline.currentShader=this),this):this},setUniform4:function(t,e,i,s,r,n,a){var o=this.uniforms[e];return o?((a||o.value1!==i||o.value2!==s||o.value3!==r||o.value4!==n)&&(o.value1=i,o.value2=s,o.value3=r,o.value4=n,this.renderer.setProgram(this.program),t.call(this.gl,o.location,i,s,r,n),this.pipeline.currentShader=this),this):this},set1f:function(t,e){return this.setUniform1(this.gl.uniform1f,t,e)},set2f:function(t,e,i){return this.setUniform2(this.gl.uniform2f,t,e,i)},set3f:function(t,e,i,s){return this.setUniform3(this.gl.uniform3f,t,e,i,s)},set4f:function(t,e,i,s,r){return this.setUniform4(this.gl.uniform4f,t,e,i,s,r)},set1fv:function(t,e){return this.setUniform1(this.gl.uniform1fv,t,e,!0)},set2fv:function(t,e){return this.setUniform1(this.gl.uniform2fv,t,e,!0)},set3fv:function(t,e){return this.setUniform1(this.gl.uniform3fv,t,e,!0)},set4fv:function(t,e){return this.setUniform1(this.gl.uniform4fv,t,e,!0)},set1iv:function(t,e){return this.setUniform1(this.gl.uniform1iv,t,e,!0)},set2iv:function(t,e){return this.setUniform1(this.gl.uniform2iv,t,e,!0)},set3iv:function(t,e){return this.setUniform1(this.gl.uniform3iv,t,e,!0)},set4iv:function(t,e){return this.setUniform1(this.gl.uniform4iv,t,e,!0)},set1i:function(t,e){return this.setUniform1(this.gl.uniform1i,t,e)},set2i:function(t,e,i){return this.setUniform2(this.gl.uniform2i,t,e,i)},set3i:function(t,e,i,s){return this.setUniform3(this.gl.uniform3i,t,e,i,s)},set4i:function(t,e,i,s,r){return this.setUniform4(this.gl.uniform4i,t,e,i,s,r)},setMatrix2fv:function(t,e,i){return this.setUniform2(this.gl.uniformMatrix2fv,t,e,i,!0)},setMatrix3fv:function(t,e,i){return this.setUniform2(this.gl.uniformMatrix3fv,t,e,i,!0)},setMatrix4fv:function(t,e,i){return this.setUniform2(this.gl.uniformMatrix4fv,t,e,i,!0)},destroy:function(){this.gl.deleteProgram(this.program),this.pipeline=null,this.renderer=null,this.gl=null,this.program=null,this.attributes=null,this.uniforms=null}});t.exports=a},71402:t=>{t.exports={BYTE:{enum:5120,size:1},UNSIGNED_BYTE:{enum:5121,size:1},SHORT:{enum:5122,size:2},UNSIGNED_SHORT:{enum:5123,size:2},INT:{enum:5124,size:4},UNSIGNED_INT:{enum:5125,size:4},FLOAT:{enum:5126,size:4}}},55478:(t,e,i)=>{var s=i(71402),r=i(98611),n={PipelineManager:i(35217),Pipelines:i(62253),RenderTarget:i(37410),Utils:i(75512),WebGLPipeline:i(44775),WebGLRenderer:i(11857),WebGLShader:i(71305)};n=r(!1,n,s),t.exports=n},5583:(t,e,i)=>{var s=i(56694),r=i(72632),n=i(91679),a=i(89053),o=i(71402),h=i(44775),l=new s({Extends:h,initialize:function(t){t.fragShader=r(t,"fragShader",n),t.vertShader=r(t,"vertShader",a),t.batchSize=r(t,"batchSize",1),t.vertices=r(t,"vertices",[-1,1,-1,-7,7,1]),t.attributes=r(t,"attributes",[{name:"inPosition",size:2,type:o.FLOAT}]),h.call(this,t)},boot:function(){h.prototype.boot.call(this),this.set1i("uMainSampler",0),this.set1i("uMaskSampler",1)},resize:function(t,e){h.prototype.resize.call(this,t,e),this.set2f("uResolution",t,e)},beginMask:function(t,e,i){var s=this.gl;if(t.bitmapMask&&s){var r=this.renderer;r.flush(),r.pushFramebuffer(t.mainFramebuffer),s.disable(s.STENCIL_TEST),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT),r.currentCameraMask.mask!==t&&(r.currentMask.mask=t,r.currentMask.camera=i)}},endMask:function(t,e){var i=this.gl,s=this.renderer,r=t.bitmapMask;if(r&&i){s.flush(),s.pushFramebuffer(t.maskFramebuffer),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),s.setBlendMode(0,!0),r.renderWebGL(s,r,e),s.flush(),s.popFramebuffer(),s.popFramebuffer();var n=s.getCurrentStencilMask();n?(i.enable(i.STENCIL_TEST),n.mask.applyStencil(s,n.camera,!0)):s.currentMask.mask=null,s.pipelines.set(this),i.activeTexture(i.TEXTURE1),i.bindTexture(i.TEXTURE_2D,t.maskTexture),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,t.mainTexture),this.set1i("uInvertMaskAlpha",t.invertAlpha),i.drawArrays(this.topology,0,3),s.resetTextures()}}});t.exports=l},67589:(t,e,i)=>{var s=i(56694),r=i(11117),n=i(72632),a=i(37699),o=i(28739),h=i(69360),l=i(71402),u=i(44775),c=new s({Extends:u,initialize:function(t){t.fragShader=n(t,"fragShader",a),t.vertShader=n(t,"vertShader",o),t.attributes=n(t,"attributes",[{name:"inPosition",size:2},{name:"inColor",size:4,type:l.UNSIGNED_BYTE,normalized:!0}]),u.call(this,t),this.calcMatrix=new h,this.tempTriangle=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}],this.strokeTint={TL:0,TR:0,BL:0,BR:0},this.fillTint={TL:0,TR:0,BL:0,BR:0},this.currentFrame={u0:0,v0:0,u1:1,v1:1},this.firstQuad=[0,0,0,0,0],this.prevQuad=[0,0,0,0,0],this.polygonCache=[]},batchFillRect:function(t,e,i,s,r,n){this.renderer.pipelines.set(this);var a=this.calcMatrix;n&&n.multiply(r,a);var o=t+i,h=e+s,l=a.getX(t,e),u=a.getY(t,e),c=a.getX(t,h),d=a.getY(t,h),f=a.getX(o,h),p=a.getY(o,h),v=a.getX(o,e),g=a.getY(o,e),m=this.fillTint;this.batchQuad(l,u,c,d,f,p,v,g,m.TL,m.TR,m.BL,m.BR)},batchFillTriangle:function(t,e,i,s,r,n,a,o){this.renderer.pipelines.set(this);var h=this.calcMatrix;o&&o.multiply(a,h);var l=h.getX(t,e),u=h.getY(t,e),c=h.getX(i,s),d=h.getY(i,s),f=h.getX(r,n),p=h.getY(r,n),v=this.fillTint;this.batchTri(l,u,c,d,f,p,v.TL,v.TR,v.BL)},batchStrokeTriangle:function(t,e,i,s,r,n,a,o,h){var l=this.tempTriangle;l[0].x=t,l[0].y=e,l[0].width=a,l[1].x=i,l[1].y=s,l[1].width=a,l[2].x=r,l[2].y=n,l[2].width=a,l[3].x=t,l[3].y=e,l[3].width=a,this.batchStrokePath(l,a,!1,o,h)},batchFillPath:function(t,e,i){this.renderer.pipelines.set(this);var s=this.calcMatrix;i&&i.multiply(e,s);for(var n,a,o=t.length,h=this.polygonCache,l=this.fillTint.TL,u=this.fillTint.TR,c=this.fillTint.BL,d=0;d0&&X[4]?this.batchQuad(F,D,M,P,X[0],X[1],X[2],X[3],I,B,N,Y):(U[0]=F,U[1]=D,U[2]=M,U[3]=P,U[4]=1),h&&U[4]?this.batchQuad(C,R,O,L,U[0],U[1],U[2],U[3],I,B,N,Y):(X[0]=C,X[1]=R,X[2]=O,X[3]=L,X[4]=1)}},batchVert:function(t,e,i){var s=this.vertexViewF32,r=this.vertexViewU32,n=this.vertexCount*this.currentShader.vertexComponentCount-1;s[++n]=t,s[++n]=e,r[++n]=i,this.vertexCount++},batchQuad:function(t,e,i,s,r,n,a,o,h,l,u,c){var d=!1;return this.shouldFlush(6)&&(this.flush(),d=!0),this.batchVert(t,e,h),this.batchVert(i,s,u),this.batchVert(r,n,c),this.batchVert(t,e,h),this.batchVert(r,n,c),this.batchVert(a,o,l),d},batchTri:function(t,e,i,s,r,n,a,o,h){var l=!1;return this.shouldFlush(3)&&(this.flush(),l=!0),this.batchVert(t,e,a),this.batchVert(i,s,o),this.batchVert(r,n,h),l},destroy:function(){return u.prototype.destroy.call(this),this.polygonCache=null,this}});t.exports=c},66901:(t,e,i)=>{var s=i(56694),r=i(72632),n=i(65045),a=i(77310),o=i(93736),h=i(44775),l=10,u=new o,c=new s({Extends:a,initialize:function(t){l=t.game.renderer.config.maxLights;for(var e=r(t,"fragShader",n),i=[],s=1;s<=l;s++)i.push({name:"lights"+s,fragShader:e.replace("%LIGHT_COUNT%",s.toString())});t.shaders=i,a.call(this,t),this.inverseRotationMatrix=new Float32Array([1,0,0,0,1,0,0,0,1]),this.defaultNormalMap,this.lightsActive=!0},boot:function(){h.prototype.boot.call(this);var t=this.gl,e=t.createTexture();t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,e),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array([127,127,255,255])),this.defaultNormalMap={glTexture:e};for(var i=0;i0&&this.flush();var e=this.inverseRotationMatrix;if(t){var i=-t,s=Math.cos(i),r=Math.sin(i);e[1]=r,e[3]=-r,e[0]=e[4]=s}else e[0]=e[4]=1,e[1]=e[3]=0;this.setMatrix3fv("uInverseRotationMatrix",!1,e),this.currentNormalMapRotation=t}},setTexture2D:function(t,e){var i=this.renderer;void 0===t&&(t=i.tempTextures[0]);var s=this.getNormalMap(e);i.isNewNormalMap(t,s)&&(this.flush(),i.setTextureZero(t),i.setNormalMap(s));var r=e?e.rotation:0;return this.setNormalMapRotation(r),this.currentUnit=0,0},setGameObject:function(t,e){void 0===e&&(e=t.frame);var i=this.renderer,s=e.glTexture,r=this.getNormalMap(t);return i.isNewNormalMap()&&(this.flush(),i.setTextureZero(s),i.setNormalMap(r)),this.setNormalMapRotation(t.rotation),this.currentUnit=0,0},getNormalMap:function(t){var e;return t?t.displayTexture?e=t.displayTexture.dataSource[t.displayFrame.sourceIndex]:t.texture?e=t.texture.dataSource[t.frame.sourceIndex]:t.tileset&&(e=Array.isArray(t.tileset)?t.tileset[0].image.dataSource[0]:t.tileset.image.dataSource[0]):e=this.defaultNormalMap,e||(e=this.defaultNormalMap),e.glTexture},batchSprite:function(t,e,i){this.lightsActive&&a.prototype.batchSprite.call(this,t,e,i)},batchTexture:function(t,e,i,s,r,n,o,h,l,u,c,d,f,p,v,g,m,y,x,T,w,E,b,S,A,_,C,R,M,P,O,L){this.lightsActive&&a.prototype.batchTexture.call(this,t,e,i,s,r,n,o,h,l,u,c,d,f,p,v,g,m,y,x,T,w,E,b,S,A,_,C,R,M,P,O,L)},batchTextureFrame:function(t,e,i,s,r,n,o){this.lightsActive&&a.prototype.batchTextureFrame.call(this,t,e,i,s,r,n,o)}});c.LIGHT_COUNT=l,t.exports=c},77310:(t,e,i)=>{var s=i(56694),r=i(11117),n=i(72632),a=i(53787),o=i(15968),h=i(69360),l=i(75512),u=i(71402),c=i(44775),d=new s({Extends:c,initialize:function(t){var e=t.game.renderer,i=n(t,"fragShader",a);t.fragShader=l.parseFragmentShaderMaxTextures(i,e.maxTextures),t.vertShader=n(t,"vertShader",o),t.attributes=n(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexId"},{name:"inTintEffect"},{name:"inTint",size:4,type:u.UNSIGNED_BYTE,normalized:!0}]),c.call(this,t),this._tempMatrix1=new h,this._tempMatrix2=new h,this._tempMatrix3=new h,this.calcMatrix=new h,this.tempTriangle=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}],this.strokeTint={TL:0,TR:0,BL:0,BR:0},this.fillTint={TL:0,TR:0,BL:0,BR:0},this.currentFrame={u0:0,v0:0,u1:1,v1:1},this.firstQuad=[0,0,0,0,0],this.prevQuad=[0,0,0,0,0],this.polygonCache=[]},boot:function(){c.prototype.boot.call(this),this.currentShader.set1iv("uMainSampler",this.renderer.textureIndexes)},batchSprite:function(t,e,i){this.manager.set(this,t);var s=this._tempMatrix1,r=this._tempMatrix2,n=this._tempMatrix3,a=t.frame,o=a.glTexture,h=a.u0,u=a.v0,c=a.u1,d=a.v1,f=a.x,p=a.y,v=a.cutWidth,g=a.cutHeight,m=a.customPivot,y=t.displayOriginX,x=t.displayOriginY,T=-y+f,w=-x+p;if(t.isCropped){var E=t._crop;E.flipX===t.flipX&&E.flipY===t.flipY||a.updateCropUVs(E,t.flipX,t.flipY),h=E.u0,u=E.v0,c=E.u1,d=E.v1,v=E.width,g=E.height,T=-y+(f=E.x),w=-x+(p=E.y)}var b=1,S=1;t.flipX&&(m||(T+=-a.realWidth+2*y),b=-1),(t.flipY||a.source.isGLTexture&&!o.flipY)&&(m||(w+=-a.realHeight+2*x),S=-1),r.applyITRS(t.x,t.y,t.rotation,t.scaleX*b,t.scaleY*S),s.copyFrom(e.matrix),i?(s.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),r.e=t.x,r.f=t.y):(r.e-=e.scrollX*t.scrollFactorX,r.f-=e.scrollY*t.scrollFactorY),s.multiply(r,n);var A=T+v,_=w+g,C=e.roundPixels,R=n.getXRound(T,w,C),M=n.getXRound(T,_,C),P=n.getXRound(A,_,C),O=n.getXRound(A,w,C),L=n.getYRound(T,w,C),F=n.getYRound(T,_,C),D=n.getYRound(A,_,C),k=n.getYRound(A,w,C),I=l.getTintAppendFloatAlpha,B=e.alpha,N=I(t.tintTopLeft,B*t._alphaTL),Y=I(t.tintTopRight,B*t._alphaTR),X=I(t.tintBottomLeft,B*t._alphaBL),U=I(t.tintBottomRight,B*t._alphaBR);this.shouldFlush(6)&&this.flush();var z=this.setGameObject(t,a);this.manager.preBatch(t),this.batchQuad(t,R,L,M,F,P,D,O,k,h,u,c,d,N,Y,X,U,t.tintFill,o,z),this.manager.postBatch(t)},batchTexture:function(t,e,i,s,r,n,a,o,h,l,u,c,d,f,p,v,g,m,y,x,T,w,E,b,S,A,_,C,R,M,P,O){this.manager.set(this,t);var L=this._tempMatrix1,F=this._tempMatrix2,D=this._tempMatrix3,k=m/i+_,I=y/s+C,B=(m+x)/i+_,N=(y+T)/s+C,Y=a,X=o,U=-v,z=-g;if(t.isCropped){var G=t._crop,W=G.width,V=G.height;Y=W,X=V,a=W,o=V;var H=m=G.x,j=y=G.y;c&&(H=x-G.x-W),d&&(j=T-G.y-V),k=H/i+_,I=j/s+C,B=(H+W)/i+_,N=(j+V)/s+C,U=-v+m,z=-g+y}c&&(Y*=-1,U+=a),(d^=!P&&e.isRenderTexture?1:0)&&(X*=-1,z+=o);var K=U+Y,q=z+X;F.applyITRS(r,n,u,h,l),L.copyFrom(R.matrix),M?(L.multiplyWithOffset(M,-R.scrollX*f,-R.scrollY*p),F.e=r,F.f=n):(F.e-=R.scrollX*f,F.f-=R.scrollY*p),L.multiply(F,D);var Z=R.roundPixels,J=D.getXRound(U,z,Z),Q=D.getYRound(U,z,Z),$=D.getXRound(U,q,Z),tt=D.getYRound(U,q,Z),et=D.getXRound(K,q,Z),it=D.getYRound(K,q,Z),st=D.getXRound(K,z,Z),rt=D.getYRound(K,z,Z);void 0===O&&(O=this.renderer.setTexture2D(e)),t&&this.manager.preBatch(t),this.batchQuad(t,J,Q,$,tt,et,it,st,rt,k,I,B,N,w,E,b,S,A,e,O),t&&this.manager.postBatch(t)},batchTextureFrame:function(t,e,i,s,r,n,a){this.manager.set(this);var o=this._tempMatrix1.copyFrom(n),h=this._tempMatrix2,u=e+t.width,c=i+t.height;a?o.multiply(a,h):h=o;var d=h.getX(e,i),f=h.getY(e,i),p=h.getX(e,c),v=h.getY(e,c),g=h.getX(u,c),m=h.getY(u,c),y=h.getX(u,i),x=h.getY(u,i),T=this.renderer.setTextureSource(t.source);s=l.getTintAppendFloatAlpha(s,r),this.batchQuad(null,d,f,p,v,g,m,y,x,t.u0,t.v0,t.u1,t.v1,s,s,s,s,0,t.glTexture,T)},batchFillRect:function(t,e,i,s,r,n){this.renderer.pipelines.set(this);var a=this.calcMatrix;n&&n.multiply(r,a);var o=t+i,h=e+s,l=a.getX(t,e),u=a.getY(t,e),c=a.getX(t,h),d=a.getY(t,h),f=a.getX(o,h),p=a.getY(o,h),v=a.getX(o,e),g=a.getY(o,e),m=this.fillTint;this.batchQuad(null,l,u,c,d,f,p,v,g,0,0,1,1,m.TL,m.TR,m.BL,m.BR,2)},batchFillTriangle:function(t,e,i,s,r,n,a,o){this.renderer.pipelines.set(this);var h=this.calcMatrix;o&&o.multiply(a,h);var l=h.getX(t,e),u=h.getY(t,e),c=h.getX(i,s),d=h.getY(i,s),f=h.getX(r,n),p=h.getY(r,n),v=this.fillTint;this.batchTri(null,l,u,c,d,f,p,0,0,1,1,v.TL,v.TR,v.BL,2)},batchStrokeTriangle:function(t,e,i,s,r,n,a,o,h){var l=this.tempTriangle;l[0].x=t,l[0].y=e,l[0].width=a,l[1].x=i,l[1].y=s,l[1].width=a,l[2].x=r,l[2].y=n,l[2].width=a,l[3].x=t,l[3].y=e,l[3].width=a,this.batchStrokePath(l,a,!1,o,h)},batchFillPath:function(t,e,i){this.renderer.pipelines.set(this);var s=this.calcMatrix;i&&i.multiply(e,s);for(var n,a,o=t.length,h=this.polygonCache,l=this.fillTint.TL,u=this.fillTint.TR,c=this.fillTint.BL,d=0;d0&&X[4]?this.batchQuad(null,F,D,M,P,X[0],X[1],X[2],X[3],0,0,1,1,I,B,N,Y,2):(U[0]=F,U[1]=D,U[2]=M,U[3]=P,U[4]=1),h&&U[4]?this.batchQuad(null,C,R,O,L,U[0],U[1],U[2],U[3],0,0,1,1,I,B,N,Y,2):(X[0]=C,X[1]=R,X[2]=O,X[3]=L,X[4]=1)}}});t.exports=d},10919:(t,e,i)=>{var s=i(56694),r=i(72632),n=i(83327),a=i(54677),o=i(44775),h=new s({Extends:o,initialize:function(t){t.vertShader=r(t,"vertShader",a),t.fragShader=r(t,"fragShader",n),t.attributes=r(t,"attributes",[{name:"inPosition",size:2},{name:"inLightPosition",size:2},{name:"inLightRadius"},{name:"inLightAttenuation"},{name:"inLightColor",size:4}]),o.call(this,t)},onRender:function(t,e){this.set2f("uResolution",this.width,this.height),this.set1f("uCameraZoom",e.zoom)},batchPointLight:function(t,e,i,s,r,n,a,o,h,l,u,c){var d=t.color,f=t.intensity,p=t.radius,v=t.attenuation,g=d.r*f,m=d.g*f,y=d.b*f,x=e.alpha*t.alpha;this.shouldFlush(6)&&this.flush(),this.batchLightVert(i,s,u,c,p,v,g,m,y,x),this.batchLightVert(r,n,u,c,p,v,g,m,y,x),this.batchLightVert(a,o,u,c,p,v,g,m,y,x),this.batchLightVert(i,s,u,c,p,v,g,m,y,x),this.batchLightVert(a,o,u,c,p,v,g,m,y,x),this.batchLightVert(h,l,u,c,p,v,g,m,y,x)},batchLightVert:function(t,e,i,s,r,n,a,o,h,l){var u=this.vertexViewF32,c=this.vertexCount*this.currentShader.vertexComponentCount-1;u[++c]=t,u[++c]=e,u[++c]=i,u[++c]=s,u[++c]=r,u[++c]=n,u[++c]=a,u[++c]=o,u[++c]=h,u[++c]=l,this.vertexCount++}});t.exports=h},80486:(t,e,i)=>{var s=i(56694),r=i(65246),n=i(72632),a=i(12569),o=i(99365),h=i(44775),l=new s({Extends:h,initialize:function(t){t.renderTarget=n(t,"renderTarget",1),t.fragShader=n(t,"fragShader",a),t.vertShader=n(t,"vertShader",o),t.attributes=n(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]),t.batchSize=1,t.vertices=[-1,-1,0,0,-1,1,0,1,1,1,1,1,-1,-1,0,0,1,1,1,1,1,-1,1,0],h.call(this,t),this.isPostFX=!0,this.gameObject,this.colorMatrix=new r,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2,this.renderer.isBooted&&(this.manager=this.renderer.pipelines,this.boot())},boot:function(){h.prototype.boot.call(this);var t=this.manager.UTILITY_PIPELINE;this.fullFrame1=t.fullFrame1,this.fullFrame2=t.fullFrame2,this.halfFrame1=t.halfFrame1,this.halfFrame2=t.halfFrame2,this.set1i("uMainSampler",0)},onDraw:function(t){this.bindAndDraw(t)},copyFrame:function(t,e,i,s,r){this.manager.copyFrame(t,e,i,s,r)},copyToGame:function(t){this.manager.copyToGame(t)},drawFrame:function(t,e,i){this.manager.drawFrame(t,e,i,this.colorMatrix)},blendFrames:function(t,e,i,s,r){this.manager.blendFrames(t,e,i,s,r)},blendFramesAdditive:function(t,e,i,s,r){this.manager.blendFramesAdditive(t,e,i,s,r)},clearFrame:function(t,e){this.manager.clearFrame(t,e)},blitFrame:function(t,e,i,s,r,n){this.manager.blitFrame(t,e,i,s,r,n)},copyFrameRect:function(t,e,i,s,r,n,a,o){this.manager.copyFrameRect(t,e,i,s,r,n,a,o)},bindAndDraw:function(t,e,i,s,r){void 0===i&&(i=!0),void 0===s&&(s=!0);var n=this.gl,a=this.renderer;this.bind(r),this.set1i("uMainSampler",0),e?(n.viewport(0,0,e.width,e.height),n.bindFramebuffer(n.FRAMEBUFFER,e.framebuffer),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,e.texture,0),i&&(s?n.clearColor(0,0,0,0):n.clearColor(0,0,0,1),n.clear(n.COLOR_BUFFER_BIT))):(a.popFramebuffer(!1,!1,!1),a.currentFramebuffer||n.viewport(0,0,a.width,a.height)),n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,t.texture),n.bufferData(n.ARRAY_BUFFER,this.vertexData,n.STATIC_DRAW),n.drawArrays(n.TRIANGLES,0,6),e?(n.bindTexture(n.TEXTURE_2D,null),n.bindFramebuffer(n.FRAMEBUFFER,null)):a.resetTextures()}});t.exports=l},21213:(t,e,i)=>{var s=i(56694),r=i(72632),n=i(77310),a=new s({Extends:n,initialize:function(t){t.topology=5,t.batchSize=r(t,"batchSize",256),n.call(this,t)}});t.exports=a},51212:(t,e,i)=>{var s=i(56694),r=i(72632),n=i(77310),a=i(85060),o=i(18166),h=i(44775),l=new s({Extends:n,initialize:function(t){t.fragShader=r(t,"fragShader",a),t.vertShader=r(t,"vertShader",o),t.forceZero=!0,n.call(this,t)},boot:function(){h.prototype.boot.call(this),this.set1i("uMainSampler",0)}});t.exports=l},38964:(t,e,i)=>{var s=i(95723),r=i(79993),n=i(56694),a=i(72632),o=i(77310),h=i(12569),l=i(74118),u=i(37410),c=i(85060),d=i(18166),f=i(69360),p=i(71402),v=i(44775),g=new n({Extends:v,initialize:function(t){t.attributes=a(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexId"},{name:"inTintEffect"},{name:"inTint",size:4,type:p.UNSIGNED_BYTE,normalized:!0}]);var e=a(t,"fragShader",h),i=a(t,"vertShader",d),s=a(t,"drawShader",h),r=[{name:"DrawSprite",fragShader:c,vertShader:d},{name:"CopySprite",fragShader:e,vertShader:i},{name:"DrawGame",fragShader:s,vertShader:d}],n=a(t,"shaders",[]);t.shaders=r.concat(n),t.vertShader||(t.vertShader=i),t.batchSize=1,v.call(this,t),this.isSpriteFX=!0,this._tempMatrix1=new f,this._tempMatrix2=new f,this._tempMatrix3=new f,this.drawSpriteShader,this.copyShader,this.gameShader,this.quadVertexData,this.quadVertexBuffer,this.quadVertexViewF32,this.spriteBounds=new l,this.targetBounds=new l,this.fsTarget,this.tempSprite,this.renderer.isBooted&&(this.manager=this.renderer.pipelines,this.boot())},boot:function(){v.prototype.boot.call(this);var t=this.shaders,e=this.renderer;this.drawSpriteShader=t[0],this.copyShader=t[1],this.gameShader=t[2],this.fsTarget=new u(e,e.width,e.height,1,0,!0,!0),this.renderTargets=this.manager.renderTargets.concat(this.fsTarget);var i=new ArrayBuffer(168);this.quadVertexData=i,this.quadVertexViewF32=new Float32Array(i),this.quadVertexBuffer=e.createVertexBuffer(i,this.gl.STATIC_DRAW),this.onResize(e.width,e.height),this.currentShader=this.copyShader},onResize:function(t,e){var i=this.quadVertexViewF32;i[1]=e,i[22]=e,i[14]=t,i[28]=t,i[35]=t,i[36]=e},batchSprite:function(t,e,i){o.prototype.batchSprite.call(this,t,e,i)},batchTexture:function(t,e,i,s,r,n,a,h,l,u,c,d,f,p,v,g,m,y,x,T,w,E,b,S,A,_,C,R,M,P,O,L){o.prototype.batchTexture.call(this,t,e,i,s,r,n,a,h,l,u,c,d,true,p,v,g,m,y,x,T,w,E,b,S,A,_,C,R,M,P,O,L)},batchQuad:function(t,e,i,s,n,a,o,h,l,u,c,d,f,p,v,g,m,y,x){var T=Math.min(e,s,a,h),w=Math.min(i,n,o,l),E=Math.max(e,s,a,h)-T,b=Math.max(i,n,o,l)-w,S=this.spriteBounds.setTo(T,w,E,b),A=t.fxPadding,_=E+2*A,C=b+2*A,R=Math.abs(Math.max(_,C)),M=this.manager.getRenderTarget(R),P=this.targetBounds.setTo(0,0,M.width,M.height);r(P,S.centerX,S.centerY),this.tempSprite=t;var O=this.gl,L=this.renderer;this.setShader(this.drawSpriteShader),this.set1i("uMainSampler",0),this.flipProjectionMatrix(!0),this.onDrawSprite(t,M),t.onFX(this);var F=this.fsTarget;return L.setTextureZero(x),O.viewport(0,0,L.width,L.height),O.bindFramebuffer(O.FRAMEBUFFER,F.framebuffer),O.framebufferTexture2D(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_2D,F.texture,0),O.clearColor(0,0,0,0),O.clear(O.COLOR_BUFFER_BIT),this.batchVert(e,i,u,c,0,y,p),this.batchVert(s,n,u,f,0,y,g),this.batchVert(a,o,d,f,0,y,m),this.batchVert(e,i,u,c,0,y,p),this.batchVert(a,o,d,f,0,y,m),this.batchVert(h,l,d,c,0,y,v),this.flush(),this.flipProjectionMatrix(!1),L.clearTextureZero(),O.activeTexture(O.TEXTURE0),O.bindTexture(O.TEXTURE_2D,M.texture),O.copyTexSubImage2D(O.TEXTURE_2D,0,0,0,P.x,P.y,P.width,P.height),O.bindFramebuffer(O.FRAMEBUFFER,null),O.bindTexture(O.TEXTURE_2D,null),this.onBatch(t),this.currentShader=this.copyShader,this.onDraw(M,this.manager.getSwapRenderTarget()),!0},onDrawSprite:function(){},onCopySprite:function(){},copySprite:function(t,e,i,r,n,a){void 0===i&&(i=!0),void 0===r&&(r=!0),void 0===n&&(n=!1),void 0===a&&(a=this.copyShader);var o=this.gl,h=this.tempSprite;this.currentShader=a;var l=this.setVertexBuffer(this.quadVertexBuffer);if(a.bind(l,!1),this.set1i("uMainSampler",0),h.onFXCopy(this),this.onCopySprite(t,e,h),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,t.texture),t.height>e.height)o.viewport(0,0,t.width,t.height),this.setTargetUVs(t,e);else{var u=e.height-t.height;o.viewport(0,u,t.width,t.height),this.resetUVs()}if(o.bindFramebuffer(o.FRAMEBUFFER,e.framebuffer),o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,e.texture,0),i&&(o.clearColor(0,0,0,Number(!r)),o.clear(o.COLOR_BUFFER_BIT)),n){var c=this.renderer.currentBlendMode;this.renderer.setBlendMode(s.ERASE)}o.bufferData(o.ARRAY_BUFFER,this.quadVertexData,o.STATIC_DRAW),o.drawArrays(o.TRIANGLES,0,6),n&&this.renderer.setBlendMode(c),o.bindFramebuffer(o.FRAMEBUFFER,null)},blendFrames:function(t,e,i,s,r){this.manager.blendFrames(t,e,i,s,r)},blendFramesAdditive:function(t,e,i,s,r){this.manager.blendFramesAdditive(t,e,i,s,r)},drawToGame:function(t){this.currentShader=null,this.setShader(this.copyShader),this.bindAndDraw(t)},copyToGame:function(t){this.currentShader=null,this.setShader(this.gameShader),this.bindAndDraw(t)},bindAndDraw:function(t){var e=this.gl,i=this.renderer;this.set1i("uMainSampler",0),i.popFramebuffer(!1,!1,!1),i.currentFramebuffer||e.viewport(0,0,i.width,i.height),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t.texture);var s=this._tempMatrix1.loadIdentity(),r=this.targetBounds.x,n=this.targetBounds.y,a=r+t.width,o=n+t.height,h=s.getX(r,n),l=s.getX(r,o),u=s.getX(a,o),c=s.getX(a,n),d=s.getY(r,n),f=s.getY(r,o),p=s.getY(a,o),v=s.getY(a,n);this.batchVert(h,d,0,0,0,0,16777215),this.batchVert(l,f,0,1,0,0,16777215),this.batchVert(u,p,1,1,0,0,16777215),this.batchVert(h,d,0,0,0,0,16777215),this.batchVert(u,p,1,1,0,0,16777215),this.batchVert(c,v,1,0,0,0,16777215),this.flush(),i.resetTextures(),this.tempSprite=null},onDraw:function(t){this.drawToGame(t)},setUVs:function(t,e,i,s,r,n,a,o){var h=this.quadVertexViewF32;h[2]=t,h[3]=e,h[9]=i,h[10]=s,h[16]=r,h[17]=n,h[23]=t,h[24]=e,h[30]=r,h[31]=n,h[37]=a,h[38]=o},setTargetUVs:function(t,e){var i=e.height/t.height;i=i>.5?.5-(i-.5):.5-i+.5,this.setUVs(0,i,0,1+i,1,1+i,1,i)},resetUVs:function(){this.setUVs(0,0,0,1,1,1,1,0)},destroy:function(){this.gl.deleteBuffer(this.quadVertexBuffer),this._tempMatrix1.destroy(),this._tempMatrix2.destroy(),this._tempMatrix3.destroy(),this._tempMatrix1=null,this._tempMatrix1=null,this._tempMatrix1=null,this.drawSpriteShader=null,this.copyShader=null,this.gameShader=null,this.quadVertexData=null,this.quadVertexBuffer=null,this.quadVertexViewF32=null,this.fsTarget=null,this.tempSprite=null,v.prototype.destroy.call(this)}});t.exports=g},60848:(t,e,i)=>{var s=i(2529),r=i(95723),n=i(56694),a=i(65246),o=i(37486),h=i(79060),l=i(72632),u=i(98921),c=i(99365),d=i(44775),f=new n({Extends:d,initialize:function(t){t.renderTarget=l(t,"renderTarget",[{scale:1},{scale:1},{scale:.5},{scale:.5}]),t.vertShader=l(t,"vertShader",c),t.shaders=l(t,"shaders",[{name:"Copy",fragShader:h},{name:"AddBlend",fragShader:s},{name:"LinearBlend",fragShader:u},{name:"ColorMatrix",fragShader:o}]),t.attributes=l(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]),t.vertices=[-1,-1,0,0,-1,1,0,1,1,1,1,1,-1,-1,0,0,1,1,1,1,1,-1,1,0],t.batchSize=1,d.call(this,t),this.colorMatrix=new a,this.copyShader,this.addShader,this.linearShader,this.colorMatrixShader,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2},boot:function(){d.prototype.boot.call(this);var t=this.shaders,e=this.renderTargets;this.copyShader=t[0],this.addShader=t[1],this.linearShader=t[2],this.colorMatrixShader=t[3],this.fullFrame1=e[0],this.fullFrame2=e[1],this.halfFrame1=e[2],this.halfFrame2=e[3]},copyFrame:function(t,e,i,s,r){void 0===i&&(i=1),void 0===s&&(s=!0),void 0===r&&(r=!0);var n=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",i),n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,t.texture),e?(n.viewport(0,0,e.width,e.height),n.bindFramebuffer(n.FRAMEBUFFER,e.framebuffer),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,e.texture,0)):n.viewport(0,0,t.width,t.height),s&&(r?n.clearColor(0,0,0,0):n.clearColor(0,0,0,1),n.clear(n.COLOR_BUFFER_BIT)),n.bufferData(n.ARRAY_BUFFER,this.vertexData,n.STATIC_DRAW),n.drawArrays(n.TRIANGLES,0,6),n.bindFramebuffer(n.FRAMEBUFFER,null),n.bindTexture(n.TEXTURE_2D,null)},blitFrame:function(t,e,i,s,n,a){void 0===i&&(i=1),void 0===s&&(s=!0),void 0===n&&(n=!0),void 0===a&&(a=!1);var o=this.gl;if(this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",i),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,t.texture),t.height>e.height)o.viewport(0,0,t.width,t.height),this.setTargetUVs(t,e);else{var h=e.height-t.height;o.viewport(0,h,t.width,t.height)}if(o.bindFramebuffer(o.FRAMEBUFFER,e.framebuffer),o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,e.texture,0),s&&(n?o.clearColor(0,0,0,0):o.clearColor(0,0,0,1),o.clear(o.COLOR_BUFFER_BIT)),a){var l=this.renderer.currentBlendMode;this.renderer.setBlendMode(r.ERASE)}o.bufferData(o.ARRAY_BUFFER,this.vertexData,o.STATIC_DRAW),o.drawArrays(o.TRIANGLES,0,6),a&&this.renderer.setBlendMode(l),o.bindFramebuffer(o.FRAMEBUFFER,null),o.bindTexture(o.TEXTURE_2D,null),this.resetUVs()},copyFrameRect:function(t,e,i,s,r,n,a,o){void 0===a&&(a=!0),void 0===o&&(o=!0);var h=this.gl;h.bindFramebuffer(h.FRAMEBUFFER,t.framebuffer),h.framebufferTexture2D(h.FRAMEBUFFER,h.COLOR_ATTACHMENT0,h.TEXTURE_2D,t.texture,0),a&&(o?h.clearColor(0,0,0,0):h.clearColor(0,0,0,1),h.clear(h.COLOR_BUFFER_BIT)),h.activeTexture(h.TEXTURE0),h.bindTexture(h.TEXTURE_2D,e.texture),h.copyTexSubImage2D(h.TEXTURE_2D,0,0,0,i,s,r,n),h.bindFramebuffer(h.FRAMEBUFFER,null),h.bindTexture(h.TEXTURE_2D,null)},copyToGame:function(t){var e=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",1),this.renderer.popFramebuffer(),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t.texture),e.bufferData(e.ARRAY_BUFFER,this.vertexData,e.STATIC_DRAW),e.drawArrays(e.TRIANGLES,0,6),this.renderer.resetTextures()},drawFrame:function(t,e,i,s){void 0===i&&(i=!0),void 0===s&&(s=this.colorMatrix);var r=this.gl;this.setShader(this.colorMatrixShader),this.set1i("uMainSampler",0),this.set1fv("uColorMatrix",s.getData()),this.set1f("uAlpha",s.alpha),r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,t.texture),e?(r.viewport(0,0,e.width,e.height),r.bindFramebuffer(r.FRAMEBUFFER,e.framebuffer),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e.texture,0)):r.viewport(0,0,t.width,t.height),i?r.clearColor(0,0,0,0):r.clearColor(0,0,0,1),r.clear(r.COLOR_BUFFER_BIT),r.bufferData(r.ARRAY_BUFFER,this.vertexData,r.STATIC_DRAW),r.drawArrays(r.TRIANGLES,0,6),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindTexture(r.TEXTURE_2D,null)},blendFrames:function(t,e,i,s,r,n){void 0===s&&(s=1),void 0===r&&(r=!0),void 0===n&&(n=this.linearShader);var a=this.gl;this.setShader(n),this.set1i("uMainSampler1",0),this.set1i("uMainSampler2",1),this.set1f("uStrength",s),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,t.texture),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,e.texture),i?(a.bindFramebuffer(a.FRAMEBUFFER,i.framebuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,i.texture,0),a.viewport(0,0,i.width,i.height)):a.viewport(0,0,t.width,t.height),r?a.clearColor(0,0,0,0):a.clearColor(0,0,0,1),a.clear(a.COLOR_BUFFER_BIT),a.bufferData(a.ARRAY_BUFFER,this.vertexData,a.STATIC_DRAW),a.drawArrays(a.TRIANGLES,0,6),a.bindFramebuffer(a.FRAMEBUFFER,null),a.bindTexture(a.TEXTURE_2D,null)},blendFramesAdditive:function(t,e,i,s,r){this.blendFrames(t,e,i,s,r,this.addShader)},clearFrame:function(t,e){void 0===e&&(e=!0);var i=this.gl;i.viewport(0,0,t.width,t.height),i.bindFramebuffer(i.FRAMEBUFFER,t.framebuffer),e?i.clearColor(0,0,0,0):i.clearColor(0,0,0,1),i.clear(i.COLOR_BUFFER_BIT);var s=this.renderer.currentFramebuffer;i.bindFramebuffer(i.FRAMEBUFFER,s)},setUVs:function(t,e,i,s,r,n,a,o){var h=this.vertexViewF32;h[2]=t,h[3]=e,h[6]=i,h[7]=s,h[10]=r,h[11]=n,h[14]=t,h[15]=e,h[18]=r,h[19]=n,h[22]=a,h[23]=o},setTargetUVs:function(t,e){var i=e.height/t.height;i=i>.5?.5-(i-.5):.5-i+.5,this.setUVs(0,i,0,1+i,1,1+i,1,i)},flipX:function(){this.setUVs(1,0,1,1,0,1,0,0)},flipY:function(){this.setUVs(0,1,0,0,1,0,1,1)},resetUVs:function(){this.setUVs(0,0,0,1,1,1,1,0)}});t.exports=f},65641:t=>{t.exports={BITMAPMASK_PIPELINE:"BitmapMaskPipeline",LIGHT_PIPELINE:"Light2D",POINTLIGHT_PIPELINE:"PointLightPipeline",SINGLE_PIPELINE:"SinglePipeline",MULTI_PIPELINE:"MultiPipeline",ROPE_PIPELINE:"RopePipeline",GRAPHICS_PIPELINE:"GraphicsPipeline",POSTFX_PIPELINE:"PostFXPipeline",UTILITY_PIPELINE:"UtilityPipeline"}},68726:t=>{t.exports="pipelineafterflush"},67186:t=>{t.exports="pipelinebeforeflush"},22709:t=>{t.exports="pipelinebind"},74469:t=>{t.exports="pipelineboot"},93953:t=>{t.exports="pipelinedestroy"},51687:t=>{t.exports="pipelinerebind"},25034:t=>{t.exports="pipelineresize"},18970:(t,e,i)=>{t.exports={AFTER_FLUSH:i(68726),BEFORE_FLUSH:i(67186),BIND:i(22709),BOOT:i(74469),DESTROY:i(93953),REBIND:i(51687),RESIZE:i(25034)}},62253:(t,e,i)=>{var s=i(65641),r=i(98611),n={BitmapMaskPipeline:i(5583),Events:i(18970),GraphicsPipeline:i(67589),LightPipeline:i(66901),MultiPipeline:i(77310),PointLightPipeline:i(10919),PostFXPipeline:i(80486),RopePipeline:i(21213),SinglePipeline:i(51212),SpriteFXPipeline:i(38964),UtilityPipeline:i(60848)};n=r(!1,n,s),t.exports=n},2529:t=>{t.exports=["#define SHADER_NAME PHASER_ADD_BLEND_FS","","precision mediump float;","","uniform sampler2D uMainSampler1;","uniform sampler2D uMainSampler2;","uniform float uStrength;","","varying vec2 outTexCoord;","","void main ()","{"," vec4 frame1 = texture2D(uMainSampler1, outTexCoord);"," vec4 frame2 = texture2D(uMainSampler2, outTexCoord);",""," gl_FragColor = frame1 + frame2 * uStrength;","}",""].join("\n")},91679:t=>{t.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_FS","","precision mediump float;","","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uMaskSampler;","uniform bool uInvertMaskAlpha;","","void main ()","{"," vec2 uv = gl_FragCoord.xy / uResolution;"," vec4 mainColor = texture2D(uMainSampler, uv);"," vec4 maskColor = texture2D(uMaskSampler, uv);"," float alpha = mainColor.a;",""," if (!uInvertMaskAlpha)"," {"," alpha *= (maskColor.a);"," }"," else"," {"," alpha *= (1.0 - maskColor.a);"," }",""," gl_FragColor = vec4(mainColor.rgb * alpha, alpha);","}",""].join("\n")},89053:t=>{t.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_VS","","precision mediump float;","","attribute vec2 inPosition;","","void main ()","{"," gl_Position = vec4(inPosition, 0.0, 1.0);","}",""].join("\n")},37486:t=>{t.exports=["#define SHADER_NAME PHASER_COLORMATRIX_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","uniform float uColorMatrix[20];","uniform float uAlpha;","","varying vec2 outTexCoord;","","void main ()","{"," vec4 c = texture2D(uMainSampler, outTexCoord);",""," if (uAlpha == 0.0)"," {"," gl_FragColor = c;",""," return;"," }",""," if (c.a > 0.0)"," {"," c.rgb /= c.a;"," }",""," vec4 result;",""," result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4];"," result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9];"," result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14];"," result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19];",""," vec3 rgb = mix(c.rgb, result.rgb, uAlpha);",""," rgb *= result.a;",""," gl_FragColor = vec4(rgb, result.a);","}",""].join("\n")},79060:t=>{t.exports=["#define SHADER_NAME PHASER_COPY_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","uniform float uBrightness;","","varying vec2 outTexCoord;","","void main ()","{"," gl_FragColor = texture2D(uMainSampler, outTexCoord) * uBrightness;","}",""].join("\n")},37699:t=>{t.exports=["#define SHADER_NAME PHASER_GRAPHICS_FS","","precision mediump float;","","varying vec4 outColor;","","void main ()","{"," gl_FragColor = vec4(outColor.bgr * outColor.a, outColor.a);","}",""].join("\n")},28739:t=>{t.exports=["#define SHADER_NAME PHASER_GRAPHICS_VS","","precision mediump float;","","uniform mat4 uProjectionMatrix;","","attribute vec2 inPosition;","attribute vec4 inColor;","","varying vec4 outColor;","","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);",""," outColor = inColor;","}",""].join("\n")},65045:t=>{t.exports=["#define SHADER_NAME PHASER_LIGHT_FS","","precision mediump float;","","struct Light","{"," vec2 position;"," vec3 color;"," float intensity;"," float radius;","};","","const int kMaxLights = %LIGHT_COUNT%;","","uniform vec4 uCamera; /* x, y, rotation, zoom */","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uNormSampler;","uniform vec3 uAmbientLightColor;","uniform Light uLights[kMaxLights];","uniform mat3 uInverseRotationMatrix;","","varying vec2 outTexCoord;","varying vec4 outTint;","","void main()","{"," vec3 finalColor = vec3(0.0, 0.0, 0.0);"," vec4 color = texture2D(uMainSampler, outTexCoord) * vec4(outTint.bgr * outTint.a, outTint.a);"," vec3 normalMap = texture2D(uNormSampler, outTexCoord).rgb;"," vec3 normal = normalize(uInverseRotationMatrix * vec3(normalMap * 2.0 - 1.0));"," vec2 res = vec2(min(uResolution.x, uResolution.y)) * uCamera.w;",""," for (int index = 0; index < kMaxLights; ++index)"," {"," Light light = uLights[index];"," vec3 lightDir = vec3((light.position.xy / res) - (gl_FragCoord.xy / res), 0.1);"," vec3 lightNormal = normalize(lightDir);"," float distToSurf = length(lightDir) * uCamera.w;"," float diffuseFactor = max(dot(normal, lightNormal), 0.0);"," float radius = (light.radius / res.x * uCamera.w) * uCamera.w;"," float attenuation = clamp(1.0 - distToSurf * distToSurf / (radius * radius), 0.0, 1.0);"," vec3 diffuse = light.color * diffuseFactor;"," finalColor += (attenuation * diffuse) * light.intensity;"," }",""," vec4 colorOutput = vec4(uAmbientLightColor + finalColor, 1.0);",""," gl_FragColor = color * vec4(colorOutput.rgb * colorOutput.a, colorOutput.a);","}",""].join("\n")},98921:t=>{t.exports=["#define SHADER_NAME PHASER_LINEAR_BLEND_FS","","precision mediump float;","","uniform sampler2D uMainSampler1;","uniform sampler2D uMainSampler2;","uniform float uStrength;","","varying vec2 outTexCoord;","","void main ()","{"," vec4 frame1 = texture2D(uMainSampler1, outTexCoord);"," vec4 frame2 = texture2D(uMainSampler2, outTexCoord);",""," gl_FragColor = mix(frame1, frame2 * uStrength, 0.5);","}",""].join("\n")},53787:t=>{t.exports=["#define SHADER_NAME PHASER_MULTI_FS","#define numTextures %count%","","precision highp float;","","uniform sampler2D uMainSampler[%count%];","","varying vec2 outTexCoord;","varying float outTexId;","varying float outTintEffect;","varying vec4 outTint;","","vec4 getSampler (int index, vec2 uv)","{"," for (int i = 0; i < numTextures; ++i)"," {"," if (i == index)"," {"," return texture2D(uMainSampler[i], uv);"," }"," }",""," // Return black"," return vec4(0);","}","","void main ()","{"," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);",""," vec4 texture = getSampler(int(outTexId), outTexCoord);",""," // Multiply texture tint"," vec4 color = texture * texel;",""," if (outTintEffect == 1.0)"," {"," // Solid color + texture alpha"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," // Solid color, no texture"," color = texel;"," }",""," gl_FragColor = color;","}",""].join("\n")},15968:t=>{t.exports=["#define SHADER_NAME PHASER_MULTI_VS","","precision highp float;","","uniform mat4 uProjectionMatrix;","","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexId;","attribute float inTintEffect;","attribute vec4 inTint;","","varying vec2 outTexCoord;","varying float outTexId;","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);",""," outTexCoord = inTexCoord;"," outTexId = inTexId;"," outTint = inTint;"," outTintEffect = inTintEffect;","}",""].join("\n")},83327:t=>{t.exports=["#define SHADER_NAME PHASER_POINTLIGHT_FS","","precision mediump float;","","uniform vec2 uResolution;","uniform float uCameraZoom;","","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","","void main ()","{"," vec2 center = (lightPosition.xy + 1.0) * (uResolution.xy * 0.5);",""," float distToSurf = length(center - gl_FragCoord.xy);",""," float radius = 1.0 - distToSurf / (lightRadius * uCameraZoom);",""," float intensity = smoothstep(0.0, 1.0, radius * lightAttenuation);",""," vec4 color = vec4(intensity, intensity, intensity, 0.0) * lightColor;",""," gl_FragColor = vec4(color.rgb * lightColor.a, color.a);","}",""].join("\n")},54677:t=>{t.exports=["#define SHADER_NAME PHASER_POINTLIGHT_VS","","precision mediump float;","","uniform mat4 uProjectionMatrix;","","attribute vec2 inPosition;","attribute vec2 inLightPosition;","attribute vec4 inLightColor;","attribute float inLightRadius;","attribute float inLightAttenuation;","","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","","void main ()","{"," lightColor = inLightColor;"," lightRadius = inLightRadius;"," lightAttenuation = inLightAttenuation;"," lightPosition = uProjectionMatrix * vec4(inLightPosition, 1.0, 1.0);",""," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);","}",""].join("\n")},12569:t=>{t.exports=["#define SHADER_NAME PHASER_POSTFX_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","","varying vec2 outTexCoord;","","void main ()","{"," gl_FragColor = texture2D(uMainSampler, outTexCoord);","}",""].join("\n")},99365:t=>{t.exports=["#define SHADER_NAME PHASER_QUAD_VS","","precision mediump float;","","attribute vec2 inPosition;","attribute vec2 inTexCoord;","","varying vec2 outFragCoord;","varying vec2 outTexCoord;","","void main ()","{"," outFragCoord = inPosition.xy * 0.5 + 0.5;"," outTexCoord = inTexCoord;",""," gl_Position = vec4(inPosition, 0, 1);","}",""].join("\n")},85060:t=>{t.exports=["#define SHADER_NAME PHASER_SINGLE_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);",""," // Multiply texture tint"," vec4 color = texture * texel;",""," if (outTintEffect == 1.0)"," {"," // Solid color + texture alpha"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," // Solid color, no texture"," color = texel;"," }",""," gl_FragColor = color;","}",""].join("\n")},18166:t=>{t.exports=["#define SHADER_NAME PHASER_SINGLE_VS","","precision mediump float;","","uniform mat4 uProjectionMatrix;","","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexId;","attribute float inTintEffect;","attribute vec4 inTint;","","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);",""," outTexCoord = inTexCoord;"," outTint = inTint;"," outTintEffect = inTintEffect;","}",""].join("\n")},756:(t,e,i)=>{var s=i(55301),r=i(56694),n=i(6659),a=i(40444),o=i(97081),h=i(74181),l=i(2893),u=i(9229),c=i(72283),d=i(74118),f=i(90881),p=i(84314),v=i(93736),g=new r({Extends:n,initialize:function(t){n.call(this),this.game=t,this.canvas,this.canvasBounds=new d,this.parent=null,this.parentIsWindow=!1,this.parentSize=new f,this.gameSize=new f,this.baseSize=new f,this.displaySize=new f,this.scaleMode=s.SCALE_MODE.NONE,this.zoom=1,this._resetZoom=!1,this.displayScale=new v(1,1),this.autoRound=!1,this.autoCenter=s.CENTER.NO_CENTER,this.orientation=s.ORIENTATION.LANDSCAPE,this.fullscreen,this.fullscreenTarget=null,this._createdFullscreenTarget=!1,this.dirty=!1,this.resizeInterval=500,this._lastCheck=0,this._checkOrientation=!1,this.listeners={orientationChange:c,windowResize:c,fullScreenChange:c,fullScreenError:c}},preBoot:function(){this.parseConfig(this.game.config),this.game.events.once(o.BOOT,this.boot,this)},boot:function(){var t=this.game;this.canvas=t.canvas,this.fullscreen=t.device.fullscreen,this.scaleMode!==s.SCALE_MODE.RESIZE&&this.displaySize.setAspectMode(this.scaleMode),this.scaleMode===s.SCALE_MODE.NONE?this.resize(this.width,this.height):(this.getParentBounds(),this.parentSize.width>0&&this.parentSize.height>0&&this.displaySize.setParent(this.parentSize),this.refresh()),t.events.on(o.PRE_STEP,this.step,this),t.events.once(o.READY,this.refresh,this),t.events.once(o.DESTROY,this.destroy,this),this.startListeners()},parseConfig:function(t){this.getParent(t),this.getParentBounds();var e=t.width,i=t.height,r=t.scaleMode,n=t.zoom,a=t.autoRound;if("string"==typeof e){var o=this.parentSize.width;0===o&&(o=window.innerWidth);var h=parseInt(e,10)/100;e=Math.floor(o*h)}if("string"==typeof i){var l=this.parentSize.height;0===l&&(l=window.innerHeight);var c=parseInt(i,10)/100;i=Math.floor(l*c)}this.scaleMode=r,this.autoRound=a,this.autoCenter=t.autoCenter,this.resizeInterval=t.resizeInterval,a&&(e=Math.floor(e),i=Math.floor(i)),this.gameSize.setSize(e,i),n===s.ZOOM.MAX_ZOOM&&(n=this.getMaxZoom()),this.zoom=n,1!==n&&(this._resetZoom=!0),this.baseSize.setSize(e,i),a&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),t.minWidth>0&&this.displaySize.setMin(t.minWidth*n,t.minHeight*n),t.maxWidth>0&&this.displaySize.setMax(t.maxWidth*n,t.maxHeight*n),this.displaySize.setSize(e,i),this.orientation=u(e,i)},getParent:function(t){var e=t.parent;if(null!==e){if(this.parent=l(e),this.parentIsWindow=this.parent===document.body,t.expandParent&&t.scaleMode!==s.SCALE_MODE.NONE){var i=this.parent.getBoundingClientRect();(this.parentIsWindow||0===i.height)&&(document.documentElement.style.height="100%",document.body.style.height="100%",i=this.parent.getBoundingClientRect(),this.parentIsWindow||0!==i.height||(this.parent.style.overflow="hidden",this.parent.style.width="100%",this.parent.style.height="100%"))}t.fullscreenTarget&&!this.fullscreenTarget&&(this.fullscreenTarget=l(t.fullscreenTarget))}},getParentBounds:function(){if(!this.parent)return!1;var t=this.parentSize,e=this.parent.getBoundingClientRect();this.parentIsWindow&&this.game.device.os.iOS&&(e.height=h(!0));var i=e.width,s=e.height;if(t.width!==i||t.height!==s)return t.setSize(i,s),!0;if(this.canvas){var r=this.canvasBounds,n=this.canvas.getBoundingClientRect();if(n.x!==r.x||n.y!==r.y)return!0}return!1},lockOrientation:function(t){var e=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation;return!!e&&e.call(screen,t)},setParentSize:function(t,e){return this.parentSize.setSize(t,e),this.refresh()},setGameSize:function(t,e){var i=this.autoRound;i&&(t=Math.floor(t),e=Math.floor(e));var s=this.width,r=this.height;return this.gameSize.resize(t,e),this.baseSize.resize(t,e),i&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setAspectRatio(t/e),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height,this.refresh(s,r)},resize:function(t,e){var i=this.zoom,s=this.autoRound;s&&(t=Math.floor(t),e=Math.floor(e));var r=this.width,n=this.height;this.gameSize.resize(t,e),this.baseSize.resize(t,e),s&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(t*i,e*i),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height;var a=this.canvas.style,o=t*i,h=e*i;return s&&(o=Math.floor(o),h=Math.floor(h)),o===t&&h===e||(a.width=o+"px",a.height=h+"px"),this.refresh(r,n)},setZoom:function(t){return this.zoom=t,this._resetZoom=!0,this.refresh()},setMaxZoom:function(){return this.zoom=this.getMaxZoom(),this._resetZoom=!0,this.refresh()},refresh:function(t,e){void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.updateScale(),this.updateBounds(),this.updateOrientation(),this.displayScale.set(this.baseSize.width/this.canvasBounds.width,this.baseSize.height/this.canvasBounds.height);var i=this.game.domContainer;if(i){this.baseSize.setCSS(i);var s=this.canvas.style,r=i.style;r.transform="scale("+this.displaySize.width/this.baseSize.width+","+this.displaySize.height/this.baseSize.height+")",r.marginLeft=s.marginLeft,r.marginTop=s.marginTop}return this.emit(a.RESIZE,this.gameSize,this.baseSize,this.displaySize,t,e),this},updateOrientation:function(){if(this._checkOrientation){this._checkOrientation=!1;var t=u(this.width,this.height);t!==this.orientation&&(this.orientation=t,this.emit(a.ORIENTATION_CHANGE,t))}},updateScale:function(){var t,e,i=this.canvas.style,r=this.gameSize.width,n=this.gameSize.height,a=this.zoom,o=this.autoRound;this.scaleMode===s.SCALE_MODE.NONE?(this.displaySize.setSize(r*a,n*a),t=this.displaySize.width,e=this.displaySize.height,o&&(t=Math.floor(t),e=Math.floor(e)),this._resetZoom&&(i.width=t+"px",i.height=e+"px",this._resetZoom=!1)):this.scaleMode===s.SCALE_MODE.RESIZE?(this.displaySize.setSize(this.parentSize.width,this.parentSize.height),this.gameSize.setSize(this.displaySize.width,this.displaySize.height),this.baseSize.setSize(this.displaySize.width,this.displaySize.height),t=this.displaySize.width,e=this.displaySize.height,o&&(t=Math.floor(t),e=Math.floor(e)),this.canvas.width=t,this.canvas.height=e):(this.displaySize.setSize(this.parentSize.width,this.parentSize.height),t=this.displaySize.width,e=this.displaySize.height,o&&(t=Math.floor(t),e=Math.floor(e)),i.width=t+"px",i.height=e+"px"),this.getParentBounds(),this.updateCenter()},getMaxZoom:function(){var t=p(this.parentSize.width,this.gameSize.width,0,!0),e=p(this.parentSize.height,this.gameSize.height,0,!0);return Math.max(Math.min(t,e),1)},updateCenter:function(){var t=this.autoCenter;if(t!==s.CENTER.NO_CENTER){var e=this.canvas,i=e.style,r=e.getBoundingClientRect(),n=r.width,a=r.height,o=Math.floor((this.parentSize.width-n)/2),h=Math.floor((this.parentSize.height-a)/2);t===s.CENTER.CENTER_HORIZONTALLY?h=0:t===s.CENTER.CENTER_VERTICALLY&&(o=0),i.marginLeft=o+"px",i.marginTop=h+"px"}},updateBounds:function(){var t=this.canvasBounds,e=this.canvas.getBoundingClientRect();t.x=e.left+(window.pageXOffset||0)-(document.documentElement.clientLeft||0),t.y=e.top+(window.pageYOffset||0)-(document.documentElement.clientTop||0),t.width=e.width,t.height=e.height},transformX:function(t){return(t-this.canvasBounds.left)*this.displayScale.x},transformY:function(t){return(t-this.canvasBounds.top)*this.displayScale.y},startFullscreen:function(t){void 0===t&&(t={navigationUI:"hide"});var e=this.fullscreen;if(e.available){if(!e.active){var i=this.getFullscreenTarget();e.keyboard?i[e.request](Element.ALLOW_KEYBOARD_INPUT):i[e.request](t)}}else this.emit(a.FULLSCREEN_UNSUPPORTED)},fullscreenSuccessHandler:function(){this.getParentBounds(),this.refresh(),this.emit(a.ENTER_FULLSCREEN)},fullscreenErrorHandler:function(t){this.removeFullscreenTarget(),this.emit(a.FULLSCREEN_FAILED,t)},getFullscreenTarget:function(){if(!this.fullscreenTarget){var t=document.createElement("div");t.style.margin="0",t.style.padding="0",t.style.width="100%",t.style.height="100%",this.fullscreenTarget=t,this._createdFullscreenTarget=!0}this._createdFullscreenTarget&&(this.canvas.parentNode.insertBefore(this.fullscreenTarget,this.canvas),this.fullscreenTarget.appendChild(this.canvas));return this.fullscreenTarget},removeFullscreenTarget:function(){if(this._createdFullscreenTarget){var t=this.fullscreenTarget;if(t&&t.parentNode){var e=t.parentNode;e.insertBefore(this.canvas,t),e.removeChild(t)}}},stopFullscreen:function(){var t=this.fullscreen;if(!t.available)return this.emit(a.FULLSCREEN_UNSUPPORTED),!1;t.active&&document[t.cancel](),this.removeFullscreenTarget(),this.getParentBounds(),this.emit(a.LEAVE_FULLSCREEN),this.refresh()},toggleFullscreen:function(t){this.fullscreen.active?this.stopFullscreen():this.startFullscreen(t)},startListeners:function(){var t=this,e=this.listeners;if(e.orientationChange=function(){t.updateBounds(),t._checkOrientation=!0,t.dirty=!0},e.windowResize=function(){t.updateBounds(),t.dirty=!0},window.addEventListener("orientationchange",e.orientationChange,!1),window.addEventListener("resize",e.windowResize,!1),this.fullscreen.available){e.fullScreenChange=function(e){return t.onFullScreenChange(e)},e.fullScreenError=function(e){return t.onFullScreenError(e)};["webkit","moz",""].forEach((function(t){document.addEventListener(t+"fullscreenchange",e.fullScreenChange,!1),document.addEventListener(t+"fullscreenerror",e.fullScreenError,!1)})),document.addEventListener("MSFullscreenChange",e.fullScreenChange,!1),document.addEventListener("MSFullscreenError",e.fullScreenError,!1)}},onFullScreenChange:function(){document.fullscreenElement||document.webkitFullscreenElement||document.msFullscreenElement||document.mozFullScreenElement?this.fullscreenSuccessHandler():this.stopFullscreen()},onFullScreenError:function(){this.removeFullscreenTarget()},getViewPort:function(t){void 0===t&&(t=new d);var e,i,s=this.baseSize,r=this.parentSize,n=this.canvasBounds,a=this.displayScale,o=n.x>=0?0:-n.x*a.x,h=n.y>=0?0:-n.y*a.y;return e=r.width>=n.width?s.width:s.width-(n.width-r.width)*a.x,i=r.height>=n.height?s.height:s.height-(n.height-r.height)*a.y,t.setTo(o,h,e,i),t},step:function(t,e){this.parent&&(this._lastCheck+=e,(this.dirty||this._lastCheck>this.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var t=this.listeners;window.removeEventListener("orientationchange",t.orientationChange,!1),window.removeEventListener("resize",t.windowResize,!1);["webkit","moz",""].forEach((function(e){document.removeEventListener(e+"fullscreenchange",t.fullScreenChange,!1),document.removeEventListener(e+"fullscreenerror",t.fullScreenError,!1)})),document.removeEventListener("MSFullscreenChange",t.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",t.fullScreenError,!1)},destroy:function(){this.removeAllListeners(),this.stopListeners(),this.game=null,this.canvas=null,this.canvasBounds=null,this.parent=null,this.fullscreenTarget=null,this.parentSize.destroy(),this.gameSize.destroy(),this.baseSize.destroy(),this.displaySize.destroy()},isFullscreen:{get:function(){return this.fullscreen.active}},width:{get:function(){return this.gameSize.width}},height:{get:function(){return this.gameSize.height}},isPortrait:{get:function(){return this.orientation===s.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===s.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});t.exports=g},35098:t=>{t.exports={NO_CENTER:0,CENTER_BOTH:1,CENTER_HORIZONTALLY:2,CENTER_VERTICALLY:3}},53539:t=>{t.exports={LANDSCAPE:"landscape-primary",PORTRAIT:"portrait-primary"}},12637:t=>{t.exports={NONE:0,WIDTH_CONTROLS_HEIGHT:1,HEIGHT_CONTROLS_WIDTH:2,FIT:3,ENVELOP:4,RESIZE:5}},10217:t=>{t.exports={NO_ZOOM:1,ZOOM_2X:2,ZOOM_4X:4,MAX_ZOOM:-1}},55301:(t,e,i)=>{var s={CENTER:i(35098),ORIENTATION:i(53539),SCALE_MODE:i(12637),ZOOM:i(10217)};t.exports=s},82085:t=>{t.exports="enterfullscreen"},11826:t=>{t.exports="fullscreenfailed"},56691:t=>{t.exports="fullscreenunsupported"},34739:t=>{t.exports="leavefullscreen"},26681:t=>{t.exports="orientationchange"},11428:t=>{t.exports="resize"},40444:(t,e,i)=>{t.exports={ENTER_FULLSCREEN:i(82085),FULLSCREEN_FAILED:i(11826),FULLSCREEN_UNSUPPORTED:i(56691),LEAVE_FULLSCREEN:i(34739),ORIENTATION_CHANGE:i(26681),RESIZE:i(11428)}},86754:(t,e,i)=>{var s=i(98611),r=i(55301),n={Center:i(35098),Events:i(40444),Orientation:i(53539),ScaleManager:i(756),ScaleModes:i(12637),Zoom:i(10217)};n=s(!1,n,r.CENTER),n=s(!1,n,r.ORIENTATION),n=s(!1,n,r.SCALE_MODE),n=s(!1,n,r.ZOOM),t.exports=n},47736:(t,e,i)=>{var s=i(72632),r=i(40587);t.exports=function(t){var e=t.game.config.defaultPhysicsSystem,i=s(t.settings,"physics",!1);if(e||i){var n=[];if(e&&n.push(r(e+"Physics")),i)for(var a in i)a=r(a.concat("Physics")),-1===n.indexOf(a)&&n.push(a);return n}}},91088:(t,e,i)=>{var s=i(72632);t.exports=function(t){var e=t.plugins.getDefaultScenePlugins(),i=s(t.settings,"plugins",!1);return Array.isArray(i)?i:e||[]}},90415:t=>{t.exports={game:"game",renderer:"renderer",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",scale:"scale",sound:"sound",textures:"textures",events:"events",cameras:"cameras",add:"add",make:"make",scenePlugin:"scene",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",impactPhysics:"impact",matterPhysics:"matter"}},87157:(t,e,i)=>{var s=i(56694),r=i(63946),n=new s({initialize:function(t){this.sys=new r(this,t),this.game,this.anims,this.cache,this.registry,this.sound,this.textures,this.events,this.cameras,this.add,this.make,this.scene,this.children,this.lights,this.data,this.input,this.load,this.time,this.tweens,this.physics,this.matter,this.scale,this.plugins,this.renderer},update:function(){}});t.exports=n},13553:(t,e,i)=>{var s=i(56694),r=i(92980),n=i(7599),a=i(97081),o=i(10850),h=i(683),l=i(72283),u=i(87157),c=i(63946),d=new s({initialize:function(t,e){if(this.game=t,this.keys={},this.scenes=[],this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,this.customViewports=0,e){Array.isArray(e)||(e=[e]);for(var i=0;i-1&&(delete this.keys[s],this.scenes.splice(i,1),this._start.indexOf(s)>-1&&(i=this._start.indexOf(s),this._start.splice(i,1)),e.sys.destroy())}return this},bootScene:function(t){var e,i=t.sys,s=i.settings;i.sceneUpdate=l,t.init&&(t.init.call(t,s.data),s.status=r.INIT,s.isTransition&&i.events.emit(n.TRANSITION_INIT,s.transitionFrom,s.transitionDuration)),i.load&&(e=i.load).reset(),e&&t.preload?(t.preload.call(t),s.status=r.LOADING,e.once(h.COMPLETE,this.loadComplete,this),e.start()):this.create(t)},loadComplete:function(t){this.create(t.scene)},payloadComplete:function(t){this.bootScene(t.scene)},update:function(t,e){this.processQueue(),this.isProcessing=!0;for(var i=this.scenes.length-1;i>=0;i--){var s=this.scenes[i].sys;s.settings.status>r.START&&s.settings.status<=r.RUNNING&&s.step(t,e)}},render:function(t){for(var e=0;e=r.LOADING&&i.settings.status0){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.unshift(i)}}return this},moveDown:function(t){if(this.isProcessing)this._queue.push({op:"moveDown",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e>0){var i=e-1,s=this.getScene(t),r=this.getAt(i);this.scenes[e]=r,this.scenes[i]=s}}return this},moveUp:function(t){if(this.isProcessing)this._queue.push({op:"moveUp",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e{var s=i(82897),r=i(56694),n=i(7599),a=i(72632),o=i(91963),h=new r({initialize:function(t){this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.key=t.sys.settings.key,this.manager=t.sys.game.scene,this.transitionProgress=0,this._elapsed=0,this._target=null,this._duration=0,this._onUpdate,this._onUpdateScope,this._willSleep=!1,this._willRemove=!1,t.sys.events.once(n.BOOT,this.boot,this),t.sys.events.on(n.START,this.pluginStart,this)},boot:function(){this.systems.events.once(n.DESTROY,this.destroy,this)},pluginStart:function(){this._target=null,this.systems.events.once(n.SHUTDOWN,this.shutdown,this)},start:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",this.key),this.manager.queueOp("start",t,e),this},restart:function(t){var e=this.key;return this.manager.queueOp("stop",e),this.manager.queueOp("start",e,t),this},transition:function(t){void 0===t&&(t={});var e=a(t,"target",!1),i=this.manager.getScene(e);if(!e||!this.checkValidTransition(i))return!1;var s=a(t,"duration",1e3);this._elapsed=0,this._target=i,this._duration=s,this._willSleep=a(t,"sleep",!1),this._willRemove=a(t,"remove",!1);var r=a(t,"onUpdate",null);r&&(this._onUpdate=r,this._onUpdateScope=a(t,"onUpdateScope",this.scene));var o=a(t,"allowInput",!1);this.settings.transitionAllowInput=o;var h=i.sys.settings;return h.isTransition=!0,h.transitionFrom=this.scene,h.transitionDuration=s,h.transitionAllowInput=o,a(t,"moveAbove",!1)?this.manager.moveAbove(this.key,e):a(t,"moveBelow",!1)&&this.manager.moveBelow(this.key,e),i.sys.isSleeping()?i.sys.wake(a(t,"data")):this.manager.start(e,a(t,"data")),this.systems.events.emit(n.TRANSITION_OUT,i,s),this.systems.events.on(n.UPDATE,this.step,this),!0},checkValidTransition:function(t){return!(!t||t.sys.isActive()||t.sys.isTransitioning()||t===this.scene||this.systems.isTransitioning())},step:function(t,e){this._elapsed+=e,this.transitionProgress=s(this._elapsed/this._duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.transitionProgress),this._elapsed>=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;this.systems.events.off(n.UPDATE,this.step,this),t.events.emit(n.TRANSITION_COMPLETE,this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i,s){return this.manager.add(t,e,i,s)},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t){return t!==this.key&&this.manager.queueOp("switch",this.key,t),this},stop:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t,e),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var s=this.manager.getScene(e);return s&&s.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isPaused:function(t){return void 0===t&&(t=this.key),this.manager.isPaused(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off(n.SHUTDOWN,this.shutdown,this),t.off(n.POST_UPDATE,this.step,this),t.off(n.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(n.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});o.register("ScenePlugin",h,"scenePlugin"),t.exports=h},36765:(t,e,i)=>{var s=i(92980),r=i(10850),n=i(30657),a=i(90415),o={create:function(t){return"string"==typeof t?t={key:t}:void 0===t&&(t={}),{status:s.PENDING,key:r(t,"key",""),active:r(t,"active",!1),visible:r(t,"visible",!0),isBooted:!1,isTransition:!1,transitionFrom:null,transitionDuration:0,transitionAllowInput:!0,data:{},pack:r(t,"pack",!1),cameras:r(t,"cameras",null),map:r(t,"map",n(a,r(t,"mapAdd",{}))),physics:r(t,"physics",{}),loader:r(t,"loader",{}),plugins:r(t,"plugins",!1),input:r(t,"input",{})}}};t.exports=o},63946:(t,e,i)=>{var s=i(56694),r=i(92980),n=i(18360),a=i(7599),o=i(47736),h=i(91088),l=i(86459),u=i(72283),c=i(36765),d=new s({initialize:function(t,e){this.scene=t,this.game,this.renderer,this.config=e,this.settings=c.create(e),this.canvas,this.context,this.anims,this.cache,this.plugins,this.registry,this.scale,this.sound,this.textures,this.add,this.cameras,this.displayList,this.events,this.make,this.scenePlugin,this.updateList,this.sceneUpdate=u},init:function(t){this.settings.status=r.INIT,this.sceneUpdate=u,this.game=t,this.renderer=t.renderer,this.canvas=t.canvas,this.context=t.context;var e=t.plugins;this.plugins=e,e.addToScene(this,n.Global,[n.CoreScene,h(this),o(this)]),this.events.emit(a.BOOT,this),this.settings.isBooted=!0},step:function(t,e){var i=this.events;i.emit(a.PRE_UPDATE,t,e),i.emit(a.UPDATE,t,e),this.sceneUpdate.call(this.scene,t,e),i.emit(a.POST_UPDATE,t,e)},render:function(t){var e=this.displayList;e.depthSort(),this.events.emit(a.PRE_RENDER,t),this.cameras.render(t,e),this.events.emit(a.RENDER,t)},queueDepthSort:function(){this.displayList.queueDepthSort()},depthSort:function(){this.displayList.depthSort()},pause:function(t){var e=this.events,i=this.settings;return this.settings.active&&(i.status=r.PAUSED,i.active=!1,e.emit(a.PAUSE,this,t)),this},resume:function(t){var e=this.events,i=this.settings;return this.settings.active||(i.status=r.RUNNING,i.active=!0,e.emit(a.RESUME,this,t)),this},sleep:function(t){var e=this.events,i=this.settings;return i.status=r.SLEEPING,i.active=!1,i.visible=!1,e.emit(a.SLEEP,this,t),this},wake:function(t){var e=this.events,i=this.settings;return i.status=r.RUNNING,i.active=!0,i.visible=!0,e.emit(a.WAKE,this,t),i.isTransition&&e.emit(a.TRANSITION_WAKE,i.transitionFrom,i.transitionDuration),this},getData:function(){return this.settings.data},isSleeping:function(){return this.settings.status===r.SLEEPING},isActive:function(){return this.settings.status===r.RUNNING},isPaused:function(){return this.settings.status===r.PAUSED},isTransitioning:function(){return this.settings.isTransition||null!==this.scenePlugin._target},isTransitionOut:function(){return null!==this.scenePlugin._target&&this.scenePlugin._duration>0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(t){return this.settings.visible=t,this},setActive:function(t,e){return t?this.resume(e):this.pause(e)},start:function(t){var e=this.events,i=this.settings;t&&(i.data=t),i.status=r.START,i.active=!0,i.visible=!0,e.emit(a.START,this),e.emit(a.READY,this,t)},shutdown:function(t){var e=this.events,i=this.settings;e.off(a.TRANSITION_INIT),e.off(a.TRANSITION_START),e.off(a.TRANSITION_COMPLETE),e.off(a.TRANSITION_OUT),i.status=r.SHUTDOWN,i.active=!1,i.visible=!1,this.renderer===l.WEBGL&&this.renderer.resetTextures(!0),e.emit(a.SHUTDOWN,this,t)},destroy:function(){var t=this.events,e=this.settings;e.status=r.DESTROYED,e.active=!1,e.visible=!1,t.emit(a.DESTROY,this),t.removeAllListeners();for(var i=["scene","game","anims","cache","plugins","registry","sound","textures","add","camera","displayList","events","make","scenePlugin","updateList"],s=0;s{t.exports={PENDING:0,INIT:1,START:2,LOADING:3,CREATING:4,RUNNING:5,PAUSED:6,SLEEPING:7,SHUTDOWN:8,DESTROYED:9}},31803:t=>{t.exports="addedtoscene"},94817:t=>{t.exports="boot"},28977:t=>{t.exports="create"},91959:t=>{t.exports="destroy"},363:t=>{t.exports="pause"},15643:t=>{t.exports="postupdate"},17058:t=>{t.exports="prerender"},77125:t=>{t.exports="preupdate"},76018:t=>{t.exports="ready"},28620:t=>{t.exports="removedfromscene"},41538:t=>{t.exports="render"},34268:t=>{t.exports="resume"},2342:t=>{t.exports="shutdown"},96541:t=>{t.exports="sleep"},74244:t=>{t.exports="start"},17046:t=>{t.exports="transitioncomplete"},13637:t=>{t.exports="transitioninit"},14733:t=>{t.exports="transitionout"},33899:t=>{t.exports="transitionstart"},52418:t=>{t.exports="transitionwake"},31735:t=>{t.exports="update"},8470:t=>{t.exports="wake"},7599:(t,e,i)=>{t.exports={ADDED_TO_SCENE:i(31803),BOOT:i(94817),CREATE:i(28977),DESTROY:i(91959),PAUSE:i(363),POST_UPDATE:i(15643),PRE_RENDER:i(17058),PRE_UPDATE:i(77125),READY:i(76018),REMOVED_FROM_SCENE:i(28620),RENDER:i(41538),RESUME:i(34268),SHUTDOWN:i(2342),SLEEP:i(96541),START:i(74244),TRANSITION_COMPLETE:i(17046),TRANSITION_INIT:i(13637),TRANSITION_OUT:i(14733),TRANSITION_START:i(33899),TRANSITION_WAKE:i(52418),UPDATE:i(31735),WAKE:i(8470)}},20436:(t,e,i)=>{var s=i(92980),r=i(98611),n={Events:i(7599),GetPhysicsPlugins:i(47736),GetScenePlugins:i(91088),SceneManager:i(13553),ScenePlugin:i(64051),Settings:i(36765),Systems:i(63946)};n=r(!1,n,s),t.exports=n},25798:(t,e,i)=>{var s=i(56694),r=i(6659),n=i(76038),a=i(98611),o=i(72283),h=new s({Extends:r,initialize:function(t,e,i){r.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=this.duration||0,this.totalDuration=this.totalDuration||0,this.config={mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0},this.currentConfig=this.config,this.config=a(this.config,i),this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(console.error("addMarker "+t.name+" already exists in Sound"),!1):(t=a(!0,{name:"",start:0,duration:this.totalDuration-(t.start||0),config:{mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0}},t),this.markers[t.name]=t,!0))},updateMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(this.markers[t.name]=a(!0,this.markers[t.name],t),!0):(console.warn("Audio Marker: "+t.name+" missing in Sound: "+this.key),!1))},removeMarker:function(t){var e=this.markers[t];return e?(this.markers[t]=null,e):null},play:function(t,e){if(void 0===t&&(t=""),"object"==typeof t&&(e=t,t=""),"string"!=typeof t)return!1;if(t){if(!this.markers[t])return console.warn("Marker: "+t+" missing in Sound: "+this.key),!1;this.currentMarker=this.markers[t],this.currentConfig=this.currentMarker.config,this.duration=this.currentMarker.duration}else this.currentMarker=null,this.currentConfig=this.config,this.duration=this.totalDuration;return this.resetConfig(),this.currentConfig=a(this.currentConfig,e),this.isPlaying=!0,this.isPaused=!1,!0},pause:function(){return!(this.isPaused||!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!0,!0)},resume:function(){return!(!this.isPaused||this.isPlaying)&&(this.isPlaying=!0,this.isPaused=!1,!0)},stop:function(){return!(!this.isPaused&&!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!1,this.resetConfig(),!0)},applyConfig:function(){this.mute=this.currentConfig.mute,this.volume=this.currentConfig.volume,this.rate=this.currentConfig.rate,this.detune=this.currentConfig.detune,this.loop=this.currentConfig.loop,this.pan=this.currentConfig.pan},resetConfig:function(){this.currentConfig.seek=0,this.currentConfig.delay=0},update:o,calculateRate:function(){var t=this.currentConfig.detune+this.manager.detune,e=Math.pow(1.0005777895065548,t);this.totalRate=this.currentConfig.rate*this.manager.rate*e},destroy:function(){this.pendingRemove||(this.emit(n.DESTROY,this),this.pendingRemove=!0,this.manager=null,this.key="",this.removeAllListeners(),this.isPlaying=!1,this.isPaused=!1,this.config=null,this.currentConfig=null,this.markers=null,this.currentMarker=null)}});t.exports=h},12486:(t,e,i)=>{var s=i(56694),r=i(32742),n=i(6659),a=i(76038),o=i(97081),h=i(72283),l=i(71608),u=i(51463),c=new s({Extends:n,initialize:function(t){n.call(this),this.game=t,this.jsonCache=t.cache.json,this.sounds=[],this.mute=!1,this.volume=1,this.pauseOnBlur=!0,this._rate=1,this._detune=0,this.locked=this.locked||!1,this.unlocked=!1,t.events.on(o.BLUR,this.onGameBlur,this),t.events.on(o.FOCUS,this.onGameFocus,this),t.events.on(o.PRE_STEP,this.update,this),t.events.once(o.DESTROY,this.destroy,this)},add:h,addAudioSprite:function(t,e){void 0===e&&(e={});var i=this.add(t,e);for(var s in i.spritemap=this.jsonCache.get(t).spritemap,i.spritemap)if(i.spritemap.hasOwnProperty(s)){var n=r(e),a=i.spritemap[s];n.loop=!!a.hasOwnProperty("loop")&&a.loop,i.addMarker({name:s,start:a.start,duration:a.end-a.start,config:n})}return i},get:function(t){return u(this.sounds,"key",t)},getAll:function(t){return l(this.sounds,"key",t)},play:function(t,e){var i=this.add(t);return i.once(a.COMPLETE,i.destroy,i),e?e.name?(i.addMarker(e),i.play(e.name)):i.play(e):i.play()},playAudioSprite:function(t,e,i){var s=this.addAudioSprite(t);return s.once(a.COMPLETE,s.destroy,s),s.play(e,i)},remove:function(t){var e=this.sounds.indexOf(t);return-1!==e&&(t.destroy(),this.sounds.splice(e,1),!0)},removeAll:function(){this.sounds.forEach((function(t){t.destroy()})),this.sounds.length=0},removeByKey:function(t){for(var e=0,i=this.sounds.length-1;i>=0;i--){var s=this.sounds[i];s.key===t&&(s.destroy(),this.sounds.splice(i,1),e++)}return e},pauseAll:function(){this.forEachActiveSound((function(t){t.pause()})),this.emit(a.PAUSE_ALL,this)},resumeAll:function(){this.forEachActiveSound((function(t){t.resume()})),this.emit(a.RESUME_ALL,this)},stopAll:function(){this.forEachActiveSound((function(t){t.stop()})),this.emit(a.STOP_ALL,this)},stopByKey:function(t){var e=0;return this.getAll(t).forEach((function(t){t.stop()&&e++})),e},unlock:h,onBlur:h,onFocus:h,onGameBlur:function(){this.pauseOnBlur&&this.onBlur()},onGameFocus:function(){this.pauseOnBlur&&this.onFocus()},update:function(t,e){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit(a.UNLOCKED,this));for(var i=this.sounds.length-1;i>=0;i--)this.sounds[i].pendingRemove&&this.sounds.splice(i,1);this.sounds.forEach((function(i){i.update(t,e)}))},destroy:function(){this.game.events.off(o.BLUR,this.onGameBlur,this),this.game.events.off(o.FOCUS,this.onGameFocus,this),this.game.events.off(o.PRE_STEP,this.update,this),this.removeAllListeners(),this.removeAll(),this.sounds.length=0,this.sounds=null,this.game=null},forEachActiveSound:function(t,e){var i=this;this.sounds.forEach((function(s,r){s&&!s.pendingRemove&&t.call(e||i,s,r,i.sounds)}))},setRate:function(t){return this.rate=t,this},rate:{get:function(){return this._rate},set:function(t){this._rate=t,this.forEachActiveSound((function(t){t.calculateRate()})),this.emit(a.GLOBAL_RATE,this,t)}},setDetune:function(t){return this.detune=t,this},detune:{get:function(){return this._detune},set:function(t){this._detune=t,this.forEachActiveSound((function(t){t.calculateRate()})),this.emit(a.GLOBAL_DETUNE,this,t)}}});t.exports=c},84191:(t,e,i)=>{var s=i(27622),r=i(17546),n=i(55491),a={create:function(t){var e=t.config.audio,i=t.device.audio;return e.noAudio||!i.webAudio&&!i.audioData?new r(t):i.webAudio&&!e.disableWebAudio?new n(t):new s(t)}};t.exports=a},77578:t=>{t.exports="complete"},19679:t=>{t.exports="decodedall"},56951:t=>{t.exports="decoded"},16436:t=>{t.exports="destroy"},55154:t=>{t.exports="detune"},57818:t=>{t.exports="detune"},57890:t=>{t.exports="mute"},83022:t=>{t.exports="rate"},99170:t=>{t.exports="volume"},64289:t=>{t.exports="looped"},67214:t=>{t.exports="loop"},53128:t=>{t.exports="mute"},73078:t=>{t.exports="pan"},76763:t=>{t.exports="pauseall"},88426:t=>{t.exports="pause"},13765:t=>{t.exports="play"},80291:t=>{t.exports="rate"},11124:t=>{t.exports="resumeall"},55382:t=>{t.exports="resume"},71157:t=>{t.exports="seek"},31776:t=>{t.exports="stopall"},39450:t=>{t.exports="stop"},21939:t=>{t.exports="unlocked"},33019:t=>{t.exports="volume"},76038:(t,e,i)=>{t.exports={COMPLETE:i(77578),DECODED:i(56951),DECODED_ALL:i(19679),DESTROY:i(16436),DETUNE:i(55154),GLOBAL_DETUNE:i(57818),GLOBAL_MUTE:i(57890),GLOBAL_RATE:i(83022),GLOBAL_VOLUME:i(99170),LOOP:i(67214),LOOPED:i(64289),MUTE:i(53128),PAN:i(73078),PAUSE_ALL:i(76763),PAUSE:i(88426),PLAY:i(13765),RATE:i(80291),RESUME_ALL:i(11124),RESUME:i(55382),SEEK:i(71157),STOP_ALL:i(31776),STOP:i(39450),UNLOCKED:i(21939),VOLUME:i(33019)}},34350:(t,e,i)=>{var s=i(25798),r=i(56694),n=i(76038),a=i(82897),o=new r({Extends:s,initialize:function(t,e,i){if(void 0===i&&(i={}),this.tags=t.game.cache.audio.get(e),!this.tags)throw new Error('There is no audio asset with key "'+e+'" in the audio cache');this.audio=null,this.startTime=0,this.previousTime=0,this.duration=this.tags[0].duration,this.totalDuration=this.tags[0].duration,s.call(this,t,e,i)},play:function(t,e){return!this.manager.isLocked(this,"play",[t,e])&&(!!s.prototype.play.call(this,t,e)&&(!!this.pickAndPlayAudioTag()&&(this.emit(n.PLAY,this),!0)))},pause:function(){return!this.manager.isLocked(this,"pause")&&(!(this.startTime>0)&&(!!s.prototype.pause.call(this)&&(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit(n.PAUSE,this),!0)))},resume:function(){return!this.manager.isLocked(this,"resume")&&(!(this.startTime>0)&&(!!s.prototype.resume.call(this)&&(!!this.pickAndPlayAudioTag()&&(this.emit(n.RESUME,this),!0))))},stop:function(){return!this.manager.isLocked(this,"stop")&&(!!s.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit(n.STOP,this),!0))},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var t=this.currentConfig.seek,e=this.currentConfig.delay,i=(this.currentMarker?this.currentMarker.start:0)+t;return this.previousTime=i,this.audio.currentTime=i,this.applyConfig(),0===e?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+1e3*e,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var t=0;t0)this.startTime=i-this.manager.loopEndOffset?(this.audio.currentTime=e+Math.max(0,s-i),s=this.audio.currentTime):s=i)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit(n.COMPLETE,this);this.previousTime=s}},destroy:function(){s.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=a(this.currentConfig.volume*this.manager.volume,0,1))},calculateRate:function(){s.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(t){this.currentConfig.mute=t,this.manager.isLocked(this,"mute",t)||(this.updateMute(),this.emit(n.MUTE,this,t))}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.currentConfig.volume},set:function(t){this.currentConfig.volume=t,this.manager.isLocked(this,"volume",t)||(this.updateVolume(),this.emit(n.VOLUME,this,t))}},setVolume:function(t){return this.volume=t,this},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.manager.isLocked(this,n.RATE,t)||(this.calculateRate(),this.emit(n.RATE,this,t))}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.manager.isLocked(this,n.DETUNE,t)||(this.calculateRate(),this.emit(n.DETUNE,this,t))}},setDetune:function(t){return this.detune=t,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.isLocked(this,"seek",t)||this.startTime>0||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.isPlaying?(this.previousTime=t,this.audio.currentTime=t):this.isPaused&&(this.currentConfig.seek=t),this.emit(n.SEEK,this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.manager.isLocked(this,"loop",t)||(this.audio&&(this.audio.loop=t),this.emit(n.LOOP,this,t))}},setLoop:function(t){return this.loop=t,this},pan:{get:function(){return this.currentConfig.pan},set:function(t){this.currentConfig.pan=t,this.emit(n.PAN,this,t)}},setPan:function(t){return this.pan=t,this}});t.exports=o},27622:(t,e,i)=>{var s=i(12486),r=i(56694),n=i(76038),a=i(34350),o=new r({Extends:s,initialize:function(t){this.override=!0,this.audioPlayDelay=.1,this.loopEndOffset=.05,this.onBlurPausedSounds=[],this.locked="ontouchstart"in window,this.lockedActionsQueue=this.locked?[]:null,this._mute=!1,this._volume=1,s.call(this,t)},add:function(t,e){var i=new a(this,t,e);return this.sounds.push(i),i},unlock:function(){this.locked=!1;var t=this;if(this.game.cache.audio.entries.each((function(e,i){for(var s=0;s{t.exports={SoundManagerCreator:i(84191),Events:i(76038),BaseSound:i(25798),BaseSoundManager:i(12486),WebAudioSound:i(96008),WebAudioSoundManager:i(55491),HTML5AudioSound:i(34350),HTML5AudioSoundManager:i(27622),NoAudioSound:i(38662),NoAudioSoundManager:i(17546)}},38662:(t,e,i)=>{var s=i(25798),r=i(56694),n=i(6659),a=i(98611),o=function(){return!1},h=function(){return this},l=new r({Extends:n,initialize:function(t,e,i){void 0===i&&(i={}),n.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=0,this.totalDuration=0,this.config=a({mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0},i),this.currentConfig=this.config,this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.seek=0,this.loop=!1,this.pan=0,this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:o,updateMarker:o,removeMarker:function(){return null},play:o,pause:o,resume:o,stop:o,destroy:function(){s.prototype.destroy.call(this)},setMute:h,setVolume:h,setRate:h,setDetune:h,setSeek:h,setLoop:h,setPan:h});t.exports=l},17546:(t,e,i)=>{var s=i(12486),r=i(56694),n=i(6659),a=i(38662),o=i(72283),h=new r({Extends:n,initialize:function(t){n.call(this),this.game=t,this.sounds=[],this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.pauseOnBlur=!0,this.locked=!1},add:function(t,e){var i=new a(this,t,e);return this.sounds.push(i),i},addAudioSprite:function(t,e){var i=this.add(t,e);return i.spritemap={},i},play:function(t,e){return!1},playAudioSprite:function(t,e,i){return!1},remove:function(t){return s.prototype.remove.call(this,t)},removeByKey:function(t){return s.prototype.removeByKey.call(this,t)},pauseAll:o,resumeAll:o,stopAll:o,update:o,setRate:o,setDetune:o,setMute:o,setVolume:o,forEachActiveSound:function(t,e){s.prototype.forEachActiveSound.call(this,t,e)},destroy:function(){s.prototype.destroy.call(this)}});t.exports=h},96008:(t,e,i)=>{var s=i(25798),r=i(56694),n=i(76038),a=new r({Extends:s,initialize:function(t,e,i){if(void 0===i&&(i={}),this.audioBuffer=t.game.cache.audio.get(e),!this.audioBuffer)throw new Error('Audio key "'+e+'" missing from cache');this.source=null,this.loopSource=null,this.muteNode=t.context.createGain(),this.volumeNode=t.context.createGain(),this.pannerNode=null,this.playTime=0,this.startTime=0,this.loopTime=0,this.rateUpdates=[],this.hasEnded=!1,this.hasLooped=!1,this.muteNode.connect(this.volumeNode),t.context.createStereoPanner?(this.pannerNode=t.context.createStereoPanner(),this.volumeNode.connect(this.pannerNode),this.pannerNode.connect(t.destination)):this.volumeNode.connect(t.destination),this.duration=this.audioBuffer.duration,this.totalDuration=this.audioBuffer.duration,s.call(this,t,e,i)},play:function(t,e){return!!s.prototype.play.call(this,t,e)&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource(),this.emit(n.PLAY,this),!0)},pause:function(){return!(this.manager.context.currentTime{var s=i(82329),r=i(12486),n=i(56694),a=i(76038),o=i(97081),h=i(96008),l=new n({Extends:r,initialize:function(t){this.context=this.createAudioContext(t),this.masterMuteNode=this.context.createGain(),this.masterVolumeNode=this.context.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(this.context.destination),this.destination=this.masterMuteNode,this.locked="suspended"===this.context.state&&("ontouchstart"in window||"onclick"in window),r.call(this,t),this.locked&&t.isBooted?this.unlock():t.events.once(o.BOOT,this.unlock,this)},createAudioContext:function(t){var e=t.config.audio;return e.context?(e.context.resume(),e.context):window.hasOwnProperty("AudioContext")?new AudioContext:window.hasOwnProperty("webkitAudioContext")?new window.webkitAudioContext:void 0},setAudioContext:function(t){return this.context&&this.context.close(),this.masterMuteNode&&this.masterMuteNode.disconnect(),this.masterVolumeNode&&this.masterVolumeNode.disconnect(),this.context=t,this.masterMuteNode=t.createGain(),this.masterVolumeNode=t.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(t.destination),this.destination=this.masterMuteNode,this},add:function(t,e){var i=new h(this,t,e);return this.sounds.push(i),i},decodeAudio:function(t,e){var i;i=Array.isArray(t)?t:[{key:t,data:e}];for(var r=this.game.cache.audio,n=i.length,o=0;o{var s=i(59959),r=i(56694),n=i(72283),a=i(17922),o=new r({initialize:function(t){this.parent=t,this.list=[],this.position=0,this.addCallback=n,this.removeCallback=n,this._sortKey=""},add:function(t,e){return e?s.Add(this.list,t):s.Add(this.list,t,0,this.addCallback,this)},addAt:function(t,e,i){return i?s.AddAt(this.list,t,e):s.AddAt(this.list,t,e,0,this.addCallback,this)},getAt:function(t){return this.list[t]},getIndex:function(t){return this.list.indexOf(t)},sort:function(t,e){return t?(void 0===e&&(e=function(e,i){return e[t]-i[t]}),a(this.list,e),this):this},getByName:function(t){return s.GetFirst(this.list,"name",t)},getRandom:function(t,e){return s.GetRandom(this.list,t,e)},getFirst:function(t,e,i,r){return s.GetFirst(this.list,t,e,i,r)},getAll:function(t,e,i,r){return s.GetAll(this.list,t,e,i,r)},count:function(t,e){return s.CountAllMatching(this.list,t,e)},swap:function(t,e){s.Swap(this.list,t,e)},moveTo:function(t,e){return s.MoveTo(this.list,t,e)},moveAbove:function(t,e){return s.MoveAbove(this.list,t,e)},moveBelow:function(t,e){return s.MoveBelow(this.list,t,e)},remove:function(t,e){return e?s.Remove(this.list,t):s.Remove(this.list,t,this.removeCallback,this)},removeAt:function(t,e){return e?s.RemoveAt(this.list,t):s.RemoveAt(this.list,t,this.removeCallback,this)},removeBetween:function(t,e,i){return i?s.RemoveBetween(this.list,t,e):s.RemoveBetween(this.list,t,e,this.removeCallback,this)},removeAll:function(t){for(var e=this.list.length;e--;)this.remove(this.list[e],t);return this},bringToTop:function(t){return s.BringToTop(this.list,t)},sendToBack:function(t){return s.SendToBack(this.list,t)},moveUp:function(t){return s.MoveUp(this.list,t),t},moveDown:function(t){return s.MoveDown(this.list,t),t},reverse:function(){return this.list.reverse(),this},shuffle:function(){return s.Shuffle(this.list),this},replace:function(t,e){return s.Replace(this.list,t,e)},exists:function(t){return this.list.indexOf(t)>-1},setAll:function(t,e,i,r){return s.SetAll(this.list,t,e,i,r),this},each:function(t,e){for(var i=[null],s=2;s0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}}});t.exports=o},33885:(t,e,i)=>{var s=new(i(56694))({initialize:function(t){if(this.entries={},this.size=0,Array.isArray(t))for(var e=0;e{var s=i(56694),r=i(6659),n=i(36716),a=new s({Extends:r,initialize:function(){r.call(this),this._pending=[],this._active=[],this._destroy=[],this._toProcess=0,this.checkQueue=!1},add:function(t){return this._pending.push(t),this._toProcess++,t},remove:function(t){return this._destroy.push(t),this._toProcess++,t},removeAll:function(){for(var t=this._active,e=this._destroy,i=t.length;i--;)e.push(t[i]),this._toProcess++;return this},update:function(){if(0===this._toProcess)return this._active;var t,e,i=this._destroy,s=this._active;for(t=0;t{var s=i(53466);function r(t){if(!(this instanceof r))return new r(t,[".left",".top",".right",".bottom"]);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}function n(t,e,i){if(!i)return e.indexOf(t);for(var s=0;s=t.minX&&e.maxY>=t.minY}function v(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(t,e,i,r,n){for(var a,o=[e,i];o.length;)(i=o.pop())-(e=o.pop())<=r||(a=e+Math.ceil((i-e)/r/2)*r,s(t,a,e,i,n),o.push(e,a,a,i))}r.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],s=this.toBBox;if(!p(t,e))return i;for(var r,n,a,o,h=[];e;){for(r=0,n=e.children.length;r=0&&n[e].children.length>this._maxEntries;)this._split(n,e),e--;this._adjustParentBBoxes(r,n,e)},_split:function(t,e){var i=t[e],s=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,s);var n=this._chooseSplitIndex(i,r,s),o=v(i.children.splice(n,i.children.length-n));o.height=i.height,o.leaf=i.leaf,a(i,this.toBBox),a(o,this.toBBox),e?t[e-1].children.push(o):this._splitRoot(i,o)},_splitRoot:function(t,e){this.data=v([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var s,r,n,a,h,l,u,d,f,p,v,g,m,y;for(l=u=1/0,s=e;s<=i-e;s++)r=o(t,0,s,this.toBBox),n=o(t,s,i,this.toBBox),f=r,p=n,v=void 0,g=void 0,m=void 0,y=void 0,v=Math.max(f.minX,p.minX),g=Math.max(f.minY,p.minY),m=Math.min(f.maxX,p.maxX),y=Math.min(f.maxY,p.maxY),a=Math.max(0,m-v)*Math.max(0,y-g),h=c(r)+c(n),a=e;r--)n=t.children[r],h(u,t.leaf?a(n):n),c+=d(u);return c},_adjustParentBBoxes:function(t,e,i){for(var s=i;s>=0;s--)h(e[s],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():a(t[i],this.toBBox)},compareMinX:function(t,e){return t.left-e.left},compareMinY:function(t,e){return t.top-e.top},toBBox:function(t){return{minX:t.left,minY:t.top,maxX:t.right,maxY:t.bottom}}},t.exports=r},58403:(t,e,i)=>{var s=new(i(56694))({initialize:function(t){if(this.entries=[],Array.isArray(t))for(var e=0;e-1&&this.entries.splice(e,1),this},dump:function(){console.group("Set");for(var t=0;t-1},union:function(t){var e=new s;return t.entries.forEach((function(t){e.set(t)})),this.entries.forEach((function(t){e.set(t)})),e},intersect:function(t){var e=new s;return this.entries.forEach((function(i){t.contains(i)&&e.set(i)})),e},difference:function(t){var e=new s;return this.entries.forEach((function(i){t.contains(i)||e.set(i)})),e},size:{get:function(){return this.entries.length},set:function(t){return t{var s=i(82897),r=i(56694),n=i(84314),a=i(93736),o=new r({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===s&&(s=null),this._width=t,this._height=e,this._parent=s,this.aspectMode=i,this.aspectRatio=0===e?1:t/e,this.minWidth=0,this.minHeight=0,this.maxWidth=Number.MAX_VALUE,this.maxHeight=Number.MAX_VALUE,this.snapTo=new a},setAspectMode:function(t){return void 0===t&&(t=0),this.aspectMode=t,this.setSize(this._width,this._height)},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.snapTo.set(t,e),this.setSize(this._width,this._height)},setParent:function(t){return this._parent=t,this.setSize(this._width,this._height)},setMin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.minWidth=s(t,0,this.maxWidth),this.minHeight=s(e,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(t,e){return void 0===t&&(t=Number.MAX_VALUE),void 0===e&&(e=t),this.maxWidth=s(t,this.minWidth,Number.MAX_VALUE),this.maxHeight=s(e,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(t,e){switch(void 0===t&&(t=0),void 0===e&&(e=t),this.aspectMode){case o.NONE:this._width=this.getNewWidth(n(t,this.snapTo.x)),this._height=this.getNewHeight(n(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height;break;case o.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(n(t,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case o.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(n(e,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case o.FIT:this.constrain(t,e,!0);break;case o.ENVELOP:this.constrain(t,e,!1)}return this},setAspectRatio:function(t){return this.aspectRatio=t,this.setSize(this._width,this._height)},resize:function(t,e){return this._width=this.getNewWidth(n(t,this.snapTo.x)),this._height=this.getNewHeight(n(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height,this},getNewWidth:function(t,e){return void 0===e&&(e=!0),t=s(t,this.minWidth,this.maxWidth),e&&this._parent&&t>this._parent.width&&(t=Math.max(this.minWidth,this._parent.width)),t},getNewHeight:function(t,e){return void 0===e&&(e=!0),t=s(t,this.minHeight,this.maxHeight),e&&this._parent&&t>this._parent.height&&(t=Math.max(this.minHeight,this._parent.height)),t},constrain:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=!0),t=this.getNewWidth(t),e=this.getNewHeight(e);var s=this.snapTo,r=0===e?1:t/e;return i&&this.aspectRatio>r||!i&&this.aspectRatio0&&(t=(e=n(e,s.y))*this.aspectRatio)):(i&&this.aspectRatior)&&(t=(e=n(e,s.y))*this.aspectRatio,s.x>0&&(e=(t=n(t,s.x))*(1/this.aspectRatio))),this._width=t,this._height=e,this},fitTo:function(t,e){return this.constrain(t,e,!0)},envelop:function(t,e){return this.constrain(t,e,!1)},setWidth:function(t){return this.setSize(t,this._height)},setHeight:function(t){return this.setSize(this._width,t)},toString:function(){return"[{ Size (width="+this._width+" height="+this._height+" aspectRatio="+this.aspectRatio+" aspectMode="+this.aspectMode+") }]"},setCSS:function(t){t&&t.style&&(t.style.width=this._width+"px",t.style.height=this._height+"px")},copy:function(t){return t.setAspectMode(this.aspectMode),t.aspectRatio=this.aspectRatio,t.setSize(this.width,this.height)},destroy:function(){this._parent=null,this.snapTo=null},width:{get:function(){return this._width},set:function(t){this.setSize(t,this._height)}},height:{get:function(){return this._height},set:function(t){this.setSize(this._width,t)}}});o.NONE=0,o.WIDTH_CONTROLS_HEIGHT=1,o.HEIGHT_CONTROLS_WIDTH=2,o.FIT=3,o.ENVELOP=4,t.exports=o},94160:t=>{t.exports="add"},95393:t=>{t.exports="remove"},36716:(t,e,i)=>{t.exports={PROCESS_QUEUE_ADD:i(94160),PROCESS_QUEUE_REMOVE:i(95393)}},20010:(t,e,i)=>{t.exports={Events:i(36716),List:i(71207),Map:i(33885),ProcessQueue:i(74623),RTree:i(68687),Set:i(58403),Size:i(90881)}},17487:(t,e,i)=>{var s=i(56694),r=i(82897),n=i(27119),a=i(86459),o=i(28621),h=i(31673),l=new s({Extends:h,initialize:function(t,e,i,s,r){h.call(this,t,e,i,s,r),this.add("__BASE",0,0,0,s,r),this._source=this.frames.__BASE.source,this.canvas=this._source.image,this.context=this.canvas.getContext("2d"),this.width=s,this.height=r,this.imageData=this.context.getImageData(0,0,s,r),this.data=null,this.imageData&&(this.data=this.imageData.data),this.pixels=null,this.buffer,this.data&&(this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data)},update:function(){return this.imageData=this.context.getImageData(0,0,this.width,this.height),this.data=this.imageData.data,this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data,this.manager.game.config.renderType===a.WEBGL&&this.refresh(),this},draw:function(t,e,i){return this.context.drawImage(i,t,e),this.update()},drawFrame:function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=0);var r=this.manager.getFrame(t,e);if(r){var n=r.canvasData,a=r.cutWidth,o=r.cutHeight,h=r.source.resolution;return this.context.drawImage(r.source.image,n.x,n.y,a,o,i,s,a/h,o/h),this.update()}return this},setPixel:function(t,e,i,s,r,n){if(void 0===n&&(n=255),t=Math.abs(Math.floor(t)),e=Math.abs(Math.floor(e)),this.getIndex(t,e)>-1){var a=this.context.getImageData(t,e,1,1);a.data[0]=i,a.data[1]=s,a.data[2]=r,a.data[3]=n,this.context.putImageData(a,t,e)}return this},putData:function(t,e,i,s,r,n,a){return void 0===s&&(s=0),void 0===r&&(r=0),void 0===n&&(n=t.width),void 0===a&&(a=t.height),this.context.putImageData(t,e,i,s,r,n,a),this},getData:function(t,e,i,s){return t=r(Math.floor(t),0,this.width-1),e=r(Math.floor(e),0,this.height-1),i=r(i,1,this.width-t),s=r(s,1,this.height-e),this.context.getImageData(t,e,i,s)},getPixel:function(t,e,i){i||(i=new n);var s=this.getIndex(t,e);if(s>-1){var r=this.data,a=r[s+0],o=r[s+1],h=r[s+2],l=r[s+3];i.setTo(a,o,h,l)}return i},getPixels:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===s&&(s=i),t=Math.abs(Math.round(t)),e=Math.abs(Math.round(e));for(var a=r(t,0,this.width),o=r(t+i,0,this.width),h=r(e,0,this.height),l=r(e+s,0,this.height),u=new n,c=[],d=h;d{var s=i(56694),r=i(82897),n=i(98611),a=new s({initialize:function(t,e,i,s,r,n,a){this.texture=t,this.name=e,this.source=t.source[i],this.sourceIndex=i,this.glTexture=this.source.glTexture,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0}},this.setSize(n,a,s,r)},setSize:function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=0),this.cutX=i,this.cutY=s,this.cutWidth=t,this.cutHeight=e,this.width=t,this.height=e,this.halfWidth=Math.floor(.5*t),this.halfHeight=Math.floor(.5*e),this.centerX=Math.floor(t/2),this.centerY=Math.floor(e/2);var r=this.data,n=r.cut;n.x=i,n.y=s,n.w=t,n.h=e,n.r=i+t,n.b=s+e,r.sourceSize.w=t,r.sourceSize.h=e,r.spriteSourceSize.w=t,r.spriteSourceSize.h=e,r.radius=.5*Math.sqrt(t*t+e*e);var a=r.drawImage;return a.x=i,a.y=s,a.width=t,a.height=e,this.updateUVs()},setTrim:function(t,e,i,s,r,n){var a=this.data,o=a.spriteSourceSize;return a.trim=!0,a.sourceSize.w=t,a.sourceSize.h=e,o.x=i,o.y=s,o.w=r,o.h=n,o.r=i+r,o.b=s+n,this.x=i,this.y=s,this.width=r,this.height=n,this.halfWidth=.5*r,this.halfHeight=.5*n,this.centerX=Math.floor(r/2),this.centerY=Math.floor(n/2),this.updateUVs()},setCropUVs:function(t,e,i,s,n,a,o){var h=this.cutX,l=this.cutY,u=this.cutWidth,c=this.cutHeight,d=this.realWidth,f=this.realHeight,p=h+(e=r(e,0,d)),v=l+(i=r(i,0,f)),g=s=r(s,0,d-e),m=n=r(n,0,f-i),y=this.data;if(y.trim){var x=y.spriteSourceSize,T=e+(s=r(s,0,u-e)),w=i+(n=r(n,0,c-i));if(!(x.rT||x.y>w)){var E=Math.max(x.x,e),b=Math.max(x.y,i),S=Math.min(x.r,T)-E,A=Math.min(x.b,w)-b;g=S,m=A,p=a?h+(u-(E-x.x)-S):h+(E-x.x),v=o?l+(c-(b-x.y)-A):l+(b-x.y),e=E,i=b,s=S,n=A}else p=0,v=0,g=0,m=0}else a&&(p=h+(u-e-s)),o&&(v=l+(c-i-n));var _=this.source.width,C=this.source.height;return t.u0=Math.max(0,p/_),t.v0=Math.max(0,v/C),t.u1=Math.min(1,(p+g)/_),t.v1=Math.min(1,(v+m)/C),t.x=e,t.y=i,t.cx=p,t.cy=v,t.cw=g,t.ch=m,t.width=s,t.height=n,t.flipX=a,t.flipY=o,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},setUVs:function(t,e,i,s,r,n){var a=this.data.drawImage;return a.width=t,a.height=e,this.u0=i,this.v0=s,this.u1=r,this.v1=n,this},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,s=this.cutHeight,r=this.data.drawImage;r.width=i,r.height=s;var n=this.source.width,a=this.source.height;return this.u0=t/n,this.v0=e/a,this.u1=(t+i)/n,this.v1=(e+s)/a,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new a(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=n(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.source=null,this.texture=null,this.glTexture=null,this.customData=null,this.data=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=a},31673:(t,e,i)=>{var s=i(86459),r=i(56694),n=i(82047),a=i(32547),o='Texture "%s" has no frame "%s"',h=new r({initialize:function(t,e,i,s,r){Array.isArray(i)||(i=[i]),this.manager=t,this.key=e,this.source=[],this.dataSource=[],this.frames={},this.customData={},this.firstFrame="__BASE",this.frameTotal=0;for(var n=0;n{var s=i(61068),r=i(17487),n=i(56694),a=i(27119),o=i(86459),h=i(6659),l=i(38203),u=i(97081),c=i(52780),d=i(10850),f=i(69150),p=i(31673),v=new n({Extends:h,initialize:function(t){h.call(this),this.game=t,this.name="TextureManager",this.list={},this._tempCanvas=s.create2D(this,1,1),this._tempContext=this._tempCanvas.getContext("2d"),this._pending=0,t.events.once(u.BOOT,this.boot,this)},boot:function(){this._pending=3,this.on(l.LOAD,this.updatePending,this),this.on(l.ERROR,this.updatePending,this);var t=this.game.config;this.addBase64("__DEFAULT",t.defaultImage),this.addBase64("__MISSING",t.missingImage),this.addBase64("__WHITE",t.whiteImage),this.game.events.once(u.DESTROY,this.destroy,this)},updatePending:function(){this._pending--,0===this._pending&&(this.off(l.LOAD),this.off(l.ERROR),this.emit(l.READY))},checkKey:function(t){return!this.exists(t)||(console.error("Texture key already in use: "+t),!1)},remove:function(t){if("string"==typeof t){if(!this.exists(t))return console.warn("No texture found matching key: "+t),this;t=this.get(t)}return this.list.hasOwnProperty(t.key)&&(t.destroy(),this.emit(l.REMOVE,t.key)),this},removeKey:function(t){return this.list.hasOwnProperty(t)&&delete this.list[t],this},addBase64:function(t,e){if(this.checkKey(t)){var i=this,s=new Image;s.onerror=function(){i.emit(l.ERROR,t)},s.onload=function(){var e=i.create(t,s);f.Image(e,0),i.emit(l.ADD,t,e),i.emit(l.LOAD,t,e)},s.src=e}return this},getBase64:function(t,e,i,r){void 0===i&&(i="image/png"),void 0===r&&(r=.92);var n="",a=this.getFrame(t,e);if(a&&(a.source.isRenderTexture||a.source.isGLTexture))console.warn("Cannot getBase64 from WebGL Texture");else if(a){var o=a.canvasData,h=s.create2D(this,o.width,o.height);h.getContext("2d").drawImage(a.source.image,o.x,o.y,o.width,o.height,0,0,o.width,o.height),n=h.toDataURL(i,r),s.remove(h)}return n},addImage:function(t,e,i){var s=null;return this.checkKey(t)&&(s=this.create(t,e),f.Image(s,0),i&&s.setDataSource(i),this.emit(l.ADD,t,s)),s},addGLTexture:function(t,e,i,s){var r=null;return this.checkKey(t)&&(void 0===i&&(i=e.width),void 0===s&&(s=e.height),(r=this.create(t,e,i,s)).add("__BASE",0,0,0,i,s),this.emit(l.ADD,t,r)),r},addCompressedTexture:function(t,e,i){var s=null;if(this.checkKey(t)){if((s=this.create(t,e)).add("__BASE",0,0,0,e.width,e.height),i)if(Array.isArray(i))for(var r=0;r=n.x&&t=n.y&&e=n.x&&t=n.y&&e{var s=i(61068),r=i(56694),n=i(28621),a=i(27394),o=new r({initialize:function(t,e,i,s,r){void 0===r&&(r=!1);var o=t.manager.game;this.renderer=o.renderer,this.texture=t,this.source=e,this.image=e.compressed?null:e,this.compressionAlgorithm=e.compressed?e.format:null,this.resolution=1,this.width=i||e.naturalWidth||e.videoWidth||e.width||0,this.height=s||e.naturalHeight||e.videoHeight||e.height||0,this.scaleMode=a.DEFAULT,this.isCanvas=e instanceof HTMLCanvasElement,this.isVideo=window.hasOwnProperty("HTMLVideoElement")&&e instanceof HTMLVideoElement,this.isRenderTexture="RenderTexture"===e.type,this.isGLTexture=window.hasOwnProperty("WebGLTexture")&&e instanceof WebGLTexture,this.isPowerOf2=n(this.width,this.height),this.glTexture=null,this.glIndex=0,this.glIndexCounter=-1,this.flipY=r,this.init(o)},init:function(t){var e=this.renderer;e&&(e.gl?this.isCanvas?this.glTexture=e.createCanvasTexture(this.image,!1,this.flipY):this.isVideo?this.glTexture=e.createVideoTexture(this.image,!1,this.flipY):this.isRenderTexture?(this.image=this.source.canvas,this.glTexture=e.createTextureFromSource(null,this.width,this.height,this.scaleMode)):this.isGLTexture?this.glTexture=this.source:this.compressionAlgorithm?this.glTexture=e.createTextureFromSource(this.source):this.glTexture=e.createTextureFromSource(this.image,this.width,this.height,this.scaleMode):this.isRenderTexture&&(this.image=this.source.canvas)),t.config.antialias||this.setFilter(1)},setFilter:function(t){this.renderer.gl&&this.renderer.setTextureFilter(this.glTexture,t),this.scaleMode=t},setFlipY:function(t){return void 0===t&&(t=!0),this.flipY=t,this},update:function(){var t=this.renderer.gl;t&&this.isCanvas?this.glTexture=this.renderer.updateCanvasTexture(this.image,this.glTexture,this.flipY):t&&this.isVideo&&(this.glTexture=this.renderer.updateVideoTexture(this.image,this.glTexture,this.flipY))},destroy:function(){this.glTexture&&this.renderer.deleteTexture(this.glTexture,!0),this.isCanvas&&s.remove(this.image),this.renderer=null,this.texture=null,this.source=null,this.image=null,this.glTexture=null}});t.exports=o},65154:t=>{t.exports={LINEAR:0,NEAREST:1}},49644:t=>{t.exports="addtexture"},60079:t=>{t.exports="onerror"},72665:t=>{t.exports="onload"},93006:t=>{t.exports="ready"},69018:t=>{t.exports="removetexture"},38203:(t,e,i)=>{t.exports={ADD:i(49644),ERROR:i(60079),LOAD:i(72665),READY:i(93006),REMOVE:i(69018)}},87499:(t,e,i)=>{var s=i(98611),r=i(65154),n={CanvasTexture:i(17487),Events:i(38203),FilterMode:r,Frame:i(82047),Parsers:i(69150),Texture:i(31673),TextureManager:i(6237),TextureSource:i(32547)};n=s(!1,n,r),t.exports=n},35082:t=>{t.exports=function(t,e,i){if(i.getElementsByTagName("TextureAtlas")){var s=t.source[e];t.add("__BASE",e,0,0,s.width,s.height);for(var r,n=i.getElementsByTagName("SubTexture"),a=0;a{t.exports=function(t,e){var i=t.source[e];return t.add("__BASE",e,0,0,i.width,i.height),t}},21560:t=>{t.exports=function(t,e){var i=t.source[e];return t.add("__BASE",e,0,0,i.width,i.height),t}},64423:(t,e,i)=>{var s=i(32742);t.exports=function(t,e,i){if(i.frames||i.textures){var r=t.source[e];t.add("__BASE",e,0,0,r.width,r.height);for(var n,a=Array.isArray(i.textures)?i.textures[e].frames:i.frames,o=0;o{var s=i(32742);t.exports=function(t,e,i){if(i.frames){var r=t.source[e];t.add("__BASE",e,0,0,r.width,r.height);var n,a=i.frames;for(var o in a)if(a.hasOwnProperty(o)){var h=a[o];n=t.add(o,e,h.frame.x,h.frame.y,h.frame.w,h.frame.h),h.trimmed&&n.setTrim(h.sourceSize.w,h.sourceSize.h,h.spriteSourceSize.x,h.spriteSourceSize.y,h.spriteSourceSize.w,h.spriteSourceSize.h),h.rotated&&(n.rotated=!0,n.updateUVsInverted());var l=h.anchor||h.pivot;l&&(n.customPivot=!0,n.pivotX=l.x,n.pivotY=l.y),n.customData=s(h)}for(var u in i)"frames"!==u&&(Array.isArray(i[u])?t.customData[u]=i[u].slice(0):t.customData[u]=i[u]);return t}console.warn("Invalid Texture Atlas JSON Hash given, missing 'frames' Object")}},67409:t=>{t.exports=function(t){var e,i=[171,75,84,88,32,49,49,187,13,10,26,10],s=new Uint8Array(t,0,12);for(e=0;e>1),v=Math.max(1,v>>1),f+=g}return{mipmaps:d,width:h,height:l,internalFormat:o,compressed:!0,generateMipmap:!1}}console.warn("KTXParser - Only compressed formats supported")}},24904:t=>{function e(t,e,i,s,r,n,a){return void 0===a&&(a=16),Math.floor((t+i)/r)*Math.floor((e+s)/n)*a}function i(t,e){return(t=Math.max(t,16))*(e=Math.max(e,8))/4}function s(t,e){return(t=Math.max(t,8))*(e=Math.max(e,8))/2}function r(t,i){return e(t,i,3,3,4,4,8)}function n(t,i){return e(t,i,3,3,4,4)}var a={0:{sizeFunc:i,glFormat:35841},1:{sizeFunc:i,glFormat:35843},2:{sizeFunc:s,glFormat:35840},3:{sizeFunc:s,glFormat:35842},6:{sizeFunc:r,glFormat:36196},7:{sizeFunc:r,glFormat:33776},8:{sizeFunc:n,glFormat:33777},9:{sizeFunc:n,glFormat:33778},11:{sizeFunc:n,glFormat:33779},22:{sizeFunc:r,glFormat:37492},23:{sizeFunc:n,glFormat:37496},24:{sizeFunc:r,glFormat:37494},25:{sizeFunc:r,glFormat:37488},26:{sizeFunc:n,glFormat:37490},27:{sizeFunc:n,glFormat:37808},28:{sizeFunc:function(t,i){return e(t,i,4,3,5,4)},glFormat:37809},29:{sizeFunc:function(t,i){return e(t,i,4,4,5,5)},glFormat:37810},30:{sizeFunc:function(t,i){return e(t,i,5,4,6,5)},glFormat:37811},31:{sizeFunc:function(t,i){return e(t,i,5,5,6,6)},glFormat:37812},32:{sizeFunc:function(t,i){return e(t,i,7,4,8,5)},glFormat:37813},33:{sizeFunc:function(t,i){return e(t,i,7,5,8,6)},glFormat:37814},34:{sizeFunc:function(t,i){return e(t,i,7,7,8,8)},glFormat:37815},35:{sizeFunc:function(t,i){return e(t,i,9,4,10,5)},glFormat:37816},36:{sizeFunc:function(t,i){return e(t,i,9,5,10,6)},glFormat:37817},37:{sizeFunc:function(t,i){return e(t,i,9,7,10,8)},glFormat:37818},38:{sizeFunc:function(t,i){return e(t,i,9,9,10,10)},glFormat:37819},39:{sizeFunc:function(t,i){return e(t,i,11,9,12,10)},glFormat:37820},40:{sizeFunc:function(t,i){return e(t,i,11,11,12,12)},glFormat:37821}};t.exports=function(t){for(var e=new Uint32Array(t,0,13),i=e[2],s=a[i].glFormat,r=a[i].sizeFunc,n=e[11],o=e[7],h=e[6],l=52+e[12],u=new Uint8Array(t,l),c=new Array(n),d=0,f=o,p=h,v=0;v>1),p=Math.max(1,p>>1),d+=g}return{mipmaps:c,width:o,height:h,internalFormat:s,compressed:!0,generateMipmap:!1}}},6143:(t,e,i)=>{var s=i(72632);t.exports=function(t,e,i,r,n,a,o){var h=s(o,"frameWidth",null),l=s(o,"frameHeight",h);if(null===h)throw new Error("TextureManager.SpriteSheet: Invalid frameWidth given.");var u=t.source[e];t.add("__BASE",e,0,0,u.width,u.height);var c=s(o,"startFrame",0),d=s(o,"endFrame",-1),f=s(o,"margin",0),p=s(o,"spacing",0),v=Math.floor((n-f+p)/(h+p))*Math.floor((a-f+p)/(l+p));0===v&&console.warn("SpriteSheet frame dimensions will result in zero frames for texture:",t.key),(c>v||c<-v)&&(c=0),c<0&&(c=v+c),-1!==d&&(v=c+(d+1));for(var g=f,m=f,y=0,x=0,T=0;Tn&&(y=w-n),E>a&&(x=E-a),t.add(T,e,i+g,r+m,h-y,l-x),(g+=h+p)+h>n&&(g=f,m+=l+p)}return t}},20030:(t,e,i)=>{var s=i(72632);t.exports=function(t,e,i){var r=s(i,"frameWidth",null),n=s(i,"frameHeight",r);if(!r)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var a=t.source[0];t.add("__BASE",0,0,0,a.width,a.height);var o,h=s(i,"startFrame",0),l=s(i,"endFrame",-1),u=s(i,"margin",0),c=s(i,"spacing",0),d=e.cutX,f=e.cutY,p=e.cutWidth,v=e.cutHeight,g=e.realWidth,m=e.realHeight,y=Math.floor((g-u+c)/(r+c)),x=Math.floor((m-u+c)/(n+c)),T=y*x,w=e.x,E=r-w,b=r-(g-p-w),S=e.y,A=n-S,_=n-(m-v-S);(h>T||h<-T)&&(h=0),h<0&&(h=T+h),-1!==l&&(T=h+(l+1));for(var C=u,R=u,M=0,P=e.sourceIndex,O=0;O{var e=0,i=function(t,i,s,r){var n=e-r.y-r.height;t.add(s,i,r.x,n,r.width,r.height)};t.exports=function(t,s,r){var n=t.source[s];t.add("__BASE",s,0,0,n.width,n.height),e=n.height;for(var a=r.split("\n"),o=/^[ ]*(- )*(\w+)+[: ]+(.*)/,h="",l="",u={x:0,y:0,width:0,height:0},c=0;c{t.exports={AtlasXML:i(35082),Canvas:i(83332),Image:i(21560),JSONArray:i(64423),JSONHash:i(17264),KTXParser:i(67409),PVRParser:i(24904),SpriteSheet:i(6143),SpriteSheetFromAtlas:i(20030),UnityYAML:i(89187)}},93560:t=>{t.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}},97042:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s,r,n,a){(void 0===i||i<=0)&&(i=32),(void 0===s||s<=0)&&(s=32),void 0===r&&(r=0),void 0===n&&(n=0),this.name=t,this.firstgid=0|e,this.imageWidth=0|i,this.imageHeight=0|s,this.imageMargin=0|r,this.imageSpacing=0|n,this.properties=a||{},this.images=[],this.total=0},containsImageIndex:function(t){return t>=this.firstgid&&t{var s=new(i(56694))({initialize:function(t){if(this.gids=[],void 0!==t)for(var e=0;e{var s=i(93560),r=i(16586),n=i(90715),a=i(89797);t.exports=function(t,e,i,o,h,l,u,c){void 0===i&&(i=32),void 0===o&&(o=32),void 0===h&&(h=10),void 0===l&&(l=10),void 0===c&&(c=!1);var d=null;if(Array.isArray(u))d=n(void 0!==e?e:"map",s.ARRAY_2D,u,i,o,c);else if(void 0!==e){var f=t.cache.tilemap.get(e);f?d=n(e,f.format,f.data,i,o,c):console.warn("No map data found for key "+e)}return null===d&&(d=new r({tileWidth:i,tileHeight:o,width:h,height:l})),new a(t,d)}},29633:(t,e,i)=>{var s=i(12920),r=i(56694),n=i(64937),a=i(66658),o=new r({Mixins:[n.Alpha,n.Flip,n.Visible],initialize:function(t,e,i,s,r,n,a,o){this.layer=t,this.index=e,this.x=i,this.y=s,this.width=r,this.height=n,this.right,this.bottom,this.baseWidth=void 0!==a?a:r,this.baseHeight=void 0!==o?o:n,this.pixelX=0,this.pixelY=0,this.updatePixelXY(),this.properties={},this.rotation=0,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceLeft=!1,this.faceRight=!1,this.faceTop=!1,this.faceBottom=!1,this.collisionCallback=void 0,this.collisionCallbackContext=this,this.tint=16777215,this.physics={}},containsPoint:function(t,e){return!(tthis.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=t.properties,this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldXY(this.x,this.y,void 0,t).x:this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldY(this.y,t)-(this.height-this.baseHeight)*e.scaleY:this.y*this.baseHeight-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new a),e.x=this.getLeft(t),e.y=this.getTop(t),e.width=this.getRight(t)-e.x,e.height=this.getBottom(t)-e.y,e},getCenterX:function(t){return(this.getLeft(t)+this.getRight(t))/2},getCenterY:function(t){return(this.getTop(t)+this.getBottom(t))/2},intersects:function(t,e,i,s){return!(i<=this.pixelX||s<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){(void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,s,r){(void 0===e&&(e=t),void 0===i&&(i=t),void 0===s&&(s=t),void 0===r&&(r=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=s,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=s,r)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,s){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==s&&(this.baseHeight=s),this.updatePixelXY(),this},updatePixelXY:function(){var t=this.layer.orientation;if(t===s.ORTHOGONAL)this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight;else if(t===s.ISOMETRIC)this.pixelX=(this.x-this.y)*this.baseWidth*.5,this.pixelY=(this.x+this.y)*this.baseHeight*.5;else if(t===s.STAGGERED)this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*(this.baseHeight/2);else if(t===s.HEXAGONAL){var e=this.layer.hexSideLength,i=(this.baseHeight-e)/2+e;this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*i}return this.right=this.pixelX+this.baseWidth,this.bottom=this.pixelY+this.baseHeight,this},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||void 0!==this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.layer.tilemapLayer;if(t){var e=t.gidMap[this.index];if(e)return e}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=o},89797:(t,e,i)=>{var s=i(56694),r=i(75606),n=i(93560),a=i(72632),o=i(94990),h=i(46422),l=i(12920),u=i(52257),c=i(72677),d=i(13747),f=i(29633),p=i(5047),v=i(87177),g=i(47975),m=new s({initialize:function(t,e){this.scene=t,this.tileWidth=e.tileWidth,this.tileHeight=e.tileHeight,this.width=e.width,this.height=e.height,this.orientation=e.orientation,this.renderOrder=e.renderOrder,this.format=e.format,this.version=e.version,this.properties=e.properties,this.widthInPixels=e.widthInPixels,this.heightInPixels=e.heightInPixels,this.imageCollections=e.imageCollections,this.images=e.images,this.layers=e.layers,this.tilesets=e.tilesets,this.objects=e.objects,this.currentLayerIndex=0,this.hexSideLength=e.hexSideLength;var i=this.orientation;this._convert={WorldToTileXY:p.GetWorldToTileXYFunction(i),WorldToTileX:p.GetWorldToTileXFunction(i),WorldToTileY:p.GetWorldToTileYFunction(i),TileToWorldXY:p.GetTileToWorldXYFunction(i),TileToWorldX:p.GetTileToWorldXFunction(i),TileToWorldY:p.GetTileToWorldYFunction(i)}},createBlankDynamicLayer:function(t,e,i,s,r,n,a,o){return console.warn("createBlankDynamicLayer is deprecated. Use createBlankLayer"),this.createBlankLayer(t,e,i,s,r,n,a,o)},createDynamicLayer:function(t,e,i,s){return console.warn("createDynamicLayer is deprecated. Use createLayer"),this.createLayer(t,e,i,s)},createStaticLayer:function(t,e,i,s){return console.warn("createStaticLayer is deprecated. Use createLayer"),this.createLayer(t,e,i,s)},setRenderOrder:function(t){var e=["right-down","left-down","right-up","left-up"];return"number"==typeof t&&(t=e[t]),e.indexOf(t)>-1&&(this.renderOrder=t),this},addTilesetImage:function(t,e,i,s,r,a,o){if(void 0===t)return null;if(null==e&&(e=t),!this.scene.sys.textures.exists(e))return console.warn("Invalid Tileset Image: "+e),null;var h=this.scene.sys.textures.get(e),l=this.getTilesetIndex(t);if(null===l&&this.format===n.TILED_JSON)return console.warn("No data found for Tileset: "+t),null;var u=this.tilesets[l];return u?(u.setTileSize(i,s),u.setSpacing(r,a),u.setImage(h),u):(void 0===i&&(i=this.tileWidth),void 0===s&&(s=this.tileHeight),void 0===r&&(r=0),void 0===a&&(a=0),void 0===o&&(o=0),(u=new g(t,o,i,s,r,a)).setImage(h),this.tilesets.push(u),u)},copy:function(t,e,i,s,r,n,a,o){return null!==(o=this.getLayer(o))?(p.Copy(t,e,i,s,r,n,a,o),this):null},createBlankLayer:function(t,e,i,s,r,n,a,h){if(void 0===i&&(i=0),void 0===s&&(s=0),void 0===r&&(r=this.width),void 0===n&&(n=this.height),void 0===a&&(a=this.tileWidth),void 0===h&&(h=this.tileHeight),null!==this.getLayerIndex(t))return console.warn("Invalid Tilemap Layer ID: "+t),null;for(var l,u=new o({name:t,tileWidth:a,tileHeight:h,width:r,height:n,orientation:this.orientation}),c=0;c-1&&this.putTileAt(e,n.x,n.y,i,n.tilemapLayer)}return s},removeTileAt:function(t,e,i,s,r){return void 0===i&&(i=!0),void 0===s&&(s=!0),null===(r=this.getLayer(r))?null:p.RemoveTileAt(t,e,i,s,r)},removeTileAtWorldXY:function(t,e,i,s,r,n){return void 0===i&&(i=!0),void 0===s&&(s=!0),null===(n=this.getLayer(n))?null:p.RemoveTileAtWorldXY(t,e,i,s,r,n)},renderDebug:function(t,e,i){return null===(i=this.getLayer(i))?null:(this.orientation===l.ORTHOGONAL&&p.RenderDebug(t,e,i),this)},renderDebugFull:function(t,e){for(var i=this.layers,s=0;s{var s=i(99325),r=i(15043);s.register("tilemap",(function(t){var e=void 0!==t?t:{};return r(this.scene,e.key,e.tileWidth,e.tileHeight,e.width,e.height,e.data,e.insertNull)}))},37940:(t,e,i)=>{var s=i(61286),r=i(15043);s.register("tilemap",(function(t,e,i,s,n,a,o){return null===t&&(t=void 0),null===e&&(e=void 0),null===i&&(i=void 0),null===s&&(s=void 0),null===n&&(n=void 0),r(this.scene,t,e,i,s,n,a,o)}))},87177:(t,e,i)=>{var s=i(56694),r=i(64937),n=i(89980),a=i(5047),o=i(96193),h=new s({Extends:n,Mixins:[r.Alpha,r.BlendMode,r.ComputedSize,r.Depth,r.Flip,r.GetBounds,r.Origin,r.Pipeline,r.Transform,r.Visible,r.ScrollFactor,o],initialize:function(t,e,i,s,r,o){n.call(this,t,"TilemapLayer"),this.isTilemap=!0,this.tilemap=e,this.layerIndex=i,this.layer=e.layers[i],this.layer.tilemapLayer=this,this.tileset=[],this.tilesDrawn=0,this.tilesTotal=this.layer.width*this.layer.height,this.culledTiles=[],this.skipCull=!1,this.cullPaddingX=1,this.cullPaddingY=1,this.cullCallback=a.GetCullTilesFunction(this.layer.orientation),this._renderOrder=0,this.gidMap=[],this.setTilesets(s),this.setAlpha(this.layer.alpha),this.setPosition(r,o),this.setOrigin(),this.setSize(e.tileWidth*this.layer.width,e.tileHeight*this.layer.height),this.initPipeline()},setTilesets:function(t){var e=[],i=[],s=this.tilemap;Array.isArray(t)||(t=[t]);for(var r=0;r=0&&t<4&&(this._renderOrder=t),this},calculateFacesAt:function(t,e){return a.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,s){return a.CalculateFacesWithin(t,e,i,s,this.layer),this},createFromTiles:function(t,e,i,s,r){return a.CreateFromTiles(t,e,i,s,r,this.layer)},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles,this._renderOrder)},copy:function(t,e,i,s,r,n,o){return a.Copy(t,e,i,s,r,n,o,this.layer),this},fill:function(t,e,i,s,r,n){return a.Fill(t,e,i,s,r,n,this.layer),this},filterTiles:function(t,e,i,s,r,n,o){return a.FilterTiles(t,e,i,s,r,n,o,this.layer)},findByIndex:function(t,e,i){return a.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,s,r,n,o){return a.FindTile(t,e,i,s,r,n,o,this.layer)},forEachTile:function(t,e,i,s,r,n,o){return a.ForEachTile(t,e,i,s,r,n,o,this.layer),this},getTileAt:function(t,e,i){return a.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,s){return a.GetTileAtWorldXY(t,e,i,s,this.layer)},getTilesWithin:function(t,e,i,s,r){return a.GetTilesWithin(t,e,i,s,r,this.layer)},getTilesWithinShape:function(t,e,i){return a.GetTilesWithinShape(t,e,i,this.layer)},getTilesWithinWorldXY:function(t,e,i,s,r,n){return a.GetTilesWithinWorldXY(t,e,i,s,r,n,this.layer)},hasTileAt:function(t,e){return a.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return a.HasTileAtWorldXY(t,e,i,this.layer)},putTileAt:function(t,e,i,s){return a.PutTileAt(t,e,i,s,this.layer)},putTileAtWorldXY:function(t,e,i,s,r){return a.PutTileAtWorldXY(t,e,i,s,r,this.layer)},putTilesAt:function(t,e,i,s){return a.PutTilesAt(t,e,i,s,this.layer),this},randomize:function(t,e,i,s,r){return a.Randomize(t,e,i,s,r,this.layer),this},removeTileAt:function(t,e,i,s){return a.RemoveTileAt(t,e,i,s,this.layer)},removeTileAtWorldXY:function(t,e,i,s,r){return a.RemoveTileAtWorldXY(t,e,i,s,r,this.layer)},renderDebug:function(t,e){return a.RenderDebug(t,e,this.layer),this},replaceByIndex:function(t,e,i,s,r,n){return a.ReplaceByIndex(t,e,i,s,r,n,this.layer),this},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},setCollision:function(t,e,i,s){return a.SetCollision(t,e,i,this.layer,s),this},setCollisionBetween:function(t,e,i,s){return a.SetCollisionBetween(t,e,i,s,this.layer),this},setCollisionByProperty:function(t,e,i){return a.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return a.SetCollisionByExclusion(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return a.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileIndexCallback:function(t,e,i){return a.SetTileIndexCallback(t,e,i,this.layer),this},setTileLocationCallback:function(t,e,i,s,r,n){return a.SetTileLocationCallback(t,e,i,s,r,n,this.layer),this},shuffle:function(t,e,i,s){return a.Shuffle(t,e,i,s,this.layer),this},swapByIndex:function(t,e,i,s,r,n){return a.SwapByIndex(t,e,i,s,r,n,this.layer),this},tileToWorldX:function(t,e){return this.tilemap.tileToWorldX(t,e,this)},tileToWorldY:function(t,e){return this.tilemap.tileToWorldY(t,e,this)},tileToWorldXY:function(t,e,i,s){return this.tilemap.tileToWorldXY(t,e,i,s,this)},weightedRandomize:function(t,e,i,s,r){return a.WeightedRandomize(e,i,s,r,t,this.layer),this},worldToTileX:function(t,e,i){return this.tilemap.worldToTileX(t,e,i,this)},worldToTileY:function(t,e,i){return this.tilemap.worldToTileY(t,e,i,this)},worldToTileXY:function(t,e,i,s,r){return this.tilemap.worldToTileXY(t,e,i,s,r,this)},destroy:function(t){void 0===t&&(t=!0),this.tilemap&&(this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),t&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.culledTiles.length=0,this.cullCallback=null,this.gidMap=[],this.tileset=[],n.prototype.destroy.call(this))}});t.exports=h},17394:(t,e,i)=>{var s=i(69360),r=new s,n=new s,a=new s;t.exports=function(t,e,i,s){var o=e.cull(i),h=o.length,l=i.alpha*e.alpha;if(!(0===h||l<=0)){var u=r,c=n,d=a;c.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),u.copyFrom(i.matrix);var f=t.currentContext,p=e.gidMap;f.save(),s?(u.multiplyWithOffset(s,-i.scrollX*e.scrollFactorX,-i.scrollY*e.scrollFactorY),c.e=e.x,c.f=e.y,u.multiply(c,d),d.copyToContext(f)):(c.e-=i.scrollX*e.scrollFactorX,c.f-=i.scrollY*e.scrollFactorY,c.copyToContext(f)),(!t.antialias||e.scaleX>1||e.scaleY>1)&&(f.imageSmoothingEnabled=!1);for(var v=0;v{var s=i(72283),r=i(72283);s=i(51395),r=i(17394),t.exports={renderWebGL:s,renderCanvas:r}},51395:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i){var r=e.cull(i),n=r.length,a=i.alpha*e.alpha;if(!(0===n||a<=0)){var o=e.gidMap,h=t.pipelines.set(e.pipeline,e),l=s.getTintAppendFloatAlpha,u=e.scrollFactorX,c=e.scrollFactorY,d=e.x,f=e.y,p=e.scaleX,v=e.scaleY;t.pipelines.preBatch(e);for(var g=0;g{var s=i(56694),r=i(93736),n=new s({initialize:function(t,e,i,s,n,a,o,h,l){(void 0===i||i<=0)&&(i=32),(void 0===s||s<=0)&&(s=32),void 0===n&&(n=0),void 0===a&&(a=0),void 0===o&&(o={}),void 0===h&&(h={}),this.name=t,this.firstgid=e,this.tileWidth=i,this.tileHeight=s,this.tileMargin=n,this.tileSpacing=a,this.tileProperties=o,this.tileData=h,this.tileOffset=new r,void 0!==l&&this.tileOffset.set(l.x,l.y),this.image=null,this.glTexture=null,this.rows=0,this.columns=0,this.total=0,this.texCoordinates=[]},getTileProperties:function(t){return this.containsTileIndex(t)?this.tileProperties[t-this.firstgid]:null},getTileData:function(t){return this.containsTileIndex(t)?this.tileData[t-this.firstgid]:null},getTileCollisionGroup:function(t){var e=this.getTileData(t);return e&&e.objectgroup?e.objectgroup:null},containsTileIndex:function(t){return t>=this.firstgid&&t{var s=i(15494);t.exports=function(t,e,i){var r=s(t,e,!0,i),n=s(t,e-1,!0,i),a=s(t,e+1,!0,i),o=s(t-1,e,!0,i),h=s(t+1,e,!0,i),l=r&&r.collides;return l&&(r.faceTop=!0,r.faceBottom=!0,r.faceLeft=!0,r.faceRight=!0),n&&n.collides&&(l&&(r.faceTop=!1),n.faceBottom=!l),a&&a.collides&&(l&&(r.faceBottom=!1),a.faceTop=!l),o&&o.collides&&(l&&(r.faceLeft=!1),o.faceRight=!l),h&&h.collides&&(l&&(r.faceRight=!1),h.faceLeft=!l),r&&!r.collides&&r.resetFaces(),r}},60386:(t,e,i)=>{var s=i(15494),r=i(50811);t.exports=function(t,e,i,n,a){for(var o=null,h=null,l=null,u=null,c=r(t,e,i,n,null,a),d=0;d{var s=new(i(93736));t.exports=function(t,e,i,r){var n=i.tilemapLayer,a=n.cullPaddingX,o=n.cullPaddingY,h=n.tilemap.tileToWorldXY(t,e,s,r,n);return h.x>r.worldView.x+n.scaleX*i.tileWidth*(-a-.5)&&h.xr.worldView.y+n.scaleY*i.tileHeight*(-o-1)&&h.y{var s=i(50811),r=i(60386);t.exports=function(t,e,i,n,a,o,h,l){void 0===h&&(h=!0),t<0&&(t=0),e<0&&(e=0);for(var u=s(t,e,i,n,null,l),c=a-t,d=o-e,f=0;f=0&&p=0&&v{var s=i(50811),r=i(51202);t.exports=function(t,e,i,n,a,o){i||(i={}),Array.isArray(t)||(t=[t]);var h=o.tilemapLayer;n||(n=h.scene),a||(a=n.cameras.main);var l,u=s(0,0,o.width,o.height,null,o),c=[];for(l=0;l{var s=i(74118),r=i(82127),n=i(84314),a=new s;t.exports=function(t,e){var i=t.tilemapLayer.tilemap,s=t.tilemapLayer,o=Math.floor(i.tileWidth*s.scaleX),h=Math.floor(i.tileHeight*s.scaleY),l=n(e.worldView.x-s.x,o,0,!0)-s.cullPaddingX,u=r(e.worldView.right-s.x,o,0,!0)+s.cullPaddingX,c=n(e.worldView.y-s.y,h,0,!0)-s.cullPaddingY,d=r(e.worldView.bottom-s.y,h,0,!0)+s.cullPaddingY;return a.setTo(l,c,u-l,d-c)}},381:(t,e,i)=>{var s=i(71586),r=i(6987);t.exports=function(t,e,i,n){void 0===i&&(i=[]),void 0===n&&(n=0),i.length=0;var a=t.tilemapLayer,o=s(t,e);return(a.skipCull||1!==a.scrollFactorX||1!==a.scrollFactorY)&&(o.left=0,o.right=t.width,o.top=0,o.bottom=t.height),r(t,o,n,i),i}},97734:(t,e,i)=>{var s=i(50811),r=i(60386),n=i(68234);t.exports=function(t,e,i,a,o,h,l){for(var u=-1!==l.collideIndexes.indexOf(t),c=s(e,i,a,o,null,l),d=0;d{var s=i(50811);t.exports=function(t,e,i,r,n,a,o,h){return s(i,r,n,a,o,h).filter(t,e)}},37982:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=0),void 0===i&&(i=!1);var r,n,a,o=0;if(i){for(n=s.height-1;n>=0;n--)for(r=s.width-1;r>=0;r--)if((a=s.data[n][r])&&a.index===t){if(o===e)return a;o+=1}}else for(n=0;n{var s=i(50811);t.exports=function(t,e,i,r,n,a,o,h){return s(i,r,n,a,o,h).find(t,e)||null}},80916:(t,e,i)=>{var s=i(50811);t.exports=function(t,e,i,r,n,a,o,h){s(i,r,n,a,o,h).forEach(t,e)}},31493:(t,e,i)=>{var s=i(12920),r=i(381),n=i(37524),a=i(20887),o=i(72283),h=i(19242);t.exports=function(t){return t===s.ORTHOGONAL?r:t===s.HEXAGONAL?n:t===s.STAGGERED?h:t===s.ISOMETRIC?a:o}},15494:(t,e,i)=>{var s=i(62839);t.exports=function(t,e,i,r){if(void 0===i&&(i=!1),s(t,e,r)){var n=r.data[e][t]||null;return n?-1===n.index?i?n:null:n:null}return null}},24640:(t,e,i)=>{var s=i(15494),r=new(i(93736));t.exports=function(t,e,i,n,a){return a.tilemapLayer.worldToTileXY(t,e,!0,r,n),s(r.x,r.y,i,a)}},16884:(t,e,i)=>{var s=i(12920),r=i(72283),n=i(44150);t.exports=function(t){return t===s.ORTHOGONAL?n:r}},68182:(t,e,i)=>{var s=i(12920),r=i(21715),n=i(21808),a=i(72283),o=i(33388),h=i(46836);t.exports=function(t){return t===s.ORTHOGONAL?h:t===s.ISOMETRIC?n:t===s.HEXAGONAL?r:t===s.STAGGERED?o:a}},3752:(t,e,i)=>{var s=i(12920),r=i(37728),n=i(72283),a=i(84132),o=i(42477);t.exports=function(t){return t===s.ORTHOGONAL?o:t===s.HEXAGONAL?r:t===s.STAGGERED?a:n}},50811:(t,e,i)=>{var s=i(72632);t.exports=function(t,e,i,r,n,a){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=a.width),void 0===r&&(r=a.height),n||(n={});var o=s(n,"isNotEmpty",!1),h=s(n,"isColliding",!1),l=s(n,"hasInterestingFace",!1);t<0&&(i+=t,t=0),e<0&&(r+=e,e=0),t+i>a.width&&(i=Math.max(a.width-t,0)),e+r>a.height&&(r=Math.max(a.height-e,0));for(var u=[],c=e;c{var s=i(84068),r=i(50811),n=i(7563),a=i(72283),o=i(93736),h=function(t,e){return n.RectangleToTriangle(e,t)},l=new o,u=new o,c=new o;t.exports=function(t,e,i,o){if(void 0===t)return[];var d=a;t instanceof s.Circle?d=n.CircleToRectangle:t instanceof s.Rectangle?d=n.RectangleToRectangle:t instanceof s.Triangle?d=h:t instanceof s.Line&&(d=n.LineToRectangle),o.tilemapLayer.worldToTileXY(t.left,t.top,!0,u,i);var f=u.x,p=u.y;o.tilemapLayer.worldToTileXY(t.right,t.bottom,!0,c,i);var v=Math.ceil(c.x),g=Math.ceil(c.y),m=Math.max(v-f,1),y=Math.max(g-p,1),x=r(f,p,m,y,e,o),T=o.tileWidth,w=o.tileHeight;o.tilemapLayer&&(T*=o.tilemapLayer.scaleX,w*=o.tilemapLayer.scaleY);for(var E=[],b=new s.Rectangle(0,0,T,w),S=0;S{var s=i(50811),r=i(93736),n=new r,a=new r;t.exports=function(t,e,i,r,o,h,l){var u=l.tilemapLayer.tilemap._convert.WorldToTileXY;u(t,e,!0,n,h,l);var c=n.x,d=n.y;u(t+i,e+r,!1,a,h,l);var f=Math.ceil(a.x),p=Math.ceil(a.y);return s(c,d,f-c,p-d,o,l)}},29296:(t,e,i)=>{var s=i(12920),r=i(72283),n=i(806);t.exports=function(t){return t===s.ORTHOGONAL?n:r}},32688:(t,e,i)=>{var s=i(12920),r=i(11516),n=i(18750),a=i(72283),o=i(90562),h=i(45676);t.exports=function(t){return t===s.ORTHOGONAL?h:t===s.ISOMETRIC?n:t===s.HEXAGONAL?r:t===s.STAGGERED?o:a}},74326:(t,e,i)=>{var s=i(12920),r=i(44382),n=i(72283),a=i(3689),o=i(70520);t.exports=function(t){return t===s.ORTHOGONAL?o:t===s.HEXAGONAL?r:t===s.STAGGERED?a:n}},46598:(t,e,i)=>{var s=i(62839);t.exports=function(t,e,i){if(s(t,e,i)){var r=i.data[e][t];return null!==r&&r.index>-1}return!1}},28654:(t,e,i)=>{var s=i(46598),r=new(i(93736));t.exports=function(t,e,i,n){n.tilemapLayer.worldToTileXY(t,e,!0,r,i);var a=r.x,o=r.y;return s(a,o,n)}},6358:(t,e,i)=>{var s=i(82127),r=i(84314);t.exports=function(t,e){var i=t.tilemapLayer.tilemap,n=t.tilemapLayer,a=Math.floor(i.tileWidth*n.scaleX),o=Math.floor(i.tileHeight*n.scaleY),h=t.hexSideLength,l=(o-h)/2+h;return{left:r(e.worldView.x-n.x,a,0,!0)-n.cullPaddingX,right:s(e.worldView.right-n.x,a,0,!0)+n.cullPaddingX,top:r(e.worldView.y-n.y,l,0,!0)-n.cullPaddingY,bottom:s(e.worldView.bottom-n.y,l,0,!0)+n.cullPaddingY}}},37524:(t,e,i)=>{var s=i(6358),r=i(6987);t.exports=function(t,e,i,n){void 0===i&&(i=[]),void 0===n&&(n=0),i.length=0;var a=t.tilemapLayer;if(!a.skipCull&&1===a.scrollFactorX&&1===a.scrollFactorY){var o=s(t,e);r(t,o,n,i)}return i}},21715:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,r,n){i||(i=new s);var a=n.baseTileWidth,o=n.baseTileHeight,h=n.tilemapLayer,l=0,u=0;h&&(r||(r=h.scene.cameras.main),l=h.x+r.scrollX*(1-h.scrollFactorX),a*=h.scaleX,u=h.y+r.scrollY*(1-h.scrollFactorY),o*=h.scaleY);var c=n.hexSideLength,d=l+t*a+e%2*(a/2),f=u+e*((o-c)/2+c);return i.set(d,f)}},37728:t=>{t.exports=function(t,e,i){var s=i.baseTileHeight,r=i.tilemapLayer,n=0;r&&(void 0===e&&(e=r.scene.cameras.main),n=r.y+e.scrollY*(1-r.scrollFactorY),s*=r.scaleY);var a=r.tilemap.hexSideLength;return n+t*((s-a)/2+a)}},11516:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,r,n,a){r||(r=new s);var o=a.baseTileWidth,h=a.baseTileHeight,l=a.tilemapLayer;l&&(n||(n=l.scene.cameras.main),e-=l.y+n.scrollY*(1-l.scrollFactorY),h*=l.scaleY,t-=l.x+n.scrollX*(1-l.scrollFactorX),o*=l.scaleX);var u=a.hexSideLength,c=(h-u)/2+u,d=i?Math.floor(e/c):e/c,f=i?Math.floor((t-d%2*.5*o)/o):(t-d%2*.5*o)/o;return r.set(f,d)}},44382:t=>{t.exports=function(t,e,i,s){var r=s.baseTileHeight,n=s.tilemapLayer;n&&(i||(i=n.scene.cameras.main),t-=n.y+i.scrollY*(1-n.scrollFactorY),r*=n.scaleY);var a=s.hexSideLength,o=(r-a)/2+a;return e?Math.floor(t/o):t/o}},62839:t=>{t.exports=function(t,e,i){return t>=0&&t=0&&e{var s=i(13125);t.exports=function(t,e,i,r){void 0===i&&(i=[]),void 0===r&&(r=0),i.length=0;var n,a,o,h=t.tilemapLayer,l=t.data,u=t.width,c=t.height,d=u,f=c;if(!h.skipCull)if(0===r){for(a=0;a=0;n--)if(s(n,a,t,e)){if(!(o=l[a][n])||-1===o.index||!o.visible||0===o.alpha)continue;i.push(o)}}else if(2===r){for(a=f;a>=0;a--)for(n=0;l[a]&&n=0;a--)for(n=d;l[a]&&n>=0;n--)if(s(n,a,t,e)){if(!(o=l[a][n])||-1===o.index||!o.visible||0===o.alpha)continue;i.push(o)}return h.tilesDrawn=i.length,h.tilesTotal=u*c,i}},21808:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,r,n){i||(i=new s);var a=n.baseTileWidth,o=n.baseTileHeight,h=n.tilemapLayer,l=0,u=0;h&&(r||(r=h.scene.cameras.main),l=h.x+r.scrollX*(1-h.scrollFactorX),a*=h.scaleX,u=h.y+r.scrollY*(1-h.scrollFactorY),o*=h.scaleY);var c=l+a/2*(t-e),d=u+(t+e)*(o/2);return i.set(c,d)}},18750:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,r,n,a){r||(r=new s);var o=a.baseTileWidth,h=a.baseTileHeight,l=a.tilemapLayer;l&&(n||(n=l.scene.cameras.main),e-=l.y+n.scrollY*(1-l.scrollFactorY),h*=l.scaleY,t-=l.x+n.scrollX*(1-l.scrollFactorX),o*=l.scaleX);var u=i?Math.floor((t/(o/2)+e/(h/2))/2):(t/(o/2)+e/(h/2))/2,c=i?Math.floor((e/(h/2)-t/(o/2))/2):(e/(h/2)-t/(o/2))/2;return r.set(u,c)}},29003:(t,e,i)=>{var s=i(29633),r=i(62839),n=i(92839),a=i(68234),o=i(14556);t.exports=function(t,e,i,h,l){if(void 0===h&&(h=!0),!r(e,i,l))return null;var u=l.data[i][e],c=u&&u.collides;if(t instanceof s)null===l.data[i][e]&&(l.data[i][e]=new s(l,t.index,e,i,l.tileWidth,l.tileHeight)),l.data[i][e].copy(t);else{var d=t;null===l.data[i][e]?l.data[i][e]=new s(l,d,e,i,l.tileWidth,l.tileHeight):l.data[i][e].index=d}var f=l.data[i][e],p=-1!==l.collideIndexes.indexOf(f.index),v=o(l.tilemapLayer.tilemap)[d=t instanceof s?t.index:t][2],g=l.tilemapLayer.tileset[v];return f.width=g.tileWidth,f.height=g.tileHeight,a(f,p),h&&c!==f.collides&&n(e,i,l),f}},48565:(t,e,i)=>{var s=i(29003),r=new(i(93736));t.exports=function(t,e,i,n,a,o){return o.tilemapLayer.worldToTileXY(e,i,!0,r,a,o),s(t,r.x,r.y,n,o)}},56547:(t,e,i)=>{var s=i(60386),r=i(29003);t.exports=function(t,e,i,n,a){if(void 0===n&&(n=!0),!Array.isArray(t))return null;Array.isArray(t[0])||(t=[t]);for(var o=t.length,h=t[0].length,l=0;l{var s=i(50811),r=i(72861);t.exports=function(t,e,i,n,a,o){var h,l=s(t,e,i,n,{},o);if(!a)for(a=[],h=0;h{var s=i(29633),r=i(62839),n=i(92839);t.exports=function(t,e,i,a,o){if(void 0===i&&(i=!0),void 0===a&&(a=!0),!r(t,e,o))return null;var h=o.data[e][t];return h?(o.data[e][t]=i?null:new s(o,-1,t,e,o.tileWidth,o.tileHeight),a&&h&&h.collides&&n(t,e,o),h):null}},17384:(t,e,i)=>{var s=i(929),r=new(i(93736));t.exports=function(t,e,i,n,a,o){return o.tilemapLayer.worldToTileXY(t,e,!0,r,a,o),s(r.x,r.y,i,n,o)}},93763:(t,e,i)=>{var s=i(50811),r=i(95509),n=new r(105,210,231,150),a=new r(243,134,48,200),o=new r(40,39,37,150);t.exports=function(t,e,i){void 0===e&&(e={});var r=void 0!==e.tileColor?e.tileColor:n,h=void 0!==e.collidingTileColor?e.collidingTileColor:a,l=void 0!==e.faceColor?e.faceColor:o,u=s(0,0,i.width,i.height,null,i);t.translateCanvas(i.tilemapLayer.x,i.tilemapLayer.y),t.scaleCanvas(i.tilemapLayer.scaleX,i.tilemapLayer.scaleY);for(var c=0;c{var s=i(50811);t.exports=function(t,e,i,r,n,a,o){for(var h=s(i,r,n,a,null,o),l=0;l{t.exports=function(t,e,i,s){var r,n,a,o=t.data,h=t.width,l=t.height,u=t.tilemapLayer,c=Math.max(0,e.left),d=Math.min(h,e.right),f=Math.max(0,e.top),p=Math.min(l,e.bottom);if(0===i)for(n=f;n=c;r--)(a=o[n][r])&&-1!==a.index&&a.visible&&0!==a.alpha&&s.push(a);else if(2===i)for(n=p;n>=f;n--)for(r=c;o[n]&&r=f;n--)for(r=d;o[n]&&r>=c;r--)(a=o[n][r])&&-1!==a.index&&a.visible&&0!==a.alpha&&s.push(a);return u.tilesDrawn=s.length,u.tilesTotal=h*l,s}},51710:(t,e,i)=>{var s=i(68234),r=i(60386),n=i(91181);t.exports=function(t,e,i,a,o){void 0===e&&(e=!0),void 0===i&&(i=!0),void 0===o&&(o=!0),Array.isArray(t)||(t=[t]);for(var h=0;h{var s=i(68234),r=i(60386),n=i(91181);t.exports=function(t,e,i,a,o,h){if(void 0===i&&(i=!0),void 0===a&&(a=!0),void 0===h&&(h=!0),!(t>e)){for(var l=t;l<=e;l++)n(l,i,o);if(h)for(var u=0;u=t&&d.index<=e&&s(d,i)}a&&r(0,0,o.width,o.height,o)}}},33158:(t,e,i)=>{var s=i(68234),r=i(60386),n=i(91181);t.exports=function(t,e,i,a){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var o=0;o{var s=i(68234),r=i(60386),n=i(19256);t.exports=function(t,e,i,a){void 0===e&&(e=!0),void 0===i&&(i=!0);for(var o=0;o{var s=i(68234),r=i(60386);t.exports=function(t,e,i){void 0===t&&(t=!0),void 0===e&&(e=!0);for(var n=0;n0&&s(o,t)}}e&&r(0,0,i.width,i.height,i)}},91181:t=>{t.exports=function(t,e,i){var s=i.collideIndexes.indexOf(t);e&&-1===s?i.collideIndexes.push(t):e||-1===s||i.collideIndexes.splice(s,1)}},68234:t=>{t.exports=function(t,e){e?t.setCollision(!0,!0,!0,!0,!1):t.resetCollision(!1)}},11628:t=>{t.exports=function(t,e,i,s){if("number"==typeof t)s.callbacks[t]=null!==e?{callback:e,callbackContext:i}:void 0;else for(var r=0,n=t.length;r{var s=i(50811);t.exports=function(t,e,i,r,n,a,o){for(var h=s(t,e,i,r,null,o),l=0;l{var s=i(50811),r=i(18592);t.exports=function(t,e,i,n,a){var o=s(t,e,i,n,null,a),h=o.map((function(t){return t.index}));r(h);for(var l=0;l{var s=i(82127),r=i(84314);t.exports=function(t,e){var i=t.tilemapLayer.tilemap,n=t.tilemapLayer,a=Math.floor(i.tileWidth*n.scaleX),o=Math.floor(i.tileHeight*n.scaleY);return{left:r(e.worldView.x-n.x,a,0,!0)-n.cullPaddingX,right:s(e.worldView.right-n.x,a,0,!0)+n.cullPaddingX,top:r(e.worldView.y-n.y,o/2,0,!0)-n.cullPaddingY,bottom:s(e.worldView.bottom-n.y,o/2,0,!0)+n.cullPaddingY}}},19242:(t,e,i)=>{var s=i(53945),r=i(6987);t.exports=function(t,e,i,n){void 0===i&&(i=[]),void 0===n&&(n=0),i.length=0;var a=t.tilemapLayer;if(!a.skipCull&&1===a.scrollFactorX&&1===a.scrollFactorY){var o=s(t,e);r(t,o,n,i)}return i}},33388:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,r,n){i||(i=new s);var a=n.baseTileWidth,o=n.baseTileHeight,h=n.tilemapLayer,l=0,u=0;h&&(r||(r=h.scene.cameras.main),l=h.x+r.scrollX*(1-h.scrollFactorX),a*=h.scaleX,u=h.y+r.scrollY*(1-h.scrollFactorY),o*=h.scaleY);var c=l+t*a+e%2*(a/2),d=u+e*(o/2);return i.set(c,d)}},84132:t=>{t.exports=function(t,e,i){var s=i.baseTileHeight,r=i.tilemapLayer,n=0;return r&&(void 0===e&&(e=r.scene.cameras.main),n=r.y+e.scrollY*(1-r.scrollFactorY),s*=r.scaleY),n+t*(s/2)+s}},90562:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,r,n,a){r||(r=new s);var o=a.baseTileWidth,h=a.baseTileHeight,l=a.tilemapLayer;l&&(n||(n=l.scene.cameras.main),e-=l.y+n.scrollY*(1-l.scrollFactorY),h*=l.scaleY,t-=l.x+n.scrollX*(1-l.scrollFactorX),o*=l.scaleX);var u=i?Math.floor(e/(h/2)):e/(h/2),c=i?Math.floor((t+u%2*.5*o)/o):(t+u%2*.5*o)/o;return r.set(c,u)}},3689:t=>{t.exports=function(t,e,i,s){var r=s.baseTileHeight,n=s.tilemapLayer;return n&&(i||(i=n.scene.cameras.main),t-=n.y+i.scrollY*(1-n.scrollFactorY),r*=n.scaleY),e?Math.floor(t/(r/2)):t/(r/2)}},55217:(t,e,i)=>{var s=i(50811);t.exports=function(t,e,i,r,n,a,o){for(var h=s(i,r,n,a,null,o),l=0;l{t.exports=function(t,e,i){var s=i.baseTileWidth,r=i.tilemapLayer,n=0;return r&&(e||(e=r.scene.cameras.main),n=r.x+e.scrollX*(1-r.scrollFactorX),s*=r.scaleX),n+t*s}},46836:(t,e,i)=>{var s=i(44150),r=i(42477),n=i(93736);t.exports=function(t,e,i,a,o){return i||(i=new n(0,0)),i.x=s(t,a,o),i.y=r(e,a,o),i}},42477:t=>{t.exports=function(t,e,i){var s=i.baseTileHeight,r=i.tilemapLayer,n=0;return r&&(e||(e=r.scene.cameras.main),n=r.y+e.scrollY*(1-r.scrollFactorY),s*=r.scaleY),n+t*s}},39677:(t,e,i)=>{var s=i(50811);t.exports=function(t,e,i,r,n,a){if(n){var o,h=s(t,e,i,r,null,a),l=0;for(o=0;o{t.exports=function(t,e,i,s){void 0===e&&(e=!0);var r=s.baseTileWidth,n=s.tilemapLayer;return n&&(i||(i=n.scene.cameras.main),t-=n.x+i.scrollX*(1-n.scrollFactorX),r*=n.scaleX),e?Math.floor(t/r):t/r}},45676:(t,e,i)=>{var s=i(806),r=i(70520),n=i(93736);t.exports=function(t,e,i,a,o,h){return void 0===i&&(i=!0),a||(a=new n(0,0)),a.x=s(t,i,o,h),a.y=r(e,i,o,h),a}},70520:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=!0);var r=s.baseTileHeight,n=s.tilemapLayer;return n&&(i||(i=n.scene.cameras.main),t-=n.y+i.scrollY*(1-n.scrollFactorY),r*=n.scaleY),e?Math.floor(t/r):t/r}},5047:(t,e,i)=>{t.exports={CalculateFacesAt:i(92839),CalculateFacesWithin:i(60386),CheckIsoBounds:i(13125),Copy:i(17347),CreateFromTiles:i(93604),CullBounds:i(71586),CullTiles:i(381),Fill:i(97734),FilterTiles:i(63555),FindByIndex:i(37982),FindTile:i(48297),ForEachTile:i(80916),GetCullTilesFunction:i(31493),GetTileAt:i(15494),GetTileAtWorldXY:i(24640),GetTilesWithin:i(50811),GetTilesWithinShape:i(31674),GetTilesWithinWorldXY:i(44662),GetTileToWorldXFunction:i(16884),GetTileToWorldXYFunction:i(68182),GetTileToWorldYFunction:i(3752),GetWorldToTileXFunction:i(29296),GetWorldToTileXYFunction:i(32688),GetWorldToTileYFunction:i(74326),HasTileAt:i(46598),HasTileAtWorldXY:i(28654),HexagonalCullBounds:i(6358),HexagonalCullTiles:i(37524),HexagonalTileToWorldXY:i(21715),HexagonalTileToWorldY:i(37728),HexagonalWorldToTileXY:i(11516),HexagonalWorldToTileY:i(44382),IsInLayerBounds:i(62839),IsometricCullTiles:i(20887),IsometricTileToWorldXY:i(21808),IsometricWorldToTileXY:i(18750),PutTileAt:i(29003),PutTileAtWorldXY:i(48565),PutTilesAt:i(56547),Randomize:i(91180),RemoveTileAt:i(929),RemoveTileAtWorldXY:i(17384),RenderDebug:i(93763),ReplaceByIndex:i(51202),RunCull:i(6987),SetCollision:i(51710),SetCollisionBetween:i(15216),SetCollisionByExclusion:i(33158),SetCollisionByProperty:i(4180),SetCollisionFromCollisionGroup:i(18625),SetLayerCollisionIndex:i(91181),SetTileCollision:i(68234),SetTileIndexCallback:i(11628),SetTileLocationCallback:i(72732),Shuffle:i(34397),StaggeredCullBounds:i(53945),StaggeredCullTiles:i(19242),StaggeredTileToWorldXY:i(33388),StaggeredTileToWorldY:i(84132),StaggeredWorldToTileXY:i(90562),StaggeredWorldToTileY:i(3689),SwapByIndex:i(55217),TileToWorldX:i(44150),TileToWorldXY:i(46836),TileToWorldY:i(42477),WeightedRandomize:i(39677),WorldToTileX:i(806),WorldToTileXY:i(45676),WorldToTileY:i(70520)}},12920:t=>{t.exports={ORTHOGONAL:0,ISOMETRIC:1,STAGGERED:2,HEXAGONAL:3}},84758:(t,e,i)=>{var s={ORIENTATION:i(12920)};t.exports=s},52678:(t,e,i)=>{var s=i(98611),r=i(84758),n={Components:i(5047),Parsers:i(34124),Formats:i(93560),ImageCollection:i(97042),ParseToTilemap:i(15043),Tile:i(29633),Tilemap:i(89797),TilemapCreator:i(4843),TilemapFactory:i(37940),Tileset:i(47975),TilemapLayer:i(87177),Orientation:i(12920),LayerData:i(94990),MapData:i(16586),ObjectLayer:i(15256)};n=s(!1,n,r.ORIENTATION),t.exports=n},94990:(t,e,i)=>{var s=i(56694),r=i(12920),n=i(72632),a=new s({initialize:function(t){void 0===t&&(t={}),this.name=n(t,"name","layer"),this.x=n(t,"x",0),this.y=n(t,"y",0),this.width=n(t,"width",0),this.height=n(t,"height",0),this.tileWidth=n(t,"tileWidth",0),this.tileHeight=n(t,"tileHeight",0),this.baseTileWidth=n(t,"baseTileWidth",this.tileWidth),this.baseTileHeight=n(t,"baseTileHeight",this.tileHeight),this.orientation=n(t,"orientation",r.ORTHOGONAL),this.widthInPixels=n(t,"widthInPixels",this.width*this.baseTileWidth),this.heightInPixels=n(t,"heightInPixels",this.height*this.baseTileHeight),this.alpha=n(t,"alpha",1),this.visible=n(t,"visible",!0),this.properties=n(t,"properties",[]),this.indexes=n(t,"indexes",[]),this.collideIndexes=n(t,"collideIndexes",[]),this.callbacks=n(t,"callbacks",[]),this.bodies=n(t,"bodies",[]),this.data=n(t,"data",[]),this.tilemapLayer=n(t,"tilemapLayer",null),this.hexSideLength=n(t,"hexSideLength",0)}});t.exports=a},16586:(t,e,i)=>{var s=i(56694),r=i(12920),n=i(72632),a=new s({initialize:function(t){void 0===t&&(t={}),this.name=n(t,"name","map"),this.width=n(t,"width",0),this.height=n(t,"height",0),this.infinite=n(t,"infinite",!1),this.tileWidth=n(t,"tileWidth",0),this.tileHeight=n(t,"tileHeight",0),this.widthInPixels=n(t,"widthInPixels",this.width*this.tileWidth),this.heightInPixels=n(t,"heightInPixels",this.height*this.tileHeight),this.format=n(t,"format",null),this.orientation=n(t,"orientation",r.ORTHOGONAL),this.renderOrder=n(t,"renderOrder","right-down"),this.version=n(t,"version","1"),this.properties=n(t,"properties",{}),this.layers=n(t,"layers",[]),this.images=n(t,"images",[]),this.objects=n(t,"objects",[]),this.collision=n(t,"collision",{}),this.tilesets=n(t,"tilesets",[]),this.imageCollections=n(t,"imageCollections",[]),this.tiles=n(t,"tiles",[]),this.hexSideLength=n(t,"hexSideLength",0)}});t.exports=a},15256:(t,e,i)=>{var s=i(56694),r=i(72632),n=new s({initialize:function(t){void 0===t&&(t={}),this.name=r(t,"name","object layer"),this.opacity=r(t,"opacity",1),this.properties=r(t,"properties",{}),this.propertyTypes=r(t,"propertytypes",{}),this.type=r(t,"type","objectgroup"),this.visible=r(t,"visible",!0),this.objects=r(t,"objects",[])}});t.exports=n},21394:(t,e,i)=>{var s=i(12920);t.exports=function(t){return"isometric"===(t=t.toLowerCase())?s.ISOMETRIC:"staggered"===t?s.STAGGERED:"hexagonal"===t?s.HEXAGONAL:s.ORTHOGONAL}},90715:(t,e,i)=>{var s=i(93560),r=i(84346),n=i(96097),a=i(2378),o=i(44909);t.exports=function(t,e,i,h,l,u){var c;switch(e){case s.ARRAY_2D:c=r(t,i,h,l,u);break;case s.CSV:c=n(t,i,h,l,u);break;case s.TILED_JSON:c=a(t,i,u);break;case s.WELTMEISTER:c=o(t,i,u);break;default:console.warn("Unrecognized tilemap data format: "+e),c=null}return c}},84346:(t,e,i)=>{var s=i(93560),r=i(94990),n=i(16586),a=i(29633);t.exports=function(t,e,i,o,h){for(var l=new r({tileWidth:i,tileHeight:o}),u=new n({name:t,tileWidth:i,tileHeight:o,format:s.ARRAY_2D,layers:[l]}),c=[],d=e.length,f=0,p=0;p{var s=i(93560),r=i(84346);t.exports=function(t,e,i,n,a){var o=e.trim().split("\n").map((function(t){return t.split(",")})),h=r(t,o,i,n,a);return h.format=s.CSV,h}},30951:(t,e,i)=>{var s=i(94990),r=i(29633);t.exports=function(t,e){for(var i=[],n=0;n-1?new r(o,f,c,u,a.tilesize,a.tilesize):e?null:new r(o,-1,c,u,a.tilesize,a.tilesize),h.push(d)}l.push(h),h=[]}o.data=l,i.push(o)}return i}},47488:(t,e,i)=>{var s=i(47975);t.exports=function(t){for(var e=[],i=[],r=0;r{var s=i(93560),r=i(16586),n=i(30951),a=i(47488);t.exports=function(t,e,i){if(0===e.layer.length)return console.warn("No layers found in the Weltmeister map: "+t),null;for(var o=0,h=0,l=0;lo&&(o=e.layer[l].width),e.layer[l].height>h&&(h=e.layer[l].height);var u=new r({width:o,height:h,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:s.WELTMEISTER});return u.layers=n(e,i),u.tilesets=a(e),u}},24507:(t,e,i)=>{t.exports={ParseTileLayers:i(30951),ParseTilesets:i(47488),ParseWeltmeister:i(44909)}},34124:(t,e,i)=>{t.exports={FromOrientationString:i(21394),Parse:i(90715),Parse2DArray:i(84346),ParseCSV:i(96097),Impact:i(24507),Tiled:i(50044)}},48646:(t,e,i)=>{var s=i(98611);t.exports=function(t){for(var e,i,r,n,a,o=0;o{t.exports=function(t){for(var e=window.atob(t),i=e.length,s=new Array(i/4),r=0;r>>0;return s}},14556:(t,e,i)=>{var s=i(47975);t.exports=function(t){var e,i,r=[];for(e=0;e{var s=i(72632);t.exports=function(t,e,i){if(!e)return{i:0,layers:t.layers,name:"",opacity:1,visible:!0,x:0,y:0};var r=e.x+s(e,"startx",0)*t.tilewidth+s(e,"offsetx",0),n=e.y+s(e,"starty",0)*t.tileheight+s(e,"offsety",0);return{i:0,layers:e.layers,name:i.name+e.name+"/",opacity:i.opacity*e.opacity,visible:i.visible&&e.visible,x:i.x+r,y:i.y+n}}},8847:t=>{var e=2147483648,i=1073741824,s=536870912;t.exports=function(t){var r=Boolean(t&e),n=Boolean(t&i),a=Boolean(t&s);t&=536870911;var o=0,h=!1;return r&&n&&a?(o=Math.PI/2,h=!0):r&&n&&!a?(o=Math.PI,h=!1):r&&!n&&a?(o=Math.PI/2,h=!1):!r||n||a?!r&&n&&a?(o=3*Math.PI/2,h=!1):r||!n||a?r||n||!a?r||n||a||(o=0,h=!1):(o=3*Math.PI/2,h=!0):(o=Math.PI,h=!0):(o=0,h=!0),{gid:t,flippedHorizontal:r,flippedVertical:n,flippedAntiDiagonal:a,rotation:o,flipped:h}}},78339:(t,e,i)=>{var s=i(72632),r=i(92044);t.exports=function(t){for(var e=[],i=[],n=r(t);n.i0;)if(n.i>=n.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}n=i.pop()}else{var a=n.layers[n.i];if(n.i++,"imagelayer"===a.type){var o=s(a,"offsetx",0)+s(a,"startx",0),h=s(a,"offsety",0)+s(a,"starty",0);e.push({name:n.name+a.name,image:a.image,x:n.x+o+a.x,y:n.y+h+a.y,alpha:n.opacity*a.opacity,visible:n.visible&&a.visible,properties:s(a,"properties",{})})}else if("group"===a.type){var l=r(t,a,n);i.push(n),n=l}}return e}},2378:(t,e,i)=>{var s=i(48646),r=i(14556),n=i(12920),a=i(93560),o=i(21394),h=i(16586),l=i(78339),u=i(61136),c=i(95925),d=i(93392);t.exports=function(t,e,i){var f=new h({width:e.width,height:e.height,name:t,tileWidth:e.tilewidth,tileHeight:e.tileheight,orientation:o(e.orientation),format:a.TILED_JSON,version:e.version,properties:e.properties,renderOrder:e.renderorder,infinite:e.infinite});f.orientation===n.HEXAGONAL&&(f.hexSideLength=e.hexsidelength),f.layers=c(e,i),f.images=l(e);var p=d(e);return f.tilesets=p.tilesets,f.imageCollections=p.imageCollections,f.objects=u(e),f.tiles=r(f),s(f),f}},4281:(t,e,i)=>{var s=i(28820),r=i(8847),n=function(t){return{x:t.x,y:t.y}},a=["id","name","type","rotation","properties","visible","x","y","width","height"];t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0);var o=s(t,a);if(o.x+=e,o.y+=i,t.gid){var h=r(t.gid);o.gid=h.gid,o.flippedHorizontal=h.flippedHorizontal,o.flippedVertical=h.flippedVertical,o.flippedAntiDiagonal=h.flippedAntiDiagonal}else t.polyline?o.polyline=t.polyline.map(n):t.polygon?o.polygon=t.polygon.map(n):t.ellipse?o.ellipse=t.ellipse:t.text?o.text=t.text:t.point?o.point=!0:o.rectangle=!0;return o}},61136:(t,e,i)=>{var s=i(72632),r=i(4281),n=i(15256),a=i(92044);t.exports=function(t){for(var e=[],i=[],o=a(t);o.i0;)if(o.i>=o.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}o=i.pop()}else{var h=o.layers[o.i];if(o.i++,h.opacity*=o.opacity,h.visible=o.visible&&h.visible,"objectgroup"===h.type){h.name=o.name+h.name;for(var l=o.x+s(h,"startx",0)+s(h,"offsetx",0),u=o.y+s(h,"starty",0)+s(h,"offsety",0),c=[],d=0;d{var s=i(43908),r=i(12920),n=i(92044),a=i(21394),o=i(72632),h=i(94990),l=i(8847),u=i(29633);t.exports=function(t,e){for(var i=o(t,"infinite",!1),c=[],d=[],f=n(t);f.i0;)if(f.i>=f.layers.length){if(d.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}f=d.pop()}else{var p=f.layers[f.i];if(f.i++,"tilelayer"===p.type)if(p.compression)console.warn("TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '"+p.name+"'");else{if(p.encoding&&"base64"===p.encoding){if(p.chunks)for(var v=0;v0?((y=new u(g,m.gid,L,F,t.tilewidth,t.tileheight)).rotation=m.rotation,y.flipX=m.flipped,T[F][L]=y):(x=e?null:new u(g,-1,L,F,t.tilewidth,t.tileheight),T[F][L]=x),++w===_.width&&(M++,w=0)}}else{(g=new h({name:f.name+p.name,x:f.x+o(p,"offsetx",0)+p.x,y:f.y+o(p,"offsety",0)+p.y,width:p.width,height:p.height,tileWidth:t.tilewidth,tileHeight:t.tileheight,alpha:f.opacity*p.opacity,visible:f.visible&&p.visible,properties:o(p,"properties",[]),orientation:a(t.orientation)})).orientation===r.HEXAGONAL&&(g.hexSideLength=t.hexsidelength);for(var D=[],k=0,I=p.data.length;k0?((y=new u(g,m.gid,w,T.length,t.tilewidth,t.tileheight)).rotation=m.rotation,y.flipX=m.flipped,D.push(y)):(x=e?null:new u(g,-1,w,T.length,t.tilewidth,t.tileheight),D.push(x)),++w===p.width&&(T.push(D),w=0,D=[])}g.data=T,c.push(g)}else if("group"===p.type){var B=n(t,p,f);d.push(f),f=B}}return c}},93392:(t,e,i)=>{var s=i(47975),r=i(97042),n=i(4281),a=i(39642);t.exports=function(t){for(var e,i=[],o=[],h=null,l=0;l1){var d=void 0,f=void 0;if(Array.isArray(u.tiles)){d=d||{},f=f||{};for(var p=0;p{t.exports=function(t,e){for(var i=0;i0){var n,a,o,h={},l={};if(Array.isArray(s.edgecolors))for(n=0;n{t.exports={AssignTileProperties:i(48646),Base64Decode:i(43908),BuildTilesetIndex:i(14556),CreateGroupLayer:i(92044),ParseGID:i(8847),ParseImageLayers:i(78339),ParseJSONTiled:i(2378),ParseObject:i(4281),ParseObjectLayers:i(61136),ParseTileLayers:i(95925),ParseTilesets:i(93392)}},73779:(t,e,i)=>{var s=i(56694),r=i(91963),n=i(7599),a=i(57911),o=i(66458),h=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.now=0,this.timeScale=1,this.paused=!1,this._active=[],this._pendingInsertion=[],this._pendingRemoval=[],t.sys.events.once(n.BOOT,this.boot,this),t.sys.events.on(n.START,this.start,this)},boot:function(){this.now=this.systems.game.loop.time,this.systems.events.once(n.DESTROY,this.destroy,this)},start:function(){var t=this.systems.events;t.on(n.PRE_UPDATE,this.preUpdate,this),t.on(n.UPDATE,this.update,this),t.once(n.SHUTDOWN,this.shutdown,this)},addEvent:function(t){var e;return t instanceof a?(e=t,this.removeEvent(e),e.elapsed=e.startAt,e.hasDispatched=!1,e.repeatCount=-1===e.repeat||e.loop?999999999999:e.repeat):e=new a(t),this._pendingInsertion.push(e),e},delayedCall:function(t,e,i,s){return this.addEvent({delay:t,callback:e,args:i,callbackScope:s})},clearPendingEvents:function(){return this._pendingInsertion=[],this},removeEvent:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e-1&&this._active.splice(r,1),s.destroy()}for(i=0;i=s.delay)){var r=s.elapsed-s.delay;if(s.elapsed=s.delay,!s.hasDispatched&&s.callback&&(s.hasDispatched=!0,s.callback.apply(s.callbackScope,s.args)),s.repeatCount>0){if(s.repeatCount--,r>=s.delay)for(;r>=s.delay&&s.repeatCount>0;)s.callback&&s.callback.apply(s.callbackScope,s.args),r-=s.delay,s.repeatCount--;s.elapsed=r,s.hasDispatched=!1}else s.hasDispatched&&this._pendingRemoval.push(s)}}}},shutdown:function(){var t;for(t=0;t{var s=i(56694),r=i(72632),n=new s({initialize:function(t){this.delay=0,this.repeat=0,this.repeatCount=0,this.loop=!1,this.callback,this.callbackScope,this.args,this.timeScale=1,this.startAt=0,this.elapsed=0,this.paused=!1,this.hasDispatched=!1,this.reset(t)},reset:function(t){return this.delay=r(t,"delay",0),this.repeat=r(t,"repeat",0),this.loop=r(t,"loop",!1),this.callback=r(t,"callback",void 0),this.callbackScope=r(t,"callbackScope",this.callback),this.args=r(t,"args",[]),this.timeScale=r(t,"timeScale",1),this.startAt=r(t,"startAt",0),this.paused=r(t,"paused",!1),this.elapsed=this.startAt,this.hasDispatched=!1,this.repeatCount=-1===this.repeat||this.loop?999999999999:this.repeat,this},getProgress:function(){return this.elapsed/this.delay},getOverallProgress:function(){if(this.repeat>0){var t=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/t}return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return.001*this.elapsed},getRemaining:function(){return this.delay-this.elapsed},getRemainingSeconds:function(){return.001*this.getRemaining()},getOverallRemaining:function(){return this.delay*(1+this.repeatCount)-this.elapsed},getOverallRemainingSeconds:function(){return.001*this.getOverallRemaining()},remove:function(t){void 0===t&&(t=!1),this.elapsed=this.delay,this.hasDispatched=!t,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});t.exports=n},97121:(t,e,i)=>{t.exports={Clock:i(73779),TimerEvent:i(57911)}},28860:(t,e,i)=>{var s=i(56694),r=i(6659),n=i(54272),a=i(68061),o=i(55303),h=new s({Extends:r,initialize:function(t){r.call(this),this.manager=t,this.isTimeline=!0,this.data=[],this.totalData=0,this.useFrames=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.completeDelay=0,this.countdown=0,this.state=o.PENDING_ADD,this._pausedState=o.PENDING_ADD,this.paused=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.callbacks={onComplete:null,onLoop:null,onStart:null,onUpdate:null,onYoyo:null},this.callbackScope},dispatchTimelineEvent:function(t,e){this.emit(t,this),e&&e.func.apply(e.scope,e.params)},setTimeScale:function(t){return this.timeScale=t,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return this.state===o.ACTIVE},add:function(t){return this.queue(a(this,t))},queue:function(t){return this.isPlaying()||(t.parent=this,t.parentIsTimeline=!0,this.data.push(t),this.totalData=this.data.length),this},hasOffset:function(t){return null!==t.offset},isOffsetAbsolute:function(t){return"number"==typeof t},isOffsetRelative:function(t){if("string"===typeof t){var e=t[0];if("-"===e||"+"===e)return!0}return!1},getRelativeOffset:function(t,e){var i=t[0],s=parseFloat(t.substr(2)),r=e;switch(i){case"+":r+=s;break;case"-":r-=s}return Math.max(0,r)},calcDuration:function(){for(var t=0,e=0,i=0,s=0;s0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},init:function(){return this.calcDuration(),this.progress=0,this.totalProgress=0,!this.paused||(this.state=o.PAUSED,!1)},resetTweens:function(t){for(var e=0;e0?(this.elapsed=0,this.progress=0,this.loopCounter--,this.resetTweens(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=o.LOOP_DELAY):(this.state=o.ACTIVE,this.dispatchTimelineEvent(n.TIMELINE_LOOP,this.callbacks.onLoop))):this.completeDelay>0?(this.state=o.COMPLETE_DELAY,this.countdown=this.completeDelay):(this.state=o.PENDING_REMOVE,this.dispatchTimelineEvent(n.TIMELINE_COMPLETE,this.callbacks.onComplete))},update:function(t,e){if(this.state!==o.PAUSED){switch(this.useFrames&&(e=1*this.manager.timeScale),e*=this.timeScale,this.elapsed+=e,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=e,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),this.state){case o.ACTIVE:for(var i=this.totalData,s=0;s{var s=i(66458),r=i(56694),n=i(68710),a=i(91963),o=i(7599),h=i(91944),l=i(32981),u=i(55303),c=i(68061),d=new r({initialize:function(t){this.scene=t,this.systems=t.sys,this.timeScale=1,this._add=[],this._pending=[],this._active=[],this._destroy=[],this._toProcess=0,t.sys.events.once(o.BOOT,this.boot,this),t.sys.events.on(o.START,this.start,this)},boot:function(){this.systems.events.once(o.DESTROY,this.destroy,this)},start:function(){var t=this.systems.events;t.on(o.PRE_UPDATE,this.preUpdate,this),t.on(o.UPDATE,this.update,this),t.once(o.SHUTDOWN,this.shutdown,this),this.timeScale=1},createTimeline:function(t){return l(this,t)},timeline:function(t){var e=l(this,t);return e.paused||(this._add.push(e),this._toProcess++),e},create:function(t){return c(this,t)},add:function(t){var e=c(this,t);return this._add.push(e),this._toProcess++,e},existing:function(t){return this._add.push(t),this._toProcess++,this},addCounter:function(t){var e=n(this,t);return this._add.push(e),this._toProcess++,e},stagger:function(t,e){return h(t,e)},preUpdate:function(){if(0!==this._toProcess){var t,e,i=this._destroy,s=this._active,r=this._pending;for(t=0;t-1&&(e.state=u.REMOVED,r.splice(n,1)):(e.state=u.REMOVED,s.splice(n,1))}for(i.length=0,i=this._add,t=0;t{t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},21902:(t,e,i)=>{var s=i(35060),r=i(40587);t.exports=function(t,e){var i=s.Power0;if("string"==typeof t)if(s.hasOwnProperty(t))i=s[t];else{var n="";t.indexOf(".")&&("in"===(n=t.substr(t.indexOf(".")+1)).toLowerCase()?n="easeIn":"out"===n.toLowerCase()?n="easeOut":"inout"===n.toLowerCase()&&(n="easeInOut")),t=r(t.substr(0,t.indexOf(".")+1)+n),s.hasOwnProperty(t)&&(i=s[t])}else"function"==typeof t?i=t:Array.isArray(t)&&t.length;if(!e)return i;var a=e.slice(0);return a.unshift(0),function(t){return a[0]=t,i.apply(this,a)}}},28348:t=>{t.exports=function(t,e,i){var s;t.hasOwnProperty(e)?s="function"===typeof t[e]?function(i,s,r,n,a,o){return t[e](i,s,r,n,a,o)}:function(){return t[e]}:s="function"==typeof i?i:function(){return i};return s}},92407:(t,e,i)=>{var s=i(53709);t.exports=function(t){var e,i=[];if(t.hasOwnProperty("props"))for(e in t.props)"_"!==e.substr(0,1)&&i.push({key:e,value:t.props[e]});else for(e in t)-1===s.indexOf(e)&&"_"!==e.substr(0,1)&&i.push({key:e,value:t[e]});return i}},65868:(t,e,i)=>{var s=i(10850);t.exports=function(t){var e=s(t,"targets",null);return null===e||("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e])),e}},10365:(t,e,i)=>{var s=i(10850);t.exports=function(t){var e=s(t,"tweens",null);return null===e?[]:("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e]),e)}},9744:t=>{function e(t){return!!t.getActive&&"function"==typeof t.getActive}function i(t){return!!t.getStart&&"function"==typeof t.getStart}function s(t){return!!t.getEnd&&"function"==typeof t.getEnd}var r=function(t,n){var a,o,h=function(t,e,i){return i},l=function(t,e,i){return i},u=null,c=typeof n;if("number"===c)h=function(){return n};else if("string"===c){var d=n[0],f=parseFloat(n.substr(2));switch(d){case"+":h=function(t,e,i){return i+f};break;case"-":h=function(t,e,i){return i-f};break;case"*":h=function(t,e,i){return i*f};break;case"/":h=function(t,e,i){return i/f};break;default:h=function(){return parseFloat(n)}}}else if("function"===c)h=n;else if("object"===c)if(i(o=n)||s(o)||e(o))e(n)&&(u=n.getActive),s(n)&&(h=n.getEnd),i(n)&&(l=n.getStart);else if(n.hasOwnProperty("value"))a=r(t,n.value);else{var p=n.hasOwnProperty("to"),v=n.hasOwnProperty("from"),g=n.hasOwnProperty("start");if(p&&(v||g)){if(a=r(t,n.to),g){var m=r(t,n.start);a.getActive=m.getEnd}if(v){var y=r(t,n.from);a.getStart=y.getEnd}}}return a||(a={getActive:u,getEnd:h,getStart:l}),a};t.exports=r},68710:(t,e,i)=>{var s=i(99730),r=i(20494),n=i(63130),a=i(21902),o=i(28348),h=i(10850),l=i(9744),u=i(39366),c=i(15718);t.exports=function(t,e,i){void 0===i&&(i=s);var d=h(e,"from",0),f=h(e,"to",1),p=[{value:d}],v=o(e,"delay",i.delay),g=o(e,"duration",i.duration),m=h(e,"easeParams",i.easeParams),y=a(h(e,"ease",i.ease),m),x=o(e,"hold",i.hold),T=o(e,"repeat",i.repeat),w=o(e,"repeatDelay",i.repeatDelay),E=n(e,"yoyo",i.yoyo),b=[],S=l("value",f),A=c(p[0],0,"value",S.getEnd,S.getStart,S.getActive,y,v,g,E,x,T,w,!1,!1);A.start=d,A.current=d,A.to=f,b.push(A);var _=new u(t,b,p);_.offset=r(e,"offset",null),_.completeDelay=r(e,"completeDelay",0),_.loop=Math.round(r(e,"loop",0)),_.loopDelay=Math.round(r(e,"loopDelay",0)),_.paused=n(e,"paused",!1),_.useFrames=n(e,"useFrames",!1);for(var C=h(e,"callbackScope",_),R=u.TYPES,M=0;M{var s=i(21902),r=i(10850),n=i(83392);t.exports=function(t,e){var i;void 0===e&&(e={});var a=r(e,"start",0),o=r(e,"ease",null),h=r(e,"grid",null),l=r(e,"from",0),u="first"===l,c="center"===l,d="last"===l,f="number"==typeof l,p=Array.isArray(t),v=p?parseFloat(t[0]):parseFloat(t),g=p?parseFloat(t[1]):0,m=Math.max(v,g);if(p&&(a+=v),h){var y=h[0],x=h[1],T=0,w=0,E=0,b=0,S=[];d?(T=y-1,w=x-1):f?(T=l%y,w=Math.floor(l/y)):c&&(T=(y-1)/2,w=(x-1)/2);for(var A=n.MIN_SAFE_INTEGER,_=0;_A&&(A=R),S[_][C]=R}}}var M=o?s(o):null;return i=h?function(t,e,i,s){var r,n=0,o=s%y,h=Math.floor(s/y);if(o>=0&&o=0&&h{var s=i(32742),r=i(99730),n=i(20494),a=i(63130),o=i(21902),h=i(28348),l=i(65868),u=i(10365),c=i(10850),d=i(28860),f=i(68061);t.exports=function(t,e){var i=new d(t);i.completeDelay=n(e,"completeDelay",0),i.loop=Math.round(n(e,"loop",0)),i.loopDelay=Math.round(n(e,"loopDelay",0)),i.paused=a(e,"paused",!1),i.useFrames=a(e,"useFrames",!1);var p=c(e,"callbackScope",i),v=c(e,"onStart",!1);if(v){var g=c(e,"onStartScope",p),m=c(e,"onStartParams",[]);i.setCallback("onStart",v,m,g)}var y=c(e,"onUpdate",!1);if(y){var x=c(e,"onUpdateScope",p),T=c(e,"onUpdateParams",[]);i.setCallback("onUpdate",y,T,x)}var w=c(e,"onLoop",!1);if(w){var E=c(e,"onLoopScope",p),b=c(e,"onLoopParams",[]);i.setCallback("onLoop",w,b,E)}var S=c(e,"onYoyo",!1);if(S){var A=c(e,"onYoyoScope",p),_=c(e,"onYoyoParams",[]);i.setCallback("onYoyo",S,_,A)}var C=c(e,"onComplete",!1);if(C){var R=c(e,"onCompleteScope",p),M=c(e,"onCompleteParams",[]);i.setCallback("onComplete",C,M,R)}var P=u(e);if(0===P.length)return i.paused=!0,i;var O=s(r);O.targets=l(e);var L=n(e,"totalDuration",0);O.duration=L>0?Math.floor(L/P.length):h(e,"duration",O.duration),O.delay=h(e,"delay",O.delay),O.easeParams=c(e,"easeParams",O.easeParams),O.ease=o(c(e,"ease",O.ease),O.easeParams),O.hold=h(e,"hold",O.hold),O.repeat=h(e,"repeat",O.repeat),O.repeatDelay=h(e,"repeatDelay",O.repeatDelay),O.yoyo=a(e,"yoyo",O.yoyo),O.flipX=a(e,"flipX",O.flipX),O.flipY=a(e,"flipY",O.flipY);for(var F=0;F{var s=i(99730),r=i(20494),n=i(63130),a=i(21902),o=i(28348),h=i(92407),l=i(65868),u=i(10850),c=i(9744),d=i(39366),f=i(15718);t.exports=function(t,e,i){void 0===i&&(i=s);for(var p=i.targets?i.targets:l(e),v=h(e),g=o(e,"delay",i.delay),m=o(e,"duration",i.duration),y=u(e,"easeParams",i.easeParams),x=a(u(e,"ease",i.ease),y),T=o(e,"hold",i.hold),w=o(e,"repeat",i.repeat),E=o(e,"repeatDelay",i.repeatDelay),b=n(e,"yoyo",i.yoyo),S=n(e,"flipX",i.flipX),A=n(e,"flipY",i.flipY),_=[],C=0;C{t.exports={GetBoolean:i(63130),GetEaseFunction:i(21902),GetNewValue:i(28348),GetProps:i(92407),GetTargets:i(65868),GetTweens:i(10365),GetValueOp:i(9744),NumberTweenBuilder:i(68710),StaggerBuilder:i(91944),TimelineBuilder:i(32981),TweenBuilder:i(68061)}},51910:t=>{t.exports="complete"},76826:t=>{t.exports="loop"},59953:t=>{t.exports="pause"},92495:t=>{t.exports="resume"},55493:t=>{t.exports="start"},48224:t=>{t.exports="update"},5570:t=>{t.exports="active"},6383:t=>{t.exports="complete"},72582:t=>{t.exports="loop"},80803:t=>{t.exports="repeat"},10472:t=>{t.exports="start"},5379:t=>{t.exports="stop"},43449:t=>{t.exports="update"},61541:t=>{t.exports="yoyo"},54272:(t,e,i)=>{t.exports={TIMELINE_COMPLETE:i(51910),TIMELINE_LOOP:i(76826),TIMELINE_PAUSE:i(59953),TIMELINE_RESUME:i(92495),TIMELINE_START:i(55493),TIMELINE_UPDATE:i(48224),TWEEN_ACTIVE:i(5570),TWEEN_COMPLETE:i(6383),TWEEN_LOOP:i(72582),TWEEN_REPEAT:i(80803),TWEEN_START:i(10472),TWEEN_STOP:i(5379),TWEEN_UPDATE:i(43449),TWEEN_YOYO:i(61541)}},75193:(t,e,i)=>{var s=i(55303),r=i(98611),n={Builders:i(79619),Events:i(54272),TweenManager:i(64532),Tween:i(39366),TweenData:i(15718),Timeline:i(28860)};n=r(!1,n,s),t.exports=n},99730:t=>{t.exports={targets:null,delay:0,duration:1e3,ease:"Power0",easeParams:null,hold:0,repeat:0,repeatDelay:0,yoyo:!1,flipX:!1,flipY:!1}},53709:t=>{t.exports=["callbackScope","completeDelay","delay","duration","ease","easeParams","flipX","flipY","hold","loop","loopDelay","offset","onActive","onActiveParams","onActiveScope","onComplete","onCompleteParams","onCompleteScope","onLoop","onLoopParams","onLoopScope","onRepeat","onRepeatParams","onRepeatScope","onStart","onStartParams","onStartScope","onStop","onStopParams","onStopScope","onUpdate","onUpdateParams","onUpdateScope","onYoyo","onYoyoParams","onYoyoScope","paused","props","repeat","repeatDelay","targets","useFrames","yoyo"]},39366:(t,e,i)=>{var s=i(56694),r=i(6659),n=i(54272),a=i(99325),o=i(61286),h=i(55303),l=i(83392),u=new s({Extends:r,initialize:function(t,e,i){r.call(this),this.parent=t,this.parentIsTimeline=t.hasOwnProperty("isTimeline"),this.data=e,this.totalData=e.length,this.targets=i,this.totalTargets=i.length,this.useFrames=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.startDelay=0,this.hasStarted=!1,this.isSeeking=!1,this.completeDelay=0,this.countdown=0,this.offset=0,this.calculatedOffset=0,this.state=h.PENDING_ADD,this._pausedState=h.INIT,this.paused=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.callbacks={onActive:null,onComplete:null,onLoop:null,onRepeat:null,onStart:null,onStop:null,onUpdate:null,onYoyo:null},this.callbackScope},getValue:function(t){return void 0===t&&(t=0),this.data[t].current},setTimeScale:function(t){return this.timeScale=t,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return this.state===h.ACTIVE},isPaused:function(){return this.state===h.PAUSED},hasTarget:function(t){return-1!==this.targets.indexOf(t)},updateTo:function(t,e,i){void 0===i&&(i=!1);for(var s=0;s0&&(r.totalDuration+=r.t2*r.repeat),r.totalDuration>t&&(t=r.totalDuration),r.delay0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay,this.startDelay=e},init:function(){if(this.paused&&!this.parentIsTimeline)return this.state=h.PENDING_ADD,this._pausedState=h.INIT,!1;for(var t=this.data,e=this.totalTargets,i=0;i0?(this.elapsed=0,this.progress=0,this.loopCounter--,this.resetTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=h.LOOP_DELAY):(this.state=h.ACTIVE,this.dispatchTweenEvent(n.TWEEN_LOOP,this.callbacks.onLoop))):this.completeDelay>0?(this.state=h.COMPLETE_DELAY,this.countdown=this.completeDelay):(this.state=h.PENDING_REMOVE,this.dispatchTweenEvent(n.TWEEN_COMPLETE,this.callbacks.onComplete))},pause:function(){return this.state===h.PAUSED||(this.paused=!0,this._pausedState=this.state,this.state=h.PAUSED),this},play:function(t){void 0===t&&(t=!1);var e=this.state;return e!==h.INIT||this.parentIsTimeline?e===h.ACTIVE||e===h.PENDING_ADD&&this._pausedState===h.PENDING_ADD?this:this.parentIsTimeline||e!==h.PENDING_REMOVE&&e!==h.REMOVED?(this.parentIsTimeline?(this.resetTweenData(t),0===this.calculatedOffset?this.state=h.ACTIVE:(this.countdown=this.calculatedOffset,this.state=h.OFFSET_DELAY)):this.paused?(this.paused=!1,this.makeActive()):(this.resetTweenData(t),this.state=h.ACTIVE,this.makeActive()),this):(this.seek(0),this.parent.makeActive(this),this):(this.resetTweenData(!1),this.state=h.ACTIVE,this)},resetTweenData:function(t){for(var e=this.data,i=this.totalData,s=this.totalTargets,r=0;r0&&(n.elapsed=n.delay,n.state=h.DELAY),n.getActiveValue&&(a[o]=n.getActiveValue(n.target,n.key,n.start))}},resume:function(){return this.state===h.PAUSED?(this.paused=!1,this.state=this._pausedState):this.play(),this},seek:function(t,e){void 0===e&&(e=16.6),this.state===h.REMOVED&&this.makeActive(),this.elapsed=0,this.progress=0,this.totalElapsed=0,this.totalProgress=0;for(var i=this.data,s=this.totalTargets,r=0;r0&&(n.elapsed=n.delay,n.state=h.DELAY)}this.calcDuration();var c=!1;this.state===h.PAUSED&&(c=!0,this.state=h.ACTIVE),this.isSeeking=!0;do{this.update(0,e)}while(this.totalProgress0?(e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY(),e.start=e.getStartValue(e.target,e.key,e.start,e.index,t.totalTargets,t),e.end=e.getEndValue(e.target,e.key,e.start,e.index,t.totalTargets,t),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,h.REPEAT_DELAY):(this.dispatchTweenDataEvent(n.TWEEN_REPEAT,t.callbacks.onRepeat,e),h.PLAYING_FORWARD)):h.COMPLETE},setStateFromStart:function(t,e,i){return e.repeatCounter>0?(e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY(),e.end=e.getEndValue(e.target,e.key,e.start,e.index,t.totalTargets,t),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,h.REPEAT_DELAY):(this.dispatchTweenDataEvent(n.TWEEN_REPEAT,t.callbacks.onRepeat,e),h.PLAYING_FORWARD)):h.COMPLETE},updateTweenData:function(t,e,i){var s=e.target;switch(e.state){case h.PLAYING_FORWARD:case h.PLAYING_BACKWARD:if(!s){e.state=h.COMPLETE;break}var r=e.elapsed,a=e.duration,o=0;(r+=i)>a&&(o=r-a,r=a);var l=e.state===h.PLAYING_FORWARD,u=r/a;if(e.elapsed=r,e.progress=u,e.previous=e.current,1===u)l?(e.current=e.end,s[e.key]=e.end,e.hold>0?(e.elapsed=e.hold-o,e.state=h.HOLD_DELAY):e.state=this.setStateFromEnd(t,e,o)):(e.current=e.start,s[e.key]=e.start,e.state=this.setStateFromStart(t,e,o));else{var c=l?e.ease(u):e.ease(1-u);e.current=e.start+(e.end-e.start)*c,s[e.key]=e.current}this.dispatchTweenDataEvent(n.TWEEN_UPDATE,t.callbacks.onUpdate,e);break;case h.DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=h.PENDING_RENDER);break;case h.REPEAT_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=h.PLAYING_FORWARD,this.dispatchTweenDataEvent(n.TWEEN_REPEAT,t.callbacks.onRepeat,e));break;case h.HOLD_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.state=this.setStateFromEnd(t,e,Math.abs(e.elapsed)));break;case h.PENDING_RENDER:s?(e.start=e.getStartValue(s,e.key,s[e.key],e.index,t.totalTargets,t),e.end=e.getEndValue(s,e.key,e.start,e.index,t.totalTargets,t),e.current=e.start,s[e.key]=e.start,e.state=h.PLAYING_FORWARD):e.state=h.COMPLETE}return e.state!==h.COMPLETE}});u.TYPES=["onActive","onComplete","onLoop","onRepeat","onStart","onStop","onUpdate","onYoyo"],o.register("tween",(function(t){return this.scene.sys.tweens.add(t)})),a.register("tween",(function(t){return this.scene.sys.tweens.create(t)})),t.exports=u},15718:t=>{t.exports=function(t,e,i,s,r,n,a,o,h,l,u,c,d,f,p){return{target:t,index:e,key:i,getActiveValue:n,getEndValue:s,getStartValue:r,ease:a,duration:0,totalDuration:0,delay:0,yoyo:l,hold:0,repeat:0,repeatDelay:0,flipX:f,flipY:p,progress:0,elapsed:0,repeatCounter:0,start:0,previous:0,current:0,end:0,t1:0,t2:0,gen:{delay:o,duration:h,hold:u,repeat:c,repeatDelay:d},state:0}}},55303:t=>{t.exports={CREATED:0,INIT:1,DELAY:2,OFFSET_DELAY:3,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING_ADD:20,PAUSED:21,LOOP_DELAY:22,ACTIVE:23,COMPLETE_DELAY:24,PENDING_REMOVE:25,REMOVED:26}},56694:t=>{function e(t,e,i){var s=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&s.value&&"object"==typeof s.value&&(s=s.value),!(!s||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(s))&&(void 0===s.enumerable&&(s.enumerable=!0),void 0===s.configurable&&(s.configurable=!0),s)}function i(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function s(t,s,r,a){for(var o in s)if(s.hasOwnProperty(o)){var h=e(s,o,r);if(!1!==h){if(i((a||t).prototype,o)){if(n.ignoreFinals)continue;throw new Error("cannot override final property '"+o+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,o,h)}else t.prototype[o]=s[o]}}function r(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i{t.exports=function(){}},78991:t=>{t.exports=function(t,e,i,s,r){if(void 0===r&&(r=t),i>0){var n=i-t.length;if(n<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),s&&s.call(r,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.splice(a,1),a--;if(0===(a=e.length))return null;i>0&&a>n&&(e.splice(n),a=n);for(var o=0;o{t.exports=function(t,e,i,s,r,n){if(void 0===i&&(i=0),void 0===n&&(n=t),s>0){var a=s-t.length;if(a<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),r&&r.call(n,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.pop(),o--;if(0===(o=e.length))return null;s>0&&o>a&&(e.splice(a),o=a);for(var h=o-1;h>=0;h--){var l=e[h];t.splice(i,0,l),r&&r.call(n,l)}return e}},58742:t=>{t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i{var s=i(45838);t.exports=function(t,e,i,r,n){void 0===r&&(r=0),void 0===n&&(n=t.length);var a=0;if(s(t,r,n))for(var o=r;o{t.exports=function(t,e,i){var s,r=[null];for(s=3;s{var s=i(45838);t.exports=function(t,e,i,r,n){if(void 0===r&&(r=0),void 0===n&&(n=t.length),s(t,r,n)){var a,o=[null];for(a=5;a{t.exports=function(t,e,i){if(!e.length)return NaN;if(1===e.length)return e[0];var s,r,n=1;if(i){if(te.length&&(n=e.length),i?(s=e[n-1][i],(r=e[n][i])-t<=t-s?e[n]:e[n-1]):(s=e[n-1],(r=e[n])-t<=t-s?r:s)}},71608:(t,e,i)=>{var s=i(45838);t.exports=function(t,e,i,r,n){void 0===r&&(r=0),void 0===n&&(n=t.length);var a=[];if(s(t,r,n))for(var o=r;o{var s=i(45838);t.exports=function(t,e,i,r,n){if(void 0===r&&(r=0),void 0===n&&(n=t.length),s(t,r,n))for(var a=r;a{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var s=e+Math.floor(Math.random()*i);return void 0===t[s]?null:t[s]}},24218:t=>{t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),r=t.indexOf(i);if(s<0||r<0)throw new Error("Supplied items must be elements of the same array");return s>r||(t.splice(s,1),r===t.length-1?t.push(e):t.splice(r,0,e)),t}},58258:t=>{t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),r=t.indexOf(i);if(s<0||r<0)throw new Error("Supplied items must be elements of the same array");return s{t.exports=function(t,e){var i=t.indexOf(e);if(i>0){var s=t[i-1],r=t.indexOf(s);t[i]=s,t[r]=e}return t}},68396:t=>{t.exports=function(t,e,i){var s=t.indexOf(e);if(-1===s||i<0||i>=t.length)throw new Error("Supplied index out of bounds");return s!==i&&(t.splice(s,1),t.splice(i,0,e)),e}},27555:t=>{t.exports=function(t,e){var i=t.indexOf(e);if(-1!==i&&i{t.exports=function(t,e,i,s){var r,n=[],a=!1;if((i||s)&&(a=!0,i||(i=""),s||(s="")),e=e;r--)a?n.push(i+r.toString()+s):n.push(r);else for(r=t;r<=e;r++)a?n.push(i+r.toString()+s):n.push(r);return n}},89955:(t,e,i)=>{var s=i(67233);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var r=[],n=Math.max(s((e-t)/(i||1)),0),a=0;a{function e(t,e,i){var s=t[e];t[e]=t[i],t[i]=s}function i(t,e){return te?1:0}var s=function(t,r,n,a,o){for(void 0===n&&(n=0),void 0===a&&(a=t.length-1),void 0===o&&(o=i);a>n;){if(a-n>600){var h=a-n+1,l=r-n+1,u=Math.log(h),c=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*c*(h-c)/h)*(l-h/2<0?-1:1),f=Math.max(n,Math.floor(r-l*c/h+d)),p=Math.min(a,Math.floor(r+(h-l)*c/h+d));s(t,r,f,p,o)}var v=t[r],g=n,m=a;for(e(t,n,r),o(t[a],v)>0&&e(t,n,a);g0;)m--}0===o(t[n],v)?e(t,n,m):e(t,++m,a),m<=r&&(n=m+1),r<=m&&(a=m-1)}};t.exports=s},75757:(t,e,i)=>{var s=i(10850),r=i(18592),n=function(t,e,i){for(var s=[],r=0;r{var s=i(72677);t.exports=function(t,e,i,r){var n;if(void 0===r&&(r=t),!Array.isArray(e))return-1!==(n=t.indexOf(e))?(s(t,n),i&&i.call(r,e),e):null;for(var a=e.length-1,o=[];a>=0;){var h=e[a];-1!==(n=t.indexOf(h))&&(s(t,n),o.push(h),i&&i.call(r,h)),a--}return o}},8324:(t,e,i)=>{var s=i(72677);t.exports=function(t,e,i,r){if(void 0===r&&(r=t),e<0||e>t.length-1)throw new Error("Index out of bounds");var n=s(t,e);return i&&i.call(r,n),n}},47427:(t,e,i)=>{var s=i(45838);t.exports=function(t,e,i,r,n){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===n&&(n=t),s(t,e,i)){var a=i-e,o=t.splice(e,a);if(r)for(var h=0;h{var s=i(72677);t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var r=e+Math.floor(Math.random()*i);return s(t,r)}},80402:t=>{t.exports=function(t,e,i){var s=t.indexOf(e),r=t.indexOf(i);return-1!==s&&-1===r&&(t[s]=i,!0)}},77640:t=>{t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,s=0;s{t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,s=0;s{t.exports=function(t,e,i,s){var r=t.length;if(e<0||e>r||e>=i||i>r||e+i>r){if(s)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},27847:t=>{t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i>0&&(t.splice(i,1),t.unshift(e)),e}},6034:(t,e,i)=>{var s=i(45838);t.exports=function(t,e,i,r,n){if(void 0===r&&(r=0),void 0===n&&(n=t.length),s(t,r,n))for(var a=r;a{t.exports=function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(Math.random()*(e+1)),s=t[e];t[e]=t[i],t[i]=s}return t}},28834:t=>{t.exports=function(t){var e=/\D/g;return t.sort((function(t,i){return parseInt(t.replace(e,""),10)-parseInt(i.replace(e,""),10)})),t}},72677:t=>{t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,s=t[e],r=e;r{function e(t,e){return String(t).localeCompare(e)}function i(t,e,i,s){var r,n,a,o,h,l=t.length,u=0,c=2*i;for(r=0;rl&&(n=l),a>l&&(a=l),o=r,h=n;;)if(o{t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),r=t.indexOf(i);if(s<0||r<0)throw new Error("Supplied items must be elements of the same array");return t[s]=i,t[r]=e,t}},59959:(t,e,i)=>{t.exports={Matrix:i(13515),Add:i(78991),AddAt:i(48522),BringToTop:i(58742),CountAllMatching:i(30164),Each:i(36337),EachInRange:i(46208),FindClosestInSorted:i(2406),GetAll:i(71608),GetFirst:i(51463),GetRandom:i(72861),MoveDown:i(51172),MoveTo:i(68396),MoveUp:i(27555),MoveAbove:i(24218),MoveBelow:i(58258),NumberArray:i(13401),NumberArrayStep:i(89955),QuickSelect:i(53466),Range:i(75757),Remove:i(66458),RemoveAt:i(8324),RemoveBetween:i(47427),RemoveRandomElement:i(50147),Replace:i(80402),RotateLeft:i(77640),RotateRight:i(38487),SafeRange:i(45838),SendToBack:i(27847),SetAll:i(6034),Shuffle:i(18592),SortByDigits:i(28834),SpliceOne:i(72677),StableSort:i(17922),Swap:i(96928)}},97494:t=>{t.exports=function(t){if(!Array.isArray(t)||!Array.isArray(t[0]))return!1;for(var e=t[0].length,i=1;i{var s=i(76400),r=i(97494);t.exports=function(t){var e="";if(!r(t))return e;for(var i=0;i{t.exports=function(t){return t.reverse()}},51995:t=>{t.exports=function(t){for(var e=0;e{var s=i(63515);t.exports=function(t){return s(t,180)}},42549:(t,e,i)=>{var s=i(63515);t.exports=function(t){return s(t,90)}},63515:(t,e,i)=>{var s=i(97494),r=i(78581);t.exports=function(t,e){if(void 0===e&&(e=90),!s(t))return null;if("string"!=typeof e&&(e=(e%360+360)%360),90===e||-270===e||"rotateLeft"===e)(t=r(t)).reverse();else if(-90===e||270===e||"rotateRight"===e)t.reverse(),t=r(t);else if(180===Math.abs(e)||"rotate180"===e){for(var i=0;i{var s=i(63515);t.exports=function(t){return s(t,-90)}},27365:(t,e,i)=>{var s=i(77640),r=i(38487);t.exports=function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),0!==i&&(i<0?s(t,Math.abs(i)):r(t,i)),0!==e)for(var n=0;n{t.exports=function(t){for(var e=t.length,i=t[0].length,s=new Array(i),r=0;r-1;n--)s[r][n]=t[n][r]}return s}},13515:(t,e,i)=>{t.exports={CheckMatrix:i(97494),MatrixToString:i(68428),ReverseColumns:i(59521),ReverseRows:i(51995),Rotate180:i(89011),RotateLeft:i(42549),RotateMatrix:i(63515),RotateRight:i(14305),Translate:i(27365),TransposeMatrix:i(78581)}},40581:t=>{var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";t.exports=function(t,i){for(var s=new Uint8Array(t),r=s.length,n=i?"data:"+i+";base64,":"",a=0;a>2],n+=e[(3&s[a])<<4|s[a+1]>>4],n+=e[(15&s[a+1])<<2|s[a+2]>>6],n+=e[63&s[a+2]];return r%3==2?n=n.substring(0,n.length-1)+"=":r%3==1&&(n=n.substring(0,n.length-2)+"=="),n}},82329:t=>{for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(256),s=0;s>4,u[h++]=(15&s)<<4|r>>2,u[h++]=(3&r)<<6|63&n;return l}},78417:(t,e,i)=>{t.exports={ArrayBufferToBase64:i(40581),Base64ToArrayBuffer:i(82329)}},22178:(t,e,i)=>{t.exports={Array:i(59959),Base64:i(78417),Objects:i(64615),String:i(50379),NOOP:i(72283)}},32742:t=>{t.exports=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i]=t[i].slice(0):e[i]=t[i];return e}},28699:t=>{var e=function(t){var i,s,r;if("object"!=typeof t||null===t)return t;for(r in i=Array.isArray(t)?[]:{},t)s=t[r],i[r]=e(s);return i};t.exports=e},98611:(t,e,i)=>{var s=i(42911),r=function(){var t,e,i,n,a,o,h=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof h&&(c=h,h=arguments[1]||{},l=2),u===l&&(h=this,--l);l{var s=i(5923),r=i(10850);t.exports=function(t,e,i){var n=r(t,e,null);if(null===n)return i;if(Array.isArray(n))return s.RND.pick(n);if("object"==typeof n){if(n.hasOwnProperty("randInt"))return s.RND.integerInRange(n.randInt[0],n.randInt[1]);if(n.hasOwnProperty("randFloat"))return s.RND.realInRange(n.randFloat[0],n.randFloat[1])}else if("function"==typeof n)return n(e);return n}},72632:t=>{t.exports=function(t,e,i){var s=typeof t;return t&&"number"!==s&&"string"!==s&&t.hasOwnProperty(e)&&void 0!==t[e]?t[e]:i}},94324:(t,e,i)=>{var s=i(10850),r=i(82897);t.exports=function(t,e,i,n,a){void 0===a&&(a=i);var o=s(t,e,a);return r(o,i,n)}},10850:t=>{t.exports=function(t,e,i){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return t[e];if(-1!==e.indexOf(".")){for(var s=e.split("."),r=t,n=i,a=0;a{t.exports=function(t,e){for(var i=0;i{t.exports=function(t,e){for(var i=0;i{t.exports=function(t,e){return t.hasOwnProperty(e)}},42911:t=>{t.exports=function(t){if("object"!=typeof t||t.nodeType||t===t.window)return!1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0}},30657:(t,e,i)=>{var s=i(32742);t.exports=function(t,e){var i=s(t);for(var r in e)i.hasOwnProperty(r)||(i[r]=e[r]);return i}},72066:(t,e,i)=>{var s=i(32742);t.exports=function(t,e){var i=s(t);for(var r in e)i.hasOwnProperty(r)&&(i[r]=e[r]);return i}},28820:(t,e,i)=>{var s=i(19256);t.exports=function(t,e){for(var i={},r=0;r{t.exports=function(t,e,i){if(!t||"number"==typeof t)return!1;if(t.hasOwnProperty(e))return t[e]=i,!0;if(-1!==e.indexOf(".")){for(var s=e.split("."),r=t,n=t,a=0;a{t.exports={Clone:i(32742),DeepCopy:i(28699),Extend:i(98611),GetAdvancedValue:i(20494),GetFastValue:i(72632),GetMinMaxValue:i(94324),GetValue:i(10850),HasAll:i(87701),HasAny:i(53523),HasValue:i(19256),IsPlainObject:i(42911),Merge:i(30657),MergeRight:i(72066),Pick:i(28820),SetValue:i(22440)}},69429:t=>{t.exports=function(t,e){return t.replace(/%([0-9]+)/g,(function(t,i){return e[Number(i)-1]}))}},76400:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=0),void 0===i&&(i=" "),void 0===s&&(s=3);var r=0;if(e+1>=(t=t.toString()).length)switch(s){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var n=Math.ceil((r=e-t.length)/2);t=new Array(r-n+1).join(i)+t+new Array(n+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},76872:t=>{t.exports=function(t,e){return 0===e?t.slice(1):t.slice(0,e-1)+t.slice(e)}},8051:t=>{t.exports=function(t){return t.split("").reverse().join("")}},76583:t=>{t.exports=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))}},40587:t=>{t.exports=function(t){return t&&t[0].toUpperCase()+t.slice(1)}},50379:(t,e,i)=>{t.exports={Format:i(69429),Pad:i(76400),RemoveAt:i(76872),Reverse:i(8051),UppercaseFirst:i(40587),UUID:i(76583)}}},e={};function i(s){var r=e[s];if(void 0!==r)return r.exports;var n=e[s]={exports:{}};return t[s](n,n.exports,i),n.exports}return i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i(85780)})()})); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Phaser",[],e):"object"==typeof exports?exports.Phaser=e():t.Phaser=e()}(this,(()=>(()=>{var t={6659:t=>{"use strict";var e=Object.prototype.hasOwnProperty,i="~";function s(){}function n(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function r(t,e,s,r,a){if("function"!=typeof s)throw new TypeError("The listener must be a function");var o=new n(s,r||t,a),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],o]:t._events[h].push(o):(t._events[h]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new s:delete t._events[e]}function o(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,s,n=[];if(0===this._eventsCount)return n;for(s in t=this._events)e.call(t,s)&&n.push(i?s.slice(1):s);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},o.prototype.listeners=function(t){var e=i?i+t:t,s=this._events[e];if(!s)return[];if(s.fn)return[s.fn];for(var n=0,r=s.length,a=new Array(r);n{var s=i(82590);t.exports=function(t,e,i,n){for(var r=t[0],a=1;a{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"angle",e,i,n,r)}},22015:t=>{t.exports=function(t,e,i){for(var s=0;s{t.exports=function(t,e,i){void 0===i&&(i=0);for(var s=i;s{t.exports=function(t,e,i){void 0===i&&(i=0);for(var s=i;s{var s=i(40327),n=i(84093),r=i(72632),a=i(72283),o=new(i(71030))({sys:{queueDepthSort:a,events:{once:a}}},0,0,1,1);t.exports=function(t,e){void 0===e&&(e={});var i=e.hasOwnProperty("width"),a=e.hasOwnProperty("height"),h=r(e,"width",-1),l=r(e,"height",-1),u=r(e,"cellWidth",1),c=r(e,"cellHeight",u),d=r(e,"position",n.TOP_LEFT),f=r(e,"x",0),p=r(e,"y",0),v=0,g=0,m=h*u,y=l*c;o.setPosition(f,p),o.setSize(u,c);for(var x=0;x{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"alpha",e,i,n,r)}},3877:(t,e,i)=>{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"x",e,i,n,r)}},71020:(t,e,i)=>{var s=i(6124);t.exports=function(t,e,i,n,r,a,o){return null==i&&(i=e),s(t,"x",e,n,a,o),s(t,"y",i,r,a,o)}},28970:(t,e,i)=>{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"y",e,i,n,r)}},82249:t=>{t.exports=function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=6.28);for(var n=i,r=(s-i)/t.length,a=0;a{t.exports=function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=6.28);for(var n=i,r=(s-i)/t.length,a=e.width/2,o=e.height/2,h=0;h{var s=i(8570);t.exports=function(t,e){for(var i=s(e,t.length),n=0;n{var s=i(40053),n=i(77640),r=i(38487);t.exports=function(t,e,i){void 0===i&&(i=0);var a=s(e,!1,t.length);i>0?n(a,i):i<0&&r(a,Math.abs(i));for(var o=0;o{var s=i(58813);t.exports=function(t,e,i){var n=s({x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2},i),r=s({x1:e.x2,y1:e.y2,x2:e.x3,y2:e.y3},i),a=s({x1:e.x3,y1:e.y3,x2:e.x1,y2:e.y1},i);n.pop(),r.pop(),a.pop();for(var o=(n=n.concat(r,a)).length/t.length,h=0,l=0;l{t.exports=function(t,e,i){for(var s=0;s{t.exports=function(t,e,i,s,n,r){var a;void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=1);var o=0,h=t.length;if(1===r)for(a=n;a=0;a--)t[a][e]+=i+o*s,o++;return t}},23646:t=>{t.exports=function(t,e,i,s,n,r){var a;void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=1);var o=0,h=t.length;if(1===r)for(a=n;a=0;a--)t[a][e]=i+o*s,o++;return t}},4392:(t,e,i)=>{var s=i(30977);t.exports=function(t,e){for(var i=0;i{var s=i(72006);t.exports=function(t,e){for(var i=0;i{var s=i(74077);t.exports=function(t,e){for(var i=0;i{var s=i(30001);t.exports=function(t,e){for(var i=0;i{var s=i(99761);t.exports=function(t,e){for(var i=0;i{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"rotation",e,i,n,r)}},87299:(t,e,i)=>{var s=i(72395),n=i(53996);t.exports=function(t,e,i){for(var r=e.x,a=e.y,o=0;o{var s=i(72395);t.exports=function(t,e,i,n){var r=e.x,a=e.y;if(0===n)return t;for(var o=0;o{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"scaleX",e,i,n,r)}},51449:(t,e,i)=>{var s=i(6124);t.exports=function(t,e,i,n,r,a,o){return null==i&&(i=e),s(t,"scaleX",e,n,a,o),s(t,"scaleY",i,r,a,o)}},64895:(t,e,i)=>{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"scaleY",e,i,n,r)}},30329:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"alpha",e,i,n,r)}},43954:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n){return s(t,"blendMode",e,0,i,n)}},70688:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"depth",e,i,n,r)}},8314:t=>{t.exports=function(t,e,i){for(var s=0;s{var s=i(23646);t.exports=function(t,e,i,n,r,a,o){return null==i&&(i=e),s(t,"originX",e,n,a,o),s(t,"originY",i,r,a,o),t.forEach((function(t){t.updateDisplayOrigin()})),t}},38767:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"rotation",e,i,n,r)}},18584:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r,a,o){return null==i&&(i=e),s(t,"scaleX",e,n,a,o),s(t,"scaleY",i,r,a,o)}},17381:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"scaleX",e,i,n,r)}},74370:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"scaleY",e,i,n,r)}},27773:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r,a,o){return null==i&&(i=e),s(t,"scrollFactorX",e,n,a,o),s(t,"scrollFactorY",i,r,a,o)}},75257:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"scrollFactorX",e,i,n,r)}},54512:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"scrollFactorY",e,i,n,r)}},69423:t=>{t.exports=function(t,e,i,s,n){for(var r=0;r{var s=i(23646);t.exports=function(t,e,i,n){return s(t,"visible",e,0,i,n)}},94833:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"x",e,i,n,r)}},14284:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r,a,o){return null==i&&(i=e),s(t,"x",e,n,a,o),s(t,"y",i,r,a,o)}},96574:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"y",e,i,n,r)}},74086:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r){var a,o,h,l,u,c;if(void 0===n&&(n=0),void 0===r&&(r=new s),t.length>1)if(0===n){var d=t.length-1;for(a=t[d].x,o=t[d].y,h=d-1;h>=0;h--)l=(c=t[h]).x,u=c.y,c.x=a,c.y=o,a=l,o=u;t[d].x=e,t[d].y=i}else{for(a=t[0].x,o=t[0].y,h=1;h{var s=i(18592);t.exports=function(t){return s(t)}},1558:(t,e,i)=>{var s=i(5514);t.exports=function(t,e,i,n,r){void 0===r&&(r=!1);var a,o=Math.abs(n-i)/t.length;if(r)for(a=0;a{var s=i(87736);t.exports=function(t,e,i,n,r){void 0===r&&(r=!1);var a,o=Math.abs(n-i)/t.length;if(r)for(a=0;a{t.exports=function(t,e,i,s,n){void 0===n&&(n=!1);var r,a=Math.abs(s-i)/t.length;if(n)for(r=0;r{t.exports=function(t){for(var e=0;e{var s=i(1071);t.exports=function(t,e,i){void 0===i&&(i=0);for(var n=0;n{t.exports={AlignTo:i(62270),Angle:i(61148),Call:i(22015),GetFirst:i(31060),GetLast:i(52367),GridAlign:i(12673),IncAlpha:i(691),IncX:i(3877),IncXY:i(71020),IncY:i(28970),PlaceOnCircle:i(82249),PlaceOnEllipse:i(30285),PlaceOnLine:i(61557),PlaceOnRectangle:i(63549),PlaceOnTriangle:i(51629),PlayAnimation:i(1045),PropertyValueInc:i(6124),PropertyValueSet:i(23646),RandomCircle:i(4392),RandomEllipse:i(94985),RandomLine:i(63305),RandomRectangle:i(90739),RandomTriangle:i(91417),Rotate:i(26182),RotateAround:i(87299),RotateAroundDistance:i(92194),ScaleX:i(30363),ScaleXY:i(51449),ScaleY:i(64895),SetAlpha:i(30329),SetBlendMode:i(43954),SetDepth:i(70688),SetHitArea:i(8314),SetOrigin:i(12894),SetRotation:i(38767),SetScale:i(18584),SetScaleX:i(17381),SetScaleY:i(74370),SetScrollFactor:i(27773),SetScrollFactorX:i(75257),SetScrollFactorY:i(54512),SetTint:i(69423),SetVisible:i(58291),SetX:i(94833),SetXY:i(14284),SetY:i(96574),ShiftPosition:i(74086),Shuffle:i(86347),SmootherStep:i(9938),SmoothStep:i(1558),Spread:i(71060),ToggleVisible:i(11207),WrapInRectangle:i(24404)}},85463:(t,e,i)=>{var s=i(82897),n=i(56694),r=i(16938),a=i(2406),o=i(71519),h=i(10850),l=i(28834),u=new n({initialize:function(t,e,i){this.manager=t,this.key=e,this.type="frame",this.frames=this.getFrames(t.textureManager,h(i,"frames",[]),h(i,"defaultTextureKey",null),h(i,"sortFrames",!0)),this.frameRate=h(i,"frameRate",null),this.duration=h(i,"duration",null),this.msPerFrame,this.skipMissedFrames=h(i,"skipMissedFrames",!0),this.delay=h(i,"delay",0),this.repeat=h(i,"repeat",0),this.repeatDelay=h(i,"repeatDelay",0),this.yoyo=h(i,"yoyo",!1),this.showOnStart=h(i,"showOnStart",!1),this.hideOnComplete=h(i,"hideOnComplete",!1),this.paused=!1,this.calculateDuration(this,this.getTotalFrames(),this.duration,this.frameRate),this.manager.on&&(this.manager.on(r.PAUSE_ALL,this.pause,this),this.manager.on(r.RESUME_ALL,this.resume,this))},getTotalFrames:function(){return this.frames.length},calculateDuration:function(t,e,i,s){null===i&&null===s?(t.frameRate=24,t.duration=24/e*1e3):i&&null===s?(t.duration=i,t.frameRate=e/(i/1e3)):(t.frameRate=s,t.duration=e/s*1e3),t.msPerFrame=1e3/t.frameRate},addFrame:function(t){return this.addFrameAt(this.frames.length,t)},addFrameAt:function(t,e){var i=this.getFrames(this.manager.textureManager,e);if(i.length>0){if(0===t)this.frames=i.concat(this.frames);else if(t===this.frames.length)this.frames=this.frames.concat(i);else{var s=this.frames.slice(0,t),n=this.frames.slice(t);this.frames=s.concat(i,n)}this.updateFrameSequence()}return this},checkFrame:function(t){return t>=0&&t0){r.isLast=!0,r.nextFrame=c[0],c[0].prevFrame=r;var y=1/(c.length-1);for(a=0;a0?t.inReverse&&t.forward?t.forward=!1:this.repeatAnimation(t):t.complete():this.updateAndGetNextTick(t,e.nextFrame)},handleYoyoFrame:function(t,e){if(e||(e=!1),t.inReverse===!e&&t.repeatCounter>0)return(0===t.repeatDelay||t.pendingRepeat)&&(t.forward=e),void this.repeatAnimation(t);if(t.inReverse===e||0!==t.repeatCounter){t.forward=e;var i=e?t.currentFrame.nextFrame:t.currentFrame.prevFrame;this.updateAndGetNextTick(t,i)}else t.complete()},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t.yoyo?this.handleYoyoFrame(t,!0):t.repeatCounter>0?(t.inReverse&&!t.forward||(t.forward=!0),this.repeatAnimation(t)):t.complete():this.updateAndGetNextTick(t,e.prevFrame)},updateAndGetNextTick:function(t,e){t.setCurrentFrame(e),this.getNextTick(t)},removeFrame:function(t){var e=this.frames.indexOf(t);return-1!==e&&this.removeFrameAt(e),this},removeFrameAt:function(t){return this.frames.splice(t,1),this.updateFrameSequence(),this},repeatAnimation:function(t){if(2===t._pendingStop){if(0===t._pendingStopValue)return t.stop();t._pendingStopValue--}t.repeatDelay>0&&!t.pendingRepeat?(t.pendingRepeat=!0,t.accumulator-=t.nextTick,t.nextTick+=t.repeatDelay):(t.repeatCounter--,t.forward?t.setCurrentFrame(t.currentFrame.nextFrame):t.setCurrentFrame(t.currentFrame.prevFrame),t.isPlaying&&(this.getNextTick(t),t.handleRepeat()))},toJSON:function(){var t={key:this.key,type:this.type,frames:[],frameRate:this.frameRate,duration:this.duration,skipMissedFrames:this.skipMissedFrames,delay:this.delay,repeat:this.repeat,repeatDelay:this.repeatDelay,yoyo:this.yoyo,showOnStart:this.showOnStart,hideOnComplete:this.hideOnComplete};return this.frames.forEach((function(e){t.frames.push(e.toJSON())})),t},updateFrameSequence:function(){for(var t,e=this.frames.length,i=1/(e-1),s=0;s1?(t.isLast=!0,t.prevFrame=this.frames[e-2],t.nextFrame=this.frames[0]):e>1&&(t.prevFrame=this.frames[s-1],t.nextFrame=this.frames[s+1]);return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.manager.off&&(this.manager.off(r.PAUSE_ALL,this.pause,this),this.manager.off(r.RESUME_ALL,this.resume,this)),this.manager.remove(this.key);for(var t=0;t{var s=new(i(56694))({initialize:function(t,e,i,s,n){void 0===n&&(n=!1),this.textureKey=t,this.textureFrame=e,this.index=i,this.frame=s,this.isFirst=!1,this.isLast=!1,this.prevFrame=null,this.nextFrame=null,this.duration=0,this.progress=0,this.isKeyFrame=n},toJSON:function(){return{key:this.textureKey,frame:this.textureFrame,duration:this.duration,keyframe:this.isKeyFrame}},destroy:function(){this.frame=void 0}});t.exports=s},90249:(t,e,i)=>{var s=i(85463),n=i(56694),r=i(33885),a=i(6659),o=i(16938),h=i(97081),l=i(72632),u=i(10850),c=i(76400),d=i(13401),f=new n({Extends:a,initialize:function(t){a.call(this),this.game=t,this.textureManager=null,this.globalTimeScale=1,this.anims=new r,this.mixes=new r,this.paused=!1,this.name="AnimationManager",t.events.once(h.BOOT,this.boot,this)},boot:function(){this.textureManager=this.game.textures,this.game.events.once(h.DESTROY,this.destroy,this)},addMix:function(t,e,i){var s=this.anims,n=this.mixes,r="string"==typeof t?t:t.key,a="string"==typeof e?e:e.key;if(s.has(r)&&s.has(a)){var o=n.get(r);o||(o={}),o[a]=i,n.set(r,o)}return this},removeMix:function(t,e){var i=this.mixes,s="string"==typeof t?t:t.key,n=i.get(s);if(n)if(e){var r="string"==typeof e?e:e.key;n.hasOwnProperty(r)&&delete n[r]}else e||i.delete(s);return this},getMix:function(t,e){var i=this.mixes,s="string"==typeof t?t:t.key,n="string"==typeof e?e:e.key,r=i.get(s);return r&&r.hasOwnProperty(n)?r[n]:0},add:function(t,e){return this.anims.has(t)?(console.warn("Animation key exists: "+t),this):(e.key=t,this.anims.set(t,e),this.emit(o.ADD_ANIMATION,t,e),this)},exists:function(t){return this.anims.has(t)},createFromAseprite:function(t,e,i){var s=[],n=this.game.cache.json.get(t);if(!n)return s;var r=this,a=u(n,"meta",null),o=u(n,"frames",null);a&&o&&u(a,"frameTags",[]).forEach((function(n){var a=[],h=l(n,"name",null),u=l(n,"from",0),c=l(n,"to",0),d=l(n,"direction","forward");if(h&&(!e||e&&e.indexOf(h)>-1)){for(var f=0,p=u;p<=c;p++){var v=p.toString(),g=o[v];if(g){var m=l(g,"duration",Number.MAX_SAFE_INTEGER);a.push({key:t,frame:v,duration:m}),f+=m}}var y=f/a.length;a.forEach((function(t){t.duration-=y})),"reverse"===d&&(a=a.reverse());var x,T={key:h,frames:a,duration:f,yoyo:"pingpong"===d};i?i.anims&&(x=i.anims.create(T)):x=r.create(T),x&&s.push(x)}}));return s},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))||(i=new s(this,e,t),this.anims.set(e,i),this.emit(o.ADD_ANIMATION,e,i))),i},fromJSON:function(t,e){void 0===e&&(e=!1),e&&this.anims.clear(),"string"==typeof t&&(t=JSON.parse(t));var i=[];if(t.hasOwnProperty("anims")&&Array.isArray(t.anims)){for(var s=0;s{var s=i(56694),n=i(33885),r=i(72632),a=i(16938),o=i(85463),h=new s({initialize:function(t){this.parent=t,this.animationManager=t.scene.sys.anims,this.animationManager.on(a.REMOVE_ANIMATION,this.globalRemove,this),this.textureManager=this.animationManager.textureManager,this.anims=null,this.isPlaying=!1,this.hasStarted=!1,this.currentAnim=null,this.currentFrame=null,this.nextAnim=null,this.nextAnimsQueue=[],this.timeScale=1,this.frameRate=0,this.duration=0,this.msPerFrame=0,this.skipMissedFrames=!0,this.delay=0,this.repeat=0,this.repeatDelay=0,this.yoyo=!1,this.showOnStart=!1,this.hideOnComplete=!1,this.forward=!0,this.inReverse=!1,this.accumulator=0,this.nextTick=0,this.delayCounter=0,this.repeatCounter=0,this.pendingRepeat=!1,this._paused=!1,this._wasPlaying=!1,this._pendingStop=0,this._pendingStopValue},chain:function(t){var e=this.parent;if(void 0===t)return this.nextAnimsQueue.length=0,this.nextAnim=null,e;Array.isArray(t)||(t=[t]);for(var i=0;is.getTotalFrames()&&(h=0);var l=s.frames[h];0!==h||this.forward||(l=s.getLastFrame()),this.currentFrame=l}else console.warn("Missing animation: "+i);return this.parent},pause:function(t){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),void 0!==t&&this.setCurrentFrame(t),this.parent},resume:function(t){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),void 0!==t&&this.setCurrentFrame(t),this.parent},playAfterDelay:function(t,e){if(this.isPlaying){var i=this.nextAnim,s=this.nextAnimsQueue;i&&s.unshift(i),this.nextAnim=t,this._pendingStop=1,this._pendingStopValue=e}else this.delayCounter=e,this.play(t,!0);return this.parent},playAfterRepeat:function(t,e){if(void 0===e&&(e=1),this.isPlaying){var i=this.nextAnim,s=this.nextAnimsQueue;i&&s.unshift(i),-1!==this.repeatCounter&&e>this.repeatCounter&&(e=this.repeatCounter),this.nextAnim=t,this._pendingStop=2,this._pendingStopValue=e}else this.play(t);return this.parent},play:function(t,e){void 0===e&&(e=!1);var i=this.currentAnim,s=this.parent,n="string"==typeof t?t:t.key;if(e&&this.isPlaying&&i.key===n)return s;if(i&&this.isPlaying){var r=this.animationManager.getMix(i.key,t);if(r>0)return this.playAfterDelay(t,r)}return this.forward=!0,this.inReverse=!1,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t)},playReverse:function(t,e){void 0===e&&(e=!1);var i="string"==typeof t?t:t.key;return e&&this.isPlaying&&this.currentAnim.key===i?this.parent:(this.forward=!1,this.inReverse=!0,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t))},startAnimation:function(t){this.load(t);var e=this.currentAnim,i=this.parent;return e?(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat,e.getFirstTick(this),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!1,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.delayCounter+=this.delay,0===this.delayCounter&&this.handleStart(),i):i},handleStart:function(){this.showOnStart&&this.parent.setVisible(!0),this.setCurrentFrame(this.currentFrame),this.hasStarted=!0,this.emitEvents(a.ANIMATION_START)},handleRepeat:function(){this.pendingRepeat=!1,this.emitEvents(a.ANIMATION_REPEAT)},handleStop:function(){this._pendingStop=0,this.isPlaying=!1,this.emitEvents(a.ANIMATION_STOP)},handleComplete:function(){this._pendingStop=0,this.isPlaying=!1,this.hideOnComplete&&this.parent.setVisible(!1),this.emitEvents(a.ANIMATION_COMPLETE,a.ANIMATION_COMPLETE_KEY)},emitEvents:function(t,e){var i=this.currentAnim,s=this.currentFrame,n=this.parent,r=s.textureFrame;n.emit(t,i,s,n,r),e&&n.emit(e+i.key,i,s,n,r)},reverse:function(){return this.isPlaying&&(this.inReverse=!this.inReverse,this.forward=!this.forward),this.parent},getProgress:function(){var t=this.currentFrame;if(!t)return 0;var e=t.progress;return this.inReverse&&(e*=-1),e},setProgress:function(t){return this.forward||(t=1-t),this.setCurrentFrame(this.currentAnim.getFrameByProgress(t)),this.parent},setRepeat:function(t){return this.repeatCounter=-1===t?Number.MAX_VALUE:t,this.parent},globalRemove:function(t,e){void 0===e&&(e=this.currentAnim),this.isPlaying&&e.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},restart:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);var i=this.currentAnim,s=this.parent;return i?(e&&(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat),i.getFirstTick(this),this.emitEvents(a.ANIMATION_RESTART),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!t,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.setCurrentFrame(i.frames[0]),this.parent):s},complete:function(){if(this._pendingStop=0,this.isPlaying=!1,this.currentAnim&&this.handleComplete(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.length>0?this.nextAnimsQueue.shift():null,this.play(t)}return this.parent},stop:function(){if(this._pendingStop=0,this.isPlaying=!1,this.currentAnim&&this.handleStop(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.shift(),this.play(t)}return this.parent},stopAfterDelay:function(t){return this._pendingStop=1,this._pendingStopValue=t,this.parent},stopAfterRepeat:function(t){return void 0===t&&(t=1),-1!==this.repeatCounter&&t>this.repeatCounter&&(t=this.repeatCounter),this._pendingStop=2,this._pendingStopValue=t,this.parent},stopOnFrame:function(t){return this._pendingStop=3,this._pendingStopValue=t,this.parent},getTotalFrames:function(){return this.currentAnim?this.currentAnim.getTotalFrames():0},update:function(t,e){var i=this.currentAnim;if(this.isPlaying&&i&&!i.paused){if(this.accumulator+=e*this.timeScale,1===this._pendingStop&&(this._pendingStopValue-=e,this._pendingStopValue<=0))return this.stop();if(this.hasStarted){if(this.accumulator>=this.nextTick&&(this.forward?i.nextFrame(this):i.previousFrame(this),this.isPlaying&&0===this._pendingStop&&this.skipMissedFrames&&this.accumulator>this.nextTick)){var s=0;do{this.forward?i.nextFrame(this):i.previousFrame(this),s++}while(this.isPlaying&&this.accumulator>this.nextTick&&s<60)}}else this.accumulator>=this.delayCounter&&(this.accumulator-=this.delayCounter,this.handleStart())}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),t.setAlpha&&(e.alpha=t.alpha),e.setSizeToFrame(),e._originComponent&&(t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin()),this.isPlaying&&this.hasStarted&&(this.emitEvents(a.ANIMATION_UPDATE),3===this._pendingStop&&this._pendingStopValue===t&&this.stop()),e},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},get:function(t){return this.anims?this.anims.get(t):null},exists:function(t){return!!this.anims&&this.anims.has(t)},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))||(i=new o(this,e,t),this.anims||(this.anims=new n),this.anims.set(e,i))),i},createFromAseprite:function(t,e){return this.animationManager.createFromAseprite(t,e,this.parent)},generateFrameNames:function(t,e){return this.animationManager.generateFrameNames(t,e)},generateFrameNumbers:function(t,e){return this.animationManager.generateFrameNumbers(t,e)},remove:function(t){var e=this.get(t);return e&&(this.currentAnim===e&&this.stop(),this.anims.delete(t)),e},destroy:function(){this.animationManager.off(a.REMOVE_ANIMATION,this.globalRemove,this),this.anims&&this.anims.clear(),this.animationManager=null,this.parent=null,this.nextAnim=null,this.nextAnimsQueue.length=0,this.currentAnim=null,this.currentFrame=null},isPaused:{get:function(){return this._paused}}});t.exports=h},44509:t=>{t.exports="add"},84563:t=>{t.exports="animationcomplete"},61586:t=>{t.exports="animationcomplete-"},72175:t=>{t.exports="animationrepeat"},568:t=>{t.exports="animationrestart"},37690:t=>{t.exports="animationstart"},58525:t=>{t.exports="animationstop"},5243:t=>{t.exports="animationupdate"},10598:t=>{t.exports="pauseall"},4860:t=>{t.exports="remove"},31865:t=>{t.exports="resumeall"},16938:(t,e,i)=>{t.exports={ADD_ANIMATION:i(44509),ANIMATION_COMPLETE:i(84563),ANIMATION_COMPLETE_KEY:i(61586),ANIMATION_REPEAT:i(72175),ANIMATION_RESTART:i(568),ANIMATION_START:i(37690),ANIMATION_STOP:i(58525),ANIMATION_UPDATE:i(5243),PAUSE_ALL:i(10598),REMOVE_ANIMATION:i(4860),RESUME_ALL:i(31865)}},13517:(t,e,i)=>{t.exports={Animation:i(85463),AnimationFrame:i(71519),AnimationManager:i(90249),AnimationState:i(16569),Events:i(16938)}},23740:(t,e,i)=>{var s=i(56694),n=i(33885),r=i(6659),a=i(69773),o=new s({initialize:function(){this.entries=new n,this.events=new r},add:function(t,e){return this.entries.set(t,e),this.events.emit(a.ADD,this,t,e),this},has:function(t){return this.entries.has(t)},exists:function(t){return this.entries.has(t)},get:function(t){return this.entries.get(t)},remove:function(t){var e=this.get(t);return e&&(this.entries.delete(t),this.events.emit(a.REMOVE,this,t,e.data)),this},getKeys:function(){return this.entries.keys()},destroy:function(){this.entries.clear(),this.events.removeAllListeners(),this.entries=null,this.events=null}});t.exports=o},43474:(t,e,i)=>{var s=i(23740),n=i(56694),r=i(97081),a=new n({initialize:function(t){this.game=t,this.binary=new s,this.bitmapFont=new s,this.json=new s,this.physics=new s,this.shader=new s,this.audio=new s,this.video=new s,this.text=new s,this.html=new s,this.obj=new s,this.tilemap=new s,this.xml=new s,this.custom={},this.game.events.once(r.DESTROY,this.destroy,this)},addCustom:function(t){return this.custom.hasOwnProperty(t)||(this.custom[t]=new s),this.custom[t]},destroy:function(){for(var t=["binary","bitmapFont","json","physics","shader","audio","video","text","html","obj","tilemap","xml"],e=0;e{t.exports="add"},75968:t=>{t.exports="remove"},69773:(t,e,i)=>{t.exports={ADD:i(94762),REMOVE:i(75968)}},45820:(t,e,i)=>{t.exports={BaseCache:i(23740),CacheManager:i(43474),Events:i(69773)}},51052:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(75606),a=i(6659),o=i(89787),h=i(74118),l=i(69360),u=i(93222),c=i(93736),d=new s({Extends:a,Mixins:[n.Alpha,n.Visible],initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),a.call(this),this.scene,this.sceneManager,this.scaleManager,this.cameraManager,this.id=0,this.name="",this.roundPixels=!1,this.useBounds=!1,this.worldView=new h,this.dirty=!0,this._x=t,this._y=e,this._width=i,this._height=s,this._bounds=new h,this._scrollX=0,this._scrollY=0,this._zoomX=1,this._zoomY=1,this._rotation=0,this.matrix=new l,this.transparent=!0,this.backgroundColor=u("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new c(i/2,s/2),this.originX=.5,this.originY=.5,this._customViewport=!1,this.mask=null,this._maskCamera=null,this.renderList=[]},addToRenderList:function(t){this.renderList.push(t)},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this},getScroll:function(t,e,i){void 0===i&&(i=new c);var s=.5*this.width,n=.5*this.height;return i.x=t-s,i.y=e-n,this.useBounds&&(i.x=this.clampX(i.x),i.y=this.clampY(i.y)),i},centerOnX:function(t){var e=.5*this.width;return this.midPoint.x=t,this.scrollX=t-e,this.useBounds&&(this.scrollX=this.clampX(this.scrollX)),this},centerOnY:function(t){var e=.5*this.height;return this.midPoint.y=t,this.scrollY=t-e,this.useBounds&&(this.scrollY=this.clampY(this.scrollY)),this},centerOn:function(t,e){return this.centerOnX(t),this.centerOnY(e),this},centerToBounds:function(){if(this.useBounds){var t=this._bounds,e=.5*this.width,i=.5*this.height;this.midPoint.set(t.centerX,t.centerY),this.scrollX=t.centerX-e,this.scrollY=t.centerY-i}return this},centerToSize:function(){return this.scrollX=.5*this.width,this.scrollY=.5*this.height,this},cull:function(t){if(this.disableCull)return t;var e=this.matrix.matrix,i=e[0],s=e[1],n=e[2],r=e[3],a=i*r-s*n;if(!a)return t;var o=e[4],h=e[5],l=this.scrollX,u=this.scrollY,c=this.width,d=this.height,f=this.y,p=f+d,v=this.x,g=v+c,m=this.culledObjects,y=t.length;a=1/a,m.length=0;for(var x=0;xv&&S*i+b*n+of&&S*s+b*r+hn&&(t=n),t},clampY:function(t){var e=this._bounds,i=this.displayHeight,s=e.y+(i-this.height)/2,n=Math.max(s,s+e.height-i);return tn&&(t=n),t},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(t){return void 0===t&&(t=0),this.rotation=r(t),this},setBackgroundColor:function(t){return void 0===t&&(t="rgba(0,0,0,0)"),this.backgroundColor=u(t),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(t,e,i,s,n){return void 0===n&&(n=!1),this._bounds.setTo(t,e,i,s),this.dirty=!0,this.useBounds=!0,n?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},getBounds:function(t){void 0===t&&(t=new h);var e=this._bounds;return t.setTo(e.x,e.y,e.width,e.height),t},setName:function(t){return void 0===t&&(t=""),this.name=t,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setRoundPixels:function(t){return this.roundPixels=t,this},setScene:function(t){this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=t;var e=t.sys;return this.sceneManager=e.game.scene,this.scaleManager=e.scale,this.cameraManager=e.cameras,this.updateSystem(),this},setScroll:function(t,e){return void 0===e&&(e=t),this.scrollX=t,this.scrollY=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},setViewport:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setZoom:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),0===t&&(t=.001),0===e&&(e=.001),this.zoomX=t,this.zoomY=e,this},setMask:function(t,e){return void 0===e&&(e=!0),this.mask=t,this._maskCamera=e?this.cameraManager.default:this,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},toJSON:function(){var t={name:this.name,x:this.x,y:this.y,width:this.width,height:this.height,zoom:this.zoom,rotation:this.rotation,roundPixels:this.roundPixels,scrollX:this.scrollX,scrollY:this.scrollY,backgroundColor:this.backgroundColor.rgba};return this.useBounds&&(t.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),t},update:function(){},updateSystem:function(){if(this.scaleManager){var t=0!==this._x||0!==this._y||this.scaleManager.width!==this._width||this.scaleManager.height!==this._height,e=this.sceneManager;t&&!this._customViewport?e.customViewports++:!t&&this._customViewport&&e.customViewports--,this.dirty=!0,this._customViewport=t}},destroy:function(){this.emit(o.DESTROY,this),this.removeAllListeners(),this.matrix.destroy(),this.culledObjects=[],this._customViewport&&this.sceneManager.customViewports--,this.renderList=[],this._bounds=null,this.scene=null,this.scaleManager=null,this.sceneManager=null,this.cameraManager=null},x:{get:function(){return this._x},set:function(t){this._x=t,this.updateSystem()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.updateSystem()}},width:{get:function(){return this._width},set:function(t){this._width=t,this.updateSystem()}},height:{get:function(){return this._height},set:function(t){this._height=t,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(t){this._scrollX=t,this.dirty=!0}},scrollY:{get:function(){return this._scrollY},set:function(t){this._scrollY=t,this.dirty=!0}},zoom:{get:function(){return(this._zoomX+this._zoomY)/2},set:function(t){this._zoomX=t,this._zoomY=t,this.dirty=!0}},zoomX:{get:function(){return this._zoomX},set:function(t){this._zoomX=t,this.dirty=!0}},zoomY:{get:function(){return this._zoomY},set:function(t){this._zoomY=t,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this.dirty=!0}},centerX:{get:function(){return this.x+.5*this.width}},centerY:{get:function(){return this.y+.5*this.height}},displayWidth:{get:function(){return this.width/this.zoomX}},displayHeight:{get:function(){return this.height/this.zoomY}}});t.exports=d},47751:(t,e,i)=>{var s=i(51052),n=i(79993),r=i(82897),a=i(56694),o=i(64937),h=i(53030),l=i(89787),u=i(42798),c=i(74118),d=i(93736),f=new a({Extends:s,Mixins:[o.Pipeline],initialize:function(t,e,i,n){s.call(this,t,e,i,n),this.postPipelines=[],this.pipelineData={},this.inputEnabled=!0,this.fadeEffect=new h.Fade(this),this.flashEffect=new h.Flash(this),this.shakeEffect=new h.Shake(this),this.panEffect=new h.Pan(this),this.rotateToEffect=new h.RotateTo(this),this.zoomEffect=new h.Zoom(this),this.lerp=new d(1,1),this.followOffset=new d,this.deadzone=null,this._follow=null},setDeadzone:function(t,e){if(void 0===t)this.deadzone=null;else{if(this.deadzone?(this.deadzone.width=t,this.deadzone.height=e):this.deadzone=new c(0,0,t,e),this._follow){var i=this.width/2,s=this.height/2,r=this._follow.x-this.followOffset.x,a=this._follow.y-this.followOffset.y;this.midPoint.set(r,a),this.scrollX=r-i,this.scrollY=a-s}n(this.deadzone,this.midPoint.x,this.midPoint.y)}return this},fadeIn:function(t,e,i,s,n,r){return this.fadeEffect.start(!1,t,e,i,s,!0,n,r)},fadeOut:function(t,e,i,s,n,r){return this.fadeEffect.start(!0,t,e,i,s,!0,n,r)},fadeFrom:function(t,e,i,s,n,r,a){return this.fadeEffect.start(!1,t,e,i,s,n,r,a)},fade:function(t,e,i,s,n,r,a){return this.fadeEffect.start(!0,t,e,i,s,n,r,a)},flash:function(t,e,i,s,n,r,a){return this.flashEffect.start(t,e,i,s,n,r,a)},shake:function(t,e,i,s,n){return this.shakeEffect.start(t,e,i,s,n)},pan:function(t,e,i,s,n,r,a){return this.panEffect.start(t,e,i,s,n,r,a)},rotateTo:function(t,e,i,s,n,r,a){return this.rotateToEffect.start(t,e,i,s,n,r,a)},zoomTo:function(t,e,i,s,n,r){return this.zoomEffect.start(t,e,i,s,n,r)},preRender:function(){this.renderList.length=0;var t=this.width,e=this.height,i=.5*t,s=.5*e,r=this.zoom,a=this.matrix,o=t*this.originX,h=e*this.originY,c=this._follow,d=this.deadzone,f=this.scrollX,p=this.scrollY;d&&n(d,this.midPoint.x,this.midPoint.y);var v=!1;if(c&&!this.panEffect.isRunning){var g=c.x-this.followOffset.x,m=c.y-this.followOffset.y;d?(gd.right&&(f=u(f,f+(g-d.right),this.lerp.x)),md.bottom&&(p=u(p,p+(m-d.bottom),this.lerp.y))):(f=u(f,g-o,this.lerp.x),p=u(p,m-h,this.lerp.y)),v=!0}this.useBounds&&(f=this.clampX(f),p=this.clampY(p)),this.roundPixels&&(o=Math.round(o),h=Math.round(h),f=Math.round(f),p=Math.round(p)),this.scrollX=f,this.scrollY=p;var y=f+i,x=p+s;this.midPoint.set(y,x);var T=t/r,w=e/r,E=y-T/2,S=x-w/2;this.roundPixels&&(E=Math.round(E),S=Math.round(S)),this.worldView.setTo(E,S,T,w),a.applyITRS(this.x+o,this.y+h,this.rotation,r,r),a.translate(-o,-h),this.shakeEffect.preRender(),v&&this.emit(l.FOLLOW_UPDATE,this,c)},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,s,n,a){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===s&&(s=i),void 0===n&&(n=0),void 0===a&&(a=n),this._follow=t,this.roundPixels=e,i=r(i,0,1),s=r(s,0,1),this.lerp.set(i,s),this.followOffset.set(n,a);var o=this.width/2,h=this.height/2,l=t.x-n,u=t.y-a;return this.midPoint.set(l,u),this.scrollX=l-o,this.scrollY=u-h,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.rotateToEffect.reset(),this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.rotateToEffect.update(t,e),this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.resetFX(),s.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=f},62382:(t,e,i)=>{var s=i(47751),n=i(56694),r=i(72632),a=i(91963),o=i(94287),h=i(40444),l=i(7599),u=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.roundPixels=t.sys.game.config.roundPixels,this.cameras=[],this.main,this.default,t.sys.events.once(l.BOOT,this.boot,this),t.sys.events.on(l.START,this.start,this)},boot:function(){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0],this.default=new s(0,0,t.scale.width,t.scale.height).setScene(this.scene),t.game.scale.on(h.RESIZE,this.onResize,this),this.systems.events.once(l.DESTROY,this.destroy,this)},start:function(){if(!this.main){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0]}var e=this.systems.events;e.on(l.UPDATE,this.update,this),e.once(l.SHUTDOWN,this.shutdown,this)},add:function(t,e,i,n,r,a){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===n&&(n=this.scene.sys.scale.height),void 0===r&&(r=!1),void 0===a&&(a="");var o=new s(t,e,i,n);return o.setName(a),o.setScene(this.scene),o.setRoundPixels(this.roundPixels),o.id=this.getNextID(),this.cameras.push(o),r&&(this.main=o),o},addExisting:function(t,e){return void 0===e&&(e=!1),-1===this.cameras.indexOf(t)?(t.id=this.getNextID(),t.setRoundPixels(this.roundPixels),this.cameras.push(t),e&&(this.main=t),t):null},getNextID:function(){for(var t=this.cameras,e=1,i=0;i<32;i++){for(var s=!1,n=0;n0){r.preRender();var a=this.getVisibleChildren(e.getChildren(),r);t.render(i,a,r)}}},getVisibleChildren:function(t,e){for(var i=[],s=0;s{var s=i(82897),n=i(56694),r=i(89787),a=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.isComplete=!1,this.direction=!0,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n,a,o,h){if(void 0===t&&(t=!0),void 0===e&&(e=1e3),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=0),void 0===a&&(a=!1),void 0===o&&(o=null),void 0===h&&(h=this.camera.scene),!a&&this.isRunning)return this.camera;this.isRunning=!0,this.isComplete=!1,this.duration=e,this.direction=t,this.progress=0,this.red=i,this.green=s,this.blue=n,this.alpha=t?Number.MIN_VALUE:1,this._elapsed=0,this._onUpdate=o,this._onUpdateScope=h;var l=t?r.FADE_OUT_START:r.FADE_IN_START;return this.camera.emit(l,this.camera,this,e,i,s,n),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=s(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed{var s=i(82897),n=i(56694),r=i(89787),a=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=1,this.progress=0,this._elapsed=0,this._alpha,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n,a,o){return void 0===t&&(t=250),void 0===e&&(e=255),void 0===i&&(i=255),void 0===s&&(s=255),void 0===n&&(n=!1),void 0===a&&(a=null),void 0===o&&(o=this.camera.scene),!n&&this.isRunning||(this.isRunning=!0,this.duration=t,this.progress=0,this.red=e,this.green=i,this.blue=s,this._alpha=this.alpha,this._elapsed=0,this._onUpdate=a,this._onUpdateScope=o,this.camera.emit(r.FLASH_START,this.camera,this,t,e,i,s)),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=s(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed{var s=i(82897),n=i(56694),r=i(35060),a=i(89787),o=i(93736),h=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=new o,this.current=new o,this.destination=new o,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n,o,h){void 0===i&&(i=1e3),void 0===s&&(s=r.Linear),void 0===n&&(n=!1),void 0===o&&(o=null),void 0===h&&(h=this.camera.scene);var l=this.camera;return!n&&this.isRunning||(this.isRunning=!0,this.duration=i,this.progress=0,this.source.set(l.scrollX,l.scrollY),this.destination.set(t,e),l.getScroll(t,e,this.current),"string"==typeof s&&r.hasOwnProperty(s)?this.ease=r[s]:"function"==typeof s&&(this.ease=s),this._elapsed=0,this._onUpdate=o,this._onUpdateScope=h,this.camera.emit(a.PAN_START,this.camera,this,i,t,e)),l},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=s(this._elapsed/this.duration,0,1);this.progress=i;var n=this.camera;if(this._elapsed{var s=i(82897),n=i(56694),r=i(89787),a=i(35060),o=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=0,this.current=0,this.destination=0,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope,this.clockwise=!0,this.shortestPath=!1},start:function(t,e,i,s,n,o,h){void 0===i&&(i=1e3),void 0===s&&(s=a.Linear),void 0===n&&(n=!1),void 0===o&&(o=null),void 0===h&&(h=this.camera.scene),void 0===e&&(e=!1),this.shortestPath=e;var l=t;t<0?(l=-1*t,this.clockwise=!1):this.clockwise=!0;var u=360*Math.PI/180;l-=Math.floor(l/u)*u;var c=this.camera;if(!n&&this.isRunning)return c;if(this.isRunning=!0,this.duration=i,this.progress=0,this.source=c.rotation,this.destination=l,"string"==typeof s&&a.hasOwnProperty(s)?this.ease=a[s]:"function"==typeof s&&(this.ease=s),this._elapsed=0,this._onUpdate=o,this._onUpdateScope=h,this.shortestPath){var d=0,f=0;(d=this.destination>this.source?Math.abs(this.destination-this.source):Math.abs(this.destination+u)-this.source)<(f=this.source>this.destination?Math.abs(this.source-this.destination):Math.abs(this.source+u)-this.destination)?this.clockwise=!0:d>f&&(this.clockwise=!1)}return this.camera.emit(r.ROTATE_START,this.camera,this,i,l),c},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=s(this._elapsed/this.duration,0,1);this.progress=i;var n=this.camera;if(this._elapsed=l?Math.abs(h-l):Math.abs(h+o)-l;var u=0;u=this.clockwise?n.rotation+a*r:n.rotation-a*r,n.rotation=u,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,n,i,u)}else n.rotation=this.destination,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,n,i,this.destination),this.effectComplete()}},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(r.ROTATE_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null,this.source=null,this.destination=null}});t.exports=o},3241:(t,e,i)=>{var s=i(82897),n=i(56694),r=i(89787),a=i(93736),o=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.intensity=new a,this.progress=0,this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n){return void 0===t&&(t=100),void 0===e&&(e=.05),void 0===i&&(i=!1),void 0===s&&(s=null),void 0===n&&(n=this.camera.scene),!i&&this.isRunning||(this.isRunning=!0,this.duration=t,this.progress=0,"number"==typeof e?this.intensity.set(e):this.intensity.set(e.x,e.y),this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate=s,this._onUpdateScope=n,this.camera.emit(r.SHAKE_START,this.camera,this,t,e)),this.camera},preRender:function(){this.isRunning&&this.camera.matrix.translate(this._offsetX,this._offsetY)},update:function(t,e){if(this.isRunning)if(this._elapsed+=e,this.progress=s(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed{var s=i(82897),n=i(56694),r=i(35060),a=i(89787),o=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=1,this.destination=1,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n,o){void 0===e&&(e=1e3),void 0===i&&(i=r.Linear),void 0===s&&(s=!1),void 0===n&&(n=null),void 0===o&&(o=this.camera.scene);var h=this.camera;return!s&&this.isRunning||(this.isRunning=!0,this.duration=e,this.progress=0,this.source=h.zoom,this.destination=t,"string"==typeof i&&r.hasOwnProperty(i)?this.ease=r[i]:"function"==typeof i&&(this.ease=i),this._elapsed=0,this._onUpdate=n,this._onUpdateScope=o,this.camera.emit(a.ZOOM_START,this.camera,this,e,t)),h},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=s(this._elapsed/this.duration,0,1),this._elapsed{t.exports={Fade:i(92522),Flash:i(22151),Pan:i(37551),Shake:i(3241),RotateTo:i(1771),Zoom:i(13383)}},39577:t=>{t.exports="cameradestroy"},85373:t=>{t.exports="camerafadeincomplete"},92057:t=>{t.exports="camerafadeinstart"},1903:t=>{t.exports="camerafadeoutcomplete"},96131:t=>{t.exports="camerafadeoutstart"},85409:t=>{t.exports="cameraflashcomplete"},25500:t=>{t.exports="cameraflashstart"},44071:t=>{t.exports="followupdate"},19818:t=>{t.exports="camerapancomplete"},80002:t=>{t.exports="camerapanstart"},87966:t=>{t.exports="postrender"},74217:t=>{t.exports="prerender"},34805:t=>{t.exports="camerarotatecomplete"},30408:t=>{t.exports="camerarotatestart"},49856:t=>{t.exports="camerashakecomplete"},69189:t=>{t.exports="camerashakestart"},67657:t=>{t.exports="camerazoomcomplete"},14229:t=>{t.exports="camerazoomstart"},89787:(t,e,i)=>{t.exports={DESTROY:i(39577),FADE_IN_COMPLETE:i(85373),FADE_IN_START:i(92057),FADE_OUT_COMPLETE:i(1903),FADE_OUT_START:i(96131),FLASH_COMPLETE:i(85409),FLASH_START:i(25500),FOLLOW_UPDATE:i(44071),PAN_COMPLETE:i(19818),PAN_START:i(80002),POST_RENDER:i(87966),PRE_RENDER:i(74217),ROTATE_COMPLETE:i(34805),ROTATE_START:i(30408),SHAKE_COMPLETE:i(49856),SHAKE_START:i(69189),ZOOM_COMPLETE:i(67657),ZOOM_START:i(14229)}},32356:(t,e,i)=>{t.exports={Camera:i(47751),BaseCamera:i(51052),CameraManager:i(62382),Effects:i(53030),Events:i(89787)}},84219:(t,e,i)=>{var s=i(56694),n=i(10850),r=new s({initialize:function(t){this.camera=n(t,"camera",null),this.left=n(t,"left",null),this.right=n(t,"right",null),this.up=n(t,"up",null),this.down=n(t,"down",null),this.zoomIn=n(t,"zoomIn",null),this.zoomOut=n(t,"zoomOut",null),this.zoomSpeed=n(t,"zoomSpeed",.01),this.minZoom=n(t,"minZoom",.001),this.maxZoom=n(t,"maxZoom",1e3),this.speedX=0,this.speedY=0;var e=n(t,"speed",null);"number"==typeof e?(this.speedX=e,this.speedY=e):(this.speedX=n(t,"speed.x",0),this.speedY=n(t,"speed.y",0)),this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this.up&&this.up.isDown?e.scrollY-=this.speedY*t|0:this.down&&this.down.isDown&&(e.scrollY+=this.speedY*t|0),this.left&&this.left.isDown?e.scrollX-=this.speedX*t|0:this.right&&this.right.isDown&&(e.scrollX+=this.speedX*t|0),this.zoomIn&&this.zoomIn.isDown?(e.zoom-=this.zoomSpeed,e.zoomthis.maxZoom&&(e.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},69370:(t,e,i)=>{var s=i(56694),n=i(10850),r=new s({initialize:function(t){this.camera=n(t,"camera",null),this.left=n(t,"left",null),this.right=n(t,"right",null),this.up=n(t,"up",null),this.down=n(t,"down",null),this.zoomIn=n(t,"zoomIn",null),this.zoomOut=n(t,"zoomOut",null),this.zoomSpeed=n(t,"zoomSpeed",.01),this.minZoom=n(t,"minZoom",.001),this.maxZoom=n(t,"maxZoom",1e3),this.accelX=0,this.accelY=0;var e=n(t,"acceleration",null);"number"==typeof e?(this.accelX=e,this.accelY=e):(this.accelX=n(t,"acceleration.x",0),this.accelY=n(t,"acceleration.y",0)),this.dragX=0,this.dragY=0;var i=n(t,"drag",null);"number"==typeof i?(this.dragX=i,this.dragY=i):(this.dragX=n(t,"drag.x",0),this.dragY=n(t,"drag.y",0)),this.maxSpeedX=0,this.maxSpeedY=0;var s=n(t,"maxSpeed",null);"number"==typeof s?(this.maxSpeedX=s,this.maxSpeedY=s):(this.maxSpeedX=n(t,"maxSpeed.x",0),this.maxSpeedY=n(t,"maxSpeed.y",0)),this._speedX=0,this._speedY=0,this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this._speedX>0?(this._speedX-=this.dragX*t,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*t,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*t,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*t,this._speedY>0&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoomthis.maxZoom&&(e.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},6524:(t,e,i)=>{t.exports={FixedKeyControl:i(84219),SmoothedKeyControl:i(69370)}},44143:(t,e,i)=>{t.exports={Controls:i(6524),Scene2D:i(32356)}},86459:(t,e,i)=>{var s={VERSION:"3.60.0-beta.10",BlendModes:i(95723),ScaleModes:i(27394),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=s},14033:(t,e,i)=>{var s=i(56694),n=i(86459),r=i(77290),a=i(72632),o=i(10850),h=i(42911),l=i(5923),u=i(72283),c=i(18360),d=i(93222),f=new s({initialize:function(t){void 0===t&&(t={});var e=o(t,"scale",null);this.width=o(e,"width",1024,t),this.height=o(e,"height",768,t),this.zoom=o(e,"zoom",1,t),this.parent=o(e,"parent",void 0,t),this.scaleMode=o(e,e?"mode":"scaleMode",0,t),this.expandParent=o(e,"expandParent",!0,t),this.autoRound=o(e,"autoRound",!1,t),this.autoCenter=o(e,"autoCenter",0,t),this.resizeInterval=o(e,"resizeInterval",500,t),this.fullscreenTarget=o(e,"fullscreenTarget",null,t),this.minWidth=o(e,"minWidth",0,t),this.maxWidth=o(e,"maxWidth",0,t),this.minHeight=o(e,"minHeight",0,t),this.maxHeight=o(e,"maxHeight",0,t),this.renderType=o(t,"type",n.AUTO),this.canvas=o(t,"canvas",null),this.context=o(t,"context",null),this.canvasStyle=o(t,"canvasStyle",null),this.customEnvironment=o(t,"customEnvironment",!1),this.sceneConfig=o(t,"scene",null),this.seed=o(t,"seed",[(Date.now()*Math.random()).toString()]),l.RND=new l.RandomDataGenerator(this.seed),this.gameTitle=o(t,"title",""),this.gameURL=o(t,"url","https://phaser.io"),this.gameVersion=o(t,"version",""),this.autoFocus=o(t,"autoFocus",!0),this.domCreateContainer=o(t,"dom.createContainer",!1),this.domPointerEvents=o(t,"dom.pointerEvents","none"),this.inputKeyboard=o(t,"input.keyboard",!0),this.inputKeyboardEventTarget=o(t,"input.keyboard.target",window),this.inputKeyboardCapture=o(t,"input.keyboard.capture",[]),this.inputMouse=o(t,"input.mouse",!0),this.inputMouseEventTarget=o(t,"input.mouse.target",null),this.inputMousePreventDefaultDown=o(t,"input.mouse.preventDefaultDown",!0),this.inputMousePreventDefaultUp=o(t,"input.mouse.preventDefaultUp",!0),this.inputMousePreventDefaultMove=o(t,"input.mouse.preventDefaultMove",!0),this.inputMousePreventDefaultWheel=o(t,"input.mouse.preventDefaultWheel",!0),this.inputTouch=o(t,"input.touch",r.input.touch),this.inputTouchEventTarget=o(t,"input.touch.target",null),this.inputTouchCapture=o(t,"input.touch.capture",!0),this.inputActivePointers=o(t,"input.activePointers",1),this.inputSmoothFactor=o(t,"input.smoothFactor",0),this.inputWindowEvents=o(t,"input.windowEvents",!0),this.inputGamepad=o(t,"input.gamepad",!1),this.inputGamepadEventTarget=o(t,"input.gamepad.target",window),this.disableContextMenu=o(t,"disableContextMenu",!1),this.audio=o(t,"audio",{}),this.hideBanner=!1===o(t,"banner",null),this.hidePhaser=o(t,"banner.hidePhaser",!1),this.bannerTextColor=o(t,"banner.text","#ffffff"),this.bannerBackgroundColor=o(t,"banner.background",["#ff0000","#ffff00","#00ff00","#00ffff","#000000"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=o(t,"fps",null);var i=o(t,"render",null);this.pipeline=o(i,"pipeline",null,t),this.antialias=o(i,"antialias",!0,t),this.antialiasGL=o(i,"antialiasGL",!0,t),this.mipmapFilter=o(i,"mipmapFilter","LINEAR",t),this.desynchronized=o(i,"desynchronized",!1,t),this.roundPixels=o(i,"roundPixels",!1,t),this.pixelArt=o(i,"pixelArt",1!==this.zoom,t),this.pixelArt&&(this.antialias=!1,this.antialiasGL=!1,this.roundPixels=!0),this.transparent=o(i,"transparent",!1,t),this.clearBeforeRender=o(i,"clearBeforeRender",!0,t),this.preserveDrawingBuffer=o(i,"preserveDrawingBuffer",!1,t),this.premultipliedAlpha=o(i,"premultipliedAlpha",!0,t),this.failIfMajorPerformanceCaveat=o(i,"failIfMajorPerformanceCaveat",!1,t),this.powerPreference=o(i,"powerPreference","default",t),this.batchSize=o(i,"batchSize",4096,t),this.maxTextures=o(i,"maxTextures",-1,t),this.maxLights=o(i,"maxLights",10,t);var s=o(t,"backgroundColor",0);this.backgroundColor=d(s),this.transparent&&(this.backgroundColor=d(0),this.backgroundColor.alpha=0),this.preBoot=o(t,"callbacks.preBoot",u),this.postBoot=o(t,"callbacks.postBoot",u),this.physics=o(t,"physics",{}),this.defaultPhysicsSystem=o(this.physics,"default",!1),this.loaderBaseURL=o(t,"loader.baseURL",""),this.loaderPath=o(t,"loader.path",""),this.loaderMaxParallelDownloads=o(t,"loader.maxParallelDownloads",r.os.android?6:32),this.loaderCrossOrigin=o(t,"loader.crossOrigin",void 0),this.loaderResponseType=o(t,"loader.responseType",""),this.loaderAsync=o(t,"loader.async",!0),this.loaderUser=o(t,"loader.user",""),this.loaderPassword=o(t,"loader.password",""),this.loaderTimeout=o(t,"loader.timeout",0),this.loaderWithCredentials=o(t,"loader.withCredentials",!1),this.loaderImageLoadType=o(t,"loader.imageLoadType","XHR"),this.loaderLocalScheme=o(t,"loader.localScheme",["file://","capacitor://"]),this.installGlobalPlugins=[],this.installScenePlugins=[];var f=o(t,"plugins",null),p=c.DefaultScene;f&&(Array.isArray(f)?this.defaultPlugins=f:h(f)&&(this.installGlobalPlugins=a(f,"global",[]),this.installScenePlugins=a(f,"scene",[]),Array.isArray(f.default)?p=f.default:Array.isArray(f.defaultMerge)&&(p=p.concat(f.defaultMerge)))),this.defaultPlugins=p;var v="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=o(t,"images.default",v+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=o(t,"images.missing",v+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),this.whiteImage=o(t,"images.white","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABdJREFUeNpi/P//PwMMMDEgAdwcgAADAJZuAwXJYZOzAAAAAElFTkSuQmCC"),window&&(window.FORCE_WEBGL?this.renderType=n.WEBGL:window.FORCE_CANVAS&&(this.renderType=n.CANVAS))}});t.exports=f},50150:(t,e,i)=>{var s=i(70616),n=i(61068),r=i(86459),a=i(90185);t.exports=function(t){var e=t.config;if((e.customEnvironment||e.canvas)&&e.renderType===r.AUTO)throw new Error("Must set explicit renderType in custom environment");if(!e.customEnvironment&&!e.canvas&&e.renderType!==r.HEADLESS)if(e.renderType===r.AUTO&&(e.renderType=a.webGL?r.WEBGL:r.CANVAS),e.renderType===r.WEBGL){if(!a.webGL)throw new Error("Cannot create WebGL context, aborting.")}else{if(e.renderType!==r.CANVAS)throw new Error("Unknown value for renderer type: "+e.renderType);if(!a.canvas)throw new Error("Cannot create Canvas context, aborting.")}e.antialias||n.disableSmoothing();var o,h,l=t.scale.baseSize,u=l.width,c=l.height;(e.canvas?(t.canvas=e.canvas,t.canvas.width=u,t.canvas.height=c):t.canvas=n.create(t,u,c,e.renderType),e.canvasStyle&&(t.canvas.style=e.canvasStyle),e.antialias||s.setCrisp(t.canvas),e.renderType!==r.HEADLESS)&&(o=i(91135),h=i(11857),e.renderType===r.WEBGL?t.renderer=new h(t):(t.renderer=new o(t),t.context=t.renderer.gameContext))}},77291:(t,e,i)=>{var s=i(86459);t.exports=function(t){var e=t.config;if(!e.hideBanner){var i="WebGL";e.renderType===s.CANVAS?i="Canvas":e.renderType===s.HEADLESS&&(i="Headless");var n,r=e.audio,a=t.device.audio;if(n=a.webAudio&&!r.disableWebAudio?"Web Audio":r.noAudio||!a.webAudio&&!a.audioData?"No Audio":"HTML5 Audio",t.device.browser.ie)window.console&&console.log("Phaser v"+s.VERSION+" / https://phaser.io");else{var o,h="",l=[h];if(Array.isArray(e.bannerBackgroundColor))e.bannerBackgroundColor.forEach((function(t){h=h.concat("%c "),l.push("background: "+t),o=t})),l[l.length-1]="color: "+e.bannerTextColor+"; background: "+o;else h=h.concat("%c "),l.push("color: "+e.bannerTextColor+"; background: "+e.bannerBackgroundColor);l.push("background: transparent"),e.gameTitle&&(h=h.concat(e.gameTitle),e.gameVersion&&(h=h.concat(" v"+e.gameVersion)),e.hidePhaser||(h=h.concat(" / ")));e.hidePhaser||(h=h.concat("Phaser v"+s.VERSION+" ("+i+" | "+n+")")),h=h.concat(" %c "+e.gameURL),l[0]=h,console.log.apply(console,l)}}}},15213:(t,e,i)=>{var s=i(99584),n=i(90249),r=i(43474),a=i(61068),o=i(56694),h=i(14033),l=i(85178),u=i(50150),c=i(81078),d=i(77291),f=i(77290),p=i(21546),v=i(6659),g=i(97081),m=i(69898),y=i(91963),x=i(49274),T=i(756),w=i(13553),E=i(38203),S=i(6237),b=i(26617),A=i(26493),_=i(84191),C=new o({initialize:function(t){this.config=new h(t),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new v,this.anims=new n(this),this.textures=new S(this),this.cache=new r(this),this.registry=new c(this),this.input=new m(this,this.config),this.scene=new w(this,this.config.sceneConfig),this.device=f,this.scale=new T(this,this.config),this.sound=null,this.sound=_.create(this),this.loop=new b(this,this.config.fps),this.plugins=new x(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,p(this.boot.bind(this))},boot:function(){y.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),u(this),l(this),d(this),s(this.canvas,this.config.parent),this.textures.once(E.READY,this.texturesReady,this),this.events.emit(g.BOOT)):console.warn("Aborting. Core Plugins missing.")},texturesReady:function(){this.events.emit(g.READY),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),A(this);var t=this.events;t.on(g.HIDDEN,this.onHidden,this),t.on(g.VISIBLE,this.onVisible,this),t.on(g.BLUR,this.onBlur,this),t.on(g.FOCUS,this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit(g.PRE_STEP,t,e),i.emit(g.STEP,t,e),this.scene.update(t,e),i.emit(g.POST_STEP,t,e);var s=this.renderer;s.preRender(),i.emit(g.PRE_RENDER,s,t,e),this.scene.render(s),s.postRender(),i.emit(g.POST_RENDER,s,t,e)},headlessStep:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit(g.PRE_STEP,t,e),i.emit(g.STEP,t,e),this.scene.update(t,e),i.emit(g.POST_STEP,t,e),i.emit(g.PRE_RENDER),i.emit(g.POST_RENDER)},onHidden:function(){this.loop.pause(),this.events.emit(g.PAUSE)},pause:function(){this.onHidden()},onVisible:function(){this.loop.resume(),this.events.emit(g.RESUME)},resume:function(){this.onVisible()},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},getFrame:function(){return this.loop.frame},getTime:function(){return this.loop.now},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.scene.destroy(),this.events.emit(g.DESTROY),this.events.removeAllListeners(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(a.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.domContainer&&this.domContainer.parentNode.removeChild(this.domContainer),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=C},26617:(t,e,i)=>{var s=i(56694),n=i(10850),r=i(72283),a=i(27385),o=new s({initialize:function(t,e){this.game=t,this.raf=new a,this.started=!1,this.running=!1,this.minFps=n(e,"min",5),this.targetFps=n(e,"target",60),this.fpsLimit=n(e,"limit",0),this.hasFpsLimit=this.fpsLimit>0,this._limitRate=this.hasFpsLimit?1e3/this.fpsLimit:0,this._min=1e3/this.minFps,this._target=1e3/this.targetFps,this.actualFps=this.targetFps,this.nextFpsUpdate=0,this.framesThisSecond=0,this.callback=r,this.forceSetTimeOut=n(e,"forceSetTimeOut",!1),this.time=0,this.startTime=0,this.lastTime=0,this.frame=0,this.inFocus=!0,this._pauseTime=0,this._coolDown=0,this.delta=0,this.deltaIndex=0,this.deltaHistory=[],this.deltaSmoothingMax=n(e,"deltaHistory",10),this.panicMax=n(e,"panicMax",120),this.rawDelta=0,this.now=0,this.smoothStep=n(e,"smoothStep",!0)},blur:function(){this.inFocus=!1},focus:function(){this.inFocus=!0,this.resetDelta()},pause:function(){this._pauseTime=window.performance.now()},resume:function(){this.resetDelta(),this.startTime+=this.time-this._pauseTime},resetDelta:function(){var t=window.performance.now();this.time=t,this.lastTime=t,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0;for(var e=0;e0||!this.inFocus)&&(this._coolDown--,t=Math.min(t,this._target)),t>this._min&&(t=i[e],t=Math.min(t,this._min)),i[e]=t,this.deltaIndex++,this.deltaIndex>=s&&(this.deltaIndex=0);for(var n=0,r=0;r=this.nextFpsUpdate&&this.updateFPS(t),this.framesThisSecond++,this.delta>=this._limitRate&&(this.callback(t,this.delta),this.delta=0),this.lastTime=t,this.frame++},step:function(t){this.now=t;var e=Math.max(0,t-this.lastTime);this.rawDelta=e,this.time+=this.rawDelta,this.smoothStep&&(e=this.smoothDelta(e)),this.delta=e,t>=this.nextFpsUpdate&&this.updateFPS(t),this.framesThisSecond++,this.callback(t,e),this.lastTime=t,this.frame++},tick:function(){var t=window.performance.now();this.hasFpsLimit?this.stepLimitFPS(t):this.step(t)},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){void 0===t&&(t=!1);var e=window.performance.now();if(!this.running){t&&(this.startTime+=-this.lastTime+(this.lastTime+e));var i=this.hasFpsLimit?this.stepLimitFPS.bind(this):this.step.bind(this);this.raf.start(i,this.forceSetTimeOut,this._target),this.running=!0,this.nextFpsUpdate=e+1e3,this.framesThisSecond=0,this.fpsLimitTriggered=!1,this.tick()}},getDuration:function(){return Math.round(this.lastTime-this.startTime)/1e3},getDurationMS:function(){return Math.round(this.lastTime-this.startTime)},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.raf.destroy(),this.raf=null,this.game=null,this.callback=null}});t.exports=o},26493:(t,e,i)=>{var s=i(97081);t.exports=function(t){var e,i=t.events;if(void 0!==document.hidden)e="visibilitychange";else{["webkit","moz","ms"].forEach((function(t){void 0!==document[t+"Hidden"]&&(document.hidden=function(){return document[t+"Hidden"]},e=t+"visibilitychange")}))}e&&document.addEventListener(e,(function(t){document.hidden||"pause"===t.type?i.emit(s.HIDDEN):i.emit(s.VISIBLE)}),!1),window.onblur=function(){i.emit(s.BLUR)},window.onfocus=function(){i.emit(s.FOCUS)},window.focus&&t.config.autoFocus&&window.focus()}},41651:t=>{t.exports="blur"},5520:t=>{t.exports="boot"},51673:t=>{t.exports="contextlost"},66336:t=>{t.exports="contextrestored"},25055:t=>{t.exports="destroy"},23767:t=>{t.exports="focus"},57564:t=>{t.exports="hidden"},38327:t=>{t.exports="pause"},43807:t=>{t.exports="postrender"},73652:t=>{t.exports="poststep"},780:t=>{t.exports="prerender"},13781:t=>{t.exports="prestep"},38247:t=>{t.exports="ready"},29129:t=>{t.exports="resume"},34994:t=>{t.exports="step"},98704:t=>{t.exports="visible"},97081:(t,e,i)=>{t.exports={BLUR:i(41651),BOOT:i(5520),CONTEXT_LOST:i(51673),CONTEXT_RESTORED:i(66336),DESTROY:i(25055),FOCUS:i(23767),HIDDEN:i(57564),PAUSE:i(38327),POST_RENDER:i(43807),POST_STEP:i(73652),PRE_RENDER:i(780),PRE_STEP:i(13781),READY:i(38247),RESUME:i(29129),STEP:i(34994),VISIBLE:i(98704)}},80293:(t,e,i)=>{t.exports={Config:i(14033),CreateRenderer:i(50150),DebugHeader:i(77291),Events:i(97081),TimeStep:i(26617),VisibilityHandler:i(26493)}},52780:(t,e,i)=>{var s=i(81543),n=i(61068),r=i(10850);t.exports=function(t){var e=r(t,"data",[]),i=r(t,"canvas",null),a=r(t,"palette",s),o=r(t,"pixelWidth",1),h=r(t,"pixelHeight",o),l=r(t,"resizeCanvas",!0),u=r(t,"clearCanvas",!0),c=r(t,"preRender",null),d=r(t,"postRender",null),f=Math.floor(Math.abs(e[0].length*o)),p=Math.floor(Math.abs(e.length*h));i||(i=n.create2D(this,f,p),l=!1,u=!1),l&&(i.width=f,i.height=p);var v=i.getContext("2d");u&&v.clearRect(0,0,f,p),c&&c(i,v);for(var g=0;g{t.exports={GenerateTexture:i(52780),Palettes:i(25235)}},81543:t=>{t.exports={0:"#000",1:"#9D9D9D",2:"#FFF",3:"#BE2633",4:"#E06F8B",5:"#493C2B",6:"#A46422",7:"#EB8931",8:"#F7E26B",9:"#2F484E",A:"#44891A",B:"#A3CE27",C:"#1B2632",D:"#005784",E:"#31A2F2",F:"#B2DCEF"}},75846:t=>{t.exports={0:"#000",1:"#fff",2:"#8b4131",3:"#7bbdc5",4:"#8b41ac",5:"#6aac41",6:"#3931a4",7:"#d5de73",8:"#945a20",9:"#5a4100",A:"#bd736a",B:"#525252",C:"#838383",D:"#acee8b",E:"#7b73de",F:"#acacac"}},83206:t=>{t.exports={0:"#000",1:"#2234d1",2:"#0c7e45",3:"#44aacc",4:"#8a3622",5:"#5c2e78",6:"#aa5c3d",7:"#b5b5b5",8:"#5e606e",9:"#4c81fb",A:"#6cd947",B:"#7be2f9",C:"#eb8a60",D:"#e23d69",E:"#ffd93f",F:"#fff"}},13194:t=>{t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#f5f4eb"}},50686:t=>{t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#fff"}},25235:(t,e,i)=>{t.exports={ARNE16:i(81543),C64:i(75846),CGA:i(83206),JMP:i(13194),MSX:i(50686)}},63120:(t,e,i)=>{var s=i(56694),n=i(34631),r=i(38517),a=i(93736),o=new s({Extends:r,initialize:function(t,e,i,s){r.call(this,"CubicBezierCurve"),Array.isArray(t)&&(s=new a(t[6],t[7]),i=new a(t[4],t[5]),e=new a(t[2],t[3]),t=new a(t[0],t[1])),this.p0=t,this.p1=e,this.p2=i,this.p3=s},getStartPoint:function(t){return void 0===t&&(t=new a),t.copy(this.p0)},getResolution:function(t){return t},getPoint:function(t,e){void 0===e&&(e=new a);var i=this.p0,s=this.p1,r=this.p2,o=this.p3;return e.set(n(t,i.x,s.x,r.x,o.x),n(t,i.y,s.y,r.y,o.y))},draw:function(t,e){void 0===e&&(e=32);var i=this.getPoints(e);t.beginPath(),t.moveTo(this.p0.x,this.p0.y);for(var s=1;s{var s=i(56694),n=i(80222),r=i(74118),a=i(93736),o=new s({initialize:function(t){this.type=t,this.defaultDivisions=5,this.arcLengthDivisions=100,this.cacheArcLengths=[],this.needsUpdate=!0,this.active=!0,this._tmpVec2A=new a,this._tmpVec2B=new a},draw:function(t,e){return void 0===e&&(e=32),t.strokePoints(this.getPoints(e))},getBounds:function(t,e){t||(t=new r),void 0===e&&(e=16);var i=this.getLength();e>i&&(e=i/2);var s=Math.max(1,Math.round(i/e));return n(this.getSpacedPoints(s),t)},getDistancePoints:function(t){var e=this.getLength(),i=Math.max(1,e/t);return this.getSpacedPoints(i)},getEndPoint:function(t){return void 0===t&&(t=new a),this.getPointAt(1,t)},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],s=this.getPoint(0,this._tmpVec2A),n=0;i.push(0);for(var r=1;r<=t;r++)n+=(e=this.getPoint(r/t,this._tmpVec2B)).distance(s),i.push(n),s.copy(e);return this.cacheArcLengths=i,i},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var s=0;s<=t;s++)i.push(this.getPoint(s/t));return i},getRandomPoint:function(t){return void 0===t&&(t=new a),this.getPoint(Math.random(),t)},getSpacedPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var s=0;s<=t;s++){var n=this.getUtoTmapping(s/t,null,t);i.push(this.getPoint(n))}return i},getStartPoint:function(t){return void 0===t&&(t=new a),this.getPointAt(0,t)},getTangent:function(t,e){void 0===e&&(e=new a);var i=1e-4,s=t-i,n=t+i;return s<0&&(s=0),n>1&&(n=1),this.getPoint(s,this._tmpVec2A),this.getPoint(n,e),e.subtract(this._tmpVec2A).normalize()},getTangentAt:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)},getTFromDistance:function(t,e){return t<=0?0:this.getUtoTmapping(0,t,e)},getUtoTmapping:function(t,e,i){var s,n=this.getLengths(i),r=0,a=n.length;s=e?Math.min(e,n[a-1]):t*n[a-1];for(var o,h=0,l=a-1;h<=l;)if((o=n[r=Math.floor(h+(l-h)/2)]-s)<0)h=r+1;else{if(!(o>0)){l=r;break}l=r-1}if(n[r=l]===s)return r/(a-1);var u=n[r];return(r+(s-u)/(n[r+1]-u))/(a-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});t.exports=o},48835:(t,e,i)=>{var s=i(56694),n=i(38517),r=i(75606),a=i(10850),o=i(23701),h=i(93736),l=new s({Extends:n,initialize:function(t,e,i,s,o,l,u,c){if("object"==typeof t){var d=t;t=a(d,"x",0),e=a(d,"y",0),i=a(d,"xRadius",0),s=a(d,"yRadius",i),o=a(d,"startAngle",0),l=a(d,"endAngle",360),u=a(d,"clockwise",!1),c=a(d,"rotation",0)}else void 0===s&&(s=i),void 0===o&&(o=0),void 0===l&&(l=360),void 0===u&&(u=!1),void 0===c&&(c=0);n.call(this,"EllipseCurve"),this.p0=new h(t,e),this._xRadius=i,this._yRadius=s,this._startAngle=r(o),this._endAngle=r(l),this._clockwise=u,this._rotation=r(c)},getStartPoint:function(t){return void 0===t&&(t=new h),this.getPoint(0,t)},getResolution:function(t){return 2*t},getPoint:function(t,e){void 0===e&&(e=new h);for(var i=2*Math.PI,s=this._endAngle-this._startAngle,n=Math.abs(s)i;)s-=i;s{var s=i(56694),n=i(38517),r=i(80222),a=i(74118),o=i(93736),h=new s({Extends:n,initialize:function(t,e){n.call(this,"LineCurve"),Array.isArray(t)&&(e=new o(t[2],t[3]),t=new o(t[0],t[1])),this.p0=t,this.p1=e,this.arcLengthDivisions=1},getBounds:function(t){return void 0===t&&(t=new a),r([this.p0,this.p1],t)},getStartPoint:function(t){return void 0===t&&(t=new o),t.copy(this.p0)},getResolution:function(t){return void 0===t&&(t=1),t},getPoint:function(t,e){return void 0===e&&(e=new o),1===t?e.copy(this.p1):(e.copy(this.p1).subtract(this.p0).scale(t).add(this.p0),e)},getPointAt:function(t,e){return this.getPoint(t,e)},getTangent:function(t,e){return void 0===e&&(e=new o),e.copy(this.p1).subtract(this.p0).normalize(),e},getUtoTmapping:function(t,e,i){var s;if(e){var n=this.getLengths(i),r=n[n.length-1];s=Math.min(e,r)/r}else s=t;return s},draw:function(t){return t.lineBetween(this.p0.x,this.p0.y,this.p1.x,this.p1.y),t},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y]}}});h.fromJSON=function(t){var e=t.points,i=new o(e[0],e[1]),s=new o(e[2],e[3]);return new h(i,s)},t.exports=h},64761:(t,e,i)=>{var s=i(56694),n=i(38517),r=i(16252),a=i(93736),o=new s({Extends:n,initialize:function(t,e,i){n.call(this,"QuadraticBezierCurve"),Array.isArray(t)&&(i=new a(t[4],t[5]),e=new a(t[2],t[3]),t=new a(t[0],t[1])),this.p0=t,this.p1=e,this.p2=i},getStartPoint:function(t){return void 0===t&&(t=new a),t.copy(this.p0)},getResolution:function(t){return t},getPoint:function(t,e){void 0===e&&(e=new a);var i=this.p0,s=this.p1,n=this.p2;return e.set(r(t,i.x,s.x,n.x),r(t,i.y,s.y,n.y))},draw:function(t,e){void 0===e&&(e=32);var i=this.getPoints(e);t.beginPath(),t.moveTo(this.p0.x,this.p0.y);for(var s=1;s{var s=i(14976),n=i(56694),r=i(38517),a=i(93736),o=new n({Extends:r,initialize:function(t){void 0===t&&(t=[]),r.call(this,"SplineCurve"),this.points=[],this.addPoints(t)},addPoints:function(t){for(var e=0;ei.length-2?i.length-1:r+1],c=i[r>i.length-3?i.length-1:r+2];return e.set(s(o,h.x,l.x,u.x,c.x),s(o,h.y,l.y,u.y,c.y))},toJSON:function(){for(var t=[],e=0;e{t.exports={Path:i(12822),MoveTo:i(53639),CubicBezier:i(63120),Curve:i(38517),Ellipse:i(48835),Line:i(58084),QuadraticBezier:i(64761),Spline:i(11956)}},53639:(t,e,i)=>{var s=i(56694),n=i(93736),r=new s({initialize:function(t,e){this.active=!1,this.p0=new n(t,e)},getPoint:function(t,e){return void 0===e&&(e=new n),e.copy(this.p0)},getPointAt:function(t,e){return this.getPoint(t,e)},getResolution:function(){return 1},getLength:function(){return 0},toJSON:function(){return{type:"MoveTo",points:[this.p0.x,this.p0.y]}}});t.exports=r},12822:(t,e,i)=>{var s=i(56694),n=i(63120),r=i(48835),a=i(61286),o=i(58084),h=i(53639),l=i(64761),u=i(74118),c=i(11956),d=i(93736),f=i(83392),p=new s({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.name="",this.curves=[],this.cacheLengths=[],this.autoClose=!1,this.startPoint=new d,this._tmpVec2A=new d,this._tmpVec2B=new d,"object"==typeof t?this.fromJSON(t):this.startPoint.set(t,e)},add:function(t){return this.curves.push(t),this},circleTo:function(t,e,i){return void 0===e&&(e=!1),this.ellipseTo(t,t,0,360,e,i)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);return t.equals(e)||this.curves.push(new o(e,t)),this},cubicBezierTo:function(t,e,i,s,r,a){var o,h,l,u=this.getEndPoint();return t instanceof d?(o=t,h=e,l=i):(o=new d(i,s),h=new d(r,a),l=new d(t,e)),this.add(new n(u,o,h,l))},quadraticBezierTo:function(t,e,i,s){var n,r,a=this.getEndPoint();return t instanceof d?(n=t,r=e):(n=new d(i,s),r=new d(t,e)),this.add(new l(a,n,r))},draw:function(t,e){for(var i=0;i=e)return this.curves[s];s++}return null},getEndPoint:function(t){return void 0===t&&(t=new d),this.curves.length>0?this.curves[this.curves.length-1].getPoint(1,t):t.copy(this.startPoint),t},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},getPoint:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),s=this.getCurveLengths(),n=0;n=i){var r=s[n]-i,a=this.curves[n],o=a.getLength(),h=0===o?0:1-r/o;return a.getPointAt(h,e)}n++}return null},getPoints:function(t){void 0===t&&(t=12);for(var e,i=[],s=0;s1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i},getRandomPoint:function(t){return void 0===t&&(t=new d),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getStartPoint:function(t){return void 0===t&&(t=new d),t.copy(this.startPoint)},getTangent:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),s=this.getCurveLengths(),n=0;n=i){var r=s[n]-i,a=this.curves[n],o=a.getLength(),h=0===o?0:1-r/o;return a.getTangentAt(h,e)}n++}return null},lineTo:function(t,e){t instanceof d?this._tmpVec2B.copy(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new o([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new c(t))},moveTo:function(t,e){return t instanceof d?this.add(new h(t.x,t.y)):this.add(new h(t,e))},toJSON:function(){for(var t=[],e=0;e{var s=i(56694),n=i(35026),r=new s({initialize:function(t,e){this.parent=t,this.events=e,e||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once(n.DESTROY,this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],s=0;s{var s=i(56694),n=i(81078),r=i(91963),a=i(7599),o=new s({Extends:n,initialize:function(t){n.call(this,t,t.sys.events),this.scene=t,this.systems=t.sys,t.sys.events.once(a.BOOT,this.boot,this),t.sys.events.on(a.START,this.start,this)},boot:function(){this.events=this.systems.events,this.events.once(a.DESTROY,this.destroy,this)},start:function(){this.events.once(a.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.systems.events.off(a.SHUTDOWN,this.shutdown,this)},destroy:function(){n.prototype.destroy.call(this),this.events.off(a.START,this.start,this),this.scene=null,this.systems=null}});r.register("DataManagerPlugin",o,"data"),t.exports=o},73569:t=>{t.exports="changedata"},15590:t=>{t.exports="changedata-"},37669:t=>{t.exports="destroy"},87090:t=>{t.exports="removedata"},90142:t=>{t.exports="setdata"},35026:(t,e,i)=>{t.exports={CHANGE_DATA:i(73569),CHANGE_DATA_KEY:i(15590),DESTROY:i(37669),REMOVE_DATA:i(87090),SET_DATA:i(90142)}},1999:(t,e,i)=>{t.exports={DataManager:i(81078),DataManagerPlugin:i(76508),Events:i(35026)}},10720:(t,e,i)=>{var s=i(1350),n={flac:!1,aac:!1,audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return n;n.audioData=!!window.Audio,n.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio"),e=!!t.canPlayType;try{if(e){var i=function(e,i){var s=t.canPlayType("audio/"+e).replace(/^no$/,"");return i?Boolean(s||t.canPlayType("audio/"+i).replace(/^no$/,"")):Boolean(s)};if(n.ogg=i('ogg; codecs="vorbis"'),n.opus=i('ogg; codecs="opus"',"opus"),n.mp3=i("mpeg"),n.wav=i("wav"),n.m4a=i("x-m4a"),n.aac=i("aac"),n.flac=i("flac","x-flac"),n.webm=i('webm; codecs="vorbis"'),""!==t.canPlayType('audio/mp4; codecs="ec-3"'))if(s.edge)n.dolby=!0;else if(s.safari&&s.safariVersion>=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var r=parseInt(RegExp.$1,10),a=parseInt(RegExp.$2,10);(10===r&&a>=11||r>10)&&(n.dolby=!0)}}}catch(t){}return n}()},1350:(t,e,i)=>{var s,n=i(36580),r={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0};t.exports=(s=navigator.userAgent,/Edge\/\d+/.test(s)?r.edge=!0:/Chrome\/(\d+)/.test(s)&&!n.windowsPhone?(r.chrome=!0,r.chromeVersion=parseInt(RegExp.$1,10)):/Firefox\D+(\d+)/.test(s)?(r.firefox=!0,r.firefoxVersion=parseInt(RegExp.$1,10)):/AppleWebKit/.test(s)&&n.iOS?r.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(s)?(r.ie=!0,r.ieVersion=parseInt(RegExp.$1,10)):/Opera/.test(s)?r.opera=!0:/Safari/.test(s)&&!n.windowsPhone?r.safari=!0:/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(s)&&(r.ie=!0,r.trident=!0,r.tridentVersion=parseInt(RegExp.$1,10),r.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(s)&&(r.silk=!0),r)},98581:(t,e,i)=>{var s,n,r,a=i(61068),o={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=("function"!=typeof importScripts&&void 0!==document&&(o.supportNewBlendModes=(s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",n="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(r=new Image).onload=function(){var t=new Image;t.onload=function(){var e=a.create2D(t,6).getContext("2d",{willReadFrequently:!0});if(e.globalCompositeOperation="multiply",e.drawImage(r,0,0),e.drawImage(t,2,0),!e.getImageData(2,0,1,1))return!1;var i=e.getImageData(2,0,1,1).data;a.remove(t),o.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=s+"/wCKxvRF"+n},r.src=s+"AP804Oa6"+n,!1),o.supportInverseAlpha=function(){var t=a.create2D(this,2).getContext("2d",{willReadFrequently:!0});t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1),s=i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3];return a.remove(this),s}()),o)},90185:(t,e,i)=>{var s=i(36580),n=i(1350),r=i(61068),a={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){if("function"==typeof importScripts)return a;a.canvas=!!window.CanvasRenderingContext2D;try{a.localStorage=!!localStorage.getItem}catch(t){a.localStorage=!1}a.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),a.fileSystem=!!window.requestFileSystem;var t,e,i,o=!1;return a.webGL=function(){if(window.WebGLRenderingContext)try{var t=r.createWebGL(this),e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=r.create2D(this),s=i.getContext("2d").createImageData(1,1);return o=s.data instanceof Uint8ClampedArray,r.remove(t),r.remove(i),!!e}catch(t){return!1}return!1}(),a.worker=!!window.Worker,a.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,a.getUserMedia=a.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,n.firefox&&n.firefoxVersion<21&&(a.getUserMedia=!1),!s.iOS&&(n.ie||n.firefox||n.chrome)&&(a.canvasBitBltShift=!0),(n.safari||n.mobileSafari)&&(a.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(a.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(a.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),a.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==a.littleEndian&&o,a}()},33553:t=>{var e={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){if("function"==typeof importScripts)return e;var t,i="Fullscreen",s="FullScreen",n=["request"+i,"request"+s,"webkitRequest"+i,"webkitRequest"+s,"msRequest"+i,"msRequest"+s,"mozRequest"+s,"mozRequest"+i];for(t=0;t{var s=i(1350),n={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=("function"==typeof importScripts||(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(n.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(n.mspointer=!0),navigator.getGamepads&&(n.gamepads=!0),"onwheel"in window||s.ie&&"WheelEvent"in window?n.wheelEvent="wheel":"onmousewheel"in window?n.wheelEvent="mousewheel":s.firefox&&"MouseScrollEvent"in window&&(n.wheelEvent="DOMMouseScroll")),n)},36580:t=>{var e={android:!1,chromeOS:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};t.exports=function(){if("function"==typeof importScripts)return e;var t=navigator.userAgent;/Windows/.test(t)?e.windows=!0:/Mac OS/.test(t)&&!/like Mac OS/.test(t)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(e.iOS=!0,e.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),e.iOSVersion=parseInt(RegExp.$1,10)):e.macOS=!0:/Android/.test(t)?e.android=!0:/Linux/.test(t)?e.linux=!0:/iP[ao]d|iPhone/i.test(t)?(e.iOS=!0,navigator.appVersion.match(/OS (\d+)/),e.iOSVersion=parseInt(RegExp.$1,10),e.iPhone=-1!==t.toLowerCase().indexOf("iphone"),e.iPad=-1!==t.toLowerCase().indexOf("ipad")):/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?e.kindle=!0:/CrOS/.test(t)&&(e.chromeOS=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(e.android=!1,e.iOS=!1,e.macOS=!1,e.windows=!0,e.windowsPhone=!0);var i=/Silk/.test(t);return(e.windows||e.macOS||e.linux&&!i||e.chromeOS)&&(e.desktop=!0),(e.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(e.desktop=!1),navigator.standalone&&(e.webApp=!0),"function"!=typeof importScripts&&(void 0!==window.cordova&&(e.cordova=!0),void 0!==window.ejecta&&(e.ejecta=!0)),"undefined"!=typeof process&&process.versions&&process.versions.node&&(e.node=!0),e.node&&"object"==typeof process.versions&&(e.nodeWebkit=!!process.versions["node-webkit"],e.electron=!!process.versions.electron),/Crosswalk/.test(t)&&(e.crosswalk=!0),e.pixelRatio=window.devicePixelRatio||1,e}()},53861:t=>{var e={h264:!1,hls:!1,mp4:!1,m4v:!1,ogg:!1,vp9:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return e;var t=document.createElement("video"),i=!!t.canPlayType,s=/^no$/;try{i&&(t.canPlayType('video/ogg; codecs="theora"').replace(s,"")&&(e.ogg=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(s,"")&&(e.h264=!0,e.mp4=!0),t.canPlayType("video/x-m4v").replace(s,"")&&(e.m4v=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(s,"")&&(e.webm=!0),t.canPlayType('video/webm; codecs="vp9"').replace(s,"")&&(e.vp9=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(s,"")&&(e.hls=!0))}catch(t){}return e}()},77290:(t,e,i)=>{t.exports={os:i(36580),browser:i(1350),features:i(90185),input:i(95872),audio:i(10720),video:i(53861),fullscreen:i(33553),canvasFeatures:i(98581)}},65246:(t,e,i)=>{var s=new(i(56694))({initialize:function(){this._matrix=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],this.alpha=1,this._dirty=!0,this._data},set:function(t){return this._matrix=t,this._dirty=!0,this},reset:function(){var t=this._matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=1,t[13]=0,t[14]=0,t[15]=0,t[16]=0,t[17]=0,t[18]=1,t[19]=0,this._dirty=!0,this},getData:function(){if(this._dirty){var t=new Float32Array(this._matrix);t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,this._data=t,this._dirty=!1}return this._data},brightness:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t;return this.multiply([i,0,0,0,0,0,i,0,0,0,0,0,i,0,0,0,0,0,1,0],e)},saturate:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=2*t/3+1,s=-.5*(i-1);return this.multiply([i,s,s,0,0,s,i,s,0,0,s,s,i,0,0,0,0,0,1,0],e)},desaturate:function(t){return void 0===t&&(t=!1),this.saturate(-1,t)},hue:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1),t=t/180*Math.PI;var i=Math.cos(t),s=Math.sin(t),n=.213,r=.715,a=.072;return this.multiply([n+.787*i+s*-n,r+i*-r+s*-r,a+i*-a+.928*s,0,0,n+i*-n+.143*s,r+i*(1-r)+.14*s,a+i*-a+-.283*s,0,0,n+i*-n+-.787*s,r+i*-r+s*r,a+.928*i+s*a,0,0,0,0,0,1,0],e)},grayscale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=!1),this.saturate(-t,e)},blackWhite:function(t){return void 0===t&&(t=!1),this.multiply([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},contrast:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t+1,s=-.5*(i-1);return this.multiply([i,0,0,0,s,0,i,0,0,s,0,0,i,0,s,0,0,0,1,0],e)},negative:function(t){return void 0===t&&(t=!1),this.multiply([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},desaturateLuminance:function(t){return void 0===t&&(t=!1),this.multiply([.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0],t)},sepia:function(t){return void 0===t&&(t=!1),this.multiply([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},night:function(t,e){return void 0===t&&(t=.1),void 0===e&&(e=!1),this.multiply([-2*t,-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0],e)},lsd:function(t){return void 0===t&&(t=!1),this.multiply([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},brown:function(t){return void 0===t&&(t=!1),this.multiply([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},vintagePinhole:function(t){return void 0===t&&(t=!1),this.multiply([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},kodachrome:function(t){return void 0===t&&(t=!1),this.multiply([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],t)},technicolor:function(t){return void 0===t&&(t=!1),this.multiply([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],t)},polaroid:function(t){return void 0===t&&(t=!1),this.multiply([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},shiftToBGR:function(t){return void 0===t&&(t=!1),this.multiply([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},multiply:function(t,e){e||this.reset();for(var i=this._matrix,s=[],n=0;n<20;n++)s[n]=i[n];return i[0]=s[0]*t[0]+s[1]*t[5]+s[2]*t[10]+s[3]*t[15],i[1]=s[0]*t[1]+s[1]*t[6]+s[2]*t[11]+s[3]*t[16],i[2]=s[0]*t[2]+s[1]*t[7]+s[2]*t[12]+s[3]*t[17],i[3]=s[0]*t[3]+s[1]*t[8]+s[2]*t[13]+s[3]*t[18],i[4]=s[0]*t[4]+s[1]*t[9]+s[2]*t[14]+s[3]*t[19]+s[4],i[5]=s[5]*t[0]+s[6]*t[5]+s[7]*t[10]+s[8]*t[15],i[6]=s[5]*t[1]+s[6]*t[6]+s[7]*t[11]+s[8]*t[16],i[7]=s[5]*t[2]+s[6]*t[7]+s[7]*t[12]+s[8]*t[17],i[8]=s[5]*t[3]+s[6]*t[8]+s[7]*t[13]+s[8]*t[18],i[9]=s[5]*t[4]+s[6]*t[9]+s[7]*t[14]+s[8]*t[19]+s[9],i[10]=s[10]*t[0]+s[11]*t[5]+s[12]*t[10]+s[13]*t[15],i[11]=s[10]*t[1]+s[11]*t[6]+s[12]*t[11]+s[13]*t[16],i[12]=s[10]*t[2]+s[11]*t[7]+s[12]*t[12]+s[13]*t[17],i[13]=s[10]*t[3]+s[11]*t[8]+s[12]*t[13]+s[13]*t[18],i[14]=s[10]*t[4]+s[11]*t[9]+s[12]*t[14]+s[13]*t[19]+s[14],i[15]=s[15]*t[0]+s[16]*t[5]+s[17]*t[10]+s[18]*t[15],i[16]=s[15]*t[1]+s[16]*t[6]+s[17]*t[11]+s[18]*t[16],i[17]=s[15]*t[2]+s[16]*t[7]+s[17]*t[12]+s[18]*t[17],i[18]=s[15]*t[3]+s[16]*t[8]+s[17]*t[13]+s[18]*t[18],i[19]=s[15]*t[4]+s[16]*t[9]+s[17]*t[14]+s[18]*t[19]+s[19],this._dirty=!0,this}});t.exports=s},39298:(t,e,i)=>{var s=i(56694),n=i(72283),r=new s({initialize:function(t,e,i){this._rgb=[0,0,0],this.onChangeCallback=n,this.dirty=!1,this.set(t,e,i)},set:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this._rgb=[t,e,i],this.onChange(),this},equals:function(t,e,i){var s=this._rgb;return s[0]===t&&s[1]===e&&s[2]===i},onChange:function(){this.dirty=!0;var t=this._rgb;this.onChangeCallback.call(this,t[0],t[1],t[2])},r:{get:function(){return this._rgb[0]},set:function(t){this._rgb[0]=t,this.onChange()}},g:{get:function(){return this._rgb[1]},set:function(t){this._rgb[1]=t,this.onChange()}},b:{get:function(){return this._rgb[2]},set:function(t){this._rgb[2]=t,this.onChange()}},destroy:function(){this.onChangeCallback=null}});t.exports=r},84093:t=>{t.exports={TOP_LEFT:0,TOP_CENTER:1,TOP_RIGHT:2,LEFT_TOP:3,LEFT_CENTER:4,LEFT_BOTTOM:5,CENTER:6,RIGHT_TOP:7,RIGHT_CENTER:8,RIGHT_BOTTOM:9,BOTTOM_LEFT:10,BOTTOM_CENTER:11,BOTTOM_RIGHT:12}},32058:(t,e,i)=>{var s=i(97328),n=i(59994),r=i(73174),a=i(28417);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,n(e)+i),r(t,s(e)+o),t}},85535:(t,e,i)=>{var s=i(97328),n=i(40163),r=i(73174),a=i(74465);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,n(e)-i),r(t,s(e)+o),t}},9605:(t,e,i)=>{var s=i(97328),n=i(70271),r=i(73174),a=i(19298);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,n(e)+i),r(t,s(e)+o),t}},22529:(t,e,i)=>{var s=i(21843),n=i(59994),r=i(29568);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),s(t,n(e)+i,r(e)+a),t}},5739:(t,e,i)=>{var s=i(29568),n=i(40163),r=i(81711),a=i(74465);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,n(e)-i),r(t,s(e)+o),t}},40327:(t,e,i)=>{var s=i(84093),n=[];n[s.BOTTOM_CENTER]=i(32058),n[s.BOTTOM_LEFT]=i(85535),n[s.BOTTOM_RIGHT]=i(9605),n[s.CENTER]=i(22529),n[s.LEFT_CENTER]=i(5739),n[s.RIGHT_CENTER]=i(27683),n[s.TOP_CENTER]=i(96439),n[s.TOP_LEFT]=i(81447),n[s.TOP_RIGHT]=i(47888),n[s.LEFT_BOTTOM]=n[s.BOTTOM_LEFT],n[s.LEFT_TOP]=n[s.TOP_LEFT],n[s.RIGHT_BOTTOM]=n[s.BOTTOM_RIGHT],n[s.RIGHT_TOP]=n[s.TOP_RIGHT];t.exports=function(t,e,i,s,r){return n[i](t,e,s,r)}},27683:(t,e,i)=>{var s=i(29568),n=i(70271),r=i(81711),a=i(19298);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,n(e)+i),r(t,s(e)+o),t}},96439:(t,e,i)=>{var s=i(59994),n=i(47196),r=i(28417),a=i(84349);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),r(t,s(e)+i),a(t,n(e)-o),t}},81447:(t,e,i)=>{var s=i(40163),n=i(47196),r=i(74465),a=i(84349);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),r(t,s(e)-i),a(t,n(e)-o),t}},47888:(t,e,i)=>{var s=i(70271),n=i(47196),r=i(19298),a=i(84349);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),r(t,s(e)+i),a(t,n(e)-o),t}},46997:(t,e,i)=>{t.exports={BottomCenter:i(32058),BottomLeft:i(85535),BottomRight:i(9605),Center:i(22529),LeftCenter:i(5739),QuickSet:i(40327),RightCenter:i(27683),TopCenter:i(96439),TopLeft:i(81447),TopRight:i(47888)}},93545:(t,e,i)=>{var s=i(84093),n=i(98611),r={In:i(46997),To:i(86639)};r=n(!1,r,s),t.exports=r},27118:(t,e,i)=>{var s=i(97328),n=i(59994),r=i(28417),a=i(84349);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),r(t,n(e)+i),a(t,s(e)+o),t}},84469:(t,e,i)=>{var s=i(97328),n=i(40163),r=i(74465),a=i(84349);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),r(t,n(e)-i),a(t,s(e)+o),t}},51577:(t,e,i)=>{var s=i(97328),n=i(70271),r=i(19298),a=i(84349);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),r(t,n(e)+i),a(t,s(e)+o),t}},90271:(t,e,i)=>{var s=i(97328),n=i(40163),r=i(73174),a=i(19298);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,n(e)-i),r(t,s(e)+o),t}},30466:(t,e,i)=>{var s=i(29568),n=i(40163),r=i(81711),a=i(19298);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,n(e)-i),r(t,s(e)+o),t}},50087:(t,e,i)=>{var s=i(40163),n=i(47196),r=i(19298),a=i(84349);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),r(t,s(e)-i),a(t,n(e)-o),t}},82590:(t,e,i)=>{var s=i(84093),n=[];n[s.BOTTOM_CENTER]=i(27118),n[s.BOTTOM_LEFT]=i(84469),n[s.BOTTOM_RIGHT]=i(51577),n[s.LEFT_BOTTOM]=i(90271),n[s.LEFT_CENTER]=i(30466),n[s.LEFT_TOP]=i(50087),n[s.RIGHT_BOTTOM]=i(13555),n[s.RIGHT_CENTER]=i(99049),n[s.RIGHT_TOP]=i(67788),n[s.TOP_CENTER]=i(78170),n[s.TOP_LEFT]=i(54145),n[s.TOP_RIGHT]=i(75548);t.exports=function(t,e,i,s,r){return n[i](t,e,s,r)}},13555:(t,e,i)=>{var s=i(97328),n=i(70271),r=i(73174),a=i(74465);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,n(e)+i),r(t,s(e)+o),t}},99049:(t,e,i)=>{var s=i(29568),n=i(70271),r=i(81711),a=i(74465);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,n(e)+i),r(t,s(e)+o),t}},67788:(t,e,i)=>{var s=i(70271),n=i(47196),r=i(74465),a=i(84349);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),r(t,s(e)+i),a(t,n(e)-o),t}},78170:(t,e,i)=>{var s=i(59994),n=i(47196),r=i(73174),a=i(28417);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)+i),r(t,n(e)-o),t}},54145:(t,e,i)=>{var s=i(40163),n=i(47196),r=i(73174),a=i(74465);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)-i),r(t,n(e)-o),t}},75548:(t,e,i)=>{var s=i(70271),n=i(47196),r=i(73174),a=i(19298);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)+i),r(t,n(e)-o),t}},86639:(t,e,i)=>{t.exports={BottomCenter:i(27118),BottomLeft:i(84469),BottomRight:i(51577),LeftBottom:i(90271),LeftCenter:i(30466),LeftTop:i(50087),QuickSet:i(82590),RightBottom:i(13555),RightCenter:i(99049),RightTop:i(67788),TopCenter:i(78170),TopLeft:i(54145),TopRight:i(75548)}},21843:(t,e,i)=>{var s=i(28417),n=i(81711);t.exports=function(t,e,i){return s(t,e),n(t,i)}},97328:t=>{t.exports=function(t){return t.y+t.height-t.height*t.originY}},7126:(t,e,i)=>{var s=i(97328),n=i(40163),r=i(70271),a=i(47196);t.exports=function(t,e){void 0===e&&(e={});var i=n(t),o=a(t);return e.x=i,e.y=o,e.width=r(t)-i,e.height=s(t)-o,e}},59994:t=>{t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},29568:t=>{t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},40163:t=>{t.exports=function(t){return t.x-t.width*t.originX}},52088:t=>{t.exports=function(t){return t.width*t.originX}},23379:t=>{t.exports=function(t){return t.height*t.originY}},70271:t=>{t.exports=function(t){return t.x+t.width-t.width*t.originX}},47196:t=>{t.exports=function(t){return t.y-t.height*t.originY}},73174:t=>{t.exports=function(t,e){return t.y=e-t.height+t.height*t.originY,t}},28417:t=>{t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},81711:t=>{t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},74465:t=>{t.exports=function(t,e){return t.x=e+t.width*t.originX,t}},19298:t=>{t.exports=function(t,e){return t.x=e-t.width+t.width*t.originX,t}},84349:t=>{t.exports=function(t,e){return t.y=e+t.height*t.originY,t}},15252:(t,e,i)=>{t.exports={CenterOn:i(21843),GetBottom:i(97328),GetBounds:i(7126),GetCenterX:i(59994),GetCenterY:i(29568),GetLeft:i(40163),GetOffsetX:i(52088),GetOffsetY:i(23379),GetRight:i(70271),GetTop:i(47196),SetBottom:i(73174),SetCenterX:i(28417),SetCenterY:i(81711),SetLeft:i(74465),SetRight:i(19298),SetTop:i(84349)}},70616:t=>{t.exports={setCrisp:function(t){return["optimizeSpeed","-moz-crisp-edges","-o-crisp-edges","-webkit-optimize-contrast","optimize-contrast","crisp-edges","pixelated"].forEach((function(e){t.style["image-rendering"]=e})),t.style.msInterpolationMode="nearest-neighbor",t},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},61068:(t,e,i)=>{var s,n,r,a=i(86459),o=i(8213),h=[],l=!1;t.exports=(r=function(){var t=0;return h.forEach((function(e){e.parent&&t++})),t},{create2D:function(t,e,i){return s(t,e,i,a.CANVAS)},create:s=function(t,e,i,s,r){var u;void 0===e&&(e=1),void 0===i&&(i=1),void 0===s&&(s=a.CANVAS),void 0===r&&(r=!1);var c=n(s);return null===c?(c={parent:t,canvas:document.createElement("canvas"),type:s},s===a.CANVAS&&h.push(c),u=c.canvas):(c.parent=t,u=c.canvas),r&&(c.parent=u),u.width=e,u.height=i,l&&s===a.CANVAS&&o.disable(u.getContext("2d")),u},createWebGL:function(t,e,i){return s(t,e,i,a.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:n=function(t){if(void 0===t&&(t=a.CANVAS),t===a.WEBGL)return null;for(var e=0;e{var e,i="";t.exports={disable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!1),t},enable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!0),t},getPrefix:e=function(t){for(var e=["i","webkitI","msI","mozI","oI"],i=0;i{t.exports=function(t,e){return void 0===e&&(e="none"),t.style.msTouchAction=e,t.style["ms-touch-action"]=e,t.style["touch-action"]=e,t}},36505:t=>{t.exports=function(t,e){void 0===e&&(e="none");return["-webkit-","-khtml-","-moz-","-ms-",""].forEach((function(i){t.style[i+"user-select"]=e})),t.style["-webkit-touch-callout"]=e,t.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",t}},23514:(t,e,i)=>{t.exports={CanvasInterpolation:i(70616),CanvasPool:i(61068),Smoothing:i(8213),TouchAction:i(59271),UserSelect:i(36505)}},27119:(t,e,i)=>{var s=i(56694),n=i(22946),r=i(5657),a=i(24650),o=i(68033),h=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=255),this.r=0,this.g=0,this.b=0,this.a=255,this._h=0,this._s=0,this._v=0,this._locked=!1,this.gl=[0,0,0,1],this._color=0,this._color32=0,this._rgba="",this.setTo(t,e,i,s)},transparent:function(){return this._locked=!0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this._locked=!1,this.update(!0)},setTo:function(t,e,i,s,n){return void 0===s&&(s=255),void 0===n&&(n=!0),this._locked=!0,this.red=t,this.green=e,this.blue=i,this.alpha=s,this._locked=!1,this.update(n)},setGLTo:function(t,e,i,s){return void 0===s&&(s=1),this._locked=!0,this.redGL=t,this.greenGL=e,this.blueGL=i,this.alphaGL=s,this._locked=!1,this.update(!0)},setFromRGB:function(t){return this._locked=!0,this.red=t.r,this.green=t.g,this.blue=t.b,t.hasOwnProperty("a")&&(this.alpha=t.a),this._locked=!1,this.update(!0)},setFromHSV:function(t,e,i){return a(t,e,i,this)},update:function(t){if(void 0===t&&(t=!1),this._locked)return this;var e=this.r,i=this.g,s=this.b,a=this.a;return this._color=n(e,i,s),this._color32=r(e,i,s,a),this._rgba="rgba("+e+","+i+","+s+","+a/255+")",t&&o(e,i,s,this),this},updateHSV:function(){var t=this.r,e=this.g,i=this.b;return o(t,e,i,this),this},clone:function(){return new h(this.r,this.g,this.b,this.a)},gray:function(t){return this.setTo(t,t,t)},random:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t)),s=Math.floor(t+Math.random()*(e-t)),n=Math.floor(t+Math.random()*(e-t));return this.setTo(i,s,n)},randomGray:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t));return this.setTo(i,i,i)},saturate:function(t){return this.s+=t/100,this},desaturate:function(t){return this.s-=t/100,this},lighten:function(t){return this.v+=t/100,this},darken:function(t){return this.v-=t/100,this},brighten:function(t){var e=this.r,i=this.g,s=this.b;return e=Math.max(0,Math.min(255,e-Math.round(-t/100*255))),i=Math.max(0,Math.min(255,i-Math.round(-t/100*255))),s=Math.max(0,Math.min(255,s-Math.round(-t/100*255))),this.setTo(e,i,s)},color:{get:function(){return this._color}},color32:{get:function(){return this._color32}},rgba:{get:function(){return this._rgba}},redGL:{get:function(){return this.gl[0]},set:function(t){this.gl[0]=Math.min(Math.abs(t),1),this.r=Math.floor(255*this.gl[0]),this.update(!0)}},greenGL:{get:function(){return this.gl[1]},set:function(t){this.gl[1]=Math.min(Math.abs(t),1),this.g=Math.floor(255*this.gl[1]),this.update(!0)}},blueGL:{get:function(){return this.gl[2]},set:function(t){this.gl[2]=Math.min(Math.abs(t),1),this.b=Math.floor(255*this.gl[2]),this.update(!0)}},alphaGL:{get:function(){return this.gl[3]},set:function(t){this.gl[3]=Math.min(Math.abs(t),1),this.a=Math.floor(255*this.gl[3]),this.update()}},red:{get:function(){return this.r},set:function(t){t=Math.floor(Math.abs(t)),this.r=Math.min(t,255),this.gl[0]=t/255,this.update(!0)}},green:{get:function(){return this.g},set:function(t){t=Math.floor(Math.abs(t)),this.g=Math.min(t,255),this.gl[1]=t/255,this.update(!0)}},blue:{get:function(){return this.b},set:function(t){t=Math.floor(Math.abs(t)),this.b=Math.min(t,255),this.gl[2]=t/255,this.update(!0)}},alpha:{get:function(){return this.a},set:function(t){t=Math.floor(Math.abs(t)),this.a=Math.min(t,255),this.gl[3]=t/255,this.update()}},h:{get:function(){return this._h},set:function(t){this._h=t,a(t,this._s,this._v,this)}},s:{get:function(){return this._s},set:function(t){this._s=t,a(this._h,t,this._v,this)}},v:{get:function(){return this._v},set:function(t){this._v=t,a(this._h,this._s,t,this)}}});t.exports=h},30245:(t,e,i)=>{var s=i(22946);t.exports=function(t){void 0===t&&(t=1024);var e,i=[],n=255,r=255,a=0,o=0;for(e=0;e<=n;e++)i.push({r:r,g:e,b:o,color:s(r,e,o)});for(a=255,e=n;e>=0;e--)i.push({r:e,g:a,b:o,color:s(e,a,o)});for(r=0,e=0;e<=n;e++,a--)i.push({r:r,g:a,b:e,color:s(r,a,e)});for(a=0,o=255,e=0;e<=n;e++,o--,r++)i.push({r:r,g:a,b:o,color:s(r,a,o)});if(1024===t)return i;var h=[],l=0,u=1024/t;for(e=0;e{t.exports=function(t){var e={r:t>>16&255,g:t>>8&255,b:255&t,a:255};return t>16777215&&(e.a=t>>>24),e}},25409:t=>{t.exports=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e}},22946:t=>{t.exports=function(t,e,i){return t<<16|e<<8|i}},5657:t=>{t.exports=function(t,e,i,s){return s<<24|t<<16|e<<8|i}},74777:(t,e,i)=>{var s=i(27119),n=i(59998);t.exports=function(t,e,i){var r=i,a=i,o=i;if(0!==e){var h=i<.5?i*(1+e):i+e-i*e,l=2*i-h;r=n(l,h,t+1/3),a=n(l,h,t),o=n(l,h,t-1/3)}return(new s).setGLTo(r,a,o,1)}},89263:(t,e,i)=>{var s=i(24650);t.exports=function(t,e){void 0===t&&(t=1),void 0===e&&(e=1);for(var i=[],n=0;n<=359;n++)i.push(s(n/359,t,e));return i}},24650:(t,e,i)=>{var s=i(22946);function n(t,e,i,s){var n=(t+6*e)%6,r=Math.min(n,4-n,1);return Math.round(255*(s-s*i*Math.max(0,r)))}t.exports=function(t,e,i,r){void 0===e&&(e=1),void 0===i&&(i=1);var a=n(5,t,e,i),o=n(3,t,e,i),h=n(1,t,e,i);return r?r.setTo?r.setTo(a,o,h,r.alpha,!1):(r.r=a,r.g=o,r.b=h,r.color=s(a,o,h),r):{r:a,g:o,b:h,color:s(a,o,h)}}},91487:(t,e,i)=>{var s=i(27119);t.exports=function(t){var e=new s;t=t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,i,s){return e+e+i+i+s+s}));var i=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(i){var n=parseInt(i[1],16),r=parseInt(i[2],16),a=parseInt(i[3],16);e.setTo(n,r,a)}return e}},59998:t=>{t.exports=function(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}},74853:(t,e,i)=>{var s=i(27119),n=i(15978);t.exports=function(t){var e=n(t);return new s(e.r,e.g,e.b,e.a)}},15978:t=>{t.exports=function(t){return t>16777215?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},53756:(t,e,i)=>{var s=i(42798),n=function(t,e,i,n,r,a,o,h){void 0===o&&(o=100),void 0===h&&(h=0);var l=h/o;return{r:s(t,n,l),g:s(e,r,l),b:s(i,a,l)}};t.exports={RGBWithRGB:n,ColorWithRGB:function(t,e,i,s,r,a){return void 0===r&&(r=100),void 0===a&&(a=0),n(t.r,t.g,t.b,e,i,s,r,a)},ColorWithColor:function(t,e,i,s){return void 0===i&&(i=100),void 0===s&&(s=0),n(t.r,t.g,t.b,e.r,e.g,e.b,i,s)}}},73904:(t,e,i)=>{var s=i(27119);t.exports=function(t){return new s(t.r,t.g,t.b,t.a)}},26841:(t,e,i)=>{var s=i(27119);t.exports=function(t){var e=new s,i=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(t.toLowerCase());if(i){var n=parseInt(i[1],10),r=parseInt(i[2],10),a=parseInt(i[3],10),o=void 0!==i[4]?parseFloat(i[4]):1;e.setTo(n,r,a,255*o)}return e}},68033:t=>{t.exports=function(t,e,i,s){void 0===s&&(s={h:0,s:0,v:0}),t/=255,e/=255,i/=255;var n=Math.min(t,e,i),r=Math.max(t,e,i),a=r-n,o=0,h=0===r?0:a/r,l=r;return r!==n&&(r===t?o=(e-i)/a+(e{var s=i(25409);t.exports=function(t,e,i,n,r){return void 0===n&&(n=255),void 0===r&&(r="#"),"#"===r?"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1,7):"0x"+s(n)+s(t)+s(e)+s(i)}},37243:(t,e,i)=>{var s=i(17489),n=i(27119);t.exports=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=255),new n(s(t,e),s(t,e),s(t,e))}},93222:(t,e,i)=>{var s=i(91487),n=i(74853),r=i(73904),a=i(26841);t.exports=function(t){switch(typeof t){case"string":return"rgb"===t.substr(0,3).toLowerCase()?a(t):s(t);case"number":return n(t);case"object":return r(t)}}},95509:(t,e,i)=>{var s=i(27119);s.ColorSpectrum=i(30245),s.ColorToRGBA=i(86672),s.ComponentToHex=i(25409),s.GetColor=i(22946),s.GetColor32=i(5657),s.HexStringToColor=i(91487),s.HSLToColor=i(74777),s.HSVColorWheel=i(89263),s.HSVToRGB=i(24650),s.HueToComponent=i(59998),s.IntegerToColor=i(74853),s.IntegerToRGB=i(15978),s.Interpolate=i(53756),s.ObjectToColor=i(73904),s.RandomRGB=i(37243),s.RGBStringToColor=i(26841),s.RGBToHSV=i(68033),s.RGBToString=i(4880),s.ValueToColor=i(93222),t.exports=s},24816:(t,e,i)=>{t.exports={Align:i(93545),BaseShader:i(31053),Bounds:i(15252),Canvas:i(23514),Color:i(95509),ColorMatrix:i(65246),Masks:i(93310),RGB:i(39298)}},76756:(t,e,i)=>{var s=i(56694),n=i(97081),r=i(81044),a=new s({initialize:function(t,e){var i=t.sys.renderer;this.renderer=i,this.bitmapMask=e,this.maskTexture=null,this.mainTexture=null,this.dirty=!0,this.mainFramebuffer=null,this.maskFramebuffer=null,this.invertAlpha=!1,this.isStencil=!1,this.scene=t,this.createMask(),t.sys.game.events.on(n.CONTEXT_RESTORED,this.createMask,this),i&&i.on(r.RESIZE,this.createMask,this)},createMask:function(){var t=this.renderer;if(t&&t.gl){this.mainTexture&&this.clearMask();var e=t.width,i=t.height,s=0==(e&e-1)&&0==(i&i-1),n=t.gl,r=s?n.REPEAT:n.CLAMP_TO_EDGE,a=n.LINEAR;this.mainTexture=t.createTexture2D(0,a,a,r,r,n.RGBA,null,e,i),this.maskTexture=t.createTexture2D(0,a,a,r,r,n.RGBA,null,e,i),this.mainFramebuffer=t.createFramebuffer(e,i,this.mainTexture,!0),this.maskFramebuffer=t.createFramebuffer(e,i,this.maskTexture,!0)}},clearMask:function(){var t=this.renderer;t&&t.gl&&this.mainTexture&&(t.deleteTexture(this.mainTexture),t.deleteTexture(this.maskTexture),t.deleteFramebuffer(this.mainFramebuffer),t.deleteFramebuffer(this.maskFramebuffer),this.mainTexture=null,this.maskTexture=null,this.mainFramebuffer=null,this.maskFramebuffer=null)},setBitmap:function(t){this.bitmapMask=t},preRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.beginMask(this,e,i)},postRenderWebGL:function(t,e){t.pipelines.BITMAPMASK_PIPELINE.endMask(this,e)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.clearMask(),this.scene.sys.game.events.off(n.CONTEXT_RESTORED,this.createMask,this),this.renderer&&this.renderer.off(r.RESIZE,this.createMask,this),this.bitmapMask=null,this.prevFramebuffer=null,this.renderer=null}});t.exports=a},63037:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e){this.geometryMask=e,this.invertAlpha=!1,this.isStencil=!0,this.level=0},setShape:function(t){return this.geometryMask=t,this},setInvertAlpha:function(t){return void 0===t&&(t=!0),this.invertAlpha=t,this},preRenderWebGL:function(t,e,i){var s=t.gl;t.flush(),0===t.maskStack.length&&(s.enable(s.STENCIL_TEST),s.clear(s.STENCIL_BUFFER_BIT),t.maskCount=0),t.currentCameraMask.mask!==this&&(t.currentMask.mask=this),t.maskStack.push({mask:this,camera:i}),this.applyStencil(t,i,!0),t.maskCount++},applyStencil:function(t,e,i){var s=t.gl,n=this.geometryMask,r=t.maskCount;s.colorMask(!1,!1,!1,!1),i?(s.stencilFunc(s.EQUAL,r,255),s.stencilOp(s.KEEP,s.KEEP,s.INCR)):(s.stencilFunc(s.EQUAL,r+1,255),s.stencilOp(s.KEEP,s.KEEP,s.DECR)),n.renderWebGL(t,n,e),t.flush(),s.colorMask(!0,!0,!0,!0),s.stencilOp(s.KEEP,s.KEEP,s.KEEP),i?this.invertAlpha?s.stencilFunc(s.NOTEQUAL,r+1,255):s.stencilFunc(s.EQUAL,r+1,255):this.invertAlpha?s.stencilFunc(s.NOTEQUAL,r,255):s.stencilFunc(s.EQUAL,r,255)},postRenderWebGL:function(t){var e=t.gl;t.maskStack.pop(),t.maskCount--,t.flush();var i=t.currentMask;if(0===t.maskStack.length)i.mask=null,e.disable(e.STENCIL_TEST);else{var s=t.maskStack[t.maskStack.length-1];s.mask.applyStencil(t,s.camera,!1),t.currentCameraMask.mask!==s.mask?(i.mask=s.mask,i.camera=s.camera):i.mask=null}},preRenderCanvas:function(t,e,i){var s=this.geometryMask;t.currentContext.save(),s.renderCanvas(t,s,i,null,null,!0),t.currentContext.clip()},postRenderCanvas:function(t){t.currentContext.restore()},destroy:function(){this.geometryMask=null}});t.exports=s},93310:(t,e,i)=>{t.exports={BitmapMask:i(76756),GeometryMask:i(63037)}},31053:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s){e&&""!==e||(e=["precision mediump float;","uniform vec2 resolution;","varying vec2 fragCoord;","void main () {"," vec2 uv = fragCoord / resolution.xy;"," gl_FragColor = vec4(uv.xyx, 1.0);","}"].join("\n")),i&&""!==i||(i=["precision mediump float;","uniform mat4 uProjectionMatrix;","uniform mat4 uViewMatrix;","uniform vec2 uResolution;","attribute vec2 inPosition;","varying vec2 fragCoord;","varying vec2 outTexCoord;","void main () {"," gl_Position = uProjectionMatrix * uViewMatrix * vec4(inPosition, 1.0, 1.0);"," fragCoord = vec2(inPosition.x, uResolution.y - inPosition.y);"," outTexCoord = vec2(inPosition.x / uResolution.x, fragCoord.y / uResolution.y);","}"].join("\n")),void 0===s&&(s=null),this.key=t,this.fragmentSrc=e,this.vertexSrc=i,this.uniforms=s}});t.exports=s},99584:t=>{t.exports=function(t,e){var i;if(e)"string"==typeof e?i=document.getElementById(e):"object"==typeof e&&1===e.nodeType&&(i=e);else if(t.parentElement||null===e)return t;return i||(i=document.body),i.appendChild(t),t}},85178:(t,e,i)=>{var s=i(99584);t.exports=function(t){var e=t.config;if(e.parent&&e.domCreateContainer){var i=document.createElement("div");i.style.cssText=["display: block;","width: "+t.scale.width+"px;","height: "+t.scale.height+"px;","padding: 0; margin: 0;","position: absolute;","overflow: hidden;","pointer-events: "+e.domPointerEvents+";","transform: scale(1);","transform-origin: left top;"].join(" "),t.domContainer=i,s(i,e.parent)}}},21546:(t,e,i)=>{var s=i(36580);t.exports=function(t){if("complete"!==document.readyState&&"interactive"!==document.readyState){var e=function(){document.removeEventListener("deviceready",e,!0),document.removeEventListener("DOMContentLoaded",e,!0),window.removeEventListener("load",e,!0),t()};document.body?s.cordova?document.addEventListener("deviceready",e,!1):(document.addEventListener("DOMContentLoaded",e,!0),window.addEventListener("load",e,!0)):window.setTimeout(e,20)}else t()}},74181:t=>{t.exports=function(t){if(!t)return window.innerHeight;var e=Math.abs(window.orientation),i={w:0,h:0},s=document.createElement("div");return s.setAttribute("style","position: fixed; height: 100vh; width: 0; top: 0"),document.documentElement.appendChild(s),i.w=90===e?s.offsetHeight:window.innerWidth,i.h=90===e?window.innerWidth:s.offsetHeight,document.documentElement.removeChild(s),s=null,90!==Math.abs(window.orientation)?i.h:i.w}},9229:(t,e,i)=>{var s=i(55301);t.exports=function(t,e){var i=window.screen,n=!!i&&(i.orientation||i.mozOrientation||i.msOrientation);return n&&"string"==typeof n.type?n.type:"string"==typeof n?n:"number"==typeof window.orientation?0===window.orientation||180===window.orientation?s.ORIENTATION.PORTRAIT:s.ORIENTATION.LANDSCAPE:window.matchMedia?window.matchMedia("(orientation: portrait)").matches?s.ORIENTATION.PORTRAIT:window.matchMedia("(orientation: landscape)").matches?s.ORIENTATION.LANDSCAPE:void 0:e>t?s.ORIENTATION.PORTRAIT:s.ORIENTATION.LANDSCAPE}},2893:t=>{t.exports=function(t){var e;return""!==t&&("string"==typeof t?e=document.getElementById(t):t&&1===t.nodeType&&(e=t)),e||(e=document.body),e}},89200:t=>{t.exports=function(t){var e="";try{if(window.DOMParser)e=(new DOMParser).parseFromString(t,"text/xml");else(e=new ActiveXObject("Microsoft.XMLDOM")).loadXML(t)}catch(t){e=null}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length?e:null}},55638:t=>{t.exports=function(t){t.parentNode&&t.parentNode.removeChild(t)}},27385:(t,e,i)=>{var s=i(56694),n=i(72283),r=new s({initialize:function(){this.isRunning=!1,this.callback=n,this.isSetTimeOut=!1,this.timeOutID=null,this.delay=0;var t=this;this.step=function e(i){t.callback(i),t.isRunning&&(t.timeOutID=window.requestAnimationFrame(e))},this.stepTimeout=function e(){t.isRunning&&(t.timeOutID=window.setTimeout(e,t.delay)),t.callback(window.performance.now())}},start:function(t,e,i){this.isRunning||(this.callback=t,this.isSetTimeOut=e,this.delay=i,this.isRunning=!0,this.timeOutID=e?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=n}});t.exports=r},3590:(t,e,i)=>{var s={AddToDOM:i(99584),DOMContentLoaded:i(21546),GetInnerHeight:i(74181),GetScreenOrientation:i(9229),GetTarget:i(2893),ParseXML:i(89200),RemoveFromDOM:i(55638),RequestAnimationFrame:i(27385)};t.exports=s},78491:(t,e,i)=>{var s=i(56694),n=i(6659),r=i(91963),a=new s({Extends:n,initialize:function(){n.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});r.register("EventEmitter",a,"events"),t.exports=a},95146:(t,e,i)=>{t.exports={EventEmitter:i(78491)}},88933:(t,e,i)=>{var s=i(95723),n=i(20494);t.exports=function(t,e,i){e.x=n(i,"x",0),e.y=n(i,"y",0),e.depth=n(i,"depth",0),e.flipX=n(i,"flipX",!1),e.flipY=n(i,"flipY",!1);var r=n(i,"scale",null);"number"==typeof r?e.setScale(r):null!==r&&(e.scaleX=n(r,"x",1),e.scaleY=n(r,"y",1));var a=n(i,"scrollFactor",null);"number"==typeof a?e.setScrollFactor(a):null!==a&&(e.scrollFactorX=n(a,"x",1),e.scrollFactorY=n(a,"y",1)),e.rotation=n(i,"rotation",0);var o=n(i,"angle",null);null!==o&&(e.angle=o),e.alpha=n(i,"alpha",1);var h=n(i,"origin",null);if("number"==typeof h)e.setOrigin(h);else if(null!==h){var l=n(h,"x",.5),u=n(h,"y",.5);e.setOrigin(l,u)}return e.blendMode=n(i,"blendMode",s.NORMAL),e.visible=n(i,"visible",!0),n(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},32291:(t,e,i)=>{var s=i(20494);t.exports=function(t,e){var i=s(e,"anims",null);if(null===i)return t;if("string"==typeof i)t.anims.play(i);else if("object"==typeof i){var n=t.anims,r=s(i,"key",void 0);if(r){var a=s(i,"startFrame",void 0),o=s(i,"delay",0),h=s(i,"repeat",0),l=s(i,"repeatDelay",0),u=s(i,"yoyo",!1),c=s(i,"play",!1),d=s(i,"delayedPlay",0),f={key:r,delay:o,repeat:h,repeatDelay:l,yoyo:u,startFrame:a};c?n.play(f):d>0?n.playAfterDelay(f,d):n.load(f)}}return t}},91713:(t,e,i)=>{var s=i(56694),n=i(71207),r=i(91963),a=i(56631),o=i(7599),h=i(17922),l=new s({Extends:n,initialize:function(t){n.call(this,t),this.sortChildrenFlag=!1,this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.events.once(o.BOOT,this.boot,this),this.events.on(o.START,this.start,this)},boot:function(){this.events.once(o.DESTROY,this.destroy,this)},addChildCallback:function(t){t.displayList&&t.displayList!==this&&t.removeFromDisplayList(),t.parentContainer&&t.parentContainer.remove(t),t.displayList||(this.queueDepthSort(),t.displayList=this,t.emit(a.ADDED_TO_SCENE,t,this.scene),this.events.emit(o.ADDED_TO_SCENE,t,this.scene))},removeChildCallback:function(t){this.queueDepthSort(),t.displayList=null,t.emit(a.REMOVED_FROM_SCENE,t,this.scene),this.events.emit(o.REMOVED_FROM_SCENE,t,this.scene)},start:function(){this.events.once(o.SHUTDOWN,this.shutdown,this)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(h(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},getChildren:function(){return this.list},shutdown:function(){for(var t=this.list;t.length;)t[0].destroy(!0);this.events.off(o.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(o.START,this.start,this),this.scene=null,this.systems=null,this.events=null}});r.register("DisplayList",l,"displayList"),t.exports=l},89980:(t,e,i)=>{var s=i(56694),n=i(48129),r=i(81078),a=i(6659),o=i(56631),h=i(7599),l=new s({Extends:a,initialize:function(t,e){a.call(this),this.scene=t,this.displayList=null,this.type=e,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.on(o.ADDED_TO_SCENE,this.addedToScene,this),this.on(o.REMOVED_FROM_SCENE,this.removedFromScene,this),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new r(this)),this},setData:function(t,e){return this.data||(this.data=new r(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new r(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new r(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new r(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(){return this.scene.sys.input.disable(this),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return n(this)},willRender:function(t){return!(!(!this.displayList||!this.displayList.active||this.displayList.willRender(t))||l.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return this.displayList?i.unshift(this.displayList.getIndex(t)):i.unshift(this.scene.sys.displayList.getIndex(t)),i},addToDisplayList:function(t){return void 0===t&&(t=this.scene.sys.displayList),this.displayList&&this.displayList!==t&&this.removeFromDisplayList(),t.exists(this)||(this.displayList=t,t.add(this,!0),t.queueDepthSort(),this.emit(o.ADDED_TO_SCENE,this,this.scene),t.events.emit(h.ADDED_TO_SCENE,this,this.scene)),this},addToUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.add(this),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(o.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(h.REMOVED_FROM_SCENE,this,this.scene)),this},removeFromUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.remove(this),this},destroy:function(t){this.scene&&!this.ignoreDestroy&&(void 0===t&&(t=!1),this.preDestroy&&this.preDestroy.call(this),this.emit(o.DESTROY,this,t),this.removeAllListeners(),this.postPipelines&&this.resetPostPipeline(!0),this.removeFromDisplayList(),this.removeFromUpdateList(),this.input&&(this.scene.sys.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0)}});l.RENDER_MASK=15,t.exports=l},99325:(t,e,i)=>{var s=i(56694),n=i(91963),r=i(7599),a=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(r.BOOT,this.boot,this),this.events.on(r.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(r.DESTROY,this.destroy,this)},start:function(){this.events.once(r.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.events.off(r.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(t,e){a.prototype.hasOwnProperty(t)||(a.prototype[t]=e)},a.remove=function(t){a.prototype.hasOwnProperty(t)&&delete a.prototype[t]},n.register("GameObjectCreator",a,"make"),t.exports=a},61286:(t,e,i)=>{var s=i(56694),n=i(91963),r=i(7599),a=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(r.BOOT,this.boot,this),this.events.on(r.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(r.DESTROY,this.destroy,this)},start:function(){this.events.once(r.SHUTDOWN,this.shutdown,this)},existing:function(t){return(t.renderCanvas||t.renderWebGL)&&this.displayList.add(t),t.preUpdate&&this.updateList.add(t),t},shutdown:function(){this.events.off(r.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(t,e){a.prototype.hasOwnProperty(t)||(a.prototype[t]=e)},a.remove=function(t){a.prototype.hasOwnProperty(t)&&delete a.prototype[t]},n.register("GameObjectFactory",a,"add"),t.exports=a},73329:(t,e,i)=>{var s=i(69360),n=new s,r=new s,a=new s,o={camera:n,sprite:r,calc:a};t.exports=function(t,e,i){var s=n,h=r,l=a;return h.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),s.copyFrom(e.matrix),i?(s.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),h.e=t.x,h.f=t.y):(h.e-=e.scrollX*t.scrollFactorX,h.f-=e.scrollY*t.scrollFactorY),s.multiply(h,l),o}},92034:(t,e,i)=>{var s=i(56694),n=i(74623),r=i(91963),a=i(7599),o=new s({Extends:n,initialize:function(t){n.call(this),this.checkQueue=!0,this.scene=t,this.systems=t.sys,t.sys.events.once(a.BOOT,this.boot,this),t.sys.events.on(a.START,this.start,this)},boot:function(){this.systems.events.once(a.DESTROY,this.destroy,this)},start:function(){var t=this.systems.events;t.on(a.PRE_UPDATE,this.update,this),t.on(a.UPDATE,this.sceneUpdate,this),t.once(a.SHUTDOWN,this.shutdown,this)},sceneUpdate:function(t,e){for(var i=this._active,s=i.length,n=0;n{t.exports=function(t,e,i,s,n,r,a,o,h,l,u,c,d,f,p){var v=i.x-e.displayOriginX+n,g=i.y-e.displayOriginY+r,m=v+i.w,y=g+i.h,x=a.getXRound(v,g,o),T=a.getYRound(v,g,o),w=a.getXRound(v,y,o),E=a.getYRound(v,y,o),S=a.getXRound(m,y,o),b=a.getYRound(m,y,o),A=a.getXRound(m,g,o),_=a.getYRound(m,g,o);t.batchQuad(e,x,T,w,E,S,b,A,_,s.u0,s.v0,s.u1,s.v1,h,l,u,c,d,f,p)}},82173:t=>{t.exports=function(t,e,i,s){if(void 0===i&&(i=!1),void 0===s)return s={local:{x:0,y:0,width:0,height:0},global:{x:0,y:0,width:0,height:0},lines:{shortest:0,longest:0,lengths:null,height:0},wrappedText:"",words:[],characters:[],scaleX:0,scaleY:0};var n,r,a,o,h=t.text,l=h.length,u=t.maxWidth,c=t.wordWrapCharCode,d=Number.MAX_VALUE,f=Number.MAX_VALUE,p=0,v=0,g=t.fontData.chars,m=t.fontData.lineHeight,y=t.letterSpacing,x=0,T=0,w=0,E=null,S=t._align,b=0,A=0,_=t.fontSize/t.fontData.size,C=_*t.scaleX,R=_*t.scaleY,M=null,P=0,O=[],L=Number.MAX_VALUE,F=0,D=0,k=0,I=[],B=[],N=null;if(u>0){for(n=0;nu||V-U>u?(z.push(G.i-1),G.cr?(z.push(G.i+G.word.length),U=0,X=null):X=G):G.cr&&(z.push(G.i+G.word.length),U=0,X=null)}for(n=z.length-1;n>=0;n--)r=h,a=z[n],o="\n",h=r.substr(0,a)+o+r.substr(a+1);s.wrappedText=h,l=h.length,I=[],N=null}var H=0;for(n=0;nb&&(d=b),f>A&&(f=A);var K=b+E.xAdvance,q=A+m;pF&&(F=k),kF&&(F=k),k0)for(var J=0;J{var s=i(31476);t.exports=function(t,e,i,n,r,a,o){var h=t.sys.textures.get(i),l=h.get(n),u=t.sys.cache.xml.get(r);if(l&&u){var c=s(u,l,a,o,h);return t.sys.cache.bitmapFont.add(e,{data:c,texture:i,frame:n,fromAtlas:!0}),!0}return!1}},39860:(t,e,i)=>{var s=i(10850);t.exports=function(t,e){var i=e.width,n=e.height,r=Math.floor(i/2),a=Math.floor(n/2),o=s(e,"chars","");if(""!==o){var h=s(e,"image",""),l=t.sys.textures.getFrame(h),u=l.cutX,c=l.cutY,d=l.source.width,f=l.source.height,p=s(e,"offset.x",0),v=s(e,"offset.y",0),g=s(e,"spacing.x",0),m=s(e,"spacing.y",0),y=s(e,"lineSpacing",0),x=s(e,"charsPerRow",null);null===x&&(x=d/i)>o.length&&(x=o.length);for(var T=p,w=v,E={retroFont:!0,font:h,size:i,lineHeight:n+y,chars:{}},S=0,b=0;b{function e(t,e){return parseInt(t.getAttribute(e),10)}t.exports=function(t,i,s,n,r){void 0===s&&(s=0),void 0===n&&(n=0);var a=i.cutX,o=i.cutY,h=i.source.width,l=i.source.height,u=i.sourceIndex,c={},d=t.getElementsByTagName("info")[0],f=t.getElementsByTagName("common")[0];c.font=d.getAttribute("face"),c.size=e(d,"size"),c.lineHeight=e(f,"lineHeight")+n,c.chars={};var p=t.getElementsByTagName("char"),v=void 0!==i&&i.trimmed;if(v)var g=i.height,m=i.width;for(var y=0;y{var s=i(66863),n=i(98611),r={Parse:i(39860)};r=n(!1,r,s),t.exports=r},66863:t=>{t.exports={TEXT_SET1:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},13468:(t,e,i)=>{var s=i(44616),n=i(56694),r=i(88899),a=new n({Extends:s,Mixins:[r],initialize:function(t,e,i,n,r,a,o){s.call(this,t,e,i,n,r,a,o),this.type="DynamicBitmapText",this.scrollX=0,this.scrollY=0,this.cropWidth=0,this.cropHeight=0,this.displayCallback,this.callbackData={parent:this,color:0,tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:0,charCode:0,x:0,y:0,scale:0,rotation:0,data:0}},setSize:function(t,e){return this.cropWidth=t,this.cropHeight=e,this},setDisplayCallback:function(t){return this.displayCallback=t,this},setScrollX:function(t){return this.scrollX=t,this},setScrollY:function(t){return this.scrollY=t,this}});t.exports=a},93438:(t,e,i)=>{var s=i(49584);t.exports=function(t,e,i,n){var r=e._text,a=r.length,o=t.currentContext;if(0!==a&&s(t,o,e,i,n)){i.addToRenderList(e);var h=e.fromAtlas?e.frame:e.texture.frames.__BASE,l=e.displayCallback,u=e.callbackData,c=e.fontData.chars,d=e.fontData.lineHeight,f=e._letterSpacing,p=0,v=0,g=0,m=null,y=0,x=0,T=0,w=0,E=0,S=0,b=null,A=0,_=e.frame.source.image,C=h.cutX,R=h.cutY,M=0,P=0,O=e._fontSize/e.fontData.size,L=e._align,F=0,D=0;e.getTextBounds(!1);var k=e._bounds.lines;1===L?D=(k.longest-k.lengths[0])/2:2===L&&(D=k.longest-k.lengths[0]),o.translate(-e.displayOriginX,-e.displayOriginY);var I=i.roundPixels;e.cropWidth>0&&e.cropHeight>0&&(o.beginPath(),o.rect(0,0,e.cropWidth,e.cropHeight),o.clip());for(var B=0;B{var s=i(13468),n=i(88933),r=i(99325),a=i(20494);r.register("dynamicBitmapText",(function(t,e){void 0===t&&(t={});var i=a(t,"font",""),r=a(t,"text",""),o=a(t,"size",!1),h=new s(this.scene,0,0,i,r,o);return void 0!==e&&(t.add=e),n(this.scene,h,t),h}))},94145:(t,e,i)=>{var s=i(13468);i(61286).register("dynamicBitmapText",(function(t,e,i,n,r){return this.displayList.add(new s(this.scene,t,e,i,n,r))}))},88899:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(16873),r=i(93438),t.exports={renderWebGL:n,renderCanvas:r}},16873:(t,e,i)=>{var s=i(73329),n=i(69360),r=i(75512),a=new n;t.exports=function(t,e,i,n){var o=e.text,h=o.length;if(0!==h){i.addToRenderList(e);var l=t.pipelines.set(e.pipeline,e),u=s(e,i,n),c=u.sprite,d=u.calc,f=a,p=e.cropWidth>0||e.cropHeight>0;p&&(l.flush(),t.pushScissor(d.tx,d.ty,e.cropWidth*d.scaleX,e.cropHeight*d.scaleY));var v,g,m=e.frame.glTexture,y=e.tintFill,x=r.getTintAppendFloatAlpha(e.tintTopLeft,i.alpha*e._alphaTL),T=r.getTintAppendFloatAlpha(e.tintTopRight,i.alpha*e._alphaTR),w=r.getTintAppendFloatAlpha(e.tintBottomLeft,i.alpha*e._alphaBL),E=r.getTintAppendFloatAlpha(e.tintBottomRight,i.alpha*e._alphaBR),S=l.setGameObject(e),b=0,A=0,_=0,C=0,R=e.letterSpacing,M=0,P=0,O=e.scrollX,L=e.scrollY,F=e.fontData,D=F.chars,k=F.lineHeight,I=e.fontSize/F.size,B=0,N=e._align,Y=0,X=0,U=e.getTextBounds(!1);e.maxWidth>0&&(h=(o=U.wrappedText).length);var z=e._bounds.lines;1===N?X=(z.longest-z.lengths[0])/2:2===N&&(X=z.longest-z.lengths[0]);var G=i.roundPixels,W=e.displayCallback,V=e.callbackData;t.pipelines.preBatch(e);for(var H=0;H{var s=i(56694),n=i(82897),r=i(64937),a=i(89980),o=i(82173),h=i(68298),l=i(31476),u=i(74118),c=i(84557),d=new s({Extends:a,Mixins:[r.Alpha,r.BlendMode,r.Depth,r.Mask,r.Origin,r.Pipeline,r.ScrollFactor,r.Texture,r.Tint,r.Transform,r.Visible,c],initialize:function(t,e,i,s,n,r,h){void 0===n&&(n=""),void 0===h&&(h=0),a.call(this,t,"BitmapText"),this.font=s;var l=this.scene.sys.cache.bitmapFont.get(s);l||console.warn("Invalid BitmapText key: "+s),this.fontData=l.data,this._text="",this._fontSize=r||this.fontData.size,this._letterSpacing=0,this._align=h,this._bounds=o(),this._dirty=!0,this._maxWidth=0,this.wordWrapCharCode=32,this.charColors=[],this.dropShadowX=0,this.dropShadowY=0,this.dropShadowColor=0,this.dropShadowAlpha=.5,this.fromAtlas=l.fromAtlas,this.setTexture(l.texture,l.frame),this.setPosition(e,i),this.setOrigin(0,0),this.initPipeline(),this.setText(n)},setLeftAlign:function(){return this._align=d.ALIGN_LEFT,this._dirty=!0,this},setCenterAlign:function(){return this._align=d.ALIGN_CENTER,this._dirty=!0,this},setRightAlign:function(){return this._align=d.ALIGN_RIGHT,this._dirty=!0,this},setFontSize:function(t){return this._fontSize=t,this._dirty=!0,this},setLetterSpacing:function(t){return void 0===t&&(t=0),this._letterSpacing=t,this._dirty=!0,this},setText:function(t){return t||0===t||(t=""),Array.isArray(t)&&(t=t.join("\n")),t!==this.text&&(this._text=t.toString(),this._dirty=!0,this.updateDisplayOrigin()),this},setDropShadow:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=.5),this.dropShadowX=t,this.dropShadowY=e,this.dropShadowColor=i,this.dropShadowAlpha=s,this},setCharacterTint:function(t,e,i,s,r,a,o){void 0===t&&(t=0),void 0===e&&(e=1),void 0===i&&(i=!1),void 0===s&&(s=-1),void 0===r&&(r=s,a=s,o=s);var h=this.text.length;-1===e&&(e=h),t<0&&(t=h+t),t=n(t,0,h-1);for(var l=n(t+e,t,h),u=this.charColors,c=t;c{var s=i(49584);t.exports=function(t,e,i,n){var r=e._text,a=r.length,o=t.currentContext;if(0!==a&&s(t,o,e,i,n)){i.addToRenderList(e);var h=e.fromAtlas?e.frame:e.texture.frames.__BASE,l=e.fontData.chars,u=e.fontData.lineHeight,c=e._letterSpacing,d=0,f=0,p=0,v=null,g=0,m=0,y=0,x=0,T=0,w=0,E=null,S=0,b=h.source.image,A=h.cutX,_=h.cutY,C=e._fontSize/e.fontData.size,R=e._align,M=0,P=0,O=e.getTextBounds(!1);e.maxWidth>0&&(a=(r=O.wrappedText).length);var L=e._bounds.lines;1===R?P=(L.longest-L.lengths[0])/2:2===R&&(P=L.longest-L.lengths[0]),o.translate(-e.displayOriginX,-e.displayOriginY);for(var F=i.roundPixels,D=0;D{var s=i(44616),n=i(88933),r=i(99325),a=i(20494),o=i(10850);r.register("bitmapText",(function(t,e){void 0===t&&(t={});var i=o(t,"font",""),r=a(t,"text",""),h=a(t,"size",!1),l=o(t,"align",0),u=new s(this.scene,0,0,i,r,h,l);return void 0!==e&&(t.add=e),n(this.scene,u,t),u}))},21797:(t,e,i)=>{var s=i(44616);i(61286).register("bitmapText",(function(t,e,i,n,r,a){return this.displayList.add(new s(this.scene,t,e,i,n,r,a))}))},84557:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(26372),r=i(97545),t.exports={renderWebGL:n,renderCanvas:r}},26372:(t,e,i)=>{var s=i(8810),n=i(73329),r=i(75512);t.exports=function(t,e,i,a){if(0!==e._text.length){i.addToRenderList(e);var o,h,l,u=t.pipelines.set(e.pipeline,e),c=n(e,i,a).calc,d=i.roundPixels,f=i.alpha,p=e.charColors,v=e.tintFill,g=r.getTintAppendFloatAlpha,m=g(e.tintTopLeft,f*e._alphaTL),y=g(e.tintTopRight,f*e._alphaTR),x=g(e.tintBottomLeft,f*e._alphaBL),T=g(e.tintBottomRight,f*e._alphaBR),w=e.frame.glTexture,E=u.setGameObject(e),S=e.getTextBounds(!1).characters,b=e.dropShadowX,A=e.dropShadowY,_=0!==b||0!==A;if(t.pipelines.preBatch(e),_){var C=e.dropShadowColor,R=e.dropShadowAlpha,M=g(C,f*R*e._alphaTL),P=g(C,f*R*e._alphaTR),O=g(C,f*R*e._alphaBL),L=g(C,f*R*e._alphaBR);for(o=0;o{var s=i(92246),n=i(41664),r=i(56694),a=i(64937),o=i(82047),h=i(89980),l=i(71207),u=new r({Extends:h,Mixins:[a.Alpha,a.BlendMode,a.Depth,a.Mask,a.Pipeline,a.ScrollFactor,a.Size,a.Texture,a.Transform,a.Visible,s],initialize:function(t,e,i,s,n){h.call(this,t,"Blitter"),this.setTexture(s,n),this.setPosition(e,i),this.initPipeline(),this.children=new l,this.renderList=[],this.dirty=!1},create:function(t,e,i,s,r){void 0===s&&(s=!0),void 0===r&&(r=this.children.length),void 0===i?i=this.frame:i instanceof o||(i=this.texture.get(i));var a=new n(this,t,e,i,s);return this.children.addAt(a,r,!1),this.dirty=!0,a},createFromCallback:function(t,e,i,s){for(var n=this.createMultiple(e,i,s),r=0;r0},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(){this.children.removeAll(),this.dirty=!0},preDestroy:function(){this.children.destroy(),this.renderList=[]}});t.exports=u},33177:t=>{t.exports=function(t,e,i,s){var n=e.getRenderList();if(0!==n.length){var r=t.currentContext,a=i.alpha*e.alpha;if(0!==a){i.addToRenderList(e),r.globalCompositeOperation=t.blendModes[e.blendMode],r.imageSmoothingEnabled=!e.frame.source.scaleMode;var o=e.x-i.scrollX*e.scrollFactorX,h=e.y-i.scrollY*e.scrollFactorY;r.save(),s&&s.copyToContext(r);for(var l=i.roundPixels,u=0;u0&&p.height>0&&(r.save(),r.translate(c.x+o,c.y+h),r.scale(m,y),r.drawImage(f.source.image,p.x,p.y,p.width,p.height,v,g,p.width,p.height),r.restore())):(l&&(v=Math.round(v),g=Math.round(g)),p.width>0&&p.height>0&&r.drawImage(f.source.image,p.x,p.y,p.width,p.height,v+c.x+o,g+c.y+h,p.width,p.height)))}r.restore()}}}},68452:(t,e,i)=>{var s=i(52816),n=i(88933),r=i(99325),a=i(20494);r.register("blitter",(function(t,e){void 0===t&&(t={});var i=a(t,"key",null),r=a(t,"frame",null),o=new s(this.scene,0,0,i,r);return void 0!==e&&(t.add=e),n(this.scene,o,t),o}))},38906:(t,e,i)=>{var s=i(52816);i(61286).register("blitter",(function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))}))},92246:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(89165),r=i(33177),t.exports={renderWebGL:n,renderCanvas:r}},89165:(t,e,i)=>{var s=i(69360),n=i(75512),r=new s;t.exports=function(t,e,i,s){var a=e.getRenderList();if(0!==a.length){var o=i.alpha*e.alpha;if(0!==o){i.addToRenderList(e);var h=t.pipelines.set(this.pipeline,e),l=i.scrollX*e.scrollFactorX,u=i.scrollY*e.scrollFactorY,c=r.copyFrom(i.matrix);s&&(c.multiplyWithOffset(s,-l,-u),l=0,u=0);var d=e.x-l,f=e.y-u,p=-1,v=i.roundPixels;t.pipelines.preBatch(e);for(var g=0;g{var s=i(56694),n=i(82047),r=new s({initialize:function(t,e,i,s,n){this.parent=t,this.x=e,this.y=i,this.frame=s,this.data={},this.tint=16777215,this._visible=n,this._alpha=1,this.flipX=!1,this.flipY=!1},setFrame:function(t){return void 0===t?this.frame=this.parent.frame:t instanceof n&&t.texture===this.parent.texture?this.frame=t:this.frame=this.parent.texture.get(t),this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this},reset:function(t,e,i){return this.x=t,this.y=e,this.flipX=!1,this.flipY=!1,this._alpha=1,this._visible=!0,this.parent.dirty=!0,i&&this.setFrame(i),this},setPosition:function(t,e){return this.x=t,this.y=e,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},setVisible:function(t){return this.visible=t,this},setAlpha:function(t){return this.alpha=t,this},setTint:function(t){return this.tint=t,this},destroy:function(){this.parent.dirty=!0,this.parent.children.remove(this),this.parent=void 0,this.frame=void 0,this.data=void 0},visible:{get:function(){return this._visible},set:function(t){this.parent.dirty|=this._visible!==t,this._visible=t}},alpha:{get:function(){return this._alpha},set:function(t){this.parent.dirty|=this._alpha>0!=t>0,this._alpha=t}}});t.exports=r},97123:(t,e,i)=>{var s=i(82897),n={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,n){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=s(t,0,1),this._alphaTR=s(e,0,1),this._alphaBL=s(i,0,1),this._alphaBR=s(n,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=s(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=s(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=s(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=s(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=n},15720:(t,e,i)=>{var s=i(82897),n={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t){return void 0===t&&(t=1),this.alpha=t,this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}}};t.exports=n},69732:(t,e,i)=>{var s=i(95723),n={_blendMode:s.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=s[t]),(t|=0)>=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=n},28284:t=>{t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},85293:t=>{var e={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,s){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,s,this.flipX,this.flipY);else{var n=t;this.frame.setCropUVs(this._crop,n.x,n.y,n.width,n.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=e},14975:t=>{var e={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.displayList&&this.displayList.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=e},88677:t=>{var e={fxPadding:0,setFXPadding:function(t){return void 0===t&&(t=0),this.fxPadding=t,this},onFXCopy:function(){},onFX:function(){}};t.exports=e},92972:t=>{t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},80693:(t,e,i)=>{var s=i(74118),n=i(2386),r=i(93736),a={prepareBoundsOutput:function(t,e){(void 0===e&&(e=!1),0!==this.rotation&&n(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getCenter:function(t){return void 0===t&&(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,t},getTopLeft:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopRight:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getLeftCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getRightCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getBottomLeft:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomRight:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBounds:function(t){var e,i,n,r,a,o,h,l;if(void 0===t&&(t=new s),this.parentContainer){var u=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(t),u.transformPoint(t.x,t.y,t),e=t.x,i=t.y,this.getTopRight(t),u.transformPoint(t.x,t.y,t),n=t.x,r=t.y,this.getBottomLeft(t),u.transformPoint(t.x,t.y,t),a=t.x,o=t.y,this.getBottomRight(t),u.transformPoint(t.x,t.y,t),h=t.x,l=t.y}else this.getTopLeft(t),e=t.x,i=t.y,this.getTopRight(t),n=t.x,r=t.y,this.getBottomLeft(t),a=t.x,o=t.y,this.getBottomRight(t),h=t.x,l=t.y;return t.x=Math.min(e,n,a,h),t.y=Math.min(i,r,o,l),t.width=Math.max(e,n,a,h)-t.x,t.height=Math.max(i,r,o,l)-t.y,t}};t.exports=a},39171:(t,e,i)=>{var s=i(76756),n=i(63037),r={mask:null,setMask:function(t){return this.mask=t,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},createBitmapMask:function(t){return void 0===t&&(this.texture||this.shader)&&(t=this),new s(this.scene,t)},createGeometryMask:function(t){return void 0===t&&(this instanceof Phaser.GameObjects.Graphics||this instanceof Phaser.GameObjects.Shape)&&(t=this),new n(this.scene,t)}};t.exports=r},28072:t=>{var e={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(t){this._displayOriginX=t,this.originX=t/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(t){this._displayOriginY=t,this.originY=t/this.height}},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this.updateDisplayOrigin()},setOriginFromFrame:function(){return this.frame&&this.frame.customPivot?(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin()):this.setOrigin()},setDisplayOrigin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displayOriginX=t,this.displayOriginY=e,this},updateDisplayOrigin:function(){return this._displayOriginX=this.originX*this.width,this._displayOriginY=this.originY*this.height,this}};t.exports=e},54211:(t,e,i)=>{var s=i(75606),n=i(63130),r=i(10850),a=i(55303),o=i(93736),h={path:null,rotateToPath:!1,pathRotationOffset:0,pathOffset:null,pathVector:null,pathDelta:null,pathTween:null,pathConfig:null,_prevDirection:a.PLAYING_FORWARD,setPath:function(t,e){void 0===e&&(e=this.pathConfig);var i=this.pathTween;return i&&i.isPlaying()&&i.stop(),this.path=t,e&&this.startFollow(e),this},setRotateToPath:function(t,e){return void 0===e&&(e=0),this.rotateToPath=t,this.pathRotationOffset=e,this},isFollowing:function(){var t=this.pathTween;return t&&t.isPlaying()},startFollow:function(t,e){void 0===t&&(t={}),void 0===e&&(e=0);var i=this.pathTween;i&&i.isPlaying()&&i.stop(),"number"==typeof t&&(t={duration:t}),t.from=r(t,"from",0),t.to=r(t,"to",1);var h=n(t,"positionOnPath",!1);this.rotateToPath=n(t,"rotateToPath",!1),this.pathRotationOffset=r(t,"rotationOffset",0);var l=r(t,"startAt",e);if(l&&(t.onStart=function(t){var e=t.data[0];e.progress=l,e.elapsed=e.duration*l;var i=e.ease(e.progress);e.current=e.start+(e.end-e.start)*i,e.target[e.key]=e.current}),this.pathOffset||(this.pathOffset=new o(this.x,this.y)),this.pathVector||(this.pathVector=new o),this.pathDelta||(this.pathDelta=new o),this.pathDelta.reset(),this.pathTween=this.scene.sys.tweens.addCounter(t),this.path.getStartPoint(this.pathOffset),h&&(this.x=this.pathOffset.x,this.y=this.pathOffset.y),this.pathOffset.x=this.x-this.pathOffset.x,this.pathOffset.y=this.y-this.pathOffset.y,this._prevDirection=a.PLAYING_FORWARD,this.rotateToPath){var u=this.path.getPoint(.1);this.rotation=Math.atan2(u.y-this.y,u.x-this.x)+s(this.pathRotationOffset)}return this.pathConfig=t,this},pauseFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.pause(),this},resumeFollow:function(){var t=this.pathTween;return t&&t.isPaused()&&t.resume(),this},stopFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.stop(),this},pathUpdate:function(){var t=this.pathTween;if(t){var e=t.data[0],i=this.pathDelta,n=this.pathVector;if(i.copy(n).negate(),e.state===a.COMPLETE)return this.path.getPoint(e.end,n),i.add(n),n.add(this.pathOffset),void this.setPosition(n.x,n.y);if(e.state!==a.PLAYING_FORWARD&&e.state!==a.PLAYING_BACKWARD)return;this.path.getPoint(t.getValue(),n),i.add(n),n.add(this.pathOffset);var r=this.x,o=this.y;this.setPosition(n.x,n.y);var h=this.x-r,l=this.y-o;if(0===h&&0===l)return;if(e.state!==this._prevDirection)return void(this._prevDirection=e.state);this.rotateToPath&&(this.rotation=Math.atan2(l,h)+s(this.pathRotationOffset))}}};t.exports=h},58210:(t,e,i)=>{var s=i(28699),n=i(65641),r=i(72677),a={defaultPipeline:null,pipeline:null,hasPostPipeline:!1,postPipelines:null,pipelineData:null,initPipeline:function(t){void 0===t&&(t=n.MULTI_PIPELINE);var e=this.scene.sys.renderer;if(!e)return!1;var i=e.pipelines;if(this.postPipelines=[],this.pipelineData={},i){var s=i.get(t);if(s)return this.defaultPipeline=s,this.pipeline=s,!0}return!1},setPipeline:function(t,e,i){var n=this.scene.sys.renderer;if(!n)return this;var r=n.pipelines;if(r){var a=r.get(t);a&&(this.pipeline=a),e&&(this.pipelineData=i?s(e):e)}return this},setPostPipeline:function(t,e,i){var n=this.scene.sys.renderer;if(!n)return this;var r=n.pipelines;if(r){Array.isArray(t)||(t=[t]);for(var a=0;a0,this},setPipelineData:function(t,e){var i=this.pipelineData;return void 0===e?delete i[t]:i[t]=e,this},getPostPipeline:function(t){for(var e=this.postPipelines,i=[],s=0;s=0;i--){var s=e[i];("string"==typeof t&&s.name===t||"string"!=typeof t&&s instanceof t)&&(s.destroy(),r(e,i))}return this.hasPostPipeline=this.postPipelines.length>0,this},getPipelineName:function(){return this.pipeline.name}};t.exports=a},45900:t=>{var e={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=e},31654:t=>{var e={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return Math.abs(this.scaleX*this.frame.realWidth)},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return Math.abs(this.scaleY*this.frame.realHeight)},set:function(t){this.scaleY=t/this.frame.realHeight}},setSizeToFrame:function(t){void 0===t&&(t=this.frame),this.width=t.realWidth,this.height=t.realHeight;var e=this.input;return e&&!e.customHitArea&&(e.hitArea.width=this.width,e.hitArea.height=this.height),this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}};t.exports=e},82081:t=>{var e={texture:null,frame:null,isCropped:!1,setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};t.exports=e},21850:t=>{var e={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,s){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,s,this.flipX,this.flipY);else{var n=t;this.frame.setCropUVs(this._crop,n.x,n.y,n.width,n.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=e},58072:t=>{var e={tintTopLeft:16777215,tintTopRight:16777215,tintBottomLeft:16777215,tintBottomRight:16777215,tintFill:!1,clearTint:function(){return this.setTint(16777215),this},setTint:function(t,e,i,s){return void 0===t&&(t=16777215),void 0===e&&(e=t,i=t,s=t),this.tintTopLeft=t,this.tintTopRight=e,this.tintBottomLeft=i,this.tintBottomRight=s,this.tintFill=!1,this},setTintFill:function(t,e,i,s){return this.setTint(t,e,i,s),this.tintFill=!0,this},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){var t=16777215;return this.tintFill||this.tintTopLeft!==t||this.tintTopRight!==t||this.tintBottomLeft!==t||this.tintBottomRight!==t}}};t.exports=e},48129:t=>{t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},56584:(t,e,i)=>{var s=i(83392),n=i(69360),r=i(64462),a=i(35786),o=i(62138),h=i(93736),l={hasTransformComponent:!0,_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(t){this._scaleX=t,this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},angle:{get:function(){return o(this._rotation*s.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*s.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=a(t)}},setPosition:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===s&&(s=0),this.x=t,this.y=e,this.z=i,this.w=s,this},copyPosition:function(t){return void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.z&&(this.z=t.z),void 0!==t.w&&(this.w=t.w),this},setRandomPosition:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===s&&(s=this.scene.sys.scale.height),this.x=t+Math.random()*i,this.y=e+Math.random()*s,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new n),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new n),void 0===e&&(e=new n);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);for(t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return t},getLocalPoint:function(t,e,i,s){i||(i=new h),s||(s=this.scene.sys.cameras.main);var n=s.scrollX,a=s.scrollY,o=t+n*this.scrollFactorX-n,l=e+a*this.scrollFactorY-a;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(o,l,i):r(o,l,this.x,this.y,this.rotation,this.scaleX,this.scaleY,i),this._originComponent&&(i.x+=this._displayOriginX,i.y+=this._displayOriginY),i},getParentRotation:function(){for(var t=0,e=this.parentContainer;e;)t+=e.rotation,e=e.parentContainer;return t}};t.exports=l},69360:(t,e,i)=>{var s=i(56694),n=i(83392),r=i(93736),a=new s({initialize:function(t,e,i,s,n,r){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=1),void 0===n&&(n=0),void 0===r&&(r=0),this.matrix=new Float32Array([t,e,i,s,n,r,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0}},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var t=this.matrix,e=t[0],i=t[1],s=t[2],r=t[3];return e||i?i>0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):s||r?n.TAU-(r>0?Math.acos(-s/this.scaleY):-Math.acos(s/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),s=this.matrix,n=s[0],r=s[1],a=s[2],o=s[3];return s[0]=n*i+a*e,s[1]=r*i+o*e,s[2]=n*-e+a*i,s[3]=r*-e+o*i,this},multiply:function(t,e){var i=this.matrix,s=t.matrix,n=i[0],r=i[1],a=i[2],o=i[3],h=i[4],l=i[5],u=s[0],c=s[1],d=s[2],f=s[3],p=s[4],v=s[5],g=void 0===e?this:e;return g.a=u*n+c*a,g.b=u*r+c*o,g.c=d*n+f*a,g.d=d*r+f*o,g.e=p*n+v*a+h,g.f=p*r+v*o+l,g},multiplyWithOffset:function(t,e,i){var s=this.matrix,n=t.matrix,r=s[0],a=s[1],o=s[2],h=s[3],l=e*r+i*o+s[4],u=e*a+i*h+s[5],c=n[0],d=n[1],f=n[2],p=n[3],v=n[4],g=n[5];return s[0]=c*r+d*o,s[1]=c*a+d*h,s[2]=f*r+p*o,s[3]=f*a+p*h,s[4]=v*r+g*o+l,s[5]=v*a+g*h+u,this},transform:function(t,e,i,s,n,r){var a=this.matrix,o=a[0],h=a[1],l=a[2],u=a[3],c=a[4],d=a[5];return a[0]=t*o+e*l,a[1]=t*h+e*u,a[2]=i*o+s*l,a[3]=i*h+s*u,a[4]=n*o+r*l+c,a[5]=n*h+r*u+d,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var s=this.matrix,n=s[0],r=s[1],a=s[2],o=s[3],h=s[4],l=s[5];return i.x=t*n+e*a+h,i.y=t*r+e*o+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=e*n-i*s;return t[0]=n/o,t[1]=-i/o,t[2]=-s/o,t[3]=e/o,t[4]=(s*a-n*r)/o,t[5]=-(e*a-i*r)/o,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){var e=this.matrix;return t.setTransform(e[0],e[1],e[2],e[3],e[4],e[5]),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,s,n,r){var a=this.matrix;return a[0]=t,a[1]=e,a[2]=i,a[3]=s,a[4]=n,a[5]=r,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],s=e[1],n=e[2],r=e[3],a=i*r-s*n;if(t.translateX=e[4],t.translateY=e[5],i||s){var o=Math.sqrt(i*i+s*s);t.rotation=s>0?Math.acos(i/o):-Math.acos(i/o),t.scaleX=o,t.scaleY=a/o}else if(n||r){var h=Math.sqrt(n*n+r*r);t.rotation=.5*Math.PI-(r>0?Math.acos(-n/h):-Math.acos(n/h)),t.scaleX=a/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,i,s,n){var r=this.matrix,a=Math.sin(i),o=Math.cos(i);return r[4]=t,r[5]=e,r[0]=o*s,r[1]=a*s,r[2]=-a*n,r[3]=o*n,this},applyInverse:function(t,e,i){void 0===i&&(i=new r);var s=this.matrix,n=s[0],a=s[1],o=s[2],h=s[3],l=s[4],u=s[5],c=1/(n*h+o*-a);return i.x=h*c*t+-o*c*e+(u*o-l*h)*c,i.y=n*c*e+-a*c*t+(-u*n+l*a)*c,i},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getXRound:function(t,e,i){var s=this.getX(t,e);return i&&(s=Math.round(s)),s},getYRound:function(t,e,i){var s=this.getY(t,e);return i&&(s=Math.round(s)),s},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.decomposedMatrix=null}});t.exports=a},59694:t=>{var e={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=e},64937:(t,e,i)=>{t.exports={Alpha:i(97123),AlphaSingle:i(15720),BlendMode:i(69732),ComputedSize:i(28284),Crop:i(85293),Depth:i(14975),Flip:i(92972),FX:i(88677),GetBounds:i(80693),Mask:i(39171),Origin:i(28072),PathFollower:i(54211),Pipeline:i(58210),ScrollFactor:i(45900),Size:i(31654),Texture:i(82081),TextureCrop:i(21850),Tint:i(58072),ToJSON:i(48129),Transform:i(56584),TransformMatrix:i(69360),Visible:i(59694)}},70339:(t,e,i)=>{var s=i(59959),n=i(95723),r=i(56694),a=i(64937),o=i(56631),h=i(89980),l=i(74118),u=i(98524),c=i(58795),d=i(93736),f=new r({Extends:h,Mixins:[a.AlphaSingle,a.BlendMode,a.ComputedSize,a.Depth,a.Mask,a.Pipeline,a.Transform,a.Visible,u],initialize:function(t,e,i,s){h.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new a.TransformMatrix,this.tempTransformMatrix=new a.TransformMatrix,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.initPipeline(),this.setPosition(e,i),this.clearAlpha(),this.setBlendMode(n.SKIP_CHECK),s&&this.add(s)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new l),t.setTo(this.x,this.y,0,0),this.parentContainer){var e=this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x,this.y);t.setTo(e.x,e.y,0,0)}if(this.list.length>0){var i=this.list,s=new l,n=!1;t.setEmpty();for(var r=0;r-1},setAll:function(t,e,i,n){return s.SetAll(this.list,t,e,i,n),this},each:function(t,e){var i,s=[null],n=this.list.slice(),r=n.length;for(i=2;i0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[]}});t.exports=f},13916:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e);var n=e.list;if(0!==n.length){var r=e.localTransform;s?(r.loadIdentity(),r.multiply(s),r.translate(e.x,e.y),r.rotate(e.rotation),r.scale(e.scaleX,e.scaleY)):r.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var a=-1!==e.blendMode;a||t.setBlendMode(0);var o=e._alpha,h=e.scrollFactorX,l=e.scrollFactorY;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var u=0;u{var s=i(88933),n=i(70339),r=i(99325),a=i(20494);r.register("container",(function(t,e){void 0===t&&(t={});var i=a(t,"x",0),r=a(t,"y",0),o=a(t,"children",null),h=new n(this.scene,i,r,o);return void 0!==e&&(t.add=e),s(this.scene,h,t),h}))},23400:(t,e,i)=>{var s=i(70339);i(61286).register("container",(function(t,e,i){return this.displayList.add(new s(this.scene,t,e,i))}))},98524:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(36934),r=i(13916),t.exports={renderWebGL:n,renderCanvas:r}},36934:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e);var n=e.list,r=n.length;if(0!==r){var a=e.localTransform;s?(a.loadIdentity(),a.multiply(s),a.translate(e.x,e.y),a.rotate(e.rotation),a.scale(e.scaleX,e.scaleY)):a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),t.pipelines.preBatch(e);var o=-1!==e.blendMode;o||t.setBlendMode(0);for(var h=e.alpha,l=e.scrollFactorX,u=e.scrollFactorY,c=0;c{t.exports=["normal","multiply","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]},38943:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(11603),a=i(89980),o=i(42911),h=i(55638),l=i(7599),u=i(51729),c=new s({Extends:a,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Origin,n.ScrollFactor,n.Transform,n.Visible,r],initialize:function(t,e,i,s,n,r){a.call(this,t,"DOMElement"),this.parent=t.sys.game.domContainer,this.cache=t.sys.cache.html,this.node,this.transformOnly=!1,this.skewX=0,this.skewY=0,this.rotate3d=new u,this.rotate3dAngle="deg",this.pointerEvents="auto",this.width=0,this.height=0,this.displayWidth=0,this.displayHeight=0,this.handler=this.dispatchNativeEvent.bind(this),this.setPosition(e,i),"string"==typeof s?"#"===s[0]?this.setElement(s.substr(1),n,r):this.createElement(s,n,r):s&&this.setElement(s,n,r),t.sys.events.on(l.SLEEP,this.handleSceneEvent,this),t.sys.events.on(l.WAKE,this.handleSceneEvent,this),t.sys.events.on(l.PRE_RENDER,this.preRender,this)},handleSceneEvent:function(t){var e=this.node,i=e.style;e&&(i.display=t.settings.visible?"block":"none")},setSkew:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.skewX=t,this.skewY=e,this},setPerspective:function(t){return this.parent.style.perspective=t+"px",this},perspective:{get:function(){return parseFloat(this.parent.style.perspective)},set:function(t){this.parent.style.perspective=t+"px"}},addListener:function(t){if(this.node){t=t.split(" ");for(var e=0;e{var s=i(2452),n=i(89980),r=i(69360),a=new r,o=new r,h=new r;t.exports=function(t,e,i,r){if(e.node){var l=e.node.style,u=e.scene.sys.settings;if(!l||!u.visible||n.RENDER_MASK!==e.renderFlags||0!==e.cameraFilter&&e.cameraFilter&i.id||e.parentContainer&&!e.parentContainer.willRender())l.display="none";else{var c=e.parentContainer,d=i.alpha*e.alpha;c&&(d*=c.alpha);var f=a,p=o,v=h,g=0,m=0,y="0%",x="0%";r?(g=e.width*e.scaleX*e.originX,m=e.height*e.scaleY*e.originY,p.applyITRS(e.x-g,e.y-m,e.rotation,e.scaleX,e.scaleY),f.copyFrom(i.matrix),f.multiplyWithOffset(r,-i.scrollX*e.scrollFactorX,-i.scrollY*e.scrollFactorY),p.e=e.x-g,p.f=e.y-m,f.multiply(p,v)):(g=e.width*e.originX,m=e.height*e.originY,p.applyITRS(e.x-g,e.y-m,e.rotation,e.scaleX,e.scaleY),f.copyFrom(i.matrix),y=100*e.originX+"%",x=100*e.originY+"%",p.e-=i.scrollX*e.scrollFactorX,p.f-=i.scrollY*e.scrollFactorY,f.multiply(p,v)),e.transformOnly||(l.display="block",l.opacity=d,l.zIndex=e._depth,l.pointerEvents=e.pointerEvents,l.mixBlendMode=s[e._blendMode]),l.transform=v.getCSSMatrix()+" skew("+e.skewX+"rad, "+e.skewY+"rad) rotate3d("+e.rotate3d.x+","+e.rotate3d.y+","+e.rotate3d.z+","+e.rotate3d.w+e.rotate3dAngle+")",l.transformOrigin=y+" "+x}}}},66788:(t,e,i)=>{var s=i(38943);i(61286).register("dom",(function(t,e,i,n,r){var a=new s(this.scene,t,e,i,n,r);return this.displayList.add(a),a}))},11603:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(66070),r=i(66070),t.exports={renderWebGL:n,renderCanvas:r}},65492:t=>{t.exports="addedtoscene"},98398:t=>{t.exports="destroy"},40239:t=>{t.exports="removedfromscene"},17286:t=>{t.exports="complete"},31496:t=>{t.exports="created"},89587:t=>{t.exports="error"},96342:t=>{t.exports="loop"},49614:t=>{t.exports="play"},24418:t=>{t.exports="seeked"},87318:t=>{t.exports="seeking"},61922:t=>{t.exports="stop"},13991:t=>{t.exports="timeout"},4052:t=>{t.exports="unlocked"},56631:(t,e,i)=>{t.exports={ADDED_TO_SCENE:i(65492),DESTROY:i(98398),REMOVED_FROM_SCENE:i(40239),VIDEO_COMPLETE:i(17286),VIDEO_CREATED:i(31496),VIDEO_ERROR:i(89587),VIDEO_LOOP:i(96342),VIDEO_PLAY:i(49614),VIDEO_SEEKED:i(24418),VIDEO_SEEKING:i(87318),VIDEO_STOP:i(61922),VIDEO_TIMEOUT:i(13991),VIDEO_UNLOCKED:i(4052)}},39419:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(89980),a=i(79394),o=new s({Extends:r,Mixins:[n.Alpha,n.BlendMode,n.Depth,n.Flip,n.Origin,n.ScrollFactor,n.Size,n.Texture,n.Tint,n.Transform,n.Visible,a],initialize:function(t){r.call(this,t,"Extern")},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(){},render:function(){}});t.exports=o},96699:()=>{},41155:(t,e,i)=>{var s=i(39419);i(61286).register("extern",(function(){var t=new s(this.scene);return this.displayList.add(t),t}))},79394:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(81410),r=i(96699),t.exports={renderWebGL:n,renderCanvas:r}},81410:(t,e,i)=>{var s=i(73329);t.exports=function(t,e,i,n){t.pipelines.clear();var r=s(e,i,n).calc;e.render.call(e,t,i,r),t.pipelines.rebind()}},36266:t=>{t.exports={ARC:0,BEGIN_PATH:1,CLOSE_PATH:2,FILL_RECT:3,LINE_TO:4,MOVE_TO:5,LINE_STYLE:6,FILL_STYLE:7,FILL_PATH:8,STROKE_PATH:9,FILL_TRIANGLE:10,STROKE_TRIANGLE:11,SAVE:14,RESTORE:15,TRANSLATE:16,SCALE:17,ROTATE:18,GRADIENT_FILL_STYLE:21,GRADIENT_LINE_STYLE:22}},33182:(t,e,i)=>{var s=i(51052),n=i(56694),r=i(36266),a=i(15720),o=i(69732),h=i(14975),l=i(39171),u=i(58210),c=i(45900),d=i(56584),f=i(59694),p=i(95669),v=i(89980),g=i(72632),m=i(10850),y=i(83392),x=i(60898),T=new n({Extends:v,Mixins:[a,o,h,l,u,d,f,c,x],initialize:function(t,e){var i=m(e,"x",0),s=m(e,"y",0);v.call(this,t,"Graphics"),this.setPosition(i,s),this.initPipeline(),this.displayOriginX=0,this.displayOriginY=0,this.commandBuffer=[],this.defaultFillColor=-1,this.defaultFillAlpha=1,this.defaultStrokeWidth=1,this.defaultStrokeColor=-1,this.defaultStrokeAlpha=1,this._lineWidth=1,this.setDefaultStyles(e)},setDefaultStyles:function(t){return m(t,"lineStyle",null)&&(this.defaultStrokeWidth=m(t,"lineStyle.width",1),this.defaultStrokeColor=m(t,"lineStyle.color",16777215),this.defaultStrokeAlpha=m(t,"lineStyle.alpha",1),this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha)),m(t,"fillStyle",null)&&(this.defaultFillColor=m(t,"fillStyle.color",16777215),this.defaultFillAlpha=m(t,"fillStyle.alpha",1),this.fillStyle(this.defaultFillColor,this.defaultFillAlpha)),this},lineStyle:function(t,e,i){return void 0===i&&(i=1),this.commandBuffer.push(r.LINE_STYLE,t,e,i),this._lineWidth=t,this},fillStyle:function(t,e){return void 0===e&&(e=1),this.commandBuffer.push(r.FILL_STYLE,t,e),this},fillGradientStyle:function(t,e,i,s,n,a,o,h){return void 0===n&&(n=1),void 0===a&&(a=n),void 0===o&&(o=n),void 0===h&&(h=n),this.commandBuffer.push(r.GRADIENT_FILL_STYLE,n,a,o,h,t,e,i,s),this},lineGradientStyle:function(t,e,i,s,n,a){return void 0===a&&(a=1),this.commandBuffer.push(r.GRADIENT_LINE_STYLE,t,a,e,i,s,n),this},beginPath:function(){return this.commandBuffer.push(r.BEGIN_PATH),this},closePath:function(){return this.commandBuffer.push(r.CLOSE_PATH),this},fillPath:function(){return this.commandBuffer.push(r.FILL_PATH),this},fill:function(){return this.commandBuffer.push(r.FILL_PATH),this},strokePath:function(){return this.commandBuffer.push(r.STROKE_PATH),this},stroke:function(){return this.commandBuffer.push(r.STROKE_PATH),this},fillCircleShape:function(t){return this.fillCircle(t.x,t.y,t.radius)},strokeCircleShape:function(t){return this.strokeCircle(t.x,t.y,t.radius)},fillCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,y.PI2),this.fillPath(),this},strokeCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,y.PI2),this.strokePath(),this},fillRectShape:function(t){return this.fillRect(t.x,t.y,t.width,t.height)},strokeRectShape:function(t){return this.strokeRect(t.x,t.y,t.width,t.height)},fillRect:function(t,e,i,s){return this.commandBuffer.push(r.FILL_RECT,t,e,i,s),this},strokeRect:function(t,e,i,s){var n=this._lineWidth/2,r=t-n,a=t+n;return this.beginPath(),this.moveTo(t,e),this.lineTo(t,e+s),this.strokePath(),this.beginPath(),this.moveTo(t+i,e),this.lineTo(t+i,e+s),this.strokePath(),this.beginPath(),this.moveTo(r,e),this.lineTo(a+i,e),this.strokePath(),this.beginPath(),this.moveTo(r,e+s),this.lineTo(a+i,e+s),this.strokePath(),this},fillRoundedRect:function(t,e,i,s,n){void 0===n&&(n=20);var r=n,a=n,o=n,h=n;return"number"!=typeof n&&(r=g(n,"tl",20),a=g(n,"tr",20),o=g(n,"bl",20),h=g(n,"br",20)),this.beginPath(),this.moveTo(t+r,e),this.lineTo(t+i-a,e),this.arc(t+i-a,e+a,a,-y.TAU,0),this.lineTo(t+i,e+s-h),this.arc(t+i-h,e+s-h,h,0,y.TAU),this.lineTo(t+o,e+s),this.arc(t+o,e+s-o,o,y.TAU,Math.PI),this.lineTo(t,e+r),this.arc(t+r,e+r,r,-Math.PI,-y.TAU),this.fillPath(),this},strokeRoundedRect:function(t,e,i,s,n){void 0===n&&(n=20);var r=n,a=n,o=n,h=n,l=Math.min(i,s)/2;return"number"!=typeof n&&(r=g(n,"tl",20),a=g(n,"tr",20),o=g(n,"bl",20),h=g(n,"br",20)),r=Math.min(r,l),a=Math.min(a,l),o=Math.min(o,l),h=Math.min(h,l),this.beginPath(),this.moveTo(t+r,e),this.lineTo(t+i-a,e),this.moveTo(t+i-a,e),this.arc(t+i-a,e+a,a,-y.TAU,0),this.lineTo(t+i,e+s-h),this.moveTo(t+i,e+s-h),this.arc(t+i-h,e+s-h,h,0,y.TAU),this.lineTo(t+o,e+s),this.moveTo(t+o,e+s),this.arc(t+o,e+s-o,o,y.TAU,Math.PI),this.lineTo(t,e+r),this.moveTo(t,e+r),this.arc(t+r,e+r,r,-Math.PI,-y.TAU),this.strokePath(),this},fillPointShape:function(t,e){return this.fillPoint(t.x,t.y,e)},fillPoint:function(t,e,i){return!i||i<1?i=1:(t-=i/2,e-=i/2),this.commandBuffer.push(r.FILL_RECT,t,e,i,i),this},fillTriangleShape:function(t){return this.fillTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},strokeTriangleShape:function(t){return this.strokeTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},fillTriangle:function(t,e,i,s,n,a){return this.commandBuffer.push(r.FILL_TRIANGLE,t,e,i,s,n,a),this},strokeTriangle:function(t,e,i,s,n,a){return this.commandBuffer.push(r.STROKE_TRIANGLE,t,e,i,s,n,a),this},strokeLineShape:function(t){return this.lineBetween(t.x1,t.y1,t.x2,t.y2)},lineBetween:function(t,e,i,s){return this.beginPath(),this.moveTo(t,e),this.lineTo(i,s),this.strokePath(),this},lineTo:function(t,e){return this.commandBuffer.push(r.LINE_TO,t,e),this},moveTo:function(t,e){return this.commandBuffer.push(r.MOVE_TO,t,e),this},strokePoints:function(t,e,i,s){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===s&&(s=t.length),this.beginPath(),this.moveTo(t[0].x,t[0].y);for(var n=1;n-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(t,e,i){var s,n,r=this.scene.sys,a=r.game.renderer;if(void 0===e&&(e=r.scale.width),void 0===i&&(i=r.scale.height),T.TargetCamera.setScene(this.scene),T.TargetCamera.setViewport(0,0,e,i),T.TargetCamera.scrollX=this.x,T.TargetCamera.scrollY=this.y,"string"==typeof t)if(r.textures.exists(t)){var o=(s=r.textures.get(t)).getSourceImage();o instanceof HTMLCanvasElement&&(n=o.getContext("2d"))}else n=(s=r.textures.createCanvas(t,e,i)).getSourceImage().getContext("2d");else t instanceof HTMLCanvasElement&&(n=t.getContext("2d"));return n&&(this.renderCanvas(a,this,T.TargetCamera,null,n,!1),s&&s.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});T.TargetCamera=new s,t.exports=T},91543:(t,e,i)=>{var s=i(36266),n=i(49584);t.exports=function(t,e,i,r,a,o){var h=e.commandBuffer,l=h.length,u=a||t.currentContext;if(0!==l&&n(t,u,e,i,r)){i.addToRenderList(e);var c=1,d=1,f=0,p=0,v=1,g=0,m=0,y=0;u.beginPath();for(var x=0;x>>16,m=(65280&f)>>>8,y=255&f,u.strokeStyle="rgba("+g+","+m+","+y+","+c+")",u.lineWidth=v,x+=3;break;case s.FILL_STYLE:p=h[x+1],d=h[x+2],g=(16711680&p)>>>16,m=(65280&p)>>>8,y=255&p,u.fillStyle="rgba("+g+","+m+","+y+","+d+")",x+=2;break;case s.BEGIN_PATH:u.beginPath();break;case s.CLOSE_PATH:u.closePath();break;case s.FILL_PATH:o||u.fill();break;case s.STROKE_PATH:o||u.stroke();break;case s.FILL_RECT:o?u.rect(h[x+1],h[x+2],h[x+3],h[x+4]):u.fillRect(h[x+1],h[x+2],h[x+3],h[x+4]),x+=4;break;case s.FILL_TRIANGLE:u.beginPath(),u.moveTo(h[x+1],h[x+2]),u.lineTo(h[x+3],h[x+4]),u.lineTo(h[x+5],h[x+6]),u.closePath(),o||u.fill(),x+=6;break;case s.STROKE_TRIANGLE:u.beginPath(),u.moveTo(h[x+1],h[x+2]),u.lineTo(h[x+3],h[x+4]),u.lineTo(h[x+5],h[x+6]),u.closePath(),o||u.stroke(),x+=6;break;case s.LINE_TO:u.lineTo(h[x+1],h[x+2]),x+=2;break;case s.MOVE_TO:u.moveTo(h[x+1],h[x+2]),x+=2;break;case s.LINE_FX_TO:u.lineTo(h[x+1],h[x+2]),x+=5;break;case s.MOVE_FX_TO:u.moveTo(h[x+1],h[x+2]),x+=5;break;case s.SAVE:u.save();break;case s.RESTORE:u.restore();break;case s.TRANSLATE:u.translate(h[x+1],h[x+2]),x+=2;break;case s.SCALE:u.scale(h[x+1],h[x+2]),x+=2;break;case s.ROTATE:u.rotate(h[x+1]),x+=1;break;case s.GRADIENT_FILL_STYLE:x+=5;break;case s.GRADIENT_LINE_STYLE:x+=6}}u.restore()}}},41286:(t,e,i)=>{var s=i(99325),n=i(33182);s.register("graphics",(function(t,e){void 0===t&&(t={}),void 0!==e&&(t.add=e);var i=new n(this.scene,t);return t.add&&this.scene.sys.displayList.add(i),i}))},13122:(t,e,i)=>{var s=i(33182);i(61286).register("graphics",(function(t){return this.displayList.add(new s(this.scene,t))}))},60898:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(34429),r=i(91543),r=i(91543),t.exports={renderWebGL:n,renderCanvas:r}},34429:(t,e,i)=>{var s=i(36266),n=i(73329),r=i(69360),a=i(75512),o=function(t,e,i){this.x=t,this.y=e,this.width=i},h=function(t,e,i){this.points=[],this.pointsLength=1,this.points[0]=new o(t,e,i)},l=[],u=new r;t.exports=function(t,e,i,r){if(0!==e.commandBuffer.length){i.addToRenderList(e);var c=t.pipelines.set(e.pipeline,e);t.pipelines.preBatch(e);for(var d=n(e,i,r).calc,f=u.loadIdentity(),p=e.commandBuffer,v=i.alpha*e.alpha,g=1,m=c.fillTint,y=c.strokeTint,x=0,T=0,w=0,E=2*Math.PI,S=[],b=0,A=!0,_=null,C=a.getTintAppendFloatAlpha,R=0;R0&&(U=U%E-E):U>E?U=E:U<0&&(U=E+U%E),null===_&&(_=new h(B+Math.cos(X)*Y,N+Math.sin(X)*Y,g),S.push(_),I+=.01);I<1+G;)w=U*I+X,x=B+Math.cos(w)*Y,T=N+Math.sin(w)*Y,_.points.push(new o(x,T,g)),I+=.01;w=U+X,x=B+Math.cos(w)*Y,T=N+Math.sin(w)*Y,_.points.push(new o(x,T,g));break;case s.FILL_RECT:c.batchFillRect(p[++R],p[++R],p[++R],p[++R],f,d);break;case s.FILL_TRIANGLE:c.batchFillTriangle(p[++R],p[++R],p[++R],p[++R],p[++R],p[++R],f,d);break;case s.STROKE_TRIANGLE:c.batchStrokeTriangle(p[++R],p[++R],p[++R],p[++R],p[++R],p[++R],g,f,d);break;case s.LINE_TO:null!==_?_.points.push(new o(p[++R],p[++R],g)):(_=new h(p[++R],p[++R],g),S.push(_));break;case s.MOVE_TO:_=new h(p[++R],p[++R],g),S.push(_);break;case s.SAVE:l.push(f.copyToArray());break;case s.RESTORE:f.copyFromArray(l.pop());break;case s.TRANSLATE:B=p[++R],N=p[++R],f.translate(B,N);break;case s.SCALE:B=p[++R],N=p[++R],f.scale(B,N);break;case s.ROTATE:f.rotate(p[++R])}t.pipelines.postBatch(e)}}},59192:(t,e,i)=>{var s=i(83979),n=i(56694),r=i(56631),a=i(6659),o=i(71608),h=i(72632),l=i(10850),u=i(42911),c=i(75757),d=i(58403),f=i(13747),p=new n({Extends:a,initialize:function(t,e,i){a.call(this),i?e&&!Array.isArray(e)&&(e=[e]):Array.isArray(e)?u(e[0])&&(i=e,e=null):u(e)&&(i=e,e=null),this.scene=t,this.children=new d,this.isParent=!0,this.type="Group",this.classType=h(i,"classType",f),this.name=h(i,"name",""),this.active=h(i,"active",!0),this.maxSize=h(i,"maxSize",-1),this.defaultKey=h(i,"defaultKey",null),this.defaultFrame=h(i,"defaultFrame",null),this.runChildUpdate=h(i,"runChildUpdate",!1),this.createCallback=h(i,"createCallback",null),this.removeCallback=h(i,"removeCallback",null),this.createMultipleCallback=h(i,"createMultipleCallback",null),this.internalCreateCallback=h(i,"internalCreateCallback",null),this.internalRemoveCallback=h(i,"internalRemoveCallback",null),e&&this.addMultiple(e),i&&this.createMultiple(i),this.on(r.ADDED_TO_SCENE,this.addedToScene,this),this.on(r.REMOVED_FROM_SCENE,this.removedFromScene,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},create:function(t,e,i,s,n,r){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.defaultKey),void 0===s&&(s=this.defaultFrame),void 0===n&&(n=!0),void 0===r&&(r=!0),this.isFull())return null;var a=new this.classType(this.scene,t,e,i,s);return a.addToDisplayList(this.scene.sys.displayList),a.addToUpdateList(),a.visible=n,a.setActive(r),this.add(a),a},createMultiple:function(t){if(this.isFull())return[];Array.isArray(t)||(t=[t]);var e=[];if(t[0].key)for(var i=0;i=0;u--)if((l=d[u]).active===i){if(++c===e)break}else l=null;return l?("number"==typeof n&&(l.x=n),"number"==typeof r&&(l.y=r),l):s?this.create(n,r,a,o,h):null},get:function(t,e,i,s,n){return this.getFirst(!1,!0,t,e,i,s,n)},getFirstAlive:function(t,e,i,s,n,r){return this.getFirst(!0,t,e,i,s,n,r)},getFirstDead:function(t,e,i,s,n,r){return this.getFirst(!1,t,e,i,s,n,r)},playAnimation:function(t,e){return s.PlayAnimation(this.children.entries,t,e),this},isFull:function(){return-1!==this.maxSize&&this.children.size>=this.maxSize},countActive:function(t){void 0===t&&(t=!0);for(var e=0,i=0;i{var s=i(99325),n=i(59192);s.register("group",(function(t){return new n(this.scene,null,t)}))},62598:(t,e,i)=>{var s=i(59192);i(61286).register("group",(function(t,e){return this.updateList.add(new s(this.scene,t,e))}))},1539:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(89980),a=i(57322),o=new s({Extends:r,Mixins:[n.Alpha,n.BlendMode,n.Depth,n.Flip,n.FX,n.GetBounds,n.Mask,n.Origin,n.Pipeline,n.ScrollFactor,n.Size,n.TextureCrop,n.Tint,n.Transform,n.Visible,a],initialize:function(t,e,i,s,n){r.call(this,t,"Image"),this._crop=this.resetCropObject(),this.setTexture(s,n),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline()}});t.exports=o},57786:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),t.batchSprite(e,e.frame,i,s)}},83556:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),a=i(1539);n.register("image",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"frame",null),o=new a(this.scene,0,0,i,n);return void 0!==e&&(t.add=e),s(this.scene,o,t),o}))},20927:(t,e,i)=>{var s=i(1539);i(61286).register("image",(function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))}))},57322:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(59390),r=i(57786),t.exports={renderWebGL:n,renderCanvas:r}},59390:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),this.pipeline.batchSprite(e,i,s)}},48013:(t,e,i)=>{var s={Events:i(56631),DisplayList:i(91713),GameObjectCreator:i(99325),GameObjectFactory:i(61286),UpdateList:i(92034),Components:i(64937),GetCalcMatrix:i(73329),BuildGameObject:i(88933),BuildGameObjectAnimation:i(32291),GameObject:i(89980),BitmapText:i(44616),Blitter:i(52816),Bob:i(41664),Container:i(70339),DOMElement:i(38943),DynamicBitmapText:i(13468),Extern:i(39419),Graphics:i(33182),Group:i(59192),Image:i(1539),Layer:i(85305),Particles:i(27684),PathFollower:i(29598),RenderTexture:i(15996),RetroFont:i(55873),Rope:i(79968),Sprite:i(13747),Text:i(76555),GetTextSize:i(32979),MeasureText:i(27030),TextStyle:i(74744),TileSprite:i(35856),Zone:i(71030),Video:i(8630),Shape:i(91461),Arc:i(28593),Curve:i(15220),Ellipse:i(28591),Grid:i(39169),IsoBox:i(4415),IsoTriangle:i(65159),Line:i(579),Polygon:i(91249),Rectangle:i(517),Star:i(77843),Triangle:i(21873),Factories:{Blitter:i(38906),Container:i(23400),DOMElement:i(66788),DynamicBitmapText:i(94145),Extern:i(41155),Graphics:i(13122),Group:i(62598),Image:i(20927),Layer:i(17676),Particles:i(30439),PathFollower:i(19626),RenderTexture:i(29599),Rope:i(31982),Sprite:i(66135),StaticBitmapText:i(21797),Text:i(94627),TileSprite:i(20509),Zone:i(34546),Video:i(215),Arc:i(10369),Curve:i(10147),Ellipse:i(99869),Grid:i(9326),IsoBox:i(88154),IsoTriangle:i(67765),Line:i(85665),Polygon:i(88203),Rectangle:i(94355),Star:i(23962),Triangle:i(79296)},Creators:{Blitter:i(68452),Container:i(44516),DynamicBitmapText:i(67513),Graphics:i(41286),Group:i(61295),Image:i(83556),Layer:i(56378),Particles:i(38842),RenderTexture:i(85692),Rope:i(96027),Sprite:i(89219),StaticBitmapText:i(95499),Text:i(75397),TileSprite:i(63950),Zone:i(24067),Video:i(65601)}};s.Shader=i(27902),s.Mesh=i(83321),s.PointLight=i(13171),s.Factories.Shader=i(51979),s.Factories.Mesh=i(8767),s.Factories.PointLight=i(91201),s.Creators.Shader=i(13908),s.Creators.Mesh=i(41839),s.Creators.PointLight=i(162),s.Light=i(14455),s.LightsManager=i(26193),s.LightsPlugin=i(50296),t.exports=s},85305:(t,e,i)=>{var s=i(95723),n=i(56694),r=i(64937),a=i(48129),o=i(81078),h=i(6659),l=i(56631),u=i(71207),c=i(58010),d=i(7599),f=i(17922),p=new n({Extends:u,Mixins:[r.AlphaSingle,r.BlendMode,r.Depth,r.Mask,r.Pipeline,r.Visible,h,c],initialize:function(t,e){u.call(this,t),h.call(this),this.scene=t,this.displayList=null,this.type="Layer",this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.systems=t.sys,this.events=t.sys.events,this.sortChildrenFlag=!1,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.initPipeline(),this.clearAlpha(),this.setBlendMode(s.SKIP_CHECK),e&&this.add(e),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new o(this)),this},setData:function(t,e){return this.data||(this.data=new o(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new o(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new o(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new o(this)),this.data.get(t)},setInteractive:function(){return this},disableInteractive:function(){return this},removeInteractive:function(){return this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return a(this)},willRender:function(t){return!(15!==this.renderFlags||0===this.list.length||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return i.unshift(this.displayList.getIndex(t)),i},addChildCallback:function(t){t.displayList&&t.displayList!==this&&t.removeFromDisplayList(),t.displayList||(this.queueDepthSort(),t.displayList=this,t.emit(l.ADDED_TO_SCENE,t,this.scene),this.events.emit(d.ADDED_TO_SCENE,t,this.scene))},removeChildCallback:function(t){this.queueDepthSort(),t.displayList=null,t.emit(l.REMOVED_FROM_SCENE,t,this.scene),this.events.emit(d.REMOVED_FROM_SCENE,t,this.scene)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(f(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},getChildren:function(){return this.list},addToDisplayList:function(t){return void 0===t&&(t=this.scene.sys.displayList),this.displayList&&this.displayList!==t&&this.removeFromDisplayList(),t.exists(this)||(this.displayList=t,t.add(this,!0),t.queueDepthSort(),this.emit(l.ADDED_TO_SCENE,this,this.scene),t.events.emit(d.ADDED_TO_SCENE,this,this.scene)),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(l.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(d.REMOVED_FROM_SCENE,this,this.scene)),this},destroy:function(t){if(this.scene&&!this.ignoreDestroy){this.emit(l.DESTROY,this);for(var e=this.list;e.length;)e[0].destroy(t);this.removeAllListeners(),this.resetPostPipeline(!0),this.displayList&&(this.displayList.remove(this,!0),this.displayList.queueDepthSort()),this.data&&(this.data.destroy(),this.data=void 0),this.active=!1,this.visible=!1,this.list=void 0,this.scene=void 0,this.displayList=void 0,this.systems=void 0,this.events=void 0}}});t.exports=p},834:t=>{t.exports=function(t,e,i){var s=e.list;if(0!==s.length){e.depthSort();var n=-1!==e.blendMode;n||t.setBlendMode(0);var r=e._alpha;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var a=0;a{var s=i(88933),n=i(85305),r=i(99325),a=i(20494);r.register("layer",(function(t,e){void 0===t&&(t={});var i=a(t,"children",null),r=new n(this.scene,i);return void 0!==e&&(t.add=e),s(this.scene,r,t),r}))},17676:(t,e,i)=>{var s=i(85305);i(61286).register("layer",(function(t){return this.displayList.add(new s(this.scene,t))}))},58010:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(17576),r=i(834),t.exports={renderWebGL:n,renderCanvas:r}},17576:t=>{t.exports=function(t,e,i){var s=e.list,n=s.length;if(0!==n){e.depthSort(),t.pipelines.preBatch(e);var r=-1!==e.blendMode;r||t.setBlendMode(0);for(var a=e.alpha,o=0;o{var s=i(26673),n=i(56694),r=i(64937),a=i(39298),o=i(75512),h=new n({Extends:s,Mixins:[r.Origin,r.ScrollFactor,r.Transform,r.Visible],initialize:function(t,e,i,n,r,o,h){s.call(this,t,e,i),this.color=new a(n,r,o),this.intensity=h,this.renderFlags=15,this.cameraFilter=0,this.setScrollFactor(1,1),this.setOrigin(),this.setDisplayOrigin(i)},displayWidth:{get:function(){return this.diameter},set:function(t){this.diameter=t}},displayHeight:{get:function(){return this.diameter},set:function(t){this.diameter=t}},width:{get:function(){return this.diameter},set:function(t){this.diameter=t}},height:{get:function(){return this.diameter},set:function(t){this.diameter=t}},willRender:function(t){return!(h.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},setColor:function(t){var e=o.getFloatsFromUintRGB(t);return this.color.set(e[0],e[1],e[2]),this},setIntensity:function(t){return this.intensity=t,this},setRadius:function(t){return this.radius=t,this}});h.RENDER_MASK=15,t.exports=h},26193:(t,e,i)=>{var s=i(26535),n=i(56694),r=i(53996),a=i(14455),o=i(13171),h=i(39298),l=i(72677),u=i(17922),c=i(75512),d=new n({initialize:function(){this.lights=[],this.ambientColor=new h(.1,.1,.1),this.active=!1,this.maxLights=-1,this.visibleLights=0},addPointLight:function(t,e,i,s,n,r){return this.systems.displayList.add(new o(this.scene,t,e,i,s,n,r))},enable:function(){return-1===this.maxLights&&(this.maxLights=this.systems.renderer.config.maxLights),this.active=!0,this},disable:function(){return this.active=!1,this},getLights:function(t){for(var e=this.lights,i=t.worldView,n=[],a=0;athis.maxLights&&(u(n,this.sortByDistance),n=n.slice(0,this.maxLights)),this.visibleLights=n.length,n},sortByDistance:function(t,e){return t.distance>=e.distance},setAmbientColor:function(t){var e=c.getFloatsFromUintRGB(t);return this.ambientColor.set(e[0],e[1],e[2]),this},getMaxVisibleLights:function(){return this.maxLights},getLightCount:function(){return this.lights.length},addLight:function(t,e,i,s,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=128),void 0===s&&(s=16777215),void 0===n&&(n=1);var r=c.getFloatsFromUintRGB(s),o=new a(t,e,i,r[0],r[1],r[2],n);return this.lights.push(o),o},removeLight:function(t){var e=this.lights.indexOf(t);return e>=0&&l(this.lights,e),this},shutdown:function(){this.lights.length=0},destroy:function(){this.shutdown()}});t.exports=d},50296:(t,e,i)=>{var s=i(56694),n=i(26193),r=i(91963),a=i(7599),o=new s({Extends:n,initialize:function(t){this.scene=t,this.systems=t.sys,t.sys.settings.isBooted||t.sys.events.once(a.BOOT,this.boot,this),n.call(this)},boot:function(){var t=this.systems.events;t.on(a.SHUTDOWN,this.shutdown,this),t.on(a.DESTROY,this.destroy,this)},destroy:function(){this.shutdown(),this.scene=void 0,this.systems=void 0}});r.register("LightsPlugin",o,"lights"),t.exports=o},83321:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(75606),a=i(18693),o=i(89980),h=i(67623),l=i(53267),u=i(73329),c=i(16650),d=i(23464),f=i(17922),p=i(70015),v=i(85769),g=new s({Extends:o,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Mask,n.Pipeline,n.Size,n.Texture,n.Transform,n.Visible,n.ScrollFactor,d],initialize:function(t,e,i,s,n,r,a,h,l,u,d,f){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s="__WHITE"),o.call(this,t,"Mesh"),this.faces=[],this.vertices=[],this.tintFill=!1,this.debugCallback=null,this.debugGraphic=null,this.hideCCW=!0,this.modelPosition=new p,this.modelScale=new p(1,1,1),this.modelRotation=new p,this.dirtyCache=[0,0,0,0,0,0,0,0,0,0,0,0],this.transformMatrix=new c,this.viewPosition=new p,this.viewMatrix=new c,this.projectionMatrix=new c,this.totalRendered=0,this.totalFrame=0,this.ignoreDirtyCache=!1;var v=t.sys.renderer;this.setPosition(e,i),this.setTexture(s,n),this.setSize(v.width,v.height),this.initPipeline(),this.setPerspective(v.width,v.height),r&&this.addVertices(r,a,h,l,u,d,f)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},panX:function(t){return this.viewPosition.addScale(p.LEFT,t),this.dirtyCache[10]=1,this},panY:function(t){return this.viewPosition.y+=p.DOWN.y*t,this.dirtyCache[10]=1,this},panZ:function(t){return this.viewPosition.z+=t,this.dirtyCache[10]=1,this},setPerspective:function(t,e,i,s,n){return void 0===i&&(i=45),void 0===s&&(s=.01),void 0===n&&(n=1e3),this.projectionMatrix.perspective(r(i),t/e,s,n),this.dirtyCache[10]=1,this.dirtyCache[11]=0,this},setOrtho:function(t,e,i,s){return void 0===t&&(t=this.scene.sys.renderer.getAspectRatio()),void 0===e&&(e=1),void 0===i&&(i=-1e3),void 0===s&&(s=1e3),this.projectionMatrix.ortho(-t,t,-e,e,i,s),this.dirtyCache[10]=1,this.dirtyCache[11]=1,this},clear:function(){return this.faces.forEach((function(t){t.destroy()})),this.faces=[],this.vertices=[],this},addVerticesFromObj:function(t,e,i,s,n,r,a,o,h){var u,c=this.scene.sys.cache.obj.get(t);return c&&(u=l(c,this,e,i,s,n,r,a,o,h)),u&&0!==u.verts.length||console.warn("Mesh.addVerticesFromObj data empty:",t),this},sortByDepth:function(t,e){return t.depth-e.depth},depthSort:function(){return f(this.faces,this.sortByDepth),this},addVertex:function(t,e,i,s,n,r,a){var o=new v(t,e,i,s,n,r,a);return this.vertices.push(o),o},addFace:function(t,e,i){var s=new a(t,e,i);return this.faces.push(s),this.dirtyCache[9]=-1,s},addVertices:function(t,e,i,s,n,r,a){var o=h(t,e,i,s,n,r,a);return o?(this.faces=this.faces.concat(o.faces),this.vertices=this.vertices.concat(o.vertices)):console.warn("Mesh.addVertices data empty or invalid"),this.dirtyCache[9]=-1,this},getFaceCount:function(){return this.faces.length},getVertexCount:function(){return this.vertices.length},getFace:function(t){return this.faces[t]},getFaceAt:function(t,e,i){void 0===i&&(i=this.scene.sys.cameras.main);for(var s=u(this,i).calc,n=this.faces,r=[],a=0;a{t.exports=function(){}},41839:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),a=i(10850),o=i(83321);n.register("mesh",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"frame",null),h=a(t,"vertices",[]),l=a(t,"uvs",[]),u=a(t,"indicies",[]),c=a(t,"containsZ",!1),d=a(t,"normals",[]),f=a(t,"colors",16777215),p=a(t,"alphas",1),v=new o(this.scene,0,0,i,n,h,l,u,c,d,f,p);return void 0!==e&&(t.add=e),s(this.scene,v,t),v}))},8767:(t,e,i)=>{var s=i(83321);i(61286).register("mesh",(function(t,e,i,n,r,a,o,h,l,u,c){return this.displayList.add(new s(this.scene,t,e,i,n,r,a,o,h,l,u,c))}))},23464:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(57410),r=i(6317),t.exports={renderWebGL:n,renderCanvas:r}},57410:(t,e,i)=>{var s=i(73329);t.exports=function(t,e,i,n){var r=e.faces,a=r.length;if(0!==a){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline,e),h=s(e,i,n).calc,l=o.setGameObject(e),u=o.vertexViewF32,c=o.vertexViewU32,d=o.vertexCount*o.currentShader.vertexComponentCount-1,f=e.tintFill,p=[],v=e.debugCallback,g=h.a,m=h.b,y=h.c,x=h.d,T=h.e,w=h.f,E=e.viewPosition.z,S=e.hideCCW,b=i.roundPixels,A=i.alpha*e.alpha,_=0;t.pipelines.preBatch(e);for(var C=0;C{var s=i(56694),n=i(61616),r=i(21902),a=i(72632),o=i(1071),h=new s({initialize:function(t,e,i,s){void 0===s&&(s=!1),this.propertyKey=e,this.propertyValue=i,this.defaultValue=i,this.steps=0,this.counter=0,this.start=0,this.end=0,this.ease,this.emitOnly=s,this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,this.loadConfig(t)},loadConfig:function(t,e){void 0===t&&(t={}),e&&(this.propertyKey=e),this.propertyValue=a(t,this.propertyKey,this.defaultValue),this.setMethods(),this.emitOnly&&(this.onUpdate=this.defaultUpdate)},toJSON:function(){return this.propertyValue},onChange:function(t){return this.propertyValue=t,this.setMethods()},setMethods:function(){var t=this.propertyValue,e=typeof t;if(this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,null!==t){if("number"===e)this.onEmit=this.staticValueEmit,this.onUpdate=this.staticValueUpdate;else if(Array.isArray(t))this.onEmit=this.randomStaticValueEmit;else if("function"===e)this.emitOnly?this.onEmit=t:this.onUpdate=t;else if("object"===e&&this.hasBoth(t,"start","end")){this.start=t.start,this.end=t.end;var i=this.has(t,"random");if(i&&(this.onEmit=this.randomRangedValueEmit),this.has(t,"steps"))this.steps=t.steps,this.counter=this.start,this.onEmit=this.steppedEmit;else{var s=this.has(t,"ease")?t.ease:"Linear";this.ease=r(s,t.easeParams),i||(this.onEmit=this.easedValueEmit),this.onUpdate=this.easeValueUpdate}}else if("object"===e&&this.hasBoth(t,"min","max"))this.start=t.min,this.end=t.max,this.onEmit=this.randomRangedValueEmit;else if("object"===e&&this.has(t,"random")){var n=t.random;Array.isArray(n)&&(this.start=n[0],this.end=n[1]),this.onEmit=this.randomRangedValueEmit}else"object"===e&&this.hasEither(t,"onEmit","onUpdate")&&(this.has(t,"onEmit")&&(this.onEmit=t.onEmit),this.has(t,"onUpdate")&&(this.onUpdate=t.onUpdate));return this}},has:function(t,e){return t.hasOwnProperty(e)},hasBoth:function(t,e,i){return t.hasOwnProperty(e)&&t.hasOwnProperty(i)},hasEither:function(t,e,i){return t.hasOwnProperty(e)||t.hasOwnProperty(i)},defaultEmit:function(t,e,i){return i},defaultUpdate:function(t,e,i,s){return s},staticValueEmit:function(){return this.propertyValue},staticValueUpdate:function(){return this.propertyValue},randomStaticValueEmit:function(){var t=Math.floor(Math.random()*this.propertyValue.length);return this.propertyValue[t]},randomRangedValueEmit:function(t,e){var i=n(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i),i},steppedEmit:function(){var t=this.counter,e=this.counter+(this.end-this.start)/this.steps;return this.counter=o(e,this.start,this.end),t},easedValueEmit:function(t,e){if(t&&t.data[e]){var i=t.data[e];i.min=this.start,i.max=this.end}return this.start},easeValueUpdate:function(t,e,i){var s=t.data[e];return(s.max-s.min)*this.ease(i)+s.min}});t.exports=h},87811:(t,e,i)=>{var s=i(56694),n=i(72632),r=new s({initialize:function(t,e,i,s,r){if("object"==typeof t){var a=t;t=n(a,"x",0),e=n(a,"y",0),i=n(a,"power",0),s=n(a,"epsilon",100),r=n(a,"gravity",50)}else void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=100),void 0===r&&(r=50);this.x=t,this.y=e,this.active=!0,this._gravity=r,this._power=0,this._epsilon=0,this.power=i,this.epsilon=s},update:function(t,e){var i=this.x-t.x,s=this.y-t.y,n=i*i+s*s;if(0!==n){var r=Math.sqrt(n);n{var s=i(56694),n=i(75606),r=new s({initialize:function(t){this.emitter=t,this.frame=null,this.x=0,this.y=0,this.velocityX=0,this.velocityY=0,this.accelerationX=0,this.accelerationY=0,this.maxVelocityX=1e4,this.maxVelocityY=1e4,this.bounce=0,this.scaleX=1,this.scaleY=1,this.alpha=1,this.angle=0,this.rotation=0,this.tint=16777215,this.life=1e3,this.lifeCurrent=1e3,this.delayCurrent=0,this.lifeT=0,this.data={tint:{min:16777215,max:16777215,current:16777215},alpha:{min:1,max:1},rotate:{min:0,max:0},scaleX:{min:1,max:1},scaleY:{min:1,max:1}}},isAlive:function(){return this.lifeCurrent>0},resetPosition:function(){this.x=0,this.y=0},fire:function(t,e){var i=this.emitter;if(this.frame=i.getFrame(),!this.frame)throw new Error("Particle has no texture frame");i.emitZone&&i.emitZone.getPoint(this),this.x+=void 0===t?i.x.onEmit(this,"x"):t,this.y+=void 0===e?i.y.onEmit(this,"y"):e,this.life=i.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0;var s=i.speedX.onEmit(this,"speedX"),r=i.speedY?i.speedY.onEmit(this,"speedY"):s;if(i.radial){var a=n(i.angle.onEmit(this,"angle"));this.velocityX=Math.cos(a)*Math.abs(s),this.velocityY=Math.sin(a)*Math.abs(r)}else if(i.moveTo){var o=i.moveToX.onEmit(this,"moveToX"),h=i.moveToY?i.moveToY.onEmit(this,"moveToY"):o,l=this.life/1e3;this.velocityX=(o-this.x)/l,this.velocityY=(h-this.y)/l}else this.velocityX=s,this.velocityY=r;i.acceleration&&(this.accelerationX=i.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=i.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=i.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=i.maxVelocityY.onEmit(this,"maxVelocityY"),this.delayCurrent=i.delay.onEmit(this,"delay"),this.scaleX=i.scaleX.onEmit(this,"scaleX"),this.scaleY=i.scaleY.onEmit(this,"scaleY"),this.angle=i.rotate.onEmit(this,"rotate"),this.rotation=n(this.angle),this.bounce=i.bounce.onEmit(this,"bounce"),this.alpha=i.alpha.onEmit(this,"alpha"),this.tint=i.tint.onEmit(this,"tint")},computeVelocity:function(t,e,i,s){var n=this.velocityX,r=this.velocityY,a=this.accelerationX,o=this.accelerationY,h=this.maxVelocityX,l=this.maxVelocityY;n+=t.gravityX*i,r+=t.gravityY*i,a&&(n+=a*i),o&&(r+=o*i),n>h?n=h:n<-h&&(n=-h),r>l?r=l:r<-l&&(r=-l),this.velocityX=n,this.velocityY=r;for(var u=0;ue.right&&t.collideRight&&(this.x=e.right,this.velocityX*=i),this.ye.bottom&&t.collideBottom&&(this.y=e.bottom,this.velocityY*=i)},update:function(t,e,i){if(this.delayCurrent>0)return this.delayCurrent-=t,!1;var s=this.emitter,r=1-this.lifeCurrent/this.life;return this.lifeT=r,this.computeVelocity(s,t,e,i),this.x+=this.velocityX*e,this.y+=this.velocityY*e,s.bounds&&this.checkBounds(s),s.deathZone&&s.deathZone.willKill(this)?(this.lifeCurrent=0,!0):(this.scaleX=s.scaleX.onUpdate(this,"scaleX",r,this.scaleX),this.scaleY=s.scaleY.onUpdate(this,"scaleY",r,this.scaleY),this.angle=s.rotate.onUpdate(this,"rotate",r,this.angle),this.rotation=n(this.angle),this.alpha=s.alpha.onUpdate(this,"alpha",r,this.alpha),this.tint=s.tint.onUpdate(this,"tint",r,this.tint),this.lifeCurrent-=t,this.lifeCurrent<=0)}});t.exports=r},9216:(t,e,i)=>{var s=i(95723),n=i(56694),r=i(64937),a=i(69361),o=i(54213),h=i(93025),l=i(72632),u=i(72861),c=i(53523),d=i(19256),f=i(14909),p=i(68433),v=i(74118),g=i(17922),m=i(93736),y=i(1071),x=new n({Mixins:[r.BlendMode,r.Mask,r.ScrollFactor,r.Visible],initialize:function(t,e){this.manager=t,this.texture=t.texture,this.frames=[t.defaultFrame],this.defaultFrame=t.defaultFrame,this.configFastMap=["active","blendMode","collideBottom","collideLeft","collideRight","collideTop","deathCallback","deathCallbackScope","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxParticles","maxAliveParticles","name","on","particleBringToTop","particleClass","radial","timeScale","trackVisible","visible"],this.configOpMap=["accelerationX","accelerationY","angle","alpha","bounce","delay","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],this.name="",this.particleClass=f,this.x=new h(e,"x",0,!0),this.y=new h(e,"y",0,!0),this.radial=!0,this.gravityX=0,this.gravityY=0,this.acceleration=!1,this.accelerationX=new h(e,"accelerationX",0,!0),this.accelerationY=new h(e,"accelerationY",0,!0),this.maxVelocityX=new h(e,"maxVelocityX",1e4,!0),this.maxVelocityY=new h(e,"maxVelocityY",1e4,!0),this.speedX=new h(e,"speedX",0,!0),this.speedY=new h(e,"speedY",0,!0),this.moveTo=!1,this.moveToX=new h(e,"moveToX",null,!0),this.moveToY=new h(e,"moveToY",null,!0),this.bounce=new h(e,"bounce",0,!0),this.scaleX=new h(e,"scaleX",1),this.scaleY=new h(e,"scaleY",1),this.tint=new h(e,"tint",16777215),this.alpha=new h(e,"alpha",1),this.lifespan=new h(e,"lifespan",1e3,!0),this.angle=new h(e,"angle",{min:0,max:360},!0),this.rotate=new h(e,"rotate",0),this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.maxParticles=0,this.maxAliveParticles=0,this.quantity=new h(e,"quantity",1,!0),this.delay=new h(e,"delay",0,!0),this.frequency=0,this.on=!0,this.particleBringToTop=!0,this.timeScale=1,this.emitZone=null,this.deathZone=null,this.bounds=null,this.collideLeft=!0,this.collideRight=!0,this.collideTop=!0,this.collideBottom=!0,this.active=!0,this.visible=!0,this.blendMode=s.NORMAL,this.follow=null,this.followOffset=new m,this.trackVisible=!1,this.currentFrame=0,this.randomFrame=!0,this.frameQuantity=1,this.dead=[],this.alive=[],this._counter=0,this._frameCounter=0,e&&this.fromJSON(e)},fromJSON:function(t){if(!t)return this;var e=0,i="";for(e=0;e0&&this.getParticleCount()>=this.maxParticles||this.maxAliveParticles>0&&this.getAliveParticleCount()>=this.maxAliveParticles},onParticleEmit:function(t,e){return void 0===t?(this.emitCallback=null,this.emitCallbackScope=null):"function"==typeof t&&(this.emitCallback=t,e&&(this.emitCallbackScope=e)),this},onParticleDeath:function(t,e){return void 0===t?(this.deathCallback=null,this.deathCallbackScope=null):"function"==typeof t&&(this.deathCallback=t,e&&(this.deathCallbackScope=e)),this},killAll:function(){for(var t=this.dead,e=this.alive;e.length>0;)t.push(e.pop());return this},forEachAlive:function(t,e){for(var i=this.alive,s=i.length,n=0;n0){var u=this.deathCallback,c=this.deathCallbackScope;for(a=h-1;a>=0;a--){var d=o[a];n.splice(d.index,1),r.push(d.particle),u&&u.call(c,d.particle),d.particle.resetPosition()}}if(this.on)if(0===this.frequency)this.emitParticle();else if(this.frequency>0)for(this._counter-=e;this._counter<=0;)this.emitParticle(),this._counter+=this.frequency},depthSortCallback:function(t,e){return t.y-e.y}});t.exports=x},84622:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(89980),a=i(87811),o=i(71207),h=i(9216),l=i(72745),u=new s({Extends:r,Mixins:[n.Depth,n.Mask,n.Pipeline,n.Transform,n.Visible,l],initialize:function(t,e,i,s){if(r.call(this,t,"ParticleEmitterManager"),this.blendMode=-1,this.timeScale=1,this.texture=null,this.frame=null,this.frameNames=[],null===i||"object"!=typeof i&&!Array.isArray(i)||(s=i,i=null),this.setTexture(e,i),this.initPipeline(),this.emitters=new o(this),this.wells=new o(this),s){Array.isArray(s)||(s=[s]);for(var n=0;n0?e.defaultFrame=i[0]:(console.warn("No texture frames were set"),e.defaultFrame=this.defaultFrame),this},addEmitter:function(t){return this.emitters.add(t)},createEmitter:function(t){return this.addEmitter(new h(this,t))},removeEmitter:function(t){return this.emitters.remove(t,!0)},addGravityWell:function(t){return this.wells.add(t)},createGravityWell:function(t){return this.addGravityWell(new a(t))},emitParticle:function(t,e,i){for(var s=this.emitters.list,n=0;n{var s=i(69360),n=new s,r=new s,a=new s,o=new s;t.exports=function(t,e,i,s){var h=e.emitters.list,l=h.length;if(0!==l){var u=n.copyFrom(i.matrix),c=r,d=a,f=o;s?(f.loadIdentity(),f.multiply(s),f.translate(e.x,e.y),f.rotate(e.rotation),f.scale(e.scaleX,e.scaleY)):f.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);for(var p=t.currentContext,v=i.roundPixels,g=0;g0&&_.height>0){var C=-A.halfWidth,R=-A.halfHeight;p.globalAlpha=b,p.save(),c.setToContext(p),v&&(C=Math.round(C),R=Math.round(R)),p.imageSmoothingEnabled=!A.source.scaleMode,p.drawImage(A.source.image,_.x,_.y,_.width,_.height,C,R,_.width,_.height),p.restore()}}}p.restore()}}}}},38842:(t,e,i)=>{var s=i(99325),n=i(20494),r=i(72632),a=i(84622);s.register("particles",(function(t,e){void 0===t&&(t={});var i=n(t,"key",null),s=n(t,"frame",null),o=r(t,"emitters",null),h=new a(this.scene,i,s,o);return void 0!==e&&(t.add=e),r(t,"add",!1)?this.displayList.add(h):this.updateList.add(h),h}))},30439:(t,e,i)=>{var s=i(61286),n=i(84622);s.register("particles",(function(t,e,i){return this.displayList.add(new n(this.scene,t,e,i))}))},72745:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(58971),r=i(66545),t.exports={renderWebGL:n,renderCanvas:r}},58971:(t,e,i)=>{var s=i(69360),n=i(75512),r=new s,a=new s,o=new s,h=new s;t.exports=function(t,e,i,s){var l=e.emitters.list,u=l.length;if(0!==u){var c=t.pipelines.set(e.pipeline),d=r,f=a,p=o,v=h;s?(v.loadIdentity(),v.multiply(s),v.translate(e.x,e.y),v.rotate(e.rotation),v.scale(e.scaleX,e.scaleY)):v.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var g=i.roundPixels,m=e.defaultFrame.glTexture,y=n.getTintAppendFloatAlpha,x=c.setGameObject(e,e.defaultFrame);t.pipelines.preBatch(e);for(var T=0;T{t.exports={EmitterOp:i(93025),GravityWell:i(87811),Particle:i(14909),ParticleEmitter:i(9216),ParticleEmitterManager:i(84622),Zones:i(25962)}},69361:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e){this.source=t,this.killOnEnter=e},willKill:function(t){var e=this.source.contains(t.x,t.y);return e&&this.killOnEnter||!e&&!this.killOnEnter}});t.exports=s},54213:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s,n){void 0===s&&(s=!1),void 0===n&&(n=!0),this.source=t,this.points=[],this.quantity=e,this.stepRate=i,this.yoyo=s,this.counter=-1,this.seamless=n,this._length=0,this._direction=0,this.updateSource()},updateSource:function(){if(this.points=this.source.getPoints(this.quantity,this.stepRate),this.seamless){var t=this.points[0],e=this.points[this.points.length-1];t.x===e.x&&t.y===e.y&&this.points.pop()}var i=this._length;return this._length=this.points.length,this._lengththis._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=s},68433:(t,e,i)=>{var s=i(56694),n=i(93736),r=new s({initialize:function(t){this.source=t,this._tempVec=new n},getPoint:function(t){var e=this._tempVec;this.source.getRandomPoint(e),t.x=e.x,t.y=e.y}});t.exports=r},25962:(t,e,i)=>{t.exports={DeathZone:i(69361),EdgeZone:i(54213),RandomZone:i(68433)}},29598:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(13747),a=new s({Extends:r,Mixins:[n.PathFollower],initialize:function(t,e,i,s,n,a){r.call(this,t,i,s,n,a),this.path=e},preUpdate:function(t,e){this.anims.update(t,e),this.pathUpdate(t)}});t.exports=a},19626:(t,e,i)=>{var s=i(61286),n=i(29598);s.register("follower",(function(t,e,i,s,r){var a=new n(this.scene,t,e,i,s,r);return this.displayList.add(a),this.updateList.add(a),a}))},13171:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(89980),a=i(74853),o=i(65641),h=i(71606),l=new s({Extends:r,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Mask,n.Pipeline,n.ScrollFactor,n.Transform,n.Visible,h],initialize:function(t,e,i,s,n,h,l){void 0===s&&(s=16777215),void 0===n&&(n=128),void 0===h&&(h=1),void 0===l&&(l=.1),r.call(this,t,"PointLight"),this.initPipeline(o.POINTLIGHT_PIPELINE),this.setPosition(e,i),this.color=a(s),this.intensity=h,this.attenuation=l,this.width=2*n,this.height=2*n,this._radius=n},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this.width=2*t,this.height=2*t}},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return this._radius}},displayOriginY:{get:function(){return this._radius}}});t.exports=l},162:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),a=i(13171);n.register("pointlight",(function(t,e){void 0===t&&(t={});var i=r(t,"color",16777215),n=r(t,"radius",128),o=r(t,"intensity",1),h=r(t,"attenuation",.1),l=new a(this.scene,0,0,i,n,o,h);return void 0!==e&&(t.add=e),s(this.scene,l,t),l}))},91201:(t,e,i)=>{var s=i(61286),n=i(13171);s.register("pointlight",(function(t,e,i,s,r,a){return this.displayList.add(new n(this.scene,t,e,i,s,r,a))}))},71606:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(80590),t.exports={renderWebGL:n,renderCanvas:r}},80590:(t,e,i)=>{var s=i(73329);t.exports=function(t,e,i,n){i.addToRenderList(e);var r=t.pipelines.set(e.pipeline),a=s(e,i,n).calc,o=e.width,h=e.height,l=-e._radius,u=-e._radius,c=l+o,d=u+h,f=a.getX(0,0),p=a.getY(0,0),v=a.getX(l,u),g=a.getY(l,u),m=a.getX(l,d),y=a.getY(l,d),x=a.getX(c,d),T=a.getY(c,d),w=a.getX(c,u),E=a.getY(c,u);t.pipelines.preBatch(e),r.batchPointLight(e,i,v,g,m,y,x,T,w,E,f,p),t.pipelines.postBatch(e)}},15996:(t,e,i)=>{var s=i(95723),n=i(51052),r=i(61068),a=i(56694),o=i(64937),h=i(86459),l=i(82047),u=i(89980),c=i(72283),d=i(65641),f=i(92675),p=i(37410),v=i(75512),g=i(76583),m=new a({Extends:u,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Crop,o.Depth,o.Flip,o.FX,o.GetBounds,o.Mask,o.Origin,o.Pipeline,o.ScrollFactor,o.Tint,o.Transform,o.Visible,f],initialize:function(t,e,i,s,a,o,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=32),void 0===a&&(a=32),u.call(this,t,"RenderTexture"),this.renderer=t.sys.renderer,this.textureManager=t.sys.textures,this.globalTint=16777215,this.globalAlpha=1,this.canvas=null,this.dirty=!1,this._crop=this.resetCropObject(),this.texture=null,this.frame=null,this._saved=!1,this.isSpriteTexture=!1,void 0===o?(this.canvas=r.create2D(this,s,a),this.texture=t.sys.textures.addCanvas(g(),this.canvas),this.frame=this.texture.get()):(this.texture=t.sys.textures.get(o),this.frame=this.texture.get(l),this.canvas=this.frame.source.image,this._saved=!0,this.dirty=!0,this.width=this.frame.cutWidth,this.height=this.frame.cutHeight),this.context=this.canvas.getContext("2d"),this._eraseMode=!1,this.camera=new n(0,0,s,a),this.renderTarget=null;var f=this.renderer;f?f.type===h.WEBGL?(this.drawGameObject=this.batchGameObjectWebGL,this.renderTarget=new p(f,s,a,1,0,!1),this.setFlipY(this.isSpriteTexture)):f.type===h.CANVAS&&(this.drawGameObject=this.batchGameObjectCanvas):this.drawGameObject=c,this.camera.setScene(t),this.setPosition(e,i),void 0===o&&this.setSize(s,a),this.setOrigin(0,0),this.initPipeline(d.SINGLE_PIPELINE)},setSize:function(t,e){return this.resize(t,e)},setIsSpriteTexture:function(t){return this.isSpriteTexture=t,this.setFlipY(t),this},resize:function(t,e){void 0===e&&(e=t);var i=this.frame;if(t!==this.width||e!==this.height){if("__BASE"===i.name){this.canvas.width=t,this.canvas.height=e,this.texture.width=t,this.texture.height=e;var s=this.renderTarget;s&&(s.resize(t,e),i.glTexture=s.texture,i.source.isRenderTexture=!0,i.source.isGLTexture=!0,i.source.glTexture=s.texture,i.source.glTexture.flipY=!0),this.camera.setSize(t,e),i.source.width=t,i.source.height=e,i.setSize(t,e),this.width=t,this.height=e}}else{var n=this.texture.getSourceImage();i.cutX+t>n.width&&(t=n.width-i.cutX),i.cutY+e>n.height&&(e=n.height-i.cutY),i.setSize(t,e,i.cutX,i.cutY)}this.updateDisplayOrigin();var r=this.input;return r&&!r.customHitArea&&(r.hitArea.width=t,r.hitArea.height=e),this},setGlobalTint:function(t){return this.globalTint=t,this},setGlobalAlpha:function(t){return this.globalAlpha=t,this},saveTexture:function(t){return this.textureManager.renameTexture(this.texture.key,t),this._saved=!0,this.texture},fill:function(t,e,i,s,n,r){var a=this.frame,o=this.camera,h=this.renderer;void 0===e&&(e=1),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=a.cutWidth),void 0===r&&(r=a.cutHeight);var l=t>>16&255,u=t>>8&255,c=255&t,d=this.renderTarget;if(o.preRender(),d){d.bind(!0);var f=this.pipeline;f.manager.set(f);var p=d.width,g=d.height,m=h.width/p,y=h.height/g;f.drawFillRect(i*m,s*y,n*m,r*y,v.getTintFromFloats(c/255,u/255,l/255,1),e),d.unbind(!0)}else{var x=this.context;h.setContext(x),x.fillStyle="rgba("+l+","+u+","+c+","+e+")",x.fillRect(i+a.cutX,s+a.cutY,n,r),h.setContext()}return this.dirty=!0,this},clear:function(){if(this.dirty){var t=this.renderTarget;if(t)t.clear();else{var e=this.context;e.save(),e.setTransform(1,0,0,1,0,0),e.clearRect(this.frame.cutX,this.frame.cutY,this.frame.cutWidth,this.frame.cutHeight),e.restore()}this.dirty=!1}return this},erase:function(t,e,i){return this._eraseMode=!0,this.draw(t,e,i,1,16777215),this._eraseMode=!1,this},draw:function(t,e,i,s,n){return this.beginDraw(),this.batchDraw(t,e,i,s,n),this.endDraw(),this},drawFrame:function(t,e,i,s,n,r){return this.beginDraw(),this.batchDrawFrame(t,e,i,s,n,r),this.endDraw(),this},fillFrame:function(t,e,i,s,n,r){void 0===i&&(i=0),void 0===s&&(s=0);var a=this.textureManager.getFrame(t,e);if(a){this.beginDraw();for(var o=s;o>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(n>>16)+(65280&n)+((255&n)<<16),Array.isArray(t)||(t=[t]),this.batchList(t,e,i,s,n),this},batchDrawFrame:function(t,e,i,s,n,r){void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=this.globalAlpha),r=void 0===r?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(r>>16)+(65280&r)+((255&r)<<16);var a=this.textureManager.getFrame(t,e);return a&&(this.renderTarget?this.pipeline.batchTextureFrame(a,i,s,r,n,this.camera.matrix,null):this.batchTextureFrame(a,i+this.frame.cutX,s+this.frame.cutY,n,r)),this},endDraw:function(t){void 0===t&&(t=this._eraseMode);var e=this.renderer,i=this.renderTarget;if(i){var s=e.endCapture();e.pipelines.setUtility().blitFrame(s,i,1,!1,!1,t,this.isSpriteTexture),e.resetScissor(),e.resetViewport()}else e.setContext();return this.dirty=!0,this},batchList:function(t,e,i,s,n){for(var r=0;r0&&a.height>0&&r.drawImage(o,a.x,a.y,a.width,a.height,e,i,a.width,a.height),r.restore()}},snapshotArea:function(t,e,i,s,n,r,a){return this.renderTarget?this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer,this.width,this.height,n,!1,t,e,i,s,r,a):this.renderer.snapshotCanvas(this.canvas,n,!1,t,e,i,s,r,a),this},snapshot:function(t,e,i){return this.renderTarget?this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer,this.width,this.height,t,!1,0,0,this.width,this.height,e,i):this.renderer.snapshotCanvas(this.canvas,t,!1,0,0,this.width,this.height,e,i),this},snapshotPixel:function(t,e,i){return this.renderTarget?this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer,this.width,this.height,i,!0,t,e):this.renderer.snapshotCanvas(this.canvas,i,!0,t,e),this},preDestroy:function(){this._saved||(r.remove(this.canvas),this.renderTarget&&this.renderTarget.destroy(),this.texture.destroy(),this.camera.destroy(),this.canvas=null,this.context=null,this.texture=null)}});t.exports=m},43267:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),t.batchSprite(e,e.frame,i,s)}},85692:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),a=i(15996);n.register("renderTexture",(function(t,e){void 0===t&&(t={});var i=r(t,"x",0),n=r(t,"y",0),o=r(t,"width",32),h=r(t,"height",32),l=r(t,"key",void 0),u=r(t,"frame",void 0),c=new a(this.scene,i,n,o,h,l,u);return void 0!==e&&(t.add=e),s(this.scene,c,t),c}))},29599:(t,e,i)=>{var s=i(61286),n=i(15996);s.register("renderTexture",(function(t,e,i,s,r,a){return this.displayList.add(new n(this.scene,t,e,i,s,r,a))}))},92675:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(46823),r=i(43267),t.exports={renderWebGL:n,renderCanvas:r}},46823:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i,n){i.addToRenderList(e);var r=i.alpha,a=e.renderTarget,o=a.width,h=a.height,l=s.getTintAppendFloatAlpha,u=t.pipelines.set(e.pipeline),c=u.setTexture2D(a.texture);u.batchTexture(e,a.texture,o,h,e.x,e.y,o,h,e.scaleX,e.scaleY,e.rotation,e.flipX,!e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,o,h,l(e.tintTopLeft,r*e._alphaTL),l(e.tintTopRight,r*e._alphaTR),l(e.tintBottomLeft,r*e._alphaBL),l(e.tintBottomRight,r*e._alphaBR),e.tintFill,0,0,i,n,!0,c),t.resetTextures()}},79968:(t,e,i)=>{var s=i(16569),n=i(56694),r=i(64937),a=i(89980),o=i(65641),h=i(58912),l=i(93736),u=new n({Extends:a,Mixins:[r.AlphaSingle,r.BlendMode,r.Depth,r.Flip,r.Mask,r.Pipeline,r.Size,r.Texture,r.Transform,r.Visible,r.ScrollFactor,h],initialize:function(t,e,i,n,r,h,u,c,d){void 0===n&&(n="__DEFAULT"),void 0===h&&(h=2),void 0===u&&(u=!0),a.call(this,t,"Rope"),this.anims=new s(this),this.points=h,this.vertices,this.uv,this.colors,this.alphas,this.tintFill="__DEFAULT"===n,this.dirty=!1,this.horizontal=u,this._flipX=!1,this._flipY=!1,this._perp=new l,this.debugCallback=null,this.debugGraphic=null,this.setTexture(n,r),this.setPosition(e,i),this.setSizeToFrame(),this.initPipeline(o.ROPE_PIPELINE),Array.isArray(h)&&this.resizeArrays(h.length),this.setPoints(h,c,d),this.updateVertices()},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){var i=this.anims.currentFrame;this.anims.update(t,e),this.anims.currentFrame!==i&&(this.updateUVs(),this.updateVertices())},play:function(t,e,i){return this.anims.play(t,e,i),this},setDirty:function(){return this.dirty=!0,this},setHorizontal:function(t,e,i){return void 0===t&&(t=this.points.length),this.horizontal?this:(this.horizontal=!0,this.setPoints(t,e,i))},setVertical:function(t,e,i){return void 0===t&&(t=this.points.length),this.horizontal?(this.horizontal=!1,this.setPoints(t,e,i)):this},setTintFill:function(t){return void 0===t&&(t=!1),this.tintFill=t,this},setAlphas:function(t,e){var i=this.points.length;if(i<1)return this;var s,n=this.alphas;void 0===t?t=[1]:Array.isArray(t)||void 0!==e||(t=[t]);var r=0;if(void 0!==e)for(s=0;sr&&(a=t[r]),n[r]=a,t.length>r+1&&(a=t[r+1]),n[r+1]=a}return this},setColors:function(t){var e=this.points.length;if(e<1)return this;var i,s=this.colors;void 0===t?t=[16777215]:Array.isArray(t)||(t=[t]);var n=0;if(t.length===e)for(i=0;in&&(r=t[n]),s[n]=r,t.length>n+1&&(r=t[n+1]),s[n+1]=r}return this},setPoints:function(t,e,i){if(void 0===t&&(t=2),"number"==typeof t){var s,n,r,a=t;if(a<2&&(a=2),t=[],this.horizontal)for(r=-this.frame.halfWidth,n=this.frame.width/(a-1),s=0;s{t.exports=function(){}},96027:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),a=i(10850),o=i(79968);n.register("rope",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"frame",null),h=r(t,"horizontal",!0),l=a(t,"points",void 0),u=a(t,"colors",void 0),c=a(t,"alphas",void 0),d=new o(this.scene,0,0,i,n,l,h,u,c);return void 0!==e&&(t.add=e),s(this.scene,d,t),d}))},31982:(t,e,i)=>{var s=i(79968);i(61286).register("rope",(function(t,e,i,n,r,a,o,h){return this.displayList.add(new s(this.scene,t,e,i,n,r,a,o,h))}))},58912:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(49489),r=i(44598),t.exports={renderWebGL:n,renderCanvas:r}},49489:(t,e,i)=>{var s=i(73329),n=i(75512);t.exports=function(t,e,i,r){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline,e),o=s(e,i,r).calc,h=e.vertices,l=e.uv,u=e.colors,c=e.alphas,d=e.alpha,f=n.getTintAppendFloatAlpha,p=i.roundPixels,v=h.length,g=Math.floor(.5*v);a.flush(),t.pipelines.preBatch(e);var m=a.setGameObject(e),y=a.vertexViewF32,x=a.vertexViewU32,T=a.vertexCount*a.currentShader.vertexComponentCount-1,w=0,E=e.tintFill;e.dirty&&e.updateVertices();for(var S=e.debugCallback,b=[],A=0;A{var s=i(56694),n=i(64937),r=i(89980),a=i(72632),o=i(98611),h=i(22440),l=i(24252),u=i(69360),c=new s({Extends:r,Mixins:[n.ComputedSize,n.Depth,n.GetBounds,n.Mask,n.Origin,n.ScrollFactor,n.Transform,n.Visible,l],initialize:function(t,e,i,s,n,a,o,h){void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=128),void 0===a&&(a=128),r.call(this,t,"Shader"),this.blendMode=-1,this.shader;var l=t.sys.renderer;this.renderer=l,this.gl=l.gl,this.vertexData=new ArrayBuffer(2*Float32Array.BYTES_PER_ELEMENT*6),this.vertexBuffer=l.createVertexBuffer(this.vertexData.byteLength,this.gl.STREAM_DRAW),this.program=null,this.bytes=new Uint8Array(this.vertexData),this.vertexViewF32=new Float32Array(this.vertexData),this._tempMatrix1=new u,this._tempMatrix2=new u,this._tempMatrix3=new u,this.viewMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.projectionMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.uniforms={},this.pointer=null,this._rendererWidth=l.width,this._rendererHeight=l.height,this._textureCount=0,this.framebuffer=null,this.glTexture=null,this.renderToTexture=!1,this.texture=null,this.setPosition(i,s),this.setSize(n,a),this.setOrigin(.5,.5),this.setShader(e,o,h)},willRender:function(t){return!!this.renderToTexture||!(r.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},setRenderToTexture:function(t,e){if(void 0===e&&(e=!1),!this.renderToTexture){var i=this.width,s=this.height,n=this.renderer;this.glTexture=n.createTextureFromSource(null,i,s,0),this.glTexture.flipY=e,this.framebuffer=n.createFramebuffer(i,s,this.glTexture,!1),this._rendererWidth=i,this._rendererHeight=s,this.renderToTexture=!0,this.projOrtho(0,this.width,this.height,0),t&&(this.texture=this.scene.sys.textures.addGLTexture(t,this.glTexture,i,s))}return this.shader&&(n.pipelines.clear(),this.load(),this.flush(),n.pipelines.rebind()),this},setShader:function(t,e,i){if(void 0===e&&(e=[]),"string"==typeof t){var s=this.scene.sys.cache.shader;if(!s.has(t))return console.warn("Shader missing: "+t),this;this.shader=s.get(t)}else this.shader=t;var n=this.gl,r=this.renderer;this.program&&n.deleteProgram(this.program);var a=r.createProgram(this.shader.vertexSrc,this.shader.fragmentSrc);n.uniformMatrix4fv(n.getUniformLocation(a,"uViewMatrix"),!1,this.viewMatrix),n.uniformMatrix4fv(n.getUniformLocation(a,"uProjectionMatrix"),!1,this.projectionMatrix),n.uniform2f(n.getUniformLocation(a,"uResolution"),this.width,this.height),this.program=a;var h=new Date,l={resolution:{type:"2f",value:{x:this.width,y:this.height}},time:{type:"1f",value:0},mouse:{type:"2f",value:{x:this.width/2,y:this.height/2}},date:{type:"4fv",value:[h.getFullYear(),h.getMonth(),h.getDate(),60*h.getHours()*60+60*h.getMinutes()+h.getSeconds()]},sampleRate:{type:"1f",value:44100},iChannel0:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel1:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel2:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel3:{type:"sampler2D",value:null,textureData:{repeat:!0}}};this.shader.uniforms?this.uniforms=o(!0,{},this.shader.uniforms,l):this.uniforms=l;for(var u=0;u<4;u++)e[u]&&this.setSampler2D("iChannel"+u,e[u],u,i);return this.initUniforms(),this.projOrtho(0,this._rendererWidth,this._rendererHeight,0),this},setPointer:function(t){return this.pointer=t,this},projOrtho:function(t,e,i,s){var n=1/(t-e),r=1/(i-s),a=this.projectionMatrix;a[0]=-2*n,a[5]=-2*r,a[10]=-.001,a[12]=(t+e)*n,a[13]=(s+i)*r,a[14]=-0;var o=this.program,h=this.gl;this.renderer.setProgram(o),h.uniformMatrix4fv(h.getUniformLocation(o,"uProjectionMatrix"),!1,this.projectionMatrix),this._rendererWidth=e,this._rendererHeight=i},initUniforms:function(){var t=this.gl,e=this.renderer.glFuncMap,i=this.program;for(var s in this._textureCount=0,this.uniforms){var n=this.uniforms[s],r=n.type,a=e[r];n.uniformLocation=t.getUniformLocation(i,s),"sampler2D"!==r&&(n.glMatrix=a.matrix,n.glValueLength=a.length,n.glFunc=a.func)}},setSampler2DBuffer:function(t,e,i,s,n,r){void 0===n&&(n=0),void 0===r&&(r={});var a=this.uniforms[t];return a.value=e,r.width=i,r.height=s,a.textureData=r,this._textureCount=n,this.initSampler2D(a),this},setSampler2D:function(t,e,i,s){void 0===i&&(i=0);var n=this.scene.sys.textures;if(n.exists(e)){var r=n.getFrame(e);if(r.glTexture&&r.glTexture.isRenderTexture)return this.setSampler2DBuffer(t,r.glTexture,r.width,r.height,i,s);var a=this.uniforms[t],o=r.source;a.textureKey=e,a.source=o.image,a.value=r.glTexture,o.isGLTexture&&(s||(s={}),s.width=o.width,s.height=o.height),s&&(a.textureData=s),this._textureCount=i,this.initSampler2D(a)}return this},setUniform:function(t,e){return h(this.uniforms,t,e),this},getUniform:function(t){return a(this.uniforms,t,null)},setChannel0:function(t,e){return this.setSampler2D("iChannel0",t,0,e)},setChannel1:function(t,e){return this.setSampler2D("iChannel1",t,1,e)},setChannel2:function(t,e){return this.setSampler2D("iChannel2",t,2,e)},setChannel3:function(t,e){return this.setSampler2D("iChannel3",t,3,e)},initSampler2D:function(t){if(t.value){var e=this.gl;e.activeTexture(e.TEXTURE0+this._textureCount),e.bindTexture(e.TEXTURE_2D,t.value);var i=t.textureData;if(i&&!t.value.isRenderTexture){var s=e[a(i,"magFilter","linear").toUpperCase()],n=e[a(i,"minFilter","linear").toUpperCase()],r=e[a(i,"wrapS","repeat").toUpperCase()],o=e[a(i,"wrapT","repeat").toUpperCase()],h=e[a(i,"format","rgba").toUpperCase()];if(i.repeat&&(r=e.REPEAT,o=e.REPEAT),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!!i.flipY),i.width){var l=a(i,"width",512),u=a(i,"height",2),c=a(i,"border",0);e.texImage2D(e.TEXTURE_2D,0,h,l,u,c,h,e.UNSIGNED_BYTE,null)}else e.texImage2D(e.TEXTURE_2D,0,h,e.RGBA,e.UNSIGNED_BYTE,t.source);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,s),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,n),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,o)}this.renderer.setProgram(this.program),e.uniform1i(t.uniformLocation,this._textureCount),this._textureCount++}},syncUniforms:function(){var t,e,i,s,n,r=this.gl,a=this.uniforms,o=0;for(var h in a)i=(t=a[h]).glFunc,e=t.glValueLength,s=t.uniformLocation,null!==(n=t.value)&&(1===e?t.glMatrix?i.call(r,s,t.transpose,n):i.call(r,s,n):2===e?i.call(r,s,n.x,n.y):3===e?i.call(r,s,n.x,n.y,n.z):4===e?i.call(r,s,n.x,n.y,n.z,n.w):"sampler2D"===t.type&&(r.activeTexture(r.TEXTURE0+o),r.bindTexture(r.TEXTURE_2D,n),r.uniform1i(s,o),o++))},load:function(t){var e=this.gl,i=this.width,s=this.height,n=this.renderer,r=this.program,a=this.viewMatrix;if(!this.renderToTexture){var o=-this._displayOriginX,h=-this._displayOriginY;a[0]=t[0],a[1]=t[1],a[4]=t[2],a[5]=t[3],a[8]=t[4],a[9]=t[5],a[12]=a[0]*o+a[4]*h,a[13]=a[1]*o+a[5]*h}e.useProgram(r),e.uniformMatrix4fv(e.getUniformLocation(r,"uViewMatrix"),!1,a),e.uniform2f(e.getUniformLocation(r,"uResolution"),this.width,this.height);var l=this.uniforms,u=l.resolution;u.value.x=i,u.value.y=s,l.time.value=n.game.loop.getDuration();var c=this.pointer;if(c){var d=l.mouse,f=c.x/i,p=1-c.y/s;d.value.x=f.toFixed(2),d.value.y=p.toFixed(2)}this.syncUniforms()},flush:function(){var t=this.width,e=this.height,i=this.program,s=this.gl,n=this.vertexBuffer,r=this.renderer,a=2*Float32Array.BYTES_PER_ELEMENT;this.renderToTexture&&(r.setFramebuffer(this.framebuffer),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT)),s.bindBuffer(s.ARRAY_BUFFER,n);var o=s.getAttribLocation(i,"inPosition");-1!==o&&(s.enableVertexAttribArray(o),s.vertexAttribPointer(o,2,s.FLOAT,!1,a,0));var h=this.vertexViewF32;h[3]=e,h[4]=t,h[5]=e,h[8]=t,h[9]=e,h[10]=t;s.bufferSubData(s.ARRAY_BUFFER,0,this.bytes.subarray(0,6*a)),s.drawArrays(s.TRIANGLES,0,6),this.renderToTexture&&r.setFramebuffer(null,!1)},setAlpha:function(){},setBlendMode:function(){},preDestroy:function(){var t=this.gl;t.deleteProgram(this.program),t.deleteBuffer(this.vertexBuffer),this.renderToTexture&&(this.renderer.deleteFramebuffer(this.framebuffer),this.texture.destroy(),this.framebuffer=null,this.glTexture=null,this.texture=null)}});t.exports=c},10612:t=>{t.exports=function(){}},13908:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),a=i(27902);n.register("shader",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"x",0),o=r(t,"y",0),h=r(t,"width",128),l=r(t,"height",128),u=new a(this.scene,i,n,o,h,l);return void 0!==e&&(t.add=e),s(this.scene,u,t),u}))},51979:(t,e,i)=>{var s=i(27902);i(61286).register("shader",(function(t,e,i,n,r,a,o){return this.displayList.add(new s(this.scene,t,e,i,n,r,a,o))}))},24252:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(19782),r=i(10612),t.exports={renderWebGL:n,renderCanvas:r}},19782:(t,e,i)=>{var s=i(73329);t.exports=function(t,e,i,n){if(e.shader){if(i.addToRenderList(e),t.pipelines.clear(),e.renderToTexture)e.load(),e.flush();else{var r=s(e,i,n).calc;t.width===e._rendererWidth&&t.height===e._rendererHeight||e.projOrtho(0,t.width,t.height,0),e.load(r.matrix),e.flush()}t.pipelines.rebind()}}},19543:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i,n,r,a){for(var o=s.getTintAppendFloatAlpha(i.fillColor,i.fillAlpha*n),h=i.pathData,l=i.pathIndexes,u=0;u{t.exports=function(t,e,i,s){var n=i||e.fillColor,r=s||e.fillAlpha,a=(16711680&n)>>>16,o=(65280&n)>>>8,h=255&n;t.fillStyle="rgba("+a+","+o+","+h+","+r+")"}},17876:t=>{t.exports=function(t,e,i,s){var n=i||e.strokeColor,r=s||e.strokeAlpha,a=(16711680&n)>>>16,o=(65280&n)>>>8,h=255&n;t.strokeStyle="rgba("+a+","+o+","+h+","+r+")",t.lineWidth=e.lineWidth}},91461:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(89980),a=i(88829),o=new s({Extends:r,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.GetBounds,n.Mask,n.Origin,n.Pipeline,n.ScrollFactor,n.Transform,n.Visible],initialize:function(t,e,i){void 0===e&&(e="Shape"),r.call(this,t,e),this.geom=i,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new a,this.width=0,this.height=0,this.initPipeline()},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.isFilled=!1:(this.fillColor=t,this.fillAlpha=e,this.isFilled=!0),this},setStrokeStyle:function(t,e,i){return void 0===i&&(i=1),void 0===t?this.isStroked=!1:(this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this.isStroked=!0),this},setClosePath:function(t){return this.closePath=t,this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}}});t.exports=o},50262:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i,n,r){var a=t.strokeTint,o=s.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*i);a.TL=o,a.TR=o,a.BL=o,a.BR=o;var h=e.pathData,l=h.length-1,u=e.lineWidth,c=u/2,d=h[0]-n,f=h[1]-r;e.closePath||(l-=2);for(var p=2;p{var s=i(2213),n=i(56694),r=i(75606),a=i(11117),o=i(26673),h=i(83392),l=i(91461),u=new n({Extends:l,Mixins:[s],initialize:function(t,e,i,s,n,r,a,h,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===n&&(n=0),void 0===r&&(r=360),void 0===a&&(a=!1),l.call(this,t,"Arc",new o(0,0,s)),this._startAngle=n,this._endAngle=r,this._anticlockwise=a,this._iterations=.01,this.setPosition(e,i);var c=2*this.geom.radius;this.setSize(c,c),void 0!==h&&this.setFillStyle(h,u),this.updateDisplayOrigin(),this.updateData()},iterations:{get:function(){return this._iterations},set:function(t){this._iterations=t,this.updateData()}},radius:{get:function(){return this.geom.radius},set:function(t){this.geom.radius=t;var e=2*t;this.setSize(e,e),this.updateDisplayOrigin(),this.updateData()}},startAngle:{get:function(){return this._startAngle},set:function(t){this._startAngle=t,this.updateData()}},endAngle:{get:function(){return this._endAngle},set:function(t){this._endAngle=t,this.updateData()}},anticlockwise:{get:function(){return this._anticlockwise},set:function(t){this._anticlockwise=t,this.updateData()}},setRadius:function(t){return this.radius=t,this},setIterations:function(t){return void 0===t&&(t=.01),this.iterations=t,this},setStartAngle:function(t,e){return this._startAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},setEndAngle:function(t,e){return this._endAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},updateData:function(){var t=this._iterations,e=t,i=this.geom.radius,s=r(this._startAngle),n=r(this._endAngle),o=i,l=i;n-=s,this._anticlockwise?n<-h.PI2?n=-h.PI2:n>0&&(n=-h.PI2+n%h.PI2):n>h.PI2?n=h.PI2:n<0&&(n=h.PI2+n%h.PI2);for(var u,c=[o+Math.cos(s)*i,l+Math.sin(s)*i];e<1;)u=n*e+s,c.push(o+Math.cos(u)*i,l+Math.sin(u)*i),e+=t;return u=n+s,c.push(o+Math.cos(u)*i,l+Math.sin(u)*i),c.push(o+Math.cos(s)*i,l+Math.sin(s)*i),this.pathIndexes=a(c),this.pathData=c,this}});t.exports=u},23560:(t,e,i)=>{var s=i(75606),n=i(15608),r=i(17876),a=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var h=t.currentContext;if(a(t,h,e,i,o)){var l=e.radius;h.beginPath(),h.arc(l-e.originX*(2*l),l-e.originY*(2*l),l,s(e._startAngle),s(e._endAngle),e.anticlockwise),e.closePath&&h.closePath(),e.isFilled&&(n(h,e),h.fill()),e.isStroked&&(r(h,e),h.stroke()),h.restore()}}},10369:(t,e,i)=>{var s=i(28593),n=i(61286);n.register("arc",(function(t,e,i,n,r,a,o,h){return this.displayList.add(new s(this.scene,t,e,i,n,r,a,o,h))})),n.register("circle",(function(t,e,i,n,r){return this.displayList.add(new s(this.scene,t,e,i,0,360,!1,n,r))}))},2213:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(58356),r=i(23560),t.exports={renderWebGL:n,renderCanvas:r}},58356:(t,e,i)=>{var s=i(73329),n=i(19543),r=i(50262);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),h=s(e,i,a),l=o.calcMatrix.copyFrom(h.calc),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&n(o,l,e,d,u,c),e.isStroked&&r(o,e,d,u,c),t.pipelines.postBatch(e)}},15220:(t,e,i)=>{var s=i(56694),n=i(87203),r=i(11117),a=i(74118),o=i(91461),h=new s({Extends:o,Mixins:[n],initialize:function(t,e,i,s,n,r){void 0===e&&(e=0),void 0===i&&(i=0),o.call(this,t,"Curve",s),this._smoothness=32,this._curveBounds=new a,this.closePath=!1,this.setPosition(e,i),void 0!==n&&this.setFillStyle(n,r),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){var t=this._curveBounds,e=this._smoothness;this.geom.getBounds(t,e),this.setSize(t.width,t.height),this.updateDisplayOrigin();for(var i=[],s=this.geom.getPoints(e),n=0;n{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.currentContext;if(r(t,o,e,i,a)){var h=e._displayOriginX+e._curveBounds.x,l=e._displayOriginY+e._curveBounds.y,u=e.pathData,c=u.length-1,d=u[0]-h,f=u[1]-l;o.beginPath(),o.moveTo(d,f),e.closePath||(c-=2);for(var p=2;p{var s=i(61286),n=i(15220);s.register("curve",(function(t,e,i,s,r){return this.displayList.add(new n(this.scene,t,e,i,s,r))}))},87203:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(82958),r=i(4024),t.exports={renderWebGL:n,renderCanvas:r}},82958:(t,e,i)=>{var s=i(19543),n=i(73329),r=i(50262);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),h=n(e,i,a),l=o.calcMatrix.copyFrom(h.calc),u=e._displayOriginX+e._curveBounds.x,c=e._displayOriginY+e._curveBounds.y,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&s(o,l,e,d,u,c),e.isStroked&&r(o,e,d,u,c),t.pipelines.postBatch(e)}},28591:(t,e,i)=>{var s=i(56694),n=i(11117),r=i(84171),a=i(95669),o=i(91461),h=new s({Extends:o,Mixins:[r],initialize:function(t,e,i,s,n,r,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===n&&(n=128),o.call(this,t,"Ellipse",new a(s/2,n/2,s,n)),this._smoothness=64,this.setPosition(e,i),this.width=s,this.height=n,void 0!==r&&this.setFillStyle(r,h),this.updateDisplayOrigin(),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSize:function(t,e){return this.width=t,this.height=e,this.geom.setPosition(t/2,e/2),this.geom.setSize(t,e),this.updateData()},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){for(var t=[],e=this.geom.getPoints(this._smoothness),i=0;i{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.currentContext;if(r(t,o,e,i,a)){var h=e._displayOriginX,l=e._displayOriginY,u=e.pathData,c=u.length-1,d=u[0]-h,f=u[1]-l;o.beginPath(),o.moveTo(d,f),e.closePath||(c-=2);for(var p=2;p{var s=i(28591);i(61286).register("ellipse",(function(t,e,i,n,r,a){return this.displayList.add(new s(this.scene,t,e,i,n,r,a))}))},84171:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(17554),r=i(55881),t.exports={renderWebGL:n,renderCanvas:r}},17554:(t,e,i)=>{var s=i(19543),n=i(73329),r=i(50262);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),h=n(e,i,a),l=o.calcMatrix.copyFrom(h.calc),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&s(o,l,e,d,u,c),e.isStroked&&r(o,e,d,u,c),t.pipelines.postBatch(e)}},39169:(t,e,i)=>{var s=i(56694),n=i(91461),r=i(88059),a=new s({Extends:n,Mixins:[r],initialize:function(t,e,i,s,r,a,o,h,l,u,c){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===r&&(r=128),void 0===a&&(a=32),void 0===o&&(o=32),n.call(this,t,"Grid",null),this.cellWidth=a,this.cellHeight=o,this.showCells=!0,this.outlineFillColor=0,this.outlineFillAlpha=0,this.showOutline=!0,this.showAltCells=!1,this.altFillColor,this.altFillAlpha,this.setPosition(e,i),this.setSize(s,r),this.setFillStyle(h,l),void 0!==u&&this.setOutlineStyle(u,c),this.updateDisplayOrigin()},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showCells=!1:(this.fillColor=t,this.fillAlpha=e,this.showCells=!0),this},setAltFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showAltCells=!1:(this.altFillColor=t,this.altFillAlpha=e,this.showAltCells=!0),this},setOutlineStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showOutline=!1:(this.outlineFillColor=t,this.outlineFillAlpha=e,this.showOutline=!0),this}});t.exports=a},95525:(t,e,i)=>{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.currentContext;if(r(t,o,e,i,a)){var h=-e._displayOriginX,l=-e._displayOriginY,u=i.alpha*e.alpha,c=e.width,d=e.height,f=e.cellWidth,p=e.cellHeight,v=Math.ceil(c/f),g=Math.ceil(d/p),m=f,y=p,x=f-(v*f-c),T=p-(g*p-d),w=e.showCells,E=e.showAltCells,S=e.showOutline,b=0,A=0,_=0,C=0,R=0;if(S&&(m--,y--,x===f&&x--,T===p&&T--),w&&e.fillAlpha>0)for(s(o,e),A=0;A0)for(s(o,e,e.altFillColor,e.altFillAlpha*u),A=0;A0){for(n(o,e,e.outlineFillColor,e.outlineFillAlpha*u),b=1;b{var s=i(61286),n=i(39169);s.register("grid",(function(t,e,i,s,r,a,o,h,l,u){return this.displayList.add(new n(this.scene,t,e,i,s,r,a,o,h,l,u))}))},88059:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(50639),r=i(95525),t.exports={renderWebGL:n,renderCanvas:r}},50639:(t,e,i)=>{var s=i(73329),n=i(75512);t.exports=function(t,e,i,r){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),o=s(e,i,r);a.calcMatrix.copyFrom(o.calc).translate(-e._displayOriginX,-e._displayOriginY);var h,l,u=i.alpha*e.alpha,c=e.width,d=e.height,f=e.cellWidth,p=e.cellHeight,v=Math.ceil(c/f),g=Math.ceil(d/p),m=f,y=p,x=f-(v*f-c),T=p-(g*p-d),w=e.showCells,E=e.showAltCells,S=e.showOutline,b=0,A=0,_=0,C=0,R=0;if(S&&(m--,y--,x===f&&x--,T===p&&T--),t.pipelines.preBatch(e),w&&e.fillAlpha>0)for(h=a.fillTint,l=n.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*u),h.TL=l,h.TR=l,h.BL=l,h.BR=l,A=0;A0)for(h=a.fillTint,l=n.getTintAppendFloatAlpha(e.altFillColor,e.altFillAlpha*u),h.TL=l,h.TR=l,h.BL=l,h.BR=l,A=0;A0){var M=a.strokeTint,P=n.getTintAppendFloatAlpha(e.outlineFillColor,e.outlineFillAlpha*u);for(M.TL=P,M.TR=P,M.BL=P,M.BR=P,b=1;b{var s=i(72296),n=i(56694),r=i(91461),a=new n({Extends:r,Mixins:[s],initialize:function(t,e,i,s,n,a,o,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=48),void 0===n&&(n=32),void 0===a&&(a=15658734),void 0===o&&(o=10066329),void 0===h&&(h=13421772),r.call(this,t,"IsoBox",null),this.projection=4,this.fillTop=a,this.fillLeft=o,this.fillRight=h,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isFilled=!0,this.setPosition(e,i),this.setSize(s,n),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=a},32884:(t,e,i)=>{var s=i(15608),n=i(49584);t.exports=function(t,e,i,r){i.addToRenderList(e);var a=t.currentContext;if(n(t,a,e,i,r)&&e.isFilled){var o=e.width,h=e.height,l=o/2,u=o/e.projection;e.showTop&&(s(a,e,e.fillTop),a.beginPath(),a.moveTo(-l,-h),a.lineTo(0,-u-h),a.lineTo(l,-h),a.lineTo(l,-1),a.lineTo(0,u-1),a.lineTo(-l,-1),a.lineTo(-l,-h),a.fill()),e.showLeft&&(s(a,e,e.fillLeft),a.beginPath(),a.moveTo(-l,0),a.lineTo(0,u),a.lineTo(0,u-h),a.lineTo(-l,-h),a.lineTo(-l,0),a.fill()),e.showRight&&(s(a,e,e.fillRight),a.beginPath(),a.moveTo(l,0),a.lineTo(0,u),a.lineTo(0,u-h),a.lineTo(l,-h),a.lineTo(l,0),a.fill()),a.restore()}}},88154:(t,e,i)=>{var s=i(61286),n=i(4415);s.register("isobox",(function(t,e,i,s,r,a,o){return this.displayList.add(new n(this.scene,t,e,i,s,r,a,o))}))},72296:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(33101),r=i(32884),t.exports={renderWebGL:n,renderCanvas:r}},33101:(t,e,i)=>{var s=i(73329),n=i(75512);t.exports=function(t,e,i,r){i.addToRenderList(e);var a,o,h,l,u,c,d,f,p,v=t.pipelines.set(e.pipeline),g=s(e,i,r),m=v.calcMatrix.copyFrom(g.calc),y=e.width,x=e.height,T=y/2,w=y/e.projection,E=i.alpha*e.alpha;e.isFilled&&(t.pipelines.preBatch(e),e.showTop&&(a=n.getTintAppendFloatAlpha(e.fillTop,E),o=m.getX(-T,-x),h=m.getY(-T,-x),l=m.getX(0,-w-x),u=m.getY(0,-w-x),c=m.getX(T,-x),d=m.getY(T,-x),f=m.getX(0,w-x),p=m.getY(0,w-x),v.batchQuad(e,o,h,l,u,c,d,f,p,0,0,1,1,a,a,a,a,2)),e.showLeft&&(a=n.getTintAppendFloatAlpha(e.fillLeft,E),o=m.getX(-T,0),h=m.getY(-T,0),l=m.getX(0,w),u=m.getY(0,w),c=m.getX(0,w-x),d=m.getY(0,w-x),f=m.getX(-T,-x),p=m.getY(-T,-x),v.batchQuad(e,o,h,l,u,c,d,f,p,0,0,1,1,a,a,a,a,2)),e.showRight&&(a=n.getTintAppendFloatAlpha(e.fillRight,E),o=m.getX(T,0),h=m.getY(T,0),l=m.getX(0,w),u=m.getY(0,w),c=m.getX(0,w-x),d=m.getY(0,w-x),f=m.getX(T,-x),p=m.getY(T,-x),v.batchQuad(e,o,h,l,u,c,d,f,p,0,0,1,1,a,a,a,a,2)),t.pipelines.postBatch(e))}},65159:(t,e,i)=>{var s=i(56694),n=i(93387),r=i(91461),a=new s({Extends:r,Mixins:[n],initialize:function(t,e,i,s,n,a,o,h,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=48),void 0===n&&(n=32),void 0===a&&(a=!1),void 0===o&&(o=15658734),void 0===h&&(h=10066329),void 0===l&&(l=13421772),r.call(this,t,"IsoTriangle",null),this.projection=4,this.fillTop=o,this.fillLeft=h,this.fillRight=l,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isReversed=a,this.isFilled=!0,this.setPosition(e,i),this.setSize(s,n),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setReversed:function(t){return this.isReversed=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=a},9923:(t,e,i)=>{var s=i(15608),n=i(49584);t.exports=function(t,e,i,r){i.addToRenderList(e);var a=t.currentContext;if(n(t,a,e,i,r)&&e.isFilled){var o=e.width,h=e.height,l=o/2,u=o/e.projection,c=e.isReversed;e.showTop&&c&&(s(a,e,e.fillTop),a.beginPath(),a.moveTo(-l,-h),a.lineTo(0,-u-h),a.lineTo(l,-h),a.lineTo(0,u-h),a.fill()),e.showLeft&&(s(a,e,e.fillLeft),a.beginPath(),c?(a.moveTo(-l,-h),a.lineTo(0,u),a.lineTo(0,u-h)):(a.moveTo(-l,0),a.lineTo(0,u),a.lineTo(0,u-h)),a.fill()),e.showRight&&(s(a,e,e.fillRight),a.beginPath(),c?(a.moveTo(l,-h),a.lineTo(0,u),a.lineTo(0,u-h)):(a.moveTo(l,0),a.lineTo(0,u),a.lineTo(0,u-h)),a.fill()),a.restore()}}},67765:(t,e,i)=>{var s=i(61286),n=i(65159);s.register("isotriangle",(function(t,e,i,s,r,a,o,h){return this.displayList.add(new n(this.scene,t,e,i,s,r,a,o,h))}))},93387:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(54946),r=i(9923),t.exports={renderWebGL:n,renderCanvas:r}},54946:(t,e,i)=>{var s=i(73329),n=i(75512);t.exports=function(t,e,i,r){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),o=s(e,i,r),h=a.calcMatrix.copyFrom(o.calc),l=e.width,u=e.height,c=l/2,d=l/e.projection,f=e.isReversed,p=i.alpha*e.alpha;if(e.isFilled){var v,g,m,y,x,T,w;if(t.pipelines.preBatch(e),e.showTop&&f){v=n.getTintAppendFloatAlpha(e.fillTop,p),g=h.getX(-c,-u),m=h.getY(-c,-u),y=h.getX(0,-d-u),x=h.getY(0,-d-u),T=h.getX(c,-u),w=h.getY(c,-u);var E=h.getX(0,d-u),S=h.getY(0,d-u);a.batchQuad(e,g,m,y,x,T,w,E,S,0,0,1,1,v,v,v,v,2)}e.showLeft&&(v=n.getTintAppendFloatAlpha(e.fillLeft,p),f?(g=h.getX(-c,-u),m=h.getY(-c,-u),y=h.getX(0,d),x=h.getY(0,d),T=h.getX(0,d-u),w=h.getY(0,d-u)):(g=h.getX(-c,0),m=h.getY(-c,0),y=h.getX(0,d),x=h.getY(0,d),T=h.getX(0,d-u),w=h.getY(0,d-u)),a.batchTri(e,g,m,y,x,T,w,0,0,1,1,v,v,v,2)),e.showRight&&(v=n.getTintAppendFloatAlpha(e.fillRight,p),f?(g=h.getX(c,-u),m=h.getY(c,-u),y=h.getX(0,d),x=h.getY(0,d),T=h.getX(0,d-u),w=h.getY(0,d-u)):(g=h.getX(c,0),m=h.getY(c,0),y=h.getX(0,d),x=h.getY(0,d),T=h.getX(0,d-u),w=h.getY(0,d-u)),a.batchTri(e,g,m,y,x,T,w,0,0,1,1,v,v,v,2)),t.pipelines.postBatch(e)}}},579:(t,e,i)=>{var s=i(56694),n=i(91461),r=i(88829),a=i(52660),o=new s({Extends:n,Mixins:[a],initialize:function(t,e,i,s,a,o,h,l,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===a&&(a=0),void 0===o&&(o=128),void 0===h&&(h=0),n.call(this,t,"Line",new r(s,a,o,h));var c=Math.max(1,this.geom.right-this.geom.left),d=Math.max(1,this.geom.bottom-this.geom.top);this.lineWidth=1,this._startWidth=1,this._endWidth=1,this.setPosition(e,i),this.setSize(c,d),void 0!==l&&this.setStrokeStyle(1,l,u),this.updateDisplayOrigin()},setLineWidth:function(t,e){return void 0===e&&(e=t),this._startWidth=t,this._endWidth=e,this.lineWidth=t,this},setTo:function(t,e,i,s){return this.geom.setTo(t,e,i,s),this}});t.exports=o},52044:(t,e,i)=>{var s=i(17876),n=i(49584);t.exports=function(t,e,i,r){i.addToRenderList(e);var a=t.currentContext;if(n(t,a,e,i,r)){var o=e._displayOriginX,h=e._displayOriginY;e.isStroked&&(s(a,e),a.beginPath(),a.moveTo(e.geom.x1-o,e.geom.y1-h),a.lineTo(e.geom.x2-o,e.geom.y2-h),a.stroke()),a.restore()}}},85665:(t,e,i)=>{var s=i(61286),n=i(579);s.register("line",(function(t,e,i,s,r,a,o,h){return this.displayList.add(new n(this.scene,t,e,i,s,r,a,o,h))}))},52660:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(46952),r=i(52044),t.exports={renderWebGL:n,renderCanvas:r}},46952:(t,e,i)=>{var s=i(73329),n=i(75512);t.exports=function(t,e,i,r){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),o=s(e,i,r);a.calcMatrix.copyFrom(o.calc);var h=e._displayOriginX,l=e._displayOriginY,u=i.alpha*e.alpha;if(t.pipelines.preBatch(e),e.isStroked){var c=a.strokeTint,d=n.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*u);c.TL=d,c.TR=d,c.BL=d,c.BR=d;var f=e._startWidth,p=e._endWidth;a.batchLine(e.geom.x1-h,e.geom.y1-l,e.geom.x2-h,e.geom.y2-l,f,p,1,0,!1,o.sprite,o.camera)}t.pipelines.postBatch(e)}},91249:(t,e,i)=>{var s=i(70573),n=i(56694),r=i(11117),a=i(14045),o=i(8580),h=i(91461),l=i(18974),u=new n({Extends:h,Mixins:[s],initialize:function(t,e,i,s,n,r){void 0===e&&(e=0),void 0===i&&(i=0),h.call(this,t,"Polygon",new o(s));var l=a(this.geom);this.setPosition(e,i),this.setSize(l.width,l.height),void 0!==n&&this.setFillStyle(n,r),this.updateDisplayOrigin(),this.updateData()},smooth:function(t){void 0===t&&(t=1);for(var e=0;e{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.currentContext;if(r(t,o,e,i,a)){var h=e._displayOriginX,l=e._displayOriginY,u=e.pathData,c=u.length-1,d=u[0]-h,f=u[1]-l;o.beginPath(),o.moveTo(d,f),e.closePath||(c-=2);for(var p=2;p{var s=i(61286),n=i(91249);s.register("polygon",(function(t,e,i,s,r){return this.displayList.add(new n(this.scene,t,e,i,s,r))}))},70573:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(72841),r=i(40834),t.exports={renderWebGL:n,renderCanvas:r}},72841:(t,e,i)=>{var s=i(19543),n=i(73329),r=i(50262);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),h=n(e,i,a),l=o.calcMatrix.copyFrom(h.calc),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&s(o,l,e,d,u,c),e.isStroked&&r(o,e,d,u,c),t.pipelines.postBatch(e)}},517:(t,e,i)=>{var s=i(56694),n=i(74118),r=i(91461),a=i(37673),o=new s({Extends:r,Mixins:[a],initialize:function(t,e,i,s,a,o,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===a&&(a=128),r.call(this,t,"Rectangle",new n(0,0,s,a)),this.setPosition(e,i),this.setSize(s,a),void 0!==o&&this.setFillStyle(o,h),this.updateDisplayOrigin(),this.updateData()},setSize:function(t,e){this.width=t,this.height=e,this.geom.setSize(t,e),this.updateData(),this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),e.getLineD(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=o},4091:(t,e,i)=>{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.currentContext;if(r(t,o,e,i,a)){var h=e._displayOriginX,l=e._displayOriginY;e.isFilled&&(s(o,e),o.fillRect(-h,-l,e.width,e.height)),e.isStroked&&(n(o,e),o.beginPath(),o.rect(-h,-l,e.width,e.height),o.stroke()),o.restore()}}},94355:(t,e,i)=>{var s=i(61286),n=i(517);s.register("rectangle",(function(t,e,i,s,r,a){return this.displayList.add(new n(this.scene,t,e,i,s,r,a))}))},37673:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(43532),r=i(4091),t.exports={renderWebGL:n,renderCanvas:r}},43532:(t,e,i)=>{var s=i(73329),n=i(50262),r=i(75512);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),h=s(e,i,a);o.calcMatrix.copyFrom(h.calc);var l=e._displayOriginX,u=e._displayOriginY,c=i.alpha*e.alpha;if(t.pipelines.preBatch(e),e.isFilled){var d=o.fillTint,f=r.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*c);d.TL=f,d.TR=f,d.BL=f,d.BR=f,o.batchFillRect(-l,-u,e.width,e.height)}e.isStroked&&n(o,e,c,l,u),t.pipelines.postBatch(e)}},77843:(t,e,i)=>{var s=i(87956),n=i(56694),r=i(11117),a=i(91461),o=new n({Extends:a,Mixins:[s],initialize:function(t,e,i,s,n,r,o,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=5),void 0===n&&(n=32),void 0===r&&(r=64),a.call(this,t,"Star",null),this._points=s,this._innerRadius=n,this._outerRadius=r,this.setPosition(e,i),this.setSize(2*r,2*r),void 0!==o&&this.setFillStyle(o,h),this.updateDisplayOrigin(),this.updateData()},setPoints:function(t){return this._points=t,this.updateData()},setInnerRadius:function(t){return this._innerRadius=t,this.updateData()},setOuterRadius:function(t){return this._outerRadius=t,this.updateData()},points:{get:function(){return this._points},set:function(t){this._points=t,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this.updateData()}},updateData:function(){var t=[],e=this._points,i=this._innerRadius,s=this._outerRadius,n=Math.PI/2*3,a=Math.PI/e,o=s,h=s;t.push(o,h+-s);for(var l=0;l{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.currentContext;if(r(t,o,e,i,a)){var h=e._displayOriginX,l=e._displayOriginY,u=e.pathData,c=u.length-1,d=u[0]-h,f=u[1]-l;o.beginPath(),o.moveTo(d,f),e.closePath||(c-=2);for(var p=2;p{var s=i(77843);i(61286).register("star",(function(t,e,i,n,r,a,o){return this.displayList.add(new s(this.scene,t,e,i,n,r,a,o))}))},87956:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(12037),r=i(11401),t.exports={renderWebGL:n,renderCanvas:r}},12037:(t,e,i)=>{var s=i(19543),n=i(73329),r=i(50262);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),h=n(e,i,a),l=o.calcMatrix.copyFrom(h.calc),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&s(o,l,e,d,u,c),e.isStroked&&r(o,e,d,u,c),t.pipelines.postBatch(e)}},21873:(t,e,i)=>{var s=i(56694),n=i(91461),r=i(66349),a=i(70498),o=new s({Extends:n,Mixins:[a],initialize:function(t,e,i,s,a,o,h,l,u,c,d){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===a&&(a=128),void 0===o&&(o=64),void 0===h&&(h=0),void 0===l&&(l=128),void 0===u&&(u=128),n.call(this,t,"Triangle",new r(s,a,o,h,l,u));var f=this.geom.right-this.geom.left,p=this.geom.bottom-this.geom.top;this.setPosition(e,i),this.setSize(f,p),void 0!==c&&this.setFillStyle(c,d),this.updateDisplayOrigin(),this.updateData()},setTo:function(t,e,i,s,n,r){return this.geom.setTo(t,e,i,s,n,r),this.updateData()},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=o},60213:(t,e,i)=>{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.currentContext;if(r(t,o,e,i,a)){var h=e._displayOriginX,l=e._displayOriginY,u=e.geom.x1-h,c=e.geom.y1-l,d=e.geom.x2-h,f=e.geom.y2-l,p=e.geom.x3-h,v=e.geom.y3-l;o.beginPath(),o.moveTo(u,c),o.lineTo(d,f),o.lineTo(p,v),o.closePath(),e.isFilled&&(s(o,e),o.fill()),e.isStroked&&(n(o,e),o.stroke()),o.restore()}}},79296:(t,e,i)=>{var s=i(61286),n=i(21873);s.register("triangle",(function(t,e,i,s,r,a,o,h,l,u){return this.displayList.add(new n(this.scene,t,e,i,s,r,a,o,h,l,u))}))},70498:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(72291),r=i(60213),t.exports={renderWebGL:n,renderCanvas:r}},72291:(t,e,i)=>{var s=i(73329),n=i(50262),r=i(75512);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),h=s(e,i,a);o.calcMatrix.copyFrom(h.calc);var l=e._displayOriginX,u=e._displayOriginY,c=i.alpha*e.alpha;if(t.pipelines.preBatch(e),e.isFilled){var d=o.fillTint,f=r.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*c);d.TL=f,d.TR=f,d.BL=f,d.BR=f;var p=e.geom.x1-l,v=e.geom.y1-u,g=e.geom.x2-l,m=e.geom.y2-u,y=e.geom.x3-l,x=e.geom.y3-u;o.batchFillTriangle(p,v,g,m,y,x,h.sprite,h.camera)}e.isStroked&&n(o,e,c,l,u),t.pipelines.postBatch(e)}},13747:(t,e,i)=>{var s=i(16569),n=i(56694),r=i(64937),a=i(89980),o=i(20791),h=new n({Extends:a,Mixins:[r.Alpha,r.BlendMode,r.Depth,r.Flip,r.FX,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.ScrollFactor,r.Size,r.TextureCrop,r.Tint,r.Transform,r.Visible,o],initialize:function(t,e,i,n,r){a.call(this,t,"Sprite"),this._crop=this.resetCropObject(),this.anims=new s(this),this.setTexture(n,r),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline()},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){this.anims.update(t,e)},play:function(t,e){return this.anims.play(t,e)},playReverse:function(t,e){return this.anims.playReverse(t,e)},playAfterDelay:function(t,e){return this.anims.playAfterDelay(t,e)},playAfterRepeat:function(t,e){return this.anims.playAfterRepeat(t,e)},chain:function(t){return this.anims.chain(t)},stop:function(){return this.anims.stop()},stopAfterDelay:function(t){return this.anims.stopAfterDelay(t)},stopAfterRepeat:function(t){return this.anims.stopAfterRepeat(t)},stopOnFrame:function(t){return this.anims.stopOnFrame(t)},toJSON:function(){return r.ToJSON(this)},preDestroy:function(){this.anims.destroy(),this.anims=void 0}});t.exports=h},27573:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),t.batchSprite(e,e.frame,i,s)}},89219:(t,e,i)=>{var s=i(88933),n=i(32291),r=i(99325),a=i(20494),o=i(13747);r.register("sprite",(function(t,e){void 0===t&&(t={});var i=a(t,"key",null),r=a(t,"frame",null),h=new o(this.scene,0,0,i,r);return void 0!==e&&(t.add=e),s(this.scene,h,t),n(h,t),h}))},66135:(t,e,i)=>{var s=i(61286),n=i(13747);s.register("sprite",(function(t,e,i,s){var r=new n(this.scene,t,e,i,s);return this.displayList.add(r),r}))},20791:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(21034),r=i(27573),t.exports={renderWebGL:n,renderCanvas:r}},21034:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),e.pipeline.batchSprite(e,i,s)}},32979:t=>{t.exports=function(t,e,i){var s=t.canvas,n=t.context,r=t.style,a=[],o=0,h=i.length;r.maxLines>0&&r.maxLines1&&(d+=f*(h-1)),{width:o,height:d,lines:h,lineWidths:a,lineSpacing:f,lineHeight:c}}},27030:(t,e,i)=>{var s=i(61068);t.exports=function(t){var e=s.create(this),i=e.getContext("2d");t.syncFont(e,i);var n=i.measureText(t.testString);if("actualBoundingBoxAscent"in n){var r=n.actualBoundingBoxAscent,a=n.actualBoundingBoxDescent;return s.remove(e),{ascent:r,descent:a,fontSize:r+a}}var o=Math.ceil(n.width*t.baselineX),h=o,l=2*h;h=h*t.baselineY|0,e.width=o,e.height=l,i.fillStyle="#f00",i.fillRect(0,0,o,l),i.font=t._font,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(t.testString,0,h);var u={ascent:0,descent:0,fontSize:0},c=i.getImageData(0,0,o,l);if(!c)return u.ascent=h,u.descent=h+6,u.fontSize=u.ascent+u.descent,s.remove(e),u;var d,f,p=c.data,v=p.length,g=4*o,m=0,y=!1;for(d=0;dh;d--){for(f=0;f{var s=i(99584),n=i(61068),r=i(56694),a=i(64937),o=i(97081),h=i(89980),l=i(32979),u=i(10850),c=i(55638),d=i(80032),f=i(74744),p=new r({Extends:h,Mixins:[a.Alpha,a.BlendMode,a.ComputedSize,a.Crop,a.Depth,a.Flip,a.FX,a.GetBounds,a.Mask,a.Origin,a.Pipeline,a.ScrollFactor,a.Tint,a.Transform,a.Visible,d],initialize:function(t,e,i,s,r){void 0===e&&(e=0),void 0===i&&(i=0),h.call(this,t,"Text"),this.renderer=t.sys.renderer,this.setPosition(e,i),this.setOrigin(0,0),this.initPipeline(),this.canvas=n.create(this),this.context=this.canvas.getContext("2d"),this.style=new f(this,r),this.autoRound=!0,this.splitRegExp=/(?:\r\n|\r|\n)/,this._text=void 0,this.padding={left:0,right:0,top:0,bottom:0},this.width=1,this.height=1,this.lineSpacing=0,this.dirty=!1,0===this.style.resolution&&(this.style.resolution=1),this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(null,this.canvas,!0),this.frame=this.texture.get(),this.frame.source.resolution=this.style.resolution,this.renderer&&this.renderer.gl&&(this.renderer.deleteTexture(this.frame.source.glTexture),this.frame.source.glTexture=null),this.initRTL(),this.setText(s),r&&r.padding&&this.setPadding(r.padding),r&&r.lineSpacing&&this.setLineSpacing(r.lineSpacing),t.sys.game.events.on(o.CONTEXT_RESTORED,this.onContextRestored,this)},initRTL:function(){this.style.rtl&&(this.canvas.dir="rtl",this.context.direction="rtl",this.canvas.style.display="none",s(this.canvas,this.scene.sys.canvas),this.originX=1)},runWordWrap:function(t){var e=this.style;if(e.wordWrapCallback){var i=e.wordWrapCallback.call(e.wordWrapCallbackScope,t,this);return Array.isArray(i)&&(i=i.join("\n")),i}return e.wordWrapWidth?e.wordWrapUseAdvanced?this.advancedWordWrap(t,this.context,this.style.wordWrapWidth):this.basicWordWrap(t,this.context,this.style.wordWrapWidth):t},advancedWordWrap:function(t,e,i){for(var s="",n=t.replace(/ +/gi," ").split(this.splitRegExp),r=n.length,a=0;al){if(0===c){for(var v=f;v.length&&(v=v.slice(0,-1),!((p=e.measureText(v).width)<=l)););if(!v.length)throw new Error("This text's wordWrapWidth setting is less than a single character!");var g=d.substr(v.length);u[c]=g,h+=v}var m=u[c].length?c:c+1,y=u.slice(m).join(" ").replace(/[ \n]*$/gi,"");n[a+1]=y+" "+(n[a+1]||""),r=n.length;break}h+=f,l-=p}s+=h.replace(/[ \n]*$/gi,"")+"\n"}}return s=s.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(t,e,i){for(var s="",n=t.split(this.splitRegExp),r=n.length-1,a=e.measureText(" ").width,o=0;o<=r;o++){for(var h=i,l=n[o].split(" "),u=l.length-1,c=0;c<=u;c++){var d=l[c],f=e.measureText(d).width,p=f;ch&&c>0&&(s+="\n",h=i),s+=d,c0&&(d+=h.lineSpacing*v),i.rtl)c=f-c-u.left-u.right;else if("right"===i.align)c+=a-h.lineWidths[v];else if("center"===i.align)c+=(a-h.lineWidths[v])/2;else if("justify"===i.align){if(h.lineWidths[v]/h.width>=.85){var g=h.width-h.lineWidths[v],m=e.measureText(" ").width,y=o[v].trim(),x=y.split(" ");g+=(o[v].length-y.length)*m;for(var T=Math.floor(g/m),w=0;T>0;)x[w]+=" ",w=(w+1)%(x.length-1||1),--T;o[v]=x.join(" ")}}this.autoRound&&(c=Math.round(c),d=Math.round(d)),i.strokeThickness&&(this.style.syncShadow(e,i.shadowStroke),e.strokeText(o[v],c,d)),i.color&&(this.style.syncShadow(e,i.shadowFill),e.fillText(o[v],c,d))}e.restore(),this.renderer&&this.renderer.gl&&(this.frame.source.glTexture=this.renderer.canvasToTexture(t,this.frame.source.glTexture,!0),this.frame.glTexture=this.frame.source.glTexture),this.dirty=!0;var E=this.input;return E&&!E.customHitArea&&(E.hitArea.width=this.width,E.hitArea.height=this.height),this},getTextMetrics:function(){return this.style.getTextMetrics()},text:{get:function(){return this._text},set:function(t){this.setText(t)}},toJSON:function(){var t=a.ToJSON(this),e={autoRound:this.autoRound,text:this._text,style:this.style.toJSON(),padding:{left:this.padding.left,right:this.padding.right,top:this.padding.top,bottom:this.padding.bottom}};return t.data=e,t},onContextRestored:function(){this.dirty=!0},preDestroy:function(){this.style.rtl&&c(this.canvas),n.remove(this.canvas),this.texture.destroy(),this.scene.sys.game.events.off(o.CONTEXT_RESTORED,this.onContextRestored,this)}});t.exports=p},71649:t=>{t.exports=function(t,e,i,s){0!==e.width&&0!==e.height&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,s))}},75397:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),a=i(76555);n.register("text",(function(t,e){void 0===t&&(t={});var i=r(t,"text",""),n=r(t,"style",null),o=r(t,"padding",null);null!==o&&(n.padding=o);var h=new a(this.scene,0,0,i,n);return void 0!==e&&(t.add=e),s(this.scene,h,t),h.autoRound=r(t,"autoRound",!0),h.resolution=r(t,"resolution",1),h}))},94627:(t,e,i)=>{var s=i(76555);i(61286).register("text",(function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))}))},80032:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(76128),r=i(71649),t.exports={renderWebGL:n,renderCanvas:r}},74744:(t,e,i)=>{var s=i(56694),n=i(20494),r=i(10850),a=i(27030),o={fontFamily:["fontFamily","Courier"],fontSize:["fontSize","16px"],fontStyle:["fontStyle",""],backgroundColor:["backgroundColor",null],color:["color","#fff"],stroke:["stroke","#fff"],strokeThickness:["strokeThickness",0],shadowOffsetX:["shadow.offsetX",0],shadowOffsetY:["shadow.offsetY",0],shadowColor:["shadow.color","#000"],shadowBlur:["shadow.blur",0],shadowStroke:["shadow.stroke",!1],shadowFill:["shadow.fill",!1],align:["align","left"],maxLines:["maxLines",0],fixedWidth:["fixedWidth",0],fixedHeight:["fixedHeight",0],resolution:["resolution",0],rtl:["rtl",!1],testString:["testString","|MÉqgy"],baselineX:["baselineX",1.2],baselineY:["baselineY",1.4],wordWrapWidth:["wordWrap.width",null],wordWrapCallback:["wordWrap.callback",null],wordWrapCallbackScope:["wordWrap.callbackScope",null],wordWrapUseAdvanced:["wordWrap.useAdvancedWrap",!1]},h=new s({initialize:function(t,e){this.parent=t,this.fontFamily,this.fontSize,this.fontStyle,this.backgroundColor,this.color,this.stroke,this.strokeThickness,this.shadowOffsetX,this.shadowOffsetY,this.shadowColor,this.shadowBlur,this.shadowStroke,this.shadowFill,this.align,this.maxLines,this.fixedWidth,this.fixedHeight,this.resolution,this.rtl,this.testString,this.baselineX,this.baselineY,this.wordWrapWidth,this.wordWrapCallback,this.wordWrapCallbackScope,this.wordWrapUseAdvanced,this._font,this.setStyle(e,!1,!0)},setStyle:function(t,e,i){for(var s in void 0===e&&(e=!0),void 0===i&&(i=!1),t&&t.hasOwnProperty("fontSize")&&"number"==typeof t.fontSize&&(t.fontSize=t.fontSize.toString()+"px"),o){var h=i?o[s][1]:this[s];this[s]="wordWrapCallback"===s||"wordWrapCallbackScope"===s?r(t,o[s][0],h):n(t,o[s][0],h)}var l=r(t,"font",null);null!==l&&this.setFont(l,!1),this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim();var u=r(t,"fill",null);null!==u&&(this.color=u);var c=r(t,"metrics",!1);return c?this.metrics={ascent:r(c,"ascent",0),descent:r(c,"descent",0),fontSize:r(c,"fontSize",0)}:!e&&this.metrics||(this.metrics=a(this)),e?this.parent.updateText():this.parent},syncFont:function(t,e){e.font=this._font},syncStyle:function(t,e){e.textBaseline="alphabetic",e.fillStyle=this.color,e.strokeStyle=this.stroke,e.lineWidth=this.strokeThickness,e.lineCap="round",e.lineJoin="round"},syncShadow:function(t,e){e?(t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur):(t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowColor=0,t.shadowBlur=0)},update:function(t){return t&&(this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim(),this.metrics=a(this)),this.parent.updateText()},setFont:function(t,e){void 0===e&&(e=!0);var i=t,s="",n="";if("string"!=typeof t)i=r(t,"fontFamily","Courier"),s=r(t,"fontSize","16px"),n=r(t,"fontStyle","");else{var a=t.split(" "),o=0;n=a.length>2?a[o++]:"",s=a[o++]||"16px",i=a[o++]||"Courier"}return i===this.fontFamily&&s===this.fontSize&&n===this.fontStyle||(this.fontFamily=i,this.fontSize=s,this.fontStyle=n,e&&this.update(!0)),this.parent},setFontFamily:function(t){return this.fontFamily!==t&&(this.fontFamily=t,this.update(!0)),this.parent},setFontStyle:function(t){return this.fontStyle!==t&&(this.fontStyle=t,this.update(!0)),this.parent},setFontSize:function(t){return"number"==typeof t&&(t=t.toString()+"px"),this.fontSize!==t&&(this.fontSize=t,this.update(!0)),this.parent},setTestString:function(t){return this.testString=t,this.update(!0)},setFixedSize:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(!1)},setBackgroundColor:function(t){return this.backgroundColor=t,this.update(!1)},setFill:function(t){return this.color=t,this.update(!1)},setColor:function(t){return this.color=t,this.update(!1)},setResolution:function(t){return this.resolution=t,this.update(!1)},setStroke:function(t,e){return void 0===e&&(e=this.strokeThickness),void 0===t&&0!==this.strokeThickness?(this.strokeThickness=0,this.update(!0)):this.stroke===t&&this.strokeThickness===e||(this.stroke=t,this.strokeThickness=e,this.update(!0)),this.parent},setShadow:function(t,e,i,s,n,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===s&&(s=0),void 0===n&&(n=!1),void 0===r&&(r=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=i,this.shadowBlur=s,this.shadowStroke=n,this.shadowFill=r,this.update(!1)},setShadowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)},setShadowColor:function(t){return void 0===t&&(t="#000"),this.shadowColor=t,this.update(!1)},setShadowBlur:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)},setShadowStroke:function(t){return this.shadowStroke=t,this.update(!1)},setShadowFill:function(t){return this.shadowFill=t,this.update(!1)},setWordWrapWidth:function(t,e){return void 0===e&&(e=!1),this.wordWrapWidth=t,this.wordWrapUseAdvanced=e,this.update(!1)},setWordWrapCallback:function(t,e){return void 0===e&&(e=null),this.wordWrapCallback=t,this.wordWrapCallbackScope=e,this.update(!1)},setAlign:function(t){return void 0===t&&(t="left"),this.align=t,this.update(!1)},setMaxLines:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)},getTextMetrics:function(){var t=this.metrics;return{ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}},toJSON:function(){var t={};for(var e in o)t[e]=this[e];return t.metrics=this.getTextMetrics(),t},destroy:function(){this.parent=void 0}});t.exports=h},76128:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i,n){if(0!==e.width&&0!==e.height){i.addToRenderList(e);var r=e.frame,a=r.width,o=r.height,h=s.getTintAppendFloatAlpha,l=t.pipelines.set(e.pipeline,e),u=l.setTexture2D(r.glTexture,e);l.batchTexture(e,r.glTexture,a,o,e.x,e.y,a/e.style.resolution,o/e.style.resolution,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,a,o,h(e.tintTopLeft,i.alpha*e._alphaTL),h(e.tintTopRight,i.alpha*e._alphaTR),h(e.tintBottomLeft,i.alpha*e._alphaBL),h(e.tintBottomRight,i.alpha*e._alphaBR),e.tintFill,0,0,i,n,!1,u)}}},35856:(t,e,i)=>{var s=i(61068),n=i(56694),r=i(64937),a=i(97081),o=i(89980),h=i(3504),l=i(8213),u=i(9271),c=i(93736),d=new n({Extends:o,Mixins:[r.Alpha,r.BlendMode,r.ComputedSize,r.Crop,r.Depth,r.Flip,r.FX,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.ScrollFactor,r.Tint,r.Transform,r.Visible,u],initialize:function(t,e,i,n,r,l,u){var d=t.sys.renderer;o.call(this,t,"TileSprite");var f=t.sys.textures.get(l),p=f.get(u);p.source.compressionAlgorithm&&(console.warn("TileSprite cannot use compressed textures"),p=(f=t.sys.textures.get("__MISSING")).get()),n&&r?(n=Math.floor(n),r=Math.floor(r)):(n=p.width,r=p.height),this._tilePosition=new c,this._tileScale=new c(1,1),this.dirty=!1,this.renderer=d,this.canvas=s.create(this,n,r),this.context=this.canvas.getContext("2d"),this.displayTexture=f,this.displayFrame=p,this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(null,this.canvas,!0),this.frame=this.texture.get(),this.potWidth=h(p.width),this.potHeight=h(p.height),this.fillCanvas=s.create2D(this,this.potWidth,this.potHeight),this.fillContext=this.fillCanvas.getContext("2d"),this.fillPattern=null,this.setPosition(e,i),this.setSize(n,r),this.setFrame(u),this.setOriginFromFrame(),this.initPipeline(),t.sys.game.events.on(a.CONTEXT_RESTORED,this.onContextRestored,this)},setTexture:function(t,e){return this.displayTexture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t){var e=this.displayTexture.get(t);return this.potWidth=h(e.width),this.potHeight=h(e.height),this.canvas.width=0,e.cutWidth&&e.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this.displayFrame=e,this.dirty=!0,this.updateTileTexture(),this},setTilePosition:function(t,e){return void 0!==t&&(this.tilePositionX=t),void 0!==e&&(this.tilePositionY=e),this},setTileScale:function(t,e){return void 0===t&&(t=this.tileScaleX),void 0===e&&(e=t),this.tileScaleX=t,this.tileScaleY=e,this},updateTileTexture:function(){if(this.dirty&&this.renderer){var t=this.displayFrame;if(t.source.isRenderTexture||t.source.isGLTexture)return console.warn("TileSprites can only use Image or Canvas based textures"),void(this.dirty=!1);var e=this.fillContext,i=this.fillCanvas,s=this.potWidth,n=this.potHeight;this.renderer&&this.renderer.gl||(s=t.cutWidth,n=t.cutHeight),e.clearRect(0,0,s,n),i.width=s,i.height=n,e.drawImage(t.source.image,t.cutX,t.cutY,t.cutWidth,t.cutHeight,0,0,s,n),this.renderer&&this.renderer.gl?this.fillPattern=this.renderer.canvasToTexture(i,this.fillPattern):this.fillPattern=e.createPattern(i,"repeat"),this.updateCanvas(),this.dirty=!1}},updateCanvas:function(){var t=this.canvas;if(t.width===this.width&&t.height===this.height||(t.width=this.width,t.height=this.height,this.frame.setSize(this.width,this.height),this.updateDisplayOrigin(),this.dirty=!0),!this.dirty||this.renderer&&this.renderer.gl)this.dirty=!1;else{var e=this.context;this.scene.sys.game.config.antialias||l.disable(e);var i=this._tileScale.x,s=this._tileScale.y,n=this._tilePosition.x,r=this._tilePosition.y;e.clearRect(0,0,this.width,this.height),e.save(),e.scale(i,s),e.translate(-n,-r),e.fillStyle=this.fillPattern,e.fillRect(n,r,this.width/i,this.height/s),e.restore(),this.dirty=!1}},onContextRestored:function(t){if(t){var e=t.gl;this.dirty=!0,this.fillPattern=null,this.fillPattern=t.createTexture2D(0,e.LINEAR,e.LINEAR,e.REPEAT,e.REPEAT,e.RGBA,this.fillCanvas,this.potWidth,this.potHeight)}},preDestroy:function(){this.renderer&&this.renderer.gl&&this.renderer.deleteTexture(this.fillPattern),s.remove(this.canvas),s.remove(this.fillCanvas),this.fillPattern=null,this.fillContext=null,this.fillCanvas=null,this.displayTexture=null,this.displayFrame=null,this.texture.destroy(),this.renderer=null,this.scene.sys.game.events.off(a.CONTEXT_RESTORED,this.onContextRestored,this)},tilePositionX:{get:function(){return this._tilePosition.x},set:function(t){this._tilePosition.x=t,this.dirty=!0}},tilePositionY:{get:function(){return this._tilePosition.y},set:function(t){this._tilePosition.y=t,this.dirty=!0}},tileScaleX:{get:function(){return this._tileScale.x},set:function(t){this._tileScale.x=t,this.dirty=!0}},tileScaleY:{get:function(){return this._tileScale.y},set:function(t){this._tileScale.y=t,this.dirty=!0}}});t.exports=d},93305:t=>{t.exports=function(t,e,i,s){e.updateCanvas(),i.addToRenderList(e),t.batchSprite(e,e.frame,i,s)}},63950:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),a=i(35856);n.register("tileSprite",(function(t,e){void 0===t&&(t={});var i=r(t,"x",0),n=r(t,"y",0),o=r(t,"width",512),h=r(t,"height",512),l=r(t,"key",""),u=r(t,"frame",""),c=new a(this.scene,i,n,o,h,l,u);return void 0!==e&&(t.add=e),s(this.scene,c,t),c}))},20509:(t,e,i)=>{var s=i(35856);i(61286).register("tileSprite",(function(t,e,i,n,r,a){return this.displayList.add(new s(this.scene,t,e,i,n,r,a))}))},9271:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(74287),r=i(93305),t.exports={renderWebGL:n,renderCanvas:r}},74287:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i,n){e.updateCanvas();var r=e.width,a=e.height;if(0!==r&&0!==a){i.addToRenderList(e);var o=s.getTintAppendFloatAlpha,h=t.pipelines.set(e.pipeline,e),l=h.setTexture2D(e.fillPattern,e);h.batchTexture(e,e.fillPattern,e.displayFrame.width*e.tileScaleX,e.displayFrame.height*e.tileScaleY,e.x,e.y,r,a,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.originX*r,e.originY*a,0,0,r,a,o(e.tintTopLeft,i.alpha*e._alphaTL),o(e.tintTopRight,i.alpha*e._alphaTR),o(e.tintBottomLeft,i.alpha*e._alphaBL),o(e.tintBottomRight,i.alpha*e._alphaBR),e.tintFill,e.tilePositionX%e.displayFrame.width/e.displayFrame.width,e.tilePositionY%e.displayFrame.height/e.displayFrame.height,i,n,!1,l)}}},8630:(t,e,i)=>{var s=i(56694),n=i(82897),r=i(64937),a=i(56631),o=i(97081),h=i(33963),l=i(89980),u=i(76038),c=i(76583),d=i(77974),f=i(83392),p=new s({Extends:l,Mixins:[r.Alpha,r.BlendMode,r.Depth,r.Flip,r.FX,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.ScrollFactor,r.Size,r.TextureCrop,r.Tint,r.Transform,r.Visible,d],initialize:function(t,e,i,s){l.call(this,t,"Video"),this.video=null,this.videoTexture=null,this.videoTextureSource=null,this.snapshotTexture=null,this.flipY=!1,this._key=c(),this.touchLocked=!0,this.playWhenUnlocked=!1,this.retryLimit=20,this.retry=0,this.retryInterval=500,this._retryID=null,this._systemMuted=!1,this._codeMuted=!1,this._systemPaused=!1,this._codePaused=!1,this._callbacks={play:this.playHandler.bind(this),error:this.loadErrorHandler.bind(this),end:this.completeHandler.bind(this),time:this.timeUpdateHandler.bind(this),seeking:this.seekingHandler.bind(this),seeked:this.seekedHandler.bind(this)},this._crop=this.resetCropObject(),this.markers={},this._markerIn=-1,this._markerOut=f.MAX_SAFE_INTEGER,this._lastUpdate=0,this._cacheKey="",this._isSeeking=!1,this.removeVideoElementOnDestroy=!1,this.setPosition(e,i),this.initPipeline(),s&&this.changeSource(s,!1);var n=t.sys.game.events;n.on(o.PAUSE,this.globalPause,this),n.on(o.RESUME,this.globalResume,this);var r=t.sys.sound;r&&r.on(u.GLOBAL_MUTE,this.globalMute,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},play:function(t,e,i){if(this.touchLocked&&this.playWhenUnlocked||this.isPlaying())return this;var s=this.video;if(!s)return console.warn("Video not loaded"),this;void 0===t&&(t=s.loop);var n=this.scene.sys.sound;n&&n.mute&&this.setMute(!0),isNaN(e)||(this._markerIn=e),!isNaN(i)&&i>e&&(this._markerOut=i),s.loop=t;var r=this._callbacks,a=s.play();return void 0!==a?a.then(this.playPromiseSuccessHandler.bind(this)).catch(this.playPromiseErrorHandler.bind(this)):(s.addEventListener("playing",r.play,!0),s.readyState<2&&(this.retry=this.retryLimit,this._retryID=window.setTimeout(this.checkVideoProgress.bind(this),this.retryInterval))),s.addEventListener("ended",r.end,!0),s.addEventListener("timeupdate",r.time,!0),s.addEventListener("seeking",r.seeking,!0),s.addEventListener("seeked",r.seeked,!0),this},changeSource:function(t,e,i,s,n){void 0===e&&(e=!0),this.video&&this.stop();var r=this.scene.sys.cache.video.get(t);return r?(this.video=r,this._cacheKey=t,this._codePaused=r.paused,this._codeMuted=r.muted,this.videoTexture?(this.scene.sys.textures.remove(this._key),this.videoTexture=this.scene.sys.textures.create(this._key,r,r.videoWidth,r.videoHeight),this.videoTextureSource=this.videoTexture.source[0],this.videoTexture.add("__BASE",0,0,0,r.videoWidth,r.videoHeight),this.setTexture(this.videoTexture),this.setSizeToFrame(),this.updateDisplayOrigin(),this.emit(a.VIDEO_CREATED,this,r.videoWidth,r.videoHeight)):this.updateTexture(),r.currentTime=0,this._lastUpdate=0,e&&this.play(i,s,n)):this.video=null,this},addMarker:function(t,e,i){return!isNaN(e)&&e>=0&&!isNaN(i)&&(this.markers[t]=[e,i]),this},playMarker:function(t,e){var i=this.markers[t];return i&&this.play(e,i[0],i[1]),this},removeMarker:function(t){return delete this.markers[t],this},snapshot:function(t,e){return void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.snapshotArea(0,0,this.width,this.height,t,e)},snapshotArea:function(t,e,i,s,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===s&&(s=this.height),void 0===n&&(n=i),void 0===r&&(r=s);var a=this.video,o=this.snapshotTexture;return o?(o.setSize(n,r),a&&o.context.drawImage(a,t,e,i,s,0,0,n,r)):(o=this.scene.sys.textures.createCanvas(c(),n,r),this.snapshotTexture=o,a&&o.context.drawImage(a,t,e,i,s,0,0,n,r)),o.update()},saveSnapshotTexture:function(t){return this.snapshotTexture?this.scene.sys.textures.renameTexture(this.snapshotTexture.key,t):this.snapshotTexture=this.scene.sys.textures.createCanvas(t,this.width,this.height),this.snapshotTexture},loadURL:function(t,e,i,s){void 0===e&&(e="loadeddata"),void 0===i&&(i=!1),this.video&&this.stop(),this.videoTexture&&this.scene.sys.textures.remove(this._key);var n=document.createElement("video");return n.controls=!1,i&&(n.muted=!0,n.defaultMuted=!0,n.setAttribute("autoplay","autoplay")),n.setAttribute("playsinline","playsinline"),n.setAttribute("preload","auto"),void 0!==s&&n.setAttribute("crossorigin",s),n.addEventListener("error",this._callbacks.error,!0),n.src=t,n.load(),this.video=n,this},loadMediaStream:function(t,e,i){void 0===e&&(e="loadeddata"),void 0===i&&(i=!1),this.video&&this.stop(),this.videoTexture&&this.scene.sys.textures.remove(this._key);var s=document.createElement("video");s.controls=!1,i&&(s.muted=!0,s.defaultMuted=!0,s.setAttribute("autoplay","autoplay")),s.setAttribute("playsinline","playsinline"),s.setAttribute("preload","auto"),s.addEventListener("error",this._callbacks.error,!0);try{s.srcObject=t}catch(e){s.src=window.URL.createObjectURL(t)}return s.load(),this.video=s,this},playPromiseSuccessHandler:function(){this._codePaused=!1,this.touchLocked=!1,this.emit(a.VIDEO_PLAY,this),this._markerIn>-1&&(this.video.currentTime=this._markerIn)},playPromiseErrorHandler:function(t){this.scene.sys.input.once(h.POINTER_DOWN,this.unlockHandler,this),this.touchLocked=!0,this.playWhenUnlocked=!0,this.emit(a.VIDEO_ERROR,this,t)},playHandler:function(){this._codePaused=!1,this.touchLocked=!1,this.emit(a.VIDEO_PLAY,this),this.video.removeEventListener("playing",this._callbacks.play,!0)},loadErrorHandler:function(t){this.stop(),this.emit(a.VIDEO_ERROR,this,t)},unlockHandler:function(){this.touchLocked=!1,this.playWhenUnlocked=!1,this.emit(a.VIDEO_UNLOCKED,this),this._markerIn>-1&&(this.video.currentTime=this._markerIn),this.video.play(),this.emit(a.VIDEO_PLAY,this)},completeHandler:function(){this.emit(a.VIDEO_COMPLETE,this)},timeUpdateHandler:function(){this.video&&this.video.currentTime=this._markerOut&&(t.loop?(t.currentTime=this._markerIn,this.updateTexture(),this._lastUpdate=e,this.emit(a.VIDEO_LOOP,this)):(this.emit(a.VIDEO_COMPLETE,this),this.stop())))}},checkVideoProgress:function(){this.video.readyState>=2?this.updateTexture():(this.retry--,this.retry>0?this._retryID=window.setTimeout(this.checkVideoProgress.bind(this),this.retryInterval):this.emit(a.VIDEO_TIMEOUT,this))},updateTexture:function(){var t=this.video,e=t.videoWidth,i=t.videoHeight;if(this.videoTexture){var s=this.videoTextureSource;s.source!==t&&(s.source=t,s.width=e,s.height=i),s.update()}else this.videoTexture=this.scene.sys.textures.create(this._key,t,e,i),this.videoTextureSource=this.videoTexture.source[0],this.videoTexture.add("__BASE",0,0,0,e,i),this.setTexture(this.videoTexture),this.setSizeToFrame(),this.updateDisplayOrigin(),this.emit(a.VIDEO_CREATED,this,e,i)},getVideoKey:function(){return this._cacheKey},seekTo:function(t){var e=this.video;if(e){var i=e.duration;if(i!==1/0&&!isNaN(i)){var s=i*t;this.setCurrentTime(s)}}return this},getCurrentTime:function(){return this.video?this.video.currentTime:0},setCurrentTime:function(t){var e=this.video;if(e){if("string"==typeof t){var i=t[0],s=parseFloat(t.substr(1));"+"===i?t=e.currentTime+s:"-"===i&&(t=e.currentTime-s)}e.currentTime=t,this._lastUpdate=t}return this},isSeeking:function(){return this._isSeeking},seekingHandler:function(){this._isSeeking=!0,this.emit(a.VIDEO_SEEKING,this)},seekedHandler:function(){this._isSeeking=!1,this.emit(a.VIDEO_SEEKED,this),this.video&&this.updateTexture()},getProgress:function(){var t=this.video;if(t){var e=t.currentTime,i=t.duration;if(i!==1/0&&!isNaN(i))return e/i}return 0},getDuration:function(){return this.video?this.video.duration:0},setMute:function(t){void 0===t&&(t=!0),this._codeMuted=t;var e=this.video;return e&&(e.muted=!!this._systemMuted||t),this},isMuted:function(){return this._codeMuted},globalMute:function(t,e){this._systemMuted=e;var i=this.video;i&&(i.muted=!!this._codeMuted||e)},globalPause:function(){this._systemPaused=!0,this.video&&this.video.pause()},globalResume:function(){this._systemPaused=!1,this.video&&!this._codePaused&&this.video.play()},setPaused:function(t){void 0===t&&(t=!0);var e=this.video;return this._codePaused=t,e&&(t?e.paused||e.pause():t||e.paused&&!this._systemPaused&&e.play()),this},getVolume:function(){return this.video?this.video.volume:1},setVolume:function(t){return void 0===t&&(t=1),this.video&&(this.video.volume=n(t,0,1)),this},getPlaybackRate:function(){return this.video?this.video.playbackRate:1},setPlaybackRate:function(t){return this.video&&(this.video.playbackRate=t),this},getLoop:function(){return!!this.video&&this.video.loop},setLoop:function(t){return void 0===t&&(t=!0),this.video&&(this.video.loop=t),this},isPlaying:function(){return!!this.video&&!(this.video.paused||this.video.ended)},isPaused:function(){return this.video&&this.video.paused||this._codePaused||this._systemPaused},saveTexture:function(t,e){return void 0===e&&(e=!1),this.videoTexture&&this.scene.sys.textures.renameTexture(this._key,t),this._key=t,this.flipY=e,this.videoTextureSource&&this.videoTextureSource.setFlipY(e),this.videoTexture},stop:function(){var t=this.video;if(t){var e=this._callbacks;for(var i in e)t.removeEventListener(i,e[i],!0);t.pause()}return this._retryID&&window.clearTimeout(this._retryID),this.emit(a.VIDEO_STOP,this),this},removeVideoElement:function(){var t=this.video;if(t){for(t.parentNode&&t.parentNode.removeChild(t);t.hasChildNodes();)t.removeChild(t.firstChild);t.removeAttribute("autoplay"),t.removeAttribute("src"),this.video=null}},preDestroy:function(){this.stop(),this.removeVideoElementOnDestroy&&this.removeVideoElement();var t=this.scene.sys.game.events;t.off(o.PAUSE,this.globalPause,this),t.off(o.RESUME,this.globalResume,this);var e=this.scene.sys.sound;e&&e.off(u.GLOBAL_MUTE,this.globalMute,this),this._retryID&&window.clearTimeout(this._retryID)}});t.exports=p},56933:t=>{t.exports=function(t,e,i,s){e.videoTexture&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,s))}},65601:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),a=i(8630);n.register("video",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=new a(this.scene,0,0,i);return void 0!==e&&(t.add=e),s(this.scene,n,t),n}))},215:(t,e,i)=>{var s=i(8630);i(61286).register("video",(function(t,e,i){return this.displayList.add(new s(this.scene,t,e,i))}))},77974:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(83572),r=i(56933),t.exports={renderWebGL:n,renderCanvas:r}},83572:t=>{t.exports=function(t,e,i,s){e.videoTexture&&(i.addToRenderList(e),e.pipeline.batchSprite(e,i,s))}},71030:(t,e,i)=>{var s=i(95723),n=i(26673),r=i(65650),a=i(56694),o=i(64937),h=i(89980),l=i(74118),u=i(94287),c=new a({Extends:h,Mixins:[o.Depth,o.GetBounds,o.Origin,o.Transform,o.ScrollFactor,o.Visible],initialize:function(t,e,i,n,r){void 0===n&&(n=1),void 0===r&&(r=n),h.call(this,t,"Zone"),this.setPosition(e,i),this.width=n,this.height=r,this.blendMode=s.NORMAL,this.updateDisplayOrigin()},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e,i){void 0===i&&(i=!0),this.width=t,this.height=e,this.updateDisplayOrigin();var s=this.input;return i&&s&&!s.customHitArea&&(s.hitArea.width=t,s.hitArea.height=e),this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},setCircleDropZone:function(t){return this.setDropZone(new n(0,0,t),r)},setRectangleDropZone:function(t,e){return this.setDropZone(new l(0,0,t,e),u)},setDropZone:function(t,e){return this.input||this.setInteractive(t,e,!0),this},setAlpha:function(){},setBlendMode:function(){},renderCanvas:function(t,e,i){i.addToRenderList(e)},renderWebGL:function(t,e,i){i.addToRenderList(e)}});t.exports=c},24067:(t,e,i)=>{var s=i(99325),n=i(20494),r=i(71030);s.register("zone",(function(t){var e=n(t,"x",0),i=n(t,"y",0),s=n(t,"width",1),a=n(t,"height",s);return new r(this.scene,e,i,s,a)}))},34546:(t,e,i)=>{var s=i(71030);i(61286).register("zone",(function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))}))},95847:t=>{t.exports=function(t){return t.radius>0?Math.PI*t.radius*t.radius:0}},26673:(t,e,i)=>{var s=i(56694),n=i(65650),r=i(94026),a=i(62941),o=i(52394),h=i(30977),l=new s({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.type=o.CIRCLE,this.x=t,this.y=e,this._radius=i,this._diameter=2*i},contains:function(t,e){return n(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i){return this.x=t,this.y=e,this._radius=i,this._diameter=2*i,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this._diameter=2*t}},diameter:{get:function(){return this._diameter},set:function(t){this._diameter=t,this._radius=.5*t}},left:{get:function(){return this.x-this._radius},set:function(t){this.x=t+this._radius}},right:{get:function(){return this.x+this._radius},set:function(t){this.x=t-this._radius}},top:{get:function(){return this.y-this._radius},set:function(t){this.y=t+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(t){this.y=t-this._radius}}});t.exports=l},37964:t=>{t.exports=function(t){return Math.PI*t.radius*2}},72233:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){return void 0===i&&(i=new s),i.x=t.x+t.radius*Math.cos(e),i.y=t.y+t.radius*Math.sin(e),i}},61761:(t,e,i)=>{var s=i(26673);t.exports=function(t){return new s(t.x,t.y,t.radius)}},65650:t=>{t.exports=function(t,e,i){return t.radius>0&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},39187:(t,e,i)=>{var s=i(65650);t.exports=function(t,e){return s(t,e.x,e.y)}},58672:(t,e,i)=>{var s=i(65650);t.exports=function(t,e){return s(t,e.x,e.y)&&s(t,e.right,e.y)&&s(t,e.x,e.bottom)&&s(t,e.right,e.bottom)}},42997:t=>{t.exports=function(t,e){return e.setTo(t.x,t.y,t.radius)}},94894:t=>{t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.radius===e.radius}},48027:(t,e,i)=>{var s=i(74118);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.left,e.y=t.top,e.width=t.diameter,e.height=t.diameter,e}},94026:(t,e,i)=>{var s=i(72233),n=i(91806),r=i(83392),a=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new a);var o=n(e,0,r.PI2);return s(t,o,i)}},62941:(t,e,i)=>{var s=i(37964),n=i(72233),r=i(91806),a=i(83392);t.exports=function(t,e,i,o){void 0===o&&(o=[]),!e&&i>0&&(e=s(t)/i);for(var h=0;h{t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},88665:t=>{t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},30977:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){void 0===e&&(e=new s);var i=2*Math.PI*Math.random(),n=Math.random()+Math.random(),r=n>1?2-n:n,a=r*Math.cos(i),o=r*Math.sin(i);return e.x=t.x+a*t.radius,e.y=t.y+o*t.radius,e}},6112:(t,e,i)=>{var s=i(26673);s.Area=i(95847),s.Circumference=i(37964),s.CircumferencePoint=i(72233),s.Clone=i(61761),s.Contains=i(65650),s.ContainsPoint=i(39187),s.ContainsRect=i(58672),s.CopyFrom=i(42997),s.Equals=i(94894),s.GetBounds=i(48027),s.GetPoint=i(94026),s.GetPoints=i(62941),s.Offset=i(34585),s.OffsetPoint=i(88665),s.Random=i(30977),t.exports=s},52394:t=>{t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},58605:t=>{t.exports=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI}},39507:t=>{t.exports=function(t){var e=t.width/2,i=t.height/2,s=Math.pow(e-i,2)/Math.pow(e+i,2);return Math.PI*(e+i)*(1+3*s/(10+Math.sqrt(4-3*s)))}},86998:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=t.width/2,r=t.height/2;return i.x=t.x+n*Math.cos(e),i.y=t.y+r*Math.sin(e),i}},81773:(t,e,i)=>{var s=i(95669);t.exports=function(t){return new s(t.x,t.y,t.width,t.height)}},72313:t=>{t.exports=function(t,e,i){if(t.width<=0||t.height<=0)return!1;var s=(e-t.x)/t.width,n=(i-t.y)/t.height;return(s*=s)+(n*=n)<.25}},34368:(t,e,i)=>{var s=i(72313);t.exports=function(t,e){return s(t,e.x,e.y)}},71431:(t,e,i)=>{var s=i(72313);t.exports=function(t,e){return s(t,e.x,e.y)&&s(t,e.right,e.y)&&s(t,e.x,e.bottom)&&s(t,e.right,e.bottom)}},75459:t=>{t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},95669:(t,e,i)=>{var s=i(56694),n=i(72313),r=i(95340),a=i(54978),o=i(52394),h=i(72006),l=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.type=o.ELLIPSE,this.x=t,this.y=e,this.width=i,this.height=s},contains:function(t,e){return n(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setEmpty:function(){return this.width=0,this.height=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getMinorRadius:function(){return Math.min(this.width,this.height)/2},getMajorRadius:function(){return Math.max(this.width,this.height)/2},left:{get:function(){return this.x-this.width/2},set:function(t){this.x=t+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(t){this.y=t+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=l},98068:t=>{t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},72897:(t,e,i)=>{var s=i(74118);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.left,e.y=t.top,e.width=t.width,e.height=t.height,e}},95340:(t,e,i)=>{var s=i(86998),n=i(91806),r=i(83392),a=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new a);var o=n(e,0,r.PI2);return s(t,o,i)}},54978:(t,e,i)=>{var s=i(39507),n=i(86998),r=i(91806),a=i(83392);t.exports=function(t,e,i,o){void 0===o&&(o=[]),!e&&i>0&&(e=s(t)/i);for(var h=0;h{t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},36233:t=>{t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},72006:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){void 0===e&&(e=new s);var i=Math.random()*Math.PI*2,n=Math.sqrt(Math.random());return e.x=t.x+n*Math.cos(i)*t.width/2,e.y=t.y+n*Math.sin(i)*t.height/2,e}},40652:(t,e,i)=>{var s=i(95669);s.Area=i(58605),s.Circumference=i(39507),s.CircumferencePoint=i(86998),s.Clone=i(81773),s.Contains=i(72313),s.ContainsPoint=i(34368),s.ContainsRect=i(71431),s.CopyFrom=i(75459),s.Equals=i(98068),s.GetBounds=i(72897),s.GetPoint=i(95340),s.GetPoints=i(54978),s.Offset=i(77951),s.OffsetPoint=i(36233),s.Random=i(72006),t.exports=s},84068:(t,e,i)=>{var s=i(52394),n=i(98611),r={Circle:i(6112),Ellipse:i(40652),Intersects:i(7563),Line:i(28482),Mesh:i(14293),Point:i(63472),Polygon:i(44359),Rectangle:i(66658),Triangle:i(87619)};r=n(!1,r,s),t.exports=r},22184:(t,e,i)=>{var s=i(53996);t.exports=function(t,e){return s(t.x,t.y,e.x,e.y)<=t.radius+e.radius}},26535:t=>{t.exports=function(t,e){var i=e.width/2,s=e.height/2,n=Math.abs(t.x-e.x-i),r=Math.abs(t.y-e.y-s),a=i+t.radius,o=s+t.radius;if(n>a||r>o)return!1;if(n<=i||r<=s)return!0;var h=n-i,l=r-s;return h*h+l*l<=t.radius*t.radius}},71145:(t,e,i)=>{var s=i(79967),n=i(22184);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r,a,o,h,l=t.x,u=t.y,c=t.radius,d=e.x,f=e.y,p=e.radius;if(u===f)0===(o=(a=-2*f)*a-4*(r=1)*(d*d+(h=(p*p-c*c-d*d+l*l)/(2*(l-d)))*h-2*d*h+f*f-p*p))?i.push(new s(h,-a/(2*r))):o>0&&(i.push(new s(h,(-a+Math.sqrt(o))/(2*r))),i.push(new s(h,(-a-Math.sqrt(o))/(2*r))));else{var v=(l-d)/(u-f),g=(p*p-c*c-d*d+l*l-f*f+u*u)/(2*(u-f));0===(o=(a=2*u*v-2*g*v-2*l)*a-4*(r=v*v+1)*(l*l+u*u+g*g-c*c-2*u*g))?(h=-a/(2*r),i.push(new s(h,g-h*v))):o>0&&(h=(-a+Math.sqrt(o))/(2*r),i.push(new s(h,g-h*v)),h=(-a-Math.sqrt(o))/(2*r),i.push(new s(h,g-h*v)))}}return i}},62508:(t,e,i)=>{var s=i(26111),n=i(26535);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=e.getLineA(),a=e.getLineB(),o=e.getLineC(),h=e.getLineD();s(r,t,i),s(a,t,i),s(o,t,i),s(h,t,i)}return i}},26111:(t,e,i)=>{var s=i(79967),n=i(61472);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r,a,o=t.x1,h=t.y1,l=t.x2,u=t.y2,c=e.x,d=e.y,f=e.radius,p=l-o,v=u-h,g=o-c,m=h-d,y=p*p+v*v,x=2*(p*g+v*m),T=x*x-4*y*(g*g+m*m-f*f);if(0===T){var w=-x/(2*y);r=o+w*p,a=h+w*v,w>=0&&w<=1&&i.push(new s(r,a))}else if(T>0){var E=(-x-Math.sqrt(T))/(2*y);r=o+E*p,a=h+E*v,E>=0&&E<=1&&i.push(new s(r,a));var S=(-x+Math.sqrt(T))/(2*y);r=o+S*p,a=h+S*v,S>=0&&S<=1&&i.push(new s(r,a))}}return i}},96537:(t,e,i)=>{var s=i(70015);t.exports=function(t,e,i,n){void 0===i&&(i=!1);var r,a,o,h=t.x1,l=t.y1,u=t.x2,c=t.y2,d=e.x1,f=e.y1,p=u-h,v=c-l,g=e.x2-d,m=e.y2-f,y=p*m-v*g;if(0===y)return!1;if(i){if((a=(d+g*(r=(p*(f-l)+v*(h-d))/(g*v-m*p))-h)/p)<0||r<0||r>1)return null;o=a}else{if(a=((l-f)*p-(h-d)*v)/y,(r=((d-h)*m-(f-l)*g)/y)<0||r>1||a<0||a>1)return null;o=r}return void 0===n&&(n=new s),n.set(h+p*o,l+v*o,o)}},17647:(t,e,i)=>{var s=i(96537),n=i(88829),r=i(70015),a=new n,o=new r;t.exports=function(t,e,i,n){void 0===i&&(i=!1),void 0===n&&(n=new r);var h=!1;n.set(),o.set();for(var l=e[0],u=1;u{var s=i(70015),n=i(51729),r=i(17647),a=new s;t.exports=function(t,e,i,s){void 0===s&&(s=new n),Array.isArray(e)||(e=[e]);var o=!1;s.set(),a.set();for(var h=0;h{var s=i(79967),n=i(25227),r=i(47910);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e))for(var a=e.getLineA(),o=e.getLineB(),h=e.getLineC(),l=e.getLineD(),u=[new s,new s,new s,new s],c=[n(a,t,u[0]),n(o,t,u[1]),n(h,t,u[2]),n(l,t,u[3])],d=0;d<4;d++)c[d]&&i.push(u[d]);return i}},7449:(t,e,i)=>{var s=i(51729),n=i(68439),r=new(i(88829));function a(t,e,i,a,o){var h=Math.cos(t),l=Math.sin(t);r.setTo(e,i,e+h,i+l);var u=n(r,a,!0);u&&o.push(new s(u.x,u.y,t,u.w))}function o(t,e){return t.z-e.z}t.exports=function(t,e,i){Array.isArray(i)||(i=[i]);for(var s=[],n=[],r=0;r{var s=i(74118),n=i(90205);t.exports=function(t,e,i){return void 0===i&&(i=new s),n(t,e)&&(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y),i}},1946:(t,e,i)=>{var s=i(9569),n=i(90205);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=t.getLineA(),a=t.getLineB(),o=t.getLineC(),h=t.getLineD();s(r,e,i),s(a,e,i),s(o,e,i),s(h,e,i)}return i}},34211:(t,e,i)=>{var s=i(20370),n=i(9569);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=e.getLineA(),a=e.getLineB(),o=e.getLineC();n(r,t,i),n(a,t,i),n(o,t,i)}return i}},80511:(t,e,i)=>{var s=i(26111),n=i(48411);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=t.getLineA(),a=t.getLineB(),o=t.getLineC();s(r,e,i),s(a,e,i),s(o,e,i)}return i}},31343:(t,e,i)=>{var s=i(79967),n=i(86117),r=i(25227);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e))for(var a=t.getLineA(),o=t.getLineB(),h=t.getLineC(),l=[new s,new s,new s],u=[r(a,e,l[0]),r(o,e,l[1]),r(h,e,l[2])],c=0;c<3;c++)u[c]&&i.push(l[c]);return i}},70534:(t,e,i)=>{var s=i(23589),n=i(31343);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=e.getLineA(),a=e.getLineB(),o=e.getLineC();n(t,r,i),n(t,a,i),n(t,o,i)}return i}},61472:(t,e,i)=>{var s=i(65650),n=new(i(79967));t.exports=function(t,e,i){if(void 0===i&&(i=n),s(e,t.x1,t.y1))return i.x=t.x1,i.y=t.y1,!0;if(s(e,t.x2,t.y2))return i.x=t.x2,i.y=t.y2,!0;var r=t.x2-t.x1,a=t.y2-t.y1,o=e.x-t.x1,h=e.y-t.y1,l=r*r+a*a,u=r,c=a;if(l>0){var d=(o*r+h*a)/l;u*=d,c*=d}return i.x=t.x1+u,i.y=t.y1+c,u*u+c*c<=l&&u*r+c*a>=0&&s(e,i.x,i.y)}},25227:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=t.x1,r=t.y1,a=t.x2,o=t.y2,h=e.x1,l=e.y1,u=e.x2,c=e.y2,d=(c-l)*(a-n)-(u-h)*(o-r);if(0===d)return!1;var f=((u-h)*(r-l)-(c-l)*(n-h))/d,p=((a-n)*(r-l)-(o-r)*(n-h))/d;return f>=0&&f<=1&&p>=0&&p<=1&&(i.x=n+f*(a-n),i.y=r+f*(o-r),!0)}},47910:t=>{t.exports=function(t,e){var i=t.x1,s=t.y1,n=t.x2,r=t.y2,a=e.x,o=e.y,h=e.right,l=e.bottom,u=0;if(i>=a&&i<=h&&s>=o&&s<=l||n>=a&&n<=h&&r>=o&&r<=l)return!0;if(i=a){if((u=s+(r-s)*(a-i)/(n-i))>o&&u<=l)return!0}else if(i>h&&n<=h&&(u=s+(r-s)*(h-i)/(n-i))>=o&&u<=l)return!0;if(s=o){if((u=i+(n-i)*(o-s)/(r-s))>=a&&u<=h)return!0}else if(s>l&&r<=l&&(u=i+(n-i)*(l-s)/(r-s))>=a&&u<=h)return!0;return!1}},34426:t=>{t.exports=function(t,e,i){void 0===i&&(i=1);var s=e.x1,n=e.y1,r=e.x2,a=e.y2,o=t.x,h=t.y,l=(r-s)*(r-s)+(a-n)*(a-n);if(0===l)return!1;var u=((o-s)*(r-s)+(h-n)*(a-n))/l;if(u<0)return Math.sqrt((s-o)*(s-o)+(n-h)*(n-h))<=i;if(u>=0&&u<=1){var c=((n-h)*(r-s)-(s-o)*(a-n))/l;return Math.abs(c)*Math.sqrt(l)<=i}return Math.sqrt((r-o)*(r-o)+(a-h)*(a-h))<=i}},81414:(t,e,i)=>{var s=i(34426);t.exports=function(t,e){if(!s(t,e))return!1;var i=Math.min(e.x1,e.x2),n=Math.max(e.x1,e.x2),r=Math.min(e.y1,e.y2),a=Math.max(e.y1,e.y2);return t.x>=i&&t.x<=n&&t.y>=r&&t.y<=a}},90205:t=>{t.exports=function(t,e){return!(t.width<=0||t.height<=0||e.width<=0||e.height<=0)&&!(t.righte.right||t.y>e.bottom)}},20370:(t,e,i)=>{var s=i(25227),n=i(94287),r=i(86875),a=i(87279);t.exports=function(t,e){if(e.left>t.right||e.rightt.bottom||e.bottom0}},8786:t=>{t.exports=function(t,e,i,s,n,r){return void 0===r&&(r=0),!(e>t.right+r||it.bottom+r||n{var s=i(61472),n=i(60689);t.exports=function(t,e){return!(t.left>e.right||t.righte.bottom||t.bottom{var s=i(25227);t.exports=function(t,e){return!(!t.contains(e.x1,e.y1)&&!t.contains(e.x2,e.y2))||(!!s(t.getLineA(),e)||(!!s(t.getLineB(),e)||!!s(t.getLineC(),e)))}},23589:(t,e,i)=>{var s=i(86875),n=i(18680),r=i(25227);t.exports=function(t,e){if(t.left>e.right||t.righte.bottom||t.bottom0||(c=n(e),(d=s(t,c,!0)).length>0)}},7563:(t,e,i)=>{t.exports={CircleToCircle:i(22184),CircleToRectangle:i(26535),GetCircleToCircle:i(71145),GetCircleToRectangle:i(62508),GetLineToCircle:i(26111),GetLineToLine:i(96537),GetLineToPoints:i(17647),GetLineToPolygon:i(68439),GetLineToRectangle:i(9569),GetRaysFromPointToPolygon:i(7449),GetRectangleIntersection:i(82931),GetRectangleToRectangle:i(1946),GetRectangleToTriangle:i(34211),GetTriangleToCircle:i(80511),GetTriangleToLine:i(31343),GetTriangleToTriangle:i(70534),LineToCircle:i(61472),LineToLine:i(25227),LineToRectangle:i(47910),PointToLine:i(34426),PointToLineSegment:i(81414),RectangleToRectangle:i(90205),RectangleToTriangle:i(20370),RectangleToValues:i(8786),TriangleToCircle:i(48411),TriangleToLine:i(86117),TriangleToTriangle:i(23589)}},50599:t=>{t.exports=function(t){return Math.atan2(t.y2-t.y1,t.x2-t.x1)}},58813:t=>{t.exports=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=[]);var s=Math.round(t.x1),n=Math.round(t.y1),r=Math.round(t.x2),a=Math.round(t.y2),o=Math.abs(r-s),h=Math.abs(a-n),l=s-h&&(c-=h,s+=l),f{t.exports=function(t,e,i){var s=e-(t.x1+t.x2)/2,n=i-(t.y1+t.y2)/2;return t.x1+=s,t.y1+=n,t.x2+=s,t.y2+=n,t}},26718:(t,e,i)=>{var s=i(88829);t.exports=function(t){return new s(t.x1,t.y1,t.x2,t.y2)}},88930:t=>{t.exports=function(t,e){return e.setTo(t.x1,t.y1,t.x2,t.y2)}},90656:t=>{t.exports=function(t,e){return t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2}},30897:(t,e,i)=>{var s=i(16028);t.exports=function(t,e,i){void 0===i&&(i=e);var n=s(t),r=t.x2-t.x1,a=t.y2-t.y1;return e&&(t.x1=t.x1-r/n*e,t.y1=t.y1-a/n*e),i&&(t.x2=t.x2+r/n*i,t.y2=t.y2+a/n*i),t}},30684:(t,e,i)=>{var s=i(92951),n=i(21902),r=i(79967);t.exports=function(t,e,i,a,o){void 0===a&&(a=0),void 0===o&&(o=[]);var h,l,u=[],c=t.x1,d=t.y1,f=t.x2-c,p=t.y2-d,v=n(e,o),g=i-1;for(h=0;h0){var m=u[0],y=[m];for(h=1;h=a&&(y.push(x),m=x)}var T=u[u.length-1];return s(m,T){var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=(t.x1+t.x2)/2,e.y=(t.y1+t.y2)/2,e}},11222:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=t.x1,r=t.y1,a=t.x2,o=t.y2,h=(a-n)*(a-n)+(o-r)*(o-r);if(0===h)return i;var l=((e.x-n)*(a-n)+(e.y-r)*(o-r))/h;return i.x=n+l*(a-n),i.y=r+l*(o-r),i}},7377:(t,e,i)=>{var s=i(83392),n=i(50599),r=i(79967);t.exports=function(t,e){void 0===e&&(e=new r);var i=n(t)-s.TAU;return e.x=Math.cos(i),e.y=Math.sin(i),e}},66464:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){return void 0===i&&(i=new s),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},8570:(t,e,i)=>{var s=i(16028),n=i(79967);t.exports=function(t,e,i,r){void 0===r&&(r=[]),!e&&i>0&&(e=s(t)/i);for(var a=t.x1,o=t.y1,h=t.x2,l=t.y2,u=0;u{t.exports=function(t,e){var i=t.x1,s=t.y1,n=t.x2,r=t.y2,a=(n-i)*(n-i)+(r-s)*(r-s);if(0===a)return!1;var o=((s-e.y)*(n-i)-(i-e.x)*(r-s))/a;return Math.abs(o)*Math.sqrt(a)}},82996:t=>{t.exports=function(t){return Math.abs(t.y1-t.y2)}},16028:t=>{t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},88829:(t,e,i)=>{var s=i(56694),n=i(66464),r=i(8570),a=i(52394),o=i(74077),h=i(93736),l=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.type=a.LINE,this.x1=t,this.y1=e,this.x2=i,this.y2=s},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return r(this,t,e,i)},getRandomPoint:function(t){return o(this,t)},setTo:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.x1=t,this.y1=e,this.x2=i,this.y2=s,this},getPointA:function(t){return void 0===t&&(t=new h),t.set(this.x1,this.y1),t},getPointB:function(t){return void 0===t&&(t=new h),t.set(this.x2,this.y2),t},left:{get:function(){return Math.min(this.x1,this.x2)},set:function(t){this.x1<=this.x2?this.x1=t:this.x2=t}},right:{get:function(){return Math.max(this.x1,this.x2)},set:function(t){this.x1>this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},73273:(t,e,i)=>{var s=i(83392),n=i(1071),r=i(50599);t.exports=function(t){var e=r(t)-s.TAU;return n(e,-Math.PI,Math.PI)}},96936:(t,e,i)=>{var s=i(83392),n=i(50599);t.exports=function(t){return Math.cos(n(t)-s.TAU)}},43581:(t,e,i)=>{var s=i(83392),n=i(50599);t.exports=function(t){return Math.sin(n(t)-s.TAU)}},13990:t=>{t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t}},1298:t=>{t.exports=function(t){return-(t.x2-t.x1)/(t.y2-t.y1)}},74077:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){void 0===e&&(e=new s);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},30473:(t,e,i)=>{var s=i(50599),n=i(73273);t.exports=function(t,e){return 2*n(e)-Math.PI-s(t)}},25968:(t,e,i)=>{var s=i(1809);t.exports=function(t,e){var i=(t.x1+t.x2)/2,n=(t.y1+t.y2)/2;return s(t,i,n,e)}},24296:(t,e,i)=>{var s=i(1809);t.exports=function(t,e,i){return s(t,e.x,e.y,i)}},1809:t=>{t.exports=function(t,e,i,s){var n=Math.cos(s),r=Math.sin(s),a=t.x1-e,o=t.y1-i;return t.x1=a*n-o*r+e,t.y1=a*r+o*n+i,a=t.x2-e,o=t.y2-i,t.x2=a*n-o*r+e,t.y2=a*r+o*n+i,t}},88171:t=>{t.exports=function(t,e,i,s,n){return t.x1=e,t.y1=i,t.x2=e+Math.cos(s)*n,t.y2=i+Math.sin(s)*n,t}},82797:t=>{t.exports=function(t){return(t.y2-t.y1)/(t.x2-t.x1)}},41067:t=>{t.exports=function(t){return Math.abs(t.x1-t.x2)}},28482:(t,e,i)=>{var s=i(88829);s.Angle=i(50599),s.BresenhamPoints=i(58813),s.CenterOn=i(88513),s.Clone=i(26718),s.CopyFrom=i(88930),s.Equals=i(90656),s.Extend=i(30897),s.GetEasedPoints=i(30684),s.GetMidPoint=i(20487),s.GetNearestPoint=i(11222),s.GetNormal=i(7377),s.GetPoint=i(66464),s.GetPoints=i(8570),s.GetShortestDistance=i(65269),s.Height=i(82996),s.Length=i(16028),s.NormalAngle=i(73273),s.NormalX=i(96936),s.NormalY=i(43581),s.Offset=i(13990),s.PerpSlope=i(1298),s.Random=i(74077),s.ReflectAngle=i(30473),s.Rotate=i(25968),s.RotateAroundPoint=i(24296),s.RotateAroundXY=i(1809),s.SetToAngle=i(88171),s.Slope=i(82797),s.Width=i(41067),t.exports=s},18693:(t,e,i)=>{var s=i(56694),n=i(74118),r=i(93736);function a(t,e,i,s){var n=t-i,r=e-s,a=n*n+r*r;return Math.sqrt(a)}var o=new s({initialize:function(t,e,i){this.vertex1=t,this.vertex2=e,this.vertex3=i,this.bounds=new n,this._inCenter=new r},getInCenter:function(t){void 0===t&&(t=!0);var e,i,s,n,r,o,h=this.vertex1,l=this.vertex2,u=this.vertex3;t?(e=h.x,i=h.y,s=l.x,n=l.y,r=u.x,o=u.y):(e=h.vx,i=h.vy,s=l.vx,n=l.vy,r=u.vx,o=u.vy);var c=a(r,o,s,n),d=a(e,i,r,o),f=a(s,n,e,i),p=c+d+f;return this._inCenter.set((e*c+s*d+r*f)/p,(i*c+n*d+o*f)/p)},contains:function(t,e,i){var s=this.vertex1,n=this.vertex2,r=this.vertex3,a=s.vx,o=s.vy,h=n.vx,l=n.vy,u=r.vx,c=r.vy;if(i){var d=i.a,f=i.b,p=i.c,v=i.d,g=i.e,m=i.f;a=s.vx*d+s.vy*p+g,o=s.vx*f+s.vy*v+m,h=n.vx*d+n.vy*p+g,l=n.vx*f+n.vy*v+m,u=r.vx*d+r.vy*p+g,c=r.vx*f+r.vy*v+m}var y=u-a,x=c-o,T=h-a,w=l-o,E=t-a,S=e-o,b=y*y+x*x,A=y*T+x*w,_=y*E+x*S,C=T*T+w*w,R=T*E+w*S,M=b*C-A*A,P=0===M?0:1/M,O=(C*_-A*R)*P,L=(b*R-A*_)*P;return O>=0&&L>=0&&O+L<1},isCounterClockwise:function(t){var e=this.vertex1,i=this.vertex2,s=this.vertex3,n=(i.vx-e.vx)*(s.vy-e.vy)-(i.vy-e.vy)*(s.vx-e.vx);return t<=0?n>=0:n<0},load:function(t,e,i,s,n){return i=this.vertex1.load(t,e,i,s,n),i=this.vertex2.load(t,e,i,s,n),i=this.vertex3.load(t,e,i,s,n)},transformCoordinatesLocal:function(t,e,i,s){return this.vertex1.transformCoordinatesLocal(t,e,i,s),this.vertex2.transformCoordinatesLocal(t,e,i,s),this.vertex3.transformCoordinatesLocal(t,e,i,s),this},updateBounds:function(){var t=this.vertex1,e=this.vertex2,i=this.vertex3,s=this.bounds;return s.x=Math.min(t.vx,e.vx,i.vx),s.y=Math.min(t.vy,e.vy,i.vy),s.width=Math.max(t.vx,e.vx,i.vx)-s.x,s.height=Math.max(t.vy,e.vy,i.vy)-s.y,this},isInView:function(t,e,i,s,n,r,a,o,h,l,u){var c=this.vertex1.update(n,r,a,o,h,l,u,s),d=this.vertex2.update(n,r,a,o,h,l,u,s),f=this.vertex3.update(n,r,a,o,h,l,u,s);if(c.ta<=0&&d.ta<=0&&f.ta<=0)return!1;if(e&&!this.isCounterClockwise(i))return!1;var p=this.bounds;p.x=Math.min(c.tx,d.tx,f.tx),p.y=Math.min(c.ty,d.ty,f.ty),p.width=Math.max(c.tx,d.tx,f.tx)-p.x,p.height=Math.max(c.ty,d.ty,f.ty)-p.y;var v=t.x+t.width,g=t.y+t.height;return!(p.width<=0||p.height<=0||t.width<=0||t.height<=0)&&!(p.rightv||p.y>g)},translate:function(t,e){void 0===e&&(e=0);var i=this.vertex1,s=this.vertex2,n=this.vertex3;return i.x+=t,i.y+=e,s.x+=t,s.y+=e,n.x+=t,n.y+=e,this},x:{get:function(){return this.getInCenter().x},set:function(t){var e=this.getInCenter();this.translate(t-e.x,0)}},y:{get:function(){return this.getInCenter().y},set:function(t){var e=this.getInCenter();this.translate(0,t-e.y)}},alpha:{get:function(){var t=this.vertex1,e=this.vertex2,i=this.vertex3;return(t.alpha+e.alpha+i.alpha)/3},set:function(t){this.vertex1.alpha=t,this.vertex2.alpha=t,this.vertex3.alpha=t}},depth:{get:function(){var t=this.vertex1,e=this.vertex2,i=this.vertex3;return(t.vz+e.vz+i.vz)/3}},destroy:function(){this.vertex1=null,this.vertex2=null,this.vertex3=null}});t.exports=o},99425:(t,e,i)=>{var s=i(18693),n=i(72632),r=i(16650),a=i(70015),o=i(85769),h=new a,l=new a,u=new r;t.exports=function(t){var e=n(t,"mesh"),i=n(t,"texture",null),r=n(t,"frame"),a=n(t,"width",1),c=n(t,"height",a),d=n(t,"widthSegments",1),f=n(t,"heightSegments",d),p=n(t,"x",0),v=n(t,"y",0),g=n(t,"z",0),m=n(t,"rotateX",0),y=n(t,"rotateY",0),x=n(t,"rotateZ",0),T=n(t,"zIsUp",!0),w=n(t,"isOrtho",!!e&&e.dirtyCache[11]),E=n(t,"colors",[16777215]),S=n(t,"alphas",[1]),b=n(t,"tile",!1),A=n(t,"flipY",!1),_=n(t,"width",null),C={faces:[],verts:[]};if(h.set(p,v,g),l.set(m,y,x),u.fromRotationXYTranslation(l,h,T),!i&&e)i=e.texture;else{if(!e||"string"!=typeof i)return C;i=e.scene.sys.textures.get(i)}var R=i.get(r);!_&&w&&i&&e&&(a=R.width/e.height,c=R.height/e.height);var M,P,O=a/2,L=c/2,F=Math.floor(d),D=Math.floor(f),k=F+1,I=D+1,B=a/F,N=c/D,Y=[],X=[],U=0,z=1,G=0,W=1;R&&(U=R.u0,z=R.u1,A?(G=R.v1,W=R.v0):(G=R.v0,W=R.v1));var V=z-U,H=W-G;for(P=0;P{var s=i(18693),n=i(16650),r=i(70015),a=i(85769),o=new r,h=new r,l=new n;t.exports=function(t,e,i,n,r,u,c,d,f,p){void 0===i&&(i=1),void 0===n&&(n=0),void 0===r&&(r=0),void 0===u&&(u=0),void 0===c&&(c=0),void 0===d&&(d=0),void 0===f&&(f=0),void 0===p&&(p=!0);var v={faces:[],verts:[]},g=t.materials;o.set(n,r,u),h.set(c,d,f),l.fromRotationXYTranslation(h,o,p);for(var m=0;m{var s=i(18693),n=i(85769);t.exports=function(t,e,i,r,a,o,h){if(void 0===r&&(r=!1),void 0===o&&(o=16777215),void 0===h&&(h=1),t.length===e.length){var l,u,c,d,f,p,v,g,m,y,x,T={faces:[],vertices:[]},w=r?3:2,E=Array.isArray(o),S=Array.isArray(h);if(Array.isArray(i)&&i.length>0)for(l=0;l{var e=!0,i="untitled",s="",n="";function r(t){var e=t.indexOf("#");return e>-1?t.substring(0,e):t}function a(t){return 0===t.models.length&&t.models.push({faces:[],name:i,textureCoords:[],vertexNormals:[],vertices:[]}),s="",t.models[t.models.length-1]}function o(t,e){var n=t.length>=2?t[1]:i;e.models.push({faces:[],name:n,textureCoords:[],vertexNormals:[],vertices:[]}),s=""}function h(t){2===t.length&&(s=t[1])}function l(t,e){var i=t.length,s=i>=2?parseFloat(t[1]):0,n=i>=3?parseFloat(t[2]):0,r=i>=4?parseFloat(t[3]):0;a(e).vertices.push({x:s,y:n,z:r})}function u(t,i){var s=t.length,n=s>=2?parseFloat(t[1]):0,r=s>=3?parseFloat(t[2]):0,o=s>=4?parseFloat(t[3]):0;isNaN(n)&&(n=0),isNaN(r)&&(r=0),isNaN(o)&&(o=0),e&&(r=1-r),a(i).textureCoords.push({u:n,v:r,w:o})}function c(t,e){var i=t.length,s=i>=2?parseFloat(t[1]):0,n=i>=3?parseFloat(t[2]):0,r=i>=4?parseFloat(t[3]):0;a(e).vertexNormals.push({x:s,y:n,z:r})}function d(t,e){var i=t.length-1;if(!(i<3)){for(var r={group:s,material:n,vertices:[]},o=0;o3)){var u=0,c=0,d=0;u=parseInt(h[0],10),l>1&&""!==h[1]&&(c=parseInt(h[1],10)),l>2&&(d=parseInt(h[2],10)),0!==u&&(u<0&&(u=a(e).vertices.length+1+u),c-=1,u-=1,d-=1,r.vertices.push({textureCoordsIndex:c,vertexIndex:u,vertexNormalIndex:d}))}}a(e).faces.push(r)}}function f(t,e){t.length>=2&&e.materialLibraries.push(t[1])}function p(t){t.length>=2&&(n=t[1])}t.exports=function(t,i){void 0===i&&(i=!0),e=i;var a={materials:{},materialLibraries:[],models:[]};s="",n="";for(var v=t.split("\n"),g=0;g{var s=i(22946);t.exports=function(t){for(var e={},i=t.split("\n"),n="",r=0;r=2?Math.floor(255*o[2]):h,u=o.length>=3?Math.floor(255*o[3]):h;e[n]=s(h,l,u)}}}return e}},15313:t=>{t.exports=function(t,e,i,s){var n,r;if(void 0===i&&void 0===s){var a=t.getInCenter();n=a.x,r=a.y}var o=Math.cos(e),h=Math.sin(e),l=t.vertex1,u=t.vertex2,c=t.vertex3,d=l.x-n,f=l.y-r;l.set(d*o-f*h+n,d*h+f*o+r),d=u.x-n,f=u.y-r,u.set(d*o-f*h+n,d*h+f*o+r),d=c.x-n,f=c.y-r,c.set(d*o-f*h+n,d*h+f*o+r)}},85769:(t,e,i)=>{var s=i(56694),n=i(75512),r=i(70015),a=new s({Extends:r,initialize:function(t,e,i,s,n,a,o,h,l,u){void 0===a&&(a=16777215),void 0===o&&(o=1),void 0===h&&(h=0),void 0===l&&(l=0),void 0===u&&(u=0),r.call(this,t,e,i),this.vx=0,this.vy=0,this.vz=0,this.nx=h,this.ny=l,this.nz=u,this.u=s,this.v=n,this.color=a,this.alpha=o,this.tx=0,this.ty=0,this.ta=0},setUVs:function(t,e){return this.u=t,this.v=e,this},transformCoordinatesLocal:function(t,e,i,s){var n=this.x,r=this.y,a=this.z,o=t.val,h=n*o[0]+r*o[4]+a*o[8]+o[12],l=n*o[1]+r*o[5]+a*o[9]+o[13],u=n*o[2]+r*o[6]+a*o[10]+o[14],c=n*o[3]+r*o[7]+a*o[11]+o[15];this.vx=h/c*e,this.vy=-l/c*i,this.vz=s<=0?u/c:-u/c},update:function(t,e,i,s,n,r,a,o){var h=this.vx*t+this.vy*i+n,l=this.vx*e+this.vy*s+r;return a&&(h=Math.round(h),l=Math.round(l)),this.tx=h,this.ty=l,this.ta=this.alpha*o,this},load:function(t,e,i,s,r){return t[++i]=this.tx,t[++i]=this.ty,t[++i]=this.u,t[++i]=this.v,t[++i]=s,t[++i]=r,e[++i]=n.getTintAppendFloatAlpha(this.color,this.ta),i}});t.exports=a},14293:(t,e,i)=>{var s={Face:i(18693),GenerateGridVerts:i(99425),GenerateObjVerts:i(53267),GenerateVerts:i(67623),ParseObj:i(27291),ParseObjMaterial:i(76799),RotateFace:i(15313),Vertex:i(85769)};t.exports=s},77601:t=>{t.exports=function(t){return t.setTo(Math.ceil(t.x),Math.ceil(t.y))}},38933:(t,e,i)=>{var s=i(79967);t.exports=function(t){return new s(t.x,t.y)}},47103:t=>{t.exports=function(t,e){return e.setTo(t.x,t.y)}},13625:t=>{t.exports=function(t,e){return t.x===e.x&&t.y===e.y}},12536:t=>{t.exports=function(t){return t.setTo(Math.floor(t.x),Math.floor(t.y))}},54205:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){if(void 0===e&&(e=new s),!Array.isArray(t))throw new Error("GetCentroid points argument must be an array");var i=t.length;if(i<1)throw new Error("GetCentroid points array must not be empty");if(1===i)e.x=t[0].x,e.y=t[0].y;else{for(var n=0;n{t.exports=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)}},82712:t=>{t.exports=function(t){return t.x*t.x+t.y*t.y}},20052:(t,e,i)=>{var s=i(74118);t.exports=function(t,e){void 0===e&&(e=new s);for(var i=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,o=0;oi&&(i=h.x),h.xr&&(r=h.y),h.y{var s=i(79967);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=new s),n.x=t.x+(e.x-t.x)*i,n.y=t.y+(e.y-t.y)*i,n}},42397:t=>{t.exports=function(t){return t.setTo(t.y,t.x)}},59464:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.setTo(-t.x,-t.y)}},79967:(t,e,i)=>{var s=i(56694),n=i(52394),r=new s({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.type=n.POINT,this.x=t,this.y=e},setTo:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this}});t.exports=r},53581:(t,e,i)=>{var s=i(79967),n=i(82712);t.exports=function(t,e,i){void 0===i&&(i=new s);var r=(t.x*e.x+t.y*e.y)/n(e);return 0!==r&&(i.x=r*e.x,i.y=r*e.y),i}},50817:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=t.x*e.x+t.y*e.y;return 0!==n&&(i.x=n*e.x,i.y=n*e.y),i}},40525:(t,e,i)=>{var s=i(50083);t.exports=function(t,e){if(0!==t.x||0!==t.y){var i=s(t);t.x/=i,t.y/=i}return t.x*=e,t.y*=e,t}},63472:(t,e,i)=>{var s=i(79967);s.Ceil=i(77601),s.Clone=i(38933),s.CopyFrom=i(47103),s.Equals=i(13625),s.Floor=i(12536),s.GetCentroid=i(54205),s.GetMagnitude=i(50083),s.GetMagnitudeSq=i(82712),s.GetRectangleFromPoints=i(20052),s.Interpolate=i(77154),s.Invert=i(42397),s.Negative=i(59464),s.Project=i(53581),s.ProjectUnit=i(50817),s.SetMagnitude=i(40525),t.exports=s},19631:(t,e,i)=>{var s=i(8580);t.exports=function(t){return new s(t.points)}},45604:t=>{t.exports=function(t,e,i){for(var s=!1,n=-1,r=t.points.length-1;++n{var s=i(45604);t.exports=function(t,e){return s(t,e.x,e.y)}},11117:t=>{"use strict";function e(t,e,r){r=r||2;var a,o,h,c,d,p,v,g=e&&e.length,m=g?e[0]*r:t.length,y=i(t,0,m,r,!0),x=[];if(!y||y.next===y.prev)return x;if(g&&(y=function(t,e,n,r){var a,o,h,c=[];for(a=0,o=e.length;a80*r){a=h=t[0],o=c=t[1];for(var T=r;Th&&(h=d),p>c&&(c=p);v=0!==(v=Math.max(h-a,c-o))?1/v:0}return n(y,x,r,a,o,v),x}function i(t,e,i,s,n){var r,a;if(n===_(t,e,i,s)>0)for(r=e;r=e;r-=s)a=S(r,t[r],t[r+1],a);return a&&m(a,a.next)&&(b(a),a=a.next),a}function s(t,e){if(!t)return t;e||(e=t);var i,s=t;do{if(i=!1,s.steiner||!m(s,s.next)&&0!==g(s.prev,s,s.next))s=s.next;else{if(b(s),(s=e=s.prev)===s.next)break;i=!0}}while(i||s!==e);return e}function n(t,e,i,l,u,c,f){if(t){!f&&c&&function(t,e,i,s){var n=t;do{null===n.z&&(n.z=d(n.x,n.y,e,i,s)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){var e,i,s,n,r,a,o,h,l=1;do{for(i=t,t=null,r=null,a=0;i;){for(a++,s=i,o=0,e=0;e0||h>0&&s;)0!==o&&(0===h||!s||i.z<=s.z)?(n=i,i=i.nextZ,o--):(n=s,s=s.nextZ,h--),r?r.nextZ=n:t=n,n.prevZ=r,r=n;i=s}r.nextZ=null,l*=2}while(a>1)}(n)}(t,l,u,c);for(var p,v,g=t;t.prev!==t.next;)if(p=t.prev,v=t.next,c?a(t,l,u,c):r(t))e.push(p.i/i),e.push(t.i/i),e.push(v.i/i),b(t),t=v.next,g=v.next;else if((t=v)===g){f?1===f?n(t=o(s(t),e,i),e,i,l,u,c,2):2===f&&h(t,e,i,l,u,c):n(s(t),e,i,l,u,c,1);break}}}function r(t){var e=t.prev,i=t,s=t.next;if(g(e,i,s)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(p(e.x,e.y,i.x,i.y,s.x,s.y,n.x,n.y)&&g(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function a(t,e,i,s){var n=t.prev,r=t,a=t.next;if(g(n,r,a)>=0)return!1;for(var o=n.xr.x?n.x>a.x?n.x:a.x:r.x>a.x?r.x:a.x,u=n.y>r.y?n.y>a.y?n.y:a.y:r.y>a.y?r.y:a.y,c=d(o,h,e,i,s),f=d(l,u,e,i,s),v=t.prevZ,m=t.nextZ;v&&v.z>=c&&m&&m.z<=f;){if(v!==t.prev&&v!==t.next&&p(n.x,n.y,r.x,r.y,a.x,a.y,v.x,v.y)&&g(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,m!==t.prev&&m!==t.next&&p(n.x,n.y,r.x,r.y,a.x,a.y,m.x,m.y)&&g(m.prev,m,m.next)>=0)return!1;m=m.nextZ}for(;v&&v.z>=c;){if(v!==t.prev&&v!==t.next&&p(n.x,n.y,r.x,r.y,a.x,a.y,v.x,v.y)&&g(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;m&&m.z<=f;){if(m!==t.prev&&m!==t.next&&p(n.x,n.y,r.x,r.y,a.x,a.y,m.x,m.y)&&g(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function o(t,e,i){var n=t;do{var r=n.prev,a=n.next.next;!m(r,a)&&y(r,n,n.next,a)&&w(r,a)&&w(a,r)&&(e.push(r.i/i),e.push(n.i/i),e.push(a.i/i),b(n),b(n.next),n=t=a),n=n.next}while(n!==t);return s(n)}function h(t,e,i,r,a,o){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&v(h,l)){var u=E(h,l);return h=s(h,h.next),u=s(u,u.next),n(h,e,i,r,a,o),void n(u,e,i,r,a,o)}l=l.next}h=h.next}while(h!==t)}function l(t,e){return t.x-e.x}function u(t,e){if(e=function(t,e){var i,s=e,n=t.x,r=t.y,a=-1/0;do{if(r<=s.y&&r>=s.next.y&&s.next.y!==s.y){var o=s.x+(r-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(o<=n&&o>a){if(a=o,o===n){if(r===s.y)return s;if(r===s.next.y)return s.next}i=s.x=s.x&&s.x>=u&&n!==s.x&&p(ri.x||s.x===i.x&&c(i,s)))&&(i=s,f=h)),s=s.next}while(s!==l);return i}(t,e),e){var i=E(e,t);s(e,e.next),s(i,i.next)}}function c(t,e){return g(t.prev,t,e.prev)<0&&g(e.next,t,t.next)<0}function d(t,e,i,s,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-s)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){var e=t,i=t;do{(e.x=0&&(t-a)*(s-o)-(i-a)*(e-o)>=0&&(i-a)*(r-o)-(n-a)*(s-o)>=0}function v(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&y(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(w(t,e)&&w(e,t)&&function(t,e){var i=t,s=!1,n=(t.x+e.x)/2,r=(t.y+e.y)/2;do{i.y>r!=i.next.y>r&&i.next.y!==i.y&&n<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(s=!s),i=i.next}while(i!==t);return s}(t,e)&&(g(t.prev,t,e.prev)||g(t,e.prev,e))||m(t,e)&&g(t.prev,t,t.next)>0&&g(e.prev,e,e.next)>0)}function g(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function m(t,e){return t.x===e.x&&t.y===e.y}function y(t,e,i,s){var n=T(g(t,e,i)),r=T(g(t,e,s)),a=T(g(i,s,t)),o=T(g(i,s,e));return n!==r&&a!==o||(!(0!==n||!x(t,i,e))||(!(0!==r||!x(t,s,e))||(!(0!==a||!x(i,t,s))||!(0!==o||!x(i,e,s)))))}function x(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function T(t){return t>0?1:t<0?-1:0}function w(t,e){return g(t.prev,t,t.next)<0?g(t,e,t.next)>=0&&g(t,t.prev,e)>=0:g(t,e,t.prev)<0||g(t,t.next,e)<0}function E(t,e){var i=new A(t.i,t.x,t.y),s=new A(e.i,e.x,e.y),n=t.next,r=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,s.next=i,i.prev=s,r.next=s,s.prev=r,s}function S(t,e,i,s){var n=new A(t,e,i);return s?(n.next=s.next,n.prev=s,s.next.prev=n,s.next=n):(n.prev=n,n.next=n),n}function b(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function A(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function _(t,e,i,s){for(var n=0,r=e,a=i-s;r0&&(s+=t[n-1].length,i.holes.push(s))}return i},t.exports=e},14045:(t,e,i)=>{var s=i(74118);t.exports=function(t,e){void 0===e&&(e=new s);for(var i,n=1/0,r=1/0,a=-n,o=-r,h=0;h{t.exports=function(t,e){void 0===e&&(e=[]);for(var i=0;i{var s=i(16028),n=i(88829),r=i(5159);t.exports=function(t,e,i,a){void 0===a&&(a=[]);var o=t.points,h=r(t);!e&&i>0&&(e=h/i);for(var l=0;lc+g)){var m=v.getPoint((u-c)/g);a.push(m);break}c+=g}return a}},5159:(t,e,i)=>{var s=i(16028),n=i(88829);t.exports=function(t){for(var e=t.points,i=0,r=0;r{var s=i(56694),n=i(45604),r=i(89294),a=i(52394),o=new s({initialize:function(t){this.type=a.POLYGON,this.area=0,this.points=[],t&&this.setTo(t)},contains:function(t,e){return n(this,t,e)},setTo:function(t){if(this.area=0,this.points=[],"string"==typeof t&&(t=t.split(" ")),!Array.isArray(t))return this;for(var e,i=Number.MAX_VALUE,s=0;s{t.exports=function(t){return t.points.reverse(),t}},95874:t=>{function e(t,e,i){var s=e.x,n=e.y,r=i.x-s,a=i.y-n;if(0!==r||0!==a){var o=((t.x-s)*r+(t.y-n)*a)/(r*r+a*a);o>1?(s=i.x,n=i.y):o>0&&(s+=r*o,n+=a*o)}return(r=t.x-s)*r+(a=t.y-n)*a}function i(t,s,n,r,a){for(var o,h=r,l=s+1;lh&&(o=l,h=u)}h>r&&(o-s>1&&i(t,s,o,r,a),a.push(t[o]),n-o>1&&i(t,o,n,r,a))}function s(t,e){var s=t.length-1,n=[t[0]];return i(t,0,s,e,n),n.push(t[s]),n}t.exports=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=!1);var n=t.points;if(n.length>2){var r=e*e;i||(n=function(t,e){for(var i,s,n,r,a,o=t[0],h=[o],l=1,u=t.length;le&&(h.push(i),o=i);return o!==i&&h.push(i),h}(n,r)),t.setTo(s(n,r))}return t}},18974:t=>{var e=function(t,e){return t[0]=e[0],t[1]=e[1],t};t.exports=function(t){var i,s=[],n=t.points;for(i=0;i0&&r.push(e([0,0],s[0])),i=0;i1&&r.push(e([0,0],s[s.length-1])),t.setTo(r)}},23490:t=>{t.exports=function(t,e,i){for(var s=t.points,n=0;n{var s=i(8580);s.Clone=i(19631),s.Contains=i(45604),s.ContainsPoint=i(87289),s.Earcut=i(11117),s.GetAABB=i(14045),s.GetNumberArray=i(98286),s.GetPoints=i(89294),s.Perimeter=i(5159),s.Reverse=i(32244),s.Simplify=i(95874),s.Smooth=i(18974),s.Translate=i(23490),t.exports=s},1653:t=>{t.exports=function(t){return t.width*t.height}},33943:t=>{t.exports=function(t){return t.x=Math.ceil(t.x),t.y=Math.ceil(t.y),t}},58662:t=>{t.exports=function(t){return t.x=Math.ceil(t.x),t.y=Math.ceil(t.y),t.width=Math.ceil(t.width),t.height=Math.ceil(t.height),t}},79993:t=>{t.exports=function(t,e,i){return t.x=e-t.width/2,t.y=i-t.height/2,t}},81572:(t,e,i)=>{var s=i(74118);t.exports=function(t){return new s(t.x,t.y,t.width,t.height)}},94287:t=>{t.exports=function(t,e,i){return!(t.width<=0||t.height<=0)&&(t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i)}},28687:(t,e,i)=>{var s=i(94287);t.exports=function(t,e){return s(t,e.x,e.y)}},73222:t=>{t.exports=function(t,e){return!(e.width*e.height>t.width*t.height)&&(e.x>t.x&&e.xt.x&&e.rightt.y&&e.yt.y&&e.bottom{t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},87279:t=>{t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x,y:t.y}),e.push({x:t.right,y:t.y}),e.push({x:t.right,y:t.bottom}),e.push({x:t.x,y:t.bottom}),e}},19989:t=>{t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},92628:(t,e,i)=>{var s=i(6700);t.exports=function(t,e){var i=s(t);return i{var s=i(6700);t.exports=function(t,e){var i=s(t);return i>s(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},71356:t=>{t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t}},21687:t=>{t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height),t}},80222:(t,e,i)=>{var s=i(74118),n=i(83392);t.exports=function(t,e){if(void 0===e&&(e=new s),0===t.length)return e;for(var i,r,a,o=Number.MAX_VALUE,h=Number.MAX_VALUE,l=n.MIN_SAFE_INTEGER,u=n.MIN_SAFE_INTEGER,c=0;c{var s=i(74118);t.exports=function(t,e,i,n,r){return void 0===r&&(r=new s),r.setTo(Math.min(t,i),Math.min(e,n),Math.abs(t-i),Math.abs(e-n))}},6700:t=>{t.exports=function(t){return 0===t.height?NaN:t.width/t.height}},35242:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.centerX,e.y=t.centerY,e}},47698:(t,e,i)=>{var s=i(85876),n=i(79967);t.exports=function(t,e,i){if(void 0===i&&(i=new n),e<=0||e>=1)return i.x=t.x,i.y=t.y,i;var r=s(t)*e;return e>.5?(r-=t.width+t.height)<=t.width?(i.x=t.right-r,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(r-t.width)):r<=t.width?(i.x=t.x+r,i.y=t.y):(i.x=t.right,i.y=t.y+(r-t.width)),i}},54932:(t,e,i)=>{var s=i(47698),n=i(85876);t.exports=function(t,e,i,r){void 0===r&&(r=[]),!e&&i>0&&(e=n(t)/i);for(var a=0;a{var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.width,e.y=t.height,e}},7782:(t,e,i)=>{var s=i(79993);t.exports=function(t,e,i){var n=t.centerX,r=t.centerY;return t.setSize(t.width+2*e,t.height+2*i),s(t,n,r)}},66217:(t,e,i)=>{var s=i(74118),n=i(90205);t.exports=function(t,e,i){return void 0===i&&(i=new s),n(t,e)?(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y):i.setEmpty(),i}},40053:(t,e,i)=>{var s=i(85876),n=i(79967);t.exports=function(t,e,i,r){if(void 0===r&&(r=[]),!e&&!i)return r;e?i=Math.round(s(t)/e):e=s(t)/i;for(var a=t.x,o=t.y,h=0,l=0;l=t.right&&(h=1,o+=a-t.right,a=t.right);break;case 1:(o+=e)>=t.bottom&&(h=2,a-=o-t.bottom,o=t.bottom);break;case 2:(a-=e)<=t.left&&(h=3,o-=t.left-a,a=t.left);break;case 3:(o-=e)<=t.top&&(h=0,o=t.top)}return r}},86673:t=>{t.exports=function(t,e){for(var i=t.x,s=t.right,n=t.y,r=t.bottom,a=0;a{t.exports=function(t,e){var i=Math.min(t.x,e.x),s=Math.max(t.right,e.right);t.x=i,t.width=s-i;var n=Math.min(t.y,e.y),r=Math.max(t.bottom,e.bottom);return t.y=n,t.height=r-n,t}},44755:t=>{t.exports=function(t,e,i){var s=Math.min(t.x,e),n=Math.max(t.right,e);t.x=s,t.width=n-s;var r=Math.min(t.y,i),a=Math.max(t.bottom,i);return t.y=r,t.height=a-r,t}},74466:t=>{t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},55946:t=>{t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},97474:t=>{t.exports=function(t,e){return t.xe.x&&t.ye.y}},85876:t=>{t.exports=function(t){return 2*(t.width+t.height)}},20243:(t,e,i)=>{var s=i(79967),n=i(75606);t.exports=function(t,e,i){void 0===i&&(i=new s),e=n(e);var r=Math.sin(e),a=Math.cos(e),o=a>0?t.width/2:t.width/-2,h=r>0?t.height/2:t.height/-2;return Math.abs(o*r){var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.x+Math.random()*t.width,e.y=t.y+Math.random()*t.height,e}},97691:(t,e,i)=>{var s=i(17489),n=i(73222),r=i(79967);t.exports=function(t,e,i){if(void 0===i&&(i=new r),n(t,e))switch(s(0,3)){case 0:i.x=t.x+Math.random()*(e.right-t.x),i.y=t.y+Math.random()*(e.top-t.y);break;case 1:i.x=e.x+Math.random()*(t.right-e.x),i.y=e.bottom+Math.random()*(t.bottom-e.bottom);break;case 2:i.x=t.x+Math.random()*(e.x-t.x),i.y=e.y+Math.random()*(t.bottom-e.y);break;case 3:i.x=e.right+Math.random()*(t.right-e.right),i.y=t.y+Math.random()*(e.bottom-t.y)}return i}},74118:(t,e,i)=>{var s=i(56694),n=i(94287),r=i(47698),a=i(54932),o=i(52394),h=i(88829),l=i(30001),u=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.type=o.RECTANGLE,this.x=t,this.y=e,this.width=i,this.height=s},contains:function(t,e){return n(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.y,this.right,this.y),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.y,this.right,this.bottom),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.bottom,this.x,this.bottom),t},getLineD:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.bottom,this.x,this.y),t},left:{get:function(){return this.x},set:function(t){t>=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=u},51828:t=>{t.exports=function(t,e){return t.width===e.width&&t.height===e.height}},5691:t=>{t.exports=function(t,e,i){return void 0===i&&(i=e),t.width*=e,t.height*=i,t}},58795:(t,e,i)=>{var s=i(74118);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=Math.min(t.x,e.x),r=Math.min(t.y,e.y),a=Math.max(t.right,e.right)-n,o=Math.max(t.bottom,e.bottom)-r;return i.setTo(n,r,a,o)}},66658:(t,e,i)=>{var s=i(74118);s.Area=i(1653),s.Ceil=i(33943),s.CeilAll=i(58662),s.CenterOn=i(79993),s.Clone=i(81572),s.Contains=i(94287),s.ContainsPoint=i(28687),s.ContainsRect=i(73222),s.CopyFrom=i(29538),s.Decompose=i(87279),s.Equals=i(19989),s.FitInside=i(92628),s.FitOutside=i(85028),s.Floor=i(71356),s.FloorAll=i(21687),s.FromPoints=i(80222),s.FromXY=i(75785),s.GetAspectRatio=i(6700),s.GetCenter=i(35242),s.GetPoint=i(47698),s.GetPoints=i(54932),s.GetSize=i(31591),s.Inflate=i(7782),s.Intersection=i(66217),s.MarchingAnts=i(40053),s.MergePoints=i(86673),s.MergeRect=i(14655),s.MergeXY=i(44755),s.Offset=i(74466),s.OffsetPoint=i(55946),s.Overlaps=i(97474),s.Perimeter=i(85876),s.PerimeterPoint=i(20243),s.Random=i(30001),s.RandomOutside=i(97691),s.SameDimensions=i(51828),s.Scale=i(5691),s.Union=i(58795),t.exports=s},19108:t=>{t.exports=function(t){var e=t.x1,i=t.y1,s=t.x2,n=t.y2,r=t.x3,a=t.y3;return Math.abs(((r-e)*(n-i)-(s-e)*(a-i))/2)}},41199:(t,e,i)=>{var s=i(66349);t.exports=function(t,e,i){var n=i*(Math.sqrt(3)/2);return new s(t,e,t+i/2,e+n,t-i/2,e+n)}},88730:(t,e,i)=>{var s=i(11117),n=i(66349);t.exports=function(t,e,i,r,a){void 0===e&&(e=null),void 0===i&&(i=1),void 0===r&&(r=1),void 0===a&&(a=[]);for(var o,h,l,u,c,d,f,p,v,g=s(t,e),m=0;m{var s=i(66349);t.exports=function(t,e,i,n){return void 0===n&&(n=i),new s(t,e,t,e-n,t+i,e)}},1882:(t,e,i)=>{var s=i(56595),n=i(9640);t.exports=function(t,e,i,r){void 0===r&&(r=s);var a=r(t),o=e-a.x,h=i-a.y;return n(t,o,h)}},56595:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=(t.x1+t.x2+t.x3)/3,e.y=(t.y1+t.y2+t.y3)/3,e}},91835:(t,e,i)=>{var s=i(93736);function n(t,e,i,s){return t*s-e*i}t.exports=function(t,e){void 0===e&&(e=new s);var i=t.x3,r=t.y3,a=t.x1-i,o=t.y1-r,h=t.x2-i,l=t.y2-r,u=2*n(a,o,h,l),c=n(o,a*a+o*o,l,h*h+l*l),d=n(a,a*a+o*o,h,h*h+l*l);return e.x=i-c/u,e.y=r+d/u,e}},97073:(t,e,i)=>{var s=i(26673);t.exports=function(t,e){void 0===e&&(e=new s);var i,n,r=t.x1,a=t.y1,o=t.x2,h=t.y2,l=t.x3,u=t.y3,c=o-r,d=h-a,f=l-r,p=u-a,v=c*(r+o)+d*(a+h),g=f*(r+l)+p*(a+u),m=2*(c*(u-h)-d*(l-o));if(Math.abs(m)<1e-6){var y=Math.min(r,o,l),x=Math.min(a,h,u);i=.5*(Math.max(r,o,l)-y),n=.5*(Math.max(a,h,u)-x),e.x=y+i,e.y=x+n,e.radius=Math.sqrt(i*i+n*n)}else e.x=(p*v-d*g)/m,e.y=(c*g-f*v)/m,i=e.x-r,n=e.y-a,e.radius=Math.sqrt(i*i+n*n);return e}},75974:(t,e,i)=>{var s=i(66349);t.exports=function(t){return new s(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}},60689:t=>{t.exports=function(t,e,i){var s=t.x3-t.x1,n=t.y3-t.y1,r=t.x2-t.x1,a=t.y2-t.y1,o=e-t.x1,h=i-t.y1,l=s*s+n*n,u=s*r+n*a,c=s*o+n*h,d=r*r+a*a,f=r*o+a*h,p=l*d-u*u,v=0===p?0:1/p,g=(d*c-u*f)*v,m=(l*f-u*c)*v;return g>=0&&m>=0&&g+m<1}},86875:t=>{t.exports=function(t,e,i,s){void 0===i&&(i=!1),void 0===s&&(s=[]);for(var n,r,a,o,h,l,u=t.x3-t.x1,c=t.y3-t.y1,d=t.x2-t.x1,f=t.y2-t.y1,p=u*u+c*c,v=u*d+c*f,g=d*d+f*f,m=p*g-v*v,y=0===m?0:1/m,x=t.x1,T=t.y1,w=0;w=0&&r>=0&&n+r<1&&(s.push({x:e[w].x,y:e[w].y}),i)));w++);return s}},51532:(t,e,i)=>{var s=i(60689);t.exports=function(t,e){return s(t,e.x,e.y)}},42538:t=>{t.exports=function(t,e){return e.setTo(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}},18680:t=>{t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x1,y:t.y1}),e.push({x:t.x2,y:t.y2}),e.push({x:t.x3,y:t.y3}),e}},29977:t=>{t.exports=function(t,e){return t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2&&t.x3===e.x3&&t.y3===e.y3}},56088:(t,e,i)=>{var s=i(79967),n=i(16028);t.exports=function(t,e,i){void 0===i&&(i=new s);var r=t.getLineA(),a=t.getLineB(),o=t.getLineC();if(e<=0||e>=1)return i.x=r.x1,i.y=r.y1,i;var h=n(r),l=n(a),u=n(o),c=(h+l+u)*e,d=0;return ch+l?(d=(c-=h+l)/u,i.x=o.x1+(o.x2-o.x1)*d,i.y=o.y1+(o.y2-o.y1)*d):(d=(c-=h)/l,i.x=a.x1+(a.x2-a.x1)*d,i.y=a.y1+(a.y2-a.y1)*d),i}},24402:(t,e,i)=>{var s=i(16028),n=i(79967);t.exports=function(t,e,i,r){void 0===r&&(r=[]);var a=t.getLineA(),o=t.getLineB(),h=t.getLineC(),l=s(a),u=s(o),c=s(h),d=l+u+c;!e&&i>0&&(e=d/i);for(var f=0;fl+u?(v=(p-=l+u)/c,g.x=h.x1+(h.x2-h.x1)*v,g.y=h.y1+(h.y2-h.y1)*v):(v=(p-=l)/u,g.x=o.x1+(o.x2-o.x1)*v,g.y=o.y1+(o.y2-o.y1)*v),r.push(g)}return r}},83648:(t,e,i)=>{var s=i(79967);function n(t,e,i,s){var n=t-i,r=e-s,a=n*n+r*r;return Math.sqrt(a)}t.exports=function(t,e){void 0===e&&(e=new s);var i=t.x1,r=t.y1,a=t.x2,o=t.y2,h=t.x3,l=t.y3,u=n(h,l,a,o),c=n(i,r,h,l),d=n(a,o,i,r),f=u+c+d;return e.x=(i*u+a*c+h*d)/f,e.y=(r*u+o*c+l*d)/f,e}},9640:t=>{t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t.x3+=e,t.y3+=i,t}},95290:(t,e,i)=>{var s=i(16028);t.exports=function(t){var e=t.getLineA(),i=t.getLineB(),n=t.getLineC();return s(e)+s(i)+s(n)}},99761:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){void 0===e&&(e=new s);var i=t.x2-t.x1,n=t.y2-t.y1,r=t.x3-t.x1,a=t.y3-t.y1,o=Math.random(),h=Math.random();return o+h>=1&&(o=1-o,h=1-h),e.x=t.x1+(i*o+r*h),e.y=t.y1+(n*o+a*h),e}},21934:(t,e,i)=>{var s=i(19211),n=i(83648);t.exports=function(t,e){var i=n(t);return s(t,i.x,i.y,e)}},68454:(t,e,i)=>{var s=i(19211);t.exports=function(t,e,i){return s(t,e.x,e.y,i)}},19211:t=>{t.exports=function(t,e,i,s){var n=Math.cos(s),r=Math.sin(s),a=t.x1-e,o=t.y1-i;return t.x1=a*n-o*r+e,t.y1=a*r+o*n+i,a=t.x2-e,o=t.y2-i,t.x2=a*n-o*r+e,t.y2=a*r+o*n+i,a=t.x3-e,o=t.y3-i,t.x3=a*n-o*r+e,t.y3=a*r+o*n+i,t}},66349:(t,e,i)=>{var s=i(56694),n=i(60689),r=i(56088),a=i(24402),o=i(52394),h=i(88829),l=i(99761),u=new s({initialize:function(t,e,i,s,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=0),this.type=o.TRIANGLE,this.x1=t,this.y1=e,this.x2=i,this.y2=s,this.x3=n,this.y3=r},contains:function(t,e){return n(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,s,n,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=0),this.x1=t,this.y1=e,this.x2=i,this.y2=s,this.x3=n,this.y3=r,this},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x1,this.y1,this.x2,this.y2),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.x2,this.y2,this.x3,this.y3),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.x3,this.y3,this.x1,this.y1),t},left:{get:function(){return Math.min(this.x1,this.x2,this.x3)},set:function(t){var e=0;e=this.x1<=this.x2&&this.x1<=this.x3?this.x1-t:this.x2<=this.x1&&this.x2<=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},right:{get:function(){return Math.max(this.x1,this.x2,this.x3)},set:function(t){var e=0;e=this.x1>=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=u},87619:(t,e,i)=>{var s=i(66349);s.Area=i(19108),s.BuildEquilateral=i(41199),s.BuildFromPolygon=i(88730),s.BuildRight=i(3635),s.CenterOn=i(1882),s.Centroid=i(56595),s.CircumCenter=i(91835),s.CircumCircle=i(97073),s.Clone=i(75974),s.Contains=i(60689),s.ContainsArray=i(86875),s.ContainsPoint=i(51532),s.CopyFrom=i(42538),s.Decompose=i(18680),s.Equals=i(29977),s.GetPoint=i(56088),s.GetPoints=i(24402),s.InCenter=i(83648),s.Perimeter=i(95290),s.Offset=i(9640),s.Random=i(99761),s.Rotate=i(21934),s.RotateAroundPoint=i(68454),s.RotateAroundXY=i(19211),t.exports=s},27395:t=>{t.exports=function(t,e,i){return{gameObject:t,enabled:!0,alwaysEnabled:!1,draggable:!1,dropZone:!1,cursor:!1,target:null,camera:null,hitArea:e,hitAreaCallback:i,hitAreaDebug:null,customHitArea:!1,localX:0,localY:0,dragState:0,dragStartX:0,dragStartY:0,dragStartXGlobal:0,dragStartYGlobal:0,dragX:0,dragY:0}}},18104:t=>{t.exports=function(t,e){return function(i,s,n,r){var a=t.getPixelAlpha(s,n,r.texture.key,r.frame.name);return a&&a>=e}}},69898:(t,e,i)=>{var s=i(56694),n=i(72687),r=i(6659),a=i(33963),o=i(97081),h=i(71064),l=i(7905),u=i(40398),c=i(37579),d=i(69360),f=i(64462),p=new s({initialize:function(t,e){this.game=t,this.scaleManager,this.canvas,this.config=e,this.enabled=!0,this.events=new r,this.isOver=!0,this.defaultCursor="",this.keyboard=e.inputKeyboard?new h(this):null,this.mouse=e.inputMouse?new l(this):null,this.touch=e.inputTouch?new c(this):null,this.pointers=[],this.pointersTotal=e.inputActivePointers,e.inputTouch&&1===this.pointersTotal&&(this.pointersTotal=2);for(var i=0;i<=this.pointersTotal;i++){var s=new u(this,i);s.smoothFactor=e.inputSmoothFactor,this.pointers.push(s)}this.mousePointer=e.inputMouse?this.pointers[0]:null,this.activePointer=this.pointers[0],this.globalTopOnly=!0,this.time=0,this._tempPoint={x:0,y:0},this._tempHitTest=[],this._tempMatrix=new d,this._tempMatrix2=new d,this._tempSkip=!1,this.mousePointerContainer=[this.mousePointer],t.events.once(o.BOOT,this.boot,this)},boot:function(){var t=this.game,e=t.events;this.canvas=t.canvas,this.scaleManager=t.scale,this.events.emit(a.MANAGER_BOOT),e.on(o.PRE_RENDER,this.preRender,this),e.once(o.DESTROY,this.destroy,this)},setCanvasOver:function(t){this.isOver=!0,this.events.emit(a.GAME_OVER,t)},setCanvasOut:function(t){this.isOver=!1,this.events.emit(a.GAME_OUT,t)},preRender:function(){var t=this.game.loop.now,e=this.game.loop.delta,i=this.game.scene.getScenes(!0,!0);this.time=t,this.events.emit(a.MANAGER_UPDATE);for(var s=0;s10&&(t=10-this.pointersTotal);for(var i=0;i{var s=i(26673),n=i(65650),r=i(56694),a=i(72687),o=i(27395),h=i(18104),l=i(53996),u=i(95669),c=i(72313),d=i(33963),f=i(6659),p=i(72632),v=i(52394),g=i(63399),m=i(42911),y=i(91963),x=i(74118),T=i(94287),w=i(7599),E=i(66349),S=i(60689),b=new r({Extends:f,initialize:function(t){f.call(this),this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.manager=t.sys.game.input,this.pluginEvents=new f,this.enabled=!0,this.displayList,this.cameras,g.install(this),this.mouse=this.manager.mouse,this.topOnly=!0,this.pollRate=-1,this._pollTimer=0;var e={cancelled:!1};this._eventContainer={stopPropagation:function(){e.cancelled=!0}},this._eventData=e,this.dragDistanceThreshold=0,this.dragTimeThreshold=0,this._temp=[],this._tempZones=[],this._list=[],this._pendingInsertion=[],this._pendingRemoval=[],this._draggable=[],this._drag={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._dragState=[],this._over={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._validTypes=["onDown","onUp","onOver","onOut","onMove","onDragStart","onDrag","onDragEnd","onDragEnter","onDragLeave","onDragOver","onDrop"],this._updatedThisFrame=!1,t.sys.events.once(w.BOOT,this.boot,this),t.sys.events.on(w.START,this.start,this)},boot:function(){this.cameras=this.systems.cameras,this.displayList=this.systems.displayList,this.systems.events.once(w.DESTROY,this.destroy,this),this.pluginEvents.emit(d.BOOT)},start:function(){var t=this.systems.events;t.on(w.TRANSITION_START,this.transitionIn,this),t.on(w.TRANSITION_OUT,this.transitionOut,this),t.on(w.TRANSITION_COMPLETE,this.transitionComplete,this),t.on(w.PRE_UPDATE,this.preUpdate,this),t.once(w.SHUTDOWN,this.shutdown,this),this.manager.events.on(d.GAME_OUT,this.onGameOut,this),this.manager.events.on(d.GAME_OVER,this.onGameOver,this),this.enabled=!0,this._dragState=[0,0,0,0,0,0,0,0,0,0],this.pluginEvents.emit(d.START)},onGameOver:function(t){this.isActive()&&this.emit(d.GAME_OVER,t.timeStamp,t)},onGameOut:function(t){this.isActive()&&this.emit(d.GAME_OUT,t.timeStamp,t)},preUpdate:function(){this.pluginEvents.emit(d.PRE_UPDATE);var t=this._pendingRemoval,e=this._pendingInsertion,i=t.length,s=e.length;if(0!==i||0!==s){for(var n=this._list,r=0;r-1&&(n.splice(o,1),this.clear(a,!0))}t.length=0,this._pendingRemoval.length=0,this._list=n.concat(e.splice(0))}},isActive:function(){return this.enabled&&this.scene.sys.isActive()},updatePoll:function(t,e){if(!this.isActive())return!1;if(this.pluginEvents.emit(d.UPDATE,t,e),this._updatedThisFrame)return this._updatedThisFrame=!1,!1;var i,s=this.manager,n=s.pointers,r=s.pointersTotal;for(i=0;i0){if(this._pollTimer-=e,!(this._pollTimer<0))return!1;this._pollTimer=this.pollRate}var o=!1;for(i=0;i0&&(o=!0)}return o},update:function(t,e){if(!this.isActive())return!1;for(var i=e.length,s=!1,n=0;n0&&(s=!0)}return this._updatedThisFrame=!0,s},clear:function(t,e){void 0===e&&(e=!1),this.disable(t);var i=t.input;i&&(i.gameObject=void 0,i.target=void 0,i.hitArea=void 0,i.hitAreaCallback=void 0,i.callbackContext=void 0,t.input=null),e||this.queueForRemoval(t);var s=this._draggable.indexOf(t);return s>-1&&this._draggable.splice(s,1),t},disable:function(t){var e=t.input;e&&(e.enabled=!1,e.dragState=0);var i=this._temp,s=this._drag,n=this._over,r=this.manager,a=i.indexOf(t);a>-1&&i.splice(a,1);for(var o=0;o-1&&s[o].splice(a,1),(a=n[o].indexOf(t))>-1&&(n[o].splice(a,1),r.resetCursor(e));return this},enable:function(t,e,i,s){return void 0===s&&(s=!1),t.input?t.input.enabled=!0:this.setHitArea(t,e,i),t.input&&s&&!t.input.dropZone&&(t.input.dropZone=s),this},hitTestPointer:function(t){for(var e=this.cameras.getCamerasBelowPointer(t),i=0;i0)return t.camera=s,n}return t.camera=e[0],[]},processDownEvents:function(t){var e=0,i=this._temp,s=this._eventData,n=this._eventContainer;s.cancelled=!1;for(var r=!1,a=0;a0&&l(t.x,t.y,t.downX,t.downY)>=n||s>0&&e>=t.downTime+s)&&(i=!0),i)return this.setDragState(t,3),this.processDragStartList(t)},processDragStartList:function(t){if(3!==this.getDragState(t))return 0;for(var e=this._drag[t.id],i=0;i1&&(this.sortGameObjects(i,t),this.topOnly&&i.splice(1)),this._drag[t.id]=i,0===this.dragDistanceThreshold&&0===this.dragTimeThreshold?(this.setDragState(t,3),this.processDragStartList(t)):(this.setDragState(t,2),0))},processDragMoveEvent:function(t){if(2===this.getDragState(t)&&this.processDragThresholdEvent(t,this.manager.game.loop.now),4!==this.getDragState(t))return 0;for(var e=this._tempZones,i=this._drag[t.id],s=0;s0?(a.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,a,h),o.target=e[0],h=o.target,a.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,a,h)):(a.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,a,h),e[0]?(o.target=e[0],h=o.target,a.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,a,h)):o.target=null)}else!h&&e[0]&&(o.target=e[0],h=o.target,a.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,a,h));if(a.parentContainer){var u=t.worldX-o.dragStartXGlobal,c=t.worldY-o.dragStartYGlobal,f=a.getParentRotation(),p=u*Math.cos(f)+c*Math.sin(f),v=c*Math.cos(f)-u*Math.sin(f);p*=1/a.parentContainer.scaleX,v*=1/a.parentContainer.scaleY,n=p+o.dragStartX,r=v+o.dragStartY}else n=t.worldX-o.dragX,r=t.worldY-o.dragY;a.emit(d.GAMEOBJECT_DRAG,t,n,r),this.emit(d.DRAG,t,a,n,r)}return i.length},processDragUpEvent:function(t){for(var e=this._drag[t.id],i=0;i0){var r=this.manager,a=this._eventData,o=this._eventContainer;a.cancelled=!1;for(var h=!1,l=0;l0){var n=this.manager,r=this._eventData,a=this._eventContainer;r.cancelled=!1;var o=!1;this.sortGameObjects(e,t);for(var h=0;h0){for(this.sortGameObjects(n,t),e=0;e0){for(this.sortGameObjects(r,t),e=0;e-1&&this._draggable.splice(n,1)}return this},makePixelPerfect:function(t){void 0===t&&(t=1);var e=this.systems.textures;return h(e,t)},setHitArea:function(t,e,i){if(void 0===e)return this.setHitAreaFromTexture(t);Array.isArray(t)||(t=[t]);var s=!1,n=!1,r=!1,a=!1,h=!1,l=!0;if(m(e)){var u=e;e=p(u,"hitArea",null),i=p(u,"hitAreaCallback",null),s=p(u,"draggable",!1),n=p(u,"dropZone",!1),r=p(u,"cursor",!1),a=p(u,"useHandCursor",!1),h=p(u,"pixelPerfect",!1);var c=p(u,"alphaTolerance",1);h&&(e={},i=this.makePixelPerfect(c)),e&&i||(this.setHitAreaFromTexture(t),l=!1)}else"function"!=typeof e||i||(i=e,e={});for(var d=0;d{var s=i(10850),n={},r={register:function(t,e,i,s,r){n[t]={plugin:e,mapping:i,settingsKey:s,configKey:r}},getPlugin:function(t){return n[t]},install:function(t){var e=t.scene.sys,i=e.settings.input,r=e.game.config;for(var a in n){var o=n[a].plugin,h=n[a].mapping,l=n[a].settingsKey,u=n[a].configKey;s(i,l,r[u])&&(t[h]=new o(t))}},remove:function(t){n.hasOwnProperty(t)&&delete n[t]}};t.exports=r},40398:(t,e,i)=>{var s=i(90447),n=i(56694),r=i(53996),a=i(88456),o=i(44521),h=i(93736),l=i(36580),u=new n({initialize:function(t,e){this.manager=t,this.id=e,this.event,this.downElement,this.upElement,this.camera=null,this.button=0,this.buttons=0,this.position=new h,this.prevPosition=new h,this.midPoint=new h(-1,-1),this.velocity=new h,this.angle=0,this.distance=0,this.smoothFactor=0,this.motionFactor=.2,this.worldX=0,this.worldY=0,this.moveTime=0,this.downX=0,this.downY=0,this.downTime=0,this.upX=0,this.upY=0,this.upTime=0,this.primaryDown=!1,this.isDown=!1,this.wasTouch=!1,this.wasCanceled=!1,this.movementX=0,this.movementY=0,this.identifier=0,this.pointerId=null,this.active=0===e,this.locked=!1,this.deltaX=0,this.deltaY=0,this.deltaZ=0},updateWorldPoint:function(t){var e=t.getWorldPoint(this.x,this.y);return this.worldX=e.x,this.worldY=e.y,this},positionToCamera:function(t,e){return t.getWorldPoint(this.x,this.y,e)},updateMotion:function(){var t=this.position.x,e=this.position.y,i=this.midPoint.x,n=this.midPoint.y;if(t!==i||e!==n){var r=o(this.motionFactor,i,t),h=o(this.motionFactor,n,e);a(r,t,.1)&&(r=t),a(h,e,.1)&&(h=e),this.midPoint.set(r,h);var l=t-r,u=e-h;this.velocity.set(l,u),this.angle=s(r,h,t,e),this.distance=Math.sqrt(l*l+u*u)}},up:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!1,this.upX=this.x,this.upY=this.y),0===this.buttons&&(this.isDown=!1,this.upTime=t.timeStamp,this.wasTouch=!1)},down:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!0,this.downX=this.x,this.downY=this.y),l.macOS&&t.ctrlKey&&(this.buttons=2,this.primaryDown=!1),this.isDown||(this.isDown=!0,this.downTime=t.timeStamp),this.wasTouch=!1},move:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.locked&&(this.movementX=t.movementX||t.mozMovementX||t.webkitMovementX||0,this.movementY=t.movementY||t.mozMovementY||t.webkitMovementY||0),this.moveTime=t.timeStamp,this.wasTouch=!1},wheel:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.deltaX=t.deltaX,this.deltaY=t.deltaY,this.deltaZ=t.deltaZ,this.wasTouch=!1},touchstart:function(t,e){t.pointerId&&(this.pointerId=t.pointerId),this.identifier=t.identifier,this.target=t.target,this.active=!0,this.buttons=1,this.event=e,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=e.timeStamp,this.isDown=!0,this.wasTouch=!0,this.wasCanceled=!1,this.updateMotion()},touchmove:function(t,e){this.event=e,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.moveTime=e.timeStamp,this.wasTouch=!0,this.updateMotion()},touchend:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!1,this.active=!1,this.updateMotion()},touchcancel:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!0,this.active=!1},noButtonDown:function(){return 0===this.buttons},leftButtonDown:function(){return!!(1&this.buttons)},rightButtonDown:function(){return!!(2&this.buttons)},middleButtonDown:function(){return!!(4&this.buttons)},backButtonDown:function(){return!!(8&this.buttons)},forwardButtonDown:function(){return!!(16&this.buttons)},leftButtonReleased:function(){return 0===this.button&&!this.isDown},rightButtonReleased:function(){return 2===this.button&&!this.isDown},middleButtonReleased:function(){return 1===this.button&&!this.isDown},backButtonReleased:function(){return 3===this.button&&!this.isDown},forwardButtonReleased:function(){return 4===this.button&&!this.isDown},getDistance:function(){return this.isDown?r(this.downX,this.downY,this.x,this.y):r(this.downX,this.downY,this.upX,this.upY)},getDistanceX:function(){return this.isDown?Math.abs(this.downX-this.x):Math.abs(this.downX-this.upX)},getDistanceY:function(){return this.isDown?Math.abs(this.downY-this.y):Math.abs(this.downY-this.upY)},getDuration:function(){return this.isDown?this.manager.time-this.downTime:this.upTime-this.downTime},getAngle:function(){return this.isDown?s(this.downX,this.downY,this.x,this.y):s(this.downX,this.downY,this.upX,this.upY)},getInterpolatedPosition:function(t,e){void 0===t&&(t=10),void 0===e&&(e=[]);for(var i=this.prevPosition.x,s=this.prevPosition.y,n=this.position.x,r=this.position.y,a=0;a{t.exports={MOUSE_DOWN:0,MOUSE_MOVE:1,MOUSE_UP:2,TOUCH_START:3,TOUCH_MOVE:4,TOUCH_END:5,POINTER_LOCK_CHANGE:6,TOUCH_CANCEL:7,MOUSE_WHEEL:8}},14874:t=>{t.exports="boot"},54168:t=>{t.exports="destroy"},526:t=>{t.exports="dragend"},81623:t=>{t.exports="dragenter"},94472:t=>{t.exports="drag"},9304:t=>{t.exports="dragleave"},34265:t=>{t.exports="dragover"},50151:t=>{t.exports="dragstart"},98134:t=>{t.exports="drop"},56773:t=>{t.exports="gameobjectdown"},45824:t=>{t.exports="dragend"},39578:t=>{t.exports="dragenter"},72072:t=>{t.exports="drag"},82569:t=>{t.exports="dragleave"},70833:t=>{t.exports="dragover"},81442:t=>{t.exports="dragstart"},32936:t=>{t.exports="drop"},99658:t=>{t.exports="gameobjectmove"},60515:t=>{t.exports="gameobjectout"},55254:t=>{t.exports="gameobjectover"},34782:t=>{t.exports="pointerdown"},41769:t=>{t.exports="pointermove"},65588:t=>{t.exports="pointerout"},61640:t=>{t.exports="pointerover"},49342:t=>{t.exports="pointerup"},82662:t=>{t.exports="wheel"},13058:t=>{t.exports="gameobjectup"},52426:t=>{t.exports="gameobjectwheel"},78072:t=>{t.exports="gameout"},1545:t=>{t.exports="gameover"},67137:t=>{t.exports="boot"},27678:t=>{t.exports="process"},22257:t=>{t.exports="update"},90379:t=>{t.exports="pointerlockchange"},88909:t=>{t.exports="pointerdown"},36548:t=>{t.exports="pointerdownoutside"},18483:t=>{t.exports="pointermove"},22355:t=>{t.exports="pointerout"},7997:t=>{t.exports="pointerover"},66318:t=>{t.exports="pointerup"},94812:t=>{t.exports="pointerupoutside"},37310:t=>{t.exports="wheel"},24196:t=>{t.exports="preupdate"},27053:t=>{t.exports="shutdown"},29413:t=>{t.exports="start"},25165:t=>{t.exports="update"},33963:(t,e,i)=>{t.exports={BOOT:i(14874),DESTROY:i(54168),DRAG_END:i(526),DRAG_ENTER:i(81623),DRAG:i(94472),DRAG_LEAVE:i(9304),DRAG_OVER:i(34265),DRAG_START:i(50151),DROP:i(98134),GAME_OUT:i(78072),GAME_OVER:i(1545),GAMEOBJECT_DOWN:i(56773),GAMEOBJECT_DRAG_END:i(45824),GAMEOBJECT_DRAG_ENTER:i(39578),GAMEOBJECT_DRAG:i(72072),GAMEOBJECT_DRAG_LEAVE:i(82569),GAMEOBJECT_DRAG_OVER:i(70833),GAMEOBJECT_DRAG_START:i(81442),GAMEOBJECT_DROP:i(32936),GAMEOBJECT_MOVE:i(99658),GAMEOBJECT_OUT:i(60515),GAMEOBJECT_OVER:i(55254),GAMEOBJECT_POINTER_DOWN:i(34782),GAMEOBJECT_POINTER_MOVE:i(41769),GAMEOBJECT_POINTER_OUT:i(65588),GAMEOBJECT_POINTER_OVER:i(61640),GAMEOBJECT_POINTER_UP:i(49342),GAMEOBJECT_POINTER_WHEEL:i(82662),GAMEOBJECT_UP:i(13058),GAMEOBJECT_WHEEL:i(52426),MANAGER_BOOT:i(67137),MANAGER_PROCESS:i(27678),MANAGER_UPDATE:i(22257),POINTER_DOWN:i(88909),POINTER_DOWN_OUTSIDE:i(36548),POINTER_MOVE:i(18483),POINTER_OUT:i(22355),POINTER_OVER:i(7997),POINTER_UP:i(66318),POINTER_UP_OUTSIDE:i(94812),POINTER_WHEEL:i(37310),POINTERLOCK_CHANGE:i(90379),PRE_UPDATE:i(24196),SHUTDOWN:i(27053),START:i(29413),UPDATE:i(25165)}},70848:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e){this.pad=t,this.events=t.events,this.index=e,this.value=0,this.threshold=.1},update:function(t){this.value=t},getValue:function(){return Math.abs(this.value){var s=i(56694),n=i(43200),r=new s({initialize:function(t,e){this.pad=t,this.events=t.manager,this.index=e,this.value=0,this.threshold=1,this.pressed=!1},update:function(t){this.value=t;var e=this.pad,i=this.index;t>=this.threshold?this.pressed||(this.pressed=!0,this.events.emit(n.BUTTON_DOWN,e,this,t),this.pad.emit(n.GAMEPAD_BUTTON_DOWN,i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit(n.BUTTON_UP,e,this,t),this.pad.emit(n.GAMEPAD_BUTTON_UP,i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=r},75956:(t,e,i)=>{var s=i(70848),n=i(21274),r=i(56694),a=i(6659),o=i(93736),h=new r({Extends:a,initialize:function(t,e){a.call(this),this.manager=t,this.pad=e,this.id=e.id,this.index=e.index;for(var i=[],r=0;r=2&&(this.leftStick.set(r[0].getValue(),r[1].getValue()),n>=4&&this.rightStick.set(r[2].getValue(),r[3].getValue()))}},destroy:function(){var t;for(this.removeAllListeners(),this.manager=null,this.pad=null,t=0;t{var s=i(56694),n=i(6659),r=i(43200),a=i(75956),o=i(10850),h=i(63399),l=i(33963),u=new s({Extends:n,initialize:function(t){n.call(this),this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.enabled=!0,this.target,this.gamepads=[],this.queue=[],this.onGamepadHandler,this._pad1,this._pad2,this._pad3,this._pad4,t.pluginEvents.once(l.BOOT,this.boot,this),t.pluginEvents.on(l.START,this.start,this)},boot:function(){var t=this.scene.sys.game,e=this.settings.input,i=t.config;this.enabled=o(e,"gamepad",i.inputGamepad)&&t.device.input.gamepads,this.target=o(e,"gamepad.target",i.inputGamepadEventTarget),this.sceneInputPlugin.pluginEvents.once(l.DESTROY,this.destroy,this)},start:function(){this.enabled&&(this.startListeners(),this.refreshPads()),this.sceneInputPlugin.pluginEvents.once(l.SHUTDOWN,this.shutdown,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},startListeners:function(){var t=this,e=this.target,i=function(e){!e.defaultPrevented&&t.isActive()&&(t.refreshPads(),t.queue.push(e))};this.onGamepadHandler=i,e.addEventListener("gamepadconnected",i,!1),e.addEventListener("gamepaddisconnected",i,!1),this.sceneInputPlugin.pluginEvents.on(l.UPDATE,this.update,this)},stopListeners:function(){this.target.removeEventListener("gamepadconnected",this.onGamepadHandler),this.target.removeEventListener("gamepaddisconnected",this.onGamepadHandler),this.sceneInputPlugin.pluginEvents.off(l.UPDATE,this.update);for(var t=0;t{t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,SELECT:8,START:9,B:0,A:1,Y:2,X:3,LEFT_SHOULDER:4,RIGHT_SHOULDER:5}},74982:t=>{t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,SHARE:8,OPTIONS:9,PS:16,TOUCHBAR:17,X:0,CIRCLE:1,SQUARE:2,TRIANGLE:3,L1:4,R1:5,L2:6,R2:7,L3:10,R3:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}},43247:t=>{t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,MENU:16,A:0,B:1,X:2,Y:3,LB:4,RB:5,LT:6,RT:7,BACK:8,START:9,LS:10,RS:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}},4898:(t,e,i)=>{t.exports={DUALSHOCK_4:i(74982),SNES_USB:i(33171),XBOX_360:i(43247)}},17344:t=>{t.exports="down"},36635:t=>{t.exports="up"},85724:t=>{t.exports="connected"},55832:t=>{t.exports="disconnected"},772:t=>{t.exports="down"},33608:t=>{t.exports="up"},43200:(t,e,i)=>{t.exports={BUTTON_DOWN:i(17344),BUTTON_UP:i(36635),CONNECTED:i(85724),DISCONNECTED:i(55832),GAMEPAD_BUTTON_DOWN:i(772),GAMEPAD_BUTTON_UP:i(33608)}},92636:(t,e,i)=>{t.exports={Axis:i(70848),Button:i(21274),Events:i(43200),Gamepad:i(75956),GamepadPlugin:i(1379),Configs:i(4898)}},20873:(t,e,i)=>{var s=i(72687),n=i(98611),r={CreatePixelPerfectHandler:i(18104),CreateInteractiveObject:i(27395),Events:i(33963),Gamepad:i(92636),InputManager:i(69898),InputPlugin:i(12499),InputPluginCache:i(63399),Keyboard:i(28388),Mouse:i(11343),Pointer:i(40398),Touch:i(77423)};r=n(!1,r,s),t.exports=r},71064:(t,e,i)=>{var s=i(66458),n=i(56694),r=i(97081),a=i(33963),o=i(11873),h=i(72283),l=new n({initialize:function(t){this.manager=t,this.queue=[],this.preventDefault=!0,this.captures=[],this.enabled=!1,this.target,this.onKeyDown=h,this.onKeyUp=h,t.events.once(a.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputKeyboard,this.target=t.inputKeyboardEventTarget,this.addCapture(t.inputKeyboardCapture),!this.target&&window&&(this.target=window),this.enabled&&this.target&&this.startListeners(),this.manager.game.events.on(r.POST_STEP,this.postUpdate,this)},startListeners:function(){var t=this;this.onKeyDown=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.events.emit(a.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}},this.onKeyUp=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.events.emit(a.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}};var e=this.target;e&&(e.addEventListener("keydown",this.onKeyDown,!1),e.addEventListener("keyup",this.onKeyUp,!1),this.enabled=!0)},stopListeners:function(){var t=this.target;t.removeEventListener("keydown",this.onKeyDown,!1),t.removeEventListener("keyup",this.onKeyUp,!1),this.enabled=!1},postUpdate:function(){this.queue=[]},addCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},removeCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},clearCaptures:function(){this.captures=[],this.preventDefault=!1},destroy:function(){this.stopListeners(),this.clearCaptures(),this.queue=[],this.manager.game.events.off(r.POST_RENDER,this.postUpdate,this),this.target=null,this.enabled=!1,this.manager=null}});t.exports=l},89666:(t,e,i)=>{var s=i(56694),n=i(6659),r=i(94030),a=i(97081),o=i(10850),h=i(33963),l=i(63399),u=i(50165),c=i(11873),d=i(95625),f=i(48044),p=i(7599),v=i(84314),g=new s({Extends:n,initialize:function(t){n.call(this),this.game=t.systems.game,this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.manager=t.manager.keyboard,this.enabled=!0,this.keys=[],this.combos=[],this.prevCode=null,this.prevTime=0,this.prevType=null,t.pluginEvents.once(h.BOOT,this.boot,this),t.pluginEvents.on(h.START,this.start,this)},boot:function(){var t=this.settings.input;this.enabled=o(t,"keyboard",!0);var e=o(t,"keyboard.capture",null);e&&this.addCaptures(e),this.sceneInputPlugin.pluginEvents.once(h.DESTROY,this.destroy,this)},start:function(){this.sceneInputPlugin.manager.events.on(h.MANAGER_PROCESS,this.update,this),this.sceneInputPlugin.pluginEvents.once(h.SHUTDOWN,this.shutdown,this),this.game.events.on(a.BLUR,this.resetKeys,this),this.scene.sys.events.on(p.PAUSE,this.resetKeys,this),this.scene.sys.events.on(p.SLEEP,this.resetKeys,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},addCapture:function(t){return this.manager.addCapture(t),this},removeCapture:function(t){return this.manager.removeCapture(t),this},getCaptures:function(){return this.manager.captures},enableGlobalCapture:function(){return this.manager.preventDefault=!0,this},disableGlobalCapture:function(){return this.manager.preventDefault=!1,this},clearCaptures:function(){return this.manager.clearCaptures(),this},createCursorKeys:function(){return this.addKeys({up:c.UP,down:c.DOWN,left:c.LEFT,right:c.RIGHT,space:c.SPACE,shift:c.SHIFT})},addKeys:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1);var s={};if("string"==typeof t){t=t.split(",");for(var n=0;n-1?s[n]=t:s[t.keyCode]=t,e&&this.addCapture(t.keyCode),t.setEmitOnRepeat(i),t}return"string"==typeof t&&(t=c[t.toUpperCase()]),s[t]||(s[t]=new u(this,t),e&&this.addCapture(t),s[t].setEmitOnRepeat(i)),s[t]},removeKey:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var s,n=this.keys;if(t instanceof u){var r=n.indexOf(t);r>-1&&(s=this.keys[r],this.keys[r]=void 0)}else"string"==typeof t&&(t=c[t.toUpperCase()]);return n[t]&&(s=n[t],n[t]=void 0),s&&(s.plugin=null,i&&this.removeCapture(s.keyCode),e&&s.destroy()),this},removeAllKeys:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);for(var i=this.keys,s=0;st._tick)return t._tick=i,!0}return!1},update:function(){var t=this.manager.queue,e=t.length;if(this.isActive()&&0!==e)for(var i=this.keys,s=0;s{t.exports=function(t,e){return e.timeLastMatched=t.timeStamp,e.index++,e.index===e.size||(e.current=e.keyCodes[e.index],!1)}},95625:(t,e,i)=>{var s=i(56694),n=i(94030),r=i(72632),a=i(2544),o=i(88754),h=new s({initialize:function(t,e,i){if(void 0===i&&(i={}),e.length<2)return!1;this.manager=t,this.enabled=!0,this.keyCodes=[];for(var s=0;s{var s=i(60258);t.exports=function(t,e){if(e.matched)return!0;var i=!1,n=!1;if(t.keyCode===e.current)if(e.index>0&&e.maxKeyDelay>0){var r=e.timeLastMatched+e.maxKeyDelay;t.timeStamp<=r&&(n=!0,i=s(t,e))}else n=!0,i=s(t,e);return!n&&e.resetOnWrongKey&&(e.index=0,e.current=e.keyCodes[0]),i&&(e.timeLastMatched=t.timeStamp,e.matched=!0,e.timeMatched=t.timeStamp),i}},88754:t=>{t.exports=function(t){return t.current=t.keyCodes[0],t.index=0,t.timeLastMatched=0,t.matched=!1,t.timeMatched=0,t}},5044:t=>{t.exports="keydown"},40813:t=>{t.exports="keyup"},89319:t=>{t.exports="keycombomatch"},76362:t=>{t.exports="down"},78595:t=>{t.exports="keydown-"},30056:t=>{t.exports="keyup-"},81939:t=>{t.exports="up"},94030:(t,e,i)=>{t.exports={ANY_KEY_DOWN:i(5044),ANY_KEY_UP:i(40813),COMBO_MATCH:i(89319),DOWN:i(76362),KEY_DOWN:i(78595),KEY_UP:i(30056),UP:i(81939)}},28388:(t,e,i)=>{t.exports={Events:i(94030),KeyboardManager:i(71064),KeyboardPlugin:i(89666),Key:i(50165),KeyCodes:i(11873),KeyCombo:i(95625),AdvanceKeyCombo:i(60258),ProcessKeyCombo:i(2544),ResetKeyCombo:i(88754),JustDown:i(42460),JustUp:i(53162),DownDuration:i(64964),UpDuration:i(70331)}},64964:t=>{t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeDown;return t.isDown&&i{t.exports=function(t){return!!t._justDown&&(t._justDown=!1,!0)}},53162:t=>{t.exports=function(t){return!!t._justUp&&(t._justUp=!1,!0)}},50165:(t,e,i)=>{var s=i(56694),n=i(6659),r=i(94030),a=new s({Extends:n,initialize:function(t,e){n.call(this),this.plugin=t,this.keyCode=e,this.originalEvent=void 0,this.enabled=!0,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.metaKey=!1,this.location=0,this.timeDown=0,this.duration=0,this.timeUp=0,this.emitOnRepeat=!1,this.repeats=0,this._justDown=!1,this._justUp=!1,this._tick=-1},setEmitOnRepeat:function(t){return this.emitOnRepeat=t,this},onDown:function(t){this.originalEvent=t,this.enabled&&(this.altKey=t.altKey,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.metaKey=t.metaKey,this.location=t.location,this.repeats++,this.isDown?this.emitOnRepeat&&this.emit(r.DOWN,this,t):(this.isDown=!0,this.isUp=!1,this.timeDown=t.timeStamp,this.duration=0,this._justDown=!0,this._justUp=!1,this.emit(r.DOWN,this,t)))},onUp:function(t){this.originalEvent=t,this.enabled&&(this.isDown=!1,this.isUp=!0,this.timeUp=t.timeStamp,this.duration=this.timeUp-this.timeDown,this.repeats=0,this._justDown=!1,this._justUp=!0,this._tick=-1,this.emit(r.UP,this,t))},reset:function(){return this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.metaKey=!1,this.timeDown=0,this.duration=0,this.timeUp=0,this.repeats=0,this._justDown=!1,this._justUp=!1,this._tick=-1,this},getDuration:function(){return this.isDown?this.plugin.game.loop.time-this.timeDown:0},destroy:function(){this.removeAllListeners(),this.originalEvent=null,this.plugin=null}});t.exports=a},11873:t=>{t.exports={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:42,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,NUMPAD_ZERO:96,NUMPAD_ONE:97,NUMPAD_TWO:98,NUMPAD_THREE:99,NUMPAD_FOUR:100,NUMPAD_FIVE:101,NUMPAD_SIX:102,NUMPAD_SEVEN:103,NUMPAD_EIGHT:104,NUMPAD_NINE:105,NUMPAD_ADD:107,NUMPAD_SUBTRACT:109,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,SEMICOLON:186,PLUS:187,COMMA:188,MINUS:189,PERIOD:190,FORWARD_SLASH:191,BACK_SLASH:220,QUOTES:222,BACKTICK:192,OPEN_BRACKET:219,CLOSED_BRACKET:221,SEMICOLON_FIREFOX:59,COLON:58,COMMA_FIREFOX_WINDOWS:60,COMMA_FIREFOX:62,BRACKET_RIGHT_FIREFOX:174,BRACKET_LEFT_FIREFOX:175}},48044:(t,e,i)=>{var s=i(11873),n={};for(var r in s)n[s[r]]=r;t.exports=n},70331:t=>{t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeUp;return t.isUp&&i{var s=i(56694),n=i(90185),r=i(33963),a=i(72283),o=new s({initialize:function(t){this.manager=t,this.preventDefaultDown=!0,this.preventDefaultUp=!0,this.preventDefaultMove=!0,this.preventDefaultWheel=!1,this.enabled=!1,this.target,this.locked=!1,this.onMouseMove=a,this.onMouseDown=a,this.onMouseUp=a,this.onMouseDownWindow=a,this.onMouseUpWindow=a,this.onMouseOver=a,this.onMouseOut=a,this.onMouseWheel=a,this.pointerLockChange=a,this.isTop=!0,t.events.once(r.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputMouse,this.target=t.inputMouseEventTarget,this.passive=t.inputMousePassive,this.preventDefaultDown=t.inputMousePreventDefaultDown,this.preventDefaultUp=t.inputMousePreventDefaultUp,this.preventDefaultMove=t.inputMousePreventDefaultMove,this.preventDefaultWheel=t.inputMousePreventDefaultWheel,this.target?"string"==typeof this.target&&(this.target=document.getElementById(this.target)):this.target=this.manager.game.canvas,t.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return this.target.addEventListener("contextmenu",(function(t){return t.preventDefault(),!1})),this},requestPointerLock:function(){if(n.pointerLock){var t=this.target;t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock||t.webkitRequestPointerLock,t.requestPointerLock()}},releasePointerLock:function(){n.pointerLock&&(document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,document.exitPointerLock())},startListeners:function(){var t=this.target;if(t){var e=this,i=this.manager,s=i.canvas,r=window&&window.focus&&i.game.config.autoFocus;this.onMouseMove=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onMouseMove(t),e.preventDefaultMove&&t.preventDefault())},this.onMouseDown=function(t){r&&window.focus(),!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onMouseDown(t),e.preventDefaultDown&&t.target===s&&t.preventDefault())},this.onMouseDownWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==s&&i.onMouseDown(t)},this.onMouseUp=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onMouseUp(t),e.preventDefaultUp&&t.target===s&&t.preventDefault())},this.onMouseUpWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==s&&i.onMouseUp(t)},this.onMouseOver=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.setCanvasOver(t)},this.onMouseOut=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.setCanvasOut(t)},this.onMouseWheel=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.onMouseWheel(t),e.preventDefaultWheel&&t.target===s&&t.preventDefault()};var a={passive:!0};if(t.addEventListener("mousemove",this.onMouseMove),t.addEventListener("mousedown",this.onMouseDown),t.addEventListener("mouseup",this.onMouseUp),t.addEventListener("mouseover",this.onMouseOver,a),t.addEventListener("mouseout",this.onMouseOut,a),this.preventDefaultWheel?t.addEventListener("wheel",this.onMouseWheel,{passive:!1}):t.addEventListener("wheel",this.onMouseWheel,a),window&&i.game.config.inputWindowEvents)try{window.top.addEventListener("mousedown",this.onMouseDownWindow,a),window.top.addEventListener("mouseup",this.onMouseUpWindow,a)}catch(t){window.addEventListener("mousedown",this.onMouseDownWindow,a),window.addEventListener("mouseup",this.onMouseUpWindow,a),this.isTop=!1}n.pointerLock&&(this.pointerLockChange=function(t){var s=e.target;e.locked=document.pointerLockElement===s||document.mozPointerLockElement===s||document.webkitPointerLockElement===s,i.onPointerLockChange(t)},document.addEventListener("pointerlockchange",this.pointerLockChange,!0),document.addEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.addEventListener("webkitpointerlockchange",this.pointerLockChange,!0)),this.enabled=!0}},stopListeners:function(){var t=this.target;t.removeEventListener("mousemove",this.onMouseMove),t.removeEventListener("mousedown",this.onMouseDown),t.removeEventListener("mouseup",this.onMouseUp),t.removeEventListener("mouseover",this.onMouseOver),t.removeEventListener("mouseout",this.onMouseOut),window&&((t=this.isTop?window.top:window).removeEventListener("mousedown",this.onMouseDownWindow),t.removeEventListener("mouseup",this.onMouseUpWindow)),n.pointerLock&&(document.removeEventListener("pointerlockchange",this.pointerLockChange,!0),document.removeEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.removeEventListener("webkitpointerlockchange",this.pointerLockChange,!0))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});t.exports=o},11343:(t,e,i)=>{t.exports={MouseManager:i(7905)}},37579:(t,e,i)=>{var s=i(56694),n=i(33963),r=i(72283),a=new s({initialize:function(t){this.manager=t,this.capture=!0,this.enabled=!1,this.target,this.onTouchStart=r,this.onTouchStartWindow=r,this.onTouchMove=r,this.onTouchEnd=r,this.onTouchEndWindow=r,this.onTouchCancel=r,this.onTouchCancelWindow=r,this.isTop=!0,t.events.once(n.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputTouch,this.target=t.inputTouchEventTarget,this.capture=t.inputTouchCapture,this.target?"string"==typeof this.target&&(this.target=document.getElementById(this.target)):this.target=this.manager.game.canvas,t.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return this.target.addEventListener("contextmenu",(function(t){return t.preventDefault(),!1})),this},startListeners:function(){var t=this.target;if(t){var e=this,i=this.manager,s=i.canvas,n=window&&window.focus&&i.game.config.autoFocus;this.onTouchMove=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onTouchMove(t),e.capture&&t.cancelable&&t.preventDefault())},this.onTouchStart=function(t){n&&window.focus(),!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onTouchStart(t),e.capture&&t.cancelable&&t.target===s&&t.preventDefault())},this.onTouchStartWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==s&&i.onTouchStart(t)},this.onTouchEnd=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onTouchEnd(t),e.capture&&t.cancelable&&t.target===s&&t.preventDefault())},this.onTouchEndWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==s&&i.onTouchEnd(t)},this.onTouchCancel=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onTouchCancel(t),e.capture&&t.preventDefault())},this.onTouchCancelWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.onTouchCancel(t)};var r=this.capture,a={passive:!0},o={passive:!1};if(t.addEventListener("touchstart",this.onTouchStart,r?o:a),t.addEventListener("touchmove",this.onTouchMove,r?o:a),t.addEventListener("touchend",this.onTouchEnd,r?o:a),t.addEventListener("touchcancel",this.onTouchCancel,r?o:a),window&&i.game.config.inputWindowEvents)try{window.top.addEventListener("touchstart",this.onTouchStartWindow,o),window.top.addEventListener("touchend",this.onTouchEndWindow,o),window.top.addEventListener("touchcancel",this.onTouchCancelWindow,o)}catch(t){window.addEventListener("touchstart",this.onTouchStartWindow,o),window.addEventListener("touchend",this.onTouchEndWindow,o),window.addEventListener("touchcancel",this.onTouchCancelWindow,o),this.isTop=!1}this.enabled=!0}},stopListeners:function(){var t=this.target;t.removeEventListener("touchstart",this.onTouchStart),t.removeEventListener("touchmove",this.onTouchMove),t.removeEventListener("touchend",this.onTouchEnd),t.removeEventListener("touchcancel",this.onTouchCancel),window&&((t=this.isTop?window.top:window).removeEventListener("touchstart",this.onTouchStartWindow),t.removeEventListener("touchend",this.onTouchEndWindow),t.removeEventListener("touchcancel",this.onTouchCancelWindow))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});t.exports=a},77423:(t,e,i)=>{t.exports={TouchManager:i(37579)}},98035:(t,e,i)=>{var s=i(56694),n=i(12117),r=i(683),a=i(72632),o=i(30750),h=i(43531),l=i(88490),u=i(33868),c=new s({initialize:function(t,e){if(this.loader=t,this.cache=a(e,"cache",!1),this.type=a(e,"type",!1),!this.type)throw new Error("Invalid File type: "+this.type);this.key=a(e,"key",!1);var i=this.key;if(t.prefix&&""!==t.prefix&&(this.key=t.prefix+i),!this.key)throw new Error("Invalid File key: "+this.key);var s=a(e,"url");void 0===s?s=t.path+i+"."+a(e,"extension",""):"string"!=typeof s||s.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)||(s=t.path+s),this.url=s,this.src="",this.xhrSettings=u(a(e,"responseType",void 0)),a(e,"xhrSettings",!1)&&(this.xhrSettings=h(this.xhrSettings,a(e,"xhrSettings",{}))),this.xhrLoader=null,this.state="function"==typeof this.url?n.FILE_POPULATED:n.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=a(e,"config",{}),this.multiFile,this.linkFile},setLink:function(t){this.linkFile=t,t.linkFile=this},resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){this.state===n.FILE_POPULATED?this.loader.nextFile(this,!0):(this.state=n.FILE_LOADING,this.src=o(this,this.loader.baseURL),0===this.src.indexOf("data:")?console.warn("Local data URIs are not supported: "+this.key):this.xhrLoader=l(this,this.loader.xhr))},onLoad:function(t,e){var i=t.responseURL&&this.loader.localSchemes.some((function(e){return 0===t.responseURL.indexOf(e)}))&&0===e.target.status,s=!(e.target&&200!==e.target.status)||i;4===t.readyState&&t.status>=400&&t.status<=599&&(s=!1),this.state=n.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,s)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(r.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=n.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=n.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){console.error('Failed to process file: %s "%s"',this.type,this.key),this.state=n.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.data&&this.cache.add(this.key,this.data)},pendingDestroy:function(t){if(this.state!==n.FILE_PENDING_DESTROY){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit(r.FILE_COMPLETE,e,i,t),this.loader.emit(r.FILE_KEY_COMPLETE+i+"-"+e,e,i,t),this.loader.flagForRemoval(this),this.state=n.FILE_PENDING_DESTROY}},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});c.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var s=new FileReader;s.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+s.result.split(",")[1]},s.onerror=t.onerror,s.readAsDataURL(e)}},c.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=c},76846:t=>{var e={},i={install:function(t){for(var i in e)t[i]=e[i]},register:function(t,i){e[t]=i},destroy:function(){e={}}};t.exports=i},30750:t=>{t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},67285:(t,e,i)=>{var s=i(56694),n=i(12117),r=i(58403),a=i(6659),o=i(683),h=i(76846),l=i(72632),u=i(10850),c=i(91963),d=i(7599),f=i(33868),p=new s({Extends:a,initialize:function(t){a.call(this);var e=t.sys.game.config,i=t.sys.settings.loader;this.scene=t,this.systems=t.sys,this.cacheManager=t.sys.cache,this.textureManager=t.sys.textures,this.sceneManager=t.sys.game.scene,h.install(this),this.prefix="",this.path="",this.baseURL="",this.setBaseURL(l(i,"baseURL",e.loaderBaseURL)),this.setPath(l(i,"path",e.loaderPath)),this.setPrefix(l(i,"prefix",e.loaderPrefix)),this.maxParallelDownloads=l(i,"maxParallelDownloads",e.loaderMaxParallelDownloads),this.xhr=f(l(i,"responseType",e.loaderResponseType),l(i,"async",e.loaderAsync),l(i,"user",e.loaderUser),l(i,"password",e.loaderPassword),l(i,"timeout",e.loaderTimeout),l(i,"withCredentials",e.loaderWithCredentials)),this.crossOrigin=l(i,"crossOrigin",e.loaderCrossOrigin),this.imageLoadType=l(i,"imageLoadType",e.loaderImageLoadType),this.localSchemes=l(i,"localScheme",e.loaderLocalScheme),this.totalToLoad=0,this.progress=0,this.list=new r,this.inflight=new r,this.queue=new r,this._deleteQueue=new r,this.totalFailed=0,this.totalComplete=0,this.state=n.LOADER_IDLE,this.multiKeyIndex=0,t.sys.events.once(d.BOOT,this.boot,this),t.sys.events.on(d.START,this.pluginStart,this)},boot:function(){this.systems.events.once(d.DESTROY,this.destroy,this)},pluginStart:function(){this.systems.events.once(d.SHUTDOWN,this.shutdown,this)},setBaseURL:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.baseURL=t,this},setPath:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.path=t,this},setPrefix:function(t){return void 0===t&&(t=""),this.prefix=t,this},setCORS:function(t){return this.crossOrigin=t,this},addFile:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e0},isLoading:function(){return this.state===n.LOADER_LOADING||this.state===n.LOADER_PROCESSING},isReady:function(){return this.state===n.LOADER_IDLE||this.state===n.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit(o.START,this),0===this.list.size?this.loadComplete():(this.state=n.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on(d.UPDATE,this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit(o.PROGRESS,this.progress)},update:function(){this.state===n.LOADER_LOADING&&this.list.size>0&&this.inflight.size{var s=i(98611),n=i(33868);t.exports=function(t,e){var i=void 0===t?n():s({},t);if(e)for(var r in e)void 0!==e[r]&&(i[r]=e[r]);return i}},45176:(t,e,i)=>{var s=i(56694),n=i(12117),r=i(683),a=new s({initialize:function(t,e,i,s){var r=[];s.forEach((function(t){t&&r.push(t)})),this.loader=t,this.type=e,this.key=i,this.multiKeyIndex=t.multiKeyIndex++,this.files=r,this.state=n.FILE_PENDING,this.complete=!1,this.pending=r.length,this.failed=0,this.config={},this.baseURL=t.baseURL,this.path=t.path,this.prefix=t.prefix;for(var a=0;a{var s=i(43531);t.exports=function(t,e){var i=s(e,t.xhrSettings),n=new XMLHttpRequest;if(n.open("GET",t.src,i.async,i.user,i.password),n.responseType=t.xhrSettings.responseType,n.timeout=i.timeout,i.headers)for(var r in i.headers)n.setRequestHeader(r,i.headers[r]);return i.header&&i.headerValue&&n.setRequestHeader(i.header,i.headerValue),i.requestedWith&&n.setRequestHeader("X-Requested-With",i.requestedWith),i.overrideMimeType&&n.overrideMimeType(i.overrideMimeType),i.withCredentials&&(n.withCredentials=!0),n.onload=t.onLoad.bind(t,n),n.onerror=t.onError.bind(t,n),n.onprogress=t.onProgress.bind(t),n.send(),n}},33868:t=>{t.exports=function(t,e,i,s,n,r){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===s&&(s=""),void 0===n&&(n=0),void 0===r&&(r=!1),{responseType:t,async:e,user:i,password:s,timeout:n,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:r}}},12117:t=>{t.exports={LOADER_IDLE:0,LOADER_LOADING:1,LOADER_PROCESSING:2,LOADER_COMPLETE:3,LOADER_SHUTDOWN:4,LOADER_DESTROYED:5,FILE_PENDING:10,FILE_LOADING:11,FILE_LOADED:12,FILE_FAILED:13,FILE_PROCESSING:14,FILE_ERRORED:16,FILE_COMPLETE:17,FILE_DESTROYED:18,FILE_POPULATED:19,FILE_PENDING_DESTROY:20}},7398:t=>{t.exports="addfile"},52187:t=>{t.exports="complete"},36627:t=>{t.exports="filecomplete"},81925:t=>{t.exports="filecomplete-"},29774:t=>{t.exports="loaderror"},20943:t=>{t.exports="load"},74693:t=>{t.exports="fileprogress"},71176:t=>{t.exports="postprocess"},88984:t=>{t.exports="progress"},72753:t=>{t.exports="start"},683:(t,e,i)=>{t.exports={ADD:i(7398),COMPLETE:i(52187),FILE_COMPLETE:i(36627),FILE_KEY_COMPLETE:i(81925),FILE_LOAD_ERROR:i(29774),FILE_LOAD:i(20943),FILE_PROGRESS:i(74693),POST_PROCESS:i(71176),PROGRESS:i(88984),START:i(72753)}},46468:(t,e,i)=>{var s=i(56694),n=i(76846),r=i(70806),a=i(683),o=new s({Extends:r,initialize:function(t,e,i,s,n){r.call(this,t,e,i,s,n),this.type="animationJSON"},onProcess:function(){this.loader.once(a.POST_PROCESS,this.onLoadComplete,this),r.prototype.onProcess.call(this)},onLoadComplete:function(){this.loader.systems.anims.fromJSON(this.data)}});n.register("animation",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(76846),r=i(72632),a=i(42927),o=i(42911),h=i(70806),l=i(45176),u=new s({Extends:l,initialize:function(t,e,i,s,n,u){var c,d;if(o(e)){var f=e;e=r(f,"key"),c=new a(t,{key:e,url:r(f,"textureURL"),extension:r(f,"textureExtension","png"),normalMap:r(f,"normalMap"),xhrSettings:r(f,"textureXhrSettings")}),d=new h(t,{key:e,url:r(f,"atlasURL"),extension:r(f,"atlasExtension","json"),xhrSettings:r(f,"atlasXhrSettings")})}else c=new a(t,e,i,n),d=new h(t,e,s,u);c.linkFile?l.call(this,t,"atlasjson",e,[c,d,c.linkFile]):l.call(this,t,"atlasjson",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(t.key,t.data,e.data,i),e.addToCache(),this.complete=!0}}});n.register("aseprite",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var a=0;a{var s=i(56694),n=i(76846),r=i(72632),a=i(42927),o=i(42911),h=i(70806),l=i(45176),u=new s({Extends:l,initialize:function(t,e,i,s,n,u){var c,d;if(o(e)){var f=e;e=r(f,"key"),c=new a(t,{key:e,url:r(f,"textureURL"),extension:r(f,"textureExtension","png"),normalMap:r(f,"normalMap"),xhrSettings:r(f,"textureXhrSettings")}),d=new h(t,{key:e,url:r(f,"atlasURL"),extension:r(f,"atlasExtension","json"),xhrSettings:r(f,"atlasXhrSettings")})}else c=new a(t,e,i,n),d=new h(t,e,s,u);c.linkFile?l.call(this,t,"atlasjson",e,[c,d,c.linkFile]):l.call(this,t,"atlasjson",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(t.key,t.data,e.data,i),this.complete=!0}}});n.register("atlas",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var a=0;a{var s=i(56694),n=i(76846),r=i(72632),a=i(42927),o=i(42911),h=i(45176),l=i(15297),u=new s({Extends:h,initialize:function(t,e,i,s,n,u){var c,d;if(o(e)){var f=e;e=r(f,"key"),c=new a(t,{key:e,url:r(f,"textureURL"),extension:r(f,"textureExtension","png"),normalMap:r(f,"normalMap"),xhrSettings:r(f,"textureXhrSettings")}),d=new l(t,{key:e,url:r(f,"atlasURL"),extension:r(f,"atlasExtension","xml"),xhrSettings:r(f,"atlasXhrSettings")})}else c=new a(t,e,i,n),d=new l(t,e,s,u);c.linkFile?h.call(this,t,"atlasxml",e,[c,d,c.linkFile]):h.call(this,t,"atlasxml",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlasXML(t.key,t.data,e.data,i),this.complete=!0}}});n.register("atlasXML",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var a=0;a{var s=i(56694),n=i(12117),r=i(98035),a=i(76846),o=i(72632),h=i(30929),l=i(42911),u=new s({Extends:r,initialize:function(t,e,i,s,n){if(l(e)){var a=e;e=o(a,"key"),s=o(a,"xhrSettings"),n=o(a,"context",n)}var h={type:"audio",cache:t.cacheManager.audio,extension:i.type,responseType:"arraybuffer",key:e,url:i.url,xhrSettings:s,config:{context:n}};r.call(this,t,h)},onProcess:function(){this.state=n.FILE_PROCESSING;var t=this;this.config.context.decodeAudioData(this.xhrLoader.response,(function(e){t.data=e,t.onProcessComplete()}),(function(e){console.error("Error decoding audio: "+t.key+" - ",e?e.message:null),t.onProcessError()})),this.config.context=null}});u.create=function(t,e,i,s,n){var r=t.systems.game,a=r.config.audio,c=r.device.audio;l(e)&&(i=o(e,"url",[]),s=o(e,"config",{}));var d=u.getAudioURL(r,i);return d?c.webAudio&&!a.disableWebAudio?new u(t,e,d,n,r.sound.context):new h(t,e,d,s):null},u.getAudioURL=function(t,e){Array.isArray(e)||(e=[e]);for(var i=0;i{var s=i(67448),n=i(56694),r=i(76846),a=i(72632),o=i(42911),h=i(70806),l=i(45176),u=new n({Extends:l,initialize:function(t,e,i,n,r,u,c){if(o(e)){var d=e;e=a(d,"key"),i=a(d,"jsonURL"),n=a(d,"audioURL"),r=a(d,"audioConfig"),u=a(d,"audioXhrSettings"),c=a(d,"jsonXhrSettings")}var f;if(n){var p=s.create(t,e,n,r,u);p&&(f=new h(t,e,i,c),l.call(this,t,"audiosprite",e,[p,f]),this.config.resourceLoad=!1)}else f=new h(t,e,i,c),l.call(this,t,"audiosprite",e,[f]),this.config.resourceLoad=!0,this.config.audioConfig=r,this.config.audioXhrSettings=u},onFileComplete:function(t){if(-1!==this.files.indexOf(t)&&(this.pending--,this.config.resourceLoad&&"json"===t.type&&t.data.hasOwnProperty("resources"))){var e=t.data.resources,i=a(this.config,"audioConfig"),n=a(this.config,"audioXhrSettings"),r=s.create(this.loader,t.key,e,i,n);r&&(this.addToMultiFile(r),this.loader.addFile(r))}},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1];t.addToCache(),e.addToCache(),this.complete=!0}}});r.register("audioSprite",(function(t,e,i,s,n,r){var a,o=this.systems.game,h=o.config.audio,l=o.device.audio;if(h&&h.noAudio||!l.webAudio&&!l.audioData)return this;if(Array.isArray(t))for(var c=0;c{var s=i(56694),n=i(12117),r=i(98035),a=i(76846),o=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s,n){var a="bin";if(h(e)){var l=e;e=o(l,"key"),i=o(l,"url"),s=o(l,"xhrSettings"),a=o(l,"extension",a),n=o(l,"dataType",n)}var u={type:"binary",cache:t.cacheManager.binary,extension:a,responseType:"arraybuffer",key:e,url:i,xhrSettings:s,config:{dataType:n}};r.call(this,t,u)},onProcess:function(){this.state=n.FILE_PROCESSING;var t=this.config.dataType;this.data=t?new t(this.xhrLoader.response):this.xhrLoader.response,this.onProcessComplete()}});a.register("binary",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(76846),r=i(72632),a=i(42927),o=i(42911),h=i(45176),l=i(31476),u=i(15297),c=new s({Extends:h,initialize:function(t,e,i,s,n,l){var c,d;if(o(e)){var f=e;e=r(f,"key"),c=new a(t,{key:e,url:r(f,"textureURL"),extension:r(f,"textureExtension","png"),normalMap:r(f,"normalMap"),xhrSettings:r(f,"textureXhrSettings")}),d=new u(t,{key:e,url:r(f,"fontDataURL"),extension:r(f,"fontDataExtension","xml"),xhrSettings:r(f,"fontDataXhrSettings")})}else c=new a(t,e,i,n),d=new u(t,e,s,l);c.linkFile?h.call(this,t,"bitmapfont",e,[c,d,c.linkFile]):h.call(this,t,"bitmapfont",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1];t.addToCache();var i=t.cache.get(t.key),s=l(e.data,t.cache.getFrame(t.key),0,0,i);this.loader.cacheManager.bitmapFont.add(t.key,{data:s,texture:t.key,frame:null}),this.complete=!0}}});n.register("bitmapFont",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var a=0;a{var s=i(56694),n=i(12117),r=i(98035),a=i(76846),o=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s){var n="css";if(h(e)){var a=e;e=o(a,"key"),i=o(a,"url"),s=o(a,"xhrSettings"),n=o(a,"extension",n)}var l={type:"script",cache:!1,extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,l)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=document.createElement("style"),this.data.defer=!1,this.data.innerHTML=this.xhrLoader.responseText,document.head.appendChild(this.data),this.onProcessComplete()}});a.register("css",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(73152),n=i(40612),r=i(56694),a=i(76846),o=i(72632),h=i(42927),l=i(42911),u=i(70806),c=i(67409),d=i(30657),f=i(80802),p=i(45176),v=i(24904),g=new r({Extends:p,initialize:function(t,e,i,s){if(i.multiAtlasURL){var r=new u(t,{key:e,url:i.multiAtlasURL,xhrSettings:s,config:i});p.call(this,t,"texture",e,[r])}else{var a=i.textureURL.substr(i.textureURL.length-3);i.type||(i.type="ktx"===a.toLowerCase()?"KTX":"PVR");var o=new n(t,{key:e,url:i.textureURL,extension:a,xhrSettings:s,config:i});if(i.atlasURL){var h=new u(t,{key:e,url:i.atlasURL,xhrSettings:s,config:i});p.call(this,t,"texture",e,[o,h])}else p.call(this,t,"texture",e,[o])}this.config=i},onFileComplete:function(t){if(-1!==this.files.indexOf(t)){if(this.pending--,!this.config.multiAtlasURL)return;if("json"===t.type&&t.data.hasOwnProperty("textures")){var e=t.data.textures,i=this.config,s=this.loader,r=s.baseURL,a=s.path,h=s.prefix,l=o(i,"multiBaseURL",this.baseURL),u=o(i,"multiPath",this.path),c=o(i,"prefix",this.prefix),d=o(i,"textureXhrSettings");l&&s.setBaseURL(l),u&&s.setPath(u),c&&s.setPrefix(c);for(var f=0;f{var s=i(56694),n=i(12117),r=i(98035),a=i(76846),o=i(72632),h=i(42911),l=i(31053),u=new s({Extends:r,initialize:function(t,e,i,s,n){var a="glsl";if(h(e)){var l=e;e=o(l,"key"),i=o(l,"url"),s=o(l,"shaderType","fragment"),n=o(l,"xhrSettings"),a=o(l,"extension",a)}else void 0===s&&(s="fragment");var u={type:"glsl",cache:t.cacheManager.shader,extension:a,responseType:"text",key:e,url:i,config:{shaderType:s},xhrSettings:n};r.call(this,t,u)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t=this.data.split("\n"),e=this.extractBlock(t,0);if(e)for(;e;){var i=this.getShaderName(e.header),s=this.getShaderType(e.header),n=this.getShaderUniforms(e.header),r=e.shader;if(this.cache.has(i)){var a=this.cache.get(i);"fragment"===s?a.fragmentSrc=r:a.vertexSrc=r,a.uniforms||(a.uniforms=n)}else"fragment"===s?this.cache.add(i,new l(i,r,"",n)):this.cache.add(i,new l(i,"",r,n));e=this.extractBlock(t,e.offset)}else"fragment"===this.config.shaderType?this.cache.add(this.key,new l(this.key,this.data)):this.cache.add(this.key,new l(this.key,"",this.data))},getShaderName:function(t){for(var e=0;e{var s=i(56694),n=i(683),r=i(98035),a=i(72632),o=i(30750),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s){if(h(e)){var n=e;e=a(n,"key"),s=a(n,"config",s)}var o={type:"audio",cache:t.cacheManager.audio,extension:i.type,key:e,url:i.url,config:s};r.call(this,t,o),this.locked="ontouchstart"in window,this.loaded=!1,this.filesLoaded=0,this.filesTotal=0},onLoad:function(){this.loaded||(this.loaded=!0,this.loader.nextFile(this,!0))},onError:function(){for(var t=0;t{var s=i(56694),n=i(12117),r=i(98035),a=i(76846),o=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s){var n="html";if(h(e)){var a=e;e=o(a,"key"),i=o(a,"url"),s=o(a,"xhrSettings"),n=o(a,"extension",n)}var l={type:"text",cache:t.cacheManager.html,extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,l)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});a.register("html",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(12117),r=i(98035),a=i(76846),o=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s,n,a){void 0===s&&(s=512),void 0===n&&(n=512);var l="html";if(h(e)){var u=e;e=o(u,"key"),i=o(u,"url"),a=o(u,"xhrSettings"),l=o(u,"extension",l),s=o(u,"width",s),n=o(u,"height",n)}var c={type:"html",cache:t.textureManager,extension:l,responseType:"text",key:e,url:i,xhrSettings:a,config:{width:s,height:n}};r.call(this,t,c)},onProcess:function(){this.state=n.FILE_PROCESSING;var t=this.config.width,e=this.config.height,i=[];i.push(''),i.push(''),i.push(''),i.push(this.xhrLoader.responseText),i.push(""),i.push(""),i.push("");var s=[i.join("\n")],a=this;try{var o=new window.Blob(s,{type:"image/svg+xml;charset=utf-8"})}catch(t){return a.state=n.FILE_ERRORED,void a.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){r.revokeObjectURL(a.data),a.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(a.data),a.onProcessError()},r.createObjectURL(this.data,o,"image/svg+xml")},addToCache:function(){this.cache.addImage(this.key,this.data)}});a.register("htmlTexture",(function(t,e,i,s,n){if(Array.isArray(t))for(var r=0;r{var s=i(56694),n=i(12117),r=i(98035),a=i(76846),o=i(72632),h=i(42911),l=i(30750),u=new s({Extends:r,initialize:function t(e,i,s,n,a){var l,u="png";if(h(i)){var c=i;i=o(c,"key"),s=o(c,"url"),l=o(c,"normalMap"),n=o(c,"xhrSettings"),u=o(c,"extension",u),a=o(c,"frameConfig")}Array.isArray(s)&&(l=s[1],s=s[0]);var d={type:"image",cache:e.textureManager,extension:u,responseType:"blob",key:i,url:s,xhrSettings:n,config:a};if(r.call(this,e,d),l){var f=new t(e,this.key,l,n,a);f.type="normalMap",this.setLink(f),e.addFile(f)}this.useImageElementLoad="HTMLImageElement"===e.imageLoadType,this.useImageElementLoad&&(this.load=this.loadImage,this.onProcess=this.onProcessImage)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){r.revokeObjectURL(t.data),t.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(t.data),t.onProcessError()},r.createObjectURL(this.data,this.xhrLoader.response,"image/png")},onProcessImage:function(){var t=this.state;this.state=n.FILE_PROCESSING,t===n.FILE_LOADED?this.onProcessComplete():this.onProcessError()},loadImage:function(){if(this.state=n.FILE_LOADING,this.src=l(this,this.loader.baseURL),0===this.src.indexOf("data:"))console.warn("Local data URIs are not supported: "+this.key);else{this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){t.state=n.FILE_LOADED,t.loader.nextFile(t,!0)},this.data.onerror=function(){t.loader.nextFile(t,!1)},this.data.src=this.src}},addToCache:function(){var t=this.linkFile;t&&t.state>=n.FILE_COMPLETE?"image"===this.type?this.cache.addImage(this.key,this.data,t.data):this.cache.addImage(t.key,t.data,this.data):t||this.cache.addImage(this.key,this.data)}});a.register("image",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(12117),r=i(98035),a=i(76846),o=i(72632),h=i(10850),l=i(42911),u=new s({Extends:r,initialize:function(t,e,i,s,a){var u="json";if(l(e)){var c=e;e=o(c,"key"),i=o(c,"url"),s=o(c,"xhrSettings"),u=o(c,"extension",u),a=o(c,"dataKey",a)}var d={type:"json",cache:t.cacheManager.json,extension:u,responseType:"text",key:e,url:i,xhrSettings:s,config:a};r.call(this,t,d),l(i)&&(this.data=a?h(i,a):i,this.state=n.FILE_POPULATED)},onProcess:function(){if(this.state!==n.FILE_POPULATED){this.state=n.FILE_PROCESSING;try{var t=JSON.parse(this.xhrLoader.responseText)}catch(t){throw this.onProcessError(),t}var e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});a.register("json",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(76846),r=i(72632),a=i(42927),o=i(42911),h=i(70806),l=i(45176),u=new s({Extends:l,initialize:function(t,e,i,s,n,a,u){if(o(e)){var c=e;e=r(c,"key"),i=r(c,"url",!1)?r(c,"url"):r(c,"atlasURL"),a=r(c,"xhrSettings"),s=r(c,"path"),n=r(c,"baseURL"),u=r(c,"textureXhrSettings")}var d=new h(t,e,i,a);l.call(this,t,"multiatlas",e,[d]),this.config.path=s,this.config.baseURL=n,this.config.textureXhrSettings=u},onFileComplete:function(t){if(-1!==this.files.indexOf(t)&&(this.pending--,"json"===t.type&&t.data.hasOwnProperty("textures"))){var e=t.data.textures,i=this.config,s=this.loader,n=s.baseURL,o=s.path,h=s.prefix,l=r(i,"baseURL",this.baseURL),u=r(i,"path",this.path),c=r(i,"prefix",this.prefix),d=r(i,"textureXhrSettings");s.setBaseURL(l),s.setPath(u),s.setPrefix(c);for(var f=0;f{var s=i(56694),n=i(76846),r=i(72632),a=i(42911),o=i(45176),h=i(55188),l=new s({Extends:o,initialize:function(t,e,i,s){var n="js",l=[];if(a(e)){var u=e;e=r(u,"key"),i=r(u,"url"),s=r(u,"xhrSettings"),n=r(u,"extension",n)}Array.isArray(i)||(i=[i]);for(var c=0;c{var s=i(56694),n=i(76846),r=i(72632),a=i(42911),o=i(45176),h=i(27291),l=i(76799),u=i(86897),c=new s({Extends:o,initialize:function(t,e,i,s,n,h){var l,c,d=t.cacheManager.obj;if(a(e)){var f=e;e=r(f,"key"),l=new u(t,{key:e,type:"obj",cache:d,url:r(f,"url"),extension:r(f,"extension","obj"),xhrSettings:r(f,"xhrSettings"),config:{flipUV:r(f,"flipUV",n)}}),(s=r(f,"matURL"))&&(c=new u(t,{key:e,type:"mat",cache:d,url:s,extension:r(f,"matExtension","mat"),xhrSettings:r(f,"xhrSettings")}))}else l=new u(t,{key:e,url:i,type:"obj",cache:d,extension:"obj",xhrSettings:h,config:{flipUV:n}}),s&&(c=new u(t,{key:e,url:s,type:"mat",cache:d,extension:"mat",xhrSettings:h}));o.call(this,t,"obj",e,[l,c])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=h(t.data,t.config.flipUV);e&&(i.materials=l(e.data)),t.cache.add(t.key,i),this.complete=!0}}});n.register("obj",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var a=0;a{var s=i(56694),n=i(12117),r=i(76846),a=i(70806),o=new s({Extends:a,initialize:function(t,e,i,s,n){a.call(this,t,e,i,s,n),this.type="packfile"},onProcess:function(){this.state!==n.FILE_POPULATED&&(this.state=n.FILE_PROCESSING,this.data=JSON.parse(this.xhrLoader.responseText)),this.loader.addPack(this.data,this.config),this.onProcessComplete()}});r.register("pack",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(12117),r=i(98035),a=i(76846),o=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s,a,l){var u="js";if(h(e)){var c=e;e=o(c,"key"),i=o(c,"url"),l=o(c,"xhrSettings"),u=o(c,"extension",u),s=o(c,"start"),a=o(c,"mapping")}var d={type:"plugin",cache:!1,extension:u,responseType:"text",key:e,url:i,xhrSettings:l,config:{start:s,mapping:a}};r.call(this,t,d),"function"==typeof i&&(this.data=i,this.state=n.FILE_POPULATED)},onProcess:function(){var t=this.loader.systems.plugins,e=this.config,i=o(e,"start",!1),s=o(e,"mapping",null);if(this.state===n.FILE_POPULATED)t.install(this.key,this.data,i,s);else{this.state=n.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data);var r=t.install(this.key,window[this.key],i,s);(i||s)&&(this.loader.systems[s]=r,this.loader.scene[s]=r)}this.onProcessComplete()}});a.register("plugin",(function(t,e,i,s,n){if(Array.isArray(t))for(var r=0;r{var s=i(56694),n=i(12117),r=i(98035),a=i(76846),o=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s,n){var a="svg";if(h(e)){var l=e;e=o(l,"key"),i=o(l,"url"),s=o(l,"svgConfig",{}),n=o(l,"xhrSettings"),a=o(l,"extension",a)}var u={type:"svg",cache:t.textureManager,extension:a,responseType:"text",key:e,url:i,xhrSettings:n,config:{width:o(s,"width"),height:o(s,"height"),scale:o(s,"scale")}};r.call(this,t,u)},onProcess:function(){this.state=n.FILE_PROCESSING;var t=this.xhrLoader.responseText,e=[t],i=this.config.width,s=this.config.height,a=this.config.scale;t:if(i&&s||a){var o=(new DOMParser).parseFromString(t,"text/xml").getElementsByTagName("svg")[0],h=o.hasAttribute("viewBox"),l=parseFloat(o.getAttribute("width")),u=parseFloat(o.getAttribute("height"));if(!h&&l&&u)o.setAttribute("viewBox","0 0 "+l+" "+u);else if(h&&!l&&!u){var c=o.getAttribute("viewBox").split(/\s+|,/);l=c[2],u=c[3]}if(a){if(!l||!u)break t;i=l*a,s=u*a}o.setAttribute("width",i.toString()+"px"),o.setAttribute("height",s.toString()+"px"),e=[(new XMLSerializer).serializeToString(o)]}try{var d=new window.Blob(e,{type:"image/svg+xml;charset=utf-8"})}catch(t){return void this.onProcessError()}this.data=new Image,this.data.crossOrigin=this.crossOrigin;var f=this,p=!1;this.data.onload=function(){p||r.revokeObjectURL(f.data),f.onProcessComplete()},this.data.onerror=function(){p?f.onProcessError():(p=!0,r.revokeObjectURL(f.data),f.data.src="data:image/svg+xml,"+encodeURIComponent(e.join("")))},r.createObjectURL(this.data,d,"image/svg+xml")},addToCache:function(){this.cache.addImage(this.key,this.data)}});a.register("svg",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(12117),r=i(98035),a=i(76846),o=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s){var n="js";if(h(e)){var a=e;e=o(a,"key"),i=o(a,"url"),s=o(a,"xhrSettings"),n=o(a,"extension",n)}var l={type:"text",extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,l)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t=this.data.concat("(function(){\nreturn new "+this.key+"();\n}).call(this);"),e=eval;this.loader.sceneManager.add(this.key,e(t)),this.complete=!0}});a.register("sceneFile",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(12117),r=i(98035),a=i(76846),o=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s,a,l){var u="js";if(h(e)){var c=e;e=o(c,"key"),i=o(c,"url"),l=o(c,"xhrSettings"),u=o(c,"extension",u),s=o(c,"systemKey"),a=o(c,"sceneKey")}var d={type:"scenePlugin",cache:!1,extension:u,responseType:"text",key:e,url:i,xhrSettings:l,config:{systemKey:s,sceneKey:a}};r.call(this,t,d),"function"==typeof i&&(this.data=i,this.state=n.FILE_POPULATED)},onProcess:function(){var t=this.loader.systems.plugins,e=this.config,i=this.key,s=o(e,"systemKey",i),r=o(e,"sceneKey",i);this.state===n.FILE_POPULATED?t.installScenePlugin(s,this.data,r,this.loader.scene,!0):(this.state=n.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data),t.installScenePlugin(s,window[this.key],r,this.loader.scene,!0)),this.onProcessComplete()}});a.register("scenePlugin",(function(t,e,i,s,n){if(Array.isArray(t))for(var r=0;r{var s=i(56694),n=i(12117),r=i(98035),a=i(76846),o=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s,n){var a="js";if(h(e)){var l=e;e=o(l,"key"),i=o(l,"url"),s=o(l,"type","script"),n=o(l,"xhrSettings"),a=o(l,"extension",a)}else void 0===s&&(s="script");var u={type:s,cache:!1,extension:a,responseType:"text",key:e,url:i,xhrSettings:n};r.call(this,t,u)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data),this.onProcessComplete()}});a.register("script",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(76846),r=i(42927),a=new s({Extends:r,initialize:function(t,e,i,s,n){r.call(this,t,e,i,n,s),this.type="spritesheet"},addToCache:function(){this.cache.addSpriteSheet(this.key,this.data,this.config)}});n.register("spritesheet",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(12117),r=i(98035),a=i(76846),o=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s){var n="text",a="txt",l=t.cacheManager.text;if(h(e)){var u=e;e=o(u,"key"),i=o(u,"url"),s=o(u,"xhrSettings"),a=o(u,"extension",a),n=o(u,"type",n),l=o(u,"cache",l)}var c={type:n,cache:l,extension:a,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,c)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});a.register("text",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(12117),r=i(98035),a=i(76846),o=i(72632),h=i(42911),l=i(93560),u=new s({Extends:r,initialize:function(t,e,i,s){var n="csv";if(h(e)){var a=e;e=o(a,"key"),i=o(a,"url"),s=o(a,"xhrSettings"),n=o(a,"extension",n)}var u={type:"tilemapCSV",cache:t.cacheManager.tilemap,extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,u),this.tilemapFormat=l.CSV},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t={format:this.tilemapFormat,data:this.data};this.cache.add(this.key,t)}});a.register("tilemapCSV",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(76846),r=i(70806),a=i(93560),o=new s({Extends:r,initialize:function(t,e,i,s){r.call(this,t,e,i,s),this.type="tilemapJSON",this.cache=t.cacheManager.tilemap},addToCache:function(){var t={format:a.WELTMEISTER,data:this.data};this.cache.add(this.key,t)}});n.register("tilemapImpact",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(76846),r=i(70806),a=i(93560),o=new s({Extends:r,initialize:function(t,e,i,s){r.call(this,t,e,i,s),this.type="tilemapJSON",this.cache=t.cacheManager.tilemap},addToCache:function(){var t={format:a.TILED_JSON,data:this.data};this.cache.add(this.key,t)}});n.register("tilemapTiledJSON",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(76846),r=i(72632),a=i(42927),o=i(42911),h=i(45176),l=i(86897),u=new s({Extends:h,initialize:function(t,e,i,s,n,u){var c,d;if(o(e)){var f=e;e=r(f,"key"),c=new a(t,{key:e,url:r(f,"textureURL"),extension:r(f,"textureExtension","png"),normalMap:r(f,"normalMap"),xhrSettings:r(f,"textureXhrSettings")}),d=new l(t,{key:e,url:r(f,"atlasURL"),extension:r(f,"atlasExtension","txt"),xhrSettings:r(f,"atlasXhrSettings")})}else c=new a(t,e,i,n),d=new l(t,e,s,u);c.linkFile?h.call(this,t,"unityatlas",e,[c,d,c.linkFile]):h.call(this,t,"unityatlas",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addUnityAtlas(t.key,t.data,e.data,i),this.complete=!0}}});n.register("unityAtlas",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var a=0;a{var s=i(56694),n=i(12117),r=i(98035),a=i(76846),o=i(30750),h=i(72632),l=i(42911),u=new s({Extends:r,initialize:function(t,e,i,s,n,a,o){void 0===s&&(s="loadeddata"),void 0===n&&(n=!1),void 0===a&&(a=!1),"loadeddata"!==s&&"canplay"!==s&&"canplaythrough"!==s&&(s="loadeddata");var h={type:"video",cache:t.cacheManager.video,extension:i.type,responseType:"blob",key:e,url:i.url,xhrSettings:o,config:{loadEvent:s,asBlob:n,noAudio:a}};this.onLoadCallback=this.onVideoLoadHandler.bind(this),this.onErrorCallback=this.onVideoErrorHandler.bind(this),r.call(this,t,h)},onProcess:function(){if(this.state=n.FILE_PROCESSING,this.config.asBlob){var t=this.createVideoElement();this.data=t;var e=this;this.data.onloadeddata=function(){e.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(e.data),e.onProcessError()},r.createObjectURL(t,this.xhrLoader.response,""),t.load()}else this.onProcessComplete()},createVideoElement:function(){var t=document.createElement("video");return t.controls=!1,t.crossOrigin=this.loader.crossOrigin,this.config.noAudio&&(t.muted=!0,t.defaultMuted=!0,t.setAttribute("autoplay","autoplay")),t.setAttribute("playsinline","playsinline"),t.setAttribute("preload","auto"),t},onVideoLoadHandler:function(t){var e=t.target;e.removeEventListener(this.config.loadEvent,this.onLoadCallback,!0),e.removeEventListener("error",this.onErrorCallback,!0),this.data=e,this.resetXHR(),this.loader.nextFile(this,!0)},onVideoErrorHandler:function(t){var e=t.target;e&&(e.removeEventListener(this.config.loadEvent,this.onLoadCallback,!0),e.removeEventListener("error",this.onErrorCallback,!0)),this.resetXHR(),this.loader.nextFile(this,!1)},load:function(){var t=this.config.loadEvent;if(this.config.asBlob)r.prototype.load.call(this);else{this.percentComplete=0;var e=this.createVideoElement();e.addEventListener(t,this.onLoadCallback,!0),e.addEventListener("error",this.onErrorCallback,!0),e.src=o(this,this.loader.baseURL),e.load()}}});u.create=function(t,e,i,s,n,r,a){var o=t.systems.game;l(e)&&(i=h(e,"url",[]),s=h(e,"loadEvent","loadeddata"),n=h(e,"asBlob",!1),r=h(e,"noAudio",!1),a=h(e,"xhrSettings"),e=h(e,"key"));var c=u.getVideoURL(o,i);if(c)return new u(t,e,c,s,n,r,a)},u.getVideoURL=function(t,e){Array.isArray(e)||(e=[e]);for(var i=0;i{var s=i(56694),n=i(12117),r=i(98035),a=i(76846),o=i(72632),h=i(42911),l=i(89200),u=new s({Extends:r,initialize:function(t,e,i,s){var n="xml";if(h(e)){var a=e;e=o(a,"key"),i=o(a,"url"),s=o(a,"xhrSettings"),n=o(a,"extension",n)}var l={type:"xml",cache:t.cacheManager.xml,extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,l)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=l(this.xhrLoader.responseText),this.data?this.onProcessComplete():this.onProcessError()}});a.register("xml",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{t.exports={AnimationJSONFile:i(46468),AsepriteFile:i(31648),AtlasJSONFile:i(73152),AtlasXMLFile:i(24616),AudioFile:i(67448),AudioSpriteFile:i(66109),BinaryFile:i(40612),BitmapFontFile:i(54565),CompressedTextureFile:i(47375),CSSFile:i(99898),GLSLFile:i(46568),HTML5AudioFile:i(30929),HTMLFile:i(77459),HTMLTextureFile:i(9755),ImageFile:i(42927),JSONFile:i(70806),MultiAtlasFile:i(80802),MultiScriptFile:i(39034),OBJFile:i(85527),PackFile:i(3616),PluginFile:i(12217),SceneFile:i(95171),ScenePluginFile:i(82458),ScriptFile:i(55188),SpriteSheetFile:i(33536),SVGFile:i(4474),TextFile:i(86897),TilemapCSVFile:i(58673),TilemapImpactFile:i(98896),TilemapJSONFile:i(50563),UnityAtlasFile:i(82857),VideoFile:i(22833),XMLFile:i(15297)}},95695:(t,e,i)=>{var s=i(12117),n=i(98611),r={Events:i(683),FileTypes:i(34034),File:i(98035),FileTypesManager:i(76846),GetURL:i(30750),LoaderPlugin:i(67285),MergeXHRSettings:i(43531),MultiFile:i(45176),XHRLoader:i(88490),XHRSettings:i(33868)};r=n(!1,r,s),t.exports=r},26042:t=>{t.exports=function(t){for(var e=0,i=0;i{var s=i(8034);t.exports=function(t,e){return s(t)/s(e)/s(t-e)}},17489:t=>{t.exports=function(t,e){return Math.floor(Math.random()*(e-t+1)+t)}},14976:t=>{t.exports=function(t,e,i,s,n){var r=.5*(s-e),a=.5*(n-i),o=t*t;return(2*i-2*s+r+a)*(t*o)+(-3*i+3*s-2*r-a)*o+r*t+i}},89129:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.ceil(t*s)/s}},82897:t=>{t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},75606:(t,e,i)=>{var s=i(83392);t.exports=function(t){return t*s.DEG_TO_RAD}},767:t=>{t.exports=function(t,e){return Math.abs(t-e)}},9849:(t,e,i)=>{var s=i(82897),n=i(56694),r=i(16650),a=i(72283),o=new r,h=new n({initialize:function t(e,i,s,n){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=t.DefaultOrder),this._x=e,this._y=i,this._z=s,this._order=n,this.onChangeCallback=a},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback(this)}},set:function(t,e,i,s){return void 0===s&&(s=this._order),this._x=t,this._y=e,this._z=i,this._order=s,this.onChangeCallback(this),this},copy:function(t){return this.set(t.x,t.y,t.z,t.order)},setFromQuaternion:function(t,e,i){return void 0===e&&(e=this._order),void 0===i&&(i=!1),o.fromQuat(t),this.setFromRotationMatrix(o,e,i)},setFromRotationMatrix:function(t,e,i){void 0===e&&(e=this._order),void 0===i&&(i=!1);var n=t.val,r=n[0],a=n[4],o=n[8],h=n[1],l=n[5],u=n[9],c=n[2],d=n[6],f=n[10],p=0,v=0,g=0,m=.99999;switch(e){case"XYZ":v=Math.asin(s(o,-1,1)),Math.abs(o){t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},61616:t=>{t.exports=function(t,e){return Math.random()*(e-t)+t}},60679:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.floor(t*s)/s}},91806:(t,e,i)=>{var s=i(82897);t.exports=function(t,e,i){return(i-e)*(t=s(t,0,1))+e}},79366:t=>{t.exports=function(t,e){return t/e/1e3}},43776:t=>{t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},58442:t=>{t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},42798:t=>{t.exports=function(t,e,i){return(e-t)*i+t}},61072:t=>{t.exports=function(t,e,i){return void 0===i&&(i=0),t.clone().lerp(e,i)}},5341:(t,e,i)=>{var s=new(i(56694))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new s(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=s,this},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=l*r-a*h,c=-l*n+a*o,d=h*n-r*o,f=e*u+i*c+s*d;return f?(f=1/f,t[0]=u*f,t[1]=(-l*i+s*h)*f,t[2]=(a*i-s*r)*f,t[3]=c*f,t[4]=(l*e-s*o)*f,t[5]=(-a*e+s*n)*f,t[6]=d*f,t[7]=(-h*e+i*o)*f,t[8]=(r*e-i*n)*f,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return t[0]=r*l-a*h,t[1]=s*h-i*l,t[2]=i*a-s*r,t[3]=a*o-n*l,t[4]=e*l-s*o,t[5]=s*n-e*a,t[6]=n*h-r*o,t[7]=i*o-e*h,t[8]=e*r-i*n,this},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return e*(l*r-a*h)+i*(-l*n+a*o)+s*(h*n-r*o)},multiply:function(t){var e=this.val,i=e[0],s=e[1],n=e[2],r=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],c=t.val,d=c[0],f=c[1],p=c[2],v=c[3],g=c[4],m=c[5],y=c[6],x=c[7],T=c[8];return e[0]=d*i+f*r+p*h,e[1]=d*s+f*a+p*l,e[2]=d*n+f*o+p*u,e[3]=v*i+g*r+m*h,e[4]=v*s+g*a+m*l,e[5]=v*n+g*o+m*u,e[6]=y*i+x*r+T*h,e[7]=y*s+x*a+T*l,e[8]=y*n+x*o+T*u,this},translate:function(t){var e=this.val,i=t.x,s=t.y;return e[6]=i*e[0]+s*e[3]+e[6],e[7]=i*e[1]+s*e[4]+e[7],e[8]=i*e[2]+s*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],s=e[1],n=e[2],r=e[3],a=e[4],o=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*r,e[1]=l*s+h*a,e[2]=l*n+h*o,e[3]=l*r-h*i,e[4]=l*a-h*s,e[5]=l*o-h*n,this},scale:function(t){var e=this.val,i=t.x,s=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=s*e[3],e[4]=s*e[4],e[5]=s*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,s=t.z,n=t.w,r=e+e,a=i+i,o=s+s,h=e*r,l=e*a,u=e*o,c=i*a,d=i*o,f=s*o,p=n*r,v=n*a,g=n*o,m=this.val;return m[0]=1-(c+f),m[3]=l+g,m[6]=u-v,m[1]=l-g,m[4]=1-(h+f),m[7]=d+p,m[2]=u+v,m[5]=d-p,m[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,i=this.val,s=e[0],n=e[1],r=e[2],a=e[3],o=e[4],h=e[5],l=e[6],u=e[7],c=e[8],d=e[9],f=e[10],p=e[11],v=e[12],g=e[13],m=e[14],y=e[15],x=s*h-n*o,T=s*l-r*o,w=s*u-a*o,E=n*l-r*h,S=n*u-a*h,b=r*u-a*l,A=c*g-d*v,_=c*m-f*v,C=c*y-p*v,R=d*m-f*g,M=d*y-p*g,P=f*y-p*m,O=x*P-T*M+w*R+E*C-S*_+b*A;return O?(O=1/O,i[0]=(h*P-l*M+u*R)*O,i[1]=(l*C-o*P-u*_)*O,i[2]=(o*M-h*C+u*A)*O,i[3]=(r*M-n*P-a*R)*O,i[4]=(s*P-r*C+a*_)*O,i[5]=(n*C-s*M-a*A)*O,i[6]=(g*b-m*S+y*E)*O,i[7]=(m*w-v*b-y*T)*O,i[8]=(v*S-g*w+y*x)*O,this):null}});t.exports=s},16650:(t,e,i)=>{var s=i(56694),n=i(70015),r=1e-6,a=new s({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new a(this)},set:function(t){return this.copy(t)},setValues:function(t,e,i,s,n,r,a,o,h,l,u,c,d,f,p,v){var g=this.val;return g[0]=t,g[1]=e,g[2]=i,g[3]=s,g[4]=n,g[5]=r,g[6]=a,g[7]=o,g[8]=h,g[9]=l,g[10]=u,g[11]=c,g[12]=d,g[13]=f,g[14]=p,g[15]=v,this},copy:function(t){var e=t.val;return this.setValues(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},fromArray:function(t){return this.setValues(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(t,e,i){var s=o.fromQuat(i).val,n=e.x,r=e.y,a=e.z;return this.setValues(s[0]*n,s[1]*n,s[2]*n,0,s[4]*r,s[5]*r,s[6]*r,0,s[8]*a,s[9]*a,s[10]*a,0,t.x,t.y,t.z,1)},xyz:function(t,e,i){this.identity();var s=this.val;return s[12]=t,s[13]=e,s[14]=i,this},scaling:function(t,e,i){this.zero();var s=this.val;return s[0]=t,s[5]=e,s[10]=i,s[15]=1,this},identity:function(){return this.setValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[3],n=t[6],r=t[7],a=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=n,t[11]=t[14],t[12]=s,t[13]=r,t[14]=a,this},getInverse:function(t){return this.copy(t),this.invert()},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],v=t[14],g=t[15],m=e*a-i*r,y=e*o-s*r,x=e*h-n*r,T=i*o-s*a,w=i*h-n*a,E=s*h-n*o,S=l*p-u*f,b=l*v-c*f,A=l*g-d*f,_=u*v-c*p,C=u*g-d*p,R=c*g-d*v,M=m*R-y*C+x*_+T*A-w*b+E*S;return M?(M=1/M,this.setValues((a*R-o*C+h*_)*M,(s*C-i*R-n*_)*M,(p*E-v*w+g*T)*M,(c*w-u*E-d*T)*M,(o*A-r*R-h*b)*M,(e*R-s*A+n*b)*M,(v*x-f*E-g*y)*M,(l*E-c*x+d*y)*M,(r*C-a*A+h*S)*M,(i*A-e*C-n*S)*M,(f*w-p*x+g*m)*M,(u*x-l*w-d*m)*M,(a*b-r*_-o*S)*M,(e*_-i*b+s*S)*M,(p*y-f*T-v*m)*M,(l*T-u*y+c*m)*M)):this},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],v=t[14],g=t[15];return this.setValues(a*(c*g-d*v)-u*(o*g-h*v)+p*(o*d-h*c),-(i*(c*g-d*v)-u*(s*g-n*v)+p*(s*d-n*c)),i*(o*g-h*v)-a*(s*g-n*v)+p*(s*h-n*o),-(i*(o*d-h*c)-a*(s*d-n*c)+u*(s*h-n*o)),-(r*(c*g-d*v)-l*(o*g-h*v)+f*(o*d-h*c)),e*(c*g-d*v)-l*(s*g-n*v)+f*(s*d-n*c),-(e*(o*g-h*v)-r*(s*g-n*v)+f*(s*h-n*o)),e*(o*d-h*c)-r*(s*d-n*c)+l*(s*h-n*o),r*(u*g-d*p)-l*(a*g-h*p)+f*(a*d-h*u),-(e*(u*g-d*p)-l*(i*g-n*p)+f*(i*d-n*u)),e*(a*g-h*p)-r*(i*g-n*p)+f*(i*h-n*a),-(e*(a*d-h*u)-r*(i*d-n*u)+l*(i*h-n*a)),-(r*(u*v-c*p)-l*(a*v-o*p)+f*(a*c-o*u)),e*(u*v-c*p)-l*(i*v-s*p)+f*(i*c-s*u),-(e*(a*v-o*p)-r*(i*v-s*p)+f*(i*o-s*a)),e*(a*c-o*u)-r*(i*c-s*u)+l*(i*o-s*a))},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],v=t[14],g=t[15];return(e*a-i*r)*(c*g-d*v)-(e*o-s*r)*(u*g-d*p)+(e*h-n*r)*(u*v-c*p)+(i*o-s*a)*(l*g-d*f)-(i*h-n*a)*(l*v-c*f)+(s*h-n*o)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],s=e[1],n=e[2],r=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],p=e[12],v=e[13],g=e[14],m=e[15],y=t.val,x=y[0],T=y[1],w=y[2],E=y[3];return e[0]=x*i+T*a+w*u+E*p,e[1]=x*s+T*o+w*c+E*v,e[2]=x*n+T*h+w*d+E*g,e[3]=x*r+T*l+w*f+E*m,x=y[4],T=y[5],w=y[6],E=y[7],e[4]=x*i+T*a+w*u+E*p,e[5]=x*s+T*o+w*c+E*v,e[6]=x*n+T*h+w*d+E*g,e[7]=x*r+T*l+w*f+E*m,x=y[8],T=y[9],w=y[10],E=y[11],e[8]=x*i+T*a+w*u+E*p,e[9]=x*s+T*o+w*c+E*v,e[10]=x*n+T*h+w*d+E*g,e[11]=x*r+T*l+w*f+E*m,x=y[12],T=y[13],w=y[14],E=y[15],e[12]=x*i+T*a+w*u+E*p,e[13]=x*s+T*o+w*c+E*v,e[14]=x*n+T*h+w*d+E*g,e[15]=x*r+T*l+w*f+E*m,this},multiplyLocal:function(t){var e=this.val,i=t.val;return this.setValues(e[0]*i[0]+e[1]*i[4]+e[2]*i[8]+e[3]*i[12],e[0]*i[1]+e[1]*i[5]+e[2]*i[9]+e[3]*i[13],e[0]*i[2]+e[1]*i[6]+e[2]*i[10]+e[3]*i[14],e[0]*i[3]+e[1]*i[7]+e[2]*i[11]+e[3]*i[15],e[4]*i[0]+e[5]*i[4]+e[6]*i[8]+e[7]*i[12],e[4]*i[1]+e[5]*i[5]+e[6]*i[9]+e[7]*i[13],e[4]*i[2]+e[5]*i[6]+e[6]*i[10]+e[7]*i[14],e[4]*i[3]+e[5]*i[7]+e[6]*i[11]+e[7]*i[15],e[8]*i[0]+e[9]*i[4]+e[10]*i[8]+e[11]*i[12],e[8]*i[1]+e[9]*i[5]+e[10]*i[9]+e[11]*i[13],e[8]*i[2]+e[9]*i[6]+e[10]*i[10]+e[11]*i[14],e[8]*i[3]+e[9]*i[7]+e[10]*i[11]+e[11]*i[15],e[12]*i[0]+e[13]*i[4]+e[14]*i[8]+e[15]*i[12],e[12]*i[1]+e[13]*i[5]+e[14]*i[9]+e[15]*i[13],e[12]*i[2]+e[13]*i[6]+e[14]*i[10]+e[15]*i[14],e[12]*i[3]+e[13]*i[7]+e[14]*i[11]+e[15]*i[15])},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.val,s=e.val,n=i[0],r=i[4],a=i[8],o=i[12],h=i[1],l=i[5],u=i[9],c=i[13],d=i[2],f=i[6],p=i[10],v=i[14],g=i[3],m=i[7],y=i[11],x=i[15],T=s[0],w=s[4],E=s[8],S=s[12],b=s[1],A=s[5],_=s[9],C=s[13],R=s[2],M=s[6],P=s[10],O=s[14],L=s[3],F=s[7],D=s[11],k=s[15];return this.setValues(n*T+r*b+a*R+o*L,h*T+l*b+u*R+c*L,d*T+f*b+p*R+v*L,g*T+m*b+y*R+x*L,n*w+r*A+a*M+o*F,h*w+l*A+u*M+c*F,d*w+f*A+p*M+v*F,g*w+m*A+y*M+x*F,n*E+r*_+a*P+o*D,h*E+l*_+u*P+c*D,d*E+f*_+p*P+v*D,g*E+m*_+y*P+x*D,n*S+r*C+a*O+o*k,h*S+l*C+u*O+c*k,d*S+f*C+p*O+v*k,g*S+m*C+y*O+x*k)},translate:function(t){return this.translateXYZ(t.x,t.y,t.z)},translateXYZ:function(t,e,i){var s=this.val;return s[12]=s[0]*t+s[4]*e+s[8]*i+s[12],s[13]=s[1]*t+s[5]*e+s[9]*i+s[13],s[14]=s[2]*t+s[6]*e+s[10]*i+s[14],s[15]=s[3]*t+s[7]*e+s[11]*i+s[15],this},scale:function(t){return this.scaleXYZ(t.x,t.y,t.z)},scaleXYZ:function(t,e,i){var s=this.val;return s[0]=s[0]*t,s[1]=s[1]*t,s[2]=s[2]*t,s[3]=s[3]*t,s[4]=s[4]*e,s[5]=s[5]*e,s[6]=s[6]*e,s[7]=s[7]*e,s[8]=s[8]*i,s[9]=s[9]*i,s[10]=s[10]*i,s[11]=s[11]*i,this},makeRotationAxis:function(t,e){var i=Math.cos(e),s=Math.sin(e),n=1-i,r=t.x,a=t.y,o=t.z,h=n*r,l=n*a;return this.setValues(h*r+i,h*a-s*o,h*o+s*a,0,h*a+s*o,l*a+i,l*o-s*r,0,h*o-s*a,l*o+s*r,n*o*o+i,0,0,0,0,1)},rotate:function(t,e){var i=this.val,s=e.x,n=e.y,a=e.z,o=Math.sqrt(s*s+n*n+a*a);if(Math.abs(o){t.exports=function(t,e,i){return Math.min(t+e,i)}},37394:t=>{t.exports=function(t){var e=t.length;if(0===e)return 0;t.sort((function(t,e){return t-e}));var i=Math.floor(e/2);return e%2==0?(t[i]+t[i-1])/2:t[i]}},17259:t=>{t.exports=function(t,e,i){return Math.max(t-e,i)}},61820:t=>{t.exports=function(t,e,i,s){void 0===i&&(i=e+1);var n=(t-e)/(i-e);return n>1?void 0!==s?(n=(s-t)/(s-i))<0&&(n=0):n=1:n<0&&(n=0),n}},75003:(t,e,i)=>{var s=i(56694),n=i(5341),r=i(72283),a=i(70015),o=1e-6,h=new Int8Array([1,2,0]),l=new Float32Array([0,0,0]),u=new a(1,0,0),c=new a(0,1,0),d=new a,f=new n,p=new s({initialize:function(t,e,i,s){this.onChangeCallback=r,this.set(t,e,i,s)},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback(this)}},copy:function(t){return this.set(t)},set:function(t,e,i,s,n){return void 0===n&&(n=!0),"object"==typeof t?(this._x=t.x||0,this._y=t.y||0,this._z=t.z||0,this._w=t.w||0):(this._x=t||0,this._y=e||0,this._z=i||0,this._w=s||0),n&&this.onChangeCallback(this),this},add:function(t){return this._x+=t.x,this._y+=t.y,this._z+=t.z,this._w+=t.w,this.onChangeCallback(this),this},subtract:function(t){return this._x-=t.x,this._y-=t.y,this._z-=t.z,this._w-=t.w,this.onChangeCallback(this),this},scale:function(t){return this._x*=t,this._y*=t,this._z*=t,this._w*=t,this.onChangeCallback(this),this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,n=t*t+e*e+i*i+s*s;return n>0&&(n=1/Math.sqrt(n),this._x=t*n,this._y=e*n,this._z=i*n,this._w=s*n),this.onChangeCallback(this),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,n=this.z,r=this.w;return this.set(i+e*(t.x-i),s+e*(t.y-s),n+e*(t.z-n),r+e*(t.w-r))},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(d.copy(u).cross(t).length().999999?this.set(0,0,0,1):(d.copy(t).cross(e),this._x=d.x,this._y=d.y,this._z=d.z,this._w=1+i,this.normalize())},setAxes:function(t,e,i){var s=f.val;return s[0]=e.x,s[3]=e.y,s[6]=e.z,s[1]=i.x,s[4]=i.y,s[7]=i.z,s[2]=-t.x,s[5]=-t.y,s[8]=-t.z,this.fromMat3(f).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.set(i*t.x,i*t.y,i*t.z,Math.cos(e))},multiply:function(t){var e=this.x,i=this.y,s=this.z,n=this.w,r=t.x,a=t.y,o=t.z,h=t.w;return this.set(e*h+n*r+i*o-s*a,i*h+n*a+s*r-e*o,s*h+n*o+e*a-i*r,n*h-e*r-i*a-s*o)},slerp:function(t,e){var i=this.x,s=this.y,n=this.z,r=this.w,a=t.x,h=t.y,l=t.z,u=t.w,c=i*a+s*h+n*l+r*u;c<0&&(c=-c,a=-a,h=-h,l=-l,u=-u);var d=1-e,f=e;if(1-c>o){var p=Math.acos(c),v=Math.sin(p);d=Math.sin((1-e)*p)/v,f=Math.sin(e*p)/v}return this.set(d*i+f*a,d*s+f*h,d*n+f*l,d*r+f*u)},invert:function(){var t=this.x,e=this.y,i=this.z,s=this.w,n=t*t+e*e+i*i+s*s,r=n?1/n:0;return this.set(-t*r,-e*r,-i*r,s*r)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,n=this.w,r=Math.sin(t),a=Math.cos(t);return this.set(e*a+n*r,i*a+s*r,s*a-i*r,n*a-e*r)},rotateY:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,n=this.w,r=Math.sin(t),a=Math.cos(t);return this.set(e*a-s*r,i*a+n*r,s*a+e*r,n*a-i*r)},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,n=this.w,r=Math.sin(t),a=Math.cos(t);return this.set(e*a+i*r,i*a-e*r,s*a+n*r,n*a-s*r)},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},setFromEuler:function(t,e){var i=t.x/2,s=t.y/2,n=t.z/2,r=Math.cos(i),a=Math.cos(s),o=Math.cos(n),h=Math.sin(i),l=Math.sin(s),u=Math.sin(n);switch(t.order){case"XYZ":this.set(h*a*o+r*l*u,r*l*o-h*a*u,r*a*u+h*l*o,r*a*o-h*l*u,e);break;case"YXZ":this.set(h*a*o+r*l*u,r*l*o-h*a*u,r*a*u-h*l*o,r*a*o+h*l*u,e);break;case"ZXY":this.set(h*a*o-r*l*u,r*l*o+h*a*u,r*a*u+h*l*o,r*a*o-h*l*u,e);break;case"ZYX":this.set(h*a*o-r*l*u,r*l*o+h*a*u,r*a*u-h*l*o,r*a*o+h*l*u,e);break;case"YZX":this.set(h*a*o+r*l*u,r*l*o+h*a*u,r*a*u-h*l*o,r*a*o-h*l*u,e);break;case"XZY":this.set(h*a*o-r*l*u,r*l*o-h*a*u,r*a*u+h*l*o,r*a*o+h*l*u,e)}return this},setFromRotationMatrix:function(t){var e,i=t.val,s=i[0],n=i[4],r=i[8],a=i[1],o=i[5],h=i[9],l=i[2],u=i[6],c=i[10],d=s+o+c;return d>0?(e=.5/Math.sqrt(d+1),this.set((u-h)*e,(r-l)*e,(a-n)*e,.25/e)):s>o&&s>c?(e=2*Math.sqrt(1+s-o-c),this.set(.25*e,(n+a)/e,(r+l)/e,(u-h)/e)):o>c?(e=2*Math.sqrt(1+o-s-c),this.set((n+a)/e,.25*e,(h+u)/e,(r-l)/e)):(e=2*Math.sqrt(1+c-s-o),this.set((r+l)/e,(h+u)/e,.25*e,(a-n)/e)),this},fromMat3:function(t){var e,i=t.val,s=i[0]+i[4]+i[8];if(s>0)e=Math.sqrt(s+1),this.w=.5*e,e=.5/e,this._x=(i[7]-i[5])*e,this._y=(i[2]-i[6])*e,this._z=(i[3]-i[1])*e;else{var n=0;i[4]>i[0]&&(n=1),i[8]>i[3*n+n]&&(n=2);var r=h[n],a=h[r];e=Math.sqrt(i[3*n+n]-i[3*r+r]-i[3*a+a]+1),l[n]=.5*e,e=.5/e,l[r]=(i[3*r+n]+i[3*n+r])*e,l[a]=(i[3*a+n]+i[3*n+a])*e,this._x=l[0],this._y=l[1],this._z=l[2],this._w=(i[3*a+r]-i[3*r+a])*e}return this.onChangeCallback(this),this}});t.exports=p},23701:(t,e,i)=>{var s=i(83392);t.exports=function(t){return t*s.RAD_TO_DEG}},16906:t=>{t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},52417:t=>{t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,s=2*Math.random()-1,n=Math.sqrt(1-s*s)*e;return t.x=Math.cos(i)*n,t.y=Math.sin(i)*n,t.z=s*e,t}},17915:t=>{t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},52257:t=>{t.exports=function(t,e){var i=t.x,s=t.y;return t.x=i*Math.cos(e)-s*Math.sin(e),t.y=i*Math.sin(e)+s*Math.cos(e),t}},2386:t=>{t.exports=function(t,e,i,s){var n=Math.cos(s),r=Math.sin(s),a=t.x-e,o=t.y-i;return t.x=a*n-o*r+e,t.y=a*r+o*n+i,t}},72395:t=>{t.exports=function(t,e,i,s,n){var r=s+Math.atan2(t.y-i,t.x-e);return t.x=e+n*Math.cos(r),t.y=i+n*Math.sin(r),t}},41061:t=>{t.exports=function(t,e,i,s,n){return t.x=e+n*Math.cos(s),t.y=i+n*Math.sin(s),t}},93709:(t,e,i)=>{var s=i(70015),n=i(16650),r=i(75003),a=new n,o=new r,h=new s;t.exports=function(t,e,i){return o.setAxisAngle(e,i),a.fromRotationTranslation(o,h.set(0,0,0)),t.transformMat4(a)}},67233:t=>{t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},64333:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.round(t*s)/s}},59533:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=1),void 0===i&&(i=1),void 0===s&&(s=1),s*=Math.PI/t;for(var n=[],r=[],a=0;a{t.exports=function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},87736:t=>{t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},55805:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n){void 0===n&&(n=new s);var r=0,a=0;return t>0&&t<=e*i&&(r=t>e-1?t-(a=Math.floor(t/e))*e:t),n.set(r,a)}},64462:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r,a,o,h){void 0===h&&(h=new s);var l=Math.sin(r),u=Math.cos(r),c=u*a,d=l*a,f=-l*o,p=u*o,v=1/(c*p+f*-d);return h.x=p*v*t+-f*v*e+(n*f-i*p)*v,h.y=c*v*e+-d*v*t+(-n*c+i*d)*v,h}},93736:(t,e,i)=>{var s=i(56694),n=i(88456),r=new s({initialize:function(t,e){this.x=0,this.y=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0):(void 0===e&&(e=t),this.x=t||0,this.y=e||0)},clone:function(){return new r(this.x,this.y)},copy:function(t){return this.x=t.x||0,this.y=t.y||0,this},setFromObject:function(t){return this.x=t.x||0,this.y=t.y||0,this},set:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setTo:function(t,e){return this.set(t,e)},setToPolar:function(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this},equals:function(t){return this.x===t.x&&this.y===t.y},fuzzyEquals:function(t,e){return n(this.x,t.x,e)&&n(this.y,t.y,e)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},setAngle:function(t){return this.setToPolar(t,this.length())},add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},length:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},setLength:function(t){return this.normalize().scale(t)},lengthSq:function(){var t=this.x,e=this.y;return t*t+e*e},normalize:function(){var t=this.x,e=this.y,i=t*t+e*e;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},normalizeLeftHand:function(){var t=this.x;return this.x=this.y,this.y=-1*t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this},transformMat3:function(t){var e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[3]*i+s[6],this.y=s[1]*e+s[4]*i+s[7],this},transformMat4:function(t){var e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[4]*i+s[12],this.y=s[1]*e+s[5]*i+s[13],this},reset:function(){return this.x=0,this.y=0,this},limit:function(t){var e=this.length();return e&&e>t&&this.scale(t/e),this},reflect:function(t){return t=t.clone().normalize(),this.subtract(t.scale(2*this.dot(t)))},mirror:function(t){return this.reflect(t).negate()},rotate:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e*this.x-i*this.y,i*this.x+e*this.y)},project:function(t){var e=this.dot(t)/t.dot(t);return this.copy(t).scale(e)}});r.ZERO=new r,r.RIGHT=new r(1,0),r.LEFT=new r(-1,0),r.UP=new r(0,-1),r.DOWN=new r(0,1),r.ONE=new r(1,1),t.exports=r},70015:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clone:function(){return new s(this.x,this.y,this.z)},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},crossVectors:function(t,e){var i=t.x,s=t.y,n=t.z,r=e.x,a=e.y,o=e.z;return this.x=s*o-n*a,this.y=n*r-i*o,this.z=i*a-s*r,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},setFromMatrixPosition:function(t){return this.fromArray(t.val,12)},setFromMatrixColumn:function(t,e){return this.fromArray(t.val,4*e)},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addScale:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return Math.sqrt(e*e+i*i+s*s)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return e*e+i*i+s*s},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,s=t*t+e*e+i*i;return s>0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,s=this.z,n=t.x,r=t.y,a=t.z;return this.x=i*a-s*r,this.y=s*n-e*a,this.z=e*r-i*n,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,n=this.z;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=n+e*(t.z-n),this},applyMatrix3:function(t){var e=this.x,i=this.y,s=this.z,n=t.val;return this.x=n[0]*e+n[3]*i+n[6]*s,this.y=n[1]*e+n[4]*i+n[7]*s,this.z=n[2]*e+n[5]*i+n[8]*s,this},applyMatrix4:function(t){var e=this.x,i=this.y,s=this.z,n=t.val,r=1/(n[3]*e+n[7]*i+n[11]*s+n[15]);return this.x=(n[0]*e+n[4]*i+n[8]*s+n[12])*r,this.y=(n[1]*e+n[5]*i+n[9]*s+n[13])*r,this.z=(n[2]*e+n[6]*i+n[10]*s+n[14])*r,this},transformMat3:function(t){var e=this.x,i=this.y,s=this.z,n=t.val;return this.x=e*n[0]+i*n[3]+s*n[6],this.y=e*n[1]+i*n[4]+s*n[7],this.z=e*n[2]+i*n[5]+s*n[8],this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,n=t.val;return this.x=n[0]*e+n[4]*i+n[8]*s+n[12],this.y=n[1]*e+n[5]*i+n[9]*s+n[13],this.z=n[2]*e+n[6]*i+n[10]*s+n[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,s=this.z,n=t.val,r=e*n[0]+i*n[4]+s*n[8]+n[12],a=e*n[1]+i*n[5]+s*n[9]+n[13],o=e*n[2]+i*n[6]+s*n[10]+n[14],h=e*n[3]+i*n[7]+s*n[11]+n[15];return this.x=r/h,this.y=a/h,this.z=o/h,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,n=t.x,r=t.y,a=t.z,o=t.w,h=o*e+r*s-a*i,l=o*i+a*e-n*s,u=o*s+n*i-r*e,c=-n*e-r*i-a*s;return this.x=h*o+c*-n+l*-a-u*-r,this.y=l*o+c*-r+u*-n-h*-a,this.z=u*o+c*-a+h*-r-l*-n,this},project:function(t){var e=this.x,i=this.y,s=this.z,n=t.val,r=n[0],a=n[1],o=n[2],h=n[3],l=n[4],u=n[5],c=n[6],d=n[7],f=n[8],p=n[9],v=n[10],g=n[11],m=n[12],y=n[13],x=n[14],T=1/(e*h+i*d+s*g+n[15]);return this.x=(e*r+i*l+s*f+m)*T,this.y=(e*a+i*u+s*p+y)*T,this.z=(e*o+i*c+s*v+x)*T,this},projectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unprojectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unproject:function(t,e){var i=t.x,s=t.y,n=t.z,r=t.w,a=this.x-i,o=r-this.y-1-s,h=this.z;return this.x=2*a/n-1,this.y=2*o/r-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});s.ZERO=new s,s.RIGHT=new s(1,0,0),s.LEFT=new s(-1,0,0),s.UP=new s(0,-1,0),s.DOWN=new s(0,1,0),s.FORWARD=new s(0,0,1),s.BACK=new s(0,0,-1),s.ONE=new s(1,1,1),t.exports=s},51729:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0)},clone:function(){return new s(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,s){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,n=t*t+e*e+i*i+s*s;return n>0&&(n=1/Math.sqrt(n),this.x=t*n,this.y=e*n,this.z=i*n,this.w=s*n),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,n=this.z,r=this.w;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=n+e*(t.z-n),this.w=r+e*(t.w-r),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,n=t.w-this.w||0;return Math.sqrt(e*e+i*i+s*s+n*n)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,n=t.w-this.w||0;return e*e+i*i+s*s+n*n},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,n=this.w,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*s+r[12]*n,this.y=r[1]*e+r[5]*i+r[9]*s+r[13]*n,this.z=r[2]*e+r[6]*i+r[10]*s+r[14]*n,this.w=r[3]*e+r[7]*i+r[11]*s+r[15]*n,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,n=t.x,r=t.y,a=t.z,o=t.w,h=o*e+r*s-a*i,l=o*i+a*e-n*s,u=o*s+n*i-r*e,c=-n*e-r*i-a*s;return this.x=h*o+c*-n+l*-a-u*-r,this.y=l*o+c*-r+u*-n-h*-a,this.z=u*o+c*-a+h*-r-l*-n,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});s.prototype.sub=s.prototype.subtract,s.prototype.mul=s.prototype.multiply,s.prototype.div=s.prototype.divide,s.prototype.dist=s.prototype.distance,s.prototype.distSq=s.prototype.distanceSq,s.prototype.len=s.prototype.length,s.prototype.lenSq=s.prototype.lengthSq,t.exports=s},9557:t=>{t.exports=function(t,e,i){return Math.abs(t-e)<=i}},1071:t=>{t.exports=function(t,e,i){var s=i-e;return e+((t-e)%s+s)%s}},90447:t=>{t.exports=function(t,e,i,s){return Math.atan2(s-e,i-t)}},94240:t=>{t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},84066:t=>{t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},9678:t=>{t.exports=function(t,e,i,s){return Math.atan2(i-t,s-e)}},76861:(t,e,i)=>{var s=i(83392);t.exports=function(t){return t>Math.PI&&(t-=s.PI2),Math.abs(((t+s.TAU)%s.PI2-s.PI2)%s.PI2)}},37570:t=>{t.exports=function(t){return(t%=2*Math.PI)>=0?t:t+2*Math.PI}},87597:(t,e,i)=>{var s=i(61616);t.exports=function(){return s(-Math.PI,Math.PI)}},74493:(t,e,i)=>{var s=i(61616);t.exports=function(){return s(-180,180)}},19049:(t,e,i)=>{var s=i(37570);t.exports=function(t){return s(t+Math.PI)}},90612:(t,e,i)=>{var s=i(83392);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=s.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e{t.exports=function(t,e){var i=e-t;return 0===i?0:i-360*Math.floor((i- -180)/360)}},35786:(t,e,i)=>{var s=i(1071);t.exports=function(t){return s(t,-Math.PI,Math.PI)}},62138:(t,e,i)=>{var s=i(1071);t.exports=function(t){return s(t,-180,180)}},22153:(t,e,i)=>{t.exports={Between:i(90447),BetweenPoints:i(94240),BetweenPointsY:i(84066),BetweenY:i(9678),CounterClockwise:i(76861),Normalize:i(37570),Random:i(87597),RandomDegrees:i(74493),Reverse:i(19049),RotateTo:i(90612),ShortestBetween:i(93954),Wrap:i(35786),WrapDegrees:i(62138)}},83392:t=>{var e={PI2:2*Math.PI,TAU:.5*Math.PI,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:null,MIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER||-9007199254740991,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991};t.exports=e},53996:t=>{t.exports=function(t,e,i,s){var n=t-i,r=e-s;return Math.sqrt(n*n+r*r)}},92951:t=>{t.exports=function(t,e){var i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)}},12161:t=>{t.exports=function(t,e){var i=t.x-e.x,s=t.y-e.y;return i*i+s*s}},38057:t=>{t.exports=function(t,e,i,s){return Math.max(Math.abs(t-i),Math.abs(e-s))}},33297:t=>{t.exports=function(t,e,i,s,n){return void 0===n&&(n=2),Math.sqrt(Math.pow(i-t,n)+Math.pow(s-e,n))}},90366:t=>{t.exports=function(t,e,i,s){return Math.abs(t-i)+Math.abs(e-s)}},35032:t=>{t.exports=function(t,e,i,s){var n=t-i,r=e-s;return n*n+r*r}},10130:(t,e,i)=>{t.exports={Between:i(53996),BetweenPoints:i(92951),BetweenPointsSquared:i(12161),Chebyshev:i(38057),Power:i(33297),Snake:i(90366),Squared:i(35032)}},35060:(t,e,i)=>{var s=i(25265),n=i(57428),r=i(73214),a=i(71778),o=i(36468),h=i(88258),l=i(52910),u=i(67799),c=i(74083),d=i(92284),f=i(28035),p=i(8754);t.exports={Power0:l,Power1:u.Out,Power2:a.Out,Power3:c.Out,Power4:d.Out,Linear:l,Quad:u.Out,Cubic:a.Out,Quart:c.Out,Quint:d.Out,Sine:f.Out,Expo:h.Out,Circ:r.Out,Elastic:o.Out,Back:s.Out,Bounce:n.Out,Stepped:p,"Quad.easeIn":u.In,"Cubic.easeIn":a.In,"Quart.easeIn":c.In,"Quint.easeIn":d.In,"Sine.easeIn":f.In,"Expo.easeIn":h.In,"Circ.easeIn":r.In,"Elastic.easeIn":o.In,"Back.easeIn":s.In,"Bounce.easeIn":n.In,"Quad.easeOut":u.Out,"Cubic.easeOut":a.Out,"Quart.easeOut":c.Out,"Quint.easeOut":d.Out,"Sine.easeOut":f.Out,"Expo.easeOut":h.Out,"Circ.easeOut":r.Out,"Elastic.easeOut":o.Out,"Back.easeOut":s.Out,"Bounce.easeOut":n.Out,"Quad.easeInOut":u.InOut,"Cubic.easeInOut":a.InOut,"Quart.easeInOut":c.InOut,"Quint.easeInOut":d.InOut,"Sine.easeInOut":f.InOut,"Expo.easeInOut":h.InOut,"Circ.easeInOut":r.InOut,"Elastic.easeInOut":o.InOut,"Back.easeInOut":s.InOut,"Bounce.easeInOut":n.InOut}},25860:t=>{t.exports=function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)}},45264:t=>{t.exports=function(t,e){void 0===e&&(e=1.70158);var i=1.525*e;return(t*=2)<1?t*t*((i+1)*t-i)*.5:.5*((t-=2)*t*((i+1)*t+i)+2)}},36699:t=>{t.exports=function(t,e){return void 0===e&&(e=1.70158),--t*t*((e+1)*t+e)+1}},25265:(t,e,i)=>{t.exports={In:i(25860),Out:i(36699),InOut:i(45264)}},62191:t=>{t.exports=function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}},24799:t=>{t.exports=function(t){var e=!1;return t<.5?(t=1-2*t,e=!0):t=2*t-1,t<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5}},60819:t=>{t.exports=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},57428:(t,e,i)=>{t.exports={In:i(62191),Out:i(60819),InOut:i(24799)}},86855:t=>{t.exports=function(t){return 1-Math.sqrt(1-t*t)}},7280:t=>{t.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},18058:t=>{t.exports=function(t){return Math.sqrt(1- --t*t)}},73214:(t,e,i)=>{t.exports={In:i(86855),Out:i(18058),InOut:i(7280)}},91532:t=>{t.exports=function(t){return t*t*t}},63180:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},16518:t=>{t.exports=function(t){return--t*t*t+1}},71778:(t,e,i)=>{t.exports={In:i(91532),Out:i(16518),InOut:i(63180)}},24729:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)}},50325:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)*.5+1}},84074:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-s)*(2*Math.PI)/i)+1}},36468:(t,e,i)=>{t.exports={In:i(24729),Out:i(84074),InOut:i(50325)}},95638:t=>{t.exports=function(t){return Math.pow(2,10*(t-1))-.001}},10357:t=>{t.exports=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))}},14894:t=>{t.exports=function(t){return 1-Math.pow(2,-10*t)}},88258:(t,e,i)=>{t.exports={In:i(95638),Out:i(14894),InOut:i(10357)}},33063:(t,e,i)=>{t.exports={Back:i(25265),Bounce:i(57428),Circular:i(73214),Cubic:i(71778),Elastic:i(36468),Expo:i(88258),Linear:i(52910),Quadratic:i(67799),Quartic:i(74083),Quintic:i(92284),Sine:i(28035),Stepped:i(8754)}},43927:t=>{t.exports=function(t){return t}},52910:(t,e,i)=>{t.exports=i(43927)},77471:t=>{t.exports=function(t){return t*t}},83863:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},44383:t=>{t.exports=function(t){return t*(2-t)}},67799:(t,e,i)=>{t.exports={In:i(77471),Out:i(44383),InOut:i(83863)}},48311:t=>{t.exports=function(t){return t*t*t*t}},55248:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},23135:t=>{t.exports=function(t){return 1- --t*t*t*t}},74083:(t,e,i)=>{t.exports={In:i(48311),Out:i(23135),InOut:i(55248)}},7313:t=>{t.exports=function(t){return t*t*t*t*t}},98759:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},26670:t=>{t.exports=function(t){return--t*t*t*t*t+1}},92284:(t,e,i)=>{t.exports={In:i(7313),Out:i(26670),InOut:i(98759)}},52929:t=>{t.exports=function(t){return 0===t?0:1===t?1:1-Math.cos(t*Math.PI/2)}},66333:t=>{t.exports=function(t){return 0===t?0:1===t?1:.5*(1-Math.cos(Math.PI*t))}},37255:t=>{t.exports=function(t){return 0===t?0:1===t?1:Math.sin(t*Math.PI/2)}},28035:(t,e,i)=>{t.exports={In:i(52929),Out:i(37255),InOut:i(66333)}},52770:t=>{t.exports=function(t,e){return void 0===e&&(e=1),t<=0?0:t>=1?1:1/e*(1+(e*t|0))}},8754:(t,e,i)=>{t.exports=i(52770)},17247:t=>{t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},88456:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.floor(t+e)}},41935:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t>e-i}},54726:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t{t.exports={Ceil:i(17247),Equal:i(88456),Floor:i(61824),GreaterThan:i(41935),LessThan:i(54726)}},5923:(t,e,i)=>{var s=i(83392),n=i(98611),r={Angle:i(22153),Distance:i(10130),Easing:i(33063),Fuzzy:i(52778),Interpolation:i(48528),Pow2:i(73773),Snap:i(23679),RandomDataGenerator:i(81429),Average:i(26042),Bernstein:i(22824),Between:i(17489),CatmullRom:i(14976),CeilTo:i(89129),Clamp:i(82897),DegToRad:i(75606),Difference:i(767),Euler:i(9849),Factorial:i(8034),FloatBetween:i(61616),FloorTo:i(60679),FromPercent:i(91806),GetSpeed:i(79366),IsEven:i(43776),IsEvenStrict:i(58442),Linear:i(42798),LinearXY:i(61072),MaxAdd:i(69635),Median:i(37394),MinSub:i(17259),Percent:i(61820),RadToDeg:i(23701),RandomXY:i(16906),RandomXYZ:i(52417),RandomXYZW:i(17915),Rotate:i(52257),RotateAround:i(2386),RotateAroundDistance:i(72395),RotateTo:i(41061),RoundAwayFromZero:i(67233),RoundTo:i(64333),SinCosTableGenerator:i(59533),SmootherStep:i(87736),SmoothStep:i(5514),ToXY:i(55805),TransformXY:i(64462),Within:i(9557),Wrap:i(1071),Vector2:i(93736),Vector3:i(70015),Vector4:i(51729),Matrix3:i(5341),Matrix4:i(16650),Quaternion:i(75003),RotateVec3:i(93709)};r=n(!1,r,s),t.exports=r},63210:(t,e,i)=>{var s=i(22824);t.exports=function(t,e){for(var i=0,n=t.length-1,r=0;r<=n;r++)i+=Math.pow(1-e,n-r)*Math.pow(e,r)*t[r]*s(n,r);return i}},88332:(t,e,i)=>{var s=i(14976);t.exports=function(t,e){var i=t.length-1,n=i*e,r=Math.floor(n);return t[0]===t[i]?(e<0&&(r=Math.floor(n=i*(1+e))),s(n-r,t[(r-1+i)%i],t[r],t[(r+1)%i],t[(r+2)%i])):e<0?t[0]-(s(-n,t[0],t[0],t[1],t[1])-t[0]):e>1?t[i]-(s(n-i,t[i],t[i],t[i-1],t[i-1])-t[i]):s(n-r,t[r?r-1:0],t[r],t[i{t.exports=function(t,e,i,s,n){return function(t,e){var i=1-t;return i*i*i*e}(t,e)+function(t,e){var i=1-t;return 3*i*i*t*e}(t,i)+function(t,e){return 3*(1-t)*t*t*e}(t,s)+function(t,e){return t*t*t*e}(t,n)}},47614:(t,e,i)=>{var s=i(42798);t.exports=function(t,e){var i=t.length-1,n=i*e,r=Math.floor(n);return e<0?s(t[0],t[1],n):e>1?s(t[i],t[i-1],i-n):s(t[r],t[r+1>i?i:r+1],n-r)}},16252:t=>{t.exports=function(t,e,i,s){return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,s)}},44521:(t,e,i)=>{var s=i(5514);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},45507:(t,e,i)=>{var s=i(87736);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},48528:(t,e,i)=>{t.exports={Bezier:i(63210),CatmullRom:i(88332),CubicBezier:i(34631),Linear:i(47614),QuadraticBezier:i(16252),SmoothStep:i(44521),SmootherStep:i(45507)}},3504:t=>{t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<{t.exports=function(t,e){return t>0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},2018:t=>{t.exports=function(t){return t>0&&0==(t&t-1)}},73773:(t,e,i)=>{t.exports={GetNext:i(3504),IsSize:i(28621),IsValue:i(2018)}},81429:(t,e,i)=>{var s=new(i(56694))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,i=this.n;t=t.toString();for(var s=0;s>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e0;e--){var i=Math.floor(this.frac()*(e+1)),s=t[i];t[i]=t[e],t[e]=s}return t}});t.exports=s},82127:t=>{t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),s?(i+t)/e:i+t)}},84314:t=>{t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),s?(i+t)/e:i+t)}},88462:t=>{t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),s?(i+t)/e:i+t)}},23679:(t,e,i)=>{t.exports={Ceil:i(82127),Floor:i(84314),To:i(88462)}},85780:(t,e,i)=>{var s=i(86459),n=i(98611),r={Actions:i(83979),Animations:i(13517),BlendModes:i(95723),Cache:i(45820),Cameras:i(44143),Core:i(80293),Class:i(56694),Create:i(84106),Curves:i(73962),Data:i(1999),Display:i(24816),DOM:i(3590),Events:i(95146),Game:i(15213),GameObjects:i(48013),Geom:i(84068),Input:i(20873),Loader:i(95695),Math:i(5923),Physics:{Arcade:i(39977)},Plugins:i(45615),Renderer:i(42069),Scale:i(86754),ScaleModes:i(27394),Scene:i(87157),Scenes:i(20436),Structs:i(20010),Textures:i(87499),Tilemaps:i(52678),Time:i(97121),Tweens:i(75193),Utils:i(22178)};r.Sound=i(56751),r=n(!1,r,s),t.exports=r,i.g.Phaser=r},62832:(t,e,i)=>{var s=i(56694),n=i(7864),r=i(1539),a=new s({Extends:r,Mixins:[n.Acceleration,n.Angular,n.Bounce,n.Debug,n.Drag,n.Enable,n.Friction,n.Gravity,n.Immovable,n.Mass,n.Pushable,n.Size,n.Velocity],initialize:function(t,e,i,s,n){r.call(this,t,e,i,s,n),this.body=null}});t.exports=a},66150:(t,e,i)=>{var s=i(56694),n=i(75606),r=i(53996),a=i(35032),o=i(99523),h=i(72632),l=i(30657),u=i(2732),c=i(15147),d=i(91963),f=i(7599),p=i(93736),v=i(85233),g=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,t.sys.events.once(f.BOOT,this.boot,this),t.sys.events.on(f.START,this.start,this)},boot:function(){this.world=new v(this.scene,this.config),this.add=new o(this.world),this.systems.events.once(f.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new v(this.scene,this.config),this.add=new o(this.world));var t=this.systems.events;h(this.config,"customUpdate",!1)||t.on(f.UPDATE,this.world.update,this.world),t.on(f.POST_UPDATE,this.world.postUpdate,this.world),t.once(f.SHUTDOWN,this.shutdown,this)},enableUpdate:function(){this.systems.events.on(f.UPDATE,this.world.update,this.world)},disableUpdate:function(){this.systems.events.off(f.UPDATE,this.world.update,this.world)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return l(h(e,"arcade",{}),h(t,"arcade",{}))},overlap:function(t,e,i,s,n){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=i),this.world.collideObjects(t,e,i,s,n,!0)},collide:function(t,e,i,s,n){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=i),this.world.collideObjects(t,e,i,s,n,!1)},collideTiles:function(t,e,i,s,n){return this.world.collideTiles(t,e,i,s,n)},overlapTiles:function(t,e,i,s,n){return this.world.overlapTiles(t,e,i,s,n)},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},accelerateTo:function(t,e,i,s,n,r){void 0===s&&(s=60);var a=Math.atan2(i-t.y,e-t.x);return t.body.acceleration.setToPolar(a,s),void 0!==n&&void 0!==r&&t.body.maxVelocity.set(n,r),a},accelerateToObject:function(t,e,i,s,n){return this.accelerateTo(t,e.x,e.y,i,s,n)},closest:function(t,e){e||(e=this.world.bodies.entries);for(var i=Number.MAX_VALUE,s=null,n=t.x,r=t.y,o=e.length,h=0;hi&&(s=l,i=c)}}return s},moveTo:function(t,e,i,s,n){void 0===s&&(s=60),void 0===n&&(n=0);var a=Math.atan2(i-t.y,e-t.x);return n>0&&(s=r(t.x,t.y,e,i)/(n/1e3)),t.body.velocity.setToPolar(a,s),a},moveToObject:function(t,e,i,s){return this.moveTo(t,e.x,e.y,i,s)},velocityFromAngle:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new p),i.setToPolar(n(t),e)},velocityFromRotation:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new p),i.setToPolar(t,e)},overlapRect:function(t,e,i,s,n,r){return c(this.world,t,e,i,s,n,r)},overlapCirc:function(t,e,i,s,n){return u(this.world,t,e,i,s,n)},shutdown:function(){if(this.world){var t=this.systems.events;t.off(f.UPDATE,this.world.update,this.world),t.off(f.POST_UPDATE,this.world.postUpdate,this.world),t.off(f.SHUTDOWN,this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null}},destroy:function(){this.shutdown(),this.scene.sys.events.off(f.START,this.start,this),this.scene=null,this.systems=null}});d.register("ArcadePhysics",g,"arcadePhysics"),t.exports=g},25084:(t,e,i)=>{var s=i(56694),n=i(7864),r=i(13747),a=new s({Extends:r,Mixins:[n.Acceleration,n.Angular,n.Bounce,n.Debug,n.Drag,n.Enable,n.Friction,n.Gravity,n.Immovable,n.Mass,n.Pushable,n.Size,n.Velocity],initialize:function(t,e,i,s,n){r.call(this,t,e,i,s,n),this.body=null}});t.exports=a},97602:(t,e,i)=>{var s=i(56694),n=i(47401),r=i(27037),a=i(23701),o=i(74118),h=i(94287),l=i(93736),u=new s({initialize:function(t,e){var i=64,s=64,r=void 0!==e;r&&e.displayWidth&&(i=e.displayWidth,s=e.displayHeight),r||(e={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0}),this.world=t,this.gameObject=r?e:void 0,this.isBody=!0,this.transform={x:e.x,y:e.y,rotation:e.angle,scaleX:e.scaleX,scaleY:e.scaleY,displayOriginX:e.displayOriginX,displayOriginY:e.displayOriginY},this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new l,this.position=new l(e.x-e.scaleX*e.displayOriginX,e.y-e.scaleY*e.displayOriginY),this.prev=this.position.clone(),this.prevFrame=this.position.clone(),this.allowRotation=!0,this.rotation=e.angle,this.preRotation=e.angle,this.width=i,this.height=s,this.sourceWidth=i,this.sourceHeight=s,e.frame&&(this.sourceWidth=e.frame.realWidth,this.sourceHeight=e.frame.realHeight),this.halfWidth=Math.abs(i/2),this.halfHeight=Math.abs(s/2),this.center=new l(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=new l,this.newVelocity=new l,this.deltaMax=new l,this.acceleration=new l,this.allowDrag=!0,this.drag=new l,this.allowGravity=!0,this.gravity=new l,this.bounce=new l,this.worldBounce=null,this.customBoundsRectangle=t.bounds,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new l(1e4,1e4),this.maxSpeed=-1,this.friction=new l(1,0),this.useDamping=!1,this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=n.FACING_NONE,this.immovable=!1,this.pushable=!0,this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.syncBounds=!1,this.physicsType=n.DYNAMIC_BODY,this._sx=e.scaleX,this._sy=e.scaleY,this._dx=0,this._dy=0,this._tx=0,this._ty=0,this._bounds=new o},updateBounds:function(){var t=this.gameObject,e=this.transform;if(t.parentContainer){var i=t.getWorldTransformMatrix(this.world._tempMatrix,this.world._tempMatrix2);e.x=i.tx,e.y=i.ty,e.rotation=a(i.rotation),e.scaleX=i.scaleX,e.scaleY=i.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY}else e.x=t.x,e.y=t.y,e.rotation=t.angle,e.scaleX=t.scaleX,e.scaleY=t.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY;var s=!1;if(this.syncBounds){var n=t.getBounds(this._bounds);this.width=n.width,this.height=n.height,s=!0}else{var r=Math.abs(e.scaleX),o=Math.abs(e.scaleY);this._sx===r&&this._sy===o||(this.width=this.sourceWidth*r,this.height=this.sourceHeight*o,this._sx=r,this._sy=o,s=!0)}s&&(this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter())},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},updateFromGameObject:function(){this.updateBounds();var t=this.transform;this.position.x=t.x+t.scaleX*(this.offset.x-t.displayOriginX),this.position.y=t.y+t.scaleY*(this.offset.y-t.displayOriginY),this.updateCenter()},resetFlags:function(t){void 0===t&&(t=!1);var e=this.wasTouching,i=this.touching,s=this.blocked;t?(e.none=!0,e.up=!1,e.down=!1,e.left=!1,e.right=!1):(e.none=i.none,e.up=i.up,e.down=i.down,e.left=i.left,e.right=i.right),i.none=!0,i.up=!1,i.down=!1,i.left=!1,i.right=!1,s.none=!0,s.up=!1,s.down=!1,s.left=!1,s.right=!1,this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1},preUpdate:function(t,e){t&&this.resetFlags(),this.gameObject&&this.updateFromGameObject(),this.rotation=this.transform.rotation,this.preRotation=this.rotation,this.moves&&(this.prev.x=this.position.x,this.prev.y=this.position.y,this.prevFrame.x=this.position.x,this.prevFrame.y=this.position.y),t&&this.update(e)},update:function(t){if(this.prev.x=this.position.x,this.prev.y=this.position.y,this.moves){this.world.updateMotion(this,t);var e=this.velocity.x,i=this.velocity.y;this.newVelocity.set(e*t,i*t),this.position.add(this.newVelocity),this.updateCenter(),this.angle=Math.atan2(i,e),this.speed=Math.sqrt(e*e+i*i),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds&&this.world.emit(r.WORLD_BOUNDS,this,this.blocked.up,this.blocked.down,this.blocked.left,this.blocked.right)}this._dx=this.position.x-this.prev.x,this._dy=this.position.y-this.prev.y},postUpdate:function(){var t=this.position.x-this.prevFrame.x,e=this.position.y-this.prevFrame.y,i=this.gameObject;if(this.moves){var s=this.deltaMax.x,r=this.deltaMax.y;0!==s&&0!==t&&(t<0&&t<-s?t=-s:t>0&&t>s&&(t=s)),0!==r&&0!==e&&(e<0&&e<-r?e=-r:e>0&&e>r&&(e=r)),i&&(i.x+=t,i.y+=e)}t<0?this.facing=n.FACING_LEFT:t>0&&(this.facing=n.FACING_RIGHT),e<0?this.facing=n.FACING_UP:e>0&&(this.facing=n.FACING_DOWN),this.allowRotation&&i&&(i.angle+=this.deltaZ()),this._tx=t,this._ty=e},setBoundsRectangle:function(t){return this.customBoundsRectangle=t||this.world.bounds,this},checkWorldBounds:function(){var t=this.position,e=this.customBoundsRectangle,i=this.world.checkCollision,s=this.worldBounce?-this.worldBounce.x:-this.bounce.x,n=this.worldBounce?-this.worldBounce.y:-this.bounce.y,r=!1;return t.xe.right&&i.right&&(t.x=e.right-this.width,this.velocity.x*=s,this.blocked.right=!0,r=!0),t.ye.bottom&&i.down&&(t.y=e.bottom-this.height,this.velocity.y*=n,this.blocked.down=!0,r=!0),r&&(this.blocked.none=!1,this.updateCenter()),r},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this},setGameObject:function(t,e){return void 0===e&&(e=!0),this.world.remove(this),this.gameObject&&this.gameObject.body&&(this.gameObject.body=null),this.gameObject=t,t.body&&(t.body=this),this.setSize(),this.world.add(this),this.enable=e,this},setSize:function(t,e,i){void 0===i&&(i=!0);var s=this.gameObject;if(s&&(!t&&s.frame&&(t=s.frame.realWidth),!e&&s.frame&&(e=s.frame.realHeight)),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&s&&s.getCenter){var n=(s.width-t)/2,r=(s.height-e)/2;this.offset.set(n,r)}return this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.isCircle=!0,this.radius=t,this.sourceWidth=2*t,this.sourceHeight=2*t,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter()):this.isCircle=!1,this},reset:function(t,e){this.stop();var i=this.gameObject;i&&(i.setPosition(t,e),this.rotation=i.angle,this.preRotation=i.angle);var s=this.position;i&&i.getTopLeft?i.getTopLeft(s):s.set(t,e),this.prev.copy(s),this.prevFrame.copy(s),i&&this.updateBounds(),this.updateCenter(),this.checkWorldBounds(),this.resetFlags(!0)},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?this.radius>0&&t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom&&(this.center.x-t)*(this.center.x-t)+(this.center.y-e)*(this.center.y-e)<=this.radius*this.radius:h(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this._dx>0?this._dx:-this._dx},deltaAbsY:function(){return this._dy>0?this._dy:-this._dy},deltaX:function(){return this._dx},deltaY:function(){return this._dy},deltaXFinal:function(){return this._tx},deltaYFinal:function(){return this._ty},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.enable=!1,this.world&&this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,s=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor),this.isCircle?t.strokeCircle(i,s,this.width/2):(this.checkCollision.up&&t.lineBetween(e.x,e.y,e.x+this.width,e.y),this.checkCollision.right&&t.lineBetween(e.x+this.width,e.y,e.x+this.width,e.y+this.height),this.checkCollision.down&&t.lineBetween(e.x,e.y+this.height,e.x+this.width,e.y+this.height),this.checkCollision.left&&t.lineBetween(e.x,e.y,e.x,e.y+this.height))),this.debugShowVelocity&&(t.lineStyle(t.defaultStrokeWidth,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,s,i+this.velocity.x/2,s+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setCollideWorldBounds:function(t,e,i,s){void 0===t&&(t=!0),this.collideWorldBounds=t;var n=void 0!==e,r=void 0!==i;return(n||r)&&(this.worldBounce||(this.worldBounce=new l),n&&(this.worldBounce.x=e),r&&(this.worldBounce.y=i)),void 0!==s&&(this.onWorldBounds=s),this},setValue:function(t,e,i){return void 0===e&&(e=t.x),void 0===i&&(i=t.y),t.set(e,i),this},setVelocity:function(t,e){return this.velocity.set(t,e),t=this.velocity.x,e=this.velocity.y,this.speed=Math.sqrt(t*t+e*e),this},setVelocityX:function(t){return this.setVelocity(t,this.velocity.y)},setVelocityY:function(t){return this.setVelocity(this.velocity.x,t)},setMaxVelocity:function(t,e){return this.maxVelocity.set(t,e),this},setMaxVelocityX:function(t){return this.maxVelocity.x=t,this},setMaxVelocityY:function(t){return this.maxVelocity.y=t,this},setMaxSpeed:function(t){return this.maxSpeed=t,this},setBounce:function(t,e){return this.bounce.set(t,e),this},setBounceX:function(t){return this.bounce.x=t,this},setBounceY:function(t){return this.bounce.y=t,this},setAcceleration:function(t,e){return this.acceleration.set(t,e),this},setAccelerationX:function(t){return this.acceleration.x=t,this},setAccelerationY:function(t){return this.acceleration.y=t,this},setAllowDrag:function(t){return void 0===t&&(t=!0),this.allowDrag=t,this},setAllowGravity:function(t){return void 0===t&&(t=!0),this.allowGravity=t,this},setAllowRotation:function(t){return void 0===t&&(t=!0),this.allowRotation=t,this},setDrag:function(t,e){return this.drag.set(t,e),this},setDamping:function(t){return this.useDamping=t,this},setDragX:function(t){return this.drag.x=t,this},setDragY:function(t){return this.drag.y=t,this},setGravity:function(t,e){return this.gravity.set(t,e),this},setGravityX:function(t){return this.gravity.x=t,this},setGravityY:function(t){return this.gravity.y=t,this},setFriction:function(t,e){return this.friction.set(t,e),this},setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setAngularVelocity:function(t){return this.angularVelocity=t,this},setAngularAcceleration:function(t){return this.angularAcceleration=t,this},setAngularDrag:function(t){return this.angularDrag=t,this},setMass:function(t){return this.mass=t,this},setImmovable:function(t){return void 0===t&&(t=!0),this.immovable=t,this},setEnable:function(t){return void 0===t&&(t=!0),this.enable=t,this},processX:function(t,e,i,s){this.x+=t,this.updateCenter(),null!==e&&(this.velocity.x=e);var n=this.blocked;i&&(n.left=!0),s&&(n.right=!0)},processY:function(t,e,i,s){this.y+=t,this.updateCenter(),null!==e&&(this.velocity.y=e);var n=this.blocked;i&&(n.up=!0),s&&(n.down=!0)},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=u},3909:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s,n,r,a){this.world=t,this.name="",this.active=!0,this.overlapOnly=e,this.object1=i,this.object2=s,this.collideCallback=n,this.processCallback=r,this.callbackContext=a},setName:function(t){return this.name=t,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});t.exports=s},99523:(t,e,i)=>{var s=i(62832),n=i(25084),r=i(97602),a=i(56694),o=i(47401),h=i(10481),l=i(66634),u=i(46346),c=new a({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},collider:function(t,e,i,s,n){return this.world.addCollider(t,e,i,s,n)},overlap:function(t,e,i,s,n){return this.world.addOverlap(t,e,i,s,n)},existing:function(t,e){var i=e?o.STATIC_BODY:o.DYNAMIC_BODY;return this.world.enableBody(t,i),t},staticImage:function(t,e,i,n){var r=new s(this.scene,t,e,i,n);return this.sys.displayList.add(r),this.world.enableBody(r,o.STATIC_BODY),r},image:function(t,e,i,n){var r=new s(this.scene,t,e,i,n);return this.sys.displayList.add(r),this.world.enableBody(r,o.DYNAMIC_BODY),r},staticSprite:function(t,e,i,s){var r=new n(this.scene,t,e,i,s);return this.sys.displayList.add(r),this.sys.updateList.add(r),this.world.enableBody(r,o.STATIC_BODY),r},sprite:function(t,e,i,s){var r=new n(this.scene,t,e,i,s);return this.sys.displayList.add(r),this.sys.updateList.add(r),this.world.enableBody(r,o.DYNAMIC_BODY),r},staticGroup:function(t,e){return this.sys.updateList.add(new u(this.world,this.world.scene,t,e))},group:function(t,e){return this.sys.updateList.add(new h(this.world,this.world.scene,t,e))},body:function(t,e,i,s){var n=new r(this.world);return n.position.set(t,e),i&&s&&n.setSize(i,s),this.world.add(n,o.DYNAMIC_BODY),n},staticBody:function(t,e,i,s){var n=new l(this.world);return n.position.set(t,e),i&&s&&n.setSize(i,s),this.world.add(n,o.STATIC_BODY),n},destroy:function(){this.world=null,this.scene=null,this.sys=null}});t.exports=c},75671:(t,e,i)=>{var s=i(47401);t.exports=function(t,e,i,n){var r=0,a=t.deltaAbsX()+e.deltaAbsX()+n;return 0===t._dx&&0===e._dx?(t.embedded=!0,e.embedded=!0):t._dx>e._dx?(r=t.right-e.x)>a&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?r=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.right=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.left=!0)):t._dxa&&!i||!1===t.checkCollision.left||!1===e.checkCollision.right?r=0:(t.touching.none=!1,t.touching.left=!0,e.touching.none=!1,e.touching.right=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.left=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.right=!0))),t.overlapX=r,e.overlapX=r,r}},66185:(t,e,i)=>{var s=i(47401);t.exports=function(t,e,i,n){var r=0,a=t.deltaAbsY()+e.deltaAbsY()+n;return 0===t._dy&&0===e._dy?(t.embedded=!0,e.embedded=!0):t._dy>e._dy?(r=t.bottom-e.y)>a&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?r=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.down=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.up=!0)):t._dya&&!i||!1===t.checkCollision.up||!1===e.checkCollision.down?r=0:(t.touching.none=!1,t.touching.up=!0,e.touching.none=!1,e.touching.down=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.up=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.down=!0))),t.overlapY=r,e.overlapY=r,r}},10481:(t,e,i)=>{var s=i(25084),n=i(56694),r=i(47401),a=i(72632),o=i(59192),h=i(42911),l=new n({Extends:o,initialize:function(t,e,i,n){if(i||n)if(h(i))n=i,i=null,n.internalCreateCallback=this.createCallbackHandler,n.internalRemoveCallback=this.removeCallbackHandler;else if(Array.isArray(i)&&h(i[0])){n=i[0];var l=this;i.forEach((function(t){t.internalCreateCallback=l.createCallbackHandler,t.internalRemoveCallback=l.removeCallbackHandler})),i=null}else n={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};else n={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};this.world=t,n.classType=a(n,"classType",s),this.physicsType=r.DYNAMIC_BODY,this.defaults={setCollideWorldBounds:a(n,"collideWorldBounds",!1),setBoundsRectangle:a(n,"customBoundsRectangle",null),setAccelerationX:a(n,"accelerationX",0),setAccelerationY:a(n,"accelerationY",0),setAllowDrag:a(n,"allowDrag",!0),setAllowGravity:a(n,"allowGravity",!0),setAllowRotation:a(n,"allowRotation",!0),setBounceX:a(n,"bounceX",0),setBounceY:a(n,"bounceY",0),setDragX:a(n,"dragX",0),setDragY:a(n,"dragY",0),setEnable:a(n,"enable",!0),setGravityX:a(n,"gravityX",0),setGravityY:a(n,"gravityY",0),setFrictionX:a(n,"frictionX",0),setFrictionY:a(n,"frictionY",0),setMaxVelocityX:a(n,"maxVelocityX",1e4),setMaxVelocityY:a(n,"maxVelocityY",1e4),setVelocityX:a(n,"velocityX",0),setVelocityY:a(n,"velocityY",0),setAngularVelocity:a(n,"angularVelocity",0),setAngularAcceleration:a(n,"angularAcceleration",0),setAngularDrag:a(n,"angularDrag",0),setMass:a(n,"mass",1),setImmovable:a(n,"immovable",!1)},o.call(this,e,i,n),this.type="PhysicsGroup"},createCallbackHandler:function(t){t.body||this.world.enableBody(t,r.DYNAMIC_BODY);var e=t.body;for(var i in this.defaults)e[i](this.defaults[i])},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},setVelocity:function(t,e,i){void 0===i&&(i=0);for(var s=this.getChildren(),n=0;n{var e,i,s,n,r,a,o,h,l,u,c,d,f,p,v,g,m,y=function(){return u&&v&&i.blocked.right?(e.processX(-m,o,!1,!0),1):l&&g&&i.blocked.left?(e.processX(m,o,!0),1):f&&g&&e.blocked.right?(i.processX(-m,h,!1,!0),2):d&&v&&e.blocked.left?(i.processX(m,h,!0),2):0},x=function(t){if(s&&n)m*=.5,0===t||3===t?(e.processX(m,r),i.processX(-m,a)):(e.processX(-m,r),i.processX(m,a));else if(s&&!n)0===t||3===t?e.processX(m,o,!0):e.processX(-m,o,!1,!0);else if(!s&&n)0===t||3===t?i.processX(-m,h,!1,!0):i.processX(m,h,!0);else{var v=.5*m;0===t?p?(e.processX(m,0,!0),i.processX(0,null,!1,!0)):f?(e.processX(v,0,!0),i.processX(-v,0,!1,!0)):(e.processX(v,i.velocity.x,!0),i.processX(-v,null,!1,!0)):1===t?c?(e.processX(0,null,!1,!0),i.processX(m,0,!0)):u?(e.processX(-v,0,!1,!0),i.processX(v,0,!0)):(e.processX(-v,null,!1,!0),i.processX(v,e.velocity.x,!0)):2===t?p?(e.processX(-m,0,!1,!0),i.processX(0,null,!0)):d?(e.processX(-v,0,!1,!0),i.processX(v,0,!0)):(e.processX(-v,i.velocity.x,!1,!0),i.processX(v,null,!0)):3===t&&(c?(e.processX(0,null,!0),i.processX(-m,0,!1,!0)):l?(e.processX(v,0,!0),i.processX(-v,0,!1,!0)):(e.processX(v,i.velocity.y,!0),i.processX(-v,null,!1,!0)))}return!0};t.exports={BlockCheck:y,Check:function(){var t=e.velocity.x,s=i.velocity.x,n=Math.sqrt(s*s*i.mass/e.mass)*(s>0?1:-1),o=Math.sqrt(t*t*e.mass/i.mass)*(t>0?1:-1),h=.5*(n+o);return o-=h,r=h+(n-=h)*e.bounce.x,a=h+o*i.bounce.x,l&&g?x(0):d&&v?x(1):u&&v?x(2):!(!f||!g)&&x(3)},Set:function(t,r,a){i=r;var x=(e=t).velocity.x,T=i.velocity.x;return s=e.pushable,l=e._dx<0,u=e._dx>0,c=0===e._dx,v=Math.abs(e.right-i.x)<=Math.abs(i.right-e.x),o=T-x*e.bounce.x,n=i.pushable,d=i._dx<0,f=i._dx>0,p=0===i._dx,g=!v,h=x-T*i.bounce.x,m=Math.abs(a),y()},Run:x,RunImmovableBody1:function(t){1===t?i.velocity.x=0:v?i.processX(m,h,!0):i.processX(-m,h,!1,!0),e.moves&&(i.y+=(e.y-e.prev.y)*e.friction.y,i._dy=i.y-i.prev.y)},RunImmovableBody2:function(t){2===t?e.velocity.x=0:g?e.processX(m,o,!0):e.processX(-m,o,!1,!0),i.moves&&(e.y+=(i.y-i.prev.y)*i.friction.y,e._dy=e.y-e.prev.y)}}},67050:t=>{var e,i,s,n,r,a,o,h,l,u,c,d,f,p,v,g,m,y=function(){return u&&v&&i.blocked.down?(e.processY(-m,o,!1,!0),1):l&&g&&i.blocked.up?(e.processY(m,o,!0),1):f&&g&&e.blocked.down?(i.processY(-m,h,!1,!0),2):d&&v&&e.blocked.up?(i.processY(m,h,!0),2):0},x=function(t){if(s&&n)m*=.5,0===t||3===t?(e.processY(m,r),i.processY(-m,a)):(e.processY(-m,r),i.processY(m,a));else if(s&&!n)0===t||3===t?e.processY(m,o,!0):e.processY(-m,o,!1,!0);else if(!s&&n)0===t||3===t?i.processY(-m,h,!1,!0):i.processY(m,h,!0);else{var v=.5*m;0===t?p?(e.processY(m,0,!0),i.processY(0,null,!1,!0)):f?(e.processY(v,0,!0),i.processY(-v,0,!1,!0)):(e.processY(v,i.velocity.y,!0),i.processY(-v,null,!1,!0)):1===t?c?(e.processY(0,null,!1,!0),i.processY(m,0,!0)):u?(e.processY(-v,0,!1,!0),i.processY(v,0,!0)):(e.processY(-v,null,!1,!0),i.processY(v,e.velocity.y,!0)):2===t?p?(e.processY(-m,0,!1,!0),i.processY(0,null,!0)):d?(e.processY(-v,0,!1,!0),i.processY(v,0,!0)):(e.processY(-v,i.velocity.y,!1,!0),i.processY(v,null,!0)):3===t&&(c?(e.processY(0,null,!0),i.processY(-m,0,!1,!0)):l?(e.processY(v,0,!0),i.processY(-v,0,!1,!0)):(e.processY(v,i.velocity.y,!0),i.processY(-v,null,!1,!0)))}return!0};t.exports={BlockCheck:y,Check:function(){var t=e.velocity.y,s=i.velocity.y,n=Math.sqrt(s*s*i.mass/e.mass)*(s>0?1:-1),o=Math.sqrt(t*t*e.mass/i.mass)*(t>0?1:-1),h=.5*(n+o);return o-=h,r=h+(n-=h)*e.bounce.y,a=h+o*i.bounce.y,l&&g?x(0):d&&v?x(1):u&&v?x(2):!(!f||!g)&&x(3)},Set:function(t,r,a){i=r;var x=(e=t).velocity.y,T=i.velocity.y;return s=e.pushable,l=e._dy<0,u=e._dy>0,c=0===e._dy,v=Math.abs(e.bottom-i.y)<=Math.abs(i.bottom-e.y),o=T-x*e.bounce.y,n=i.pushable,d=i._dy<0,f=i._dy>0,p=0===i._dy,g=!v,h=x-T*i.bounce.y,m=Math.abs(a),y()},Run:x,RunImmovableBody1:function(t){1===t?i.velocity.y=0:v?i.processY(m,h,!0):i.processY(-m,h,!1,!0),e.moves&&(i.x+=(e.x-e.prev.x)*e.friction.x,i._dx=i.x-i.prev.x)},RunImmovableBody2:function(t){2===t?e.velocity.y=0:g?e.processY(m,o,!0):e.processY(-m,o,!1,!0),i.moves&&(e.x+=(i.x-i.prev.x)*i.friction.x,e._dx=e.x-e.prev.x)}}},61777:(t,e,i)=>{var s=i(75671),n=i(22916);t.exports=function(t,e,i,r){var a=s(t,e,i,r),o=t.immovable,h=e.immovable;if(i||0===a||o&&h||t.customSeparateX||e.customSeparateX)return 0!==a||t.embedded&&e.embedded;var l=n.Set(t,e,a);return o||h?(o?n.RunImmovableBody1(l):h&&n.RunImmovableBody2(l),!0):l>0||n.Check()}},25299:(t,e,i)=>{var s=i(66185),n=i(67050);t.exports=function(t,e,i,r){var a=s(t,e,i,r),o=t.immovable,h=e.immovable;if(i||0===a||o&&h||t.customSeparateY||e.customSeparateY)return 0!==a||t.embedded&&e.embedded;var l=n.Set(t,e,a);return o||h?(o?n.RunImmovableBody1(l):h&&n.RunImmovableBody2(l),!0):l>0||n.Check()}},66634:(t,e,i)=>{var s=i(65650),n=i(56694),r=i(47401),a=i(94287),o=i(93736),h=new n({initialize:function(t,e){var i=64,s=64,n=void 0!==e;n&&e.displayWidth&&(i=e.displayWidth,s=e.displayHeight),n||(e={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0}),this.world=t,this.gameObject=n?e:void 0,this.isBody=!0,this.debugShowBody=t.defaults.debugShowStaticBody,this.debugBodyColor=t.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new o,this.position=new o(e.x-i*e.originX,e.y-s*e.originY),this.width=i,this.height=s,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new o(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=o.ZERO,this.allowGravity=!1,this.gravity=o.ZERO,this.bounce=o.ZERO,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.mass=1,this.immovable=!0,this.pushable=!1,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.physicsType=r.STATIC_BODY,this._dx=0,this._dy=0},setGameObject:function(t,e){return t&&t!==this.gameObject&&(this.gameObject.body=null,t.body=this,this.gameObject=t),e&&this.updateFromGameObject(),this},updateFromGameObject:function(){this.world.staticTree.remove(this);var t=this.gameObject;return t.getTopLeft(this.position),this.width=t.displayWidth,this.height=t.displayHeight,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.world.staticTree.insert(this),this},setOffset:function(t,e){return void 0===e&&(e=t),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(t,e),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(t,e,i){void 0===i&&(i=!0);var s=this.gameObject;if(!t&&s.frame&&(t=s.frame.realWidth),!e&&s.frame&&(e=s.frame.realHeight),this.world.staticTree.remove(this),this.width=t,this.height=e,this.halfWidth=Math.floor(t/2),this.halfHeight=Math.floor(e/2),i&&s.getCenter){var n=s.displayWidth/2,r=s.displayHeight/2;this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(n-this.halfWidth,r-this.halfHeight),this.position.x+=this.offset.x,this.position.y+=this.offset.y}return this.updateCenter(),this.isCircle=!1,this.radius=0,this.world.staticTree.insert(this),this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=t,this.width=2*t,this.height=2*t,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(t,e){var i=this.gameObject;void 0===t&&(t=i.x),void 0===e&&(e=i.y),this.world.staticTree.remove(this),i.setPosition(t,e),i.getTopLeft(this.position),this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?s(this,t,e):a(this,t,e)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,s=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor,1),this.isCircle?t.strokeCircle(i,s,this.width/2):t.strokeRect(e.x,e.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(t){return t<=0&&(t=.1),this.mass=t,this},x:{get:function(){return this.position.x},set:function(t){this.world.staticTree.remove(this),this.position.x=t,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(t){this.world.staticTree.remove(this),this.position.y=t,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=h},46346:(t,e,i)=>{var s=i(25084),n=i(56694),r=i(47401),a=i(72632),o=i(59192),h=i(42911),l=new n({Extends:o,initialize:function(t,e,i,n){i||n?h(i)?(n=i,i=null,n.internalCreateCallback=this.createCallbackHandler,n.internalRemoveCallback=this.removeCallbackHandler,n.createMultipleCallback=this.createMultipleCallbackHandler,n.classType=a(n,"classType",s)):Array.isArray(i)&&h(i[0])?(n=i,i=null,n.forEach((function(t){t.internalCreateCallback=this.createCallbackHandler,t.internalRemoveCallback=this.removeCallbackHandler,t.createMultipleCallback=this.createMultipleCallbackHandler,t.classType=a(t,"classType",s)}))):n={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler}:n={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler,createMultipleCallback:this.createMultipleCallbackHandler,classType:s},this.world=t,this.physicsType=r.STATIC_BODY,o.call(this,e,i,n),this.type="StaticPhysicsGroup"},createCallbackHandler:function(t){t.body||this.world.enableBody(t,r.STATIC_BODY)},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},createMultipleCallbackHandler:function(){this.refresh()},refresh:function(){for(var t=this.children.entries,e=0;e{var s=i(94240),n=i(97602),r=i(82897),a=i(56694),o=i(3909),h=i(47401),l=i(53996),u=i(6659),c=i(27037),d=i(88456),f=i(41935),p=i(54726),v=i(75671),g=i(66185),m=i(44662),y=i(10850),x=i(83392),T=i(74623),w=i(25163),E=i(74118),S=i(68687),b=i(27354),A=i(61777),_=i(25299),C=i(58403),R=i(66634),M=i(28808),P=i(69360),O=i(93736),L=i(1071),F=new a({Extends:u,initialize:function(t,e){u.call(this),this.scene=t,this.bodies=new C,this.staticBodies=new C,this.pendingDestroy=new C,this.colliders=new T,this.gravity=new O(y(e,"gravity.x",0),y(e,"gravity.y",0)),this.bounds=new E(y(e,"x",0),y(e,"y",0),y(e,"width",t.sys.scale.width),y(e,"height",t.sys.scale.height)),this.checkCollision={up:y(e,"checkCollision.up",!0),down:y(e,"checkCollision.down",!0),left:y(e,"checkCollision.left",!0),right:y(e,"checkCollision.right",!0)},this.fps=y(e,"fps",60),this.fixedStep=y(e,"fixedStep",!0),this._elapsed=0,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this.stepsLastFrame=0,this.timeScale=y(e,"timeScale",1),this.OVERLAP_BIAS=y(e,"overlapBias",4),this.TILE_BIAS=y(e,"tileBias",16),this.forceX=y(e,"forceX",!1),this.isPaused=y(e,"isPaused",!1),this._total=0,this.drawDebug=y(e,"debug",!1),this.debugGraphic,this.defaults={debugShowBody:y(e,"debugShowBody",!0),debugShowStaticBody:y(e,"debugShowStaticBody",!0),debugShowVelocity:y(e,"debugShowVelocity",!0),bodyDebugColor:y(e,"debugBodyColor",16711935),staticBodyDebugColor:y(e,"debugStaticBodyColor",255),velocityDebugColor:y(e,"debugVelocityColor",65280)},this.maxEntries=y(e,"maxEntries",16),this.useTree=y(e,"useTree",!0),this.tree=new S(this.maxEntries),this.staticTree=new S(this.maxEntries),this.treeMinMax={minX:0,minY:0,maxX:0,maxY:0},this._tempMatrix=new P,this._tempMatrix2=new P,this.tileFilterOptions={isColliding:!0,isNotEmpty:!0,hasInterestingFace:!0},this.drawDebug&&this.createDebugGraphic()},enable:function(t,e){void 0===e&&(e=h.DYNAMIC_BODY),Array.isArray(t)||(t=[t]);for(var i=0;i=r;for(this.fixedStep||(n=.001*e,o=!0,this._elapsed=0),i=0;i=r;)this._elapsed-=r,this.step(n)}},step:function(t){var e,i,s=this.bodies.entries,n=s.length;for(e=0;e0){var l=this.tree,u=this.staticTree;for(s=(i=o.entries).length,t=0;t-1&&c>v&&(t.velocity.normalize().scale(v),c=v),t.speed=c},separate:function(t,e,i,s,n){if(!t.enable||!e.enable||t.checkCollision.none||e.checkCollision.none||!this.intersects(t,e))return!1;if(i&&!1===i.call(s,t.gameObject,e.gameObject))return!1;if(t.isCircle&&e.isCircle)return this.separateCircle(t,e,n);if(t.isCircle!==e.isCircle){var r=t.isCircle?e:t,a=t.isCircle?t:e,o={x:r.x,y:r.y,right:r.right,bottom:r.bottom},h=a.center;if((h.yo.bottom)&&(h.xo.right))return this.separateCircle(t,e,n)}var l=!1,u=!1;n?(l=A(t,e,n,this.OVERLAP_BIAS),u=_(t,e,n,this.OVERLAP_BIAS)):this.forceX||Math.abs(this.gravity.y+t.gravity.y)a.right&&(r=l(o.x,o.y,a.right,a.y)-o.radius):o.y>a.bottom&&(o.xa.right&&(r=l(o.x,o.y,a.right,a.bottom)-o.radius)),r*=-1}else r=t.halfWidth+e.halfWidth-l(t.center.x,t.center.y,e.center.x,e.center.y);if(t.overlapR=r,e.overlapR=r,i||0===r||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==r&&(t.onOverlap||e.onOverlap)&&this.emit(c.OVERLAP,t.gameObject,e.gameObject,t,e),0!==r;var h=t.center.x-e.center.x,u=t.center.y-e.center.y,d=Math.sqrt(Math.pow(h,2)+Math.pow(u,2)),f=(e.center.x-t.center.x)/d||0,p=(e.center.y-t.center.y)/d||0,m=2*(t.velocity.x*f+t.velocity.y*p-e.velocity.x*f-e.velocity.y*p)/(t.mass+e.mass);(t.immovable||e.immovable)&&(m*=2),t.immovable||(t.velocity.x=t.velocity.x-m/t.mass*f,t.velocity.y=t.velocity.y-m/t.mass*p),e.immovable||(e.velocity.x=e.velocity.x+m/e.mass*f,e.velocity.y=e.velocity.y+m/e.mass*p),t.immovable||e.immovable||(r/=2);var y=s(t.center,e.center),T=(r+x.EPSILON)*Math.cos(y),w=(r+x.EPSILON)*Math.sin(y);return t.immovable||(t.x-=T,t.y-=w,t.updateCenter()),e.immovable||(e.x+=T,e.y+=w,e.updateCenter()),t.velocity.x*=t.bounce.x,t.velocity.y*=t.bounce.y,e.velocity.x*=e.bounce.x,e.velocity.y*=e.bounce.y,(t.onCollide||e.onCollide)&&this.emit(c.COLLIDE,t.gameObject,e.gameObject,t,e),!0},intersects:function(t,e){return t!==e&&(t.isCircle||e.isCircle?t.isCircle?e.isCircle?l(t.center.x,t.center.y,e.center.x,e.center.y)<=t.halfWidth+e.halfWidth:this.circleBodyIntersects(t,e):this.circleBodyIntersects(e,t):!(t.right<=e.position.x||t.bottom<=e.position.y||t.position.x>=e.right||t.position.y>=e.bottom))},circleBodyIntersects:function(t,e){var i=r(t.center.x,e.left,e.right),s=r(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-s)*(t.center.y-s)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,s,n){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=i),this.collideObjects(t,e,i,s,n,!0)},collide:function(t,e,i,s,n){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=i),this.collideObjects(t,e,i,s,n,!1)},collideObjects:function(t,e,i,s,n,r){var a,o;!t.isParent||void 0!==t.physicsType&&void 0!==e&&t!==e||(t=t.children.entries),e&&e.isParent&&void 0===e.physicsType&&(e=e.children.entries);var h=Array.isArray(t),l=Array.isArray(e);if(this._total=0,h||l)if(!h&&l)for(a=0;a0},collideHandler:function(t,e,i,s,n,r){if(void 0===e&&t.isParent)return this.collideGroupVsGroup(t,t,i,s,n,r);if(!t||!e)return!1;if(t.body||t.isBody){if(e.body||e.isBody)return this.collideSpriteVsSprite(t,e,i,s,n,r);if(e.isParent)return this.collideSpriteVsGroup(t,e,i,s,n,r);if(e.isTilemap)return this.collideSpriteVsTilemapLayer(t,e,i,s,n,r)}else if(t.isParent){if(e.body||e.isBody)return this.collideSpriteVsGroup(e,t,i,s,n,r);if(e.isParent)return this.collideGroupVsGroup(t,e,i,s,n,r);if(e.isTilemap)return this.collideGroupVsTilemapLayer(t,e,i,s,n,r)}else if(t.isTilemap){if(e.body||e.isBody)return this.collideSpriteVsTilemapLayer(e,t,i,s,n,r);if(e.isParent)return this.collideGroupVsTilemapLayer(e,t,i,s,n,r)}},collideSpriteVsSprite:function(t,e,i,s,n,r){var a=t.isBody?t:t.body,o=e.isBody?e:e.body;return!(!a||!o)&&(this.separate(a,o,s,n,r)&&(i&&i.call(n,t,e),this._total++),!0)},collideSpriteVsGroup:function(t,e,i,s,n,r){var a,o,l,u=t.isBody?t:t.body;if(0!==e.length&&u&&u.enable&&!u.checkCollision.none)if(this.useTree||e.physicsType===h.STATIC_BODY){var c=this.treeMinMax;c.minX=u.left,c.minY=u.top,c.maxX=u.right,c.maxY=u.bottom;var d=e.physicsType===h.DYNAMIC_BODY?this.tree.search(c):this.staticTree.search(c);for(o=d.length,a=0;ac.baseTileWidth){var d=(c.tileWidth-c.baseTileWidth)*e.scaleX;o-=d,l+=d}c.tileHeight>c.baseTileHeight&&(u+=(c.tileHeight-c.baseTileHeight)*e.scaleY);var f=r?null:this.tileFilterOptions,p=m(o,h,l,u,f,e.scene.cameras.main,e.layer);return 0!==p.length&&this.collideSpriteVsTilesHandler(t,p,i,s,n,r,!0)},collideSpriteVsTilesHandler:function(t,e,i,s,n,r,a){for(var o,h,l=t.isBody?t:t.body,u={left:0,right:0,top:0,bottom:0},d=!1,f=0;f{t.exports={setAcceleration:function(t,e){return this.body.acceleration.set(t,e),this},setAccelerationX:function(t){return this.body.acceleration.x=t,this},setAccelerationY:function(t){return this.body.acceleration.y=t,this}}},29257:t=>{t.exports={setAngularVelocity:function(t){return this.body.angularVelocity=t,this},setAngularAcceleration:function(t){return this.body.angularAcceleration=t,this},setAngularDrag:function(t){return this.body.angularDrag=t,this}}},62122:t=>{t.exports={setBounce:function(t,e){return this.body.bounce.set(t,e),this},setBounceX:function(t){return this.body.bounce.x=t,this},setBounceY:function(t){return this.body.bounce.y=t,this},setCollideWorldBounds:function(t,e,i,s){return this.body.setCollideWorldBounds(t,e,i,s),this}}},99803:t=>{t.exports={setDebug:function(t,e,i){return this.debugShowBody=t,this.debugShowVelocity=e,this.debugBodyColor=i,this},setDebugBodyColor:function(t){return this.body.debugBodyColor=t,this},debugShowBody:{get:function(){return this.body.debugShowBody},set:function(t){this.body.debugShowBody=t}},debugShowVelocity:{get:function(){return this.body.debugShowVelocity},set:function(t){this.body.debugShowVelocity=t}},debugBodyColor:{get:function(){return this.body.debugBodyColor},set:function(t){this.body.debugBodyColor=t}}}},87145:t=>{t.exports={setDrag:function(t,e){return this.body.drag.set(t,e),this},setDragX:function(t){return this.body.drag.x=t,this},setDragY:function(t){return this.body.drag.y=t,this},setDamping:function(t){return this.body.useDamping=t,this}}},96174:t=>{var e={enableBody:function(t,e,i,s,n){return t&&this.body.reset(e,i),s&&(this.body.gameObject.active=!0),n&&(this.body.gameObject.visible=!0),this.body.enable=!0,this},disableBody:function(t,e){return void 0===t&&(t=!1),void 0===e&&(e=!1),this.body.stop(),this.body.enable=!1,t&&(this.body.gameObject.active=!1),e&&(this.body.gameObject.visible=!1),this},refreshBody:function(){return this.body.updateFromGameObject(),this}};t.exports=e},51702:t=>{t.exports={setFriction:function(t,e){return this.body.friction.set(t,e),this},setFrictionX:function(t){return this.body.friction.x=t,this},setFrictionY:function(t){return this.body.friction.y=t,this}}},25578:t=>{t.exports={setGravity:function(t,e){return this.body.gravity.set(t,e),this},setGravityX:function(t){return this.body.gravity.x=t,this},setGravityY:function(t){return this.body.gravity.y=t,this}}},72029:t=>{var e={setImmovable:function(t){return void 0===t&&(t=!0),this.body.immovable=t,this}};t.exports=e},34566:t=>{t.exports={setMass:function(t){return this.body.mass=t,this}}},2732:(t,e,i)=>{var s=i(15147),n=i(26673),r=i(22184),a=i(26535);t.exports=function(t,e,i,o,h,l){var u=s(t,e-o,i-o,2*o,2*o,h,l);if(0===u.length)return u;for(var c=new n(e,i,o),d=new n,f=[],p=0;p{t.exports=function(t,e,i,s,n,r,a){void 0===r&&(r=!0),void 0===a&&(a=!1);var o=[],h=[],l=t.treeMinMax;if(l.minX=e,l.minY=i,l.maxX=e+s,l.maxY=i+n,a&&(h=t.staticTree.search(l)),r&&t.useTree)o=t.tree.search(l);else if(r){var u=t.bodies,c={position:{x:e,y:i},left:e,top:i,right:e+s,bottom:i+n,isCircle:!1},d=t.intersects;u.iterate((function(t){d(t,c)&&o.push(t)}))}return h.concat(o)}},57527:t=>{var e={setPushable:function(t){return void 0===t&&(t=!0),this.body.pushable=t,this}};t.exports=e},77687:t=>{t.exports={setOffset:function(t,e){return this.body.setOffset(t,e),this},setSize:function(t,e,i){return this.body.setSize(t,e,i),this},setBodySize:function(t,e,i){return this.body.setSize(t,e,i),this},setCircle:function(t,e,i){return this.body.setCircle(t,e,i),this}}},66536:t=>{t.exports={setVelocity:function(t,e){return this.body.setVelocity(t,e),this},setVelocityX:function(t){return this.body.setVelocityX(t),this},setVelocityY:function(t){return this.body.setVelocityY(t),this},setMaxVelocity:function(t,e){return this.body.maxVelocity.set(t,e),this}}},7864:(t,e,i)=>{t.exports={Acceleration:i(5321),Angular:i(29257),Bounce:i(62122),Debug:i(99803),Drag:i(87145),Enable:i(96174),Friction:i(51702),Gravity:i(25578),Immovable:i(72029),Mass:i(34566),OverlapCirc:i(2732),OverlapRect:i(15147),Pushable:i(57527),Size:i(77687),Velocity:i(66536)}},47401:t=>{t.exports={DYNAMIC_BODY:0,STATIC_BODY:1,GROUP:2,TILEMAPLAYER:3,FACING_NONE:10,FACING_UP:11,FACING_DOWN:12,FACING_LEFT:13,FACING_RIGHT:14}},22346:t=>{t.exports="collide"},95092:t=>{t.exports="overlap"},15775:t=>{t.exports="pause"},74142:t=>{t.exports="resume"},22825:t=>{t.exports="tilecollide"},10851:t=>{t.exports="tileoverlap"},7543:t=>{t.exports="worldbounds"},1487:t=>{t.exports="worldstep"},27037:(t,e,i)=>{t.exports={COLLIDE:i(22346),OVERLAP:i(95092),PAUSE:i(15775),RESUME:i(74142),TILE_COLLIDE:i(22825),TILE_OVERLAP:i(10851),WORLD_BOUNDS:i(7543),WORLD_STEP:i(1487)}},39977:(t,e,i)=>{var s=i(47401),n=i(98611),r={ArcadePhysics:i(66150),Body:i(97602),Collider:i(3909),Components:i(7864),Events:i(27037),Factory:i(99523),GetOverlapX:i(75671),GetOverlapY:i(66185),SeparateX:i(61777),SeparateY:i(25299),Group:i(10481),Image:i(62832),Sprite:i(25084),StaticBody:i(66634),StaticGroup:i(46346),Tilemap:i(8413),World:i(85233)};r=n(!1,r,s),t.exports=r},25163:t=>{t.exports=function(t,e){return t.collisionCallback?!t.collisionCallback.call(t.collisionCallbackContext,e,t):!t.layer.callbacks[t.index]||!t.layer.callbacks[t.index].callback.call(t.layer.callbacks[t.index].callbackContext,e,t)}},98209:t=>{t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.left=!0):e>0&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=e,t.updateCenter(),0===t.bounce.x?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x}},72792:t=>{t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):e>0&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=e,t.updateCenter(),0===t.bounce.y?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y}},27354:(t,e,i)=>{var s=i(14405),n=i(52926),r=i(28808);t.exports=function(t,e,i,a,o,h,l){var u=a.left,c=a.top,d=a.right,f=a.bottom,p=i.faceLeft||i.faceRight,v=i.faceTop||i.faceBottom;if(l||(p=!0,v=!0),!p&&!v)return!1;var g=0,m=0,y=0,x=1;if(e.deltaAbsX()>e.deltaAbsY()?y=-1:e.deltaAbsX(){var s=i(98209);t.exports=function(t,e,i,n,r,a){var o=0,h=e.faceLeft,l=e.faceRight,u=e.collideLeft,c=e.collideRight;return a||(h=!0,l=!0,u=!0,c=!0),t.deltaX()<0&&c&&t.checkCollision.left?l&&t.x0&&u&&t.checkCollision.right&&h&&t.right>i&&(o=t.right-i)>r&&(o=0),0!==o&&(t.customSeparateX?t.overlapX=o:s(t,o)),o}},52926:(t,e,i)=>{var s=i(72792);t.exports=function(t,e,i,n,r,a){var o=0,h=e.faceTop,l=e.faceBottom,u=e.collideUp,c=e.collideDown;return a||(h=!0,l=!0,u=!0,c=!0),t.deltaY()<0&&c&&t.checkCollision.up?l&&t.y0&&u&&t.checkCollision.down&&h&&t.bottom>i&&(o=t.bottom-i)>r&&(o=0),0!==o&&(t.customSeparateY?t.overlapY=o:s(t,o)),o}},28808:t=>{t.exports=function(t,e){return!(e.right<=t.left||e.bottom<=t.top||e.position.x>=t.right||e.position.y>=t.bottom)}},8413:(t,e,i)=>{var s={ProcessTileCallbacks:i(25163),ProcessTileSeparationX:i(98209),ProcessTileSeparationY:i(72792),SeparateTile:i(27354),TileCheckX:i(14405),TileCheckY:i(52926),TileIntersectsBody:i(28808)};t.exports=s},88257:(t,e,i)=>{var s=new(i(56694))({initialize:function(t){this.pluginManager=t,this.game=t.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=s},18360:t=>{t.exports={Global:["game","anims","cache","plugins","registry","scale","sound","textures","renderer"],CoreScene:["EventEmitter","CameraManager","GameObjectCreator","GameObjectFactory","ScenePlugin","DisplayList","UpdateList"],DefaultScene:["Clock","DataManagerPlugin","InputPlugin","Loader","TweenManager","LightsPlugin"]}},91963:t=>{var e={},i={},s={register:function(t,i,s,n){void 0===n&&(n=!1),e[t]={plugin:i,mapping:s,custom:n}},registerCustom:function(t,e,s,n){i[t]={plugin:e,mapping:s,data:n}},hasCore:function(t){return e.hasOwnProperty(t)},hasCustom:function(t){return i.hasOwnProperty(t)},getCore:function(t){return e[t]},getCustom:function(t){return i[t]},getCustomClass:function(t){return i.hasOwnProperty(t)?i[t].plugin:null},remove:function(t){e.hasOwnProperty(t)&&delete e[t]},removeCustom:function(t){i.hasOwnProperty(t)&&delete i[t]},destroyCorePlugins:function(){for(var t in e)e.hasOwnProperty(t)&&delete e[t]},destroyCustomPlugins:function(){for(var t in i)i.hasOwnProperty(t)&&delete i[t]}};t.exports=s},49274:(t,e,i)=>{var s=i(56694),n=i(97081),r=i(6659),a=i(76846),o=i(99325),h=i(61286),l=i(72632),u=i(91963),c=i(66458),d=new s({Extends:r,initialize:function(t){r.call(this),this.game=t,this.plugins=[],this.scenePlugins=[],this._pendingGlobal=[],this._pendingScene=[],t.isBooted?this.boot():t.events.once(n.BOOT,this.boot,this)},boot:function(){var t,e,i,s,r,a,o,h=this.game.config,u=h.installGlobalPlugins;for(u=u.concat(this._pendingGlobal),t=0;t{var s=i(88257),n=i(56694),r=i(7599),a=new n({Extends:s,initialize:function(t,e,i){s.call(this,e),this.scene=t,this.systems=t.sys,this.pluginKey=i,t.sys.events.once(r.BOOT,this.boot,this)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=a},45615:(t,e,i)=>{t.exports={BasePlugin:i(88257),DefaultPlugins:i(18360),PluginCache:i(91963),PluginManager:i(49274),ScenePlugin:i(39283)}},95723:t=>{t.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,ERASE:17,SOURCE_IN:18,SOURCE_OUT:19,SOURCE_ATOP:20,DESTINATION_OVER:21,DESTINATION_IN:22,DESTINATION_OUT:23,DESTINATION_ATOP:24,LIGHTER:25,COPY:26,XOR:27}},27394:t=>{t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},91135:(t,e,i)=>{var s=i(89787),n=i(61840),r=i(56694),a=i(86459),o=i(6659),h=i(81044),l=i(32834),u=i(40444),c=i(38203),d=i(69360),f=new r({Extends:o,initialize:function(t){o.call(this);var e=t.config;this.config={clearBeforeRender:e.clearBeforeRender,backgroundColor:e.backgroundColor,antialias:e.antialias,roundPixels:e.roundPixels},this.game=t,this.type=a.CANVAS,this.drawCount=0,this.width=0,this.height=0,this.gameCanvas=t.canvas;var i={alpha:t.config.transparent,desynchronized:t.config.desynchronized,willReadFrequently:!1};this.gameContext=e.context?e.context:this.gameCanvas.getContext("2d",i),this.currentContext=this.gameContext,this.antialias=t.config.antialias,this.blendModes=l(),this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this._tempMatrix1=new d,this._tempMatrix2=new d,this._tempMatrix3=new d,this.isBooted=!1,this.init()},init:function(){this.game.textures.once(c.READY,this.boot,this)},boot:function(){var t=this.game,e=t.scale.baseSize;this.width=e.width,this.height=e.height,this.isBooted=!0,t.scale.on(u.RESIZE,this.onResize,this),this.resize(e.width,e.height)},onResize:function(t,e){e.width===this.width&&e.height===this.height||this.resize(e.width,e.height)},resize:function(t,e){this.width=t,this.height=e,this.emit(h.RESIZE,t,e)},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(t){return this.currentContext.globalCompositeOperation=t,this},setContext:function(t){return this.currentContext=t||this.gameContext,this},setAlpha:function(t){return this.currentContext.globalAlpha=t,this},preRender:function(){var t=this.gameContext,e=this.config,i=this.width,s=this.height;t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),e.clearBeforeRender&&(t.clearRect(0,0,i,s),e.transparent||(t.fillStyle=e.backgroundColor.rgba,t.fillRect(0,0,i,s))),t.save(),this.drawCount=0,this.emit(h.PRE_RENDER)},render:function(t,e,i){var n=e.length;this.emit(h.RENDER,t,i);var r=i.x,a=i.y,o=i.width,l=i.height,u=i.renderToTexture?i.context:t.sys.context;u.save(),this.game.scene.customViewports&&(u.beginPath(),u.rect(r,a,o,l),u.clip()),i.emit(s.PRE_RENDER,i),this.currentContext=u;var c=i.mask;c&&c.preRenderCanvas(this,null,i._maskCamera),i.transparent||(u.fillStyle=i.backgroundColor.rgba,u.fillRect(r,a,o,l)),u.globalAlpha=i.alpha,u.globalCompositeOperation="source-over",this.drawCount+=n,i.renderToTexture&&i.emit(s.PRE_RENDER,i),i.matrix.copyToContext(u);for(var d=0;d=0?m=-(m+c):m<0&&(m=Math.abs(m)-c)),t.flipY&&(y>=0?y=-(y+d):y<0&&(y=Math.abs(y)-d))}var T=1,w=1;t.flipX&&(f||(m+=-e.realWidth+2*v),T=-1),t.flipY&&(f||(y+=-e.realHeight+2*g),w=-1),o.applyITRS(t.x,t.y,t.rotation,t.scaleX*T,t.scaleY*w),a.copyFrom(i.matrix),s?(a.multiplyWithOffset(s,-i.scrollX*t.scrollFactorX,-i.scrollY*t.scrollFactorY),o.e=t.x,o.f=t.y):(o.e-=i.scrollX*t.scrollFactorX,o.f-=i.scrollY*t.scrollFactorY),a.multiply(o),i.roundPixels&&(a.e=Math.round(a.e),a.f=Math.round(a.f)),r.save(),a.setToContext(r),r.globalCompositeOperation=this.blendModes[t.blendMode],r.globalAlpha=n,r.imageSmoothingEnabled=!e.source.scaleMode,t.mask&&t.mask.preRenderCanvas(this,t,i),c>0&&d>0&&r.drawImage(e.source.image,l,u,c,d,m,y,c/p,d/p),t.mask&&t.mask.postRenderCanvas(this,t,i),r.restore()}},destroy:function(){this.removeAllListeners(),this.game=null,this.gameCanvas=null,this.gameContext=null}});t.exports=f},6046:(t,e,i)=>{t.exports={CanvasRenderer:i(91135),GetBlendModes:i(32834),SetTransform:i(49584)}},32834:(t,e,i)=>{var s=i(95723),n=i(98581);t.exports=function(){var t=[],e=n.supportNewBlendModes,i="source-over";return t[s.NORMAL]=i,t[s.ADD]="lighter",t[s.MULTIPLY]=e?"multiply":i,t[s.SCREEN]=e?"screen":i,t[s.OVERLAY]=e?"overlay":i,t[s.DARKEN]=e?"darken":i,t[s.LIGHTEN]=e?"lighten":i,t[s.COLOR_DODGE]=e?"color-dodge":i,t[s.COLOR_BURN]=e?"color-burn":i,t[s.HARD_LIGHT]=e?"hard-light":i,t[s.SOFT_LIGHT]=e?"soft-light":i,t[s.DIFFERENCE]=e?"difference":i,t[s.EXCLUSION]=e?"exclusion":i,t[s.HUE]=e?"hue":i,t[s.SATURATION]=e?"saturation":i,t[s.COLOR]=e?"color":i,t[s.LUMINOSITY]=e?"luminosity":i,t[s.ERASE]="destination-out",t[s.SOURCE_IN]="source-in",t[s.SOURCE_OUT]="source-out",t[s.SOURCE_ATOP]="source-atop",t[s.DESTINATION_OVER]="destination-over",t[s.DESTINATION_IN]="destination-in",t[s.DESTINATION_OUT]="destination-out",t[s.DESTINATION_ATOP]="destination-atop",t[s.LIGHTER]="lighter",t[s.COPY]="copy",t[s.XOR]="xor",t}},49584:(t,e,i)=>{var s=i(73329);t.exports=function(t,e,i,n,r){var a=n.alpha*i.alpha;if(a<=0)return!1;var o=s(i,n,r).calc;return e.globalCompositeOperation=t.blendModes[i.blendMode],e.globalAlpha=a,e.save(),o.setToContext(e),e.imageSmoothingEnabled=i.frame?!i.frame.source.scaleMode:t.antialias,!0}},70936:t=>{t.exports="postrender"},99298:t=>{t.exports="prerender"},7743:t=>{t.exports="render"},99519:t=>{t.exports="resize"},81044:(t,e,i)=>{t.exports={POST_RENDER:i(70936),PRE_RENDER:i(99298),RENDER:i(7743),RESIZE:i(99519)}},42069:(t,e,i)=>{t.exports={Canvas:i(6046),Events:i(81044),Snapshot:i(95528),WebGL:i(55478)}},61840:(t,e,i)=>{var s=i(61068),n=i(27119),r=i(72632);t.exports=function(t,e){var i=r(e,"callback"),a=r(e,"type","image/png"),o=r(e,"encoder",.92),h=Math.abs(Math.round(r(e,"x",0))),l=Math.abs(Math.round(r(e,"y",0))),u=Math.floor(r(e,"width",t.width)),c=Math.floor(r(e,"height",t.height));if(r(e,"getPixel",!1)){var d=t.getContext("2d").getImageData(h,l,1,1).data;i.call(null,new n(d[0],d[1],d[2],d[3]))}else if(0!==h||0!==l||u!==t.width||c!==t.height){var f=s.createWebGL(this,u,c),p=f.getContext("2d");u>0&&c>0&&p.drawImage(t,h,l,u,c,0,0,u,c);var v=new Image;v.onerror=function(){i.call(null),s.remove(f)},v.onload=function(){i.call(null,v),s.remove(f)},v.src=f.toDataURL(a,o)}else{var g=new Image;g.onerror=function(){i.call(null)},g.onload=function(){i.call(null,g)},g.src=t.toDataURL(a,o)}}},1217:(t,e,i)=>{var s=i(61068),n=i(27119),r=i(72632);t.exports=function(t,e){var i=t,a=r(e,"callback"),o=r(e,"type","image/png"),h=r(e,"encoder",.92),l=Math.abs(Math.round(r(e,"x",0))),u=Math.abs(Math.round(r(e,"y",0))),c=r(e,"getPixel",!1),d=r(e,"isFramebuffer",!1),f=d?r(e,"bufferWidth",1):i.drawingBufferWidth,p=d?r(e,"bufferHeight",1):i.drawingBufferHeight;if(c){var v=new Uint8Array(4),g=d?u:p-u;i.readPixels(l,g,1,1,i.RGBA,i.UNSIGNED_BYTE,v),a.call(null,new n(v[0],v[1],v[2],v[3]))}else{var m=Math.floor(r(e,"width",f)),y=Math.floor(r(e,"height",p)),x=new Uint8Array(m*y*4);i.readPixels(l,p-u-y,m,y,i.RGBA,i.UNSIGNED_BYTE,x);for(var T=s.createWebGL(this,m,y),w=T.getContext("2d"),E=w.getImageData(0,0,m,y),S=E.data,b=0;b{t.exports={Canvas:i(61840),WebGL:i(1217)}},35217:(t,e,i)=>{var s=i(56694),n=i(65641),r=i(33885),a=i(72632),o=i(37410),h=i(82127),l=i(5583),u=i(66901),c=i(77310),d=i(10919),f=i(21213),p=i(51212),v=i(60848),g=new s({initialize:function(t){this.game=t.game,this.renderer=t,this.classes=new r([[n.UTILITY_PIPELINE,v],[n.MULTI_PIPELINE,c],[n.BITMAPMASK_PIPELINE,l],[n.SINGLE_PIPELINE,p],[n.ROPE_PIPELINE,f],[n.LIGHT_PIPELINE,u],[n.POINTLIGHT_PIPELINE,d]]),this.postPipelineClasses=new r,this.pipelines=new r,this.current=null,this.previous=null,this.MULTI_PIPELINE=null,this.BITMAPMASK_PIPELINE=null,this.UTILITY_PIPELINE=null,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2,this.renderTargets=[],this.maxDimension=0,this.frameInc=32,this.targetIndex=0},boot:function(t){var e=this.renderer,i=this.renderTargets;this.frameInc=Math.floor(a(t,"frameInc",32));for(var s,r,h=e.width,l=e.height,u=Math.min(h,l),c=Math.ceil(u/this.frameInc),d=1;d=0;i--){var s=e[i];s.active&&s.preBatch(t)}}},postBatch:function(t){if(t.hasPostPipeline){this.flush();for(var e=t.postPipelines,i=0;i=0;i--){var s=e[i];s.active&&s.preBatch(t)}}},postBatchCamera:function(t){if(t.hasPostPipeline){this.flush();for(var e=t.postPipelines,i=0;ithis.maxDimension)return this.targetIndex=e.length-3,e[this.targetIndex];var i=3*(h(t,this.frameInc,0,!0)-1);return this.targetIndex=i,e[i]},getSwapRenderTarget:function(){return this.renderTargets[this.targetIndex+1]},getAltSwapRenderTarget:function(){return this.renderTargets[this.targetIndex+2]},destroy:function(){this.flush(),this.classes.clear(),this.postPipelineClasses.clear(),this.pipelines.clear(),this.renderer=null,this.game=null,this.classes=null,this.postPipelineClasses=null,this.pipelines=null,this.current=null,this.previous=null}});t.exports=g},37410:(t,e,i)=>{var s=i(56694),n=i(81044),r=new s({initialize:function(t,e,i,s,n,r,a){void 0===s&&(s=1),void 0===n&&(n=0),void 0===r&&(r=!0),void 0===a&&(a=!1),this.renderer=t,this.framebuffer=null,this.texture=null,this.width=0,this.height=0,this.scale=s,this.minFilter=n,this.autoClear=r,this.autoResize=!1,this.resize(e,i),a&&this.setAutoResize(!0)},setAutoResize:function(t){return t&&!this.autoResize?(this.renderer.on(n.RESIZE,this.resize,this),this.autoResize=!0):!t&&this.autoResize&&(this.renderer.off(n.RESIZE,this.resize,this),this.autoResize=!1),this},resize:function(t,e){var i=t*this.scale,s=e*this.scale;if(i!==this.width||s!==this.height){var n=this.renderer;n.deleteFramebuffer(this.framebuffer),n.deleteTexture(this.texture),t*=this.scale,e*=this.scale,(t=Math.round(t))<=0&&(t=1),(e=Math.round(e))<=0&&(e=1),this.texture=n.createTextureFromSource(null,t,e,this.minFilter,!0),this.framebuffer=n.createFramebuffer(t,e,this.texture,!1),this.width=t,this.height=e}return this},bind:function(t,e,i){if(void 0===t&&(t=!1),t&&this.renderer.flush(),e&&i&&this.resize(e,i),this.renderer.pushFramebuffer(this.framebuffer,!1,!1,!1),t&&this.adjustViewport(),this.autoClear){var s=this.renderer.gl;s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT)}},adjustViewport:function(){var t=this.renderer.gl;t.viewport(0,0,this.width,this.height),t.disable(t.SCISSOR_TEST)},clear:function(){var t=this.renderer,e=t.gl;t.pushFramebuffer(this.framebuffer),e.disable(e.SCISSOR_TEST),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),t.popFramebuffer(),t.resetScissor()},unbind:function(t){void 0===t&&(t=!1);var e=this.renderer;return t&&e.flush(),e.popFramebuffer()},destroy:function(){var t=this.renderer;t.deleteFramebuffer(this.framebuffer),t.deleteTexture(this.texture),t.off(n.RESIZE,this.resize,this),this.renderer=null,this.framebuffer=null,this.texture=null}});t.exports=r},75512:t=>{t.exports={getTintFromFloats:function(t,e,i,s){return((255&(255*s|0))<<24|(255&(255*t|0))<<16|(255&(255*e|0))<<8|255&(255*i|0))>>>0},getTintAppendFloatAlpha:function(t,e){return((255&(255*e|0))<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255&(255*e|0))<<24|(255&(0|t))<<16|(255&(t>>8|0))<<8|255&(t>>16|0))>>>0},getFloatsFromUintRGB:function(t){return[(255&(t>>16|0))/255,(255&(t>>8|0))/255,(255&(0|t))/255]},checkShaderMax:function(t,e){var i=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);return e&&-1!==e?Math.min(i,e):i},parseFragmentShaderMaxTextures:function(t,e){if(!t)return"";for(var i="vec4 getSampler (int index, vec2 uv) {",s=0;s0&&s{var s=i(56694),n=i(28699),r=i(6659),a=i(18970),o=i(72632),h=i(16650),l=i(81044),u=i(37410),c=i(75512),d=i(71305),f=new s({Extends:r,initialize:function(t){r.call(this);var e=t.game,i=e.renderer,s=i.gl;this.name=o(t,"name","WebGLPipeline"),this.game=e,this.renderer=i,this.manager,this.gl=s,this.view=e.canvas,this.width=0,this.height=0,this.vertexCount=0,this.vertexCapacity=0,this.vertexData,this.vertexBuffer,this.topology=o(t,"topology",s.TRIANGLES),this.bytes,this.vertexViewF32,this.vertexViewU32,this.active=!0,this.currentUnit=0,this.forceZero=o(t,"forceZero",!1),this.hasBooted=!1,this.isPostFX=!1,this.isSpriteFX=!1,this.renderTargets=[],this.currentRenderTarget,this.shaders=[],this.currentShader,this.projectionMatrix,this.projectionWidth=0,this.projectionHeight=0,this.config=t,this.glReset=!1},boot:function(){var t,e=this.gl,i=this.config,s=this.renderer;this.isPostFX||(this.projectionMatrix=(new h).identity());var n=this.renderTargets,r=o(i,"renderTarget",!1);"boolean"==typeof r&&r&&(r=1);var c=s.width,d=s.height;if("number"==typeof r)for(t=0;tx&&(x=y[t].vertexSize);var T=o(i,"batchSize",s.config.batchSize);this.vertexCapacity=6*T;var w=new ArrayBuffer(this.vertexCapacity*x);this.vertexData=w,this.bytes=new Uint8Array(w),this.vertexViewF32=new Float32Array(w),this.vertexViewU32=new Uint32Array(w);var E=o(i,"vertices",null);for(E?(this.vertexViewF32.set(E),this.vertexBuffer=s.createVertexBuffer(w,e.STATIC_DRAW)):this.vertexBuffer=s.createVertexBuffer(w.byteLength,e.DYNAMIC_DRAW),this.setVertexBuffer(),t=y.length-1;t>=0;t--)y[t].rebind();this.hasBooted=!0,s.on(l.RESIZE,this.resize,this),s.on(l.PRE_RENDER,this.onPreRender,this),s.on(l.RENDER,this.onRender,this),s.on(l.POST_RENDER,this.onPostRender,this),this.emit(a.BOOT,this),this.onBoot()},onBoot:function(){},onResize:function(){},setShader:function(t,e,i){var s=this.renderer;t===this.currentShader&&s.currentProgram===this.currentShader.program||(this.flush(),s.resetTextures(),this.setVertexBuffer(i)&&!e&&(e=!0),t.bind(e,!1),this.currentShader=t);return this},getShaderByName:function(t){for(var e=this.shaders,i=0;ithis.vertexCapacity},resize:function(t,e){t===this.width&&e===this.height||this.flush(),this.width=t,this.height=e;for(var i=this.renderTargets,s=0;s=0;i--){var s=e[i].rebind();t&&s!==t||(this.currentShader=s)}return this.emit(a.REBIND,this.currentShader),this.onActive(this.currentShader),this.onRebind(),this.glReset=!1,this},setVertexBuffer:function(t){void 0===t&&(t=this.vertexBuffer);var e=this.gl;return e.getParameter(e.ARRAY_BUFFER_BINDING)!==t&&(e.bindBuffer(e.ARRAY_BUFFER,t),!0)},preBatch:function(t){return this.currentRenderTarget&&this.currentRenderTarget.bind(),this.onPreBatch(t),this},postBatch:function(t){return this.onDraw(this.currentRenderTarget),this.onPostBatch(t),this},onDraw:function(){},unbind:function(){this.currentRenderTarget&&this.currentRenderTarget.unbind()},flush:function(t){if(void 0===t&&(t=!1),this.vertexCount>0){this.emit(a.BEFORE_FLUSH,this,t),this.onBeforeFlush(t);var e=this.gl,i=this.vertexCount,s=this.currentShader.vertexSize;this.active&&(this.setVertexBuffer(),i===this.vertexCapacity?e.bufferData(e.ARRAY_BUFFER,this.vertexData,e.DYNAMIC_DRAW):e.bufferSubData(e.ARRAY_BUFFER,0,this.bytes.subarray(0,i*s)),e.drawArrays(this.topology,0,i)),this.vertexCount=0,this.emit(a.AFTER_FLUSH,this,t),this.onAfterFlush(t)}return this},onActive:function(){},onBind:function(){},onRebind:function(){},onBatch:function(){},onPreBatch:function(){},onPostBatch:function(){},onPreRender:function(){},onRender:function(){},onPostRender:function(){},onBeforeFlush:function(){},onAfterFlush:function(){},batchVert:function(t,e,i,s,n,r,a){var o=this.vertexViewF32,h=this.vertexViewU32,l=this.vertexCount*this.currentShader.vertexComponentCount-1;o[++l]=t,o[++l]=e,o[++l]=i,o[++l]=s,o[++l]=n,o[++l]=r,h[++l]=a,this.vertexCount++},batchQuad:function(t,e,i,s,n,r,a,o,h,l,u,c,d,f,p,v,g,m,y,x){void 0===x&&(x=this.currentUnit);var T=!1;return this.shouldFlush(6)&&(this.flush(),T=!0,x=this.setTexture2D(y)),this.batchVert(e,i,l,u,x,m,f),this.batchVert(s,n,l,d,x,m,v),this.batchVert(r,a,c,d,x,m,g),this.batchVert(e,i,l,u,x,m,f),this.batchVert(r,a,c,d,x,m,g),this.batchVert(o,h,c,u,x,m,p),this.onBatch(t),T},batchTri:function(t,e,i,s,n,r,a,o,h,l,u,c,d,f,p,v,g){void 0===g&&(g=this.currentUnit);var m=!1;return this.shouldFlush(3)&&(this.flush(),m=!0,g=this.setTexture2D(v)),this.batchVert(e,i,o,h,g,p,c),this.batchVert(s,n,o,u,g,p,d),this.batchVert(r,a,l,u,g,p,f),this.onBatch(t),m},drawFillRect:function(t,e,i,s,n,r,a,o){void 0===a&&(a=this.renderer.whiteTexture.glTexture),void 0===o&&(o=!0),t=Math.floor(t),e=Math.floor(e);var h=Math.floor(t+i),l=Math.floor(e+s),u=this.setTexture2D(a),d=c.getTintAppendFloatAlphaAndSwap(n,r),f=0,p=1;o&&(f=1,p=0),this.batchQuad(null,t,e,t,l,h,l,h,e,0,f,1,p,d,d,d,d,0,a,u)},setTexture2D:function(t){return void 0===t&&(t=this.renderer.whiteTexture.glTexture),this.currentUnit=this.renderer.setTexture2D(t),this.currentUnit},bindTexture:function(t,e){void 0===e&&(e=0);var i=this.gl;return i.activeTexture(i.TEXTURE0+e),i.bindTexture(i.TEXTURE_2D,t),this},bindRenderTarget:function(t,e){return this.bindTexture(t.texture,e)},setTime:function(t){return this.set1f(t,this.game.loop.getDuration()),this},setBoolean:function(t,e,i){return void 0===i&&(i=this.currentShader),i.setBoolean(t,e),this},set1f:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set1f(t,e),this},set2f:function(t,e,i,s){return void 0===s&&(s=this.currentShader),s.set2f(t,e,i),this},set3f:function(t,e,i,s,n){return void 0===n&&(n=this.currentShader),n.set3f(t,e,i,s),this},set4f:function(t,e,i,s,n,r){return void 0===r&&(r=this.currentShader),r.set4f(t,e,i,s,n),this},set1fv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set1fv(t,e),this},set2fv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set2fv(t,e),this},set3fv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set3fv(t,e),this},set4fv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set4fv(t,e),this},set1iv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set1iv(t,e),this},set2iv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set2iv(t,e),this},set3iv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set3iv(t,e),this},set4iv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set4iv(t,e),this},set1i:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set1i(t,e),this},set2i:function(t,e,i,s){return void 0===s&&(s=this.currentShader),s.set2i(t,e,i),this},set3i:function(t,e,i,s,n){return void 0===n&&(n=this.currentShader),n.set3i(t,e,i,s),this},set4i:function(t,e,i,s,n,r){return void 0===r&&(r=this.currentShader),r.set4i(t,e,i,s,n),this},setMatrix2fv:function(t,e,i,s){return void 0===s&&(s=this.currentShader),s.setMatrix2fv(t,e,i),this},setMatrix3fv:function(t,e,i,s){return void 0===s&&(s=this.currentShader),s.setMatrix3fv(t,e,i),this},setMatrix4fv:function(t,e,i,s){return void 0===s&&(s=this.currentShader),s.setMatrix4fv(t,e,i),this},destroy:function(){var t;this.emit(a.DESTROY,this);var e=this.shaders;for(t=0;t{var s=i(66458),n=i(89787),r=i(56694),a=i(86459),o=i(6659),h=i(81044),l=i(97081),u=i(28621),c=i(16650),d=i(72283),f=i(35217),p=i(37410),v=i(40444),g=i(38203),m=i(75512),y=i(1217),x=new r({Extends:o,initialize:function(t){o.call(this);var e=t.config,i={alpha:e.transparent,desynchronized:e.desynchronized,depth:!1,antialias:e.antialiasGL,premultipliedAlpha:e.premultipliedAlpha,stencil:!0,failIfMajorPerformanceCaveat:e.failIfMajorPerformanceCaveat,powerPreference:e.powerPreference,preserveDrawingBuffer:e.preserveDrawingBuffer,willReadFrequently:!1};this.config={clearBeforeRender:e.clearBeforeRender,antialias:e.antialias,backgroundColor:e.backgroundColor,contextCreation:i,roundPixels:e.roundPixels,maxTextures:e.maxTextures,maxTextureSize:e.maxTextureSize,batchSize:e.batchSize,maxLights:e.maxLights,mipmapFilter:e.mipmapFilter},this.game=t,this.type=a.WEBGL,this.pipelines=null,this.width=0,this.height=0,this.canvas=t.canvas,this.blendModes=[],this.contextLost=!1,this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92,isFramebuffer:!1,bufferWidth:0,bufferHeight:0},this.currentActiveTexture=0,this.startActiveTexture=0,this.maxTextures=0,this.textureIndexes,this.tempTextures,this.textureZero,this.normalTexture,this.currentFramebuffer=null,this.fboStack=[],this.currentProgram=null,this.currentBlendMode=1/0,this.currentScissorEnabled=!1,this.currentScissor=null,this.scissorStack=[],this.contextLostHandler=d,this.contextRestoredHandler=d,this.gl=null,this.supportedExtensions=null,this.instancedArraysExtension=null,this.vaoExtension=null,this.extensions={},this.glFormats=[],this.compression,this.drawingBufferHeight=0,this.blankTexture=null,this.whiteTexture=null,this.maskCount=0,this.maskStack=[],this.currentMask={mask:null,camera:null},this.currentCameraMask={mask:null,camera:null},this.glFuncMap=null,this.currentType="",this.newType=!1,this.nextTypeMatch=!1,this.finalType=!1,this.mipmapFilter=null,this.textureFlush=0,this.isTextureClean=!1,this.defaultScissor=[0,0,0,0],this.isBooted=!1,this.renderTarget=null,this.projectionMatrix,this.projectionWidth=0,this.projectionHeight=0,this.init(this.config)},init:function(t){var e,i=this.game,s=this.canvas,n=t.backgroundColor;if(!(e=i.config.context?i.config.context:s.getContext("webgl",t.contextCreation)||s.getContext("experimental-webgl",t.contextCreation))||e.isContextLost())throw this.contextLost=!0,new Error("WebGL unsupported");this.gl=e;var r=this;this.contextLostHandler=function(t){r.contextLost=!0,r.game.events.emit(l.CONTEXT_LOST,r),t.preventDefault()},this.contextRestoredHandler=function(){r.contextLost=!1,r.init(r.config),r.game.events.emit(l.CONTEXT_RESTORED,r)},s.addEventListener("webglcontextlost",this.contextLostHandler,!1),s.addEventListener("webglcontextrestored",this.contextRestoredHandler,!1),i.context=e;for(var o=0;o<=27;o++)this.blendModes.push({func:[e.ONE,e.ONE_MINUS_SRC_ALPHA],equation:e.FUNC_ADD});this.blendModes[1].func=[e.ONE,e.DST_ALPHA],this.blendModes[2].func=[e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA],this.blendModes[3].func=[e.ONE,e.ONE_MINUS_SRC_COLOR],this.blendModes[17]={func:[e.ZERO,e.ONE_MINUS_SRC_ALPHA],equation:e.FUNC_REVERSE_SUBTRACT},this.glFormats[0]=e.BYTE,this.glFormats[1]=e.SHORT,this.glFormats[2]=e.UNSIGNED_BYTE,this.glFormats[3]=e.UNSIGNED_SHORT,this.glFormats[4]=e.FLOAT,this.glFuncMap={mat2:{func:e.uniformMatrix2fv,length:1,matrix:!0},mat3:{func:e.uniformMatrix3fv,length:1,matrix:!0},mat4:{func:e.uniformMatrix4fv,length:1,matrix:!0},"1f":{func:e.uniform1f,length:1},"1fv":{func:e.uniform1fv,length:1},"1i":{func:e.uniform1i,length:1},"1iv":{func:e.uniform1iv,length:1},"2f":{func:e.uniform2f,length:2},"2fv":{func:e.uniform2fv,length:1},"2i":{func:e.uniform2i,length:2},"2iv":{func:e.uniform2iv,length:1},"3f":{func:e.uniform3f,length:3},"3fv":{func:e.uniform3fv,length:1},"3i":{func:e.uniform3i,length:3},"3iv":{func:e.uniform3iv,length:1},"4f":{func:e.uniform4f,length:4},"4fv":{func:e.uniform4fv,length:1},"4i":{func:e.uniform4i,length:4},"4iv":{func:e.uniform4iv,length:1}};var h=e.getSupportedExtensions();t.maxTextures&&-1!==t.maxTextures||(t.maxTextures=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),t.maxTextureSize||(t.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE)),this.compression=this.getCompressedTextures(),this.supportedExtensions=h;var u="ANGLE_instanced_arrays";this.instancedArraysExtension=h.indexOf(u)>-1?e.getExtension(u):null;var d="OES_vertex_array_object";this.vaoExtension=h.indexOf(d)>-1?e.getExtension(d):null,e.disable(e.DEPTH_TEST),e.disable(e.CULL_FACE),e.enable(e.BLEND),e.clearColor(n.redGL,n.greenGL,n.blueGL,n.alphaGL),this.mipmapFilter=e[t.mipmapFilter],this.maxTextures=m.checkShaderMax(e,t.maxTextures),this.textureIndexes=[];var p=this.tempTextures;if(Array.isArray(p))for(var v=0;o0&&s>0;if(a&&o){var h=a[0],l=a[1],u=a[2],c=a[3];o=h!==t||l!==e||u!==i||c!==s}o&&(this.flush(),r.scissor(t,n-e-s,i,s))},resetScissor:function(){var t=this.gl;t.enable(t.SCISSOR_TEST);var e=this.currentScissor;if(e){var i=e[0],s=e[1],n=e[2],r=e[3];n>0&&r>0&&t.scissor(i,this.drawingBufferHeight-s-r,n,r)}},popScissor:function(){var t=this.scissorStack;t.pop();var e=t[t.length-1];e&&this.setScissor(e[0],e[1],e[2],e[3]),this.currentScissor=e},hasActiveStencilMask:function(){var t=this.currentMask.mask,e=this.currentCameraMask.mask;return t&&t.isStencil||e&&e.isStencil},resetViewport:function(){var t=this.gl;t.viewport(0,0,this.width,this.height),this.drawingBufferHeight=t.drawingBufferHeight},setBlendMode:function(t,e){void 0===e&&(e=!1);var i=this.gl,s=this.blendModes[t];return!!(e||t!==a.BlendModes.SKIP_CHECK&&this.currentBlendMode!==t)&&(this.flush(),i.enable(i.BLEND),i.blendEquation(s.equation),s.func.length>2?i.blendFuncSeparate(s.func[0],s.func[1],s.func[2],s.func[3]):i.blendFunc(s.func[0],s.func[1]),this.currentBlendMode=t,!0)},addBlendMode:function(t,e){return this.blendModes.push({func:t,equation:e})-1},updateBlendMode:function(t,e,i){return this.blendModes[t]&&(this.blendModes[t].func=e,i&&(this.blendModes[t].equation=i)),this},removeBlendMode:function(t){return t>17&&this.blendModes[t]&&this.blendModes.splice(t,1),this},setBlankTexture:function(){this.setTexture2D(this.blankTexture.glTexture)},setTextureSource:function(t){if(this.pipelines.forceZero())return this.setTextureZero(t.glTexture,!0),0;var e=this.gl,i=this.currentActiveTexture;return t.glIndexCounter0)&&this.pipelines.setMulti().drawFillRect(e,i,s,r,m.getTintFromFloats(a.blueGL,a.greenGL,a.redGL,1),a.alphaGL)},getCurrentStencilMask:function(){var t=null,e=this.maskStack,i=this.currentCameraMask;return e.length>0?t=e[e.length-1]:i.mask&&i.mask.isStencil&&(t=i),t},postRenderCamera:function(t){var e=t.flashEffect,i=t.fadeEffect;if(e.isRunning||i.isRunning||i.isComplete){var s=this.pipelines.setMulti();e.postRenderWebGL(s,m.getTintFromFloats),i.postRenderWebGL(s,m.getTintFromFloats)}t.dirty=!1,this.popScissor(),t.mask&&(this.currentCameraMask.mask=null,t.mask.postRenderWebGL(this,t._maskCamera)),this.pipelines.postBatchCamera(t),t.emit(n.POST_RENDER,t)},preRender:function(){if(!this.contextLost){var t=this.gl;if(t.bindFramebuffer(t.FRAMEBUFFER,null),this.config.clearBeforeRender){var e=this.config.backgroundColor;t.clearColor(e.redGL,e.greenGL,e.blueGL,e.alphaGL),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT|t.STENCIL_BUFFER_BIT)}t.enable(t.SCISSOR_TEST),this.currentScissor=this.defaultScissor,this.scissorStack.length=0,this.scissorStack.push(this.currentScissor),this.game.scene.customViewports&&t.scissor(0,this.drawingBufferHeight-this.height,this.width,this.height),this.currentMask.mask=null,this.currentCameraMask.mask=null,this.maskStack.length=0,this.textureFlush=0,this.emit(h.PRE_RENDER)}},render:function(t,e,i){if(!this.contextLost){var s=e.length;if(this.emit(h.RENDER,t,i),this.preRenderCamera(i),0===s)return this.setBlendMode(a.BlendModes.NORMAL),void this.postRenderCamera(i);this.currentType="";for(var n=this.currentMask,r=0;r0&&(this.startActiveTexture++,this.currentActiveTexture=1)}},snapshot:function(t,e,i){return this.snapshotArea(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight,t,e,i)},snapshotArea:function(t,e,i,s,n,r,a){var o=this.snapshotState;return o.callback=n,o.type=r,o.encoder=a,o.getPixel=!1,o.x=t,o.y=e,o.width=Math.min(i,this.gl.drawingBufferWidth),o.height=Math.min(s,this.gl.drawingBufferHeight),this},snapshotPixel:function(t,e,i){return this.snapshotArea(t,e,1,1,i),this.snapshotState.getPixel=!0,this},snapshotFramebuffer:function(t,e,i,s,n,r,a,o,h,l,u){void 0===n&&(n=!1),void 0===r&&(r=0),void 0===a&&(a=0),void 0===o&&(o=e),void 0===h&&(h=i);var c=this.currentFramebuffer;this.snapshotArea(r,a,o,h,s,l,u);var d=this.snapshotState;return d.getPixel=n,d.isFramebuffer=!0,d.bufferWidth=e,d.bufferHeight=i,this.setFramebuffer(t),y(this.gl,d),this.setFramebuffer(c),d.callback=null,d.isFramebuffer=!1,this},canvasToTexture:function(t,e,i,s){return void 0===i&&(i=!1),void 0===s&&(s=!1),e?this.updateCanvasTexture(t,e,s):this.createCanvasTexture(t,i,s)},createCanvasTexture:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var s=this.gl,n=s.NEAREST,r=s.NEAREST,a=t.width,o=t.height,h=s.CLAMP_TO_EDGE,l=u(a,o);return!e&&l&&(h=s.REPEAT),this.config.antialias&&(n=l?this.mipmapFilter:s.LINEAR,r=s.LINEAR),this.createTexture2D(0,n,r,h,h,s.RGBA,t,a,o,!0,!1,i)},updateCanvasTexture:function(t,e,i){void 0===i&&(i=!1);var s=this.gl,n=t.width,r=t.height;if(n>0&&r>0){s.activeTexture(s.TEXTURE0);var a=s.getParameter(s.TEXTURE_BINDING_2D);s.bindTexture(s.TEXTURE_2D,e),i&&s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!0),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,s.RGBA,s.UNSIGNED_BYTE,t),e.width=n,e.height=r,a&&s.bindTexture(s.TEXTURE_2D,a)}return e},createVideoTexture:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var s=this.gl,n=s.NEAREST,r=s.NEAREST,a=t.videoWidth,o=t.videoHeight,h=s.CLAMP_TO_EDGE,l=u(a,o);return!e&&l&&(h=s.REPEAT),this.config.antialias&&(n=l?this.mipmapFilter:s.LINEAR,r=s.LINEAR),this.createTexture2D(0,n,r,h,h,s.RGBA,t,a,o,!0,!0,i)},updateVideoTexture:function(t,e,i){void 0===i&&(i=!1);var s=this.gl,n=t.videoWidth,r=t.videoHeight;if(n>0&&r>0){s.activeTexture(s.TEXTURE0);var a=s.getParameter(s.TEXTURE_BINDING_2D);s.bindTexture(s.TEXTURE_2D,e),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,i),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,s.RGBA,s.UNSIGNED_BYTE,t),e.width=n,e.height=r,a&&s.bindTexture(s.TEXTURE_2D,a)}return e},setTextureFilter:function(t,e){var i=this.gl,s=[i.LINEAR,i.NEAREST][e];i.activeTexture(i.TEXTURE0);var n=i.getParameter(i.TEXTURE_BINDING_2D);return i.bindTexture(i.TEXTURE_2D,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,s),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,s),n&&i.bindTexture(i.TEXTURE_2D,n),this},getMaxTextureSize:function(){return this.config.maxTextureSize},destroy:function(){this.canvas.removeEventListener("webglcontextlost",this.contextLostHandler,!1),this.canvas.removeEventListener("webglcontextrestored",this.contextRestoredHandler,!1);for(var t=this.gl,e=this.tempTextures,i=0;i{var s=i(56694),n=i(72632),r=i(71402),a=new s({initialize:function(t,e,i,s,n){this.pipeline=t,this.name=e,this.renderer=t.renderer,this.gl=this.renderer.gl,this.fragSrc=s,this.vertSrc=i,this.program=this.renderer.createProgram(i,s),this.attributes,this.vertexComponentCount=0,this.vertexSize=0,this.uniforms={},this.createAttributes(n),this.createUniforms()},createAttributes:function(t){var e=0,i=0,s=[];this.vertexComponentCount=0;for(var a=0;a=0?(e.enableVertexAttribArray(f),e.vertexAttribPointer(f,o,h,d,i,l),a.enabled=!0,a.location=f):-1!==f&&e.disableVertexAttribArray(f)}else u?e.vertexAttribPointer(c,o,h,d,i,l):!u&&c>-1&&(e.disableVertexAttribArray(c),a.location=-1)}return this},createUniforms:function(){var t,e,i,s=this.gl,n=this.program,r=this.uniforms,a=s.getProgramParameter(n,s.ACTIVE_UNIFORMS);for(t=0;t0&&(e=e.substr(0,h),r.hasOwnProperty(e)||null!==(i=s.getUniformLocation(n,e))&&(r[e]={name:e,location:i,value1:null,value2:null,value3:null,value4:null}))}}return this},hasUniform:function(t){return this.uniforms.hasOwnProperty(t)},resetUniform:function(t){var e=this.uniforms[t];return e&&(e.value1=null,e.value2=null,e.value3=null,e.value4=null),this},setUniform1:function(t,e,i,s){var n=this.uniforms[e];return n?((s||n.value1!==i)&&(n.value1=i,this.renderer.setProgram(this.program),t.call(this.gl,n.location,i),this.pipeline.currentShader=this),this):this},setUniform2:function(t,e,i,s,n){var r=this.uniforms[e];return r?((n||r.value1!==i||r.value2!==s)&&(r.value1=i,r.value2=s,this.renderer.setProgram(this.program),t.call(this.gl,r.location,i,s),this.pipeline.currentShader=this),this):this},setUniform3:function(t,e,i,s,n,r){var a=this.uniforms[e];return a?((r||a.value1!==i||a.value2!==s||a.value3!==n)&&(a.value1=i,a.value2=s,a.value3=n,this.renderer.setProgram(this.program),t.call(this.gl,a.location,i,s,n),this.pipeline.currentShader=this),this):this},setUniform4:function(t,e,i,s,n,r,a){var o=this.uniforms[e];return o?((a||o.value1!==i||o.value2!==s||o.value3!==n||o.value4!==r)&&(o.value1=i,o.value2=s,o.value3=n,o.value4=r,this.renderer.setProgram(this.program),t.call(this.gl,o.location,i,s,n,r),this.pipeline.currentShader=this),this):this},setBoolean:function(t,e){return this.setUniform1(this.gl.uniform1i,t,Number(e))},set1f:function(t,e){return this.setUniform1(this.gl.uniform1f,t,e)},set2f:function(t,e,i){return this.setUniform2(this.gl.uniform2f,t,e,i)},set3f:function(t,e,i,s){return this.setUniform3(this.gl.uniform3f,t,e,i,s)},set4f:function(t,e,i,s,n){return this.setUniform4(this.gl.uniform4f,t,e,i,s,n)},set1fv:function(t,e){return this.setUniform1(this.gl.uniform1fv,t,e,!0)},set2fv:function(t,e){return this.setUniform1(this.gl.uniform2fv,t,e,!0)},set3fv:function(t,e){return this.setUniform1(this.gl.uniform3fv,t,e,!0)},set4fv:function(t,e){return this.setUniform1(this.gl.uniform4fv,t,e,!0)},set1iv:function(t,e){return this.setUniform1(this.gl.uniform1iv,t,e,!0)},set2iv:function(t,e){return this.setUniform1(this.gl.uniform2iv,t,e,!0)},set3iv:function(t,e){return this.setUniform1(this.gl.uniform3iv,t,e,!0)},set4iv:function(t,e){return this.setUniform1(this.gl.uniform4iv,t,e,!0)},set1i:function(t,e){return this.setUniform1(this.gl.uniform1i,t,e)},set2i:function(t,e,i){return this.setUniform2(this.gl.uniform2i,t,e,i)},set3i:function(t,e,i,s){return this.setUniform3(this.gl.uniform3i,t,e,i,s)},set4i:function(t,e,i,s,n){return this.setUniform4(this.gl.uniform4i,t,e,i,s,n)},setMatrix2fv:function(t,e,i){return this.setUniform2(this.gl.uniformMatrix2fv,t,e,i,!0)},setMatrix3fv:function(t,e,i){return this.setUniform2(this.gl.uniformMatrix3fv,t,e,i,!0)},setMatrix4fv:function(t,e,i){return this.setUniform2(this.gl.uniformMatrix4fv,t,e,i,!0)},createProgram:function(t,e){void 0===t&&(t=this.vertSrc),void 0===e&&(e=this.fragSrc);var i=this.gl;return this.program&&i.deleteProgram(this.program),this.vertSrc=t,this.fragSrc=e,this.program=this.renderer.createProgram(t,e),this.createUniforms(),this.rebind()},destroy:function(){this.gl.deleteProgram(this.program),this.pipeline=null,this.renderer=null,this.gl=null,this.program=null,this.attributes=null,this.uniforms=null}});t.exports=a},71402:t=>{t.exports={BYTE:{enum:5120,size:1},UNSIGNED_BYTE:{enum:5121,size:1},SHORT:{enum:5122,size:2},UNSIGNED_SHORT:{enum:5123,size:2},INT:{enum:5124,size:4},UNSIGNED_INT:{enum:5125,size:4},FLOAT:{enum:5126,size:4}}},55478:(t,e,i)=>{var s=i(71402),n=i(98611),r={PipelineManager:i(35217),Pipelines:i(62253),RenderTarget:i(37410),Utils:i(75512),WebGLPipeline:i(44775),WebGLRenderer:i(11857),WebGLShader:i(71305)};r=n(!1,r,s),t.exports=r},5583:(t,e,i)=>{var s=i(56694),n=i(72632),r=i(91679),a=i(89053),o=i(71402),h=i(44775),l=new s({Extends:h,initialize:function(t){t.fragShader=n(t,"fragShader",r),t.vertShader=n(t,"vertShader",a),t.batchSize=n(t,"batchSize",1),t.vertices=n(t,"vertices",[-1,1,-1,-7,7,1]),t.attributes=n(t,"attributes",[{name:"inPosition",size:2,type:o.FLOAT}]),h.call(this,t)},boot:function(){h.prototype.boot.call(this),this.set1i("uMainSampler",0),this.set1i("uMaskSampler",1)},resize:function(t,e){h.prototype.resize.call(this,t,e),this.set2f("uResolution",t,e)},beginMask:function(t,e,i){var s=this.gl;if(t.bitmapMask&&s){var n=this.renderer;n.flush(),n.pushFramebuffer(t.mainFramebuffer),s.disable(s.STENCIL_TEST),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT),n.currentCameraMask.mask!==t&&(n.currentMask.mask=t,n.currentMask.camera=i)}},endMask:function(t,e){var i=this.gl,s=this.renderer,n=t.bitmapMask;if(n&&i){s.flush(),s.pushFramebuffer(t.maskFramebuffer),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),s.setBlendMode(0,!0),n.renderWebGL(s,n,e),s.flush(),s.popFramebuffer(),s.popFramebuffer();var r=s.getCurrentStencilMask();r?(i.enable(i.STENCIL_TEST),r.mask.applyStencil(s,r.camera,!0)):s.currentMask.mask=null,s.pipelines.set(this),i.activeTexture(i.TEXTURE1),i.bindTexture(i.TEXTURE_2D,t.maskTexture),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,t.mainTexture),this.set1i("uInvertMaskAlpha",t.invertAlpha),i.drawArrays(this.topology,0,3),s.resetTextures()}}});t.exports=l},66901:(t,e,i)=>{var s=i(56694),n=i(72632),r=i(65045),a=i(77310),o=i(93736),h=i(44775),l=10,u=new o,c=new s({Extends:a,initialize:function(t){l=t.game.renderer.config.maxLights;for(var e=n(t,"fragShader",r),i=[],s=1;s<=l;s++)i.push({name:"lights"+s,fragShader:e.replace("%LIGHT_COUNT%",s.toString())});t.shaders=i,a.call(this,t),this.inverseRotationMatrix=new Float32Array([1,0,0,0,1,0,0,0,1]),this.defaultNormalMap,this.lightsActive=!0},boot:function(){h.prototype.boot.call(this);var t=this.gl,e=t.createTexture();t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,e),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array([127,127,255,255])),this.defaultNormalMap={glTexture:e};for(var i=0;i0&&this.flush();var e=this.inverseRotationMatrix;if(t){var i=-t,s=Math.cos(i),n=Math.sin(i);e[1]=n,e[3]=-n,e[0]=e[4]=s}else e[0]=e[4]=1,e[1]=e[3]=0;this.setMatrix3fv("uInverseRotationMatrix",!1,e),this.currentNormalMapRotation=t}},setTexture2D:function(t,e){var i=this.renderer;void 0===t&&(t=i.tempTextures[0]);var s=this.getNormalMap(e);i.isNewNormalMap(t,s)&&(this.flush(),i.setTextureZero(t),i.setNormalMap(s));var n=e?e.rotation:0;return this.setNormalMapRotation(n),this.currentUnit=0,0},setGameObject:function(t,e){void 0===e&&(e=t.frame);var i=this.renderer,s=e.glTexture,n=this.getNormalMap(t);return i.isNewNormalMap()&&(this.flush(),i.setTextureZero(s),i.setNormalMap(n)),this.setNormalMapRotation(t.rotation),this.currentUnit=0,0},getNormalMap:function(t){var e;return t?t.displayTexture?e=t.displayTexture.dataSource[t.displayFrame.sourceIndex]:t.texture?e=t.texture.dataSource[t.frame.sourceIndex]:t.tileset&&(e=Array.isArray(t.tileset)?t.tileset[0].image.dataSource[0]:t.tileset.image.dataSource[0]):e=this.defaultNormalMap,e||(e=this.defaultNormalMap),e.glTexture},batchSprite:function(t,e,i){this.lightsActive&&a.prototype.batchSprite.call(this,t,e,i)},batchTexture:function(t,e,i,s,n,r,o,h,l,u,c,d,f,p,v,g,m,y,x,T,w,E,S,b,A,_,C,R,M,P,O,L){this.lightsActive&&a.prototype.batchTexture.call(this,t,e,i,s,n,r,o,h,l,u,c,d,f,p,v,g,m,y,x,T,w,E,S,b,A,_,C,R,M,P,O,L)},batchTextureFrame:function(t,e,i,s,n,r,o){this.lightsActive&&a.prototype.batchTextureFrame.call(this,t,e,i,s,n,r,o)}});c.LIGHT_COUNT=l,t.exports=c},77310:(t,e,i)=>{var s=i(56694),n=i(11117),r=i(72632),a=i(53787),o=i(15968),h=i(69360),l=i(75512),u=i(71402),c=i(44775),d=new s({Extends:c,initialize:function(t){var e=t.game.renderer,i=r(t,"fragShader",a);t.fragShader=l.parseFragmentShaderMaxTextures(i,e.maxTextures),t.vertShader=r(t,"vertShader",o),t.attributes=r(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexId"},{name:"inTintEffect"},{name:"inTint",size:4,type:u.UNSIGNED_BYTE,normalized:!0}]),c.call(this,t),this._tempMatrix1=new h,this._tempMatrix2=new h,this._tempMatrix3=new h,this.calcMatrix=new h,this.tempTriangle=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}],this.strokeTint={TL:0,TR:0,BL:0,BR:0},this.fillTint={TL:0,TR:0,BL:0,BR:0},this.currentFrame={u0:0,v0:0,u1:1,v1:1},this.firstQuad=[0,0,0,0,0],this.prevQuad=[0,0,0,0,0],this.polygonCache=[]},boot:function(){c.prototype.boot.call(this),this.currentShader.set1iv("uMainSampler",this.renderer.textureIndexes)},batchSprite:function(t,e,i){this.manager.set(this,t);var s=this._tempMatrix1,n=this._tempMatrix2,r=this._tempMatrix3,a=t.frame,o=a.glTexture,h=a.u0,u=a.v0,c=a.u1,d=a.v1,f=a.x,p=a.y,v=a.cutWidth,g=a.cutHeight,m=a.customPivot,y=t.displayOriginX,x=t.displayOriginY,T=-y+f,w=-x+p;if(t.isCropped){var E=t._crop;E.flipX===t.flipX&&E.flipY===t.flipY||a.updateCropUVs(E,t.flipX,t.flipY),h=E.u0,u=E.v0,c=E.u1,d=E.v1,v=E.width,g=E.height,T=-y+(f=E.x),w=-x+(p=E.y)}var S=1,b=1;t.flipX&&(m||(T+=-a.realWidth+2*y),S=-1),(t.flipY||a.source.isGLTexture&&!o.flipY)&&(m||(w+=-a.realHeight+2*x),b=-1),n.applyITRS(t.x,t.y,t.rotation,t.scaleX*S,t.scaleY*b),s.copyFrom(e.matrix),i?(s.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),n.e=t.x,n.f=t.y):(n.e-=e.scrollX*t.scrollFactorX,n.f-=e.scrollY*t.scrollFactorY),s.multiply(n,r);var A=T+v,_=w+g,C=e.roundPixels,R=r.getXRound(T,w,C),M=r.getXRound(T,_,C),P=r.getXRound(A,_,C),O=r.getXRound(A,w,C),L=r.getYRound(T,w,C),F=r.getYRound(T,_,C),D=r.getYRound(A,_,C),k=r.getYRound(A,w,C),I=l.getTintAppendFloatAlpha,B=e.alpha,N=I(t.tintTopLeft,B*t._alphaTL),Y=I(t.tintTopRight,B*t._alphaTR),X=I(t.tintBottomLeft,B*t._alphaBL),U=I(t.tintBottomRight,B*t._alphaBR);this.shouldFlush(6)&&this.flush();var z=this.setGameObject(t,a);this.manager.preBatch(t),this.batchQuad(t,R,L,M,F,P,D,O,k,h,u,c,d,N,Y,X,U,t.tintFill,o,z),this.manager.postBatch(t)},batchTexture:function(t,e,i,s,n,r,a,o,h,l,u,c,d,f,p,v,g,m,y,x,T,w,E,S,b,A,_,C,R,M,P,O){this.manager.set(this,t);var L=this._tempMatrix1,F=this._tempMatrix2,D=this._tempMatrix3,k=m/i+_,I=y/s+C,B=(m+x)/i+_,N=(y+T)/s+C,Y=a,X=o,U=-v,z=-g;if(t.isCropped){var G=t._crop,W=G.width,V=G.height;Y=W,X=V,a=W,o=V;var H=m=G.x,j=y=G.y;c&&(H=x-G.x-W),d&&(j=T-G.y-V),k=H/i+_,I=j/s+C,B=(H+W)/i+_,N=(j+V)/s+C,U=-v+m,z=-g+y}c&&(Y*=-1,U+=a),(d^=!P&&e.isRenderTexture?1:0)&&(X*=-1,z+=o);var K=U+Y,q=z+X;F.applyITRS(n,r,u,h,l),L.copyFrom(R.matrix),M?(L.multiplyWithOffset(M,-R.scrollX*f,-R.scrollY*p),F.e=n,F.f=r):(F.e-=R.scrollX*f,F.f-=R.scrollY*p),L.multiply(F,D);var Z=R.roundPixels,J=D.getXRound(U,z,Z),Q=D.getYRound(U,z,Z),$=D.getXRound(U,q,Z),tt=D.getYRound(U,q,Z),et=D.getXRound(K,q,Z),it=D.getYRound(K,q,Z),st=D.getXRound(K,z,Z),nt=D.getYRound(K,z,Z);void 0===O&&(O=this.renderer.setTexture2D(e)),t&&this.manager.preBatch(t),this.batchQuad(t,J,Q,$,tt,et,it,st,nt,k,I,B,N,w,E,S,b,A,e,O),t&&this.manager.postBatch(t)},batchTextureFrame:function(t,e,i,s,n,r,a){this.manager.set(this);var o=this._tempMatrix1.copyFrom(r),h=this._tempMatrix2,u=e+t.width,c=i+t.height;a?o.multiply(a,h):h=o;var d=h.getX(e,i),f=h.getY(e,i),p=h.getX(e,c),v=h.getY(e,c),g=h.getX(u,c),m=h.getY(u,c),y=h.getX(u,i),x=h.getY(u,i),T=this.renderer.setTextureSource(t.source);s=l.getTintAppendFloatAlpha(s,n),this.batchQuad(null,d,f,p,v,g,m,y,x,t.u0,t.v0,t.u1,t.v1,s,s,s,s,0,t.glTexture,T)},batchFillRect:function(t,e,i,s,n,r){this.renderer.pipelines.set(this);var a=this.calcMatrix;r&&r.multiply(n,a);var o=t+i,h=e+s,l=a.getX(t,e),u=a.getY(t,e),c=a.getX(t,h),d=a.getY(t,h),f=a.getX(o,h),p=a.getY(o,h),v=a.getX(o,e),g=a.getY(o,e),m=this.fillTint;this.batchQuad(null,l,u,c,d,f,p,v,g,0,0,1,1,m.TL,m.TR,m.BL,m.BR,2)},batchFillTriangle:function(t,e,i,s,n,r,a,o){this.renderer.pipelines.set(this);var h=this.calcMatrix;o&&o.multiply(a,h);var l=h.getX(t,e),u=h.getY(t,e),c=h.getX(i,s),d=h.getY(i,s),f=h.getX(n,r),p=h.getY(n,r),v=this.fillTint;this.batchTri(null,l,u,c,d,f,p,0,0,1,1,v.TL,v.TR,v.BL,2)},batchStrokeTriangle:function(t,e,i,s,n,r,a,o,h){var l=this.tempTriangle;l[0].x=t,l[0].y=e,l[0].width=a,l[1].x=i,l[1].y=s,l[1].width=a,l[2].x=n,l[2].y=r,l[2].width=a,l[3].x=t,l[3].y=e,l[3].width=a,this.batchStrokePath(l,a,!1,o,h)},batchFillPath:function(t,e,i){this.renderer.pipelines.set(this);var s=this.calcMatrix;i&&i.multiply(e,s);for(var r,a,o=t.length,h=this.polygonCache,l=this.fillTint.TL,u=this.fillTint.TR,c=this.fillTint.BL,d=0;d0&&X[4]?this.batchQuad(null,F,D,M,P,X[0],X[1],X[2],X[3],0,0,1,1,I,B,N,Y,2):(U[0]=F,U[1]=D,U[2]=M,U[3]=P,U[4]=1),h&&U[4]?this.batchQuad(null,C,R,O,L,U[0],U[1],U[2],U[3],0,0,1,1,I,B,N,Y,2):(X[0]=C,X[1]=R,X[2]=O,X[3]=L,X[4]=1)}}});t.exports=d},10919:(t,e,i)=>{var s=i(56694),n=i(72632),r=i(83327),a=i(54677),o=i(44775),h=new s({Extends:o,initialize:function(t){t.vertShader=n(t,"vertShader",a),t.fragShader=n(t,"fragShader",r),t.attributes=n(t,"attributes",[{name:"inPosition",size:2},{name:"inLightPosition",size:2},{name:"inLightRadius"},{name:"inLightAttenuation"},{name:"inLightColor",size:4}]),o.call(this,t)},onRender:function(t,e){this.set2f("uResolution",this.width,this.height),this.set1f("uCameraZoom",e.zoom)},batchPointLight:function(t,e,i,s,n,r,a,o,h,l,u,c){var d=t.color,f=t.intensity,p=t.radius,v=t.attenuation,g=d.r*f,m=d.g*f,y=d.b*f,x=e.alpha*t.alpha;this.shouldFlush(6)&&this.flush(),this.batchLightVert(i,s,u,c,p,v,g,m,y,x),this.batchLightVert(n,r,u,c,p,v,g,m,y,x),this.batchLightVert(a,o,u,c,p,v,g,m,y,x),this.batchLightVert(i,s,u,c,p,v,g,m,y,x),this.batchLightVert(a,o,u,c,p,v,g,m,y,x),this.batchLightVert(h,l,u,c,p,v,g,m,y,x)},batchLightVert:function(t,e,i,s,n,r,a,o,h,l){var u=this.vertexViewF32,c=this.vertexCount*this.currentShader.vertexComponentCount-1;u[++c]=t,u[++c]=e,u[++c]=i,u[++c]=s,u[++c]=n,u[++c]=r,u[++c]=a,u[++c]=o,u[++c]=h,u[++c]=l,this.vertexCount++}});t.exports=h},80486:(t,e,i)=>{var s=i(56694),n=i(65246),r=i(72632),a=i(12569),o=i(99365),h=i(44775),l=new s({Extends:h,initialize:function(t){t.renderTarget=r(t,"renderTarget",1),t.fragShader=r(t,"fragShader",a),t.vertShader=r(t,"vertShader",o),t.attributes=r(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]),t.batchSize=1,t.vertices=[-1,-1,0,0,-1,1,0,1,1,1,1,1,-1,-1,0,0,1,1,1,1,1,-1,1,0],h.call(this,t),this.isPostFX=!0,this.gameObject,this.colorMatrix=new n,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2,this.renderer.isBooted&&(this.manager=this.renderer.pipelines,this.boot())},boot:function(){h.prototype.boot.call(this);var t=this.manager.UTILITY_PIPELINE;this.fullFrame1=t.fullFrame1,this.fullFrame2=t.fullFrame2,this.halfFrame1=t.halfFrame1,this.halfFrame2=t.halfFrame2,this.set1i("uMainSampler",0)},onDraw:function(t){this.bindAndDraw(t)},copyFrame:function(t,e,i,s,n){this.manager.copyFrame(t,e,i,s,n)},copyToGame:function(t){this.manager.copyToGame(t)},drawFrame:function(t,e,i){this.manager.drawFrame(t,e,i,this.colorMatrix)},blendFrames:function(t,e,i,s,n){this.manager.blendFrames(t,e,i,s,n)},blendFramesAdditive:function(t,e,i,s,n){this.manager.blendFramesAdditive(t,e,i,s,n)},clearFrame:function(t,e){this.manager.clearFrame(t,e)},blitFrame:function(t,e,i,s,n,r){this.manager.blitFrame(t,e,i,s,n,r)},copyFrameRect:function(t,e,i,s,n,r,a,o){this.manager.copyFrameRect(t,e,i,s,n,r,a,o)},bindAndDraw:function(t,e,i,s,n){void 0===i&&(i=!0),void 0===s&&(s=!0);var r=this.gl,a=this.renderer;this.bind(n),this.set1i("uMainSampler",0),e?(r.viewport(0,0,e.width,e.height),r.bindFramebuffer(r.FRAMEBUFFER,e.framebuffer),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e.texture,0),i&&(s?r.clearColor(0,0,0,0):r.clearColor(0,0,0,1),r.clear(r.COLOR_BUFFER_BIT))):(a.popFramebuffer(!1,!1,!1),a.currentFramebuffer||r.viewport(0,0,a.width,a.height)),r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,t.texture),r.bufferData(r.ARRAY_BUFFER,this.vertexData,r.STATIC_DRAW),r.drawArrays(r.TRIANGLES,0,6),e?(r.bindTexture(r.TEXTURE_2D,null),r.bindFramebuffer(r.FRAMEBUFFER,null)):a.resetTextures()}});t.exports=l},21213:(t,e,i)=>{var s=i(56694),n=i(72632),r=i(77310),a=new s({Extends:r,initialize:function(t){t.topology=5,t.batchSize=n(t,"batchSize",256),r.call(this,t)}});t.exports=a},51212:(t,e,i)=>{var s=i(56694),n=i(72632),r=i(77310),a=i(85060),o=i(18166),h=i(44775),l=new s({Extends:r,initialize:function(t){t.fragShader=n(t,"fragShader",a),t.vertShader=n(t,"vertShader",o),t.forceZero=!0,r.call(this,t)},boot:function(){h.prototype.boot.call(this),this.set1i("uMainSampler",0)}});t.exports=l},38964:(t,e,i)=>{var s=i(95723),n=i(79993),r=i(56694),a=i(72632),o=i(77310),h=i(12569),l=i(74118),u=i(37410),c=i(85060),d=i(18166),f=i(69360),p=i(71402),v=i(44775),g=new r({Extends:v,initialize:function(t){t.attributes=a(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexId"},{name:"inTintEffect"},{name:"inTint",size:4,type:p.UNSIGNED_BYTE,normalized:!0}]);var e=a(t,"fragShader",h),i=a(t,"vertShader",d),s=a(t,"drawShader",h),n=[{name:"DrawSprite",fragShader:c,vertShader:d},{name:"CopySprite",fragShader:e,vertShader:i},{name:"DrawGame",fragShader:s,vertShader:d}],r=a(t,"shaders",[]);t.shaders=n.concat(r),t.vertShader||(t.vertShader=i),t.batchSize=1,v.call(this,t),this.isSpriteFX=!0,this._tempMatrix1=new f,this._tempMatrix2=new f,this._tempMatrix3=new f,this.drawSpriteShader,this.copyShader,this.gameShader,this.quadVertexData,this.quadVertexBuffer,this.quadVertexViewF32,this.spriteBounds=new l,this.targetBounds=new l,this.fsTarget,this.tempSprite,this.renderer.isBooted&&(this.manager=this.renderer.pipelines,this.boot())},boot:function(){v.prototype.boot.call(this);var t=this.shaders,e=this.renderer;this.drawSpriteShader=t[0],this.copyShader=t[1],this.gameShader=t[2],this.fsTarget=new u(e,e.width,e.height,1,0,!0,!0),this.renderTargets=this.manager.renderTargets.concat(this.fsTarget);var i=new ArrayBuffer(168);this.quadVertexData=i,this.quadVertexViewF32=new Float32Array(i),this.quadVertexBuffer=e.createVertexBuffer(i,this.gl.STATIC_DRAW),this.onResize(e.width,e.height),this.currentShader=this.copyShader},onResize:function(t,e){var i=this.quadVertexViewF32;i[1]=e,i[22]=e,i[14]=t,i[28]=t,i[35]=t,i[36]=e},batchSprite:function(t,e,i){o.prototype.batchSprite.call(this,t,e,i)},batchTexture:function(t,e,i,s,n,r,a,h,l,u,c,d,f,p,v,g,m,y,x,T,w,E,S,b,A,_,C,R,M,P,O,L){o.prototype.batchTexture.call(this,t,e,i,s,n,r,a,h,l,u,c,d,f,p,v,g,m,y,x,T,w,E,S,b,A,_,C,R,M,P,O,L)},batchQuad:function(t,e,i,s,r,a,o,h,l,u,c,d,f,p,v,g,m,y,x){var T=Math.min(e,s,a,h),w=Math.min(i,r,o,l),E=Math.max(e,s,a,h)-T,S=Math.max(i,r,o,l)-w,b=this.spriteBounds.setTo(T,w,E,S),A=t.fxPadding,_=E+2*A,C=S+2*A,R=Math.abs(Math.max(_,C)),M=this.manager.getRenderTarget(R),P=this.targetBounds.setTo(0,0,M.width,M.height);n(P,b.centerX,b.centerY),this.tempSprite=t;var O=this.gl,L=this.renderer;this.setShader(this.drawSpriteShader),this.set1i("uMainSampler",0),this.flipProjectionMatrix(!0),this.onDrawSprite(t,M),t.onFX(this);var F=this.fsTarget;return L.setTextureZero(x),O.viewport(0,0,L.width,L.height),O.bindFramebuffer(O.FRAMEBUFFER,F.framebuffer),O.framebufferTexture2D(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_2D,F.texture,0),O.clearColor(0,0,0,0),O.clear(O.COLOR_BUFFER_BIT),this.batchVert(e,i,u,c,0,y,p),this.batchVert(s,r,u,f,0,y,g),this.batchVert(a,o,d,f,0,y,m),this.batchVert(e,i,u,c,0,y,p),this.batchVert(a,o,d,f,0,y,m),this.batchVert(h,l,d,c,0,y,v),this.flush(),this.flipProjectionMatrix(!1),L.clearTextureZero(),O.activeTexture(O.TEXTURE0),O.bindTexture(O.TEXTURE_2D,M.texture),O.copyTexSubImage2D(O.TEXTURE_2D,0,0,0,P.x,P.y,P.width,P.height),O.bindFramebuffer(O.FRAMEBUFFER,null),O.bindTexture(O.TEXTURE_2D,null),this.onBatch(t),this.currentShader=this.copyShader,this.onDraw(M,this.manager.getSwapRenderTarget(),this.manager.getAltSwapRenderTarget()),!0},onDrawSprite:function(){},onCopySprite:function(){},copySprite:function(t,e,i,n,r,a){void 0===i&&(i=!0),void 0===n&&(n=!0),void 0===r&&(r=!1),void 0===a&&(a=this.copyShader);var o=this.gl,h=this.tempSprite;this.currentShader=a;var l=this.setVertexBuffer(this.quadVertexBuffer);if(a.bind(l,!1),this.set1i("uMainSampler",0),h.onFXCopy(this),this.onCopySprite(t,e,h),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,t.texture),t.height>e.height)o.viewport(0,0,t.width,t.height),this.setTargetUVs(t,e);else{var u=e.height-t.height;o.viewport(0,u,t.width,t.height),this.resetUVs()}if(o.bindFramebuffer(o.FRAMEBUFFER,e.framebuffer),o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,e.texture,0),i&&(o.clearColor(0,0,0,Number(!n)),o.clear(o.COLOR_BUFFER_BIT)),r){var c=this.renderer.currentBlendMode;this.renderer.setBlendMode(s.ERASE)}o.bufferData(o.ARRAY_BUFFER,this.quadVertexData,o.STATIC_DRAW),o.drawArrays(o.TRIANGLES,0,6),r&&this.renderer.setBlendMode(c),o.bindFramebuffer(o.FRAMEBUFFER,null)},blendFrames:function(t,e,i,s,n){this.manager.blendFrames(t,e,i,s,n)},blendFramesAdditive:function(t,e,i,s,n){this.manager.blendFramesAdditive(t,e,i,s,n)},drawToGame:function(t){this.currentShader=null,this.setShader(this.copyShader),this.bindAndDraw(t)},copyToGame:function(t){this.currentShader=null,this.setShader(this.gameShader),this.bindAndDraw(t)},bindAndDraw:function(t){var e=this.gl,i=this.renderer;this.set1i("uMainSampler",0),i.popFramebuffer(!1,!1,!1),i.currentFramebuffer||e.viewport(0,0,i.width,i.height),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t.texture);var s=this._tempMatrix1.loadIdentity(),n=this.targetBounds.x,r=this.targetBounds.y,a=n+t.width,o=r+t.height,h=s.getX(n,r),l=s.getX(n,o),u=s.getX(a,o),c=s.getX(a,r),d=s.getY(n,r),f=s.getY(n,o),p=s.getY(a,o),v=s.getY(a,r);this.batchVert(h,d,0,0,0,0,16777215),this.batchVert(l,f,0,1,0,0,16777215),this.batchVert(u,p,1,1,0,0,16777215),this.batchVert(h,d,0,0,0,0,16777215),this.batchVert(u,p,1,1,0,0,16777215),this.batchVert(c,v,1,0,0,0,16777215),this.flush(),i.resetTextures(),this.tempSprite=null},onDraw:function(t){this.drawToGame(t)},setUVs:function(t,e,i,s,n,r,a,o){var h=this.quadVertexViewF32;h[2]=t,h[3]=e,h[9]=i,h[10]=s,h[16]=n,h[17]=r,h[23]=t,h[24]=e,h[30]=n,h[31]=r,h[37]=a,h[38]=o},setTargetUVs:function(t,e){var i=e.height/t.height;i=i>.5?.5-(i-.5):.5-i+.5,this.setUVs(0,i,0,1+i,1,1+i,1,i)},resetUVs:function(){this.setUVs(0,0,0,1,1,1,1,0)},destroy:function(){this.gl.deleteBuffer(this.quadVertexBuffer),this._tempMatrix1.destroy(),this._tempMatrix2.destroy(),this._tempMatrix3.destroy(),this._tempMatrix1=null,this._tempMatrix1=null,this._tempMatrix1=null,this.drawSpriteShader=null,this.copyShader=null,this.gameShader=null,this.quadVertexData=null,this.quadVertexBuffer=null,this.quadVertexViewF32=null,this.fsTarget=null,this.tempSprite=null,v.prototype.destroy.call(this)}});t.exports=g},60848:(t,e,i)=>{var s=i(2529),n=i(95723),r=i(56694),a=i(65246),o=i(37486),h=i(79060),l=i(72632),u=i(98921),c=i(99365),d=i(44775),f=new r({Extends:d,initialize:function(t){t.renderTarget=l(t,"renderTarget",[{scale:1},{scale:1},{scale:.5},{scale:.5}]),t.vertShader=l(t,"vertShader",c),t.shaders=l(t,"shaders",[{name:"Copy",fragShader:h},{name:"AddBlend",fragShader:s},{name:"LinearBlend",fragShader:u},{name:"ColorMatrix",fragShader:o}]),t.attributes=l(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]),t.vertices=[-1,-1,0,0,-1,1,0,1,1,1,1,1,-1,-1,0,0,1,1,1,1,1,-1,1,0],t.batchSize=1,d.call(this,t),this.colorMatrix=new a,this.copyShader,this.addShader,this.linearShader,this.colorMatrixShader,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2},boot:function(){d.prototype.boot.call(this);var t=this.shaders,e=this.renderTargets;this.copyShader=t[0],this.addShader=t[1],this.linearShader=t[2],this.colorMatrixShader=t[3],this.fullFrame1=e[0],this.fullFrame2=e[1],this.halfFrame1=e[2],this.halfFrame2=e[3]},copyFrame:function(t,e,i,s,n){void 0===i&&(i=1),void 0===s&&(s=!0),void 0===n&&(n=!0);var r=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",i),r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,t.texture),e?(r.viewport(0,0,e.width,e.height),r.bindFramebuffer(r.FRAMEBUFFER,e.framebuffer),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e.texture,0)):r.viewport(0,0,t.width,t.height),s&&(n?r.clearColor(0,0,0,0):r.clearColor(0,0,0,1),r.clear(r.COLOR_BUFFER_BIT)),r.bufferData(r.ARRAY_BUFFER,this.vertexData,r.STATIC_DRAW),r.drawArrays(r.TRIANGLES,0,6),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindTexture(r.TEXTURE_2D,null)},blitFrame:function(t,e,i,s,r,a,o){void 0===i&&(i=1),void 0===s&&(s=!0),void 0===r&&(r=!0),void 0===a&&(a=!1),void 0===o&&(o=!1);var h=this.gl;if(this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",i),h.activeTexture(h.TEXTURE0),h.bindTexture(h.TEXTURE_2D,t.texture),t.height>e.height)h.viewport(0,0,t.width,t.height),this.setTargetUVs(t,e);else{var l=e.height-t.height;h.viewport(0,l,t.width,t.height)}if(h.bindFramebuffer(h.FRAMEBUFFER,e.framebuffer),h.framebufferTexture2D(h.FRAMEBUFFER,h.COLOR_ATTACHMENT0,h.TEXTURE_2D,e.texture,0),s&&(r?h.clearColor(0,0,0,0):h.clearColor(0,0,0,1),h.clear(h.COLOR_BUFFER_BIT)),a){var u=this.renderer.currentBlendMode;this.renderer.setBlendMode(n.ERASE)}o&&this.flipY(),h.bufferData(h.ARRAY_BUFFER,this.vertexData,h.STATIC_DRAW),h.drawArrays(h.TRIANGLES,0,6),a&&this.renderer.setBlendMode(u),h.bindFramebuffer(h.FRAMEBUFFER,null),h.bindTexture(h.TEXTURE_2D,null),this.resetUVs()},copyFrameRect:function(t,e,i,s,n,r,a,o){void 0===a&&(a=!0),void 0===o&&(o=!0);var h=this.gl;h.bindFramebuffer(h.FRAMEBUFFER,t.framebuffer),h.framebufferTexture2D(h.FRAMEBUFFER,h.COLOR_ATTACHMENT0,h.TEXTURE_2D,t.texture,0),a&&(o?h.clearColor(0,0,0,0):h.clearColor(0,0,0,1),h.clear(h.COLOR_BUFFER_BIT)),h.activeTexture(h.TEXTURE0),h.bindTexture(h.TEXTURE_2D,e.texture),h.copyTexSubImage2D(h.TEXTURE_2D,0,0,0,i,s,n,r),h.bindFramebuffer(h.FRAMEBUFFER,null),h.bindTexture(h.TEXTURE_2D,null)},copyToGame:function(t){var e=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",1),this.renderer.popFramebuffer(),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t.texture),e.bufferData(e.ARRAY_BUFFER,this.vertexData,e.STATIC_DRAW),e.drawArrays(e.TRIANGLES,0,6),this.renderer.resetTextures()},drawFrame:function(t,e,i,s){void 0===i&&(i=!0),void 0===s&&(s=this.colorMatrix);var n=this.gl;this.setShader(this.colorMatrixShader),this.set1i("uMainSampler",0),this.set1fv("uColorMatrix",s.getData()),this.set1f("uAlpha",s.alpha),n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,t.texture),e?(n.viewport(0,0,e.width,e.height),n.bindFramebuffer(n.FRAMEBUFFER,e.framebuffer),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,e.texture,0)):n.viewport(0,0,t.width,t.height),i?n.clearColor(0,0,0,0):n.clearColor(0,0,0,1),n.clear(n.COLOR_BUFFER_BIT),n.bufferData(n.ARRAY_BUFFER,this.vertexData,n.STATIC_DRAW),n.drawArrays(n.TRIANGLES,0,6),n.bindFramebuffer(n.FRAMEBUFFER,null),n.bindTexture(n.TEXTURE_2D,null)},blendFrames:function(t,e,i,s,n,r){void 0===s&&(s=1),void 0===n&&(n=!0),void 0===r&&(r=this.linearShader);var a=this.gl;this.setShader(r),this.set1i("uMainSampler1",0),this.set1i("uMainSampler2",1),this.set1f("uStrength",s),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,t.texture),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,e.texture),i?(a.bindFramebuffer(a.FRAMEBUFFER,i.framebuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,i.texture,0),a.viewport(0,0,i.width,i.height)):a.viewport(0,0,t.width,t.height),n?a.clearColor(0,0,0,0):a.clearColor(0,0,0,1),a.clear(a.COLOR_BUFFER_BIT),a.bufferData(a.ARRAY_BUFFER,this.vertexData,a.STATIC_DRAW),a.drawArrays(a.TRIANGLES,0,6),a.bindFramebuffer(a.FRAMEBUFFER,null),a.bindTexture(a.TEXTURE_2D,null)},blendFramesAdditive:function(t,e,i,s,n){this.blendFrames(t,e,i,s,n,this.addShader)},clearFrame:function(t,e){void 0===e&&(e=!0);var i=this.gl;i.viewport(0,0,t.width,t.height),i.bindFramebuffer(i.FRAMEBUFFER,t.framebuffer),e?i.clearColor(0,0,0,0):i.clearColor(0,0,0,1),i.clear(i.COLOR_BUFFER_BIT);var s=this.renderer.currentFramebuffer;i.bindFramebuffer(i.FRAMEBUFFER,s)},setUVs:function(t,e,i,s,n,r,a,o){var h=this.vertexViewF32;h[2]=t,h[3]=e,h[6]=i,h[7]=s,h[10]=n,h[11]=r,h[14]=t,h[15]=e,h[18]=n,h[19]=r,h[22]=a,h[23]=o},setTargetUVs:function(t,e){var i=e.height/t.height;i=i>.5?.5-(i-.5):.5-i+.5,this.setUVs(0,i,0,1+i,1,1+i,1,i)},flipX:function(){this.setUVs(1,0,1,1,0,1,0,0)},flipY:function(){this.setUVs(0,1,0,0,1,0,1,1)},resetUVs:function(){this.setUVs(0,0,0,1,1,1,1,0)}});t.exports=f},65641:t=>{t.exports={BITMAPMASK_PIPELINE:"BitmapMaskPipeline",LIGHT_PIPELINE:"Light2D",POINTLIGHT_PIPELINE:"PointLightPipeline",SINGLE_PIPELINE:"SinglePipeline",MULTI_PIPELINE:"MultiPipeline",ROPE_PIPELINE:"RopePipeline",GRAPHICS_PIPELINE:"GraphicsPipeline",POSTFX_PIPELINE:"PostFXPipeline",UTILITY_PIPELINE:"UtilityPipeline"}},68726:t=>{t.exports="pipelineafterflush"},67186:t=>{t.exports="pipelinebeforeflush"},22709:t=>{t.exports="pipelinebind"},74469:t=>{t.exports="pipelineboot"},93953:t=>{t.exports="pipelinedestroy"},51687:t=>{t.exports="pipelinerebind"},25034:t=>{t.exports="pipelineresize"},18970:(t,e,i)=>{t.exports={AFTER_FLUSH:i(68726),BEFORE_FLUSH:i(67186),BIND:i(22709),BOOT:i(74469),DESTROY:i(93953),REBIND:i(51687),RESIZE:i(25034)}},62253:(t,e,i)=>{var s=i(65641),n=i(98611),r={BitmapMaskPipeline:i(5583),Events:i(18970),LightPipeline:i(66901),MultiPipeline:i(77310),PointLightPipeline:i(10919),PostFXPipeline:i(80486),RopePipeline:i(21213),SinglePipeline:i(51212),SpriteFXPipeline:i(38964),UtilityPipeline:i(60848)};r=n(!1,r,s),t.exports=r},2529:t=>{t.exports=["#define SHADER_NAME PHASER_ADD_BLEND_FS","","precision mediump float;","","uniform sampler2D uMainSampler1;","uniform sampler2D uMainSampler2;","uniform float uStrength;","","varying vec2 outTexCoord;","","void main ()","{"," vec4 frame1 = texture2D(uMainSampler1, outTexCoord);"," vec4 frame2 = texture2D(uMainSampler2, outTexCoord);",""," gl_FragColor = frame1 + frame2 * uStrength;","}",""].join("\n")},91679:t=>{t.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_FS","","precision mediump float;","","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uMaskSampler;","uniform bool uInvertMaskAlpha;","","void main ()","{"," vec2 uv = gl_FragCoord.xy / uResolution;",""," vec4 mainColor = texture2D(uMainSampler, uv);"," vec4 maskColor = texture2D(uMaskSampler, uv);",""," if (!uInvertMaskAlpha)"," {"," mainColor *= maskColor.a;"," }"," else"," {"," mainColor *= (1.0 - maskColor.a);"," }",""," gl_FragColor = mainColor;","}",""].join("\n")},89053:t=>{t.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_VS","","precision mediump float;","","attribute vec2 inPosition;","","void main ()","{"," gl_Position = vec4(inPosition, 0.0, 1.0);","}",""].join("\n")},37486:t=>{t.exports=["#define SHADER_NAME PHASER_COLORMATRIX_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","uniform float uColorMatrix[20];","uniform float uAlpha;","","varying vec2 outTexCoord;","","void main ()","{"," vec4 c = texture2D(uMainSampler, outTexCoord);",""," if (uAlpha == 0.0)"," {"," gl_FragColor = c;",""," return;"," }",""," if (c.a > 0.0)"," {"," c.rgb /= c.a;"," }",""," vec4 result;",""," result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4];"," result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9];"," result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14];"," result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19];",""," vec3 rgb = mix(c.rgb, result.rgb, uAlpha);",""," rgb *= result.a;",""," gl_FragColor = vec4(rgb, result.a);","}",""].join("\n")},79060:t=>{t.exports=["#define SHADER_NAME PHASER_COPY_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","uniform float uBrightness;","","varying vec2 outTexCoord;","","void main ()","{"," gl_FragColor = texture2D(uMainSampler, outTexCoord) * uBrightness;","}",""].join("\n")},65045:t=>{t.exports=["#define SHADER_NAME PHASER_LIGHT_FS","","precision mediump float;","","struct Light","{"," vec2 position;"," vec3 color;"," float intensity;"," float radius;","};","","const int kMaxLights = %LIGHT_COUNT%;","","uniform vec4 uCamera; /* x, y, rotation, zoom */","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uNormSampler;","uniform vec3 uAmbientLightColor;","uniform Light uLights[kMaxLights];","uniform mat3 uInverseRotationMatrix;","","varying vec2 outTexCoord;","varying vec4 outTint;","","void main()","{"," vec3 finalColor = vec3(0.0, 0.0, 0.0);"," vec4 color = texture2D(uMainSampler, outTexCoord) * vec4(outTint.bgr * outTint.a, outTint.a);"," vec3 normalMap = texture2D(uNormSampler, outTexCoord).rgb;"," vec3 normal = normalize(uInverseRotationMatrix * vec3(normalMap * 2.0 - 1.0));"," vec2 res = vec2(min(uResolution.x, uResolution.y)) * uCamera.w;",""," for (int index = 0; index < kMaxLights; ++index)"," {"," Light light = uLights[index];"," vec3 lightDir = vec3((light.position.xy / res) - (gl_FragCoord.xy / res), 0.1);"," vec3 lightNormal = normalize(lightDir);"," float distToSurf = length(lightDir) * uCamera.w;"," float diffuseFactor = max(dot(normal, lightNormal), 0.0);"," float radius = (light.radius / res.x * uCamera.w) * uCamera.w;"," float attenuation = clamp(1.0 - distToSurf * distToSurf / (radius * radius), 0.0, 1.0);"," vec3 diffuse = light.color * diffuseFactor;"," finalColor += (attenuation * diffuse) * light.intensity;"," }",""," vec4 colorOutput = vec4(uAmbientLightColor + finalColor, 1.0);",""," gl_FragColor = color * vec4(colorOutput.rgb * colorOutput.a, colorOutput.a);","}",""].join("\n")},98921:t=>{t.exports=["#define SHADER_NAME PHASER_LINEAR_BLEND_FS","","precision mediump float;","","uniform sampler2D uMainSampler1;","uniform sampler2D uMainSampler2;","uniform float uStrength;","","varying vec2 outTexCoord;","","void main ()","{"," vec4 frame1 = texture2D(uMainSampler1, outTexCoord);"," vec4 frame2 = texture2D(uMainSampler2, outTexCoord);",""," gl_FragColor = mix(frame1, frame2 * uStrength, 0.5);","}",""].join("\n")},53787:t=>{t.exports=["#define SHADER_NAME PHASER_MULTI_V2_FS","#define numTextures %count%","","precision highp float;","","uniform sampler2D uMainSampler[%count%];","","varying vec2 outTexCoord;","varying float outTexId;","varying float outTintEffect;","varying vec4 outTint;","","%getSampler%","","void main ()","{"," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);",""," vec4 texture = getSampler(int(outTexId), outTexCoord);",""," // Multiply texture tint"," vec4 color = texture * texel;",""," if (outTintEffect == 1.0)"," {"," // Solid color + texture alpha"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," // Solid color, no texture"," color = texel;"," }",""," gl_FragColor = color;","}",""].join("\n")},15968:t=>{t.exports=["#define SHADER_NAME PHASER_MULTI_VS","","precision highp float;","","uniform mat4 uProjectionMatrix;","","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexId;","attribute float inTintEffect;","attribute vec4 inTint;","","varying vec2 outTexCoord;","varying float outTexId;","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);",""," outTexCoord = inTexCoord;"," outTexId = inTexId;"," outTint = inTint;"," outTintEffect = inTintEffect;","}",""].join("\n")},83327:t=>{t.exports=["#define SHADER_NAME PHASER_POINTLIGHT_FS","","precision mediump float;","","uniform vec2 uResolution;","uniform float uCameraZoom;","","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","","void main ()","{"," vec2 center = (lightPosition.xy + 1.0) * (uResolution.xy * 0.5);",""," float distToSurf = length(center - gl_FragCoord.xy);",""," float radius = 1.0 - distToSurf / (lightRadius * uCameraZoom);",""," float intensity = smoothstep(0.0, 1.0, radius * lightAttenuation);",""," vec4 color = vec4(intensity, intensity, intensity, 0.0) * lightColor;",""," gl_FragColor = vec4(color.rgb * lightColor.a, color.a);","}",""].join("\n")},54677:t=>{t.exports=["#define SHADER_NAME PHASER_POINTLIGHT_VS","","precision mediump float;","","uniform mat4 uProjectionMatrix;","","attribute vec2 inPosition;","attribute vec2 inLightPosition;","attribute vec4 inLightColor;","attribute float inLightRadius;","attribute float inLightAttenuation;","","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","","void main ()","{"," lightColor = inLightColor;"," lightRadius = inLightRadius;"," lightAttenuation = inLightAttenuation;"," lightPosition = uProjectionMatrix * vec4(inLightPosition, 1.0, 1.0);",""," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);","}",""].join("\n")},12569:t=>{t.exports=["#define SHADER_NAME PHASER_POSTFX_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","","varying vec2 outTexCoord;","","void main ()","{"," gl_FragColor = texture2D(uMainSampler, outTexCoord);","}",""].join("\n")},99365:t=>{t.exports=["#define SHADER_NAME PHASER_QUAD_VS","","precision mediump float;","","attribute vec2 inPosition;","attribute vec2 inTexCoord;","","varying vec2 outFragCoord;","varying vec2 outTexCoord;","","void main ()","{"," outFragCoord = inPosition.xy * 0.5 + 0.5;"," outTexCoord = inTexCoord;",""," gl_Position = vec4(inPosition, 0, 1);","}",""].join("\n")},85060:t=>{t.exports=["#define SHADER_NAME PHASER_SINGLE_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);",""," // Multiply texture tint"," vec4 color = texture * texel;",""," if (outTintEffect == 1.0)"," {"," // Solid color + texture alpha"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," // Solid color, no texture"," color = texel;"," }",""," gl_FragColor = color;","}",""].join("\n")},18166:t=>{t.exports=["#define SHADER_NAME PHASER_SINGLE_VS","","precision mediump float;","","uniform mat4 uProjectionMatrix;","","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexId;","attribute float inTintEffect;","attribute vec4 inTint;","","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);",""," outTexCoord = inTexCoord;"," outTint = inTint;"," outTintEffect = inTintEffect;","}",""].join("\n")},756:(t,e,i)=>{var s=i(55301),n=i(56694),r=i(6659),a=i(40444),o=i(97081),h=i(74181),l=i(2893),u=i(9229),c=i(72283),d=i(74118),f=i(90881),p=i(84314),v=i(93736),g=new n({Extends:r,initialize:function(t){r.call(this),this.game=t,this.canvas,this.canvasBounds=new d,this.parent=null,this.parentIsWindow=!1,this.parentSize=new f,this.gameSize=new f,this.baseSize=new f,this.displaySize=new f,this.scaleMode=s.SCALE_MODE.NONE,this.zoom=1,this._resetZoom=!1,this.displayScale=new v(1,1),this.autoRound=!1,this.autoCenter=s.CENTER.NO_CENTER,this.orientation=s.ORIENTATION.LANDSCAPE,this.fullscreen,this.fullscreenTarget=null,this._createdFullscreenTarget=!1,this.dirty=!1,this.resizeInterval=500,this._lastCheck=0,this._checkOrientation=!1,this.listeners={orientationChange:c,windowResize:c,fullScreenChange:c,fullScreenError:c}},preBoot:function(){this.parseConfig(this.game.config),this.game.events.once(o.BOOT,this.boot,this)},boot:function(){var t=this.game;this.canvas=t.canvas,this.fullscreen=t.device.fullscreen,this.scaleMode!==s.SCALE_MODE.RESIZE&&this.displaySize.setAspectMode(this.scaleMode),this.scaleMode===s.SCALE_MODE.NONE?this.resize(this.width,this.height):(this.getParentBounds(),this.parentSize.width>0&&this.parentSize.height>0&&this.displaySize.setParent(this.parentSize),this.refresh()),t.events.on(o.PRE_STEP,this.step,this),t.events.once(o.READY,this.refresh,this),t.events.once(o.DESTROY,this.destroy,this),this.startListeners()},parseConfig:function(t){this.getParent(t),this.getParentBounds();var e=t.width,i=t.height,n=t.scaleMode,r=t.zoom,a=t.autoRound;if("string"==typeof e){var o=this.parentSize.width;0===o&&(o=window.innerWidth);var h=parseInt(e,10)/100;e=Math.floor(o*h)}if("string"==typeof i){var l=this.parentSize.height;0===l&&(l=window.innerHeight);var c=parseInt(i,10)/100;i=Math.floor(l*c)}this.scaleMode=n,this.autoRound=a,this.autoCenter=t.autoCenter,this.resizeInterval=t.resizeInterval,a&&(e=Math.floor(e),i=Math.floor(i)),this.gameSize.setSize(e,i),r===s.ZOOM.MAX_ZOOM&&(r=this.getMaxZoom()),this.zoom=r,1!==r&&(this._resetZoom=!0),this.baseSize.setSize(e,i),a&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),t.minWidth>0&&this.displaySize.setMin(t.minWidth*r,t.minHeight*r),t.maxWidth>0&&this.displaySize.setMax(t.maxWidth*r,t.maxHeight*r),this.displaySize.setSize(e,i),this.orientation=u(e,i)},getParent:function(t){var e=t.parent;if(null!==e){if(this.parent=l(e),this.parentIsWindow=this.parent===document.body,t.expandParent&&t.scaleMode!==s.SCALE_MODE.NONE){var i=this.parent.getBoundingClientRect();(this.parentIsWindow||0===i.height)&&(document.documentElement.style.height="100%",document.body.style.height="100%",i=this.parent.getBoundingClientRect(),this.parentIsWindow||0!==i.height||(this.parent.style.overflow="hidden",this.parent.style.width="100%",this.parent.style.height="100%"))}t.fullscreenTarget&&!this.fullscreenTarget&&(this.fullscreenTarget=l(t.fullscreenTarget))}},getParentBounds:function(){if(!this.parent)return!1;var t=this.parentSize,e=this.parent.getBoundingClientRect();this.parentIsWindow&&this.game.device.os.iOS&&(e.height=h(!0));var i=e.width,s=e.height;if(t.width!==i||t.height!==s)return t.setSize(i,s),!0;if(this.canvas){var n=this.canvasBounds,r=this.canvas.getBoundingClientRect();if(r.x!==n.x||r.y!==n.y)return!0}return!1},lockOrientation:function(t){var e=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation;return!!e&&e.call(screen,t)},setParentSize:function(t,e){return this.parentSize.setSize(t,e),this.refresh()},setGameSize:function(t,e){var i=this.autoRound;i&&(t=Math.floor(t),e=Math.floor(e));var s=this.width,n=this.height;return this.gameSize.resize(t,e),this.baseSize.resize(t,e),i&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setAspectRatio(t/e),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height,this.refresh(s,n)},resize:function(t,e){var i=this.zoom,s=this.autoRound;s&&(t=Math.floor(t),e=Math.floor(e));var n=this.width,r=this.height;this.gameSize.resize(t,e),this.baseSize.resize(t,e),s&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(t*i,e*i),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height;var a=this.canvas.style,o=t*i,h=e*i;return s&&(o=Math.floor(o),h=Math.floor(h)),o===t&&h===e||(a.width=o+"px",a.height=h+"px"),this.refresh(n,r)},setZoom:function(t){return this.zoom=t,this._resetZoom=!0,this.refresh()},setMaxZoom:function(){return this.zoom=this.getMaxZoom(),this._resetZoom=!0,this.refresh()},refresh:function(t,e){void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.updateScale(),this.updateBounds(),this.updateOrientation(),this.displayScale.set(this.baseSize.width/this.canvasBounds.width,this.baseSize.height/this.canvasBounds.height);var i=this.game.domContainer;if(i){this.baseSize.setCSS(i);var s=this.canvas.style,n=i.style;n.transform="scale("+this.displaySize.width/this.baseSize.width+","+this.displaySize.height/this.baseSize.height+")",n.marginLeft=s.marginLeft,n.marginTop=s.marginTop}return this.emit(a.RESIZE,this.gameSize,this.baseSize,this.displaySize,t,e),this},updateOrientation:function(){if(this._checkOrientation){this._checkOrientation=!1;var t=u(this.width,this.height);t!==this.orientation&&(this.orientation=t,this.emit(a.ORIENTATION_CHANGE,t))}},updateScale:function(){var t,e,i=this.canvas.style,n=this.gameSize.width,r=this.gameSize.height,a=this.zoom,o=this.autoRound;this.scaleMode===s.SCALE_MODE.NONE?(this.displaySize.setSize(n*a,r*a),t=this.displaySize.width,e=this.displaySize.height,o&&(t=Math.floor(t),e=Math.floor(e)),this._resetZoom&&(i.width=t+"px",i.height=e+"px",this._resetZoom=!1)):this.scaleMode===s.SCALE_MODE.RESIZE?(this.displaySize.setSize(this.parentSize.width,this.parentSize.height),this.gameSize.setSize(this.displaySize.width,this.displaySize.height),this.baseSize.setSize(this.displaySize.width,this.displaySize.height),t=this.displaySize.width,e=this.displaySize.height,o&&(t=Math.floor(t),e=Math.floor(e)),this.canvas.width=t,this.canvas.height=e):(this.displaySize.setSize(this.parentSize.width,this.parentSize.height),t=this.displaySize.width,e=this.displaySize.height,o&&(t=Math.floor(t),e=Math.floor(e)),i.width=t+"px",i.height=e+"px"),this.getParentBounds(),this.updateCenter()},getMaxZoom:function(){var t=p(this.parentSize.width,this.gameSize.width,0,!0),e=p(this.parentSize.height,this.gameSize.height,0,!0);return Math.max(Math.min(t,e),1)},updateCenter:function(){var t=this.autoCenter;if(t!==s.CENTER.NO_CENTER){var e=this.canvas,i=e.style,n=e.getBoundingClientRect(),r=n.width,a=n.height,o=Math.floor((this.parentSize.width-r)/2),h=Math.floor((this.parentSize.height-a)/2);t===s.CENTER.CENTER_HORIZONTALLY?h=0:t===s.CENTER.CENTER_VERTICALLY&&(o=0),i.marginLeft=o+"px",i.marginTop=h+"px"}},updateBounds:function(){var t=this.canvasBounds,e=this.canvas.getBoundingClientRect();t.x=e.left+(window.pageXOffset||0)-(document.documentElement.clientLeft||0),t.y=e.top+(window.pageYOffset||0)-(document.documentElement.clientTop||0),t.width=e.width,t.height=e.height},transformX:function(t){return(t-this.canvasBounds.left)*this.displayScale.x},transformY:function(t){return(t-this.canvasBounds.top)*this.displayScale.y},startFullscreen:function(t){void 0===t&&(t={navigationUI:"hide"});var e=this.fullscreen;if(e.available){if(!e.active){var i=this.getFullscreenTarget();e.keyboard?i[e.request](Element.ALLOW_KEYBOARD_INPUT):i[e.request](t)}}else this.emit(a.FULLSCREEN_UNSUPPORTED)},fullscreenSuccessHandler:function(){this.getParentBounds(),this.refresh(),this.emit(a.ENTER_FULLSCREEN)},fullscreenErrorHandler:function(t){this.removeFullscreenTarget(),this.emit(a.FULLSCREEN_FAILED,t)},getFullscreenTarget:function(){if(!this.fullscreenTarget){var t=document.createElement("div");t.style.margin="0",t.style.padding="0",t.style.width="100%",t.style.height="100%",this.fullscreenTarget=t,this._createdFullscreenTarget=!0}this._createdFullscreenTarget&&(this.canvas.parentNode.insertBefore(this.fullscreenTarget,this.canvas),this.fullscreenTarget.appendChild(this.canvas));return this.fullscreenTarget},removeFullscreenTarget:function(){if(this._createdFullscreenTarget){var t=this.fullscreenTarget;if(t&&t.parentNode){var e=t.parentNode;e.insertBefore(this.canvas,t),e.removeChild(t)}}},stopFullscreen:function(){var t=this.fullscreen;if(!t.available)return this.emit(a.FULLSCREEN_UNSUPPORTED),!1;t.active&&document[t.cancel](),this.removeFullscreenTarget(),this.getParentBounds(),this.emit(a.LEAVE_FULLSCREEN),this.refresh()},toggleFullscreen:function(t){this.fullscreen.active?this.stopFullscreen():this.startFullscreen(t)},startListeners:function(){var t=this,e=this.listeners;if(e.orientationChange=function(){t.updateBounds(),t._checkOrientation=!0,t.dirty=!0},e.windowResize=function(){t.updateBounds(),t.dirty=!0},window.addEventListener("orientationchange",e.orientationChange,!1),window.addEventListener("resize",e.windowResize,!1),this.fullscreen.available){e.fullScreenChange=function(e){return t.onFullScreenChange(e)},e.fullScreenError=function(e){return t.onFullScreenError(e)};["webkit","moz",""].forEach((function(t){document.addEventListener(t+"fullscreenchange",e.fullScreenChange,!1),document.addEventListener(t+"fullscreenerror",e.fullScreenError,!1)})),document.addEventListener("MSFullscreenChange",e.fullScreenChange,!1),document.addEventListener("MSFullscreenError",e.fullScreenError,!1)}},onFullScreenChange:function(){document.fullscreenElement||document.webkitFullscreenElement||document.msFullscreenElement||document.mozFullScreenElement?this.fullscreenSuccessHandler():this.stopFullscreen()},onFullScreenError:function(){this.removeFullscreenTarget()},getViewPort:function(t){void 0===t&&(t=new d);var e,i,s=this.baseSize,n=this.parentSize,r=this.canvasBounds,a=this.displayScale,o=r.x>=0?0:-r.x*a.x,h=r.y>=0?0:-r.y*a.y;return e=n.width>=r.width?s.width:s.width-(r.width-n.width)*a.x,i=n.height>=r.height?s.height:s.height-(r.height-n.height)*a.y,t.setTo(o,h,e,i),t},step:function(t,e){this.parent&&(this._lastCheck+=e,(this.dirty||this._lastCheck>this.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var t=this.listeners;window.removeEventListener("orientationchange",t.orientationChange,!1),window.removeEventListener("resize",t.windowResize,!1);["webkit","moz",""].forEach((function(e){document.removeEventListener(e+"fullscreenchange",t.fullScreenChange,!1),document.removeEventListener(e+"fullscreenerror",t.fullScreenError,!1)})),document.removeEventListener("MSFullscreenChange",t.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",t.fullScreenError,!1)},destroy:function(){this.removeAllListeners(),this.stopListeners(),this.game=null,this.canvas=null,this.canvasBounds=null,this.parent=null,this.fullscreenTarget=null,this.parentSize.destroy(),this.gameSize.destroy(),this.baseSize.destroy(),this.displaySize.destroy()},isFullscreen:{get:function(){return this.fullscreen.active}},width:{get:function(){return this.gameSize.width}},height:{get:function(){return this.gameSize.height}},isPortrait:{get:function(){return this.orientation===s.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===s.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});t.exports=g},35098:t=>{t.exports={NO_CENTER:0,CENTER_BOTH:1,CENTER_HORIZONTALLY:2,CENTER_VERTICALLY:3}},53539:t=>{t.exports={LANDSCAPE:"landscape-primary",PORTRAIT:"portrait-primary"}},12637:t=>{t.exports={NONE:0,WIDTH_CONTROLS_HEIGHT:1,HEIGHT_CONTROLS_WIDTH:2,FIT:3,ENVELOP:4,RESIZE:5}},10217:t=>{t.exports={NO_ZOOM:1,ZOOM_2X:2,ZOOM_4X:4,MAX_ZOOM:-1}},55301:(t,e,i)=>{var s={CENTER:i(35098),ORIENTATION:i(53539),SCALE_MODE:i(12637),ZOOM:i(10217)};t.exports=s},82085:t=>{t.exports="enterfullscreen"},11826:t=>{t.exports="fullscreenfailed"},56691:t=>{t.exports="fullscreenunsupported"},34739:t=>{t.exports="leavefullscreen"},26681:t=>{t.exports="orientationchange"},11428:t=>{t.exports="resize"},40444:(t,e,i)=>{t.exports={ENTER_FULLSCREEN:i(82085),FULLSCREEN_FAILED:i(11826),FULLSCREEN_UNSUPPORTED:i(56691),LEAVE_FULLSCREEN:i(34739),ORIENTATION_CHANGE:i(26681),RESIZE:i(11428)}},86754:(t,e,i)=>{var s=i(98611),n=i(55301),r={Center:i(35098),Events:i(40444),Orientation:i(53539),ScaleManager:i(756),ScaleModes:i(12637),Zoom:i(10217)};r=s(!1,r,n.CENTER),r=s(!1,r,n.ORIENTATION),r=s(!1,r,n.SCALE_MODE),r=s(!1,r,n.ZOOM),t.exports=r},47736:(t,e,i)=>{var s=i(72632),n=i(40587);t.exports=function(t){var e=t.game.config.defaultPhysicsSystem,i=s(t.settings,"physics",!1);if(e||i){var r=[];if(e&&r.push(n(e+"Physics")),i)for(var a in i)a=n(a.concat("Physics")),-1===r.indexOf(a)&&r.push(a);return r}}},91088:(t,e,i)=>{var s=i(72632);t.exports=function(t){var e=t.plugins.getDefaultScenePlugins(),i=s(t.settings,"plugins",!1);return Array.isArray(i)?i:e||[]}},90415:t=>{t.exports={game:"game",renderer:"renderer",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",scale:"scale",sound:"sound",textures:"textures",events:"events",cameras:"cameras",add:"add",make:"make",scenePlugin:"scene",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",impactPhysics:"impact",matterPhysics:"matter"}},87157:(t,e,i)=>{var s=i(56694),n=i(63946),r=new s({initialize:function(t){this.sys=new n(this,t),this.game,this.anims,this.cache,this.registry,this.sound,this.textures,this.events,this.cameras,this.add,this.make,this.scene,this.children,this.lights,this.data,this.input,this.load,this.time,this.tweens,this.physics,this.matter,this.scale,this.plugins,this.renderer},update:function(){}});t.exports=r},13553:(t,e,i)=>{var s=i(56694),n=i(92980),r=i(7599),a=i(97081),o=i(10850),h=i(683),l=i(72283),u=i(87157),c=i(63946),d=new s({initialize:function(t,e){if(this.game=t,this.keys={},this.scenes=[],this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,this.customViewports=0,e){Array.isArray(e)||(e=[e]);for(var i=0;i-1&&(delete this.keys[s],this.scenes.splice(i,1),this._start.indexOf(s)>-1&&(i=this._start.indexOf(s),this._start.splice(i,1)),e.sys.destroy())}return this},bootScene:function(t){var e,i=t.sys,s=i.settings;i.sceneUpdate=l,t.init&&(t.init.call(t,s.data),s.status=n.INIT,s.isTransition&&i.events.emit(r.TRANSITION_INIT,s.transitionFrom,s.transitionDuration)),i.load&&(e=i.load).reset(),e&&t.preload?(t.preload.call(t),s.status=n.LOADING,e.once(h.COMPLETE,this.loadComplete,this),e.start()):this.create(t)},loadComplete:function(t){this.game.sound&&this.game.sound.onBlurPausedSounds&&this.game.sound.unlock(),this.create(t.scene)},payloadComplete:function(t){this.bootScene(t.scene)},update:function(t,e){this.processQueue(),this.isProcessing=!0;for(var i=this.scenes.length-1;i>=0;i--){var s=this.scenes[i].sys;s.settings.status>n.START&&s.settings.status<=n.RUNNING&&s.step(t,e)}},render:function(t){for(var e=0;e=n.LOADING&&i.settings.status=n.START&&a<=n.CREATING)return this;if(a>=n.RUNNING&&a<=n.SLEEPING)r.shutdown(),r.sceneUpdate=l,r.start(e);else if(r.sceneUpdate=l,r.start(e),r.load&&(s=r.load),s&&r.settings.hasOwnProperty("pack")&&(s.reset(),s.addPack({payload:r.settings.pack})))return r.settings.status=n.LOADING,s.once(h.COMPLETE,this.payloadComplete,this),s.start(),this;return this.bootScene(i),this},stop:function(t,e){var i=this.getScene(t);if(i&&!i.sys.isTransitioning()&&i.sys.settings.status!==n.SHUTDOWN){var s=i.sys.load;s.off(h.COMPLETE,this.loadComplete,this),s.off(h.COMPLETE,this.payloadComplete,this),i.sys.shutdown(e)}return this},switch:function(t,e){var i=this.getScene(t),s=this.getScene(e);return i&&s&&i!==s&&(this.sleep(t),this.isSleeping(e)?this.wake(e):this.start(e)),this},getAt:function(t){return this.scenes[t]},getIndex:function(t){var e=this.getScene(t);return this.scenes.indexOf(e)},bringToTop:function(t){if(this.isProcessing)this._queue.push({op:"bringToTop",keyA:t,keyB:null});else{var e=this.getIndex(t);if(-1!==e&&e0){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.unshift(i)}}return this},moveDown:function(t){if(this.isProcessing)this._queue.push({op:"moveDown",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e>0){var i=e-1,s=this.getScene(t),n=this.getAt(i);this.scenes[e]=n,this.scenes[i]=s}}return this},moveUp:function(t){if(this.isProcessing)this._queue.push({op:"moveUp",keyA:t,keyB:null});else{var e=this.getIndex(t);if(ei),0,n)}}return this},moveBelow:function(t,e){if(t===e)return this;if(this.isProcessing)this._queue.push({op:"moveBelow",keyA:t,keyB:e});else{var i=this.getIndex(t),s=this.getIndex(e);if(-1!==i&&-1!==s&&s>i){var n=this.getAt(s);this.scenes.splice(s,1),0===i?this.scenes.unshift(n):this.scenes.splice(i-(s{var s=i(82897),n=i(56694),r=i(7599),a=i(72632),o=i(91963),h=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.key=t.sys.settings.key,this.manager=t.sys.game.scene,this.transitionProgress=0,this._elapsed=0,this._target=null,this._duration=0,this._onUpdate,this._onUpdateScope,this._willSleep=!1,this._willRemove=!1,t.sys.events.once(r.BOOT,this.boot,this),t.sys.events.on(r.START,this.pluginStart,this)},boot:function(){this.systems.events.once(r.DESTROY,this.destroy,this)},pluginStart:function(){this._target=null,this.systems.events.once(r.SHUTDOWN,this.shutdown,this)},start:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",this.key),this.manager.queueOp("start",t,e),this},restart:function(t){var e=this.key;return this.manager.queueOp("stop",e),this.manager.queueOp("start",e,t),this},transition:function(t){void 0===t&&(t={});var e=a(t,"target",!1),i=this.manager.getScene(e);if(!e||!this.checkValidTransition(i))return!1;var s=a(t,"duration",1e3);this._elapsed=0,this._target=i,this._duration=s,this._willSleep=a(t,"sleep",!1),this._willRemove=a(t,"remove",!1);var n=a(t,"onUpdate",null);n&&(this._onUpdate=n,this._onUpdateScope=a(t,"onUpdateScope",this.scene));var o=a(t,"allowInput",!1);this.settings.transitionAllowInput=o;var h=i.sys.settings;return h.isTransition=!0,h.transitionFrom=this.scene,h.transitionDuration=s,h.transitionAllowInput=o,a(t,"moveAbove",!1)?this.manager.moveAbove(this.key,e):a(t,"moveBelow",!1)&&this.manager.moveBelow(this.key,e),i.sys.isSleeping()?i.sys.wake(a(t,"data")):this.manager.start(e,a(t,"data")),this.systems.events.emit(r.TRANSITION_OUT,i,s),this.systems.events.on(r.UPDATE,this.step,this),!0},checkValidTransition:function(t){return!(!t||t.sys.isActive()||t.sys.isTransitioning()||t===this.scene||this.systems.isTransitioning())},step:function(t,e){this._elapsed+=e,this.transitionProgress=s(this._elapsed/this._duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.transitionProgress),this._elapsed>=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;this.systems.events.off(r.UPDATE,this.step,this),t.events.emit(r.TRANSITION_COMPLETE,this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i,s){return this.manager.add(t,e,i,s)},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t){return t!==this.key&&this.manager.queueOp("switch",this.key,t),this},stop:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t,e),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var s=this.manager.getScene(e);return s&&s.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isPaused:function(t){return void 0===t&&(t=this.key),this.manager.isPaused(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getStatus:function(t){var e=this.manager.getScene(t);if(e)return e.sys.getStatus()},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off(r.SHUTDOWN,this.shutdown,this),t.off(r.POST_UPDATE,this.step,this),t.off(r.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});o.register("ScenePlugin",h,"scenePlugin"),t.exports=h},36765:(t,e,i)=>{var s=i(92980),n=i(10850),r=i(30657),a=i(90415),o={create:function(t){return"string"==typeof t?t={key:t}:void 0===t&&(t={}),{status:s.PENDING,key:n(t,"key",""),active:n(t,"active",!1),visible:n(t,"visible",!0),isBooted:!1,isTransition:!1,transitionFrom:null,transitionDuration:0,transitionAllowInput:!0,data:{},pack:n(t,"pack",!1),cameras:n(t,"cameras",null),map:n(t,"map",r(a,n(t,"mapAdd",{}))),physics:n(t,"physics",{}),loader:n(t,"loader",{}),plugins:n(t,"plugins",!1),input:n(t,"input",{})}}};t.exports=o},63946:(t,e,i)=>{var s=i(56694),n=i(92980),r=i(18360),a=i(7599),o=i(47736),h=i(91088),l=i(86459),u=i(72283),c=i(36765),d=new s({initialize:function(t,e){this.scene=t,this.game,this.renderer,this.config=e,this.settings=c.create(e),this.canvas,this.context,this.anims,this.cache,this.plugins,this.registry,this.scale,this.sound,this.textures,this.add,this.cameras,this.displayList,this.events,this.make,this.scenePlugin,this.updateList,this.sceneUpdate=u},init:function(t){this.settings.status=n.INIT,this.sceneUpdate=u,this.game=t,this.renderer=t.renderer,this.canvas=t.canvas,this.context=t.context;var e=t.plugins;this.plugins=e,e.addToScene(this,r.Global,[r.CoreScene,h(this),o(this)]),this.events.emit(a.BOOT,this),this.settings.isBooted=!0},step:function(t,e){var i=this.events;i.emit(a.PRE_UPDATE,t,e),i.emit(a.UPDATE,t,e),this.sceneUpdate.call(this.scene,t,e),i.emit(a.POST_UPDATE,t,e)},render:function(t){var e=this.displayList;e.depthSort(),this.events.emit(a.PRE_RENDER,t),this.cameras.render(t,e),this.events.emit(a.RENDER,t)},queueDepthSort:function(){this.displayList.queueDepthSort()},depthSort:function(){this.displayList.depthSort()},pause:function(t){var e=this.settings,i=this.getStatus();return i!==n.CREATING&&i!==n.RUNNING?console.warn("Cannot pause non-running Scene",e.key):this.settings.active&&(e.status=n.PAUSED,e.active=!1,this.events.emit(a.PAUSE,this,t)),this},resume:function(t){var e=this.events,i=this.settings;return this.settings.active||(i.status=n.RUNNING,i.active=!0,e.emit(a.RESUME,this,t)),this},sleep:function(t){var e=this.settings,i=this.getStatus();return i!==n.CREATING&&i!==n.RUNNING?console.warn("Cannot sleep non-running Scene",e.key):(e.status=n.SLEEPING,e.active=!1,e.visible=!1,this.events.emit(a.SLEEP,this,t)),this},wake:function(t){var e=this.events,i=this.settings;return i.status=n.RUNNING,i.active=!0,i.visible=!0,e.emit(a.WAKE,this,t),i.isTransition&&e.emit(a.TRANSITION_WAKE,i.transitionFrom,i.transitionDuration),this},getData:function(){return this.settings.data},getStatus:function(){return this.settings.status},isSleeping:function(){return this.settings.status===n.SLEEPING},isActive:function(){return this.settings.status===n.RUNNING},isPaused:function(){return this.settings.status===n.PAUSED},isTransitioning:function(){return this.settings.isTransition||null!==this.scenePlugin._target},isTransitionOut:function(){return null!==this.scenePlugin._target&&this.scenePlugin._duration>0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(t){return this.settings.visible=t,this},setActive:function(t,e){return t?this.resume(e):this.pause(e)},start:function(t){var e=this.events,i=this.settings;t&&(i.data=t),i.status=n.START,i.active=!0,i.visible=!0,e.emit(a.START,this),e.emit(a.READY,this,t)},shutdown:function(t){var e=this.events,i=this.settings;e.off(a.TRANSITION_INIT),e.off(a.TRANSITION_START),e.off(a.TRANSITION_COMPLETE),e.off(a.TRANSITION_OUT),i.status=n.SHUTDOWN,i.active=!1,i.visible=!1,this.renderer===l.WEBGL&&this.renderer.resetTextures(!0),e.emit(a.SHUTDOWN,this,t)},destroy:function(){var t=this.events,e=this.settings;e.status=n.DESTROYED,e.active=!1,e.visible=!1,t.emit(a.DESTROY,this),t.removeAllListeners();for(var i=["scene","game","anims","cache","plugins","registry","sound","textures","add","camera","displayList","events","make","scenePlugin","updateList"],s=0;s{t.exports={PENDING:0,INIT:1,START:2,LOADING:3,CREATING:4,RUNNING:5,PAUSED:6,SLEEPING:7,SHUTDOWN:8,DESTROYED:9}},31803:t=>{t.exports="addedtoscene"},94817:t=>{t.exports="boot"},28977:t=>{t.exports="create"},91959:t=>{t.exports="destroy"},363:t=>{t.exports="pause"},15643:t=>{t.exports="postupdate"},17058:t=>{t.exports="prerender"},77125:t=>{t.exports="preupdate"},76018:t=>{t.exports="ready"},28620:t=>{t.exports="removedfromscene"},41538:t=>{t.exports="render"},34268:t=>{t.exports="resume"},2342:t=>{t.exports="shutdown"},96541:t=>{t.exports="sleep"},74244:t=>{t.exports="start"},17046:t=>{t.exports="transitioncomplete"},13637:t=>{t.exports="transitioninit"},14733:t=>{t.exports="transitionout"},33899:t=>{t.exports="transitionstart"},52418:t=>{t.exports="transitionwake"},31735:t=>{t.exports="update"},8470:t=>{t.exports="wake"},7599:(t,e,i)=>{t.exports={ADDED_TO_SCENE:i(31803),BOOT:i(94817),CREATE:i(28977),DESTROY:i(91959),PAUSE:i(363),POST_UPDATE:i(15643),PRE_RENDER:i(17058),PRE_UPDATE:i(77125),READY:i(76018),REMOVED_FROM_SCENE:i(28620),RENDER:i(41538),RESUME:i(34268),SHUTDOWN:i(2342),SLEEP:i(96541),START:i(74244),TRANSITION_COMPLETE:i(17046),TRANSITION_INIT:i(13637),TRANSITION_OUT:i(14733),TRANSITION_START:i(33899),TRANSITION_WAKE:i(52418),UPDATE:i(31735),WAKE:i(8470)}},20436:(t,e,i)=>{var s=i(92980),n=i(98611),r={Events:i(7599),GetPhysicsPlugins:i(47736),GetScenePlugins:i(91088),SceneManager:i(13553),ScenePlugin:i(64051),Settings:i(36765),Systems:i(63946)};r=n(!1,r,s),t.exports=r},25798:(t,e,i)=>{var s=i(56694),n=i(6659),r=i(76038),a=i(98611),o=i(72283),h=new s({Extends:n,initialize:function(t,e,i){n.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=this.duration||0,this.totalDuration=this.totalDuration||0,this.config={mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0},this.currentConfig=this.config,this.config=a(this.config,i),this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(console.error("addMarker "+t.name+" already exists in Sound"),!1):(t=a(!0,{name:"",start:0,duration:this.totalDuration-(t.start||0),config:{mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0}},t),this.markers[t.name]=t,!0))},updateMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(this.markers[t.name]=a(!0,this.markers[t.name],t),!0):(console.warn("Audio Marker: "+t.name+" missing in Sound: "+this.key),!1))},removeMarker:function(t){var e=this.markers[t];return e?(this.markers[t]=null,e):null},play:function(t,e){if(void 0===t&&(t=""),"object"==typeof t&&(e=t,t=""),"string"!=typeof t)return!1;if(t){if(!this.markers[t])return console.warn("Marker: "+t+" missing in Sound: "+this.key),!1;this.currentMarker=this.markers[t],this.currentConfig=this.currentMarker.config,this.duration=this.currentMarker.duration}else this.currentMarker=null,this.currentConfig=this.config,this.duration=this.totalDuration;return this.resetConfig(),this.currentConfig=a(this.currentConfig,e),this.isPlaying=!0,this.isPaused=!1,!0},pause:function(){return!(this.isPaused||!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!0,!0)},resume:function(){return!(!this.isPaused||this.isPlaying)&&(this.isPlaying=!0,this.isPaused=!1,!0)},stop:function(){return!(!this.isPaused&&!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!1,this.resetConfig(),!0)},applyConfig:function(){this.mute=this.currentConfig.mute,this.volume=this.currentConfig.volume,this.rate=this.currentConfig.rate,this.detune=this.currentConfig.detune,this.loop=this.currentConfig.loop,this.pan=this.currentConfig.pan},resetConfig:function(){this.currentConfig.seek=0,this.currentConfig.delay=0},update:o,calculateRate:function(){var t=this.currentConfig.detune+this.manager.detune,e=Math.pow(1.0005777895065548,t);this.totalRate=this.currentConfig.rate*this.manager.rate*e},destroy:function(){this.pendingRemove||(this.emit(r.DESTROY,this),this.removeAllListeners(),this.pendingRemove=!0,this.manager=null,this.config=null,this.currentConfig=null,this.markers=null,this.currentMarker=null)}});t.exports=h},12486:(t,e,i)=>{var s=i(56694),n=i(32742),r=i(6659),a=i(76038),o=i(97081),h=i(72283),l=i(71608),u=i(51463),c=new s({Extends:r,initialize:function(t){r.call(this),this.game=t,this.jsonCache=t.cache.json,this.sounds=[],this.mute=!1,this.volume=1,this.pauseOnBlur=!0,this._rate=1,this._detune=0,this.locked=this.locked||!1,this.unlocked=!1,t.events.on(o.BLUR,this.onGameBlur,this),t.events.on(o.FOCUS,this.onGameFocus,this),t.events.on(o.PRE_STEP,this.update,this),t.events.once(o.DESTROY,this.destroy,this)},add:h,addAudioSprite:function(t,e){void 0===e&&(e={});var i=this.add(t,e);for(var s in i.spritemap=this.jsonCache.get(t).spritemap,i.spritemap)if(i.spritemap.hasOwnProperty(s)){var r=n(e),a=i.spritemap[s];r.loop=!!a.hasOwnProperty("loop")&&a.loop,i.addMarker({name:s,start:a.start,duration:a.end-a.start,config:r})}return i},get:function(t){return u(this.sounds,"key",t)},getAll:function(t){return l(this.sounds,"key",t)},play:function(t,e){var i=this.add(t);return i.once(a.COMPLETE,i.destroy,i),e?e.name?(i.addMarker(e),i.play(e.name)):i.play(e):i.play()},playAudioSprite:function(t,e,i){var s=this.addAudioSprite(t);return s.once(a.COMPLETE,s.destroy,s),s.play(e,i)},remove:function(t){var e=this.sounds.indexOf(t);return-1!==e&&(t.destroy(),this.sounds.splice(e,1),!0)},removeAll:function(){this.sounds.forEach((function(t){t.destroy()})),this.sounds.length=0},removeByKey:function(t){for(var e=0,i=this.sounds.length-1;i>=0;i--){var s=this.sounds[i];s.key===t&&(s.destroy(),this.sounds.splice(i,1),e++)}return e},pauseAll:function(){this.forEachActiveSound((function(t){t.pause()})),this.emit(a.PAUSE_ALL,this)},resumeAll:function(){this.forEachActiveSound((function(t){t.resume()})),this.emit(a.RESUME_ALL,this)},stopAll:function(){this.forEachActiveSound((function(t){t.stop()})),this.emit(a.STOP_ALL,this)},stopByKey:function(t){var e=0;return this.getAll(t).forEach((function(t){t.stop()&&e++})),e},unlock:h,onBlur:h,onFocus:h,onGameBlur:function(){this.pauseOnBlur&&this.onBlur()},onGameFocus:function(){this.pauseOnBlur&&this.onFocus()},update:function(t,e){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit(a.UNLOCKED,this));for(var i=this.sounds.length-1;i>=0;i--)this.sounds[i].pendingRemove&&this.sounds.splice(i,1);this.sounds.forEach((function(i){i.update(t,e)}))},destroy:function(){this.game.events.off(o.BLUR,this.onGameBlur,this),this.game.events.off(o.FOCUS,this.onGameFocus,this),this.game.events.off(o.PRE_STEP,this.update,this),this.removeAllListeners(),this.removeAll(),this.sounds.length=0,this.sounds=null,this.game=null},forEachActiveSound:function(t,e){var i=this;this.sounds.forEach((function(s,n){s&&!s.pendingRemove&&t.call(e||i,s,n,i.sounds)}))},setRate:function(t){return this.rate=t,this},rate:{get:function(){return this._rate},set:function(t){this._rate=t,this.forEachActiveSound((function(t){t.calculateRate()})),this.emit(a.GLOBAL_RATE,this,t)}},setDetune:function(t){return this.detune=t,this},detune:{get:function(){return this._detune},set:function(t){this._detune=t,this.forEachActiveSound((function(t){t.calculateRate()})),this.emit(a.GLOBAL_DETUNE,this,t)}}});t.exports=c},84191:(t,e,i)=>{var s=i(27622),n=i(17546),r=i(55491),a={create:function(t){var e=t.config.audio,i=t.device.audio;return e.noAudio||!i.webAudio&&!i.audioData?new n(t):i.webAudio&&!e.disableWebAudio?new r(t):new s(t)}};t.exports=a},77578:t=>{t.exports="complete"},19679:t=>{t.exports="decodedall"},56951:t=>{t.exports="decoded"},16436:t=>{t.exports="destroy"},55154:t=>{t.exports="detune"},57818:t=>{t.exports="detune"},57890:t=>{t.exports="mute"},83022:t=>{t.exports="rate"},99170:t=>{t.exports="volume"},64289:t=>{t.exports="looped"},67214:t=>{t.exports="loop"},53128:t=>{t.exports="mute"},73078:t=>{t.exports="pan"},76763:t=>{t.exports="pauseall"},88426:t=>{t.exports="pause"},13765:t=>{t.exports="play"},80291:t=>{t.exports="rate"},11124:t=>{t.exports="resumeall"},55382:t=>{t.exports="resume"},71157:t=>{t.exports="seek"},31776:t=>{t.exports="stopall"},39450:t=>{t.exports="stop"},21939:t=>{t.exports="unlocked"},33019:t=>{t.exports="volume"},76038:(t,e,i)=>{t.exports={COMPLETE:i(77578),DECODED:i(56951),DECODED_ALL:i(19679),DESTROY:i(16436),DETUNE:i(55154),GLOBAL_DETUNE:i(57818),GLOBAL_MUTE:i(57890),GLOBAL_RATE:i(83022),GLOBAL_VOLUME:i(99170),LOOP:i(67214),LOOPED:i(64289),MUTE:i(53128),PAN:i(73078),PAUSE_ALL:i(76763),PAUSE:i(88426),PLAY:i(13765),RATE:i(80291),RESUME_ALL:i(11124),RESUME:i(55382),SEEK:i(71157),STOP_ALL:i(31776),STOP:i(39450),UNLOCKED:i(21939),VOLUME:i(33019)}},34350:(t,e,i)=>{var s=i(25798),n=i(56694),r=i(76038),a=i(82897),o=new n({Extends:s,initialize:function(t,e,i){if(void 0===i&&(i={}),this.tags=t.game.cache.audio.get(e),!this.tags)throw new Error('No cached audio asset with key "'+e);this.audio=null,this.startTime=0,this.previousTime=0,this.duration=this.tags[0].duration,this.totalDuration=this.tags[0].duration,s.call(this,t,e,i)},play:function(t,e){return!this.manager.isLocked(this,"play",[t,e])&&(!!s.prototype.play.call(this,t,e)&&(!!this.pickAndPlayAudioTag()&&(this.emit(r.PLAY,this),!0)))},pause:function(){return!this.manager.isLocked(this,"pause")&&(!(this.startTime>0)&&(!!s.prototype.pause.call(this)&&(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit(r.PAUSE,this),!0)))},resume:function(){return!this.manager.isLocked(this,"resume")&&(!(this.startTime>0)&&(!!s.prototype.resume.call(this)&&(!!this.pickAndPlayAudioTag()&&(this.emit(r.RESUME,this),!0))))},stop:function(){return!this.manager.isLocked(this,"stop")&&(!!s.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit(r.STOP,this),!0))},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var t=this.currentConfig.seek,e=this.currentConfig.delay,i=(this.currentMarker?this.currentMarker.start:0)+t;return this.previousTime=i,this.audio.currentTime=i,this.applyConfig(),0===e?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+1e3*e,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var t=0;t0)this.startTime=i-this.manager.loopEndOffset?(this.audio.currentTime=e+Math.max(0,s-i),s=this.audio.currentTime):s=i)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit(r.COMPLETE,this);this.previousTime=s}},destroy:function(){s.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=a(this.currentConfig.volume*this.manager.volume,0,1))},calculateRate:function(){s.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(t){this.currentConfig.mute=t,this.manager.isLocked(this,"mute",t)||(this.updateMute(),this.emit(r.MUTE,this,t))}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.currentConfig.volume},set:function(t){this.currentConfig.volume=t,this.manager.isLocked(this,"volume",t)||(this.updateVolume(),this.emit(r.VOLUME,this,t))}},setVolume:function(t){return this.volume=t,this},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.manager.isLocked(this,r.RATE,t)||(this.calculateRate(),this.emit(r.RATE,this,t))}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.manager.isLocked(this,r.DETUNE,t)||(this.calculateRate(),this.emit(r.DETUNE,this,t))}},setDetune:function(t){return this.detune=t,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.isLocked(this,"seek",t)||this.startTime>0||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.isPlaying?(this.previousTime=t,this.audio.currentTime=t):this.isPaused&&(this.currentConfig.seek=t),this.emit(r.SEEK,this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.manager.isLocked(this,"loop",t)||(this.audio&&(this.audio.loop=t),this.emit(r.LOOP,this,t))}},setLoop:function(t){return this.loop=t,this},pan:{get:function(){return this.currentConfig.pan},set:function(t){this.currentConfig.pan=t,this.emit(r.PAN,this,t)}},setPan:function(t){return this.pan=t,this}});t.exports=o},27622:(t,e,i)=>{var s=i(12486),n=i(56694),r=i(76038),a=i(34350),o=new n({Extends:s,initialize:function(t){this.override=!0,this.audioPlayDelay=.1,this.loopEndOffset=.05,this.onBlurPausedSounds=[],this.locked="ontouchstart"in window,this.lockedActionsQueue=this.locked?[]:null,this._mute=!1,this._volume=1,s.call(this,t)},add:function(t,e){var i=new a(this,t,e);return this.sounds.push(i),i},unlock:function(){this.locked=!1;var t=this;if(this.game.cache.audio.entries.each((function(e,i){for(var s=0;s{t.exports={SoundManagerCreator:i(84191),Events:i(76038),BaseSound:i(25798),BaseSoundManager:i(12486),WebAudioSound:i(96008),WebAudioSoundManager:i(55491),HTML5AudioSound:i(34350),HTML5AudioSoundManager:i(27622),NoAudioSound:i(38662),NoAudioSoundManager:i(17546)}},38662:(t,e,i)=>{var s=i(25798),n=i(56694),r=i(6659),a=i(98611),o=i(72283),h=function(){return!1},l=function(){return null},u=function(){return this},c=new n({Extends:r,initialize:function(t,e,i){void 0===i&&(i={}),r.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=0,this.totalDuration=0,this.config=a({mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0},i),this.currentConfig=this.config,this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.seek=0,this.loop=!1,this.pan=0,this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:h,updateMarker:h,removeMarker:l,play:h,pause:h,resume:h,stop:h,setMute:u,setVolume:u,setRate:u,setDetune:u,setSeek:u,setLoop:u,setPan:u,applyConfig:l,resetConfig:l,update:o,calculateRate:l,destroy:function(){s.prototype.destroy.call(this)}});t.exports=c},17546:(t,e,i)=>{var s=i(12486),n=i(56694),r=i(6659),a=i(38662),o=i(72283),h=new n({Extends:r,initialize:function(t){r.call(this),this.game=t,this.sounds=[],this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.pauseOnBlur=!0,this.locked=!1},add:function(t,e){var i=new a(this,t,e);return this.sounds.push(i),i},addAudioSprite:function(t,e){var i=this.add(t,e);return i.spritemap={},i},get:function(t){return s.prototype.get.call(this,t)},getAll:function(t){return s.prototype.getAll.call(this,t)},play:function(t,e){return!1},playAudioSprite:function(t,e,i){return!1},remove:function(t){return s.prototype.remove.call(this,t)},removeAll:function(){return s.prototype.removeAll.call(this)},removeByKey:function(t){return s.prototype.removeByKey.call(this,t)},stopByKey:function(t){return s.prototype.stopByKey.call(this,t)},onBlur:o,onFocus:o,onGameBlur:o,onGameFocus:o,pauseAll:o,resumeAll:o,stopAll:o,update:o,setRate:o,setDetune:o,setMute:o,setVolume:o,unlock:o,forEachActiveSound:function(t,e){s.prototype.forEachActiveSound.call(this,t,e)},destroy:function(){s.prototype.destroy.call(this)}});t.exports=h},96008:(t,e,i)=>{var s=i(25798),n=i(56694),r=i(76038),a=new n({Extends:s,initialize:function(t,e,i){if(void 0===i&&(i={}),this.audioBuffer=t.game.cache.audio.get(e),!this.audioBuffer)throw new Error('Audio key "'+e+'" missing from cache');this.source=null,this.loopSource=null,this.muteNode=t.context.createGain(),this.volumeNode=t.context.createGain(),this.pannerNode=null,this.playTime=0,this.startTime=0,this.loopTime=0,this.rateUpdates=[],this.hasEnded=!1,this.hasLooped=!1,this.muteNode.connect(this.volumeNode),t.context.createStereoPanner?(this.pannerNode=t.context.createStereoPanner(),this.volumeNode.connect(this.pannerNode),this.pannerNode.connect(t.destination)):this.volumeNode.connect(t.destination),this.duration=this.audioBuffer.duration,this.totalDuration=this.audioBuffer.duration,s.call(this,t,e,i)},play:function(t,e){return!!s.prototype.play.call(this,t,e)&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource(),this.emit(r.PLAY,this),!0)},pause:function(){return!(this.manager.context.currentTime{var s=i(82329),n=i(12486),r=i(56694),a=i(76038),o=i(97081),h=i(96008),l=new r({Extends:n,initialize:function(t){this.context=this.createAudioContext(t),this.masterMuteNode=this.context.createGain(),this.masterVolumeNode=this.context.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(this.context.destination),this.destination=this.masterMuteNode,this.locked="suspended"===this.context.state&&("ontouchstart"in window||"onclick"in window),n.call(this,t),this.locked&&t.isBooted?this.unlock():t.events.once(o.BOOT,this.unlock,this)},createAudioContext:function(t){var e=t.config.audio;return e.context?(e.context.resume(),e.context):window.hasOwnProperty("AudioContext")?new AudioContext:window.hasOwnProperty("webkitAudioContext")?new window.webkitAudioContext:void 0},setAudioContext:function(t){return this.context&&this.context.close(),this.masterMuteNode&&this.masterMuteNode.disconnect(),this.masterVolumeNode&&this.masterVolumeNode.disconnect(),this.context=t,this.masterMuteNode=t.createGain(),this.masterVolumeNode=t.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(t.destination),this.destination=this.masterMuteNode,this},add:function(t,e){var i=new h(this,t,e);return this.sounds.push(i),i},decodeAudio:function(t,e){var i;i=Array.isArray(t)?t:[{key:t,data:e}];for(var n=this.game.cache.audio,r=i.length,o=0;o{var s=i(59959),n=i(56694),r=i(72283),a=i(17922),o=new n({initialize:function(t){this.parent=t,this.list=[],this.position=0,this.addCallback=r,this.removeCallback=r,this._sortKey=""},add:function(t,e){return e?s.Add(this.list,t):s.Add(this.list,t,0,this.addCallback,this)},addAt:function(t,e,i){return i?s.AddAt(this.list,t,e):s.AddAt(this.list,t,e,0,this.addCallback,this)},getAt:function(t){return this.list[t]},getIndex:function(t){return this.list.indexOf(t)},sort:function(t,e){return t?(void 0===e&&(e=function(e,i){return e[t]-i[t]}),a(this.list,e),this):this},getByName:function(t){return s.GetFirst(this.list,"name",t)},getRandom:function(t,e){return s.GetRandom(this.list,t,e)},getFirst:function(t,e,i,n){return s.GetFirst(this.list,t,e,i,n)},getAll:function(t,e,i,n){return s.GetAll(this.list,t,e,i,n)},count:function(t,e){return s.CountAllMatching(this.list,t,e)},swap:function(t,e){s.Swap(this.list,t,e)},moveTo:function(t,e){return s.MoveTo(this.list,t,e)},moveAbove:function(t,e){return s.MoveAbove(this.list,t,e)},moveBelow:function(t,e){return s.MoveBelow(this.list,t,e)},remove:function(t,e){return e?s.Remove(this.list,t):s.Remove(this.list,t,this.removeCallback,this)},removeAt:function(t,e){return e?s.RemoveAt(this.list,t):s.RemoveAt(this.list,t,this.removeCallback,this)},removeBetween:function(t,e,i){return i?s.RemoveBetween(this.list,t,e):s.RemoveBetween(this.list,t,e,this.removeCallback,this)},removeAll:function(t){for(var e=this.list.length;e--;)this.remove(this.list[e],t);return this},bringToTop:function(t){return s.BringToTop(this.list,t)},sendToBack:function(t){return s.SendToBack(this.list,t)},moveUp:function(t){return s.MoveUp(this.list,t),t},moveDown:function(t){return s.MoveDown(this.list,t),t},reverse:function(){return this.list.reverse(),this},shuffle:function(){return s.Shuffle(this.list),this},replace:function(t,e){return s.Replace(this.list,t,e)},exists:function(t){return this.list.indexOf(t)>-1},setAll:function(t,e,i,n){return s.SetAll(this.list,t,e,i,n),this},each:function(t,e){for(var i=[null],s=2;s0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}}});t.exports=o},33885:(t,e,i)=>{var s=new(i(56694))({initialize:function(t){if(this.entries={},this.size=0,Array.isArray(t))for(var e=0;e{var s=i(56694),n=i(6659),r=i(36716),a=new s({Extends:n,initialize:function(){n.call(this),this._pending=[],this._active=[],this._destroy=[],this._toProcess=0,this.checkQueue=!1},isActive:function(t){return this._active.indexOf(t)>-1},isPending:function(t){return this._toProcess>0&&this._pending.indexOf(t)>-1},isDestroying:function(t){return this._destroy.indexOf(t)>-1},add:function(t){return this.checkQueue&&(this.isActive(t)||this.isPending(t))||(this._pending.push(t),this._toProcess++),t},remove:function(t){if(this.isPending(t)){var e=this._pending,i=e.indexOf(t);-1!==i&&e.splice(i,1)}else this.isActive(t)&&(this._destroy.push(t),this._toProcess++);return t},removeAll:function(){for(var t=this._active,e=this._destroy,i=t.length;i--;)e.push(t[i]),this._toProcess++;return this},update:function(){if(0===this._toProcess)return this._active;var t,e,i=this._destroy,s=this._active;for(t=0;t{var s=i(53466);function n(t){if(!(this instanceof n))return new n(t,[".left",".top",".right",".bottom"]);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}function r(t,e,i){if(!i)return e.indexOf(t);for(var s=0;s=t.minX&&e.maxY>=t.minY}function v(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(t,e,i,n,r){for(var a,o=[e,i];o.length;)(i=o.pop())-(e=o.pop())<=n||(a=e+Math.ceil((i-e)/n/2)*n,s(t,a,e,i,r),o.push(e,a,a,i))}n.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],s=this.toBBox;if(!p(t,e))return i;for(var n,r,a,o,h=[];e;){for(n=0,r=e.children.length;n=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(n,r,e)},_split:function(t,e){var i=t[e],s=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,s);var r=this._chooseSplitIndex(i,n,s),o=v(i.children.splice(r,i.children.length-r));o.height=i.height,o.leaf=i.leaf,a(i,this.toBBox),a(o,this.toBBox),e?t[e-1].children.push(o):this._splitRoot(i,o)},_splitRoot:function(t,e){this.data=v([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var s,n,r,a,h,l,u,d,f,p,v,g,m,y;for(l=u=1/0,s=e;s<=i-e;s++)n=o(t,0,s,this.toBBox),r=o(t,s,i,this.toBBox),f=n,p=r,v=void 0,g=void 0,m=void 0,y=void 0,v=Math.max(f.minX,p.minX),g=Math.max(f.minY,p.minY),m=Math.min(f.maxX,p.maxX),y=Math.min(f.maxY,p.maxY),a=Math.max(0,m-v)*Math.max(0,y-g),h=c(n)+c(r),a=e;n--)r=t.children[n],h(u,t.leaf?a(r):r),c+=d(u);return c},_adjustParentBBoxes:function(t,e,i){for(var s=i;s>=0;s--)h(e[s],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():a(t[i],this.toBBox)},compareMinX:function(t,e){return t.left-e.left},compareMinY:function(t,e){return t.top-e.top},toBBox:function(t){return{minX:t.left,minY:t.top,maxX:t.right,maxY:t.bottom}}},t.exports=n},58403:(t,e,i)=>{var s=new(i(56694))({initialize:function(t){if(this.entries=[],Array.isArray(t))for(var e=0;e-1&&this.entries.splice(e,1),this},dump:function(){console.group("Set");for(var t=0;t-1},union:function(t){var e=new s;return t.entries.forEach((function(t){e.set(t)})),this.entries.forEach((function(t){e.set(t)})),e},intersect:function(t){var e=new s;return this.entries.forEach((function(i){t.contains(i)&&e.set(i)})),e},difference:function(t){var e=new s;return this.entries.forEach((function(i){t.contains(i)||e.set(i)})),e},size:{get:function(){return this.entries.length},set:function(t){return t{var s=i(82897),n=i(56694),r=i(84314),a=i(93736),o=new n({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===s&&(s=null),this._width=t,this._height=e,this._parent=s,this.aspectMode=i,this.aspectRatio=0===e?1:t/e,this.minWidth=0,this.minHeight=0,this.maxWidth=Number.MAX_VALUE,this.maxHeight=Number.MAX_VALUE,this.snapTo=new a},setAspectMode:function(t){return void 0===t&&(t=0),this.aspectMode=t,this.setSize(this._width,this._height)},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.snapTo.set(t,e),this.setSize(this._width,this._height)},setParent:function(t){return this._parent=t,this.setSize(this._width,this._height)},setMin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.minWidth=s(t,0,this.maxWidth),this.minHeight=s(e,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(t,e){return void 0===t&&(t=Number.MAX_VALUE),void 0===e&&(e=t),this.maxWidth=s(t,this.minWidth,Number.MAX_VALUE),this.maxHeight=s(e,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(t,e){switch(void 0===t&&(t=0),void 0===e&&(e=t),this.aspectMode){case o.NONE:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height;break;case o.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case o.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(r(e,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case o.FIT:this.constrain(t,e,!0);break;case o.ENVELOP:this.constrain(t,e,!1)}return this},setAspectRatio:function(t){return this.aspectRatio=t,this.setSize(this._width,this._height)},resize:function(t,e){return this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height,this},getNewWidth:function(t,e){return void 0===e&&(e=!0),t=s(t,this.minWidth,this.maxWidth),e&&this._parent&&t>this._parent.width&&(t=Math.max(this.minWidth,this._parent.width)),t},getNewHeight:function(t,e){return void 0===e&&(e=!0),t=s(t,this.minHeight,this.maxHeight),e&&this._parent&&t>this._parent.height&&(t=Math.max(this.minHeight,this._parent.height)),t},constrain:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=!0),t=this.getNewWidth(t),e=this.getNewHeight(e);var s=this.snapTo,n=0===e?1:t/e;return i&&this.aspectRatio>n||!i&&this.aspectRatio0&&(t=(e=r(e,s.y))*this.aspectRatio)):(i&&this.aspectRation)&&(t=(e=r(e,s.y))*this.aspectRatio,s.x>0&&(e=(t=r(t,s.x))*(1/this.aspectRatio))),this._width=t,this._height=e,this},fitTo:function(t,e){return this.constrain(t,e,!0)},envelop:function(t,e){return this.constrain(t,e,!1)},setWidth:function(t){return this.setSize(t,this._height)},setHeight:function(t){return this.setSize(this._width,t)},toString:function(){return"[{ Size (width="+this._width+" height="+this._height+" aspectRatio="+this.aspectRatio+" aspectMode="+this.aspectMode+") }]"},setCSS:function(t){t&&t.style&&(t.style.width=this._width+"px",t.style.height=this._height+"px")},copy:function(t){return t.setAspectMode(this.aspectMode),t.aspectRatio=this.aspectRatio,t.setSize(this.width,this.height)},destroy:function(){this._parent=null,this.snapTo=null},width:{get:function(){return this._width},set:function(t){this.setSize(t,this._height)}},height:{get:function(){return this._height},set:function(t){this.setSize(this._width,t)}}});o.NONE=0,o.WIDTH_CONTROLS_HEIGHT=1,o.HEIGHT_CONTROLS_WIDTH=2,o.FIT=3,o.ENVELOP=4,t.exports=o},94160:t=>{t.exports="add"},95393:t=>{t.exports="remove"},36716:(t,e,i)=>{t.exports={PROCESS_QUEUE_ADD:i(94160),PROCESS_QUEUE_REMOVE:i(95393)}},20010:(t,e,i)=>{t.exports={Events:i(36716),List:i(71207),Map:i(33885),ProcessQueue:i(74623),RTree:i(68687),Set:i(58403),Size:i(90881)}},17487:(t,e,i)=>{var s=i(56694),n=i(82897),r=i(27119),a=i(86459),o=i(28621),h=i(31673),l=new s({Extends:h,initialize:function(t,e,i,s,n){h.call(this,t,e,i,s,n),this.add("__BASE",0,0,0,s,n),this._source=this.frames.__BASE.source,this.canvas=this._source.image,this.context=this.canvas.getContext("2d"),this.width=s,this.height=n,this.imageData=this.context.getImageData(0,0,s,n),this.data=null,this.imageData&&(this.data=this.imageData.data),this.pixels=null,this.buffer,this.data&&(this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data)},update:function(){return this.imageData=this.context.getImageData(0,0,this.width,this.height),this.data=this.imageData.data,this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data,this.manager.game.config.renderType===a.WEBGL&&this.refresh(),this},draw:function(t,e,i){return this.context.drawImage(i,t,e),this.update()},drawFrame:function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=0);var n=this.manager.getFrame(t,e);if(n){var r=n.canvasData,a=n.cutWidth,o=n.cutHeight,h=n.source.resolution;return this.context.drawImage(n.source.image,r.x,r.y,a,o,i,s,a/h,o/h),this.update()}return this},setPixel:function(t,e,i,s,n,r){if(void 0===r&&(r=255),t=Math.abs(Math.floor(t)),e=Math.abs(Math.floor(e)),this.getIndex(t,e)>-1){var a=this.context.getImageData(t,e,1,1);a.data[0]=i,a.data[1]=s,a.data[2]=n,a.data[3]=r,this.context.putImageData(a,t,e)}return this},putData:function(t,e,i,s,n,r,a){return void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=t.width),void 0===a&&(a=t.height),this.context.putImageData(t,e,i,s,n,r,a),this},getData:function(t,e,i,s){return t=n(Math.floor(t),0,this.width-1),e=n(Math.floor(e),0,this.height-1),i=n(i,1,this.width-t),s=n(s,1,this.height-e),this.context.getImageData(t,e,i,s)},getPixel:function(t,e,i){i||(i=new r);var s=this.getIndex(t,e);if(s>-1){var n=this.data,a=n[s+0],o=n[s+1],h=n[s+2],l=n[s+3];i.setTo(a,o,h,l)}return i},getPixels:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===s&&(s=i),t=Math.abs(Math.round(t)),e=Math.abs(Math.round(e));for(var a=n(t,0,this.width),o=n(t+i,0,this.width),h=n(e,0,this.height),l=n(e+s,0,this.height),u=new r,c=[],d=h;d{var s=i(56694),n=i(82897),r=i(98611),a=new s({initialize:function(t,e,i,s,n,r,a){this.texture=t,this.name=e,this.source=t.source[i],this.sourceIndex=i,this.glTexture=this.source.glTexture,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0}},this.setSize(r,a,s,n)},setSize:function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=0),this.cutX=i,this.cutY=s,this.cutWidth=t,this.cutHeight=e,this.width=t,this.height=e,this.halfWidth=Math.floor(.5*t),this.halfHeight=Math.floor(.5*e),this.centerX=Math.floor(t/2),this.centerY=Math.floor(e/2);var n=this.data,r=n.cut;r.x=i,r.y=s,r.w=t,r.h=e,r.r=i+t,r.b=s+e,n.sourceSize.w=t,n.sourceSize.h=e,n.spriteSourceSize.w=t,n.spriteSourceSize.h=e,n.radius=.5*Math.sqrt(t*t+e*e);var a=n.drawImage;return a.x=i,a.y=s,a.width=t,a.height=e,this.updateUVs()},setTrim:function(t,e,i,s,n,r){var a=this.data,o=a.spriteSourceSize;return a.trim=!0,a.sourceSize.w=t,a.sourceSize.h=e,o.x=i,o.y=s,o.w=n,o.h=r,o.r=i+n,o.b=s+r,this.x=i,this.y=s,this.width=n,this.height=r,this.halfWidth=.5*n,this.halfHeight=.5*r,this.centerX=Math.floor(n/2),this.centerY=Math.floor(r/2),this.updateUVs()},setCropUVs:function(t,e,i,s,r,a,o){var h=this.cutX,l=this.cutY,u=this.cutWidth,c=this.cutHeight,d=this.realWidth,f=this.realHeight,p=h+(e=n(e,0,d)),v=l+(i=n(i,0,f)),g=s=n(s,0,d-e),m=r=n(r,0,f-i),y=this.data;if(y.trim){var x=y.spriteSourceSize,T=e+(s=n(s,0,u-e)),w=i+(r=n(r,0,c-i));if(!(x.rT||x.y>w)){var E=Math.max(x.x,e),S=Math.max(x.y,i),b=Math.min(x.r,T)-E,A=Math.min(x.b,w)-S;g=b,m=A,p=a?h+(u-(E-x.x)-b):h+(E-x.x),v=o?l+(c-(S-x.y)-A):l+(S-x.y),e=E,i=S,s=b,r=A}else p=0,v=0,g=0,m=0}else a&&(p=h+(u-e-s)),o&&(v=l+(c-i-r));var _=this.source.width,C=this.source.height;return t.u0=Math.max(0,p/_),t.v0=Math.max(0,v/C),t.u1=Math.min(1,(p+g)/_),t.v1=Math.min(1,(v+m)/C),t.x=e,t.y=i,t.cx=p,t.cy=v,t.cw=g,t.ch=m,t.width=s,t.height=r,t.flipX=a,t.flipY=o,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},setUVs:function(t,e,i,s,n,r){var a=this.data.drawImage;return a.width=t,a.height=e,this.u0=i,this.v0=s,this.u1=n,this.v1=r,this},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,s=this.cutHeight,n=this.data.drawImage;n.width=i,n.height=s;var r=this.source.width,a=this.source.height;return this.u0=t/r,this.v0=e/a,this.u1=(t+i)/r,this.v1=(e+s)/a,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new a(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=r(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.source=null,this.texture=null,this.glTexture=null,this.customData=null,this.data=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=a},31673:(t,e,i)=>{var s=i(86459),n=i(56694),r=i(82047),a=i(32547),o='Texture "%s" has no frame "%s"',h=new n({initialize:function(t,e,i,s,n){Array.isArray(i)||(i=[i]),this.manager=t,this.key=e,this.source=[],this.dataSource=[],this.frames={},this.customData={},this.firstFrame="__BASE",this.frameTotal=0;for(var r=0;r{var s=i(61068),n=i(17487),r=i(56694),a=i(27119),o=i(86459),h=i(6659),l=i(38203),u=i(97081),c=i(52780),d=i(10850),f=i(69150),p=i(31673),v=new r({Extends:h,initialize:function(t){h.call(this),this.game=t,this.name="TextureManager",this.list={},this._tempCanvas=s.create2D(this),this._tempContext=this._tempCanvas.getContext("2d",{willReadFrequently:!0}),this._pending=0,t.events.once(u.BOOT,this.boot,this)},boot:function(){this._pending=3,this.on(l.LOAD,this.updatePending,this),this.on(l.ERROR,this.updatePending,this);var t=this.game.config;this.addBase64("__DEFAULT",t.defaultImage),this.addBase64("__MISSING",t.missingImage),this.addBase64("__WHITE",t.whiteImage),this.game.events.once(u.DESTROY,this.destroy,this)},updatePending:function(){this._pending--,0===this._pending&&(this.off(l.LOAD),this.off(l.ERROR),this.emit(l.READY))},checkKey:function(t){return!this.exists(t)||(console.error("Texture key already in use: "+t),!1)},remove:function(t){if("string"==typeof t){if(!this.exists(t))return console.warn("No texture found matching key: "+t),this;t=this.get(t)}return this.list.hasOwnProperty(t.key)&&(t.destroy(),this.emit(l.REMOVE,t.key),this.emit(l.REMOVE_KEY+t.key)),this},removeKey:function(t){return this.list.hasOwnProperty(t)&&delete this.list[t],this},addBase64:function(t,e){if(this.checkKey(t)){var i=this,s=new Image;s.onerror=function(){i.emit(l.ERROR,t)},s.onload=function(){var e=i.create(t,s);f.Image(e,0),i.emit(l.ADD,t,e),i.emit(l.ADD_KEY+t,e),i.emit(l.LOAD,t,e)},s.src=e}return this},getBase64:function(t,e,i,n){void 0===i&&(i="image/png"),void 0===n&&(n=.92);var r="",a=this.getFrame(t,e);if(a&&(a.source.isRenderTexture||a.source.isGLTexture))console.warn("Cannot getBase64 from WebGL Texture");else if(a){var o=a.canvasData,h=s.create2D(this,o.width,o.height),l=h.getContext("2d");o.width>0&&o.height>0&&l.drawImage(a.source.image,o.x,o.y,o.width,o.height,0,0,o.width,o.height),r=h.toDataURL(i,n),s.remove(h)}return r},addImage:function(t,e,i){var s=null;return this.checkKey(t)&&(s=this.create(t,e),f.Image(s,0),i&&s.setDataSource(i),this.emit(l.ADD,t,s),this.emit(l.ADD_KEY+t,s)),s},addGLTexture:function(t,e,i,s){var n=null;return this.checkKey(t)&&(void 0===i&&(i=e.width),void 0===s&&(s=e.height),(n=this.create(t,e,i,s)).add("__BASE",0,0,0,i,s),this.emit(l.ADD,t,n),this.emit(l.ADD_KEY+t,n)),n},addCompressedTexture:function(t,e,i){var s=null;if(this.checkKey(t)){if((s=this.create(t,e)).add("__BASE",0,0,0,e.width,e.height),i)if(Array.isArray(i))for(var n=0;n=r.x&&t=r.y&&e=r.x&&t=r.y&&e{var s=i(61068),n=i(56694),r=i(28621),a=i(27394),o=new n({initialize:function(t,e,i,s,n){void 0===n&&(n=!1);var o=t.manager.game;this.renderer=o.renderer,this.texture=t,this.source=e,this.image=e.compressed?null:e,this.compressionAlgorithm=e.compressed?e.format:null,this.resolution=1,this.width=i||e.naturalWidth||e.videoWidth||e.width||0,this.height=s||e.naturalHeight||e.videoHeight||e.height||0,this.scaleMode=a.DEFAULT,this.isCanvas=e instanceof HTMLCanvasElement,this.isVideo=window.hasOwnProperty("HTMLVideoElement")&&e instanceof HTMLVideoElement,this.isRenderTexture="RenderTexture"===e.type,this.isGLTexture=window.hasOwnProperty("WebGLTexture")&&e instanceof WebGLTexture,this.isPowerOf2=r(this.width,this.height),this.glTexture=null,this.glIndex=0,this.glIndexCounter=-1,this.flipY=n,this.init(o)},init:function(t){var e=this.renderer;e&&(e.gl?this.isCanvas?this.glTexture=e.createCanvasTexture(this.image,!1,this.flipY):this.isVideo?this.glTexture=e.createVideoTexture(this.image,!1,this.flipY):this.isRenderTexture?(this.image=this.source.canvas,this.glTexture=e.createTextureFromSource(null,this.width,this.height,this.scaleMode)):this.isGLTexture?this.glTexture=this.source:this.compressionAlgorithm?this.glTexture=e.createTextureFromSource(this.source):this.glTexture=e.createTextureFromSource(this.image,this.width,this.height,this.scaleMode):this.isRenderTexture&&(this.image=this.source.canvas)),t.config.antialias||this.setFilter(1)},setFilter:function(t){this.renderer.gl&&this.renderer.setTextureFilter(this.glTexture,t),this.scaleMode=t},setFlipY:function(t){return void 0===t&&(t=!0),this.flipY=t,this},update:function(){var t=this.renderer.gl;t&&this.isCanvas?this.glTexture=this.renderer.updateCanvasTexture(this.image,this.glTexture,this.flipY):t&&this.isVideo&&(this.glTexture=this.renderer.updateVideoTexture(this.image,this.glTexture,this.flipY))},destroy:function(){this.glTexture&&this.renderer.deleteTexture(this.glTexture,!0),this.isCanvas&&s.remove(this.image),this.renderer=null,this.texture=null,this.source=null,this.image=null,this.glTexture=null}});t.exports=o},65154:t=>{t.exports={LINEAR:0,NEAREST:1}},49644:t=>{t.exports="addtexture"},29569:t=>{t.exports="addtexture-"},60079:t=>{t.exports="onerror"},72665:t=>{t.exports="onload"},93006:t=>{t.exports="ready"},69018:t=>{t.exports="removetexture"},85549:t=>{t.exports="removetexture-"},38203:(t,e,i)=>{t.exports={ADD:i(49644),ADD_KEY:i(29569),ERROR:i(60079),LOAD:i(72665),READY:i(93006),REMOVE:i(69018),REMOVE_KEY:i(85549)}},87499:(t,e,i)=>{var s=i(98611),n=i(65154),r={CanvasTexture:i(17487),Events:i(38203),FilterMode:n,Frame:i(82047),Parsers:i(69150),Texture:i(31673),TextureManager:i(6237),TextureSource:i(32547)};r=s(!1,r,n),t.exports=r},35082:t=>{t.exports=function(t,e,i){if(i.getElementsByTagName("TextureAtlas")){var s=t.source[e];t.add("__BASE",e,0,0,s.width,s.height);for(var n,r=i.getElementsByTagName("SubTexture"),a=0;a{t.exports=function(t,e){var i=t.source[e];return t.add("__BASE",e,0,0,i.width,i.height),t}},21560:t=>{t.exports=function(t,e){var i=t.source[e];return t.add("__BASE",e,0,0,i.width,i.height),t}},64423:(t,e,i)=>{var s=i(32742);t.exports=function(t,e,i){if(i.frames||i.textures){var n=t.source[e];t.add("__BASE",e,0,0,n.width,n.height);for(var r,a=Array.isArray(i.textures)?i.textures[e].frames:i.frames,o=0;o{var s=i(32742);t.exports=function(t,e,i){if(i.frames){var n=t.source[e];t.add("__BASE",e,0,0,n.width,n.height);var r,a=i.frames;for(var o in a)if(a.hasOwnProperty(o)){var h=a[o];if(r=t.add(o,e,h.frame.x,h.frame.y,h.frame.w,h.frame.h)){h.trimmed&&r.setTrim(h.sourceSize.w,h.sourceSize.h,h.spriteSourceSize.x,h.spriteSourceSize.y,h.spriteSourceSize.w,h.spriteSourceSize.h),h.rotated&&(r.rotated=!0,r.updateUVsInverted());var l=h.anchor||h.pivot;l&&(r.customPivot=!0,r.pivotX=l.x,r.pivotY=l.y),r.customData=s(h)}else console.warn("Invalid atlas json, frame already exists: "+o)}for(var u in i)"frames"!==u&&(Array.isArray(i[u])?t.customData[u]=i[u].slice(0):t.customData[u]=i[u]);return t}console.warn("Invalid Texture Atlas JSON Hash given, missing 'frames' Object")}},67409:t=>{t.exports=function(t){var e,i=[171,75,84,88,32,49,49,187,13,10,26,10],s=new Uint8Array(t,0,12);for(e=0;e>1),v=Math.max(1,v>>1),f+=g}return{mipmaps:d,width:h,height:l,internalFormat:o,compressed:!0,generateMipmap:!1}}console.warn("KTXParser - Only compressed formats supported")}},24904:t=>{function e(t,e,i,s,n,r,a){return void 0===a&&(a=16),Math.floor((t+i)/n)*Math.floor((e+s)/r)*a}function i(t,e){return(t=Math.max(t,16))*(e=Math.max(e,8))/4}function s(t,e){return(t=Math.max(t,8))*(e=Math.max(e,8))/2}function n(t,i){return e(t,i,3,3,4,4,8)}function r(t,i){return e(t,i,3,3,4,4)}var a={0:{sizeFunc:i,glFormat:35841},1:{sizeFunc:i,glFormat:35843},2:{sizeFunc:s,glFormat:35840},3:{sizeFunc:s,glFormat:35842},6:{sizeFunc:n,glFormat:36196},7:{sizeFunc:n,glFormat:33776},8:{sizeFunc:r,glFormat:33777},9:{sizeFunc:r,glFormat:33778},11:{sizeFunc:r,glFormat:33779},22:{sizeFunc:n,glFormat:37492},23:{sizeFunc:r,glFormat:37496},24:{sizeFunc:n,glFormat:37494},25:{sizeFunc:n,glFormat:37488},26:{sizeFunc:r,glFormat:37490},27:{sizeFunc:r,glFormat:37808},28:{sizeFunc:function(t,i){return e(t,i,4,3,5,4)},glFormat:37809},29:{sizeFunc:function(t,i){return e(t,i,4,4,5,5)},glFormat:37810},30:{sizeFunc:function(t,i){return e(t,i,5,4,6,5)},glFormat:37811},31:{sizeFunc:function(t,i){return e(t,i,5,5,6,6)},glFormat:37812},32:{sizeFunc:function(t,i){return e(t,i,7,4,8,5)},glFormat:37813},33:{sizeFunc:function(t,i){return e(t,i,7,5,8,6)},glFormat:37814},34:{sizeFunc:function(t,i){return e(t,i,7,7,8,8)},glFormat:37815},35:{sizeFunc:function(t,i){return e(t,i,9,4,10,5)},glFormat:37816},36:{sizeFunc:function(t,i){return e(t,i,9,5,10,6)},glFormat:37817},37:{sizeFunc:function(t,i){return e(t,i,9,7,10,8)},glFormat:37818},38:{sizeFunc:function(t,i){return e(t,i,9,9,10,10)},glFormat:37819},39:{sizeFunc:function(t,i){return e(t,i,11,9,12,10)},glFormat:37820},40:{sizeFunc:function(t,i){return e(t,i,11,11,12,12)},glFormat:37821}};t.exports=function(t){for(var e=new Uint32Array(t,0,13),i=e[2],s=a[i].glFormat,n=a[i].sizeFunc,r=e[11],o=e[7],h=e[6],l=52+e[12],u=new Uint8Array(t,l),c=new Array(r),d=0,f=o,p=h,v=0;v>1),p=Math.max(1,p>>1),d+=g}return{mipmaps:c,width:o,height:h,internalFormat:s,compressed:!0,generateMipmap:!1}}},6143:(t,e,i)=>{var s=i(72632);t.exports=function(t,e,i,n,r,a,o){var h=s(o,"frameWidth",null),l=s(o,"frameHeight",h);if(null===h)throw new Error("TextureManager.SpriteSheet: Invalid frameWidth given.");var u=t.source[e];t.add("__BASE",e,0,0,u.width,u.height);var c=s(o,"startFrame",0),d=s(o,"endFrame",-1),f=s(o,"margin",0),p=s(o,"spacing",0),v=Math.floor((r-f+p)/(h+p))*Math.floor((a-f+p)/(l+p));0===v&&console.warn("SpriteSheet frame dimensions will result in zero frames for texture:",t.key),(c>v||c<-v)&&(c=0),c<0&&(c=v+c),-1!==d&&(v=c+(d+1));for(var g=f,m=f,y=0,x=0,T=0;Tr&&(y=w-r),E>a&&(x=E-a),t.add(T,e,i+g,n+m,h-y,l-x),(g+=h+p)+h>r&&(g=f,m+=l+p)}return t}},20030:(t,e,i)=>{var s=i(72632);t.exports=function(t,e,i){var n=s(i,"frameWidth",null),r=s(i,"frameHeight",n);if(!n)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var a=t.source[0];t.add("__BASE",0,0,0,a.width,a.height);var o,h=s(i,"startFrame",0),l=s(i,"endFrame",-1),u=s(i,"margin",0),c=s(i,"spacing",0),d=e.cutX,f=e.cutY,p=e.cutWidth,v=e.cutHeight,g=e.realWidth,m=e.realHeight,y=Math.floor((g-u+c)/(n+c)),x=Math.floor((m-u+c)/(r+c)),T=y*x,w=e.x,E=n-w,S=n-(g-p-w),b=e.y,A=r-b,_=r-(m-v-b);(h>T||h<-T)&&(h=0),h<0&&(h=T+h),-1!==l&&(T=h+(l+1));for(var C=u,R=u,M=0,P=e.sourceIndex,O=0;O{var e=0,i=function(t,i,s,n){var r=e-n.y-n.height;t.add(s,i,n.x,r,n.width,n.height)};t.exports=function(t,s,n){var r=t.source[s];t.add("__BASE",s,0,0,r.width,r.height),e=r.height;for(var a=n.split("\n"),o=/^[ ]*(- )*(\w+)+[: ]+(.*)/,h="",l="",u={x:0,y:0,width:0,height:0},c=0;c{t.exports={AtlasXML:i(35082),Canvas:i(83332),Image:i(21560),JSONArray:i(64423),JSONHash:i(17264),KTXParser:i(67409),PVRParser:i(24904),SpriteSheet:i(6143),SpriteSheetFromAtlas:i(20030),UnityYAML:i(89187)}},93560:t=>{t.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}},97042:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s,n,r,a){(void 0===i||i<=0)&&(i=32),(void 0===s||s<=0)&&(s=32),void 0===n&&(n=0),void 0===r&&(r=0),this.name=t,this.firstgid=0|e,this.imageWidth=0|i,this.imageHeight=0|s,this.imageMargin=0|n,this.imageSpacing=0|r,this.properties=a||{},this.images=[],this.total=0},containsImageIndex:function(t){return t>=this.firstgid&&t{var s=new(i(56694))({initialize:function(t){if(this.gids=[],void 0!==t)for(var e=0;e{var s=i(93560),n=i(16586),r=i(90715),a=i(89797);t.exports=function(t,e,i,o,h,l,u,c){void 0===i&&(i=32),void 0===o&&(o=32),void 0===h&&(h=10),void 0===l&&(l=10),void 0===c&&(c=!1);var d=null;if(Array.isArray(u))d=r(void 0!==e?e:"map",s.ARRAY_2D,u,i,o,c);else if(void 0!==e){var f=t.cache.tilemap.get(e);f?d=r(e,f.format,f.data,i,o,c):console.warn("No map data found for key "+e)}return null===d&&(d=new n({tileWidth:i,tileHeight:o,width:h,height:l})),new a(t,d)}},29633:(t,e,i)=>{var s=i(12920),n=i(56694),r=i(64937),a=i(66658),o=new n({Mixins:[r.Alpha,r.Flip,r.Visible],initialize:function(t,e,i,s,n,r,a,o){this.layer=t,this.index=e,this.x=i,this.y=s,this.width=n,this.height=r,this.right,this.bottom,this.baseWidth=void 0!==a?a:n,this.baseHeight=void 0!==o?o:r,this.pixelX=0,this.pixelY=0,this.updatePixelXY(),this.properties={},this.rotation=0,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceLeft=!1,this.faceRight=!1,this.faceTop=!1,this.faceBottom=!1,this.collisionCallback=void 0,this.collisionCallbackContext=this,this.tint=16777215,this.physics={}},containsPoint:function(t,e){return!(tthis.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=t.properties,this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldXY(this.x,this.y,void 0,t).x:this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldXY(this.x,this.y,void 0,t).y:this.y*this.baseWidth-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new a),e.x=this.getLeft(t),e.y=this.getTop(t),e.width=this.getRight(t)-e.x,e.height=this.getBottom(t)-e.y,e},getCenterX:function(t){return(this.getLeft(t)+this.getRight(t))/2},getCenterY:function(t){return(this.getTop(t)+this.getBottom(t))/2},intersects:function(t,e,i,s){return!(i<=this.pixelX||s<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){(void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,s,n){(void 0===e&&(e=t),void 0===i&&(i=t),void 0===s&&(s=t),void 0===n&&(n=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=s,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=s,n)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,s){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==s&&(this.baseHeight=s),this.updatePixelXY(),this},updatePixelXY:function(){var t=this.layer.orientation;if(t===s.ORTHOGONAL)this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight;else if(t===s.ISOMETRIC)this.pixelX=(this.x-this.y)*this.baseWidth*.5,this.pixelY=(this.x+this.y)*this.baseHeight*.5;else if(t===s.STAGGERED)this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*(this.baseHeight/2);else if(t===s.HEXAGONAL){var e=this.layer.hexSideLength,i=(this.baseHeight-e)/2+e;this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*i}return this.right=this.pixelX+this.baseWidth,this.bottom=this.pixelY+this.baseHeight,this},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||void 0!==this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.layer.tilemapLayer;if(t){var e=t.gidMap[this.index];if(e)return e}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=o},89797:(t,e,i)=>{var s=i(56694),n=i(75606),r=i(93560),a=i(72632),o=i(94990),h=i(46422),l=i(12920),u=i(52257),c=i(72677),d=i(13747),f=i(29633),p=i(5047),v=i(87177),g=i(47975),m=new s({initialize:function(t,e){this.scene=t,this.tileWidth=e.tileWidth,this.tileHeight=e.tileHeight,this.width=e.width,this.height=e.height,this.orientation=e.orientation,this.renderOrder=e.renderOrder,this.format=e.format,this.version=e.version,this.properties=e.properties,this.widthInPixels=e.widthInPixels,this.heightInPixels=e.heightInPixels,this.imageCollections=e.imageCollections,this.images=e.images,this.layers=e.layers,this.tilesets=e.tilesets,this.objects=e.objects,this.currentLayerIndex=0,this.hexSideLength=e.hexSideLength;var i=this.orientation;this._convert={WorldToTileXY:p.GetWorldToTileXYFunction(i),WorldToTileX:p.GetWorldToTileXFunction(i),WorldToTileY:p.GetWorldToTileYFunction(i),TileToWorldXY:p.GetTileToWorldXYFunction(i),TileToWorldX:p.GetTileToWorldXFunction(i),TileToWorldY:p.GetTileToWorldYFunction(i)}},setRenderOrder:function(t){var e=["right-down","left-down","right-up","left-up"];return"number"==typeof t&&(t=e[t]),e.indexOf(t)>-1&&(this.renderOrder=t),this},addTilesetImage:function(t,e,i,s,n,a,o){if(void 0===t)return null;if(null==e&&(e=t),!this.scene.sys.textures.exists(e))return console.warn("Invalid Tileset Image: "+e),null;var h=this.scene.sys.textures.get(e),l=this.getTilesetIndex(t);if(null===l&&this.format===r.TILED_JSON)return console.warn("No data found for Tileset: "+t),null;var u=this.tilesets[l];return u?(u.setTileSize(i,s),u.setSpacing(n,a),u.setImage(h),u):(void 0===i&&(i=this.tileWidth),void 0===s&&(s=this.tileHeight),void 0===n&&(n=0),void 0===a&&(a=0),void 0===o&&(o=0),(u=new g(t,o,i,s,n,a)).setImage(h),this.tilesets.push(u),u)},copy:function(t,e,i,s,n,r,a,o){return null!==(o=this.getLayer(o))?(p.Copy(t,e,i,s,n,r,a,o),this):null},createBlankLayer:function(t,e,i,s,n,r,a,h){if(void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=this.width),void 0===r&&(r=this.height),void 0===a&&(a=this.tileWidth),void 0===h&&(h=this.tileHeight),null!==this.getLayerIndex(t))return console.warn("Invalid Tilemap Layer ID: "+t),null;for(var l,u=new o({name:t,tileWidth:a,tileHeight:h,width:n,height:r,orientation:this.orientation}),c=0;c-1&&this.putTileAt(e,r.x,r.y,i,r.tilemapLayer)}return s},removeTileAt:function(t,e,i,s,n){return void 0===i&&(i=!0),void 0===s&&(s=!0),null===(n=this.getLayer(n))?null:p.RemoveTileAt(t,e,i,s,n)},removeTileAtWorldXY:function(t,e,i,s,n,r){return void 0===i&&(i=!0),void 0===s&&(s=!0),null===(r=this.getLayer(r))?null:p.RemoveTileAtWorldXY(t,e,i,s,n,r)},renderDebug:function(t,e,i){return null===(i=this.getLayer(i))?null:(this.orientation===l.ORTHOGONAL&&p.RenderDebug(t,e,i),this)},renderDebugFull:function(t,e){for(var i=this.layers,s=0;s{var s=i(99325),n=i(15043);s.register("tilemap",(function(t){var e=void 0!==t?t:{};return n(this.scene,e.key,e.tileWidth,e.tileHeight,e.width,e.height,e.data,e.insertNull)}))},37940:(t,e,i)=>{var s=i(61286),n=i(15043);s.register("tilemap",(function(t,e,i,s,r,a,o){return null===t&&(t=void 0),null===e&&(e=void 0),null===i&&(i=void 0),null===s&&(s=void 0),null===r&&(r=void 0),n(this.scene,t,e,i,s,r,a,o)}))},87177:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(89980),a=i(5047),o=i(96193),h=new s({Extends:r,Mixins:[n.Alpha,n.BlendMode,n.ComputedSize,n.Depth,n.Flip,n.GetBounds,n.Mask,n.Origin,n.Pipeline,n.Transform,n.Visible,n.ScrollFactor,o],initialize:function(t,e,i,s,n,o){r.call(this,t,"TilemapLayer"),this.isTilemap=!0,this.tilemap=e,this.layerIndex=i,this.layer=e.layers[i],this.layer.tilemapLayer=this,this.tileset=[],this.tilesDrawn=0,this.tilesTotal=this.layer.width*this.layer.height,this.culledTiles=[],this.skipCull=!1,this.cullPaddingX=1,this.cullPaddingY=1,this.cullCallback=a.GetCullTilesFunction(this.layer.orientation),this._renderOrder=0,this.gidMap=[],this.setTilesets(s),this.setAlpha(this.layer.alpha),this.setPosition(n,o),this.setOrigin(0,0),this.setSize(e.tileWidth*this.layer.width,e.tileHeight*this.layer.height),this.initPipeline()},setTilesets:function(t){var e=[],i=[],s=this.tilemap;Array.isArray(t)||(t=[t]);for(var n=0;n=0&&t<4&&(this._renderOrder=t),this},calculateFacesAt:function(t,e){return a.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,s){return a.CalculateFacesWithin(t,e,i,s,this.layer),this},createFromTiles:function(t,e,i,s,n){return a.CreateFromTiles(t,e,i,s,n,this.layer)},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles,this._renderOrder)},copy:function(t,e,i,s,n,r,o){return a.Copy(t,e,i,s,n,r,o,this.layer),this},fill:function(t,e,i,s,n,r){return a.Fill(t,e,i,s,n,r,this.layer),this},filterTiles:function(t,e,i,s,n,r,o){return a.FilterTiles(t,e,i,s,n,r,o,this.layer)},findByIndex:function(t,e,i){return a.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,s,n,r,o){return a.FindTile(t,e,i,s,n,r,o,this.layer)},forEachTile:function(t,e,i,s,n,r,o){return a.ForEachTile(t,e,i,s,n,r,o,this.layer),this},setTint:function(t,e,i,s,n,r){void 0===t&&(t=16777215);return this.forEachTile((function(e){e.tint=t}),this,e,i,s,n,r)},getTileAt:function(t,e,i){return a.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,s){return a.GetTileAtWorldXY(t,e,i,s,this.layer)},getTilesWithin:function(t,e,i,s,n){return a.GetTilesWithin(t,e,i,s,n,this.layer)},getTilesWithinShape:function(t,e,i){return a.GetTilesWithinShape(t,e,i,this.layer)},getTilesWithinWorldXY:function(t,e,i,s,n,r){return a.GetTilesWithinWorldXY(t,e,i,s,n,r,this.layer)},hasTileAt:function(t,e){return a.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return a.HasTileAtWorldXY(t,e,i,this.layer)},putTileAt:function(t,e,i,s){return a.PutTileAt(t,e,i,s,this.layer)},putTileAtWorldXY:function(t,e,i,s,n){return a.PutTileAtWorldXY(t,e,i,s,n,this.layer)},putTilesAt:function(t,e,i,s){return a.PutTilesAt(t,e,i,s,this.layer),this},randomize:function(t,e,i,s,n){return a.Randomize(t,e,i,s,n,this.layer),this},removeTileAt:function(t,e,i,s){return a.RemoveTileAt(t,e,i,s,this.layer)},removeTileAtWorldXY:function(t,e,i,s,n){return a.RemoveTileAtWorldXY(t,e,i,s,n,this.layer)},renderDebug:function(t,e){return a.RenderDebug(t,e,this.layer),this},replaceByIndex:function(t,e,i,s,n,r){return a.ReplaceByIndex(t,e,i,s,n,r,this.layer),this},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},setCollision:function(t,e,i,s){return a.SetCollision(t,e,i,this.layer,s),this},setCollisionBetween:function(t,e,i,s){return a.SetCollisionBetween(t,e,i,s,this.layer),this},setCollisionByProperty:function(t,e,i){return a.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return a.SetCollisionByExclusion(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return a.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileIndexCallback:function(t,e,i){return a.SetTileIndexCallback(t,e,i,this.layer),this},setTileLocationCallback:function(t,e,i,s,n,r){return a.SetTileLocationCallback(t,e,i,s,n,r,this.layer),this},shuffle:function(t,e,i,s){return a.Shuffle(t,e,i,s,this.layer),this},swapByIndex:function(t,e,i,s,n,r){return a.SwapByIndex(t,e,i,s,n,r,this.layer),this},tileToWorldX:function(t,e){return this.tilemap.tileToWorldX(t,e,this)},tileToWorldY:function(t,e){return this.tilemap.tileToWorldY(t,e,this)},tileToWorldXY:function(t,e,i,s){return this.tilemap.tileToWorldXY(t,e,i,s,this)},weightedRandomize:function(t,e,i,s,n){return a.WeightedRandomize(e,i,s,n,t,this.layer),this},worldToTileX:function(t,e,i){return this.tilemap.worldToTileX(t,e,i,this)},worldToTileY:function(t,e,i){return this.tilemap.worldToTileY(t,e,i,this)},worldToTileXY:function(t,e,i,s,n){return this.tilemap.worldToTileXY(t,e,i,s,n,this)},destroy:function(t){void 0===t&&(t=!0),this.tilemap&&(this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),t&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.culledTiles.length=0,this.cullCallback=null,this.gidMap=[],this.tileset=[],r.prototype.destroy.call(this))}});t.exports=h},17394:(t,e,i)=>{var s=i(69360),n=new s,r=new s,a=new s;t.exports=function(t,e,i,s){var o=e.cull(i),h=o.length,l=i.alpha*e.alpha;if(!(0===h||l<=0)){var u=n,c=r,d=a;c.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),u.copyFrom(i.matrix);var f=t.currentContext,p=e.gidMap;f.save(),s?(u.multiplyWithOffset(s,-i.scrollX*e.scrollFactorX,-i.scrollY*e.scrollFactorY),c.e=e.x,c.f=e.y,u.multiply(c,d),d.copyToContext(f)):(c.e-=i.scrollX*e.scrollFactorX,c.f-=i.scrollY*e.scrollFactorY,c.copyToContext(f)),(!t.antialias||e.scaleX>1||e.scaleY>1)&&(f.imageSmoothingEnabled=!1);for(var v=0;v{var s=i(72283),n=s,r=s;n=i(51395),r=i(17394),t.exports={renderWebGL:n,renderCanvas:r}},51395:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i){var n=e.cull(i),r=n.length,a=i.alpha*e.alpha;if(!(0===r||a<=0)){var o=e.gidMap,h=t.pipelines.set(e.pipeline,e),l=s.getTintAppendFloatAlpha,u=e.scrollFactorX,c=e.scrollFactorY,d=e.x,f=e.y,p=e.scaleX,v=e.scaleY;t.pipelines.preBatch(e);for(var g=0;g{var s=i(56694),n=i(93736),r=new s({initialize:function(t,e,i,s,r,a,o,h,l){(void 0===i||i<=0)&&(i=32),(void 0===s||s<=0)&&(s=32),void 0===r&&(r=0),void 0===a&&(a=0),void 0===o&&(o={}),void 0===h&&(h={}),this.name=t,this.firstgid=e,this.tileWidth=i,this.tileHeight=s,this.tileMargin=r,this.tileSpacing=a,this.tileProperties=o,this.tileData=h,this.tileOffset=new n,void 0!==l&&this.tileOffset.set(l.x,l.y),this.image=null,this.glTexture=null,this.rows=0,this.columns=0,this.total=0,this.texCoordinates=[]},getTileProperties:function(t){return this.containsTileIndex(t)?this.tileProperties[t-this.firstgid]:null},getTileData:function(t){return this.containsTileIndex(t)?this.tileData[t-this.firstgid]:null},getTileCollisionGroup:function(t){var e=this.getTileData(t);return e&&e.objectgroup?e.objectgroup:null},containsTileIndex:function(t){return t>=this.firstgid&&t{var s=i(15494);t.exports=function(t,e,i){var n=s(t,e,!0,i),r=s(t,e-1,!0,i),a=s(t,e+1,!0,i),o=s(t-1,e,!0,i),h=s(t+1,e,!0,i),l=n&&n.collides;return l&&(n.faceTop=!0,n.faceBottom=!0,n.faceLeft=!0,n.faceRight=!0),r&&r.collides&&(l&&(n.faceTop=!1),r.faceBottom=!l),a&&a.collides&&(l&&(n.faceBottom=!1),a.faceTop=!l),o&&o.collides&&(l&&(n.faceLeft=!1),o.faceRight=!l),h&&h.collides&&(l&&(n.faceRight=!1),h.faceLeft=!l),n&&!n.collides&&n.resetFaces(),n}},60386:(t,e,i)=>{var s=i(15494),n=i(50811);t.exports=function(t,e,i,r,a){for(var o=null,h=null,l=null,u=null,c=n(t,e,i,r,null,a),d=0;d{var s=new(i(93736));t.exports=function(t,e,i,n){var r=i.tilemapLayer,a=r.cullPaddingX,o=r.cullPaddingY,h=r.tilemap.tileToWorldXY(t,e,s,n,r);return h.x>n.worldView.x+r.scaleX*i.tileWidth*(-a-.5)&&h.xn.worldView.y+r.scaleY*i.tileHeight*(-o-1)&&h.y{var s=i(50811),n=i(60386);t.exports=function(t,e,i,r,a,o,h,l){void 0===h&&(h=!0),t<0&&(t=0),e<0&&(e=0);for(var u=s(t,e,i,r,null,l),c=a-t,d=o-e,f=0;f=0&&p=0&&v{var s=i(50811),n=i(51202);t.exports=function(t,e,i,r,a,o){i||(i={}),Array.isArray(t)||(t=[t]);var h=o.tilemapLayer;r||(r=h.scene),a||(a=r.cameras.main);var l,u=s(0,0,o.width,o.height,null,o),c=[];for(l=0;l{var s=i(74118),n=i(82127),r=i(84314),a=new s;t.exports=function(t,e){var i=t.tilemapLayer.tilemap,s=t.tilemapLayer,o=Math.floor(i.tileWidth*s.scaleX),h=Math.floor(i.tileHeight*s.scaleY),l=r(e.worldView.x-s.x,o,0,!0)-s.cullPaddingX,u=n(e.worldView.right-s.x,o,0,!0)+s.cullPaddingX,c=r(e.worldView.y-s.y,h,0,!0)-s.cullPaddingY,d=n(e.worldView.bottom-s.y,h,0,!0)+s.cullPaddingY;return a.setTo(l,c,u-l,d-c)}},381:(t,e,i)=>{var s=i(71586),n=i(6987);t.exports=function(t,e,i,r){void 0===i&&(i=[]),void 0===r&&(r=0),i.length=0;var a=t.tilemapLayer,o=s(t,e);return(a.skipCull||1!==a.scrollFactorX||1!==a.scrollFactorY)&&(o.left=0,o.right=t.width,o.top=0,o.bottom=t.height),n(t,o,r,i),i}},97734:(t,e,i)=>{var s=i(50811),n=i(60386),r=i(68234);t.exports=function(t,e,i,a,o,h,l){for(var u=-1!==l.collideIndexes.indexOf(t),c=s(e,i,a,o,null,l),d=0;d{var s=i(50811);t.exports=function(t,e,i,n,r,a,o,h){return s(i,n,r,a,o,h).filter(t,e)}},37982:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=0),void 0===i&&(i=!1);var n,r,a,o=0;if(i){for(r=s.height-1;r>=0;r--)for(n=s.width-1;n>=0;n--)if((a=s.data[r][n])&&a.index===t){if(o===e)return a;o+=1}}else for(r=0;r{var s=i(50811);t.exports=function(t,e,i,n,r,a,o,h){return s(i,n,r,a,o,h).find(t,e)||null}},80916:(t,e,i)=>{var s=i(50811);t.exports=function(t,e,i,n,r,a,o,h){s(i,n,r,a,o,h).forEach(t,e)}},31493:(t,e,i)=>{var s=i(12920),n=i(381),r=i(37524),a=i(20887),o=i(72283),h=i(19242);t.exports=function(t){return t===s.ORTHOGONAL?n:t===s.HEXAGONAL?r:t===s.STAGGERED?h:t===s.ISOMETRIC?a:o}},15494:(t,e,i)=>{var s=i(62839);t.exports=function(t,e,i,n){if(void 0===i&&(i=!1),s(t,e,n)){var r=n.data[e][t]||null;return r?-1===r.index?i?r:null:r:null}return null}},24640:(t,e,i)=>{var s=i(15494),n=new(i(93736));t.exports=function(t,e,i,r,a){return a.tilemapLayer.worldToTileXY(t,e,!0,n,r),s(n.x,n.y,i,a)}},16884:(t,e,i)=>{var s=i(12920),n=i(72283),r=i(44150);t.exports=function(t){return t===s.ORTHOGONAL?r:n}},68182:(t,e,i)=>{var s=i(12920),n=i(21715),r=i(21808),a=i(72283),o=i(33388),h=i(46836);t.exports=function(t){return t===s.ORTHOGONAL?h:t===s.ISOMETRIC?r:t===s.HEXAGONAL?n:t===s.STAGGERED?o:a}},3752:(t,e,i)=>{var s=i(12920),n=i(37728),r=i(72283),a=i(84132),o=i(42477);t.exports=function(t){return t===s.ORTHOGONAL?o:t===s.HEXAGONAL?n:t===s.STAGGERED?a:r}},50811:(t,e,i)=>{var s=i(72632);t.exports=function(t,e,i,n,r,a){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=a.width),void 0===n&&(n=a.height),r||(r={});var o=s(r,"isNotEmpty",!1),h=s(r,"isColliding",!1),l=s(r,"hasInterestingFace",!1);t<0&&(i+=t,t=0),e<0&&(n+=e,e=0),t+i>a.width&&(i=Math.max(a.width-t,0)),e+n>a.height&&(n=Math.max(a.height-e,0));for(var u=[],c=e;c{var s=i(84068),n=i(50811),r=i(7563),a=i(72283),o=i(93736),h=function(t,e){return r.RectangleToTriangle(e,t)},l=new o,u=new o,c=new o;t.exports=function(t,e,i,o){if(void 0===t)return[];var d=a;t instanceof s.Circle?d=r.CircleToRectangle:t instanceof s.Rectangle?d=r.RectangleToRectangle:t instanceof s.Triangle?d=h:t instanceof s.Line&&(d=r.LineToRectangle),o.tilemapLayer.worldToTileXY(t.left,t.top,!0,u,i);var f=u.x,p=u.y;o.tilemapLayer.worldToTileXY(t.right,t.bottom,!1,c,i);var v=Math.ceil(c.x),g=Math.ceil(c.y),m=Math.max(v-f,1),y=Math.max(g-p,1),x=n(f,p,m,y,e,o),T=o.tileWidth,w=o.tileHeight;o.tilemapLayer&&(T*=o.tilemapLayer.scaleX,w*=o.tilemapLayer.scaleY);for(var E=[],S=new s.Rectangle(0,0,T,w),b=0;b{var s=i(50811),n=i(93736),r=new n,a=new n;t.exports=function(t,e,i,n,o,h,l){var u=l.tilemapLayer.tilemap._convert.WorldToTileXY;u(t,e,!0,r,h,l);var c=r.x,d=r.y;u(t+i,e+n,!1,a,h,l);var f=Math.ceil(a.x),p=Math.ceil(a.y);return s(c,d,f-c,p-d,o,l)}},29296:(t,e,i)=>{var s=i(12920),n=i(72283),r=i(806);t.exports=function(t){return t===s.ORTHOGONAL?r:n}},32688:(t,e,i)=>{var s=i(12920),n=i(11516),r=i(18750),a=i(72283),o=i(90562),h=i(45676);t.exports=function(t){return t===s.ORTHOGONAL?h:t===s.ISOMETRIC?r:t===s.HEXAGONAL?n:t===s.STAGGERED?o:a}},74326:(t,e,i)=>{var s=i(12920),n=i(44382),r=i(72283),a=i(3689),o=i(70520);t.exports=function(t){return t===s.ORTHOGONAL?o:t===s.HEXAGONAL?n:t===s.STAGGERED?a:r}},46598:(t,e,i)=>{var s=i(62839);t.exports=function(t,e,i){if(s(t,e,i)){var n=i.data[e][t];return null!==n&&n.index>-1}return!1}},28654:(t,e,i)=>{var s=i(46598),n=new(i(93736));t.exports=function(t,e,i,r){r.tilemapLayer.worldToTileXY(t,e,!0,n,i);var a=n.x,o=n.y;return s(a,o,r)}},6358:(t,e,i)=>{var s=i(82127),n=i(84314);t.exports=function(t,e){var i=t.tilemapLayer.tilemap,r=t.tilemapLayer,a=Math.floor(i.tileWidth*r.scaleX),o=Math.floor(i.tileHeight*r.scaleY),h=t.hexSideLength,l=(o-h)/2+h;return{left:n(e.worldView.x-r.x,a,0,!0)-r.cullPaddingX,right:s(e.worldView.right-r.x,a,0,!0)+r.cullPaddingX,top:n(e.worldView.y-r.y,l,0,!0)-r.cullPaddingY,bottom:s(e.worldView.bottom-r.y,l,0,!0)+r.cullPaddingY}}},37524:(t,e,i)=>{var s=i(6358),n=i(6987);t.exports=function(t,e,i,r){void 0===i&&(i=[]),void 0===r&&(r=0),i.length=0;var a=t.tilemapLayer;if(!a.skipCull&&1===a.scrollFactorX&&1===a.scrollFactorY){var o=s(t,e);n(t,o,r,i)}return i}},21715:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r){i||(i=new s);var a=r.baseTileWidth,o=r.baseTileHeight,h=r.tilemapLayer,l=0,u=0;h&&(n||(n=h.scene.cameras.main),l=h.x+n.scrollX*(1-h.scrollFactorX),a*=h.scaleX,u=h.y+n.scrollY*(1-h.scrollFactorY),o*=h.scaleY);var c=r.hexSideLength,d=l+t*a+e%2*(a/2),f=u+e*((o-c)/2+c);return i.set(d,f)}},37728:t=>{t.exports=function(t,e,i){var s=i.baseTileHeight,n=i.tilemapLayer,r=0;n&&(void 0===e&&(e=n.scene.cameras.main),r=n.y+e.scrollY*(1-n.scrollFactorY),s*=n.scaleY);var a=n.tilemap.hexSideLength;return r+t*((s-a)/2+a)}},11516:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r,a){n||(n=new s);var o=a.baseTileWidth,h=a.baseTileHeight,l=a.tilemapLayer;l&&(r||(r=l.scene.cameras.main),e-=l.y+r.scrollY*(1-l.scrollFactorY),h*=l.scaleY,t-=l.x+r.scrollX*(1-l.scrollFactorX),o*=l.scaleX);var u=a.hexSideLength,c=(h-u)/2+u,d=i?Math.floor(e/c):e/c,f=i?Math.floor((t-d%2*.5*o)/o):(t-d%2*.5*o)/o;return n.set(f,d)}},44382:t=>{t.exports=function(t,e,i,s){var n=s.baseTileHeight,r=s.tilemapLayer;r&&(i||(i=r.scene.cameras.main),t-=r.y+i.scrollY*(1-r.scrollFactorY),n*=r.scaleY);var a=s.hexSideLength,o=(n-a)/2+a;return e?Math.floor(t/o):t/o}},62839:t=>{t.exports=function(t,e,i){return t>=0&&t=0&&e{var s=i(13125);t.exports=function(t,e,i,n){void 0===i&&(i=[]),void 0===n&&(n=0),i.length=0;var r,a,o,h=t.tilemapLayer,l=t.data,u=t.width,c=t.height,d=u,f=c;if(!h.skipCull)if(0===n){for(a=0;a=0;r--)if(s(r,a,t,e)){if(!(o=l[a][r])||-1===o.index||!o.visible||0===o.alpha)continue;i.push(o)}}else if(2===n){for(a=f;a>=0;a--)for(r=0;l[a]&&r=0;a--)for(r=d;l[a]&&r>=0;r--)if(s(r,a,t,e)){if(!(o=l[a][r])||-1===o.index||!o.visible||0===o.alpha)continue;i.push(o)}return h.tilesDrawn=i.length,h.tilesTotal=u*c,i}},21808:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r){i||(i=new s);var a=r.baseTileWidth,o=r.baseTileHeight,h=r.tilemapLayer,l=0,u=0;h&&(n||(n=h.scene.cameras.main),l=h.x+n.scrollX*(1-h.scrollFactorX),a*=h.scaleX,u=h.y+n.scrollY*(1-h.scrollFactorY),o*=h.scaleY);var c=l+a/2*(t-e),d=u+(t+e)*(o/2);return i.set(c,d)}},18750:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r,a){n||(n=new s);var o=a.baseTileWidth,h=a.baseTileHeight,l=a.tilemapLayer;l&&(r||(r=l.scene.cameras.main),e-=l.y+r.scrollY*(1-l.scrollFactorY),h*=l.scaleY,t-=l.x+r.scrollX*(1-l.scrollFactorX),o*=l.scaleX);var u=i?Math.floor((t/(o/2)+e/(h/2))/2):(t/(o/2)+e/(h/2))/2,c=i?Math.floor((e/(h/2)-t/(o/2))/2):(e/(h/2)-t/(o/2))/2;return n.set(u,c)}},29003:(t,e,i)=>{var s=i(29633),n=i(62839),r=i(92839),a=i(68234),o=i(14556);t.exports=function(t,e,i,h,l){if(void 0===h&&(h=!0),!n(e,i,l))return null;var u,c=l.data[i][e],d=c&&c.collides;t instanceof s?(null===l.data[i][e]&&(l.data[i][e]=new s(l,t.index,e,i,l.tileWidth,l.tileHeight)),l.data[i][e].copy(t)):(u=t,null===l.data[i][e]?l.data[i][e]=new s(l,u,e,i,l.tileWidth,l.tileHeight):l.data[i][e].index=u);var f=l.data[i][e],p=-1!==l.collideIndexes.indexOf(f.index),v=o(l.tilemapLayer.tilemap)[u=t instanceof s?t.index:t][2],g=l.tilemapLayer.tileset[v];return f.width=g.tileWidth,f.height=g.tileHeight,a(f,p),h&&d!==f.collides&&r(e,i,l),f}},48565:(t,e,i)=>{var s=i(29003),n=new(i(93736));t.exports=function(t,e,i,r,a,o){return o.tilemapLayer.worldToTileXY(e,i,!0,n,a,o),s(t,n.x,n.y,r,o)}},56547:(t,e,i)=>{var s=i(60386),n=i(29003);t.exports=function(t,e,i,r,a){if(void 0===r&&(r=!0),!Array.isArray(t))return null;Array.isArray(t[0])||(t=[t]);for(var o=t.length,h=t[0].length,l=0;l{var s=i(50811),n=i(72861);t.exports=function(t,e,i,r,a,o){var h,l=s(t,e,i,r,{},o);if(!a)for(a=[],h=0;h{var s=i(29633),n=i(62839),r=i(92839);t.exports=function(t,e,i,a,o){if(void 0===i&&(i=!0),void 0===a&&(a=!0),!n(t,e,o))return null;var h=o.data[e][t];return h?(o.data[e][t]=i?null:new s(o,-1,t,e,o.tileWidth,o.tileHeight),a&&h&&h.collides&&r(t,e,o),h):null}},17384:(t,e,i)=>{var s=i(929),n=new(i(93736));t.exports=function(t,e,i,r,a,o){return o.tilemapLayer.worldToTileXY(t,e,!0,n,a,o),s(n.x,n.y,i,r,o)}},93763:(t,e,i)=>{var s=i(50811),n=i(95509),r=new n(105,210,231,150),a=new n(243,134,48,200),o=new n(40,39,37,150);t.exports=function(t,e,i){void 0===e&&(e={});var n=void 0!==e.tileColor?e.tileColor:r,h=void 0!==e.collidingTileColor?e.collidingTileColor:a,l=void 0!==e.faceColor?e.faceColor:o,u=s(0,0,i.width,i.height,null,i);t.translateCanvas(i.tilemapLayer.x,i.tilemapLayer.y),t.scaleCanvas(i.tilemapLayer.scaleX,i.tilemapLayer.scaleY);for(var c=0;c{var s=i(50811);t.exports=function(t,e,i,n,r,a,o){for(var h=s(i,n,r,a,null,o),l=0;l{t.exports=function(t,e,i,s){var n,r,a,o=t.data,h=t.width,l=t.height,u=t.tilemapLayer,c=Math.max(0,e.left),d=Math.min(h,e.right),f=Math.max(0,e.top),p=Math.min(l,e.bottom);if(0===i)for(r=f;r=c;n--)(a=o[r][n])&&-1!==a.index&&a.visible&&0!==a.alpha&&s.push(a);else if(2===i)for(r=p;r>=f;r--)for(n=c;o[r]&&n=f;r--)for(n=d;o[r]&&n>=c;n--)(a=o[r][n])&&-1!==a.index&&a.visible&&0!==a.alpha&&s.push(a);return u.tilesDrawn=s.length,u.tilesTotal=h*l,s}},51710:(t,e,i)=>{var s=i(68234),n=i(60386),r=i(91181);t.exports=function(t,e,i,a,o){void 0===e&&(e=!0),void 0===i&&(i=!0),void 0===o&&(o=!0),Array.isArray(t)||(t=[t]);for(var h=0;h{var s=i(68234),n=i(60386),r=i(91181);t.exports=function(t,e,i,a,o,h){if(void 0===i&&(i=!0),void 0===a&&(a=!0),void 0===h&&(h=!0),!(t>e)){for(var l=t;l<=e;l++)r(l,i,o);if(h)for(var u=0;u=t&&d.index<=e&&s(d,i)}a&&n(0,0,o.width,o.height,o)}}},33158:(t,e,i)=>{var s=i(68234),n=i(60386),r=i(91181);t.exports=function(t,e,i,a){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var o=0;o{var s=i(68234),n=i(60386),r=i(19256);t.exports=function(t,e,i,a){void 0===e&&(e=!0),void 0===i&&(i=!0);for(var o=0;o{var s=i(68234),n=i(60386);t.exports=function(t,e,i){void 0===t&&(t=!0),void 0===e&&(e=!0);for(var r=0;r0&&s(o,t)}}e&&n(0,0,i.width,i.height,i)}},91181:t=>{t.exports=function(t,e,i){var s=i.collideIndexes.indexOf(t);e&&-1===s?i.collideIndexes.push(t):e||-1===s||i.collideIndexes.splice(s,1)}},68234:t=>{t.exports=function(t,e){e?t.setCollision(!0,!0,!0,!0,!1):t.resetCollision(!1)}},11628:t=>{t.exports=function(t,e,i,s){if("number"==typeof t)s.callbacks[t]=null!==e?{callback:e,callbackContext:i}:void 0;else for(var n=0,r=t.length;n{var s=i(50811);t.exports=function(t,e,i,n,r,a,o){for(var h=s(t,e,i,n,null,o),l=0;l{var s=i(50811),n=i(18592);t.exports=function(t,e,i,r,a){var o=s(t,e,i,r,null,a),h=o.map((function(t){return t.index}));n(h);for(var l=0;l{var s=i(82127),n=i(84314);t.exports=function(t,e){var i=t.tilemapLayer.tilemap,r=t.tilemapLayer,a=Math.floor(i.tileWidth*r.scaleX),o=Math.floor(i.tileHeight*r.scaleY);return{left:n(e.worldView.x-r.x,a,0,!0)-r.cullPaddingX,right:s(e.worldView.right-r.x,a,0,!0)+r.cullPaddingX,top:n(e.worldView.y-r.y,o/2,0,!0)-r.cullPaddingY,bottom:s(e.worldView.bottom-r.y,o/2,0,!0)+r.cullPaddingY}}},19242:(t,e,i)=>{var s=i(53945),n=i(6987);t.exports=function(t,e,i,r){void 0===i&&(i=[]),void 0===r&&(r=0),i.length=0;var a=t.tilemapLayer;if(!a.skipCull&&1===a.scrollFactorX&&1===a.scrollFactorY){var o=s(t,e);n(t,o,r,i)}return i}},33388:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r){i||(i=new s);var a=r.baseTileWidth,o=r.baseTileHeight,h=r.tilemapLayer,l=0,u=0;h&&(n||(n=h.scene.cameras.main),l=h.x+n.scrollX*(1-h.scrollFactorX),a*=h.scaleX,u=h.y+n.scrollY*(1-h.scrollFactorY),o*=h.scaleY);var c=l+t*a+e%2*(a/2),d=u+e*(o/2);return i.set(c,d)}},84132:t=>{t.exports=function(t,e,i){var s=i.baseTileHeight,n=i.tilemapLayer,r=0;return n&&(void 0===e&&(e=n.scene.cameras.main),r=n.y+e.scrollY*(1-n.scrollFactorY),s*=n.scaleY),r+t*(s/2)+s}},90562:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r,a){n||(n=new s);var o=a.baseTileWidth,h=a.baseTileHeight,l=a.tilemapLayer;l&&(r||(r=l.scene.cameras.main),e-=l.y+r.scrollY*(1-l.scrollFactorY),h*=l.scaleY,t-=l.x+r.scrollX*(1-l.scrollFactorX),o*=l.scaleX);var u=i?Math.floor(e/(h/2)):e/(h/2),c=i?Math.floor((t+u%2*.5*o)/o):(t+u%2*.5*o)/o;return n.set(c,u)}},3689:t=>{t.exports=function(t,e,i,s){var n=s.baseTileHeight,r=s.tilemapLayer;return r&&(i||(i=r.scene.cameras.main),t-=r.y+i.scrollY*(1-r.scrollFactorY),n*=r.scaleY),e?Math.floor(t/(n/2)):t/(n/2)}},55217:(t,e,i)=>{var s=i(50811);t.exports=function(t,e,i,n,r,a,o){for(var h=s(i,n,r,a,null,o),l=0;l{t.exports=function(t,e,i){var s=i.baseTileWidth,n=i.tilemapLayer,r=0;return n&&(e||(e=n.scene.cameras.main),r=n.x+e.scrollX*(1-n.scrollFactorX),s*=n.scaleX),r+t*s}},46836:(t,e,i)=>{var s=i(44150),n=i(42477),r=i(93736);t.exports=function(t,e,i,a,o){return i||(i=new r(0,0)),i.x=s(t,a,o),i.y=n(e,a,o),i}},42477:t=>{t.exports=function(t,e,i){var s=i.baseTileHeight,n=i.tilemapLayer,r=0;return n&&(e||(e=n.scene.cameras.main),r=n.y+e.scrollY*(1-n.scrollFactorY),s*=n.scaleY),r+t*s}},39677:(t,e,i)=>{var s=i(50811);t.exports=function(t,e,i,n,r,a){if(r){var o,h=s(t,e,i,n,null,a),l=0;for(o=0;o{t.exports=function(t,e,i,s){void 0===e&&(e=!0);var n=s.baseTileWidth,r=s.tilemapLayer;return r&&(i||(i=r.scene.cameras.main),t-=r.x+i.scrollX*(1-r.scrollFactorX),n*=r.scaleX),e?Math.floor(t/n):t/n}},45676:(t,e,i)=>{var s=i(806),n=i(70520),r=i(93736);t.exports=function(t,e,i,a,o,h){return void 0===i&&(i=!0),a||(a=new r(0,0)),a.x=s(t,i,o,h),a.y=n(e,i,o,h),a}},70520:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=!0);var n=s.baseTileHeight,r=s.tilemapLayer;return r&&(i||(i=r.scene.cameras.main),t-=r.y+i.scrollY*(1-r.scrollFactorY),n*=r.scaleY),e?Math.floor(t/n):t/n}},5047:(t,e,i)=>{t.exports={CalculateFacesAt:i(92839),CalculateFacesWithin:i(60386),CheckIsoBounds:i(13125),Copy:i(17347),CreateFromTiles:i(93604),CullBounds:i(71586),CullTiles:i(381),Fill:i(97734),FilterTiles:i(63555),FindByIndex:i(37982),FindTile:i(48297),ForEachTile:i(80916),GetCullTilesFunction:i(31493),GetTileAt:i(15494),GetTileAtWorldXY:i(24640),GetTilesWithin:i(50811),GetTilesWithinShape:i(31674),GetTilesWithinWorldXY:i(44662),GetTileToWorldXFunction:i(16884),GetTileToWorldXYFunction:i(68182),GetTileToWorldYFunction:i(3752),GetWorldToTileXFunction:i(29296),GetWorldToTileXYFunction:i(32688),GetWorldToTileYFunction:i(74326),HasTileAt:i(46598),HasTileAtWorldXY:i(28654),HexagonalCullBounds:i(6358),HexagonalCullTiles:i(37524),HexagonalTileToWorldXY:i(21715),HexagonalTileToWorldY:i(37728),HexagonalWorldToTileXY:i(11516),HexagonalWorldToTileY:i(44382),IsInLayerBounds:i(62839),IsometricCullTiles:i(20887),IsometricTileToWorldXY:i(21808),IsometricWorldToTileXY:i(18750),PutTileAt:i(29003),PutTileAtWorldXY:i(48565),PutTilesAt:i(56547),Randomize:i(91180),RemoveTileAt:i(929),RemoveTileAtWorldXY:i(17384),RenderDebug:i(93763),ReplaceByIndex:i(51202),RunCull:i(6987),SetCollision:i(51710),SetCollisionBetween:i(15216),SetCollisionByExclusion:i(33158),SetCollisionByProperty:i(4180),SetCollisionFromCollisionGroup:i(18625),SetLayerCollisionIndex:i(91181),SetTileCollision:i(68234),SetTileIndexCallback:i(11628),SetTileLocationCallback:i(72732),Shuffle:i(34397),StaggeredCullBounds:i(53945),StaggeredCullTiles:i(19242),StaggeredTileToWorldXY:i(33388),StaggeredTileToWorldY:i(84132),StaggeredWorldToTileXY:i(90562),StaggeredWorldToTileY:i(3689),SwapByIndex:i(55217),TileToWorldX:i(44150),TileToWorldXY:i(46836),TileToWorldY:i(42477),WeightedRandomize:i(39677),WorldToTileX:i(806),WorldToTileXY:i(45676),WorldToTileY:i(70520)}},12920:t=>{t.exports={ORTHOGONAL:0,ISOMETRIC:1,STAGGERED:2,HEXAGONAL:3}},84758:(t,e,i)=>{var s={ORIENTATION:i(12920)};t.exports=s},52678:(t,e,i)=>{var s=i(98611),n=i(84758),r={Components:i(5047),Parsers:i(34124),Formats:i(93560),ImageCollection:i(97042),ParseToTilemap:i(15043),Tile:i(29633),Tilemap:i(89797),TilemapCreator:i(4843),TilemapFactory:i(37940),Tileset:i(47975),TilemapLayer:i(87177),Orientation:i(12920),LayerData:i(94990),MapData:i(16586),ObjectLayer:i(15256)};r=s(!1,r,n.ORIENTATION),t.exports=r},94990:(t,e,i)=>{var s=i(56694),n=i(12920),r=i(72632),a=new s({initialize:function(t){void 0===t&&(t={}),this.name=r(t,"name","layer"),this.x=r(t,"x",0),this.y=r(t,"y",0),this.width=r(t,"width",0),this.height=r(t,"height",0),this.tileWidth=r(t,"tileWidth",0),this.tileHeight=r(t,"tileHeight",0),this.baseTileWidth=r(t,"baseTileWidth",this.tileWidth),this.baseTileHeight=r(t,"baseTileHeight",this.tileHeight),this.orientation=r(t,"orientation",n.ORTHOGONAL),this.widthInPixels=r(t,"widthInPixels",this.width*this.baseTileWidth),this.heightInPixels=r(t,"heightInPixels",this.height*this.baseTileHeight),this.alpha=r(t,"alpha",1),this.visible=r(t,"visible",!0),this.properties=r(t,"properties",[]),this.indexes=r(t,"indexes",[]),this.collideIndexes=r(t,"collideIndexes",[]),this.callbacks=r(t,"callbacks",[]),this.bodies=r(t,"bodies",[]),this.data=r(t,"data",[]),this.tilemapLayer=r(t,"tilemapLayer",null),this.hexSideLength=r(t,"hexSideLength",0)}});t.exports=a},16586:(t,e,i)=>{var s=i(56694),n=i(12920),r=i(72632),a=new s({initialize:function(t){void 0===t&&(t={}),this.name=r(t,"name","map"),this.width=r(t,"width",0),this.height=r(t,"height",0),this.infinite=r(t,"infinite",!1),this.tileWidth=r(t,"tileWidth",0),this.tileHeight=r(t,"tileHeight",0),this.widthInPixels=r(t,"widthInPixels",this.width*this.tileWidth),this.heightInPixels=r(t,"heightInPixels",this.height*this.tileHeight),this.format=r(t,"format",null),this.orientation=r(t,"orientation",n.ORTHOGONAL),this.renderOrder=r(t,"renderOrder","right-down"),this.version=r(t,"version","1"),this.properties=r(t,"properties",{}),this.layers=r(t,"layers",[]),this.images=r(t,"images",[]),this.objects=r(t,"objects",[]),this.collision=r(t,"collision",{}),this.tilesets=r(t,"tilesets",[]),this.imageCollections=r(t,"imageCollections",[]),this.tiles=r(t,"tiles",[]),this.hexSideLength=r(t,"hexSideLength",0)}});t.exports=a},15256:(t,e,i)=>{var s=i(56694),n=i(72632),r=new s({initialize:function(t){void 0===t&&(t={}),this.name=n(t,"name","object layer"),this.opacity=n(t,"opacity",1),this.properties=n(t,"properties",{}),this.propertyTypes=n(t,"propertytypes",{}),this.type=n(t,"type","objectgroup"),this.visible=n(t,"visible",!0),this.objects=n(t,"objects",[])}});t.exports=r},21394:(t,e,i)=>{var s=i(12920);t.exports=function(t){return"isometric"===(t=t.toLowerCase())?s.ISOMETRIC:"staggered"===t?s.STAGGERED:"hexagonal"===t?s.HEXAGONAL:s.ORTHOGONAL}},90715:(t,e,i)=>{var s=i(93560),n=i(84346),r=i(96097),a=i(2378),o=i(44909);t.exports=function(t,e,i,h,l,u){var c;switch(e){case s.ARRAY_2D:c=n(t,i,h,l,u);break;case s.CSV:c=r(t,i,h,l,u);break;case s.TILED_JSON:c=a(t,i,u);break;case s.WELTMEISTER:c=o(t,i,u);break;default:console.warn("Unrecognized tilemap data format: "+e),c=null}return c}},84346:(t,e,i)=>{var s=i(93560),n=i(94990),r=i(16586),a=i(29633);t.exports=function(t,e,i,o,h){for(var l=new n({tileWidth:i,tileHeight:o}),u=new r({name:t,tileWidth:i,tileHeight:o,format:s.ARRAY_2D,layers:[l]}),c=[],d=e.length,f=0,p=0;p{var s=i(93560),n=i(84346);t.exports=function(t,e,i,r,a){var o=e.trim().split("\n").map((function(t){return t.split(",")})),h=n(t,o,i,r,a);return h.format=s.CSV,h}},30951:(t,e,i)=>{var s=i(94990),n=i(29633);t.exports=function(t,e){for(var i=[],r=0;r-1?new n(o,f,c,u,a.tilesize,a.tilesize):e?null:new n(o,-1,c,u,a.tilesize,a.tilesize),h.push(d)}l.push(h),h=[]}o.data=l,i.push(o)}return i}},47488:(t,e,i)=>{var s=i(47975);t.exports=function(t){for(var e=[],i=[],n=0;n{var s=i(93560),n=i(16586),r=i(30951),a=i(47488);t.exports=function(t,e,i){if(0===e.layer.length)return console.warn("No layers found in the Weltmeister map: "+t),null;for(var o=0,h=0,l=0;lo&&(o=e.layer[l].width),e.layer[l].height>h&&(h=e.layer[l].height);var u=new n({width:o,height:h,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:s.WELTMEISTER});return u.layers=r(e,i),u.tilesets=a(e),u}},24507:(t,e,i)=>{t.exports={ParseTileLayers:i(30951),ParseTilesets:i(47488),ParseWeltmeister:i(44909)}},34124:(t,e,i)=>{t.exports={FromOrientationString:i(21394),Parse:i(90715),Parse2DArray:i(84346),ParseCSV:i(96097),Impact:i(24507),Tiled:i(50044)}},48646:(t,e,i)=>{var s=i(98611);t.exports=function(t){for(var e,i,n,r,a,o=0;o{t.exports=function(t){for(var e=window.atob(t),i=e.length,s=new Array(i/4),n=0;n>>0;return s}},14556:(t,e,i)=>{var s=i(47975);t.exports=function(t){var e,i,n=[];for(e=0;e{var s=i(72632);t.exports=function(t,e,i){if(!e)return{i:0,layers:t.layers,name:"",opacity:1,visible:!0,x:0,y:0};var n=e.x+s(e,"startx",0)*t.tilewidth+s(e,"offsetx",0),r=e.y+s(e,"starty",0)*t.tileheight+s(e,"offsety",0);return{i:0,layers:e.layers,name:i.name+e.name+"/",opacity:i.opacity*e.opacity,visible:i.visible&&e.visible,x:i.x+n,y:i.y+r}}},8847:t=>{var e=2147483648,i=1073741824,s=536870912;t.exports=function(t){var n=Boolean(t&e),r=Boolean(t&i),a=Boolean(t&s);t&=536870911;var o=0,h=!1;return n&&r&&a?(o=Math.PI/2,h=!0):n&&r&&!a?(o=Math.PI,h=!1):n&&!r&&a?(o=Math.PI/2,h=!1):!n||r||a?!n&&r&&a?(o=3*Math.PI/2,h=!1):n||!r||a?n||r||!a?n||r||a||(o=0,h=!1):(o=3*Math.PI/2,h=!0):(o=Math.PI,h=!0):(o=0,h=!0),{gid:t,flippedHorizontal:n,flippedVertical:r,flippedAntiDiagonal:a,rotation:o,flipped:h}}},78339:(t,e,i)=>{var s=i(72632),n=i(92044);t.exports=function(t){for(var e=[],i=[],r=n(t);r.i0;)if(r.i>=r.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}r=i.pop()}else{var a=r.layers[r.i];if(r.i++,"imagelayer"===a.type){var o=s(a,"offsetx",0)+s(a,"startx",0),h=s(a,"offsety",0)+s(a,"starty",0);e.push({name:r.name+a.name,image:a.image,x:r.x+o+a.x,y:r.y+h+a.y,alpha:r.opacity*a.opacity,visible:r.visible&&a.visible,properties:s(a,"properties",{})})}else if("group"===a.type){var l=n(t,a,r);i.push(r),r=l}}return e}},2378:(t,e,i)=>{var s=i(48646),n=i(14556),r=i(12920),a=i(93560),o=i(21394),h=i(16586),l=i(78339),u=i(61136),c=i(95925),d=i(93392);t.exports=function(t,e,i){var f=new h({width:e.width,height:e.height,name:t,tileWidth:e.tilewidth,tileHeight:e.tileheight,orientation:o(e.orientation),format:a.TILED_JSON,version:e.version,properties:e.properties,renderOrder:e.renderorder,infinite:e.infinite});f.orientation===r.HEXAGONAL&&(f.hexSideLength=e.hexsidelength),f.layers=c(e,i),f.images=l(e);var p=d(e);return f.tilesets=p.tilesets,f.imageCollections=p.imageCollections,f.objects=u(e),f.tiles=n(f),s(f),f}},4281:(t,e,i)=>{var s=i(28820),n=i(8847),r=function(t){return{x:t.x,y:t.y}},a=["id","name","type","rotation","properties","visible","x","y","width","height"];t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0);var o=s(t,a);if(o.x+=e,o.y+=i,t.gid){var h=n(t.gid);o.gid=h.gid,o.flippedHorizontal=h.flippedHorizontal,o.flippedVertical=h.flippedVertical,o.flippedAntiDiagonal=h.flippedAntiDiagonal}else t.polyline?o.polyline=t.polyline.map(r):t.polygon?o.polygon=t.polygon.map(r):t.ellipse?o.ellipse=t.ellipse:t.text?o.text=t.text:t.point?o.point=!0:o.rectangle=!0;return o}},61136:(t,e,i)=>{var s=i(72632),n=i(4281),r=i(15256),a=i(92044);t.exports=function(t){for(var e=[],i=[],o=a(t);o.i0;)if(o.i>=o.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}o=i.pop()}else{var h=o.layers[o.i];if(o.i++,h.opacity*=o.opacity,h.visible=o.visible&&h.visible,"objectgroup"===h.type){h.name=o.name+h.name;for(var l=o.x+s(h,"startx",0)+s(h,"offsetx",0),u=o.y+s(h,"starty",0)+s(h,"offsety",0),c=[],d=0;d{var s=i(43908),n=i(12920),r=i(92044),a=i(21394),o=i(72632),h=i(94990),l=i(8847),u=i(29633);t.exports=function(t,e){for(var i=o(t,"infinite",!1),c=[],d=[],f=r(t);f.i0;)if(f.i>=f.layers.length){if(d.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}f=d.pop()}else{var p=f.layers[f.i];if(f.i++,"tilelayer"===p.type)if(p.compression)console.warn("TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '"+p.name+"'");else{if(p.encoding&&"base64"===p.encoding){if(p.chunks)for(var v=0;v0?((y=new u(g,m.gid,L,F,t.tilewidth,t.tileheight)).rotation=m.rotation,y.flipX=m.flipped,T[F][L]=y):(x=e?null:new u(g,-1,L,F,t.tilewidth,t.tileheight),T[F][L]=x),++w===_.width&&(M++,w=0)}}else{(g=new h({name:f.name+p.name,x:f.x+o(p,"offsetx",0)+p.x,y:f.y+o(p,"offsety",0)+p.y,width:p.width,height:p.height,tileWidth:t.tilewidth,tileHeight:t.tileheight,alpha:f.opacity*p.opacity,visible:f.visible&&p.visible,properties:o(p,"properties",[]),orientation:a(t.orientation)})).orientation===n.HEXAGONAL&&(g.hexSideLength=t.hexsidelength);for(var D=[],k=0,I=p.data.length;k0?((y=new u(g,m.gid,w,T.length,t.tilewidth,t.tileheight)).rotation=m.rotation,y.flipX=m.flipped,D.push(y)):(x=e?null:new u(g,-1,w,T.length,t.tilewidth,t.tileheight),D.push(x)),++w===p.width&&(T.push(D),w=0,D=[])}g.data=T,c.push(g)}else if("group"===p.type){var B=r(t,p,f);d.push(f),f=B}}return c}},93392:(t,e,i)=>{var s=i(47975),n=i(97042),r=i(4281),a=i(39642);t.exports=function(t){for(var e,i=[],o=[],h=null,l=0;l1){var d=void 0,f=void 0;if(Array.isArray(u.tiles)){d=d||{},f=f||{};for(var p=0;p{t.exports=function(t,e){for(var i=0;i0){var r,a,o,h={},l={};if(Array.isArray(s.edgecolors))for(r=0;r{t.exports={AssignTileProperties:i(48646),Base64Decode:i(43908),BuildTilesetIndex:i(14556),CreateGroupLayer:i(92044),ParseGID:i(8847),ParseImageLayers:i(78339),ParseJSONTiled:i(2378),ParseObject:i(4281),ParseObjectLayers:i(61136),ParseTileLayers:i(95925),ParseTilesets:i(93392)}},73779:(t,e,i)=>{var s=i(56694),n=i(91963),r=i(7599),a=i(57911),o=i(66458),h=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.now=0,this.timeScale=1,this.paused=!1,this._active=[],this._pendingInsertion=[],this._pendingRemoval=[],t.sys.events.once(r.BOOT,this.boot,this),t.sys.events.on(r.START,this.start,this)},boot:function(){this.now=this.systems.game.loop.time,this.systems.events.once(r.DESTROY,this.destroy,this)},start:function(){var t=this.systems.events;t.on(r.PRE_UPDATE,this.preUpdate,this),t.on(r.UPDATE,this.update,this),t.once(r.SHUTDOWN,this.shutdown,this)},addEvent:function(t){var e;return t instanceof a?(e=t,this.removeEvent(e),e.elapsed=e.startAt,e.hasDispatched=!1,e.repeatCount=-1===e.repeat||e.loop?999999999999:e.repeat):e=new a(t),this._pendingInsertion.push(e),e},delayedCall:function(t,e,i,s){return this.addEvent({delay:t,callback:e,args:i,callbackScope:s})},clearPendingEvents:function(){return this._pendingInsertion=[],this},removeEvent:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e-1&&this._active.splice(n,1),s.destroy()}for(i=0;i=s.delay)){var n=s.elapsed-s.delay;if(s.elapsed=s.delay,!s.hasDispatched&&s.callback&&(s.hasDispatched=!0,s.callback.apply(s.callbackScope,s.args)),s.repeatCount>0){if(s.repeatCount--,n>=s.delay)for(;n>=s.delay&&s.repeatCount>0;)s.callback&&s.callback.apply(s.callbackScope,s.args),n-=s.delay,s.repeatCount--;s.elapsed=n,s.hasDispatched=!1}else s.hasDispatched&&this._pendingRemoval.push(s)}}}},shutdown:function(){var t;for(t=0;t{var s=i(56694),n=i(72632),r=new s({initialize:function(t){this.delay=0,this.repeat=0,this.repeatCount=0,this.loop=!1,this.callback,this.callbackScope,this.args,this.timeScale=1,this.startAt=0,this.elapsed=0,this.paused=!1,this.hasDispatched=!1,this.reset(t)},reset:function(t){return this.delay=n(t,"delay",0),this.repeat=n(t,"repeat",0),this.loop=n(t,"loop",!1),this.callback=n(t,"callback",void 0),this.callbackScope=n(t,"callbackScope",this.callback),this.args=n(t,"args",[]),this.timeScale=n(t,"timeScale",1),this.startAt=n(t,"startAt",0),this.paused=n(t,"paused",!1),this.elapsed=this.startAt,this.hasDispatched=!1,this.repeatCount=-1===this.repeat||this.loop?999999999999:this.repeat,this},getProgress:function(){return this.elapsed/this.delay},getOverallProgress:function(){if(this.repeat>0){var t=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/t}return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return.001*this.elapsed},getRemaining:function(){return this.delay-this.elapsed},getRemainingSeconds:function(){return.001*this.getRemaining()},getOverallRemaining:function(){return this.delay*(1+this.repeatCount)-this.elapsed},getOverallRemainingSeconds:function(){return.001*this.getOverallRemaining()},remove:function(t){void 0===t&&(t=!1),this.elapsed=this.delay,this.hasDispatched=!t,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});t.exports=r},97121:(t,e,i)=>{t.exports={Clock:i(73779),TimerEvent:i(57911)}},64532:(t,e,i)=>{var s=i(66458),n=i(56694),r=i(5454),a=i(68710),o=i(91963),h=i(7599),l=i(91944),u=i(39366),c=i(68061),d=i(45641),f=i(56034),p=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.timeScale=1,this.paused=!1,this.processing=!1,this.tweens=[],this.time=0,this.startTime=0,this.nextTime=0,this.prevTime=0,this.maxLag=500,this.lagSkip=33,this.gap=1e3/240,t.sys.events.once(h.BOOT,this.boot,this),t.sys.events.on(h.START,this.start,this)},boot:function(){this.systems.events.once(h.DESTROY,this.destroy,this)},start:function(){var t=this.systems.events;t.on(h.UPDATE,this.update,this),t.once(h.SHUTDOWN,this.shutdown,this),this.timeScale=1,this.paused=!1,this.startTime=Date.now(),this.prevTime=this.startTime,this.nextTime=this.gap},create:function(t){Array.isArray(t)||(t=[t]);for(var e=[],i=0;i-1},existing:function(t){return this.has(t)||this.tweens.push(t.init()),this},addCounter:function(t){var e=a(this,t);return this.tweens.push(e.init()),e},stagger:function(t,e){return l(t,e)},setLagSmooth:function(t,e){return void 0===t&&(t=1/1e-8),void 0===e&&(e=0),this.maxLag=t,this.lagSkip=Math.min(e,this.maxLag),this},setFps:function(t){return void 0===t&&(t=240),this.gap=1e3/t,this.nextTime=1e3*this.time+this.gap,this},getDelta:function(t){var e=Date.now()-this.prevTime;e>this.maxLag&&(this.startTime+=e-this.lagSkip),this.prevTime+=e;var i=this.prevTime-this.startTime,s=i-this.nextTime,n=i-1e3*this.time;return s>0||t?(i/=1e3,this.time=i,this.nextTime+=s+(s>=this.gap?4:this.gap-s)):n=0,n},tick:function(){return this.step(!0),this},update:function(){this.paused||this.step(!1)},step:function(t){void 0===t&&(t=!1);var e=this.getDelta(t);if(0!==e){var i,s;this.processing=!0;var n=[],r=this.tweens;for(i=0;i0){for(i=0;i-1&&(s.isPendingRemove()||s.isDestroyed())&&(r.splice(o,1),s.destroy())}n.length=0}this.processing=!1}},remove:function(t){return this.processing?t.setPendingRemoveState():(s(this.tweens,t),t.setRemovedState()),this},reset:function(t){return this.existing(t),t.seek(),t.setActiveState(),this},makeActive:function(t){return this.existing(t),t.setActiveState(),this},each:function(t,e){var i,s=[null];for(i=1;i{t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},21902:(t,e,i)=>{var s=i(35060),n=i(40587);t.exports=function(t,e){var i=s.Power0;if("string"==typeof t)if(s.hasOwnProperty(t))i=s[t];else{var r="";if(t.indexOf(".")){var a=(r=t.substring(t.indexOf(".")+1)).toLowerCase();"in"===a?r="easeIn":"out"===a?r="easeOut":"inout"===a&&(r="easeInOut")}t=n(t.substring(0,t.indexOf(".")+1)+r),s.hasOwnProperty(t)&&(i=s[t])}else"function"==typeof t&&(i=t);if(!e)return i;var o=e.slice(0);return o.unshift(0),function(t){return o[0]=t,i.apply(this,o)}}},4840:(t,e,i)=>{var s=i(63210),n=i(88332),r={bezier:s,catmull:n,catmullrom:n,linear:i(47614)};t.exports=function(t){if(null===t)return null;var e=r.linear;return"string"==typeof t?r.hasOwnProperty(t)&&(e=r[t]):"function"==typeof t&&(e=t),e}},28348:t=>{t.exports=function(t,e,i){var s;t.hasOwnProperty(e)?s="function"===typeof t[e]?function(i,s,n,r,a,o){return t[e](i,s,n,r,a,o)}:function(){return t[e]}:s="function"==typeof i?i:function(){return i};return s}},92407:(t,e,i)=>{var s=i(53709);t.exports=function(t){var e,i=[];if(t.hasOwnProperty("props"))for(e in t.props)"_"!==e.substring(0,1)&&i.push({key:e,value:t.props[e]});else for(e in t)-1===s.indexOf(e)&&"_"!==e.substring(0,1)&&i.push({key:e,value:t[e]});return i}},65868:(t,e,i)=>{var s=i(10850);t.exports=function(t){var e=s(t,"targets",null);return null===e||("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e])),e}},9744:(t,e,i)=>{var s=i(17489),n=i(61616);function r(t){return!!t.getActive&&"function"==typeof t.getActive}function a(t){return!!t.getStart&&"function"==typeof t.getStart}function o(t){return!!t.getEnd&&"function"==typeof t.getEnd}var h=function(t,e){var i,l,u=function(t,e,i){return i},c=function(t,e,i){return i},d=null,f=typeof e;if("number"===f)u=function(){return e};else if(Array.isArray(e))c=function(){return e[0]},u=function(){return e[e.length-1]};else if("string"===f){var p=e.toLowerCase(),v="random"===p.substring(0,6),g="int"===p.substring(0,3);if(v||g){var m=p.indexOf("("),y=p.indexOf(")"),x=p.indexOf(",");if(!(m&&y&&x))throw new Error("invalid random() format");var T=parseFloat(p.substring(m+1,x)),w=parseFloat(p.substring(x+1,y));u=v?function(){return n(T,w)}:function(){return s(T,w)}}else{p=p[0];var E=parseFloat(e.substr(2));switch(p){case"+":u=function(t,e,i){return i+E};break;case"-":u=function(t,e,i){return i-E};break;case"*":u=function(t,e,i){return i*E};break;case"/":u=function(t,e,i){return i/E};break;default:u=function(){return parseFloat(e)}}}}else if("function"===f)u=e;else if("object"===f)if(a(l=e)||o(l)||r(l))r(e)&&(d=e.getActive),o(e)&&(u=e.getEnd),a(e)&&(c=e.getStart);else if(e.hasOwnProperty("value"))i=h(t,e.value);else{var S=e.hasOwnProperty("to"),b=e.hasOwnProperty("from"),A=e.hasOwnProperty("start");if(S&&(b||A)){if(i=h(t,e.to),A){var _=h(t,e.start);i.getActive=_.getEnd}if(b){var C=h(t,e.from);i.getStart=C.getEnd}}}return i||(i={getActive:d,getEnd:u,getStart:c}),i};t.exports=h},68710:(t,e,i)=>{var s=i(502),n=i(99730),r=i(20494),a=i(63130),o=i(21902),h=i(28348),l=i(10850),u=i(9744),c=i(72066),d=i(39366);t.exports=function(t,e,i){if(e instanceof d)return e.parent=t,e;i=void 0===i?n:c(n,i);var f=l(e,"from",0),p=l(e,"to",1),v=[{value:f}],g=l(e,"delay",i.delay),m=l(e,"easeParams",i.easeParams),y=l(e,"ease",i.ease),x=u("value",p),T=new d(t,v),w=T.add(0,"value",x.getEnd,x.getStart,x.getActive,o(l(e,"ease",y),l(e,"easeParams",m)),h(e,"delay",g),l(e,"duration",i.duration),a(e,"yoyo",i.yoyo),l(e,"hold",i.hold),l(e,"repeat",i.repeat),l(e,"repeatDelay",i.repeatDelay),!1,!1);w.start=f,w.current=f,T.completeDelay=r(e,"completeDelay",0),T.loop=Math.round(r(e,"loop",0)),T.loopDelay=Math.round(r(e,"loopDelay",0)),T.paused=a(e,"paused",!1),T.persist=a(e,"persist",!1),T.callbackScope=l(e,"callbackScope",T);for(var E=s.TYPES,S=0;S{var s=i(21902),n=i(10850),r=i(83392);t.exports=function(t,e){var i;void 0===e&&(e={});var a=n(e,"start",0),o=n(e,"ease",null),h=n(e,"grid",null),l=n(e,"from",0),u="first"===l,c="center"===l,d="last"===l,f="number"==typeof l,p=Array.isArray(t),v=p?parseFloat(t[0]):parseFloat(t),g=p?parseFloat(t[1]):0,m=Math.max(v,g);if(p&&(a+=v),h){var y=h[0],x=h[1],T=0,w=0,E=0,S=0,b=[];d?(T=y-1,w=x-1):f?(T=l%y,w=Math.floor(l/y)):c&&(T=(y-1)/2,w=(x-1)/2);for(var A=r.MIN_SAFE_INTEGER,_=0;_A&&(A=R),b[_][C]=R}}}var M=o?s(o):null;return i=h?function(t,e,i,s){var n,r=0,o=s%y,h=Math.floor(s/y);if(o>=0&&o=0&&h{var s=i(502),n=i(99730),r=i(20494),a=i(63130),o=i(21902),h=i(4840),l=i(28348),u=i(92407),c=i(65868),d=i(10850),f=i(9744),p=i(72066),v=i(39366);t.exports=function(t,e,i){if(e instanceof v)return e.parent=t,e;i=void 0===i?n:p(n,i);var g=c(e);!g&&i.targets&&(g=i.targets);for(var m=u(e),y=d(e,"delay",i.delay),x=d(e,"duration",i.duration),T=d(e,"easeParams",i.easeParams),w=d(e,"ease",i.ease),E=d(e,"hold",i.hold),S=d(e,"repeat",i.repeat),b=d(e,"repeatDelay",i.repeatDelay),A=a(e,"yoyo",i.yoyo),_=a(e,"flipX",i.flipX),C=a(e,"flipY",i.flipY),R=d(e,"interpolation",i.interpolation),M=function(t,e,i,s){if("texture"===i){var n=s,r=void 0;Array.isArray(s)?(n=s[0],r=s[1]):s.hasOwnProperty("value")&&(n=s.value,Array.isArray(s.value)&&(n=s.value[0],r=s.value[1])),t.addFrame(e,n,r,l(s,"delay",y),d(s,"duration",x),d(s,"hold",E),d(s,"repeat",S),d(s,"repeatDelay",b),a(s,"flipX",_),a(s,"flipY",C))}else{var u=f(i,s),c=h(d(s,"interpolation",R));t.add(e,i,u.getEnd,u.getStart,u.getActive,o(d(s,"ease",w),d(s,"easeParams",T)),l(s,"delay",y),d(s,"duration",x),a(s,"yoyo",A),d(s,"hold",E),d(s,"repeat",S),d(s,"repeatDelay",b),a(s,"flipX",_),a(s,"flipY",C),c,c?s:null)}},P=new v(t,g),O=0;O{var s=i(502),n=i(20494),r=i(63130),a=i(65868),o=i(10850),h=i(68061),l=i(45641);t.exports=function(t,e){if(e instanceof l)return e.parent=t,e;var i,u=new l(t);u.startDelay=o(e,"delay",0),u.completeDelay=n(e,"completeDelay",0),u.loop=Math.round(n(e,"loop",o(e,"repeat",0))),u.loopDelay=Math.round(n(e,"loopDelay",o(e,"repeatDelay",0))),u.paused=r(e,"paused",!1),u.persist=r(e,"persist",!0),u.callbackScope=o(e,"callbackScope",u);var c=s.TYPES;for(i=0;i{t.exports={GetBoolean:i(63130),GetEaseFunction:i(21902),GetInterpolationFunction:i(4840),GetNewValue:i(28348),GetProps:i(92407),GetTargets:i(65868),GetValueOp:i(9744),NumberTweenBuilder:i(68710),StaggerBuilder:i(91944),TweenBuilder:i(68061)}},5570:t=>{t.exports="active"},6383:t=>{t.exports="complete"},72582:t=>{t.exports="loop"},90281:t=>{t.exports="pause"},80803:t=>{t.exports="repeat"},13640:t=>{t.exports="resume"},10472:t=>{t.exports="start"},5379:t=>{t.exports="stop"},43449:t=>{t.exports="update"},61541:t=>{t.exports="yoyo"},54272:(t,e,i)=>{t.exports={TWEEN_ACTIVE:i(5570),TWEEN_COMPLETE:i(6383),TWEEN_LOOP:i(72582),TWEEN_PAUSE:i(90281),TWEEN_RESUME:i(13640),TWEEN_REPEAT:i(80803),TWEEN_START:i(10472),TWEEN_STOP:i(5379),TWEEN_UPDATE:i(43449),TWEEN_YOYO:i(61541)}},75193:(t,e,i)=>{var s={States:i(55303),Builders:i(79619),Events:i(54272),TweenManager:i(64532),Tween:i(39366),TweenData:i(15718)};t.exports=s},502:(t,e,i)=>{var s=i(56694),n=i(6659),r=i(54272),a=i(55303),o=new s({Extends:n,initialize:function(t){n.call(this),this.parent=t,this.data=[],this.totalData=0,this.startDelay=0,this.hasStarted=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.completeDelay=0,this.countdown=0,this.state=a.PENDING,this.paused=!1,this.callbacks={onActive:null,onComplete:null,onLoop:null,onPause:null,onRepeat:null,onResume:null,onStart:null,onStop:null,onUpdate:null,onYoyo:null},this.callbackScope,this.persist=!1},init:function(){return this.initTweenData(),this.setActiveState(),this.dispatchEvent(r.TWEEN_ACTIVE,"onActive"),this},setTimeScale:function(t){return this.timeScale=t,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return!this.paused&&this.isActive()},isPaused:function(){return this.paused},pause:function(){return this.paused||(this.paused=!0,this.dispatchEvent(r.TWEEN_PAUSE,"onPause")),this},resume:function(){return this.paused&&(this.paused=!1,this.dispatchEvent(r.TWEEN_RESUME,"onResume")),this},makeActive:function(){this.parent.makeActive(this),this.dispatchEvent(r.TWEEN_ACTIVE,"onActive")},onCompleteHandler:function(){this.setPendingRemoveState(),this.dispatchEvent(r.TWEEN_COMPLETE,"onComplete")},complete:function(t){return void 0===t&&(t=0),t?(this.setCompleteDelayState(),this.countdown=t):this.onCompleteHandler(),this},completeAfterLoop:function(t){return void 0===t&&(t=0),this.loopCounter>t&&(this.loopCounter=t),this},remove:function(){return this.parent.remove(this),this},stop:function(){return this.isRemoved()||this.isPendingRemove()||(this.dispatchEvent(r.TWEEN_STOP,"onStop"),this.setPendingRemoveState()),this},updateLoopCountdown:function(t){this.countdown-=t,this.countdown<=0&&(this.setActiveState(),this.dispatchEvent(r.TWEEN_LOOP,"onLoop"))},updateStartCountdown:function(t){return this.countdown-=t,this.countdown<=0&&(this.hasStarted=!0,this.setActiveState(),this.dispatchEvent(r.TWEEN_START,"onStart"),t=0),t},updateCompleteDelay:function(t){this.countdown-=t,this.countdown<=0&&this.onCompleteHandler()},setCallback:function(t,e,i){return void 0===i&&(i=[]),this.callbacks.hasOwnProperty(t)&&(this.callbacks[t]={func:e,params:i}),this},setPendingState:function(){this.state=a.PENDING},setActiveState:function(){this.state=a.ACTIVE},setLoopDelayState:function(){this.state=a.LOOP_DELAY},setCompleteDelayState:function(){this.state=a.COMPLETE_DELAY},setStartDelayState:function(){this.state=a.START_DELAY,this.countdown=this.startDelay,this.hasStarted=!1},setPendingRemoveState:function(){this.state=a.PENDING_REMOVE},setRemovedState:function(){this.state=a.REMOVED},setFinishedState:function(){this.state=a.FINISHED},setDestroyedState:function(){this.state=a.DESTROYED},isPending:function(){return this.state===a.PENDING},isActive:function(){return this.state===a.ACTIVE},isLoopDelayed:function(){return this.state===a.LOOP_DELAY},isCompleteDelayed:function(){return this.state===a.COMPLETE_DELAY},isStartDelayed:function(){return this.state===a.START_DELAY},isPendingRemove:function(){return this.state===a.PENDING_REMOVE},isRemoved:function(){return this.state===a.REMOVED},isFinished:function(){return this.state===a.FINISHED},isDestroyed:function(){return this.state===a.DESTROYED},destroy:function(){this.data&&this.data.forEach((function(t){t.destroy()})),this.removeAllListeners(),this.callbacks=null,this.data=null,this.parent=null,this.setDestroyedState()}});o.TYPES=["onActive","onComplete","onLoop","onPause","onRepeat","onResume","onStart","onStop","onUpdate","onYoyo"],t.exports=o},65521:(t,e,i)=>{var s=i(56694),n=i(55303),r=new s({initialize:function(t,e,i,s,n,r,a,o,h,l){this.tween=t,this.targetIndex=e,this.duration=s,this.totalDuration=0,this.delay=0,this.getDelay=i,this.yoyo=n,this.hold=r,this.repeat=a,this.repeatDelay=o,this.repeatCounter=0,this.flipX=h,this.flipY=l,this.progress=0,this.elapsed=0,this.state=0,this.isCountdown=!1},setCreatedState:function(){this.state=n.CREATED,this.isCountdown=!1},setDelayState:function(){this.state=n.DELAY,this.isCountdown=!0},setPendingRenderState:function(){this.state=n.PENDING_RENDER,this.isCountdown=!1},setPlayingForwardState:function(){this.state=n.PLAYING_FORWARD,this.isCountdown=!1},setPlayingBackwardState:function(){this.state=n.PLAYING_BACKWARD,this.isCountdown=!1},setHoldState:function(){this.state=n.HOLD_DELAY,this.isCountdown=!0},setRepeatState:function(){this.state=n.REPEAT_DELAY,this.isCountdown=!0},setCompleteState:function(){this.state=n.COMPLETE,this.isCountdown=!1},isCreated:function(){return this.state===n.CREATED},isDelayed:function(){return this.state===n.DELAY},isPendingRender:function(){return this.state===n.PENDING_RENDER},isPlayingForward:function(){return this.state===n.PLAYING_FORWARD},isPlayingBackward:function(){return this.state===n.PLAYING_BACKWARD},isHolding:function(){return this.state===n.HOLD_DELAY},isRepeating:function(){return this.state===n.REPEAT_DELAY},isComplete:function(){return this.state===n.COMPLETE},destroy:function(){this.tween=null,this.getDelay=null,this.setCompleteState()}});t.exports=r},99730:t=>{t.exports={targets:null,delay:0,duration:1e3,ease:"Power0",easeParams:null,hold:0,repeat:0,repeatDelay:0,yoyo:!1,flipX:!1,flipY:!1,persist:!1,interpolation:null}},53709:t=>{t.exports=["callbackScope","completeDelay","delay","duration","ease","easeParams","flipX","flipY","hold","interpolation","loop","loopDelay","onActive","onActiveParams","onComplete","onCompleteParams","onLoop","onLoopParams","onPause","onPauseParams","onRepeat","onRepeatParams","onResume","onResumeParams","onStart","onStartParams","onStop","onStopParams","onUpdate","onUpdateParams","onYoyo","onYoyoParams","paused","persist","props","repeat","repeatDelay","targets","yoyo"]},39366:(t,e,i)=>{var s=i(502),n=i(56694),r=i(54272),a=i(99325),o=i(61286),h=i(83392),l=i(55303),u=i(15718),c=i(96490),d=new n({Extends:s,initialize:function(t,e){s.call(this,t),this.targets=e,this.totalTargets=e.length,this.isSeeking=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.delta=0},add:function(t,e,i,s,n,r,a,o,h,l,c,d,f,p,v,g){var m=new u(this,t,e,i,s,n,r,a,o,h,l,c,d,f,p,v,g);return this.totalData=this.data.push(m),m},addFrame:function(t,e,i,s,n,r,a,o,h,l){var u=new c(this,t,e,i,s,n,r,a,o,h,l);return this.totalData=this.data.push(u),u},getValue:function(t){return void 0===t&&(t=0),this.data[t].current},hasTarget:function(t){return-1!==this.targets.indexOf(t)},updateTo:function(t,e,i){void 0===i&&(i=!1);for(var s=0;s0)this.elapsed=0,this.progress=0,this.loopCounter--,this.resetTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(r.TWEEN_LOOP,"onLoop"));else{if(!(this.completeDelay>0))return this.onCompleteHandler(),!0;this.countdown=this.completeDelay,this.setCompleteDelayState()}return!1},onCompleteHandler:function(){this.progress=1,this.totalProgress=1,s.prototype.onCompleteHandler.call(this)},play:function(){return this.isDestroyed()?(console.warn("Cannot play destroyed Tween",this),this):((this.isPendingRemove()||this.isPending())&&this.seek(),this.paused=!1,this.setActiveState(),this)},resetTweenData:function(t){for(var e=this.data,i=this.totalData,s=0;s0){this.isSeeking=!0;do{this.update(e)}while(this.totalProgress<=t);this.isSeeking=!1}return this},initTweenData:function(t){void 0===t&&(t=!1),this.reset(!0),this.duration=0,this.startDelay=h.MAX_SAFE_INTEGER;for(var e=this.data,i=0;i0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},reset:function(t){this.elapsed=0,this.progress=0,this.totalElapsed=0,this.totalProgress=0,this.loopCounter=-1===this.loop?999999999999:this.loop,t||(this.resetTweenData(!0),this.setActiveState(),this.dispatchEvent(r.TWEEN_ACTIVE,"onActive"))},update:function(t){if(this.isPendingRemove()||this.isDestroyed())return!0;if(this.isFinished()||this.paused&&!this.isSeeking)return!1;t*=this.timeScale*this.parent.timeScale,this.isLoopDelayed()?this.updateLoopCountdown(t):this.isCompleteDelayed()?this.updateCompleteDelay(t):this.hasStarted||this.isSeeking||(this.startDelay-=t,this.startDelay<=0&&(this.hasStarted=!0,this.dispatchEvent(r.TWEEN_START,"onStart"),t=0));var e=!1;if(this.isActive())for(var i=this.data,s=0;s{var s=i(66458),n=i(502),r=i(56694),a=i(54272),o=i(99325),h=i(61286),l=new r({Extends:n,initialize:function(t){n.call(this,t),this.currentTween=null,this.currentIndex=0},init:function(){return this.loopCounter=-1===this.loop?999999999999:this.loop,this.setCurrentTween(0),this.startDelay>0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this.dispatchEvent(a.TWEEN_ACTIVE,"onActive"),this},add:function(t){var e=this.parent.create(t);Array.isArray(e)||(e=[e]);for(var i=this.data,s=0;s0)this.loopCounter--,this.resetTweens(),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(a.TWEEN_LOOP,"onLoop"));else{if(!(this.completeDelay>0))return this.onCompleteHandler(),!0;this.countdown=this.completeDelay,this.setCompleteDelayState()}return!1},play:function(){return this.isDestroyed()?(console.warn("Cannot play destroyed TweenChain",this),this):((this.isPendingRemove()||this.isPending())&&this.resetTweens(),this.paused=!1,this.startDelay>0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this)},resetTweens:function(){for(var t=this.data,e=this.totalData,i=0;i{var s=i(65521),n=i(56694),r=i(54272),a=new n({Extends:s,initialize:function(t,e,i,n,r,a,o,h,l,u,c,d,f,p,v,g,m){s.call(this,t,e,h,l,u,c,d,f,p,v),this.key=i,this.getActiveValue=a,this.getEndValue=n,this.getStartValue=r,this.ease=o,this.start=0,this.previous=0,this.current=0,this.end=0,this.interpolation=g,this.interpolationData=m},init:function(t){var e=this.tween,i=e.totalTargets,s=this.targetIndex,n=e.targets[s],r=this.key;this.delay=this.getDelay(n,r,0,s,i,e),this.repeatCounter=-1===this.repeat?999999999999:this.repeat,this.setPendingRenderState();var a=this.duration+this.hold;this.yoyo&&(a+=this.duration);var o=a+this.repeatDelay;this.totalDuration=this.delay+a,-1===this.repeat?this.totalDuration+=999999999999*o:this.repeat>0&&(this.totalDuration+=o*this.repeat),this.totalDuration>e.duration&&(e.duration=this.totalDuration),this.delay0&&(this.elapsed=this.delay,this.setDelayState()),!t&&this.getActiveValue&&(n[r]=this.getActiveValue(n,r,this.start))},update:function(t){var e=this.tween,i=e.totalTargets,s=this.targetIndex,n=e.targets[s],a=this.key;if(!n)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=t,this.elapsed<=0&&(this.elapsed=0,t=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(r.TWEEN_REPEAT,"onRepeat")):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.start=this.getStartValue(n,a,n[a],s,i,e),this.end=this.getEndValue(n,a,this.start,s,i,e),this.current=this.start,n[a]=this.start,this.setPlayingForwardState(),!0;var o=this.isPlayingForward(),h=this.isPlayingBackward();if(o||h){var l=this.elapsed,u=this.duration,c=0,d=!1;(l+=t)>=u&&(c=l-u,l=u,d=!0);var f=l/u;if(this.elapsed=l,this.progress=f,this.previous=this.current,d)o?(this.current=this.end,n[a]=this.end,this.hold>0&&this.repeatCounter>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(c)):(this.current=this.start,n[a]=this.start,this.setStateFromStart(c));else{o||(f=1-f);var p=this.ease(f);this.interpolation?this.current=this.interpolation(this.interpolationData,p):this.current=this.start+(this.end-this.start)*p,n[a]=this.current}this.dispatchEvent(r.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},reset:function(t){var e=this.tween,i=e.totalTargets,s=this.targetIndex,n=e.targets[s],r=this.key;this.progress=0,this.elapsed=0,this.repeatCounter=-1===this.repeat?999999999999:this.repeat,t?(this.start=this.getStartValue(n,r,this.start,s,i,e),this.end=this.getEndValue(n,r,this.end,s,i,e),this.current=this.start,this.setPlayingForwardState()):this.setPendingRenderState(),this.delay>0&&(this.elapsed=this.delay,this.setDelayState()),this.getActiveValue&&(n[r]=this.getActiveValue(n,r,this.start))},dispatchEvent:function(t,e){var i=this.tween;if(!i.isSeeking){var s=i.targets[this.targetIndex],n=this.key,r=this.current,a=this.previoius;i.emit(t,i,n,s,r,a);var o=i.callbacks[e];o&&o.func.apply(o.scope,[i,s,n,r,a].concat(o.params))}},setStateFromEnd:function(t){this.yoyo?this.onRepeat(t,!0,!0):this.repeatCounter>0?this.onRepeat(t,!0):this.setCompleteState()},setStateFromStart:function(t){this.repeatCounter>0?this.onRepeat(t,!1):this.setCompleteState()},onRepeat:function(t,e,i){void 0===i&&(i=!1);var s=this.tween,n=s.totalTargets,a=this.targetIndex,o=s.targets[a],h=this.key;if(this.elapsed=t,this.progress=t/this.duration,this.flipX&&o.toggleFlipX(),this.flipY&&o.toggleFlipY(),(e||i)&&(this.start=this.getStartValue(o,h,this.start,a,n,s)),i)return this.setPlayingBackwardState(),void this.dispatchEvent(r.TWEEN_YOYO,"onYoyo");this.repeatCounter--,this.end=this.getEndValue(o,h,this.start,a,n,s),this.repeatDelay>0?(this.elapsed=this.repeatDelay-t,this.current=this.start,o[h]=this.current,this.setRepeatState()):(this.setPlayingForwardState(),this.dispatchEvent(r.TWEEN_REPEAT,"onRepeat"))},destroy:function(){s.prototype.destroy.call(this),this.getActiveValue=null,this.getEndValue=null,this.getStartValue=null,this.ease=null}});t.exports=a},96490:(t,e,i)=>{var s=i(65521),n=i(56694),r=i(54272),a=new n({Extends:s,initialize:function(t,e,i,n,r,a,o,h,l,u,c){s.call(this,t,e,r,a,!1,o,h,l,u,c),this.startTexture=null,this.endTexture=i,this.startFrame=null,this.endFrame=n,this.yoyo=h>0},init:function(t){var e=this.tween,i=e.totalTargets,s=this.targetIndex,n=e.targets[s];this.delay=this.getDelay(n,"texture",0,s,i,e),this.repeatCounter=-1===this.repeat?999999999999:this.repeat,this.setPendingRenderState();var r=this.duration+this.hold;this.yoyo&&(r+=this.duration);var a=r+this.repeatDelay;this.totalDuration=this.delay+r,-1===this.repeat?this.totalDuration+=999999999999*a:this.repeat>0&&(this.totalDuration+=a*this.repeat),this.totalDuration>e.duration&&(e.duration=this.totalDuration),this.delay0&&(this.elapsed=this.delay,this.setDelayState())},update:function(t){var e=this.tween,i=this.targetIndex,s=e.targets[i];if(!s)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=t,this.elapsed<=0&&(this.elapsed=0,t=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(r.TWEEN_REPEAT,"onRepeat")):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.startTexture&&s.setTexture(this.startTexture,this.startFrame),this.setPlayingForwardState(),!0;var n=this.isPlayingForward(),a=this.isPlayingBackward();if(n||a){var o=this.elapsed,h=this.duration,l=0,u=!1;(o+=t)>=h&&(l=o-h,o=h,u=!0);var c=o/h;this.elapsed=o,this.progress=c,u&&(n?(s.setTexture(this.endTexture,this.endFrame),this.hold>0&&this.repeatCounter>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(l)):(s.setTexture(this.startTexture,this.startFrame),this.setStateFromStart(l))),this.dispatchEvent(r.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},reset:function(t){this.progress=0,this.elapsed=0,this.repeatCounter=-1===this.repeat?999999999999:this.repeat,t?this.setPlayingForwardState():this.setPendingRenderState(),this.delay>0&&(this.elapsed=this.delay,this.setDelayState())},dispatchEvent:function(t,e){var i=this.tween;if(!i.isSeeking){var s=i.targets[this.targetIndex];i.emit(t,i,"texture",s);var n=i.callbacks[e];n&&n.func.apply(n.scope,[i,s,"texture"].concat(n.params))}},setStateFromEnd:function(t){this.repeatCounter>0?this.onRepeat(t,!0):this.setCompleteState()},setStateFromStart:function(t){this.repeatCounter>0?this.onRepeat(t,!1):this.setCompleteState()},onRepeat:function(t,e){void 0===e&&(e=!1);var i=this.tween,s=this.targetIndex,n=i.targets[s];if(this.elapsed=t,this.progress=t/this.duration,this.flipX&&n.toggleFlipX(),this.flipY&&n.toggleFlipY(),e)return this.setPlayingBackwardState(),void this.dispatchEvent(r.TWEEN_YOYO,"onYoyo");this.repeatCounter--,this.repeatDelay>0?(this.elapsed=this.repeatDelay-t,this.setRepeatState()):(this.setPlayingForwardState(),this.dispatchEvent(r.TWEEN_REPEAT,"onRepeat"))}});t.exports=a},55303:t=>{t.exports={CREATED:0,DELAY:2,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING:20,ACTIVE:21,LOOP_DELAY:22,COMPLETE_DELAY:23,START_DELAY:24,PENDING_REMOVE:25,REMOVED:26,FINISHED:27,DESTROYED:28}},56694:t=>{function e(t,e,i){var s=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&s.value&&"object"==typeof s.value&&(s=s.value),!(!s||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(s))&&(void 0===s.enumerable&&(s.enumerable=!0),void 0===s.configurable&&(s.configurable=!0),s)}function i(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function s(t,s,n,a){for(var o in s)if(s.hasOwnProperty(o)){var h=e(s,o,n);if(!1!==h){if(i((a||t).prototype,o)){if(r.ignoreFinals)continue;throw new Error("cannot override final property '"+o+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,o,h)}else t.prototype[o]=s[o]}}function n(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i{t.exports=function(){}},78991:t=>{t.exports=function(t,e,i,s,n){if(void 0===n&&(n=t),i>0){var r=i-t.length;if(r<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),s&&s.call(n,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.splice(a,1),a--;if(0===(a=e.length))return null;i>0&&a>r&&(e.splice(r),a=r);for(var o=0;o{t.exports=function(t,e,i,s,n,r){if(void 0===i&&(i=0),void 0===r&&(r=t),s>0){var a=s-t.length;if(a<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),n&&n.call(r,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.pop(),o--;if(0===(o=e.length))return null;s>0&&o>a&&(e.splice(a),o=a);for(var h=o-1;h>=0;h--){var l=e[h];t.splice(i,0,l),n&&n.call(r,l)}return e}},58742:t=>{t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i{var s=i(45838);t.exports=function(t,e,i,n,r){void 0===n&&(n=0),void 0===r&&(r=t.length);var a=0;if(s(t,n,r))for(var o=n;o{t.exports=function(t,e,i){var s,n=[null];for(s=3;s{var s=i(45838);t.exports=function(t,e,i,n,r){if(void 0===n&&(n=0),void 0===r&&(r=t.length),s(t,n,r)){var a,o=[null];for(a=5;a{t.exports=function(t,e,i){if(!e.length)return NaN;if(1===e.length)return e[0];var s,n,r=1;if(i){if(te.length&&(r=e.length),i?(s=e[r-1][i],(n=e[r][i])-t<=t-s?e[r]:e[r-1]):(s=e[r-1],(n=e[r])-t<=t-s?n:s)}},5454:t=>{var e=function(t,i){void 0===i&&(i=[]);for(var s=0;s{var s=i(45838);t.exports=function(t,e,i,n,r){void 0===n&&(n=0),void 0===r&&(r=t.length);var a=[];if(s(t,n,r))for(var o=n;o{var s=i(45838);t.exports=function(t,e,i,n,r){if(void 0===n&&(n=0),void 0===r&&(r=t.length),s(t,n,r))for(var a=n;a{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var s=e+Math.floor(Math.random()*i);return void 0===t[s]?null:t[s]}},24218:t=>{t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),n=t.indexOf(i);if(s<0||n<0)throw new Error("Supplied items must be elements of the same array");return s>n||(t.splice(s,1),n===t.length-1?t.push(e):t.splice(n,0,e)),t}},58258:t=>{t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),n=t.indexOf(i);if(s<0||n<0)throw new Error("Supplied items must be elements of the same array");return s{t.exports=function(t,e){var i=t.indexOf(e);if(i>0){var s=t[i-1],n=t.indexOf(s);t[i]=s,t[n]=e}return t}},68396:t=>{t.exports=function(t,e,i){var s=t.indexOf(e);if(-1===s||i<0||i>=t.length)throw new Error("Supplied index out of bounds");return s!==i&&(t.splice(s,1),t.splice(i,0,e)),e}},27555:t=>{t.exports=function(t,e){var i=t.indexOf(e);if(-1!==i&&i{t.exports=function(t,e,i,s){var n,r=[],a=!1;if((i||s)&&(a=!0,i||(i=""),s||(s="")),e=e;n--)a?r.push(i+n.toString()+s):r.push(n);else for(n=t;n<=e;n++)a?r.push(i+n.toString()+s):r.push(n);return r}},89955:(t,e,i)=>{var s=i(67233);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var n=[],r=Math.max(s((e-t)/(i||1)),0),a=0;a{function e(t,e,i){var s=t[e];t[e]=t[i],t[i]=s}function i(t,e){return te?1:0}var s=function(t,n,r,a,o){for(void 0===r&&(r=0),void 0===a&&(a=t.length-1),void 0===o&&(o=i);a>r;){if(a-r>600){var h=a-r+1,l=n-r+1,u=Math.log(h),c=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*c*(h-c)/h)*(l-h/2<0?-1:1),f=Math.max(r,Math.floor(n-l*c/h+d)),p=Math.min(a,Math.floor(n+(h-l)*c/h+d));s(t,n,f,p,o)}var v=t[n],g=r,m=a;for(e(t,r,n),o(t[a],v)>0&&e(t,r,a);g0;)m--}0===o(t[r],v)?e(t,r,m):e(t,++m,a),m<=n&&(r=m+1),n<=m&&(a=m-1)}};t.exports=s},75757:(t,e,i)=>{var s=i(10850),n=i(18592),r=function(t,e,i){for(var s=[],n=0;n{var s=i(72677);t.exports=function(t,e,i,n){var r;if(void 0===n&&(n=t),!Array.isArray(e))return-1!==(r=t.indexOf(e))?(s(t,r),i&&i.call(n,e),e):null;for(var a=e.length-1,o=[];a>=0;){var h=e[a];-1!==(r=t.indexOf(h))&&(s(t,r),o.push(h),i&&i.call(n,h)),a--}return o}},8324:(t,e,i)=>{var s=i(72677);t.exports=function(t,e,i,n){if(void 0===n&&(n=t),e<0||e>t.length-1)throw new Error("Index out of bounds");var r=s(t,e);return i&&i.call(n,r),r}},47427:(t,e,i)=>{var s=i(45838);t.exports=function(t,e,i,n,r){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===r&&(r=t),s(t,e,i)){var a=i-e,o=t.splice(e,a);if(n)for(var h=0;h{var s=i(72677);t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var n=e+Math.floor(Math.random()*i);return s(t,n)}},80402:t=>{t.exports=function(t,e,i){var s=t.indexOf(e),n=t.indexOf(i);return-1!==s&&-1===n&&(t[s]=i,!0)}},77640:t=>{t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,s=0;s{t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,s=0;s{t.exports=function(t,e,i,s){var n=t.length;if(e<0||e>n||e>=i||i>n){if(s)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},27847:t=>{t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i>0&&(t.splice(i,1),t.unshift(e)),e}},6034:(t,e,i)=>{var s=i(45838);t.exports=function(t,e,i,n,r){if(void 0===n&&(n=0),void 0===r&&(r=t.length),s(t,n,r))for(var a=n;a{t.exports=function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(Math.random()*(e+1)),s=t[e];t[e]=t[i],t[i]=s}return t}},28834:t=>{t.exports=function(t){var e=/\D/g;return t.sort((function(t,i){return parseInt(t.replace(e,""),10)-parseInt(i.replace(e,""),10)})),t}},72677:t=>{t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,s=t[e],n=e;n{function e(t,e){return String(t).localeCompare(e)}function i(t,e,i,s){var n,r,a,o,h,l=t.length,u=0,c=2*i;for(n=0;nl&&(r=l),a>l&&(a=l),o=n,h=r;;)if(o{t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),n=t.indexOf(i);if(s<0||n<0)throw new Error("Supplied items must be elements of the same array");return t[s]=i,t[n]=e,t}},59959:(t,e,i)=>{t.exports={Matrix:i(13515),Add:i(78991),AddAt:i(48522),BringToTop:i(58742),CountAllMatching:i(30164),Each:i(36337),EachInRange:i(46208),FindClosestInSorted:i(2406),Flatten:i(5454),GetAll:i(71608),GetFirst:i(51463),GetRandom:i(72861),MoveDown:i(51172),MoveTo:i(68396),MoveUp:i(27555),MoveAbove:i(24218),MoveBelow:i(58258),NumberArray:i(13401),NumberArrayStep:i(89955),QuickSelect:i(53466),Range:i(75757),Remove:i(66458),RemoveAt:i(8324),RemoveBetween:i(47427),RemoveRandomElement:i(50147),Replace:i(80402),RotateLeft:i(77640),RotateRight:i(38487),SafeRange:i(45838),SendToBack:i(27847),SetAll:i(6034),Shuffle:i(18592),SortByDigits:i(28834),SpliceOne:i(72677),StableSort:i(17922),Swap:i(96928)}},97494:t=>{t.exports=function(t){if(!Array.isArray(t)||!Array.isArray(t[0]))return!1;for(var e=t[0].length,i=1;i{var s=i(76400),n=i(97494);t.exports=function(t){var e="";if(!n(t))return e;for(var i=0;i{t.exports=function(t){return t.reverse()}},51995:t=>{t.exports=function(t){for(var e=0;e{var s=i(63515);t.exports=function(t){return s(t,180)}},42549:(t,e,i)=>{var s=i(63515);t.exports=function(t){return s(t,90)}},63515:(t,e,i)=>{var s=i(97494),n=i(78581);t.exports=function(t,e){if(void 0===e&&(e=90),!s(t))return null;if("string"!=typeof e&&(e=(e%360+360)%360),90===e||-270===e||"rotateLeft"===e)(t=n(t)).reverse();else if(-90===e||270===e||"rotateRight"===e)t.reverse(),t=n(t);else if(180===Math.abs(e)||"rotate180"===e){for(var i=0;i{var s=i(63515);t.exports=function(t){return s(t,-90)}},27365:(t,e,i)=>{var s=i(77640),n=i(38487);t.exports=function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),0!==i&&(i<0?s(t,Math.abs(i)):n(t,i)),0!==e)for(var r=0;r{t.exports=function(t){for(var e=t.length,i=t[0].length,s=new Array(i),n=0;n-1;r--)s[n][r]=t[r][n]}return s}},13515:(t,e,i)=>{t.exports={CheckMatrix:i(97494),MatrixToString:i(68428),ReverseColumns:i(59521),ReverseRows:i(51995),Rotate180:i(89011),RotateLeft:i(42549),RotateMatrix:i(63515),RotateRight:i(14305),Translate:i(27365),TransposeMatrix:i(78581)}},40581:t=>{var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";t.exports=function(t,i){for(var s=new Uint8Array(t),n=s.length,r=i?"data:"+i+";base64,":"",a=0;a>2],r+=e[(3&s[a])<<4|s[a+1]>>4],r+=e[(15&s[a+1])<<2|s[a+2]>>6],r+=e[63&s[a+2]];return n%3==2?r=r.substring(0,r.length-1)+"=":n%3==1&&(r=r.substring(0,r.length-2)+"=="),r}},82329:t=>{for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(256),s=0;s>4,u[h++]=(15&s)<<4|n>>2,u[h++]=(3&n)<<6|63&r;return l}},78417:(t,e,i)=>{t.exports={ArrayBufferToBase64:i(40581),Base64ToArrayBuffer:i(82329)}},22178:(t,e,i)=>{t.exports={Array:i(59959),Base64:i(78417),Objects:i(64615),String:i(50379),NOOP:i(72283)}},32742:t=>{t.exports=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i]=t[i].slice(0):e[i]=t[i];return e}},28699:t=>{var e=function(t){var i,s,n;if("object"!=typeof t||null===t)return t;for(n in i=Array.isArray(t)?[]:{},t)s=t[n],i[n]=e(s);return i};t.exports=e},98611:(t,e,i)=>{var s=i(42911),n=function(){var t,e,i,r,a,o,h=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof h&&(c=h,h=arguments[1]||{},l=2),u===l&&(h=this,--l);l{var s=i(5923),n=i(10850);t.exports=function(t,e,i){var r=n(t,e,null);if(null===r)return i;if(Array.isArray(r))return s.RND.pick(r);if("object"==typeof r){if(r.hasOwnProperty("randInt"))return s.RND.integerInRange(r.randInt[0],r.randInt[1]);if(r.hasOwnProperty("randFloat"))return s.RND.realInRange(r.randFloat[0],r.randFloat[1])}else if("function"==typeof r)return r(e);return r}},72632:t=>{t.exports=function(t,e,i){var s=typeof t;return t&&"number"!==s&&"string"!==s&&t.hasOwnProperty(e)&&void 0!==t[e]?t[e]:i}},94324:(t,e,i)=>{var s=i(10850),n=i(82897);t.exports=function(t,e,i,r,a){void 0===a&&(a=i);var o=s(t,e,a);return n(o,i,r)}},10850:t=>{t.exports=function(t,e,i,s){if(!t&&!s||"number"==typeof t)return i;if(t&&t.hasOwnProperty(e))return t[e];if(s&&s.hasOwnProperty(e))return s[e];if(-1!==e.indexOf(".")){for(var n=e.split("."),r=t,a=s,o=i,h=i,l=!0,u=!0,c=0;c{t.exports=function(t,e){for(var i=0;i{t.exports=function(t,e){for(var i=0;i{t.exports=function(t,e){return t.hasOwnProperty(e)}},42911:t=>{t.exports=function(t){if("object"!=typeof t||t.nodeType||t===t.window)return!1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0}},30657:(t,e,i)=>{var s=i(32742);t.exports=function(t,e){var i=s(t);for(var n in e)i.hasOwnProperty(n)||(i[n]=e[n]);return i}},72066:(t,e,i)=>{var s=i(32742);t.exports=function(t,e){var i=s(t);for(var n in e)i.hasOwnProperty(n)&&(i[n]=e[n]);return i}},28820:(t,e,i)=>{var s=i(19256);t.exports=function(t,e){for(var i={},n=0;n{t.exports=function(t,e,i){if(!t||"number"==typeof t)return!1;if(t.hasOwnProperty(e))return t[e]=i,!0;if(-1!==e.indexOf(".")){for(var s=e.split("."),n=t,r=t,a=0;a{t.exports={Clone:i(32742),DeepCopy:i(28699),Extend:i(98611),GetAdvancedValue:i(20494),GetFastValue:i(72632),GetMinMaxValue:i(94324),GetValue:i(10850),HasAll:i(87701),HasAny:i(53523),HasValue:i(19256),IsPlainObject:i(42911),Merge:i(30657),MergeRight:i(72066),Pick:i(28820),SetValue:i(22440)}},69429:t=>{t.exports=function(t,e){return t.replace(/%([0-9]+)/g,(function(t,i){return e[Number(i)-1]}))}},76400:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=0),void 0===i&&(i=" "),void 0===s&&(s=3);var n=0;if(e+1>=(t=t.toString()).length)switch(s){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var r=Math.ceil((n=e-t.length)/2);t=new Array(n-r+1).join(i)+t+new Array(r+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},76872:t=>{t.exports=function(t,e){return 0===e?t.slice(1):t.slice(0,e-1)+t.slice(e)}},8051:t=>{t.exports=function(t){return t.split("").reverse().join("")}},76583:t=>{t.exports=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))}},40587:t=>{t.exports=function(t){return t&&t[0].toUpperCase()+t.slice(1)}},50379:(t,e,i)=>{t.exports={Format:i(69429),Pad:i(76400),RemoveAt:i(76872),Reverse:i(8051),UppercaseFirst:i(40587),UUID:i(76583)}}},e={};function i(s){var n=e[s];if(void 0!==n)return n.exports;var r=e[s]={exports:{}};return t[s](r,r.exports,i),r.exports}return i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i(85780)})())); \ No newline at end of file diff --git a/dist/phaser-ie9.js b/dist/phaser-ie9.js index 6081eaf1c..638929bc4 100644 --- a/dist/phaser-ie9.js +++ b/dist/phaser-ie9.js @@ -7,7 +7,7 @@ exports["Phaser"] = factory(); else root["Phaser"] = factory(); -})(this, function() { +})(this, () => { return /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ @@ -360,7 +360,7 @@ if (true) { /** * @author samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -409,7 +409,7 @@ module.exports = AlignTo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -451,7 +451,7 @@ module.exports = Angle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -491,7 +491,7 @@ module.exports = Call; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -550,7 +550,7 @@ module.exports = GetFirst; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -609,7 +609,7 @@ module.exports = GetLast; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -729,7 +729,7 @@ module.exports = GridAlign; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -771,7 +771,7 @@ module.exports = IncAlpha; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -813,7 +813,7 @@ module.exports = IncX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -861,7 +861,7 @@ module.exports = IncXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -903,7 +903,7 @@ module.exports = IncY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -953,7 +953,7 @@ module.exports = PlaceOnCircle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1006,7 +1006,7 @@ module.exports = PlaceOnEllipse; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1051,7 +1051,7 @@ module.exports = PlaceOnLine; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1110,7 +1110,7 @@ module.exports = PlaceOnRectangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1172,7 +1172,7 @@ module.exports = PlaceOnTriangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1217,7 +1217,7 @@ module.exports = PlayAnimation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1285,7 +1285,7 @@ module.exports = PropertyValueInc; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1353,7 +1353,7 @@ module.exports = PropertyValueSet; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1394,7 +1394,7 @@ module.exports = RandomCircle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1435,7 +1435,7 @@ module.exports = RandomEllipse; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1476,7 +1476,7 @@ module.exports = RandomLine; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1515,7 +1515,7 @@ module.exports = RandomRectangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1556,7 +1556,7 @@ module.exports = RandomTriangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1598,7 +1598,7 @@ module.exports = Rotate; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1645,7 +1645,7 @@ module.exports = RotateAround; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1695,7 +1695,7 @@ module.exports = RotateAroundDistance; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1737,7 +1737,7 @@ module.exports = ScaleX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1785,7 +1785,7 @@ module.exports = ScaleXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1827,7 +1827,7 @@ module.exports = ScaleY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1869,7 +1869,7 @@ module.exports = SetAlpha; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1910,7 +1910,7 @@ module.exports = SetBlendMode; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1952,7 +1952,7 @@ module.exports = SetDepth; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1992,7 +1992,7 @@ module.exports = SetHitArea; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2046,7 +2046,7 @@ module.exports = SetOrigin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2088,7 +2088,7 @@ module.exports = SetRotation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2136,7 +2136,7 @@ module.exports = SetScale; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2178,7 +2178,7 @@ module.exports = SetScaleX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2220,7 +2220,7 @@ module.exports = SetScaleY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2268,7 +2268,7 @@ module.exports = SetScrollFactor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2310,7 +2310,7 @@ module.exports = SetScrollFactorX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2352,7 +2352,7 @@ module.exports = SetScrollFactorY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2392,7 +2392,7 @@ module.exports = SetTint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2431,7 +2431,7 @@ module.exports = SetVisible; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2473,7 +2473,7 @@ module.exports = SetX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2521,7 +2521,7 @@ module.exports = SetXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2563,7 +2563,7 @@ module.exports = SetY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2694,7 +2694,7 @@ module.exports = ShiftPosition; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2728,7 +2728,7 @@ module.exports = Shuffle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2787,7 +2787,7 @@ module.exports = SmoothStep; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2846,7 +2846,7 @@ module.exports = SmootherStep; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2910,7 +2910,7 @@ module.exports = Spread; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2948,7 +2948,7 @@ module.exports = ToggleVisible; /** * @author Richard Davey * @author samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2997,7 +2997,7 @@ module.exports = WrapInRectangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -3071,7 +3071,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -3987,7 +3987,7 @@ module.exports = Animation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -4175,7 +4175,7 @@ module.exports = AnimationFrame; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -4567,10 +4567,11 @@ var AnimationManager = new Class({ * * @param {string} key - The key of the loaded Aseprite atlas. It must have been loaded prior to calling this method. * @param {string[]} [tags] - An array of Tag names. If provided, only animations found in this array will be created. + * @param {(Phaser.Animations.AnimationManager|Phaser.GameObjects.GameObject)} [target] - Create the animations on this target Sprite. If not given, they will be created globally in this Animation Manager. * * @return {Phaser.Animations.Animation[]} An array of Animation instances that were successfully created. */ - createFromAseprite: function (key, tags) + createFromAseprite: function (key, tags, target) { var output = []; @@ -4607,10 +4608,8 @@ var AnimationManager = new Class({ if (!tags || (tags && tags.indexOf(name) > -1)) { - // Get all the frames for this tag - var tempFrames = []; - var minDuration = Number.MAX_SAFE_INTEGER; - + // Get all the frames for this tag and calculate the total duration in milliseconds. + var totalDuration = 0; for (var i = from; i <= to; i++) { var frameKey = i.toString(); @@ -4619,26 +4618,18 @@ var AnimationManager = new Class({ if (frame) { var frameDuration = GetFastValue(frame, 'duration', Number.MAX_SAFE_INTEGER); - - if (frameDuration < minDuration) - { - minDuration = frameDuration; - } - - tempFrames.push({ frame: frameKey, duration: frameDuration }); + animFrames.push({ key: key, frame: frameKey, duration: frameDuration }); + totalDuration += frameDuration; } } - tempFrames.forEach(function (entry) - { - animFrames.push({ - key: key, - frame: entry.frame, - duration: (entry.duration - minDuration) - }); - }); + // Fix duration to play nice with how the next tick is calculated. + var msPerFrame = totalDuration / animFrames.length; - var totalDuration = (minDuration * animFrames.length); + animFrames.forEach(function (entry) + { + entry.duration -= msPerFrame; + }); if (direction === 'reverse') { @@ -4653,7 +4644,19 @@ var AnimationManager = new Class({ yoyo: (direction === 'pingpong') }; - var result = _this.create(createConfig); + var result; + + if (target) + { + if (target.anims) + { + result = target.anims.create(createConfig); + } + } + else + { + result = _this.create(createConfig); + } if (result) { @@ -4765,14 +4768,15 @@ var AnimationManager = new Class({ * Generates objects with string based frame names, as configured by the given {@link Phaser.Types.Animations.GenerateFrameNames}. * * It's a helper method, designed to make it easier for you to extract all of the frame names from texture atlases. + * * If you're working with a sprite sheet, see the `generateFrameNumbers` method instead. * * Example: * * If you have a texture atlases loaded called `gems` and it contains 6 frames called `ruby_0001`, `ruby_0002`, and so on, - * then you can call this method using: `this.anims.generateFrameNames('gems', { prefix: 'ruby_', end: 6, zeroPad: 4 })`. + * then you can call this method using: `this.anims.generateFrameNames('gems', { prefix: 'ruby_', start: 1, end: 6, zeroPad: 4 })`. * - * The `end` value tells it to look for 6 frames, incrementally numbered, all starting with the prefix `ruby_`. The `zeroPad` + * The `end` value tells it to select frames 1 through 6, incrementally numbered, all starting with the prefix `ruby_`. The `zeroPad` * value tells it how many zeroes pad out the numbers. To create an animation using this method, you can do: * * ```javascript @@ -4859,7 +4863,6 @@ var AnimationManager = new Class({ * If you're working with a texture atlas, see the `generateFrameNames` method instead. * * It's a helper method, designed to make it easier for you to extract frames from sprite sheets. - * If you're working with a texture atlas, see the `generateFrameNames` method instead. * * Example: * @@ -5188,7 +5191,7 @@ module.exports = AnimationManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -5660,7 +5663,7 @@ var AnimationState = new Class({ * @method Phaser.Animations.AnimationState#chain * @since 3.16.0 * - * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig|string[]|Phaser.Animations.Animation[]|Phaser.Types.Animations.PlayAnimationConfig[])} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object, or an array of them. + * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig|string[]|Phaser.Animations.Animation[]|Phaser.Types.Animations.PlayAnimationConfig[])} [key] - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object, or an array of them. * * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. */ @@ -6889,6 +6892,93 @@ var AnimationState = new Class({ return anim; }, + /** + * Create one, or more animations from a loaded Aseprite JSON file. + * + * Aseprite is a powerful animated sprite editor and pixel art tool. + * + * You can find more details at https://www.aseprite.org/ + * + * To export a compatible JSON file in Aseprite, please do the following: + * + * 1. Go to "File - Export Sprite Sheet" + * + * 2. On the **Layout** tab: + * 2a. Set the "Sheet type" to "Packed" + * 2b. Set the "Constraints" to "None" + * 2c. Check the "Merge Duplicates" checkbox + * + * 3. On the **Sprite** tab: + * 3a. Set "Layers" to "Visible layers" + * 3b. Set "Frames" to "All frames", unless you only wish to export a sub-set of tags + * + * 4. On the **Borders** tab: + * 4a. Check the "Trim Sprite" and "Trim Cells" options + * 4b. Ensure "Border Padding", "Spacing" and "Inner Padding" are all > 0 (1 is usually enough) + * + * 5. On the **Output** tab: + * 5a. Check "Output File", give your image a name and make sure you choose "png files" as the file type + * 5b. Check "JSON Data" and give your json file a name + * 5c. The JSON Data type can be either a Hash or Array, Phaser doesn't mind. + * 5d. Make sure "Tags" is checked in the Meta options + * 5e. In the "Item Filename" input box, make sure it says just "{frame}" and nothing more. + * + * 6. Click export + * + * This was tested with Aseprite 1.2.25. + * + * This will export a png and json file which you can load using the Aseprite Loader, i.e.: + * + * ```javascript + * function preload () + * { + * this.load.path = 'assets/animations/aseprite/'; + * this.load.aseprite('paladin', 'paladin.png', 'paladin.json'); + * } + * ``` + * + * Once loaded, you can call this method on a Sprite with the 'atlas' key: + * + * ```javascript + * const sprite = this.add.sprite(400, 300); + * + * sprite.anims.createFromAseprite('paladin'); + * ``` + * + * Any animations defined in the JSON will now be available to use on this Sprite and you play them + * via their Tag name. For example, if you have an animation called 'War Cry' on your Aseprite timeline, + * you can play it on the Sprite using that Tag name: + * + * ```javascript + * const sprite = this.add.sprite(400, 300); + * + * sprite.anims.createFromAseprite('paladin'); + * + * sprite.play('War Cry'); + * ``` + * + * When calling this method you can optionally provide an array of tag names, and only those animations + * will be created. For example: + * + * ```javascript + * sprite.anims.createFromAseprite('paladin', [ 'step', 'War Cry', 'Magnum Break' ]); + * ``` + * + * This will only create the 3 animations defined. Note that the tag names are case-sensitive. + * + * @method Phaser.Animations.AnimationState#createFromAseprite + * @since 3.60.0 + * + * @param {string} key - The key of the loaded Aseprite atlas. It must have been loaded prior to calling this method. + * @param {string[]} [tags] - An array of Tag names. If provided, only animations found in this array will be created. + * + * @return {Phaser.Animations.Animation[]} An array of Animation instances that were successfully created. + */ + createFromAseprite: function (key, tags) + { + return this.animationManager.createFromAseprite(key, tags, this.parent); + }, + /** * Generate an array of {@link Phaser.Types.Animations.AnimationFrame} objects from a texture key and configuration object. * @@ -7066,7 +7156,7 @@ module.exports = AnimationState; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7094,7 +7184,7 @@ module.exports = 'add'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7141,7 +7231,7 @@ module.exports = 'animationcomplete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7192,7 +7282,7 @@ module.exports = 'animationcomplete-'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7236,7 +7326,7 @@ module.exports = 'animationrepeat'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7278,7 +7368,7 @@ module.exports = 'animationrestart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7321,7 +7411,7 @@ module.exports = 'animationstart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7364,7 +7454,7 @@ module.exports = 'animationstop'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7411,7 +7501,7 @@ module.exports = 'animationupdate'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7436,7 +7526,7 @@ module.exports = 'pauseall'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7461,7 +7551,7 @@ module.exports = 'remove'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7485,7 +7575,7 @@ module.exports = 'resumeall'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7517,7 +7607,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7543,7 +7633,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7730,7 +7820,7 @@ module.exports = BaseCache; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7965,7 +8055,7 @@ module.exports = CacheManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7991,7 +8081,7 @@ module.exports = 'add'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -8017,7 +8107,7 @@ module.exports = 'remove'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -8040,7 +8130,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -8064,7 +8154,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -10043,7 +10133,7 @@ module.exports = BaseCamera; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -10851,7 +10941,7 @@ module.exports = Camera; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -11469,7 +11559,7 @@ var CameraManager = new Class({ * @since 3.50.0 * * @param {Phaser.GameObjects.GameObject[]} children - An array of Game Objects to be checked against the camera. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera to filte the Game Objects against. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera to filter the Game Objects against. * * @return {Phaser.GameObjects.GameObject[]} A filtered list of only Game Objects within the Scene that will render against the given Camera. */ @@ -11636,7 +11726,7 @@ module.exports = CameraManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -12025,7 +12115,7 @@ module.exports = Fade; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -12388,7 +12478,7 @@ module.exports = Flash; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -13148,7 +13238,7 @@ module.exports = RotateTo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -13468,7 +13558,7 @@ module.exports = Shake; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -13762,7 +13852,7 @@ module.exports = Zoom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -13789,7 +13879,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -13813,7 +13903,7 @@ module.exports = 'cameradestroy'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -13840,7 +13930,7 @@ module.exports = 'camerafadeincomplete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -13871,7 +13961,7 @@ module.exports = 'camerafadeinstart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -13898,7 +13988,7 @@ module.exports = 'camerafadeoutcomplete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -13929,7 +14019,7 @@ module.exports = 'camerafadeoutstart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -13954,7 +14044,7 @@ module.exports = 'cameraflashcomplete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -13983,7 +14073,7 @@ module.exports = 'cameraflashstart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14012,7 +14102,7 @@ module.exports = 'followupdate'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14037,7 +14127,7 @@ module.exports = 'camerapancomplete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14065,7 +14155,7 @@ module.exports = 'camerapanstart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14092,7 +14182,7 @@ module.exports = 'postrender'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14119,7 +14209,7 @@ module.exports = 'prerender'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14144,7 +14234,7 @@ module.exports = 'camerarotatecomplete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14171,7 +14261,7 @@ module.exports = 'camerarotatestart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14196,7 +14286,7 @@ module.exports = 'camerashakecomplete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14223,7 +14313,7 @@ module.exports = 'camerashakestart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14248,7 +14338,7 @@ module.exports = 'camerazoomcomplete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14275,7 +14365,7 @@ module.exports = 'camerazoomstart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14314,7 +14404,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14340,7 +14430,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14672,7 +14762,7 @@ module.exports = FixedKeyControl; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -15180,7 +15270,7 @@ module.exports = SmoothedKeyControl; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -15203,7 +15293,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -15230,7 +15320,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -15250,7 +15340,7 @@ var CONST = { * @type {string} * @since 3.0.0 */ - VERSION: '3.60.0-beta.3', + VERSION: '3.60.0-beta.10', BlendModes: __webpack_require__(95723), @@ -15375,7 +15465,7 @@ module.exports = CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -15421,97 +15511,79 @@ var Config = new Class({ var defaultBannerTextColor = '#ffffff'; + // Scale Manager - Anything set in here over-rides anything set in the core game config + + var scaleConfig = GetValue(config, 'scale', null); + /** * @const {(number|string)} Phaser.Core.Config#width - The width of the underlying canvas, in pixels. */ - this.width = GetValue(config, 'width', 1024); + this.width = GetValue(scaleConfig, 'width', 1024, config); /** * @const {(number|string)} Phaser.Core.Config#height - The height of the underlying canvas, in pixels. */ - this.height = GetValue(config, 'height', 768); + this.height = GetValue(scaleConfig, 'height', 768, config); /** * @const {(Phaser.Scale.ZoomType|number)} Phaser.Core.Config#zoom - The zoom factor, as used by the Scale Manager. */ - this.zoom = GetValue(config, 'zoom', 1); + this.zoom = GetValue(scaleConfig, 'zoom', 1, config); /** * @const {?*} Phaser.Core.Config#parent - A parent DOM element into which the canvas created by the renderer will be injected. */ - this.parent = GetValue(config, 'parent', undefined); + this.parent = GetValue(scaleConfig, 'parent', undefined, config); /** * @const {Phaser.Scale.ScaleModeType} Phaser.Core.Config#scaleMode - The scale mode as used by the Scale Manager. The default is zero, which is no scaling. */ - this.scaleMode = GetValue(config, 'scaleMode', 0); + this.scaleMode = GetValue(scaleConfig, (scaleConfig) ? 'mode' : 'scaleMode', 0, config); /** * @const {boolean} Phaser.Core.Config#expandParent - Is the Scale Manager allowed to adjust the CSS height property of the parent to be 100%? */ - this.expandParent = GetValue(config, 'expandParent', true); + this.expandParent = GetValue(scaleConfig, 'expandParent', true, config); /** * @const {boolean} Phaser.Core.Config#autoRound - Automatically round the display and style sizes of the canvas. This can help with performance in lower-powered devices. */ - this.autoRound = GetValue(config, 'autoRound', false); + this.autoRound = GetValue(scaleConfig, 'autoRound', false, config); /** * @const {Phaser.Scale.CenterType} Phaser.Core.Config#autoCenter - Automatically center the canvas within the parent? */ - this.autoCenter = GetValue(config, 'autoCenter', 0); + this.autoCenter = GetValue(scaleConfig, 'autoCenter', 0, config); /** * @const {number} Phaser.Core.Config#resizeInterval - How many ms should elapse before checking if the browser size has changed? */ - this.resizeInterval = GetValue(config, 'resizeInterval', 500); + this.resizeInterval = GetValue(scaleConfig, 'resizeInterval', 500, config); /** * @const {?(HTMLElement|string)} Phaser.Core.Config#fullscreenTarget - The DOM element that will be sent into full screen mode, or its `id`. If undefined Phaser will create its own div and insert the canvas into it when entering fullscreen mode. */ - this.fullscreenTarget = GetValue(config, 'fullscreenTarget', null); + this.fullscreenTarget = GetValue(scaleConfig, 'fullscreenTarget', null, config); /** * @const {number} Phaser.Core.Config#minWidth - The minimum width, in pixels, the canvas will scale down to. A value of zero means no minimum. */ - this.minWidth = GetValue(config, 'minWidth', 0); + this.minWidth = GetValue(scaleConfig, 'minWidth', 0, config); /** * @const {number} Phaser.Core.Config#maxWidth - The maximum width, in pixels, the canvas will scale up to. A value of zero means no maximum. */ - this.maxWidth = GetValue(config, 'maxWidth', 0); + this.maxWidth = GetValue(scaleConfig, 'maxWidth', 0, config); /** * @const {number} Phaser.Core.Config#minHeight - The minimum height, in pixels, the canvas will scale down to. A value of zero means no minimum. */ - this.minHeight = GetValue(config, 'minHeight', 0); + this.minHeight = GetValue(scaleConfig, 'minHeight', 0, config); /** * @const {number} Phaser.Core.Config#maxHeight - The maximum height, in pixels, the canvas will scale up to. A value of zero means no maximum. */ - this.maxHeight = GetValue(config, 'maxHeight', 0); - - // Scale Manager - Anything set in here over-rides anything set above - - var scaleConfig = GetValue(config, 'scale', null); - - if (scaleConfig) - { - this.width = GetValue(scaleConfig, 'width', this.width); - this.height = GetValue(scaleConfig, 'height', this.height); - this.zoom = GetValue(scaleConfig, 'zoom', this.zoom); - this.parent = GetValue(scaleConfig, 'parent', this.parent); - this.scaleMode = GetValue(scaleConfig, 'mode', this.scaleMode); - this.expandParent = GetValue(scaleConfig, 'expandParent', this.expandParent); - this.autoRound = GetValue(scaleConfig, 'autoRound', this.autoRound); - this.autoCenter = GetValue(scaleConfig, 'autoCenter', this.autoCenter); - this.resizeInterval = GetValue(scaleConfig, 'resizeInterval', this.resizeInterval); - this.fullscreenTarget = GetValue(scaleConfig, 'fullscreenTarget', this.fullscreenTarget); - this.minWidth = GetValue(scaleConfig, 'min.width', this.minWidth); - this.maxWidth = GetValue(scaleConfig, 'max.width', this.maxWidth); - this.minHeight = GetValue(scaleConfig, 'min.height', this.minHeight); - this.maxHeight = GetValue(scaleConfig, 'max.height', this.maxHeight); - } + this.maxHeight = GetValue(scaleConfig, 'maxHeight', 0, config); /** * @const {number} Phaser.Core.Config#renderType - Force Phaser to use a specific renderer. Can be `CONST.CANVAS`, `CONST.WEBGL`, `CONST.HEADLESS` or `CONST.AUTO` (default) @@ -15711,45 +15783,44 @@ var Config = new Class({ */ this.fps = GetValue(config, 'fps', null); - // Renderer Settings - // These can either be in a `render` object within the Config, or specified on their own + // Render Settings - Anything set in here over-rides anything set in the core game config - var renderConfig = GetValue(config, 'render', config); + var renderConfig = GetValue(config, 'render', null); /** * @const {Phaser.Types.Core.PipelineConfig} Phaser.Core.Config#pipeline - An object mapping WebGL names to WebGLPipeline classes. These should be class constructors, not instances. */ - this.pipeline = GetValue(renderConfig, 'pipeline', null); + this.pipeline = GetValue(renderConfig, 'pipeline', null, config); /** * @const {boolean} Phaser.Core.Config#antialias - When set to `true`, WebGL uses linear interpolation to draw scaled or rotated textures, giving a smooth appearance. When set to `false`, WebGL uses nearest-neighbor interpolation, giving a crisper appearance. `false` also disables antialiasing of the game canvas itself, if the browser supports it, when the game canvas is scaled. */ - this.antialias = GetValue(renderConfig, 'antialias', true); + this.antialias = GetValue(renderConfig, 'antialias', true, config); /** * @const {boolean} Phaser.Core.Config#antialiasGL - Sets the `antialias` property when the WebGL context is created. Setting this value does not impact any subsequent textures that are created, or the canvas style attributes. */ - this.antialiasGL = GetValue(renderConfig, 'antialiasGL', true); + this.antialiasGL = GetValue(renderConfig, 'antialiasGL', true, config); /** * @const {string} Phaser.Core.Config#mipmapFilter - Sets the `mipmapFilter` property when the WebGL renderer is created. */ - this.mipmapFilter = GetValue(renderConfig, 'mipmapFilter', 'LINEAR'); + this.mipmapFilter = GetValue(renderConfig, 'mipmapFilter', 'LINEAR', config); /** * @const {boolean} Phaser.Core.Config#desynchronized - When set to `true` it will create a desynchronized context for both 2D and WebGL. See https://developers.google.com/web/updates/2019/05/desynchronized for details. */ - this.desynchronized = GetValue(renderConfig, 'desynchronized', false); + this.desynchronized = GetValue(renderConfig, 'desynchronized', false, config); /** * @const {boolean} Phaser.Core.Config#roundPixels - Draw texture-based Game Objects at only whole-integer positions. Game Objects without textures, like Graphics, ignore this property. */ - this.roundPixels = GetValue(renderConfig, 'roundPixels', false); + this.roundPixels = GetValue(renderConfig, 'roundPixels', false, config); /** * @const {boolean} Phaser.Core.Config#pixelArt - Prevent pixel art from becoming blurred when scaled. It will remain crisp (tells the WebGL renderer to automatically create textures using a linear filter mode). */ - this.pixelArt = GetValue(renderConfig, 'pixelArt', this.zoom !== 1); + this.pixelArt = GetValue(renderConfig, 'pixelArt', this.zoom !== 1, config); if (this.pixelArt) { @@ -15761,47 +15832,47 @@ var Config = new Class({ /** * @const {boolean} Phaser.Core.Config#transparent - Whether the game canvas will have a transparent background. */ - this.transparent = GetValue(renderConfig, 'transparent', false); + this.transparent = GetValue(renderConfig, 'transparent', false, config); /** * @const {boolean} Phaser.Core.Config#clearBeforeRender - Whether the game canvas will be cleared between each rendering frame. You can disable this if you have a full-screen background image or game object. */ - this.clearBeforeRender = GetValue(renderConfig, 'clearBeforeRender', true); + this.clearBeforeRender = GetValue(renderConfig, 'clearBeforeRender', true, config); /** * @const {boolean} Phaser.Core.Config#preserveDrawingBuffer - If the value is true the WebGL buffers will not be cleared and will preserve their values until cleared or overwritten by the author. */ - this.preserveDrawingBuffer = GetValue(renderConfig, 'preserveDrawingBuffer', false); + this.preserveDrawingBuffer = GetValue(renderConfig, 'preserveDrawingBuffer', false, config); /** * @const {boolean} Phaser.Core.Config#premultipliedAlpha - In WebGL mode, sets the drawing buffer to contain colors with pre-multiplied alpha. */ - this.premultipliedAlpha = GetValue(renderConfig, 'premultipliedAlpha', true); + this.premultipliedAlpha = GetValue(renderConfig, 'premultipliedAlpha', true, config); /** * @const {boolean} Phaser.Core.Config#failIfMajorPerformanceCaveat - Let the browser abort creating a WebGL context if it judges performance would be unacceptable. */ - this.failIfMajorPerformanceCaveat = GetValue(renderConfig, 'failIfMajorPerformanceCaveat', false); + this.failIfMajorPerformanceCaveat = GetValue(renderConfig, 'failIfMajorPerformanceCaveat', false, config); /** * @const {string} Phaser.Core.Config#powerPreference - "high-performance", "low-power" or "default". A hint to the browser on how much device power the game might use. */ - this.powerPreference = GetValue(renderConfig, 'powerPreference', 'default'); + this.powerPreference = GetValue(renderConfig, 'powerPreference', 'default', config); /** * @const {number} Phaser.Core.Config#batchSize - The default WebGL Batch size. Represents the number of _quads_ that can be added to a single batch. */ - this.batchSize = GetValue(renderConfig, 'batchSize', 4096); + this.batchSize = GetValue(renderConfig, 'batchSize', 4096, config); /** * @const {number} Phaser.Core.Config#maxTextures - When in WebGL mode, this sets the maximum number of GPU Textures to use. The default, -1, will use all available units. The WebGL1 spec says all browsers should provide a minimum of 8. */ - this.maxTextures = GetValue(renderConfig, 'maxTextures', -1); + this.maxTextures = GetValue(renderConfig, 'maxTextures', -1, config); /** * @const {number} Phaser.Core.Config#maxLights - The maximum number of lights allowed to be visible within range of a single Camera in the LightManager. */ - this.maxLights = GetValue(renderConfig, 'maxLights', 10); + this.maxLights = GetValue(renderConfig, 'maxLights', 10, config); var bgc = GetValue(config, 'backgroundColor', 0); @@ -15849,9 +15920,7 @@ var Config = new Class({ /** * @const {number} Phaser.Core.Config#loaderMaxParallelDownloads - Maximum parallel downloads allowed for resources (Default to 32). */ - var defaultParallel = (Device.os.android) ? 6 : 32; - - this.loaderMaxParallelDownloads = GetValue(config, 'loader.maxParallelDownloads', defaultParallel); + this.loaderMaxParallelDownloads = GetValue(config, 'loader.maxParallelDownloads', (Device.os.android) ? 6 : 32); /** * @const {(string|undefined)} Phaser.Core.Config#loaderCrossOrigin - 'anonymous', 'use-credentials', or `undefined`. If you're not making cross-origin requests, leave this as `undefined`. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes}. @@ -15893,6 +15962,14 @@ var Config = new Class({ */ this.loaderImageLoadType = GetValue(config, 'loader.imageLoadType', 'XHR'); + // On iOS, Capacitor often runs on a capacitor:// protocol, meaning local files are served from capacitor:// rather than file:// + // See: https://github.com/photonstorm/phaser/issues/5685 + + /** + * @const {string[]} Phaser.Core.Config#loaderLocalScheme - An array of schemes that the Loader considers as being 'local' files. Defaults to: `[ 'file://', 'capacitor://' ]`. + */ + this.loaderLocalScheme = GetValue(config, 'loader.localScheme', [ 'file://', 'capacitor://' ]); + /* * Allows `plugins` property to either be an array, in which case it just replaces * the default plugins like previously, or a config object. @@ -15995,7 +16072,7 @@ module.exports = Config; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -16124,7 +16201,7 @@ module.exports = CreateRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -16255,7 +16332,7 @@ module.exports = DebugHeader; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -16802,6 +16879,22 @@ var Game = new Class({ this.events.emit(Events.PAUSE); }, + /** + * This will pause the entire game and emit a `PAUSE` event. + * + * All of Phaser's internal systems will be paused and the game will not re-render. + * + * Note that it does not pause any Loader requests that are currently in-flight. + * + * @method Phaser.Game#pause + * @fires Phaser.Core.Events#PAUSE + * @since 3.60.0 + */ + pause: function () + { + this.onHidden(); + }, + /** * Called automatically by the Visibility Handler. * This will resume the main loop and then emit a resume event. @@ -16818,6 +16911,20 @@ var Game = new Class({ this.events.emit(Events.RESUME); }, + /** + * This will resume the entire game and emit a `RESUME` event. + * + * All of Phaser's internal systems will be resumed and the game will start rendering again. + * + * @method Phaser.Game#resume + * @fires Phaser.Core.Events#RESUME + * @since 3.60.0 + */ + resume: function () + { + this.onVisible(); + }, + /** * Called automatically by the Visibility Handler. * This will set the main loop into a 'blurred' state, which pauses it. @@ -16959,7 +17066,7 @@ module.exports = Game; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -16974,11 +17081,11 @@ var RequestAnimationFrame = __webpack_require__(27385); * @classdesc * The core runner class that Phaser uses to handle the game loop. It can use either Request Animation Frame, * or SetTimeout, based on browser support and config settings, to create a continuous loop within the browser. - * + * * Each time the loop fires, `TimeStep.step` is called and this is then passed onto the core Game update loop, * it is the core heartbeat of your game. It will fire as often as Request Animation Frame is capable of handling * on the target device. - * + * * Note that there are lots of situations where a browser will stop updating your game. Such as if the player * switches tabs, or covers up the browser window with another application. In these cases, the 'heartbeat' * of your game will pause, and only resume when focus is returned to it by the player. There is no way to avoid @@ -17047,6 +17154,9 @@ var TimeStep = new Class({ /** * The minimum fps rate you want the Time Step to run at. * + * Setting this cannot guarantee the browser runs at this rate, it merely influences + * the internal timing values to help the Timestep know when it has gone out of sync. + * * @name Phaser.Core.TimeStep#minFps * @type {number} * @default 5 @@ -17069,7 +17179,57 @@ var TimeStep = new Class({ this.targetFps = GetValue(config, 'target', 60); /** - * The minFps value in ms. + * Enforce a frame rate limit. This forces how often the Game step will run. By default it is zero, + * which means it will run at whatever limit the browser (via RequestAnimationFrame) can handle, which + * is the optimum rate for fast-action or responsive games. + * + * However, if you are building a non-game app, like a graphics generator, or low-intensity game that doesn't + * require 60fps, then you can lower the step rate via this Game Config value: + * + * ```js + * fps: { + * limit: 30 + * } + * ``` + * + * Setting this _beyond_ the rate of RequestAnimationFrame will make no difference at all. + * + * Use it purely to _restrict_ updates in low-intensity situations only. + * + * @name Phaser.Core.TimeStep#fpsLimit + * @type {number} + * @default 0 + * @since 3.60.0 + */ + this.fpsLimit = GetValue(config, 'limit', 0); + + /** + * Is the FPS rate limited? + * + * This is set by setting the Game Config `limit` value to a value above zero. + * + * Consider this property as read-only. + * + * @name Phaser.Core.TimeStep#hasFpsLimit + * @type {boolean} + * @default false + * @since 3.60.0 + */ + this.hasFpsLimit = (this.fpsLimit > 0); + + /** + * Internal value holding the fps rate limit in ms. + * + * @name Phaser.Core.TimeStep#_limitRate + * @type {number} + * @private + * @since 3.60.0 + */ + this._limitRate = (this.hasFpsLimit) ? (1000 / this.fpsLimit) : 0; + + /** + * The minimum fps value in ms. + * * Defaults to 200ms between frames (i.e. super slow!) * * @name Phaser.Core.TimeStep#_min @@ -17080,7 +17240,8 @@ var TimeStep = new Class({ this._min = 1000 / this.minFps; /** - * The targetFps value in ms. + * The target fps value in ms. + * * Defaults to 16.66ms between frames (i.e. normal) * * @name Phaser.Core.TimeStep#_target @@ -17103,6 +17264,7 @@ var TimeStep = new Class({ /** * The time at which the next fps rate update will take place. + * * When an fps update happens, the `framesThisSecond` value is reset. * * @name Phaser.Core.TimeStep#nextFpsUpdate @@ -17125,7 +17287,7 @@ var TimeStep = new Class({ this.framesThisSecond = 0; /** - * A callback to be invoked each time the Time Step steps. + * A callback to be invoked each time the TimeStep steps. * * @name Phaser.Core.TimeStep#callback * @type {Phaser.Types.Core.TimeStepCallback} @@ -17135,7 +17297,7 @@ var TimeStep = new Class({ this.callback = NOOP; /** - * You can force the Time Step to use Set Timeout instead of Request Animation Frame by setting + * You can force the TimeStep to use SetTimeOut instead of Request Animation Frame by setting * the `forceSetTimeOut` property to `true` in the Game Configuration object. It cannot be changed at run-time. * * @name Phaser.Core.TimeStep#forceSetTimeOut @@ -17147,7 +17309,10 @@ var TimeStep = new Class({ this.forceSetTimeOut = GetValue(config, 'forceSetTimeOut', false); /** - * The time, calculated at the start of the current step, as smoothed by the delta value. + * The time, updated each step by adding the elapsed delta time to the previous value. + * + * This differs from the `TimeStep.now` value, which is the high resolution time value + * as provided by Request Animation Frame. * * @name Phaser.Core.TimeStep#time * @type {number} @@ -17157,8 +17322,9 @@ var TimeStep = new Class({ this.time = 0; /** - * The time at which the game started running. This value is adjusted if the game is then - * paused and resumes. + * The time at which the game started running. + * + * This value is adjusted if the game is then paused and resumes. * * @name Phaser.Core.TimeStep#startTime * @type {number} @@ -17168,7 +17334,9 @@ var TimeStep = new Class({ this.startTime = 0; /** - * The time, as returned by `performance.now` of the previous step. + * The time of the previous step. + * + * This is typically a high resolution timer value, as provided by Request Animation Frame. * * @name Phaser.Core.TimeStep#lastTime * @type {number} @@ -17191,6 +17359,7 @@ var TimeStep = new Class({ /** * Is the browser currently considered in focus by the Page Visibility API? + * * This value is set in the `blur` method, which is called automatically by the Game instance. * * @name Phaser.Core.TimeStep#inFocus @@ -17254,7 +17423,7 @@ var TimeStep = new Class({ /** * The maximum number of delta values that are retained in order to calculate a smoothed moving average. - * + * * This can be changed in the Game Config via the `fps.deltaHistory` property. The default is 10. * * @name Phaser.Core.TimeStep#deltaSmoothingMax @@ -17267,7 +17436,7 @@ var TimeStep = new Class({ /** * The number of frames that the cooldown is set to after the browser panics over the FPS rate, usually * as a result of switching tabs and regaining focus. - * + * * This can be changed in the Game Config via the `fps.panicMax` property. The default is 120. * * @name Phaser.Core.TimeStep#panicMax @@ -17279,7 +17448,7 @@ var TimeStep = new Class({ /** * The actual elapsed time in ms between one update and the next. - * + * * Unlike with `delta`, no smoothing, capping, or averaging is applied to this value. * So please be careful when using this value in math calculations. * @@ -17291,7 +17460,10 @@ var TimeStep = new Class({ this.rawDelta = 0; /** - * The time, as returned by `performance.now` at the very start of the current step. + * The time, set at the start of the current step. + * + * This is typically a high resolution timer value, as provided by Request Animation Frame. + * * This can differ from the `time` value in that it isn't calculated based on the delta value. * * @name Phaser.Core.TimeStep#now @@ -17303,9 +17475,9 @@ var TimeStep = new Class({ /** * Apply smoothing to the delta value used within Phasers internal calculations? - * + * * This can be changed in the Game Config via the `fps.smoothStep` property. The default is `true`. - * + * * Smoothing helps settle down the delta values after browser tab switches, or other situations * which could cause significant delta spikes or dips. By default it has been enabled in Phaser 3 * since the first version, but is now exposed under this property (and the corresponding game config @@ -17425,7 +17597,159 @@ var TimeStep = new Class({ this.callback = callback; - this.raf.start(this.step.bind(this), this.forceSetTimeOut, this._target); + var step = (this.hasFpsLimit) ? this.stepLimitFPS.bind(this) : this.step.bind(this); + + this.raf.start(step, this.forceSetTimeOut, this._target); + }, + + /** + * Takes the delta value and smooths it based on the previous frames. + * + * Called automatically as part of the step. + * + * @method Phaser.Core.TimeStep#smoothDelta + * @since 3.60.0 + * + * @param {number} delta - The delta value for this step. + * + * @return {number} The smoothed delta value. + */ + smoothDelta: function (delta) + { + var idx = this.deltaIndex; + var history = this.deltaHistory; + var max = this.deltaSmoothingMax; + + if (this._coolDown > 0 || !this.inFocus) + { + this._coolDown--; + + delta = Math.min(delta, this._target); + } + + if (delta > this._min) + { + // Probably super bad start time or browser tab context loss, + // so use the last 'sane' delta value + + delta = history[idx]; + + // Clamp delta to min (in case history has become corrupted somehow) + delta = Math.min(delta, this._min); + } + + // Smooth out the delta over the previous X frames + + // add the delta to the smoothing array + history[idx] = delta; + + // adjusts the delta history array index based on the smoothing count + // this stops the array growing beyond the size of deltaSmoothingMax + this.deltaIndex++; + + if (this.deltaIndex >= max) + { + this.deltaIndex = 0; + } + + // Loop the history array, adding the delta values together + var avg = 0; + + for (var i = 0; i < max; i++) + { + avg += history[i]; + } + + // Then divide by the array length to get the average delta + avg /= max; + + return avg; + }, + + /** + * Update the estimate of the frame rate, `fps`. Every second, the number + * of frames that occurred in that second are included in an exponential + * moving average of all frames per second, with an alpha of 0.25. This + * means that more recent seconds affect the estimated frame rate more than + * older seconds. + * + * When a browser window is NOT minimized, but is covered up (i.e. you're using + * another app which has spawned a window over the top of the browser), then it + * will start to throttle the raf callback time. It waits for a while, and then + * starts to drop the frame rate at 1 frame per second until it's down to just over 1fps. + * So if the game was running at 60fps, and the player opens a new window, then + * after 60 seconds (+ the 'buffer time') it'll be down to 1fps, so rafin'g at 1Hz. + * + * When they make the game visible again, the frame rate is increased at a rate of + * approx. 8fps, back up to 60fps (or the max it can obtain) + * + * There is no easy way to determine if this drop in frame rate is because the + * browser is throttling raf, or because the game is struggling with performance + * because you're asking it to do too much on the device. + * + * Compute the new exponential moving average with an alpha of 0.25. + * + * @method Phaser.Core.TimeStep#updateFPS + * @since 3.60.0 + * + * @param {number} time - The timestamp passed in from RequestAnimationFrame or setTimeout. + */ + updateFPS: function (time) + { + this.actualFps = 0.25 * this.framesThisSecond + 0.75 * this.actualFps; + this.nextFpsUpdate = time + 1000; + this.framesThisSecond = 0; + }, + + /** + * The main step method with an fps limiter. This is called each time the browser updates, either by Request Animation Frame, + * or by Set Timeout. It is responsible for calculating the delta values, frame totals, cool down history and more. + * You generally should never call this method directly. + * + * @method Phaser.Core.TimeStep#stepLimitFPS + * @since 3.60.0 + * + * @param {number} time - The timestamp passed in from RequestAnimationFrame or setTimeout. + */ + stepLimitFPS: function (time) + { + this.now = time; + + // delta time (time is in ms) + // Math.max because Chrome will sometimes give negative deltas + var delta = Math.max(0, time - this.lastTime); + + this.rawDelta = delta; + + // Real-world timer advance + this.time += this.rawDelta; + + if (this.smoothStep) + { + delta = this.smoothDelta(delta); + } + + // Set as the world delta value (after smoothing, if applied) + this.delta += delta; + + if (time >= this.nextFpsUpdate) + { + this.updateFPS(time); + } + + this.framesThisSecond++; + + if (this.delta >= this._limitRate) + { + this.callback(time, this.delta); + + this.delta = 0; + } + + // Shift time value over + this.lastTime = time; + + this.frame++; }, /** @@ -17435,127 +17759,38 @@ var TimeStep = new Class({ * * @method Phaser.Core.TimeStep#step * @since 3.0.0 + * + * @param {number} time - The timestamp passed in from RequestAnimationFrame or setTimeout. */ - step: function () + step: function (time) { - // Because the timestamp passed in from raf represents the beginning of the main thread frame that we’re currently in, - // not the actual time now, and as we want to compare this time value against Event timeStamps and the like, we need a - // more accurate one: - - var time = window.performance.now(); - this.now = time; - var before = time - this.lastTime; - - if (before < 0) - { - // Because, Chrome. - before = 0; - } - - this.rawDelta = before; - - var idx = this.deltaIndex; - var history = this.deltaHistory; - var max = this.deltaSmoothingMax; - // delta time (time is in ms) - var dt = before; + // Math.max because Chrome will sometimes give negative deltas + var delta = Math.max(0, time - this.lastTime); - // Delta Average - var avg = before; - - // When a browser switches tab, then comes back again, it takes around 10 frames before - // the delta time settles down so we employ a 'cooling down' period before we start - // trusting the delta values again, to avoid spikes flooding through our delta average - - if (this.smoothStep) - { - if (this._coolDown > 0 || !this.inFocus) - { - this._coolDown--; - - dt = Math.min(dt, this._target); - } - - if (dt > this._min) - { - // Probably super bad start time or browser tab context loss, - // so use the last 'sane' dt value - - dt = history[idx]; - - // Clamp delta to min (in case history has become corrupted somehow) - dt = Math.min(dt, this._min); - } - - // Smooth out the delta over the previous X frames - - // add the delta to the smoothing array - history[idx] = dt; - - // adjusts the delta history array index based on the smoothing count - // this stops the array growing beyond the size of deltaSmoothingMax - this.deltaIndex++; - - if (this.deltaIndex > max) - { - this.deltaIndex = 0; - } - - // Loop the history array, adding the delta values together - avg = 0; - - for (var i = 0; i < max; i++) - { - avg += history[i]; - } - - // Then divide by the array length to get the average delta - avg /= max; - } - - // Set as the world delta value - this.delta = avg; + this.rawDelta = delta; // Real-world timer advance this.time += this.rawDelta; - // Update the estimate of the frame rate, `fps`. Every second, the number - // of frames that occurred in that second are included in an exponential - // moving average of all frames per second, with an alpha of 0.25. This - // means that more recent seconds affect the estimated frame rate more than - // older seconds. - // - // When a browser window is NOT minimized, but is covered up (i.e. you're using - // another app which has spawned a window over the top of the browser), then it - // will start to throttle the raf callback time. It waits for a while, and then - // starts to drop the frame rate at 1 frame per second until it's down to just over 1fps. - // So if the game was running at 60fps, and the player opens a new window, then - // after 60 seconds (+ the 'buffer time') it'll be down to 1fps, so rafin'g at 1Hz. - // - // When they make the game visible again, the frame rate is increased at a rate of - // approx. 8fps, back up to 60fps (or the max it can obtain) - // - // There is no easy way to determine if this drop in frame rate is because the - // browser is throttling raf, or because the game is struggling with performance - // because you're asking it to do too much on the device. - - if (time > this.nextFpsUpdate) + if (this.smoothStep) { - // Compute the new exponential moving average with an alpha of 0.25. - this.actualFps = 0.25 * this.framesThisSecond + 0.75 * this.actualFps; - this.nextFpsUpdate = time + 1000; - this.framesThisSecond = 0; + delta = this.smoothDelta(delta); + } + + // Set as the world delta value (after smoothing, if applied) + this.delta = delta; + + if (time >= this.nextFpsUpdate) + { + this.updateFPS(time); } this.framesThisSecond++; - // Interpolation - how far between what is expected and where we are? - var interpolation = avg / this._target; - - this.callback(time, avg, interpolation); + this.callback(time, delta); // Shift time value over this.lastTime = time; @@ -17571,7 +17806,16 @@ var TimeStep = new Class({ */ tick: function () { - this.step(); + var now = window.performance.now(); + + if (this.hasFpsLimit) + { + this.stepLimitFPS(now); + } + else + { + this.step(now); + } }, /** @@ -17601,20 +17845,30 @@ var TimeStep = new Class({ */ wake: function (seamless) { + if (seamless === undefined) { seamless = false; } + + var now = window.performance.now(); + if (this.running) { return; } else if (seamless) { - this.startTime += -this.lastTime + (this.lastTime + window.performance.now()); + this.startTime += -this.lastTime + (this.lastTime + now); } - this.raf.start(this.step.bind(this), this.useRAF); + var step = (this.hasFpsLimit) ? this.stepLimitFPS.bind(this) : this.step.bind(this); + + this.raf.start(step, this.forceSetTimeOut, this._target); this.running = true; - this.step(); + this.nextFpsUpdate = now + 1000; + this.framesThisSecond = 0; + this.fpsLimitTriggered = false; + + this.tick(); }, /** @@ -17672,10 +17926,11 @@ var TimeStep = new Class({ { this.stop(); - this.callback = NOOP; + this.raf.destroy(); this.raf = null; this.game = null; + this.callback = null; } }); @@ -17690,7 +17945,7 @@ module.exports = TimeStep; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -17782,7 +18037,7 @@ module.exports = VisibilityHandler; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -17806,7 +18061,7 @@ module.exports = 'blur'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -17829,7 +18084,7 @@ module.exports = 'boot'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -17853,7 +18108,7 @@ module.exports = 'contextlost'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -17877,7 +18132,7 @@ module.exports = 'contextrestored'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -17901,7 +18156,7 @@ module.exports = 'destroy'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -17924,7 +18179,7 @@ module.exports = 'focus'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -17951,13 +18206,13 @@ module.exports = 'hidden'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Pause Event. - * + * * This event is dispatched when the Game loop enters a paused state, usually as a result of the Visibility Handler. * * @event Phaser.Core.Events#PAUSE @@ -17973,7 +18228,7 @@ module.exports = 'pause'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18000,7 +18255,7 @@ module.exports = 'postrender'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18026,7 +18281,7 @@ module.exports = 'poststep'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18052,7 +18307,7 @@ module.exports = 'prerender'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18078,13 +18333,13 @@ module.exports = 'prestep'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Ready Event. - * + * * This event is dispatched when the Phaser Game instance has finished booting, the Texture Manager is fully ready, * and all local systems are now able to start. * @@ -18101,13 +18356,13 @@ module.exports = 'ready'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Resume Event. - * + * * This event is dispatched when the game loop leaves a paused state and resumes running. * * @event Phaser.Core.Events#RESUME @@ -18123,7 +18378,7 @@ module.exports = 'resume'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18149,7 +18404,7 @@ module.exports = 'step'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18174,7 +18429,7 @@ module.exports = 'visible'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18211,7 +18466,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18238,7 +18493,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18361,7 +18616,7 @@ module.exports = GenerateTexture; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18370,7 +18625,7 @@ module.exports = GenerateTexture; */ module.exports = { - + GenerateTexture: __webpack_require__(52780), Palettes: __webpack_require__(25235) @@ -18384,7 +18639,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18423,7 +18678,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18462,7 +18717,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18501,7 +18756,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18540,7 +18795,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18579,7 +18834,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18605,7 +18860,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18833,7 +19088,7 @@ module.exports = CubicBezierCurve; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -19451,7 +19706,7 @@ module.exports = Curve; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -20076,7 +20331,7 @@ module.exports = EllipseCurve; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -20383,7 +20638,7 @@ module.exports = LineCurve; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -20414,7 +20669,7 @@ var QuadraticBezier = new Class({ function QuadraticBezier (p0, p1, p2) { - Curve.call(this, 'QuadraticBezier'); + Curve.call(this, 'QuadraticBezierCurve'); if (Array.isArray(p0)) { @@ -20601,7 +20856,7 @@ module.exports = QuadraticBezier; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -20827,7 +21082,7 @@ module.exports = SplineCurve; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -20855,7 +21110,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -20995,7 +21250,7 @@ module.exports = MoveTo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -21464,6 +21719,35 @@ var Path = new Class({ return lengths; }, + /** + * Returns the Curve that forms the Path at the given normalized location (between 0 and 1). + * + * @method Phaser.Curves.Path#getCurveAt + * @since 3.60.0 + * + * @param {number} t - The normalized location on the Path, between 0 and 1. + * + * @return {?Phaser.Curves.Curve} The Curve that is part of this Path at a given location, or `null` if no curve was found. + */ + getCurveAt: function (t) + { + var d = t * this.getLength(); + var curveLengths = this.getCurveLengths(); + var i = 0; + + while (i < curveLengths.length) + { + if (curveLengths[i] >= d) + { + return this.curves[i]; + } + + i++; + } + + return null; + }, + /** * Returns the ending point of the Path. * @@ -21885,7 +22169,7 @@ module.exports = Path; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -22593,7 +22877,7 @@ module.exports = DataManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -22721,7 +23005,7 @@ module.exports = DataManagerPlugin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -22754,7 +23038,7 @@ module.exports = 'changedata'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -22785,7 +23069,7 @@ module.exports = 'changedata-'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -22807,7 +23091,7 @@ module.exports = 'destroy'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -22836,7 +23120,7 @@ module.exports = 'removedata'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -22865,7 +23149,7 @@ module.exports = 'setdata'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -22891,7 +23175,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -22915,7 +23199,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -22933,6 +23217,8 @@ var Browser = __webpack_require__(1350); * @property {boolean} audioData - Can this device play HTML Audio tags? * @property {boolean} dolby - Can this device play EC-3 Dolby Digital Plus files? * @property {boolean} m4a - Can this device can play m4a files. + * @property {boolean} aac - Can this device can play aac files. + * @property {boolean} flac - Can this device can play flac files. * @property {boolean} mp3 - Can this device play mp3 files? * @property {boolean} ogg - Can this device play ogg files? * @property {boolean} opus - Can this device play opus files? @@ -22942,6 +23228,8 @@ var Browser = __webpack_require__(1350); */ var Audio = { + flac: false, + aac: false, audioData: false, dolby: false, m4a: false, @@ -22966,46 +23254,39 @@ function init () Audio.webAudio = !!(window['AudioContext'] || window['webkitAudioContext']); var audioElement = document.createElement('audio'); - var result = !!audioElement.canPlayType; try { if (result) { - if (audioElement.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, '')) + var CanPlay = function (type1, type2) { - Audio.ogg = true; - } + var canPlayType1 = audioElement.canPlayType('audio/' + type1).replace(/^no$/, ''); - if (audioElement.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/, '') || audioElement.canPlayType('audio/opus;').replace(/^no$/, '')) - { - Audio.opus = true; - } + if (type2) + { + return Boolean(canPlayType1 || audioElement.canPlayType('audio/' + type2).replace(/^no$/, '')); + } + else + { + return Boolean(canPlayType1); + } + }; - if (audioElement.canPlayType('audio/mpeg;').replace(/^no$/, '')) - { - Audio.mp3 = true; - } - - // Mimetypes accepted: + // wav Mimetypes accepted: // developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements - if (audioElement.canPlayType('audio/wav').replace(/^no$/, '')) - { - Audio.wav = true; - } - if (audioElement.canPlayType('audio/x-m4a;') || audioElement.canPlayType('audio/aac;').replace(/^no$/, '')) - { - Audio.m4a = true; - } + Audio.ogg = CanPlay('ogg; codecs="vorbis"'); + Audio.opus = CanPlay('ogg; codecs="opus"', 'opus'); + Audio.mp3 = CanPlay('mpeg'); + Audio.wav = CanPlay('wav'); + Audio.m4a = CanPlay('x-m4a'); + Audio.aac = CanPlay('aac'); + Audio.flac = CanPlay('flac', 'x-flac'); + Audio.webm = CanPlay('webm; codecs="vorbis"'); - if (audioElement.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/, '')) - { - Audio.webm = true; - } - - if (audioElement.canPlayType('audio/mp4;codecs="ec-3"') !== '') + if (audioElement.canPlayType('audio/mp4; codecs="ec-3"') !== '') { if (Browser.edge) { @@ -23045,7 +23326,7 @@ module.exports = init(); /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -23156,7 +23437,7 @@ module.exports = init(); /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -23194,8 +23475,8 @@ function checkBlendMode () yellow.onload = function () { - var canvas = CanvasPool.create(yellow, 6, 1); - var context = canvas.getContext('2d'); + var canvas = CanvasPool.create2D(yellow, 6); + var context = canvas.getContext('2d', { willReadFrequently: true }); context.globalCompositeOperation = 'multiply'; @@ -23224,8 +23505,8 @@ function checkBlendMode () function checkInverseAlpha () { - var canvas = CanvasPool.create(this, 2, 1); - var context = canvas.getContext('2d'); + var canvas = CanvasPool.create2D(this, 2); + var context = canvas.getContext('2d', { willReadFrequently: true }); context.fillStyle = 'rgba(10, 20, 30, 0.5)'; @@ -23246,8 +23527,12 @@ function checkInverseAlpha () // Get those values var s2 = context.getImageData(1, 0, 1, 1); + var result = (s2.data[0] === s1.data[0] && s2.data[1] === s1.data[1] && s2.data[2] === s1.data[2] && s2.data[3] === s1.data[3]); + + CanvasPool.remove(this); + // Compare and return - return (s2.data[0] === s1.data[0] && s2.data[1] === s1.data[1] && s2.data[2] === s1.data[2] && s2.data[3] === s1.data[3]); + return result; } function init () @@ -23271,7 +23556,7 @@ module.exports = init(); /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -23469,7 +23754,7 @@ module.exports = init(); /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -23579,7 +23864,7 @@ module.exports = init(); /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -23660,7 +23945,7 @@ module.exports = init(); /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -23853,7 +24138,7 @@ module.exports = init(); /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -23871,6 +24156,7 @@ module.exports = init(); * @property {boolean} h264 - Can this device play h264 mp4 video files? * @property {boolean} hls - Can this device play hls video files? * @property {boolean} mp4 - Can this device play h264 mp4 video files? + * @property {boolean} m4v - Can this device play m4v (typically mp4) video files? * @property {boolean} ogg - Can this device play ogg video files? * @property {boolean} vp9 - Can this device play vp9 video files? * @property {boolean} webm - Can this device play webm video files? @@ -23880,6 +24166,7 @@ var Video = { h264: false, hls: false, mp4: false, + m4v: false, ogg: false, vp9: false, webm: false @@ -23895,34 +24182,40 @@ function init () var videoElement = document.createElement('video'); var result = !!videoElement.canPlayType; + var no = /^no$/; try { if (result) { - if (videoElement.canPlayType('video/ogg; codecs="theora"').replace(/^no$/, '')) + if (videoElement.canPlayType('video/ogg; codecs="theora"').replace(no, '')) { Video.ogg = true; } - if (videoElement.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/, '')) + if (videoElement.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(no, '')) { // Without QuickTime, this value will be `undefined`. github.com/Modernizr/Modernizr/issues/546 Video.h264 = true; Video.mp4 = true; } - if (videoElement.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/, '')) + if (videoElement.canPlayType('video/x-m4v').replace(no, '')) + { + Video.m4v = true; + } + + if (videoElement.canPlayType('video/webm; codecs="vp8, vorbis"').replace(no, '')) { Video.webm = true; } - if (videoElement.canPlayType('video/webm; codecs="vp9"').replace(/^no$/, '')) + if (videoElement.canPlayType('video/webm; codecs="vp9"').replace(no, '')) { Video.vp9 = true; } - if (videoElement.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/, '')) + if (videoElement.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(no, '')) { Video.hls = true; } @@ -23946,7 +24239,7 @@ module.exports = init(); /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -23994,7 +24287,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -24645,7 +24938,7 @@ module.exports = ColorMatrix; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -24748,7 +25041,7 @@ var RGB = new Class({ { var rgb = this._rgb; - return (rgb.r === red && rgb.g === green && rgb.b === blue); + return (rgb[0] === red && rgb[1] === green && rgb[2] === blue); }, /** @@ -24866,7 +25159,7 @@ module.exports = RGB; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25001,7 +25294,7 @@ module.exports = ALIGN_CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25046,7 +25339,7 @@ module.exports = BottomCenter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25091,7 +25384,7 @@ module.exports = BottomLeft; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25136,7 +25429,7 @@ module.exports = BottomRight; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25179,7 +25472,7 @@ module.exports = Center; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25224,7 +25517,7 @@ module.exports = LeftCenter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25278,7 +25571,7 @@ module.exports = QuickSet; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25323,7 +25616,7 @@ module.exports = RightCenter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25368,7 +25661,7 @@ module.exports = TopCenter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25413,7 +25706,7 @@ module.exports = TopLeft; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25458,7 +25751,7 @@ module.exports = TopRight; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25489,7 +25782,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25520,7 +25813,7 @@ module.exports = Align; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25565,7 +25858,7 @@ module.exports = BottomCenter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25610,7 +25903,7 @@ module.exports = BottomLeft; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25655,7 +25948,7 @@ module.exports = BottomRight; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25700,7 +25993,7 @@ module.exports = LeftBottom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25745,7 +26038,7 @@ module.exports = LeftCenter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25790,7 +26083,7 @@ module.exports = LeftTop; /** * @author samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25843,7 +26136,7 @@ module.exports = QuickSet; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25888,7 +26181,7 @@ module.exports = RightBottom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25933,7 +26226,7 @@ module.exports = RightCenter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25978,7 +26271,7 @@ module.exports = RightTop; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26023,7 +26316,7 @@ module.exports = TopCenter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26068,7 +26361,7 @@ module.exports = TopLeft; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26113,7 +26406,7 @@ module.exports = TopRight; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26147,7 +26440,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26185,7 +26478,7 @@ module.exports = CenterOn; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26214,7 +26507,7 @@ module.exports = GetBottom; /** * @author samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26259,7 +26552,7 @@ module.exports = GetBounds; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26288,7 +26581,7 @@ module.exports = GetCenterX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26317,7 +26610,7 @@ module.exports = GetCenterY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26346,7 +26639,7 @@ module.exports = GetLeft; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26377,7 +26670,7 @@ module.exports = GetOffsetX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26408,7 +26701,7 @@ module.exports = GetOffsetY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26437,7 +26730,7 @@ module.exports = GetRight; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26466,7 +26759,7 @@ module.exports = GetTop; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26500,7 +26793,7 @@ module.exports = SetBottom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26536,7 +26829,7 @@ module.exports = SetCenterX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26572,7 +26865,7 @@ module.exports = SetCenterY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26606,7 +26899,7 @@ module.exports = SetLeft; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26640,7 +26933,7 @@ module.exports = SetRight; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26674,7 +26967,7 @@ module.exports = SetTop; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26711,7 +27004,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26775,7 +27068,7 @@ module.exports = CanvasInterpolation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26790,7 +27083,7 @@ var _disableContextSmoothing = false; /** * The CanvasPool is a global static object, that allows Phaser to recycle and pool 2D Context Canvas DOM elements. - * It does not pool WebGL Contexts, because once the context options are set they cannot be modified again, + * It does not pool WebGL Contexts, because once the context options are set they cannot be modified again, * which is useless for some of the Phaser pipelines / renderer. * * This singleton is instantiated as soon as Phaser loads, before a Phaser.Game instance has even been created. @@ -27037,7 +27330,7 @@ module.exports = CanvasPool(); /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -27170,7 +27463,7 @@ module.exports = Smoothing(); /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -27206,7 +27499,7 @@ module.exports = TouchAction; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -27254,7 +27547,7 @@ module.exports = UserSelect; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -27269,7 +27562,7 @@ module.exports = { Smoothing: __webpack_require__(8213), TouchAction: __webpack_require__(59271), UserSelect: __webpack_require__(36505) - + }; @@ -27280,7 +27573,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28144,7 +28437,7 @@ module.exports = Color; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28242,7 +28535,7 @@ module.exports = ColorSpectrum; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28283,7 +28576,7 @@ module.exports = ColorToRGBA; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28314,7 +28607,7 @@ module.exports = ComponentToHex; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28345,7 +28638,7 @@ module.exports = GetColor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28377,7 +28670,7 @@ module.exports = GetColor32; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28428,14 +28721,14 @@ module.exports = HSLToColor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var HSVToRGB = __webpack_require__(24650); /** - * Get HSV color wheel values in an array which will be 360 elements in size. + * Generates an HSV color wheel which is an array of 360 Color objects, for each step of the wheel. * * @function Phaser.Display.Color.HSVColorWheel * @since 3.0.0 @@ -28443,7 +28736,7 @@ var HSVToRGB = __webpack_require__(24650); * @param {number} [s=1] - The saturation, in the range 0 - 1. * @param {number} [v=1] - The value, in the range 0 - 1. * - * @return {Phaser.Types.Display.ColorObject[]} An array containing 360 elements, where each contains a single numeric value corresponding to the color at that point in the HSV color wheel. + * @return {Phaser.Types.Display.ColorObject[]} An array containing 360 ColorObject elements, where each element contains a Color object corresponding to the color at that point in the HSV color wheel. */ var HSVColorWheel = function (s, v) { @@ -28470,7 +28763,7 @@ module.exports = HSVColorWheel; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28552,7 +28845,7 @@ module.exports = HSVToRGB; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28606,7 +28899,7 @@ module.exports = HexStringToColor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28663,7 +28956,7 @@ module.exports = HueToComponent; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28697,7 +28990,7 @@ module.exports = IntegerToColor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28746,7 +29039,7 @@ module.exports = IntegerToRGB; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28855,7 +29148,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28886,7 +29179,7 @@ module.exports = ObjectToColor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28933,7 +29226,7 @@ module.exports = RGBStringToColor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -29014,7 +29307,7 @@ module.exports = RGBToHSV; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -29059,7 +29352,7 @@ module.exports = RGBToString; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -29096,7 +29389,7 @@ module.exports = RandomRGB; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -29153,7 +29446,7 @@ module.exports = ValueToColor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -29189,7 +29482,7 @@ module.exports = Color; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -29218,7 +29511,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -29553,7 +29846,7 @@ module.exports = BitmapMask; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -29874,7 +30167,7 @@ module.exports = GeometryMask; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -29897,7 +30190,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30024,7 +30317,7 @@ module.exports = BaseShader; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30083,7 +30376,7 @@ module.exports = AddToDOM; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30128,7 +30421,7 @@ module.exports = CreateDOMContainer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30192,7 +30485,7 @@ module.exports = DOMContentLoaded; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30218,7 +30511,7 @@ var GetInnerHeight = function (iOS) var axis = Math.abs(window.orientation); var size = { w: 0, h: 0 }; - + var ruler = document.createElement('div'); ruler.setAttribute('style', 'position: fixed; height: 100vh; width: 0; top: 0'); @@ -30252,7 +30545,7 @@ module.exports = GetInnerHeight; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30318,7 +30611,7 @@ module.exports = GetScreenOrientation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30370,7 +30663,7 @@ module.exports = GetTarget; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30428,7 +30721,7 @@ module.exports = ParseXML; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30458,7 +30751,7 @@ module.exports = RemoveFromDOM; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30468,6 +30761,7 @@ var NOOP = __webpack_require__(72283); /** * @classdesc * Abstracts away the use of RAF or setTimeOut for the core game update loop. + * * This is invoked automatically by the Phaser.Game instance. * * @class RequestAnimationFrame @@ -30500,16 +30794,6 @@ var RequestAnimationFrame = new Class({ */ this.callback = NOOP; - /** - * The most recent timestamp. Either a DOMHighResTimeStamp under RAF or `Date.now` under SetTimeout. - * - * @name Phaser.DOM.RequestAnimationFrame#tick - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.tick = 0; - /** * True if the step is using setTimeout instead of RAF. * @@ -30531,54 +30815,42 @@ var RequestAnimationFrame = new Class({ this.timeOutID = null; /** - * The previous time the step was called. + * The delay rate in ms for setTimeOut. * - * @name Phaser.DOM.RequestAnimationFrame#lastTime + * @name Phaser.DOM.RequestAnimationFrame#delay * @type {number} * @default 0 - * @since 3.0.0 + * @since 3.60.0 */ - this.lastTime = 0; - - /** - * The target FPS rate in ms. - * Only used when setTimeout is used instead of RAF. - * - * @name Phaser.DOM.RequestAnimationFrame#target - * @type {number} - * @default 0 - * @since 3.21.0 - */ - this.target = 0; + this.delay = 0; var _this = this; /** * The RAF step function. - * Updates the local tick value, invokes the callback and schedules another call to requestAnimationFrame. + * + * Invokes the callback and schedules another call to requestAnimationFrame. * * @name Phaser.DOM.RequestAnimationFrame#step * @type {FrameRequestCallback} * @since 3.0.0 + * + * @param {number} time - The timestamp passed in from RequestAnimationFrame. */ - this.step = function step () + this.step = function step (time) { - // Because we cannot trust the time passed to this callback from the browser and need it kept in sync with event times - var timestamp = window.performance.now(); + _this.callback(time); - // DOMHighResTimeStamp - _this.lastTime = _this.tick; - - _this.tick = timestamp; - - _this.callback(timestamp); - - _this.timeOutID = window.requestAnimationFrame(step); + if (_this.isRunning) + { + _this.timeOutID = window.requestAnimationFrame(step); + } }; /** * The SetTimeout step function. - * Updates the local tick value, invokes the callback and schedules another call to setTimeout. + * + * Invokes the callback and schedules another call to setTimeout. * * @name Phaser.DOM.RequestAnimationFrame#stepTimeout * @type {function} @@ -30586,17 +30858,13 @@ var RequestAnimationFrame = new Class({ */ this.stepTimeout = function stepTimeout () { - var d = Date.now(); + if (_this.isRunning) + { + // Make the next request before the callback, so that timing is maintained + _this.timeOutID = window.setTimeout(stepTimeout, _this.delay); + } - var delay = Math.min(Math.max(_this.target * 2 + _this.tick - d, 0), _this.target); - - _this.lastTime = _this.tick; - - _this.tick = d; - - _this.callback(d); - - _this.timeOutID = window.setTimeout(stepTimeout, delay); + _this.callback(window.performance.now()); }; }, @@ -30608,9 +30876,9 @@ var RequestAnimationFrame = new Class({ * * @param {FrameRequestCallback} callback - The callback to invoke each step. * @param {boolean} forceSetTimeOut - Should it use SetTimeout, even if RAF is available? - * @param {number} targetFPS - The target fps rate (in ms). Only used when setTimeout is used. + * @param {number} delay - The setTimeout delay rate in ms. */ - start: function (callback, forceSetTimeOut, targetFPS) + start: function (callback, forceSetTimeOut, delay) { if (this.isRunning) { @@ -30621,7 +30889,7 @@ var RequestAnimationFrame = new Class({ this.isSetTimeOut = forceSetTimeOut; - this.target = targetFPS; + this.delay = delay; this.isRunning = true; @@ -30673,7 +30941,7 @@ module.exports = RequestAnimationFrame; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30704,7 +30972,7 @@ module.exports = Dom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30889,7 +31157,7 @@ module.exports = EventEmitter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30907,7 +31175,7 @@ module.exports = { EventEmitter: __webpack_require__(78491) }; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -31036,7 +31304,7 @@ module.exports = BuildGameObject; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -31134,7 +31402,7 @@ module.exports = BuildGameObjectAnimation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -31247,6 +31515,11 @@ var DisplayList = new Class({ gameObject.removeFromDisplayList(); } + if (gameObject.parentContainer) + { + gameObject.parentContainer.remove(gameObject); + } + if (!gameObject.displayList) { this.queueDepthSort(); @@ -31365,15 +31638,11 @@ var DisplayList = new Class({ { var list = this.list; - var i = list.length; - - while (i--) + while (list.length) { - list[i].destroy(true); + list[0].destroy(true); } - list.length = 0; - this.events.off(SceneEvents.SHUTDOWN, this.shutdown, this); }, @@ -31410,7 +31679,7 @@ module.exports = DisplayList; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -31914,10 +32183,7 @@ var GameObject = new Class({ */ disableInteractive: function () { - if (this.input) - { - this.input.enabled = false; - } + this.scene.sys.input.disable(this); return this; }, @@ -32024,7 +32290,9 @@ var GameObject = new Class({ */ willRender: function (camera) { - return !(GameObject.RENDER_MASK !== this.renderFlags || (this.cameraFilter !== 0 && (this.cameraFilter & camera.id))); + var listWillRender = (this.displayList && this.displayList.active) ? this.displayList.willRender(camera) : true; + + return !(!listWillRender || GameObject.RENDER_MASK !== this.renderFlags || (this.cameraFilter !== 0 && (this.cameraFilter & camera.id))); }, /** @@ -32310,7 +32578,7 @@ module.exports = GameObject; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -32514,7 +32782,7 @@ module.exports = GameObjectCreator; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -32748,7 +33016,7 @@ module.exports = GameObjectFactory; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -32820,7 +33088,7 @@ module.exports = GetCalcMatrix; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -33125,7 +33393,7 @@ module.exports = UpdateList; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -33185,7 +33453,7 @@ module.exports = BatchChar; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -33571,7 +33839,7 @@ var GetBitmapTextSize = function (src, round, updateOrigin, out) i: charIndex, char: text[i], code: charCode, - x: (glyph.xOffset + xAdvance) * scale, + x: (glyph.xOffset + x) * scale, y: (glyph.yOffset + yAdvance) * scale, w: glyph.width * scale, h: glyph.height * scale, @@ -33582,7 +33850,7 @@ var GetBitmapTextSize = function (src, round, updateOrigin, out) glyph: glyph }); - xAdvance += glyph.xAdvance + letterSpacing; + xAdvance += glyph.xAdvance + letterSpacing + ((kerningOffset !== undefined) ? kerningOffset : 0); lastGlyph = glyph; lastCharCode = charCode; currentLineWidth = gw * scale; @@ -33708,7 +33976,7 @@ module.exports = GetBitmapTextSize; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -33763,7 +34031,7 @@ module.exports = ParseFromAtlas; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -33896,7 +34164,7 @@ module.exports = ParseRetroFont; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -34058,7 +34326,7 @@ module.exports = ParseXMLBitmapFont; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -34085,7 +34353,7 @@ module.exports = RetroFont; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -34202,7 +34470,7 @@ module.exports = RETRO_FONT_CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -34233,7 +34501,8 @@ var Render = __webpack_require__(88899); * * BMFont (Windows, free): {@link http://www.angelcode.com/products/bmfont/|http://www.angelcode.com/products/bmfont/} * Glyph Designer (OS X, commercial): {@link http://www.71squared.com/en/glyphdesigner|http://www.71squared.com/en/glyphdesigner} - * Littera (Web-based, free): {@link http://kvazars.com/littera/|http://kvazars.com/littera/} + * Snow BMF (Web-based, free): {@link https://snowb.org//|https://snowb.org/} + * Littera (Flash-based, free): {@link http://kvazars.com/littera/|http://kvazars.com/littera/} * * For most use cases it is recommended to use XML. If you wish to use JSON, the formatting should be equal to the result of * converting a valid XML file through the popular X2JS library. An online tool for conversion can be found here: {@link http://codebeautify.org/xmltojson|http://codebeautify.org/xmltojson} @@ -34436,7 +34705,7 @@ module.exports = DynamicBitmapText; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -34609,7 +34878,7 @@ var DynamicBitmapTextCanvasRenderer = function (renderer, src, camera, parentMat x += lineOffsetX; - xAdvance += glyph.xAdvance + letterSpacing; + xAdvance += glyph.xAdvance + letterSpacing + ((kerningOffset !== undefined) ? kerningOffset : 0); lastGlyph = glyph; lastCharCode = charCode; @@ -34651,7 +34920,7 @@ module.exports = DynamicBitmapTextCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -34703,7 +34972,7 @@ GameObjectCreator.register('dynamicBitmapText', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -34773,12 +35042,13 @@ GameObjectFactory.register('dynamicBitmapText', function (x, y, font, text, size /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -34805,7 +35075,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -35094,7 +35364,7 @@ module.exports = DynamicBitmapTextWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -35125,7 +35395,8 @@ var Render = __webpack_require__(84557); * * BMFont (Windows, free): {@link http://www.angelcode.com/products/bmfont/|http://www.angelcode.com/products/bmfont/} * Glyph Designer (OS X, commercial): {@link http://www.71squared.com/en/glyphdesigner|http://www.71squared.com/en/glyphdesigner} - * Littera (Web-based, free): {@link http://kvazars.com/littera/|http://kvazars.com/littera/} + * Snow BMF (Web-based, free): {@link https://snowb.org//|https://snowb.org/} + * Littera (Flash-based, free): {@link http://kvazars.com/littera/|http://kvazars.com/littera/} * * For most use cases it is recommended to use XML. If you wish to use JSON, the formatting should be equal to the result of * converting a valid XML file through the popular X2JS library. An online tool for conversion can be found here: {@link http://codebeautify.org/xmltojson|http://codebeautify.org/xmltojson} @@ -36195,7 +36466,7 @@ module.exports = BitmapText; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -36341,7 +36612,7 @@ var BitmapTextCanvasRenderer = function (renderer, src, camera, parentMatrix) x += lineOffsetX; - xAdvance += glyph.xAdvance + letterSpacing; + xAdvance += glyph.xAdvance + letterSpacing + ((kerningOffset !== undefined) ? kerningOffset : 0); lastGlyph = glyph; lastCharCode = charCode; @@ -36381,7 +36652,7 @@ module.exports = BitmapTextCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -36435,7 +36706,7 @@ GameObjectCreator.register('bitmapText', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -36500,12 +36771,13 @@ GameObjectFactory.register('bitmapText', function (x, y, font, text, size, align /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -36532,7 +36804,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -36672,7 +36944,7 @@ module.exports = BitmapTextWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -36972,7 +37244,7 @@ module.exports = Blitter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -37014,7 +37286,7 @@ var BlitterCanvasRenderer = function (renderer, src, camera, parentMatrix) // Blend Mode + Scale Mode ctx.globalCompositeOperation = renderer.blendModes[src.blendMode]; - ctx.imageSmoothingEnabled = !(!renderer.antialias || src.frame.source.scaleMode); + ctx.imageSmoothingEnabled = !src.frame.source.scaleMode; var cameraScrollX = src.x - camera.scrollX * src.scrollFactorX; var cameraScrollY = src.y - camera.scrollY * src.scrollFactorY; @@ -37057,17 +37329,20 @@ var BlitterCanvasRenderer = function (renderer, src, camera, parentMatrix) dy = Math.round(dy); } - ctx.drawImage( - frame.source.image, - cd.x, - cd.y, - cd.width, - cd.height, - dx + bob.x + cameraScrollX, - dy + bob.y + cameraScrollY, - cd.width, - cd.height - ); + if (cd.width > 0 && cd.height > 0) + { + ctx.drawImage( + frame.source.image, + cd.x, + cd.y, + cd.width, + cd.height, + dx + bob.x + cameraScrollX, + dy + bob.y + cameraScrollY, + cd.width, + cd.height + ); + } } else { @@ -37083,11 +37358,14 @@ var BlitterCanvasRenderer = function (renderer, src, camera, parentMatrix) dy -= cd.height; } - ctx.save(); - ctx.translate(bob.x + cameraScrollX, bob.y + cameraScrollY); - ctx.scale(fx, fy); - ctx.drawImage(frame.source.image, cd.x, cd.y, cd.width, cd.height, dx, dy, cd.width, cd.height); - ctx.restore(); + if (cd.width > 0 && cd.height > 0) + { + ctx.save(); + ctx.translate(bob.x + cameraScrollX, bob.y + cameraScrollY); + ctx.scale(fx, fy); + ctx.drawImage(frame.source.image, cd.x, cd.y, cd.width, cd.height, dx, dy, cd.width, cd.height); + ctx.restore(); + } } } @@ -37104,7 +37382,7 @@ module.exports = BlitterCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -37155,7 +37433,7 @@ GameObjectCreator.register('blitter', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -37198,12 +37476,13 @@ GameObjectFactory.register('blitter', function (x, y, key, frame) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -37230,7 +37509,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -37372,7 +37651,7 @@ module.exports = BlitterWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -37803,7 +38082,7 @@ module.exports = Bob; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -38099,7 +38378,7 @@ module.exports = Alpha; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -38210,7 +38489,7 @@ module.exports = AlphaSingle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -38228,7 +38507,7 @@ var BlendMode = { /** * Private internal value. Holds the current blend mode. - * + * * @name Phaser.GameObjects.Components.BlendMode#_blendMode * @type {number} * @private @@ -38333,14 +38612,14 @@ module.exports = BlendMode; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Provides methods used for calculating and setting the size of a non-Frame based Game Object. * Should be applied as a mixin and not used directly. - * + * * @namespace Phaser.GameObjects.Components.ComputedSize * @since 3.0.0 */ @@ -38349,11 +38628,11 @@ var ComputedSize = { /** * The native (un-scaled) width of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayWidth` property. - * + * * @name Phaser.GameObjects.Components.ComputedSize#width * @type {number} * @since 3.0.0 @@ -38362,11 +38641,11 @@ var ComputedSize = { /** * The native (un-scaled) height of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayHeight` property. - * + * * @name Phaser.GameObjects.Components.ComputedSize#height * @type {number} * @since 3.0.0 @@ -38375,11 +38654,11 @@ var ComputedSize = { /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. - * + * * @name Phaser.GameObjects.Components.ComputedSize#displayWidth * @type {number} * @since 3.0.0 @@ -38400,11 +38679,11 @@ var ComputedSize = { /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. - * + * * @name Phaser.GameObjects.Components.ComputedSize#displayHeight * @type {number} * @since 3.0.0 @@ -38425,21 +38704,21 @@ var ComputedSize = { /** * Sets the internal size of this Game Object, as used for frame or physics body creation. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. - * + * * @method Phaser.GameObjects.Components.ComputedSize#setSize * @since 3.4.0 * * @param {number} width - The width of this Game Object. * @param {number} height - The height of this Game Object. - * + * * @return {this} This Game Object instance. */ setSize: function (width, height) @@ -38452,15 +38731,15 @@ var ComputedSize = { /** * Sets the display size of this Game Object. - * + * * Calling this will adjust the scale. - * + * * @method Phaser.GameObjects.Components.ComputedSize#setDisplaySize * @since 3.4.0 * * @param {number} width - The width of this Game Object. * @param {number} height - The height of this Game Object. - * + * * @return {this} This Game Object instance. */ setDisplaySize: function (width, height) @@ -38483,7 +38762,7 @@ module.exports = ComputedSize; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -38527,24 +38806,24 @@ var Crop = { /** * Applies a crop to a texture based Game Object, such as a Sprite or Image. - * + * * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. - * + * * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just * changes what is shown when rendered. - * + * * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. - * + * * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left * half of it, you could call `setCrop(0, 0, 400, 600)`. - * + * * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop * an area of 200x100 when applied to a Game Object that had a scale factor of 2. - * + * * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. - * + * * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. - * + * * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow * the renderer to skip several internal calculations. * @@ -38589,7 +38868,7 @@ var Crop = { * @method Phaser.GameObjects.Components.Crop#resetCropObject * @private * @since 3.12.0 - * + * * @return {object} The crop object. */ resetCropObject: function () @@ -38609,7 +38888,7 @@ module.exports = Crop; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -38635,7 +38914,7 @@ var Depth = { _depth: 0, /** - * The depth of this Game Object within the Scene. + * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. @@ -38682,7 +38961,7 @@ var Depth = { * @method Phaser.GameObjects.Components.Depth#setDepth * @since 3.0.0 * - * @param {number} value - The depth of this Game Object. + * @param {number} value - The depth of this Game Object. Ensure this value is only ever a number data-type. * * @return {this} This Game Object instance. */ @@ -38707,7 +38986,7 @@ module.exports = Depth; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -38727,7 +39006,7 @@ var FX = { * when it is being rendered by a SpriteFX Pipeline. * * Lots of FX require additional spacing added to the texture the - * Game Object uses, for example a glow or shaddow effect, and this + * Game Object uses, for example a glow or shadow effect, and this * method allows you to control how much extra padding is included * in addition to the texture size. * @@ -38743,7 +39022,7 @@ var FX = { * when it is being rendered by a SpriteFX Pipeline. * * Lots of FX require additional spacing added to the texture the - * Game Object uses, for example a glow or shaddow effect, and this + * Game Object uses, for example a glow or shadow effect, and this * method allows you to control how much extra padding is included * in addition to the texture size. * @@ -38810,14 +39089,14 @@ module.exports = FX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Provides methods used for visually flipping a Game Object. * Should be applied as a mixin and not used directly. - * + * * @namespace Phaser.GameObjects.Components.Flip * @since 3.0.0 */ @@ -38826,11 +39105,11 @@ var Flip = { /** * The horizontally flipped state of the Game Object. - * + * * A Game Object that is flipped horizontally will render inversed on the horizontal axis. * Flipping always takes place from the middle of the texture and does not impact the scale value. * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * + * * @name Phaser.GameObjects.Components.Flip#flipX * @type {boolean} * @default false @@ -38840,11 +39119,11 @@ var Flip = { /** * The vertically flipped state of the Game Object. - * + * * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) * Flipping always takes place from the middle of the texture and does not impact the scale value. * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * + * * @name Phaser.GameObjects.Components.Flip#flipY * @type {boolean} * @default false @@ -38854,14 +39133,14 @@ var Flip = { /** * Toggles the horizontal flipped state of this Game Object. - * + * * A Game Object that is flipped horizontally will render inversed on the horizontal axis. * Flipping always takes place from the middle of the texture and does not impact the scale value. * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * + * * @method Phaser.GameObjects.Components.Flip#toggleFlipX * @since 3.0.0 - * + * * @return {this} This Game Object instance. */ toggleFlipX: function () @@ -38873,10 +39152,10 @@ var Flip = { /** * Toggles the vertical flipped state of this Game Object. - * + * * @method Phaser.GameObjects.Components.Flip#toggleFlipY * @since 3.0.0 - * + * * @return {this} This Game Object instance. */ toggleFlipY: function () @@ -38888,16 +39167,16 @@ var Flip = { /** * Sets the horizontal flipped state of this Game Object. - * + * * A Game Object that is flipped horizontally will render inversed on the horizontal axis. * Flipping always takes place from the middle of the texture and does not impact the scale value. * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * + * * @method Phaser.GameObjects.Components.Flip#setFlipX * @since 3.0.0 * * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped. - * + * * @return {this} This Game Object instance. */ setFlipX: function (value) @@ -38909,12 +39188,12 @@ var Flip = { /** * Sets the vertical flipped state of this Game Object. - * + * * @method Phaser.GameObjects.Components.Flip#setFlipY * @since 3.0.0 * * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped. - * + * * @return {this} This Game Object instance. */ setFlipY: function (value) @@ -38926,17 +39205,17 @@ var Flip = { /** * Sets the horizontal and vertical flipped state of this Game Object. - * + * * A Game Object that is flipped will render inversed on the flipped axis. * Flipping always takes place from the middle of the texture and does not impact the scale value. * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * + * * @method Phaser.GameObjects.Components.Flip#setFlip * @since 3.0.0 * * @param {boolean} x - The horizontal flipped state. `false` for no flip, or `true` to be flipped. * @param {boolean} y - The horizontal flipped state. `false` for no flip, or `true` to be flipped. - * + * * @return {this} This Game Object instance. */ setFlip: function (x, y) @@ -38949,7 +39228,7 @@ var Flip = { /** * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. - * + * * @method Phaser.GameObjects.Components.Flip#resetFlip * @since 3.0.0 * @@ -38975,7 +39254,7 @@ module.exports = Flip; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -39262,7 +39541,7 @@ var GetBounds = { var TLx, TLy, TRx, TRy, BLx, BLy, BRx, BRy; - // Instead of doing a check if parent container is + // Instead of doing a check if parent container is // defined per corner we only do it once. if (this.parentContainer) { @@ -39335,7 +39614,7 @@ module.exports = GetBounds; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -39458,13 +39737,13 @@ var Mask = { * @method Phaser.GameObjects.Components.Mask#createGeometryMask * @since 3.6.2 * - * @param {Phaser.GameObjects.Graphics} [graphics] - A Graphics Game Object. The geometry within it will be used as the mask. + * @param {Phaser.GameObjects.Graphics|Phaser.GameObjects.Shape} [graphics] - A Graphics Game Object, or any kind of Shape Game Object. The geometry within it will be used as the mask. * * @return {Phaser.Display.Masks.GeometryMask} This Geometry Mask that was created. */ createGeometryMask: function (graphics) { - if (graphics === undefined && this.type === 'Graphics') + if (graphics === undefined && (this instanceof Phaser.GameObjects.Graphics || this instanceof Phaser.GameObjects.Shape)) { // eslint-disable-next-line consistent-this graphics = this; @@ -39485,7 +39764,7 @@ module.exports = Mask; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -39689,7 +39968,7 @@ module.exports = Origin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -40056,7 +40335,7 @@ var PathFollower = { if (tweenData.state === TWEEN_CONST.COMPLETE) { - this.path.getPoint(1, pathVector); + this.path.getPoint(tweenData.end, pathVector); pathDelta.add(pathVector); pathVector.add(this.pathOffset); @@ -40117,7 +40396,7 @@ module.exports = PathFollower; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -40299,7 +40578,7 @@ var Pipeline = { * If you call this method multiple times, the new pipelines will be appended to any existing * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. * - * You can optionally also sets the `pipelineData` property, if the parameter is given. + * You can optionally also set the `pipelineData` property, if the parameter is given. * * Both the pipeline and post pipelines share the pipeline data object together. * @@ -40541,7 +40820,7 @@ module.exports = Pipeline; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -40565,7 +40844,7 @@ var ScrollFactor = { * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. - * + * * Please be aware that scroll factor values other than 1 are not taken in to consideration when * calculating physics collisions. Bodies always collide based on their world position, but changing * the scroll factor is a visual adjustment to where the textures are rendered, which can offset @@ -40589,7 +40868,7 @@ var ScrollFactor = { * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. - * + * * Please be aware that scroll factor values other than 1 are not taken in to consideration when * calculating physics collisions. Bodies always collide based on their world position, but changing * the scroll factor is a visual adjustment to where the textures are rendered, which can offset @@ -40613,7 +40892,7 @@ var ScrollFactor = { * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. - * + * * Please be aware that scroll factor values other than 1 are not taken in to consideration when * calculating physics collisions. Bodies always collide based on their world position, but changing * the scroll factor is a visual adjustment to where the textures are rendered, which can offset @@ -40649,13 +40928,13 @@ module.exports = ScrollFactor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Provides methods used for getting and setting the size of a Game Object. - * + * * @namespace Phaser.GameObjects.Components.Size * @since 3.0.0 */ @@ -40664,7 +40943,7 @@ var Size = { /** * A property indicating that a Game Object has this component. - * + * * @name Phaser.GameObjects.Components.Size#_sizeComponent * @type {boolean} * @private @@ -40675,11 +40954,11 @@ var Size = { /** * The native (un-scaled) width of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayWidth` property. - * + * * @name Phaser.GameObjects.Components.Size#width * @type {number} * @since 3.0.0 @@ -40688,11 +40967,11 @@ var Size = { /** * The native (un-scaled) height of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayHeight` property. - * + * * @name Phaser.GameObjects.Components.Size#height * @type {number} * @since 3.0.0 @@ -40701,11 +40980,11 @@ var Size = { /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. - * + * * @name Phaser.GameObjects.Components.Size#displayWidth * @type {number} * @since 3.0.0 @@ -40726,11 +41005,11 @@ var Size = { /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. - * + * * @name Phaser.GameObjects.Components.Size#displayHeight * @type {number} * @since 3.0.0 @@ -40751,20 +41030,20 @@ var Size = { /** * Sets the size of this Game Object to be that of the given Frame. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. - * + * * @method Phaser.GameObjects.Components.Size#setSizeToFrame * @since 3.0.0 * * @param {Phaser.Textures.Frame} frame - The frame to base the size of this Game Object on. - * + * * @return {this} This Game Object instance. */ setSizeToFrame: function (frame) @@ -40774,26 +41053,34 @@ var Size = { this.width = frame.realWidth; this.height = frame.realHeight; + var input = this.input; + + if (input && !input.customHitArea) + { + input.hitArea.width = this.width; + input.hitArea.height = this.height; + } + return this; }, /** * Sets the internal size of this Game Object, as used for frame or physics body creation. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. - * + * * @method Phaser.GameObjects.Components.Size#setSize * @since 3.0.0 * * @param {number} width - The width of this Game Object. * @param {number} height - The height of this Game Object. - * + * * @return {this} This Game Object instance. */ setSize: function (width, height) @@ -40806,15 +41093,15 @@ var Size = { /** * Sets the display size of this Game Object. - * + * * Calling this will adjust the scale. - * + * * @method Phaser.GameObjects.Components.Size#setDisplaySize * @since 3.0.0 * * @param {number} width - The width of this Game Object. * @param {number} height - The height of this Game Object. - * + * * @return {this} This Game Object instance. */ setDisplaySize: function (width, height) @@ -40837,7 +41124,7 @@ module.exports = Size; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -40968,7 +41255,7 @@ module.exports = Texture; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -41177,7 +41464,7 @@ module.exports = TextureCrop; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -41415,7 +41702,7 @@ module.exports = Tint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -41477,7 +41764,7 @@ module.exports = ToJSON; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -41500,6 +41787,17 @@ var _FLAG = 4; // 0100 var Transform = { + /** + * A property indicating that a Game Object has this component. + * + * @name Phaser.GameObjects.Components.Transform#hasTransformComponent + * @type {boolean} + * @readonly + * @default true + * @since 3.60.0 + */ + hasTransformComponent: true, + /** * Private internal value. Holds the horizontal scale value. * @@ -42089,7 +42387,7 @@ module.exports = Transform; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -42644,16 +42942,16 @@ var TransformMatrix = new Class({ }, /** - * Transform a point using this Matrix. + * Transform a point in to the local space of this Matrix. * * @method Phaser.GameObjects.Components.TransformMatrix#transformPoint * @since 3.0.0 * * @param {number} x - The x coordinate of the point to transform. * @param {number} y - The y coordinate of the point to transform. - * @param {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} point - The Point object to store the transformed coordinates. + * @param {Phaser.Types.Math.Vector2Like} [point] - Optional Point object to store the transformed coordinates in. * - * @return {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} The Point containing the transformed coordinates. + * @return {Phaser.Types.Math.Vector2Like} The Point containing the transformed coordinates. */ transformPoint: function (x, y, point) { @@ -43110,7 +43408,7 @@ module.exports = TransformMatrix; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -43120,7 +43418,7 @@ var _FLAG = 1; // 0001 /** * Provides methods used for setting the visibility of a Game Object. * Should be applied as a mixin and not used directly. - * + * * @namespace Phaser.GameObjects.Components.Visible * @since 3.0.0 */ @@ -43129,7 +43427,7 @@ var Visible = { /** * Private internal value. Holds the visible value. - * + * * @name Phaser.GameObjects.Components.Visible#_visible * @type {boolean} * @private @@ -43140,9 +43438,9 @@ var Visible = { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. - * + * * @name Phaser.GameObjects.Components.Visible#visible * @type {boolean} * @since 3.0.0 @@ -43172,14 +43470,14 @@ var Visible = { /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * * @method Phaser.GameObjects.Components.Visible#setVisible * @since 3.0.0 * * @param {boolean} value - The visible state of the Game Object. - * + * * @return {this} This Game Object instance. */ setVisible: function (value) @@ -43200,7 +43498,7 @@ module.exports = Visible; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -43244,7 +43542,7 @@ module.exports = { /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -43692,9 +43990,11 @@ var Container = new Class({ gameObject.parentContainer.remove(gameObject); } + gameObject.parentContainer = this; + gameObject.removeFromDisplayList(); - gameObject.parentContainer = this; + gameObject.addedToScene(); } }, @@ -43709,12 +44009,14 @@ var Container = new Class({ */ removeHandler: function (gameObject) { - gameObject.off(Events.DESTROY, this.remove); + gameObject.off(Events.DESTROY, this.remove, this); if (this.exclusive) { gameObject.parentContainer = null; + gameObject.removedFromScene(); + gameObject.addToDisplayList(); } }, @@ -43741,7 +44043,8 @@ var Container = new Class({ } else { - output = new Vector2(source.x, source.y); + output.x = source.x; + output.y = source.y; } var tempMatrix = this.tempTransformMatrix; @@ -44169,14 +44472,25 @@ var Container = new Class({ */ removeAll: function (destroyChild) { - var removed = ArrayUtils.RemoveBetween(this.list, 0, this.list.length, this.removeHandler, this); + var list = this.list; if (destroyChild) { - for (var i = 0; i < removed.length; i++) + for (var i = 0; i < list.length; i++) { - removed[i].destroy(); + if (list[i] && list[i].scene) + { + list[i].off(Events.DESTROY, this.remove, this); + + list[i].destroy(); + } } + + this.list = []; + } + else + { + ArrayUtils.RemoveBetween(list, 0, list.length, this.removeHandler, this); } return this; @@ -44639,7 +44953,7 @@ module.exports = Container; /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -44748,7 +45062,7 @@ module.exports = ContainerCanvasRenderer; /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -44799,7 +45113,7 @@ GameObjectCreator.register('container', function (config, addToScene) /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -44834,12 +45148,13 @@ GameObjectFactory.register('container', function (x, y, children) /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -44867,7 +45182,7 @@ module.exports = { /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -44990,7 +45305,7 @@ var ContainerWebGLRenderer = function (renderer, container, camera, parentMatrix child.setAlpha(childAlphaTopLeft * alpha, childAlphaTopRight * alpha, childAlphaBottomLeft * alpha, childAlphaBottomRight * alpha); // Render - child.renderWebGL(renderer, child, camera, transformMatrix); + child.renderWebGL(renderer, child, camera, transformMatrix, container); // Restore original values @@ -45019,7 +45334,7 @@ module.exports = ContainerWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -45062,7 +45377,7 @@ module.exports = [ /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -46058,7 +46373,7 @@ module.exports = DOMElement; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -46186,7 +46501,7 @@ module.exports = DOMElementCSSRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -46276,12 +46591,13 @@ GameObjectFactory.register('dom', function (x, y, element, style, innerText) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -46308,7 +46624,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -46335,7 +46651,7 @@ module.exports = 'addedtoscene'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -46362,7 +46678,7 @@ module.exports = 'destroy'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -46389,27 +46705,27 @@ module.exports = 'removedfromscene'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Video Game Object Complete Event. - * + * * This event is dispatched when a Video finishes playback by reaching the end of its duration. It * is also dispatched if a video marker sequence is being played and reaches the end. - * + * * Note that not all videos can fire this event. Live streams, for example, have no fixed duration, * so never technically 'complete'. - * + * * If a video is stopped from playback, via the `Video.stop` method, it will emit the * `VIDEO_STOP` event instead of this one. - * + * * Listen for it from a Video Game Object instance using `Video.on('complete', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_COMPLETE * @since 3.20.0 - * + * * @param {Phaser.GameObjects.Video} video - The Video Game Object which completed playback. */ module.exports = 'complete'; @@ -46422,22 +46738,22 @@ module.exports = 'complete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Video Game Object Created Event. - * + * * This event is dispatched when the texture for a Video has been created. This happens * when enough of the video source has been loaded that the browser is able to render a * frame from it. - * + * * Listen for it from a Video Game Object instance using `Video.on('created', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_CREATED * @since 3.20.0 - * + * * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event. * @param {number} width - The width of the video. * @param {number} height - The height of the video. @@ -46452,20 +46768,20 @@ module.exports = 'created'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Video Game Object Error Event. - * + * * This event is dispatched when a Video tries to play a source that does not exist, or is the wrong file type. - * + * * Listen for it from a Video Game Object instance using `Video.on('error', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_ERROR * @since 3.20.0 - * + * * @param {Phaser.GameObjects.Video} video - The Video Game Object which threw the error. * @param {Event} event - The native DOM event the browser raised during playback. */ @@ -46479,27 +46795,27 @@ module.exports = 'error'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Video Game Object Loop Event. - * + * * This event is dispatched when a Video that is currently playing has looped. This only * happens if the `loop` parameter was specified, or the `setLoop` method was called, * and if the video has a fixed duration. Video streams, for example, cannot loop, as * they have no duration. - * + * * Looping is based on the result of the Video `timeupdate` event. This event is not * frame-accurate, due to the way browsers work, so please do not rely on this loop * event to be time or frame precise. - * + * * Listen for it from a Video Game Object instance using `Video.on('loop', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_LOOP * @since 3.20.0 - * + * * @param {Phaser.GameObjects.Video} video - The Video Game Object which has looped. */ module.exports = 'loop'; @@ -46512,23 +46828,23 @@ module.exports = 'loop'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Video Game Object Play Event. - * + * * This event is dispatched when a Video begins playback. For videos that do not require * interaction unlocking, this is usually as soon as the `Video.play` method is called. * However, for videos that require unlocking, it is fired once playback begins after * they've been unlocked. - * + * * Listen for it from a Video Game Object instance using `Video.on('play', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_PLAY * @since 3.20.0 - * + * * @param {Phaser.GameObjects.Video} video - The Video Game Object which started playback. */ module.exports = 'play'; @@ -46541,20 +46857,20 @@ module.exports = 'play'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Video Game Object Seeked Event. - * + * * This event is dispatched when a Video completes seeking to a new point in its timeline. - * + * * Listen for it from a Video Game Object instance using `Video.on('seeked', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_SEEKED * @since 3.20.0 - * + * * @param {Phaser.GameObjects.Video} video - The Video Game Object which completed seeking. */ module.exports = 'seeked'; @@ -46567,21 +46883,21 @@ module.exports = 'seeked'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Video Game Object Seeking Event. - * + * * This event is dispatched when a Video _begins_ seeking to a new point in its timeline. * When the seek is complete, it will dispatch the `VIDEO_SEEKED` event to conclude. - * + * * Listen for it from a Video Game Object instance using `Video.on('seeking', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_SEEKING * @since 3.20.0 - * + * * @param {Phaser.GameObjects.Video} video - The Video Game Object which started seeking. */ module.exports = 'seeking'; @@ -46594,21 +46910,21 @@ module.exports = 'seeking'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Video Game Object Stopped Event. - * + * * This event is dispatched when a Video is stopped from playback via a call to the `Video.stop` method, * either directly via game code, or indirectly as the result of changing a video source or destroying it. - * + * * Listen for it from a Video Game Object instance using `Video.on('stop', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_STOP * @since 3.20.0 - * + * * @param {Phaser.GameObjects.Video} video - The Video Game Object which stopped playback. */ module.exports = 'stop'; @@ -46621,21 +46937,21 @@ module.exports = 'stop'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Video Game Object Timeout Event. - * + * * This event is dispatched when a Video has exhausted its allocated time while trying to connect to a video * source to start playback. - * + * * Listen for it from a Video Game Object instance using `Video.on('timeout', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_TIMEOUT * @since 3.20.0 - * + * * @param {Phaser.GameObjects.Video} video - The Video Game Object which timed out. */ module.exports = 'timeout'; @@ -46648,21 +46964,21 @@ module.exports = 'timeout'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Video Game Object Unlocked Event. - * + * * This event is dispatched when a Video that was prevented from playback due to the browsers * Media Engagement Interaction policy, is unlocked by a user gesture. - * + * * Listen for it from a Video Game Object instance using `Video.on('unlocked', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_UNLOCKED * @since 3.20.0 - * + * * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event. */ module.exports = 'unlocked'; @@ -46675,7 +46991,7 @@ module.exports = 'unlocked'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -46709,7 +47025,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -46829,7 +47145,7 @@ module.exports = Extern; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -46871,12 +47187,13 @@ GameObjectFactory.register('extern', function () /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -46903,7 +47220,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -46944,7 +47261,7 @@ module.exports = ExternWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -46980,7 +47297,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -47215,7 +47532,7 @@ var Graphics = new Class({ }, /** - * Set the current line style. + * Set the current line style. Used for all 'stroke' related functions. * * @method Phaser.GameObjects.Graphics#lineStyle * @since 3.0.0 @@ -47241,7 +47558,7 @@ var Graphics = new Class({ }, /** - * Set the current fill style. + * Set the current fill style. Used for all 'fill' related functions. * * @method Phaser.GameObjects.Graphics#fillStyle * @since 3.0.0 @@ -47690,6 +48007,8 @@ var Graphics = new Class({ var tr = radius; var bl = radius; var br = radius; + + var maxRadius = Math.min(width, height) / 2; if (typeof radius !== 'number') { @@ -47698,7 +48017,12 @@ var Graphics = new Class({ bl = GetFastValue(radius, 'bl', 20); br = GetFastValue(radius, 'br', 20); } - + + tl = Math.min(tl, maxRadius); + tr = Math.min(tr, maxRadius); + bl = Math.min(bl, maxRadius); + br = Math.min(br, maxRadius); + this.beginPath(); this.moveTo(x + tl, y); this.lineTo(x + width - tr, y); @@ -48457,7 +48781,7 @@ module.exports = Graphics; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -48705,7 +49029,7 @@ module.exports = GraphicsCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -48740,7 +49064,7 @@ GameObjectCreator.register('graphics', function (config, addToScene) { this.scene.sys.displayList.add(graphics); } - + return graphics; }); @@ -48754,7 +49078,7 @@ GameObjectCreator.register('graphics', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -48794,12 +49118,13 @@ GameObjectFactory.register('graphics', function (config) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -48829,7 +49154,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -49185,7 +49510,7 @@ module.exports = GraphicsWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -49310,7 +49635,7 @@ var Group = new Class({ * The class to create new group members from. * * @name Phaser.GameObjects.Group#classType - * @type {Function} + * @type {Phaser.Types.GameObjects.Group.GroupClassTypeConstructor} * @since 3.0.0 * @default Phaser.GameObjects.Sprite */ @@ -50915,7 +51240,7 @@ module.exports = Group; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -50949,7 +51274,7 @@ GameObjectCreator.register('group', function (config) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -50964,7 +51289,7 @@ var GameObjectFactory = __webpack_require__(61286); * @method Phaser.GameObjects.GameObjectFactory#group * @since 3.0.0 * - * @param {(Phaser.GameObjects.GameObject[]|Phaser.Types.GameObjects.Group.GroupConfig|Phaser.Types.GameObjects.Group.GroupConfig[])} [children] - Game Objects to add to this Group; or the `config` argument. + * @param {(Phaser.GameObjects.GameObject[]|Phaser.Types.GameObjects.Group.GroupConfig|Phaser.Types.GameObjects.Group.GroupConfig[]|Phaser.Types.GameObjects.Group.GroupCreateConfig)} [children] - Game Objects to add to this Group; or the `config` argument. * @param {Phaser.Types.GameObjects.Group.GroupConfig|Phaser.Types.GameObjects.Group.GroupCreateConfig} [config] - A Group Configuration object. * * @return {Phaser.GameObjects.Group} The Game Object that was created. @@ -50982,7 +51307,7 @@ GameObjectFactory.register('group', function (children, config) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -51086,7 +51411,7 @@ module.exports = Image; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -51121,7 +51446,7 @@ module.exports = ImageCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -51172,7 +51497,7 @@ GameObjectCreator.register('image', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -51215,12 +51540,13 @@ GameObjectFactory.register('image', function (x, y, key, frame) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -51247,7 +51573,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -51282,7 +51608,7 @@ module.exports = ImageWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -51435,7 +51761,7 @@ module.exports = GameObjects; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -52368,8 +52694,10 @@ var Layer = new Class({ * @method Phaser.GameObjects.Layer#destroy * @fires Phaser.GameObjects.Events#DESTROY * @since 3.50.0 + * + * @param {boolean} [fromScene=false] - `True` if this Game Object is being destroyed by the Scene, `false` if not. */ - destroy: function () + destroy: function (fromScene) { // This Game Object has already been destroyed if (!this.scene || this.ignoreDestroy) @@ -52379,11 +52707,11 @@ var Layer = new Class({ this.emit(GameObjectEvents.DESTROY, this); - var i = this.list.length; + var list = this.list; - while (i--) + while (list.length) { - this.list[i].destroy(); + list[0].destroy(fromScene); } this.removeAllListeners(); @@ -52426,7 +52754,7 @@ module.exports = Layer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -52442,7 +52770,6 @@ module.exports = Layer; * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Layer} layer - The Game Object being rendered in this call. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ var LayerCanvasRenderer = function (renderer, layer, camera) { @@ -52513,7 +52840,7 @@ module.exports = LayerCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -52561,7 +52888,7 @@ GameObjectCreator.register('layer', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -52593,12 +52920,13 @@ GameObjectFactory.register('layer', function (children) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -52625,7 +52953,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -52749,7 +53077,7 @@ module.exports = LayerWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -52769,13 +53097,19 @@ var Utils = __webpack_require__(75512); * * They can also simply be used to represent a point light for your own purposes. * + * As of Phaser 3.60 this Game Object now has the Transform and Origin components. However, changing the scale, + * rotation or origin properties will not make any difference to the Light. They are simply present to allow you + * to add this Light to a Container, or enable it for Physics. + * * @class Light * @extends Phaser.Geom.Circle * @memberof Phaser.GameObjects * @constructor * @since 3.0.0 * + * @extends Phaser.GameObjects.Components.Origin * @extends Phaser.GameObjects.Components.ScrollFactor + * @extends Phaser.GameObjects.Components.Transform * @extends Phaser.GameObjects.Components.Visible * * @param {number} x - The horizontal position of the light. @@ -52791,7 +53125,9 @@ var Light = new Class({ Extends: Circle, Mixins: [ + Components.Origin, Components.ScrollFactor, + Components.Transform, Components.Visible ], @@ -52847,6 +53183,92 @@ var Light = new Class({ this.cameraFilter = 0; this.setScrollFactor(1, 1); + this.setOrigin(); + this.setDisplayOrigin(radius); + }, + + /** + * The width of this Light Game Object. This is the same as `Light.diameter`. + * + * @name Phaser.GameObjects.Light#displayWidth + * @type {number} + * @since 3.60.0 + */ + displayWidth: { + + get: function () + { + return this.diameter; + }, + + set: function (value) + { + this.diameter = value; + } + + }, + + /** + * The height of this Light Game Object. This is the same as `Light.diameter`. + * + * @name Phaser.GameObjects.Light#displayHeight + * @type {number} + * @since 3.60.0 + */ + displayHeight: { + + get: function () + { + return this.diameter; + }, + + set: function (value) + { + this.diameter = value; + } + + }, + + /** + * The width of this Light Game Object. This is the same as `Light.diameter`. + * + * @name Phaser.GameObjects.Light#width + * @type {number} + * @since 3.60.0 + */ + width: { + + get: function () + { + return this.diameter; + }, + + set: function (value) + { + this.diameter = value; + } + + }, + + /** + * The height of this Light Game Object. This is the same as `Light.diameter`. + * + * @name Phaser.GameObjects.Light#height + * @type {number} + * @since 3.60.0 + */ + height: { + + get: function () + { + return this.diameter; + }, + + set: function (value) + { + this.diameter = value; + } + }, /** @@ -52939,7 +53361,7 @@ module.exports = Light; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -53301,7 +53723,7 @@ module.exports = LightsManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -53420,7 +53842,7 @@ module.exports = LightsPlugin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -53969,10 +54391,16 @@ var Mesh = new Class({ addVerticesFromObj: function (key, scale, x, y, z, rotateX, rotateY, rotateZ, zIsUp) { var data = this.scene.sys.cache.obj.get(key); + var parsedData; if (data) { - GenerateObjVerts(data, this, scale, x, y, z, rotateX, rotateY, rotateZ, zIsUp); + parsedData = GenerateObjVerts(data, this, scale, x, y, z, rotateX, rotateY, rotateZ, zIsUp); + } + + if (!parsedData || parsedData.verts.length === 0) + { + console.warn('Mesh.addVerticesFromObj data empty:', key); } return this; @@ -54136,6 +54564,10 @@ var Mesh = new Class({ this.faces = this.faces.concat(result.faces); this.vertices = this.vertices.concat(result.vertices); } + else + { + console.warn('Mesh.addVertices data empty or invalid'); + } this.dirtyCache[9] = -1; @@ -54474,8 +54906,74 @@ var Mesh = new Class({ this.debugCallback = null; this.debugGraphic = null; - } + }, + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff on all vertices, + * which results in no visible change to the texture. + * + * @method Phaser.GameObjects.Mesh#clearTint + * @webglOnly + * @since 3.60.0 + * + * @return {this} This Game Object instance. + */ + clearTint: function () + { + return this.setTint(); + }, + + /** + * Sets an additive tint on all vertices of this Mesh Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. + * + * To remove a tint call `clearTint`. + * + * @method Phaser.GameObjects.Mesh#setTint + * @webglOnly + * @since 3.60.0 + * + * @param {number} [tint=0xffffff] - The tint being applied to all vertices of this Mesh Game Object. + * + * @return {this} This Game Object instance. + */ + setTint: function (tint) + { + if (tint === undefined) { tint = 0xffffff; } + + var vertices = this.vertices; + + for (var i = 0; i < vertices.length; i++) + { + vertices[i].color = tint; + } + + return this; + }, + + /** + * The tint value being applied to the whole of the Game Object. + * This property is a setter-only. + * + * @method Phaser.GameObjects.Mesh#tint + * @type {number} + * @webglOnly + * @since 3.60.0 + */ + tint: { + + set: function (value) + { + this.setTint(value); + } + } }); module.exports = Mesh; @@ -54488,7 +54986,7 @@ module.exports = Mesh; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -54517,7 +55015,7 @@ module.exports = MeshCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -54574,7 +55072,7 @@ GameObjectCreator.register('mesh', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -54620,12 +55118,13 @@ if (true) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -54652,7 +55151,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -54765,7 +55264,7 @@ module.exports = MeshWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -55003,6 +55502,12 @@ var EmitterOp = new Class({ this.onEmit = this.defaultEmit; this.onUpdate = this.defaultUpdate; + // `moveToX` and `moveToY` are null by default + if (value === null) + { + return; + } + if (t === 'number') { // Explicit static value: @@ -55369,7 +55874,7 @@ module.exports = EmitterOp; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -55379,9 +55884,9 @@ var GetFastValue = __webpack_require__(72632); /** * @classdesc * The GravityWell action applies a force on the particle to draw it towards, or repel it from, a single point. - * + * * The force applied is inversely proportional to the square of the distance from the particle to the point, in accordance with Newton's law of gravity. - * + * * This simulates the effect of gravity over large distances (as between planets, for example). * * @class GravityWell @@ -55589,13 +56094,12 @@ module.exports = GravityWell; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var Class = __webpack_require__(56694); var DegToRad = __webpack_require__(75606); -var DistanceBetween = __webpack_require__(53996); /** * @classdesc @@ -55929,16 +56433,10 @@ var Particle = new Class({ { var mx = emitter.moveToX.onEmit(this, 'moveToX'); var my = (emitter.moveToY) ? emitter.moveToY.onEmit(this, 'moveToY') : mx; + var lifeS = this.life / 1000; - var angle = Math.atan2(my - this.y, mx - this.x); - - var speed = DistanceBetween(this.x, this.y, mx, my) / (this.life / 1000); - - // We know how many pixels we need to move, but how fast? - // var speed = this.distanceToXY(displayObject, x, y) / (maxTime / 1000); - - this.velocityX = Math.cos(angle) * speed; - this.velocityY = Math.sin(angle) * speed; + this.velocityX = (mx - this.x) / lifeS; + this.velocityY = (my - this.y) / lifeS; } else { @@ -55958,7 +56456,7 @@ var Particle = new Class({ this.delayCurrent = emitter.delay.onEmit(this, 'delay'); this.scaleX = emitter.scaleX.onEmit(this, 'scaleX'); - this.scaleY = (emitter.scaleY) ? emitter.scaleY.onEmit(this, 'scaleY') : this.scaleX; + this.scaleY = emitter.scaleY.onEmit(this, 'scaleY'); this.angle = emitter.rotate.onEmit(this, 'rotate'); this.rotation = DegToRad(this.angle); @@ -56120,15 +56618,7 @@ var Particle = new Class({ } this.scaleX = emitter.scaleX.onUpdate(this, 'scaleX', t, this.scaleX); - - if (emitter.scaleY) - { - this.scaleY = emitter.scaleY.onUpdate(this, 'scaleY', t, this.scaleY); - } - else - { - this.scaleY = this.scaleX; - } + this.scaleY = emitter.scaleY.onUpdate(this, 'scaleY', t, this.scaleY); this.angle = emitter.rotate.onUpdate(this, 'rotate', t, this.angle); this.rotation = DegToRad(this.angle); @@ -56154,7 +56644,7 @@ module.exports = Particle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -56265,6 +56755,7 @@ var ParticleEmitter = new Class({ 'gravityX', 'gravityY', 'maxParticles', + 'maxAliveParticles', 'name', 'on', 'particleBringToTop', @@ -56321,7 +56812,7 @@ var ParticleEmitter = new Class({ * The Particle Class which will be emitted by this Emitter. * * @name Phaser.GameObjects.Particles.ParticleEmitter#particleClass - * @type {Phaser.GameObjects.Particles.Particle} + * @type {Phaser.Types.GameObjects.Particles.ParticleClassConstructor} * @default Phaser.GameObjects.Particles.Particle * @since 3.0.0 */ @@ -56457,7 +56948,10 @@ var ParticleEmitter = new Class({ this.speedY = new EmitterOp(config, 'speedY', 0, true); /** - * Whether moveToX and moveToY are nonzero. Set automatically during configuration. + * Whether moveToX and moveToY are set. Set automatically during configuration. + * + * When true the particles move toward the moveToX and moveToY coordinates and arrive at the end of their life. + * Emitter angle, speedX, and speedY are ignored. * * @name Phaser.GameObjects.Particles.ParticleEmitter#moveTo * @type {boolean} @@ -56474,7 +56968,7 @@ var ParticleEmitter = new Class({ * @default 0 * @since 3.0.0 */ - this.moveToX = new EmitterOp(config, 'moveToX', 0, true); + this.moveToX = new EmitterOp(config, 'moveToX', null, true); /** * The y-coordinate emitted particles move toward, when {@link Phaser.GameObjects.Particles.ParticleEmitter#moveTo} is true. @@ -56484,7 +56978,7 @@ var ParticleEmitter = new Class({ * @default 0 * @since 3.0.0 */ - this.moveToY = new EmitterOp(config, 'moveToY', 0, true); + this.moveToY = new EmitterOp(config, 'moveToY', null, true); /** * Whether particles will rebound when they meet the emitter bounds. @@ -56624,6 +57118,19 @@ var ParticleEmitter = new Class({ */ this.maxParticles = 0; + /** + * The maximum number of alive (and rendering) particles this emitter will update. + * When this limit is reached, a particle needs to die before another can be emitted. + * + * 0 means no limits. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#maxAliveParticles + * @type {number} + * @default 0 + * @since 3.60.0 + */ + this.maxAliveParticles = 0; + /** * How many particles are emitted each time particles are emitted (one explosion or one flow cycle). * @@ -56960,7 +57467,7 @@ var ParticleEmitter = new Class({ this.acceleration = (this.accelerationX.propertyValue !== 0 || this.accelerationY.propertyValue !== 0); - this.moveTo = (this.moveToX.propertyValue !== 0 || this.moveToY.propertyValue !== 0); + this.moveTo = (this.moveToX.propertyValue !== null && this.moveToY.propertyValue !== null); // Special 'speed' override @@ -56981,7 +57488,7 @@ var ParticleEmitter = new Class({ if (HasValue(config, 'scale')) { this.scaleX.loadConfig(config, 'scale'); - this.scaleY = null; + this.scaleY.loadConfig(config, 'scale'); } if (HasValue(config, 'callbackScope')) @@ -57066,9 +57573,10 @@ var ParticleEmitter = new Class({ output.speed = this.speedX.toJSON(); } - if (!this.scaleY) + if (this.scaleX === this.scaleY) { delete output.scaleX; + delete output.scaleY; output.scale = this.scaleX.toJSON(); } @@ -57395,7 +57903,7 @@ var ParticleEmitter = new Class({ }, /** - * Sets the scale of emitted particles. + * Sets the scale of emitted particles. This updates both the scaleX and scaleY values. * * @method Phaser.GameObjects.Particles.ParticleEmitter#setScale * @since 3.0.0 @@ -57407,7 +57915,7 @@ var ParticleEmitter = new Class({ setScale: function (value) { this.scaleX.onChange(value); - this.scaleY = null; + this.scaleY.onChange(value); return this; }, @@ -57744,7 +58252,8 @@ var ParticleEmitter = new Class({ }, /** - * Whether this emitter is at its limit (if set). + * Whether this emitter is at either its hard-cap limit (maxParticles), if set, or + * the max allowed number of 'alive' particles (maxAliveParticles). * * @method Phaser.GameObjects.Particles.ParticleEmitter#atLimit * @since 3.0.0 @@ -57753,7 +58262,12 @@ var ParticleEmitter = new Class({ */ atLimit: function () { - return (this.maxParticles > 0 && this.getParticleCount() === this.maxParticles); + if (this.maxParticles > 0 && this.getParticleCount() >= this.maxParticles) + { + return true; + } + + return (this.maxAliveParticles > 0 && this.getAliveParticleCount() >= this.maxAliveParticles); }, /** @@ -58018,9 +58532,9 @@ var ParticleEmitter = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitter#explode * @since 3.0.0 * - * @param {number} count - The amount of Particles to emit. - * @param {number} x - The x coordinate to emit the Particles from. - * @param {number} y - The y coordinate to emit the Particles from. + * @param {number} [count=this.quantity] - The number of Particles to emit. + * @param {number} [x=this.x] - The x coordinate to emit the Particles from. + * @param {number} [y=this.x] - The y coordinate to emit the Particles from. * * @return {Phaser.GameObjects.Particles.Particle} The most recently emitted Particle. */ @@ -58196,12 +58710,12 @@ var ParticleEmitter = new Class({ { this._counter -= delta; - if (this._counter <= 0) + while (this._counter <= 0) { this.emitParticle(); // counter = frequency - remained from previous delta - this._counter = (this.frequency - Math.abs(this._counter)); + this._counter += this.frequency; } } }, @@ -58234,7 +58748,7 @@ module.exports = ParticleEmitter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -58742,7 +59256,7 @@ module.exports = ParticleEmitterManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -58845,26 +59359,29 @@ var ParticleManagerCanvasRenderer = function (renderer, emitterManager, camera, var frame = particle.frame; var cd = frame.canvasData; - var x = -(frame.halfWidth); - var y = -(frame.halfHeight); - - ctx.globalAlpha = alpha; - - ctx.save(); - - calcMatrix.setToContext(ctx); - - if (roundPixels) + if (cd.width > 0 && cd.height > 0) { - x = Math.round(x); - y = Math.round(y); + var x = -(frame.halfWidth); + var y = -(frame.halfHeight); + + ctx.globalAlpha = alpha; + + ctx.save(); + + calcMatrix.setToContext(ctx); + + if (roundPixels) + { + x = Math.round(x); + y = Math.round(y); + } + + ctx.imageSmoothingEnabled = !frame.source.scaleMode; + + ctx.drawImage(frame.source.image, cd.x, cd.y, cd.width, cd.height, x, y, cd.width, cd.height); + + ctx.restore(); } - - ctx.imageSmoothingEnabled = !(!renderer.antialias || frame.source.scaleMode); - - ctx.drawImage(frame.source.image, cd.x, cd.y, cd.width, cd.height, x, y, cd.width, cd.height); - - ctx.restore(); } ctx.restore(); @@ -58881,7 +59398,7 @@ module.exports = ParticleManagerCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -58941,7 +59458,7 @@ GameObjectCreator.register('particles', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -58975,12 +59492,13 @@ GameObjectFactory.register('particles', function (key, frame, emitters) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -59007,7 +59525,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -59165,7 +59683,7 @@ module.exports = ParticleManagerWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -59192,7 +59710,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -59271,7 +59789,7 @@ module.exports = DeathZone; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -59516,7 +60034,7 @@ module.exports = EdgeZone; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -59590,7 +60108,7 @@ module.exports = RandomZone; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -59614,7 +60132,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -59697,7 +60215,7 @@ module.exports = PathFollower; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -59746,7 +60264,7 @@ GameObjectFactory.register('follower', function (path, x, y, key, frame) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -59815,7 +60333,6 @@ var PointLight = new Class({ Components.AlphaSingle, Components.BlendMode, Components.Depth, - Components.GetBounds, Components.Mask, Components.Pipeline, Components.ScrollFactor, @@ -59952,7 +60469,7 @@ module.exports = PointLight; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -60003,7 +60520,7 @@ GameObjectCreator.register('pointlight', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -60064,12 +60581,13 @@ GameObjectFactory.register('pointlight', function (x, y, color, radius, intensit /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -60091,7 +60609,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -60160,7 +60678,7 @@ module.exports = PointLightWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -60192,6 +60710,10 @@ var UUID = __webpack_require__(76583); * is a technical limitation of WebGL. To get around it, create your shape as a texture in an art package, then draw that * to the Render Texture. * + * If you are planning on using this Render Texture as a base texture for Sprite + * Game Objects, then you should call `RenderTexture.setIsSpriteTexture()` _before_ + * calling any `draw` methods, otherwise you will get inverted frames in WebGL. + * * @class RenderTexture * @extends Phaser.GameObjects.GameObject * @memberof Phaser.GameObjects @@ -60350,6 +60872,23 @@ var RenderTexture = new Class({ */ this._saved = false; + /** + * Is this Render Texture being used as the base texture for a Sprite Game Object? + * + * To enable this, call `RenderTexture.setIsSpriteTexture(true)`. + * + * You should do this _before_ drawing to this RenderTexture, so that it correctly + * inverses the frames for WebGL rendering. Not doing so will result in inverted frames. + * + * This property is used in the `endDraw` method. + * + * @name Phaser.GameObjects.RenderTexture#isSpriteTexture + * @type {boolean} + * @readonly + * @since 3.60.0 + */ + this.isSpriteTexture = false; + if (key === undefined) { this.canvas = CanvasPool.create2D(this, width, height); @@ -60430,6 +60969,8 @@ var RenderTexture = new Class({ this.drawGameObject = this.batchGameObjectWebGL; this.renderTarget = new RenderTarget(renderer, width, height, 1, 0, false); + + this.setFlipY(this.isSpriteTexture); } else if (renderer.type === CONST.CANVAS) { @@ -60466,6 +61007,27 @@ var RenderTexture = new Class({ return this.resize(width, height); }, + /** + * If you are planning on using this Render Texture as a base texture for Sprite + * Game Objects, then you should call this method with a value of `true` before + * calling drawing anything to it, otherwise you will get inverted frames in WebGL. + * + * @method Phaser.GameObjects.RenderTexture#setIsSpriteTexture + * @since 3.60.0 + * + * @param {boolean} value - Is this Render Target being used as a Sprite Texture, or not? + * + * @return {this} This Game Object instance. + */ + setIsSpriteTexture: function (value) + { + this.isSpriteTexture = value; + + this.setFlipY(value); + + return this; + }, + /** * Resizes the Render Texture to the new dimensions given. * @@ -60518,6 +61080,7 @@ var RenderTexture = new Class({ frame.source.isRenderTexture = true; frame.source.isGLTexture = true; frame.source.glTexture = renderTarget.texture; + frame.source.glTexture.flipY = true; } this.camera.setSize(width, height); @@ -60668,9 +61231,9 @@ var RenderTexture = new Class({ if (width === undefined) { width = frame.cutWidth; } if (height === undefined) { height = frame.cutHeight; } - var r = (rgb >> 16 & 0xFF) / 255; - var g = (rgb >> 8 & 0xFF) / 255; - var b = (rgb & 0xFF) / 255; + var r = (rgb >> 16 & 0xFF); + var g = (rgb >> 8 & 0xFF); + var b = (rgb & 0xFF); var renderTarget = this.renderTarget; @@ -60695,7 +61258,7 @@ var RenderTexture = new Class({ pipeline.drawFillRect( x * sx, y * sy, width * sx, height * sy, - Utils.getTintFromFloats(b, g, r, 1), + Utils.getTintFromFloats(b / 255, g / 255, r / 255, 1), alpha ); @@ -60824,7 +61387,10 @@ var RenderTexture = new Class({ * * A Texture Frame instance. * * A string. This is used to look-up a texture from the Texture Manager. * - * Note: You cannot draw a Render Texture to itself. + * Note 1: You cannot draw a Render Texture to itself. + * + * Note 2: For Game Objects that have Post FX Pipelines, the pipeline _cannot_ be + * used when drawn to this Render Texture. * * If passing in a Group or Container it will only draw children that return `true` * when their `willRender()` method is called. I.e. a Container with 10 children, @@ -60851,6 +61417,10 @@ var RenderTexture = new Class({ * try and pass them in an array in one single call, rather than making lots of * separate calls. * + * If you are planning on using this Render Texture as a base texture for Sprite + * Game Objects, then you should set `RenderTexture.isSpriteTexture = true` before + * calling this method, otherwise you will get inverted frames in WebGL. + * * @method Phaser.GameObjects.RenderTexture#draw * @since 3.2.0 * @@ -60889,11 +61459,15 @@ var RenderTexture = new Class({ * * If you need to draw a Sprite to this Render Texture, use the `draw` method instead. * + * If you are planning on using this Render Texture as a base texture for Sprite + * Game Objects, then you should set `RenderTexture.isSpriteTexture = true` before + * calling this method, otherwise you will get inverted frames in WebGL. + * * @method Phaser.GameObjects.RenderTexture#drawFrame * @since 3.12.0 * * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. - * @param {(string|number)} [frame] - The name or index of the frame within the Texture. + * @param {(string|number)} [frame] - The name or index of the frame within the Texture. Set to `null` to skip this argument if not required. * @param {number} [x=0] - The x position to draw the frame at. * @param {number} [y=0] - The y position to draw the frame at. * @param {number} [alpha] - The alpha to use. If not specified it uses the `globalAlpha` property. @@ -60910,6 +61484,65 @@ var RenderTexture = new Class({ return this; }, + /** + * Takes the given Texture Frame and draws it to this Render Texture + * as a fill pattern, i.e. in a grid-layout based on the frame dimensions. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * + * ```javascript + * var rt = this.add.renderTexture(0, 0, 800, 600); + * rt.fillFrame(key, frame); + * ``` + * + * You can optionally provide a position, alpha and tint value to apply to the frames + * before they are drawn. The position controls the offset of the first frame to be drawn + * and can be negative if required. + * + * Calling this method will cause a batch flush, so if you've got a stack of things to draw + * in a tight loop, try using the `draw` method instead. + * + * If you are planning on using this Render Texture as a base texture for Sprite + * Game Objects, then you should set `RenderTexture.isSpriteTexture = true` before + * calling this method, otherwise you will get inverted frames in WebGL. + * + * @method Phaser.GameObjects.RenderTexture#fillFrame + * @since 3.60.0 + * + * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. + * @param {(string|number)} [frame] - The name or index of the frame within the Texture. Set to `null` to skip this argument if not required. + * @param {number} [x=0] - The x position to start drawing the frames from (can be negative to offset). + * @param {number} [y=0] - The y position to start drawing the frames from (can be negative to offset). + * @param {number} [alpha] - The alpha to use. If not specified it uses the `globalAlpha` property. + * @param {number} [tint] - WebGL only. The tint color to use. If not specified it uses the `globalTint` property. + * + * @return {this} This Render Texture instance. + */ + fillFrame: function (key, frame, x, y, alpha, tint) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + + var textureFrame = this.textureManager.getFrame(key, frame); + + if (textureFrame) + { + this.beginDraw(); + + for (var sy = y; sy < this.height; sy += textureFrame.height) + { + for (var sx = x; sx < this.width; sx += textureFrame.width) + { + this.batchDrawFrame(key, frame, sx, sy, alpha, tint); + } + } + + this.endDraw(); + } + + return this; + }, + /** * Use this method if you need to batch draw a large number of Game Objects to * this Render Texture in a single go, or on a frequent basis. @@ -61202,7 +61835,7 @@ var RenderTexture = new Class({ var util = renderer.pipelines.setUtility(); - util.blitFrame(canvasTarget, renderTarget, 1, false, false, erase); + util.blitFrame(canvasTarget, renderTarget, 1, false, false, erase, this.isSpriteTexture); renderer.resetScissor(); renderer.resetViewport(); @@ -61329,6 +61962,11 @@ var RenderTexture = new Class({ } else { + if (!this._eraseMode) + { + this.renderer.setBlendMode(gameObject.blendMode); + } + gameObject.renderWebGL(this.renderer, gameObject, this.camera); } @@ -61439,7 +62077,10 @@ var RenderTexture = new Class({ matrix.setToContext(ctx); - ctx.drawImage(source, cd.x, cd.y, cd.width, cd.height, x, y, cd.width, cd.height); + if (cd.width > 0 && cd.height > 0) + { + ctx.drawImage(source, cd.x, cd.y, cd.width, cd.height, x, y, cd.width, cd.height); + } ctx.restore(); } @@ -61592,7 +62233,7 @@ module.exports = RenderTexture; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -61627,7 +62268,7 @@ module.exports = RenderTextureCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -61680,7 +62321,7 @@ GameObjectCreator.register('renderTexture', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -61691,7 +62332,7 @@ var RenderTexture = __webpack_require__(15996); * Creates a new Render Texture Game Object and adds it to the Scene. * * Note: This method will only be available if the Render Texture Game Object has been built into Phaser. - * + * * A Render Texture is a special texture that allows any number of Game Objects to be drawn to it. You can take many complex objects and * draw them all to this one texture, which can they be used as the texture for other Game Object's. It's a way to generate dynamic * textures at run-time that are WebGL friendly and don't invoke expensive GPU uploads. @@ -61705,7 +62346,7 @@ var RenderTexture = __webpack_require__(15996); * @param {number} [height=32] - The height of the Render Texture. * @property {string} [key] - The texture key to make the RenderTexture from. * @property {string} [frame] - the frame to make the RenderTexture from. - * + * * @return {Phaser.GameObjects.RenderTexture} The Game Object that was created. */ GameObjectFactory.register('renderTexture', function (x, y, width, height, key, frame) @@ -61721,12 +62362,13 @@ GameObjectFactory.register('renderTexture', function (x, y, width, height, key, /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -61753,7 +62395,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -61826,7 +62468,7 @@ module.exports = RenderTextureWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -62952,7 +63594,7 @@ module.exports = Rope; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -62981,7 +63623,7 @@ module.exports = RopeCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -63024,11 +63666,6 @@ GameObjectCreator.register('rope', function (config, addToScene) BuildGameObject(this.scene, rope, config); - if (!config.add) - { - this.updateList.add(rope); - } - return rope; }); @@ -63042,7 +63679,7 @@ GameObjectCreator.register('rope', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -63085,12 +63722,13 @@ if (true) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -63117,7 +63755,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -63232,7 +63870,7 @@ module.exports = RopeWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -64465,7 +65103,7 @@ module.exports = Shader; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -64494,7 +65132,7 @@ module.exports = ShaderCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -64548,7 +65186,7 @@ GameObjectCreator.register('shader', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -64590,12 +65228,13 @@ if (true) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -64622,7 +65261,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -64685,7 +65324,7 @@ module.exports = ShaderWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -64748,7 +65387,7 @@ module.exports = FillPathWebGL; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -64786,7 +65425,7 @@ module.exports = FillStyleCanvas; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -64825,7 +65464,7 @@ module.exports = LineStyleCanvas; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -65249,7 +65888,7 @@ module.exports = Shape; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -65323,7 +65962,7 @@ module.exports = StrokePathWebGL; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -65341,14 +65980,14 @@ var Shape = __webpack_require__(91461); * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * When it renders it displays an arc shape. You can control the start and end angles of the arc, * as well as if the angles are winding clockwise or anti-clockwise. With the default settings * it renders as a complete circle. By changing the angles you can create other arc shapes, * such as half-circles. - * + * * Arcs also have an `iterations` property and corresponding `setIterations` method. This allows * you to control how smooth the shape renders in WebGL, by controlling the number of iterations * that take place during construction. @@ -65572,7 +66211,7 @@ var Arc = new Class({ * * @method Phaser.GameObjects.Arc#setRadius * @since 3.13.0 - * + * * @param {number} value - The value to set the radius to. * * @return {this} This Game Object instance. @@ -65592,7 +66231,7 @@ var Arc = new Class({ * * @method Phaser.GameObjects.Arc#setIterations * @since 3.13.0 - * + * * @param {number} value - The value to set the iterations to. * * @return {this} This Game Object instance. @@ -65612,7 +66251,7 @@ var Arc = new Class({ * * @method Phaser.GameObjects.Arc#setStartAngle * @since 3.13.0 - * + * * @param {number} value - The value to set the starting angle to. * * @return {this} This Game Object instance. @@ -65635,7 +66274,7 @@ var Arc = new Class({ * * @method Phaser.GameObjects.Arc#setEndAngle * @since 3.13.0 - * + * * @param {number} value - The value to set the ending angle to. * * @return {this} This Game Object instance. @@ -65733,7 +66372,7 @@ module.exports = Arc; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -65811,7 +66450,7 @@ module.exports = ArcCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -65822,14 +66461,14 @@ var GameObjectFactory = __webpack_require__(61286); * Creates a new Arc Shape Game Object and adds it to the Scene. * * Note: This method will only be available if the Arc Game Object has been built into Phaser. - * + * * The Arc Shape is a Game Object that can be added to a Scene, Group or Container. You can * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * When it renders it displays an arc shape. You can control the start and end angles of the arc, * as well as if the angles are winding clockwise or anti-clockwise. With the default settings * it renders as a complete circle. By changing the angles you can create other arc shapes, @@ -65856,7 +66495,7 @@ GameObjectFactory.register('arc', function (x, y, radius, startAngle, endAngle, /** * Creates a new Circle Shape Game Object and adds it to the Scene. - * + * * A Circle is an Arc with no defined start and end angle, making it render as a complete circle. * * Note: This method will only be available if the Arc Game Object has been built into Phaser. @@ -65885,12 +66524,13 @@ GameObjectFactory.register('circle', function (x, y, radius, fillColor, fillAlph /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -65917,7 +66557,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -65979,7 +66619,7 @@ module.exports = ArcWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -65995,12 +66635,12 @@ var Shape = __webpack_require__(91461); * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * To render a Curve Shape you must first create a `Phaser.Curves.Curve` object, then pass it to * the Curve Shape in the constructor. - * + * * The Curve shape also has a `smoothness` property and corresponding `setSmoothness` method. * This allows you to control how smooth the shape renders in WebGL, by controlling the number of iterations * that take place during construction. Increase and decrease the default value for smoother, or more @@ -66102,7 +66742,7 @@ var Curve = new Class({ * * @method Phaser.GameObjects.Curve#setSmoothness * @since 3.13.0 - * + * * @param {number} value - The value to set the smoothness to. * * @return {this} This Game Object instance. @@ -66162,7 +66802,7 @@ module.exports = Curve; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -66252,7 +66892,7 @@ module.exports = CurveCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -66263,17 +66903,17 @@ var Curve = __webpack_require__(15220); * Creates a new Curve Shape Game Object and adds it to the Scene. * * Note: This method will only be available if the Curve Game Object has been built into Phaser. - * + * * The Curve Shape is a Game Object that can be added to a Scene, Group or Container. You can * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * To render a Curve Shape you must first create a `Phaser.Curves.Curve` object, then pass it to * the Curve Shape in the constructor. - * + * * The Curve shape also has a `smoothness` property and corresponding `setSmoothness` method. * This allows you to control how smooth the shape renders in WebGL, by controlling the number of iterations * that take place during construction. Increase and decrease the default value for smoother, or more @@ -66303,12 +66943,13 @@ GameObjectFactory.register('curve', function (x, y, curve, fillColor, fillAlpha) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -66335,7 +66976,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -66397,7 +67038,7 @@ module.exports = CurveWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -66413,13 +67054,13 @@ var Shape = __webpack_require__(91461); * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * When it renders it displays an ellipse shape. You can control the width and height of the ellipse. * If the width and height match it will render as a circle. If the width is less than the height, * it will look more like an egg shape. - * + * * The Ellipse shape also has a `smoothness` property and corresponding `setSmoothness` method. * This allows you to control how smooth the shape renders in WebGL, by controlling the number of iterations * that take place during construction. Increase and decrease the default value for smoother, or more @@ -66514,7 +67155,7 @@ var Ellipse = new Class({ * * @method Phaser.GameObjects.Ellipse#setSize * @since 3.13.0 - * + * * @param {number} width - The width of the ellipse. * @param {number} height - The height of the ellipse. * @@ -66537,7 +67178,7 @@ var Ellipse = new Class({ * * @method Phaser.GameObjects.Ellipse#setSmoothness * @since 3.13.0 - * + * * @param {number} value - The value to set the smoothness to. * * @return {this} This Game Object instance. @@ -66588,7 +67229,7 @@ module.exports = Ellipse; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -66675,7 +67316,7 @@ module.exports = EllipseCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -66686,18 +67327,18 @@ var GameObjectFactory = __webpack_require__(61286); * Creates a new Ellipse Shape Game Object and adds it to the Scene. * * Note: This method will only be available if the Ellipse Game Object has been built into Phaser. - * + * * The Ellipse Shape is a Game Object that can be added to a Scene, Group or Container. You can * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * When it renders it displays an ellipse shape. You can control the width and height of the ellipse. * If the width and height match it will render as a circle. If the width is less than the height, * it will look more like an egg shape. - * + * * The Ellipse shape also has a `smoothness` property and corresponding `setSmoothness` method. * This allows you to control how smooth the shape renders in WebGL, by controlling the number of iterations * that take place during construction. Increase and decrease the default value for smoother, or more @@ -66728,12 +67369,13 @@ GameObjectFactory.register('ellipse', function (x, y, width, height, fillColor, /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -66760,7 +67402,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -66822,7 +67464,7 @@ module.exports = EllipseWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -67102,7 +67744,7 @@ module.exports = Grid; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -67293,7 +67935,7 @@ module.exports = GridCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -67304,14 +67946,14 @@ var Grid = __webpack_require__(39169); * Creates a new Grid Shape Game Object and adds it to the Scene. * * Note: This method will only be available if the Grid Game Object has been built into Phaser. - * + * * The Grid Shape is a Game Object that can be added to a Scene, Group or Container. You can * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports only fill colors and cannot be stroked. - * + * * A Grid Shape allows you to display a grid in your game, where you can control the size of the * grid as well as the width and height of the grid cells. You can set a fill color for each grid * cell as well as an alternate fill color. When the alternate fill color is set then the grid @@ -67349,12 +67991,13 @@ GameObjectFactory.register('grid', function (x, y, width, height, cellWidth, cel /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -67381,7 +68024,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -67583,7 +68226,7 @@ module.exports = GridWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -67597,13 +68240,13 @@ var Shape = __webpack_require__(91461); * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports only fill colors and cannot be stroked. - * + * * An IsoBox is an 'isometric' rectangle. Each face of it has a different fill color. You can set * the color of the top, left and right faces of the rectangle respectively. You can also choose * which of the faces are rendered via the `showTop`, `showLeft` and `showRight` properties. - * + * * You cannot view an IsoBox from under-neath, however you can change the 'angle' by setting * the `projection` property. * @@ -67725,7 +68368,7 @@ var IsoBox = new Class({ * * @method Phaser.GameObjects.IsoBox#setProjection * @since 3.13.0 - * + * * @param {number} value - The value to set the projection to. * * @return {this} This Game Object instance. @@ -67743,7 +68386,7 @@ var IsoBox = new Class({ * * @method Phaser.GameObjects.IsoBox#setFaces * @since 3.13.0 - * + * * @param {boolean} [showTop=true] - Show the top-face of the iso box. * @param {boolean} [showLeft=true] - Show the left-face of the iso box. * @param {boolean} [showRight=true] - Show the right-face of the iso box. @@ -67769,7 +68412,7 @@ var IsoBox = new Class({ * * @method Phaser.GameObjects.IsoBox#setFillStyle * @since 3.13.0 - * + * * @param {number} [fillTop] - The color used to fill the top of the iso box. * @param {number} [fillLeft] - The color used to fill in the left-facing side of the iso box. * @param {number} [fillRight] - The color used to fill in the right-facing side of the iso box. @@ -67799,7 +68442,7 @@ module.exports = IsoBox; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -67902,7 +68545,7 @@ module.exports = IsoBoxCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -67913,18 +68556,18 @@ var IsoBox = __webpack_require__(4415); * Creates a new IsoBox Shape Game Object and adds it to the Scene. * * Note: This method will only be available if the IsoBox Game Object has been built into Phaser. - * + * * The IsoBox Shape is a Game Object that can be added to a Scene, Group or Container. You can * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports only fill colors and cannot be stroked. - * + * * An IsoBox is an 'isometric' rectangle. Each face of it has a different fill color. You can set * the color of the top, left and right faces of the rectangle respectively. You can also choose * which of the faces are rendered via the `showTop`, `showLeft` and `showRight` properties. - * + * * You cannot view an IsoBox from under-neath, however you can change the 'angle' by setting * the `projection` property. * @@ -67954,12 +68597,13 @@ GameObjectFactory.register('isobox', function (x, y, size, height, fillTop, fill /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -67986,7 +68630,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -68123,7 +68767,7 @@ module.exports = IsoBoxWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -68137,13 +68781,13 @@ var Shape = __webpack_require__(91461); * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports only fill colors and cannot be stroked. - * + * * An IsoTriangle is an 'isometric' triangle. Think of it like a pyramid. Each face has a different * fill color. You can set the color of the top, left and right faces of the triangle respectively * You can also choose which of the faces are rendered via the `showTop`, `showLeft` and `showRight` properties. - * + * * You cannot view an IsoTriangle from under-neath, however you can change the 'angle' by setting * the `projection` property. The `reversed` property controls if the IsoTriangle is rendered upside * down or not. @@ -68278,7 +68922,7 @@ var IsoTriangle = new Class({ * * @method Phaser.GameObjects.IsoTriangle#setProjection * @since 3.13.0 - * + * * @param {number} value - The value to set the projection to. * * @return {this} This Game Object instance. @@ -68296,7 +68940,7 @@ var IsoTriangle = new Class({ * * @method Phaser.GameObjects.IsoTriangle#setReversed * @since 3.13.0 - * + * * @param {boolean} reversed - Sets if the iso triangle will be rendered upside down or not. * * @return {this} This Game Object instance. @@ -68314,7 +68958,7 @@ var IsoTriangle = new Class({ * * @method Phaser.GameObjects.IsoTriangle#setFaces * @since 3.13.0 - * + * * @param {boolean} [showTop=true] - Show the top-face of the iso triangle (only if `reversed` is true) * @param {boolean} [showLeft=true] - Show the left-face of the iso triangle. * @param {boolean} [showRight=true] - Show the right-face of the iso triangle. @@ -68340,7 +68984,7 @@ var IsoTriangle = new Class({ * * @method Phaser.GameObjects.IsoTriangle#setFillStyle * @since 3.13.0 - * + * * @param {number} [fillTop] - The color used to fill the top of the iso triangle. * @param {number} [fillLeft] - The color used to fill in the left-facing side of the iso triangle. * @param {number} [fillRight] - The color used to fill in the right-facing side of the iso triangle. @@ -68370,7 +69014,7 @@ module.exports = IsoTriangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -68486,7 +69130,7 @@ module.exports = IsoTriangleCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -68497,18 +69141,18 @@ var IsoTriangle = __webpack_require__(65159); * Creates a new IsoTriangle Shape Game Object and adds it to the Scene. * * Note: This method will only be available if the IsoTriangle Game Object has been built into Phaser. - * + * * The IsoTriangle Shape is a Game Object that can be added to a Scene, Group or Container. You can * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports only fill colors and cannot be stroked. - * + * * An IsoTriangle is an 'isometric' triangle. Think of it like a pyramid. Each face has a different * fill color. You can set the color of the top, left and right faces of the triangle respectively * You can also choose which of the faces are rendered via the `showTop`, `showLeft` and `showRight` properties. - * + * * You cannot view an IsoTriangle from under-neath, however you can change the 'angle' by setting * the `projection` property. The `reversed` property controls if the IsoTriangle is rendered upside * down or not. @@ -68540,12 +69184,13 @@ GameObjectFactory.register('isotriangle', function (x, y, size, height, reversed /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -68572,7 +69217,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -68729,7 +69374,7 @@ module.exports = IsoTriangleWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -68897,7 +69542,7 @@ module.exports = Line; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -68956,7 +69601,7 @@ module.exports = LineCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -68967,18 +69612,18 @@ var Line = __webpack_require__(579); * Creates a new Line Shape Game Object and adds it to the Scene. * * Note: This method will only be available if the Line Game Object has been built into Phaser. - * + * * The Line Shape is a Game Object that can be added to a Scene, Group or Container. You can * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports only stroke colors and cannot be filled. - * + * * A Line Shape allows you to draw a line between two points in your game. You can control the * stroke color and thickness of the line. In WebGL only you can also specify a different * thickness for the start and end of the line, allowing you to render lines that taper-off. - * + * * If you need to draw multiple lines in a sequence you may wish to use the Polygon Shape instead. * * @method Phaser.GameObjects.GameObjectFactory#line @@ -69008,12 +69653,13 @@ GameObjectFactory.register('line', function (x, y, x1, y1, x2, y2, strokeColor, /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -69040,7 +69686,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -69118,7 +69764,7 @@ module.exports = LineWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -69136,9 +69782,9 @@ var Smooth = __webpack_require__(18974); * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * The Polygon Shape is created by providing a list of points, which are then used to create an * internal Polygon geometry object. The points can be set from a variety of formats: * @@ -69147,7 +69793,7 @@ var Smooth = __webpack_require__(18974); * - An array of objects with public x/y properties: `[obj1, obj2, ...]` * - An array of paired numbers that represent point coordinates: `[x1,y1, x2,y2, ...]` * - An array of arrays with two elements representing x/y coordinates: `[[x1, y1], [x2, y2], ...]` - * + * * By default the `x` and `y` coordinates of this Shape refer to the center of it. However, depending * on the coordinates of the points provided, the final shape may be rendered offset from its origin. * @@ -69202,7 +69848,7 @@ var Polygon = new Class({ * * @method Phaser.GameObjects.Polygon#smooth * @since 3.13.0 - * + * * @param {number} [iterations=1] - The number of times to apply the polygon smoothing. * * @return {this} This Game Object instance. @@ -69219,6 +69865,42 @@ var Polygon = new Class({ return this.updateData(); }, + /** + * Sets this Polygon to the given points. + * + * The points can be set from a variety of formats: + * + * - A string containing paired values separated by a single space: `'40 0 40 20 100 20 100 80 40 80 40 100 0 50'` + * - An array of Point objects: `[new Phaser.Point(x1, y1), ...]` + * - An array of objects with public x/y properties: `[obj1, obj2, ...]` + * - An array of paired numbers that represent point coordinates: `[x1,y1, x2,y2, ...]` + * - An array of arrays with two elements representing x/y coordinates: `[[x1, y1], [x2, y2], ...]` + * + * Calling this method will reset the size (width, height) and display origin of this Shape. + * + * It also runs both GetAABB and EarCut on the given points, so please be careful not to do this + * at a high frequency, or with too many points. + * + * @method Phaser.GameObjects.Polygon#setTo + * @since 3.60.0 + * + * @param {(string|number[]|Phaser.Types.Math.Vector2Like[])} [points] - Points defining the perimeter of this polygon. Please check function description above for the different supported formats. + * + * @return {this} This Game Object instance. + */ + setTo: function (points) + { + this.geom.setTo(points); + + var bounds = GetAABB(this.geom); + + this.setSize(bounds.width, bounds.height); + + this.updateDisplayOrigin(); + + return this.updateData(); + }, + /** * Internal method that updates the data and path values. * @@ -69258,7 +69940,7 @@ module.exports = Polygon; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -69314,7 +69996,10 @@ var PolygonCanvasRenderer = function (renderer, src, camera, parentMatrix) ctx.lineTo(px2, py2); } - ctx.closePath(); + if (src.closePath) + { + ctx.closePath(); + } if (src.isFilled) { @@ -69345,7 +70030,7 @@ module.exports = PolygonCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -69354,16 +70039,16 @@ var Polygon = __webpack_require__(91249); /** * Creates a new Polygon Shape Game Object and adds it to the Scene. - * + * * Note: This method will only be available if the Polygon Game Object has been built into Phaser. - * + * * The Polygon Shape is a Game Object that can be added to a Scene, Group or Container. You can * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * The Polygon Shape is created by providing a list of points, which are then used to create an * internal Polygon geometry object. The points can be set from a variety of formats: * @@ -69371,7 +70056,7 @@ var Polygon = __webpack_require__(91249); * - An array of objects with public x/y properties: `[obj1, obj2, ...]` * - An array of paired numbers that represent point coordinates: `[x1,y1, x2,y2, ...]` * - An array of arrays with two elements representing x/y coordinates: `[[x1, y1], [x2, y2], ...]` - * + * * By default the `x` and `y` coordinates of this Shape refer to the center of it. However, depending * on the coordinates of the points provided, the final shape may be rendered offset from its origin. * @@ -69399,12 +70084,13 @@ GameObjectFactory.register('polygon', function (x, y, points, fillColor, fillAlp /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -69431,7 +70117,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -69493,7 +70179,7 @@ module.exports = PolygonWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -69559,14 +70245,9 @@ var Rectangle = new Class({ }, /** - * Sets the internal size of this Game Object, as used for frame or physics body creation. + * Sets the internal size of this Rectangle, as used for frame or physics body creation. * - * This will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or call the - * `setDisplaySize` method, which is the same thing as changing the scale but allows you - * to do so by giving pixel values. - * - * If you have enabled this Game Object for input, changing the size will _not_ change the + * If you have assigned a custom input hit area for this Rectangle, changing the Rectangle size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * * @method Phaser.GameObjects.Rectangle#setSize @@ -69647,7 +70328,7 @@ module.exports = Rectangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -69723,7 +70404,7 @@ module.exports = RectangleCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -69734,14 +70415,14 @@ var Rectangle = __webpack_require__(517); * Creates a new Rectangle Shape Game Object and adds it to the Scene. * * Note: This method will only be available if the Rectangle Game Object has been built into Phaser. - * + * * The Rectangle Shape is a Game Object that can be added to a Scene, Group or Container. You can * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * You can change the size of the rectangle by changing the `width` and `height` properties. * * @method Phaser.GameObjects.GameObjectFactory#rectangle @@ -69769,12 +70450,13 @@ GameObjectFactory.register('rectangle', function (x, y, width, height, fillColor /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -69801,7 +70483,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -69875,7 +70557,7 @@ module.exports = RectangleWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -69890,14 +70572,14 @@ var Shape = __webpack_require__(91461); * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * As the name implies, the Star shape will display a star in your game. You can control several * aspects of it including the number of points that constitute the star. The default is 5. If * you change it to 4 it will render as a diamond. If you increase them, you'll get a more spiky * star shape. - * + * * You can also control the inner and outer radius, which is how 'long' each point of the star is. * Modify these values to create more interesting shapes. * @@ -69987,7 +70669,7 @@ var Star = new Class({ * * @method Phaser.GameObjects.Star#setPoints * @since 3.13.0 - * + * * @param {number} value - The amount of points the Star will have. * * @return {this} This Game Object instance. @@ -70005,7 +70687,7 @@ var Star = new Class({ * * @method Phaser.GameObjects.Star#setInnerRadius * @since 3.13.0 - * + * * @param {number} value - The amount to set the inner radius to. * * @return {this} This Game Object instance. @@ -70023,7 +70705,7 @@ var Star = new Class({ * * @method Phaser.GameObjects.Star#setOuterRadius * @since 3.13.0 - * + * * @param {number} value - The amount to set the outer radius to. * * @return {this} This Game Object instance. @@ -70130,7 +70812,7 @@ var Star = new Class({ // So origin 0.5 = the center of the star var x = outerRadius; var y = outerRadius; - + path.push(x, y + -outerRadius); for (var i = 0; i < points; i++) @@ -70140,7 +70822,7 @@ var Star = new Class({ rot += step; path.push(x + Math.cos(rot) * innerRadius, y + Math.sin(rot) * innerRadius); - + rot += step; } @@ -70164,7 +70846,7 @@ module.exports = Star; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -70251,7 +70933,7 @@ module.exports = StarCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -70262,19 +70944,19 @@ var GameObjectFactory = __webpack_require__(61286); * Creates a new Star Shape Game Object and adds it to the Scene. * * Note: This method will only be available if the Star Game Object has been built into Phaser. - * + * * The Star Shape is a Game Object that can be added to a Scene, Group or Container. You can * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * As the name implies, the Star shape will display a star in your game. You can control several * aspects of it including the number of points that constitute the star. The default is 5. If * you change it to 4 it will render as a diamond. If you increase them, you'll get a more spiky * star shape. - * + * * You can also control the inner and outer radius, which is how 'long' each point of the star is. * Modify these values to create more interesting shapes. * @@ -70304,12 +70986,13 @@ GameObjectFactory.register('star', function (x, y, points, innerRadius, outerRad /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -70336,7 +71019,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -70398,7 +71081,7 @@ module.exports = StarWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -70413,9 +71096,9 @@ var TriangleRender = __webpack_require__(70498); * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * The Triangle consists of 3 lines, joining up to form a triangular shape. You can control the * position of each point of these lines. The triangle is always closed and cannot have an open * face. If you require that, consider using a Polygon instead. @@ -70542,7 +71225,7 @@ module.exports = Triangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -70619,7 +71302,7 @@ module.exports = TriangleCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -70630,14 +71313,14 @@ var Triangle = __webpack_require__(21873); * Creates a new Triangle Shape Game Object and adds it to the Scene. * * Note: This method will only be available if the Triangle Game Object has been built into Phaser. - * + * * The Triangle Shape is a Game Object that can be added to a Scene, Group or Container. You can * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * The Triangle consists of 3 lines, joining up to form a triangular shape. You can control the * position of each point of these lines. The triangle is always closed and cannot have an open * face. If you require that, consider using a Polygon instead. @@ -70671,12 +71354,13 @@ GameObjectFactory.register('triangle', function (x, y, x1, y1, x2, y2, x3, y3, f /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -70703,7 +71387,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -70788,7 +71472,7 @@ module.exports = TriangleWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -71134,7 +71818,7 @@ var Sprite = new Class({ * @method Phaser.GameObjects.Sprite#chain * @since 3.50.0 * - * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig|string[]|Phaser.Animations.Animation[]|Phaser.Types.Animations.PlayAnimationConfig[])} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object, or an array of them. + * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig|string[]|Phaser.Animations.Animation[]|Phaser.Types.Animations.PlayAnimationConfig[])} [key] - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object, or an array of them. * * @return {this} This Game Object. */ @@ -71270,7 +71954,7 @@ module.exports = Sprite; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -71305,7 +71989,7 @@ module.exports = SpriteCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -71359,7 +72043,7 @@ GameObjectCreator.register('sprite', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -71406,12 +72090,13 @@ GameObjectFactory.register('sprite', function (x, y, key, frame) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -71438,7 +72123,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -71473,7 +72158,7 @@ module.exports = SpriteWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -71556,7 +72241,7 @@ module.exports = GetTextSize; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -71706,7 +72391,7 @@ module.exports = MeasureText; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -72321,6 +73006,47 @@ var Text = new Class({ return this; }, + /** + * Appends the given text to the content already being displayed by this Text object. + * + * An array of strings will be joined with `\n` line breaks. + * + * @method Phaser.GameObjects.Text#appendText + * @since 3.60.0 + * + * @param {(string|string[])} value - The string, or array of strings, to be appended to the existing content of this Text object. + * @param {boolean} [addCR=true] - Insert a carriage-return before the string value. + * + * @return {this} This Text object. + */ + appendText: function (value, addCR) + { + if (addCR === undefined) { addCR = true; } + + if (!value && value !== 0) + { + value = ''; + } + + if (Array.isArray(value)) + { + value = value.join('\n'); + } + + value = value.toString(); + + var newText = this._text.concat((addCR) ? '\n' + value : value); + + if (newText !== this._text) + { + this._text = newText; + + this.updateText(); + } + + return this; + }, + /** * Set the text style. * @@ -72922,7 +73648,7 @@ var Text = new Class({ if (style.rtl) { - linePositionX = w - linePositionX; + linePositionX = w - linePositionX - padding.left - padding.right; } else if (style.align === 'right') { @@ -73137,7 +73863,7 @@ module.exports = Text; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -73177,7 +73903,7 @@ module.exports = TextCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -73265,7 +73991,7 @@ GameObjectCreator.register('text', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -73331,12 +74057,13 @@ GameObjectFactory.register('text', function (x, y, text, style) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -73363,7 +74090,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -73721,23 +74448,6 @@ var TextStyle = new Class({ // Set to defaults + user style this.setStyle(style, false, true); - - var metrics = GetValue(style, 'metrics', false); - - // Provide optional TextMetrics in the style object to avoid the canvas look-up / scanning - // Doing this is reset if you then change the font of this TextStyle after creation - if (metrics) - { - this.metrics = { - ascent: GetValue(metrics, 'ascent', 0), - descent: GetValue(metrics, 'descent', 0), - fontSize: GetValue(metrics, 'fontSize', 0) - }; - } - else - { - this.metrics = MeasureText(this); - } }, /** @@ -73806,9 +74516,26 @@ var TextStyle = new Class({ this.color = fill; } + var metrics = GetValue(style, 'metrics', false); + + // Provide optional TextMetrics in the style object to avoid the canvas look-up / scanning + // Doing this is reset if you then change the font of this TextStyle after creation + if (metrics) + { + this.metrics = { + ascent: GetValue(metrics, 'ascent', 0), + descent: GetValue(metrics, 'descent', 0), + fontSize: GetValue(metrics, 'fontSize', 0) + }; + } + else if (updateText || !this.metrics) + { + this.metrics = MeasureText(this); + } + if (updateText) { - return this.update(true); + return this.parent.updateText(); } else { @@ -74470,7 +75197,7 @@ module.exports = TextStyle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -74542,7 +75269,7 @@ module.exports = TextWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -74646,6 +75373,13 @@ var TileSprite = new Class({ var displayTexture = scene.sys.textures.get(textureKey); var displayFrame = displayTexture.get(frameKey); + if (displayFrame.source.compressionAlgorithm) + { + console.warn('TileSprite cannot use compressed textures'); + displayTexture = scene.sys.textures.get('__MISSING'); + displayFrame = displayTexture.get(); + } + if (!width || !height) { width = displayFrame.width; @@ -75075,7 +75809,6 @@ var TileSprite = new Class({ this.dirty = true; this.fillPattern = null; this.fillPattern = renderer.createTexture2D(0, gl.LINEAR, gl.LINEAR, gl.REPEAT, gl.REPEAT, gl.RGBA, this.fillCanvas, this.potWidth, this.potHeight); - }, /** @@ -75213,7 +75946,7 @@ module.exports = TileSprite; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -75250,7 +75983,7 @@ module.exports = TileSpriteCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -75303,7 +76036,7 @@ GameObjectCreator.register('tileSprite', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -75348,12 +76081,13 @@ GameObjectFactory.register('tileSprite', function (x, y, width, height, key, fra /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -75380,7 +76114,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -75456,7 +76190,7 @@ module.exports = TileSpriteWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -75533,6 +76267,7 @@ var MATH_CONST = __webpack_require__(83392); * @extends Phaser.GameObjects.Components.BlendMode * @extends Phaser.GameObjects.Components.Depth * @extends Phaser.GameObjects.Components.Flip + * @extends Phaser.GameObjects.Components.FX * @extends Phaser.GameObjects.Components.GetBounds * @extends Phaser.GameObjects.Components.Mask * @extends Phaser.GameObjects.Components.Origin @@ -75558,6 +76293,7 @@ var Video = new Class({ Components.BlendMode, Components.Depth, Components.Flip, + Components.FX, Components.GetBounds, Components.Mask, Components.Origin, @@ -77311,7 +78047,7 @@ module.exports = Video; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -77349,7 +78085,7 @@ module.exports = VideoCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -77386,11 +78122,6 @@ GameObjectCreator.register('video', function (config, addToScene) BuildGameObject(this.scene, video, config); - if (!config.add) - { - this.updateList.add(video); - } - return video; }); @@ -77404,7 +78135,7 @@ GameObjectCreator.register('video', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -77438,12 +78169,13 @@ GameObjectFactory.register('video', function (x, y, key) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -77470,7 +78202,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -77508,7 +78240,7 @@ module.exports = VideoWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -77830,7 +78562,7 @@ module.exports = Zone; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -77870,7 +78602,7 @@ GameObjectCreator.register('zone', function (config) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -77889,7 +78621,7 @@ var GameObjectFactory = __webpack_require__(61286); * @param {number} y - The vertical position of this Game Object in the world. * @param {number} width - The width of the Game Object. * @param {number} height - The height of the Game Object. - * + * * @return {Phaser.GameObjects.Zone} The Game Object that was created. */ GameObjectFactory.register('zone', function (x, y, width, height) @@ -77898,9 +78630,9 @@ GameObjectFactory.register('zone', function (x, y, width, height) }); // When registering a factory function 'this' refers to the GameObjectFactory context. -// +// // There are several properties available to use: -// +// // this.scene - a reference to the Scene that owns the GameObjectFactory // this.displayList - a reference to the Display List the Scene owns // this.updateList - a reference to the Update List the Scene owns @@ -77913,7 +78645,7 @@ GameObjectFactory.register('zone', function (x, y, width, height) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -77942,7 +78674,7 @@ module.exports = Area; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78318,7 +79050,7 @@ module.exports = Circle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78347,7 +79079,7 @@ module.exports = Circumference; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78387,7 +79119,7 @@ module.exports = CircumferencePoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78418,7 +79150,7 @@ module.exports = Clone; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78460,7 +79192,7 @@ module.exports = Contains; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78492,7 +79224,7 @@ module.exports = ContainsPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78529,7 +79261,7 @@ module.exports = ContainsRect; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78562,7 +79294,7 @@ module.exports = CopyFrom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78597,7 +79329,7 @@ module.exports = Equals; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78638,7 +79370,7 @@ module.exports = GetBounds; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78682,7 +79414,7 @@ module.exports = GetPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78735,7 +79467,7 @@ module.exports = GetPoints; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78771,7 +79503,7 @@ module.exports = Offset; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78806,7 +79538,7 @@ module.exports = OffsetPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78851,7 +79583,7 @@ module.exports = Random; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78883,7 +79615,7 @@ module.exports = Circle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78891,7 +79623,7 @@ var GEOM_CONST = { /** * A Circle Geometry object type. - * + * * @name Phaser.Geom.CIRCLE * @type {number} * @since 3.19.0 @@ -78900,7 +79632,7 @@ var GEOM_CONST = { /** * An Ellipse Geometry object type. - * + * * @name Phaser.Geom.ELLIPSE * @type {number} * @since 3.19.0 @@ -78909,7 +79641,7 @@ var GEOM_CONST = { /** * A Line Geometry object type. - * + * * @name Phaser.Geom.LINE * @type {number} * @since 3.19.0 @@ -78918,7 +79650,7 @@ var GEOM_CONST = { /** * A Point Geometry object type. - * + * * @name Phaser.Geom.POINT * @type {number} * @since 3.19.0 @@ -78927,7 +79659,7 @@ var GEOM_CONST = { /** * A Polygon Geometry object type. - * + * * @name Phaser.Geom.POLYGON * @type {number} * @since 3.19.0 @@ -78936,7 +79668,7 @@ var GEOM_CONST = { /** * A Rectangle Geometry object type. - * + * * @name Phaser.Geom.RECTANGLE * @type {number} * @since 3.19.0 @@ -78945,7 +79677,7 @@ var GEOM_CONST = { /** * A Triangle Geometry object type. - * + * * @name Phaser.Geom.TRIANGLE * @type {number} * @since 3.19.0 @@ -78964,7 +79696,7 @@ module.exports = GEOM_CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78999,7 +79731,7 @@ module.exports = Area; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79032,7 +79764,7 @@ module.exports = Circumference; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79075,7 +79807,7 @@ module.exports = CircumferencePoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79106,7 +79838,7 @@ module.exports = Clone; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79149,7 +79881,7 @@ module.exports = Contains; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79181,7 +79913,7 @@ module.exports = ContainsPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79218,7 +79950,7 @@ module.exports = ContainsRect; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79251,7 +79983,7 @@ module.exports = CopyFrom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79634,7 +80366,7 @@ module.exports = Ellipse; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79670,7 +80402,7 @@ module.exports = Equals; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79711,7 +80443,7 @@ module.exports = GetBounds; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79755,7 +80487,7 @@ module.exports = GetPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79810,7 +80542,7 @@ module.exports = GetPoints; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79846,7 +80578,7 @@ module.exports = Offset; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79881,7 +80613,7 @@ module.exports = OffsetPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79923,7 +80655,7 @@ module.exports = Random; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79955,7 +80687,7 @@ module.exports = Ellipse; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79993,7 +80725,7 @@ module.exports = Geom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80025,7 +80757,7 @@ module.exports = CircleToCircle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80081,7 +80813,7 @@ module.exports = CircleToRectangle; /** * @author Florian Vazelle * @author Geoffrey Glaive - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80176,7 +80908,7 @@ module.exports = GetCircleToCircle; /** * @author Florian Vazelle * @author Geoffrey Glaive - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80227,7 +80959,7 @@ module.exports = GetCircleToRectangle; /** * @author Florian Vazelle * @author Geoffrey Glaive - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80319,15 +81051,15 @@ module.exports = GetLineToCircle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var Vector3 = __webpack_require__(70015); /** - * Checks for intersection between the two line segments and returns the intersection point as a Vector3, - * or `null` if the lines are parallel, or do not intersect. + * Checks for intersection between the two line segments, or a ray and a line segment, + * and returns the intersection point as a Vector3, or `null` if the lines are parallel, or do not intersect. * * The `z` property of the Vector3 contains the intersection distance, which can be used to find * the closest intersecting point from a group of line segments. @@ -80335,14 +81067,17 @@ var Vector3 = __webpack_require__(70015); * @function Phaser.Geom.Intersects.GetLineToLine * @since 3.50.0 * - * @param {Phaser.Geom.Line} line1 - The first line segment to check. + * @param {Phaser.Geom.Line} line1 - The first line segment, or a ray, to check. * @param {Phaser.Geom.Line} line2 - The second line segment to check. + * @param {boolean} [isRay=false] - Is `line1` a ray or a line segment? * @param {Phaser.Math.Vector3} [out] - A Vector3 to store the intersection results in. * * @return {Phaser.Math.Vector3} A Vector3 containing the intersection results, or `null`. */ -var GetLineToLine = function (line1, line2, out) +var GetLineToLine = function (line1, line2, isRay, out) { + if (isRay === undefined) { isRay = false; } + var x1 = line1.x1; var y1 = line1.y1; var x2 = line1.x2; @@ -80370,13 +81105,35 @@ var GetLineToLine = function (line1, line2, out) return false; } - var t = ((x3 - x1) * dy2 - (y3 - y1) * dx2) / denom; - var u = ((y1 - y3) * dx1 - (x1 - x3) * dy1) / denom; + var t; + var u; + var s; - // Intersects? - if (t < 0 || t > 1 || u < 0 || u > 1) + if (isRay) { - return null; + t = (dx1 * (y3 - y1) + dy1 * (x1 - x3)) / (dx2 * dy1 - dy2 * dx1); + u = (x3 + dx2 * t - x1) / dx1; + + // Intersects? + if (u < 0 || t < 0 || t > 1) + { + return null; + } + + s = u; + } + else + { + t = ((x3 - x1) * dy2 - (y3 - y1) * dx2) / denom; + u = ((y1 - y3) * dx1 - (x1 - x3) * dy1) / denom; + + // Intersects? + if (t < 0 || t > 1 || u < 0 || u > 1) + { + return null; + } + + s = t; } if (out === undefined) @@ -80385,9 +81142,9 @@ var GetLineToLine = function (line1, line2, out) } return out.set( - x1 + dx1 * t, - y1 + dy1 * t, - t + x1 + dx1 * s, + y1 + dy1 * s, + s ); }; @@ -80401,13 +81158,13 @@ module.exports = GetLineToLine; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Vector3 = __webpack_require__(70015); var GetLineToLine = __webpack_require__(96537); var Line = __webpack_require__(88829); +var Vector3 = __webpack_require__(70015); // Temp calculation segment var segment = new Line(); @@ -80429,14 +81186,16 @@ var tempIntersect = new Vector3(); * @function Phaser.Geom.Intersects.GetLineToPoints * @since 3.50.0 * - * @param {Phaser.Geom.Line} line - The line segment to check. + * @param {Phaser.Geom.Line} line - The line segment, or ray, to check. If a ray, set the `isRay` parameter to `true`. * @param {Phaser.Math.Vector2[] | Phaser.Geom.Point[]} points - An array of points to check. + * @param {boolean} [isRay=false] - Is `line` a ray or a line segment? * @param {Phaser.Math.Vector3} [out] - A Vector3 to store the intersection results in. * * @return {Phaser.Math.Vector3} A Vector3 containing the intersection results, or `null`. */ -var GetLineToPoints = function (line, points, out) +var GetLineToPoints = function (line, points, isRay, out) { + if (isRay === undefined) { isRay = false; } if (out === undefined) { out = new Vector3(); } var closestIntersect = false; @@ -80455,7 +81214,7 @@ var GetLineToPoints = function (line, points, out) prev = current; - if (GetLineToLine(line, segment, tempIntersect)) + if (GetLineToLine(line, segment, isRay, tempIntersect)) { if (!closestIntersect || tempIntersect.z < out.z) { @@ -80479,7 +81238,7 @@ module.exports = GetLineToPoints; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80504,13 +81263,14 @@ var tempIntersect = new Vector3(); * @function Phaser.Geom.Intersects.GetLineToPolygon * @since 3.50.0 * - * @param {Phaser.Geom.Line} line - The line segment to check. + * @param {Phaser.Geom.Line} line - The line segment, or ray, to check. If a ray, set the `isRay` parameter to `true`. * @param {Phaser.Geom.Polygon | Phaser.Geom.Polygon[]} polygons - A single polygon, or array of polygons, to check. + * @param {boolean} [isRay=false] - Is `line` a ray or a line segment? * @param {Phaser.Math.Vector4} [out] - A Vector4 to store the intersection results in. * * @return {Phaser.Math.Vector4} A Vector4 containing the intersection results, or `null`. */ -var GetLineToPolygon = function (line, polygons, out) +var GetLineToPolygon = function (line, polygons, isRay, out) { if (out === undefined) { out = new Vector4(); } @@ -80527,7 +81287,7 @@ var GetLineToPolygon = function (line, polygons, out) for (var i = 0; i < polygons.length; i++) { - if (GetLineToPoints(line, polygons[i].points, tempIntersect)) + if (GetLineToPoints(line, polygons[i].points, isRay, tempIntersect)) { if (!closestIntersect || tempIntersect.z < out.z) { @@ -80552,7 +81312,7 @@ module.exports = GetLineToPolygon; /** * @author Florian Vazelle * @author Geoffrey Glaive - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80612,7 +81372,7 @@ module.exports = GetLineToRectangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80633,7 +81393,7 @@ function CheckIntersects (angle, x, y, polygons, intersects) segment.setTo(x, y, x + dx, y + dy); - var closestIntersect = GetLineToPolygon(segment, polygons); + var closestIntersect = GetLineToPolygon(segment, polygons, true); if (closestIntersect) { @@ -80715,7 +81475,7 @@ module.exports = GetRaysFromPointToPolygon; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80724,9 +81484,9 @@ var RectangleToRectangle = __webpack_require__(90205); /** * Checks if two Rectangle shapes intersect and returns the area of this intersection as Rectangle object. - * + * * If optional `output` parameter is omitted, new Rectangle object is created and returned. If there is intersection, it will contain intersection area. If there is no intersection, it wil be empty Rectangle (all values set to zero). - * + * * If Rectangle object is passed as `output` and there is intersection, then intersection area data will be loaded into it and it will be returned. If there is no intersection, it will be returned without any change. * * @function Phaser.Geom.Intersects.GetRectangleIntersection @@ -80766,7 +81526,7 @@ module.exports = GetRectangleIntersection; /** * @author Florian Vazelle * @author Geoffrey Glaive - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80818,7 +81578,7 @@ module.exports = GetRectangleToRectangle; /** * @author Florian Vazelle * @author Geoffrey Glaive - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80867,7 +81627,7 @@ module.exports = GetRectangleToTriangle; /** * @author Florian Vazelle * @author Geoffrey Glaive - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80917,7 +81677,7 @@ module.exports = GetTriangleToCircle; /** * @author Florian Vazelle * @author Geoffrey Glaive - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80977,7 +81737,7 @@ module.exports = GetTriangleToLine; /** * @author Florian Vazelle * @author Geoffrey Glaive - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81026,7 +81786,7 @@ module.exports = GetTriangleToTriangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81090,10 +81850,10 @@ var LineToCircle = function (line, circle, nearest) nearest.x = line.x1 + px; nearest.y = line.y1 + py; - + // len2 of p var pLen2 = (px * px) + (py * py); - + return ( pLen2 <= dLen2 && ((px * dx) + (py * dy)) >= 0 && @@ -81111,7 +81871,7 @@ module.exports = LineToCircle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81188,7 +81948,7 @@ module.exports = LineToLine; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81291,13 +82051,13 @@ module.exports = LineToRectangle; /** * @author Richard Davey * @author Florian Mertens - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Checks if the a Point falls between the two end-points of a Line, based on the given line thickness. - * + * * Assumes that the line end points are circular, not square. * * @function Phaser.Geom.Intersects.PointToLine @@ -81361,7 +82121,7 @@ module.exports = PointToLine; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81403,7 +82163,7 @@ module.exports = PointToLineSegment; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81442,7 +82202,7 @@ module.exports = RectangleToRectangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81536,7 +82296,7 @@ module.exports = RectangleToTriangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81577,7 +82337,7 @@ module.exports = RectangleToValues; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81643,7 +82403,7 @@ module.exports = TriangleToCircle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81699,7 +82459,7 @@ module.exports = TriangleToLine; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81790,7 +82550,7 @@ module.exports = TriangleToTriangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81838,7 +82598,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81867,7 +82627,7 @@ module.exports = Angle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81942,7 +82702,7 @@ module.exports = BresenhamPoints; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81983,7 +82743,7 @@ module.exports = CenterOn; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82014,7 +82774,7 @@ module.exports = Clone; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82046,7 +82806,7 @@ module.exports = CopyFrom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82081,7 +82841,7 @@ module.exports = Equals; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82140,7 +82900,7 @@ module.exports = Extend; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82261,7 +83021,7 @@ module.exports = GetEasedPoints; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82301,7 +83061,7 @@ module.exports = GetMidPoint; /** * @author Richard Davey * @author Florian Mertens - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82356,7 +83116,7 @@ module.exports = GetNearestPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82401,7 +83161,7 @@ module.exports = GetNormal; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82441,7 +83201,7 @@ module.exports = GetPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82508,7 +83268,7 @@ module.exports = GetPoints; /** * @author Richard Davey * @author Florian Mertens - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82555,7 +83315,7 @@ module.exports = GetShortestDistance; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82584,7 +83344,7 @@ module.exports = Height; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82613,7 +83373,7 @@ module.exports = Length; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82951,7 +83711,7 @@ module.exports = Line; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82986,7 +83746,7 @@ module.exports = NormalAngle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83018,7 +83778,7 @@ module.exports = NormalX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83051,7 +83811,7 @@ module.exports = NormalY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83090,7 +83850,7 @@ module.exports = Offset; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83119,7 +83879,7 @@ module.exports = PerpSlope; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83160,7 +83920,7 @@ module.exports = Random; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83195,7 +83955,7 @@ module.exports = ReflectAngle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83232,7 +83992,7 @@ module.exports = Rotate; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83267,7 +84027,7 @@ module.exports = RotateAroundPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83316,7 +84076,7 @@ module.exports = RotateAroundXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83357,7 +84117,7 @@ module.exports = SetToAngle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83386,7 +84146,7 @@ module.exports = Slope; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83415,7 +84175,7 @@ module.exports = Width; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83461,7 +84221,7 @@ module.exports = Line; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -84026,7 +84786,7 @@ module.exports = Face; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -84269,7 +85029,7 @@ module.exports = GenerateGridVerts; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -84414,7 +85174,7 @@ module.exports = GenerateObjVerts; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -84606,7 +85366,7 @@ module.exports = GenerateVerts; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -84923,7 +85683,7 @@ module.exports = ParseObj; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85002,7 +85762,7 @@ module.exports = ParseObjMaterial; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85068,7 +85828,7 @@ module.exports = RotateFace; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85365,7 +86125,7 @@ module.exports = Vertex; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85396,7 +86156,7 @@ module.exports = Mesh; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85427,7 +86187,7 @@ module.exports = Ceil; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85458,7 +86218,7 @@ module.exports = Clone; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85490,7 +86250,7 @@ module.exports = CopyFrom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85520,7 +86280,7 @@ module.exports = Equals; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85551,7 +86311,7 @@ module.exports = Floor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85616,7 +86376,7 @@ module.exports = GetCentroid; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85645,7 +86405,7 @@ module.exports = GetMagnitude; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85674,7 +86434,7 @@ module.exports = GetMagnitudeSq; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85745,7 +86505,7 @@ module.exports = GetRectangleFromPoints; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85787,7 +86547,7 @@ module.exports = Interpolate; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85818,7 +86578,7 @@ module.exports = Invert; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85854,7 +86614,7 @@ module.exports = Negative; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85948,7 +86708,7 @@ module.exports = Point; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85996,7 +86756,7 @@ module.exports = Project; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -86042,7 +86802,7 @@ module.exports = ProjectUnit; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -86087,7 +86847,7 @@ module.exports = SetMagnitude; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -86119,7 +86879,7 @@ module.exports = Point; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -86150,7 +86910,7 @@ module.exports = Clone; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -86200,7 +86960,7 @@ module.exports = Contains; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -86233,7 +86993,7 @@ module.exports = ContainsPoint; "use strict"; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -86997,7 +87757,7 @@ module.exports = earcut; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87054,7 +87814,7 @@ module.exports = GetAABB; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87098,7 +87858,7 @@ module.exports = GetNumberArray; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87176,7 +87936,7 @@ module.exports = GetPoints; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87225,7 +87985,7 @@ module.exports = Perimeter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87460,7 +88220,7 @@ module.exports = Polygon; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87700,7 +88460,7 @@ module.exports = Simplify; /** * @author Richard Davey * @author Igor Ognichenko - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87711,7 +88471,7 @@ var copy = function (out, a) { out[0] = a[0]; out[1] = a[1]; - + return out; }; @@ -87739,12 +88499,12 @@ var Smooth = function (polygon) } var output = []; - + if (points.length > 0) { output.push(copy([ 0, 0 ], points[0])); } - + for (i = 0; i < points.length - 1; i++) { var p0 = points[i]; @@ -87757,12 +88517,12 @@ var Smooth = function (polygon) output.push([ 0.85 * p0x + 0.15 * p1x, 0.85 * p0y + 0.15 * p1y ]); output.push([ 0.15 * p0x + 0.85 * p1x, 0.15 * p0y + 0.85 * p1y ]); } - + if (points.length > 1) { output.push(copy([ 0, 0 ], points[points.length - 1])); } - + return polygon.setTo(output); }; @@ -87776,7 +88536,7 @@ module.exports = Smooth; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87817,7 +88577,7 @@ module.exports = Translate; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87846,7 +88606,7 @@ module.exports = Polygon; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87875,7 +88635,7 @@ module.exports = Area; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87909,7 +88669,7 @@ module.exports = Ceil; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87945,7 +88705,7 @@ module.exports = CeilAll; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87983,7 +88743,7 @@ module.exports = CenterOn; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88014,7 +88774,7 @@ module.exports = Clone; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88050,7 +88810,7 @@ module.exports = Contains; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88082,7 +88842,7 @@ module.exports = ContainsPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88123,7 +88883,7 @@ module.exports = ContainsRect; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88155,7 +88915,7 @@ module.exports = CopyFrom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88193,7 +88953,7 @@ module.exports = Decompose; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88228,7 +88988,7 @@ module.exports = Equals; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88238,7 +88998,7 @@ var GetAspectRatio = __webpack_require__(6700); * Adjusts the target rectangle, changing its width, height and position, * so that it fits inside the area of the source rectangle, while maintaining its original * aspect ratio. - * + * * Unlike the `FitOutside` function, there may be some space inside the source area not covered. * * @function Phaser.Geom.Rectangle.FitInside @@ -88282,7 +89042,7 @@ module.exports = FitInside; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88292,7 +89052,7 @@ var GetAspectRatio = __webpack_require__(6700); * Adjusts the target rectangle, changing its width, height and position, * so that it fully covers the area of the source rectangle, while maintaining its original * aspect ratio. - * + * * Unlike the `FitInside` function, the target rectangle may extend further out than the source. * * @function Phaser.Geom.Rectangle.FitOutside @@ -88336,7 +89096,7 @@ module.exports = FitOutside; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88370,7 +89130,7 @@ module.exports = Floor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88406,7 +89166,7 @@ module.exports = FloorAll; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88493,7 +89253,7 @@ module.exports = FromPoints; /** * @author samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88537,7 +89297,7 @@ module.exports = FromXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88566,7 +89326,7 @@ module.exports = GetAspectRatio; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88605,7 +89365,7 @@ module.exports = GetCenter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88614,9 +89374,9 @@ var Point = __webpack_require__(79967); /** * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. - * + * * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. - * + * * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side. * * @function Phaser.Geom.Rectangle.GetPoint @@ -88687,7 +89447,7 @@ module.exports = GetPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88742,7 +89502,7 @@ module.exports = GetPoints; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88783,7 +89543,7 @@ module.exports = GetSize; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88826,7 +89586,7 @@ module.exports = Inflate; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88878,7 +89638,7 @@ module.exports = Intersection; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88998,7 +89758,7 @@ module.exports = MarchingAnts; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -89048,7 +89808,7 @@ module.exports = MergePoints; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -89096,7 +89856,7 @@ module.exports = MergeRect; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -89141,7 +89901,7 @@ module.exports = MergeXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -89177,7 +89937,7 @@ module.exports = Offset; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -89212,7 +89972,7 @@ module.exports = OffsetPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -89247,7 +90007,7 @@ module.exports = Overlaps; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -89276,7 +90036,7 @@ module.exports = Perimeter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -89334,7 +90094,7 @@ module.exports = PerimeterPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -89373,7 +90133,7 @@ module.exports = Random; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -89445,7 +90205,7 @@ module.exports = RandomOutside; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -89552,9 +90312,9 @@ var Rectangle = new Class({ /** * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. - * + * * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. - * + * * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side. * * @method Phaser.Geom.Rectangle#getPoint @@ -89957,7 +90717,7 @@ module.exports = Rectangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -89987,7 +90747,7 @@ module.exports = SameDimensions; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90027,7 +90787,7 @@ module.exports = Scale; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90070,7 +90830,7 @@ module.exports = Union; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90125,7 +90885,7 @@ module.exports = Rectangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90165,7 +90925,7 @@ module.exports = Area; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90210,7 +90970,7 @@ module.exports = BuildEquilateral; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90287,7 +91047,7 @@ module.exports = BuildFromPolygon; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90337,7 +91097,7 @@ module.exports = BuildRight; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90391,7 +91151,7 @@ module.exports = CenterOn; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90436,7 +91196,7 @@ module.exports = Centroid; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90513,7 +91273,7 @@ module.exports = CircumCenter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90597,7 +91357,7 @@ module.exports = CircumCircle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90628,7 +91388,7 @@ module.exports = Clone; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90682,7 +91442,7 @@ module.exports = Contains; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90745,7 +91505,7 @@ var ContainsArray = function (triangle, points, returnFirst, out) u = ((dot11 * dot02) - (dot01 * dot12)) * inv; v = ((dot00 * dot12) - (dot01 * dot02)) * inv; - + if (u >= 0 && v >= 0 && (u + v < 1)) { out.push({ x: points[i].x, y: points[i].y }); @@ -90770,7 +91530,7 @@ module.exports = ContainsArray; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90802,7 +91562,7 @@ module.exports = ContainsPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90834,7 +91594,7 @@ module.exports = CopyFrom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90870,7 +91630,7 @@ module.exports = Decompose; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90907,7 +91667,7 @@ module.exports = Equals; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90995,7 +91755,7 @@ module.exports = GetPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -91089,7 +91849,7 @@ module.exports = GetPoints; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -91155,7 +91915,7 @@ module.exports = InCenter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -91197,7 +91957,7 @@ module.exports = Offset; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -91233,7 +91993,7 @@ module.exports = Perimeter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -91290,7 +92050,7 @@ module.exports = Random; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -91327,7 +92087,7 @@ module.exports = Rotate; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -91362,7 +92122,7 @@ module.exports = RotateAroundPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -91417,7 +92177,7 @@ module.exports = RotateAroundXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -91865,7 +92625,7 @@ module.exports = Triangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -91906,13 +92666,13 @@ module.exports = Triangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Creates a new Interactive Object. - * + * * This is called automatically by the Input Manager when you enable a Game Object for input. * * The resulting Interactive Object is mapped to the Game Object's `input` property. @@ -91978,7 +92738,7 @@ module.exports = CreateInteractiveObject; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -92015,7 +92775,7 @@ module.exports = CreatePixelPerfectHandler; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -92330,15 +93090,18 @@ var InputManager = new Class({ */ boot: function () { - this.canvas = this.game.canvas; + var game = this.game; + var events = game.events; - this.scaleManager = this.game.scale; + this.canvas = game.canvas; + + this.scaleManager = game.scale; this.events.emit(Events.MANAGER_BOOT); - this.game.events.on(GameEvents.PRE_RENDER, this.preRender, this); + events.on(GameEvents.PRE_RENDER, this.preRender, this); - this.game.events.once(GameEvents.DESTROY, this.destroy, this); + events.once(GameEvents.DESTROY, this.destroy, this); }, /** @@ -92626,11 +93389,26 @@ var InputManager = new Class({ if (pointer.active && pointer.identifier === changedTouch.identifier) { - pointer.touchmove(changedTouch, event); + var element = document.elementFromPoint(changedTouch.pageX, changedTouch.pageY); + var overCanvas = element === this.canvas; - this.activePointer = pointer; + if (!this.isOver && overCanvas) + { + this.setCanvasOver(event); + } + else if (this.isOver && !overCanvas) + { + this.setCanvasOut(event); + } - changed.push(pointer); + if (this.isOver) + { + pointer.touchmove(changedTouch, event); + + this.activePointer = pointer; + + changed.push(pointer); + } break; } @@ -93108,7 +93886,7 @@ module.exports = InputManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -93885,12 +94663,20 @@ var InputPlugin = new Class({ { if (skipQueue === undefined) { skipQueue = false; } + this.disable(gameObject); + var input = gameObject.input; // If GameObject.input already cleared from higher class - if (!input) + if (input) { - return; + input.gameObject = undefined; + input.target = undefined; + input.hitArea = undefined; + input.hitAreaCallback = undefined; + input.callbackContext = undefined; + + gameObject.input = null; } if (!skipQueue) @@ -93898,15 +94684,6 @@ var InputPlugin = new Class({ this.queueForRemoval(gameObject); } - input.gameObject = undefined; - input.target = undefined; - input.hitArea = undefined; - input.hitAreaCallback = undefined; - input.callbackContext = undefined; - - gameObject.input = null; - - // Clear from _draggable, _drag and _over var index = this._draggable.indexOf(gameObject); if (index > -1) @@ -93914,22 +94691,6 @@ var InputPlugin = new Class({ this._draggable.splice(index, 1); } - index = this._drag[0].indexOf(gameObject); - - if (index > -1) - { - this._drag[0].splice(index, 1); - } - - index = this._over[0].indexOf(gameObject); - - if (index > -1) - { - this._over[0].splice(index, 1); - - this.manager.resetCursor(input); - } - return gameObject; }, @@ -93943,10 +94704,52 @@ var InputPlugin = new Class({ * @since 3.0.0 * * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to have its input system disabled. + * + * @return {this} This Input Plugin. */ disable: function (gameObject) { - gameObject.input.enabled = false; + var input = gameObject.input; + + if (input) + { + input.enabled = false; + input.dragState = 0; + } + + // Clear from _temp, _drag and _over + var temp = this._temp; + var drag = this._drag; + var over = this._over; + var manager = this.manager; + + var index = temp.indexOf(gameObject); + + if (index > -1) + { + temp.splice(index, 1); + } + + for (var i = 0; i < manager.pointersTotal; i++) + { + index = drag[i].indexOf(gameObject); + + if (index > -1) + { + drag[i].splice(index, 1); + } + + index = over[i].indexOf(gameObject); + + if (index > -1) + { + over[i].splice(index, 1); + + manager.resetCursor(input); + } + } + + return this; }, /** @@ -95532,6 +96335,7 @@ var InputPlugin = new Class({ var offsetx = 0; var offsety = 0; + switch (shapeType) { case GEOM_CONST.CIRCLE: @@ -95568,10 +96372,11 @@ var InputPlugin = new Class({ if (debug) { debug.isFilled = false; + debug.strokeColor = color; debug.preUpdate = function () { - debug.setStrokeStyle(1 / gameObject.scale, color); + debug.setStrokeStyle(1 / gameObject.scale, debug.strokeColor); debug.setDisplayOrigin(gameObject.displayOriginX, gameObject.displayOriginY); @@ -95745,7 +96550,7 @@ var InputPlugin = new Class({ */ sortGameObjects: function (gameObjects, pointer) { - if (gameObjects.length < 2) + if (gameObjects.length < 2 || !pointer.camera) { return gameObjects; } @@ -95754,7 +96559,10 @@ var InputPlugin = new Class({ return gameObjects.sort(function (childA, childB) { - return list.indexOf(childB) - list.indexOf(childA); + var indexA = Math.max(list.indexOf(childA), 0); + var indexB = Math.max(list.indexOf(childB), 0); + + return indexB - indexA; }); }, @@ -96320,7 +97128,7 @@ module.exports = InputPlugin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -96429,7 +97237,7 @@ module.exports = InputPluginCache; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -97716,7 +98524,7 @@ module.exports = Pointer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -97724,7 +98532,7 @@ var INPUT_CONST = { /** * The mouse pointer is being held down. - * + * * @name Phaser.Input.MOUSE_DOWN * @type {number} * @since 3.10.0 @@ -97733,7 +98541,7 @@ var INPUT_CONST = { /** * The mouse pointer is being moved. - * + * * @name Phaser.Input.MOUSE_MOVE * @type {number} * @since 3.10.0 @@ -97742,7 +98550,7 @@ var INPUT_CONST = { /** * The mouse pointer is released. - * + * * @name Phaser.Input.MOUSE_UP * @type {number} * @since 3.10.0 @@ -97751,7 +98559,7 @@ var INPUT_CONST = { /** * A touch pointer has been started. - * + * * @name Phaser.Input.TOUCH_START * @type {number} * @since 3.10.0 @@ -97760,7 +98568,7 @@ var INPUT_CONST = { /** * A touch pointer has been started. - * + * * @name Phaser.Input.TOUCH_MOVE * @type {number} * @since 3.10.0 @@ -97769,7 +98577,7 @@ var INPUT_CONST = { /** * A touch pointer has been started. - * + * * @name Phaser.Input.TOUCH_END * @type {number} * @since 3.10.0 @@ -97778,7 +98586,7 @@ var INPUT_CONST = { /** * The pointer lock has changed. - * + * * @name Phaser.Input.POINTER_LOCK_CHANGE * @type {number} * @since 3.10.0 @@ -97787,7 +98595,7 @@ var INPUT_CONST = { /** * A touch pointer has been been cancelled by the browser. - * + * * @name Phaser.Input.TOUCH_CANCEL * @type {number} * @since 3.15.0 @@ -97796,7 +98604,7 @@ var INPUT_CONST = { /** * The mouse wheel changes. - * + * * @name Phaser.Input.MOUSE_WHEEL * @type {number} * @since 3.18.0 @@ -97815,13 +98623,13 @@ module.exports = INPUT_CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Input Plugin Boot Event. - * + * * This internal event is dispatched by the Input Plugin when it boots, signalling to all of its systems to create themselves. * * @event Phaser.Input.Events#BOOT @@ -97837,13 +98645,13 @@ module.exports = 'boot'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Input Plugin Destroy Event. - * + * * This internal event is dispatched by the Input Plugin when it is destroyed, signalling to all of its systems to destroy themselves. * * @event Phaser.Input.Events#DESTROY @@ -97859,22 +98667,22 @@ module.exports = 'destroy'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Drag End Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer stops dragging a Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('dragend', listener)`. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_END]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_END} event instead. * * @event Phaser.Input.Events#DRAG_END * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object that this pointer stopped dragging. */ @@ -97888,24 +98696,24 @@ module.exports = 'dragend'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Drag Enter Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer drags a Game Object into a Drag Target. - * + * * Listen to this event from within a Scene using: `this.input.on('dragenter', listener)`. - * + * * A Pointer can only drag a single Game Object at once. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_ENTER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_ENTER} event instead. * * @event Phaser.Input.Events#DRAG_ENTER * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object that this pointer is dragging. * @param {Phaser.GameObjects.GameObject} target - The drag target that this pointer has moved into. @@ -97920,24 +98728,24 @@ module.exports = 'dragenter'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Drag Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves while dragging a Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('drag', listener)`. - * + * * A Pointer can only drag a single Game Object at once. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG} event instead. * * @event Phaser.Input.Events#DRAG * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object that this pointer is dragging. * @param {number} dragX - The x coordinate where the Pointer is currently dragging the Game Object, in world space. @@ -97953,24 +98761,24 @@ module.exports = 'drag'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Drag Leave Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer drags a Game Object out of a Drag Target. - * + * * Listen to this event from within a Scene using: `this.input.on('dragleave', listener)`. - * + * * A Pointer can only drag a single Game Object at once. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_LEAVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_LEAVE} event instead. * * @event Phaser.Input.Events#DRAG_LEAVE * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object that this pointer is dragging. * @param {Phaser.GameObjects.GameObject} target - The drag target that this pointer has left. @@ -97985,27 +98793,27 @@ module.exports = 'dragleave'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Drag Over Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer drags a Game Object over a Drag Target. - * + * * When the Game Object first enters the drag target it will emit a `dragenter` event. If it then moves while within * the drag target, it will emit this event instead. - * + * * Listen to this event from within a Scene using: `this.input.on('dragover', listener)`. - * + * * A Pointer can only drag a single Game Object at once. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_OVER} event instead. * * @event Phaser.Input.Events#DRAG_OVER * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object that this pointer is dragging. * @param {Phaser.GameObjects.GameObject} target - The drag target that this pointer has moved over. @@ -98020,24 +98828,24 @@ module.exports = 'dragover'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Drag Start Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer starts to drag any Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('dragstart', listener)`. - * + * * A Pointer can only drag a single Game Object at once. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_START]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_START} event instead. * * @event Phaser.Input.Events#DRAG_START * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object that this pointer is dragging. */ @@ -98051,22 +98859,22 @@ module.exports = 'dragstart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Drop Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer drops a Game Object on a Drag Target. - * + * * Listen to this event from within a Scene using: `this.input.on('drop', listener)`. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DROP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DROP} event instead. * * @event Phaser.Input.Events#DROP * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object that this pointer was dragging. * @param {Phaser.GameObjects.GameObject} target - The Drag Target the `gameObject` has been dropped on. @@ -98081,34 +98889,34 @@ module.exports = 'drop'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Down Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is pressed down on _any_ interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('gameobjectdown', listener)`. - * + * * To receive this event, the Game Objects must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} event instead. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} * 2. [GAMEOBJECT_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DOWN} * 3. [POINTER_DOWN]{@linkcode Phaser.Input.Events#event:POINTER_DOWN} or [POINTER_DOWN_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_DOWN_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_DOWN * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the pointer was pressed down on. * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow. @@ -98123,24 +98931,24 @@ module.exports = 'gameobjectdown'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Drag End Event. - * + * * This event is dispatched by an interactive Game Object if a pointer stops dragging it. - * + * * Listen to this event from a Game Object using: `gameObject.on('dragend', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive and enabled for drag. * See [GameObject.setInteractive](Phaser.GameObjects.GameObject#setInteractive) for more details. * * @event Phaser.Input.Events#GAMEOBJECT_DRAG_END * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {number} dragX - The x coordinate where the Pointer stopped dragging the Game Object, in world space. * @param {number} dragY - The y coordinate where the Pointer stopped dragging the Game Object, in world space. @@ -98155,24 +98963,24 @@ module.exports = 'dragend'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Drag Enter Event. - * + * * This event is dispatched by an interactive Game Object if a pointer drags it into a drag target. - * + * * Listen to this event from a Game Object using: `gameObject.on('dragenter', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive and enabled for drag. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. * * @event Phaser.Input.Events#GAMEOBJECT_DRAG_ENTER * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} target - The drag target that this pointer has moved into. */ @@ -98186,24 +98994,24 @@ module.exports = 'dragenter'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Drag Event. - * + * * This event is dispatched by an interactive Game Object if a pointer moves while dragging it. - * + * * Listen to this event from a Game Object using: `gameObject.on('drag', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive and enabled for drag. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. * * @event Phaser.Input.Events#GAMEOBJECT_DRAG * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {number} dragX - The x coordinate where the Pointer is currently dragging the Game Object, in world space. * @param {number} dragY - The y coordinate where the Pointer is currently dragging the Game Object, in world space. @@ -98218,24 +99026,24 @@ module.exports = 'drag'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Drag Leave Event. - * + * * This event is dispatched by an interactive Game Object if a pointer drags it out of a drag target. - * + * * Listen to this event from a Game Object using: `gameObject.on('dragleave', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive and enabled for drag. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. * * @event Phaser.Input.Events#GAMEOBJECT_DRAG_LEAVE * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} target - The drag target that this pointer has left. */ @@ -98249,27 +99057,27 @@ module.exports = 'dragleave'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Drag Over Event. - * + * * This event is dispatched by an interactive Game Object if a pointer drags it over a drag target. - * + * * When the Game Object first enters the drag target it will emit a `dragenter` event. If it then moves while within * the drag target, it will emit this event instead. - * + * * Listen to this event from a Game Object using: `gameObject.on('dragover', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive and enabled for drag. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. * * @event Phaser.Input.Events#GAMEOBJECT_DRAG_OVER * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} target - The drag target that this pointer has moved over. */ @@ -98283,27 +99091,27 @@ module.exports = 'dragover'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Drag Start Event. - * + * * This event is dispatched by an interactive Game Object if a pointer starts to drag it. - * + * * Listen to this event from a Game Object using: `gameObject.on('dragstart', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive and enabled for drag. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * There are lots of useful drag related properties that are set within the Game Object when dragging occurs. * For example, `gameObject.input.dragStartX`, `dragStartY` and so on. * * @event Phaser.Input.Events#GAMEOBJECT_DRAG_START * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {number} dragX - The x coordinate where the Pointer is currently dragging the Game Object, in world space. * @param {number} dragY - The y coordinate where the Pointer is currently dragging the Game Object, in world space. @@ -98318,24 +99126,24 @@ module.exports = 'dragstart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Drop Event. - * + * * This event is dispatched by an interactive Game Object if a pointer drops it on a Drag Target. - * + * * Listen to this event from a Game Object using: `gameObject.on('drop', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive and enabled for drag. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. * * @event Phaser.Input.Events#GAMEOBJECT_DROP * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} target - The Drag Target the `gameObject` has been dropped on. */ @@ -98349,34 +99157,34 @@ module.exports = 'drop'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Move Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is moved across _any_ interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('gameobjectmove', listener)`. - * + * * To receive this event, the Game Objects must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_MOVE} event instead. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_MOVE} * 2. [GAMEOBJECT_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_MOVE} * 3. [POINTER_MOVE]{@linkcode Phaser.Input.Events#event:POINTER_MOVE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_MOVE * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the pointer was moved on. * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow. @@ -98391,34 +99199,37 @@ module.exports = 'gameobjectmove'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Out Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves out of _any_ interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('gameobjectout', listener)`. - * + * * To receive this event, the Game Objects must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OUT} event instead. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OUT} * 2. [GAMEOBJECT_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OUT} * 3. [POINTER_OUT]{@linkcode Phaser.Input.Events#event:POINTER_OUT} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * + * If the pointer leaves the game canvas itself, it will not trigger an this event. To handle those cases, + * please listen for the [GAME_OUT]{@linkcode Phaser.Input.Events#event:GAME_OUT} event. + * * @event Phaser.Input.Events#GAMEOBJECT_OUT * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the pointer moved out of. * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow. @@ -98433,34 +99244,34 @@ module.exports = 'gameobjectout'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Over Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves over _any_ interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('gameobjectover', listener)`. - * + * * To receive this event, the Game Objects must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OVER} event instead. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OVER} * 2. [GAMEOBJECT_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OVER} * 3. [POINTER_OVER]{@linkcode Phaser.Input.Events#event:POINTER_OVER} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_OVER * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the pointer moved over. * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow. @@ -98475,33 +99286,33 @@ module.exports = 'gameobjectover'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Pointer Down Event. - * + * * This event is dispatched by an interactive Game Object if a pointer is pressed down on it. - * + * * Listen to this event from a Game Object using: `gameObject.on('pointerdown', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} * 2. [GAMEOBJECT_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DOWN} * 3. [POINTER_DOWN]{@linkcode Phaser.Input.Events#event:POINTER_DOWN} or [POINTER_DOWN_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_DOWN_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_POINTER_DOWN * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {number} localX - The x coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. * @param {number} localY - The y coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. @@ -98517,33 +99328,33 @@ module.exports = 'pointerdown'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Pointer Move Event. - * + * * This event is dispatched by an interactive Game Object if a pointer is moved while over it. - * + * * Listen to this event from a Game Object using: `gameObject.on('pointermove', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_MOVE} * 2. [GAMEOBJECT_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_MOVE} * 3. [POINTER_MOVE]{@linkcode Phaser.Input.Events#event:POINTER_MOVE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_POINTER_MOVE * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {number} localX - The x coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. * @param {number} localY - The y coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. @@ -98559,33 +99370,36 @@ module.exports = 'pointermove'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Pointer Out Event. - * + * * This event is dispatched by an interactive Game Object if a pointer moves out of it. - * + * * Listen to this event from a Game Object using: `gameObject.on('pointerout', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OUT} * 2. [GAMEOBJECT_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OUT} * 3. [POINTER_OUT]{@linkcode Phaser.Input.Events#event:POINTER_OUT} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * + * If the pointer leaves the game canvas itself, it will not trigger an this event. To handle those cases, + * please listen for the [GAME_OUT]{@linkcode Phaser.Input.Events#event:GAME_OUT} event. + * * @event Phaser.Input.Events#GAMEOBJECT_POINTER_OUT * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow. */ @@ -98599,33 +99413,33 @@ module.exports = 'pointerout'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Pointer Over Event. - * + * * This event is dispatched by an interactive Game Object if a pointer moves over it. - * + * * Listen to this event from a Game Object using: `gameObject.on('pointerover', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OVER} * 2. [GAMEOBJECT_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OVER} * 3. [POINTER_OVER]{@linkcode Phaser.Input.Events#event:POINTER_OVER} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_POINTER_OVER * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {number} localX - The x coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. * @param {number} localY - The y coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. @@ -98641,33 +99455,33 @@ module.exports = 'pointerover'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Pointer Up Event. - * + * * This event is dispatched by an interactive Game Object if a pointer is released while over it. - * + * * Listen to this event from a Game Object using: `gameObject.on('pointerup', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} * 2. [GAMEOBJECT_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_UP} * 3. [POINTER_UP]{@linkcode Phaser.Input.Events#event:POINTER_UP} or [POINTER_UP_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_UP_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_POINTER_UP * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {number} localX - The x coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. * @param {number} localY - The y coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. @@ -98683,33 +99497,33 @@ module.exports = 'pointerup'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Pointer Wheel Event. - * + * * This event is dispatched by an interactive Game Object if a pointer has its wheel moved while over it. - * + * * Listen to this event from a Game Object using: `gameObject.on('wheel', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_WHEEL} * 2. [GAMEOBJECT_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_WHEEL} * 3. [POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:POINTER_WHEEL} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_POINTER_WHEEL * @since 3.18.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {number} deltaX - The horizontal scroll amount that occurred due to the user moving a mouse wheel or similar input device. * @param {number} deltaY - The vertical scroll amount that occurred due to the user moving a mouse wheel or similar input device. This value will typically be less than 0 if the user scrolls up and greater than zero if scrolling down. @@ -98726,34 +99540,34 @@ module.exports = 'wheel'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Up Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is released while over _any_ interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('gameobjectup', listener)`. - * + * * To receive this event, the Game Objects must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} event instead. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} * 2. [GAMEOBJECT_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_UP} * 3. [POINTER_UP]{@linkcode Phaser.Input.Events#event:POINTER_UP} or [POINTER_UP_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_UP_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_UP * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the pointer was over when released. * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow. @@ -98768,34 +99582,34 @@ module.exports = 'gameobjectup'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Wheel Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer has its wheel moved while over _any_ interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('gameobjectwheel', listener)`. - * + * * To receive this event, the Game Objects must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_WHEEL} event instead. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_WHEEL} * 2. [GAMEOBJECT_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_WHEEL} * 3. [POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:POINTER_WHEEL} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_WHEEL * @since 3.18.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the pointer was over when the wheel changed. * @param {number} deltaX - The horizontal scroll amount that occurred due to the user moving a mouse wheel or similar input device. @@ -98813,21 +99627,21 @@ module.exports = 'gameobjectwheel'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Input Plugin Game Out Event. - * + * * This event is dispatched by the Input Plugin if the active pointer leaves the game canvas and is now * outside of it, elsewhere on the web page. - * + * * Listen to this event from within a Scene using: `this.input.on('gameout', listener)`. * * @event Phaser.Input.Events#GAME_OUT * @since 3.16.1 - * + * * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. * @param {(MouseEvent|TouchEvent)} event - The DOM Event that triggered the canvas out. */ @@ -98841,21 +99655,21 @@ module.exports = 'gameout'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Input Plugin Game Over Event. - * + * * This event is dispatched by the Input Plugin if the active pointer enters the game canvas and is now * over of it, having previously been elsewhere on the web page. - * + * * Listen to this event from within a Scene using: `this.input.on('gameover', listener)`. * * @event Phaser.Input.Events#GAME_OVER * @since 3.16.1 - * + * * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. * @param {(MouseEvent|TouchEvent)} event - The DOM Event that triggered the canvas over. */ @@ -98869,13 +99683,13 @@ module.exports = 'gameover'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Input Manager Boot Event. - * + * * This internal event is dispatched by the Input Manager when it boots. * * @event Phaser.Input.Events#MANAGER_BOOT @@ -98891,19 +99705,19 @@ module.exports = 'boot'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Input Manager Process Event. - * + * * This internal event is dispatched by the Input Manager when not using the legacy queue system, * and it wants the Input Plugins to update themselves. * * @event Phaser.Input.Events#MANAGER_PROCESS * @since 3.0.0 - * + * * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. */ @@ -98917,13 +99731,13 @@ module.exports = 'process'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Input Manager Update Event. - * + * * This internal event is dispatched by the Input Manager as part of its update step. * * @event Phaser.Input.Events#MANAGER_UPDATE @@ -98939,18 +99753,18 @@ module.exports = 'update'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Input Manager Pointer Lock Change Event. - * + * * This event is dispatched by the Input Manager when it is processing a native Pointer Lock Change DOM Event. * * @event Phaser.Input.Events#POINTERLOCK_CHANGE * @since 3.0.0 - * + * * @param {Event} event - The native DOM Event. * @param {boolean} locked - The locked state of the Mouse Pointer. */ @@ -98964,29 +99778,29 @@ module.exports = 'pointerlockchange'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Down Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is pressed down anywhere. - * + * * Listen to this event from within a Scene using: `this.input.on('pointerdown', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} * 2. [GAMEOBJECT_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DOWN} * 3. [POINTER_DOWN]{@linkcode Phaser.Input.Events#event:POINTER_DOWN} or [POINTER_DOWN_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_DOWN_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#POINTER_DOWN * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject[]} currentlyOver - An array containing all interactive Game Objects that the pointer was over when the event was created. */ @@ -99000,29 +99814,29 @@ module.exports = 'pointerdown'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Down Outside Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is pressed down anywhere outside of the game canvas. - * + * * Listen to this event from within a Scene using: `this.input.on('pointerdownoutside', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} * 2. [GAMEOBJECT_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DOWN} * 3. [POINTER_DOWN]{@linkcode Phaser.Input.Events#event:POINTER_DOWN} or [POINTER_DOWN_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_DOWN_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#POINTER_DOWN_OUTSIDE * @since 3.16.1 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. */ module.exports = 'pointerdownoutside'; @@ -99035,29 +99849,29 @@ module.exports = 'pointerdownoutside'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Move Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is moved anywhere. - * + * * Listen to this event from within a Scene using: `this.input.on('pointermove', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_MOVE} * 2. [GAMEOBJECT_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_MOVE} * 3. [POINTER_MOVE]{@linkcode Phaser.Input.Events#event:POINTER_MOVE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#POINTER_MOVE * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject[]} currentlyOver - An array containing all interactive Game Objects that the pointer was over when the event was created. */ @@ -99071,29 +99885,32 @@ module.exports = 'pointermove'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Out Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves out of any interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('pointerout', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OUT} * 2. [GAMEOBJECT_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OUT} * 3. [POINTER_OUT]{@linkcode Phaser.Input.Events#event:POINTER_OUT} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * + * If the pointer leaves the game canvas itself, it will not trigger an this event. To handle those cases, + * please listen for the [GAME_OUT]{@linkcode Phaser.Input.Events#event:GAME_OUT} event. + * * @event Phaser.Input.Events#POINTER_OUT * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject[]} justOut - An array containing all interactive Game Objects that the pointer moved out of when the event was created. */ @@ -99107,29 +99924,29 @@ module.exports = 'pointerout'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Over Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves over any interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('pointerover', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OVER} * 2. [GAMEOBJECT_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OVER} * 3. [POINTER_OVER]{@linkcode Phaser.Input.Events#event:POINTER_OVER} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#POINTER_OVER * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject[]} justOver - An array containing all interactive Game Objects that the pointer moved over when the event was created. */ @@ -99143,29 +99960,29 @@ module.exports = 'pointerover'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Up Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is released anywhere. - * + * * Listen to this event from within a Scene using: `this.input.on('pointerup', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} * 2. [GAMEOBJECT_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_UP} * 3. [POINTER_UP]{@linkcode Phaser.Input.Events#event:POINTER_UP} or [POINTER_UP_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_UP_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#POINTER_UP * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject[]} currentlyOver - An array containing all interactive Game Objects that the pointer was over when the event was created. */ @@ -99179,29 +99996,29 @@ module.exports = 'pointerup'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Up Outside Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is released anywhere outside of the game canvas. - * + * * Listen to this event from within a Scene using: `this.input.on('pointerupoutside', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} * 2. [GAMEOBJECT_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_UP} * 3. [POINTER_UP]{@linkcode Phaser.Input.Events#event:POINTER_UP} or [POINTER_UP_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_UP_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#POINTER_UP_OUTSIDE * @since 3.16.1 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. */ module.exports = 'pointerupoutside'; @@ -99214,29 +100031,29 @@ module.exports = 'pointerupoutside'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Wheel Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer has its wheel updated. - * + * * Listen to this event from within a Scene using: `this.input.on('wheel', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_WHEEL} * 2. [GAMEOBJECT_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_WHEEL} * 3. [POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:POINTER_WHEEL} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#POINTER_WHEEL * @since 3.18.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject[]} currentlyOver - An array containing all interactive Game Objects that the pointer was over when the event was created. * @param {number} deltaX - The horizontal scroll amount that occurred due to the user moving a mouse wheel or similar input device. @@ -99253,13 +100070,13 @@ module.exports = 'wheel'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Input Plugin Pre-Update Event. - * + * * This internal event is dispatched by the Input Plugin at the start of its `preUpdate` method. * This hook is designed specifically for input plugins, but can also be listened to from user-land code. * @@ -99276,13 +100093,13 @@ module.exports = 'preupdate'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Input Plugin Shutdown Event. - * + * * This internal event is dispatched by the Input Plugin when it shuts down, signalling to all of its systems to shut themselves down. * * @event Phaser.Input.Events#SHUTDOWN @@ -99298,13 +100115,13 @@ module.exports = 'shutdown'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Input Plugin Start Event. - * + * * This internal event is dispatched by the Input Plugin when it has finished setting-up, * signalling to all of its internal systems to start. * @@ -99321,19 +100138,19 @@ module.exports = 'start'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Input Plugin Update Event. - * + * * This internal event is dispatched by the Input Plugin at the start of its `update` method. * This hook is designed specifically for input plugins, but can also be listened to from user-land code. * * @event Phaser.Input.Events#UPDATE * @since 3.0.0 - * + * * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. */ @@ -99347,7 +100164,7 @@ module.exports = 'update'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -99414,7 +100231,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -99540,7 +100357,7 @@ module.exports = Axis; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -99687,7 +100504,7 @@ module.exports = Button; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -100461,7 +101278,7 @@ module.exports = Gamepad; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -101108,7 +101925,7 @@ module.exports = GamepadPlugin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -101124,7 +101941,7 @@ module.exports = { /** * D-Pad up - * + * * @name Phaser.Input.Gamepad.Configs.SNES_USB.UP * @const * @type {number} @@ -101134,7 +101951,7 @@ module.exports = { /** * D-Pad down - * + * * @name Phaser.Input.Gamepad.Configs.SNES_USB.DOWN * @const * @type {number} @@ -101144,7 +101961,7 @@ module.exports = { /** * D-Pad left - * + * * @name Phaser.Input.Gamepad.Configs.SNES_USB.LEFT * @const * @type {number} @@ -101154,7 +101971,7 @@ module.exports = { /** * D-Pad right - * + * * @name Phaser.Input.Gamepad.Configs.SNES_USB.RIGHT * @const * @type {number} @@ -101164,7 +101981,7 @@ module.exports = { /** * Select button - * + * * @name Phaser.Input.Gamepad.Configs.SNES_USB.SELECT * @const * @type {number} @@ -101174,7 +101991,7 @@ module.exports = { /** * Start button - * + * * @name Phaser.Input.Gamepad.Configs.SNES_USB.START * @const * @type {number} @@ -101184,7 +102001,7 @@ module.exports = { /** * B Button (Bottom) - * + * * @name Phaser.Input.Gamepad.Configs.SNES_USB.B * @const * @type {number} @@ -101194,7 +102011,7 @@ module.exports = { /** * A Button (Right) - * + * * @name Phaser.Input.Gamepad.Configs.SNES_USB.A * @const * @type {number} @@ -101204,7 +102021,7 @@ module.exports = { /** * Y Button (Left) - * + * * @name Phaser.Input.Gamepad.Configs.SNES_USB.Y * @const * @type {number} @@ -101214,7 +102031,7 @@ module.exports = { /** * X Button (Top) - * + * * @name Phaser.Input.Gamepad.Configs.SNES_USB.X * @const * @type {number} @@ -101224,7 +102041,7 @@ module.exports = { /** * Left bumper - * + * * @name Phaser.Input.Gamepad.Configs.SNES_USB.LEFT_SHOULDER * @const * @type {number} @@ -101234,7 +102051,7 @@ module.exports = { /** * Right bumper - * + * * @name Phaser.Input.Gamepad.Configs.SNES_USB.RIGHT_SHOULDER * @const * @type {number} @@ -101252,7 +102069,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -101268,7 +102085,7 @@ module.exports = { /** * D-Pad up - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.UP * @const * @type {number} @@ -101278,7 +102095,7 @@ module.exports = { /** * D-Pad down - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.DOWN * @const * @type {number} @@ -101288,7 +102105,7 @@ module.exports = { /** * D-Pad left - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.LEFT * @const * @type {number} @@ -101298,7 +102115,7 @@ module.exports = { /** * D-Pad up - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.RIGHT * @const * @type {number} @@ -101308,7 +102125,7 @@ module.exports = { /** * Share button - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.SHARE * @const * @type {number} @@ -101318,7 +102135,7 @@ module.exports = { /** * Options button - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.OPTIONS * @const * @type {number} @@ -101328,7 +102145,7 @@ module.exports = { /** * PlayStation logo button - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.PS * @const * @type {number} @@ -101338,7 +102155,7 @@ module.exports = { /** * Touchpad click - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.TOUCHBAR * @const * @type {number} @@ -101348,7 +102165,7 @@ module.exports = { /** * Cross button (Bottom) - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.X * @const * @type {number} @@ -101358,7 +102175,7 @@ module.exports = { /** * Circle button (Right) - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.CIRCLE * @const * @type {number} @@ -101368,7 +102185,7 @@ module.exports = { /** * Square button (Left) - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.SQUARE * @const * @type {number} @@ -101378,7 +102195,7 @@ module.exports = { /** * Triangle button (Top) - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.TRIANGLE * @const * @type {number} @@ -101388,7 +102205,7 @@ module.exports = { /** * Left bumper (L1) - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.L1 * @const * @type {number} @@ -101398,7 +102215,7 @@ module.exports = { /** * Right bumper (R1) - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.R1 * @const * @type {number} @@ -101408,7 +102225,7 @@ module.exports = { /** * Left trigger (L2) - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.L2 * @const * @type {number} @@ -101418,7 +102235,7 @@ module.exports = { /** * Right trigger (R2) - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.R2 * @const * @type {number} @@ -101428,7 +102245,7 @@ module.exports = { /** * Left stick click (L3) - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.L3 * @const * @type {number} @@ -101438,7 +102255,7 @@ module.exports = { /** * Right stick click (R3) - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.R3 * @const * @type {number} @@ -101448,7 +102265,7 @@ module.exports = { /** * Left stick horizontal - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.LEFT_STICK_H * @const * @type {number} @@ -101458,7 +102275,7 @@ module.exports = { /** * Left stick vertical - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.LEFT_STICK_V * @const * @type {number} @@ -101468,7 +102285,7 @@ module.exports = { /** * Right stick horizontal - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.RIGHT_STICK_H * @const * @type {number} @@ -101478,7 +102295,7 @@ module.exports = { /** * Right stick vertical - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.RIGHT_STICK_V * @const * @type {number} @@ -101496,7 +102313,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -101511,7 +102328,7 @@ module.exports = { /** * D-Pad up - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.UP * @const * @type {number} @@ -101521,7 +102338,7 @@ module.exports = { /** * D-Pad down - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.DOWN * @const * @type {number} @@ -101531,7 +102348,7 @@ module.exports = { /** * D-Pad left - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.LEFT * @const * @type {number} @@ -101541,7 +102358,7 @@ module.exports = { /** * D-Pad right - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.RIGHT * @const * @type {number} @@ -101551,7 +102368,7 @@ module.exports = { /** * XBox menu button - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.MENU * @const * @type {number} @@ -101561,7 +102378,7 @@ module.exports = { /** * A button (Bottom) - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.A * @const * @type {number} @@ -101571,7 +102388,7 @@ module.exports = { /** * B button (Right) - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.B * @const * @type {number} @@ -101581,7 +102398,7 @@ module.exports = { /** * X button (Left) - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.X * @const * @type {number} @@ -101591,7 +102408,7 @@ module.exports = { /** * Y button (Top) - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.Y * @const * @type {number} @@ -101601,7 +102418,7 @@ module.exports = { /** * Left Bumper - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.LB * @const * @type {number} @@ -101611,7 +102428,7 @@ module.exports = { /** * Right Bumper - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.RB * @const * @type {number} @@ -101621,7 +102438,7 @@ module.exports = { /** * Left Trigger - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.LT * @const * @type {number} @@ -101631,7 +102448,7 @@ module.exports = { /** * Right Trigger - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.RT * @const * @type {number} @@ -101641,7 +102458,7 @@ module.exports = { /** * Back / Change View button - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.BACK * @const * @type {number} @@ -101651,7 +102468,7 @@ module.exports = { /** * Start button - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.START * @const * @type {number} @@ -101661,7 +102478,7 @@ module.exports = { /** * Left Stick press - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.LS * @const * @type {number} @@ -101671,7 +102488,7 @@ module.exports = { /** * Right stick press - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.RS * @const * @type {number} @@ -101681,7 +102498,7 @@ module.exports = { /** * Left Stick horizontal - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.LEFT_STICK_H * @const * @type {number} @@ -101691,7 +102508,7 @@ module.exports = { /** * Left Stick vertical - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.LEFT_STICK_V * @const * @type {number} @@ -101701,7 +102518,7 @@ module.exports = { /** * Right Stick horizontal - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.RIGHT_STICK_H * @const * @type {number} @@ -101711,7 +102528,7 @@ module.exports = { /** * Right Stick vertical - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.RIGHT_STICK_V * @const * @type {number} @@ -101729,7 +102546,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -101753,22 +102570,22 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Gamepad Button Down Event. - * + * * This event is dispatched by the Gamepad Plugin when a button has been pressed on any active Gamepad. - * + * * Listen to this event from within a Scene using: `this.input.gamepad.on('down', listener)`. - * + * * You can also listen for a DOWN event from a Gamepad instance. See the [GAMEPAD_BUTTON_DOWN]{@linkcode Phaser.Input.Gamepad.Events#event:GAMEPAD_BUTTON_DOWN} event for details. * * @event Phaser.Input.Gamepad.Events#BUTTON_DOWN * @since 3.10.0 - * + * * @param {Phaser.Input.Gamepad} pad - A reference to the Gamepad on which the button was pressed. * @param {Phaser.Input.Gamepad.Button} button - A reference to the Button which was pressed. * @param {number} value - The value of the button at the time it was pressed. Between 0 and 1. Some Gamepads have pressure-sensitive buttons. @@ -101783,22 +102600,22 @@ module.exports = 'down'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Gamepad Button Up Event. - * + * * This event is dispatched by the Gamepad Plugin when a button has been released on any active Gamepad. - * + * * Listen to this event from within a Scene using: `this.input.gamepad.on('up', listener)`. - * + * * You can also listen for an UP event from a Gamepad instance. See the [GAMEPAD_BUTTON_UP]{@linkcode Phaser.Input.Gamepad.Events#event:GAMEPAD_BUTTON_UP} event for details. * * @event Phaser.Input.Gamepad.Events#BUTTON_UP * @since 3.10.0 - * + * * @param {Phaser.Input.Gamepad} pad - A reference to the Gamepad on which the button was released. * @param {Phaser.Input.Gamepad.Button} button - A reference to the Button which was released. * @param {number} value - The value of the button at the time it was released. Between 0 and 1. Some Gamepads have pressure-sensitive buttons. @@ -101813,17 +102630,17 @@ module.exports = 'up'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Gamepad Connected Event. - * + * * This event is dispatched by the Gamepad Plugin when a Gamepad has been connected. - * + * * Listen to this event from within a Scene using: `this.input.gamepad.once('connected', listener)`. - * + * * Note that the browser may require you to press a button on a gamepad before it will allow you to access it, * this is for security reasons. However, it may also trust the page already, in which case you won't get the * 'connected' event and instead should check `GamepadPlugin.total` to see if it thinks there are any gamepads @@ -101831,7 +102648,7 @@ module.exports = 'up'; * * @event Phaser.Input.Gamepad.Events#CONNECTED * @since 3.0.0 - * + * * @param {Phaser.Input.Gamepad} pad - A reference to the Gamepad which was connected. * @param {Event} event - The native DOM Event that triggered the connection. */ @@ -101845,20 +102662,20 @@ module.exports = 'connected'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Gamepad Disconnected Event. - * + * * This event is dispatched by the Gamepad Plugin when a Gamepad has been disconnected. - * + * * Listen to this event from within a Scene using: `this.input.gamepad.once('disconnected', listener)`. * * @event Phaser.Input.Gamepad.Events#DISCONNECTED * @since 3.0.0 - * + * * @param {Phaser.Input.Gamepad} pad - A reference to the Gamepad which was disconnected. * @param {Event} event - The native DOM Event that triggered the disconnection. */ @@ -101872,25 +102689,25 @@ module.exports = 'disconnected'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Gamepad Button Down Event. - * + * * This event is dispatched by a Gamepad instance when a button has been pressed on it. - * + * * Listen to this event from a Gamepad instance. Once way to get this is from the `pad1`, `pad2`, etc properties on the Gamepad Plugin: * `this.input.gamepad.pad1.on('down', listener)`. - * + * * Note that you will not receive any Gamepad button events until the browser considers the Gamepad as being 'connected'. - * + * * You can also listen for a DOWN event from the Gamepad Plugin. See the [BUTTON_DOWN]{@linkcode Phaser.Input.Gamepad.Events#event:BUTTON_DOWN} event for details. * * @event Phaser.Input.Gamepad.Events#GAMEPAD_BUTTON_DOWN * @since 3.10.0 - * + * * @param {number} index - The index of the button that was pressed. * @param {number} value - The value of the button at the time it was pressed. Between 0 and 1. Some Gamepads have pressure-sensitive buttons. * @param {Phaser.Input.Gamepad.Button} button - A reference to the Button which was pressed. @@ -101905,25 +102722,25 @@ module.exports = 'down'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Gamepad Button Up Event. - * + * * This event is dispatched by a Gamepad instance when a button has been released on it. - * + * * Listen to this event from a Gamepad instance. Once way to get this is from the `pad1`, `pad2`, etc properties on the Gamepad Plugin: * `this.input.gamepad.pad1.on('up', listener)`. - * + * * Note that you will not receive any Gamepad button events until the browser considers the Gamepad as being 'connected'. - * + * * You can also listen for an UP event from the Gamepad Plugin. See the [BUTTON_UP]{@linkcode Phaser.Input.Gamepad.Events#event:BUTTON_UP} event for details. * * @event Phaser.Input.Gamepad.Events#GAMEPAD_BUTTON_UP * @since 3.10.0 - * + * * @param {number} index - The index of the button that was released. * @param {number} value - The value of the button at the time it was released. Between 0 and 1. Some Gamepads have pressure-sensitive buttons. * @param {Phaser.Input.Gamepad.Button} button - A reference to the Button which was released. @@ -101938,7 +102755,7 @@ module.exports = 'up'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -101965,7 +102782,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -101980,7 +102797,7 @@ module.exports = { Events: __webpack_require__(43200), Gamepad: __webpack_require__(75956), GamepadPlugin: __webpack_require__(1379), - + Configs: __webpack_require__(4898) }; @@ -101992,7 +102809,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -102032,7 +102849,7 @@ module.exports = Input; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -102477,7 +103294,7 @@ module.exports = KeyboardManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -102526,7 +103343,8 @@ var SnapFloor = __webpack_require__(84314); * Scene to stop all input, or `this.input.keyboard.preventDefault = false` to stop a Scene halting input on another Scene. * * _Note_: Many keyboards are unable to process certain combinations of keys due to hardware limitations known as ghosting. - * See http://www.html5gamedevs.com/topic/4876-impossible-to-use-more-than-2-keyboard-input-buttons-at-the-same-time/ for more details. + * See http://www.html5gamedevs.com/topic/4876-impossible-to-use-more-than-2-keyboard-input-buttons-at-the-same-time/ for more details + * and use the site https://w3c.github.io/uievents/tools/key-event-viewer.html to test your n-key support in browser. * * Also please be aware that certain browser extensions can disable or override Phaser keyboard handling. * For example the Chrome extension vimium is known to disable Phaser from using the D key, while EverNote disables the backtick key. @@ -103024,12 +103842,14 @@ var KeyboardPlugin = new Class({ * * @param {(Phaser.Input.Keyboard.Key|string|number)} key - Either a Key object, a string, such as `A` or `SPACE`, or a key code value. * @param {boolean} [destroy=false] - Call `Key.destroy` on the removed Key object? + * @param {boolean} [removeCapture=false] - Remove this Key from being captured? Only applies if set to capture when created. * * @return {this} This KeyboardPlugin object. */ - removeKey: function (key, destroy) + removeKey: function (key, destroy, removeCapture) { if (destroy === undefined) { destroy = false; } + if (removeCapture === undefined) { removeCapture = false; } var keys = this.keys; var ref; @@ -103061,6 +103881,11 @@ var KeyboardPlugin = new Class({ { ref.plugin = null; + if (removeCapture) + { + this.removeCapture(ref.keyCode); + } + if (destroy) { ref.destroy(); @@ -103077,11 +103902,15 @@ var KeyboardPlugin = new Class({ * @since 3.24.0 * * @param {boolean} [destroy=false] - Call `Key.destroy` on each removed Key object? + * @param {boolean} [removeCapture=false] - Remove all key captures for Key objects owened by this plugin? * * @return {this} This KeyboardPlugin object. */ - removeAllKeys: function (destroy) + removeAllKeys: function (destroy, removeCapture) { + if (destroy === undefined) { destroy = false; } + if (removeCapture === undefined) { removeCapture = false; } + var keys = this.keys; for (var i = 0; i < keys.length; i++) @@ -103092,6 +103921,11 @@ var KeyboardPlugin = new Class({ { keys[i] = undefined; + if (removeCapture) + { + this.removeCapture(key.keyCode); + } + if (destroy) { key.destroy(); @@ -103423,7 +104257,7 @@ module.exports = KeyboardPlugin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -103466,7 +104300,7 @@ module.exports = AdvanceKeyCombo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -103760,7 +104594,7 @@ module.exports = KeyCombo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -103842,7 +104676,7 @@ module.exports = ProcessKeyCombo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -103878,21 +104712,21 @@ module.exports = ResetKeyCombo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Global Key Down Event. - * + * * This event is dispatched by the Keyboard Plugin when any key on the keyboard is pressed down. - * + * * Listen to this event from within a Scene using: `this.input.keyboard.on('keydown', listener)`. - * + * * You can also listen for a specific key being pressed. See [Keyboard.Events.KEY_DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:KEY_DOWN} for details. - * + * * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:DOWN} for details. - * + * * _Note_: Many keyboards are unable to process certain combinations of keys due to hardware limitations known as ghosting. * Read [this article on ghosting]{@link http://www.html5gamedevs.com/topic/4876-impossible-to-use-more-than-2-keyboard-input-buttons-at-the-same-time/} for details. * @@ -103902,7 +104736,7 @@ module.exports = ResetKeyCombo; * * @event Phaser.Input.Keyboard.Events#ANY_KEY_DOWN * @since 3.0.0 - * + * * @param {KeyboardEvent} event - The native DOM Keyboard Event. You can inspect this to learn more about the key that was pressed, any modifiers, etc. */ module.exports = 'keydown'; @@ -103915,24 +104749,24 @@ module.exports = 'keydown'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Global Key Up Event. - * + * * This event is dispatched by the Keyboard Plugin when any key on the keyboard is released. - * + * * Listen to this event from within a Scene using: `this.input.keyboard.on('keyup', listener)`. - * + * * You can also listen for a specific key being released. See [Keyboard.Events.KEY_UP]{@linkcode Phaser.Input.Keyboard.Events#event:KEY_UP} for details. - * + * * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.UP]{@linkcode Phaser.Input.Keyboard.Events#event:UP} for details. * * @event Phaser.Input.Keyboard.Events#ANY_KEY_UP * @since 3.0.0 - * + * * @param {KeyboardEvent} event - The native DOM Keyboard Event. You can inspect this to learn more about the key that was released, any modifiers, etc. */ module.exports = 'keyup'; @@ -103945,17 +104779,17 @@ module.exports = 'keyup'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Key Combo Match Event. - * + * * This event is dispatched by the Keyboard Plugin when a [Key Combo]{@link Phaser.Input.Keyboard.KeyCombo} is matched. - * + * * Listen for this event from the Key Plugin after a combo has been created: - * + * * ```javascript * this.input.keyboard.createCombo([ 38, 38, 40, 40, 37, 39, 37, 39, 66, 65, 13 ], { resetOnMatch: true }); * @@ -103966,7 +104800,7 @@ module.exports = 'keyup'; * * @event Phaser.Input.Keyboard.Events#COMBO_MATCH * @since 3.0.0 - * + * * @param {Phaser.Input.Keyboard.KeyCombo} keycombo - The Key Combo object that was matched. * @param {KeyboardEvent} event - The native DOM Keyboard Event of the final key in the combo. You can inspect this to learn more about any modifiers, etc. */ @@ -103980,28 +104814,28 @@ module.exports = 'keycombomatch'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Key Down Event. - * + * * This event is dispatched by a [Key]{@link Phaser.Input.Keyboard.Key} object when it is pressed. - * + * * Listen for this event from the Key object instance directly: - * + * * ```javascript * var spaceBar = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE); - * + * * spaceBar.on('down', listener) * ``` - * + * * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_DOWN} for details. * * @event Phaser.Input.Keyboard.Events#DOWN * @since 3.0.0 - * + * * @param {Phaser.Input.Keyboard.Key} key - The Key object that was pressed. * @param {KeyboardEvent} event - The native DOM Keyboard Event. You can inspect this to learn more about any modifiers, etc. */ @@ -104015,24 +104849,24 @@ module.exports = 'down'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Key Down Event. - * + * * This event is dispatched by the Keyboard Plugin when any key on the keyboard is pressed down. - * + * * Unlike the `ANY_KEY_DOWN` event, this one has a special dynamic event name. For example, to listen for the `A` key being pressed * use the following from within a Scene: `this.input.keyboard.on('keydown-A', listener)`. You can replace the `-A` part of the event - * name with any valid [Key Code string]{@link Phaser.Input.Keyboard.KeyCodes}. For example, this will listen for the space bar: + * name with any valid [Key Code string]{@link Phaser.Input.Keyboard.KeyCodes}. For example, this will listen for the space bar: * `this.input.keyboard.on('keydown-SPACE', listener)`. - * + * * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_DOWN} for details. - * + * * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:DOWN} for details. - * + * * _Note_: Many keyboards are unable to process certain combinations of keys due to hardware limitations known as ghosting. * Read [this article on ghosting]{@link http://www.html5gamedevs.com/topic/4876-impossible-to-use-more-than-2-keyboard-input-buttons-at-the-same-time/} for details. * @@ -104042,7 +104876,7 @@ module.exports = 'down'; * * @event Phaser.Input.Keyboard.Events#KEY_DOWN * @since 3.0.0 - * + * * @param {KeyboardEvent} event - The native DOM Keyboard Event. You can inspect this to learn more about the key that was pressed, any modifiers, etc. */ module.exports = 'keydown-'; @@ -104055,27 +104889,27 @@ module.exports = 'keydown-'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Key Up Event. - * + * * This event is dispatched by the Keyboard Plugin when any key on the keyboard is released. - * + * * Unlike the `ANY_KEY_UP` event, this one has a special dynamic event name. For example, to listen for the `A` key being released * use the following from within a Scene: `this.input.keyboard.on('keyup-A', listener)`. You can replace the `-A` part of the event - * name with any valid [Key Code string]{@link Phaser.Input.Keyboard.KeyCodes}. For example, this will listen for the space bar: + * name with any valid [Key Code string]{@link Phaser.Input.Keyboard.KeyCodes}. For example, this will listen for the space bar: * `this.input.keyboard.on('keyup-SPACE', listener)`. - * + * * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_UP]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_UP} for details. - * + * * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.UP]{@linkcode Phaser.Input.Keyboard.Events#event:UP} for details. * * @event Phaser.Input.Keyboard.Events#KEY_UP * @since 3.0.0 - * + * * @param {KeyboardEvent} event - The native DOM Keyboard Event. You can inspect this to learn more about the key that was released, any modifiers, etc. */ module.exports = 'keyup-'; @@ -104088,28 +104922,28 @@ module.exports = 'keyup-'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Key Up Event. - * + * * This event is dispatched by a [Key]{@link Phaser.Input.Keyboard.Key} object when it is released. - * + * * Listen for this event from the Key object instance directly: - * + * * ```javascript * var spaceBar = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE); - * + * * spaceBar.on('up', listener) * ``` - * + * * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_UP]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_UP} for details. * * @event Phaser.Input.Keyboard.Events#UP * @since 3.0.0 - * + * * @param {Phaser.Input.Keyboard.Key} key - The Key object that was released. * @param {KeyboardEvent} event - The native DOM Keyboard Event. You can inspect this to learn more about any modifiers, etc. */ @@ -104123,7 +104957,7 @@ module.exports = 'up'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -104151,7 +104985,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -104190,7 +105024,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -104225,15 +105059,15 @@ module.exports = DownDuration; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The justDown value allows you to test if this Key has just been pressed down or not. - * + * * When you check this value it will return `true` if the Key is down, otherwise `false`. - * + * * You can only call justDown once per key press. It will only return `true` once, until the Key is released and pressed down again. * This allows you to use it in situations where you want to check if this key is down without using an event, such as in a core game loop. * @@ -104268,15 +105102,15 @@ module.exports = JustDown; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The justUp value allows you to test if this Key has just been released or not. - * + * * When you check this value it will return `true` if the Key is up, otherwise `false`. - * + * * You can only call JustUp once per key release. It will only return `true` once, until the Key is pressed down and released again. * This allows you to use it in situations where you want to check if this key is up without using an event, such as in a core game loop. * @@ -104311,7 +105145,7 @@ module.exports = JustUp; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -104485,7 +105319,7 @@ var Key = new Class({ /** * When a key is held down should it continuously fire the `down` event each time it repeats? - * + * * By default it will emit the `down` event just once, but if you wish to receive the event * for each repeat as well, enable this property. * @@ -104545,9 +105379,9 @@ var Key = new Class({ * * @method Phaser.Input.Keyboard.Key#setEmitOnRepeat * @since 3.16.0 - * + * * @param {boolean} value - Emit `down` events on repeated key down actions, or just once? - * + * * @return {this} This Key instance. */ setEmitOnRepeat: function (value) @@ -104564,7 +105398,7 @@ var Key = new Class({ * @method Phaser.Input.Keyboard.Key#onDown * @fires Phaser.Input.Keyboard.Events#DOWN * @since 3.16.0 - * + * * @param {KeyboardEvent} event - The native DOM Keyboard event. */ onDown: function (event) @@ -104581,7 +105415,7 @@ var Key = new Class({ this.shiftKey = event.shiftKey; this.metaKey = event.metaKey; this.location = event.location; - + this.repeats++; if (!this.isDown) @@ -104608,7 +105442,7 @@ var Key = new Class({ * @method Phaser.Input.Keyboard.Key#onUp * @fires Phaser.Input.Keyboard.Events#UP * @since 3.16.0 - * + * * @param {KeyboardEvent} event - The native DOM Keyboard event. */ onUp: function (event) @@ -104619,32 +105453,32 @@ var Key = new Class({ { return; } - + this.isDown = false; this.isUp = true; this.timeUp = event.timeStamp; this.duration = this.timeUp - this.timeDown; this.repeats = 0; - + this._justDown = false; this._justUp = true; this._tick = -1; - + this.emit(Events.UP, this, event); }, /** * Resets this Key object back to its default un-pressed state. * + * As of version 3.60.0 it no longer resets the `enabled` or `preventDefault` flags. + * * @method Phaser.Input.Keyboard.Key#reset * @since 3.6.0 - * + * * @return {this} This Key instance. */ reset: function () { - this.preventDefault = true; - this.enabled = true; this.isDown = false; this.isUp = true; this.altKey = false; @@ -104664,15 +105498,15 @@ var Key = new Class({ /** * Returns the duration, in ms, that the Key has been held down for. - * + * * If the key is not currently down it will return zero. - * - * The get the duration the Key was held down for in the previous up-down cycle, + * + * To get the duration the Key was held down for in the previous up-down cycle, * use the `Key.duration` property value instead. * * @method Phaser.Input.Keyboard.Key#getDuration * @since 3.17.0 - * + * * @return {number} The duration, in ms, that the Key has been held down for if currently down. */ getDuration: function () @@ -104714,7 +105548,7 @@ module.exports = Key; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -104730,7 +105564,7 @@ var KeyCodes = { /** * The BACKSPACE key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.BACKSPACE * @type {number} * @since 3.0.0 @@ -104739,7 +105573,7 @@ var KeyCodes = { /** * The TAB key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.TAB * @type {number} * @since 3.0.0 @@ -104748,7 +105582,7 @@ var KeyCodes = { /** * The ENTER key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.ENTER * @type {number} * @since 3.0.0 @@ -104757,7 +105591,7 @@ var KeyCodes = { /** * The SHIFT key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.SHIFT * @type {number} * @since 3.0.0 @@ -104766,7 +105600,7 @@ var KeyCodes = { /** * The CTRL key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.CTRL * @type {number} * @since 3.0.0 @@ -104775,7 +105609,7 @@ var KeyCodes = { /** * The ALT key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.ALT * @type {number} * @since 3.0.0 @@ -104784,7 +105618,7 @@ var KeyCodes = { /** * The PAUSE key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.PAUSE * @type {number} * @since 3.0.0 @@ -104793,7 +105627,7 @@ var KeyCodes = { /** * The CAPS_LOCK key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.CAPS_LOCK * @type {number} * @since 3.0.0 @@ -104802,7 +105636,7 @@ var KeyCodes = { /** * The ESC key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.ESC * @type {number} * @since 3.0.0 @@ -104811,7 +105645,7 @@ var KeyCodes = { /** * The SPACE key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.SPACE * @type {number} * @since 3.0.0 @@ -104820,7 +105654,7 @@ var KeyCodes = { /** * The PAGE_UP key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.PAGE_UP * @type {number} * @since 3.0.0 @@ -104829,7 +105663,7 @@ var KeyCodes = { /** * The PAGE_DOWN key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.PAGE_DOWN * @type {number} * @since 3.0.0 @@ -104838,7 +105672,7 @@ var KeyCodes = { /** * The END key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.END * @type {number} * @since 3.0.0 @@ -104847,7 +105681,7 @@ var KeyCodes = { /** * The HOME key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.HOME * @type {number} * @since 3.0.0 @@ -104856,7 +105690,7 @@ var KeyCodes = { /** * The LEFT key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.LEFT * @type {number} * @since 3.0.0 @@ -104865,7 +105699,7 @@ var KeyCodes = { /** * The UP key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.UP * @type {number} * @since 3.0.0 @@ -104874,7 +105708,7 @@ var KeyCodes = { /** * The RIGHT key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.RIGHT * @type {number} * @since 3.0.0 @@ -104883,7 +105717,7 @@ var KeyCodes = { /** * The DOWN key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.DOWN * @type {number} * @since 3.0.0 @@ -104892,7 +105726,7 @@ var KeyCodes = { /** * The PRINT_SCREEN key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.PRINT_SCREEN * @type {number} * @since 3.0.0 @@ -104901,7 +105735,7 @@ var KeyCodes = { /** * The INSERT key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.INSERT * @type {number} * @since 3.0.0 @@ -104910,7 +105744,7 @@ var KeyCodes = { /** * The DELETE key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.DELETE * @type {number} * @since 3.0.0 @@ -104919,7 +105753,7 @@ var KeyCodes = { /** * The ZERO key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.ZERO * @type {number} * @since 3.0.0 @@ -104928,7 +105762,7 @@ var KeyCodes = { /** * The ONE key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.ONE * @type {number} * @since 3.0.0 @@ -104937,7 +105771,7 @@ var KeyCodes = { /** * The TWO key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.TWO * @type {number} * @since 3.0.0 @@ -104946,7 +105780,7 @@ var KeyCodes = { /** * The THREE key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.THREE * @type {number} * @since 3.0.0 @@ -104955,7 +105789,7 @@ var KeyCodes = { /** * The FOUR key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.FOUR * @type {number} * @since 3.0.0 @@ -104964,7 +105798,7 @@ var KeyCodes = { /** * The FIVE key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.FIVE * @type {number} * @since 3.0.0 @@ -104973,7 +105807,7 @@ var KeyCodes = { /** * The SIX key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.SIX * @type {number} * @since 3.0.0 @@ -104982,7 +105816,7 @@ var KeyCodes = { /** * The SEVEN key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.SEVEN * @type {number} * @since 3.0.0 @@ -104991,7 +105825,7 @@ var KeyCodes = { /** * The EIGHT key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.EIGHT * @type {number} * @since 3.0.0 @@ -105000,7 +105834,7 @@ var KeyCodes = { /** * The NINE key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NINE * @type {number} * @since 3.0.0 @@ -105009,7 +105843,7 @@ var KeyCodes = { /** * The NUMPAD_ZERO key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_ZERO * @type {number} * @since 3.0.0 @@ -105018,7 +105852,7 @@ var KeyCodes = { /** * The NUMPAD_ONE key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_ONE * @type {number} * @since 3.0.0 @@ -105027,7 +105861,7 @@ var KeyCodes = { /** * The NUMPAD_TWO key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_TWO * @type {number} * @since 3.0.0 @@ -105036,7 +105870,7 @@ var KeyCodes = { /** * The NUMPAD_THREE key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_THREE * @type {number} * @since 3.0.0 @@ -105045,7 +105879,7 @@ var KeyCodes = { /** * The NUMPAD_FOUR key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_FOUR * @type {number} * @since 3.0.0 @@ -105054,7 +105888,7 @@ var KeyCodes = { /** * The NUMPAD_FIVE key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_FIVE * @type {number} * @since 3.0.0 @@ -105063,7 +105897,7 @@ var KeyCodes = { /** * The NUMPAD_SIX key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_SIX * @type {number} * @since 3.0.0 @@ -105072,7 +105906,7 @@ var KeyCodes = { /** * The NUMPAD_SEVEN key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_SEVEN * @type {number} * @since 3.0.0 @@ -105081,7 +105915,7 @@ var KeyCodes = { /** * The NUMPAD_EIGHT key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_EIGHT * @type {number} * @since 3.0.0 @@ -105090,7 +105924,7 @@ var KeyCodes = { /** * The NUMPAD_NINE key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_NINE * @type {number} * @since 3.0.0 @@ -105099,7 +105933,7 @@ var KeyCodes = { /** * The Numpad Addition (+) key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_ADD * @type {number} * @since 3.21.0 @@ -105108,7 +105942,7 @@ var KeyCodes = { /** * The Numpad Subtraction (-) key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_SUBTRACT * @type {number} * @since 3.21.0 @@ -105117,7 +105951,7 @@ var KeyCodes = { /** * The A key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.A * @type {number} * @since 3.0.0 @@ -105126,7 +105960,7 @@ var KeyCodes = { /** * The B key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.B * @type {number} * @since 3.0.0 @@ -105135,7 +105969,7 @@ var KeyCodes = { /** * The C key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.C * @type {number} * @since 3.0.0 @@ -105144,7 +105978,7 @@ var KeyCodes = { /** * The D key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.D * @type {number} * @since 3.0.0 @@ -105153,7 +105987,7 @@ var KeyCodes = { /** * The E key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.E * @type {number} * @since 3.0.0 @@ -105162,7 +105996,7 @@ var KeyCodes = { /** * The F key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F * @type {number} * @since 3.0.0 @@ -105171,7 +106005,7 @@ var KeyCodes = { /** * The G key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.G * @type {number} * @since 3.0.0 @@ -105180,7 +106014,7 @@ var KeyCodes = { /** * The H key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.H * @type {number} * @since 3.0.0 @@ -105189,7 +106023,7 @@ var KeyCodes = { /** * The I key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.I * @type {number} * @since 3.0.0 @@ -105198,7 +106032,7 @@ var KeyCodes = { /** * The J key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.J * @type {number} * @since 3.0.0 @@ -105207,7 +106041,7 @@ var KeyCodes = { /** * The K key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.K * @type {number} * @since 3.0.0 @@ -105216,7 +106050,7 @@ var KeyCodes = { /** * The L key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.L * @type {number} * @since 3.0.0 @@ -105225,7 +106059,7 @@ var KeyCodes = { /** * The M key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.M * @type {number} * @since 3.0.0 @@ -105234,7 +106068,7 @@ var KeyCodes = { /** * The N key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.N * @type {number} * @since 3.0.0 @@ -105243,7 +106077,7 @@ var KeyCodes = { /** * The O key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.O * @type {number} * @since 3.0.0 @@ -105252,7 +106086,7 @@ var KeyCodes = { /** * The P key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.P * @type {number} * @since 3.0.0 @@ -105261,7 +106095,7 @@ var KeyCodes = { /** * The Q key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.Q * @type {number} * @since 3.0.0 @@ -105270,7 +106104,7 @@ var KeyCodes = { /** * The R key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.R * @type {number} * @since 3.0.0 @@ -105279,7 +106113,7 @@ var KeyCodes = { /** * The S key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.S * @type {number} * @since 3.0.0 @@ -105288,7 +106122,7 @@ var KeyCodes = { /** * The T key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.T * @type {number} * @since 3.0.0 @@ -105297,7 +106131,7 @@ var KeyCodes = { /** * The U key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.U * @type {number} * @since 3.0.0 @@ -105306,7 +106140,7 @@ var KeyCodes = { /** * The V key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.V * @type {number} * @since 3.0.0 @@ -105315,7 +106149,7 @@ var KeyCodes = { /** * The W key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.W * @type {number} * @since 3.0.0 @@ -105324,7 +106158,7 @@ var KeyCodes = { /** * The X key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.X * @type {number} * @since 3.0.0 @@ -105333,7 +106167,7 @@ var KeyCodes = { /** * The Y key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.Y * @type {number} * @since 3.0.0 @@ -105342,7 +106176,7 @@ var KeyCodes = { /** * The Z key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.Z * @type {number} * @since 3.0.0 @@ -105351,7 +106185,7 @@ var KeyCodes = { /** * The F1 key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F1 * @type {number} * @since 3.0.0 @@ -105360,7 +106194,7 @@ var KeyCodes = { /** * The F2 key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F2 * @type {number} * @since 3.0.0 @@ -105369,7 +106203,7 @@ var KeyCodes = { /** * The F3 key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F3 * @type {number} * @since 3.0.0 @@ -105378,7 +106212,7 @@ var KeyCodes = { /** * The F4 key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F4 * @type {number} * @since 3.0.0 @@ -105387,7 +106221,7 @@ var KeyCodes = { /** * The F5 key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F5 * @type {number} * @since 3.0.0 @@ -105396,7 +106230,7 @@ var KeyCodes = { /** * The F6 key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F6 * @type {number} * @since 3.0.0 @@ -105405,7 +106239,7 @@ var KeyCodes = { /** * The F7 key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F7 * @type {number} * @since 3.0.0 @@ -105414,7 +106248,7 @@ var KeyCodes = { /** * The F8 key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F8 * @type {number} * @since 3.0.0 @@ -105423,7 +106257,7 @@ var KeyCodes = { /** * The F9 key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F9 * @type {number} * @since 3.0.0 @@ -105432,7 +106266,7 @@ var KeyCodes = { /** * The F10 key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F10 * @type {number} * @since 3.0.0 @@ -105441,7 +106275,7 @@ var KeyCodes = { /** * The F11 key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F11 * @type {number} * @since 3.0.0 @@ -105450,7 +106284,7 @@ var KeyCodes = { /** * The F12 key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F12 * @type {number} * @since 3.0.0 @@ -105459,7 +106293,7 @@ var KeyCodes = { /** * The SEMICOLON key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.SEMICOLON * @type {number} * @since 3.0.0 @@ -105468,7 +106302,7 @@ var KeyCodes = { /** * The PLUS key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.PLUS * @type {number} * @since 3.0.0 @@ -105477,7 +106311,7 @@ var KeyCodes = { /** * The COMMA key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.COMMA * @type {number} * @since 3.0.0 @@ -105486,7 +106320,7 @@ var KeyCodes = { /** * The MINUS key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.MINUS * @type {number} * @since 3.0.0 @@ -105495,7 +106329,7 @@ var KeyCodes = { /** * The PERIOD key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.PERIOD * @type {number} * @since 3.0.0 @@ -105504,7 +106338,7 @@ var KeyCodes = { /** * The FORWARD_SLASH key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.FORWARD_SLASH * @type {number} * @since 3.0.0 @@ -105513,7 +106347,7 @@ var KeyCodes = { /** * The BACK_SLASH key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.BACK_SLASH * @type {number} * @since 3.0.0 @@ -105522,7 +106356,7 @@ var KeyCodes = { /** * The QUOTES key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.QUOTES * @type {number} * @since 3.0.0 @@ -105531,7 +106365,7 @@ var KeyCodes = { /** * The BACKTICK key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.BACKTICK * @type {number} * @since 3.0.0 @@ -105540,7 +106374,7 @@ var KeyCodes = { /** * The OPEN_BRACKET key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.OPEN_BRACKET * @type {number} * @since 3.0.0 @@ -105549,7 +106383,7 @@ var KeyCodes = { /** * The CLOSED_BRACKET key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.CLOSED_BRACKET * @type {number} * @since 3.0.0 @@ -105558,7 +106392,7 @@ var KeyCodes = { /** * The SEMICOLON_FIREFOX key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.SEMICOLON_FIREFOX * @type {number} * @since 3.0.0 @@ -105567,7 +106401,7 @@ var KeyCodes = { /** * The COLON key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.COLON * @type {number} * @since 3.0.0 @@ -105576,7 +106410,7 @@ var KeyCodes = { /** * The COMMA_FIREFOX_WINDOWS key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.COMMA_FIREFOX_WINDOWS * @type {number} * @since 3.0.0 @@ -105585,7 +106419,7 @@ var KeyCodes = { /** * The COMMA_FIREFOX key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.COMMA_FIREFOX * @type {number} * @since 3.0.0 @@ -105594,7 +106428,7 @@ var KeyCodes = { /** * The BRACKET_RIGHT_FIREFOX key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.BRACKET_RIGHT_FIREFOX * @type {number} * @since 3.0.0 @@ -105603,7 +106437,7 @@ var KeyCodes = { /** * The BRACKET_LEFT_FIREFOX key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.BRACKET_LEFT_FIREFOX * @type {number} * @since 3.0.0 @@ -105621,7 +106455,7 @@ module.exports = KeyCodes; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -105644,7 +106478,7 @@ module.exports = KeyMap; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -105679,7 +106513,7 @@ module.exports = UpDuration; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -105949,11 +106783,11 @@ var MouseManager = new Class({ }, /** - * Attempts to disable the context menu from appearing if you right-click on the browser. + * Attempts to disable the context menu from appearing if you right-click on the game canvas, or specified input target. * * Works by listening for the `contextmenu` event and prevent defaulting it. * - * Use this if you need to enable right-button mouse support in your game, and the browser + * Use this if you need to enable right-button mouse support in your game, and the context * menu keeps getting in the way. * * @method Phaser.Input.Mouse.MouseManager#disableContextMenu @@ -105963,7 +106797,7 @@ var MouseManager = new Class({ */ disableContextMenu: function () { - document.body.addEventListener('contextmenu', function (event) + this.target.addEventListener('contextmenu', function (event) { event.preventDefault(); return false; @@ -106246,7 +107080,7 @@ module.exports = MouseManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -106258,7 +107092,7 @@ module.exports = MouseManager; module.exports = { MouseManager: __webpack_require__(7905) - + }; /* eslint-enable */ @@ -106270,7 +107104,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -106285,9 +107119,9 @@ var NOOP = __webpack_require__(72283); /** * @classdesc * The Touch Manager is a helper class that belongs to the Input Manager. - * + * * Its role is to listen for native DOM Touch Events and then pass them onto the Input Manager for further processing. - * + * * You do not need to create this class directly, the Input Manager will create an instance of it automatically. * * @class TouchManager @@ -106414,24 +107248,18 @@ var TouchManager = new Class({ this.onTouchCancelWindow = NOOP; /** - * The Touch Over event handler function. - * Initially empty and bound in the `startListeners` method. + * Are the event listeners hooked into `window.top` or `window`? * - * @name Phaser.Input.Touch.TouchManager#onTouchOver - * @type {function} - * @since 3.16.0 - */ - this.onTouchOver = NOOP; - - /** - * The Touch Out event handler function. - * Initially empty and bound in the `startListeners` method. + * This is set during the `boot` sequence. If the browser does not have access to `window.top`, + * such as in cross-origin iframe environments, this property gets set to `false` and the events + * are hooked into `window` instead. * - * @name Phaser.Input.Touch.TouchManager#onTouchOut - * @type {function} - * @since 3.16.0 + * @name Phaser.Input.Touch.TouchManager#isTop + * @type {boolean} + * @readonly + * @since 3.60.0 */ - this.onTouchOut = NOOP; + this.isTop = true; inputManager.events.once(InputEvents.MANAGER_BOOT, this.boot, this); }, @@ -106455,6 +107283,10 @@ var TouchManager = new Class({ { this.target = this.manager.game.canvas; } + else if (typeof this.target === 'string') + { + this.target = document.getElementById(this.target); + } if (config.disableContextMenu) { @@ -106469,9 +107301,9 @@ var TouchManager = new Class({ /** * Attempts to disable the context menu from appearing if you touch-hold on the browser. - * + * * Works by listening for the `contextmenu` event and prevent defaulting it. - * + * * Use this if you need to disable the OS context menu on mobile. * * @method Phaser.Input.Touch.TouchManager#disableContextMenu @@ -106481,7 +107313,7 @@ var TouchManager = new Class({ */ disableContextMenu: function () { - document.body.addEventListener('contextmenu', function (event) + this.target.addEventListener('contextmenu', function (event) { event.preventDefault(); return false; @@ -106492,7 +107324,7 @@ var TouchManager = new Class({ /** * Starts the Touch Event listeners running as long as an input target is set. - * + * * This method is called automatically if Touch Input is enabled in the game config, * which it is by default. However, you can call it manually should you need to * delay input capturing until later in the game. @@ -106502,9 +107334,30 @@ var TouchManager = new Class({ */ startListeners: function () { + var target = this.target; + + if (!target) + { + return; + } + var _this = this; - var canvas = this.manager.canvas; - var autoFocus = (window && window.focus && this.manager.game.config.autoFocus); + var manager = this.manager; + var canvas = manager.canvas; + var autoFocus = (window && window.focus && manager.game.config.autoFocus); + + this.onTouchMove = function (event) + { + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled) + { + manager.onTouchMove(event); + + if (_this.capture && event.cancelable) + { + event.preventDefault(); + } + } + }; this.onTouchStart = function (event) { @@ -106513,10 +107366,10 @@ var TouchManager = new Class({ window.focus(); } - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled) { - _this.manager.onTouchStart(event); - + manager.onTouchStart(event); + if (_this.capture && event.cancelable && event.target === canvas) { event.preventDefault(); @@ -106526,32 +107379,19 @@ var TouchManager = new Class({ this.onTouchStartWindow = function (event) { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled && event.target !== canvas) + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled && event.target !== canvas) { // Only process the event if the target isn't the canvas - _this.manager.onTouchStart(event); - } - }; - - this.onTouchMove = function (event) - { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) - { - _this.manager.onTouchMove(event); - - if (_this.capture && event.cancelable) - { - event.preventDefault(); - } + manager.onTouchStart(event); } }; this.onTouchEnd = function (event) { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled) { - _this.manager.onTouchEnd(event); - + manager.onTouchEnd(event); + if (_this.capture && event.cancelable && event.target === canvas) { event.preventDefault(); @@ -106561,19 +107401,19 @@ var TouchManager = new Class({ this.onTouchEndWindow = function (event) { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled && event.target !== canvas) + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled && event.target !== canvas) { // Only process the event if the target isn't the canvas - _this.manager.onTouchEnd(event); + manager.onTouchEnd(event); } }; this.onTouchCancel = function (event) { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled) { - _this.manager.onTouchCancel(event); - + manager.onTouchCancel(event); + if (_this.capture) { event.preventDefault(); @@ -106583,50 +107423,37 @@ var TouchManager = new Class({ this.onTouchCancelWindow = function (event) { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled) { - _this.manager.onTouchCancel(event); + manager.onTouchCancel(event); } }; - this.onTouchOver = function (event) - { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) - { - _this.manager.setCanvasOver(event); - } - }; - - this.onTouchOut = function (event) - { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) - { - _this.manager.setCanvasOut(event); - } - }; - - var target = this.target; - - if (!target) - { - return; - } - + var capture = this.capture; var passive = { passive: true }; var nonPassive = { passive: false }; - target.addEventListener('touchstart', this.onTouchStart, (this.capture) ? nonPassive : passive); - target.addEventListener('touchmove', this.onTouchMove, (this.capture) ? nonPassive : passive); - target.addEventListener('touchend', this.onTouchEnd, (this.capture) ? nonPassive : passive); - target.addEventListener('touchcancel', this.onTouchCancel, (this.capture) ? nonPassive : passive); - target.addEventListener('touchover', this.onTouchOver, (this.capture) ? nonPassive : passive); - target.addEventListener('touchout', this.onTouchOut, (this.capture) ? nonPassive : passive); + target.addEventListener('touchstart', this.onTouchStart, (capture) ? nonPassive : passive); + target.addEventListener('touchmove', this.onTouchMove, (capture) ? nonPassive : passive); + target.addEventListener('touchend', this.onTouchEnd, (capture) ? nonPassive : passive); + target.addEventListener('touchcancel', this.onTouchCancel, (capture) ? nonPassive : passive); - if (window && this.manager.game.config.inputWindowEvents) + if (window && manager.game.config.inputWindowEvents) { - window.addEventListener('touchstart', this.onTouchStartWindow, nonPassive); - window.addEventListener('touchend', this.onTouchEndWindow, nonPassive); - window.addEventListener('touchcancel', this.onTouchCancelWindow, nonPassive); + try + { + window.top.addEventListener('touchstart', this.onTouchStartWindow, nonPassive); + window.top.addEventListener('touchend', this.onTouchEndWindow, nonPassive); + window.top.addEventListener('touchcancel', this.onTouchCancelWindow, nonPassive); + } + catch (exception) + { + window.addEventListener('touchstart', this.onTouchStartWindow, nonPassive); + window.addEventListener('touchend', this.onTouchEndWindow, nonPassive); + window.addEventListener('touchcancel', this.onTouchCancelWindow, nonPassive); + + this.isTop = false; + } } this.enabled = true; @@ -106647,13 +107474,14 @@ var TouchManager = new Class({ target.removeEventListener('touchmove', this.onTouchMove); target.removeEventListener('touchend', this.onTouchEnd); target.removeEventListener('touchcancel', this.onTouchCancel); - target.removeEventListener('touchover', this.onTouchOver); - target.removeEventListener('touchout', this.onTouchOut); if (window) { - window.removeEventListener('touchstart', this.onTouchStartWindow); - window.removeEventListener('touchend', this.onTouchEndWindow); + target = (this.isTop) ? window.top : window; + + target.removeEventListener('touchstart', this.onTouchStartWindow); + target.removeEventListener('touchend', this.onTouchEndWindow); + target.removeEventListener('touchcancel', this.onTouchCancelWindow); } }, @@ -106684,7 +107512,7 @@ module.exports = TouchManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -106696,7 +107524,7 @@ module.exports = TouchManager; module.exports = { TouchManager: __webpack_require__(37579) - + }; /* eslint-enable */ @@ -106708,7 +107536,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -106767,6 +107595,11 @@ var File = new Class({ */ this.type = GetFastValue(fileConfig, 'type', false); + if (!this.type) + { + throw new Error('Invalid File type: ' + this.type); + } + /** * Unique cache key (unique within its file type) * @@ -106783,9 +107616,9 @@ var File = new Class({ this.key = loader.prefix + loadKey; } - if (!this.type || !this.key) + if (!this.key) { - throw new Error('Invalid Loader.' + this.type + ' key'); + throw new Error('Invalid File key: ' + this.key); } var url = GetFastValue(fileConfig, 'url'); @@ -107018,10 +107851,10 @@ var File = new Class({ */ onLoad: function (xhr, event) { - // On iOS, Capacitor often runs on a capacitor:// protocol, meaning local files are served from capacitor:// rather than file:// - // See: https://github.com/photonstorm/phaser/issues/5685 - - var isLocalFile = xhr.responseURL && (xhr.responseURL.indexOf('file://') === 0 || xhr.responseURL.indexOf('capacitor://') === 0); + var isLocalFile = xhr.responseURL && this.loader.localSchemes.some(function (scheme) + { + return xhr.responseURL.indexOf(scheme) === 0; + }); var localFileOk = (isLocalFile && event.target.status === 0); @@ -107157,12 +107990,10 @@ var File = new Class({ */ addToCache: function () { - if (this.cache) + if (this.cache && this.data) { this.cache.add(this.key, this.data); } - - this.pendingDestroy(); }, /** @@ -107176,6 +108007,11 @@ var File = new Class({ */ pendingDestroy: function (data) { + if (this.state === CONST.FILE_PENDING_DESTROY) + { + return; + } + if (data === undefined) { data = this.data; } var key = this.key; @@ -107185,6 +108021,8 @@ var File = new Class({ this.loader.emit(Events.FILE_KEY_COMPLETE + type + '-' + key, key, type, data); this.loader.flagForRemoval(this); + + this.state = CONST.FILE_PENDING_DESTROY; }, /** @@ -107267,7 +108105,7 @@ module.exports = File; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -107281,13 +108119,13 @@ var FileTypesManager = { /** * Static method called when a LoaderPlugin is created. - * + * * Loops through the local types object and injects all of them as * properties into the LoaderPlugin instance. * * @method Phaser.Loader.FileTypesManager.install * @since 3.0.0 - * + * * @param {Phaser.Loader.LoaderPlugin} loader - The LoaderPlugin to install the types into. */ install: function (loader) @@ -107300,12 +108138,12 @@ var FileTypesManager = { /** * Static method called directly by the File Types. - * + * * The key is a reference to the function used to load the files via the Loader, i.e. `image`. * * @method Phaser.Loader.FileTypesManager.register * @since 3.0.0 - * + * * @param {string} key - The key that will be used as the method name in the LoaderPlugin. * @param {function} factoryFunction - The function that will be called when LoaderPlugin.key is invoked. */ @@ -107337,7 +108175,7 @@ module.exports = FileTypesManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -107379,7 +108217,7 @@ module.exports = GetURL; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -107390,6 +108228,7 @@ var EventEmitter = __webpack_require__(6659); var Events = __webpack_require__(683); var FileTypesManager = __webpack_require__(76846); var GetFastValue = __webpack_require__(72632); +var GetValue = __webpack_require__(10850); var PluginCache = __webpack_require__(91963); var SceneEvents = __webpack_require__(7599); var XHRSettings = __webpack_require__(33868); @@ -107595,6 +108434,18 @@ var LoaderPlugin = new Class({ */ this.imageLoadType = GetFastValue(sceneConfig, 'imageLoadType', gameConfig.loaderImageLoadType); + /** + * An array of all schemes that the Loader considers as being 'local'. + * + * This is populated by the `Phaser.Core.Config#loaderLocalScheme` game configuration setting and defaults to + * `[ 'file://', 'capacitor://' ]`. Additional local schemes can be added to this array as needed. + * + * @name Phaser.Loader.LoaderPlugin#localSchemes + * @type {string[]} + * @since 3.60.0 + */ + this.localSchemes = GetFastValue(sceneConfig, 'localScheme', gameConfig.loaderLocalScheme); + /** * The total number of files to load. It may not always be accurate because you may add to the Loader during the process * of loading, especially if you load a Pack File. Therefore this value can change, but in most cases remains static. @@ -107982,9 +108833,13 @@ var LoaderPlugin = new Class({ addPack: function (pack, packKey) { // if no packKey provided we'll add everything to the queue - if (packKey && pack.hasOwnProperty(packKey)) + if (typeof(packKey) === 'string') { - pack = { packKey: pack[packKey] }; + var subPack = GetValue(pack, packKey); + if (subPack) + { + pack = { packKey: subPack }; + } } var total = 0; @@ -108268,12 +109123,14 @@ var LoaderPlugin = new Class({ { // If we got here then all files the link file needs are ready to add to the cache file.multiFile.addToCache(); + file.multiFile.pendingDestroy(); } } else { // If we got here, then the file processed, so let it add itself to its cache file.addToCache(); + file.pendingDestroy(); } } @@ -108472,7 +109329,7 @@ module.exports = LoaderPlugin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -108521,11 +109378,13 @@ module.exports = MergeXHRSettings; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var Class = __webpack_require__(56694); +var CONST = __webpack_require__(12117); +var Events = __webpack_require__(683); /** * @classdesc @@ -108607,6 +109466,15 @@ var MultiFile = new Class({ */ this.files = finalFiles; + /** + * The current state of the file. One of the FILE_CONST values. + * + * @name Phaser.Loader.MultiFile#state + * @type {number} + * @since 3.60.0 + */ + this.state = CONST.FILE_PENDING; + /** * The completion status of this MultiFile. * @@ -108756,6 +109624,53 @@ var MultiFile = new Class({ // eslint-disable-next-line no-console console.error('File failed: %s "%s" (via %s "%s")', this.type, this.key, file.type, file.key); } + }, + + /** + * Called once all children of this multi file have been added to their caches and is now + * ready for deletion from the Loader. + * + * It will emit a `filecomplete` event from the LoaderPlugin. + * + * @method Phaser.Loader.MultiFile#pendingDestroy + * @fires Phaser.Loader.Events#FILE_COMPLETE + * @fires Phaser.Loader.Events#FILE_KEY_COMPLETE + * @since 3.60.0 + */ + pendingDestroy: function () + { + if (this.state === CONST.FILE_PENDING_DESTROY) + { + return; + } + + var key = this.key; + var type = this.type; + + this.loader.emit(Events.FILE_COMPLETE, key, type); + this.loader.emit(Events.FILE_KEY_COMPLETE + type + '-' + key, key, type); + + this.loader.flagForRemoval(this); + + for (var i = 0; i < this.files.length; i++) + { + this.files[i].pendingDestroy(); + } + + this.state = CONST.FILE_PENDING_DESTROY; + }, + + /** + * Destroy this Multi File and any references it holds. + * + * @method Phaser.Loader.MultiFile#destroy + * @since 3.60.0 + */ + destroy: function () + { + this.loader = null; + this.files = null; + this.config = null; } }); @@ -108770,7 +109685,7 @@ module.exports = MultiFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -108852,7 +109767,7 @@ module.exports = XHRLoader; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -108923,7 +109838,7 @@ module.exports = XHRSettings; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -108931,7 +109846,7 @@ var FILE_CONST = { /** * The Loader is idle. - * + * * @name Phaser.Loader.LOADER_IDLE * @type {number} * @since 3.0.0 @@ -108940,7 +109855,7 @@ var FILE_CONST = { /** * The Loader is actively loading. - * + * * @name Phaser.Loader.LOADER_LOADING * @type {number} * @since 3.0.0 @@ -108949,7 +109864,7 @@ var FILE_CONST = { /** * The Loader is processing files is has loaded. - * + * * @name Phaser.Loader.LOADER_PROCESSING * @type {number} * @since 3.0.0 @@ -108958,7 +109873,7 @@ var FILE_CONST = { /** * The Loader has completed loading and processing. - * + * * @name Phaser.Loader.LOADER_COMPLETE * @type {number} * @since 3.0.0 @@ -108967,7 +109882,7 @@ var FILE_CONST = { /** * The Loader is shutting down. - * + * * @name Phaser.Loader.LOADER_SHUTDOWN * @type {number} * @since 3.0.0 @@ -108976,7 +109891,7 @@ var FILE_CONST = { /** * The Loader has been destroyed. - * + * * @name Phaser.Loader.LOADER_DESTROYED * @type {number} * @since 3.0.0 @@ -108984,8 +109899,8 @@ var FILE_CONST = { LOADER_DESTROYED: 5, /** - * File is in the load queue but not yet started - * + * File is in the load queue but not yet started. + * * @name Phaser.Loader.FILE_PENDING * @type {number} * @since 3.0.0 @@ -108994,7 +109909,7 @@ var FILE_CONST = { /** * File has been started to load by the loader (onLoad called) - * + * * @name Phaser.Loader.FILE_LOADING * @type {number} * @since 3.0.0 @@ -109002,8 +109917,8 @@ var FILE_CONST = { FILE_LOADING: 11, /** - * File has loaded successfully, awaiting processing - * + * File has loaded successfully, awaiting processing. + * * @name Phaser.Loader.FILE_LOADED * @type {number} * @since 3.0.0 @@ -109011,8 +109926,8 @@ var FILE_CONST = { FILE_LOADED: 12, /** - * File failed to load - * + * File failed to load. + * * @name Phaser.Loader.FILE_FAILED * @type {number} * @since 3.0.0 @@ -109021,7 +109936,7 @@ var FILE_CONST = { /** * File is being processed (onProcess callback) - * + * * @name Phaser.Loader.FILE_PROCESSING * @type {number} * @since 3.0.0 @@ -109030,7 +109945,7 @@ var FILE_CONST = { /** * The File has errored somehow during processing. - * + * * @name Phaser.Loader.FILE_ERRORED * @type {number} * @since 3.0.0 @@ -109039,7 +109954,7 @@ var FILE_CONST = { /** * File has finished processing. - * + * * @name Phaser.Loader.FILE_COMPLETE * @type {number} * @since 3.0.0 @@ -109047,8 +109962,8 @@ var FILE_CONST = { FILE_COMPLETE: 17, /** - * File has been destroyed - * + * File has been destroyed. + * * @name Phaser.Loader.FILE_DESTROYED * @type {number} * @since 3.0.0 @@ -109056,13 +109971,22 @@ var FILE_CONST = { FILE_DESTROYED: 18, /** - * File was populated from local data and doesn't need an HTTP request - * + * File was populated from local data and doesn't need an HTTP request. + * * @name Phaser.Loader.FILE_POPULATED * @type {number} * @since 3.0.0 */ - FILE_POPULATED: 19 + FILE_POPULATED: 19, + + /** + * File is pending being destroyed. + * + * @name Phaser.Loader.FILE_PENDING_DESTROY + * @type {number} + * @since 3.60.0 + */ + FILE_PENDING_DESTROY: 20 }; @@ -109076,7 +110000,7 @@ module.exports = FILE_CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -109107,7 +110031,7 @@ module.exports = 'addfile'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -109136,25 +110060,27 @@ module.exports = 'complete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The File Load Complete Event. - * - * This event is dispatched by the Loader Plugin when any file in the queue finishes loading. - * + * + * This event is dispatched by the Loader Plugin when _any_ file in the queue finishes loading. + * * Listen to it from a Scene using: `this.load.on('filecomplete', listener)`. - * + * + * Make sure you remove this listener when you have finished, or it will continue to fire if the Scene reloads. + * * You can also listen for the completion of a specific file. See the [FILE_KEY_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_KEY_COMPLETE} event. * * @event Phaser.Loader.Events#FILE_COMPLETE * @since 3.0.0 - * + * * @param {string} key - The key of the file that just loaded and finished processing. * @param {string} type - The [file type]{@link Phaser.Loader.File#type} of the file that just loaded, i.e. `image`. - * @param {any} data - The raw data the file contained. + * @param {any} [data] - The raw data the file contained. If the file was a multi-file, like an atlas or bitmap font, this parameter will be undefined. */ module.exports = 'filecomplete'; @@ -109166,17 +110092,17 @@ module.exports = 'filecomplete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The File Load Complete Event. - * + * * This event is dispatched by the Loader Plugin when any file in the queue finishes loading. - * + * * It uses a special dynamic event name constructed from the key and type of the file. - * + * * For example, if you have loaded an `image` with a key of `monster`, you can listen for it * using the following: * @@ -109187,29 +110113,31 @@ module.exports = 'filecomplete'; * ``` * * Or, if you have loaded a texture `atlas` with a key of `Level1`: - * + * * ```javascript * this.load.on('filecomplete-atlas-Level1', function (key, type, data) { * // Your handler code * }); * ``` - * + * * Or, if you have loaded a sprite sheet with a key of `Explosion` and a prefix of `GAMEOVER`: - * + * * ```javascript * this.load.on('filecomplete-spritesheet-GAMEOVERExplosion', function (key, type, data) { * // Your handler code * }); * ``` - * + * + * Make sure you remove your listeners when you have finished, or they will continue to fire if the Scene reloads. + * * You can also listen for the generic completion of files. See the [FILE_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_COMPLETE} event. * * @event Phaser.Loader.Events#FILE_KEY_COMPLETE * @since 3.0.0 - * + * * @param {string} key - The key of the file that just loaded and finished processing. * @param {string} type - The [file type]{@link Phaser.Loader.File#type} of the file that just loaded, i.e. `image`. - * @param {any} data - The raw data the file contained. + * @param {any} [data] - The raw data the file contained. If the file was a multi-file, like an atlas or bitmap font, this parameter will be undefined. */ module.exports = 'filecomplete-'; @@ -109221,7 +110149,7 @@ module.exports = 'filecomplete-'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -109247,7 +110175,7 @@ module.exports = 'loaderror'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -109274,7 +110202,7 @@ module.exports = 'load'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -109302,7 +110230,7 @@ module.exports = 'fileprogress'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -109332,7 +110260,7 @@ module.exports = 'postprocess'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -109358,22 +110286,22 @@ module.exports = 'progress'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Loader Plugin Start Event. - * + * * This event is dispatched when the Loader starts running. At this point load progress is zero. - * + * * This event is dispatched even if there aren't any files in the load queue. - * + * * Listen to it from a Scene using: `this.load.on('start', listener)`. * * @event Phaser.Loader.Events#START * @since 3.0.0 - * + * * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. */ module.exports = 'start'; @@ -109386,7 +110314,7 @@ module.exports = 'start'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -109417,7 +110345,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -109619,7 +110547,7 @@ module.exports = AnimationJSONFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -109890,7 +110818,7 @@ module.exports = AsepriteFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -109990,8 +110918,6 @@ var AtlasJSONFile = new Class({ this.loader.textureManager.addAtlas(image.key, image.data, json.data, normalMap); - json.pendingDestroy(); - this.complete = true; } } @@ -110022,7 +110948,16 @@ var AtlasJSONFile = new Class({ * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details. * * Phaser expects the atlas data to be provided in a JSON file, using either the JSON Hash or JSON Array format. - * These files are created by software such as Texture Packer, Shoebox and Adobe Flash / Animate. + * + * These files are created by software such as: + * + * * [Texture Packer](https://www.codeandweb.com/texturepacker/tutorials/how-to-create-sprite-sheets-for-phaser3?source=photonstorm) + * * [Shoebox](https://renderhjs.net/shoebox/) + * * [Gamma Texture Packer](https://gammafp.com/tool/atlas-packer/) + * * [Adobe Flash / Animate](https://www.adobe.com/uk/products/animate.html) + * * [Free Texture Packer](http://free-tex-packer.com/) + * * [Leshy SpriteSheet Tool](https://www.leshylabs.com/apps/sstool/) + * * If you are using Texture Packer and have enabled multi-atlas support, then please use the Phaser Multi Atlas loader * instead of this one. * @@ -110140,7 +111075,7 @@ module.exports = AtlasJSONFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -110238,8 +111173,6 @@ var AtlasXMLFile = new Class({ this.loader.textureManager.addAtlasXML(image.key, image.data, xml.data, normalMap); - xml.pendingDestroy(); - this.complete = true; } } @@ -110384,7 +111317,7 @@ module.exports = AtlasXMLFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -110412,7 +111345,7 @@ var IsPlainObject = __webpack_require__(42911); * * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. * @param {(string|Phaser.Types.Loader.FileTypes.AudioFileConfig)} key - The key to use for this file, or a file configuration object. - * @param {any} [urlConfig] - The absolute or relative URL to load this file from in a config object. + * @param {Phaser.Types.Loader.FileTypes.AudioFileURLConfig} [urlConfig] - The absolute or relative URL to load this file from in a config object. * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. * @param {AudioContext} [audioContext] - The AudioContext this file will use to process itself. */ @@ -110603,7 +111536,7 @@ AudioFile.getAudioURL = function (game, urls) * @since 3.0.0 * * @param {(string|Phaser.Types.Loader.FileTypes.AudioFileConfig|Phaser.Types.Loader.FileTypes.AudioFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. - * @param {(string|string[])} [urls] - The absolute or relative URL to load the audio files from. + * @param {(string|string[]|Phaser.Types.Loader.FileTypes.AudioFileURLConfig|Phaser.Types.Loader.FileTypes.AudioFileURLConfig[])} [urls] - The absolute or relative URL to load the audio files from. * @param {any} [config] - An object containing an `instances` property for HTML5Audio. Defaults to 1. * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. * @@ -110659,7 +111592,7 @@ module.exports = AudioFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -110950,7 +111883,7 @@ FileTypesManager.register('audioSprite', function (key, jsonURL, audioURL, audio /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -111133,7 +112066,7 @@ module.exports = BinaryFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -111230,7 +112163,6 @@ var BitmapFontFile = new Class({ var xml = this.files[1]; image.addToCache(); - xml.pendingDestroy(); var texture = image.cache.get(image.key); @@ -111381,7 +112313,7 @@ module.exports = BitmapFontFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -111560,6 +112492,7 @@ var Class = __webpack_require__(56694); var FileTypesManager = __webpack_require__(76846); var GetFastValue = __webpack_require__(72632); var ImageFile = __webpack_require__(42927); +var IsPlainObject = __webpack_require__(42911); var JSONFile = __webpack_require__(70806); var KTXParser = __webpack_require__(67409); var Merge = __webpack_require__(30657); @@ -111773,11 +112706,6 @@ var CompressedTextureFile = new Class({ textureManager.addCompressedTexture(image.key, textureData, atlasData); } - - if (json) - { - json.pendingDestroy(); - } } this.complete = true; @@ -111860,11 +112788,6 @@ var CompressedTextureFile = new Class({ textureManager.addAtlasJSONArray(this.key, images, data, normalMaps); this.complete = true; - - for (i = 0; i < this.files.length; i++) - { - this.files[i].pendingDestroy(); - } } }); @@ -111924,6 +112847,22 @@ var CompressedTextureFile = new Class({ * * When loading a Multi Atlas you do not need to specify the `textureURL` property as it will be read from the JSON file. * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.texture({ + * key: 'yourPic', + * url: { + * ASTC: { type: 'PVR', textureURL: 'pic-astc-4x4.pvr' }, + * PVRTC: { type: 'PVR', textureURL: 'pic-pvrtc-4bpp-rgba.pvr' }, + * S3TC: { type: 'PVR', textureURL: 'pic-dxt5.pvr' }, + * IMG: { textureURL: 'pic.png' } + * } + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.CompressedTextureFileConfig` for more details. + * * The number of formats you provide to this function is up to you, but you should ensure you * cover the primary platforms where appropriate. * @@ -111986,71 +112925,102 @@ var CompressedTextureFile = new Class({ * @fires Phaser.Loader.LoaderPlugin#ADD * @since 3.60.0 * - * @param {string} key - The key to use for this file within the Texture Manager. - * @param {Phaser.Types.Loader.FileTypes.CompressedTextureFileConfig} urls - The compressed texture configuration object. + * @param {(string|Phaser.Types.Loader.FileTypes.CompressedTextureFileConfig|Phaser.Types.Loader.FileTypes.CompressedTextureFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {Phaser.Types.Loader.FileTypes.CompressedTextureFileConfig} [url] - The compressed texture configuration object. Not required if passing a config object as the `key` parameter. * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. * * @return {this} The Loader instance. */ -FileTypesManager.register('texture', function (key, urls, xhrSettings) +FileTypesManager.register('texture', function (key, url, xhrSettings) { - var entry = { - format: null, - type: null, - textureURL: null, - atlasURL: null, - multiAtlasURL: null, - multiPath: null, - multiBaseURL: null - }; - var renderer = this.systems.renderer; - for (var textureBaseFormat in urls) + var AddEntry = function (loader, key, urls, xhrSettings) { - if (renderer.supportsCompressedTexture(textureBaseFormat)) - { - var urlEntry = urls[textureBaseFormat]; + var entry = { + format: null, + type: null, + textureURL: undefined, + atlasURL: undefined, + multiAtlasURL: undefined, + multiPath: undefined, + multiBaseURL: undefined + }; - if (typeof urlEntry === 'string') + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + urls = GetFastValue(config, 'url'), + xhrSettings = GetFastValue(config, 'xhrSettings'); + } + + var matched = false; + + for (var textureBaseFormat in urls) + { + if (renderer.supportsCompressedTexture(textureBaseFormat)) { - entry.textureURL = urlEntry; + var urlEntry = urls[textureBaseFormat]; + + if (typeof urlEntry === 'string') + { + entry.textureURL = urlEntry; + } + else + { + entry = Merge(urlEntry, entry); + } + + entry.format = textureBaseFormat.toUpperCase(); + + matched = true; + + break; + } + } + + if (!matched) + { + console.warn('No supported compressed texture format or IMG fallback', key); + } + else if (entry.format === 'IMG') + { + var multifile; + if (entry.multiAtlasURL) + { + multifile = new MultiAtlasFile(this, key, entry.multiAtlasURL, entry.multiPath, entry.multiBaseURL, xhrSettings); + loader.addFile(multifile.files); + } + else if (entry.atlasURL) + { + multifile = new AtlasJSONFile(loader, key, entry.textureURL, entry.atlasURL, xhrSettings); + loader.addFile(multifile.files); } else { - entry = Merge(urlEntry, entry); + loader.addFile(new ImageFile(loader, key, entry.textureURL, xhrSettings)); } - - entry.format = textureBaseFormat.toUpperCase(); - - break; - } - } - - if (!entry) - { - console.warn('No supported texture format or IMG fallback', key); - } - else if (entry.format === 'IMG') - { - if (entry.multiAtlasURL) - { - this.addFile(new MultiAtlasFile(this, key, entry.multiAtlasURL, entry.multiPath, entry.multiBaseURL, xhrSettings)); - } - else if (entry.atlasURL) - { - this.addFile(new AtlasJSONFile(this, key, entry.textureURL, entry.atlasURL, xhrSettings)); } else { - this.addFile(new ImageFile(this, key, entry.textureURL, xhrSettings)); + var texture = new CompressedTextureFile(loader, key, entry, xhrSettings); + + loader.addFile(texture.files); + } + }; + + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + AddEntry(this, key[i]); } } else { - var texture = new CompressedTextureFile(this, key, entry, xhrSettings); - - this.addFile(texture.files); + AddEntry(this, key, url, xhrSettings); } return this; @@ -112066,7 +113036,7 @@ module.exports = CompressedTextureFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -112216,8 +113186,6 @@ var GLSLFile = new Class({ { this.cache.add(this.key, new Shader(this.key, '', this.data)); } - - this.pendingDestroy(); }, /** @@ -112478,7 +113446,7 @@ module.exports = GLSLFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -112494,7 +113462,7 @@ var IsPlainObject = __webpack_require__(42911); * A single Audio File suitable for loading by the Loader. * * These are created when you use the Phaser.Loader.LoaderPlugin#audio method and are not typically created directly. - * + * * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#audio. * * @class HTML5AudioFile @@ -112682,7 +113650,7 @@ module.exports = HTML5AudioFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -112858,7 +113826,7 @@ module.exports = HTMLFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -113001,9 +113969,7 @@ var HTMLTextureFile = new Class({ */ addToCache: function () { - var texture = this.cache.addImage(this.key, this.data); - - this.pendingDestroy(texture); + this.cache.addImage(this.key, this.data); } }); @@ -113117,7 +114083,7 @@ module.exports = HTMLTextureFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -113318,29 +114284,22 @@ var ImageFile = new Class({ */ addToCache: function () { - var texture; var linkFile = this.linkFile; - if (linkFile && linkFile.state === CONST.FILE_COMPLETE) + if (linkFile && linkFile.state >= CONST.FILE_COMPLETE) { if (this.type === 'image') { - texture = this.cache.addImage(this.key, this.data, linkFile.data); + this.cache.addImage(this.key, this.data, linkFile.data); } else { - texture = this.cache.addImage(linkFile.key, linkFile.data, this.data); + this.cache.addImage(linkFile.key, linkFile.data, this.data); } - - this.pendingDestroy(texture); - - linkFile.pendingDestroy(texture); } else if (!linkFile) { - texture = this.cache.addImage(this.key, this.data); - - this.pendingDestroy(texture); + this.cache.addImage(this.key, this.data); } } @@ -113469,7 +114428,7 @@ module.exports = ImageFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -113709,7 +114668,7 @@ module.exports = JSONFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -113913,11 +114872,6 @@ var MultiAtlasFile = new Class({ this.loader.textureManager.addAtlasJSONArray(this.key, images, data, normalMaps); this.complete = true; - - for (i = 0; i < this.files.length; i++) - { - this.files[i].pendingDestroy(); - } } } @@ -114043,7 +114997,7 @@ module.exports = MultiAtlasFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -114261,7 +115215,7 @@ module.exports = MultiScriptFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -114516,7 +115470,7 @@ module.exports = OBJFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -114735,7 +115689,7 @@ module.exports = PackFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -114948,7 +115902,7 @@ module.exports = PluginFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -115135,9 +116089,7 @@ var SVGFile = new Class({ */ addToCache: function () { - var texture = this.cache.addImage(this.key, this.data); - - this.pendingDestroy(texture); + this.cache.addImage(this.key, this.data); } }); @@ -115288,7 +116240,7 @@ module.exports = SVGFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -115509,7 +116461,7 @@ module.exports = SceneFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -115716,7 +116668,7 @@ module.exports = ScenePluginFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -115744,6 +116696,7 @@ var IsPlainObject = __webpack_require__(42911); * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. * @param {(string|Phaser.Types.Loader.FileTypes.ScriptFileConfig)} key - The key to use for this file, or a file configuration object. * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". + * @param {string} [type='script'] - The script type. Should be either 'script' for classic JavaScript, or 'module' if the file contains an exported module. * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. */ var ScriptFile = new Class({ @@ -115752,7 +116705,7 @@ var ScriptFile = new Class({ initialize: - function ScriptFile (loader, key, url, xhrSettings) + function ScriptFile (loader, key, url, type, xhrSettings) { var extension = 'js'; @@ -115762,12 +116715,17 @@ var ScriptFile = new Class({ key = GetFastValue(config, 'key'); url = GetFastValue(config, 'url'); + type = GetFastValue(config, 'type', 'script'); xhrSettings = GetFastValue(config, 'xhrSettings'); extension = GetFastValue(config, 'extension', extension); } + else if (type === undefined) + { + type = 'script'; + } var fileConfig = { - type: 'script', + type: type, cache: false, extension: extension, responseType: 'text', @@ -115815,6 +116773,15 @@ var ScriptFile = new Class({ * } * ``` * + * If the script file contains a module, then you should specify that using the 'type' parameter: + * + * ```javascript + * function preload () + * { + * this.load.script('aliens', 'lib/aliens.js', 'module'); + * } + * ``` + * * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, * or if it's already running, when the next free load slot becomes available. This happens automatically if you * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued @@ -115830,7 +116797,8 @@ var ScriptFile = new Class({ * ```javascript * this.load.script({ * key: 'aliens', - * url: 'lib/aliens.js' + * url: 'lib/aliens.js', + * type: 'script' // or 'module' * }); * ``` * @@ -115856,11 +116824,12 @@ var ScriptFile = new Class({ * * @param {(string|Phaser.Types.Loader.FileTypes.ScriptFileConfig|Phaser.Types.Loader.FileTypes.ScriptFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". + * @param {string} [type='script'] - The script type. Should be either 'script' for classic JavaScript, or 'module' if the file contains an exported module. * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. * * @return {this} The Loader instance. */ -FileTypesManager.register('script', function (key, url, xhrSettings) +FileTypesManager.register('script', function (key, url, type, xhrSettings) { if (Array.isArray(key)) { @@ -115872,7 +116841,7 @@ FileTypesManager.register('script', function (key, url, xhrSettings) } else { - this.addFile(new ScriptFile(this, key, url, xhrSettings)); + this.addFile(new ScriptFile(this, key, url, type, xhrSettings)); } return this; @@ -115888,7 +116857,7 @@ module.exports = ScriptFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -115901,7 +116870,7 @@ var ImageFile = __webpack_require__(42927); * A single Sprite Sheet Image File suitable for loading by the Loader. * * These are created when you use the Phaser.Loader.LoaderPlugin#spritesheet method and are not typically created directly. - * + * * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#spritesheet. * * @class SpriteSheetFile @@ -115937,9 +116906,7 @@ var SpriteSheetFile = new Class({ */ addToCache: function () { - var texture = this.cache.addSpriteSheet(this.key, this.data, this.config); - - this.pendingDestroy(texture); + this.cache.addSpriteSheet(this.key, this.data, this.config); } }); @@ -115954,7 +116921,7 @@ var SpriteSheetFile = new Class({ * what sort of file you're actually trying to load. * * You can call this method from within your Scene's `preload`, along with any other files you wish to load: - * + * * ```javascript * function preload () * { @@ -115969,7 +116936,7 @@ var SpriteSheetFile = new Class({ * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been * loaded. - * + * * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle. * If you try to load an animated gif only the first frame will be rendered. Browsers do not natively support playback * of animated gifs to Canvas elements. @@ -115980,7 +116947,7 @@ var SpriteSheetFile = new Class({ * then remove it from the Texture Manager first, before loading a new one. * * Instead of passing arguments you can pass a configuration object, such as: - * + * * ```javascript * this.load.spritesheet({ * key: 'bot', @@ -115997,7 +116964,7 @@ var SpriteSheetFile = new Class({ * See the documentation for `Phaser.Types.Loader.FileTypes.SpriteSheetFileConfig` for more details. * * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key: - * + * * ```javascript * this.load.spritesheet('bot', 'images/robot.png', { frameWidth: 32, frameHeight: 38 }); * // and later in your game ... @@ -116016,13 +116983,13 @@ var SpriteSheetFile = new Class({ * * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image, * then you can specify it by providing an array as the `url` where the second element is the normal map: - * + * * ```javascript * this.load.spritesheet('logo', [ 'images/AtariLogo.png', 'images/AtariLogo-n.png' ], { frameWidth: 256, frameHeight: 80 }); * ``` * * Or, if you are using a config object use the `normalMap` property: - * + * * ```javascript * this.load.spritesheet({ * key: 'logo', @@ -116037,7 +117004,7 @@ var SpriteSheetFile = new Class({ * * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings. * Normal maps are a WebGL only feature. - * + * * Note: The ability to load this type of file will only be available if the Sprite Sheet File type has been built into Phaser. * It is available in the default build but can be excluded from custom builds. * @@ -116080,7 +117047,7 @@ module.exports = SpriteSheetFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -116260,7 +117227,7 @@ module.exports = TextFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -116353,8 +117320,6 @@ var TilemapCSVFile = new Class({ var tiledata = { format: this.tilemapFormat, data: this.data }; this.cache.add(this.key, tiledata); - - this.pendingDestroy(tiledata); } }); @@ -116456,7 +117421,7 @@ module.exports = TilemapCSVFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -116510,8 +117475,6 @@ var TilemapImpactFile = new Class({ var tiledata = { format: TILEMAP_FORMATS.WELTMEISTER, data: this.data }; this.cache.add(this.key, tiledata); - - this.pendingDestroy(tiledata); } }); @@ -116613,7 +117576,7 @@ module.exports = TilemapImpactFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -116667,8 +117630,6 @@ var TilemapJSONFile = new Class({ var tiledata = { format: TILEMAP_FORMATS.TILED_JSON, data: this.data }; this.cache.add(this.key, tiledata); - - this.pendingDestroy(tiledata); } }); @@ -116770,7 +117731,7 @@ module.exports = TilemapJSONFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -116868,8 +117829,6 @@ var UnityAtlasFile = new Class({ this.loader.textureManager.addUnityAtlas(image.key, image.data, text.data, normalMap); - text.pendingDestroy(); - this.complete = true; } } @@ -117013,7 +117972,7 @@ module.exports = UnityAtlasFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -117041,7 +118000,7 @@ var IsPlainObject = __webpack_require__(42911); * * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. * @param {(string|Phaser.Types.Loader.FileTypes.VideoFileConfig)} key - The key to use for this file, or a file configuration object. - * @param {any} [urlConfig] - The absolute or relative URL to load this file from in a config object. + * @param {Phaser.Types.Loader.FileTypes.VideoFileURLConfig} [urlConfig] - The absolute or relative URL to load this file from in a config object. * @param {string} [loadEvent] - The load event to listen for when _not_ loading as a blob. Either 'loadeddata', 'canplay' or 'canplaythrough'. * @param {boolean} [asBlob] - Load the video as a data blob, or via the Video element? * @param {boolean} [noAudio] - Does the video have an audio track? If not you can enable auto-playing on it. @@ -117361,7 +118320,7 @@ VideoFile.getVideoURL = function (game, urls) * @since 3.20.0 * * @param {(string|Phaser.Types.Loader.FileTypes.VideoFileConfig|Phaser.Types.Loader.FileTypes.VideoFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. - * @param {(string|string[])} [urls] - The absolute or relative URL to load the video files from. + * @param {(string|string[]|Phaser.Types.Loader.FileTypes.VideoFileURLConfig|Phaser.Types.Loader.FileTypes.VideoFileURLConfig[])} [urls] - The absolute or relative URL to load the video files from. * @param {string} [loadEvent='loadeddata'] - The load event to listen for when _not_ loading as a blob. Either `loadeddata`, `canplay` or `canplaythrough`. * @param {boolean} [asBlob=false] - Load the video as a data blob, or stream it via the Video element? * @param {boolean} [noAudio=false] - Does the video have an audio track? If not you can enable auto-playing on it. @@ -117409,7 +118368,7 @@ module.exports = VideoFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -117593,7 +118552,7 @@ module.exports = XMLFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -117647,7 +118606,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -117688,7 +118647,7 @@ module.exports = Loader; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -117724,7 +118683,7 @@ module.exports = Average; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -117756,7 +118715,7 @@ module.exports = Bernstein; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -117786,7 +118745,7 @@ module.exports = Between; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -117824,7 +118783,7 @@ module.exports = CatmullRom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -117862,7 +118821,7 @@ module.exports = CeilTo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -117893,7 +118852,7 @@ module.exports = Clamp; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -117924,7 +118883,7 @@ module.exports = DegToRad; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -117954,7 +118913,7 @@ module.exports = Difference; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -118238,7 +119197,7 @@ module.exports = Euler; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -118279,7 +119238,7 @@ module.exports = Factorial; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -118309,7 +119268,7 @@ module.exports = FloatBetween; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -118347,7 +119306,7 @@ module.exports = FloorTo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -118382,7 +119341,7 @@ module.exports = FromPercent; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -118416,7 +119375,7 @@ module.exports = GetSpeed; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -118448,7 +119407,7 @@ module.exports = IsEven; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -118478,7 +119437,7 @@ module.exports = IsEvenStrict; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -118502,6 +119461,41 @@ var Linear = function (p0, p1, t) module.exports = Linear; +/***/ }), + +/***/ 61072: +/***/ ((module) => { + +/** + * @author Greg McLean + * @copyright 2021 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Interpolates two given Vectors and returns a new Vector between them. + * + * Does not modify either of the passed Vectors. + * + * @function Phaser.Math.LinearXY + * @since 3.60.0 + * + * @param {Phaser.Math.Vector2} vector1 - Starting vector + * @param {Phaser.Math.Vector2} vector2 - Ending vector + * @param {number} [t=0] - The percentage between vector1 and vector2 to return, represented as a number between 0 and 1. + * + * @return {Phaser.Math.Vector2} The step t% of the way between vector1 and vector2. + */ +var LinearXY = function (vector1, vector2, t) +{ + if (t === undefined) { t = 0; } + + return vector1.clone().lerp(vector2, t); +}; + +module.exports = LinearXY; + + /***/ }), /***/ 5341: @@ -118509,7 +119503,7 @@ module.exports = Linear; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -119103,7 +120097,7 @@ module.exports = Matrix3; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -120897,7 +121891,7 @@ module.exports = Matrix4; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -120970,7 +121964,7 @@ module.exports = Median; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -121001,7 +121995,7 @@ module.exports = MinSub; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -121061,7 +122055,7 @@ module.exports = Percent; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122111,7 +123105,7 @@ module.exports = Quaternion; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122142,7 +123136,7 @@ module.exports = RadToDeg; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122183,7 +123177,7 @@ module.exports = RandomXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122223,7 +123217,7 @@ module.exports = RandomXYZ; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122260,7 +123254,7 @@ module.exports = RandomXYZW; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122296,7 +123290,7 @@ module.exports = Rotate; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122341,7 +123335,7 @@ module.exports = RotateAround; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122383,7 +123377,7 @@ module.exports = RotateAroundDistance; /** * @author samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122421,7 +123415,7 @@ module.exports = RotateTo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122470,7 +123464,7 @@ module.exports = RotateVec3; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122500,23 +123494,23 @@ module.exports = RoundAwayFromZero; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Round a value to the given precision. - * + * * For example: - * + * * ```javascript * RoundTo(123.456, 0) = 123 * RoundTo(123.456, 1) = 120 * RoundTo(123.456, 2) = 100 * ``` - * + * * To round the decimal, i.e. to round to precision, pass in a negative `place`: - * + * * ```javascript * RoundTo(123.456789, 0) = 123 * RoundTo(123.456789, -1) = 123.5 @@ -122553,7 +123547,7 @@ module.exports = RoundTo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122607,7 +123601,7 @@ module.exports = SinCosTableGenerator; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122655,7 +123649,7 @@ module.exports = SmoothStep; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122695,7 +123689,7 @@ module.exports = SmootherStep; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122703,9 +123697,9 @@ var Vector2 = __webpack_require__(93736); /** * Returns a Vector2 containing the x and y position of the given index in a `width` x `height` sized grid. - * + * * For example, in a 6 x 4 grid, index 16 would equal x: 4 y: 2. - * + * * If the given index is out of range an empty Vector2 is returned. * * @function Phaser.Math.ToXY @@ -122752,7 +123746,7 @@ module.exports = ToXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122808,7 +123802,7 @@ module.exports = TransformXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -123499,6 +124493,23 @@ var Vector2 = new Class({ var sin = Math.sin(delta); return this.set(cos * this.x - sin * this.y, sin * this.x + cos * this.y); + }, + + /** + * Project this Vector onto another. + * + * @method Phaser.Math.Vector2#project + * @since 3.60.0 + * + * @param {Phaser.Math.Vector2} src - The vector to project onto. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + project: function (src) + { + var scalar = this.dot(src) / src.dot(src); + + return this.copy(src).scale(scalar); } }); @@ -123585,7 +124596,7 @@ module.exports = Vector2; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -124632,7 +125643,7 @@ module.exports = Vector3; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125174,7 +126185,7 @@ module.exports = Vector4; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125205,12 +126216,12 @@ module.exports = Within; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** - * Wrap the given `value` between `min` and `max. + * Wrap the given `value` between `min` and `max`. * * @function Phaser.Math.Wrap * @since 3.0.0 @@ -125238,7 +126249,7 @@ module.exports = Wrap; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125270,7 +126281,7 @@ module.exports = Between; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125302,7 +126313,7 @@ module.exports = BetweenPoints; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125335,7 +126346,7 @@ module.exports = BetweenPointsY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125370,7 +126381,7 @@ module.exports = BetweenY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125416,7 +126427,7 @@ module.exports = CounterClockwise; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125455,7 +126466,7 @@ module.exports = Normalize; /** * @author Richard Davey * @author @samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125485,7 +126496,7 @@ module.exports = Random; /** * @author Richard Davey * @author @samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125514,7 +126525,7 @@ module.exports = RandomDegrees; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125545,7 +126556,7 @@ module.exports = Reverse; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125613,7 +126624,7 @@ module.exports = RotateTo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125661,7 +126672,7 @@ module.exports = ShortestBetween; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125694,7 +126705,7 @@ module.exports = Wrap; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125727,7 +126738,7 @@ module.exports = WrapDegrees; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125761,7 +126772,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125769,7 +126780,7 @@ var MATH_CONST = { /** * The value of PI * 2. - * + * * @name Phaser.Math.PI2 * @type {number} * @since 3.0.0 @@ -125778,7 +126789,7 @@ var MATH_CONST = { /** * The value of PI * 0.5. - * + * * @name Phaser.Math.TAU * @type {number} * @since 3.0.0 @@ -125787,7 +126798,7 @@ var MATH_CONST = { /** * An epsilon value (1.0e-6) - * + * * @name Phaser.Math.EPSILON * @type {number} * @since 3.0.0 @@ -125796,7 +126807,7 @@ var MATH_CONST = { /** * For converting degrees to radians (PI / 180) - * + * * @name Phaser.Math.DEG_TO_RAD * @type {number} * @since 3.0.0 @@ -125805,7 +126816,7 @@ var MATH_CONST = { /** * For converting radians to degrees (180 / PI) - * + * * @name Phaser.Math.RAD_TO_DEG * @type {number} * @since 3.0.0 @@ -125815,7 +126826,7 @@ var MATH_CONST = { /** * An instance of the Random Number Generator. * This is not set until the Game boots. - * + * * @name Phaser.Math.RND * @type {Phaser.Math.RandomDataGenerator} * @since 3.0.0 @@ -125825,7 +126836,7 @@ var MATH_CONST = { /** * The minimum safe integer this browser supports. * We use a const for backward compatibility with Internet Explorer. - * + * * @name Phaser.Math.MIN_SAFE_INTEGER * @type {number} * @since 3.21.0 @@ -125835,7 +126846,7 @@ var MATH_CONST = { /** * The maximum safe integer this browser supports. * We use a const for backward compatibility with Internet Explorer. - * + * * @name Phaser.Math.MAX_SAFE_INTEGER * @type {number} * @since 3.21.0 @@ -125854,7 +126865,7 @@ module.exports = MATH_CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125889,7 +126900,7 @@ module.exports = DistanceBetween; /** * @author samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125922,7 +126933,7 @@ module.exports = DistanceBetweenPoints; /** * @author samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125955,7 +126966,7 @@ module.exports = DistanceBetweenPointsSquared; /** * @author samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125990,7 +127001,7 @@ module.exports = ChebyshevDistance; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126025,7 +127036,7 @@ module.exports = DistancePower; /** * @author samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126060,7 +127071,7 @@ module.exports = SnakeDistance; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126095,7 +127106,7 @@ module.exports = DistanceSquared; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126123,7 +127134,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126205,7 +127216,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126237,7 +127248,7 @@ module.exports = In; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126278,7 +127289,7 @@ module.exports = InOut; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126310,7 +127321,7 @@ module.exports = Out; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126334,7 +127345,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126380,7 +127391,7 @@ module.exports = In; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126445,7 +127456,7 @@ module.exports = InOut; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126489,7 +127500,7 @@ module.exports = Out; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126513,7 +127524,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126542,7 +127553,7 @@ module.exports = In; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126578,7 +127589,7 @@ module.exports = InOut; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126607,7 +127618,7 @@ module.exports = Out; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126631,7 +127642,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126660,7 +127671,7 @@ module.exports = In; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126696,7 +127707,7 @@ module.exports = InOut; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126725,7 +127736,7 @@ module.exports = Out; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126749,7 +127760,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126805,7 +127816,7 @@ module.exports = In; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126868,7 +127879,7 @@ module.exports = InOut; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126924,7 +127935,7 @@ module.exports = Out; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126948,7 +127959,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126977,7 +127988,7 @@ module.exports = In; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127013,7 +128024,7 @@ module.exports = InOut; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127042,7 +128053,7 @@ module.exports = Out; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127066,7 +128077,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127099,7 +128110,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127128,7 +128139,7 @@ module.exports = Linear; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127142,7 +128153,7 @@ module.exports = __webpack_require__(43927); /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127171,7 +128182,7 @@ module.exports = In; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127207,7 +128218,7 @@ module.exports = InOut; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127236,7 +128247,7 @@ module.exports = Out; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127260,7 +128271,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127289,7 +128300,7 @@ module.exports = In; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127325,7 +128336,7 @@ module.exports = InOut; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127354,7 +128365,7 @@ module.exports = Out; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127378,7 +128389,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127407,7 +128418,7 @@ module.exports = In; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127443,7 +128454,7 @@ module.exports = InOut; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127472,7 +128483,7 @@ module.exports = Out; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127496,7 +128507,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127536,7 +128547,7 @@ module.exports = In; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127576,7 +128587,7 @@ module.exports = InOut; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127616,7 +128627,7 @@ module.exports = Out; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127640,7 +128651,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127683,7 +128694,7 @@ module.exports = Stepped; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127701,7 +128712,7 @@ module.exports = __webpack_require__(52770); /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127733,7 +128744,7 @@ module.exports = Ceil; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127768,7 +128779,7 @@ module.exports = Equal; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127800,7 +128811,7 @@ module.exports = Floor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127835,7 +128846,7 @@ module.exports = GreaterThan; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127870,7 +128881,7 @@ module.exports = LessThan; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127896,7 +128907,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127939,6 +128950,7 @@ var PhaserMath = { IsEven: __webpack_require__(43776), IsEvenStrict: __webpack_require__(58442), Linear: __webpack_require__(42798), + LinearXY: __webpack_require__(61072), MaxAdd: __webpack_require__(69635), Median: __webpack_require__(37394), MinSub: __webpack_require__(17259), @@ -127988,7 +129000,7 @@ module.exports = PhaserMath; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128028,7 +129040,7 @@ module.exports = BezierInterpolation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128086,7 +129098,7 @@ module.exports = CatmullRomInterpolation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128157,7 +129169,7 @@ module.exports = CubicBezierInterpolation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128205,7 +129217,7 @@ module.exports = LinearInterpolation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128265,7 +129277,7 @@ module.exports = QuadraticBezierInterpolation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128299,7 +129311,7 @@ module.exports = SmoothStepInterpolation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128333,7 +129345,7 @@ module.exports = SmootherStepInterpolation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128361,7 +129373,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128392,7 +129404,7 @@ module.exports = GetPowerOfTwo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128423,7 +129435,7 @@ module.exports = IsSizePowerOfTwo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128452,7 +129464,7 @@ module.exports = IsValuePowerOfTwo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128476,7 +129488,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128485,13 +129497,13 @@ var Class = __webpack_require__(56694); /** * @classdesc * A seeded Random Data Generator. - * + * * Access via `Phaser.Math.RND` which is an instance of this class pre-defined * by Phaser. Or, create your own instance to use as you require. - * + * * The `Math.RND` generator is seeded by the Game Config property value `seed`. * If no such config property exists, a random number is used. - * + * * If you create your own instance of this class you should provide a seed for it. * If no seed is given it will use a 'random' one based on Date.now. * @@ -128823,7 +129835,7 @@ var RandomDataGenerator = new Class({ * * @method Phaser.Math.RandomDataGenerator#pick * @since 3.0.0 - * + * * @generic T * @genericUse {T[]} - [array] * @genericUse {T} - [$return] @@ -128987,7 +129999,7 @@ module.exports = RandomDataGenerator; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -129032,7 +130044,7 @@ module.exports = SnapCeil; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -129077,7 +130089,7 @@ module.exports = SnapFloor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -129121,7 +130133,7 @@ module.exports = SnapTo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -129145,7 +130157,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -129239,7 +130251,7 @@ __webpack_require__.g.Phaser = Phaser; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -129342,7 +130354,7 @@ module.exports = ArcadeImage; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -129539,8 +130551,8 @@ var ArcadePhysics = new Class({ * * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object or array of objects to check. * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`. - * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they overlap. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [overlapCallback] - An optional callback function that is called if the objects overlap. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they overlap. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {*} [callbackContext] - The context in which to run the callbacks. * * @return {boolean} True if at least one Game Object overlaps another. @@ -129581,8 +130593,8 @@ var ArcadePhysics = new Class({ * * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object or array of objects to check. * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`. - * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {*} [callbackContext] - The context in which to run the callbacks. * * @return {boolean} True if any overlapping Game Objects were separated, otherwise false. @@ -129620,8 +130632,8 @@ var ArcadePhysics = new Class({ * * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision. * @param {Phaser.Tilemaps.Tile[]} tiles - An array of Tiles to check for collision against. - * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} [callbackContext] - The context in which to run the callbacks. * * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated. @@ -129648,8 +130660,8 @@ var ArcadePhysics = new Class({ * * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision. * @param {Phaser.Tilemaps.Tile[]} tiles - An array of Tiles to check for collision against. - * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects overlap. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects overlap. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} [callbackContext] - The context in which to run the callbacks. * * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated. @@ -130068,7 +131080,7 @@ module.exports = ArcadePhysics; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -130173,7 +131185,7 @@ module.exports = ArcadeSprite; /** * @author Richard Davey * @author Benjamin D. Richards - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -130197,7 +131209,7 @@ var Vector2 = __webpack_require__(93736); * @since 3.0.0 * * @param {Phaser.Physics.Arcade.World} world - The Arcade Physics simulation this Body belongs to. - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object this Body belongs to. + * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object this Body belongs to. As of Phaser 3.60 this is now optional. */ var Body = new Class({ @@ -130205,8 +131217,32 @@ var Body = new Class({ function Body (world, gameObject) { - var width = (gameObject.displayWidth) ? gameObject.displayWidth : 64; - var height = (gameObject.displayHeight) ? gameObject.displayHeight : 64; + var width = 64; + var height = 64; + + var dummyGameObject = { + x: 0, + y: 0, + angle: 0, + rotation: 0, + scaleX: 1, + scaleY: 1, + displayOriginX: 0, + displayOriginY: 0 + }; + + var hasGameObject = (gameObject !== undefined); + + if (hasGameObject && gameObject.displayWidth) + { + width = gameObject.displayWidth; + height = gameObject.displayHeight; + } + + if (!hasGameObject) + { + gameObject = dummyGameObject; + } /** * The Arcade Physics simulation this Body belongs to. @@ -130220,11 +131256,23 @@ var Body = new Class({ /** * The Game Object this Body belongs to. * + * As of Phaser 3.60 this is now optional and can be undefined. + * * @name Phaser.Physics.Arcade.Body#gameObject * @type {Phaser.GameObjects.GameObject} * @since 3.0.0 */ - this.gameObject = gameObject; + this.gameObject = (hasGameObject) ? gameObject : undefined; + + /** + * A quick-test flag that signifies this is a Body, used in the World collision handler. + * + * @name Phaser.Physics.Arcade.Body#isBody + * @type {boolean} + * @readonly + * @since 3.60.0 + */ + this.isBody = true; /** * Transformations applied to this Body. @@ -131196,7 +132244,10 @@ var Body = new Class({ this.resetFlags(); } - this.updateFromGameObject(); + if (this.gameObject) + { + this.updateFromGameObject(); + } this.rotation = this.transform.rotation; this.preRotation = this.rotation; @@ -131274,6 +132325,7 @@ var Body = new Class({ { var dx = this.position.x - this.prevFrame.x; var dy = this.position.y - this.prevFrame.y; + var gameObject = this.gameObject; if (this.moves) { @@ -131304,8 +132356,11 @@ var Body = new Class({ } } - this.gameObject.x += dx; - this.gameObject.y += dy; + if (gameObject) + { + gameObject.x += dx; + gameObject.y += dy; + } } if (dx < 0) @@ -131326,9 +132381,9 @@ var Body = new Class({ this.facing = CONST.FACING_DOWN; } - if (this.allowRotation) + if (this.allowRotation && gameObject) { - this.gameObject.angle += this.deltaZ(); + gameObject.angle += this.deltaZ(); } this._tx = dx; @@ -131432,6 +132487,53 @@ var Body = new Class({ return this; }, + /** + * Assign this Body to a new Game Object. + * + * Removes this body from the Physics World, assigns to the new Game Object, calls `setSize` and then + * adds this body back into the World again, setting it enabled, unless the `enable` argument is set to `false`. + * + * If this body already has a Game Object, then it will remove itself from that Game Object first. + * + * Only if the given `gameObject` has a `body` property will this Body be assigned to it. + * + * @method Phaser.Physics.Arcade.Body#setGameObject + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object this Body belongs to. + * @param {boolean} [enable=true] - Automatically enable this Body for physics. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setGameObject: function (gameObject, enable) + { + if (enable === undefined) { enable = true; } + + // Remove from the World + this.world.remove(this); + + if (this.gameObject && this.gameObject.body) + { + // Disconnect the current Game Object + this.gameObject.body = null; + } + + this.gameObject = gameObject; + + if (gameObject.body) + { + gameObject.body = this; + } + + this.setSize(); + + this.world.add(this); + + this.enable = enable; + + return this; + }, + /** * Sizes and positions this Body, as a rectangle. * Modifies the Body `offset` if `center` is true (the default). @@ -131452,14 +132554,17 @@ var Body = new Class({ var gameObject = this.gameObject; - if (!width && gameObject.frame) + if (gameObject) { - width = gameObject.frame.realWidth; - } + if (!width && gameObject.frame) + { + width = gameObject.frame.realWidth; + } - if (!height && gameObject.frame) - { - height = gameObject.frame.realHeight; + if (!height && gameObject.frame) + { + height = gameObject.frame.realHeight; + } } this.sourceWidth = width; @@ -131473,7 +132578,7 @@ var Body = new Class({ this.updateCenter(); - if (center && gameObject.getCenter) + if (center && gameObject && gameObject.getCenter) { var ox = (gameObject.width - width) / 2; var oy = (gameObject.height - height) / 2; @@ -131546,25 +132651,35 @@ var Body = new Class({ var gameObject = this.gameObject; - gameObject.setPosition(x, y); - - if (gameObject.getTopLeft) + if (gameObject) { - gameObject.getTopLeft(this.position); + gameObject.setPosition(x, y); + + this.rotation = gameObject.angle; + this.preRotation = gameObject.angle; + } + + var pos = this.position; + + if (gameObject && gameObject.getTopLeft) + { + gameObject.getTopLeft(pos); } else { - this.position.set(x, y); + pos.set(x, y); } - this.prev.copy(this.position); - this.prevFrame.copy(this.position); + this.prev.copy(pos); + this.prevFrame.copy(pos); - this.rotation = gameObject.angle; - this.preRotation = gameObject.angle; + if (gameObject) + { + this.updateBounds(); + } - this.updateBounds(); this.updateCenter(); + this.checkWorldBounds(); this.resetFlags(true); }, @@ -131928,6 +133043,16 @@ var Body = new Class({ return this; }, + setValue: function (vec2, x, y) + { + if (x === undefined) { x = vec2.x; } + if (y === undefined) { y = vec2.y; } + + vec2.set(x, y); + + return this; + }, + /** * Sets the Body's velocity. * @@ -131963,14 +133088,7 @@ var Body = new Class({ */ setVelocityX: function (value) { - this.velocity.x = value; - - var x = value; - var y = this.velocity.y; - - this.speed = Math.sqrt(x * x + y * y); - - return this; + return this.setVelocity(value, this.velocity.y); }, /** @@ -131985,14 +133103,7 @@ var Body = new Class({ */ setVelocityY: function (value) { - this.velocity.y = value; - - var x = this.velocity.x; - var y = value; - - this.speed = Math.sqrt(x * x + y * y); - - return this; + return this.setVelocity(this.velocity.x, value); }, /** @@ -132709,7 +133820,7 @@ module.exports = Body; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -132729,8 +133840,8 @@ var Class = __webpack_require__(56694); * @param {boolean} overlapOnly - Whether to check for collisions or overlap. * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object to check for collision. * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object2 - The second object to check for collision. - * @param {ArcadePhysicsCallback} collideCallback - The callback to invoke when the two objects collide. - * @param {ArcadePhysicsCallback} processCallback - The callback to invoke when the two objects collide. Must return a boolean. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} collideCallback - The callback to invoke when the two objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} processCallback - The callback to invoke when the two objects collide. Must return a boolean. * @param {any} callbackContext - The scope in which to call the callbacks. */ var Collider = new Class({ @@ -132798,7 +133909,7 @@ var Collider = new Class({ * The callback to invoke when the two objects collide. * * @name Phaser.Physics.Arcade.Collider#collideCallback - * @type {ArcadePhysicsCallback} + * @type {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} * @since 3.0.0 */ this.collideCallback = collideCallback; @@ -132807,7 +133918,7 @@ var Collider = new Class({ * If a processCallback exists it must return true or collision checking will be skipped. * * @name Phaser.Physics.Arcade.Collider#processCallback - * @type {ArcadePhysicsCallback} + * @type {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} * @since 3.0.0 */ this.processCallback = processCallback; @@ -132893,15 +134004,17 @@ module.exports = Collider; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var ArcadeImage = __webpack_require__(62832); var ArcadeSprite = __webpack_require__(25084); +var Body = __webpack_require__(97602); var Class = __webpack_require__(56694); var CONST = __webpack_require__(47401); var PhysicsGroup = __webpack_require__(10481); +var StaticBody = __webpack_require__(66634); var StaticPhysicsGroup = __webpack_require__(46346); /** @@ -132956,10 +134069,10 @@ var Factory = new Class({ * @method Phaser.Physics.Arcade.Factory#collider * @since 3.0.0 * - * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]|Phaser.GameObjects.Group|Phaser.GameObjects.Group[])} object1 - The first object to check for collision. - * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]|Phaser.GameObjects.Group|Phaser.GameObjects.Group[])} object2 - The second object to check for collision. - * @param {ArcadePhysicsCallback} [collideCallback] - The callback to invoke when the two objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - The callback to invoke when the two objects collide. Must return a boolean. + * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object to check for collision. + * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object2 - The second object to check for collision. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - The callback to invoke when the two objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - The callback to invoke when the two objects collide. Must return a boolean. * @param {*} [callbackContext] - The scope in which to call the callbacks. * * @return {Phaser.Physics.Arcade.Collider} The Collider that was created. @@ -132975,10 +134088,10 @@ var Factory = new Class({ * @method Phaser.Physics.Arcade.Factory#overlap * @since 3.0.0 * - * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]|Phaser.GameObjects.Group|Phaser.GameObjects.Group[])} object1 - The first object to check for overlap. - * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]|Phaser.GameObjects.Group|Phaser.GameObjects.Group[])} object2 - The second object to check for overlap. - * @param {ArcadePhysicsCallback} [collideCallback] - The callback to invoke when the two objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - The callback to invoke when the two objects collide. Must return a boolean. + * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object to check for overlap. + * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object2 - The second object to check for overlap. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - The callback to invoke when the two objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - The callback to invoke when the two objects collide. Must return a boolean. * @param {*} [callbackContext] - The scope in which to call the callbacks. * * @return {Phaser.Physics.Arcade.Collider} The Collider that was created. @@ -133142,6 +134255,70 @@ var Factory = new Class({ return this.sys.updateList.add(new PhysicsGroup(this.world, this.world.scene, children, config)); }, + /** + * Creates a new physics Body with the given position and size. + * + * This Body is not associated with any Game Object, but still exists within the world + * and can be tested for collision, have velocity, etc. + * + * @method Phaser.Physics.Arcade.Factory#body + * @since 3.60.0 + * + * @param {number} x - The horizontal position of this Body in the physics world. + * @param {number} y - The vertical position of this Body in the physics world. + * @param {number} [width=64] - The width of the Body in pixels. Cannot be negative or zero. + * @param {number} [height=64] - The height of the Body in pixels. Cannot be negative or zero. + * + * @return {Phaser.Physics.Arcade.Body} The Body that was created. + */ + body: function (x, y, width, height) + { + var body = new Body(this.world); + + body.position.set(x, y); + + if (width && height) + { + body.setSize(width, height); + } + + this.world.add(body, CONST.DYNAMIC_BODY); + + return body; + }, + + /** + * Creates a new static physics Body with the given position and size. + * + * This Body is not associated with any Game Object, but still exists within the world + * and can be tested for collision, etc. + * + * @method Phaser.Physics.Arcade.Factory#staticBody + * @since 3.60.0 + * + * @param {number} x - The horizontal position of this Body in the physics world. + * @param {number} y - The vertical position of this Body in the physics world. + * @param {number} [width=64] - The width of the Body in pixels. Cannot be negative or zero. + * @param {number} [height=64] - The height of the Body in pixels. Cannot be negative or zero. + * + * @return {Phaser.Physics.Arcade.Body} The Body that was created. + */ + staticBody: function (x, y, width, height) + { + var body = new StaticBody(this.world); + + body.position.set(x, y); + + if (width && height) + { + body.setSize(width, height); + } + + this.world.add(body, CONST.STATIC_BODY); + + return body; + }, + /** * Destroys this Factory. * @@ -133167,7 +134344,7 @@ module.exports = Factory; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -133276,7 +134453,7 @@ module.exports = GetOverlapX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -133385,7 +134562,7 @@ module.exports = GetOverlapY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -133488,7 +134665,7 @@ var PhysicsGroup = new Class({ * This should be either `Phaser.Physics.Arcade.Image`, `Phaser.Physics.Arcade.Sprite`, or a class extending one of those. * * @name Phaser.Physics.Arcade.Group#classType - * @type {Function} + * @type {Phaser.Types.GameObjects.Group.GroupClassTypeConstructor} * @default ArcadeSprite * @since 3.0.0 */ @@ -133682,7 +134859,7 @@ module.exports = PhysicsGroup; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -134100,7 +135277,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -134518,7 +135695,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -134590,7 +135767,7 @@ module.exports = SeparateX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -134662,7 +135839,7 @@ module.exports = SeparateY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -134689,7 +135866,7 @@ var Vector2 = __webpack_require__(93736); * @since 3.0.0 * * @param {Phaser.Physics.Arcade.World} world - The Arcade Physics simulation this Static Body belongs to. - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object this Static Body belongs to. + * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object this Body belongs to. As of Phaser 3.60 this is now optional. */ var StaticBody = new Class({ @@ -134697,8 +135874,32 @@ var StaticBody = new Class({ function StaticBody (world, gameObject) { - var width = (gameObject.displayWidth) ? gameObject.displayWidth : 64; - var height = (gameObject.displayHeight) ? gameObject.displayHeight : 64; + var width = 64; + var height = 64; + + var dummyGameObject = { + x: 0, + y: 0, + angle: 0, + rotation: 0, + scaleX: 1, + scaleY: 1, + displayOriginX: 0, + displayOriginY: 0 + }; + + var hasGameObject = (gameObject !== undefined); + + if (hasGameObject && gameObject.displayWidth) + { + width = gameObject.displayWidth; + height = gameObject.displayHeight; + } + + if (!hasGameObject) + { + gameObject = dummyGameObject; + } /** * The Arcade Physics simulation this Static Body belongs to. @@ -134712,11 +135913,24 @@ var StaticBody = new Class({ /** * The Game Object this Static Body belongs to. * + * As of Phaser 3.60 this is now optional and can be undefined. + * * @name Phaser.Physics.Arcade.StaticBody#gameObject * @type {Phaser.GameObjects.GameObject} * @since 3.0.0 */ - this.gameObject = gameObject; + this.gameObject = (hasGameObject) ? gameObject : undefined; + + + /** + * A quick-test flag that signifies this is a Body, used in the World collision handler. + * + * @name Phaser.Physics.Arcade.StaticBody#isBody + * @type {boolean} + * @readonly + * @since 3.60.0 + */ + this.isBody = true; /** * Whether the Static Body's boundary is drawn to the debug display. @@ -135675,7 +136889,7 @@ module.exports = StaticBody; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -135875,7 +137089,7 @@ module.exports = StaticPhysicsGroup; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -136274,6 +137488,15 @@ var World = new Class({ */ this._tempMatrix2 = new TransformMatrix(); + /** + * The Filtering Options passed to `GetTilesWithinWorldXY` as part of the `collideSpriteVsTilemapLayer` check. + * + * @name Phaser.Physics.Arcade.World#tileFilterOptions + * @type {Phaser.Types.Tilemaps.FilteringOptions} + * @since 3.60.0 + */ + this.tileFilterOptions = { isColliding: true, isNotEmpty: true, hasInterestingFace: true }; + if (this.drawDebug) { this.createDebugGraphic(); @@ -136382,19 +137605,22 @@ var World = new Class({ { if (bodyType === undefined) { bodyType = CONST.DYNAMIC_BODY; } - if (!object.body) + if (object.hasTransformComponent) { - if (bodyType === CONST.DYNAMIC_BODY) + if (!object.body) { - object.body = new Body(this, object); + if (bodyType === CONST.DYNAMIC_BODY) + { + object.body = new Body(this, object); + } + else if (bodyType === CONST.STATIC_BODY) + { + object.body = new StaticBody(this, object); + } } - else if (bodyType === CONST.STATIC_BODY) - { - object.body = new StaticBody(this, object); - } - } - this.add(object.body); + this.add(object.body); + } return object; }, @@ -136677,8 +137903,8 @@ var World = new Class({ * * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object to check for collision. * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object2 - The second object to check for collision. - * @param {ArcadePhysicsCallback} [collideCallback] - The callback to invoke when the two objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - The callback to invoke when the two objects collide. Must return a boolean. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - The callback to invoke when the two objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - The callback to invoke when the two objects collide. Must return a boolean. * @param {*} [callbackContext] - The scope in which to call the callbacks. * * @return {Phaser.Physics.Arcade.Collider} The Collider that was created. @@ -136712,8 +137938,8 @@ var World = new Class({ * * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object to check for overlap. * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object2 - The second object to check for overlap. - * @param {ArcadePhysicsCallback} [collideCallback] - The callback to invoke when the two objects overlap. - * @param {ArcadePhysicsCallback} [processCallback] - The callback to invoke when the two objects overlap. Must return a boolean. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - The callback to invoke when the two objects overlap. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - The callback to invoke when the two objects overlap. Must return a boolean. * @param {*} [callbackContext] - The scope in which to call the callbacks. * * @return {Phaser.Physics.Arcade.Collider} The Collider that was created. @@ -137218,17 +138444,15 @@ var World = new Class({ * * @param {Phaser.Physics.Arcade.Body} body1 - The first Body to be separated. * @param {Phaser.Physics.Arcade.Body} body2 - The second Body to be separated. - * @param {ArcadePhysicsCallback} [processCallback] - The process callback. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - The process callback. * @param {*} [callbackContext] - The context in which to invoke the callback. * @param {boolean} [overlapOnly] - If this a collide or overlap check? - * @param {boolean} [intersects] - Assert that the bodies intersect and should not be tested before separation. * * @return {boolean} True if separation occurred, otherwise false. */ - separate: function (body1, body2, processCallback, callbackContext, overlapOnly, intersects) + separate: function (body1, body2, processCallback, callbackContext, overlapOnly) { if ( - !intersects && !body1.enable || !body2.enable || body1.checkCollision.none || @@ -137555,8 +138779,8 @@ var World = new Class({ * * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object or array of objects to check. * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`. - * @param {ArcadePhysicsCallback} [overlapCallback] - An optional callback function that is called if the objects overlap. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they overlap. If this is set then `overlapCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [overlapCallback] - An optional callback function that is called if the objects overlap. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they overlap. If this is set then `overlapCallback` will only be called if this callback returns `true`. * @param {*} [callbackContext] - The context in which to run the callbacks. * * @return {boolean} True if at least one Game Object overlaps another. @@ -137598,8 +138822,8 @@ var World = new Class({ * * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object or array of objects to check. * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`. - * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} [callbackContext] - The context in which to run the callbacks. * * @return {boolean} `true` if any overlapping Game Objects were separated, otherwise `false`. @@ -137622,8 +138846,8 @@ var World = new Class({ * * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object to check for collision. * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} [object2] - The second object to check for collision. - * @param {ArcadePhysicsCallback} collideCallback - The callback to invoke when the two objects collide. - * @param {ArcadePhysicsCallback} processCallback - The callback to invoke when the two objects collide. Must return a boolean. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} collideCallback - The callback to invoke when the two objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} processCallback - The callback to invoke when the two objects collide. Must return a boolean. * @param {any} callbackContext - The scope in which to call the callbacks. * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * @@ -137715,8 +138939,8 @@ var World = new Class({ * * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object or array of objects to check. * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object2 - The second object or array of objects to check, or `undefined`. - * @param {ArcadePhysicsCallback} collideCallback - An optional callback function that is called if the objects collide. - * @param {ArcadePhysicsCallback} processCallback - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} collideCallback - An optional callback function that is called if the objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} processCallback - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} callbackContext - The context in which to run the callbacks. * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * @@ -137737,10 +138961,12 @@ var World = new Class({ return false; } - // A Body - if (object1.body) + // TODO - Convert to fast-path index for Collider + + // SPRITE + if (object1.body || object1.isBody) { - if (object2.body) + if (object2.body || object2.isBody) { return this.collideSpriteVsSprite(object1, object2, collideCallback, processCallback, callbackContext, overlapOnly); } @@ -137757,7 +138983,7 @@ var World = new Class({ // GROUPS else if (object1.isParent) { - if (object2.body) + if (object2.body || object2.isBody) { return this.collideSpriteVsGroup(object2, object1, collideCallback, processCallback, callbackContext, overlapOnly); } @@ -137774,7 +139000,7 @@ var World = new Class({ // TILEMAP LAYERS else if (object1.isTilemap) { - if (object2.body) + if (object2.body || object2.isBody) { return this.collideSpriteVsTilemapLayer(object2, object1, collideCallback, processCallback, callbackContext, overlapOnly); } @@ -137795,8 +139021,8 @@ var World = new Class({ * * @param {Phaser.GameObjects.GameObject} sprite1 - The first object to check for collision. * @param {Phaser.GameObjects.GameObject} sprite2 - The second object to check for collision. - * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} [callbackContext] - The context in which to run the callbacks. * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * @@ -137804,12 +139030,15 @@ var World = new Class({ */ collideSpriteVsSprite: function (sprite1, sprite2, collideCallback, processCallback, callbackContext, overlapOnly) { - if (!sprite1.body || !sprite2.body) + var body1 = (sprite1.isBody) ? sprite1 : sprite1.body; + var body2 = (sprite2.isBody) ? sprite2 : sprite2.body; + + if (!body1 || !body2) { return false; } - if (this.separate(sprite1.body, sprite2.body, processCallback, callbackContext, overlapOnly)) + if (this.separate(body1, body2, processCallback, callbackContext, overlapOnly)) { if (collideCallback) { @@ -137832,8 +139061,8 @@ var World = new Class({ * * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision. * @param {Phaser.GameObjects.Group} group - The second object to check for collision. - * @param {ArcadePhysicsCallback} collideCallback - The callback to invoke when the two objects collide. - * @param {ArcadePhysicsCallback} processCallback - The callback to invoke when the two objects collide. Must return a boolean. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} collideCallback - The callback to invoke when the two objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} processCallback - The callback to invoke when the two objects collide. Must return a boolean. * @param {any} callbackContext - The scope in which to call the callbacks. * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * @@ -137841,7 +139070,7 @@ var World = new Class({ */ collideSpriteVsGroup: function (sprite, group, collideCallback, processCallback, callbackContext, overlapOnly) { - var bodyA = sprite.body; + var bodyA = (sprite.isBody) ? sprite : sprite.body; if (group.length === 0 || !bodyA || !bodyA.enable || bodyA.checkCollision.none) { @@ -137877,7 +139106,7 @@ var World = new Class({ continue; } - if (this.separate(bodyA, bodyB, processCallback, callbackContext, overlapOnly, true)) + if (this.separate(bodyA, bodyB, processCallback, callbackContext, overlapOnly)) { if (collideCallback) { @@ -137927,8 +139156,8 @@ var World = new Class({ * * @param {Phaser.GameObjects.Group} group - The first object to check for collision. * @param {Phaser.Tilemaps.TilemapLayer} tilemapLayer - The second object to check for collision. - * @param {ArcadePhysicsCallback} collideCallback - An optional callback function that is called if the objects collide. - * @param {ArcadePhysicsCallback} processCallback - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} collideCallback - An optional callback function that is called if the objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} processCallback - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} callbackContext - The context in which to run the callbacks. * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * @@ -137947,7 +139176,7 @@ var World = new Class({ for (var i = 0; i < children.length; i++) { - if (children[i].body) + if (children[i].body || children[i].isBody) { if (this.collideSpriteVsTilemapLayer(children[i], tilemapLayer, collideCallback, processCallback, callbackContext, overlapOnly)) { @@ -137981,15 +139210,15 @@ var World = new Class({ * * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision. * @param {Phaser.Tilemaps.Tile[]} tiles - An array of Tiles to check for collision against. - * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} [callbackContext] - The context in which to run the callbacks. * * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated. */ collideTiles: function (sprite, tiles, collideCallback, processCallback, callbackContext) { - if (!sprite.body.enable || tiles.length === 0) + if (tiles.length === 0 || (sprite.body && !sprite.body.enable) || (sprite.isBody && !sprite.enable)) { return false; } @@ -138016,15 +139245,15 @@ var World = new Class({ * * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision. * @param {Phaser.Tilemaps.Tile[]} tiles - An array of Tiles to check for collision against. - * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects overlap. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects overlap. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} [callbackContext] - The context in which to run the callbacks. * * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated. */ overlapTiles: function (sprite, tiles, collideCallback, processCallback, callbackContext) { - if (!sprite.body.enable || tiles.length === 0) + if (tiles.length === 0 || (sprite.body && !sprite.body.enable) || (sprite.isBody && !sprite.enable)) { return false; } @@ -138045,8 +139274,8 @@ var World = new Class({ * * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision. * @param {Phaser.Tilemaps.TilemapLayer} tilemapLayer - The second object to check for collision. - * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} [callbackContext] - The context in which to run the callbacks. * @param {boolean} [overlapOnly] - Whether this is a collision or overlap check. * @@ -138054,7 +139283,7 @@ var World = new Class({ */ collideSpriteVsTilemapLayer: function (sprite, tilemapLayer, collideCallback, processCallback, callbackContext, overlapOnly) { - var body = sprite.body; + var body = (sprite.isBody) ? sprite : sprite.body; if (!body.enable || body.checkCollision.none) { @@ -138083,7 +139312,9 @@ var World = new Class({ h += yDiff; } - var mapData = GetTilesWithinWorldXY(x, y, w, h, null, tilemapLayer.scene.cameras.main, tilemapLayer.layer); + var options = (overlapOnly) ? null : this.tileFilterOptions; + + var mapData = GetTilesWithinWorldXY(x, y, w, h, options, tilemapLayer.scene.cameras.main, tilemapLayer.layer); if (mapData.length === 0) { @@ -138107,8 +139338,8 @@ var World = new Class({ * * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision. * @param {Phaser.Tilemaps.TilemapLayer} tilemapLayer - The second object to check for collision. - * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} [callbackContext] - The context in which to run the callbacks. * @param {boolean} [overlapOnly] - Whether this is a collision or overlap check. * @param {boolean} [isLayer] - Is this check coming from a TilemapLayer or an array of tiles? @@ -138117,7 +139348,7 @@ var World = new Class({ */ collideSpriteVsTilesHandler: function (sprite, tiles, collideCallback, processCallback, callbackContext, overlapOnly, isLayer) { - var body = sprite.body; + var body = (sprite.isBody) ? sprite : sprite.body; var tile; var tileWorldRect = { left: 0, right: 0, top: 0, bottom: 0 }; @@ -138183,8 +139414,8 @@ var World = new Class({ * * @param {Phaser.GameObjects.Group} group1 - The first object to check for collision. * @param {Phaser.GameObjects.Group} group2 - The second object to check for collision. - * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} [callbackContext] - The context in which to run the callbacks. * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * @@ -138298,6 +139529,12 @@ var World = new Class({ this.shutdown(); this.scene = null; + + if (this.debugGraphic) + { + this.debugGraphic.destroy(); + this.debugGraphic = null; + } } }); @@ -138312,7 +139549,7 @@ module.exports = World; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -138388,7 +139625,7 @@ module.exports = Acceleration; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -138402,7 +139639,7 @@ var Angular = { /** * Sets the angular velocity of the body. - * + * * In Arcade Physics, bodies cannot rotate. They are always axis-aligned. * However, they can have angular motion, which is passed on to the Game Object bound to the body, * causing them to visually rotate, even though the body remains axis-aligned. @@ -138423,7 +139660,7 @@ var Angular = { /** * Sets the angular acceleration of the body. - * + * * In Arcade Physics, bodies cannot rotate. They are always axis-aligned. * However, they can have angular motion, which is passed on to the Game Object bound to the body, * causing them to visually rotate, even though the body remains axis-aligned. @@ -138471,7 +139708,7 @@ module.exports = Angular; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -138485,7 +139722,7 @@ var Bounce = { /** * Sets the bounce values of this body. - * + * * Bounce is the amount of restitution, or elasticity, the body has when it collides with another object. * A value of 1 means that it will retain its full velocity after the rebound. A value of 0 means it will not rebound at all. * @@ -138540,7 +139777,7 @@ var Bounce = { /** * Sets whether this Body collides with the world boundary. - * + * * Optionally also sets the World Bounce values. If the `Body.worldBounce` is null, it's set to a new Phaser.Math.Vector2 first. * * @method Phaser.Physics.Arcade.Components.Bounce#setCollideWorldBounds @@ -138549,12 +139786,13 @@ var Bounce = { * @param {boolean} [value=true] - `true` if this body should collide with the world bounds, otherwise `false`. * @param {number} [bounceX] - If given this will be replace the `worldBounce.x` value. * @param {number} [bounceY] - If given this will be replace the `worldBounce.y` value. + * @param {boolean} [onWorldBounds] - If given this replaces the Body's `onWorldBounds` value. * * @return {this} This Game Object. */ - setCollideWorldBounds: function (value, bounceX, bounceY) + setCollideWorldBounds: function (value, bounceX, bounceY, onWorldBounds) { - this.body.setCollideWorldBounds(value, bounceX, bounceY); + this.body.setCollideWorldBounds(value, bounceX, bounceY, onWorldBounds); return this; } @@ -138571,7 +139809,7 @@ module.exports = Bounce; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -138585,7 +139823,7 @@ var Debug = { /** * Sets the debug values of this body. - * + * * Bodies will only draw their debug if debug has been enabled for Arcade Physics as a whole. * Note that there is a performance cost in drawing debug displays. It should never be used in production. * @@ -138699,7 +139937,7 @@ module.exports = Debug; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -138833,7 +140071,7 @@ module.exports = Drag; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -138958,7 +140196,7 @@ module.exports = Enable; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -139047,7 +140285,7 @@ module.exports = Friction; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -139062,7 +140300,7 @@ var Gravity = { /** * Set the X and Y values of the gravitational pull to act upon this Arcade Physics Game Object. Values can be positive or negative. Larger values result in a stronger effect. - * + * * If only one value is provided, this value will be used for both the X and Y axis. * * @method Phaser.Physics.Arcade.Components.Gravity#setGravity @@ -139126,7 +140364,7 @@ module.exports = Gravity; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -139173,7 +140411,7 @@ module.exports = Immovable; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -139369,7 +140607,7 @@ module.exports = OverlapRect; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -139418,7 +140656,7 @@ module.exports = Pushable; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -139522,7 +140760,7 @@ module.exports = Size; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -139622,7 +140860,7 @@ module.exports = Velocity; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -139658,7 +140896,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -139788,25 +141026,25 @@ module.exports = CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Arcade Physics World Collide Event. - * + * * This event is dispatched by an Arcade Physics World instance if two bodies collide _and_ at least * one of them has their [onCollide]{@link Phaser.Physics.Arcade.Body#onCollide} property set to `true`. - * + * * It provides an alternative means to handling collide events rather than using the callback approach. - * + * * Listen to it from a Scene using: `this.physics.world.on('collide', listener)`. - * + * * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. * * @event Phaser.Physics.Arcade.Events#COLLIDE * @since 3.0.0 - * + * * @param {Phaser.GameObjects.GameObject} gameObject1 - The first Game Object involved in the collision. This is the parent of `body1`. * @param {Phaser.GameObjects.GameObject} gameObject2 - The second Game Object involved in the collision. This is the parent of `body2`. * @param {Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody} body1 - The first Physics Body involved in the collision. @@ -139822,25 +141060,25 @@ module.exports = 'collide'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Arcade Physics World Overlap Event. - * + * * This event is dispatched by an Arcade Physics World instance if two bodies overlap _and_ at least * one of them has their [onOverlap]{@link Phaser.Physics.Arcade.Body#onOverlap} property set to `true`. - * + * * It provides an alternative means to handling overlap events rather than using the callback approach. - * + * * Listen to it from a Scene using: `this.physics.world.on('overlap', listener)`. - * + * * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. * * @event Phaser.Physics.Arcade.Events#OVERLAP * @since 3.0.0 - * + * * @param {Phaser.GameObjects.GameObject} gameObject1 - The first Game Object involved in the overlap. This is the parent of `body1`. * @param {Phaser.GameObjects.GameObject} gameObject2 - The second Game Object involved in the overlap. This is the parent of `body2`. * @param {Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody} body1 - The first Physics Body involved in the overlap. @@ -139856,15 +141094,15 @@ module.exports = 'overlap'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Arcade Physics World Pause Event. - * + * * This event is dispatched by an Arcade Physics World instance when it is paused. - * + * * Listen to it from a Scene using: `this.physics.world.on('pause', listener)`. * * @event Phaser.Physics.Arcade.Events#PAUSE @@ -139880,15 +141118,15 @@ module.exports = 'pause'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Arcade Physics World Resume Event. - * + * * This event is dispatched by an Arcade Physics World instance when it resumes from a paused state. - * + * * Listen to it from a Scene using: `this.physics.world.on('resume', listener)`. * * @event Phaser.Physics.Arcade.Events#RESUME @@ -139904,25 +141142,25 @@ module.exports = 'resume'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Arcade Physics Tile Collide Event. - * + * * This event is dispatched by an Arcade Physics World instance if a body collides with a Tile _and_ * has its [onCollide]{@link Phaser.Physics.Arcade.Body#onCollide} property set to `true`. - * + * * It provides an alternative means to handling collide events rather than using the callback approach. - * + * * Listen to it from a Scene using: `this.physics.world.on('tilecollide', listener)`. - * + * * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. * * @event Phaser.Physics.Arcade.Events#TILE_COLLIDE * @since 3.16.1 - * + * * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object involved in the collision. This is the parent of `body`. * @param {Phaser.Tilemaps.Tile} tile - The tile the body collided with. * @param {Phaser.Physics.Arcade.Body} body - The Arcade Physics Body of the Game Object involved in the collision. @@ -139937,25 +141175,25 @@ module.exports = 'tilecollide'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Arcade Physics Tile Overlap Event. - * + * * This event is dispatched by an Arcade Physics World instance if a body overlaps with a Tile _and_ * has its [onOverlap]{@link Phaser.Physics.Arcade.Body#onOverlap} property set to `true`. - * + * * It provides an alternative means to handling overlap events rather than using the callback approach. - * + * * Listen to it from a Scene using: `this.physics.world.on('tileoverlap', listener)`. - * + * * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. * * @event Phaser.Physics.Arcade.Events#TILE_OVERLAP * @since 3.16.1 - * + * * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object involved in the overlap. This is the parent of `body`. * @param {Phaser.Tilemaps.Tile} tile - The tile the body overlapped. * @param {Phaser.Physics.Arcade.Body} body - The Arcade Physics Body of the Game Object involved in the overlap. @@ -139970,23 +141208,23 @@ module.exports = 'tileoverlap'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Arcade Physics World Bounds Event. - * + * * This event is dispatched by an Arcade Physics World instance if a body makes contact with the world bounds _and_ * it has its [onWorldBounds]{@link Phaser.Physics.Arcade.Body#onWorldBounds} property set to `true`. - * + * * It provides an alternative means to handling collide events rather than using the callback approach. - * + * * Listen to it from a Scene using: `this.physics.world.on('worldbounds', listener)`. * * @event Phaser.Physics.Arcade.Events#WORLD_BOUNDS * @since 3.0.0 - * + * * @param {Phaser.Physics.Arcade.Body} body - The Arcade Physics Body that hit the world bounds. * @param {boolean} up - Is the Body blocked up? I.e. collided with the top of the world bounds. * @param {boolean} down - Is the Body blocked down? I.e. collided with the bottom of the world bounds. @@ -140003,7 +141241,7 @@ module.exports = 'worldbounds'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140032,7 +141270,7 @@ module.exports = 'worldstep'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140061,7 +141299,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140107,7 +141345,7 @@ module.exports = Arcade; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140149,7 +141387,7 @@ module.exports = ProcessTileCallbacks; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140198,7 +141436,7 @@ module.exports = ProcessTileSeparationX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140247,7 +141485,7 @@ module.exports = ProcessTileSeparationY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140368,7 +141606,7 @@ module.exports = SeparateTile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140459,7 +141697,7 @@ module.exports = TileCheckX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140550,7 +141788,7 @@ module.exports = TileCheckY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140587,7 +141825,7 @@ module.exports = TileIntersectsBody; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140617,7 +141855,7 @@ module.exports = Tilemap; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140644,7 +141882,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140653,17 +141891,17 @@ var Vector2 = __webpack_require__(93736); /** * @classdesc - * + * * The Body Bounds class contains methods to help you extract the world coordinates from various points around * the bounds of a Matter Body. Because Matter bodies are positioned based on their center of mass, and not a * dimension based center, you often need to get the bounds coordinates in order to properly align them in the world. - * + * * You can access this class via the MatterPhysics class from a Scene, i.e.: - * + * * ```javascript * this.matter.bodyBounds.getTopLeft(body); * ``` - * + * * See also the `MatterPhysics.alignBody` method. * * @class BodyBounds @@ -140698,9 +141936,9 @@ var BodyBounds = new Class({ /** * Parses the given body to get the bounds diff values from it. - * + * * They're stored in this class in the temporary properties `boundsCenter` and `centerDiff`. - * + * * This method is called automatically by all other methods in this class. * * @method Phaser.Physics.Matter.BodyBounds#parseBody @@ -140736,7 +141974,7 @@ var BodyBounds = new Class({ /** * Takes a Body and returns the world coordinates of the top-left of its _bounds_. - * + * * Body bounds are updated by Matter each step and factor in scale and rotation. * This will return the world coordinate based on the bodies _current_ position and bounds. * @@ -140770,7 +142008,7 @@ var BodyBounds = new Class({ /** * Takes a Body and returns the world coordinates of the top-center of its _bounds_. - * + * * Body bounds are updated by Matter each step and factor in scale and rotation. * This will return the world coordinate based on the bodies _current_ position and bounds. * @@ -140804,7 +142042,7 @@ var BodyBounds = new Class({ /** * Takes a Body and returns the world coordinates of the top-right of its _bounds_. - * + * * Body bounds are updated by Matter each step and factor in scale and rotation. * This will return the world coordinate based on the bodies _current_ position and bounds. * @@ -140838,7 +142076,7 @@ var BodyBounds = new Class({ /** * Takes a Body and returns the world coordinates of the left-center of its _bounds_. - * + * * Body bounds are updated by Matter each step and factor in scale and rotation. * This will return the world coordinate based on the bodies _current_ position and bounds. * @@ -140872,7 +142110,7 @@ var BodyBounds = new Class({ /** * Takes a Body and returns the world coordinates of the center of its _bounds_. - * + * * Body bounds are updated by Matter each step and factor in scale and rotation. * This will return the world coordinate based on the bodies _current_ position and bounds. * @@ -140905,7 +142143,7 @@ var BodyBounds = new Class({ /** * Takes a Body and returns the world coordinates of the right-center of its _bounds_. - * + * * Body bounds are updated by Matter each step and factor in scale and rotation. * This will return the world coordinate based on the bodies _current_ position and bounds. * @@ -140939,7 +142177,7 @@ var BodyBounds = new Class({ /** * Takes a Body and returns the world coordinates of the bottom-left of its _bounds_. - * + * * Body bounds are updated by Matter each step and factor in scale and rotation. * This will return the world coordinate based on the bodies _current_ position and bounds. * @@ -140973,7 +142211,7 @@ var BodyBounds = new Class({ /** * Takes a Body and returns the world coordinates of the bottom-center of its _bounds_. - * + * * Body bounds are updated by Matter each step and factor in scale and rotation. * This will return the world coordinate based on the bodies _current_ position and bounds. * @@ -141007,7 +142245,7 @@ var BodyBounds = new Class({ /** * Takes a Body and returns the world coordinates of the bottom-right of its _bounds_. - * + * * Body bounds are updated by Matter each step and factor in scale and rotation. * This will return the world coordinate based on the bodies _current_ position and bounds. * @@ -141051,7 +142289,7 @@ module.exports = BodyBounds; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -141065,13 +142303,12 @@ Matter.Body = __webpack_require__(84125); Matter.Composite = __webpack_require__(11299); Matter.World = __webpack_require__(72005); +Matter.Collision = __webpack_require__(63454); Matter.Detector = __webpack_require__(13657); -Matter.Grid = __webpack_require__(15489); Matter.Pairs = __webpack_require__(91327); Matter.Pair = __webpack_require__(70584); Matter.Query = __webpack_require__(13390); Matter.Resolver = __webpack_require__(44272); -Matter.SAT = __webpack_require__(5756); Matter.Constraint = __webpack_require__(52838); @@ -141109,7 +142346,7 @@ module.exports = Matter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -142040,7 +143277,7 @@ module.exports = Factory; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -142066,7 +143303,7 @@ function hasGetterOrSetter (def) /** * A Matter Game Object is a generic object that allows you to combine any Phaser Game Object, * including those you have extended or created yourself, with all of the Matter Components. - * + * * This enables you to use component methods such as `setVelocity` or `isSensor` directly from * this Game Object. * @@ -142150,7 +143387,7 @@ var MatterGameObject = function (world, gameObject, options, addToWorld) } options.addToWorld = addToWorld; - + gameObject.setBody(shape, options); } @@ -142167,7 +143404,7 @@ module.exports = MatterGameObject; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -142314,7 +143551,7 @@ module.exports = MatterImage; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -142325,6 +143562,8 @@ var Body = __webpack_require__(84125); var BodyBounds = __webpack_require__(63568); var Bounds = __webpack_require__(84091); var Class = __webpack_require__(56694); +var Collision = __webpack_require__(63454); +var Common = __webpack_require__(68758); var Composite = __webpack_require__(11299); var Composites = __webpack_require__(56643); var Constraint = __webpack_require__(52838); @@ -142333,7 +143572,6 @@ var DistanceBetween = __webpack_require__(53996); var Factory = __webpack_require__(72653); var GetFastValue = __webpack_require__(72632); var GetValue = __webpack_require__(10850); -var Grid = __webpack_require__(15489); var MatterAttractors = __webpack_require__(1675); var MatterCollisionEvents = __webpack_require__(80391); var MatterLib = __webpack_require__(16929); @@ -142345,20 +143583,21 @@ var Plugin = __webpack_require__(84474); var PluginCache = __webpack_require__(91963); var Query = __webpack_require__(13390); var Resolver = __webpack_require__(44272); -var SAT = __webpack_require__(5756); var SceneEvents = __webpack_require__(7599); var Svg = __webpack_require__(92765); var Vector = __webpack_require__(10438); var Vertices = __webpack_require__(39745); var World = __webpack_require__(31468); +Common.setDecomp(__webpack_require__(81084)); + /** * @classdesc * The Phaser Matter plugin provides the ability to use the Matter JS Physics Engine within your Phaser games. - * + * * Unlike Arcade Physics, the other physics system provided with Phaser, Matter JS is a full-body physics system. * It features: - * + * * * Rigid bodies * * Compound bodies * * Composite bodies @@ -142376,10 +143615,10 @@ var World = __webpack_require__(31468); * * Views (translate, zoom) * * Collision queries (raycasting, region tests) * * Time scaling (slow-mo, speed-up) - * + * * Configuration of Matter is handled via the Matter World Config object, which can be passed in either the * Phaser Game Config, or Phaser Scene Config. Here is a basic example: - * + * * ```js * physics: { * default: 'matter', @@ -142395,11 +143634,11 @@ var World = __webpack_require__(31468); * } * } * ``` - * + * * This class acts as an interface between a Phaser Scene and a single instance of the Matter Engine. - * + * * Use it to access the most common Matter features and helper functions. - * + * * You can find details, documentation and examples on the Matter JS website: https://brm.io/matter-js/ * * @class MatterPhysics @@ -142455,7 +143694,7 @@ var MatterPhysics = new Class({ /** * An instance of the Matter Factory. This class provides lots of functions for creating a * wide variety of physics objects and adds them automatically to the Matter World. - * + * * You can use this class to cut-down on the amount of code required in your game, however, * use of the Factory is entirely optional and should be seen as a development aid. It's * perfectly possible to create and add components to the Matter world without using it. @@ -142480,7 +143719,7 @@ var MatterPhysics = new Class({ /** * A reference to the `Matter.Body` module. - * + * * The `Matter.Body` module contains methods for creating and manipulating body models. * A `Matter.Body` is a rigid body that can be simulated by a `Matter.Engine`. * Factories for commonly used body configurations (such as rectangles, circles and other polygons) can be found in the `Bodies` module. @@ -142493,7 +143732,7 @@ var MatterPhysics = new Class({ /** * A reference to the `Matter.Composite` module. - * + * * The `Matter.Composite` module contains methods for creating and manipulating composite bodies. * A composite body is a collection of `Matter.Body`, `Matter.Constraint` and other `Matter.Composite`, therefore composites form a tree structure. * It is important to use the functions in this module to modify composites, rather than directly modifying their properties. @@ -142507,9 +143746,22 @@ var MatterPhysics = new Class({ // Collision: + /** + * A reference to the `Matter.Collision` module. + * + * The `Matter.Collision` module contains methods for detecting collisions between a given pair of bodies. + * + * For efficient detection between a list of bodies, see `Matter.Detector` and `Matter.Query`. + * + * @name Phaser.Physics.Matter.MatterPhysics#collision + * @type {MatterJS.Collision} + * @since 3.60.0 + */ + this.collision = Collision; + /** * A reference to the `Matter.Detector` module. - * + * * The `Matter.Detector` module contains methods for detecting collisions given a set of pairs. * * @name Phaser.Physics.Matter.MatterPhysics#detector @@ -142518,20 +143770,9 @@ var MatterPhysics = new Class({ */ this.detector = Detector; - /** - * A reference to the `Matter.Grid` module. - * - * The `Matter.Grid` module contains methods for creating and manipulating collision broadphase grid structures. - * - * @name Phaser.Physics.Matter.MatterPhysics#grid - * @type {MatterJS.GridFactory} - * @since 3.22.0 - */ - this.grid = Grid; - /** * A reference to the `Matter.Pair` module. - * + * * The `Matter.Pair` module contains methods for creating and manipulating collision pairs. * * @name Phaser.Physics.Matter.MatterPhysics#pair @@ -142542,7 +143783,7 @@ var MatterPhysics = new Class({ /** * A reference to the `Matter.Pairs` module. - * + * * The `Matter.Pairs` module contains methods for creating and manipulating collision pair sets. * * @name Phaser.Physics.Matter.MatterPhysics#pairs @@ -142553,7 +143794,7 @@ var MatterPhysics = new Class({ /** * A reference to the `Matter.Query` module. - * + * * The `Matter.Query` module contains methods for performing collision queries. * * @name Phaser.Physics.Matter.MatterPhysics#query @@ -142564,7 +143805,7 @@ var MatterPhysics = new Class({ /** * A reference to the `Matter.Resolver` module. - * + * * The `Matter.Resolver` module contains methods for resolving collision pairs. * * @name Phaser.Physics.Matter.MatterPhysics#resolver @@ -142573,22 +143814,11 @@ var MatterPhysics = new Class({ */ this.resolver = Resolver; - /** - * A reference to the `Matter.SAT` module. - * - * The `Matter.SAT` module contains methods for detecting collisions using the Separating Axis Theorem. - * - * @name Phaser.Physics.Matter.MatterPhysics#sat - * @type {MatterJS.SATFactory} - * @since 3.22.0 - */ - this.sat = SAT; - // Constraint /** * A reference to the `Matter.Constraint` module. - * + * * The `Matter.Constraint` module contains methods for creating and manipulating constraints. * Constraints are used for specifying that a fixed distance must be maintained between two bodies (or a body and a fixed world-space position). * The stiffness of constraints can be modified to create springs or elastic. @@ -142603,7 +143833,7 @@ var MatterPhysics = new Class({ /** * A reference to the `Matter.Bodies` module. - * + * * The `Matter.Bodies` module contains factory methods for creating rigid bodies * with commonly used body configurations (such as rectangles, circles and other polygons). * @@ -142615,7 +143845,7 @@ var MatterPhysics = new Class({ /** * A reference to the `Matter.Composites` module. - * + * * The `Matter.Composites` module contains factory methods for creating composite bodies * with commonly used configurations (such as stacks and chains). * @@ -142629,7 +143859,7 @@ var MatterPhysics = new Class({ /** * A reference to the `Matter.Axes` module. - * + * * The `Matter.Axes` module contains methods for creating and manipulating sets of axes. * * @name Phaser.Physics.Matter.MatterPhysics#axes @@ -142640,7 +143870,7 @@ var MatterPhysics = new Class({ /** * A reference to the `Matter.Bounds` module. - * + * * The `Matter.Bounds` module contains methods for creating and manipulating axis-aligned bounding boxes (AABB). * * @name Phaser.Physics.Matter.MatterPhysics#bounds @@ -142651,7 +143881,7 @@ var MatterPhysics = new Class({ /** * A reference to the `Matter.Svg` module. - * + * * The `Matter.Svg` module contains methods for converting SVG images into an array of vector points. * * To use this module you also need the SVGPathSeg polyfill: https://github.com/progers/pathseg @@ -142664,7 +143894,7 @@ var MatterPhysics = new Class({ /** * A reference to the `Matter.Vector` module. - * + * * The `Matter.Vector` module contains methods for creating and manipulating vectors. * Vectors are the basis of all the geometry related operations in the engine. * A `Matter.Vector` object is of the form `{ x: 0, y: 0 }`. @@ -142677,7 +143907,7 @@ var MatterPhysics = new Class({ /** * A reference to the `Matter.Vertices` module. - * + * * The `Matter.Vertices` module contains methods for creating and manipulating sets of vertices. * A set of vertices is an array of `Matter.Vector` with additional indexing properties inserted by `Vertices.create`. * A `Matter.Body` maintains a set of vertices to represent the shape of the object (its convex hull). @@ -142690,7 +143920,7 @@ var MatterPhysics = new Class({ /** * A reference to the `Matter.Vertices` module. - * + * * The `Matter.Vertices` module contains methods for creating and manipulating sets of vertices. * A set of vertices is an array of `Matter.Vector` with additional indexing properties inserted by `Vertices.create`. * A `Matter.Body` maintains a set of vertices to represent the shape of the object (its convex hull). @@ -142802,18 +144032,18 @@ var MatterPhysics = new Class({ /** * Enables the Matter Attractors Plugin. - * + * * The attractors plugin that makes it easy to apply continual forces on bodies. * It's possible to simulate effects such as wind, gravity and magnetism. - * + * * https://github.com/liabru/matter-attractors - * + * * This method is called automatically if `plugins.attractors` is set in the Matter World Config. * However, you can also call it directly from within your game. * * @method Phaser.Physics.Matter.MatterPhysics#enableAttractorPlugin * @since 3.0.0 - * + * * @return {this} This Matter Physics instance. */ enableAttractorPlugin: function () @@ -142826,19 +144056,19 @@ var MatterPhysics = new Class({ /** * Enables the Matter Wrap Plugin. - * + * * The coordinate wrapping plugin that automatically wraps the position of bodies such that they always stay * within the given bounds. Upon crossing a boundary the body will appear on the opposite side of the bounds, * while maintaining its velocity. - * + * * https://github.com/liabru/matter-wrap - * + * * This method is called automatically if `plugins.wrap` is set in the Matter World Config. * However, you can also call it directly from within your game. * * @method Phaser.Physics.Matter.MatterPhysics#enableWrapPlugin * @since 3.0.0 - * + * * @return {this} This Matter Physics instance. */ enableWrapPlugin: function () @@ -142851,33 +144081,33 @@ var MatterPhysics = new Class({ /** * Enables the Matter Collision Events Plugin. - * + * * Note that this plugin is enabled by default. So you should only ever need to call this * method if you have specifically disabled the plugin in your Matter World Config. * You can disable it by setting `plugins.collisionevents: false` in your Matter World Config. - * + * * This plugin triggers three new events on Matter.Body: - * + * * 1. `onCollide` * 2. `onCollideEnd` * 3. `onCollideActive` - * + * * These events correspond to the Matter.js events `collisionStart`, `collisionActive` and `collisionEnd`, respectively. * You can listen to these events via Matter.Events or they will also be emitted from the Matter World. - * + * * This plugin also extends Matter.Body with three convenience functions: - * + * * `Matter.Body.setOnCollide(callback)` * `Matter.Body.setOnCollideEnd(callback)` * `Matter.Body.setOnCollideActive(callback)` - * + * * You can register event callbacks by providing a function of type (pair: Matter.Pair) => void - * + * * https://github.com/dxu/matter-collision-events * * @method Phaser.Physics.Matter.MatterPhysics#enableCollisionEventsPlugin * @since 3.22.0 - * + * * @return {this} This Matter Physics instance. */ enableCollisionEventsPlugin: function () @@ -142890,7 +144120,7 @@ var MatterPhysics = new Class({ /** * Pauses the Matter World instance and sets `enabled` to `false`. - * + * * A paused world will not run any simulations for the duration it is paused. * * @method Phaser.Physics.Matter.MatterPhysics#pause @@ -142953,12 +144183,12 @@ var MatterPhysics = new Class({ /** * Manually advances the physics simulation by one iteration. - * + * * You can optionally pass in the `delta` and `correction` values to be used by Engine.update. * If undefined they use the Matter defaults of 60Hz and no correction. - * + * * Calling `step` directly bypasses any checks of `enabled` or `autoUpdate`. - * + * * It also ignores any custom `getDelta` functions, as you should be passing the delta * value in to this call. * @@ -142985,22 +144215,22 @@ var MatterPhysics = new Class({ /** * Checks if the vertices of the given body, or an array of bodies, contains the given point, or not. - * + * * You can pass in either a single body, or an array of bodies to be checked. This method will * return `true` if _any_ of the bodies in the array contain the point. See the `intersectPoint` method if you need * to get a list of intersecting bodies. - * + * * The point should be transformed into the Matter World coordinate system in advance. This happens by * default with Input Pointers, but if you wish to use points from another system you may need to * transform them before passing them. - * + * * @method Phaser.Physics.Matter.MatterPhysics#containsPoint * @since 3.22.0 * * @param {(Phaser.Types.Physics.Matter.MatterBody|Phaser.Types.Physics.Matter.MatterBody[])} body - The body, or an array of bodies, to check against the point. * @param {number} x - The horizontal coordinate of the point. * @param {number} y - The vertical coordinate of the point. - * + * * @return {boolean} `true` if the point is within one of the bodies given, otherwise `false`. */ containsPoint: function (body, x, y) @@ -143016,20 +144246,20 @@ var MatterPhysics = new Class({ /** * Checks the given coordinates to see if any vertices of the given bodies contain it. - * + * * If no bodies are provided it will search all bodies in the Matter World, including within Composites. - * + * * The coordinates should be transformed into the Matter World coordinate system in advance. This happens by * default with Input Pointers, but if you wish to use coordinates from another system you may need to * transform them before passing them. - * + * * @method Phaser.Physics.Matter.MatterPhysics#intersectPoint * @since 3.22.0 * * @param {number} x - The horizontal coordinate of the point. * @param {number} y - The vertical coordinate of the point. * @param {Phaser.Types.Physics.Matter.MatterBody[]} [bodies] - An array of bodies to check. If not provided it will search all bodies in the world. - * + * * @return {Phaser.Types.Physics.Matter.MatterBody[]} An array of bodies which contain the given point. */ intersectPoint: function (x, y, bodies) @@ -143057,9 +144287,9 @@ var MatterPhysics = new Class({ * Checks the given rectangular area to see if any vertices of the given bodies intersect with it. * Or, if the `outside` parameter is set to `true`, it checks to see which bodies do not * intersect with it. - * + * * If no bodies are provided it will search all bodies in the Matter World, including within Composites. - * + * * @method Phaser.Physics.Matter.MatterPhysics#intersectRect * @since 3.22.0 * @@ -143069,7 +144299,7 @@ var MatterPhysics = new Class({ * @param {number} height - The height of the area. * @param {boolean} [outside=false] - If `false` it checks for vertices inside the area, if `true` it checks for vertices outside the area. * @param {Phaser.Types.Physics.Matter.MatterBody[]} [bodies] - An array of bodies to check. If not provided it will search all bodies in the world. - * + * * @return {Phaser.Types.Physics.Matter.MatterBody[]} An array of bodies that intersect with the given area. */ intersectRect: function (x, y, width, height, outside, bodies) @@ -143100,11 +144330,11 @@ var MatterPhysics = new Class({ /** * Checks the given ray segment to see if any vertices of the given bodies intersect with it. - * + * * If no bodies are provided it will search all bodies in the Matter World. - * + * * The width of the ray can be specified via the `rayWidth` parameter. - * + * * @method Phaser.Physics.Matter.MatterPhysics#intersectRay * @since 3.22.0 * @@ -143114,13 +144344,13 @@ var MatterPhysics = new Class({ * @param {number} y2 - The vertical coordinate of the end of the ray segment. * @param {number} [rayWidth=1] - The width of the ray segment. * @param {Phaser.Types.Physics.Matter.MatterBody[]} [bodies] - An array of bodies to check. If not provided it will search all bodies in the world. - * + * * @return {Phaser.Types.Physics.Matter.MatterBody[]} An array of bodies whos vertices intersect with the ray segment. */ intersectRay: function (x1, y1, x2, y2, rayWidth, bodies) { if (rayWidth === undefined) { rayWidth = 1; } - + bodies = this.getMatterBodies(bodies); var result = []; @@ -143136,15 +144366,15 @@ var MatterPhysics = new Class({ /** * Checks the given Matter Body to see if it intersects with any of the given bodies. - * + * * If no bodies are provided it will check against all bodies in the Matter World. - * + * * @method Phaser.Physics.Matter.MatterPhysics#intersectBody * @since 3.22.0 * * @param {Phaser.Types.Physics.Matter.MatterBody} body - The target body. * @param {Phaser.Types.Physics.Matter.MatterBody[]} [bodies] - An array of bodies to check the target body against. If not provided it will search all bodies in the world. - * + * * @return {Phaser.Types.Physics.Matter.MatterBody[]} An array of bodies whos vertices intersect with target body. */ intersectBody: function (body, bodies) @@ -143173,31 +144403,31 @@ var MatterPhysics = new Class({ /** * Checks to see if the target body, or an array of target bodies, intersects with any of the given bodies. - * + * * If intersection occurs this method will return `true` and, if provided, invoke the callbacks. - * + * * If no bodies are provided for the second parameter the target will check again all bodies in the Matter World. - * + * * Note that bodies can only overlap if they are in non-colliding collision groups or categories. - * + * * If you provide a `processCallback` then the two bodies that overlap are sent to it. This callback * must return a boolean and is used to allow you to perform additional processing tests before a final * outcome is decided. If it returns `true` then the bodies are finally passed to the `overlapCallback`, if set. - * + * * If you provide an `overlapCallback` then the matching pairs of overlapping bodies will be sent to it. - * + * * Both callbacks have the following signature: `function (bodyA, bodyB, collisionInfo)` where `bodyA` is always * the target body. The `collisionInfo` object contains additional data, such as the angle and depth of penetration. - * + * * @method Phaser.Physics.Matter.MatterPhysics#overlap * @since 3.22.0 * * @param {(Phaser.Types.Physics.Matter.MatterBody|Phaser.Types.Physics.Matter.MatterBody[])} target - The target body, or array of target bodies, to check. * @param {Phaser.Types.Physics.Matter.MatterBody[]} [bodies] - The second body, or array of bodies, to check. If falsey it will check against all bodies in the world. - * @param {ArcadePhysicsCallback} [overlapCallback] - An optional callback function that is called if the bodies overlap. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two bodies if they overlap. If this is set then `overlapCallback` will only be invoked if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [overlapCallback] - An optional callback function that is called if the bodies overlap. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two bodies if they overlap. If this is set then `overlapCallback` will only be invoked if this callback returns `true`. * @param {*} [callbackContext] - The context, or scope, in which to run the callbacks. - * + * * @return {boolean} `true` if the target body intersects with _any_ of the bodies given, otherwise `false`. */ overlap: function (target, bodies, overlapCallback, processCallback, callbackContext) @@ -143249,9 +144479,9 @@ var MatterPhysics = new Class({ /** * Sets the collision filter category of all given Matter Bodies to the given value. - * + * * This number must be a power of two between 2^0 (= 1) and 2^31. - * + * * Bodies with different collision groups (see {@link #setCollisionGroup}) will only collide if their collision * categories are included in their collision masks (see {@link #setCollidesWith}). * @@ -143277,10 +144507,10 @@ var MatterPhysics = new Class({ /** * Sets the collision filter group of all given Matter Bodies to the given value. - * + * * If the group value is zero, or if two Matter Bodies have different group values, * they will collide according to the usual collision filter rules (see {@link #setCollisionCategory} and {@link #setCollisionGroup}). - * + * * If two Matter Bodies have the same positive group value, they will always collide; * if they have the same negative group value they will never collide. * @@ -143306,9 +144536,9 @@ var MatterPhysics = new Class({ /** * Sets the collision filter mask of all given Matter Bodies to the given value. - * + * * Two Matter Bodies with different collision groups will only collide if each one includes the others - * category in its mask based on a bitwise AND operation: `(categoryA & maskB) !== 0` and + * category in its mask based on a bitwise AND operation: `(categoryA & maskB) !== 0` and * `(categoryB & maskA) !== 0` are both true. * * @method Phaser.Physics.Matter.MatterPhysics#setCollidesWith @@ -143347,10 +144577,10 @@ var MatterPhysics = new Class({ /** * Takes an array and returns a new array made from all of the Matter Bodies found in the original array. - * + * * For example, passing in Matter Game Objects, such as a bunch of Matter Sprites, to this method, would * return an array containing all of their native Matter Body objects. - * + * * If the `bodies` argument is falsey, it will return all bodies in the world. * * @method Phaser.Physics.Matter.MatterPhysics#getMatterBodies @@ -143526,7 +144756,7 @@ var MatterPhysics = new Class({ /** * Applies a force to a body, from the given world position, including resulting torque. * If no angle is given, the current body angle is used. - * + * * Use very small speed values, such as 0.1, depending on the mass and required velocity. * * @method Phaser.Physics.Matter.MatterPhysics#applyForceFromPosition @@ -143564,7 +144794,7 @@ var MatterPhysics = new Class({ /** * Apply a force to a body based on the given angle and speed. * If no angle is given, the current body angle is used. - * + * * Use very small speed values, such as 0.1, depending on the mass and required velocity. * * @method Phaser.Physics.Matter.MatterPhysics#applyForceFromAngle @@ -143632,22 +144862,22 @@ var MatterPhysics = new Class({ /** * Aligns a Body, or Matter Game Object, against the given coordinates. - * + * * The alignment takes place using the body bounds, which take into consideration things * like body scale and rotation. - * + * * Although a Body has a `position` property, it is based on the center of mass for the body, * not a dimension based center. This makes aligning bodies difficult, especially if they have * rotated or scaled. This method will derive the correct position based on the body bounds and * its center of mass offset, in order to align the body with the given coordinate. - * + * * For example, if you wanted to align a body so it sat in the bottom-center of the * Scene, and the world was 800 x 600 in size: - * + * * ```javascript * this.matter.alignBody(body, 400, 600, Phaser.Display.Align.BOTTOM_CENTER); * ``` - * + * * You pass in 400 for the x coordinate, because that is the center of the world, and 600 for * the y coordinate, as that is the base of the world. * @@ -143677,7 +144907,7 @@ var MatterPhysics = new Class({ case ALIGN_CONST.TOP_CENTER: pos = this.bodyBounds.getTopCenter(body, x, y); break; - + case ALIGN_CONST.TOP_RIGHT: case ALIGN_CONST.RIGHT_TOP: pos = this.bodyBounds.getTopRight(body, x, y); @@ -143784,7 +145014,7 @@ module.exports = MatterPhysics; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -143937,7 +145167,7 @@ module.exports = MatterSprite; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -144063,7 +145293,7 @@ var MatterTileBody = new Class({ * @since 3.0.0 * * @param {Phaser.Types.Physics.Matter.MatterBodyTileOptions} [options] - Options to be used when creating the Matter body. See MatterJS.Body for a list of what Matter accepts. - * + * * @return {Phaser.Physics.Matter.TileBody} This TileBody object. */ setFromTileRectangle: function (options) @@ -144097,7 +145327,7 @@ var MatterTileBody = new Class({ * @since 3.0.0 * * @param {Phaser.Types.Physics.Matter.MatterBodyTileOptions} [options] - Options to be used when creating the Matter body. See MatterJS.Body for a list of what Matter accepts. - * + * * @return {Phaser.Physics.Matter.TileBody} This TileBody object. */ setFromTileCollision: function (options) @@ -144188,7 +145418,7 @@ var MatterTileBody = new Class({ * * @param {MatterJS.BodyType} body - The new Matter body to use. * @param {boolean} [addToWorld=true] - Whether or not to add the body to the Matter world. - * + * * @return {Phaser.Physics.Matter.TileBody} This TileBody object. */ setBody: function (body, addToWorld) @@ -144260,7 +145490,7 @@ module.exports = MatterTileBody; * @author Joachim Grill * @author Richard Davey * @copyright 2018 CodeAndWeb GmbH - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -144289,7 +145519,7 @@ var PhysicsEditorParser = { * @param {number} y - The vertical world location of the body. * @param {object} config - The body configuration and fixture (child body) definitions, as exported by PhysicsEditor. * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation. - * + * * @return {MatterJS.BodyType} A compound Matter JS Body. */ parseBody: function (x, y, config, options) @@ -144319,7 +145549,7 @@ var PhysicsEditorParser = { var body = Body.create(matterConfig); Body.setParts(body, fixtures); - + Body.setPosition(body, { x: x, y: y }); return body; @@ -144332,7 +145562,7 @@ var PhysicsEditorParser = { * @since 3.10.0 * * @param {object} fixtureConfig - The fixture object to parse. - * + * * @return {MatterJS.BodyType[]} - An array of Matter JS Bodies. */ parseFixture: function (fixtureConfig) @@ -144367,7 +145597,7 @@ var PhysicsEditorParser = { * * @param {array} vertexSets - The vertex lists to parse. * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation. - * + * * @return {MatterJS.BodyType[]} - An array of Matter JS Bodies. */ parseVertices: function (vertexSets, options) @@ -144401,7 +145631,7 @@ module.exports = PhysicsEditorParser; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -144410,29 +145640,29 @@ var Body = __webpack_require__(84125); /** * Creates a body using the supplied physics data, as provided by a JSON file. - * + * * The data file should be loaded as JSON: - * + * * ```javascript * preload () * { * this.load.json('ninjas', 'assets/ninjas.json); * } - * + * * create () * { * const ninjaShapes = this.cache.json.get('ninjas'); - * + * * this.matter.add.fromJSON(400, 300, ninjaShapes.shinobi); * } * ``` - * + * * Do not pass the entire JSON file to this method, but instead pass one of the shapes contained within it. - * + * * If you pas in an `options` object, any settings in there will override those in the config object. - * + * * The structure of the JSON file is as follows: - * + * * ```text * { * 'generator_info': // The name of the application that created the JSON data @@ -144443,7 +145673,7 @@ var Body = __webpack_require__(84125); * } * } * ``` - * + * * At the time of writing, only the Phaser Physics Tracer App exports in this format. * * @namespace Phaser.Physics.Matter.PhysicsJSONParser @@ -144461,7 +145691,7 @@ var PhysicsJSONParser = { * @param {number} y - The vertical world location of the body. * @param {object} config - The body configuration data. * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation. - * + * * @return {MatterJS.BodyType} A Matter JS Body. */ parseBody: function (x, y, config, options) @@ -144519,7 +145749,7 @@ module.exports = PhysicsJSONParser; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -144542,7 +145772,7 @@ var Vertices = __webpack_require__(39745); * and when one is pressed down it checks to see if that hit any part of any active * body in the world. If it did, and the body has input enabled, it will begin to * drag it until either released, or you stop it via the `stopDrag` method. - * + * * You can adjust the stiffness, length and other properties of the constraint via * the `options` object on creation. * @@ -144620,7 +145850,7 @@ var PointerConstraint = new Class({ /** * Is this Constraint active or not? - * + * * An active constraint will be processed each update. An inactive one will be skipped. * Use this to toggle a Pointer Constraint on and off. * @@ -144675,7 +145905,7 @@ var PointerConstraint = new Class({ /** * A Pointer has been pressed down onto the Scene. - * + * * If this Constraint doesn't have an active Pointer then a hit test is set to * run against all active bodies in the world during the _next_ call to `update`. * If a body is found, it is bound to this constraint and the drag begins. @@ -144718,7 +145948,7 @@ var PointerConstraint = new Class({ * @method Phaser.Physics.Matter.PointerConstraint#getBody * @fires Phaser.Physics.Matter.Events#DRAG_START * @since 3.16.2 - * + * * @return {boolean} `true` if a body was found and set, otherwise `false`. */ getBody: function (pointer) @@ -144833,9 +146063,9 @@ var PointerConstraint = new Class({ var pos = this.position; var constraint = this.constraint; - + this.camera.getWorldPoint(pointer.x, pointer.y, pos); - + // Drag update constraint.pointA.x = pos.x; constraint.pointA.y = pos.y; @@ -144848,7 +146078,7 @@ var PointerConstraint = new Class({ /** * Stops the Pointer Constraint from dragging the body any further. - * + * * This is called automatically if the Pointer is released while actively * dragging a body. Or, you can call it manually to release a body from a * constraint without having to first release the pointer. @@ -144908,7 +146138,7 @@ module.exports = PointerConstraint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -144931,15 +146161,15 @@ var Vector = __webpack_require__(10438); /** * @classdesc * The Matter World class is responsible for managing one single instance of a Matter Physics World for Phaser. - * + * * Access this via `this.matter.world` from within a Scene. - * + * * This class creates a Matter JS World Composite along with the Matter JS Engine during instantiation. It also * handles delta timing, bounds, body and constraint creation and debug drawing. - * + * * If you wish to access the Matter JS World object directly, see the `localWorld` property. * If you wish to access the Matter Engine directly, see the `engine` property. - * + * * This class is an Event Emitter and will proxy _all_ Matter JS events, as they are received. * * @class World @@ -145035,13 +146265,13 @@ var World = new Class({ /** * This function is called every time the core game loop steps, which is bound to the * Request Animation Frame frequency unless otherwise modified. - * + * * The function is passed two values: `time` and `delta`, both of which come from the game step values. - * + * * It must return a number. This number is used as the delta value passed to Matter.Engine.update. - * + * * You can override this function with your own to define your own timestep. - * + * * If you need to update the Engine multiple times in a single game step then call * `World.update` as many times as required. Each call will trigger the `getDelta` function. * If you wish to have full control over when the Engine updates then see the property `autoUpdate`. @@ -145079,7 +146309,7 @@ var World = new Class({ /** * The Matter JS Runner Configuration object. - * + * * This object is populated via the Matter Configuration object's `runner` property and is * updated constantly during the game step. * @@ -145138,12 +146368,12 @@ var World = new Class({ /** * The debug configuration object. - * + * * The values stored in this object are read from the Matter World Config `debug` property. - * + * * When a new Body or Constraint is _added to the World_, they are given the values stored in this object, * unless they have their own `render` object set that will override them. - * + * * Note that while you can modify the values of properties in this object at run-time, it will not change * any of the Matter objects _already added_. It will only impact objects newly added to the world, or one * that is removed and then re-added at a later time. @@ -145254,16 +146484,16 @@ var World = new Class({ /** * Sets the debug render style for the children of the given Matter Composite. - * + * * Composites themselves do not render, but they can contain bodies, constraints and other composites that may do. * So the children of this composite are passed to the `setBodyRenderStyle`, `setCompositeRenderStyle` and * `setConstraintRenderStyle` methods accordingly. - * + * * @method Phaser.Physics.Matter.World#setCompositeRenderStyle * @since 3.22.0 * * @param {MatterJS.CompositeType} composite - The Matter Composite to set the render style on. - * + * * @return {this} This Matter World instance for method chaining. */ setCompositeRenderStyle: function (composite) @@ -145304,15 +146534,15 @@ var World = new Class({ /** * Sets the debug render style for the given Matter Body. - * + * * If you are using this on a Phaser Game Object, such as a Matter Sprite, then pass in the body property * to this method, not the Game Object itself. - * + * * If you wish to skip a parameter, so it retains its current value, pass `false` for it. - * + * * If you wish to reset the Body render colors to the defaults found in the World Debug Config, then call * this method with just the `body` parameter provided and no others. - * + * * @method Phaser.Physics.Matter.World#setBodyRenderStyle * @since 3.22.0 * @@ -145322,7 +146552,7 @@ var World = new Class({ * @param {number} [lineThickness] - The line thickness. If `null` it will use the World Debug Config value. * @param {number} [fillColor] - The fill color. If `null` it will use the World Debug Config value. * @param {number} [fillOpacity] - The fill opacity, between 0 and 1. If `null` it will use the World Debug Config value. - * + * * @return {this} This Matter World instance for method chaining. */ setBodyRenderStyle: function (body, lineColor, lineOpacity, lineThickness, fillColor, fillOpacity) @@ -145390,15 +146620,15 @@ var World = new Class({ /** * Sets the debug render style for the given Matter Constraint. - * + * * If you are using this on a Phaser Game Object, then pass in the body property * to this method, not the Game Object itself. - * + * * If you wish to skip a parameter, so it retains its current value, pass `false` for it. - * + * * If you wish to reset the Constraint render colors to the defaults found in the World Debug Config, then call * this method with just the `constraint` parameter provided and no others. - * + * * @method Phaser.Physics.Matter.World#setConstraintRenderStyle * @since 3.22.0 * @@ -145409,7 +146639,7 @@ var World = new Class({ * @param {number} [pinSize] - If this constraint is a pin, this sets the size of the pin circle. If `null` it will use the World Debug Config value. * @param {number} [anchorColor] - The color used when rendering this constraints anchors. If `null` it will use the World Debug Config value. * @param {number} [anchorSize] - The size of the anchor circle, if this constraint has anchors. If `null` it will use the World Debug Config value. - * + * * @return {this} This Matter World instance for method chaining. */ setConstraintRenderStyle: function (constraint, lineColor, lineOpacity, lineThickness, pinSize, anchorColor, anchorSize) @@ -145524,12 +146754,12 @@ var World = new Class({ MatterEvents.on(world, 'beforeAdd', function (event) { var objects = [].concat(event.object); - + for (var i = 0; i < objects.length; i++) { var obj = objects[i]; var render = obj.render; - + if (obj.type === 'body') { _this.setBodyRenderStyle(obj, render.lineColor, render.lineOpacity, render.lineThickness, render.fillColor, render.fillOpacity); @@ -145709,12 +146939,12 @@ var World = new Class({ /** * Creates a Phaser.GameObjects.Graphics object that is used to render all of the debug bodies and joints to. - * + * * This method is called automatically by the constructor, if debugging has been enabled. - * + * * The created Graphics object is automatically added to the Scene at 0x0 and given a depth of `Number.MAX_VALUE`, * so it renders above all else in the Scene. - * + * * The Graphics object is assigned to the `debugGraphic` property of this class and `drawDebug` is enabled. * * @method Phaser.Physics.Matter.World#createDebugGraphic @@ -145754,7 +146984,7 @@ var World = new Class({ /** * Sets the worlds gravity to the values given. - * + * * Gravity effects all bodies in the world, unless they have the `ignoreGravity` flag set. * * @method Phaser.Physics.Matter.World#setGravity @@ -145807,9 +147037,9 @@ var World = new Class({ /** * Adds a Matter JS object, or array of objects, to the world. - * + * * The objects should be valid Matter JS entities, such as a Body, Composite or Constraint. - * + * * Triggers `beforeAdd` and `afterAdd` events. * * @method Phaser.Physics.Matter.World#add @@ -145828,9 +147058,9 @@ var World = new Class({ /** * Removes a Matter JS object, or array of objects, from the world. - * + * * The objects should be valid Matter JS entities, such as a Body, Composite or Constraint. - * + * * Triggers `beforeRemove` and `afterRemove` events. * * @method Phaser.Physics.Matter.World#remove @@ -145862,7 +147092,7 @@ var World = new Class({ /** * Removes a Matter JS constraint, or array of constraints, from the world. - * + * * Triggers `beforeRemove` and `afterRemove` events. * * @method Phaser.Physics.Matter.World#removeConstraint @@ -145882,7 +147112,7 @@ var World = new Class({ /** * Adds `MatterTileBody` instances for all the colliding tiles within the given tilemap layer. - * + * * Set the appropriate tiles in your layer to collide before calling this method! * * @method Phaser.Physics.Matter.World#convertTilemapLayer @@ -145962,7 +147192,7 @@ var World = new Class({ /** * Pauses this Matter World instance and sets `enabled` to `false`. - * + * * A paused world will not run any simulations for the duration it is paused. * * @method Phaser.Physics.Matter.World#pause @@ -146000,16 +147230,16 @@ var World = new Class({ /** * The internal update method. This is called automatically by the parent Scene. - * + * * Moves the simulation forward in time by delta ms. Uses `World.correction` value as an optional number that * specifies the time correction factor to apply to the update. This can help improve the accuracy of the * simulation in cases where delta is changing between updates. The value of correction is defined as `delta / lastDelta`, * i.e. the percentage change of delta over the last step. Therefore the value is always 1 (no correction) when * delta is constant (or when no correction is desired, which is the default). * See the paper on Time Corrected Verlet for more information. - * + * * Triggers `beforeUpdate` and `afterUpdate` events. Triggers `collisionStart`, `collisionActive` and `collisionEnd` events. - * + * * If the World is paused, `update` is still run, but exits early and does not update the Matter Engine. * * @method Phaser.Physics.Matter.World#update @@ -146046,7 +147276,7 @@ var World = new Class({ runner.deltaHistory.push(delta); runner.deltaHistory = runner.deltaHistory.slice(-runner.deltaSampleSize); delta = Math.min.apply(null, runner.deltaHistory); - + // limit delta delta = delta < runner.deltaMin ? runner.deltaMin : delta; delta = delta > runner.deltaMax ? runner.deltaMax : delta; @@ -146087,12 +147317,12 @@ var World = new Class({ /** * Manually advances the physics simulation by one iteration. - * + * * You can optionally pass in the `delta` and `correction` values to be used by Engine.update. * If undefined they use the Matter defaults of 60Hz and no correction. - * + * * Calling `step` directly bypasses any checks of `enabled` or `autoUpdate`. - * + * * It also ignores any custom `getDelta` functions, as you should be passing the delta * value in to this call. * @@ -146148,9 +147378,9 @@ var World = new Class({ * * @method Phaser.Physics.Matter.World#has * @since 3.22.0 - * + * * @param {(MatterJS.Body|Phaser.GameObjects.GameObject)} body - The Matter Body, or Game Object, to search for within the world. - * + * * @return {MatterJS.BodyType[]} An array of all the Matter JS Bodies in this World. */ has: function (body) @@ -146165,7 +147395,7 @@ var World = new Class({ * * @method Phaser.Physics.Matter.World#getAllBodies * @since 3.22.0 - * + * * @return {MatterJS.BodyType[]} An array of all the Matter JS Bodies in this World. */ getAllBodies: function () @@ -146178,7 +147408,7 @@ var World = new Class({ * * @method Phaser.Physics.Matter.World#getAllConstraints * @since 3.22.0 - * + * * @return {MatterJS.ConstraintType[]} An array of all the Matter JS Constraints in this World. */ getAllConstraints: function () @@ -146191,7 +147421,7 @@ var World = new Class({ * * @method Phaser.Physics.Matter.World#getAllComposites * @since 3.22.0 - * + * * @return {MatterJS.CompositeType[]} An array of all the Matter JS Composites in this World. */ getAllComposites: function () @@ -146201,7 +147431,7 @@ var World = new Class({ /** * Handles the rendering of bodies and debug information to the debug Graphics object, if enabled. - * + * * This method is called automatically by the Scene after all processing has taken place. * * @method Phaser.Physics.Matter.World#postUpdate @@ -146266,20 +147496,20 @@ var World = new Class({ /** * Renders the Engine Broadphase Controller Grid to the given Graphics instance. - * + * * The debug renderer calls this method if the `showBroadphase` config value is set. - * + * * This method is used internally by the Matter Debug Renderer, but is also exposed publically should * you wish to render the Grid to your own Graphics instance. - * + * * @method Phaser.Physics.Matter.World#renderGrid * @since 3.22.0 - * + * * @param {MatterJS.Grid} grid - The Matter Grid to be rendered. * @param {Phaser.GameObjects.Graphics} graphics - The Graphics object to render to. * @param {number} lineColor - The line color. * @param {number} lineOpacity - The line opacity, between 0 and 1. - * + * * @return {this} This Matter World instance for method chaining. */ renderGrid: function (grid, graphics, lineColor, lineOpacity) @@ -146312,19 +147542,19 @@ var World = new Class({ /** * Renders the list of Pair separations to the given Graphics instance. - * + * * The debug renderer calls this method if the `showSeparations` config value is set. - * + * * This method is used internally by the Matter Debug Renderer, but is also exposed publically should * you wish to render the Grid to your own Graphics instance. - * + * * @method Phaser.Physics.Matter.World#renderSeparations * @since 3.22.0 - * + * * @param {MatterJS.Pair[]} pairs - An array of Matter Pairs to be rendered. * @param {Phaser.GameObjects.Graphics} graphics - The Graphics object to render to. * @param {number} lineColor - The line color. - * + * * @return {this} This Matter World instance for method chaining. */ renderSeparations: function (pairs, graphics, lineColor) @@ -146348,7 +147578,7 @@ var World = new Class({ var penetration = collision.penetration; var k = (!bodyA.isStatic && !bodyB.isStatic) ? 4 : 1; - + if (bodyB.isStatic) { k = 0; @@ -146381,19 +147611,19 @@ var World = new Class({ /** * Renders the list of collision points and normals to the given Graphics instance. - * + * * The debug renderer calls this method if the `showCollisions` config value is set. - * + * * This method is used internally by the Matter Debug Renderer, but is also exposed publically should * you wish to render the Grid to your own Graphics instance. - * + * * @method Phaser.Physics.Matter.World#renderCollisions * @since 3.22.0 - * + * * @param {MatterJS.Pair[]} pairs - An array of Matter Pairs to be rendered. * @param {Phaser.GameObjects.Graphics} graphics - The Graphics object to render to. * @param {number} lineColor - The line color. - * + * * @return {this} This Matter World instance for method chaining. */ renderCollisions: function (pairs, graphics, lineColor) @@ -146475,17 +147705,17 @@ var World = new Class({ /** * Renders the bounds of an array of Bodies to the given Graphics instance. - * + * * If the body is a compound body, it will render the bounds for the parent compound. - * + * * The debug renderer calls this method if the `showBounds` config value is set. - * + * * This method is used internally by the Matter Debug Renderer, but is also exposed publically should * you wish to render bounds to your own Graphics instance. * * @method Phaser.Physics.Matter.World#renderBodyBounds * @since 3.22.0 - * + * * @param {array} bodies - An array of bodies from the localWorld. * @param {Phaser.GameObjects.Graphics} graphics - The Graphics object to render to. * @param {number} lineColor - The line color. @@ -146523,7 +147753,7 @@ var World = new Class({ for (var j = parts.length > 1 ? 1 : 0; j < parts.length; j++) { var part = parts[j]; - + graphics.strokeRect( part.bounds.min.x, part.bounds.min.y, @@ -146539,15 +147769,15 @@ var World = new Class({ /** * Renders either all axes, or a single axis indicator, for an array of Bodies, to the given Graphics instance. - * + * * The debug renderer calls this method if the `showAxes` or `showAngleIndicator` config values are set. - * + * * This method is used internally by the Matter Debug Renderer, but is also exposed publically should * you wish to render bounds to your own Graphics instance. * * @method Phaser.Physics.Matter.World#renderBodyAxes * @since 3.22.0 - * + * * @param {array} bodies - An array of bodies from the localWorld. * @param {Phaser.GameObjects.Graphics} graphics - The Graphics object to render to. * @param {boolean} showAxes - If `true` it will render all body axes. If `false` it will render a single axis indicator. @@ -146578,7 +147808,7 @@ var World = new Class({ for (j = parts.length > 1 ? 1 : 0; j < parts.length; j++) { part = parts[j]; - + for (k = 0; k < part.axes.length; k++) { var axis = part.axes[k]; @@ -146597,7 +147827,7 @@ var World = new Class({ for (j = parts.length > 1 ? 1 : 0; j < parts.length; j++) { part = parts[j]; - + for (k = 0; k < part.axes.length; k++) { graphics.lineBetween( @@ -146616,15 +147846,15 @@ var World = new Class({ /** * Renders a velocity indicator for an array of Bodies, to the given Graphics instance. - * + * * The debug renderer calls this method if the `showVelocity` config value is set. - * + * * This method is used internally by the Matter Debug Renderer, but is also exposed publically should * you wish to render bounds to your own Graphics instance. * * @method Phaser.Physics.Matter.World#renderBodyVelocity * @since 3.22.0 - * + * * @param {array} bodies - An array of bodies from the localWorld. * @param {Phaser.GameObjects.Graphics} graphics - The Graphics object to render to. * @param {number} lineColor - The line color. @@ -146658,13 +147888,13 @@ var World = new Class({ /** * Renders the given array of Bodies to the debug graphics instance. - * + * * Called automatically by the `postUpdate` method. * * @method Phaser.Physics.Matter.World#renderBodies * @private * @since 3.14.0 - * + * * @param {array} bodies - An array of bodies from the localWorld. */ renderBodies: function (bodies) @@ -146748,16 +147978,16 @@ var World = new Class({ /** * Renders a single Matter Body to the given Phaser Graphics Game Object. - * + * * This method is used internally by the Matter Debug Renderer, but is also exposed publically should * you wish to render a Body to your own Graphics instance. - * + * * If you don't wish to render a line around the body, set the `lineColor` parameter to `null`. * Equally, if you don't wish to render a fill, set the `fillColor` parameter to `null`. - * + * * @method Phaser.Physics.Matter.World#renderBody * @since 3.22.0 - * + * * @param {MatterJS.BodyType} body - The Matter Body to be rendered. * @param {Phaser.GameObjects.Graphics} graphics - The Graphics object to render to. * @param {boolean} showInternalEdges - Render internal edges of the polygon? @@ -146766,7 +147996,7 @@ var World = new Class({ * @param {number} [lineThickness=1] - The line thickness. * @param {number} [fillColor] - The fill color. * @param {number} [fillOpacity] - The fill opacity, between 0 and 1. - * + * * @return {this} This Matter World instance for method chaining. */ renderBody: function (body, graphics, showInternalEdges, lineColor, lineOpacity, lineThickness, fillColor, fillOpacity) @@ -146808,7 +148038,7 @@ var World = new Class({ { graphics.fillStyle(sensorFillColor, fillOpacity * opacity); } - + if (lineColor !== null) { graphics.lineStyle(lineThickness, sensorLineColor, lineOpacity * opacity); @@ -146820,7 +148050,7 @@ var World = new Class({ { graphics.fillStyle(fillColor, fillOpacity * opacity); } - + if (lineColor !== null) { graphics.lineStyle(lineThickness, lineColor, lineOpacity * opacity); @@ -146858,7 +148088,7 @@ var World = new Class({ graphics.moveTo(vertices[nextIndex].x, vertices[nextIndex].y); } } - + graphics.closePath(); } @@ -146888,18 +148118,18 @@ var World = new Class({ /** * Renders the Convex Hull for a single Matter Body to the given Phaser Graphics Game Object. - * + * * This method is used internally by the Matter Debug Renderer, but is also exposed publically should * you wish to render a Body hull to your own Graphics instance. - * + * * @method Phaser.Physics.Matter.World#renderConvexHull * @since 3.22.0 - * + * * @param {MatterJS.BodyType} body - The Matter Body to be rendered. * @param {Phaser.GameObjects.Graphics} graphics - The Graphics object to render to. * @param {number} hullColor - The color used to render the hull. * @param {number} [lineThickness=1] - The hull line thickness. - * + * * @return {this} This Matter World instance for method chaining. */ renderConvexHull: function (body, graphics, hullColor, lineThickness) @@ -146924,7 +148154,7 @@ var World = new Class({ { graphics.lineTo(verts[v].x, verts[v].y); } - + graphics.lineTo(verts[0].x, verts[0].y); graphics.strokePath(); @@ -146935,7 +148165,7 @@ var World = new Class({ /** * Renders all of the constraints in the world (unless they are specifically set to invisible). - * + * * Called automatically by the `postUpdate` method. * * @method Phaser.Physics.Matter.World#renderJoints @@ -146946,7 +148176,7 @@ var World = new Class({ { var graphics = this.debugGraphic; - // Render constraints + // Render constraints var constraints = Composite.allConstraints(this.localWorld); for (var i = 0; i < constraints.length; i++) @@ -146966,13 +148196,13 @@ var World = new Class({ /** * Renders a single Matter Constraint, such as a Pin or a Spring, to the given Phaser Graphics Game Object. - * + * * This method is used internally by the Matter Debug Renderer, but is also exposed publically should * you wish to render a Constraint to your own Graphics instance. - * + * * @method Phaser.Physics.Matter.World#renderConstraint * @since 3.22.0 - * + * * @param {MatterJS.ConstraintType} constraint - The Matter Constraint to render. * @param {Phaser.GameObjects.Graphics} graphics - The Graphics object to render to. * @param {number} lineColor - The line color. @@ -146981,7 +148211,7 @@ var World = new Class({ * @param {number} pinSize - If this constraint is a pin, this sets the size of the pin circle. * @param {number} anchorColor - The color used when rendering this constraints anchors. Set to `null` to not render anchors. * @param {number} anchorSize - The size of the anchor circle, if this constraint has anchors and is rendering them. - * + * * @return {this} This Matter World instance for method chaining. */ renderConstraint: function (constraint, graphics, lineColor, lineOpacity, lineThickness, pinSize, anchorColor, anchorSize) @@ -147062,7 +148292,7 @@ var World = new Class({ /** * Resets the internal collision IDs that Matter.JS uses for Body collision groups. - * + * * You should call this before destroying your game if you need to restart the game * again on the same page, without first reloading the page. Or, if you wish to * consistently destroy a Scene that contains Matter.js and then run it again @@ -147129,7 +148359,7 @@ module.exports = World; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -147170,7 +148400,7 @@ module.exports = Bounce; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -147256,7 +148486,7 @@ var Collision = { /** * The callback is sent a `Phaser.Types.Physics.Matter.MatterCollisionData` object. - * + * * This does not change the bodies collision category, group or filter. Those must be set in addition * to the callback. * @@ -147276,7 +148506,7 @@ var Collision = { /** * The callback is sent a `Phaser.Types.Physics.Matter.MatterCollisionData` object. - * + * * This does not change the bodies collision category, group or filter. Those must be set in addition * to the callback. * @@ -147296,7 +148526,7 @@ var Collision = { /** * The callback is sent a `Phaser.Types.Physics.Matter.MatterCollisionData` object. - * + * * This does not change the bodies collision category, group or filter. Those must be set in addition * to the callback. * @@ -147316,7 +148546,7 @@ var Collision = { /** * The callback is sent a reference to the other body, along with a `Phaser.Types.Physics.Matter.MatterCollisionData` object. - * + * * This does not change the bodies collision category, group or filter. Those must be set in addition * to the callback. * @@ -147357,7 +148587,7 @@ module.exports = Collision; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -147412,7 +148642,7 @@ var Force = { /** * Apply thrust to the forward position of the body. - * + * * Use very small values, such as 0.1, depending on the mass and required speed. * * @method Phaser.Physics.Matter.Components.Force#thrust @@ -147435,7 +148665,7 @@ var Force = { /** * Apply thrust to the left position of the body. - * + * * Use very small values, such as 0.1, depending on the mass and required speed. * * @method Phaser.Physics.Matter.Components.Force#thrustLeft @@ -147458,7 +148688,7 @@ var Force = { /** * Apply thrust to the right position of the body. - * + * * Use very small values, such as 0.1, depending on the mass and required speed. * * @method Phaser.Physics.Matter.Components.Force#thrustRight @@ -147481,7 +148711,7 @@ var Force = { /** * Apply thrust to the back position of the body. - * + * * Use very small values, such as 0.1, depending on the mass and required speed. * * @method Phaser.Physics.Matter.Components.Force#thrustBack @@ -147514,7 +148744,7 @@ module.exports = Force; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -147605,7 +148835,7 @@ module.exports = Friction; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -147646,7 +148876,7 @@ module.exports = Gravity; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -147697,9 +148927,9 @@ var Mass = { /** * The body's center of mass. - * + * * Calling this creates a new `Vector2 each time to avoid mutation. - * + * * If you only need to read the value and won't change it, you can get it from `GameObject.body.centerOfMass`. * * @name Phaser.Physics.Matter.Components.Mass#centerOfMass @@ -147729,7 +148959,7 @@ module.exports = Mass; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -147784,7 +149014,7 @@ module.exports = Sensor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -147806,7 +149036,7 @@ var SetBody = { /** * Set the body on a Game Object to a rectangle. - * + * * Calling this methods resets previous properties you may have set on the body, including * plugins, mass, friction, etc. So be sure to re-apply these in the options object if needed. * @@ -147826,7 +149056,7 @@ var SetBody = { /** * Set the body on a Game Object to a circle. - * + * * Calling this methods resets previous properties you may have set on the body, including * plugins, mass, friction, etc. So be sure to re-apply these in the options object if needed. * @@ -147845,7 +149075,7 @@ var SetBody = { /** * Set the body on the Game Object to a polygon shape. - * + * * Calling this methods resets previous properties you may have set on the body, including * plugins, mass, friction, etc. So be sure to re-apply these in the options object if needed. * @@ -147865,7 +149095,7 @@ var SetBody = { /** * Set the body on the Game Object to a trapezoid shape. - * + * * Calling this methods resets previous properties you may have set on the body, including * plugins, mass, friction, etc. So be sure to re-apply these in the options object if needed. * @@ -147886,7 +149116,7 @@ var SetBody = { /** * Set this Game Object to use the given existing Matter Body. - * + * * The body is first removed from the world before being added to this Game Object. * * @method Phaser.Physics.Matter.Components.SetBody#setExistingBody @@ -147958,7 +149188,7 @@ var SetBody = { /** * Set this Game Object to create and use a new Body based on the configuration object given. - * + * * Calling this method resets previous properties you may have set on the body, including * plugins, mass, friction, etc. So be sure to re-apply these in the options object if needed. * @@ -148039,7 +149269,7 @@ var SetBody = { var flagInternal = GetFastValue(config, 'flagInternal', false); var removeCollinear = GetFastValue(config, 'removeCollinear', 0.01); var minimumArea = GetFastValue(config, 'minimumArea', 10); - + body = Bodies.fromVertices(bodyX, bodyY, verts, options, flagInternal, removeCollinear, minimumArea); } } @@ -148075,7 +149305,7 @@ module.exports = SetBody; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -148234,7 +149464,7 @@ module.exports = Sleep; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -148290,7 +149520,7 @@ module.exports = Static; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -148376,7 +149606,7 @@ var Transform = { { var factorX = 1 / this._scaleX; var factorY = 1 / this._scaleY; - + this._scaleX = value; if (this._scaleX === 0) @@ -148606,7 +149836,7 @@ module.exports = Transform; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -148708,7 +149938,7 @@ module.exports = Velocity; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -148741,7 +149971,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -148755,15 +149985,15 @@ module.exports = { /** * The Matter Physics After Add Event. - * + * * This event is dispatched by a Matter Physics World instance at the end of the process when a new Body * or Constraint has just been added to the world. - * + * * Listen to it from a Scene using: `this.matter.world.on('afteradd', listener)`. * * @event Phaser.Physics.Matter.Events#AFTER_ADD * @since 3.22.0 - * + * * @param {Phaser.Physics.Matter.Events.AfterAddEvent} event - The Add Event object. */ module.exports = 'afteradd'; @@ -148776,7 +150006,7 @@ module.exports = 'afteradd'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -148790,15 +150020,15 @@ module.exports = 'afteradd'; /** * The Matter Physics After Remove Event. - * - * This event is dispatched by a Matter Physics World instance at the end of the process when a + * + * This event is dispatched by a Matter Physics World instance at the end of the process when a * Body or Constraint was removed from the world. - * + * * Listen to it from a Scene using: `this.matter.world.on('afterremove', listener)`. * * @event Phaser.Physics.Matter.Events#AFTER_REMOVE * @since 3.22.0 - * + * * @param {Phaser.Physics.Matter.Events.AfterRemoveEvent} event - The Remove Event object. */ module.exports = 'afterremove'; @@ -148811,7 +150041,7 @@ module.exports = 'afterremove'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -148825,14 +150055,14 @@ module.exports = 'afterremove'; /** * The Matter Physics After Update Event. - * + * * This event is dispatched by a Matter Physics World instance after the engine has updated and all collision events have resolved. - * + * * Listen to it from a Scene using: `this.matter.world.on('afterupdate', listener)`. * * @event Phaser.Physics.Matter.Events#AFTER_UPDATE * @since 3.0.0 - * + * * @param {Phaser.Physics.Matter.Events.AfterUpdateEvent} event - The Update Event object. */ module.exports = 'afterupdate'; @@ -148845,7 +150075,7 @@ module.exports = 'afterupdate'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -148859,15 +150089,15 @@ module.exports = 'afterupdate'; /** * The Matter Physics Before Add Event. - * + * * This event is dispatched by a Matter Physics World instance at the start of the process when a new Body * or Constraint is being added to the world. - * + * * Listen to it from a Scene using: `this.matter.world.on('beforeadd', listener)`. * * @event Phaser.Physics.Matter.Events#BEFORE_ADD * @since 3.22.0 - * + * * @param {Phaser.Physics.Matter.Events.BeforeAddEvent} event - The Add Event object. */ module.exports = 'beforeadd'; @@ -148880,7 +150110,7 @@ module.exports = 'beforeadd'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -148894,15 +150124,15 @@ module.exports = 'beforeadd'; /** * The Matter Physics Before Remove Event. - * - * This event is dispatched by a Matter Physics World instance at the start of the process when a + * + * This event is dispatched by a Matter Physics World instance at the start of the process when a * Body or Constraint is being removed from the world. - * + * * Listen to it from a Scene using: `this.matter.world.on('beforeremove', listener)`. * * @event Phaser.Physics.Matter.Events#BEFORE_REMOVE * @since 3.22.0 - * + * * @param {Phaser.Physics.Matter.Events.BeforeRemoveEvent} event - The Remove Event object. */ module.exports = 'beforeremove'; @@ -148915,7 +150145,7 @@ module.exports = 'beforeremove'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -148929,14 +150159,14 @@ module.exports = 'beforeremove'; /** * The Matter Physics Before Update Event. - * + * * This event is dispatched by a Matter Physics World instance right before all the collision processing takes place. - * + * * Listen to it from a Scene using: `this.matter.world.on('beforeupdate', listener)`. * * @event Phaser.Physics.Matter.Events#BEFORE_UPDATE * @since 3.0.0 - * + * * @param {Phaser.Physics.Matter.Events.BeforeUpdateEvent} event - The Update Event object. */ module.exports = 'beforeupdate'; @@ -148949,7 +150179,7 @@ module.exports = 'beforeupdate'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -148964,15 +150194,15 @@ module.exports = 'beforeupdate'; /** * The Matter Physics Collision Active Event. - * + * * This event is dispatched by a Matter Physics World instance after the engine has updated. * It provides a list of all pairs that are colliding in the current tick (if any). - * + * * Listen to it from a Scene using: `this.matter.world.on('collisionactive', listener)`. * * @event Phaser.Physics.Matter.Events#COLLISION_ACTIVE * @since 3.0.0 - * + * * @param {Phaser.Physics.Matter.Events.CollisionActiveEvent} event - The Collision Event object. * @param {MatterJS.BodyType} bodyA - The first body of the first colliding pair. The `event.pairs` array may contain more colliding bodies. * @param {MatterJS.BodyType} bodyB - The second body of the first colliding pair. The `event.pairs` array may contain more colliding bodies. @@ -148987,7 +150217,7 @@ module.exports = 'collisionactive'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -149002,15 +150232,15 @@ module.exports = 'collisionactive'; /** * The Matter Physics Collision End Event. - * + * * This event is dispatched by a Matter Physics World instance after the engine has updated. * It provides a list of all pairs that have finished colliding in the current tick (if any). - * + * * Listen to it from a Scene using: `this.matter.world.on('collisionend', listener)`. * * @event Phaser.Physics.Matter.Events#COLLISION_END * @since 3.0.0 - * + * * @param {Phaser.Physics.Matter.Events.CollisionEndEvent} event - The Collision Event object. * @param {MatterJS.BodyType} bodyA - The first body of the first colliding pair. The `event.pairs` array may contain more colliding bodies. * @param {MatterJS.BodyType} bodyB - The second body of the first colliding pair. The `event.pairs` array may contain more colliding bodies. @@ -149025,7 +150255,7 @@ module.exports = 'collisionend'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -149040,15 +150270,15 @@ module.exports = 'collisionend'; /** * The Matter Physics Collision Start Event. - * + * * This event is dispatched by a Matter Physics World instance after the engine has updated. * It provides a list of all pairs that have started to collide in the current tick (if any). - * + * * Listen to it from a Scene using: `this.matter.world.on('collisionstart', listener)`. * * @event Phaser.Physics.Matter.Events#COLLISION_START * @since 3.0.0 - * + * * @param {Phaser.Physics.Matter.Events.CollisionStartEvent} event - The Collision Event object. * @param {MatterJS.BodyType} bodyA - The first body of the first colliding pair. The `event.pairs` array may contain more colliding bodies. * @param {MatterJS.BodyType} bodyB - The second body of the first colliding pair. The `event.pairs` array may contain more colliding bodies. @@ -149063,21 +150293,21 @@ module.exports = 'collisionstart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Matter Physics Drag End Event. - * + * * This event is dispatched by a Matter Physics World instance when a Pointer Constraint * stops dragging a body. - * + * * Listen to it from a Scene using: `this.matter.world.on('dragend', listener)`. * * @event Phaser.Physics.Matter.Events#DRAG_END * @since 3.16.2 - * + * * @param {MatterJS.BodyType} body - The Body that has stopped being dragged. This is a Matter Body, not a Phaser Game Object. * @param {Phaser.Physics.Matter.PointerConstraint} constraint - The Pointer Constraint that was dragging the body. */ @@ -149091,21 +150321,21 @@ module.exports = 'dragend'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Matter Physics Drag Event. - * + * * This event is dispatched by a Matter Physics World instance when a Pointer Constraint * is actively dragging a body. It is emitted each time the pointer moves. - * + * * Listen to it from a Scene using: `this.matter.world.on('drag', listener)`. * * @event Phaser.Physics.Matter.Events#DRAG * @since 3.16.2 - * + * * @param {MatterJS.BodyType} body - The Body that is being dragged. This is a Matter Body, not a Phaser Game Object. * @param {Phaser.Physics.Matter.PointerConstraint} constraint - The Pointer Constraint that is dragging the body. */ @@ -149119,21 +150349,21 @@ module.exports = 'drag'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Matter Physics Drag Start Event. - * + * * This event is dispatched by a Matter Physics World instance when a Pointer Constraint * starts dragging a body. - * + * * Listen to it from a Scene using: `this.matter.world.on('dragstart', listener)`. * * @event Phaser.Physics.Matter.Events#DRAG_START * @since 3.16.2 - * + * * @param {MatterJS.BodyType} body - The Body that has started being dragged. This is a Matter Body, not a Phaser Game Object. * @param {MatterJS.BodyType} part - The part of the body that was clicked on. * @param {Phaser.Physics.Matter.PointerConstraint} constraint - The Pointer Constraint that is dragging the body. @@ -149148,15 +150378,15 @@ module.exports = 'dragstart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Matter Physics World Pause Event. - * + * * This event is dispatched by an Matter Physics World instance when it is paused. - * + * * Listen to it from a Scene using: `this.matter.world.on('pause', listener)`. * * @event Phaser.Physics.Matter.Events#PAUSE @@ -149172,15 +150402,15 @@ module.exports = 'pause'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Matter Physics World Resume Event. - * + * * This event is dispatched by an Matter Physics World instance when it resumes from a paused state. - * + * * Listen to it from a Scene using: `this.matter.world.on('resume', listener)`. * * @event Phaser.Physics.Matter.Events#RESUME @@ -149196,7 +150426,7 @@ module.exports = 'resume'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -149209,14 +150439,14 @@ module.exports = 'resume'; /** * The Matter Physics Sleep End Event. - * + * * This event is dispatched by a Matter Physics World instance when a Body stop sleeping. - * + * * Listen to it from a Scene using: `this.matter.world.on('sleepend', listener)`. * * @event Phaser.Physics.Matter.Events#SLEEP_END * @since 3.0.0 - * + * * @param {Phaser.Physics.Matter.Events.SleepEndEvent} event - The Sleep Event object. * @param {MatterJS.BodyType} body - The body that has stopped sleeping. */ @@ -149230,7 +150460,7 @@ module.exports = 'sleepend'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -149243,14 +150473,14 @@ module.exports = 'sleepend'; /** * The Matter Physics Sleep Start Event. - * + * * This event is dispatched by a Matter Physics World instance when a Body goes to sleep. - * + * * Listen to it from a Scene using: `this.matter.world.on('sleepstart', listener)`. * * @event Phaser.Physics.Matter.Events#SLEEP_START * @since 3.0.0 - * + * * @param {Phaser.Physics.Matter.Events.SleepStartEvent} event - The Sleep Event object. * @param {MatterJS.BodyType} body - The body that has gone to sleep. */ @@ -149264,7 +150494,7 @@ module.exports = 'sleepstart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -149301,7 +150531,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -149384,7 +150614,6 @@ var Axes = __webpack_require__(50658); force: { x: 0, y: 0 }, torque: 0, positionImpulse: { x: 0, y: 0 }, - previousPositionImpulse: { x: 0, y: 0 }, constraintImpulse: { x: 0, y: 0, angle: 0 }, totalContacts: 0, speed: 0, @@ -149545,13 +150774,13 @@ var Axes = __webpack_require__(50658); { var centerOfMass = body.centerOfMass; var centerOffset = body.centerOffset; - + var bodyWidth = bounds.max.x - bounds.min.x; var bodyHeight = bounds.max.y - bounds.min.y; - + centerOfMass.x = -(bounds.min.x - body.position.x) / bodyWidth; centerOfMass.y = -(bounds.min.y - body.position.y) / bodyHeight; - + centerOffset.x = bodyWidth * centerOfMass.x; centerOffset.y = bodyHeight * centerOfMass.y; } @@ -149699,7 +150928,7 @@ var Axes = __webpack_require__(50658); }; /** - * Sets the moment of inertia (i.e. second moment of area) of the body. + * Sets the moment of inertia (i.e. second moment of area) of the body. * Inverse inertia is automatically updated to reflect the change. Mass is not changed. * @method setInertia * @param {body} body @@ -149828,7 +151057,7 @@ var Axes = __webpack_require__(50658); }; /** - * Set the centre of mass of the body. + * Set the centre of mass of the body. * The `centre` is a vector in world-space unless `relative` is set, in which case it is a translation. * The centre of mass is the point the body rotates about and can be used to simulate non-uniform density. * This is equal to moving `body.position` but not the `body.vertices`. @@ -149945,7 +151174,7 @@ var Axes = __webpack_require__(50658); sin = Math.sin(rotation), dx = body.position.x - point.x, dy = body.position.y - point.y; - + Body.setPosition(body, { x: point.x + (dx * cos - dy * sin), y: point.y + (dx * sin + dy * cos) @@ -150012,7 +151241,7 @@ var Axes = __webpack_require__(50658); } // handle circles - if (body.circleRadius) { + if (body.circleRadius) { if (scaleX === scaleY) { body.circleRadius *= scaleX; } else { @@ -150061,7 +151290,7 @@ var Axes = __webpack_require__(50658); var part = body.parts[i]; Vertices.translate(part.vertices, body.velocity); - + if (i > 0) { part.position.x += body.velocity.x; part.position.y += body.velocity.y; @@ -150185,7 +151414,7 @@ var Axes = __webpack_require__(50658); */ /** - * An array of bodies that make up this body. + * An array of bodies that make up this body. * The first body in the array must always be a self reference to the current body instance. * All bodies in the `parts` array together form a single rigid compound body. * Parts are allowed to overlap, have gaps or holes or even form concave bodies. @@ -150227,7 +151456,7 @@ var Axes = __webpack_require__(50658); * [{ x: 0, y: 0 }, { x: 25, y: 50 }, { x: 50, y: 0 }] * * When passed via `Body.create`, the vertices are translated relative to `body.position` (i.e. world-space, and constantly updated by `Body.update` during simulation). - * The `Vector` objects are also augmented with additional properties required for efficient collision detection. + * The `Vector` objects are also augmented with additional properties required for efficient collision detection. * * Other properties such as `inertia` and `bounds` are automatically calculated from the passed vertices (unless provided via `options`). * Concave hulls are not currently supported. The module `Matter.Vertices` contains useful methods for working with vertices. @@ -150287,7 +151516,7 @@ var Axes = __webpack_require__(50658); */ /** - * A `Vector` that _measures_ the current velocity of the body after the last `Body.update`. It is read-only. + * A `Vector` that _measures_ the current velocity of the body after the last `Body.update`. It is read-only. * If you need to modify a body's velocity directly, you should either apply a force or simply change the body's `position` (as the engine uses position-Verlet integration). * * @readOnly @@ -150297,7 +151526,7 @@ var Axes = __webpack_require__(50658); */ /** - * A `Number` that _measures_ the current angular velocity of the body after the last `Body.update`. It is read-only. + * A `Number` that _measures_ the current angular velocity of the body after the last `Body.update`. It is read-only. * If you need to modify a body's angular velocity directly, you should apply a torque or simply change the body's `angle` (as the engine uses position-Verlet integration). * * @readOnly @@ -150395,7 +151624,7 @@ var Axes = __webpack_require__(50658); /** * A `Number` that defines the restitution (elasticity) of the body. The value is always positive and is in the range `(0, 1)`. - * A value of `0` means collisions may be perfectly inelastic and no bouncing may occur. + * A value of `0` means collisions may be perfectly inelastic and no bouncing may occur. * A value of `0.8` means the body may bounce back with approximately 80% of its kinetic energy. * Note that collision response is based on _pairs_ of bodies, and that `restitution` values are _combined_ with the following formula: * @@ -150411,7 +151640,7 @@ var Axes = __webpack_require__(50658); * A value of `0` means that the body may slide indefinitely. * A value of `1` means the body may come to a stop almost instantly after a force is applied. * - * The effects of the value may be non-linear. + * The effects of the value may be non-linear. * High values may be unstable depending on the body. * The engine uses a Coulomb friction model including static and kinetic friction. * Note that collision response is based on _pairs_ of bodies, and that `friction` values are _combined_ with the following formula: @@ -150424,7 +151653,7 @@ var Axes = __webpack_require__(50658); */ /** - * A `Number` that defines the static friction of the body (in the Coulomb friction model). + * A `Number` that defines the static friction of the body (in the Coulomb friction model). * A value of `0` means the body will never 'stick' when it is nearly stationary and only dynamic `friction` is used. * The higher the value (e.g. `10`), the more force it will take to initially get the body moving when nearly stationary. * This value is multiplied with the `friction` property to make it easier to change `friction` and maintain an appropriate amount of static friction. @@ -150435,10 +151664,10 @@ var Axes = __webpack_require__(50658); */ /** - * A `Number` that defines the air friction of the body (air resistance). + * A `Number` that defines the air friction of the body (air resistance). * A value of `0` means the body will never slow as it moves through space. * The higher the value, the faster a body slows when moving through space. - * The effects of the value are non-linear. + * The effects of the value are non-linear. * * @property frictionAir * @type number @@ -150607,13 +151836,13 @@ var Axes = __webpack_require__(50658); * @property axes * @type vector[] */ - + /** * A `Number` that _measures_ the area of the body's convex hull, calculated at creation by `Body.create`. * * @property area * @type string - * @default + * @default */ /** @@ -150674,7 +151903,7 @@ var Axes = __webpack_require__(50658); /** * A callback that is invoked when this Body starts colliding with any other Body. - * + * * You can register callbacks by providing a function of type `( pair: Matter.Pair) => void`. * * @property onCollideCallback @@ -150684,7 +151913,7 @@ var Axes = __webpack_require__(50658); /** * A callback that is invoked when this Body stops colliding with any other Body. - * + * * You can register callbacks by providing a function of type `( pair: Matter.Pair) => void`. * * @property onCollideEndCallback @@ -150694,7 +151923,7 @@ var Axes = __webpack_require__(50658); /** * A callback that is invoked for the duration that this Body is colliding with any other Body. - * + * * You can register callbacks by providing a function of type `( pair: Matter.Pair) => void`. * * @property onCollideActiveCallback @@ -150757,7 +151986,12 @@ var Body = __webpack_require__(84125); constraints: [], composites: [], label: 'Composite', - plugin: {} + plugin: {}, + cache: { + allBodies: null, + allConstraints: null, + allComposites: null + } }, options); }; @@ -150777,12 +152011,18 @@ var Body = __webpack_require__(84125); composite.isModified = isModified; + if (isModified && composite.cache) { + composite.cache.allBodies = null; + composite.cache.allConstraints = null; + composite.cache.allComposites = null; + } + if (updateParents && composite.parent) { Composite.setModified(composite.parent, isModified, updateParents, updateChildren); } if (updateChildren) { - for(var i = 0; i < composite.composites.length; i++) { + for (var i = 0; i < composite.composites.length; i++) { var childComposite = composite.composites[i]; Composite.setModified(childComposite, isModified, updateParents, updateChildren); } @@ -150790,11 +152030,11 @@ var Body = __webpack_require__(84125); }; /** - * Generic add function. Adds one or many body(s), constraint(s) or a composite(s) to the given composite. + * Generic single or multi-add function. Adds a single or an array of body(s), constraint(s) or composite(s) to the given composite. * Triggers `beforeAdd` and `afterAdd` events on the `composite`. * @method add * @param {composite} composite - * @param {} object + * @param {object|array} object A single or an array of body(s), constraint(s) or composite(s) * @return {composite} The original composite with the objects added */ Composite.add = function(composite, object) { @@ -150840,7 +152080,7 @@ var Body = __webpack_require__(84125); * Triggers `beforeRemove` and `afterRemove` events on the `composite`. * @method remove * @param {composite} composite - * @param {} object + * @param {object|array} object * @param {boolean} [deep=false] * @return {composite} The original composite with the objects removed */ @@ -150900,10 +152140,9 @@ var Body = __webpack_require__(84125); * @return {composite} The original compositeA with the composite removed */ Composite.removeComposite = function(compositeA, compositeB, deep) { - var position = compositeA.composites.indexOf(compositeB); + var position = Common.indexOf(compositeA.composites, compositeB); if (position !== -1) { Composite.removeCompositeAt(compositeA, position); - Composite.setModified(compositeA, true, true, false); } if (deep) { @@ -150953,10 +152192,9 @@ var Body = __webpack_require__(84125); * @return {composite} The original composite with the body removed */ Composite.removeBody = function(composite, body, deep) { - var position = composite.bodies.indexOf(body); + var position = Common.indexOf(composite.bodies, body); if (position !== -1) { Composite.removeBodyAt(composite, position); - Composite.setModified(composite, true, true, false); } if (deep) { @@ -151006,7 +152244,7 @@ var Body = __webpack_require__(84125); * @return {composite} The original composite with the constraint removed */ Composite.removeConstraint = function(composite, constraint, deep) { - var position = composite.constraints.indexOf(constraint); + var position = Common.indexOf(composite.constraints, constraint); if (position !== -1) { Composite.removeConstraintAt(composite, position); } @@ -151057,6 +152295,7 @@ var Body = __webpack_require__(84125); composite.constraints.length = 0; composite.composites.length = 0; + Composite.setModified(composite, true, true, false); return composite; @@ -151069,11 +152308,19 @@ var Body = __webpack_require__(84125); * @return {body[]} All the bodies */ Composite.allBodies = function(composite) { + if (composite.cache && composite.cache.allBodies) { + return composite.cache.allBodies; + } + var bodies = [].concat(composite.bodies); for (var i = 0; i < composite.composites.length; i++) bodies = bodies.concat(Composite.allBodies(composite.composites[i])); + if (composite.cache) { + composite.cache.allBodies = bodies; + } + return bodies; }; @@ -151084,11 +152331,19 @@ var Body = __webpack_require__(84125); * @return {constraint[]} All the constraints */ Composite.allConstraints = function(composite) { + if (composite.cache && composite.cache.allConstraints) { + return composite.cache.allConstraints; + } + var constraints = [].concat(composite.constraints); for (var i = 0; i < composite.composites.length; i++) constraints = constraints.concat(Composite.allConstraints(composite.composites[i])); + if (composite.cache) { + composite.cache.allConstraints = constraints; + } + return constraints; }; @@ -151099,11 +152354,19 @@ var Body = __webpack_require__(84125); * @return {composite[]} All the composites */ Composite.allComposites = function(composite) { + if (composite.cache && composite.cache.allComposites) { + return composite.cache.allComposites; + } + var composites = [].concat(composite.composites); for (var i = 0; i < composite.composites.length; i++) composites = composites.concat(Composite.allComposites(composite.composites[i])); + if (composite.cache) { + composite.cache.allComposites = composites; + } + return composites; }; @@ -151170,8 +152433,6 @@ var Body = __webpack_require__(84125); objects[i].id = Common.nextId(); } - Composite.setModified(composite, true, true, false); - return composite; }; @@ -151190,8 +152451,6 @@ var Body = __webpack_require__(84125); Body.translate(bodies[i], translation); } - Composite.setModified(composite, true, true, false); - return composite; }; @@ -151221,8 +152480,6 @@ var Body = __webpack_require__(84125); Body.rotate(body, rotation); } - Composite.setModified(composite, true, true, false); - return composite; }; @@ -151251,8 +152508,6 @@ var Body = __webpack_require__(84125); Body.scale(body, scaleX, scaleY); } - Composite.setModified(composite, true, true, false); - return composite; }; @@ -151405,6 +152660,15 @@ var Body = __webpack_require__(84125); * @type {} */ + /** + * An object used for storing cached results for performance reasons. + * This is used internally only and is automatically managed. + * + * @private + * @property cache + * @type {} + */ + })(); @@ -151414,13 +152678,15 @@ var Body = __webpack_require__(84125); /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** -* The `Matter.World` module contains methods for creating and manipulating the world composite. -* A `Matter.World` is a `Matter.Composite` body, which is a collection of `Matter.Body`, `Matter.Constraint` and other `Matter.Composite`. -* A `Matter.World` has a few additional properties including `gravity` and `bounds`. -* It is important to use the functions in the `Matter.Composite` module to modify the world composite, rather than directly modifying its properties. -* There are also a few methods here that alias those in `Matter.Composite` for easier readability. +* This module has now been replaced by `Matter.Composite`. * -* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples). +* All usage should be migrated to the equivalent functions found on `Matter.Composite`. +* For example `World.add(world, body)` now becomes `Composite.add(world, body)`. +* +* The property `world.gravity` has been moved to `engine.gravity`. +* +* For back-compatibility purposes this module will remain as a direct alias to `Matter.Composite` in the short term during migration. +* Eventually this alias module will be marked as deprecated and then later removed in a future release. * * @class World * @extends Composite @@ -151431,37 +152697,19 @@ var World = {}; module.exports = World; var Composite = __webpack_require__(11299); -var Constraint = __webpack_require__(52838); -var Common = __webpack_require__(68758); (function() { /** - * Creates a new world composite. The options parameter is an object that specifies any properties you wish to override the defaults. - * See the properties section below for detailed information on what you can pass via the `options` object. - * @method create - * @constructor - * @param {} options - * @return {world} A new world + * See above, aliases for back compatibility only */ - World.create = function(options) { - var composite = Composite.create(); - - var defaults = { - label: 'World', - gravity: { - x: 0, - y: 1, - scale: 0.001 - }, - bounds: { - min: { x: -Infinity, y: -Infinity }, - max: { x: Infinity, y: Infinity } - } - }; - - return Common.extend(composite, defaults, options); - }; + World.create = Composite.create; + World.add = Composite.add; + World.remove = Composite.remove; + World.clear = Composite.clear; + World.addComposite = Composite.addComposite; + World.addBody = Composite.addBody; + World.addConstraint = Composite.addConstraint; /* * @@ -151510,7 +152758,7 @@ var Common = __webpack_require__(68758); // World is a Composite body // see src/module/Outro.js for these aliases: - + /** * An alias for Composite.add * @method add @@ -151542,7 +152790,7 @@ var Common = __webpack_require__(68758); * @param {composite} composite * @return {world} The original world with the objects from composite added */ - + /** * An alias for Composite.addBody * @method addBody @@ -151562,92 +152810,589 @@ var Common = __webpack_require__(68758); })(); +/***/ }), + +/***/ 63454: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** +* The `Matter.Collision` module contains methods for detecting collisions between a given pair of bodies. +* +* For efficient detection between a list of bodies, see `Matter.Detector` and `Matter.Query`. +* +* See `Matter.Engine` for collision events. +* +* @class Collision +*/ + +var Collision = {}; + +module.exports = Collision; + +var Vertices = __webpack_require__(39745); +var Pair = __webpack_require__(70584); + +(function() { + var _supports = []; + + var _overlapAB = { + overlap: 0, + axis: null + }; + + var _overlapBA = { + overlap: 0, + axis: null + }; + + /** + * Creates a new collision record. + * @method create + * @param {body} bodyA The first body part represented by the collision record + * @param {body} bodyB The second body part represented by the collision record + * @return {collision} A new collision record + */ + Collision.create = function(bodyA, bodyB) { + return { + pair: null, + collided: false, + bodyA: bodyA, + bodyB: bodyB, + parentA: bodyA.parent, + parentB: bodyB.parent, + depth: 0, + normal: { x: 0, y: 0 }, + tangent: { x: 0, y: 0 }, + penetration: { x: 0, y: 0 }, + supports: [] + }; + }; + + /** + * Detect collision between two bodies. + * @method collides + * @param {body} bodyA + * @param {body} bodyB + * @param {pairs} [pairs] Optionally reuse collision records from existing pairs. + * @return {collision|null} A collision record if detected, otherwise null + */ + Collision.collides = function(bodyA, bodyB, pairs) { + Collision._overlapAxes(_overlapAB, bodyA.vertices, bodyB.vertices, bodyA.axes); + + if (_overlapAB.overlap <= 0) { + return null; + } + + Collision._overlapAxes(_overlapBA, bodyB.vertices, bodyA.vertices, bodyB.axes); + + if (_overlapBA.overlap <= 0) { + return null; + } + + // reuse collision records for gc efficiency + var pair = pairs && pairs.table[Pair.id(bodyA, bodyB)], + collision; + + if (!pair) { + collision = Collision.create(bodyA, bodyB); + collision.collided = true; + collision.bodyA = bodyA.id < bodyB.id ? bodyA : bodyB; + collision.bodyB = bodyA.id < bodyB.id ? bodyB : bodyA; + collision.parentA = collision.bodyA.parent; + collision.parentB = collision.bodyB.parent; + } else { + collision = pair.collision; + } + + bodyA = collision.bodyA; + bodyB = collision.bodyB; + + var minOverlap; + + if (_overlapAB.overlap < _overlapBA.overlap) { + minOverlap = _overlapAB; + } else { + minOverlap = _overlapBA; + } + + var normal = collision.normal, + supports = collision.supports, + minAxis = minOverlap.axis, + minAxisX = minAxis.x, + minAxisY = minAxis.y; + + // ensure normal is facing away from bodyA + if (minAxisX * (bodyB.position.x - bodyA.position.x) + minAxisY * (bodyB.position.y - bodyA.position.y) < 0) { + normal.x = minAxisX; + normal.y = minAxisY; + } else { + normal.x = -minAxisX; + normal.y = -minAxisY; + } + + collision.tangent.x = -normal.y; + collision.tangent.y = normal.x; + + collision.depth = minOverlap.overlap; + + collision.penetration.x = normal.x * collision.depth; + collision.penetration.y = normal.y * collision.depth; + + // find support points, there is always either exactly one or two + var supportsB = Collision._findSupports(bodyA, bodyB, normal, 1), + supportCount = 0; + + // find the supports from bodyB that are inside bodyA + if (Vertices.contains(bodyA.vertices, supportsB[0])) { + supports[supportCount++] = supportsB[0]; + } + + if (Vertices.contains(bodyA.vertices, supportsB[1])) { + supports[supportCount++] = supportsB[1]; + } + + // find the supports from bodyA that are inside bodyB + if (supportCount < 2) { + var supportsA = Collision._findSupports(bodyB, bodyA, normal, -1); + + if (Vertices.contains(bodyB.vertices, supportsA[0])) { + supports[supportCount++] = supportsA[0]; + } + + if (supportCount < 2 && Vertices.contains(bodyB.vertices, supportsA[1])) { + supports[supportCount++] = supportsA[1]; + } + } + + // account for the edge case of overlapping but no vertex containment + if (supportCount === 0) { + supports[supportCount++] = supportsB[0]; + } + + // update supports array size + supports.length = supportCount; + + return collision; + }; + + /** + * Find the overlap between two sets of vertices. + * @method _overlapAxes + * @private + * @param {object} result + * @param {vertices} verticesA + * @param {vertices} verticesB + * @param {axes} axes + */ + Collision._overlapAxes = function(result, verticesA, verticesB, axes) { + var verticesALength = verticesA.length, + verticesBLength = verticesB.length, + verticesAX = verticesA[0].x, + verticesAY = verticesA[0].y, + verticesBX = verticesB[0].x, + verticesBY = verticesB[0].y, + axesLength = axes.length, + overlapMin = Number.MAX_VALUE, + overlapAxisNumber = 0, + overlap, + overlapAB, + overlapBA, + dot, + i, + j; + + for (i = 0; i < axesLength; i++) { + var axis = axes[i], + axisX = axis.x, + axisY = axis.y, + minA = verticesAX * axisX + verticesAY * axisY, + minB = verticesBX * axisX + verticesBY * axisY, + maxA = minA, + maxB = minB; + + for (j = 1; j < verticesALength; j += 1) { + dot = verticesA[j].x * axisX + verticesA[j].y * axisY; + + if (dot > maxA) { + maxA = dot; + } else if (dot < minA) { + minA = dot; + } + } + + for (j = 1; j < verticesBLength; j += 1) { + dot = verticesB[j].x * axisX + verticesB[j].y * axisY; + + if (dot > maxB) { + maxB = dot; + } else if (dot < minB) { + minB = dot; + } + } + + overlapAB = maxA - minB; + overlapBA = maxB - minA; + overlap = overlapAB < overlapBA ? overlapAB : overlapBA; + + if (overlap < overlapMin) { + overlapMin = overlap; + overlapAxisNumber = i; + + if (overlap <= 0) { + // can not be intersecting + break; + } + } + } + + result.axis = axes[overlapAxisNumber]; + result.overlap = overlapMin; + }; + + /** + * Projects vertices on an axis and returns an interval. + * @method _projectToAxis + * @private + * @param {} projection + * @param {} vertices + * @param {} axis + */ + Collision._projectToAxis = function(projection, vertices, axis) { + var min = vertices[0].x * axis.x + vertices[0].y * axis.y, + max = min; + + for (var i = 1; i < vertices.length; i += 1) { + var dot = vertices[i].x * axis.x + vertices[i].y * axis.y; + + if (dot > max) { + max = dot; + } else if (dot < min) { + min = dot; + } + } + + projection.min = min; + projection.max = max; + }; + + /** + * Finds supporting vertices given two bodies along a given direction using hill-climbing. + * @method _findSupports + * @private + * @param {body} bodyA + * @param {body} bodyB + * @param {vector} normal + * @param {number} direction + * @return [vector] + */ + Collision._findSupports = function(bodyA, bodyB, normal, direction) { + var vertices = bodyB.vertices, + verticesLength = vertices.length, + bodyAPositionX = bodyA.position.x, + bodyAPositionY = bodyA.position.y, + normalX = normal.x * direction, + normalY = normal.y * direction, + nearestDistance = Number.MAX_VALUE, + vertexA, + vertexB, + vertexC, + distance, + j; + + // find deepest vertex relative to the axis + for (j = 0; j < verticesLength; j += 1) { + vertexB = vertices[j]; + distance = normalX * (bodyAPositionX - vertexB.x) + normalY * (bodyAPositionY - vertexB.y); + + // convex hill-climbing + if (distance < nearestDistance) { + nearestDistance = distance; + vertexA = vertexB; + } + } + + // measure next vertex + vertexC = vertices[(verticesLength + vertexA.index - 1) % verticesLength]; + nearestDistance = normalX * (bodyAPositionX - vertexC.x) + normalY * (bodyAPositionY - vertexC.y); + + // compare with previous vertex + vertexB = vertices[(vertexA.index + 1) % verticesLength]; + if (normalX * (bodyAPositionX - vertexB.x) + normalY * (bodyAPositionY - vertexB.y) < nearestDistance) { + _supports[0] = vertexA; + _supports[1] = vertexB; + + return _supports; + } + + _supports[0] = vertexA; + _supports[1] = vertexC; + + return _supports; + }; + + /* + * + * Properties Documentation + * + */ + + /** + * A reference to the pair using this collision record, if there is one. + * + * @property pair + * @type {pair|null} + * @default null + */ + + /** + * A flag that indicates if the bodies were colliding when the collision was last updated. + * + * @property collided + * @type boolean + * @default false + */ + + /** + * The first body part represented by the collision (see also `collision.parentA`). + * + * @property bodyA + * @type body + */ + + /** + * The second body part represented by the collision (see also `collision.parentB`). + * + * @property bodyB + * @type body + */ + + /** + * The first body represented by the collision (i.e. `collision.bodyA.parent`). + * + * @property parentA + * @type body + */ + + /** + * The second body represented by the collision (i.e. `collision.bodyB.parent`). + * + * @property parentB + * @type body + */ + + /** + * A `Number` that represents the minimum separating distance between the bodies along the collision normal. + * + * @readOnly + * @property depth + * @type number + * @default 0 + */ + + /** + * A normalised `Vector` that represents the direction between the bodies that provides the minimum separating distance. + * + * @property normal + * @type vector + * @default { x: 0, y: 0 } + */ + + /** + * A normalised `Vector` that is the tangent direction to the collision normal. + * + * @property tangent + * @type vector + * @default { x: 0, y: 0 } + */ + + /** + * A `Vector` that represents the direction and depth of the collision. + * + * @property penetration + * @type vector + * @default { x: 0, y: 0 } + */ + + /** + * An array of body vertices that represent the support points in the collision. + * These are the deepest vertices (along the collision normal) of each body that are contained by the other body's vertices. + * + * @property supports + * @type vector[] + * @default [] + */ + +})(); + + +/***/ }), + +/***/ 17319: +/***/ ((module) => { + +/** +* The `Matter.Contact` module contains methods for creating and manipulating collision contacts. +* +* @class Contact +*/ + +var Contact = {}; + +module.exports = Contact; + +(function() { + + /** + * Creates a new contact. + * @method create + * @param {vertex} vertex + * @return {contact} A new contact + */ + Contact.create = function(vertex) { + return { + vertex: vertex, + normalImpulse: 0, + tangentImpulse: 0 + }; + }; + +})(); + + /***/ }), /***/ 13657: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** -* The `Matter.Detector` module contains methods for detecting collisions given a set of pairs. +* The `Matter.Detector` module contains methods for efficiently detecting collisions between a list of bodies using a broadphase algorithm. * * @class Detector */ -// TODO: speculative contacts - var Detector = {}; module.exports = Detector; -var SAT = __webpack_require__(5756); -var Pair = __webpack_require__(70584); -var Bounds = __webpack_require__(84091); +var Common = __webpack_require__(68758); +var Collision = __webpack_require__(63454); (function() { /** - * Finds all collisions given a list of pairs. - * @method collisions - * @param {pair[]} broadphasePairs - * @param {engine} engine - * @return {array} collisions + * Creates a new collision detector. + * @method create + * @param {} options + * @return {detector} A new collision detector */ - Detector.collisions = function(broadphasePairs, engine) { + Detector.create = function(options) { + var defaults = { + bodies: [], + pairs: null + }; + + return Common.extend(defaults, options); + }; + + /** + * Sets the list of bodies in the detector. + * @method setBodies + * @param {detector} detector + * @param {body[]} bodies + */ + Detector.setBodies = function(detector, bodies) { + detector.bodies = bodies.slice(0); + }; + + /** + * Clears the detector including its list of bodies. + * @method clear + * @param {detector} detector + */ + Detector.clear = function(detector) { + detector.bodies = []; + }; + + /** + * Efficiently finds all collisions among all the bodies in `detector.bodies` using a broadphase algorithm. + * + * _Note:_ The specific ordering of collisions returned is not guaranteed between releases and may change for performance reasons. + * If a specific ordering is required then apply a sort to the resulting array. + * @method collisions + * @param {detector} detector + * @return {collision[]} collisions + */ + Detector.collisions = function(detector) { var collisions = [], - pairsTable = engine.pairs.table; + pairs = detector.pairs, + bodies = detector.bodies, + bodiesLength = bodies.length, + canCollide = Detector.canCollide, + collides = Collision.collides, + i, + j; - // @if DEBUG - var metrics = engine.metrics; - // @endif - - for (var i = 0; i < broadphasePairs.length; i++) { - var bodyA = broadphasePairs[i][0], - bodyB = broadphasePairs[i][1]; + bodies.sort(Detector._compareBoundsX); - if ((bodyA.isStatic || bodyA.isSleeping) && (bodyB.isStatic || bodyB.isSleeping)) - continue; - - if (!Detector.canCollide(bodyA.collisionFilter, bodyB.collisionFilter)) - continue; + for (i = 0; i < bodiesLength; i++) { + var bodyA = bodies[i], + boundsA = bodyA.bounds, + boundXMax = bodyA.bounds.max.x, + boundYMax = bodyA.bounds.max.y, + boundYMin = bodyA.bounds.min.y, + bodyAStatic = bodyA.isStatic || bodyA.isSleeping, + partsALength = bodyA.parts.length, + partsASingle = partsALength === 1; - // @if DEBUG - metrics.midphaseTests += 1; - // @endif + for (j = i + 1; j < bodiesLength; j++) { + var bodyB = bodies[j], + boundsB = bodyB.bounds; - // mid phase - if (Bounds.overlaps(bodyA.bounds, bodyB.bounds)) { - for (var j = bodyA.parts.length > 1 ? 1 : 0; j < bodyA.parts.length; j++) { - var partA = bodyA.parts[j]; + if (boundsB.min.x > boundXMax) { + break; + } - for (var k = bodyB.parts.length > 1 ? 1 : 0; k < bodyB.parts.length; k++) { - var partB = bodyB.parts[k]; + if (boundYMax < boundsB.min.y || boundYMin > boundsB.max.y) { + continue; + } - if ((partA === bodyA && partB === bodyB) || Bounds.overlaps(partA.bounds, partB.bounds)) { - // find a previous collision we could reuse - var pairId = Pair.id(partA, partB), - pair = pairsTable[pairId], - previousCollision; + if (bodyAStatic && (bodyB.isStatic || bodyB.isSleeping)) { + continue; + } - if (pair && pair.isActive) { - previousCollision = pair.collision; - } else { - previousCollision = null; + if (!canCollide(bodyA.collisionFilter, bodyB.collisionFilter)) { + continue; + } + + var partsBLength = bodyB.parts.length; + + if (partsASingle && partsBLength === 1) { + var collision = collides(bodyA, bodyB, pairs); + + if (collision) { + collisions.push(collision); + } + } else { + var partsAStart = partsALength > 1 ? 1 : 0, + partsBStart = partsBLength > 1 ? 1 : 0; + + for (var k = partsAStart; k < partsALength; k++) { + var partA = bodyA.parts[k], + boundsA = partA.bounds; + + for (var z = partsBStart; z < partsBLength; z++) { + var partB = bodyB.parts[z], + boundsB = partB.bounds; + + if (boundsA.min.x > boundsB.max.x || boundsA.max.x < boundsB.min.x + || boundsA.max.y < boundsB.min.y || boundsA.min.y > boundsB.max.y) { + continue; } - // narrow phase - var collision = SAT.collides(partA, partB, previousCollision); + var collision = collides(partA, partB, pairs); - // @if DEBUG - metrics.narrowphaseTests += 1; - if (collision.reused) - metrics.narrowReuseCount += 1; - // @endif - - if (collision.collided) { + if (collision) { collisions.push(collision); - // @if DEBUG - metrics.narrowDetections += 1; - // @endif } } } @@ -151673,341 +153418,48 @@ var Bounds = __webpack_require__(84091); return (filterA.mask & filterB.category) !== 0 && (filterB.mask & filterA.category) !== 0; }; -})(); - - -/***/ }), - -/***/ 15489: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -/** -* The `Matter.Grid` module contains methods for creating and manipulating collision broadphase grid structures. -* -* @class Grid -*/ - -var Grid = {}; - -module.exports = Grid; - -var Pair = __webpack_require__(70584); -var Detector = __webpack_require__(13657); -var Common = __webpack_require__(68758); - -(function() { - /** - * Creates a new grid. - * @method create - * @param {} options - * @return {grid} A new grid - */ - Grid.create = function(options) { - var defaults = { - controller: Grid, - detector: Detector.collisions, - buckets: {}, - pairs: {}, - pairsList: [], - bucketWidth: 48, - bucketHeight: 48 - }; - - return Common.extend(defaults, options); - }; - - /** - * The width of a single grid bucket. - * - * @property bucketWidth - * @type number - * @default 48 - */ - - /** - * The height of a single grid bucket. - * - * @property bucketHeight - * @type number - * @default 48 - */ - - /** - * Updates the grid. - * @method update - * @param {grid} grid - * @param {body[]} bodies - * @param {engine} engine - * @param {boolean} forceUpdate - */ - Grid.update = function(grid, bodies, engine, forceUpdate) { - var i, col, row, - world = engine.world, - buckets = grid.buckets, - bucket, - bucketId, - gridChanged = false; - - // @if DEBUG - var metrics = engine.metrics; - metrics.broadphaseTests = 0; - // @endif - - for (i = 0; i < bodies.length; i++) { - var body = bodies[i]; - - if (body.isSleeping && !forceUpdate) - continue; - - // don't update out of world bodies - if (body.bounds.max.x < world.bounds.min.x || body.bounds.min.x > world.bounds.max.x - || body.bounds.max.y < world.bounds.min.y || body.bounds.min.y > world.bounds.max.y) - continue; - - var newRegion = Grid._getRegion(grid, body); - - // if the body has changed grid region - if (!body.region || newRegion.id !== body.region.id || forceUpdate) { - - // @if DEBUG - metrics.broadphaseTests += 1; - // @endif - - if (!body.region || forceUpdate) - body.region = newRegion; - - var union = Grid._regionUnion(newRegion, body.region); - - // update grid buckets affected by region change - // iterate over the union of both regions - for (col = union.startCol; col <= union.endCol; col++) { - for (row = union.startRow; row <= union.endRow; row++) { - bucketId = Grid._getBucketId(col, row); - bucket = buckets[bucketId]; - - var isInsideNewRegion = (col >= newRegion.startCol && col <= newRegion.endCol - && row >= newRegion.startRow && row <= newRegion.endRow); - - var isInsideOldRegion = (col >= body.region.startCol && col <= body.region.endCol - && row >= body.region.startRow && row <= body.region.endRow); - - // remove from old region buckets - if (!isInsideNewRegion && isInsideOldRegion) { - if (isInsideOldRegion) { - if (bucket) - Grid._bucketRemoveBody(grid, bucket, body); - } - } - - // add to new region buckets - if (body.region === newRegion || (isInsideNewRegion && !isInsideOldRegion) || forceUpdate) { - if (!bucket) - bucket = Grid._createBucket(buckets, bucketId); - Grid._bucketAddBody(grid, bucket, body); - } - } - } - - // set the new region - body.region = newRegion; - - // flag changes so we can update pairs - gridChanged = true; - } - } - - // update pairs list only if pairs changed (i.e. a body changed region) - if (gridChanged) - grid.pairsList = Grid._createActivePairsList(grid); - }; - - /** - * Clears the grid. - * @method clear - * @param {grid} grid - */ - Grid.clear = function(grid) { - grid.buckets = {}; - grid.pairs = {}; - grid.pairsList = []; - }; - - /** - * Finds the union of two regions. - * @method _regionUnion + * The comparison function used in the broadphase algorithm. + * Returns the signed delta of the bodies bounds on the x-axis. * @private - * @param {} regionA - * @param {} regionB - * @return {} region + * @method _sortCompare + * @param {body} bodyA + * @param {body} bodyB + * @return {number} The signed delta used for sorting */ - Grid._regionUnion = function(regionA, regionB) { - var startCol = Math.min(regionA.startCol, regionB.startCol), - endCol = Math.max(regionA.endCol, regionB.endCol), - startRow = Math.min(regionA.startRow, regionB.startRow), - endRow = Math.max(regionA.endRow, regionB.endRow); - - return Grid._createRegion(startCol, endCol, startRow, endRow); + Detector._compareBoundsX = function(bodyA, bodyB) { + return bodyA.bounds.min.x - bodyB.bounds.min.x; }; + /* + * + * Properties Documentation + * + */ + /** - * Gets the region a given body falls in for a given grid. - * @method _getRegion - * @private - * @param {} grid - * @param {} body - * @return {} region + * The array of `Matter.Body` between which the detector finds collisions. + * + * _Note:_ The order of bodies in this array _is not fixed_ and will be continually managed by the detector. + * @property bodies + * @type body[] + * @default [] */ - Grid._getRegion = function(grid, body) { - var bounds = body.bounds, - startCol = Math.floor(bounds.min.x / grid.bucketWidth), - endCol = Math.floor(bounds.max.x / grid.bucketWidth), - startRow = Math.floor(bounds.min.y / grid.bucketHeight), - endRow = Math.floor(bounds.max.y / grid.bucketHeight); - - return Grid._createRegion(startCol, endCol, startRow, endRow); - }; /** - * Creates a region. - * @method _createRegion - * @private - * @param {} startCol - * @param {} endCol - * @param {} startRow - * @param {} endRow - * @return {} region + * Optional. A `Matter.Pairs` object from which previous collision objects may be reused. Intended for internal `Matter.Engine` usage. + * @property pairs + * @type {pairs|null} + * @default null */ - Grid._createRegion = function(startCol, endCol, startRow, endRow) { - return { - id: startCol + ',' + endCol + ',' + startRow + ',' + endRow, - startCol: startCol, - endCol: endCol, - startRow: startRow, - endRow: endRow - }; - }; - /** - * Gets the bucket id at the given position. - * @method _getBucketId - * @private - * @param {} column - * @param {} row - * @return {string} bucket id - */ - Grid._getBucketId = function(column, row) { - return 'C' + column + 'R' + row; - }; - - /** - * Creates a bucket. - * @method _createBucket - * @private - * @param {} buckets - * @param {} bucketId - * @return {} bucket - */ - Grid._createBucket = function(buckets, bucketId) { - var bucket = buckets[bucketId] = []; - return bucket; - }; - - /** - * Adds a body to a bucket. - * @method _bucketAddBody - * @private - * @param {} grid - * @param {} bucket - * @param {} body - */ - Grid._bucketAddBody = function(grid, bucket, body) { - // add new pairs - for (var i = 0; i < bucket.length; i++) { - var bodyB = bucket[i]; - - if (body.id === bodyB.id || (body.isStatic && bodyB.isStatic)) - continue; - - // keep track of the number of buckets the pair exists in - // important for Grid.update to work - var pairId = Pair.id(body, bodyB), - pair = grid.pairs[pairId]; - - if (pair) { - pair[2] += 1; - } else { - grid.pairs[pairId] = [body, bodyB, 1]; - } - } - - // add to bodies (after pairs, otherwise pairs with self) - bucket.push(body); - }; - - /** - * Removes a body from a bucket. - * @method _bucketRemoveBody - * @private - * @param {} grid - * @param {} bucket - * @param {} body - */ - Grid._bucketRemoveBody = function(grid, bucket, body) { - // remove from bucket - bucket.splice(bucket.indexOf(body), 1); - - // update pair counts - for (var i = 0; i < bucket.length; i++) { - // keep track of the number of buckets the pair exists in - // important for _createActivePairsList to work - var bodyB = bucket[i], - pairId = Pair.id(body, bodyB), - pair = grid.pairs[pairId]; - - if (pair) - pair[2] -= 1; - } - }; - - /** - * Generates a list of the active pairs in the grid. - * @method _createActivePairsList - * @private - * @param {} grid - * @return [] pairs - */ - Grid._createActivePairsList = function(grid) { - var pairKeys, - pair, - pairs = []; - - // grid.pairs is used as a hashmap - pairKeys = Common.keys(grid.pairs); - - // iterate over grid.pairs - for (var k = 0; k < pairKeys.length; k++) { - pair = grid.pairs[pairKeys[k]]; - - // if pair exists in at least one bucket - // it is a pair that needs further collision testing so push it - if (pair[2] > 0) { - pairs.push(pair); - } else { - delete grid.pairs[pairKeys[k]]; - } - } - - return pairs; - }; - })(); /***/ }), /***/ 70584: -/***/ ((module) => { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * The `Matter.Pair` module contains methods for creating and manipulating collision pairs. @@ -152019,6 +153471,8 @@ var Pair = {}; module.exports = Pair; +var Contact = __webpack_require__(17319); + (function() { /** @@ -152036,6 +153490,8 @@ module.exports = Pair; id: Pair.id(bodyA, bodyB), bodyA: bodyA, bodyB: bodyB, + collision: collision, + contacts: [], activeContacts: [], separation: 0, isActive: true, @@ -152043,7 +153499,6 @@ module.exports = Pair; isSensor: bodyA.isSensor || bodyB.isSensor, timeCreated: timestamp, timeUpdated: timestamp, - collision: null, inverseMass: 0, friction: 0, frictionStatic: 0, @@ -152064,35 +153519,36 @@ module.exports = Pair; * @param {number} timestamp */ Pair.update = function(pair, collision, timestamp) { + var contacts = pair.contacts, + supports = collision.supports, + activeContacts = pair.activeContacts, + parentA = collision.parentA, + parentB = collision.parentB, + parentAVerticesLength = parentA.vertices.length; + + pair.isActive = true; + pair.timeUpdated = timestamp; pair.collision = collision; + pair.separation = collision.depth; + pair.inverseMass = parentA.inverseMass + parentB.inverseMass; + pair.friction = parentA.friction < parentB.friction ? parentA.friction : parentB.friction; + pair.frictionStatic = parentA.frictionStatic > parentB.frictionStatic ? parentA.frictionStatic : parentB.frictionStatic; + pair.restitution = parentA.restitution > parentB.restitution ? parentA.restitution : parentB.restitution; + pair.slop = parentA.slop > parentB.slop ? parentA.slop : parentB.slop; - if (collision.collided) { - var supports = collision.supports, - activeContacts = pair.activeContacts, - parentA = collision.parentA, - parentB = collision.parentB; + collision.pair = pair; + activeContacts.length = 0; + + for (var i = 0; i < supports.length; i++) { + var support = supports[i], + contactId = support.body === parentA ? support.index : parentAVerticesLength + support.index, + contact = contacts[contactId]; - pair.inverseMass = parentA.inverseMass + parentB.inverseMass; - pair.friction = Math.min(parentA.friction, parentB.friction); - pair.frictionStatic = Math.max(parentA.frictionStatic, parentB.frictionStatic); - pair.restitution = Math.max(parentA.restitution, parentB.restitution); - pair.slop = Math.max(parentA.slop, parentB.slop); - - for (var i = 0; i < supports.length; i++) { - activeContacts[i] = supports[i].contact; + if (contact) { + activeContacts.push(contact); + } else { + activeContacts.push(contacts[contactId] = Contact.create(support)); } - - // optimise array size - var supportCount = supports.length; - if (supportCount < activeContacts.length) { - activeContacts.length = supportCount; - } - - pair.separation = collision.depth; - Pair.setActive(pair, true, timestamp); - } else { - if (pair.isActive === true) - Pair.setActive(pair, false, timestamp); } }; @@ -152150,8 +153606,6 @@ var Pair = __webpack_require__(70584); var Common = __webpack_require__(68758); (function() { - - Pairs._pairMaxIdleLife = 1000; /** * Creates a new pairs structure. @@ -152178,12 +153632,14 @@ var Common = __webpack_require__(68758); */ Pairs.update = function(pairs, collisions, timestamp) { var pairsList = pairs.list, + pairsListLength = pairsList.length, pairsTable = pairs.table, + collisionsLength = collisions.length, collisionStart = pairs.collisionStart, collisionEnd = pairs.collisionEnd, collisionActive = pairs.collisionActive, collision, - pairId, + pairIndex, pair, i; @@ -152192,90 +153648,61 @@ var Common = __webpack_require__(68758); collisionEnd.length = 0; collisionActive.length = 0; - for (i = 0; i < pairsList.length; i++) { + for (i = 0; i < pairsListLength; i++) { pairsList[i].confirmedActive = false; } - for (i = 0; i < collisions.length; i++) { + for (i = 0; i < collisionsLength; i++) { collision = collisions[i]; + pair = collision.pair; - if (collision.collided) { - pairId = Pair.id(collision.bodyA, collision.bodyB); - - pair = pairsTable[pairId]; - - if (pair) { - // pair already exists (but may or may not be active) - if (pair.isActive) { - // pair exists and is active - collisionActive.push(pair); - } else { - // pair exists but was inactive, so a collision has just started again - collisionStart.push(pair); - } - - // update the pair - Pair.update(pair, collision, timestamp); - pair.confirmedActive = true; + if (pair) { + // pair already exists (but may or may not be active) + if (pair.isActive) { + // pair exists and is active + collisionActive.push(pair); } else { - // pair did not exist, create a new pair - pair = Pair.create(collision, timestamp); - pairsTable[pairId] = pair; - - // push the new pair + // pair exists but was inactive, so a collision has just started again collisionStart.push(pair); - pairsList.push(pair); + } + + // update the pair + Pair.update(pair, collision, timestamp); + pair.confirmedActive = true; + } else { + // pair did not exist, create a new pair + pair = Pair.create(collision, timestamp); + pairsTable[pair.id] = pair; + + // push the new pair + collisionStart.push(pair); + pairsList.push(pair); + } + } + + // find pairs that are no longer active + var removePairIndex = []; + pairsListLength = pairsList.length; + + for (i = 0; i < pairsListLength; i++) { + pair = pairsList[i]; + + if (!pair.confirmedActive) { + Pair.setActive(pair, false, timestamp); + collisionEnd.push(pair); + + if (!pair.collision.bodyA.isSleeping && !pair.collision.bodyB.isSleeping) { + removePairIndex.push(i); } } } - // deactivate previously active pairs that are now inactive - for (i = 0; i < pairsList.length; i++) { - pair = pairsList[i]; - if (pair.isActive && !pair.confirmedActive) { - Pair.setActive(pair, false, timestamp); - collisionEnd.push(pair); - } - } - }; - - /** - * Finds and removes pairs that have been inactive for a set amount of time. - * @method removeOld - * @param {object} pairs - * @param {number} timestamp - */ - Pairs.removeOld = function(pairs, timestamp) { - var pairsList = pairs.list, - pairsTable = pairs.table, - indexesToRemove = [], - pair, - collision, - pairIndex, - i; - - for (i = 0; i < pairsList.length; i++) { - pair = pairsList[i]; - collision = pair.collision; - - // never remove sleeping pairs - if (collision.bodyA.isSleeping || collision.bodyB.isSleeping) { - pair.timeUpdated = timestamp; - continue; - } - - // if pair is inactive for too long, mark it to be removed - if (timestamp - pair.timeUpdated > Pairs._pairMaxIdleLife) { - indexesToRemove.push(i); - } - } - - // remove marked pairs - for (i = 0; i < indexesToRemove.length; i++) { - pairIndex = indexesToRemove[i] - i; + // remove inactive pairs + for (i = 0; i < removePairIndex.length; i++) { + pairIndex = removePairIndex[i] - i; pair = pairsList[pairIndex]; - delete pairsTable[pair.id]; pairsList.splice(pairIndex, 1); + delete pairsTable[pair.id]; } }; @@ -152315,7 +153742,7 @@ var Query = {}; module.exports = Query; var Vector = __webpack_require__(10438); -var SAT = __webpack_require__(5756); +var Collision = __webpack_require__(63454); var Bounds = __webpack_require__(84091); var Bodies = __webpack_require__(68516); var Vertices = __webpack_require__(39745); @@ -152327,28 +153754,34 @@ var Vertices = __webpack_require__(39745); * @method collides * @param {body} body * @param {body[]} bodies - * @return {object[]} Collisions + * @return {collision[]} Collisions */ Query.collides = function(body, bodies) { - var collisions = []; + var collisions = [], + bodiesLength = bodies.length, + bounds = body.bounds, + collides = Collision.collides, + overlaps = Bounds.overlaps; - for (var i = 0; i < bodies.length; i++) { - var bodyA = bodies[i]; + for (var i = 0; i < bodiesLength; i++) { + var bodyA = bodies[i], + partsALength = bodyA.parts.length, + partsAStart = partsALength === 1 ? 0 : 1; // Phaser addition - skip same body checks if (body === bodyA) { continue; } - - if (Bounds.overlaps(bodyA.bounds, body.bounds)) { - for (var j = bodyA.parts.length === 1 ? 0 : 1; j < bodyA.parts.length; j++) { + + if (overlaps(bodyA.bounds, bounds)) { + for (var j = partsAStart; j < partsALength; j++) { var part = bodyA.parts[j]; - if (Bounds.overlaps(part.bounds, body.bounds)) { - var collision = SAT.collides(part, body); + if (overlaps(part.bounds, bounds)) { + var collision = collides(part, body); - if (collision.collided) { + if (collision) { collisions.push(collision); break; } @@ -152367,7 +153800,7 @@ var Vertices = __webpack_require__(39745); * @param {vector} startPoint * @param {vector} endPoint * @param {number} [rayWidth] - * @return {object[]} Collisions + * @return {collision[]} Collisions */ Query.ray = function(bodies, startPoint, endPoint, rayWidth) { rayWidth = rayWidth || 1e-100; @@ -152381,7 +153814,7 @@ var Vertices = __webpack_require__(39745); for (var i = 0; i < collisions.length; i += 1) { var collision = collisions[i]; - collision.body = collision.bodyB = collision.bodyA; + collision.body = collision.bodyB = collision.bodyA; } return collisions; @@ -152420,7 +153853,7 @@ var Vertices = __webpack_require__(39745); for (var i = 0; i < bodies.length; i++) { var body = bodies[i]; - + if (Bounds.contains(body.bounds, point)) { for (var j = body.parts.length === 1 ? 0 : 1; j < body.parts.length; j++) { var part = body.parts[j]; @@ -152456,8 +153889,6 @@ var Resolver = {}; module.exports = Resolver; var Vertices = __webpack_require__(39745); -var Vector = __webpack_require__(10438); -var Common = __webpack_require__(68758); var Bounds = __webpack_require__(84091); (function() { @@ -152476,10 +153907,11 @@ var Bounds = __webpack_require__(84091); Resolver.preSolvePosition = function(pairs) { var i, pair, - activeCount; + activeCount, + pairsLength = pairs.length; // find total contacts on each body - for (i = 0; i < pairs.length; i++) { + for (i = 0; i < pairsLength; i++) { pair = pairs[i]; if (!pair.isActive) @@ -152495,36 +153927,22 @@ var Bounds = __webpack_require__(84091); * Find a solution for pair positions. * @method solvePosition * @param {pair[]} pairs - * @param {body[]} bodies * @param {number} timeScale */ - Resolver.solvePosition = function(pairs, bodies, timeScale) { + Resolver.solvePosition = function(pairs, timeScale) { var i, - normalX, - normalY, pair, collision, bodyA, bodyB, normal, - separation, - penetration, - positionImpulseA, - positionImpulseB, contactShare, - bodyBtoAX, - bodyBtoAY, positionImpulse, - impulseCoefficient = timeScale * Resolver._positionDampen; - - for (i = 0; i < bodies.length; i++) { - var body = bodies[i]; - body.previousPositionImpulse.x = body.positionImpulse.x; - body.previousPositionImpulse.y = body.positionImpulse.y; - } + positionDampen = Resolver._positionDampen, + pairsLength = pairs.length; // find impulses required to resolve penetration - for (i = 0; i < pairs.length; i++) { + for (i = 0; i < pairsLength; i++) { pair = pairs[i]; if (!pair.isActive || pair.isSensor) @@ -152535,35 +153953,37 @@ var Bounds = __webpack_require__(84091); bodyB = collision.parentB; normal = collision.normal; - positionImpulseA = bodyA.previousPositionImpulse; - positionImpulseB = bodyB.previousPositionImpulse; + // get current separation between body edges involved in collision + pair.separation = + normal.x * (bodyB.positionImpulse.x + collision.penetration.x - bodyA.positionImpulse.x) + + normal.y * (bodyB.positionImpulse.y + collision.penetration.y - bodyA.positionImpulse.y); + } + + for (i = 0; i < pairsLength; i++) { + pair = pairs[i]; - penetration = collision.penetration; - - bodyBtoAX = positionImpulseB.x - positionImpulseA.x + penetration.x; - bodyBtoAY = positionImpulseB.y - positionImpulseA.y + penetration.y; - - normalX = normal.x; - normalY = normal.y; - - separation = normalX * bodyBtoAX + normalY * bodyBtoAY; - pair.separation = separation; - - positionImpulse = (separation - pair.slop) * impulseCoefficient; + if (!pair.isActive || pair.isSensor) + continue; + + collision = pair.collision; + bodyA = collision.parentA; + bodyB = collision.parentB; + normal = collision.normal; + positionImpulse = (pair.separation - pair.slop) * timeScale; if (bodyA.isStatic || bodyB.isStatic) positionImpulse *= 2; if (!(bodyA.isStatic || bodyA.isSleeping)) { - contactShare = positionImpulse / bodyA.totalContacts; - bodyA.positionImpulse.x += normalX * contactShare; - bodyA.positionImpulse.y += normalY * contactShare; + contactShare = positionDampen / bodyA.totalContacts; + bodyA.positionImpulse.x += normal.x * positionImpulse * contactShare; + bodyA.positionImpulse.y += normal.y * positionImpulse * contactShare; } if (!(bodyB.isStatic || bodyB.isSleeping)) { - contactShare = positionImpulse / bodyB.totalContacts; - bodyB.positionImpulse.x -= normalX * contactShare; - bodyB.positionImpulse.y -= normalY * contactShare; + contactShare = positionDampen / bodyB.totalContacts; + bodyB.positionImpulse.x -= normal.x * positionImpulse * contactShare; + bodyB.positionImpulse.y -= normal.y * positionImpulse * contactShare; } } }; @@ -152574,34 +153994,43 @@ var Bounds = __webpack_require__(84091); * @param {body[]} bodies */ Resolver.postSolvePosition = function(bodies) { - for (var i = 0; i < bodies.length; i++) { - var body = bodies[i]; + var positionWarming = Resolver._positionWarming, + bodiesLength = bodies.length, + verticesTranslate = Vertices.translate, + boundsUpdate = Bounds.update; + + for (var i = 0; i < bodiesLength; i++) { + var body = bodies[i], + positionImpulse = body.positionImpulse, + positionImpulseX = positionImpulse.x, + positionImpulseY = positionImpulse.y, + velocity = body.velocity; // reset contact count body.totalContacts = 0; - if (body.positionImpulse.x !== 0 || body.positionImpulse.y !== 0) { + if (positionImpulseX !== 0 || positionImpulseY !== 0) { // update body geometry for (var j = 0; j < body.parts.length; j++) { var part = body.parts[j]; - Vertices.translate(part.vertices, body.positionImpulse); - Bounds.update(part.bounds, part.vertices, body.velocity); - part.position.x += body.positionImpulse.x; - part.position.y += body.positionImpulse.y; + verticesTranslate(part.vertices, positionImpulse); + boundsUpdate(part.bounds, part.vertices, velocity); + part.position.x += positionImpulseX; + part.position.y += positionImpulseY; } // move the body without changing velocity - body.positionPrev.x += body.positionImpulse.x; - body.positionPrev.y += body.positionImpulse.y; + body.positionPrev.x += positionImpulseX; + body.positionPrev.y += positionImpulseY; - if (Vector.dot(body.positionImpulse, body.velocity) < 0) { + if (positionImpulseX * velocity.x + positionImpulseY * velocity.y < 0) { // reset cached impulse if the body has velocity along it - body.positionImpulse.x = 0; - body.positionImpulse.y = 0; + positionImpulse.x = 0; + positionImpulse.y = 0; } else { // warm the next iteration - body.positionImpulse.x *= Resolver._positionWarming; - body.positionImpulse.y *= Resolver._positionWarming; + positionImpulse.x *= positionWarming; + positionImpulse.y *= positionWarming; } } } @@ -152613,61 +154042,53 @@ var Bounds = __webpack_require__(84091); * @param {pair[]} pairs */ Resolver.preSolveVelocity = function(pairs) { - var i, - j, - pair, - contacts, - collision, - bodyA, - bodyB, - normal, - tangent, - contact, - contactVertex, - normalImpulse, - tangentImpulse, - offset, - impulse = Vector._temp[0], - tempA = Vector._temp[1]; + var pairsLength = pairs.length, + i, + j; - for (i = 0; i < pairs.length; i++) { - pair = pairs[i]; + for (i = 0; i < pairsLength; i++) { + var pair = pairs[i]; if (!pair.isActive || pair.isSensor) continue; - contacts = pair.activeContacts; - collision = pair.collision; - bodyA = collision.parentA; - bodyB = collision.parentB; - normal = collision.normal; - tangent = collision.tangent; - + var contacts = pair.activeContacts, + contactsLength = contacts.length, + collision = pair.collision, + bodyA = collision.parentA, + bodyB = collision.parentB, + normal = collision.normal, + tangent = collision.tangent; + // resolve each contact - for (j = 0; j < contacts.length; j++) { - contact = contacts[j]; - contactVertex = contact.vertex; - normalImpulse = contact.normalImpulse; - tangentImpulse = contact.tangentImpulse; - + for (j = 0; j < contactsLength; j++) { + var contact = contacts[j], + contactVertex = contact.vertex, + normalImpulse = contact.normalImpulse, + tangentImpulse = contact.tangentImpulse; + if (normalImpulse !== 0 || tangentImpulse !== 0) { // total impulse from contact - impulse.x = (normal.x * normalImpulse) + (tangent.x * tangentImpulse); - impulse.y = (normal.y * normalImpulse) + (tangent.y * tangentImpulse); + var impulseX = normal.x * normalImpulse + tangent.x * tangentImpulse, + impulseY = normal.y * normalImpulse + tangent.y * tangentImpulse; // apply impulse from contact if (!(bodyA.isStatic || bodyA.isSleeping)) { - offset = Vector.sub(contactVertex, bodyA.position, tempA); - bodyA.positionPrev.x += impulse.x * bodyA.inverseMass; - bodyA.positionPrev.y += impulse.y * bodyA.inverseMass; - bodyA.anglePrev += Vector.cross(offset, impulse) * bodyA.inverseInertia; + bodyA.positionPrev.x += impulseX * bodyA.inverseMass; + bodyA.positionPrev.y += impulseY * bodyA.inverseMass; + bodyA.anglePrev += bodyA.inverseInertia * ( + (contactVertex.x - bodyA.position.x) * impulseY + - (contactVertex.y - bodyA.position.y) * impulseX + ); } - + if (!(bodyB.isStatic || bodyB.isSleeping)) { - offset = Vector.sub(contactVertex, bodyB.position, tempA); - bodyB.positionPrev.x -= impulse.x * bodyB.inverseMass; - bodyB.positionPrev.y -= impulse.y * bodyB.inverseMass; - bodyB.anglePrev -= Vector.cross(offset, impulse) * bodyB.inverseInertia; + bodyB.positionPrev.x -= impulseX * bodyB.inverseMass; + bodyB.positionPrev.y -= impulseY * bodyB.inverseMass; + bodyB.anglePrev -= bodyB.inverseInertia * ( + (contactVertex.x - bodyB.position.x) * impulseY + - (contactVertex.y - bodyB.position.y) * impulseX + ); } } } @@ -152682,14 +154103,17 @@ var Bounds = __webpack_require__(84091); */ Resolver.solveVelocity = function(pairs, timeScale) { var timeScaleSquared = timeScale * timeScale, - impulse = Vector._temp[0], - tempA = Vector._temp[1], - tempB = Vector._temp[2], - tempC = Vector._temp[3], - tempD = Vector._temp[4], - tempE = Vector._temp[5]; - - for (var i = 0; i < pairs.length; i++) { + restingThresh = Resolver._restingThresh * timeScaleSquared, + frictionNormalMultiplier = Resolver._frictionNormalMultiplier, + restingThreshTangent = Resolver._restingThreshTangent * timeScaleSquared, + NumberMaxValue = Number.MAX_VALUE, + pairsLength = pairs.length, + tangentImpulse, + maxFriction, + i, + j; + + for (i = 0; i < pairsLength; i++) { var pair = pairs[i]; if (!pair.isActive || pair.isSensor) @@ -152698,97 +154122,119 @@ var Bounds = __webpack_require__(84091); var collision = pair.collision, bodyA = collision.parentA, bodyB = collision.parentB, - normal = collision.normal, - tangent = collision.tangent, + bodyAVelocity = bodyA.velocity, + bodyBVelocity = bodyB.velocity, + normalX = collision.normal.x, + normalY = collision.normal.y, + tangentX = collision.tangent.x, + tangentY = collision.tangent.y, contacts = pair.activeContacts, - contactShare = 1 / contacts.length; + contactsLength = contacts.length, + contactShare = 1 / contactsLength, + inverseMassTotal = bodyA.inverseMass + bodyB.inverseMass, + friction = pair.friction * pair.frictionStatic * frictionNormalMultiplier * timeScaleSquared; // update body velocities - bodyA.velocity.x = bodyA.position.x - bodyA.positionPrev.x; - bodyA.velocity.y = bodyA.position.y - bodyA.positionPrev.y; - bodyB.velocity.x = bodyB.position.x - bodyB.positionPrev.x; - bodyB.velocity.y = bodyB.position.y - bodyB.positionPrev.y; + bodyAVelocity.x = bodyA.position.x - bodyA.positionPrev.x; + bodyAVelocity.y = bodyA.position.y - bodyA.positionPrev.y; + bodyBVelocity.x = bodyB.position.x - bodyB.positionPrev.x; + bodyBVelocity.y = bodyB.position.y - bodyB.positionPrev.y; bodyA.angularVelocity = bodyA.angle - bodyA.anglePrev; bodyB.angularVelocity = bodyB.angle - bodyB.anglePrev; // resolve each contact - for (var j = 0; j < contacts.length; j++) { + for (j = 0; j < contactsLength; j++) { var contact = contacts[j], - contactVertex = contact.vertex, - offsetA = Vector.sub(contactVertex, bodyA.position, tempA), - offsetB = Vector.sub(contactVertex, bodyB.position, tempB), - velocityPointA = Vector.add(bodyA.velocity, Vector.mult(Vector.perp(offsetA), bodyA.angularVelocity), tempC), - velocityPointB = Vector.add(bodyB.velocity, Vector.mult(Vector.perp(offsetB), bodyB.angularVelocity), tempD), - relativeVelocity = Vector.sub(velocityPointA, velocityPointB, tempE), - normalVelocity = Vector.dot(normal, relativeVelocity); + contactVertex = contact.vertex; - var tangentVelocity = Vector.dot(tangent, relativeVelocity), - tangentSpeed = Math.abs(tangentVelocity), - tangentVelocityDirection = Common.sign(tangentVelocity); + var offsetAX = contactVertex.x - bodyA.position.x, + offsetAY = contactVertex.y - bodyA.position.y, + offsetBX = contactVertex.x - bodyB.position.x, + offsetBY = contactVertex.y - bodyB.position.y; + + var velocityPointAX = bodyAVelocity.x - offsetAY * bodyA.angularVelocity, + velocityPointAY = bodyAVelocity.y + offsetAX * bodyA.angularVelocity, + velocityPointBX = bodyBVelocity.x - offsetBY * bodyB.angularVelocity, + velocityPointBY = bodyBVelocity.y + offsetBX * bodyB.angularVelocity; - // raw impulses - var normalImpulse = (1 + pair.restitution) * normalVelocity, - normalForce = Common.clamp(pair.separation + normalVelocity, 0, 1) * Resolver._frictionNormalMultiplier; + var relativeVelocityX = velocityPointAX - velocityPointBX, + relativeVelocityY = velocityPointAY - velocityPointBY; + + var normalVelocity = normalX * relativeVelocityX + normalY * relativeVelocityY, + tangentVelocity = tangentX * relativeVelocityX + tangentY * relativeVelocityY; // coulomb friction - var tangentImpulse = tangentVelocity, - maxFriction = Infinity; + var normalOverlap = pair.separation + normalVelocity; + var normalForce = Math.min(normalOverlap, 1); + normalForce = normalOverlap < 0 ? 0 : normalForce; + + var frictionLimit = normalForce * friction; - if (tangentSpeed > pair.friction * pair.frictionStatic * normalForce * timeScaleSquared) { - maxFriction = tangentSpeed; - tangentImpulse = Common.clamp( - pair.friction * tangentVelocityDirection * timeScaleSquared, - -maxFriction, maxFriction - ); + if (tangentVelocity > frictionLimit || -tangentVelocity > frictionLimit) { + maxFriction = tangentVelocity > 0 ? tangentVelocity : -tangentVelocity; + tangentImpulse = pair.friction * (tangentVelocity > 0 ? 1 : -1) * timeScaleSquared; + + if (tangentImpulse < -maxFriction) { + tangentImpulse = -maxFriction; + } else if (tangentImpulse > maxFriction) { + tangentImpulse = maxFriction; + } + } else { + tangentImpulse = tangentVelocity; + maxFriction = NumberMaxValue; } - // modify impulses accounting for mass, inertia and offset - var oAcN = Vector.cross(offsetA, normal), - oBcN = Vector.cross(offsetB, normal), - share = contactShare / (bodyA.inverseMass + bodyB.inverseMass + bodyA.inverseInertia * oAcN * oAcN + bodyB.inverseInertia * oBcN * oBcN); + // account for mass, inertia and contact offset + var oAcN = offsetAX * normalY - offsetAY * normalX, + oBcN = offsetBX * normalY - offsetBY * normalX, + share = contactShare / (inverseMassTotal + bodyA.inverseInertia * oAcN * oAcN + bodyB.inverseInertia * oBcN * oBcN); - normalImpulse *= share; + // raw impulses + var normalImpulse = (1 + pair.restitution) * normalVelocity * share; tangentImpulse *= share; // handle high velocity and resting collisions separately - if (normalVelocity < 0 && normalVelocity * normalVelocity > Resolver._restingThresh * timeScaleSquared) { + if (normalVelocity * normalVelocity > restingThresh && normalVelocity < 0) { // high normal velocity so clear cached contact normal impulse contact.normalImpulse = 0; } else { // solve resting collision constraints using Erin Catto's method (GDC08) // impulse constraint tends to 0 var contactNormalImpulse = contact.normalImpulse; - contact.normalImpulse = Math.min(contact.normalImpulse + normalImpulse, 0); + contact.normalImpulse += normalImpulse; + contact.normalImpulse = Math.min(contact.normalImpulse, 0); normalImpulse = contact.normalImpulse - contactNormalImpulse; } // handle high velocity and resting collisions separately - if (tangentVelocity * tangentVelocity > Resolver._restingThreshTangent * timeScaleSquared) { + if (tangentVelocity * tangentVelocity > restingThreshTangent) { // high tangent velocity so clear cached contact tangent impulse contact.tangentImpulse = 0; } else { // solve resting collision constraints using Erin Catto's method (GDC08) // tangent impulse tends to -tangentSpeed or +tangentSpeed var contactTangentImpulse = contact.tangentImpulse; - contact.tangentImpulse = Common.clamp(contact.tangentImpulse + tangentImpulse, -maxFriction, maxFriction); + contact.tangentImpulse += tangentImpulse; + if (contact.tangentImpulse < -maxFriction) contact.tangentImpulse = -maxFriction; + if (contact.tangentImpulse > maxFriction) contact.tangentImpulse = maxFriction; tangentImpulse = contact.tangentImpulse - contactTangentImpulse; } // total impulse from contact - impulse.x = (normal.x * normalImpulse) + (tangent.x * tangentImpulse); - impulse.y = (normal.y * normalImpulse) + (tangent.y * tangentImpulse); + var impulseX = normalX * normalImpulse + tangentX * tangentImpulse, + impulseY = normalY * normalImpulse + tangentY * tangentImpulse; // apply impulse from contact if (!(bodyA.isStatic || bodyA.isSleeping)) { - bodyA.positionPrev.x += impulse.x * bodyA.inverseMass; - bodyA.positionPrev.y += impulse.y * bodyA.inverseMass; - bodyA.anglePrev += Vector.cross(offsetA, impulse) * bodyA.inverseInertia; + bodyA.positionPrev.x += impulseX * bodyA.inverseMass; + bodyA.positionPrev.y += impulseY * bodyA.inverseMass; + bodyA.anglePrev += (offsetAX * impulseY - offsetAY * impulseX) * bodyA.inverseInertia; } if (!(bodyB.isStatic || bodyB.isSleeping)) { - bodyB.positionPrev.x -= impulse.x * bodyB.inverseMass; - bodyB.positionPrev.y -= impulse.y * bodyB.inverseMass; - bodyB.anglePrev -= Vector.cross(offsetB, impulse) * bodyB.inverseInertia; + bodyB.positionPrev.x -= impulseX * bodyB.inverseMass; + bodyB.positionPrev.y -= impulseY * bodyB.inverseMass; + bodyB.anglePrev -= (offsetBX * impulseY - offsetBY * impulseX) * bodyB.inverseInertia; } } } @@ -152797,283 +154243,6 @@ var Bounds = __webpack_require__(84091); })(); -/***/ }), - -/***/ 5756: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -/** -* The `Matter.SAT` module contains methods for detecting collisions using the Separating Axis Theorem. -* -* @class SAT -*/ - -// TODO: true circles and curves - -var SAT = {}; - -module.exports = SAT; - -var Vertices = __webpack_require__(39745); -var Vector = __webpack_require__(10438); - -(function() { - - /** - * Detect collision between two bodies using the Separating Axis Theorem. - * @method collides - * @param {body} bodyA - * @param {body} bodyB - * @param {collision} previousCollision - * @return {collision} collision - */ - SAT.collides = function(bodyA, bodyB, previousCollision) { - var overlapAB, - overlapBA, - minOverlap, - collision, - canReusePrevCol = false; - - if (previousCollision) { - // estimate total motion - var parentA = bodyA.parent, - parentB = bodyB.parent, - motion = parentA.speed * parentA.speed + parentA.angularSpeed * parentA.angularSpeed - + parentB.speed * parentB.speed + parentB.angularSpeed * parentB.angularSpeed; - - // we may be able to (partially) reuse collision result - // but only safe if collision was resting - canReusePrevCol = previousCollision && previousCollision.collided && motion < 0.2; - - // reuse collision object - collision = previousCollision; - } else { - collision = { collided: false, bodyA: bodyA, bodyB: bodyB }; - } - - if (previousCollision && canReusePrevCol) { - // if we can reuse the collision result - // we only need to test the previously found axis - var axisBodyA = collision.axisBody, - axisBodyB = axisBodyA === bodyA ? bodyB : bodyA, - axes = [axisBodyA.axes[previousCollision.axisNumber]]; - - minOverlap = SAT._overlapAxes(axisBodyA.vertices, axisBodyB.vertices, axes); - collision.reused = true; - - if (minOverlap.overlap <= 0) { - collision.collided = false; - return collision; - } - } else { - // if we can't reuse a result, perform a full SAT test - - overlapAB = SAT._overlapAxes(bodyA.vertices, bodyB.vertices, bodyA.axes); - - if (overlapAB.overlap <= 0) { - collision.collided = false; - return collision; - } - - overlapBA = SAT._overlapAxes(bodyB.vertices, bodyA.vertices, bodyB.axes); - - if (overlapBA.overlap <= 0) { - collision.collided = false; - return collision; - } - - if (overlapAB.overlap < overlapBA.overlap) { - minOverlap = overlapAB; - collision.axisBody = bodyA; - } else { - minOverlap = overlapBA; - collision.axisBody = bodyB; - } - - // important for reuse later - collision.axisNumber = minOverlap.axisNumber; - } - - collision.bodyA = bodyA.id < bodyB.id ? bodyA : bodyB; - collision.bodyB = bodyA.id < bodyB.id ? bodyB : bodyA; - collision.collided = true; - collision.depth = minOverlap.overlap; - collision.parentA = collision.bodyA.parent; - collision.parentB = collision.bodyB.parent; - - bodyA = collision.bodyA; - bodyB = collision.bodyB; - - // ensure normal is facing away from bodyA - if (Vector.dot(minOverlap.axis, Vector.sub(bodyB.position, bodyA.position)) < 0) { - collision.normal = { - x: minOverlap.axis.x, - y: minOverlap.axis.y - }; - } else { - collision.normal = { - x: -minOverlap.axis.x, - y: -minOverlap.axis.y - }; - } - - collision.tangent = Vector.perp(collision.normal); - - collision.penetration = collision.penetration || {}; - collision.penetration.x = collision.normal.x * collision.depth; - collision.penetration.y = collision.normal.y * collision.depth; - - // find support points, there is always either exactly one or two - var verticesB = SAT._findSupports(bodyA, bodyB, collision.normal), - supports = []; - - // find the supports from bodyB that are inside bodyA - if (Vertices.contains(bodyA.vertices, verticesB[0])) - supports.push(verticesB[0]); - - if (Vertices.contains(bodyA.vertices, verticesB[1])) - supports.push(verticesB[1]); - - // find the supports from bodyA that are inside bodyB - if (supports.length < 2) { - var verticesA = SAT._findSupports(bodyB, bodyA, Vector.neg(collision.normal)); - - if (Vertices.contains(bodyB.vertices, verticesA[0])) - supports.push(verticesA[0]); - - if (supports.length < 2 && Vertices.contains(bodyB.vertices, verticesA[1])) - supports.push(verticesA[1]); - } - - // account for the edge case of overlapping but no vertex containment - if (supports.length < 1) - supports = [verticesB[0]]; - - collision.supports = supports; - - return collision; - }; - - /** - * Find the overlap between two sets of vertices. - * @method _overlapAxes - * @private - * @param {} verticesA - * @param {} verticesB - * @param {} axes - * @return result - */ - SAT._overlapAxes = function(verticesA, verticesB, axes) { - var projectionA = Vector._temp[0], - projectionB = Vector._temp[1], - result = { overlap: Number.MAX_VALUE }, - overlap, - axis; - - for (var i = 0; i < axes.length; i++) { - axis = axes[i]; - - SAT._projectToAxis(projectionA, verticesA, axis); - SAT._projectToAxis(projectionB, verticesB, axis); - - overlap = Math.min(projectionA.max - projectionB.min, projectionB.max - projectionA.min); - - if (overlap <= 0) { - result.overlap = overlap; - return result; - } - - if (overlap < result.overlap) { - result.overlap = overlap; - result.axis = axis; - result.axisNumber = i; - } - } - - return result; - }; - - /** - * Projects vertices on an axis and returns an interval. - * @method _projectToAxis - * @private - * @param {} projection - * @param {} vertices - * @param {} axis - */ - SAT._projectToAxis = function(projection, vertices, axis) { - var min = Vector.dot(vertices[0], axis), - max = min; - - for (var i = 1; i < vertices.length; i += 1) { - var dot = Vector.dot(vertices[i], axis); - - if (dot > max) { - max = dot; - } else if (dot < min) { - min = dot; - } - } - - projection.min = min; - projection.max = max; - }; - - /** - * Finds supporting vertices given two bodies along a given direction using hill-climbing. - * @method _findSupports - * @private - * @param {} bodyA - * @param {} bodyB - * @param {} normal - * @return [vector] - */ - SAT._findSupports = function(bodyA, bodyB, normal) { - var nearestDistance = Number.MAX_VALUE, - vertexToBody = Vector._temp[0], - vertices = bodyB.vertices, - bodyAPosition = bodyA.position, - distance, - vertex, - vertexA, - vertexB; - - // find closest vertex on bodyB - for (var i = 0; i < vertices.length; i++) { - vertex = vertices[i]; - vertexToBody.x = vertex.x - bodyAPosition.x; - vertexToBody.y = vertex.y - bodyAPosition.y; - distance = -Vector.dot(normal, vertexToBody); - - if (distance < nearestDistance) { - nearestDistance = distance; - vertexA = vertex; - } - } - - // find next closest vertex using the two connected to it - var prevIndex = vertexA.index - 1 >= 0 ? vertexA.index - 1 : vertices.length - 1; - vertex = vertices[prevIndex]; - vertexToBody.x = vertex.x - bodyAPosition.x; - vertexToBody.y = vertex.y - bodyAPosition.y; - nearestDistance = -Vector.dot(normal, vertexToBody); - vertexB = vertex; - - var nextIndex = (vertexA.index + 1) % vertices.length; - vertex = vertices[nextIndex]; - vertexToBody.x = vertex.x - bodyAPosition.x; - vertexToBody.y = vertex.y - bodyAPosition.y; - distance = -Vector.dot(normal, vertexToBody); - if (distance < nearestDistance) { - vertexB = vertex; - } - - return [vertexA, vertexB]; - }; - -})(); - - /***/ }), /***/ 52838: @@ -153393,8 +154562,10 @@ var Common = __webpack_require__(68758); */ Constraint.pointAWorld = function(constraint) { return { - x: (constraint.bodyA ? constraint.bodyA.position.x : 0) + constraint.pointA.x, - y: (constraint.bodyA ? constraint.bodyA.position.y : 0) + constraint.pointA.y + x: (constraint.bodyA ? constraint.bodyA.position.x : 0) + + (constraint.pointA ? constraint.pointA.x : 0), + y: (constraint.bodyA ? constraint.bodyA.position.y : 0) + + (constraint.pointA ? constraint.pointA.y : 0) }; }; @@ -153406,8 +154577,10 @@ var Common = __webpack_require__(68758); */ Constraint.pointBWorld = function(constraint) { return { - x: (constraint.bodyB ? constraint.bodyB.position.x : 0) + constraint.pointB.x, - y: (constraint.bodyB ? constraint.bodyB.position.y : 0) + constraint.pointB.y + x: (constraint.bodyB ? constraint.bodyB.position.x : 0) + + (constraint.pointB ? constraint.pointB.x : 0), + y: (constraint.bodyB ? constraint.bodyB.position.y : 0) + + (constraint.pointB ? constraint.pointB.y : 0) }; }; @@ -153567,7 +154740,7 @@ var Common = __webpack_require__(68758); /***/ }), /***/ 68758: -/***/ ((module) => { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * The `Matter.Common` module contains utility functions that are common to all modules. @@ -153584,7 +154757,9 @@ module.exports = Common; Common._nextId = 0; Common._seed = 0; Common._nowStartTime = +(new Date()); - + Common._warnedOnce = {}; + Common._decomp = null; + /** * Extends the object in the first argument using the object in the second argument. * @method extend @@ -153792,7 +154967,7 @@ module.exports = Common; * @return {boolean} True if the object is a string, otherwise false */ Common.isString = function(obj) { - return Object.prototype.toString.call(obj) === '[object String]'; + return toString.call(obj) === '[object String]'; }; /** @@ -153823,9 +154998,9 @@ module.exports = Common; /** * Returns the current timestamp since the time origin (e.g. from page load). - * The result will be high-resolution including decimal places if available. + * The result is in milliseconds and will use high-resolution timing if available. * @method now - * @return {number} the current timestamp + * @return {number} the current timestamp in milliseconds */ Common.now = function() { if (typeof window !== 'undefined' && window.performance) { @@ -153836,6 +155011,10 @@ module.exports = Common; } } + if (Date.now) { + return Date.now(); + } + return (new Date()) - Common._nowStartTime; }; @@ -153929,6 +155108,35 @@ module.exports = Common; } }; + /** + * Uses `Common.warn` to log the given message one time only. + * @method warnOnce + * @param ...objs {} The objects to log. + */ + Common.warnOnce = function() { + var message = Array.prototype.slice.call(arguments).join(' '); + + if (!Common._warnedOnce[message]) { + Common.warn(message); + Common._warnedOnce[message] = true; + } + }; + + /** + * Shows a deprecated console warning when the function on the given object is called. + * The target function will be replaced with a new function that first shows the warning + * and then calls the original function. + * @method deprecated + * @param {object} obj The object or module + * @param {string} name The property name of the function on obj + * @param {string} warning The one-time message to show if the function is called + */ + Common.deprecated = function(obj, prop, warning) { + obj[prop] = Common.chain(function() { + Common.warnOnce('🔅 deprecated 🔅', warning); + }, obj[prop]); + }; + /** * Returns the next unique sequential ID. * @method nextId @@ -154106,6 +155314,44 @@ module.exports = Common; func )); }; + + /** + * Provide the [poly-decomp](https://github.com/schteppe/poly-decomp.js) library module to enable + * concave vertex decomposition support when using `Bodies.fromVertices` e.g. `Common.setDecomp(require('poly-decomp'))`. + * @method setDecomp + * @param {} decomp The [poly-decomp](https://github.com/schteppe/poly-decomp.js) library module. + */ + Common.setDecomp = function(decomp) { + Common._decomp = decomp; + }; + + /** + * Returns the [poly-decomp](https://github.com/schteppe/poly-decomp.js) library module provided through `Common.setDecomp`, + * otherwise returns the global `decomp` if set. + * @method getDecomp + * @return {} The [poly-decomp](https://github.com/schteppe/poly-decomp.js) library module if provided. + */ + Common.getDecomp = function() { + // get user provided decomp if set + var decomp = Common._decomp; + + try { + // otherwise from window global + if (!decomp && typeof window !== 'undefined') { + decomp = window.decomp; + } + + // otherwise from node global + if (!decomp && typeof __webpack_require__.g !== 'undefined') { + decomp = __webpack_require__.g.decomp; + } + } catch (e) { + // decomp not available + decomp = null; + } + + return decomp; + }; })(); @@ -154128,12 +155374,10 @@ var Engine = {}; module.exports = Engine; -var World = __webpack_require__(72005); var Sleeping = __webpack_require__(22806); var Resolver = __webpack_require__(44272); +var Detector = __webpack_require__(13657); var Pairs = __webpack_require__(91327); -var Metrics = __webpack_require__(86330); -var Grid = __webpack_require__(15489); var Events = __webpack_require__(39073); var Composite = __webpack_require__(11299); var Constraint = __webpack_require__(52838); @@ -154150,16 +155394,9 @@ var Body = __webpack_require__(84125); * @param {object} [options] * @return {engine} engine */ - Engine.create = function(element, options) { - // options may be passed as the first (and only) argument - options = Common.isElement(element) ? options : element; - element = Common.isElement(element) ? element : null; + Engine.create = function(options) { options = options || {}; - if (element || options.render) { - Common.warn('Engine.create: engine.render is deprecated (see docs)'); - } - var defaults = { positionIterations: 6, velocityIterations: 4, @@ -154167,26 +155404,31 @@ var Body = __webpack_require__(84125); enableSleeping: false, events: [], plugin: {}, + gravity: { + x: 0, + y: 1, + scale: 0.001 + }, timing: { timestamp: 0, - timeScale: 1 - }, - broadphase: { - controller: Grid + timeScale: 1, + lastDelta: 0, + lastElapsed: 0 } }; var engine = Common.extend(defaults, options); - engine.world = options.world || World.create(engine.world); - engine.pairs = Pairs.create(); - engine.broadphase = engine.broadphase.controller.create(engine.broadphase); - engine.metrics = engine.metrics || { extended: false }; - - // @if DEBUG - engine.metrics = Metrics.create(engine.metrics); - // @endif + engine.world = options.world || Composite.create({ label: 'World' }); + engine.pairs = options.pairs || Pairs.create(); + engine.detector = options.detector || Detector.create(); + // for temporary back compatibility only + engine.grid = { buckets: [] }; + engine.world.gravity = engine.gravity; + engine.broadphase = engine.grid; + engine.metrics = {}; + return engine; }; @@ -154206,17 +155448,21 @@ var Body = __webpack_require__(84125); * @param {number} [correction=1] */ Engine.update = function(engine, delta, correction) { + var startTime = Common.now(); + delta = delta || 1000 / 60; correction = correction || 1; var world = engine.world, + detector = engine.detector, + pairs = engine.pairs, timing = engine.timing, - broadphase = engine.broadphase, - broadphasePairs = [], + timestamp = timing.timestamp, i; // increment timestamp timing.timestamp += delta * timing.timeScale; + timing.lastDelta = delta * timing.timeScale; // create an event object var event = { @@ -154225,21 +155471,26 @@ var Body = __webpack_require__(84125); Events.trigger(engine, 'beforeUpdate', event); - // get lists of all bodies and constraints, no matter what composites they are in + // get all bodies and all constraints in the world var allBodies = Composite.allBodies(world), allConstraints = Composite.allConstraints(world); - // @if DEBUG - // reset metrics logging - Metrics.reset(engine.metrics); - // @endif + // update the detector bodies if they have changed + if (world.isModified) { + Detector.setBodies(detector, allBodies); + } - // if sleeping enabled, call the sleeping controller + // reset all composite modified flags + if (world.isModified) { + Composite.setModified(world, false, false, true); + } + + // update sleeping if enabled if (engine.enableSleeping) Sleeping.update(allBodies, timing.timeScale); - // applies gravity to all bodies - Engine._bodiesApplyGravity(allBodies, world.gravity); + // apply gravity to all bodies + Engine._bodiesApplyGravity(allBodies, engine.gravity); // update all body position and rotation by integration Engine._bodiesUpdate(allBodies, delta, timing.timeScale, correction, world.bounds); @@ -154251,33 +155502,12 @@ var Body = __webpack_require__(84125); } Constraint.postSolveAll(allBodies); - // broadphase pass: find potential collision pairs - if (broadphase.controller) { - // if world is dirty, we must flush the whole grid - if (world.isModified) - broadphase.controller.clear(broadphase); - - // update the grid buckets based on current bodies - broadphase.controller.update(broadphase, allBodies, engine, world.isModified); - broadphasePairs = broadphase.pairsList; - } else { - // if no broadphase set, we just pass all bodies - broadphasePairs = allBodies; - } - - // clear all composite modified flags - if (world.isModified) { - Composite.setModified(world, false, false, true); - } - - // narrowphase pass: find actual collisions, then create or update collision pairs - var collisions = broadphase.detector(broadphasePairs, engine); + // find all collisions + detector.pairs = engine.pairs; + var collisions = Detector.collisions(detector); // update collision pairs - var pairs = engine.pairs, - timestamp = timing.timestamp; Pairs.update(pairs, collisions, timestamp); - Pairs.removeOld(pairs, timestamp); // wake up bodies involved in collisions if (engine.enableSleeping) @@ -154290,7 +155520,7 @@ var Body = __webpack_require__(84125); // iteratively resolve position between collisions Resolver.preSolvePosition(pairs.list); for (i = 0; i < engine.positionIterations; i++) { - Resolver.solvePosition(pairs.list, allBodies, timing.timeScale); + Resolver.solvePosition(pairs.list, timing.timeScale); } Resolver.postSolvePosition(allBodies); @@ -154314,16 +155544,14 @@ var Body = __webpack_require__(84125); if (pairs.collisionEnd.length > 0) Events.trigger(engine, 'collisionEnd', { pairs: pairs.collisionEnd }); - // @if DEBUG - // update metrics log - Metrics.update(engine.metrics, engine); - // @endif - // clear force buffers Engine._bodiesClearForces(allBodies); Events.trigger(engine, 'afterUpdate', event); + // log the time elapsed computing this update + engine.timing.lastElapsed = Common.now() - startTime; + return engine; }; @@ -154352,21 +155580,13 @@ var Body = __webpack_require__(84125); }; /** - * Clears the engine including the world, pairs and broadphase. + * Clears the engine pairs and detector. * @method clear * @param {engine} engine */ Engine.clear = function(engine) { - var world = engine.world; - Pairs.clear(engine.pairs); - - var broadphase = engine.broadphase; - if (broadphase.controller) { - var bodies = Composite.allBodies(world); - broadphase.controller.clear(broadphase); - broadphase.controller.update(broadphase, bodies, engine, true); - } + Detector.clear(engine.detector); }; /** @@ -154436,7 +155656,8 @@ var Body = __webpack_require__(84125); }; /** - * An alias for `Runner.run`, see `Matter.Runner` for more information. + * A deprecated alias for `Runner.run`, use `Matter.Runner.run(engine)` instead and see `Matter.Runner` for more information. + * @deprecated use Matter.Runner.run(engine) instead * @method run * @param {engine} engine */ @@ -154445,53 +155666,53 @@ var Body = __webpack_require__(84125); * Fired just before an update * * @event beforeUpdate - * @param {} event An event object + * @param {object} event An event object * @param {number} event.timestamp The engine.timing.timestamp of the event - * @param {} event.source The source object of the event - * @param {} event.name The name of the event + * @param {engine} event.source The source object of the event + * @param {string} event.name The name of the event */ /** * Fired after engine update and all collision events * * @event afterUpdate - * @param {} event An event object + * @param {object} event An event object * @param {number} event.timestamp The engine.timing.timestamp of the event - * @param {} event.source The source object of the event - * @param {} event.name The name of the event + * @param {engine} event.source The source object of the event + * @param {string} event.name The name of the event */ /** * Fired after engine update, provides a list of all pairs that have started to collide in the current tick (if any) * * @event collisionStart - * @param {} event An event object - * @param {} event.pairs List of affected pairs + * @param {object} event An event object + * @param {pair[]} event.pairs List of affected pairs * @param {number} event.timestamp The engine.timing.timestamp of the event - * @param {} event.source The source object of the event - * @param {} event.name The name of the event + * @param {engine} event.source The source object of the event + * @param {string} event.name The name of the event */ /** * Fired after engine update, provides a list of all pairs that are colliding in the current tick (if any) * * @event collisionActive - * @param {} event An event object - * @param {} event.pairs List of affected pairs + * @param {object} event An event object + * @param {pair[]} event.pairs List of affected pairs * @param {number} event.timestamp The engine.timing.timestamp of the event - * @param {} event.source The source object of the event - * @param {} event.name The name of the event + * @param {engine} event.source The source object of the event + * @param {string} event.name The name of the event */ /** * Fired after engine update, provides a list of all pairs that have ended collision in the current tick (if any) * * @event collisionEnd - * @param {} event An event object - * @param {} event.pairs List of affected pairs + * @param {object} event An event object + * @param {pair[]} event.pairs List of affected pairs * @param {number} event.timestamp The engine.timing.timestamp of the event - * @param {} event.source The source object of the event - * @param {} event.name The name of the event + * @param {engine} event.source The source object of the event + * @param {string} event.name The name of the event */ /* @@ -154565,32 +155786,56 @@ var Body = __webpack_require__(84125); */ /** - * An instance of a `Render` controller. The default value is a `Matter.Render` instance created by `Engine.create`. - * One may also develop a custom renderer module based on `Matter.Render` and pass an instance of it to `Engine.create` via `options.render`. + * A `Number` that represents the total execution time elapsed during the last `Engine.update` in milliseconds. + * It is updated by timing from the start of the last `Engine.update` call until it ends. * - * A minimal custom renderer object must define at least three functions: `create`, `clear` and `world` (see `Matter.Render`). - * It is also possible to instead pass the _module_ reference via `options.render.controller` and `Engine.create` will instantiate one for you. + * This value will also include the total execution time of all event handlers directly or indirectly triggered by the engine update. * - * @property render - * @type render - * @deprecated see Demo.js for an example of creating a renderer - * @default a Matter.Render instance + * @property timing.lastElapsed + * @type number + * @default 0 */ /** - * An instance of a broadphase controller. The default value is a `Matter.Grid` instance created by `Engine.create`. + * A `Number` that represents the `delta` value used in the last engine update. * + * @property timing.lastDelta + * @type number + * @default 0 + */ + + /** + * A `Matter.Detector` instance. + * + * @property detector + * @type detector + * @default a Matter.Detector instance + */ + + /** + * A `Matter.Grid` instance. + * + * @deprecated replaced by `engine.detector` + * @property grid + * @type grid + * @default a Matter.Grid instance + */ + + /** + * Replaced by and now alias for `engine.grid`. + * + * @deprecated replaced by `engine.detector` * @property broadphase * @type grid * @default a Matter.Grid instance */ /** - * A `World` composite object that will contain all simulated bodies and constraints. + * The root `Matter.Composite` instance that will contain all bodies, constraints and other composites to be simulated by this engine. * * @property world - * @type world - * @default a Matter.World instance + * @type composite + * @default a Matter.Composite instance */ /** @@ -154600,6 +155845,37 @@ var Body = __webpack_require__(84125); * @type {} */ + /** + * The gravity to apply on all bodies in `engine.world`. + * + * @property gravity + * @type object + */ + + /** + * The gravity x component. + * + * @property gravity.x + * @type object + * @default 0 + */ + + /** + * The gravity y component. + * + * @property gravity.y + * @type object + * @default 1 + */ + + /** + * The gravity scale factor. + * + * @property gravity.scale + * @type object + * @default 0.001 + */ + })(); @@ -154756,7 +156032,7 @@ var Common = __webpack_require__(68758); * @readOnly * @type {String} */ - Matter.version = '0.14.2'; + Matter.version = '0.18.0'; /** * A list of plugin dependencies to be installed. These are normally set and installed through `Matter.use`. @@ -154815,106 +156091,6 @@ var Common = __webpack_require__(68758); })(); -/***/ }), - -/***/ 86330: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -// @if DEBUG -/** -* _Internal Class_, not generally used outside of the engine's internals. -* -*/ - -var Metrics = {}; - -module.exports = Metrics; - -var Composite = __webpack_require__(11299); -var Common = __webpack_require__(68758); - -(function() { - - /** - * Creates a new metrics. - * @method create - * @private - * @return {metrics} A new metrics - */ - Metrics.create = function(options) { - var defaults = { - extended: false, - narrowDetections: 0, - narrowphaseTests: 0, - narrowReuse: 0, - narrowReuseCount: 0, - midphaseTests: 0, - broadphaseTests: 0, - narrowEff: 0.0001, - midEff: 0.0001, - broadEff: 0.0001, - collisions: 0, - buckets: 0, - bodies: 0, - pairs: 0 - }; - - return Common.extend(defaults, false, options); - }; - - /** - * Resets metrics. - * @method reset - * @private - * @param {metrics} metrics - */ - Metrics.reset = function(metrics) { - if (metrics.extended) { - metrics.narrowDetections = 0; - metrics.narrowphaseTests = 0; - metrics.narrowReuse = 0; - metrics.narrowReuseCount = 0; - metrics.midphaseTests = 0; - metrics.broadphaseTests = 0; - metrics.narrowEff = 0; - metrics.midEff = 0; - metrics.broadEff = 0; - metrics.collisions = 0; - metrics.buckets = 0; - metrics.pairs = 0; - metrics.bodies = 0; - } - }; - - /** - * Updates metrics. - * @method update - * @private - * @param {metrics} metrics - * @param {engine} engine - */ - Metrics.update = function(metrics, engine) { - if (metrics.extended) { - var world = engine.world, - bodies = Composite.allBodies(world); - - metrics.collisions = metrics.narrowDetections; - metrics.pairs = engine.pairs.list.length; - metrics.bodies = bodies.length; - metrics.midEff = (metrics.narrowDetections / (metrics.midphaseTests || 1)).toFixed(2); - metrics.narrowEff = (metrics.narrowDetections / (metrics.narrowphaseTests || 1)).toFixed(2); - metrics.broadEff = (1 - (metrics.broadphaseTests / (bodies.length || 1))).toFixed(2); - metrics.narrowReuse = (metrics.narrowReuseCount / (metrics.narrowphaseTests || 1)).toFixed(2); - //var broadphase = engine.broadphase[engine.broadphase.current]; - //if (broadphase.instance) - // metrics.buckets = Common.keys(broadphase.instance.buckets).length; - } - }; - -})(); -// @endif - - /***/ }), /***/ 84474: @@ -154968,7 +156144,7 @@ var Common = __webpack_require__(68758); }; /** - * Resolves a dependency to a plugin object from the registry if it exists. + * Resolves a dependency to a plugin object from the registry if it exists. * The `dependency` may contain a version, but only the name matters when resolving. * @method resolve * @param dependency {string} The dependency. @@ -155162,7 +156338,7 @@ var Common = __webpack_require__(68758); */ Plugin.dependencyParse = function(dependency) { if (Common.isString(dependency)) { - var pattern = /^[\w-]+(@(\*|[\^~]?\d+\.\d+\.\d+(-[0-9A-Za-z-]+)?))?$/; + var pattern = /^[\w-]+(@(\*|[\^~]?\d+\.\d+\.\d+(-[0-9A-Za-z-+]+)?))?$/; if (!pattern.test(dependency)) { Common.warn('Plugin.dependencyParse:', dependency, 'is not a valid dependency string.'); @@ -155181,13 +156357,15 @@ var Common = __webpack_require__(68758); }; /** - * Parses a version string into its components. + * Parses a version string into its components. * Versions are strictly of the format `x.y.z` (as in [semver](http://semver.org/)). * Versions may optionally have a prerelease tag in the format `x.y.z-alpha`. * Ranges are a strict subset of [npm ranges](https://docs.npmjs.com/misc/semver#advanced-range-syntax). * Only the following range types are supported: * - Tilde ranges e.g. `~1.2.3` * - Caret ranges e.g. `^1.2.3` + * - Greater than ranges e.g. `>1.2.3` + * - Greater than or equal ranges e.g. `>=1.2.3` * - Exact version e.g. `1.2.3` * - Any version `*` * @method versionParse @@ -155195,29 +156373,28 @@ var Common = __webpack_require__(68758); * @return {object} The version range parsed into its components. */ Plugin.versionParse = function(range) { - var pattern = /^\*|[\^~]?\d+\.\d+\.\d+(-[0-9A-Za-z-]+)?$/; + var pattern = /^(\*)|(\^|~|>=|>)?\s*((\d+)\.(\d+)\.(\d+))(-[0-9A-Za-z-+]+)?$/; if (!pattern.test(range)) { Common.warn('Plugin.versionParse:', range, 'is not a valid version or range.'); } - var identifiers = range.split('-'); - range = identifiers[0]; - - var isRange = isNaN(Number(range[0])), - version = isRange ? range.substr(1) : range, - parts = Common.map(version.split('.'), function(part) { - return Number(part); - }); + var parts = pattern.exec(range); + var major = Number(parts[4]); + var minor = Number(parts[5]); + var patch = Number(parts[6]); return { - isRange: isRange, - version: version, + isRange: Boolean(parts[1] || parts[2]), + version: parts[3], range: range, - operator: isRange ? range[0] : '', - parts: parts, - prerelease: identifiers[1], - number: parts[0] * 1e8 + parts[1] * 1e4 + parts[2] + operator: parts[1] || parts[2] || '', + major: major, + minor: minor, + patch: patch, + parts: [major, minor, patch], + prerelease: parts[7], + number: major * 1e8 + minor * 1e4 + patch }; }; @@ -155233,30 +156410,36 @@ var Common = __webpack_require__(68758); Plugin.versionSatisfies = function(version, range) { range = range || '*'; - var rangeParsed = Plugin.versionParse(range), - rangeParts = rangeParsed.parts, - versionParsed = Plugin.versionParse(version), - versionParts = versionParsed.parts; + var r = Plugin.versionParse(range), + v = Plugin.versionParse(version); - if (rangeParsed.isRange) { - if (rangeParsed.operator === '*' || version === '*') { + if (r.isRange) { + if (r.operator === '*' || version === '*') { return true; } - if (rangeParsed.operator === '~') { - return versionParts[0] === rangeParts[0] && versionParts[1] === rangeParts[1] && versionParts[2] >= rangeParts[2]; + if (r.operator === '>') { + return v.number > r.number; } - if (rangeParsed.operator === '^') { - if (rangeParts[0] > 0) { - return versionParts[0] === rangeParts[0] && versionParsed.number >= rangeParsed.number; + if (r.operator === '>=') { + return v.number >= r.number; + } + + if (r.operator === '~') { + return v.major === r.major && v.minor === r.minor && v.patch >= r.patch; + } + + if (r.operator === '^') { + if (r.major > 0) { + return v.major === r.major && v.number >= r.number; } - if (rangeParts[1] > 0) { - return versionParts[1] === rangeParts[1] && versionParts[2] >= rangeParts[2]; + if (r.minor > 0) { + return v.minor === r.minor && v.patch >= r.patch; } - return versionParts[2] === rangeParts[2]; + return v.patch === r.patch; } } @@ -155408,7 +156591,7 @@ var Events = __webpack_require__(39073); /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** -* The `Matter.Bodies` module contains factory methods for creating rigid body models +* The `Matter.Bodies` module contains factory methods for creating rigid body models * with commonly used body configurations (such as rectangles, circles and other polygons). * * See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples). @@ -155427,12 +156610,11 @@ var Common = __webpack_require__(68758); var Body = __webpack_require__(84125); var Bounds = __webpack_require__(84091); var Vector = __webpack_require__(10438); -var decomp = __webpack_require__(81084); (function() { /** - * Creates a new rigid body model with a rectangle hull. + * Creates a new rigid body model with a rectangle hull. * The options parameter is an object that specifies any properties you wish to override the defaults. * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object. * @method rectangle @@ -155446,7 +156628,7 @@ var decomp = __webpack_require__(81084); Bodies.rectangle = function(x, y, width, height, options) { options = options || {}; - var rectangle = { + var rectangle = { label: 'Rectangle Body', position: { x: x, y: y }, vertices: Vertices.fromPath('L 0 0 L ' + width + ' 0 L ' + width + ' ' + height + ' L 0 ' + height) @@ -155454,16 +156636,16 @@ var decomp = __webpack_require__(81084); if (options.chamfer) { var chamfer = options.chamfer; - rectangle.vertices = Vertices.chamfer(rectangle.vertices, chamfer.radius, + rectangle.vertices = Vertices.chamfer(rectangle.vertices, chamfer.radius, chamfer.quality, chamfer.qualityMin, chamfer.qualityMax); delete options.chamfer; } return Body.create(Common.extend({}, rectangle, options)); }; - + /** - * Creates a new rigid body model with a trapezoid hull. + * Creates a new rigid body model with a trapezoid hull. * The options parameter is an object that specifies any properties you wish to override the defaults. * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object. * @method trapezoid @@ -155480,7 +156662,7 @@ var decomp = __webpack_require__(81084); slope *= 0.5; var roof = (1 - (slope * 2)) * width; - + var x1 = width * slope, x2 = x1 + roof, x3 = x2 + x1, @@ -155492,7 +156674,7 @@ var decomp = __webpack_require__(81084); verticesPath = 'L 0 0 L ' + x2 + ' ' + (-height) + ' L ' + x3 + ' 0'; } - var trapezoid = { + var trapezoid = { label: 'Trapezoid Body', position: { x: x, y: y }, vertices: Vertices.fromPath(verticesPath) @@ -155500,7 +156682,7 @@ var decomp = __webpack_require__(81084); if (options.chamfer) { var chamfer = options.chamfer; - trapezoid.vertices = Vertices.chamfer(trapezoid.vertices, chamfer.radius, + trapezoid.vertices = Vertices.chamfer(trapezoid.vertices, chamfer.radius, chamfer.quality, chamfer.qualityMin, chamfer.qualityMax); delete options.chamfer; } @@ -155509,7 +156691,7 @@ var decomp = __webpack_require__(81084); }; /** - * Creates a new rigid body model with a circle hull. + * Creates a new rigid body model with a circle hull. * The options parameter is an object that specifies any properties you wish to override the defaults. * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object. * @method circle @@ -155527,7 +156709,7 @@ var decomp = __webpack_require__(81084); label: 'Circle Body', circleRadius: radius }; - + // approximate circles with polygons until true circles implemented in SAT maxSides = maxSides || 25; var sides = Math.ceil(Math.max(10, Math.min(maxSides, radius))); @@ -155540,7 +156722,7 @@ var decomp = __webpack_require__(81084); }; /** - * Creates a new rigid body model with a regular polygon hull with the given number of sides. + * Creates a new rigid body model with a regular polygon hull with the given number of sides. * The options parameter is an object that specifies any properties you wish to override the defaults. * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object. * @method polygon @@ -155569,7 +156751,7 @@ var decomp = __webpack_require__(81084); path += 'L ' + xx.toFixed(3) + ' ' + yy.toFixed(3) + ' '; } - var polygon = { + var polygon = { label: 'Polygon Body', position: { x: x, y: y }, vertices: Vertices.fromPath(path) @@ -155577,7 +156759,7 @@ var decomp = __webpack_require__(81084); if (options.chamfer) { var chamfer = options.chamfer; - polygon.vertices = Vertices.chamfer(polygon.vertices, chamfer.radius, + polygon.vertices = Vertices.chamfer(polygon.vertices, chamfer.radius, chamfer.quality, chamfer.qualityMin, chamfer.qualityMax); delete options.chamfer; } @@ -155586,29 +156768,46 @@ var decomp = __webpack_require__(81084); }; /** - * Creates a body using the supplied vertices (or an array containing multiple sets of vertices). - * If the vertices are convex, they will pass through as supplied. - * Otherwise if the vertices are concave, they will be decomposed if [poly-decomp.js](https://github.com/schteppe/poly-decomp.js) is available. - * Note that this process is not guaranteed to support complex sets of vertices (e.g. those with holes may fail). - * By default the decomposition will discard collinear edges (to improve performance). - * It can also optionally discard any parts that have an area less than `minimumArea`. - * If the vertices can not be decomposed, the result will fall back to using the convex hull. - * The options parameter is an object that specifies any `Matter.Body` properties you wish to override the defaults. + * Utility to create a compound body based on set(s) of vertices. + * + * _Note:_ To optionally enable automatic concave vertices decomposition the [poly-decomp](https://github.com/schteppe/poly-decomp.js) + * package must be first installed and provided see `Common.setDecomp`, otherwise the convex hull of each vertex set will be used. + * + * The resulting vertices are reorientated about their centre of mass, + * and offset such that `body.position` corresponds to this point. + * + * The resulting offset may be found if needed by subtracting `body.bounds` from the original input bounds. + * To later move the centre of mass see `Body.setCentre`. + * + * Note that automatic conconcave decomposition results are not always optimal. + * For best results, simplify the input vertices as much as possible first. + * By default this function applies some addtional simplification to help. + * + * Some outputs may also require further manual processing afterwards to be robust. + * In particular some parts may need to be overlapped to avoid collision gaps. + * Thin parts and sharp points should be avoided or removed where possible. + * + * The options parameter object specifies any `Matter.Body` properties you wish to override the defaults. + * * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object. * @method fromVertices * @param {number} x * @param {number} y - * @param [[vector]] vertexSets - * @param {object} [options] - * @param {bool} [flagInternal=false] - * @param {number} [removeCollinear=0.01] - * @param {number} [minimumArea=10] + * @param {array} vertexSets One or more arrays of vertex points e.g. `[[{ x: 0, y: 0 }...], ...]`. + * @param {object} [options] The body options. + * @param {bool} [flagInternal=false] Optionally marks internal edges with `isInternal`. + * @param {number} [removeCollinear=0.01] Threshold when simplifying vertices along the same edge. + * @param {number} [minimumArea=10] Threshold when removing small parts. + * @param {number} [removeDuplicatePoints=0.01] Threshold when simplifying nearby vertices. * @return {body} */ - Bodies.fromVertices = function(x, y, vertexSets, options, flagInternal, removeCollinear, minimumArea) { - var body, + Bodies.fromVertices = function(x, y, vertexSets, options, flagInternal, removeCollinear, minimumArea, removeDuplicatePoints) { + var decomp = Common.getDecomp(), + canDecomp, + body, parts, isConvex, + isConcave, vertices, i, j, @@ -155616,16 +156815,16 @@ var decomp = __webpack_require__(81084); v, z; + // check decomp is as expected + canDecomp = Boolean(decomp && decomp.quickDecomp); + options = options || {}; parts = []; flagInternal = typeof flagInternal !== 'undefined' ? flagInternal : false; removeCollinear = typeof removeCollinear !== 'undefined' ? removeCollinear : 0.01; minimumArea = typeof minimumArea !== 'undefined' ? minimumArea : 10; - - if (!decomp) { - Common.warn('Bodies.fromVertices: poly-decomp.js required. Could not decompose vertices. Fallback to convex hull.'); - } + removeDuplicatePoints = typeof removeDuplicatePoints !== 'undefined' ? removeDuplicatePoints : 0.01; // ensure vertexSets is an array of arrays if (!Common.isArray(vertexSets[0])) { @@ -155635,8 +156834,15 @@ var decomp = __webpack_require__(81084); for (v = 0; v < vertexSets.length; v += 1) { vertices = vertexSets[v]; isConvex = Vertices.isConvex(vertices); + isConcave = !isConvex; - if (isConvex || !decomp) { + if (isConcave && !canDecomp) { + Common.warnOnce( + 'Bodies.fromVertices: Install the \'poly-decomp\' library and use Common.setDecomp or provide \'decomp\' as a global to decompose concave vertices.' + ); + } + + if (isConvex || !canDecomp) { if (isConvex) { vertices = Vertices.clockwiseSort(vertices); } else { @@ -155658,6 +156864,8 @@ var decomp = __webpack_require__(81084); decomp.makeCCW(concave); if (removeCollinear !== false) decomp.removeCollinearPoints(concave, removeCollinear); + if (removeDuplicatePoints !== false && decomp.removeDuplicatePoints) + decomp.removeDuplicatePoints(concave, removeDuplicatePoints); // use the quick decomposition algorithm (Bayazit) var decomposed = decomp.quickDecomp(concave); @@ -155692,6 +156900,7 @@ var decomp = __webpack_require__(81084); parts[i] = Body.create(Common.extend(parts[i], options)); } + // flag internal edges (coincident part edges) if (flagInternal) { Bodies.flagCoincidentParts(parts, 5); @@ -155700,6 +156909,8 @@ var decomp = __webpack_require__(81084); if (parts.length > 1) { // create the parent body to be returned, that contains generated compound parts body = Body.create(Common.extend({ parts: parts.slice(0) }, options)); + + // offset such that body.position is at the centre off mass Body.setPosition(body, { x: x, y: y }); return body; @@ -155711,7 +156922,7 @@ var decomp = __webpack_require__(81084); /** * Takes an array of Body objects and flags all internal edges (coincident parts) based on the maxDistance * value. The array is changed in-place and returned, so you can pass this function a `Body.parts` property. - * + * * @method flagCoincidentParts * @param {body[]} parts - The Body parts, or array of bodies, to flag. * @param {number} [maxDistance=5] @@ -155784,6 +156995,7 @@ var Constraint = __webpack_require__(52838); var Common = __webpack_require__(68758); var Body = __webpack_require__(84125); var Bodies = __webpack_require__(68516); +var deprecated = Common.deprecated; (function() { @@ -155970,7 +157182,8 @@ var Bodies = __webpack_require__(68516); }; /** - * Creates a composite with a Newton's Cradle setup of bodies and constraints. + * This has now moved to the [newtonsCradle example](https://github.com/liabru/matter-js/blob/master/examples/newtonsCradle.js), follow that instead as this function is deprecated here. + * @deprecated moved to newtonsCradle example * @method newtonsCradle * @param {number} xx * @param {number} yy @@ -155994,9 +157207,12 @@ var Bodies = __webpack_require__(68516); return newtonsCradle; }; + + deprecated(Composites, 'newtonsCradle', 'Composites.newtonsCradle ➤ moved to newtonsCradle example'); /** - * Creates a composite with simple car setup of bodies and constraints. + * This has now moved to the [car example](https://github.com/liabru/matter-js/blob/master/examples/car.js), follow that instead as this function is deprecated here. + * @deprecated moved to car example * @method car * @param {number} xx * @param {number} yy @@ -156062,8 +157278,12 @@ var Bodies = __webpack_require__(68516); return car; }; + deprecated(Composites, 'car', 'Composites.car ➤ moved to car example'); + /** - * Creates a simple soft body like object. + * This has now moved to the [softBody example](https://github.com/liabru/matter-js/blob/master/examples/softBody.js) + * and the [cloth example](https://github.com/liabru/matter-js/blob/master/examples/cloth.js), follow those instead as this function is deprecated here. + * @deprecated moved to softBody and cloth examples * @method softBody * @param {number} xx * @param {number} yy @@ -156092,6 +157312,7 @@ var Bodies = __webpack_require__(68516); return softBody; }; + deprecated(Composites, 'softBody', 'Composites.softBody ➤ moved to softBody and cloth examples'); })(); @@ -156821,17 +158042,9 @@ var Common = __webpack_require__(68758); y: point.y, index: i, body: body, - isInternal: false, - contact: null, - offset: null + isInternal: false }; - vertex.contact = { - vertex: vertex, - normalImpulse: 0, - tangentImpulse: 0 - }; - vertices.push(vertex); } @@ -156954,17 +158167,16 @@ var Common = __webpack_require__(68758); * @param {number} scalar */ Vertices.translate = function(vertices, vector, scalar) { - var i; - if (scalar) { - for (i = 0; i < vertices.length; i++) { - vertices[i].x += vector.x * scalar; - vertices[i].y += vector.y * scalar; - } - } else { - for (i = 0; i < vertices.length; i++) { - vertices[i].x += vector.x; - vertices[i].y += vector.y; - } + scalar = typeof scalar !== 'undefined' ? scalar : 1; + + var verticesLength = vertices.length, + translateX = vector.x * scalar, + translateY = vector.y * scalar, + i; + + for (i = 0; i < verticesLength; i++) { + vertices[i].x += translateX; + vertices[i].y += translateY; } return vertices; @@ -156982,15 +158194,21 @@ var Common = __webpack_require__(68758); return; var cos = Math.cos(angle), - sin = Math.sin(angle); + sin = Math.sin(angle), + pointX = point.x, + pointY = point.y, + verticesLength = vertices.length, + vertex, + dx, + dy, + i; - for (var i = 0; i < vertices.length; i++) { - var vertice = vertices[i], - dx = vertice.x - point.x, - dy = vertice.y - point.y; - - vertice.x = point.x + (dx * cos - dy * sin); - vertice.y = point.y + (dx * sin + dy * cos); + for (i = 0; i < verticesLength; i++) { + vertex = vertices[i]; + dx = vertex.x - pointX; + dy = vertex.y - pointY; + vertex.x = pointX + (dx * cos - dy * sin); + vertex.y = pointY + (dx * sin + dy * cos); } return vertices; @@ -157004,12 +158222,21 @@ var Common = __webpack_require__(68758); * @return {boolean} True if the vertices contains point, otherwise false */ Vertices.contains = function(vertices, point) { - for (var i = 0; i < vertices.length; i++) { - var vertice = vertices[i], - nextVertice = vertices[(i + 1) % vertices.length]; - if ((point.x - vertice.x) * (nextVertice.y - vertice.y) + (point.y - vertice.y) * (vertice.x - nextVertice.x) > 0) { + var pointX = point.x, + pointY = point.y, + verticesLength = vertices.length, + vertex = vertices[verticesLength - 1], + nextVertex; + + for (var i = 0; i < verticesLength; i++) { + nextVertex = vertices[i]; + + if ((pointX - vertex.x) * (nextVertex.y - vertex.y) + + (pointY - vertex.y) * (vertex.x - nextVertex.x) > 0) { return false; } + + vertex = nextVertex; } return true; @@ -157248,7 +158475,7 @@ var MatterAttractors = { name: 'matter-attractors', version: '0.1.7', - for: 'matter-js@^0.14.2', + for: 'matter-js@^0.18.0', silent: true, // installs the plugin where `base` is `Matter` @@ -157407,7 +158634,7 @@ var MatterCollisionEvents = { name: 'matter-collision-events', version: '0.1.6', - for: 'matter-js@^0.14.2', + for: 'matter-js@^0.18.0', silent: true, install: function (matter) @@ -157542,7 +158769,7 @@ var MatterWrap = { // plugin meta name: 'matter-wrap', // PLUGIN_NAME version: '0.1.4', // PLUGIN_VERSION - for: 'matter-js@^0.14.2', + for: 'matter-js@^0.18.0', silent: true, // no console log please // installs the plugin where `base` is `Matter` @@ -157623,8 +158850,8 @@ var MatterWrap = { Body: { /** - * Wraps the `body` position such that it always stays within the given bounds. - * Upon crossing a boundary the body will appear on the opposite side of the bounds, + * Wraps the `body` position such that it always stays within the given bounds. + * Upon crossing a boundary the body will appear on the opposite side of the bounds, * while maintaining its velocity. * This is called automatically by the plugin. * @function MatterWrap.Body.wrap @@ -157654,7 +158881,7 @@ var MatterWrap = { bounds: function(composite) { var bodies = Matter.Composite.allBodies(composite), vertices = []; - + for (var i = 0; i < bodies.length; i += 1) { var body = bodies[i]; vertices.push(body.bounds.min, body.bounds.max); @@ -157664,8 +158891,8 @@ var MatterWrap = { }, /** - * Wraps the `composite` position such that it always stays within the given bounds. - * Upon crossing a boundary the composite will appear on the opposite side of the bounds, + * Wraps the `composite` position such that it always stays within the given bounds. + * Upon crossing a boundary the composite will appear on the opposite side of the bounds, * while maintaining its velocity. * This is called automatically by the plugin. * @function MatterWrap.Composite.wrap @@ -157675,7 +158902,7 @@ var MatterWrap = { */ wrap: function(composite, bounds) { var translation = MatterWrap.Bounds.wrap( - MatterWrap.Composite.bounds(composite), + MatterWrap.Composite.bounds(composite), bounds ); @@ -157696,19 +158923,20 @@ module.exports = MatterWrap; */ /** - * This plugin adds a new property `body.plugin.wrap` to instances of `Matter.Body`. + * This plugin adds a new property `body.plugin.wrap` to instances of `Matter.Body`. * This is a `Matter.Bounds` instance that specifies the wrapping region. * @property {Matter.Bounds} body.plugin.wrap * @memberof Matter.Body */ /** - * This plugin adds a new property `composite.plugin.wrap` to instances of `Matter.Composite`. + * This plugin adds a new property `composite.plugin.wrap` to instances of `Matter.Composite`. * This is a `Matter.Bounds` instance that specifies the wrapping region. * @property {Matter.Bounds} composite.plugin.wrap * @memberof Matter.Composite */ + /***/ }), /***/ 81084: @@ -158387,7 +159615,7 @@ function points_eq(a,b,precision){ /** * @author Richard Davey -* @copyright 2020 Photon Storm Ltd. +* @copyright 2022 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} */ @@ -158518,13 +159746,13 @@ module.exports = BasePlugin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Default Plugins. - * + * * @namespace Phaser.Plugins.DefaultPlugins * @memberof Phaser.Plugins * @since 3.0.0 @@ -158621,7 +159849,7 @@ module.exports = DefaultPlugins; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -158647,7 +159875,7 @@ var PluginCache = {}; * * @method Phaser.Plugins.PluginCache.register * @since 3.8.0 - * + * * @param {string} key - A reference used to get this plugin from the plugin cache. * @param {function} plugin - The plugin to be stored. Should be the core object, not instantiated. * @param {string} mapping - If this plugin is to be injected into the Scene Systems, this is the property key map used. @@ -158666,7 +159894,7 @@ PluginCache.register = function (key, plugin, mapping, custom) * * @method Phaser.Plugins.PluginCache.registerCustom * @since 3.8.0 - * + * * @param {string} key - A reference used to get this plugin from the plugin cache. * @param {function} plugin - The plugin to be stored. Should be the core object, not instantiated. * @param {string} mapping - If this plugin is to be injected into the Scene Systems, this is the property key map used. @@ -158682,7 +159910,7 @@ PluginCache.registerCustom = function (key, plugin, mapping, data) * * @method Phaser.Plugins.PluginCache.hasCore * @since 3.8.0 - * + * * @param {string} key - The key to check for. * * @return {boolean} `true` if the key is already in use in the core cache, otherwise `false`. @@ -158697,7 +159925,7 @@ PluginCache.hasCore = function (key) * * @method Phaser.Plugins.PluginCache.hasCustom * @since 3.8.0 - * + * * @param {string} key - The key to check for. * * @return {boolean} `true` if the key is already in use in the custom cache, otherwise `false`. @@ -158712,7 +159940,7 @@ PluginCache.hasCustom = function (key) * * @method Phaser.Plugins.PluginCache.getCore * @since 3.8.0 - * + * * @param {string} key - The key of the core plugin to get. * * @return {Phaser.Types.Plugins.CorePluginContainer} The core plugin object. @@ -158727,7 +159955,7 @@ PluginCache.getCore = function (key) * * @method Phaser.Plugins.PluginCache.getCustom * @since 3.8.0 - * + * * @param {string} key - The key of the custom plugin to get. * * @return {Phaser.Types.Plugins.CustomPluginContainer} The custom plugin object. @@ -158742,7 +159970,7 @@ PluginCache.getCustom = function (key) * * @method Phaser.Plugins.PluginCache.getCustomClass * @since 3.8.0 - * + * * @param {string} key - The key of the custom plugin to get. * * @return {function} The custom plugin object. @@ -158757,7 +159985,7 @@ PluginCache.getCustomClass = function (key) * * @method Phaser.Plugins.PluginCache.remove * @since 3.8.0 - * + * * @param {string} key - The key of the core plugin to remove. */ PluginCache.remove = function (key) @@ -158773,7 +160001,7 @@ PluginCache.remove = function (key) * * @method Phaser.Plugins.PluginCache.removeCustom * @since 3.8.0 - * + * * @param {string} key - The key of the custom plugin to remove. */ PluginCache.removeCustom = function (key) @@ -158786,7 +160014,7 @@ PluginCache.removeCustom = function (key) /** * Removes all Core Plugins. - * + * * This includes all of the internal system plugins that Phaser needs, like the Input Plugin and Loader Plugin. * So be sure you only call this if you do not wish to run Phaser again. * @@ -158831,7 +160059,7 @@ module.exports = PluginCache; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -159739,7 +160967,7 @@ module.exports = PluginManager; /** * @author Richard Davey -* @copyright 2020 Photon Storm Ltd. +* @copyright 2022 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} */ @@ -159882,7 +161110,7 @@ module.exports = ScenePlugin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -160211,6 +161439,8 @@ if (typeof window.Uint32Array !== 'function' && typeof window.Uint32Array !== 'o CheapArray('Uint16Array'); // jshint ignore:line CheapArray('Int16Array'); // jshint ignore:line CheapArray('ArrayBuffer'); // jshint ignore:line + CheapArray('Int8Array'); // jshint ignore:line + CheapArray('Uint8Array'); // jshint ignore:line } @@ -160348,13 +161578,13 @@ if (!window.cancelAnimationFrame) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Phaser Blend Modes. - * + * * @namespace Phaser.BlendModes * @since 3.0.0 */ @@ -160363,7 +161593,7 @@ module.exports = { /** * Skips the Blend Mode check in the renderer. - * + * * @name Phaser.BlendModes.SKIP_CHECK * @type {number} * @const @@ -160374,7 +161604,7 @@ module.exports = { /** * Normal blend mode. For Canvas and WebGL. * This is the default setting and draws new shapes on top of the existing canvas content. - * + * * @name Phaser.BlendModes.NORMAL * @type {number} * @const @@ -160385,7 +161615,7 @@ module.exports = { /** * Add blend mode. For Canvas and WebGL. * Where both shapes overlap the color is determined by adding color values. - * + * * @name Phaser.BlendModes.ADD * @type {number} * @const @@ -160396,7 +161626,7 @@ module.exports = { /** * Multiply blend mode. For Canvas and WebGL. * The pixels are of the top layer are multiplied with the corresponding pixel of the bottom layer. A darker picture is the result. - * + * * @name Phaser.BlendModes.MULTIPLY * @type {number} * @const @@ -160407,7 +161637,7 @@ module.exports = { /** * Screen blend mode. For Canvas and WebGL. * The pixels are inverted, multiplied, and inverted again. A lighter picture is the result (opposite of multiply) - * + * * @name Phaser.BlendModes.SCREEN * @type {number} * @const @@ -160418,7 +161648,7 @@ module.exports = { /** * Overlay blend mode. For Canvas only. * A combination of multiply and screen. Dark parts on the base layer become darker, and light parts become lighter. - * + * * @name Phaser.BlendModes.OVERLAY * @type {number} * @const @@ -160429,7 +161659,7 @@ module.exports = { /** * Darken blend mode. For Canvas only. * Retains the darkest pixels of both layers. - * + * * @name Phaser.BlendModes.DARKEN * @type {number} * @const @@ -160440,7 +161670,7 @@ module.exports = { /** * Lighten blend mode. For Canvas only. * Retains the lightest pixels of both layers. - * + * * @name Phaser.BlendModes.LIGHTEN * @type {number} * @const @@ -160451,7 +161681,7 @@ module.exports = { /** * Color Dodge blend mode. For Canvas only. * Divides the bottom layer by the inverted top layer. - * + * * @name Phaser.BlendModes.COLOR_DODGE * @type {number} * @const @@ -160462,7 +161692,7 @@ module.exports = { /** * Color Burn blend mode. For Canvas only. * Divides the inverted bottom layer by the top layer, and then inverts the result. - * + * * @name Phaser.BlendModes.COLOR_BURN * @type {number} * @const @@ -160473,7 +161703,7 @@ module.exports = { /** * Hard Light blend mode. For Canvas only. * A combination of multiply and screen like overlay, but with top and bottom layer swapped. - * + * * @name Phaser.BlendModes.HARD_LIGHT * @type {number} * @const @@ -160484,7 +161714,7 @@ module.exports = { /** * Soft Light blend mode. For Canvas only. * A softer version of hard-light. Pure black or white does not result in pure black or white. - * + * * @name Phaser.BlendModes.SOFT_LIGHT * @type {number} * @const @@ -160495,7 +161725,7 @@ module.exports = { /** * Difference blend mode. For Canvas only. * Subtracts the bottom layer from the top layer or the other way round to always get a positive value. - * + * * @name Phaser.BlendModes.DIFFERENCE * @type {number} * @const @@ -160506,7 +161736,7 @@ module.exports = { /** * Exclusion blend mode. For Canvas only. * Like difference, but with lower contrast. - * + * * @name Phaser.BlendModes.EXCLUSION * @type {number} * @const @@ -160517,7 +161747,7 @@ module.exports = { /** * Hue blend mode. For Canvas only. * Preserves the luma and chroma of the bottom layer, while adopting the hue of the top layer. - * + * * @name Phaser.BlendModes.HUE * @type {number} * @const @@ -160528,7 +161758,7 @@ module.exports = { /** * Saturation blend mode. For Canvas only. * Preserves the luma and hue of the bottom layer, while adopting the chroma of the top layer. - * + * * @name Phaser.BlendModes.SATURATION * @type {number} * @const @@ -160539,7 +161769,7 @@ module.exports = { /** * Color blend mode. For Canvas only. * Preserves the luma of the bottom layer, while adopting the hue and chroma of the top layer. - * + * * @name Phaser.BlendModes.COLOR * @type {number} * @const @@ -160550,7 +161780,7 @@ module.exports = { /** * Luminosity blend mode. For Canvas only. * Preserves the hue and chroma of the bottom layer, while adopting the luma of the top layer. - * + * * @name Phaser.BlendModes.LUMINOSITY * @type {number} * @const @@ -160560,7 +161790,7 @@ module.exports = { /** * Alpha erase blend mode. For Canvas and WebGL. - * + * * @name Phaser.BlendModes.ERASE * @type {number} * @const @@ -160571,7 +161801,7 @@ module.exports = { /** * Source-in blend mode. For Canvas only. * The new shape is drawn only where both the new shape and the destination canvas overlap. Everything else is made transparent. - * + * * @name Phaser.BlendModes.SOURCE_IN * @type {number} * @const @@ -160582,7 +161812,7 @@ module.exports = { /** * Source-out blend mode. For Canvas only. * The new shape is drawn where it doesn't overlap the existing canvas content. - * + * * @name Phaser.BlendModes.SOURCE_OUT * @type {number} * @const @@ -160593,7 +161823,7 @@ module.exports = { /** * Source-out blend mode. For Canvas only. * The new shape is only drawn where it overlaps the existing canvas content. - * + * * @name Phaser.BlendModes.SOURCE_ATOP * @type {number} * @const @@ -160604,7 +161834,7 @@ module.exports = { /** * Destination-over blend mode. For Canvas only. * New shapes are drawn behind the existing canvas content. - * + * * @name Phaser.BlendModes.DESTINATION_OVER * @type {number} * @const @@ -160615,7 +161845,7 @@ module.exports = { /** * Destination-in blend mode. For Canvas only. * The existing canvas content is kept where both the new shape and existing canvas content overlap. Everything else is made transparent. - * + * * @name Phaser.BlendModes.DESTINATION_IN * @type {number} * @const @@ -160626,7 +161856,7 @@ module.exports = { /** * Destination-out blend mode. For Canvas only. * The existing content is kept where it doesn't overlap the new shape. - * + * * @name Phaser.BlendModes.DESTINATION_OUT * @type {number} * @const @@ -160637,7 +161867,7 @@ module.exports = { /** * Destination-out blend mode. For Canvas only. * The existing canvas is only kept where it overlaps the new shape. The new shape is drawn behind the canvas content. - * + * * @name Phaser.BlendModes.DESTINATION_ATOP * @type {number} * @const @@ -160648,7 +161878,7 @@ module.exports = { /** * Lighten blend mode. For Canvas only. * Where both shapes overlap the color is determined by adding color values. - * + * * @name Phaser.BlendModes.LIGHTER * @type {number} * @const @@ -160659,7 +161889,7 @@ module.exports = { /** * Copy blend mode. For Canvas only. * Only the new shape is shown. - * + * * @name Phaser.BlendModes.COPY * @type {number} * @const @@ -160670,7 +161900,7 @@ module.exports = { /** * Xor blend mode. For Canvas only. * Shapes are made transparent where both overlap and drawn normal everywhere else. - * + * * @name Phaser.BlendModes.XOR * @type {number} * @const @@ -160688,13 +161918,13 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Phaser Scale Modes. - * + * * @namespace Phaser.ScaleModes * @since 3.0.0 */ @@ -160703,7 +161933,7 @@ var ScaleModes = { /** * Default Scale Mode (Linear). - * + * * @name Phaser.ScaleModes.DEFAULT * @type {number} * @readonly @@ -160713,7 +161943,7 @@ var ScaleModes = { /** * Linear Scale Mode. - * + * * @name Phaser.ScaleModes.LINEAR * @type {number} * @readonly @@ -160723,7 +161953,7 @@ var ScaleModes = { /** * Nearest Scale Mode. - * + * * @name Phaser.ScaleModes.NEAREST * @type {number} * @readonly @@ -160744,7 +161974,7 @@ module.exports = ScaleModes; /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -160857,7 +162087,8 @@ var CanvasRenderer = new Class({ var contextOptions = { alpha: game.config.transparent, - desynchronized: game.config.desynchronized + desynchronized: game.config.desynchronized, + willReadFrequently: false }; /** @@ -161554,14 +162785,17 @@ var CanvasRenderer = new Class({ ctx.globalAlpha = alpha; - ctx.imageSmoothingEnabled = !(!this.antialias || frame.source.scaleMode); + ctx.imageSmoothingEnabled = !frame.source.scaleMode; if (sprite.mask) { sprite.mask.preRenderCanvas(this, sprite, camera); } - ctx.drawImage(frame.source.image, frameX, frameY, frameWidth, frameHeight, x, y, frameWidth / res, frameHeight / res); + if (frameWidth > 0 && frameHeight > 0) + { + ctx.drawImage(frame.source.image, frameX, frameY, frameWidth, frameHeight, x, y, frameWidth / res, frameHeight / res); + } if (sprite.mask) { @@ -161598,7 +162832,7 @@ module.exports = CanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -161622,7 +162856,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -161687,7 +162921,7 @@ module.exports = GetBlendModes; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -161703,7 +162937,8 @@ var GetCalcMatrix = __webpack_require__(73329); * 4. Sets the alpha value of the context to be that used by the Game Object combined with the Camera. * 5. Saves the context state. * 6. Sets the final matrix values into the context via setTransform. - * 7. If Renderer.antialias, or the frame.source.scaleMode is set, then imageSmoothingEnabled is set. + * 7. If the Game Object has a texture frame, imageSmoothingEnabled is set based on frame.source.scaleMode. + * 8. If the Game Object does not have a texture frame, imageSmoothingEnabled is set based on Renderer.antialias. * * This function is only meant to be used internally. Most of the Canvas Renderer classes use it. * @@ -161740,7 +162975,7 @@ var SetTransform = function (renderer, ctx, src, camera, parentMatrix) calcMatrix.setToContext(ctx); - ctx.imageSmoothingEnabled = !(!renderer.antialias || (src.frame && src.frame.source.scaleMode)); + ctx.imageSmoothingEnabled = src.frame ? !src.frame.source.scaleMode : renderer.antialias; return true; }; @@ -161755,7 +162990,7 @@ module.exports = SetTransform; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -161778,7 +163013,7 @@ module.exports = 'postrender'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -161802,7 +163037,7 @@ module.exports = 'prerender'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -161829,7 +163064,7 @@ module.exports = 'render'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -161855,7 +163090,7 @@ module.exports = 'resize'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -161880,7 +163115,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -161909,7 +163144,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -161919,7 +163154,7 @@ var GetFastValue = __webpack_require__(72632); /** * Takes a snapshot of an area from the current frame displayed by a canvas. - * + * * This is then copied to an Image object. When this loads, the results are sent * to the callback provided in the Snapshot Configuration object. * @@ -161936,8 +163171,8 @@ var CanvasSnapshot = function (canvas, config) var encoderOptions = GetFastValue(config, 'encoder', 0.92); var x = Math.abs(Math.round(GetFastValue(config, 'x', 0))); var y = Math.abs(Math.round(GetFastValue(config, 'y', 0))); - var width = GetFastValue(config, 'width', canvas.width); - var height = GetFastValue(config, 'height', canvas.height); + var width = Math.floor(GetFastValue(config, 'width', canvas.width)); + var height = Math.floor(GetFastValue(config, 'height', canvas.height)); var getPixel = GetFastValue(config, 'getPixel', false); if (getPixel) @@ -161946,7 +163181,7 @@ var CanvasSnapshot = function (canvas, config) var imageData = context.getImageData(x, y, 1, 1); var data = imageData.data; - callback.call(null, new Color(data[0], data[1], data[2], data[3] / 255)); + callback.call(null, new Color(data[0], data[1], data[2], data[3])); } else if (x !== 0 || y !== 0 || width !== canvas.width || height !== canvas.height) { @@ -161954,10 +163189,13 @@ var CanvasSnapshot = function (canvas, config) var copyCanvas = CanvasPool.createWebGL(this, width, height); var ctx = copyCanvas.getContext('2d'); - ctx.drawImage(canvas, x, y, width, height, 0, 0, width, height); + if (width > 0 && height > 0) + { + ctx.drawImage(canvas, x, y, width, height, 0, 0, width, height); + } var image1 = new Image(); - + image1.onerror = function () { callback.call(null); @@ -161978,7 +163216,7 @@ var CanvasSnapshot = function (canvas, config) { // Full Grab var image2 = new Image(); - + image2.onerror = function () { callback.call(null); @@ -162003,7 +163241,7 @@ module.exports = CanvasSnapshot; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -162020,18 +163258,18 @@ var GetFastValue = __webpack_require__(72632); * @function Phaser.Renderer.Snapshot.WebGL * @since 3.0.0 * - * @param {HTMLCanvasElement} sourceCanvas - The canvas to take a snapshot of. + * @param {WebGLRenderingContext} sourceContext - The WebGL context to take a snapshot of. * @param {Phaser.Types.Renderer.Snapshot.SnapshotState} config - The snapshot configuration object. */ -var WebGLSnapshot = function (sourceCanvas, config) +var WebGLSnapshot = function (sourceContext, config) { - var gl = sourceCanvas.getContext('experimental-webgl'); + var gl = sourceContext; var callback = GetFastValue(config, 'callback'); var type = GetFastValue(config, 'type', 'image/png'); var encoderOptions = GetFastValue(config, 'encoder', 0.92); - var x = GetFastValue(config, 'x', 0); - var y = GetFastValue(config, 'y', 0); + var x = Math.abs(Math.round(GetFastValue(config, 'x', 0))); + var y = Math.abs(Math.round(GetFastValue(config, 'y', 0))); var getPixel = GetFastValue(config, 'getPixel', false); @@ -162048,12 +163286,12 @@ var WebGLSnapshot = function (sourceCanvas, config) gl.readPixels(x, destY, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixel); - callback.call(null, new Color(pixel[0], pixel[1], pixel[2], pixel[3] / 255)); + callback.call(null, new Color(pixel[0], pixel[1], pixel[2], pixel[3])); } else { - var width = GetFastValue(config, 'width', bufferWidth); - var height = GetFastValue(config, 'height', bufferHeight); + var width = Math.floor(GetFastValue(config, 'width', bufferWidth)); + var height = Math.floor(GetFastValue(config, 'height', bufferHeight)); var total = width * height * 4; @@ -162116,7 +163354,7 @@ module.exports = WebGLSnapshot; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -162139,7 +163377,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -162152,7 +163390,6 @@ var SnapCeil = __webpack_require__(82127); // Default Phaser 3 Pipelines var BitmapMaskPipeline = __webpack_require__(5583); -var GraphicsPipeline = __webpack_require__(67589); var LightPipeline = __webpack_require__(66901); var MultiPipeline = __webpack_require__(77310); var PointLightPipeline = __webpack_require__(10919); @@ -162168,16 +163405,15 @@ var UtilityPipeline = __webpack_require__(60848); * The `WebGLRenderer` owns a single instance of the Pipeline Manager, which you can access * via the `WebGLRenderer.pipelines` property. * - * By default, there are 8 pipelines installed into the Pipeline Manager when Phaser boots: + * By default, there are 7 pipelines installed into the Pipeline Manager when Phaser boots: * * 1. The Multi Pipeline. Responsible for all multi-texture rendering, i.e. Sprites and Tilemaps. - * 2. The Graphics Pipeline. Responsible for rendering Graphics and Shape objects. - * 3. The Rope Pipeline. Responsible for rendering the Rope Game Object. - * 4. The Light Pipeline. Responsible for rendering the Light Game Object. - * 5. The Point Light Pipeline. Responsible for rendering the Point Light Game Object. - * 6. The Single Pipeline. Responsible for rendering Game Objects that explicitly require one bound texture. - * 7. The Bitmap Mask Pipeline. Responsible for Bitmap Mask rendering. - * 8. The Utility Pipeline. Responsible for providing lots of handy texture manipulation functions. + * 2. The Rope Pipeline. Responsible for rendering the Rope Game Object. + * 3. The Light Pipeline. Responsible for rendering the Light Game Object. + * 4. The Point Light Pipeline. Responsible for rendering the Point Light Game Object. + * 5. The Single Pipeline. Responsible for rendering Game Objects that explicitly require one bound texture. + * 6. The Bitmap Mask Pipeline. Responsible for Bitmap Mask rendering. + * 7. The Utility Pipeline. Responsible for providing lots of handy texture manipulation functions. * * You can add your own custom pipeline via the `PipelineManager.add` method. Pipelines are * identified by unique string-based keys. @@ -162229,8 +163465,7 @@ var PipelineManager = new Class({ [ CONST.SINGLE_PIPELINE, SinglePipeline ], [ CONST.ROPE_PIPELINE, RopePipeline ], [ CONST.LIGHT_PIPELINE, LightPipeline ], - [ CONST.POINTLIGHT_PIPELINE, PointLightPipeline ], - [ CONST.GRAPHICS_PIPELINE, GraphicsPipeline ] + [ CONST.POINTLIGHT_PIPELINE, PointLightPipeline ] ]); /** @@ -163408,7 +164643,7 @@ module.exports = PipelineManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -163781,7 +165016,7 @@ module.exports = RenderTarget; * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> * @author Matthew Groves <@doormat> - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -163905,8 +165140,9 @@ module.exports = { }, /** - * Checks the given Fragment Shader Source for `%count%` declarations and - * replaces those with GLSL code for setting `texture = texture2D(uMainSampler[i], outTexCoord)`. + * Checks the given Fragment Shader Source for `%count%` and `%getSampler%` declarations and + * replaces those with GLSL code for setting `texture = texture2D(uMainSampler[i], outTexCoord)` + * and injecting the `getSampler` glsl function. * * @function Phaser.Renderer.WebGL.Utils.parseFragmentShaderMaxTextures * @since 3.50.0 @@ -163923,6 +165159,22 @@ module.exports = { return ''; } + var src = 'vec4 getSampler (int index, vec2 uv) {'; + + for (var i = 0; i < maxTextures; i++) + { + if (i > 0 && i < maxTextures) + { + src += '\nelse '; + } + + src += 'if (index == ' + i + ') { return texture2D(uMainSampler[' + i + '], uv); }'; + } + + src += '\nreturn vec4(0);\n}'; + + fragmentShaderSource = fragmentShaderSource.replace(/%getSampler%/gi, src); + return fragmentShaderSource.replace(/%count%/gi, maxTextures.toString()); } }; @@ -163935,7 +165187,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -165543,6 +166795,33 @@ var WebGLPipeline = new Class({ return this; }, + /** + * Sets a boolean uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setBoolean + * @since 3.60.0 + * + * @param {string} name - The name of the uniform to set. + * @param {boolean} value - The new value of the `boolean` uniform. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + setBoolean: function (name, value, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.setBoolean(name, value); + + return this; + }, + /** * Sets a 1f uniform value based on the given name on the currently set shader. * @@ -166142,7 +167421,7 @@ module.exports = WebGLPipeline; /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -166208,7 +167487,8 @@ var WebGLRenderer = new Class({ stencil: true, failIfMajorPerformanceCaveat: gameConfig.failIfMajorPerformanceCaveat, powerPreference: gameConfig.powerPreference, - preserveDrawingBuffer: gameConfig.preserveDrawingBuffer + preserveDrawingBuffer: gameConfig.preserveDrawingBuffer, + willReadFrequently: false }; /** @@ -166691,7 +167971,7 @@ var WebGLRenderer = new Class({ * * You can specify this as a string in the game config, i.e.: * - * `renderer: { mipmapFilter: 'NEAREST_MIPMAP_LINEAR' }` + * `render: { mipmapFilter: 'NEAREST_MIPMAP_LINEAR' }` * * The 6 options for WebGL1 are, in order from least to most computationally expensive: * @@ -167720,6 +169000,7 @@ var WebGLRenderer = new Class({ gl.bindTexture(gl.TEXTURE_2D, texture); this.textureZero = texture; + this.isTextureClean = false; } }, @@ -168213,7 +169494,11 @@ var WebGLRenderer = new Class({ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, wrapT); gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, pma); - gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY); + + if (flipY) + { + gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true); + } var generateMipmap = false; @@ -168313,7 +169598,7 @@ var WebGLRenderer = new Class({ 36061: 'Framebuffer Unsupported' }; - throw new Error('Framebuffer status: ' + errors[complete]); + throw new Error('Framebuffer status: ' + (errors[complete] || complete)); } framebuffer.renderTexture = renderTexture; @@ -168791,7 +170076,7 @@ var WebGLRenderer = new Class({ if (state.callback) { - WebGLSnapshot(this.canvas, state); + WebGLSnapshot(this.gl, state); state.callback = null; } @@ -168951,7 +170236,7 @@ var WebGLRenderer = new Class({ this.setFramebuffer(framebuffer); - WebGLSnapshot(this.canvas, state); + WebGLSnapshot(this.gl, state); this.setFramebuffer(currentFramebuffer); @@ -169060,7 +170345,11 @@ var WebGLRenderer = new Class({ var currentTexture = gl.getParameter(gl.TEXTURE_BINDING_2D); gl.bindTexture(gl.TEXTURE_2D, dstTexture); - gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY); + if (flipY) + { + gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true); + } + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, srcCanvas); @@ -169259,7 +170548,7 @@ module.exports = WebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -169336,6 +170625,24 @@ var WebGLShader = new Class({ */ this.gl = this.renderer.gl; + /** + * The fragment shader source code. + * + * @name Phaser.Renderer.WebGL.WebGLShader#fragSrc + * @type {string} + * @since 3.60.0 + */ + this.fragSrc = fragmentShader; + + /** + * The vertex shader source code. + * + * @name Phaser.Renderer.WebGL.WebGLShader#vertSrc + * @type {string} + * @since 3.60.0 + */ + this.vertSrc = vertexShader; + /** * The WebGLProgram created from the vertex and fragment shaders. * @@ -169900,6 +171207,28 @@ var WebGLShader = new Class({ return this; }, + /** + * Sets a boolean uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#setBoolean + * @since 3.60.0 + * + * @param {string} name - The name of the uniform to set. + * @param {boolean} value - The new value of the `boolean` uniform. + * + * @return {this} This WebGLShader instance. + */ + setBoolean: function (name, value) + { + return this.setUniform1(this.gl.uniform1i, name, Number(value)); + }, + /** * Sets a 1f uniform value based on the given name on this shader. * @@ -170333,6 +171662,51 @@ var WebGLShader = new Class({ return this.setUniform2(this.gl.uniformMatrix4fv, name, transpose, matrix, true); }, + /** + * This method will create the Shader Program on the current GL context. + * + * If a program already exists, it will be destroyed and the new one will take its place. + * + * After the program is created the uniforms will be reset and + * this shader will be rebound. + * + * This is a very expensive process and if your shader is referenced elsewhere in + * your game those references may then be lost, so be sure to use this carefully. + * + * However, if you need to update say the fragment shader source, then you can pass + * the new source into this method and it'll rebuild the program using it. If you + * don't want to change the vertex shader src, pass `undefined` as the parameter. + * + * @method Phaser.Renderer.WebGL.WebGLShader#createProgram + * @since 3.60.0 + * + * @param {string} [vertSrc] - The source code of the vertex shader. If not given, uses the source already defined in this Shader. + * @param {string} [fragSrc] - The source code of the fragment shader. If not given, uses the source already defined in this Shader. + * + * @return {this} This WebGLShader instance. + */ + createProgram: function (vertSrc, fragSrc) + { + if (vertSrc === undefined) { vertSrc = this.vertSrc; } + if (fragSrc === undefined) { fragSrc = this.fragSrc; } + + var gl = this.gl; + + if (this.program) + { + gl.deleteProgram(this.program); + } + + this.vertSrc = vertSrc; + this.fragSrc = fragSrc; + + this.program = this.renderer.createProgram(vertSrc, fragSrc); + + this.createUniforms(); + + return this.rebind(); + }, + /** * Removes all external references from this class and deletes the WebGL program from the WebGL context. * @@ -170365,7 +171739,7 @@ module.exports = WebGLShader; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -170446,7 +171820,7 @@ module.exports = WEBGL_CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -170486,7 +171860,7 @@ module.exports = WebGL; /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -170677,690 +172051,6 @@ var BitmapMaskPipeline = new Class({ module.exports = BitmapMaskPipeline; -/***/ }), - -/***/ 67589: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(56694); -var Earcut = __webpack_require__(11117); -var GetFastValue = __webpack_require__(72632); -var ShaderSourceFS = __webpack_require__(37699); -var ShaderSourceVS = __webpack_require__(28739); -var TransformMatrix = __webpack_require__(69360); -var WEBGL_CONST = __webpack_require__(71402); -var WebGLPipeline = __webpack_require__(44775); - -/** - * @classdesc - * The Graphics Pipeline is the rendering pipeline used by Phaser in WebGL when drawing - * primitive geometry objects, such as the Graphics Game Object, or the Shape Game Objects - * such as Arc, Line, Rectangle and Star. It handles the preperation and batching of related vertices. - * - * Prior to Phaser v3.50 the functions of this pipeline were merged with the `TextureTintPipeline`. - * - * The fragment shader it uses can be found in `shaders/src/Graphics.frag`. - * The vertex shader it uses can be found in `shaders/src/Graphics.vert`. - * - * The default shader attributes for this pipeline are: - * - * `inPosition` (vec2) - * `inColor` (vec4, normalized) - * - * The default shader uniforms for this pipeline are: - * - * `uProjectionMatrix` (mat4) - * - * @class GraphicsPipeline - * @extends Phaser.Renderer.WebGL.WebGLPipeline - * @memberof Phaser.Renderer.WebGL.Pipelines - * @constructor - * @since 3.50.0 - * - * @param {Phaser.Types.Renderer.WebGL.WebGLPipelineConfig} config - The configuration options for this pipeline. - */ -var GraphicsPipeline = new Class({ - - Extends: WebGLPipeline, - - initialize: - - function GraphicsPipeline (config) - { - config.fragShader = GetFastValue(config, 'fragShader', ShaderSourceFS); - config.vertShader = GetFastValue(config, 'vertShader', ShaderSourceVS); - config.attributes = GetFastValue(config, 'attributes', [ - { - name: 'inPosition', - size: 2 - }, - { - name: 'inColor', - size: 4, - type: WEBGL_CONST.UNSIGNED_BYTE, - normalized: true - } - ]); - - WebGLPipeline.call(this, config); - - /** - * A temporary Transform Matrix, re-used internally during batching by the - * Shape Game Objects. - * - * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#calcMatrix - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.50.0 - */ - this.calcMatrix = new TransformMatrix(); - - /** - * Used internally to draw stroked triangles. - * - * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#tempTriangle - * @type {array} - * @private - * @since 3.50.0 - */ - this.tempTriangle = [ - { x: 0, y: 0, width: 0 }, - { x: 0, y: 0, width: 0 }, - { x: 0, y: 0, width: 0 }, - { x: 0, y: 0, width: 0 } - ]; - - /** - * Cached stroke tint. - * - * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#strokeTint - * @type {object} - * @private - * @since 3.50.0 - */ - this.strokeTint = { TL: 0, TR: 0, BL: 0, BR: 0 }; - - /** - * Cached fill tint. - * - * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#fillTint - * @type {object} - * @private - * @since 3.50.0 - */ - this.fillTint = { TL: 0, TR: 0, BL: 0, BR: 0 }; - - /** - * Internal texture frame reference. - * - * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#currentFrame - * @type {Phaser.Textures.Frame} - * @private - * @since 3.50.0 - */ - this.currentFrame = { u0: 0, v0: 0, u1: 1, v1: 1 }; - - /** - * Internal path quad cache. - * - * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#firstQuad - * @type {number[]} - * @private - * @since 3.50.0 - */ - this.firstQuad = [ 0, 0, 0, 0, 0 ]; - - /** - * Internal path quad cache. - * - * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#prevQuad - * @type {number[]} - * @private - * @since 3.50.0 - */ - this.prevQuad = [ 0, 0, 0, 0, 0 ]; - - /** - * Used internally for triangulating a polygon. - * - * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#polygonCache - * @type {array} - * @private - * @since 3.50.0 - */ - this.polygonCache = []; - }, - - /** - * Pushes a filled rectangle into the vertex batch. - * - * Rectangle factors in the given transform matrices before adding to the batch. - * - * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchFillRect - * @since 3.50.0 - * - * @param {number} x - Horizontal top left coordinate of the rectangle. - * @param {number} y - Vertical top left coordinate of the rectangle. - * @param {number} width - Width of the rectangle. - * @param {number} height - Height of the rectangle. - * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. - */ - batchFillRect: function (x, y, width, height, currentMatrix, parentMatrix) - { - this.renderer.pipelines.set(this); - - var calcMatrix = this.calcMatrix; - - // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix - if (parentMatrix) - { - parentMatrix.multiply(currentMatrix, calcMatrix); - } - - var xw = x + width; - var yh = y + height; - - var x0 = calcMatrix.getX(x, y); - var y0 = calcMatrix.getY(x, y); - - var x1 = calcMatrix.getX(x, yh); - var y1 = calcMatrix.getY(x, yh); - - var x2 = calcMatrix.getX(xw, yh); - var y2 = calcMatrix.getY(xw, yh); - - var x3 = calcMatrix.getX(xw, y); - var y3 = calcMatrix.getY(xw, y); - - var tint = this.fillTint; - - this.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, tint.TL, tint.TR, tint.BL, tint.BR); - }, - - /** - * Pushes a filled triangle into the vertex batch. - * - * Triangle factors in the given transform matrices before adding to the batch. - * - * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchFillTriangle - * @since 3.50.0 - * - * @param {number} x0 - Point 0 x coordinate. - * @param {number} y0 - Point 0 y coordinate. - * @param {number} x1 - Point 1 x coordinate. - * @param {number} y1 - Point 1 y coordinate. - * @param {number} x2 - Point 2 x coordinate. - * @param {number} y2 - Point 2 y coordinate. - * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. - */ - batchFillTriangle: function (x0, y0, x1, y1, x2, y2, currentMatrix, parentMatrix) - { - this.renderer.pipelines.set(this); - - var calcMatrix = this.calcMatrix; - - // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix - if (parentMatrix) - { - parentMatrix.multiply(currentMatrix, calcMatrix); - } - - var tx0 = calcMatrix.getX(x0, y0); - var ty0 = calcMatrix.getY(x0, y0); - - var tx1 = calcMatrix.getX(x1, y1); - var ty1 = calcMatrix.getY(x1, y1); - - var tx2 = calcMatrix.getX(x2, y2); - var ty2 = calcMatrix.getY(x2, y2); - - var tint = this.fillTint; - - this.batchTri(tx0, ty0, tx1, ty1, tx2, ty2, tint.TL, tint.TR, tint.BL); - }, - - /** - * Pushes a stroked triangle into the vertex batch. - * - * Triangle factors in the given transform matrices before adding to the batch. - * - * The triangle is created from 3 lines and drawn using the `batchStrokePath` method. - * - * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchStrokeTriangle - * @since 3.50.0 - * - * @param {number} x0 - Point 0 x coordinate. - * @param {number} y0 - Point 0 y coordinate. - * @param {number} x1 - Point 1 x coordinate. - * @param {number} y1 - Point 1 y coordinate. - * @param {number} x2 - Point 2 x coordinate. - * @param {number} y2 - Point 2 y coordinate. - * @param {number} lineWidth - The width of the line in pixels. - * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. - */ - batchStrokeTriangle: function (x0, y0, x1, y1, x2, y2, lineWidth, currentMatrix, parentMatrix) - { - var tempTriangle = this.tempTriangle; - - tempTriangle[0].x = x0; - tempTriangle[0].y = y0; - tempTriangle[0].width = lineWidth; - - tempTriangle[1].x = x1; - tempTriangle[1].y = y1; - tempTriangle[1].width = lineWidth; - - tempTriangle[2].x = x2; - tempTriangle[2].y = y2; - tempTriangle[2].width = lineWidth; - - tempTriangle[3].x = x0; - tempTriangle[3].y = y0; - tempTriangle[3].width = lineWidth; - - this.batchStrokePath(tempTriangle, lineWidth, false, currentMatrix, parentMatrix); - }, - - /** - * Adds the given path to the vertex batch for rendering. - * - * It works by taking the array of path data and then passing it through Earcut, which - * creates a list of polygons. Each polygon is then added to the batch. - * - * The path is always automatically closed because it's filled. - * - * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchFillPath - * @since 3.50.0 - * - * @param {Phaser.Types.Math.Vector2Like[]} path - Collection of points that represent the path. - * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. - */ - batchFillPath: function (path, currentMatrix, parentMatrix) - { - this.renderer.pipelines.set(this); - - var calcMatrix = this.calcMatrix; - - // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix - if (parentMatrix) - { - parentMatrix.multiply(currentMatrix, calcMatrix); - } - - var length = path.length; - var polygonCache = this.polygonCache; - var polygonIndexArray; - var point; - - var tintTL = this.fillTint.TL; - var tintTR = this.fillTint.TR; - var tintBL = this.fillTint.BL; - - for (var pathIndex = 0; pathIndex < length; ++pathIndex) - { - point = path[pathIndex]; - polygonCache.push(point.x, point.y); - } - - polygonIndexArray = Earcut(polygonCache); - length = polygonIndexArray.length; - - for (var index = 0; index < length; index += 3) - { - var p0 = polygonIndexArray[index + 0] * 2; - var p1 = polygonIndexArray[index + 1] * 2; - var p2 = polygonIndexArray[index + 2] * 2; - - var x0 = polygonCache[p0 + 0]; - var y0 = polygonCache[p0 + 1]; - var x1 = polygonCache[p1 + 0]; - var y1 = polygonCache[p1 + 1]; - var x2 = polygonCache[p2 + 0]; - var y2 = polygonCache[p2 + 1]; - - var tx0 = calcMatrix.getX(x0, y0); - var ty0 = calcMatrix.getY(x0, y0); - - var tx1 = calcMatrix.getX(x1, y1); - var ty1 = calcMatrix.getY(x1, y1); - - var tx2 = calcMatrix.getX(x2, y2); - var ty2 = calcMatrix.getY(x2, y2); - - this.batchTri(tx0, ty0, tx1, ty1, tx2, ty2, tintTL, tintTR, tintBL); - } - - polygonCache.length = 0; - }, - - /** - * Adds the given path to the vertex batch for rendering. - * - * It works by taking the array of path data and calling `batchLine` for each section - * of the path. - * - * The path is optionally closed at the end. - * - * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchStrokePath - * @since 3.50.0 - * - * @param {Phaser.Types.Math.Vector2Like[]} path - Collection of points that represent the path. - * @param {number} lineWidth - The width of the line segments in pixels. - * @param {boolean} pathOpen - Indicates if the path should be closed or left open. - * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. - */ - batchStrokePath: function (path, lineWidth, pathOpen, currentMatrix, parentMatrix) - { - this.renderer.pipelines.set(this); - - // Reset the closePath booleans - this.prevQuad[4] = 0; - this.firstQuad[4] = 0; - - var pathLength = path.length - 1; - - for (var pathIndex = 0; pathIndex < pathLength; pathIndex++) - { - var point0 = path[pathIndex]; - var point1 = path[pathIndex + 1]; - - this.batchLine( - point0.x, - point0.y, - point1.x, - point1.y, - point0.width / 2, - point1.width / 2, - lineWidth, - pathIndex, - !pathOpen && (pathIndex === pathLength - 1), - currentMatrix, - parentMatrix - ); - } - }, - - /** - * Creates a line out of 4 quads and adds it to the vertex batch based on the given line values. - * - * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchLine - * @since 3.50.0 - * - * @param {number} ax - x coordinate of the start of the line. - * @param {number} ay - y coordinate of the start of the line. - * @param {number} bx - x coordinate of the end of the line. - * @param {number} by - y coordinate of the end of the line. - * @param {number} aLineWidth - Width of the start of the line. - * @param {number} bLineWidth - Width of the end of the line. - * @param {number} index - If this line is part of a multi-line draw, the index of the line in the draw. - * @param {boolean} closePath - Does this line close a multi-line path? - * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. - */ - batchLine: function (ax, ay, bx, by, aLineWidth, bLineWidth, lineWidth, index, closePath, currentMatrix, parentMatrix) - { - this.renderer.pipelines.set(this); - - var calcMatrix = this.calcMatrix; - - // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix - if (parentMatrix) - { - parentMatrix.multiply(currentMatrix, calcMatrix); - } - - var dx = bx - ax; - var dy = by - ay; - - var len = Math.sqrt(dx * dx + dy * dy); - var al0 = aLineWidth * (by - ay) / len; - var al1 = aLineWidth * (ax - bx) / len; - var bl0 = bLineWidth * (by - ay) / len; - var bl1 = bLineWidth * (ax - bx) / len; - - var lx0 = bx - bl0; - var ly0 = by - bl1; - var lx1 = ax - al0; - var ly1 = ay - al1; - var lx2 = bx + bl0; - var ly2 = by + bl1; - var lx3 = ax + al0; - var ly3 = ay + al1; - - // tx0 = bottom right - var brX = calcMatrix.getX(lx0, ly0); - var brY = calcMatrix.getY(lx0, ly0); - - // tx1 = bottom left - var blX = calcMatrix.getX(lx1, ly1); - var blY = calcMatrix.getY(lx1, ly1); - - // tx2 = top right - var trX = calcMatrix.getX(lx2, ly2); - var trY = calcMatrix.getY(lx2, ly2); - - // tx3 = top left - var tlX = calcMatrix.getX(lx3, ly3); - var tlY = calcMatrix.getY(lx3, ly3); - - var tint = this.strokeTint; - - var tintTL = tint.TL; - var tintTR = tint.TR; - var tintBL = tint.BL; - var tintBR = tint.BR; - - // TL, BL, BR, TR - this.batchQuad(tlX, tlY, blX, blY, brX, brY, trX, trY, tintTL, tintTR, tintBL, tintBR); - - if (lineWidth <= 2) - { - // No point doing a linejoin if the line isn't thick enough - return; - } - - var prev = this.prevQuad; - var first = this.firstQuad; - - if (index > 0 && prev[4]) - { - this.batchQuad(tlX, tlY, blX, blY, prev[0], prev[1], prev[2], prev[3], tintTL, tintTR, tintBL, tintBR); - } - else - { - first[0] = tlX; - first[1] = tlY; - first[2] = blX; - first[3] = blY; - first[4] = 1; - } - - if (closePath && first[4]) - { - // Add a join for the final path segment - this.batchQuad(brX, brY, trX, trY, first[0], first[1], first[2], first[3], tintTL, tintTR, tintBL, tintBR); - } - else - { - // Store it - - prev[0] = brX; - prev[1] = brY; - prev[2] = trX; - prev[3] = trY; - prev[4] = 1; - } - }, - - /** - * Adds a single vertex to the current vertex buffer and increments the - * `vertexCount` property by 1. - * - * This method is called directly by `batchTri` and `batchQuad`. - * - * It does not perform any batch limit checking itself, so if you need to call - * this method directly, do so in the same way that `batchQuad` does, for example. - * - * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchVert - * @since 3.50.0 - * - * @param {number} x - The vertex x position. - * @param {number} y - The vertex y position. - * @param {number} tint - The tint color value. - */ - batchVert: function (x, y, tint) - { - var vertexViewF32 = this.vertexViewF32; - var vertexViewU32 = this.vertexViewU32; - - var vertexOffset = (this.vertexCount * this.currentShader.vertexComponentCount) - 1; - - vertexViewF32[++vertexOffset] = x; - vertexViewF32[++vertexOffset] = y; - vertexViewU32[++vertexOffset] = tint; - - this.vertexCount++; - }, - - /** - * Adds the vertices data into the batch and flushes if full. - * - * Assumes 6 vertices in the following arrangement: - * - * ``` - * 0----3 - * |\ B| - * | \ | - * | \ | - * | A \| - * | \ - * 1----2 - * ``` - * - * Where tx0/ty0 = 0, tx1/ty1 = 1, tx2/ty2 = 2 and tx3/ty3 = 3 - * - * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchQuad - * @override - * @since 3.50.0 - * - * @param {number} x0 - The top-left x position. - * @param {number} y0 - The top-left y position. - * @param {number} x1 - The bottom-left x position. - * @param {number} y1 - The bottom-left y position. - * @param {number} x2 - The bottom-right x position. - * @param {number} y2 - The bottom-right y position. - * @param {number} x3 - The top-right x position. - * @param {number} y3 - The top-right y position. - * @param {number} tintTL - The top-left tint color value. - * @param {number} tintTR - The top-right tint color value. - * @param {number} tintBL - The bottom-left tint color value. - * @param {number} tintBR - The bottom-right tint color value. - * - * @return {boolean} `true` if this method caused the batch to flush, otherwise `false`. - */ - batchQuad: function (x0, y0, x1, y1, x2, y2, x3, y3, tintTL, tintTR, tintBL, tintBR) - { - var hasFlushed = false; - - if (this.shouldFlush(6)) - { - this.flush(); - - hasFlushed = true; - } - - this.batchVert(x0, y0, tintTL); - this.batchVert(x1, y1, tintBL); - this.batchVert(x2, y2, tintBR); - this.batchVert(x0, y0, tintTL); - this.batchVert(x2, y2, tintBR); - this.batchVert(x3, y3, tintTR); - - return hasFlushed; - }, - - /** - * Adds the vertices data into the batch and flushes if full. - * - * Assumes 3 vertices in the following arrangement: - * - * ``` - * 0 - * |\ - * | \ - * | \ - * | \ - * | \ - * 1-----2 - * ``` - * - * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchTri - * @override - * @since 3.50.0 - * - * @param {number} x1 - The bottom-left x position. - * @param {number} y1 - The bottom-left y position. - * @param {number} x2 - The bottom-right x position. - * @param {number} y2 - The bottom-right y position. - * @param {number} x3 - The top-right x position. - * @param {number} y3 - The top-right y position. - * @param {number} tintTL - The top-left tint color value. - * @param {number} tintTR - The top-right tint color value. - * @param {number} tintBL - The bottom-left tint color value. - * - * @return {boolean} `true` if this method caused the batch to flush, otherwise `false`. - */ - batchTri: function (x0, y0, x1, y1, x2, y2, tintTL, tintTR, tintBL) - { - var hasFlushed = false; - - if (this.shouldFlush(3)) - { - this.flush(); - - hasFlushed = true; - } - - this.batchVert(x0, y0, tintTL); - this.batchVert(x1, y1, tintTR); - this.batchVert(x2, y2, tintBL); - - return hasFlushed; - }, - - /** - * Destroys all shader instances, removes all object references and nulls all external references. - * - * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#destroy - * @since 3.50.0 - * - * @return {this} This WebGLPipeline instance. - */ - destroy: function () - { - WebGLPipeline.prototype.destroy.call(this); - - this.polygonCache = null; - - return this; - } - -}); - -module.exports = GraphicsPipeline; - - /***/ }), /***/ 66901: @@ -171369,7 +172059,7 @@ module.exports = GraphicsPipeline; /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -171896,7 +172586,7 @@ module.exports = LightPipeline; /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -171941,9 +172631,12 @@ var WebGLPipeline = __webpack_require__(44775); * * If you wish to create a custom pipeline extending from this one, you should use the string * declaration `%count%` in your fragment shader source, which is used to set the number of - * `sampler2Ds` available to the `getSampler` function. + * `sampler2Ds` available. Also add `%getSampler%` so Phaser can inject the getSampler glsl function. + * This function can be used to get the pixel vec4 from the texture: * - * This pipeline will automatically inject that code for you, should those values exist + * `vec4 texture = getSampler(int(outTexId), outTexCoord);` + * + * This pipeline will automatically inject the getSampler function for you, should the value exist * in your shader source. If you wish to handle this yourself, you can also use the * function `Utils.parseFragmentShaderMaxTextures`. * @@ -172896,7 +173589,7 @@ module.exports = MultiPipeline; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -173071,7 +173764,7 @@ module.exports = PointLightPipeline; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -173566,7 +174259,7 @@ module.exports = PostFXPipeline; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -173634,7 +174327,7 @@ module.exports = RopePipeline; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -173712,7 +174405,7 @@ module.exports = SinglePipeline; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -174120,7 +174813,7 @@ var SpriteFXPipeline = new Class({ // batchQuad will intercept the rendering // Needed for Text & TileSprite - how about others? - flipY = true; + // flipY = true; MultiPipeline.prototype.batchTexture.call(this, gameObject, texture, textureWidth, textureHeight, srcX, srcY, srcWidth, srcHeight, scaleX, scaleY, rotation, flipX, flipY, scrollFactorX, scrollFactorY, displayOriginX, displayOriginY, frameX, frameY, frameWidth, frameHeight, tintTL, tintTR, tintBL, tintBR, tintEffect, uOffset, vOffset, camera, parentTransformMatrix, skipFlip, textureUnit); }, @@ -174251,7 +174944,7 @@ var SpriteFXPipeline = new Class({ // Set this here, so we can immediately call the set uniform functions and it'll work on the correct shader this.currentShader = this.copyShader; - this.onDraw(target, this.manager.getSwapRenderTarget()); + this.onDraw(target, this.manager.getSwapRenderTarget(), this.manager.getAltSwapRenderTarget()); return true; }, @@ -174551,6 +175244,7 @@ var SpriteFXPipeline = new Class({ * * @param {Phaser.Renderer.WebGL.RenderTarget} target - The Render Target to draw to the game. * @param {Phaser.Renderer.WebGL.RenderTarget} [swapTarget] - The Swap Render Target, useful for double-buffer effects. + * @param {Phaser.Renderer.WebGL.RenderTarget} [altSwapTarget] - The Swap Render Target, useful for double-buffer effects. */ onDraw: function (target) { @@ -174685,7 +175379,7 @@ module.exports = SpriteFXPipeline; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -175024,13 +175718,15 @@ var UtilityPipeline = new Class({ * @param {boolean} [clear=true] - Clear the target before copying? * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? * @param {boolean} [eraseMode=false] - Erase source from target using ERASE Blend Mode? + * @param {boolean} [flipY=false] - Flip the UV on the Y axis before drawing? */ - blitFrame: function (source, target, brightness, clear, clearAlpha, eraseMode) + blitFrame: function (source, target, brightness, clear, clearAlpha, eraseMode, flipY) { if (brightness === undefined) { brightness = 1; } if (clear === undefined) { clear = true; } if (clearAlpha === undefined) { clearAlpha = true; } if (eraseMode === undefined) { eraseMode = false; } + if (flipY === undefined) { flipY = false; } var gl = this.gl; @@ -175079,6 +175775,11 @@ var UtilityPipeline = new Class({ this.renderer.setBlendMode(BlendModes.ERASE); } + if (flipY) + { + this.flipY(); + } + gl.bufferData(gl.ARRAY_BUFFER, this.vertexData, gl.STATIC_DRAW); gl.drawArrays(gl.TRIANGLES, 0, 6); @@ -175477,7 +176178,7 @@ module.exports = UtilityPipeline; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -175585,7 +176286,7 @@ module.exports = PIPELINE_CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -175611,7 +176312,7 @@ module.exports = 'pipelineafterflush'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -175637,7 +176338,7 @@ module.exports = 'pipelinebeforeflush'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -175662,7 +176363,7 @@ module.exports = 'pipelinebind'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -175686,7 +176387,7 @@ module.exports = 'pipelineboot'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -175710,7 +176411,7 @@ module.exports = 'pipelinedestroy'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -175735,7 +176436,7 @@ module.exports = 'pipelinerebind'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -175762,7 +176463,7 @@ module.exports = 'pipelineresize'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -175790,7 +176491,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -175805,7 +176506,6 @@ var Pipelines = { BitmapMaskPipeline: __webpack_require__(5583), Events: __webpack_require__(18970), - GraphicsPipeline: __webpack_require__(67589), LightPipeline: __webpack_require__(66901), MultiPipeline: __webpack_require__(77310), PointLightPipeline: __webpack_require__(10919), @@ -175871,20 +176571,20 @@ module.exports = [ 'void main ()', '{', ' vec2 uv = gl_FragCoord.xy / uResolution;', + '', ' vec4 mainColor = texture2D(uMainSampler, uv);', ' vec4 maskColor = texture2D(uMaskSampler, uv);', - ' float alpha = mainColor.a;', '', ' if (!uInvertMaskAlpha)', ' {', - ' alpha *= (maskColor.a);', + ' mainColor *= maskColor.a;', ' }', ' else', ' {', - ' alpha *= (1.0 - maskColor.a);', + ' mainColor *= (1.0 - maskColor.a);', ' }', '', - ' gl_FragColor = vec4(mainColor.rgb * alpha, alpha);', + ' gl_FragColor = mainColor;', '}', '' ].join('\n'); @@ -175982,53 +176682,6 @@ module.exports = [ ].join('\n'); -/***/ }), - -/***/ 37699: -/***/ ((module) => { - -module.exports = [ - '#define SHADER_NAME PHASER_GRAPHICS_FS', - '', - 'precision mediump float;', - '', - 'varying vec4 outColor;', - '', - 'void main ()', - '{', - ' gl_FragColor = vec4(outColor.bgr * outColor.a, outColor.a);', - '}', - '' -].join('\n'); - - -/***/ }), - -/***/ 28739: -/***/ ((module) => { - -module.exports = [ - '#define SHADER_NAME PHASER_GRAPHICS_VS', - '', - 'precision mediump float;', - '', - 'uniform mat4 uProjectionMatrix;', - '', - 'attribute vec2 inPosition;', - 'attribute vec4 inColor;', - '', - 'varying vec4 outColor;', - '', - 'void main ()', - '{', - ' gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);', - '', - ' outColor = inColor;', - '}', - '' -].join('\n'); - - /***/ }), /***/ 65045: @@ -176122,7 +176775,7 @@ module.exports = [ /***/ ((module) => { module.exports = [ - '#define SHADER_NAME PHASER_MULTI_FS', + '#define SHADER_NAME PHASER_MULTI_V2_FS', '#define numTextures %count%', '', 'precision highp float;', @@ -176134,19 +176787,7 @@ module.exports = [ 'varying float outTintEffect;', 'varying vec4 outTint;', '', - 'vec4 getSampler (int index, vec2 uv)', - '{', - ' for (int i = 0; i < numTextures; ++i)', - ' {', - ' if (i == index)', - ' {', - ' return texture2D(uMainSampler[i], uv);', - ' }', - ' }', - '', - ' // Return black', - ' return vec4(0);', - '}', + '%getSampler%', '', 'void main ()', '{', @@ -176413,7 +177054,7 @@ module.exports = [ /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -177899,7 +178540,7 @@ var ScaleManager = new Class({ * Get Rectange of visible area, this Rectange does NOT factor in camera scroll. * * @method Phaser.Scale.ScaleManager#getViewPort - * @since 3.56.0 + * @since 3.60.0 * * @param {Phaser.Geom.Rectangle} [out] - The Rectangle of visible area. * @@ -178170,13 +178811,13 @@ module.exports = ScaleManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Phaser Scale Manager constants for centering the game canvas. - * + * * @namespace Phaser.Scale.Center * @memberof Phaser.Scale * @since 3.16.0 @@ -178184,9 +178825,9 @@ module.exports = ScaleManager; /** * Phaser Scale Manager constants for centering the game canvas. - * + * * To find out what each mode does please see [Phaser.Scale.Center]{@link Phaser.Scale.Center}. - * + * * @typedef {Phaser.Scale.Center} Phaser.Scale.CenterType * @memberof Phaser.Scale * @since 3.16.0 @@ -178197,7 +178838,7 @@ module.exports = { /** * The game canvas is not centered within the parent by Phaser. * You can still center it yourself via CSS. - * + * * @name Phaser.Scale.Center.NO_CENTER * @type {number} * @const @@ -178208,10 +178849,10 @@ module.exports = { /** * The game canvas is centered both horizontally and vertically within the parent. * To do this, the parent has to have a bounds that can be calculated and not be empty. - * + * * Centering is achieved by setting the margin left and top properties of the * game canvas, and does not factor in any other CSS styles you may have applied. - * + * * @name Phaser.Scale.Center.CENTER_BOTH * @type {number} * @const @@ -178222,10 +178863,10 @@ module.exports = { /** * The game canvas is centered horizontally within the parent. * To do this, the parent has to have a bounds that can be calculated and not be empty. - * + * * Centering is achieved by setting the margin left and top properties of the * game canvas, and does not factor in any other CSS styles you may have applied. - * + * * @name Phaser.Scale.Center.CENTER_HORIZONTALLY * @type {number} * @const @@ -178236,10 +178877,10 @@ module.exports = { /** * The game canvas is centered both vertically within the parent. * To do this, the parent has to have a bounds that can be calculated and not be empty. - * + * * Centering is achieved by setting the margin left and top properties of the * game canvas, and does not factor in any other CSS styles you may have applied. - * + * * @name Phaser.Scale.Center.CENTER_VERTICALLY * @type {number} * @const @@ -178257,13 +178898,13 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Phaser Scale Manager constants for orientation. - * + * * @namespace Phaser.Scale.Orientation * @memberof Phaser.Scale * @since 3.16.0 @@ -178271,9 +178912,9 @@ module.exports = { /** * Phaser Scale Manager constants for orientation. - * + * * To find out what each mode does please see [Phaser.Scale.Orientation]{@link Phaser.Scale.Orientation}. - * + * * @typedef {Phaser.Scale.Orientation} Phaser.Scale.OrientationType * @memberof Phaser.Scale * @since 3.16.0 @@ -178283,7 +178924,7 @@ module.exports = { /** * A landscape orientation. - * + * * @name Phaser.Scale.Orientation.LANDSCAPE * @type {string} * @const @@ -178293,7 +178934,7 @@ module.exports = { /** * A portrait orientation. - * + * * @name Phaser.Scale.Orientation.PORTRAIT * @type {string} * @const @@ -178311,13 +178952,13 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Phaser Scale Manager constants for the different scale modes available. - * + * * @namespace Phaser.Scale.ScaleModes * @memberof Phaser.Scale * @since 3.16.0 @@ -178325,9 +178966,9 @@ module.exports = { /** * Phaser Scale Manager constants for the different scale modes available. - * + * * To find out what each mode does please see [Phaser.Scale.ScaleModes]{@link Phaser.Scale.ScaleModes}. - * + * * @typedef {Phaser.Scale.ScaleModes} Phaser.Scale.ScaleModeType * @memberof Phaser.Scale * @since 3.16.0 @@ -178339,7 +178980,7 @@ module.exports = { * No scaling happens at all. The canvas is set to the size given in the game config and Phaser doesn't change it * again from that point on. If you change the canvas size, either via CSS, or directly via code, then you need * to call the Scale Managers `resize` method to give the new dimensions, or input events will stop working. - * + * * @name Phaser.Scale.ScaleModes.NONE * @type {number} * @const @@ -178349,7 +178990,7 @@ module.exports = { /** * The height is automatically adjusted based on the width. - * + * * @name Phaser.Scale.ScaleModes.WIDTH_CONTROLS_HEIGHT * @type {number} * @const @@ -178359,7 +179000,7 @@ module.exports = { /** * The width is automatically adjusted based on the height. - * + * * @name Phaser.Scale.ScaleModes.HEIGHT_CONTROLS_WIDTH * @type {number} * @const @@ -178371,7 +179012,7 @@ module.exports = { * The width and height are automatically adjusted to fit inside the given target area, * while keeping the aspect ratio. Depending on the aspect ratio there may be some space * inside the area which is not covered. - * + * * @name Phaser.Scale.ScaleModes.FIT * @type {number} * @const @@ -178382,7 +179023,7 @@ module.exports = { /** * The width and height are automatically adjusted to make the size cover the entire target * area while keeping the aspect ratio. This may extend further out than the target size. - * + * * @name Phaser.Scale.ScaleModes.ENVELOP * @type {number} * @const @@ -178392,7 +179033,7 @@ module.exports = { /** * The Canvas is resized to fit all available _parent_ space, regardless of aspect ratio. - * + * * @name Phaser.Scale.ScaleModes.RESIZE * @type {number} * @const @@ -178410,13 +179051,13 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Phaser Scale Manager constants for zoom modes. - * + * * @namespace Phaser.Scale.Zoom * @memberof Phaser.Scale * @since 3.16.0 @@ -178424,9 +179065,9 @@ module.exports = { /** * Phaser Scale Manager constants for zoom modes. - * + * * To find out what each mode does please see [Phaser.Scale.Zoom]{@link Phaser.Scale.Zoom}. - * + * * @typedef {Phaser.Scale.Zoom} Phaser.Scale.ZoomType * @memberof Phaser.Scale * @since 3.16.0 @@ -178436,7 +179077,7 @@ module.exports = { /** * The game canvas will not be zoomed by Phaser. - * + * * @name Phaser.Scale.Zoom.NO_ZOOM * @type {number} * @const @@ -178446,7 +179087,7 @@ module.exports = { /** * The game canvas will be 2x zoomed by Phaser. - * + * * @name Phaser.Scale.Zoom.ZOOM_2X * @type {number} * @const @@ -178456,7 +179097,7 @@ module.exports = { /** * The game canvas will be 4x zoomed by Phaser. - * + * * @name Phaser.Scale.Zoom.ZOOM_4X * @type {number} * @const @@ -178467,7 +179108,7 @@ module.exports = { /** * Calculate the zoom value based on the maximum multiplied game size that will * fit into the parent, or browser window if no parent is set. - * + * * @name Phaser.Scale.Zoom.MAX_ZOOM * @type {number} * @const @@ -178485,7 +179126,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -178508,7 +179149,7 @@ module.exports = CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -178528,7 +179169,7 @@ module.exports = 'enterfullscreen'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -178548,7 +179189,7 @@ module.exports = 'fullscreenfailed'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -178568,7 +179209,7 @@ module.exports = 'fullscreenunsupported'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -178589,7 +179230,7 @@ module.exports = 'leavefullscreen'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -178613,7 +179254,7 @@ module.exports = 'orientationchange'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -178644,7 +179285,7 @@ module.exports = 'resize'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -178671,7 +179312,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -178680,22 +179321,22 @@ var CONST = __webpack_require__(55301); /** * @namespace Phaser.Scale - * + * * @borrows Phaser.Scale.Center.NO_CENTER as NO_CENTER * @borrows Phaser.Scale.Center.CENTER_BOTH as CENTER_BOTH * @borrows Phaser.Scale.Center.CENTER_HORIZONTALLY as CENTER_HORIZONTALLY * @borrows Phaser.Scale.Center.CENTER_VERTICALLY as CENTER_VERTICALLY - * + * * @borrows Phaser.Scale.Orientation.LANDSCAPE as LANDSCAPE * @borrows Phaser.Scale.Orientation.PORTRAIT as PORTRAIT - * + * * @borrows Phaser.Scale.ScaleModes.NONE as NONE * @borrows Phaser.Scale.ScaleModes.WIDTH_CONTROLS_HEIGHT as WIDTH_CONTROLS_HEIGHT * @borrows Phaser.Scale.ScaleModes.HEIGHT_CONTROLS_WIDTH as HEIGHT_CONTROLS_WIDTH * @borrows Phaser.Scale.ScaleModes.FIT as FIT * @borrows Phaser.Scale.ScaleModes.ENVELOP as ENVELOP * @borrows Phaser.Scale.ScaleModes.RESIZE as RESIZE - * + * * @borrows Phaser.Scale.Zoom.NO_ZOOM as NO_ZOOM * @borrows Phaser.Scale.Zoom.ZOOM_2X as ZOOM_2X * @borrows Phaser.Scale.Zoom.ZOOM_4X as ZOOM_4X @@ -178728,7 +179369,7 @@ module.exports = Scale; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -178791,7 +179432,7 @@ module.exports = GetPhysicsPlugins; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -178839,7 +179480,7 @@ module.exports = GetScenePlugins; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -178902,7 +179543,7 @@ module.exports = InjectionMap; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -179222,7 +179863,7 @@ module.exports = Scene; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -179734,6 +180375,13 @@ var SceneManager = new Class({ */ loadComplete: function (loader) { + // TODO - Remove. This should *not* be handled here + // Try to unlock HTML5 sounds every time any loader completes + if (this.game.sound && this.game.sound.onBlurPausedSounds) + { + this.game.sound.unlock(); + } + this.create(loader.scene); }, @@ -180340,7 +180988,9 @@ var SceneManager = new Class({ }, /** - * Starts the given Scene. + * Starts the given Scene, if it is not starting, loading, or creating. + * + * If the Scene is running, paused, or sleeping, it will be shutdown and then started. * * @method Phaser.Scenes.SceneManager#start * @since 3.0.0 @@ -180372,10 +181022,18 @@ var SceneManager = new Class({ } var sys = scene.sys; + var status = sys.settings.status; - // If the Scene is already running (perhaps they called start from a launched sub-Scene?) - // then we close it down before starting it again. - if (sys.isActive() || sys.isPaused()) + // If the scene is already started but not yet running, + // let it continue. + if (status >= CONST.START && status <= CONST.CREATING) + { + return this; + } + + // If the Scene is already running, paused, or sleeping, + // close it down before starting it again. + else if (status >= CONST.RUNNING && status <= CONST.SLEEPING) { sys.shutdown(); @@ -180383,6 +181041,9 @@ var SceneManager = new Class({ sys.start(data); } + + // If the Scene is INIT or SHUTDOWN, + // start it directly. else { sys.sceneUpdate = NOOP; @@ -180436,6 +181097,11 @@ var SceneManager = new Class({ if (scene && !scene.sys.isTransitioning() && scene.sys.settings.status !== CONST.SHUTDOWN) { + var loader = scene.sys.load; + + loader.off(LoaderEvents.COMPLETE, this.loadComplete, this); + loader.off(LoaderEvents.COMPLETE, this.payloadComplete, this); + scene.sys.shutdown(data); } @@ -180672,7 +181338,7 @@ var SceneManager = new Class({ var indexA = this.getIndex(keyA); var indexB = this.getIndex(keyB); - if (indexA !== -1 && indexB !== -1) + if (indexA !== -1 && indexB !== -1 && indexB < indexA) { var tempScene = this.getAt(indexB); @@ -180680,7 +181346,7 @@ var SceneManager = new Class({ this.scenes.splice(indexB, 1); // Add in new location - this.scenes.splice(indexA + 1, 0, tempScene); + this.scenes.splice(indexA + (indexB > indexA), 0, tempScene); } } @@ -180695,7 +181361,7 @@ var SceneManager = new Class({ * @method Phaser.Scenes.SceneManager#moveBelow * @since 3.2.0 * - * @param {(string|Phaser.Scene)} keyA - The Scene that Scene B will be moved above. + * @param {(string|Phaser.Scene)} keyA - The Scene that Scene B will be moved below. * @param {(string|Phaser.Scene)} keyB - The Scene to be moved. * * @return {this} This Scene Manager instance. @@ -180716,7 +181382,7 @@ var SceneManager = new Class({ var indexA = this.getIndex(keyA); var indexB = this.getIndex(keyB); - if (indexA !== -1 && indexB !== -1) + if (indexA !== -1 && indexB !== -1 && indexB > indexA) { var tempScene = this.getAt(indexB); @@ -180730,7 +181396,7 @@ var SceneManager = new Class({ else { // Add in new location - this.scenes.splice(indexA, 0, tempScene); + this.scenes.splice(indexA - (indexB < indexA), 0, tempScene); } } } @@ -180863,7 +181529,7 @@ module.exports = SceneManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -181065,7 +181731,7 @@ var ScenePlugin = new Class({ * @since 3.0.0 * * @param {(string|Phaser.Scene)} [key] - The Scene to start. - * @param {object} [data] - The Scene data. + * @param {object} [data] - The Scene data. If no value is given it will not overwrite any previous data that may exist. * * @return {this} This Scene Plugin instance. */ @@ -181087,7 +181753,7 @@ var ScenePlugin = new Class({ * @method Phaser.Scenes.ScenePlugin#restart * @since 3.4.0 * - * @param {object} [data] - The Scene data. + * @param {object} [data] - The Scene data. If no value is given it will not overwrite any previous data that may exist. * * @return {this} This Scene Plugin instance. */ @@ -181104,6 +181770,8 @@ var ScenePlugin = new Class({ /** * This will start a transition from the current Scene to the target Scene given. * + * The target Scene cannot be the same as the current Scene. + * * The transition will last for the duration specified in milliseconds. * * You can have the target Scene moved above or below this one in the display list. @@ -181814,6 +182482,26 @@ var ScenePlugin = new Class({ return this.manager.getScene(key); }, + /** + * Return the status of the Scene. + * + * @method Phaser.Scenes.ScenePlugin#getStatus + * @since 3.60.0 + * + * @param {(string|Phaser.Scene)} key - The Scene to get the status from. + * + * @return {number} The Scene status. This maps to the `Phaser.Scene` constants, such as `Phaser.Scene.LOADING`. + */ + getStatus: function (key) + { + var scene = this.manager.getScene(key); + + if (scene) + { + return scene.sys.getStatus(); + } + }, + /** * Retrieves the numeric index of a Scene in the Scenes list. * @@ -181884,7 +182572,7 @@ module.exports = ScenePlugin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -181981,7 +182669,7 @@ module.exports = Settings; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -182387,7 +183075,8 @@ var Systems = new Class({ /** * Pause this Scene. - * A paused Scene still renders, it just doesn't run ANY of its update handlers or systems. + * + * A paused Scene still renders, it just doesn't run any of its update handlers or systems. * * @method Phaser.Scenes.Systems#pause * @fires Phaser.Scenes.Events#PAUSE @@ -182399,16 +183088,20 @@ var Systems = new Class({ */ pause: function (data) { - var events = this.events; var settings = this.settings; + var status = this.getStatus(); - if (this.settings.active) + if (status !== CONST.CREATING && status !== CONST.RUNNING) + { + console.warn('Cannot pause non-running Scene', settings.key); + } + else if (this.settings.active) { settings.status = CONST.PAUSED; settings.active = false; - events.emit(Events.PAUSE, this, data); + this.events.emit(Events.PAUSE, this, data); } return this; @@ -182460,15 +183153,22 @@ var Systems = new Class({ */ sleep: function (data) { - var events = this.events; var settings = this.settings; + var status = this.getStatus(); - settings.status = CONST.SLEEPING; + if (status !== CONST.CREATING && status !== CONST.RUNNING) + { + console.warn('Cannot sleep non-running Scene', settings.key); + } + else + { + settings.status = CONST.SLEEPING; - settings.active = false; - settings.visible = false; + settings.active = false; + settings.visible = false; - events.emit(Events.SLEEP, this, data); + this.events.emit(Events.SLEEP, this, data); + } return this; }, @@ -182513,13 +183213,26 @@ var Systems = new Class({ * @method Phaser.Scenes.Systems#getData * @since 3.22.0 * - * @return {any} + * @return {any} The Scene Data. */ getData: function () { return this.settings.data; }, + /** + * Returns the current status of this Scene. + * + * @method Phaser.Scenes.Systems#getStatus + * @since 3.60.0 + * + * @return {number} The status of this Scene. One of the `Phaser.Scene` constants. + */ + getStatus: function () + { + return this.settings.status; + }, + /** * Is this Scene sleeping? * @@ -182767,13 +183480,13 @@ module.exports = Systems; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Scene consts. - * + * * @ignore */ @@ -182781,7 +183494,7 @@ var CONST = { /** * Scene state. - * + * * @name Phaser.Scenes.PENDING * @readonly * @type {number} @@ -182791,7 +183504,7 @@ var CONST = { /** * Scene state. - * + * * @name Phaser.Scenes.INIT * @readonly * @type {number} @@ -182801,7 +183514,7 @@ var CONST = { /** * Scene state. - * + * * @name Phaser.Scenes.START * @readonly * @type {number} @@ -182811,7 +183524,7 @@ var CONST = { /** * Scene state. - * + * * @name Phaser.Scenes.LOADING * @readonly * @type {number} @@ -182821,7 +183534,7 @@ var CONST = { /** * Scene state. - * + * * @name Phaser.Scenes.CREATING * @readonly * @type {number} @@ -182831,7 +183544,7 @@ var CONST = { /** * Scene state. - * + * * @name Phaser.Scenes.RUNNING * @readonly * @type {number} @@ -182841,7 +183554,7 @@ var CONST = { /** * Scene state. - * + * * @name Phaser.Scenes.PAUSED * @readonly * @type {number} @@ -182851,7 +183564,7 @@ var CONST = { /** * Scene state. - * + * * @name Phaser.Scenes.SLEEPING * @readonly * @type {number} @@ -182861,7 +183574,7 @@ var CONST = { /** * Scene state. - * + * * @name Phaser.Scenes.SHUTDOWN * @readonly * @type {number} @@ -182871,7 +183584,7 @@ var CONST = { /** * Scene state. - * + * * @name Phaser.Scenes.DESTROYED * @readonly * @type {number} @@ -182891,7 +183604,7 @@ module.exports = CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -182918,7 +183631,7 @@ module.exports = 'addedtoscene'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -182944,7 +183657,7 @@ module.exports = 'boot'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -182974,7 +183687,7 @@ module.exports = 'create'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -183002,7 +183715,7 @@ module.exports = 'destroy'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -183030,7 +183743,7 @@ module.exports = 'pause'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -183108,7 +183821,7 @@ module.exports = 'prerender'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -183147,7 +183860,7 @@ module.exports = 'preupdate'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -183176,7 +183889,7 @@ module.exports = 'ready'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -183203,7 +183916,7 @@ module.exports = 'removedfromscene'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -183242,7 +183955,7 @@ module.exports = 'render'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -183270,7 +183983,7 @@ module.exports = 'resume'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -183301,7 +184014,7 @@ module.exports = 'shutdown'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -183329,7 +184042,7 @@ module.exports = 'sleep'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -183355,7 +184068,7 @@ module.exports = 'start'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -183392,7 +184105,7 @@ module.exports = 'transitioncomplete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -183430,7 +184143,7 @@ module.exports = 'transitioninit'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -183465,7 +184178,7 @@ module.exports = 'transitionout'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -183506,7 +184219,7 @@ module.exports = 'transitionstart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -183542,7 +184255,7 @@ module.exports = 'transitionwake'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -183555,7 +184268,7 @@ module.exports = 'transitionwake'; * * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} - * 3. The `Scene.update` method is called, if it exists + * 3. The `Scene.update` method is called, if it exists and the Scene is in a Running state, otherwise this is skipped. * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} @@ -183581,7 +184294,7 @@ module.exports = 'update'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -183609,7 +184322,7 @@ module.exports = 'wake'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -183652,7 +184365,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -183689,7 +184402,7 @@ module.exports = Scene; /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -183728,7 +184441,6 @@ var BaseSound = new Class({ * * @name Phaser.Sound.BaseSound#manager * @type {Phaser.Sound.BaseSoundManager} - * @private * @since 3.0.0 */ this.manager = manager; @@ -183862,7 +184574,6 @@ var BaseSound = new Class({ * * @name Phaser.Sound.BaseSound#pendingRemove * @type {boolean} - * @private * @default false * @since 3.0.0 */ @@ -184098,7 +184809,6 @@ var BaseSound = new Class({ * Method used internally for applying config values to some of the sound properties. * * @method Phaser.Sound.BaseSound#applyConfig - * @protected * @since 3.0.0 */ applyConfig: function () @@ -184115,7 +184825,6 @@ var BaseSound = new Class({ * Method used internally for resetting values of some of the config properties. * * @method Phaser.Sound.BaseSound#resetConfig - * @protected * @since 3.0.0 */ resetConfig: function () @@ -184128,8 +184837,6 @@ var BaseSound = new Class({ * Update method called automatically by sound manager on every game step. * * @method Phaser.Sound.BaseSound#update - * @override - * @protected * @since 3.0.0 * * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. @@ -184141,7 +184848,6 @@ var BaseSound = new Class({ * Method used internally to calculate total playback rate of the sound. * * @method Phaser.Sound.BaseSound#calculateRate - * @protected * @since 3.0.0 */ calculateRate: function () @@ -184168,12 +184874,12 @@ var BaseSound = new Class({ } this.emit(Events.DESTROY, this); - this.pendingRemove = true; - this.manager = null; - this.key = ''; + this.removeAllListeners(); - this.isPlaying = false; - this.isPaused = false; + + this.pendingRemove = true; + + this.manager = null; this.config = null; this.currentConfig = null; this.markers = null; @@ -184193,7 +184899,7 @@ module.exports = BaseSound; /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -184371,7 +185077,7 @@ var BaseSoundManager = new Class({ * @param {string} key - Asset key for the sound. * @param {Phaser.Types.Sound.SoundConfig} [config] - An optional config object containing default sound settings. * - * @return {(Phaser.Sound.HTML5AudioSound|Phaser.Sound.WebAudioSound)} The new audio sprite sound instance. + * @return {(Phaser.Sound.NoAudioSound|Phaser.Sound.HTML5AudioSound|Phaser.Sound.WebAudioSound)} The new audio sprite sound instance. */ addAudioSprite: function (key, config) { @@ -184525,7 +185231,6 @@ var BaseSoundManager = new Class({ return false; }, - /** * Removes all sounds from the manager, destroying the sounds. * @@ -184625,7 +185330,6 @@ var BaseSoundManager = new Class({ this.emit(Events.STOP_ALL, this); }, - /** * Stops any sounds matching the given key. * @@ -184806,7 +185510,7 @@ var BaseSoundManager = new Class({ * * @param {number} value - Global playback rate at which all the sounds will be played. * - * @return {Phaser.Sound.BaseSoundManager} This Sound Manager. + * @return {this} This Sound Manager. */ setRate: function (value) { @@ -184856,7 +185560,7 @@ var BaseSoundManager = new Class({ * * @param {number} value - The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). * - * @return {Phaser.Sound.BaseSoundManager} This Sound Manager. + * @return {this} This Sound Manager. */ setDetune: function (value) { @@ -184908,7 +185612,7 @@ module.exports = BaseSoundManager; /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -184960,17 +185664,17 @@ module.exports = SoundManagerCreator; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Complete Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they complete playback. - * + * * Listen to it from a Sound instance using `Sound.on('complete', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('complete', listener); @@ -184979,7 +185683,7 @@ module.exports = SoundManagerCreator; * * @event Phaser.Sound.Events#COMPLETE * @since 3.16.1 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. */ module.exports = 'complete'; @@ -184992,21 +185696,21 @@ module.exports = 'complete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Audio Data Decoded All Event. - * + * * This event is dispatched by the Web Audio Sound Manager as a result of calling the `decodeAudio` method, * once all files passed to the method have been decoded (or errored). - * + * * Use `Phaser.Sound.Events#DECODED` to listen for single sounds being decoded, and `DECODED_ALL` to * listen for them all completing. - * + * * Listen to it from the Sound Manager in a Scene using `this.sound.on('decodedall', listener)`, i.e.: - * + * * ```javascript * this.sound.once('decodedall', handler); * this.sound.decodeAudio([ audioFiles ]); @@ -185025,17 +185729,17 @@ module.exports = 'decodedall'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Audio Data Decoded Event. - * + * * This event is dispatched by the Web Audio Sound Manager as a result of calling the `decodeAudio` method. - * + * * Listen to it from the Sound Manager in a Scene using `this.sound.on('decoded', listener)`, i.e.: - * + * * ```javascript * this.sound.on('decoded', handler); * this.sound.decodeAudio(key, audioData); @@ -185043,7 +185747,7 @@ module.exports = 'decodedall'; * * @event Phaser.Sound.Events#DECODED * @since 3.18.0 - * + * * @param {string} key - The key of the audio file that was decoded and added to the audio cache. */ module.exports = 'decoded'; @@ -185056,18 +185760,18 @@ module.exports = 'decoded'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Destroy Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are destroyed, either * directly or via a Sound Manager. - * + * * Listen to it from a Sound instance using `Sound.on('destroy', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('destroy', listener); @@ -185076,7 +185780,7 @@ module.exports = 'decoded'; * * @event Phaser.Sound.Events#DESTROY * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. */ module.exports = 'destroy'; @@ -185089,17 +185793,17 @@ module.exports = 'destroy'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Detune Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their detune value changes. - * + * * Listen to it from a Sound instance using `Sound.on('detune', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('detune', listener); @@ -185109,7 +185813,7 @@ module.exports = 'destroy'; * * @event Phaser.Sound.Events#DETUNE * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. * @param {number} detune - The new detune value of the Sound. */ @@ -185123,22 +185827,22 @@ module.exports = 'detune'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Manager Global Detune Event. - * + * * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, * or the HTML5 Audio Manager. It is dispatched when the `detune` property of the Sound Manager is changed, which globally * adjusts the detuning of all active sounds. - * + * * Listen to it from a Scene using: `this.sound.on('rate', listener)`. * * @event Phaser.Sound.Events#GLOBAL_DETUNE * @since 3.0.0 - * + * * @param {Phaser.Sound.BaseSoundManager} soundManager - A reference to the sound manager that emitted the event. * @param {number} detune - The updated detune value. */ @@ -185152,21 +185856,21 @@ module.exports = 'detune'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Manager Global Mute Event. - * + * * This event is dispatched by the Sound Manager when its `mute` property is changed, either directly * or via the `setMute` method. This changes the mute state of all active sounds. - * + * * Listen to it from a Scene using: `this.sound.on('mute', listener)`. * * @event Phaser.Sound.Events#GLOBAL_MUTE * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSoundManager|Phaser.Sound.HTML5AudioSoundManager)} soundManager - A reference to the Sound Manager that emitted the event. * @param {boolean} mute - The mute value. `true` if the Sound Manager is now muted, otherwise `false`. */ @@ -185180,22 +185884,22 @@ module.exports = 'mute'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Manager Global Rate Event. - * + * * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, * or the HTML5 Audio Manager. It is dispatched when the `rate` property of the Sound Manager is changed, which globally * adjusts the playback rate of all active sounds. - * + * * Listen to it from a Scene using: `this.sound.on('rate', listener)`. * * @event Phaser.Sound.Events#GLOBAL_RATE * @since 3.0.0 - * + * * @param {Phaser.Sound.BaseSoundManager} soundManager - A reference to the sound manager that emitted the event. * @param {number} rate - The updated rate value. */ @@ -185209,21 +185913,21 @@ module.exports = 'rate'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Manager Global Volume Event. - * + * * This event is dispatched by the Sound Manager when its `volume` property is changed, either directly * or via the `setVolume` method. This changes the volume of all active sounds. - * + * * Listen to it from a Scene using: `this.sound.on('volume', listener)`. * * @event Phaser.Sound.Events#GLOBAL_VOLUME * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSoundManager|Phaser.Sound.HTML5AudioSoundManager)} soundManager - A reference to the sound manager that emitted the event. * @param {number} volume - The new global volume of the Sound Manager. */ @@ -185237,29 +185941,29 @@ module.exports = 'volume'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Looped Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they loop during playback. - * + * * Listen to it from a Sound instance using `Sound.on('looped', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('looped', listener); * music.setLoop(true); * music.play(); * ``` - * + * * This is not to be confused with the [LOOP]{@linkcode Phaser.Sound.Events#event:LOOP} event, which only emits when the loop state of a Sound is changed. * * @event Phaser.Sound.Events#LOOPED * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. */ module.exports = 'looped'; @@ -185272,28 +185976,28 @@ module.exports = 'looped'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Loop Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their loop state is changed. - * + * * Listen to it from a Sound instance using `Sound.on('loop', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('loop', listener); * music.setLoop(true); * ``` - * + * * This is not to be confused with the [LOOPED]{@linkcode Phaser.Sound.Events#event:LOOPED} event, which emits each time a Sound loops during playback. * * @event Phaser.Sound.Events#LOOP * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. * @param {boolean} loop - The new loop value. `true` if the Sound will loop, otherwise `false`. */ @@ -185307,17 +186011,17 @@ module.exports = 'loop'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Mute Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their mute state changes. - * + * * Listen to it from a Sound instance using `Sound.on('mute', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('mute', listener); @@ -185327,7 +186031,7 @@ module.exports = 'loop'; * * @event Phaser.Sound.Events#MUTE * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. * @param {boolean} mute - The mute value. `true` if the Sound is now muted, otherwise `false`. */ @@ -185341,7 +186045,7 @@ module.exports = 'mute'; /** * @author pi-kei - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -185375,22 +186079,22 @@ module.exports = 'pan'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pause All Sounds Event. - * + * * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, * or the HTML5 Audio Manager. It is dispatched when the `pauseAll` method is invoked and after all current Sounds * have been paused. - * + * * Listen to it from a Scene using: `this.sound.on('pauseall', listener)`. * * @event Phaser.Sound.Events#PAUSE_ALL * @since 3.0.0 - * + * * @param {Phaser.Sound.BaseSoundManager} soundManager - A reference to the sound manager that emitted the event. */ module.exports = 'pauseall'; @@ -185403,17 +186107,17 @@ module.exports = 'pauseall'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Pause Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are paused. - * + * * Listen to it from a Sound instance using `Sound.on('pause', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('pause', listener); @@ -185423,7 +186127,7 @@ module.exports = 'pauseall'; * * @event Phaser.Sound.Events#PAUSE * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. */ module.exports = 'pause'; @@ -185436,17 +186140,17 @@ module.exports = 'pause'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Play Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are played. - * + * * Listen to it from a Sound instance using `Sound.on('play', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('play', listener); @@ -185455,7 +186159,7 @@ module.exports = 'pause'; * * @event Phaser.Sound.Events#PLAY * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. */ module.exports = 'play'; @@ -185468,17 +186172,17 @@ module.exports = 'play'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Rate Change Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their rate changes. - * + * * Listen to it from a Sound instance using `Sound.on('rate', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('rate', listener); @@ -185488,7 +186192,7 @@ module.exports = 'play'; * * @event Phaser.Sound.Events#RATE * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. * @param {number} rate - The new rate of the Sound. */ @@ -185502,22 +186206,22 @@ module.exports = 'rate'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Resume All Sounds Event. - * + * * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, * or the HTML5 Audio Manager. It is dispatched when the `resumeAll` method is invoked and after all current Sounds * have been resumed. - * + * * Listen to it from a Scene using: `this.sound.on('resumeall', listener)`. * * @event Phaser.Sound.Events#RESUME_ALL * @since 3.0.0 - * + * * @param {Phaser.Sound.BaseSoundManager} soundManager - A reference to the sound manager that emitted the event. */ module.exports = 'resumeall'; @@ -185530,17 +186234,17 @@ module.exports = 'resumeall'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Resume Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are resumed from a paused state. - * + * * Listen to it from a Sound instance using `Sound.on('resume', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('resume', listener); @@ -185551,7 +186255,7 @@ module.exports = 'resumeall'; * * @event Phaser.Sound.Events#RESUME * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. */ module.exports = 'resume'; @@ -185564,17 +186268,17 @@ module.exports = 'resume'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Seek Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are seeked to a new position. - * + * * Listen to it from a Sound instance using `Sound.on('seek', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('seek', listener); @@ -185584,7 +186288,7 @@ module.exports = 'resume'; * * @event Phaser.Sound.Events#SEEK * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. * @param {number} detune - The new detune value of the Sound. */ @@ -185598,22 +186302,22 @@ module.exports = 'seek'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Stop All Sounds Event. - * + * * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, * or the HTML5 Audio Manager. It is dispatched when the `stopAll` method is invoked and after all current Sounds * have been stopped. - * + * * Listen to it from a Scene using: `this.sound.on('stopall', listener)`. * * @event Phaser.Sound.Events#STOP_ALL * @since 3.0.0 - * + * * @param {Phaser.Sound.BaseSoundManager} soundManager - A reference to the sound manager that emitted the event. */ module.exports = 'stopall'; @@ -185626,17 +186330,17 @@ module.exports = 'stopall'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Stop Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are stopped. - * + * * Listen to it from a Sound instance using `Sound.on('stop', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('stop', listener); @@ -185646,7 +186350,7 @@ module.exports = 'stopall'; * * @event Phaser.Sound.Events#STOP * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. */ module.exports = 'stop'; @@ -185659,22 +186363,22 @@ module.exports = 'stop'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Manager Unlocked Event. - * + * * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, * or the HTML5 Audio Manager. It is dispatched during the update loop when the Sound Manager becomes unlocked. For * Web Audio this is on the first user gesture on the page. - * + * * Listen to it from a Scene using: `this.sound.on('unlocked', listener)`. * * @event Phaser.Sound.Events#UNLOCKED * @since 3.0.0 - * + * * @param {Phaser.Sound.BaseSoundManager} soundManager - A reference to the sound manager that emitted the event. */ module.exports = 'unlocked'; @@ -185687,17 +186391,17 @@ module.exports = 'unlocked'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Volume Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their volume changes. - * + * * Listen to it from a Sound instance using `Sound.on('volume', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('volume', listener); @@ -185707,7 +186411,7 @@ module.exports = 'unlocked'; * * @event Phaser.Sound.Events#VOLUME * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. * @param {number} volume - The new volume of the Sound. */ @@ -185721,7 +186425,7 @@ module.exports = 'volume'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -185767,7 +186471,7 @@ module.exports = { /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -185802,19 +186506,18 @@ var HTML5AudioSound = new Class({ /** * An array containing all HTML5 Audio tags that could be used for individual - * sound's playback. Number of instances depends on the config value passed - * to the Loader#audio method call, default is 1. + * sound playback. Number of instances depends on the config value passed + * to the `Loader#audio` method call, default is 1. * * @name Phaser.Sound.HTML5AudioSound#tags * @type {HTMLAudioElement[]} - * @private * @since 3.0.0 */ this.tags = manager.game.cache.audio.get(key); if (!this.tags) { - throw new Error('There is no audio asset with key "' + key + '" in the audio cache'); + throw new Error('No cached audio asset with key "' + key); } /** @@ -185822,7 +186525,6 @@ var HTML5AudioSound = new Class({ * * @name Phaser.Sound.HTML5AudioSound#audio * @type {HTMLAudioElement} - * @private * @default null * @since 3.0.0 */ @@ -185835,7 +186537,6 @@ var HTML5AudioSound = new Class({ * * @name Phaser.Sound.HTML5AudioSound#startTime * @type {number} - * @private * @default 0 * @since 3.0.0 */ @@ -185847,7 +186548,6 @@ var HTML5AudioSound = new Class({ * * @name Phaser.Sound.HTML5AudioSound#previousTime * @type {number} - * @private * @default 0 * @since 3.0.0 */ @@ -186000,10 +186700,9 @@ var HTML5AudioSound = new Class({ }, /** - * Used internally to do what the name says. + * This method is used internally to pick and play the next available audio tag. * * @method Phaser.Sound.HTML5AudioSound#pickAndPlayAudioTag - * @private * @since 3.0.0 * * @return {boolean} Whether the sound was assigned an audio tag successfully. @@ -186013,6 +186712,7 @@ var HTML5AudioSound = new Class({ if (!this.pickAudioTag()) { this.reset(); + return false; } @@ -186056,7 +186756,6 @@ var HTML5AudioSound = new Class({ * does nothing. * * @method Phaser.Sound.HTML5AudioSound#pickAudioTag - * @private * @since 3.0.0 * * @return {boolean} Whether the sound was assigned an audio tag successfully. @@ -186122,7 +186821,6 @@ var HTML5AudioSound = new Class({ * thrown from rejected Promise returned from play method call. * * @method Phaser.Sound.HTML5AudioSound#playCatchPromise - * @private * @since 3.0.0 */ playCatchPromise: function () @@ -186140,10 +186838,9 @@ var HTML5AudioSound = new Class({ }, /** - * Used internally to do what the name says. + * This method is used internally to stop and release the current audio tag. * * @method Phaser.Sound.HTML5AudioSound#stopAndReleaseAudioTag - * @private * @since 3.0.0 */ stopAndReleaseAudioTag: function () @@ -186164,7 +186861,6 @@ var HTML5AudioSound = new Class({ * or when hijacking audio tag from another sound. * * @method Phaser.Sound.HTML5AudioSound#reset - * @private * @since 3.0.0 */ reset: function () @@ -186177,7 +186873,6 @@ var HTML5AudioSound = new Class({ * Phaser.Sound.HTML5AudioSoundManager#pauseOnBlur is set to true. * * @method Phaser.Sound.HTML5AudioSoundManager#onBlur - * @private * @since 3.0.0 */ onBlur: function () @@ -186197,7 +186892,6 @@ var HTML5AudioSound = new Class({ * Phaser.Sound.HTML5AudioSoundManager#pauseOnBlur is set to true. * * @method Phaser.Sound.HTML5AudioSound#onFocus - * @private * @since 3.0.0 */ onFocus: function () @@ -186213,7 +186907,6 @@ var HTML5AudioSound = new Class({ * @method Phaser.Sound.HTML5AudioSound#update * @fires Phaser.Sound.Events#COMPLETE * @fires Phaser.Sound.Events#LOOPED - * @protected * @since 3.0.0 * * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. @@ -186296,10 +186989,9 @@ var HTML5AudioSound = new Class({ }, /** - * Method used internally to determine mute setting of the sound. + * This method is used internally to update the mute setting of this sound. * * @method Phaser.Sound.HTML5AudioSound#updateMute - * @private * @since 3.0.0 */ updateMute: function () @@ -186311,10 +187003,9 @@ var HTML5AudioSound = new Class({ }, /** - * Method used internally to calculate total volume of the sound. + * This method is used internally to update the volume of this sound. * * @method Phaser.Sound.HTML5AudioSound#updateVolume - * @private * @since 3.0.0 */ updateVolume: function () @@ -186326,10 +187017,9 @@ var HTML5AudioSound = new Class({ }, /** - * Method used internally to calculate total playback rate of the sound. + * This method is used internally to update the playback rate of this sound. * * @method Phaser.Sound.HTML5AudioSound#calculateRate - * @protected * @since 3.0.0 */ calculateRate: function () @@ -186742,7 +187432,7 @@ module.exports = HTML5AudioSound; /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -187212,7 +187902,7 @@ module.exports = HTML5AudioSoundManager; /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -187249,7 +187939,7 @@ module.exports = { /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -187257,6 +187947,7 @@ var BaseSound = __webpack_require__(25798); var Class = __webpack_require__(56694); var EventEmitter = __webpack_require__(6659); var Extend = __webpack_require__(98611); +var NOOP = __webpack_require__(72283); var returnFalse = function () { @@ -187283,6 +187974,7 @@ var returnThis = function () * breaking on devices that don't support any audio playback technologies. * * @class NoAudioSound + * @extends Phaser.Events.EventEmitter * @memberof Phaser.Sound * @constructor * @since 3.0.0 @@ -187303,14 +187995,89 @@ var NoAudioSound = new Class({ EventEmitter.call(this); + /** + * Local reference to the sound manager. + * + * @name Phaser.Sound.NoAudioSound#manager + * @type {Phaser.Sound.BaseSoundManager} + * @since 3.0.0 + */ this.manager = manager; + + /** + * Asset key for the sound. + * + * @name Phaser.Sound.NoAudioSound#key + * @type {string} + * @readonly + * @since 3.0.0 + */ this.key = key; + + /** + * Flag indicating if sound is currently playing. + * + * @name Phaser.Sound.NoAudioSound#isPlaying + * @type {boolean} + * @default false + * @readonly + * @since 3.0.0 + */ this.isPlaying = false; + + /** + * Flag indicating if sound is currently paused. + * + * @name Phaser.Sound.NoAudioSound#isPaused + * @type {boolean} + * @default false + * @readonly + * @since 3.0.0 + */ this.isPaused = false; + + /** + * A property that holds the value of sound's actual playback rate, + * after its rate and detune values has been combined with global + * rate and detune values. + * + * @name Phaser.Sound.NoAudioSound#totalRate + * @type {number} + * @default 1 + * @readonly + * @since 3.0.0 + */ this.totalRate = 1; + + /** + * A value representing the duration, in seconds. + * It could be total sound duration or a marker duration. + * + * @name Phaser.Sound.NoAudioSound#duration + * @type {number} + * @readonly + * @since 3.0.0 + */ this.duration = 0; + + /** + * The total duration of the sound in seconds. + * + * @name Phaser.Sound.NoAudioSound#totalDuration + * @type {number} + * @readonly + * @since 3.0.0 + */ this.totalDuration = 0; + /** + * A config object used to store default sound settings' values. + * Default values will be set by properties' setters. + * + * @name Phaser.Sound.NoAudioSound#config + * @type {Phaser.Types.Sound.SoundConfig} + * @since 3.0.0 + */ this.config = Extend({ mute: false, volume: 1, @@ -187322,16 +188089,132 @@ var NoAudioSound = new Class({ pan: 0 }, config); + /** + * Reference to the currently used config. + * It could be default config or marker config. + * + * @name Phaser.Sound.NoAudioSound#currentConfig + * @type {Phaser.Types.Sound.SoundConfig} + * @since 3.0.0 + */ this.currentConfig = this.config; + + /** + * Boolean indicating whether the sound is muted or not. + * Gets or sets the muted state of this sound. + * + * @name Phaser.Sound.NoAudioSound#mute + * @type {boolean} + * @default false + * @fires Phaser.Sound.Events#MUTE + * @since 3.0.0 + */ this.mute = false; + + /** + * Gets or sets the volume of this sound, a value between 0 (silence) and 1 (full volume). + * + * @name Phaser.Sound.NoAudioSound#volume + * @type {number} + * @default 1 + * @fires Phaser.Sound.Events#VOLUME + * @since 3.0.0 + */ this.volume = 1; + + /** + * Rate at which this Sound will be played. + * Value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed + * and 2.0 doubles the audios playback speed. + * + * @name Phaser.Sound.NoAudioSound#rate + * @type {number} + * @default 1 + * @fires Phaser.Sound.Events#RATE + * @since 3.0.0 + */ this.rate = 1; + + /** + * The detune value of this Sound, given in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29). + * The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + * + * @name Phaser.Sound.NoAudioSound#detune + * @type {number} + * @default 0 + * @fires Phaser.Sound.Events#DETUNE + * @since 3.0.0 + */ this.detune = 0; + + /** + * Property representing the position of playback for this sound, in seconds. + * Setting it to a specific value moves current playback to that position. + * The value given is clamped to the range 0 to current marker duration. + * Setting seek of a stopped sound has no effect. + * + * @name Phaser.Sound.NoAudioSound#seek + * @type {number} + * @fires Phaser.Sound.Events#SEEK + * @since 3.0.0 + */ this.seek = 0; + + /** + * Flag indicating whether or not the sound or current sound marker will loop. + * + * @name Phaser.Sound.NoAudioSound#loop + * @type {boolean} + * @default false + * @fires Phaser.Sound.Events#LOOP + * @since 3.0.0 + */ this.loop = false; + + /** + * Gets or sets the pan of this sound, a value between -1 (full left pan) and 1 (full right pan). + * + * Always returns zero on iOS / Safari as it doesn't support the stereo panner node. + * + * @name Phaser.Sound.NoAudioSound#pan + * @type {number} + * @default 0 + * @fires Phaser.Sound.Events#PAN + * @since 3.50.0 + */ this.pan = 0; + + /** + * Object containing markers definitions. + * + * @name Phaser.Sound.NoAudioSound#markers + * @type {Object.} + * @default {} + * @readonly + * @since 3.0.0 + */ this.markers = {}; + + /** + * Currently playing marker. + * 'null' if whole sound is playing. + * + * @name Phaser.Sound.NoAudioSound#currentMarker + * @type {Phaser.Types.Sound.SoundMarker} + * @default null + * @readonly + * @since 3.0.0 + */ this.currentMarker = null; + + /** + * Flag indicating if destroy method was called on this sound. + * + * @name Phaser.Sound.NoAudioSound#pendingRemove + * @type {boolean} + * @default false + * @since 3.0.0 + */ this.pendingRemove = false; }, @@ -187404,6 +188287,132 @@ var NoAudioSound = new Class({ */ stop: returnFalse, + /** + * Sets the muted state of this Sound. + * + * @method Phaser.Sound.NoAudioSound#setMute + * @since 3.4.0 + * + * @param {boolean} value - `true` to mute this sound, `false` to unmute it. + * + * @return {this} This Sound instance. + */ + setMute: returnThis, + + /** + * Sets the volume of this Sound. + * + * @method Phaser.Sound.NoAudioSound#setVolume + * @since 3.4.0 + * + * @param {number} value - The volume of the sound. + * + * @return {this} This Sound instance. + */ + setVolume: returnThis, + + /** + * Sets the playback rate of this Sound. + * + * For example, a value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed + * and 2.0 doubles the audios playback speed. + * + * @method Phaser.Sound.NoAudioSound#setRate + * @since 3.3.0 + * + * @param {number} value - The playback rate at of this Sound. + * + * @return {this} This Sound instance. + */ + setRate: returnThis, + + /** + * Sets the detune value of this Sound, given in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29). + * The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + * + * @method Phaser.Sound.NoAudioSound#setDetune + * @since 3.3.0 + * + * @param {number} value - The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + * + * @return {this} This Sound instance. + */ + setDetune: returnThis, + + /** + * Seeks to a specific point in this sound. + * + * @method Phaser.Sound.NoAudioSound#setSeek + * @since 3.4.0 + * + * @param {number} value - The point in the sound to seek to. + * + * @return {this} This Sound instance. + */ + setSeek: returnThis, + + /** + * Sets the loop state of this Sound. + * + * @method Phaser.Sound.NoAudioSound#setLoop + * @since 3.4.0 + * + * @param {boolean} value - `true` to loop this sound, `false` to not loop it. + * + * @return {this} This Sound instance. + */ + setLoop: returnThis, + + /** + * Sets the pan of this sound, a value between -1 (full left pan) and 1 (full right pan). + * + * Note: iOS / Safari doesn't support the stereo panner node. + * + * @method Phaser.Sound.NoAudioSound#setPan + * @since 3.50.0 + * + * @param {number} value - The pan of the sound. A value between -1 (full left pan) and 1 (full right pan). + * + * @return {this} This Sound instance. + */ + setPan: returnThis, + + /** + * Method used internally for applying config values to some of the sound properties. + * + * @method Phaser.Sound.NoAudioSound#applyConfig + * @since 3.0.0 + */ + applyConfig: returnNull, + + /** + * Method used internally for resetting values of some of the config properties. + * + * @method Phaser.Sound.NoAudioSound#resetConfig + * @since 3.0.0 + */ + resetConfig: returnNull, + + /** + * Update method called automatically by sound manager on every game step. + * + * @method Phaser.Sound.NoAudioSound#update + * @override + * @since 3.0.0 + * + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} delta - The delta time elapsed since the last frame. + */ + update: NOOP, + + /** + * Method used internally to calculate total playback rate of the sound. + * + * @method Phaser.Sound.NoAudioSound#calculateRate + * @since 3.0.0 + */ + calculateRate: returnNull, + /** * Destroys this sound and all associated events and marks it for removal from the sound manager. * @@ -187414,21 +188423,7 @@ var NoAudioSound = new Class({ destroy: function () { BaseSound.prototype.destroy.call(this); - }, - - setMute: returnThis, - - setVolume: returnThis, - - setRate: returnThis, - - setDetune: returnThis, - - setSeek: returnThis, - - setLoop: returnThis, - - setPan: returnThis + } }); @@ -187443,7 +188438,7 @@ module.exports = NoAudioSound; /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -187490,6 +188485,17 @@ var NoAudioSoundManager = new Class({ this.locked = false; }, + /** + * Adds a new sound into the sound manager. + * + * @method Phaser.Sound.NoAudioSoundManager#add + * @since 3.60.0 + * + * @param {string} key - Asset key for the sound. + * @param {Phaser.Types.Sound.SoundConfig} [config] - An optional config object containing default sound settings. + * + * @return {Phaser.Sound.NoAudioSound} The new sound instance. + */ add: function (key, config) { var sound = new NoAudioSound(this, key, config); @@ -187499,6 +188505,19 @@ var NoAudioSoundManager = new Class({ return sound; }, + /** + * Adds a new audio sprite sound into the sound manager. + * Audio Sprites are a combination of audio files and a JSON configuration. + * The JSON follows the format of that created by https://github.com/tonistiigi/audiosprite + * + * @method Phaser.Sound.NoAudioSoundManager#addAudioSprite + * @since 3.60.0 + * + * @param {string} key - Asset key for the sound. + * @param {Phaser.Types.Sound.SoundConfig} [config] - An optional config object containing default sound settings. + * + * @return {Phaser.Sound.NoAudioSound} The new audio sprite sound instance. + */ addAudioSprite: function (key, config) { var sound = this.add(key, config); @@ -187508,42 +188527,260 @@ var NoAudioSoundManager = new Class({ return sound; }, + /** + * Gets the first sound in the manager matching the given key, if any. + * + * @method Phaser.Sound.NoAudioSoundManager#get + * @since 3.23.0 + * + * @param {string} key - Sound asset key. + * + * @return {?Phaser.Sound.BaseSound} - The sound, or null. + */ + get: function (key) + { + return BaseSoundManager.prototype.get.call(this, key); + }, + + /** + * Gets any sounds in the manager matching the given key. + * + * @method Phaser.Sound.NoAudioSoundManager#getAll + * @since 3.23.0 + * + * @param {string} key - Sound asset key. + * + * @return {Phaser.Sound.BaseSound[]} - The sounds, or an empty array. + */ + getAll: function (key) + { + return BaseSoundManager.prototype.getAll.call(this, key); + }, + + /** + * This method does nothing but return 'false' for the No Audio Sound Manager, to maintain + * compatibility with the other Sound Managers. + * + * @method Phaser.Sound.NoAudioSoundManager#play + * @since 3.0.0 + * + * @param {string} key - Asset key for the sound. + * @param {(Phaser.Types.Sound.SoundConfig|Phaser.Types.Sound.SoundMarker)} [extra] - An optional additional object containing settings to be applied to the sound. It could be either config or marker object. + * + * @return {boolean} Always 'false' for the No Audio Sound Manager. + */ // eslint-disable-next-line no-unused-vars play: function (key, extra) { return false; }, + /** + * This method does nothing but return 'false' for the No Audio Sound Manager, to maintain + * compatibility with the other Sound Managers. + * + * @method Phaser.Sound.NoAudioSoundManager#playAudioSprite + * @since 3.0.0 + * + * @param {string} key - Asset key for the sound. + * @param {string} spriteName - The name of the sound sprite to play. + * @param {Phaser.Types.Sound.SoundConfig} [config] - An optional config object containing default sound settings. + * + * @return {boolean} Always 'false' for the No Audio Sound Manager. + */ // eslint-disable-next-line no-unused-vars playAudioSprite: function (key, spriteName, config) { return false; }, + /** + * Removes a sound from the sound manager. + * The removed sound is destroyed before removal. + * + * @method Phaser.Sound.NoAudioSoundManager#remove + * @since 3.0.0 + * + * @param {Phaser.Sound.BaseSound} sound - The sound object to remove. + * + * @return {boolean} True if the sound was removed successfully, otherwise false. + */ remove: function (sound) { return BaseSoundManager.prototype.remove.call(this, sound); }, + /** + * Removes all sounds from the manager, destroying the sounds. + * + * @method Phaser.Sound.NoAudioSoundManager#removeAll + * @since 3.23.0 + */ + removeAll: function () + { + return BaseSoundManager.prototype.removeAll.call(this); + }, + + /** + * Removes all sounds from the sound manager that have an asset key matching the given value. + * The removed sounds are destroyed before removal. + * + * @method Phaser.Sound.NoAudioSoundManager#removeByKey + * @since 3.0.0 + * + * @param {string} key - The key to match when removing sound objects. + * + * @return {number} The number of matching sound objects that were removed. + */ removeByKey: function (key) { return BaseSoundManager.prototype.removeByKey.call(this, key); }, + /** + * Stops any sounds matching the given key. + * + * @method Phaser.Sound.NoAudioSoundManager#stopByKey + * @since 3.23.0 + * + * @param {string} key - Sound asset key. + * + * @return {number} - How many sounds were stopped. + */ + stopByKey: function (key) + { + return BaseSoundManager.prototype.stopByKey.call(this, key); + }, + + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#onBlur + * @since 3.0.0 + */ + onBlur: NOOP, + + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#onFocus + * @since 3.0.0 + */ + onFocus: NOOP, + + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#onGameBlur + * @since 3.0.0 + */ + onGameBlur: NOOP, + + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#onGameFocus + * @since 3.0.0 + */ + onGameFocus: NOOP, + + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#pauseAll + * @since 3.0.0 + */ pauseAll: NOOP, + + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#resumeAll + * @since 3.0.0 + */ resumeAll: NOOP, + + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#stopAll + * @since 3.0.0 + */ stopAll: NOOP, + + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#update + * @since 3.0.0 + */ update: NOOP, + + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#setRate + * @since 3.0.0 + * + * @return {this} This Sound Manager. + */ setRate: NOOP, + + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#setDetune + * @since 3.0.0 + * + * @return {this} This Sound Manager. + */ setDetune: NOOP, + + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#setMute + * @since 3.0.0 + */ setMute: NOOP, + + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#setVolume + * @since 3.0.0 + */ setVolume: NOOP, + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#unlock + * @since 3.0.0 + */ + unlock: NOOP, + + /** + * Method used internally for iterating only over active sounds and skipping sounds that are marked for removal. + * + * @method Phaser.Sound.NoAudioSoundManager#forEachActiveSound + * @private + * @since 3.0.0 + * + * @param {Phaser.Types.Sound.EachActiveSoundCallback} callback - Callback function. (manager: Phaser.Sound.BaseSoundManager, sound: Phaser.Sound.BaseSound, index: number, sounds: Phaser.Manager.BaseSound[]) => void + * @param {*} [scope] - Callback context. + */ forEachActiveSound: function (callbackfn, scope) { BaseSoundManager.prototype.forEachActiveSound.call(this, callbackfn, scope); }, + /** + * Destroys all the sounds in the game and all associated events. + * + * @method Phaser.Sound.NoAudioSoundManager#destroy + * @since 3.0.0 + */ destroy: function () { BaseSoundManager.prototype.destroy.call(this); @@ -187562,7 +188799,7 @@ module.exports = NoAudioSoundManager; /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -187660,11 +188897,13 @@ var WebAudioSound = new Class({ /** * The time at which the sound should have started playback from the beginning. - * Based on BaseAudioContext.currentTime value. + * + * Treat this property as read-only. + * + * Based on `BaseAudioContext.currentTime` value. * * @name Phaser.Sound.WebAudioSound#playTime * @type {number} - * @private * @default 0 * @since 3.0.0 */ @@ -187672,11 +188911,13 @@ var WebAudioSound = new Class({ /** * The time at which the sound source should have actually started playback. - * Based on BaseAudioContext.currentTime value. + * + * Treat this property as read-only. + * + * Based on `BaseAudioContext.currentTime` value. * * @name Phaser.Sound.WebAudioSound#startTime * @type {number} - * @private * @default 0 * @since 3.0.0 */ @@ -187684,11 +188925,11 @@ var WebAudioSound = new Class({ /** * The time at which the sound loop source should actually start playback. - * Based on BaseAudioContext.currentTime value. + * + * Based on `BaseAudioContext.currentTime` value. * * @name Phaser.Sound.WebAudioSound#loopTime * @type {number} - * @private * @default 0 * @since 3.0.0 */ @@ -187696,11 +188937,13 @@ var WebAudioSound = new Class({ /** * An array where we keep track of all rate updates during playback. - * Array of object types: { time: number, rate: number } + * + * Treat this property as read-only. + * + * Array of object types: `{ time: number, rate: number }` * * @name Phaser.Sound.WebAudioSound#rateUpdates * @type {array} - * @private * @default [] * @since 3.0.0 */ @@ -187893,10 +189136,9 @@ var WebAudioSound = new Class({ }, /** - * Used internally. + * This method is only used internally and it creates a looping buffer source. * * @method Phaser.Sound.WebAudioSound#createAndStartLoopBufferSource - * @private * @since 3.0.0 */ createAndStartLoopBufferSource: function () @@ -187912,10 +189154,9 @@ var WebAudioSound = new Class({ }, /** - * Used internally. + * This method is only used internally and it creates a buffer source. * * @method Phaser.Sound.WebAudioSound#createBufferSource - * @private * @since 3.0.0 * * @return {AudioBufferSourceNode} @@ -187951,10 +189192,9 @@ var WebAudioSound = new Class({ }, /** - * Used internally. + * This method is only used internally and it stops and removes a buffer source. * * @method Phaser.Sound.WebAudioSound#stopAndRemoveBufferSource - * @private * @since 3.0.0 */ stopAndRemoveBufferSource: function () @@ -187973,10 +189213,9 @@ var WebAudioSound = new Class({ }, /** - * Used internally. + * This method is only used internally and it stops and removes a looping buffer source. * * @method Phaser.Sound.WebAudioSound#stopAndRemoveLoopBufferSource - * @private * @since 3.0.0 */ stopAndRemoveLoopBufferSource: function () @@ -187995,7 +189234,6 @@ var WebAudioSound = new Class({ * Method used internally for applying config values to some of the sound properties. * * @method Phaser.Sound.WebAudioSound#applyConfig - * @protected * @since 3.0.0 */ applyConfig: function () @@ -188016,7 +189254,6 @@ var WebAudioSound = new Class({ * @method Phaser.Sound.WebAudioSound#update * @fires Phaser.Sound.Events#COMPLETE * @fires Phaser.Sound.Events#LOOPED - * @protected * @since 3.0.0 */ update: function () @@ -188059,6 +189296,11 @@ var WebAudioSound = new Class({ */ destroy: function () { + if (this.pendingRemove) + { + return; + } + BaseSound.prototype.destroy.call(this); this.audioBuffer = null; @@ -188082,7 +189324,6 @@ var WebAudioSound = new Class({ * Method used internally to calculate total playback rate of the sound. * * @method Phaser.Sound.WebAudioSound#calculateRate - * @protected * @since 3.0.0 */ calculateRate: function () @@ -188115,7 +189356,6 @@ var WebAudioSound = new Class({ * Method used internally for calculating current playback time of a playing sound. * * @method Phaser.Sound.WebAudioSound#getCurrentTime - * @private * @since 3.0.0 */ getCurrentTime: function () @@ -188146,7 +189386,6 @@ var WebAudioSound = new Class({ * at witch the loop source should start playing. * * @method Phaser.Sound.WebAudioSound#getLoopTime - * @private * @since 3.0.0 */ getLoopTime: function () @@ -188547,7 +189786,7 @@ module.exports = WebAudioSound; /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -189046,7 +190285,7 @@ module.exports = WebAudioSoundManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -189895,7 +191134,7 @@ module.exports = List; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -190271,7 +191510,7 @@ module.exports = Map; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -190370,6 +191609,60 @@ var ProcessQueue = new Class({ this.checkQueue = false; }, + /** + * Checks the given item to see if it is already active within this Process Queue. + * + * @method Phaser.Structs.ProcessQueue#isActive + * @since 3.60.0 + * + * @genericUse {T} - [item] + * @genericUse {Phaser.Structs.ProcessQueue.} - [$return] + * + * @param {*} item - The item to check. + * + * @return {boolean} `true` if the item is active, otherwise `false`. + */ + isActive: function (item) + { + return (this._active.indexOf(item) > -1); + }, + + /** + * Checks the given item to see if it is already pending addition to this Process Queue. + * + * @method Phaser.Structs.ProcessQueue#isPending + * @since 3.60.0 + * + * @genericUse {T} - [item] + * @genericUse {Phaser.Structs.ProcessQueue.} - [$return] + * + * @param {*} item - The item to check. + * + * @return {boolean} `true` if the item is pending insertion, otherwise `false`. + */ + isPending: function (item) + { + return (this._toProcess > 0 && this._pending.indexOf(item) > -1); + }, + + /** + * Checks the given item to see if it is already pending destruction from this Process Queue. + * + * @method Phaser.Structs.ProcessQueue#isDestroying + * @since 3.60.0 + * + * @genericUse {T} - [item] + * @genericUse {Phaser.Structs.ProcessQueue.} - [$return] + * + * @param {*} item - The item to check. + * + * @return {boolean} `true` if the item is pending destruction, otherwise `false`. + */ + isDestroying: function (item) + { + return (this._destroy.indexOf(item) > -1); + }, + /** * Adds a new item to the Process Queue. * @@ -190387,6 +191680,12 @@ var ProcessQueue = new Class({ */ add: function (item) { + // Don't add if already active or pending + if (this.checkQueue && (this.isActive(item) || this.isPending(item))) + { + return item; + } + this._pending.push(item); this._toProcess++; @@ -190397,7 +191696,7 @@ var ProcessQueue = new Class({ /** * Removes an item from the Process Queue. * - * The item is added to the pending destroy and fully removed in the next update. + * The item is added to the 'destroy' list and is fully removed in the next update. * * @method Phaser.Structs.ProcessQueue#remove * @since 3.0.0 @@ -190411,9 +191710,29 @@ var ProcessQueue = new Class({ */ remove: function (item) { - this._destroy.push(item); + // Check if it's in the _pending list + if (this.isPending(item)) + { + var pending = this._pending; - this._toProcess++; + var idx = pending.indexOf(item); + + if (idx !== -1) + { + // Remove directly, no need to wait for an update loop + pending.splice(idx, 1); + } + } + else if (this.isActive(item)) + { + // Item is actively running? Queue it for deletion + this._destroy.push(item); + + this._toProcess++; + } + + // If neither of the above conditions pass, then the item is either already in the destroy list, + // or isn't pending or active, so cannot be removed anyway return item; }, @@ -190576,7 +191895,7 @@ module.exports = ProcessQueue; /** * @author Vladimir Agafonkin * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -190592,7 +191911,7 @@ var quickselect = __webpack_require__(53466); * * This version of RBush uses a fixed min/max accessor structure of `[ '.left', '.top', '.right', '.bottom' ]`. * This is to avoid the eval like function creation that the original library used, which caused CSP policy violations. - * + * * rbush is forked from https://github.com/mourner/rbush by Vladimir Agafonkin * * @class RTree @@ -191180,6 +192499,7 @@ function multiSelect (arr, left, right, n, compare) module.exports = rbush; + /***/ }), /***/ 58403: @@ -191187,7 +192507,7 @@ module.exports = rbush; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -191637,7 +192957,7 @@ module.exports = Set; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -191649,7 +192969,7 @@ var Vector2 = __webpack_require__(93736); /** * @classdesc * The Size component allows you to set `width` and `height` properties and define the relationship between them. - * + * * The component can automatically maintain the aspect ratios between the two values, and clamp them * to a defined min-max range. You can also control the dominant axis. When dimensions are given to the Size component * that would cause it to exceed its min-max range, the dimensions are adjusted based on the dominant axis. @@ -191718,7 +193038,7 @@ var Size = new Class({ /** * The proportional relationship between the width and height. - * + * * This property is read-only and is updated automatically when either the `width` or `height` properties are changed, * depending on the aspect mode. * @@ -191777,9 +193097,9 @@ var Size = new Class({ /** * A Vector2 containing the horizontal and vertical snap values, which the width and height are snapped to during resizing. - * + * * By default this is disabled. - * + * * This property is read-only. To change it see the `setSnap` method. * * @name Phaser.Structs.Size#snapTo @@ -191792,19 +193112,19 @@ var Size = new Class({ /** * Sets the aspect mode of this Size component. - * + * * The aspect mode controls what happens when you modify the `width` or `height` properties, or call `setSize`. - * + * * It can be a number from 0 to 4, or a Size constant: - * + * * 0. NONE = Do not make the size fit the aspect ratio. Change the ratio when the size changes. * 1. WIDTH_CONTROLS_HEIGHT = The height is automatically adjusted based on the width. * 2. HEIGHT_CONTROLS_WIDTH = The width is automatically adjusted based on the height. * 3. FIT = The width and height are automatically adjusted to fit inside the given target area, while keeping the aspect ratio. Depending on the aspect ratio there may be some space inside the area which is not covered. * 4. ENVELOP = The width and height are automatically adjusted to make the size cover the entire target area while keeping the aspect ratio. This may extend further out than the target size. - * + * * Calling this method automatically recalculates the `width` and the `height`, if required. - * + * * @method Phaser.Structs.Size#setAspectMode * @since 3.16.0 * @@ -191825,14 +193145,14 @@ var Size = new Class({ * By setting a Snap To value when this Size component is modified its dimensions will automatically * by snapped to the nearest grid slice, using floor. For example, if you have snap value of 16, * and the width changes to 68, then it will snap down to 64 (the closest multiple of 16 when floored) - * + * * Note that snapping takes place before adjustments by the parent, or the min / max settings. If these * values are not multiples of the given snap values, then this can result in un-snapped dimensions. - * + * * Call this method with no arguments to reset the snap values. - * + * * Calling this method automatically recalculates the `width` and the `height`, if required. - * + * * @method Phaser.Structs.Size#setSnap * @since 3.16.0 * @@ -191853,18 +193173,18 @@ var Size = new Class({ /** * Sets, or clears, the parent of this Size component. - * + * * To clear the parent call this method with no arguments. - * + * * The parent influences the maximum extents to which this Size component can expand, * based on the aspect mode: - * + * * NONE - The parent clamps both the width and height. * WIDTH_CONTROLS_HEIGHT - The parent clamps just the width. * HEIGHT_CONTROLS_WIDTH - The parent clamps just the height. * FIT - The parent clamps whichever axis is required to ensure the size fits within it. * ENVELOP - The parent is used to ensure the size fully envelops the parent. - * + * * Calling this method automatically calls `setSize`. * * @method Phaser.Structs.Size#setParent @@ -191883,11 +193203,11 @@ var Size = new Class({ /** * Set the minimum width and height values this Size component will allow. - * + * * The minimum values can never be below zero, or greater than the maximum values. - * + * * Setting this will automatically adjust both the `width` and `height` properties to ensure they are within range. - * + * * Note that based on the aspect mode, and if this Size component has a parent set or not, the minimums set here * _can_ be exceed in some situations. * @@ -191912,9 +193232,9 @@ var Size = new Class({ /** * Set the maximum width and height values this Size component will allow. - * + * * Setting this will automatically adjust both the `width` and `height` properties to ensure they are within range. - * + * * Note that based on the aspect mode, and if this Size component has a parent set or not, the maximums set here * _can_ be exceed in some situations. * @@ -191939,16 +193259,16 @@ var Size = new Class({ /** * Sets the width and height of this Size component based on the aspect mode. - * + * * If the aspect mode is 'none' then calling this method will change the aspect ratio, otherwise the current * aspect ratio is honored across all other modes. - * + * * If snapTo values have been set then the given width and height are snapped first, prior to any further * adjustment via min/max values, or a parent. - * + * * If minimum and/or maximum dimensions have been specified, the values given to this method will be clamped into * that range prior to adjustment, but may still exceed them depending on the aspect mode. - * + * * If this Size component has a parent set, and the aspect mode is `fit` or `envelop`, then the given sizes will * be clamped to the range specified by the parent. * @@ -191964,7 +193284,7 @@ var Size = new Class({ { if (width === undefined) { width = 0; } if (height === undefined) { height = width; } - + switch (this.aspectMode) { case Size.NONE: @@ -191997,7 +193317,7 @@ var Size = new Class({ /** * Sets a new aspect ratio, overriding what was there previously. - * + * * It then calls `setSize` immediately using the current dimensions. * * @method Phaser.Structs.Size#setAspectRatio @@ -192016,7 +193336,7 @@ var Size = new Class({ /** * Sets a new width and height for this Size component and updates the aspect ratio based on them. - * + * * It _doesn't_ change the `aspectMode` and still factors in size limits such as the min max and parent bounds. * * @method Phaser.Structs.Size#resize @@ -192050,7 +193370,7 @@ var Size = new Class({ getNewWidth: function (value, checkParent) { if (checkParent === undefined) { checkParent = true; } - + value = Clamp(value, this.minWidth, this.maxWidth); if (checkParent && this._parent && value > this._parent.width) @@ -192088,10 +193408,10 @@ var Size = new Class({ /** * The current `width` and `height` are adjusted to fit inside the given dimensions, while keeping the aspect ratio. - * + * * If `fit` is true there may be some space inside the target area which is not covered if its aspect ratio differs. * If `fit` is false the size may extend further out than the target area if the aspect ratios differ. - * + * * If this Size component has a parent set, then the width and height passed to this method will be clamped so * it cannot exceed that of the parent. * @@ -192157,9 +193477,9 @@ var Size = new Class({ /** * The current `width` and `height` are adjusted to fit inside the given dimensions, while keeping the aspect ratio. - * + * * There may be some space inside the target area which is not covered if its aspect ratio differs. - * + * * If this Size component has a parent set, then the width and height passed to this method will be clamped so * it cannot exceed that of the parent. * @@ -192178,9 +193498,9 @@ var Size = new Class({ /** * The current `width` and `height` are adjusted so that they fully envelope the given dimensions, while keeping the aspect ratio. - * + * * The size may extend further out than the target area if the aspect ratios differ. - * + * * If this Size component has a parent set, then the values are clamped so that it never exceeds the parent * on the longest axis. * @@ -192199,7 +193519,7 @@ var Size = new Class({ /** * Sets the width of this Size component. - * + * * Depending on the aspect mode, changing the width may also update the height and aspect ratio. * * @method Phaser.Structs.Size#setWidth @@ -192216,7 +193536,7 @@ var Size = new Class({ /** * Sets the height of this Size component. - * + * * Depending on the aspect mode, changing the height may also update the width and aspect ratio. * * @method Phaser.Structs.Size#setHeight @@ -192268,7 +193588,7 @@ var Size = new Class({ * * @method Phaser.Structs.Size#copy * @since 3.16.0 - * + * * @param {Phaser.Structs.Size} destination - The Size component to copy the values to. * * @return {Phaser.Structs.Size} The updated destination Size component. @@ -192284,9 +193604,9 @@ var Size = new Class({ /** * Destroys this Size component. - * + * * This clears the local properties and any parent object, if set. - * + * * A destroyed Size component cannot be re-used. * * @method Phaser.Structs.Size#destroy @@ -192300,11 +193620,11 @@ var Size = new Class({ /** * The width of this Size component. - * + * * This value is clamped to the range specified by `minWidth` and `maxWidth`, if enabled. - * + * * A width can never be less than zero. - * + * * Changing this value will automatically update the `height` if the aspect ratio lock is enabled. * You can also use the `setWidth` and `getWidth` methods. * @@ -192328,11 +193648,11 @@ var Size = new Class({ /** * The height of this Size component. - * + * * This value is clamped to the range specified by `minHeight` and `maxHeight`, if enabled. - * + * * A height can never be less than zero. - * + * * Changing this value will automatically update the `width` if the aspect ratio lock is enabled. * You can also use the `setHeight` and `getHeight` methods. * @@ -192358,7 +193678,7 @@ var Size = new Class({ /** * Do not make the size fit the aspect ratio. Change the ratio when the size changes. - * + * * @name Phaser.Structs.Size.NONE * @constant * @type {number} @@ -192368,7 +193688,7 @@ Size.NONE = 0; /** * The height is automatically adjusted based on the width. - * + * * @name Phaser.Structs.Size.WIDTH_CONTROLS_HEIGHT * @constant * @type {number} @@ -192378,7 +193698,7 @@ Size.WIDTH_CONTROLS_HEIGHT = 1; /** * The width is automatically adjusted based on the height. - * + * * @name Phaser.Structs.Size.HEIGHT_CONTROLS_WIDTH * @constant * @type {number} @@ -192388,7 +193708,7 @@ Size.HEIGHT_CONTROLS_WIDTH = 2; /** * The width and height are automatically adjusted to fit inside the given target area, while keeping the aspect ratio. Depending on the aspect ratio there may be some space inside the area which is not covered. - * + * * @name Phaser.Structs.Size.FIT * @constant * @type {number} @@ -192398,7 +193718,7 @@ Size.FIT = 3; /** * The width and height are automatically adjusted to make the size cover the entire target area while keeping the aspect ratio. This may extend further out than the target size. - * + * * @name Phaser.Structs.Size.ENVELOP * @constant * @type {number} @@ -192416,22 +193736,22 @@ module.exports = Size; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Process Queue Add Event. - * + * * This event is dispatched by a Process Queue when a new item is successfully moved to its active list. - * + * * You will most commonly see this used by a Scene's Update List when a new Game Object has been added. - * + * * In that instance, listen to this event from within a Scene using: `this.sys.updateList.on('add', listener)`. * * @event Phaser.Structs.Events#PROCESS_QUEUE_ADD * @since 3.20.0 - * + * * @param {*} item - The item that was added to the Process Queue. */ module.exports = 'add'; @@ -192444,22 +193764,22 @@ module.exports = 'add'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Process Queue Remove Event. - * + * * This event is dispatched by a Process Queue when a new item is successfully removed from its active list. - * + * * You will most commonly see this used by a Scene's Update List when a Game Object has been removed. - * + * * In that instance, listen to this event from within a Scene using: `this.sys.updateList.on('remove', listener)`. * * @event Phaser.Structs.Events#PROCESS_QUEUE_REMOVE * @since 3.20.0 - * + * * @param {*} item - The item that was removed from the Process Queue. */ module.exports = 'remove'; @@ -192472,7 +193792,7 @@ module.exports = 'remove'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -192495,7 +193815,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -192523,7 +193843,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -193159,7 +194479,7 @@ module.exports = CanvasTexture; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -194017,7 +195337,7 @@ module.exports = Frame; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -194546,7 +195866,7 @@ module.exports = Texture; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -194634,7 +195954,7 @@ var TextureManager = new Class({ * @private * @since 3.0.0 */ - this._tempCanvas = CanvasPool.create2D(this, 1, 1); + this._tempCanvas = CanvasPool.create2D(this); /** * The context of the temporary canvas element made to save an pixel data in getPixel() and getPixelAlpha() method. @@ -194644,7 +195964,7 @@ var TextureManager = new Class({ * @private * @since 3.0.0 */ - this._tempContext = this._tempCanvas.getContext('2d'); + this._tempContext = this._tempCanvas.getContext('2d', { willReadFrequently: true }); /** * An counting value used for emitting 'ready' event after all of managers in game is loaded. @@ -194705,6 +196025,7 @@ var TextureManager = new Class({ /** * Checks the given texture key and throws a console.warn if the key is already in use, then returns false. + * * If you wish to avoid the console.warn then use `TextureManager.exists` instead. * * @method Phaser.Textures.TextureManager#checkKey @@ -194765,6 +196086,7 @@ var TextureManager = new Class({ key.destroy(); this.emit(Events.REMOVE, key.key); + this.emit(Events.REMOVE_KEY + key.key); } return this; @@ -194828,7 +196150,7 @@ var TextureManager = new Class({ Parser.Image(texture, 0); _this.emit(Events.ADD, key, texture); - + _this.emit(Events.ADD_KEY + key, texture); _this.emit(Events.LOAD, key, texture); }; @@ -194877,17 +196199,20 @@ var TextureManager = new Class({ var canvas = CanvasPool.create2D(this, cd.width, cd.height); var ctx = canvas.getContext('2d'); - ctx.drawImage( - textureFrame.source.image, - cd.x, - cd.y, - cd.width, - cd.height, - 0, - 0, - cd.width, - cd.height - ); + if (cd.width > 0 && cd.height > 0) + { + ctx.drawImage( + textureFrame.source.image, + cd.x, + cd.y, + cd.width, + cd.height, + 0, + 0, + cd.width, + cd.height + ); + } data = canvas.toDataURL(type, encoderOptions); @@ -194926,6 +196251,7 @@ var TextureManager = new Class({ } this.emit(Events.ADD, key, texture); + this.emit(Events.ADD_KEY + key, texture); } return texture; @@ -194966,6 +196292,7 @@ var TextureManager = new Class({ texture.add('__BASE', 0, 0, 0, width, height); this.emit(Events.ADD, key, texture); + this.emit(Events.ADD_KEY + key, texture); } return texture; @@ -195016,6 +196343,7 @@ var TextureManager = new Class({ } this.emit(Events.ADD, key, texture); + this.emit(Events.ADD_KEY + key, texture); } return texture; @@ -195045,6 +196373,7 @@ var TextureManager = new Class({ texture.add('__BASE', 0, 0, 0, renderTexture.width, renderTexture.height); this.emit(Events.ADD, key, texture); + this.emit(Events.ADD_KEY + key, texture); } return texture; @@ -195172,6 +196501,7 @@ var TextureManager = new Class({ this.list[key] = texture; this.emit(Events.ADD, key, texture); + this.emit(Events.ADD_KEY + key, texture); } return texture; @@ -195252,6 +196582,7 @@ var TextureManager = new Class({ } this.emit(Events.ADD, key, texture); + this.emit(Events.ADD_KEY + key, texture); } return texture; @@ -195299,6 +196630,7 @@ var TextureManager = new Class({ } this.emit(Events.ADD, key, texture); + this.emit(Events.ADD_KEY + key, texture); } return texture; @@ -195335,6 +196667,7 @@ var TextureManager = new Class({ } this.emit(Events.ADD, key, texture); + this.emit(Events.ADD_KEY + key, texture); } return texture; @@ -195371,6 +196704,7 @@ var TextureManager = new Class({ } this.emit(Events.ADD, key, texture); + this.emit(Events.ADD_KEY + key, texture); } return texture; @@ -195380,32 +196714,45 @@ var TextureManager = new Class({ * Adds a Sprite Sheet to this Texture Manager. * * In Phaser terminology a Sprite Sheet is a texture containing different frames, but each frame is the exact - * same size and cannot be trimmed or rotated. + * same size and cannot be trimmed or rotated. This is different to a Texture Atlas, created by tools such as + * Texture Packer, and more akin with the fixed-frame exports you get from apps like Aseprite or old arcade + * games. + * + * As of Phaser 3.60 you can use this method to add a sprite sheet to an existing Phaser Texture. * * @method Phaser.Textures.TextureManager#addSpriteSheet * @fires Phaser.Textures.Events#ADD * @since 3.0.0 * - * @param {string} key - The unique string-based key of the Texture. - * @param {HTMLImageElement} source - The source Image element. + * @param {string} key - The unique string-based key of the Texture. Give an empty string if you provide a Phaser Texture as the 2nd argument. + * @param {(HTMLImageElement|Phaser.Textures.Texture)} source - The source Image element, or a Phaser Texture. * @param {Phaser.Types.Textures.SpriteSheetConfig} config - The configuration object for this Sprite Sheet. * - * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use. + * @return {?Phaser.Textures.Texture} The Texture that was created or updated, or `null` if the key is already in use. */ addSpriteSheet: function (key, source, config) { var texture = null; - if (this.checkKey(key)) + if (source instanceof Texture) + { + key = texture.key; + texture = source; + } + else if (this.checkKey(key)) { texture = this.create(key, source); + } + if (texture) + { var width = texture.source[0].width; var height = texture.source[0].height; Parser.SpriteSheet(texture, 0, 0, 0, width, height, config); this.emit(Events.ADD, key, texture); + this.emit(Events.ADD_KEY + key, texture); } return texture; @@ -195459,6 +196806,7 @@ var TextureManager = new Class({ } this.emit(Events.ADD, key, texture); + this.emit(Events.ADD_KEY + key, texture); return texture; } @@ -195580,7 +196928,7 @@ var TextureManager = new Class({ /** * Returns an array with all of the keys of all Textures in this Texture Manager. - * The output array will exclude the `__DEFAULT` and `__MISSING` keys. + * The output array will exclude the `__DEFAULT`, `__MISSING`, and `__WHITE` keys. * * @method Phaser.Textures.TextureManager#getTextureKeys * @since 3.0.0 @@ -195593,7 +196941,7 @@ var TextureManager = new Class({ for (var key in this.list) { - if (key !== '__DEFAULT' && key !== '__MISSING') + if (key !== '__DEFAULT' && key !== '__MISSING' && key !== '__WHITE') { output.push(key); } @@ -195812,7 +197160,7 @@ module.exports = TextureManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -196186,7 +197534,7 @@ module.exports = TextureSource; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -196201,7 +197549,7 @@ var CONST = { /** * Linear filter type. - * + * * @name Phaser.Textures.FilterMode.LINEAR * @type {number} * @const @@ -196211,14 +197559,14 @@ var CONST = { /** * Nearest neighbor filter type. - * + * * @name Phaser.Textures.FilterMode.NEAREST * @type {number} * @const * @since 3.0.0 */ NEAREST: 1 - + }; module.exports = CONST; @@ -196231,26 +197579,52 @@ module.exports = CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Texture Add Event. - * + * * This event is dispatched by the Texture Manager when a texture is added to it. - * + * * Listen to this event from within a Scene using: `this.textures.on('addtexture', listener)`. * * @event Phaser.Textures.Events#ADD * @since 3.0.0 - * + * * @param {string} key - The key of the Texture that was added to the Texture Manager. * @param {Phaser.Textures.Texture} texture - A reference to the Texture that was added to the Texture Manager. */ module.exports = 'addtexture'; +/***/ }), + +/***/ 29569: +/***/ ((module) => { + +/** + * @author samme + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Texture Add Key Event. + * + * This event is dispatched by the Texture Manager when a texture with the given key is added to it. + * + * Listen to this event from within a Scene using: `this.textures.on('addtexture-key', listener)`. + * + * @event Phaser.Textures.Events#ADD_KEY + * @since 3.60.0 + * + * @param {Phaser.Textures.Texture} texture - A reference to the Texture that was added to the Texture Manager. + */ +module.exports = 'addtexture-'; + + /***/ }), /***/ 60079: @@ -196258,21 +197632,21 @@ module.exports = 'addtexture'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Texture Load Error Event. - * + * * This event is dispatched by the Texture Manager when a texture it requested to load failed. * This only happens when base64 encoded textures fail. All other texture types are loaded via the Loader Plugin. - * + * * Listen to this event from within a Scene using: `this.textures.on('onerror', listener)`. * * @event Phaser.Textures.Events#ERROR * @since 3.0.0 - * + * * @param {string} key - The key of the Texture that failed to load into the Texture Manager. */ module.exports = 'onerror'; @@ -196285,23 +197659,23 @@ module.exports = 'onerror'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Texture Load Event. - * + * * This event is dispatched by the Texture Manager when a texture has finished loading on it. * This only happens for base64 encoded textures. All other texture types are loaded via the Loader Plugin. - * + * * Listen to this event from within a Scene using: `this.textures.on('onload', listener)`. - * + * * This event is dispatched after the [ADD]{@linkcode Phaser.Textures.Events#event:ADD} event. * * @event Phaser.Textures.Events#LOAD * @since 3.0.0 - * + * * @param {string} key - The key of the Texture that was loaded by the Texture Manager. * @param {Phaser.Textures.Texture} texture - A reference to the Texture that was loaded by the Texture Manager. */ @@ -196315,13 +197689,13 @@ module.exports = 'onload'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * This internal event signifies that the Texture Manager is now ready and the Game can continue booting. - * + * * When a Phaser Game instance is booting for the first time, the Texture Manager has to wait on a couple of non-blocking * async events before it's fully ready to carry on. When those complete the Texture Manager emits this event via the Game * instance, which tells the Game to carry on booting. @@ -196339,28 +197713,55 @@ module.exports = 'ready'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Texture Remove Event. - * + * * This event is dispatched by the Texture Manager when a texture is removed from it. - * + * * Listen to this event from within a Scene using: `this.textures.on('removetexture', listener)`. - * + * * If you have any Game Objects still using the removed texture, they will start throwing * errors the next time they try to render. Be sure to clear all use of the texture in this event handler. * * @event Phaser.Textures.Events#REMOVE * @since 3.0.0 - * + * * @param {string} key - The key of the Texture that was removed from the Texture Manager. */ module.exports = 'removetexture'; +/***/ }), + +/***/ 85549: +/***/ ((module) => { + +/** + * @author samme + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Texture Remove Key Event. + * + * This event is dispatched by the Texture Manager when a texture with the given key is removed from it. + * + * Listen to this event from within a Scene using: `this.textures.on('removetexture-key', listener)`. + * + * If you have any Game Objects still using the removed texture, they will start throwing + * errors the next time they try to render. Be sure to clear all use of the texture in this event handler. + * + * @event Phaser.Textures.Events#REMOVE_KEY + * @since 3.60.0 + */ +module.exports = 'removetexture-'; + + /***/ }), /***/ 38203: @@ -196368,7 +197769,7 @@ module.exports = 'removetexture'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -196379,10 +197780,12 @@ module.exports = 'removetexture'; module.exports = { ADD: __webpack_require__(49644), + ADD_KEY: __webpack_require__(29569), ERROR: __webpack_require__(60079), LOAD: __webpack_require__(72665), READY: __webpack_require__(93006), - REMOVE: __webpack_require__(69018) + REMOVE: __webpack_require__(69018), + REMOVE_KEY: __webpack_require__(85549) }; @@ -196394,7 +197797,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -196407,7 +197810,7 @@ var FilterMode = __webpack_require__(65154); /** * Linear filter type. - * + * * @name Phaser.Textures.LINEAR * @type {number} * @const @@ -196416,7 +197819,7 @@ var FilterMode = __webpack_require__(65154); /** * Nearest Neighbor filter type. - * + * * @name Phaser.Textures.NEAREST * @type {number} * @const @@ -196448,7 +197851,7 @@ module.exports = Textures; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -196530,7 +197933,7 @@ module.exports = AtlasXML; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -196566,7 +197969,7 @@ module.exports = Canvas; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -196602,7 +198005,7 @@ module.exports = Image; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -196649,6 +198052,13 @@ var JSONArray = function (texture, sourceIndex, json) // The frame values are the exact coordinates to cut the frame out of the atlas from newFrame = texture.add(src.filename, sourceIndex, src.frame.x, src.frame.y, src.frame.w, src.frame.h); + if (!newFrame) + { + console.warn('Invalid atlas json, frame already exists: ' + src.filename); + + continue; + } + // These are the original (non-trimmed) sprite values if (src.trimmed) { @@ -196712,7 +198122,7 @@ module.exports = JSONArray; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -196763,6 +198173,13 @@ var JSONHash = function (texture, sourceIndex, json) // The frame values are the exact coordinates to cut the frame out of the atlas from newFrame = texture.add(key, sourceIndex, src.frame.x, src.frame.y, src.frame.w, src.frame.h); + if (!newFrame) + { + console.warn('Invalid atlas json, frame already exists: ' + key); + + continue; + } + // These are the original (non-trimmed) sprite values if (src.trimmed) { @@ -197225,7 +198642,7 @@ module.exports = PVRParser; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -197351,7 +198768,7 @@ module.exports = SpriteSheet; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -197543,7 +198960,7 @@ module.exports = SpriteSheetFromAtlas; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -197714,7 +199131,7 @@ TextureImporter: /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -197745,7 +199162,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -197757,7 +199174,7 @@ module.exports = { /** * CSV Map Type - * + * * @name Phaser.Tilemaps.Formats.CSV * @type {number} * @since 3.0.0 @@ -197766,7 +199183,7 @@ module.exports = { /** * Tiled JSON Map Type - * + * * @name Phaser.Tilemaps.Formats.TILED_JSON * @type {number} * @since 3.0.0 @@ -197775,7 +199192,7 @@ module.exports = { /** * 2D Array Map Type - * + * * @name Phaser.Tilemaps.Formats.ARRAY_2D * @type {number} * @since 3.0.0 @@ -197784,7 +199201,7 @@ module.exports = { /** * Weltmeister (Impact.js) Map Type - * + * * @name Phaser.Tilemaps.Formats.WELTMEISTER * @type {number} * @since 3.0.0 @@ -197801,7 +199218,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -197817,7 +199234,7 @@ var Class = __webpack_require__(56694); * @memberof Phaser.Tilemaps * @constructor * @since 3.0.0 - * + * * @param {string} name - The name of the image collection in the map data. * @param {number} firstgid - The first image index this image collection contains. * @param {number} [width=32] - Width of widest image (in pixels). @@ -197839,7 +199256,7 @@ var ImageCollection = new Class({ /** * The name of the Image Collection. - * + * * @name Phaser.Tilemaps.ImageCollection#name * @type {string} * @since 3.0.0 @@ -197849,7 +199266,7 @@ var ImageCollection = new Class({ /** * The Tiled firstgid value. * This is the starting index of the first image index this Image Collection contains. - * + * * @name Phaser.Tilemaps.ImageCollection#firstgid * @type {number} * @since 3.0.0 @@ -197858,7 +199275,7 @@ var ImageCollection = new Class({ /** * The width of the widest image (in pixels). - * + * * @name Phaser.Tilemaps.ImageCollection#imageWidth * @type {number} * @readonly @@ -197868,7 +199285,7 @@ var ImageCollection = new Class({ /** * The height of the tallest image (in pixels). - * + * * @name Phaser.Tilemaps.ImageCollection#imageHeight * @type {number} * @readonly @@ -197879,7 +199296,7 @@ var ImageCollection = new Class({ /** * The margin around the images in the collection (in pixels). * Use `setSpacing` to change. - * + * * @name Phaser.Tilemaps.ImageCollection#imageMarge * @type {number} * @readonly @@ -197890,7 +199307,7 @@ var ImageCollection = new Class({ /** * The spacing between each image in the collection (in pixels). * Use `setSpacing` to change. - * + * * @name Phaser.Tilemaps.ImageCollection#imageSpacing * @type {number} * @readonly @@ -197900,7 +199317,7 @@ var ImageCollection = new Class({ /** * Image Collection-specific properties that are typically defined in the Tiled editor. - * + * * @name Phaser.Tilemaps.ImageCollection#properties * @type {object} * @since 3.0.0 @@ -197909,7 +199326,7 @@ var ImageCollection = new Class({ /** * The cached images that are a part of this collection. - * + * * @name Phaser.Tilemaps.ImageCollection#images * @type {array} * @readonly @@ -197919,7 +199336,7 @@ var ImageCollection = new Class({ /** * The total number of images in the image collection. - * + * * @name Phaser.Tilemaps.ImageCollection#total * @type {number} * @readonly @@ -197933,9 +199350,9 @@ var ImageCollection = new Class({ * * @method Phaser.Tilemaps.ImageCollection#containsImageIndex * @since 3.0.0 - * + * * @param {number} imageIndex - The image index to search for. - * + * * @return {boolean} True if this Image Collection contains the given index. */ containsImageIndex: function (imageIndex) @@ -197948,7 +199365,7 @@ var ImageCollection = new Class({ * * @method Phaser.Tilemaps.ImageCollection#addImage * @since 3.0.0 - * + * * @param {number} gid - The gid of the image in the Image Collection. * @param {string} image - The the key of the image in the Image Collection and in the cache. * @@ -198208,7 +199625,7 @@ module.exports = ObjectHelper; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -198295,7 +199712,7 @@ module.exports = ParseToTilemap; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -198745,9 +200162,14 @@ var Tile = new Class({ // Tiled places tiles on a grid of baseWidth x baseHeight. The origin for a tile in grid // units is the bottom left, so the y coordinate needs to be adjusted by the difference // between the base size and this tile's size. - return tilemapLayer - ? tilemapLayer.tileToWorldY(this.y, camera) - (this.height - this.baseHeight) * tilemapLayer.scaleY - : this.y * this.baseHeight - (this.height - this.baseHeight); + if (tilemapLayer) + { + var point = tilemapLayer.tileToWorldXY(this.x, this.y, undefined, camera); + + return point.y; + } + + return this.y * this.baseWidth - (this.height - this.baseHeight); }, /** @@ -198770,7 +200192,6 @@ var Tile = new Class({ : this.getTop(camera) + this.height; }, - /** * Gets the world rectangle bounding box for the tile, factoring in the layers position, * scale and scroll. @@ -199224,7 +200645,7 @@ module.exports = Tile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -199524,36 +200945,6 @@ var Tilemap = new Class({ }; }, - /** - * @ignore - */ - createBlankDynamicLayer: function (name, tileset, x, y, width, height, tileWidth, tileHeight) - { - console.warn('createBlankDynamicLayer is deprecated. Use createBlankLayer'); - - return this.createBlankLayer(name, tileset, x, y, width, height, tileWidth, tileHeight); - }, - - /** - * @ignore - */ - createDynamicLayer: function (layerID, tileset, x, y) - { - console.warn('createDynamicLayer is deprecated. Use createLayer'); - - return this.createLayer(layerID, tileset, x, y); - }, - - /** - * @ignore - */ - createStaticLayer: function (layerID, tileset, x, y) - { - console.warn('createStaticLayer is deprecated. Use createLayer'); - - return this.createLayer(layerID, tileset, x, y); - }, - /** * Sets the rendering (draw) order of the tiles in this map. * @@ -199818,7 +201209,7 @@ var Tilemap = new Class({ if (typeof layerID === 'string') { - console.warn('Valid tilelayer names:\n\t' + this.getTileLayerNames().join(',\n\t')); + console.warn('Valid tilelayer names: %o', this.getTileLayerNames()); } return null; @@ -199826,7 +201217,7 @@ var Tilemap = new Class({ var layerData = this.layers[index]; - // Check for an associated static or dynamic tilemap layer + // Check for an associated tilemap layer if (layerData.tilemapLayer) { console.warn('Tilemap Layer ID already exists:' + layerID); @@ -201867,7 +203258,7 @@ module.exports = Tilemap; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -201882,9 +203273,9 @@ var ParseToTilemap = __webpack_require__(15043); * * @method Phaser.GameObjects.GameObjectCreator#tilemap * @since 3.0.0 - * + * * @param {Phaser.Types.Tilemaps.TilemapConfig} [config] - The config options for the Tilemap. - * + * * @return {Phaser.Tilemaps.Tilemap} */ GameObjectCreator.register('tilemap', function (config) @@ -201912,7 +203303,7 @@ GameObjectCreator.register('tilemap', function (config) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -201945,7 +203336,7 @@ var ParseToTilemap = __webpack_require__(15043); * the tile data doesn't need to change then setting this value to `true` will help with memory * consumption. However if your map is small or you need to update the tiles dynamically, then leave * the default value set. - * + * * @return {Phaser.Tilemaps.Tilemap} */ GameObjectFactory.register('tilemap', function (key, tileWidth, tileHeight, width, height, data, insertNull) @@ -201979,7 +203370,7 @@ GameObjectFactory.register('tilemap', function (key, tileWidth, tileHeight, widt /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -202006,6 +203397,7 @@ var TilemapLayerRender = __webpack_require__(96193); * @extends Phaser.GameObjects.Components.Depth * @extends Phaser.GameObjects.Components.Flip * @extends Phaser.GameObjects.Components.GetBounds + * @extends Phaser.GameObjects.Components.Mask * @extends Phaser.GameObjects.Components.Origin * @extends Phaser.GameObjects.Components.Pipeline * @extends Phaser.GameObjects.Components.ScrollFactor @@ -202030,6 +203422,7 @@ var TilemapLayer = new Class({ Components.Depth, Components.Flip, Components.GetBounds, + Components.Mask, Components.Origin, Components.Pipeline, Components.Transform, @@ -202220,10 +203613,50 @@ var TilemapLayer = new Class({ */ this.gidMap = []; + /** + * The horizontal origin of this Tilemap Layer. + * + * @name Phaser.Tilemaps.TilemapLayer#originX + * @type {number} + * @default 0 + * @readOnly + * @since 3.0.0 + */ + + /** + * The vertical origin of this Tilemap Layer. + * + * @name Phaser.Tilemaps.TilemapLayer#originY + * @type {number} + * @default 0 + * @readOnly + * @since 3.0.0 + */ + + /** + * The horizontal display origin of this Tilemap Layer. + * + * @name Phaser.Tilemaps.TilemapLayer#displayOriginX + * @type {number} + * @default 0 + * @readOnly + * @since 3.0.0 + */ + + /** + * The vertical display origin of this Tilemap Layer. + * + * @name Phaser.Tilemaps.TilemapLayer#displayOriginY + * @type {number} + * @default 0 + * @readOnly + * @since 3.0.0 + */ + this.setTilesets(tileset); this.setAlpha(this.layer.alpha); this.setPosition(x, y); - this.setOrigin(); + this.setOrigin(0, 0); this.setSize(tilemap.tileWidth * this.layer.width, tilemap.tileHeight * this.layer.height); this.initPipeline(); @@ -202542,6 +203975,43 @@ var TilemapLayer = new Class({ return this; }, + /** + * Sets an additive tint on each Tile within the given area. + * + * The tint works by taking the pixel color values from the tileset texture, and then + * multiplying it by the color value of the tint. + * + * If no area values are given then all tiles will be tinted to the given color. + * + * To remove a tint call this method with either no parameters, or by passing white `0xffffff` as the tint color. + * + * If a tile already has a tint set then calling this method will override that. + * + * @method Phaser.Tilemaps.TilemapLayer#setTint + * @webglOnly + * @since 3.60.0 + * + * @param {number} [tint=0xffffff] - The tint color being applied to each tile within the region. Given as a hex value, i.e. `0xff0000` for red. Set to white (`0xffffff`) to reset the tint. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. + * + * @return {this} This Tilemap Layer object. + */ + setTint: function (tint, tileX, tileY, width, height, filteringOptions) + { + if (tint === undefined) { tint = 0xffffff; } + + var tintTile = function (tile) + { + tile.tint = tint; + }; + + return this.forEachTile(tintTile, this, tileX, tileY, width, height, filteringOptions); + }, + /** * Gets a tile at the given tile coordinates from the given layer. * @@ -203295,7 +204765,7 @@ module.exports = TilemapLayer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -203385,15 +204855,14 @@ var TilemapLayerCanvasRenderer = function (renderer, src, camera, parentMatrix) var image = tileset.image.getSourceImage(); var tileTexCoords = tileset.getTileTextureCoordinates(tile.index); + var tileWidth = tileset.tileWidth; + var tileHeight = tileset.tileHeight; - if (tileTexCoords === null) + if (tileTexCoords === null || tileWidth === 0 || tileHeight === 0) { continue; } - var tileWidth = tileset.tileWidth; - var tileHeight = tileset.tileHeight; - var halfWidth = tileWidth * 0.5; var halfHeight = tileHeight * 0.5; @@ -203440,12 +204909,13 @@ module.exports = TilemapLayerCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -203472,7 +204942,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -203589,7 +205059,7 @@ module.exports = TilemapLayerWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -204010,7 +205480,7 @@ module.exports = Tileset; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -204105,7 +205575,7 @@ module.exports = CalculateFacesAt; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -204171,7 +205641,7 @@ module.exports = CalculateFacesWithin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -204218,7 +205688,7 @@ module.exports = CheckIsoBounds; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -204285,7 +205755,7 @@ module.exports = Copy; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -204373,7 +205843,7 @@ module.exports = CreateFromTiles; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -204430,7 +205900,7 @@ module.exports = CullBounds; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -204486,7 +205956,7 @@ module.exports = CullTiles; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -204540,7 +206010,7 @@ module.exports = Fill; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -204584,7 +206054,7 @@ module.exports = FilterTiles; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -204671,7 +206141,7 @@ module.exports = FindByIndex; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -204723,7 +206193,7 @@ module.exports = FindTile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -204770,7 +206240,7 @@ module.exports = ForEachTile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -204825,7 +206295,7 @@ module.exports = GetCullTilesFunction; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -204881,7 +206351,7 @@ module.exports = GetTileAt; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -204921,7 +206391,7 @@ module.exports = GetTileAtWorldXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -204961,7 +206431,7 @@ module.exports = GetTileToWorldXFunction; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -205016,7 +206486,7 @@ module.exports = GetTileToWorldXYFunction; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -205066,7 +206536,7 @@ module.exports = GetTileToWorldYFunction; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -205166,7 +206636,7 @@ module.exports = GetTilesWithin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -205230,7 +206700,7 @@ var GetTilesWithinShape = function (shape, filteringOptions, camera, layer) var yStart = pointStart.y; // Bottom right corner of the shapes's bounding box, rounded up to include partial tiles - layer.tilemapLayer.worldToTileXY(shape.right, shape.bottom, true, pointEnd, camera); + layer.tilemapLayer.worldToTileXY(shape.right, shape.bottom, false, pointEnd, camera); var xEnd = Math.ceil(pointEnd.x); var yEnd = Math.ceil(pointEnd.y); @@ -205282,7 +206752,7 @@ module.exports = GetTilesWithinShape; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -205337,7 +206807,7 @@ module.exports = GetTilesWithinWorldXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -205377,7 +206847,7 @@ module.exports = GetWorldToTileXFunction; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -205432,7 +206902,7 @@ module.exports = GetWorldToTileXYFunction; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -205482,7 +206952,7 @@ module.exports = GetWorldToTileYFunction; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -205525,7 +206995,7 @@ module.exports = HasTileAt; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -205568,7 +207038,7 @@ module.exports = HasTileAtWorldXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -205625,7 +207095,7 @@ module.exports = HexagonalCullBounds; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -205677,7 +207147,7 @@ module.exports = HexagonalCullTiles; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -205743,7 +207213,7 @@ module.exports = HexagonalTileToWorldXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -205792,7 +207262,7 @@ module.exports = HexagonalTileToWorldY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -205862,7 +207332,7 @@ module.exports = HexagonalWorldToTileXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -205914,7 +207384,7 @@ module.exports = HexagonalWorldToTileY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -205945,7 +207415,7 @@ module.exports = IsInLayerBounds; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -206094,7 +207564,7 @@ module.exports = IsometricCullTiles; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -206156,7 +207626,7 @@ module.exports = IsometricTileToWorldXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -206222,7 +207692,7 @@ module.exports = IsometricWorldToTileXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -206258,6 +207728,7 @@ var PutTileAt = function (tile, tileX, tileY, recalculateFaces, layer) return null; } + var index; var oldTile = layer.data[tileY][tileX]; var oldTileCollides = oldTile && oldTile.collides; @@ -206272,7 +207743,7 @@ var PutTileAt = function (tile, tileX, tileY, recalculateFaces, layer) } else { - var index = tile; + index = tile; if (layer.data[tileY][tileX] === null) { @@ -206290,7 +207761,8 @@ var PutTileAt = function (tile, tileX, tileY, recalculateFaces, layer) // Copy properties from tileset to tiles. var tiles = BuildTilesetIndex(layer.tilemapLayer.tilemap); - var index = tile instanceof Tile ? tile.index : tile; + + index = tile instanceof Tile ? tile.index : tile; var sid = tiles[index][2]; var set = layer.tilemapLayer.tileset[sid]; @@ -206319,7 +207791,7 @@ module.exports = PutTileAt; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -206363,7 +207835,7 @@ module.exports = PutTileAtWorldXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -206431,7 +207903,7 @@ module.exports = PutTilesAt; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -206490,7 +207962,7 @@ module.exports = Randomize; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -206553,7 +208025,7 @@ module.exports = RemoveTileAt; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -206595,7 +208067,7 @@ module.exports = RemoveTileAtWorldXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -206678,7 +208150,7 @@ module.exports = RenderDebug; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -206723,7 +208195,7 @@ module.exports = ReplaceByIndex; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -206850,7 +208322,7 @@ module.exports = RunCull; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -206922,7 +208394,7 @@ module.exports = SetCollision; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -206999,7 +208471,7 @@ module.exports = SetCollisionBetween; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -207061,7 +208533,7 @@ module.exports = SetCollisionByExclusion; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -207137,7 +208609,7 @@ module.exports = SetCollisionByProperty; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -207197,7 +208669,7 @@ module.exports = SetCollisionFromCollisionGroup; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -207236,7 +208708,7 @@ module.exports = SetLayerCollisionIndex; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -207272,7 +208744,7 @@ module.exports = SetTileCollision; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -207319,7 +208791,7 @@ module.exports = SetTileIndexCallback; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -207361,7 +208833,7 @@ module.exports = SetTileLocationCallback; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -207407,7 +208879,7 @@ module.exports = Shuffle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -207461,7 +208933,7 @@ module.exports = StaggeredCullBounds; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -207513,7 +208985,7 @@ module.exports = StaggeredCullTiles; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -207575,7 +209047,7 @@ module.exports = StaggeredTileToWorldXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -207620,7 +209092,7 @@ module.exports = StaggeredTileToWorldY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -207686,7 +209158,7 @@ module.exports = StaggeredWorldToTileXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -207734,7 +209206,7 @@ module.exports = StaggeredWorldToTileY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -207786,7 +209258,7 @@ module.exports = SwapByIndex; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -207831,7 +209303,7 @@ module.exports = TileToWorldX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -207875,7 +209347,7 @@ module.exports = TileToWorldXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -207920,7 +209392,7 @@ module.exports = TileToWorldY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -208004,7 +209476,7 @@ module.exports = WeightedRandomize; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -208053,7 +209525,7 @@ module.exports = WorldToTileX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -208099,7 +209571,7 @@ module.exports = WorldToTileXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -208148,7 +209620,7 @@ module.exports = WorldToTileY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -208238,13 +209710,13 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Phaser Tilemap constants for orientation. - * + * * @namespace Phaser.Tilemaps.Orientation * @memberof Phaser.Tilemaps * @since 3.50.0 @@ -208252,9 +209724,9 @@ module.exports = { /** * Phaser Tilemap constants for orientation. - * + * * To find out what each mode does please see [Phaser.Tilemaps.Orientation]{@link Phaser.Tilemaps.Orientation}. - * + * * @typedef {Phaser.Tilemaps.Orientation} Phaser.Tilemaps.OrientationType * @memberof Phaser.Tilemaps * @since 3.50.0 @@ -208264,7 +209736,7 @@ module.exports = { /** * Orthogonal Tilemap orientation constant. - * + * * @name Phaser.Tilemaps.Orientation.ORTHOGONAL * @type {number} * @const @@ -208312,7 +209784,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -208332,7 +209804,7 @@ module.exports = CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -208382,7 +209854,7 @@ module.exports = Tilemaps; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -208623,7 +210095,7 @@ module.exports = LayerData; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -208860,7 +210332,7 @@ module.exports = MapData; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -208983,7 +210455,7 @@ module.exports = ObjectLayer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -209031,7 +210503,7 @@ module.exports = FromOrientationString; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -209102,7 +210574,7 @@ module.exports = Parse; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -209136,7 +210608,7 @@ var Parse2DArray = function (name, data, tileWidth, tileHeight, insertNull) tileWidth: tileWidth, tileHeight: tileHeight }); - + var mapData = new MapData({ name: name, tileWidth: tileWidth, @@ -209195,7 +210667,7 @@ module.exports = Parse2DArray; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -209244,7 +210716,7 @@ module.exports = ParseCSV; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -209331,7 +210803,7 @@ module.exports = ParseTileLayers; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -209383,7 +210855,7 @@ module.exports = ParseTilesets; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -209451,7 +210923,7 @@ module.exports = ParseWeltmeister; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -209475,7 +210947,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -209503,7 +210975,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -209577,7 +211049,7 @@ module.exports = AssignTileProperties; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -209621,7 +211093,7 @@ module.exports = Base64Decode; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -209716,7 +211188,7 @@ module.exports = BuildTilesetIndex; /** * @author Seth Berrier - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -209729,20 +211201,19 @@ var GetFastValue = __webpack_require__(72632); * @since 3.21.0 * * @param {object} json - The Tiled JSON object. - * @param {object} [currentl] - The current group layer from the Tiled JSON file. - * @param {object} [parentstate] - The state of the parent group (if any). + * @param {object} [group] - The current group layer from the Tiled JSON file. + * @param {object} [parentState] - The state of the parent group (if any). * * @return {object} A group state object with proper values for updating children layers. */ -var CreateGroupLayer = function (json, groupl, parentstate) +var CreateGroupLayer = function (json, group, parentState) { - if (!groupl) + if (!group) { // Return a default group state object return { i: 0, // Current layer array iterator layers: json.layers, // Current array of layers - // Values inherited from parent group name: '', opacity: 1, @@ -209753,18 +211224,18 @@ var CreateGroupLayer = function (json, groupl, parentstate) } // Compute group layer x, y - var layerX = groupl.x + GetFastValue(groupl, 'startx', 0) * json.tilewidth + GetFastValue(groupl, 'offsetx', 0); - var layerY = groupl.y + GetFastValue(groupl, 'starty', 0) * json.tileheight + GetFastValue(groupl, 'offsety', 0); + var layerX = group.x + GetFastValue(group, 'startx', 0) * json.tilewidth + GetFastValue(group, 'offsetx', 0); + var layerY = group.y + GetFastValue(group, 'starty', 0) * json.tileheight + GetFastValue(group, 'offsety', 0); // Compute next state inherited from group return { i: 0, - layers: groupl.layers, - name: parentstate.name + groupl.name + '/', - opacity: parentstate.opacity * groupl.opacity, - visible: parentstate.visible && groupl.visible, - x: parentstate.x + layerX, - y: parentstate.y + layerY + layers: group.layers, + name: parentState.name + group.name + '/', + opacity: parentState.opacity * group.opacity, + visible: parentState.visible && group.visible, + x: parentState.x + layerX, + y: parentState.y + layerY }; }; @@ -209778,7 +211249,7 @@ module.exports = CreateGroupLayer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -209869,7 +211340,7 @@ module.exports = ParseGID; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -209958,7 +211429,7 @@ module.exports = ParseImageLayers; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -210039,7 +211510,7 @@ module.exports = ParseJSONTiled; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -210120,7 +211591,7 @@ module.exports = ParseObject; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -210220,7 +211691,7 @@ module.exports = ParseObjectLayers; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -210491,7 +211962,7 @@ module.exports = ParseTileLayers; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -210687,7 +212158,7 @@ module.exports = ParseTilesets; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -210829,7 +212300,7 @@ module.exports = ParseWangsets; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -210861,7 +212332,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -211338,7 +212809,7 @@ module.exports = Clock; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -211704,7 +213175,7 @@ module.exports = TimerEvent; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -211720,912 +213191,6 @@ module.exports = { }; -/***/ }), - -/***/ 28860: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(56694); -var EventEmitter = __webpack_require__(6659); -var Events = __webpack_require__(54272); -var TweenBuilder = __webpack_require__(68061); -var TWEEN_CONST = __webpack_require__(55303); - -/** - * @classdesc - * A Timeline combines multiple Tweens into one. Its overall behavior is otherwise similar to a single Tween. - * - * The Timeline updates all of its Tweens simultaneously. Its methods allow you to easily build a sequence - * of Tweens (each one starting after the previous one) or run multiple Tweens at once during given parts of the Timeline. - * - * @class Timeline - * @memberof Phaser.Tweens - * @extends Phaser.Events.EventEmitter - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Tweens.TweenManager} manager - The Tween Manager which owns this Timeline. - */ -var Timeline = new Class({ - - Extends: EventEmitter, - - initialize: - - function Timeline (manager) - { - EventEmitter.call(this); - - /** - * The Tween Manager which owns this Timeline. - * - * @name Phaser.Tweens.Timeline#manager - * @type {Phaser.Tweens.TweenManager} - * @since 3.0.0 - */ - this.manager = manager; - - /** - * A constant value which allows this Timeline to be easily identified as one. - * - * @name Phaser.Tweens.Timeline#isTimeline - * @type {boolean} - * @default true - * @since 3.0.0 - */ - this.isTimeline = true; - - /** - * An array of Tween objects, each containing a unique property and target being tweened. - * - * @name Phaser.Tweens.Timeline#data - * @type {array} - * @default [] - * @since 3.0.0 - */ - this.data = []; - - /** - * The cached size of the data array. - * - * @name Phaser.Tweens.Timeline#totalData - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.totalData = 0; - - /** - * If true then duration, delay, etc values are all frame totals, rather than ms. - * - * @name Phaser.Tweens.Timeline#useFrames - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.useFrames = false; - - /** - * Scales the time applied to this Timeline. A value of 1 runs in real-time. A value of 0.5 runs 50% slower, and so on. - * Value isn't used when calculating total duration of the Timeline, it's a run-time delta adjustment only. - * - * @name Phaser.Tweens.Timeline#timeScale - * @type {number} - * @default 1 - * @since 3.0.0 - */ - this.timeScale = 1; - - /** - * Loop this Timeline? Can be -1 for an infinite loop, or an integer. - * When enabled it will play through ALL Tweens again (use Tween.repeat to loop a single tween) - * - * @name Phaser.Tweens.Timeline#loop - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.loop = 0; - - /** - * Time in ms/frames before this Timeline loops. - * - * @name Phaser.Tweens.Timeline#loopDelay - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.loopDelay = 0; - - /** - * How many loops are left to run? - * - * @name Phaser.Tweens.Timeline#loopCounter - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.loopCounter = 0; - - /** - * Time in ms/frames before the 'onComplete' event fires. This never fires if loop = true (as it never completes) - * - * @name Phaser.Tweens.Timeline#completeDelay - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.completeDelay = 0; - - /** - * Countdown timer value, as used by `loopDelay` and `completeDelay`. - * - * @name Phaser.Tweens.Timeline#countdown - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.countdown = 0; - - /** - * The current state of the Timeline. - * - * @name Phaser.Tweens.Timeline#state - * @type {number} - * @since 3.0.0 - */ - this.state = TWEEN_CONST.PENDING_ADD; - - /** - * The state of the Timeline when it was paused (used by Resume) - * - * @name Phaser.Tweens.Timeline#_pausedState - * @type {number} - * @private - * @since 3.0.0 - */ - this._pausedState = TWEEN_CONST.PENDING_ADD; - - /** - * Does the Timeline start off paused? (if so it needs to be started with Timeline.play) - * - * @name Phaser.Tweens.Timeline#paused - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.paused = false; - - /** - * Elapsed time in ms/frames of this run through of the Timeline. - * - * @name Phaser.Tweens.Timeline#elapsed - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.elapsed = 0; - - /** - * Total elapsed time in ms/frames of the entire Timeline, including looping. - * - * @name Phaser.Tweens.Timeline#totalElapsed - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.totalElapsed = 0; - - /** - * Time in ms/frames for the whole Timeline to play through once, excluding loop amounts and loop delays. - * - * @name Phaser.Tweens.Timeline#duration - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.duration = 0; - - /** - * Value between 0 and 1. The amount of progress through the Timeline, _excluding loops_. - * - * @name Phaser.Tweens.Timeline#progress - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.progress = 0; - - /** - * Time in ms/frames for all Tweens in this Timeline to complete (including looping) - * - * @name Phaser.Tweens.Timeline#totalDuration - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.totalDuration = 0; - - /** - * Value between 0 and 1. The amount through the entire Timeline, including looping. - * - * @name Phaser.Tweens.Timeline#totalProgress - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.totalProgress = 0; - - /** - * An object containing the different Tween callback functions. - * - * You can either set these in the Tween config, or by calling the `Tween.setCallback` method. - * - * `onComplete` When the Timeline finishes playback fully or `Timeline.stop` is called. Never invoked if timeline is set to repeat infinitely. - * `onLoop` When a Timeline loops. - * `onStart` When the Timeline starts playing. - * `onUpdate` When a Timeline updates a child Tween. - * `onYoyo` When a Timeline starts a yoyo. - * - * @name Phaser.Tweens.Timeline#callbacks - * @type {object} - * @since 3.0.0 - */ - this.callbacks = { - onComplete: null, - onLoop: null, - onStart: null, - onUpdate: null, - onYoyo: null - }; - - /** - * The context in which all callbacks are invoked. - * - * @name Phaser.Tweens.Timeline#callbackScope - * @type {any} - * @since 3.0.0 - */ - this.callbackScope; - }, - - /** - * Internal method that will emit a Timeline based Event and invoke the given callback. - * - * @method Phaser.Tweens.Timeline#dispatchTimelineEvent - * @since 3.19.0 - * - * @param {Phaser.Types.Tweens.Event} event - The Event to be dispatched. - * @param {function} callback - The callback to be invoked. Can be `null` or `undefined` to skip invocation. - */ - dispatchTimelineEvent: function (event, callback) - { - this.emit(event, this); - - if (callback) - { - callback.func.apply(callback.scope, callback.params); - } - }, - - /** - * Sets the value of the time scale applied to this Timeline. A value of 1 runs in real-time. - * A value of 0.5 runs 50% slower, and so on. - * - * The value isn't used when calculating total duration of the tween, it's a run-time delta adjustment only. - * - * @method Phaser.Tweens.Timeline#setTimeScale - * @since 3.0.0 - * - * @param {number} value - The time scale value to set. - * - * @return {this} This Timeline object. - */ - setTimeScale: function (value) - { - this.timeScale = value; - - return this; - }, - - /** - * Gets the value of the time scale applied to this Timeline. A value of 1 runs in real-time. - * A value of 0.5 runs 50% slower, and so on. - * - * @method Phaser.Tweens.Timeline#getTimeScale - * @since 3.0.0 - * - * @return {number} The value of the time scale applied to this Timeline. - */ - getTimeScale: function () - { - return this.timeScale; - }, - - /** - * Check whether or not the Timeline is playing. - * - * @method Phaser.Tweens.Timeline#isPlaying - * @since 3.0.0 - * - * @return {boolean} `true` if this Timeline is active, otherwise `false`. - */ - isPlaying: function () - { - return (this.state === TWEEN_CONST.ACTIVE); - }, - - /** - * Creates a new Tween, based on the given Tween Config, and adds it to this Timeline. - * - * @method Phaser.Tweens.Timeline#add - * @since 3.0.0 - * - * @param {(Phaser.Types.Tweens.TweenBuilderConfig|object)} config - The configuration object for the Tween. - * - * @return {this} This Timeline object. - */ - add: function (config) - { - return this.queue(TweenBuilder(this, config)); - }, - - /** - * Adds an existing Tween to this Timeline. - * - * @method Phaser.Tweens.Timeline#queue - * @since 3.0.0 - * - * @param {Phaser.Tweens.Tween} tween - The Tween to be added to this Timeline. - * - * @return {this} This Timeline object. - */ - queue: function (tween) - { - if (!this.isPlaying()) - { - tween.parent = this; - tween.parentIsTimeline = true; - - this.data.push(tween); - - this.totalData = this.data.length; - } - - return this; - }, - - /** - * Checks whether a Tween has an offset value. - * - * @method Phaser.Tweens.Timeline#hasOffset - * @since 3.0.0 - * - * @param {Phaser.Tweens.Tween} tween - The Tween to check. - * - * @return {boolean} `true` if the tween has a non-null offset. - */ - hasOffset: function (tween) - { - return (tween.offset !== null); - }, - - /** - * Checks whether the offset value is a number or a directive that is relative to previous tweens. - * - * @method Phaser.Tweens.Timeline#isOffsetAbsolute - * @since 3.0.0 - * - * @param {number} value - The offset value to be evaluated. - * - * @return {boolean} `true` if the result is a number, `false` if it is a directive like " -= 1000". - */ - isOffsetAbsolute: function (value) - { - return (typeof(value) === 'number'); - }, - - /** - * Checks if the offset is a relative value rather than an absolute one. - * If the value is just a number, this returns false. - * - * @method Phaser.Tweens.Timeline#isOffsetRelative - * @since 3.0.0 - * - * @param {string} value - The offset value to be evaluated. - * - * @return {boolean} `true` if the value is relative, i.e " -= 1000". If `false`, the offset is absolute. - */ - isOffsetRelative: function (value) - { - var t = typeof(value); - - if (t === 'string') - { - var op = value[0]; - - if (op === '-' || op === '+') - { - return true; - } - } - - return false; - }, - - /** - * Parses the relative offset value, returning a positive or negative number. - * - * @method Phaser.Tweens.Timeline#getRelativeOffset - * @since 3.0.0 - * - * @param {string} value - The relative offset, in the format of '-=500', for example. The first character determines whether it will be a positive or negative number. Spacing matters here. - * @param {number} base - The value to use as the offset. - * - * @return {number} The parsed offset value. - */ - getRelativeOffset: function (value, base) - { - var op = value[0]; - var num = parseFloat(value.substr(2)); - var result = base; - - switch (op) - { - case '+': - result += num; - break; - - case '-': - result -= num; - break; - } - - // Cannot ever be < 0 - return Math.max(0, result); - }, - - /** - * Calculates the total duration of the timeline. - * - * Computes all tween durations and returns the full duration of the timeline. - * - * The resulting number is stored in the timeline, not as a return value. - * - * @method Phaser.Tweens.Timeline#calcDuration - * @since 3.0.0 - */ - calcDuration: function () - { - var prevEnd = 0; - var totalDuration = 0; - var offsetDuration = 0; - - for (var i = 0; i < this.totalData; i++) - { - var tween = this.data[i]; - - tween.init(); - - if (this.hasOffset(tween)) - { - if (this.isOffsetAbsolute(tween.offset)) - { - // An actual number, so it defines the start point from the beginning of the timeline - tween.calculatedOffset = tween.offset; - - if (tween.offset === 0) - { - offsetDuration = 0; - } - } - else if (this.isOffsetRelative(tween.offset)) - { - // A relative offset (i.e. '-=1000', so starts at 'offset' ms relative to the PREVIOUS Tweens ending time) - tween.calculatedOffset = this.getRelativeOffset(tween.offset, prevEnd); - } - } - else - { - // Sequential - tween.calculatedOffset = offsetDuration; - } - - prevEnd = tween.totalDuration + tween.calculatedOffset; - - totalDuration += tween.totalDuration; - offsetDuration += tween.totalDuration; - } - - // Excludes loop values - this.duration = totalDuration; - - this.loopCounter = (this.loop === -1) ? 999999999999 : this.loop; - - if (this.loopCounter > 0) - { - this.totalDuration = this.duration + this.completeDelay + ((this.duration + this.loopDelay) * this.loopCounter); - } - else - { - this.totalDuration = this.duration + this.completeDelay; - } - }, - - /** - * Initializes the timeline, which means all Tweens get their init() called, and the total duration will be computed. - * Returns a boolean indicating whether the timeline is auto-started or not. - * - * @method Phaser.Tweens.Timeline#init - * @since 3.0.0 - * - * @return {boolean} `true` if the Timeline is started. `false` if it is paused. - */ - init: function () - { - this.calcDuration(); - - this.progress = 0; - this.totalProgress = 0; - - if (this.paused) - { - this.state = TWEEN_CONST.PAUSED; - - return false; - } - else - { - return true; - } - }, - - /** - * Resets all of the timeline's tweens back to their initial states. - * The boolean parameter indicates whether tweens that are looping should reset as well, or not. - * - * @method Phaser.Tweens.Timeline#resetTweens - * @since 3.0.0 - * - * @param {boolean} resetFromLoop - If `true`, resets all looping tweens to their initial values. - */ - resetTweens: function (resetFromLoop) - { - for (var i = 0; i < this.totalData; i++) - { - var tween = this.data[i]; - - tween.play(resetFromLoop); - } - }, - - /** - * Sets a callback for the Timeline. - * - * @method Phaser.Tweens.Timeline#setCallback - * @since 3.0.0 - * - * @param {string} type - The internal type of callback to set. - * @param {function} callback - Timeline allows multiple tweens to be linked together to create a streaming sequence. - * @param {array} [params] - The parameters to pass to the callback. - * @param {object} [scope] - The context scope of the callback. - * - * @return {this} This Timeline object. - */ - setCallback: function (type, callback, params, scope) - { - if (Timeline.TYPES.indexOf(type) !== -1) - { - this.callbacks[type] = { func: callback, scope: scope, params: [ this ].concat(params) }; - } - - return this; - }, - - /** - * Passed a Tween to the Tween Manager and requests it be made active. - * - * @method Phaser.Tweens.Timeline#makeActive - * @since 3.3.0 - * - * @param {Phaser.Tweens.Tween} tween - The tween object to make active. - * - * @return {Phaser.Tweens.TweenManager} The Timeline's Tween Manager reference. - */ - makeActive: function (tween) - { - return this.manager.makeActive(tween); - }, - - /** - * Starts playing the Timeline. - * - * @method Phaser.Tweens.Timeline#play - * @fires Phaser.Tweens.Events#TIMELINE_START - * @since 3.0.0 - */ - play: function () - { - if (this.state === TWEEN_CONST.ACTIVE) - { - return; - } - - if (this.paused) - { - this.paused = false; - - this.manager.makeActive(this); - - return; - } - else - { - this.resetTweens(false); - - this.state = TWEEN_CONST.ACTIVE; - } - - this.dispatchTimelineEvent(Events.TIMELINE_START, this.callbacks.onStart); - }, - - /** - * Updates the Timeline's `state` and fires callbacks and events. - * - * @method Phaser.Tweens.Timeline#nextState - * @fires Phaser.Tweens.Events#TIMELINE_COMPLETE - * @fires Phaser.Tweens.Events#TIMELINE_LOOP - * @since 3.0.0 - * - * @see Phaser.Tweens.Timeline#update - */ - nextState: function () - { - if (this.loopCounter > 0) - { - // Reset the elapsed time - this.elapsed = 0; - this.progress = 0; - - this.loopCounter--; - - this.resetTweens(true); - - if (this.loopDelay > 0) - { - this.countdown = this.loopDelay; - - this.state = TWEEN_CONST.LOOP_DELAY; - } - else - { - this.state = TWEEN_CONST.ACTIVE; - - this.dispatchTimelineEvent(Events.TIMELINE_LOOP, this.callbacks.onLoop); - } - } - else if (this.completeDelay > 0) - { - this.state = TWEEN_CONST.COMPLETE_DELAY; - - this.countdown = this.completeDelay; - } - else - { - this.state = TWEEN_CONST.PENDING_REMOVE; - - this.dispatchTimelineEvent(Events.TIMELINE_COMPLETE, this.callbacks.onComplete); - } - }, - - /** - * Returns 'true' if this Timeline has finished and should be removed from the Tween Manager. - * Otherwise, returns false. - * - * @method Phaser.Tweens.Timeline#update - * @fires Phaser.Tweens.Events#TIMELINE_COMPLETE - * @fires Phaser.Tweens.Events#TIMELINE_UPDATE - * @since 3.0.0 - * - * @param {number} timestamp - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. - * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. - * - * @return {boolean} Returns `true` if this Timeline has finished and should be removed from the Tween Manager. - */ - update: function (timestamp, delta) - { - if (this.state === TWEEN_CONST.PAUSED) - { - return; - } - - if (this.useFrames) - { - delta = 1 * this.manager.timeScale; - } - - delta *= this.timeScale; - - this.elapsed += delta; - this.progress = Math.min(this.elapsed / this.duration, 1); - - this.totalElapsed += delta; - this.totalProgress = Math.min(this.totalElapsed / this.totalDuration, 1); - - switch (this.state) - { - case TWEEN_CONST.ACTIVE: - - var stillRunning = this.totalData; - - for (var i = 0; i < this.totalData; i++) - { - var tween = this.data[i]; - - if (tween.update(timestamp, delta)) - { - stillRunning--; - } - } - - this.dispatchTimelineEvent(Events.TIMELINE_UPDATE, this.callbacks.onUpdate); - - // Anything still running? If not, we're done - if (stillRunning === 0) - { - this.nextState(); - } - - break; - - case TWEEN_CONST.LOOP_DELAY: - - this.countdown -= delta; - - if (this.countdown <= 0) - { - this.state = TWEEN_CONST.ACTIVE; - - this.dispatchTimelineEvent(Events.TIMELINE_LOOP, this.callbacks.onLoop); - } - - break; - - case TWEEN_CONST.COMPLETE_DELAY: - - this.countdown -= delta; - - if (this.countdown <= 0) - { - this.state = TWEEN_CONST.PENDING_REMOVE; - - this.dispatchTimelineEvent(Events.TIMELINE_COMPLETE, this.callbacks.onComplete); - } - - break; - } - - return (this.state === TWEEN_CONST.PENDING_REMOVE); - }, - - /** - * Stops the Timeline immediately, whatever stage of progress it is at and flags it for removal by the TweenManager. - * - * @method Phaser.Tweens.Timeline#stop - * @since 3.0.0 - */ - stop: function () - { - this.state = TWEEN_CONST.PENDING_REMOVE; - }, - - /** - * Pauses the Timeline, retaining its internal state. - * - * Calling this on a Timeline that is already paused has no effect and fires no event. - * - * @method Phaser.Tweens.Timeline#pause - * @fires Phaser.Tweens.Events#TIMELINE_PAUSE - * @since 3.0.0 - * - * @return {this} This Timeline object. - */ - pause: function () - { - if (this.state === TWEEN_CONST.PAUSED) - { - return; - } - - this.paused = true; - - this._pausedState = this.state; - - this.state = TWEEN_CONST.PAUSED; - - this.emit(Events.TIMELINE_PAUSE, this); - - return this; - }, - - /** - * Resumes a paused Timeline from where it was when it was paused. - * - * Calling this on a Timeline that isn't paused has no effect and fires no event. - * - * @method Phaser.Tweens.Timeline#resume - * @fires Phaser.Tweens.Events#TIMELINE_RESUME - * @since 3.0.0 - * - * @return {this} This Timeline object. - */ - resume: function () - { - if (this.state === TWEEN_CONST.PAUSED) - { - this.paused = false; - - this.state = this._pausedState; - - this.emit(Events.TIMELINE_RESUME, this); - } - - return this; - }, - - /** - * Checks if any of the Tweens in this Timeline as operating on the target object. - * - * Returns `false` if no Tweens operate on the target object. - * - * @method Phaser.Tweens.Timeline#hasTarget - * @since 3.0.0 - * - * @param {object} target - The target to check all Tweens against. - * - * @return {boolean} `true` if there is at least a single Tween that operates on the target object, otherwise `false`. - */ - hasTarget: function (target) - { - for (var i = 0; i < this.data.length; i++) - { - if (this.data[i].hasTarget(target)) - { - return true; - } - } - - return false; - }, - - /** - * Stops all the Tweens in the Timeline immediately, whatever stage of progress they are at and flags - * them for removal by the TweenManager. - * - * @method Phaser.Tweens.Timeline#destroy - * @since 3.0.0 - */ - destroy: function () - { - for (var i = 0; i < this.data.length; i++) - { - this.data[i].stop(); - } - } - -}); - -Timeline.TYPES = [ 'onStart', 'onUpdate', 'onLoop', 'onComplete', 'onYoyo' ]; - -module.exports = Timeline; - - /***/ }), /***/ 64532: @@ -212633,23 +213198,25 @@ module.exports = Timeline; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var ArrayRemove = __webpack_require__(66458); var Class = __webpack_require__(56694); +var Flatten = __webpack_require__(5454); var NumberTweenBuilder = __webpack_require__(68710); var PluginCache = __webpack_require__(91963); var SceneEvents = __webpack_require__(7599); var StaggerBuilder = __webpack_require__(91944); -var TimelineBuilder = __webpack_require__(32981); -var TWEEN_CONST = __webpack_require__(55303); +var Tween = __webpack_require__(39366); var TweenBuilder = __webpack_require__(68061); +var TweenChain = __webpack_require__(45641); +var TweenChainBuilder = __webpack_require__(56034); /** * @classdesc - * The Tween Manager is a default Scene Plugin which controls and updates Tweens and Timelines. + * The Tween Manager is a default Scene Plugin which controls and updates Tweens. * * @class TweenManager * @memberof Phaser.Tweens @@ -212695,55 +213262,111 @@ var TweenManager = new Class({ this.timeScale = 1; /** - * An array of Tweens and Timelines which will be added to the Tween Manager at the start of the frame. + * This toggles the updating state of this Tween Manager. * - * @name Phaser.Tweens.TweenManager#_add - * @type {array} - * @private - * @since 3.0.0 + * Setting `paused` to `true` (or calling the `pauseAll` method) will + * stop this Tween Manager from updating any of its tweens, including + * newly created ones. Set back to `false` to resume playback. + * + * @name Phaser.Tweens.TweenManager#paused + * @type {boolean} + * @default false + * @since 3.60.0 */ - this._add = []; + this.paused = false; /** - * An array of Tweens and Timelines pending to be later added to the Tween Manager. + * Is this Tween Manager currently processing the tweens as part of + * its 'update' loop? This is set to 'true' at the start of 'update' + * and reset to 'false' at the end of the function. Allows you to trap + * Tween Manager status during tween callbacks. * - * @name Phaser.Tweens.TweenManager#_pending - * @type {array} - * @private - * @since 3.0.0 + * @name Phaser.Tweens.TweenManager#processing + * @type {boolean} + * @default false + * @since 3.60.0 */ - this._pending = []; + this.processing = false; /** - * An array of Tweens and Timelines which are still incomplete and are actively processed by the Tween Manager. + * An array of Tweens which are actively being processed by the Tween Manager. * - * @name Phaser.Tweens.TweenManager#_active - * @type {array} - * @private - * @since 3.0.0 + * @name Phaser.Tweens.TweenManager#tweens + * @type {Phaser.Tweens.Tween[]} + * @since 3.60.0 */ - this._active = []; + this.tweens = []; /** - * An array of Tweens and Timelines which will be removed from the Tween Manager at the start of the frame. + * The time the Tween Manager was updated. * - * @name Phaser.Tweens.TweenManager#_destroy - * @type {array} - * @private - * @since 3.0.0 - */ - this._destroy = []; - - /** - * The number of Tweens and Timelines which need to be processed by the Tween Manager at the start of the frame. - * - * @name Phaser.Tweens.TweenManager#_toProcess + * @name Phaser.Tweens.TweenManager#time * @type {number} - * @private - * @default 0 - * @since 3.0.0 + * @since 3.60.0 */ - this._toProcess = 0; + this.time = 0; + + /** + * The time the Tween Manager was started. + * + * @name Phaser.Tweens.TweenManager#startTime + * @type {number} + * @since 3.60.0 + */ + this.startTime = 0; + + /** + * The time the Tween Manager should next update. + * + * @name Phaser.Tweens.TweenManager#nextTime + * @type {number} + * @since 3.60.0 + */ + this.nextTime = 0; + + /** + * The time the Tween Manager previously updated. + * + * @name Phaser.Tweens.TweenManager#prevTime + * @type {number} + * @since 3.60.0 + */ + this.prevTime = 0; + + /** + * The maximum amount of time, in milliseconds, the browser can + * lag for, before lag smoothing is applied. + * + * See the `TweenManager.setLagSmooth` method for further details. + * + * @name Phaser.Tweens.TweenManager#maxLag + * @type {number} + * @default 500 + * @since 3.60.0 + */ + this.maxLag = 500; + + /** + * The amount of time, in milliseconds, that is used to set the + * delta when lag smoothing is applied. + * + * See the `TweenManager.setLagSmooth` method for further details. + * + * @name Phaser.Tweens.TweenManager#lagSkip + * @type {number} + * @default 33 + * @since 3.60.0 + */ + this.lagSkip = 33; + + /** + * An internal value that holds the fps rate. + * + * @name Phaser.Tweens.TweenManager#gap + * @type {number} + * @since 3.60.0 + */ + this.gap = 1000 / 240; scene.sys.events.once(SceneEvents.BOOT, this.boot, this); scene.sys.events.on(SceneEvents.START, this.start, this); @@ -212775,105 +213398,242 @@ var TweenManager = new Class({ { var eventEmitter = this.systems.events; - eventEmitter.on(SceneEvents.PRE_UPDATE, this.preUpdate, this); eventEmitter.on(SceneEvents.UPDATE, this.update, this); eventEmitter.once(SceneEvents.SHUTDOWN, this.shutdown, this); this.timeScale = 1; + this.paused = false; + + this.startTime = Date.now(); + this.prevTime = this.startTime; + this.nextTime = this.gap; }, /** - * Create a Tween Timeline and return it, but do NOT add it to the active or pending Tween lists. + * Create a Tween and return it, but does not add it to this Tween Manager. * - * @method Phaser.Tweens.TweenManager#createTimeline - * @since 3.0.0 + * Please note that a Tween will not manipulate any target property that begins with an underscore. * - * @param {Phaser.Types.Tweens.TimelineBuilderConfig} [config] - The configuration object for the Timeline and its Tweens. + * In order to play this tween, you'll need to add it to a Tween Manager via + * the `TweenManager.existing` method. * - * @return {Phaser.Tweens.Timeline} The created Timeline object. - */ - createTimeline: function (config) - { - return TimelineBuilder(this, config); - }, - - /** - * Create a Tween Timeline and add it to the active Tween list. - * - * @method Phaser.Tweens.TweenManager#timeline - * @since 3.0.0 - * - * @param {Phaser.Types.Tweens.TimelineBuilderConfig} [config] - The configuration object for the Timeline and its Tweens. - * - * @return {Phaser.Tweens.Timeline} The created Timeline object. - */ - timeline: function (config) - { - var timeline = TimelineBuilder(this, config); - - if (!timeline.paused) - { - this._add.push(timeline); - - this._toProcess++; - } - - return timeline; - }, - - /** - * Create a Tween and return it, but do NOT add it to the active or pending Tween lists. + * You can optionally pass an **array** of Tween Configuration objects to this method and it will create + * one Tween per entry in the array. If an array is given, an array of tweens is returned. * * @method Phaser.Tweens.TweenManager#create * @since 3.0.0 * - * @param {Phaser.Types.Tweens.TweenBuilderConfig|object} config - The configuration object for the Tween. + * @param {Phaser.Types.Tweens.TweenBuilderConfig|Phaser.Types.Tweens.TweenBuilderConfig[]|object|object[]} config - A Tween Configuration object. Or an array of Tween Configuration objects. * - * @return {Phaser.Tweens.Tween} The created Tween object. + * @return {Phaser.Tweens.Tween|Phaser.Tweens.Tween[]} The created Tween, or an array of Tweens if an array of tween configs was provided. */ create: function (config) { - return TweenBuilder(this, config); + if (!Array.isArray(config)) + { + config = [ config ]; + } + + var result = []; + + for (var i = 0; i < config.length; i++) + { + var tween = config[i]; + + if (tween instanceof Tween || tween instanceof TweenChain) + { + // Allow them to send an array of mixed instances and configs + result.push(tween); + } + else if (Array.isArray(tween.tweens)) + { + result.push(TweenChainBuilder(this, tween)); + } + else + { + result.push(TweenBuilder(this, tween)); + } + } + + return (result.length === 1) ? result[0] : result; }, /** - * Create a Tween and add it to the active Tween list. + * Create a Tween and add it to this Tween Manager by passing a Tween Configuration object. * - * Please note that a Tween will not manipulate any property that begins with an underscore. + * Example, run from within a Scene: + * + * ```js + * const logo = this.add.image(100, 100, 'logo'); + * + * this.tweens.add({ + * targets: logo, + * x: 600, + * ease: 'Power1', + * duration: 2000 + * }); + * ``` + * + * See the `TweenBuilderConfig` for all of the options you have available. + * + * Playback will start immediately unless the tween has been configured to be paused. + * + * Please note that a Tween will not manipulate any target property that begins with an underscore. + * + * Tweens are designed to be 'fire-and-forget'. They automatically destroy themselves once playback + * is complete, to free-up memory and resources. If you wish to keep a tween after playback, i.e. to + * play it again at a later time, then you should set the `persist` property to `true` in the config. + * However, doing so means it's entirely up to _you_ to destroy the tween when you're finished with it, + * otherwise it will linger in memory forever. + * + * You can optionally pass an **array** of Tween Configuration objects to this method and it will create + * one Tween per entry in the array. If an array is given, an array of tweens is returned. + * + * If you wish to chain Tweens together for sequential playback, see the `TweenManager.chain` method. * * @method Phaser.Tweens.TweenManager#add * @since 3.0.0 * - * @param {Phaser.Types.Tweens.TweenBuilderConfig|object} config - The configuration object for the Tween. + * @param {Phaser.Types.Tweens.TweenBuilderConfig|Phaser.Types.Tweens.TweenBuilderConfig[]|object|object[]} config - A Tween Configuration object. Or an array of Tween Configuration objects. * - * @return {Phaser.Tweens.Tween} The created Tween. + * @return {Phaser.Tweens.Tween|Phaser.Tweens.Tween[]} The created Tween, or an array of Tweens if an array of tween configs was provided. */ add: function (config) { - var tween = TweenBuilder(this, config); + var tween; + var result = []; + var tweens = this.tweens; - this._add.push(tween); + if (!Array.isArray(config)) + { + config = [ config ]; + } - this._toProcess++; + for (var i = 0; i < config.length; i++) + { + tween = config[i]; - return tween; + if (tween instanceof Tween || tween instanceof TweenChain) + { + tweens.push(tween.init()); + } + else + { + if (Array.isArray(tween.tweens)) + { + tween = TweenChainBuilder(this, tween); + } + else + { + tween = TweenBuilder(this, tween); + } + + tweens.push(tween.init()); + } + + result.push(tween); + } + + return (result.length === 1) ? result[0] : result; }, /** - * Add an existing tween into the active Tween list. + * Create a sequence of Tweens, chained to one-another, and add them to this Tween Manager. + * + * The tweens are played in order, from start to finish. You can optionally set the chain + * to repeat as many times as you like. Once the chain has finished playing, or repeating if set, + * all tweens in the chain will be destroyed automatically. To override this, set the 'persists' + * argument to 'true'. + * + * Playback will start immediately unless the _first_ Tween has been configured to be paused. + * + * Please note that Tweens will not manipulate any target property that begins with an underscore. + * + * @method Phaser.Tweens.TweenManager#chain + * @since 3.60.0 + * + * @param {Phaser.Types.Tweens.TweenBuilderConfig[]|object[]} tweens - A Tween Chain configuration object, or an array of them to create multiple chains at once. + * + * @return {(Phaser.Tweens.TweenChain|Phaser.Tweens.TweenChain[])} The Tween Chain instance, or an array of them if you passed in an array of configs. + */ + chain: function (config) + { + if (!Array.isArray(config)) + { + config = [ config ]; + } + + var chain; + var result = []; + var tweens = this.tweens; + + for (var i = 0; i < config.length; i++) + { + chain = TweenChainBuilder(this, config[i]); + + tweens.push(chain.init()); + + result.push(chain); + } + + return (result.length === 1) ? result[0] : result; + }, + + /** + * Returns an array containing this Tween and all Tweens chained to it, + * in the order in which they will be played. + * + * If there are no chained Tweens an empty array is returned. + * + * @method Phaser.Tweens.TweenManager#getChainedTweens + * @since 3.60.0 + * + * @param {Phaser.Tweens.Tween} tween - The Tween to return the chain from. + * + * @return {Phaser.Tweens.Tween[]} An array of the chained tweens, or an empty array if there aren't any. + */ + getChainedTweens: function (tween) + { + return tween.getChainedTweens(); + }, + + /** + * Check to see if the given Tween instance exists within this Tween Manager. + * + * Will return `true` as long as the Tween is being processed by this Tween Manager. + * + * Will return `false` if not present, or has a state of `REMOVED` or `DESTROYED`. + * + * @method Phaser.Tweens.TweenManager#has + * @since 3.60.0 + * + * @param {Phaser.Tweens.Tween} tween - The Tween instance to check. + * + * @return {boolean} `true` if the Tween exists within this Tween Manager, otherwise `false`. + */ + has: function (tween) + { + return (this.tweens.indexOf(tween) > -1); + }, + + /** + * Add an existing Tween to this Tween Manager. + * + * Playback will start immediately unless the tween has been configured to be paused. * * @method Phaser.Tweens.TweenManager#existing * @since 3.0.0 * * @param {Phaser.Tweens.Tween} tween - The Tween to add. * - * @return {Phaser.Tweens.TweenManager} This Tween Manager object. + * @return {this} This Tween Manager instance. */ existing: function (tween) { - this._add.push(tween); - - this._toProcess++; + if (!this.has(tween)) + { + this.tweens.push(tween.init()); + } return this; }, @@ -212881,6 +213641,10 @@ var TweenManager = new Class({ /** * Create a Number Tween and add it to the active Tween list. * + * Playback will start immediately unless the tween has been configured to be paused. + * + * Please note that a Tween will not manipulate any target property that begins with an underscore. + * * @method Phaser.Tweens.TweenManager#addCounter * @since 3.0.0 * @@ -212892,9 +213656,7 @@ var TweenManager = new Class({ { var tween = NumberTweenBuilder(this, config); - this._add.push(tween); - - this._toProcess++; + this.tweens.push(tween.init()); return tween; }, @@ -212946,168 +213708,279 @@ var TweenManager = new Class({ }, /** - * Updates the Tween Manager's internal lists at the start of the frame. + * Set the limits that are used when a browser encounters lag, or delays that cause the elapsed + * time between two frames to exceed the expected amount. If this occurs, the Tween Manager will + * act as if the 'skip' amount of times has passed, in order to maintain strict tween sequencing. * - * This method will return immediately if no changes have been indicated. + * This is enabled by default with the values 500ms for the lag limit and 33ms for the skip. * - * @method Phaser.Tweens.TweenManager#preUpdate - * @since 3.0.0 + * You should not set these to low values, as it won't give time for the browser to ever + * catch-up with itself and reclaim sync. + * + * Call this method with no arguments to disable smoothing. + * + * Call it with the arguments `500` and `33` to reset to the defaults. + * + * @method Phaser.Tweens.TweenManager#setLagSmooth + * @since 3.60.0 + * + * @param {number} [limit=0] - If the browser exceeds this amount, in milliseconds, it will act as if the 'skip' amount has elapsed instead. + * @param {number} [skip=0] - The amount, in milliseconds, to use as the step delta should the browser lag beyond the 'limit'. + * + * @return {this} This Tween Manager instance. */ - preUpdate: function () + setLagSmooth: function (limit, skip) { - if (this._toProcess === 0) - { - // Quick bail - return; - } + if (limit === undefined) { limit = 1 / 1e-8; } + if (skip === undefined) { skip = 0; } - var list = this._destroy; - var active = this._active; - var pending = this._pending; - var i; - var tween; + this.maxLag = limit; + this.lagSkip = Math.min(skip, this.maxLag); - // Clear the 'destroy' list - for (i = 0; i < list.length; i++) - { - tween = list[i]; - - // Remove from the 'active' array - var idx = active.indexOf(tween); - - if (idx === -1) - { - // Not in the active array, is it in pending instead? - idx = pending.indexOf(tween); - - if (idx > -1) - { - tween.state = TWEEN_CONST.REMOVED; - pending.splice(idx, 1); - } - } - else - { - tween.state = TWEEN_CONST.REMOVED; - active.splice(idx, 1); - } - } - - list.length = 0; - - // Process the addition list - // This stops callbacks and out of sync events from populating the active array mid-way during the update - - list = this._add; - - for (i = 0; i < list.length; i++) - { - tween = list[i]; - - if (tween.state === TWEEN_CONST.PENDING_ADD) - { - // Return true if the Tween should be started right away, otherwise false - if (tween.init()) - { - tween.play(); - - this._active.push(tween); - } - else - { - this._pending.push(tween); - } - } - } - - list.length = 0; - - this._toProcess = 0; + return this; }, /** - * Updates all Tweens and Timelines of the Tween Manager. + * Limits the Tween system to run at a particular frame rate. + * + * You should not set this _above_ the frequency of the browser, + * but instead can use it to throttle the frame rate lower, should + * you need to in certain situations. + * + * @method Phaser.Tweens.TweenManager#setFps + * @since 3.60.0 + * + * @param {number} [fps=240] - The frame rate to tick at. + * + * @return {this} This Tween Manager instance. + */ + setFps: function (fps) + { + if (fps === undefined) { fps = 240; } + + this.gap = 1000 / fps; + this.nextTime = this.time * 1000 + this.gap; + + return this; + }, + + /** + * Internal method that calculates the delta value, along with the other timing values, + * and returns the new delta. + * + * You should not typically call this method directly. + * + * @method Phaser.Tweens.TweenManager#getDelta + * @since 3.60.0 + * + * @param {boolean} [tick=false] - Is this a manual tick, or an automated tick? + * + * @return {number} The new delta value. + */ + getDelta: function (tick) + { + var elapsed = Date.now() - this.prevTime; + + if (elapsed > this.maxLag) + { + this.startTime += elapsed - this.lagSkip; + } + + this.prevTime += elapsed; + + var time = this.prevTime - this.startTime; + var overlap = time - this.nextTime; + var delta = time - this.time * 1000; + + if (overlap > 0 || tick) + { + time /= 1000; + this.time = time; + this.nextTime += overlap + (overlap >= this.gap ? 4 : this.gap - overlap); + } + else + { + delta = 0; + } + + return delta; + }, + + /** + * Manually advance the Tween system by one step. + * + * This will update all Tweens even if the Tween Manager is currently + * paused. + * + * @method Phaser.Tweens.TweenManager#tick + * @since 3.60.0 + * + * @return {this} This Tween Manager instance. + */ + tick: function () + { + this.step(true); + + return this; + }, + + /** + * Internal update handler. + * + * Calls `TweenManager.step` as long as the Tween Manager has not + * been paused. * * @method Phaser.Tweens.TweenManager#update * @since 3.0.0 - * - * @param {number} timestamp - The current time in milliseconds. - * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. */ - update: function (timestamp, delta) + update: function () { - // Process active tweens - var list = this._active; + if (!this.paused) + { + this.step(false); + } + }, + + /** + * Updates all Tweens belonging to this Tween Manager. + * + * Called automatically by `update` and `tick`. + * + * @method Phaser.Tweens.TweenManager#step + * @since 3.60.0 + * + * @param {boolean} [tick=false] - Is this a manual tick, or an automated tick? + */ + step: function (tick) + { + if (tick === undefined) { tick = false; } + + var delta = this.getDelta(tick); + + if (delta === 0) + { + return; + } + + this.processing = true; + + var i; var tween; + var toDestroy = []; + var list = this.tweens; - // Scale the delta - delta *= this.timeScale; - - for (var i = 0; i < list.length; i++) + // By not caching the length we can immediately update tweens added + // this frame (such as chained tweens) + for (i = 0; i < list.length; i++) { tween = list[i]; // If Tween.update returns 'true' then it means it has completed, // so move it to the destroy list - if (tween.update(timestamp, delta)) + if (tween.update(delta)) { - this._destroy.push(tween); - this._toProcess++; + toDestroy.push(tween); } } + + // Clean-up the 'toDestroy' list + var count = toDestroy.length; + + if (count && list.length > 0) + { + for (i = 0; i < count; i++) + { + tween = toDestroy[i]; + + var idx = list.indexOf(tween); + + if (idx > -1 && (tween.isPendingRemove() || tween.isDestroyed())) + { + list.splice(idx, 1); + + tween.destroy(); + } + } + + toDestroy.length = 0; + } + + this.processing = false; }, /** - * Removes the given tween from the Tween Manager, regardless of its state (pending or active). + * Removes the given Tween from this Tween Manager, even if it hasn't started + * playback yet. If this method is called while the Tween Manager is processing + * an update loop, then the tween will be flagged for removal at the start of + * the next frame. Otherwise, it is removed immediately. + * + * The removed tween is _not_ destroyed. It is just removed from this Tween Manager. * * @method Phaser.Tweens.TweenManager#remove * @since 3.17.0 * * @param {Phaser.Tweens.Tween} tween - The Tween to be removed. * - * @return {Phaser.Tweens.TweenManager} This Tween Manager object. + * @return {this} This Tween Manager instance. */ remove: function (tween) { - ArrayRemove(this._add, tween); - ArrayRemove(this._pending, tween); - ArrayRemove(this._active, tween); - ArrayRemove(this._destroy, tween); + if (this.processing) + { + // Remove it on the next frame + tween.setPendingRemoveState(); + } + else + { + // Remove it immediately + ArrayRemove(this.tweens, tween); - tween.state = TWEEN_CONST.REMOVED; + tween.setRemovedState(); + } return this; }, /** - * Checks if a Tween or Timeline is active and adds it to the Tween Manager at the start of the frame if it isn't. + * Resets the given Tween. + * + * If the Tween does not belong to this Tween Manager, it will first be added. + * + * Then it will seek to position 0 and playback will start on the next frame. + * + * @method Phaser.Tweens.TweenManager#reset + * @since 3.60.0 + * + * @param {Phaser.Tweens.Tween} tween - The Tween to be reset. + * + * @return {this} This Tween Manager instance. + */ + reset: function (tween) + { + this.existing(tween); + + tween.seek(); + + tween.setActiveState(); + + return this; + }, + + /** + * Checks if a Tween is active and adds it to the Tween Manager at the start of the frame if it isn't. * * @method Phaser.Tweens.TweenManager#makeActive * @since 3.0.0 * * @param {Phaser.Tweens.Tween} tween - The Tween to check. * - * @return {Phaser.Tweens.TweenManager} This Tween Manager object. + * @return {this} This Tween Manager instance. */ makeActive: function (tween) { - if (this._add.indexOf(tween) !== -1 || this._active.indexOf(tween) !== -1) - { - return this; - } + this.existing(tween); - var idx = this._pending.indexOf(tween); - - if (idx !== -1) - { - this._pending.splice(idx, 1); - } - - this._add.push(tween); - - tween.state = TWEEN_CONST.PENDING_ADD; - - this._toProcess++; + tween.setActiveState(); return this; }, @@ -213121,47 +213994,89 @@ var TweenManager = new Class({ * @param {function} callback - The function to call. * @param {object} [scope] - The scope (`this` object) to call the function with. * @param {...*} [args] - The arguments to pass into the function. Its first argument will always be the Tween currently being iterated. + * + * @return {this} This Tween Manager instance. */ each: function (callback, scope) { + var i; var args = [ null ]; - for (var i = 1; i < arguments.length; i++) + for (i = 1; i < arguments.length; i++) { args.push(arguments[i]); } - for (var texture in this.list) + this.tweens.forEach(function (tween) { - args[0] = this.list[texture]; + args[0] = tween; callback.apply(scope, args); - } + }); + + return this; }, /** - * Returns an array of all active Tweens and Timelines in the Tween Manager. + * Returns an array containing references to all Tweens in this Tween Manager. * - * @method Phaser.Tweens.TweenManager#getAllTweens + * It is safe to mutate the returned array. However, acting upon any of the Tweens + * within it, will adjust those stored in this Tween Manager, as they are passed + * by reference and not cloned. + * + * If you wish to get tweens for a specific target, see `getTweensOf`. + * + * @method Phaser.Tweens.TweenManager#getTweens * @since 3.0.0 * - * @return {Phaser.Tweens.Tween[]} A new array containing references to all active Tweens and Timelines. + * @return {Phaser.Tweens.Tween[]} A new array containing references to all Tweens. */ - getAllTweens: function () + getTweens: function () + { + return this.tweens.slice(); + }, + + /** + * Returns an array of all Tweens in the Tween Manager which affect the given target, or array of targets. + * + * It's possible for this method to return tweens that are about to be removed from + * the Tween Manager. You should check the state of the returned tween before acting + * upon it. + * + * @method Phaser.Tweens.TweenManager#getTweensOf + * @since 3.0.0 + * + * @param {object|array} target - The target to look for. Provide an array to look for multiple targets. + * + * @return {Phaser.Tweens.Tween[]} A new array containing all Tweens which affect the given target(s). + */ + getTweensOf: function (target) { - var list = this._active; var output = []; + var list = this.tweens; + + target = Flatten(target); + + var targetLen = target.length; for (var i = 0; i < list.length; i++) { - output.push(list[i]); + var tween = list[i]; + + for (var t = 0; t < targetLen; t++) + { + if (tween.hasTarget(target[t])) + { + output.push(tween); + } + } } return output; }, /** - * Returns the scale of the time delta for all Tweens and Timelines owned by this Tween Manager. + * Returns the scale of the time delta for all Tweens owned by this Tween Manager. * * @method Phaser.Tweens.TweenManager#getGlobalTimeScale * @since 3.0.0 @@ -213173,183 +214088,6 @@ var TweenManager = new Class({ return this.timeScale; }, - /** - * Returns an array of all Tweens or Timelines in the Tween Manager which affect the given target or array of targets. - * - * Only the currently active tweens are tested. A tween that has completed and is - * awaiting removal will not be included in the results. - * - * If you wish to also search pending tweens, use the `includePending` flag. - * - * @method Phaser.Tweens.TweenManager#getTweensOf - * @since 3.0.0 - * - * @param {(object|array)} target - The target to look for. Provide an array to look for multiple targets. - * @param {boolean} [includePending=false] - Also check for pending tweens, not just active ones? - * - * @return {Phaser.Tweens.Tween[]} A new array containing all Tweens and Timelines which affect the given target(s). - */ - getTweensOf: function (target, includePending) - { - if (includePending === undefined) { includePending = false; } - - var list = this._active; - var tween; - var output = []; - var i; - var t; - - if (!Array.isArray(target)) - { - target = [ target ]; - } - - for (i = 0; i < list.length; i++) - { - tween = list[i]; - - for (t = 0; t < target.length; t++) - { - if (tween.hasTarget(target[t])) - { - output.push(tween); - } - } - } - - if (includePending) - { - list = this._pending; - - for (i = 0; i < list.length; i++) - { - tween = list[i]; - - for (t = 0; t < target.length; t++) - { - if (tween.hasTarget(target[t])) - { - output.push(tween); - } - } - } - } - - return output; - }, - - /** - * Checks if the given object is being affected by a playing Tween. - * - * @method Phaser.Tweens.TweenManager#isTweening - * @since 3.0.0 - * - * @param {object} target - target Phaser.Tweens.Tween object - * - * @return {boolean} returns if target tween object is active or not - */ - isTweening: function (target) - { - var list = this._active; - var tween; - - for (var i = 0; i < list.length; i++) - { - tween = list[i]; - - if (tween.hasTarget(target) && tween.isPlaying()) - { - return true; - } - } - - return false; - }, - - /** - * Stops all Tweens in this Tween Manager. They will be removed at the start of the frame. - * - * @method Phaser.Tweens.TweenManager#killAll - * @since 3.0.0 - * - * @return {Phaser.Tweens.TweenManager} This Tween Manager. - */ - killAll: function () - { - var tweens = this.getAllTweens(); - - for (var i = 0; i < tweens.length; i++) - { - tweens[i].stop(); - } - - return this; - }, - - /** - * Stops all Tweens which affect the given target or array of targets. The Tweens will be removed from the Tween Manager at the start of the frame. - * - * @see {@link #getTweensOf} - * - * @method Phaser.Tweens.TweenManager#killTweensOf - * @since 3.0.0 - * - * @param {(object|array)} target - The target to look for. Provide an array to look for multiple targets. - * - * @return {Phaser.Tweens.TweenManager} This Tween Manager. - */ - killTweensOf: function (target) - { - var tweens = this.getTweensOf(target); - - for (var i = 0; i < tweens.length; i++) - { - tweens[i].stop(); - } - - return this; - }, - - /** - * Pauses all Tweens in this Tween Manager. - * - * @method Phaser.Tweens.TweenManager#pauseAll - * @since 3.0.0 - * - * @return {Phaser.Tweens.TweenManager} This Tween Manager. - */ - pauseAll: function () - { - var list = this._active; - - for (var i = 0; i < list.length; i++) - { - list[i].pause(); - } - - return this; - }, - - /** - * Resumes all Tweens in this Tween Manager. - * - * @method Phaser.Tweens.TweenManager#resumeAll - * @since 3.0.0 - * - * @return {Phaser.Tweens.TweenManager} This Tween Manager. - */ - resumeAll: function () - { - var list = this._active; - - for (var i = 0; i < list.length; i++) - { - list[i].resume(); - } - - return this; - }, - /** * Sets a new scale of the time delta for this Tween Manager. * @@ -213360,7 +214098,7 @@ var TweenManager = new Class({ * * @param {number} value - The new scale of the time delta, where 1 is the normal speed. * - * @return {Phaser.Tweens.TweenManager} This Tween Manager. + * @return {this} This Tween Manager instance. */ setGlobalTimeScale: function (value) { @@ -213369,8 +214107,144 @@ var TweenManager = new Class({ return this; }, + /** + * Checks if the given object is being affected by a _playing_ Tween. + * + * If the Tween is paused, this method will return false. + * + * @method Phaser.Tweens.TweenManager#isTweening + * @since 3.0.0 + * + * @param {object} target - The object to check if a tween is active for it, or not. + * + * @return {boolean} Returns `true` if a tween is active on the given target, otherwise `false`. + */ + isTweening: function (target) + { + var list = this.tweens; + var tween; + + for (var i = 0; i < list.length; i++) + { + tween = list[i]; + + if (tween.isPlaying() && tween.hasTarget(target)) + { + return true; + } + } + + return false; + }, + + /** + * Destroys all Tweens in this Tween Manager. + * + * The tweens will erase all references to any targets they hold + * and be stopped immediately. + * + * If this method is called while the Tween Manager is running its + * update process, then the tweens will be removed at the start of + * the next frame. Outside of this, they are removed immediately. + * + * @method Phaser.Tweens.TweenManager#killAll + * @since 3.0.0 + * + * @return {this} This Tween Manager instance. + */ + killAll: function () + { + var tweens = (this.processing) ? this.getAllTweens() : this.tweens; + + for (var i = 0; i < tweens.length; i++) + { + tweens[i].destroy(); + } + + if (!this.processing) + { + tweens.length = 0; + } + + return this; + }, + + /** + * Stops all Tweens which affect the given target or array of targets. + * + * The tweens will erase all references to any targets they hold + * and be stopped immediately. + * + * If this method is called while the Tween Manager is running its + * update process, then the tweens will be removed at the start of + * the next frame. Outside of this, they are removed immediately. + * + * @see {@link #getTweensOf} + * + * @method Phaser.Tweens.TweenManager#killTweensOf + * @since 3.0.0 + * + * @param {(object|array)} target - The target to kill the tweens of. Provide an array to use multiple targets. + * + * @return {this} This Tween Manager instance. + */ + killTweensOf: function (target) + { + var tweens = this.getTweensOf(target); + + for (var i = 0; i < tweens.length; i++) + { + tweens[i].destroy(); + } + + return this; + }, + + /** + * Pauses this Tween Manager. No Tweens will update while paused. + * + * This includes tweens created after this method was called. + * + * See `TweenManager#resumeAll` to resume the playback. + * + * As of Phaser 3.60 you can also toggle the boolean property `TweenManager.paused`. + * + * @method Phaser.Tweens.TweenManager#pauseAll + * @since 3.0.0 + * + * @return {this} This Tween Manager instance. + */ + pauseAll: function () + { + this.paused = true; + + return this; + }, + + /** + * Resumes playback of this Tween Manager. + * + * All active Tweens will continue updating. + * + * See `TweenManager#pauseAll` to pause the playback. + * + * As of Phaser 3.60 you can also toggle the boolean property `TweenManager.paused`. + * + * @method Phaser.Tweens.TweenManager#resumeAll + * @since 3.0.0 + * + * @return {this} This Tween Manager instance. + */ + resumeAll: function () + { + this.paused = false; + + return this; + }, + /** * The Scene that owns this plugin is shutting down. + * * We need to kill and reset all internal properties as well as stop listening to Scene events. * * @method Phaser.Tweens.TweenManager#shutdown @@ -213380,16 +214254,10 @@ var TweenManager = new Class({ { this.killAll(); - this._add = []; - this._pending = []; - this._active = []; - this._destroy = []; - - this._toProcess = 0; + this.tweens = []; var eventEmitter = this.systems.events; - eventEmitter.off(SceneEvents.PRE_UPDATE, this.preUpdate, this); eventEmitter.off(SceneEvents.UPDATE, this.update, this); eventEmitter.off(SceneEvents.SHUTDOWN, this.shutdown, this); }, @@ -213425,7 +214293,7 @@ module.exports = TweenManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -213437,9 +214305,9 @@ module.exports = TweenManager; * * @param {object} source - The object to retrieve the value from. * @param {string} key - The key to look for in the `source` object. - * @param {*} defaultValue - The default value to return if the `key` doesn't exist or if no `source` object is provided. + * @param {boolean} defaultValue - The default value to return if the `key` doesn't exist or if no `source` object is provided. * - * @return {*} The retrieved value. + * @return {boolean} The retrieved value. */ var GetBoolean = function (source, key, defaultValue) { @@ -213467,7 +214335,7 @@ module.exports = GetBoolean; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -213476,7 +214344,7 @@ var UppercaseFirst = __webpack_require__(40587); /** * This internal function is used to return the correct ease function for a Tween. - * + * * It can take a variety of input, including an EaseMap based string, or a custom function. * * @function Phaser.Tweens.Builders.GetEaseFunction @@ -213513,23 +214381,25 @@ var GetEaseFunction = function (ease, easeParams) // quad.out = Quad.easeOut // quad.inout = Quad.easeInOut - direction = ease.substr(ease.indexOf('.') + 1); + direction = ease.substring(ease.indexOf('.') + 1); - if (direction.toLowerCase() === 'in') + var directionLower = direction.toLowerCase(); + + if (directionLower === 'in') { direction = 'easeIn'; } - else if (direction.toLowerCase() === 'out') + else if (directionLower === 'out') { direction = 'easeOut'; } - else if (direction.toLowerCase() === 'inout') + else if (directionLower === 'inout') { direction = 'easeInOut'; } } - ease = UppercaseFirst(ease.substr(0, ease.indexOf('.') + 1) + direction); + ease = UppercaseFirst(ease.substring(0, ease.indexOf('.') + 1) + direction); if (EaseMap.hasOwnProperty(ease)) { @@ -213542,10 +214412,6 @@ var GetEaseFunction = function (ease, easeParams) // Custom function easeFunction = ease; } - else if (Array.isArray(ease) && ease.length === 4) - { - // Bezier function (TODO) - } // No custom ease parameters? if (!easeParams) @@ -213570,6 +214436,74 @@ var GetEaseFunction = function (ease, easeParams) module.exports = GetEaseFunction; +/***/ }), + +/***/ 4840: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Bezier = __webpack_require__(63210); +var CatmullRom = __webpack_require__(88332); +var Linear = __webpack_require__(47614); + +var FuncMap = { + bezier: Bezier, + catmull: CatmullRom, + catmullrom: CatmullRom, + linear: Linear +}; + +/** + * This internal function is used to return the correct interpolation function for a Tween. + * + * It can take a variety of input, including a string, or a custom function. + * + * @function Phaser.Tweens.Builders.GetInterpolationFunction + * @since 3.60.0 + * + * @param {(string|function|null)} interpolation - The interpolation function to find. This can be either a string, or a custom function, or null. + * + * @return {?function} The interpolation function to use, or `null`. + */ +var GetInterpolationFunction = function (interpolation) +{ + if (interpolation === null) + { + return null; + } + + // Default interpolation function + var interpolationFunction = FuncMap.linear; + + // Prepare interpolation function + if (typeof interpolation === 'string') + { + // String based look-up + + // 1) They specified it correctly + if (FuncMap.hasOwnProperty(interpolation)) + { + interpolationFunction = FuncMap[interpolation]; + } + } + else if (typeof interpolation === 'function') + { + // Custom function + interpolationFunction = interpolation; + } + + // Return interpolation function + return interpolationFunction; +}; + +module.exports = GetInterpolationFunction; + + /***/ }), /***/ 28348: @@ -213577,7 +214511,7 @@ module.exports = GetEaseFunction; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -213592,7 +214526,7 @@ module.exports = GetEaseFunction; * @param {string} key - The property to get from the source. * @param {any} defaultValue - A default value to return should the source not have the property set. * - * @return {function} A function which when called will return the property value from the source. + * @return {function} A function which, when called, will return the property value from the source. */ var GetNewValue = function (source, key, defaultValue) { @@ -213642,7 +214576,7 @@ module.exports = GetNewValue; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -213673,7 +214607,7 @@ var GetProps = function (config) for (key in config.props) { // Skip any property that starts with an underscore - if (key.substr(0, 1) !== '_') + if (key.substring(0, 1) !== '_') { keys.push({ key: key, value: config.props[key] }); } @@ -213684,7 +214618,7 @@ var GetProps = function (config) for (key in config) { // Skip any property that is in the ReservedProps list or that starts with an underscore - if (RESERVED.indexOf(key) === -1 && key.substr(0, 1) !== '_') + if (RESERVED.indexOf(key) === -1 && key.substring(0, 1) !== '_') { keys.push({ key: key, value: config[key] }); } @@ -213704,7 +214638,7 @@ module.exports = GetProps; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -213749,63 +214683,17 @@ module.exports = GetTargets; /***/ }), -/***/ 10365: +/***/ 9744: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetValue = __webpack_require__(10850); - -/** - * Internal function used by the Timeline Builder. - * - * It returns an array of all tweens in the given timeline config. - * - * @function Phaser.Tweens.Builders.GetTweens - * @since 3.0.0 - * - * @param {Phaser.Types.Tweens.TimelineBuilderConfig} config - The configuration object for the Timeline. - * - * @return {Phaser.Tweens.Tween[]} An array of Tween instances that the Timeline will manage. - */ -var GetTweens = function (config) -{ - var tweens = GetValue(config, 'tweens', null); - - if (tweens === null) - { - return []; - } - else if (typeof tweens === 'function') - { - tweens = tweens.call(); - } - - if (!Array.isArray(tweens)) - { - tweens = [ tweens ]; - } - - return tweens; -}; - -module.exports = GetTweens; - - -/***/ }), - -/***/ 9744: -/***/ ((module) => { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ +var Between = __webpack_require__(17489); +var FloatBetween = __webpack_require__(61616); /** * @ignore @@ -213841,7 +214729,7 @@ function hasGetters (def) /** * Returns `getActive`, `getStart` and `getEnd` functions for a TweenData based on a target property and end value. - * + * * `getActive` if not null, is invoked _immediately_ as soon as the TweenData is running, and is set on the target property. * `getEnd` is invoked once any start delays have expired and returns what the value should tween to. * `getStart` is invoked when the tween reaches the end and needs to either repeat or yoyo, it returns the value to go back to. @@ -213850,11 +214738,11 @@ function hasGetters (def) * A string can be provided to specify a relative end value which consists of an operation * (`+=` to add to the current value, `-=` to subtract from the current value, `*=` to multiply the current * value, or `/=` to divide the current value) followed by its operand. - * + * * A function can be provided to allow greater control over the end value; it will receive the target * object being tweened, the name of the property being tweened, and the current value of the property - * as its arguments. - * + * as its arguments and must return a value. + * * If both the starting and the ending values need to be controlled, an object with `getStart` and `getEnd` * callbacks, which will receive the same arguments, can be provided instead. If an object with a `value` * property is provided, the property will be used as the effective value under the same rules described here. @@ -213894,53 +214782,112 @@ var GetValueOp = function (key, propertyValue) return propertyValue; }; } + else if (Array.isArray(propertyValue)) + { + // props: { + // x: [ 400, 300, 200 ], + // y: [ 10, 500, 10 ] + // } + + getStart = function () + { + return propertyValue[0]; + }; + + getEnd = function () + { + return propertyValue[propertyValue.length - 1]; + }; + } else if (t === 'string') { // props: { // x: '+=400', // y: '-=300', // z: '*=2', - // w: '/=2' + // w: '/=2', + // p: 'random(10, 100)' - random float + // p: 'int(10, 100)' - random int // } - var op = propertyValue[0]; - var num = parseFloat(propertyValue.substr(2)); + var op = propertyValue.toLowerCase(); + var isRandom = (op.substring(0, 6) === 'random'); + var isInt = (op.substring(0, 3) === 'int'); - switch (op) + if (isRandom || isInt) { - case '+': - getEnd = function (target, key, value) - { - return value + num; - }; - break; + // random(0.5, 3.45) + // int(10, 100) + var brace1 = op.indexOf('('); + var brace2 = op.indexOf(')'); + var comma = op.indexOf(','); - case '-': - getEnd = function (target, key, value) - { - return value - num; - }; - break; + if (brace1 && brace2 && comma) + { + var value1 = parseFloat(op.substring(brace1 + 1, comma)); + var value2 = parseFloat(op.substring(comma + 1, brace2)); - case '*': - getEnd = function (target, key, value) + if (isRandom) { - return value * num; - }; - break; + getEnd = function () + { + return FloatBetween(value1, value2); + }; + } + else + { + getEnd = function () + { + return Between(value1, value2); + }; + } + } + else + { + throw new Error('invalid random() format'); + } + } + else + { + op = op[0]; + var num = parseFloat(propertyValue.substr(2)); - case '/': - getEnd = function (target, key, value) - { - return value / num; - }; - break; + switch (op) + { + case '+': + getEnd = function (target, key, value) + { + return value + num; + }; + break; - default: - getEnd = function () - { - return parseFloat(propertyValue); - }; + case '-': + getEnd = function (target, key, value) + { + return value - num; + }; + break; + + case '*': + getEnd = function (target, key, value) + { + return value * num; + }; + break; + + case '/': + getEnd = function (target, key, value) + { + return value / num; + }; + break; + + default: + getEnd = function () + { + return parseFloat(propertyValue); + }; + } } } else if (t === 'function') @@ -213948,7 +214895,7 @@ var GetValueOp = function (key, propertyValue) // The same as setting just the getEnd function and no getStart // props: { - // x: function (target, key, value, targetIndex, totalTargets, tween) { return value + 50); }, + // x: function (target, key, value, targetIndex, totalTargets, tween, tweenData) { return value + 50); }, // } getEnd = propertyValue; @@ -213960,19 +214907,19 @@ var GetValueOp = function (key, propertyValue) /* x: { // Called the moment Tween is active. The returned value sets the property on the target immediately. - getActive: function (target, key, value, targetIndex, totalTargets, tween) + getActive: function (target, key, value, targetIndex, totalTargets, tween, tweenData) { return value; }, // Called at the start of the Tween. The returned value sets what the property will be at the END of the Tween. - getEnd: function (target, key, value, targetIndex, totalTargets, tween) + getEnd: function (target, key, value, targetIndex, totalTargets, tween, tweenData) { return value; }, // Called at the end of the Tween. The returned value sets what the property will be at the START of the Tween. - getStart: function (target, key, value, targetIndex, totalTargets, tween) + getStart: function (target, key, value, targetIndex, totalTargets, tween, tweenData) { return value; } @@ -214035,14 +214982,14 @@ var GetValueOp = function (key, propertyValue) if (hasStart) { var startCallbacks = GetValueOp(key, propertyValue.start); - + callbacks.getActive = startCallbacks.getEnd; } - + if (hasFrom) { var fromCallbacks = GetValueOp(key, propertyValue.from); - + callbacks.getStart = fromCallbacks.getEnd; } } @@ -214072,10 +215019,11 @@ module.exports = GetValueOp; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var BaseTween = __webpack_require__(502); var Defaults = __webpack_require__(99730); var GetAdvancedValue = __webpack_require__(20494); var GetBoolean = __webpack_require__(63130); @@ -214083,8 +215031,8 @@ var GetEaseFunction = __webpack_require__(21902); var GetNewValue = __webpack_require__(28348); var GetValue = __webpack_require__(10850); var GetValueOp = __webpack_require__(9744); +var MergeRight = __webpack_require__(72066); var Tween = __webpack_require__(39366); -var TweenData = __webpack_require__(15718); /** * Creates a new Number Tween. @@ -214092,7 +215040,7 @@ var TweenData = __webpack_require__(15718); * @function Phaser.Tweens.Builders.NumberTweenBuilder * @since 3.0.0 * - * @param {(Phaser.Tweens.TweenManager|Phaser.Tweens.Timeline)} parent - The owner of the new Tween. + * @param {Phaser.Tweens.TweenManager} parent - The owner of the new Tween. * @param {Phaser.Types.Tweens.NumberTweenBuilderConfig} config - Configuration for the new Tween. * @param {Phaser.Types.Tweens.TweenConfigDefaults} defaults - Tween configuration defaults. * @@ -214100,10 +215048,21 @@ var TweenData = __webpack_require__(15718); */ var NumberTweenBuilder = function (parent, config, defaults) { + if (config instanceof Tween) + { + config.parent = parent; + + return config; + } + if (defaults === undefined) { defaults = Defaults; } + else + { + defaults = MergeRight(Defaults, defaults); + } // var tween = this.tweens.addCounter({ // from: 100, @@ -214120,56 +215079,46 @@ var NumberTweenBuilder = function (parent, config, defaults) var targets = [ { value: from } ]; - var delay = GetNewValue(config, 'delay', defaults.delay); - var duration = GetNewValue(config, 'duration', defaults.duration); + var delay = GetValue(config, 'delay', defaults.delay); var easeParams = GetValue(config, 'easeParams', defaults.easeParams); - var ease = GetEaseFunction(GetValue(config, 'ease', defaults.ease), easeParams); - var hold = GetNewValue(config, 'hold', defaults.hold); - var repeat = GetNewValue(config, 'repeat', defaults.repeat); - var repeatDelay = GetNewValue(config, 'repeatDelay', defaults.repeatDelay); - var yoyo = GetBoolean(config, 'yoyo', defaults.yoyo); - - var data = []; + var ease = GetValue(config, 'ease', defaults.ease); var ops = GetValueOp('value', to); - var tweenData = TweenData( - targets[0], + var tween = new Tween(parent, targets); + + // TODO - Needs tidying up + easeParams being used, etc + + var tweenData = tween.add( 0, 'value', ops.getEnd, ops.getStart, ops.getActive, - ease, - delay, - duration, - yoyo, - hold, - repeat, - repeatDelay, + GetEaseFunction(GetValue(config, 'ease', ease), GetValue(config, 'easeParams', easeParams)), + GetNewValue(config, 'delay', delay), + GetValue(config, 'duration', defaults.duration), + GetBoolean(config, 'yoyo', defaults.yoyo), + GetValue(config, 'hold', defaults.hold), + GetValue(config, 'repeat', defaults.repeat), + GetValue(config, 'repeatDelay', defaults.repeatDelay), false, false ); tweenData.start = from; tweenData.current = from; - tweenData.to = to; - data.push(tweenData); - - var tween = new Tween(parent, data, targets); - - tween.offset = GetAdvancedValue(config, 'offset', null); tween.completeDelay = GetAdvancedValue(config, 'completeDelay', 0); tween.loop = Math.round(GetAdvancedValue(config, 'loop', 0)); tween.loopDelay = Math.round(GetAdvancedValue(config, 'loopDelay', 0)); tween.paused = GetBoolean(config, 'paused', false); - tween.useFrames = GetBoolean(config, 'useFrames', false); + tween.persist = GetBoolean(config, 'persist', false); // Set the Callbacks - var scope = GetValue(config, 'callbackScope', tween); + tween.callbackScope = GetValue(config, 'callbackScope', tween); - var callbacks = Tween.TYPES; + var callbacks = BaseTween.TYPES; for (var i = 0; i < callbacks.length; i++) { @@ -214179,10 +215128,9 @@ var NumberTweenBuilder = function (parent, config, defaults) if (callback) { - var callbackScope = GetValue(config, type + 'Scope', scope); var callbackParams = GetValue(config, type + 'Params', []); - tween.setCallback(type, callback, callbackParams, callbackScope); + tween.setCallback(type, callback, callbackParams); } } @@ -214199,7 +215147,7 @@ module.exports = NumberTweenBuilder; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -214209,14 +215157,14 @@ var MATH_CONST = __webpack_require__(83392); /** * Creates a Stagger function to be used by a Tween property. - * + * * The stagger function will allow you to stagger changes to the value of the property across all targets of the tween. - * + * * This is only worth using if the tween has multiple targets. - * + * * The following will stagger the delay by 100ms across all targets of the tween, causing them to scale down to 0.2 * over the duration specified: - * + * * ```javascript * this.tweens.add({ * targets: [ ... ], @@ -214226,10 +215174,10 @@ var MATH_CONST = __webpack_require__(83392); * delay: this.tweens.stagger(100) * }); * ``` - * + * * The following will stagger the delay by 500ms across all targets of the tween using a 10 x 6 grid, staggering * from the center out, using a cubic ease. - * + * * ```javascript * this.tweens.add({ * targets: [ ... ], @@ -214277,7 +215225,7 @@ var StaggerBuilder = function (value, options) if (grid) { - // Pre-calc the grid to save doing it for ever tweendata update + // Pre-calc the grid to save doing it for every TweenData update var gridWidth = grid[0]; var gridHeight = grid[1]; @@ -214337,18 +215285,18 @@ var StaggerBuilder = function (value, options) var gridSpace = 0; var toX = index % gridWidth; var toY = Math.floor(index / gridWidth); - + if (toX >= 0 && toX < gridWidth && toY >= 0 && toY < gridHeight) { gridSpace = gridValues[toY][toX]; } var output; - + if (isRange) { var diff = (value2 - value1); - + if (easeFunction) { output = ((gridSpace / gridMax) * diff) * easeFunction(gridSpace / gridMax); @@ -214376,9 +215324,9 @@ var StaggerBuilder = function (value, options) { // zero offset total--; - + var fromIndex; - + if (fromFirst) { fromIndex = index; @@ -214395,9 +215343,9 @@ var StaggerBuilder = function (value, options) { fromIndex = Math.abs(from - index); } - + var output; - + if (isRange) { var spacing; @@ -214410,7 +215358,7 @@ var StaggerBuilder = function (value, options) { spacing = ((value2 - value1) / total) * fromIndex; } - + if (easeFunction) { output = spacing * easeFunction(fromIndex / total); @@ -214428,7 +215376,7 @@ var StaggerBuilder = function (value, options) { output = fromIndex * value1; } - + return output + start; }; } @@ -214439,158 +215387,6 @@ var StaggerBuilder = function (value, options) module.exports = StaggerBuilder; -/***/ }), - -/***/ 32981: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Clone = __webpack_require__(32742); -var Defaults = __webpack_require__(99730); -var GetAdvancedValue = __webpack_require__(20494); -var GetBoolean = __webpack_require__(63130); -var GetEaseFunction = __webpack_require__(21902); -var GetNewValue = __webpack_require__(28348); -var GetTargets = __webpack_require__(65868); -var GetTweens = __webpack_require__(10365); -var GetValue = __webpack_require__(10850); -var Timeline = __webpack_require__(28860); -var TweenBuilder = __webpack_require__(68061); - -/** - * Builds a Timeline of Tweens based on a configuration object. - * - * @function Phaser.Tweens.Builders.TimelineBuilder - * @since 3.0.0 - * - * @param {Phaser.Tweens.TweenManager} manager - The Tween Manager to which the Timeline will belong. - * @param {Phaser.Types.Tweens.TimelineBuilderConfig} config - The configuration object for the Timeline. - * - * @return {Phaser.Tweens.Timeline} The created Timeline. - */ -var TimelineBuilder = function (manager, config) -{ - var timeline = new Timeline(manager); - - timeline.completeDelay = GetAdvancedValue(config, 'completeDelay', 0); - timeline.loop = Math.round(GetAdvancedValue(config, 'loop', 0)); - timeline.loopDelay = Math.round(GetAdvancedValue(config, 'loopDelay', 0)); - timeline.paused = GetBoolean(config, 'paused', false); - timeline.useFrames = GetBoolean(config, 'useFrames', false); - - // Callbacks - - var scope = GetValue(config, 'callbackScope', timeline); - var onStart = GetValue(config, 'onStart', false); - - // The Start of the Timeline - if (onStart) - { - var onStartScope = GetValue(config, 'onStartScope', scope); - var onStartParams = GetValue(config, 'onStartParams', []); - - timeline.setCallback('onStart', onStart, onStartParams, onStartScope); - } - - var onUpdate = GetValue(config, 'onUpdate', false); - - // Every time the Timeline updates (regardless which Tweens are running) - if (onUpdate) - { - var onUpdateScope = GetValue(config, 'onUpdateScope', scope); - var onUpdateParams = GetValue(config, 'onUpdateParams', []); - - timeline.setCallback('onUpdate', onUpdate, onUpdateParams, onUpdateScope); - } - - var onLoop = GetValue(config, 'onLoop', false); - - // Called when the whole Timeline loops - if (onLoop) - { - var onLoopScope = GetValue(config, 'onLoopScope', scope); - var onLoopParams = GetValue(config, 'onLoopParams', []); - - timeline.setCallback('onLoop', onLoop, onLoopParams, onLoopScope); - } - - var onYoyo = GetValue(config, 'onYoyo', false); - - // Called when a Timeline yoyos - if (onYoyo) - { - var onYoyoScope = GetValue(config, 'onYoyoScope', scope); - var onYoyoParams = GetValue(config, 'onYoyoParams', []); - - timeline.setCallback('onYoyo', onYoyo, onYoyoParams, onYoyoScope); - } - - var onComplete = GetValue(config, 'onComplete', false); - - // Called when the Timeline completes, after the completeDelay, etc. - if (onComplete) - { - var onCompleteScope = GetValue(config, 'onCompleteScope', scope); - var onCompleteParams = GetValue(config, 'onCompleteParams', []); - - timeline.setCallback('onComplete', onComplete, onCompleteParams, onCompleteScope); - } - - // Tweens - - var tweens = GetTweens(config); - - if (tweens.length === 0) - { - timeline.paused = true; - - return timeline; - } - - var defaults = Clone(Defaults); - - defaults.targets = GetTargets(config); - - // totalDuration: If specified each tween in the Timeline is given an equal portion of the totalDuration - - var totalDuration = GetAdvancedValue(config, 'totalDuration', 0); - - if (totalDuration > 0) - { - defaults.duration = Math.floor(totalDuration / tweens.length); - } - else - { - defaults.duration = GetNewValue(config, 'duration', defaults.duration); - } - - defaults.delay = GetNewValue(config, 'delay', defaults.delay); - defaults.easeParams = GetValue(config, 'easeParams', defaults.easeParams); - defaults.ease = GetEaseFunction(GetValue(config, 'ease', defaults.ease), defaults.easeParams); - defaults.hold = GetNewValue(config, 'hold', defaults.hold); - defaults.repeat = GetNewValue(config, 'repeat', defaults.repeat); - defaults.repeatDelay = GetNewValue(config, 'repeatDelay', defaults.repeatDelay); - defaults.yoyo = GetBoolean(config, 'yoyo', defaults.yoyo); - defaults.flipX = GetBoolean(config, 'flipX', defaults.flipX); - defaults.flipY = GetBoolean(config, 'flipY', defaults.flipY); - - // Create the Tweens - for (var i = 0; i < tweens.length; i++) - { - timeline.queue(TweenBuilder(timeline, tweens[i], defaults)); - } - - return timeline; -}; - -module.exports = TimelineBuilder; - - /***/ }), /***/ 68061: @@ -214598,21 +215394,23 @@ module.exports = TimelineBuilder; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var BaseTween = __webpack_require__(502); var Defaults = __webpack_require__(99730); var GetAdvancedValue = __webpack_require__(20494); var GetBoolean = __webpack_require__(63130); var GetEaseFunction = __webpack_require__(21902); +var GetInterpolationFunction = __webpack_require__(4840); var GetNewValue = __webpack_require__(28348); var GetProps = __webpack_require__(92407); var GetTargets = __webpack_require__(65868); var GetValue = __webpack_require__(10850); var GetValueOp = __webpack_require__(9744); +var MergeRight = __webpack_require__(72066); var Tween = __webpack_require__(39366); -var TweenData = __webpack_require__(15718); /** * Creates a new Tween. @@ -214620,7 +215418,7 @@ var TweenData = __webpack_require__(15718); * @function Phaser.Tweens.Builders.TweenBuilder * @since 3.0.0 * - * @param {(Phaser.Tweens.TweenManager|Phaser.Tweens.Timeline)} parent - The owner of the new Tween. + * @param {Phaser.Tweens.TweenManager} parent - The owner of the new Tween. * @param {Phaser.Types.Tweens.TweenBuilderConfig|object} config - Configuration for the new Tween. * @param {Phaser.Types.Tweens.TweenConfigDefaults} defaults - Tween configuration defaults. * @@ -214628,30 +215426,110 @@ var TweenData = __webpack_require__(15718); */ var TweenBuilder = function (parent, config, defaults) { + if (config instanceof Tween) + { + config.parent = parent; + + return config; + } + if (defaults === undefined) { defaults = Defaults; } + else + { + defaults = MergeRight(Defaults, defaults); + } // Create arrays of the Targets and the Properties - var targets = (defaults.targets) ? defaults.targets : GetTargets(config); + var targets = GetTargets(config); + + if (!targets && defaults.targets) + { + targets = defaults.targets; + } - // var props = (defaults.props) ? defaults.props : GetProps(config); var props = GetProps(config); // Default Tween values - var delay = GetNewValue(config, 'delay', defaults.delay); - var duration = GetNewValue(config, 'duration', defaults.duration); + + var delay = GetValue(config, 'delay', defaults.delay); + var duration = GetValue(config, 'duration', defaults.duration); var easeParams = GetValue(config, 'easeParams', defaults.easeParams); - var ease = GetEaseFunction(GetValue(config, 'ease', defaults.ease), easeParams); - var hold = GetNewValue(config, 'hold', defaults.hold); - var repeat = GetNewValue(config, 'repeat', defaults.repeat); - var repeatDelay = GetNewValue(config, 'repeatDelay', defaults.repeatDelay); + var ease = GetValue(config, 'ease', defaults.ease); + var hold = GetValue(config, 'hold', defaults.hold); + var repeat = GetValue(config, 'repeat', defaults.repeat); + var repeatDelay = GetValue(config, 'repeatDelay', defaults.repeatDelay); var yoyo = GetBoolean(config, 'yoyo', defaults.yoyo); var flipX = GetBoolean(config, 'flipX', defaults.flipX); var flipY = GetBoolean(config, 'flipY', defaults.flipY); + var interpolation = GetValue(config, 'interpolation', defaults.interpolation); - var data = []; + var addTarget = function (tween, targetIndex, key, value) + { + if (key === 'texture') + { + var texture = value; + var frame = undefined; + + if (Array.isArray(value)) + { + texture = value[0]; + frame = value[1]; + } + else if (value.hasOwnProperty('value')) + { + texture = value.value; + + if (Array.isArray(value.value)) + { + texture = value.value[0]; + frame = value.value[1]; + } + } + + tween.addFrame( + targetIndex, + texture, + frame, + GetNewValue(value, 'delay', delay), + GetValue(value, 'duration', duration), + GetValue(value, 'hold', hold), + GetValue(value, 'repeat', repeat), + GetValue(value, 'repeatDelay', repeatDelay), + GetBoolean(value, 'flipX', flipX), + GetBoolean(value, 'flipY', flipY) + ); + } + else + { + var ops = GetValueOp(key, value); + + var interpolationFunc = GetInterpolationFunction(GetValue(value, 'interpolation', interpolation)); + + tween.add( + targetIndex, + key, + ops.getEnd, + ops.getStart, + ops.getActive, + GetEaseFunction(GetValue(value, 'ease', ease), GetValue(value, 'easeParams', easeParams)), + GetNewValue(value, 'delay', delay), + GetValue(value, 'duration', duration), + GetBoolean(value, 'yoyo', yoyo), + GetValue(value, 'hold', hold), + GetValue(value, 'repeat', repeat), + GetValue(value, 'repeatDelay', repeatDelay), + GetBoolean(value, 'flipX', flipX), + GetBoolean(value, 'flipY', flipY), + interpolationFunc, + (interpolationFunc) ? value : null + ); + } + }; + + var tween = new Tween(parent, targets); // Loop through every property defined in the Tween, i.e.: props { x, y, alpha } for (var p = 0; p < props.length; p++) @@ -214660,44 +215538,31 @@ var TweenBuilder = function (parent, config, defaults) var value = props[p].value; // Create 1 TweenData per target, per property - for (var t = 0; t < targets.length; t++) + for (var targetIndex = 0; targetIndex < targets.length; targetIndex++) { - var ops = GetValueOp(key, value); - - var tweenData = TweenData( - targets[t], - t, - key, - ops.getEnd, - ops.getStart, - ops.getActive, - GetEaseFunction(GetValue(value, 'ease', ease), GetValue(value, 'easeParams', easeParams)), - GetNewValue(value, 'delay', delay), - GetNewValue(value, 'duration', duration), - GetBoolean(value, 'yoyo', yoyo), - GetNewValue(value, 'hold', hold), - GetNewValue(value, 'repeat', repeat), - GetNewValue(value, 'repeatDelay', repeatDelay), - GetBoolean(value, 'flipX', flipX), - GetBoolean(value, 'flipY', flipY) - ); - - data.push(tweenData); + // Special-case for scale short-cut: + if (key === 'scale' && !targets[targetIndex].hasOwnProperty('scale')) + { + addTarget(tween, targetIndex, 'scaleX', value); + addTarget(tween, targetIndex, 'scaleY', value); + } + else + { + addTarget(tween, targetIndex, key, value); + } } } - var tween = new Tween(parent, data, targets); - - tween.offset = GetAdvancedValue(config, 'offset', null); tween.completeDelay = GetAdvancedValue(config, 'completeDelay', 0); tween.loop = Math.round(GetAdvancedValue(config, 'loop', 0)); tween.loopDelay = Math.round(GetAdvancedValue(config, 'loopDelay', 0)); tween.paused = GetBoolean(config, 'paused', false); - tween.useFrames = GetBoolean(config, 'useFrames', false); + tween.persist = GetBoolean(config, 'persist', false); // Set the Callbacks - var scope = GetValue(config, 'callbackScope', tween); - var callbacks = Tween.TYPES; + tween.callbackScope = GetValue(config, 'callbackScope', tween); + + var callbacks = BaseTween.TYPES; for (var i = 0; i < callbacks.length; i++) { @@ -214707,10 +215572,9 @@ var TweenBuilder = function (parent, config, defaults) if (callback) { - var callbackScope = GetValue(config, type + 'Scope', scope); var callbackParams = GetValue(config, type + 'Params', []); - tween.setCallback(type, callback, callbackParams, callbackScope); + tween.setCallback(type, callback, callbackParams); } } @@ -214720,6 +215584,105 @@ var TweenBuilder = function (parent, config, defaults) module.exports = TweenBuilder; +/***/ }), + +/***/ 56034: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BaseTween = __webpack_require__(502); +var GetAdvancedValue = __webpack_require__(20494); +var GetBoolean = __webpack_require__(63130); +var GetTargets = __webpack_require__(65868); +var GetValue = __webpack_require__(10850); +var TweenBuilder = __webpack_require__(68061); +var TweenChain = __webpack_require__(45641); + +/** + * Creates a new Tween Chain instance. + * + * @function Phaser.Tweens.Builders.TweenChainBuilder + * @since 3.60.0 + * + * @param {Phaser.Tweens.TweenManager} parent - The owner of the new Tween. + * @param {Phaser.Types.Tweens.TweenChainBuilderConfig|object} config - Configuration for the new Tween. + * + * @return {Phaser.Tweens.TweenChain} The new Tween Chain. + */ +var TweenChainBuilder = function (parent, config) +{ + if (config instanceof TweenChain) + { + config.parent = parent; + + return config; + } + + // Default TweenChain values + + var chain = new TweenChain(parent); + + chain.startDelay = GetValue(config, 'delay', 0); + chain.completeDelay = GetAdvancedValue(config, 'completeDelay', 0); + chain.loop = Math.round(GetAdvancedValue(config, 'loop', GetValue(config, 'repeat', 0))); + chain.loopDelay = Math.round(GetAdvancedValue(config, 'loopDelay', GetValue(config, 'repeatDelay', 0))); + chain.paused = GetBoolean(config, 'paused', false); + chain.persist = GetBoolean(config, 'persist', true); + + // Set the Callbacks + chain.callbackScope = GetValue(config, 'callbackScope', chain); + + var i; + var callbacks = BaseTween.TYPES; + + for (i = 0; i < callbacks.length; i++) + { + var type = callbacks[i]; + + var callback = GetValue(config, type, false); + + if (callback) + { + var callbackParams = GetValue(config, type + 'Params', []); + + chain.setCallback(type, callback, callbackParams); + } + } + + // Add in the Tweens + var tweens = GetValue(config, 'tweens', null); + + if (Array.isArray(tweens)) + { + var chainedTweens = []; + + var targets = GetTargets(config); + var defaults = undefined; + + if (targets) + { + defaults = { targets: targets }; + } + + for (i = 0; i < tweens.length; i++) + { + chainedTweens.push(TweenBuilder(chain, tweens[i], defaults)); + } + + chain.add(chainedTweens); + } + + return chain; +}; + +module.exports = TweenChainBuilder; + + /***/ }), /***/ 79619: @@ -214727,7 +215690,7 @@ module.exports = TweenBuilder; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -214739,245 +215702,18 @@ module.exports = { GetBoolean: __webpack_require__(63130), GetEaseFunction: __webpack_require__(21902), + GetInterpolationFunction: __webpack_require__(4840), GetNewValue: __webpack_require__(28348), GetProps: __webpack_require__(92407), GetTargets: __webpack_require__(65868), - GetTweens: __webpack_require__(10365), GetValueOp: __webpack_require__(9744), NumberTweenBuilder: __webpack_require__(68710), StaggerBuilder: __webpack_require__(91944), - TimelineBuilder: __webpack_require__(32981), TweenBuilder: __webpack_require__(68061) }; -/***/ }), - -/***/ 51910: -/***/ ((module) => { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Timeline Complete Event. - * - * This event is dispatched by a Tween Timeline when it completes playback. - * - * Listen to it from a Timeline instance using `Timeline.on('complete', listener)`, i.e.: - * - * ```javascript - * var timeline = this.tweens.timeline({ - * targets: image, - * ease: 'Power1', - * duration: 3000, - * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] - * }); - * timeline.on('complete', listener); - * timeline.play(); - * ``` - * - * @event Phaser.Tweens.Events#TIMELINE_COMPLETE - * @since 3.0.0 - * - * @param {Phaser.Tweens.Timeline} timeline - A reference to the Timeline instance that emitted the event. - */ -module.exports = 'complete'; - - -/***/ }), - -/***/ 76826: -/***/ ((module) => { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Timeline Loop Event. - * - * This event is dispatched by a Tween Timeline every time it loops. - * - * Listen to it from a Timeline instance using `Timeline.on('loop', listener)`, i.e.: - * - * ```javascript - * var timeline = this.tweens.timeline({ - * targets: image, - * ease: 'Power1', - * duration: 3000, - * loop: 4, - * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] - * }); - * timeline.on('loop', listener); - * timeline.play(); - * ``` - * - * @event Phaser.Tweens.Events#TIMELINE_LOOP - * @since 3.0.0 - * - * @param {Phaser.Tweens.Timeline} timeline - A reference to the Timeline instance that emitted the event. - */ -module.exports = 'loop'; - - -/***/ }), - -/***/ 59953: -/***/ ((module) => { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Timeline Pause Event. - * - * This event is dispatched by a Tween Timeline when it is paused. - * - * Listen to it from a Timeline instance using `Timeline.on('pause', listener)`, i.e.: - * - * ```javascript - * var timeline = this.tweens.timeline({ - * targets: image, - * ease: 'Power1', - * duration: 3000, - * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] - * }); - * timeline.on('pause', listener); - * // At some point later ... - * timeline.pause(); - * ``` - * - * @event Phaser.Tweens.Events#TIMELINE_PAUSE - * @since 3.0.0 - * - * @param {Phaser.Tweens.Timeline} timeline - A reference to the Timeline instance that emitted the event. - */ -module.exports = 'pause'; - - -/***/ }), - -/***/ 92495: -/***/ ((module) => { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Timeline Resume Event. - * - * This event is dispatched by a Tween Timeline when it is resumed from a paused state. - * - * Listen to it from a Timeline instance using `Timeline.on('resume', listener)`, i.e.: - * - * ```javascript - * var timeline = this.tweens.timeline({ - * targets: image, - * ease: 'Power1', - * duration: 3000, - * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] - * }); - * timeline.on('resume', listener); - * // At some point later ... - * timeline.resume(); - * ``` - * - * @event Phaser.Tweens.Events#TIMELINE_RESUME - * @since 3.0.0 - * - * @param {Phaser.Tweens.Timeline} timeline - A reference to the Timeline instance that emitted the event. - */ -module.exports = 'resume'; - - -/***/ }), - -/***/ 55493: -/***/ ((module) => { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Timeline Start Event. - * - * This event is dispatched by a Tween Timeline when it starts. - * - * Listen to it from a Timeline instance using `Timeline.on('start', listener)`, i.e.: - * - * ```javascript - * var timeline = this.tweens.timeline({ - * targets: image, - * ease: 'Power1', - * duration: 3000, - * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] - * }); - * timeline.on('start', listener); - * timeline.play(); - * ``` - * - * @event Phaser.Tweens.Events#TIMELINE_START - * @since 3.0.0 - * - * @param {Phaser.Tweens.Timeline} timeline - A reference to the Timeline instance that emitted the event. - */ -module.exports = 'start'; - - -/***/ }), - -/***/ 48224: -/***/ ((module) => { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Timeline Update Event. - * - * This event is dispatched by a Tween Timeline every time it updates, which can happen a lot of times per second, - * so be careful about listening to this event unless you absolutely require it. - * - * Listen to it from a Timeline instance using `Timeline.on('update', listener)`, i.e.: - * - * ```javascript - * var timeline = this.tweens.timeline({ - * targets: image, - * ease: 'Power1', - * duration: 3000, - * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] - * }); - * timeline.on('update', listener); - * timeline.play(); - * ``` - * - * @event Phaser.Tweens.Events#TIMELINE_UPDATE - * @since 3.0.0 - * - * @param {Phaser.Tweens.Timeline} timeline - A reference to the Timeline instance that emitted the event. - */ -module.exports = 'update'; - - /***/ }), /***/ 5570: @@ -214985,36 +215721,40 @@ module.exports = 'update'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Tween Active Event. - * + * * This event is dispatched by a Tween when it becomes active within the Tween Manager. - * + * * An 'active' Tween is one that is now progressing, although it may not yet be updating * any target properties, due to settings such as `delay`. If you need an event for when * the Tween starts actually updating its first property, see `TWEEN_START`. - * + * * Listen to it from a Tween instance using `Tween.on('active', listener)`, i.e.: - * + * * ```javascript - * var tween = this.tweens.add({ + * var tween = this.tweens.create({ * targets: image, * x: 500, * ease: 'Power1', * duration: 3000 * }); * tween.on('active', listener); + * this.tweens.existing(tween); * ``` * + * Note that this event is usually dispatched already by the time you call `this.tweens.add()`, and is + * meant for use with `tweens.create()` and/or `tweens.existing()`. + * * @event Phaser.Tweens.Events#TWEEN_ACTIVE * @since 3.19.0 - * + * * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. - * @param {any[]} targets - An array of references to the target/s the Tween is operating on. + * @param {(any|any[])} targets - The targets of the Tween. If this Tween has multiple targets this will be an array of the targets. */ module.exports = 'active'; @@ -215026,22 +215766,22 @@ module.exports = 'active'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Tween Complete Event. - * + * * This event is dispatched by a Tween when it completes playback entirely, factoring in repeats and loops. - * + * * If the Tween has been set to loop or repeat infinitely, this event will not be dispatched * unless the `Tween.stop` method is called. - * + * * If a Tween has a `completeDelay` set, this event will fire after that delay expires. - * + * * Listen to it from a Tween instance using `Tween.on('complete', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.add({ * targets: image, @@ -215054,9 +215794,9 @@ module.exports = 'active'; * * @event Phaser.Tweens.Events#TWEEN_COMPLETE * @since 3.19.0 - * + * * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. - * @param {any[]} targets - An array of references to the target/s the Tween is operating on. + * @param {(any|any[])} targets - The targets of the Tween. If this Tween has multiple targets this will be an array of the targets. */ module.exports = 'complete'; @@ -215068,24 +215808,24 @@ module.exports = 'complete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Tween Loop Event. - * + * * This event is dispatched by a Tween when it loops. - * + * * This event will only be dispatched if the Tween has a loop count set. - * + * * If a Tween has a `loopDelay` set, this event will fire after that delay expires. - * + * * The difference between `loop` and `repeat` is that `repeat` is a property setting, * where-as `loop` applies to the entire Tween. - * + * * Listen to it from a Tween instance using `Tween.on('loop', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.add({ * targets: image, @@ -215099,13 +215839,51 @@ module.exports = 'complete'; * * @event Phaser.Tweens.Events#TWEEN_LOOP * @since 3.19.0 - * + * * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. - * @param {any[]} targets - An array of references to the target/s the Tween is operating on. + * @param {(any|any[])} targets - The targets of the Tween. If this Tween has multiple targets this will be an array of the targets. */ module.exports = 'loop'; +/***/ }), + +/***/ 90281: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Tween Pause Event. + * + * This event is dispatched by a Tween when it is paused. + * + * Listen to it from a Tween instance using `Tween.on('pause', listener)`, i.e.: + * + * ```javascript + * var tween = this.tweens.add({ + * targets: image, + * ease: 'Power1', + * duration: 3000, + * x: 600 + * }); + * tween.on('pause', listener); + * // At some point later ... + * tween.pause(); + * ``` + * + * @event Phaser.Tweens.Events#TWEEN_PAUSE + * @since 3.60.0 + * + * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. + */ +module.exports = 'pause'; + + /***/ }), /***/ 80803: @@ -215113,24 +215891,24 @@ module.exports = 'loop'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Tween Repeat Event. - * + * * This event is dispatched by a Tween when one of the properties it is tweening repeats. - * + * * This event will only be dispatched if the Tween has a property with a repeat count set. - * + * * If a Tween has a `repeatDelay` set, this event will fire after that delay expires. - * + * * The difference between `loop` and `repeat` is that `repeat` is a property setting, * where-as `loop` applies to the entire Tween. - * + * * Listen to it from a Tween instance using `Tween.on('repeat', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.add({ * targets: image, @@ -215144,14 +215922,54 @@ module.exports = 'loop'; * * @event Phaser.Tweens.Events#TWEEN_REPEAT * @since 3.19.0 - * + * * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. - * @param {string} key - The key of the property that just repeated. - * @param {any} target - The target that the property just repeated on. + * @param {string} key - The property on the target that has just repeated, i.e. `x` or `scaleY`, or whatever property you are tweening. + * @param {any} target - The target object that was repeated. Usually a Game Object, but can be of any type. + * @param {number} current - The current value of the property being set on the target. + * @param {number} previous - The previous value of the property being set on the target. */ module.exports = 'repeat'; +/***/ }), + +/***/ 13640: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Tween Resume Event. + * + * This event is dispatched by a Tween when it is resumed from a paused state. + * + * Listen to it from a Tween instance using `Tween.on('resume', listener)`, i.e.: + * + * ```javascript + * var tween = this.tweens.add({ + * targets: image, + * ease: 'Power1', + * duration: 3000, + * x: 600 + * }); + * tween.on('resume', listener); + * // At some point later ... + * tween.resume(); + * ``` + * + * @event Phaser.Tweens.Events#TWEEN_RESUME + * @since 3.60.0 + * + * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. + */ +module.exports = 'resume'; + + /***/ }), /***/ 10472: @@ -215159,21 +215977,21 @@ module.exports = 'repeat'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Tween Start Event. - * + * * This event is dispatched by a Tween when it starts tweening its first property. - * + * * A Tween will only emit this event once, as it can only start once. - * + * * If a Tween has a `delay` set, this event will fire after that delay expires. - * + * * Listen to it from a Tween instance using `Tween.on('start', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.add({ * targets: image, @@ -215186,9 +216004,9 @@ module.exports = 'repeat'; * * @event Phaser.Tweens.Events#TWEEN_START * @since 3.19.0 - * + * * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. - * @param {any[]} targets - An array of references to the target/s the Tween is operating on. + * @param {(any|any[])} targets - The targets of the Tween. If this Tween has multiple targets this will be an array of the targets. */ module.exports = 'start'; @@ -215200,7 +216018,7 @@ module.exports = 'start'; /** * @author samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -215225,7 +216043,7 @@ module.exports = 'start'; * @since 3.24.0 * * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. - * @param {any[]} targets - An array of references to the target/s the Tween is operating on. + * @param {(any|any[])} targets - The targets of the Tween. If this Tween has multiple targets this will be an array of the targets. */ module.exports = 'stop'; @@ -215237,21 +216055,21 @@ module.exports = 'stop'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Tween Update Event. - * + * * This event is dispatched by a Tween every time it updates _any_ of the properties it is tweening. - * + * * A Tween that is changing 3 properties of a target will emit this event 3 times per change, once per property. - * + * * **Note:** This is a very high frequency event and may be dispatched multiple times, every single frame. - * + * * Listen to it from a Tween instance using `Tween.on('update', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.add({ * targets: image, @@ -215264,9 +216082,9 @@ module.exports = 'stop'; * * @event Phaser.Tweens.Events#TWEEN_UPDATE * @since 3.19.0 - * + * * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. - * @param {string} key - The property that was updated, i.e. `x` or `scale`. + * @param {string} key - The property on the target that has just updated, i.e. `x` or `scaleY`, or whatever property you are tweening. * @param {any} target - The target object that was updated. Usually a Game Object, but can be of any type. * @param {number} current - The current value of the property that was tweened. * @param {number} previous - The previous value of the property that was tweened, prior to this update. @@ -215281,25 +216099,25 @@ module.exports = 'update'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Tween Yoyo Event. - * + * * This event is dispatched by a Tween whenever a property it is tweening yoyos. - * + * * This event will only be dispatched if the Tween has a property with `yoyo` set. - * + * * If the Tween has a `hold` value, this event is dispatched when the hold expires. - * + * * This event is dispatched for every property, and for every target, that yoyos. * For example, if a Tween was updating 2 properties and had 10 targets, this event * would be dispatched 20 times (twice per target). So be careful how you use it! - * + * * Listen to it from a Tween instance using `Tween.on('yoyo', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.add({ * targets: image, @@ -215313,10 +216131,12 @@ module.exports = 'update'; * * @event Phaser.Tweens.Events#TWEEN_YOYO * @since 3.19.0 - * + * * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. - * @param {string} key - The property that yoyo'd, i.e. `x` or `scale`. + * @param {string} key - The property on the target that has just yoyo'd, i.e. `x` or `scaleY`, or whatever property you are tweening. * @param {any} target - The target object that was yoyo'd. Usually a Game Object, but can be of any type. + * @param {number} current - The current value of the property being set on the target. + * @param {number} previous - The previous value of the property being set on the target. */ module.exports = 'yoyo'; @@ -215328,7 +216148,7 @@ module.exports = 'yoyo'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -215338,15 +216158,11 @@ module.exports = 'yoyo'; module.exports = { - TIMELINE_COMPLETE: __webpack_require__(51910), - TIMELINE_LOOP: __webpack_require__(76826), - TIMELINE_PAUSE: __webpack_require__(59953), - TIMELINE_RESUME: __webpack_require__(92495), - TIMELINE_START: __webpack_require__(55493), - TIMELINE_UPDATE: __webpack_require__(48224), TWEEN_ACTIVE: __webpack_require__(5570), TWEEN_COMPLETE: __webpack_require__(6383), TWEEN_LOOP: __webpack_require__(72582), + TWEEN_PAUSE: __webpack_require__(90281), + TWEEN_RESUME: __webpack_require__(13640), TWEEN_REPEAT: __webpack_require__(80803), TWEEN_START: __webpack_require__(10472), TWEEN_STOP: __webpack_require__(5379), @@ -215363,35 +216179,1389 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(55303); -var Extend = __webpack_require__(98611); - /** * @namespace Phaser.Tweens */ var Tweens = { + States: __webpack_require__(55303), + Builders: __webpack_require__(79619), Events: __webpack_require__(54272), TweenManager: __webpack_require__(64532), Tween: __webpack_require__(39366), - TweenData: __webpack_require__(15718), - Timeline: __webpack_require__(28860) + TweenData: __webpack_require__(15718) }; -// Merge in the consts -Tweens = Extend(false, Tweens, CONST); - module.exports = Tweens; +/***/ }), + +/***/ 502: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(56694); +var EventEmitter = __webpack_require__(6659); +var Events = __webpack_require__(54272); +var TWEEN_CONST = __webpack_require__(55303); + +/** + * @classdesc + * As the name implies, this is the base Tween class that both the Tween and TweenChain + * inherit from. It contains shared properties and methods common to both types of Tween. + * + * Typically you would never instantiate this class directly, although you could certainly + * use it to create your own variation of Tweens from. + * + * @class BaseTween + * @memberof Phaser.Tweens + * @extends Phaser.Events.EventEmitter + * @constructor + * @since 3.60.0 + * + * @param {(Phaser.Tweens.TweenManager|Phaser.Tweens.TweenChain)} parent - A reference to the Tween Manager, or Tween Chain, that owns this Tween. + */ +var BaseTween = new Class({ + + Extends: EventEmitter, + + initialize: + + function BaseTween (parent) + { + EventEmitter.call(this); + + /** + * A reference to the Tween Manager, or Tween Chain, that owns this Tween. + * + * @name Phaser.Tweens.BaseTween#parent + * @type {(Phaser.Tweens.TweenManager|Phaser.Tweens.TweenChain)} + * @since 3.60.0 + */ + this.parent = parent; + + /** + * The main data array. For a Tween, this contains all of the `TweenData` objects, each + * containing a unique property and target that is being tweened. + * + * For a TweenChain, this contains an array of `Tween` instances, which are being played + * through in sequence. + * + * @name Phaser.Tweens.BaseTween#data + * @type {(Phaser.Tweens.TweenData[]|Phaser.Tweens.Tween[])} + * @since 3.60.0 + */ + this.data = []; + + /** + * The cached size of the data array. + * + * @name Phaser.Tweens.BaseTween#totalData + * @type {number} + * @since 3.60.0 + */ + this.totalData = 0; + + /** + * The time in milliseconds before the 'onStart' event fires. + * + * For a Tween, this is the shortest `delay` value across all of the TweenDatas it owns. + * For a TweenChain, it is whatever delay value was given in the configuration. + * + * @name Phaser.Tweens.BaseTween#startDelay + * @type {number} + * @default 0 + * @since 3.60.0 + */ + this.startDelay = 0; + + /** + * Has this Tween started playback yet? + * + * This boolean is toggled when the Tween leaves the 'start delayed' state and begins running. + * + * @name Phaser.Tweens.BaseTween#hasStarted + * @type {boolean} + * @readonly + * @since 3.60.0 + */ + this.hasStarted = false; + + /** + * Scales the time applied to this Tween. A value of 1 runs in real-time. A value of 0.5 runs 50% slower, and so on. + * + * The value isn't used when calculating total duration of the tween, it's a run-time delta adjustment only. + * + * This value is multiplied by the `TweenManager.timeScale`. + * + * @name Phaser.Tweens.BaseTween#timeScale + * @type {number} + * @default 1 + * @since 3.60.0 + */ + this.timeScale = 1; + + /** + * The number of times this Tween will loop. + * + * Can be -1 for an infinite loop, zero for none, or a positive integer. + * + * Typically this is set in the configuration object, but can also be set directly + * as long as this Tween is paused and hasn't started playback. + * + * When enabled it will play through ALL Tweens again. + * + * Use TweenData.repeat to loop a single element. + * + * @name Phaser.Tweens.BaseTween#loop + * @type {number} + * @default 0 + * @since 3.60.0 + */ + this.loop = 0; + + /** + * The time in milliseconds before the Tween loops. + * + * Only used if `loop` is > 0. + * + * @name Phaser.Tweens.BaseTween#loopDelay + * @type {number} + * @default 0 + * @since 3.60.0 + */ + this.loopDelay = 0; + + /** + * Internal counter recording how many loops are left to run. + * + * @name Phaser.Tweens.BaseTween#loopCounter + * @type {number} + * @default 0 + * @since 3.60.0 + */ + this.loopCounter = 0; + + /** + * The time in milliseconds before the 'onComplete' event fires. + * + * This never fires if `loop = -1` as it never completes because it has been + * set to loop forever. + * + * @name Phaser.Tweens.BaseTween#completeDelay + * @type {number} + * @default 0 + * @since 3.60.0 + */ + this.completeDelay = 0; + + /** + * An internal countdown timer (used by loopDelay and completeDelay) + * + * @name Phaser.Tweens.BaseTween#countdown + * @type {number} + * @default 0 + * @since 3.60.0 + */ + this.countdown = 0; + + /** + * The current state of the Tween. + * + * @name Phaser.Tweens.BaseTween#state + * @type {Phaser.Tweens.StateType} + * @since 3.60.0 + */ + this.state = TWEEN_CONST.PENDING; + + /** + * Is the Tween currently paused? + * + * A paused Tween needs to be started with the `play` method, or resumed with the `resume` method. + * + * This property can be toggled at runtime if required. + * + * @name Phaser.Tweens.BaseTween#paused + * @type {boolean} + * @default false + * @since 3.60.0 + */ + this.paused = false; + + /** + * An object containing the different Tween callback functions. + * + * You can either set these in the Tween config, or by calling the `Tween.setCallback` method. + * + * The types available are: + * + * `onActive` - When the Tween is first created it moves to an 'active' state when added to the Tween Manager. 'Active' does not mean 'playing'. + * `onStart` - When the Tween starts playing after a delayed or paused state. This will happen at the same time as `onActive` if the tween has no delay and isn't paused. + * `onLoop` - When a Tween loops, if it has been set to do so. This happens _after_ the `loopDelay` expires, if set. + * `onComplete` - When the Tween finishes playback fully. Never invoked if the Tween is set to repeat infinitely. + * `onStop` - Invoked only if the `Tween.stop` method is called. + * `onPause` - Invoked only if the `Tween.pause` method is called. Not invoked if the Tween Manager is paused. + * `onResume` - Invoked only if the `Tween.resume` method is called. Not invoked if the Tween Manager is resumed. + * + * The following types are also available and are invoked on a `TweenData` level - that is per-object, per-property, being tweened. + * + * `onYoyo` - When a TweenData starts a yoyo. This happens _after_ the `hold` delay expires, if set. + * `onRepeat` - When a TweenData repeats playback. This happens _after_ the `repeatDelay` expires, if set. + * `onUpdate` - When a TweenData updates a property on a source target during playback. + * + * @name Phaser.Tweens.BaseTween#callbacks + * @type {Phaser.Types.Tweens.TweenCallbacks} + * @since 3.60.0 + */ + this.callbacks = { + onActive: null, + onComplete: null, + onLoop: null, + onPause: null, + onRepeat: null, + onResume: null, + onStart: null, + onStop: null, + onUpdate: null, + onYoyo: null + }; + + /** + * The scope (or context) in which all of the callbacks are invoked. + * + * This defaults to be this Tween, but you can override this property + * to set it to whatever object you require. + * + * @name Phaser.Tweens.BaseTween#callbackScope + * @type {any} + * @since 3.60.0 + */ + this.callbackScope; + + /** + * Will this Tween persist after playback? A Tween that persists will _not_ be destroyed by the + * Tween Manager, or when calling `Tween.stop`, and can be re-played as required. You can either + * set this property when creating the tween in the tween config, or set it _prior_ to playback. + * + * However, it's up to you to ensure you destroy persistent tweens when you are finished with them, + * or they will retain references you may no longer require and waste memory. + * + * By default, `Tweens` are set to _not_ persist, so they are automatically cleaned-up by + * the Tween Manager. But `TweenChains` _do_ persist by default, unless overridden in their + * config. This is because the type of situations you use a chain for is far more likely to + * need to be replayed again in the future, rather than disposed of. + * + * @name Phaser.Tweens.BaseTween#persist + * @type {boolean} + * @since 3.60.0 + */ + this.persist = false; + }, + + /** + * Prepares this Tween for playback. + * + * Called automatically by the TweenManager. Should not be called directly. + * + * @method Phaser.Tweens.BaseTween#init + * @fires Phaser.Tweens.Events#TWEEN_ACTIVE + * @since 3.60.0 + * + * @return {this} This Tween instance. + */ + init: function () + { + this.initTweenData(); + + this.setActiveState(); + + this.dispatchEvent(Events.TWEEN_ACTIVE, 'onActive'); + + return this; + }, + + /** + * Sets the value of the time scale applied to this Tween. A value of 1 runs in real-time. + * A value of 0.5 runs 50% slower, and so on. + * + * The value isn't used when calculating total duration of the tween, it's a run-time delta adjustment only. + * + * This value is multiplied by the `TweenManager.timeScale`. + * + * @method Phaser.Tweens.BaseTween#setTimeScale + * @since 3.60.0 + * + * @param {number} value - The time scale value to set. + * + * @return {this} This Tween instance. + */ + setTimeScale: function (value) + { + this.timeScale = value; + + return this; + }, + + /** + * Gets the value of the time scale applied to this Tween. A value of 1 runs in real-time. + * A value of 0.5 runs 50% slower, and so on. + * + * @method Phaser.Tweens.BaseTween#getTimeScale + * @since 3.60.0 + * + * @return {number} The value of the time scale applied to this Tween. + */ + getTimeScale: function () + { + return this.timeScale; + }, + + /** + * Checks if this Tween is currently playing. + * + * If this Tween is paused, or not active, this method will return false. + * + * @method Phaser.Tweens.BaseTween#isPlaying + * @since 3.60.0 + * + * @return {boolean} `true` if the Tween is playing, otherwise `false`. + */ + isPlaying: function () + { + return (!this.paused && this.isActive()); + }, + + /** + * Checks if the Tween is currently paused. + * + * This is the same as inspecting the `BaseTween.paused` property directly. + * + * @method Phaser.Tweens.BaseTween#isPaused + * @since 3.60.0 + * + * @return {boolean} `true` if the Tween is paused, otherwise `false`. + */ + isPaused: function () + { + return this.paused; + }, + + /** + * Pauses the Tween immediately. Use `resume` to continue playback. + * + * You can also toggle the `Tween.paused` boolean property, but doing so will not trigger the PAUSE event. + * + * @method Phaser.Tweens.BaseTween#pause + * @fires Phaser.Tweens.Events#TWEEN_PAUSE + * @since 3.60.0 + * + * @return {this} This Tween instance. + */ + pause: function () + { + if (!this.paused) + { + this.paused = true; + + this.dispatchEvent(Events.TWEEN_PAUSE, 'onPause'); + } + + return this; + }, + + /** + * Resumes the playback of a previously paused Tween. + * + * You can also toggle the `Tween.paused` boolean property, but doing so will not trigger the RESUME event. + * + * @method Phaser.Tweens.BaseTween#resume + * @fires Phaser.Tweens.Events#TWEEN_RESUME + * @since 3.60.0 + * + * @return {this} This Tween instance. + */ + resume: function () + { + if (this.paused) + { + this.paused = false; + + this.dispatchEvent(Events.TWEEN_RESUME, 'onResume'); + } + + return this; + }, + + /** + * Internal method that makes this Tween active within the TweenManager + * and emits the onActive event and callback. + * + * @method Phaser.Tweens.BaseTween#makeActive + * @fires Phaser.Tweens.Events#TWEEN_ACTIVE + * @since 3.60.0 + */ + makeActive: function () + { + this.parent.makeActive(this); + + this.dispatchEvent(Events.TWEEN_ACTIVE, 'onActive'); + }, + + /** + * Internal method that handles this tween completing and emitting the onComplete event + * and callback. + * + * @method Phaser.Tweens.BaseTween#onCompleteHandler + * @since 3.60.0 + */ + onCompleteHandler: function () + { + this.setPendingRemoveState(); + + this.dispatchEvent(Events.TWEEN_COMPLETE, 'onComplete'); + }, + + /** + * Flags the Tween as being complete, whatever stage of progress it is at. + * + * If an `onComplete` callback has been defined it will automatically invoke it, unless a `delay` + * argument is provided, in which case the Tween will delay for that period of time before calling the callback. + * + * If you don't need a delay or don't have an `onComplete` callback then call `Tween.stop` instead. + * + * @method Phaser.Tweens.BaseTween#complete + * @fires Phaser.Tweens.Events#TWEEN_COMPLETE + * @since 3.2.0 + * + * @param {number} [delay=0] - The time to wait before invoking the complete callback. If zero it will fire immediately. + * + * @return {this} This Tween instance. + */ + complete: function (delay) + { + if (delay === undefined) { delay = 0; } + + if (delay) + { + this.setCompleteDelayState(); + + this.countdown = delay; + } + else + { + this.onCompleteHandler(); + } + + return this; + }, + + /** + * Flags the Tween as being complete only once the current loop has finished. + * + * This is a useful way to stop an infinitely looping tween once a complete cycle is over, + * rather than abruptly. + * + * If you don't have a loop then call `Tween.stop` instead. + * + * @method Phaser.Tweens.BaseTween#completeAfterLoop + * @fires Phaser.Tweens.Events#TWEEN_COMPLETE + * @since 3.60.0 + * + * @param {number} [loops=0] - The number of loops that should finish before this tween completes. Zero means complete just the current loop. + * + * @return {this} This Tween instance. + */ + completeAfterLoop: function (loops) + { + if (loops === undefined) { loops = 0; } + + if (this.loopCounter > loops) + { + this.loopCounter = loops; + } + + return this; + }, + + /** + * Immediately removes this Tween from the TweenManager and all of its internal arrays, + * no matter what stage it is at. Then sets the tween state to `REMOVED`. + * + * You should dispose of your reference to this tween after calling this method, to + * free it from memory. If you no longer require it, call `Tween.destroy()` on it. + * + * @method Phaser.Tweens.BaseTween#remove + * @since 3.60.0 + * + * @return {this} This Tween instance. + */ + remove: function () + { + this.parent.remove(this); + + return this; + }, + + /** + * Stops the Tween immediately, whatever stage of progress it is at. + * + * If not a part of a Tween Chain it is also flagged for removal by the Tween Manager. + * + * If an `onStop` callback has been defined it will automatically invoke it. + * + * The Tween will be removed during the next game frame, but should be considered 'destroyed' from this point on. + * + * Typically, you cannot play a Tween that has been stopped. If you just wish to pause the tween, not destroy it, + * then call the `pause` method instead and use `resume` to continue playback. If you wish to restart the Tween, + * use the `restart` or `seek` methods. + * + * @method Phaser.Tweens.BaseTween#stop + * @fires Phaser.Tweens.Events#TWEEN_STOP + * @since 3.60.0 + * + * @return {this} This Tween instance. + */ + stop: function () + { + if (!this.isRemoved() && !this.isPendingRemove()) + { + this.dispatchEvent(Events.TWEEN_STOP, 'onStop'); + + this.setPendingRemoveState(); + } + + return this; + }, + + /** + * Internal method that handles the processing of the loop delay countdown timer and + * the dispatch of related events. Called automatically by `Tween.update`. + * + * @method Phaser.Tweens.BaseTween#updateLoopCountdown + * @since 3.60.0 + * + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + updateLoopCountdown: function (delta) + { + this.countdown -= delta; + + if (this.countdown <= 0) + { + this.setActiveState(); + + this.dispatchEvent(Events.TWEEN_LOOP, 'onLoop'); + } + }, + + /** + * Internal method that handles the processing of the start delay countdown timer and + * the dispatch of related events. Called automatically by `Tween.update`. + * + * @method Phaser.Tweens.BaseTween#updateStartCountdown + * @since 3.60.0 + * + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + updateStartCountdown: function (delta) + { + this.countdown -= delta; + + if (this.countdown <= 0) + { + this.hasStarted = true; + + this.setActiveState(); + + this.dispatchEvent(Events.TWEEN_START, 'onStart'); + + // Reset the delta so we always start progress from zero + delta = 0; + } + + return delta; + }, + + /** + * Internal method that handles the processing of the complete delay countdown timer and + * the dispatch of related events. Called automatically by `Tween.update`. + * + * @method Phaser.Tweens.BaseTween#updateCompleteDelay + * @since 3.60.0 + * + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + updateCompleteDelay: function (delta) + { + this.countdown -= delta; + + if (this.countdown <= 0) + { + this.onCompleteHandler(); + } + }, + + /** + * Sets an event based callback to be invoked during playback. + * + * Calling this method will replace a previously set callback for the given type, if any exists. + * + * The types available are: + * + * `onActive` - When the Tween is first created it moves to an 'active' state when added to the Tween Manager. 'Active' does not mean 'playing'. + * `onStart` - When the Tween starts playing after a delayed or paused state. This will happen at the same time as `onActive` if the tween has no delay and isn't paused. + * `onLoop` - When a Tween loops, if it has been set to do so. This happens _after_ the `loopDelay` expires, if set. + * `onComplete` - When the Tween finishes playback fully. Never invoked if the Tween is set to repeat infinitely. + * `onStop` - Invoked only if the `Tween.stop` method is called. + * `onPause` - Invoked only if the `Tween.pause` method is called. Not invoked if the Tween Manager is paused. + * `onResume` - Invoked only if the `Tween.resume` method is called. Not invoked if the Tween Manager is resumed. + * + * The following types are also available and are invoked on a `TweenData` level - that is per-object, per-property, being tweened. + * + * `onYoyo` - When a TweenData starts a yoyo. This happens _after_ the `hold` delay expires, if set. + * `onRepeat` - When a TweenData repeats playback. This happens _after_ the `repeatDelay` expires, if set. + * `onUpdate` - When a TweenData updates a property on a source target during playback. + * + * @method Phaser.Tweens.BaseTween#setCallback + * @since 3.60.0 + * + * @param {Phaser.Types.Tweens.TweenCallbackTypes} type - The type of callback to set. One of: `onActive`, `onComplete`, `onLoop`, `onPause`, `onRepeat`, `onResume`, `onStart`, `onStop`, `onUpdate` or `onYoyo`. + * @param {function} callback - Your callback that will be invoked. + * @param {array} [params] - The parameters to pass to the callback. Pass an empty array if you don't want to define any, but do wish to set the scope. + * + * @return {this} This Tween instance. + */ + setCallback: function (type, callback, params) + { + if (params === undefined) { params = []; } + + if (this.callbacks.hasOwnProperty(type)) + { + this.callbacks[type] = { func: callback, params: params }; + } + + return this; + }, + + /** + * Sets this Tween state to PENDING. + * + * @method Phaser.Tweens.BaseTween#setPendingState + * @since 3.60.0 + */ + setPendingState: function () + { + this.state = TWEEN_CONST.PENDING; + }, + + /** + * Sets this Tween state to ACTIVE. + * + * @method Phaser.Tweens.BaseTween#setActiveState + * @since 3.60.0 + */ + setActiveState: function () + { + this.state = TWEEN_CONST.ACTIVE; + }, + + /** + * Sets this Tween state to LOOP_DELAY. + * + * @method Phaser.Tweens.BaseTween#setLoopDelayState + * @since 3.60.0 + */ + setLoopDelayState: function () + { + this.state = TWEEN_CONST.LOOP_DELAY; + }, + + /** + * Sets this Tween state to COMPLETE_DELAY. + * + * @method Phaser.Tweens.BaseTween#setCompleteDelayState + * @since 3.60.0 + */ + setCompleteDelayState: function () + { + this.state = TWEEN_CONST.COMPLETE_DELAY; + }, + + /** + * Sets this Tween state to START_DELAY. + * + * @method Phaser.Tweens.BaseTween#setStartDelayState + * @since 3.60.0 + */ + setStartDelayState: function () + { + this.state = TWEEN_CONST.START_DELAY; + + this.countdown = this.startDelay; + + this.hasStarted = false; + }, + + /** + * Sets this Tween state to PENDING_REMOVE. + * + * @method Phaser.Tweens.BaseTween#setPendingRemoveState + * @since 3.60.0 + */ + setPendingRemoveState: function () + { + this.state = TWEEN_CONST.PENDING_REMOVE; + }, + + /** + * Sets this Tween state to REMOVED. + * + * @method Phaser.Tweens.BaseTween#setRemovedState + * @since 3.60.0 + */ + setRemovedState: function () + { + this.state = TWEEN_CONST.REMOVED; + }, + + /** + * Sets this Tween state to FINISHED. + * + * @method Phaser.Tweens.BaseTween#setFinishedState + * @since 3.60.0 + */ + setFinishedState: function () + { + this.state = TWEEN_CONST.FINISHED; + }, + + /** + * Sets this Tween state to DESTROYED. + * + * @method Phaser.Tweens.BaseTween#setDestroyedState + * @since 3.60.0 + */ + setDestroyedState: function () + { + this.state = TWEEN_CONST.DESTROYED; + }, + + /** + * Returns `true` if this Tween has a _current_ state of PENDING, otherwise `false`. + * + * @method Phaser.Tweens.BaseTween#isPending + * @since 3.60.0 + * + * @return {boolean} `true` if this Tween has a _current_ state of PENDING, otherwise `false`. + */ + isPending: function () + { + return (this.state === TWEEN_CONST.PENDING); + }, + + /** + * Returns `true` if this Tween has a _current_ state of ACTIVE, otherwise `false`. + * + * @method Phaser.Tweens.BaseTween#isActive + * @since 3.60.0 + * + * @return {boolean} `true` if this Tween has a _current_ state of ACTIVE, otherwise `false`. + */ + isActive: function () + { + return (this.state === TWEEN_CONST.ACTIVE); + }, + + /** + * Returns `true` if this Tween has a _current_ state of LOOP_DELAY, otherwise `false`. + * + * @method Phaser.Tweens.BaseTween#isLoopDelayed + * @since 3.60.0 + * + * @return {boolean} `true` if this Tween has a _current_ state of LOOP_DELAY, otherwise `false`. + */ + isLoopDelayed: function () + { + return (this.state === TWEEN_CONST.LOOP_DELAY); + }, + + /** + * Returns `true` if this Tween has a _current_ state of COMPLETE_DELAY, otherwise `false`. + * + * @method Phaser.Tweens.BaseTween#isCompleteDelayed + * @since 3.60.0 + * + * @return {boolean} `true` if this Tween has a _current_ state of COMPLETE_DELAY, otherwise `false`. + */ + isCompleteDelayed: function () + { + return (this.state === TWEEN_CONST.COMPLETE_DELAY); + }, + + /** + * Returns `true` if this Tween has a _current_ state of START_DELAY, otherwise `false`. + * + * @method Phaser.Tweens.BaseTween#isStartDelayed + * @since 3.60.0 + * + * @return {boolean} `true` if this Tween has a _current_ state of START_DELAY, otherwise `false`. + */ + isStartDelayed: function () + { + return (this.state === TWEEN_CONST.START_DELAY); + }, + + /** + * Returns `true` if this Tween has a _current_ state of PENDING_REMOVE, otherwise `false`. + * + * @method Phaser.Tweens.BaseTween#isPendingRemove + * @since 3.60.0 + * + * @return {boolean} `true` if this Tween has a _current_ state of PENDING_REMOVE, otherwise `false`. + */ + isPendingRemove: function () + { + return (this.state === TWEEN_CONST.PENDING_REMOVE); + }, + + /** + * Returns `true` if this Tween has a _current_ state of REMOVED, otherwise `false`. + * + * @method Phaser.Tweens.BaseTween#isRemoved + * @since 3.60.0 + * + * @return {boolean} `true` if this Tween has a _current_ state of REMOVED, otherwise `false`. + */ + isRemoved: function () + { + return (this.state === TWEEN_CONST.REMOVED); + }, + + /** + * Returns `true` if this Tween has a _current_ state of FINISHED, otherwise `false`. + * + * @method Phaser.Tweens.BaseTween#isFinished + * @since 3.60.0 + * + * @return {boolean} `true` if this Tween has a _current_ state of FINISHED, otherwise `false`. + */ + isFinished: function () + { + return (this.state === TWEEN_CONST.FINISHED); + }, + + /** + * Returns `true` if this Tween has a _current_ state of DESTROYED, otherwise `false`. + * + * @method Phaser.Tweens.BaseTween#isDestroyed + * @since 3.60.0 + * + * @return {boolean} `true` if this Tween has a _current_ state of DESTROYED, otherwise `false`. + */ + isDestroyed: function () + { + return (this.state === TWEEN_CONST.DESTROYED); + }, + + /** + * Handles the destroy process of this Tween, clearing out the + * Tween Data and resetting the targets. A Tween that has been + * destroyed cannot ever be played or used again. + * + * @method Phaser.Tweens.BaseTween#destroy + * @since 3.60.0 + */ + destroy: function () + { + if (this.data) + { + this.data.forEach(function (tweenData) + { + tweenData.destroy(); + }); + } + + this.removeAllListeners(); + + this.callbacks = null; + this.data = null; + this.parent = null; + + this.setDestroyedState(); + } + +}); + +BaseTween.TYPES = [ + 'onActive', + 'onComplete', + 'onLoop', + 'onPause', + 'onRepeat', + 'onResume', + 'onStart', + 'onStop', + 'onUpdate', + 'onYoyo' +]; + +module.exports = BaseTween; + + +/***/ }), + +/***/ 65521: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(56694); +var TWEEN_CONST = __webpack_require__(55303); + +/** + * @classdesc + * BaseTweenData is the class that the TweenData and TweenFrameData classes + * extend from. You should not typically instantiate this class directly, but instead + * use it to form your own tween data classes from, should you require it. + * + * Prior to Phaser 3.60 the TweenData was just an object, but was refactored to a class, + * to make it responsible for its own state and updating. + * + * @class BaseTweenData + * @memberof Phaser.Tweens + * @constructor + * @since 3.60.0 + * + * @param {Phaser.Tweens.Tween} tween - The tween this TweenData instance belongs to. + * @param {number} targetIndex - The target index within the Tween targets array. + * @param {string} key - The property of the target to tween. + * @param {Phaser.Types.Tweens.GetEndCallback} getEnd - What the property will be at the END of the Tween. + * @param {Phaser.Types.Tweens.GetStartCallback} getStart - What the property will be at the START of the Tween. + * @param {?Phaser.Types.Tweens.GetActiveCallback} getActive - If not null, is invoked _immediately_ as soon as the TweenData is running, and is set on the target property. + * @param {function} ease - The ease function this tween uses. + * @param {function} delay - Function that returns the time in ms/frames before tween will start. + * @param {number} duration - The duration of the tween in ms/frames. + * @param {boolean} yoyo - Determines whether the tween should return back to its start value after hold has expired. + * @param {number} hold - Function that returns the time in ms/frames the tween will pause before repeating or returning to its starting value if yoyo is set to true. + * @param {number} repeat - Function that returns the number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. + * @param {number} repeatDelay - Function that returns the time in ms/frames before the repeat will start. + * @param {boolean} flipX - Should toggleFlipX be called when yoyo or repeat happens? + * @param {boolean} flipY - Should toggleFlipY be called when yoyo or repeat happens? + * @param {?function} interpolation - The interpolation function to be used for arrays of data. Defaults to 'null'. + * @param {?number[]} interpolationData - The array of interpolation data to be set. Defaults to 'null'. + */ +var BaseTweenData = new Class({ + + initialize: + + function BaseTweenData (tween, targetIndex, delay, duration, yoyo, hold, repeat, repeatDelay, flipX, flipY) + { + /** + * A reference to the Tween that this TweenData instance belongs to. + * + * @name Phaser.Tweens.BaseTweenData#tween + * @type {Phaser.Tweens.Tween} + * @since 3.60.0 + */ + this.tween = tween; + + /** + * The index of the target within the Tween `targets` array. + * + * @name Phaser.Tweens.BaseTweenData#targetIndex + * @type {number} + * @since 3.60.0 + */ + this.targetIndex = targetIndex; + + /** + * The duration of the tween in milliseconds, excluding any time required + * for yoyo or repeats. + * + * @name Phaser.Tweens.BaseTweenData#duration + * @type {number} + * @since 3.60.0 + */ + this.duration = duration; + + /** + * The total calculated duration, in milliseconds, of this TweenData. + * Factoring in the duration, repeats, delays and yoyos. + * + * @name Phaser.Tweens.BaseTweenData#totalDuration + * @type {number} + * @since 3.60.0 + */ + this.totalDuration = 0; + + /** + * The time, in milliseconds, before this tween will start playing. + * + * This value is generated by the `getDelay` function. + * + * @name Phaser.Tweens.BaseTweenData#delay + * @type {number} + * @since 3.60.0 + */ + this.delay = 0; + + /** + * This function returns the value to be used for `TweenData.delay`. + * + * @name Phaser.Tweens.BaseTweenData#getDelay + * @type {function} + * @since 3.60.0 + */ + this.getDelay = delay; + + /** + * Will the Tween ease back to its starting values, after reaching the end + * and any `hold` value that may be set? + * + * @name Phaser.Tweens.BaseTweenData#yoyo + * @type {boolean} + * @since 3.60.0 + */ + this.yoyo = yoyo; + + /** + * The time, in milliseconds, before this tween will start a yoyo to repeat. + * + * @name Phaser.Tweens.BaseTweenData#hold + * @type {number} + * @since 3.60.0 + */ + this.hold = hold; + + /** + * The number of times this tween will repeat. + * + * The tween will always run once regardless of this value, + * so a repeat value of '1' will play the tween twice: I.e. the original + * play-through and then it repeats that once (1). + * + * If this value is set to -1 this tween will repeat forever. + * + * @name Phaser.Tweens.BaseTweenData#repeat + * @type {number} + * @since 3.60.0 + */ + this.repeat = repeat; + + /** + * The time, in milliseconds, before the repeat will start. + * + * @name Phaser.Tweens.BaseTweenData#repeatDelay + * @type {number} + * @since 3.60.0 + */ + this.repeatDelay = repeatDelay; + + /** + * How many repeats are left to run? + * + * @name Phaser.Tweens.BaseTweenData#repeatCounter + * @type {number} + * @since 3.60.0 + */ + this.repeatCounter = 0; + + /** + * If `true` this Tween will call `toggleFlipX` on the Tween target + * whenever it yoyo's or repeats. It will only be called if the target + * has a function matching this name, like most Phaser GameObjects do. + * + * @name Phaser.Tweens.BaseTweenData#flipX + * @type {boolean} + * @since 3.60.0 + */ + this.flipX = flipX; + + /** + * If `true` this Tween will call `toggleFlipY` on the Tween target + * whenever it yoyo's or repeats. It will only be called if the target + * has a function matching this name, like most Phaser GameObjects do. + * + * @name Phaser.Tweens.BaseTweenData#flipY + * @type {boolean} + * @since 3.60.0 + */ + this.flipY = flipY; + + /** + * A value between 0 and 1 holding the progress of this TweenData. + * + * @name Phaser.Tweens.BaseTweenData#progress + * @type {number} + * @since 3.60.0 + */ + this.progress = 0; + + /** + * The amount of time, in milliseconds, that has elapsed since this + * TweenData was made active. + * + * @name Phaser.Tweens.BaseTweenData#elapsed + * @type {number} + * @since 3.60.0 + */ + this.elapsed = 0; + + /** + * The state of this TweenData. + * + * @name Phaser.Tweens.BaseTweenData#state + * @type {Phaser.Tweens.StateType} + * @since 3.60.0 + */ + this.state = 0; + + /** + * Is this Tween Data currently waiting for a countdown to elapse, or not? + * + * @name Phaser.Tweens.BaseTweenData#isCountdown + * @type {boolean} + * @since 3.60.0 + */ + this.isCountdown = false; + }, + + /** + * Sets this TweenData state to CREATED. + * + * @method Phaser.Tweens.BaseTweenData#setCreatedState + * @since 3.60.0 + */ + setCreatedState: function () + { + this.state = TWEEN_CONST.CREATED; + this.isCountdown = false; + }, + + /** + * Sets this TweenData state to DELAY. + * + * @method Phaser.Tweens.BaseTweenData#setDelayState + * @since 3.60.0 + */ + setDelayState: function () + { + this.state = TWEEN_CONST.DELAY; + this.isCountdown = true; + }, + + /** + * Sets this TweenData state to PENDING_RENDER. + * + * @method Phaser.Tweens.BaseTweenData#setPendingRenderState + * @since 3.60.0 + */ + setPendingRenderState: function () + { + this.state = TWEEN_CONST.PENDING_RENDER; + this.isCountdown = false; + }, + + /** + * Sets this TweenData state to PLAYING_FORWARD. + * + * @method Phaser.Tweens.BaseTweenData#setPlayingForwardState + * @since 3.60.0 + */ + setPlayingForwardState: function () + { + this.state = TWEEN_CONST.PLAYING_FORWARD; + this.isCountdown = false; + }, + + /** + * Sets this TweenData state to PLAYING_BACKWARD. + * + * @method Phaser.Tweens.BaseTweenData#setPlayingBackwardState + * @since 3.60.0 + */ + setPlayingBackwardState: function () + { + this.state = TWEEN_CONST.PLAYING_BACKWARD; + this.isCountdown = false; + }, + + /** + * Sets this TweenData state to HOLD_DELAY. + * + * @method Phaser.Tweens.BaseTweenData#setHoldState + * @since 3.60.0 + */ + setHoldState: function () + { + this.state = TWEEN_CONST.HOLD_DELAY; + this.isCountdown = true; + }, + + /** + * Sets this TweenData state to REPEAT_DELAY. + * + * @method Phaser.Tweens.BaseTweenData#setRepeatState + * @since 3.60.0 + */ + setRepeatState: function () + { + this.state = TWEEN_CONST.REPEAT_DELAY; + this.isCountdown = true; + }, + + /** + * Sets this TweenData state to COMPLETE. + * + * @method Phaser.Tweens.BaseTweenData#setCompleteState + * @since 3.60.0 + */ + setCompleteState: function () + { + this.state = TWEEN_CONST.COMPLETE; + this.isCountdown = false; + }, + + /** + * Returns `true` if this TweenData has a _current_ state of CREATED, otherwise `false`. + * + * @method Phaser.Tweens.BaseTweenData#isCreated + * @since 3.60.0 + * + * @return {boolean} `true` if this TweenData has a _current_ state of CREATED, otherwise `false`. + */ + isCreated: function () + { + return (this.state === TWEEN_CONST.CREATED); + }, + + /** + * Returns `true` if this TweenData has a _current_ state of DELAY, otherwise `false`. + * + * @method Phaser.Tweens.BaseTweenData#isDelayed + * @since 3.60.0 + * + * @return {boolean} `true` if this TweenData has a _current_ state of DELAY, otherwise `false`. + */ + isDelayed: function () + { + return (this.state === TWEEN_CONST.DELAY); + }, + + /** + * Returns `true` if this TweenData has a _current_ state of PENDING_RENDER, otherwise `false`. + * + * @method Phaser.Tweens.BaseTweenData#isPendingRender + * @since 3.60.0 + * + * @return {boolean} `true` if this TweenData has a _current_ state of PENDING_RENDER, otherwise `false`. + */ + isPendingRender: function () + { + return (this.state === TWEEN_CONST.PENDING_RENDER); + }, + + /** + * Returns `true` if this TweenData has a _current_ state of PLAYING_FORWARD, otherwise `false`. + * + * @method Phaser.Tweens.BaseTweenData#isPlayingForward + * @since 3.60.0 + * + * @return {boolean} `true` if this TweenData has a _current_ state of PLAYING_FORWARD, otherwise `false`. + */ + isPlayingForward: function () + { + return (this.state === TWEEN_CONST.PLAYING_FORWARD); + }, + + /** + * Returns `true` if this TweenData has a _current_ state of PLAYING_BACKWARD, otherwise `false`. + * + * @method Phaser.Tweens.BaseTweenData#isPlayingBackward + * @since 3.60.0 + * + * @return {boolean} `true` if this TweenData has a _current_ state of PLAYING_BACKWARD, otherwise `false`. + */ + isPlayingBackward: function () + { + return (this.state === TWEEN_CONST.PLAYING_BACKWARD); + }, + + /** + * Returns `true` if this TweenData has a _current_ state of HOLD_DELAY, otherwise `false`. + * + * @method Phaser.Tweens.BaseTweenData#isHolding + * @since 3.60.0 + * + * @return {boolean} `true` if this TweenData has a _current_ state of HOLD_DELAY, otherwise `false`. + */ + isHolding: function () + { + return (this.state === TWEEN_CONST.HOLD_DELAY); + }, + + /** + * Returns `true` if this TweenData has a _current_ state of REPEAT_DELAY, otherwise `false`. + * + * @method Phaser.Tweens.BaseTweenData#isRepeating + * @since 3.60.0 + * + * @return {boolean} `true` if this TweenData has a _current_ state of REPEAT_DELAY, otherwise `false`. + */ + isRepeating: function () + { + return (this.state === TWEEN_CONST.REPEAT_DELAY); + }, + + /** + * Returns `true` if this TweenData has a _current_ state of COMPLETE, otherwise `false`. + * + * @method Phaser.Tweens.BaseTweenData#isComplete + * @since 3.60.0 + * + * @return {boolean} `true` if this TweenData has a _current_ state of COMPLETE, otherwise `false`. + */ + isComplete: function () + { + return (this.state === TWEEN_CONST.COMPLETE); + }, + + /** + * Immediately destroys this TweenData, nulling of all its references. + * + * @method Phaser.Tweens.BaseTweenData#destroy + * @since 3.60.0 + */ + destroy: function () + { + this.tween = null; + this.getDelay = null; + this.setCompleteState(); + } + +}); + +module.exports = BaseTweenData; + + /***/ }), /***/ 99730: @@ -215399,14 +217569,14 @@ module.exports = Tweens; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * @typedef {object} Phaser.Types.Tweens.TweenConfigDefaults * @since 3.0.0 - * + * * @property {(object|object[])} targets - The object, or an array of objects, to run the tween on. * @property {number} [delay=0] - The number of milliseconds to delay before the tween will start. * @property {number} [duration=1000] - The duration of the tween in milliseconds. @@ -215418,6 +217588,8 @@ module.exports = Tweens; * @property {boolean} [yoyo=false] - Should the tween complete, then reverse the values incrementally to get back to the starting tween values? The reverse tweening will also take `duration` milliseconds to complete. * @property {boolean} [flipX=false] - Horizontally flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the `flipX` property. * @property {boolean} [flipY=false] - Vertically flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the `flipY` property. + * @property {boolean} [persist=false] - Retain the tween within the Tween Manager, even after playback completes? + * @property {function} [interpolation=null] - The interpolation function to use for array-based tween values. */ var TWEEN_DEFAULTS = { @@ -215431,7 +217603,9 @@ var TWEEN_DEFAULTS = { repeatDelay: 0, yoyo: false, flipX: false, - flipY: false + flipY: false, + persist: false, + interpolation: null }; module.exports = TWEEN_DEFAULTS; @@ -215444,7 +217618,7 @@ module.exports = TWEEN_DEFAULTS; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -215456,17 +217630,15 @@ module.exports = TWEEN_DEFAULTS; // ease: The ease function used by the tween // easeParams: The parameters to go with the ease function (if any) // flipX: flip X the GameObject on tween end -// flipY: flip Y the GameObject on tween end// hold: The time the tween will pause before running a yoyo +// flipY: flip Y the GameObject on tween end // hold: The time the tween will pause before running a yoyo // loop: The time the tween will pause before starting either a yoyo or returning to the start for a repeat // loopDelay: -// offset: Used when the Tween is part of a Timeline // paused: Does the tween start in a paused state, or playing? // props: The properties being tweened by the tween // repeat: The number of times the tween will repeat itself (a value of 1 means the tween will play twice, as it repeated once) // repeatDelay: The time the tween will pause for before starting a repeat. The tween holds in the start state. // targets: The targets the tween is updating. -// useFrames: Use frames or milliseconds? // yoyo: boolean - Does the tween reverse itself (yoyo) when it reaches the end? module.exports = [ @@ -215479,39 +217651,35 @@ module.exports = [ 'flipX', 'flipY', 'hold', + 'interpolation', 'loop', 'loopDelay', - 'offset', 'onActive', 'onActiveParams', - 'onActiveScope', 'onComplete', 'onCompleteParams', - 'onCompleteScope', 'onLoop', 'onLoopParams', - 'onLoopScope', + 'onPause', + 'onPauseParams', 'onRepeat', 'onRepeatParams', - 'onRepeatScope', + 'onResume', + 'onResumeParams', 'onStart', 'onStartParams', - 'onStartScope', 'onStop', 'onStopParams', - 'onStopScope', 'onUpdate', 'onUpdateParams', - 'onUpdateScope', 'onYoyo', 'onYoyoParams', - 'onYoyoScope', 'paused', + 'persist', 'props', 'repeat', 'repeatDelay', 'targets', - 'useFrames', 'yoyo' ]; @@ -215523,17 +217691,19 @@ module.exports = [ /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var BaseTween = __webpack_require__(502); var Class = __webpack_require__(56694); -var EventEmitter = __webpack_require__(6659); var Events = __webpack_require__(54272); var GameObjectCreator = __webpack_require__(99325); var GameObjectFactory = __webpack_require__(61286); -var TWEEN_CONST = __webpack_require__(55303); var MATH_CONST = __webpack_require__(83392); +var TWEEN_CONST = __webpack_require__(55303); +var TweenData = __webpack_require__(15718); +var TweenFrameData = __webpack_require__(96490); /** * @classdesc @@ -215545,60 +217715,22 @@ var MATH_CONST = __webpack_require__(83392); * * @class Tween * @memberof Phaser.Tweens - * @extends Phaser.Events.EventEmitter + * @extends Phaser.Tweens.BaseTween * @constructor * @since 3.0.0 * - * @param {(Phaser.Tweens.TweenManager|Phaser.Tweens.Timeline)} parent - A reference to the parent of this Tween. Either the Tween Manager or a Tween Timeline instance. - * @param {Phaser.Types.Tweens.TweenDataConfig[]} data - An array of TweenData objects, each containing a unique property to be tweened. + * @param {Phaser.Tweens.TweenManager} parent - A reference to the Tween Manager that owns this Tween. * @param {array} targets - An array of targets to be tweened. */ var Tween = new Class({ - Extends: EventEmitter, + Extends: BaseTween, initialize: - function Tween (parent, data, targets) + function Tween (parent, targets) { - EventEmitter.call(this); - - /** - * A reference to the parent of this Tween. - * Either the Tween Manager or a Tween Timeline instance. - * - * @name Phaser.Tweens.Tween#parent - * @type {(Phaser.Tweens.TweenManager|Phaser.Tweens.Timeline)} - * @since 3.0.0 - */ - this.parent = parent; - - /** - * Is the parent of this Tween a Timeline? - * - * @name Phaser.Tweens.Tween#parentIsTimeline - * @type {boolean} - * @since 3.0.0 - */ - this.parentIsTimeline = parent.hasOwnProperty('isTimeline'); - - /** - * An array of TweenData objects, each containing a unique property and target being tweened. - * - * @name Phaser.Tweens.Tween#data - * @type {Phaser.Types.Tweens.TweenDataConfig[]} - * @since 3.0.0 - */ - this.data = data; - - /** - * The cached length of the data array. - * - * @name Phaser.Tweens.Tween#totalData - * @type {number} - * @since 3.0.0 - */ - this.totalData = data.length; + BaseTween.call(this, parent); /** * An array of references to the target/s this Tween is operating on. @@ -215618,80 +217750,6 @@ var Tween = new Class({ */ this.totalTargets = targets.length; - /** - * If `true` then duration, delay, etc values are all frame totals. - * - * @name Phaser.Tweens.Tween#useFrames - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.useFrames = false; - - /** - * Scales the time applied to this Tween. A value of 1 runs in real-time. A value of 0.5 runs 50% slower, and so on. - * Value isn't used when calculating total duration of the tween, it's a run-time delta adjustment only. - * - * @name Phaser.Tweens.Tween#timeScale - * @type {number} - * @default 1 - * @since 3.0.0 - */ - this.timeScale = 1; - - /** - * Loop this tween? Can be -1 for an infinite loop, or an integer. - * When enabled it will play through ALL TweenDatas again. Use TweenData.repeat to loop a single element. - * - * @name Phaser.Tweens.Tween#loop - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.loop = 0; - - /** - * Time in ms/frames before the tween loops. - * - * @name Phaser.Tweens.Tween#loopDelay - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.loopDelay = 0; - - /** - * How many loops are left to run? - * - * @name Phaser.Tweens.Tween#loopCounter - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.loopCounter = 0; - - /** - * Time in ms/frames before the 'onStart' event fires. - * This is the shortest `delay` value across all of the TweenDatas of this Tween. - * - * @name Phaser.Tweens.Tween#startDelay - * @type {number} - * @default 0 - * @since 3.19.0 - */ - this.startDelay = 0; - - /** - * Has this Tween started playback yet? - * This boolean is toggled when the Tween leaves the 'delayed' state and starts running. - * - * @name Phaser.Tweens.Tween#hasStarted - * @type {boolean} - * @readonly - * @since 3.19.0 - */ - this.hasStarted = false; - /** * Is this Tween currently seeking? * This boolean is toggled in the `Tween.seek` method. @@ -215705,81 +217763,12 @@ var Tween = new Class({ this.isSeeking = false; /** - * Time in ms/frames before the 'onComplete' event fires. This never fires if loop = -1 (as it never completes) - * - * @name Phaser.Tweens.Tween#completeDelay - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.completeDelay = 0; - - /** - * Countdown timer (used by timeline offset, loopDelay and completeDelay) - * - * @name Phaser.Tweens.Tween#countdown - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.countdown = 0; - - /** - * Set only if this Tween is part of a Timeline. - * - * @name Phaser.Tweens.Tween#offset - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.offset = 0; - - /** - * Set only if this Tween is part of a Timeline. The calculated offset amount. - * - * @name Phaser.Tweens.Tween#calculatedOffset - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.calculatedOffset = 0; - - /** - * The current state of the tween - * - * @name Phaser.Tweens.Tween#state - * @type {number} - * @since 3.0.0 - */ - this.state = TWEEN_CONST.PENDING_ADD; - - /** - * The state of the tween when it was paused (used by Resume) - * - * @name Phaser.Tweens.Tween#_pausedState - * @type {number} - * @private - * @since 3.0.0 - */ - this._pausedState = TWEEN_CONST.INIT; - - /** - * Does the Tween start off paused? (if so it needs to be started with Tween.play) - * - * @name Phaser.Tweens.Tween#paused - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.paused = false; - - /** - * Elapsed time in ms/frames of this run through the Tween. + * Elapsed time in ms/frames of this run through of the Tween. * * @name Phaser.Tweens.Tween#elapsed * @type {number} * @default 0 - * @since 3.0.0 + * @since 3.60.0 */ this.elapsed = 0; @@ -215789,7 +217778,7 @@ var Tween = new Class({ * @name Phaser.Tweens.Tween#totalElapsed * @type {number} * @default 0 - * @since 3.0.0 + * @since 3.60.0 */ this.totalElapsed = 0; @@ -215799,27 +217788,27 @@ var Tween = new Class({ * @name Phaser.Tweens.Tween#duration * @type {number} * @default 0 - * @since 3.0.0 + * @since 3.60.0 */ this.duration = 0; /** - * Value between 0 and 1. The amount through the Tween, excluding loops. + * Value between 0 and 1. The amount of progress through the Tween, excluding loops. * * @name Phaser.Tweens.Tween#progress * @type {number} * @default 0 - * @since 3.0.0 + * @since 3.60.0 */ this.progress = 0; /** - * Time in ms/frames for the Tween to complete (including looping) + * Time in ms/frames it takes for the Tween to complete a full playthrough (including looping) * * @name Phaser.Tweens.Tween#totalDuration * @type {number} * @default 0 - * @since 3.0.0 + * @since 3.60.0 */ this.totalDuration = 0; @@ -215829,46 +217818,85 @@ var Tween = new Class({ * @name Phaser.Tweens.Tween#totalProgress * @type {number} * @default 0 - * @since 3.0.0 + * @since 3.60.0 */ this.totalProgress = 0; /** - * An object containing the different Tween callback functions. + * The delta used in the current update. * - * You can either set these in the Tween config, or by calling the `Tween.setCallback` method. - * - * `onActive` When the Tween is moved from the pending to the active list in the Tween Manager, even if playback paused. - * `onStart` When the Tween starts playing after a delayed state. Will happen at the same time as `onActive` if it has no delay. - * `onYoyo` When a TweenData starts a yoyo. This happens _after_ the `hold` delay expires, if set. - * `onRepeat` When a TweenData repeats playback. This happens _after_ the `repeatDelay` expires, if set. - * `onComplete` When the Tween finishes playback fully. Never invoked if tween is set to repeat infinitely. - * `onUpdate` When a TweenData updates a property on a source target during playback. - * `onLoop` When a Tween loops. This happens _after_ the `loopDelay` expires, if set. - * - * @name Phaser.Tweens.Tween#callbacks - * @type {object} - * @since 3.0.0 + * @name Phaser.Tweens.Tween#delta + * @type {number} + * @default 0 + * @since 3.60.0 */ - this.callbacks = { - onActive: null, - onComplete: null, - onLoop: null, - onRepeat: null, - onStart: null, - onStop: null, - onUpdate: null, - onYoyo: null - }; + this.delta = 0; + }, - /** - * The context in which all callbacks are invoked. - * - * @name Phaser.Tweens.Tween#callbackScope - * @type {any} - * @since 3.0.0 - */ - this.callbackScope; + /** + * Adds a new TweenData to this Tween. Typically, this method is called + * automatically by the TweenBuilder, however you can also invoke it + * yourself. + * + * @method Phaser.Tweens.Tween#add + * @since 3.60.0 + * + * @param {number} targetIndex - The target index within the Tween targets array. + * @param {string} key - The property of the target to tween. + * @param {Phaser.Types.Tweens.GetEndCallback} getEnd - What the property will be at the END of the Tween. + * @param {Phaser.Types.Tweens.GetStartCallback} getStart - What the property will be at the START of the Tween. + * @param {?Phaser.Types.Tweens.GetActiveCallback} getActive - If not null, is invoked _immediately_ as soon as the TweenData is running, and is set on the target property. + * @param {function} ease - The ease function this tween uses. + * @param {function} delay - Function that returns the time in ms/frames before tween will start. + * @param {number} duration - The duration of the tween in ms/frames. + * @param {boolean} yoyo - Determines whether the tween should return back to its start value after hold has expired. + * @param {number} hold - Function that returns the time in ms/frames the tween will pause before repeating or returning to its starting value if yoyo is set to true. + * @param {number} repeat - Function that returns the number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. + * @param {number} repeatDelay - Function that returns the time in ms/frames before the repeat will start. + * @param {boolean} flipX - Should toggleFlipX be called when yoyo or repeat happens? + * @param {boolean} flipY - Should toggleFlipY be called when yoyo or repeat happens? + * @param {?function} interpolation - The interpolation function to be used for arrays of data. Defaults to 'null'. + * @param {?number[]} interpolationData - The array of interpolation data to be set. Defaults to 'null'. + * + * @return {Phaser.Tweens.TweenData} The TweenData instance that was added. + */ + add: function (targetIndex, key, getEnd, getStart, getActive, ease, delay, duration, yoyo, hold, repeat, repeatDelay, flipX, flipY, interpolation, interpolationData) + { + var tweenData = new TweenData(this, targetIndex, key, getEnd, getStart, getActive, ease, delay, duration, yoyo, hold, repeat, repeatDelay, flipX, flipY, interpolation, interpolationData); + + this.totalData = this.data.push(tweenData); + + return tweenData; + }, + + /** + * Adds a new TweenFrameData to this Tween. Typically, this method is called + * automatically by the TweenBuilder, however you can also invoke it + * yourself. + * + * @method Phaser.Tweens.Tween#addFrame + * @since 3.60.0 + * + * @param {number} targetIndex - The target index within the Tween targets array. + * @param {string} texture - The texture to set on the target at the end of the tween. + * @param {string|number} frame - The texture frame to set on the target at the end of the tween. + * @param {function} delay - Function that returns the time in ms/frames before tween will start. + * @param {number} duration - The duration of the tween in ms/frames. + * @param {number} hold - Function that returns the time in ms/frames the tween will pause before repeating or returning to its starting value if yoyo is set to true. + * @param {number} repeat - Function that returns the number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. + * @param {number} repeatDelay - Function that returns the time in ms/frames before the repeat will start. + * @param {boolean} flipX - Should toggleFlipX be called when yoyo or repeat happens? + * @param {boolean} flipY - Should toggleFlipY be called when yoyo or repeat happens? + * + * @return {Phaser.Tweens.TweenFrameData} The TweenFrameData instance that was added. + */ + addFrame: function (targetIndex, texture, frame, delay, duration, hold, repeat, repeatDelay, flipX, flipY) + { + var tweenData = new TweenFrameData(this, targetIndex, texture, frame, delay, duration, hold, repeat, repeatDelay, flipX, flipY); + + this.totalData = this.data.push(tweenData); + + return tweenData; }, /** @@ -215888,62 +217916,6 @@ var Tween = new Class({ return this.data[index].current; }, - /** - * Set the scale the time applied to this Tween. A value of 1 runs in real-time. A value of 0.5 runs 50% slower, and so on. - * - * @method Phaser.Tweens.Tween#setTimeScale - * @since 3.0.0 - * - * @param {number} value - The scale factor for timescale. - * - * @return {this} - This Tween instance. - */ - setTimeScale: function (value) - { - this.timeScale = value; - - return this; - }, - - /** - * Returns the scale of the time applied to this Tween. - * - * @method Phaser.Tweens.Tween#getTimeScale - * @since 3.0.0 - * - * @return {number} The timescale of this tween (between 0 and 1) - */ - getTimeScale: function () - { - return this.timeScale; - }, - - /** - * Checks if the Tween is currently active. - * - * @method Phaser.Tweens.Tween#isPlaying - * @since 3.0.0 - * - * @return {boolean} `true` if the Tween is active, otherwise `false`. - */ - isPlaying: function () - { - return (this.state === TWEEN_CONST.ACTIVE); - }, - - /** - * Checks if the Tween is currently paused. - * - * @method Phaser.Tweens.Tween#isPaused - * @since 3.0.0 - * - * @return {boolean} `true` if the Tween is paused, otherwise `false`. - */ - isPaused: function () - { - return (this.state === TWEEN_CONST.PAUSED); - }, - /** * See if this Tween is currently acting upon the given target. * @@ -215973,7 +217945,7 @@ var Tween = new Class({ * @param {*} value - The new value of the property. * @param {boolean} [startToCurrent=false] - Should this change set the start value to be the current value? * - * @return {this} - This Tween instance. + * @return {this} This Tween instance. */ updateTo: function (key, value, startToCurrent) { @@ -215998,7 +217970,12 @@ var Tween = new Class({ }, /** - * Restarts the tween from the beginning. + * Restarts the Tween from the beginning. + * + * You can only restart a Tween that is currently playing. If the Tween has already been stopped, restarting + * it will throw an error. + * + * If you wish to restart the Tween from a specific point, use the `Tween.seek` method instead. * * @method Phaser.Tweens.Tween#restart * @since 3.0.0 @@ -216007,172 +217984,32 @@ var Tween = new Class({ */ restart: function () { - // Reset these so they're ready for the next update - this.elapsed = 0; - this.progress = 0; - this.totalElapsed = 0; - this.totalProgress = 0; - - if (this.state === TWEEN_CONST.ACTIVE) + switch (this.state) { - return this.seek(0); - } - else if (this.state === TWEEN_CONST.REMOVED) - { - this.seek(0); - this.parent.makeActive(this); + case TWEEN_CONST.REMOVED: + case TWEEN_CONST.FINISHED: + this.seek(); + this.parent.makeActive(this); + break; - return this; - } - else if (this.state === TWEEN_CONST.PENDING_ADD) - { - return this; - } - else - { - return this.play(); - } - }, + case TWEEN_CONST.PENDING: + case TWEEN_CONST.PENDING_REMOVE: + this.parent.reset(this); + break; - /** - * Internal method that calculates the overall duration of the Tween. - * - * @method Phaser.Tweens.Tween#calcDuration - * @since 3.0.0 - */ - calcDuration: function () - { - var maxDuration = 0; - var minDelay = MATH_CONST.MAX_SAFE_INTEGER; + case TWEEN_CONST.DESTROYED: + console.warn('Cannot restart destroyed Tweens', this); + break; - var data = this.data; - - for (var i = 0; i < this.totalData; i++) - { - var tweenData = data[i]; - - // Set t1 (duration + hold + yoyo) - tweenData.t1 = tweenData.duration + tweenData.hold; - - if (tweenData.yoyo) - { - tweenData.t1 += tweenData.duration; - } - - // Set t2 (repeatDelay + duration + hold + yoyo) - tweenData.t2 = tweenData.t1 + tweenData.repeatDelay; - - // Total Duration - tweenData.totalDuration = tweenData.delay + tweenData.t1; - - if (tweenData.repeat === -1) - { - tweenData.totalDuration += (tweenData.t2 * 999999999999); - } - else if (tweenData.repeat > 0) - { - tweenData.totalDuration += (tweenData.t2 * tweenData.repeat); - } - - if (tweenData.totalDuration > maxDuration) - { - // Get the longest TweenData from the Tween, used to calculate the Tween TD - maxDuration = tweenData.totalDuration; - } - - if (tweenData.delay < minDelay) - { - minDelay = tweenData.delay; - } + default: + this.seek(); + break; } - // Excludes loop values + this.paused = false; + this.hasStarted = false; - // If duration has been set to 0 then we give it a super-low value so that it always - // renders at least 1 frame, but no more, without causing divided by zero errors elsewhere. - this.duration = Math.max(maxDuration, 0.001); - - this.loopCounter = (this.loop === -1) ? 999999999999 : this.loop; - - if (this.loopCounter > 0) - { - this.totalDuration = this.duration + this.completeDelay + ((this.duration + this.loopDelay) * this.loopCounter); - } - else - { - this.totalDuration = this.duration + this.completeDelay; - } - - // How long before this Tween starts playback? - this.startDelay = minDelay; - }, - - /** - * Called by TweenManager.preUpdate as part of its loop to check pending and active tweens. - * Should not be called directly. - * - * @method Phaser.Tweens.Tween#init - * @since 3.0.0 - * - * @return {boolean} Returns `true` if this Tween should be moved from the pending list to the active list by the Tween Manager. - */ - init: function () - { - // You can't have a paused Tween if it's part of a Timeline - if (this.paused && !this.parentIsTimeline) - { - this.state = TWEEN_CONST.PENDING_ADD; - this._pausedState = TWEEN_CONST.INIT; - - return false; - } - - var data = this.data; - var totalTargets = this.totalTargets; - - for (var i = 0; i < this.totalData; i++) - { - var tweenData = data[i]; - var target = tweenData.target; - var gen = tweenData.gen; - var key = tweenData.key; - var targetIndex = tweenData.index; - - // Old function signature: i, totalTargets, target - // New function signature: target, key, value, index, total, tween - - tweenData.delay = gen.delay(target, key, 0, targetIndex, totalTargets, this); - tweenData.duration = Math.max(gen.duration(target, key, 0, targetIndex, totalTargets, this), 0.001); - tweenData.hold = gen.hold(target, key, 0, targetIndex, totalTargets, this); - tweenData.repeat = gen.repeat(target, key, 0, targetIndex, totalTargets, this); - tweenData.repeatDelay = gen.repeatDelay(target, key, 0, targetIndex, totalTargets, this); - } - - this.calcDuration(); - - this.progress = 0; - this.totalProgress = 0; - this.elapsed = 0; - this.totalElapsed = 0; - - this.state = TWEEN_CONST.INIT; - - return true; - }, - - /** - * Internal method that makes this Tween active within the TweenManager - * and emits the onActive event and callback. - * - * @method Phaser.Tweens.Tween#makeActive - * @fires Phaser.Tweens.Events#TWEEN_ACTIVE - * @since 3.19.0 - */ - makeActive: function () - { - this.parent.makeActive(this); - - this.dispatchTweenEvent(Events.TWEEN_ACTIVE, this.callbacks.onActive); + return this; }, /** @@ -216182,6 +218019,8 @@ var Tween = new Class({ * @fires Phaser.Tweens.Events#TWEEN_COMPLETE * @fires Phaser.Tweens.Events#TWEEN_LOOP * @since 3.0.0 + * + * @return {boolean} `true` if this Tween has completed, otherwise `false`. */ nextState: function () { @@ -216196,51 +218035,45 @@ var Tween = new Class({ if (this.loopDelay > 0) { this.countdown = this.loopDelay; - this.state = TWEEN_CONST.LOOP_DELAY; + + this.setLoopDelayState(); } else { - this.state = TWEEN_CONST.ACTIVE; + this.setActiveState(); - this.dispatchTweenEvent(Events.TWEEN_LOOP, this.callbacks.onLoop); + this.dispatchEvent(Events.TWEEN_LOOP, 'onLoop'); } } else if (this.completeDelay > 0) { - this.state = TWEEN_CONST.COMPLETE_DELAY; - this.countdown = this.completeDelay; + + this.setCompleteDelayState(); } else { - this.state = TWEEN_CONST.PENDING_REMOVE; + this.onCompleteHandler(); - this.dispatchTweenEvent(Events.TWEEN_COMPLETE, this.callbacks.onComplete); + return true; } + + return false; }, /** - * Pauses the Tween immediately. Use `resume` to continue playback. + * Internal method that handles this tween completing and starting + * the next tween in the chain, if any. * - * @method Phaser.Tweens.Tween#pause - * @since 3.0.0 - * - * @return {this} - This Tween instance. + * @method Phaser.Tweens.Tween#onCompleteHandler + * @since 3.60.0 */ - pause: function () + onCompleteHandler: function () { - if (this.state === TWEEN_CONST.PAUSED) - { - return this; - } + this.progress = 1; + this.totalProgress = 1; - this.paused = true; - - this._pausedState = this.state; - - this.state = TWEEN_CONST.PAUSED; - - return this; + BaseTween.prototype.onCompleteHandler.call(this); }, /** @@ -216251,71 +218084,32 @@ var Tween = new Class({ * If the Tween is already playing, calling this method again will have no effect. If you wish to * restart the Tween, use `Tween.restart` instead. * - * Calling this method after the Tween has completed will start the Tween playing again from the start. + * Calling this method after the Tween has completed will start the Tween playing again from the beginning. * This is the same as calling `Tween.seek(0)` and then `Tween.play()`. * * @method Phaser.Tweens.Tween#play * @since 3.0.0 * - * @param {boolean} [resetFromTimeline=false] - Is this Tween being played as part of a Timeline? - * * @return {this} This Tween instance. */ - play: function (resetFromTimeline) + play: function () { - if (resetFromTimeline === undefined) { resetFromTimeline = false; } - - var state = this.state; - - if (state === TWEEN_CONST.INIT && !this.parentIsTimeline) + if (this.isDestroyed()) { - this.resetTweenData(false); - - this.state = TWEEN_CONST.ACTIVE; - - return this; - } - else if (state === TWEEN_CONST.ACTIVE || (state === TWEEN_CONST.PENDING_ADD && this._pausedState === TWEEN_CONST.PENDING_ADD)) - { - return this; - } - else if (!this.parentIsTimeline && (state === TWEEN_CONST.PENDING_REMOVE || state === TWEEN_CONST.REMOVED)) - { - this.seek(0); - this.parent.makeActive(this); + console.warn('Cannot play destroyed Tween', this); return this; } - if (this.parentIsTimeline) + if (this.isPendingRemove() || this.isPending()) { - this.resetTweenData(resetFromTimeline); - - if (this.calculatedOffset === 0) - { - this.state = TWEEN_CONST.ACTIVE; - } - else - { - this.countdown = this.calculatedOffset; - - this.state = TWEEN_CONST.OFFSET_DELAY; - } + // This makes the tween active as well: + this.seek(); } - else if (this.paused) - { - this.paused = false; - this.makeActive(); - } - else - { - this.resetTweenData(resetFromTimeline); + this.paused = false; - this.state = TWEEN_CONST.ACTIVE; - - this.makeActive(); - } + this.setActiveState(); return this; }, @@ -216332,74 +218126,13 @@ var Tween = new Class({ { var data = this.data; var total = this.totalData; - var totalTargets = this.totalTargets; for (var i = 0; i < total; i++) { - var tweenData = data[i]; - - var target = tweenData.target; - var key = tweenData.key; - var targetIndex = tweenData.index; - - tweenData.progress = 0; - tweenData.elapsed = 0; - - tweenData.repeatCounter = (tweenData.repeat === -1) ? 999999999999 : tweenData.repeat; - - if (resetFromLoop) - { - tweenData.start = tweenData.getStartValue(target, key, tweenData.start, targetIndex, totalTargets, this); - - tweenData.end = tweenData.getEndValue(target, key, tweenData.end, targetIndex, totalTargets, this); - - tweenData.current = tweenData.start; - - tweenData.state = TWEEN_CONST.PLAYING_FORWARD; - } - else - { - tweenData.state = TWEEN_CONST.PENDING_RENDER; - } - - if (tweenData.delay > 0) - { - tweenData.elapsed = tweenData.delay; - - tweenData.state = TWEEN_CONST.DELAY; - } - - if (tweenData.getActiveValue) - { - target[key] = tweenData.getActiveValue(tweenData.target, tweenData.key, tweenData.start); - } + data[i].reset(resetFromLoop); } }, - /** - * Resumes the playback of a previously paused Tween. - * - * @method Phaser.Tweens.Tween#resume - * @since 3.0.0 - * - * @return {this} - This Tween instance. - */ - resume: function () - { - if (this.state === TWEEN_CONST.PAUSED) - { - this.paused = false; - - this.state = this._pausedState; - } - else - { - this.play(); - } - - return this; - }, - /** * Seeks to a specific point in the Tween. * @@ -216419,222 +218152,108 @@ var Tween = new Class({ * @method Phaser.Tweens.Tween#seek * @since 3.0.0 * - * @param {number} toPosition - A value between 0 and 1 which represents the progress point to seek to. - * @param {number} [delta=16.6] - The size of each step when seeking through the Tween. A higher value completes faster but at a cost of less precision. + * @param {number} [toPosition=0] - A value between 0 and 1 which represents the progress point to seek to. + * @param {number} [delta=16.6] - The size of each step when seeking through the Tween. A higher value completes faster but at the cost of less precision. * * @return {this} This Tween instance. */ seek: function (toPosition, delta) { + if (toPosition === undefined) { toPosition = 0; } if (delta === undefined) { delta = 16.6; } - if (this.state === TWEEN_CONST.REMOVED) + if (this.isRemoved() || this.isFinished()) { this.makeActive(); } + this.initTweenData(true); + + if (toPosition > 0) + { + this.isSeeking = true; + + do + { + this.update(delta); + + } while (this.totalProgress <= toPosition); + + this.isSeeking = false; + } + + return this; + }, + + /** + * Initialises all of the Tween Data and Tween values. + * + * This is called automatically and should not typically be invoked directly. + * + * @method Phaser.Tweens.Tween#initTweenData + * @since 3.60.0 + * + * @param {boolean} [isSeek=false] - Is this being called as part of a seek, or not? + */ + initTweenData: function (isSeek) + { + if (isSeek === undefined) { isSeek = false; } + + this.reset(true); + + // These two values are set directly during TweenData.init: + this.duration = 0; + this.startDelay = MATH_CONST.MAX_SAFE_INTEGER; + + var data = this.data; + + for (var i = 0; i < this.totalData; i++) + { + data[i].init(isSeek); + } + + // Clamp duration to ensure we never divide by zero + this.duration = Math.max(this.duration, 0.01); + + if (this.loopCounter > 0) + { + this.totalDuration = this.duration + this.completeDelay + ((this.duration + this.loopDelay) * this.loopCounter); + } + else + { + this.totalDuration = this.duration + this.completeDelay; + } + }, + + /** + * Resets this Tween ready for another play-through from the parent TweenChain. + * + * This is called automatically and should not typically be invoked directly. + * + * If you wish to restart this Tween, see `Tween.restart` or `Tween.seek` instead. + * + * @method Phaser.Tweens.Tween#reset + * @since 3.60.0 + * + * @param {boolean} [skipReset=false] - Skip resetting the TweenData and Active State? + */ + reset: function (skipReset) + { this.elapsed = 0; this.progress = 0; this.totalElapsed = 0; this.totalProgress = 0; - var data = this.data; - var totalTargets = this.totalTargets; + this.loopCounter = (this.loop === -1) ? 999999999999 : this.loop; - for (var i = 0; i < this.totalData; i++) + if (!skipReset) { - var tweenData = data[i]; - var target = tweenData.target; - var gen = tweenData.gen; - var key = tweenData.key; - var targetIndex = tweenData.index; + this.resetTweenData(true); - tweenData.progress = 0; - tweenData.elapsed = 0; + this.setActiveState(); - tweenData.repeatCounter = (tweenData.repeat === -1) ? 999999999999 : tweenData.repeat; - - // Old function signature: i, totalTargets, target - // New function signature: target, key, value, index, total, tween - - tweenData.delay = gen.delay(target, key, 0, targetIndex, totalTargets, this); - tweenData.duration = Math.max(gen.duration(target, key, 0, targetIndex, totalTargets, this), 0.001); - tweenData.hold = gen.hold(target, key, 0, targetIndex, totalTargets, this); - tweenData.repeat = gen.repeat(target, key, 0, targetIndex, totalTargets, this); - tweenData.repeatDelay = gen.repeatDelay(target, key, 0, targetIndex, totalTargets, this); - - tweenData.current = tweenData.start; - tweenData.state = TWEEN_CONST.PLAYING_FORWARD; - - this.updateTweenData(this, tweenData, 0, targetIndex, totalTargets); - - if (tweenData.delay > 0) - { - tweenData.elapsed = tweenData.delay; - tweenData.state = TWEEN_CONST.DELAY; - } + this.dispatchEvent(Events.TWEEN_ACTIVE, 'onActive'); } - - this.calcDuration(); - - var wasPaused = false; - - if (this.state === TWEEN_CONST.PAUSED) - { - wasPaused = true; - - this.state = TWEEN_CONST.ACTIVE; - } - - this.isSeeking = true; - - do - { - this.update(0, delta); - - } while (this.totalProgress < toPosition); - - this.isSeeking = false; - - if (wasPaused) - { - this.state = TWEEN_CONST.PAUSED; - } - - return this; - }, - - /** - * Sets an event based callback to be invoked during playback. - * - * Calling this method will replace a previously set callback for the given type, if any exists. - * - * The types available are: - * - * `onActive` When the Tween is moved from the pending to the active list in the Tween Manager, even if playback paused. - * `onStart` When the Tween starts playing after a delayed state. Will happen at the same time as `onActive` if it has no delay. - * `onYoyo` When a TweenData starts a yoyo. This happens _after_ the `hold` delay expires, if set. - * `onRepeat` When a TweenData repeats playback. This happens _after_ the `repeatDelay` expires, if set. - * `onComplete` When the Tween finishes playback fully or `Tween.stop` is called. Never invoked if tween is set to repeat infinitely. - * `onUpdate` When a TweenData updates a property on a source target during playback. - * `onLoop` When a Tween loops. This happens _after_ the `loopDelay` expires, if set. - * - * @method Phaser.Tweens.Tween#setCallback - * @since 3.0.0 - * - * @param {string} type - Type of the callback to set. - * @param {function} callback - The function to invoke when this callback happens. - * @param {array} [params] - An array of parameters for specified callbacks types. - * @param {any} [scope] - The context the callback will be invoked in. - * - * @return {this} This Tween instance. - */ - setCallback: function (type, callback, params, scope) - { - this.callbacks[type] = { func: callback, scope: scope, params: [ this, null ].concat(params) }; - - return this; - }, - - /** - * Flags the Tween as being complete, whatever stage of progress it is at. - * - * If an onComplete callback has been defined it will automatically invoke it, unless a `delay` - * argument is provided, in which case the Tween will delay for that period of time before calling the callback. - * - * If you don't need a delay, or have an onComplete callback, then call `Tween.stop` instead. - * - * @method Phaser.Tweens.Tween#complete - * @fires Phaser.Tweens.Events#TWEEN_COMPLETE - * @since 3.2.0 - * - * @param {number} [delay=0] - The time to wait before invoking the complete callback. If zero it will fire immediately. - * - * @return {this} This Tween instance. - */ - complete: function (delay) - { - if (delay === undefined) { delay = 0; } - - if (delay) - { - this.state = TWEEN_CONST.COMPLETE_DELAY; - - this.countdown = delay; - } - else - { - this.state = TWEEN_CONST.PENDING_REMOVE; - - this.dispatchTweenEvent(Events.TWEEN_COMPLETE, this.callbacks.onComplete); - } - - return this; - }, - - /** - * Immediately removes this Tween from the TweenManager and all of its internal arrays, - * no matter what stage it as it. Then sets the tween state to `REMOVED`. - * - * You should dispose of your reference to this tween after calling this method, to - * free it from memory. - * - * @method Phaser.Tweens.Tween#remove - * @since 3.17.0 - * - * @return {this} This Tween instance. - */ - remove: function () - { - this.parent.remove(this); - - return this; - }, - - /** - * Stops the Tween immediately, whatever stage of progress it is at and flags it for removal by the TweenManager. - * - * @method Phaser.Tweens.Tween#stop - * @since 3.0.0 - * - * @param {number} [resetTo] - If you want to seek the tween, provide a value between 0 and 1. - * - * @return {this} This Tween instance. - */ - stop: function (resetTo) - { - if (this.state === TWEEN_CONST.ACTIVE) - { - if (resetTo !== undefined) - { - this.seek(resetTo); - } - } - - if (this.state !== TWEEN_CONST.REMOVED) - { - if (this.state === TWEEN_CONST.PAUSED || this.state === TWEEN_CONST.PENDING_ADD) - { - if (this.parentIsTimeline) - { - this.parent.manager._destroy.push(this); - this.parent.manager._toProcess++; - } - else - { - this.parent._destroy.push(this); - this.parent._toProcess++; - } - } - - this.dispatchTweenEvent(Events.TWEEN_STOP, this.callbacks.onStop); - - this.removeAllListeners(); - - this.state = TWEEN_CONST.PENDING_REMOVE; - } - - return this; }, /** @@ -216646,24 +218265,62 @@ var Tween = new Class({ * @fires Phaser.Tweens.Events#TWEEN_START * @since 3.0.0 * - * @param {number} timestamp - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. * * @return {boolean} Returns `true` if this Tween has finished and should be removed from the Tween Manager, otherwise returns `false`. */ - update: function (timestamp, delta) + update: function (delta) { - if (this.state === TWEEN_CONST.PAUSED) + if (this.isPendingRemove() || this.isDestroyed()) + { + return true; + } + else if (this.isFinished() || (this.paused && !this.isSeeking)) { return false; } - if (this.useFrames) + delta *= this.timeScale * this.parent.timeScale; + + if (this.isLoopDelayed()) { - delta = 1 * this.parent.timeScale; + this.updateLoopCountdown(delta); + } + else if (this.isCompleteDelayed()) + { + this.updateCompleteDelay(delta); + } + else if (!this.hasStarted && !this.isSeeking) + { + this.startDelay -= delta; + + if (this.startDelay <= 0) + { + this.hasStarted = true; + + this.dispatchEvent(Events.TWEEN_START, 'onStart'); + + // Reset the delta so we always start progress from zero + delta = 0; + } } - delta *= this.timeScale; + var stillRunning = false; + + if (this.isActive()) + { + var data = this.data; + + for (var i = 0; i < this.totalData; i++) + { + if (data[i].update(delta)) + { + stillRunning = true; + } + } + } + + this.delta = delta; this.elapsed += delta; this.progress = Math.min(this.elapsed / this.duration, 1); @@ -216671,450 +218328,67 @@ var Tween = new Class({ this.totalElapsed += delta; this.totalProgress = Math.min(this.totalElapsed / this.totalDuration, 1); - switch (this.state) + // Anything still running? If not, we're done + if (!stillRunning) { - case TWEEN_CONST.ACTIVE: - - if (!this.hasStarted && !this.isSeeking) - { - this.startDelay -= delta; - - if (this.startDelay <= 0) - { - this.hasStarted = true; - - this.dispatchTweenEvent(Events.TWEEN_START, this.callbacks.onStart); - } - } - - var stillRunning = false; - - for (var i = 0; i < this.totalData; i++) - { - var tweenData = this.data[i]; - - if (this.updateTweenData(this, tweenData, delta)) - { - stillRunning = true; - } - } - - // Anything still running? If not, we're done - if (!stillRunning) - { - this.nextState(); - } - - break; - - case TWEEN_CONST.LOOP_DELAY: - - this.countdown -= delta; - - if (this.countdown <= 0) - { - this.state = TWEEN_CONST.ACTIVE; - - this.dispatchTweenEvent(Events.TWEEN_LOOP, this.callbacks.onLoop); - } - - break; - - case TWEEN_CONST.OFFSET_DELAY: - - this.countdown -= delta; - - if (this.countdown <= 0) - { - this.state = TWEEN_CONST.ACTIVE; - } - - break; - - case TWEEN_CONST.COMPLETE_DELAY: - - this.countdown -= delta; - - if (this.countdown <= 0) - { - this.state = TWEEN_CONST.PENDING_REMOVE; - - this.dispatchTweenEvent(Events.TWEEN_COMPLETE, this.callbacks.onComplete); - } - - break; + // This calls onCompleteHandler if this tween is over + this.nextState(); } - return (this.state === TWEEN_CONST.PENDING_REMOVE); - }, + // if nextState called onCompleteHandler then we're ready to be removed, unless we persist + var remove = this.isPendingRemove(); - /** - * Internal method that will emit a TweenData based Event and invoke the given callback. - * - * @method Phaser.Tweens.Tween#dispatchTweenDataEvent - * @since 3.19.0 - * - * @param {Phaser.Types.Tweens.Event} event - The Event to be dispatched. - * @param {function} callback - The callback to be invoked. Can be `null` or `undefined` to skip invocation. - * @param {Phaser.Types.Tweens.TweenDataConfig} tweenData - The TweenData object that caused this event. - */ - dispatchTweenDataEvent: function (event, callback, tweenData) - { - if (!this.isSeeking) + if (remove && this.persist) { - this.emit(event, this, tweenData.key, tweenData.target, tweenData.current, tweenData.previous); + this.setFinishedState(); - if (callback) - { - callback.params[1] = tweenData.target; - - callback.func.apply(callback.scope, callback.params); - } + remove = false; } + + return remove; }, /** * Internal method that will emit a Tween based Event and invoke the given callback. * - * @method Phaser.Tweens.Tween#dispatchTweenEvent - * @since 3.19.0 + * @method Phaser.Tweens.Tween#dispatchEvent + * @since 3.60.0 * * @param {Phaser.Types.Tweens.Event} event - The Event to be dispatched. - * @param {function} callback - The callback to be invoked. Can be `null` or `undefined` to skip invocation. + * @param {Phaser.Types.Tweens.TweenCallbackTypes} [callback] - The name of the callback to be invoked. Can be `null` or `undefined` to skip invocation. */ - dispatchTweenEvent: function (event, callback) + dispatchEvent: function (event, callback) { if (!this.isSeeking) { this.emit(event, this, this.targets); - if (callback) - { - callback.params[1] = this.targets; + var handler = this.callbacks[callback]; - callback.func.apply(callback.scope, callback.params); + if (handler) + { + handler.func.apply(handler.scope, [ this, this.targets ].concat(handler.params)); } } }, /** - * Internal method used as part of the playback process that sets a tween to play in reverse. + * Handles the destroy process of this Tween, clearing out the + * Tween Data and resetting the targets. A Tween that has been + * destroyed cannot ever be played or used again. * - * @method Phaser.Tweens.Tween#setStateFromEnd - * @fires Phaser.Tweens.Events#TWEEN_REPEAT - * @fires Phaser.Tweens.Events#TWEEN_YOYO - * @since 3.0.0 - * - * @param {Phaser.Tweens.Tween} tween - The Tween to update. - * @param {Phaser.Types.Tweens.TweenDataConfig} tweenData - The TweenData property to update. - * @param {number} diff - Any extra time that needs to be accounted for in the elapsed and progress values. - * - * @return {number} The state of this Tween. + * @method Phaser.Tweens.Tween#destroy + * @since 3.60.0 */ - setStateFromEnd: function (tween, tweenData, diff) + destroy: function () { - if (tweenData.yoyo) - { - // We've hit the end of a Playing Forward TweenData and we have a yoyo + BaseTween.prototype.destroy.call(this); - // Account for any extra time we got from the previous frame - tweenData.elapsed = diff; - tweenData.progress = diff / tweenData.duration; - - if (tweenData.flipX) - { - tweenData.target.toggleFlipX(); - } - - if (tweenData.flipY) - { - tweenData.target.toggleFlipY(); - } - - this.dispatchTweenDataEvent(Events.TWEEN_YOYO, tween.callbacks.onYoyo, tweenData); - - tweenData.start = tweenData.getStartValue(tweenData.target, tweenData.key, tweenData.start, tweenData.index, tween.totalTargets, tween); - - return TWEEN_CONST.PLAYING_BACKWARD; - } - else if (tweenData.repeatCounter > 0) - { - // We've hit the end of a Playing Forward TweenData and we have a Repeat. - // So we're going to go right back to the start to repeat it again. - - tweenData.repeatCounter--; - - // Account for any extra time we got from the previous frame - tweenData.elapsed = diff; - tweenData.progress = diff / tweenData.duration; - - if (tweenData.flipX) - { - tweenData.target.toggleFlipX(); - } - - if (tweenData.flipY) - { - tweenData.target.toggleFlipY(); - } - - tweenData.start = tweenData.getStartValue(tweenData.target, tweenData.key, tweenData.start, tweenData.index, tween.totalTargets, tween); - - tweenData.end = tweenData.getEndValue(tweenData.target, tweenData.key, tweenData.start, tweenData.index, tween.totalTargets, tween); - - // Delay? - if (tweenData.repeatDelay > 0) - { - tweenData.elapsed = tweenData.repeatDelay - diff; - - tweenData.current = tweenData.start; - - tweenData.target[tweenData.key] = tweenData.current; - - return TWEEN_CONST.REPEAT_DELAY; - } - else - { - this.dispatchTweenDataEvent(Events.TWEEN_REPEAT, tween.callbacks.onRepeat, tweenData); - - return TWEEN_CONST.PLAYING_FORWARD; - } - } - - return TWEEN_CONST.COMPLETE; - }, - - /** - * Internal method used as part of the playback process that sets a tween to play from the start. - * - * @method Phaser.Tweens.Tween#setStateFromStart - * @fires Phaser.Tweens.Events#TWEEN_REPEAT - * @since 3.0.0 - * - * @param {Phaser.Tweens.Tween} tween - The Tween to update. - * @param {Phaser.Types.Tweens.TweenDataConfig} tweenData - The TweenData property to update. - * @param {number} diff - Any extra time that needs to be accounted for in the elapsed and progress values. - * - * @return {number} The state of this Tween. - */ - setStateFromStart: function (tween, tweenData, diff) - { - if (tweenData.repeatCounter > 0) - { - tweenData.repeatCounter--; - - // Account for any extra time we got from the previous frame - tweenData.elapsed = diff; - tweenData.progress = diff / tweenData.duration; - - if (tweenData.flipX) - { - tweenData.target.toggleFlipX(); - } - - if (tweenData.flipY) - { - tweenData.target.toggleFlipY(); - } - - tweenData.end = tweenData.getEndValue(tweenData.target, tweenData.key, tweenData.start, tweenData.index, tween.totalTargets, tween); - - // Delay? - if (tweenData.repeatDelay > 0) - { - tweenData.elapsed = tweenData.repeatDelay - diff; - - tweenData.current = tweenData.start; - - tweenData.target[tweenData.key] = tweenData.current; - - return TWEEN_CONST.REPEAT_DELAY; - } - else - { - this.dispatchTweenDataEvent(Events.TWEEN_REPEAT, tween.callbacks.onRepeat, tweenData); - - return TWEEN_CONST.PLAYING_FORWARD; - } - } - - return TWEEN_CONST.COMPLETE; - }, - - /** - * Internal method that advances the TweenData based on the time value given. - * - * @method Phaser.Tweens.Tween#updateTweenData - * @fires Phaser.Tweens.Events#TWEEN_UPDATE - * @fires Phaser.Tweens.Events#TWEEN_REPEAT - * @since 3.0.0 - * - * @param {Phaser.Tweens.Tween} tween - The Tween to update. - * @param {Phaser.Types.Tweens.TweenDataConfig} tweenData - The TweenData property to update. - * @param {number} delta - Either a value in ms, or 1 if Tween.useFrames is true. - * - * @return {boolean} True if the tween is not complete (e.g., playing), or false if the tween is complete. - */ - updateTweenData: function (tween, tweenData, delta) - { - var target = tweenData.target; - - switch (tweenData.state) - { - case TWEEN_CONST.PLAYING_FORWARD: - case TWEEN_CONST.PLAYING_BACKWARD: - - if (!target) - { - tweenData.state = TWEEN_CONST.COMPLETE; - break; - } - - var elapsed = tweenData.elapsed; - var duration = tweenData.duration; - var diff = 0; - - elapsed += delta; - - if (elapsed > duration) - { - diff = elapsed - duration; - elapsed = duration; - } - - var forward = (tweenData.state === TWEEN_CONST.PLAYING_FORWARD); - var progress = elapsed / duration; - - tweenData.elapsed = elapsed; - tweenData.progress = progress; - tweenData.previous = tweenData.current; - - if (progress === 1) - { - if (forward) - { - tweenData.current = tweenData.end; - target[tweenData.key] = tweenData.end; - - if (tweenData.hold > 0) - { - tweenData.elapsed = tweenData.hold - diff; - - tweenData.state = TWEEN_CONST.HOLD_DELAY; - } - else - { - tweenData.state = this.setStateFromEnd(tween, tweenData, diff); - } - } - else - { - tweenData.current = tweenData.start; - target[tweenData.key] = tweenData.start; - - tweenData.state = this.setStateFromStart(tween, tweenData, diff); - } - } - else - { - var v = (forward) ? tweenData.ease(progress) : tweenData.ease(1 - progress); - - tweenData.current = tweenData.start + ((tweenData.end - tweenData.start) * v); - - target[tweenData.key] = tweenData.current; - } - - this.dispatchTweenDataEvent(Events.TWEEN_UPDATE, tween.callbacks.onUpdate, tweenData); - - break; - - case TWEEN_CONST.DELAY: - - tweenData.elapsed -= delta; - - if (tweenData.elapsed <= 0) - { - tweenData.elapsed = Math.abs(tweenData.elapsed); - - tweenData.state = TWEEN_CONST.PENDING_RENDER; - } - - break; - - case TWEEN_CONST.REPEAT_DELAY: - - tweenData.elapsed -= delta; - - if (tweenData.elapsed <= 0) - { - tweenData.elapsed = Math.abs(tweenData.elapsed); - - tweenData.state = TWEEN_CONST.PLAYING_FORWARD; - - this.dispatchTweenDataEvent(Events.TWEEN_REPEAT, tween.callbacks.onRepeat, tweenData); - } - - break; - - case TWEEN_CONST.HOLD_DELAY: - - tweenData.elapsed -= delta; - - if (tweenData.elapsed <= 0) - { - tweenData.state = this.setStateFromEnd(tween, tweenData, Math.abs(tweenData.elapsed)); - } - - break; - - case TWEEN_CONST.PENDING_RENDER: - - if (target) - { - tweenData.start = tweenData.getStartValue(target, tweenData.key, target[tweenData.key], tweenData.index, tween.totalTargets, tween); - - tweenData.end = tweenData.getEndValue(target, tweenData.key, tweenData.start, tweenData.index, tween.totalTargets, tween); - - tweenData.current = tweenData.start; - - target[tweenData.key] = tweenData.start; - - tweenData.state = TWEEN_CONST.PLAYING_FORWARD; - } - else - { - tweenData.state = TWEEN_CONST.COMPLETE; - } - - break; - } - - // Return TRUE if this TweenData still playing, otherwise return FALSE - return (tweenData.state !== TWEEN_CONST.COMPLETE); + this.targets = null; } }); -// onActive = 'active' event = When the Tween is moved from the pending to the active list in the manager, even if playback delayed -// onStart = 'start' event = When the Tween starts playing from a delayed state (will happen same time as onActive if no delay) -// onStop = 'stop' event = When the Tween is stopped -// onYoyo = 'yoyo' event = When the Tween starts a yoyo -// onRepeat = 'repeat' event = When a TweenData repeats playback (if any) -// onComplete = 'complete' event = When the Tween finishes all playback (can sometimes never happen if repeat -1), also when 'stop' called -// onUpdate = 'update' event = When the Tween updates a TweenData during playback (expensive!) -// onLoop = 'loop' event = Used to loop ALL TweenDatas in a Tween - -Tween.TYPES = [ - 'onActive', - 'onComplete', - 'onLoop', - 'onRepeat', - 'onStart', - 'onStop', - 'onUpdate', - 'onYoyo' -]; - /** * Creates a new Tween object. * @@ -217132,14 +218406,6 @@ GameObjectFactory.register('tween', function (config) return this.scene.sys.tweens.add(config); }); -// When registering a factory function 'this' refers to the GameObjectFactory context. -// -// There are several properties available to use: -// -// this.scene - a reference to the Scene that owns the GameObjectFactory -// this.displayList - a reference to the Display List the Scene owns -// this.updateList - a reference to the Update List the Scene owns - /** * Creates a new Tween object and returns it. * @@ -217157,139 +218423,1706 @@ GameObjectCreator.register('tween', function (config) return this.scene.sys.tweens.create(config); }); -// When registering a factory function 'this' refers to the GameObjectCreator context. - module.exports = Tween; /***/ }), -/***/ 15718: -/***/ ((module) => { +/***/ 45641: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var ArrayRemove = __webpack_require__(66458); +var BaseTween = __webpack_require__(502); +var Class = __webpack_require__(56694); +var Events = __webpack_require__(54272); +var GameObjectCreator = __webpack_require__(99325); +var GameObjectFactory = __webpack_require__(61286); + /** - * Returns a TweenDataConfig object that describes the tween data for a unique property of a unique target. - * A single Tween consists of multiple TweenDatas, depending on how many properties are being changed by the Tween. + * @classdesc + * TODO * - * This is an internal function used by the TweenBuilder and should not be accessed directly, instead, - * Tweens should be created using the GameObjectFactory or GameObjectCreator. + * @class TweenChain + * @memberof Phaser.Tweens + * @extends Phaser.Tweens.BaseTween + * @constructor + * @since 3.60.0 * - * @function Phaser.Tweens.TweenData - * @since 3.0.0 + * @param {(Phaser.Tweens.TweenManager|Phaser.Tweens.TweenChain)} parent - A reference to the Tween Manager, or TweenChain, that owns this TweenChain. + */ +var TweenChain = new Class({ + + Extends: BaseTween, + + initialize: + + function TweenChain (parent) + { + BaseTween.call(this, parent); + + /** + * A reference to the Tween that this TweenChain is currently playing. + * + * @name Phaser.Tweens.TweenChain#currentTween + * @type {Phaser.Tweens.Tween} + * @since 3.60.0 + */ + this.currentTween = null; + + /** + * A reference to the data array index of the currently playing tween. + * + * @name Phaser.Tweens.TweenChain#currentIndex + * @type {number} + * @since 3.60.0 + */ + this.currentIndex = 0; + }, + + /** + * Prepares this TweenChain for playback. + * + * Called automatically by the TweenManager. Should not be called directly. + * + * @method Phaser.Tweens.TweenChain#init + * @fires Phaser.Tweens.Events#TWEEN_ACTIVE + * @since 3.60.0 + * + * @return {this} This TweenChain instance. + */ + init: function () + { + this.loopCounter = (this.loop === -1) ? 999999999999 : this.loop; + + this.setCurrentTween(0); + + if (this.startDelay > 0 && !this.isStartDelayed()) + { + this.setStartDelayState(); + } + else + { + this.setActiveState(); + } + + this.dispatchEvent(Events.TWEEN_ACTIVE, 'onActive'); + + return this; + }, + + /** + * Create a sequence of Tweens, chained to one-another, and add them to this Tween Manager. + * + * The tweens are played in order, from start to finish. You can optionally set the chain + * to repeat as many times as you like. Once the chain has finished playing, or repeating if set, + * all tweens in the chain will be destroyed automatically. To override this, set the 'persists' + * argument to 'true'. + * + * Playback will start immediately unless the _first_ Tween has been configured to be paused. + * + * Please note that Tweens will not manipulate any target property that begins with an underscore. + * + * @method Phaser.Tweens.TweenChain#add + * @since 3.60.0 + * + * @param {Phaser.Types.Tweens.TweenBuilderConfig[]|object[]} tweens - An array of Tween configuration objects for the Tweens in this chain. + * + * @return {this} This TweenChain instance. + */ + add: function (tweens) + { + var newTweens = this.parent.create(tweens); + + if (!Array.isArray(newTweens)) + { + newTweens = [ newTweens ]; + } + + var data = this.data; + + for (var i = 0; i < newTweens.length; i++) + { + var tween = newTweens[i]; + + tween.parent = this; + + data.push(tween.init()); + } + + this.totalData = data.length; + + return this; + }, + + /** + * Removes the given Tween from this Tween Chain. + * + * The removed tween is _not_ destroyed. It is just removed from this Tween Chain. + * + * If the given Tween is currently playing then the chain will automatically move + * to the next tween in the chain. If there are no more tweens, this chain will complete. + * + * @method Phaser.Tweens.TweenChain#remove + * @since 3.60.0 + * @override + * + * @param {Phaser.Tweens.Tween} tween - The Tween to be removed. + * + * @return {this} This Tween Chain instance. + */ + remove: function (tween) + { + // Remove it immediately + ArrayRemove(this.data, tween); + + tween.setRemovedState(); + + if (tween === this.currentTween) + { + this.nextTween(); + } + + this.totalData = this.data.length; + + return this; + }, + + /** + * See if any of the tweens in this Tween Chain is currently acting upon the given target. + * + * @method Phaser.Tweens.TweenChain#hasTarget + * @since 3.60.0 + * + * @param {object} target - The target to check against this TweenChain. + * + * @return {boolean} `true` if the given target is a target of this TweenChain, otherwise `false`. + */ + hasTarget: function (target) + { + var data = this.data; + + for (var i = 0; i < this.totalData; i++) + { + if (data[i].hasTarget(target)) + { + return true; + } + } + + return false; + }, + + /** + * Restarts the TweenChain from the beginning. + * + * If this TweenChain was configured to have a loop, or start delay, those + * are reset to their initial values as well. It will also dispatch the + * `onActive` callback and event again. + * + * @method Phaser.Tweens.TweenChain#restart + * @since 3.60.0 + * + * @return {this} This TweenChain instance. + */ + restart: function () + { + if (this.isDestroyed()) + { + console.warn('Cannot restart destroyed TweenChain', this); + + return this; + } + + if (this.isRemoved()) + { + this.parent.makeActive(this); + } + + this.resetTweens(); + + this.paused = false; + + return this.init(); + }, + + /** + * Resets the given Tween. + * + * It will seek to position 0 and playback will start on the next frame. + * + * @method Phaser.Tweens.TweenChain#reset + * @since 3.60.0 + * + * @param {Phaser.Tweens.Tween} tween - The Tween to be reset. + * + * @return {this} This TweenChain instance. + */ + reset: function (tween) + { + tween.seek(); + + tween.setActiveState(); + + return this; + }, + + /** + * Re-initiases the given Tween and sets it to the Active state. + * + * @method Phaser.Tweens.TweenChain#makeActive + * @since 3.60.0 + * @override + * + * @param {Phaser.Tweens.Tween} tween - The Tween to check. + * + * @return {this} This TweenChain instance. + */ + makeActive: function (tween) + { + tween.init(); + + tween.setActiveState(); + + return this; + }, + + /** + * Internal method that advances to the next state of the TweenChain playback. + * + * @method Phaser.Tweens.TweenChain#nextState + * @fires Phaser.Tweens.Events#TWEEN_COMPLETE + * @fires Phaser.Tweens.Events#TWEEN_LOOP + * @since 3.60.0 + * + * @return {boolean} `true` if this TweenChain has completed, otherwise `false`. + */ + nextState: function () + { + if (this.loopCounter > 0) + { + this.loopCounter--; + + this.resetTweens(); + + if (this.loopDelay > 0) + { + this.countdown = this.loopDelay; + + this.setLoopDelayState(); + } + else + { + this.setActiveState(); + + this.dispatchEvent(Events.TWEEN_LOOP, 'onLoop'); + } + } + else if (this.completeDelay > 0) + { + this.countdown = this.completeDelay; + + this.setCompleteDelayState(); + } + else + { + this.onCompleteHandler(); + + return true; + } + + return false; + }, + + /** + * Starts this TweenChain playing. + * + * You only need to call this method if you have configured this TweenChain to be paused on creation. + * + * If the TweenChain is already playing, calling this method again will have no effect. If you wish to + * restart the chain, use `TweenChain.restart` instead. + * + * Calling this method after the TweenChain has completed will start the chain playing again from the beginning. + * + * @method Phaser.Tweens.TweenChain#play + * @since 3.60.0 + * + * @return {this} This TweenChain instance. + */ + play: function () + { + if (this.isDestroyed()) + { + console.warn('Cannot play destroyed TweenChain', this); + + return this; + } + + if (this.isPendingRemove() || this.isPending()) + { + this.resetTweens(); + } + + this.paused = false; + + if (this.startDelay > 0 && !this.isStartDelayed()) + { + this.setStartDelayState(); + } + else + { + this.setActiveState(); + } + + return this; + }, + + /** + * Internal method that resets all of the Tweens and the current index pointer. + * + * @method Phaser.Tweens.TweenChain#resetTweens + * @since 3.60.0 + */ + resetTweens: function () + { + var data = this.data; + var total = this.totalData; + + for (var i = 0; i < total; i++) + { + data[i].reset(false); + } + + this.currentIndex = 0; + this.currentTween = data[0]; + }, + + /** + * Internal method that advances the TweenChain based on the time values. + * + * @method Phaser.Tweens.TweenChain#update + * @fires Phaser.Tweens.Events#TWEEN_COMPLETE + * @fires Phaser.Tweens.Events#TWEEN_LOOP + * @fires Phaser.Tweens.Events#TWEEN_START + * @since 3.60.0 + * + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + * + * @return {boolean} Returns `true` if this TweenChain has finished and should be removed from the Tween Manager, otherwise returns `false`. + */ + update: function (delta) + { + if (this.isPendingRemove() || this.isDestroyed()) + { + return true; + } + else if (this.isFinished() || this.paused) + { + return false; + } + + // The TweehChain.timeScale is applied within Tween.update, so doesn't need including here + delta *= this.parent.timeScale; + + if (this.isLoopDelayed()) + { + this.updateLoopCountdown(delta); + } + else if (this.isCompleteDelayed()) + { + this.updateCompleteDelay(delta); + } + else if (this.isStartDelayed()) + { + // Reset the delta so we always start progress from zero + delta = this.updateStartCountdown(delta); + } + + var remove = false; + + if (this.isActive() && this.currentTween) + { + if (this.currentTween.update(delta)) + { + // This tween has finshed playback, so move to the next one + if (this.nextTween()) + { + this.nextState(); + } + } + + // if nextState called onCompleteHandler then we're ready to be removed, unless we persist + remove = this.isPendingRemove(); + + if (remove && this.persist) + { + this.setFinishedState(); + + remove = false; + } + } + + return remove; + }, + + /** + * Immediately advances to the next Tween in the chain. + * + * This is typically called internally, but can be used if you need to + * advance playback for some reason. + * + * @method Phaser.Tweens.TweenChain#nextTween + * @since 3.60.0 + * + * @return {boolean} `true` if there are no more Tweens in the chain, otherwise `false`. + */ + nextTween: function () + { + this.currentIndex++; + + if (this.currentIndex === this.totalData) + { + return true; + } + else + { + this.setCurrentTween(this.currentIndex); + } + + return false; + }, + + /** + * Sets the current active Tween to the given index, based on its + * entry in the TweenChain data array. + * + * @method Phaser.Tweens.TweenChain#setCurrentTween + * @since 3.60.0 + * + * @param {number} index - The index of the Tween to be made current. + */ + setCurrentTween: function (index) + { + this.currentIndex = index; + + this.currentTween = this.data[index]; + + this.currentTween.setActiveState(); + + this.currentTween.dispatchEvent(Events.TWEEN_ACTIVE, 'onActive'); + }, + + /** + * Internal method that will emit a TweenChain based Event and invoke the given callback. + * + * @method Phaser.Tweens.TweenChain#dispatchEvent + * @since 3.60.0 + * + * @param {Phaser.Types.Tweens.Event} event - The Event to be dispatched. + * @param {Phaser.Types.Tweens.TweenCallbackTypes} [callback] - The name of the callback to be invoked. Can be `null` or `undefined` to skip invocation. + */ + dispatchEvent: function (event, callback) + { + this.emit(event, this); + + var handler = this.callbacks[callback]; + + if (handler) + { + handler.func.apply(handler.scope, [ this ].concat(handler.params)); + } + }, + + /** + * Immediately destroys this TweenChain, nulling of all its references. + * + * @method Phaser.Tweens.TweenChain#destroy + * @since 3.60.0 + */ + destroy: function () + { + BaseTween.prototype.destroy.call(this); + + this.currentTween = null; + } + +}); + +/** + * Creates a new TweenChain object and adds it to the Tween Manager. * - * @param {any} target - The target to tween. - * @param {number} index - The target index within the Tween targets array. + * Note: This method will only be available if Tweens have been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectFactory#tweenchain + * @since 3.60.0 + * + * @param {Phaser.Types.Tweens.TweenBuilderConfig|object} config - The TweenChain configuration. + * + * @return {Phaser.Tweens.TweenChain} The TweenChain that was created. + */ +GameObjectFactory.register('tweenchain', function (config) +{ + return this.scene.sys.tweens.chain(config); +}); + +/** + * Creates a new TweenChain object and returns it, without adding it to the Tween Manager. + * + * Note: This method will only be available if Tweens have been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectCreator#tweenchain + * @since 3.60.0 + * + * @param {Phaser.Types.Tweens.TweenBuilderConfig|object} config - The TweenChain configuration. + * + * @return {Phaser.Tweens.TweenChain} The TweenChain that was created. + */ +GameObjectCreator.register('tweenchain', function (config) +{ + return this.scene.sys.tweens.create(config); +}); + +module.exports = TweenChain; + + +/***/ }), + +/***/ 15718: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BaseTweenData = __webpack_require__(65521); +var Class = __webpack_require__(56694); +var Events = __webpack_require__(54272); + +/** + * @classdesc + * The TweenData is a class that contains a single target and property that is being tweened. + * + * Tweens create TweenData instances when they are created, with one TweenData instance per + * target, per property. A Tween can own multiple TweenData instances, but a TweenData only + * ever belongs to a single Tween. + * + * You should not typically create these yourself, but rather use the TweenBuilder, + * or the `Tween.add` method. + * + * Prior to Phaser 3.60 the TweenData was just an object, but was refactored to a class, + * to make it responsible for its own state and updating. + * + * @class TweenData + * @memberof Phaser.Tweens + * @extends Phaser.Tweens.BaseTweenData + * @constructor + * @since 3.60.0 + * + * @param {Phaser.Tweens.Tween} tween - The tween this TweenData instance belongs to. + * @param {number} targetIndex - The target index within the Tween targets array. * @param {string} key - The property of the target to tween. - * @param {function} getEnd - What the property will be at the END of the Tween. - * @param {function} getStart - What the property will be at the START of the Tween. - * @param {?function} getActive - If not null, is invoked _immediately_ as soon as the TweenData is running, and is set on the target property. + * @param {Phaser.Types.Tweens.GetEndCallback} getEnd - What the property will be at the END of the Tween. + * @param {Phaser.Types.Tweens.GetStartCallback} getStart - What the property will be at the START of the Tween. + * @param {?Phaser.Types.Tweens.GetActiveCallback} getActive - If not null, is invoked _immediately_ as soon as the TweenData is running, and is set on the target property. * @param {function} ease - The ease function this tween uses. - * @param {number} delay - Time in ms/frames before tween will start. - * @param {number} duration - Duration of the tween in ms/frames. + * @param {function} delay - Function that returns the time in ms/frames before tween will start. + * @param {number} duration - The duration of the tween in ms/frames. * @param {boolean} yoyo - Determines whether the tween should return back to its start value after hold has expired. - * @param {number} hold - Time in ms/frames the tween will pause before repeating or returning to its starting value if yoyo is set to true. - * @param {number} repeat - Number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. - * @param {number} repeatDelay - Time in ms/frames before the repeat will start. + * @param {number} hold - Function that returns the time in ms/frames the tween will pause before repeating or returning to its starting value if yoyo is set to true. + * @param {number} repeat - Function that returns the number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. + * @param {number} repeatDelay - Function that returns the time in ms/frames before the repeat will start. * @param {boolean} flipX - Should toggleFlipX be called when yoyo or repeat happens? * @param {boolean} flipY - Should toggleFlipY be called when yoyo or repeat happens? - * - * @return {Phaser.Types.Tweens.TweenDataConfig} The config object describing this TweenData. + * @param {?function} interpolation - The interpolation function to be used for arrays of data. Defaults to 'null'. + * @param {?number[]} interpolationData - The array of interpolation data to be set. Defaults to 'null'. */ -var TweenData = function (target, index, key, getEnd, getStart, getActive, ease, delay, duration, yoyo, hold, repeat, repeatDelay, flipX, flipY) -{ - return { +var TweenData = new Class({ - // The target to tween - target: target, + Extends: BaseTweenData, - // The index of the target within the tween targets array - index: index, + initialize: - // The property of the target to tween - key: key, + function TweenData (tween, targetIndex, key, getEnd, getStart, getActive, ease, delay, duration, yoyo, hold, repeat, repeatDelay, flipX, flipY, interpolation, interpolationData) + { + BaseTweenData.call(this, tween, targetIndex, delay, duration, yoyo, hold, repeat, repeatDelay, flipX, flipY); - // What to set the property to the moment the TweenData is invoked. - getActiveValue: getActive, + /** + * The property of the target to be tweened. + * + * @name Phaser.Tweens.TweenData#key + * @type {string} + * @since 3.60.0 + */ + this.key = key; - // The returned value sets what the property will be at the END of the Tween. - getEndValue: getEnd, + /** + * A function that returns what to set the target property to, + * the moment the TweenData is invoked. + * + * This is called when this TweenData is inititalised or reset. + * + * @name Phaser.Tweens.TweenData#getActiveValue + * @type {?Phaser.Types.Tweens.GetActiveCallback} + * @since 3.60.0 + */ + this.getActiveValue = getActive; - // The returned value sets what the property will be at the START of the Tween. - getStartValue: getStart, + /** + * A function that returns what to set the target property to + * at the end of the tween. + * + * This is called when the tween starts playing, after any initial + * start delay, or if the tween is reset, or is set to repeat. + * + * @name Phaser.Tweens.TweenData#getEndValue + * @type {Phaser.Types.Tweens.GetEndCallback} + * @since 3.60.0 + */ + this.getEndValue = getEnd; - // The ease function this tween uses. - ease: ease, + /** + * A function that returns what to set the target property to + * at the start of the tween. + * + * This is called when the tween starts playing, after any initial + * start delay, or if the tween is reset, or is set to repeat. + * + * @name Phaser.Tweens.TweenData#getStartValue + * @type {Phaser.Types.Tweens.GetStartCallback} + * @since 3.60.0 + */ + this.getStartValue = getStart; - // Duration of the tween in ms/frames, excludes time for yoyo or repeats. - duration: 0, + /** + * The ease function this Tween uses to calculate the target value. + * + * @name Phaser.Tweens.TweenData#ease + * @type {function} + * @since 3.60.0 + */ + this.ease = ease; - // The total calculated duration of this TweenData (based on duration, repeat, delay and yoyo) - totalDuration: 0, + /** + * The target's starting value, as returned by `getStartValue`. + * + * @name Phaser.Tweens.TweenData#start + * @type {number} + * @since 3.60.0 + */ + this.start = 0; - // Time in ms/frames before tween will start. - delay: 0, + /** + * The target value from the previous step. + * + * @name Phaser.Tweens.TweenData#previous + * @type {number} + * @since 3.60.0 + */ + this.previous = 0; - // Cause the tween to return back to its start value after hold has expired. - yoyo: yoyo, + /** + * The target's current value, as recorded in the most recent step. + * + * @name Phaser.Tweens.TweenData#current + * @type {number} + * @since 3.60.0 + */ + this.current = 0; - // Time in ms/frames the tween will pause before running the yoyo or starting a repeat. - hold: 0, + /** + * The target's ending value, as returned by `getEndValue`. + * + * @name Phaser.Tweens.TweenData#end + * @type {number} + * @since 3.60.0 + */ + this.end = 0; - // Number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. - repeat: 0, + /** + * The interpolation function to be used for arrays of data. + * + * @name Phaser.Tweens.TweenData#interpolation + * @type {?function} + * @default null + * @since 3.60.0 + */ + this.interpolation = interpolation; - // Time in ms/frames before the repeat will start. - repeatDelay: 0, + /** + * The array of data to interpolate, if interpolation is being used. + * + * @name Phaser.Tweens.TweenData#interpolationData + * @type {?number[]} + * @since 3.60.0 + */ + this.interpolationData = interpolationData; + }, - // Automatically call toggleFlipX when the TweenData yoyos or repeats - flipX: flipX, + /** + * Prepares this TweenData for playback. + * + * Called automatically by the parent Tween. Should not be called directly. + * + * @method Phaser.Tweens.TweenData#init + * @since 3.60.0 + * + * @param {boolean} [isSeek=false] - Is the parent Tween currently seeking? + */ + init: function (isSeek) + { + var tween = this.tween; + var totalTargets = tween.totalTargets; - // Automatically call toggleFlipY when the TweenData yoyos or repeats - flipY: flipY, + var targetIndex = this.targetIndex; + var target = tween.targets[targetIndex]; + var key = this.key; - // Between 0 and 1 showing completion of this TweenData. - progress: 0, + // Function signature: target, key, value, index, total, tween - // Delta counter. - elapsed: 0, + this.delay = this.getDelay(target, key, 0, targetIndex, totalTargets, tween); - // How many repeats are left to run? - repeatCounter: 0, + this.repeatCounter = (this.repeat === -1) ? 999999999999 : this.repeat; - // Ease Value Data: + this.setPendingRenderState(); - start: 0, - previous: 0, - current: 0, - end: 0, + // calcDuration: - // Time Durations - t1: 0, - t2: 0, + // Set t1 (duration + hold + yoyo) + var t1 = this.duration + this.hold; - // LoadValue generation functions - gen: { - delay: delay, - duration: duration, - hold: hold, - repeat: repeat, - repeatDelay: repeatDelay - }, + if (this.yoyo) + { + t1 += this.duration; + } - // TWEEN_CONST.CREATED - state: 0 - }; -}; + // Set t2 (repeatDelay + duration + hold + yoyo) + var t2 = t1 + this.repeatDelay; + + // Total Duration + this.totalDuration = this.delay + t1; + + if (this.repeat === -1) + { + this.totalDuration += (t2 * 999999999999); + } + else if (this.repeat > 0) + { + this.totalDuration += (t2 * this.repeat); + } + + if (this.totalDuration > tween.duration) + { + // Set the longest duration in the parent Tween + tween.duration = this.totalDuration; + } + + if (this.delay < tween.startDelay) + { + tween.startDelay = this.delay; + } + + // seek specific: + if (isSeek) + { + this.current = this.start; + this.progress = 0; + this.elapsed = 0; + + this.setPlayingForwardState(); + + this.update(0); + } + + if (this.delay > 0) + { + this.elapsed = this.delay; + + this.setDelayState(); + } + + if (!isSeek && this.getActiveValue) + { + target[key] = this.getActiveValue(target, key, this.start); + } + }, + + /** + * Internal method that advances this TweenData based on the delta value given. + * + * @method Phaser.Tweens.TweenData#update + * @fires Phaser.Tweens.Events#TWEEN_UPDATE + * @fires Phaser.Tweens.Events#TWEEN_REPEAT + * @since 3.60.0 + * + * @param {number} delta - The elapsed delta time in ms. + * + * @return {boolean} `true` if this TweenData is still playing, or `false` if it has finished entirely. + */ + update: function (delta) + { + var tween = this.tween; + var totalTargets = tween.totalTargets; + + var targetIndex = this.targetIndex; + var target = tween.targets[targetIndex]; + var key = this.key; + + // Bail out if we don't have a target to act upon + if (!target) + { + this.setCompleteState(); + + return false; + } + + if (this.isCountdown) + { + this.elapsed -= delta; + + if (this.elapsed <= 0) + { + this.elapsed = 0; + + delta = 0; + + if (this.isDelayed()) + { + this.setPendingRenderState(); + } + else if (this.isRepeating()) + { + this.setPlayingForwardState(); + + this.dispatchEvent(Events.TWEEN_REPEAT, 'onRepeat'); + } + else if (this.isHolding()) + { + this.setStateFromEnd(0); + } + } + } + + // All of the above have the ability to change the state, so put this in its own check + + if (this.isPendingRender()) + { + this.start = this.getStartValue(target, key, target[key], targetIndex, totalTargets, tween); + + this.end = this.getEndValue(target, key, this.start, targetIndex, totalTargets, tween); + + this.current = this.start; + + target[key] = this.start; + + this.setPlayingForwardState(); + + return true; + } + + var forward = this.isPlayingForward(); + var backward = this.isPlayingBackward(); + + if (forward || backward) + { + var elapsed = this.elapsed; + var duration = this.duration; + var diff = 0; + var complete = false; + + elapsed += delta; + + if (elapsed >= duration) + { + diff = elapsed - duration; + elapsed = duration; + complete = true; + } + + var progress = elapsed / duration; + + this.elapsed = elapsed; + this.progress = progress; + this.previous = this.current; + + if (complete) + { + if (forward) + { + this.current = this.end; + + target[key] = this.end; + + if (this.hold > 0 && this.repeatCounter > 0) + { + this.elapsed = this.hold; + + this.setHoldState(); + } + else + { + this.setStateFromEnd(diff); + } + } + else + { + this.current = this.start; + + target[key] = this.start; + + this.setStateFromStart(diff); + } + } + else + { + if (!forward) + { + progress = 1 - progress; + } + + var v = this.ease(progress); + + if (this.interpolation) + { + this.current = this.interpolation(this.interpolationData, v); + } + else + { + this.current = this.start + ((this.end - this.start) * v); + } + + target[key] = this.current; + } + + this.dispatchEvent(Events.TWEEN_UPDATE, 'onUpdate'); + } + + // Return TRUE if this TweenData still playing, otherwise FALSE + return !this.isComplete(); + }, + + /** + * Internal method that resets this Tween Data, including the progress and elapsed values. + * + * @method Phaser.Tweens.TweenData#reset + * @since 3.60.0 + * + * @param {boolean} resetFromLoop - Has this method been called as part of a loop? + */ + reset: function (resetFromLoop) + { + var tween = this.tween; + var totalTargets = tween.totalTargets; + + var targetIndex = this.targetIndex; + var target = tween.targets[targetIndex]; + var key = this.key; + + this.progress = 0; + this.elapsed = 0; + + this.repeatCounter = (this.repeat === -1) ? 999999999999 : this.repeat; + + if (resetFromLoop) + { + this.start = this.getStartValue(target, key, this.start, targetIndex, totalTargets, tween); + + this.end = this.getEndValue(target, key, this.end, targetIndex, totalTargets, tween); + + this.current = this.start; + + this.setPlayingForwardState(); + } + else + { + this.setPendingRenderState(); + } + + if (this.delay > 0) + { + this.elapsed = this.delay; + + this.setDelayState(); + } + + if (this.getActiveValue) + { + target[key] = this.getActiveValue(target, key, this.start); + } + }, + + /** + * Internal method that will emit a TweenData based Event on the + * parent Tween and also invoke the given callback, if provided. + * + * @method Phaser.Tweens.TweenData#dispatchEvent + * @since 3.60.0 + * + * @param {Phaser.Types.Tweens.Event} event - The Event to be dispatched. + * @param {Phaser.Types.Tweens.TweenCallbackTypes} [callback] - The name of the callback to be invoked. Can be `null` or `undefined` to skip invocation. + */ + dispatchEvent: function (event, callback) + { + var tween = this.tween; + + if (!tween.isSeeking) + { + var target = tween.targets[this.targetIndex]; + var key = this.key; + + var current = this.current; + var previous = this.previoius; + + tween.emit(event, tween, key, target, current, previous); + + var handler = tween.callbacks[callback]; + + if (handler) + { + handler.func.apply(handler.scope, [ tween, target, key, current, previous ].concat(handler.params)); + } + } + }, + + /** + * Internal method used as part of the playback process that checks if this + * TweenData should yoyo, repeat, or has completed. + * + * @method Phaser.Tweens.TweenData#setStateFromEnd + * @fires Phaser.Tweens.Events#TWEEN_REPEAT + * @fires Phaser.Tweens.Events#TWEEN_YOYO + * @since 3.60.0 + * + * @param {number} diff - Any extra time that needs to be accounted for in the elapsed and progress values. + */ + setStateFromEnd: function (diff) + { + if (this.yoyo) + { + this.onRepeat(diff, true, true); + } + else if (this.repeatCounter > 0) + { + this.onRepeat(diff, true); + } + else + { + this.setCompleteState(); + } + }, + + /** + * Internal method used as part of the playback process that checks if this + * TweenData should repeat or has completed. + * + * @method Phaser.Tweens.TweenData#setStateFromStart + * @fires Phaser.Tweens.Events#TWEEN_REPEAT + * @since 3.60.0 + * + * @param {number} diff - Any extra time that needs to be accounted for in the elapsed and progress values. + */ + setStateFromStart: function (diff) + { + if (this.repeatCounter > 0) + { + this.onRepeat(diff, false); + } + else + { + this.setCompleteState(); + } + }, + + /** + * Internal method that handles repeating or yoyo'ing this TweenData. + * + * Called automatically by `setStateFromStart` and `setStateFromEnd`. + * + * @method Phaser.Tweens.TweenData#onRepeat + * @fires Phaser.Tweens.Events#TWEEN_REPEAT + * @fires Phaser.Tweens.Events#TWEEN_YOYO + * @since 3.60.0 + * + * @param {number} diff - Any extra time that needs to be accounted for in the elapsed and progress values. + * @param {boolean} setStart - Set the TweenData start values? + * @param {boolean} [isYoyo=false] - Is this call a Yoyo check? + */ + onRepeat: function (diff, setStart, isYoyo) + { + if (isYoyo === undefined) { isYoyo = false; } + + var tween = this.tween; + var totalTargets = tween.totalTargets; + + var targetIndex = this.targetIndex; + var target = tween.targets[targetIndex]; + var key = this.key; + + // Account for any extra time we got from the previous frame + this.elapsed = diff; + this.progress = diff / this.duration; + + if (this.flipX) + { + target.toggleFlipX(); + } + + if (this.flipY) + { + target.toggleFlipY(); + } + + if (setStart || isYoyo) + { + this.start = this.getStartValue(target, key, this.start, targetIndex, totalTargets, tween); + } + + if (isYoyo) + { + this.setPlayingBackwardState(); + + this.dispatchEvent(Events.TWEEN_YOYO, 'onYoyo'); + + return; + } + + this.repeatCounter--; + + this.end = this.getEndValue(target, key, this.start, targetIndex, totalTargets, tween); + + // Delay? + if (this.repeatDelay > 0) + { + this.elapsed = this.repeatDelay - diff; + + this.current = this.start; + + target[key] = this.current; + + this.setRepeatState(); + } + else + { + this.setPlayingForwardState(); + + this.dispatchEvent(Events.TWEEN_REPEAT, 'onRepeat'); + } + }, + + /** + * Immediately destroys this TweenData, nulling of all its references. + * + * @method Phaser.Tweens.TweenData#destroy + * @since 3.60.0 + */ + destroy: function () + { + BaseTweenData.prototype.destroy.call(this); + + this.getActiveValue = null; + this.getEndValue = null; + this.getStartValue = null; + this.ease = null; + } + +}); module.exports = TweenData; +/***/ }), + +/***/ 96490: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BaseTweenData = __webpack_require__(65521); +var Class = __webpack_require__(56694); +var Events = __webpack_require__(54272); + +/** + * @classdesc + * The TweenFrameData is a class that contains a single target that will change the texture frame + * and the conclusion of the tween. + * + * TweenFrameData instances are typically created by the TweenBuilder automatically, when it + * detects the prescence of a 'texture' property as the key being tweened. + * + * A Tween can own multiple TweenFrameData instances, but a TweenFrameData only + * ever belongs to a single Tween. + * + * You should not typically create these yourself, but rather use the TweenBuilder, + * or the `Tween.addFrame` method. + * + * @class TweenFrameData + * @memberof Phaser.Tweens + * @extends Phaser.Tweens.BaseTweenData + * @constructor + * @since 3.60.0 + * + * @param {Phaser.Tweens.Tween} tween - The tween this TweenData instance belongs to. + * @param {number} targetIndex - The target index within the Tween targets array. + * @param {string} texture - The texture key to set at the end of this tween. + * @param {(string|number)} frame - The texture frame to set at the end of this tween. + * @param {function} delay - Function that returns the time in ms/frames before tween will start. + * @param {number} duration - The duration of the tween in ms/frames. + * @param {number} hold - Function that returns the time in ms/frames the tween will pause before repeating or returning to its starting value if yoyo is set to true. + * @param {number} repeat - Function that returns the number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. + * @param {number} repeatDelay - Function that returns the time in ms/frames before the repeat will start. + * @param {boolean} flipX - Should toggleFlipX be called when yoyo or repeat happens? + * @param {boolean} flipY - Should toggleFlipY be called when yoyo or repeat happens? + */ +var TweenFrameData = new Class({ + + Extends: BaseTweenData, + + initialize: + + function TweenFrameData (tween, targetIndex, texture, frame, delay, duration, hold, repeat, repeatDelay, flipX, flipY) + { + BaseTweenData.call(this, tween, targetIndex, delay, duration, false, hold, repeat, repeatDelay, flipX, flipY); + + /** + * The texture to be set at the start of the tween. + * + * @name Phaser.Tweens.TweenFrameData#startTexture + * @type {string} + * @since 3.60.0 + */ + this.startTexture = null; + + /** + * The texture to be set at the end of the tween. + * + * @name Phaser.Tweens.TweenFrameData#endTexture + * @type {string} + * @since 3.60.0 + */ + this.endTexture = texture; + + /** + * The frame to be set at the start of the tween. + * + * @name Phaser.Tweens.TweenFrameData#startFrame + * @type {(string|number)} + * @since 3.60.0 + */ + this.startFrame = null; + + /** + * The frame to be set at the end of the tween. + * + * @name Phaser.Tweens.TweenFrameData#endFrame + * @type {(string|number)} + * @since 3.60.0 + */ + this.endFrame = frame; + + /** + * Will the Tween ease back to its starting values, after reaching the end + * and any `hold` value that may be set? + * + * @name Phaser.Tweens.TweenFrameData#yoyo + * @type {boolean} + * @since 3.60.0 + */ + this.yoyo = (repeat > 0) ? true : false; + }, + + /** + * Prepares this TweenData for playback. + * + * Called automatically by the parent Tween. Should not be called directly. + * + * @method Phaser.Tweens.TweenFrameData#init + * @since 3.60.0 + * + * @param {boolean} [isSeek=false] - Is the parent Tween currently seeking? + */ + init: function (isSeek) + { + var tween = this.tween; + var totalTargets = tween.totalTargets; + + var targetIndex = this.targetIndex; + var target = tween.targets[targetIndex]; + + // Function signature: target, key, value, index, total, tween + + this.delay = this.getDelay(target, 'texture', 0, targetIndex, totalTargets, tween); + + this.repeatCounter = (this.repeat === -1) ? 999999999999 : this.repeat; + + this.setPendingRenderState(); + + // calcDuration: + + // Set t1 (duration + hold + yoyo) + var t1 = this.duration + this.hold; + + if (this.yoyo) + { + t1 += this.duration; + } + + // Set t2 (repeatDelay + duration + hold + yoyo) + var t2 = t1 + this.repeatDelay; + + // Total Duration + this.totalDuration = this.delay + t1; + + if (this.repeat === -1) + { + this.totalDuration += (t2 * 999999999999); + } + else if (this.repeat > 0) + { + this.totalDuration += (t2 * this.repeat); + } + + if (this.totalDuration > tween.duration) + { + // Set the longest duration in the parent Tween + tween.duration = this.totalDuration; + } + + if (this.delay < tween.startDelay) + { + tween.startDelay = this.delay; + } + + if (!this.startTexture) + { + this.startTexture = target.texture.key; + this.startFrame = target.frame.name; + } + + // seek specific: + if (isSeek) + { + this.progress = 0; + this.elapsed = 0; + + this.setPlayingForwardState(); + + this.update(0); + } + + if (this.delay > 0) + { + this.elapsed = this.delay; + + this.setDelayState(); + } + }, + + /** + * Internal method that advances this TweenData based on the delta value given. + * + * @method Phaser.Tweens.TweenFrameData#update + * @fires Phaser.Tweens.Events#TWEEN_UPDATE + * @fires Phaser.Tweens.Events#TWEEN_REPEAT + * @since 3.60.0 + * + * @param {number} delta - The elapsed delta time in ms. + * + * @return {boolean} `true` if this TweenData is still playing, or `false` if it has finished entirely. + */ + update: function (delta) + { + var tween = this.tween; + var targetIndex = this.targetIndex; + var target = tween.targets[targetIndex]; + + // Bail out if we don't have a target to act upon + if (!target) + { + this.setCompleteState(); + + return false; + } + + if (this.isCountdown) + { + this.elapsed -= delta; + + if (this.elapsed <= 0) + { + this.elapsed = 0; + + delta = 0; + + if (this.isDelayed()) + { + this.setPendingRenderState(); + } + else if (this.isRepeating()) + { + this.setPlayingForwardState(); + + this.dispatchEvent(Events.TWEEN_REPEAT, 'onRepeat'); + } + else if (this.isHolding()) + { + this.setStateFromEnd(0); + } + } + } + + // All of the above have the ability to change the state, so put this in its own check + + if (this.isPendingRender()) + { + if (this.startTexture) + { + target.setTexture(this.startTexture, this.startFrame); + } + + this.setPlayingForwardState(); + + return true; + } + + var forward = this.isPlayingForward(); + var backward = this.isPlayingBackward(); + + if (forward || backward) + { + var elapsed = this.elapsed; + var duration = this.duration; + var diff = 0; + var complete = false; + + elapsed += delta; + + if (elapsed >= duration) + { + diff = elapsed - duration; + elapsed = duration; + complete = true; + } + + var progress = elapsed / duration; + + this.elapsed = elapsed; + this.progress = progress; + + if (complete) + { + if (forward) + { + target.setTexture(this.endTexture, this.endFrame); + + if (this.hold > 0 && this.repeatCounter > 0) + { + this.elapsed = this.hold; + + this.setHoldState(); + } + else + { + this.setStateFromEnd(diff); + } + } + else + { + target.setTexture(this.startTexture, this.startFrame); + + this.setStateFromStart(diff); + } + } + + this.dispatchEvent(Events.TWEEN_UPDATE, 'onUpdate'); + } + + // Return TRUE if this TweenData still playing, otherwise FALSE + return !this.isComplete(); + }, + + /** + * Internal method that resets this Tween Data, including the progress and elapsed values. + * + * @method Phaser.Tweens.TweenFrameData#reset + * @since 3.60.0 + * + * @param {boolean} resetFromLoop - Has this method been called as part of a loop? + */ + reset: function (resetFromLoop) + { + this.progress = 0; + this.elapsed = 0; + + this.repeatCounter = (this.repeat === -1) ? 999999999999 : this.repeat; + + if (resetFromLoop) + { + this.setPlayingForwardState(); + } + else + { + this.setPendingRenderState(); + } + + if (this.delay > 0) + { + this.elapsed = this.delay; + + this.setDelayState(); + } + }, + + /** + * Internal method that will emit a TweenData based Event on the + * parent Tween and also invoke the given callback, if provided. + * + * @method Phaser.Tweens.TweenFrameData#dispatchEvent + * @since 3.60.0 + * + * @param {Phaser.Types.Tweens.Event} event - The Event to be dispatched. + * @param {Phaser.Types.Tweens.TweenCallbackTypes} [callback] - The name of the callback to be invoked. Can be `null` or `undefined` to skip invocation. + */ + dispatchEvent: function (event, callback) + { + var tween = this.tween; + + if (!tween.isSeeking) + { + var target = tween.targets[this.targetIndex]; + + tween.emit(event, tween, 'texture', target); + + var handler = tween.callbacks[callback]; + + if (handler) + { + handler.func.apply(handler.scope, [ tween, target, 'texture' ].concat(handler.params)); + } + } + }, + + /** + * Internal method used as part of the playback process that checks if this + * TweenData should yoyo, repeat, or has completed. + * + * @method Phaser.Tweens.TweenFrameData#setStateFromEnd + * @fires Phaser.Tweens.Events#TWEEN_REPEAT + * @fires Phaser.Tweens.Events#TWEEN_YOYO + * @since 3.60.0 + * + * @param {number} diff - Any extra time that needs to be accounted for in the elapsed and progress values. + */ + setStateFromEnd: function (diff) + { + if (this.repeatCounter > 0) + { + this.onRepeat(diff, true); + } + else + { + this.setCompleteState(); + } + }, + + /** + * Internal method used as part of the playback process that checks if this + * TweenData should repeat or has completed. + * + * @method Phaser.Tweens.TweenFrameData#setStateFromStart + * @fires Phaser.Tweens.Events#TWEEN_REPEAT + * @since 3.60.0 + * + * @param {number} diff - Any extra time that needs to be accounted for in the elapsed and progress values. + */ + setStateFromStart: function (diff) + { + if (this.repeatCounter > 0) + { + this.onRepeat(diff, false); + } + else + { + this.setCompleteState(); + } + }, + + /** + * Internal method that handles repeating or yoyo'ing this TweenData. + * + * Called automatically by `setStateFromStart` and `setStateFromEnd`. + * + * @method Phaser.Tweens.TweenFrameData#onRepeat + * @fires Phaser.Tweens.Events#TWEEN_REPEAT + * @fires Phaser.Tweens.Events#TWEEN_YOYO + * @since 3.60.0 + * + * @param {number} diff - Any extra time that needs to be accounted for in the elapsed and progress values. + * @param {boolean} [isYoyo=false] - Is this call a Yoyo check? + */ + onRepeat: function (diff, isYoyo) + { + if (isYoyo === undefined) { isYoyo = false; } + + var tween = this.tween; + + var targetIndex = this.targetIndex; + var target = tween.targets[targetIndex]; + + // Account for any extra time we got from the previous frame + this.elapsed = diff; + this.progress = diff / this.duration; + + if (this.flipX) + { + target.toggleFlipX(); + } + + if (this.flipY) + { + target.toggleFlipY(); + } + + if (isYoyo) + { + this.setPlayingBackwardState(); + + this.dispatchEvent(Events.TWEEN_YOYO, 'onYoyo'); + + return; + } + + this.repeatCounter--; + + // Delay? + if (this.repeatDelay > 0) + { + this.elapsed = this.repeatDelay - diff; + + this.setRepeatState(); + } + else + { + this.setPlayingForwardState(); + + this.dispatchEvent(Events.TWEEN_REPEAT, 'onRepeat'); + } + } + +}); + +module.exports = TweenFrameData; + + /***/ }), /***/ 55303: @@ -217297,98 +220130,108 @@ module.exports = TweenData; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +/** + * Phaser Tween States. + * + * @namespace Phaser.Tweens.States + * @memberof Phaser.Tweens + * @since 3.60.0 + */ + +/** + * Phaser Tween state constants. + * + * @typedef {Phaser.Tweens.States} Phaser.Tweens.StateType + * @memberof Phaser.Tweens + * @since 3.60.0 + */ + var TWEEN_CONST = { /** * TweenData state. - * - * @name Phaser.Tweens.CREATED + * + * @name Phaser.Tweens.States.CREATED * @type {number} + * @const * @since 3.0.0 */ CREATED: 0, - /** - * TweenData state. - * - * @name Phaser.Tweens.INIT - * @type {number} - * @since 3.0.0 - */ - INIT: 1, + // 1 used to be INIT prior to 3.60 /** * TweenData state. - * - * @name Phaser.Tweens.DELAY + * + * @name Phaser.Tweens.States.DELAY * @type {number} + * @const * @since 3.0.0 */ DELAY: 2, - /** - * TweenData state. - * - * @name Phaser.Tweens.OFFSET_DELAY - * @type {number} - * @since 3.0.0 - */ - OFFSET_DELAY: 3, + // 3 used to be OFFSET_DELAY prior to 3.60 /** * TweenData state. - * - * @name Phaser.Tweens.PENDING_RENDER + * + * @name Phaser.Tweens.States.PENDING_RENDER * @type {number} + * @const * @since 3.0.0 */ PENDING_RENDER: 4, /** * TweenData state. - * - * @name Phaser.Tweens.PLAYING_FORWARD + * + * @name Phaser.Tweens.States.PLAYING_FORWARD * @type {number} + * @const * @since 3.0.0 */ PLAYING_FORWARD: 5, /** * TweenData state. - * - * @name Phaser.Tweens.PLAYING_BACKWARD + * + * @name Phaser.Tweens.States.PLAYING_BACKWARD * @type {number} + * @const * @since 3.0.0 */ PLAYING_BACKWARD: 6, /** * TweenData state. - * - * @name Phaser.Tweens.HOLD_DELAY + * + * @name Phaser.Tweens.States.HOLD_DELAY * @type {number} + * @const * @since 3.0.0 */ HOLD_DELAY: 7, /** * TweenData state. - * - * @name Phaser.Tweens.REPEAT_DELAY + * + * @name Phaser.Tweens.States.REPEAT_DELAY * @type {number} + * @const * @since 3.0.0 */ REPEAT_DELAY: 8, /** * TweenData state. - * - * @name Phaser.Tweens.COMPLETE + * + * @name Phaser.Tweens.States.COMPLETE * @type {number} + * @const * @since 3.0.0 */ COMPLETE: 9, @@ -217396,67 +220239,97 @@ var TWEEN_CONST = { // Tween specific (starts from 20 to cleanly allow extra TweenData consts in the future) /** - * Tween state. - * - * @name Phaser.Tweens.PENDING_ADD + * Tween state. The Tween has been created but has not yet been added to the Tween Manager. + * + * @name Phaser.Tweens.States.PENDING * @type {number} + * @const * @since 3.0.0 */ - PENDING_ADD: 20, + PENDING: 20, /** - * Tween state. - * - * @name Phaser.Tweens.PAUSED + * Tween state. The Tween is active within the Tween Manager. This means it is either playing, + * or was playing and is currently paused, but in both cases it's still being processed by + * the Tween Manager, so is considered 'active'. + * + * @name Phaser.Tweens.States.ACTIVE * @type {number} + * @const * @since 3.0.0 */ - PAUSED: 21, + ACTIVE: 21, /** - * Tween state. - * - * @name Phaser.Tweens.LOOP_DELAY + * Tween state. The Tween is waiting for a loop countdown to elapse. + * + * @name Phaser.Tweens.States.LOOP_DELAY * @type {number} + * @const * @since 3.0.0 */ LOOP_DELAY: 22, /** - * Tween state. - * - * @name Phaser.Tweens.ACTIVE + * Tween state. The Tween is waiting for a complete delay to elapse. + * + * @name Phaser.Tweens.States.COMPLETE_DELAY * @type {number} + * @const * @since 3.0.0 */ - ACTIVE: 23, + COMPLETE_DELAY: 23, /** - * Tween state. - * - * @name Phaser.Tweens.COMPLETE_DELAY + * Tween state. The Tween is waiting for a starting delay to elapse. + * + * @name Phaser.Tweens.States.START_DELAY * @type {number} + * @const * @since 3.0.0 */ - COMPLETE_DELAY: 24, + START_DELAY: 24, /** - * Tween state. - * - * @name Phaser.Tweens.PENDING_REMOVE + * Tween state. The Tween has finished playback and is waiting to be removed from the Tween Manager. + * + * @name Phaser.Tweens.States.PENDING_REMOVE * @type {number} + * @const * @since 3.0.0 */ PENDING_REMOVE: 25, /** - * Tween state. - * - * @name Phaser.Tweens.REMOVED + * Tween state. The Tween has been removed from the Tween Manager. + * + * @name Phaser.Tweens.States.REMOVED * @type {number} + * @const * @since 3.0.0 */ - REMOVED: 26 + REMOVED: 26, + + /** + * Tween state. The Tween has finished playback but was flagged as 'persistent' during creation, + * so will not be automatically removed by the Tween Manager. + * + * @name Phaser.Tweens.States.FINISHED + * @type {number} + * @const + * @since 3.60.0 + */ + FINISHED: 27, + + /** + * Tween state. The Tween has been destroyed and can no longer be played by a Tween Manager. + * + * @name Phaser.Tweens.States.DESTROYED + * @type {number} + * @const + * @since 3.60.0 + */ + DESTROYED: 28 }; @@ -217470,7 +220343,7 @@ module.exports = TWEEN_CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -217727,7 +220600,7 @@ module.exports = Class; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -217755,7 +220628,7 @@ module.exports = NOOP; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -217873,22 +220746,22 @@ module.exports = Add; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Adds the given item, or array of items, to the array starting at the index specified. - * + * * Each item must be unique within the array. - * + * * Existing elements in the array are shifted up. - * + * * The array is modified in-place and returned. - * + * * You can optionally specify a limit to the maximum size of the array. If the quantity of items being * added will take the array length over this limit, it will stop adding once the limit is reached. - * + * * You can optionally specify a callback to be invoked for each item successfully added to the array. * * @function Phaser.Utils.Array.AddAt @@ -217996,7 +220869,7 @@ module.exports = AddAt; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -218035,7 +220908,7 @@ module.exports = BringToTop; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -218088,7 +220961,7 @@ module.exports = CountAllMatching; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -218135,7 +221008,7 @@ module.exports = Each; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -218192,7 +221065,7 @@ module.exports = EachInRange; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -218270,6 +221143,50 @@ var FindClosestInSorted = function (value, array, key) module.exports = FindClosestInSorted; +/***/ }), + +/***/ 5454: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Takes an array and flattens it, returning a shallow-copy flattened array. + * + * @function Phaser.Utils.Array.Flatten + * @since 3.60.0 + * + * @param {array} array - The array to flatten. + * @param {array} [output] - An array to hold the results in. + * + * @return {array} The flattened output array. + */ +var Flatten = function (array, output) +{ + if (output === undefined) { output = []; } + + for (var i = 0; i < array.length; i++) + { + if (Array.isArray(array[i])) + { + Flatten(array[i], output); + } + else + { + output.push(array[i]); + } + } + + return output; +}; + +module.exports = Flatten; + + /***/ }), /***/ 71608: @@ -218277,7 +221194,7 @@ module.exports = FindClosestInSorted; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -218340,7 +221257,7 @@ module.exports = GetAll; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -218400,7 +221317,7 @@ module.exports = GetFirst; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -218436,7 +221353,7 @@ module.exports = GetRandom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -218450,7 +221367,7 @@ module.exports = GetRandom; * @param {array} array - The input array. * @param {*} item1 - The element to move above base element. * @param {*} item2 - The base element. - * + * * * @return {array} The input array. */ @@ -218501,7 +221418,7 @@ module.exports = MoveAbove; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -218515,7 +221432,7 @@ module.exports = MoveAbove; * @param {array} array - The input array. * @param {*} item1 - The element to move below base element. * @param {*} item2 - The base element. - * + * * * @return {array} The input array. */ @@ -218566,7 +221483,7 @@ module.exports = MoveBelow; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -218609,7 +221526,7 @@ module.exports = MoveDown; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -218657,7 +221574,7 @@ module.exports = MoveTo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -218700,7 +221617,7 @@ module.exports = MoveUp; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -218794,7 +221711,7 @@ module.exports = NumberArray; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -218808,7 +221725,7 @@ var RoundAwayFromZero = __webpack_require__(67233); * * Certain values for `start` and `end` (eg. NaN/undefined/null) are currently coerced to 0; * for forward compatibility make sure to pass in actual numbers. - * + * * @example * NumberArrayStep(4); * // => [0, 1, 2, 3] @@ -218872,7 +221789,7 @@ module.exports = NumberArrayStep; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -218995,7 +221912,7 @@ module.exports = QuickSelect; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -219025,29 +221942,29 @@ var BuildChunk = function (a, b, qty) * * Range ([a,b,c], [1,2,3]) = * a1, a2, a3, b1, b2, b3, c1, c2, c3 - * + * * Range ([a,b], [1,2,3], qty = 3) = * a1, a1, a1, a2, a2, a2, a3, a3, a3, b1, b1, b1, b2, b2, b2, b3, b3, b3 - * + * * Range ([a,b,c], [1,2,3], repeat x1) = * a1, a2, a3, b1, b2, b3, c1, c2, c3, a1, a2, a3, b1, b2, b3, c1, c2, c3 - * + * * Range ([a,b], [1,2], repeat -1 = endless, max = 14) = * Maybe if max is set then repeat goes to -1 automatically? * a1, a2, b1, b2, a1, a2, b1, b2, a1, a2, b1, b2, a1, a2 (capped at 14 elements) - * + * * Range ([a], [1,2,3,4,5], random = true) = * a4, a1, a5, a2, a3 - * + * * Range ([a, b], [1,2,3], random = true) = * b3, a2, a1, b1, a3, b2 - * + * * Range ([a, b, c], [1,2,3], randomB = true) = * a3, a1, a2, b2, b3, b1, c1, c3, c2 - * + * * Range ([a], [1,2,3,4,5], yoyo = true) = * a1, a2, a3, a4, a5, a5, a4, a3, a2, a1 - * + * * Range ([a, b], [1,2,3], yoyo = true) = * a1, a2, a3, b1, b2, b3, b3, b2, b1, a3, a2, a1 * @@ -219134,7 +222051,7 @@ module.exports = Range; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -219224,7 +222141,7 @@ module.exports = Remove; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -219232,9 +222149,9 @@ var SpliceOne = __webpack_require__(72677); /** * Removes the item from the given position in the array. - * + * * The array is modified in-place. - * + * * You can optionally specify a callback to be invoked for the item if it is successfully removed from the array. * * @function Phaser.Utils.Array.RemoveAt @@ -219276,7 +222193,7 @@ module.exports = RemoveAt; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -219284,9 +222201,9 @@ var SafeRange = __webpack_require__(45838); /** * Removes the item within the given range in the array. - * + * * The array is modified in-place. - * + * * You can optionally specify a callback to be invoked for the item/s successfully removed from the array. * * @function Phaser.Utils.Array.RemoveBetween @@ -219340,7 +222257,7 @@ module.exports = RemoveBetween; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -219379,7 +222296,7 @@ module.exports = RemoveRandomElement; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -219424,7 +222341,7 @@ module.exports = Replace; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -219465,7 +222382,7 @@ module.exports = RotateLeft; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -219506,13 +222423,13 @@ module.exports = RotateRight; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Tests if the start and end indexes are a safe range for the given array. - * + * * @function Phaser.Utils.Array.SafeRange * @since 3.4.0 * @@ -219530,8 +222447,7 @@ var SafeRange = function (array, startIndex, endIndex, throwError) if (startIndex < 0 || startIndex > len || startIndex >= endIndex || - endIndex > len || - startIndex + endIndex > len) + endIndex > len) { if (throwError) { @@ -219556,7 +222472,7 @@ module.exports = SafeRange; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -219595,7 +222511,7 @@ module.exports = SendToBack; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -219651,7 +222567,7 @@ module.exports = SetAll; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -219693,7 +222609,7 @@ module.exports = Shuffle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -219732,7 +222648,7 @@ module.exports = SortByDigits; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -219780,7 +222696,7 @@ module.exports = SpliceOne; /** * @author Richard Davey * @author Angry Bytes (and contributors) - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -219956,7 +222872,7 @@ module.exports = StableSort; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -220005,7 +222921,7 @@ module.exports = Swap; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -220024,6 +222940,7 @@ module.exports = { Each: __webpack_require__(36337), EachInRange: __webpack_require__(46208), FindClosestInSorted: __webpack_require__(2406), + Flatten: __webpack_require__(5454), GetAll: __webpack_require__(71608), GetFirst: __webpack_require__(51463), GetRandom: __webpack_require__(72861), @@ -220062,7 +222979,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -220125,7 +223042,7 @@ module.exports = CheckMatrix; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -220221,7 +223138,7 @@ module.exports = MatrixToString; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -220267,7 +223184,7 @@ module.exports = ReverseColumns; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -220318,7 +223235,7 @@ module.exports = ReverseRows; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -220366,7 +223283,7 @@ module.exports = Rotate180; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -220414,7 +223331,7 @@ module.exports = RotateLeft; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -220501,7 +223418,7 @@ module.exports = RotateMatrix; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -220549,7 +223466,7 @@ module.exports = RotateRight; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -220639,7 +223556,7 @@ module.exports = TranslateMatrix; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -220702,7 +223619,7 @@ module.exports = TransposeMatrix; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -220734,7 +223651,7 @@ module.exports = { /** * @author Niklas von Hertzen (https://github.com/niklasvh/base64-arraybuffer) * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -220742,17 +223659,17 @@ var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; /** * Converts an ArrayBuffer into a base64 string. - * + * * The resulting string can optionally be a data uri if the `mediaType` argument is provided. - * + * * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs for more details. * * @function Phaser.Utils.Base64.ArrayBufferToBase64 * @since 3.18.0 - * + * * @param {ArrayBuffer} arrayBuffer - The Array Buffer to encode. * @param {string} [mediaType] - An optional media type, i.e. `audio/ogg` or `image/jpeg`. If included the resulting string will be a data URI. - * + * * @return {string} The base64 encoded Array Buffer. */ var ArrayBufferToBase64 = function (arrayBuffer, mediaType) @@ -220778,7 +223695,7 @@ var ArrayBufferToBase64 = function (arrayBuffer, mediaType) { base64 = base64.substring(0, base64.length - 2) + '=='; } - + return base64; }; @@ -220793,7 +223710,7 @@ module.exports = ArrayBufferToBase64; /** * @author Niklas von Hertzen (https://github.com/niklasvh/base64-arraybuffer) * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -220812,9 +223729,9 @@ for (var i = 0; i < chars.length; i++) * * @function Phaser.Utils.Base64.Base64ToArrayBuffer * @since 3.18.0 - * + * * @param {string} base64 - The base64 string to be decoded. Can optionally contain a data URI header, which will be stripped out prior to decoding. - * + * * @return {ArrayBuffer} An ArrayBuffer decoded from the base64 data. */ var Base64ToArrayBuffer = function (base64) @@ -220868,7 +223785,7 @@ module.exports = Base64ToArrayBuffer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -220891,7 +223808,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -220917,7 +223834,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -220960,7 +223877,7 @@ module.exports = Clone; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -221010,7 +223927,7 @@ module.exports = DeepCopy; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -221112,7 +224029,7 @@ module.exports = Extend; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -221123,7 +224040,7 @@ var GetValue = __webpack_require__(10850); * Retrieves a value from an object. Allows for more advanced selection options, including: * * Allowed types: - * + * * Implicit * { * x: 4 @@ -221148,7 +224065,7 @@ var GetValue = __webpack_require__(10850); * { * x: { randFloat: [min, max] } * } - * + * * * @function Phaser.Utils.Objects.GetAdvancedValue * @since 3.0.0 @@ -221200,7 +224117,7 @@ module.exports = GetAdvancedValue; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -221244,7 +224161,7 @@ module.exports = GetFastValue; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -221284,61 +224201,108 @@ module.exports = GetMinMaxValue; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -// Source object -// The key as a string, or an array of keys, i.e. 'banner', or 'banner.hideBanner' -// The default value to use if the key doesn't exist - /** - * Retrieves a value from an object. + * Retrieves a value from an object, or an alternative object, falling to a back-up default value if not found. + * + * The key is a string, which can be split based on the use of the period character. + * + * For example: + * + * ```javascript + * const source = { + * lives: 3, + * render: { + * screen: { + * width: 1024 + * } + * } + * } + * + * const lives = GetValue(source, 'lives', 1); + * const width = GetValue(source, 'render.screen.width', 800); + * const height = GetValue(source, 'render.screen.height', 600); + * ``` + * + * In the code above, `lives` will be 3 because it's defined at the top level of `source`. + * The `width` value will be 1024 because it can be found inside the `render.screen` object. + * The `height` value will be 600, the default value, because it is missing from the `render.screen` object. * * @function Phaser.Utils.Objects.GetValue * @since 3.0.0 * - * @param {object} source - The object to retrieve the value from. + * @param {object} source - The primary object to try to retrieve the value from. If not found in here, `altSource` is checked. * @param {string} key - The name of the property to retrieve from the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`) - `banner.hideBanner` would return the value of the `hideBanner` property from the object stored in the `banner` property of the `source` object. * @param {*} defaultValue - The value to return if the `key` isn't found in the `source` object. + * @param {object} [altSource] - An alternative object to retrieve the value from. If the property exists in `source` then `altSource` will not be used. * * @return {*} The value of the requested key. */ -var GetValue = function (source, key, defaultValue) +var GetValue = function (source, key, defaultValue, altSource) { - if (!source || typeof source === 'number') + if ((!source && !altSource) || typeof source === 'number') { return defaultValue; } - else if (source.hasOwnProperty(key)) + else if (source && source.hasOwnProperty(key)) { return source[key]; } + else if (altSource && altSource.hasOwnProperty(key)) + { + return altSource[key]; + } else if (key.indexOf('.') !== -1) { var keys = key.split('.'); - var parent = source; - var value = defaultValue; + var parentA = source; + var parentB = altSource; + var valueA = defaultValue; + var valueB = defaultValue; + var valueAFound = true; + var valueBFound = true; // Use for loop here so we can break early for (var i = 0; i < keys.length; i++) { - if (parent.hasOwnProperty(keys[i])) + if (parentA && parentA.hasOwnProperty(keys[i])) { - // Yes it has a key property, let's carry on down - value = parent[keys[i]]; - - parent = parent[keys[i]]; + // Yes parentA has a key property, let's carry on down + valueA = parentA[keys[i]]; + parentA = parentA[keys[i]]; } else { - // Can't go any further, so reset to default - value = defaultValue; - break; + valueAFound = false; + } + + if (parentB && parentB.hasOwnProperty(keys[i])) + { + // Yes parentB has a key property, let's carry on down + valueB = parentB[keys[i]]; + parentB = parentB[keys[i]]; + } + else + { + valueBFound = false; } } - return value; + if (valueAFound) + { + return valueA; + } + else if (valueBFound) + { + return valueB; + } + else + { + return defaultValue; + } } else { @@ -221356,7 +224320,7 @@ module.exports = GetValue; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -221394,7 +224358,7 @@ module.exports = HasAll; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -221432,7 +224396,7 @@ module.exports = HasAny; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -221462,7 +224426,7 @@ module.exports = HasValue; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -221519,7 +224483,7 @@ module.exports = IsPlainObject; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -221528,7 +224492,7 @@ var Clone = __webpack_require__(32742); /** * Creates a new Object using all values from obj1 and obj2. * If a value exists in both obj1 and obj2, the value in obj1 is used. - * + * * This is only a shallow copy. Deeply nested objects are not cloned, so be sure to only use this * function on shallow objects. * @@ -221565,7 +224529,7 @@ module.exports = Merge; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -221573,7 +224537,7 @@ var Clone = __webpack_require__(32742); /** * Creates a new Object using all values from obj1. - * + * * Then scans obj2. If a property is found in obj2 that *also* exists in obj1, the value from obj2 is used, otherwise the property is skipped. * * @function Phaser.Utils.Objects.MergeRight @@ -221609,7 +224573,7 @@ module.exports = MergeRight; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -221654,15 +224618,15 @@ module.exports = Pick; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Sets a value in an object, allowing for dot notation to control the depth of the property. - * + * * For example: - * + * * ```javascript * var data = { * world: { @@ -221672,9 +224636,9 @@ module.exports = Pick; * } * } * }; - * + * * SetValue(data, 'world.position.y', 300); - * + * * console.log(data.world.position.y); // 300 * ``` * @@ -221724,7 +224688,7 @@ var SetValue = function (source, key, value) return true; } - + return false; }; @@ -221738,7 +224702,7 @@ module.exports = SetValue; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -221774,7 +224738,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -221810,7 +224774,7 @@ module.exports = Format; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -221823,13 +224787,13 @@ module.exports = Format; * This would return: `bob---` as it has padded it out to 6 characters, using the `-` on the right. * * You can also use it to pad numbers (they are always returned as strings): - * + * * `pad(512, 6, '0', 1)` * * Would return: `000512` with the string padded to the left. * * If you don't specify a direction it'll pad to both sides: - * + * * `pad('c64', 7, '*')` * * Would return: `**c64**` @@ -221841,7 +224805,7 @@ module.exports = Format; * @param {number} [len=0] - The number of characters to be added. * @param {string} [pad=" "] - The string to pad it out with (defaults to a space). * @param {number} [dir=3] - The direction dir = 1 (left), 2 (right), 3 (both). - * + * * @return {string} The padded string. */ var Pad = function (str, len, pad, dir) @@ -221887,7 +224851,7 @@ module.exports = Pad; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -221924,7 +224888,7 @@ module.exports = RemoveAt; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -221954,13 +224918,13 @@ module.exports = Reverse; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Creates and returns an RFC4122 version 4 compliant UUID. - * + * * The string is in the form: `xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx` where each `x` is replaced with a random * hexadecimal digit from 0 to f, and `y` is replaced with a random hexadecimal digit from 8 to b. * @@ -221990,7 +224954,7 @@ module.exports = UUID; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -222028,7 +224992,7 @@ module.exports = UppercaseFirst; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ diff --git a/dist/phaser-ie9.min.js b/dist/phaser-ie9.min.js index 9c9803c5f..06f877fc2 100644 --- a/dist/phaser-ie9.min.js +++ b/dist/phaser-ie9.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Phaser",[],e):"object"==typeof exports?exports.Phaser=e():t.Phaser=e()}(this,(function(){return(()=>{var t={6659:t=>{"use strict";var e=Object.prototype.hasOwnProperty,i="~";function s(){}function n(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function r(t,e,s,r,o){if("function"!=typeof s)throw new TypeError("The listener must be a function");var a=new n(s,r||t,o),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new s:delete t._events[e]}function a(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(i=!1)),a.prototype.eventNames=function(){var t,s,n=[];if(0===this._eventsCount)return n;for(s in t=this._events)e.call(t,s)&&n.push(i?s.slice(1):s);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=i?i+t:t,s=this._events[e];if(!s)return[];if(s.fn)return[s.fn];for(var n=0,r=s.length,o=new Array(r);n{var s=i(82590);t.exports=function(t,e,i,n){for(var r=t[0],o=1;o{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"angle",e,i,n,r)}},22015:t=>{t.exports=function(t,e,i){for(var s=0;s{t.exports=function(t,e,i){void 0===i&&(i=0);for(var s=i;s{t.exports=function(t,e,i){void 0===i&&(i=0);for(var s=i;s{var s=i(40327),n=i(84093),r=i(72632),o=i(72283),a=new(i(71030))({sys:{queueDepthSort:o,events:{once:o}}},0,0,1,1);t.exports=function(t,e){void 0===e&&(e={});var i=e.hasOwnProperty("width"),o=e.hasOwnProperty("height"),h=r(e,"width",-1),l=r(e,"height",-1),u=r(e,"cellWidth",1),c=r(e,"cellHeight",u),d=r(e,"position",n.TOP_LEFT),p=r(e,"x",0),f=r(e,"y",0),v=0,g=0,m=h*u,y=l*c;a.setPosition(p,f),a.setSize(u,c);for(var x=0;x{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"alpha",e,i,n,r)}},3877:(t,e,i)=>{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"x",e,i,n,r)}},71020:(t,e,i)=>{var s=i(6124);t.exports=function(t,e,i,n,r,o,a){return null==i&&(i=e),s(t,"x",e,n,o,a),s(t,"y",i,r,o,a)}},28970:(t,e,i)=>{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"y",e,i,n,r)}},82249:t=>{t.exports=function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=6.28);for(var n=i,r=(s-i)/t.length,o=0;o{t.exports=function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=6.28);for(var n=i,r=(s-i)/t.length,o=e.width/2,a=e.height/2,h=0;h{var s=i(8570);t.exports=function(t,e){for(var i=s(e,t.length),n=0;n{var s=i(40053),n=i(77640),r=i(38487);t.exports=function(t,e,i){void 0===i&&(i=0);var o=s(e,!1,t.length);i>0?n(o,i):i<0&&r(o,Math.abs(i));for(var a=0;a{var s=i(58813);t.exports=function(t,e,i){var n=s({x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2},i),r=s({x1:e.x2,y1:e.y2,x2:e.x3,y2:e.y3},i),o=s({x1:e.x3,y1:e.y3,x2:e.x1,y2:e.y1},i);n.pop(),r.pop(),o.pop();for(var a=(n=n.concat(r,o)).length/t.length,h=0,l=0;l{t.exports=function(t,e,i){for(var s=0;s{t.exports=function(t,e,i,s,n,r){var o;void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=1);var a=0,h=t.length;if(1===r)for(o=n;o=0;o--)t[o][e]+=i+a*s,a++;return t}},23646:t=>{t.exports=function(t,e,i,s,n,r){var o;void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=1);var a=0,h=t.length;if(1===r)for(o=n;o=0;o--)t[o][e]=i+a*s,a++;return t}},4392:(t,e,i)=>{var s=i(30977);t.exports=function(t,e){for(var i=0;i{var s=i(72006);t.exports=function(t,e){for(var i=0;i{var s=i(74077);t.exports=function(t,e){for(var i=0;i{var s=i(30001);t.exports=function(t,e){for(var i=0;i{var s=i(99761);t.exports=function(t,e){for(var i=0;i{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"rotation",e,i,n,r)}},87299:(t,e,i)=>{var s=i(72395),n=i(53996);t.exports=function(t,e,i){for(var r=e.x,o=e.y,a=0;a{var s=i(72395);t.exports=function(t,e,i,n){var r=e.x,o=e.y;if(0===n)return t;for(var a=0;a{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"scaleX",e,i,n,r)}},51449:(t,e,i)=>{var s=i(6124);t.exports=function(t,e,i,n,r,o,a){return null==i&&(i=e),s(t,"scaleX",e,n,o,a),s(t,"scaleY",i,r,o,a)}},64895:(t,e,i)=>{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"scaleY",e,i,n,r)}},30329:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"alpha",e,i,n,r)}},43954:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n){return s(t,"blendMode",e,0,i,n)}},70688:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"depth",e,i,n,r)}},8314:t=>{t.exports=function(t,e,i){for(var s=0;s{var s=i(23646);t.exports=function(t,e,i,n,r,o,a){return null==i&&(i=e),s(t,"originX",e,n,o,a),s(t,"originY",i,r,o,a),t.forEach((function(t){t.updateDisplayOrigin()})),t}},38767:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"rotation",e,i,n,r)}},18584:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r,o,a){return null==i&&(i=e),s(t,"scaleX",e,n,o,a),s(t,"scaleY",i,r,o,a)}},17381:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"scaleX",e,i,n,r)}},74370:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"scaleY",e,i,n,r)}},27773:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r,o,a){return null==i&&(i=e),s(t,"scrollFactorX",e,n,o,a),s(t,"scrollFactorY",i,r,o,a)}},75257:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"scrollFactorX",e,i,n,r)}},54512:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"scrollFactorY",e,i,n,r)}},69423:t=>{t.exports=function(t,e,i,s,n){for(var r=0;r{var s=i(23646);t.exports=function(t,e,i,n){return s(t,"visible",e,0,i,n)}},94833:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"x",e,i,n,r)}},14284:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r,o,a){return null==i&&(i=e),s(t,"x",e,n,o,a),s(t,"y",i,r,o,a)}},96574:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"y",e,i,n,r)}},74086:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r){var o,a,h,l,u,c;if(void 0===n&&(n=0),void 0===r&&(r=new s),t.length>1)if(0===n){var d=t.length-1;for(o=t[d].x,a=t[d].y,h=d-1;h>=0;h--)l=(c=t[h]).x,u=c.y,c.x=o,c.y=a,o=l,a=u;t[d].x=e,t[d].y=i}else{for(o=t[0].x,a=t[0].y,h=1;h{var s=i(18592);t.exports=function(t){return s(t)}},1558:(t,e,i)=>{var s=i(5514);t.exports=function(t,e,i,n,r){void 0===r&&(r=!1);var o,a=Math.abs(n-i)/t.length;if(r)for(o=0;o{var s=i(87736);t.exports=function(t,e,i,n,r){void 0===r&&(r=!1);var o,a=Math.abs(n-i)/t.length;if(r)for(o=0;o{t.exports=function(t,e,i,s,n){void 0===n&&(n=!1);var r,o=Math.abs(s-i)/t.length;if(n)for(r=0;r{t.exports=function(t){for(var e=0;e{var s=i(1071);t.exports=function(t,e,i){void 0===i&&(i=0);for(var n=0;n{t.exports={AlignTo:i(62270),Angle:i(61148),Call:i(22015),GetFirst:i(31060),GetLast:i(52367),GridAlign:i(12673),IncAlpha:i(691),IncX:i(3877),IncXY:i(71020),IncY:i(28970),PlaceOnCircle:i(82249),PlaceOnEllipse:i(30285),PlaceOnLine:i(61557),PlaceOnRectangle:i(63549),PlaceOnTriangle:i(51629),PlayAnimation:i(1045),PropertyValueInc:i(6124),PropertyValueSet:i(23646),RandomCircle:i(4392),RandomEllipse:i(94985),RandomLine:i(63305),RandomRectangle:i(90739),RandomTriangle:i(91417),Rotate:i(26182),RotateAround:i(87299),RotateAroundDistance:i(92194),ScaleX:i(30363),ScaleXY:i(51449),ScaleY:i(64895),SetAlpha:i(30329),SetBlendMode:i(43954),SetDepth:i(70688),SetHitArea:i(8314),SetOrigin:i(12894),SetRotation:i(38767),SetScale:i(18584),SetScaleX:i(17381),SetScaleY:i(74370),SetScrollFactor:i(27773),SetScrollFactorX:i(75257),SetScrollFactorY:i(54512),SetTint:i(69423),SetVisible:i(58291),SetX:i(94833),SetXY:i(14284),SetY:i(96574),ShiftPosition:i(74086),Shuffle:i(86347),SmootherStep:i(9938),SmoothStep:i(1558),Spread:i(71060),ToggleVisible:i(11207),WrapInRectangle:i(24404)}},85463:(t,e,i)=>{var s=i(82897),n=i(56694),r=i(16938),o=i(2406),a=i(71519),h=i(10850),l=i(28834),u=new n({initialize:function(t,e,i){this.manager=t,this.key=e,this.type="frame",this.frames=this.getFrames(t.textureManager,h(i,"frames",[]),h(i,"defaultTextureKey",null),h(i,"sortFrames",!0)),this.frameRate=h(i,"frameRate",null),this.duration=h(i,"duration",null),this.msPerFrame,this.skipMissedFrames=h(i,"skipMissedFrames",!0),this.delay=h(i,"delay",0),this.repeat=h(i,"repeat",0),this.repeatDelay=h(i,"repeatDelay",0),this.yoyo=h(i,"yoyo",!1),this.showOnStart=h(i,"showOnStart",!1),this.hideOnComplete=h(i,"hideOnComplete",!1),this.paused=!1,this.calculateDuration(this,this.getTotalFrames(),this.duration,this.frameRate),this.manager.on&&(this.manager.on(r.PAUSE_ALL,this.pause,this),this.manager.on(r.RESUME_ALL,this.resume,this))},getTotalFrames:function(){return this.frames.length},calculateDuration:function(t,e,i,s){null===i&&null===s?(t.frameRate=24,t.duration=24/e*1e3):i&&null===s?(t.duration=i,t.frameRate=e/(i/1e3)):(t.frameRate=s,t.duration=e/s*1e3),t.msPerFrame=1e3/t.frameRate},addFrame:function(t){return this.addFrameAt(this.frames.length,t)},addFrameAt:function(t,e){var i=this.getFrames(this.manager.textureManager,e);if(i.length>0){if(0===t)this.frames=i.concat(this.frames);else if(t===this.frames.length)this.frames=this.frames.concat(i);else{var s=this.frames.slice(0,t),n=this.frames.slice(t);this.frames=s.concat(i,n)}this.updateFrameSequence()}return this},checkFrame:function(t){return t>=0&&t0){r.isLast=!0,r.nextFrame=c[0],c[0].prevFrame=r;var y=1/(c.length-1);for(o=0;o0?t.inReverse&&t.forward?t.forward=!1:this.repeatAnimation(t):t.complete():this.updateAndGetNextTick(t,e.nextFrame)},handleYoyoFrame:function(t,e){if(e||(e=!1),t.inReverse===!e&&t.repeatCounter>0)return(0===t.repeatDelay||t.pendingRepeat)&&(t.forward=e),void this.repeatAnimation(t);if(t.inReverse===e||0!==t.repeatCounter){t.forward=e;var i=e?t.currentFrame.nextFrame:t.currentFrame.prevFrame;this.updateAndGetNextTick(t,i)}else t.complete()},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t.yoyo?this.handleYoyoFrame(t,!0):t.repeatCounter>0?(t.inReverse&&!t.forward||(t.forward=!0),this.repeatAnimation(t)):t.complete():this.updateAndGetNextTick(t,e.prevFrame)},updateAndGetNextTick:function(t,e){t.setCurrentFrame(e),this.getNextTick(t)},removeFrame:function(t){var e=this.frames.indexOf(t);return-1!==e&&this.removeFrameAt(e),this},removeFrameAt:function(t){return this.frames.splice(t,1),this.updateFrameSequence(),this},repeatAnimation:function(t){if(2===t._pendingStop){if(0===t._pendingStopValue)return t.stop();t._pendingStopValue--}t.repeatDelay>0&&!t.pendingRepeat?(t.pendingRepeat=!0,t.accumulator-=t.nextTick,t.nextTick+=t.repeatDelay):(t.repeatCounter--,t.forward?t.setCurrentFrame(t.currentFrame.nextFrame):t.setCurrentFrame(t.currentFrame.prevFrame),t.isPlaying&&(this.getNextTick(t),t.handleRepeat()))},toJSON:function(){var t={key:this.key,type:this.type,frames:[],frameRate:this.frameRate,duration:this.duration,skipMissedFrames:this.skipMissedFrames,delay:this.delay,repeat:this.repeat,repeatDelay:this.repeatDelay,yoyo:this.yoyo,showOnStart:this.showOnStart,hideOnComplete:this.hideOnComplete};return this.frames.forEach((function(e){t.frames.push(e.toJSON())})),t},updateFrameSequence:function(){for(var t,e=this.frames.length,i=1/(e-1),s=0;s1?(t.isLast=!0,t.prevFrame=this.frames[e-2],t.nextFrame=this.frames[0]):e>1&&(t.prevFrame=this.frames[s-1],t.nextFrame=this.frames[s+1]);return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.manager.off&&(this.manager.off(r.PAUSE_ALL,this.pause,this),this.manager.off(r.RESUME_ALL,this.resume,this)),this.manager.remove(this.key);for(var t=0;t{var s=new(i(56694))({initialize:function(t,e,i,s,n){void 0===n&&(n=!1),this.textureKey=t,this.textureFrame=e,this.index=i,this.frame=s,this.isFirst=!1,this.isLast=!1,this.prevFrame=null,this.nextFrame=null,this.duration=0,this.progress=0,this.isKeyFrame=n},toJSON:function(){return{key:this.textureKey,frame:this.textureFrame,duration:this.duration,keyframe:this.isKeyFrame}},destroy:function(){this.frame=void 0}});t.exports=s},90249:(t,e,i)=>{var s=i(85463),n=i(56694),r=i(33885),o=i(6659),a=i(16938),h=i(97081),l=i(72632),u=i(10850),c=i(76400),d=i(13401),p=new n({Extends:o,initialize:function(t){o.call(this),this.game=t,this.textureManager=null,this.globalTimeScale=1,this.anims=new r,this.mixes=new r,this.paused=!1,this.name="AnimationManager",t.events.once(h.BOOT,this.boot,this)},boot:function(){this.textureManager=this.game.textures,this.game.events.once(h.DESTROY,this.destroy,this)},addMix:function(t,e,i){var s=this.anims,n=this.mixes,r="string"==typeof t?t:t.key,o="string"==typeof e?e:e.key;if(s.has(r)&&s.has(o)){var a=n.get(r);a||(a={}),a[o]=i,n.set(r,a)}return this},removeMix:function(t,e){var i=this.mixes,s="string"==typeof t?t:t.key,n=i.get(s);if(n)if(e){var r="string"==typeof e?e:e.key;n.hasOwnProperty(r)&&delete n[r]}else e||i.delete(s);return this},getMix:function(t,e){var i=this.mixes,s="string"==typeof t?t:t.key,n="string"==typeof e?e:e.key,r=i.get(s);return r&&r.hasOwnProperty(n)?r[n]:0},add:function(t,e){return this.anims.has(t)?(console.warn("Animation key exists: "+t),this):(e.key=t,this.anims.set(t,e),this.emit(a.ADD_ANIMATION,t,e),this)},exists:function(t){return this.anims.has(t)},createFromAseprite:function(t,e){var i=[],s=this.game.cache.json.get(t);if(!s)return i;var n=this,r=u(s,"meta",null),o=u(s,"frames",null);r&&o&&u(r,"frameTags",[]).forEach((function(s){var r=[],a=l(s,"name",null),h=l(s,"from",0),u=l(s,"to",0),c=l(s,"direction","forward");if(a&&(!e||e&&e.indexOf(a)>-1)){for(var d=[],p=Number.MAX_SAFE_INTEGER,f=h;f<=u;f++){var v=f.toString(),g=o[v];if(g){var m=l(g,"duration",Number.MAX_SAFE_INTEGER);m{var s=i(56694),n=i(33885),r=i(72632),o=i(16938),a=i(85463),h=new s({initialize:function(t){this.parent=t,this.animationManager=t.scene.sys.anims,this.animationManager.on(o.REMOVE_ANIMATION,this.globalRemove,this),this.textureManager=this.animationManager.textureManager,this.anims=null,this.isPlaying=!1,this.hasStarted=!1,this.currentAnim=null,this.currentFrame=null,this.nextAnim=null,this.nextAnimsQueue=[],this.timeScale=1,this.frameRate=0,this.duration=0,this.msPerFrame=0,this.skipMissedFrames=!0,this.delay=0,this.repeat=0,this.repeatDelay=0,this.yoyo=!1,this.showOnStart=!1,this.hideOnComplete=!1,this.forward=!0,this.inReverse=!1,this.accumulator=0,this.nextTick=0,this.delayCounter=0,this.repeatCounter=0,this.pendingRepeat=!1,this._paused=!1,this._wasPlaying=!1,this._pendingStop=0,this._pendingStopValue},chain:function(t){var e=this.parent;if(void 0===t)return this.nextAnimsQueue.length=0,this.nextAnim=null,e;Array.isArray(t)||(t=[t]);for(var i=0;is.getTotalFrames()&&(h=0);var l=s.frames[h];0!==h||this.forward||(l=s.getLastFrame()),this.currentFrame=l}else console.warn("Missing animation: "+i);return this.parent},pause:function(t){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),void 0!==t&&this.setCurrentFrame(t),this.parent},resume:function(t){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),void 0!==t&&this.setCurrentFrame(t),this.parent},playAfterDelay:function(t,e){if(this.isPlaying){var i=this.nextAnim,s=this.nextAnimsQueue;i&&s.unshift(i),this.nextAnim=t,this._pendingStop=1,this._pendingStopValue=e}else this.delayCounter=e,this.play(t,!0);return this.parent},playAfterRepeat:function(t,e){if(void 0===e&&(e=1),this.isPlaying){var i=this.nextAnim,s=this.nextAnimsQueue;i&&s.unshift(i),-1!==this.repeatCounter&&e>this.repeatCounter&&(e=this.repeatCounter),this.nextAnim=t,this._pendingStop=2,this._pendingStopValue=e}else this.play(t);return this.parent},play:function(t,e){void 0===e&&(e=!1);var i=this.currentAnim,s=this.parent,n="string"==typeof t?t:t.key;if(e&&this.isPlaying&&i.key===n)return s;if(i&&this.isPlaying){var r=this.animationManager.getMix(i.key,t);if(r>0)return this.playAfterDelay(t,r)}return this.forward=!0,this.inReverse=!1,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t)},playReverse:function(t,e){void 0===e&&(e=!1);var i="string"==typeof t?t:t.key;return e&&this.isPlaying&&this.currentAnim.key===i?this.parent:(this.forward=!1,this.inReverse=!0,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t))},startAnimation:function(t){this.load(t);var e=this.currentAnim,i=this.parent;return e?(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat,e.getFirstTick(this),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!1,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.delayCounter+=this.delay,0===this.delayCounter&&this.handleStart(),i):i},handleStart:function(){this.showOnStart&&this.parent.setVisible(!0),this.setCurrentFrame(this.currentFrame),this.hasStarted=!0,this.emitEvents(o.ANIMATION_START)},handleRepeat:function(){this.pendingRepeat=!1,this.emitEvents(o.ANIMATION_REPEAT)},handleStop:function(){this._pendingStop=0,this.isPlaying=!1,this.emitEvents(o.ANIMATION_STOP)},handleComplete:function(){this._pendingStop=0,this.isPlaying=!1,this.hideOnComplete&&this.parent.setVisible(!1),this.emitEvents(o.ANIMATION_COMPLETE,o.ANIMATION_COMPLETE_KEY)},emitEvents:function(t,e){var i=this.currentAnim,s=this.currentFrame,n=this.parent,r=s.textureFrame;n.emit(t,i,s,n,r),e&&n.emit(e+i.key,i,s,n,r)},reverse:function(){return this.isPlaying&&(this.inReverse=!this.inReverse,this.forward=!this.forward),this.parent},getProgress:function(){var t=this.currentFrame;if(!t)return 0;var e=t.progress;return this.inReverse&&(e*=-1),e},setProgress:function(t){return this.forward||(t=1-t),this.setCurrentFrame(this.currentAnim.getFrameByProgress(t)),this.parent},setRepeat:function(t){return this.repeatCounter=-1===t?Number.MAX_VALUE:t,this.parent},globalRemove:function(t,e){void 0===e&&(e=this.currentAnim),this.isPlaying&&e.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},restart:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);var i=this.currentAnim,s=this.parent;return i?(e&&(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat),i.getFirstTick(this),this.emitEvents(o.ANIMATION_RESTART),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!t,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.setCurrentFrame(i.frames[0]),this.parent):s},complete:function(){if(this._pendingStop=0,this.isPlaying=!1,this.currentAnim&&this.handleComplete(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.length>0?this.nextAnimsQueue.shift():null,this.play(t)}return this.parent},stop:function(){if(this._pendingStop=0,this.isPlaying=!1,this.currentAnim&&this.handleStop(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.shift(),this.play(t)}return this.parent},stopAfterDelay:function(t){return this._pendingStop=1,this._pendingStopValue=t,this.parent},stopAfterRepeat:function(t){return void 0===t&&(t=1),-1!==this.repeatCounter&&t>this.repeatCounter&&(t=this.repeatCounter),this._pendingStop=2,this._pendingStopValue=t,this.parent},stopOnFrame:function(t){return this._pendingStop=3,this._pendingStopValue=t,this.parent},getTotalFrames:function(){return this.currentAnim?this.currentAnim.getTotalFrames():0},update:function(t,e){var i=this.currentAnim;if(this.isPlaying&&i&&!i.paused){if(this.accumulator+=e*this.timeScale,1===this._pendingStop&&(this._pendingStopValue-=e,this._pendingStopValue<=0))return this.stop();if(this.hasStarted){if(this.accumulator>=this.nextTick&&(this.forward?i.nextFrame(this):i.previousFrame(this),this.isPlaying&&0===this._pendingStop&&this.skipMissedFrames&&this.accumulator>this.nextTick)){var s=0;do{this.forward?i.nextFrame(this):i.previousFrame(this),s++}while(this.isPlaying&&this.accumulator>this.nextTick&&s<60)}}else this.accumulator>=this.delayCounter&&(this.accumulator-=this.delayCounter,this.handleStart())}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),t.setAlpha&&(e.alpha=t.alpha),e.setSizeToFrame(),e._originComponent&&(t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin()),this.isPlaying&&this.hasStarted&&(this.emitEvents(o.ANIMATION_UPDATE),3===this._pendingStop&&this._pendingStopValue===t&&this.stop()),e},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},get:function(t){return this.anims?this.anims.get(t):null},exists:function(t){return!!this.anims&&this.anims.has(t)},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))||(i=new a(this,e,t),this.anims||(this.anims=new n),this.anims.set(e,i))),i},generateFrameNames:function(t,e){return this.animationManager.generateFrameNames(t,e)},generateFrameNumbers:function(t,e){return this.animationManager.generateFrameNumbers(t,e)},remove:function(t){var e=this.get(t);return e&&(this.currentAnim===e&&this.stop(),this.anims.delete(t)),e},destroy:function(){this.animationManager.off(o.REMOVE_ANIMATION,this.globalRemove,this),this.anims&&this.anims.clear(),this.animationManager=null,this.parent=null,this.nextAnim=null,this.nextAnimsQueue.length=0,this.currentAnim=null,this.currentFrame=null},isPaused:{get:function(){return this._paused}}});t.exports=h},44509:t=>{t.exports="add"},84563:t=>{t.exports="animationcomplete"},61586:t=>{t.exports="animationcomplete-"},72175:t=>{t.exports="animationrepeat"},568:t=>{t.exports="animationrestart"},37690:t=>{t.exports="animationstart"},58525:t=>{t.exports="animationstop"},5243:t=>{t.exports="animationupdate"},10598:t=>{t.exports="pauseall"},4860:t=>{t.exports="remove"},31865:t=>{t.exports="resumeall"},16938:(t,e,i)=>{t.exports={ADD_ANIMATION:i(44509),ANIMATION_COMPLETE:i(84563),ANIMATION_COMPLETE_KEY:i(61586),ANIMATION_REPEAT:i(72175),ANIMATION_RESTART:i(568),ANIMATION_START:i(37690),ANIMATION_STOP:i(58525),ANIMATION_UPDATE:i(5243),PAUSE_ALL:i(10598),REMOVE_ANIMATION:i(4860),RESUME_ALL:i(31865)}},13517:(t,e,i)=>{t.exports={Animation:i(85463),AnimationFrame:i(71519),AnimationManager:i(90249),AnimationState:i(16569),Events:i(16938)}},23740:(t,e,i)=>{var s=i(56694),n=i(33885),r=i(6659),o=i(69773),a=new s({initialize:function(){this.entries=new n,this.events=new r},add:function(t,e){return this.entries.set(t,e),this.events.emit(o.ADD,this,t,e),this},has:function(t){return this.entries.has(t)},exists:function(t){return this.entries.has(t)},get:function(t){return this.entries.get(t)},remove:function(t){var e=this.get(t);return e&&(this.entries.delete(t),this.events.emit(o.REMOVE,this,t,e.data)),this},getKeys:function(){return this.entries.keys()},destroy:function(){this.entries.clear(),this.events.removeAllListeners(),this.entries=null,this.events=null}});t.exports=a},43474:(t,e,i)=>{var s=i(23740),n=i(56694),r=i(97081),o=new n({initialize:function(t){this.game=t,this.binary=new s,this.bitmapFont=new s,this.json=new s,this.physics=new s,this.shader=new s,this.audio=new s,this.video=new s,this.text=new s,this.html=new s,this.obj=new s,this.tilemap=new s,this.xml=new s,this.custom={},this.game.events.once(r.DESTROY,this.destroy,this)},addCustom:function(t){return this.custom.hasOwnProperty(t)||(this.custom[t]=new s),this.custom[t]},destroy:function(){for(var t=["binary","bitmapFont","json","physics","shader","audio","video","text","html","obj","tilemap","xml"],e=0;e{t.exports="add"},75968:t=>{t.exports="remove"},69773:(t,e,i)=>{t.exports={ADD:i(94762),REMOVE:i(75968)}},45820:(t,e,i)=>{t.exports={BaseCache:i(23740),CacheManager:i(43474),Events:i(69773)}},51052:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(75606),o=i(6659),a=i(89787),h=i(74118),l=i(69360),u=i(93222),c=i(93736),d=new s({Extends:o,Mixins:[n.Alpha,n.Visible],initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),o.call(this),this.scene,this.sceneManager,this.scaleManager,this.cameraManager,this.id=0,this.name="",this.roundPixels=!1,this.useBounds=!1,this.worldView=new h,this.dirty=!0,this._x=t,this._y=e,this._width=i,this._height=s,this._bounds=new h,this._scrollX=0,this._scrollY=0,this._zoomX=1,this._zoomY=1,this._rotation=0,this.matrix=new l,this.transparent=!0,this.backgroundColor=u("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new c(i/2,s/2),this.originX=.5,this.originY=.5,this._customViewport=!1,this.mask=null,this._maskCamera=null,this.renderList=[]},addToRenderList:function(t){this.renderList.push(t)},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this},getScroll:function(t,e,i){void 0===i&&(i=new c);var s=.5*this.width,n=.5*this.height;return i.x=t-s,i.y=e-n,this.useBounds&&(i.x=this.clampX(i.x),i.y=this.clampY(i.y)),i},centerOnX:function(t){var e=.5*this.width;return this.midPoint.x=t,this.scrollX=t-e,this.useBounds&&(this.scrollX=this.clampX(this.scrollX)),this},centerOnY:function(t){var e=.5*this.height;return this.midPoint.y=t,this.scrollY=t-e,this.useBounds&&(this.scrollY=this.clampY(this.scrollY)),this},centerOn:function(t,e){return this.centerOnX(t),this.centerOnY(e),this},centerToBounds:function(){if(this.useBounds){var t=this._bounds,e=.5*this.width,i=.5*this.height;this.midPoint.set(t.centerX,t.centerY),this.scrollX=t.centerX-e,this.scrollY=t.centerY-i}return this},centerToSize:function(){return this.scrollX=.5*this.width,this.scrollY=.5*this.height,this},cull:function(t){if(this.disableCull)return t;var e=this.matrix.matrix,i=e[0],s=e[1],n=e[2],r=e[3],o=i*r-s*n;if(!o)return t;var a=e[4],h=e[5],l=this.scrollX,u=this.scrollY,c=this.width,d=this.height,p=this.y,f=p+d,v=this.x,g=v+c,m=this.culledObjects,y=t.length;o=1/o,m.length=0;for(var x=0;xv&&E*i+S*n+ap&&E*s+S*r+hn&&(t=n),t},clampY:function(t){var e=this._bounds,i=this.displayHeight,s=e.y+(i-this.height)/2,n=Math.max(s,s+e.height-i);return tn&&(t=n),t},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(t){return void 0===t&&(t=0),this.rotation=r(t),this},setBackgroundColor:function(t){return void 0===t&&(t="rgba(0,0,0,0)"),this.backgroundColor=u(t),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(t,e,i,s,n){return void 0===n&&(n=!1),this._bounds.setTo(t,e,i,s),this.dirty=!0,this.useBounds=!0,n?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},getBounds:function(t){void 0===t&&(t=new h);var e=this._bounds;return t.setTo(e.x,e.y,e.width,e.height),t},setName:function(t){return void 0===t&&(t=""),this.name=t,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setRoundPixels:function(t){return this.roundPixels=t,this},setScene:function(t){this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=t;var e=t.sys;return this.sceneManager=e.game.scene,this.scaleManager=e.scale,this.cameraManager=e.cameras,this.updateSystem(),this},setScroll:function(t,e){return void 0===e&&(e=t),this.scrollX=t,this.scrollY=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},setViewport:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setZoom:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),0===t&&(t=.001),0===e&&(e=.001),this.zoomX=t,this.zoomY=e,this},setMask:function(t,e){return void 0===e&&(e=!0),this.mask=t,this._maskCamera=e?this.cameraManager.default:this,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},toJSON:function(){var t={name:this.name,x:this.x,y:this.y,width:this.width,height:this.height,zoom:this.zoom,rotation:this.rotation,roundPixels:this.roundPixels,scrollX:this.scrollX,scrollY:this.scrollY,backgroundColor:this.backgroundColor.rgba};return this.useBounds&&(t.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),t},update:function(){},updateSystem:function(){if(this.scaleManager){var t=0!==this._x||0!==this._y||this.scaleManager.width!==this._width||this.scaleManager.height!==this._height,e=this.sceneManager;t&&!this._customViewport?e.customViewports++:!t&&this._customViewport&&e.customViewports--,this.dirty=!0,this._customViewport=t}},destroy:function(){this.emit(a.DESTROY,this),this.removeAllListeners(),this.matrix.destroy(),this.culledObjects=[],this._customViewport&&this.sceneManager.customViewports--,this.renderList=[],this._bounds=null,this.scene=null,this.scaleManager=null,this.sceneManager=null,this.cameraManager=null},x:{get:function(){return this._x},set:function(t){this._x=t,this.updateSystem()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.updateSystem()}},width:{get:function(){return this._width},set:function(t){this._width=t,this.updateSystem()}},height:{get:function(){return this._height},set:function(t){this._height=t,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(t){this._scrollX=t,this.dirty=!0}},scrollY:{get:function(){return this._scrollY},set:function(t){this._scrollY=t,this.dirty=!0}},zoom:{get:function(){return(this._zoomX+this._zoomY)/2},set:function(t){this._zoomX=t,this._zoomY=t,this.dirty=!0}},zoomX:{get:function(){return this._zoomX},set:function(t){this._zoomX=t,this.dirty=!0}},zoomY:{get:function(){return this._zoomY},set:function(t){this._zoomY=t,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this.dirty=!0}},centerX:{get:function(){return this.x+.5*this.width}},centerY:{get:function(){return this.y+.5*this.height}},displayWidth:{get:function(){return this.width/this.zoomX}},displayHeight:{get:function(){return this.height/this.zoomY}}});t.exports=d},47751:(t,e,i)=>{var s=i(51052),n=i(79993),r=i(82897),o=i(56694),a=i(64937),h=i(53030),l=i(89787),u=i(42798),c=i(74118),d=i(93736),p=new o({Extends:s,Mixins:[a.Pipeline],initialize:function(t,e,i,n){s.call(this,t,e,i,n),this.postPipelines=[],this.pipelineData={},this.inputEnabled=!0,this.fadeEffect=new h.Fade(this),this.flashEffect=new h.Flash(this),this.shakeEffect=new h.Shake(this),this.panEffect=new h.Pan(this),this.rotateToEffect=new h.RotateTo(this),this.zoomEffect=new h.Zoom(this),this.lerp=new d(1,1),this.followOffset=new d,this.deadzone=null,this._follow=null},setDeadzone:function(t,e){if(void 0===t)this.deadzone=null;else{if(this.deadzone?(this.deadzone.width=t,this.deadzone.height=e):this.deadzone=new c(0,0,t,e),this._follow){var i=this.width/2,s=this.height/2,r=this._follow.x-this.followOffset.x,o=this._follow.y-this.followOffset.y;this.midPoint.set(r,o),this.scrollX=r-i,this.scrollY=o-s}n(this.deadzone,this.midPoint.x,this.midPoint.y)}return this},fadeIn:function(t,e,i,s,n,r){return this.fadeEffect.start(!1,t,e,i,s,!0,n,r)},fadeOut:function(t,e,i,s,n,r){return this.fadeEffect.start(!0,t,e,i,s,!0,n,r)},fadeFrom:function(t,e,i,s,n,r,o){return this.fadeEffect.start(!1,t,e,i,s,n,r,o)},fade:function(t,e,i,s,n,r,o){return this.fadeEffect.start(!0,t,e,i,s,n,r,o)},flash:function(t,e,i,s,n,r,o){return this.flashEffect.start(t,e,i,s,n,r,o)},shake:function(t,e,i,s,n){return this.shakeEffect.start(t,e,i,s,n)},pan:function(t,e,i,s,n,r,o){return this.panEffect.start(t,e,i,s,n,r,o)},rotateTo:function(t,e,i,s,n,r,o){return this.rotateToEffect.start(t,e,i,s,n,r,o)},zoomTo:function(t,e,i,s,n,r){return this.zoomEffect.start(t,e,i,s,n,r)},preRender:function(){this.renderList.length=0;var t=this.width,e=this.height,i=.5*t,s=.5*e,r=this.zoom,o=this.matrix,a=t*this.originX,h=e*this.originY,c=this._follow,d=this.deadzone,p=this.scrollX,f=this.scrollY;d&&n(d,this.midPoint.x,this.midPoint.y);var v=!1;if(c&&!this.panEffect.isRunning){var g=c.x-this.followOffset.x,m=c.y-this.followOffset.y;d?(gd.right&&(p=u(p,p+(g-d.right),this.lerp.x)),md.bottom&&(f=u(f,f+(m-d.bottom),this.lerp.y))):(p=u(p,g-a,this.lerp.x),f=u(f,m-h,this.lerp.y)),v=!0}this.useBounds&&(p=this.clampX(p),f=this.clampY(f)),this.roundPixels&&(a=Math.round(a),h=Math.round(h),p=Math.round(p),f=Math.round(f)),this.scrollX=p,this.scrollY=f;var y=p+i,x=f+s;this.midPoint.set(y,x);var T=t/r,w=e/r,b=y-T/2,E=x-w/2;this.roundPixels&&(b=Math.round(b),E=Math.round(E)),this.worldView.setTo(b,E,T,w),o.applyITRS(this.x+a,this.y+h,this.rotation,r,r),o.translate(-a,-h),this.shakeEffect.preRender(),v&&this.emit(l.FOLLOW_UPDATE,this,c)},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,s,n,o){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===s&&(s=i),void 0===n&&(n=0),void 0===o&&(o=n),this._follow=t,this.roundPixels=e,i=r(i,0,1),s=r(s,0,1),this.lerp.set(i,s),this.followOffset.set(n,o);var a=this.width/2,h=this.height/2,l=t.x-n,u=t.y-o;return this.midPoint.set(l,u),this.scrollX=l-a,this.scrollY=u-h,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.rotateToEffect.reset(),this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.rotateToEffect.update(t,e),this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.resetFX(),s.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=p},62382:(t,e,i)=>{var s=i(47751),n=i(56694),r=i(72632),o=i(91963),a=i(94287),h=i(40444),l=i(7599),u=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.roundPixels=t.sys.game.config.roundPixels,this.cameras=[],this.main,this.default,t.sys.events.once(l.BOOT,this.boot,this),t.sys.events.on(l.START,this.start,this)},boot:function(){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0],this.default=new s(0,0,t.scale.width,t.scale.height).setScene(this.scene),t.game.scale.on(h.RESIZE,this.onResize,this),this.systems.events.once(l.DESTROY,this.destroy,this)},start:function(){if(!this.main){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0]}var e=this.systems.events;e.on(l.UPDATE,this.update,this),e.once(l.SHUTDOWN,this.shutdown,this)},add:function(t,e,i,n,r,o){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===n&&(n=this.scene.sys.scale.height),void 0===r&&(r=!1),void 0===o&&(o="");var a=new s(t,e,i,n);return a.setName(o),a.setScene(this.scene),a.setRoundPixels(this.roundPixels),a.id=this.getNextID(),this.cameras.push(a),r&&(this.main=a),a},addExisting:function(t,e){return void 0===e&&(e=!1),-1===this.cameras.indexOf(t)?(t.id=this.getNextID(),t.setRoundPixels(this.roundPixels),this.cameras.push(t),e&&(this.main=t),t):null},getNextID:function(){for(var t=this.cameras,e=1,i=0;i<32;i++){for(var s=!1,n=0;n0){r.preRender();var o=this.getVisibleChildren(e.getChildren(),r);t.render(i,o,r)}}},getVisibleChildren:function(t,e){for(var i=[],s=0;s{var s=i(82897),n=i(56694),r=i(89787),o=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.isComplete=!1,this.direction=!0,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n,o,a,h){if(void 0===t&&(t=!0),void 0===e&&(e=1e3),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=0),void 0===o&&(o=!1),void 0===a&&(a=null),void 0===h&&(h=this.camera.scene),!o&&this.isRunning)return this.camera;this.isRunning=!0,this.isComplete=!1,this.duration=e,this.direction=t,this.progress=0,this.red=i,this.green=s,this.blue=n,this.alpha=t?Number.MIN_VALUE:1,this._elapsed=0,this._onUpdate=a,this._onUpdateScope=h;var l=t?r.FADE_OUT_START:r.FADE_IN_START;return this.camera.emit(l,this.camera,this,e,i,s,n),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=s(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed{var s=i(82897),n=i(56694),r=i(89787),o=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=1,this.progress=0,this._elapsed=0,this._alpha,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n,o,a){return void 0===t&&(t=250),void 0===e&&(e=255),void 0===i&&(i=255),void 0===s&&(s=255),void 0===n&&(n=!1),void 0===o&&(o=null),void 0===a&&(a=this.camera.scene),!n&&this.isRunning||(this.isRunning=!0,this.duration=t,this.progress=0,this.red=e,this.green=i,this.blue=s,this._alpha=this.alpha,this._elapsed=0,this._onUpdate=o,this._onUpdateScope=a,this.camera.emit(r.FLASH_START,this.camera,this,t,e,i,s)),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=s(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed{var s=i(82897),n=i(56694),r=i(35060),o=i(89787),a=i(93736),h=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=new a,this.current=new a,this.destination=new a,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n,a,h){void 0===i&&(i=1e3),void 0===s&&(s=r.Linear),void 0===n&&(n=!1),void 0===a&&(a=null),void 0===h&&(h=this.camera.scene);var l=this.camera;return!n&&this.isRunning||(this.isRunning=!0,this.duration=i,this.progress=0,this.source.set(l.scrollX,l.scrollY),this.destination.set(t,e),l.getScroll(t,e,this.current),"string"==typeof s&&r.hasOwnProperty(s)?this.ease=r[s]:"function"==typeof s&&(this.ease=s),this._elapsed=0,this._onUpdate=a,this._onUpdateScope=h,this.camera.emit(o.PAN_START,this.camera,this,i,t,e)),l},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=s(this._elapsed/this.duration,0,1);this.progress=i;var n=this.camera;if(this._elapsed{var s=i(82897),n=i(56694),r=i(89787),o=i(35060),a=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=0,this.current=0,this.destination=0,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope,this.clockwise=!0,this.shortestPath=!1},start:function(t,e,i,s,n,a,h){void 0===i&&(i=1e3),void 0===s&&(s=o.Linear),void 0===n&&(n=!1),void 0===a&&(a=null),void 0===h&&(h=this.camera.scene),void 0===e&&(e=!1),this.shortestPath=e;var l=t;t<0?(l=-1*t,this.clockwise=!1):this.clockwise=!0;var u=360*Math.PI/180;l-=Math.floor(l/u)*u;var c=this.camera;if(!n&&this.isRunning)return c;if(this.isRunning=!0,this.duration=i,this.progress=0,this.source=c.rotation,this.destination=l,"string"==typeof s&&o.hasOwnProperty(s)?this.ease=o[s]:"function"==typeof s&&(this.ease=s),this._elapsed=0,this._onUpdate=a,this._onUpdateScope=h,this.shortestPath){var d=0,p=0;(d=this.destination>this.source?Math.abs(this.destination-this.source):Math.abs(this.destination+u)-this.source)<(p=this.source>this.destination?Math.abs(this.source-this.destination):Math.abs(this.source+u)-this.destination)?this.clockwise=!0:d>p&&(this.clockwise=!1)}return this.camera.emit(r.ROTATE_START,this.camera,this,i,l),c},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=s(this._elapsed/this.duration,0,1);this.progress=i;var n=this.camera;if(this._elapsed=l?Math.abs(h-l):Math.abs(h+a)-l;var u=0;u=this.clockwise?n.rotation+o*r:n.rotation-o*r,n.rotation=u,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,n,i,u)}else n.rotation=this.destination,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,n,i,this.destination),this.effectComplete()}},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(r.ROTATE_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null,this.source=null,this.destination=null}});t.exports=a},3241:(t,e,i)=>{var s=i(82897),n=i(56694),r=i(89787),o=i(93736),a=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.intensity=new o,this.progress=0,this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n){return void 0===t&&(t=100),void 0===e&&(e=.05),void 0===i&&(i=!1),void 0===s&&(s=null),void 0===n&&(n=this.camera.scene),!i&&this.isRunning||(this.isRunning=!0,this.duration=t,this.progress=0,"number"==typeof e?this.intensity.set(e):this.intensity.set(e.x,e.y),this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate=s,this._onUpdateScope=n,this.camera.emit(r.SHAKE_START,this.camera,this,t,e)),this.camera},preRender:function(){this.isRunning&&this.camera.matrix.translate(this._offsetX,this._offsetY)},update:function(t,e){if(this.isRunning)if(this._elapsed+=e,this.progress=s(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed{var s=i(82897),n=i(56694),r=i(35060),o=i(89787),a=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=1,this.destination=1,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n,a){void 0===e&&(e=1e3),void 0===i&&(i=r.Linear),void 0===s&&(s=!1),void 0===n&&(n=null),void 0===a&&(a=this.camera.scene);var h=this.camera;return!s&&this.isRunning||(this.isRunning=!0,this.duration=e,this.progress=0,this.source=h.zoom,this.destination=t,"string"==typeof i&&r.hasOwnProperty(i)?this.ease=r[i]:"function"==typeof i&&(this.ease=i),this._elapsed=0,this._onUpdate=n,this._onUpdateScope=a,this.camera.emit(o.ZOOM_START,this.camera,this,e,t)),h},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=s(this._elapsed/this.duration,0,1),this._elapsed{t.exports={Fade:i(92522),Flash:i(22151),Pan:i(37551),Shake:i(3241),RotateTo:i(1771),Zoom:i(13383)}},39577:t=>{t.exports="cameradestroy"},85373:t=>{t.exports="camerafadeincomplete"},92057:t=>{t.exports="camerafadeinstart"},1903:t=>{t.exports="camerafadeoutcomplete"},96131:t=>{t.exports="camerafadeoutstart"},85409:t=>{t.exports="cameraflashcomplete"},25500:t=>{t.exports="cameraflashstart"},44071:t=>{t.exports="followupdate"},19818:t=>{t.exports="camerapancomplete"},80002:t=>{t.exports="camerapanstart"},87966:t=>{t.exports="postrender"},74217:t=>{t.exports="prerender"},34805:t=>{t.exports="camerarotatecomplete"},30408:t=>{t.exports="camerarotatestart"},49856:t=>{t.exports="camerashakecomplete"},69189:t=>{t.exports="camerashakestart"},67657:t=>{t.exports="camerazoomcomplete"},14229:t=>{t.exports="camerazoomstart"},89787:(t,e,i)=>{t.exports={DESTROY:i(39577),FADE_IN_COMPLETE:i(85373),FADE_IN_START:i(92057),FADE_OUT_COMPLETE:i(1903),FADE_OUT_START:i(96131),FLASH_COMPLETE:i(85409),FLASH_START:i(25500),FOLLOW_UPDATE:i(44071),PAN_COMPLETE:i(19818),PAN_START:i(80002),POST_RENDER:i(87966),PRE_RENDER:i(74217),ROTATE_COMPLETE:i(34805),ROTATE_START:i(30408),SHAKE_COMPLETE:i(49856),SHAKE_START:i(69189),ZOOM_COMPLETE:i(67657),ZOOM_START:i(14229)}},32356:(t,e,i)=>{t.exports={Camera:i(47751),BaseCamera:i(51052),CameraManager:i(62382),Effects:i(53030),Events:i(89787)}},84219:(t,e,i)=>{var s=i(56694),n=i(10850),r=new s({initialize:function(t){this.camera=n(t,"camera",null),this.left=n(t,"left",null),this.right=n(t,"right",null),this.up=n(t,"up",null),this.down=n(t,"down",null),this.zoomIn=n(t,"zoomIn",null),this.zoomOut=n(t,"zoomOut",null),this.zoomSpeed=n(t,"zoomSpeed",.01),this.minZoom=n(t,"minZoom",.001),this.maxZoom=n(t,"maxZoom",1e3),this.speedX=0,this.speedY=0;var e=n(t,"speed",null);"number"==typeof e?(this.speedX=e,this.speedY=e):(this.speedX=n(t,"speed.x",0),this.speedY=n(t,"speed.y",0)),this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this.up&&this.up.isDown?e.scrollY-=this.speedY*t|0:this.down&&this.down.isDown&&(e.scrollY+=this.speedY*t|0),this.left&&this.left.isDown?e.scrollX-=this.speedX*t|0:this.right&&this.right.isDown&&(e.scrollX+=this.speedX*t|0),this.zoomIn&&this.zoomIn.isDown?(e.zoom-=this.zoomSpeed,e.zoomthis.maxZoom&&(e.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},69370:(t,e,i)=>{var s=i(56694),n=i(10850),r=new s({initialize:function(t){this.camera=n(t,"camera",null),this.left=n(t,"left",null),this.right=n(t,"right",null),this.up=n(t,"up",null),this.down=n(t,"down",null),this.zoomIn=n(t,"zoomIn",null),this.zoomOut=n(t,"zoomOut",null),this.zoomSpeed=n(t,"zoomSpeed",.01),this.minZoom=n(t,"minZoom",.001),this.maxZoom=n(t,"maxZoom",1e3),this.accelX=0,this.accelY=0;var e=n(t,"acceleration",null);"number"==typeof e?(this.accelX=e,this.accelY=e):(this.accelX=n(t,"acceleration.x",0),this.accelY=n(t,"acceleration.y",0)),this.dragX=0,this.dragY=0;var i=n(t,"drag",null);"number"==typeof i?(this.dragX=i,this.dragY=i):(this.dragX=n(t,"drag.x",0),this.dragY=n(t,"drag.y",0)),this.maxSpeedX=0,this.maxSpeedY=0;var s=n(t,"maxSpeed",null);"number"==typeof s?(this.maxSpeedX=s,this.maxSpeedY=s):(this.maxSpeedX=n(t,"maxSpeed.x",0),this.maxSpeedY=n(t,"maxSpeed.y",0)),this._speedX=0,this._speedY=0,this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this._speedX>0?(this._speedX-=this.dragX*t,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*t,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*t,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*t,this._speedY>0&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoomthis.maxZoom&&(e.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},6524:(t,e,i)=>{t.exports={FixedKeyControl:i(84219),SmoothedKeyControl:i(69370)}},44143:(t,e,i)=>{t.exports={Controls:i(6524),Scene2D:i(32356)}},86459:(t,e,i)=>{var s={VERSION:"3.60.0-beta.3",BlendModes:i(95723),ScaleModes:i(27394),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=s},14033:(t,e,i)=>{var s=i(56694),n=i(86459),r=i(77290),o=i(72632),a=i(10850),h=i(42911),l=i(5923),u=i(72283),c=i(18360),d=i(93222),p=new s({initialize:function(t){void 0===t&&(t={});this.width=a(t,"width",1024),this.height=a(t,"height",768),this.zoom=a(t,"zoom",1),this.parent=a(t,"parent",void 0),this.scaleMode=a(t,"scaleMode",0),this.expandParent=a(t,"expandParent",!0),this.autoRound=a(t,"autoRound",!1),this.autoCenter=a(t,"autoCenter",0),this.resizeInterval=a(t,"resizeInterval",500),this.fullscreenTarget=a(t,"fullscreenTarget",null),this.minWidth=a(t,"minWidth",0),this.maxWidth=a(t,"maxWidth",0),this.minHeight=a(t,"minHeight",0),this.maxHeight=a(t,"maxHeight",0);var e=a(t,"scale",null);e&&(this.width=a(e,"width",this.width),this.height=a(e,"height",this.height),this.zoom=a(e,"zoom",this.zoom),this.parent=a(e,"parent",this.parent),this.scaleMode=a(e,"mode",this.scaleMode),this.expandParent=a(e,"expandParent",this.expandParent),this.autoRound=a(e,"autoRound",this.autoRound),this.autoCenter=a(e,"autoCenter",this.autoCenter),this.resizeInterval=a(e,"resizeInterval",this.resizeInterval),this.fullscreenTarget=a(e,"fullscreenTarget",this.fullscreenTarget),this.minWidth=a(e,"min.width",this.minWidth),this.maxWidth=a(e,"max.width",this.maxWidth),this.minHeight=a(e,"min.height",this.minHeight),this.maxHeight=a(e,"max.height",this.maxHeight)),this.renderType=a(t,"type",n.AUTO),this.canvas=a(t,"canvas",null),this.context=a(t,"context",null),this.canvasStyle=a(t,"canvasStyle",null),this.customEnvironment=a(t,"customEnvironment",!1),this.sceneConfig=a(t,"scene",null),this.seed=a(t,"seed",[(Date.now()*Math.random()).toString()]),l.RND=new l.RandomDataGenerator(this.seed),this.gameTitle=a(t,"title",""),this.gameURL=a(t,"url","https://phaser.io"),this.gameVersion=a(t,"version",""),this.autoFocus=a(t,"autoFocus",!0),this.domCreateContainer=a(t,"dom.createContainer",!1),this.domPointerEvents=a(t,"dom.pointerEvents","none"),this.inputKeyboard=a(t,"input.keyboard",!0),this.inputKeyboardEventTarget=a(t,"input.keyboard.target",window),this.inputKeyboardCapture=a(t,"input.keyboard.capture",[]),this.inputMouse=a(t,"input.mouse",!0),this.inputMouseEventTarget=a(t,"input.mouse.target",null),this.inputMousePreventDefaultDown=a(t,"input.mouse.preventDefaultDown",!0),this.inputMousePreventDefaultUp=a(t,"input.mouse.preventDefaultUp",!0),this.inputMousePreventDefaultMove=a(t,"input.mouse.preventDefaultMove",!0),this.inputMousePreventDefaultWheel=a(t,"input.mouse.preventDefaultWheel",!0),this.inputTouch=a(t,"input.touch",r.input.touch),this.inputTouchEventTarget=a(t,"input.touch.target",null),this.inputTouchCapture=a(t,"input.touch.capture",!0),this.inputActivePointers=a(t,"input.activePointers",1),this.inputSmoothFactor=a(t,"input.smoothFactor",0),this.inputWindowEvents=a(t,"input.windowEvents",!0),this.inputGamepad=a(t,"input.gamepad",!1),this.inputGamepadEventTarget=a(t,"input.gamepad.target",window),this.disableContextMenu=a(t,"disableContextMenu",!1),this.audio=a(t,"audio",{}),this.hideBanner=!1===a(t,"banner",null),this.hidePhaser=a(t,"banner.hidePhaser",!1),this.bannerTextColor=a(t,"banner.text","#ffffff"),this.bannerBackgroundColor=a(t,"banner.background",["#ff0000","#ffff00","#00ff00","#00ffff","#000000"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=a(t,"fps",null);var i=a(t,"render",t);this.pipeline=a(i,"pipeline",null),this.antialias=a(i,"antialias",!0),this.antialiasGL=a(i,"antialiasGL",!0),this.mipmapFilter=a(i,"mipmapFilter","LINEAR"),this.desynchronized=a(i,"desynchronized",!1),this.roundPixels=a(i,"roundPixels",!1),this.pixelArt=a(i,"pixelArt",1!==this.zoom),this.pixelArt&&(this.antialias=!1,this.antialiasGL=!1,this.roundPixels=!0),this.transparent=a(i,"transparent",!1),this.clearBeforeRender=a(i,"clearBeforeRender",!0),this.preserveDrawingBuffer=a(i,"preserveDrawingBuffer",!1),this.premultipliedAlpha=a(i,"premultipliedAlpha",!0),this.failIfMajorPerformanceCaveat=a(i,"failIfMajorPerformanceCaveat",!1),this.powerPreference=a(i,"powerPreference","default"),this.batchSize=a(i,"batchSize",4096),this.maxTextures=a(i,"maxTextures",-1),this.maxLights=a(i,"maxLights",10);var s=a(t,"backgroundColor",0);this.backgroundColor=d(s),this.transparent&&(this.backgroundColor=d(0),this.backgroundColor.alpha=0),this.preBoot=a(t,"callbacks.preBoot",u),this.postBoot=a(t,"callbacks.postBoot",u),this.physics=a(t,"physics",{}),this.defaultPhysicsSystem=a(this.physics,"default",!1),this.loaderBaseURL=a(t,"loader.baseURL",""),this.loaderPath=a(t,"loader.path","");var p=r.os.android?6:32;this.loaderMaxParallelDownloads=a(t,"loader.maxParallelDownloads",p),this.loaderCrossOrigin=a(t,"loader.crossOrigin",void 0),this.loaderResponseType=a(t,"loader.responseType",""),this.loaderAsync=a(t,"loader.async",!0),this.loaderUser=a(t,"loader.user",""),this.loaderPassword=a(t,"loader.password",""),this.loaderTimeout=a(t,"loader.timeout",0),this.loaderWithCredentials=a(t,"loader.withCredentials",!1),this.loaderImageLoadType=a(t,"loader.imageLoadType","XHR"),this.installGlobalPlugins=[],this.installScenePlugins=[];var f=a(t,"plugins",null),v=c.DefaultScene;f&&(Array.isArray(f)?this.defaultPlugins=f:h(f)&&(this.installGlobalPlugins=o(f,"global",[]),this.installScenePlugins=o(f,"scene",[]),Array.isArray(f.default)?v=f.default:Array.isArray(f.defaultMerge)&&(v=v.concat(f.defaultMerge)))),this.defaultPlugins=v;var g="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=a(t,"images.default",g+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=a(t,"images.missing",g+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),this.whiteImage=a(t,"images.white","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABdJREFUeNpi/P//PwMMMDEgAdwcgAADAJZuAwXJYZOzAAAAAElFTkSuQmCC"),window&&(window.FORCE_WEBGL?this.renderType=n.WEBGL:window.FORCE_CANVAS&&(this.renderType=n.CANVAS))}});t.exports=p},50150:(t,e,i)=>{var s=i(70616),n=i(61068),r=i(86459),o=i(90185);t.exports=function(t){var e=t.config;if((e.customEnvironment||e.canvas)&&e.renderType===r.AUTO)throw new Error("Must set explicit renderType in custom environment");if(!e.customEnvironment&&!e.canvas&&e.renderType!==r.HEADLESS)if(e.renderType===r.AUTO&&(e.renderType=o.webGL?r.WEBGL:r.CANVAS),e.renderType===r.WEBGL){if(!o.webGL)throw new Error("Cannot create WebGL context, aborting.")}else{if(e.renderType!==r.CANVAS)throw new Error("Unknown value for renderer type: "+e.renderType);if(!o.canvas)throw new Error("Cannot create Canvas context, aborting.")}e.antialias||n.disableSmoothing();var a,h,l=t.scale.baseSize,u=l.width,c=l.height;(e.canvas?(t.canvas=e.canvas,t.canvas.width=u,t.canvas.height=c):t.canvas=n.create(t,u,c,e.renderType),e.canvasStyle&&(t.canvas.style=e.canvasStyle),e.antialias||s.setCrisp(t.canvas),e.renderType!==r.HEADLESS)&&(a=i(91135),h=i(11857),e.renderType===r.WEBGL?t.renderer=new h(t):(t.renderer=new a(t),t.context=t.renderer.gameContext))}},77291:(t,e,i)=>{var s=i(86459);t.exports=function(t){var e=t.config;if(!e.hideBanner){var i="WebGL";e.renderType===s.CANVAS?i="Canvas":e.renderType===s.HEADLESS&&(i="Headless");var n,r=e.audio,o=t.device.audio;if(n=o.webAudio&&!r.disableWebAudio?"Web Audio":r.noAudio||!o.webAudio&&!o.audioData?"No Audio":"HTML5 Audio",t.device.browser.ie)window.console&&console.log("Phaser v"+s.VERSION+" / https://phaser.io");else{var a,h="",l=[h];if(Array.isArray(e.bannerBackgroundColor))e.bannerBackgroundColor.forEach((function(t){h=h.concat("%c "),l.push("background: "+t),a=t})),l[l.length-1]="color: "+e.bannerTextColor+"; background: "+a;else h=h.concat("%c "),l.push("color: "+e.bannerTextColor+"; background: "+e.bannerBackgroundColor);l.push("background: transparent"),e.gameTitle&&(h=h.concat(e.gameTitle),e.gameVersion&&(h=h.concat(" v"+e.gameVersion)),e.hidePhaser||(h=h.concat(" / ")));e.hidePhaser||(h=h.concat("Phaser v"+s.VERSION+" ("+i+" | "+n+")")),h=h.concat(" %c "+e.gameURL),l[0]=h,console.log.apply(console,l)}}}},15213:(t,e,i)=>{var s=i(99584),n=i(90249),r=i(43474),o=i(61068),a=i(56694),h=i(14033),l=i(85178),u=i(50150),c=i(81078),d=i(77291),p=i(77290),f=i(21546),v=i(6659),g=i(97081),m=i(69898),y=i(91963),x=i(49274),T=i(756),w=i(13553),b=i(38203),E=i(6237),S=i(26617),A=i(26493),_=i(84191),C=new a({initialize:function(t){this.config=new h(t),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new v,this.anims=new n(this),this.textures=new E(this),this.cache=new r(this),this.registry=new c(this),this.input=new m(this,this.config),this.scene=new w(this,this.config.sceneConfig),this.device=p,this.scale=new T(this,this.config),this.sound=null,this.sound=_.create(this),this.loop=new S(this,this.config.fps),this.plugins=new x(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,f(this.boot.bind(this))},boot:function(){y.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),u(this),l(this),d(this),s(this.canvas,this.config.parent),this.textures.once(b.READY,this.texturesReady,this),this.events.emit(g.BOOT)):console.warn("Aborting. Core Plugins missing.")},texturesReady:function(){this.events.emit(g.READY),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),A(this);var t=this.events;t.on(g.HIDDEN,this.onHidden,this),t.on(g.VISIBLE,this.onVisible,this),t.on(g.BLUR,this.onBlur,this),t.on(g.FOCUS,this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit(g.PRE_STEP,t,e),i.emit(g.STEP,t,e),this.scene.update(t,e),i.emit(g.POST_STEP,t,e);var s=this.renderer;s.preRender(),i.emit(g.PRE_RENDER,s,t,e),this.scene.render(s),s.postRender(),i.emit(g.POST_RENDER,s,t,e)},headlessStep:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit(g.PRE_STEP,t,e),i.emit(g.STEP,t,e),this.scene.update(t,e),i.emit(g.POST_STEP,t,e),i.emit(g.PRE_RENDER),i.emit(g.POST_RENDER)},onHidden:function(){this.loop.pause(),this.events.emit(g.PAUSE)},onVisible:function(){this.loop.resume(),this.events.emit(g.RESUME)},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},getFrame:function(){return this.loop.frame},getTime:function(){return this.loop.now},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.scene.destroy(),this.events.emit(g.DESTROY),this.events.removeAllListeners(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(o.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.domContainer&&this.domContainer.parentNode.removeChild(this.domContainer),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=C},26617:(t,e,i)=>{var s=i(56694),n=i(10850),r=i(72283),o=i(27385),a=new s({initialize:function(t,e){this.game=t,this.raf=new o,this.started=!1,this.running=!1,this.minFps=n(e,"min",5),this.targetFps=n(e,"target",60),this._min=1e3/this.minFps,this._target=1e3/this.targetFps,this.actualFps=this.targetFps,this.nextFpsUpdate=0,this.framesThisSecond=0,this.callback=r,this.forceSetTimeOut=n(e,"forceSetTimeOut",!1),this.time=0,this.startTime=0,this.lastTime=0,this.frame=0,this.inFocus=!0,this._pauseTime=0,this._coolDown=0,this.delta=0,this.deltaIndex=0,this.deltaHistory=[],this.deltaSmoothingMax=n(e,"deltaHistory",10),this.panicMax=n(e,"panicMax",120),this.rawDelta=0,this.now=0,this.smoothStep=n(e,"smoothStep",!0)},blur:function(){this.inFocus=!1},focus:function(){this.inFocus=!0,this.resetDelta()},pause:function(){this._pauseTime=window.performance.now()},resume:function(){this.resetDelta(),this.startTime+=this.time-this._pauseTime},resetDelta:function(){var t=window.performance.now();this.time=t,this.lastTime=t,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0;for(var e=0;e0||!this.inFocus)&&(this._coolDown--,r=Math.min(r,this._target)),r>this._min&&(r=s[i],r=Math.min(r,this._min)),s[i]=r,this.deltaIndex++,this.deltaIndex>n&&(this.deltaIndex=0),o=0;for(var a=0;athis.nextFpsUpdate&&(this.actualFps=.25*this.framesThisSecond+.75*this.actualFps,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0),this.framesThisSecond++;var h=o/this._target;this.callback(t,o,h),this.lastTime=t,this.frame++},tick:function(){this.step()},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){this.running||(t&&(this.startTime+=-this.lastTime+(this.lastTime+window.performance.now())),this.raf.start(this.step.bind(this),this.useRAF),this.running=!0,this.step())},getDuration:function(){return Math.round(this.lastTime-this.startTime)/1e3},getDurationMS:function(){return Math.round(this.lastTime-this.startTime)},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.callback=r,this.raf=null,this.game=null}});t.exports=a},26493:(t,e,i)=>{var s=i(97081);t.exports=function(t){var e,i=t.events;if(void 0!==document.hidden)e="visibilitychange";else{["webkit","moz","ms"].forEach((function(t){void 0!==document[t+"Hidden"]&&(document.hidden=function(){return document[t+"Hidden"]},e=t+"visibilitychange")}))}e&&document.addEventListener(e,(function(t){document.hidden||"pause"===t.type?i.emit(s.HIDDEN):i.emit(s.VISIBLE)}),!1),window.onblur=function(){i.emit(s.BLUR)},window.onfocus=function(){i.emit(s.FOCUS)},window.focus&&t.config.autoFocus&&window.focus()}},41651:t=>{t.exports="blur"},5520:t=>{t.exports="boot"},51673:t=>{t.exports="contextlost"},66336:t=>{t.exports="contextrestored"},25055:t=>{t.exports="destroy"},23767:t=>{t.exports="focus"},57564:t=>{t.exports="hidden"},38327:t=>{t.exports="pause"},43807:t=>{t.exports="postrender"},73652:t=>{t.exports="poststep"},780:t=>{t.exports="prerender"},13781:t=>{t.exports="prestep"},38247:t=>{t.exports="ready"},29129:t=>{t.exports="resume"},34994:t=>{t.exports="step"},98704:t=>{t.exports="visible"},97081:(t,e,i)=>{t.exports={BLUR:i(41651),BOOT:i(5520),CONTEXT_LOST:i(51673),CONTEXT_RESTORED:i(66336),DESTROY:i(25055),FOCUS:i(23767),HIDDEN:i(57564),PAUSE:i(38327),POST_RENDER:i(43807),POST_STEP:i(73652),PRE_RENDER:i(780),PRE_STEP:i(13781),READY:i(38247),RESUME:i(29129),STEP:i(34994),VISIBLE:i(98704)}},80293:(t,e,i)=>{t.exports={Config:i(14033),CreateRenderer:i(50150),DebugHeader:i(77291),Events:i(97081),TimeStep:i(26617),VisibilityHandler:i(26493)}},52780:(t,e,i)=>{var s=i(81543),n=i(61068),r=i(10850);t.exports=function(t){var e=r(t,"data",[]),i=r(t,"canvas",null),o=r(t,"palette",s),a=r(t,"pixelWidth",1),h=r(t,"pixelHeight",a),l=r(t,"resizeCanvas",!0),u=r(t,"clearCanvas",!0),c=r(t,"preRender",null),d=r(t,"postRender",null),p=Math.floor(Math.abs(e[0].length*a)),f=Math.floor(Math.abs(e.length*h));i||(i=n.create2D(this,p,f),l=!1,u=!1),l&&(i.width=p,i.height=f);var v=i.getContext("2d");u&&v.clearRect(0,0,p,f),c&&c(i,v);for(var g=0;g{t.exports={GenerateTexture:i(52780),Palettes:i(25235)}},81543:t=>{t.exports={0:"#000",1:"#9D9D9D",2:"#FFF",3:"#BE2633",4:"#E06F8B",5:"#493C2B",6:"#A46422",7:"#EB8931",8:"#F7E26B",9:"#2F484E",A:"#44891A",B:"#A3CE27",C:"#1B2632",D:"#005784",E:"#31A2F2",F:"#B2DCEF"}},75846:t=>{t.exports={0:"#000",1:"#fff",2:"#8b4131",3:"#7bbdc5",4:"#8b41ac",5:"#6aac41",6:"#3931a4",7:"#d5de73",8:"#945a20",9:"#5a4100",A:"#bd736a",B:"#525252",C:"#838383",D:"#acee8b",E:"#7b73de",F:"#acacac"}},83206:t=>{t.exports={0:"#000",1:"#2234d1",2:"#0c7e45",3:"#44aacc",4:"#8a3622",5:"#5c2e78",6:"#aa5c3d",7:"#b5b5b5",8:"#5e606e",9:"#4c81fb",A:"#6cd947",B:"#7be2f9",C:"#eb8a60",D:"#e23d69",E:"#ffd93f",F:"#fff"}},13194:t=>{t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#f5f4eb"}},50686:t=>{t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#fff"}},25235:(t,e,i)=>{t.exports={ARNE16:i(81543),C64:i(75846),CGA:i(83206),JMP:i(13194),MSX:i(50686)}},63120:(t,e,i)=>{var s=i(56694),n=i(34631),r=i(38517),o=i(93736),a=new s({Extends:r,initialize:function(t,e,i,s){r.call(this,"CubicBezierCurve"),Array.isArray(t)&&(s=new o(t[6],t[7]),i=new o(t[4],t[5]),e=new o(t[2],t[3]),t=new o(t[0],t[1])),this.p0=t,this.p1=e,this.p2=i,this.p3=s},getStartPoint:function(t){return void 0===t&&(t=new o),t.copy(this.p0)},getResolution:function(t){return t},getPoint:function(t,e){void 0===e&&(e=new o);var i=this.p0,s=this.p1,r=this.p2,a=this.p3;return e.set(n(t,i.x,s.x,r.x,a.x),n(t,i.y,s.y,r.y,a.y))},draw:function(t,e){void 0===e&&(e=32);var i=this.getPoints(e);t.beginPath(),t.moveTo(this.p0.x,this.p0.y);for(var s=1;s{var s=i(56694),n=i(80222),r=i(74118),o=i(93736),a=new s({initialize:function(t){this.type=t,this.defaultDivisions=5,this.arcLengthDivisions=100,this.cacheArcLengths=[],this.needsUpdate=!0,this.active=!0,this._tmpVec2A=new o,this._tmpVec2B=new o},draw:function(t,e){return void 0===e&&(e=32),t.strokePoints(this.getPoints(e))},getBounds:function(t,e){t||(t=new r),void 0===e&&(e=16);var i=this.getLength();e>i&&(e=i/2);var s=Math.max(1,Math.round(i/e));return n(this.getSpacedPoints(s),t)},getDistancePoints:function(t){var e=this.getLength(),i=Math.max(1,e/t);return this.getSpacedPoints(i)},getEndPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(1,t)},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],s=this.getPoint(0,this._tmpVec2A),n=0;i.push(0);for(var r=1;r<=t;r++)n+=(e=this.getPoint(r/t,this._tmpVec2B)).distance(s),i.push(n),s.copy(e);return this.cacheArcLengths=i,i},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var s=0;s<=t;s++)i.push(this.getPoint(s/t));return i},getRandomPoint:function(t){return void 0===t&&(t=new o),this.getPoint(Math.random(),t)},getSpacedPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var s=0;s<=t;s++){var n=this.getUtoTmapping(s/t,null,t);i.push(this.getPoint(n))}return i},getStartPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(0,t)},getTangent:function(t,e){void 0===e&&(e=new o);var i=1e-4,s=t-i,n=t+i;return s<0&&(s=0),n>1&&(n=1),this.getPoint(s,this._tmpVec2A),this.getPoint(n,e),e.subtract(this._tmpVec2A).normalize()},getTangentAt:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)},getTFromDistance:function(t,e){return t<=0?0:this.getUtoTmapping(0,t,e)},getUtoTmapping:function(t,e,i){var s,n=this.getLengths(i),r=0,o=n.length;s=e?Math.min(e,n[o-1]):t*n[o-1];for(var a,h=0,l=o-1;h<=l;)if((a=n[r=Math.floor(h+(l-h)/2)]-s)<0)h=r+1;else{if(!(a>0)){l=r;break}l=r-1}if(n[r=l]===s)return r/(o-1);var u=n[r];return(r+(s-u)/(n[r+1]-u))/(o-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});t.exports=a},48835:(t,e,i)=>{var s=i(56694),n=i(38517),r=i(75606),o=i(10850),a=i(23701),h=i(93736),l=new s({Extends:n,initialize:function(t,e,i,s,a,l,u,c){if("object"==typeof t){var d=t;t=o(d,"x",0),e=o(d,"y",0),i=o(d,"xRadius",0),s=o(d,"yRadius",i),a=o(d,"startAngle",0),l=o(d,"endAngle",360),u=o(d,"clockwise",!1),c=o(d,"rotation",0)}else void 0===s&&(s=i),void 0===a&&(a=0),void 0===l&&(l=360),void 0===u&&(u=!1),void 0===c&&(c=0);n.call(this,"EllipseCurve"),this.p0=new h(t,e),this._xRadius=i,this._yRadius=s,this._startAngle=r(a),this._endAngle=r(l),this._clockwise=u,this._rotation=r(c)},getStartPoint:function(t){return void 0===t&&(t=new h),this.getPoint(0,t)},getResolution:function(t){return 2*t},getPoint:function(t,e){void 0===e&&(e=new h);for(var i=2*Math.PI,s=this._endAngle-this._startAngle,n=Math.abs(s)i;)s-=i;s{var s=i(56694),n=i(38517),r=i(80222),o=i(74118),a=i(93736),h=new s({Extends:n,initialize:function(t,e){n.call(this,"LineCurve"),Array.isArray(t)&&(e=new a(t[2],t[3]),t=new a(t[0],t[1])),this.p0=t,this.p1=e,this.arcLengthDivisions=1},getBounds:function(t){return void 0===t&&(t=new o),r([this.p0,this.p1],t)},getStartPoint:function(t){return void 0===t&&(t=new a),t.copy(this.p0)},getResolution:function(t){return void 0===t&&(t=1),t},getPoint:function(t,e){return void 0===e&&(e=new a),1===t?e.copy(this.p1):(e.copy(this.p1).subtract(this.p0).scale(t).add(this.p0),e)},getPointAt:function(t,e){return this.getPoint(t,e)},getTangent:function(t,e){return void 0===e&&(e=new a),e.copy(this.p1).subtract(this.p0).normalize(),e},getUtoTmapping:function(t,e,i){var s;if(e){var n=this.getLengths(i),r=n[n.length-1];s=Math.min(e,r)/r}else s=t;return s},draw:function(t){return t.lineBetween(this.p0.x,this.p0.y,this.p1.x,this.p1.y),t},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y]}}});h.fromJSON=function(t){var e=t.points,i=new a(e[0],e[1]),s=new a(e[2],e[3]);return new h(i,s)},t.exports=h},64761:(t,e,i)=>{var s=i(56694),n=i(38517),r=i(16252),o=i(93736),a=new s({Extends:n,initialize:function(t,e,i){n.call(this,"QuadraticBezier"),Array.isArray(t)&&(i=new o(t[4],t[5]),e=new o(t[2],t[3]),t=new o(t[0],t[1])),this.p0=t,this.p1=e,this.p2=i},getStartPoint:function(t){return void 0===t&&(t=new o),t.copy(this.p0)},getResolution:function(t){return t},getPoint:function(t,e){void 0===e&&(e=new o);var i=this.p0,s=this.p1,n=this.p2;return e.set(r(t,i.x,s.x,n.x),r(t,i.y,s.y,n.y))},draw:function(t,e){void 0===e&&(e=32);var i=this.getPoints(e);t.beginPath(),t.moveTo(this.p0.x,this.p0.y);for(var s=1;s{var s=i(14976),n=i(56694),r=i(38517),o=i(93736),a=new n({Extends:r,initialize:function(t){void 0===t&&(t=[]),r.call(this,"SplineCurve"),this.points=[],this.addPoints(t)},addPoints:function(t){for(var e=0;ei.length-2?i.length-1:r+1],c=i[r>i.length-3?i.length-1:r+2];return e.set(s(a,h.x,l.x,u.x,c.x),s(a,h.y,l.y,u.y,c.y))},toJSON:function(){for(var t=[],e=0;e{t.exports={Path:i(12822),MoveTo:i(53639),CubicBezier:i(63120),Curve:i(38517),Ellipse:i(48835),Line:i(58084),QuadraticBezier:i(64761),Spline:i(11956)}},53639:(t,e,i)=>{var s=i(56694),n=i(93736),r=new s({initialize:function(t,e){this.active=!1,this.p0=new n(t,e)},getPoint:function(t,e){return void 0===e&&(e=new n),e.copy(this.p0)},getPointAt:function(t,e){return this.getPoint(t,e)},getResolution:function(){return 1},getLength:function(){return 0},toJSON:function(){return{type:"MoveTo",points:[this.p0.x,this.p0.y]}}});t.exports=r},12822:(t,e,i)=>{var s=i(56694),n=i(63120),r=i(48835),o=i(61286),a=i(58084),h=i(53639),l=i(64761),u=i(74118),c=i(11956),d=i(93736),p=i(83392),f=new s({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.name="",this.curves=[],this.cacheLengths=[],this.autoClose=!1,this.startPoint=new d,this._tmpVec2A=new d,this._tmpVec2B=new d,"object"==typeof t?this.fromJSON(t):this.startPoint.set(t,e)},add:function(t){return this.curves.push(t),this},circleTo:function(t,e,i){return void 0===e&&(e=!1),this.ellipseTo(t,t,0,360,e,i)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);return t.equals(e)||this.curves.push(new a(e,t)),this},cubicBezierTo:function(t,e,i,s,r,o){var a,h,l,u=this.getEndPoint();return t instanceof d?(a=t,h=e,l=i):(a=new d(i,s),h=new d(r,o),l=new d(t,e)),this.add(new n(u,a,h,l))},quadraticBezierTo:function(t,e,i,s){var n,r,o=this.getEndPoint();return t instanceof d?(n=t,r=e):(n=new d(i,s),r=new d(t,e)),this.add(new l(o,n,r))},draw:function(t,e){for(var i=0;i0?this.curves[this.curves.length-1].getPoint(1,t):t.copy(this.startPoint),t},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},getPoint:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),s=this.getCurveLengths(),n=0;n=i){var r=s[n]-i,o=this.curves[n],a=o.getLength(),h=0===a?0:1-r/a;return o.getPointAt(h,e)}n++}return null},getPoints:function(t){void 0===t&&(t=12);for(var e,i=[],s=0;s1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i},getRandomPoint:function(t){return void 0===t&&(t=new d),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getStartPoint:function(t){return void 0===t&&(t=new d),t.copy(this.startPoint)},getTangent:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),s=this.getCurveLengths(),n=0;n=i){var r=s[n]-i,o=this.curves[n],a=o.getLength(),h=0===a?0:1-r/a;return o.getTangentAt(h,e)}n++}return null},lineTo:function(t,e){t instanceof d?this._tmpVec2B.copy(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new a([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new c(t))},moveTo:function(t,e){return t instanceof d?this.add(new h(t.x,t.y)):this.add(new h(t,e))},toJSON:function(){for(var t=[],e=0;e{var s=i(56694),n=i(35026),r=new s({initialize:function(t,e){this.parent=t,this.events=e,e||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once(n.DESTROY,this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],s=0;s{var s=i(56694),n=i(81078),r=i(91963),o=i(7599),a=new s({Extends:n,initialize:function(t){n.call(this,t,t.sys.events),this.scene=t,this.systems=t.sys,t.sys.events.once(o.BOOT,this.boot,this),t.sys.events.on(o.START,this.start,this)},boot:function(){this.events=this.systems.events,this.events.once(o.DESTROY,this.destroy,this)},start:function(){this.events.once(o.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.systems.events.off(o.SHUTDOWN,this.shutdown,this)},destroy:function(){n.prototype.destroy.call(this),this.events.off(o.START,this.start,this),this.scene=null,this.systems=null}});r.register("DataManagerPlugin",a,"data"),t.exports=a},73569:t=>{t.exports="changedata"},15590:t=>{t.exports="changedata-"},37669:t=>{t.exports="destroy"},87090:t=>{t.exports="removedata"},90142:t=>{t.exports="setdata"},35026:(t,e,i)=>{t.exports={CHANGE_DATA:i(73569),CHANGE_DATA_KEY:i(15590),DESTROY:i(37669),REMOVE_DATA:i(87090),SET_DATA:i(90142)}},1999:(t,e,i)=>{t.exports={DataManager:i(81078),DataManagerPlugin:i(76508),Events:i(35026)}},10720:(t,e,i)=>{var s=i(1350),n={audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return n;n.audioData=!!window.Audio,n.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio"),e=!!t.canPlayType;try{if(e&&(t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,"")&&(n.ogg=!0),(t.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,"")||t.canPlayType("audio/opus;").replace(/^no$/,""))&&(n.opus=!0),t.canPlayType("audio/mpeg;").replace(/^no$/,"")&&(n.mp3=!0),t.canPlayType("audio/wav").replace(/^no$/,"")&&(n.wav=!0),(t.canPlayType("audio/x-m4a;")||t.canPlayType("audio/aac;").replace(/^no$/,""))&&(n.m4a=!0),t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")&&(n.webm=!0),""!==t.canPlayType('audio/mp4;codecs="ec-3"')))if(s.edge)n.dolby=!0;else if(s.safari&&s.safariVersion>=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var i=parseInt(RegExp.$1,10),r=parseInt(RegExp.$2,10);(10===i&&r>=11||i>10)&&(n.dolby=!0)}}catch(t){}return n}()},1350:(t,e,i)=>{var s,n=i(36580),r={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0};t.exports=(s=navigator.userAgent,/Edge\/\d+/.test(s)?r.edge=!0:/Chrome\/(\d+)/.test(s)&&!n.windowsPhone?(r.chrome=!0,r.chromeVersion=parseInt(RegExp.$1,10)):/Firefox\D+(\d+)/.test(s)?(r.firefox=!0,r.firefoxVersion=parseInt(RegExp.$1,10)):/AppleWebKit/.test(s)&&n.iOS?r.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(s)?(r.ie=!0,r.ieVersion=parseInt(RegExp.$1,10)):/Opera/.test(s)?r.opera=!0:/Safari/.test(s)&&!n.windowsPhone?r.safari=!0:/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(s)&&(r.ie=!0,r.trident=!0,r.tridentVersion=parseInt(RegExp.$1,10),r.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(s)&&(r.silk=!0),r)},98581:(t,e,i)=>{var s,n,r,o=i(61068),a={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=("function"!=typeof importScripts&&void 0!==document&&(a.supportNewBlendModes=(s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",n="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(r=new Image).onload=function(){var t=new Image;t.onload=function(){var e=o.create(t,6,1).getContext("2d");if(e.globalCompositeOperation="multiply",e.drawImage(r,0,0),e.drawImage(t,2,0),!e.getImageData(2,0,1,1))return!1;var i=e.getImageData(2,0,1,1).data;o.remove(t),a.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=s+"/wCKxvRF"+n},r.src=s+"AP804Oa6"+n,!1),a.supportInverseAlpha=function(){var t=o.create(this,2,1).getContext("2d");t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1);return i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3]}()),a)},90185:(t,e,i)=>{var s=i(36580),n=i(1350),r=i(61068),o={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){if("function"==typeof importScripts)return o;o.canvas=!!window.CanvasRenderingContext2D;try{o.localStorage=!!localStorage.getItem}catch(t){o.localStorage=!1}o.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),o.fileSystem=!!window.requestFileSystem;var t,e,i,a=!1;return o.webGL=function(){if(window.WebGLRenderingContext)try{var t=r.createWebGL(this),e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=r.create2D(this),s=i.getContext("2d").createImageData(1,1);return a=s.data instanceof Uint8ClampedArray,r.remove(t),r.remove(i),!!e}catch(t){return!1}return!1}(),o.worker=!!window.Worker,o.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,o.getUserMedia=o.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,n.firefox&&n.firefoxVersion<21&&(o.getUserMedia=!1),!s.iOS&&(n.ie||n.firefox||n.chrome)&&(o.canvasBitBltShift=!0),(n.safari||n.mobileSafari)&&(o.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(o.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(o.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),o.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==o.littleEndian&&a,o}()},33553:t=>{var e={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){if("function"==typeof importScripts)return e;var t,i="Fullscreen",s="FullScreen",n=["request"+i,"request"+s,"webkitRequest"+i,"webkitRequest"+s,"msRequest"+i,"msRequest"+s,"mozRequest"+s,"mozRequest"+i];for(t=0;t{var s=i(1350),n={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=("function"==typeof importScripts||(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(n.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(n.mspointer=!0),navigator.getGamepads&&(n.gamepads=!0),"onwheel"in window||s.ie&&"WheelEvent"in window?n.wheelEvent="wheel":"onmousewheel"in window?n.wheelEvent="mousewheel":s.firefox&&"MouseScrollEvent"in window&&(n.wheelEvent="DOMMouseScroll")),n)},36580:t=>{var e={android:!1,chromeOS:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};t.exports=function(){if("function"==typeof importScripts)return e;var t=navigator.userAgent;/Windows/.test(t)?e.windows=!0:/Mac OS/.test(t)&&!/like Mac OS/.test(t)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(e.iOS=!0,e.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),e.iOSVersion=parseInt(RegExp.$1,10)):e.macOS=!0:/Android/.test(t)?e.android=!0:/Linux/.test(t)?e.linux=!0:/iP[ao]d|iPhone/i.test(t)?(e.iOS=!0,navigator.appVersion.match(/OS (\d+)/),e.iOSVersion=parseInt(RegExp.$1,10),e.iPhone=-1!==t.toLowerCase().indexOf("iphone"),e.iPad=-1!==t.toLowerCase().indexOf("ipad")):/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?e.kindle=!0:/CrOS/.test(t)&&(e.chromeOS=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(e.android=!1,e.iOS=!1,e.macOS=!1,e.windows=!0,e.windowsPhone=!0);var i=/Silk/.test(t);return(e.windows||e.macOS||e.linux&&!i||e.chromeOS)&&(e.desktop=!0),(e.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(e.desktop=!1),navigator.standalone&&(e.webApp=!0),"function"!=typeof importScripts&&(void 0!==window.cordova&&(e.cordova=!0),void 0!==window.ejecta&&(e.ejecta=!0)),"undefined"!=typeof process&&process.versions&&process.versions.node&&(e.node=!0),e.node&&"object"==typeof process.versions&&(e.nodeWebkit=!!process.versions["node-webkit"],e.electron=!!process.versions.electron),/Crosswalk/.test(t)&&(e.crosswalk=!0),e.pixelRatio=window.devicePixelRatio||1,e}()},53861:t=>{var e={h264:!1,hls:!1,mp4:!1,ogg:!1,vp9:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return e;var t=document.createElement("video"),i=!!t.canPlayType;try{i&&(t.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,"")&&(e.ogg=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,"")&&(e.h264=!0,e.mp4=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")&&(e.webm=!0),t.canPlayType('video/webm; codecs="vp9"').replace(/^no$/,"")&&(e.vp9=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/,"")&&(e.hls=!0))}catch(t){}return e}()},77290:(t,e,i)=>{t.exports={os:i(36580),browser:i(1350),features:i(90185),input:i(95872),audio:i(10720),video:i(53861),fullscreen:i(33553),canvasFeatures:i(98581)}},65246:(t,e,i)=>{var s=new(i(56694))({initialize:function(){this._matrix=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],this.alpha=1,this._dirty=!0,this._data},set:function(t){return this._matrix=t,this._dirty=!0,this},reset:function(){var t=this._matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=1,t[13]=0,t[14]=0,t[15]=0,t[16]=0,t[17]=0,t[18]=1,t[19]=0,this._dirty=!0,this},getData:function(){if(this._dirty){var t=new Float32Array(this._matrix);t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,this._data=t,this._dirty=!1}return this._data},brightness:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t;return this.multiply([i,0,0,0,0,0,i,0,0,0,0,0,i,0,0,0,0,0,1,0],e)},saturate:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=2*t/3+1,s=-.5*(i-1);return this.multiply([i,s,s,0,0,s,i,s,0,0,s,s,i,0,0,0,0,0,1,0],e)},desaturate:function(t){return void 0===t&&(t=!1),this.saturate(-1,t)},hue:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1),t=t/180*Math.PI;var i=Math.cos(t),s=Math.sin(t),n=.213,r=.715,o=.072;return this.multiply([n+.787*i+s*-n,r+i*-r+s*-r,o+i*-o+.928*s,0,0,n+i*-n+.143*s,r+i*(1-r)+.14*s,o+i*-o+-.283*s,0,0,n+i*-n+-.787*s,r+i*-r+s*r,o+.928*i+s*o,0,0,0,0,0,1,0],e)},grayscale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=!1),this.saturate(-t,e)},blackWhite:function(t){return void 0===t&&(t=!1),this.multiply([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},contrast:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t+1,s=-.5*(i-1);return this.multiply([i,0,0,0,s,0,i,0,0,s,0,0,i,0,s,0,0,0,1,0],e)},negative:function(t){return void 0===t&&(t=!1),this.multiply([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},desaturateLuminance:function(t){return void 0===t&&(t=!1),this.multiply([.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0],t)},sepia:function(t){return void 0===t&&(t=!1),this.multiply([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},night:function(t,e){return void 0===t&&(t=.1),void 0===e&&(e=!1),this.multiply([-2*t,-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0],e)},lsd:function(t){return void 0===t&&(t=!1),this.multiply([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},brown:function(t){return void 0===t&&(t=!1),this.multiply([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},vintagePinhole:function(t){return void 0===t&&(t=!1),this.multiply([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},kodachrome:function(t){return void 0===t&&(t=!1),this.multiply([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],t)},technicolor:function(t){return void 0===t&&(t=!1),this.multiply([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],t)},polaroid:function(t){return void 0===t&&(t=!1),this.multiply([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},shiftToBGR:function(t){return void 0===t&&(t=!1),this.multiply([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},multiply:function(t,e){e||this.reset();for(var i=this._matrix,s=[],n=0;n<20;n++)s[n]=i[n];return i[0]=s[0]*t[0]+s[1]*t[5]+s[2]*t[10]+s[3]*t[15],i[1]=s[0]*t[1]+s[1]*t[6]+s[2]*t[11]+s[3]*t[16],i[2]=s[0]*t[2]+s[1]*t[7]+s[2]*t[12]+s[3]*t[17],i[3]=s[0]*t[3]+s[1]*t[8]+s[2]*t[13]+s[3]*t[18],i[4]=s[0]*t[4]+s[1]*t[9]+s[2]*t[14]+s[3]*t[19]+s[4],i[5]=s[5]*t[0]+s[6]*t[5]+s[7]*t[10]+s[8]*t[15],i[6]=s[5]*t[1]+s[6]*t[6]+s[7]*t[11]+s[8]*t[16],i[7]=s[5]*t[2]+s[6]*t[7]+s[7]*t[12]+s[8]*t[17],i[8]=s[5]*t[3]+s[6]*t[8]+s[7]*t[13]+s[8]*t[18],i[9]=s[5]*t[4]+s[6]*t[9]+s[7]*t[14]+s[8]*t[19]+s[9],i[10]=s[10]*t[0]+s[11]*t[5]+s[12]*t[10]+s[13]*t[15],i[11]=s[10]*t[1]+s[11]*t[6]+s[12]*t[11]+s[13]*t[16],i[12]=s[10]*t[2]+s[11]*t[7]+s[12]*t[12]+s[13]*t[17],i[13]=s[10]*t[3]+s[11]*t[8]+s[12]*t[13]+s[13]*t[18],i[14]=s[10]*t[4]+s[11]*t[9]+s[12]*t[14]+s[13]*t[19]+s[14],i[15]=s[15]*t[0]+s[16]*t[5]+s[17]*t[10]+s[18]*t[15],i[16]=s[15]*t[1]+s[16]*t[6]+s[17]*t[11]+s[18]*t[16],i[17]=s[15]*t[2]+s[16]*t[7]+s[17]*t[12]+s[18]*t[17],i[18]=s[15]*t[3]+s[16]*t[8]+s[17]*t[13]+s[18]*t[18],i[19]=s[15]*t[4]+s[16]*t[9]+s[17]*t[14]+s[18]*t[19]+s[19],this._dirty=!0,this}});t.exports=s},39298:(t,e,i)=>{var s=i(56694),n=i(72283),r=new s({initialize:function(t,e,i){this._rgb=[0,0,0],this.onChangeCallback=n,this.dirty=!1,this.set(t,e,i)},set:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this._rgb=[t,e,i],this.onChange(),this},equals:function(t,e,i){var s=this._rgb;return s.r===t&&s.g===e&&s.b===i},onChange:function(){this.dirty=!0;var t=this._rgb;this.onChangeCallback.call(this,t[0],t[1],t[2])},r:{get:function(){return this._rgb[0]},set:function(t){this._rgb[0]=t,this.onChange()}},g:{get:function(){return this._rgb[1]},set:function(t){this._rgb[1]=t,this.onChange()}},b:{get:function(){return this._rgb[2]},set:function(t){this._rgb[2]=t,this.onChange()}},destroy:function(){this.onChangeCallback=null}});t.exports=r},84093:t=>{t.exports={TOP_LEFT:0,TOP_CENTER:1,TOP_RIGHT:2,LEFT_TOP:3,LEFT_CENTER:4,LEFT_BOTTOM:5,CENTER:6,RIGHT_TOP:7,RIGHT_CENTER:8,RIGHT_BOTTOM:9,BOTTOM_LEFT:10,BOTTOM_CENTER:11,BOTTOM_RIGHT:12}},32058:(t,e,i)=>{var s=i(97328),n=i(59994),r=i(73174),o=i(28417);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)+a),t}},85535:(t,e,i)=>{var s=i(97328),n=i(40163),r=i(73174),o=i(74465);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)-i),r(t,s(e)+a),t}},9605:(t,e,i)=>{var s=i(97328),n=i(70271),r=i(73174),o=i(19298);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)+a),t}},22529:(t,e,i)=>{var s=i(21843),n=i(59994),r=i(29568);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),s(t,n(e)+i,r(e)+o),t}},5739:(t,e,i)=>{var s=i(29568),n=i(40163),r=i(81711),o=i(74465);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)-i),r(t,s(e)+a),t}},40327:(t,e,i)=>{var s=i(84093),n=[];n[s.BOTTOM_CENTER]=i(32058),n[s.BOTTOM_LEFT]=i(85535),n[s.BOTTOM_RIGHT]=i(9605),n[s.CENTER]=i(22529),n[s.LEFT_CENTER]=i(5739),n[s.RIGHT_CENTER]=i(27683),n[s.TOP_CENTER]=i(96439),n[s.TOP_LEFT]=i(81447),n[s.TOP_RIGHT]=i(47888),n[s.LEFT_BOTTOM]=n[s.BOTTOM_LEFT],n[s.LEFT_TOP]=n[s.TOP_LEFT],n[s.RIGHT_BOTTOM]=n[s.BOTTOM_RIGHT],n[s.RIGHT_TOP]=n[s.TOP_RIGHT];t.exports=function(t,e,i,s,r){return n[i](t,e,s,r)}},27683:(t,e,i)=>{var s=i(29568),n=i(70271),r=i(81711),o=i(19298);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)+a),t}},96439:(t,e,i)=>{var s=i(59994),n=i(47196),r=i(28417),o=i(84349);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)+i),o(t,n(e)-a),t}},81447:(t,e,i)=>{var s=i(40163),n=i(47196),r=i(74465),o=i(84349);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)-i),o(t,n(e)-a),t}},47888:(t,e,i)=>{var s=i(70271),n=i(47196),r=i(19298),o=i(84349);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)+i),o(t,n(e)-a),t}},46997:(t,e,i)=>{t.exports={BottomCenter:i(32058),BottomLeft:i(85535),BottomRight:i(9605),Center:i(22529),LeftCenter:i(5739),QuickSet:i(40327),RightCenter:i(27683),TopCenter:i(96439),TopLeft:i(81447),TopRight:i(47888)}},93545:(t,e,i)=>{var s=i(84093),n=i(98611),r={In:i(46997),To:i(86639)};r=n(!1,r,s),t.exports=r},27118:(t,e,i)=>{var s=i(97328),n=i(59994),r=i(28417),o=i(84349);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)+a),t}},84469:(t,e,i)=>{var s=i(97328),n=i(40163),r=i(74465),o=i(84349);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)-i),o(t,s(e)+a),t}},51577:(t,e,i)=>{var s=i(97328),n=i(70271),r=i(19298),o=i(84349);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)+a),t}},90271:(t,e,i)=>{var s=i(97328),n=i(40163),r=i(73174),o=i(19298);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)-i),r(t,s(e)+a),t}},30466:(t,e,i)=>{var s=i(29568),n=i(40163),r=i(81711),o=i(19298);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)-i),r(t,s(e)+a),t}},50087:(t,e,i)=>{var s=i(40163),n=i(47196),r=i(19298),o=i(84349);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)-i),o(t,n(e)-a),t}},82590:(t,e,i)=>{var s=i(84093),n=[];n[s.BOTTOM_CENTER]=i(27118),n[s.BOTTOM_LEFT]=i(84469),n[s.BOTTOM_RIGHT]=i(51577),n[s.LEFT_BOTTOM]=i(90271),n[s.LEFT_CENTER]=i(30466),n[s.LEFT_TOP]=i(50087),n[s.RIGHT_BOTTOM]=i(13555),n[s.RIGHT_CENTER]=i(99049),n[s.RIGHT_TOP]=i(67788),n[s.TOP_CENTER]=i(78170),n[s.TOP_LEFT]=i(54145),n[s.TOP_RIGHT]=i(75548);t.exports=function(t,e,i,s,r){return n[i](t,e,s,r)}},13555:(t,e,i)=>{var s=i(97328),n=i(70271),r=i(73174),o=i(74465);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)+a),t}},99049:(t,e,i)=>{var s=i(29568),n=i(70271),r=i(81711),o=i(74465);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)+a),t}},67788:(t,e,i)=>{var s=i(70271),n=i(47196),r=i(74465),o=i(84349);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)+i),o(t,n(e)-a),t}},78170:(t,e,i)=>{var s=i(59994),n=i(47196),r=i(73174),o=i(28417);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)-a),t}},54145:(t,e,i)=>{var s=i(40163),n=i(47196),r=i(73174),o=i(74465);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)-a),t}},75548:(t,e,i)=>{var s=i(70271),n=i(47196),r=i(73174),o=i(19298);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)-a),t}},86639:(t,e,i)=>{t.exports={BottomCenter:i(27118),BottomLeft:i(84469),BottomRight:i(51577),LeftBottom:i(90271),LeftCenter:i(30466),LeftTop:i(50087),QuickSet:i(82590),RightBottom:i(13555),RightCenter:i(99049),RightTop:i(67788),TopCenter:i(78170),TopLeft:i(54145),TopRight:i(75548)}},21843:(t,e,i)=>{var s=i(28417),n=i(81711);t.exports=function(t,e,i){return s(t,e),n(t,i)}},97328:t=>{t.exports=function(t){return t.y+t.height-t.height*t.originY}},7126:(t,e,i)=>{var s=i(97328),n=i(40163),r=i(70271),o=i(47196);t.exports=function(t,e){void 0===e&&(e={});var i=n(t),a=o(t);return e.x=i,e.y=a,e.width=r(t)-i,e.height=s(t)-a,e}},59994:t=>{t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},29568:t=>{t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},40163:t=>{t.exports=function(t){return t.x-t.width*t.originX}},52088:t=>{t.exports=function(t){return t.width*t.originX}},23379:t=>{t.exports=function(t){return t.height*t.originY}},70271:t=>{t.exports=function(t){return t.x+t.width-t.width*t.originX}},47196:t=>{t.exports=function(t){return t.y-t.height*t.originY}},73174:t=>{t.exports=function(t,e){return t.y=e-t.height+t.height*t.originY,t}},28417:t=>{t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},81711:t=>{t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},74465:t=>{t.exports=function(t,e){return t.x=e+t.width*t.originX,t}},19298:t=>{t.exports=function(t,e){return t.x=e-t.width+t.width*t.originX,t}},84349:t=>{t.exports=function(t,e){return t.y=e+t.height*t.originY,t}},15252:(t,e,i)=>{t.exports={CenterOn:i(21843),GetBottom:i(97328),GetBounds:i(7126),GetCenterX:i(59994),GetCenterY:i(29568),GetLeft:i(40163),GetOffsetX:i(52088),GetOffsetY:i(23379),GetRight:i(70271),GetTop:i(47196),SetBottom:i(73174),SetCenterX:i(28417),SetCenterY:i(81711),SetLeft:i(74465),SetRight:i(19298),SetTop:i(84349)}},70616:t=>{t.exports={setCrisp:function(t){return["optimizeSpeed","-moz-crisp-edges","-o-crisp-edges","-webkit-optimize-contrast","optimize-contrast","crisp-edges","pixelated"].forEach((function(e){t.style["image-rendering"]=e})),t.style.msInterpolationMode="nearest-neighbor",t},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},61068:(t,e,i)=>{var s,n,r,o=i(86459),a=i(8213),h=[],l=!1;t.exports=(r=function(){var t=0;return h.forEach((function(e){e.parent&&t++})),t},{create2D:function(t,e,i){return s(t,e,i,o.CANVAS)},create:s=function(t,e,i,s,r){var u;void 0===e&&(e=1),void 0===i&&(i=1),void 0===s&&(s=o.CANVAS),void 0===r&&(r=!1);var c=n(s);return null===c?(c={parent:t,canvas:document.createElement("canvas"),type:s},s===o.CANVAS&&h.push(c),u=c.canvas):(c.parent=t,u=c.canvas),r&&(c.parent=u),u.width=e,u.height=i,l&&s===o.CANVAS&&a.disable(u.getContext("2d")),u},createWebGL:function(t,e,i){return s(t,e,i,o.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:n=function(t){if(void 0===t&&(t=o.CANVAS),t===o.WEBGL)return null;for(var e=0;e{var e,i="";t.exports={disable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!1),t},enable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!0),t},getPrefix:e=function(t){for(var e=["i","webkitI","msI","mozI","oI"],i=0;i{t.exports=function(t,e){return void 0===e&&(e="none"),t.style.msTouchAction=e,t.style["ms-touch-action"]=e,t.style["touch-action"]=e,t}},36505:t=>{t.exports=function(t,e){void 0===e&&(e="none");return["-webkit-","-khtml-","-moz-","-ms-",""].forEach((function(i){t.style[i+"user-select"]=e})),t.style["-webkit-touch-callout"]=e,t.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",t}},23514:(t,e,i)=>{t.exports={CanvasInterpolation:i(70616),CanvasPool:i(61068),Smoothing:i(8213),TouchAction:i(59271),UserSelect:i(36505)}},27119:(t,e,i)=>{var s=i(56694),n=i(22946),r=i(5657),o=i(24650),a=i(68033),h=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=255),this.r=0,this.g=0,this.b=0,this.a=255,this._h=0,this._s=0,this._v=0,this._locked=!1,this.gl=[0,0,0,1],this._color=0,this._color32=0,this._rgba="",this.setTo(t,e,i,s)},transparent:function(){return this._locked=!0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this._locked=!1,this.update(!0)},setTo:function(t,e,i,s,n){return void 0===s&&(s=255),void 0===n&&(n=!0),this._locked=!0,this.red=t,this.green=e,this.blue=i,this.alpha=s,this._locked=!1,this.update(n)},setGLTo:function(t,e,i,s){return void 0===s&&(s=1),this._locked=!0,this.redGL=t,this.greenGL=e,this.blueGL=i,this.alphaGL=s,this._locked=!1,this.update(!0)},setFromRGB:function(t){return this._locked=!0,this.red=t.r,this.green=t.g,this.blue=t.b,t.hasOwnProperty("a")&&(this.alpha=t.a),this._locked=!1,this.update(!0)},setFromHSV:function(t,e,i){return o(t,e,i,this)},update:function(t){if(void 0===t&&(t=!1),this._locked)return this;var e=this.r,i=this.g,s=this.b,o=this.a;return this._color=n(e,i,s),this._color32=r(e,i,s,o),this._rgba="rgba("+e+","+i+","+s+","+o/255+")",t&&a(e,i,s,this),this},updateHSV:function(){var t=this.r,e=this.g,i=this.b;return a(t,e,i,this),this},clone:function(){return new h(this.r,this.g,this.b,this.a)},gray:function(t){return this.setTo(t,t,t)},random:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t)),s=Math.floor(t+Math.random()*(e-t)),n=Math.floor(t+Math.random()*(e-t));return this.setTo(i,s,n)},randomGray:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t));return this.setTo(i,i,i)},saturate:function(t){return this.s+=t/100,this},desaturate:function(t){return this.s-=t/100,this},lighten:function(t){return this.v+=t/100,this},darken:function(t){return this.v-=t/100,this},brighten:function(t){var e=this.r,i=this.g,s=this.b;return e=Math.max(0,Math.min(255,e-Math.round(-t/100*255))),i=Math.max(0,Math.min(255,i-Math.round(-t/100*255))),s=Math.max(0,Math.min(255,s-Math.round(-t/100*255))),this.setTo(e,i,s)},color:{get:function(){return this._color}},color32:{get:function(){return this._color32}},rgba:{get:function(){return this._rgba}},redGL:{get:function(){return this.gl[0]},set:function(t){this.gl[0]=Math.min(Math.abs(t),1),this.r=Math.floor(255*this.gl[0]),this.update(!0)}},greenGL:{get:function(){return this.gl[1]},set:function(t){this.gl[1]=Math.min(Math.abs(t),1),this.g=Math.floor(255*this.gl[1]),this.update(!0)}},blueGL:{get:function(){return this.gl[2]},set:function(t){this.gl[2]=Math.min(Math.abs(t),1),this.b=Math.floor(255*this.gl[2]),this.update(!0)}},alphaGL:{get:function(){return this.gl[3]},set:function(t){this.gl[3]=Math.min(Math.abs(t),1),this.a=Math.floor(255*this.gl[3]),this.update()}},red:{get:function(){return this.r},set:function(t){t=Math.floor(Math.abs(t)),this.r=Math.min(t,255),this.gl[0]=t/255,this.update(!0)}},green:{get:function(){return this.g},set:function(t){t=Math.floor(Math.abs(t)),this.g=Math.min(t,255),this.gl[1]=t/255,this.update(!0)}},blue:{get:function(){return this.b},set:function(t){t=Math.floor(Math.abs(t)),this.b=Math.min(t,255),this.gl[2]=t/255,this.update(!0)}},alpha:{get:function(){return this.a},set:function(t){t=Math.floor(Math.abs(t)),this.a=Math.min(t,255),this.gl[3]=t/255,this.update()}},h:{get:function(){return this._h},set:function(t){this._h=t,o(t,this._s,this._v,this)}},s:{get:function(){return this._s},set:function(t){this._s=t,o(this._h,t,this._v,this)}},v:{get:function(){return this._v},set:function(t){this._v=t,o(this._h,this._s,t,this)}}});t.exports=h},30245:(t,e,i)=>{var s=i(22946);t.exports=function(t){void 0===t&&(t=1024);var e,i=[],n=255,r=255,o=0,a=0;for(e=0;e<=n;e++)i.push({r:r,g:e,b:a,color:s(r,e,a)});for(o=255,e=n;e>=0;e--)i.push({r:e,g:o,b:a,color:s(e,o,a)});for(r=0,e=0;e<=n;e++,o--)i.push({r:r,g:o,b:e,color:s(r,o,e)});for(o=0,a=255,e=0;e<=n;e++,a--,r++)i.push({r:r,g:o,b:a,color:s(r,o,a)});if(1024===t)return i;var h=[],l=0,u=1024/t;for(e=0;e{t.exports=function(t){var e={r:t>>16&255,g:t>>8&255,b:255&t,a:255};return t>16777215&&(e.a=t>>>24),e}},25409:t=>{t.exports=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e}},22946:t=>{t.exports=function(t,e,i){return t<<16|e<<8|i}},5657:t=>{t.exports=function(t,e,i,s){return s<<24|t<<16|e<<8|i}},74777:(t,e,i)=>{var s=i(27119),n=i(59998);t.exports=function(t,e,i){var r=i,o=i,a=i;if(0!==e){var h=i<.5?i*(1+e):i+e-i*e,l=2*i-h;r=n(l,h,t+1/3),o=n(l,h,t),a=n(l,h,t-1/3)}return(new s).setGLTo(r,o,a,1)}},89263:(t,e,i)=>{var s=i(24650);t.exports=function(t,e){void 0===t&&(t=1),void 0===e&&(e=1);for(var i=[],n=0;n<=359;n++)i.push(s(n/359,t,e));return i}},24650:(t,e,i)=>{var s=i(22946);function n(t,e,i,s){var n=(t+6*e)%6,r=Math.min(n,4-n,1);return Math.round(255*(s-s*i*Math.max(0,r)))}t.exports=function(t,e,i,r){void 0===e&&(e=1),void 0===i&&(i=1);var o=n(5,t,e,i),a=n(3,t,e,i),h=n(1,t,e,i);return r?r.setTo?r.setTo(o,a,h,r.alpha,!1):(r.r=o,r.g=a,r.b=h,r.color=s(o,a,h),r):{r:o,g:a,b:h,color:s(o,a,h)}}},91487:(t,e,i)=>{var s=i(27119);t.exports=function(t){var e=new s;t=t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,i,s){return e+e+i+i+s+s}));var i=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(i){var n=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16);e.setTo(n,r,o)}return e}},59998:t=>{t.exports=function(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}},74853:(t,e,i)=>{var s=i(27119),n=i(15978);t.exports=function(t){var e=n(t);return new s(e.r,e.g,e.b,e.a)}},15978:t=>{t.exports=function(t){return t>16777215?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},53756:(t,e,i)=>{var s=i(42798),n=function(t,e,i,n,r,o,a,h){void 0===a&&(a=100),void 0===h&&(h=0);var l=h/a;return{r:s(t,n,l),g:s(e,r,l),b:s(i,o,l)}};t.exports={RGBWithRGB:n,ColorWithRGB:function(t,e,i,s,r,o){return void 0===r&&(r=100),void 0===o&&(o=0),n(t.r,t.g,t.b,e,i,s,r,o)},ColorWithColor:function(t,e,i,s){return void 0===i&&(i=100),void 0===s&&(s=0),n(t.r,t.g,t.b,e.r,e.g,e.b,i,s)}}},73904:(t,e,i)=>{var s=i(27119);t.exports=function(t){return new s(t.r,t.g,t.b,t.a)}},26841:(t,e,i)=>{var s=i(27119);t.exports=function(t){var e=new s,i=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(t.toLowerCase());if(i){var n=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10),a=void 0!==i[4]?parseFloat(i[4]):1;e.setTo(n,r,o,255*a)}return e}},68033:t=>{t.exports=function(t,e,i,s){void 0===s&&(s={h:0,s:0,v:0}),t/=255,e/=255,i/=255;var n=Math.min(t,e,i),r=Math.max(t,e,i),o=r-n,a=0,h=0===r?0:o/r,l=r;return r!==n&&(r===t?a=(e-i)/o+(e{var s=i(25409);t.exports=function(t,e,i,n,r){return void 0===n&&(n=255),void 0===r&&(r="#"),"#"===r?"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1,7):"0x"+s(n)+s(t)+s(e)+s(i)}},37243:(t,e,i)=>{var s=i(17489),n=i(27119);t.exports=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=255),new n(s(t,e),s(t,e),s(t,e))}},93222:(t,e,i)=>{var s=i(91487),n=i(74853),r=i(73904),o=i(26841);t.exports=function(t){switch(typeof t){case"string":return"rgb"===t.substr(0,3).toLowerCase()?o(t):s(t);case"number":return n(t);case"object":return r(t)}}},95509:(t,e,i)=>{var s=i(27119);s.ColorSpectrum=i(30245),s.ColorToRGBA=i(86672),s.ComponentToHex=i(25409),s.GetColor=i(22946),s.GetColor32=i(5657),s.HexStringToColor=i(91487),s.HSLToColor=i(74777),s.HSVColorWheel=i(89263),s.HSVToRGB=i(24650),s.HueToComponent=i(59998),s.IntegerToColor=i(74853),s.IntegerToRGB=i(15978),s.Interpolate=i(53756),s.ObjectToColor=i(73904),s.RandomRGB=i(37243),s.RGBStringToColor=i(26841),s.RGBToHSV=i(68033),s.RGBToString=i(4880),s.ValueToColor=i(93222),t.exports=s},24816:(t,e,i)=>{t.exports={Align:i(93545),BaseShader:i(31053),Bounds:i(15252),Canvas:i(23514),Color:i(95509),ColorMatrix:i(65246),Masks:i(93310),RGB:i(39298)}},76756:(t,e,i)=>{var s=i(56694),n=i(97081),r=i(81044),o=new s({initialize:function(t,e){var i=t.sys.renderer;this.renderer=i,this.bitmapMask=e,this.maskTexture=null,this.mainTexture=null,this.dirty=!0,this.mainFramebuffer=null,this.maskFramebuffer=null,this.invertAlpha=!1,this.isStencil=!1,this.scene=t,this.createMask(),t.sys.game.events.on(n.CONTEXT_RESTORED,this.createMask,this),i&&i.on(r.RESIZE,this.createMask,this)},createMask:function(){var t=this.renderer;if(t&&t.gl){this.mainTexture&&this.clearMask();var e=t.width,i=t.height,s=0==(e&e-1)&&0==(i&i-1),n=t.gl,r=s?n.REPEAT:n.CLAMP_TO_EDGE,o=n.LINEAR;this.mainTexture=t.createTexture2D(0,o,o,r,r,n.RGBA,null,e,i),this.maskTexture=t.createTexture2D(0,o,o,r,r,n.RGBA,null,e,i),this.mainFramebuffer=t.createFramebuffer(e,i,this.mainTexture,!0),this.maskFramebuffer=t.createFramebuffer(e,i,this.maskTexture,!0)}},clearMask:function(){var t=this.renderer;t&&t.gl&&this.mainTexture&&(t.deleteTexture(this.mainTexture),t.deleteTexture(this.maskTexture),t.deleteFramebuffer(this.mainFramebuffer),t.deleteFramebuffer(this.maskFramebuffer),this.mainTexture=null,this.maskTexture=null,this.mainFramebuffer=null,this.maskFramebuffer=null)},setBitmap:function(t){this.bitmapMask=t},preRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.beginMask(this,e,i)},postRenderWebGL:function(t,e){t.pipelines.BITMAPMASK_PIPELINE.endMask(this,e)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.clearMask(),this.scene.sys.game.events.off(n.CONTEXT_RESTORED,this.createMask,this),this.renderer&&this.renderer.off(r.RESIZE,this.createMask,this),this.bitmapMask=null,this.prevFramebuffer=null,this.renderer=null}});t.exports=o},63037:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e){this.geometryMask=e,this.invertAlpha=!1,this.isStencil=!0,this.level=0},setShape:function(t){return this.geometryMask=t,this},setInvertAlpha:function(t){return void 0===t&&(t=!0),this.invertAlpha=t,this},preRenderWebGL:function(t,e,i){var s=t.gl;t.flush(),0===t.maskStack.length&&(s.enable(s.STENCIL_TEST),s.clear(s.STENCIL_BUFFER_BIT),t.maskCount=0),t.currentCameraMask.mask!==this&&(t.currentMask.mask=this),t.maskStack.push({mask:this,camera:i}),this.applyStencil(t,i,!0),t.maskCount++},applyStencil:function(t,e,i){var s=t.gl,n=this.geometryMask,r=t.maskCount;s.colorMask(!1,!1,!1,!1),i?(s.stencilFunc(s.EQUAL,r,255),s.stencilOp(s.KEEP,s.KEEP,s.INCR)):(s.stencilFunc(s.EQUAL,r+1,255),s.stencilOp(s.KEEP,s.KEEP,s.DECR)),n.renderWebGL(t,n,e),t.flush(),s.colorMask(!0,!0,!0,!0),s.stencilOp(s.KEEP,s.KEEP,s.KEEP),i?this.invertAlpha?s.stencilFunc(s.NOTEQUAL,r+1,255):s.stencilFunc(s.EQUAL,r+1,255):this.invertAlpha?s.stencilFunc(s.NOTEQUAL,r,255):s.stencilFunc(s.EQUAL,r,255)},postRenderWebGL:function(t){var e=t.gl;t.maskStack.pop(),t.maskCount--,t.flush();var i=t.currentMask;if(0===t.maskStack.length)i.mask=null,e.disable(e.STENCIL_TEST);else{var s=t.maskStack[t.maskStack.length-1];s.mask.applyStencil(t,s.camera,!1),t.currentCameraMask.mask!==s.mask?(i.mask=s.mask,i.camera=s.camera):i.mask=null}},preRenderCanvas:function(t,e,i){var s=this.geometryMask;t.currentContext.save(),s.renderCanvas(t,s,i,null,null,!0),t.currentContext.clip()},postRenderCanvas:function(t){t.currentContext.restore()},destroy:function(){this.geometryMask=null}});t.exports=s},93310:(t,e,i)=>{t.exports={BitmapMask:i(76756),GeometryMask:i(63037)}},31053:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s){e&&""!==e||(e=["precision mediump float;","uniform vec2 resolution;","varying vec2 fragCoord;","void main () {"," vec2 uv = fragCoord / resolution.xy;"," gl_FragColor = vec4(uv.xyx, 1.0);","}"].join("\n")),i&&""!==i||(i=["precision mediump float;","uniform mat4 uProjectionMatrix;","uniform mat4 uViewMatrix;","uniform vec2 uResolution;","attribute vec2 inPosition;","varying vec2 fragCoord;","varying vec2 outTexCoord;","void main () {"," gl_Position = uProjectionMatrix * uViewMatrix * vec4(inPosition, 1.0, 1.0);"," fragCoord = vec2(inPosition.x, uResolution.y - inPosition.y);"," outTexCoord = vec2(inPosition.x / uResolution.x, fragCoord.y / uResolution.y);","}"].join("\n")),void 0===s&&(s=null),this.key=t,this.fragmentSrc=e,this.vertexSrc=i,this.uniforms=s}});t.exports=s},99584:t=>{t.exports=function(t,e){var i;if(e)"string"==typeof e?i=document.getElementById(e):"object"==typeof e&&1===e.nodeType&&(i=e);else if(t.parentElement||null===e)return t;return i||(i=document.body),i.appendChild(t),t}},85178:(t,e,i)=>{var s=i(99584);t.exports=function(t){var e=t.config;if(e.parent&&e.domCreateContainer){var i=document.createElement("div");i.style.cssText=["display: block;","width: "+t.scale.width+"px;","height: "+t.scale.height+"px;","padding: 0; margin: 0;","position: absolute;","overflow: hidden;","pointer-events: "+e.domPointerEvents+";","transform: scale(1);","transform-origin: left top;"].join(" "),t.domContainer=i,s(i,e.parent)}}},21546:(t,e,i)=>{var s=i(36580);t.exports=function(t){if("complete"!==document.readyState&&"interactive"!==document.readyState){var e=function(){document.removeEventListener("deviceready",e,!0),document.removeEventListener("DOMContentLoaded",e,!0),window.removeEventListener("load",e,!0),t()};document.body?s.cordova?document.addEventListener("deviceready",e,!1):(document.addEventListener("DOMContentLoaded",e,!0),window.addEventListener("load",e,!0)):window.setTimeout(e,20)}else t()}},74181:t=>{t.exports=function(t){if(!t)return window.innerHeight;var e=Math.abs(window.orientation),i={w:0,h:0},s=document.createElement("div");return s.setAttribute("style","position: fixed; height: 100vh; width: 0; top: 0"),document.documentElement.appendChild(s),i.w=90===e?s.offsetHeight:window.innerWidth,i.h=90===e?window.innerWidth:s.offsetHeight,document.documentElement.removeChild(s),s=null,90!==Math.abs(window.orientation)?i.h:i.w}},9229:(t,e,i)=>{var s=i(55301);t.exports=function(t,e){var i=window.screen,n=!!i&&(i.orientation||i.mozOrientation||i.msOrientation);return n&&"string"==typeof n.type?n.type:"string"==typeof n?n:"number"==typeof window.orientation?0===window.orientation||180===window.orientation?s.ORIENTATION.PORTRAIT:s.ORIENTATION.LANDSCAPE:window.matchMedia?window.matchMedia("(orientation: portrait)").matches?s.ORIENTATION.PORTRAIT:window.matchMedia("(orientation: landscape)").matches?s.ORIENTATION.LANDSCAPE:void 0:e>t?s.ORIENTATION.PORTRAIT:s.ORIENTATION.LANDSCAPE}},2893:t=>{t.exports=function(t){var e;return""!==t&&("string"==typeof t?e=document.getElementById(t):t&&1===t.nodeType&&(e=t)),e||(e=document.body),e}},89200:t=>{t.exports=function(t){var e="";try{if(window.DOMParser)e=(new DOMParser).parseFromString(t,"text/xml");else(e=new ActiveXObject("Microsoft.XMLDOM")).loadXML(t)}catch(t){e=null}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length?e:null}},55638:t=>{t.exports=function(t){t.parentNode&&t.parentNode.removeChild(t)}},27385:(t,e,i)=>{var s=i(56694),n=i(72283),r=new s({initialize:function(){this.isRunning=!1,this.callback=n,this.tick=0,this.isSetTimeOut=!1,this.timeOutID=null,this.lastTime=0,this.target=0;var t=this;this.step=function e(){var i=window.performance.now();t.lastTime=t.tick,t.tick=i,t.callback(i),t.timeOutID=window.requestAnimationFrame(e)},this.stepTimeout=function e(){var i=Date.now(),s=Math.min(Math.max(2*t.target+t.tick-i,0),t.target);t.lastTime=t.tick,t.tick=i,t.callback(i),t.timeOutID=window.setTimeout(e,s)}},start:function(t,e,i){this.isRunning||(this.callback=t,this.isSetTimeOut=e,this.target=i,this.isRunning=!0,this.timeOutID=e?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=n}});t.exports=r},3590:(t,e,i)=>{var s={AddToDOM:i(99584),DOMContentLoaded:i(21546),GetInnerHeight:i(74181),GetScreenOrientation:i(9229),GetTarget:i(2893),ParseXML:i(89200),RemoveFromDOM:i(55638),RequestAnimationFrame:i(27385)};t.exports=s},78491:(t,e,i)=>{var s=i(56694),n=i(6659),r=i(91963),o=new s({Extends:n,initialize:function(){n.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});r.register("EventEmitter",o,"events"),t.exports=o},95146:(t,e,i)=>{t.exports={EventEmitter:i(78491)}},88933:(t,e,i)=>{var s=i(95723),n=i(20494);t.exports=function(t,e,i){e.x=n(i,"x",0),e.y=n(i,"y",0),e.depth=n(i,"depth",0),e.flipX=n(i,"flipX",!1),e.flipY=n(i,"flipY",!1);var r=n(i,"scale",null);"number"==typeof r?e.setScale(r):null!==r&&(e.scaleX=n(r,"x",1),e.scaleY=n(r,"y",1));var o=n(i,"scrollFactor",null);"number"==typeof o?e.setScrollFactor(o):null!==o&&(e.scrollFactorX=n(o,"x",1),e.scrollFactorY=n(o,"y",1)),e.rotation=n(i,"rotation",0);var a=n(i,"angle",null);null!==a&&(e.angle=a),e.alpha=n(i,"alpha",1);var h=n(i,"origin",null);if("number"==typeof h)e.setOrigin(h);else if(null!==h){var l=n(h,"x",.5),u=n(h,"y",.5);e.setOrigin(l,u)}return e.blendMode=n(i,"blendMode",s.NORMAL),e.visible=n(i,"visible",!0),n(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},32291:(t,e,i)=>{var s=i(20494);t.exports=function(t,e){var i=s(e,"anims",null);if(null===i)return t;if("string"==typeof i)t.anims.play(i);else if("object"==typeof i){var n=t.anims,r=s(i,"key",void 0);if(r){var o=s(i,"startFrame",void 0),a=s(i,"delay",0),h=s(i,"repeat",0),l=s(i,"repeatDelay",0),u=s(i,"yoyo",!1),c=s(i,"play",!1),d=s(i,"delayedPlay",0),p={key:r,delay:a,repeat:h,repeatDelay:l,yoyo:u,startFrame:o};c?n.play(p):d>0?n.playAfterDelay(p,d):n.load(p)}}return t}},91713:(t,e,i)=>{var s=i(56694),n=i(71207),r=i(91963),o=i(56631),a=i(7599),h=i(17922),l=new s({Extends:n,initialize:function(t){n.call(this,t),this.sortChildrenFlag=!1,this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.events.once(a.BOOT,this.boot,this),this.events.on(a.START,this.start,this)},boot:function(){this.events.once(a.DESTROY,this.destroy,this)},addChildCallback:function(t){t.displayList&&t.displayList!==this&&t.removeFromDisplayList(),t.displayList||(this.queueDepthSort(),t.displayList=this,t.emit(o.ADDED_TO_SCENE,t,this.scene),this.events.emit(a.ADDED_TO_SCENE,t,this.scene))},removeChildCallback:function(t){this.queueDepthSort(),t.displayList=null,t.emit(o.REMOVED_FROM_SCENE,t,this.scene),this.events.emit(a.REMOVED_FROM_SCENE,t,this.scene)},start:function(){this.events.once(a.SHUTDOWN,this.shutdown,this)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(h(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},getChildren:function(){return this.list},shutdown:function(){for(var t=this.list,e=t.length;e--;)t[e].destroy(!0);t.length=0,this.events.off(a.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(a.START,this.start,this),this.scene=null,this.systems=null,this.events=null}});r.register("DisplayList",l,"displayList"),t.exports=l},89980:(t,e,i)=>{var s=i(56694),n=i(48129),r=i(81078),o=i(6659),a=i(56631),h=i(7599),l=new s({Extends:o,initialize:function(t,e){o.call(this),this.scene=t,this.displayList=null,this.type=e,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.on(a.ADDED_TO_SCENE,this.addedToScene,this),this.on(a.REMOVED_FROM_SCENE,this.removedFromScene,this),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new r(this)),this},setData:function(t,e){return this.data||(this.data=new r(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new r(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new r(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new r(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(){return this.input&&(this.input.enabled=!1),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return n(this)},willRender:function(t){return!(l.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return this.displayList?i.unshift(this.displayList.getIndex(t)):i.unshift(this.scene.sys.displayList.getIndex(t)),i},addToDisplayList:function(t){return void 0===t&&(t=this.scene.sys.displayList),this.displayList&&this.displayList!==t&&this.removeFromDisplayList(),t.exists(this)||(this.displayList=t,t.add(this,!0),t.queueDepthSort(),this.emit(a.ADDED_TO_SCENE,this,this.scene),t.events.emit(h.ADDED_TO_SCENE,this,this.scene)),this},addToUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.add(this),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(a.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(h.REMOVED_FROM_SCENE,this,this.scene)),this},removeFromUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.remove(this),this},destroy:function(t){this.scene&&!this.ignoreDestroy&&(void 0===t&&(t=!1),this.preDestroy&&this.preDestroy.call(this),this.emit(a.DESTROY,this,t),this.removeAllListeners(),this.postPipelines&&this.resetPostPipeline(!0),this.removeFromDisplayList(),this.removeFromUpdateList(),this.input&&(this.scene.sys.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0)}});l.RENDER_MASK=15,t.exports=l},99325:(t,e,i)=>{var s=i(56694),n=i(91963),r=i(7599),o=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(r.BOOT,this.boot,this),this.events.on(r.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(r.DESTROY,this.destroy,this)},start:function(){this.events.once(r.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.events.off(r.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});o.register=function(t,e){o.prototype.hasOwnProperty(t)||(o.prototype[t]=e)},o.remove=function(t){o.prototype.hasOwnProperty(t)&&delete o.prototype[t]},n.register("GameObjectCreator",o,"make"),t.exports=o},61286:(t,e,i)=>{var s=i(56694),n=i(91963),r=i(7599),o=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(r.BOOT,this.boot,this),this.events.on(r.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(r.DESTROY,this.destroy,this)},start:function(){this.events.once(r.SHUTDOWN,this.shutdown,this)},existing:function(t){return(t.renderCanvas||t.renderWebGL)&&this.displayList.add(t),t.preUpdate&&this.updateList.add(t),t},shutdown:function(){this.events.off(r.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});o.register=function(t,e){o.prototype.hasOwnProperty(t)||(o.prototype[t]=e)},o.remove=function(t){o.prototype.hasOwnProperty(t)&&delete o.prototype[t]},n.register("GameObjectFactory",o,"add"),t.exports=o},73329:(t,e,i)=>{var s=i(69360),n=new s,r=new s,o=new s,a={camera:n,sprite:r,calc:o};t.exports=function(t,e,i){var s=n,h=r,l=o;return h.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),s.copyFrom(e.matrix),i?(s.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),h.e=t.x,h.f=t.y):(h.e-=e.scrollX*t.scrollFactorX,h.f-=e.scrollY*t.scrollFactorY),s.multiply(h,l),a}},92034:(t,e,i)=>{var s=i(56694),n=i(74623),r=i(91963),o=i(7599),a=new s({Extends:n,initialize:function(t){n.call(this),this.checkQueue=!0,this.scene=t,this.systems=t.sys,t.sys.events.once(o.BOOT,this.boot,this),t.sys.events.on(o.START,this.start,this)},boot:function(){this.systems.events.once(o.DESTROY,this.destroy,this)},start:function(){var t=this.systems.events;t.on(o.PRE_UPDATE,this.update,this),t.on(o.UPDATE,this.sceneUpdate,this),t.once(o.SHUTDOWN,this.shutdown,this)},sceneUpdate:function(t,e){for(var i=this._active,s=i.length,n=0;n{t.exports=function(t,e,i,s,n,r,o,a,h,l,u,c,d,p,f){var v=i.x-e.displayOriginX+n,g=i.y-e.displayOriginY+r,m=v+i.w,y=g+i.h,x=o.getXRound(v,g,a),T=o.getYRound(v,g,a),w=o.getXRound(v,y,a),b=o.getYRound(v,y,a),E=o.getXRound(m,y,a),S=o.getYRound(m,y,a),A=o.getXRound(m,g,a),_=o.getYRound(m,g,a);t.batchQuad(e,x,T,w,b,E,S,A,_,s.u0,s.v0,s.u1,s.v1,h,l,u,c,d,p,f)}},82173:t=>{t.exports=function(t,e,i,s){if(void 0===i&&(i=!1),void 0===s)return s={local:{x:0,y:0,width:0,height:0},global:{x:0,y:0,width:0,height:0},lines:{shortest:0,longest:0,lengths:null,height:0},wrappedText:"",words:[],characters:[],scaleX:0,scaleY:0};var n,r,o,a,h=t.text,l=h.length,u=t.maxWidth,c=t.wordWrapCharCode,d=Number.MAX_VALUE,p=Number.MAX_VALUE,f=0,v=0,g=t.fontData.chars,m=t.fontData.lineHeight,y=t.letterSpacing,x=0,T=0,w=0,b=null,E=t._align,S=0,A=0,_=t.fontSize/t.fontData.size,C=_*t.scaleX,M=_*t.scaleY,R=null,P=0,O=[],L=Number.MAX_VALUE,F=0,D=0,k=0,I=[],B=[],N=null;if(u>0){for(n=0;nu||W-X>u?(z.push(G.i-1),G.cr?(z.push(G.i+G.word.length),X=0,U=null):U=G):G.cr&&(z.push(G.i+G.word.length),X=0,U=null)}for(n=z.length-1;n>=0;n--)r=h,o=z[n],a="\n",h=r.substr(0,o)+a+r.substr(o+1);s.wrappedText=h,l=h.length,I=[],N=null}var H=0;for(n=0;nS&&(d=S),p>A&&(p=A);var q=S+b.xAdvance,K=A+m;fF&&(F=k),kF&&(F=k),k0)for(var J=0;J{var s=i(31476);t.exports=function(t,e,i,n,r,o,a){var h=t.sys.textures.get(i),l=h.get(n),u=t.sys.cache.xml.get(r);if(l&&u){var c=s(u,l,o,a,h);return t.sys.cache.bitmapFont.add(e,{data:c,texture:i,frame:n,fromAtlas:!0}),!0}return!1}},39860:(t,e,i)=>{var s=i(10850);t.exports=function(t,e){var i=e.width,n=e.height,r=Math.floor(i/2),o=Math.floor(n/2),a=s(e,"chars","");if(""!==a){var h=s(e,"image",""),l=t.sys.textures.getFrame(h),u=l.cutX,c=l.cutY,d=l.source.width,p=l.source.height,f=s(e,"offset.x",0),v=s(e,"offset.y",0),g=s(e,"spacing.x",0),m=s(e,"spacing.y",0),y=s(e,"lineSpacing",0),x=s(e,"charsPerRow",null);null===x&&(x=d/i)>a.length&&(x=a.length);for(var T=f,w=v,b={retroFont:!0,font:h,size:i,lineHeight:n+y,chars:{}},E=0,S=0;S{function e(t,e){return parseInt(t.getAttribute(e),10)}t.exports=function(t,i,s,n,r){void 0===s&&(s=0),void 0===n&&(n=0);var o=i.cutX,a=i.cutY,h=i.source.width,l=i.source.height,u=i.sourceIndex,c={},d=t.getElementsByTagName("info")[0],p=t.getElementsByTagName("common")[0];c.font=d.getAttribute("face"),c.size=e(d,"size"),c.lineHeight=e(p,"lineHeight")+n,c.chars={};var f=t.getElementsByTagName("char"),v=void 0!==i&&i.trimmed;if(v)var g=i.height,m=i.width;for(var y=0;y{var s=i(66863),n=i(98611),r={Parse:i(39860)};r=n(!1,r,s),t.exports=r},66863:t=>{t.exports={TEXT_SET1:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},13468:(t,e,i)=>{var s=i(44616),n=i(56694),r=i(88899),o=new n({Extends:s,Mixins:[r],initialize:function(t,e,i,n,r,o,a){s.call(this,t,e,i,n,r,o,a),this.type="DynamicBitmapText",this.scrollX=0,this.scrollY=0,this.cropWidth=0,this.cropHeight=0,this.displayCallback,this.callbackData={parent:this,color:0,tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:0,charCode:0,x:0,y:0,scale:0,rotation:0,data:0}},setSize:function(t,e){return this.cropWidth=t,this.cropHeight=e,this},setDisplayCallback:function(t){return this.displayCallback=t,this},setScrollX:function(t){return this.scrollX=t,this},setScrollY:function(t){return this.scrollY=t,this}});t.exports=o},93438:(t,e,i)=>{var s=i(49584);t.exports=function(t,e,i,n){var r=e._text,o=r.length,a=t.currentContext;if(0!==o&&s(t,a,e,i,n)){i.addToRenderList(e);var h=e.fromAtlas?e.frame:e.texture.frames.__BASE,l=e.displayCallback,u=e.callbackData,c=e.fontData.chars,d=e.fontData.lineHeight,p=e._letterSpacing,f=0,v=0,g=0,m=null,y=0,x=0,T=0,w=0,b=0,E=0,S=null,A=0,_=e.frame.source.image,C=h.cutX,M=h.cutY,R=0,P=0,O=e._fontSize/e.fontData.size,L=e._align,F=0,D=0;e.getTextBounds(!1);var k=e._bounds.lines;1===L?D=(k.longest-k.lengths[0])/2:2===L&&(D=k.longest-k.lengths[0]),a.translate(-e.displayOriginX,-e.displayOriginY);var I=i.roundPixels;e.cropWidth>0&&e.cropHeight>0&&(a.beginPath(),a.rect(0,0,e.cropWidth,e.cropHeight),a.clip());for(var B=0;B{var s=i(13468),n=i(88933),r=i(99325),o=i(20494);r.register("dynamicBitmapText",(function(t,e){void 0===t&&(t={});var i=o(t,"font",""),r=o(t,"text",""),a=o(t,"size",!1),h=new s(this.scene,0,0,i,r,a);return void 0!==e&&(t.add=e),n(this.scene,h,t),h}))},94145:(t,e,i)=>{var s=i(13468);i(61286).register("dynamicBitmapText",(function(t,e,i,n,r){return this.displayList.add(new s(this.scene,t,e,i,n,r))}))},88899:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(16873),n=i(93438),t.exports={renderWebGL:s,renderCanvas:n}},16873:(t,e,i)=>{var s=i(73329),n=i(69360),r=i(75512),o=new n;t.exports=function(t,e,i,n){var a=e.text,h=a.length;if(0!==h){i.addToRenderList(e);var l=t.pipelines.set(e.pipeline,e),u=s(e,i,n),c=u.sprite,d=u.calc,p=o,f=e.cropWidth>0||e.cropHeight>0;f&&(l.flush(),t.pushScissor(d.tx,d.ty,e.cropWidth*d.scaleX,e.cropHeight*d.scaleY));var v,g,m=e.frame.glTexture,y=e.tintFill,x=r.getTintAppendFloatAlpha(e.tintTopLeft,i.alpha*e._alphaTL),T=r.getTintAppendFloatAlpha(e.tintTopRight,i.alpha*e._alphaTR),w=r.getTintAppendFloatAlpha(e.tintBottomLeft,i.alpha*e._alphaBL),b=r.getTintAppendFloatAlpha(e.tintBottomRight,i.alpha*e._alphaBR),E=l.setGameObject(e),S=0,A=0,_=0,C=0,M=e.letterSpacing,R=0,P=0,O=e.scrollX,L=e.scrollY,F=e.fontData,D=F.chars,k=F.lineHeight,I=e.fontSize/F.size,B=0,N=e._align,Y=0,U=0,X=e.getTextBounds(!1);e.maxWidth>0&&(h=(a=X.wrappedText).length);var z=e._bounds.lines;1===N?U=(z.longest-z.lengths[0])/2:2===N&&(U=z.longest-z.lengths[0]);var G=i.roundPixels,V=e.displayCallback,W=e.callbackData;t.pipelines.preBatch(e);for(var H=0;H{var s=i(56694),n=i(82897),r=i(64937),o=i(89980),a=i(82173),h=i(68298),l=i(31476),u=i(74118),c=i(84557),d=new s({Extends:o,Mixins:[r.Alpha,r.BlendMode,r.Depth,r.Mask,r.Origin,r.Pipeline,r.ScrollFactor,r.Texture,r.Tint,r.Transform,r.Visible,c],initialize:function(t,e,i,s,n,r,h){void 0===n&&(n=""),void 0===h&&(h=0),o.call(this,t,"BitmapText"),this.font=s;var l=this.scene.sys.cache.bitmapFont.get(s);l||console.warn("Invalid BitmapText key: "+s),this.fontData=l.data,this._text="",this._fontSize=r||this.fontData.size,this._letterSpacing=0,this._align=h,this._bounds=a(),this._dirty=!0,this._maxWidth=0,this.wordWrapCharCode=32,this.charColors=[],this.dropShadowX=0,this.dropShadowY=0,this.dropShadowColor=0,this.dropShadowAlpha=.5,this.fromAtlas=l.fromAtlas,this.setTexture(l.texture,l.frame),this.setPosition(e,i),this.setOrigin(0,0),this.initPipeline(),this.setText(n)},setLeftAlign:function(){return this._align=d.ALIGN_LEFT,this._dirty=!0,this},setCenterAlign:function(){return this._align=d.ALIGN_CENTER,this._dirty=!0,this},setRightAlign:function(){return this._align=d.ALIGN_RIGHT,this._dirty=!0,this},setFontSize:function(t){return this._fontSize=t,this._dirty=!0,this},setLetterSpacing:function(t){return void 0===t&&(t=0),this._letterSpacing=t,this._dirty=!0,this},setText:function(t){return t||0===t||(t=""),Array.isArray(t)&&(t=t.join("\n")),t!==this.text&&(this._text=t.toString(),this._dirty=!0,this.updateDisplayOrigin()),this},setDropShadow:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=.5),this.dropShadowX=t,this.dropShadowY=e,this.dropShadowColor=i,this.dropShadowAlpha=s,this},setCharacterTint:function(t,e,i,s,r,o,a){void 0===t&&(t=0),void 0===e&&(e=1),void 0===i&&(i=!1),void 0===s&&(s=-1),void 0===r&&(r=s,o=s,a=s);var h=this.text.length;-1===e&&(e=h),t<0&&(t=h+t),t=n(t,0,h-1);for(var l=n(t+e,t,h),u=this.charColors,c=t;c{var s=i(49584);t.exports=function(t,e,i,n){var r=e._text,o=r.length,a=t.currentContext;if(0!==o&&s(t,a,e,i,n)){i.addToRenderList(e);var h=e.fromAtlas?e.frame:e.texture.frames.__BASE,l=e.fontData.chars,u=e.fontData.lineHeight,c=e._letterSpacing,d=0,p=0,f=0,v=null,g=0,m=0,y=0,x=0,T=0,w=0,b=null,E=0,S=h.source.image,A=h.cutX,_=h.cutY,C=e._fontSize/e.fontData.size,M=e._align,R=0,P=0,O=e.getTextBounds(!1);e.maxWidth>0&&(o=(r=O.wrappedText).length);var L=e._bounds.lines;1===M?P=(L.longest-L.lengths[0])/2:2===M&&(P=L.longest-L.lengths[0]),a.translate(-e.displayOriginX,-e.displayOriginY);for(var F=i.roundPixels,D=0;D{var s=i(44616),n=i(88933),r=i(99325),o=i(20494),a=i(10850);r.register("bitmapText",(function(t,e){void 0===t&&(t={});var i=a(t,"font",""),r=o(t,"text",""),h=o(t,"size",!1),l=a(t,"align",0),u=new s(this.scene,0,0,i,r,h,l);return void 0!==e&&(t.add=e),n(this.scene,u,t),u}))},21797:(t,e,i)=>{var s=i(44616);i(61286).register("bitmapText",(function(t,e,i,n,r,o){return this.displayList.add(new s(this.scene,t,e,i,n,r,o))}))},84557:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(26372),n=i(97545),t.exports={renderWebGL:s,renderCanvas:n}},26372:(t,e,i)=>{var s=i(8810),n=i(73329),r=i(75512);t.exports=function(t,e,i,o){if(0!==e._text.length){i.addToRenderList(e);var a,h,l,u=t.pipelines.set(e.pipeline,e),c=n(e,i,o).calc,d=i.roundPixels,p=i.alpha,f=e.charColors,v=e.tintFill,g=r.getTintAppendFloatAlpha,m=g(e.tintTopLeft,p*e._alphaTL),y=g(e.tintTopRight,p*e._alphaTR),x=g(e.tintBottomLeft,p*e._alphaBL),T=g(e.tintBottomRight,p*e._alphaBR),w=e.frame.glTexture,b=u.setGameObject(e),E=e.getTextBounds(!1).characters,S=e.dropShadowX,A=e.dropShadowY,_=0!==S||0!==A;if(t.pipelines.preBatch(e),_){var C=e.dropShadowColor,M=e.dropShadowAlpha,R=g(C,p*M*e._alphaTL),P=g(C,p*M*e._alphaTR),O=g(C,p*M*e._alphaBL),L=g(C,p*M*e._alphaBR);for(a=0;a{var s=i(92246),n=i(41664),r=i(56694),o=i(64937),a=i(82047),h=i(89980),l=i(71207),u=new r({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.Depth,o.Mask,o.Pipeline,o.ScrollFactor,o.Size,o.Texture,o.Transform,o.Visible,s],initialize:function(t,e,i,s,n){h.call(this,t,"Blitter"),this.setTexture(s,n),this.setPosition(e,i),this.initPipeline(),this.children=new l,this.renderList=[],this.dirty=!1},create:function(t,e,i,s,r){void 0===s&&(s=!0),void 0===r&&(r=this.children.length),void 0===i?i=this.frame:i instanceof a||(i=this.texture.get(i));var o=new n(this,t,e,i,s);return this.children.addAt(o,r,!1),this.dirty=!0,o},createFromCallback:function(t,e,i,s){for(var n=this.createMultiple(e,i,s),r=0;r0},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(){this.children.removeAll(),this.dirty=!0},preDestroy:function(){this.children.destroy(),this.renderList=[]}});t.exports=u},33177:t=>{t.exports=function(t,e,i,s){var n=e.getRenderList();if(0!==n.length){var r=t.currentContext,o=i.alpha*e.alpha;if(0!==o){i.addToRenderList(e),r.globalCompositeOperation=t.blendModes[e.blendMode],r.imageSmoothingEnabled=!(!t.antialias||e.frame.source.scaleMode);var a=e.x-i.scrollX*e.scrollFactorX,h=e.y-i.scrollY*e.scrollFactorY;r.save(),s&&s.copyToContext(r);for(var l=i.roundPixels,u=0;u{var s=i(52816),n=i(88933),r=i(99325),o=i(20494);r.register("blitter",(function(t,e){void 0===t&&(t={});var i=o(t,"key",null),r=o(t,"frame",null),a=new s(this.scene,0,0,i,r);return void 0!==e&&(t.add=e),n(this.scene,a,t),a}))},38906:(t,e,i)=>{var s=i(52816);i(61286).register("blitter",(function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))}))},92246:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(89165),n=i(33177),t.exports={renderWebGL:s,renderCanvas:n}},89165:(t,e,i)=>{var s=i(69360),n=i(75512),r=new s;t.exports=function(t,e,i,s){var o=e.getRenderList();if(0!==o.length){var a=i.alpha*e.alpha;if(0!==a){i.addToRenderList(e);var h=t.pipelines.set(this.pipeline,e),l=i.scrollX*e.scrollFactorX,u=i.scrollY*e.scrollFactorY,c=r.copyFrom(i.matrix);s&&(c.multiplyWithOffset(s,-l,-u),l=0,u=0);var d=e.x-l,p=e.y-u,f=-1,v=i.roundPixels;t.pipelines.preBatch(e);for(var g=0;g{var s=i(56694),n=i(82047),r=new s({initialize:function(t,e,i,s,n){this.parent=t,this.x=e,this.y=i,this.frame=s,this.data={},this.tint=16777215,this._visible=n,this._alpha=1,this.flipX=!1,this.flipY=!1},setFrame:function(t){return void 0===t?this.frame=this.parent.frame:t instanceof n&&t.texture===this.parent.texture?this.frame=t:this.frame=this.parent.texture.get(t),this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this},reset:function(t,e,i){return this.x=t,this.y=e,this.flipX=!1,this.flipY=!1,this._alpha=1,this._visible=!0,this.parent.dirty=!0,i&&this.setFrame(i),this},setPosition:function(t,e){return this.x=t,this.y=e,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},setVisible:function(t){return this.visible=t,this},setAlpha:function(t){return this.alpha=t,this},setTint:function(t){return this.tint=t,this},destroy:function(){this.parent.dirty=!0,this.parent.children.remove(this),this.parent=void 0,this.frame=void 0,this.data=void 0},visible:{get:function(){return this._visible},set:function(t){this.parent.dirty|=this._visible!==t,this._visible=t}},alpha:{get:function(){return this._alpha},set:function(t){this.parent.dirty|=this._alpha>0!=t>0,this._alpha=t}}});t.exports=r},97123:(t,e,i)=>{var s=i(82897),n={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,n){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=s(t,0,1),this._alphaTR=s(e,0,1),this._alphaBL=s(i,0,1),this._alphaBR=s(n,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=s(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=s(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=s(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=s(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=n},15720:(t,e,i)=>{var s=i(82897),n={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t){return void 0===t&&(t=1),this.alpha=t,this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}}};t.exports=n},69732:(t,e,i)=>{var s=i(95723),n={_blendMode:s.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=s[t]),(t|=0)>=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=n},28284:t=>{t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},85293:t=>{var e={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,s){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,s,this.flipX,this.flipY);else{var n=t;this.frame.setCropUVs(this._crop,n.x,n.y,n.width,n.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=e},14975:t=>{var e={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.displayList&&this.displayList.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=e},88677:t=>{var e={fxPadding:0,setFXPadding:function(t){return void 0===t&&(t=0),this.fxPadding=t,this},onFXCopy:function(){},onFX:function(){}};t.exports=e},92972:t=>{t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},80693:(t,e,i)=>{var s=i(74118),n=i(2386),r=i(93736),o={prepareBoundsOutput:function(t,e){(void 0===e&&(e=!1),0!==this.rotation&&n(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getCenter:function(t){return void 0===t&&(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,t},getTopLeft:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopRight:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getLeftCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getRightCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getBottomLeft:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomRight:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBounds:function(t){var e,i,n,r,o,a,h,l;if(void 0===t&&(t=new s),this.parentContainer){var u=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(t),u.transformPoint(t.x,t.y,t),e=t.x,i=t.y,this.getTopRight(t),u.transformPoint(t.x,t.y,t),n=t.x,r=t.y,this.getBottomLeft(t),u.transformPoint(t.x,t.y,t),o=t.x,a=t.y,this.getBottomRight(t),u.transformPoint(t.x,t.y,t),h=t.x,l=t.y}else this.getTopLeft(t),e=t.x,i=t.y,this.getTopRight(t),n=t.x,r=t.y,this.getBottomLeft(t),o=t.x,a=t.y,this.getBottomRight(t),h=t.x,l=t.y;return t.x=Math.min(e,n,o,h),t.y=Math.min(i,r,a,l),t.width=Math.max(e,n,o,h)-t.x,t.height=Math.max(i,r,a,l)-t.y,t}};t.exports=o},39171:(t,e,i)=>{var s=i(76756),n=i(63037),r={mask:null,setMask:function(t){return this.mask=t,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},createBitmapMask:function(t){return void 0===t&&(this.texture||this.shader)&&(t=this),new s(this.scene,t)},createGeometryMask:function(t){return void 0===t&&"Graphics"===this.type&&(t=this),new n(this.scene,t)}};t.exports=r},28072:t=>{var e={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(t){this._displayOriginX=t,this.originX=t/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(t){this._displayOriginY=t,this.originY=t/this.height}},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this.updateDisplayOrigin()},setOriginFromFrame:function(){return this.frame&&this.frame.customPivot?(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin()):this.setOrigin()},setDisplayOrigin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displayOriginX=t,this.displayOriginY=e,this},updateDisplayOrigin:function(){return this._displayOriginX=this.originX*this.width,this._displayOriginY=this.originY*this.height,this}};t.exports=e},54211:(t,e,i)=>{var s=i(75606),n=i(63130),r=i(10850),o=i(55303),a=i(93736),h={path:null,rotateToPath:!1,pathRotationOffset:0,pathOffset:null,pathVector:null,pathDelta:null,pathTween:null,pathConfig:null,_prevDirection:o.PLAYING_FORWARD,setPath:function(t,e){void 0===e&&(e=this.pathConfig);var i=this.pathTween;return i&&i.isPlaying()&&i.stop(),this.path=t,e&&this.startFollow(e),this},setRotateToPath:function(t,e){return void 0===e&&(e=0),this.rotateToPath=t,this.pathRotationOffset=e,this},isFollowing:function(){var t=this.pathTween;return t&&t.isPlaying()},startFollow:function(t,e){void 0===t&&(t={}),void 0===e&&(e=0);var i=this.pathTween;i&&i.isPlaying()&&i.stop(),"number"==typeof t&&(t={duration:t}),t.from=r(t,"from",0),t.to=r(t,"to",1);var h=n(t,"positionOnPath",!1);this.rotateToPath=n(t,"rotateToPath",!1),this.pathRotationOffset=r(t,"rotationOffset",0);var l=r(t,"startAt",e);if(l&&(t.onStart=function(t){var e=t.data[0];e.progress=l,e.elapsed=e.duration*l;var i=e.ease(e.progress);e.current=e.start+(e.end-e.start)*i,e.target[e.key]=e.current}),this.pathOffset||(this.pathOffset=new a(this.x,this.y)),this.pathVector||(this.pathVector=new a),this.pathDelta||(this.pathDelta=new a),this.pathDelta.reset(),this.pathTween=this.scene.sys.tweens.addCounter(t),this.path.getStartPoint(this.pathOffset),h&&(this.x=this.pathOffset.x,this.y=this.pathOffset.y),this.pathOffset.x=this.x-this.pathOffset.x,this.pathOffset.y=this.y-this.pathOffset.y,this._prevDirection=o.PLAYING_FORWARD,this.rotateToPath){var u=this.path.getPoint(.1);this.rotation=Math.atan2(u.y-this.y,u.x-this.x)+s(this.pathRotationOffset)}return this.pathConfig=t,this},pauseFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.pause(),this},resumeFollow:function(){var t=this.pathTween;return t&&t.isPaused()&&t.resume(),this},stopFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.stop(),this},pathUpdate:function(){var t=this.pathTween;if(t){var e=t.data[0],i=this.pathDelta,n=this.pathVector;if(i.copy(n).negate(),e.state===o.COMPLETE)return this.path.getPoint(1,n),i.add(n),n.add(this.pathOffset),void this.setPosition(n.x,n.y);if(e.state!==o.PLAYING_FORWARD&&e.state!==o.PLAYING_BACKWARD)return;this.path.getPoint(t.getValue(),n),i.add(n),n.add(this.pathOffset);var r=this.x,a=this.y;this.setPosition(n.x,n.y);var h=this.x-r,l=this.y-a;if(0===h&&0===l)return;if(e.state!==this._prevDirection)return void(this._prevDirection=e.state);this.rotateToPath&&(this.rotation=Math.atan2(l,h)+s(this.pathRotationOffset))}}};t.exports=h},58210:(t,e,i)=>{var s=i(28699),n=i(65641),r=i(72677),o={defaultPipeline:null,pipeline:null,hasPostPipeline:!1,postPipelines:null,pipelineData:null,initPipeline:function(t){void 0===t&&(t=n.MULTI_PIPELINE);var e=this.scene.sys.renderer;if(!e)return!1;var i=e.pipelines;if(this.postPipelines=[],this.pipelineData={},i){var s=i.get(t);if(s)return this.defaultPipeline=s,this.pipeline=s,!0}return!1},setPipeline:function(t,e,i){var n=this.scene.sys.renderer;if(!n)return this;var r=n.pipelines;if(r){var o=r.get(t);o&&(this.pipeline=o),e&&(this.pipelineData=i?s(e):e)}return this},setPostPipeline:function(t,e,i){var n=this.scene.sys.renderer;if(!n)return this;var r=n.pipelines;if(r){Array.isArray(t)||(t=[t]);for(var o=0;o0,this},setPipelineData:function(t,e){var i=this.pipelineData;return void 0===e?delete i[t]:i[t]=e,this},getPostPipeline:function(t){for(var e=this.postPipelines,i=[],s=0;s=0;i--){var s=e[i];("string"==typeof t&&s.name===t||"string"!=typeof t&&s instanceof t)&&(s.destroy(),r(e,i))}return this.hasPostPipeline=this.postPipelines.length>0,this},getPipelineName:function(){return this.pipeline.name}};t.exports=o},45900:t=>{var e={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=e},31654:t=>{var e={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return Math.abs(this.scaleX*this.frame.realWidth)},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return Math.abs(this.scaleY*this.frame.realHeight)},set:function(t){this.scaleY=t/this.frame.realHeight}},setSizeToFrame:function(t){return void 0===t&&(t=this.frame),this.width=t.realWidth,this.height=t.realHeight,this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}};t.exports=e},82081:t=>{var e={texture:null,frame:null,isCropped:!1,setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};t.exports=e},21850:t=>{var e={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,s){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,s,this.flipX,this.flipY);else{var n=t;this.frame.setCropUVs(this._crop,n.x,n.y,n.width,n.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=e},58072:t=>{var e={tintTopLeft:16777215,tintTopRight:16777215,tintBottomLeft:16777215,tintBottomRight:16777215,tintFill:!1,clearTint:function(){return this.setTint(16777215),this},setTint:function(t,e,i,s){return void 0===t&&(t=16777215),void 0===e&&(e=t,i=t,s=t),this.tintTopLeft=t,this.tintTopRight=e,this.tintBottomLeft=i,this.tintBottomRight=s,this.tintFill=!1,this},setTintFill:function(t,e,i,s){return this.setTint(t,e,i,s),this.tintFill=!0,this},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){var t=16777215;return this.tintFill||this.tintTopLeft!==t||this.tintTopRight!==t||this.tintBottomLeft!==t||this.tintBottomRight!==t}}};t.exports=e},48129:t=>{t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},56584:(t,e,i)=>{var s=i(83392),n=i(69360),r=i(64462),o=i(35786),a=i(62138),h=i(93736),l={_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(t){this._scaleX=t,this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},angle:{get:function(){return a(this._rotation*s.RAD_TO_DEG)},set:function(t){this.rotation=a(t)*s.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=o(t)}},setPosition:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===s&&(s=0),this.x=t,this.y=e,this.z=i,this.w=s,this},copyPosition:function(t){return void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.z&&(this.z=t.z),void 0!==t.w&&(this.w=t.w),this},setRandomPosition:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===s&&(s=this.scene.sys.scale.height),this.x=t+Math.random()*i,this.y=e+Math.random()*s,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new n),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new n),void 0===e&&(e=new n);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);for(t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return t},getLocalPoint:function(t,e,i,s){i||(i=new h),s||(s=this.scene.sys.cameras.main);var n=s.scrollX,o=s.scrollY,a=t+n*this.scrollFactorX-n,l=e+o*this.scrollFactorY-o;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(a,l,i):r(a,l,this.x,this.y,this.rotation,this.scaleX,this.scaleY,i),this._originComponent&&(i.x+=this._displayOriginX,i.y+=this._displayOriginY),i},getParentRotation:function(){for(var t=0,e=this.parentContainer;e;)t+=e.rotation,e=e.parentContainer;return t}};t.exports=l},69360:(t,e,i)=>{var s=i(56694),n=i(83392),r=i(93736),o=new s({initialize:function(t,e,i,s,n,r){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=1),void 0===n&&(n=0),void 0===r&&(r=0),this.matrix=new Float32Array([t,e,i,s,n,r,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0}},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var t=this.matrix,e=t[0],i=t[1],s=t[2],r=t[3];return e||i?i>0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):s||r?n.TAU-(r>0?Math.acos(-s/this.scaleY):-Math.acos(s/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),s=this.matrix,n=s[0],r=s[1],o=s[2],a=s[3];return s[0]=n*i+o*e,s[1]=r*i+a*e,s[2]=n*-e+o*i,s[3]=r*-e+a*i,this},multiply:function(t,e){var i=this.matrix,s=t.matrix,n=i[0],r=i[1],o=i[2],a=i[3],h=i[4],l=i[5],u=s[0],c=s[1],d=s[2],p=s[3],f=s[4],v=s[5],g=void 0===e?this:e;return g.a=u*n+c*o,g.b=u*r+c*a,g.c=d*n+p*o,g.d=d*r+p*a,g.e=f*n+v*o+h,g.f=f*r+v*a+l,g},multiplyWithOffset:function(t,e,i){var s=this.matrix,n=t.matrix,r=s[0],o=s[1],a=s[2],h=s[3],l=e*r+i*a+s[4],u=e*o+i*h+s[5],c=n[0],d=n[1],p=n[2],f=n[3],v=n[4],g=n[5];return s[0]=c*r+d*a,s[1]=c*o+d*h,s[2]=p*r+f*a,s[3]=p*o+f*h,s[4]=v*r+g*a+l,s[5]=v*o+g*h+u,this},transform:function(t,e,i,s,n,r){var o=this.matrix,a=o[0],h=o[1],l=o[2],u=o[3],c=o[4],d=o[5];return o[0]=t*a+e*l,o[1]=t*h+e*u,o[2]=i*a+s*l,o[3]=i*h+s*u,o[4]=n*a+r*l+c,o[5]=n*h+r*u+d,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var s=this.matrix,n=s[0],r=s[1],o=s[2],a=s[3],h=s[4],l=s[5];return i.x=t*n+e*o+h,i.y=t*r+e*a+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=e*n-i*s;return t[0]=n/a,t[1]=-i/a,t[2]=-s/a,t[3]=e/a,t[4]=(s*o-n*r)/a,t[5]=-(e*o-i*r)/a,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){var e=this.matrix;return t.setTransform(e[0],e[1],e[2],e[3],e[4],e[5]),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,s,n,r){var o=this.matrix;return o[0]=t,o[1]=e,o[2]=i,o[3]=s,o[4]=n,o[5]=r,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],s=e[1],n=e[2],r=e[3],o=i*r-s*n;if(t.translateX=e[4],t.translateY=e[5],i||s){var a=Math.sqrt(i*i+s*s);t.rotation=s>0?Math.acos(i/a):-Math.acos(i/a),t.scaleX=a,t.scaleY=o/a}else if(n||r){var h=Math.sqrt(n*n+r*r);t.rotation=.5*Math.PI-(r>0?Math.acos(-n/h):-Math.acos(n/h)),t.scaleX=o/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,i,s,n){var r=this.matrix,o=Math.sin(i),a=Math.cos(i);return r[4]=t,r[5]=e,r[0]=a*s,r[1]=o*s,r[2]=-o*n,r[3]=a*n,this},applyInverse:function(t,e,i){void 0===i&&(i=new r);var s=this.matrix,n=s[0],o=s[1],a=s[2],h=s[3],l=s[4],u=s[5],c=1/(n*h+a*-o);return i.x=h*c*t+-a*c*e+(u*a-l*h)*c,i.y=n*c*e+-o*c*t+(-u*n+l*o)*c,i},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getXRound:function(t,e,i){var s=this.getX(t,e);return i&&(s=Math.round(s)),s},getYRound:function(t,e,i){var s=this.getY(t,e);return i&&(s=Math.round(s)),s},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.decomposedMatrix=null}});t.exports=o},59694:t=>{var e={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=e},64937:(t,e,i)=>{t.exports={Alpha:i(97123),AlphaSingle:i(15720),BlendMode:i(69732),ComputedSize:i(28284),Crop:i(85293),Depth:i(14975),Flip:i(92972),FX:i(88677),GetBounds:i(80693),Mask:i(39171),Origin:i(28072),PathFollower:i(54211),Pipeline:i(58210),ScrollFactor:i(45900),Size:i(31654),Texture:i(82081),TextureCrop:i(21850),Tint:i(58072),ToJSON:i(48129),Transform:i(56584),TransformMatrix:i(69360),Visible:i(59694)}},70339:(t,e,i)=>{var s=i(59959),n=i(95723),r=i(56694),o=i(64937),a=i(56631),h=i(89980),l=i(74118),u=i(98524),c=i(58795),d=i(93736),p=new r({Extends:h,Mixins:[o.AlphaSingle,o.BlendMode,o.ComputedSize,o.Depth,o.Mask,o.Pipeline,o.Transform,o.Visible,u],initialize:function(t,e,i,s){h.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new o.TransformMatrix,this.tempTransformMatrix=new o.TransformMatrix,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.initPipeline(),this.setPosition(e,i),this.clearAlpha(),this.setBlendMode(n.SKIP_CHECK),s&&this.add(s)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new l),t.setTo(this.x,this.y,0,0),this.parentContainer){var e=this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x,this.y);t.setTo(e.x,e.y,0,0)}if(this.list.length>0){var i=this.list,s=new l,n=!1;t.setEmpty();for(var r=0;r-1},setAll:function(t,e,i,n){return s.SetAll(this.list,t,e,i,n),this},each:function(t,e){var i,s=[null],n=this.list.slice(),r=n.length;for(i=2;i0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[]}});t.exports=p},13916:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e);var n=e.list;if(0!==n.length){var r=e.localTransform;s?(r.loadIdentity(),r.multiply(s),r.translate(e.x,e.y),r.rotate(e.rotation),r.scale(e.scaleX,e.scaleY)):r.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var o=-1!==e.blendMode;o||t.setBlendMode(0);var a=e._alpha,h=e.scrollFactorX,l=e.scrollFactorY;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var u=0;u{var s=i(88933),n=i(70339),r=i(99325),o=i(20494);r.register("container",(function(t,e){void 0===t&&(t={});var i=o(t,"x",0),r=o(t,"y",0),a=o(t,"children",null),h=new n(this.scene,i,r,a);return void 0!==e&&(t.add=e),s(this.scene,h,t),h}))},23400:(t,e,i)=>{var s=i(70339);i(61286).register("container",(function(t,e,i){return this.displayList.add(new s(this.scene,t,e,i))}))},98524:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(36934),n=i(13916),t.exports={renderWebGL:s,renderCanvas:n}},36934:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e);var n=e.list,r=n.length;if(0!==r){var o=e.localTransform;s?(o.loadIdentity(),o.multiply(s),o.translate(e.x,e.y),o.rotate(e.rotation),o.scale(e.scaleX,e.scaleY)):o.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),t.pipelines.preBatch(e);var a=-1!==e.blendMode;a||t.setBlendMode(0);for(var h=e.alpha,l=e.scrollFactorX,u=e.scrollFactorY,c=0;c{t.exports=["normal","multiply","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]},38943:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(11603),o=i(89980),a=i(42911),h=i(55638),l=i(7599),u=i(51729),c=new s({Extends:o,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Origin,n.ScrollFactor,n.Transform,n.Visible,r],initialize:function(t,e,i,s,n,r){o.call(this,t,"DOMElement"),this.parent=t.sys.game.domContainer,this.cache=t.sys.cache.html,this.node,this.transformOnly=!1,this.skewX=0,this.skewY=0,this.rotate3d=new u,this.rotate3dAngle="deg",this.pointerEvents="auto",this.width=0,this.height=0,this.displayWidth=0,this.displayHeight=0,this.handler=this.dispatchNativeEvent.bind(this),this.setPosition(e,i),"string"==typeof s?"#"===s[0]?this.setElement(s.substr(1),n,r):this.createElement(s,n,r):s&&this.setElement(s,n,r),t.sys.events.on(l.SLEEP,this.handleSceneEvent,this),t.sys.events.on(l.WAKE,this.handleSceneEvent,this),t.sys.events.on(l.PRE_RENDER,this.preRender,this)},handleSceneEvent:function(t){var e=this.node,i=e.style;e&&(i.display=t.settings.visible?"block":"none")},setSkew:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.skewX=t,this.skewY=e,this},setPerspective:function(t){return this.parent.style.perspective=t+"px",this},perspective:{get:function(){return parseFloat(this.parent.style.perspective)},set:function(t){this.parent.style.perspective=t+"px"}},addListener:function(t){if(this.node){t=t.split(" ");for(var e=0;e{var s=i(2452),n=i(89980),r=i(69360),o=new r,a=new r,h=new r;t.exports=function(t,e,i,r){if(e.node){var l=e.node.style,u=e.scene.sys.settings;if(!l||!u.visible||n.RENDER_MASK!==e.renderFlags||0!==e.cameraFilter&&e.cameraFilter&i.id||e.parentContainer&&!e.parentContainer.willRender())l.display="none";else{var c=e.parentContainer,d=i.alpha*e.alpha;c&&(d*=c.alpha);var p=o,f=a,v=h,g=0,m=0,y="0%",x="0%";r?(g=e.width*e.scaleX*e.originX,m=e.height*e.scaleY*e.originY,f.applyITRS(e.x-g,e.y-m,e.rotation,e.scaleX,e.scaleY),p.copyFrom(i.matrix),p.multiplyWithOffset(r,-i.scrollX*e.scrollFactorX,-i.scrollY*e.scrollFactorY),f.e=e.x-g,f.f=e.y-m,p.multiply(f,v)):(g=e.width*e.originX,m=e.height*e.originY,f.applyITRS(e.x-g,e.y-m,e.rotation,e.scaleX,e.scaleY),p.copyFrom(i.matrix),y=100*e.originX+"%",x=100*e.originY+"%",f.e-=i.scrollX*e.scrollFactorX,f.f-=i.scrollY*e.scrollFactorY,p.multiply(f,v)),e.transformOnly||(l.display="block",l.opacity=d,l.zIndex=e._depth,l.pointerEvents=e.pointerEvents,l.mixBlendMode=s[e._blendMode]),l.transform=v.getCSSMatrix()+" skew("+e.skewX+"rad, "+e.skewY+"rad) rotate3d("+e.rotate3d.x+","+e.rotate3d.y+","+e.rotate3d.z+","+e.rotate3d.w+e.rotate3dAngle+")",l.transformOrigin=y+" "+x}}}},66788:(t,e,i)=>{var s=i(38943);i(61286).register("dom",(function(t,e,i,n,r){var o=new s(this.scene,t,e,i,n,r);return this.displayList.add(o),o}))},11603:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(66070),n=i(66070),t.exports={renderWebGL:s,renderCanvas:n}},65492:t=>{t.exports="addedtoscene"},98398:t=>{t.exports="destroy"},40239:t=>{t.exports="removedfromscene"},17286:t=>{t.exports="complete"},31496:t=>{t.exports="created"},89587:t=>{t.exports="error"},96342:t=>{t.exports="loop"},49614:t=>{t.exports="play"},24418:t=>{t.exports="seeked"},87318:t=>{t.exports="seeking"},61922:t=>{t.exports="stop"},13991:t=>{t.exports="timeout"},4052:t=>{t.exports="unlocked"},56631:(t,e,i)=>{t.exports={ADDED_TO_SCENE:i(65492),DESTROY:i(98398),REMOVED_FROM_SCENE:i(40239),VIDEO_COMPLETE:i(17286),VIDEO_CREATED:i(31496),VIDEO_ERROR:i(89587),VIDEO_LOOP:i(96342),VIDEO_PLAY:i(49614),VIDEO_SEEKED:i(24418),VIDEO_SEEKING:i(87318),VIDEO_STOP:i(61922),VIDEO_TIMEOUT:i(13991),VIDEO_UNLOCKED:i(4052)}},39419:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(89980),o=i(79394),a=new s({Extends:r,Mixins:[n.Alpha,n.BlendMode,n.Depth,n.Flip,n.Origin,n.ScrollFactor,n.Size,n.Texture,n.Tint,n.Transform,n.Visible,o],initialize:function(t){r.call(this,t,"Extern")},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(){},render:function(){}});t.exports=a},96699:()=>{},41155:(t,e,i)=>{var s=i(39419);i(61286).register("extern",(function(){var t=new s(this.scene);return this.displayList.add(t),t}))},79394:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(81410),n=i(96699),t.exports={renderWebGL:s,renderCanvas:n}},81410:(t,e,i)=>{var s=i(73329);t.exports=function(t,e,i,n){t.pipelines.clear();var r=s(e,i,n).calc;e.render.call(e,t,i,r),t.pipelines.rebind()}},36266:t=>{t.exports={ARC:0,BEGIN_PATH:1,CLOSE_PATH:2,FILL_RECT:3,LINE_TO:4,MOVE_TO:5,LINE_STYLE:6,FILL_STYLE:7,FILL_PATH:8,STROKE_PATH:9,FILL_TRIANGLE:10,STROKE_TRIANGLE:11,SAVE:14,RESTORE:15,TRANSLATE:16,SCALE:17,ROTATE:18,GRADIENT_FILL_STYLE:21,GRADIENT_LINE_STYLE:22}},33182:(t,e,i)=>{var s=i(51052),n=i(56694),r=i(36266),o=i(15720),a=i(69732),h=i(14975),l=i(39171),u=i(58210),c=i(45900),d=i(56584),p=i(59694),f=i(95669),v=i(89980),g=i(72632),m=i(10850),y=i(83392),x=i(60898),T=new n({Extends:v,Mixins:[o,a,h,l,u,d,p,c,x],initialize:function(t,e){var i=m(e,"x",0),s=m(e,"y",0);v.call(this,t,"Graphics"),this.setPosition(i,s),this.initPipeline(),this.displayOriginX=0,this.displayOriginY=0,this.commandBuffer=[],this.defaultFillColor=-1,this.defaultFillAlpha=1,this.defaultStrokeWidth=1,this.defaultStrokeColor=-1,this.defaultStrokeAlpha=1,this._lineWidth=1,this.setDefaultStyles(e)},setDefaultStyles:function(t){return m(t,"lineStyle",null)&&(this.defaultStrokeWidth=m(t,"lineStyle.width",1),this.defaultStrokeColor=m(t,"lineStyle.color",16777215),this.defaultStrokeAlpha=m(t,"lineStyle.alpha",1),this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha)),m(t,"fillStyle",null)&&(this.defaultFillColor=m(t,"fillStyle.color",16777215),this.defaultFillAlpha=m(t,"fillStyle.alpha",1),this.fillStyle(this.defaultFillColor,this.defaultFillAlpha)),this},lineStyle:function(t,e,i){return void 0===i&&(i=1),this.commandBuffer.push(r.LINE_STYLE,t,e,i),this._lineWidth=t,this},fillStyle:function(t,e){return void 0===e&&(e=1),this.commandBuffer.push(r.FILL_STYLE,t,e),this},fillGradientStyle:function(t,e,i,s,n,o,a,h){return void 0===n&&(n=1),void 0===o&&(o=n),void 0===a&&(a=n),void 0===h&&(h=n),this.commandBuffer.push(r.GRADIENT_FILL_STYLE,n,o,a,h,t,e,i,s),this},lineGradientStyle:function(t,e,i,s,n,o){return void 0===o&&(o=1),this.commandBuffer.push(r.GRADIENT_LINE_STYLE,t,o,e,i,s,n),this},beginPath:function(){return this.commandBuffer.push(r.BEGIN_PATH),this},closePath:function(){return this.commandBuffer.push(r.CLOSE_PATH),this},fillPath:function(){return this.commandBuffer.push(r.FILL_PATH),this},fill:function(){return this.commandBuffer.push(r.FILL_PATH),this},strokePath:function(){return this.commandBuffer.push(r.STROKE_PATH),this},stroke:function(){return this.commandBuffer.push(r.STROKE_PATH),this},fillCircleShape:function(t){return this.fillCircle(t.x,t.y,t.radius)},strokeCircleShape:function(t){return this.strokeCircle(t.x,t.y,t.radius)},fillCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,y.PI2),this.fillPath(),this},strokeCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,y.PI2),this.strokePath(),this},fillRectShape:function(t){return this.fillRect(t.x,t.y,t.width,t.height)},strokeRectShape:function(t){return this.strokeRect(t.x,t.y,t.width,t.height)},fillRect:function(t,e,i,s){return this.commandBuffer.push(r.FILL_RECT,t,e,i,s),this},strokeRect:function(t,e,i,s){var n=this._lineWidth/2,r=t-n,o=t+n;return this.beginPath(),this.moveTo(t,e),this.lineTo(t,e+s),this.strokePath(),this.beginPath(),this.moveTo(t+i,e),this.lineTo(t+i,e+s),this.strokePath(),this.beginPath(),this.moveTo(r,e),this.lineTo(o+i,e),this.strokePath(),this.beginPath(),this.moveTo(r,e+s),this.lineTo(o+i,e+s),this.strokePath(),this},fillRoundedRect:function(t,e,i,s,n){void 0===n&&(n=20);var r=n,o=n,a=n,h=n;return"number"!=typeof n&&(r=g(n,"tl",20),o=g(n,"tr",20),a=g(n,"bl",20),h=g(n,"br",20)),this.beginPath(),this.moveTo(t+r,e),this.lineTo(t+i-o,e),this.arc(t+i-o,e+o,o,-y.TAU,0),this.lineTo(t+i,e+s-h),this.arc(t+i-h,e+s-h,h,0,y.TAU),this.lineTo(t+a,e+s),this.arc(t+a,e+s-a,a,y.TAU,Math.PI),this.lineTo(t,e+r),this.arc(t+r,e+r,r,-Math.PI,-y.TAU),this.fillPath(),this},strokeRoundedRect:function(t,e,i,s,n){void 0===n&&(n=20);var r=n,o=n,a=n,h=n;return"number"!=typeof n&&(r=g(n,"tl",20),o=g(n,"tr",20),a=g(n,"bl",20),h=g(n,"br",20)),this.beginPath(),this.moveTo(t+r,e),this.lineTo(t+i-o,e),this.moveTo(t+i-o,e),this.arc(t+i-o,e+o,o,-y.TAU,0),this.lineTo(t+i,e+s-h),this.moveTo(t+i,e+s-h),this.arc(t+i-h,e+s-h,h,0,y.TAU),this.lineTo(t+a,e+s),this.moveTo(t+a,e+s),this.arc(t+a,e+s-a,a,y.TAU,Math.PI),this.lineTo(t,e+r),this.moveTo(t,e+r),this.arc(t+r,e+r,r,-Math.PI,-y.TAU),this.strokePath(),this},fillPointShape:function(t,e){return this.fillPoint(t.x,t.y,e)},fillPoint:function(t,e,i){return!i||i<1?i=1:(t-=i/2,e-=i/2),this.commandBuffer.push(r.FILL_RECT,t,e,i,i),this},fillTriangleShape:function(t){return this.fillTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},strokeTriangleShape:function(t){return this.strokeTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},fillTriangle:function(t,e,i,s,n,o){return this.commandBuffer.push(r.FILL_TRIANGLE,t,e,i,s,n,o),this},strokeTriangle:function(t,e,i,s,n,o){return this.commandBuffer.push(r.STROKE_TRIANGLE,t,e,i,s,n,o),this},strokeLineShape:function(t){return this.lineBetween(t.x1,t.y1,t.x2,t.y2)},lineBetween:function(t,e,i,s){return this.beginPath(),this.moveTo(t,e),this.lineTo(i,s),this.strokePath(),this},lineTo:function(t,e){return this.commandBuffer.push(r.LINE_TO,t,e),this},moveTo:function(t,e){return this.commandBuffer.push(r.MOVE_TO,t,e),this},strokePoints:function(t,e,i,s){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===s&&(s=t.length),this.beginPath(),this.moveTo(t[0].x,t[0].y);for(var n=1;n-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(t,e,i){var s,n,r=this.scene.sys,o=r.game.renderer;if(void 0===e&&(e=r.scale.width),void 0===i&&(i=r.scale.height),T.TargetCamera.setScene(this.scene),T.TargetCamera.setViewport(0,0,e,i),T.TargetCamera.scrollX=this.x,T.TargetCamera.scrollY=this.y,"string"==typeof t)if(r.textures.exists(t)){var a=(s=r.textures.get(t)).getSourceImage();a instanceof HTMLCanvasElement&&(n=a.getContext("2d"))}else n=(s=r.textures.createCanvas(t,e,i)).getSourceImage().getContext("2d");else t instanceof HTMLCanvasElement&&(n=t.getContext("2d"));return n&&(this.renderCanvas(o,this,T.TargetCamera,null,n,!1),s&&s.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});T.TargetCamera=new s,t.exports=T},91543:(t,e,i)=>{var s=i(36266),n=i(49584);t.exports=function(t,e,i,r,o,a){var h=e.commandBuffer,l=h.length,u=o||t.currentContext;if(0!==l&&n(t,u,e,i,r)){i.addToRenderList(e);var c=1,d=1,p=0,f=0,v=1,g=0,m=0,y=0;u.beginPath();for(var x=0;x>>16,m=(65280&p)>>>8,y=255&p,u.strokeStyle="rgba("+g+","+m+","+y+","+c+")",u.lineWidth=v,x+=3;break;case s.FILL_STYLE:f=h[x+1],d=h[x+2],g=(16711680&f)>>>16,m=(65280&f)>>>8,y=255&f,u.fillStyle="rgba("+g+","+m+","+y+","+d+")",x+=2;break;case s.BEGIN_PATH:u.beginPath();break;case s.CLOSE_PATH:u.closePath();break;case s.FILL_PATH:a||u.fill();break;case s.STROKE_PATH:a||u.stroke();break;case s.FILL_RECT:a?u.rect(h[x+1],h[x+2],h[x+3],h[x+4]):u.fillRect(h[x+1],h[x+2],h[x+3],h[x+4]),x+=4;break;case s.FILL_TRIANGLE:u.beginPath(),u.moveTo(h[x+1],h[x+2]),u.lineTo(h[x+3],h[x+4]),u.lineTo(h[x+5],h[x+6]),u.closePath(),a||u.fill(),x+=6;break;case s.STROKE_TRIANGLE:u.beginPath(),u.moveTo(h[x+1],h[x+2]),u.lineTo(h[x+3],h[x+4]),u.lineTo(h[x+5],h[x+6]),u.closePath(),a||u.stroke(),x+=6;break;case s.LINE_TO:u.lineTo(h[x+1],h[x+2]),x+=2;break;case s.MOVE_TO:u.moveTo(h[x+1],h[x+2]),x+=2;break;case s.LINE_FX_TO:u.lineTo(h[x+1],h[x+2]),x+=5;break;case s.MOVE_FX_TO:u.moveTo(h[x+1],h[x+2]),x+=5;break;case s.SAVE:u.save();break;case s.RESTORE:u.restore();break;case s.TRANSLATE:u.translate(h[x+1],h[x+2]),x+=2;break;case s.SCALE:u.scale(h[x+1],h[x+2]),x+=2;break;case s.ROTATE:u.rotate(h[x+1]),x+=1;break;case s.GRADIENT_FILL_STYLE:x+=5;break;case s.GRADIENT_LINE_STYLE:x+=6}}u.restore()}}},41286:(t,e,i)=>{var s=i(99325),n=i(33182);s.register("graphics",(function(t,e){void 0===t&&(t={}),void 0!==e&&(t.add=e);var i=new n(this.scene,t);return t.add&&this.scene.sys.displayList.add(i),i}))},13122:(t,e,i)=>{var s=i(33182);i(61286).register("graphics",(function(t){return this.displayList.add(new s(this.scene,t))}))},60898:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(34429),n=i(91543),n=i(91543),t.exports={renderWebGL:s,renderCanvas:n}},34429:(t,e,i)=>{var s=i(36266),n=i(73329),r=i(69360),o=i(75512),a=function(t,e,i){this.x=t,this.y=e,this.width=i},h=function(t,e,i){this.points=[],this.pointsLength=1,this.points[0]=new a(t,e,i)},l=[],u=new r;t.exports=function(t,e,i,r){if(0!==e.commandBuffer.length){i.addToRenderList(e);var c=t.pipelines.set(e.pipeline,e);t.pipelines.preBatch(e);for(var d=n(e,i,r).calc,p=u.loadIdentity(),f=e.commandBuffer,v=i.alpha*e.alpha,g=1,m=c.fillTint,y=c.strokeTint,x=0,T=0,w=0,b=2*Math.PI,E=[],S=0,A=!0,_=null,C=o.getTintAppendFloatAlpha,M=0;M0&&(X=X%b-b):X>b?X=b:X<0&&(X=b+X%b),null===_&&(_=new h(B+Math.cos(U)*Y,N+Math.sin(U)*Y,g),E.push(_),I+=.01);I<1+G;)w=X*I+U,x=B+Math.cos(w)*Y,T=N+Math.sin(w)*Y,_.points.push(new a(x,T,g)),I+=.01;w=X+U,x=B+Math.cos(w)*Y,T=N+Math.sin(w)*Y,_.points.push(new a(x,T,g));break;case s.FILL_RECT:c.batchFillRect(f[++M],f[++M],f[++M],f[++M],p,d);break;case s.FILL_TRIANGLE:c.batchFillTriangle(f[++M],f[++M],f[++M],f[++M],f[++M],f[++M],p,d);break;case s.STROKE_TRIANGLE:c.batchStrokeTriangle(f[++M],f[++M],f[++M],f[++M],f[++M],f[++M],g,p,d);break;case s.LINE_TO:null!==_?_.points.push(new a(f[++M],f[++M],g)):(_=new h(f[++M],f[++M],g),E.push(_));break;case s.MOVE_TO:_=new h(f[++M],f[++M],g),E.push(_);break;case s.SAVE:l.push(p.copyToArray());break;case s.RESTORE:p.copyFromArray(l.pop());break;case s.TRANSLATE:B=f[++M],N=f[++M],p.translate(B,N);break;case s.SCALE:B=f[++M],N=f[++M],p.scale(B,N);break;case s.ROTATE:p.rotate(f[++M])}t.pipelines.postBatch(e)}}},59192:(t,e,i)=>{var s=i(83979),n=i(56694),r=i(56631),o=i(6659),a=i(71608),h=i(72632),l=i(10850),u=i(42911),c=i(75757),d=i(58403),p=i(13747),f=new n({Extends:o,initialize:function(t,e,i){o.call(this),i?e&&!Array.isArray(e)&&(e=[e]):Array.isArray(e)?u(e[0])&&(i=e,e=null):u(e)&&(i=e,e=null),this.scene=t,this.children=new d,this.isParent=!0,this.type="Group",this.classType=h(i,"classType",p),this.name=h(i,"name",""),this.active=h(i,"active",!0),this.maxSize=h(i,"maxSize",-1),this.defaultKey=h(i,"defaultKey",null),this.defaultFrame=h(i,"defaultFrame",null),this.runChildUpdate=h(i,"runChildUpdate",!1),this.createCallback=h(i,"createCallback",null),this.removeCallback=h(i,"removeCallback",null),this.createMultipleCallback=h(i,"createMultipleCallback",null),this.internalCreateCallback=h(i,"internalCreateCallback",null),this.internalRemoveCallback=h(i,"internalRemoveCallback",null),e&&this.addMultiple(e),i&&this.createMultiple(i),this.on(r.ADDED_TO_SCENE,this.addedToScene,this),this.on(r.REMOVED_FROM_SCENE,this.removedFromScene,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},create:function(t,e,i,s,n,r){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.defaultKey),void 0===s&&(s=this.defaultFrame),void 0===n&&(n=!0),void 0===r&&(r=!0),this.isFull())return null;var o=new this.classType(this.scene,t,e,i,s);return o.addToDisplayList(this.scene.sys.displayList),o.addToUpdateList(),o.visible=n,o.setActive(r),this.add(o),o},createMultiple:function(t){if(this.isFull())return[];Array.isArray(t)||(t=[t]);var e=[];if(t[0].key)for(var i=0;i=0;u--)if((l=d[u]).active===i){if(++c===e)break}else l=null;return l?("number"==typeof n&&(l.x=n),"number"==typeof r&&(l.y=r),l):s?this.create(n,r,o,a,h):null},get:function(t,e,i,s,n){return this.getFirst(!1,!0,t,e,i,s,n)},getFirstAlive:function(t,e,i,s,n,r){return this.getFirst(!0,t,e,i,s,n,r)},getFirstDead:function(t,e,i,s,n,r){return this.getFirst(!1,t,e,i,s,n,r)},playAnimation:function(t,e){return s.PlayAnimation(this.children.entries,t,e),this},isFull:function(){return-1!==this.maxSize&&this.children.size>=this.maxSize},countActive:function(t){void 0===t&&(t=!0);for(var e=0,i=0;i{var s=i(99325),n=i(59192);s.register("group",(function(t){return new n(this.scene,null,t)}))},62598:(t,e,i)=>{var s=i(59192);i(61286).register("group",(function(t,e){return this.updateList.add(new s(this.scene,t,e))}))},1539:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(89980),o=i(57322),a=new s({Extends:r,Mixins:[n.Alpha,n.BlendMode,n.Depth,n.Flip,n.FX,n.GetBounds,n.Mask,n.Origin,n.Pipeline,n.ScrollFactor,n.Size,n.TextureCrop,n.Tint,n.Transform,n.Visible,o],initialize:function(t,e,i,s,n){r.call(this,t,"Image"),this._crop=this.resetCropObject(),this.setTexture(s,n),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline()}});t.exports=a},57786:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),t.batchSprite(e,e.frame,i,s)}},83556:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(1539);n.register("image",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"frame",null),a=new o(this.scene,0,0,i,n);return void 0!==e&&(t.add=e),s(this.scene,a,t),a}))},20927:(t,e,i)=>{var s=i(1539);i(61286).register("image",(function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))}))},57322:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(59390),n=i(57786),t.exports={renderWebGL:s,renderCanvas:n}},59390:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),this.pipeline.batchSprite(e,i,s)}},48013:(t,e,i)=>{var s={Events:i(56631),DisplayList:i(91713),GameObjectCreator:i(99325),GameObjectFactory:i(61286),UpdateList:i(92034),Components:i(64937),GetCalcMatrix:i(73329),BuildGameObject:i(88933),BuildGameObjectAnimation:i(32291),GameObject:i(89980),BitmapText:i(44616),Blitter:i(52816),Bob:i(41664),Container:i(70339),DOMElement:i(38943),DynamicBitmapText:i(13468),Extern:i(39419),Graphics:i(33182),Group:i(59192),Image:i(1539),Layer:i(85305),Particles:i(27684),PathFollower:i(29598),RenderTexture:i(15996),RetroFont:i(55873),Rope:i(79968),Sprite:i(13747),Text:i(76555),GetTextSize:i(32979),MeasureText:i(27030),TextStyle:i(74744),TileSprite:i(35856),Zone:i(71030),Video:i(8630),Shape:i(91461),Arc:i(28593),Curve:i(15220),Ellipse:i(28591),Grid:i(39169),IsoBox:i(4415),IsoTriangle:i(65159),Line:i(579),Polygon:i(91249),Rectangle:i(517),Star:i(77843),Triangle:i(21873),Factories:{Blitter:i(38906),Container:i(23400),DOMElement:i(66788),DynamicBitmapText:i(94145),Extern:i(41155),Graphics:i(13122),Group:i(62598),Image:i(20927),Layer:i(17676),Particles:i(30439),PathFollower:i(19626),RenderTexture:i(29599),Rope:i(31982),Sprite:i(66135),StaticBitmapText:i(21797),Text:i(94627),TileSprite:i(20509),Zone:i(34546),Video:i(215),Arc:i(10369),Curve:i(10147),Ellipse:i(99869),Grid:i(9326),IsoBox:i(88154),IsoTriangle:i(67765),Line:i(85665),Polygon:i(88203),Rectangle:i(94355),Star:i(23962),Triangle:i(79296)},Creators:{Blitter:i(68452),Container:i(44516),DynamicBitmapText:i(67513),Graphics:i(41286),Group:i(61295),Image:i(83556),Layer:i(56378),Particles:i(38842),RenderTexture:i(85692),Rope:i(96027),Sprite:i(89219),StaticBitmapText:i(95499),Text:i(75397),TileSprite:i(63950),Zone:i(24067),Video:i(65601)}};s.Shader=i(27902),s.Mesh=i(83321),s.PointLight=i(13171),s.Factories.Shader=i(51979),s.Factories.Mesh=i(8767),s.Factories.PointLight=i(91201),s.Creators.Shader=i(13908),s.Creators.Mesh=i(41839),s.Creators.PointLight=i(162),s.Light=i(14455),s.LightsManager=i(26193),s.LightsPlugin=i(50296),t.exports=s},85305:(t,e,i)=>{var s=i(95723),n=i(56694),r=i(64937),o=i(48129),a=i(81078),h=i(6659),l=i(56631),u=i(71207),c=i(58010),d=i(7599),p=i(17922),f=new n({Extends:u,Mixins:[r.AlphaSingle,r.BlendMode,r.Depth,r.Mask,r.Pipeline,r.Visible,h,c],initialize:function(t,e){u.call(this,t),h.call(this),this.scene=t,this.displayList=null,this.type="Layer",this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.systems=t.sys,this.events=t.sys.events,this.sortChildrenFlag=!1,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.initPipeline(),this.clearAlpha(),this.setBlendMode(s.SKIP_CHECK),e&&this.add(e),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new a(this)),this},setData:function(t,e){return this.data||(this.data=new a(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new a(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new a(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new a(this)),this.data.get(t)},setInteractive:function(){return this},disableInteractive:function(){return this},removeInteractive:function(){return this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return o(this)},willRender:function(t){return!(15!==this.renderFlags||0===this.list.length||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return i.unshift(this.displayList.getIndex(t)),i},addChildCallback:function(t){t.displayList&&t.displayList!==this&&t.removeFromDisplayList(),t.displayList||(this.queueDepthSort(),t.displayList=this,t.emit(l.ADDED_TO_SCENE,t,this.scene),this.events.emit(d.ADDED_TO_SCENE,t,this.scene))},removeChildCallback:function(t){this.queueDepthSort(),t.displayList=null,t.emit(l.REMOVED_FROM_SCENE,t,this.scene),this.events.emit(d.REMOVED_FROM_SCENE,t,this.scene)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(p(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},getChildren:function(){return this.list},addToDisplayList:function(t){return void 0===t&&(t=this.scene.sys.displayList),this.displayList&&this.displayList!==t&&this.removeFromDisplayList(),t.exists(this)||(this.displayList=t,t.add(this,!0),t.queueDepthSort(),this.emit(l.ADDED_TO_SCENE,this,this.scene),t.events.emit(d.ADDED_TO_SCENE,this,this.scene)),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(l.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(d.REMOVED_FROM_SCENE,this,this.scene)),this},destroy:function(){if(this.scene&&!this.ignoreDestroy){this.emit(l.DESTROY,this);for(var t=this.list.length;t--;)this.list[t].destroy();this.removeAllListeners(),this.resetPostPipeline(!0),this.displayList&&(this.displayList.remove(this,!0),this.displayList.queueDepthSort()),this.data&&(this.data.destroy(),this.data=void 0),this.active=!1,this.visible=!1,this.list=void 0,this.scene=void 0,this.displayList=void 0,this.systems=void 0,this.events=void 0}}});t.exports=f},834:t=>{t.exports=function(t,e,i){var s=e.list;if(0!==s.length){e.depthSort();var n=-1!==e.blendMode;n||t.setBlendMode(0);var r=e._alpha;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var o=0;o{var s=i(88933),n=i(85305),r=i(99325),o=i(20494);r.register("layer",(function(t,e){void 0===t&&(t={});var i=o(t,"children",null),r=new n(this.scene,i);return void 0!==e&&(t.add=e),s(this.scene,r,t),r}))},17676:(t,e,i)=>{var s=i(85305);i(61286).register("layer",(function(t){return this.displayList.add(new s(this.scene,t))}))},58010:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(17576),n=i(834),t.exports={renderWebGL:s,renderCanvas:n}},17576:t=>{t.exports=function(t,e,i){var s=e.list,n=s.length;if(0!==n){e.depthSort(),t.pipelines.preBatch(e);var r=-1!==e.blendMode;r||t.setBlendMode(0);for(var o=e.alpha,a=0;a{var s=i(26673),n=i(56694),r=i(64937),o=i(39298),a=i(75512),h=new n({Extends:s,Mixins:[r.ScrollFactor,r.Visible],initialize:function(t,e,i,n,r,a,h){s.call(this,t,e,i),this.color=new o(n,r,a),this.intensity=h,this.renderFlags=15,this.cameraFilter=0,this.setScrollFactor(1,1)},willRender:function(t){return!(h.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},setColor:function(t){var e=a.getFloatsFromUintRGB(t);return this.color.set(e[0],e[1],e[2]),this},setIntensity:function(t){return this.intensity=t,this},setRadius:function(t){return this.radius=t,this}});h.RENDER_MASK=15,t.exports=h},26193:(t,e,i)=>{var s=i(26535),n=i(56694),r=i(53996),o=i(14455),a=i(13171),h=i(39298),l=i(72677),u=i(17922),c=i(75512),d=new n({initialize:function(){this.lights=[],this.ambientColor=new h(.1,.1,.1),this.active=!1,this.maxLights=-1,this.visibleLights=0},addPointLight:function(t,e,i,s,n,r){return this.systems.displayList.add(new a(this.scene,t,e,i,s,n,r))},enable:function(){return-1===this.maxLights&&(this.maxLights=this.systems.renderer.config.maxLights),this.active=!0,this},disable:function(){return this.active=!1,this},getLights:function(t){for(var e=this.lights,i=t.worldView,n=[],o=0;othis.maxLights&&(u(n,this.sortByDistance),n=n.slice(0,this.maxLights)),this.visibleLights=n.length,n},sortByDistance:function(t,e){return t.distance>=e.distance},setAmbientColor:function(t){var e=c.getFloatsFromUintRGB(t);return this.ambientColor.set(e[0],e[1],e[2]),this},getMaxVisibleLights:function(){return this.maxLights},getLightCount:function(){return this.lights.length},addLight:function(t,e,i,s,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=128),void 0===s&&(s=16777215),void 0===n&&(n=1);var r=c.getFloatsFromUintRGB(s),a=new o(t,e,i,r[0],r[1],r[2],n);return this.lights.push(a),a},removeLight:function(t){var e=this.lights.indexOf(t);return e>=0&&l(this.lights,e),this},shutdown:function(){this.lights.length=0},destroy:function(){this.shutdown()}});t.exports=d},50296:(t,e,i)=>{var s=i(56694),n=i(26193),r=i(91963),o=i(7599),a=new s({Extends:n,initialize:function(t){this.scene=t,this.systems=t.sys,t.sys.settings.isBooted||t.sys.events.once(o.BOOT,this.boot,this),n.call(this)},boot:function(){var t=this.systems.events;t.on(o.SHUTDOWN,this.shutdown,this),t.on(o.DESTROY,this.destroy,this)},destroy:function(){this.shutdown(),this.scene=void 0,this.systems=void 0}});r.register("LightsPlugin",a,"lights"),t.exports=a},83321:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(75606),o=i(18693),a=i(89980),h=i(67623),l=i(53267),u=i(73329),c=i(16650),d=i(23464),p=i(17922),f=i(70015),v=i(85769),g=new s({Extends:a,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Mask,n.Pipeline,n.Size,n.Texture,n.Transform,n.Visible,n.ScrollFactor,d],initialize:function(t,e,i,s,n,r,o,h,l,u,d,p){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s="__WHITE"),a.call(this,t,"Mesh"),this.faces=[],this.vertices=[],this.tintFill=!1,this.debugCallback=null,this.debugGraphic=null,this.hideCCW=!0,this.modelPosition=new f,this.modelScale=new f(1,1,1),this.modelRotation=new f,this.dirtyCache=[0,0,0,0,0,0,0,0,0,0,0,0],this.transformMatrix=new c,this.viewPosition=new f,this.viewMatrix=new c,this.projectionMatrix=new c,this.totalRendered=0,this.totalFrame=0,this.ignoreDirtyCache=!1;var v=t.sys.renderer;this.setPosition(e,i),this.setTexture(s,n),this.setSize(v.width,v.height),this.initPipeline(),this.setPerspective(v.width,v.height),r&&this.addVertices(r,o,h,l,u,d,p)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},panX:function(t){return this.viewPosition.addScale(f.LEFT,t),this.dirtyCache[10]=1,this},panY:function(t){return this.viewPosition.y+=f.DOWN.y*t,this.dirtyCache[10]=1,this},panZ:function(t){return this.viewPosition.z+=t,this.dirtyCache[10]=1,this},setPerspective:function(t,e,i,s,n){return void 0===i&&(i=45),void 0===s&&(s=.01),void 0===n&&(n=1e3),this.projectionMatrix.perspective(r(i),t/e,s,n),this.dirtyCache[10]=1,this.dirtyCache[11]=0,this},setOrtho:function(t,e,i,s){return void 0===t&&(t=this.scene.sys.renderer.getAspectRatio()),void 0===e&&(e=1),void 0===i&&(i=-1e3),void 0===s&&(s=1e3),this.projectionMatrix.ortho(-t,t,-e,e,i,s),this.dirtyCache[10]=1,this.dirtyCache[11]=1,this},clear:function(){return this.faces.forEach((function(t){t.destroy()})),this.faces=[],this.vertices=[],this},addVerticesFromObj:function(t,e,i,s,n,r,o,a,h){var u=this.scene.sys.cache.obj.get(t);return u&&l(u,this,e,i,s,n,r,o,a,h),this},sortByDepth:function(t,e){return t.depth-e.depth},depthSort:function(){return p(this.faces,this.sortByDepth),this},addVertex:function(t,e,i,s,n,r,o){var a=new v(t,e,i,s,n,r,o);return this.vertices.push(a),a},addFace:function(t,e,i){var s=new o(t,e,i);return this.faces.push(s),this.dirtyCache[9]=-1,s},addVertices:function(t,e,i,s,n,r,o){var a=h(t,e,i,s,n,r,o);return a&&(this.faces=this.faces.concat(a.faces),this.vertices=this.vertices.concat(a.vertices)),this.dirtyCache[9]=-1,this},getFaceCount:function(){return this.faces.length},getVertexCount:function(){return this.vertices.length},getFace:function(t){return this.faces[t]},getFaceAt:function(t,e,i){void 0===i&&(i=this.scene.sys.cameras.main);for(var s=u(this,i).calc,n=this.faces,r=[],o=0;o{t.exports=function(){}},41839:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(10850),a=i(83321);n.register("mesh",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"frame",null),h=o(t,"vertices",[]),l=o(t,"uvs",[]),u=o(t,"indicies",[]),c=o(t,"containsZ",!1),d=o(t,"normals",[]),p=o(t,"colors",16777215),f=o(t,"alphas",1),v=new a(this.scene,0,0,i,n,h,l,u,c,d,p,f);return void 0!==e&&(t.add=e),s(this.scene,v,t),v}))},8767:(t,e,i)=>{var s=i(83321);i(61286).register("mesh",(function(t,e,i,n,r,o,a,h,l,u,c){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a,h,l,u,c))}))},23464:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(57410),n=i(6317),t.exports={renderWebGL:s,renderCanvas:n}},57410:(t,e,i)=>{var s=i(73329);t.exports=function(t,e,i,n){var r=e.faces,o=r.length;if(0!==o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline,e),h=s(e,i,n).calc,l=a.setGameObject(e),u=a.vertexViewF32,c=a.vertexViewU32,d=a.vertexCount*a.currentShader.vertexComponentCount-1,p=e.tintFill,f=[],v=e.debugCallback,g=h.a,m=h.b,y=h.c,x=h.d,T=h.e,w=h.f,b=e.viewPosition.z,E=e.hideCCW,S=i.roundPixels,A=i.alpha*e.alpha,_=0;t.pipelines.preBatch(e);for(var C=0;C{var s=i(56694),n=i(61616),r=i(21902),o=i(72632),a=i(1071),h=new s({initialize:function(t,e,i,s){void 0===s&&(s=!1),this.propertyKey=e,this.propertyValue=i,this.defaultValue=i,this.steps=0,this.counter=0,this.start=0,this.end=0,this.ease,this.emitOnly=s,this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,this.loadConfig(t)},loadConfig:function(t,e){void 0===t&&(t={}),e&&(this.propertyKey=e),this.propertyValue=o(t,this.propertyKey,this.defaultValue),this.setMethods(),this.emitOnly&&(this.onUpdate=this.defaultUpdate)},toJSON:function(){return this.propertyValue},onChange:function(t){return this.propertyValue=t,this.setMethods()},setMethods:function(){var t=this.propertyValue,e=typeof t;if(this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,"number"===e)this.onEmit=this.staticValueEmit,this.onUpdate=this.staticValueUpdate;else if(Array.isArray(t))this.onEmit=this.randomStaticValueEmit;else if("function"===e)this.emitOnly?this.onEmit=t:this.onUpdate=t;else if("object"===e&&this.hasBoth(t,"start","end")){this.start=t.start,this.end=t.end;var i=this.has(t,"random");if(i&&(this.onEmit=this.randomRangedValueEmit),this.has(t,"steps"))this.steps=t.steps,this.counter=this.start,this.onEmit=this.steppedEmit;else{var s=this.has(t,"ease")?t.ease:"Linear";this.ease=r(s,t.easeParams),i||(this.onEmit=this.easedValueEmit),this.onUpdate=this.easeValueUpdate}}else if("object"===e&&this.hasBoth(t,"min","max"))this.start=t.min,this.end=t.max,this.onEmit=this.randomRangedValueEmit;else if("object"===e&&this.has(t,"random")){var n=t.random;Array.isArray(n)&&(this.start=n[0],this.end=n[1]),this.onEmit=this.randomRangedValueEmit}else"object"===e&&this.hasEither(t,"onEmit","onUpdate")&&(this.has(t,"onEmit")&&(this.onEmit=t.onEmit),this.has(t,"onUpdate")&&(this.onUpdate=t.onUpdate));return this},has:function(t,e){return t.hasOwnProperty(e)},hasBoth:function(t,e,i){return t.hasOwnProperty(e)&&t.hasOwnProperty(i)},hasEither:function(t,e,i){return t.hasOwnProperty(e)||t.hasOwnProperty(i)},defaultEmit:function(t,e,i){return i},defaultUpdate:function(t,e,i,s){return s},staticValueEmit:function(){return this.propertyValue},staticValueUpdate:function(){return this.propertyValue},randomStaticValueEmit:function(){var t=Math.floor(Math.random()*this.propertyValue.length);return this.propertyValue[t]},randomRangedValueEmit:function(t,e){var i=n(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i),i},steppedEmit:function(){var t=this.counter,e=this.counter+(this.end-this.start)/this.steps;return this.counter=a(e,this.start,this.end),t},easedValueEmit:function(t,e){if(t&&t.data[e]){var i=t.data[e];i.min=this.start,i.max=this.end}return this.start},easeValueUpdate:function(t,e,i){var s=t.data[e];return(s.max-s.min)*this.ease(i)+s.min}});t.exports=h},87811:(t,e,i)=>{var s=i(56694),n=i(72632),r=new s({initialize:function(t,e,i,s,r){if("object"==typeof t){var o=t;t=n(o,"x",0),e=n(o,"y",0),i=n(o,"power",0),s=n(o,"epsilon",100),r=n(o,"gravity",50)}else void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=100),void 0===r&&(r=50);this.x=t,this.y=e,this.active=!0,this._gravity=r,this._power=0,this._epsilon=0,this.power=i,this.epsilon=s},update:function(t,e){var i=this.x-t.x,s=this.y-t.y,n=i*i+s*s;if(0!==n){var r=Math.sqrt(n);n{var s=i(56694),n=i(75606),r=i(53996),o=new s({initialize:function(t){this.emitter=t,this.frame=null,this.x=0,this.y=0,this.velocityX=0,this.velocityY=0,this.accelerationX=0,this.accelerationY=0,this.maxVelocityX=1e4,this.maxVelocityY=1e4,this.bounce=0,this.scaleX=1,this.scaleY=1,this.alpha=1,this.angle=0,this.rotation=0,this.tint=16777215,this.life=1e3,this.lifeCurrent=1e3,this.delayCurrent=0,this.lifeT=0,this.data={tint:{min:16777215,max:16777215,current:16777215},alpha:{min:1,max:1},rotate:{min:0,max:0},scaleX:{min:1,max:1},scaleY:{min:1,max:1}}},isAlive:function(){return this.lifeCurrent>0},resetPosition:function(){this.x=0,this.y=0},fire:function(t,e){var i=this.emitter;if(this.frame=i.getFrame(),!this.frame)throw new Error("Particle has no texture frame");i.emitZone&&i.emitZone.getPoint(this),this.x+=void 0===t?i.x.onEmit(this,"x"):t,this.y+=void 0===e?i.y.onEmit(this,"y"):e,this.life=i.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0;var s=i.speedX.onEmit(this,"speedX"),o=i.speedY?i.speedY.onEmit(this,"speedY"):s;if(i.radial){var a=n(i.angle.onEmit(this,"angle"));this.velocityX=Math.cos(a)*Math.abs(s),this.velocityY=Math.sin(a)*Math.abs(o)}else if(i.moveTo){var h=i.moveToX.onEmit(this,"moveToX"),l=i.moveToY?i.moveToY.onEmit(this,"moveToY"):h,u=Math.atan2(l-this.y,h-this.x),c=r(this.x,this.y,h,l)/(this.life/1e3);this.velocityX=Math.cos(u)*c,this.velocityY=Math.sin(u)*c}else this.velocityX=s,this.velocityY=o;i.acceleration&&(this.accelerationX=i.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=i.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=i.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=i.maxVelocityY.onEmit(this,"maxVelocityY"),this.delayCurrent=i.delay.onEmit(this,"delay"),this.scaleX=i.scaleX.onEmit(this,"scaleX"),this.scaleY=i.scaleY?i.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=i.rotate.onEmit(this,"rotate"),this.rotation=n(this.angle),this.bounce=i.bounce.onEmit(this,"bounce"),this.alpha=i.alpha.onEmit(this,"alpha"),this.tint=i.tint.onEmit(this,"tint")},computeVelocity:function(t,e,i,s){var n=this.velocityX,r=this.velocityY,o=this.accelerationX,a=this.accelerationY,h=this.maxVelocityX,l=this.maxVelocityY;n+=t.gravityX*i,r+=t.gravityY*i,o&&(n+=o*i),a&&(r+=a*i),n>h?n=h:n<-h&&(n=-h),r>l?r=l:r<-l&&(r=-l),this.velocityX=n,this.velocityY=r;for(var u=0;ue.right&&t.collideRight&&(this.x=e.right,this.velocityX*=i),this.ye.bottom&&t.collideBottom&&(this.y=e.bottom,this.velocityY*=i)},update:function(t,e,i){if(this.delayCurrent>0)return this.delayCurrent-=t,!1;var s=this.emitter,r=1-this.lifeCurrent/this.life;return this.lifeT=r,this.computeVelocity(s,t,e,i),this.x+=this.velocityX*e,this.y+=this.velocityY*e,s.bounds&&this.checkBounds(s),s.deathZone&&s.deathZone.willKill(this)?(this.lifeCurrent=0,!0):(this.scaleX=s.scaleX.onUpdate(this,"scaleX",r,this.scaleX),s.scaleY?this.scaleY=s.scaleY.onUpdate(this,"scaleY",r,this.scaleY):this.scaleY=this.scaleX,this.angle=s.rotate.onUpdate(this,"rotate",r,this.angle),this.rotation=n(this.angle),this.alpha=s.alpha.onUpdate(this,"alpha",r,this.alpha),this.tint=s.tint.onUpdate(this,"tint",r,this.tint),this.lifeCurrent-=t,this.lifeCurrent<=0)}});t.exports=o},9216:(t,e,i)=>{var s=i(95723),n=i(56694),r=i(64937),o=i(69361),a=i(54213),h=i(93025),l=i(72632),u=i(72861),c=i(53523),d=i(19256),p=i(14909),f=i(68433),v=i(74118),g=i(17922),m=i(93736),y=i(1071),x=new n({Mixins:[r.BlendMode,r.Mask,r.ScrollFactor,r.Visible],initialize:function(t,e){this.manager=t,this.texture=t.texture,this.frames=[t.defaultFrame],this.defaultFrame=t.defaultFrame,this.configFastMap=["active","blendMode","collideBottom","collideLeft","collideRight","collideTop","deathCallback","deathCallbackScope","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxParticles","name","on","particleBringToTop","particleClass","radial","timeScale","trackVisible","visible"],this.configOpMap=["accelerationX","accelerationY","angle","alpha","bounce","delay","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],this.name="",this.particleClass=p,this.x=new h(e,"x",0,!0),this.y=new h(e,"y",0,!0),this.radial=!0,this.gravityX=0,this.gravityY=0,this.acceleration=!1,this.accelerationX=new h(e,"accelerationX",0,!0),this.accelerationY=new h(e,"accelerationY",0,!0),this.maxVelocityX=new h(e,"maxVelocityX",1e4,!0),this.maxVelocityY=new h(e,"maxVelocityY",1e4,!0),this.speedX=new h(e,"speedX",0,!0),this.speedY=new h(e,"speedY",0,!0),this.moveTo=!1,this.moveToX=new h(e,"moveToX",0,!0),this.moveToY=new h(e,"moveToY",0,!0),this.bounce=new h(e,"bounce",0,!0),this.scaleX=new h(e,"scaleX",1),this.scaleY=new h(e,"scaleY",1),this.tint=new h(e,"tint",16777215),this.alpha=new h(e,"alpha",1),this.lifespan=new h(e,"lifespan",1e3,!0),this.angle=new h(e,"angle",{min:0,max:360},!0),this.rotate=new h(e,"rotate",0),this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.maxParticles=0,this.quantity=new h(e,"quantity",1,!0),this.delay=new h(e,"delay",0,!0),this.frequency=0,this.on=!0,this.particleBringToTop=!0,this.timeScale=1,this.emitZone=null,this.deathZone=null,this.bounds=null,this.collideLeft=!0,this.collideRight=!0,this.collideTop=!0,this.collideBottom=!0,this.active=!0,this.visible=!0,this.blendMode=s.NORMAL,this.follow=null,this.followOffset=new m,this.trackVisible=!1,this.currentFrame=0,this.randomFrame=!0,this.frameQuantity=1,this.dead=[],this.alive=[],this._counter=0,this._frameCounter=0,e&&this.fromJSON(e)},fromJSON:function(t){if(!t)return this;var e=0,i="";for(e=0;e0&&this.getParticleCount()===this.maxParticles},onParticleEmit:function(t,e){return void 0===t?(this.emitCallback=null,this.emitCallbackScope=null):"function"==typeof t&&(this.emitCallback=t,e&&(this.emitCallbackScope=e)),this},onParticleDeath:function(t,e){return void 0===t?(this.deathCallback=null,this.deathCallbackScope=null):"function"==typeof t&&(this.deathCallback=t,e&&(this.deathCallbackScope=e)),this},killAll:function(){for(var t=this.dead,e=this.alive;e.length>0;)t.push(e.pop());return this},forEachAlive:function(t,e){for(var i=this.alive,s=i.length,n=0;n0){var u=this.deathCallback,c=this.deathCallbackScope;for(o=h-1;o>=0;o--){var d=a[o];n.splice(d.index,1),r.push(d.particle),u&&u.call(c,d.particle),d.particle.resetPosition()}}this.on&&(0===this.frequency?this.emitParticle():this.frequency>0&&(this._counter-=e,this._counter<=0&&(this.emitParticle(),this._counter=this.frequency-Math.abs(this._counter))))},depthSortCallback:function(t,e){return t.y-e.y}});t.exports=x},84622:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(89980),o=i(87811),a=i(71207),h=i(9216),l=i(72745),u=new s({Extends:r,Mixins:[n.Depth,n.Mask,n.Pipeline,n.Transform,n.Visible,l],initialize:function(t,e,i,s){if(r.call(this,t,"ParticleEmitterManager"),this.blendMode=-1,this.timeScale=1,this.texture=null,this.frame=null,this.frameNames=[],null===i||"object"!=typeof i&&!Array.isArray(i)||(s=i,i=null),this.setTexture(e,i),this.initPipeline(),this.emitters=new a(this),this.wells=new a(this),s){Array.isArray(s)||(s=[s]);for(var n=0;n0?e.defaultFrame=i[0]:(console.warn("No texture frames were set"),e.defaultFrame=this.defaultFrame),this},addEmitter:function(t){return this.emitters.add(t)},createEmitter:function(t){return this.addEmitter(new h(this,t))},removeEmitter:function(t){return this.emitters.remove(t,!0)},addGravityWell:function(t){return this.wells.add(t)},createGravityWell:function(t){return this.addGravityWell(new o(t))},emitParticle:function(t,e,i){for(var s=this.emitters.list,n=0;n{var s=i(69360),n=new s,r=new s,o=new s,a=new s;t.exports=function(t,e,i,s){var h=e.emitters.list,l=h.length;if(0!==l){var u=n.copyFrom(i.matrix),c=r,d=o,p=a;s?(p.loadIdentity(),p.multiply(s),p.translate(e.x,e.y),p.rotate(e.rotation),p.scale(e.scaleX,e.scaleY)):p.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);for(var f=t.currentContext,v=i.roundPixels,g=0;g{var s=i(99325),n=i(20494),r=i(72632),o=i(84622);s.register("particles",(function(t,e){void 0===t&&(t={});var i=n(t,"key",null),s=n(t,"frame",null),a=r(t,"emitters",null),h=new o(this.scene,i,s,a);return void 0!==e&&(t.add=e),r(t,"add",!1)?this.displayList.add(h):this.updateList.add(h),h}))},30439:(t,e,i)=>{var s=i(61286),n=i(84622);s.register("particles",(function(t,e,i){return this.displayList.add(new n(this.scene,t,e,i))}))},72745:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(58971),n=i(66545),t.exports={renderWebGL:s,renderCanvas:n}},58971:(t,e,i)=>{var s=i(69360),n=i(75512),r=new s,o=new s,a=new s,h=new s;t.exports=function(t,e,i,s){var l=e.emitters.list,u=l.length;if(0!==u){var c=t.pipelines.set(e.pipeline),d=r,p=o,f=a,v=h;s?(v.loadIdentity(),v.multiply(s),v.translate(e.x,e.y),v.rotate(e.rotation),v.scale(e.scaleX,e.scaleY)):v.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var g=i.roundPixels,m=e.defaultFrame.glTexture,y=n.getTintAppendFloatAlpha,x=c.setGameObject(e,e.defaultFrame);t.pipelines.preBatch(e);for(var T=0;T{t.exports={EmitterOp:i(93025),GravityWell:i(87811),Particle:i(14909),ParticleEmitter:i(9216),ParticleEmitterManager:i(84622),Zones:i(25962)}},69361:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e){this.source=t,this.killOnEnter=e},willKill:function(t){var e=this.source.contains(t.x,t.y);return e&&this.killOnEnter||!e&&!this.killOnEnter}});t.exports=s},54213:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s,n){void 0===s&&(s=!1),void 0===n&&(n=!0),this.source=t,this.points=[],this.quantity=e,this.stepRate=i,this.yoyo=s,this.counter=-1,this.seamless=n,this._length=0,this._direction=0,this.updateSource()},updateSource:function(){if(this.points=this.source.getPoints(this.quantity,this.stepRate),this.seamless){var t=this.points[0],e=this.points[this.points.length-1];t.x===e.x&&t.y===e.y&&this.points.pop()}var i=this._length;return this._length=this.points.length,this._lengththis._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=s},68433:(t,e,i)=>{var s=i(56694),n=i(93736),r=new s({initialize:function(t){this.source=t,this._tempVec=new n},getPoint:function(t){var e=this._tempVec;this.source.getRandomPoint(e),t.x=e.x,t.y=e.y}});t.exports=r},25962:(t,e,i)=>{t.exports={DeathZone:i(69361),EdgeZone:i(54213),RandomZone:i(68433)}},29598:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(13747),o=new s({Extends:r,Mixins:[n.PathFollower],initialize:function(t,e,i,s,n,o){r.call(this,t,i,s,n,o),this.path=e},preUpdate:function(t,e){this.anims.update(t,e),this.pathUpdate(t)}});t.exports=o},19626:(t,e,i)=>{var s=i(61286),n=i(29598);s.register("follower",(function(t,e,i,s,r){var o=new n(this.scene,t,e,i,s,r);return this.displayList.add(o),this.updateList.add(o),o}))},13171:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(89980),o=i(74853),a=i(65641),h=i(71606),l=new s({Extends:r,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.GetBounds,n.Mask,n.Pipeline,n.ScrollFactor,n.Transform,n.Visible,h],initialize:function(t,e,i,s,n,h,l){void 0===s&&(s=16777215),void 0===n&&(n=128),void 0===h&&(h=1),void 0===l&&(l=.1),r.call(this,t,"PointLight"),this.initPipeline(a.POINTLIGHT_PIPELINE),this.setPosition(e,i),this.color=o(s),this.intensity=h,this.attenuation=l,this.width=2*n,this.height=2*n,this._radius=n},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this.width=2*t,this.height=2*t}},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return this._radius}},displayOriginY:{get:function(){return this._radius}}});t.exports=l},162:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(13171);n.register("pointlight",(function(t,e){void 0===t&&(t={});var i=r(t,"color",16777215),n=r(t,"radius",128),a=r(t,"intensity",1),h=r(t,"attenuation",.1),l=new o(this.scene,0,0,i,n,a,h);return void 0!==e&&(t.add=e),s(this.scene,l,t),l}))},91201:(t,e,i)=>{var s=i(61286),n=i(13171);s.register("pointlight",(function(t,e,i,s,r,o){return this.displayList.add(new n(this.scene,t,e,i,s,r,o))}))},71606:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(80590),t.exports={renderWebGL:s,renderCanvas:n}},80590:(t,e,i)=>{var s=i(73329);t.exports=function(t,e,i,n){i.addToRenderList(e);var r=t.pipelines.set(e.pipeline),o=s(e,i,n).calc,a=e.width,h=e.height,l=-e._radius,u=-e._radius,c=l+a,d=u+h,p=o.getX(0,0),f=o.getY(0,0),v=o.getX(l,u),g=o.getY(l,u),m=o.getX(l,d),y=o.getY(l,d),x=o.getX(c,d),T=o.getY(c,d),w=o.getX(c,u),b=o.getY(c,u);t.pipelines.preBatch(e),r.batchPointLight(e,i,v,g,m,y,x,T,w,b,p,f),t.pipelines.postBatch(e)}},15996:(t,e,i)=>{var s=i(95723),n=i(51052),r=i(61068),o=i(56694),a=i(64937),h=i(86459),l=i(82047),u=i(89980),c=i(72283),d=i(65641),p=i(92675),f=i(37410),v=i(75512),g=i(76583),m=new o({Extends:u,Mixins:[a.Alpha,a.BlendMode,a.ComputedSize,a.Crop,a.Depth,a.Flip,a.FX,a.GetBounds,a.Mask,a.Origin,a.Pipeline,a.ScrollFactor,a.Tint,a.Transform,a.Visible,p],initialize:function(t,e,i,s,o,a,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=32),void 0===o&&(o=32),u.call(this,t,"RenderTexture"),this.renderer=t.sys.renderer,this.textureManager=t.sys.textures,this.globalTint=16777215,this.globalAlpha=1,this.canvas=null,this.dirty=!1,this._crop=this.resetCropObject(),this.texture=null,this.frame=null,this._saved=!1,void 0===a?(this.canvas=r.create2D(this,s,o),this.texture=t.sys.textures.addCanvas(g(),this.canvas),this.frame=this.texture.get()):(this.texture=t.sys.textures.get(a),this.frame=this.texture.get(l),this.canvas=this.frame.source.image,this._saved=!0,this.dirty=!0,this.width=this.frame.cutWidth,this.height=this.frame.cutHeight),this.context=this.canvas.getContext("2d"),this._eraseMode=!1,this.camera=new n(0,0,s,o),this.renderTarget=null;var p=this.renderer;p?p.type===h.WEBGL?(this.drawGameObject=this.batchGameObjectWebGL,this.renderTarget=new f(p,s,o,1,0,!1)):p.type===h.CANVAS&&(this.drawGameObject=this.batchGameObjectCanvas):this.drawGameObject=c,this.camera.setScene(t),this.setPosition(e,i),void 0===a&&this.setSize(s,o),this.setOrigin(0,0),this.initPipeline(d.SINGLE_PIPELINE)},setSize:function(t,e){return this.resize(t,e)},resize:function(t,e){void 0===e&&(e=t);var i=this.frame;if(t!==this.width||e!==this.height){if("__BASE"===i.name){this.canvas.width=t,this.canvas.height=e,this.texture.width=t,this.texture.height=e;var s=this.renderTarget;s&&(s.resize(t,e),i.glTexture=s.texture,i.source.isRenderTexture=!0,i.source.isGLTexture=!0,i.source.glTexture=s.texture),this.camera.setSize(t,e),i.source.width=t,i.source.height=e,i.setSize(t,e),this.width=t,this.height=e}}else{var n=this.texture.getSourceImage();i.cutX+t>n.width&&(t=n.width-i.cutX),i.cutY+e>n.height&&(e=n.height-i.cutY),i.setSize(t,e,i.cutX,i.cutY)}this.updateDisplayOrigin();var r=this.input;return r&&!r.customHitArea&&(r.hitArea.width=t,r.hitArea.height=e),this},setGlobalTint:function(t){return this.globalTint=t,this},setGlobalAlpha:function(t){return this.globalAlpha=t,this},saveTexture:function(t){return this.textureManager.renameTexture(this.texture.key,t),this._saved=!0,this.texture},fill:function(t,e,i,s,n,r){var o=this.frame,a=this.camera,h=this.renderer;void 0===e&&(e=1),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=o.cutWidth),void 0===r&&(r=o.cutHeight);var l=(t>>16&255)/255,u=(t>>8&255)/255,c=(255&t)/255,d=this.renderTarget;if(a.preRender(),d){d.bind(!0);var p=this.pipeline;p.manager.set(p);var f=d.width,g=d.height,m=h.width/f,y=h.height/g;p.drawFillRect(i*m,s*y,n*m,r*y,v.getTintFromFloats(c,u,l,1),e),d.unbind(!0)}else{var x=this.context;h.setContext(x),x.fillStyle="rgba("+l+","+u+","+c+","+e+")",x.fillRect(i+o.cutX,s+o.cutY,n,r),h.setContext()}return this.dirty=!0,this},clear:function(){if(this.dirty){var t=this.renderTarget;if(t)t.clear();else{var e=this.context;e.save(),e.setTransform(1,0,0,1,0,0),e.clearRect(this.frame.cutX,this.frame.cutY,this.frame.cutWidth,this.frame.cutHeight),e.restore()}this.dirty=!1}return this},erase:function(t,e,i){return this._eraseMode=!0,this.draw(t,e,i,1,16777215),this._eraseMode=!1,this},draw:function(t,e,i,s,n){return this.beginDraw(),this.batchDraw(t,e,i,s,n),this.endDraw(),this},drawFrame:function(t,e,i,s,n,r){return this.beginDraw(),this.batchDrawFrame(t,e,i,s,n,r),this.endDraw(),this},beginDraw:function(){var t=this.camera,e=this.renderer,i=this.renderTarget;return t.preRender(),i?e.beginCapture(i.width,i.height):e.setContext(this.context),this},batchDraw:function(t,e,i,s,n){return void 0===s&&(s=this.globalAlpha),n=void 0===n?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(n>>16)+(65280&n)+((255&n)<<16),Array.isArray(t)||(t=[t]),this.batchList(t,e,i,s,n),this},batchDrawFrame:function(t,e,i,s,n,r){void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=this.globalAlpha),r=void 0===r?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(r>>16)+(65280&r)+((255&r)<<16);var o=this.textureManager.getFrame(t,e);return o&&(this.renderTarget?this.pipeline.batchTextureFrame(o,i,s,r,n,this.camera.matrix,null):this.batchTextureFrame(o,i+this.frame.cutX,s+this.frame.cutY,n,r)),this},endDraw:function(t){void 0===t&&(t=this._eraseMode);var e=this.renderer,i=this.renderTarget;if(i){var s=e.endCapture();e.pipelines.setUtility().blitFrame(s,i,1,!1,!1,t),e.resetScissor(),e.resetViewport()}else e.setContext();return this.dirty=!0,this},batchList:function(t,e,i,s,n){for(var r=0;r{t.exports=function(t,e,i,s){i.addToRenderList(e),t.batchSprite(e,e.frame,i,s)}},85692:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(15996);n.register("renderTexture",(function(t,e){void 0===t&&(t={});var i=r(t,"x",0),n=r(t,"y",0),a=r(t,"width",32),h=r(t,"height",32),l=r(t,"key",void 0),u=r(t,"frame",void 0),c=new o(this.scene,i,n,a,h,l,u);return void 0!==e&&(t.add=e),s(this.scene,c,t),c}))},29599:(t,e,i)=>{var s=i(61286),n=i(15996);s.register("renderTexture",(function(t,e,i,s,r,o){return this.displayList.add(new n(this.scene,t,e,i,s,r,o))}))},92675:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(46823),n=i(43267),t.exports={renderWebGL:s,renderCanvas:n}},46823:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i,n){i.addToRenderList(e);var r=i.alpha,o=e.renderTarget,a=o.width,h=o.height,l=s.getTintAppendFloatAlpha,u=t.pipelines.set(e.pipeline),c=u.setTexture2D(o.texture);u.batchTexture(e,o.texture,a,h,e.x,e.y,a,h,e.scaleX,e.scaleY,e.rotation,e.flipX,!e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,a,h,l(e.tintTopLeft,r*e._alphaTL),l(e.tintTopRight,r*e._alphaTR),l(e.tintBottomLeft,r*e._alphaBL),l(e.tintBottomRight,r*e._alphaBR),e.tintFill,0,0,i,n,!0,c),t.resetTextures()}},79968:(t,e,i)=>{var s=i(16569),n=i(56694),r=i(64937),o=i(89980),a=i(65641),h=i(58912),l=i(93736),u=new n({Extends:o,Mixins:[r.AlphaSingle,r.BlendMode,r.Depth,r.Flip,r.Mask,r.Pipeline,r.Size,r.Texture,r.Transform,r.Visible,r.ScrollFactor,h],initialize:function(t,e,i,n,r,h,u,c,d){void 0===n&&(n="__DEFAULT"),void 0===h&&(h=2),void 0===u&&(u=!0),o.call(this,t,"Rope"),this.anims=new s(this),this.points=h,this.vertices,this.uv,this.colors,this.alphas,this.tintFill="__DEFAULT"===n,this.dirty=!1,this.horizontal=u,this._flipX=!1,this._flipY=!1,this._perp=new l,this.debugCallback=null,this.debugGraphic=null,this.setTexture(n,r),this.setPosition(e,i),this.setSizeToFrame(),this.initPipeline(a.ROPE_PIPELINE),Array.isArray(h)&&this.resizeArrays(h.length),this.setPoints(h,c,d),this.updateVertices()},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){var i=this.anims.currentFrame;this.anims.update(t,e),this.anims.currentFrame!==i&&(this.updateUVs(),this.updateVertices())},play:function(t,e,i){return this.anims.play(t,e,i),this},setDirty:function(){return this.dirty=!0,this},setHorizontal:function(t,e,i){return void 0===t&&(t=this.points.length),this.horizontal?this:(this.horizontal=!0,this.setPoints(t,e,i))},setVertical:function(t,e,i){return void 0===t&&(t=this.points.length),this.horizontal?(this.horizontal=!1,this.setPoints(t,e,i)):this},setTintFill:function(t){return void 0===t&&(t=!1),this.tintFill=t,this},setAlphas:function(t,e){var i=this.points.length;if(i<1)return this;var s,n=this.alphas;void 0===t?t=[1]:Array.isArray(t)||void 0!==e||(t=[t]);var r=0;if(void 0!==e)for(s=0;sr&&(o=t[r]),n[r]=o,t.length>r+1&&(o=t[r+1]),n[r+1]=o}return this},setColors:function(t){var e=this.points.length;if(e<1)return this;var i,s=this.colors;void 0===t?t=[16777215]:Array.isArray(t)||(t=[t]);var n=0;if(t.length===e)for(i=0;in&&(r=t[n]),s[n]=r,t.length>n+1&&(r=t[n+1]),s[n+1]=r}return this},setPoints:function(t,e,i){if(void 0===t&&(t=2),"number"==typeof t){var s,n,r,o=t;if(o<2&&(o=2),t=[],this.horizontal)for(r=-this.frame.halfWidth,n=this.frame.width/(o-1),s=0;s{t.exports=function(){}},96027:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(10850),a=i(79968);n.register("rope",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"frame",null),h=r(t,"horizontal",!0),l=o(t,"points",void 0),u=o(t,"colors",void 0),c=o(t,"alphas",void 0),d=new a(this.scene,0,0,i,n,l,h,u,c);return void 0!==e&&(t.add=e),s(this.scene,d,t),t.add||this.updateList.add(d),d}))},31982:(t,e,i)=>{var s=i(79968);i(61286).register("rope",(function(t,e,i,n,r,o,a,h){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a,h))}))},58912:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(49489),n=i(44598),t.exports={renderWebGL:s,renderCanvas:n}},49489:(t,e,i)=>{var s=i(73329),n=i(75512);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline,e),a=s(e,i,r).calc,h=e.vertices,l=e.uv,u=e.colors,c=e.alphas,d=e.alpha,p=n.getTintAppendFloatAlpha,f=i.roundPixels,v=h.length,g=Math.floor(.5*v);o.flush(),t.pipelines.preBatch(e);var m=o.setGameObject(e),y=o.vertexViewF32,x=o.vertexViewU32,T=o.vertexCount*o.currentShader.vertexComponentCount-1,w=0,b=e.tintFill;e.dirty&&e.updateVertices();for(var E=e.debugCallback,S=[],A=0;A{var s=i(56694),n=i(64937),r=i(89980),o=i(72632),a=i(98611),h=i(22440),l=i(24252),u=i(69360),c=new s({Extends:r,Mixins:[n.ComputedSize,n.Depth,n.GetBounds,n.Mask,n.Origin,n.ScrollFactor,n.Transform,n.Visible,l],initialize:function(t,e,i,s,n,o,a,h){void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=128),void 0===o&&(o=128),r.call(this,t,"Shader"),this.blendMode=-1,this.shader;var l=t.sys.renderer;this.renderer=l,this.gl=l.gl,this.vertexData=new ArrayBuffer(2*Float32Array.BYTES_PER_ELEMENT*6),this.vertexBuffer=l.createVertexBuffer(this.vertexData.byteLength,this.gl.STREAM_DRAW),this.program=null,this.bytes=new Uint8Array(this.vertexData),this.vertexViewF32=new Float32Array(this.vertexData),this._tempMatrix1=new u,this._tempMatrix2=new u,this._tempMatrix3=new u,this.viewMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.projectionMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.uniforms={},this.pointer=null,this._rendererWidth=l.width,this._rendererHeight=l.height,this._textureCount=0,this.framebuffer=null,this.glTexture=null,this.renderToTexture=!1,this.texture=null,this.setPosition(i,s),this.setSize(n,o),this.setOrigin(.5,.5),this.setShader(e,a,h)},willRender:function(t){return!!this.renderToTexture||!(r.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},setRenderToTexture:function(t,e){if(void 0===e&&(e=!1),!this.renderToTexture){var i=this.width,s=this.height,n=this.renderer;this.glTexture=n.createTextureFromSource(null,i,s,0),this.glTexture.flipY=e,this.framebuffer=n.createFramebuffer(i,s,this.glTexture,!1),this._rendererWidth=i,this._rendererHeight=s,this.renderToTexture=!0,this.projOrtho(0,this.width,this.height,0),t&&(this.texture=this.scene.sys.textures.addGLTexture(t,this.glTexture,i,s))}return this.shader&&(n.pipelines.clear(),this.load(),this.flush(),n.pipelines.rebind()),this},setShader:function(t,e,i){if(void 0===e&&(e=[]),"string"==typeof t){var s=this.scene.sys.cache.shader;if(!s.has(t))return console.warn("Shader missing: "+t),this;this.shader=s.get(t)}else this.shader=t;var n=this.gl,r=this.renderer;this.program&&n.deleteProgram(this.program);var o=r.createProgram(this.shader.vertexSrc,this.shader.fragmentSrc);n.uniformMatrix4fv(n.getUniformLocation(o,"uViewMatrix"),!1,this.viewMatrix),n.uniformMatrix4fv(n.getUniformLocation(o,"uProjectionMatrix"),!1,this.projectionMatrix),n.uniform2f(n.getUniformLocation(o,"uResolution"),this.width,this.height),this.program=o;var h=new Date,l={resolution:{type:"2f",value:{x:this.width,y:this.height}},time:{type:"1f",value:0},mouse:{type:"2f",value:{x:this.width/2,y:this.height/2}},date:{type:"4fv",value:[h.getFullYear(),h.getMonth(),h.getDate(),60*h.getHours()*60+60*h.getMinutes()+h.getSeconds()]},sampleRate:{type:"1f",value:44100},iChannel0:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel1:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel2:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel3:{type:"sampler2D",value:null,textureData:{repeat:!0}}};this.shader.uniforms?this.uniforms=a(!0,{},this.shader.uniforms,l):this.uniforms=l;for(var u=0;u<4;u++)e[u]&&this.setSampler2D("iChannel"+u,e[u],u,i);return this.initUniforms(),this.projOrtho(0,this._rendererWidth,this._rendererHeight,0),this},setPointer:function(t){return this.pointer=t,this},projOrtho:function(t,e,i,s){var n=1/(t-e),r=1/(i-s),o=this.projectionMatrix;o[0]=-2*n,o[5]=-2*r,o[10]=-.001,o[12]=(t+e)*n,o[13]=(s+i)*r,o[14]=-0;var a=this.program,h=this.gl;this.renderer.setProgram(a),h.uniformMatrix4fv(h.getUniformLocation(a,"uProjectionMatrix"),!1,this.projectionMatrix),this._rendererWidth=e,this._rendererHeight=i},initUniforms:function(){var t=this.gl,e=this.renderer.glFuncMap,i=this.program;for(var s in this._textureCount=0,this.uniforms){var n=this.uniforms[s],r=n.type,o=e[r];n.uniformLocation=t.getUniformLocation(i,s),"sampler2D"!==r&&(n.glMatrix=o.matrix,n.glValueLength=o.length,n.glFunc=o.func)}},setSampler2DBuffer:function(t,e,i,s,n,r){void 0===n&&(n=0),void 0===r&&(r={});var o=this.uniforms[t];return o.value=e,r.width=i,r.height=s,o.textureData=r,this._textureCount=n,this.initSampler2D(o),this},setSampler2D:function(t,e,i,s){void 0===i&&(i=0);var n=this.scene.sys.textures;if(n.exists(e)){var r=n.getFrame(e);if(r.glTexture&&r.glTexture.isRenderTexture)return this.setSampler2DBuffer(t,r.glTexture,r.width,r.height,i,s);var o=this.uniforms[t],a=r.source;o.textureKey=e,o.source=a.image,o.value=r.glTexture,a.isGLTexture&&(s||(s={}),s.width=a.width,s.height=a.height),s&&(o.textureData=s),this._textureCount=i,this.initSampler2D(o)}return this},setUniform:function(t,e){return h(this.uniforms,t,e),this},getUniform:function(t){return o(this.uniforms,t,null)},setChannel0:function(t,e){return this.setSampler2D("iChannel0",t,0,e)},setChannel1:function(t,e){return this.setSampler2D("iChannel1",t,1,e)},setChannel2:function(t,e){return this.setSampler2D("iChannel2",t,2,e)},setChannel3:function(t,e){return this.setSampler2D("iChannel3",t,3,e)},initSampler2D:function(t){if(t.value){var e=this.gl;e.activeTexture(e.TEXTURE0+this._textureCount),e.bindTexture(e.TEXTURE_2D,t.value);var i=t.textureData;if(i&&!t.value.isRenderTexture){var s=e[o(i,"magFilter","linear").toUpperCase()],n=e[o(i,"minFilter","linear").toUpperCase()],r=e[o(i,"wrapS","repeat").toUpperCase()],a=e[o(i,"wrapT","repeat").toUpperCase()],h=e[o(i,"format","rgba").toUpperCase()];if(i.repeat&&(r=e.REPEAT,a=e.REPEAT),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!!i.flipY),i.width){var l=o(i,"width",512),u=o(i,"height",2),c=o(i,"border",0);e.texImage2D(e.TEXTURE_2D,0,h,l,u,c,h,e.UNSIGNED_BYTE,null)}else e.texImage2D(e.TEXTURE_2D,0,h,e.RGBA,e.UNSIGNED_BYTE,t.source);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,s),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,n),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,a)}this.renderer.setProgram(this.program),e.uniform1i(t.uniformLocation,this._textureCount),this._textureCount++}},syncUniforms:function(){var t,e,i,s,n,r=this.gl,o=this.uniforms,a=0;for(var h in o)i=(t=o[h]).glFunc,e=t.glValueLength,s=t.uniformLocation,null!==(n=t.value)&&(1===e?t.glMatrix?i.call(r,s,t.transpose,n):i.call(r,s,n):2===e?i.call(r,s,n.x,n.y):3===e?i.call(r,s,n.x,n.y,n.z):4===e?i.call(r,s,n.x,n.y,n.z,n.w):"sampler2D"===t.type&&(r.activeTexture(r.TEXTURE0+a),r.bindTexture(r.TEXTURE_2D,n),r.uniform1i(s,a),a++))},load:function(t){var e=this.gl,i=this.width,s=this.height,n=this.renderer,r=this.program,o=this.viewMatrix;if(!this.renderToTexture){var a=-this._displayOriginX,h=-this._displayOriginY;o[0]=t[0],o[1]=t[1],o[4]=t[2],o[5]=t[3],o[8]=t[4],o[9]=t[5],o[12]=o[0]*a+o[4]*h,o[13]=o[1]*a+o[5]*h}e.useProgram(r),e.uniformMatrix4fv(e.getUniformLocation(r,"uViewMatrix"),!1,o),e.uniform2f(e.getUniformLocation(r,"uResolution"),this.width,this.height);var l=this.uniforms,u=l.resolution;u.value.x=i,u.value.y=s,l.time.value=n.game.loop.getDuration();var c=this.pointer;if(c){var d=l.mouse,p=c.x/i,f=1-c.y/s;d.value.x=p.toFixed(2),d.value.y=f.toFixed(2)}this.syncUniforms()},flush:function(){var t=this.width,e=this.height,i=this.program,s=this.gl,n=this.vertexBuffer,r=this.renderer,o=2*Float32Array.BYTES_PER_ELEMENT;this.renderToTexture&&(r.setFramebuffer(this.framebuffer),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT)),s.bindBuffer(s.ARRAY_BUFFER,n);var a=s.getAttribLocation(i,"inPosition");-1!==a&&(s.enableVertexAttribArray(a),s.vertexAttribPointer(a,2,s.FLOAT,!1,o,0));var h=this.vertexViewF32;h[3]=e,h[4]=t,h[5]=e,h[8]=t,h[9]=e,h[10]=t;s.bufferSubData(s.ARRAY_BUFFER,0,this.bytes.subarray(0,6*o)),s.drawArrays(s.TRIANGLES,0,6),this.renderToTexture&&r.setFramebuffer(null,!1)},setAlpha:function(){},setBlendMode:function(){},preDestroy:function(){var t=this.gl;t.deleteProgram(this.program),t.deleteBuffer(this.vertexBuffer),this.renderToTexture&&(this.renderer.deleteFramebuffer(this.framebuffer),this.texture.destroy(),this.framebuffer=null,this.glTexture=null,this.texture=null)}});t.exports=c},10612:t=>{t.exports=function(){}},13908:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(27902);n.register("shader",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"x",0),a=r(t,"y",0),h=r(t,"width",128),l=r(t,"height",128),u=new o(this.scene,i,n,a,h,l);return void 0!==e&&(t.add=e),s(this.scene,u,t),u}))},51979:(t,e,i)=>{var s=i(27902);i(61286).register("shader",(function(t,e,i,n,r,o,a){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a))}))},24252:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(19782),n=i(10612),t.exports={renderWebGL:s,renderCanvas:n}},19782:(t,e,i)=>{var s=i(73329);t.exports=function(t,e,i,n){if(e.shader){if(i.addToRenderList(e),t.pipelines.clear(),e.renderToTexture)e.load(),e.flush();else{var r=s(e,i,n).calc;t.width===e._rendererWidth&&t.height===e._rendererHeight||e.projOrtho(0,t.width,t.height,0),e.load(r.matrix),e.flush()}t.pipelines.rebind()}}},19543:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i,n,r,o){for(var a=s.getTintAppendFloatAlpha(i.fillColor,i.fillAlpha*n),h=i.pathData,l=i.pathIndexes,u=0;u{t.exports=function(t,e,i,s){var n=i||e.fillColor,r=s||e.fillAlpha,o=(16711680&n)>>>16,a=(65280&n)>>>8,h=255&n;t.fillStyle="rgba("+o+","+a+","+h+","+r+")"}},17876:t=>{t.exports=function(t,e,i,s){var n=i||e.strokeColor,r=s||e.strokeAlpha,o=(16711680&n)>>>16,a=(65280&n)>>>8,h=255&n;t.strokeStyle="rgba("+o+","+a+","+h+","+r+")",t.lineWidth=e.lineWidth}},91461:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(89980),o=i(88829),a=new s({Extends:r,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.GetBounds,n.Mask,n.Origin,n.Pipeline,n.ScrollFactor,n.Transform,n.Visible],initialize:function(t,e,i){void 0===e&&(e="Shape"),r.call(this,t,e),this.geom=i,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new o,this.width=0,this.height=0,this.initPipeline()},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.isFilled=!1:(this.fillColor=t,this.fillAlpha=e,this.isFilled=!0),this},setStrokeStyle:function(t,e,i){return void 0===i&&(i=1),void 0===t?this.isStroked=!1:(this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this.isStroked=!0),this},setClosePath:function(t){return this.closePath=t,this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}}});t.exports=a},50262:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i,n,r){var o=t.strokeTint,a=s.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*i);o.TL=a,o.TR=a,o.BL=a,o.BR=a;var h=e.pathData,l=h.length-1,u=e.lineWidth,c=u/2,d=h[0]-n,p=h[1]-r;e.closePath||(l-=2);for(var f=2;f{var s=i(2213),n=i(56694),r=i(75606),o=i(11117),a=i(26673),h=i(83392),l=i(91461),u=new n({Extends:l,Mixins:[s],initialize:function(t,e,i,s,n,r,o,h,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===n&&(n=0),void 0===r&&(r=360),void 0===o&&(o=!1),l.call(this,t,"Arc",new a(0,0,s)),this._startAngle=n,this._endAngle=r,this._anticlockwise=o,this._iterations=.01,this.setPosition(e,i);var c=2*this.geom.radius;this.setSize(c,c),void 0!==h&&this.setFillStyle(h,u),this.updateDisplayOrigin(),this.updateData()},iterations:{get:function(){return this._iterations},set:function(t){this._iterations=t,this.updateData()}},radius:{get:function(){return this.geom.radius},set:function(t){this.geom.radius=t;var e=2*t;this.setSize(e,e),this.updateDisplayOrigin(),this.updateData()}},startAngle:{get:function(){return this._startAngle},set:function(t){this._startAngle=t,this.updateData()}},endAngle:{get:function(){return this._endAngle},set:function(t){this._endAngle=t,this.updateData()}},anticlockwise:{get:function(){return this._anticlockwise},set:function(t){this._anticlockwise=t,this.updateData()}},setRadius:function(t){return this.radius=t,this},setIterations:function(t){return void 0===t&&(t=.01),this.iterations=t,this},setStartAngle:function(t,e){return this._startAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},setEndAngle:function(t,e){return this._endAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},updateData:function(){var t=this._iterations,e=t,i=this.geom.radius,s=r(this._startAngle),n=r(this._endAngle),a=i,l=i;n-=s,this._anticlockwise?n<-h.PI2?n=-h.PI2:n>0&&(n=-h.PI2+n%h.PI2):n>h.PI2?n=h.PI2:n<0&&(n=h.PI2+n%h.PI2);for(var u,c=[a+Math.cos(s)*i,l+Math.sin(s)*i];e<1;)u=n*e+s,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),e+=t;return u=n+s,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),c.push(a+Math.cos(s)*i,l+Math.sin(s)*i),this.pathIndexes=o(c),this.pathData=c,this}});t.exports=u},23560:(t,e,i)=>{var s=i(75606),n=i(15608),r=i(17876),o=i(49584);t.exports=function(t,e,i,a){i.addToRenderList(e);var h=t.currentContext;if(o(t,h,e,i,a)){var l=e.radius;h.beginPath(),h.arc(l-e.originX*(2*l),l-e.originY*(2*l),l,s(e._startAngle),s(e._endAngle),e.anticlockwise),e.closePath&&h.closePath(),e.isFilled&&(n(h,e),h.fill()),e.isStroked&&(r(h,e),h.stroke()),h.restore()}}},10369:(t,e,i)=>{var s=i(28593),n=i(61286);n.register("arc",(function(t,e,i,n,r,o,a,h){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a,h))})),n.register("circle",(function(t,e,i,n,r){return this.displayList.add(new s(this.scene,t,e,i,0,360,!1,n,r))}))},2213:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(58356),n=i(23560),t.exports={renderWebGL:s,renderCanvas:n}},58356:(t,e,i)=>{var s=i(73329),n=i(19543),r=i(50262);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=s(e,i,o),l=a.calcMatrix.copyFrom(h.calc),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&n(a,l,e,d,u,c),e.isStroked&&r(a,e,d,u,c),t.pipelines.postBatch(e)}},15220:(t,e,i)=>{var s=i(56694),n=i(87203),r=i(11117),o=i(74118),a=i(91461),h=new s({Extends:a,Mixins:[n],initialize:function(t,e,i,s,n,r){void 0===e&&(e=0),void 0===i&&(i=0),a.call(this,t,"Curve",s),this._smoothness=32,this._curveBounds=new o,this.closePath=!1,this.setPosition(e,i),void 0!==n&&this.setFillStyle(n,r),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){var t=this._curveBounds,e=this._smoothness;this.geom.getBounds(t,e),this.setSize(t.width,t.height),this.updateDisplayOrigin();for(var i=[],s=this.geom.getPoints(e),n=0;n{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=e._displayOriginX+e._curveBounds.x,l=e._displayOriginY+e._curveBounds.y,u=e.pathData,c=u.length-1,d=u[0]-h,p=u[1]-l;a.beginPath(),a.moveTo(d,p),e.closePath||(c-=2);for(var f=2;f{var s=i(61286),n=i(15220);s.register("curve",(function(t,e,i,s,r){return this.displayList.add(new n(this.scene,t,e,i,s,r))}))},87203:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(82958),n=i(4024),t.exports={renderWebGL:s,renderCanvas:n}},82958:(t,e,i)=>{var s=i(19543),n=i(73329),r=i(50262);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=n(e,i,o),l=a.calcMatrix.copyFrom(h.calc),u=e._displayOriginX+e._curveBounds.x,c=e._displayOriginY+e._curveBounds.y,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&s(a,l,e,d,u,c),e.isStroked&&r(a,e,d,u,c),t.pipelines.postBatch(e)}},28591:(t,e,i)=>{var s=i(56694),n=i(11117),r=i(84171),o=i(95669),a=i(91461),h=new s({Extends:a,Mixins:[r],initialize:function(t,e,i,s,n,r,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===n&&(n=128),a.call(this,t,"Ellipse",new o(s/2,n/2,s,n)),this._smoothness=64,this.setPosition(e,i),this.width=s,this.height=n,void 0!==r&&this.setFillStyle(r,h),this.updateDisplayOrigin(),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSize:function(t,e){return this.width=t,this.height=e,this.geom.setPosition(t/2,e/2),this.geom.setSize(t,e),this.updateData()},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){for(var t=[],e=this.geom.getPoints(this._smoothness),i=0;i{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY,u=e.pathData,c=u.length-1,d=u[0]-h,p=u[1]-l;a.beginPath(),a.moveTo(d,p),e.closePath||(c-=2);for(var f=2;f{var s=i(28591);i(61286).register("ellipse",(function(t,e,i,n,r,o){return this.displayList.add(new s(this.scene,t,e,i,n,r,o))}))},84171:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(17554),n=i(55881),t.exports={renderWebGL:s,renderCanvas:n}},17554:(t,e,i)=>{var s=i(19543),n=i(73329),r=i(50262);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=n(e,i,o),l=a.calcMatrix.copyFrom(h.calc),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&s(a,l,e,d,u,c),e.isStroked&&r(a,e,d,u,c),t.pipelines.postBatch(e)}},39169:(t,e,i)=>{var s=i(56694),n=i(91461),r=i(88059),o=new s({Extends:n,Mixins:[r],initialize:function(t,e,i,s,r,o,a,h,l,u,c){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===r&&(r=128),void 0===o&&(o=32),void 0===a&&(a=32),n.call(this,t,"Grid",null),this.cellWidth=o,this.cellHeight=a,this.showCells=!0,this.outlineFillColor=0,this.outlineFillAlpha=0,this.showOutline=!0,this.showAltCells=!1,this.altFillColor,this.altFillAlpha,this.setPosition(e,i),this.setSize(s,r),this.setFillStyle(h,l),void 0!==u&&this.setOutlineStyle(u,c),this.updateDisplayOrigin()},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showCells=!1:(this.fillColor=t,this.fillAlpha=e,this.showCells=!0),this},setAltFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showAltCells=!1:(this.altFillColor=t,this.altFillAlpha=e,this.showAltCells=!0),this},setOutlineStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showOutline=!1:(this.outlineFillColor=t,this.outlineFillAlpha=e,this.showOutline=!0),this}});t.exports=o},95525:(t,e,i)=>{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=-e._displayOriginX,l=-e._displayOriginY,u=i.alpha*e.alpha,c=e.width,d=e.height,p=e.cellWidth,f=e.cellHeight,v=Math.ceil(c/p),g=Math.ceil(d/f),m=p,y=f,x=p-(v*p-c),T=f-(g*f-d),w=e.showCells,b=e.showAltCells,E=e.showOutline,S=0,A=0,_=0,C=0,M=0;if(E&&(m--,y--,x===p&&x--,T===f&&T--),w&&e.fillAlpha>0)for(s(a,e),A=0;A0)for(s(a,e,e.altFillColor,e.altFillAlpha*u),A=0;A0){for(n(a,e,e.outlineFillColor,e.outlineFillAlpha*u),S=1;S{var s=i(61286),n=i(39169);s.register("grid",(function(t,e,i,s,r,o,a,h,l,u){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a,h,l,u))}))},88059:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(50639),n=i(95525),t.exports={renderWebGL:s,renderCanvas:n}},50639:(t,e,i)=>{var s=i(73329),n=i(75512);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),a=s(e,i,r);o.calcMatrix.copyFrom(a.calc).translate(-e._displayOriginX,-e._displayOriginY);var h,l,u=i.alpha*e.alpha,c=e.width,d=e.height,p=e.cellWidth,f=e.cellHeight,v=Math.ceil(c/p),g=Math.ceil(d/f),m=p,y=f,x=p-(v*p-c),T=f-(g*f-d),w=e.showCells,b=e.showAltCells,E=e.showOutline,S=0,A=0,_=0,C=0,M=0;if(E&&(m--,y--,x===p&&x--,T===f&&T--),t.pipelines.preBatch(e),w&&e.fillAlpha>0)for(h=o.fillTint,l=n.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*u),h.TL=l,h.TR=l,h.BL=l,h.BR=l,A=0;A0)for(h=o.fillTint,l=n.getTintAppendFloatAlpha(e.altFillColor,e.altFillAlpha*u),h.TL=l,h.TR=l,h.BL=l,h.BR=l,A=0;A0){var R=o.strokeTint,P=n.getTintAppendFloatAlpha(e.outlineFillColor,e.outlineFillAlpha*u);for(R.TL=P,R.TR=P,R.BL=P,R.BR=P,S=1;S{var s=i(72296),n=i(56694),r=i(91461),o=new n({Extends:r,Mixins:[s],initialize:function(t,e,i,s,n,o,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=48),void 0===n&&(n=32),void 0===o&&(o=15658734),void 0===a&&(a=10066329),void 0===h&&(h=13421772),r.call(this,t,"IsoBox",null),this.projection=4,this.fillTop=o,this.fillLeft=a,this.fillRight=h,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isFilled=!0,this.setPosition(e,i),this.setSize(s,n),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=o},32884:(t,e,i)=>{var s=i(15608),n=i(49584);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.currentContext;if(n(t,o,e,i,r)&&e.isFilled){var a=e.width,h=e.height,l=a/2,u=a/e.projection;e.showTop&&(s(o,e,e.fillTop),o.beginPath(),o.moveTo(-l,-h),o.lineTo(0,-u-h),o.lineTo(l,-h),o.lineTo(l,-1),o.lineTo(0,u-1),o.lineTo(-l,-1),o.lineTo(-l,-h),o.fill()),e.showLeft&&(s(o,e,e.fillLeft),o.beginPath(),o.moveTo(-l,0),o.lineTo(0,u),o.lineTo(0,u-h),o.lineTo(-l,-h),o.lineTo(-l,0),o.fill()),e.showRight&&(s(o,e,e.fillRight),o.beginPath(),o.moveTo(l,0),o.lineTo(0,u),o.lineTo(0,u-h),o.lineTo(l,-h),o.lineTo(l,0),o.fill()),o.restore()}}},88154:(t,e,i)=>{var s=i(61286),n=i(4415);s.register("isobox",(function(t,e,i,s,r,o,a){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a))}))},72296:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(33101),n=i(32884),t.exports={renderWebGL:s,renderCanvas:n}},33101:(t,e,i)=>{var s=i(73329),n=i(75512);t.exports=function(t,e,i,r){i.addToRenderList(e);var o,a,h,l,u,c,d,p,f,v=t.pipelines.set(e.pipeline),g=s(e,i,r),m=v.calcMatrix.copyFrom(g.calc),y=e.width,x=e.height,T=y/2,w=y/e.projection,b=i.alpha*e.alpha;e.isFilled&&(t.pipelines.preBatch(e),e.showTop&&(o=n.getTintAppendFloatAlpha(e.fillTop,b),a=m.getX(-T,-x),h=m.getY(-T,-x),l=m.getX(0,-w-x),u=m.getY(0,-w-x),c=m.getX(T,-x),d=m.getY(T,-x),p=m.getX(0,w-x),f=m.getY(0,w-x),v.batchQuad(e,a,h,l,u,c,d,p,f,0,0,1,1,o,o,o,o,2)),e.showLeft&&(o=n.getTintAppendFloatAlpha(e.fillLeft,b),a=m.getX(-T,0),h=m.getY(-T,0),l=m.getX(0,w),u=m.getY(0,w),c=m.getX(0,w-x),d=m.getY(0,w-x),p=m.getX(-T,-x),f=m.getY(-T,-x),v.batchQuad(e,a,h,l,u,c,d,p,f,0,0,1,1,o,o,o,o,2)),e.showRight&&(o=n.getTintAppendFloatAlpha(e.fillRight,b),a=m.getX(T,0),h=m.getY(T,0),l=m.getX(0,w),u=m.getY(0,w),c=m.getX(0,w-x),d=m.getY(0,w-x),p=m.getX(T,-x),f=m.getY(T,-x),v.batchQuad(e,a,h,l,u,c,d,p,f,0,0,1,1,o,o,o,o,2)),t.pipelines.postBatch(e))}},65159:(t,e,i)=>{var s=i(56694),n=i(93387),r=i(91461),o=new s({Extends:r,Mixins:[n],initialize:function(t,e,i,s,n,o,a,h,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=48),void 0===n&&(n=32),void 0===o&&(o=!1),void 0===a&&(a=15658734),void 0===h&&(h=10066329),void 0===l&&(l=13421772),r.call(this,t,"IsoTriangle",null),this.projection=4,this.fillTop=a,this.fillLeft=h,this.fillRight=l,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isReversed=o,this.isFilled=!0,this.setPosition(e,i),this.setSize(s,n),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setReversed:function(t){return this.isReversed=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=o},9923:(t,e,i)=>{var s=i(15608),n=i(49584);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.currentContext;if(n(t,o,e,i,r)&&e.isFilled){var a=e.width,h=e.height,l=a/2,u=a/e.projection,c=e.isReversed;e.showTop&&c&&(s(o,e,e.fillTop),o.beginPath(),o.moveTo(-l,-h),o.lineTo(0,-u-h),o.lineTo(l,-h),o.lineTo(0,u-h),o.fill()),e.showLeft&&(s(o,e,e.fillLeft),o.beginPath(),c?(o.moveTo(-l,-h),o.lineTo(0,u),o.lineTo(0,u-h)):(o.moveTo(-l,0),o.lineTo(0,u),o.lineTo(0,u-h)),o.fill()),e.showRight&&(s(o,e,e.fillRight),o.beginPath(),c?(o.moveTo(l,-h),o.lineTo(0,u),o.lineTo(0,u-h)):(o.moveTo(l,0),o.lineTo(0,u),o.lineTo(0,u-h)),o.fill()),o.restore()}}},67765:(t,e,i)=>{var s=i(61286),n=i(65159);s.register("isotriangle",(function(t,e,i,s,r,o,a,h){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a,h))}))},93387:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(54946),n=i(9923),t.exports={renderWebGL:s,renderCanvas:n}},54946:(t,e,i)=>{var s=i(73329),n=i(75512);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),a=s(e,i,r),h=o.calcMatrix.copyFrom(a.calc),l=e.width,u=e.height,c=l/2,d=l/e.projection,p=e.isReversed,f=i.alpha*e.alpha;if(e.isFilled){var v,g,m,y,x,T,w;if(t.pipelines.preBatch(e),e.showTop&&p){v=n.getTintAppendFloatAlpha(e.fillTop,f),g=h.getX(-c,-u),m=h.getY(-c,-u),y=h.getX(0,-d-u),x=h.getY(0,-d-u),T=h.getX(c,-u),w=h.getY(c,-u);var b=h.getX(0,d-u),E=h.getY(0,d-u);o.batchQuad(e,g,m,y,x,T,w,b,E,0,0,1,1,v,v,v,v,2)}e.showLeft&&(v=n.getTintAppendFloatAlpha(e.fillLeft,f),p?(g=h.getX(-c,-u),m=h.getY(-c,-u),y=h.getX(0,d),x=h.getY(0,d),T=h.getX(0,d-u),w=h.getY(0,d-u)):(g=h.getX(-c,0),m=h.getY(-c,0),y=h.getX(0,d),x=h.getY(0,d),T=h.getX(0,d-u),w=h.getY(0,d-u)),o.batchTri(e,g,m,y,x,T,w,0,0,1,1,v,v,v,2)),e.showRight&&(v=n.getTintAppendFloatAlpha(e.fillRight,f),p?(g=h.getX(c,-u),m=h.getY(c,-u),y=h.getX(0,d),x=h.getY(0,d),T=h.getX(0,d-u),w=h.getY(0,d-u)):(g=h.getX(c,0),m=h.getY(c,0),y=h.getX(0,d),x=h.getY(0,d),T=h.getX(0,d-u),w=h.getY(0,d-u)),o.batchTri(e,g,m,y,x,T,w,0,0,1,1,v,v,v,2)),t.pipelines.postBatch(e)}}},579:(t,e,i)=>{var s=i(56694),n=i(91461),r=i(88829),o=i(52660),a=new s({Extends:n,Mixins:[o],initialize:function(t,e,i,s,o,a,h,l,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===o&&(o=0),void 0===a&&(a=128),void 0===h&&(h=0),n.call(this,t,"Line",new r(s,o,a,h));var c=Math.max(1,this.geom.right-this.geom.left),d=Math.max(1,this.geom.bottom-this.geom.top);this.lineWidth=1,this._startWidth=1,this._endWidth=1,this.setPosition(e,i),this.setSize(c,d),void 0!==l&&this.setStrokeStyle(1,l,u),this.updateDisplayOrigin()},setLineWidth:function(t,e){return void 0===e&&(e=t),this._startWidth=t,this._endWidth=e,this.lineWidth=t,this},setTo:function(t,e,i,s){return this.geom.setTo(t,e,i,s),this}});t.exports=a},52044:(t,e,i)=>{var s=i(17876),n=i(49584);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.currentContext;if(n(t,o,e,i,r)){var a=e._displayOriginX,h=e._displayOriginY;e.isStroked&&(s(o,e),o.beginPath(),o.moveTo(e.geom.x1-a,e.geom.y1-h),o.lineTo(e.geom.x2-a,e.geom.y2-h),o.stroke()),o.restore()}}},85665:(t,e,i)=>{var s=i(61286),n=i(579);s.register("line",(function(t,e,i,s,r,o,a,h){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a,h))}))},52660:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(46952),n=i(52044),t.exports={renderWebGL:s,renderCanvas:n}},46952:(t,e,i)=>{var s=i(73329),n=i(75512);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),a=s(e,i,r);o.calcMatrix.copyFrom(a.calc);var h=e._displayOriginX,l=e._displayOriginY,u=i.alpha*e.alpha;if(t.pipelines.preBatch(e),e.isStroked){var c=o.strokeTint,d=n.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*u);c.TL=d,c.TR=d,c.BL=d,c.BR=d;var p=e._startWidth,f=e._endWidth;o.batchLine(e.geom.x1-h,e.geom.y1-l,e.geom.x2-h,e.geom.y2-l,p,f,1,0,!1,a.sprite,a.camera)}t.pipelines.postBatch(e)}},91249:(t,e,i)=>{var s=i(70573),n=i(56694),r=i(11117),o=i(14045),a=i(8580),h=i(91461),l=i(18974),u=new n({Extends:h,Mixins:[s],initialize:function(t,e,i,s,n,r){void 0===e&&(e=0),void 0===i&&(i=0),h.call(this,t,"Polygon",new a(s));var l=o(this.geom);this.setPosition(e,i),this.setSize(l.width,l.height),void 0!==n&&this.setFillStyle(n,r),this.updateDisplayOrigin(),this.updateData()},smooth:function(t){void 0===t&&(t=1);for(var e=0;e{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY,u=e.pathData,c=u.length-1,d=u[0]-h,p=u[1]-l;a.beginPath(),a.moveTo(d,p),e.closePath||(c-=2);for(var f=2;f{var s=i(61286),n=i(91249);s.register("polygon",(function(t,e,i,s,r){return this.displayList.add(new n(this.scene,t,e,i,s,r))}))},70573:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(72841),n=i(40834),t.exports={renderWebGL:s,renderCanvas:n}},72841:(t,e,i)=>{var s=i(19543),n=i(73329),r=i(50262);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=n(e,i,o),l=a.calcMatrix.copyFrom(h.calc),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&s(a,l,e,d,u,c),e.isStroked&&r(a,e,d,u,c),t.pipelines.postBatch(e)}},517:(t,e,i)=>{var s=i(56694),n=i(74118),r=i(91461),o=i(37673),a=new s({Extends:r,Mixins:[o],initialize:function(t,e,i,s,o,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===o&&(o=128),r.call(this,t,"Rectangle",new n(0,0,s,o)),this.setPosition(e,i),this.setSize(s,o),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},setSize:function(t,e){this.width=t,this.height=e,this.geom.setSize(t,e),this.updateData(),this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),e.getLineD(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=a},4091:(t,e,i)=>{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY;e.isFilled&&(s(a,e),a.fillRect(-h,-l,e.width,e.height)),e.isStroked&&(n(a,e),a.beginPath(),a.rect(-h,-l,e.width,e.height),a.stroke()),a.restore()}}},94355:(t,e,i)=>{var s=i(61286),n=i(517);s.register("rectangle",(function(t,e,i,s,r,o){return this.displayList.add(new n(this.scene,t,e,i,s,r,o))}))},37673:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(43532),n=i(4091),t.exports={renderWebGL:s,renderCanvas:n}},43532:(t,e,i)=>{var s=i(73329),n=i(50262),r=i(75512);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=s(e,i,o);a.calcMatrix.copyFrom(h.calc);var l=e._displayOriginX,u=e._displayOriginY,c=i.alpha*e.alpha;if(t.pipelines.preBatch(e),e.isFilled){var d=a.fillTint,p=r.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*c);d.TL=p,d.TR=p,d.BL=p,d.BR=p,a.batchFillRect(-l,-u,e.width,e.height)}e.isStroked&&n(a,e,c,l,u),t.pipelines.postBatch(e)}},77843:(t,e,i)=>{var s=i(87956),n=i(56694),r=i(11117),o=i(91461),a=new n({Extends:o,Mixins:[s],initialize:function(t,e,i,s,n,r,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=5),void 0===n&&(n=32),void 0===r&&(r=64),o.call(this,t,"Star",null),this._points=s,this._innerRadius=n,this._outerRadius=r,this.setPosition(e,i),this.setSize(2*r,2*r),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},setPoints:function(t){return this._points=t,this.updateData()},setInnerRadius:function(t){return this._innerRadius=t,this.updateData()},setOuterRadius:function(t){return this._outerRadius=t,this.updateData()},points:{get:function(){return this._points},set:function(t){this._points=t,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this.updateData()}},updateData:function(){var t=[],e=this._points,i=this._innerRadius,s=this._outerRadius,n=Math.PI/2*3,o=Math.PI/e,a=s,h=s;t.push(a,h+-s);for(var l=0;l{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY,u=e.pathData,c=u.length-1,d=u[0]-h,p=u[1]-l;a.beginPath(),a.moveTo(d,p),e.closePath||(c-=2);for(var f=2;f{var s=i(77843);i(61286).register("star",(function(t,e,i,n,r,o,a){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a))}))},87956:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(12037),n=i(11401),t.exports={renderWebGL:s,renderCanvas:n}},12037:(t,e,i)=>{var s=i(19543),n=i(73329),r=i(50262);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=n(e,i,o),l=a.calcMatrix.copyFrom(h.calc),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&s(a,l,e,d,u,c),e.isStroked&&r(a,e,d,u,c),t.pipelines.postBatch(e)}},21873:(t,e,i)=>{var s=i(56694),n=i(91461),r=i(66349),o=i(70498),a=new s({Extends:n,Mixins:[o],initialize:function(t,e,i,s,o,a,h,l,u,c,d){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===o&&(o=128),void 0===a&&(a=64),void 0===h&&(h=0),void 0===l&&(l=128),void 0===u&&(u=128),n.call(this,t,"Triangle",new r(s,o,a,h,l,u));var p=this.geom.right-this.geom.left,f=this.geom.bottom-this.geom.top;this.setPosition(e,i),this.setSize(p,f),void 0!==c&&this.setFillStyle(c,d),this.updateDisplayOrigin(),this.updateData()},setTo:function(t,e,i,s,n,r){return this.geom.setTo(t,e,i,s,n,r),this.updateData()},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=a},60213:(t,e,i)=>{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY,u=e.geom.x1-h,c=e.geom.y1-l,d=e.geom.x2-h,p=e.geom.y2-l,f=e.geom.x3-h,v=e.geom.y3-l;a.beginPath(),a.moveTo(u,c),a.lineTo(d,p),a.lineTo(f,v),a.closePath(),e.isFilled&&(s(a,e),a.fill()),e.isStroked&&(n(a,e),a.stroke()),a.restore()}}},79296:(t,e,i)=>{var s=i(61286),n=i(21873);s.register("triangle",(function(t,e,i,s,r,o,a,h,l,u){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a,h,l,u))}))},70498:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(72291),n=i(60213),t.exports={renderWebGL:s,renderCanvas:n}},72291:(t,e,i)=>{var s=i(73329),n=i(50262),r=i(75512);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=s(e,i,o);a.calcMatrix.copyFrom(h.calc);var l=e._displayOriginX,u=e._displayOriginY,c=i.alpha*e.alpha;if(t.pipelines.preBatch(e),e.isFilled){var d=a.fillTint,p=r.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*c);d.TL=p,d.TR=p,d.BL=p,d.BR=p;var f=e.geom.x1-l,v=e.geom.y1-u,g=e.geom.x2-l,m=e.geom.y2-u,y=e.geom.x3-l,x=e.geom.y3-u;a.batchFillTriangle(f,v,g,m,y,x,h.sprite,h.camera)}e.isStroked&&n(a,e,c,l,u),t.pipelines.postBatch(e)}},13747:(t,e,i)=>{var s=i(16569),n=i(56694),r=i(64937),o=i(89980),a=i(20791),h=new n({Extends:o,Mixins:[r.Alpha,r.BlendMode,r.Depth,r.Flip,r.FX,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.ScrollFactor,r.Size,r.TextureCrop,r.Tint,r.Transform,r.Visible,a],initialize:function(t,e,i,n,r){o.call(this,t,"Sprite"),this._crop=this.resetCropObject(),this.anims=new s(this),this.setTexture(n,r),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline()},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){this.anims.update(t,e)},play:function(t,e){return this.anims.play(t,e)},playReverse:function(t,e){return this.anims.playReverse(t,e)},playAfterDelay:function(t,e){return this.anims.playAfterDelay(t,e)},playAfterRepeat:function(t,e){return this.anims.playAfterRepeat(t,e)},chain:function(t){return this.anims.chain(t)},stop:function(){return this.anims.stop()},stopAfterDelay:function(t){return this.anims.stopAfterDelay(t)},stopAfterRepeat:function(t){return this.anims.stopAfterRepeat(t)},stopOnFrame:function(t){return this.anims.stopOnFrame(t)},toJSON:function(){return r.ToJSON(this)},preDestroy:function(){this.anims.destroy(),this.anims=void 0}});t.exports=h},27573:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),t.batchSprite(e,e.frame,i,s)}},89219:(t,e,i)=>{var s=i(88933),n=i(32291),r=i(99325),o=i(20494),a=i(13747);r.register("sprite",(function(t,e){void 0===t&&(t={});var i=o(t,"key",null),r=o(t,"frame",null),h=new a(this.scene,0,0,i,r);return void 0!==e&&(t.add=e),s(this.scene,h,t),n(h,t),h}))},66135:(t,e,i)=>{var s=i(61286),n=i(13747);s.register("sprite",(function(t,e,i,s){var r=new n(this.scene,t,e,i,s);return this.displayList.add(r),r}))},20791:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(21034),n=i(27573),t.exports={renderWebGL:s,renderCanvas:n}},21034:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),e.pipeline.batchSprite(e,i,s)}},32979:t=>{t.exports=function(t,e,i){var s=t.canvas,n=t.context,r=t.style,o=[],a=0,h=i.length;r.maxLines>0&&r.maxLines1&&(d+=p*(h-1)),{width:a,height:d,lines:h,lineWidths:o,lineSpacing:p,lineHeight:c}}},27030:(t,e,i)=>{var s=i(61068);t.exports=function(t){var e=s.create(this),i=e.getContext("2d");t.syncFont(e,i);var n=i.measureText(t.testString);if("actualBoundingBoxAscent"in n){var r=n.actualBoundingBoxAscent,o=n.actualBoundingBoxDescent;return s.remove(e),{ascent:r,descent:o,fontSize:r+o}}var a=Math.ceil(n.width*t.baselineX),h=a,l=2*h;h=h*t.baselineY|0,e.width=a,e.height=l,i.fillStyle="#f00",i.fillRect(0,0,a,l),i.font=t._font,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(t.testString,0,h);var u={ascent:0,descent:0,fontSize:0},c=i.getImageData(0,0,a,l);if(!c)return u.ascent=h,u.descent=h+6,u.fontSize=u.ascent+u.descent,s.remove(e),u;var d,p,f=c.data,v=f.length,g=4*a,m=0,y=!1;for(d=0;dh;d--){for(p=0;p{var s=i(99584),n=i(61068),r=i(56694),o=i(64937),a=i(97081),h=i(89980),l=i(32979),u=i(10850),c=i(55638),d=i(80032),p=i(74744),f=new r({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Crop,o.Depth,o.Flip,o.FX,o.GetBounds,o.Mask,o.Origin,o.Pipeline,o.ScrollFactor,o.Tint,o.Transform,o.Visible,d],initialize:function(t,e,i,s,r){void 0===e&&(e=0),void 0===i&&(i=0),h.call(this,t,"Text"),this.renderer=t.sys.renderer,this.setPosition(e,i),this.setOrigin(0,0),this.initPipeline(),this.canvas=n.create(this),this.context=this.canvas.getContext("2d"),this.style=new p(this,r),this.autoRound=!0,this.splitRegExp=/(?:\r\n|\r|\n)/,this._text=void 0,this.padding={left:0,right:0,top:0,bottom:0},this.width=1,this.height=1,this.lineSpacing=0,this.dirty=!1,0===this.style.resolution&&(this.style.resolution=1),this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(null,this.canvas,!0),this.frame=this.texture.get(),this.frame.source.resolution=this.style.resolution,this.renderer&&this.renderer.gl&&(this.renderer.deleteTexture(this.frame.source.glTexture),this.frame.source.glTexture=null),this.initRTL(),this.setText(s),r&&r.padding&&this.setPadding(r.padding),r&&r.lineSpacing&&this.setLineSpacing(r.lineSpacing),t.sys.game.events.on(a.CONTEXT_RESTORED,this.onContextRestored,this)},initRTL:function(){this.style.rtl&&(this.canvas.dir="rtl",this.context.direction="rtl",this.canvas.style.display="none",s(this.canvas,this.scene.sys.canvas),this.originX=1)},runWordWrap:function(t){var e=this.style;if(e.wordWrapCallback){var i=e.wordWrapCallback.call(e.wordWrapCallbackScope,t,this);return Array.isArray(i)&&(i=i.join("\n")),i}return e.wordWrapWidth?e.wordWrapUseAdvanced?this.advancedWordWrap(t,this.context,this.style.wordWrapWidth):this.basicWordWrap(t,this.context,this.style.wordWrapWidth):t},advancedWordWrap:function(t,e,i){for(var s="",n=t.replace(/ +/gi," ").split(this.splitRegExp),r=n.length,o=0;ol){if(0===c){for(var v=p;v.length&&(v=v.slice(0,-1),!((f=e.measureText(v).width)<=l)););if(!v.length)throw new Error("This text's wordWrapWidth setting is less than a single character!");var g=d.substr(v.length);u[c]=g,h+=v}var m=u[c].length?c:c+1,y=u.slice(m).join(" ").replace(/[ \n]*$/gi,"");n[o+1]=y+" "+(n[o+1]||""),r=n.length;break}h+=p,l-=f}s+=h.replace(/[ \n]*$/gi,"")+"\n"}}return s=s.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(t,e,i){for(var s="",n=t.split(this.splitRegExp),r=n.length-1,o=e.measureText(" ").width,a=0;a<=r;a++){for(var h=i,l=n[a].split(" "),u=l.length-1,c=0;c<=u;c++){var d=l[c],p=e.measureText(d).width,f=p;ch&&c>0&&(s+="\n",h=i),s+=d,c0&&(d+=h.lineSpacing*v),i.rtl)c=p-c;else if("right"===i.align)c+=o-h.lineWidths[v];else if("center"===i.align)c+=(o-h.lineWidths[v])/2;else if("justify"===i.align){if(h.lineWidths[v]/h.width>=.85){var g=h.width-h.lineWidths[v],m=e.measureText(" ").width,y=a[v].trim(),x=y.split(" ");g+=(a[v].length-y.length)*m;for(var T=Math.floor(g/m),w=0;T>0;)x[w]+=" ",w=(w+1)%(x.length-1||1),--T;a[v]=x.join(" ")}}this.autoRound&&(c=Math.round(c),d=Math.round(d)),i.strokeThickness&&(this.style.syncShadow(e,i.shadowStroke),e.strokeText(a[v],c,d)),i.color&&(this.style.syncShadow(e,i.shadowFill),e.fillText(a[v],c,d))}e.restore(),this.renderer&&this.renderer.gl&&(this.frame.source.glTexture=this.renderer.canvasToTexture(t,this.frame.source.glTexture,!0),this.frame.glTexture=this.frame.source.glTexture),this.dirty=!0;var b=this.input;return b&&!b.customHitArea&&(b.hitArea.width=this.width,b.hitArea.height=this.height),this},getTextMetrics:function(){return this.style.getTextMetrics()},text:{get:function(){return this._text},set:function(t){this.setText(t)}},toJSON:function(){var t=o.ToJSON(this),e={autoRound:this.autoRound,text:this._text,style:this.style.toJSON(),padding:{left:this.padding.left,right:this.padding.right,top:this.padding.top,bottom:this.padding.bottom}};return t.data=e,t},onContextRestored:function(){this.dirty=!0},preDestroy:function(){this.style.rtl&&c(this.canvas),n.remove(this.canvas),this.texture.destroy(),this.scene.sys.game.events.off(a.CONTEXT_RESTORED,this.onContextRestored,this)}});t.exports=f},71649:t=>{t.exports=function(t,e,i,s){0!==e.width&&0!==e.height&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,s))}},75397:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(76555);n.register("text",(function(t,e){void 0===t&&(t={});var i=r(t,"text",""),n=r(t,"style",null),a=r(t,"padding",null);null!==a&&(n.padding=a);var h=new o(this.scene,0,0,i,n);return void 0!==e&&(t.add=e),s(this.scene,h,t),h.autoRound=r(t,"autoRound",!0),h.resolution=r(t,"resolution",1),h}))},94627:(t,e,i)=>{var s=i(76555);i(61286).register("text",(function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))}))},80032:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(76128),n=i(71649),t.exports={renderWebGL:s,renderCanvas:n}},74744:(t,e,i)=>{var s=i(56694),n=i(20494),r=i(10850),o=i(27030),a={fontFamily:["fontFamily","Courier"],fontSize:["fontSize","16px"],fontStyle:["fontStyle",""],backgroundColor:["backgroundColor",null],color:["color","#fff"],stroke:["stroke","#fff"],strokeThickness:["strokeThickness",0],shadowOffsetX:["shadow.offsetX",0],shadowOffsetY:["shadow.offsetY",0],shadowColor:["shadow.color","#000"],shadowBlur:["shadow.blur",0],shadowStroke:["shadow.stroke",!1],shadowFill:["shadow.fill",!1],align:["align","left"],maxLines:["maxLines",0],fixedWidth:["fixedWidth",0],fixedHeight:["fixedHeight",0],resolution:["resolution",0],rtl:["rtl",!1],testString:["testString","|MÉqgy"],baselineX:["baselineX",1.2],baselineY:["baselineY",1.4],wordWrapWidth:["wordWrap.width",null],wordWrapCallback:["wordWrap.callback",null],wordWrapCallbackScope:["wordWrap.callbackScope",null],wordWrapUseAdvanced:["wordWrap.useAdvancedWrap",!1]},h=new s({initialize:function(t,e){this.parent=t,this.fontFamily,this.fontSize,this.fontStyle,this.backgroundColor,this.color,this.stroke,this.strokeThickness,this.shadowOffsetX,this.shadowOffsetY,this.shadowColor,this.shadowBlur,this.shadowStroke,this.shadowFill,this.align,this.maxLines,this.fixedWidth,this.fixedHeight,this.resolution,this.rtl,this.testString,this.baselineX,this.baselineY,this.wordWrapWidth,this.wordWrapCallback,this.wordWrapCallbackScope,this.wordWrapUseAdvanced,this._font,this.setStyle(e,!1,!0);var i=r(e,"metrics",!1);this.metrics=i?{ascent:r(i,"ascent",0),descent:r(i,"descent",0),fontSize:r(i,"fontSize",0)}:o(this)},setStyle:function(t,e,i){for(var s in void 0===e&&(e=!0),void 0===i&&(i=!1),t&&t.hasOwnProperty("fontSize")&&"number"==typeof t.fontSize&&(t.fontSize=t.fontSize.toString()+"px"),a){var o=i?a[s][1]:this[s];this[s]="wordWrapCallback"===s||"wordWrapCallbackScope"===s?r(t,a[s][0],o):n(t,a[s][0],o)}var h=r(t,"font",null);null!==h&&this.setFont(h,!1),this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim();var l=r(t,"fill",null);return null!==l&&(this.color=l),e?this.update(!0):this.parent},syncFont:function(t,e){e.font=this._font},syncStyle:function(t,e){e.textBaseline="alphabetic",e.fillStyle=this.color,e.strokeStyle=this.stroke,e.lineWidth=this.strokeThickness,e.lineCap="round",e.lineJoin="round"},syncShadow:function(t,e){e?(t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur):(t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowColor=0,t.shadowBlur=0)},update:function(t){return t&&(this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim(),this.metrics=o(this)),this.parent.updateText()},setFont:function(t,e){void 0===e&&(e=!0);var i=t,s="",n="";if("string"!=typeof t)i=r(t,"fontFamily","Courier"),s=r(t,"fontSize","16px"),n=r(t,"fontStyle","");else{var o=t.split(" "),a=0;n=o.length>2?o[a++]:"",s=o[a++]||"16px",i=o[a++]||"Courier"}return i===this.fontFamily&&s===this.fontSize&&n===this.fontStyle||(this.fontFamily=i,this.fontSize=s,this.fontStyle=n,e&&this.update(!0)),this.parent},setFontFamily:function(t){return this.fontFamily!==t&&(this.fontFamily=t,this.update(!0)),this.parent},setFontStyle:function(t){return this.fontStyle!==t&&(this.fontStyle=t,this.update(!0)),this.parent},setFontSize:function(t){return"number"==typeof t&&(t=t.toString()+"px"),this.fontSize!==t&&(this.fontSize=t,this.update(!0)),this.parent},setTestString:function(t){return this.testString=t,this.update(!0)},setFixedSize:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(!1)},setBackgroundColor:function(t){return this.backgroundColor=t,this.update(!1)},setFill:function(t){return this.color=t,this.update(!1)},setColor:function(t){return this.color=t,this.update(!1)},setResolution:function(t){return this.resolution=t,this.update(!1)},setStroke:function(t,e){return void 0===e&&(e=this.strokeThickness),void 0===t&&0!==this.strokeThickness?(this.strokeThickness=0,this.update(!0)):this.stroke===t&&this.strokeThickness===e||(this.stroke=t,this.strokeThickness=e,this.update(!0)),this.parent},setShadow:function(t,e,i,s,n,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===s&&(s=0),void 0===n&&(n=!1),void 0===r&&(r=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=i,this.shadowBlur=s,this.shadowStroke=n,this.shadowFill=r,this.update(!1)},setShadowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)},setShadowColor:function(t){return void 0===t&&(t="#000"),this.shadowColor=t,this.update(!1)},setShadowBlur:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)},setShadowStroke:function(t){return this.shadowStroke=t,this.update(!1)},setShadowFill:function(t){return this.shadowFill=t,this.update(!1)},setWordWrapWidth:function(t,e){return void 0===e&&(e=!1),this.wordWrapWidth=t,this.wordWrapUseAdvanced=e,this.update(!1)},setWordWrapCallback:function(t,e){return void 0===e&&(e=null),this.wordWrapCallback=t,this.wordWrapCallbackScope=e,this.update(!1)},setAlign:function(t){return void 0===t&&(t="left"),this.align=t,this.update(!1)},setMaxLines:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)},getTextMetrics:function(){var t=this.metrics;return{ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}},toJSON:function(){var t={};for(var e in a)t[e]=this[e];return t.metrics=this.getTextMetrics(),t},destroy:function(){this.parent=void 0}});t.exports=h},76128:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i,n){if(0!==e.width&&0!==e.height){i.addToRenderList(e);var r=e.frame,o=r.width,a=r.height,h=s.getTintAppendFloatAlpha,l=t.pipelines.set(e.pipeline,e),u=l.setTexture2D(r.glTexture,e);l.batchTexture(e,r.glTexture,o,a,e.x,e.y,o/e.style.resolution,a/e.style.resolution,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,o,a,h(e.tintTopLeft,i.alpha*e._alphaTL),h(e.tintTopRight,i.alpha*e._alphaTR),h(e.tintBottomLeft,i.alpha*e._alphaBL),h(e.tintBottomRight,i.alpha*e._alphaBR),e.tintFill,0,0,i,n,!1,u)}}},35856:(t,e,i)=>{var s=i(61068),n=i(56694),r=i(64937),o=i(97081),a=i(89980),h=i(3504),l=i(8213),u=i(9271),c=i(93736),d=new n({Extends:a,Mixins:[r.Alpha,r.BlendMode,r.ComputedSize,r.Crop,r.Depth,r.Flip,r.FX,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.ScrollFactor,r.Tint,r.Transform,r.Visible,u],initialize:function(t,e,i,n,r,l,u){var d=t.sys.renderer;a.call(this,t,"TileSprite");var p=t.sys.textures.get(l),f=p.get(u);n&&r?(n=Math.floor(n),r=Math.floor(r)):(n=f.width,r=f.height),this._tilePosition=new c,this._tileScale=new c(1,1),this.dirty=!1,this.renderer=d,this.canvas=s.create(this,n,r),this.context=this.canvas.getContext("2d"),this.displayTexture=p,this.displayFrame=f,this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(null,this.canvas,!0),this.frame=this.texture.get(),this.potWidth=h(f.width),this.potHeight=h(f.height),this.fillCanvas=s.create2D(this,this.potWidth,this.potHeight),this.fillContext=this.fillCanvas.getContext("2d"),this.fillPattern=null,this.setPosition(e,i),this.setSize(n,r),this.setFrame(u),this.setOriginFromFrame(),this.initPipeline(),t.sys.game.events.on(o.CONTEXT_RESTORED,this.onContextRestored,this)},setTexture:function(t,e){return this.displayTexture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t){var e=this.displayTexture.get(t);return this.potWidth=h(e.width),this.potHeight=h(e.height),this.canvas.width=0,e.cutWidth&&e.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this.displayFrame=e,this.dirty=!0,this.updateTileTexture(),this},setTilePosition:function(t,e){return void 0!==t&&(this.tilePositionX=t),void 0!==e&&(this.tilePositionY=e),this},setTileScale:function(t,e){return void 0===t&&(t=this.tileScaleX),void 0===e&&(e=t),this.tileScaleX=t,this.tileScaleY=e,this},updateTileTexture:function(){if(this.dirty&&this.renderer){var t=this.displayFrame;if(t.source.isRenderTexture||t.source.isGLTexture)return console.warn("TileSprites can only use Image or Canvas based textures"),void(this.dirty=!1);var e=this.fillContext,i=this.fillCanvas,s=this.potWidth,n=this.potHeight;this.renderer&&this.renderer.gl||(s=t.cutWidth,n=t.cutHeight),e.clearRect(0,0,s,n),i.width=s,i.height=n,e.drawImage(t.source.image,t.cutX,t.cutY,t.cutWidth,t.cutHeight,0,0,s,n),this.renderer&&this.renderer.gl?this.fillPattern=this.renderer.canvasToTexture(i,this.fillPattern):this.fillPattern=e.createPattern(i,"repeat"),this.updateCanvas(),this.dirty=!1}},updateCanvas:function(){var t=this.canvas;if(t.width===this.width&&t.height===this.height||(t.width=this.width,t.height=this.height,this.frame.setSize(this.width,this.height),this.updateDisplayOrigin(),this.dirty=!0),!this.dirty||this.renderer&&this.renderer.gl)this.dirty=!1;else{var e=this.context;this.scene.sys.game.config.antialias||l.disable(e);var i=this._tileScale.x,s=this._tileScale.y,n=this._tilePosition.x,r=this._tilePosition.y;e.clearRect(0,0,this.width,this.height),e.save(),e.scale(i,s),e.translate(-n,-r),e.fillStyle=this.fillPattern,e.fillRect(n,r,this.width/i,this.height/s),e.restore(),this.dirty=!1}},onContextRestored:function(t){if(t){var e=t.gl;this.dirty=!0,this.fillPattern=null,this.fillPattern=t.createTexture2D(0,e.LINEAR,e.LINEAR,e.REPEAT,e.REPEAT,e.RGBA,this.fillCanvas,this.potWidth,this.potHeight)}},preDestroy:function(){this.renderer&&this.renderer.gl&&this.renderer.deleteTexture(this.fillPattern),s.remove(this.canvas),s.remove(this.fillCanvas),this.fillPattern=null,this.fillContext=null,this.fillCanvas=null,this.displayTexture=null,this.displayFrame=null,this.texture.destroy(),this.renderer=null,this.scene.sys.game.events.off(o.CONTEXT_RESTORED,this.onContextRestored,this)},tilePositionX:{get:function(){return this._tilePosition.x},set:function(t){this._tilePosition.x=t,this.dirty=!0}},tilePositionY:{get:function(){return this._tilePosition.y},set:function(t){this._tilePosition.y=t,this.dirty=!0}},tileScaleX:{get:function(){return this._tileScale.x},set:function(t){this._tileScale.x=t,this.dirty=!0}},tileScaleY:{get:function(){return this._tileScale.y},set:function(t){this._tileScale.y=t,this.dirty=!0}}});t.exports=d},93305:t=>{t.exports=function(t,e,i,s){e.updateCanvas(),i.addToRenderList(e),t.batchSprite(e,e.frame,i,s)}},63950:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(35856);n.register("tileSprite",(function(t,e){void 0===t&&(t={});var i=r(t,"x",0),n=r(t,"y",0),a=r(t,"width",512),h=r(t,"height",512),l=r(t,"key",""),u=r(t,"frame",""),c=new o(this.scene,i,n,a,h,l,u);return void 0!==e&&(t.add=e),s(this.scene,c,t),c}))},20509:(t,e,i)=>{var s=i(35856);i(61286).register("tileSprite",(function(t,e,i,n,r,o){return this.displayList.add(new s(this.scene,t,e,i,n,r,o))}))},9271:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(74287),n=i(93305),t.exports={renderWebGL:s,renderCanvas:n}},74287:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i,n){e.updateCanvas();var r=e.width,o=e.height;if(0!==r&&0!==o){i.addToRenderList(e);var a=s.getTintAppendFloatAlpha,h=t.pipelines.set(e.pipeline,e),l=h.setTexture2D(e.fillPattern,e);h.batchTexture(e,e.fillPattern,e.displayFrame.width*e.tileScaleX,e.displayFrame.height*e.tileScaleY,e.x,e.y,r,o,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.originX*r,e.originY*o,0,0,r,o,a(e.tintTopLeft,i.alpha*e._alphaTL),a(e.tintTopRight,i.alpha*e._alphaTR),a(e.tintBottomLeft,i.alpha*e._alphaBL),a(e.tintBottomRight,i.alpha*e._alphaBR),e.tintFill,e.tilePositionX%e.displayFrame.width/e.displayFrame.width,e.tilePositionY%e.displayFrame.height/e.displayFrame.height,i,n,!1,l)}}},8630:(t,e,i)=>{var s=i(56694),n=i(82897),r=i(64937),o=i(56631),a=i(97081),h=i(33963),l=i(89980),u=i(76038),c=i(76583),d=i(77974),p=i(83392),f=new s({Extends:l,Mixins:[r.Alpha,r.BlendMode,r.Depth,r.Flip,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.ScrollFactor,r.Size,r.TextureCrop,r.Tint,r.Transform,r.Visible,d],initialize:function(t,e,i,s){l.call(this,t,"Video"),this.video=null,this.videoTexture=null,this.videoTextureSource=null,this.snapshotTexture=null,this.flipY=!1,this._key=c(),this.touchLocked=!0,this.playWhenUnlocked=!1,this.retryLimit=20,this.retry=0,this.retryInterval=500,this._retryID=null,this._systemMuted=!1,this._codeMuted=!1,this._systemPaused=!1,this._codePaused=!1,this._callbacks={play:this.playHandler.bind(this),error:this.loadErrorHandler.bind(this),end:this.completeHandler.bind(this),time:this.timeUpdateHandler.bind(this),seeking:this.seekingHandler.bind(this),seeked:this.seekedHandler.bind(this)},this._crop=this.resetCropObject(),this.markers={},this._markerIn=-1,this._markerOut=p.MAX_SAFE_INTEGER,this._lastUpdate=0,this._cacheKey="",this._isSeeking=!1,this.removeVideoElementOnDestroy=!1,this.setPosition(e,i),this.initPipeline(),s&&this.changeSource(s,!1);var n=t.sys.game.events;n.on(a.PAUSE,this.globalPause,this),n.on(a.RESUME,this.globalResume,this);var r=t.sys.sound;r&&r.on(u.GLOBAL_MUTE,this.globalMute,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},play:function(t,e,i){if(this.touchLocked&&this.playWhenUnlocked||this.isPlaying())return this;var s=this.video;if(!s)return console.warn("Video not loaded"),this;void 0===t&&(t=s.loop);var n=this.scene.sys.sound;n&&n.mute&&this.setMute(!0),isNaN(e)||(this._markerIn=e),!isNaN(i)&&i>e&&(this._markerOut=i),s.loop=t;var r=this._callbacks,o=s.play();return void 0!==o?o.then(this.playPromiseSuccessHandler.bind(this)).catch(this.playPromiseErrorHandler.bind(this)):(s.addEventListener("playing",r.play,!0),s.readyState<2&&(this.retry=this.retryLimit,this._retryID=window.setTimeout(this.checkVideoProgress.bind(this),this.retryInterval))),s.addEventListener("ended",r.end,!0),s.addEventListener("timeupdate",r.time,!0),s.addEventListener("seeking",r.seeking,!0),s.addEventListener("seeked",r.seeked,!0),this},changeSource:function(t,e,i,s,n){void 0===e&&(e=!0),this.video&&this.stop();var r=this.scene.sys.cache.video.get(t);return r?(this.video=r,this._cacheKey=t,this._codePaused=r.paused,this._codeMuted=r.muted,this.videoTexture?(this.scene.sys.textures.remove(this._key),this.videoTexture=this.scene.sys.textures.create(this._key,r,r.videoWidth,r.videoHeight),this.videoTextureSource=this.videoTexture.source[0],this.videoTexture.add("__BASE",0,0,0,r.videoWidth,r.videoHeight),this.setTexture(this.videoTexture),this.setSizeToFrame(),this.updateDisplayOrigin(),this.emit(o.VIDEO_CREATED,this,r.videoWidth,r.videoHeight)):this.updateTexture(),r.currentTime=0,this._lastUpdate=0,e&&this.play(i,s,n)):this.video=null,this},addMarker:function(t,e,i){return!isNaN(e)&&e>=0&&!isNaN(i)&&(this.markers[t]=[e,i]),this},playMarker:function(t,e){var i=this.markers[t];return i&&this.play(e,i[0],i[1]),this},removeMarker:function(t){return delete this.markers[t],this},snapshot:function(t,e){return void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.snapshotArea(0,0,this.width,this.height,t,e)},snapshotArea:function(t,e,i,s,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===s&&(s=this.height),void 0===n&&(n=i),void 0===r&&(r=s);var o=this.video,a=this.snapshotTexture;return a?(a.setSize(n,r),o&&a.context.drawImage(o,t,e,i,s,0,0,n,r)):(a=this.scene.sys.textures.createCanvas(c(),n,r),this.snapshotTexture=a,o&&a.context.drawImage(o,t,e,i,s,0,0,n,r)),a.update()},saveSnapshotTexture:function(t){return this.snapshotTexture?this.scene.sys.textures.renameTexture(this.snapshotTexture.key,t):this.snapshotTexture=this.scene.sys.textures.createCanvas(t,this.width,this.height),this.snapshotTexture},loadURL:function(t,e,i,s){void 0===e&&(e="loadeddata"),void 0===i&&(i=!1),this.video&&this.stop(),this.videoTexture&&this.scene.sys.textures.remove(this._key);var n=document.createElement("video");return n.controls=!1,i&&(n.muted=!0,n.defaultMuted=!0,n.setAttribute("autoplay","autoplay")),n.setAttribute("playsinline","playsinline"),n.setAttribute("preload","auto"),void 0!==s&&n.setAttribute("crossorigin",s),n.addEventListener("error",this._callbacks.error,!0),n.src=t,n.load(),this.video=n,this},loadMediaStream:function(t,e,i){void 0===e&&(e="loadeddata"),void 0===i&&(i=!1),this.video&&this.stop(),this.videoTexture&&this.scene.sys.textures.remove(this._key);var s=document.createElement("video");s.controls=!1,i&&(s.muted=!0,s.defaultMuted=!0,s.setAttribute("autoplay","autoplay")),s.setAttribute("playsinline","playsinline"),s.setAttribute("preload","auto"),s.addEventListener("error",this._callbacks.error,!0);try{s.srcObject=t}catch(e){s.src=window.URL.createObjectURL(t)}return s.load(),this.video=s,this},playPromiseSuccessHandler:function(){this._codePaused=!1,this.touchLocked=!1,this.emit(o.VIDEO_PLAY,this),this._markerIn>-1&&(this.video.currentTime=this._markerIn)},playPromiseErrorHandler:function(t){this.scene.sys.input.once(h.POINTER_DOWN,this.unlockHandler,this),this.touchLocked=!0,this.playWhenUnlocked=!0,this.emit(o.VIDEO_ERROR,this,t)},playHandler:function(){this._codePaused=!1,this.touchLocked=!1,this.emit(o.VIDEO_PLAY,this),this.video.removeEventListener("playing",this._callbacks.play,!0)},loadErrorHandler:function(t){this.stop(),this.emit(o.VIDEO_ERROR,this,t)},unlockHandler:function(){this.touchLocked=!1,this.playWhenUnlocked=!1,this.emit(o.VIDEO_UNLOCKED,this),this._markerIn>-1&&(this.video.currentTime=this._markerIn),this.video.play(),this.emit(o.VIDEO_PLAY,this)},completeHandler:function(){this.emit(o.VIDEO_COMPLETE,this)},timeUpdateHandler:function(){this.video&&this.video.currentTime=this._markerOut&&(t.loop?(t.currentTime=this._markerIn,this.updateTexture(),this._lastUpdate=e,this.emit(o.VIDEO_LOOP,this)):(this.emit(o.VIDEO_COMPLETE,this),this.stop())))}},checkVideoProgress:function(){this.video.readyState>=2?this.updateTexture():(this.retry--,this.retry>0?this._retryID=window.setTimeout(this.checkVideoProgress.bind(this),this.retryInterval):this.emit(o.VIDEO_TIMEOUT,this))},updateTexture:function(){var t=this.video,e=t.videoWidth,i=t.videoHeight;if(this.videoTexture){var s=this.videoTextureSource;s.source!==t&&(s.source=t,s.width=e,s.height=i),s.update()}else this.videoTexture=this.scene.sys.textures.create(this._key,t,e,i),this.videoTextureSource=this.videoTexture.source[0],this.videoTexture.add("__BASE",0,0,0,e,i),this.setTexture(this.videoTexture),this.setSizeToFrame(),this.updateDisplayOrigin(),this.emit(o.VIDEO_CREATED,this,e,i)},getVideoKey:function(){return this._cacheKey},seekTo:function(t){var e=this.video;if(e){var i=e.duration;if(i!==1/0&&!isNaN(i)){var s=i*t;this.setCurrentTime(s)}}return this},getCurrentTime:function(){return this.video?this.video.currentTime:0},setCurrentTime:function(t){var e=this.video;if(e){if("string"==typeof t){var i=t[0],s=parseFloat(t.substr(1));"+"===i?t=e.currentTime+s:"-"===i&&(t=e.currentTime-s)}e.currentTime=t,this._lastUpdate=t}return this},isSeeking:function(){return this._isSeeking},seekingHandler:function(){this._isSeeking=!0,this.emit(o.VIDEO_SEEKING,this)},seekedHandler:function(){this._isSeeking=!1,this.emit(o.VIDEO_SEEKED,this),this.video&&this.updateTexture()},getProgress:function(){var t=this.video;if(t){var e=t.currentTime,i=t.duration;if(i!==1/0&&!isNaN(i))return e/i}return 0},getDuration:function(){return this.video?this.video.duration:0},setMute:function(t){void 0===t&&(t=!0),this._codeMuted=t;var e=this.video;return e&&(e.muted=!!this._systemMuted||t),this},isMuted:function(){return this._codeMuted},globalMute:function(t,e){this._systemMuted=e;var i=this.video;i&&(i.muted=!!this._codeMuted||e)},globalPause:function(){this._systemPaused=!0,this.video&&this.video.pause()},globalResume:function(){this._systemPaused=!1,this.video&&!this._codePaused&&this.video.play()},setPaused:function(t){void 0===t&&(t=!0);var e=this.video;return this._codePaused=t,e&&(t?e.paused||e.pause():t||e.paused&&!this._systemPaused&&e.play()),this},getVolume:function(){return this.video?this.video.volume:1},setVolume:function(t){return void 0===t&&(t=1),this.video&&(this.video.volume=n(t,0,1)),this},getPlaybackRate:function(){return this.video?this.video.playbackRate:1},setPlaybackRate:function(t){return this.video&&(this.video.playbackRate=t),this},getLoop:function(){return!!this.video&&this.video.loop},setLoop:function(t){return void 0===t&&(t=!0),this.video&&(this.video.loop=t),this},isPlaying:function(){return!!this.video&&!(this.video.paused||this.video.ended)},isPaused:function(){return this.video&&this.video.paused||this._codePaused||this._systemPaused},saveTexture:function(t,e){return void 0===e&&(e=!1),this.videoTexture&&this.scene.sys.textures.renameTexture(this._key,t),this._key=t,this.flipY=e,this.videoTextureSource&&this.videoTextureSource.setFlipY(e),this.videoTexture},stop:function(){var t=this.video;if(t){var e=this._callbacks;for(var i in e)t.removeEventListener(i,e[i],!0);t.pause()}return this._retryID&&window.clearTimeout(this._retryID),this.emit(o.VIDEO_STOP,this),this},removeVideoElement:function(){var t=this.video;if(t){for(t.parentNode&&t.parentNode.removeChild(t);t.hasChildNodes();)t.removeChild(t.firstChild);t.removeAttribute("autoplay"),t.removeAttribute("src"),this.video=null}},preDestroy:function(){this.stop(),this.removeVideoElementOnDestroy&&this.removeVideoElement();var t=this.scene.sys.game.events;t.off(a.PAUSE,this.globalPause,this),t.off(a.RESUME,this.globalResume,this);var e=this.scene.sys.sound;e&&e.off(u.GLOBAL_MUTE,this.globalMute,this),this._retryID&&window.clearTimeout(this._retryID)}});t.exports=f},56933:t=>{t.exports=function(t,e,i,s){e.videoTexture&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,s))}},65601:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(8630);n.register("video",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=new o(this.scene,0,0,i);return void 0!==e&&(t.add=e),s(this.scene,n,t),t.add||this.updateList.add(n),n}))},215:(t,e,i)=>{var s=i(8630);i(61286).register("video",(function(t,e,i){return this.displayList.add(new s(this.scene,t,e,i))}))},77974:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(83572),n=i(56933),t.exports={renderWebGL:s,renderCanvas:n}},83572:t=>{t.exports=function(t,e,i,s){e.videoTexture&&(i.addToRenderList(e),e.pipeline.batchSprite(e,i,s))}},71030:(t,e,i)=>{var s=i(95723),n=i(26673),r=i(65650),o=i(56694),a=i(64937),h=i(89980),l=i(74118),u=i(94287),c=new o({Extends:h,Mixins:[a.Depth,a.GetBounds,a.Origin,a.Transform,a.ScrollFactor,a.Visible],initialize:function(t,e,i,n,r){void 0===n&&(n=1),void 0===r&&(r=n),h.call(this,t,"Zone"),this.setPosition(e,i),this.width=n,this.height=r,this.blendMode=s.NORMAL,this.updateDisplayOrigin()},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e,i){void 0===i&&(i=!0),this.width=t,this.height=e,this.updateDisplayOrigin();var s=this.input;return i&&s&&!s.customHitArea&&(s.hitArea.width=t,s.hitArea.height=e),this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},setCircleDropZone:function(t){return this.setDropZone(new n(0,0,t),r)},setRectangleDropZone:function(t,e){return this.setDropZone(new l(0,0,t,e),u)},setDropZone:function(t,e){return this.input||this.setInteractive(t,e,!0),this},setAlpha:function(){},setBlendMode:function(){},renderCanvas:function(t,e,i){i.addToRenderList(e)},renderWebGL:function(t,e,i){i.addToRenderList(e)}});t.exports=c},24067:(t,e,i)=>{var s=i(99325),n=i(20494),r=i(71030);s.register("zone",(function(t){var e=n(t,"x",0),i=n(t,"y",0),s=n(t,"width",1),o=n(t,"height",s);return new r(this.scene,e,i,s,o)}))},34546:(t,e,i)=>{var s=i(71030);i(61286).register("zone",(function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))}))},95847:t=>{t.exports=function(t){return t.radius>0?Math.PI*t.radius*t.radius:0}},26673:(t,e,i)=>{var s=i(56694),n=i(65650),r=i(94026),o=i(62941),a=i(52394),h=i(30977),l=new s({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.type=a.CIRCLE,this.x=t,this.y=e,this._radius=i,this._diameter=2*i},contains:function(t,e){return n(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i){return this.x=t,this.y=e,this._radius=i,this._diameter=2*i,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this._diameter=2*t}},diameter:{get:function(){return this._diameter},set:function(t){this._diameter=t,this._radius=.5*t}},left:{get:function(){return this.x-this._radius},set:function(t){this.x=t+this._radius}},right:{get:function(){return this.x+this._radius},set:function(t){this.x=t-this._radius}},top:{get:function(){return this.y-this._radius},set:function(t){this.y=t+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(t){this.y=t-this._radius}}});t.exports=l},37964:t=>{t.exports=function(t){return Math.PI*t.radius*2}},72233:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){return void 0===i&&(i=new s),i.x=t.x+t.radius*Math.cos(e),i.y=t.y+t.radius*Math.sin(e),i}},61761:(t,e,i)=>{var s=i(26673);t.exports=function(t){return new s(t.x,t.y,t.radius)}},65650:t=>{t.exports=function(t,e,i){return t.radius>0&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},39187:(t,e,i)=>{var s=i(65650);t.exports=function(t,e){return s(t,e.x,e.y)}},58672:(t,e,i)=>{var s=i(65650);t.exports=function(t,e){return s(t,e.x,e.y)&&s(t,e.right,e.y)&&s(t,e.x,e.bottom)&&s(t,e.right,e.bottom)}},42997:t=>{t.exports=function(t,e){return e.setTo(t.x,t.y,t.radius)}},94894:t=>{t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.radius===e.radius}},48027:(t,e,i)=>{var s=i(74118);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.left,e.y=t.top,e.width=t.diameter,e.height=t.diameter,e}},94026:(t,e,i)=>{var s=i(72233),n=i(91806),r=i(83392),o=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new o);var a=n(e,0,r.PI2);return s(t,a,i)}},62941:(t,e,i)=>{var s=i(37964),n=i(72233),r=i(91806),o=i(83392);t.exports=function(t,e,i,a){void 0===a&&(a=[]),!e&&i>0&&(e=s(t)/i);for(var h=0;h{t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},88665:t=>{t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},30977:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){void 0===e&&(e=new s);var i=2*Math.PI*Math.random(),n=Math.random()+Math.random(),r=n>1?2-n:n,o=r*Math.cos(i),a=r*Math.sin(i);return e.x=t.x+o*t.radius,e.y=t.y+a*t.radius,e}},6112:(t,e,i)=>{var s=i(26673);s.Area=i(95847),s.Circumference=i(37964),s.CircumferencePoint=i(72233),s.Clone=i(61761),s.Contains=i(65650),s.ContainsPoint=i(39187),s.ContainsRect=i(58672),s.CopyFrom=i(42997),s.Equals=i(94894),s.GetBounds=i(48027),s.GetPoint=i(94026),s.GetPoints=i(62941),s.Offset=i(34585),s.OffsetPoint=i(88665),s.Random=i(30977),t.exports=s},52394:t=>{t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},58605:t=>{t.exports=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI}},39507:t=>{t.exports=function(t){var e=t.width/2,i=t.height/2,s=Math.pow(e-i,2)/Math.pow(e+i,2);return Math.PI*(e+i)*(1+3*s/(10+Math.sqrt(4-3*s)))}},86998:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=t.width/2,r=t.height/2;return i.x=t.x+n*Math.cos(e),i.y=t.y+r*Math.sin(e),i}},81773:(t,e,i)=>{var s=i(95669);t.exports=function(t){return new s(t.x,t.y,t.width,t.height)}},72313:t=>{t.exports=function(t,e,i){if(t.width<=0||t.height<=0)return!1;var s=(e-t.x)/t.width,n=(i-t.y)/t.height;return(s*=s)+(n*=n)<.25}},34368:(t,e,i)=>{var s=i(72313);t.exports=function(t,e){return s(t,e.x,e.y)}},71431:(t,e,i)=>{var s=i(72313);t.exports=function(t,e){return s(t,e.x,e.y)&&s(t,e.right,e.y)&&s(t,e.x,e.bottom)&&s(t,e.right,e.bottom)}},75459:t=>{t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},95669:(t,e,i)=>{var s=i(56694),n=i(72313),r=i(95340),o=i(54978),a=i(52394),h=i(72006),l=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.type=a.ELLIPSE,this.x=t,this.y=e,this.width=i,this.height=s},contains:function(t,e){return n(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setEmpty:function(){return this.width=0,this.height=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getMinorRadius:function(){return Math.min(this.width,this.height)/2},getMajorRadius:function(){return Math.max(this.width,this.height)/2},left:{get:function(){return this.x-this.width/2},set:function(t){this.x=t+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(t){this.y=t+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=l},98068:t=>{t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},72897:(t,e,i)=>{var s=i(74118);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.left,e.y=t.top,e.width=t.width,e.height=t.height,e}},95340:(t,e,i)=>{var s=i(86998),n=i(91806),r=i(83392),o=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new o);var a=n(e,0,r.PI2);return s(t,a,i)}},54978:(t,e,i)=>{var s=i(39507),n=i(86998),r=i(91806),o=i(83392);t.exports=function(t,e,i,a){void 0===a&&(a=[]),!e&&i>0&&(e=s(t)/i);for(var h=0;h{t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},36233:t=>{t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},72006:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){void 0===e&&(e=new s);var i=Math.random()*Math.PI*2,n=Math.sqrt(Math.random());return e.x=t.x+n*Math.cos(i)*t.width/2,e.y=t.y+n*Math.sin(i)*t.height/2,e}},40652:(t,e,i)=>{var s=i(95669);s.Area=i(58605),s.Circumference=i(39507),s.CircumferencePoint=i(86998),s.Clone=i(81773),s.Contains=i(72313),s.ContainsPoint=i(34368),s.ContainsRect=i(71431),s.CopyFrom=i(75459),s.Equals=i(98068),s.GetBounds=i(72897),s.GetPoint=i(95340),s.GetPoints=i(54978),s.Offset=i(77951),s.OffsetPoint=i(36233),s.Random=i(72006),t.exports=s},84068:(t,e,i)=>{var s=i(52394),n=i(98611),r={Circle:i(6112),Ellipse:i(40652),Intersects:i(7563),Line:i(28482),Mesh:i(14293),Point:i(63472),Polygon:i(44359),Rectangle:i(66658),Triangle:i(87619)};r=n(!1,r,s),t.exports=r},22184:(t,e,i)=>{var s=i(53996);t.exports=function(t,e){return s(t.x,t.y,e.x,e.y)<=t.radius+e.radius}},26535:t=>{t.exports=function(t,e){var i=e.width/2,s=e.height/2,n=Math.abs(t.x-e.x-i),r=Math.abs(t.y-e.y-s),o=i+t.radius,a=s+t.radius;if(n>o||r>a)return!1;if(n<=i||r<=s)return!0;var h=n-i,l=r-s;return h*h+l*l<=t.radius*t.radius}},71145:(t,e,i)=>{var s=i(79967),n=i(22184);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r,o,a,h,l=t.x,u=t.y,c=t.radius,d=e.x,p=e.y,f=e.radius;if(u===p)0===(a=(o=-2*p)*o-4*(r=1)*(d*d+(h=(f*f-c*c-d*d+l*l)/(2*(l-d)))*h-2*d*h+p*p-f*f))?i.push(new s(h,-o/(2*r))):a>0&&(i.push(new s(h,(-o+Math.sqrt(a))/(2*r))),i.push(new s(h,(-o-Math.sqrt(a))/(2*r))));else{var v=(l-d)/(u-p),g=(f*f-c*c-d*d+l*l-p*p+u*u)/(2*(u-p));0===(a=(o=2*u*v-2*g*v-2*l)*o-4*(r=v*v+1)*(l*l+u*u+g*g-c*c-2*u*g))?(h=-o/(2*r),i.push(new s(h,g-h*v))):a>0&&(h=(-o+Math.sqrt(a))/(2*r),i.push(new s(h,g-h*v)),h=(-o-Math.sqrt(a))/(2*r),i.push(new s(h,g-h*v)))}}return i}},62508:(t,e,i)=>{var s=i(26111),n=i(26535);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC(),h=e.getLineD();s(r,t,i),s(o,t,i),s(a,t,i),s(h,t,i)}return i}},26111:(t,e,i)=>{var s=i(79967),n=i(61472);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r,o,a=t.x1,h=t.y1,l=t.x2,u=t.y2,c=e.x,d=e.y,p=e.radius,f=l-a,v=u-h,g=a-c,m=h-d,y=f*f+v*v,x=2*(f*g+v*m),T=x*x-4*y*(g*g+m*m-p*p);if(0===T){var w=-x/(2*y);r=a+w*f,o=h+w*v,w>=0&&w<=1&&i.push(new s(r,o))}else if(T>0){var b=(-x-Math.sqrt(T))/(2*y);r=a+b*f,o=h+b*v,b>=0&&b<=1&&i.push(new s(r,o));var E=(-x+Math.sqrt(T))/(2*y);r=a+E*f,o=h+E*v,E>=0&&E<=1&&i.push(new s(r,o))}}return i}},96537:(t,e,i)=>{var s=i(70015);t.exports=function(t,e,i){var n=t.x1,r=t.y1,o=t.x2,a=t.y2,h=e.x1,l=e.y1,u=o-n,c=a-r,d=e.x2-h,p=e.y2-l,f=u*p-c*d;if(0===f)return!1;var v=((h-n)*p-(l-r)*d)/f,g=((r-l)*u-(n-h)*c)/f;return v<0||v>1||g<0||g>1?null:(void 0===i&&(i=new s),i.set(n+u*v,r+c*v,v))}},17647:(t,e,i)=>{var s=i(70015),n=i(96537),r=new(i(88829)),o=new s;t.exports=function(t,e,i){void 0===i&&(i=new s);var a=!1;i.set(),o.set();for(var h=e[0],l=1;l{var s=i(70015),n=i(51729),r=i(17647),o=new s;t.exports=function(t,e,i){void 0===i&&(i=new n),Array.isArray(e)||(e=[e]);var s=!1;i.set(),o.set();for(var a=0;a{var s=i(79967),n=i(25227),r=i(47910);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e))for(var o=e.getLineA(),a=e.getLineB(),h=e.getLineC(),l=e.getLineD(),u=[new s,new s,new s,new s],c=[n(o,t,u[0]),n(a,t,u[1]),n(h,t,u[2]),n(l,t,u[3])],d=0;d<4;d++)c[d]&&i.push(u[d]);return i}},7449:(t,e,i)=>{var s=i(51729),n=i(68439),r=new(i(88829));function o(t,e,i,o,a){var h=Math.cos(t),l=Math.sin(t);r.setTo(e,i,e+h,i+l);var u=n(r,o);u&&a.push(new s(u.x,u.y,t,u.w))}function a(t,e){return t.z-e.z}t.exports=function(t,e,i){Array.isArray(i)||(i=[i]);for(var s=[],n=[],r=0;r{var s=i(74118),n=i(90205);t.exports=function(t,e,i){return void 0===i&&(i=new s),n(t,e)&&(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y),i}},1946:(t,e,i)=>{var s=i(9569),n=i(90205);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=t.getLineA(),o=t.getLineB(),a=t.getLineC(),h=t.getLineD();s(r,e,i),s(o,e,i),s(a,e,i),s(h,e,i)}return i}},34211:(t,e,i)=>{var s=i(20370),n=i(9569);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC();n(r,t,i),n(o,t,i),n(a,t,i)}return i}},80511:(t,e,i)=>{var s=i(26111),n=i(48411);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=t.getLineA(),o=t.getLineB(),a=t.getLineC();s(r,e,i),s(o,e,i),s(a,e,i)}return i}},31343:(t,e,i)=>{var s=i(79967),n=i(86117),r=i(25227);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e))for(var o=t.getLineA(),a=t.getLineB(),h=t.getLineC(),l=[new s,new s,new s],u=[r(o,e,l[0]),r(a,e,l[1]),r(h,e,l[2])],c=0;c<3;c++)u[c]&&i.push(l[c]);return i}},70534:(t,e,i)=>{var s=i(23589),n=i(31343);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC();n(t,r,i),n(t,o,i),n(t,a,i)}return i}},61472:(t,e,i)=>{var s=i(65650),n=new(i(79967));t.exports=function(t,e,i){if(void 0===i&&(i=n),s(e,t.x1,t.y1))return i.x=t.x1,i.y=t.y1,!0;if(s(e,t.x2,t.y2))return i.x=t.x2,i.y=t.y2,!0;var r=t.x2-t.x1,o=t.y2-t.y1,a=e.x-t.x1,h=e.y-t.y1,l=r*r+o*o,u=r,c=o;if(l>0){var d=(a*r+h*o)/l;u*=d,c*=d}return i.x=t.x1+u,i.y=t.y1+c,u*u+c*c<=l&&u*r+c*o>=0&&s(e,i.x,i.y)}},25227:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=t.x1,r=t.y1,o=t.x2,a=t.y2,h=e.x1,l=e.y1,u=e.x2,c=e.y2,d=(c-l)*(o-n)-(u-h)*(a-r);if(0===d)return!1;var p=((u-h)*(r-l)-(c-l)*(n-h))/d,f=((o-n)*(r-l)-(a-r)*(n-h))/d;return p>=0&&p<=1&&f>=0&&f<=1&&(i.x=n+p*(o-n),i.y=r+p*(a-r),!0)}},47910:t=>{t.exports=function(t,e){var i=t.x1,s=t.y1,n=t.x2,r=t.y2,o=e.x,a=e.y,h=e.right,l=e.bottom,u=0;if(i>=o&&i<=h&&s>=a&&s<=l||n>=o&&n<=h&&r>=a&&r<=l)return!0;if(i=o){if((u=s+(r-s)*(o-i)/(n-i))>a&&u<=l)return!0}else if(i>h&&n<=h&&(u=s+(r-s)*(h-i)/(n-i))>=a&&u<=l)return!0;if(s=a){if((u=i+(n-i)*(a-s)/(r-s))>=o&&u<=h)return!0}else if(s>l&&r<=l&&(u=i+(n-i)*(l-s)/(r-s))>=o&&u<=h)return!0;return!1}},34426:t=>{t.exports=function(t,e,i){void 0===i&&(i=1);var s=e.x1,n=e.y1,r=e.x2,o=e.y2,a=t.x,h=t.y,l=(r-s)*(r-s)+(o-n)*(o-n);if(0===l)return!1;var u=((a-s)*(r-s)+(h-n)*(o-n))/l;if(u<0)return Math.sqrt((s-a)*(s-a)+(n-h)*(n-h))<=i;if(u>=0&&u<=1){var c=((n-h)*(r-s)-(s-a)*(o-n))/l;return Math.abs(c)*Math.sqrt(l)<=i}return Math.sqrt((r-a)*(r-a)+(o-h)*(o-h))<=i}},81414:(t,e,i)=>{var s=i(34426);t.exports=function(t,e){if(!s(t,e))return!1;var i=Math.min(e.x1,e.x2),n=Math.max(e.x1,e.x2),r=Math.min(e.y1,e.y2),o=Math.max(e.y1,e.y2);return t.x>=i&&t.x<=n&&t.y>=r&&t.y<=o}},90205:t=>{t.exports=function(t,e){return!(t.width<=0||t.height<=0||e.width<=0||e.height<=0)&&!(t.righte.right||t.y>e.bottom)}},20370:(t,e,i)=>{var s=i(25227),n=i(94287),r=i(86875),o=i(87279);t.exports=function(t,e){if(e.left>t.right||e.rightt.bottom||e.bottom0}},8786:t=>{t.exports=function(t,e,i,s,n,r){return void 0===r&&(r=0),!(e>t.right+r||it.bottom+r||n{var s=i(61472),n=i(60689);t.exports=function(t,e){return!(t.left>e.right||t.righte.bottom||t.bottom{var s=i(25227);t.exports=function(t,e){return!(!t.contains(e.x1,e.y1)&&!t.contains(e.x2,e.y2))||(!!s(t.getLineA(),e)||(!!s(t.getLineB(),e)||!!s(t.getLineC(),e)))}},23589:(t,e,i)=>{var s=i(86875),n=i(18680),r=i(25227);t.exports=function(t,e){if(t.left>e.right||t.righte.bottom||t.bottom0||(c=n(e),(d=s(t,c,!0)).length>0)}},7563:(t,e,i)=>{t.exports={CircleToCircle:i(22184),CircleToRectangle:i(26535),GetCircleToCircle:i(71145),GetCircleToRectangle:i(62508),GetLineToCircle:i(26111),GetLineToLine:i(96537),GetLineToPoints:i(17647),GetLineToPolygon:i(68439),GetLineToRectangle:i(9569),GetRaysFromPointToPolygon:i(7449),GetRectangleIntersection:i(82931),GetRectangleToRectangle:i(1946),GetRectangleToTriangle:i(34211),GetTriangleToCircle:i(80511),GetTriangleToLine:i(31343),GetTriangleToTriangle:i(70534),LineToCircle:i(61472),LineToLine:i(25227),LineToRectangle:i(47910),PointToLine:i(34426),PointToLineSegment:i(81414),RectangleToRectangle:i(90205),RectangleToTriangle:i(20370),RectangleToValues:i(8786),TriangleToCircle:i(48411),TriangleToLine:i(86117),TriangleToTriangle:i(23589)}},50599:t=>{t.exports=function(t){return Math.atan2(t.y2-t.y1,t.x2-t.x1)}},58813:t=>{t.exports=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=[]);var s=Math.round(t.x1),n=Math.round(t.y1),r=Math.round(t.x2),o=Math.round(t.y2),a=Math.abs(r-s),h=Math.abs(o-n),l=s-h&&(c-=h,s+=l),p{t.exports=function(t,e,i){var s=e-(t.x1+t.x2)/2,n=i-(t.y1+t.y2)/2;return t.x1+=s,t.y1+=n,t.x2+=s,t.y2+=n,t}},26718:(t,e,i)=>{var s=i(88829);t.exports=function(t){return new s(t.x1,t.y1,t.x2,t.y2)}},88930:t=>{t.exports=function(t,e){return e.setTo(t.x1,t.y1,t.x2,t.y2)}},90656:t=>{t.exports=function(t,e){return t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2}},30897:(t,e,i)=>{var s=i(16028);t.exports=function(t,e,i){void 0===i&&(i=e);var n=s(t),r=t.x2-t.x1,o=t.y2-t.y1;return e&&(t.x1=t.x1-r/n*e,t.y1=t.y1-o/n*e),i&&(t.x2=t.x2+r/n*i,t.y2=t.y2+o/n*i),t}},30684:(t,e,i)=>{var s=i(92951),n=i(21902),r=i(79967);t.exports=function(t,e,i,o,a){void 0===o&&(o=0),void 0===a&&(a=[]);var h,l,u=[],c=t.x1,d=t.y1,p=t.x2-c,f=t.y2-d,v=n(e,a),g=i-1;for(h=0;h0){var m=u[0],y=[m];for(h=1;h=o&&(y.push(x),m=x)}var T=u[u.length-1];return s(m,T){var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=(t.x1+t.x2)/2,e.y=(t.y1+t.y2)/2,e}},11222:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=t.x1,r=t.y1,o=t.x2,a=t.y2,h=(o-n)*(o-n)+(a-r)*(a-r);if(0===h)return i;var l=((e.x-n)*(o-n)+(e.y-r)*(a-r))/h;return i.x=n+l*(o-n),i.y=r+l*(a-r),i}},7377:(t,e,i)=>{var s=i(83392),n=i(50599),r=i(79967);t.exports=function(t,e){void 0===e&&(e=new r);var i=n(t)-s.TAU;return e.x=Math.cos(i),e.y=Math.sin(i),e}},66464:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){return void 0===i&&(i=new s),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},8570:(t,e,i)=>{var s=i(16028),n=i(79967);t.exports=function(t,e,i,r){void 0===r&&(r=[]),!e&&i>0&&(e=s(t)/i);for(var o=t.x1,a=t.y1,h=t.x2,l=t.y2,u=0;u{t.exports=function(t,e){var i=t.x1,s=t.y1,n=t.x2,r=t.y2,o=(n-i)*(n-i)+(r-s)*(r-s);if(0===o)return!1;var a=((s-e.y)*(n-i)-(i-e.x)*(r-s))/o;return Math.abs(a)*Math.sqrt(o)}},82996:t=>{t.exports=function(t){return Math.abs(t.y1-t.y2)}},16028:t=>{t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},88829:(t,e,i)=>{var s=i(56694),n=i(66464),r=i(8570),o=i(52394),a=i(74077),h=i(93736),l=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.type=o.LINE,this.x1=t,this.y1=e,this.x2=i,this.y2=s},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return r(this,t,e,i)},getRandomPoint:function(t){return a(this,t)},setTo:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.x1=t,this.y1=e,this.x2=i,this.y2=s,this},getPointA:function(t){return void 0===t&&(t=new h),t.set(this.x1,this.y1),t},getPointB:function(t){return void 0===t&&(t=new h),t.set(this.x2,this.y2),t},left:{get:function(){return Math.min(this.x1,this.x2)},set:function(t){this.x1<=this.x2?this.x1=t:this.x2=t}},right:{get:function(){return Math.max(this.x1,this.x2)},set:function(t){this.x1>this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},73273:(t,e,i)=>{var s=i(83392),n=i(1071),r=i(50599);t.exports=function(t){var e=r(t)-s.TAU;return n(e,-Math.PI,Math.PI)}},96936:(t,e,i)=>{var s=i(83392),n=i(50599);t.exports=function(t){return Math.cos(n(t)-s.TAU)}},43581:(t,e,i)=>{var s=i(83392),n=i(50599);t.exports=function(t){return Math.sin(n(t)-s.TAU)}},13990:t=>{t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t}},1298:t=>{t.exports=function(t){return-(t.x2-t.x1)/(t.y2-t.y1)}},74077:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){void 0===e&&(e=new s);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},30473:(t,e,i)=>{var s=i(50599),n=i(73273);t.exports=function(t,e){return 2*n(e)-Math.PI-s(t)}},25968:(t,e,i)=>{var s=i(1809);t.exports=function(t,e){var i=(t.x1+t.x2)/2,n=(t.y1+t.y2)/2;return s(t,i,n,e)}},24296:(t,e,i)=>{var s=i(1809);t.exports=function(t,e,i){return s(t,e.x,e.y,i)}},1809:t=>{t.exports=function(t,e,i,s){var n=Math.cos(s),r=Math.sin(s),o=t.x1-e,a=t.y1-i;return t.x1=o*n-a*r+e,t.y1=o*r+a*n+i,o=t.x2-e,a=t.y2-i,t.x2=o*n-a*r+e,t.y2=o*r+a*n+i,t}},88171:t=>{t.exports=function(t,e,i,s,n){return t.x1=e,t.y1=i,t.x2=e+Math.cos(s)*n,t.y2=i+Math.sin(s)*n,t}},82797:t=>{t.exports=function(t){return(t.y2-t.y1)/(t.x2-t.x1)}},41067:t=>{t.exports=function(t){return Math.abs(t.x1-t.x2)}},28482:(t,e,i)=>{var s=i(88829);s.Angle=i(50599),s.BresenhamPoints=i(58813),s.CenterOn=i(88513),s.Clone=i(26718),s.CopyFrom=i(88930),s.Equals=i(90656),s.Extend=i(30897),s.GetEasedPoints=i(30684),s.GetMidPoint=i(20487),s.GetNearestPoint=i(11222),s.GetNormal=i(7377),s.GetPoint=i(66464),s.GetPoints=i(8570),s.GetShortestDistance=i(65269),s.Height=i(82996),s.Length=i(16028),s.NormalAngle=i(73273),s.NormalX=i(96936),s.NormalY=i(43581),s.Offset=i(13990),s.PerpSlope=i(1298),s.Random=i(74077),s.ReflectAngle=i(30473),s.Rotate=i(25968),s.RotateAroundPoint=i(24296),s.RotateAroundXY=i(1809),s.SetToAngle=i(88171),s.Slope=i(82797),s.Width=i(41067),t.exports=s},18693:(t,e,i)=>{var s=i(56694),n=i(74118),r=i(93736);function o(t,e,i,s){var n=t-i,r=e-s,o=n*n+r*r;return Math.sqrt(o)}var a=new s({initialize:function(t,e,i){this.vertex1=t,this.vertex2=e,this.vertex3=i,this.bounds=new n,this._inCenter=new r},getInCenter:function(t){void 0===t&&(t=!0);var e,i,s,n,r,a,h=this.vertex1,l=this.vertex2,u=this.vertex3;t?(e=h.x,i=h.y,s=l.x,n=l.y,r=u.x,a=u.y):(e=h.vx,i=h.vy,s=l.vx,n=l.vy,r=u.vx,a=u.vy);var c=o(r,a,s,n),d=o(e,i,r,a),p=o(s,n,e,i),f=c+d+p;return this._inCenter.set((e*c+s*d+r*p)/f,(i*c+n*d+a*p)/f)},contains:function(t,e,i){var s=this.vertex1,n=this.vertex2,r=this.vertex3,o=s.vx,a=s.vy,h=n.vx,l=n.vy,u=r.vx,c=r.vy;if(i){var d=i.a,p=i.b,f=i.c,v=i.d,g=i.e,m=i.f;o=s.vx*d+s.vy*f+g,a=s.vx*p+s.vy*v+m,h=n.vx*d+n.vy*f+g,l=n.vx*p+n.vy*v+m,u=r.vx*d+r.vy*f+g,c=r.vx*p+r.vy*v+m}var y=u-o,x=c-a,T=h-o,w=l-a,b=t-o,E=e-a,S=y*y+x*x,A=y*T+x*w,_=y*b+x*E,C=T*T+w*w,M=T*b+w*E,R=S*C-A*A,P=0===R?0:1/R,O=(C*_-A*M)*P,L=(S*M-A*_)*P;return O>=0&&L>=0&&O+L<1},isCounterClockwise:function(t){var e=this.vertex1,i=this.vertex2,s=this.vertex3,n=(i.vx-e.vx)*(s.vy-e.vy)-(i.vy-e.vy)*(s.vx-e.vx);return t<=0?n>=0:n<0},load:function(t,e,i,s,n){return i=this.vertex1.load(t,e,i,s,n),i=this.vertex2.load(t,e,i,s,n),i=this.vertex3.load(t,e,i,s,n)},transformCoordinatesLocal:function(t,e,i,s){return this.vertex1.transformCoordinatesLocal(t,e,i,s),this.vertex2.transformCoordinatesLocal(t,e,i,s),this.vertex3.transformCoordinatesLocal(t,e,i,s),this},updateBounds:function(){var t=this.vertex1,e=this.vertex2,i=this.vertex3,s=this.bounds;return s.x=Math.min(t.vx,e.vx,i.vx),s.y=Math.min(t.vy,e.vy,i.vy),s.width=Math.max(t.vx,e.vx,i.vx)-s.x,s.height=Math.max(t.vy,e.vy,i.vy)-s.y,this},isInView:function(t,e,i,s,n,r,o,a,h,l,u){var c=this.vertex1.update(n,r,o,a,h,l,u,s),d=this.vertex2.update(n,r,o,a,h,l,u,s),p=this.vertex3.update(n,r,o,a,h,l,u,s);if(c.ta<=0&&d.ta<=0&&p.ta<=0)return!1;if(e&&!this.isCounterClockwise(i))return!1;var f=this.bounds;f.x=Math.min(c.tx,d.tx,p.tx),f.y=Math.min(c.ty,d.ty,p.ty),f.width=Math.max(c.tx,d.tx,p.tx)-f.x,f.height=Math.max(c.ty,d.ty,p.ty)-f.y;var v=t.x+t.width,g=t.y+t.height;return!(f.width<=0||f.height<=0||t.width<=0||t.height<=0)&&!(f.rightv||f.y>g)},translate:function(t,e){void 0===e&&(e=0);var i=this.vertex1,s=this.vertex2,n=this.vertex3;return i.x+=t,i.y+=e,s.x+=t,s.y+=e,n.x+=t,n.y+=e,this},x:{get:function(){return this.getInCenter().x},set:function(t){var e=this.getInCenter();this.translate(t-e.x,0)}},y:{get:function(){return this.getInCenter().y},set:function(t){var e=this.getInCenter();this.translate(0,t-e.y)}},alpha:{get:function(){var t=this.vertex1,e=this.vertex2,i=this.vertex3;return(t.alpha+e.alpha+i.alpha)/3},set:function(t){this.vertex1.alpha=t,this.vertex2.alpha=t,this.vertex3.alpha=t}},depth:{get:function(){var t=this.vertex1,e=this.vertex2,i=this.vertex3;return(t.vz+e.vz+i.vz)/3}},destroy:function(){this.vertex1=null,this.vertex2=null,this.vertex3=null}});t.exports=a},99425:(t,e,i)=>{var s=i(18693),n=i(72632),r=i(16650),o=i(70015),a=i(85769),h=new o,l=new o,u=new r;t.exports=function(t){var e=n(t,"mesh"),i=n(t,"texture",null),r=n(t,"frame"),o=n(t,"width",1),c=n(t,"height",o),d=n(t,"widthSegments",1),p=n(t,"heightSegments",d),f=n(t,"x",0),v=n(t,"y",0),g=n(t,"z",0),m=n(t,"rotateX",0),y=n(t,"rotateY",0),x=n(t,"rotateZ",0),T=n(t,"zIsUp",!0),w=n(t,"isOrtho",!!e&&e.dirtyCache[11]),b=n(t,"colors",[16777215]),E=n(t,"alphas",[1]),S=n(t,"tile",!1),A=n(t,"flipY",!1),_=n(t,"width",null),C={faces:[],verts:[]};if(h.set(f,v,g),l.set(m,y,x),u.fromRotationXYTranslation(l,h,T),!i&&e)i=e.texture;else{if(!e||"string"!=typeof i)return C;i=e.scene.sys.textures.get(i)}var M=i.get(r);!_&&w&&i&&e&&(o=M.width/e.height,c=M.height/e.height);var R,P,O=o/2,L=c/2,F=Math.floor(d),D=Math.floor(p),k=F+1,I=D+1,B=o/F,N=c/D,Y=[],U=[],X=0,z=1,G=0,V=1;M&&(X=M.u0,z=M.u1,A?(G=M.v1,V=M.v0):(G=M.v0,V=M.v1));var W=z-X,H=V-G;for(P=0;P{var s=i(18693),n=i(16650),r=i(70015),o=i(85769),a=new r,h=new r,l=new n;t.exports=function(t,e,i,n,r,u,c,d,p,f){void 0===i&&(i=1),void 0===n&&(n=0),void 0===r&&(r=0),void 0===u&&(u=0),void 0===c&&(c=0),void 0===d&&(d=0),void 0===p&&(p=0),void 0===f&&(f=!0);var v={faces:[],verts:[]},g=t.materials;a.set(n,r,u),h.set(c,d,p),l.fromRotationXYTranslation(h,a,f);for(var m=0;m{var s=i(18693),n=i(85769);t.exports=function(t,e,i,r,o,a,h){if(void 0===r&&(r=!1),void 0===a&&(a=16777215),void 0===h&&(h=1),t.length===e.length){var l,u,c,d,p,f,v,g,m,y,x,T={faces:[],vertices:[]},w=r?3:2,b=Array.isArray(a),E=Array.isArray(h);if(Array.isArray(i)&&i.length>0)for(l=0;l{var e=!0,i="untitled",s="",n="";function r(t){var e=t.indexOf("#");return e>-1?t.substring(0,e):t}function o(t){return 0===t.models.length&&t.models.push({faces:[],name:i,textureCoords:[],vertexNormals:[],vertices:[]}),s="",t.models[t.models.length-1]}function a(t,e){var n=t.length>=2?t[1]:i;e.models.push({faces:[],name:n,textureCoords:[],vertexNormals:[],vertices:[]}),s=""}function h(t){2===t.length&&(s=t[1])}function l(t,e){var i=t.length,s=i>=2?parseFloat(t[1]):0,n=i>=3?parseFloat(t[2]):0,r=i>=4?parseFloat(t[3]):0;o(e).vertices.push({x:s,y:n,z:r})}function u(t,i){var s=t.length,n=s>=2?parseFloat(t[1]):0,r=s>=3?parseFloat(t[2]):0,a=s>=4?parseFloat(t[3]):0;isNaN(n)&&(n=0),isNaN(r)&&(r=0),isNaN(a)&&(a=0),e&&(r=1-r),o(i).textureCoords.push({u:n,v:r,w:a})}function c(t,e){var i=t.length,s=i>=2?parseFloat(t[1]):0,n=i>=3?parseFloat(t[2]):0,r=i>=4?parseFloat(t[3]):0;o(e).vertexNormals.push({x:s,y:n,z:r})}function d(t,e){var i=t.length-1;if(!(i<3)){for(var r={group:s,material:n,vertices:[]},a=0;a3)){var u=0,c=0,d=0;u=parseInt(h[0],10),l>1&&""!==h[1]&&(c=parseInt(h[1],10)),l>2&&(d=parseInt(h[2],10)),0!==u&&(u<0&&(u=o(e).vertices.length+1+u),c-=1,u-=1,d-=1,r.vertices.push({textureCoordsIndex:c,vertexIndex:u,vertexNormalIndex:d}))}}o(e).faces.push(r)}}function p(t,e){t.length>=2&&e.materialLibraries.push(t[1])}function f(t){t.length>=2&&(n=t[1])}t.exports=function(t,i){void 0===i&&(i=!0),e=i;var o={materials:{},materialLibraries:[],models:[]};s="",n="";for(var v=t.split("\n"),g=0;g{var s=i(22946);t.exports=function(t){for(var e={},i=t.split("\n"),n="",r=0;r=2?Math.floor(255*a[2]):h,u=a.length>=3?Math.floor(255*a[3]):h;e[n]=s(h,l,u)}}}return e}},15313:t=>{t.exports=function(t,e,i,s){var n,r;if(void 0===i&&void 0===s){var o=t.getInCenter();n=o.x,r=o.y}var a=Math.cos(e),h=Math.sin(e),l=t.vertex1,u=t.vertex2,c=t.vertex3,d=l.x-n,p=l.y-r;l.set(d*a-p*h+n,d*h+p*a+r),d=u.x-n,p=u.y-r,u.set(d*a-p*h+n,d*h+p*a+r),d=c.x-n,p=c.y-r,c.set(d*a-p*h+n,d*h+p*a+r)}},85769:(t,e,i)=>{var s=i(56694),n=i(75512),r=i(70015),o=new s({Extends:r,initialize:function(t,e,i,s,n,o,a,h,l,u){void 0===o&&(o=16777215),void 0===a&&(a=1),void 0===h&&(h=0),void 0===l&&(l=0),void 0===u&&(u=0),r.call(this,t,e,i),this.vx=0,this.vy=0,this.vz=0,this.nx=h,this.ny=l,this.nz=u,this.u=s,this.v=n,this.color=o,this.alpha=a,this.tx=0,this.ty=0,this.ta=0},setUVs:function(t,e){return this.u=t,this.v=e,this},transformCoordinatesLocal:function(t,e,i,s){var n=this.x,r=this.y,o=this.z,a=t.val,h=n*a[0]+r*a[4]+o*a[8]+a[12],l=n*a[1]+r*a[5]+o*a[9]+a[13],u=n*a[2]+r*a[6]+o*a[10]+a[14],c=n*a[3]+r*a[7]+o*a[11]+a[15];this.vx=h/c*e,this.vy=-l/c*i,this.vz=s<=0?u/c:-u/c},update:function(t,e,i,s,n,r,o,a){var h=this.vx*t+this.vy*i+n,l=this.vx*e+this.vy*s+r;return o&&(h=Math.round(h),l=Math.round(l)),this.tx=h,this.ty=l,this.ta=this.alpha*a,this},load:function(t,e,i,s,r){return t[++i]=this.tx,t[++i]=this.ty,t[++i]=this.u,t[++i]=this.v,t[++i]=s,t[++i]=r,e[++i]=n.getTintAppendFloatAlpha(this.color,this.ta),i}});t.exports=o},14293:(t,e,i)=>{var s={Face:i(18693),GenerateGridVerts:i(99425),GenerateObjVerts:i(53267),GenerateVerts:i(67623),ParseObj:i(27291),ParseObjMaterial:i(76799),RotateFace:i(15313),Vertex:i(85769)};t.exports=s},77601:t=>{t.exports=function(t){return t.setTo(Math.ceil(t.x),Math.ceil(t.y))}},38933:(t,e,i)=>{var s=i(79967);t.exports=function(t){return new s(t.x,t.y)}},47103:t=>{t.exports=function(t,e){return e.setTo(t.x,t.y)}},13625:t=>{t.exports=function(t,e){return t.x===e.x&&t.y===e.y}},12536:t=>{t.exports=function(t){return t.setTo(Math.floor(t.x),Math.floor(t.y))}},54205:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){if(void 0===e&&(e=new s),!Array.isArray(t))throw new Error("GetCentroid points argument must be an array");var i=t.length;if(i<1)throw new Error("GetCentroid points array must not be empty");if(1===i)e.x=t[0].x,e.y=t[0].y;else{for(var n=0;n{t.exports=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)}},82712:t=>{t.exports=function(t){return t.x*t.x+t.y*t.y}},20052:(t,e,i)=>{var s=i(74118);t.exports=function(t,e){void 0===e&&(e=new s);for(var i=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY,a=0;ai&&(i=h.x),h.xr&&(r=h.y),h.y{var s=i(79967);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=new s),n.x=t.x+(e.x-t.x)*i,n.y=t.y+(e.y-t.y)*i,n}},42397:t=>{t.exports=function(t){return t.setTo(t.y,t.x)}},59464:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.setTo(-t.x,-t.y)}},79967:(t,e,i)=>{var s=i(56694),n=i(52394),r=new s({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.type=n.POINT,this.x=t,this.y=e},setTo:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this}});t.exports=r},53581:(t,e,i)=>{var s=i(79967),n=i(82712);t.exports=function(t,e,i){void 0===i&&(i=new s);var r=(t.x*e.x+t.y*e.y)/n(e);return 0!==r&&(i.x=r*e.x,i.y=r*e.y),i}},50817:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=t.x*e.x+t.y*e.y;return 0!==n&&(i.x=n*e.x,i.y=n*e.y),i}},40525:(t,e,i)=>{var s=i(50083);t.exports=function(t,e){if(0!==t.x||0!==t.y){var i=s(t);t.x/=i,t.y/=i}return t.x*=e,t.y*=e,t}},63472:(t,e,i)=>{var s=i(79967);s.Ceil=i(77601),s.Clone=i(38933),s.CopyFrom=i(47103),s.Equals=i(13625),s.Floor=i(12536),s.GetCentroid=i(54205),s.GetMagnitude=i(50083),s.GetMagnitudeSq=i(82712),s.GetRectangleFromPoints=i(20052),s.Interpolate=i(77154),s.Invert=i(42397),s.Negative=i(59464),s.Project=i(53581),s.ProjectUnit=i(50817),s.SetMagnitude=i(40525),t.exports=s},19631:(t,e,i)=>{var s=i(8580);t.exports=function(t){return new s(t.points)}},45604:t=>{t.exports=function(t,e,i){for(var s=!1,n=-1,r=t.points.length-1;++n{var s=i(45604);t.exports=function(t,e){return s(t,e.x,e.y)}},11117:t=>{"use strict";function e(t,e,r){r=r||2;var o,a,h,c,d,f,v,g=e&&e.length,m=g?e[0]*r:t.length,y=i(t,0,m,r,!0),x=[];if(!y||y.next===y.prev)return x;if(g&&(y=function(t,e,n,r){var o,a,h,c=[];for(o=0,a=e.length;o80*r){o=h=t[0],a=c=t[1];for(var T=r;Th&&(h=d),f>c&&(c=f);v=0!==(v=Math.max(h-o,c-a))?1/v:0}return n(y,x,r,o,a,v),x}function i(t,e,i,s,n){var r,o;if(n===_(t,e,i,s)>0)for(r=e;r=e;r-=s)o=E(r,t[r],t[r+1],o);return o&&m(o,o.next)&&(S(o),o=o.next),o}function s(t,e){if(!t)return t;e||(e=t);var i,s=t;do{if(i=!1,s.steiner||!m(s,s.next)&&0!==g(s.prev,s,s.next))s=s.next;else{if(S(s),(s=e=s.prev)===s.next)break;i=!0}}while(i||s!==e);return e}function n(t,e,i,l,u,c,p){if(t){!p&&c&&function(t,e,i,s){var n=t;do{null===n.z&&(n.z=d(n.x,n.y,e,i,s)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){var e,i,s,n,r,o,a,h,l=1;do{for(i=t,t=null,r=null,o=0;i;){for(o++,s=i,a=0,e=0;e0||h>0&&s;)0!==a&&(0===h||!s||i.z<=s.z)?(n=i,i=i.nextZ,a--):(n=s,s=s.nextZ,h--),r?r.nextZ=n:t=n,n.prevZ=r,r=n;i=s}r.nextZ=null,l*=2}while(o>1)}(n)}(t,l,u,c);for(var f,v,g=t;t.prev!==t.next;)if(f=t.prev,v=t.next,c?o(t,l,u,c):r(t))e.push(f.i/i),e.push(t.i/i),e.push(v.i/i),S(t),t=v.next,g=v.next;else if((t=v)===g){p?1===p?n(t=a(s(t),e,i),e,i,l,u,c,2):2===p&&h(t,e,i,l,u,c):n(s(t),e,i,l,u,c,1);break}}}function r(t){var e=t.prev,i=t,s=t.next;if(g(e,i,s)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(f(e.x,e.y,i.x,i.y,s.x,s.y,n.x,n.y)&&g(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function o(t,e,i,s){var n=t.prev,r=t,o=t.next;if(g(n,r,o)>=0)return!1;for(var a=n.xr.x?n.x>o.x?n.x:o.x:r.x>o.x?r.x:o.x,u=n.y>r.y?n.y>o.y?n.y:o.y:r.y>o.y?r.y:o.y,c=d(a,h,e,i,s),p=d(l,u,e,i,s),v=t.prevZ,m=t.nextZ;v&&v.z>=c&&m&&m.z<=p;){if(v!==t.prev&&v!==t.next&&f(n.x,n.y,r.x,r.y,o.x,o.y,v.x,v.y)&&g(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,m!==t.prev&&m!==t.next&&f(n.x,n.y,r.x,r.y,o.x,o.y,m.x,m.y)&&g(m.prev,m,m.next)>=0)return!1;m=m.nextZ}for(;v&&v.z>=c;){if(v!==t.prev&&v!==t.next&&f(n.x,n.y,r.x,r.y,o.x,o.y,v.x,v.y)&&g(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;m&&m.z<=p;){if(m!==t.prev&&m!==t.next&&f(n.x,n.y,r.x,r.y,o.x,o.y,m.x,m.y)&&g(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function a(t,e,i){var n=t;do{var r=n.prev,o=n.next.next;!m(r,o)&&y(r,n,n.next,o)&&w(r,o)&&w(o,r)&&(e.push(r.i/i),e.push(n.i/i),e.push(o.i/i),S(n),S(n.next),n=t=o),n=n.next}while(n!==t);return s(n)}function h(t,e,i,r,o,a){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&v(h,l)){var u=b(h,l);return h=s(h,h.next),u=s(u,u.next),n(h,e,i,r,o,a),void n(u,e,i,r,o,a)}l=l.next}h=h.next}while(h!==t)}function l(t,e){return t.x-e.x}function u(t,e){if(e=function(t,e){var i,s=e,n=t.x,r=t.y,o=-1/0;do{if(r<=s.y&&r>=s.next.y&&s.next.y!==s.y){var a=s.x+(r-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(a<=n&&a>o){if(o=a,a===n){if(r===s.y)return s;if(r===s.next.y)return s.next}i=s.x=s.x&&s.x>=u&&n!==s.x&&f(ri.x||s.x===i.x&&c(i,s)))&&(i=s,p=h)),s=s.next}while(s!==l);return i}(t,e),e){var i=b(e,t);s(e,e.next),s(i,i.next)}}function c(t,e){return g(t.prev,t,e.prev)<0&&g(e.next,t,t.next)<0}function d(t,e,i,s,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-s)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p(t){var e=t,i=t;do{(e.x=0&&(t-o)*(s-a)-(i-o)*(e-a)>=0&&(i-o)*(r-a)-(n-o)*(s-a)>=0}function v(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&y(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(w(t,e)&&w(e,t)&&function(t,e){var i=t,s=!1,n=(t.x+e.x)/2,r=(t.y+e.y)/2;do{i.y>r!=i.next.y>r&&i.next.y!==i.y&&n<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(s=!s),i=i.next}while(i!==t);return s}(t,e)&&(g(t.prev,t,e.prev)||g(t,e.prev,e))||m(t,e)&&g(t.prev,t,t.next)>0&&g(e.prev,e,e.next)>0)}function g(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function m(t,e){return t.x===e.x&&t.y===e.y}function y(t,e,i,s){var n=T(g(t,e,i)),r=T(g(t,e,s)),o=T(g(i,s,t)),a=T(g(i,s,e));return n!==r&&o!==a||(!(0!==n||!x(t,i,e))||(!(0!==r||!x(t,s,e))||(!(0!==o||!x(i,t,s))||!(0!==a||!x(i,e,s)))))}function x(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function T(t){return t>0?1:t<0?-1:0}function w(t,e){return g(t.prev,t,t.next)<0?g(t,e,t.next)>=0&&g(t,t.prev,e)>=0:g(t,e,t.prev)<0||g(t,t.next,e)<0}function b(t,e){var i=new A(t.i,t.x,t.y),s=new A(e.i,e.x,e.y),n=t.next,r=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,s.next=i,i.prev=s,r.next=s,s.prev=r,s}function E(t,e,i,s){var n=new A(t,e,i);return s?(n.next=s.next,n.prev=s,s.next.prev=n,s.next=n):(n.prev=n,n.next=n),n}function S(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function A(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function _(t,e,i,s){for(var n=0,r=e,o=i-s;r0&&(s+=t[n-1].length,i.holes.push(s))}return i},t.exports=e},14045:(t,e,i)=>{var s=i(74118);t.exports=function(t,e){void 0===e&&(e=new s);for(var i,n=1/0,r=1/0,o=-n,a=-r,h=0;h{t.exports=function(t,e){void 0===e&&(e=[]);for(var i=0;i{var s=i(16028),n=i(88829),r=i(5159);t.exports=function(t,e,i,o){void 0===o&&(o=[]);var a=t.points,h=r(t);!e&&i>0&&(e=h/i);for(var l=0;lc+g)){var m=v.getPoint((u-c)/g);o.push(m);break}c+=g}return o}},5159:(t,e,i)=>{var s=i(16028),n=i(88829);t.exports=function(t){for(var e=t.points,i=0,r=0;r{var s=i(56694),n=i(45604),r=i(89294),o=i(52394),a=new s({initialize:function(t){this.type=o.POLYGON,this.area=0,this.points=[],t&&this.setTo(t)},contains:function(t,e){return n(this,t,e)},setTo:function(t){if(this.area=0,this.points=[],"string"==typeof t&&(t=t.split(" ")),!Array.isArray(t))return this;for(var e,i=Number.MAX_VALUE,s=0;s{t.exports=function(t){return t.points.reverse(),t}},95874:t=>{function e(t,e,i){var s=e.x,n=e.y,r=i.x-s,o=i.y-n;if(0!==r||0!==o){var a=((t.x-s)*r+(t.y-n)*o)/(r*r+o*o);a>1?(s=i.x,n=i.y):a>0&&(s+=r*a,n+=o*a)}return(r=t.x-s)*r+(o=t.y-n)*o}function i(t,s,n,r,o){for(var a,h=r,l=s+1;lh&&(a=l,h=u)}h>r&&(a-s>1&&i(t,s,a,r,o),o.push(t[a]),n-a>1&&i(t,a,n,r,o))}function s(t,e){var s=t.length-1,n=[t[0]];return i(t,0,s,e,n),n.push(t[s]),n}t.exports=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=!1);var n=t.points;if(n.length>2){var r=e*e;i||(n=function(t,e){for(var i,s,n,r,o,a=t[0],h=[a],l=1,u=t.length;le&&(h.push(i),a=i);return a!==i&&h.push(i),h}(n,r)),t.setTo(s(n,r))}return t}},18974:t=>{var e=function(t,e){return t[0]=e[0],t[1]=e[1],t};t.exports=function(t){var i,s=[],n=t.points;for(i=0;i0&&r.push(e([0,0],s[0])),i=0;i1&&r.push(e([0,0],s[s.length-1])),t.setTo(r)}},23490:t=>{t.exports=function(t,e,i){for(var s=t.points,n=0;n{var s=i(8580);s.Clone=i(19631),s.Contains=i(45604),s.ContainsPoint=i(87289),s.Earcut=i(11117),s.GetAABB=i(14045),s.GetNumberArray=i(98286),s.GetPoints=i(89294),s.Perimeter=i(5159),s.Reverse=i(32244),s.Simplify=i(95874),s.Smooth=i(18974),s.Translate=i(23490),t.exports=s},1653:t=>{t.exports=function(t){return t.width*t.height}},33943:t=>{t.exports=function(t){return t.x=Math.ceil(t.x),t.y=Math.ceil(t.y),t}},58662:t=>{t.exports=function(t){return t.x=Math.ceil(t.x),t.y=Math.ceil(t.y),t.width=Math.ceil(t.width),t.height=Math.ceil(t.height),t}},79993:t=>{t.exports=function(t,e,i){return t.x=e-t.width/2,t.y=i-t.height/2,t}},81572:(t,e,i)=>{var s=i(74118);t.exports=function(t){return new s(t.x,t.y,t.width,t.height)}},94287:t=>{t.exports=function(t,e,i){return!(t.width<=0||t.height<=0)&&(t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i)}},28687:(t,e,i)=>{var s=i(94287);t.exports=function(t,e){return s(t,e.x,e.y)}},73222:t=>{t.exports=function(t,e){return!(e.width*e.height>t.width*t.height)&&(e.x>t.x&&e.xt.x&&e.rightt.y&&e.yt.y&&e.bottom{t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},87279:t=>{t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x,y:t.y}),e.push({x:t.right,y:t.y}),e.push({x:t.right,y:t.bottom}),e.push({x:t.x,y:t.bottom}),e}},19989:t=>{t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},92628:(t,e,i)=>{var s=i(6700);t.exports=function(t,e){var i=s(t);return i{var s=i(6700);t.exports=function(t,e){var i=s(t);return i>s(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},71356:t=>{t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t}},21687:t=>{t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height),t}},80222:(t,e,i)=>{var s=i(74118),n=i(83392);t.exports=function(t,e){if(void 0===e&&(e=new s),0===t.length)return e;for(var i,r,o,a=Number.MAX_VALUE,h=Number.MAX_VALUE,l=n.MIN_SAFE_INTEGER,u=n.MIN_SAFE_INTEGER,c=0;c{var s=i(74118);t.exports=function(t,e,i,n,r){return void 0===r&&(r=new s),r.setTo(Math.min(t,i),Math.min(e,n),Math.abs(t-i),Math.abs(e-n))}},6700:t=>{t.exports=function(t){return 0===t.height?NaN:t.width/t.height}},35242:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.centerX,e.y=t.centerY,e}},47698:(t,e,i)=>{var s=i(85876),n=i(79967);t.exports=function(t,e,i){if(void 0===i&&(i=new n),e<=0||e>=1)return i.x=t.x,i.y=t.y,i;var r=s(t)*e;return e>.5?(r-=t.width+t.height)<=t.width?(i.x=t.right-r,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(r-t.width)):r<=t.width?(i.x=t.x+r,i.y=t.y):(i.x=t.right,i.y=t.y+(r-t.width)),i}},54932:(t,e,i)=>{var s=i(47698),n=i(85876);t.exports=function(t,e,i,r){void 0===r&&(r=[]),!e&&i>0&&(e=n(t)/i);for(var o=0;o{var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.width,e.y=t.height,e}},7782:(t,e,i)=>{var s=i(79993);t.exports=function(t,e,i){var n=t.centerX,r=t.centerY;return t.setSize(t.width+2*e,t.height+2*i),s(t,n,r)}},66217:(t,e,i)=>{var s=i(74118),n=i(90205);t.exports=function(t,e,i){return void 0===i&&(i=new s),n(t,e)?(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y):i.setEmpty(),i}},40053:(t,e,i)=>{var s=i(85876),n=i(79967);t.exports=function(t,e,i,r){if(void 0===r&&(r=[]),!e&&!i)return r;e?i=Math.round(s(t)/e):e=s(t)/i;for(var o=t.x,a=t.y,h=0,l=0;l=t.right&&(h=1,a+=o-t.right,o=t.right);break;case 1:(a+=e)>=t.bottom&&(h=2,o-=a-t.bottom,a=t.bottom);break;case 2:(o-=e)<=t.left&&(h=3,a-=t.left-o,o=t.left);break;case 3:(a-=e)<=t.top&&(h=0,a=t.top)}return r}},86673:t=>{t.exports=function(t,e){for(var i=t.x,s=t.right,n=t.y,r=t.bottom,o=0;o{t.exports=function(t,e){var i=Math.min(t.x,e.x),s=Math.max(t.right,e.right);t.x=i,t.width=s-i;var n=Math.min(t.y,e.y),r=Math.max(t.bottom,e.bottom);return t.y=n,t.height=r-n,t}},44755:t=>{t.exports=function(t,e,i){var s=Math.min(t.x,e),n=Math.max(t.right,e);t.x=s,t.width=n-s;var r=Math.min(t.y,i),o=Math.max(t.bottom,i);return t.y=r,t.height=o-r,t}},74466:t=>{t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},55946:t=>{t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},97474:t=>{t.exports=function(t,e){return t.xe.x&&t.ye.y}},85876:t=>{t.exports=function(t){return 2*(t.width+t.height)}},20243:(t,e,i)=>{var s=i(79967),n=i(75606);t.exports=function(t,e,i){void 0===i&&(i=new s),e=n(e);var r=Math.sin(e),o=Math.cos(e),a=o>0?t.width/2:t.width/-2,h=r>0?t.height/2:t.height/-2;return Math.abs(a*r){var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.x+Math.random()*t.width,e.y=t.y+Math.random()*t.height,e}},97691:(t,e,i)=>{var s=i(17489),n=i(73222),r=i(79967);t.exports=function(t,e,i){if(void 0===i&&(i=new r),n(t,e))switch(s(0,3)){case 0:i.x=t.x+Math.random()*(e.right-t.x),i.y=t.y+Math.random()*(e.top-t.y);break;case 1:i.x=e.x+Math.random()*(t.right-e.x),i.y=e.bottom+Math.random()*(t.bottom-e.bottom);break;case 2:i.x=t.x+Math.random()*(e.x-t.x),i.y=e.y+Math.random()*(t.bottom-e.y);break;case 3:i.x=e.right+Math.random()*(t.right-e.right),i.y=t.y+Math.random()*(e.bottom-t.y)}return i}},74118:(t,e,i)=>{var s=i(56694),n=i(94287),r=i(47698),o=i(54932),a=i(52394),h=i(88829),l=i(30001),u=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.type=a.RECTANGLE,this.x=t,this.y=e,this.width=i,this.height=s},contains:function(t,e){return n(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.y,this.right,this.y),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.y,this.right,this.bottom),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.bottom,this.x,this.bottom),t},getLineD:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.bottom,this.x,this.y),t},left:{get:function(){return this.x},set:function(t){t>=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=u},51828:t=>{t.exports=function(t,e){return t.width===e.width&&t.height===e.height}},5691:t=>{t.exports=function(t,e,i){return void 0===i&&(i=e),t.width*=e,t.height*=i,t}},58795:(t,e,i)=>{var s=i(74118);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=Math.min(t.x,e.x),r=Math.min(t.y,e.y),o=Math.max(t.right,e.right)-n,a=Math.max(t.bottom,e.bottom)-r;return i.setTo(n,r,o,a)}},66658:(t,e,i)=>{var s=i(74118);s.Area=i(1653),s.Ceil=i(33943),s.CeilAll=i(58662),s.CenterOn=i(79993),s.Clone=i(81572),s.Contains=i(94287),s.ContainsPoint=i(28687),s.ContainsRect=i(73222),s.CopyFrom=i(29538),s.Decompose=i(87279),s.Equals=i(19989),s.FitInside=i(92628),s.FitOutside=i(85028),s.Floor=i(71356),s.FloorAll=i(21687),s.FromPoints=i(80222),s.FromXY=i(75785),s.GetAspectRatio=i(6700),s.GetCenter=i(35242),s.GetPoint=i(47698),s.GetPoints=i(54932),s.GetSize=i(31591),s.Inflate=i(7782),s.Intersection=i(66217),s.MarchingAnts=i(40053),s.MergePoints=i(86673),s.MergeRect=i(14655),s.MergeXY=i(44755),s.Offset=i(74466),s.OffsetPoint=i(55946),s.Overlaps=i(97474),s.Perimeter=i(85876),s.PerimeterPoint=i(20243),s.Random=i(30001),s.RandomOutside=i(97691),s.SameDimensions=i(51828),s.Scale=i(5691),s.Union=i(58795),t.exports=s},19108:t=>{t.exports=function(t){var e=t.x1,i=t.y1,s=t.x2,n=t.y2,r=t.x3,o=t.y3;return Math.abs(((r-e)*(n-i)-(s-e)*(o-i))/2)}},41199:(t,e,i)=>{var s=i(66349);t.exports=function(t,e,i){var n=i*(Math.sqrt(3)/2);return new s(t,e,t+i/2,e+n,t-i/2,e+n)}},88730:(t,e,i)=>{var s=i(11117),n=i(66349);t.exports=function(t,e,i,r,o){void 0===e&&(e=null),void 0===i&&(i=1),void 0===r&&(r=1),void 0===o&&(o=[]);for(var a,h,l,u,c,d,p,f,v,g=s(t,e),m=0;m{var s=i(66349);t.exports=function(t,e,i,n){return void 0===n&&(n=i),new s(t,e,t,e-n,t+i,e)}},1882:(t,e,i)=>{var s=i(56595),n=i(9640);t.exports=function(t,e,i,r){void 0===r&&(r=s);var o=r(t),a=e-o.x,h=i-o.y;return n(t,a,h)}},56595:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=(t.x1+t.x2+t.x3)/3,e.y=(t.y1+t.y2+t.y3)/3,e}},91835:(t,e,i)=>{var s=i(93736);function n(t,e,i,s){return t*s-e*i}t.exports=function(t,e){void 0===e&&(e=new s);var i=t.x3,r=t.y3,o=t.x1-i,a=t.y1-r,h=t.x2-i,l=t.y2-r,u=2*n(o,a,h,l),c=n(a,o*o+a*a,l,h*h+l*l),d=n(o,o*o+a*a,h,h*h+l*l);return e.x=i-c/u,e.y=r+d/u,e}},97073:(t,e,i)=>{var s=i(26673);t.exports=function(t,e){void 0===e&&(e=new s);var i,n,r=t.x1,o=t.y1,a=t.x2,h=t.y2,l=t.x3,u=t.y3,c=a-r,d=h-o,p=l-r,f=u-o,v=c*(r+a)+d*(o+h),g=p*(r+l)+f*(o+u),m=2*(c*(u-h)-d*(l-a));if(Math.abs(m)<1e-6){var y=Math.min(r,a,l),x=Math.min(o,h,u);i=.5*(Math.max(r,a,l)-y),n=.5*(Math.max(o,h,u)-x),e.x=y+i,e.y=x+n,e.radius=Math.sqrt(i*i+n*n)}else e.x=(f*v-d*g)/m,e.y=(c*g-p*v)/m,i=e.x-r,n=e.y-o,e.radius=Math.sqrt(i*i+n*n);return e}},75974:(t,e,i)=>{var s=i(66349);t.exports=function(t){return new s(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}},60689:t=>{t.exports=function(t,e,i){var s=t.x3-t.x1,n=t.y3-t.y1,r=t.x2-t.x1,o=t.y2-t.y1,a=e-t.x1,h=i-t.y1,l=s*s+n*n,u=s*r+n*o,c=s*a+n*h,d=r*r+o*o,p=r*a+o*h,f=l*d-u*u,v=0===f?0:1/f,g=(d*c-u*p)*v,m=(l*p-u*c)*v;return g>=0&&m>=0&&g+m<1}},86875:t=>{t.exports=function(t,e,i,s){void 0===i&&(i=!1),void 0===s&&(s=[]);for(var n,r,o,a,h,l,u=t.x3-t.x1,c=t.y3-t.y1,d=t.x2-t.x1,p=t.y2-t.y1,f=u*u+c*c,v=u*d+c*p,g=d*d+p*p,m=f*g-v*v,y=0===m?0:1/m,x=t.x1,T=t.y1,w=0;w=0&&r>=0&&n+r<1&&(s.push({x:e[w].x,y:e[w].y}),i)));w++);return s}},51532:(t,e,i)=>{var s=i(60689);t.exports=function(t,e){return s(t,e.x,e.y)}},42538:t=>{t.exports=function(t,e){return e.setTo(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}},18680:t=>{t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x1,y:t.y1}),e.push({x:t.x2,y:t.y2}),e.push({x:t.x3,y:t.y3}),e}},29977:t=>{t.exports=function(t,e){return t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2&&t.x3===e.x3&&t.y3===e.y3}},56088:(t,e,i)=>{var s=i(79967),n=i(16028);t.exports=function(t,e,i){void 0===i&&(i=new s);var r=t.getLineA(),o=t.getLineB(),a=t.getLineC();if(e<=0||e>=1)return i.x=r.x1,i.y=r.y1,i;var h=n(r),l=n(o),u=n(a),c=(h+l+u)*e,d=0;return ch+l?(d=(c-=h+l)/u,i.x=a.x1+(a.x2-a.x1)*d,i.y=a.y1+(a.y2-a.y1)*d):(d=(c-=h)/l,i.x=o.x1+(o.x2-o.x1)*d,i.y=o.y1+(o.y2-o.y1)*d),i}},24402:(t,e,i)=>{var s=i(16028),n=i(79967);t.exports=function(t,e,i,r){void 0===r&&(r=[]);var o=t.getLineA(),a=t.getLineB(),h=t.getLineC(),l=s(o),u=s(a),c=s(h),d=l+u+c;!e&&i>0&&(e=d/i);for(var p=0;pl+u?(v=(f-=l+u)/c,g.x=h.x1+(h.x2-h.x1)*v,g.y=h.y1+(h.y2-h.y1)*v):(v=(f-=l)/u,g.x=a.x1+(a.x2-a.x1)*v,g.y=a.y1+(a.y2-a.y1)*v),r.push(g)}return r}},83648:(t,e,i)=>{var s=i(79967);function n(t,e,i,s){var n=t-i,r=e-s,o=n*n+r*r;return Math.sqrt(o)}t.exports=function(t,e){void 0===e&&(e=new s);var i=t.x1,r=t.y1,o=t.x2,a=t.y2,h=t.x3,l=t.y3,u=n(h,l,o,a),c=n(i,r,h,l),d=n(o,a,i,r),p=u+c+d;return e.x=(i*u+o*c+h*d)/p,e.y=(r*u+a*c+l*d)/p,e}},9640:t=>{t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t.x3+=e,t.y3+=i,t}},95290:(t,e,i)=>{var s=i(16028);t.exports=function(t){var e=t.getLineA(),i=t.getLineB(),n=t.getLineC();return s(e)+s(i)+s(n)}},99761:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){void 0===e&&(e=new s);var i=t.x2-t.x1,n=t.y2-t.y1,r=t.x3-t.x1,o=t.y3-t.y1,a=Math.random(),h=Math.random();return a+h>=1&&(a=1-a,h=1-h),e.x=t.x1+(i*a+r*h),e.y=t.y1+(n*a+o*h),e}},21934:(t,e,i)=>{var s=i(19211),n=i(83648);t.exports=function(t,e){var i=n(t);return s(t,i.x,i.y,e)}},68454:(t,e,i)=>{var s=i(19211);t.exports=function(t,e,i){return s(t,e.x,e.y,i)}},19211:t=>{t.exports=function(t,e,i,s){var n=Math.cos(s),r=Math.sin(s),o=t.x1-e,a=t.y1-i;return t.x1=o*n-a*r+e,t.y1=o*r+a*n+i,o=t.x2-e,a=t.y2-i,t.x2=o*n-a*r+e,t.y2=o*r+a*n+i,o=t.x3-e,a=t.y3-i,t.x3=o*n-a*r+e,t.y3=o*r+a*n+i,t}},66349:(t,e,i)=>{var s=i(56694),n=i(60689),r=i(56088),o=i(24402),a=i(52394),h=i(88829),l=i(99761),u=new s({initialize:function(t,e,i,s,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=0),this.type=a.TRIANGLE,this.x1=t,this.y1=e,this.x2=i,this.y2=s,this.x3=n,this.y3=r},contains:function(t,e){return n(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,s,n,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=0),this.x1=t,this.y1=e,this.x2=i,this.y2=s,this.x3=n,this.y3=r,this},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x1,this.y1,this.x2,this.y2),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.x2,this.y2,this.x3,this.y3),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.x3,this.y3,this.x1,this.y1),t},left:{get:function(){return Math.min(this.x1,this.x2,this.x3)},set:function(t){var e=0;e=this.x1<=this.x2&&this.x1<=this.x3?this.x1-t:this.x2<=this.x1&&this.x2<=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},right:{get:function(){return Math.max(this.x1,this.x2,this.x3)},set:function(t){var e=0;e=this.x1>=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=u},87619:(t,e,i)=>{var s=i(66349);s.Area=i(19108),s.BuildEquilateral=i(41199),s.BuildFromPolygon=i(88730),s.BuildRight=i(3635),s.CenterOn=i(1882),s.Centroid=i(56595),s.CircumCenter=i(91835),s.CircumCircle=i(97073),s.Clone=i(75974),s.Contains=i(60689),s.ContainsArray=i(86875),s.ContainsPoint=i(51532),s.CopyFrom=i(42538),s.Decompose=i(18680),s.Equals=i(29977),s.GetPoint=i(56088),s.GetPoints=i(24402),s.InCenter=i(83648),s.Perimeter=i(95290),s.Offset=i(9640),s.Random=i(99761),s.Rotate=i(21934),s.RotateAroundPoint=i(68454),s.RotateAroundXY=i(19211),t.exports=s},27395:t=>{t.exports=function(t,e,i){return{gameObject:t,enabled:!0,alwaysEnabled:!1,draggable:!1,dropZone:!1,cursor:!1,target:null,camera:null,hitArea:e,hitAreaCallback:i,hitAreaDebug:null,customHitArea:!1,localX:0,localY:0,dragState:0,dragStartX:0,dragStartY:0,dragStartXGlobal:0,dragStartYGlobal:0,dragX:0,dragY:0}}},18104:t=>{t.exports=function(t,e){return function(i,s,n,r){var o=t.getPixelAlpha(s,n,r.texture.key,r.frame.name);return o&&o>=e}}},69898:(t,e,i)=>{var s=i(56694),n=i(72687),r=i(6659),o=i(33963),a=i(97081),h=i(71064),l=i(7905),u=i(40398),c=i(37579),d=i(69360),p=i(64462),f=new s({initialize:function(t,e){this.game=t,this.scaleManager,this.canvas,this.config=e,this.enabled=!0,this.events=new r,this.isOver=!0,this.defaultCursor="",this.keyboard=e.inputKeyboard?new h(this):null,this.mouse=e.inputMouse?new l(this):null,this.touch=e.inputTouch?new c(this):null,this.pointers=[],this.pointersTotal=e.inputActivePointers,e.inputTouch&&1===this.pointersTotal&&(this.pointersTotal=2);for(var i=0;i<=this.pointersTotal;i++){var s=new u(this,i);s.smoothFactor=e.inputSmoothFactor,this.pointers.push(s)}this.mousePointer=e.inputMouse?this.pointers[0]:null,this.activePointer=this.pointers[0],this.globalTopOnly=!0,this.time=0,this._tempPoint={x:0,y:0},this._tempHitTest=[],this._tempMatrix=new d,this._tempMatrix2=new d,this._tempSkip=!1,this.mousePointerContainer=[this.mousePointer],t.events.once(a.BOOT,this.boot,this)},boot:function(){this.canvas=this.game.canvas,this.scaleManager=this.game.scale,this.events.emit(o.MANAGER_BOOT),this.game.events.on(a.PRE_RENDER,this.preRender,this),this.game.events.once(a.DESTROY,this.destroy,this)},setCanvasOver:function(t){this.isOver=!0,this.events.emit(o.GAME_OVER,t)},setCanvasOut:function(t){this.isOver=!1,this.events.emit(o.GAME_OUT,t)},preRender:function(){var t=this.game.loop.now,e=this.game.loop.delta,i=this.game.scene.getScenes(!0,!0);this.time=t,this.events.emit(o.MANAGER_UPDATE);for(var s=0;s10&&(t=10-this.pointersTotal);for(var i=0;i{var s=i(26673),n=i(65650),r=i(56694),o=i(72687),a=i(27395),h=i(18104),l=i(53996),u=i(95669),c=i(72313),d=i(33963),p=i(6659),f=i(72632),v=i(52394),g=i(63399),m=i(42911),y=i(91963),x=i(74118),T=i(94287),w=i(7599),b=i(66349),E=i(60689),S=new r({Extends:p,initialize:function(t){p.call(this),this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.manager=t.sys.game.input,this.pluginEvents=new p,this.enabled=!0,this.displayList,this.cameras,g.install(this),this.mouse=this.manager.mouse,this.topOnly=!0,this.pollRate=-1,this._pollTimer=0;var e={cancelled:!1};this._eventContainer={stopPropagation:function(){e.cancelled=!0}},this._eventData=e,this.dragDistanceThreshold=0,this.dragTimeThreshold=0,this._temp=[],this._tempZones=[],this._list=[],this._pendingInsertion=[],this._pendingRemoval=[],this._draggable=[],this._drag={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._dragState=[],this._over={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._validTypes=["onDown","onUp","onOver","onOut","onMove","onDragStart","onDrag","onDragEnd","onDragEnter","onDragLeave","onDragOver","onDrop"],this._updatedThisFrame=!1,t.sys.events.once(w.BOOT,this.boot,this),t.sys.events.on(w.START,this.start,this)},boot:function(){this.cameras=this.systems.cameras,this.displayList=this.systems.displayList,this.systems.events.once(w.DESTROY,this.destroy,this),this.pluginEvents.emit(d.BOOT)},start:function(){var t=this.systems.events;t.on(w.TRANSITION_START,this.transitionIn,this),t.on(w.TRANSITION_OUT,this.transitionOut,this),t.on(w.TRANSITION_COMPLETE,this.transitionComplete,this),t.on(w.PRE_UPDATE,this.preUpdate,this),t.once(w.SHUTDOWN,this.shutdown,this),this.manager.events.on(d.GAME_OUT,this.onGameOut,this),this.manager.events.on(d.GAME_OVER,this.onGameOver,this),this.enabled=!0,this._dragState=[0,0,0,0,0,0,0,0,0,0],this.pluginEvents.emit(d.START)},onGameOver:function(t){this.isActive()&&this.emit(d.GAME_OVER,t.timeStamp,t)},onGameOut:function(t){this.isActive()&&this.emit(d.GAME_OUT,t.timeStamp,t)},preUpdate:function(){this.pluginEvents.emit(d.PRE_UPDATE);var t=this._pendingRemoval,e=this._pendingInsertion,i=t.length,s=e.length;if(0!==i||0!==s){for(var n=this._list,r=0;r-1&&(n.splice(a,1),this.clear(o,!0))}t.length=0,this._pendingRemoval.length=0,this._list=n.concat(e.splice(0))}},isActive:function(){return this.enabled&&this.scene.sys.isActive()},updatePoll:function(t,e){if(!this.isActive())return!1;if(this.pluginEvents.emit(d.UPDATE,t,e),this._updatedThisFrame)return this._updatedThisFrame=!1,!1;var i,s=this.manager,n=s.pointers,r=s.pointersTotal;for(i=0;i0){if(this._pollTimer-=e,!(this._pollTimer<0))return!1;this._pollTimer=this.pollRate}var a=!1;for(i=0;i0&&(a=!0)}return a},update:function(t,e){if(!this.isActive())return!1;for(var i=e.length,s=!1,n=0;n0&&(s=!0)}return this._updatedThisFrame=!0,s},clear:function(t,e){void 0===e&&(e=!1);var i=t.input;if(i){e||this.queueForRemoval(t),i.gameObject=void 0,i.target=void 0,i.hitArea=void 0,i.hitAreaCallback=void 0,i.callbackContext=void 0,t.input=null;var s=this._draggable.indexOf(t);return s>-1&&this._draggable.splice(s,1),(s=this._drag[0].indexOf(t))>-1&&this._drag[0].splice(s,1),(s=this._over[0].indexOf(t))>-1&&(this._over[0].splice(s,1),this.manager.resetCursor(i)),t}},disable:function(t){t.input.enabled=!1},enable:function(t,e,i,s){return void 0===s&&(s=!1),t.input?t.input.enabled=!0:this.setHitArea(t,e,i),t.input&&s&&!t.input.dropZone&&(t.input.dropZone=s),this},hitTestPointer:function(t){for(var e=this.cameras.getCamerasBelowPointer(t),i=0;i0)return t.camera=s,n}return t.camera=e[0],[]},processDownEvents:function(t){var e=0,i=this._temp,s=this._eventData,n=this._eventContainer;s.cancelled=!1;for(var r=!1,o=0;o0&&l(t.x,t.y,t.downX,t.downY)>=n||s>0&&e>=t.downTime+s)&&(i=!0),i)return this.setDragState(t,3),this.processDragStartList(t)},processDragStartList:function(t){if(3!==this.getDragState(t))return 0;for(var e=this._drag[t.id],i=0;i1&&(this.sortGameObjects(i,t),this.topOnly&&i.splice(1)),this._drag[t.id]=i,0===this.dragDistanceThreshold&&0===this.dragTimeThreshold?(this.setDragState(t,3),this.processDragStartList(t)):(this.setDragState(t,2),0))},processDragMoveEvent:function(t){if(2===this.getDragState(t)&&this.processDragThresholdEvent(t,this.manager.game.loop.now),4!==this.getDragState(t))return 0;for(var e=this._tempZones,i=this._drag[t.id],s=0;s0?(o.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,o,h),a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h)):(o.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,o,h),e[0]?(a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h)):a.target=null)}else!h&&e[0]&&(a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h));if(o.parentContainer){var u=t.worldX-a.dragStartXGlobal,c=t.worldY-a.dragStartYGlobal,p=o.getParentRotation(),f=u*Math.cos(p)+c*Math.sin(p),v=c*Math.cos(p)-u*Math.sin(p);f*=1/o.parentContainer.scaleX,v*=1/o.parentContainer.scaleY,n=f+a.dragStartX,r=v+a.dragStartY}else n=t.worldX-a.dragX,r=t.worldY-a.dragY;o.emit(d.GAMEOBJECT_DRAG,t,n,r),this.emit(d.DRAG,t,o,n,r)}return i.length},processDragUpEvent:function(t){for(var e=this._drag[t.id],i=0;i0){var r=this.manager,o=this._eventData,a=this._eventContainer;o.cancelled=!1;for(var h=!1,l=0;l0){var n=this.manager,r=this._eventData,o=this._eventContainer;r.cancelled=!1;var a=!1;this.sortGameObjects(e,t);for(var h=0;h0){for(this.sortGameObjects(n,t),e=0;e0){for(this.sortGameObjects(r,t),e=0;e-1&&this._draggable.splice(n,1)}return this},makePixelPerfect:function(t){void 0===t&&(t=1);var e=this.systems.textures;return h(e,t)},setHitArea:function(t,e,i){if(void 0===e)return this.setHitAreaFromTexture(t);Array.isArray(t)||(t=[t]);var s=!1,n=!1,r=!1,o=!1,h=!1,l=!0;if(m(e)){var u=e;e=f(u,"hitArea",null),i=f(u,"hitAreaCallback",null),s=f(u,"draggable",!1),n=f(u,"dropZone",!1),r=f(u,"cursor",!1),o=f(u,"useHandCursor",!1),h=f(u,"pixelPerfect",!1);var c=f(u,"alphaTolerance",1);h&&(e={},i=this.makePixelPerfect(c)),e&&i||(this.setHitAreaFromTexture(t),l=!1)}else"function"!=typeof e||i||(i=e,e={});for(var d=0;d{var s=i(10850),n={},r={register:function(t,e,i,s,r){n[t]={plugin:e,mapping:i,settingsKey:s,configKey:r}},getPlugin:function(t){return n[t]},install:function(t){var e=t.scene.sys,i=e.settings.input,r=e.game.config;for(var o in n){var a=n[o].plugin,h=n[o].mapping,l=n[o].settingsKey,u=n[o].configKey;s(i,l,r[u])&&(t[h]=new a(t))}},remove:function(t){n.hasOwnProperty(t)&&delete n[t]}};t.exports=r},40398:(t,e,i)=>{var s=i(90447),n=i(56694),r=i(53996),o=i(88456),a=i(44521),h=i(93736),l=i(36580),u=new n({initialize:function(t,e){this.manager=t,this.id=e,this.event,this.downElement,this.upElement,this.camera=null,this.button=0,this.buttons=0,this.position=new h,this.prevPosition=new h,this.midPoint=new h(-1,-1),this.velocity=new h,this.angle=0,this.distance=0,this.smoothFactor=0,this.motionFactor=.2,this.worldX=0,this.worldY=0,this.moveTime=0,this.downX=0,this.downY=0,this.downTime=0,this.upX=0,this.upY=0,this.upTime=0,this.primaryDown=!1,this.isDown=!1,this.wasTouch=!1,this.wasCanceled=!1,this.movementX=0,this.movementY=0,this.identifier=0,this.pointerId=null,this.active=0===e,this.locked=!1,this.deltaX=0,this.deltaY=0,this.deltaZ=0},updateWorldPoint:function(t){var e=t.getWorldPoint(this.x,this.y);return this.worldX=e.x,this.worldY=e.y,this},positionToCamera:function(t,e){return t.getWorldPoint(this.x,this.y,e)},updateMotion:function(){var t=this.position.x,e=this.position.y,i=this.midPoint.x,n=this.midPoint.y;if(t!==i||e!==n){var r=a(this.motionFactor,i,t),h=a(this.motionFactor,n,e);o(r,t,.1)&&(r=t),o(h,e,.1)&&(h=e),this.midPoint.set(r,h);var l=t-r,u=e-h;this.velocity.set(l,u),this.angle=s(r,h,t,e),this.distance=Math.sqrt(l*l+u*u)}},up:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!1,this.upX=this.x,this.upY=this.y),0===this.buttons&&(this.isDown=!1,this.upTime=t.timeStamp,this.wasTouch=!1)},down:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!0,this.downX=this.x,this.downY=this.y),l.macOS&&t.ctrlKey&&(this.buttons=2,this.primaryDown=!1),this.isDown||(this.isDown=!0,this.downTime=t.timeStamp),this.wasTouch=!1},move:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.locked&&(this.movementX=t.movementX||t.mozMovementX||t.webkitMovementX||0,this.movementY=t.movementY||t.mozMovementY||t.webkitMovementY||0),this.moveTime=t.timeStamp,this.wasTouch=!1},wheel:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.deltaX=t.deltaX,this.deltaY=t.deltaY,this.deltaZ=t.deltaZ,this.wasTouch=!1},touchstart:function(t,e){t.pointerId&&(this.pointerId=t.pointerId),this.identifier=t.identifier,this.target=t.target,this.active=!0,this.buttons=1,this.event=e,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=e.timeStamp,this.isDown=!0,this.wasTouch=!0,this.wasCanceled=!1,this.updateMotion()},touchmove:function(t,e){this.event=e,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.moveTime=e.timeStamp,this.wasTouch=!0,this.updateMotion()},touchend:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!1,this.active=!1,this.updateMotion()},touchcancel:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!0,this.active=!1},noButtonDown:function(){return 0===this.buttons},leftButtonDown:function(){return!!(1&this.buttons)},rightButtonDown:function(){return!!(2&this.buttons)},middleButtonDown:function(){return!!(4&this.buttons)},backButtonDown:function(){return!!(8&this.buttons)},forwardButtonDown:function(){return!!(16&this.buttons)},leftButtonReleased:function(){return 0===this.button&&!this.isDown},rightButtonReleased:function(){return 2===this.button&&!this.isDown},middleButtonReleased:function(){return 1===this.button&&!this.isDown},backButtonReleased:function(){return 3===this.button&&!this.isDown},forwardButtonReleased:function(){return 4===this.button&&!this.isDown},getDistance:function(){return this.isDown?r(this.downX,this.downY,this.x,this.y):r(this.downX,this.downY,this.upX,this.upY)},getDistanceX:function(){return this.isDown?Math.abs(this.downX-this.x):Math.abs(this.downX-this.upX)},getDistanceY:function(){return this.isDown?Math.abs(this.downY-this.y):Math.abs(this.downY-this.upY)},getDuration:function(){return this.isDown?this.manager.time-this.downTime:this.upTime-this.downTime},getAngle:function(){return this.isDown?s(this.downX,this.downY,this.x,this.y):s(this.downX,this.downY,this.upX,this.upY)},getInterpolatedPosition:function(t,e){void 0===t&&(t=10),void 0===e&&(e=[]);for(var i=this.prevPosition.x,s=this.prevPosition.y,n=this.position.x,r=this.position.y,o=0;o{t.exports={MOUSE_DOWN:0,MOUSE_MOVE:1,MOUSE_UP:2,TOUCH_START:3,TOUCH_MOVE:4,TOUCH_END:5,POINTER_LOCK_CHANGE:6,TOUCH_CANCEL:7,MOUSE_WHEEL:8}},14874:t=>{t.exports="boot"},54168:t=>{t.exports="destroy"},526:t=>{t.exports="dragend"},81623:t=>{t.exports="dragenter"},94472:t=>{t.exports="drag"},9304:t=>{t.exports="dragleave"},34265:t=>{t.exports="dragover"},50151:t=>{t.exports="dragstart"},98134:t=>{t.exports="drop"},56773:t=>{t.exports="gameobjectdown"},45824:t=>{t.exports="dragend"},39578:t=>{t.exports="dragenter"},72072:t=>{t.exports="drag"},82569:t=>{t.exports="dragleave"},70833:t=>{t.exports="dragover"},81442:t=>{t.exports="dragstart"},32936:t=>{t.exports="drop"},99658:t=>{t.exports="gameobjectmove"},60515:t=>{t.exports="gameobjectout"},55254:t=>{t.exports="gameobjectover"},34782:t=>{t.exports="pointerdown"},41769:t=>{t.exports="pointermove"},65588:t=>{t.exports="pointerout"},61640:t=>{t.exports="pointerover"},49342:t=>{t.exports="pointerup"},82662:t=>{t.exports="wheel"},13058:t=>{t.exports="gameobjectup"},52426:t=>{t.exports="gameobjectwheel"},78072:t=>{t.exports="gameout"},1545:t=>{t.exports="gameover"},67137:t=>{t.exports="boot"},27678:t=>{t.exports="process"},22257:t=>{t.exports="update"},90379:t=>{t.exports="pointerlockchange"},88909:t=>{t.exports="pointerdown"},36548:t=>{t.exports="pointerdownoutside"},18483:t=>{t.exports="pointermove"},22355:t=>{t.exports="pointerout"},7997:t=>{t.exports="pointerover"},66318:t=>{t.exports="pointerup"},94812:t=>{t.exports="pointerupoutside"},37310:t=>{t.exports="wheel"},24196:t=>{t.exports="preupdate"},27053:t=>{t.exports="shutdown"},29413:t=>{t.exports="start"},25165:t=>{t.exports="update"},33963:(t,e,i)=>{t.exports={BOOT:i(14874),DESTROY:i(54168),DRAG_END:i(526),DRAG_ENTER:i(81623),DRAG:i(94472),DRAG_LEAVE:i(9304),DRAG_OVER:i(34265),DRAG_START:i(50151),DROP:i(98134),GAME_OUT:i(78072),GAME_OVER:i(1545),GAMEOBJECT_DOWN:i(56773),GAMEOBJECT_DRAG_END:i(45824),GAMEOBJECT_DRAG_ENTER:i(39578),GAMEOBJECT_DRAG:i(72072),GAMEOBJECT_DRAG_LEAVE:i(82569),GAMEOBJECT_DRAG_OVER:i(70833),GAMEOBJECT_DRAG_START:i(81442),GAMEOBJECT_DROP:i(32936),GAMEOBJECT_MOVE:i(99658),GAMEOBJECT_OUT:i(60515),GAMEOBJECT_OVER:i(55254),GAMEOBJECT_POINTER_DOWN:i(34782),GAMEOBJECT_POINTER_MOVE:i(41769),GAMEOBJECT_POINTER_OUT:i(65588),GAMEOBJECT_POINTER_OVER:i(61640),GAMEOBJECT_POINTER_UP:i(49342),GAMEOBJECT_POINTER_WHEEL:i(82662),GAMEOBJECT_UP:i(13058),GAMEOBJECT_WHEEL:i(52426),MANAGER_BOOT:i(67137),MANAGER_PROCESS:i(27678),MANAGER_UPDATE:i(22257),POINTER_DOWN:i(88909),POINTER_DOWN_OUTSIDE:i(36548),POINTER_MOVE:i(18483),POINTER_OUT:i(22355),POINTER_OVER:i(7997),POINTER_UP:i(66318),POINTER_UP_OUTSIDE:i(94812),POINTER_WHEEL:i(37310),POINTERLOCK_CHANGE:i(90379),PRE_UPDATE:i(24196),SHUTDOWN:i(27053),START:i(29413),UPDATE:i(25165)}},70848:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e){this.pad=t,this.events=t.events,this.index=e,this.value=0,this.threshold=.1},update:function(t){this.value=t},getValue:function(){return Math.abs(this.value){var s=i(56694),n=i(43200),r=new s({initialize:function(t,e){this.pad=t,this.events=t.manager,this.index=e,this.value=0,this.threshold=1,this.pressed=!1},update:function(t){this.value=t;var e=this.pad,i=this.index;t>=this.threshold?this.pressed||(this.pressed=!0,this.events.emit(n.BUTTON_DOWN,e,this,t),this.pad.emit(n.GAMEPAD_BUTTON_DOWN,i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit(n.BUTTON_UP,e,this,t),this.pad.emit(n.GAMEPAD_BUTTON_UP,i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=r},75956:(t,e,i)=>{var s=i(70848),n=i(21274),r=i(56694),o=i(6659),a=i(93736),h=new r({Extends:o,initialize:function(t,e){o.call(this),this.manager=t,this.pad=e,this.id=e.id,this.index=e.index;for(var i=[],r=0;r=2&&(this.leftStick.set(r[0].getValue(),r[1].getValue()),n>=4&&this.rightStick.set(r[2].getValue(),r[3].getValue()))}},destroy:function(){var t;for(this.removeAllListeners(),this.manager=null,this.pad=null,t=0;t{var s=i(56694),n=i(6659),r=i(43200),o=i(75956),a=i(10850),h=i(63399),l=i(33963),u=new s({Extends:n,initialize:function(t){n.call(this),this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.enabled=!0,this.target,this.gamepads=[],this.queue=[],this.onGamepadHandler,this._pad1,this._pad2,this._pad3,this._pad4,t.pluginEvents.once(l.BOOT,this.boot,this),t.pluginEvents.on(l.START,this.start,this)},boot:function(){var t=this.scene.sys.game,e=this.settings.input,i=t.config;this.enabled=a(e,"gamepad",i.inputGamepad)&&t.device.input.gamepads,this.target=a(e,"gamepad.target",i.inputGamepadEventTarget),this.sceneInputPlugin.pluginEvents.once(l.DESTROY,this.destroy,this)},start:function(){this.enabled&&(this.startListeners(),this.refreshPads()),this.sceneInputPlugin.pluginEvents.once(l.SHUTDOWN,this.shutdown,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},startListeners:function(){var t=this,e=this.target,i=function(e){!e.defaultPrevented&&t.isActive()&&(t.refreshPads(),t.queue.push(e))};this.onGamepadHandler=i,e.addEventListener("gamepadconnected",i,!1),e.addEventListener("gamepaddisconnected",i,!1),this.sceneInputPlugin.pluginEvents.on(l.UPDATE,this.update,this)},stopListeners:function(){this.target.removeEventListener("gamepadconnected",this.onGamepadHandler),this.target.removeEventListener("gamepaddisconnected",this.onGamepadHandler),this.sceneInputPlugin.pluginEvents.off(l.UPDATE,this.update);for(var t=0;t{t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,SELECT:8,START:9,B:0,A:1,Y:2,X:3,LEFT_SHOULDER:4,RIGHT_SHOULDER:5}},74982:t=>{t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,SHARE:8,OPTIONS:9,PS:16,TOUCHBAR:17,X:0,CIRCLE:1,SQUARE:2,TRIANGLE:3,L1:4,R1:5,L2:6,R2:7,L3:10,R3:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}},43247:t=>{t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,MENU:16,A:0,B:1,X:2,Y:3,LB:4,RB:5,LT:6,RT:7,BACK:8,START:9,LS:10,RS:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}},4898:(t,e,i)=>{t.exports={DUALSHOCK_4:i(74982),SNES_USB:i(33171),XBOX_360:i(43247)}},17344:t=>{t.exports="down"},36635:t=>{t.exports="up"},85724:t=>{t.exports="connected"},55832:t=>{t.exports="disconnected"},772:t=>{t.exports="down"},33608:t=>{t.exports="up"},43200:(t,e,i)=>{t.exports={BUTTON_DOWN:i(17344),BUTTON_UP:i(36635),CONNECTED:i(85724),DISCONNECTED:i(55832),GAMEPAD_BUTTON_DOWN:i(772),GAMEPAD_BUTTON_UP:i(33608)}},92636:(t,e,i)=>{t.exports={Axis:i(70848),Button:i(21274),Events:i(43200),Gamepad:i(75956),GamepadPlugin:i(1379),Configs:i(4898)}},20873:(t,e,i)=>{var s=i(72687),n=i(98611),r={CreatePixelPerfectHandler:i(18104),CreateInteractiveObject:i(27395),Events:i(33963),Gamepad:i(92636),InputManager:i(69898),InputPlugin:i(12499),InputPluginCache:i(63399),Keyboard:i(28388),Mouse:i(11343),Pointer:i(40398),Touch:i(77423)};r=n(!1,r,s),t.exports=r},71064:(t,e,i)=>{var s=i(66458),n=i(56694),r=i(97081),o=i(33963),a=i(11873),h=i(72283),l=new n({initialize:function(t){this.manager=t,this.queue=[],this.preventDefault=!0,this.captures=[],this.enabled=!1,this.target,this.onKeyDown=h,this.onKeyUp=h,t.events.once(o.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputKeyboard,this.target=t.inputKeyboardEventTarget,this.addCapture(t.inputKeyboardCapture),!this.target&&window&&(this.target=window),this.enabled&&this.target&&this.startListeners(),this.manager.game.events.on(r.POST_STEP,this.postUpdate,this)},startListeners:function(){var t=this;this.onKeyDown=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.events.emit(o.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}},this.onKeyUp=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.events.emit(o.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}};var e=this.target;e&&(e.addEventListener("keydown",this.onKeyDown,!1),e.addEventListener("keyup",this.onKeyUp,!1),this.enabled=!0)},stopListeners:function(){var t=this.target;t.removeEventListener("keydown",this.onKeyDown,!1),t.removeEventListener("keyup",this.onKeyUp,!1),this.enabled=!1},postUpdate:function(){this.queue=[]},addCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},removeCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},clearCaptures:function(){this.captures=[],this.preventDefault=!1},destroy:function(){this.stopListeners(),this.clearCaptures(),this.queue=[],this.manager.game.events.off(r.POST_RENDER,this.postUpdate,this),this.target=null,this.enabled=!1,this.manager=null}});t.exports=l},89666:(t,e,i)=>{var s=i(56694),n=i(6659),r=i(94030),o=i(97081),a=i(10850),h=i(33963),l=i(63399),u=i(50165),c=i(11873),d=i(95625),p=i(48044),f=i(7599),v=i(84314),g=new s({Extends:n,initialize:function(t){n.call(this),this.game=t.systems.game,this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.manager=t.manager.keyboard,this.enabled=!0,this.keys=[],this.combos=[],this.prevCode=null,this.prevTime=0,this.prevType=null,t.pluginEvents.once(h.BOOT,this.boot,this),t.pluginEvents.on(h.START,this.start,this)},boot:function(){var t=this.settings.input;this.enabled=a(t,"keyboard",!0);var e=a(t,"keyboard.capture",null);e&&this.addCaptures(e),this.sceneInputPlugin.pluginEvents.once(h.DESTROY,this.destroy,this)},start:function(){this.sceneInputPlugin.manager.events.on(h.MANAGER_PROCESS,this.update,this),this.sceneInputPlugin.pluginEvents.once(h.SHUTDOWN,this.shutdown,this),this.game.events.on(o.BLUR,this.resetKeys,this),this.scene.sys.events.on(f.PAUSE,this.resetKeys,this),this.scene.sys.events.on(f.SLEEP,this.resetKeys,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},addCapture:function(t){return this.manager.addCapture(t),this},removeCapture:function(t){return this.manager.removeCapture(t),this},getCaptures:function(){return this.manager.captures},enableGlobalCapture:function(){return this.manager.preventDefault=!0,this},disableGlobalCapture:function(){return this.manager.preventDefault=!1,this},clearCaptures:function(){return this.manager.clearCaptures(),this},createCursorKeys:function(){return this.addKeys({up:c.UP,down:c.DOWN,left:c.LEFT,right:c.RIGHT,space:c.SPACE,shift:c.SHIFT})},addKeys:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1);var s={};if("string"==typeof t){t=t.split(",");for(var n=0;n-1?s[n]=t:s[t.keyCode]=t,e&&this.addCapture(t.keyCode),t.setEmitOnRepeat(i),t}return"string"==typeof t&&(t=c[t.toUpperCase()]),s[t]||(s[t]=new u(this,t),e&&this.addCapture(t),s[t].setEmitOnRepeat(i)),s[t]},removeKey:function(t,e){void 0===e&&(e=!1);var i,s=this.keys;if(t instanceof u){var n=s.indexOf(t);n>-1&&(i=this.keys[n],this.keys[n]=void 0)}else"string"==typeof t&&(t=c[t.toUpperCase()]);return s[t]&&(i=s[t],s[t]=void 0),i&&(i.plugin=null,e&&i.destroy()),this},removeAllKeys:function(t){for(var e=this.keys,i=0;it._tick)return t._tick=i,!0}return!1},update:function(){var t=this.manager.queue,e=t.length;if(this.isActive()&&0!==e)for(var i=this.keys,s=0;s{t.exports=function(t,e){return e.timeLastMatched=t.timeStamp,e.index++,e.index===e.size||(e.current=e.keyCodes[e.index],!1)}},95625:(t,e,i)=>{var s=i(56694),n=i(94030),r=i(72632),o=i(2544),a=i(88754),h=new s({initialize:function(t,e,i){if(void 0===i&&(i={}),e.length<2)return!1;this.manager=t,this.enabled=!0,this.keyCodes=[];for(var s=0;s{var s=i(60258);t.exports=function(t,e){if(e.matched)return!0;var i=!1,n=!1;if(t.keyCode===e.current)if(e.index>0&&e.maxKeyDelay>0){var r=e.timeLastMatched+e.maxKeyDelay;t.timeStamp<=r&&(n=!0,i=s(t,e))}else n=!0,i=s(t,e);return!n&&e.resetOnWrongKey&&(e.index=0,e.current=e.keyCodes[0]),i&&(e.timeLastMatched=t.timeStamp,e.matched=!0,e.timeMatched=t.timeStamp),i}},88754:t=>{t.exports=function(t){return t.current=t.keyCodes[0],t.index=0,t.timeLastMatched=0,t.matched=!1,t.timeMatched=0,t}},5044:t=>{t.exports="keydown"},40813:t=>{t.exports="keyup"},89319:t=>{t.exports="keycombomatch"},76362:t=>{t.exports="down"},78595:t=>{t.exports="keydown-"},30056:t=>{t.exports="keyup-"},81939:t=>{t.exports="up"},94030:(t,e,i)=>{t.exports={ANY_KEY_DOWN:i(5044),ANY_KEY_UP:i(40813),COMBO_MATCH:i(89319),DOWN:i(76362),KEY_DOWN:i(78595),KEY_UP:i(30056),UP:i(81939)}},28388:(t,e,i)=>{t.exports={Events:i(94030),KeyboardManager:i(71064),KeyboardPlugin:i(89666),Key:i(50165),KeyCodes:i(11873),KeyCombo:i(95625),AdvanceKeyCombo:i(60258),ProcessKeyCombo:i(2544),ResetKeyCombo:i(88754),JustDown:i(42460),JustUp:i(53162),DownDuration:i(64964),UpDuration:i(70331)}},64964:t=>{t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeDown;return t.isDown&&i{t.exports=function(t){return!!t._justDown&&(t._justDown=!1,!0)}},53162:t=>{t.exports=function(t){return!!t._justUp&&(t._justUp=!1,!0)}},50165:(t,e,i)=>{var s=i(56694),n=i(6659),r=i(94030),o=new s({Extends:n,initialize:function(t,e){n.call(this),this.plugin=t,this.keyCode=e,this.originalEvent=void 0,this.enabled=!0,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.metaKey=!1,this.location=0,this.timeDown=0,this.duration=0,this.timeUp=0,this.emitOnRepeat=!1,this.repeats=0,this._justDown=!1,this._justUp=!1,this._tick=-1},setEmitOnRepeat:function(t){return this.emitOnRepeat=t,this},onDown:function(t){this.originalEvent=t,this.enabled&&(this.altKey=t.altKey,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.metaKey=t.metaKey,this.location=t.location,this.repeats++,this.isDown?this.emitOnRepeat&&this.emit(r.DOWN,this,t):(this.isDown=!0,this.isUp=!1,this.timeDown=t.timeStamp,this.duration=0,this._justDown=!0,this._justUp=!1,this.emit(r.DOWN,this,t)))},onUp:function(t){this.originalEvent=t,this.enabled&&(this.isDown=!1,this.isUp=!0,this.timeUp=t.timeStamp,this.duration=this.timeUp-this.timeDown,this.repeats=0,this._justDown=!1,this._justUp=!0,this._tick=-1,this.emit(r.UP,this,t))},reset:function(){return this.preventDefault=!0,this.enabled=!0,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.metaKey=!1,this.timeDown=0,this.duration=0,this.timeUp=0,this.repeats=0,this._justDown=!1,this._justUp=!1,this._tick=-1,this},getDuration:function(){return this.isDown?this.plugin.game.loop.time-this.timeDown:0},destroy:function(){this.removeAllListeners(),this.originalEvent=null,this.plugin=null}});t.exports=o},11873:t=>{t.exports={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:42,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,NUMPAD_ZERO:96,NUMPAD_ONE:97,NUMPAD_TWO:98,NUMPAD_THREE:99,NUMPAD_FOUR:100,NUMPAD_FIVE:101,NUMPAD_SIX:102,NUMPAD_SEVEN:103,NUMPAD_EIGHT:104,NUMPAD_NINE:105,NUMPAD_ADD:107,NUMPAD_SUBTRACT:109,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,SEMICOLON:186,PLUS:187,COMMA:188,MINUS:189,PERIOD:190,FORWARD_SLASH:191,BACK_SLASH:220,QUOTES:222,BACKTICK:192,OPEN_BRACKET:219,CLOSED_BRACKET:221,SEMICOLON_FIREFOX:59,COLON:58,COMMA_FIREFOX_WINDOWS:60,COMMA_FIREFOX:62,BRACKET_RIGHT_FIREFOX:174,BRACKET_LEFT_FIREFOX:175}},48044:(t,e,i)=>{var s=i(11873),n={};for(var r in s)n[s[r]]=r;t.exports=n},70331:t=>{t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeUp;return t.isUp&&i{var s=i(56694),n=i(90185),r=i(33963),o=i(72283),a=new s({initialize:function(t){this.manager=t,this.preventDefaultDown=!0,this.preventDefaultUp=!0,this.preventDefaultMove=!0,this.preventDefaultWheel=!1,this.enabled=!1,this.target,this.locked=!1,this.onMouseMove=o,this.onMouseDown=o,this.onMouseUp=o,this.onMouseDownWindow=o,this.onMouseUpWindow=o,this.onMouseOver=o,this.onMouseOut=o,this.onMouseWheel=o,this.pointerLockChange=o,this.isTop=!0,t.events.once(r.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputMouse,this.target=t.inputMouseEventTarget,this.passive=t.inputMousePassive,this.preventDefaultDown=t.inputMousePreventDefaultDown,this.preventDefaultUp=t.inputMousePreventDefaultUp,this.preventDefaultMove=t.inputMousePreventDefaultMove,this.preventDefaultWheel=t.inputMousePreventDefaultWheel,this.target?"string"==typeof this.target&&(this.target=document.getElementById(this.target)):this.target=this.manager.game.canvas,t.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return document.body.addEventListener("contextmenu",(function(t){return t.preventDefault(),!1})),this},requestPointerLock:function(){if(n.pointerLock){var t=this.target;t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock||t.webkitRequestPointerLock,t.requestPointerLock()}},releasePointerLock:function(){n.pointerLock&&(document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,document.exitPointerLock())},startListeners:function(){var t=this.target;if(t){var e=this,i=this.manager,s=i.canvas,r=window&&window.focus&&i.game.config.autoFocus;this.onMouseMove=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onMouseMove(t),e.preventDefaultMove&&t.preventDefault())},this.onMouseDown=function(t){r&&window.focus(),!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onMouseDown(t),e.preventDefaultDown&&t.target===s&&t.preventDefault())},this.onMouseDownWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==s&&i.onMouseDown(t)},this.onMouseUp=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onMouseUp(t),e.preventDefaultUp&&t.target===s&&t.preventDefault())},this.onMouseUpWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==s&&i.onMouseUp(t)},this.onMouseOver=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.setCanvasOver(t)},this.onMouseOut=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.setCanvasOut(t)},this.onMouseWheel=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.onMouseWheel(t),e.preventDefaultWheel&&t.target===s&&t.preventDefault()};var o={passive:!0};if(t.addEventListener("mousemove",this.onMouseMove),t.addEventListener("mousedown",this.onMouseDown),t.addEventListener("mouseup",this.onMouseUp),t.addEventListener("mouseover",this.onMouseOver,o),t.addEventListener("mouseout",this.onMouseOut,o),this.preventDefaultWheel?t.addEventListener("wheel",this.onMouseWheel,{passive:!1}):t.addEventListener("wheel",this.onMouseWheel,o),window&&i.game.config.inputWindowEvents)try{window.top.addEventListener("mousedown",this.onMouseDownWindow,o),window.top.addEventListener("mouseup",this.onMouseUpWindow,o)}catch(t){window.addEventListener("mousedown",this.onMouseDownWindow,o),window.addEventListener("mouseup",this.onMouseUpWindow,o),this.isTop=!1}n.pointerLock&&(this.pointerLockChange=function(t){var s=e.target;e.locked=document.pointerLockElement===s||document.mozPointerLockElement===s||document.webkitPointerLockElement===s,i.onPointerLockChange(t)},document.addEventListener("pointerlockchange",this.pointerLockChange,!0),document.addEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.addEventListener("webkitpointerlockchange",this.pointerLockChange,!0)),this.enabled=!0}},stopListeners:function(){var t=this.target;t.removeEventListener("mousemove",this.onMouseMove),t.removeEventListener("mousedown",this.onMouseDown),t.removeEventListener("mouseup",this.onMouseUp),t.removeEventListener("mouseover",this.onMouseOver),t.removeEventListener("mouseout",this.onMouseOut),window&&((t=this.isTop?window.top:window).removeEventListener("mousedown",this.onMouseDownWindow),t.removeEventListener("mouseup",this.onMouseUpWindow)),n.pointerLock&&(document.removeEventListener("pointerlockchange",this.pointerLockChange,!0),document.removeEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.removeEventListener("webkitpointerlockchange",this.pointerLockChange,!0))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});t.exports=a},11343:(t,e,i)=>{t.exports={MouseManager:i(7905)}},37579:(t,e,i)=>{var s=i(56694),n=i(33963),r=i(72283),o=new s({initialize:function(t){this.manager=t,this.capture=!0,this.enabled=!1,this.target,this.onTouchStart=r,this.onTouchStartWindow=r,this.onTouchMove=r,this.onTouchEnd=r,this.onTouchEndWindow=r,this.onTouchCancel=r,this.onTouchCancelWindow=r,this.onTouchOver=r,this.onTouchOut=r,t.events.once(n.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputTouch,this.target=t.inputTouchEventTarget,this.capture=t.inputTouchCapture,this.target||(this.target=this.manager.game.canvas),t.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return document.body.addEventListener("contextmenu",(function(t){return t.preventDefault(),!1})),this},startListeners:function(){var t=this,e=this.manager.canvas,i=window&&window.focus&&this.manager.game.config.autoFocus;this.onTouchStart=function(s){i&&window.focus(),!s.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onTouchStart(s),t.capture&&s.cancelable&&s.target===e&&s.preventDefault())},this.onTouchStartWindow=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&i.target!==e&&t.manager.onTouchStart(i)},this.onTouchMove=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onTouchMove(e),t.capture&&e.cancelable&&e.preventDefault())},this.onTouchEnd=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onTouchEnd(i),t.capture&&i.cancelable&&i.target===e&&i.preventDefault())},this.onTouchEndWindow=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&i.target!==e&&t.manager.onTouchEnd(i)},this.onTouchCancel=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onTouchCancel(e),t.capture&&e.preventDefault())},this.onTouchCancelWindow=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.onTouchCancel(e)},this.onTouchOver=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.setCanvasOver(e)},this.onTouchOut=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.setCanvasOut(e)};var s=this.target;if(s){var n={passive:!0},r={passive:!1};s.addEventListener("touchstart",this.onTouchStart,this.capture?r:n),s.addEventListener("touchmove",this.onTouchMove,this.capture?r:n),s.addEventListener("touchend",this.onTouchEnd,this.capture?r:n),s.addEventListener("touchcancel",this.onTouchCancel,this.capture?r:n),s.addEventListener("touchover",this.onTouchOver,this.capture?r:n),s.addEventListener("touchout",this.onTouchOut,this.capture?r:n),window&&this.manager.game.config.inputWindowEvents&&(window.addEventListener("touchstart",this.onTouchStartWindow,r),window.addEventListener("touchend",this.onTouchEndWindow,r),window.addEventListener("touchcancel",this.onTouchCancelWindow,r)),this.enabled=!0}},stopListeners:function(){var t=this.target;t.removeEventListener("touchstart",this.onTouchStart),t.removeEventListener("touchmove",this.onTouchMove),t.removeEventListener("touchend",this.onTouchEnd),t.removeEventListener("touchcancel",this.onTouchCancel),t.removeEventListener("touchover",this.onTouchOver),t.removeEventListener("touchout",this.onTouchOut),window&&(window.removeEventListener("touchstart",this.onTouchStartWindow),window.removeEventListener("touchend",this.onTouchEndWindow))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});t.exports=o},77423:(t,e,i)=>{t.exports={TouchManager:i(37579)}},98035:(t,e,i)=>{var s=i(56694),n=i(12117),r=i(683),o=i(72632),a=i(30750),h=i(43531),l=i(88490),u=i(33868),c=new s({initialize:function(t,e){this.loader=t,this.cache=o(e,"cache",!1),this.type=o(e,"type",!1),this.key=o(e,"key",!1);var i=this.key;if(t.prefix&&""!==t.prefix&&(this.key=t.prefix+i),!this.type||!this.key)throw new Error("Invalid Loader."+this.type+" key");var s=o(e,"url");void 0===s?s=t.path+i+"."+o(e,"extension",""):"string"!=typeof s||s.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)||(s=t.path+s),this.url=s,this.src="",this.xhrSettings=u(o(e,"responseType",void 0)),o(e,"xhrSettings",!1)&&(this.xhrSettings=h(this.xhrSettings,o(e,"xhrSettings",{}))),this.xhrLoader=null,this.state="function"==typeof this.url?n.FILE_POPULATED:n.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=o(e,"config",{}),this.multiFile,this.linkFile},setLink:function(t){this.linkFile=t,t.linkFile=this},resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){this.state===n.FILE_POPULATED?this.loader.nextFile(this,!0):(this.state=n.FILE_LOADING,this.src=a(this,this.loader.baseURL),0===this.src.indexOf("data:")?console.warn("Local data URIs are not supported: "+this.key):this.xhrLoader=l(this,this.loader.xhr))},onLoad:function(t,e){var i=t.responseURL&&(0===t.responseURL.indexOf("file://")||0===t.responseURL.indexOf("capacitor://"))&&0===e.target.status,s=!(e.target&&200!==e.target.status)||i;4===t.readyState&&t.status>=400&&t.status<=599&&(s=!1),this.state=n.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,s)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(r.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=n.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=n.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){console.error('Failed to process file: %s "%s"',this.type,this.key),this.state=n.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.cache.add(this.key,this.data),this.pendingDestroy()},pendingDestroy:function(t){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit(r.FILE_COMPLETE,e,i,t),this.loader.emit(r.FILE_KEY_COMPLETE+i+"-"+e,e,i,t),this.loader.flagForRemoval(this)},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});c.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var s=new FileReader;s.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+s.result.split(",")[1]},s.onerror=t.onerror,s.readAsDataURL(e)}},c.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=c},76846:t=>{var e={},i={install:function(t){for(var i in e)t[i]=e[i]},register:function(t,i){e[t]=i},destroy:function(){e={}}};t.exports=i},30750:t=>{t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},67285:(t,e,i)=>{var s=i(56694),n=i(12117),r=i(58403),o=i(6659),a=i(683),h=i(76846),l=i(72632),u=i(91963),c=i(7599),d=i(33868),p=new s({Extends:o,initialize:function(t){o.call(this);var e=t.sys.game.config,i=t.sys.settings.loader;this.scene=t,this.systems=t.sys,this.cacheManager=t.sys.cache,this.textureManager=t.sys.textures,this.sceneManager=t.sys.game.scene,h.install(this),this.prefix="",this.path="",this.baseURL="",this.setBaseURL(l(i,"baseURL",e.loaderBaseURL)),this.setPath(l(i,"path",e.loaderPath)),this.setPrefix(l(i,"prefix",e.loaderPrefix)),this.maxParallelDownloads=l(i,"maxParallelDownloads",e.loaderMaxParallelDownloads),this.xhr=d(l(i,"responseType",e.loaderResponseType),l(i,"async",e.loaderAsync),l(i,"user",e.loaderUser),l(i,"password",e.loaderPassword),l(i,"timeout",e.loaderTimeout),l(i,"withCredentials",e.loaderWithCredentials)),this.crossOrigin=l(i,"crossOrigin",e.loaderCrossOrigin),this.imageLoadType=l(i,"imageLoadType",e.loaderImageLoadType),this.totalToLoad=0,this.progress=0,this.list=new r,this.inflight=new r,this.queue=new r,this._deleteQueue=new r,this.totalFailed=0,this.totalComplete=0,this.state=n.LOADER_IDLE,this.multiKeyIndex=0,t.sys.events.once(c.BOOT,this.boot,this),t.sys.events.on(c.START,this.pluginStart,this)},boot:function(){this.systems.events.once(c.DESTROY,this.destroy,this)},pluginStart:function(){this.systems.events.once(c.SHUTDOWN,this.shutdown,this)},setBaseURL:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.baseURL=t,this},setPath:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.path=t,this},setPrefix:function(t){return void 0===t&&(t=""),this.prefix=t,this},setCORS:function(t){return this.crossOrigin=t,this},addFile:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e0},isLoading:function(){return this.state===n.LOADER_LOADING||this.state===n.LOADER_PROCESSING},isReady:function(){return this.state===n.LOADER_IDLE||this.state===n.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit(a.START,this),0===this.list.size?this.loadComplete():(this.state=n.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on(c.UPDATE,this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit(a.PROGRESS,this.progress)},update:function(){this.state===n.LOADER_LOADING&&this.list.size>0&&this.inflight.size{var s=i(98611),n=i(33868);t.exports=function(t,e){var i=void 0===t?n():s({},t);if(e)for(var r in e)void 0!==e[r]&&(i[r]=e[r]);return i}},45176:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s){var n=[];s.forEach((function(t){t&&n.push(t)})),this.loader=t,this.type=e,this.key=i,this.multiKeyIndex=t.multiKeyIndex++,this.files=n,this.complete=!1,this.pending=n.length,this.failed=0,this.config={},this.baseURL=t.baseURL,this.path=t.path,this.prefix=t.prefix;for(var r=0;r{var s=i(43531);t.exports=function(t,e){var i=s(e,t.xhrSettings),n=new XMLHttpRequest;if(n.open("GET",t.src,i.async,i.user,i.password),n.responseType=t.xhrSettings.responseType,n.timeout=i.timeout,i.headers)for(var r in i.headers)n.setRequestHeader(r,i.headers[r]);return i.header&&i.headerValue&&n.setRequestHeader(i.header,i.headerValue),i.requestedWith&&n.setRequestHeader("X-Requested-With",i.requestedWith),i.overrideMimeType&&n.overrideMimeType(i.overrideMimeType),i.withCredentials&&(n.withCredentials=!0),n.onload=t.onLoad.bind(t,n),n.onerror=t.onError.bind(t,n),n.onprogress=t.onProgress.bind(t),n.send(),n}},33868:t=>{t.exports=function(t,e,i,s,n,r){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===s&&(s=""),void 0===n&&(n=0),void 0===r&&(r=!1),{responseType:t,async:e,user:i,password:s,timeout:n,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:r}}},12117:t=>{t.exports={LOADER_IDLE:0,LOADER_LOADING:1,LOADER_PROCESSING:2,LOADER_COMPLETE:3,LOADER_SHUTDOWN:4,LOADER_DESTROYED:5,FILE_PENDING:10,FILE_LOADING:11,FILE_LOADED:12,FILE_FAILED:13,FILE_PROCESSING:14,FILE_ERRORED:16,FILE_COMPLETE:17,FILE_DESTROYED:18,FILE_POPULATED:19}},7398:t=>{t.exports="addfile"},52187:t=>{t.exports="complete"},36627:t=>{t.exports="filecomplete"},81925:t=>{t.exports="filecomplete-"},29774:t=>{t.exports="loaderror"},20943:t=>{t.exports="load"},74693:t=>{t.exports="fileprogress"},71176:t=>{t.exports="postprocess"},88984:t=>{t.exports="progress"},72753:t=>{t.exports="start"},683:(t,e,i)=>{t.exports={ADD:i(7398),COMPLETE:i(52187),FILE_COMPLETE:i(36627),FILE_KEY_COMPLETE:i(81925),FILE_LOAD_ERROR:i(29774),FILE_LOAD:i(20943),FILE_PROGRESS:i(74693),POST_PROCESS:i(71176),PROGRESS:i(88984),START:i(72753)}},46468:(t,e,i)=>{var s=i(56694),n=i(76846),r=i(70806),o=i(683),a=new s({Extends:r,initialize:function(t,e,i,s,n){r.call(this,t,e,i,s,n),this.type="animationJSON"},onProcess:function(){this.loader.once(o.POST_PROCESS,this.onLoadComplete,this),r.prototype.onProcess.call(this)},onLoadComplete:function(){this.loader.systems.anims.fromJSON(this.data)}});n.register("animation",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(76846),r=i(72632),o=i(42927),a=i(42911),h=i(70806),l=i(45176),u=new s({Extends:l,initialize:function(t,e,i,s,n,u){var c,d;if(a(e)){var p=e;e=r(p,"key"),c=new o(t,{key:e,url:r(p,"textureURL"),extension:r(p,"textureExtension","png"),normalMap:r(p,"normalMap"),xhrSettings:r(p,"textureXhrSettings")}),d=new h(t,{key:e,url:r(p,"atlasURL"),extension:r(p,"atlasExtension","json"),xhrSettings:r(p,"atlasXhrSettings")})}else c=new o(t,e,i,n),d=new h(t,e,s,u);c.linkFile?l.call(this,t,"atlasjson",e,[c,d,c.linkFile]):l.call(this,t,"atlasjson",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(t.key,t.data,e.data,i),e.addToCache(),this.complete=!0}}});n.register("aseprite",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var o=0;o{var s=i(56694),n=i(76846),r=i(72632),o=i(42927),a=i(42911),h=i(70806),l=i(45176),u=new s({Extends:l,initialize:function(t,e,i,s,n,u){var c,d;if(a(e)){var p=e;e=r(p,"key"),c=new o(t,{key:e,url:r(p,"textureURL"),extension:r(p,"textureExtension","png"),normalMap:r(p,"normalMap"),xhrSettings:r(p,"textureXhrSettings")}),d=new h(t,{key:e,url:r(p,"atlasURL"),extension:r(p,"atlasExtension","json"),xhrSettings:r(p,"atlasXhrSettings")})}else c=new o(t,e,i,n),d=new h(t,e,s,u);c.linkFile?l.call(this,t,"atlasjson",e,[c,d,c.linkFile]):l.call(this,t,"atlasjson",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(t.key,t.data,e.data,i),e.pendingDestroy(),this.complete=!0}}});n.register("atlas",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var o=0;o{var s=i(56694),n=i(76846),r=i(72632),o=i(42927),a=i(42911),h=i(45176),l=i(15297),u=new s({Extends:h,initialize:function(t,e,i,s,n,u){var c,d;if(a(e)){var p=e;e=r(p,"key"),c=new o(t,{key:e,url:r(p,"textureURL"),extension:r(p,"textureExtension","png"),normalMap:r(p,"normalMap"),xhrSettings:r(p,"textureXhrSettings")}),d=new l(t,{key:e,url:r(p,"atlasURL"),extension:r(p,"atlasExtension","xml"),xhrSettings:r(p,"atlasXhrSettings")})}else c=new o(t,e,i,n),d=new l(t,e,s,u);c.linkFile?h.call(this,t,"atlasxml",e,[c,d,c.linkFile]):h.call(this,t,"atlasxml",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlasXML(t.key,t.data,e.data,i),e.pendingDestroy(),this.complete=!0}}});n.register("atlasXML",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var o=0;o{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(30929),l=i(42911),u=new s({Extends:r,initialize:function(t,e,i,s,n){if(l(e)){var o=e;e=a(o,"key"),s=a(o,"xhrSettings"),n=a(o,"context",n)}var h={type:"audio",cache:t.cacheManager.audio,extension:i.type,responseType:"arraybuffer",key:e,url:i.url,xhrSettings:s,config:{context:n}};r.call(this,t,h)},onProcess:function(){this.state=n.FILE_PROCESSING;var t=this;this.config.context.decodeAudioData(this.xhrLoader.response,(function(e){t.data=e,t.onProcessComplete()}),(function(e){console.error("Error decoding audio: "+t.key+" - ",e?e.message:null),t.onProcessError()})),this.config.context=null}});u.create=function(t,e,i,s,n){var r=t.systems.game,o=r.config.audio,c=r.device.audio;l(e)&&(i=a(e,"url",[]),s=a(e,"config",{}));var d=u.getAudioURL(r,i);return d?c.webAudio&&!o.disableWebAudio?new u(t,e,d,n,r.sound.context):new h(t,e,d,s):null},u.getAudioURL=function(t,e){Array.isArray(e)||(e=[e]);for(var i=0;i{var s=i(67448),n=i(56694),r=i(76846),o=i(72632),a=i(42911),h=i(70806),l=i(45176),u=new n({Extends:l,initialize:function(t,e,i,n,r,u,c){if(a(e)){var d=e;e=o(d,"key"),i=o(d,"jsonURL"),n=o(d,"audioURL"),r=o(d,"audioConfig"),u=o(d,"audioXhrSettings"),c=o(d,"jsonXhrSettings")}var p;if(n){var f=s.create(t,e,n,r,u);f&&(p=new h(t,e,i,c),l.call(this,t,"audiosprite",e,[f,p]),this.config.resourceLoad=!1)}else p=new h(t,e,i,c),l.call(this,t,"audiosprite",e,[p]),this.config.resourceLoad=!0,this.config.audioConfig=r,this.config.audioXhrSettings=u},onFileComplete:function(t){if(-1!==this.files.indexOf(t)&&(this.pending--,this.config.resourceLoad&&"json"===t.type&&t.data.hasOwnProperty("resources"))){var e=t.data.resources,i=o(this.config,"audioConfig"),n=o(this.config,"audioXhrSettings"),r=s.create(this.loader,t.key,e,i,n);r&&(this.addToMultiFile(r),this.loader.addFile(r))}},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1];t.addToCache(),e.addToCache(),this.complete=!0}}});r.register("audioSprite",(function(t,e,i,s,n,r){var o,a=this.systems.game,h=a.config.audio,l=a.device.audio;if(h&&h.noAudio||!l.webAudio&&!l.audioData)return this;if(Array.isArray(t))for(var c=0;c{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s,n){var o="bin";if(h(e)){var l=e;e=a(l,"key"),i=a(l,"url"),s=a(l,"xhrSettings"),o=a(l,"extension",o),n=a(l,"dataType",n)}var u={type:"binary",cache:t.cacheManager.binary,extension:o,responseType:"arraybuffer",key:e,url:i,xhrSettings:s,config:{dataType:n}};r.call(this,t,u)},onProcess:function(){this.state=n.FILE_PROCESSING;var t=this.config.dataType;this.data=t?new t(this.xhrLoader.response):this.xhrLoader.response,this.onProcessComplete()}});o.register("binary",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(76846),r=i(72632),o=i(42927),a=i(42911),h=i(45176),l=i(31476),u=i(15297),c=new s({Extends:h,initialize:function(t,e,i,s,n,l){var c,d;if(a(e)){var p=e;e=r(p,"key"),c=new o(t,{key:e,url:r(p,"textureURL"),extension:r(p,"textureExtension","png"),normalMap:r(p,"normalMap"),xhrSettings:r(p,"textureXhrSettings")}),d=new u(t,{key:e,url:r(p,"fontDataURL"),extension:r(p,"fontDataExtension","xml"),xhrSettings:r(p,"fontDataXhrSettings")})}else c=new o(t,e,i,n),d=new u(t,e,s,l);c.linkFile?h.call(this,t,"bitmapfont",e,[c,d,c.linkFile]):h.call(this,t,"bitmapfont",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1];t.addToCache(),e.pendingDestroy();var i=t.cache.get(t.key),s=l(e.data,t.cache.getFrame(t.key),0,0,i);this.loader.cacheManager.bitmapFont.add(t.key,{data:s,texture:t.key,frame:null}),this.complete=!0}}});n.register("bitmapFont",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var o=0;o{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s){var n="css";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),s=a(o,"xhrSettings"),n=a(o,"extension",n)}var l={type:"script",cache:!1,extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,l)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=document.createElement("style"),this.data.defer=!1,this.data.innerHTML=this.xhrLoader.responseText,document.head.appendChild(this.data),this.onProcessComplete()}});o.register("css",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(73152),n=i(40612),r=i(56694),o=i(76846),a=i(72632),h=i(42927),l=i(70806),u=i(67409),c=i(30657),d=i(80802),p=i(45176),f=i(24904),v=new r({Extends:p,initialize:function(t,e,i,s){if(i.multiAtlasURL){var r=new l(t,{key:e,url:i.multiAtlasURL,xhrSettings:s,config:i});p.call(this,t,"texture",e,[r])}else{var o=i.textureURL.substr(i.textureURL.length-3);i.type||(i.type="ktx"===o.toLowerCase()?"KTX":"PVR");var a=new n(t,{key:e,url:i.textureURL,extension:o,xhrSettings:s,config:i});if(i.atlasURL){var h=new l(t,{key:e,url:i.atlasURL,xhrSettings:s,config:i});p.call(this,t,"texture",e,[a,h])}else p.call(this,t,"texture",e,[a])}this.config=i},onFileComplete:function(t){if(-1!==this.files.indexOf(t)){if(this.pending--,!this.config.multiAtlasURL)return;if("json"===t.type&&t.data.hasOwnProperty("textures")){var e=t.data.textures,i=this.config,s=this.loader,r=s.baseURL,o=s.path,h=s.prefix,l=a(i,"multiBaseURL",this.baseURL),u=a(i,"multiPath",this.path),c=a(i,"prefix",this.prefix),d=a(i,"textureXhrSettings");l&&s.setBaseURL(l),u&&s.setPath(u),c&&s.setPrefix(c);for(var p=0;p{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=i(31053),u=new s({Extends:r,initialize:function(t,e,i,s,n){var o="glsl";if(h(e)){var l=e;e=a(l,"key"),i=a(l,"url"),s=a(l,"shaderType","fragment"),n=a(l,"xhrSettings"),o=a(l,"extension",o)}else void 0===s&&(s="fragment");var u={type:"glsl",cache:t.cacheManager.shader,extension:o,responseType:"text",key:e,url:i,config:{shaderType:s},xhrSettings:n};r.call(this,t,u)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t=this.data.split("\n"),e=this.extractBlock(t,0);if(e)for(;e;){var i=this.getShaderName(e.header),s=this.getShaderType(e.header),n=this.getShaderUniforms(e.header),r=e.shader;if(this.cache.has(i)){var o=this.cache.get(i);"fragment"===s?o.fragmentSrc=r:o.vertexSrc=r,o.uniforms||(o.uniforms=n)}else"fragment"===s?this.cache.add(i,new l(i,r,"",n)):this.cache.add(i,new l(i,"",r,n));e=this.extractBlock(t,e.offset)}else"fragment"===this.config.shaderType?this.cache.add(this.key,new l(this.key,this.data)):this.cache.add(this.key,new l(this.key,"",this.data));this.pendingDestroy()},getShaderName:function(t){for(var e=0;e{var s=i(56694),n=i(683),r=i(98035),o=i(72632),a=i(30750),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s){if(h(e)){var n=e;e=o(n,"key"),s=o(n,"config",s)}var a={type:"audio",cache:t.cacheManager.audio,extension:i.type,key:e,url:i.url,config:s};r.call(this,t,a),this.locked="ontouchstart"in window,this.loaded=!1,this.filesLoaded=0,this.filesTotal=0},onLoad:function(){this.loaded||(this.loaded=!0,this.loader.nextFile(this,!0))},onError:function(){for(var t=0;t{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s){var n="html";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),s=a(o,"xhrSettings"),n=a(o,"extension",n)}var l={type:"text",cache:t.cacheManager.html,extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,l)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});o.register("html",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s,n,o){void 0===s&&(s=512),void 0===n&&(n=512);var l="html";if(h(e)){var u=e;e=a(u,"key"),i=a(u,"url"),o=a(u,"xhrSettings"),l=a(u,"extension",l),s=a(u,"width",s),n=a(u,"height",n)}var c={type:"html",cache:t.textureManager,extension:l,responseType:"text",key:e,url:i,xhrSettings:o,config:{width:s,height:n}};r.call(this,t,c)},onProcess:function(){this.state=n.FILE_PROCESSING;var t=this.config.width,e=this.config.height,i=[];i.push(''),i.push(''),i.push(''),i.push(this.xhrLoader.responseText),i.push(""),i.push(""),i.push("");var s=[i.join("\n")],o=this;try{var a=new window.Blob(s,{type:"image/svg+xml;charset=utf-8"})}catch(t){return o.state=n.FILE_ERRORED,void o.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){r.revokeObjectURL(o.data),o.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(o.data),o.onProcessError()},r.createObjectURL(this.data,a,"image/svg+xml")},addToCache:function(){var t=this.cache.addImage(this.key,this.data);this.pendingDestroy(t)}});o.register("htmlTexture",(function(t,e,i,s,n){if(Array.isArray(t))for(var r=0;r{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=i(30750),u=new s({Extends:r,initialize:function t(e,i,s,n,o){var l,u="png";if(h(i)){var c=i;i=a(c,"key"),s=a(c,"url"),l=a(c,"normalMap"),n=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(c,"frameConfig")}Array.isArray(s)&&(l=s[1],s=s[0]);var d={type:"image",cache:e.textureManager,extension:u,responseType:"blob",key:i,url:s,xhrSettings:n,config:o};if(r.call(this,e,d),l){var p=new t(e,this.key,l,n,o);p.type="normalMap",this.setLink(p),e.addFile(p)}this.useImageElementLoad="HTMLImageElement"===e.imageLoadType,this.useImageElementLoad&&(this.load=this.loadImage,this.onProcess=this.onProcessImage)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){r.revokeObjectURL(t.data),t.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(t.data),t.onProcessError()},r.createObjectURL(this.data,this.xhrLoader.response,"image/png")},onProcessImage:function(){var t=this.state;this.state=n.FILE_PROCESSING,t===n.FILE_LOADED?this.onProcessComplete():this.onProcessError()},loadImage:function(){if(this.state=n.FILE_LOADING,this.src=l(this,this.loader.baseURL),0===this.src.indexOf("data:"))console.warn("Local data URIs are not supported: "+this.key);else{this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){t.state=n.FILE_LOADED,t.loader.nextFile(t,!0)},this.data.onerror=function(){t.loader.nextFile(t,!1)},this.data.src=this.src}},addToCache:function(){var t,e=this.linkFile;e&&e.state===n.FILE_COMPLETE?(t="image"===this.type?this.cache.addImage(this.key,this.data,e.data):this.cache.addImage(e.key,e.data,this.data),this.pendingDestroy(t),e.pendingDestroy(t)):e||(t=this.cache.addImage(this.key,this.data),this.pendingDestroy(t))}});o.register("image",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(10850),l=i(42911),u=new s({Extends:r,initialize:function(t,e,i,s,o){var u="json";if(l(e)){var c=e;e=a(c,"key"),i=a(c,"url"),s=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(c,"dataKey",o)}var d={type:"json",cache:t.cacheManager.json,extension:u,responseType:"text",key:e,url:i,xhrSettings:s,config:o};r.call(this,t,d),l(i)&&(this.data=o?h(i,o):i,this.state=n.FILE_POPULATED)},onProcess:function(){if(this.state!==n.FILE_POPULATED){this.state=n.FILE_PROCESSING;try{var t=JSON.parse(this.xhrLoader.responseText)}catch(t){throw this.onProcessError(),t}var e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});o.register("json",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(76846),r=i(72632),o=i(42927),a=i(42911),h=i(70806),l=i(45176),u=new s({Extends:l,initialize:function(t,e,i,s,n,o,u){if(a(e)){var c=e;e=r(c,"key"),i=r(c,"url",!1)?r(c,"url"):r(c,"atlasURL"),o=r(c,"xhrSettings"),s=r(c,"path"),n=r(c,"baseURL"),u=r(c,"textureXhrSettings")}var d=new h(t,e,i,o);l.call(this,t,"multiatlas",e,[d]),this.config.path=s,this.config.baseURL=n,this.config.textureXhrSettings=u},onFileComplete:function(t){if(-1!==this.files.indexOf(t)&&(this.pending--,"json"===t.type&&t.data.hasOwnProperty("textures"))){var e=t.data.textures,i=this.config,s=this.loader,n=s.baseURL,a=s.path,h=s.prefix,l=r(i,"baseURL",this.baseURL),u=r(i,"path",this.path),c=r(i,"prefix",this.prefix),d=r(i,"textureXhrSettings");s.setBaseURL(l),s.setPath(u),s.setPrefix(c);for(var p=0;p{var s=i(56694),n=i(76846),r=i(72632),o=i(42911),a=i(45176),h=i(55188),l=new s({Extends:a,initialize:function(t,e,i,s){var n="js",l=[];if(o(e)){var u=e;e=r(u,"key"),i=r(u,"url"),s=r(u,"xhrSettings"),n=r(u,"extension",n)}Array.isArray(i)||(i=[i]);for(var c=0;c{var s=i(56694),n=i(76846),r=i(72632),o=i(42911),a=i(45176),h=i(27291),l=i(76799),u=i(86897),c=new s({Extends:a,initialize:function(t,e,i,s,n,h){var l,c,d=t.cacheManager.obj;if(o(e)){var p=e;e=r(p,"key"),l=new u(t,{key:e,type:"obj",cache:d,url:r(p,"url"),extension:r(p,"extension","obj"),xhrSettings:r(p,"xhrSettings"),config:{flipUV:r(p,"flipUV",n)}}),(s=r(p,"matURL"))&&(c=new u(t,{key:e,type:"mat",cache:d,url:s,extension:r(p,"matExtension","mat"),xhrSettings:r(p,"xhrSettings")}))}else l=new u(t,{key:e,url:i,type:"obj",cache:d,extension:"obj",xhrSettings:h,config:{flipUV:n}}),s&&(c=new u(t,{key:e,url:s,type:"mat",cache:d,extension:"mat",xhrSettings:h}));a.call(this,t,"obj",e,[l,c])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=h(t.data,t.config.flipUV);e&&(i.materials=l(e.data)),t.cache.add(t.key,i),this.complete=!0}}});n.register("obj",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var o=0;o{var s=i(56694),n=i(12117),r=i(76846),o=i(70806),a=new s({Extends:o,initialize:function(t,e,i,s,n){o.call(this,t,e,i,s,n),this.type="packfile"},onProcess:function(){this.state!==n.FILE_POPULATED&&(this.state=n.FILE_PROCESSING,this.data=JSON.parse(this.xhrLoader.responseText)),this.loader.addPack(this.data,this.config),this.onProcessComplete()}});r.register("pack",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s,o,l){var u="js";if(h(e)){var c=e;e=a(c,"key"),i=a(c,"url"),l=a(c,"xhrSettings"),u=a(c,"extension",u),s=a(c,"start"),o=a(c,"mapping")}var d={type:"plugin",cache:!1,extension:u,responseType:"text",key:e,url:i,xhrSettings:l,config:{start:s,mapping:o}};r.call(this,t,d),"function"==typeof i&&(this.data=i,this.state=n.FILE_POPULATED)},onProcess:function(){var t=this.loader.systems.plugins,e=this.config,i=a(e,"start",!1),s=a(e,"mapping",null);if(this.state===n.FILE_POPULATED)t.install(this.key,this.data,i,s);else{this.state=n.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data);var r=t.install(this.key,window[this.key],i,s);(i||s)&&(this.loader.systems[s]=r,this.loader.scene[s]=r)}this.onProcessComplete()}});o.register("plugin",(function(t,e,i,s,n){if(Array.isArray(t))for(var r=0;r{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s,n){var o="svg";if(h(e)){var l=e;e=a(l,"key"),i=a(l,"url"),s=a(l,"svgConfig",{}),n=a(l,"xhrSettings"),o=a(l,"extension",o)}var u={type:"svg",cache:t.textureManager,extension:o,responseType:"text",key:e,url:i,xhrSettings:n,config:{width:a(s,"width"),height:a(s,"height"),scale:a(s,"scale")}};r.call(this,t,u)},onProcess:function(){this.state=n.FILE_PROCESSING;var t=this.xhrLoader.responseText,e=[t],i=this.config.width,s=this.config.height,o=this.config.scale;t:if(i&&s||o){var a=(new DOMParser).parseFromString(t,"text/xml").getElementsByTagName("svg")[0],h=a.hasAttribute("viewBox"),l=parseFloat(a.getAttribute("width")),u=parseFloat(a.getAttribute("height"));if(!h&&l&&u)a.setAttribute("viewBox","0 0 "+l+" "+u);else if(h&&!l&&!u){var c=a.getAttribute("viewBox").split(/\s+|,/);l=c[2],u=c[3]}if(o){if(!l||!u)break t;i=l*o,s=u*o}a.setAttribute("width",i.toString()+"px"),a.setAttribute("height",s.toString()+"px"),e=[(new XMLSerializer).serializeToString(a)]}try{var d=new window.Blob(e,{type:"image/svg+xml;charset=utf-8"})}catch(t){return void this.onProcessError()}this.data=new Image,this.data.crossOrigin=this.crossOrigin;var p=this,f=!1;this.data.onload=function(){f||r.revokeObjectURL(p.data),p.onProcessComplete()},this.data.onerror=function(){f?p.onProcessError():(f=!0,r.revokeObjectURL(p.data),p.data.src="data:image/svg+xml,"+encodeURIComponent(e.join("")))},r.createObjectURL(this.data,d,"image/svg+xml")},addToCache:function(){var t=this.cache.addImage(this.key,this.data);this.pendingDestroy(t)}});o.register("svg",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s){var n="js";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),s=a(o,"xhrSettings"),n=a(o,"extension",n)}var l={type:"text",extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,l)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t=this.data.concat("(function(){\nreturn new "+this.key+"();\n}).call(this);"),e=eval;this.loader.sceneManager.add(this.key,e(t)),this.complete=!0}});o.register("sceneFile",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s,o,l){var u="js";if(h(e)){var c=e;e=a(c,"key"),i=a(c,"url"),l=a(c,"xhrSettings"),u=a(c,"extension",u),s=a(c,"systemKey"),o=a(c,"sceneKey")}var d={type:"scenePlugin",cache:!1,extension:u,responseType:"text",key:e,url:i,xhrSettings:l,config:{systemKey:s,sceneKey:o}};r.call(this,t,d),"function"==typeof i&&(this.data=i,this.state=n.FILE_POPULATED)},onProcess:function(){var t=this.loader.systems.plugins,e=this.config,i=this.key,s=a(e,"systemKey",i),r=a(e,"sceneKey",i);this.state===n.FILE_POPULATED?t.installScenePlugin(s,this.data,r,this.loader.scene,!0):(this.state=n.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data),t.installScenePlugin(s,window[this.key],r,this.loader.scene,!0)),this.onProcessComplete()}});o.register("scenePlugin",(function(t,e,i,s,n){if(Array.isArray(t))for(var r=0;r{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s){var n="js";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),s=a(o,"xhrSettings"),n=a(o,"extension",n)}var l={type:"script",cache:!1,extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,l)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data),this.onProcessComplete()}});o.register("script",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(76846),r=i(42927),o=new s({Extends:r,initialize:function(t,e,i,s,n){r.call(this,t,e,i,n,s),this.type="spritesheet"},addToCache:function(){var t=this.cache.addSpriteSheet(this.key,this.data,this.config);this.pendingDestroy(t)}});n.register("spritesheet",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s){var n="text",o="txt",l=t.cacheManager.text;if(h(e)){var u=e;e=a(u,"key"),i=a(u,"url"),s=a(u,"xhrSettings"),o=a(u,"extension",o),n=a(u,"type",n),l=a(u,"cache",l)}var c={type:n,cache:l,extension:o,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,c)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});o.register("text",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=i(93560),u=new s({Extends:r,initialize:function(t,e,i,s){var n="csv";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),s=a(o,"xhrSettings"),n=a(o,"extension",n)}var u={type:"tilemapCSV",cache:t.cacheManager.tilemap,extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,u),this.tilemapFormat=l.CSV},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t={format:this.tilemapFormat,data:this.data};this.cache.add(this.key,t),this.pendingDestroy(t)}});o.register("tilemapCSV",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(76846),r=i(70806),o=i(93560),a=new s({Extends:r,initialize:function(t,e,i,s){r.call(this,t,e,i,s),this.type="tilemapJSON",this.cache=t.cacheManager.tilemap},addToCache:function(){var t={format:o.WELTMEISTER,data:this.data};this.cache.add(this.key,t),this.pendingDestroy(t)}});n.register("tilemapImpact",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(76846),r=i(70806),o=i(93560),a=new s({Extends:r,initialize:function(t,e,i,s){r.call(this,t,e,i,s),this.type="tilemapJSON",this.cache=t.cacheManager.tilemap},addToCache:function(){var t={format:o.TILED_JSON,data:this.data};this.cache.add(this.key,t),this.pendingDestroy(t)}});n.register("tilemapTiledJSON",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(76846),r=i(72632),o=i(42927),a=i(42911),h=i(45176),l=i(86897),u=new s({Extends:h,initialize:function(t,e,i,s,n,u){var c,d;if(a(e)){var p=e;e=r(p,"key"),c=new o(t,{key:e,url:r(p,"textureURL"),extension:r(p,"textureExtension","png"),normalMap:r(p,"normalMap"),xhrSettings:r(p,"textureXhrSettings")}),d=new l(t,{key:e,url:r(p,"atlasURL"),extension:r(p,"atlasExtension","txt"),xhrSettings:r(p,"atlasXhrSettings")})}else c=new o(t,e,i,n),d=new l(t,e,s,u);c.linkFile?h.call(this,t,"unityatlas",e,[c,d,c.linkFile]):h.call(this,t,"unityatlas",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addUnityAtlas(t.key,t.data,e.data,i),e.pendingDestroy(),this.complete=!0}}});n.register("unityAtlas",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var o=0;o{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(30750),h=i(72632),l=i(42911),u=new s({Extends:r,initialize:function(t,e,i,s,n,o,a){void 0===s&&(s="loadeddata"),void 0===n&&(n=!1),void 0===o&&(o=!1),"loadeddata"!==s&&"canplay"!==s&&"canplaythrough"!==s&&(s="loadeddata");var h={type:"video",cache:t.cacheManager.video,extension:i.type,responseType:"blob",key:e,url:i.url,xhrSettings:a,config:{loadEvent:s,asBlob:n,noAudio:o}};this.onLoadCallback=this.onVideoLoadHandler.bind(this),this.onErrorCallback=this.onVideoErrorHandler.bind(this),r.call(this,t,h)},onProcess:function(){if(this.state=n.FILE_PROCESSING,this.config.asBlob){var t=this.createVideoElement();this.data=t;var e=this;this.data.onloadeddata=function(){e.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(e.data),e.onProcessError()},r.createObjectURL(t,this.xhrLoader.response,""),t.load()}else this.onProcessComplete()},createVideoElement:function(){var t=document.createElement("video");return t.controls=!1,t.crossOrigin=this.loader.crossOrigin,this.config.noAudio&&(t.muted=!0,t.defaultMuted=!0,t.setAttribute("autoplay","autoplay")),t.setAttribute("playsinline","playsinline"),t.setAttribute("preload","auto"),t},onVideoLoadHandler:function(t){var e=t.target;e.removeEventListener(this.config.loadEvent,this.onLoadCallback,!0),e.removeEventListener("error",this.onErrorCallback,!0),this.data=e,this.resetXHR(),this.loader.nextFile(this,!0)},onVideoErrorHandler:function(t){var e=t.target;e&&(e.removeEventListener(this.config.loadEvent,this.onLoadCallback,!0),e.removeEventListener("error",this.onErrorCallback,!0)),this.resetXHR(),this.loader.nextFile(this,!1)},load:function(){var t=this.config.loadEvent;if(this.config.asBlob)r.prototype.load.call(this);else{this.percentComplete=0;var e=this.createVideoElement();e.addEventListener(t,this.onLoadCallback,!0),e.addEventListener("error",this.onErrorCallback,!0),e.src=a(this,this.loader.baseURL),e.load()}}});u.create=function(t,e,i,s,n,r,o){var a=t.systems.game;l(e)&&(i=h(e,"url",[]),s=h(e,"loadEvent","loadeddata"),n=h(e,"asBlob",!1),r=h(e,"noAudio",!1),o=h(e,"xhrSettings"),e=h(e,"key"));var c=u.getVideoURL(a,i);if(c)return new u(t,e,c,s,n,r,o)},u.getVideoURL=function(t,e){Array.isArray(e)||(e=[e]);for(var i=0;i{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=i(89200),u=new s({Extends:r,initialize:function(t,e,i,s){var n="xml";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),s=a(o,"xhrSettings"),n=a(o,"extension",n)}var l={type:"xml",cache:t.cacheManager.xml,extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,l)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=l(this.xhrLoader.responseText),this.data?this.onProcessComplete():this.onProcessError()}});o.register("xml",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{t.exports={AnimationJSONFile:i(46468),AsepriteFile:i(31648),AtlasJSONFile:i(73152),AtlasXMLFile:i(24616),AudioFile:i(67448),AudioSpriteFile:i(66109),BinaryFile:i(40612),BitmapFontFile:i(54565),CompressedTextureFile:i(47375),CSSFile:i(99898),GLSLFile:i(46568),HTML5AudioFile:i(30929),HTMLFile:i(77459),HTMLTextureFile:i(9755),ImageFile:i(42927),JSONFile:i(70806),MultiAtlasFile:i(80802),MultiScriptFile:i(39034),OBJFile:i(85527),PackFile:i(3616),PluginFile:i(12217),SceneFile:i(95171),ScenePluginFile:i(82458),ScriptFile:i(55188),SpriteSheetFile:i(33536),SVGFile:i(4474),TextFile:i(86897),TilemapCSVFile:i(58673),TilemapImpactFile:i(98896),TilemapJSONFile:i(50563),UnityAtlasFile:i(82857),VideoFile:i(22833),XMLFile:i(15297)}},95695:(t,e,i)=>{var s=i(12117),n=i(98611),r={Events:i(683),FileTypes:i(34034),File:i(98035),FileTypesManager:i(76846),GetURL:i(30750),LoaderPlugin:i(67285),MergeXHRSettings:i(43531),MultiFile:i(45176),XHRLoader:i(88490),XHRSettings:i(33868)};r=n(!1,r,s),t.exports=r},26042:t=>{t.exports=function(t){for(var e=0,i=0;i{var s=i(8034);t.exports=function(t,e){return s(t)/s(e)/s(t-e)}},17489:t=>{t.exports=function(t,e){return Math.floor(Math.random()*(e-t+1)+t)}},14976:t=>{t.exports=function(t,e,i,s,n){var r=.5*(s-e),o=.5*(n-i),a=t*t;return(2*i-2*s+r+o)*(t*a)+(-3*i+3*s-2*r-o)*a+r*t+i}},89129:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.ceil(t*s)/s}},82897:t=>{t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},75606:(t,e,i)=>{var s=i(83392);t.exports=function(t){return t*s.DEG_TO_RAD}},767:t=>{t.exports=function(t,e){return Math.abs(t-e)}},9849:(t,e,i)=>{var s=i(82897),n=i(56694),r=i(16650),o=i(72283),a=new r,h=new n({initialize:function t(e,i,s,n){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=t.DefaultOrder),this._x=e,this._y=i,this._z=s,this._order=n,this.onChangeCallback=o},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback(this)}},set:function(t,e,i,s){return void 0===s&&(s=this._order),this._x=t,this._y=e,this._z=i,this._order=s,this.onChangeCallback(this),this},copy:function(t){return this.set(t.x,t.y,t.z,t.order)},setFromQuaternion:function(t,e,i){return void 0===e&&(e=this._order),void 0===i&&(i=!1),a.fromQuat(t),this.setFromRotationMatrix(a,e,i)},setFromRotationMatrix:function(t,e,i){void 0===e&&(e=this._order),void 0===i&&(i=!1);var n=t.val,r=n[0],o=n[4],a=n[8],h=n[1],l=n[5],u=n[9],c=n[2],d=n[6],p=n[10],f=0,v=0,g=0,m=.99999;switch(e){case"XYZ":v=Math.asin(s(a,-1,1)),Math.abs(a){t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},61616:t=>{t.exports=function(t,e){return Math.random()*(e-t)+t}},60679:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.floor(t*s)/s}},91806:(t,e,i)=>{var s=i(82897);t.exports=function(t,e,i){return(i-e)*(t=s(t,0,1))+e}},79366:t=>{t.exports=function(t,e){return t/e/1e3}},43776:t=>{t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},58442:t=>{t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},42798:t=>{t.exports=function(t,e,i){return(e-t)*i+t}},5341:(t,e,i)=>{var s=new(i(56694))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new s(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=s,this},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=l*r-o*h,c=-l*n+o*a,d=h*n-r*a,p=e*u+i*c+s*d;return p?(p=1/p,t[0]=u*p,t[1]=(-l*i+s*h)*p,t[2]=(o*i-s*r)*p,t[3]=c*p,t[4]=(l*e-s*a)*p,t[5]=(-o*e+s*n)*p,t[6]=d*p,t[7]=(-h*e+i*a)*p,t[8]=(r*e-i*n)*p,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return t[0]=r*l-o*h,t[1]=s*h-i*l,t[2]=i*o-s*r,t[3]=o*a-n*l,t[4]=e*l-s*a,t[5]=s*n-e*o,t[6]=n*h-r*a,t[7]=i*a-e*h,t[8]=e*r-i*n,this},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return e*(l*r-o*h)+i*(-l*n+o*a)+s*(h*n-r*a)},multiply:function(t){var e=this.val,i=e[0],s=e[1],n=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=t.val,d=c[0],p=c[1],f=c[2],v=c[3],g=c[4],m=c[5],y=c[6],x=c[7],T=c[8];return e[0]=d*i+p*r+f*h,e[1]=d*s+p*o+f*l,e[2]=d*n+p*a+f*u,e[3]=v*i+g*r+m*h,e[4]=v*s+g*o+m*l,e[5]=v*n+g*a+m*u,e[6]=y*i+x*r+T*h,e[7]=y*s+x*o+T*l,e[8]=y*n+x*a+T*u,this},translate:function(t){var e=this.val,i=t.x,s=t.y;return e[6]=i*e[0]+s*e[3]+e[6],e[7]=i*e[1]+s*e[4]+e[7],e[8]=i*e[2]+s*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],s=e[1],n=e[2],r=e[3],o=e[4],a=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*r,e[1]=l*s+h*o,e[2]=l*n+h*a,e[3]=l*r-h*i,e[4]=l*o-h*s,e[5]=l*a-h*n,this},scale:function(t){var e=this.val,i=t.x,s=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=s*e[3],e[4]=s*e[4],e[5]=s*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,s=t.z,n=t.w,r=e+e,o=i+i,a=s+s,h=e*r,l=e*o,u=e*a,c=i*o,d=i*a,p=s*a,f=n*r,v=n*o,g=n*a,m=this.val;return m[0]=1-(c+p),m[3]=l+g,m[6]=u-v,m[1]=l-g,m[4]=1-(h+p),m[7]=d+f,m[2]=u+v,m[5]=d-f,m[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,i=this.val,s=e[0],n=e[1],r=e[2],o=e[3],a=e[4],h=e[5],l=e[6],u=e[7],c=e[8],d=e[9],p=e[10],f=e[11],v=e[12],g=e[13],m=e[14],y=e[15],x=s*h-n*a,T=s*l-r*a,w=s*u-o*a,b=n*l-r*h,E=n*u-o*h,S=r*u-o*l,A=c*g-d*v,_=c*m-p*v,C=c*y-f*v,M=d*m-p*g,R=d*y-f*g,P=p*y-f*m,O=x*P-T*R+w*M+b*C-E*_+S*A;return O?(O=1/O,i[0]=(h*P-l*R+u*M)*O,i[1]=(l*C-a*P-u*_)*O,i[2]=(a*R-h*C+u*A)*O,i[3]=(r*R-n*P-o*M)*O,i[4]=(s*P-r*C+o*_)*O,i[5]=(n*C-s*R-o*A)*O,i[6]=(g*S-m*E+y*b)*O,i[7]=(m*w-v*S-y*T)*O,i[8]=(v*E-g*w+y*x)*O,this):null}});t.exports=s},16650:(t,e,i)=>{var s=i(56694),n=i(70015),r=1e-6,o=new s({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new o(this)},set:function(t){return this.copy(t)},setValues:function(t,e,i,s,n,r,o,a,h,l,u,c,d,p,f,v){var g=this.val;return g[0]=t,g[1]=e,g[2]=i,g[3]=s,g[4]=n,g[5]=r,g[6]=o,g[7]=a,g[8]=h,g[9]=l,g[10]=u,g[11]=c,g[12]=d,g[13]=p,g[14]=f,g[15]=v,this},copy:function(t){var e=t.val;return this.setValues(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},fromArray:function(t){return this.setValues(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(t,e,i){var s=a.fromQuat(i).val,n=e.x,r=e.y,o=e.z;return this.setValues(s[0]*n,s[1]*n,s[2]*n,0,s[4]*r,s[5]*r,s[6]*r,0,s[8]*o,s[9]*o,s[10]*o,0,t.x,t.y,t.z,1)},xyz:function(t,e,i){this.identity();var s=this.val;return s[12]=t,s[13]=e,s[14]=i,this},scaling:function(t,e,i){this.zero();var s=this.val;return s[0]=t,s[5]=e,s[10]=i,s[15]=1,this},identity:function(){return this.setValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[3],n=t[6],r=t[7],o=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=n,t[11]=t[14],t[12]=s,t[13]=r,t[14]=o,this},getInverse:function(t){return this.copy(t),this.invert()},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],p=t[12],f=t[13],v=t[14],g=t[15],m=e*o-i*r,y=e*a-s*r,x=e*h-n*r,T=i*a-s*o,w=i*h-n*o,b=s*h-n*a,E=l*f-u*p,S=l*v-c*p,A=l*g-d*p,_=u*v-c*f,C=u*g-d*f,M=c*g-d*v,R=m*M-y*C+x*_+T*A-w*S+b*E;return R?(R=1/R,this.setValues((o*M-a*C+h*_)*R,(s*C-i*M-n*_)*R,(f*b-v*w+g*T)*R,(c*w-u*b-d*T)*R,(a*A-r*M-h*S)*R,(e*M-s*A+n*S)*R,(v*x-p*b-g*y)*R,(l*b-c*x+d*y)*R,(r*C-o*A+h*E)*R,(i*A-e*C-n*E)*R,(p*w-f*x+g*m)*R,(u*x-l*w-d*m)*R,(o*S-r*_-a*E)*R,(e*_-i*S+s*E)*R,(f*y-p*T-v*m)*R,(l*T-u*y+c*m)*R)):this},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],p=t[12],f=t[13],v=t[14],g=t[15];return this.setValues(o*(c*g-d*v)-u*(a*g-h*v)+f*(a*d-h*c),-(i*(c*g-d*v)-u*(s*g-n*v)+f*(s*d-n*c)),i*(a*g-h*v)-o*(s*g-n*v)+f*(s*h-n*a),-(i*(a*d-h*c)-o*(s*d-n*c)+u*(s*h-n*a)),-(r*(c*g-d*v)-l*(a*g-h*v)+p*(a*d-h*c)),e*(c*g-d*v)-l*(s*g-n*v)+p*(s*d-n*c),-(e*(a*g-h*v)-r*(s*g-n*v)+p*(s*h-n*a)),e*(a*d-h*c)-r*(s*d-n*c)+l*(s*h-n*a),r*(u*g-d*f)-l*(o*g-h*f)+p*(o*d-h*u),-(e*(u*g-d*f)-l*(i*g-n*f)+p*(i*d-n*u)),e*(o*g-h*f)-r*(i*g-n*f)+p*(i*h-n*o),-(e*(o*d-h*u)-r*(i*d-n*u)+l*(i*h-n*o)),-(r*(u*v-c*f)-l*(o*v-a*f)+p*(o*c-a*u)),e*(u*v-c*f)-l*(i*v-s*f)+p*(i*c-s*u),-(e*(o*v-a*f)-r*(i*v-s*f)+p*(i*a-s*o)),e*(o*c-a*u)-r*(i*c-s*u)+l*(i*a-s*o))},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],p=t[12],f=t[13],v=t[14],g=t[15];return(e*o-i*r)*(c*g-d*v)-(e*a-s*r)*(u*g-d*f)+(e*h-n*r)*(u*v-c*f)+(i*a-s*o)*(l*g-d*p)-(i*h-n*o)*(l*v-c*p)+(s*h-n*a)*(l*f-u*p)},multiply:function(t){var e=this.val,i=e[0],s=e[1],n=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=e[9],d=e[10],p=e[11],f=e[12],v=e[13],g=e[14],m=e[15],y=t.val,x=y[0],T=y[1],w=y[2],b=y[3];return e[0]=x*i+T*o+w*u+b*f,e[1]=x*s+T*a+w*c+b*v,e[2]=x*n+T*h+w*d+b*g,e[3]=x*r+T*l+w*p+b*m,x=y[4],T=y[5],w=y[6],b=y[7],e[4]=x*i+T*o+w*u+b*f,e[5]=x*s+T*a+w*c+b*v,e[6]=x*n+T*h+w*d+b*g,e[7]=x*r+T*l+w*p+b*m,x=y[8],T=y[9],w=y[10],b=y[11],e[8]=x*i+T*o+w*u+b*f,e[9]=x*s+T*a+w*c+b*v,e[10]=x*n+T*h+w*d+b*g,e[11]=x*r+T*l+w*p+b*m,x=y[12],T=y[13],w=y[14],b=y[15],e[12]=x*i+T*o+w*u+b*f,e[13]=x*s+T*a+w*c+b*v,e[14]=x*n+T*h+w*d+b*g,e[15]=x*r+T*l+w*p+b*m,this},multiplyLocal:function(t){var e=this.val,i=t.val;return this.setValues(e[0]*i[0]+e[1]*i[4]+e[2]*i[8]+e[3]*i[12],e[0]*i[1]+e[1]*i[5]+e[2]*i[9]+e[3]*i[13],e[0]*i[2]+e[1]*i[6]+e[2]*i[10]+e[3]*i[14],e[0]*i[3]+e[1]*i[7]+e[2]*i[11]+e[3]*i[15],e[4]*i[0]+e[5]*i[4]+e[6]*i[8]+e[7]*i[12],e[4]*i[1]+e[5]*i[5]+e[6]*i[9]+e[7]*i[13],e[4]*i[2]+e[5]*i[6]+e[6]*i[10]+e[7]*i[14],e[4]*i[3]+e[5]*i[7]+e[6]*i[11]+e[7]*i[15],e[8]*i[0]+e[9]*i[4]+e[10]*i[8]+e[11]*i[12],e[8]*i[1]+e[9]*i[5]+e[10]*i[9]+e[11]*i[13],e[8]*i[2]+e[9]*i[6]+e[10]*i[10]+e[11]*i[14],e[8]*i[3]+e[9]*i[7]+e[10]*i[11]+e[11]*i[15],e[12]*i[0]+e[13]*i[4]+e[14]*i[8]+e[15]*i[12],e[12]*i[1]+e[13]*i[5]+e[14]*i[9]+e[15]*i[13],e[12]*i[2]+e[13]*i[6]+e[14]*i[10]+e[15]*i[14],e[12]*i[3]+e[13]*i[7]+e[14]*i[11]+e[15]*i[15])},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.val,s=e.val,n=i[0],r=i[4],o=i[8],a=i[12],h=i[1],l=i[5],u=i[9],c=i[13],d=i[2],p=i[6],f=i[10],v=i[14],g=i[3],m=i[7],y=i[11],x=i[15],T=s[0],w=s[4],b=s[8],E=s[12],S=s[1],A=s[5],_=s[9],C=s[13],M=s[2],R=s[6],P=s[10],O=s[14],L=s[3],F=s[7],D=s[11],k=s[15];return this.setValues(n*T+r*S+o*M+a*L,h*T+l*S+u*M+c*L,d*T+p*S+f*M+v*L,g*T+m*S+y*M+x*L,n*w+r*A+o*R+a*F,h*w+l*A+u*R+c*F,d*w+p*A+f*R+v*F,g*w+m*A+y*R+x*F,n*b+r*_+o*P+a*D,h*b+l*_+u*P+c*D,d*b+p*_+f*P+v*D,g*b+m*_+y*P+x*D,n*E+r*C+o*O+a*k,h*E+l*C+u*O+c*k,d*E+p*C+f*O+v*k,g*E+m*C+y*O+x*k)},translate:function(t){return this.translateXYZ(t.x,t.y,t.z)},translateXYZ:function(t,e,i){var s=this.val;return s[12]=s[0]*t+s[4]*e+s[8]*i+s[12],s[13]=s[1]*t+s[5]*e+s[9]*i+s[13],s[14]=s[2]*t+s[6]*e+s[10]*i+s[14],s[15]=s[3]*t+s[7]*e+s[11]*i+s[15],this},scale:function(t){return this.scaleXYZ(t.x,t.y,t.z)},scaleXYZ:function(t,e,i){var s=this.val;return s[0]=s[0]*t,s[1]=s[1]*t,s[2]=s[2]*t,s[3]=s[3]*t,s[4]=s[4]*e,s[5]=s[5]*e,s[6]=s[6]*e,s[7]=s[7]*e,s[8]=s[8]*i,s[9]=s[9]*i,s[10]=s[10]*i,s[11]=s[11]*i,this},makeRotationAxis:function(t,e){var i=Math.cos(e),s=Math.sin(e),n=1-i,r=t.x,o=t.y,a=t.z,h=n*r,l=n*o;return this.setValues(h*r+i,h*o-s*a,h*a+s*o,0,h*o+s*a,l*o+i,l*a-s*r,0,h*a-s*o,l*a+s*r,n*a*a+i,0,0,0,0,1)},rotate:function(t,e){var i=this.val,s=e.x,n=e.y,o=e.z,a=Math.sqrt(s*s+n*n+o*o);if(Math.abs(a){t.exports=function(t,e,i){return Math.min(t+e,i)}},37394:t=>{t.exports=function(t){var e=t.length;if(0===e)return 0;t.sort((function(t,e){return t-e}));var i=Math.floor(e/2);return e%2==0?(t[i]+t[i-1])/2:t[i]}},17259:t=>{t.exports=function(t,e,i){return Math.max(t-e,i)}},61820:t=>{t.exports=function(t,e,i,s){void 0===i&&(i=e+1);var n=(t-e)/(i-e);return n>1?void 0!==s?(n=(s-t)/(s-i))<0&&(n=0):n=1:n<0&&(n=0),n}},75003:(t,e,i)=>{var s=i(56694),n=i(5341),r=i(72283),o=i(70015),a=1e-6,h=new Int8Array([1,2,0]),l=new Float32Array([0,0,0]),u=new o(1,0,0),c=new o(0,1,0),d=new o,p=new n,f=new s({initialize:function(t,e,i,s){this.onChangeCallback=r,this.set(t,e,i,s)},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback(this)}},copy:function(t){return this.set(t)},set:function(t,e,i,s,n){return void 0===n&&(n=!0),"object"==typeof t?(this._x=t.x||0,this._y=t.y||0,this._z=t.z||0,this._w=t.w||0):(this._x=t||0,this._y=e||0,this._z=i||0,this._w=s||0),n&&this.onChangeCallback(this),this},add:function(t){return this._x+=t.x,this._y+=t.y,this._z+=t.z,this._w+=t.w,this.onChangeCallback(this),this},subtract:function(t){return this._x-=t.x,this._y-=t.y,this._z-=t.z,this._w-=t.w,this.onChangeCallback(this),this},scale:function(t){return this._x*=t,this._y*=t,this._z*=t,this._w*=t,this.onChangeCallback(this),this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,n=t*t+e*e+i*i+s*s;return n>0&&(n=1/Math.sqrt(n),this._x=t*n,this._y=e*n,this._z=i*n,this._w=s*n),this.onChangeCallback(this),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,n=this.z,r=this.w;return this.set(i+e*(t.x-i),s+e*(t.y-s),n+e*(t.z-n),r+e*(t.w-r))},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(d.copy(u).cross(t).length().999999?this.set(0,0,0,1):(d.copy(t).cross(e),this._x=d.x,this._y=d.y,this._z=d.z,this._w=1+i,this.normalize())},setAxes:function(t,e,i){var s=p.val;return s[0]=e.x,s[3]=e.y,s[6]=e.z,s[1]=i.x,s[4]=i.y,s[7]=i.z,s[2]=-t.x,s[5]=-t.y,s[8]=-t.z,this.fromMat3(p).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.set(i*t.x,i*t.y,i*t.z,Math.cos(e))},multiply:function(t){var e=this.x,i=this.y,s=this.z,n=this.w,r=t.x,o=t.y,a=t.z,h=t.w;return this.set(e*h+n*r+i*a-s*o,i*h+n*o+s*r-e*a,s*h+n*a+e*o-i*r,n*h-e*r-i*o-s*a)},slerp:function(t,e){var i=this.x,s=this.y,n=this.z,r=this.w,o=t.x,h=t.y,l=t.z,u=t.w,c=i*o+s*h+n*l+r*u;c<0&&(c=-c,o=-o,h=-h,l=-l,u=-u);var d=1-e,p=e;if(1-c>a){var f=Math.acos(c),v=Math.sin(f);d=Math.sin((1-e)*f)/v,p=Math.sin(e*f)/v}return this.set(d*i+p*o,d*s+p*h,d*n+p*l,d*r+p*u)},invert:function(){var t=this.x,e=this.y,i=this.z,s=this.w,n=t*t+e*e+i*i+s*s,r=n?1/n:0;return this.set(-t*r,-e*r,-i*r,s*r)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,n=this.w,r=Math.sin(t),o=Math.cos(t);return this.set(e*o+n*r,i*o+s*r,s*o-i*r,n*o-e*r)},rotateY:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,n=this.w,r=Math.sin(t),o=Math.cos(t);return this.set(e*o-s*r,i*o+n*r,s*o+e*r,n*o-i*r)},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,n=this.w,r=Math.sin(t),o=Math.cos(t);return this.set(e*o+i*r,i*o-e*r,s*o+n*r,n*o-s*r)},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},setFromEuler:function(t,e){var i=t.x/2,s=t.y/2,n=t.z/2,r=Math.cos(i),o=Math.cos(s),a=Math.cos(n),h=Math.sin(i),l=Math.sin(s),u=Math.sin(n);switch(t.order){case"XYZ":this.set(h*o*a+r*l*u,r*l*a-h*o*u,r*o*u+h*l*a,r*o*a-h*l*u,e);break;case"YXZ":this.set(h*o*a+r*l*u,r*l*a-h*o*u,r*o*u-h*l*a,r*o*a+h*l*u,e);break;case"ZXY":this.set(h*o*a-r*l*u,r*l*a+h*o*u,r*o*u+h*l*a,r*o*a-h*l*u,e);break;case"ZYX":this.set(h*o*a-r*l*u,r*l*a+h*o*u,r*o*u-h*l*a,r*o*a+h*l*u,e);break;case"YZX":this.set(h*o*a+r*l*u,r*l*a+h*o*u,r*o*u-h*l*a,r*o*a-h*l*u,e);break;case"XZY":this.set(h*o*a-r*l*u,r*l*a-h*o*u,r*o*u+h*l*a,r*o*a+h*l*u,e)}return this},setFromRotationMatrix:function(t){var e,i=t.val,s=i[0],n=i[4],r=i[8],o=i[1],a=i[5],h=i[9],l=i[2],u=i[6],c=i[10],d=s+a+c;return d>0?(e=.5/Math.sqrt(d+1),this.set((u-h)*e,(r-l)*e,(o-n)*e,.25/e)):s>a&&s>c?(e=2*Math.sqrt(1+s-a-c),this.set(.25*e,(n+o)/e,(r+l)/e,(u-h)/e)):a>c?(e=2*Math.sqrt(1+a-s-c),this.set((n+o)/e,.25*e,(h+u)/e,(r-l)/e)):(e=2*Math.sqrt(1+c-s-a),this.set((r+l)/e,(h+u)/e,.25*e,(o-n)/e)),this},fromMat3:function(t){var e,i=t.val,s=i[0]+i[4]+i[8];if(s>0)e=Math.sqrt(s+1),this.w=.5*e,e=.5/e,this._x=(i[7]-i[5])*e,this._y=(i[2]-i[6])*e,this._z=(i[3]-i[1])*e;else{var n=0;i[4]>i[0]&&(n=1),i[8]>i[3*n+n]&&(n=2);var r=h[n],o=h[r];e=Math.sqrt(i[3*n+n]-i[3*r+r]-i[3*o+o]+1),l[n]=.5*e,e=.5/e,l[r]=(i[3*r+n]+i[3*n+r])*e,l[o]=(i[3*o+n]+i[3*n+o])*e,this._x=l[0],this._y=l[1],this._z=l[2],this._w=(i[3*o+r]-i[3*r+o])*e}return this.onChangeCallback(this),this}});t.exports=f},23701:(t,e,i)=>{var s=i(83392);t.exports=function(t){return t*s.RAD_TO_DEG}},16906:t=>{t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},52417:t=>{t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,s=2*Math.random()-1,n=Math.sqrt(1-s*s)*e;return t.x=Math.cos(i)*n,t.y=Math.sin(i)*n,t.z=s*e,t}},17915:t=>{t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},52257:t=>{t.exports=function(t,e){var i=t.x,s=t.y;return t.x=i*Math.cos(e)-s*Math.sin(e),t.y=i*Math.sin(e)+s*Math.cos(e),t}},2386:t=>{t.exports=function(t,e,i,s){var n=Math.cos(s),r=Math.sin(s),o=t.x-e,a=t.y-i;return t.x=o*n-a*r+e,t.y=o*r+a*n+i,t}},72395:t=>{t.exports=function(t,e,i,s,n){var r=s+Math.atan2(t.y-i,t.x-e);return t.x=e+n*Math.cos(r),t.y=i+n*Math.sin(r),t}},41061:t=>{t.exports=function(t,e,i,s,n){return t.x=e+n*Math.cos(s),t.y=i+n*Math.sin(s),t}},93709:(t,e,i)=>{var s=i(70015),n=i(16650),r=i(75003),o=new n,a=new r,h=new s;t.exports=function(t,e,i){return a.setAxisAngle(e,i),o.fromRotationTranslation(a,h.set(0,0,0)),t.transformMat4(o)}},67233:t=>{t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},64333:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.round(t*s)/s}},59533:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=1),void 0===i&&(i=1),void 0===s&&(s=1),s*=Math.PI/t;for(var n=[],r=[],o=0;o{t.exports=function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},87736:t=>{t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},55805:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n){void 0===n&&(n=new s);var r=0,o=0;return t>0&&t<=e*i&&(r=t>e-1?t-(o=Math.floor(t/e))*e:t),n.set(r,o)}},64462:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r,o,a,h){void 0===h&&(h=new s);var l=Math.sin(r),u=Math.cos(r),c=u*o,d=l*o,p=-l*a,f=u*a,v=1/(c*f+p*-d);return h.x=f*v*t+-p*v*e+(n*p-i*f)*v,h.y=c*v*e+-d*v*t+(-n*c+i*d)*v,h}},93736:(t,e,i)=>{var s=i(56694),n=i(88456),r=new s({initialize:function(t,e){this.x=0,this.y=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0):(void 0===e&&(e=t),this.x=t||0,this.y=e||0)},clone:function(){return new r(this.x,this.y)},copy:function(t){return this.x=t.x||0,this.y=t.y||0,this},setFromObject:function(t){return this.x=t.x||0,this.y=t.y||0,this},set:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setTo:function(t,e){return this.set(t,e)},setToPolar:function(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this},equals:function(t){return this.x===t.x&&this.y===t.y},fuzzyEquals:function(t,e){return n(this.x,t.x,e)&&n(this.y,t.y,e)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},setAngle:function(t){return this.setToPolar(t,this.length())},add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},length:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},setLength:function(t){return this.normalize().scale(t)},lengthSq:function(){var t=this.x,e=this.y;return t*t+e*e},normalize:function(){var t=this.x,e=this.y,i=t*t+e*e;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},normalizeLeftHand:function(){var t=this.x;return this.x=this.y,this.y=-1*t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this},transformMat3:function(t){var e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[3]*i+s[6],this.y=s[1]*e+s[4]*i+s[7],this},transformMat4:function(t){var e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[4]*i+s[12],this.y=s[1]*e+s[5]*i+s[13],this},reset:function(){return this.x=0,this.y=0,this},limit:function(t){var e=this.length();return e&&e>t&&this.scale(t/e),this},reflect:function(t){return t=t.clone().normalize(),this.subtract(t.scale(2*this.dot(t)))},mirror:function(t){return this.reflect(t).negate()},rotate:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e*this.x-i*this.y,i*this.x+e*this.y)}});r.ZERO=new r,r.RIGHT=new r(1,0),r.LEFT=new r(-1,0),r.UP=new r(0,-1),r.DOWN=new r(0,1),r.ONE=new r(1,1),t.exports=r},70015:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clone:function(){return new s(this.x,this.y,this.z)},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},crossVectors:function(t,e){var i=t.x,s=t.y,n=t.z,r=e.x,o=e.y,a=e.z;return this.x=s*a-n*o,this.y=n*r-i*a,this.z=i*o-s*r,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},setFromMatrixPosition:function(t){return this.fromArray(t.val,12)},setFromMatrixColumn:function(t,e){return this.fromArray(t.val,4*e)},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addScale:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return Math.sqrt(e*e+i*i+s*s)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return e*e+i*i+s*s},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,s=t*t+e*e+i*i;return s>0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,s=this.z,n=t.x,r=t.y,o=t.z;return this.x=i*o-s*r,this.y=s*n-e*o,this.z=e*r-i*n,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,n=this.z;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=n+e*(t.z-n),this},applyMatrix3:function(t){var e=this.x,i=this.y,s=this.z,n=t.val;return this.x=n[0]*e+n[3]*i+n[6]*s,this.y=n[1]*e+n[4]*i+n[7]*s,this.z=n[2]*e+n[5]*i+n[8]*s,this},applyMatrix4:function(t){var e=this.x,i=this.y,s=this.z,n=t.val,r=1/(n[3]*e+n[7]*i+n[11]*s+n[15]);return this.x=(n[0]*e+n[4]*i+n[8]*s+n[12])*r,this.y=(n[1]*e+n[5]*i+n[9]*s+n[13])*r,this.z=(n[2]*e+n[6]*i+n[10]*s+n[14])*r,this},transformMat3:function(t){var e=this.x,i=this.y,s=this.z,n=t.val;return this.x=e*n[0]+i*n[3]+s*n[6],this.y=e*n[1]+i*n[4]+s*n[7],this.z=e*n[2]+i*n[5]+s*n[8],this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,n=t.val;return this.x=n[0]*e+n[4]*i+n[8]*s+n[12],this.y=n[1]*e+n[5]*i+n[9]*s+n[13],this.z=n[2]*e+n[6]*i+n[10]*s+n[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,s=this.z,n=t.val,r=e*n[0]+i*n[4]+s*n[8]+n[12],o=e*n[1]+i*n[5]+s*n[9]+n[13],a=e*n[2]+i*n[6]+s*n[10]+n[14],h=e*n[3]+i*n[7]+s*n[11]+n[15];return this.x=r/h,this.y=o/h,this.z=a/h,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,n=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*s-o*i,l=a*i+o*e-n*s,u=a*s+n*i-r*e,c=-n*e-r*i-o*s;return this.x=h*a+c*-n+l*-o-u*-r,this.y=l*a+c*-r+u*-n-h*-o,this.z=u*a+c*-o+h*-r-l*-n,this},project:function(t){var e=this.x,i=this.y,s=this.z,n=t.val,r=n[0],o=n[1],a=n[2],h=n[3],l=n[4],u=n[5],c=n[6],d=n[7],p=n[8],f=n[9],v=n[10],g=n[11],m=n[12],y=n[13],x=n[14],T=1/(e*h+i*d+s*g+n[15]);return this.x=(e*r+i*l+s*p+m)*T,this.y=(e*o+i*u+s*f+y)*T,this.z=(e*a+i*c+s*v+x)*T,this},projectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unprojectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unproject:function(t,e){var i=t.x,s=t.y,n=t.z,r=t.w,o=this.x-i,a=r-this.y-1-s,h=this.z;return this.x=2*o/n-1,this.y=2*a/r-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});s.ZERO=new s,s.RIGHT=new s(1,0,0),s.LEFT=new s(-1,0,0),s.UP=new s(0,-1,0),s.DOWN=new s(0,1,0),s.FORWARD=new s(0,0,1),s.BACK=new s(0,0,-1),s.ONE=new s(1,1,1),t.exports=s},51729:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0)},clone:function(){return new s(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,s){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,n=t*t+e*e+i*i+s*s;return n>0&&(n=1/Math.sqrt(n),this.x=t*n,this.y=e*n,this.z=i*n,this.w=s*n),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,n=this.z,r=this.w;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=n+e*(t.z-n),this.w=r+e*(t.w-r),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,n=t.w-this.w||0;return Math.sqrt(e*e+i*i+s*s+n*n)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,n=t.w-this.w||0;return e*e+i*i+s*s+n*n},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,n=this.w,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*s+r[12]*n,this.y=r[1]*e+r[5]*i+r[9]*s+r[13]*n,this.z=r[2]*e+r[6]*i+r[10]*s+r[14]*n,this.w=r[3]*e+r[7]*i+r[11]*s+r[15]*n,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,n=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*s-o*i,l=a*i+o*e-n*s,u=a*s+n*i-r*e,c=-n*e-r*i-o*s;return this.x=h*a+c*-n+l*-o-u*-r,this.y=l*a+c*-r+u*-n-h*-o,this.z=u*a+c*-o+h*-r-l*-n,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});s.prototype.sub=s.prototype.subtract,s.prototype.mul=s.prototype.multiply,s.prototype.div=s.prototype.divide,s.prototype.dist=s.prototype.distance,s.prototype.distSq=s.prototype.distanceSq,s.prototype.len=s.prototype.length,s.prototype.lenSq=s.prototype.lengthSq,t.exports=s},9557:t=>{t.exports=function(t,e,i){return Math.abs(t-e)<=i}},1071:t=>{t.exports=function(t,e,i){var s=i-e;return e+((t-e)%s+s)%s}},90447:t=>{t.exports=function(t,e,i,s){return Math.atan2(s-e,i-t)}},94240:t=>{t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},84066:t=>{t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},9678:t=>{t.exports=function(t,e,i,s){return Math.atan2(i-t,s-e)}},76861:(t,e,i)=>{var s=i(83392);t.exports=function(t){return t>Math.PI&&(t-=s.PI2),Math.abs(((t+s.TAU)%s.PI2-s.PI2)%s.PI2)}},37570:t=>{t.exports=function(t){return(t%=2*Math.PI)>=0?t:t+2*Math.PI}},87597:(t,e,i)=>{var s=i(61616);t.exports=function(){return s(-Math.PI,Math.PI)}},74493:(t,e,i)=>{var s=i(61616);t.exports=function(){return s(-180,180)}},19049:(t,e,i)=>{var s=i(37570);t.exports=function(t){return s(t+Math.PI)}},90612:(t,e,i)=>{var s=i(83392);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=s.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e{t.exports=function(t,e){var i=e-t;return 0===i?0:i-360*Math.floor((i- -180)/360)}},35786:(t,e,i)=>{var s=i(1071);t.exports=function(t){return s(t,-Math.PI,Math.PI)}},62138:(t,e,i)=>{var s=i(1071);t.exports=function(t){return s(t,-180,180)}},22153:(t,e,i)=>{t.exports={Between:i(90447),BetweenPoints:i(94240),BetweenPointsY:i(84066),BetweenY:i(9678),CounterClockwise:i(76861),Normalize:i(37570),Random:i(87597),RandomDegrees:i(74493),Reverse:i(19049),RotateTo:i(90612),ShortestBetween:i(93954),Wrap:i(35786),WrapDegrees:i(62138)}},83392:t=>{var e={PI2:2*Math.PI,TAU:.5*Math.PI,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:null,MIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER||-9007199254740991,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991};t.exports=e},53996:t=>{t.exports=function(t,e,i,s){var n=t-i,r=e-s;return Math.sqrt(n*n+r*r)}},92951:t=>{t.exports=function(t,e){var i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)}},12161:t=>{t.exports=function(t,e){var i=t.x-e.x,s=t.y-e.y;return i*i+s*s}},38057:t=>{t.exports=function(t,e,i,s){return Math.max(Math.abs(t-i),Math.abs(e-s))}},33297:t=>{t.exports=function(t,e,i,s,n){return void 0===n&&(n=2),Math.sqrt(Math.pow(i-t,n)+Math.pow(s-e,n))}},90366:t=>{t.exports=function(t,e,i,s){return Math.abs(t-i)+Math.abs(e-s)}},35032:t=>{t.exports=function(t,e,i,s){var n=t-i,r=e-s;return n*n+r*r}},10130:(t,e,i)=>{t.exports={Between:i(53996),BetweenPoints:i(92951),BetweenPointsSquared:i(12161),Chebyshev:i(38057),Power:i(33297),Snake:i(90366),Squared:i(35032)}},35060:(t,e,i)=>{var s=i(25265),n=i(57428),r=i(73214),o=i(71778),a=i(36468),h=i(88258),l=i(52910),u=i(67799),c=i(74083),d=i(92284),p=i(28035),f=i(8754);t.exports={Power0:l,Power1:u.Out,Power2:o.Out,Power3:c.Out,Power4:d.Out,Linear:l,Quad:u.Out,Cubic:o.Out,Quart:c.Out,Quint:d.Out,Sine:p.Out,Expo:h.Out,Circ:r.Out,Elastic:a.Out,Back:s.Out,Bounce:n.Out,Stepped:f,"Quad.easeIn":u.In,"Cubic.easeIn":o.In,"Quart.easeIn":c.In,"Quint.easeIn":d.In,"Sine.easeIn":p.In,"Expo.easeIn":h.In,"Circ.easeIn":r.In,"Elastic.easeIn":a.In,"Back.easeIn":s.In,"Bounce.easeIn":n.In,"Quad.easeOut":u.Out,"Cubic.easeOut":o.Out,"Quart.easeOut":c.Out,"Quint.easeOut":d.Out,"Sine.easeOut":p.Out,"Expo.easeOut":h.Out,"Circ.easeOut":r.Out,"Elastic.easeOut":a.Out,"Back.easeOut":s.Out,"Bounce.easeOut":n.Out,"Quad.easeInOut":u.InOut,"Cubic.easeInOut":o.InOut,"Quart.easeInOut":c.InOut,"Quint.easeInOut":d.InOut,"Sine.easeInOut":p.InOut,"Expo.easeInOut":h.InOut,"Circ.easeInOut":r.InOut,"Elastic.easeInOut":a.InOut,"Back.easeInOut":s.InOut,"Bounce.easeInOut":n.InOut}},25860:t=>{t.exports=function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)}},45264:t=>{t.exports=function(t,e){void 0===e&&(e=1.70158);var i=1.525*e;return(t*=2)<1?t*t*((i+1)*t-i)*.5:.5*((t-=2)*t*((i+1)*t+i)+2)}},36699:t=>{t.exports=function(t,e){return void 0===e&&(e=1.70158),--t*t*((e+1)*t+e)+1}},25265:(t,e,i)=>{t.exports={In:i(25860),Out:i(36699),InOut:i(45264)}},62191:t=>{t.exports=function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}},24799:t=>{t.exports=function(t){var e=!1;return t<.5?(t=1-2*t,e=!0):t=2*t-1,t<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5}},60819:t=>{t.exports=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},57428:(t,e,i)=>{t.exports={In:i(62191),Out:i(60819),InOut:i(24799)}},86855:t=>{t.exports=function(t){return 1-Math.sqrt(1-t*t)}},7280:t=>{t.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},18058:t=>{t.exports=function(t){return Math.sqrt(1- --t*t)}},73214:(t,e,i)=>{t.exports={In:i(86855),Out:i(18058),InOut:i(7280)}},91532:t=>{t.exports=function(t){return t*t*t}},63180:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},16518:t=>{t.exports=function(t){return--t*t*t+1}},71778:(t,e,i)=>{t.exports={In:i(91532),Out:i(16518),InOut:i(63180)}},24729:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)}},50325:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)*.5+1}},84074:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-s)*(2*Math.PI)/i)+1}},36468:(t,e,i)=>{t.exports={In:i(24729),Out:i(84074),InOut:i(50325)}},95638:t=>{t.exports=function(t){return Math.pow(2,10*(t-1))-.001}},10357:t=>{t.exports=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))}},14894:t=>{t.exports=function(t){return 1-Math.pow(2,-10*t)}},88258:(t,e,i)=>{t.exports={In:i(95638),Out:i(14894),InOut:i(10357)}},33063:(t,e,i)=>{t.exports={Back:i(25265),Bounce:i(57428),Circular:i(73214),Cubic:i(71778),Elastic:i(36468),Expo:i(88258),Linear:i(52910),Quadratic:i(67799),Quartic:i(74083),Quintic:i(92284),Sine:i(28035),Stepped:i(8754)}},43927:t=>{t.exports=function(t){return t}},52910:(t,e,i)=>{t.exports=i(43927)},77471:t=>{t.exports=function(t){return t*t}},83863:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},44383:t=>{t.exports=function(t){return t*(2-t)}},67799:(t,e,i)=>{t.exports={In:i(77471),Out:i(44383),InOut:i(83863)}},48311:t=>{t.exports=function(t){return t*t*t*t}},55248:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},23135:t=>{t.exports=function(t){return 1- --t*t*t*t}},74083:(t,e,i)=>{t.exports={In:i(48311),Out:i(23135),InOut:i(55248)}},7313:t=>{t.exports=function(t){return t*t*t*t*t}},98759:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},26670:t=>{t.exports=function(t){return--t*t*t*t*t+1}},92284:(t,e,i)=>{t.exports={In:i(7313),Out:i(26670),InOut:i(98759)}},52929:t=>{t.exports=function(t){return 0===t?0:1===t?1:1-Math.cos(t*Math.PI/2)}},66333:t=>{t.exports=function(t){return 0===t?0:1===t?1:.5*(1-Math.cos(Math.PI*t))}},37255:t=>{t.exports=function(t){return 0===t?0:1===t?1:Math.sin(t*Math.PI/2)}},28035:(t,e,i)=>{t.exports={In:i(52929),Out:i(37255),InOut:i(66333)}},52770:t=>{t.exports=function(t,e){return void 0===e&&(e=1),t<=0?0:t>=1?1:1/e*(1+(e*t|0))}},8754:(t,e,i)=>{t.exports=i(52770)},17247:t=>{t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},88456:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.floor(t+e)}},41935:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t>e-i}},54726:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t{t.exports={Ceil:i(17247),Equal:i(88456),Floor:i(61824),GreaterThan:i(41935),LessThan:i(54726)}},5923:(t,e,i)=>{var s=i(83392),n=i(98611),r={Angle:i(22153),Distance:i(10130),Easing:i(33063),Fuzzy:i(52778),Interpolation:i(48528),Pow2:i(73773),Snap:i(23679),RandomDataGenerator:i(81429),Average:i(26042),Bernstein:i(22824),Between:i(17489),CatmullRom:i(14976),CeilTo:i(89129),Clamp:i(82897),DegToRad:i(75606),Difference:i(767),Euler:i(9849),Factorial:i(8034),FloatBetween:i(61616),FloorTo:i(60679),FromPercent:i(91806),GetSpeed:i(79366),IsEven:i(43776),IsEvenStrict:i(58442),Linear:i(42798),MaxAdd:i(69635),Median:i(37394),MinSub:i(17259),Percent:i(61820),RadToDeg:i(23701),RandomXY:i(16906),RandomXYZ:i(52417),RandomXYZW:i(17915),Rotate:i(52257),RotateAround:i(2386),RotateAroundDistance:i(72395),RotateTo:i(41061),RoundAwayFromZero:i(67233),RoundTo:i(64333),SinCosTableGenerator:i(59533),SmootherStep:i(87736),SmoothStep:i(5514),ToXY:i(55805),TransformXY:i(64462),Within:i(9557),Wrap:i(1071),Vector2:i(93736),Vector3:i(70015),Vector4:i(51729),Matrix3:i(5341),Matrix4:i(16650),Quaternion:i(75003),RotateVec3:i(93709)};r=n(!1,r,s),t.exports=r},63210:(t,e,i)=>{var s=i(22824);t.exports=function(t,e){for(var i=0,n=t.length-1,r=0;r<=n;r++)i+=Math.pow(1-e,n-r)*Math.pow(e,r)*t[r]*s(n,r);return i}},88332:(t,e,i)=>{var s=i(14976);t.exports=function(t,e){var i=t.length-1,n=i*e,r=Math.floor(n);return t[0]===t[i]?(e<0&&(r=Math.floor(n=i*(1+e))),s(n-r,t[(r-1+i)%i],t[r],t[(r+1)%i],t[(r+2)%i])):e<0?t[0]-(s(-n,t[0],t[0],t[1],t[1])-t[0]):e>1?t[i]-(s(n-i,t[i],t[i],t[i-1],t[i-1])-t[i]):s(n-r,t[r?r-1:0],t[r],t[i{t.exports=function(t,e,i,s,n){return function(t,e){var i=1-t;return i*i*i*e}(t,e)+function(t,e){var i=1-t;return 3*i*i*t*e}(t,i)+function(t,e){return 3*(1-t)*t*t*e}(t,s)+function(t,e){return t*t*t*e}(t,n)}},47614:(t,e,i)=>{var s=i(42798);t.exports=function(t,e){var i=t.length-1,n=i*e,r=Math.floor(n);return e<0?s(t[0],t[1],n):e>1?s(t[i],t[i-1],i-n):s(t[r],t[r+1>i?i:r+1],n-r)}},16252:t=>{t.exports=function(t,e,i,s){return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,s)}},44521:(t,e,i)=>{var s=i(5514);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},45507:(t,e,i)=>{var s=i(87736);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},48528:(t,e,i)=>{t.exports={Bezier:i(63210),CatmullRom:i(88332),CubicBezier:i(34631),Linear:i(47614),QuadraticBezier:i(16252),SmoothStep:i(44521),SmootherStep:i(45507)}},3504:t=>{t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<{t.exports=function(t,e){return t>0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},2018:t=>{t.exports=function(t){return t>0&&0==(t&t-1)}},73773:(t,e,i)=>{t.exports={GetNext:i(3504),IsSize:i(28621),IsValue:i(2018)}},81429:(t,e,i)=>{var s=new(i(56694))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,i=this.n;t=t.toString();for(var s=0;s>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e0;e--){var i=Math.floor(this.frac()*(e+1)),s=t[i];t[i]=t[e],t[e]=s}return t}});t.exports=s},82127:t=>{t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),s?(i+t)/e:i+t)}},84314:t=>{t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),s?(i+t)/e:i+t)}},88462:t=>{t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),s?(i+t)/e:i+t)}},23679:(t,e,i)=>{t.exports={Ceil:i(82127),Floor:i(84314),To:i(88462)}},10654:(t,e,i)=>{i(92244);var s=i(86459),n=i(98611),r={Actions:i(83979),Animations:i(13517),BlendModes:i(95723),Cache:i(45820),Cameras:i(44143),Core:i(80293),Class:i(56694),Create:i(84106),Curves:i(73962),Data:i(1999),Display:i(24816),DOM:i(3590),Events:i(95146),Game:i(15213),GameObjects:i(48013),Geom:i(84068),Input:i(20873),Loader:i(95695),Math:i(5923),Physics:i(53954),Plugins:i(45615),Renderer:i(42069),Scale:i(86754),ScaleModes:i(27394),Scene:i(87157),Scenes:i(20436),Structs:i(20010),Textures:i(87499),Tilemaps:i(52678),Time:i(97121),Tweens:i(75193),Utils:i(22178)};r.Sound=i(56751),r=n(!1,r,s),t.exports=r,i.g.Phaser=r},62832:(t,e,i)=>{var s=i(56694),n=i(7864),r=i(1539),o=new s({Extends:r,Mixins:[n.Acceleration,n.Angular,n.Bounce,n.Debug,n.Drag,n.Enable,n.Friction,n.Gravity,n.Immovable,n.Mass,n.Pushable,n.Size,n.Velocity],initialize:function(t,e,i,s,n){r.call(this,t,e,i,s,n),this.body=null}});t.exports=o},66150:(t,e,i)=>{var s=i(56694),n=i(75606),r=i(53996),o=i(35032),a=i(99523),h=i(72632),l=i(30657),u=i(2732),c=i(15147),d=i(91963),p=i(7599),f=i(93736),v=i(85233),g=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,t.sys.events.once(p.BOOT,this.boot,this),t.sys.events.on(p.START,this.start,this)},boot:function(){this.world=new v(this.scene,this.config),this.add=new a(this.world),this.systems.events.once(p.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new v(this.scene,this.config),this.add=new a(this.world));var t=this.systems.events;h(this.config,"customUpdate",!1)||t.on(p.UPDATE,this.world.update,this.world),t.on(p.POST_UPDATE,this.world.postUpdate,this.world),t.once(p.SHUTDOWN,this.shutdown,this)},enableUpdate:function(){this.systems.events.on(p.UPDATE,this.world.update,this.world)},disableUpdate:function(){this.systems.events.off(p.UPDATE,this.world.update,this.world)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return l(h(e,"arcade",{}),h(t,"arcade",{}))},overlap:function(t,e,i,s,n){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=i),this.world.collideObjects(t,e,i,s,n,!0)},collide:function(t,e,i,s,n){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=i),this.world.collideObjects(t,e,i,s,n,!1)},collideTiles:function(t,e,i,s,n){return this.world.collideTiles(t,e,i,s,n)},overlapTiles:function(t,e,i,s,n){return this.world.overlapTiles(t,e,i,s,n)},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},accelerateTo:function(t,e,i,s,n,r){void 0===s&&(s=60);var o=Math.atan2(i-t.y,e-t.x);return t.body.acceleration.setToPolar(o,s),void 0!==n&&void 0!==r&&t.body.maxVelocity.set(n,r),o},accelerateToObject:function(t,e,i,s,n){return this.accelerateTo(t,e.x,e.y,i,s,n)},closest:function(t,e){e||(e=this.world.bodies.entries);for(var i=Number.MAX_VALUE,s=null,n=t.x,r=t.y,a=e.length,h=0;hi&&(s=l,i=c)}}return s},moveTo:function(t,e,i,s,n){void 0===s&&(s=60),void 0===n&&(n=0);var o=Math.atan2(i-t.y,e-t.x);return n>0&&(s=r(t.x,t.y,e,i)/(n/1e3)),t.body.velocity.setToPolar(o,s),o},moveToObject:function(t,e,i,s){return this.moveTo(t,e.x,e.y,i,s)},velocityFromAngle:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new f),i.setToPolar(n(t),e)},velocityFromRotation:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new f),i.setToPolar(t,e)},overlapRect:function(t,e,i,s,n,r){return c(this.world,t,e,i,s,n,r)},overlapCirc:function(t,e,i,s,n){return u(this.world,t,e,i,s,n)},shutdown:function(){if(this.world){var t=this.systems.events;t.off(p.UPDATE,this.world.update,this.world),t.off(p.POST_UPDATE,this.world.postUpdate,this.world),t.off(p.SHUTDOWN,this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null}},destroy:function(){this.shutdown(),this.scene.sys.events.off(p.START,this.start,this),this.scene=null,this.systems=null}});d.register("ArcadePhysics",g,"arcadePhysics"),t.exports=g},25084:(t,e,i)=>{var s=i(56694),n=i(7864),r=i(13747),o=new s({Extends:r,Mixins:[n.Acceleration,n.Angular,n.Bounce,n.Debug,n.Drag,n.Enable,n.Friction,n.Gravity,n.Immovable,n.Mass,n.Pushable,n.Size,n.Velocity],initialize:function(t,e,i,s,n){r.call(this,t,e,i,s,n),this.body=null}});t.exports=o},97602:(t,e,i)=>{var s=i(56694),n=i(47401),r=i(27037),o=i(23701),a=i(74118),h=i(94287),l=i(93736),u=new s({initialize:function(t,e){var i=e.displayWidth?e.displayWidth:64,s=e.displayHeight?e.displayHeight:64;this.world=t,this.gameObject=e,this.transform={x:e.x,y:e.y,rotation:e.angle,scaleX:e.scaleX,scaleY:e.scaleY,displayOriginX:e.displayOriginX,displayOriginY:e.displayOriginY},this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new l,this.position=new l(e.x-e.scaleX*e.displayOriginX,e.y-e.scaleY*e.displayOriginY),this.prev=this.position.clone(),this.prevFrame=this.position.clone(),this.allowRotation=!0,this.rotation=e.angle,this.preRotation=e.angle,this.width=i,this.height=s,this.sourceWidth=i,this.sourceHeight=s,e.frame&&(this.sourceWidth=e.frame.realWidth,this.sourceHeight=e.frame.realHeight),this.halfWidth=Math.abs(i/2),this.halfHeight=Math.abs(s/2),this.center=new l(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=new l,this.newVelocity=new l,this.deltaMax=new l,this.acceleration=new l,this.allowDrag=!0,this.drag=new l,this.allowGravity=!0,this.gravity=new l,this.bounce=new l,this.worldBounce=null,this.customBoundsRectangle=t.bounds,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new l(1e4,1e4),this.maxSpeed=-1,this.friction=new l(1,0),this.useDamping=!1,this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=n.FACING_NONE,this.immovable=!1,this.pushable=!0,this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.syncBounds=!1,this.physicsType=n.DYNAMIC_BODY,this._sx=e.scaleX,this._sy=e.scaleY,this._dx=0,this._dy=0,this._tx=0,this._ty=0,this._bounds=new a},updateBounds:function(){var t=this.gameObject,e=this.transform;if(t.parentContainer){var i=t.getWorldTransformMatrix(this.world._tempMatrix,this.world._tempMatrix2);e.x=i.tx,e.y=i.ty,e.rotation=o(i.rotation),e.scaleX=i.scaleX,e.scaleY=i.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY}else e.x=t.x,e.y=t.y,e.rotation=t.angle,e.scaleX=t.scaleX,e.scaleY=t.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY;var s=!1;if(this.syncBounds){var n=t.getBounds(this._bounds);this.width=n.width,this.height=n.height,s=!0}else{var r=Math.abs(e.scaleX),a=Math.abs(e.scaleY);this._sx===r&&this._sy===a||(this.width=this.sourceWidth*r,this.height=this.sourceHeight*a,this._sx=r,this._sy=a,s=!0)}s&&(this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter())},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},updateFromGameObject:function(){this.updateBounds();var t=this.transform;this.position.x=t.x+t.scaleX*(this.offset.x-t.displayOriginX),this.position.y=t.y+t.scaleY*(this.offset.y-t.displayOriginY),this.updateCenter()},resetFlags:function(t){void 0===t&&(t=!1);var e=this.wasTouching,i=this.touching,s=this.blocked;t?(e.none=!0,e.up=!1,e.down=!1,e.left=!1,e.right=!1):(e.none=i.none,e.up=i.up,e.down=i.down,e.left=i.left,e.right=i.right),i.none=!0,i.up=!1,i.down=!1,i.left=!1,i.right=!1,s.none=!0,s.up=!1,s.down=!1,s.left=!1,s.right=!1,this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1},preUpdate:function(t,e){t&&this.resetFlags(),this.updateFromGameObject(),this.rotation=this.transform.rotation,this.preRotation=this.rotation,this.moves&&(this.prev.x=this.position.x,this.prev.y=this.position.y,this.prevFrame.x=this.position.x,this.prevFrame.y=this.position.y),t&&this.update(e)},update:function(t){if(this.prev.x=this.position.x,this.prev.y=this.position.y,this.moves){this.world.updateMotion(this,t);var e=this.velocity.x,i=this.velocity.y;this.newVelocity.set(e*t,i*t),this.position.add(this.newVelocity),this.updateCenter(),this.angle=Math.atan2(i,e),this.speed=Math.sqrt(e*e+i*i),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds&&this.world.emit(r.WORLD_BOUNDS,this,this.blocked.up,this.blocked.down,this.blocked.left,this.blocked.right)}this._dx=this.position.x-this.prev.x,this._dy=this.position.y-this.prev.y},postUpdate:function(){var t=this.position.x-this.prevFrame.x,e=this.position.y-this.prevFrame.y;if(this.moves){var i=this.deltaMax.x,s=this.deltaMax.y;0!==i&&0!==t&&(t<0&&t<-i?t=-i:t>0&&t>i&&(t=i)),0!==s&&0!==e&&(e<0&&e<-s?e=-s:e>0&&e>s&&(e=s)),this.gameObject.x+=t,this.gameObject.y+=e}t<0?this.facing=n.FACING_LEFT:t>0&&(this.facing=n.FACING_RIGHT),e<0?this.facing=n.FACING_UP:e>0&&(this.facing=n.FACING_DOWN),this.allowRotation&&(this.gameObject.angle+=this.deltaZ()),this._tx=t,this._ty=e},setBoundsRectangle:function(t){return this.customBoundsRectangle=t||this.world.bounds,this},checkWorldBounds:function(){var t=this.position,e=this.customBoundsRectangle,i=this.world.checkCollision,s=this.worldBounce?-this.worldBounce.x:-this.bounce.x,n=this.worldBounce?-this.worldBounce.y:-this.bounce.y,r=!1;return t.xe.right&&i.right&&(t.x=e.right-this.width,this.velocity.x*=s,this.blocked.right=!0,r=!0),t.ye.bottom&&i.down&&(t.y=e.bottom-this.height,this.velocity.y*=n,this.blocked.down=!0,r=!0),r&&(this.blocked.none=!1,this.updateCenter()),r},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this},setSize:function(t,e,i){void 0===i&&(i=!0);var s=this.gameObject;if(!t&&s.frame&&(t=s.frame.realWidth),!e&&s.frame&&(e=s.frame.realHeight),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&s.getCenter){var n=(s.width-t)/2,r=(s.height-e)/2;this.offset.set(n,r)}return this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.isCircle=!0,this.radius=t,this.sourceWidth=2*t,this.sourceHeight=2*t,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter()):this.isCircle=!1,this},reset:function(t,e){this.stop();var i=this.gameObject;i.setPosition(t,e),i.getTopLeft?i.getTopLeft(this.position):this.position.set(t,e),this.prev.copy(this.position),this.prevFrame.copy(this.position),this.rotation=i.angle,this.preRotation=i.angle,this.updateBounds(),this.updateCenter(),this.resetFlags(!0)},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?this.radius>0&&t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom&&(this.center.x-t)*(this.center.x-t)+(this.center.y-e)*(this.center.y-e)<=this.radius*this.radius:h(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this._dx>0?this._dx:-this._dx},deltaAbsY:function(){return this._dy>0?this._dy:-this._dy},deltaX:function(){return this._dx},deltaY:function(){return this._dy},deltaXFinal:function(){return this._tx},deltaYFinal:function(){return this._ty},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.enable=!1,this.world&&this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,s=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor),this.isCircle?t.strokeCircle(i,s,this.width/2):(this.checkCollision.up&&t.lineBetween(e.x,e.y,e.x+this.width,e.y),this.checkCollision.right&&t.lineBetween(e.x+this.width,e.y,e.x+this.width,e.y+this.height),this.checkCollision.down&&t.lineBetween(e.x,e.y+this.height,e.x+this.width,e.y+this.height),this.checkCollision.left&&t.lineBetween(e.x,e.y,e.x,e.y+this.height))),this.debugShowVelocity&&(t.lineStyle(t.defaultStrokeWidth,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,s,i+this.velocity.x/2,s+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setCollideWorldBounds:function(t,e,i,s){void 0===t&&(t=!0),this.collideWorldBounds=t;var n=void 0!==e,r=void 0!==i;return(n||r)&&(this.worldBounce||(this.worldBounce=new l),n&&(this.worldBounce.x=e),r&&(this.worldBounce.y=i)),void 0!==s&&(this.onWorldBounds=s),this},setVelocity:function(t,e){return this.velocity.set(t,e),t=this.velocity.x,e=this.velocity.y,this.speed=Math.sqrt(t*t+e*e),this},setVelocityX:function(t){this.velocity.x=t;var e=t,i=this.velocity.y;return this.speed=Math.sqrt(e*e+i*i),this},setVelocityY:function(t){this.velocity.y=t;var e=this.velocity.x,i=t;return this.speed=Math.sqrt(e*e+i*i),this},setMaxVelocity:function(t,e){return this.maxVelocity.set(t,e),this},setMaxVelocityX:function(t){return this.maxVelocity.x=t,this},setMaxVelocityY:function(t){return this.maxVelocity.y=t,this},setMaxSpeed:function(t){return this.maxSpeed=t,this},setBounce:function(t,e){return this.bounce.set(t,e),this},setBounceX:function(t){return this.bounce.x=t,this},setBounceY:function(t){return this.bounce.y=t,this},setAcceleration:function(t,e){return this.acceleration.set(t,e),this},setAccelerationX:function(t){return this.acceleration.x=t,this},setAccelerationY:function(t){return this.acceleration.y=t,this},setAllowDrag:function(t){return void 0===t&&(t=!0),this.allowDrag=t,this},setAllowGravity:function(t){return void 0===t&&(t=!0),this.allowGravity=t,this},setAllowRotation:function(t){return void 0===t&&(t=!0),this.allowRotation=t,this},setDrag:function(t,e){return this.drag.set(t,e),this},setDamping:function(t){return this.useDamping=t,this},setDragX:function(t){return this.drag.x=t,this},setDragY:function(t){return this.drag.y=t,this},setGravity:function(t,e){return this.gravity.set(t,e),this},setGravityX:function(t){return this.gravity.x=t,this},setGravityY:function(t){return this.gravity.y=t,this},setFriction:function(t,e){return this.friction.set(t,e),this},setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setAngularVelocity:function(t){return this.angularVelocity=t,this},setAngularAcceleration:function(t){return this.angularAcceleration=t,this},setAngularDrag:function(t){return this.angularDrag=t,this},setMass:function(t){return this.mass=t,this},setImmovable:function(t){return void 0===t&&(t=!0),this.immovable=t,this},setEnable:function(t){return void 0===t&&(t=!0),this.enable=t,this},processX:function(t,e,i,s){this.x+=t,this.updateCenter(),null!==e&&(this.velocity.x=e);var n=this.blocked;i&&(n.left=!0),s&&(n.right=!0)},processY:function(t,e,i,s){this.y+=t,this.updateCenter(),null!==e&&(this.velocity.y=e);var n=this.blocked;i&&(n.up=!0),s&&(n.down=!0)},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=u},3909:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s,n,r,o){this.world=t,this.name="",this.active=!0,this.overlapOnly=e,this.object1=i,this.object2=s,this.collideCallback=n,this.processCallback=r,this.callbackContext=o},setName:function(t){return this.name=t,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});t.exports=s},99523:(t,e,i)=>{var s=i(62832),n=i(25084),r=i(56694),o=i(47401),a=i(10481),h=i(46346),l=new r({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},collider:function(t,e,i,s,n){return this.world.addCollider(t,e,i,s,n)},overlap:function(t,e,i,s,n){return this.world.addOverlap(t,e,i,s,n)},existing:function(t,e){var i=e?o.STATIC_BODY:o.DYNAMIC_BODY;return this.world.enableBody(t,i),t},staticImage:function(t,e,i,n){var r=new s(this.scene,t,e,i,n);return this.sys.displayList.add(r),this.world.enableBody(r,o.STATIC_BODY),r},image:function(t,e,i,n){var r=new s(this.scene,t,e,i,n);return this.sys.displayList.add(r),this.world.enableBody(r,o.DYNAMIC_BODY),r},staticSprite:function(t,e,i,s){var r=new n(this.scene,t,e,i,s);return this.sys.displayList.add(r),this.sys.updateList.add(r),this.world.enableBody(r,o.STATIC_BODY),r},sprite:function(t,e,i,s){var r=new n(this.scene,t,e,i,s);return this.sys.displayList.add(r),this.sys.updateList.add(r),this.world.enableBody(r,o.DYNAMIC_BODY),r},staticGroup:function(t,e){return this.sys.updateList.add(new h(this.world,this.world.scene,t,e))},group:function(t,e){return this.sys.updateList.add(new a(this.world,this.world.scene,t,e))},destroy:function(){this.world=null,this.scene=null,this.sys=null}});t.exports=l},75671:(t,e,i)=>{var s=i(47401);t.exports=function(t,e,i,n){var r=0,o=t.deltaAbsX()+e.deltaAbsX()+n;return 0===t._dx&&0===e._dx?(t.embedded=!0,e.embedded=!0):t._dx>e._dx?(r=t.right-e.x)>o&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?r=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.right=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.left=!0)):t._dxo&&!i||!1===t.checkCollision.left||!1===e.checkCollision.right?r=0:(t.touching.none=!1,t.touching.left=!0,e.touching.none=!1,e.touching.right=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.left=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.right=!0))),t.overlapX=r,e.overlapX=r,r}},66185:(t,e,i)=>{var s=i(47401);t.exports=function(t,e,i,n){var r=0,o=t.deltaAbsY()+e.deltaAbsY()+n;return 0===t._dy&&0===e._dy?(t.embedded=!0,e.embedded=!0):t._dy>e._dy?(r=t.bottom-e.y)>o&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?r=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.down=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.up=!0)):t._dyo&&!i||!1===t.checkCollision.up||!1===e.checkCollision.down?r=0:(t.touching.none=!1,t.touching.up=!0,e.touching.none=!1,e.touching.down=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.up=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.down=!0))),t.overlapY=r,e.overlapY=r,r}},10481:(t,e,i)=>{var s=i(25084),n=i(56694),r=i(47401),o=i(72632),a=i(59192),h=i(42911),l=new n({Extends:a,initialize:function(t,e,i,n){if(i||n)if(h(i))n=i,i=null,n.internalCreateCallback=this.createCallbackHandler,n.internalRemoveCallback=this.removeCallbackHandler;else if(Array.isArray(i)&&h(i[0])){n=i[0];var l=this;i.forEach((function(t){t.internalCreateCallback=l.createCallbackHandler,t.internalRemoveCallback=l.removeCallbackHandler})),i=null}else n={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};else n={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};this.world=t,n.classType=o(n,"classType",s),this.physicsType=r.DYNAMIC_BODY,this.defaults={setCollideWorldBounds:o(n,"collideWorldBounds",!1),setBoundsRectangle:o(n,"customBoundsRectangle",null),setAccelerationX:o(n,"accelerationX",0),setAccelerationY:o(n,"accelerationY",0),setAllowDrag:o(n,"allowDrag",!0),setAllowGravity:o(n,"allowGravity",!0),setAllowRotation:o(n,"allowRotation",!0),setBounceX:o(n,"bounceX",0),setBounceY:o(n,"bounceY",0),setDragX:o(n,"dragX",0),setDragY:o(n,"dragY",0),setEnable:o(n,"enable",!0),setGravityX:o(n,"gravityX",0),setGravityY:o(n,"gravityY",0),setFrictionX:o(n,"frictionX",0),setFrictionY:o(n,"frictionY",0),setMaxVelocityX:o(n,"maxVelocityX",1e4),setMaxVelocityY:o(n,"maxVelocityY",1e4),setVelocityX:o(n,"velocityX",0),setVelocityY:o(n,"velocityY",0),setAngularVelocity:o(n,"angularVelocity",0),setAngularAcceleration:o(n,"angularAcceleration",0),setAngularDrag:o(n,"angularDrag",0),setMass:o(n,"mass",1),setImmovable:o(n,"immovable",!1)},a.call(this,e,i,n),this.type="PhysicsGroup"},createCallbackHandler:function(t){t.body||this.world.enableBody(t,r.DYNAMIC_BODY);var e=t.body;for(var i in this.defaults)e[i](this.defaults[i])},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},setVelocity:function(t,e,i){void 0===i&&(i=0);for(var s=this.getChildren(),n=0;n{var e,i,s,n,r,o,a,h,l,u,c,d,p,f,v,g,m,y=function(){return u&&v&&i.blocked.right?(e.processX(-m,a,!1,!0),1):l&&g&&i.blocked.left?(e.processX(m,a,!0),1):p&&g&&e.blocked.right?(i.processX(-m,h,!1,!0),2):d&&v&&e.blocked.left?(i.processX(m,h,!0),2):0},x=function(t){if(s&&n)m*=.5,0===t||3===t?(e.processX(m,r),i.processX(-m,o)):(e.processX(-m,r),i.processX(m,o));else if(s&&!n)0===t||3===t?e.processX(m,a,!0):e.processX(-m,a,!1,!0);else if(!s&&n)0===t||3===t?i.processX(-m,h,!1,!0):i.processX(m,h,!0);else{var v=.5*m;0===t?f?(e.processX(m,0,!0),i.processX(0,null,!1,!0)):p?(e.processX(v,0,!0),i.processX(-v,0,!1,!0)):(e.processX(v,i.velocity.x,!0),i.processX(-v,null,!1,!0)):1===t?c?(e.processX(0,null,!1,!0),i.processX(m,0,!0)):u?(e.processX(-v,0,!1,!0),i.processX(v,0,!0)):(e.processX(-v,null,!1,!0),i.processX(v,e.velocity.x,!0)):2===t?f?(e.processX(-m,0,!1,!0),i.processX(0,null,!0)):d?(e.processX(-v,0,!1,!0),i.processX(v,0,!0)):(e.processX(-v,i.velocity.x,!1,!0),i.processX(v,null,!0)):3===t&&(c?(e.processX(0,null,!0),i.processX(-m,0,!1,!0)):l?(e.processX(v,0,!0),i.processX(-v,0,!1,!0)):(e.processX(v,i.velocity.y,!0),i.processX(-v,null,!1,!0)))}return!0};t.exports={BlockCheck:y,Check:function(){var t=e.velocity.x,s=i.velocity.x,n=Math.sqrt(s*s*i.mass/e.mass)*(s>0?1:-1),a=Math.sqrt(t*t*e.mass/i.mass)*(t>0?1:-1),h=.5*(n+a);return a-=h,r=h+(n-=h)*e.bounce.x,o=h+a*i.bounce.x,l&&g?x(0):d&&v?x(1):u&&v?x(2):!(!p||!g)&&x(3)},Set:function(t,r,o){i=r;var x=(e=t).velocity.x,T=i.velocity.x;return s=e.pushable,l=e._dx<0,u=e._dx>0,c=0===e._dx,v=Math.abs(e.right-i.x)<=Math.abs(i.right-e.x),a=T-x*e.bounce.x,n=i.pushable,d=i._dx<0,p=i._dx>0,f=0===i._dx,g=!v,h=x-T*i.bounce.x,m=Math.abs(o),y()},Run:x,RunImmovableBody1:function(t){1===t?i.velocity.x=0:v?i.processX(m,h,!0):i.processX(-m,h,!1,!0),e.moves&&(i.y+=(e.y-e.prev.y)*e.friction.y,i._dy=i.y-i.prev.y)},RunImmovableBody2:function(t){2===t?e.velocity.x=0:g?e.processX(m,a,!0):e.processX(-m,a,!1,!0),i.moves&&(e.y+=(i.y-i.prev.y)*i.friction.y,e._dy=e.y-e.prev.y)}}},67050:t=>{var e,i,s,n,r,o,a,h,l,u,c,d,p,f,v,g,m,y=function(){return u&&v&&i.blocked.down?(e.processY(-m,a,!1,!0),1):l&&g&&i.blocked.up?(e.processY(m,a,!0),1):p&&g&&e.blocked.down?(i.processY(-m,h,!1,!0),2):d&&v&&e.blocked.up?(i.processY(m,h,!0),2):0},x=function(t){if(s&&n)m*=.5,0===t||3===t?(e.processY(m,r),i.processY(-m,o)):(e.processY(-m,r),i.processY(m,o));else if(s&&!n)0===t||3===t?e.processY(m,a,!0):e.processY(-m,a,!1,!0);else if(!s&&n)0===t||3===t?i.processY(-m,h,!1,!0):i.processY(m,h,!0);else{var v=.5*m;0===t?f?(e.processY(m,0,!0),i.processY(0,null,!1,!0)):p?(e.processY(v,0,!0),i.processY(-v,0,!1,!0)):(e.processY(v,i.velocity.y,!0),i.processY(-v,null,!1,!0)):1===t?c?(e.processY(0,null,!1,!0),i.processY(m,0,!0)):u?(e.processY(-v,0,!1,!0),i.processY(v,0,!0)):(e.processY(-v,null,!1,!0),i.processY(v,e.velocity.y,!0)):2===t?f?(e.processY(-m,0,!1,!0),i.processY(0,null,!0)):d?(e.processY(-v,0,!1,!0),i.processY(v,0,!0)):(e.processY(-v,i.velocity.y,!1,!0),i.processY(v,null,!0)):3===t&&(c?(e.processY(0,null,!0),i.processY(-m,0,!1,!0)):l?(e.processY(v,0,!0),i.processY(-v,0,!1,!0)):(e.processY(v,i.velocity.y,!0),i.processY(-v,null,!1,!0)))}return!0};t.exports={BlockCheck:y,Check:function(){var t=e.velocity.y,s=i.velocity.y,n=Math.sqrt(s*s*i.mass/e.mass)*(s>0?1:-1),a=Math.sqrt(t*t*e.mass/i.mass)*(t>0?1:-1),h=.5*(n+a);return a-=h,r=h+(n-=h)*e.bounce.y,o=h+a*i.bounce.y,l&&g?x(0):d&&v?x(1):u&&v?x(2):!(!p||!g)&&x(3)},Set:function(t,r,o){i=r;var x=(e=t).velocity.y,T=i.velocity.y;return s=e.pushable,l=e._dy<0,u=e._dy>0,c=0===e._dy,v=Math.abs(e.bottom-i.y)<=Math.abs(i.bottom-e.y),a=T-x*e.bounce.y,n=i.pushable,d=i._dy<0,p=i._dy>0,f=0===i._dy,g=!v,h=x-T*i.bounce.y,m=Math.abs(o),y()},Run:x,RunImmovableBody1:function(t){1===t?i.velocity.y=0:v?i.processY(m,h,!0):i.processY(-m,h,!1,!0),e.moves&&(i.x+=(e.x-e.prev.x)*e.friction.x,i._dx=i.x-i.prev.x)},RunImmovableBody2:function(t){2===t?e.velocity.y=0:g?e.processY(m,a,!0):e.processY(-m,a,!1,!0),i.moves&&(e.x+=(i.x-i.prev.x)*i.friction.x,e._dx=e.x-e.prev.x)}}},61777:(t,e,i)=>{var s=i(75671),n=i(22916);t.exports=function(t,e,i,r){var o=s(t,e,i,r),a=t.immovable,h=e.immovable;if(i||0===o||a&&h||t.customSeparateX||e.customSeparateX)return 0!==o||t.embedded&&e.embedded;var l=n.Set(t,e,o);return a||h?(a?n.RunImmovableBody1(l):h&&n.RunImmovableBody2(l),!0):l>0||n.Check()}},25299:(t,e,i)=>{var s=i(66185),n=i(67050);t.exports=function(t,e,i,r){var o=s(t,e,i,r),a=t.immovable,h=e.immovable;if(i||0===o||a&&h||t.customSeparateY||e.customSeparateY)return 0!==o||t.embedded&&e.embedded;var l=n.Set(t,e,o);return a||h?(a?n.RunImmovableBody1(l):h&&n.RunImmovableBody2(l),!0):l>0||n.Check()}},66634:(t,e,i)=>{var s=i(65650),n=i(56694),r=i(47401),o=i(94287),a=i(93736),h=new n({initialize:function(t,e){var i=e.displayWidth?e.displayWidth:64,s=e.displayHeight?e.displayHeight:64;this.world=t,this.gameObject=e,this.debugShowBody=t.defaults.debugShowStaticBody,this.debugBodyColor=t.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new a,this.position=new a(e.x-i*e.originX,e.y-s*e.originY),this.width=i,this.height=s,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new a(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=a.ZERO,this.allowGravity=!1,this.gravity=a.ZERO,this.bounce=a.ZERO,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.mass=1,this.immovable=!0,this.pushable=!1,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.physicsType=r.STATIC_BODY,this._dx=0,this._dy=0},setGameObject:function(t,e){return t&&t!==this.gameObject&&(this.gameObject.body=null,t.body=this,this.gameObject=t),e&&this.updateFromGameObject(),this},updateFromGameObject:function(){this.world.staticTree.remove(this);var t=this.gameObject;return t.getTopLeft(this.position),this.width=t.displayWidth,this.height=t.displayHeight,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.world.staticTree.insert(this),this},setOffset:function(t,e){return void 0===e&&(e=t),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(t,e),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(t,e,i){void 0===i&&(i=!0);var s=this.gameObject;if(!t&&s.frame&&(t=s.frame.realWidth),!e&&s.frame&&(e=s.frame.realHeight),this.world.staticTree.remove(this),this.width=t,this.height=e,this.halfWidth=Math.floor(t/2),this.halfHeight=Math.floor(e/2),i&&s.getCenter){var n=s.displayWidth/2,r=s.displayHeight/2;this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(n-this.halfWidth,r-this.halfHeight),this.position.x+=this.offset.x,this.position.y+=this.offset.y}return this.updateCenter(),this.isCircle=!1,this.radius=0,this.world.staticTree.insert(this),this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=t,this.width=2*t,this.height=2*t,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(t,e){var i=this.gameObject;void 0===t&&(t=i.x),void 0===e&&(e=i.y),this.world.staticTree.remove(this),i.setPosition(t,e),i.getTopLeft(this.position),this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?s(this,t,e):o(this,t,e)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,s=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor,1),this.isCircle?t.strokeCircle(i,s,this.width/2):t.strokeRect(e.x,e.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(t){return t<=0&&(t=.1),this.mass=t,this},x:{get:function(){return this.position.x},set:function(t){this.world.staticTree.remove(this),this.position.x=t,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(t){this.world.staticTree.remove(this),this.position.y=t,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=h},46346:(t,e,i)=>{var s=i(25084),n=i(56694),r=i(47401),o=i(72632),a=i(59192),h=i(42911),l=new n({Extends:a,initialize:function(t,e,i,n){i||n?h(i)?(n=i,i=null,n.internalCreateCallback=this.createCallbackHandler,n.internalRemoveCallback=this.removeCallbackHandler,n.createMultipleCallback=this.createMultipleCallbackHandler,n.classType=o(n,"classType",s)):Array.isArray(i)&&h(i[0])?(n=i,i=null,n.forEach((function(t){t.internalCreateCallback=this.createCallbackHandler,t.internalRemoveCallback=this.removeCallbackHandler,t.createMultipleCallback=this.createMultipleCallbackHandler,t.classType=o(t,"classType",s)}))):n={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler}:n={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler,createMultipleCallback:this.createMultipleCallbackHandler,classType:s},this.world=t,this.physicsType=r.STATIC_BODY,a.call(this,e,i,n),this.type="StaticPhysicsGroup"},createCallbackHandler:function(t){t.body||this.world.enableBody(t,r.STATIC_BODY)},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},createMultipleCallbackHandler:function(){this.refresh()},refresh:function(){for(var t=this.children.entries,e=0;e{var s=i(94240),n=i(97602),r=i(82897),o=i(56694),a=i(3909),h=i(47401),l=i(53996),u=i(6659),c=i(27037),d=i(88456),p=i(41935),f=i(54726),v=i(75671),g=i(66185),m=i(44662),y=i(10850),x=i(83392),T=i(74623),w=i(25163),b=i(74118),E=i(68687),S=i(27354),A=i(61777),_=i(25299),C=i(58403),M=i(66634),R=i(28808),P=i(69360),O=i(93736),L=i(1071),F=new o({Extends:u,initialize:function(t,e){u.call(this),this.scene=t,this.bodies=new C,this.staticBodies=new C,this.pendingDestroy=new C,this.colliders=new T,this.gravity=new O(y(e,"gravity.x",0),y(e,"gravity.y",0)),this.bounds=new b(y(e,"x",0),y(e,"y",0),y(e,"width",t.sys.scale.width),y(e,"height",t.sys.scale.height)),this.checkCollision={up:y(e,"checkCollision.up",!0),down:y(e,"checkCollision.down",!0),left:y(e,"checkCollision.left",!0),right:y(e,"checkCollision.right",!0)},this.fps=y(e,"fps",60),this.fixedStep=y(e,"fixedStep",!0),this._elapsed=0,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this.stepsLastFrame=0,this.timeScale=y(e,"timeScale",1),this.OVERLAP_BIAS=y(e,"overlapBias",4),this.TILE_BIAS=y(e,"tileBias",16),this.forceX=y(e,"forceX",!1),this.isPaused=y(e,"isPaused",!1),this._total=0,this.drawDebug=y(e,"debug",!1),this.debugGraphic,this.defaults={debugShowBody:y(e,"debugShowBody",!0),debugShowStaticBody:y(e,"debugShowStaticBody",!0),debugShowVelocity:y(e,"debugShowVelocity",!0),bodyDebugColor:y(e,"debugBodyColor",16711935),staticBodyDebugColor:y(e,"debugStaticBodyColor",255),velocityDebugColor:y(e,"debugVelocityColor",65280)},this.maxEntries=y(e,"maxEntries",16),this.useTree=y(e,"useTree",!0),this.tree=new E(this.maxEntries),this.staticTree=new E(this.maxEntries),this.treeMinMax={minX:0,minY:0,maxX:0,maxY:0},this._tempMatrix=new P,this._tempMatrix2=new P,this.drawDebug&&this.createDebugGraphic()},enable:function(t,e){void 0===e&&(e=h.DYNAMIC_BODY),Array.isArray(t)||(t=[t]);for(var i=0;i=r;for(this.fixedStep||(n=.001*e,a=!0,this._elapsed=0),i=0;i=r;)this._elapsed-=r,this.step(n)}},step:function(t){var e,i,s=this.bodies.entries,n=s.length;for(e=0;e0){var l=this.tree,u=this.staticTree;for(s=(i=a.entries).length,t=0;t-1&&c>v&&(t.velocity.normalize().scale(v),c=v),t.speed=c},separate:function(t,e,i,s,n,r){if(!r&&!t.enable||!e.enable||t.checkCollision.none||e.checkCollision.none||!this.intersects(t,e))return!1;if(i&&!1===i.call(s,t.gameObject,e.gameObject))return!1;if(t.isCircle&&e.isCircle)return this.separateCircle(t,e,n);if(t.isCircle!==e.isCircle){var o=t.isCircle?e:t,a=t.isCircle?t:e,h={x:o.x,y:o.y,right:o.right,bottom:o.bottom},l=a.center;if((l.yh.bottom)&&(l.xh.right))return this.separateCircle(t,e,n)}var u=!1,d=!1;n?(u=A(t,e,n,this.OVERLAP_BIAS),d=_(t,e,n,this.OVERLAP_BIAS)):this.forceX||Math.abs(this.gravity.y+t.gravity.y)o.right&&(r=l(a.x,a.y,o.right,o.y)-a.radius):a.y>o.bottom&&(a.xo.right&&(r=l(a.x,a.y,o.right,o.bottom)-a.radius)),r*=-1}else r=t.halfWidth+e.halfWidth-l(t.center.x,t.center.y,e.center.x,e.center.y);if(t.overlapR=r,e.overlapR=r,i||0===r||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==r&&(t.onOverlap||e.onOverlap)&&this.emit(c.OVERLAP,t.gameObject,e.gameObject,t,e),0!==r;var h=t.center.x-e.center.x,u=t.center.y-e.center.y,d=Math.sqrt(Math.pow(h,2)+Math.pow(u,2)),p=(e.center.x-t.center.x)/d||0,f=(e.center.y-t.center.y)/d||0,m=2*(t.velocity.x*p+t.velocity.y*f-e.velocity.x*p-e.velocity.y*f)/(t.mass+e.mass);(t.immovable||e.immovable)&&(m*=2),t.immovable||(t.velocity.x=t.velocity.x-m/t.mass*p,t.velocity.y=t.velocity.y-m/t.mass*f),e.immovable||(e.velocity.x=e.velocity.x+m/e.mass*p,e.velocity.y=e.velocity.y+m/e.mass*f),t.immovable||e.immovable||(r/=2);var y=s(t.center,e.center),T=(r+x.EPSILON)*Math.cos(y),w=(r+x.EPSILON)*Math.sin(y);return t.immovable||(t.x-=T,t.y-=w,t.updateCenter()),e.immovable||(e.x+=T,e.y+=w,e.updateCenter()),t.velocity.x*=t.bounce.x,t.velocity.y*=t.bounce.y,e.velocity.x*=e.bounce.x,e.velocity.y*=e.bounce.y,(t.onCollide||e.onCollide)&&this.emit(c.COLLIDE,t.gameObject,e.gameObject,t,e),!0},intersects:function(t,e){return t!==e&&(t.isCircle||e.isCircle?t.isCircle?e.isCircle?l(t.center.x,t.center.y,e.center.x,e.center.y)<=t.halfWidth+e.halfWidth:this.circleBodyIntersects(t,e):this.circleBodyIntersects(e,t):!(t.right<=e.position.x||t.bottom<=e.position.y||t.position.x>=e.right||t.position.y>=e.bottom))},circleBodyIntersects:function(t,e){var i=r(t.center.x,e.left,e.right),s=r(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-s)*(t.center.y-s)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,s,n){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=i),this.collideObjects(t,e,i,s,n,!0)},collide:function(t,e,i,s,n){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=i),this.collideObjects(t,e,i,s,n,!1)},collideObjects:function(t,e,i,s,n,r){var o,a;!t.isParent||void 0!==t.physicsType&&void 0!==e&&t!==e||(t=t.children.entries),e&&e.isParent&&void 0===e.physicsType&&(e=e.children.entries);var h=Array.isArray(t),l=Array.isArray(e);if(this._total=0,h||l)if(!h&&l)for(o=0;o0},collideHandler:function(t,e,i,s,n,r){if(void 0===e&&t.isParent)return this.collideGroupVsGroup(t,t,i,s,n,r);if(!t||!e)return!1;if(t.body){if(e.body)return this.collideSpriteVsSprite(t,e,i,s,n,r);if(e.isParent)return this.collideSpriteVsGroup(t,e,i,s,n,r);if(e.isTilemap)return this.collideSpriteVsTilemapLayer(t,e,i,s,n,r)}else if(t.isParent){if(e.body)return this.collideSpriteVsGroup(e,t,i,s,n,r);if(e.isParent)return this.collideGroupVsGroup(t,e,i,s,n,r);if(e.isTilemap)return this.collideGroupVsTilemapLayer(t,e,i,s,n,r)}else if(t.isTilemap){if(e.body)return this.collideSpriteVsTilemapLayer(e,t,i,s,n,r);if(e.isParent)return this.collideGroupVsTilemapLayer(e,t,i,s,n,r)}},collideSpriteVsSprite:function(t,e,i,s,n,r){return!(!t.body||!e.body)&&(this.separate(t.body,e.body,s,n,r)&&(i&&i.call(n,t,e),this._total++),!0)},collideSpriteVsGroup:function(t,e,i,s,n,r){var o,a,l,u=t.body;if(0!==e.length&&u&&u.enable&&!u.checkCollision.none)if(this.useTree||e.physicsType===h.STATIC_BODY){var c=this.treeMinMax;c.minX=u.left,c.minY=u.top,c.maxX=u.right,c.maxY=u.bottom;var d=e.physicsType===h.DYNAMIC_BODY?this.tree.search(c):this.staticTree.search(c);for(a=d.length,o=0;oc.baseTileWidth){var d=(c.tileWidth-c.baseTileWidth)*e.scaleX;a-=d,l+=d}c.tileHeight>c.baseTileHeight&&(u+=(c.tileHeight-c.baseTileHeight)*e.scaleY);var p=m(a,h,l,u,null,e.scene.cameras.main,e.layer);return 0!==p.length&&this.collideSpriteVsTilesHandler(t,p,i,s,n,r,!0)},collideSpriteVsTilesHandler:function(t,e,i,s,n,r,o){for(var a,h,l=t.body,u={left:0,right:0,top:0,bottom:0},d=!1,p=0;p{t.exports={setAcceleration:function(t,e){return this.body.acceleration.set(t,e),this},setAccelerationX:function(t){return this.body.acceleration.x=t,this},setAccelerationY:function(t){return this.body.acceleration.y=t,this}}},29257:t=>{t.exports={setAngularVelocity:function(t){return this.body.angularVelocity=t,this},setAngularAcceleration:function(t){return this.body.angularAcceleration=t,this},setAngularDrag:function(t){return this.body.angularDrag=t,this}}},62122:t=>{t.exports={setBounce:function(t,e){return this.body.bounce.set(t,e),this},setBounceX:function(t){return this.body.bounce.x=t,this},setBounceY:function(t){return this.body.bounce.y=t,this},setCollideWorldBounds:function(t,e,i){return this.body.setCollideWorldBounds(t,e,i),this}}},99803:t=>{t.exports={setDebug:function(t,e,i){return this.debugShowBody=t,this.debugShowVelocity=e,this.debugBodyColor=i,this},setDebugBodyColor:function(t){return this.body.debugBodyColor=t,this},debugShowBody:{get:function(){return this.body.debugShowBody},set:function(t){this.body.debugShowBody=t}},debugShowVelocity:{get:function(){return this.body.debugShowVelocity},set:function(t){this.body.debugShowVelocity=t}},debugBodyColor:{get:function(){return this.body.debugBodyColor},set:function(t){this.body.debugBodyColor=t}}}},87145:t=>{t.exports={setDrag:function(t,e){return this.body.drag.set(t,e),this},setDragX:function(t){return this.body.drag.x=t,this},setDragY:function(t){return this.body.drag.y=t,this},setDamping:function(t){return this.body.useDamping=t,this}}},96174:t=>{var e={enableBody:function(t,e,i,s,n){return t&&this.body.reset(e,i),s&&(this.body.gameObject.active=!0),n&&(this.body.gameObject.visible=!0),this.body.enable=!0,this},disableBody:function(t,e){return void 0===t&&(t=!1),void 0===e&&(e=!1),this.body.stop(),this.body.enable=!1,t&&(this.body.gameObject.active=!1),e&&(this.body.gameObject.visible=!1),this},refreshBody:function(){return this.body.updateFromGameObject(),this}};t.exports=e},51702:t=>{t.exports={setFriction:function(t,e){return this.body.friction.set(t,e),this},setFrictionX:function(t){return this.body.friction.x=t,this},setFrictionY:function(t){return this.body.friction.y=t,this}}},25578:t=>{t.exports={setGravity:function(t,e){return this.body.gravity.set(t,e),this},setGravityX:function(t){return this.body.gravity.x=t,this},setGravityY:function(t){return this.body.gravity.y=t,this}}},72029:t=>{var e={setImmovable:function(t){return void 0===t&&(t=!0),this.body.immovable=t,this}};t.exports=e},34566:t=>{t.exports={setMass:function(t){return this.body.mass=t,this}}},2732:(t,e,i)=>{var s=i(15147),n=i(26673),r=i(22184),o=i(26535);t.exports=function(t,e,i,a,h,l){var u=s(t,e-a,i-a,2*a,2*a,h,l);if(0===u.length)return u;for(var c=new n(e,i,a),d=new n,p=[],f=0;f{t.exports=function(t,e,i,s,n,r,o){void 0===r&&(r=!0),void 0===o&&(o=!1);var a=[],h=[],l=t.treeMinMax;if(l.minX=e,l.minY=i,l.maxX=e+s,l.maxY=i+n,o&&(h=t.staticTree.search(l)),r&&t.useTree)a=t.tree.search(l);else if(r){var u=t.bodies,c={position:{x:e,y:i},left:e,top:i,right:e+s,bottom:i+n,isCircle:!1},d=t.intersects;u.iterate((function(t){d(t,c)&&a.push(t)}))}return h.concat(a)}},57527:t=>{var e={setPushable:function(t){return void 0===t&&(t=!0),this.body.pushable=t,this}};t.exports=e},77687:t=>{t.exports={setOffset:function(t,e){return this.body.setOffset(t,e),this},setSize:function(t,e,i){return this.body.setSize(t,e,i),this},setBodySize:function(t,e,i){return this.body.setSize(t,e,i),this},setCircle:function(t,e,i){return this.body.setCircle(t,e,i),this}}},66536:t=>{t.exports={setVelocity:function(t,e){return this.body.setVelocity(t,e),this},setVelocityX:function(t){return this.body.setVelocityX(t),this},setVelocityY:function(t){return this.body.setVelocityY(t),this},setMaxVelocity:function(t,e){return this.body.maxVelocity.set(t,e),this}}},7864:(t,e,i)=>{t.exports={Acceleration:i(5321),Angular:i(29257),Bounce:i(62122),Debug:i(99803),Drag:i(87145),Enable:i(96174),Friction:i(51702),Gravity:i(25578),Immovable:i(72029),Mass:i(34566),OverlapCirc:i(2732),OverlapRect:i(15147),Pushable:i(57527),Size:i(77687),Velocity:i(66536)}},47401:t=>{t.exports={DYNAMIC_BODY:0,STATIC_BODY:1,GROUP:2,TILEMAPLAYER:3,FACING_NONE:10,FACING_UP:11,FACING_DOWN:12,FACING_LEFT:13,FACING_RIGHT:14}},22346:t=>{t.exports="collide"},95092:t=>{t.exports="overlap"},15775:t=>{t.exports="pause"},74142:t=>{t.exports="resume"},22825:t=>{t.exports="tilecollide"},10851:t=>{t.exports="tileoverlap"},7543:t=>{t.exports="worldbounds"},1487:t=>{t.exports="worldstep"},27037:(t,e,i)=>{t.exports={COLLIDE:i(22346),OVERLAP:i(95092),PAUSE:i(15775),RESUME:i(74142),TILE_COLLIDE:i(22825),TILE_OVERLAP:i(10851),WORLD_BOUNDS:i(7543),WORLD_STEP:i(1487)}},39977:(t,e,i)=>{var s=i(47401),n=i(98611),r={ArcadePhysics:i(66150),Body:i(97602),Collider:i(3909),Components:i(7864),Events:i(27037),Factory:i(99523),GetOverlapX:i(75671),GetOverlapY:i(66185),SeparateX:i(61777),SeparateY:i(25299),Group:i(10481),Image:i(62832),Sprite:i(25084),StaticBody:i(66634),StaticGroup:i(46346),Tilemap:i(8413),World:i(85233)};r=n(!1,r,s),t.exports=r},25163:t=>{t.exports=function(t,e){return t.collisionCallback?!t.collisionCallback.call(t.collisionCallbackContext,e,t):!t.layer.callbacks[t.index]||!t.layer.callbacks[t.index].callback.call(t.layer.callbacks[t.index].callbackContext,e,t)}},98209:t=>{t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.left=!0):e>0&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=e,t.updateCenter(),0===t.bounce.x?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x}},72792:t=>{t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):e>0&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=e,t.updateCenter(),0===t.bounce.y?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y}},27354:(t,e,i)=>{var s=i(14405),n=i(52926),r=i(28808);t.exports=function(t,e,i,o,a,h,l){var u=o.left,c=o.top,d=o.right,p=o.bottom,f=i.faceLeft||i.faceRight,v=i.faceTop||i.faceBottom;if(l||(f=!0,v=!0),!f&&!v)return!1;var g=0,m=0,y=0,x=1;if(e.deltaAbsX()>e.deltaAbsY()?y=-1:e.deltaAbsX(){var s=i(98209);t.exports=function(t,e,i,n,r,o){var a=0,h=e.faceLeft,l=e.faceRight,u=e.collideLeft,c=e.collideRight;return o||(h=!0,l=!0,u=!0,c=!0),t.deltaX()<0&&c&&t.checkCollision.left?l&&t.x0&&u&&t.checkCollision.right&&h&&t.right>i&&(a=t.right-i)>r&&(a=0),0!==a&&(t.customSeparateX?t.overlapX=a:s(t,a)),a}},52926:(t,e,i)=>{var s=i(72792);t.exports=function(t,e,i,n,r,o){var a=0,h=e.faceTop,l=e.faceBottom,u=e.collideUp,c=e.collideDown;return o||(h=!0,l=!0,u=!0,c=!0),t.deltaY()<0&&c&&t.checkCollision.up?l&&t.y0&&u&&t.checkCollision.down&&h&&t.bottom>i&&(a=t.bottom-i)>r&&(a=0),0!==a&&(t.customSeparateY?t.overlapY=a:s(t,a)),a}},28808:t=>{t.exports=function(t,e){return!(e.right<=t.left||e.bottom<=t.top||e.position.x>=t.right||e.position.y>=t.bottom)}},8413:(t,e,i)=>{var s={ProcessTileCallbacks:i(25163),ProcessTileSeparationX:i(98209),ProcessTileSeparationY:i(72792),SeparateTile:i(27354),TileCheckX:i(14405),TileCheckY:i(52926),TileIntersectsBody:i(28808)};t.exports=s},53954:(t,e,i)=>{t.exports={Arcade:i(39977),Matter:i(45949)}},63568:(t,e,i)=>{var s=i(56694),n=i(93736),r=new s({initialize:function(){this.boundsCenter=new n,this.centerDiff=new n},parseBody:function(t){if(!(t=t.hasOwnProperty("body")?t.body:t).hasOwnProperty("bounds")||!t.hasOwnProperty("centerOfMass"))return!1;var e=this.boundsCenter,i=this.centerDiff,s=t.bounds.max.x-t.bounds.min.x,n=t.bounds.max.y-t.bounds.min.y,r=s*t.centerOfMass.x,o=n*t.centerOfMass.y;return e.set(s/2,n/2),i.set(r-e.x,o-e.y),!0},getTopLeft:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e+s.x+r.x,i+s.y+r.y)}return!1},getTopCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e+r.x,i+s.y+r.y)}return!1},getTopRight:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e-(s.x-r.x),i+s.y+r.y)}return!1},getLeftCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e+s.x+r.x,i+r.y)}return!1},getCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.centerDiff;return new n(e+s.x,i+s.y)}return!1},getRightCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e-(s.x-r.x),i+r.y)}return!1},getBottomLeft:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e+s.x+r.x,i-(s.y-r.y))}return!1},getBottomCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e+r.x,i-(s.y-r.y))}return!1},getBottomRight:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e-(s.x-r.x),i-(s.y-r.y))}return!1}});t.exports=r},18171:(t,e,i)=>{var s=i(16929);s.Body=i(84125),s.Composite=i(11299),s.World=i(72005),s.Detector=i(13657),s.Grid=i(15489),s.Pairs=i(91327),s.Pair=i(70584),s.Query=i(13390),s.Resolver=i(44272),s.SAT=i(5756),s.Constraint=i(52838),s.Common=i(68758),s.Engine=i(45775),s.Events=i(39073),s.Sleeping=i(22806),s.Plugin=i(84474),s.Bodies=i(68516),s.Composites=i(56643),s.Axes=i(50658),s.Bounds=i(84091),s.Svg=i(92765),s.Vector=i(10438),s.Vertices=i(39745),s.World.add=s.Composite.add,s.World.remove=s.Composite.remove,s.World.addComposite=s.Composite.addComposite,s.World.addBody=s.Composite.addBody,s.World.addConstraint=s.Composite.addConstraint,s.World.clear=s.Composite.clear,t.exports=s},72653:(t,e,i)=>{var s=i(68516),n=i(56694),r=i(56643),o=i(52838),a=i(92765),h=i(3860),l=i(7030),u=i(73658),c=i(84720),d=i(10998),p=i(72829),f=i(88596),v=i(39745),g=new n({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},rectangle:function(t,e,i,n,r){var o=s.rectangle(t,e,i,n,r);return this.world.add(o),o},trapezoid:function(t,e,i,n,r,o){var a=s.trapezoid(t,e,i,n,r,o);return this.world.add(a),a},circle:function(t,e,i,n,r){var o=s.circle(t,e,i,n,r);return this.world.add(o),o},polygon:function(t,e,i,n,r){var o=s.polygon(t,e,i,n,r);return this.world.add(o),o},fromVertices:function(t,e,i,n,r,o,a){"string"==typeof i&&(i=v.fromPath(i));var h=s.fromVertices(t,e,i,n,r,o,a);return this.world.add(h),h},fromPhysicsEditor:function(t,e,i,s,n){void 0===n&&(n=!0);var r=d.parseBody(t,e,i,s);return n&&!this.world.has(r)&&this.world.add(r),r},fromSVG:function(t,e,i,n,r,o){void 0===n&&(n=1),void 0===r&&(r={}),void 0===o&&(o=!0);for(var h=i.getElementsByTagName("path"),l=[],u=0;u{var s=i(74527),n=i(72632),r=i(93736);t.exports=function(t,e,i,o){void 0===i&&(i={}),void 0===o&&(o=!0);var a=e.x,h=e.y;if(e.body={temp:!0,position:{x:a,y:h}},[s.Bounce,s.Collision,s.Force,s.Friction,s.Gravity,s.Mass,s.Sensor,s.SetBody,s.Sleep,s.Static,s.Transform,s.Velocity].forEach((function(t){for(var i in t)(s=t[i]).get&&"function"==typeof s.get||s.set&&"function"==typeof s.set?Object.defineProperty(e,i,{get:t[i].get,set:t[i].set}):Object.defineProperty(e,i,{value:t[i]});var s})),e.world=t,e._tempVec2=new r(a,h),i.hasOwnProperty("type")&&"body"===i.type)e.setExistingBody(i,o);else{var l=n(i,"shape",null);l||(l="rectangle"),i.addToWorld=o,e.setBody(l,i)}return e}},7030:(t,e,i)=>{var s=i(56694),n=i(74527),r=i(89980),o=i(72632),a=i(1539),h=i(58210),l=i(93736),u=new s({Extends:a,Mixins:[n.Bounce,n.Collision,n.Force,n.Friction,n.Gravity,n.Mass,n.Sensor,n.SetBody,n.Sleep,n.Static,n.Transform,n.Velocity,h],initialize:function(t,e,i,s,n,a){r.call(this,t.scene,"Image"),this._crop=this.resetCropObject(),this.setTexture(s,n),this.setSizeToFrame(),this.setOrigin(),this.world=t,this._tempVec2=new l(e,i);var h=o(a,"shape",null);h?this.setBody(h,a):this.setRectangle(this.width,this.height,a),this.setPosition(e,i),this.initPipeline()}});t.exports=u},50583:(t,e,i)=>{var s=i(84093),n=i(50658),r=i(68516),o=i(84125),a=i(63568),h=i(84091),l=i(56694),u=i(11299),c=i(56643),d=i(52838),p=i(13657),f=i(53996),v=i(72653),g=i(72632),m=i(10850),y=i(15489),x=i(1675),T=i(80391),w=i(16929),b=i(44097),E=i(30657),S=i(70584),A=i(91327),_=i(84474),C=i(91963),M=i(13390),R=i(44272),P=i(5756),O=i(7599),L=i(92765),F=i(10438),D=i(39745),k=i(31468),I=new l({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,this.bodyBounds,this.body=o,this.composite=u,this.detector=p,this.grid=y,this.pair=S,this.pairs=A,this.query=M,this.resolver=R,this.sat=P,this.constraint=d,this.bodies=r,this.composites=c,this.axes=n,this.bounds=h,this.svg=L,this.vector=F,this.vertices=D,this.verts=D,this._tempVec2=F.create(),m(this.config,"plugins.collisionevents",!0)&&this.enableCollisionEventsPlugin(),m(this.config,"plugins.attractors",!1)&&this.enableAttractorPlugin(),m(this.config,"plugins.wrap",!1)&&this.enableWrapPlugin(),R._restingThresh=m(this.config,"restingThresh",4),R._restingThreshTangent=m(this.config,"restingThreshTangent",6),R._positionDampen=m(this.config,"positionDampen",.9),R._positionWarming=m(this.config,"positionWarming",.8),R._frictionNormalMultiplier=m(this.config,"frictionNormalMultiplier",5),t.sys.events.once(O.BOOT,this.boot,this),t.sys.events.on(O.START,this.start,this)},boot:function(){this.world=new k(this.scene,this.config),this.add=new v(this.world),this.bodyBounds=new a,this.systems.events.once(O.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new k(this.scene,this.config),this.add=new v(this.world));var t=this.systems.events;t.on(O.UPDATE,this.world.update,this.world),t.on(O.POST_UPDATE,this.world.postUpdate,this.world),t.once(O.SHUTDOWN,this.shutdown,this)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return E(g(e,"matter",{}),g(t,"matter",{}))},enableAttractorPlugin:function(){return _.register(x),_.use(w,x),this},enableWrapPlugin:function(){return _.register(b),_.use(w,b),this},enableCollisionEventsPlugin:function(){return _.register(T),_.use(w,T),this},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},set60Hz:function(){return this.world.getDelta=this.world.update60Hz,this.world.autoUpdate=!0,this},set30Hz:function(){return this.world.getDelta=this.world.update30Hz,this.world.autoUpdate=!0,this},step:function(t,e){this.world.step(t,e)},containsPoint:function(t,e,i){t=this.getMatterBodies(t);var s=F.create(e,i);return M.point(t,s).length>0},intersectPoint:function(t,e,i){i=this.getMatterBodies(i);var s=F.create(t,e),n=[];return M.point(i,s).forEach((function(t){-1===n.indexOf(t)&&n.push(t)})),n},intersectRect:function(t,e,i,s,n,r){void 0===n&&(n=!1),r=this.getMatterBodies(r);var o={min:{x:t,y:e},max:{x:t+i,y:e+s}},a=[];return M.region(r,o,n).forEach((function(t){-1===a.indexOf(t)&&a.push(t)})),a},intersectRay:function(t,e,i,s,n,r){void 0===n&&(n=1),r=this.getMatterBodies(r);for(var o=[],a=M.ray(r,F.create(t,e),F.create(i,s),n),h=0;h{var s=i(16569),n=i(56694),r=i(74527),o=i(89980),a=i(72632),h=i(58210),l=i(13747),u=i(93736),c=new n({Extends:l,Mixins:[r.Bounce,r.Collision,r.Force,r.Friction,r.Gravity,r.Mass,r.Sensor,r.SetBody,r.Sleep,r.Static,r.Transform,r.Velocity,h],initialize:function(t,e,i,n,r,h){o.call(this,t.scene,"Sprite"),this._crop=this.resetCropObject(),this.anims=new s(this),this.setTexture(n,r),this.setSizeToFrame(),this.setOrigin(),this.world=t,this._tempVec2=new u(e,i);var l=a(h,"shape",null);l?this.setBody(l,h):this.setRectangle(this.width,this.height,h),this.setPosition(e,i),this.initPipeline()}});t.exports=c},84720:(t,e,i)=>{var s=i(68516),n=i(84125),r=i(56694),o=i(74527),a=i(6659),h=i(72632),l=i(19256),u=i(39745),c=new r({Extends:a,Mixins:[o.Bounce,o.Collision,o.Friction,o.Gravity,o.Mass,o.Sensor,o.Sleep,o.Static],initialize:function(t,e,i){a.call(this),this.tile=e,this.world=t,e.physics.matterBody&&e.physics.matterBody.destroy(),e.physics.matterBody=this;var s=h(i,"body",null),n=h(i,"addToWorld",!0);if(s)this.setBody(s,n);else{var r=e.getCollisionGroup();h(r,"objects",[]).length>0?this.setFromTileCollision(i):this.setFromTileRectangle(i)}},setFromTileRectangle:function(t){void 0===t&&(t={}),l(t,"isStatic")||(t.isStatic=!0),l(t,"addToWorld")||(t.addToWorld=!0);var e=this.tile.getBounds(),i=e.x+e.width/2,n=e.y+e.height/2,r=s.rectangle(i,n,e.width,e.height,t);return this.setBody(r,t.addToWorld),this},setFromTileCollision:function(t){void 0===t&&(t={}),l(t,"isStatic")||(t.isStatic=!0),l(t,"addToWorld")||(t.addToWorld=!0);for(var e=this.tile.tilemapLayer.scaleX,i=this.tile.tilemapLayer.scaleY,r=this.tile.getLeft(),o=this.tile.getTop(),a=this.tile.getCollisionGroup(),c=h(a,"objects",[]),d=[],p=0;p1&&(t.parts=d,this.setBody(n.create(t),t.addToWorld)),this},setBody:function(t,e){return void 0===e&&(e=!0),this.body&&this.removeBody(),this.body=t,this.body.gameObject=this,e&&this.world.add(this.body),this},removeBody:function(){return this.body&&(this.world.remove(this.body),this.body.gameObject=void 0,this.body=void 0),this},destroy:function(){this.removeBody(),this.tile.physics.matterBody=void 0,this.removeAllListeners()}});t.exports=c},10998:(t,e,i)=>{var s=i(68516),n=i(84125),r=i(68758),o=i(72632),a=i(39745),h={parseBody:function(t,e,i,s){void 0===s&&(s={});for(var a=o(i,"fixtures",[]),h=[],l=0;l{var s=i(68516),n=i(84125),r={parseBody:function(t,e,i,r){var o;void 0===r&&(r={});var a=i.vertices;if(1===a.length)r.vertices=a[0],o=n.create(r),s.flagCoincidentParts(o.parts);else{for(var h=[],l=0;l{var s=i(84091),n=i(56694),r=i(11299),o=i(52838),a=i(13657),h=i(35416),l=i(33963),u=i(30657),c=i(22806),d=i(93736),p=i(39745),f=new n({initialize:function(t,e,i){void 0===i&&(i={});this.scene=t,this.world=e,this.camera=null,this.pointer=null,this.active=!0,this.position=new d,this.body=null,this.part=null,this.constraint=o.create(u(i,{label:"Pointer Constraint",pointA:{x:0,y:0},pointB:{x:0,y:0},length:.01,stiffness:.1,angularStiffness:1,collisionFilter:{category:1,mask:4294967295,group:0}})),this.world.on(h.BEFORE_UPDATE,this.update,this),t.sys.input.on(l.POINTER_DOWN,this.onDown,this),t.sys.input.on(l.POINTER_UP,this.onUp,this)},onDown:function(t){this.pointer||(this.pointer=t,this.camera=t.camera)},onUp:function(t){t===this.pointer&&(this.pointer=null)},getBody:function(t){var e=this.position,i=this.constraint;this.camera.getWorldPoint(t.x,t.y,e);for(var n=r.allBodies(this.world.localWorld),o=0;o1?1:0;n{var s=i(68516),n=i(84125),r=i(56694),o=i(68758),a=i(11299),h=i(45775),l=i(6659),u=i(35416),c=i(72632),d=i(10850),p=i(84125),f=i(39073),v=i(84720),g=i(72005),m=i(10438),y=new r({Extends:l,initialize:function(t,e){l.call(this),this.scene=t,this.engine=h.create(e),this.localWorld=this.engine.world;var i=d(e,"gravity",null);i?this.setGravity(i.x,i.y,i.scale):!1===i&&this.setGravity(0,0,0),this.walls={left:null,right:null,top:null,bottom:null},this.enabled=d(e,"enabled",!0),this.correction=d(e,"correction",1),this.getDelta=d(e,"getDelta",this.update60Hz);var s=c(e,"runner",{}),n=c(s,"fps",!1),r=c(s,"fps",60),o=c(s,"delta",1e3/r),a=c(s,"deltaMin",1e3/r),u=c(s,"deltaMax",1e3/(.5*r));n||(r=1e3/o),this.runner={fps:r,correction:c(s,"correction",1),deltaSampleSize:c(s,"deltaSampleSize",60),counterTimestamp:0,frameCounter:0,deltaHistory:[],timePrev:null,timeScalePrev:1,frameRequestId:null,isFixed:c(s,"isFixed",!1),delta:o,deltaMin:a,deltaMax:u},this.autoUpdate=d(e,"autoUpdate",!0);var p=d(e,"debug",!1);if(this.drawDebug="object"==typeof p||p,this.debugGraphic,this.debugConfig={showAxes:c(p,"showAxes",!1),showAngleIndicator:c(p,"showAngleIndicator",!1),angleColor:c(p,"angleColor",15208787),showBroadphase:c(p,"showBroadphase",!1),broadphaseColor:c(p,"broadphaseColor",16757760),showBounds:c(p,"showBounds",!1),boundsColor:c(p,"boundsColor",16777215),showVelocity:c(p,"showVelocity",!1),velocityColor:c(p,"velocityColor",44783),showCollisions:c(p,"showCollisions",!1),collisionColor:c(p,"collisionColor",16094476),showSeparations:c(p,"showSeparations",!1),separationColor:c(p,"separationColor",16753920),showBody:c(p,"showBody",!0),showStaticBody:c(p,"showStaticBody",!0),showInternalEdges:c(p,"showInternalEdges",!1),renderFill:c(p,"renderFill",!1),renderLine:c(p,"renderLine",!0),fillColor:c(p,"fillColor",1075465),fillOpacity:c(p,"fillOpacity",1),lineColor:c(p,"lineColor",2678297),lineOpacity:c(p,"lineOpacity",1),lineThickness:c(p,"lineThickness",1),staticFillColor:c(p,"staticFillColor",857979),staticLineColor:c(p,"staticLineColor",1255396),showSleeping:c(p,"showSleeping",!1),staticBodySleepOpacity:c(p,"staticBodySleepOpacity",.7),sleepFillColor:c(p,"sleepFillColor",4605510),sleepLineColor:c(p,"sleepLineColor",10066585),showSensors:c(p,"showSensors",!0),sensorFillColor:c(p,"sensorFillColor",857979),sensorLineColor:c(p,"sensorLineColor",1255396),showPositions:c(p,"showPositions",!0),positionSize:c(p,"positionSize",4),positionColor:c(p,"positionColor",14697178),showJoint:c(p,"showJoint",!0),jointColor:c(p,"jointColor",14737474),jointLineOpacity:c(p,"jointLineOpacity",1),jointLineThickness:c(p,"jointLineThickness",2),pinSize:c(p,"pinSize",4),pinColor:c(p,"pinColor",4382944),springColor:c(p,"springColor",14697184),anchorColor:c(p,"anchorColor",15724527),anchorSize:c(p,"anchorSize",4),showConvexHulls:c(p,"showConvexHulls",!1),hullColor:c(p,"hullColor",14091216)},this.drawDebug&&this.createDebugGraphic(),this.setEventsProxy(),c(e,"setBounds",!1)){var f=e.setBounds;if("boolean"==typeof f)this.setBounds();else{var v=c(f,"x",0),g=c(f,"y",0),m=c(f,"width",t.sys.scale.width),y=c(f,"height",t.sys.scale.height),x=c(f,"thickness",64),T=c(f,"left",!0),w=c(f,"right",!0),b=c(f,"top",!0),E=c(f,"bottom",!0);this.setBounds(v,g,m,y,x,T,w,b,E)}}},setCompositeRenderStyle:function(t){var e,i,s,n=t.bodies,r=t.constraints,o=t.composites;for(e=0;e0&&(i=n[0].bodyA,s=n[0].bodyB),t.emit(u.COLLISION_START,e,i,s)})),f.on(e,"collisionActive",(function(e){var i,s,n=e.pairs;n.length>0&&(i=n[0].bodyA,s=n[0].bodyB),t.emit(u.COLLISION_ACTIVE,e,i,s)})),f.on(e,"collisionEnd",(function(e){var i,s,n=e.pairs;n.length>0&&(i=n[0].bodyA,s=n[0].bodyB),t.emit(u.COLLISION_END,e,i,s)}))},setBounds:function(t,e,i,s,n,r,o,a,h){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===s&&(s=this.scene.sys.scale.height),void 0===n&&(n=64),void 0===r&&(r=!0),void 0===o&&(o=!0),void 0===a&&(a=!0),void 0===h&&(h=!0),this.updateWall(r,"left",t-n,e-n,n,s+2*n),this.updateWall(o,"right",t+i,e-n,n,s+2*n),this.updateWall(a,"top",t,e-n,i,n),this.updateWall(h,"bottom",t,e+s,i,n),this},updateWall:function(t,e,i,s,n,r){var o=this.walls[e];t?(o&&g.remove(this.localWorld,o),i+=n/2,s+=r/2,this.walls[e]=this.create(i,s,n,r,{isStatic:!0,friction:0,frictionStatic:0})):(o&&g.remove(this.localWorld,o),this.walls[e]=null)},createDebugGraphic:function(){var t=this.scene.sys.add.graphics({x:0,y:0});return t.setDepth(Number.MAX_VALUE),this.debugGraphic=t,this.drawDebug=!0,t},disableGravity:function(){return this.localWorld.gravity.x=0,this.localWorld.gravity.y=0,this.localWorld.gravity.scale=0,this},setGravity:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=1),this.localWorld.gravity.x=t,this.localWorld.gravity.y=e,void 0!==i&&(this.localWorld.gravity.scale=i),this},create:function(t,e,i,n,r){var o=s.rectangle(t,e,i,n,r);return g.add(this.localWorld,o),o},add:function(t){return g.add(this.localWorld,t),this},remove:function(t,e){Array.isArray(t)||(t=[t]);for(var i=0;is.deltaMax?s.deltaMax:e)/s.delta,s.delta=e),0!==s.timeScalePrev&&(r*=n.timeScale/s.timeScalePrev),0===n.timeScale&&(r=0),s.timeScalePrev=n.timeScale,s.correction=r,s.frameCounter+=1,t-s.counterTimestamp>=1e3&&(s.fps=s.frameCounter*((t-s.counterTimestamp)/1e3),s.counterTimestamp=t,s.frameCounter=0),h.update(i,e,r)}},step:function(t,e){h.update(this.engine,t,e)},update60Hz:function(){return 1e3/60},update30Hz:function(){return 1e3/30},has:function(t){var e=t.hasOwnProperty("body")?t.body:t;return null!==a.get(this.localWorld,e.id,e.type)},getAllBodies:function(){return a.allBodies(this.localWorld)},getAllConstraints:function(){return a.allConstraints(this.localWorld)},getAllComposites:function(){return a.allComposites(this.localWorld)},postUpdate:function(){if(this.drawDebug){var t=this.debugConfig,e=this.engine,i=this.debugGraphic,s=a.allBodies(this.localWorld);this.debugGraphic.clear(),t.showBroadphase&&e.broadphase.controller&&this.renderGrid(e.broadphase,i,t.broadphaseColor,.5),t.showBounds&&this.renderBodyBounds(s,i,t.boundsColor,.5),(t.showBody||t.showStaticBody)&&this.renderBodies(s),t.showJoint&&this.renderJoints(),(t.showAxes||t.showAngleIndicator)&&this.renderBodyAxes(s,i,t.showAxes,t.angleColor,.5),t.showVelocity&&this.renderBodyVelocity(s,i,t.velocityColor,1,2),t.showSeparations&&this.renderSeparations(e.pairs.list,i,t.separationColor),t.showCollisions&&this.renderCollisions(e.pairs.list,i,t.collisionColor)}},renderGrid:function(t,e,i,s){e.lineStyle(1,i,s);for(var n=o.keys(t.buckets),r=0;r0){var l=h[0].vertex.x,u=h[0].vertex.y;2===h.length&&(l=(h[0].vertex.x+h[1].vertex.x)/2,u=(h[0].vertex.y+h[1].vertex.y)/2),a.bodyB===a.supports[0].body||a.bodyA.isStatic?e.lineBetween(l-8*a.normal.x,u-8*a.normal.y,l,u):e.lineBetween(l+8*a.normal.x,u+8*a.normal.y,l,u)}}return this},renderBodyBounds:function(t,e,i,s){e.lineStyle(1,i,s);for(var n=0;n1?1:0;h1?1:0;a1?1:0;a1&&this.renderConvexHull(v,e,p,y)}}},renderBody:function(t,e,i,s,n,r,o,a){void 0===s&&(s=null),void 0===n&&(n=null),void 0===r&&(r=1),void 0===o&&(o=null),void 0===a&&(a=null);for(var h=this.debugConfig,l=h.sensorFillColor,u=h.sensorLineColor,c=t.parts,d=c.length,p=d>1?1:0;p1){var n=t.vertices;e.lineStyle(s,i),e.beginPath(),e.moveTo(n[0].x,n[0].y);for(var r=1;r0&&(e.fillStyle(a),e.fillCircle(u.x,u.y,h),e.fillCircle(c.x,c.y,h)),this},resetCollisionIDs:function(){return n._nextCollidingGroupId=1,n._nextNonCollidingGroupId=-1,n._nextCategory=1,this},shutdown:function(){f.off(this.engine),this.removeAllListeners(),g.clear(this.localWorld,!1),h.clear(this.engine),this.drawDebug&&this.debugGraphic.destroy()},destroy:function(){this.shutdown()}});t.exports=y},95349:t=>{t.exports={setBounce:function(t){return this.body.restitution=t,this}}},70679:t=>{var e={setCollisionCategory:function(t){return this.body.collisionFilter.category=t,this},setCollisionGroup:function(t){return this.body.collisionFilter.group=t,this},setCollidesWith:function(t){var e=0;if(Array.isArray(t))for(var i=0;i{var s=i(84125),n={applyForce:function(t){return this._tempVec2.set(this.body.position.x,this.body.position.y),s.applyForce(this.body,this._tempVec2,t),this},applyForceFrom:function(t,e){return s.applyForce(this.body,t,e),this},thrust:function(t){var e=this.body.angle;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),s.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustLeft:function(t){var e=this.body.angle-Math.PI/2;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),s.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustRight:function(t){var e=this.body.angle+Math.PI/2;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),s.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustBack:function(t){var e=this.body.angle-Math.PI;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),s.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this}};t.exports=n},74015:t=>{var e={setFriction:function(t,e,i){return this.body.friction=t,void 0!==e&&(this.body.frictionAir=e),void 0!==i&&(this.body.frictionStatic=i),this},setFrictionAir:function(t){return this.body.frictionAir=t,this},setFrictionStatic:function(t){return this.body.frictionStatic=t,this}};t.exports=e},11535:t=>{t.exports={setIgnoreGravity:function(t){return this.body.ignoreGravity=t,this}}},74497:(t,e,i)=>{var s=i(84125),n=i(93736),r={setMass:function(t){return s.setMass(this.body,t),this},setDensity:function(t){return s.setDensity(this.body,t),this},centerOfMass:{get:function(){return new n(this.body.centerOfMass.x,this.body.centerOfMass.y)}}};t.exports=r},75529:t=>{t.exports={setSensor:function(t){return this.body.isSensor=t,this},isSensor:function(){return this.body.isSensor}}},64024:(t,e,i)=>{var s=i(68516),n=i(84125),r=i(88456),o=i(72632),a=i(10998),h=i(72829),l=i(39745),u={setRectangle:function(t,e,i){return this.setBody({type:"rectangle",width:t,height:e},i)},setCircle:function(t,e){return this.setBody({type:"circle",radius:t},e)},setPolygon:function(t,e,i){return this.setBody({type:"polygon",sides:e,radius:t},i)},setTrapezoid:function(t,e,i,s){return this.setBody({type:"trapezoid",width:t,height:e,slope:i},s)},setExistingBody:function(t,e){void 0===e&&(e=!0),this.body&&this.world.remove(this.body,!0),this.body=t;for(var i=0;i{var s=i(35416),n=i(22806),r=i(39073),o={setToSleep:function(){return n.set(this.body,!0),this},setAwake:function(){return n.set(this.body,!1),this},setSleepThreshold:function(t){return void 0===t&&(t=60),this.body.sleepThreshold=t,this},setSleepEvents:function(t,e){return this.setSleepStartEvent(t),this.setSleepEndEvent(e),this},setSleepStartEvent:function(t){if(t){var e=this.world;r.on(this.body,"sleepStart",(function(t){e.emit(s.SLEEP_START,t,this)}))}else r.off(this.body,"sleepStart");return this},setSleepEndEvent:function(t){if(t){var e=this.world;r.on(this.body,"sleepEnd",(function(t){e.emit(s.SLEEP_END,t,this)}))}else r.off(this.body,"sleepEnd");return this}};t.exports=o},82884:(t,e,i)=>{var s=i(84125),n={setStatic:function(t){return s.setStatic(this.body,t),this},isStatic:function(){return this.body.isStatic}};t.exports=n},4753:(t,e,i)=>{var s=i(84125),n=i(83392),r=i(35786),o=i(62138),a={x:{get:function(){return this.body.position.x},set:function(t){this._tempVec2.set(t,this.y),s.setPosition(this.body,this._tempVec2)}},y:{get:function(){return this.body.position.y},set:function(t){this._tempVec2.set(this.x,t),s.setPosition(this.body,this._tempVec2)}},scaleX:{get:function(){return this._scaleX},set:function(t){var e=1/this._scaleX,i=1/this._scaleY;this._scaleX=t,0===this._scaleX?this.renderFlags&=-5:this.renderFlags|=4,s.scale(this.body,e,i),s.scale(this.body,t,this._scaleY)}},scaleY:{get:function(){return this._scaleY},set:function(t){var e=1/this._scaleX,i=1/this._scaleY;this._scaleY=t,0===this._scaleY?this.renderFlags&=-5:this.renderFlags|=4,s.scale(this.body,e,i),s.scale(this.body,this._scaleX,t)}},angle:{get:function(){return o(this.body.angle*n.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*n.DEG_TO_RAD}},rotation:{get:function(){return this.body.angle},set:function(t){this._rotation=r(t),s.setAngle(this.body,this._rotation)}},setPosition:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this._tempVec2.set(t,e),s.setPosition(this.body,this._tempVec2),this},setRotation:function(t){return void 0===t&&(t=0),this._rotation=r(t),s.setAngle(this.body,t),this},setFixedRotation:function(){return s.setInertia(this.body,1/0),this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,s.setAngle(this.body,this.rotation),this},setScale:function(t,e,i){void 0===t&&(t=1),void 0===e&&(e=t);var n=1/this._scaleX,r=1/this._scaleY;return this._scaleX=t,this._scaleY=e,s.scale(this.body,n,r,i),s.scale(this.body,t,e,i),this}};t.exports=a},37268:(t,e,i)=>{var s=i(84125),n={setAngularVelocity:function(t){return s.setAngularVelocity(this.body,t),this},setVelocityX:function(t){return this._tempVec2.set(t,this.body.velocity.y),s.setVelocity(this.body,this._tempVec2),this},setVelocityY:function(t){return this._tempVec2.set(this.body.velocity.x,t),s.setVelocity(this.body,this._tempVec2),this},setVelocity:function(t,e){return this._tempVec2.set(t,e),s.setVelocity(this.body,this._tempVec2),this}};t.exports=n},74527:(t,e,i)=>{t.exports={Bounce:i(95349),Collision:i(70679),Force:i(77178),Friction:i(74015),Gravity:i(11535),Mass:i(74497),Sensor:i(75529),SetBody:i(64024),Sleep:i(25106),Static:i(82884),Transform:i(4753),Velocity:i(37268)}},63201:t=>{t.exports="afteradd"},30474:t=>{t.exports="afterremove"},44822:t=>{t.exports="afterupdate"},88820:t=>{t.exports="beforeadd"},94849:t=>{t.exports="beforeremove"},6391:t=>{t.exports="beforeupdate"},96738:t=>{t.exports="collisionactive"},7916:t=>{t.exports="collisionend"},59529:t=>{t.exports="collisionstart"},10219:t=>{t.exports="dragend"},183:t=>{t.exports="drag"},39143:t=>{t.exports="dragstart"},16483:t=>{t.exports="pause"},35806:t=>{t.exports="resume"},22106:t=>{t.exports="sleepend"},5803:t=>{t.exports="sleepstart"},35416:(t,e,i)=>{t.exports={AFTER_ADD:i(63201),AFTER_REMOVE:i(30474),AFTER_UPDATE:i(44822),BEFORE_ADD:i(88820),BEFORE_REMOVE:i(94849),BEFORE_UPDATE:i(6391),COLLISION_ACTIVE:i(96738),COLLISION_END:i(7916),COLLISION_START:i(59529),DRAG_END:i(10219),DRAG:i(183),DRAG_START:i(39143),PAUSE:i(16483),RESUME:i(35806),SLEEP_END:i(22106),SLEEP_START:i(5803)}},45949:(t,e,i)=>{t.exports={BodyBounds:i(63568),Components:i(74527),Events:i(35416),Factory:i(72653),MatterGameObject:i(3860),Image:i(7030),Matter:i(18171),MatterPhysics:i(50583),PolyDecomp:i(81084),Sprite:i(73658),TileBody:i(84720),PhysicsEditorParser:i(10998),PhysicsJSONParser:i(72829),PointerConstraint:i(88596),World:i(31468)}},84125:(t,e,i)=>{var s={};t.exports=s;var n=i(39745),r=i(10438),o=i(22806),a=i(68758),h=i(84091),l=i(50658);!function(){s._inertiaScale=4,s._nextCollidingGroupId=1,s._nextNonCollidingGroupId=-1,s._nextCategory=1,s.create=function(e){var i={id:a.nextId(),type:"body",label:"Body",parts:[],plugin:{},angle:0,vertices:null,position:{x:0,y:0},force:{x:0,y:0},torque:0,positionImpulse:{x:0,y:0},previousPositionImpulse:{x:0,y:0},constraintImpulse:{x:0,y:0,angle:0},totalContacts:0,speed:0,angularSpeed:0,velocity:{x:0,y:0},angularVelocity:0,isSensor:!1,isStatic:!1,isSleeping:!1,motion:0,sleepThreshold:60,density:.001,restitution:0,friction:.1,frictionStatic:.5,frictionAir:.01,collisionFilter:{category:1,mask:4294967295,group:0},slop:.05,timeScale:1,events:null,bounds:null,chamfer:null,circleRadius:0,positionPrev:null,anglePrev:0,parent:null,axes:null,area:0,mass:0,inverseMass:0,inertia:0,inverseInertia:0,_original:null,render:{visible:!0,opacity:1,sprite:{xOffset:0,yOffset:0},fillColor:null,fillOpacity:null,lineColor:null,lineOpacity:null,lineThickness:null},gameObject:null,scale:{x:1,y:1},centerOfMass:{x:0,y:0},centerOffset:{x:0,y:0},gravityScale:{x:1,y:1},ignoreGravity:!1,ignorePointer:!1,onCollideCallback:null,onCollideEndCallback:null,onCollideActiveCallback:null,onCollideWith:{}};!e.hasOwnProperty("position")&&e.hasOwnProperty("vertices")?e.position=n.centre(e.vertices):e.hasOwnProperty("vertices")||(i.vertices=n.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"));var s=a.extend(i,e);return t(s,e),s.setOnCollideWith=function(t,e){return e?this.onCollideWith[t.id]=e:delete this.onCollideWith[t.id],this},s},s.nextGroup=function(t){return t?s._nextNonCollidingGroupId--:s._nextCollidingGroupId++},s.nextCategory=function(){return s._nextCategory=s._nextCategory<<1,s._nextCategory};var t=function(t,e){e=e||{},s.set(t,{bounds:t.bounds||h.create(t.vertices),positionPrev:t.positionPrev||r.clone(t.position),anglePrev:t.anglePrev||t.angle,vertices:t.vertices,parts:t.parts||[t],isStatic:t.isStatic,isSleeping:t.isSleeping,parent:t.parent||t});var i=t.bounds;if(n.rotate(t.vertices,t.angle,t.position),l.rotate(t.axes,t.angle),h.update(i,t.vertices,t.velocity),s.set(t,{axes:e.axes||t.axes,area:e.area||t.area,mass:e.mass||t.mass,inertia:e.inertia||t.inertia}),1===t.parts.length){var o=t.centerOfMass,a=t.centerOffset,u=i.max.x-i.min.x,c=i.max.y-i.min.y;o.x=-(i.min.x-t.position.x)/u,o.y=-(i.min.y-t.position.y)/c,a.x=u*o.x,a.y=c*o.y}};s.set=function(t,e,i){var n;for(n in"string"==typeof e&&(n=e,(e={})[n]=i),e)if(Object.prototype.hasOwnProperty.call(e,n))switch(i=e[n],n){case"isStatic":s.setStatic(t,i);break;case"isSleeping":o.set(t,i);break;case"mass":s.setMass(t,i);break;case"density":s.setDensity(t,i);break;case"inertia":s.setInertia(t,i);break;case"vertices":s.setVertices(t,i);break;case"position":s.setPosition(t,i);break;case"angle":s.setAngle(t,i);break;case"velocity":s.setVelocity(t,i);break;case"angularVelocity":s.setAngularVelocity(t,i);break;case"parts":s.setParts(t,i);break;case"centre":s.setCentre(t,i);break;default:t[n]=i}},s.setStatic=function(t,e){for(var i=0;i0&&r.rotateAbout(o.position,i,t.position,o.position)}},s.setVelocity=function(t,e){t.positionPrev.x=t.position.x-e.x,t.positionPrev.y=t.position.y-e.y,t.velocity.x=e.x,t.velocity.y=e.y,t.speed=r.magnitude(t.velocity)},s.setAngularVelocity=function(t,e){t.anglePrev=t.angle-e,t.angularVelocity=e,t.angularSpeed=Math.abs(t.angularVelocity)},s.translate=function(t,e){s.setPosition(t,r.add(t.position,e))},s.rotate=function(t,e,i){if(i){var n=Math.cos(e),r=Math.sin(e),o=t.position.x-i.x,a=t.position.y-i.y;s.setPosition(t,{x:i.x+(o*n-a*r),y:i.y+(o*r+a*n)}),s.setAngle(t,t.angle+e)}else s.setAngle(t,t.angle+e)},s.scale=function(t,e,i,r){var o=0,a=0;r=r||t.position;for(var u=0;u0&&(o+=c.area,a+=c.inertia),c.position.x=r.x+(c.position.x-r.x)*e,c.position.y=r.y+(c.position.y-r.y)*i,h.update(c.bounds,c.vertices,t.velocity)}t.parts.length>1&&(t.area=o,t.isStatic||(s.setMass(t,t.density*o),s.setInertia(t,a))),t.circleRadius&&(e===i?t.circleRadius*=e:t.circleRadius=null)},s.update=function(t,e,i,s){var o=Math.pow(e*i*t.timeScale,2),a=1-t.frictionAir*i*t.timeScale,u=t.position.x-t.positionPrev.x,c=t.position.y-t.positionPrev.y;t.velocity.x=u*a*s+t.force.x/t.mass*o,t.velocity.y=c*a*s+t.force.y/t.mass*o,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.angularVelocity=(t.angle-t.anglePrev)*a*s+t.torque/t.inertia*o,t.anglePrev=t.angle,t.angle+=t.angularVelocity,t.speed=r.magnitude(t.velocity),t.angularSpeed=Math.abs(t.angularVelocity);for(var d=0;d0&&(p.position.x+=t.velocity.x,p.position.y+=t.velocity.y),0!==t.angularVelocity&&(n.rotate(p.vertices,t.angularVelocity,t.position),l.rotate(p.axes,t.angularVelocity),d>0&&r.rotateAbout(p.position,t.angularVelocity,t.position,p.position)),h.update(p.bounds,p.vertices,t.velocity)}},s.applyForce=function(t,e,i){t.force.x+=i.x,t.force.y+=i.y;var s=e.x-t.position.x,n=e.y-t.position.y;t.torque+=s*i.y-n*i.x},s._totalProperties=function(t){for(var e={mass:0,area:0,inertia:0,centre:{x:0,y:0}},i=1===t.parts.length?0:1;i{var s={};t.exports=s;var n=i(39073),r=i(68758),o=i(84091),a=i(84125);s.create=function(t){return r.extend({id:r.nextId(),type:"composite",parent:null,isModified:!1,bodies:[],constraints:[],composites:[],label:"Composite",plugin:{}},t)},s.setModified=function(t,e,i,r){if(n.trigger(t,"compositeModified",t),t.isModified=e,i&&t.parent&&s.setModified(t.parent,e,i,r),r)for(var o=0;o{var s={};t.exports=s;var n=i(11299),r=(i(52838),i(68758));s.create=function(t){var e=n.create(),i={label:"World",gravity:{x:0,y:1,scale:.001},bounds:{min:{x:-1/0,y:-1/0},max:{x:1/0,y:1/0}}};return r.extend(e,i,t)}},13657:(t,e,i)=>{var s={};t.exports=s;var n=i(5756),r=i(70584),o=i(84091);s.collisions=function(t,e){for(var i=[],a=e.pairs.table,h=e.metrics,l=0;l1?1:0;d1?1:0;f0:0!=(t.mask&e.category)&&0!=(e.mask&t.category)}},15489:(t,e,i)=>{var s={};t.exports=s;var n=i(70584),r=i(13657),o=i(68758);s.create=function(t){var e={controller:s,detector:r.collisions,buckets:{},pairs:{},pairsList:[],bucketWidth:48,bucketHeight:48};return o.extend(e,t)},s.update=function(t,e,i,n){var r,o,a,h,l,u=i.world,c=t.buckets,d=!1,p=i.metrics;for(p.broadphaseTests=0,r=0;ru.bounds.max.x||f.bounds.max.yu.bounds.max.y)){var v=s._getRegion(t,f);if(!f.region||v.id!==f.region.id||n){p.broadphaseTests+=1,f.region&&!n||(f.region=v);var g=s._regionUnion(v,f.region);for(o=g.startCol;o<=g.endCol;o++)for(a=g.startRow;a<=g.endRow;a++){h=c[l=s._getBucketId(o,a)];var m=o>=v.startCol&&o<=v.endCol&&a>=v.startRow&&a<=v.endRow,y=o>=f.region.startCol&&o<=f.region.endCol&&a>=f.region.startRow&&a<=f.region.endRow;!m&&y&&y&&h&&s._bucketRemoveBody(t,h,f),(f.region===v||m&&!y||n)&&(h||(h=s._createBucket(c,l)),s._bucketAddBody(t,h,f))}f.region=v,d=!0}}}d&&(t.pairsList=s._createActivePairsList(t))},s.clear=function(t){t.buckets={},t.pairs={},t.pairsList=[]},s._regionUnion=function(t,e){var i=Math.min(t.startCol,e.startCol),n=Math.max(t.endCol,e.endCol),r=Math.min(t.startRow,e.startRow),o=Math.max(t.endRow,e.endRow);return s._createRegion(i,n,r,o)},s._getRegion=function(t,e){var i=e.bounds,n=Math.floor(i.min.x/t.bucketWidth),r=Math.floor(i.max.x/t.bucketWidth),o=Math.floor(i.min.y/t.bucketHeight),a=Math.floor(i.max.y/t.bucketHeight);return s._createRegion(n,r,o,a)},s._createRegion=function(t,e,i,s){return{id:t+","+e+","+i+","+s,startCol:t,endCol:e,startRow:i,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,i){for(var s=0;s0?s.push(i):delete t.pairs[e[n]];return s}},70584:t=>{var e={};t.exports=e,e.create=function(t,i){var s=t.bodyA,n=t.bodyB,r={id:e.id(s,n),bodyA:s,bodyB:n,activeContacts:[],separation:0,isActive:!0,confirmedActive:!0,isSensor:s.isSensor||n.isSensor,timeCreated:i,timeUpdated:i,collision:null,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return e.update(r,t,i),r},e.update=function(t,i,s){if(t.collision=i,i.collided){var n=i.supports,r=t.activeContacts,o=i.parentA,a=i.parentB;t.inverseMass=o.inverseMass+a.inverseMass,t.friction=Math.min(o.friction,a.friction),t.frictionStatic=Math.max(o.frictionStatic,a.frictionStatic),t.restitution=Math.max(o.restitution,a.restitution),t.slop=Math.max(o.slop,a.slop);for(var h=0;h{var s={};t.exports=s;var n=i(70584),r=i(68758);s._pairMaxIdleLife=1e3,s.create=function(t){return r.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},t)},s.update=function(t,e,i){var s,r,o,a,h=t.list,l=t.table,u=t.collisionStart,c=t.collisionEnd,d=t.collisionActive;for(u.length=0,c.length=0,d.length=0,a=0;as._pairMaxIdleLife&&l.push(o);for(o=0;o{var s={};t.exports=s;var n=i(10438),r=i(5756),o=i(84091),a=i(68516),h=i(39745);s.collides=function(t,e){for(var i=[],s=0;s{var s={};t.exports=s;var n=i(39745),r=i(10438),o=i(68758),a=i(84091);s._restingThresh=4,s._restingThreshTangent=6,s._positionDampen=.9,s._positionWarming=.8,s._frictionNormalMultiplier=5,s.preSolvePosition=function(t){var e,i,s;for(e=0;ep.friction*p.frictionStatic*D*i&&(I=O,k=o.clamp(p.friction*L*i,-I,I));var B=r.cross(S,m),N=r.cross(A,m),Y=T/(v.inverseMass+g.inverseMass+v.inverseInertia*B*B+g.inverseInertia*N*N);if(F*=Y,k*=Y,R<0&&R*R>s._restingThresh*i)b.normalImpulse=0;else{var U=b.normalImpulse;b.normalImpulse=Math.min(b.normalImpulse+F,0),F=b.normalImpulse-U}if(P*P>s._restingThreshTangent*i)b.tangentImpulse=0;else{var X=b.tangentImpulse;b.tangentImpulse=o.clamp(b.tangentImpulse+k,-I,I),k=b.tangentImpulse-X}n.x=m.x*F+y.x*k,n.y=m.y*F+y.y*k,v.isStatic||v.isSleeping||(v.positionPrev.x+=n.x*v.inverseMass,v.positionPrev.y+=n.y*v.inverseMass,v.anglePrev+=r.cross(S,n)*v.inverseInertia),g.isStatic||g.isSleeping||(g.positionPrev.x-=n.x*g.inverseMass,g.positionPrev.y-=n.y*g.inverseMass,g.anglePrev-=r.cross(A,n)*g.inverseInertia)}}}}},5756:(t,e,i)=>{var s={};t.exports=s;var n=i(39745),r=i(10438);s.collides=function(t,e,i){var o,a,h,l,u=!1;if(i){var c=t.parent,d=e.parent,p=c.speed*c.speed+c.angularSpeed*c.angularSpeed+d.speed*d.speed+d.angularSpeed*d.angularSpeed;u=i&&i.collided&&p<.2,l=i}else l={collided:!1,bodyA:t,bodyB:e};if(i&&u){var f=l.axisBody,v=f===t?e:t,g=[f.axes[i.axisNumber]];if(h=s._overlapAxes(f.vertices,v.vertices,g),l.reused=!0,h.overlap<=0)return l.collided=!1,l}else{if((o=s._overlapAxes(t.vertices,e.vertices,t.axes)).overlap<=0)return l.collided=!1,l;if((a=s._overlapAxes(e.vertices,t.vertices,e.axes)).overlap<=0)return l.collided=!1,l;o.overlapn?n=a:a=0?o.index-1:u.length-1],l.x=n.x-c.x,l.y=n.y-c.y,h=-r.dot(i,l),a=n,n=u[(o.index+1)%u.length],l.x=n.x-c.x,l.y=n.y-c.y,(s=-r.dot(i,l)){var s={};t.exports=s;var n=i(39745),r=i(10438),o=i(22806),a=i(84091),h=i(50658),l=i(68758);s._warming=.4,s._torqueDampen=1,s._minLength=1e-6,s.create=function(t){var e=t;e.bodyA&&!e.pointA&&(e.pointA={x:0,y:0}),e.bodyB&&!e.pointB&&(e.pointB={x:0,y:0});var i=e.bodyA?r.add(e.bodyA.position,e.pointA):e.pointA,s=e.bodyB?r.add(e.bodyB.position,e.pointB):e.pointB,n=r.magnitude(r.sub(i,s));e.length=void 0!==e.length?e.length:n,e.id=e.id||l.nextId(),e.label=e.label||"Constraint",e.type="constraint",e.stiffness=e.stiffness||(e.length>0?1:.7),e.damping=e.damping||0,e.angularStiffness=e.angularStiffness||0,e.angleA=e.bodyA?e.bodyA.angle:e.angleA,e.angleB=e.bodyB?e.bodyB.angle:e.angleB,e.plugin={};var o={visible:!0,type:"line",anchors:!0,lineColor:null,lineOpacity:null,lineThickness:null,pinSize:null,anchorColor:null,anchorSize:null};return 0===e.length&&e.stiffness>.1?(o.type="pin",o.anchors=!1):e.stiffness<.9&&(o.type="spring"),e.render=l.extend(o,e.render),e},s.preSolveAll=function(t){for(var e=0;e0&&(c.position.x+=l.x,c.position.y+=l.y),0!==l.angle&&(n.rotate(c.vertices,l.angle,i.position),h.rotate(c.axes,l.angle),u>0&&r.rotateAbout(c.position,l.angle,i.position,c.position)),a.update(c.bounds,c.vertices,i.velocity)}l.angle*=s._warming,l.x*=s._warming,l.y*=s._warming}}},s.pointAWorld=function(t){return{x:(t.bodyA?t.bodyA.position.x:0)+t.pointA.x,y:(t.bodyA?t.bodyA.position.y:0)+t.pointA.y}},s.pointBWorld=function(t){return{x:(t.bodyB?t.bodyB.position.x:0)+t.pointB.x,y:(t.bodyB?t.bodyB.position.y:0)+t.pointB.y}}},68758:t=>{var e={};t.exports=e,function(){e._nextId=0,e._seed=0,e._nowStartTime=+new Date,e.extend=function(t,i){var s,n;"boolean"==typeof i?(s=2,n=i):(s=1,n=!0);for(var r=s;r0;i--){var s=Math.floor(e.random()*(i+1)),n=t[i];t[i]=t[s],t[s]=n}return t},e.choose=function(t){return t[Math.floor(e.random()*t.length)]},e.isElement=function(t){return"undefined"!=typeof HTMLElement?t instanceof HTMLElement:!!(t&&t.nodeType&&t.nodeName)},e.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},e.isFunction=function(t){return"function"==typeof t},e.isPlainObject=function(t){return"object"==typeof t&&t.constructor===Object},e.isString=function(t){return"[object String]"===Object.prototype.toString.call(t)},e.clamp=function(t,e,i){return ti?i:t},e.sign=function(t){return t<0?-1:1},e.now=function(){if("undefined"!=typeof window&&window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return new Date-e._nowStartTime},e.random=function(e,i){return i=void 0!==i?i:1,(e=void 0!==e?e:0)+t()*(i-e)};var t=function(){return e._seed=(9301*e._seed+49297)%233280,e._seed/233280};e.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)},e.logLevel=1,e.log=function(){console&&e.logLevel>0&&e.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},e.info=function(){console&&e.logLevel>0&&e.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},e.warn=function(){console&&e.logLevel>0&&e.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},e.nextId=function(){return e._nextId++},e.indexOf=function(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0;i{var s={};t.exports=s;var n=i(72005),r=i(22806),o=i(44272),a=i(91327),h=i(86330),l=i(15489),u=i(39073),c=i(11299),d=i(52838),p=i(68758),f=i(84125);s.create=function(t,e){e=(e=p.isElement(t)?e:t)||{},((t=p.isElement(t)?t:null)||e.render)&&p.warn("Engine.create: engine.render is deprecated (see docs)");var i={positionIterations:6,velocityIterations:4,constraintIterations:2,enableSleeping:!1,events:[],plugin:{},timing:{timestamp:0,timeScale:1},broadphase:{controller:l}},s=p.extend(i,e);return s.world=e.world||n.create(s.world),s.pairs=a.create(),s.broadphase=s.broadphase.controller.create(s.broadphase),s.metrics=s.metrics||{extended:!1},s.metrics=h.create(s.metrics),s},s.update=function(t,e,i){e=e||1e3/60,i=i||1;var n,l=t.world,p=t.timing,f=t.broadphase,v=[];p.timestamp+=e*p.timeScale;var g={timestamp:p.timestamp};u.trigger(t,"beforeUpdate",g);var m=c.allBodies(l),y=c.allConstraints(l);for(h.reset(t.metrics),t.enableSleeping&&r.update(m,p.timeScale),s._bodiesApplyGravity(m,l.gravity),s._bodiesUpdate(m,e,p.timeScale,i,l.bounds),d.preSolveAll(m),n=0;n0&&u.trigger(t,"collisionStart",{pairs:T.collisionStart}),o.preSolvePosition(T.list),n=0;n0&&u.trigger(t,"collisionActive",{pairs:T.collisionActive}),T.collisionEnd.length>0&&u.trigger(t,"collisionEnd",{pairs:T.collisionEnd}),h.update(t.metrics,t),s._bodiesClearForces(m),u.trigger(t,"afterUpdate",g),t},s.merge=function(t,e){if(p.extend(t,e),e.world){t.world=e.world,s.clear(t);for(var i=c.allBodies(t.world),n=0;n{var s={};t.exports=s;var n=i(68758);s.on=function(t,e,i){for(var s,n=e.split(" "),r=0;r0){i||(i={}),s=e.split(" ");for(var l=0;l{var s={};t.exports=s;var n=i(84474),r=i(68758);s.name="matter-js",s.version="0.14.2",s.uses=[],s.used=[],s.use=function(){n.use(s,Array.prototype.slice.call(arguments))},s.before=function(t,e){return t=t.replace(/^Matter./,""),r.chainPathBefore(s,t,e)},s.after=function(t,e){return t=t.replace(/^Matter./,""),r.chainPathAfter(s,t,e)}},86330:(t,e,i)=>{var s={};t.exports=s;var n=i(11299),r=i(68758);s.create=function(t){return r.extend({extended:!1,narrowDetections:0,narrowphaseTests:0,narrowReuse:0,narrowReuseCount:0,midphaseTests:0,broadphaseTests:0,narrowEff:1e-4,midEff:1e-4,broadEff:1e-4,collisions:0,buckets:0,bodies:0,pairs:0},!1,t)},s.reset=function(t){t.extended&&(t.narrowDetections=0,t.narrowphaseTests=0,t.narrowReuse=0,t.narrowReuseCount=0,t.midphaseTests=0,t.broadphaseTests=0,t.narrowEff=0,t.midEff=0,t.broadEff=0,t.collisions=0,t.buckets=0,t.pairs=0,t.bodies=0)},s.update=function(t,e){if(t.extended){var i=e.world,s=n.allBodies(i);t.collisions=t.narrowDetections,t.pairs=e.pairs.list.length,t.bodies=s.length,t.midEff=(t.narrowDetections/(t.midphaseTests||1)).toFixed(2),t.narrowEff=(t.narrowDetections/(t.narrowphaseTests||1)).toFixed(2),t.broadEff=(1-t.broadphaseTests/(s.length||1)).toFixed(2),t.narrowReuse=(t.narrowReuseCount/(t.narrowphaseTests||1)).toFixed(2)}}},84474:(t,e,i)=>{var s={};t.exports=s;var n=i(68758);s._registry={},s.register=function(t){if(s.isPlugin(t)||n.warn("Plugin.register:",s.toString(t),"does not implement all required fields."),t.name in s._registry){var e=s._registry[t.name],i=s.versionParse(t.version).number,r=s.versionParse(e.version).number;i>r?(n.warn("Plugin.register:",s.toString(e),"was upgraded to",s.toString(t)),s._registry[t.name]=t):i-1},s.isFor=function(t,e){var i=t.for&&s.dependencyParse(t.for);return!t.for||e.name===i.name&&s.versionSatisfies(e.version,i.range)},s.use=function(t,e){if(t.uses=(t.uses||[]).concat(e||[]),0!==t.uses.length){for(var i=s.dependencies(t),r=n.topologicalSort(i),o=[],a=0;a0&&!h.silent&&n.info(o.join(" "))}else n.warn("Plugin.use:",s.toString(t),"does not specify any dependencies to install.")},s.dependencies=function(t,e){var i=s.dependencyParse(t),r=i.name;if(!(r in(e=e||{}))){t=s.resolve(t)||t,e[r]=n.map(t.uses||[],(function(e){s.isPlugin(e)&&s.register(e);var r=s.dependencyParse(e),o=s.resolve(e);return o&&!s.versionSatisfies(o.version,r.range)?(n.warn("Plugin.dependencies:",s.toString(o),"does not satisfy",s.toString(r),"used by",s.toString(i)+"."),o._warned=!0,t._warned=!0):o||(n.warn("Plugin.dependencies:",s.toString(e),"used by",s.toString(i),"could not be resolved."),t._warned=!0),r.name}));for(var o=0;o=n[2];if("^"===i.operator)return n[0]>0?o[0]===n[0]&&r.number>=i.number:n[1]>0?o[1]===n[1]&&o[2]>=n[2]:o[2]===n[2]}return t===e||"*"===t}},22806:(t,e,i)=>{var s={};t.exports=s;var n=i(39073);s._motionWakeThreshold=.18,s._motionSleepThreshold=.08,s._minBias=.9,s.update=function(t,e){for(var i=e*e*e,n=0;n0&&r.motion=r.sleepThreshold&&s.set(r,!0)):r.sleepCounter>0&&(r.sleepCounter-=1)}else s.set(r,!1)}},s.afterCollisions=function(t,e){for(var i=e*e*e,n=0;ns._motionWakeThreshold*i&&s.set(l,!1)}}}},s.set=function(t,e){var i=t.isSleeping;e?(t.isSleeping=!0,t.sleepCounter=t.sleepThreshold,t.positionImpulse.x=0,t.positionImpulse.y=0,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.anglePrev=t.angle,t.speed=0,t.angularSpeed=0,t.motion=0,i||n.trigger(t,"sleepStart")):(t.isSleeping=!1,t.sleepCounter=0,i&&n.trigger(t,"sleepEnd"))}},68516:(t,e,i)=>{var s={};t.exports=s;var n=i(39745),r=i(68758),o=i(84125),a=i(84091),h=i(10438),l=i(81084);s.rectangle=function(t,e,i,s,a){a=a||{};var h={label:"Rectangle Body",position:{x:t,y:e},vertices:n.fromPath("L 0 0 L "+i+" 0 L "+i+" "+s+" L 0 "+s)};if(a.chamfer){var l=a.chamfer;h.vertices=n.chamfer(h.vertices,l.radius,l.quality,l.qualityMin,l.qualityMax),delete a.chamfer}return o.create(r.extend({},h,a))},s.trapezoid=function(t,e,i,s,a,h){h=h||{};var l,u=i*(a*=.5),c=u+(1-2*a)*i,d=c+u;l=a<.5?"L 0 0 L "+u+" "+-s+" L "+c+" "+-s+" L "+d+" 0":"L 0 0 L "+c+" "+-s+" L "+d+" 0";var p={label:"Trapezoid Body",position:{x:t,y:e},vertices:n.fromPath(l)};if(h.chamfer){var f=h.chamfer;p.vertices=n.chamfer(p.vertices,f.radius,f.quality,f.qualityMin,f.qualityMax),delete h.chamfer}return o.create(r.extend({},p,h))},s.circle=function(t,e,i,n,o){n=n||{};var a={label:"Circle Body",circleRadius:i};o=o||25;var h=Math.ceil(Math.max(10,Math.min(o,i)));return h%2==1&&(h+=1),s.polygon(t,e,h,i,r.extend({},a,n))},s.polygon=function(t,e,i,a,h){if(h=h||{},i<3)return s.circle(t,e,a,h);for(var l=2*Math.PI/i,u="",c=.5*l,d=0;d0&&n.area(T)1?(d=o.create(r.extend({parts:p.slice(0)},a)),o.setPosition(d,{x:t,y:e}),d):p[0]},s.flagCoincidentParts=function(t,e){void 0===e&&(e=5);for(var i=0;i{var s={};t.exports=s;var n=i(11299),r=i(52838),o=i(68758),a=i(84125),h=i(68516);s.stack=function(t,e,i,s,r,o,h){for(var l,u=n.create({label:"Stack"}),c=t,d=e,p=0,f=0;fv&&(v=y),a.translate(m,{x:.5*x,y:.5*y}),c=m.bounds.max.x+r,n.addBody(u,m),l=m,p+=1}else c+=r}d+=v+o,c=t}return u},s.chain=function(t,e,i,s,a,h){for(var l=t.bodies,u=1;u0)for(l=0;l0&&(d=p[l-1+(h-1)*e],n.addConstraint(t,r.create(o.extend({bodyA:d,bodyB:c},a)))),s&&ld||o<(l=d-l)||o>i-1-l))return 1===c&&a.translate(u,{x:(o+(i%2==1?1:-1))*p,y:0}),h(t+(u?o*p:0)+o*r,s,o,l,u,c)}))},s.newtonsCradle=function(t,e,i,s,o){for(var a=n.create({label:"Newtons Cradle"}),l=0;l{var s={};t.exports=s;var n=i(10438),r=i(68758);s.fromVertices=function(t){for(var e={},i=0;i{var e={};t.exports=e,e.create=function(t){var i={min:{x:0,y:0},max:{x:0,y:0}};return t&&e.update(i,t),i},e.update=function(t,e,i){t.min.x=1/0,t.max.x=-1/0,t.min.y=1/0,t.max.y=-1/0;for(var s=0;st.max.x&&(t.max.x=n.x),n.xt.max.y&&(t.max.y=n.y),n.y0?t.max.x+=i.x:t.min.x+=i.x,i.y>0?t.max.y+=i.y:t.min.y+=i.y)},e.contains=function(t,e){return e.x>=t.min.x&&e.x<=t.max.x&&e.y>=t.min.y&&e.y<=t.max.y},e.overlaps=function(t,e){return t.min.x<=e.max.x&&t.max.x>=e.min.x&&t.max.y>=e.min.y&&t.min.y<=e.max.y},e.translate=function(t,e){t.min.x+=e.x,t.max.x+=e.x,t.min.y+=e.y,t.max.y+=e.y},e.shift=function(t,e){var i=t.max.x-t.min.x,s=t.max.y-t.min.y;t.min.x=e.x,t.max.x=e.x+i,t.min.y=e.y,t.max.y=e.y+s}},92765:(t,e,i)=>{var s={};t.exports=s;i(84091);var n=i(68758);s.pathToVertices=function(t,e){"undefined"==typeof window||"SVGPathSeg"in window||n.warn("Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.");var i,r,o,a,h,l,u,c,d,p,f,v=[],g=0,m=0,y=0;e=e||15;var x=function(t,e,i){var s=i%2==1&&i>1;if(!d||t!=d.x||e!=d.y){d&&s?(p=d.x,f=d.y):(p=0,f=0);var n={x:p+t,y:f+e};!s&&d||(d=n),v.push(n),m=p+t,y=f+e}},T=function(t){var e=t.pathSegTypeAsLetter.toUpperCase();if("Z"!==e){switch(e){case"M":case"L":case"T":case"C":case"S":case"Q":m=t.x,y=t.y;break;case"H":m=t.x;break;case"V":y=t.y}x(m,y,t.pathSegType)}};for(s._svgPathToAbsolute(t),o=t.getTotalLength(),l=[],i=0;i{var e={};t.exports=e,e.create=function(t,e){return{x:t||0,y:e||0}},e.clone=function(t){return{x:t.x,y:t.y}},e.magnitude=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},e.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},e.rotate=function(t,e,i){var s=Math.cos(e),n=Math.sin(e);i||(i={});var r=t.x*s-t.y*n;return i.y=t.x*n+t.y*s,i.x=r,i},e.rotateAbout=function(t,e,i,s){var n=Math.cos(e),r=Math.sin(e);s||(s={});var o=i.x+((t.x-i.x)*n-(t.y-i.y)*r);return s.y=i.y+((t.x-i.x)*r+(t.y-i.y)*n),s.x=o,s},e.normalise=function(t){var i=e.magnitude(t);return 0===i?{x:0,y:0}:{x:t.x/i,y:t.y/i}},e.dot=function(t,e){return t.x*e.x+t.y*e.y},e.cross=function(t,e){return t.x*e.y-t.y*e.x},e.cross3=function(t,e,i){return(e.x-t.x)*(i.y-t.y)-(e.y-t.y)*(i.x-t.x)},e.add=function(t,e,i){return i||(i={}),i.x=t.x+e.x,i.y=t.y+e.y,i},e.sub=function(t,e,i){return i||(i={}),i.x=t.x-e.x,i.y=t.y-e.y,i},e.mult=function(t,e){return{x:t.x*e,y:t.y*e}},e.div=function(t,e){return{x:t.x/e,y:t.y/e}},e.perp=function(t,e){return{x:(e=!0===e?-1:1)*-t.y,y:e*t.x}},e.neg=function(t){return{x:-t.x,y:-t.y}},e.angle=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)},e._temp=[e.create(),e.create(),e.create(),e.create(),e.create(),e.create()]},39745:(t,e,i)=>{var s={};t.exports=s;var n=i(10438),r=i(68758);s.create=function(t,e){for(var i=[],s=0;s0)return!1}return!0},s.scale=function(t,e,i,r){if(1===e&&1===i)return t;var o,a;r=r||s.centre(t);for(var h=0;h=0?h-1:t.length-1],u=t[h],c=t[(h+1)%t.length],d=e[h0&&(r|=2),3===r)return!1;return 0!==r||null},s.hull=function(t){var e,i,s=[],r=[];for((t=t.slice(0)).sort((function(t,e){var i=t.x-e.x;return 0!==i?i:t.y-e.y})),i=0;i=2&&n.cross3(r[r.length-2],r[r.length-1],e)<=0;)r.pop();r.push(e)}for(i=t.length-1;i>=0;i-=1){for(e=t[i];s.length>=2&&n.cross3(s[s.length-2],s[s.length-1],e)<=0;)s.pop();s.push(e)}return s.pop(),r.pop(),s.concat(r)}},1675:(t,e,i)=>{var s=i(18171),n={name:"matter-attractors",version:"0.1.7",for:"matter-js@^0.14.2",silent:!0,install:function(t){t.after("Body.create",(function(){n.Body.init(this)})),t.before("Engine.update",(function(t){n.Engine.update(t)}))},Body:{init:function(t){t.plugin.attractors=t.plugin.attractors||[]}},Engine:{update:function(t){for(var e=s.Composite.allBodies(t.world),i=0;i0)for(var o=0;o{t.exports={name:"matter-collision-events",version:"0.1.6",for:"matter-js@^0.14.2",silent:!0,install:function(t){t.after("Engine.create",(function(){t.Events.on(this,"collisionStart",(function(e){e.pairs.map((function(e){var i=e.bodyA,s=e.bodyB;i.gameObject&&i.gameObject.emit("collide",i,s,e),s.gameObject&&s.gameObject.emit("collide",s,i,e),t.Events.trigger(i,"onCollide",{pair:e}),t.Events.trigger(s,"onCollide",{pair:e}),i.onCollideCallback&&i.onCollideCallback(e),s.onCollideCallback&&s.onCollideCallback(e),i.onCollideWith[s.id]&&i.onCollideWith[s.id](s,e),s.onCollideWith[i.id]&&s.onCollideWith[i.id](i,e)}))})),t.Events.on(this,"collisionActive",(function(e){e.pairs.map((function(e){var i=e.bodyA,s=e.bodyB;i.gameObject&&i.gameObject.emit("collideActive",i,s,e),s.gameObject&&s.gameObject.emit("collideActive",s,i,e),t.Events.trigger(i,"onCollideActive",{pair:e}),t.Events.trigger(s,"onCollideActive",{pair:e}),i.onCollideActiveCallback&&i.onCollideActiveCallback(e),s.onCollideActiveCallback&&s.onCollideActiveCallback(e)}))})),t.Events.on(this,"collisionEnd",(function(e){e.pairs.map((function(e){var i=e.bodyA,s=e.bodyB;i.gameObject&&i.gameObject.emit("collideEnd",i,s,e),s.gameObject&&s.gameObject.emit("collideEnd",s,i,e),t.Events.trigger(i,"onCollideEnd",{pair:e}),t.Events.trigger(s,"onCollideEnd",{pair:e}),i.onCollideEndCallback&&i.onCollideEndCallback(e),s.onCollideEndCallback&&s.onCollideEndCallback(e)}))}))}))}}},44097:(t,e,i)=>{var s=i(18171),n={name:"matter-wrap",version:"0.1.4",for:"matter-js@^0.14.2",silent:!0,install:function(t){t.after("Engine.update",(function(){n.Engine.update(this)}))},Engine:{update:function(t){for(var e=t.world,i=s.Composite.allBodies(e),r=s.Composite.allComposites(e),o=0;oe.max.x?i=e.min.x-t.max.x:t.max.xe.max.y?s=e.min.y-t.max.y:t.max.y{function e(t,e,i){i=i||0;var s,n,r,o,a,h,l,u=[0,0];return s=t[1][1]-t[0][1],n=t[0][0]-t[1][0],r=s*t[0][0]+n*t[0][1],o=e[1][1]-e[0][1],a=e[0][0]-e[1][0],h=o*e[0][0]+a*e[0][1],E(l=s*a-o*n,0,i)||(u[0]=(a*r-n*h)/l,u[1]=(s*h-o*r)/l),u}function i(t,e,i,s){var n=e[0]-t[0],r=e[1]-t[1],o=s[0]-i[0],a=s[1]-i[1];if(o*r-a*n==0)return!1;var h=(n*(i[1]-t[1])+r*(t[0]-i[0]))/(o*r-a*n),l=(o*(t[1]-i[1])+a*(i[0]-t[0]))/(a*n-o*r);return h>=0&&h<=1&&l>=0&&l<=1}function s(t,e,i){return(e[0]-t[0])*(i[1]-t[1])-(i[0]-t[0])*(e[1]-t[1])}function n(t,e,i){return s(t,e,i)>0}function r(t,e,i){return s(t,e,i)>=0}function o(t,e,i){return s(t,e,i)<0}function a(t,e,i){return s(t,e,i)<=0}t.exports={decomp:function(t){var e=T(t);return e.length>0?w(t,e):[t]},quickDecomp:function t(e,i,s,h,l,u,v){u=u||100,v=v||0,l=l||25,i=void 0!==i?i:[],s=s||[],h=h||[];var g=[0,0],m=[0,0],x=[0,0],T=0,w=0,E=0,S=0,A=0,_=0,C=0,M=[],R=[],P=e,O=e;if(O.length<3)return i;if(++v>u)return console.warn("quickDecomp: max level ("+u+") reached."),i;for(var L=0;LA&&(A+=e.length),S=Number.MAX_VALUE,A<_)return i;for(F=_;F<=A;++F)r(d(P,L-1),d(P,L),d(P,F))&&a(d(P,L+1),d(P,L),d(P,F))&&(E=c(d(P,L),d(P,F)))3&&s>=0;--s)u(d(t,s-1),d(t,s),d(t,s+1),e)&&(t.splice(s%t.length,1),i++);return i},removeDuplicatePoints:function(t,e){for(var i=t.length-1;i>=1;--i)for(var s=t[i],n=i-1;n>=0;--n)S(s,t[n],e)&&t.splice(i,1)},makeCCW:function(t){for(var e=0,i=t,s=1;si[e][0])&&(e=s);return!n(d(t,e-1),d(t,e),d(t,e+1))&&(function(t){for(var e=[],i=t.length,s=0;s!==i;s++)e.push(t.pop());for(s=0;s!==i;s++)t[s]=e[s]}(t),!0)}};var h=[],l=[];function u(t,e,i,n){if(n){var r=h,o=l;r[0]=e[0]-t[0],r[1]=e[1]-t[1],o[0]=i[0]-e[0],o[1]=i[1]-e[1];var a=r[0]*o[0]+r[1]*o[1],u=Math.sqrt(r[0]*r[0]+r[1]*r[1]),c=Math.sqrt(o[0]*o[0]+o[1]*o[1]);return Math.acos(a/(u*c)){var s=new(i(56694))({initialize:function(t){this.pluginManager=t,this.game=t.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=s},18360:t=>{t.exports={Global:["game","anims","cache","plugins","registry","scale","sound","textures","renderer"],CoreScene:["EventEmitter","CameraManager","GameObjectCreator","GameObjectFactory","ScenePlugin","DisplayList","UpdateList"],DefaultScene:["Clock","DataManagerPlugin","InputPlugin","Loader","TweenManager","LightsPlugin"]}},91963:t=>{var e={},i={},s={register:function(t,i,s,n){void 0===n&&(n=!1),e[t]={plugin:i,mapping:s,custom:n}},registerCustom:function(t,e,s,n){i[t]={plugin:e,mapping:s,data:n}},hasCore:function(t){return e.hasOwnProperty(t)},hasCustom:function(t){return i.hasOwnProperty(t)},getCore:function(t){return e[t]},getCustom:function(t){return i[t]},getCustomClass:function(t){return i.hasOwnProperty(t)?i[t].plugin:null},remove:function(t){e.hasOwnProperty(t)&&delete e[t]},removeCustom:function(t){i.hasOwnProperty(t)&&delete i[t]},destroyCorePlugins:function(){for(var t in e)e.hasOwnProperty(t)&&delete e[t]},destroyCustomPlugins:function(){for(var t in i)i.hasOwnProperty(t)&&delete i[t]}};t.exports=s},49274:(t,e,i)=>{var s=i(56694),n=i(97081),r=i(6659),o=i(76846),a=i(99325),h=i(61286),l=i(72632),u=i(91963),c=i(66458),d=new s({Extends:r,initialize:function(t){r.call(this),this.game=t,this.plugins=[],this.scenePlugins=[],this._pendingGlobal=[],this._pendingScene=[],t.isBooted?this.boot():t.events.once(n.BOOT,this.boot,this)},boot:function(){var t,e,i,s,r,o,a,h=this.game.config,u=h.installGlobalPlugins;for(u=u.concat(this._pendingGlobal),t=0;t{var s=i(88257),n=i(56694),r=i(7599),o=new n({Extends:s,initialize:function(t,e,i){s.call(this,e),this.scene=t,this.systems=t.sys,this.pluginKey=i,t.sys.events.once(r.BOOT,this.boot,this)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=o},45615:(t,e,i)=>{t.exports={BasePlugin:i(88257),DefaultPlugins:i(18360),PluginCache:i(91963),PluginManager:i(49274),ScenePlugin:i(39283)}},37823:()=>{Array.prototype.forEach||(Array.prototype.forEach=function(t){"use strict";if(null==this)throw new TypeError;var e=Object(this),i=e.length>>>0;if("function"!=typeof t)throw new TypeError;for(var s=arguments.length>=2?arguments[1]:void 0,n=0;n{Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)})},22782:()=>{!function(){function t(t){t&&(t.setTargetAtTime||(t.setTargetAtTime=t.setTargetValueAtTime))}window.hasOwnProperty("webkitAudioContext")&&!window.hasOwnProperty("AudioContext")&&(window.AudioContext=webkitAudioContext,AudioContext.prototype.hasOwnProperty("createGain")||(AudioContext.prototype.createGain=AudioContext.prototype.createGainNode),AudioContext.prototype.hasOwnProperty("createDelay")||(AudioContext.prototype.createDelay=AudioContext.prototype.createDelayNode),AudioContext.prototype.hasOwnProperty("createScriptProcessor")||(AudioContext.prototype.createScriptProcessor=AudioContext.prototype.createJavaScriptNode),AudioContext.prototype.hasOwnProperty("createPeriodicWave")||(AudioContext.prototype.createPeriodicWave=AudioContext.prototype.createWaveTable),AudioContext.prototype.internal_createGain=AudioContext.prototype.createGain,AudioContext.prototype.createGain=function(){var e=this.internal_createGain();return t(e.gain),e},AudioContext.prototype.internal_createDelay=AudioContext.prototype.createDelay,AudioContext.prototype.createDelay=function(e){var i=e?this.internal_createDelay(e):this.internal_createDelay();return t(i.delayTime),i},AudioContext.prototype.internal_createBufferSource=AudioContext.prototype.createBufferSource,AudioContext.prototype.createBufferSource=function(){var e=this.internal_createBufferSource();return e.start?(e.internal_start=e.start,e.start=function(t,i,s){void 0!==s?e.internal_start(t||0,i,s):e.internal_start(t||0,i||0)}):e.start=function(t,e,i){e||i?this.noteGrainOn(t||0,e,i):this.noteOn(t||0)},e.stop?(e.internal_stop=e.stop,e.stop=function(t){e.internal_stop(t||0)}):e.stop=function(t){this.noteOff(t||0)},t(e.playbackRate),e},AudioContext.prototype.internal_createDynamicsCompressor=AudioContext.prototype.createDynamicsCompressor,AudioContext.prototype.createDynamicsCompressor=function(){var e=this.internal_createDynamicsCompressor();return t(e.threshold),t(e.knee),t(e.ratio),t(e.reduction),t(e.attack),t(e.release),e},AudioContext.prototype.internal_createBiquadFilter=AudioContext.prototype.createBiquadFilter,AudioContext.prototype.createBiquadFilter=function(){var e=this.internal_createBiquadFilter();return t(e.frequency),t(e.detune),t(e.Q),t(e.gain),e},AudioContext.prototype.hasOwnProperty("createOscillator")&&(AudioContext.prototype.internal_createOscillator=AudioContext.prototype.createOscillator,AudioContext.prototype.createOscillator=function(){var e=this.internal_createOscillator();return e.start?(e.internal_start=e.start,e.start=function(t){e.internal_start(t||0)}):e.start=function(t){this.noteOn(t||0)},e.stop?(e.internal_stop=e.stop,e.stop=function(t){e.internal_stop(t||0)}):e.stop=function(t){this.noteOff(t||0)},e.setPeriodicWave||(e.setPeriodicWave=e.setWaveTable),t(e.frequency),t(e.detune),e})),window.hasOwnProperty("webkitOfflineAudioContext")&&!window.hasOwnProperty("OfflineAudioContext")&&(window.OfflineAudioContext=webkitOfflineAudioContext)}()},58909:()=>{Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)})},52273:()=>{if("function"!=typeof window.Uint32Array&&"object"!=typeof window.Uint32Array){var t=function(t){var e=new Array;window[t]=function(t){if("number"==typeof t){Array.call(this,t),this.length=t;for(var e=0;e{window.console||(window.console={},window.console.log=window.console.assert=function(){},window.console.warn=window.console.assert=function(){})},92244:(t,e,i)=>{i(37823),i(60680),i(22782),i(77844),i(58909),i(52108),i(77359),i(52273)},52108:()=>{!function(){if("performance"in window==!1&&(window.performance={}),Date.now=Date.now||function(){return(new Date).getTime()},"now"in window.performance==!1){var t=Date.now();performance.timing&&performance.timing.navigationStart&&(t=performance.timing.navigationStart),window.performance.now=function(){return Date.now()-t}}}()},77359:()=>{for(var t=Date.now(),e=["ms","moz","webkit","o"],i=0;i{t.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,ERASE:17,SOURCE_IN:18,SOURCE_OUT:19,SOURCE_ATOP:20,DESTINATION_OVER:21,DESTINATION_IN:22,DESTINATION_OUT:23,DESTINATION_ATOP:24,LIGHTER:25,COPY:26,XOR:27}},27394:t=>{t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},91135:(t,e,i)=>{var s=i(89787),n=i(61840),r=i(56694),o=i(86459),a=i(6659),h=i(81044),l=i(32834),u=i(40444),c=i(38203),d=i(69360),p=new r({Extends:a,initialize:function(t){a.call(this);var e=t.config;this.config={clearBeforeRender:e.clearBeforeRender,backgroundColor:e.backgroundColor,antialias:e.antialias,roundPixels:e.roundPixels},this.game=t,this.type=o.CANVAS,this.drawCount=0,this.width=0,this.height=0,this.gameCanvas=t.canvas;var i={alpha:t.config.transparent,desynchronized:t.config.desynchronized};this.gameContext=e.context?e.context:this.gameCanvas.getContext("2d",i),this.currentContext=this.gameContext,this.antialias=t.config.antialias,this.blendModes=l(),this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this._tempMatrix1=new d,this._tempMatrix2=new d,this._tempMatrix3=new d,this.isBooted=!1,this.init()},init:function(){this.game.textures.once(c.READY,this.boot,this)},boot:function(){var t=this.game,e=t.scale.baseSize;this.width=e.width,this.height=e.height,this.isBooted=!0,t.scale.on(u.RESIZE,this.onResize,this),this.resize(e.width,e.height)},onResize:function(t,e){e.width===this.width&&e.height===this.height||this.resize(e.width,e.height)},resize:function(t,e){this.width=t,this.height=e,this.emit(h.RESIZE,t,e)},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(t){return this.currentContext.globalCompositeOperation=t,this},setContext:function(t){return this.currentContext=t||this.gameContext,this},setAlpha:function(t){return this.currentContext.globalAlpha=t,this},preRender:function(){var t=this.gameContext,e=this.config,i=this.width,s=this.height;t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),e.clearBeforeRender&&(t.clearRect(0,0,i,s),e.transparent||(t.fillStyle=e.backgroundColor.rgba,t.fillRect(0,0,i,s))),t.save(),this.drawCount=0,this.emit(h.PRE_RENDER)},render:function(t,e,i){var n=e.length;this.emit(h.RENDER,t,i);var r=i.x,o=i.y,a=i.width,l=i.height,u=i.renderToTexture?i.context:t.sys.context;u.save(),this.game.scene.customViewports&&(u.beginPath(),u.rect(r,o,a,l),u.clip()),i.emit(s.PRE_RENDER,i),this.currentContext=u;var c=i.mask;c&&c.preRenderCanvas(this,null,i._maskCamera),i.transparent||(u.fillStyle=i.backgroundColor.rgba,u.fillRect(r,o,a,l)),u.globalAlpha=i.alpha,u.globalCompositeOperation="source-over",this.drawCount+=n,i.renderToTexture&&i.emit(s.PRE_RENDER,i),i.matrix.copyToContext(u);for(var d=0;d=0?m=-(m+c):m<0&&(m=Math.abs(m)-c)),t.flipY&&(y>=0?y=-(y+d):y<0&&(y=Math.abs(y)-d))}var T=1,w=1;t.flipX&&(p||(m+=-e.realWidth+2*v),T=-1),t.flipY&&(p||(y+=-e.realHeight+2*g),w=-1),a.applyITRS(t.x,t.y,t.rotation,t.scaleX*T,t.scaleY*w),o.copyFrom(i.matrix),s?(o.multiplyWithOffset(s,-i.scrollX*t.scrollFactorX,-i.scrollY*t.scrollFactorY),a.e=t.x,a.f=t.y):(a.e-=i.scrollX*t.scrollFactorX,a.f-=i.scrollY*t.scrollFactorY),o.multiply(a),i.roundPixels&&(o.e=Math.round(o.e),o.f=Math.round(o.f)),r.save(),o.setToContext(r),r.globalCompositeOperation=this.blendModes[t.blendMode],r.globalAlpha=n,r.imageSmoothingEnabled=!(!this.antialias||e.source.scaleMode),t.mask&&t.mask.preRenderCanvas(this,t,i),r.drawImage(e.source.image,l,u,c,d,m,y,c/f,d/f),t.mask&&t.mask.postRenderCanvas(this,t,i),r.restore()}},destroy:function(){this.removeAllListeners(),this.game=null,this.gameCanvas=null,this.gameContext=null}});t.exports=p},6046:(t,e,i)=>{t.exports={CanvasRenderer:i(91135),GetBlendModes:i(32834),SetTransform:i(49584)}},32834:(t,e,i)=>{var s=i(95723),n=i(98581);t.exports=function(){var t=[],e=n.supportNewBlendModes,i="source-over";return t[s.NORMAL]=i,t[s.ADD]="lighter",t[s.MULTIPLY]=e?"multiply":i,t[s.SCREEN]=e?"screen":i,t[s.OVERLAY]=e?"overlay":i,t[s.DARKEN]=e?"darken":i,t[s.LIGHTEN]=e?"lighten":i,t[s.COLOR_DODGE]=e?"color-dodge":i,t[s.COLOR_BURN]=e?"color-burn":i,t[s.HARD_LIGHT]=e?"hard-light":i,t[s.SOFT_LIGHT]=e?"soft-light":i,t[s.DIFFERENCE]=e?"difference":i,t[s.EXCLUSION]=e?"exclusion":i,t[s.HUE]=e?"hue":i,t[s.SATURATION]=e?"saturation":i,t[s.COLOR]=e?"color":i,t[s.LUMINOSITY]=e?"luminosity":i,t[s.ERASE]="destination-out",t[s.SOURCE_IN]="source-in",t[s.SOURCE_OUT]="source-out",t[s.SOURCE_ATOP]="source-atop",t[s.DESTINATION_OVER]="destination-over",t[s.DESTINATION_IN]="destination-in",t[s.DESTINATION_OUT]="destination-out",t[s.DESTINATION_ATOP]="destination-atop",t[s.LIGHTER]="lighter",t[s.COPY]="copy",t[s.XOR]="xor",t}},49584:(t,e,i)=>{var s=i(73329);t.exports=function(t,e,i,n,r){var o=n.alpha*i.alpha;if(o<=0)return!1;var a=s(i,n,r).calc;return e.globalCompositeOperation=t.blendModes[i.blendMode],e.globalAlpha=o,e.save(),a.setToContext(e),e.imageSmoothingEnabled=!(!t.antialias||i.frame&&i.frame.source.scaleMode),!0}},70936:t=>{t.exports="postrender"},99298:t=>{t.exports="prerender"},7743:t=>{t.exports="render"},99519:t=>{t.exports="resize"},81044:(t,e,i)=>{t.exports={POST_RENDER:i(70936),PRE_RENDER:i(99298),RENDER:i(7743),RESIZE:i(99519)}},42069:(t,e,i)=>{t.exports={Canvas:i(6046),Events:i(81044),Snapshot:i(95528),WebGL:i(55478)}},61840:(t,e,i)=>{var s=i(61068),n=i(27119),r=i(72632);t.exports=function(t,e){var i=r(e,"callback"),o=r(e,"type","image/png"),a=r(e,"encoder",.92),h=Math.abs(Math.round(r(e,"x",0))),l=Math.abs(Math.round(r(e,"y",0))),u=r(e,"width",t.width),c=r(e,"height",t.height);if(r(e,"getPixel",!1)){var d=t.getContext("2d").getImageData(h,l,1,1).data;i.call(null,new n(d[0],d[1],d[2],d[3]/255))}else if(0!==h||0!==l||u!==t.width||c!==t.height){var p=s.createWebGL(this,u,c);p.getContext("2d").drawImage(t,h,l,u,c,0,0,u,c);var f=new Image;f.onerror=function(){i.call(null),s.remove(p)},f.onload=function(){i.call(null,f),s.remove(p)},f.src=p.toDataURL(o,a)}else{var v=new Image;v.onerror=function(){i.call(null)},v.onload=function(){i.call(null,v)},v.src=t.toDataURL(o,a)}}},1217:(t,e,i)=>{var s=i(61068),n=i(27119),r=i(72632);t.exports=function(t,e){var i=t.getContext("experimental-webgl"),o=r(e,"callback"),a=r(e,"type","image/png"),h=r(e,"encoder",.92),l=r(e,"x",0),u=r(e,"y",0),c=r(e,"getPixel",!1),d=r(e,"isFramebuffer",!1),p=d?r(e,"bufferWidth",1):i.drawingBufferWidth,f=d?r(e,"bufferHeight",1):i.drawingBufferHeight;if(c){var v=new Uint8Array(4),g=d?u:f-u;i.readPixels(l,g,1,1,i.RGBA,i.UNSIGNED_BYTE,v),o.call(null,new n(v[0],v[1],v[2],v[3]/255))}else{var m=r(e,"width",p),y=r(e,"height",f),x=new Uint8Array(m*y*4);i.readPixels(l,f-u-y,m,y,i.RGBA,i.UNSIGNED_BYTE,x);for(var T=s.createWebGL(this,m,y),w=T.getContext("2d"),b=w.getImageData(0,0,m,y),E=b.data,S=0;S{t.exports={Canvas:i(61840),WebGL:i(1217)}},35217:(t,e,i)=>{var s=i(56694),n=i(65641),r=i(33885),o=i(72632),a=i(37410),h=i(82127),l=i(5583),u=i(67589),c=i(66901),d=i(77310),p=i(10919),f=i(21213),v=i(51212),g=i(60848),m=new s({initialize:function(t){this.game=t.game,this.renderer=t,this.classes=new r([[n.UTILITY_PIPELINE,g],[n.MULTI_PIPELINE,d],[n.BITMAPMASK_PIPELINE,l],[n.SINGLE_PIPELINE,v],[n.ROPE_PIPELINE,f],[n.LIGHT_PIPELINE,c],[n.POINTLIGHT_PIPELINE,p],[n.GRAPHICS_PIPELINE,u]]),this.postPipelineClasses=new r,this.pipelines=new r,this.current=null,this.previous=null,this.MULTI_PIPELINE=null,this.BITMAPMASK_PIPELINE=null,this.UTILITY_PIPELINE=null,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2,this.renderTargets=[],this.maxDimension=0,this.frameInc=32,this.targetIndex=0},boot:function(t){var e=this.renderer,i=this.renderTargets;this.frameInc=Math.floor(o(t,"frameInc",32));for(var s,r,h=e.width,l=e.height,u=Math.min(h,l),c=Math.ceil(u/this.frameInc),d=1;d=0;i--){var s=e[i];s.active&&s.preBatch(t)}}},postBatch:function(t){if(t.hasPostPipeline){this.flush();for(var e=t.postPipelines,i=0;i=0;i--){var s=e[i];s.active&&s.preBatch(t)}}},postBatchCamera:function(t){if(t.hasPostPipeline){this.flush();for(var e=t.postPipelines,i=0;ithis.maxDimension)return this.targetIndex=e.length-3,e[this.targetIndex];var i=3*(h(t,this.frameInc,0,!0)-1);return this.targetIndex=i,e[i]},getSwapRenderTarget:function(){return this.renderTargets[this.targetIndex+1]},getAltSwapRenderTarget:function(){return this.renderTargets[this.targetIndex+2]},destroy:function(){this.flush(),this.classes.clear(),this.postPipelineClasses.clear(),this.pipelines.clear(),this.renderer=null,this.game=null,this.classes=null,this.postPipelineClasses=null,this.pipelines=null,this.current=null,this.previous=null}});t.exports=m},37410:(t,e,i)=>{var s=i(56694),n=i(81044),r=new s({initialize:function(t,e,i,s,n,r,o){void 0===s&&(s=1),void 0===n&&(n=0),void 0===r&&(r=!0),void 0===o&&(o=!1),this.renderer=t,this.framebuffer=null,this.texture=null,this.width=0,this.height=0,this.scale=s,this.minFilter=n,this.autoClear=r,this.autoResize=!1,this.resize(e,i),o&&this.setAutoResize(!0)},setAutoResize:function(t){return t&&!this.autoResize?(this.renderer.on(n.RESIZE,this.resize,this),this.autoResize=!0):!t&&this.autoResize&&(this.renderer.off(n.RESIZE,this.resize,this),this.autoResize=!1),this},resize:function(t,e){var i=t*this.scale,s=e*this.scale;if(i!==this.width||s!==this.height){var n=this.renderer;n.deleteFramebuffer(this.framebuffer),n.deleteTexture(this.texture),t*=this.scale,e*=this.scale,(t=Math.round(t))<=0&&(t=1),(e=Math.round(e))<=0&&(e=1),this.texture=n.createTextureFromSource(null,t,e,this.minFilter,!0),this.framebuffer=n.createFramebuffer(t,e,this.texture,!1),this.width=t,this.height=e}return this},bind:function(t,e,i){if(void 0===t&&(t=!1),t&&this.renderer.flush(),e&&i&&this.resize(e,i),this.renderer.pushFramebuffer(this.framebuffer,!1,!1,!1),t&&this.adjustViewport(),this.autoClear){var s=this.renderer.gl;s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT)}},adjustViewport:function(){var t=this.renderer.gl;t.viewport(0,0,this.width,this.height),t.disable(t.SCISSOR_TEST)},clear:function(){var t=this.renderer,e=t.gl;t.pushFramebuffer(this.framebuffer),e.disable(e.SCISSOR_TEST),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),t.popFramebuffer(),t.resetScissor()},unbind:function(t){void 0===t&&(t=!1);var e=this.renderer;return t&&e.flush(),e.popFramebuffer()},destroy:function(){var t=this.renderer;t.deleteFramebuffer(this.framebuffer),t.deleteTexture(this.texture),t.off(n.RESIZE,this.resize,this),this.renderer=null,this.framebuffer=null,this.texture=null}});t.exports=r},75512:t=>{t.exports={getTintFromFloats:function(t,e,i,s){return((255&(255*s|0))<<24|(255&(255*t|0))<<16|(255&(255*e|0))<<8|255&(255*i|0))>>>0},getTintAppendFloatAlpha:function(t,e){return((255&(255*e|0))<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255&(255*e|0))<<24|(255&(0|t))<<16|(255&(t>>8|0))<<8|255&(t>>16|0))>>>0},getFloatsFromUintRGB:function(t){return[(255&(t>>16|0))/255,(255&(t>>8|0))/255,(255&(0|t))/255]},checkShaderMax:function(t,e){var i=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);return e&&-1!==e?Math.min(i,e):i},parseFragmentShaderMaxTextures:function(t,e){return t?t.replace(/%count%/gi,e.toString()):""}}},44775:(t,e,i)=>{var s=i(56694),n=i(28699),r=i(6659),o=i(18970),a=i(72632),h=i(16650),l=i(81044),u=i(37410),c=i(75512),d=i(71305),p=new s({Extends:r,initialize:function(t){r.call(this);var e=t.game,i=e.renderer,s=i.gl;this.name=a(t,"name","WebGLPipeline"),this.game=e,this.renderer=i,this.manager,this.gl=s,this.view=e.canvas,this.width=0,this.height=0,this.vertexCount=0,this.vertexCapacity=0,this.vertexData,this.vertexBuffer,this.topology=a(t,"topology",s.TRIANGLES),this.bytes,this.vertexViewF32,this.vertexViewU32,this.active=!0,this.currentUnit=0,this.forceZero=a(t,"forceZero",!1),this.hasBooted=!1,this.isPostFX=!1,this.isSpriteFX=!1,this.renderTargets=[],this.currentRenderTarget,this.shaders=[],this.currentShader,this.projectionMatrix,this.projectionWidth=0,this.projectionHeight=0,this.config=t,this.glReset=!1},boot:function(){var t,e=this.gl,i=this.config,s=this.renderer;this.isPostFX||(this.projectionMatrix=(new h).identity());var n=this.renderTargets,r=a(i,"renderTarget",!1);"boolean"==typeof r&&r&&(r=1);var c=s.width,d=s.height;if("number"==typeof r)for(t=0;tx&&(x=y[t].vertexSize);var T=a(i,"batchSize",s.config.batchSize);this.vertexCapacity=6*T;var w=new ArrayBuffer(this.vertexCapacity*x);this.vertexData=w,this.bytes=new Uint8Array(w),this.vertexViewF32=new Float32Array(w),this.vertexViewU32=new Uint32Array(w);var b=a(i,"vertices",null);for(b?(this.vertexViewF32.set(b),this.vertexBuffer=s.createVertexBuffer(w,e.STATIC_DRAW)):this.vertexBuffer=s.createVertexBuffer(w.byteLength,e.DYNAMIC_DRAW),this.setVertexBuffer(),t=y.length-1;t>=0;t--)y[t].rebind();this.hasBooted=!0,s.on(l.RESIZE,this.resize,this),s.on(l.PRE_RENDER,this.onPreRender,this),s.on(l.RENDER,this.onRender,this),s.on(l.POST_RENDER,this.onPostRender,this),this.emit(o.BOOT,this),this.onBoot()},onBoot:function(){},onResize:function(){},setShader:function(t,e,i){var s=this.renderer;t===this.currentShader&&s.currentProgram===this.currentShader.program||(this.flush(),s.resetTextures(),this.setVertexBuffer(i)&&!e&&(e=!0),t.bind(e,!1),this.currentShader=t);return this},getShaderByName:function(t){for(var e=this.shaders,i=0;ithis.vertexCapacity},resize:function(t,e){t===this.width&&e===this.height||this.flush(),this.width=t,this.height=e;for(var i=this.renderTargets,s=0;s=0;i--){var s=e[i].rebind();t&&s!==t||(this.currentShader=s)}return this.emit(o.REBIND,this.currentShader),this.onActive(this.currentShader),this.onRebind(),this.glReset=!1,this},setVertexBuffer:function(t){void 0===t&&(t=this.vertexBuffer);var e=this.gl;return e.getParameter(e.ARRAY_BUFFER_BINDING)!==t&&(e.bindBuffer(e.ARRAY_BUFFER,t),!0)},preBatch:function(t){return this.currentRenderTarget&&this.currentRenderTarget.bind(),this.onPreBatch(t),this},postBatch:function(t){return this.onDraw(this.currentRenderTarget),this.onPostBatch(t),this},onDraw:function(){},unbind:function(){this.currentRenderTarget&&this.currentRenderTarget.unbind()},flush:function(t){if(void 0===t&&(t=!1),this.vertexCount>0){this.emit(o.BEFORE_FLUSH,this,t),this.onBeforeFlush(t);var e=this.gl,i=this.vertexCount,s=this.currentShader.vertexSize;this.active&&(this.setVertexBuffer(),i===this.vertexCapacity?e.bufferData(e.ARRAY_BUFFER,this.vertexData,e.DYNAMIC_DRAW):e.bufferSubData(e.ARRAY_BUFFER,0,this.bytes.subarray(0,i*s)),e.drawArrays(this.topology,0,i)),this.vertexCount=0,this.emit(o.AFTER_FLUSH,this,t),this.onAfterFlush(t)}return this},onActive:function(){},onBind:function(){},onRebind:function(){},onBatch:function(){},onPreBatch:function(){},onPostBatch:function(){},onPreRender:function(){},onRender:function(){},onPostRender:function(){},onBeforeFlush:function(){},onAfterFlush:function(){},batchVert:function(t,e,i,s,n,r,o){var a=this.vertexViewF32,h=this.vertexViewU32,l=this.vertexCount*this.currentShader.vertexComponentCount-1;a[++l]=t,a[++l]=e,a[++l]=i,a[++l]=s,a[++l]=n,a[++l]=r,h[++l]=o,this.vertexCount++},batchQuad:function(t,e,i,s,n,r,o,a,h,l,u,c,d,p,f,v,g,m,y,x){void 0===x&&(x=this.currentUnit);var T=!1;return this.shouldFlush(6)&&(this.flush(),T=!0,x=this.setTexture2D(y)),this.batchVert(e,i,l,u,x,m,p),this.batchVert(s,n,l,d,x,m,v),this.batchVert(r,o,c,d,x,m,g),this.batchVert(e,i,l,u,x,m,p),this.batchVert(r,o,c,d,x,m,g),this.batchVert(a,h,c,u,x,m,f),this.onBatch(t),T},batchTri:function(t,e,i,s,n,r,o,a,h,l,u,c,d,p,f,v,g){void 0===g&&(g=this.currentUnit);var m=!1;return this.shouldFlush(3)&&(this.flush(),m=!0,g=this.setTexture2D(v)),this.batchVert(e,i,a,h,g,f,c),this.batchVert(s,n,a,u,g,f,d),this.batchVert(r,o,l,u,g,f,p),this.onBatch(t),m},drawFillRect:function(t,e,i,s,n,r,o,a){void 0===o&&(o=this.renderer.whiteTexture.glTexture),void 0===a&&(a=!0),t=Math.floor(t),e=Math.floor(e);var h=Math.floor(t+i),l=Math.floor(e+s),u=this.setTexture2D(o),d=c.getTintAppendFloatAlphaAndSwap(n,r),p=0,f=1;a&&(p=1,f=0),this.batchQuad(null,t,e,t,l,h,l,h,e,0,p,1,f,d,d,d,d,0,o,u)},setTexture2D:function(t){return void 0===t&&(t=this.renderer.whiteTexture.glTexture),this.currentUnit=this.renderer.setTexture2D(t),this.currentUnit},bindTexture:function(t,e){void 0===e&&(e=0);var i=this.gl;return i.activeTexture(i.TEXTURE0+e),i.bindTexture(i.TEXTURE_2D,t),this},bindRenderTarget:function(t,e){return this.bindTexture(t.texture,e)},setTime:function(t){return this.set1f(t,this.game.loop.getDuration()),this},set1f:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set1f(t,e),this},set2f:function(t,e,i,s){return void 0===s&&(s=this.currentShader),s.set2f(t,e,i),this},set3f:function(t,e,i,s,n){return void 0===n&&(n=this.currentShader),n.set3f(t,e,i,s),this},set4f:function(t,e,i,s,n,r){return void 0===r&&(r=this.currentShader),r.set4f(t,e,i,s,n),this},set1fv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set1fv(t,e),this},set2fv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set2fv(t,e),this},set3fv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set3fv(t,e),this},set4fv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set4fv(t,e),this},set1iv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set1iv(t,e),this},set2iv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set2iv(t,e),this},set3iv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set3iv(t,e),this},set4iv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set4iv(t,e),this},set1i:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set1i(t,e),this},set2i:function(t,e,i,s){return void 0===s&&(s=this.currentShader),s.set2i(t,e,i),this},set3i:function(t,e,i,s,n){return void 0===n&&(n=this.currentShader),n.set3i(t,e,i,s),this},set4i:function(t,e,i,s,n,r){return void 0===r&&(r=this.currentShader),r.set4i(t,e,i,s,n),this},setMatrix2fv:function(t,e,i,s){return void 0===s&&(s=this.currentShader),s.setMatrix2fv(t,e,i),this},setMatrix3fv:function(t,e,i,s){return void 0===s&&(s=this.currentShader),s.setMatrix3fv(t,e,i),this},setMatrix4fv:function(t,e,i,s){return void 0===s&&(s=this.currentShader),s.setMatrix4fv(t,e,i),this},destroy:function(){var t;this.emit(o.DESTROY,this);var e=this.shaders;for(t=0;t{var s=i(66458),n=i(89787),r=i(56694),o=i(86459),a=i(6659),h=i(81044),l=i(97081),u=i(28621),c=i(16650),d=i(72283),p=i(35217),f=i(37410),v=i(40444),g=i(38203),m=i(75512),y=i(1217),x=new r({Extends:a,initialize:function(t){a.call(this);var e=t.config,i={alpha:e.transparent,desynchronized:e.desynchronized,depth:!1,antialias:e.antialiasGL,premultipliedAlpha:e.premultipliedAlpha,stencil:!0,failIfMajorPerformanceCaveat:e.failIfMajorPerformanceCaveat,powerPreference:e.powerPreference,preserveDrawingBuffer:e.preserveDrawingBuffer};this.config={clearBeforeRender:e.clearBeforeRender,antialias:e.antialias,backgroundColor:e.backgroundColor,contextCreation:i,roundPixels:e.roundPixels,maxTextures:e.maxTextures,maxTextureSize:e.maxTextureSize,batchSize:e.batchSize,maxLights:e.maxLights,mipmapFilter:e.mipmapFilter},this.game=t,this.type=o.WEBGL,this.pipelines=null,this.width=0,this.height=0,this.canvas=t.canvas,this.blendModes=[],this.contextLost=!1,this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92,isFramebuffer:!1,bufferWidth:0,bufferHeight:0},this.currentActiveTexture=0,this.startActiveTexture=0,this.maxTextures=0,this.textureIndexes,this.tempTextures,this.textureZero,this.normalTexture,this.currentFramebuffer=null,this.fboStack=[],this.currentProgram=null,this.currentBlendMode=1/0,this.currentScissorEnabled=!1,this.currentScissor=null,this.scissorStack=[],this.contextLostHandler=d,this.contextRestoredHandler=d,this.gl=null,this.supportedExtensions=null,this.instancedArraysExtension=null,this.vaoExtension=null,this.extensions={},this.glFormats=[],this.compression,this.drawingBufferHeight=0,this.blankTexture=null,this.whiteTexture=null,this.maskCount=0,this.maskStack=[],this.currentMask={mask:null,camera:null},this.currentCameraMask={mask:null,camera:null},this.glFuncMap=null,this.currentType="",this.newType=!1,this.nextTypeMatch=!1,this.finalType=!1,this.mipmapFilter=null,this.textureFlush=0,this.isTextureClean=!1,this.defaultScissor=[0,0,0,0],this.isBooted=!1,this.renderTarget=null,this.projectionMatrix,this.projectionWidth=0,this.projectionHeight=0,this.init(this.config)},init:function(t){var e,i=this.game,s=this.canvas,n=t.backgroundColor;if(!(e=i.config.context?i.config.context:s.getContext("webgl",t.contextCreation)||s.getContext("experimental-webgl",t.contextCreation))||e.isContextLost())throw this.contextLost=!0,new Error("WebGL unsupported");this.gl=e;var r=this;this.contextLostHandler=function(t){r.contextLost=!0,r.game.events.emit(l.CONTEXT_LOST,r),t.preventDefault()},this.contextRestoredHandler=function(){r.contextLost=!1,r.init(r.config),r.game.events.emit(l.CONTEXT_RESTORED,r)},s.addEventListener("webglcontextlost",this.contextLostHandler,!1),s.addEventListener("webglcontextrestored",this.contextRestoredHandler,!1),i.context=e;for(var a=0;a<=27;a++)this.blendModes.push({func:[e.ONE,e.ONE_MINUS_SRC_ALPHA],equation:e.FUNC_ADD});this.blendModes[1].func=[e.ONE,e.DST_ALPHA],this.blendModes[2].func=[e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA],this.blendModes[3].func=[e.ONE,e.ONE_MINUS_SRC_COLOR],this.blendModes[17]={func:[e.ZERO,e.ONE_MINUS_SRC_ALPHA],equation:e.FUNC_REVERSE_SUBTRACT},this.glFormats[0]=e.BYTE,this.glFormats[1]=e.SHORT,this.glFormats[2]=e.UNSIGNED_BYTE,this.glFormats[3]=e.UNSIGNED_SHORT,this.glFormats[4]=e.FLOAT,this.glFuncMap={mat2:{func:e.uniformMatrix2fv,length:1,matrix:!0},mat3:{func:e.uniformMatrix3fv,length:1,matrix:!0},mat4:{func:e.uniformMatrix4fv,length:1,matrix:!0},"1f":{func:e.uniform1f,length:1},"1fv":{func:e.uniform1fv,length:1},"1i":{func:e.uniform1i,length:1},"1iv":{func:e.uniform1iv,length:1},"2f":{func:e.uniform2f,length:2},"2fv":{func:e.uniform2fv,length:1},"2i":{func:e.uniform2i,length:2},"2iv":{func:e.uniform2iv,length:1},"3f":{func:e.uniform3f,length:3},"3fv":{func:e.uniform3fv,length:1},"3i":{func:e.uniform3i,length:3},"3iv":{func:e.uniform3iv,length:1},"4f":{func:e.uniform4f,length:4},"4fv":{func:e.uniform4fv,length:1},"4i":{func:e.uniform4i,length:4},"4iv":{func:e.uniform4iv,length:1}};var h=e.getSupportedExtensions();t.maxTextures&&-1!==t.maxTextures||(t.maxTextures=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),t.maxTextureSize||(t.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE)),this.compression=this.getCompressedTextures(),this.supportedExtensions=h;var u="ANGLE_instanced_arrays";this.instancedArraysExtension=h.indexOf(u)>-1?e.getExtension(u):null;var d="OES_vertex_array_object";this.vaoExtension=h.indexOf(d)>-1?e.getExtension(d):null,e.disable(e.DEPTH_TEST),e.disable(e.CULL_FACE),e.enable(e.BLEND),e.clearColor(n.redGL,n.greenGL,n.blueGL,n.alphaGL),this.mipmapFilter=e[t.mipmapFilter],this.maxTextures=m.checkShaderMax(e,t.maxTextures),this.textureIndexes=[];var f=this.tempTextures;if(Array.isArray(f))for(var v=0;a0&&s>0;if(o&&a){var h=o[0],l=o[1],u=o[2],c=o[3];a=h!==t||l!==e||u!==i||c!==s}a&&(this.flush(),r.scissor(t,n-e-s,i,s))},resetScissor:function(){var t=this.gl;t.enable(t.SCISSOR_TEST);var e=this.currentScissor;if(e){var i=e[0],s=e[1],n=e[2],r=e[3];n>0&&r>0&&t.scissor(i,this.drawingBufferHeight-s-r,n,r)}},popScissor:function(){var t=this.scissorStack;t.pop();var e=t[t.length-1];e&&this.setScissor(e[0],e[1],e[2],e[3]),this.currentScissor=e},hasActiveStencilMask:function(){var t=this.currentMask.mask,e=this.currentCameraMask.mask;return t&&t.isStencil||e&&e.isStencil},resetViewport:function(){var t=this.gl;t.viewport(0,0,this.width,this.height),this.drawingBufferHeight=t.drawingBufferHeight},setBlendMode:function(t,e){void 0===e&&(e=!1);var i=this.gl,s=this.blendModes[t];return!!(e||t!==o.BlendModes.SKIP_CHECK&&this.currentBlendMode!==t)&&(this.flush(),i.enable(i.BLEND),i.blendEquation(s.equation),s.func.length>2?i.blendFuncSeparate(s.func[0],s.func[1],s.func[2],s.func[3]):i.blendFunc(s.func[0],s.func[1]),this.currentBlendMode=t,!0)},addBlendMode:function(t,e){return this.blendModes.push({func:t,equation:e})-1},updateBlendMode:function(t,e,i){return this.blendModes[t]&&(this.blendModes[t].func=e,i&&(this.blendModes[t].equation=i)),this},removeBlendMode:function(t){return t>17&&this.blendModes[t]&&this.blendModes.splice(t,1),this},setBlankTexture:function(){this.setTexture2D(this.blankTexture.glTexture)},setTextureSource:function(t){if(this.pipelines.forceZero())return this.setTextureZero(t.glTexture,!0),0;var e=this.gl,i=this.currentActiveTexture;return t.glIndexCounter0)&&this.pipelines.setMulti().drawFillRect(e,i,s,r,m.getTintFromFloats(o.blueGL,o.greenGL,o.redGL,1),o.alphaGL)},getCurrentStencilMask:function(){var t=null,e=this.maskStack,i=this.currentCameraMask;return e.length>0?t=e[e.length-1]:i.mask&&i.mask.isStencil&&(t=i),t},postRenderCamera:function(t){var e=t.flashEffect,i=t.fadeEffect;if(e.isRunning||i.isRunning||i.isComplete){var s=this.pipelines.setMulti();e.postRenderWebGL(s,m.getTintFromFloats),i.postRenderWebGL(s,m.getTintFromFloats)}t.dirty=!1,this.popScissor(),t.mask&&(this.currentCameraMask.mask=null,t.mask.postRenderWebGL(this,t._maskCamera)),this.pipelines.postBatchCamera(t),t.emit(n.POST_RENDER,t)},preRender:function(){if(!this.contextLost){var t=this.gl;if(t.bindFramebuffer(t.FRAMEBUFFER,null),this.config.clearBeforeRender){var e=this.config.backgroundColor;t.clearColor(e.redGL,e.greenGL,e.blueGL,e.alphaGL),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT|t.STENCIL_BUFFER_BIT)}t.enable(t.SCISSOR_TEST),this.currentScissor=this.defaultScissor,this.scissorStack.length=0,this.scissorStack.push(this.currentScissor),this.game.scene.customViewports&&t.scissor(0,this.drawingBufferHeight-this.height,this.width,this.height),this.currentMask.mask=null,this.currentCameraMask.mask=null,this.maskStack.length=0,this.textureFlush=0,this.emit(h.PRE_RENDER)}},render:function(t,e,i){if(!this.contextLost){var s=e.length;if(this.emit(h.RENDER,t,i),this.preRenderCamera(i),0===s)return this.setBlendMode(o.BlendModes.NORMAL),void this.postRenderCamera(i);this.currentType="";for(var n=this.currentMask,r=0;r0&&(this.startActiveTexture++,this.currentActiveTexture=1)}},snapshot:function(t,e,i){return this.snapshotArea(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight,t,e,i)},snapshotArea:function(t,e,i,s,n,r,o){var a=this.snapshotState;return a.callback=n,a.type=r,a.encoder=o,a.getPixel=!1,a.x=t,a.y=e,a.width=Math.min(i,this.gl.drawingBufferWidth),a.height=Math.min(s,this.gl.drawingBufferHeight),this},snapshotPixel:function(t,e,i){return this.snapshotArea(t,e,1,1,i),this.snapshotState.getPixel=!0,this},snapshotFramebuffer:function(t,e,i,s,n,r,o,a,h,l,u){void 0===n&&(n=!1),void 0===r&&(r=0),void 0===o&&(o=0),void 0===a&&(a=e),void 0===h&&(h=i);var c=this.currentFramebuffer;this.snapshotArea(r,o,a,h,s,l,u);var d=this.snapshotState;return d.getPixel=n,d.isFramebuffer=!0,d.bufferWidth=e,d.bufferHeight=i,this.setFramebuffer(t),y(this.canvas,d),this.setFramebuffer(c),d.callback=null,d.isFramebuffer=!1,this},canvasToTexture:function(t,e,i,s){return void 0===i&&(i=!1),void 0===s&&(s=!1),e?this.updateCanvasTexture(t,e,s):this.createCanvasTexture(t,i,s)},createCanvasTexture:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var s=this.gl,n=s.NEAREST,r=s.NEAREST,o=t.width,a=t.height,h=s.CLAMP_TO_EDGE,l=u(o,a);return!e&&l&&(h=s.REPEAT),this.config.antialias&&(n=l?this.mipmapFilter:s.LINEAR,r=s.LINEAR),this.createTexture2D(0,n,r,h,h,s.RGBA,t,o,a,!0,!1,i)},updateCanvasTexture:function(t,e,i){void 0===i&&(i=!1);var s=this.gl,n=t.width,r=t.height;if(n>0&&r>0){s.activeTexture(s.TEXTURE0);var o=s.getParameter(s.TEXTURE_BINDING_2D);s.bindTexture(s.TEXTURE_2D,e),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,i),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,s.RGBA,s.UNSIGNED_BYTE,t),e.width=n,e.height=r,o&&s.bindTexture(s.TEXTURE_2D,o)}return e},createVideoTexture:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var s=this.gl,n=s.NEAREST,r=s.NEAREST,o=t.videoWidth,a=t.videoHeight,h=s.CLAMP_TO_EDGE,l=u(o,a);return!e&&l&&(h=s.REPEAT),this.config.antialias&&(n=l?this.mipmapFilter:s.LINEAR,r=s.LINEAR),this.createTexture2D(0,n,r,h,h,s.RGBA,t,o,a,!0,!0,i)},updateVideoTexture:function(t,e,i){void 0===i&&(i=!1);var s=this.gl,n=t.videoWidth,r=t.videoHeight;if(n>0&&r>0){s.activeTexture(s.TEXTURE0);var o=s.getParameter(s.TEXTURE_BINDING_2D);s.bindTexture(s.TEXTURE_2D,e),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,i),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,s.RGBA,s.UNSIGNED_BYTE,t),e.width=n,e.height=r,o&&s.bindTexture(s.TEXTURE_2D,o)}return e},setTextureFilter:function(t,e){var i=this.gl,s=[i.LINEAR,i.NEAREST][e];i.activeTexture(i.TEXTURE0);var n=i.getParameter(i.TEXTURE_BINDING_2D);return i.bindTexture(i.TEXTURE_2D,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,s),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,s),n&&i.bindTexture(i.TEXTURE_2D,n),this},getMaxTextureSize:function(){return this.config.maxTextureSize},destroy:function(){this.canvas.removeEventListener("webglcontextlost",this.contextLostHandler,!1),this.canvas.removeEventListener("webglcontextrestored",this.contextRestoredHandler,!1);for(var t=this.gl,e=this.tempTextures,i=0;i{var s=i(56694),n=i(72632),r=i(71402),o=new s({initialize:function(t,e,i,s,n){this.pipeline=t,this.name=e,this.renderer=t.renderer,this.gl=this.renderer.gl,this.program=this.renderer.createProgram(i,s),this.attributes,this.vertexComponentCount=0,this.vertexSize=0,this.uniforms={},this.createAttributes(n),this.createUniforms()},createAttributes:function(t){var e=0,i=0,s=[];this.vertexComponentCount=0;for(var o=0;o=0?(e.enableVertexAttribArray(p),e.vertexAttribPointer(p,a,h,d,i,l),o.enabled=!0,o.location=p):-1!==p&&e.disableVertexAttribArray(p)}else u?e.vertexAttribPointer(c,a,h,d,i,l):!u&&c>-1&&(e.disableVertexAttribArray(c),o.location=-1)}return this},createUniforms:function(){var t,e,i,s=this.gl,n=this.program,r=this.uniforms,o=s.getProgramParameter(n,s.ACTIVE_UNIFORMS);for(t=0;t0&&(e=e.substr(0,h),r.hasOwnProperty(e)||null!==(i=s.getUniformLocation(n,e))&&(r[e]={name:e,location:i,value1:null,value2:null,value3:null,value4:null}))}}return this},hasUniform:function(t){return this.uniforms.hasOwnProperty(t)},resetUniform:function(t){var e=this.uniforms[t];return e&&(e.value1=null,e.value2=null,e.value3=null,e.value4=null),this},setUniform1:function(t,e,i,s){var n=this.uniforms[e];return n?((s||n.value1!==i)&&(n.value1=i,this.renderer.setProgram(this.program),t.call(this.gl,n.location,i),this.pipeline.currentShader=this),this):this},setUniform2:function(t,e,i,s,n){var r=this.uniforms[e];return r?((n||r.value1!==i||r.value2!==s)&&(r.value1=i,r.value2=s,this.renderer.setProgram(this.program),t.call(this.gl,r.location,i,s),this.pipeline.currentShader=this),this):this},setUniform3:function(t,e,i,s,n,r){var o=this.uniforms[e];return o?((r||o.value1!==i||o.value2!==s||o.value3!==n)&&(o.value1=i,o.value2=s,o.value3=n,this.renderer.setProgram(this.program),t.call(this.gl,o.location,i,s,n),this.pipeline.currentShader=this),this):this},setUniform4:function(t,e,i,s,n,r,o){var a=this.uniforms[e];return a?((o||a.value1!==i||a.value2!==s||a.value3!==n||a.value4!==r)&&(a.value1=i,a.value2=s,a.value3=n,a.value4=r,this.renderer.setProgram(this.program),t.call(this.gl,a.location,i,s,n,r),this.pipeline.currentShader=this),this):this},set1f:function(t,e){return this.setUniform1(this.gl.uniform1f,t,e)},set2f:function(t,e,i){return this.setUniform2(this.gl.uniform2f,t,e,i)},set3f:function(t,e,i,s){return this.setUniform3(this.gl.uniform3f,t,e,i,s)},set4f:function(t,e,i,s,n){return this.setUniform4(this.gl.uniform4f,t,e,i,s,n)},set1fv:function(t,e){return this.setUniform1(this.gl.uniform1fv,t,e,!0)},set2fv:function(t,e){return this.setUniform1(this.gl.uniform2fv,t,e,!0)},set3fv:function(t,e){return this.setUniform1(this.gl.uniform3fv,t,e,!0)},set4fv:function(t,e){return this.setUniform1(this.gl.uniform4fv,t,e,!0)},set1iv:function(t,e){return this.setUniform1(this.gl.uniform1iv,t,e,!0)},set2iv:function(t,e){return this.setUniform1(this.gl.uniform2iv,t,e,!0)},set3iv:function(t,e){return this.setUniform1(this.gl.uniform3iv,t,e,!0)},set4iv:function(t,e){return this.setUniform1(this.gl.uniform4iv,t,e,!0)},set1i:function(t,e){return this.setUniform1(this.gl.uniform1i,t,e)},set2i:function(t,e,i){return this.setUniform2(this.gl.uniform2i,t,e,i)},set3i:function(t,e,i,s){return this.setUniform3(this.gl.uniform3i,t,e,i,s)},set4i:function(t,e,i,s,n){return this.setUniform4(this.gl.uniform4i,t,e,i,s,n)},setMatrix2fv:function(t,e,i){return this.setUniform2(this.gl.uniformMatrix2fv,t,e,i,!0)},setMatrix3fv:function(t,e,i){return this.setUniform2(this.gl.uniformMatrix3fv,t,e,i,!0)},setMatrix4fv:function(t,e,i){return this.setUniform2(this.gl.uniformMatrix4fv,t,e,i,!0)},destroy:function(){this.gl.deleteProgram(this.program),this.pipeline=null,this.renderer=null,this.gl=null,this.program=null,this.attributes=null,this.uniforms=null}});t.exports=o},71402:t=>{t.exports={BYTE:{enum:5120,size:1},UNSIGNED_BYTE:{enum:5121,size:1},SHORT:{enum:5122,size:2},UNSIGNED_SHORT:{enum:5123,size:2},INT:{enum:5124,size:4},UNSIGNED_INT:{enum:5125,size:4},FLOAT:{enum:5126,size:4}}},55478:(t,e,i)=>{var s=i(71402),n=i(98611),r={PipelineManager:i(35217),Pipelines:i(62253),RenderTarget:i(37410),Utils:i(75512),WebGLPipeline:i(44775),WebGLRenderer:i(11857),WebGLShader:i(71305)};r=n(!1,r,s),t.exports=r},5583:(t,e,i)=>{var s=i(56694),n=i(72632),r=i(91679),o=i(89053),a=i(71402),h=i(44775),l=new s({Extends:h,initialize:function(t){t.fragShader=n(t,"fragShader",r),t.vertShader=n(t,"vertShader",o),t.batchSize=n(t,"batchSize",1),t.vertices=n(t,"vertices",[-1,1,-1,-7,7,1]),t.attributes=n(t,"attributes",[{name:"inPosition",size:2,type:a.FLOAT}]),h.call(this,t)},boot:function(){h.prototype.boot.call(this),this.set1i("uMainSampler",0),this.set1i("uMaskSampler",1)},resize:function(t,e){h.prototype.resize.call(this,t,e),this.set2f("uResolution",t,e)},beginMask:function(t,e,i){var s=this.gl;if(t.bitmapMask&&s){var n=this.renderer;n.flush(),n.pushFramebuffer(t.mainFramebuffer),s.disable(s.STENCIL_TEST),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT),n.currentCameraMask.mask!==t&&(n.currentMask.mask=t,n.currentMask.camera=i)}},endMask:function(t,e){var i=this.gl,s=this.renderer,n=t.bitmapMask;if(n&&i){s.flush(),s.pushFramebuffer(t.maskFramebuffer),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),s.setBlendMode(0,!0),n.renderWebGL(s,n,e),s.flush(),s.popFramebuffer(),s.popFramebuffer();var r=s.getCurrentStencilMask();r?(i.enable(i.STENCIL_TEST),r.mask.applyStencil(s,r.camera,!0)):s.currentMask.mask=null,s.pipelines.set(this),i.activeTexture(i.TEXTURE1),i.bindTexture(i.TEXTURE_2D,t.maskTexture),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,t.mainTexture),this.set1i("uInvertMaskAlpha",t.invertAlpha),i.drawArrays(this.topology,0,3),s.resetTextures()}}});t.exports=l},67589:(t,e,i)=>{var s=i(56694),n=i(11117),r=i(72632),o=i(37699),a=i(28739),h=i(69360),l=i(71402),u=i(44775),c=new s({Extends:u,initialize:function(t){t.fragShader=r(t,"fragShader",o),t.vertShader=r(t,"vertShader",a),t.attributes=r(t,"attributes",[{name:"inPosition",size:2},{name:"inColor",size:4,type:l.UNSIGNED_BYTE,normalized:!0}]),u.call(this,t),this.calcMatrix=new h,this.tempTriangle=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}],this.strokeTint={TL:0,TR:0,BL:0,BR:0},this.fillTint={TL:0,TR:0,BL:0,BR:0},this.currentFrame={u0:0,v0:0,u1:1,v1:1},this.firstQuad=[0,0,0,0,0],this.prevQuad=[0,0,0,0,0],this.polygonCache=[]},batchFillRect:function(t,e,i,s,n,r){this.renderer.pipelines.set(this);var o=this.calcMatrix;r&&r.multiply(n,o);var a=t+i,h=e+s,l=o.getX(t,e),u=o.getY(t,e),c=o.getX(t,h),d=o.getY(t,h),p=o.getX(a,h),f=o.getY(a,h),v=o.getX(a,e),g=o.getY(a,e),m=this.fillTint;this.batchQuad(l,u,c,d,p,f,v,g,m.TL,m.TR,m.BL,m.BR)},batchFillTriangle:function(t,e,i,s,n,r,o,a){this.renderer.pipelines.set(this);var h=this.calcMatrix;a&&a.multiply(o,h);var l=h.getX(t,e),u=h.getY(t,e),c=h.getX(i,s),d=h.getY(i,s),p=h.getX(n,r),f=h.getY(n,r),v=this.fillTint;this.batchTri(l,u,c,d,p,f,v.TL,v.TR,v.BL)},batchStrokeTriangle:function(t,e,i,s,n,r,o,a,h){var l=this.tempTriangle;l[0].x=t,l[0].y=e,l[0].width=o,l[1].x=i,l[1].y=s,l[1].width=o,l[2].x=n,l[2].y=r,l[2].width=o,l[3].x=t,l[3].y=e,l[3].width=o,this.batchStrokePath(l,o,!1,a,h)},batchFillPath:function(t,e,i){this.renderer.pipelines.set(this);var s=this.calcMatrix;i&&i.multiply(e,s);for(var r,o,a=t.length,h=this.polygonCache,l=this.fillTint.TL,u=this.fillTint.TR,c=this.fillTint.BL,d=0;d0&&U[4]?this.batchQuad(F,D,R,P,U[0],U[1],U[2],U[3],I,B,N,Y):(X[0]=F,X[1]=D,X[2]=R,X[3]=P,X[4]=1),h&&X[4]?this.batchQuad(C,M,O,L,X[0],X[1],X[2],X[3],I,B,N,Y):(U[0]=C,U[1]=M,U[2]=O,U[3]=L,U[4]=1)}},batchVert:function(t,e,i){var s=this.vertexViewF32,n=this.vertexViewU32,r=this.vertexCount*this.currentShader.vertexComponentCount-1;s[++r]=t,s[++r]=e,n[++r]=i,this.vertexCount++},batchQuad:function(t,e,i,s,n,r,o,a,h,l,u,c){var d=!1;return this.shouldFlush(6)&&(this.flush(),d=!0),this.batchVert(t,e,h),this.batchVert(i,s,u),this.batchVert(n,r,c),this.batchVert(t,e,h),this.batchVert(n,r,c),this.batchVert(o,a,l),d},batchTri:function(t,e,i,s,n,r,o,a,h){var l=!1;return this.shouldFlush(3)&&(this.flush(),l=!0),this.batchVert(t,e,o),this.batchVert(i,s,a),this.batchVert(n,r,h),l},destroy:function(){return u.prototype.destroy.call(this),this.polygonCache=null,this}});t.exports=c},66901:(t,e,i)=>{var s=i(56694),n=i(72632),r=i(65045),o=i(77310),a=i(93736),h=i(44775),l=10,u=new a,c=new s({Extends:o,initialize:function(t){l=t.game.renderer.config.maxLights;for(var e=n(t,"fragShader",r),i=[],s=1;s<=l;s++)i.push({name:"lights"+s,fragShader:e.replace("%LIGHT_COUNT%",s.toString())});t.shaders=i,o.call(this,t),this.inverseRotationMatrix=new Float32Array([1,0,0,0,1,0,0,0,1]),this.defaultNormalMap,this.lightsActive=!0},boot:function(){h.prototype.boot.call(this);var t=this.gl,e=t.createTexture();t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,e),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array([127,127,255,255])),this.defaultNormalMap={glTexture:e};for(var i=0;i0&&this.flush();var e=this.inverseRotationMatrix;if(t){var i=-t,s=Math.cos(i),n=Math.sin(i);e[1]=n,e[3]=-n,e[0]=e[4]=s}else e[0]=e[4]=1,e[1]=e[3]=0;this.setMatrix3fv("uInverseRotationMatrix",!1,e),this.currentNormalMapRotation=t}},setTexture2D:function(t,e){var i=this.renderer;void 0===t&&(t=i.tempTextures[0]);var s=this.getNormalMap(e);i.isNewNormalMap(t,s)&&(this.flush(),i.setTextureZero(t),i.setNormalMap(s));var n=e?e.rotation:0;return this.setNormalMapRotation(n),this.currentUnit=0,0},setGameObject:function(t,e){void 0===e&&(e=t.frame);var i=this.renderer,s=e.glTexture,n=this.getNormalMap(t);return i.isNewNormalMap()&&(this.flush(),i.setTextureZero(s),i.setNormalMap(n)),this.setNormalMapRotation(t.rotation),this.currentUnit=0,0},getNormalMap:function(t){var e;return t?t.displayTexture?e=t.displayTexture.dataSource[t.displayFrame.sourceIndex]:t.texture?e=t.texture.dataSource[t.frame.sourceIndex]:t.tileset&&(e=Array.isArray(t.tileset)?t.tileset[0].image.dataSource[0]:t.tileset.image.dataSource[0]):e=this.defaultNormalMap,e||(e=this.defaultNormalMap),e.glTexture},batchSprite:function(t,e,i){this.lightsActive&&o.prototype.batchSprite.call(this,t,e,i)},batchTexture:function(t,e,i,s,n,r,a,h,l,u,c,d,p,f,v,g,m,y,x,T,w,b,E,S,A,_,C,M,R,P,O,L){this.lightsActive&&o.prototype.batchTexture.call(this,t,e,i,s,n,r,a,h,l,u,c,d,p,f,v,g,m,y,x,T,w,b,E,S,A,_,C,M,R,P,O,L)},batchTextureFrame:function(t,e,i,s,n,r,a){this.lightsActive&&o.prototype.batchTextureFrame.call(this,t,e,i,s,n,r,a)}});c.LIGHT_COUNT=l,t.exports=c},77310:(t,e,i)=>{var s=i(56694),n=i(11117),r=i(72632),o=i(53787),a=i(15968),h=i(69360),l=i(75512),u=i(71402),c=i(44775),d=new s({Extends:c,initialize:function(t){var e=t.game.renderer,i=r(t,"fragShader",o);t.fragShader=l.parseFragmentShaderMaxTextures(i,e.maxTextures),t.vertShader=r(t,"vertShader",a),t.attributes=r(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexId"},{name:"inTintEffect"},{name:"inTint",size:4,type:u.UNSIGNED_BYTE,normalized:!0}]),c.call(this,t),this._tempMatrix1=new h,this._tempMatrix2=new h,this._tempMatrix3=new h,this.calcMatrix=new h,this.tempTriangle=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}],this.strokeTint={TL:0,TR:0,BL:0,BR:0},this.fillTint={TL:0,TR:0,BL:0,BR:0},this.currentFrame={u0:0,v0:0,u1:1,v1:1},this.firstQuad=[0,0,0,0,0],this.prevQuad=[0,0,0,0,0],this.polygonCache=[]},boot:function(){c.prototype.boot.call(this),this.currentShader.set1iv("uMainSampler",this.renderer.textureIndexes)},batchSprite:function(t,e,i){this.manager.set(this,t);var s=this._tempMatrix1,n=this._tempMatrix2,r=this._tempMatrix3,o=t.frame,a=o.glTexture,h=o.u0,u=o.v0,c=o.u1,d=o.v1,p=o.x,f=o.y,v=o.cutWidth,g=o.cutHeight,m=o.customPivot,y=t.displayOriginX,x=t.displayOriginY,T=-y+p,w=-x+f;if(t.isCropped){var b=t._crop;b.flipX===t.flipX&&b.flipY===t.flipY||o.updateCropUVs(b,t.flipX,t.flipY),h=b.u0,u=b.v0,c=b.u1,d=b.v1,v=b.width,g=b.height,T=-y+(p=b.x),w=-x+(f=b.y)}var E=1,S=1;t.flipX&&(m||(T+=-o.realWidth+2*y),E=-1),(t.flipY||o.source.isGLTexture&&!a.flipY)&&(m||(w+=-o.realHeight+2*x),S=-1),n.applyITRS(t.x,t.y,t.rotation,t.scaleX*E,t.scaleY*S),s.copyFrom(e.matrix),i?(s.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),n.e=t.x,n.f=t.y):(n.e-=e.scrollX*t.scrollFactorX,n.f-=e.scrollY*t.scrollFactorY),s.multiply(n,r);var A=T+v,_=w+g,C=e.roundPixels,M=r.getXRound(T,w,C),R=r.getXRound(T,_,C),P=r.getXRound(A,_,C),O=r.getXRound(A,w,C),L=r.getYRound(T,w,C),F=r.getYRound(T,_,C),D=r.getYRound(A,_,C),k=r.getYRound(A,w,C),I=l.getTintAppendFloatAlpha,B=e.alpha,N=I(t.tintTopLeft,B*t._alphaTL),Y=I(t.tintTopRight,B*t._alphaTR),U=I(t.tintBottomLeft,B*t._alphaBL),X=I(t.tintBottomRight,B*t._alphaBR);this.shouldFlush(6)&&this.flush();var z=this.setGameObject(t,o);this.manager.preBatch(t),this.batchQuad(t,M,L,R,F,P,D,O,k,h,u,c,d,N,Y,U,X,t.tintFill,a,z),this.manager.postBatch(t)},batchTexture:function(t,e,i,s,n,r,o,a,h,l,u,c,d,p,f,v,g,m,y,x,T,w,b,E,S,A,_,C,M,R,P,O){this.manager.set(this,t);var L=this._tempMatrix1,F=this._tempMatrix2,D=this._tempMatrix3,k=m/i+_,I=y/s+C,B=(m+x)/i+_,N=(y+T)/s+C,Y=o,U=a,X=-v,z=-g;if(t.isCropped){var G=t._crop,V=G.width,W=G.height;Y=V,U=W,o=V,a=W;var H=m=G.x,j=y=G.y;c&&(H=x-G.x-V),d&&(j=T-G.y-W),k=H/i+_,I=j/s+C,B=(H+V)/i+_,N=(j+W)/s+C,X=-v+m,z=-g+y}c&&(Y*=-1,X+=o),(d^=!P&&e.isRenderTexture?1:0)&&(U*=-1,z+=a);var q=X+Y,K=z+U;F.applyITRS(n,r,u,h,l),L.copyFrom(M.matrix),R?(L.multiplyWithOffset(R,-M.scrollX*p,-M.scrollY*f),F.e=n,F.f=r):(F.e-=M.scrollX*p,F.f-=M.scrollY*f),L.multiply(F,D);var Z=M.roundPixels,J=D.getXRound(X,z,Z),Q=D.getYRound(X,z,Z),$=D.getXRound(X,K,Z),tt=D.getYRound(X,K,Z),et=D.getXRound(q,K,Z),it=D.getYRound(q,K,Z),st=D.getXRound(q,z,Z),nt=D.getYRound(q,z,Z);void 0===O&&(O=this.renderer.setTexture2D(e)),t&&this.manager.preBatch(t),this.batchQuad(t,J,Q,$,tt,et,it,st,nt,k,I,B,N,w,b,E,S,A,e,O),t&&this.manager.postBatch(t)},batchTextureFrame:function(t,e,i,s,n,r,o){this.manager.set(this);var a=this._tempMatrix1.copyFrom(r),h=this._tempMatrix2,u=e+t.width,c=i+t.height;o?a.multiply(o,h):h=a;var d=h.getX(e,i),p=h.getY(e,i),f=h.getX(e,c),v=h.getY(e,c),g=h.getX(u,c),m=h.getY(u,c),y=h.getX(u,i),x=h.getY(u,i),T=this.renderer.setTextureSource(t.source);s=l.getTintAppendFloatAlpha(s,n),this.batchQuad(null,d,p,f,v,g,m,y,x,t.u0,t.v0,t.u1,t.v1,s,s,s,s,0,t.glTexture,T)},batchFillRect:function(t,e,i,s,n,r){this.renderer.pipelines.set(this);var o=this.calcMatrix;r&&r.multiply(n,o);var a=t+i,h=e+s,l=o.getX(t,e),u=o.getY(t,e),c=o.getX(t,h),d=o.getY(t,h),p=o.getX(a,h),f=o.getY(a,h),v=o.getX(a,e),g=o.getY(a,e),m=this.fillTint;this.batchQuad(null,l,u,c,d,p,f,v,g,0,0,1,1,m.TL,m.TR,m.BL,m.BR,2)},batchFillTriangle:function(t,e,i,s,n,r,o,a){this.renderer.pipelines.set(this);var h=this.calcMatrix;a&&a.multiply(o,h);var l=h.getX(t,e),u=h.getY(t,e),c=h.getX(i,s),d=h.getY(i,s),p=h.getX(n,r),f=h.getY(n,r),v=this.fillTint;this.batchTri(null,l,u,c,d,p,f,0,0,1,1,v.TL,v.TR,v.BL,2)},batchStrokeTriangle:function(t,e,i,s,n,r,o,a,h){var l=this.tempTriangle;l[0].x=t,l[0].y=e,l[0].width=o,l[1].x=i,l[1].y=s,l[1].width=o,l[2].x=n,l[2].y=r,l[2].width=o,l[3].x=t,l[3].y=e,l[3].width=o,this.batchStrokePath(l,o,!1,a,h)},batchFillPath:function(t,e,i){this.renderer.pipelines.set(this);var s=this.calcMatrix;i&&i.multiply(e,s);for(var r,o,a=t.length,h=this.polygonCache,l=this.fillTint.TL,u=this.fillTint.TR,c=this.fillTint.BL,d=0;d0&&U[4]?this.batchQuad(null,F,D,R,P,U[0],U[1],U[2],U[3],0,0,1,1,I,B,N,Y,2):(X[0]=F,X[1]=D,X[2]=R,X[3]=P,X[4]=1),h&&X[4]?this.batchQuad(null,C,M,O,L,X[0],X[1],X[2],X[3],0,0,1,1,I,B,N,Y,2):(U[0]=C,U[1]=M,U[2]=O,U[3]=L,U[4]=1)}}});t.exports=d},10919:(t,e,i)=>{var s=i(56694),n=i(72632),r=i(83327),o=i(54677),a=i(44775),h=new s({Extends:a,initialize:function(t){t.vertShader=n(t,"vertShader",o),t.fragShader=n(t,"fragShader",r),t.attributes=n(t,"attributes",[{name:"inPosition",size:2},{name:"inLightPosition",size:2},{name:"inLightRadius"},{name:"inLightAttenuation"},{name:"inLightColor",size:4}]),a.call(this,t)},onRender:function(t,e){this.set2f("uResolution",this.width,this.height),this.set1f("uCameraZoom",e.zoom)},batchPointLight:function(t,e,i,s,n,r,o,a,h,l,u,c){var d=t.color,p=t.intensity,f=t.radius,v=t.attenuation,g=d.r*p,m=d.g*p,y=d.b*p,x=e.alpha*t.alpha;this.shouldFlush(6)&&this.flush(),this.batchLightVert(i,s,u,c,f,v,g,m,y,x),this.batchLightVert(n,r,u,c,f,v,g,m,y,x),this.batchLightVert(o,a,u,c,f,v,g,m,y,x),this.batchLightVert(i,s,u,c,f,v,g,m,y,x),this.batchLightVert(o,a,u,c,f,v,g,m,y,x),this.batchLightVert(h,l,u,c,f,v,g,m,y,x)},batchLightVert:function(t,e,i,s,n,r,o,a,h,l){var u=this.vertexViewF32,c=this.vertexCount*this.currentShader.vertexComponentCount-1;u[++c]=t,u[++c]=e,u[++c]=i,u[++c]=s,u[++c]=n,u[++c]=r,u[++c]=o,u[++c]=a,u[++c]=h,u[++c]=l,this.vertexCount++}});t.exports=h},80486:(t,e,i)=>{var s=i(56694),n=i(65246),r=i(72632),o=i(12569),a=i(99365),h=i(44775),l=new s({Extends:h,initialize:function(t){t.renderTarget=r(t,"renderTarget",1),t.fragShader=r(t,"fragShader",o),t.vertShader=r(t,"vertShader",a),t.attributes=r(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]),t.batchSize=1,t.vertices=[-1,-1,0,0,-1,1,0,1,1,1,1,1,-1,-1,0,0,1,1,1,1,1,-1,1,0],h.call(this,t),this.isPostFX=!0,this.gameObject,this.colorMatrix=new n,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2,this.renderer.isBooted&&(this.manager=this.renderer.pipelines,this.boot())},boot:function(){h.prototype.boot.call(this);var t=this.manager.UTILITY_PIPELINE;this.fullFrame1=t.fullFrame1,this.fullFrame2=t.fullFrame2,this.halfFrame1=t.halfFrame1,this.halfFrame2=t.halfFrame2,this.set1i("uMainSampler",0)},onDraw:function(t){this.bindAndDraw(t)},copyFrame:function(t,e,i,s,n){this.manager.copyFrame(t,e,i,s,n)},copyToGame:function(t){this.manager.copyToGame(t)},drawFrame:function(t,e,i){this.manager.drawFrame(t,e,i,this.colorMatrix)},blendFrames:function(t,e,i,s,n){this.manager.blendFrames(t,e,i,s,n)},blendFramesAdditive:function(t,e,i,s,n){this.manager.blendFramesAdditive(t,e,i,s,n)},clearFrame:function(t,e){this.manager.clearFrame(t,e)},blitFrame:function(t,e,i,s,n,r){this.manager.blitFrame(t,e,i,s,n,r)},copyFrameRect:function(t,e,i,s,n,r,o,a){this.manager.copyFrameRect(t,e,i,s,n,r,o,a)},bindAndDraw:function(t,e,i,s,n){void 0===i&&(i=!0),void 0===s&&(s=!0);var r=this.gl,o=this.renderer;this.bind(n),this.set1i("uMainSampler",0),e?(r.viewport(0,0,e.width,e.height),r.bindFramebuffer(r.FRAMEBUFFER,e.framebuffer),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e.texture,0),i&&(s?r.clearColor(0,0,0,0):r.clearColor(0,0,0,1),r.clear(r.COLOR_BUFFER_BIT))):(o.popFramebuffer(!1,!1,!1),o.currentFramebuffer||r.viewport(0,0,o.width,o.height)),r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,t.texture),r.bufferData(r.ARRAY_BUFFER,this.vertexData,r.STATIC_DRAW),r.drawArrays(r.TRIANGLES,0,6),e?(r.bindTexture(r.TEXTURE_2D,null),r.bindFramebuffer(r.FRAMEBUFFER,null)):o.resetTextures()}});t.exports=l},21213:(t,e,i)=>{var s=i(56694),n=i(72632),r=i(77310),o=new s({Extends:r,initialize:function(t){t.topology=5,t.batchSize=n(t,"batchSize",256),r.call(this,t)}});t.exports=o},51212:(t,e,i)=>{var s=i(56694),n=i(72632),r=i(77310),o=i(85060),a=i(18166),h=i(44775),l=new s({Extends:r,initialize:function(t){t.fragShader=n(t,"fragShader",o),t.vertShader=n(t,"vertShader",a),t.forceZero=!0,r.call(this,t)},boot:function(){h.prototype.boot.call(this),this.set1i("uMainSampler",0)}});t.exports=l},38964:(t,e,i)=>{var s=i(95723),n=i(79993),r=i(56694),o=i(72632),a=i(77310),h=i(12569),l=i(74118),u=i(37410),c=i(85060),d=i(18166),p=i(69360),f=i(71402),v=i(44775),g=new r({Extends:v,initialize:function(t){t.attributes=o(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexId"},{name:"inTintEffect"},{name:"inTint",size:4,type:f.UNSIGNED_BYTE,normalized:!0}]);var e=o(t,"fragShader",h),i=o(t,"vertShader",d),s=o(t,"drawShader",h),n=[{name:"DrawSprite",fragShader:c,vertShader:d},{name:"CopySprite",fragShader:e,vertShader:i},{name:"DrawGame",fragShader:s,vertShader:d}],r=o(t,"shaders",[]);t.shaders=n.concat(r),t.vertShader||(t.vertShader=i),t.batchSize=1,v.call(this,t),this.isSpriteFX=!0,this._tempMatrix1=new p,this._tempMatrix2=new p,this._tempMatrix3=new p,this.drawSpriteShader,this.copyShader,this.gameShader,this.quadVertexData,this.quadVertexBuffer,this.quadVertexViewF32,this.spriteBounds=new l,this.targetBounds=new l,this.fsTarget,this.tempSprite,this.renderer.isBooted&&(this.manager=this.renderer.pipelines,this.boot())},boot:function(){v.prototype.boot.call(this);var t=this.shaders,e=this.renderer;this.drawSpriteShader=t[0],this.copyShader=t[1],this.gameShader=t[2],this.fsTarget=new u(e,e.width,e.height,1,0,!0,!0),this.renderTargets=this.manager.renderTargets.concat(this.fsTarget);var i=new ArrayBuffer(168);this.quadVertexData=i,this.quadVertexViewF32=new Float32Array(i),this.quadVertexBuffer=e.createVertexBuffer(i,this.gl.STATIC_DRAW),this.onResize(e.width,e.height),this.currentShader=this.copyShader},onResize:function(t,e){var i=this.quadVertexViewF32;i[1]=e,i[22]=e,i[14]=t,i[28]=t,i[35]=t,i[36]=e},batchSprite:function(t,e,i){a.prototype.batchSprite.call(this,t,e,i)},batchTexture:function(t,e,i,s,n,r,o,h,l,u,c,d,p,f,v,g,m,y,x,T,w,b,E,S,A,_,C,M,R,P,O,L){a.prototype.batchTexture.call(this,t,e,i,s,n,r,o,h,l,u,c,d,true,f,v,g,m,y,x,T,w,b,E,S,A,_,C,M,R,P,O,L)},batchQuad:function(t,e,i,s,r,o,a,h,l,u,c,d,p,f,v,g,m,y,x){var T=Math.min(e,s,o,h),w=Math.min(i,r,a,l),b=Math.max(e,s,o,h)-T,E=Math.max(i,r,a,l)-w,S=this.spriteBounds.setTo(T,w,b,E),A=t.fxPadding,_=b+2*A,C=E+2*A,M=Math.abs(Math.max(_,C)),R=this.manager.getRenderTarget(M),P=this.targetBounds.setTo(0,0,R.width,R.height);n(P,S.centerX,S.centerY),this.tempSprite=t;var O=this.gl,L=this.renderer;this.setShader(this.drawSpriteShader),this.set1i("uMainSampler",0),this.flipProjectionMatrix(!0),this.onDrawSprite(t,R),t.onFX(this);var F=this.fsTarget;return L.setTextureZero(x),O.viewport(0,0,L.width,L.height),O.bindFramebuffer(O.FRAMEBUFFER,F.framebuffer),O.framebufferTexture2D(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_2D,F.texture,0),O.clearColor(0,0,0,0),O.clear(O.COLOR_BUFFER_BIT),this.batchVert(e,i,u,c,0,y,f),this.batchVert(s,r,u,p,0,y,g),this.batchVert(o,a,d,p,0,y,m),this.batchVert(e,i,u,c,0,y,f),this.batchVert(o,a,d,p,0,y,m),this.batchVert(h,l,d,c,0,y,v),this.flush(),this.flipProjectionMatrix(!1),L.clearTextureZero(),O.activeTexture(O.TEXTURE0),O.bindTexture(O.TEXTURE_2D,R.texture),O.copyTexSubImage2D(O.TEXTURE_2D,0,0,0,P.x,P.y,P.width,P.height),O.bindFramebuffer(O.FRAMEBUFFER,null),O.bindTexture(O.TEXTURE_2D,null),this.onBatch(t),this.currentShader=this.copyShader,this.onDraw(R,this.manager.getSwapRenderTarget()),!0},onDrawSprite:function(){},onCopySprite:function(){},copySprite:function(t,e,i,n,r,o){void 0===i&&(i=!0),void 0===n&&(n=!0),void 0===r&&(r=!1),void 0===o&&(o=this.copyShader);var a=this.gl,h=this.tempSprite;this.currentShader=o;var l=this.setVertexBuffer(this.quadVertexBuffer);if(o.bind(l,!1),this.set1i("uMainSampler",0),h.onFXCopy(this),this.onCopySprite(t,e,h),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,t.texture),t.height>e.height)a.viewport(0,0,t.width,t.height),this.setTargetUVs(t,e);else{var u=e.height-t.height;a.viewport(0,u,t.width,t.height),this.resetUVs()}if(a.bindFramebuffer(a.FRAMEBUFFER,e.framebuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,e.texture,0),i&&(a.clearColor(0,0,0,Number(!n)),a.clear(a.COLOR_BUFFER_BIT)),r){var c=this.renderer.currentBlendMode;this.renderer.setBlendMode(s.ERASE)}a.bufferData(a.ARRAY_BUFFER,this.quadVertexData,a.STATIC_DRAW),a.drawArrays(a.TRIANGLES,0,6),r&&this.renderer.setBlendMode(c),a.bindFramebuffer(a.FRAMEBUFFER,null)},blendFrames:function(t,e,i,s,n){this.manager.blendFrames(t,e,i,s,n)},blendFramesAdditive:function(t,e,i,s,n){this.manager.blendFramesAdditive(t,e,i,s,n)},drawToGame:function(t){this.currentShader=null,this.setShader(this.copyShader),this.bindAndDraw(t)},copyToGame:function(t){this.currentShader=null,this.setShader(this.gameShader),this.bindAndDraw(t)},bindAndDraw:function(t){var e=this.gl,i=this.renderer;this.set1i("uMainSampler",0),i.popFramebuffer(!1,!1,!1),i.currentFramebuffer||e.viewport(0,0,i.width,i.height),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t.texture);var s=this._tempMatrix1.loadIdentity(),n=this.targetBounds.x,r=this.targetBounds.y,o=n+t.width,a=r+t.height,h=s.getX(n,r),l=s.getX(n,a),u=s.getX(o,a),c=s.getX(o,r),d=s.getY(n,r),p=s.getY(n,a),f=s.getY(o,a),v=s.getY(o,r);this.batchVert(h,d,0,0,0,0,16777215),this.batchVert(l,p,0,1,0,0,16777215),this.batchVert(u,f,1,1,0,0,16777215),this.batchVert(h,d,0,0,0,0,16777215),this.batchVert(u,f,1,1,0,0,16777215),this.batchVert(c,v,1,0,0,0,16777215),this.flush(),i.resetTextures(),this.tempSprite=null},onDraw:function(t){this.drawToGame(t)},setUVs:function(t,e,i,s,n,r,o,a){var h=this.quadVertexViewF32;h[2]=t,h[3]=e,h[9]=i,h[10]=s,h[16]=n,h[17]=r,h[23]=t,h[24]=e,h[30]=n,h[31]=r,h[37]=o,h[38]=a},setTargetUVs:function(t,e){var i=e.height/t.height;i=i>.5?.5-(i-.5):.5-i+.5,this.setUVs(0,i,0,1+i,1,1+i,1,i)},resetUVs:function(){this.setUVs(0,0,0,1,1,1,1,0)},destroy:function(){this.gl.deleteBuffer(this.quadVertexBuffer),this._tempMatrix1.destroy(),this._tempMatrix2.destroy(),this._tempMatrix3.destroy(),this._tempMatrix1=null,this._tempMatrix1=null,this._tempMatrix1=null,this.drawSpriteShader=null,this.copyShader=null,this.gameShader=null,this.quadVertexData=null,this.quadVertexBuffer=null,this.quadVertexViewF32=null,this.fsTarget=null,this.tempSprite=null,v.prototype.destroy.call(this)}});t.exports=g},60848:(t,e,i)=>{var s=i(2529),n=i(95723),r=i(56694),o=i(65246),a=i(37486),h=i(79060),l=i(72632),u=i(98921),c=i(99365),d=i(44775),p=new r({Extends:d,initialize:function(t){t.renderTarget=l(t,"renderTarget",[{scale:1},{scale:1},{scale:.5},{scale:.5}]),t.vertShader=l(t,"vertShader",c),t.shaders=l(t,"shaders",[{name:"Copy",fragShader:h},{name:"AddBlend",fragShader:s},{name:"LinearBlend",fragShader:u},{name:"ColorMatrix",fragShader:a}]),t.attributes=l(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]),t.vertices=[-1,-1,0,0,-1,1,0,1,1,1,1,1,-1,-1,0,0,1,1,1,1,1,-1,1,0],t.batchSize=1,d.call(this,t),this.colorMatrix=new o,this.copyShader,this.addShader,this.linearShader,this.colorMatrixShader,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2},boot:function(){d.prototype.boot.call(this);var t=this.shaders,e=this.renderTargets;this.copyShader=t[0],this.addShader=t[1],this.linearShader=t[2],this.colorMatrixShader=t[3],this.fullFrame1=e[0],this.fullFrame2=e[1],this.halfFrame1=e[2],this.halfFrame2=e[3]},copyFrame:function(t,e,i,s,n){void 0===i&&(i=1),void 0===s&&(s=!0),void 0===n&&(n=!0);var r=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",i),r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,t.texture),e?(r.viewport(0,0,e.width,e.height),r.bindFramebuffer(r.FRAMEBUFFER,e.framebuffer),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e.texture,0)):r.viewport(0,0,t.width,t.height),s&&(n?r.clearColor(0,0,0,0):r.clearColor(0,0,0,1),r.clear(r.COLOR_BUFFER_BIT)),r.bufferData(r.ARRAY_BUFFER,this.vertexData,r.STATIC_DRAW),r.drawArrays(r.TRIANGLES,0,6),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindTexture(r.TEXTURE_2D,null)},blitFrame:function(t,e,i,s,r,o){void 0===i&&(i=1),void 0===s&&(s=!0),void 0===r&&(r=!0),void 0===o&&(o=!1);var a=this.gl;if(this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",i),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,t.texture),t.height>e.height)a.viewport(0,0,t.width,t.height),this.setTargetUVs(t,e);else{var h=e.height-t.height;a.viewport(0,h,t.width,t.height)}if(a.bindFramebuffer(a.FRAMEBUFFER,e.framebuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,e.texture,0),s&&(r?a.clearColor(0,0,0,0):a.clearColor(0,0,0,1),a.clear(a.COLOR_BUFFER_BIT)),o){var l=this.renderer.currentBlendMode;this.renderer.setBlendMode(n.ERASE)}a.bufferData(a.ARRAY_BUFFER,this.vertexData,a.STATIC_DRAW),a.drawArrays(a.TRIANGLES,0,6),o&&this.renderer.setBlendMode(l),a.bindFramebuffer(a.FRAMEBUFFER,null),a.bindTexture(a.TEXTURE_2D,null),this.resetUVs()},copyFrameRect:function(t,e,i,s,n,r,o,a){void 0===o&&(o=!0),void 0===a&&(a=!0);var h=this.gl;h.bindFramebuffer(h.FRAMEBUFFER,t.framebuffer),h.framebufferTexture2D(h.FRAMEBUFFER,h.COLOR_ATTACHMENT0,h.TEXTURE_2D,t.texture,0),o&&(a?h.clearColor(0,0,0,0):h.clearColor(0,0,0,1),h.clear(h.COLOR_BUFFER_BIT)),h.activeTexture(h.TEXTURE0),h.bindTexture(h.TEXTURE_2D,e.texture),h.copyTexSubImage2D(h.TEXTURE_2D,0,0,0,i,s,n,r),h.bindFramebuffer(h.FRAMEBUFFER,null),h.bindTexture(h.TEXTURE_2D,null)},copyToGame:function(t){var e=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",1),this.renderer.popFramebuffer(),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t.texture),e.bufferData(e.ARRAY_BUFFER,this.vertexData,e.STATIC_DRAW),e.drawArrays(e.TRIANGLES,0,6),this.renderer.resetTextures()},drawFrame:function(t,e,i,s){void 0===i&&(i=!0),void 0===s&&(s=this.colorMatrix);var n=this.gl;this.setShader(this.colorMatrixShader),this.set1i("uMainSampler",0),this.set1fv("uColorMatrix",s.getData()),this.set1f("uAlpha",s.alpha),n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,t.texture),e?(n.viewport(0,0,e.width,e.height),n.bindFramebuffer(n.FRAMEBUFFER,e.framebuffer),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,e.texture,0)):n.viewport(0,0,t.width,t.height),i?n.clearColor(0,0,0,0):n.clearColor(0,0,0,1),n.clear(n.COLOR_BUFFER_BIT),n.bufferData(n.ARRAY_BUFFER,this.vertexData,n.STATIC_DRAW),n.drawArrays(n.TRIANGLES,0,6),n.bindFramebuffer(n.FRAMEBUFFER,null),n.bindTexture(n.TEXTURE_2D,null)},blendFrames:function(t,e,i,s,n,r){void 0===s&&(s=1),void 0===n&&(n=!0),void 0===r&&(r=this.linearShader);var o=this.gl;this.setShader(r),this.set1i("uMainSampler1",0),this.set1i("uMainSampler2",1),this.set1f("uStrength",s),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,t.texture),o.activeTexture(o.TEXTURE1),o.bindTexture(o.TEXTURE_2D,e.texture),i?(o.bindFramebuffer(o.FRAMEBUFFER,i.framebuffer),o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,i.texture,0),o.viewport(0,0,i.width,i.height)):o.viewport(0,0,t.width,t.height),n?o.clearColor(0,0,0,0):o.clearColor(0,0,0,1),o.clear(o.COLOR_BUFFER_BIT),o.bufferData(o.ARRAY_BUFFER,this.vertexData,o.STATIC_DRAW),o.drawArrays(o.TRIANGLES,0,6),o.bindFramebuffer(o.FRAMEBUFFER,null),o.bindTexture(o.TEXTURE_2D,null)},blendFramesAdditive:function(t,e,i,s,n){this.blendFrames(t,e,i,s,n,this.addShader)},clearFrame:function(t,e){void 0===e&&(e=!0);var i=this.gl;i.viewport(0,0,t.width,t.height),i.bindFramebuffer(i.FRAMEBUFFER,t.framebuffer),e?i.clearColor(0,0,0,0):i.clearColor(0,0,0,1),i.clear(i.COLOR_BUFFER_BIT);var s=this.renderer.currentFramebuffer;i.bindFramebuffer(i.FRAMEBUFFER,s)},setUVs:function(t,e,i,s,n,r,o,a){var h=this.vertexViewF32;h[2]=t,h[3]=e,h[6]=i,h[7]=s,h[10]=n,h[11]=r,h[14]=t,h[15]=e,h[18]=n,h[19]=r,h[22]=o,h[23]=a},setTargetUVs:function(t,e){var i=e.height/t.height;i=i>.5?.5-(i-.5):.5-i+.5,this.setUVs(0,i,0,1+i,1,1+i,1,i)},flipX:function(){this.setUVs(1,0,1,1,0,1,0,0)},flipY:function(){this.setUVs(0,1,0,0,1,0,1,1)},resetUVs:function(){this.setUVs(0,0,0,1,1,1,1,0)}});t.exports=p},65641:t=>{t.exports={BITMAPMASK_PIPELINE:"BitmapMaskPipeline",LIGHT_PIPELINE:"Light2D",POINTLIGHT_PIPELINE:"PointLightPipeline",SINGLE_PIPELINE:"SinglePipeline",MULTI_PIPELINE:"MultiPipeline",ROPE_PIPELINE:"RopePipeline",GRAPHICS_PIPELINE:"GraphicsPipeline",POSTFX_PIPELINE:"PostFXPipeline",UTILITY_PIPELINE:"UtilityPipeline"}},68726:t=>{t.exports="pipelineafterflush"},67186:t=>{t.exports="pipelinebeforeflush"},22709:t=>{t.exports="pipelinebind"},74469:t=>{t.exports="pipelineboot"},93953:t=>{t.exports="pipelinedestroy"},51687:t=>{t.exports="pipelinerebind"},25034:t=>{t.exports="pipelineresize"},18970:(t,e,i)=>{t.exports={AFTER_FLUSH:i(68726),BEFORE_FLUSH:i(67186),BIND:i(22709),BOOT:i(74469),DESTROY:i(93953),REBIND:i(51687),RESIZE:i(25034)}},62253:(t,e,i)=>{var s=i(65641),n=i(98611),r={BitmapMaskPipeline:i(5583),Events:i(18970),GraphicsPipeline:i(67589),LightPipeline:i(66901),MultiPipeline:i(77310),PointLightPipeline:i(10919),PostFXPipeline:i(80486),RopePipeline:i(21213),SinglePipeline:i(51212),SpriteFXPipeline:i(38964),UtilityPipeline:i(60848)};r=n(!1,r,s),t.exports=r},2529:t=>{t.exports=["#define SHADER_NAME PHASER_ADD_BLEND_FS","","precision mediump float;","","uniform sampler2D uMainSampler1;","uniform sampler2D uMainSampler2;","uniform float uStrength;","","varying vec2 outTexCoord;","","void main ()","{"," vec4 frame1 = texture2D(uMainSampler1, outTexCoord);"," vec4 frame2 = texture2D(uMainSampler2, outTexCoord);",""," gl_FragColor = frame1 + frame2 * uStrength;","}",""].join("\n")},91679:t=>{t.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_FS","","precision mediump float;","","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uMaskSampler;","uniform bool uInvertMaskAlpha;","","void main ()","{"," vec2 uv = gl_FragCoord.xy / uResolution;"," vec4 mainColor = texture2D(uMainSampler, uv);"," vec4 maskColor = texture2D(uMaskSampler, uv);"," float alpha = mainColor.a;",""," if (!uInvertMaskAlpha)"," {"," alpha *= (maskColor.a);"," }"," else"," {"," alpha *= (1.0 - maskColor.a);"," }",""," gl_FragColor = vec4(mainColor.rgb * alpha, alpha);","}",""].join("\n")},89053:t=>{t.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_VS","","precision mediump float;","","attribute vec2 inPosition;","","void main ()","{"," gl_Position = vec4(inPosition, 0.0, 1.0);","}",""].join("\n")},37486:t=>{t.exports=["#define SHADER_NAME PHASER_COLORMATRIX_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","uniform float uColorMatrix[20];","uniform float uAlpha;","","varying vec2 outTexCoord;","","void main ()","{"," vec4 c = texture2D(uMainSampler, outTexCoord);",""," if (uAlpha == 0.0)"," {"," gl_FragColor = c;",""," return;"," }",""," if (c.a > 0.0)"," {"," c.rgb /= c.a;"," }",""," vec4 result;",""," result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4];"," result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9];"," result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14];"," result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19];",""," vec3 rgb = mix(c.rgb, result.rgb, uAlpha);",""," rgb *= result.a;",""," gl_FragColor = vec4(rgb, result.a);","}",""].join("\n")},79060:t=>{t.exports=["#define SHADER_NAME PHASER_COPY_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","uniform float uBrightness;","","varying vec2 outTexCoord;","","void main ()","{"," gl_FragColor = texture2D(uMainSampler, outTexCoord) * uBrightness;","}",""].join("\n")},37699:t=>{t.exports=["#define SHADER_NAME PHASER_GRAPHICS_FS","","precision mediump float;","","varying vec4 outColor;","","void main ()","{"," gl_FragColor = vec4(outColor.bgr * outColor.a, outColor.a);","}",""].join("\n")},28739:t=>{t.exports=["#define SHADER_NAME PHASER_GRAPHICS_VS","","precision mediump float;","","uniform mat4 uProjectionMatrix;","","attribute vec2 inPosition;","attribute vec4 inColor;","","varying vec4 outColor;","","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);",""," outColor = inColor;","}",""].join("\n")},65045:t=>{t.exports=["#define SHADER_NAME PHASER_LIGHT_FS","","precision mediump float;","","struct Light","{"," vec2 position;"," vec3 color;"," float intensity;"," float radius;","};","","const int kMaxLights = %LIGHT_COUNT%;","","uniform vec4 uCamera; /* x, y, rotation, zoom */","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uNormSampler;","uniform vec3 uAmbientLightColor;","uniform Light uLights[kMaxLights];","uniform mat3 uInverseRotationMatrix;","","varying vec2 outTexCoord;","varying vec4 outTint;","","void main()","{"," vec3 finalColor = vec3(0.0, 0.0, 0.0);"," vec4 color = texture2D(uMainSampler, outTexCoord) * vec4(outTint.bgr * outTint.a, outTint.a);"," vec3 normalMap = texture2D(uNormSampler, outTexCoord).rgb;"," vec3 normal = normalize(uInverseRotationMatrix * vec3(normalMap * 2.0 - 1.0));"," vec2 res = vec2(min(uResolution.x, uResolution.y)) * uCamera.w;",""," for (int index = 0; index < kMaxLights; ++index)"," {"," Light light = uLights[index];"," vec3 lightDir = vec3((light.position.xy / res) - (gl_FragCoord.xy / res), 0.1);"," vec3 lightNormal = normalize(lightDir);"," float distToSurf = length(lightDir) * uCamera.w;"," float diffuseFactor = max(dot(normal, lightNormal), 0.0);"," float radius = (light.radius / res.x * uCamera.w) * uCamera.w;"," float attenuation = clamp(1.0 - distToSurf * distToSurf / (radius * radius), 0.0, 1.0);"," vec3 diffuse = light.color * diffuseFactor;"," finalColor += (attenuation * diffuse) * light.intensity;"," }",""," vec4 colorOutput = vec4(uAmbientLightColor + finalColor, 1.0);",""," gl_FragColor = color * vec4(colorOutput.rgb * colorOutput.a, colorOutput.a);","}",""].join("\n")},98921:t=>{t.exports=["#define SHADER_NAME PHASER_LINEAR_BLEND_FS","","precision mediump float;","","uniform sampler2D uMainSampler1;","uniform sampler2D uMainSampler2;","uniform float uStrength;","","varying vec2 outTexCoord;","","void main ()","{"," vec4 frame1 = texture2D(uMainSampler1, outTexCoord);"," vec4 frame2 = texture2D(uMainSampler2, outTexCoord);",""," gl_FragColor = mix(frame1, frame2 * uStrength, 0.5);","}",""].join("\n")},53787:t=>{t.exports=["#define SHADER_NAME PHASER_MULTI_FS","#define numTextures %count%","","precision highp float;","","uniform sampler2D uMainSampler[%count%];","","varying vec2 outTexCoord;","varying float outTexId;","varying float outTintEffect;","varying vec4 outTint;","","vec4 getSampler (int index, vec2 uv)","{"," for (int i = 0; i < numTextures; ++i)"," {"," if (i == index)"," {"," return texture2D(uMainSampler[i], uv);"," }"," }",""," // Return black"," return vec4(0);","}","","void main ()","{"," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);",""," vec4 texture = getSampler(int(outTexId), outTexCoord);",""," // Multiply texture tint"," vec4 color = texture * texel;",""," if (outTintEffect == 1.0)"," {"," // Solid color + texture alpha"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," // Solid color, no texture"," color = texel;"," }",""," gl_FragColor = color;","}",""].join("\n")},15968:t=>{t.exports=["#define SHADER_NAME PHASER_MULTI_VS","","precision highp float;","","uniform mat4 uProjectionMatrix;","","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexId;","attribute float inTintEffect;","attribute vec4 inTint;","","varying vec2 outTexCoord;","varying float outTexId;","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);",""," outTexCoord = inTexCoord;"," outTexId = inTexId;"," outTint = inTint;"," outTintEffect = inTintEffect;","}",""].join("\n")},83327:t=>{t.exports=["#define SHADER_NAME PHASER_POINTLIGHT_FS","","precision mediump float;","","uniform vec2 uResolution;","uniform float uCameraZoom;","","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","","void main ()","{"," vec2 center = (lightPosition.xy + 1.0) * (uResolution.xy * 0.5);",""," float distToSurf = length(center - gl_FragCoord.xy);",""," float radius = 1.0 - distToSurf / (lightRadius * uCameraZoom);",""," float intensity = smoothstep(0.0, 1.0, radius * lightAttenuation);",""," vec4 color = vec4(intensity, intensity, intensity, 0.0) * lightColor;",""," gl_FragColor = vec4(color.rgb * lightColor.a, color.a);","}",""].join("\n")},54677:t=>{t.exports=["#define SHADER_NAME PHASER_POINTLIGHT_VS","","precision mediump float;","","uniform mat4 uProjectionMatrix;","","attribute vec2 inPosition;","attribute vec2 inLightPosition;","attribute vec4 inLightColor;","attribute float inLightRadius;","attribute float inLightAttenuation;","","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","","void main ()","{"," lightColor = inLightColor;"," lightRadius = inLightRadius;"," lightAttenuation = inLightAttenuation;"," lightPosition = uProjectionMatrix * vec4(inLightPosition, 1.0, 1.0);",""," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);","}",""].join("\n")},12569:t=>{t.exports=["#define SHADER_NAME PHASER_POSTFX_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","","varying vec2 outTexCoord;","","void main ()","{"," gl_FragColor = texture2D(uMainSampler, outTexCoord);","}",""].join("\n")},99365:t=>{t.exports=["#define SHADER_NAME PHASER_QUAD_VS","","precision mediump float;","","attribute vec2 inPosition;","attribute vec2 inTexCoord;","","varying vec2 outFragCoord;","varying vec2 outTexCoord;","","void main ()","{"," outFragCoord = inPosition.xy * 0.5 + 0.5;"," outTexCoord = inTexCoord;",""," gl_Position = vec4(inPosition, 0, 1);","}",""].join("\n")},85060:t=>{t.exports=["#define SHADER_NAME PHASER_SINGLE_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);",""," // Multiply texture tint"," vec4 color = texture * texel;",""," if (outTintEffect == 1.0)"," {"," // Solid color + texture alpha"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," // Solid color, no texture"," color = texel;"," }",""," gl_FragColor = color;","}",""].join("\n")},18166:t=>{t.exports=["#define SHADER_NAME PHASER_SINGLE_VS","","precision mediump float;","","uniform mat4 uProjectionMatrix;","","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexId;","attribute float inTintEffect;","attribute vec4 inTint;","","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);",""," outTexCoord = inTexCoord;"," outTint = inTint;"," outTintEffect = inTintEffect;","}",""].join("\n")},756:(t,e,i)=>{var s=i(55301),n=i(56694),r=i(6659),o=i(40444),a=i(97081),h=i(74181),l=i(2893),u=i(9229),c=i(72283),d=i(74118),p=i(90881),f=i(84314),v=i(93736),g=new n({Extends:r,initialize:function(t){r.call(this),this.game=t,this.canvas,this.canvasBounds=new d,this.parent=null,this.parentIsWindow=!1,this.parentSize=new p,this.gameSize=new p,this.baseSize=new p,this.displaySize=new p,this.scaleMode=s.SCALE_MODE.NONE,this.zoom=1,this._resetZoom=!1,this.displayScale=new v(1,1),this.autoRound=!1,this.autoCenter=s.CENTER.NO_CENTER,this.orientation=s.ORIENTATION.LANDSCAPE,this.fullscreen,this.fullscreenTarget=null,this._createdFullscreenTarget=!1,this.dirty=!1,this.resizeInterval=500,this._lastCheck=0,this._checkOrientation=!1,this.listeners={orientationChange:c,windowResize:c,fullScreenChange:c,fullScreenError:c}},preBoot:function(){this.parseConfig(this.game.config),this.game.events.once(a.BOOT,this.boot,this)},boot:function(){var t=this.game;this.canvas=t.canvas,this.fullscreen=t.device.fullscreen,this.scaleMode!==s.SCALE_MODE.RESIZE&&this.displaySize.setAspectMode(this.scaleMode),this.scaleMode===s.SCALE_MODE.NONE?this.resize(this.width,this.height):(this.getParentBounds(),this.parentSize.width>0&&this.parentSize.height>0&&this.displaySize.setParent(this.parentSize),this.refresh()),t.events.on(a.PRE_STEP,this.step,this),t.events.once(a.READY,this.refresh,this),t.events.once(a.DESTROY,this.destroy,this),this.startListeners()},parseConfig:function(t){this.getParent(t),this.getParentBounds();var e=t.width,i=t.height,n=t.scaleMode,r=t.zoom,o=t.autoRound;if("string"==typeof e){var a=this.parentSize.width;0===a&&(a=window.innerWidth);var h=parseInt(e,10)/100;e=Math.floor(a*h)}if("string"==typeof i){var l=this.parentSize.height;0===l&&(l=window.innerHeight);var c=parseInt(i,10)/100;i=Math.floor(l*c)}this.scaleMode=n,this.autoRound=o,this.autoCenter=t.autoCenter,this.resizeInterval=t.resizeInterval,o&&(e=Math.floor(e),i=Math.floor(i)),this.gameSize.setSize(e,i),r===s.ZOOM.MAX_ZOOM&&(r=this.getMaxZoom()),this.zoom=r,1!==r&&(this._resetZoom=!0),this.baseSize.setSize(e,i),o&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),t.minWidth>0&&this.displaySize.setMin(t.minWidth*r,t.minHeight*r),t.maxWidth>0&&this.displaySize.setMax(t.maxWidth*r,t.maxHeight*r),this.displaySize.setSize(e,i),this.orientation=u(e,i)},getParent:function(t){var e=t.parent;if(null!==e){if(this.parent=l(e),this.parentIsWindow=this.parent===document.body,t.expandParent&&t.scaleMode!==s.SCALE_MODE.NONE){var i=this.parent.getBoundingClientRect();(this.parentIsWindow||0===i.height)&&(document.documentElement.style.height="100%",document.body.style.height="100%",i=this.parent.getBoundingClientRect(),this.parentIsWindow||0!==i.height||(this.parent.style.overflow="hidden",this.parent.style.width="100%",this.parent.style.height="100%"))}t.fullscreenTarget&&!this.fullscreenTarget&&(this.fullscreenTarget=l(t.fullscreenTarget))}},getParentBounds:function(){if(!this.parent)return!1;var t=this.parentSize,e=this.parent.getBoundingClientRect();this.parentIsWindow&&this.game.device.os.iOS&&(e.height=h(!0));var i=e.width,s=e.height;if(t.width!==i||t.height!==s)return t.setSize(i,s),!0;if(this.canvas){var n=this.canvasBounds,r=this.canvas.getBoundingClientRect();if(r.x!==n.x||r.y!==n.y)return!0}return!1},lockOrientation:function(t){var e=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation;return!!e&&e.call(screen,t)},setParentSize:function(t,e){return this.parentSize.setSize(t,e),this.refresh()},setGameSize:function(t,e){var i=this.autoRound;i&&(t=Math.floor(t),e=Math.floor(e));var s=this.width,n=this.height;return this.gameSize.resize(t,e),this.baseSize.resize(t,e),i&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setAspectRatio(t/e),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height,this.refresh(s,n)},resize:function(t,e){var i=this.zoom,s=this.autoRound;s&&(t=Math.floor(t),e=Math.floor(e));var n=this.width,r=this.height;this.gameSize.resize(t,e),this.baseSize.resize(t,e),s&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(t*i,e*i),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height;var o=this.canvas.style,a=t*i,h=e*i;return s&&(a=Math.floor(a),h=Math.floor(h)),a===t&&h===e||(o.width=a+"px",o.height=h+"px"),this.refresh(n,r)},setZoom:function(t){return this.zoom=t,this._resetZoom=!0,this.refresh()},setMaxZoom:function(){return this.zoom=this.getMaxZoom(),this._resetZoom=!0,this.refresh()},refresh:function(t,e){void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.updateScale(),this.updateBounds(),this.updateOrientation(),this.displayScale.set(this.baseSize.width/this.canvasBounds.width,this.baseSize.height/this.canvasBounds.height);var i=this.game.domContainer;if(i){this.baseSize.setCSS(i);var s=this.canvas.style,n=i.style;n.transform="scale("+this.displaySize.width/this.baseSize.width+","+this.displaySize.height/this.baseSize.height+")",n.marginLeft=s.marginLeft,n.marginTop=s.marginTop}return this.emit(o.RESIZE,this.gameSize,this.baseSize,this.displaySize,t,e),this},updateOrientation:function(){if(this._checkOrientation){this._checkOrientation=!1;var t=u(this.width,this.height);t!==this.orientation&&(this.orientation=t,this.emit(o.ORIENTATION_CHANGE,t))}},updateScale:function(){var t,e,i=this.canvas.style,n=this.gameSize.width,r=this.gameSize.height,o=this.zoom,a=this.autoRound;this.scaleMode===s.SCALE_MODE.NONE?(this.displaySize.setSize(n*o,r*o),t=this.displaySize.width,e=this.displaySize.height,a&&(t=Math.floor(t),e=Math.floor(e)),this._resetZoom&&(i.width=t+"px",i.height=e+"px",this._resetZoom=!1)):this.scaleMode===s.SCALE_MODE.RESIZE?(this.displaySize.setSize(this.parentSize.width,this.parentSize.height),this.gameSize.setSize(this.displaySize.width,this.displaySize.height),this.baseSize.setSize(this.displaySize.width,this.displaySize.height),t=this.displaySize.width,e=this.displaySize.height,a&&(t=Math.floor(t),e=Math.floor(e)),this.canvas.width=t,this.canvas.height=e):(this.displaySize.setSize(this.parentSize.width,this.parentSize.height),t=this.displaySize.width,e=this.displaySize.height,a&&(t=Math.floor(t),e=Math.floor(e)),i.width=t+"px",i.height=e+"px"),this.getParentBounds(),this.updateCenter()},getMaxZoom:function(){var t=f(this.parentSize.width,this.gameSize.width,0,!0),e=f(this.parentSize.height,this.gameSize.height,0,!0);return Math.max(Math.min(t,e),1)},updateCenter:function(){var t=this.autoCenter;if(t!==s.CENTER.NO_CENTER){var e=this.canvas,i=e.style,n=e.getBoundingClientRect(),r=n.width,o=n.height,a=Math.floor((this.parentSize.width-r)/2),h=Math.floor((this.parentSize.height-o)/2);t===s.CENTER.CENTER_HORIZONTALLY?h=0:t===s.CENTER.CENTER_VERTICALLY&&(a=0),i.marginLeft=a+"px",i.marginTop=h+"px"}},updateBounds:function(){var t=this.canvasBounds,e=this.canvas.getBoundingClientRect();t.x=e.left+(window.pageXOffset||0)-(document.documentElement.clientLeft||0),t.y=e.top+(window.pageYOffset||0)-(document.documentElement.clientTop||0),t.width=e.width,t.height=e.height},transformX:function(t){return(t-this.canvasBounds.left)*this.displayScale.x},transformY:function(t){return(t-this.canvasBounds.top)*this.displayScale.y},startFullscreen:function(t){void 0===t&&(t={navigationUI:"hide"});var e=this.fullscreen;if(e.available){if(!e.active){var i=this.getFullscreenTarget();e.keyboard?i[e.request](Element.ALLOW_KEYBOARD_INPUT):i[e.request](t)}}else this.emit(o.FULLSCREEN_UNSUPPORTED)},fullscreenSuccessHandler:function(){this.getParentBounds(),this.refresh(),this.emit(o.ENTER_FULLSCREEN)},fullscreenErrorHandler:function(t){this.removeFullscreenTarget(),this.emit(o.FULLSCREEN_FAILED,t)},getFullscreenTarget:function(){if(!this.fullscreenTarget){var t=document.createElement("div");t.style.margin="0",t.style.padding="0",t.style.width="100%",t.style.height="100%",this.fullscreenTarget=t,this._createdFullscreenTarget=!0}this._createdFullscreenTarget&&(this.canvas.parentNode.insertBefore(this.fullscreenTarget,this.canvas),this.fullscreenTarget.appendChild(this.canvas));return this.fullscreenTarget},removeFullscreenTarget:function(){if(this._createdFullscreenTarget){var t=this.fullscreenTarget;if(t&&t.parentNode){var e=t.parentNode;e.insertBefore(this.canvas,t),e.removeChild(t)}}},stopFullscreen:function(){var t=this.fullscreen;if(!t.available)return this.emit(o.FULLSCREEN_UNSUPPORTED),!1;t.active&&document[t.cancel](),this.removeFullscreenTarget(),this.getParentBounds(),this.emit(o.LEAVE_FULLSCREEN),this.refresh()},toggleFullscreen:function(t){this.fullscreen.active?this.stopFullscreen():this.startFullscreen(t)},startListeners:function(){var t=this,e=this.listeners;if(e.orientationChange=function(){t.updateBounds(),t._checkOrientation=!0,t.dirty=!0},e.windowResize=function(){t.updateBounds(),t.dirty=!0},window.addEventListener("orientationchange",e.orientationChange,!1),window.addEventListener("resize",e.windowResize,!1),this.fullscreen.available){e.fullScreenChange=function(e){return t.onFullScreenChange(e)},e.fullScreenError=function(e){return t.onFullScreenError(e)};["webkit","moz",""].forEach((function(t){document.addEventListener(t+"fullscreenchange",e.fullScreenChange,!1),document.addEventListener(t+"fullscreenerror",e.fullScreenError,!1)})),document.addEventListener("MSFullscreenChange",e.fullScreenChange,!1),document.addEventListener("MSFullscreenError",e.fullScreenError,!1)}},onFullScreenChange:function(){document.fullscreenElement||document.webkitFullscreenElement||document.msFullscreenElement||document.mozFullScreenElement?this.fullscreenSuccessHandler():this.stopFullscreen()},onFullScreenError:function(){this.removeFullscreenTarget()},getViewPort:function(t){void 0===t&&(t=new d);var e,i,s=this.baseSize,n=this.parentSize,r=this.canvasBounds,o=this.displayScale,a=r.x>=0?0:-r.x*o.x,h=r.y>=0?0:-r.y*o.y;return e=n.width>=r.width?s.width:s.width-(r.width-n.width)*o.x,i=n.height>=r.height?s.height:s.height-(r.height-n.height)*o.y,t.setTo(a,h,e,i),t},step:function(t,e){this.parent&&(this._lastCheck+=e,(this.dirty||this._lastCheck>this.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var t=this.listeners;window.removeEventListener("orientationchange",t.orientationChange,!1),window.removeEventListener("resize",t.windowResize,!1);["webkit","moz",""].forEach((function(e){document.removeEventListener(e+"fullscreenchange",t.fullScreenChange,!1),document.removeEventListener(e+"fullscreenerror",t.fullScreenError,!1)})),document.removeEventListener("MSFullscreenChange",t.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",t.fullScreenError,!1)},destroy:function(){this.removeAllListeners(),this.stopListeners(),this.game=null,this.canvas=null,this.canvasBounds=null,this.parent=null,this.fullscreenTarget=null,this.parentSize.destroy(),this.gameSize.destroy(),this.baseSize.destroy(),this.displaySize.destroy()},isFullscreen:{get:function(){return this.fullscreen.active}},width:{get:function(){return this.gameSize.width}},height:{get:function(){return this.gameSize.height}},isPortrait:{get:function(){return this.orientation===s.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===s.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});t.exports=g},35098:t=>{t.exports={NO_CENTER:0,CENTER_BOTH:1,CENTER_HORIZONTALLY:2,CENTER_VERTICALLY:3}},53539:t=>{t.exports={LANDSCAPE:"landscape-primary",PORTRAIT:"portrait-primary"}},12637:t=>{t.exports={NONE:0,WIDTH_CONTROLS_HEIGHT:1,HEIGHT_CONTROLS_WIDTH:2,FIT:3,ENVELOP:4,RESIZE:5}},10217:t=>{t.exports={NO_ZOOM:1,ZOOM_2X:2,ZOOM_4X:4,MAX_ZOOM:-1}},55301:(t,e,i)=>{var s={CENTER:i(35098),ORIENTATION:i(53539),SCALE_MODE:i(12637),ZOOM:i(10217)};t.exports=s},82085:t=>{t.exports="enterfullscreen"},11826:t=>{t.exports="fullscreenfailed"},56691:t=>{t.exports="fullscreenunsupported"},34739:t=>{t.exports="leavefullscreen"},26681:t=>{t.exports="orientationchange"},11428:t=>{t.exports="resize"},40444:(t,e,i)=>{t.exports={ENTER_FULLSCREEN:i(82085),FULLSCREEN_FAILED:i(11826),FULLSCREEN_UNSUPPORTED:i(56691),LEAVE_FULLSCREEN:i(34739),ORIENTATION_CHANGE:i(26681),RESIZE:i(11428)}},86754:(t,e,i)=>{var s=i(98611),n=i(55301),r={Center:i(35098),Events:i(40444),Orientation:i(53539),ScaleManager:i(756),ScaleModes:i(12637),Zoom:i(10217)};r=s(!1,r,n.CENTER),r=s(!1,r,n.ORIENTATION),r=s(!1,r,n.SCALE_MODE),r=s(!1,r,n.ZOOM),t.exports=r},47736:(t,e,i)=>{var s=i(72632),n=i(40587);t.exports=function(t){var e=t.game.config.defaultPhysicsSystem,i=s(t.settings,"physics",!1);if(e||i){var r=[];if(e&&r.push(n(e+"Physics")),i)for(var o in i)o=n(o.concat("Physics")),-1===r.indexOf(o)&&r.push(o);return r}}},91088:(t,e,i)=>{var s=i(72632);t.exports=function(t){var e=t.plugins.getDefaultScenePlugins(),i=s(t.settings,"plugins",!1);return Array.isArray(i)?i:e||[]}},90415:t=>{t.exports={game:"game",renderer:"renderer",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",scale:"scale",sound:"sound",textures:"textures",events:"events",cameras:"cameras",add:"add",make:"make",scenePlugin:"scene",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",impactPhysics:"impact",matterPhysics:"matter"}},87157:(t,e,i)=>{var s=i(56694),n=i(63946),r=new s({initialize:function(t){this.sys=new n(this,t),this.game,this.anims,this.cache,this.registry,this.sound,this.textures,this.events,this.cameras,this.add,this.make,this.scene,this.children,this.lights,this.data,this.input,this.load,this.time,this.tweens,this.physics,this.matter,this.scale,this.plugins,this.renderer},update:function(){}});t.exports=r},13553:(t,e,i)=>{var s=i(56694),n=i(92980),r=i(7599),o=i(97081),a=i(10850),h=i(683),l=i(72283),u=i(87157),c=i(63946),d=new s({initialize:function(t,e){if(this.game=t,this.keys={},this.scenes=[],this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,this.customViewports=0,e){Array.isArray(e)||(e=[e]);for(var i=0;i-1&&(delete this.keys[s],this.scenes.splice(i,1),this._start.indexOf(s)>-1&&(i=this._start.indexOf(s),this._start.splice(i,1)),e.sys.destroy())}return this},bootScene:function(t){var e,i=t.sys,s=i.settings;i.sceneUpdate=l,t.init&&(t.init.call(t,s.data),s.status=n.INIT,s.isTransition&&i.events.emit(r.TRANSITION_INIT,s.transitionFrom,s.transitionDuration)),i.load&&(e=i.load).reset(),e&&t.preload?(t.preload.call(t),s.status=n.LOADING,e.once(h.COMPLETE,this.loadComplete,this),e.start()):this.create(t)},loadComplete:function(t){this.create(t.scene)},payloadComplete:function(t){this.bootScene(t.scene)},update:function(t,e){this.processQueue(),this.isProcessing=!0;for(var i=this.scenes.length-1;i>=0;i--){var s=this.scenes[i].sys;s.settings.status>n.START&&s.settings.status<=n.RUNNING&&s.step(t,e)}},render:function(t){for(var e=0;e=n.LOADING&&i.settings.status0){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.unshift(i)}}return this},moveDown:function(t){if(this.isProcessing)this._queue.push({op:"moveDown",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e>0){var i=e-1,s=this.getScene(t),n=this.getAt(i);this.scenes[e]=n,this.scenes[i]=s}}return this},moveUp:function(t){if(this.isProcessing)this._queue.push({op:"moveUp",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e{var s=i(82897),n=i(56694),r=i(7599),o=i(72632),a=i(91963),h=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.key=t.sys.settings.key,this.manager=t.sys.game.scene,this.transitionProgress=0,this._elapsed=0,this._target=null,this._duration=0,this._onUpdate,this._onUpdateScope,this._willSleep=!1,this._willRemove=!1,t.sys.events.once(r.BOOT,this.boot,this),t.sys.events.on(r.START,this.pluginStart,this)},boot:function(){this.systems.events.once(r.DESTROY,this.destroy,this)},pluginStart:function(){this._target=null,this.systems.events.once(r.SHUTDOWN,this.shutdown,this)},start:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",this.key),this.manager.queueOp("start",t,e),this},restart:function(t){var e=this.key;return this.manager.queueOp("stop",e),this.manager.queueOp("start",e,t),this},transition:function(t){void 0===t&&(t={});var e=o(t,"target",!1),i=this.manager.getScene(e);if(!e||!this.checkValidTransition(i))return!1;var s=o(t,"duration",1e3);this._elapsed=0,this._target=i,this._duration=s,this._willSleep=o(t,"sleep",!1),this._willRemove=o(t,"remove",!1);var n=o(t,"onUpdate",null);n&&(this._onUpdate=n,this._onUpdateScope=o(t,"onUpdateScope",this.scene));var a=o(t,"allowInput",!1);this.settings.transitionAllowInput=a;var h=i.sys.settings;return h.isTransition=!0,h.transitionFrom=this.scene,h.transitionDuration=s,h.transitionAllowInput=a,o(t,"moveAbove",!1)?this.manager.moveAbove(this.key,e):o(t,"moveBelow",!1)&&this.manager.moveBelow(this.key,e),i.sys.isSleeping()?i.sys.wake(o(t,"data")):this.manager.start(e,o(t,"data")),this.systems.events.emit(r.TRANSITION_OUT,i,s),this.systems.events.on(r.UPDATE,this.step,this),!0},checkValidTransition:function(t){return!(!t||t.sys.isActive()||t.sys.isTransitioning()||t===this.scene||this.systems.isTransitioning())},step:function(t,e){this._elapsed+=e,this.transitionProgress=s(this._elapsed/this._duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.transitionProgress),this._elapsed>=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;this.systems.events.off(r.UPDATE,this.step,this),t.events.emit(r.TRANSITION_COMPLETE,this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i,s){return this.manager.add(t,e,i,s)},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t){return t!==this.key&&this.manager.queueOp("switch",this.key,t),this},stop:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t,e),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var s=this.manager.getScene(e);return s&&s.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isPaused:function(t){return void 0===t&&(t=this.key),this.manager.isPaused(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off(r.SHUTDOWN,this.shutdown,this),t.off(r.POST_UPDATE,this.step,this),t.off(r.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});a.register("ScenePlugin",h,"scenePlugin"),t.exports=h},36765:(t,e,i)=>{var s=i(92980),n=i(10850),r=i(30657),o=i(90415),a={create:function(t){return"string"==typeof t?t={key:t}:void 0===t&&(t={}),{status:s.PENDING,key:n(t,"key",""),active:n(t,"active",!1),visible:n(t,"visible",!0),isBooted:!1,isTransition:!1,transitionFrom:null,transitionDuration:0,transitionAllowInput:!0,data:{},pack:n(t,"pack",!1),cameras:n(t,"cameras",null),map:n(t,"map",r(o,n(t,"mapAdd",{}))),physics:n(t,"physics",{}),loader:n(t,"loader",{}),plugins:n(t,"plugins",!1),input:n(t,"input",{})}}};t.exports=a},63946:(t,e,i)=>{var s=i(56694),n=i(92980),r=i(18360),o=i(7599),a=i(47736),h=i(91088),l=i(86459),u=i(72283),c=i(36765),d=new s({initialize:function(t,e){this.scene=t,this.game,this.renderer,this.config=e,this.settings=c.create(e),this.canvas,this.context,this.anims,this.cache,this.plugins,this.registry,this.scale,this.sound,this.textures,this.add,this.cameras,this.displayList,this.events,this.make,this.scenePlugin,this.updateList,this.sceneUpdate=u},init:function(t){this.settings.status=n.INIT,this.sceneUpdate=u,this.game=t,this.renderer=t.renderer,this.canvas=t.canvas,this.context=t.context;var e=t.plugins;this.plugins=e,e.addToScene(this,r.Global,[r.CoreScene,h(this),a(this)]),this.events.emit(o.BOOT,this),this.settings.isBooted=!0},step:function(t,e){var i=this.events;i.emit(o.PRE_UPDATE,t,e),i.emit(o.UPDATE,t,e),this.sceneUpdate.call(this.scene,t,e),i.emit(o.POST_UPDATE,t,e)},render:function(t){var e=this.displayList;e.depthSort(),this.events.emit(o.PRE_RENDER,t),this.cameras.render(t,e),this.events.emit(o.RENDER,t)},queueDepthSort:function(){this.displayList.queueDepthSort()},depthSort:function(){this.displayList.depthSort()},pause:function(t){var e=this.events,i=this.settings;return this.settings.active&&(i.status=n.PAUSED,i.active=!1,e.emit(o.PAUSE,this,t)),this},resume:function(t){var e=this.events,i=this.settings;return this.settings.active||(i.status=n.RUNNING,i.active=!0,e.emit(o.RESUME,this,t)),this},sleep:function(t){var e=this.events,i=this.settings;return i.status=n.SLEEPING,i.active=!1,i.visible=!1,e.emit(o.SLEEP,this,t),this},wake:function(t){var e=this.events,i=this.settings;return i.status=n.RUNNING,i.active=!0,i.visible=!0,e.emit(o.WAKE,this,t),i.isTransition&&e.emit(o.TRANSITION_WAKE,i.transitionFrom,i.transitionDuration),this},getData:function(){return this.settings.data},isSleeping:function(){return this.settings.status===n.SLEEPING},isActive:function(){return this.settings.status===n.RUNNING},isPaused:function(){return this.settings.status===n.PAUSED},isTransitioning:function(){return this.settings.isTransition||null!==this.scenePlugin._target},isTransitionOut:function(){return null!==this.scenePlugin._target&&this.scenePlugin._duration>0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(t){return this.settings.visible=t,this},setActive:function(t,e){return t?this.resume(e):this.pause(e)},start:function(t){var e=this.events,i=this.settings;t&&(i.data=t),i.status=n.START,i.active=!0,i.visible=!0,e.emit(o.START,this),e.emit(o.READY,this,t)},shutdown:function(t){var e=this.events,i=this.settings;e.off(o.TRANSITION_INIT),e.off(o.TRANSITION_START),e.off(o.TRANSITION_COMPLETE),e.off(o.TRANSITION_OUT),i.status=n.SHUTDOWN,i.active=!1,i.visible=!1,this.renderer===l.WEBGL&&this.renderer.resetTextures(!0),e.emit(o.SHUTDOWN,this,t)},destroy:function(){var t=this.events,e=this.settings;e.status=n.DESTROYED,e.active=!1,e.visible=!1,t.emit(o.DESTROY,this),t.removeAllListeners();for(var i=["scene","game","anims","cache","plugins","registry","sound","textures","add","camera","displayList","events","make","scenePlugin","updateList"],s=0;s{t.exports={PENDING:0,INIT:1,START:2,LOADING:3,CREATING:4,RUNNING:5,PAUSED:6,SLEEPING:7,SHUTDOWN:8,DESTROYED:9}},31803:t=>{t.exports="addedtoscene"},94817:t=>{t.exports="boot"},28977:t=>{t.exports="create"},91959:t=>{t.exports="destroy"},363:t=>{t.exports="pause"},15643:t=>{t.exports="postupdate"},17058:t=>{t.exports="prerender"},77125:t=>{t.exports="preupdate"},76018:t=>{t.exports="ready"},28620:t=>{t.exports="removedfromscene"},41538:t=>{t.exports="render"},34268:t=>{t.exports="resume"},2342:t=>{t.exports="shutdown"},96541:t=>{t.exports="sleep"},74244:t=>{t.exports="start"},17046:t=>{t.exports="transitioncomplete"},13637:t=>{t.exports="transitioninit"},14733:t=>{t.exports="transitionout"},33899:t=>{t.exports="transitionstart"},52418:t=>{t.exports="transitionwake"},31735:t=>{t.exports="update"},8470:t=>{t.exports="wake"},7599:(t,e,i)=>{t.exports={ADDED_TO_SCENE:i(31803),BOOT:i(94817),CREATE:i(28977),DESTROY:i(91959),PAUSE:i(363),POST_UPDATE:i(15643),PRE_RENDER:i(17058),PRE_UPDATE:i(77125),READY:i(76018),REMOVED_FROM_SCENE:i(28620),RENDER:i(41538),RESUME:i(34268),SHUTDOWN:i(2342),SLEEP:i(96541),START:i(74244),TRANSITION_COMPLETE:i(17046),TRANSITION_INIT:i(13637),TRANSITION_OUT:i(14733),TRANSITION_START:i(33899),TRANSITION_WAKE:i(52418),UPDATE:i(31735),WAKE:i(8470)}},20436:(t,e,i)=>{var s=i(92980),n=i(98611),r={Events:i(7599),GetPhysicsPlugins:i(47736),GetScenePlugins:i(91088),SceneManager:i(13553),ScenePlugin:i(64051),Settings:i(36765),Systems:i(63946)};r=n(!1,r,s),t.exports=r},25798:(t,e,i)=>{var s=i(56694),n=i(6659),r=i(76038),o=i(98611),a=i(72283),h=new s({Extends:n,initialize:function(t,e,i){n.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=this.duration||0,this.totalDuration=this.totalDuration||0,this.config={mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0},this.currentConfig=this.config,this.config=o(this.config,i),this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(console.error("addMarker "+t.name+" already exists in Sound"),!1):(t=o(!0,{name:"",start:0,duration:this.totalDuration-(t.start||0),config:{mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0}},t),this.markers[t.name]=t,!0))},updateMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(this.markers[t.name]=o(!0,this.markers[t.name],t),!0):(console.warn("Audio Marker: "+t.name+" missing in Sound: "+this.key),!1))},removeMarker:function(t){var e=this.markers[t];return e?(this.markers[t]=null,e):null},play:function(t,e){if(void 0===t&&(t=""),"object"==typeof t&&(e=t,t=""),"string"!=typeof t)return!1;if(t){if(!this.markers[t])return console.warn("Marker: "+t+" missing in Sound: "+this.key),!1;this.currentMarker=this.markers[t],this.currentConfig=this.currentMarker.config,this.duration=this.currentMarker.duration}else this.currentMarker=null,this.currentConfig=this.config,this.duration=this.totalDuration;return this.resetConfig(),this.currentConfig=o(this.currentConfig,e),this.isPlaying=!0,this.isPaused=!1,!0},pause:function(){return!(this.isPaused||!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!0,!0)},resume:function(){return!(!this.isPaused||this.isPlaying)&&(this.isPlaying=!0,this.isPaused=!1,!0)},stop:function(){return!(!this.isPaused&&!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!1,this.resetConfig(),!0)},applyConfig:function(){this.mute=this.currentConfig.mute,this.volume=this.currentConfig.volume,this.rate=this.currentConfig.rate,this.detune=this.currentConfig.detune,this.loop=this.currentConfig.loop,this.pan=this.currentConfig.pan},resetConfig:function(){this.currentConfig.seek=0,this.currentConfig.delay=0},update:a,calculateRate:function(){var t=this.currentConfig.detune+this.manager.detune,e=Math.pow(1.0005777895065548,t);this.totalRate=this.currentConfig.rate*this.manager.rate*e},destroy:function(){this.pendingRemove||(this.emit(r.DESTROY,this),this.pendingRemove=!0,this.manager=null,this.key="",this.removeAllListeners(),this.isPlaying=!1,this.isPaused=!1,this.config=null,this.currentConfig=null,this.markers=null,this.currentMarker=null)}});t.exports=h},12486:(t,e,i)=>{var s=i(56694),n=i(32742),r=i(6659),o=i(76038),a=i(97081),h=i(72283),l=i(71608),u=i(51463),c=new s({Extends:r,initialize:function(t){r.call(this),this.game=t,this.jsonCache=t.cache.json,this.sounds=[],this.mute=!1,this.volume=1,this.pauseOnBlur=!0,this._rate=1,this._detune=0,this.locked=this.locked||!1,this.unlocked=!1,t.events.on(a.BLUR,this.onGameBlur,this),t.events.on(a.FOCUS,this.onGameFocus,this),t.events.on(a.PRE_STEP,this.update,this),t.events.once(a.DESTROY,this.destroy,this)},add:h,addAudioSprite:function(t,e){void 0===e&&(e={});var i=this.add(t,e);for(var s in i.spritemap=this.jsonCache.get(t).spritemap,i.spritemap)if(i.spritemap.hasOwnProperty(s)){var r=n(e),o=i.spritemap[s];r.loop=!!o.hasOwnProperty("loop")&&o.loop,i.addMarker({name:s,start:o.start,duration:o.end-o.start,config:r})}return i},get:function(t){return u(this.sounds,"key",t)},getAll:function(t){return l(this.sounds,"key",t)},play:function(t,e){var i=this.add(t);return i.once(o.COMPLETE,i.destroy,i),e?e.name?(i.addMarker(e),i.play(e.name)):i.play(e):i.play()},playAudioSprite:function(t,e,i){var s=this.addAudioSprite(t);return s.once(o.COMPLETE,s.destroy,s),s.play(e,i)},remove:function(t){var e=this.sounds.indexOf(t);return-1!==e&&(t.destroy(),this.sounds.splice(e,1),!0)},removeAll:function(){this.sounds.forEach((function(t){t.destroy()})),this.sounds.length=0},removeByKey:function(t){for(var e=0,i=this.sounds.length-1;i>=0;i--){var s=this.sounds[i];s.key===t&&(s.destroy(),this.sounds.splice(i,1),e++)}return e},pauseAll:function(){this.forEachActiveSound((function(t){t.pause()})),this.emit(o.PAUSE_ALL,this)},resumeAll:function(){this.forEachActiveSound((function(t){t.resume()})),this.emit(o.RESUME_ALL,this)},stopAll:function(){this.forEachActiveSound((function(t){t.stop()})),this.emit(o.STOP_ALL,this)},stopByKey:function(t){var e=0;return this.getAll(t).forEach((function(t){t.stop()&&e++})),e},unlock:h,onBlur:h,onFocus:h,onGameBlur:function(){this.pauseOnBlur&&this.onBlur()},onGameFocus:function(){this.pauseOnBlur&&this.onFocus()},update:function(t,e){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit(o.UNLOCKED,this));for(var i=this.sounds.length-1;i>=0;i--)this.sounds[i].pendingRemove&&this.sounds.splice(i,1);this.sounds.forEach((function(i){i.update(t,e)}))},destroy:function(){this.game.events.off(a.BLUR,this.onGameBlur,this),this.game.events.off(a.FOCUS,this.onGameFocus,this),this.game.events.off(a.PRE_STEP,this.update,this),this.removeAllListeners(),this.removeAll(),this.sounds.length=0,this.sounds=null,this.game=null},forEachActiveSound:function(t,e){var i=this;this.sounds.forEach((function(s,n){s&&!s.pendingRemove&&t.call(e||i,s,n,i.sounds)}))},setRate:function(t){return this.rate=t,this},rate:{get:function(){return this._rate},set:function(t){this._rate=t,this.forEachActiveSound((function(t){t.calculateRate()})),this.emit(o.GLOBAL_RATE,this,t)}},setDetune:function(t){return this.detune=t,this},detune:{get:function(){return this._detune},set:function(t){this._detune=t,this.forEachActiveSound((function(t){t.calculateRate()})),this.emit(o.GLOBAL_DETUNE,this,t)}}});t.exports=c},84191:(t,e,i)=>{var s=i(27622),n=i(17546),r=i(55491),o={create:function(t){var e=t.config.audio,i=t.device.audio;return e.noAudio||!i.webAudio&&!i.audioData?new n(t):i.webAudio&&!e.disableWebAudio?new r(t):new s(t)}};t.exports=o},77578:t=>{t.exports="complete"},19679:t=>{t.exports="decodedall"},56951:t=>{t.exports="decoded"},16436:t=>{t.exports="destroy"},55154:t=>{t.exports="detune"},57818:t=>{t.exports="detune"},57890:t=>{t.exports="mute"},83022:t=>{t.exports="rate"},99170:t=>{t.exports="volume"},64289:t=>{t.exports="looped"},67214:t=>{t.exports="loop"},53128:t=>{t.exports="mute"},73078:t=>{t.exports="pan"},76763:t=>{t.exports="pauseall"},88426:t=>{t.exports="pause"},13765:t=>{t.exports="play"},80291:t=>{t.exports="rate"},11124:t=>{t.exports="resumeall"},55382:t=>{t.exports="resume"},71157:t=>{t.exports="seek"},31776:t=>{t.exports="stopall"},39450:t=>{t.exports="stop"},21939:t=>{t.exports="unlocked"},33019:t=>{t.exports="volume"},76038:(t,e,i)=>{t.exports={COMPLETE:i(77578),DECODED:i(56951),DECODED_ALL:i(19679),DESTROY:i(16436),DETUNE:i(55154),GLOBAL_DETUNE:i(57818),GLOBAL_MUTE:i(57890),GLOBAL_RATE:i(83022),GLOBAL_VOLUME:i(99170),LOOP:i(67214),LOOPED:i(64289),MUTE:i(53128),PAN:i(73078),PAUSE_ALL:i(76763),PAUSE:i(88426),PLAY:i(13765),RATE:i(80291),RESUME_ALL:i(11124),RESUME:i(55382),SEEK:i(71157),STOP_ALL:i(31776),STOP:i(39450),UNLOCKED:i(21939),VOLUME:i(33019)}},34350:(t,e,i)=>{var s=i(25798),n=i(56694),r=i(76038),o=i(82897),a=new n({Extends:s,initialize:function(t,e,i){if(void 0===i&&(i={}),this.tags=t.game.cache.audio.get(e),!this.tags)throw new Error('There is no audio asset with key "'+e+'" in the audio cache');this.audio=null,this.startTime=0,this.previousTime=0,this.duration=this.tags[0].duration,this.totalDuration=this.tags[0].duration,s.call(this,t,e,i)},play:function(t,e){return!this.manager.isLocked(this,"play",[t,e])&&(!!s.prototype.play.call(this,t,e)&&(!!this.pickAndPlayAudioTag()&&(this.emit(r.PLAY,this),!0)))},pause:function(){return!this.manager.isLocked(this,"pause")&&(!(this.startTime>0)&&(!!s.prototype.pause.call(this)&&(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit(r.PAUSE,this),!0)))},resume:function(){return!this.manager.isLocked(this,"resume")&&(!(this.startTime>0)&&(!!s.prototype.resume.call(this)&&(!!this.pickAndPlayAudioTag()&&(this.emit(r.RESUME,this),!0))))},stop:function(){return!this.manager.isLocked(this,"stop")&&(!!s.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit(r.STOP,this),!0))},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var t=this.currentConfig.seek,e=this.currentConfig.delay,i=(this.currentMarker?this.currentMarker.start:0)+t;return this.previousTime=i,this.audio.currentTime=i,this.applyConfig(),0===e?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+1e3*e,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var t=0;t0)this.startTime=i-this.manager.loopEndOffset?(this.audio.currentTime=e+Math.max(0,s-i),s=this.audio.currentTime):s=i)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit(r.COMPLETE,this);this.previousTime=s}},destroy:function(){s.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=o(this.currentConfig.volume*this.manager.volume,0,1))},calculateRate:function(){s.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(t){this.currentConfig.mute=t,this.manager.isLocked(this,"mute",t)||(this.updateMute(),this.emit(r.MUTE,this,t))}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.currentConfig.volume},set:function(t){this.currentConfig.volume=t,this.manager.isLocked(this,"volume",t)||(this.updateVolume(),this.emit(r.VOLUME,this,t))}},setVolume:function(t){return this.volume=t,this},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.manager.isLocked(this,r.RATE,t)||(this.calculateRate(),this.emit(r.RATE,this,t))}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.manager.isLocked(this,r.DETUNE,t)||(this.calculateRate(),this.emit(r.DETUNE,this,t))}},setDetune:function(t){return this.detune=t,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.isLocked(this,"seek",t)||this.startTime>0||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.isPlaying?(this.previousTime=t,this.audio.currentTime=t):this.isPaused&&(this.currentConfig.seek=t),this.emit(r.SEEK,this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.manager.isLocked(this,"loop",t)||(this.audio&&(this.audio.loop=t),this.emit(r.LOOP,this,t))}},setLoop:function(t){return this.loop=t,this},pan:{get:function(){return this.currentConfig.pan},set:function(t){this.currentConfig.pan=t,this.emit(r.PAN,this,t)}},setPan:function(t){return this.pan=t,this}});t.exports=a},27622:(t,e,i)=>{var s=i(12486),n=i(56694),r=i(76038),o=i(34350),a=new n({Extends:s,initialize:function(t){this.override=!0,this.audioPlayDelay=.1,this.loopEndOffset=.05,this.onBlurPausedSounds=[],this.locked="ontouchstart"in window,this.lockedActionsQueue=this.locked?[]:null,this._mute=!1,this._volume=1,s.call(this,t)},add:function(t,e){var i=new o(this,t,e);return this.sounds.push(i),i},unlock:function(){this.locked=!1;var t=this;if(this.game.cache.audio.entries.each((function(e,i){for(var s=0;s{t.exports={SoundManagerCreator:i(84191),Events:i(76038),BaseSound:i(25798),BaseSoundManager:i(12486),WebAudioSound:i(96008),WebAudioSoundManager:i(55491),HTML5AudioSound:i(34350),HTML5AudioSoundManager:i(27622),NoAudioSound:i(38662),NoAudioSoundManager:i(17546)}},38662:(t,e,i)=>{var s=i(25798),n=i(56694),r=i(6659),o=i(98611),a=function(){return!1},h=function(){return this},l=new n({Extends:r,initialize:function(t,e,i){void 0===i&&(i={}),r.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=0,this.totalDuration=0,this.config=o({mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0},i),this.currentConfig=this.config,this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.seek=0,this.loop=!1,this.pan=0,this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:a,updateMarker:a,removeMarker:function(){return null},play:a,pause:a,resume:a,stop:a,destroy:function(){s.prototype.destroy.call(this)},setMute:h,setVolume:h,setRate:h,setDetune:h,setSeek:h,setLoop:h,setPan:h});t.exports=l},17546:(t,e,i)=>{var s=i(12486),n=i(56694),r=i(6659),o=i(38662),a=i(72283),h=new n({Extends:r,initialize:function(t){r.call(this),this.game=t,this.sounds=[],this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.pauseOnBlur=!0,this.locked=!1},add:function(t,e){var i=new o(this,t,e);return this.sounds.push(i),i},addAudioSprite:function(t,e){var i=this.add(t,e);return i.spritemap={},i},play:function(t,e){return!1},playAudioSprite:function(t,e,i){return!1},remove:function(t){return s.prototype.remove.call(this,t)},removeByKey:function(t){return s.prototype.removeByKey.call(this,t)},pauseAll:a,resumeAll:a,stopAll:a,update:a,setRate:a,setDetune:a,setMute:a,setVolume:a,forEachActiveSound:function(t,e){s.prototype.forEachActiveSound.call(this,t,e)},destroy:function(){s.prototype.destroy.call(this)}});t.exports=h},96008:(t,e,i)=>{var s=i(25798),n=i(56694),r=i(76038),o=new n({Extends:s,initialize:function(t,e,i){if(void 0===i&&(i={}),this.audioBuffer=t.game.cache.audio.get(e),!this.audioBuffer)throw new Error('Audio key "'+e+'" missing from cache');this.source=null,this.loopSource=null,this.muteNode=t.context.createGain(),this.volumeNode=t.context.createGain(),this.pannerNode=null,this.playTime=0,this.startTime=0,this.loopTime=0,this.rateUpdates=[],this.hasEnded=!1,this.hasLooped=!1,this.muteNode.connect(this.volumeNode),t.context.createStereoPanner?(this.pannerNode=t.context.createStereoPanner(),this.volumeNode.connect(this.pannerNode),this.pannerNode.connect(t.destination)):this.volumeNode.connect(t.destination),this.duration=this.audioBuffer.duration,this.totalDuration=this.audioBuffer.duration,s.call(this,t,e,i)},play:function(t,e){return!!s.prototype.play.call(this,t,e)&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource(),this.emit(r.PLAY,this),!0)},pause:function(){return!(this.manager.context.currentTime{var s=i(82329),n=i(12486),r=i(56694),o=i(76038),a=i(97081),h=i(96008),l=new r({Extends:n,initialize:function(t){this.context=this.createAudioContext(t),this.masterMuteNode=this.context.createGain(),this.masterVolumeNode=this.context.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(this.context.destination),this.destination=this.masterMuteNode,this.locked="suspended"===this.context.state&&("ontouchstart"in window||"onclick"in window),n.call(this,t),this.locked&&t.isBooted?this.unlock():t.events.once(a.BOOT,this.unlock,this)},createAudioContext:function(t){var e=t.config.audio;return e.context?(e.context.resume(),e.context):window.hasOwnProperty("AudioContext")?new AudioContext:window.hasOwnProperty("webkitAudioContext")?new window.webkitAudioContext:void 0},setAudioContext:function(t){return this.context&&this.context.close(),this.masterMuteNode&&this.masterMuteNode.disconnect(),this.masterVolumeNode&&this.masterVolumeNode.disconnect(),this.context=t,this.masterMuteNode=t.createGain(),this.masterVolumeNode=t.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(t.destination),this.destination=this.masterMuteNode,this},add:function(t,e){var i=new h(this,t,e);return this.sounds.push(i),i},decodeAudio:function(t,e){var i;i=Array.isArray(t)?t:[{key:t,data:e}];for(var n=this.game.cache.audio,r=i.length,a=0;a{var s=i(59959),n=i(56694),r=i(72283),o=i(17922),a=new n({initialize:function(t){this.parent=t,this.list=[],this.position=0,this.addCallback=r,this.removeCallback=r,this._sortKey=""},add:function(t,e){return e?s.Add(this.list,t):s.Add(this.list,t,0,this.addCallback,this)},addAt:function(t,e,i){return i?s.AddAt(this.list,t,e):s.AddAt(this.list,t,e,0,this.addCallback,this)},getAt:function(t){return this.list[t]},getIndex:function(t){return this.list.indexOf(t)},sort:function(t,e){return t?(void 0===e&&(e=function(e,i){return e[t]-i[t]}),o(this.list,e),this):this},getByName:function(t){return s.GetFirst(this.list,"name",t)},getRandom:function(t,e){return s.GetRandom(this.list,t,e)},getFirst:function(t,e,i,n){return s.GetFirst(this.list,t,e,i,n)},getAll:function(t,e,i,n){return s.GetAll(this.list,t,e,i,n)},count:function(t,e){return s.CountAllMatching(this.list,t,e)},swap:function(t,e){s.Swap(this.list,t,e)},moveTo:function(t,e){return s.MoveTo(this.list,t,e)},moveAbove:function(t,e){return s.MoveAbove(this.list,t,e)},moveBelow:function(t,e){return s.MoveBelow(this.list,t,e)},remove:function(t,e){return e?s.Remove(this.list,t):s.Remove(this.list,t,this.removeCallback,this)},removeAt:function(t,e){return e?s.RemoveAt(this.list,t):s.RemoveAt(this.list,t,this.removeCallback,this)},removeBetween:function(t,e,i){return i?s.RemoveBetween(this.list,t,e):s.RemoveBetween(this.list,t,e,this.removeCallback,this)},removeAll:function(t){for(var e=this.list.length;e--;)this.remove(this.list[e],t);return this},bringToTop:function(t){return s.BringToTop(this.list,t)},sendToBack:function(t){return s.SendToBack(this.list,t)},moveUp:function(t){return s.MoveUp(this.list,t),t},moveDown:function(t){return s.MoveDown(this.list,t),t},reverse:function(){return this.list.reverse(),this},shuffle:function(){return s.Shuffle(this.list),this},replace:function(t,e){return s.Replace(this.list,t,e)},exists:function(t){return this.list.indexOf(t)>-1},setAll:function(t,e,i,n){return s.SetAll(this.list,t,e,i,n),this},each:function(t,e){for(var i=[null],s=2;s0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}}});t.exports=a},33885:(t,e,i)=>{var s=new(i(56694))({initialize:function(t){if(this.entries={},this.size=0,Array.isArray(t))for(var e=0;e{var s=i(56694),n=i(6659),r=i(36716),o=new s({Extends:n,initialize:function(){n.call(this),this._pending=[],this._active=[],this._destroy=[],this._toProcess=0,this.checkQueue=!1},add:function(t){return this._pending.push(t),this._toProcess++,t},remove:function(t){return this._destroy.push(t),this._toProcess++,t},removeAll:function(){for(var t=this._active,e=this._destroy,i=t.length;i--;)e.push(t[i]),this._toProcess++;return this},update:function(){if(0===this._toProcess)return this._active;var t,e,i=this._destroy,s=this._active;for(t=0;t{var s=i(53466);function n(t){if(!(this instanceof n))return new n(t,[".left",".top",".right",".bottom"]);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}function r(t,e,i){if(!i)return e.indexOf(t);for(var s=0;s=t.minX&&e.maxY>=t.minY}function v(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(t,e,i,n,r){for(var o,a=[e,i];a.length;)(i=a.pop())-(e=a.pop())<=n||(o=e+Math.ceil((i-e)/n/2)*n,s(t,o,e,i,r),a.push(e,o,o,i))}n.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],s=this.toBBox;if(!f(t,e))return i;for(var n,r,o,a,h=[];e;){for(n=0,r=e.children.length;n=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(n,r,e)},_split:function(t,e){var i=t[e],s=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,s);var r=this._chooseSplitIndex(i,n,s),a=v(i.children.splice(r,i.children.length-r));a.height=i.height,a.leaf=i.leaf,o(i,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(t,e){this.data=v([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var s,n,r,o,h,l,u,d,p,f,v,g,m,y;for(l=u=1/0,s=e;s<=i-e;s++)n=a(t,0,s,this.toBBox),r=a(t,s,i,this.toBBox),p=n,f=r,v=void 0,g=void 0,m=void 0,y=void 0,v=Math.max(p.minX,f.minX),g=Math.max(p.minY,f.minY),m=Math.min(p.maxX,f.maxX),y=Math.min(p.maxY,f.maxY),o=Math.max(0,m-v)*Math.max(0,y-g),h=c(n)+c(r),o=e;n--)r=t.children[n],h(u,t.leaf?o(r):r),c+=d(u);return c},_adjustParentBBoxes:function(t,e,i){for(var s=i;s>=0;s--)h(e[s],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():o(t[i],this.toBBox)},compareMinX:function(t,e){return t.left-e.left},compareMinY:function(t,e){return t.top-e.top},toBBox:function(t){return{minX:t.left,minY:t.top,maxX:t.right,maxY:t.bottom}}},t.exports=n},58403:(t,e,i)=>{var s=new(i(56694))({initialize:function(t){if(this.entries=[],Array.isArray(t))for(var e=0;e-1&&this.entries.splice(e,1),this},dump:function(){console.group("Set");for(var t=0;t-1},union:function(t){var e=new s;return t.entries.forEach((function(t){e.set(t)})),this.entries.forEach((function(t){e.set(t)})),e},intersect:function(t){var e=new s;return this.entries.forEach((function(i){t.contains(i)&&e.set(i)})),e},difference:function(t){var e=new s;return this.entries.forEach((function(i){t.contains(i)||e.set(i)})),e},size:{get:function(){return this.entries.length},set:function(t){return t{var s=i(82897),n=i(56694),r=i(84314),o=i(93736),a=new n({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===s&&(s=null),this._width=t,this._height=e,this._parent=s,this.aspectMode=i,this.aspectRatio=0===e?1:t/e,this.minWidth=0,this.minHeight=0,this.maxWidth=Number.MAX_VALUE,this.maxHeight=Number.MAX_VALUE,this.snapTo=new o},setAspectMode:function(t){return void 0===t&&(t=0),this.aspectMode=t,this.setSize(this._width,this._height)},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.snapTo.set(t,e),this.setSize(this._width,this._height)},setParent:function(t){return this._parent=t,this.setSize(this._width,this._height)},setMin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.minWidth=s(t,0,this.maxWidth),this.minHeight=s(e,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(t,e){return void 0===t&&(t=Number.MAX_VALUE),void 0===e&&(e=t),this.maxWidth=s(t,this.minWidth,Number.MAX_VALUE),this.maxHeight=s(e,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(t,e){switch(void 0===t&&(t=0),void 0===e&&(e=t),this.aspectMode){case a.NONE:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height;break;case a.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case a.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(r(e,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case a.FIT:this.constrain(t,e,!0);break;case a.ENVELOP:this.constrain(t,e,!1)}return this},setAspectRatio:function(t){return this.aspectRatio=t,this.setSize(this._width,this._height)},resize:function(t,e){return this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height,this},getNewWidth:function(t,e){return void 0===e&&(e=!0),t=s(t,this.minWidth,this.maxWidth),e&&this._parent&&t>this._parent.width&&(t=Math.max(this.minWidth,this._parent.width)),t},getNewHeight:function(t,e){return void 0===e&&(e=!0),t=s(t,this.minHeight,this.maxHeight),e&&this._parent&&t>this._parent.height&&(t=Math.max(this.minHeight,this._parent.height)),t},constrain:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=!0),t=this.getNewWidth(t),e=this.getNewHeight(e);var s=this.snapTo,n=0===e?1:t/e;return i&&this.aspectRatio>n||!i&&this.aspectRatio0&&(t=(e=r(e,s.y))*this.aspectRatio)):(i&&this.aspectRation)&&(t=(e=r(e,s.y))*this.aspectRatio,s.x>0&&(e=(t=r(t,s.x))*(1/this.aspectRatio))),this._width=t,this._height=e,this},fitTo:function(t,e){return this.constrain(t,e,!0)},envelop:function(t,e){return this.constrain(t,e,!1)},setWidth:function(t){return this.setSize(t,this._height)},setHeight:function(t){return this.setSize(this._width,t)},toString:function(){return"[{ Size (width="+this._width+" height="+this._height+" aspectRatio="+this.aspectRatio+" aspectMode="+this.aspectMode+") }]"},setCSS:function(t){t&&t.style&&(t.style.width=this._width+"px",t.style.height=this._height+"px")},copy:function(t){return t.setAspectMode(this.aspectMode),t.aspectRatio=this.aspectRatio,t.setSize(this.width,this.height)},destroy:function(){this._parent=null,this.snapTo=null},width:{get:function(){return this._width},set:function(t){this.setSize(t,this._height)}},height:{get:function(){return this._height},set:function(t){this.setSize(this._width,t)}}});a.NONE=0,a.WIDTH_CONTROLS_HEIGHT=1,a.HEIGHT_CONTROLS_WIDTH=2,a.FIT=3,a.ENVELOP=4,t.exports=a},94160:t=>{t.exports="add"},95393:t=>{t.exports="remove"},36716:(t,e,i)=>{t.exports={PROCESS_QUEUE_ADD:i(94160),PROCESS_QUEUE_REMOVE:i(95393)}},20010:(t,e,i)=>{t.exports={Events:i(36716),List:i(71207),Map:i(33885),ProcessQueue:i(74623),RTree:i(68687),Set:i(58403),Size:i(90881)}},17487:(t,e,i)=>{var s=i(56694),n=i(82897),r=i(27119),o=i(86459),a=i(28621),h=i(31673),l=new s({Extends:h,initialize:function(t,e,i,s,n){h.call(this,t,e,i,s,n),this.add("__BASE",0,0,0,s,n),this._source=this.frames.__BASE.source,this.canvas=this._source.image,this.context=this.canvas.getContext("2d"),this.width=s,this.height=n,this.imageData=this.context.getImageData(0,0,s,n),this.data=null,this.imageData&&(this.data=this.imageData.data),this.pixels=null,this.buffer,this.data&&(this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data)},update:function(){return this.imageData=this.context.getImageData(0,0,this.width,this.height),this.data=this.imageData.data,this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data,this.manager.game.config.renderType===o.WEBGL&&this.refresh(),this},draw:function(t,e,i){return this.context.drawImage(i,t,e),this.update()},drawFrame:function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=0);var n=this.manager.getFrame(t,e);if(n){var r=n.canvasData,o=n.cutWidth,a=n.cutHeight,h=n.source.resolution;return this.context.drawImage(n.source.image,r.x,r.y,o,a,i,s,o/h,a/h),this.update()}return this},setPixel:function(t,e,i,s,n,r){if(void 0===r&&(r=255),t=Math.abs(Math.floor(t)),e=Math.abs(Math.floor(e)),this.getIndex(t,e)>-1){var o=this.context.getImageData(t,e,1,1);o.data[0]=i,o.data[1]=s,o.data[2]=n,o.data[3]=r,this.context.putImageData(o,t,e)}return this},putData:function(t,e,i,s,n,r,o){return void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=t.width),void 0===o&&(o=t.height),this.context.putImageData(t,e,i,s,n,r,o),this},getData:function(t,e,i,s){return t=n(Math.floor(t),0,this.width-1),e=n(Math.floor(e),0,this.height-1),i=n(i,1,this.width-t),s=n(s,1,this.height-e),this.context.getImageData(t,e,i,s)},getPixel:function(t,e,i){i||(i=new r);var s=this.getIndex(t,e);if(s>-1){var n=this.data,o=n[s+0],a=n[s+1],h=n[s+2],l=n[s+3];i.setTo(o,a,h,l)}return i},getPixels:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===s&&(s=i),t=Math.abs(Math.round(t)),e=Math.abs(Math.round(e));for(var o=n(t,0,this.width),a=n(t+i,0,this.width),h=n(e,0,this.height),l=n(e+s,0,this.height),u=new r,c=[],d=h;d{var s=i(56694),n=i(82897),r=i(98611),o=new s({initialize:function(t,e,i,s,n,r,o){this.texture=t,this.name=e,this.source=t.source[i],this.sourceIndex=i,this.glTexture=this.source.glTexture,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0}},this.setSize(r,o,s,n)},setSize:function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=0),this.cutX=i,this.cutY=s,this.cutWidth=t,this.cutHeight=e,this.width=t,this.height=e,this.halfWidth=Math.floor(.5*t),this.halfHeight=Math.floor(.5*e),this.centerX=Math.floor(t/2),this.centerY=Math.floor(e/2);var n=this.data,r=n.cut;r.x=i,r.y=s,r.w=t,r.h=e,r.r=i+t,r.b=s+e,n.sourceSize.w=t,n.sourceSize.h=e,n.spriteSourceSize.w=t,n.spriteSourceSize.h=e,n.radius=.5*Math.sqrt(t*t+e*e);var o=n.drawImage;return o.x=i,o.y=s,o.width=t,o.height=e,this.updateUVs()},setTrim:function(t,e,i,s,n,r){var o=this.data,a=o.spriteSourceSize;return o.trim=!0,o.sourceSize.w=t,o.sourceSize.h=e,a.x=i,a.y=s,a.w=n,a.h=r,a.r=i+n,a.b=s+r,this.x=i,this.y=s,this.width=n,this.height=r,this.halfWidth=.5*n,this.halfHeight=.5*r,this.centerX=Math.floor(n/2),this.centerY=Math.floor(r/2),this.updateUVs()},setCropUVs:function(t,e,i,s,r,o,a){var h=this.cutX,l=this.cutY,u=this.cutWidth,c=this.cutHeight,d=this.realWidth,p=this.realHeight,f=h+(e=n(e,0,d)),v=l+(i=n(i,0,p)),g=s=n(s,0,d-e),m=r=n(r,0,p-i),y=this.data;if(y.trim){var x=y.spriteSourceSize,T=e+(s=n(s,0,u-e)),w=i+(r=n(r,0,c-i));if(!(x.rT||x.y>w)){var b=Math.max(x.x,e),E=Math.max(x.y,i),S=Math.min(x.r,T)-b,A=Math.min(x.b,w)-E;g=S,m=A,f=o?h+(u-(b-x.x)-S):h+(b-x.x),v=a?l+(c-(E-x.y)-A):l+(E-x.y),e=b,i=E,s=S,r=A}else f=0,v=0,g=0,m=0}else o&&(f=h+(u-e-s)),a&&(v=l+(c-i-r));var _=this.source.width,C=this.source.height;return t.u0=Math.max(0,f/_),t.v0=Math.max(0,v/C),t.u1=Math.min(1,(f+g)/_),t.v1=Math.min(1,(v+m)/C),t.x=e,t.y=i,t.cx=f,t.cy=v,t.cw=g,t.ch=m,t.width=s,t.height=r,t.flipX=o,t.flipY=a,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},setUVs:function(t,e,i,s,n,r){var o=this.data.drawImage;return o.width=t,o.height=e,this.u0=i,this.v0=s,this.u1=n,this.v1=r,this},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,s=this.cutHeight,n=this.data.drawImage;n.width=i,n.height=s;var r=this.source.width,o=this.source.height;return this.u0=t/r,this.v0=e/o,this.u1=(t+i)/r,this.v1=(e+s)/o,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new o(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=r(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.source=null,this.texture=null,this.glTexture=null,this.customData=null,this.data=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=o},31673:(t,e,i)=>{var s=i(86459),n=i(56694),r=i(82047),o=i(32547),a='Texture "%s" has no frame "%s"',h=new n({initialize:function(t,e,i,s,n){Array.isArray(i)||(i=[i]),this.manager=t,this.key=e,this.source=[],this.dataSource=[],this.frames={},this.customData={},this.firstFrame="__BASE",this.frameTotal=0;for(var r=0;r{var s=i(61068),n=i(17487),r=i(56694),o=i(27119),a=i(86459),h=i(6659),l=i(38203),u=i(97081),c=i(52780),d=i(10850),p=i(69150),f=i(31673),v=new r({Extends:h,initialize:function(t){h.call(this),this.game=t,this.name="TextureManager",this.list={},this._tempCanvas=s.create2D(this,1,1),this._tempContext=this._tempCanvas.getContext("2d"),this._pending=0,t.events.once(u.BOOT,this.boot,this)},boot:function(){this._pending=3,this.on(l.LOAD,this.updatePending,this),this.on(l.ERROR,this.updatePending,this);var t=this.game.config;this.addBase64("__DEFAULT",t.defaultImage),this.addBase64("__MISSING",t.missingImage),this.addBase64("__WHITE",t.whiteImage),this.game.events.once(u.DESTROY,this.destroy,this)},updatePending:function(){this._pending--,0===this._pending&&(this.off(l.LOAD),this.off(l.ERROR),this.emit(l.READY))},checkKey:function(t){return!this.exists(t)||(console.error("Texture key already in use: "+t),!1)},remove:function(t){if("string"==typeof t){if(!this.exists(t))return console.warn("No texture found matching key: "+t),this;t=this.get(t)}return this.list.hasOwnProperty(t.key)&&(t.destroy(),this.emit(l.REMOVE,t.key)),this},removeKey:function(t){return this.list.hasOwnProperty(t)&&delete this.list[t],this},addBase64:function(t,e){if(this.checkKey(t)){var i=this,s=new Image;s.onerror=function(){i.emit(l.ERROR,t)},s.onload=function(){var e=i.create(t,s);p.Image(e,0),i.emit(l.ADD,t,e),i.emit(l.LOAD,t,e)},s.src=e}return this},getBase64:function(t,e,i,n){void 0===i&&(i="image/png"),void 0===n&&(n=.92);var r="",o=this.getFrame(t,e);if(o&&(o.source.isRenderTexture||o.source.isGLTexture))console.warn("Cannot getBase64 from WebGL Texture");else if(o){var a=o.canvasData,h=s.create2D(this,a.width,a.height);h.getContext("2d").drawImage(o.source.image,a.x,a.y,a.width,a.height,0,0,a.width,a.height),r=h.toDataURL(i,n),s.remove(h)}return r},addImage:function(t,e,i){var s=null;return this.checkKey(t)&&(s=this.create(t,e),p.Image(s,0),i&&s.setDataSource(i),this.emit(l.ADD,t,s)),s},addGLTexture:function(t,e,i,s){var n=null;return this.checkKey(t)&&(void 0===i&&(i=e.width),void 0===s&&(s=e.height),(n=this.create(t,e,i,s)).add("__BASE",0,0,0,i,s),this.emit(l.ADD,t,n)),n},addCompressedTexture:function(t,e,i){var s=null;if(this.checkKey(t)){if((s=this.create(t,e)).add("__BASE",0,0,0,e.width,e.height),i)if(Array.isArray(i))for(var n=0;n=r.x&&t=r.y&&e=r.x&&t=r.y&&e{var s=i(61068),n=i(56694),r=i(28621),o=i(27394),a=new n({initialize:function(t,e,i,s,n){void 0===n&&(n=!1);var a=t.manager.game;this.renderer=a.renderer,this.texture=t,this.source=e,this.image=e.compressed?null:e,this.compressionAlgorithm=e.compressed?e.format:null,this.resolution=1,this.width=i||e.naturalWidth||e.videoWidth||e.width||0,this.height=s||e.naturalHeight||e.videoHeight||e.height||0,this.scaleMode=o.DEFAULT,this.isCanvas=e instanceof HTMLCanvasElement,this.isVideo=window.hasOwnProperty("HTMLVideoElement")&&e instanceof HTMLVideoElement,this.isRenderTexture="RenderTexture"===e.type,this.isGLTexture=window.hasOwnProperty("WebGLTexture")&&e instanceof WebGLTexture,this.isPowerOf2=r(this.width,this.height),this.glTexture=null,this.glIndex=0,this.glIndexCounter=-1,this.flipY=n,this.init(a)},init:function(t){var e=this.renderer;e&&(e.gl?this.isCanvas?this.glTexture=e.createCanvasTexture(this.image,!1,this.flipY):this.isVideo?this.glTexture=e.createVideoTexture(this.image,!1,this.flipY):this.isRenderTexture?(this.image=this.source.canvas,this.glTexture=e.createTextureFromSource(null,this.width,this.height,this.scaleMode)):this.isGLTexture?this.glTexture=this.source:this.compressionAlgorithm?this.glTexture=e.createTextureFromSource(this.source):this.glTexture=e.createTextureFromSource(this.image,this.width,this.height,this.scaleMode):this.isRenderTexture&&(this.image=this.source.canvas)),t.config.antialias||this.setFilter(1)},setFilter:function(t){this.renderer.gl&&this.renderer.setTextureFilter(this.glTexture,t),this.scaleMode=t},setFlipY:function(t){return void 0===t&&(t=!0),this.flipY=t,this},update:function(){var t=this.renderer.gl;t&&this.isCanvas?this.glTexture=this.renderer.updateCanvasTexture(this.image,this.glTexture,this.flipY):t&&this.isVideo&&(this.glTexture=this.renderer.updateVideoTexture(this.image,this.glTexture,this.flipY))},destroy:function(){this.glTexture&&this.renderer.deleteTexture(this.glTexture,!0),this.isCanvas&&s.remove(this.image),this.renderer=null,this.texture=null,this.source=null,this.image=null,this.glTexture=null}});t.exports=a},65154:t=>{t.exports={LINEAR:0,NEAREST:1}},49644:t=>{t.exports="addtexture"},60079:t=>{t.exports="onerror"},72665:t=>{t.exports="onload"},93006:t=>{t.exports="ready"},69018:t=>{t.exports="removetexture"},38203:(t,e,i)=>{t.exports={ADD:i(49644),ERROR:i(60079),LOAD:i(72665),READY:i(93006),REMOVE:i(69018)}},87499:(t,e,i)=>{var s=i(98611),n=i(65154),r={CanvasTexture:i(17487),Events:i(38203),FilterMode:n,Frame:i(82047),Parsers:i(69150),Texture:i(31673),TextureManager:i(6237),TextureSource:i(32547)};r=s(!1,r,n),t.exports=r},35082:t=>{t.exports=function(t,e,i){if(i.getElementsByTagName("TextureAtlas")){var s=t.source[e];t.add("__BASE",e,0,0,s.width,s.height);for(var n,r=i.getElementsByTagName("SubTexture"),o=0;o{t.exports=function(t,e){var i=t.source[e];return t.add("__BASE",e,0,0,i.width,i.height),t}},21560:t=>{t.exports=function(t,e){var i=t.source[e];return t.add("__BASE",e,0,0,i.width,i.height),t}},64423:(t,e,i)=>{var s=i(32742);t.exports=function(t,e,i){if(i.frames||i.textures){var n=t.source[e];t.add("__BASE",e,0,0,n.width,n.height);for(var r,o=Array.isArray(i.textures)?i.textures[e].frames:i.frames,a=0;a{var s=i(32742);t.exports=function(t,e,i){if(i.frames){var n=t.source[e];t.add("__BASE",e,0,0,n.width,n.height);var r,o=i.frames;for(var a in o)if(o.hasOwnProperty(a)){var h=o[a];r=t.add(a,e,h.frame.x,h.frame.y,h.frame.w,h.frame.h),h.trimmed&&r.setTrim(h.sourceSize.w,h.sourceSize.h,h.spriteSourceSize.x,h.spriteSourceSize.y,h.spriteSourceSize.w,h.spriteSourceSize.h),h.rotated&&(r.rotated=!0,r.updateUVsInverted());var l=h.anchor||h.pivot;l&&(r.customPivot=!0,r.pivotX=l.x,r.pivotY=l.y),r.customData=s(h)}for(var u in i)"frames"!==u&&(Array.isArray(i[u])?t.customData[u]=i[u].slice(0):t.customData[u]=i[u]);return t}console.warn("Invalid Texture Atlas JSON Hash given, missing 'frames' Object")}},67409:t=>{t.exports=function(t){var e,i=[171,75,84,88,32,49,49,187,13,10,26,10],s=new Uint8Array(t,0,12);for(e=0;e>1),v=Math.max(1,v>>1),p+=g}return{mipmaps:d,width:h,height:l,internalFormat:a,compressed:!0,generateMipmap:!1}}console.warn("KTXParser - Only compressed formats supported")}},24904:t=>{function e(t,e,i,s,n,r,o){return void 0===o&&(o=16),Math.floor((t+i)/n)*Math.floor((e+s)/r)*o}function i(t,e){return(t=Math.max(t,16))*(e=Math.max(e,8))/4}function s(t,e){return(t=Math.max(t,8))*(e=Math.max(e,8))/2}function n(t,i){return e(t,i,3,3,4,4,8)}function r(t,i){return e(t,i,3,3,4,4)}var o={0:{sizeFunc:i,glFormat:35841},1:{sizeFunc:i,glFormat:35843},2:{sizeFunc:s,glFormat:35840},3:{sizeFunc:s,glFormat:35842},6:{sizeFunc:n,glFormat:36196},7:{sizeFunc:n,glFormat:33776},8:{sizeFunc:r,glFormat:33777},9:{sizeFunc:r,glFormat:33778},11:{sizeFunc:r,glFormat:33779},22:{sizeFunc:n,glFormat:37492},23:{sizeFunc:r,glFormat:37496},24:{sizeFunc:n,glFormat:37494},25:{sizeFunc:n,glFormat:37488},26:{sizeFunc:r,glFormat:37490},27:{sizeFunc:r,glFormat:37808},28:{sizeFunc:function(t,i){return e(t,i,4,3,5,4)},glFormat:37809},29:{sizeFunc:function(t,i){return e(t,i,4,4,5,5)},glFormat:37810},30:{sizeFunc:function(t,i){return e(t,i,5,4,6,5)},glFormat:37811},31:{sizeFunc:function(t,i){return e(t,i,5,5,6,6)},glFormat:37812},32:{sizeFunc:function(t,i){return e(t,i,7,4,8,5)},glFormat:37813},33:{sizeFunc:function(t,i){return e(t,i,7,5,8,6)},glFormat:37814},34:{sizeFunc:function(t,i){return e(t,i,7,7,8,8)},glFormat:37815},35:{sizeFunc:function(t,i){return e(t,i,9,4,10,5)},glFormat:37816},36:{sizeFunc:function(t,i){return e(t,i,9,5,10,6)},glFormat:37817},37:{sizeFunc:function(t,i){return e(t,i,9,7,10,8)},glFormat:37818},38:{sizeFunc:function(t,i){return e(t,i,9,9,10,10)},glFormat:37819},39:{sizeFunc:function(t,i){return e(t,i,11,9,12,10)},glFormat:37820},40:{sizeFunc:function(t,i){return e(t,i,11,11,12,12)},glFormat:37821}};t.exports=function(t){for(var e=new Uint32Array(t,0,13),i=e[2],s=o[i].glFormat,n=o[i].sizeFunc,r=e[11],a=e[7],h=e[6],l=52+e[12],u=new Uint8Array(t,l),c=new Array(r),d=0,p=a,f=h,v=0;v>1),f=Math.max(1,f>>1),d+=g}return{mipmaps:c,width:a,height:h,internalFormat:s,compressed:!0,generateMipmap:!1}}},6143:(t,e,i)=>{var s=i(72632);t.exports=function(t,e,i,n,r,o,a){var h=s(a,"frameWidth",null),l=s(a,"frameHeight",h);if(null===h)throw new Error("TextureManager.SpriteSheet: Invalid frameWidth given.");var u=t.source[e];t.add("__BASE",e,0,0,u.width,u.height);var c=s(a,"startFrame",0),d=s(a,"endFrame",-1),p=s(a,"margin",0),f=s(a,"spacing",0),v=Math.floor((r-p+f)/(h+f))*Math.floor((o-p+f)/(l+f));0===v&&console.warn("SpriteSheet frame dimensions will result in zero frames for texture:",t.key),(c>v||c<-v)&&(c=0),c<0&&(c=v+c),-1!==d&&(v=c+(d+1));for(var g=p,m=p,y=0,x=0,T=0;Tr&&(y=w-r),b>o&&(x=b-o),t.add(T,e,i+g,n+m,h-y,l-x),(g+=h+f)+h>r&&(g=p,m+=l+f)}return t}},20030:(t,e,i)=>{var s=i(72632);t.exports=function(t,e,i){var n=s(i,"frameWidth",null),r=s(i,"frameHeight",n);if(!n)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var o=t.source[0];t.add("__BASE",0,0,0,o.width,o.height);var a,h=s(i,"startFrame",0),l=s(i,"endFrame",-1),u=s(i,"margin",0),c=s(i,"spacing",0),d=e.cutX,p=e.cutY,f=e.cutWidth,v=e.cutHeight,g=e.realWidth,m=e.realHeight,y=Math.floor((g-u+c)/(n+c)),x=Math.floor((m-u+c)/(r+c)),T=y*x,w=e.x,b=n-w,E=n-(g-f-w),S=e.y,A=r-S,_=r-(m-v-S);(h>T||h<-T)&&(h=0),h<0&&(h=T+h),-1!==l&&(T=h+(l+1));for(var C=u,M=u,R=0,P=e.sourceIndex,O=0;O{var e=0,i=function(t,i,s,n){var r=e-n.y-n.height;t.add(s,i,n.x,r,n.width,n.height)};t.exports=function(t,s,n){var r=t.source[s];t.add("__BASE",s,0,0,r.width,r.height),e=r.height;for(var o=n.split("\n"),a=/^[ ]*(- )*(\w+)+[: ]+(.*)/,h="",l="",u={x:0,y:0,width:0,height:0},c=0;c{t.exports={AtlasXML:i(35082),Canvas:i(83332),Image:i(21560),JSONArray:i(64423),JSONHash:i(17264),KTXParser:i(67409),PVRParser:i(24904),SpriteSheet:i(6143),SpriteSheetFromAtlas:i(20030),UnityYAML:i(89187)}},93560:t=>{t.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}},97042:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s,n,r,o){(void 0===i||i<=0)&&(i=32),(void 0===s||s<=0)&&(s=32),void 0===n&&(n=0),void 0===r&&(r=0),this.name=t,this.firstgid=0|e,this.imageWidth=0|i,this.imageHeight=0|s,this.imageMargin=0|n,this.imageSpacing=0|r,this.properties=o||{},this.images=[],this.total=0},containsImageIndex:function(t){return t>=this.firstgid&&t{var s=new(i(56694))({initialize:function(t){if(this.gids=[],void 0!==t)for(var e=0;e{var s=i(93560),n=i(16586),r=i(90715),o=i(89797);t.exports=function(t,e,i,a,h,l,u,c){void 0===i&&(i=32),void 0===a&&(a=32),void 0===h&&(h=10),void 0===l&&(l=10),void 0===c&&(c=!1);var d=null;if(Array.isArray(u))d=r(void 0!==e?e:"map",s.ARRAY_2D,u,i,a,c);else if(void 0!==e){var p=t.cache.tilemap.get(e);p?d=r(e,p.format,p.data,i,a,c):console.warn("No map data found for key "+e)}return null===d&&(d=new n({tileWidth:i,tileHeight:a,width:h,height:l})),new o(t,d)}},29633:(t,e,i)=>{var s=i(12920),n=i(56694),r=i(64937),o=i(66658),a=new n({Mixins:[r.Alpha,r.Flip,r.Visible],initialize:function(t,e,i,s,n,r,o,a){this.layer=t,this.index=e,this.x=i,this.y=s,this.width=n,this.height=r,this.right,this.bottom,this.baseWidth=void 0!==o?o:n,this.baseHeight=void 0!==a?a:r,this.pixelX=0,this.pixelY=0,this.updatePixelXY(),this.properties={},this.rotation=0,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceLeft=!1,this.faceRight=!1,this.faceTop=!1,this.faceBottom=!1,this.collisionCallback=void 0,this.collisionCallbackContext=this,this.tint=16777215,this.physics={}},containsPoint:function(t,e){return!(tthis.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=t.properties,this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldXY(this.x,this.y,void 0,t).x:this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldY(this.y,t)-(this.height-this.baseHeight)*e.scaleY:this.y*this.baseHeight-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new o),e.x=this.getLeft(t),e.y=this.getTop(t),e.width=this.getRight(t)-e.x,e.height=this.getBottom(t)-e.y,e},getCenterX:function(t){return(this.getLeft(t)+this.getRight(t))/2},getCenterY:function(t){return(this.getTop(t)+this.getBottom(t))/2},intersects:function(t,e,i,s){return!(i<=this.pixelX||s<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){(void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,s,n){(void 0===e&&(e=t),void 0===i&&(i=t),void 0===s&&(s=t),void 0===n&&(n=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=s,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=s,n)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,s){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==s&&(this.baseHeight=s),this.updatePixelXY(),this},updatePixelXY:function(){var t=this.layer.orientation;if(t===s.ORTHOGONAL)this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight;else if(t===s.ISOMETRIC)this.pixelX=(this.x-this.y)*this.baseWidth*.5,this.pixelY=(this.x+this.y)*this.baseHeight*.5;else if(t===s.STAGGERED)this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*(this.baseHeight/2);else if(t===s.HEXAGONAL){var e=this.layer.hexSideLength,i=(this.baseHeight-e)/2+e;this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*i}return this.right=this.pixelX+this.baseWidth,this.bottom=this.pixelY+this.baseHeight,this},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||void 0!==this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.layer.tilemapLayer;if(t){var e=t.gidMap[this.index];if(e)return e}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=a},89797:(t,e,i)=>{var s=i(56694),n=i(75606),r=i(93560),o=i(72632),a=i(94990),h=i(46422),l=i(12920),u=i(52257),c=i(72677),d=i(13747),p=i(29633),f=i(5047),v=i(87177),g=i(47975),m=new s({initialize:function(t,e){this.scene=t,this.tileWidth=e.tileWidth,this.tileHeight=e.tileHeight,this.width=e.width,this.height=e.height,this.orientation=e.orientation,this.renderOrder=e.renderOrder,this.format=e.format,this.version=e.version,this.properties=e.properties,this.widthInPixels=e.widthInPixels,this.heightInPixels=e.heightInPixels,this.imageCollections=e.imageCollections,this.images=e.images,this.layers=e.layers,this.tilesets=e.tilesets,this.objects=e.objects,this.currentLayerIndex=0,this.hexSideLength=e.hexSideLength;var i=this.orientation;this._convert={WorldToTileXY:f.GetWorldToTileXYFunction(i),WorldToTileX:f.GetWorldToTileXFunction(i),WorldToTileY:f.GetWorldToTileYFunction(i),TileToWorldXY:f.GetTileToWorldXYFunction(i),TileToWorldX:f.GetTileToWorldXFunction(i),TileToWorldY:f.GetTileToWorldYFunction(i)}},createBlankDynamicLayer:function(t,e,i,s,n,r,o,a){return console.warn("createBlankDynamicLayer is deprecated. Use createBlankLayer"),this.createBlankLayer(t,e,i,s,n,r,o,a)},createDynamicLayer:function(t,e,i,s){return console.warn("createDynamicLayer is deprecated. Use createLayer"),this.createLayer(t,e,i,s)},createStaticLayer:function(t,e,i,s){return console.warn("createStaticLayer is deprecated. Use createLayer"),this.createLayer(t,e,i,s)},setRenderOrder:function(t){var e=["right-down","left-down","right-up","left-up"];return"number"==typeof t&&(t=e[t]),e.indexOf(t)>-1&&(this.renderOrder=t),this},addTilesetImage:function(t,e,i,s,n,o,a){if(void 0===t)return null;if(null==e&&(e=t),!this.scene.sys.textures.exists(e))return console.warn("Invalid Tileset Image: "+e),null;var h=this.scene.sys.textures.get(e),l=this.getTilesetIndex(t);if(null===l&&this.format===r.TILED_JSON)return console.warn("No data found for Tileset: "+t),null;var u=this.tilesets[l];return u?(u.setTileSize(i,s),u.setSpacing(n,o),u.setImage(h),u):(void 0===i&&(i=this.tileWidth),void 0===s&&(s=this.tileHeight),void 0===n&&(n=0),void 0===o&&(o=0),void 0===a&&(a=0),(u=new g(t,a,i,s,n,o)).setImage(h),this.tilesets.push(u),u)},copy:function(t,e,i,s,n,r,o,a){return null!==(a=this.getLayer(a))?(f.Copy(t,e,i,s,n,r,o,a),this):null},createBlankLayer:function(t,e,i,s,n,r,o,h){if(void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=this.width),void 0===r&&(r=this.height),void 0===o&&(o=this.tileWidth),void 0===h&&(h=this.tileHeight),null!==this.getLayerIndex(t))return console.warn("Invalid Tilemap Layer ID: "+t),null;for(var l,u=new a({name:t,tileWidth:o,tileHeight:h,width:n,height:r,orientation:this.orientation}),c=0;c-1&&this.putTileAt(e,r.x,r.y,i,r.tilemapLayer)}return s},removeTileAt:function(t,e,i,s,n){return void 0===i&&(i=!0),void 0===s&&(s=!0),null===(n=this.getLayer(n))?null:f.RemoveTileAt(t,e,i,s,n)},removeTileAtWorldXY:function(t,e,i,s,n,r){return void 0===i&&(i=!0),void 0===s&&(s=!0),null===(r=this.getLayer(r))?null:f.RemoveTileAtWorldXY(t,e,i,s,n,r)},renderDebug:function(t,e,i){return null===(i=this.getLayer(i))?null:(this.orientation===l.ORTHOGONAL&&f.RenderDebug(t,e,i),this)},renderDebugFull:function(t,e){for(var i=this.layers,s=0;s{var s=i(99325),n=i(15043);s.register("tilemap",(function(t){var e=void 0!==t?t:{};return n(this.scene,e.key,e.tileWidth,e.tileHeight,e.width,e.height,e.data,e.insertNull)}))},37940:(t,e,i)=>{var s=i(61286),n=i(15043);s.register("tilemap",(function(t,e,i,s,r,o,a){return null===t&&(t=void 0),null===e&&(e=void 0),null===i&&(i=void 0),null===s&&(s=void 0),null===r&&(r=void 0),n(this.scene,t,e,i,s,r,o,a)}))},87177:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(89980),o=i(5047),a=i(96193),h=new s({Extends:r,Mixins:[n.Alpha,n.BlendMode,n.ComputedSize,n.Depth,n.Flip,n.GetBounds,n.Origin,n.Pipeline,n.Transform,n.Visible,n.ScrollFactor,a],initialize:function(t,e,i,s,n,a){r.call(this,t,"TilemapLayer"),this.isTilemap=!0,this.tilemap=e,this.layerIndex=i,this.layer=e.layers[i],this.layer.tilemapLayer=this,this.tileset=[],this.tilesDrawn=0,this.tilesTotal=this.layer.width*this.layer.height,this.culledTiles=[],this.skipCull=!1,this.cullPaddingX=1,this.cullPaddingY=1,this.cullCallback=o.GetCullTilesFunction(this.layer.orientation),this._renderOrder=0,this.gidMap=[],this.setTilesets(s),this.setAlpha(this.layer.alpha),this.setPosition(n,a),this.setOrigin(),this.setSize(e.tileWidth*this.layer.width,e.tileHeight*this.layer.height),this.initPipeline()},setTilesets:function(t){var e=[],i=[],s=this.tilemap;Array.isArray(t)||(t=[t]);for(var n=0;n=0&&t<4&&(this._renderOrder=t),this},calculateFacesAt:function(t,e){return o.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,s){return o.CalculateFacesWithin(t,e,i,s,this.layer),this},createFromTiles:function(t,e,i,s,n){return o.CreateFromTiles(t,e,i,s,n,this.layer)},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles,this._renderOrder)},copy:function(t,e,i,s,n,r,a){return o.Copy(t,e,i,s,n,r,a,this.layer),this},fill:function(t,e,i,s,n,r){return o.Fill(t,e,i,s,n,r,this.layer),this},filterTiles:function(t,e,i,s,n,r,a){return o.FilterTiles(t,e,i,s,n,r,a,this.layer)},findByIndex:function(t,e,i){return o.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,s,n,r,a){return o.FindTile(t,e,i,s,n,r,a,this.layer)},forEachTile:function(t,e,i,s,n,r,a){return o.ForEachTile(t,e,i,s,n,r,a,this.layer),this},getTileAt:function(t,e,i){return o.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,s){return o.GetTileAtWorldXY(t,e,i,s,this.layer)},getTilesWithin:function(t,e,i,s,n){return o.GetTilesWithin(t,e,i,s,n,this.layer)},getTilesWithinShape:function(t,e,i){return o.GetTilesWithinShape(t,e,i,this.layer)},getTilesWithinWorldXY:function(t,e,i,s,n,r){return o.GetTilesWithinWorldXY(t,e,i,s,n,r,this.layer)},hasTileAt:function(t,e){return o.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return o.HasTileAtWorldXY(t,e,i,this.layer)},putTileAt:function(t,e,i,s){return o.PutTileAt(t,e,i,s,this.layer)},putTileAtWorldXY:function(t,e,i,s,n){return o.PutTileAtWorldXY(t,e,i,s,n,this.layer)},putTilesAt:function(t,e,i,s){return o.PutTilesAt(t,e,i,s,this.layer),this},randomize:function(t,e,i,s,n){return o.Randomize(t,e,i,s,n,this.layer),this},removeTileAt:function(t,e,i,s){return o.RemoveTileAt(t,e,i,s,this.layer)},removeTileAtWorldXY:function(t,e,i,s,n){return o.RemoveTileAtWorldXY(t,e,i,s,n,this.layer)},renderDebug:function(t,e){return o.RenderDebug(t,e,this.layer),this},replaceByIndex:function(t,e,i,s,n,r){return o.ReplaceByIndex(t,e,i,s,n,r,this.layer),this},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},setCollision:function(t,e,i,s){return o.SetCollision(t,e,i,this.layer,s),this},setCollisionBetween:function(t,e,i,s){return o.SetCollisionBetween(t,e,i,s,this.layer),this},setCollisionByProperty:function(t,e,i){return o.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return o.SetCollisionByExclusion(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return o.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileIndexCallback:function(t,e,i){return o.SetTileIndexCallback(t,e,i,this.layer),this},setTileLocationCallback:function(t,e,i,s,n,r){return o.SetTileLocationCallback(t,e,i,s,n,r,this.layer),this},shuffle:function(t,e,i,s){return o.Shuffle(t,e,i,s,this.layer),this},swapByIndex:function(t,e,i,s,n,r){return o.SwapByIndex(t,e,i,s,n,r,this.layer),this},tileToWorldX:function(t,e){return this.tilemap.tileToWorldX(t,e,this)},tileToWorldY:function(t,e){return this.tilemap.tileToWorldY(t,e,this)},tileToWorldXY:function(t,e,i,s){return this.tilemap.tileToWorldXY(t,e,i,s,this)},weightedRandomize:function(t,e,i,s,n){return o.WeightedRandomize(e,i,s,n,t,this.layer),this},worldToTileX:function(t,e,i){return this.tilemap.worldToTileX(t,e,i,this)},worldToTileY:function(t,e,i){return this.tilemap.worldToTileY(t,e,i,this)},worldToTileXY:function(t,e,i,s,n){return this.tilemap.worldToTileXY(t,e,i,s,n,this)},destroy:function(t){void 0===t&&(t=!0),this.tilemap&&(this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),t&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.culledTiles.length=0,this.cullCallback=null,this.gidMap=[],this.tileset=[],r.prototype.destroy.call(this))}});t.exports=h},17394:(t,e,i)=>{var s=i(69360),n=new s,r=new s,o=new s;t.exports=function(t,e,i,s){var a=e.cull(i),h=a.length,l=i.alpha*e.alpha;if(!(0===h||l<=0)){var u=n,c=r,d=o;c.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),u.copyFrom(i.matrix);var p=t.currentContext,f=e.gidMap;p.save(),s?(u.multiplyWithOffset(s,-i.scrollX*e.scrollFactorX,-i.scrollY*e.scrollFactorY),c.e=e.x,c.f=e.y,u.multiply(c,d),d.copyToContext(p)):(c.e-=i.scrollX*e.scrollFactorX,c.f-=i.scrollY*e.scrollFactorY,c.copyToContext(p)),(!t.antialias||e.scaleX>1||e.scaleY>1)&&(p.imageSmoothingEnabled=!1);for(var v=0;v{var s=i(72283),n=i(72283);s=i(51395),n=i(17394),t.exports={renderWebGL:s,renderCanvas:n}},51395:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i){var n=e.cull(i),r=n.length,o=i.alpha*e.alpha;if(!(0===r||o<=0)){var a=e.gidMap,h=t.pipelines.set(e.pipeline,e),l=s.getTintAppendFloatAlpha,u=e.scrollFactorX,c=e.scrollFactorY,d=e.x,p=e.y,f=e.scaleX,v=e.scaleY;t.pipelines.preBatch(e);for(var g=0;g{var s=i(56694),n=i(93736),r=new s({initialize:function(t,e,i,s,r,o,a,h,l){(void 0===i||i<=0)&&(i=32),(void 0===s||s<=0)&&(s=32),void 0===r&&(r=0),void 0===o&&(o=0),void 0===a&&(a={}),void 0===h&&(h={}),this.name=t,this.firstgid=e,this.tileWidth=i,this.tileHeight=s,this.tileMargin=r,this.tileSpacing=o,this.tileProperties=a,this.tileData=h,this.tileOffset=new n,void 0!==l&&this.tileOffset.set(l.x,l.y),this.image=null,this.glTexture=null,this.rows=0,this.columns=0,this.total=0,this.texCoordinates=[]},getTileProperties:function(t){return this.containsTileIndex(t)?this.tileProperties[t-this.firstgid]:null},getTileData:function(t){return this.containsTileIndex(t)?this.tileData[t-this.firstgid]:null},getTileCollisionGroup:function(t){var e=this.getTileData(t);return e&&e.objectgroup?e.objectgroup:null},containsTileIndex:function(t){return t>=this.firstgid&&t{var s=i(15494);t.exports=function(t,e,i){var n=s(t,e,!0,i),r=s(t,e-1,!0,i),o=s(t,e+1,!0,i),a=s(t-1,e,!0,i),h=s(t+1,e,!0,i),l=n&&n.collides;return l&&(n.faceTop=!0,n.faceBottom=!0,n.faceLeft=!0,n.faceRight=!0),r&&r.collides&&(l&&(n.faceTop=!1),r.faceBottom=!l),o&&o.collides&&(l&&(n.faceBottom=!1),o.faceTop=!l),a&&a.collides&&(l&&(n.faceLeft=!1),a.faceRight=!l),h&&h.collides&&(l&&(n.faceRight=!1),h.faceLeft=!l),n&&!n.collides&&n.resetFaces(),n}},60386:(t,e,i)=>{var s=i(15494),n=i(50811);t.exports=function(t,e,i,r,o){for(var a=null,h=null,l=null,u=null,c=n(t,e,i,r,null,o),d=0;d{var s=new(i(93736));t.exports=function(t,e,i,n){var r=i.tilemapLayer,o=r.cullPaddingX,a=r.cullPaddingY,h=r.tilemap.tileToWorldXY(t,e,s,n,r);return h.x>n.worldView.x+r.scaleX*i.tileWidth*(-o-.5)&&h.xn.worldView.y+r.scaleY*i.tileHeight*(-a-1)&&h.y{var s=i(50811),n=i(60386);t.exports=function(t,e,i,r,o,a,h,l){void 0===h&&(h=!0),t<0&&(t=0),e<0&&(e=0);for(var u=s(t,e,i,r,null,l),c=o-t,d=a-e,p=0;p=0&&f=0&&v{var s=i(50811),n=i(51202);t.exports=function(t,e,i,r,o,a){i||(i={}),Array.isArray(t)||(t=[t]);var h=a.tilemapLayer;r||(r=h.scene),o||(o=r.cameras.main);var l,u=s(0,0,a.width,a.height,null,a),c=[];for(l=0;l{var s=i(74118),n=i(82127),r=i(84314),o=new s;t.exports=function(t,e){var i=t.tilemapLayer.tilemap,s=t.tilemapLayer,a=Math.floor(i.tileWidth*s.scaleX),h=Math.floor(i.tileHeight*s.scaleY),l=r(e.worldView.x-s.x,a,0,!0)-s.cullPaddingX,u=n(e.worldView.right-s.x,a,0,!0)+s.cullPaddingX,c=r(e.worldView.y-s.y,h,0,!0)-s.cullPaddingY,d=n(e.worldView.bottom-s.y,h,0,!0)+s.cullPaddingY;return o.setTo(l,c,u-l,d-c)}},381:(t,e,i)=>{var s=i(71586),n=i(6987);t.exports=function(t,e,i,r){void 0===i&&(i=[]),void 0===r&&(r=0),i.length=0;var o=t.tilemapLayer,a=s(t,e);return(o.skipCull||1!==o.scrollFactorX||1!==o.scrollFactorY)&&(a.left=0,a.right=t.width,a.top=0,a.bottom=t.height),n(t,a,r,i),i}},97734:(t,e,i)=>{var s=i(50811),n=i(60386),r=i(68234);t.exports=function(t,e,i,o,a,h,l){for(var u=-1!==l.collideIndexes.indexOf(t),c=s(e,i,o,a,null,l),d=0;d{var s=i(50811);t.exports=function(t,e,i,n,r,o,a,h){return s(i,n,r,o,a,h).filter(t,e)}},37982:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=0),void 0===i&&(i=!1);var n,r,o,a=0;if(i){for(r=s.height-1;r>=0;r--)for(n=s.width-1;n>=0;n--)if((o=s.data[r][n])&&o.index===t){if(a===e)return o;a+=1}}else for(r=0;r{var s=i(50811);t.exports=function(t,e,i,n,r,o,a,h){return s(i,n,r,o,a,h).find(t,e)||null}},80916:(t,e,i)=>{var s=i(50811);t.exports=function(t,e,i,n,r,o,a,h){s(i,n,r,o,a,h).forEach(t,e)}},31493:(t,e,i)=>{var s=i(12920),n=i(381),r=i(37524),o=i(20887),a=i(72283),h=i(19242);t.exports=function(t){return t===s.ORTHOGONAL?n:t===s.HEXAGONAL?r:t===s.STAGGERED?h:t===s.ISOMETRIC?o:a}},15494:(t,e,i)=>{var s=i(62839);t.exports=function(t,e,i,n){if(void 0===i&&(i=!1),s(t,e,n)){var r=n.data[e][t]||null;return r?-1===r.index?i?r:null:r:null}return null}},24640:(t,e,i)=>{var s=i(15494),n=new(i(93736));t.exports=function(t,e,i,r,o){return o.tilemapLayer.worldToTileXY(t,e,!0,n,r),s(n.x,n.y,i,o)}},16884:(t,e,i)=>{var s=i(12920),n=i(72283),r=i(44150);t.exports=function(t){return t===s.ORTHOGONAL?r:n}},68182:(t,e,i)=>{var s=i(12920),n=i(21715),r=i(21808),o=i(72283),a=i(33388),h=i(46836);t.exports=function(t){return t===s.ORTHOGONAL?h:t===s.ISOMETRIC?r:t===s.HEXAGONAL?n:t===s.STAGGERED?a:o}},3752:(t,e,i)=>{var s=i(12920),n=i(37728),r=i(72283),o=i(84132),a=i(42477);t.exports=function(t){return t===s.ORTHOGONAL?a:t===s.HEXAGONAL?n:t===s.STAGGERED?o:r}},50811:(t,e,i)=>{var s=i(72632);t.exports=function(t,e,i,n,r,o){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=o.width),void 0===n&&(n=o.height),r||(r={});var a=s(r,"isNotEmpty",!1),h=s(r,"isColliding",!1),l=s(r,"hasInterestingFace",!1);t<0&&(i+=t,t=0),e<0&&(n+=e,e=0),t+i>o.width&&(i=Math.max(o.width-t,0)),e+n>o.height&&(n=Math.max(o.height-e,0));for(var u=[],c=e;c{var s=i(84068),n=i(50811),r=i(7563),o=i(72283),a=i(93736),h=function(t,e){return r.RectangleToTriangle(e,t)},l=new a,u=new a,c=new a;t.exports=function(t,e,i,a){if(void 0===t)return[];var d=o;t instanceof s.Circle?d=r.CircleToRectangle:t instanceof s.Rectangle?d=r.RectangleToRectangle:t instanceof s.Triangle?d=h:t instanceof s.Line&&(d=r.LineToRectangle),a.tilemapLayer.worldToTileXY(t.left,t.top,!0,u,i);var p=u.x,f=u.y;a.tilemapLayer.worldToTileXY(t.right,t.bottom,!0,c,i);var v=Math.ceil(c.x),g=Math.ceil(c.y),m=Math.max(v-p,1),y=Math.max(g-f,1),x=n(p,f,m,y,e,a),T=a.tileWidth,w=a.tileHeight;a.tilemapLayer&&(T*=a.tilemapLayer.scaleX,w*=a.tilemapLayer.scaleY);for(var b=[],E=new s.Rectangle(0,0,T,w),S=0;S{var s=i(50811),n=i(93736),r=new n,o=new n;t.exports=function(t,e,i,n,a,h,l){var u=l.tilemapLayer.tilemap._convert.WorldToTileXY;u(t,e,!0,r,h,l);var c=r.x,d=r.y;u(t+i,e+n,!1,o,h,l);var p=Math.ceil(o.x),f=Math.ceil(o.y);return s(c,d,p-c,f-d,a,l)}},29296:(t,e,i)=>{var s=i(12920),n=i(72283),r=i(806);t.exports=function(t){return t===s.ORTHOGONAL?r:n}},32688:(t,e,i)=>{var s=i(12920),n=i(11516),r=i(18750),o=i(72283),a=i(90562),h=i(45676);t.exports=function(t){return t===s.ORTHOGONAL?h:t===s.ISOMETRIC?r:t===s.HEXAGONAL?n:t===s.STAGGERED?a:o}},74326:(t,e,i)=>{var s=i(12920),n=i(44382),r=i(72283),o=i(3689),a=i(70520);t.exports=function(t){return t===s.ORTHOGONAL?a:t===s.HEXAGONAL?n:t===s.STAGGERED?o:r}},46598:(t,e,i)=>{var s=i(62839);t.exports=function(t,e,i){if(s(t,e,i)){var n=i.data[e][t];return null!==n&&n.index>-1}return!1}},28654:(t,e,i)=>{var s=i(46598),n=new(i(93736));t.exports=function(t,e,i,r){r.tilemapLayer.worldToTileXY(t,e,!0,n,i);var o=n.x,a=n.y;return s(o,a,r)}},6358:(t,e,i)=>{var s=i(82127),n=i(84314);t.exports=function(t,e){var i=t.tilemapLayer.tilemap,r=t.tilemapLayer,o=Math.floor(i.tileWidth*r.scaleX),a=Math.floor(i.tileHeight*r.scaleY),h=t.hexSideLength,l=(a-h)/2+h;return{left:n(e.worldView.x-r.x,o,0,!0)-r.cullPaddingX,right:s(e.worldView.right-r.x,o,0,!0)+r.cullPaddingX,top:n(e.worldView.y-r.y,l,0,!0)-r.cullPaddingY,bottom:s(e.worldView.bottom-r.y,l,0,!0)+r.cullPaddingY}}},37524:(t,e,i)=>{var s=i(6358),n=i(6987);t.exports=function(t,e,i,r){void 0===i&&(i=[]),void 0===r&&(r=0),i.length=0;var o=t.tilemapLayer;if(!o.skipCull&&1===o.scrollFactorX&&1===o.scrollFactorY){var a=s(t,e);n(t,a,r,i)}return i}},21715:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r){i||(i=new s);var o=r.baseTileWidth,a=r.baseTileHeight,h=r.tilemapLayer,l=0,u=0;h&&(n||(n=h.scene.cameras.main),l=h.x+n.scrollX*(1-h.scrollFactorX),o*=h.scaleX,u=h.y+n.scrollY*(1-h.scrollFactorY),a*=h.scaleY);var c=r.hexSideLength,d=l+t*o+e%2*(o/2),p=u+e*((a-c)/2+c);return i.set(d,p)}},37728:t=>{t.exports=function(t,e,i){var s=i.baseTileHeight,n=i.tilemapLayer,r=0;n&&(void 0===e&&(e=n.scene.cameras.main),r=n.y+e.scrollY*(1-n.scrollFactorY),s*=n.scaleY);var o=n.tilemap.hexSideLength;return r+t*((s-o)/2+o)}},11516:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r,o){n||(n=new s);var a=o.baseTileWidth,h=o.baseTileHeight,l=o.tilemapLayer;l&&(r||(r=l.scene.cameras.main),e-=l.y+r.scrollY*(1-l.scrollFactorY),h*=l.scaleY,t-=l.x+r.scrollX*(1-l.scrollFactorX),a*=l.scaleX);var u=o.hexSideLength,c=(h-u)/2+u,d=i?Math.floor(e/c):e/c,p=i?Math.floor((t-d%2*.5*a)/a):(t-d%2*.5*a)/a;return n.set(p,d)}},44382:t=>{t.exports=function(t,e,i,s){var n=s.baseTileHeight,r=s.tilemapLayer;r&&(i||(i=r.scene.cameras.main),t-=r.y+i.scrollY*(1-r.scrollFactorY),n*=r.scaleY);var o=s.hexSideLength,a=(n-o)/2+o;return e?Math.floor(t/a):t/a}},62839:t=>{t.exports=function(t,e,i){return t>=0&&t=0&&e{var s=i(13125);t.exports=function(t,e,i,n){void 0===i&&(i=[]),void 0===n&&(n=0),i.length=0;var r,o,a,h=t.tilemapLayer,l=t.data,u=t.width,c=t.height,d=u,p=c;if(!h.skipCull)if(0===n){for(o=0;o=0;r--)if(s(r,o,t,e)){if(!(a=l[o][r])||-1===a.index||!a.visible||0===a.alpha)continue;i.push(a)}}else if(2===n){for(o=p;o>=0;o--)for(r=0;l[o]&&r=0;o--)for(r=d;l[o]&&r>=0;r--)if(s(r,o,t,e)){if(!(a=l[o][r])||-1===a.index||!a.visible||0===a.alpha)continue;i.push(a)}return h.tilesDrawn=i.length,h.tilesTotal=u*c,i}},21808:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r){i||(i=new s);var o=r.baseTileWidth,a=r.baseTileHeight,h=r.tilemapLayer,l=0,u=0;h&&(n||(n=h.scene.cameras.main),l=h.x+n.scrollX*(1-h.scrollFactorX),o*=h.scaleX,u=h.y+n.scrollY*(1-h.scrollFactorY),a*=h.scaleY);var c=l+o/2*(t-e),d=u+(t+e)*(a/2);return i.set(c,d)}},18750:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r,o){n||(n=new s);var a=o.baseTileWidth,h=o.baseTileHeight,l=o.tilemapLayer;l&&(r||(r=l.scene.cameras.main),e-=l.y+r.scrollY*(1-l.scrollFactorY),h*=l.scaleY,t-=l.x+r.scrollX*(1-l.scrollFactorX),a*=l.scaleX);var u=i?Math.floor((t/(a/2)+e/(h/2))/2):(t/(a/2)+e/(h/2))/2,c=i?Math.floor((e/(h/2)-t/(a/2))/2):(e/(h/2)-t/(a/2))/2;return n.set(u,c)}},29003:(t,e,i)=>{var s=i(29633),n=i(62839),r=i(92839),o=i(68234),a=i(14556);t.exports=function(t,e,i,h,l){if(void 0===h&&(h=!0),!n(e,i,l))return null;var u=l.data[i][e],c=u&&u.collides;if(t instanceof s)null===l.data[i][e]&&(l.data[i][e]=new s(l,t.index,e,i,l.tileWidth,l.tileHeight)),l.data[i][e].copy(t);else{var d=t;null===l.data[i][e]?l.data[i][e]=new s(l,d,e,i,l.tileWidth,l.tileHeight):l.data[i][e].index=d}var p=l.data[i][e],f=-1!==l.collideIndexes.indexOf(p.index),v=a(l.tilemapLayer.tilemap)[d=t instanceof s?t.index:t][2],g=l.tilemapLayer.tileset[v];return p.width=g.tileWidth,p.height=g.tileHeight,o(p,f),h&&c!==p.collides&&r(e,i,l),p}},48565:(t,e,i)=>{var s=i(29003),n=new(i(93736));t.exports=function(t,e,i,r,o,a){return a.tilemapLayer.worldToTileXY(e,i,!0,n,o,a),s(t,n.x,n.y,r,a)}},56547:(t,e,i)=>{var s=i(60386),n=i(29003);t.exports=function(t,e,i,r,o){if(void 0===r&&(r=!0),!Array.isArray(t))return null;Array.isArray(t[0])||(t=[t]);for(var a=t.length,h=t[0].length,l=0;l{var s=i(50811),n=i(72861);t.exports=function(t,e,i,r,o,a){var h,l=s(t,e,i,r,{},a);if(!o)for(o=[],h=0;h{var s=i(29633),n=i(62839),r=i(92839);t.exports=function(t,e,i,o,a){if(void 0===i&&(i=!0),void 0===o&&(o=!0),!n(t,e,a))return null;var h=a.data[e][t];return h?(a.data[e][t]=i?null:new s(a,-1,t,e,a.tileWidth,a.tileHeight),o&&h&&h.collides&&r(t,e,a),h):null}},17384:(t,e,i)=>{var s=i(929),n=new(i(93736));t.exports=function(t,e,i,r,o,a){return a.tilemapLayer.worldToTileXY(t,e,!0,n,o,a),s(n.x,n.y,i,r,a)}},93763:(t,e,i)=>{var s=i(50811),n=i(95509),r=new n(105,210,231,150),o=new n(243,134,48,200),a=new n(40,39,37,150);t.exports=function(t,e,i){void 0===e&&(e={});var n=void 0!==e.tileColor?e.tileColor:r,h=void 0!==e.collidingTileColor?e.collidingTileColor:o,l=void 0!==e.faceColor?e.faceColor:a,u=s(0,0,i.width,i.height,null,i);t.translateCanvas(i.tilemapLayer.x,i.tilemapLayer.y),t.scaleCanvas(i.tilemapLayer.scaleX,i.tilemapLayer.scaleY);for(var c=0;c{var s=i(50811);t.exports=function(t,e,i,n,r,o,a){for(var h=s(i,n,r,o,null,a),l=0;l{t.exports=function(t,e,i,s){var n,r,o,a=t.data,h=t.width,l=t.height,u=t.tilemapLayer,c=Math.max(0,e.left),d=Math.min(h,e.right),p=Math.max(0,e.top),f=Math.min(l,e.bottom);if(0===i)for(r=p;r=c;n--)(o=a[r][n])&&-1!==o.index&&o.visible&&0!==o.alpha&&s.push(o);else if(2===i)for(r=f;r>=p;r--)for(n=c;a[r]&&n=p;r--)for(n=d;a[r]&&n>=c;n--)(o=a[r][n])&&-1!==o.index&&o.visible&&0!==o.alpha&&s.push(o);return u.tilesDrawn=s.length,u.tilesTotal=h*l,s}},51710:(t,e,i)=>{var s=i(68234),n=i(60386),r=i(91181);t.exports=function(t,e,i,o,a){void 0===e&&(e=!0),void 0===i&&(i=!0),void 0===a&&(a=!0),Array.isArray(t)||(t=[t]);for(var h=0;h{var s=i(68234),n=i(60386),r=i(91181);t.exports=function(t,e,i,o,a,h){if(void 0===i&&(i=!0),void 0===o&&(o=!0),void 0===h&&(h=!0),!(t>e)){for(var l=t;l<=e;l++)r(l,i,a);if(h)for(var u=0;u=t&&d.index<=e&&s(d,i)}o&&n(0,0,a.width,a.height,a)}}},33158:(t,e,i)=>{var s=i(68234),n=i(60386),r=i(91181);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var a=0;a{var s=i(68234),n=i(60386),r=i(19256);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0);for(var a=0;a{var s=i(68234),n=i(60386);t.exports=function(t,e,i){void 0===t&&(t=!0),void 0===e&&(e=!0);for(var r=0;r0&&s(a,t)}}e&&n(0,0,i.width,i.height,i)}},91181:t=>{t.exports=function(t,e,i){var s=i.collideIndexes.indexOf(t);e&&-1===s?i.collideIndexes.push(t):e||-1===s||i.collideIndexes.splice(s,1)}},68234:t=>{t.exports=function(t,e){e?t.setCollision(!0,!0,!0,!0,!1):t.resetCollision(!1)}},11628:t=>{t.exports=function(t,e,i,s){if("number"==typeof t)s.callbacks[t]=null!==e?{callback:e,callbackContext:i}:void 0;else for(var n=0,r=t.length;n{var s=i(50811);t.exports=function(t,e,i,n,r,o,a){for(var h=s(t,e,i,n,null,a),l=0;l{var s=i(50811),n=i(18592);t.exports=function(t,e,i,r,o){var a=s(t,e,i,r,null,o),h=a.map((function(t){return t.index}));n(h);for(var l=0;l{var s=i(82127),n=i(84314);t.exports=function(t,e){var i=t.tilemapLayer.tilemap,r=t.tilemapLayer,o=Math.floor(i.tileWidth*r.scaleX),a=Math.floor(i.tileHeight*r.scaleY);return{left:n(e.worldView.x-r.x,o,0,!0)-r.cullPaddingX,right:s(e.worldView.right-r.x,o,0,!0)+r.cullPaddingX,top:n(e.worldView.y-r.y,a/2,0,!0)-r.cullPaddingY,bottom:s(e.worldView.bottom-r.y,a/2,0,!0)+r.cullPaddingY}}},19242:(t,e,i)=>{var s=i(53945),n=i(6987);t.exports=function(t,e,i,r){void 0===i&&(i=[]),void 0===r&&(r=0),i.length=0;var o=t.tilemapLayer;if(!o.skipCull&&1===o.scrollFactorX&&1===o.scrollFactorY){var a=s(t,e);n(t,a,r,i)}return i}},33388:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r){i||(i=new s);var o=r.baseTileWidth,a=r.baseTileHeight,h=r.tilemapLayer,l=0,u=0;h&&(n||(n=h.scene.cameras.main),l=h.x+n.scrollX*(1-h.scrollFactorX),o*=h.scaleX,u=h.y+n.scrollY*(1-h.scrollFactorY),a*=h.scaleY);var c=l+t*o+e%2*(o/2),d=u+e*(a/2);return i.set(c,d)}},84132:t=>{t.exports=function(t,e,i){var s=i.baseTileHeight,n=i.tilemapLayer,r=0;return n&&(void 0===e&&(e=n.scene.cameras.main),r=n.y+e.scrollY*(1-n.scrollFactorY),s*=n.scaleY),r+t*(s/2)+s}},90562:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r,o){n||(n=new s);var a=o.baseTileWidth,h=o.baseTileHeight,l=o.tilemapLayer;l&&(r||(r=l.scene.cameras.main),e-=l.y+r.scrollY*(1-l.scrollFactorY),h*=l.scaleY,t-=l.x+r.scrollX*(1-l.scrollFactorX),a*=l.scaleX);var u=i?Math.floor(e/(h/2)):e/(h/2),c=i?Math.floor((t+u%2*.5*a)/a):(t+u%2*.5*a)/a;return n.set(c,u)}},3689:t=>{t.exports=function(t,e,i,s){var n=s.baseTileHeight,r=s.tilemapLayer;return r&&(i||(i=r.scene.cameras.main),t-=r.y+i.scrollY*(1-r.scrollFactorY),n*=r.scaleY),e?Math.floor(t/(n/2)):t/(n/2)}},55217:(t,e,i)=>{var s=i(50811);t.exports=function(t,e,i,n,r,o,a){for(var h=s(i,n,r,o,null,a),l=0;l{t.exports=function(t,e,i){var s=i.baseTileWidth,n=i.tilemapLayer,r=0;return n&&(e||(e=n.scene.cameras.main),r=n.x+e.scrollX*(1-n.scrollFactorX),s*=n.scaleX),r+t*s}},46836:(t,e,i)=>{var s=i(44150),n=i(42477),r=i(93736);t.exports=function(t,e,i,o,a){return i||(i=new r(0,0)),i.x=s(t,o,a),i.y=n(e,o,a),i}},42477:t=>{t.exports=function(t,e,i){var s=i.baseTileHeight,n=i.tilemapLayer,r=0;return n&&(e||(e=n.scene.cameras.main),r=n.y+e.scrollY*(1-n.scrollFactorY),s*=n.scaleY),r+t*s}},39677:(t,e,i)=>{var s=i(50811);t.exports=function(t,e,i,n,r,o){if(r){var a,h=s(t,e,i,n,null,o),l=0;for(a=0;a{t.exports=function(t,e,i,s){void 0===e&&(e=!0);var n=s.baseTileWidth,r=s.tilemapLayer;return r&&(i||(i=r.scene.cameras.main),t-=r.x+i.scrollX*(1-r.scrollFactorX),n*=r.scaleX),e?Math.floor(t/n):t/n}},45676:(t,e,i)=>{var s=i(806),n=i(70520),r=i(93736);t.exports=function(t,e,i,o,a,h){return void 0===i&&(i=!0),o||(o=new r(0,0)),o.x=s(t,i,a,h),o.y=n(e,i,a,h),o}},70520:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=!0);var n=s.baseTileHeight,r=s.tilemapLayer;return r&&(i||(i=r.scene.cameras.main),t-=r.y+i.scrollY*(1-r.scrollFactorY),n*=r.scaleY),e?Math.floor(t/n):t/n}},5047:(t,e,i)=>{t.exports={CalculateFacesAt:i(92839),CalculateFacesWithin:i(60386),CheckIsoBounds:i(13125),Copy:i(17347),CreateFromTiles:i(93604),CullBounds:i(71586),CullTiles:i(381),Fill:i(97734),FilterTiles:i(63555),FindByIndex:i(37982),FindTile:i(48297),ForEachTile:i(80916),GetCullTilesFunction:i(31493),GetTileAt:i(15494),GetTileAtWorldXY:i(24640),GetTilesWithin:i(50811),GetTilesWithinShape:i(31674),GetTilesWithinWorldXY:i(44662),GetTileToWorldXFunction:i(16884),GetTileToWorldXYFunction:i(68182),GetTileToWorldYFunction:i(3752),GetWorldToTileXFunction:i(29296),GetWorldToTileXYFunction:i(32688),GetWorldToTileYFunction:i(74326),HasTileAt:i(46598),HasTileAtWorldXY:i(28654),HexagonalCullBounds:i(6358),HexagonalCullTiles:i(37524),HexagonalTileToWorldXY:i(21715),HexagonalTileToWorldY:i(37728),HexagonalWorldToTileXY:i(11516),HexagonalWorldToTileY:i(44382),IsInLayerBounds:i(62839),IsometricCullTiles:i(20887),IsometricTileToWorldXY:i(21808),IsometricWorldToTileXY:i(18750),PutTileAt:i(29003),PutTileAtWorldXY:i(48565),PutTilesAt:i(56547),Randomize:i(91180),RemoveTileAt:i(929),RemoveTileAtWorldXY:i(17384),RenderDebug:i(93763),ReplaceByIndex:i(51202),RunCull:i(6987),SetCollision:i(51710),SetCollisionBetween:i(15216),SetCollisionByExclusion:i(33158),SetCollisionByProperty:i(4180),SetCollisionFromCollisionGroup:i(18625),SetLayerCollisionIndex:i(91181),SetTileCollision:i(68234),SetTileIndexCallback:i(11628),SetTileLocationCallback:i(72732),Shuffle:i(34397),StaggeredCullBounds:i(53945),StaggeredCullTiles:i(19242),StaggeredTileToWorldXY:i(33388),StaggeredTileToWorldY:i(84132),StaggeredWorldToTileXY:i(90562),StaggeredWorldToTileY:i(3689),SwapByIndex:i(55217),TileToWorldX:i(44150),TileToWorldXY:i(46836),TileToWorldY:i(42477),WeightedRandomize:i(39677),WorldToTileX:i(806),WorldToTileXY:i(45676),WorldToTileY:i(70520)}},12920:t=>{t.exports={ORTHOGONAL:0,ISOMETRIC:1,STAGGERED:2,HEXAGONAL:3}},84758:(t,e,i)=>{var s={ORIENTATION:i(12920)};t.exports=s},52678:(t,e,i)=>{var s=i(98611),n=i(84758),r={Components:i(5047),Parsers:i(34124),Formats:i(93560),ImageCollection:i(97042),ParseToTilemap:i(15043),Tile:i(29633),Tilemap:i(89797),TilemapCreator:i(4843),TilemapFactory:i(37940),Tileset:i(47975),TilemapLayer:i(87177),Orientation:i(12920),LayerData:i(94990),MapData:i(16586),ObjectLayer:i(15256)};r=s(!1,r,n.ORIENTATION),t.exports=r},94990:(t,e,i)=>{var s=i(56694),n=i(12920),r=i(72632),o=new s({initialize:function(t){void 0===t&&(t={}),this.name=r(t,"name","layer"),this.x=r(t,"x",0),this.y=r(t,"y",0),this.width=r(t,"width",0),this.height=r(t,"height",0),this.tileWidth=r(t,"tileWidth",0),this.tileHeight=r(t,"tileHeight",0),this.baseTileWidth=r(t,"baseTileWidth",this.tileWidth),this.baseTileHeight=r(t,"baseTileHeight",this.tileHeight),this.orientation=r(t,"orientation",n.ORTHOGONAL),this.widthInPixels=r(t,"widthInPixels",this.width*this.baseTileWidth),this.heightInPixels=r(t,"heightInPixels",this.height*this.baseTileHeight),this.alpha=r(t,"alpha",1),this.visible=r(t,"visible",!0),this.properties=r(t,"properties",[]),this.indexes=r(t,"indexes",[]),this.collideIndexes=r(t,"collideIndexes",[]),this.callbacks=r(t,"callbacks",[]),this.bodies=r(t,"bodies",[]),this.data=r(t,"data",[]),this.tilemapLayer=r(t,"tilemapLayer",null),this.hexSideLength=r(t,"hexSideLength",0)}});t.exports=o},16586:(t,e,i)=>{var s=i(56694),n=i(12920),r=i(72632),o=new s({initialize:function(t){void 0===t&&(t={}),this.name=r(t,"name","map"),this.width=r(t,"width",0),this.height=r(t,"height",0),this.infinite=r(t,"infinite",!1),this.tileWidth=r(t,"tileWidth",0),this.tileHeight=r(t,"tileHeight",0),this.widthInPixels=r(t,"widthInPixels",this.width*this.tileWidth),this.heightInPixels=r(t,"heightInPixels",this.height*this.tileHeight),this.format=r(t,"format",null),this.orientation=r(t,"orientation",n.ORTHOGONAL),this.renderOrder=r(t,"renderOrder","right-down"),this.version=r(t,"version","1"),this.properties=r(t,"properties",{}),this.layers=r(t,"layers",[]),this.images=r(t,"images",[]),this.objects=r(t,"objects",[]),this.collision=r(t,"collision",{}),this.tilesets=r(t,"tilesets",[]),this.imageCollections=r(t,"imageCollections",[]),this.tiles=r(t,"tiles",[]),this.hexSideLength=r(t,"hexSideLength",0)}});t.exports=o},15256:(t,e,i)=>{var s=i(56694),n=i(72632),r=new s({initialize:function(t){void 0===t&&(t={}),this.name=n(t,"name","object layer"),this.opacity=n(t,"opacity",1),this.properties=n(t,"properties",{}),this.propertyTypes=n(t,"propertytypes",{}),this.type=n(t,"type","objectgroup"),this.visible=n(t,"visible",!0),this.objects=n(t,"objects",[])}});t.exports=r},21394:(t,e,i)=>{var s=i(12920);t.exports=function(t){return"isometric"===(t=t.toLowerCase())?s.ISOMETRIC:"staggered"===t?s.STAGGERED:"hexagonal"===t?s.HEXAGONAL:s.ORTHOGONAL}},90715:(t,e,i)=>{var s=i(93560),n=i(84346),r=i(96097),o=i(2378),a=i(44909);t.exports=function(t,e,i,h,l,u){var c;switch(e){case s.ARRAY_2D:c=n(t,i,h,l,u);break;case s.CSV:c=r(t,i,h,l,u);break;case s.TILED_JSON:c=o(t,i,u);break;case s.WELTMEISTER:c=a(t,i,u);break;default:console.warn("Unrecognized tilemap data format: "+e),c=null}return c}},84346:(t,e,i)=>{var s=i(93560),n=i(94990),r=i(16586),o=i(29633);t.exports=function(t,e,i,a,h){for(var l=new n({tileWidth:i,tileHeight:a}),u=new r({name:t,tileWidth:i,tileHeight:a,format:s.ARRAY_2D,layers:[l]}),c=[],d=e.length,p=0,f=0;f{var s=i(93560),n=i(84346);t.exports=function(t,e,i,r,o){var a=e.trim().split("\n").map((function(t){return t.split(",")})),h=n(t,a,i,r,o);return h.format=s.CSV,h}},30951:(t,e,i)=>{var s=i(94990),n=i(29633);t.exports=function(t,e){for(var i=[],r=0;r-1?new n(a,p,c,u,o.tilesize,o.tilesize):e?null:new n(a,-1,c,u,o.tilesize,o.tilesize),h.push(d)}l.push(h),h=[]}a.data=l,i.push(a)}return i}},47488:(t,e,i)=>{var s=i(47975);t.exports=function(t){for(var e=[],i=[],n=0;n{var s=i(93560),n=i(16586),r=i(30951),o=i(47488);t.exports=function(t,e,i){if(0===e.layer.length)return console.warn("No layers found in the Weltmeister map: "+t),null;for(var a=0,h=0,l=0;la&&(a=e.layer[l].width),e.layer[l].height>h&&(h=e.layer[l].height);var u=new n({width:a,height:h,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:s.WELTMEISTER});return u.layers=r(e,i),u.tilesets=o(e),u}},24507:(t,e,i)=>{t.exports={ParseTileLayers:i(30951),ParseTilesets:i(47488),ParseWeltmeister:i(44909)}},34124:(t,e,i)=>{t.exports={FromOrientationString:i(21394),Parse:i(90715),Parse2DArray:i(84346),ParseCSV:i(96097),Impact:i(24507),Tiled:i(50044)}},48646:(t,e,i)=>{var s=i(98611);t.exports=function(t){for(var e,i,n,r,o,a=0;a{t.exports=function(t){for(var e=window.atob(t),i=e.length,s=new Array(i/4),n=0;n>>0;return s}},14556:(t,e,i)=>{var s=i(47975);t.exports=function(t){var e,i,n=[];for(e=0;e{var s=i(72632);t.exports=function(t,e,i){if(!e)return{i:0,layers:t.layers,name:"",opacity:1,visible:!0,x:0,y:0};var n=e.x+s(e,"startx",0)*t.tilewidth+s(e,"offsetx",0),r=e.y+s(e,"starty",0)*t.tileheight+s(e,"offsety",0);return{i:0,layers:e.layers,name:i.name+e.name+"/",opacity:i.opacity*e.opacity,visible:i.visible&&e.visible,x:i.x+n,y:i.y+r}}},8847:t=>{var e=2147483648,i=1073741824,s=536870912;t.exports=function(t){var n=Boolean(t&e),r=Boolean(t&i),o=Boolean(t&s);t&=536870911;var a=0,h=!1;return n&&r&&o?(a=Math.PI/2,h=!0):n&&r&&!o?(a=Math.PI,h=!1):n&&!r&&o?(a=Math.PI/2,h=!1):!n||r||o?!n&&r&&o?(a=3*Math.PI/2,h=!1):n||!r||o?n||r||!o?n||r||o||(a=0,h=!1):(a=3*Math.PI/2,h=!0):(a=Math.PI,h=!0):(a=0,h=!0),{gid:t,flippedHorizontal:n,flippedVertical:r,flippedAntiDiagonal:o,rotation:a,flipped:h}}},78339:(t,e,i)=>{var s=i(72632),n=i(92044);t.exports=function(t){for(var e=[],i=[],r=n(t);r.i0;)if(r.i>=r.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}r=i.pop()}else{var o=r.layers[r.i];if(r.i++,"imagelayer"===o.type){var a=s(o,"offsetx",0)+s(o,"startx",0),h=s(o,"offsety",0)+s(o,"starty",0);e.push({name:r.name+o.name,image:o.image,x:r.x+a+o.x,y:r.y+h+o.y,alpha:r.opacity*o.opacity,visible:r.visible&&o.visible,properties:s(o,"properties",{})})}else if("group"===o.type){var l=n(t,o,r);i.push(r),r=l}}return e}},2378:(t,e,i)=>{var s=i(48646),n=i(14556),r=i(12920),o=i(93560),a=i(21394),h=i(16586),l=i(78339),u=i(61136),c=i(95925),d=i(93392);t.exports=function(t,e,i){var p=new h({width:e.width,height:e.height,name:t,tileWidth:e.tilewidth,tileHeight:e.tileheight,orientation:a(e.orientation),format:o.TILED_JSON,version:e.version,properties:e.properties,renderOrder:e.renderorder,infinite:e.infinite});p.orientation===r.HEXAGONAL&&(p.hexSideLength=e.hexsidelength),p.layers=c(e,i),p.images=l(e);var f=d(e);return p.tilesets=f.tilesets,p.imageCollections=f.imageCollections,p.objects=u(e),p.tiles=n(p),s(p),p}},4281:(t,e,i)=>{var s=i(28820),n=i(8847),r=function(t){return{x:t.x,y:t.y}},o=["id","name","type","rotation","properties","visible","x","y","width","height"];t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0);var a=s(t,o);if(a.x+=e,a.y+=i,t.gid){var h=n(t.gid);a.gid=h.gid,a.flippedHorizontal=h.flippedHorizontal,a.flippedVertical=h.flippedVertical,a.flippedAntiDiagonal=h.flippedAntiDiagonal}else t.polyline?a.polyline=t.polyline.map(r):t.polygon?a.polygon=t.polygon.map(r):t.ellipse?a.ellipse=t.ellipse:t.text?a.text=t.text:t.point?a.point=!0:a.rectangle=!0;return a}},61136:(t,e,i)=>{var s=i(72632),n=i(4281),r=i(15256),o=i(92044);t.exports=function(t){for(var e=[],i=[],a=o(t);a.i0;)if(a.i>=a.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}a=i.pop()}else{var h=a.layers[a.i];if(a.i++,h.opacity*=a.opacity,h.visible=a.visible&&h.visible,"objectgroup"===h.type){h.name=a.name+h.name;for(var l=a.x+s(h,"startx",0)+s(h,"offsetx",0),u=a.y+s(h,"starty",0)+s(h,"offsety",0),c=[],d=0;d{var s=i(43908),n=i(12920),r=i(92044),o=i(21394),a=i(72632),h=i(94990),l=i(8847),u=i(29633);t.exports=function(t,e){for(var i=a(t,"infinite",!1),c=[],d=[],p=r(t);p.i0;)if(p.i>=p.layers.length){if(d.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}p=d.pop()}else{var f=p.layers[p.i];if(p.i++,"tilelayer"===f.type)if(f.compression)console.warn("TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '"+f.name+"'");else{if(f.encoding&&"base64"===f.encoding){if(f.chunks)for(var v=0;v0?((y=new u(g,m.gid,L,F,t.tilewidth,t.tileheight)).rotation=m.rotation,y.flipX=m.flipped,T[F][L]=y):(x=e?null:new u(g,-1,L,F,t.tilewidth,t.tileheight),T[F][L]=x),++w===_.width&&(R++,w=0)}}else{(g=new h({name:p.name+f.name,x:p.x+a(f,"offsetx",0)+f.x,y:p.y+a(f,"offsety",0)+f.y,width:f.width,height:f.height,tileWidth:t.tilewidth,tileHeight:t.tileheight,alpha:p.opacity*f.opacity,visible:p.visible&&f.visible,properties:a(f,"properties",[]),orientation:o(t.orientation)})).orientation===n.HEXAGONAL&&(g.hexSideLength=t.hexsidelength);for(var D=[],k=0,I=f.data.length;k0?((y=new u(g,m.gid,w,T.length,t.tilewidth,t.tileheight)).rotation=m.rotation,y.flipX=m.flipped,D.push(y)):(x=e?null:new u(g,-1,w,T.length,t.tilewidth,t.tileheight),D.push(x)),++w===f.width&&(T.push(D),w=0,D=[])}g.data=T,c.push(g)}else if("group"===f.type){var B=r(t,f,p);d.push(p),p=B}}return c}},93392:(t,e,i)=>{var s=i(47975),n=i(97042),r=i(4281),o=i(39642);t.exports=function(t){for(var e,i=[],a=[],h=null,l=0;l1){var d=void 0,p=void 0;if(Array.isArray(u.tiles)){d=d||{},p=p||{};for(var f=0;f{t.exports=function(t,e){for(var i=0;i0){var r,o,a,h={},l={};if(Array.isArray(s.edgecolors))for(r=0;r{t.exports={AssignTileProperties:i(48646),Base64Decode:i(43908),BuildTilesetIndex:i(14556),CreateGroupLayer:i(92044),ParseGID:i(8847),ParseImageLayers:i(78339),ParseJSONTiled:i(2378),ParseObject:i(4281),ParseObjectLayers:i(61136),ParseTileLayers:i(95925),ParseTilesets:i(93392)}},73779:(t,e,i)=>{var s=i(56694),n=i(91963),r=i(7599),o=i(57911),a=i(66458),h=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.now=0,this.timeScale=1,this.paused=!1,this._active=[],this._pendingInsertion=[],this._pendingRemoval=[],t.sys.events.once(r.BOOT,this.boot,this),t.sys.events.on(r.START,this.start,this)},boot:function(){this.now=this.systems.game.loop.time,this.systems.events.once(r.DESTROY,this.destroy,this)},start:function(){var t=this.systems.events;t.on(r.PRE_UPDATE,this.preUpdate,this),t.on(r.UPDATE,this.update,this),t.once(r.SHUTDOWN,this.shutdown,this)},addEvent:function(t){var e;return t instanceof o?(e=t,this.removeEvent(e),e.elapsed=e.startAt,e.hasDispatched=!1,e.repeatCount=-1===e.repeat||e.loop?999999999999:e.repeat):e=new o(t),this._pendingInsertion.push(e),e},delayedCall:function(t,e,i,s){return this.addEvent({delay:t,callback:e,args:i,callbackScope:s})},clearPendingEvents:function(){return this._pendingInsertion=[],this},removeEvent:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e-1&&this._active.splice(n,1),s.destroy()}for(i=0;i=s.delay)){var n=s.elapsed-s.delay;if(s.elapsed=s.delay,!s.hasDispatched&&s.callback&&(s.hasDispatched=!0,s.callback.apply(s.callbackScope,s.args)),s.repeatCount>0){if(s.repeatCount--,n>=s.delay)for(;n>=s.delay&&s.repeatCount>0;)s.callback&&s.callback.apply(s.callbackScope,s.args),n-=s.delay,s.repeatCount--;s.elapsed=n,s.hasDispatched=!1}else s.hasDispatched&&this._pendingRemoval.push(s)}}}},shutdown:function(){var t;for(t=0;t{var s=i(56694),n=i(72632),r=new s({initialize:function(t){this.delay=0,this.repeat=0,this.repeatCount=0,this.loop=!1,this.callback,this.callbackScope,this.args,this.timeScale=1,this.startAt=0,this.elapsed=0,this.paused=!1,this.hasDispatched=!1,this.reset(t)},reset:function(t){return this.delay=n(t,"delay",0),this.repeat=n(t,"repeat",0),this.loop=n(t,"loop",!1),this.callback=n(t,"callback",void 0),this.callbackScope=n(t,"callbackScope",this.callback),this.args=n(t,"args",[]),this.timeScale=n(t,"timeScale",1),this.startAt=n(t,"startAt",0),this.paused=n(t,"paused",!1),this.elapsed=this.startAt,this.hasDispatched=!1,this.repeatCount=-1===this.repeat||this.loop?999999999999:this.repeat,this},getProgress:function(){return this.elapsed/this.delay},getOverallProgress:function(){if(this.repeat>0){var t=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/t}return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return.001*this.elapsed},getRemaining:function(){return this.delay-this.elapsed},getRemainingSeconds:function(){return.001*this.getRemaining()},getOverallRemaining:function(){return this.delay*(1+this.repeatCount)-this.elapsed},getOverallRemainingSeconds:function(){return.001*this.getOverallRemaining()},remove:function(t){void 0===t&&(t=!1),this.elapsed=this.delay,this.hasDispatched=!t,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});t.exports=r},97121:(t,e,i)=>{t.exports={Clock:i(73779),TimerEvent:i(57911)}},28860:(t,e,i)=>{var s=i(56694),n=i(6659),r=i(54272),o=i(68061),a=i(55303),h=new s({Extends:n,initialize:function(t){n.call(this),this.manager=t,this.isTimeline=!0,this.data=[],this.totalData=0,this.useFrames=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.completeDelay=0,this.countdown=0,this.state=a.PENDING_ADD,this._pausedState=a.PENDING_ADD,this.paused=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.callbacks={onComplete:null,onLoop:null,onStart:null,onUpdate:null,onYoyo:null},this.callbackScope},dispatchTimelineEvent:function(t,e){this.emit(t,this),e&&e.func.apply(e.scope,e.params)},setTimeScale:function(t){return this.timeScale=t,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return this.state===a.ACTIVE},add:function(t){return this.queue(o(this,t))},queue:function(t){return this.isPlaying()||(t.parent=this,t.parentIsTimeline=!0,this.data.push(t),this.totalData=this.data.length),this},hasOffset:function(t){return null!==t.offset},isOffsetAbsolute:function(t){return"number"==typeof t},isOffsetRelative:function(t){if("string"===typeof t){var e=t[0];if("-"===e||"+"===e)return!0}return!1},getRelativeOffset:function(t,e){var i=t[0],s=parseFloat(t.substr(2)),n=e;switch(i){case"+":n+=s;break;case"-":n-=s}return Math.max(0,n)},calcDuration:function(){for(var t=0,e=0,i=0,s=0;s0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},init:function(){return this.calcDuration(),this.progress=0,this.totalProgress=0,!this.paused||(this.state=a.PAUSED,!1)},resetTweens:function(t){for(var e=0;e0?(this.elapsed=0,this.progress=0,this.loopCounter--,this.resetTweens(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=a.LOOP_DELAY):(this.state=a.ACTIVE,this.dispatchTimelineEvent(r.TIMELINE_LOOP,this.callbacks.onLoop))):this.completeDelay>0?(this.state=a.COMPLETE_DELAY,this.countdown=this.completeDelay):(this.state=a.PENDING_REMOVE,this.dispatchTimelineEvent(r.TIMELINE_COMPLETE,this.callbacks.onComplete))},update:function(t,e){if(this.state!==a.PAUSED){switch(this.useFrames&&(e=1*this.manager.timeScale),e*=this.timeScale,this.elapsed+=e,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=e,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),this.state){case a.ACTIVE:for(var i=this.totalData,s=0;s{var s=i(66458),n=i(56694),r=i(68710),o=i(91963),a=i(7599),h=i(91944),l=i(32981),u=i(55303),c=i(68061),d=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.timeScale=1,this._add=[],this._pending=[],this._active=[],this._destroy=[],this._toProcess=0,t.sys.events.once(a.BOOT,this.boot,this),t.sys.events.on(a.START,this.start,this)},boot:function(){this.systems.events.once(a.DESTROY,this.destroy,this)},start:function(){var t=this.systems.events;t.on(a.PRE_UPDATE,this.preUpdate,this),t.on(a.UPDATE,this.update,this),t.once(a.SHUTDOWN,this.shutdown,this),this.timeScale=1},createTimeline:function(t){return l(this,t)},timeline:function(t){var e=l(this,t);return e.paused||(this._add.push(e),this._toProcess++),e},create:function(t){return c(this,t)},add:function(t){var e=c(this,t);return this._add.push(e),this._toProcess++,e},existing:function(t){return this._add.push(t),this._toProcess++,this},addCounter:function(t){var e=r(this,t);return this._add.push(e),this._toProcess++,e},stagger:function(t,e){return h(t,e)},preUpdate:function(){if(0!==this._toProcess){var t,e,i=this._destroy,s=this._active,n=this._pending;for(t=0;t-1&&(e.state=u.REMOVED,n.splice(r,1)):(e.state=u.REMOVED,s.splice(r,1))}for(i.length=0,i=this._add,t=0;t{t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},21902:(t,e,i)=>{var s=i(35060),n=i(40587);t.exports=function(t,e){var i=s.Power0;if("string"==typeof t)if(s.hasOwnProperty(t))i=s[t];else{var r="";t.indexOf(".")&&("in"===(r=t.substr(t.indexOf(".")+1)).toLowerCase()?r="easeIn":"out"===r.toLowerCase()?r="easeOut":"inout"===r.toLowerCase()&&(r="easeInOut")),t=n(t.substr(0,t.indexOf(".")+1)+r),s.hasOwnProperty(t)&&(i=s[t])}else"function"==typeof t?i=t:Array.isArray(t)&&t.length;if(!e)return i;var o=e.slice(0);return o.unshift(0),function(t){return o[0]=t,i.apply(this,o)}}},28348:t=>{t.exports=function(t,e,i){var s;t.hasOwnProperty(e)?s="function"===typeof t[e]?function(i,s,n,r,o,a){return t[e](i,s,n,r,o,a)}:function(){return t[e]}:s="function"==typeof i?i:function(){return i};return s}},92407:(t,e,i)=>{var s=i(53709);t.exports=function(t){var e,i=[];if(t.hasOwnProperty("props"))for(e in t.props)"_"!==e.substr(0,1)&&i.push({key:e,value:t.props[e]});else for(e in t)-1===s.indexOf(e)&&"_"!==e.substr(0,1)&&i.push({key:e,value:t[e]});return i}},65868:(t,e,i)=>{var s=i(10850);t.exports=function(t){var e=s(t,"targets",null);return null===e||("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e])),e}},10365:(t,e,i)=>{var s=i(10850);t.exports=function(t){var e=s(t,"tweens",null);return null===e?[]:("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e]),e)}},9744:t=>{function e(t){return!!t.getActive&&"function"==typeof t.getActive}function i(t){return!!t.getStart&&"function"==typeof t.getStart}function s(t){return!!t.getEnd&&"function"==typeof t.getEnd}var n=function(t,r){var o,a,h=function(t,e,i){return i},l=function(t,e,i){return i},u=null,c=typeof r;if("number"===c)h=function(){return r};else if("string"===c){var d=r[0],p=parseFloat(r.substr(2));switch(d){case"+":h=function(t,e,i){return i+p};break;case"-":h=function(t,e,i){return i-p};break;case"*":h=function(t,e,i){return i*p};break;case"/":h=function(t,e,i){return i/p};break;default:h=function(){return parseFloat(r)}}}else if("function"===c)h=r;else if("object"===c)if(i(a=r)||s(a)||e(a))e(r)&&(u=r.getActive),s(r)&&(h=r.getEnd),i(r)&&(l=r.getStart);else if(r.hasOwnProperty("value"))o=n(t,r.value);else{var f=r.hasOwnProperty("to"),v=r.hasOwnProperty("from"),g=r.hasOwnProperty("start");if(f&&(v||g)){if(o=n(t,r.to),g){var m=n(t,r.start);o.getActive=m.getEnd}if(v){var y=n(t,r.from);o.getStart=y.getEnd}}}return o||(o={getActive:u,getEnd:h,getStart:l}),o};t.exports=n},68710:(t,e,i)=>{var s=i(99730),n=i(20494),r=i(63130),o=i(21902),a=i(28348),h=i(10850),l=i(9744),u=i(39366),c=i(15718);t.exports=function(t,e,i){void 0===i&&(i=s);var d=h(e,"from",0),p=h(e,"to",1),f=[{value:d}],v=a(e,"delay",i.delay),g=a(e,"duration",i.duration),m=h(e,"easeParams",i.easeParams),y=o(h(e,"ease",i.ease),m),x=a(e,"hold",i.hold),T=a(e,"repeat",i.repeat),w=a(e,"repeatDelay",i.repeatDelay),b=r(e,"yoyo",i.yoyo),E=[],S=l("value",p),A=c(f[0],0,"value",S.getEnd,S.getStart,S.getActive,y,v,g,b,x,T,w,!1,!1);A.start=d,A.current=d,A.to=p,E.push(A);var _=new u(t,E,f);_.offset=n(e,"offset",null),_.completeDelay=n(e,"completeDelay",0),_.loop=Math.round(n(e,"loop",0)),_.loopDelay=Math.round(n(e,"loopDelay",0)),_.paused=r(e,"paused",!1),_.useFrames=r(e,"useFrames",!1);for(var C=h(e,"callbackScope",_),M=u.TYPES,R=0;R{var s=i(21902),n=i(10850),r=i(83392);t.exports=function(t,e){var i;void 0===e&&(e={});var o=n(e,"start",0),a=n(e,"ease",null),h=n(e,"grid",null),l=n(e,"from",0),u="first"===l,c="center"===l,d="last"===l,p="number"==typeof l,f=Array.isArray(t),v=f?parseFloat(t[0]):parseFloat(t),g=f?parseFloat(t[1]):0,m=Math.max(v,g);if(f&&(o+=v),h){var y=h[0],x=h[1],T=0,w=0,b=0,E=0,S=[];d?(T=y-1,w=x-1):p?(T=l%y,w=Math.floor(l/y)):c&&(T=(y-1)/2,w=(x-1)/2);for(var A=r.MIN_SAFE_INTEGER,_=0;_A&&(A=M),S[_][C]=M}}}var R=a?s(a):null;return i=h?function(t,e,i,s){var n,r=0,a=s%y,h=Math.floor(s/y);if(a>=0&&a=0&&h{var s=i(32742),n=i(99730),r=i(20494),o=i(63130),a=i(21902),h=i(28348),l=i(65868),u=i(10365),c=i(10850),d=i(28860),p=i(68061);t.exports=function(t,e){var i=new d(t);i.completeDelay=r(e,"completeDelay",0),i.loop=Math.round(r(e,"loop",0)),i.loopDelay=Math.round(r(e,"loopDelay",0)),i.paused=o(e,"paused",!1),i.useFrames=o(e,"useFrames",!1);var f=c(e,"callbackScope",i),v=c(e,"onStart",!1);if(v){var g=c(e,"onStartScope",f),m=c(e,"onStartParams",[]);i.setCallback("onStart",v,m,g)}var y=c(e,"onUpdate",!1);if(y){var x=c(e,"onUpdateScope",f),T=c(e,"onUpdateParams",[]);i.setCallback("onUpdate",y,T,x)}var w=c(e,"onLoop",!1);if(w){var b=c(e,"onLoopScope",f),E=c(e,"onLoopParams",[]);i.setCallback("onLoop",w,E,b)}var S=c(e,"onYoyo",!1);if(S){var A=c(e,"onYoyoScope",f),_=c(e,"onYoyoParams",[]);i.setCallback("onYoyo",S,_,A)}var C=c(e,"onComplete",!1);if(C){var M=c(e,"onCompleteScope",f),R=c(e,"onCompleteParams",[]);i.setCallback("onComplete",C,R,M)}var P=u(e);if(0===P.length)return i.paused=!0,i;var O=s(n);O.targets=l(e);var L=r(e,"totalDuration",0);O.duration=L>0?Math.floor(L/P.length):h(e,"duration",O.duration),O.delay=h(e,"delay",O.delay),O.easeParams=c(e,"easeParams",O.easeParams),O.ease=a(c(e,"ease",O.ease),O.easeParams),O.hold=h(e,"hold",O.hold),O.repeat=h(e,"repeat",O.repeat),O.repeatDelay=h(e,"repeatDelay",O.repeatDelay),O.yoyo=o(e,"yoyo",O.yoyo),O.flipX=o(e,"flipX",O.flipX),O.flipY=o(e,"flipY",O.flipY);for(var F=0;F{var s=i(99730),n=i(20494),r=i(63130),o=i(21902),a=i(28348),h=i(92407),l=i(65868),u=i(10850),c=i(9744),d=i(39366),p=i(15718);t.exports=function(t,e,i){void 0===i&&(i=s);for(var f=i.targets?i.targets:l(e),v=h(e),g=a(e,"delay",i.delay),m=a(e,"duration",i.duration),y=u(e,"easeParams",i.easeParams),x=o(u(e,"ease",i.ease),y),T=a(e,"hold",i.hold),w=a(e,"repeat",i.repeat),b=a(e,"repeatDelay",i.repeatDelay),E=r(e,"yoyo",i.yoyo),S=r(e,"flipX",i.flipX),A=r(e,"flipY",i.flipY),_=[],C=0;C{t.exports={GetBoolean:i(63130),GetEaseFunction:i(21902),GetNewValue:i(28348),GetProps:i(92407),GetTargets:i(65868),GetTweens:i(10365),GetValueOp:i(9744),NumberTweenBuilder:i(68710),StaggerBuilder:i(91944),TimelineBuilder:i(32981),TweenBuilder:i(68061)}},51910:t=>{t.exports="complete"},76826:t=>{t.exports="loop"},59953:t=>{t.exports="pause"},92495:t=>{t.exports="resume"},55493:t=>{t.exports="start"},48224:t=>{t.exports="update"},5570:t=>{t.exports="active"},6383:t=>{t.exports="complete"},72582:t=>{t.exports="loop"},80803:t=>{t.exports="repeat"},10472:t=>{t.exports="start"},5379:t=>{t.exports="stop"},43449:t=>{t.exports="update"},61541:t=>{t.exports="yoyo"},54272:(t,e,i)=>{t.exports={TIMELINE_COMPLETE:i(51910),TIMELINE_LOOP:i(76826),TIMELINE_PAUSE:i(59953),TIMELINE_RESUME:i(92495),TIMELINE_START:i(55493),TIMELINE_UPDATE:i(48224),TWEEN_ACTIVE:i(5570),TWEEN_COMPLETE:i(6383),TWEEN_LOOP:i(72582),TWEEN_REPEAT:i(80803),TWEEN_START:i(10472),TWEEN_STOP:i(5379),TWEEN_UPDATE:i(43449),TWEEN_YOYO:i(61541)}},75193:(t,e,i)=>{var s=i(55303),n=i(98611),r={Builders:i(79619),Events:i(54272),TweenManager:i(64532),Tween:i(39366),TweenData:i(15718),Timeline:i(28860)};r=n(!1,r,s),t.exports=r},99730:t=>{t.exports={targets:null,delay:0,duration:1e3,ease:"Power0",easeParams:null,hold:0,repeat:0,repeatDelay:0,yoyo:!1,flipX:!1,flipY:!1}},53709:t=>{t.exports=["callbackScope","completeDelay","delay","duration","ease","easeParams","flipX","flipY","hold","loop","loopDelay","offset","onActive","onActiveParams","onActiveScope","onComplete","onCompleteParams","onCompleteScope","onLoop","onLoopParams","onLoopScope","onRepeat","onRepeatParams","onRepeatScope","onStart","onStartParams","onStartScope","onStop","onStopParams","onStopScope","onUpdate","onUpdateParams","onUpdateScope","onYoyo","onYoyoParams","onYoyoScope","paused","props","repeat","repeatDelay","targets","useFrames","yoyo"]},39366:(t,e,i)=>{var s=i(56694),n=i(6659),r=i(54272),o=i(99325),a=i(61286),h=i(55303),l=i(83392),u=new s({Extends:n,initialize:function(t,e,i){n.call(this),this.parent=t,this.parentIsTimeline=t.hasOwnProperty("isTimeline"),this.data=e,this.totalData=e.length,this.targets=i,this.totalTargets=i.length,this.useFrames=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.startDelay=0,this.hasStarted=!1,this.isSeeking=!1,this.completeDelay=0,this.countdown=0,this.offset=0,this.calculatedOffset=0,this.state=h.PENDING_ADD,this._pausedState=h.INIT,this.paused=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.callbacks={onActive:null,onComplete:null,onLoop:null,onRepeat:null,onStart:null,onStop:null,onUpdate:null,onYoyo:null},this.callbackScope},getValue:function(t){return void 0===t&&(t=0),this.data[t].current},setTimeScale:function(t){return this.timeScale=t,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return this.state===h.ACTIVE},isPaused:function(){return this.state===h.PAUSED},hasTarget:function(t){return-1!==this.targets.indexOf(t)},updateTo:function(t,e,i){void 0===i&&(i=!1);for(var s=0;s0&&(n.totalDuration+=n.t2*n.repeat),n.totalDuration>t&&(t=n.totalDuration),n.delay0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay,this.startDelay=e},init:function(){if(this.paused&&!this.parentIsTimeline)return this.state=h.PENDING_ADD,this._pausedState=h.INIT,!1;for(var t=this.data,e=this.totalTargets,i=0;i0?(this.elapsed=0,this.progress=0,this.loopCounter--,this.resetTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=h.LOOP_DELAY):(this.state=h.ACTIVE,this.dispatchTweenEvent(r.TWEEN_LOOP,this.callbacks.onLoop))):this.completeDelay>0?(this.state=h.COMPLETE_DELAY,this.countdown=this.completeDelay):(this.state=h.PENDING_REMOVE,this.dispatchTweenEvent(r.TWEEN_COMPLETE,this.callbacks.onComplete))},pause:function(){return this.state===h.PAUSED||(this.paused=!0,this._pausedState=this.state,this.state=h.PAUSED),this},play:function(t){void 0===t&&(t=!1);var e=this.state;return e!==h.INIT||this.parentIsTimeline?e===h.ACTIVE||e===h.PENDING_ADD&&this._pausedState===h.PENDING_ADD?this:this.parentIsTimeline||e!==h.PENDING_REMOVE&&e!==h.REMOVED?(this.parentIsTimeline?(this.resetTweenData(t),0===this.calculatedOffset?this.state=h.ACTIVE:(this.countdown=this.calculatedOffset,this.state=h.OFFSET_DELAY)):this.paused?(this.paused=!1,this.makeActive()):(this.resetTweenData(t),this.state=h.ACTIVE,this.makeActive()),this):(this.seek(0),this.parent.makeActive(this),this):(this.resetTweenData(!1),this.state=h.ACTIVE,this)},resetTweenData:function(t){for(var e=this.data,i=this.totalData,s=this.totalTargets,n=0;n0&&(r.elapsed=r.delay,r.state=h.DELAY),r.getActiveValue&&(o[a]=r.getActiveValue(r.target,r.key,r.start))}},resume:function(){return this.state===h.PAUSED?(this.paused=!1,this.state=this._pausedState):this.play(),this},seek:function(t,e){void 0===e&&(e=16.6),this.state===h.REMOVED&&this.makeActive(),this.elapsed=0,this.progress=0,this.totalElapsed=0,this.totalProgress=0;for(var i=this.data,s=this.totalTargets,n=0;n0&&(r.elapsed=r.delay,r.state=h.DELAY)}this.calcDuration();var c=!1;this.state===h.PAUSED&&(c=!0,this.state=h.ACTIVE),this.isSeeking=!0;do{this.update(0,e)}while(this.totalProgress0?(e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY(),e.start=e.getStartValue(e.target,e.key,e.start,e.index,t.totalTargets,t),e.end=e.getEndValue(e.target,e.key,e.start,e.index,t.totalTargets,t),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,h.REPEAT_DELAY):(this.dispatchTweenDataEvent(r.TWEEN_REPEAT,t.callbacks.onRepeat,e),h.PLAYING_FORWARD)):h.COMPLETE},setStateFromStart:function(t,e,i){return e.repeatCounter>0?(e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY(),e.end=e.getEndValue(e.target,e.key,e.start,e.index,t.totalTargets,t),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,h.REPEAT_DELAY):(this.dispatchTweenDataEvent(r.TWEEN_REPEAT,t.callbacks.onRepeat,e),h.PLAYING_FORWARD)):h.COMPLETE},updateTweenData:function(t,e,i){var s=e.target;switch(e.state){case h.PLAYING_FORWARD:case h.PLAYING_BACKWARD:if(!s){e.state=h.COMPLETE;break}var n=e.elapsed,o=e.duration,a=0;(n+=i)>o&&(a=n-o,n=o);var l=e.state===h.PLAYING_FORWARD,u=n/o;if(e.elapsed=n,e.progress=u,e.previous=e.current,1===u)l?(e.current=e.end,s[e.key]=e.end,e.hold>0?(e.elapsed=e.hold-a,e.state=h.HOLD_DELAY):e.state=this.setStateFromEnd(t,e,a)):(e.current=e.start,s[e.key]=e.start,e.state=this.setStateFromStart(t,e,a));else{var c=l?e.ease(u):e.ease(1-u);e.current=e.start+(e.end-e.start)*c,s[e.key]=e.current}this.dispatchTweenDataEvent(r.TWEEN_UPDATE,t.callbacks.onUpdate,e);break;case h.DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=h.PENDING_RENDER);break;case h.REPEAT_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=h.PLAYING_FORWARD,this.dispatchTweenDataEvent(r.TWEEN_REPEAT,t.callbacks.onRepeat,e));break;case h.HOLD_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.state=this.setStateFromEnd(t,e,Math.abs(e.elapsed)));break;case h.PENDING_RENDER:s?(e.start=e.getStartValue(s,e.key,s[e.key],e.index,t.totalTargets,t),e.end=e.getEndValue(s,e.key,e.start,e.index,t.totalTargets,t),e.current=e.start,s[e.key]=e.start,e.state=h.PLAYING_FORWARD):e.state=h.COMPLETE}return e.state!==h.COMPLETE}});u.TYPES=["onActive","onComplete","onLoop","onRepeat","onStart","onStop","onUpdate","onYoyo"],a.register("tween",(function(t){return this.scene.sys.tweens.add(t)})),o.register("tween",(function(t){return this.scene.sys.tweens.create(t)})),t.exports=u},15718:t=>{t.exports=function(t,e,i,s,n,r,o,a,h,l,u,c,d,p,f){return{target:t,index:e,key:i,getActiveValue:r,getEndValue:s,getStartValue:n,ease:o,duration:0,totalDuration:0,delay:0,yoyo:l,hold:0,repeat:0,repeatDelay:0,flipX:p,flipY:f,progress:0,elapsed:0,repeatCounter:0,start:0,previous:0,current:0,end:0,t1:0,t2:0,gen:{delay:a,duration:h,hold:u,repeat:c,repeatDelay:d},state:0}}},55303:t=>{t.exports={CREATED:0,INIT:1,DELAY:2,OFFSET_DELAY:3,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING_ADD:20,PAUSED:21,LOOP_DELAY:22,ACTIVE:23,COMPLETE_DELAY:24,PENDING_REMOVE:25,REMOVED:26}},56694:t=>{function e(t,e,i){var s=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&s.value&&"object"==typeof s.value&&(s=s.value),!(!s||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(s))&&(void 0===s.enumerable&&(s.enumerable=!0),void 0===s.configurable&&(s.configurable=!0),s)}function i(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function s(t,s,n,o){for(var a in s)if(s.hasOwnProperty(a)){var h=e(s,a,n);if(!1!==h){if(i((o||t).prototype,a)){if(r.ignoreFinals)continue;throw new Error("cannot override final property '"+a+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,a,h)}else t.prototype[a]=s[a]}}function n(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i{t.exports=function(){}},78991:t=>{t.exports=function(t,e,i,s,n){if(void 0===n&&(n=t),i>0){var r=i-t.length;if(r<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),s&&s.call(n,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.splice(o,1),o--;if(0===(o=e.length))return null;i>0&&o>r&&(e.splice(r),o=r);for(var a=0;a{t.exports=function(t,e,i,s,n,r){if(void 0===i&&(i=0),void 0===r&&(r=t),s>0){var o=s-t.length;if(o<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),n&&n.call(r,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.pop(),a--;if(0===(a=e.length))return null;s>0&&a>o&&(e.splice(o),a=o);for(var h=a-1;h>=0;h--){var l=e[h];t.splice(i,0,l),n&&n.call(r,l)}return e}},58742:t=>{t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i{var s=i(45838);t.exports=function(t,e,i,n,r){void 0===n&&(n=0),void 0===r&&(r=t.length);var o=0;if(s(t,n,r))for(var a=n;a{t.exports=function(t,e,i){var s,n=[null];for(s=3;s{var s=i(45838);t.exports=function(t,e,i,n,r){if(void 0===n&&(n=0),void 0===r&&(r=t.length),s(t,n,r)){var o,a=[null];for(o=5;o{t.exports=function(t,e,i){if(!e.length)return NaN;if(1===e.length)return e[0];var s,n,r=1;if(i){if(te.length&&(r=e.length),i?(s=e[r-1][i],(n=e[r][i])-t<=t-s?e[r]:e[r-1]):(s=e[r-1],(n=e[r])-t<=t-s?n:s)}},71608:(t,e,i)=>{var s=i(45838);t.exports=function(t,e,i,n,r){void 0===n&&(n=0),void 0===r&&(r=t.length);var o=[];if(s(t,n,r))for(var a=n;a{var s=i(45838);t.exports=function(t,e,i,n,r){if(void 0===n&&(n=0),void 0===r&&(r=t.length),s(t,n,r))for(var o=n;o{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var s=e+Math.floor(Math.random()*i);return void 0===t[s]?null:t[s]}},24218:t=>{t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),n=t.indexOf(i);if(s<0||n<0)throw new Error("Supplied items must be elements of the same array");return s>n||(t.splice(s,1),n===t.length-1?t.push(e):t.splice(n,0,e)),t}},58258:t=>{t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),n=t.indexOf(i);if(s<0||n<0)throw new Error("Supplied items must be elements of the same array");return s{t.exports=function(t,e){var i=t.indexOf(e);if(i>0){var s=t[i-1],n=t.indexOf(s);t[i]=s,t[n]=e}return t}},68396:t=>{t.exports=function(t,e,i){var s=t.indexOf(e);if(-1===s||i<0||i>=t.length)throw new Error("Supplied index out of bounds");return s!==i&&(t.splice(s,1),t.splice(i,0,e)),e}},27555:t=>{t.exports=function(t,e){var i=t.indexOf(e);if(-1!==i&&i{t.exports=function(t,e,i,s){var n,r=[],o=!1;if((i||s)&&(o=!0,i||(i=""),s||(s="")),e=e;n--)o?r.push(i+n.toString()+s):r.push(n);else for(n=t;n<=e;n++)o?r.push(i+n.toString()+s):r.push(n);return r}},89955:(t,e,i)=>{var s=i(67233);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var n=[],r=Math.max(s((e-t)/(i||1)),0),o=0;o{function e(t,e,i){var s=t[e];t[e]=t[i],t[i]=s}function i(t,e){return te?1:0}var s=function(t,n,r,o,a){for(void 0===r&&(r=0),void 0===o&&(o=t.length-1),void 0===a&&(a=i);o>r;){if(o-r>600){var h=o-r+1,l=n-r+1,u=Math.log(h),c=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*c*(h-c)/h)*(l-h/2<0?-1:1),p=Math.max(r,Math.floor(n-l*c/h+d)),f=Math.min(o,Math.floor(n+(h-l)*c/h+d));s(t,n,p,f,a)}var v=t[n],g=r,m=o;for(e(t,r,n),a(t[o],v)>0&&e(t,r,o);g0;)m--}0===a(t[r],v)?e(t,r,m):e(t,++m,o),m<=n&&(r=m+1),n<=m&&(o=m-1)}};t.exports=s},75757:(t,e,i)=>{var s=i(10850),n=i(18592),r=function(t,e,i){for(var s=[],n=0;n{var s=i(72677);t.exports=function(t,e,i,n){var r;if(void 0===n&&(n=t),!Array.isArray(e))return-1!==(r=t.indexOf(e))?(s(t,r),i&&i.call(n,e),e):null;for(var o=e.length-1,a=[];o>=0;){var h=e[o];-1!==(r=t.indexOf(h))&&(s(t,r),a.push(h),i&&i.call(n,h)),o--}return a}},8324:(t,e,i)=>{var s=i(72677);t.exports=function(t,e,i,n){if(void 0===n&&(n=t),e<0||e>t.length-1)throw new Error("Index out of bounds");var r=s(t,e);return i&&i.call(n,r),r}},47427:(t,e,i)=>{var s=i(45838);t.exports=function(t,e,i,n,r){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===r&&(r=t),s(t,e,i)){var o=i-e,a=t.splice(e,o);if(n)for(var h=0;h{var s=i(72677);t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var n=e+Math.floor(Math.random()*i);return s(t,n)}},80402:t=>{t.exports=function(t,e,i){var s=t.indexOf(e),n=t.indexOf(i);return-1!==s&&-1===n&&(t[s]=i,!0)}},77640:t=>{t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,s=0;s{t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,s=0;s{t.exports=function(t,e,i,s){var n=t.length;if(e<0||e>n||e>=i||i>n||e+i>n){if(s)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},27847:t=>{t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i>0&&(t.splice(i,1),t.unshift(e)),e}},6034:(t,e,i)=>{var s=i(45838);t.exports=function(t,e,i,n,r){if(void 0===n&&(n=0),void 0===r&&(r=t.length),s(t,n,r))for(var o=n;o{t.exports=function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(Math.random()*(e+1)),s=t[e];t[e]=t[i],t[i]=s}return t}},28834:t=>{t.exports=function(t){var e=/\D/g;return t.sort((function(t,i){return parseInt(t.replace(e,""),10)-parseInt(i.replace(e,""),10)})),t}},72677:t=>{t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,s=t[e],n=e;n{function e(t,e){return String(t).localeCompare(e)}function i(t,e,i,s){var n,r,o,a,h,l=t.length,u=0,c=2*i;for(n=0;nl&&(r=l),o>l&&(o=l),a=n,h=r;;)if(a{t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),n=t.indexOf(i);if(s<0||n<0)throw new Error("Supplied items must be elements of the same array");return t[s]=i,t[n]=e,t}},59959:(t,e,i)=>{t.exports={Matrix:i(13515),Add:i(78991),AddAt:i(48522),BringToTop:i(58742),CountAllMatching:i(30164),Each:i(36337),EachInRange:i(46208),FindClosestInSorted:i(2406),GetAll:i(71608),GetFirst:i(51463),GetRandom:i(72861),MoveDown:i(51172),MoveTo:i(68396),MoveUp:i(27555),MoveAbove:i(24218),MoveBelow:i(58258),NumberArray:i(13401),NumberArrayStep:i(89955),QuickSelect:i(53466),Range:i(75757),Remove:i(66458),RemoveAt:i(8324),RemoveBetween:i(47427),RemoveRandomElement:i(50147),Replace:i(80402),RotateLeft:i(77640),RotateRight:i(38487),SafeRange:i(45838),SendToBack:i(27847),SetAll:i(6034),Shuffle:i(18592),SortByDigits:i(28834),SpliceOne:i(72677),StableSort:i(17922),Swap:i(96928)}},97494:t=>{t.exports=function(t){if(!Array.isArray(t)||!Array.isArray(t[0]))return!1;for(var e=t[0].length,i=1;i{var s=i(76400),n=i(97494);t.exports=function(t){var e="";if(!n(t))return e;for(var i=0;i{t.exports=function(t){return t.reverse()}},51995:t=>{t.exports=function(t){for(var e=0;e{var s=i(63515);t.exports=function(t){return s(t,180)}},42549:(t,e,i)=>{var s=i(63515);t.exports=function(t){return s(t,90)}},63515:(t,e,i)=>{var s=i(97494),n=i(78581);t.exports=function(t,e){if(void 0===e&&(e=90),!s(t))return null;if("string"!=typeof e&&(e=(e%360+360)%360),90===e||-270===e||"rotateLeft"===e)(t=n(t)).reverse();else if(-90===e||270===e||"rotateRight"===e)t.reverse(),t=n(t);else if(180===Math.abs(e)||"rotate180"===e){for(var i=0;i{var s=i(63515);t.exports=function(t){return s(t,-90)}},27365:(t,e,i)=>{var s=i(77640),n=i(38487);t.exports=function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),0!==i&&(i<0?s(t,Math.abs(i)):n(t,i)),0!==e)for(var r=0;r{t.exports=function(t){for(var e=t.length,i=t[0].length,s=new Array(i),n=0;n-1;r--)s[n][r]=t[r][n]}return s}},13515:(t,e,i)=>{t.exports={CheckMatrix:i(97494),MatrixToString:i(68428),ReverseColumns:i(59521),ReverseRows:i(51995),Rotate180:i(89011),RotateLeft:i(42549),RotateMatrix:i(63515),RotateRight:i(14305),Translate:i(27365),TransposeMatrix:i(78581)}},40581:t=>{var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";t.exports=function(t,i){for(var s=new Uint8Array(t),n=s.length,r=i?"data:"+i+";base64,":"",o=0;o>2],r+=e[(3&s[o])<<4|s[o+1]>>4],r+=e[(15&s[o+1])<<2|s[o+2]>>6],r+=e[63&s[o+2]];return n%3==2?r=r.substring(0,r.length-1)+"=":n%3==1&&(r=r.substring(0,r.length-2)+"=="),r}},82329:t=>{for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(256),s=0;s>4,u[h++]=(15&s)<<4|n>>2,u[h++]=(3&n)<<6|63&r;return l}},78417:(t,e,i)=>{t.exports={ArrayBufferToBase64:i(40581),Base64ToArrayBuffer:i(82329)}},22178:(t,e,i)=>{t.exports={Array:i(59959),Base64:i(78417),Objects:i(64615),String:i(50379),NOOP:i(72283)}},32742:t=>{t.exports=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i]=t[i].slice(0):e[i]=t[i];return e}},28699:t=>{var e=function(t){var i,s,n;if("object"!=typeof t||null===t)return t;for(n in i=Array.isArray(t)?[]:{},t)s=t[n],i[n]=e(s);return i};t.exports=e},98611:(t,e,i)=>{var s=i(42911),n=function(){var t,e,i,r,o,a,h=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof h&&(c=h,h=arguments[1]||{},l=2),u===l&&(h=this,--l);l{var s=i(5923),n=i(10850);t.exports=function(t,e,i){var r=n(t,e,null);if(null===r)return i;if(Array.isArray(r))return s.RND.pick(r);if("object"==typeof r){if(r.hasOwnProperty("randInt"))return s.RND.integerInRange(r.randInt[0],r.randInt[1]);if(r.hasOwnProperty("randFloat"))return s.RND.realInRange(r.randFloat[0],r.randFloat[1])}else if("function"==typeof r)return r(e);return r}},72632:t=>{t.exports=function(t,e,i){var s=typeof t;return t&&"number"!==s&&"string"!==s&&t.hasOwnProperty(e)&&void 0!==t[e]?t[e]:i}},94324:(t,e,i)=>{var s=i(10850),n=i(82897);t.exports=function(t,e,i,r,o){void 0===o&&(o=i);var a=s(t,e,o);return n(a,i,r)}},10850:t=>{t.exports=function(t,e,i){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return t[e];if(-1!==e.indexOf(".")){for(var s=e.split("."),n=t,r=i,o=0;o{t.exports=function(t,e){for(var i=0;i{t.exports=function(t,e){for(var i=0;i{t.exports=function(t,e){return t.hasOwnProperty(e)}},42911:t=>{t.exports=function(t){if("object"!=typeof t||t.nodeType||t===t.window)return!1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0}},30657:(t,e,i)=>{var s=i(32742);t.exports=function(t,e){var i=s(t);for(var n in e)i.hasOwnProperty(n)||(i[n]=e[n]);return i}},72066:(t,e,i)=>{var s=i(32742);t.exports=function(t,e){var i=s(t);for(var n in e)i.hasOwnProperty(n)&&(i[n]=e[n]);return i}},28820:(t,e,i)=>{var s=i(19256);t.exports=function(t,e){for(var i={},n=0;n{t.exports=function(t,e,i){if(!t||"number"==typeof t)return!1;if(t.hasOwnProperty(e))return t[e]=i,!0;if(-1!==e.indexOf(".")){for(var s=e.split("."),n=t,r=t,o=0;o{t.exports={Clone:i(32742),DeepCopy:i(28699),Extend:i(98611),GetAdvancedValue:i(20494),GetFastValue:i(72632),GetMinMaxValue:i(94324),GetValue:i(10850),HasAll:i(87701),HasAny:i(53523),HasValue:i(19256),IsPlainObject:i(42911),Merge:i(30657),MergeRight:i(72066),Pick:i(28820),SetValue:i(22440)}},69429:t=>{t.exports=function(t,e){return t.replace(/%([0-9]+)/g,(function(t,i){return e[Number(i)-1]}))}},76400:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=0),void 0===i&&(i=" "),void 0===s&&(s=3);var n=0;if(e+1>=(t=t.toString()).length)switch(s){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var r=Math.ceil((n=e-t.length)/2);t=new Array(n-r+1).join(i)+t+new Array(r+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},76872:t=>{t.exports=function(t,e){return 0===e?t.slice(1):t.slice(0,e-1)+t.slice(e)}},8051:t=>{t.exports=function(t){return t.split("").reverse().join("")}},76583:t=>{t.exports=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))}},40587:t=>{t.exports=function(t){return t&&t[0].toUpperCase()+t.slice(1)}},50379:(t,e,i)=>{t.exports={Format:i(69429),Pad:i(76400),RemoveAt:i(76872),Reverse:i(8051),UppercaseFirst:i(40587),UUID:i(76583)}}},e={};function i(s){var n=e[s];if(void 0!==n)return n.exports;var r=e[s]={exports:{}};return t[s](r,r.exports,i),r.exports}return i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i(10654)})()})); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Phaser",[],e):"object"==typeof exports?exports.Phaser=e():t.Phaser=e()}(this,(()=>(()=>{var t={6659:t=>{"use strict";var e=Object.prototype.hasOwnProperty,i="~";function s(){}function n(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function r(t,e,s,r,o){if("function"!=typeof s)throw new TypeError("The listener must be a function");var a=new n(s,r||t,o),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new s:delete t._events[e]}function a(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(i=!1)),a.prototype.eventNames=function(){var t,s,n=[];if(0===this._eventsCount)return n;for(s in t=this._events)e.call(t,s)&&n.push(i?s.slice(1):s);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=i?i+t:t,s=this._events[e];if(!s)return[];if(s.fn)return[s.fn];for(var n=0,r=s.length,o=new Array(r);n{var s=i(82590);t.exports=function(t,e,i,n){for(var r=t[0],o=1;o{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"angle",e,i,n,r)}},22015:t=>{t.exports=function(t,e,i){for(var s=0;s{t.exports=function(t,e,i){void 0===i&&(i=0);for(var s=i;s{t.exports=function(t,e,i){void 0===i&&(i=0);for(var s=i;s{var s=i(40327),n=i(84093),r=i(72632),o=i(72283),a=new(i(71030))({sys:{queueDepthSort:o,events:{once:o}}},0,0,1,1);t.exports=function(t,e){void 0===e&&(e={});var i=e.hasOwnProperty("width"),o=e.hasOwnProperty("height"),h=r(e,"width",-1),l=r(e,"height",-1),u=r(e,"cellWidth",1),c=r(e,"cellHeight",u),d=r(e,"position",n.TOP_LEFT),p=r(e,"x",0),f=r(e,"y",0),v=0,g=0,m=h*u,y=l*c;a.setPosition(p,f),a.setSize(u,c);for(var x=0;x{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"alpha",e,i,n,r)}},3877:(t,e,i)=>{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"x",e,i,n,r)}},71020:(t,e,i)=>{var s=i(6124);t.exports=function(t,e,i,n,r,o,a){return null==i&&(i=e),s(t,"x",e,n,o,a),s(t,"y",i,r,o,a)}},28970:(t,e,i)=>{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"y",e,i,n,r)}},82249:t=>{t.exports=function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=6.28);for(var n=i,r=(s-i)/t.length,o=0;o{t.exports=function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=6.28);for(var n=i,r=(s-i)/t.length,o=e.width/2,a=e.height/2,h=0;h{var s=i(8570);t.exports=function(t,e){for(var i=s(e,t.length),n=0;n{var s=i(40053),n=i(77640),r=i(38487);t.exports=function(t,e,i){void 0===i&&(i=0);var o=s(e,!1,t.length);i>0?n(o,i):i<0&&r(o,Math.abs(i));for(var a=0;a{var s=i(58813);t.exports=function(t,e,i){var n=s({x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2},i),r=s({x1:e.x2,y1:e.y2,x2:e.x3,y2:e.y3},i),o=s({x1:e.x3,y1:e.y3,x2:e.x1,y2:e.y1},i);n.pop(),r.pop(),o.pop();for(var a=(n=n.concat(r,o)).length/t.length,h=0,l=0;l{t.exports=function(t,e,i){for(var s=0;s{t.exports=function(t,e,i,s,n,r){var o;void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=1);var a=0,h=t.length;if(1===r)for(o=n;o=0;o--)t[o][e]+=i+a*s,a++;return t}},23646:t=>{t.exports=function(t,e,i,s,n,r){var o;void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=1);var a=0,h=t.length;if(1===r)for(o=n;o=0;o--)t[o][e]=i+a*s,a++;return t}},4392:(t,e,i)=>{var s=i(30977);t.exports=function(t,e){for(var i=0;i{var s=i(72006);t.exports=function(t,e){for(var i=0;i{var s=i(74077);t.exports=function(t,e){for(var i=0;i{var s=i(30001);t.exports=function(t,e){for(var i=0;i{var s=i(99761);t.exports=function(t,e){for(var i=0;i{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"rotation",e,i,n,r)}},87299:(t,e,i)=>{var s=i(72395),n=i(53996);t.exports=function(t,e,i){for(var r=e.x,o=e.y,a=0;a{var s=i(72395);t.exports=function(t,e,i,n){var r=e.x,o=e.y;if(0===n)return t;for(var a=0;a{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"scaleX",e,i,n,r)}},51449:(t,e,i)=>{var s=i(6124);t.exports=function(t,e,i,n,r,o,a){return null==i&&(i=e),s(t,"scaleX",e,n,o,a),s(t,"scaleY",i,r,o,a)}},64895:(t,e,i)=>{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"scaleY",e,i,n,r)}},30329:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"alpha",e,i,n,r)}},43954:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n){return s(t,"blendMode",e,0,i,n)}},70688:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"depth",e,i,n,r)}},8314:t=>{t.exports=function(t,e,i){for(var s=0;s{var s=i(23646);t.exports=function(t,e,i,n,r,o,a){return null==i&&(i=e),s(t,"originX",e,n,o,a),s(t,"originY",i,r,o,a),t.forEach((function(t){t.updateDisplayOrigin()})),t}},38767:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"rotation",e,i,n,r)}},18584:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r,o,a){return null==i&&(i=e),s(t,"scaleX",e,n,o,a),s(t,"scaleY",i,r,o,a)}},17381:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"scaleX",e,i,n,r)}},74370:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"scaleY",e,i,n,r)}},27773:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r,o,a){return null==i&&(i=e),s(t,"scrollFactorX",e,n,o,a),s(t,"scrollFactorY",i,r,o,a)}},75257:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"scrollFactorX",e,i,n,r)}},54512:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"scrollFactorY",e,i,n,r)}},69423:t=>{t.exports=function(t,e,i,s,n){for(var r=0;r{var s=i(23646);t.exports=function(t,e,i,n){return s(t,"visible",e,0,i,n)}},94833:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"x",e,i,n,r)}},14284:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r,o,a){return null==i&&(i=e),s(t,"x",e,n,o,a),s(t,"y",i,r,o,a)}},96574:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"y",e,i,n,r)}},74086:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r){var o,a,h,l,u,c;if(void 0===n&&(n=0),void 0===r&&(r=new s),t.length>1)if(0===n){var d=t.length-1;for(o=t[d].x,a=t[d].y,h=d-1;h>=0;h--)l=(c=t[h]).x,u=c.y,c.x=o,c.y=a,o=l,a=u;t[d].x=e,t[d].y=i}else{for(o=t[0].x,a=t[0].y,h=1;h{var s=i(18592);t.exports=function(t){return s(t)}},1558:(t,e,i)=>{var s=i(5514);t.exports=function(t,e,i,n,r){void 0===r&&(r=!1);var o,a=Math.abs(n-i)/t.length;if(r)for(o=0;o{var s=i(87736);t.exports=function(t,e,i,n,r){void 0===r&&(r=!1);var o,a=Math.abs(n-i)/t.length;if(r)for(o=0;o{t.exports=function(t,e,i,s,n){void 0===n&&(n=!1);var r,o=Math.abs(s-i)/t.length;if(n)for(r=0;r{t.exports=function(t){for(var e=0;e{var s=i(1071);t.exports=function(t,e,i){void 0===i&&(i=0);for(var n=0;n{t.exports={AlignTo:i(62270),Angle:i(61148),Call:i(22015),GetFirst:i(31060),GetLast:i(52367),GridAlign:i(12673),IncAlpha:i(691),IncX:i(3877),IncXY:i(71020),IncY:i(28970),PlaceOnCircle:i(82249),PlaceOnEllipse:i(30285),PlaceOnLine:i(61557),PlaceOnRectangle:i(63549),PlaceOnTriangle:i(51629),PlayAnimation:i(1045),PropertyValueInc:i(6124),PropertyValueSet:i(23646),RandomCircle:i(4392),RandomEllipse:i(94985),RandomLine:i(63305),RandomRectangle:i(90739),RandomTriangle:i(91417),Rotate:i(26182),RotateAround:i(87299),RotateAroundDistance:i(92194),ScaleX:i(30363),ScaleXY:i(51449),ScaleY:i(64895),SetAlpha:i(30329),SetBlendMode:i(43954),SetDepth:i(70688),SetHitArea:i(8314),SetOrigin:i(12894),SetRotation:i(38767),SetScale:i(18584),SetScaleX:i(17381),SetScaleY:i(74370),SetScrollFactor:i(27773),SetScrollFactorX:i(75257),SetScrollFactorY:i(54512),SetTint:i(69423),SetVisible:i(58291),SetX:i(94833),SetXY:i(14284),SetY:i(96574),ShiftPosition:i(74086),Shuffle:i(86347),SmootherStep:i(9938),SmoothStep:i(1558),Spread:i(71060),ToggleVisible:i(11207),WrapInRectangle:i(24404)}},85463:(t,e,i)=>{var s=i(82897),n=i(56694),r=i(16938),o=i(2406),a=i(71519),h=i(10850),l=i(28834),u=new n({initialize:function(t,e,i){this.manager=t,this.key=e,this.type="frame",this.frames=this.getFrames(t.textureManager,h(i,"frames",[]),h(i,"defaultTextureKey",null),h(i,"sortFrames",!0)),this.frameRate=h(i,"frameRate",null),this.duration=h(i,"duration",null),this.msPerFrame,this.skipMissedFrames=h(i,"skipMissedFrames",!0),this.delay=h(i,"delay",0),this.repeat=h(i,"repeat",0),this.repeatDelay=h(i,"repeatDelay",0),this.yoyo=h(i,"yoyo",!1),this.showOnStart=h(i,"showOnStart",!1),this.hideOnComplete=h(i,"hideOnComplete",!1),this.paused=!1,this.calculateDuration(this,this.getTotalFrames(),this.duration,this.frameRate),this.manager.on&&(this.manager.on(r.PAUSE_ALL,this.pause,this),this.manager.on(r.RESUME_ALL,this.resume,this))},getTotalFrames:function(){return this.frames.length},calculateDuration:function(t,e,i,s){null===i&&null===s?(t.frameRate=24,t.duration=24/e*1e3):i&&null===s?(t.duration=i,t.frameRate=e/(i/1e3)):(t.frameRate=s,t.duration=e/s*1e3),t.msPerFrame=1e3/t.frameRate},addFrame:function(t){return this.addFrameAt(this.frames.length,t)},addFrameAt:function(t,e){var i=this.getFrames(this.manager.textureManager,e);if(i.length>0){if(0===t)this.frames=i.concat(this.frames);else if(t===this.frames.length)this.frames=this.frames.concat(i);else{var s=this.frames.slice(0,t),n=this.frames.slice(t);this.frames=s.concat(i,n)}this.updateFrameSequence()}return this},checkFrame:function(t){return t>=0&&t0){r.isLast=!0,r.nextFrame=c[0],c[0].prevFrame=r;var y=1/(c.length-1);for(o=0;o0?t.inReverse&&t.forward?t.forward=!1:this.repeatAnimation(t):t.complete():this.updateAndGetNextTick(t,e.nextFrame)},handleYoyoFrame:function(t,e){if(e||(e=!1),t.inReverse===!e&&t.repeatCounter>0)return(0===t.repeatDelay||t.pendingRepeat)&&(t.forward=e),void this.repeatAnimation(t);if(t.inReverse===e||0!==t.repeatCounter){t.forward=e;var i=e?t.currentFrame.nextFrame:t.currentFrame.prevFrame;this.updateAndGetNextTick(t,i)}else t.complete()},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t.yoyo?this.handleYoyoFrame(t,!0):t.repeatCounter>0?(t.inReverse&&!t.forward||(t.forward=!0),this.repeatAnimation(t)):t.complete():this.updateAndGetNextTick(t,e.prevFrame)},updateAndGetNextTick:function(t,e){t.setCurrentFrame(e),this.getNextTick(t)},removeFrame:function(t){var e=this.frames.indexOf(t);return-1!==e&&this.removeFrameAt(e),this},removeFrameAt:function(t){return this.frames.splice(t,1),this.updateFrameSequence(),this},repeatAnimation:function(t){if(2===t._pendingStop){if(0===t._pendingStopValue)return t.stop();t._pendingStopValue--}t.repeatDelay>0&&!t.pendingRepeat?(t.pendingRepeat=!0,t.accumulator-=t.nextTick,t.nextTick+=t.repeatDelay):(t.repeatCounter--,t.forward?t.setCurrentFrame(t.currentFrame.nextFrame):t.setCurrentFrame(t.currentFrame.prevFrame),t.isPlaying&&(this.getNextTick(t),t.handleRepeat()))},toJSON:function(){var t={key:this.key,type:this.type,frames:[],frameRate:this.frameRate,duration:this.duration,skipMissedFrames:this.skipMissedFrames,delay:this.delay,repeat:this.repeat,repeatDelay:this.repeatDelay,yoyo:this.yoyo,showOnStart:this.showOnStart,hideOnComplete:this.hideOnComplete};return this.frames.forEach((function(e){t.frames.push(e.toJSON())})),t},updateFrameSequence:function(){for(var t,e=this.frames.length,i=1/(e-1),s=0;s1?(t.isLast=!0,t.prevFrame=this.frames[e-2],t.nextFrame=this.frames[0]):e>1&&(t.prevFrame=this.frames[s-1],t.nextFrame=this.frames[s+1]);return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.manager.off&&(this.manager.off(r.PAUSE_ALL,this.pause,this),this.manager.off(r.RESUME_ALL,this.resume,this)),this.manager.remove(this.key);for(var t=0;t{var s=new(i(56694))({initialize:function(t,e,i,s,n){void 0===n&&(n=!1),this.textureKey=t,this.textureFrame=e,this.index=i,this.frame=s,this.isFirst=!1,this.isLast=!1,this.prevFrame=null,this.nextFrame=null,this.duration=0,this.progress=0,this.isKeyFrame=n},toJSON:function(){return{key:this.textureKey,frame:this.textureFrame,duration:this.duration,keyframe:this.isKeyFrame}},destroy:function(){this.frame=void 0}});t.exports=s},90249:(t,e,i)=>{var s=i(85463),n=i(56694),r=i(33885),o=i(6659),a=i(16938),h=i(97081),l=i(72632),u=i(10850),c=i(76400),d=i(13401),p=new n({Extends:o,initialize:function(t){o.call(this),this.game=t,this.textureManager=null,this.globalTimeScale=1,this.anims=new r,this.mixes=new r,this.paused=!1,this.name="AnimationManager",t.events.once(h.BOOT,this.boot,this)},boot:function(){this.textureManager=this.game.textures,this.game.events.once(h.DESTROY,this.destroy,this)},addMix:function(t,e,i){var s=this.anims,n=this.mixes,r="string"==typeof t?t:t.key,o="string"==typeof e?e:e.key;if(s.has(r)&&s.has(o)){var a=n.get(r);a||(a={}),a[o]=i,n.set(r,a)}return this},removeMix:function(t,e){var i=this.mixes,s="string"==typeof t?t:t.key,n=i.get(s);if(n)if(e){var r="string"==typeof e?e:e.key;n.hasOwnProperty(r)&&delete n[r]}else e||i.delete(s);return this},getMix:function(t,e){var i=this.mixes,s="string"==typeof t?t:t.key,n="string"==typeof e?e:e.key,r=i.get(s);return r&&r.hasOwnProperty(n)?r[n]:0},add:function(t,e){return this.anims.has(t)?(console.warn("Animation key exists: "+t),this):(e.key=t,this.anims.set(t,e),this.emit(a.ADD_ANIMATION,t,e),this)},exists:function(t){return this.anims.has(t)},createFromAseprite:function(t,e,i){var s=[],n=this.game.cache.json.get(t);if(!n)return s;var r=this,o=u(n,"meta",null),a=u(n,"frames",null);o&&a&&u(o,"frameTags",[]).forEach((function(n){var o=[],h=l(n,"name",null),u=l(n,"from",0),c=l(n,"to",0),d=l(n,"direction","forward");if(h&&(!e||e&&e.indexOf(h)>-1)){for(var p=0,f=u;f<=c;f++){var v=f.toString(),g=a[v];if(g){var m=l(g,"duration",Number.MAX_SAFE_INTEGER);o.push({key:t,frame:v,duration:m}),p+=m}}var y=p/o.length;o.forEach((function(t){t.duration-=y})),"reverse"===d&&(o=o.reverse());var x,T={key:h,frames:o,duration:p,yoyo:"pingpong"===d};i?i.anims&&(x=i.anims.create(T)):x=r.create(T),x&&s.push(x)}}));return s},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))||(i=new s(this,e,t),this.anims.set(e,i),this.emit(a.ADD_ANIMATION,e,i))),i},fromJSON:function(t,e){void 0===e&&(e=!1),e&&this.anims.clear(),"string"==typeof t&&(t=JSON.parse(t));var i=[];if(t.hasOwnProperty("anims")&&Array.isArray(t.anims)){for(var s=0;s{var s=i(56694),n=i(33885),r=i(72632),o=i(16938),a=i(85463),h=new s({initialize:function(t){this.parent=t,this.animationManager=t.scene.sys.anims,this.animationManager.on(o.REMOVE_ANIMATION,this.globalRemove,this),this.textureManager=this.animationManager.textureManager,this.anims=null,this.isPlaying=!1,this.hasStarted=!1,this.currentAnim=null,this.currentFrame=null,this.nextAnim=null,this.nextAnimsQueue=[],this.timeScale=1,this.frameRate=0,this.duration=0,this.msPerFrame=0,this.skipMissedFrames=!0,this.delay=0,this.repeat=0,this.repeatDelay=0,this.yoyo=!1,this.showOnStart=!1,this.hideOnComplete=!1,this.forward=!0,this.inReverse=!1,this.accumulator=0,this.nextTick=0,this.delayCounter=0,this.repeatCounter=0,this.pendingRepeat=!1,this._paused=!1,this._wasPlaying=!1,this._pendingStop=0,this._pendingStopValue},chain:function(t){var e=this.parent;if(void 0===t)return this.nextAnimsQueue.length=0,this.nextAnim=null,e;Array.isArray(t)||(t=[t]);for(var i=0;is.getTotalFrames()&&(h=0);var l=s.frames[h];0!==h||this.forward||(l=s.getLastFrame()),this.currentFrame=l}else console.warn("Missing animation: "+i);return this.parent},pause:function(t){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),void 0!==t&&this.setCurrentFrame(t),this.parent},resume:function(t){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),void 0!==t&&this.setCurrentFrame(t),this.parent},playAfterDelay:function(t,e){if(this.isPlaying){var i=this.nextAnim,s=this.nextAnimsQueue;i&&s.unshift(i),this.nextAnim=t,this._pendingStop=1,this._pendingStopValue=e}else this.delayCounter=e,this.play(t,!0);return this.parent},playAfterRepeat:function(t,e){if(void 0===e&&(e=1),this.isPlaying){var i=this.nextAnim,s=this.nextAnimsQueue;i&&s.unshift(i),-1!==this.repeatCounter&&e>this.repeatCounter&&(e=this.repeatCounter),this.nextAnim=t,this._pendingStop=2,this._pendingStopValue=e}else this.play(t);return this.parent},play:function(t,e){void 0===e&&(e=!1);var i=this.currentAnim,s=this.parent,n="string"==typeof t?t:t.key;if(e&&this.isPlaying&&i.key===n)return s;if(i&&this.isPlaying){var r=this.animationManager.getMix(i.key,t);if(r>0)return this.playAfterDelay(t,r)}return this.forward=!0,this.inReverse=!1,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t)},playReverse:function(t,e){void 0===e&&(e=!1);var i="string"==typeof t?t:t.key;return e&&this.isPlaying&&this.currentAnim.key===i?this.parent:(this.forward=!1,this.inReverse=!0,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t))},startAnimation:function(t){this.load(t);var e=this.currentAnim,i=this.parent;return e?(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat,e.getFirstTick(this),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!1,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.delayCounter+=this.delay,0===this.delayCounter&&this.handleStart(),i):i},handleStart:function(){this.showOnStart&&this.parent.setVisible(!0),this.setCurrentFrame(this.currentFrame),this.hasStarted=!0,this.emitEvents(o.ANIMATION_START)},handleRepeat:function(){this.pendingRepeat=!1,this.emitEvents(o.ANIMATION_REPEAT)},handleStop:function(){this._pendingStop=0,this.isPlaying=!1,this.emitEvents(o.ANIMATION_STOP)},handleComplete:function(){this._pendingStop=0,this.isPlaying=!1,this.hideOnComplete&&this.parent.setVisible(!1),this.emitEvents(o.ANIMATION_COMPLETE,o.ANIMATION_COMPLETE_KEY)},emitEvents:function(t,e){var i=this.currentAnim,s=this.currentFrame,n=this.parent,r=s.textureFrame;n.emit(t,i,s,n,r),e&&n.emit(e+i.key,i,s,n,r)},reverse:function(){return this.isPlaying&&(this.inReverse=!this.inReverse,this.forward=!this.forward),this.parent},getProgress:function(){var t=this.currentFrame;if(!t)return 0;var e=t.progress;return this.inReverse&&(e*=-1),e},setProgress:function(t){return this.forward||(t=1-t),this.setCurrentFrame(this.currentAnim.getFrameByProgress(t)),this.parent},setRepeat:function(t){return this.repeatCounter=-1===t?Number.MAX_VALUE:t,this.parent},globalRemove:function(t,e){void 0===e&&(e=this.currentAnim),this.isPlaying&&e.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},restart:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);var i=this.currentAnim,s=this.parent;return i?(e&&(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat),i.getFirstTick(this),this.emitEvents(o.ANIMATION_RESTART),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!t,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.setCurrentFrame(i.frames[0]),this.parent):s},complete:function(){if(this._pendingStop=0,this.isPlaying=!1,this.currentAnim&&this.handleComplete(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.length>0?this.nextAnimsQueue.shift():null,this.play(t)}return this.parent},stop:function(){if(this._pendingStop=0,this.isPlaying=!1,this.currentAnim&&this.handleStop(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.shift(),this.play(t)}return this.parent},stopAfterDelay:function(t){return this._pendingStop=1,this._pendingStopValue=t,this.parent},stopAfterRepeat:function(t){return void 0===t&&(t=1),-1!==this.repeatCounter&&t>this.repeatCounter&&(t=this.repeatCounter),this._pendingStop=2,this._pendingStopValue=t,this.parent},stopOnFrame:function(t){return this._pendingStop=3,this._pendingStopValue=t,this.parent},getTotalFrames:function(){return this.currentAnim?this.currentAnim.getTotalFrames():0},update:function(t,e){var i=this.currentAnim;if(this.isPlaying&&i&&!i.paused){if(this.accumulator+=e*this.timeScale,1===this._pendingStop&&(this._pendingStopValue-=e,this._pendingStopValue<=0))return this.stop();if(this.hasStarted){if(this.accumulator>=this.nextTick&&(this.forward?i.nextFrame(this):i.previousFrame(this),this.isPlaying&&0===this._pendingStop&&this.skipMissedFrames&&this.accumulator>this.nextTick)){var s=0;do{this.forward?i.nextFrame(this):i.previousFrame(this),s++}while(this.isPlaying&&this.accumulator>this.nextTick&&s<60)}}else this.accumulator>=this.delayCounter&&(this.accumulator-=this.delayCounter,this.handleStart())}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),t.setAlpha&&(e.alpha=t.alpha),e.setSizeToFrame(),e._originComponent&&(t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin()),this.isPlaying&&this.hasStarted&&(this.emitEvents(o.ANIMATION_UPDATE),3===this._pendingStop&&this._pendingStopValue===t&&this.stop()),e},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},get:function(t){return this.anims?this.anims.get(t):null},exists:function(t){return!!this.anims&&this.anims.has(t)},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))||(i=new a(this,e,t),this.anims||(this.anims=new n),this.anims.set(e,i))),i},createFromAseprite:function(t,e){return this.animationManager.createFromAseprite(t,e,this.parent)},generateFrameNames:function(t,e){return this.animationManager.generateFrameNames(t,e)},generateFrameNumbers:function(t,e){return this.animationManager.generateFrameNumbers(t,e)},remove:function(t){var e=this.get(t);return e&&(this.currentAnim===e&&this.stop(),this.anims.delete(t)),e},destroy:function(){this.animationManager.off(o.REMOVE_ANIMATION,this.globalRemove,this),this.anims&&this.anims.clear(),this.animationManager=null,this.parent=null,this.nextAnim=null,this.nextAnimsQueue.length=0,this.currentAnim=null,this.currentFrame=null},isPaused:{get:function(){return this._paused}}});t.exports=h},44509:t=>{t.exports="add"},84563:t=>{t.exports="animationcomplete"},61586:t=>{t.exports="animationcomplete-"},72175:t=>{t.exports="animationrepeat"},568:t=>{t.exports="animationrestart"},37690:t=>{t.exports="animationstart"},58525:t=>{t.exports="animationstop"},5243:t=>{t.exports="animationupdate"},10598:t=>{t.exports="pauseall"},4860:t=>{t.exports="remove"},31865:t=>{t.exports="resumeall"},16938:(t,e,i)=>{t.exports={ADD_ANIMATION:i(44509),ANIMATION_COMPLETE:i(84563),ANIMATION_COMPLETE_KEY:i(61586),ANIMATION_REPEAT:i(72175),ANIMATION_RESTART:i(568),ANIMATION_START:i(37690),ANIMATION_STOP:i(58525),ANIMATION_UPDATE:i(5243),PAUSE_ALL:i(10598),REMOVE_ANIMATION:i(4860),RESUME_ALL:i(31865)}},13517:(t,e,i)=>{t.exports={Animation:i(85463),AnimationFrame:i(71519),AnimationManager:i(90249),AnimationState:i(16569),Events:i(16938)}},23740:(t,e,i)=>{var s=i(56694),n=i(33885),r=i(6659),o=i(69773),a=new s({initialize:function(){this.entries=new n,this.events=new r},add:function(t,e){return this.entries.set(t,e),this.events.emit(o.ADD,this,t,e),this},has:function(t){return this.entries.has(t)},exists:function(t){return this.entries.has(t)},get:function(t){return this.entries.get(t)},remove:function(t){var e=this.get(t);return e&&(this.entries.delete(t),this.events.emit(o.REMOVE,this,t,e.data)),this},getKeys:function(){return this.entries.keys()},destroy:function(){this.entries.clear(),this.events.removeAllListeners(),this.entries=null,this.events=null}});t.exports=a},43474:(t,e,i)=>{var s=i(23740),n=i(56694),r=i(97081),o=new n({initialize:function(t){this.game=t,this.binary=new s,this.bitmapFont=new s,this.json=new s,this.physics=new s,this.shader=new s,this.audio=new s,this.video=new s,this.text=new s,this.html=new s,this.obj=new s,this.tilemap=new s,this.xml=new s,this.custom={},this.game.events.once(r.DESTROY,this.destroy,this)},addCustom:function(t){return this.custom.hasOwnProperty(t)||(this.custom[t]=new s),this.custom[t]},destroy:function(){for(var t=["binary","bitmapFont","json","physics","shader","audio","video","text","html","obj","tilemap","xml"],e=0;e{t.exports="add"},75968:t=>{t.exports="remove"},69773:(t,e,i)=>{t.exports={ADD:i(94762),REMOVE:i(75968)}},45820:(t,e,i)=>{t.exports={BaseCache:i(23740),CacheManager:i(43474),Events:i(69773)}},51052:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(75606),o=i(6659),a=i(89787),h=i(74118),l=i(69360),u=i(93222),c=i(93736),d=new s({Extends:o,Mixins:[n.Alpha,n.Visible],initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),o.call(this),this.scene,this.sceneManager,this.scaleManager,this.cameraManager,this.id=0,this.name="",this.roundPixels=!1,this.useBounds=!1,this.worldView=new h,this.dirty=!0,this._x=t,this._y=e,this._width=i,this._height=s,this._bounds=new h,this._scrollX=0,this._scrollY=0,this._zoomX=1,this._zoomY=1,this._rotation=0,this.matrix=new l,this.transparent=!0,this.backgroundColor=u("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new c(i/2,s/2),this.originX=.5,this.originY=.5,this._customViewport=!1,this.mask=null,this._maskCamera=null,this.renderList=[]},addToRenderList:function(t){this.renderList.push(t)},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this},getScroll:function(t,e,i){void 0===i&&(i=new c);var s=.5*this.width,n=.5*this.height;return i.x=t-s,i.y=e-n,this.useBounds&&(i.x=this.clampX(i.x),i.y=this.clampY(i.y)),i},centerOnX:function(t){var e=.5*this.width;return this.midPoint.x=t,this.scrollX=t-e,this.useBounds&&(this.scrollX=this.clampX(this.scrollX)),this},centerOnY:function(t){var e=.5*this.height;return this.midPoint.y=t,this.scrollY=t-e,this.useBounds&&(this.scrollY=this.clampY(this.scrollY)),this},centerOn:function(t,e){return this.centerOnX(t),this.centerOnY(e),this},centerToBounds:function(){if(this.useBounds){var t=this._bounds,e=.5*this.width,i=.5*this.height;this.midPoint.set(t.centerX,t.centerY),this.scrollX=t.centerX-e,this.scrollY=t.centerY-i}return this},centerToSize:function(){return this.scrollX=.5*this.width,this.scrollY=.5*this.height,this},cull:function(t){if(this.disableCull)return t;var e=this.matrix.matrix,i=e[0],s=e[1],n=e[2],r=e[3],o=i*r-s*n;if(!o)return t;var a=e[4],h=e[5],l=this.scrollX,u=this.scrollY,c=this.width,d=this.height,p=this.y,f=p+d,v=this.x,g=v+c,m=this.culledObjects,y=t.length;o=1/o,m.length=0;for(var x=0;xv&&E*i+S*n+ap&&E*s+S*r+hn&&(t=n),t},clampY:function(t){var e=this._bounds,i=this.displayHeight,s=e.y+(i-this.height)/2,n=Math.max(s,s+e.height-i);return tn&&(t=n),t},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(t){return void 0===t&&(t=0),this.rotation=r(t),this},setBackgroundColor:function(t){return void 0===t&&(t="rgba(0,0,0,0)"),this.backgroundColor=u(t),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(t,e,i,s,n){return void 0===n&&(n=!1),this._bounds.setTo(t,e,i,s),this.dirty=!0,this.useBounds=!0,n?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},getBounds:function(t){void 0===t&&(t=new h);var e=this._bounds;return t.setTo(e.x,e.y,e.width,e.height),t},setName:function(t){return void 0===t&&(t=""),this.name=t,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setRoundPixels:function(t){return this.roundPixels=t,this},setScene:function(t){this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=t;var e=t.sys;return this.sceneManager=e.game.scene,this.scaleManager=e.scale,this.cameraManager=e.cameras,this.updateSystem(),this},setScroll:function(t,e){return void 0===e&&(e=t),this.scrollX=t,this.scrollY=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},setViewport:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setZoom:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),0===t&&(t=.001),0===e&&(e=.001),this.zoomX=t,this.zoomY=e,this},setMask:function(t,e){return void 0===e&&(e=!0),this.mask=t,this._maskCamera=e?this.cameraManager.default:this,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},toJSON:function(){var t={name:this.name,x:this.x,y:this.y,width:this.width,height:this.height,zoom:this.zoom,rotation:this.rotation,roundPixels:this.roundPixels,scrollX:this.scrollX,scrollY:this.scrollY,backgroundColor:this.backgroundColor.rgba};return this.useBounds&&(t.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),t},update:function(){},updateSystem:function(){if(this.scaleManager){var t=0!==this._x||0!==this._y||this.scaleManager.width!==this._width||this.scaleManager.height!==this._height,e=this.sceneManager;t&&!this._customViewport?e.customViewports++:!t&&this._customViewport&&e.customViewports--,this.dirty=!0,this._customViewport=t}},destroy:function(){this.emit(a.DESTROY,this),this.removeAllListeners(),this.matrix.destroy(),this.culledObjects=[],this._customViewport&&this.sceneManager.customViewports--,this.renderList=[],this._bounds=null,this.scene=null,this.scaleManager=null,this.sceneManager=null,this.cameraManager=null},x:{get:function(){return this._x},set:function(t){this._x=t,this.updateSystem()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.updateSystem()}},width:{get:function(){return this._width},set:function(t){this._width=t,this.updateSystem()}},height:{get:function(){return this._height},set:function(t){this._height=t,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(t){this._scrollX=t,this.dirty=!0}},scrollY:{get:function(){return this._scrollY},set:function(t){this._scrollY=t,this.dirty=!0}},zoom:{get:function(){return(this._zoomX+this._zoomY)/2},set:function(t){this._zoomX=t,this._zoomY=t,this.dirty=!0}},zoomX:{get:function(){return this._zoomX},set:function(t){this._zoomX=t,this.dirty=!0}},zoomY:{get:function(){return this._zoomY},set:function(t){this._zoomY=t,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this.dirty=!0}},centerX:{get:function(){return this.x+.5*this.width}},centerY:{get:function(){return this.y+.5*this.height}},displayWidth:{get:function(){return this.width/this.zoomX}},displayHeight:{get:function(){return this.height/this.zoomY}}});t.exports=d},47751:(t,e,i)=>{var s=i(51052),n=i(79993),r=i(82897),o=i(56694),a=i(64937),h=i(53030),l=i(89787),u=i(42798),c=i(74118),d=i(93736),p=new o({Extends:s,Mixins:[a.Pipeline],initialize:function(t,e,i,n){s.call(this,t,e,i,n),this.postPipelines=[],this.pipelineData={},this.inputEnabled=!0,this.fadeEffect=new h.Fade(this),this.flashEffect=new h.Flash(this),this.shakeEffect=new h.Shake(this),this.panEffect=new h.Pan(this),this.rotateToEffect=new h.RotateTo(this),this.zoomEffect=new h.Zoom(this),this.lerp=new d(1,1),this.followOffset=new d,this.deadzone=null,this._follow=null},setDeadzone:function(t,e){if(void 0===t)this.deadzone=null;else{if(this.deadzone?(this.deadzone.width=t,this.deadzone.height=e):this.deadzone=new c(0,0,t,e),this._follow){var i=this.width/2,s=this.height/2,r=this._follow.x-this.followOffset.x,o=this._follow.y-this.followOffset.y;this.midPoint.set(r,o),this.scrollX=r-i,this.scrollY=o-s}n(this.deadzone,this.midPoint.x,this.midPoint.y)}return this},fadeIn:function(t,e,i,s,n,r){return this.fadeEffect.start(!1,t,e,i,s,!0,n,r)},fadeOut:function(t,e,i,s,n,r){return this.fadeEffect.start(!0,t,e,i,s,!0,n,r)},fadeFrom:function(t,e,i,s,n,r,o){return this.fadeEffect.start(!1,t,e,i,s,n,r,o)},fade:function(t,e,i,s,n,r,o){return this.fadeEffect.start(!0,t,e,i,s,n,r,o)},flash:function(t,e,i,s,n,r,o){return this.flashEffect.start(t,e,i,s,n,r,o)},shake:function(t,e,i,s,n){return this.shakeEffect.start(t,e,i,s,n)},pan:function(t,e,i,s,n,r,o){return this.panEffect.start(t,e,i,s,n,r,o)},rotateTo:function(t,e,i,s,n,r,o){return this.rotateToEffect.start(t,e,i,s,n,r,o)},zoomTo:function(t,e,i,s,n,r){return this.zoomEffect.start(t,e,i,s,n,r)},preRender:function(){this.renderList.length=0;var t=this.width,e=this.height,i=.5*t,s=.5*e,r=this.zoom,o=this.matrix,a=t*this.originX,h=e*this.originY,c=this._follow,d=this.deadzone,p=this.scrollX,f=this.scrollY;d&&n(d,this.midPoint.x,this.midPoint.y);var v=!1;if(c&&!this.panEffect.isRunning){var g=c.x-this.followOffset.x,m=c.y-this.followOffset.y;d?(gd.right&&(p=u(p,p+(g-d.right),this.lerp.x)),md.bottom&&(f=u(f,f+(m-d.bottom),this.lerp.y))):(p=u(p,g-a,this.lerp.x),f=u(f,m-h,this.lerp.y)),v=!0}this.useBounds&&(p=this.clampX(p),f=this.clampY(f)),this.roundPixels&&(a=Math.round(a),h=Math.round(h),p=Math.round(p),f=Math.round(f)),this.scrollX=p,this.scrollY=f;var y=p+i,x=f+s;this.midPoint.set(y,x);var T=t/r,w=e/r,b=y-T/2,E=x-w/2;this.roundPixels&&(b=Math.round(b),E=Math.round(E)),this.worldView.setTo(b,E,T,w),o.applyITRS(this.x+a,this.y+h,this.rotation,r,r),o.translate(-a,-h),this.shakeEffect.preRender(),v&&this.emit(l.FOLLOW_UPDATE,this,c)},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,s,n,o){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===s&&(s=i),void 0===n&&(n=0),void 0===o&&(o=n),this._follow=t,this.roundPixels=e,i=r(i,0,1),s=r(s,0,1),this.lerp.set(i,s),this.followOffset.set(n,o);var a=this.width/2,h=this.height/2,l=t.x-n,u=t.y-o;return this.midPoint.set(l,u),this.scrollX=l-a,this.scrollY=u-h,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.rotateToEffect.reset(),this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.rotateToEffect.update(t,e),this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.resetFX(),s.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=p},62382:(t,e,i)=>{var s=i(47751),n=i(56694),r=i(72632),o=i(91963),a=i(94287),h=i(40444),l=i(7599),u=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.roundPixels=t.sys.game.config.roundPixels,this.cameras=[],this.main,this.default,t.sys.events.once(l.BOOT,this.boot,this),t.sys.events.on(l.START,this.start,this)},boot:function(){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0],this.default=new s(0,0,t.scale.width,t.scale.height).setScene(this.scene),t.game.scale.on(h.RESIZE,this.onResize,this),this.systems.events.once(l.DESTROY,this.destroy,this)},start:function(){if(!this.main){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0]}var e=this.systems.events;e.on(l.UPDATE,this.update,this),e.once(l.SHUTDOWN,this.shutdown,this)},add:function(t,e,i,n,r,o){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===n&&(n=this.scene.sys.scale.height),void 0===r&&(r=!1),void 0===o&&(o="");var a=new s(t,e,i,n);return a.setName(o),a.setScene(this.scene),a.setRoundPixels(this.roundPixels),a.id=this.getNextID(),this.cameras.push(a),r&&(this.main=a),a},addExisting:function(t,e){return void 0===e&&(e=!1),-1===this.cameras.indexOf(t)?(t.id=this.getNextID(),t.setRoundPixels(this.roundPixels),this.cameras.push(t),e&&(this.main=t),t):null},getNextID:function(){for(var t=this.cameras,e=1,i=0;i<32;i++){for(var s=!1,n=0;n0){r.preRender();var o=this.getVisibleChildren(e.getChildren(),r);t.render(i,o,r)}}},getVisibleChildren:function(t,e){for(var i=[],s=0;s{var s=i(82897),n=i(56694),r=i(89787),o=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.isComplete=!1,this.direction=!0,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n,o,a,h){if(void 0===t&&(t=!0),void 0===e&&(e=1e3),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=0),void 0===o&&(o=!1),void 0===a&&(a=null),void 0===h&&(h=this.camera.scene),!o&&this.isRunning)return this.camera;this.isRunning=!0,this.isComplete=!1,this.duration=e,this.direction=t,this.progress=0,this.red=i,this.green=s,this.blue=n,this.alpha=t?Number.MIN_VALUE:1,this._elapsed=0,this._onUpdate=a,this._onUpdateScope=h;var l=t?r.FADE_OUT_START:r.FADE_IN_START;return this.camera.emit(l,this.camera,this,e,i,s,n),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=s(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed{var s=i(82897),n=i(56694),r=i(89787),o=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=1,this.progress=0,this._elapsed=0,this._alpha,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n,o,a){return void 0===t&&(t=250),void 0===e&&(e=255),void 0===i&&(i=255),void 0===s&&(s=255),void 0===n&&(n=!1),void 0===o&&(o=null),void 0===a&&(a=this.camera.scene),!n&&this.isRunning||(this.isRunning=!0,this.duration=t,this.progress=0,this.red=e,this.green=i,this.blue=s,this._alpha=this.alpha,this._elapsed=0,this._onUpdate=o,this._onUpdateScope=a,this.camera.emit(r.FLASH_START,this.camera,this,t,e,i,s)),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=s(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed{var s=i(82897),n=i(56694),r=i(35060),o=i(89787),a=i(93736),h=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=new a,this.current=new a,this.destination=new a,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n,a,h){void 0===i&&(i=1e3),void 0===s&&(s=r.Linear),void 0===n&&(n=!1),void 0===a&&(a=null),void 0===h&&(h=this.camera.scene);var l=this.camera;return!n&&this.isRunning||(this.isRunning=!0,this.duration=i,this.progress=0,this.source.set(l.scrollX,l.scrollY),this.destination.set(t,e),l.getScroll(t,e,this.current),"string"==typeof s&&r.hasOwnProperty(s)?this.ease=r[s]:"function"==typeof s&&(this.ease=s),this._elapsed=0,this._onUpdate=a,this._onUpdateScope=h,this.camera.emit(o.PAN_START,this.camera,this,i,t,e)),l},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=s(this._elapsed/this.duration,0,1);this.progress=i;var n=this.camera;if(this._elapsed{var s=i(82897),n=i(56694),r=i(89787),o=i(35060),a=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=0,this.current=0,this.destination=0,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope,this.clockwise=!0,this.shortestPath=!1},start:function(t,e,i,s,n,a,h){void 0===i&&(i=1e3),void 0===s&&(s=o.Linear),void 0===n&&(n=!1),void 0===a&&(a=null),void 0===h&&(h=this.camera.scene),void 0===e&&(e=!1),this.shortestPath=e;var l=t;t<0?(l=-1*t,this.clockwise=!1):this.clockwise=!0;var u=360*Math.PI/180;l-=Math.floor(l/u)*u;var c=this.camera;if(!n&&this.isRunning)return c;if(this.isRunning=!0,this.duration=i,this.progress=0,this.source=c.rotation,this.destination=l,"string"==typeof s&&o.hasOwnProperty(s)?this.ease=o[s]:"function"==typeof s&&(this.ease=s),this._elapsed=0,this._onUpdate=a,this._onUpdateScope=h,this.shortestPath){var d=0,p=0;(d=this.destination>this.source?Math.abs(this.destination-this.source):Math.abs(this.destination+u)-this.source)<(p=this.source>this.destination?Math.abs(this.source-this.destination):Math.abs(this.source+u)-this.destination)?this.clockwise=!0:d>p&&(this.clockwise=!1)}return this.camera.emit(r.ROTATE_START,this.camera,this,i,l),c},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=s(this._elapsed/this.duration,0,1);this.progress=i;var n=this.camera;if(this._elapsed=l?Math.abs(h-l):Math.abs(h+a)-l;var u=0;u=this.clockwise?n.rotation+o*r:n.rotation-o*r,n.rotation=u,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,n,i,u)}else n.rotation=this.destination,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,n,i,this.destination),this.effectComplete()}},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(r.ROTATE_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null,this.source=null,this.destination=null}});t.exports=a},3241:(t,e,i)=>{var s=i(82897),n=i(56694),r=i(89787),o=i(93736),a=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.intensity=new o,this.progress=0,this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n){return void 0===t&&(t=100),void 0===e&&(e=.05),void 0===i&&(i=!1),void 0===s&&(s=null),void 0===n&&(n=this.camera.scene),!i&&this.isRunning||(this.isRunning=!0,this.duration=t,this.progress=0,"number"==typeof e?this.intensity.set(e):this.intensity.set(e.x,e.y),this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate=s,this._onUpdateScope=n,this.camera.emit(r.SHAKE_START,this.camera,this,t,e)),this.camera},preRender:function(){this.isRunning&&this.camera.matrix.translate(this._offsetX,this._offsetY)},update:function(t,e){if(this.isRunning)if(this._elapsed+=e,this.progress=s(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed{var s=i(82897),n=i(56694),r=i(35060),o=i(89787),a=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=1,this.destination=1,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n,a){void 0===e&&(e=1e3),void 0===i&&(i=r.Linear),void 0===s&&(s=!1),void 0===n&&(n=null),void 0===a&&(a=this.camera.scene);var h=this.camera;return!s&&this.isRunning||(this.isRunning=!0,this.duration=e,this.progress=0,this.source=h.zoom,this.destination=t,"string"==typeof i&&r.hasOwnProperty(i)?this.ease=r[i]:"function"==typeof i&&(this.ease=i),this._elapsed=0,this._onUpdate=n,this._onUpdateScope=a,this.camera.emit(o.ZOOM_START,this.camera,this,e,t)),h},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=s(this._elapsed/this.duration,0,1),this._elapsed{t.exports={Fade:i(92522),Flash:i(22151),Pan:i(37551),Shake:i(3241),RotateTo:i(1771),Zoom:i(13383)}},39577:t=>{t.exports="cameradestroy"},85373:t=>{t.exports="camerafadeincomplete"},92057:t=>{t.exports="camerafadeinstart"},1903:t=>{t.exports="camerafadeoutcomplete"},96131:t=>{t.exports="camerafadeoutstart"},85409:t=>{t.exports="cameraflashcomplete"},25500:t=>{t.exports="cameraflashstart"},44071:t=>{t.exports="followupdate"},19818:t=>{t.exports="camerapancomplete"},80002:t=>{t.exports="camerapanstart"},87966:t=>{t.exports="postrender"},74217:t=>{t.exports="prerender"},34805:t=>{t.exports="camerarotatecomplete"},30408:t=>{t.exports="camerarotatestart"},49856:t=>{t.exports="camerashakecomplete"},69189:t=>{t.exports="camerashakestart"},67657:t=>{t.exports="camerazoomcomplete"},14229:t=>{t.exports="camerazoomstart"},89787:(t,e,i)=>{t.exports={DESTROY:i(39577),FADE_IN_COMPLETE:i(85373),FADE_IN_START:i(92057),FADE_OUT_COMPLETE:i(1903),FADE_OUT_START:i(96131),FLASH_COMPLETE:i(85409),FLASH_START:i(25500),FOLLOW_UPDATE:i(44071),PAN_COMPLETE:i(19818),PAN_START:i(80002),POST_RENDER:i(87966),PRE_RENDER:i(74217),ROTATE_COMPLETE:i(34805),ROTATE_START:i(30408),SHAKE_COMPLETE:i(49856),SHAKE_START:i(69189),ZOOM_COMPLETE:i(67657),ZOOM_START:i(14229)}},32356:(t,e,i)=>{t.exports={Camera:i(47751),BaseCamera:i(51052),CameraManager:i(62382),Effects:i(53030),Events:i(89787)}},84219:(t,e,i)=>{var s=i(56694),n=i(10850),r=new s({initialize:function(t){this.camera=n(t,"camera",null),this.left=n(t,"left",null),this.right=n(t,"right",null),this.up=n(t,"up",null),this.down=n(t,"down",null),this.zoomIn=n(t,"zoomIn",null),this.zoomOut=n(t,"zoomOut",null),this.zoomSpeed=n(t,"zoomSpeed",.01),this.minZoom=n(t,"minZoom",.001),this.maxZoom=n(t,"maxZoom",1e3),this.speedX=0,this.speedY=0;var e=n(t,"speed",null);"number"==typeof e?(this.speedX=e,this.speedY=e):(this.speedX=n(t,"speed.x",0),this.speedY=n(t,"speed.y",0)),this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this.up&&this.up.isDown?e.scrollY-=this.speedY*t|0:this.down&&this.down.isDown&&(e.scrollY+=this.speedY*t|0),this.left&&this.left.isDown?e.scrollX-=this.speedX*t|0:this.right&&this.right.isDown&&(e.scrollX+=this.speedX*t|0),this.zoomIn&&this.zoomIn.isDown?(e.zoom-=this.zoomSpeed,e.zoomthis.maxZoom&&(e.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},69370:(t,e,i)=>{var s=i(56694),n=i(10850),r=new s({initialize:function(t){this.camera=n(t,"camera",null),this.left=n(t,"left",null),this.right=n(t,"right",null),this.up=n(t,"up",null),this.down=n(t,"down",null),this.zoomIn=n(t,"zoomIn",null),this.zoomOut=n(t,"zoomOut",null),this.zoomSpeed=n(t,"zoomSpeed",.01),this.minZoom=n(t,"minZoom",.001),this.maxZoom=n(t,"maxZoom",1e3),this.accelX=0,this.accelY=0;var e=n(t,"acceleration",null);"number"==typeof e?(this.accelX=e,this.accelY=e):(this.accelX=n(t,"acceleration.x",0),this.accelY=n(t,"acceleration.y",0)),this.dragX=0,this.dragY=0;var i=n(t,"drag",null);"number"==typeof i?(this.dragX=i,this.dragY=i):(this.dragX=n(t,"drag.x",0),this.dragY=n(t,"drag.y",0)),this.maxSpeedX=0,this.maxSpeedY=0;var s=n(t,"maxSpeed",null);"number"==typeof s?(this.maxSpeedX=s,this.maxSpeedY=s):(this.maxSpeedX=n(t,"maxSpeed.x",0),this.maxSpeedY=n(t,"maxSpeed.y",0)),this._speedX=0,this._speedY=0,this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this._speedX>0?(this._speedX-=this.dragX*t,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*t,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*t,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*t,this._speedY>0&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoomthis.maxZoom&&(e.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},6524:(t,e,i)=>{t.exports={FixedKeyControl:i(84219),SmoothedKeyControl:i(69370)}},44143:(t,e,i)=>{t.exports={Controls:i(6524),Scene2D:i(32356)}},86459:(t,e,i)=>{var s={VERSION:"3.60.0-beta.10",BlendModes:i(95723),ScaleModes:i(27394),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=s},14033:(t,e,i)=>{var s=i(56694),n=i(86459),r=i(77290),o=i(72632),a=i(10850),h=i(42911),l=i(5923),u=i(72283),c=i(18360),d=i(93222),p=new s({initialize:function(t){void 0===t&&(t={});var e=a(t,"scale",null);this.width=a(e,"width",1024,t),this.height=a(e,"height",768,t),this.zoom=a(e,"zoom",1,t),this.parent=a(e,"parent",void 0,t),this.scaleMode=a(e,e?"mode":"scaleMode",0,t),this.expandParent=a(e,"expandParent",!0,t),this.autoRound=a(e,"autoRound",!1,t),this.autoCenter=a(e,"autoCenter",0,t),this.resizeInterval=a(e,"resizeInterval",500,t),this.fullscreenTarget=a(e,"fullscreenTarget",null,t),this.minWidth=a(e,"minWidth",0,t),this.maxWidth=a(e,"maxWidth",0,t),this.minHeight=a(e,"minHeight",0,t),this.maxHeight=a(e,"maxHeight",0,t),this.renderType=a(t,"type",n.AUTO),this.canvas=a(t,"canvas",null),this.context=a(t,"context",null),this.canvasStyle=a(t,"canvasStyle",null),this.customEnvironment=a(t,"customEnvironment",!1),this.sceneConfig=a(t,"scene",null),this.seed=a(t,"seed",[(Date.now()*Math.random()).toString()]),l.RND=new l.RandomDataGenerator(this.seed),this.gameTitle=a(t,"title",""),this.gameURL=a(t,"url","https://phaser.io"),this.gameVersion=a(t,"version",""),this.autoFocus=a(t,"autoFocus",!0),this.domCreateContainer=a(t,"dom.createContainer",!1),this.domPointerEvents=a(t,"dom.pointerEvents","none"),this.inputKeyboard=a(t,"input.keyboard",!0),this.inputKeyboardEventTarget=a(t,"input.keyboard.target",window),this.inputKeyboardCapture=a(t,"input.keyboard.capture",[]),this.inputMouse=a(t,"input.mouse",!0),this.inputMouseEventTarget=a(t,"input.mouse.target",null),this.inputMousePreventDefaultDown=a(t,"input.mouse.preventDefaultDown",!0),this.inputMousePreventDefaultUp=a(t,"input.mouse.preventDefaultUp",!0),this.inputMousePreventDefaultMove=a(t,"input.mouse.preventDefaultMove",!0),this.inputMousePreventDefaultWheel=a(t,"input.mouse.preventDefaultWheel",!0),this.inputTouch=a(t,"input.touch",r.input.touch),this.inputTouchEventTarget=a(t,"input.touch.target",null),this.inputTouchCapture=a(t,"input.touch.capture",!0),this.inputActivePointers=a(t,"input.activePointers",1),this.inputSmoothFactor=a(t,"input.smoothFactor",0),this.inputWindowEvents=a(t,"input.windowEvents",!0),this.inputGamepad=a(t,"input.gamepad",!1),this.inputGamepadEventTarget=a(t,"input.gamepad.target",window),this.disableContextMenu=a(t,"disableContextMenu",!1),this.audio=a(t,"audio",{}),this.hideBanner=!1===a(t,"banner",null),this.hidePhaser=a(t,"banner.hidePhaser",!1),this.bannerTextColor=a(t,"banner.text","#ffffff"),this.bannerBackgroundColor=a(t,"banner.background",["#ff0000","#ffff00","#00ff00","#00ffff","#000000"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=a(t,"fps",null);var i=a(t,"render",null);this.pipeline=a(i,"pipeline",null,t),this.antialias=a(i,"antialias",!0,t),this.antialiasGL=a(i,"antialiasGL",!0,t),this.mipmapFilter=a(i,"mipmapFilter","LINEAR",t),this.desynchronized=a(i,"desynchronized",!1,t),this.roundPixels=a(i,"roundPixels",!1,t),this.pixelArt=a(i,"pixelArt",1!==this.zoom,t),this.pixelArt&&(this.antialias=!1,this.antialiasGL=!1,this.roundPixels=!0),this.transparent=a(i,"transparent",!1,t),this.clearBeforeRender=a(i,"clearBeforeRender",!0,t),this.preserveDrawingBuffer=a(i,"preserveDrawingBuffer",!1,t),this.premultipliedAlpha=a(i,"premultipliedAlpha",!0,t),this.failIfMajorPerformanceCaveat=a(i,"failIfMajorPerformanceCaveat",!1,t),this.powerPreference=a(i,"powerPreference","default",t),this.batchSize=a(i,"batchSize",4096,t),this.maxTextures=a(i,"maxTextures",-1,t),this.maxLights=a(i,"maxLights",10,t);var s=a(t,"backgroundColor",0);this.backgroundColor=d(s),this.transparent&&(this.backgroundColor=d(0),this.backgroundColor.alpha=0),this.preBoot=a(t,"callbacks.preBoot",u),this.postBoot=a(t,"callbacks.postBoot",u),this.physics=a(t,"physics",{}),this.defaultPhysicsSystem=a(this.physics,"default",!1),this.loaderBaseURL=a(t,"loader.baseURL",""),this.loaderPath=a(t,"loader.path",""),this.loaderMaxParallelDownloads=a(t,"loader.maxParallelDownloads",r.os.android?6:32),this.loaderCrossOrigin=a(t,"loader.crossOrigin",void 0),this.loaderResponseType=a(t,"loader.responseType",""),this.loaderAsync=a(t,"loader.async",!0),this.loaderUser=a(t,"loader.user",""),this.loaderPassword=a(t,"loader.password",""),this.loaderTimeout=a(t,"loader.timeout",0),this.loaderWithCredentials=a(t,"loader.withCredentials",!1),this.loaderImageLoadType=a(t,"loader.imageLoadType","XHR"),this.loaderLocalScheme=a(t,"loader.localScheme",["file://","capacitor://"]),this.installGlobalPlugins=[],this.installScenePlugins=[];var p=a(t,"plugins",null),f=c.DefaultScene;p&&(Array.isArray(p)?this.defaultPlugins=p:h(p)&&(this.installGlobalPlugins=o(p,"global",[]),this.installScenePlugins=o(p,"scene",[]),Array.isArray(p.default)?f=p.default:Array.isArray(p.defaultMerge)&&(f=f.concat(p.defaultMerge)))),this.defaultPlugins=f;var v="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=a(t,"images.default",v+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=a(t,"images.missing",v+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),this.whiteImage=a(t,"images.white","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABdJREFUeNpi/P//PwMMMDEgAdwcgAADAJZuAwXJYZOzAAAAAElFTkSuQmCC"),window&&(window.FORCE_WEBGL?this.renderType=n.WEBGL:window.FORCE_CANVAS&&(this.renderType=n.CANVAS))}});t.exports=p},50150:(t,e,i)=>{var s=i(70616),n=i(61068),r=i(86459),o=i(90185);t.exports=function(t){var e=t.config;if((e.customEnvironment||e.canvas)&&e.renderType===r.AUTO)throw new Error("Must set explicit renderType in custom environment");if(!e.customEnvironment&&!e.canvas&&e.renderType!==r.HEADLESS)if(e.renderType===r.AUTO&&(e.renderType=o.webGL?r.WEBGL:r.CANVAS),e.renderType===r.WEBGL){if(!o.webGL)throw new Error("Cannot create WebGL context, aborting.")}else{if(e.renderType!==r.CANVAS)throw new Error("Unknown value for renderer type: "+e.renderType);if(!o.canvas)throw new Error("Cannot create Canvas context, aborting.")}e.antialias||n.disableSmoothing();var a,h,l=t.scale.baseSize,u=l.width,c=l.height;(e.canvas?(t.canvas=e.canvas,t.canvas.width=u,t.canvas.height=c):t.canvas=n.create(t,u,c,e.renderType),e.canvasStyle&&(t.canvas.style=e.canvasStyle),e.antialias||s.setCrisp(t.canvas),e.renderType!==r.HEADLESS)&&(a=i(91135),h=i(11857),e.renderType===r.WEBGL?t.renderer=new h(t):(t.renderer=new a(t),t.context=t.renderer.gameContext))}},77291:(t,e,i)=>{var s=i(86459);t.exports=function(t){var e=t.config;if(!e.hideBanner){var i="WebGL";e.renderType===s.CANVAS?i="Canvas":e.renderType===s.HEADLESS&&(i="Headless");var n,r=e.audio,o=t.device.audio;if(n=o.webAudio&&!r.disableWebAudio?"Web Audio":r.noAudio||!o.webAudio&&!o.audioData?"No Audio":"HTML5 Audio",t.device.browser.ie)window.console&&console.log("Phaser v"+s.VERSION+" / https://phaser.io");else{var a,h="",l=[h];if(Array.isArray(e.bannerBackgroundColor))e.bannerBackgroundColor.forEach((function(t){h=h.concat("%c "),l.push("background: "+t),a=t})),l[l.length-1]="color: "+e.bannerTextColor+"; background: "+a;else h=h.concat("%c "),l.push("color: "+e.bannerTextColor+"; background: "+e.bannerBackgroundColor);l.push("background: transparent"),e.gameTitle&&(h=h.concat(e.gameTitle),e.gameVersion&&(h=h.concat(" v"+e.gameVersion)),e.hidePhaser||(h=h.concat(" / ")));e.hidePhaser||(h=h.concat("Phaser v"+s.VERSION+" ("+i+" | "+n+")")),h=h.concat(" %c "+e.gameURL),l[0]=h,console.log.apply(console,l)}}}},15213:(t,e,i)=>{var s=i(99584),n=i(90249),r=i(43474),o=i(61068),a=i(56694),h=i(14033),l=i(85178),u=i(50150),c=i(81078),d=i(77291),p=i(77290),f=i(21546),v=i(6659),g=i(97081),m=i(69898),y=i(91963),x=i(49274),T=i(756),w=i(13553),b=i(38203),E=i(6237),S=i(26617),A=i(26493),_=i(84191),C=new a({initialize:function(t){this.config=new h(t),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new v,this.anims=new n(this),this.textures=new E(this),this.cache=new r(this),this.registry=new c(this),this.input=new m(this,this.config),this.scene=new w(this,this.config.sceneConfig),this.device=p,this.scale=new T(this,this.config),this.sound=null,this.sound=_.create(this),this.loop=new S(this,this.config.fps),this.plugins=new x(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,f(this.boot.bind(this))},boot:function(){y.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),u(this),l(this),d(this),s(this.canvas,this.config.parent),this.textures.once(b.READY,this.texturesReady,this),this.events.emit(g.BOOT)):console.warn("Aborting. Core Plugins missing.")},texturesReady:function(){this.events.emit(g.READY),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),A(this);var t=this.events;t.on(g.HIDDEN,this.onHidden,this),t.on(g.VISIBLE,this.onVisible,this),t.on(g.BLUR,this.onBlur,this),t.on(g.FOCUS,this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit(g.PRE_STEP,t,e),i.emit(g.STEP,t,e),this.scene.update(t,e),i.emit(g.POST_STEP,t,e);var s=this.renderer;s.preRender(),i.emit(g.PRE_RENDER,s,t,e),this.scene.render(s),s.postRender(),i.emit(g.POST_RENDER,s,t,e)},headlessStep:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit(g.PRE_STEP,t,e),i.emit(g.STEP,t,e),this.scene.update(t,e),i.emit(g.POST_STEP,t,e),i.emit(g.PRE_RENDER),i.emit(g.POST_RENDER)},onHidden:function(){this.loop.pause(),this.events.emit(g.PAUSE)},pause:function(){this.onHidden()},onVisible:function(){this.loop.resume(),this.events.emit(g.RESUME)},resume:function(){this.onVisible()},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},getFrame:function(){return this.loop.frame},getTime:function(){return this.loop.now},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.scene.destroy(),this.events.emit(g.DESTROY),this.events.removeAllListeners(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(o.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.domContainer&&this.domContainer.parentNode.removeChild(this.domContainer),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=C},26617:(t,e,i)=>{var s=i(56694),n=i(10850),r=i(72283),o=i(27385),a=new s({initialize:function(t,e){this.game=t,this.raf=new o,this.started=!1,this.running=!1,this.minFps=n(e,"min",5),this.targetFps=n(e,"target",60),this.fpsLimit=n(e,"limit",0),this.hasFpsLimit=this.fpsLimit>0,this._limitRate=this.hasFpsLimit?1e3/this.fpsLimit:0,this._min=1e3/this.minFps,this._target=1e3/this.targetFps,this.actualFps=this.targetFps,this.nextFpsUpdate=0,this.framesThisSecond=0,this.callback=r,this.forceSetTimeOut=n(e,"forceSetTimeOut",!1),this.time=0,this.startTime=0,this.lastTime=0,this.frame=0,this.inFocus=!0,this._pauseTime=0,this._coolDown=0,this.delta=0,this.deltaIndex=0,this.deltaHistory=[],this.deltaSmoothingMax=n(e,"deltaHistory",10),this.panicMax=n(e,"panicMax",120),this.rawDelta=0,this.now=0,this.smoothStep=n(e,"smoothStep",!0)},blur:function(){this.inFocus=!1},focus:function(){this.inFocus=!0,this.resetDelta()},pause:function(){this._pauseTime=window.performance.now()},resume:function(){this.resetDelta(),this.startTime+=this.time-this._pauseTime},resetDelta:function(){var t=window.performance.now();this.time=t,this.lastTime=t,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0;for(var e=0;e0||!this.inFocus)&&(this._coolDown--,t=Math.min(t,this._target)),t>this._min&&(t=i[e],t=Math.min(t,this._min)),i[e]=t,this.deltaIndex++,this.deltaIndex>=s&&(this.deltaIndex=0);for(var n=0,r=0;r=this.nextFpsUpdate&&this.updateFPS(t),this.framesThisSecond++,this.delta>=this._limitRate&&(this.callback(t,this.delta),this.delta=0),this.lastTime=t,this.frame++},step:function(t){this.now=t;var e=Math.max(0,t-this.lastTime);this.rawDelta=e,this.time+=this.rawDelta,this.smoothStep&&(e=this.smoothDelta(e)),this.delta=e,t>=this.nextFpsUpdate&&this.updateFPS(t),this.framesThisSecond++,this.callback(t,e),this.lastTime=t,this.frame++},tick:function(){var t=window.performance.now();this.hasFpsLimit?this.stepLimitFPS(t):this.step(t)},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){void 0===t&&(t=!1);var e=window.performance.now();if(!this.running){t&&(this.startTime+=-this.lastTime+(this.lastTime+e));var i=this.hasFpsLimit?this.stepLimitFPS.bind(this):this.step.bind(this);this.raf.start(i,this.forceSetTimeOut,this._target),this.running=!0,this.nextFpsUpdate=e+1e3,this.framesThisSecond=0,this.fpsLimitTriggered=!1,this.tick()}},getDuration:function(){return Math.round(this.lastTime-this.startTime)/1e3},getDurationMS:function(){return Math.round(this.lastTime-this.startTime)},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.raf.destroy(),this.raf=null,this.game=null,this.callback=null}});t.exports=a},26493:(t,e,i)=>{var s=i(97081);t.exports=function(t){var e,i=t.events;if(void 0!==document.hidden)e="visibilitychange";else{["webkit","moz","ms"].forEach((function(t){void 0!==document[t+"Hidden"]&&(document.hidden=function(){return document[t+"Hidden"]},e=t+"visibilitychange")}))}e&&document.addEventListener(e,(function(t){document.hidden||"pause"===t.type?i.emit(s.HIDDEN):i.emit(s.VISIBLE)}),!1),window.onblur=function(){i.emit(s.BLUR)},window.onfocus=function(){i.emit(s.FOCUS)},window.focus&&t.config.autoFocus&&window.focus()}},41651:t=>{t.exports="blur"},5520:t=>{t.exports="boot"},51673:t=>{t.exports="contextlost"},66336:t=>{t.exports="contextrestored"},25055:t=>{t.exports="destroy"},23767:t=>{t.exports="focus"},57564:t=>{t.exports="hidden"},38327:t=>{t.exports="pause"},43807:t=>{t.exports="postrender"},73652:t=>{t.exports="poststep"},780:t=>{t.exports="prerender"},13781:t=>{t.exports="prestep"},38247:t=>{t.exports="ready"},29129:t=>{t.exports="resume"},34994:t=>{t.exports="step"},98704:t=>{t.exports="visible"},97081:(t,e,i)=>{t.exports={BLUR:i(41651),BOOT:i(5520),CONTEXT_LOST:i(51673),CONTEXT_RESTORED:i(66336),DESTROY:i(25055),FOCUS:i(23767),HIDDEN:i(57564),PAUSE:i(38327),POST_RENDER:i(43807),POST_STEP:i(73652),PRE_RENDER:i(780),PRE_STEP:i(13781),READY:i(38247),RESUME:i(29129),STEP:i(34994),VISIBLE:i(98704)}},80293:(t,e,i)=>{t.exports={Config:i(14033),CreateRenderer:i(50150),DebugHeader:i(77291),Events:i(97081),TimeStep:i(26617),VisibilityHandler:i(26493)}},52780:(t,e,i)=>{var s=i(81543),n=i(61068),r=i(10850);t.exports=function(t){var e=r(t,"data",[]),i=r(t,"canvas",null),o=r(t,"palette",s),a=r(t,"pixelWidth",1),h=r(t,"pixelHeight",a),l=r(t,"resizeCanvas",!0),u=r(t,"clearCanvas",!0),c=r(t,"preRender",null),d=r(t,"postRender",null),p=Math.floor(Math.abs(e[0].length*a)),f=Math.floor(Math.abs(e.length*h));i||(i=n.create2D(this,p,f),l=!1,u=!1),l&&(i.width=p,i.height=f);var v=i.getContext("2d");u&&v.clearRect(0,0,p,f),c&&c(i,v);for(var g=0;g{t.exports={GenerateTexture:i(52780),Palettes:i(25235)}},81543:t=>{t.exports={0:"#000",1:"#9D9D9D",2:"#FFF",3:"#BE2633",4:"#E06F8B",5:"#493C2B",6:"#A46422",7:"#EB8931",8:"#F7E26B",9:"#2F484E",A:"#44891A",B:"#A3CE27",C:"#1B2632",D:"#005784",E:"#31A2F2",F:"#B2DCEF"}},75846:t=>{t.exports={0:"#000",1:"#fff",2:"#8b4131",3:"#7bbdc5",4:"#8b41ac",5:"#6aac41",6:"#3931a4",7:"#d5de73",8:"#945a20",9:"#5a4100",A:"#bd736a",B:"#525252",C:"#838383",D:"#acee8b",E:"#7b73de",F:"#acacac"}},83206:t=>{t.exports={0:"#000",1:"#2234d1",2:"#0c7e45",3:"#44aacc",4:"#8a3622",5:"#5c2e78",6:"#aa5c3d",7:"#b5b5b5",8:"#5e606e",9:"#4c81fb",A:"#6cd947",B:"#7be2f9",C:"#eb8a60",D:"#e23d69",E:"#ffd93f",F:"#fff"}},13194:t=>{t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#f5f4eb"}},50686:t=>{t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#fff"}},25235:(t,e,i)=>{t.exports={ARNE16:i(81543),C64:i(75846),CGA:i(83206),JMP:i(13194),MSX:i(50686)}},63120:(t,e,i)=>{var s=i(56694),n=i(34631),r=i(38517),o=i(93736),a=new s({Extends:r,initialize:function(t,e,i,s){r.call(this,"CubicBezierCurve"),Array.isArray(t)&&(s=new o(t[6],t[7]),i=new o(t[4],t[5]),e=new o(t[2],t[3]),t=new o(t[0],t[1])),this.p0=t,this.p1=e,this.p2=i,this.p3=s},getStartPoint:function(t){return void 0===t&&(t=new o),t.copy(this.p0)},getResolution:function(t){return t},getPoint:function(t,e){void 0===e&&(e=new o);var i=this.p0,s=this.p1,r=this.p2,a=this.p3;return e.set(n(t,i.x,s.x,r.x,a.x),n(t,i.y,s.y,r.y,a.y))},draw:function(t,e){void 0===e&&(e=32);var i=this.getPoints(e);t.beginPath(),t.moveTo(this.p0.x,this.p0.y);for(var s=1;s{var s=i(56694),n=i(80222),r=i(74118),o=i(93736),a=new s({initialize:function(t){this.type=t,this.defaultDivisions=5,this.arcLengthDivisions=100,this.cacheArcLengths=[],this.needsUpdate=!0,this.active=!0,this._tmpVec2A=new o,this._tmpVec2B=new o},draw:function(t,e){return void 0===e&&(e=32),t.strokePoints(this.getPoints(e))},getBounds:function(t,e){t||(t=new r),void 0===e&&(e=16);var i=this.getLength();e>i&&(e=i/2);var s=Math.max(1,Math.round(i/e));return n(this.getSpacedPoints(s),t)},getDistancePoints:function(t){var e=this.getLength(),i=Math.max(1,e/t);return this.getSpacedPoints(i)},getEndPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(1,t)},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],s=this.getPoint(0,this._tmpVec2A),n=0;i.push(0);for(var r=1;r<=t;r++)n+=(e=this.getPoint(r/t,this._tmpVec2B)).distance(s),i.push(n),s.copy(e);return this.cacheArcLengths=i,i},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var s=0;s<=t;s++)i.push(this.getPoint(s/t));return i},getRandomPoint:function(t){return void 0===t&&(t=new o),this.getPoint(Math.random(),t)},getSpacedPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var s=0;s<=t;s++){var n=this.getUtoTmapping(s/t,null,t);i.push(this.getPoint(n))}return i},getStartPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(0,t)},getTangent:function(t,e){void 0===e&&(e=new o);var i=1e-4,s=t-i,n=t+i;return s<0&&(s=0),n>1&&(n=1),this.getPoint(s,this._tmpVec2A),this.getPoint(n,e),e.subtract(this._tmpVec2A).normalize()},getTangentAt:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)},getTFromDistance:function(t,e){return t<=0?0:this.getUtoTmapping(0,t,e)},getUtoTmapping:function(t,e,i){var s,n=this.getLengths(i),r=0,o=n.length;s=e?Math.min(e,n[o-1]):t*n[o-1];for(var a,h=0,l=o-1;h<=l;)if((a=n[r=Math.floor(h+(l-h)/2)]-s)<0)h=r+1;else{if(!(a>0)){l=r;break}l=r-1}if(n[r=l]===s)return r/(o-1);var u=n[r];return(r+(s-u)/(n[r+1]-u))/(o-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});t.exports=a},48835:(t,e,i)=>{var s=i(56694),n=i(38517),r=i(75606),o=i(10850),a=i(23701),h=i(93736),l=new s({Extends:n,initialize:function(t,e,i,s,a,l,u,c){if("object"==typeof t){var d=t;t=o(d,"x",0),e=o(d,"y",0),i=o(d,"xRadius",0),s=o(d,"yRadius",i),a=o(d,"startAngle",0),l=o(d,"endAngle",360),u=o(d,"clockwise",!1),c=o(d,"rotation",0)}else void 0===s&&(s=i),void 0===a&&(a=0),void 0===l&&(l=360),void 0===u&&(u=!1),void 0===c&&(c=0);n.call(this,"EllipseCurve"),this.p0=new h(t,e),this._xRadius=i,this._yRadius=s,this._startAngle=r(a),this._endAngle=r(l),this._clockwise=u,this._rotation=r(c)},getStartPoint:function(t){return void 0===t&&(t=new h),this.getPoint(0,t)},getResolution:function(t){return 2*t},getPoint:function(t,e){void 0===e&&(e=new h);for(var i=2*Math.PI,s=this._endAngle-this._startAngle,n=Math.abs(s)i;)s-=i;s{var s=i(56694),n=i(38517),r=i(80222),o=i(74118),a=i(93736),h=new s({Extends:n,initialize:function(t,e){n.call(this,"LineCurve"),Array.isArray(t)&&(e=new a(t[2],t[3]),t=new a(t[0],t[1])),this.p0=t,this.p1=e,this.arcLengthDivisions=1},getBounds:function(t){return void 0===t&&(t=new o),r([this.p0,this.p1],t)},getStartPoint:function(t){return void 0===t&&(t=new a),t.copy(this.p0)},getResolution:function(t){return void 0===t&&(t=1),t},getPoint:function(t,e){return void 0===e&&(e=new a),1===t?e.copy(this.p1):(e.copy(this.p1).subtract(this.p0).scale(t).add(this.p0),e)},getPointAt:function(t,e){return this.getPoint(t,e)},getTangent:function(t,e){return void 0===e&&(e=new a),e.copy(this.p1).subtract(this.p0).normalize(),e},getUtoTmapping:function(t,e,i){var s;if(e){var n=this.getLengths(i),r=n[n.length-1];s=Math.min(e,r)/r}else s=t;return s},draw:function(t){return t.lineBetween(this.p0.x,this.p0.y,this.p1.x,this.p1.y),t},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y]}}});h.fromJSON=function(t){var e=t.points,i=new a(e[0],e[1]),s=new a(e[2],e[3]);return new h(i,s)},t.exports=h},64761:(t,e,i)=>{var s=i(56694),n=i(38517),r=i(16252),o=i(93736),a=new s({Extends:n,initialize:function(t,e,i){n.call(this,"QuadraticBezierCurve"),Array.isArray(t)&&(i=new o(t[4],t[5]),e=new o(t[2],t[3]),t=new o(t[0],t[1])),this.p0=t,this.p1=e,this.p2=i},getStartPoint:function(t){return void 0===t&&(t=new o),t.copy(this.p0)},getResolution:function(t){return t},getPoint:function(t,e){void 0===e&&(e=new o);var i=this.p0,s=this.p1,n=this.p2;return e.set(r(t,i.x,s.x,n.x),r(t,i.y,s.y,n.y))},draw:function(t,e){void 0===e&&(e=32);var i=this.getPoints(e);t.beginPath(),t.moveTo(this.p0.x,this.p0.y);for(var s=1;s{var s=i(14976),n=i(56694),r=i(38517),o=i(93736),a=new n({Extends:r,initialize:function(t){void 0===t&&(t=[]),r.call(this,"SplineCurve"),this.points=[],this.addPoints(t)},addPoints:function(t){for(var e=0;ei.length-2?i.length-1:r+1],c=i[r>i.length-3?i.length-1:r+2];return e.set(s(a,h.x,l.x,u.x,c.x),s(a,h.y,l.y,u.y,c.y))},toJSON:function(){for(var t=[],e=0;e{t.exports={Path:i(12822),MoveTo:i(53639),CubicBezier:i(63120),Curve:i(38517),Ellipse:i(48835),Line:i(58084),QuadraticBezier:i(64761),Spline:i(11956)}},53639:(t,e,i)=>{var s=i(56694),n=i(93736),r=new s({initialize:function(t,e){this.active=!1,this.p0=new n(t,e)},getPoint:function(t,e){return void 0===e&&(e=new n),e.copy(this.p0)},getPointAt:function(t,e){return this.getPoint(t,e)},getResolution:function(){return 1},getLength:function(){return 0},toJSON:function(){return{type:"MoveTo",points:[this.p0.x,this.p0.y]}}});t.exports=r},12822:(t,e,i)=>{var s=i(56694),n=i(63120),r=i(48835),o=i(61286),a=i(58084),h=i(53639),l=i(64761),u=i(74118),c=i(11956),d=i(93736),p=i(83392),f=new s({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.name="",this.curves=[],this.cacheLengths=[],this.autoClose=!1,this.startPoint=new d,this._tmpVec2A=new d,this._tmpVec2B=new d,"object"==typeof t?this.fromJSON(t):this.startPoint.set(t,e)},add:function(t){return this.curves.push(t),this},circleTo:function(t,e,i){return void 0===e&&(e=!1),this.ellipseTo(t,t,0,360,e,i)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);return t.equals(e)||this.curves.push(new a(e,t)),this},cubicBezierTo:function(t,e,i,s,r,o){var a,h,l,u=this.getEndPoint();return t instanceof d?(a=t,h=e,l=i):(a=new d(i,s),h=new d(r,o),l=new d(t,e)),this.add(new n(u,a,h,l))},quadraticBezierTo:function(t,e,i,s){var n,r,o=this.getEndPoint();return t instanceof d?(n=t,r=e):(n=new d(i,s),r=new d(t,e)),this.add(new l(o,n,r))},draw:function(t,e){for(var i=0;i=e)return this.curves[s];s++}return null},getEndPoint:function(t){return void 0===t&&(t=new d),this.curves.length>0?this.curves[this.curves.length-1].getPoint(1,t):t.copy(this.startPoint),t},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},getPoint:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),s=this.getCurveLengths(),n=0;n=i){var r=s[n]-i,o=this.curves[n],a=o.getLength(),h=0===a?0:1-r/a;return o.getPointAt(h,e)}n++}return null},getPoints:function(t){void 0===t&&(t=12);for(var e,i=[],s=0;s1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i},getRandomPoint:function(t){return void 0===t&&(t=new d),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getStartPoint:function(t){return void 0===t&&(t=new d),t.copy(this.startPoint)},getTangent:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),s=this.getCurveLengths(),n=0;n=i){var r=s[n]-i,o=this.curves[n],a=o.getLength(),h=0===a?0:1-r/a;return o.getTangentAt(h,e)}n++}return null},lineTo:function(t,e){t instanceof d?this._tmpVec2B.copy(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new a([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new c(t))},moveTo:function(t,e){return t instanceof d?this.add(new h(t.x,t.y)):this.add(new h(t,e))},toJSON:function(){for(var t=[],e=0;e{var s=i(56694),n=i(35026),r=new s({initialize:function(t,e){this.parent=t,this.events=e,e||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once(n.DESTROY,this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],s=0;s{var s=i(56694),n=i(81078),r=i(91963),o=i(7599),a=new s({Extends:n,initialize:function(t){n.call(this,t,t.sys.events),this.scene=t,this.systems=t.sys,t.sys.events.once(o.BOOT,this.boot,this),t.sys.events.on(o.START,this.start,this)},boot:function(){this.events=this.systems.events,this.events.once(o.DESTROY,this.destroy,this)},start:function(){this.events.once(o.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.systems.events.off(o.SHUTDOWN,this.shutdown,this)},destroy:function(){n.prototype.destroy.call(this),this.events.off(o.START,this.start,this),this.scene=null,this.systems=null}});r.register("DataManagerPlugin",a,"data"),t.exports=a},73569:t=>{t.exports="changedata"},15590:t=>{t.exports="changedata-"},37669:t=>{t.exports="destroy"},87090:t=>{t.exports="removedata"},90142:t=>{t.exports="setdata"},35026:(t,e,i)=>{t.exports={CHANGE_DATA:i(73569),CHANGE_DATA_KEY:i(15590),DESTROY:i(37669),REMOVE_DATA:i(87090),SET_DATA:i(90142)}},1999:(t,e,i)=>{t.exports={DataManager:i(81078),DataManagerPlugin:i(76508),Events:i(35026)}},10720:(t,e,i)=>{var s=i(1350),n={flac:!1,aac:!1,audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return n;n.audioData=!!window.Audio,n.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio"),e=!!t.canPlayType;try{if(e){var i=function(e,i){var s=t.canPlayType("audio/"+e).replace(/^no$/,"");return i?Boolean(s||t.canPlayType("audio/"+i).replace(/^no$/,"")):Boolean(s)};if(n.ogg=i('ogg; codecs="vorbis"'),n.opus=i('ogg; codecs="opus"',"opus"),n.mp3=i("mpeg"),n.wav=i("wav"),n.m4a=i("x-m4a"),n.aac=i("aac"),n.flac=i("flac","x-flac"),n.webm=i('webm; codecs="vorbis"'),""!==t.canPlayType('audio/mp4; codecs="ec-3"'))if(s.edge)n.dolby=!0;else if(s.safari&&s.safariVersion>=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var r=parseInt(RegExp.$1,10),o=parseInt(RegExp.$2,10);(10===r&&o>=11||r>10)&&(n.dolby=!0)}}}catch(t){}return n}()},1350:(t,e,i)=>{var s,n=i(36580),r={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0};t.exports=(s=navigator.userAgent,/Edge\/\d+/.test(s)?r.edge=!0:/Chrome\/(\d+)/.test(s)&&!n.windowsPhone?(r.chrome=!0,r.chromeVersion=parseInt(RegExp.$1,10)):/Firefox\D+(\d+)/.test(s)?(r.firefox=!0,r.firefoxVersion=parseInt(RegExp.$1,10)):/AppleWebKit/.test(s)&&n.iOS?r.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(s)?(r.ie=!0,r.ieVersion=parseInt(RegExp.$1,10)):/Opera/.test(s)?r.opera=!0:/Safari/.test(s)&&!n.windowsPhone?r.safari=!0:/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(s)&&(r.ie=!0,r.trident=!0,r.tridentVersion=parseInt(RegExp.$1,10),r.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(s)&&(r.silk=!0),r)},98581:(t,e,i)=>{var s,n,r,o=i(61068),a={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=("function"!=typeof importScripts&&void 0!==document&&(a.supportNewBlendModes=(s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",n="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(r=new Image).onload=function(){var t=new Image;t.onload=function(){var e=o.create2D(t,6).getContext("2d",{willReadFrequently:!0});if(e.globalCompositeOperation="multiply",e.drawImage(r,0,0),e.drawImage(t,2,0),!e.getImageData(2,0,1,1))return!1;var i=e.getImageData(2,0,1,1).data;o.remove(t),a.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=s+"/wCKxvRF"+n},r.src=s+"AP804Oa6"+n,!1),a.supportInverseAlpha=function(){var t=o.create2D(this,2).getContext("2d",{willReadFrequently:!0});t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1),s=i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3];return o.remove(this),s}()),a)},90185:(t,e,i)=>{var s=i(36580),n=i(1350),r=i(61068),o={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){if("function"==typeof importScripts)return o;o.canvas=!!window.CanvasRenderingContext2D;try{o.localStorage=!!localStorage.getItem}catch(t){o.localStorage=!1}o.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),o.fileSystem=!!window.requestFileSystem;var t,e,i,a=!1;return o.webGL=function(){if(window.WebGLRenderingContext)try{var t=r.createWebGL(this),e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=r.create2D(this),s=i.getContext("2d").createImageData(1,1);return a=s.data instanceof Uint8ClampedArray,r.remove(t),r.remove(i),!!e}catch(t){return!1}return!1}(),o.worker=!!window.Worker,o.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,o.getUserMedia=o.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,n.firefox&&n.firefoxVersion<21&&(o.getUserMedia=!1),!s.iOS&&(n.ie||n.firefox||n.chrome)&&(o.canvasBitBltShift=!0),(n.safari||n.mobileSafari)&&(o.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(o.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(o.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),o.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==o.littleEndian&&a,o}()},33553:t=>{var e={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){if("function"==typeof importScripts)return e;var t,i="Fullscreen",s="FullScreen",n=["request"+i,"request"+s,"webkitRequest"+i,"webkitRequest"+s,"msRequest"+i,"msRequest"+s,"mozRequest"+s,"mozRequest"+i];for(t=0;t{var s=i(1350),n={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=("function"==typeof importScripts||(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(n.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(n.mspointer=!0),navigator.getGamepads&&(n.gamepads=!0),"onwheel"in window||s.ie&&"WheelEvent"in window?n.wheelEvent="wheel":"onmousewheel"in window?n.wheelEvent="mousewheel":s.firefox&&"MouseScrollEvent"in window&&(n.wheelEvent="DOMMouseScroll")),n)},36580:t=>{var e={android:!1,chromeOS:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};t.exports=function(){if("function"==typeof importScripts)return e;var t=navigator.userAgent;/Windows/.test(t)?e.windows=!0:/Mac OS/.test(t)&&!/like Mac OS/.test(t)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(e.iOS=!0,e.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),e.iOSVersion=parseInt(RegExp.$1,10)):e.macOS=!0:/Android/.test(t)?e.android=!0:/Linux/.test(t)?e.linux=!0:/iP[ao]d|iPhone/i.test(t)?(e.iOS=!0,navigator.appVersion.match(/OS (\d+)/),e.iOSVersion=parseInt(RegExp.$1,10),e.iPhone=-1!==t.toLowerCase().indexOf("iphone"),e.iPad=-1!==t.toLowerCase().indexOf("ipad")):/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?e.kindle=!0:/CrOS/.test(t)&&(e.chromeOS=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(e.android=!1,e.iOS=!1,e.macOS=!1,e.windows=!0,e.windowsPhone=!0);var i=/Silk/.test(t);return(e.windows||e.macOS||e.linux&&!i||e.chromeOS)&&(e.desktop=!0),(e.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(e.desktop=!1),navigator.standalone&&(e.webApp=!0),"function"!=typeof importScripts&&(void 0!==window.cordova&&(e.cordova=!0),void 0!==window.ejecta&&(e.ejecta=!0)),"undefined"!=typeof process&&process.versions&&process.versions.node&&(e.node=!0),e.node&&"object"==typeof process.versions&&(e.nodeWebkit=!!process.versions["node-webkit"],e.electron=!!process.versions.electron),/Crosswalk/.test(t)&&(e.crosswalk=!0),e.pixelRatio=window.devicePixelRatio||1,e}()},53861:t=>{var e={h264:!1,hls:!1,mp4:!1,m4v:!1,ogg:!1,vp9:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return e;var t=document.createElement("video"),i=!!t.canPlayType,s=/^no$/;try{i&&(t.canPlayType('video/ogg; codecs="theora"').replace(s,"")&&(e.ogg=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(s,"")&&(e.h264=!0,e.mp4=!0),t.canPlayType("video/x-m4v").replace(s,"")&&(e.m4v=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(s,"")&&(e.webm=!0),t.canPlayType('video/webm; codecs="vp9"').replace(s,"")&&(e.vp9=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(s,"")&&(e.hls=!0))}catch(t){}return e}()},77290:(t,e,i)=>{t.exports={os:i(36580),browser:i(1350),features:i(90185),input:i(95872),audio:i(10720),video:i(53861),fullscreen:i(33553),canvasFeatures:i(98581)}},65246:(t,e,i)=>{var s=new(i(56694))({initialize:function(){this._matrix=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],this.alpha=1,this._dirty=!0,this._data},set:function(t){return this._matrix=t,this._dirty=!0,this},reset:function(){var t=this._matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=1,t[13]=0,t[14]=0,t[15]=0,t[16]=0,t[17]=0,t[18]=1,t[19]=0,this._dirty=!0,this},getData:function(){if(this._dirty){var t=new Float32Array(this._matrix);t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,this._data=t,this._dirty=!1}return this._data},brightness:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t;return this.multiply([i,0,0,0,0,0,i,0,0,0,0,0,i,0,0,0,0,0,1,0],e)},saturate:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=2*t/3+1,s=-.5*(i-1);return this.multiply([i,s,s,0,0,s,i,s,0,0,s,s,i,0,0,0,0,0,1,0],e)},desaturate:function(t){return void 0===t&&(t=!1),this.saturate(-1,t)},hue:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1),t=t/180*Math.PI;var i=Math.cos(t),s=Math.sin(t),n=.213,r=.715,o=.072;return this.multiply([n+.787*i+s*-n,r+i*-r+s*-r,o+i*-o+.928*s,0,0,n+i*-n+.143*s,r+i*(1-r)+.14*s,o+i*-o+-.283*s,0,0,n+i*-n+-.787*s,r+i*-r+s*r,o+.928*i+s*o,0,0,0,0,0,1,0],e)},grayscale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=!1),this.saturate(-t,e)},blackWhite:function(t){return void 0===t&&(t=!1),this.multiply([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},contrast:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t+1,s=-.5*(i-1);return this.multiply([i,0,0,0,s,0,i,0,0,s,0,0,i,0,s,0,0,0,1,0],e)},negative:function(t){return void 0===t&&(t=!1),this.multiply([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},desaturateLuminance:function(t){return void 0===t&&(t=!1),this.multiply([.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0],t)},sepia:function(t){return void 0===t&&(t=!1),this.multiply([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},night:function(t,e){return void 0===t&&(t=.1),void 0===e&&(e=!1),this.multiply([-2*t,-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0],e)},lsd:function(t){return void 0===t&&(t=!1),this.multiply([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},brown:function(t){return void 0===t&&(t=!1),this.multiply([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},vintagePinhole:function(t){return void 0===t&&(t=!1),this.multiply([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},kodachrome:function(t){return void 0===t&&(t=!1),this.multiply([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],t)},technicolor:function(t){return void 0===t&&(t=!1),this.multiply([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],t)},polaroid:function(t){return void 0===t&&(t=!1),this.multiply([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},shiftToBGR:function(t){return void 0===t&&(t=!1),this.multiply([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},multiply:function(t,e){e||this.reset();for(var i=this._matrix,s=[],n=0;n<20;n++)s[n]=i[n];return i[0]=s[0]*t[0]+s[1]*t[5]+s[2]*t[10]+s[3]*t[15],i[1]=s[0]*t[1]+s[1]*t[6]+s[2]*t[11]+s[3]*t[16],i[2]=s[0]*t[2]+s[1]*t[7]+s[2]*t[12]+s[3]*t[17],i[3]=s[0]*t[3]+s[1]*t[8]+s[2]*t[13]+s[3]*t[18],i[4]=s[0]*t[4]+s[1]*t[9]+s[2]*t[14]+s[3]*t[19]+s[4],i[5]=s[5]*t[0]+s[6]*t[5]+s[7]*t[10]+s[8]*t[15],i[6]=s[5]*t[1]+s[6]*t[6]+s[7]*t[11]+s[8]*t[16],i[7]=s[5]*t[2]+s[6]*t[7]+s[7]*t[12]+s[8]*t[17],i[8]=s[5]*t[3]+s[6]*t[8]+s[7]*t[13]+s[8]*t[18],i[9]=s[5]*t[4]+s[6]*t[9]+s[7]*t[14]+s[8]*t[19]+s[9],i[10]=s[10]*t[0]+s[11]*t[5]+s[12]*t[10]+s[13]*t[15],i[11]=s[10]*t[1]+s[11]*t[6]+s[12]*t[11]+s[13]*t[16],i[12]=s[10]*t[2]+s[11]*t[7]+s[12]*t[12]+s[13]*t[17],i[13]=s[10]*t[3]+s[11]*t[8]+s[12]*t[13]+s[13]*t[18],i[14]=s[10]*t[4]+s[11]*t[9]+s[12]*t[14]+s[13]*t[19]+s[14],i[15]=s[15]*t[0]+s[16]*t[5]+s[17]*t[10]+s[18]*t[15],i[16]=s[15]*t[1]+s[16]*t[6]+s[17]*t[11]+s[18]*t[16],i[17]=s[15]*t[2]+s[16]*t[7]+s[17]*t[12]+s[18]*t[17],i[18]=s[15]*t[3]+s[16]*t[8]+s[17]*t[13]+s[18]*t[18],i[19]=s[15]*t[4]+s[16]*t[9]+s[17]*t[14]+s[18]*t[19]+s[19],this._dirty=!0,this}});t.exports=s},39298:(t,e,i)=>{var s=i(56694),n=i(72283),r=new s({initialize:function(t,e,i){this._rgb=[0,0,0],this.onChangeCallback=n,this.dirty=!1,this.set(t,e,i)},set:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this._rgb=[t,e,i],this.onChange(),this},equals:function(t,e,i){var s=this._rgb;return s[0]===t&&s[1]===e&&s[2]===i},onChange:function(){this.dirty=!0;var t=this._rgb;this.onChangeCallback.call(this,t[0],t[1],t[2])},r:{get:function(){return this._rgb[0]},set:function(t){this._rgb[0]=t,this.onChange()}},g:{get:function(){return this._rgb[1]},set:function(t){this._rgb[1]=t,this.onChange()}},b:{get:function(){return this._rgb[2]},set:function(t){this._rgb[2]=t,this.onChange()}},destroy:function(){this.onChangeCallback=null}});t.exports=r},84093:t=>{t.exports={TOP_LEFT:0,TOP_CENTER:1,TOP_RIGHT:2,LEFT_TOP:3,LEFT_CENTER:4,LEFT_BOTTOM:5,CENTER:6,RIGHT_TOP:7,RIGHT_CENTER:8,RIGHT_BOTTOM:9,BOTTOM_LEFT:10,BOTTOM_CENTER:11,BOTTOM_RIGHT:12}},32058:(t,e,i)=>{var s=i(97328),n=i(59994),r=i(73174),o=i(28417);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)+a),t}},85535:(t,e,i)=>{var s=i(97328),n=i(40163),r=i(73174),o=i(74465);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)-i),r(t,s(e)+a),t}},9605:(t,e,i)=>{var s=i(97328),n=i(70271),r=i(73174),o=i(19298);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)+a),t}},22529:(t,e,i)=>{var s=i(21843),n=i(59994),r=i(29568);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),s(t,n(e)+i,r(e)+o),t}},5739:(t,e,i)=>{var s=i(29568),n=i(40163),r=i(81711),o=i(74465);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)-i),r(t,s(e)+a),t}},40327:(t,e,i)=>{var s=i(84093),n=[];n[s.BOTTOM_CENTER]=i(32058),n[s.BOTTOM_LEFT]=i(85535),n[s.BOTTOM_RIGHT]=i(9605),n[s.CENTER]=i(22529),n[s.LEFT_CENTER]=i(5739),n[s.RIGHT_CENTER]=i(27683),n[s.TOP_CENTER]=i(96439),n[s.TOP_LEFT]=i(81447),n[s.TOP_RIGHT]=i(47888),n[s.LEFT_BOTTOM]=n[s.BOTTOM_LEFT],n[s.LEFT_TOP]=n[s.TOP_LEFT],n[s.RIGHT_BOTTOM]=n[s.BOTTOM_RIGHT],n[s.RIGHT_TOP]=n[s.TOP_RIGHT];t.exports=function(t,e,i,s,r){return n[i](t,e,s,r)}},27683:(t,e,i)=>{var s=i(29568),n=i(70271),r=i(81711),o=i(19298);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)+a),t}},96439:(t,e,i)=>{var s=i(59994),n=i(47196),r=i(28417),o=i(84349);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)+i),o(t,n(e)-a),t}},81447:(t,e,i)=>{var s=i(40163),n=i(47196),r=i(74465),o=i(84349);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)-i),o(t,n(e)-a),t}},47888:(t,e,i)=>{var s=i(70271),n=i(47196),r=i(19298),o=i(84349);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)+i),o(t,n(e)-a),t}},46997:(t,e,i)=>{t.exports={BottomCenter:i(32058),BottomLeft:i(85535),BottomRight:i(9605),Center:i(22529),LeftCenter:i(5739),QuickSet:i(40327),RightCenter:i(27683),TopCenter:i(96439),TopLeft:i(81447),TopRight:i(47888)}},93545:(t,e,i)=>{var s=i(84093),n=i(98611),r={In:i(46997),To:i(86639)};r=n(!1,r,s),t.exports=r},27118:(t,e,i)=>{var s=i(97328),n=i(59994),r=i(28417),o=i(84349);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)+a),t}},84469:(t,e,i)=>{var s=i(97328),n=i(40163),r=i(74465),o=i(84349);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)-i),o(t,s(e)+a),t}},51577:(t,e,i)=>{var s=i(97328),n=i(70271),r=i(19298),o=i(84349);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)+a),t}},90271:(t,e,i)=>{var s=i(97328),n=i(40163),r=i(73174),o=i(19298);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)-i),r(t,s(e)+a),t}},30466:(t,e,i)=>{var s=i(29568),n=i(40163),r=i(81711),o=i(19298);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)-i),r(t,s(e)+a),t}},50087:(t,e,i)=>{var s=i(40163),n=i(47196),r=i(19298),o=i(84349);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)-i),o(t,n(e)-a),t}},82590:(t,e,i)=>{var s=i(84093),n=[];n[s.BOTTOM_CENTER]=i(27118),n[s.BOTTOM_LEFT]=i(84469),n[s.BOTTOM_RIGHT]=i(51577),n[s.LEFT_BOTTOM]=i(90271),n[s.LEFT_CENTER]=i(30466),n[s.LEFT_TOP]=i(50087),n[s.RIGHT_BOTTOM]=i(13555),n[s.RIGHT_CENTER]=i(99049),n[s.RIGHT_TOP]=i(67788),n[s.TOP_CENTER]=i(78170),n[s.TOP_LEFT]=i(54145),n[s.TOP_RIGHT]=i(75548);t.exports=function(t,e,i,s,r){return n[i](t,e,s,r)}},13555:(t,e,i)=>{var s=i(97328),n=i(70271),r=i(73174),o=i(74465);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)+a),t}},99049:(t,e,i)=>{var s=i(29568),n=i(70271),r=i(81711),o=i(74465);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)+a),t}},67788:(t,e,i)=>{var s=i(70271),n=i(47196),r=i(74465),o=i(84349);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)+i),o(t,n(e)-a),t}},78170:(t,e,i)=>{var s=i(59994),n=i(47196),r=i(73174),o=i(28417);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)-a),t}},54145:(t,e,i)=>{var s=i(40163),n=i(47196),r=i(73174),o=i(74465);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)-a),t}},75548:(t,e,i)=>{var s=i(70271),n=i(47196),r=i(73174),o=i(19298);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)-a),t}},86639:(t,e,i)=>{t.exports={BottomCenter:i(27118),BottomLeft:i(84469),BottomRight:i(51577),LeftBottom:i(90271),LeftCenter:i(30466),LeftTop:i(50087),QuickSet:i(82590),RightBottom:i(13555),RightCenter:i(99049),RightTop:i(67788),TopCenter:i(78170),TopLeft:i(54145),TopRight:i(75548)}},21843:(t,e,i)=>{var s=i(28417),n=i(81711);t.exports=function(t,e,i){return s(t,e),n(t,i)}},97328:t=>{t.exports=function(t){return t.y+t.height-t.height*t.originY}},7126:(t,e,i)=>{var s=i(97328),n=i(40163),r=i(70271),o=i(47196);t.exports=function(t,e){void 0===e&&(e={});var i=n(t),a=o(t);return e.x=i,e.y=a,e.width=r(t)-i,e.height=s(t)-a,e}},59994:t=>{t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},29568:t=>{t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},40163:t=>{t.exports=function(t){return t.x-t.width*t.originX}},52088:t=>{t.exports=function(t){return t.width*t.originX}},23379:t=>{t.exports=function(t){return t.height*t.originY}},70271:t=>{t.exports=function(t){return t.x+t.width-t.width*t.originX}},47196:t=>{t.exports=function(t){return t.y-t.height*t.originY}},73174:t=>{t.exports=function(t,e){return t.y=e-t.height+t.height*t.originY,t}},28417:t=>{t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},81711:t=>{t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},74465:t=>{t.exports=function(t,e){return t.x=e+t.width*t.originX,t}},19298:t=>{t.exports=function(t,e){return t.x=e-t.width+t.width*t.originX,t}},84349:t=>{t.exports=function(t,e){return t.y=e+t.height*t.originY,t}},15252:(t,e,i)=>{t.exports={CenterOn:i(21843),GetBottom:i(97328),GetBounds:i(7126),GetCenterX:i(59994),GetCenterY:i(29568),GetLeft:i(40163),GetOffsetX:i(52088),GetOffsetY:i(23379),GetRight:i(70271),GetTop:i(47196),SetBottom:i(73174),SetCenterX:i(28417),SetCenterY:i(81711),SetLeft:i(74465),SetRight:i(19298),SetTop:i(84349)}},70616:t=>{t.exports={setCrisp:function(t){return["optimizeSpeed","-moz-crisp-edges","-o-crisp-edges","-webkit-optimize-contrast","optimize-contrast","crisp-edges","pixelated"].forEach((function(e){t.style["image-rendering"]=e})),t.style.msInterpolationMode="nearest-neighbor",t},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},61068:(t,e,i)=>{var s,n,r,o=i(86459),a=i(8213),h=[],l=!1;t.exports=(r=function(){var t=0;return h.forEach((function(e){e.parent&&t++})),t},{create2D:function(t,e,i){return s(t,e,i,o.CANVAS)},create:s=function(t,e,i,s,r){var u;void 0===e&&(e=1),void 0===i&&(i=1),void 0===s&&(s=o.CANVAS),void 0===r&&(r=!1);var c=n(s);return null===c?(c={parent:t,canvas:document.createElement("canvas"),type:s},s===o.CANVAS&&h.push(c),u=c.canvas):(c.parent=t,u=c.canvas),r&&(c.parent=u),u.width=e,u.height=i,l&&s===o.CANVAS&&a.disable(u.getContext("2d")),u},createWebGL:function(t,e,i){return s(t,e,i,o.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:n=function(t){if(void 0===t&&(t=o.CANVAS),t===o.WEBGL)return null;for(var e=0;e{var e,i="";t.exports={disable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!1),t},enable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!0),t},getPrefix:e=function(t){for(var e=["i","webkitI","msI","mozI","oI"],i=0;i{t.exports=function(t,e){return void 0===e&&(e="none"),t.style.msTouchAction=e,t.style["ms-touch-action"]=e,t.style["touch-action"]=e,t}},36505:t=>{t.exports=function(t,e){void 0===e&&(e="none");return["-webkit-","-khtml-","-moz-","-ms-",""].forEach((function(i){t.style[i+"user-select"]=e})),t.style["-webkit-touch-callout"]=e,t.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",t}},23514:(t,e,i)=>{t.exports={CanvasInterpolation:i(70616),CanvasPool:i(61068),Smoothing:i(8213),TouchAction:i(59271),UserSelect:i(36505)}},27119:(t,e,i)=>{var s=i(56694),n=i(22946),r=i(5657),o=i(24650),a=i(68033),h=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=255),this.r=0,this.g=0,this.b=0,this.a=255,this._h=0,this._s=0,this._v=0,this._locked=!1,this.gl=[0,0,0,1],this._color=0,this._color32=0,this._rgba="",this.setTo(t,e,i,s)},transparent:function(){return this._locked=!0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this._locked=!1,this.update(!0)},setTo:function(t,e,i,s,n){return void 0===s&&(s=255),void 0===n&&(n=!0),this._locked=!0,this.red=t,this.green=e,this.blue=i,this.alpha=s,this._locked=!1,this.update(n)},setGLTo:function(t,e,i,s){return void 0===s&&(s=1),this._locked=!0,this.redGL=t,this.greenGL=e,this.blueGL=i,this.alphaGL=s,this._locked=!1,this.update(!0)},setFromRGB:function(t){return this._locked=!0,this.red=t.r,this.green=t.g,this.blue=t.b,t.hasOwnProperty("a")&&(this.alpha=t.a),this._locked=!1,this.update(!0)},setFromHSV:function(t,e,i){return o(t,e,i,this)},update:function(t){if(void 0===t&&(t=!1),this._locked)return this;var e=this.r,i=this.g,s=this.b,o=this.a;return this._color=n(e,i,s),this._color32=r(e,i,s,o),this._rgba="rgba("+e+","+i+","+s+","+o/255+")",t&&a(e,i,s,this),this},updateHSV:function(){var t=this.r,e=this.g,i=this.b;return a(t,e,i,this),this},clone:function(){return new h(this.r,this.g,this.b,this.a)},gray:function(t){return this.setTo(t,t,t)},random:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t)),s=Math.floor(t+Math.random()*(e-t)),n=Math.floor(t+Math.random()*(e-t));return this.setTo(i,s,n)},randomGray:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t));return this.setTo(i,i,i)},saturate:function(t){return this.s+=t/100,this},desaturate:function(t){return this.s-=t/100,this},lighten:function(t){return this.v+=t/100,this},darken:function(t){return this.v-=t/100,this},brighten:function(t){var e=this.r,i=this.g,s=this.b;return e=Math.max(0,Math.min(255,e-Math.round(-t/100*255))),i=Math.max(0,Math.min(255,i-Math.round(-t/100*255))),s=Math.max(0,Math.min(255,s-Math.round(-t/100*255))),this.setTo(e,i,s)},color:{get:function(){return this._color}},color32:{get:function(){return this._color32}},rgba:{get:function(){return this._rgba}},redGL:{get:function(){return this.gl[0]},set:function(t){this.gl[0]=Math.min(Math.abs(t),1),this.r=Math.floor(255*this.gl[0]),this.update(!0)}},greenGL:{get:function(){return this.gl[1]},set:function(t){this.gl[1]=Math.min(Math.abs(t),1),this.g=Math.floor(255*this.gl[1]),this.update(!0)}},blueGL:{get:function(){return this.gl[2]},set:function(t){this.gl[2]=Math.min(Math.abs(t),1),this.b=Math.floor(255*this.gl[2]),this.update(!0)}},alphaGL:{get:function(){return this.gl[3]},set:function(t){this.gl[3]=Math.min(Math.abs(t),1),this.a=Math.floor(255*this.gl[3]),this.update()}},red:{get:function(){return this.r},set:function(t){t=Math.floor(Math.abs(t)),this.r=Math.min(t,255),this.gl[0]=t/255,this.update(!0)}},green:{get:function(){return this.g},set:function(t){t=Math.floor(Math.abs(t)),this.g=Math.min(t,255),this.gl[1]=t/255,this.update(!0)}},blue:{get:function(){return this.b},set:function(t){t=Math.floor(Math.abs(t)),this.b=Math.min(t,255),this.gl[2]=t/255,this.update(!0)}},alpha:{get:function(){return this.a},set:function(t){t=Math.floor(Math.abs(t)),this.a=Math.min(t,255),this.gl[3]=t/255,this.update()}},h:{get:function(){return this._h},set:function(t){this._h=t,o(t,this._s,this._v,this)}},s:{get:function(){return this._s},set:function(t){this._s=t,o(this._h,t,this._v,this)}},v:{get:function(){return this._v},set:function(t){this._v=t,o(this._h,this._s,t,this)}}});t.exports=h},30245:(t,e,i)=>{var s=i(22946);t.exports=function(t){void 0===t&&(t=1024);var e,i=[],n=255,r=255,o=0,a=0;for(e=0;e<=n;e++)i.push({r:r,g:e,b:a,color:s(r,e,a)});for(o=255,e=n;e>=0;e--)i.push({r:e,g:o,b:a,color:s(e,o,a)});for(r=0,e=0;e<=n;e++,o--)i.push({r:r,g:o,b:e,color:s(r,o,e)});for(o=0,a=255,e=0;e<=n;e++,a--,r++)i.push({r:r,g:o,b:a,color:s(r,o,a)});if(1024===t)return i;var h=[],l=0,u=1024/t;for(e=0;e{t.exports=function(t){var e={r:t>>16&255,g:t>>8&255,b:255&t,a:255};return t>16777215&&(e.a=t>>>24),e}},25409:t=>{t.exports=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e}},22946:t=>{t.exports=function(t,e,i){return t<<16|e<<8|i}},5657:t=>{t.exports=function(t,e,i,s){return s<<24|t<<16|e<<8|i}},74777:(t,e,i)=>{var s=i(27119),n=i(59998);t.exports=function(t,e,i){var r=i,o=i,a=i;if(0!==e){var h=i<.5?i*(1+e):i+e-i*e,l=2*i-h;r=n(l,h,t+1/3),o=n(l,h,t),a=n(l,h,t-1/3)}return(new s).setGLTo(r,o,a,1)}},89263:(t,e,i)=>{var s=i(24650);t.exports=function(t,e){void 0===t&&(t=1),void 0===e&&(e=1);for(var i=[],n=0;n<=359;n++)i.push(s(n/359,t,e));return i}},24650:(t,e,i)=>{var s=i(22946);function n(t,e,i,s){var n=(t+6*e)%6,r=Math.min(n,4-n,1);return Math.round(255*(s-s*i*Math.max(0,r)))}t.exports=function(t,e,i,r){void 0===e&&(e=1),void 0===i&&(i=1);var o=n(5,t,e,i),a=n(3,t,e,i),h=n(1,t,e,i);return r?r.setTo?r.setTo(o,a,h,r.alpha,!1):(r.r=o,r.g=a,r.b=h,r.color=s(o,a,h),r):{r:o,g:a,b:h,color:s(o,a,h)}}},91487:(t,e,i)=>{var s=i(27119);t.exports=function(t){var e=new s;t=t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,i,s){return e+e+i+i+s+s}));var i=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(i){var n=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16);e.setTo(n,r,o)}return e}},59998:t=>{t.exports=function(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}},74853:(t,e,i)=>{var s=i(27119),n=i(15978);t.exports=function(t){var e=n(t);return new s(e.r,e.g,e.b,e.a)}},15978:t=>{t.exports=function(t){return t>16777215?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},53756:(t,e,i)=>{var s=i(42798),n=function(t,e,i,n,r,o,a,h){void 0===a&&(a=100),void 0===h&&(h=0);var l=h/a;return{r:s(t,n,l),g:s(e,r,l),b:s(i,o,l)}};t.exports={RGBWithRGB:n,ColorWithRGB:function(t,e,i,s,r,o){return void 0===r&&(r=100),void 0===o&&(o=0),n(t.r,t.g,t.b,e,i,s,r,o)},ColorWithColor:function(t,e,i,s){return void 0===i&&(i=100),void 0===s&&(s=0),n(t.r,t.g,t.b,e.r,e.g,e.b,i,s)}}},73904:(t,e,i)=>{var s=i(27119);t.exports=function(t){return new s(t.r,t.g,t.b,t.a)}},26841:(t,e,i)=>{var s=i(27119);t.exports=function(t){var e=new s,i=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(t.toLowerCase());if(i){var n=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10),a=void 0!==i[4]?parseFloat(i[4]):1;e.setTo(n,r,o,255*a)}return e}},68033:t=>{t.exports=function(t,e,i,s){void 0===s&&(s={h:0,s:0,v:0}),t/=255,e/=255,i/=255;var n=Math.min(t,e,i),r=Math.max(t,e,i),o=r-n,a=0,h=0===r?0:o/r,l=r;return r!==n&&(r===t?a=(e-i)/o+(e{var s=i(25409);t.exports=function(t,e,i,n,r){return void 0===n&&(n=255),void 0===r&&(r="#"),"#"===r?"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1,7):"0x"+s(n)+s(t)+s(e)+s(i)}},37243:(t,e,i)=>{var s=i(17489),n=i(27119);t.exports=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=255),new n(s(t,e),s(t,e),s(t,e))}},93222:(t,e,i)=>{var s=i(91487),n=i(74853),r=i(73904),o=i(26841);t.exports=function(t){switch(typeof t){case"string":return"rgb"===t.substr(0,3).toLowerCase()?o(t):s(t);case"number":return n(t);case"object":return r(t)}}},95509:(t,e,i)=>{var s=i(27119);s.ColorSpectrum=i(30245),s.ColorToRGBA=i(86672),s.ComponentToHex=i(25409),s.GetColor=i(22946),s.GetColor32=i(5657),s.HexStringToColor=i(91487),s.HSLToColor=i(74777),s.HSVColorWheel=i(89263),s.HSVToRGB=i(24650),s.HueToComponent=i(59998),s.IntegerToColor=i(74853),s.IntegerToRGB=i(15978),s.Interpolate=i(53756),s.ObjectToColor=i(73904),s.RandomRGB=i(37243),s.RGBStringToColor=i(26841),s.RGBToHSV=i(68033),s.RGBToString=i(4880),s.ValueToColor=i(93222),t.exports=s},24816:(t,e,i)=>{t.exports={Align:i(93545),BaseShader:i(31053),Bounds:i(15252),Canvas:i(23514),Color:i(95509),ColorMatrix:i(65246),Masks:i(93310),RGB:i(39298)}},76756:(t,e,i)=>{var s=i(56694),n=i(97081),r=i(81044),o=new s({initialize:function(t,e){var i=t.sys.renderer;this.renderer=i,this.bitmapMask=e,this.maskTexture=null,this.mainTexture=null,this.dirty=!0,this.mainFramebuffer=null,this.maskFramebuffer=null,this.invertAlpha=!1,this.isStencil=!1,this.scene=t,this.createMask(),t.sys.game.events.on(n.CONTEXT_RESTORED,this.createMask,this),i&&i.on(r.RESIZE,this.createMask,this)},createMask:function(){var t=this.renderer;if(t&&t.gl){this.mainTexture&&this.clearMask();var e=t.width,i=t.height,s=0==(e&e-1)&&0==(i&i-1),n=t.gl,r=s?n.REPEAT:n.CLAMP_TO_EDGE,o=n.LINEAR;this.mainTexture=t.createTexture2D(0,o,o,r,r,n.RGBA,null,e,i),this.maskTexture=t.createTexture2D(0,o,o,r,r,n.RGBA,null,e,i),this.mainFramebuffer=t.createFramebuffer(e,i,this.mainTexture,!0),this.maskFramebuffer=t.createFramebuffer(e,i,this.maskTexture,!0)}},clearMask:function(){var t=this.renderer;t&&t.gl&&this.mainTexture&&(t.deleteTexture(this.mainTexture),t.deleteTexture(this.maskTexture),t.deleteFramebuffer(this.mainFramebuffer),t.deleteFramebuffer(this.maskFramebuffer),this.mainTexture=null,this.maskTexture=null,this.mainFramebuffer=null,this.maskFramebuffer=null)},setBitmap:function(t){this.bitmapMask=t},preRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.beginMask(this,e,i)},postRenderWebGL:function(t,e){t.pipelines.BITMAPMASK_PIPELINE.endMask(this,e)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.clearMask(),this.scene.sys.game.events.off(n.CONTEXT_RESTORED,this.createMask,this),this.renderer&&this.renderer.off(r.RESIZE,this.createMask,this),this.bitmapMask=null,this.prevFramebuffer=null,this.renderer=null}});t.exports=o},63037:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e){this.geometryMask=e,this.invertAlpha=!1,this.isStencil=!0,this.level=0},setShape:function(t){return this.geometryMask=t,this},setInvertAlpha:function(t){return void 0===t&&(t=!0),this.invertAlpha=t,this},preRenderWebGL:function(t,e,i){var s=t.gl;t.flush(),0===t.maskStack.length&&(s.enable(s.STENCIL_TEST),s.clear(s.STENCIL_BUFFER_BIT),t.maskCount=0),t.currentCameraMask.mask!==this&&(t.currentMask.mask=this),t.maskStack.push({mask:this,camera:i}),this.applyStencil(t,i,!0),t.maskCount++},applyStencil:function(t,e,i){var s=t.gl,n=this.geometryMask,r=t.maskCount;s.colorMask(!1,!1,!1,!1),i?(s.stencilFunc(s.EQUAL,r,255),s.stencilOp(s.KEEP,s.KEEP,s.INCR)):(s.stencilFunc(s.EQUAL,r+1,255),s.stencilOp(s.KEEP,s.KEEP,s.DECR)),n.renderWebGL(t,n,e),t.flush(),s.colorMask(!0,!0,!0,!0),s.stencilOp(s.KEEP,s.KEEP,s.KEEP),i?this.invertAlpha?s.stencilFunc(s.NOTEQUAL,r+1,255):s.stencilFunc(s.EQUAL,r+1,255):this.invertAlpha?s.stencilFunc(s.NOTEQUAL,r,255):s.stencilFunc(s.EQUAL,r,255)},postRenderWebGL:function(t){var e=t.gl;t.maskStack.pop(),t.maskCount--,t.flush();var i=t.currentMask;if(0===t.maskStack.length)i.mask=null,e.disable(e.STENCIL_TEST);else{var s=t.maskStack[t.maskStack.length-1];s.mask.applyStencil(t,s.camera,!1),t.currentCameraMask.mask!==s.mask?(i.mask=s.mask,i.camera=s.camera):i.mask=null}},preRenderCanvas:function(t,e,i){var s=this.geometryMask;t.currentContext.save(),s.renderCanvas(t,s,i,null,null,!0),t.currentContext.clip()},postRenderCanvas:function(t){t.currentContext.restore()},destroy:function(){this.geometryMask=null}});t.exports=s},93310:(t,e,i)=>{t.exports={BitmapMask:i(76756),GeometryMask:i(63037)}},31053:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s){e&&""!==e||(e=["precision mediump float;","uniform vec2 resolution;","varying vec2 fragCoord;","void main () {"," vec2 uv = fragCoord / resolution.xy;"," gl_FragColor = vec4(uv.xyx, 1.0);","}"].join("\n")),i&&""!==i||(i=["precision mediump float;","uniform mat4 uProjectionMatrix;","uniform mat4 uViewMatrix;","uniform vec2 uResolution;","attribute vec2 inPosition;","varying vec2 fragCoord;","varying vec2 outTexCoord;","void main () {"," gl_Position = uProjectionMatrix * uViewMatrix * vec4(inPosition, 1.0, 1.0);"," fragCoord = vec2(inPosition.x, uResolution.y - inPosition.y);"," outTexCoord = vec2(inPosition.x / uResolution.x, fragCoord.y / uResolution.y);","}"].join("\n")),void 0===s&&(s=null),this.key=t,this.fragmentSrc=e,this.vertexSrc=i,this.uniforms=s}});t.exports=s},99584:t=>{t.exports=function(t,e){var i;if(e)"string"==typeof e?i=document.getElementById(e):"object"==typeof e&&1===e.nodeType&&(i=e);else if(t.parentElement||null===e)return t;return i||(i=document.body),i.appendChild(t),t}},85178:(t,e,i)=>{var s=i(99584);t.exports=function(t){var e=t.config;if(e.parent&&e.domCreateContainer){var i=document.createElement("div");i.style.cssText=["display: block;","width: "+t.scale.width+"px;","height: "+t.scale.height+"px;","padding: 0; margin: 0;","position: absolute;","overflow: hidden;","pointer-events: "+e.domPointerEvents+";","transform: scale(1);","transform-origin: left top;"].join(" "),t.domContainer=i,s(i,e.parent)}}},21546:(t,e,i)=>{var s=i(36580);t.exports=function(t){if("complete"!==document.readyState&&"interactive"!==document.readyState){var e=function(){document.removeEventListener("deviceready",e,!0),document.removeEventListener("DOMContentLoaded",e,!0),window.removeEventListener("load",e,!0),t()};document.body?s.cordova?document.addEventListener("deviceready",e,!1):(document.addEventListener("DOMContentLoaded",e,!0),window.addEventListener("load",e,!0)):window.setTimeout(e,20)}else t()}},74181:t=>{t.exports=function(t){if(!t)return window.innerHeight;var e=Math.abs(window.orientation),i={w:0,h:0},s=document.createElement("div");return s.setAttribute("style","position: fixed; height: 100vh; width: 0; top: 0"),document.documentElement.appendChild(s),i.w=90===e?s.offsetHeight:window.innerWidth,i.h=90===e?window.innerWidth:s.offsetHeight,document.documentElement.removeChild(s),s=null,90!==Math.abs(window.orientation)?i.h:i.w}},9229:(t,e,i)=>{var s=i(55301);t.exports=function(t,e){var i=window.screen,n=!!i&&(i.orientation||i.mozOrientation||i.msOrientation);return n&&"string"==typeof n.type?n.type:"string"==typeof n?n:"number"==typeof window.orientation?0===window.orientation||180===window.orientation?s.ORIENTATION.PORTRAIT:s.ORIENTATION.LANDSCAPE:window.matchMedia?window.matchMedia("(orientation: portrait)").matches?s.ORIENTATION.PORTRAIT:window.matchMedia("(orientation: landscape)").matches?s.ORIENTATION.LANDSCAPE:void 0:e>t?s.ORIENTATION.PORTRAIT:s.ORIENTATION.LANDSCAPE}},2893:t=>{t.exports=function(t){var e;return""!==t&&("string"==typeof t?e=document.getElementById(t):t&&1===t.nodeType&&(e=t)),e||(e=document.body),e}},89200:t=>{t.exports=function(t){var e="";try{if(window.DOMParser)e=(new DOMParser).parseFromString(t,"text/xml");else(e=new ActiveXObject("Microsoft.XMLDOM")).loadXML(t)}catch(t){e=null}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length?e:null}},55638:t=>{t.exports=function(t){t.parentNode&&t.parentNode.removeChild(t)}},27385:(t,e,i)=>{var s=i(56694),n=i(72283),r=new s({initialize:function(){this.isRunning=!1,this.callback=n,this.isSetTimeOut=!1,this.timeOutID=null,this.delay=0;var t=this;this.step=function e(i){t.callback(i),t.isRunning&&(t.timeOutID=window.requestAnimationFrame(e))},this.stepTimeout=function e(){t.isRunning&&(t.timeOutID=window.setTimeout(e,t.delay)),t.callback(window.performance.now())}},start:function(t,e,i){this.isRunning||(this.callback=t,this.isSetTimeOut=e,this.delay=i,this.isRunning=!0,this.timeOutID=e?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=n}});t.exports=r},3590:(t,e,i)=>{var s={AddToDOM:i(99584),DOMContentLoaded:i(21546),GetInnerHeight:i(74181),GetScreenOrientation:i(9229),GetTarget:i(2893),ParseXML:i(89200),RemoveFromDOM:i(55638),RequestAnimationFrame:i(27385)};t.exports=s},78491:(t,e,i)=>{var s=i(56694),n=i(6659),r=i(91963),o=new s({Extends:n,initialize:function(){n.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});r.register("EventEmitter",o,"events"),t.exports=o},95146:(t,e,i)=>{t.exports={EventEmitter:i(78491)}},88933:(t,e,i)=>{var s=i(95723),n=i(20494);t.exports=function(t,e,i){e.x=n(i,"x",0),e.y=n(i,"y",0),e.depth=n(i,"depth",0),e.flipX=n(i,"flipX",!1),e.flipY=n(i,"flipY",!1);var r=n(i,"scale",null);"number"==typeof r?e.setScale(r):null!==r&&(e.scaleX=n(r,"x",1),e.scaleY=n(r,"y",1));var o=n(i,"scrollFactor",null);"number"==typeof o?e.setScrollFactor(o):null!==o&&(e.scrollFactorX=n(o,"x",1),e.scrollFactorY=n(o,"y",1)),e.rotation=n(i,"rotation",0);var a=n(i,"angle",null);null!==a&&(e.angle=a),e.alpha=n(i,"alpha",1);var h=n(i,"origin",null);if("number"==typeof h)e.setOrigin(h);else if(null!==h){var l=n(h,"x",.5),u=n(h,"y",.5);e.setOrigin(l,u)}return e.blendMode=n(i,"blendMode",s.NORMAL),e.visible=n(i,"visible",!0),n(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},32291:(t,e,i)=>{var s=i(20494);t.exports=function(t,e){var i=s(e,"anims",null);if(null===i)return t;if("string"==typeof i)t.anims.play(i);else if("object"==typeof i){var n=t.anims,r=s(i,"key",void 0);if(r){var o=s(i,"startFrame",void 0),a=s(i,"delay",0),h=s(i,"repeat",0),l=s(i,"repeatDelay",0),u=s(i,"yoyo",!1),c=s(i,"play",!1),d=s(i,"delayedPlay",0),p={key:r,delay:a,repeat:h,repeatDelay:l,yoyo:u,startFrame:o};c?n.play(p):d>0?n.playAfterDelay(p,d):n.load(p)}}return t}},91713:(t,e,i)=>{var s=i(56694),n=i(71207),r=i(91963),o=i(56631),a=i(7599),h=i(17922),l=new s({Extends:n,initialize:function(t){n.call(this,t),this.sortChildrenFlag=!1,this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.events.once(a.BOOT,this.boot,this),this.events.on(a.START,this.start,this)},boot:function(){this.events.once(a.DESTROY,this.destroy,this)},addChildCallback:function(t){t.displayList&&t.displayList!==this&&t.removeFromDisplayList(),t.parentContainer&&t.parentContainer.remove(t),t.displayList||(this.queueDepthSort(),t.displayList=this,t.emit(o.ADDED_TO_SCENE,t,this.scene),this.events.emit(a.ADDED_TO_SCENE,t,this.scene))},removeChildCallback:function(t){this.queueDepthSort(),t.displayList=null,t.emit(o.REMOVED_FROM_SCENE,t,this.scene),this.events.emit(a.REMOVED_FROM_SCENE,t,this.scene)},start:function(){this.events.once(a.SHUTDOWN,this.shutdown,this)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(h(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},getChildren:function(){return this.list},shutdown:function(){for(var t=this.list;t.length;)t[0].destroy(!0);this.events.off(a.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(a.START,this.start,this),this.scene=null,this.systems=null,this.events=null}});r.register("DisplayList",l,"displayList"),t.exports=l},89980:(t,e,i)=>{var s=i(56694),n=i(48129),r=i(81078),o=i(6659),a=i(56631),h=i(7599),l=new s({Extends:o,initialize:function(t,e){o.call(this),this.scene=t,this.displayList=null,this.type=e,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.on(a.ADDED_TO_SCENE,this.addedToScene,this),this.on(a.REMOVED_FROM_SCENE,this.removedFromScene,this),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new r(this)),this},setData:function(t,e){return this.data||(this.data=new r(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new r(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new r(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new r(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(){return this.scene.sys.input.disable(this),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return n(this)},willRender:function(t){return!(!(!this.displayList||!this.displayList.active||this.displayList.willRender(t))||l.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return this.displayList?i.unshift(this.displayList.getIndex(t)):i.unshift(this.scene.sys.displayList.getIndex(t)),i},addToDisplayList:function(t){return void 0===t&&(t=this.scene.sys.displayList),this.displayList&&this.displayList!==t&&this.removeFromDisplayList(),t.exists(this)||(this.displayList=t,t.add(this,!0),t.queueDepthSort(),this.emit(a.ADDED_TO_SCENE,this,this.scene),t.events.emit(h.ADDED_TO_SCENE,this,this.scene)),this},addToUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.add(this),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(a.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(h.REMOVED_FROM_SCENE,this,this.scene)),this},removeFromUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.remove(this),this},destroy:function(t){this.scene&&!this.ignoreDestroy&&(void 0===t&&(t=!1),this.preDestroy&&this.preDestroy.call(this),this.emit(a.DESTROY,this,t),this.removeAllListeners(),this.postPipelines&&this.resetPostPipeline(!0),this.removeFromDisplayList(),this.removeFromUpdateList(),this.input&&(this.scene.sys.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0)}});l.RENDER_MASK=15,t.exports=l},99325:(t,e,i)=>{var s=i(56694),n=i(91963),r=i(7599),o=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(r.BOOT,this.boot,this),this.events.on(r.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(r.DESTROY,this.destroy,this)},start:function(){this.events.once(r.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.events.off(r.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});o.register=function(t,e){o.prototype.hasOwnProperty(t)||(o.prototype[t]=e)},o.remove=function(t){o.prototype.hasOwnProperty(t)&&delete o.prototype[t]},n.register("GameObjectCreator",o,"make"),t.exports=o},61286:(t,e,i)=>{var s=i(56694),n=i(91963),r=i(7599),o=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(r.BOOT,this.boot,this),this.events.on(r.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(r.DESTROY,this.destroy,this)},start:function(){this.events.once(r.SHUTDOWN,this.shutdown,this)},existing:function(t){return(t.renderCanvas||t.renderWebGL)&&this.displayList.add(t),t.preUpdate&&this.updateList.add(t),t},shutdown:function(){this.events.off(r.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});o.register=function(t,e){o.prototype.hasOwnProperty(t)||(o.prototype[t]=e)},o.remove=function(t){o.prototype.hasOwnProperty(t)&&delete o.prototype[t]},n.register("GameObjectFactory",o,"add"),t.exports=o},73329:(t,e,i)=>{var s=i(69360),n=new s,r=new s,o=new s,a={camera:n,sprite:r,calc:o};t.exports=function(t,e,i){var s=n,h=r,l=o;return h.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),s.copyFrom(e.matrix),i?(s.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),h.e=t.x,h.f=t.y):(h.e-=e.scrollX*t.scrollFactorX,h.f-=e.scrollY*t.scrollFactorY),s.multiply(h,l),a}},92034:(t,e,i)=>{var s=i(56694),n=i(74623),r=i(91963),o=i(7599),a=new s({Extends:n,initialize:function(t){n.call(this),this.checkQueue=!0,this.scene=t,this.systems=t.sys,t.sys.events.once(o.BOOT,this.boot,this),t.sys.events.on(o.START,this.start,this)},boot:function(){this.systems.events.once(o.DESTROY,this.destroy,this)},start:function(){var t=this.systems.events;t.on(o.PRE_UPDATE,this.update,this),t.on(o.UPDATE,this.sceneUpdate,this),t.once(o.SHUTDOWN,this.shutdown,this)},sceneUpdate:function(t,e){for(var i=this._active,s=i.length,n=0;n{t.exports=function(t,e,i,s,n,r,o,a,h,l,u,c,d,p,f){var v=i.x-e.displayOriginX+n,g=i.y-e.displayOriginY+r,m=v+i.w,y=g+i.h,x=o.getXRound(v,g,a),T=o.getYRound(v,g,a),w=o.getXRound(v,y,a),b=o.getYRound(v,y,a),E=o.getXRound(m,y,a),S=o.getYRound(m,y,a),A=o.getXRound(m,g,a),_=o.getYRound(m,g,a);t.batchQuad(e,x,T,w,b,E,S,A,_,s.u0,s.v0,s.u1,s.v1,h,l,u,c,d,p,f)}},82173:t=>{t.exports=function(t,e,i,s){if(void 0===i&&(i=!1),void 0===s)return s={local:{x:0,y:0,width:0,height:0},global:{x:0,y:0,width:0,height:0},lines:{shortest:0,longest:0,lengths:null,height:0},wrappedText:"",words:[],characters:[],scaleX:0,scaleY:0};var n,r,o,a,h=t.text,l=h.length,u=t.maxWidth,c=t.wordWrapCharCode,d=Number.MAX_VALUE,p=Number.MAX_VALUE,f=0,v=0,g=t.fontData.chars,m=t.fontData.lineHeight,y=t.letterSpacing,x=0,T=0,w=0,b=null,E=t._align,S=0,A=0,_=t.fontSize/t.fontData.size,C=_*t.scaleX,R=_*t.scaleY,M=null,P=0,O=[],L=Number.MAX_VALUE,F=0,D=0,k=0,I=[],B=[],N=null;if(u>0){for(n=0;nu||V-X>u?(z.push(G.i-1),G.cr?(z.push(G.i+G.word.length),X=0,U=null):U=G):G.cr&&(z.push(G.i+G.word.length),X=0,U=null)}for(n=z.length-1;n>=0;n--)r=h,o=z[n],a="\n",h=r.substr(0,o)+a+r.substr(o+1);s.wrappedText=h,l=h.length,I=[],N=null}var H=0;for(n=0;nS&&(d=S),p>A&&(p=A);var K=S+b.xAdvance,q=A+m;fF&&(F=k),kF&&(F=k),k0)for(var J=0;J{var s=i(31476);t.exports=function(t,e,i,n,r,o,a){var h=t.sys.textures.get(i),l=h.get(n),u=t.sys.cache.xml.get(r);if(l&&u){var c=s(u,l,o,a,h);return t.sys.cache.bitmapFont.add(e,{data:c,texture:i,frame:n,fromAtlas:!0}),!0}return!1}},39860:(t,e,i)=>{var s=i(10850);t.exports=function(t,e){var i=e.width,n=e.height,r=Math.floor(i/2),o=Math.floor(n/2),a=s(e,"chars","");if(""!==a){var h=s(e,"image",""),l=t.sys.textures.getFrame(h),u=l.cutX,c=l.cutY,d=l.source.width,p=l.source.height,f=s(e,"offset.x",0),v=s(e,"offset.y",0),g=s(e,"spacing.x",0),m=s(e,"spacing.y",0),y=s(e,"lineSpacing",0),x=s(e,"charsPerRow",null);null===x&&(x=d/i)>a.length&&(x=a.length);for(var T=f,w=v,b={retroFont:!0,font:h,size:i,lineHeight:n+y,chars:{}},E=0,S=0;S{function e(t,e){return parseInt(t.getAttribute(e),10)}t.exports=function(t,i,s,n,r){void 0===s&&(s=0),void 0===n&&(n=0);var o=i.cutX,a=i.cutY,h=i.source.width,l=i.source.height,u=i.sourceIndex,c={},d=t.getElementsByTagName("info")[0],p=t.getElementsByTagName("common")[0];c.font=d.getAttribute("face"),c.size=e(d,"size"),c.lineHeight=e(p,"lineHeight")+n,c.chars={};var f=t.getElementsByTagName("char"),v=void 0!==i&&i.trimmed;if(v)var g=i.height,m=i.width;for(var y=0;y{var s=i(66863),n=i(98611),r={Parse:i(39860)};r=n(!1,r,s),t.exports=r},66863:t=>{t.exports={TEXT_SET1:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},13468:(t,e,i)=>{var s=i(44616),n=i(56694),r=i(88899),o=new n({Extends:s,Mixins:[r],initialize:function(t,e,i,n,r,o,a){s.call(this,t,e,i,n,r,o,a),this.type="DynamicBitmapText",this.scrollX=0,this.scrollY=0,this.cropWidth=0,this.cropHeight=0,this.displayCallback,this.callbackData={parent:this,color:0,tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:0,charCode:0,x:0,y:0,scale:0,rotation:0,data:0}},setSize:function(t,e){return this.cropWidth=t,this.cropHeight=e,this},setDisplayCallback:function(t){return this.displayCallback=t,this},setScrollX:function(t){return this.scrollX=t,this},setScrollY:function(t){return this.scrollY=t,this}});t.exports=o},93438:(t,e,i)=>{var s=i(49584);t.exports=function(t,e,i,n){var r=e._text,o=r.length,a=t.currentContext;if(0!==o&&s(t,a,e,i,n)){i.addToRenderList(e);var h=e.fromAtlas?e.frame:e.texture.frames.__BASE,l=e.displayCallback,u=e.callbackData,c=e.fontData.chars,d=e.fontData.lineHeight,p=e._letterSpacing,f=0,v=0,g=0,m=null,y=0,x=0,T=0,w=0,b=0,E=0,S=null,A=0,_=e.frame.source.image,C=h.cutX,R=h.cutY,M=0,P=0,O=e._fontSize/e.fontData.size,L=e._align,F=0,D=0;e.getTextBounds(!1);var k=e._bounds.lines;1===L?D=(k.longest-k.lengths[0])/2:2===L&&(D=k.longest-k.lengths[0]),a.translate(-e.displayOriginX,-e.displayOriginY);var I=i.roundPixels;e.cropWidth>0&&e.cropHeight>0&&(a.beginPath(),a.rect(0,0,e.cropWidth,e.cropHeight),a.clip());for(var B=0;B{var s=i(13468),n=i(88933),r=i(99325),o=i(20494);r.register("dynamicBitmapText",(function(t,e){void 0===t&&(t={});var i=o(t,"font",""),r=o(t,"text",""),a=o(t,"size",!1),h=new s(this.scene,0,0,i,r,a);return void 0!==e&&(t.add=e),n(this.scene,h,t),h}))},94145:(t,e,i)=>{var s=i(13468);i(61286).register("dynamicBitmapText",(function(t,e,i,n,r){return this.displayList.add(new s(this.scene,t,e,i,n,r))}))},88899:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(16873),r=i(93438),t.exports={renderWebGL:n,renderCanvas:r}},16873:(t,e,i)=>{var s=i(73329),n=i(69360),r=i(75512),o=new n;t.exports=function(t,e,i,n){var a=e.text,h=a.length;if(0!==h){i.addToRenderList(e);var l=t.pipelines.set(e.pipeline,e),u=s(e,i,n),c=u.sprite,d=u.calc,p=o,f=e.cropWidth>0||e.cropHeight>0;f&&(l.flush(),t.pushScissor(d.tx,d.ty,e.cropWidth*d.scaleX,e.cropHeight*d.scaleY));var v,g,m=e.frame.glTexture,y=e.tintFill,x=r.getTintAppendFloatAlpha(e.tintTopLeft,i.alpha*e._alphaTL),T=r.getTintAppendFloatAlpha(e.tintTopRight,i.alpha*e._alphaTR),w=r.getTintAppendFloatAlpha(e.tintBottomLeft,i.alpha*e._alphaBL),b=r.getTintAppendFloatAlpha(e.tintBottomRight,i.alpha*e._alphaBR),E=l.setGameObject(e),S=0,A=0,_=0,C=0,R=e.letterSpacing,M=0,P=0,O=e.scrollX,L=e.scrollY,F=e.fontData,D=F.chars,k=F.lineHeight,I=e.fontSize/F.size,B=0,N=e._align,Y=0,U=0,X=e.getTextBounds(!1);e.maxWidth>0&&(h=(a=X.wrappedText).length);var z=e._bounds.lines;1===N?U=(z.longest-z.lengths[0])/2:2===N&&(U=z.longest-z.lengths[0]);var G=i.roundPixels,W=e.displayCallback,V=e.callbackData;t.pipelines.preBatch(e);for(var H=0;H{var s=i(56694),n=i(82897),r=i(64937),o=i(89980),a=i(82173),h=i(68298),l=i(31476),u=i(74118),c=i(84557),d=new s({Extends:o,Mixins:[r.Alpha,r.BlendMode,r.Depth,r.Mask,r.Origin,r.Pipeline,r.ScrollFactor,r.Texture,r.Tint,r.Transform,r.Visible,c],initialize:function(t,e,i,s,n,r,h){void 0===n&&(n=""),void 0===h&&(h=0),o.call(this,t,"BitmapText"),this.font=s;var l=this.scene.sys.cache.bitmapFont.get(s);l||console.warn("Invalid BitmapText key: "+s),this.fontData=l.data,this._text="",this._fontSize=r||this.fontData.size,this._letterSpacing=0,this._align=h,this._bounds=a(),this._dirty=!0,this._maxWidth=0,this.wordWrapCharCode=32,this.charColors=[],this.dropShadowX=0,this.dropShadowY=0,this.dropShadowColor=0,this.dropShadowAlpha=.5,this.fromAtlas=l.fromAtlas,this.setTexture(l.texture,l.frame),this.setPosition(e,i),this.setOrigin(0,0),this.initPipeline(),this.setText(n)},setLeftAlign:function(){return this._align=d.ALIGN_LEFT,this._dirty=!0,this},setCenterAlign:function(){return this._align=d.ALIGN_CENTER,this._dirty=!0,this},setRightAlign:function(){return this._align=d.ALIGN_RIGHT,this._dirty=!0,this},setFontSize:function(t){return this._fontSize=t,this._dirty=!0,this},setLetterSpacing:function(t){return void 0===t&&(t=0),this._letterSpacing=t,this._dirty=!0,this},setText:function(t){return t||0===t||(t=""),Array.isArray(t)&&(t=t.join("\n")),t!==this.text&&(this._text=t.toString(),this._dirty=!0,this.updateDisplayOrigin()),this},setDropShadow:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=.5),this.dropShadowX=t,this.dropShadowY=e,this.dropShadowColor=i,this.dropShadowAlpha=s,this},setCharacterTint:function(t,e,i,s,r,o,a){void 0===t&&(t=0),void 0===e&&(e=1),void 0===i&&(i=!1),void 0===s&&(s=-1),void 0===r&&(r=s,o=s,a=s);var h=this.text.length;-1===e&&(e=h),t<0&&(t=h+t),t=n(t,0,h-1);for(var l=n(t+e,t,h),u=this.charColors,c=t;c{var s=i(49584);t.exports=function(t,e,i,n){var r=e._text,o=r.length,a=t.currentContext;if(0!==o&&s(t,a,e,i,n)){i.addToRenderList(e);var h=e.fromAtlas?e.frame:e.texture.frames.__BASE,l=e.fontData.chars,u=e.fontData.lineHeight,c=e._letterSpacing,d=0,p=0,f=0,v=null,g=0,m=0,y=0,x=0,T=0,w=0,b=null,E=0,S=h.source.image,A=h.cutX,_=h.cutY,C=e._fontSize/e.fontData.size,R=e._align,M=0,P=0,O=e.getTextBounds(!1);e.maxWidth>0&&(o=(r=O.wrappedText).length);var L=e._bounds.lines;1===R?P=(L.longest-L.lengths[0])/2:2===R&&(P=L.longest-L.lengths[0]),a.translate(-e.displayOriginX,-e.displayOriginY);for(var F=i.roundPixels,D=0;D{var s=i(44616),n=i(88933),r=i(99325),o=i(20494),a=i(10850);r.register("bitmapText",(function(t,e){void 0===t&&(t={});var i=a(t,"font",""),r=o(t,"text",""),h=o(t,"size",!1),l=a(t,"align",0),u=new s(this.scene,0,0,i,r,h,l);return void 0!==e&&(t.add=e),n(this.scene,u,t),u}))},21797:(t,e,i)=>{var s=i(44616);i(61286).register("bitmapText",(function(t,e,i,n,r,o){return this.displayList.add(new s(this.scene,t,e,i,n,r,o))}))},84557:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(26372),r=i(97545),t.exports={renderWebGL:n,renderCanvas:r}},26372:(t,e,i)=>{var s=i(8810),n=i(73329),r=i(75512);t.exports=function(t,e,i,o){if(0!==e._text.length){i.addToRenderList(e);var a,h,l,u=t.pipelines.set(e.pipeline,e),c=n(e,i,o).calc,d=i.roundPixels,p=i.alpha,f=e.charColors,v=e.tintFill,g=r.getTintAppendFloatAlpha,m=g(e.tintTopLeft,p*e._alphaTL),y=g(e.tintTopRight,p*e._alphaTR),x=g(e.tintBottomLeft,p*e._alphaBL),T=g(e.tintBottomRight,p*e._alphaBR),w=e.frame.glTexture,b=u.setGameObject(e),E=e.getTextBounds(!1).characters,S=e.dropShadowX,A=e.dropShadowY,_=0!==S||0!==A;if(t.pipelines.preBatch(e),_){var C=e.dropShadowColor,R=e.dropShadowAlpha,M=g(C,p*R*e._alphaTL),P=g(C,p*R*e._alphaTR),O=g(C,p*R*e._alphaBL),L=g(C,p*R*e._alphaBR);for(a=0;a{var s=i(92246),n=i(41664),r=i(56694),o=i(64937),a=i(82047),h=i(89980),l=i(71207),u=new r({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.Depth,o.Mask,o.Pipeline,o.ScrollFactor,o.Size,o.Texture,o.Transform,o.Visible,s],initialize:function(t,e,i,s,n){h.call(this,t,"Blitter"),this.setTexture(s,n),this.setPosition(e,i),this.initPipeline(),this.children=new l,this.renderList=[],this.dirty=!1},create:function(t,e,i,s,r){void 0===s&&(s=!0),void 0===r&&(r=this.children.length),void 0===i?i=this.frame:i instanceof a||(i=this.texture.get(i));var o=new n(this,t,e,i,s);return this.children.addAt(o,r,!1),this.dirty=!0,o},createFromCallback:function(t,e,i,s){for(var n=this.createMultiple(e,i,s),r=0;r0},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(){this.children.removeAll(),this.dirty=!0},preDestroy:function(){this.children.destroy(),this.renderList=[]}});t.exports=u},33177:t=>{t.exports=function(t,e,i,s){var n=e.getRenderList();if(0!==n.length){var r=t.currentContext,o=i.alpha*e.alpha;if(0!==o){i.addToRenderList(e),r.globalCompositeOperation=t.blendModes[e.blendMode],r.imageSmoothingEnabled=!e.frame.source.scaleMode;var a=e.x-i.scrollX*e.scrollFactorX,h=e.y-i.scrollY*e.scrollFactorY;r.save(),s&&s.copyToContext(r);for(var l=i.roundPixels,u=0;u0&&f.height>0&&(r.save(),r.translate(c.x+a,c.y+h),r.scale(m,y),r.drawImage(p.source.image,f.x,f.y,f.width,f.height,v,g,f.width,f.height),r.restore())):(l&&(v=Math.round(v),g=Math.round(g)),f.width>0&&f.height>0&&r.drawImage(p.source.image,f.x,f.y,f.width,f.height,v+c.x+a,g+c.y+h,f.width,f.height)))}r.restore()}}}},68452:(t,e,i)=>{var s=i(52816),n=i(88933),r=i(99325),o=i(20494);r.register("blitter",(function(t,e){void 0===t&&(t={});var i=o(t,"key",null),r=o(t,"frame",null),a=new s(this.scene,0,0,i,r);return void 0!==e&&(t.add=e),n(this.scene,a,t),a}))},38906:(t,e,i)=>{var s=i(52816);i(61286).register("blitter",(function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))}))},92246:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(89165),r=i(33177),t.exports={renderWebGL:n,renderCanvas:r}},89165:(t,e,i)=>{var s=i(69360),n=i(75512),r=new s;t.exports=function(t,e,i,s){var o=e.getRenderList();if(0!==o.length){var a=i.alpha*e.alpha;if(0!==a){i.addToRenderList(e);var h=t.pipelines.set(this.pipeline,e),l=i.scrollX*e.scrollFactorX,u=i.scrollY*e.scrollFactorY,c=r.copyFrom(i.matrix);s&&(c.multiplyWithOffset(s,-l,-u),l=0,u=0);var d=e.x-l,p=e.y-u,f=-1,v=i.roundPixels;t.pipelines.preBatch(e);for(var g=0;g{var s=i(56694),n=i(82047),r=new s({initialize:function(t,e,i,s,n){this.parent=t,this.x=e,this.y=i,this.frame=s,this.data={},this.tint=16777215,this._visible=n,this._alpha=1,this.flipX=!1,this.flipY=!1},setFrame:function(t){return void 0===t?this.frame=this.parent.frame:t instanceof n&&t.texture===this.parent.texture?this.frame=t:this.frame=this.parent.texture.get(t),this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this},reset:function(t,e,i){return this.x=t,this.y=e,this.flipX=!1,this.flipY=!1,this._alpha=1,this._visible=!0,this.parent.dirty=!0,i&&this.setFrame(i),this},setPosition:function(t,e){return this.x=t,this.y=e,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},setVisible:function(t){return this.visible=t,this},setAlpha:function(t){return this.alpha=t,this},setTint:function(t){return this.tint=t,this},destroy:function(){this.parent.dirty=!0,this.parent.children.remove(this),this.parent=void 0,this.frame=void 0,this.data=void 0},visible:{get:function(){return this._visible},set:function(t){this.parent.dirty|=this._visible!==t,this._visible=t}},alpha:{get:function(){return this._alpha},set:function(t){this.parent.dirty|=this._alpha>0!=t>0,this._alpha=t}}});t.exports=r},97123:(t,e,i)=>{var s=i(82897),n={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,n){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=s(t,0,1),this._alphaTR=s(e,0,1),this._alphaBL=s(i,0,1),this._alphaBR=s(n,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=s(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=s(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=s(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=s(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=n},15720:(t,e,i)=>{var s=i(82897),n={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t){return void 0===t&&(t=1),this.alpha=t,this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}}};t.exports=n},69732:(t,e,i)=>{var s=i(95723),n={_blendMode:s.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=s[t]),(t|=0)>=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=n},28284:t=>{t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},85293:t=>{var e={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,s){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,s,this.flipX,this.flipY);else{var n=t;this.frame.setCropUVs(this._crop,n.x,n.y,n.width,n.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=e},14975:t=>{var e={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.displayList&&this.displayList.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=e},88677:t=>{var e={fxPadding:0,setFXPadding:function(t){return void 0===t&&(t=0),this.fxPadding=t,this},onFXCopy:function(){},onFX:function(){}};t.exports=e},92972:t=>{t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},80693:(t,e,i)=>{var s=i(74118),n=i(2386),r=i(93736),o={prepareBoundsOutput:function(t,e){(void 0===e&&(e=!1),0!==this.rotation&&n(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getCenter:function(t){return void 0===t&&(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,t},getTopLeft:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopRight:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getLeftCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getRightCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getBottomLeft:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomRight:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBounds:function(t){var e,i,n,r,o,a,h,l;if(void 0===t&&(t=new s),this.parentContainer){var u=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(t),u.transformPoint(t.x,t.y,t),e=t.x,i=t.y,this.getTopRight(t),u.transformPoint(t.x,t.y,t),n=t.x,r=t.y,this.getBottomLeft(t),u.transformPoint(t.x,t.y,t),o=t.x,a=t.y,this.getBottomRight(t),u.transformPoint(t.x,t.y,t),h=t.x,l=t.y}else this.getTopLeft(t),e=t.x,i=t.y,this.getTopRight(t),n=t.x,r=t.y,this.getBottomLeft(t),o=t.x,a=t.y,this.getBottomRight(t),h=t.x,l=t.y;return t.x=Math.min(e,n,o,h),t.y=Math.min(i,r,a,l),t.width=Math.max(e,n,o,h)-t.x,t.height=Math.max(i,r,a,l)-t.y,t}};t.exports=o},39171:(t,e,i)=>{var s=i(76756),n=i(63037),r={mask:null,setMask:function(t){return this.mask=t,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},createBitmapMask:function(t){return void 0===t&&(this.texture||this.shader)&&(t=this),new s(this.scene,t)},createGeometryMask:function(t){return void 0===t&&(this instanceof Phaser.GameObjects.Graphics||this instanceof Phaser.GameObjects.Shape)&&(t=this),new n(this.scene,t)}};t.exports=r},28072:t=>{var e={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(t){this._displayOriginX=t,this.originX=t/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(t){this._displayOriginY=t,this.originY=t/this.height}},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this.updateDisplayOrigin()},setOriginFromFrame:function(){return this.frame&&this.frame.customPivot?(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin()):this.setOrigin()},setDisplayOrigin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displayOriginX=t,this.displayOriginY=e,this},updateDisplayOrigin:function(){return this._displayOriginX=this.originX*this.width,this._displayOriginY=this.originY*this.height,this}};t.exports=e},54211:(t,e,i)=>{var s=i(75606),n=i(63130),r=i(10850),o=i(55303),a=i(93736),h={path:null,rotateToPath:!1,pathRotationOffset:0,pathOffset:null,pathVector:null,pathDelta:null,pathTween:null,pathConfig:null,_prevDirection:o.PLAYING_FORWARD,setPath:function(t,e){void 0===e&&(e=this.pathConfig);var i=this.pathTween;return i&&i.isPlaying()&&i.stop(),this.path=t,e&&this.startFollow(e),this},setRotateToPath:function(t,e){return void 0===e&&(e=0),this.rotateToPath=t,this.pathRotationOffset=e,this},isFollowing:function(){var t=this.pathTween;return t&&t.isPlaying()},startFollow:function(t,e){void 0===t&&(t={}),void 0===e&&(e=0);var i=this.pathTween;i&&i.isPlaying()&&i.stop(),"number"==typeof t&&(t={duration:t}),t.from=r(t,"from",0),t.to=r(t,"to",1);var h=n(t,"positionOnPath",!1);this.rotateToPath=n(t,"rotateToPath",!1),this.pathRotationOffset=r(t,"rotationOffset",0);var l=r(t,"startAt",e);if(l&&(t.onStart=function(t){var e=t.data[0];e.progress=l,e.elapsed=e.duration*l;var i=e.ease(e.progress);e.current=e.start+(e.end-e.start)*i,e.target[e.key]=e.current}),this.pathOffset||(this.pathOffset=new a(this.x,this.y)),this.pathVector||(this.pathVector=new a),this.pathDelta||(this.pathDelta=new a),this.pathDelta.reset(),this.pathTween=this.scene.sys.tweens.addCounter(t),this.path.getStartPoint(this.pathOffset),h&&(this.x=this.pathOffset.x,this.y=this.pathOffset.y),this.pathOffset.x=this.x-this.pathOffset.x,this.pathOffset.y=this.y-this.pathOffset.y,this._prevDirection=o.PLAYING_FORWARD,this.rotateToPath){var u=this.path.getPoint(.1);this.rotation=Math.atan2(u.y-this.y,u.x-this.x)+s(this.pathRotationOffset)}return this.pathConfig=t,this},pauseFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.pause(),this},resumeFollow:function(){var t=this.pathTween;return t&&t.isPaused()&&t.resume(),this},stopFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.stop(),this},pathUpdate:function(){var t=this.pathTween;if(t){var e=t.data[0],i=this.pathDelta,n=this.pathVector;if(i.copy(n).negate(),e.state===o.COMPLETE)return this.path.getPoint(e.end,n),i.add(n),n.add(this.pathOffset),void this.setPosition(n.x,n.y);if(e.state!==o.PLAYING_FORWARD&&e.state!==o.PLAYING_BACKWARD)return;this.path.getPoint(t.getValue(),n),i.add(n),n.add(this.pathOffset);var r=this.x,a=this.y;this.setPosition(n.x,n.y);var h=this.x-r,l=this.y-a;if(0===h&&0===l)return;if(e.state!==this._prevDirection)return void(this._prevDirection=e.state);this.rotateToPath&&(this.rotation=Math.atan2(l,h)+s(this.pathRotationOffset))}}};t.exports=h},58210:(t,e,i)=>{var s=i(28699),n=i(65641),r=i(72677),o={defaultPipeline:null,pipeline:null,hasPostPipeline:!1,postPipelines:null,pipelineData:null,initPipeline:function(t){void 0===t&&(t=n.MULTI_PIPELINE);var e=this.scene.sys.renderer;if(!e)return!1;var i=e.pipelines;if(this.postPipelines=[],this.pipelineData={},i){var s=i.get(t);if(s)return this.defaultPipeline=s,this.pipeline=s,!0}return!1},setPipeline:function(t,e,i){var n=this.scene.sys.renderer;if(!n)return this;var r=n.pipelines;if(r){var o=r.get(t);o&&(this.pipeline=o),e&&(this.pipelineData=i?s(e):e)}return this},setPostPipeline:function(t,e,i){var n=this.scene.sys.renderer;if(!n)return this;var r=n.pipelines;if(r){Array.isArray(t)||(t=[t]);for(var o=0;o0,this},setPipelineData:function(t,e){var i=this.pipelineData;return void 0===e?delete i[t]:i[t]=e,this},getPostPipeline:function(t){for(var e=this.postPipelines,i=[],s=0;s=0;i--){var s=e[i];("string"==typeof t&&s.name===t||"string"!=typeof t&&s instanceof t)&&(s.destroy(),r(e,i))}return this.hasPostPipeline=this.postPipelines.length>0,this},getPipelineName:function(){return this.pipeline.name}};t.exports=o},45900:t=>{var e={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=e},31654:t=>{var e={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return Math.abs(this.scaleX*this.frame.realWidth)},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return Math.abs(this.scaleY*this.frame.realHeight)},set:function(t){this.scaleY=t/this.frame.realHeight}},setSizeToFrame:function(t){void 0===t&&(t=this.frame),this.width=t.realWidth,this.height=t.realHeight;var e=this.input;return e&&!e.customHitArea&&(e.hitArea.width=this.width,e.hitArea.height=this.height),this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}};t.exports=e},82081:t=>{var e={texture:null,frame:null,isCropped:!1,setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};t.exports=e},21850:t=>{var e={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,s){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,s,this.flipX,this.flipY);else{var n=t;this.frame.setCropUVs(this._crop,n.x,n.y,n.width,n.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=e},58072:t=>{var e={tintTopLeft:16777215,tintTopRight:16777215,tintBottomLeft:16777215,tintBottomRight:16777215,tintFill:!1,clearTint:function(){return this.setTint(16777215),this},setTint:function(t,e,i,s){return void 0===t&&(t=16777215),void 0===e&&(e=t,i=t,s=t),this.tintTopLeft=t,this.tintTopRight=e,this.tintBottomLeft=i,this.tintBottomRight=s,this.tintFill=!1,this},setTintFill:function(t,e,i,s){return this.setTint(t,e,i,s),this.tintFill=!0,this},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){var t=16777215;return this.tintFill||this.tintTopLeft!==t||this.tintTopRight!==t||this.tintBottomLeft!==t||this.tintBottomRight!==t}}};t.exports=e},48129:t=>{t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},56584:(t,e,i)=>{var s=i(83392),n=i(69360),r=i(64462),o=i(35786),a=i(62138),h=i(93736),l={hasTransformComponent:!0,_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(t){this._scaleX=t,this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},angle:{get:function(){return a(this._rotation*s.RAD_TO_DEG)},set:function(t){this.rotation=a(t)*s.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=o(t)}},setPosition:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===s&&(s=0),this.x=t,this.y=e,this.z=i,this.w=s,this},copyPosition:function(t){return void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.z&&(this.z=t.z),void 0!==t.w&&(this.w=t.w),this},setRandomPosition:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===s&&(s=this.scene.sys.scale.height),this.x=t+Math.random()*i,this.y=e+Math.random()*s,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new n),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new n),void 0===e&&(e=new n);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);for(t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return t},getLocalPoint:function(t,e,i,s){i||(i=new h),s||(s=this.scene.sys.cameras.main);var n=s.scrollX,o=s.scrollY,a=t+n*this.scrollFactorX-n,l=e+o*this.scrollFactorY-o;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(a,l,i):r(a,l,this.x,this.y,this.rotation,this.scaleX,this.scaleY,i),this._originComponent&&(i.x+=this._displayOriginX,i.y+=this._displayOriginY),i},getParentRotation:function(){for(var t=0,e=this.parentContainer;e;)t+=e.rotation,e=e.parentContainer;return t}};t.exports=l},69360:(t,e,i)=>{var s=i(56694),n=i(83392),r=i(93736),o=new s({initialize:function(t,e,i,s,n,r){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=1),void 0===n&&(n=0),void 0===r&&(r=0),this.matrix=new Float32Array([t,e,i,s,n,r,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0}},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var t=this.matrix,e=t[0],i=t[1],s=t[2],r=t[3];return e||i?i>0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):s||r?n.TAU-(r>0?Math.acos(-s/this.scaleY):-Math.acos(s/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),s=this.matrix,n=s[0],r=s[1],o=s[2],a=s[3];return s[0]=n*i+o*e,s[1]=r*i+a*e,s[2]=n*-e+o*i,s[3]=r*-e+a*i,this},multiply:function(t,e){var i=this.matrix,s=t.matrix,n=i[0],r=i[1],o=i[2],a=i[3],h=i[4],l=i[5],u=s[0],c=s[1],d=s[2],p=s[3],f=s[4],v=s[5],g=void 0===e?this:e;return g.a=u*n+c*o,g.b=u*r+c*a,g.c=d*n+p*o,g.d=d*r+p*a,g.e=f*n+v*o+h,g.f=f*r+v*a+l,g},multiplyWithOffset:function(t,e,i){var s=this.matrix,n=t.matrix,r=s[0],o=s[1],a=s[2],h=s[3],l=e*r+i*a+s[4],u=e*o+i*h+s[5],c=n[0],d=n[1],p=n[2],f=n[3],v=n[4],g=n[5];return s[0]=c*r+d*a,s[1]=c*o+d*h,s[2]=p*r+f*a,s[3]=p*o+f*h,s[4]=v*r+g*a+l,s[5]=v*o+g*h+u,this},transform:function(t,e,i,s,n,r){var o=this.matrix,a=o[0],h=o[1],l=o[2],u=o[3],c=o[4],d=o[5];return o[0]=t*a+e*l,o[1]=t*h+e*u,o[2]=i*a+s*l,o[3]=i*h+s*u,o[4]=n*a+r*l+c,o[5]=n*h+r*u+d,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var s=this.matrix,n=s[0],r=s[1],o=s[2],a=s[3],h=s[4],l=s[5];return i.x=t*n+e*o+h,i.y=t*r+e*a+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=e*n-i*s;return t[0]=n/a,t[1]=-i/a,t[2]=-s/a,t[3]=e/a,t[4]=(s*o-n*r)/a,t[5]=-(e*o-i*r)/a,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){var e=this.matrix;return t.setTransform(e[0],e[1],e[2],e[3],e[4],e[5]),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,s,n,r){var o=this.matrix;return o[0]=t,o[1]=e,o[2]=i,o[3]=s,o[4]=n,o[5]=r,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],s=e[1],n=e[2],r=e[3],o=i*r-s*n;if(t.translateX=e[4],t.translateY=e[5],i||s){var a=Math.sqrt(i*i+s*s);t.rotation=s>0?Math.acos(i/a):-Math.acos(i/a),t.scaleX=a,t.scaleY=o/a}else if(n||r){var h=Math.sqrt(n*n+r*r);t.rotation=.5*Math.PI-(r>0?Math.acos(-n/h):-Math.acos(n/h)),t.scaleX=o/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,i,s,n){var r=this.matrix,o=Math.sin(i),a=Math.cos(i);return r[4]=t,r[5]=e,r[0]=a*s,r[1]=o*s,r[2]=-o*n,r[3]=a*n,this},applyInverse:function(t,e,i){void 0===i&&(i=new r);var s=this.matrix,n=s[0],o=s[1],a=s[2],h=s[3],l=s[4],u=s[5],c=1/(n*h+a*-o);return i.x=h*c*t+-a*c*e+(u*a-l*h)*c,i.y=n*c*e+-o*c*t+(-u*n+l*o)*c,i},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getXRound:function(t,e,i){var s=this.getX(t,e);return i&&(s=Math.round(s)),s},getYRound:function(t,e,i){var s=this.getY(t,e);return i&&(s=Math.round(s)),s},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.decomposedMatrix=null}});t.exports=o},59694:t=>{var e={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=e},64937:(t,e,i)=>{t.exports={Alpha:i(97123),AlphaSingle:i(15720),BlendMode:i(69732),ComputedSize:i(28284),Crop:i(85293),Depth:i(14975),Flip:i(92972),FX:i(88677),GetBounds:i(80693),Mask:i(39171),Origin:i(28072),PathFollower:i(54211),Pipeline:i(58210),ScrollFactor:i(45900),Size:i(31654),Texture:i(82081),TextureCrop:i(21850),Tint:i(58072),ToJSON:i(48129),Transform:i(56584),TransformMatrix:i(69360),Visible:i(59694)}},70339:(t,e,i)=>{var s=i(59959),n=i(95723),r=i(56694),o=i(64937),a=i(56631),h=i(89980),l=i(74118),u=i(98524),c=i(58795),d=i(93736),p=new r({Extends:h,Mixins:[o.AlphaSingle,o.BlendMode,o.ComputedSize,o.Depth,o.Mask,o.Pipeline,o.Transform,o.Visible,u],initialize:function(t,e,i,s){h.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new o.TransformMatrix,this.tempTransformMatrix=new o.TransformMatrix,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.initPipeline(),this.setPosition(e,i),this.clearAlpha(),this.setBlendMode(n.SKIP_CHECK),s&&this.add(s)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new l),t.setTo(this.x,this.y,0,0),this.parentContainer){var e=this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x,this.y);t.setTo(e.x,e.y,0,0)}if(this.list.length>0){var i=this.list,s=new l,n=!1;t.setEmpty();for(var r=0;r-1},setAll:function(t,e,i,n){return s.SetAll(this.list,t,e,i,n),this},each:function(t,e){var i,s=[null],n=this.list.slice(),r=n.length;for(i=2;i0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[]}});t.exports=p},13916:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e);var n=e.list;if(0!==n.length){var r=e.localTransform;s?(r.loadIdentity(),r.multiply(s),r.translate(e.x,e.y),r.rotate(e.rotation),r.scale(e.scaleX,e.scaleY)):r.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var o=-1!==e.blendMode;o||t.setBlendMode(0);var a=e._alpha,h=e.scrollFactorX,l=e.scrollFactorY;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var u=0;u{var s=i(88933),n=i(70339),r=i(99325),o=i(20494);r.register("container",(function(t,e){void 0===t&&(t={});var i=o(t,"x",0),r=o(t,"y",0),a=o(t,"children",null),h=new n(this.scene,i,r,a);return void 0!==e&&(t.add=e),s(this.scene,h,t),h}))},23400:(t,e,i)=>{var s=i(70339);i(61286).register("container",(function(t,e,i){return this.displayList.add(new s(this.scene,t,e,i))}))},98524:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(36934),r=i(13916),t.exports={renderWebGL:n,renderCanvas:r}},36934:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e);var n=e.list,r=n.length;if(0!==r){var o=e.localTransform;s?(o.loadIdentity(),o.multiply(s),o.translate(e.x,e.y),o.rotate(e.rotation),o.scale(e.scaleX,e.scaleY)):o.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),t.pipelines.preBatch(e);var a=-1!==e.blendMode;a||t.setBlendMode(0);for(var h=e.alpha,l=e.scrollFactorX,u=e.scrollFactorY,c=0;c{t.exports=["normal","multiply","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]},38943:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(11603),o=i(89980),a=i(42911),h=i(55638),l=i(7599),u=i(51729),c=new s({Extends:o,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Origin,n.ScrollFactor,n.Transform,n.Visible,r],initialize:function(t,e,i,s,n,r){o.call(this,t,"DOMElement"),this.parent=t.sys.game.domContainer,this.cache=t.sys.cache.html,this.node,this.transformOnly=!1,this.skewX=0,this.skewY=0,this.rotate3d=new u,this.rotate3dAngle="deg",this.pointerEvents="auto",this.width=0,this.height=0,this.displayWidth=0,this.displayHeight=0,this.handler=this.dispatchNativeEvent.bind(this),this.setPosition(e,i),"string"==typeof s?"#"===s[0]?this.setElement(s.substr(1),n,r):this.createElement(s,n,r):s&&this.setElement(s,n,r),t.sys.events.on(l.SLEEP,this.handleSceneEvent,this),t.sys.events.on(l.WAKE,this.handleSceneEvent,this),t.sys.events.on(l.PRE_RENDER,this.preRender,this)},handleSceneEvent:function(t){var e=this.node,i=e.style;e&&(i.display=t.settings.visible?"block":"none")},setSkew:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.skewX=t,this.skewY=e,this},setPerspective:function(t){return this.parent.style.perspective=t+"px",this},perspective:{get:function(){return parseFloat(this.parent.style.perspective)},set:function(t){this.parent.style.perspective=t+"px"}},addListener:function(t){if(this.node){t=t.split(" ");for(var e=0;e{var s=i(2452),n=i(89980),r=i(69360),o=new r,a=new r,h=new r;t.exports=function(t,e,i,r){if(e.node){var l=e.node.style,u=e.scene.sys.settings;if(!l||!u.visible||n.RENDER_MASK!==e.renderFlags||0!==e.cameraFilter&&e.cameraFilter&i.id||e.parentContainer&&!e.parentContainer.willRender())l.display="none";else{var c=e.parentContainer,d=i.alpha*e.alpha;c&&(d*=c.alpha);var p=o,f=a,v=h,g=0,m=0,y="0%",x="0%";r?(g=e.width*e.scaleX*e.originX,m=e.height*e.scaleY*e.originY,f.applyITRS(e.x-g,e.y-m,e.rotation,e.scaleX,e.scaleY),p.copyFrom(i.matrix),p.multiplyWithOffset(r,-i.scrollX*e.scrollFactorX,-i.scrollY*e.scrollFactorY),f.e=e.x-g,f.f=e.y-m,p.multiply(f,v)):(g=e.width*e.originX,m=e.height*e.originY,f.applyITRS(e.x-g,e.y-m,e.rotation,e.scaleX,e.scaleY),p.copyFrom(i.matrix),y=100*e.originX+"%",x=100*e.originY+"%",f.e-=i.scrollX*e.scrollFactorX,f.f-=i.scrollY*e.scrollFactorY,p.multiply(f,v)),e.transformOnly||(l.display="block",l.opacity=d,l.zIndex=e._depth,l.pointerEvents=e.pointerEvents,l.mixBlendMode=s[e._blendMode]),l.transform=v.getCSSMatrix()+" skew("+e.skewX+"rad, "+e.skewY+"rad) rotate3d("+e.rotate3d.x+","+e.rotate3d.y+","+e.rotate3d.z+","+e.rotate3d.w+e.rotate3dAngle+")",l.transformOrigin=y+" "+x}}}},66788:(t,e,i)=>{var s=i(38943);i(61286).register("dom",(function(t,e,i,n,r){var o=new s(this.scene,t,e,i,n,r);return this.displayList.add(o),o}))},11603:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(66070),r=i(66070),t.exports={renderWebGL:n,renderCanvas:r}},65492:t=>{t.exports="addedtoscene"},98398:t=>{t.exports="destroy"},40239:t=>{t.exports="removedfromscene"},17286:t=>{t.exports="complete"},31496:t=>{t.exports="created"},89587:t=>{t.exports="error"},96342:t=>{t.exports="loop"},49614:t=>{t.exports="play"},24418:t=>{t.exports="seeked"},87318:t=>{t.exports="seeking"},61922:t=>{t.exports="stop"},13991:t=>{t.exports="timeout"},4052:t=>{t.exports="unlocked"},56631:(t,e,i)=>{t.exports={ADDED_TO_SCENE:i(65492),DESTROY:i(98398),REMOVED_FROM_SCENE:i(40239),VIDEO_COMPLETE:i(17286),VIDEO_CREATED:i(31496),VIDEO_ERROR:i(89587),VIDEO_LOOP:i(96342),VIDEO_PLAY:i(49614),VIDEO_SEEKED:i(24418),VIDEO_SEEKING:i(87318),VIDEO_STOP:i(61922),VIDEO_TIMEOUT:i(13991),VIDEO_UNLOCKED:i(4052)}},39419:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(89980),o=i(79394),a=new s({Extends:r,Mixins:[n.Alpha,n.BlendMode,n.Depth,n.Flip,n.Origin,n.ScrollFactor,n.Size,n.Texture,n.Tint,n.Transform,n.Visible,o],initialize:function(t){r.call(this,t,"Extern")},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(){},render:function(){}});t.exports=a},96699:()=>{},41155:(t,e,i)=>{var s=i(39419);i(61286).register("extern",(function(){var t=new s(this.scene);return this.displayList.add(t),t}))},79394:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(81410),r=i(96699),t.exports={renderWebGL:n,renderCanvas:r}},81410:(t,e,i)=>{var s=i(73329);t.exports=function(t,e,i,n){t.pipelines.clear();var r=s(e,i,n).calc;e.render.call(e,t,i,r),t.pipelines.rebind()}},36266:t=>{t.exports={ARC:0,BEGIN_PATH:1,CLOSE_PATH:2,FILL_RECT:3,LINE_TO:4,MOVE_TO:5,LINE_STYLE:6,FILL_STYLE:7,FILL_PATH:8,STROKE_PATH:9,FILL_TRIANGLE:10,STROKE_TRIANGLE:11,SAVE:14,RESTORE:15,TRANSLATE:16,SCALE:17,ROTATE:18,GRADIENT_FILL_STYLE:21,GRADIENT_LINE_STYLE:22}},33182:(t,e,i)=>{var s=i(51052),n=i(56694),r=i(36266),o=i(15720),a=i(69732),h=i(14975),l=i(39171),u=i(58210),c=i(45900),d=i(56584),p=i(59694),f=i(95669),v=i(89980),g=i(72632),m=i(10850),y=i(83392),x=i(60898),T=new n({Extends:v,Mixins:[o,a,h,l,u,d,p,c,x],initialize:function(t,e){var i=m(e,"x",0),s=m(e,"y",0);v.call(this,t,"Graphics"),this.setPosition(i,s),this.initPipeline(),this.displayOriginX=0,this.displayOriginY=0,this.commandBuffer=[],this.defaultFillColor=-1,this.defaultFillAlpha=1,this.defaultStrokeWidth=1,this.defaultStrokeColor=-1,this.defaultStrokeAlpha=1,this._lineWidth=1,this.setDefaultStyles(e)},setDefaultStyles:function(t){return m(t,"lineStyle",null)&&(this.defaultStrokeWidth=m(t,"lineStyle.width",1),this.defaultStrokeColor=m(t,"lineStyle.color",16777215),this.defaultStrokeAlpha=m(t,"lineStyle.alpha",1),this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha)),m(t,"fillStyle",null)&&(this.defaultFillColor=m(t,"fillStyle.color",16777215),this.defaultFillAlpha=m(t,"fillStyle.alpha",1),this.fillStyle(this.defaultFillColor,this.defaultFillAlpha)),this},lineStyle:function(t,e,i){return void 0===i&&(i=1),this.commandBuffer.push(r.LINE_STYLE,t,e,i),this._lineWidth=t,this},fillStyle:function(t,e){return void 0===e&&(e=1),this.commandBuffer.push(r.FILL_STYLE,t,e),this},fillGradientStyle:function(t,e,i,s,n,o,a,h){return void 0===n&&(n=1),void 0===o&&(o=n),void 0===a&&(a=n),void 0===h&&(h=n),this.commandBuffer.push(r.GRADIENT_FILL_STYLE,n,o,a,h,t,e,i,s),this},lineGradientStyle:function(t,e,i,s,n,o){return void 0===o&&(o=1),this.commandBuffer.push(r.GRADIENT_LINE_STYLE,t,o,e,i,s,n),this},beginPath:function(){return this.commandBuffer.push(r.BEGIN_PATH),this},closePath:function(){return this.commandBuffer.push(r.CLOSE_PATH),this},fillPath:function(){return this.commandBuffer.push(r.FILL_PATH),this},fill:function(){return this.commandBuffer.push(r.FILL_PATH),this},strokePath:function(){return this.commandBuffer.push(r.STROKE_PATH),this},stroke:function(){return this.commandBuffer.push(r.STROKE_PATH),this},fillCircleShape:function(t){return this.fillCircle(t.x,t.y,t.radius)},strokeCircleShape:function(t){return this.strokeCircle(t.x,t.y,t.radius)},fillCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,y.PI2),this.fillPath(),this},strokeCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,y.PI2),this.strokePath(),this},fillRectShape:function(t){return this.fillRect(t.x,t.y,t.width,t.height)},strokeRectShape:function(t){return this.strokeRect(t.x,t.y,t.width,t.height)},fillRect:function(t,e,i,s){return this.commandBuffer.push(r.FILL_RECT,t,e,i,s),this},strokeRect:function(t,e,i,s){var n=this._lineWidth/2,r=t-n,o=t+n;return this.beginPath(),this.moveTo(t,e),this.lineTo(t,e+s),this.strokePath(),this.beginPath(),this.moveTo(t+i,e),this.lineTo(t+i,e+s),this.strokePath(),this.beginPath(),this.moveTo(r,e),this.lineTo(o+i,e),this.strokePath(),this.beginPath(),this.moveTo(r,e+s),this.lineTo(o+i,e+s),this.strokePath(),this},fillRoundedRect:function(t,e,i,s,n){void 0===n&&(n=20);var r=n,o=n,a=n,h=n;return"number"!=typeof n&&(r=g(n,"tl",20),o=g(n,"tr",20),a=g(n,"bl",20),h=g(n,"br",20)),this.beginPath(),this.moveTo(t+r,e),this.lineTo(t+i-o,e),this.arc(t+i-o,e+o,o,-y.TAU,0),this.lineTo(t+i,e+s-h),this.arc(t+i-h,e+s-h,h,0,y.TAU),this.lineTo(t+a,e+s),this.arc(t+a,e+s-a,a,y.TAU,Math.PI),this.lineTo(t,e+r),this.arc(t+r,e+r,r,-Math.PI,-y.TAU),this.fillPath(),this},strokeRoundedRect:function(t,e,i,s,n){void 0===n&&(n=20);var r=n,o=n,a=n,h=n,l=Math.min(i,s)/2;return"number"!=typeof n&&(r=g(n,"tl",20),o=g(n,"tr",20),a=g(n,"bl",20),h=g(n,"br",20)),r=Math.min(r,l),o=Math.min(o,l),a=Math.min(a,l),h=Math.min(h,l),this.beginPath(),this.moveTo(t+r,e),this.lineTo(t+i-o,e),this.moveTo(t+i-o,e),this.arc(t+i-o,e+o,o,-y.TAU,0),this.lineTo(t+i,e+s-h),this.moveTo(t+i,e+s-h),this.arc(t+i-h,e+s-h,h,0,y.TAU),this.lineTo(t+a,e+s),this.moveTo(t+a,e+s),this.arc(t+a,e+s-a,a,y.TAU,Math.PI),this.lineTo(t,e+r),this.moveTo(t,e+r),this.arc(t+r,e+r,r,-Math.PI,-y.TAU),this.strokePath(),this},fillPointShape:function(t,e){return this.fillPoint(t.x,t.y,e)},fillPoint:function(t,e,i){return!i||i<1?i=1:(t-=i/2,e-=i/2),this.commandBuffer.push(r.FILL_RECT,t,e,i,i),this},fillTriangleShape:function(t){return this.fillTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},strokeTriangleShape:function(t){return this.strokeTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},fillTriangle:function(t,e,i,s,n,o){return this.commandBuffer.push(r.FILL_TRIANGLE,t,e,i,s,n,o),this},strokeTriangle:function(t,e,i,s,n,o){return this.commandBuffer.push(r.STROKE_TRIANGLE,t,e,i,s,n,o),this},strokeLineShape:function(t){return this.lineBetween(t.x1,t.y1,t.x2,t.y2)},lineBetween:function(t,e,i,s){return this.beginPath(),this.moveTo(t,e),this.lineTo(i,s),this.strokePath(),this},lineTo:function(t,e){return this.commandBuffer.push(r.LINE_TO,t,e),this},moveTo:function(t,e){return this.commandBuffer.push(r.MOVE_TO,t,e),this},strokePoints:function(t,e,i,s){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===s&&(s=t.length),this.beginPath(),this.moveTo(t[0].x,t[0].y);for(var n=1;n-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(t,e,i){var s,n,r=this.scene.sys,o=r.game.renderer;if(void 0===e&&(e=r.scale.width),void 0===i&&(i=r.scale.height),T.TargetCamera.setScene(this.scene),T.TargetCamera.setViewport(0,0,e,i),T.TargetCamera.scrollX=this.x,T.TargetCamera.scrollY=this.y,"string"==typeof t)if(r.textures.exists(t)){var a=(s=r.textures.get(t)).getSourceImage();a instanceof HTMLCanvasElement&&(n=a.getContext("2d"))}else n=(s=r.textures.createCanvas(t,e,i)).getSourceImage().getContext("2d");else t instanceof HTMLCanvasElement&&(n=t.getContext("2d"));return n&&(this.renderCanvas(o,this,T.TargetCamera,null,n,!1),s&&s.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});T.TargetCamera=new s,t.exports=T},91543:(t,e,i)=>{var s=i(36266),n=i(49584);t.exports=function(t,e,i,r,o,a){var h=e.commandBuffer,l=h.length,u=o||t.currentContext;if(0!==l&&n(t,u,e,i,r)){i.addToRenderList(e);var c=1,d=1,p=0,f=0,v=1,g=0,m=0,y=0;u.beginPath();for(var x=0;x>>16,m=(65280&p)>>>8,y=255&p,u.strokeStyle="rgba("+g+","+m+","+y+","+c+")",u.lineWidth=v,x+=3;break;case s.FILL_STYLE:f=h[x+1],d=h[x+2],g=(16711680&f)>>>16,m=(65280&f)>>>8,y=255&f,u.fillStyle="rgba("+g+","+m+","+y+","+d+")",x+=2;break;case s.BEGIN_PATH:u.beginPath();break;case s.CLOSE_PATH:u.closePath();break;case s.FILL_PATH:a||u.fill();break;case s.STROKE_PATH:a||u.stroke();break;case s.FILL_RECT:a?u.rect(h[x+1],h[x+2],h[x+3],h[x+4]):u.fillRect(h[x+1],h[x+2],h[x+3],h[x+4]),x+=4;break;case s.FILL_TRIANGLE:u.beginPath(),u.moveTo(h[x+1],h[x+2]),u.lineTo(h[x+3],h[x+4]),u.lineTo(h[x+5],h[x+6]),u.closePath(),a||u.fill(),x+=6;break;case s.STROKE_TRIANGLE:u.beginPath(),u.moveTo(h[x+1],h[x+2]),u.lineTo(h[x+3],h[x+4]),u.lineTo(h[x+5],h[x+6]),u.closePath(),a||u.stroke(),x+=6;break;case s.LINE_TO:u.lineTo(h[x+1],h[x+2]),x+=2;break;case s.MOVE_TO:u.moveTo(h[x+1],h[x+2]),x+=2;break;case s.LINE_FX_TO:u.lineTo(h[x+1],h[x+2]),x+=5;break;case s.MOVE_FX_TO:u.moveTo(h[x+1],h[x+2]),x+=5;break;case s.SAVE:u.save();break;case s.RESTORE:u.restore();break;case s.TRANSLATE:u.translate(h[x+1],h[x+2]),x+=2;break;case s.SCALE:u.scale(h[x+1],h[x+2]),x+=2;break;case s.ROTATE:u.rotate(h[x+1]),x+=1;break;case s.GRADIENT_FILL_STYLE:x+=5;break;case s.GRADIENT_LINE_STYLE:x+=6}}u.restore()}}},41286:(t,e,i)=>{var s=i(99325),n=i(33182);s.register("graphics",(function(t,e){void 0===t&&(t={}),void 0!==e&&(t.add=e);var i=new n(this.scene,t);return t.add&&this.scene.sys.displayList.add(i),i}))},13122:(t,e,i)=>{var s=i(33182);i(61286).register("graphics",(function(t){return this.displayList.add(new s(this.scene,t))}))},60898:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(34429),r=i(91543),r=i(91543),t.exports={renderWebGL:n,renderCanvas:r}},34429:(t,e,i)=>{var s=i(36266),n=i(73329),r=i(69360),o=i(75512),a=function(t,e,i){this.x=t,this.y=e,this.width=i},h=function(t,e,i){this.points=[],this.pointsLength=1,this.points[0]=new a(t,e,i)},l=[],u=new r;t.exports=function(t,e,i,r){if(0!==e.commandBuffer.length){i.addToRenderList(e);var c=t.pipelines.set(e.pipeline,e);t.pipelines.preBatch(e);for(var d=n(e,i,r).calc,p=u.loadIdentity(),f=e.commandBuffer,v=i.alpha*e.alpha,g=1,m=c.fillTint,y=c.strokeTint,x=0,T=0,w=0,b=2*Math.PI,E=[],S=0,A=!0,_=null,C=o.getTintAppendFloatAlpha,R=0;R0&&(X=X%b-b):X>b?X=b:X<0&&(X=b+X%b),null===_&&(_=new h(B+Math.cos(U)*Y,N+Math.sin(U)*Y,g),E.push(_),I+=.01);I<1+G;)w=X*I+U,x=B+Math.cos(w)*Y,T=N+Math.sin(w)*Y,_.points.push(new a(x,T,g)),I+=.01;w=X+U,x=B+Math.cos(w)*Y,T=N+Math.sin(w)*Y,_.points.push(new a(x,T,g));break;case s.FILL_RECT:c.batchFillRect(f[++R],f[++R],f[++R],f[++R],p,d);break;case s.FILL_TRIANGLE:c.batchFillTriangle(f[++R],f[++R],f[++R],f[++R],f[++R],f[++R],p,d);break;case s.STROKE_TRIANGLE:c.batchStrokeTriangle(f[++R],f[++R],f[++R],f[++R],f[++R],f[++R],g,p,d);break;case s.LINE_TO:null!==_?_.points.push(new a(f[++R],f[++R],g)):(_=new h(f[++R],f[++R],g),E.push(_));break;case s.MOVE_TO:_=new h(f[++R],f[++R],g),E.push(_);break;case s.SAVE:l.push(p.copyToArray());break;case s.RESTORE:p.copyFromArray(l.pop());break;case s.TRANSLATE:B=f[++R],N=f[++R],p.translate(B,N);break;case s.SCALE:B=f[++R],N=f[++R],p.scale(B,N);break;case s.ROTATE:p.rotate(f[++R])}t.pipelines.postBatch(e)}}},59192:(t,e,i)=>{var s=i(83979),n=i(56694),r=i(56631),o=i(6659),a=i(71608),h=i(72632),l=i(10850),u=i(42911),c=i(75757),d=i(58403),p=i(13747),f=new n({Extends:o,initialize:function(t,e,i){o.call(this),i?e&&!Array.isArray(e)&&(e=[e]):Array.isArray(e)?u(e[0])&&(i=e,e=null):u(e)&&(i=e,e=null),this.scene=t,this.children=new d,this.isParent=!0,this.type="Group",this.classType=h(i,"classType",p),this.name=h(i,"name",""),this.active=h(i,"active",!0),this.maxSize=h(i,"maxSize",-1),this.defaultKey=h(i,"defaultKey",null),this.defaultFrame=h(i,"defaultFrame",null),this.runChildUpdate=h(i,"runChildUpdate",!1),this.createCallback=h(i,"createCallback",null),this.removeCallback=h(i,"removeCallback",null),this.createMultipleCallback=h(i,"createMultipleCallback",null),this.internalCreateCallback=h(i,"internalCreateCallback",null),this.internalRemoveCallback=h(i,"internalRemoveCallback",null),e&&this.addMultiple(e),i&&this.createMultiple(i),this.on(r.ADDED_TO_SCENE,this.addedToScene,this),this.on(r.REMOVED_FROM_SCENE,this.removedFromScene,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},create:function(t,e,i,s,n,r){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.defaultKey),void 0===s&&(s=this.defaultFrame),void 0===n&&(n=!0),void 0===r&&(r=!0),this.isFull())return null;var o=new this.classType(this.scene,t,e,i,s);return o.addToDisplayList(this.scene.sys.displayList),o.addToUpdateList(),o.visible=n,o.setActive(r),this.add(o),o},createMultiple:function(t){if(this.isFull())return[];Array.isArray(t)||(t=[t]);var e=[];if(t[0].key)for(var i=0;i=0;u--)if((l=d[u]).active===i){if(++c===e)break}else l=null;return l?("number"==typeof n&&(l.x=n),"number"==typeof r&&(l.y=r),l):s?this.create(n,r,o,a,h):null},get:function(t,e,i,s,n){return this.getFirst(!1,!0,t,e,i,s,n)},getFirstAlive:function(t,e,i,s,n,r){return this.getFirst(!0,t,e,i,s,n,r)},getFirstDead:function(t,e,i,s,n,r){return this.getFirst(!1,t,e,i,s,n,r)},playAnimation:function(t,e){return s.PlayAnimation(this.children.entries,t,e),this},isFull:function(){return-1!==this.maxSize&&this.children.size>=this.maxSize},countActive:function(t){void 0===t&&(t=!0);for(var e=0,i=0;i{var s=i(99325),n=i(59192);s.register("group",(function(t){return new n(this.scene,null,t)}))},62598:(t,e,i)=>{var s=i(59192);i(61286).register("group",(function(t,e){return this.updateList.add(new s(this.scene,t,e))}))},1539:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(89980),o=i(57322),a=new s({Extends:r,Mixins:[n.Alpha,n.BlendMode,n.Depth,n.Flip,n.FX,n.GetBounds,n.Mask,n.Origin,n.Pipeline,n.ScrollFactor,n.Size,n.TextureCrop,n.Tint,n.Transform,n.Visible,o],initialize:function(t,e,i,s,n){r.call(this,t,"Image"),this._crop=this.resetCropObject(),this.setTexture(s,n),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline()}});t.exports=a},57786:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),t.batchSprite(e,e.frame,i,s)}},83556:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(1539);n.register("image",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"frame",null),a=new o(this.scene,0,0,i,n);return void 0!==e&&(t.add=e),s(this.scene,a,t),a}))},20927:(t,e,i)=>{var s=i(1539);i(61286).register("image",(function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))}))},57322:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(59390),r=i(57786),t.exports={renderWebGL:n,renderCanvas:r}},59390:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),this.pipeline.batchSprite(e,i,s)}},48013:(t,e,i)=>{var s={Events:i(56631),DisplayList:i(91713),GameObjectCreator:i(99325),GameObjectFactory:i(61286),UpdateList:i(92034),Components:i(64937),GetCalcMatrix:i(73329),BuildGameObject:i(88933),BuildGameObjectAnimation:i(32291),GameObject:i(89980),BitmapText:i(44616),Blitter:i(52816),Bob:i(41664),Container:i(70339),DOMElement:i(38943),DynamicBitmapText:i(13468),Extern:i(39419),Graphics:i(33182),Group:i(59192),Image:i(1539),Layer:i(85305),Particles:i(27684),PathFollower:i(29598),RenderTexture:i(15996),RetroFont:i(55873),Rope:i(79968),Sprite:i(13747),Text:i(76555),GetTextSize:i(32979),MeasureText:i(27030),TextStyle:i(74744),TileSprite:i(35856),Zone:i(71030),Video:i(8630),Shape:i(91461),Arc:i(28593),Curve:i(15220),Ellipse:i(28591),Grid:i(39169),IsoBox:i(4415),IsoTriangle:i(65159),Line:i(579),Polygon:i(91249),Rectangle:i(517),Star:i(77843),Triangle:i(21873),Factories:{Blitter:i(38906),Container:i(23400),DOMElement:i(66788),DynamicBitmapText:i(94145),Extern:i(41155),Graphics:i(13122),Group:i(62598),Image:i(20927),Layer:i(17676),Particles:i(30439),PathFollower:i(19626),RenderTexture:i(29599),Rope:i(31982),Sprite:i(66135),StaticBitmapText:i(21797),Text:i(94627),TileSprite:i(20509),Zone:i(34546),Video:i(215),Arc:i(10369),Curve:i(10147),Ellipse:i(99869),Grid:i(9326),IsoBox:i(88154),IsoTriangle:i(67765),Line:i(85665),Polygon:i(88203),Rectangle:i(94355),Star:i(23962),Triangle:i(79296)},Creators:{Blitter:i(68452),Container:i(44516),DynamicBitmapText:i(67513),Graphics:i(41286),Group:i(61295),Image:i(83556),Layer:i(56378),Particles:i(38842),RenderTexture:i(85692),Rope:i(96027),Sprite:i(89219),StaticBitmapText:i(95499),Text:i(75397),TileSprite:i(63950),Zone:i(24067),Video:i(65601)}};s.Shader=i(27902),s.Mesh=i(83321),s.PointLight=i(13171),s.Factories.Shader=i(51979),s.Factories.Mesh=i(8767),s.Factories.PointLight=i(91201),s.Creators.Shader=i(13908),s.Creators.Mesh=i(41839),s.Creators.PointLight=i(162),s.Light=i(14455),s.LightsManager=i(26193),s.LightsPlugin=i(50296),t.exports=s},85305:(t,e,i)=>{var s=i(95723),n=i(56694),r=i(64937),o=i(48129),a=i(81078),h=i(6659),l=i(56631),u=i(71207),c=i(58010),d=i(7599),p=i(17922),f=new n({Extends:u,Mixins:[r.AlphaSingle,r.BlendMode,r.Depth,r.Mask,r.Pipeline,r.Visible,h,c],initialize:function(t,e){u.call(this,t),h.call(this),this.scene=t,this.displayList=null,this.type="Layer",this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.systems=t.sys,this.events=t.sys.events,this.sortChildrenFlag=!1,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.initPipeline(),this.clearAlpha(),this.setBlendMode(s.SKIP_CHECK),e&&this.add(e),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new a(this)),this},setData:function(t,e){return this.data||(this.data=new a(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new a(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new a(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new a(this)),this.data.get(t)},setInteractive:function(){return this},disableInteractive:function(){return this},removeInteractive:function(){return this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return o(this)},willRender:function(t){return!(15!==this.renderFlags||0===this.list.length||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return i.unshift(this.displayList.getIndex(t)),i},addChildCallback:function(t){t.displayList&&t.displayList!==this&&t.removeFromDisplayList(),t.displayList||(this.queueDepthSort(),t.displayList=this,t.emit(l.ADDED_TO_SCENE,t,this.scene),this.events.emit(d.ADDED_TO_SCENE,t,this.scene))},removeChildCallback:function(t){this.queueDepthSort(),t.displayList=null,t.emit(l.REMOVED_FROM_SCENE,t,this.scene),this.events.emit(d.REMOVED_FROM_SCENE,t,this.scene)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(p(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},getChildren:function(){return this.list},addToDisplayList:function(t){return void 0===t&&(t=this.scene.sys.displayList),this.displayList&&this.displayList!==t&&this.removeFromDisplayList(),t.exists(this)||(this.displayList=t,t.add(this,!0),t.queueDepthSort(),this.emit(l.ADDED_TO_SCENE,this,this.scene),t.events.emit(d.ADDED_TO_SCENE,this,this.scene)),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(l.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(d.REMOVED_FROM_SCENE,this,this.scene)),this},destroy:function(t){if(this.scene&&!this.ignoreDestroy){this.emit(l.DESTROY,this);for(var e=this.list;e.length;)e[0].destroy(t);this.removeAllListeners(),this.resetPostPipeline(!0),this.displayList&&(this.displayList.remove(this,!0),this.displayList.queueDepthSort()),this.data&&(this.data.destroy(),this.data=void 0),this.active=!1,this.visible=!1,this.list=void 0,this.scene=void 0,this.displayList=void 0,this.systems=void 0,this.events=void 0}}});t.exports=f},834:t=>{t.exports=function(t,e,i){var s=e.list;if(0!==s.length){e.depthSort();var n=-1!==e.blendMode;n||t.setBlendMode(0);var r=e._alpha;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var o=0;o{var s=i(88933),n=i(85305),r=i(99325),o=i(20494);r.register("layer",(function(t,e){void 0===t&&(t={});var i=o(t,"children",null),r=new n(this.scene,i);return void 0!==e&&(t.add=e),s(this.scene,r,t),r}))},17676:(t,e,i)=>{var s=i(85305);i(61286).register("layer",(function(t){return this.displayList.add(new s(this.scene,t))}))},58010:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(17576),r=i(834),t.exports={renderWebGL:n,renderCanvas:r}},17576:t=>{t.exports=function(t,e,i){var s=e.list,n=s.length;if(0!==n){e.depthSort(),t.pipelines.preBatch(e);var r=-1!==e.blendMode;r||t.setBlendMode(0);for(var o=e.alpha,a=0;a{var s=i(26673),n=i(56694),r=i(64937),o=i(39298),a=i(75512),h=new n({Extends:s,Mixins:[r.Origin,r.ScrollFactor,r.Transform,r.Visible],initialize:function(t,e,i,n,r,a,h){s.call(this,t,e,i),this.color=new o(n,r,a),this.intensity=h,this.renderFlags=15,this.cameraFilter=0,this.setScrollFactor(1,1),this.setOrigin(),this.setDisplayOrigin(i)},displayWidth:{get:function(){return this.diameter},set:function(t){this.diameter=t}},displayHeight:{get:function(){return this.diameter},set:function(t){this.diameter=t}},width:{get:function(){return this.diameter},set:function(t){this.diameter=t}},height:{get:function(){return this.diameter},set:function(t){this.diameter=t}},willRender:function(t){return!(h.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},setColor:function(t){var e=a.getFloatsFromUintRGB(t);return this.color.set(e[0],e[1],e[2]),this},setIntensity:function(t){return this.intensity=t,this},setRadius:function(t){return this.radius=t,this}});h.RENDER_MASK=15,t.exports=h},26193:(t,e,i)=>{var s=i(26535),n=i(56694),r=i(53996),o=i(14455),a=i(13171),h=i(39298),l=i(72677),u=i(17922),c=i(75512),d=new n({initialize:function(){this.lights=[],this.ambientColor=new h(.1,.1,.1),this.active=!1,this.maxLights=-1,this.visibleLights=0},addPointLight:function(t,e,i,s,n,r){return this.systems.displayList.add(new a(this.scene,t,e,i,s,n,r))},enable:function(){return-1===this.maxLights&&(this.maxLights=this.systems.renderer.config.maxLights),this.active=!0,this},disable:function(){return this.active=!1,this},getLights:function(t){for(var e=this.lights,i=t.worldView,n=[],o=0;othis.maxLights&&(u(n,this.sortByDistance),n=n.slice(0,this.maxLights)),this.visibleLights=n.length,n},sortByDistance:function(t,e){return t.distance>=e.distance},setAmbientColor:function(t){var e=c.getFloatsFromUintRGB(t);return this.ambientColor.set(e[0],e[1],e[2]),this},getMaxVisibleLights:function(){return this.maxLights},getLightCount:function(){return this.lights.length},addLight:function(t,e,i,s,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=128),void 0===s&&(s=16777215),void 0===n&&(n=1);var r=c.getFloatsFromUintRGB(s),a=new o(t,e,i,r[0],r[1],r[2],n);return this.lights.push(a),a},removeLight:function(t){var e=this.lights.indexOf(t);return e>=0&&l(this.lights,e),this},shutdown:function(){this.lights.length=0},destroy:function(){this.shutdown()}});t.exports=d},50296:(t,e,i)=>{var s=i(56694),n=i(26193),r=i(91963),o=i(7599),a=new s({Extends:n,initialize:function(t){this.scene=t,this.systems=t.sys,t.sys.settings.isBooted||t.sys.events.once(o.BOOT,this.boot,this),n.call(this)},boot:function(){var t=this.systems.events;t.on(o.SHUTDOWN,this.shutdown,this),t.on(o.DESTROY,this.destroy,this)},destroy:function(){this.shutdown(),this.scene=void 0,this.systems=void 0}});r.register("LightsPlugin",a,"lights"),t.exports=a},83321:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(75606),o=i(18693),a=i(89980),h=i(67623),l=i(53267),u=i(73329),c=i(16650),d=i(23464),p=i(17922),f=i(70015),v=i(85769),g=new s({Extends:a,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Mask,n.Pipeline,n.Size,n.Texture,n.Transform,n.Visible,n.ScrollFactor,d],initialize:function(t,e,i,s,n,r,o,h,l,u,d,p){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s="__WHITE"),a.call(this,t,"Mesh"),this.faces=[],this.vertices=[],this.tintFill=!1,this.debugCallback=null,this.debugGraphic=null,this.hideCCW=!0,this.modelPosition=new f,this.modelScale=new f(1,1,1),this.modelRotation=new f,this.dirtyCache=[0,0,0,0,0,0,0,0,0,0,0,0],this.transformMatrix=new c,this.viewPosition=new f,this.viewMatrix=new c,this.projectionMatrix=new c,this.totalRendered=0,this.totalFrame=0,this.ignoreDirtyCache=!1;var v=t.sys.renderer;this.setPosition(e,i),this.setTexture(s,n),this.setSize(v.width,v.height),this.initPipeline(),this.setPerspective(v.width,v.height),r&&this.addVertices(r,o,h,l,u,d,p)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},panX:function(t){return this.viewPosition.addScale(f.LEFT,t),this.dirtyCache[10]=1,this},panY:function(t){return this.viewPosition.y+=f.DOWN.y*t,this.dirtyCache[10]=1,this},panZ:function(t){return this.viewPosition.z+=t,this.dirtyCache[10]=1,this},setPerspective:function(t,e,i,s,n){return void 0===i&&(i=45),void 0===s&&(s=.01),void 0===n&&(n=1e3),this.projectionMatrix.perspective(r(i),t/e,s,n),this.dirtyCache[10]=1,this.dirtyCache[11]=0,this},setOrtho:function(t,e,i,s){return void 0===t&&(t=this.scene.sys.renderer.getAspectRatio()),void 0===e&&(e=1),void 0===i&&(i=-1e3),void 0===s&&(s=1e3),this.projectionMatrix.ortho(-t,t,-e,e,i,s),this.dirtyCache[10]=1,this.dirtyCache[11]=1,this},clear:function(){return this.faces.forEach((function(t){t.destroy()})),this.faces=[],this.vertices=[],this},addVerticesFromObj:function(t,e,i,s,n,r,o,a,h){var u,c=this.scene.sys.cache.obj.get(t);return c&&(u=l(c,this,e,i,s,n,r,o,a,h)),u&&0!==u.verts.length||console.warn("Mesh.addVerticesFromObj data empty:",t),this},sortByDepth:function(t,e){return t.depth-e.depth},depthSort:function(){return p(this.faces,this.sortByDepth),this},addVertex:function(t,e,i,s,n,r,o){var a=new v(t,e,i,s,n,r,o);return this.vertices.push(a),a},addFace:function(t,e,i){var s=new o(t,e,i);return this.faces.push(s),this.dirtyCache[9]=-1,s},addVertices:function(t,e,i,s,n,r,o){var a=h(t,e,i,s,n,r,o);return a?(this.faces=this.faces.concat(a.faces),this.vertices=this.vertices.concat(a.vertices)):console.warn("Mesh.addVertices data empty or invalid"),this.dirtyCache[9]=-1,this},getFaceCount:function(){return this.faces.length},getVertexCount:function(){return this.vertices.length},getFace:function(t){return this.faces[t]},getFaceAt:function(t,e,i){void 0===i&&(i=this.scene.sys.cameras.main);for(var s=u(this,i).calc,n=this.faces,r=[],o=0;o{t.exports=function(){}},41839:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(10850),a=i(83321);n.register("mesh",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"frame",null),h=o(t,"vertices",[]),l=o(t,"uvs",[]),u=o(t,"indicies",[]),c=o(t,"containsZ",!1),d=o(t,"normals",[]),p=o(t,"colors",16777215),f=o(t,"alphas",1),v=new a(this.scene,0,0,i,n,h,l,u,c,d,p,f);return void 0!==e&&(t.add=e),s(this.scene,v,t),v}))},8767:(t,e,i)=>{var s=i(83321);i(61286).register("mesh",(function(t,e,i,n,r,o,a,h,l,u,c){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a,h,l,u,c))}))},23464:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(57410),r=i(6317),t.exports={renderWebGL:n,renderCanvas:r}},57410:(t,e,i)=>{var s=i(73329);t.exports=function(t,e,i,n){var r=e.faces,o=r.length;if(0!==o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline,e),h=s(e,i,n).calc,l=a.setGameObject(e),u=a.vertexViewF32,c=a.vertexViewU32,d=a.vertexCount*a.currentShader.vertexComponentCount-1,p=e.tintFill,f=[],v=e.debugCallback,g=h.a,m=h.b,y=h.c,x=h.d,T=h.e,w=h.f,b=e.viewPosition.z,E=e.hideCCW,S=i.roundPixels,A=i.alpha*e.alpha,_=0;t.pipelines.preBatch(e);for(var C=0;C{var s=i(56694),n=i(61616),r=i(21902),o=i(72632),a=i(1071),h=new s({initialize:function(t,e,i,s){void 0===s&&(s=!1),this.propertyKey=e,this.propertyValue=i,this.defaultValue=i,this.steps=0,this.counter=0,this.start=0,this.end=0,this.ease,this.emitOnly=s,this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,this.loadConfig(t)},loadConfig:function(t,e){void 0===t&&(t={}),e&&(this.propertyKey=e),this.propertyValue=o(t,this.propertyKey,this.defaultValue),this.setMethods(),this.emitOnly&&(this.onUpdate=this.defaultUpdate)},toJSON:function(){return this.propertyValue},onChange:function(t){return this.propertyValue=t,this.setMethods()},setMethods:function(){var t=this.propertyValue,e=typeof t;if(this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,null!==t){if("number"===e)this.onEmit=this.staticValueEmit,this.onUpdate=this.staticValueUpdate;else if(Array.isArray(t))this.onEmit=this.randomStaticValueEmit;else if("function"===e)this.emitOnly?this.onEmit=t:this.onUpdate=t;else if("object"===e&&this.hasBoth(t,"start","end")){this.start=t.start,this.end=t.end;var i=this.has(t,"random");if(i&&(this.onEmit=this.randomRangedValueEmit),this.has(t,"steps"))this.steps=t.steps,this.counter=this.start,this.onEmit=this.steppedEmit;else{var s=this.has(t,"ease")?t.ease:"Linear";this.ease=r(s,t.easeParams),i||(this.onEmit=this.easedValueEmit),this.onUpdate=this.easeValueUpdate}}else if("object"===e&&this.hasBoth(t,"min","max"))this.start=t.min,this.end=t.max,this.onEmit=this.randomRangedValueEmit;else if("object"===e&&this.has(t,"random")){var n=t.random;Array.isArray(n)&&(this.start=n[0],this.end=n[1]),this.onEmit=this.randomRangedValueEmit}else"object"===e&&this.hasEither(t,"onEmit","onUpdate")&&(this.has(t,"onEmit")&&(this.onEmit=t.onEmit),this.has(t,"onUpdate")&&(this.onUpdate=t.onUpdate));return this}},has:function(t,e){return t.hasOwnProperty(e)},hasBoth:function(t,e,i){return t.hasOwnProperty(e)&&t.hasOwnProperty(i)},hasEither:function(t,e,i){return t.hasOwnProperty(e)||t.hasOwnProperty(i)},defaultEmit:function(t,e,i){return i},defaultUpdate:function(t,e,i,s){return s},staticValueEmit:function(){return this.propertyValue},staticValueUpdate:function(){return this.propertyValue},randomStaticValueEmit:function(){var t=Math.floor(Math.random()*this.propertyValue.length);return this.propertyValue[t]},randomRangedValueEmit:function(t,e){var i=n(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i),i},steppedEmit:function(){var t=this.counter,e=this.counter+(this.end-this.start)/this.steps;return this.counter=a(e,this.start,this.end),t},easedValueEmit:function(t,e){if(t&&t.data[e]){var i=t.data[e];i.min=this.start,i.max=this.end}return this.start},easeValueUpdate:function(t,e,i){var s=t.data[e];return(s.max-s.min)*this.ease(i)+s.min}});t.exports=h},87811:(t,e,i)=>{var s=i(56694),n=i(72632),r=new s({initialize:function(t,e,i,s,r){if("object"==typeof t){var o=t;t=n(o,"x",0),e=n(o,"y",0),i=n(o,"power",0),s=n(o,"epsilon",100),r=n(o,"gravity",50)}else void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=100),void 0===r&&(r=50);this.x=t,this.y=e,this.active=!0,this._gravity=r,this._power=0,this._epsilon=0,this.power=i,this.epsilon=s},update:function(t,e){var i=this.x-t.x,s=this.y-t.y,n=i*i+s*s;if(0!==n){var r=Math.sqrt(n);n{var s=i(56694),n=i(75606),r=new s({initialize:function(t){this.emitter=t,this.frame=null,this.x=0,this.y=0,this.velocityX=0,this.velocityY=0,this.accelerationX=0,this.accelerationY=0,this.maxVelocityX=1e4,this.maxVelocityY=1e4,this.bounce=0,this.scaleX=1,this.scaleY=1,this.alpha=1,this.angle=0,this.rotation=0,this.tint=16777215,this.life=1e3,this.lifeCurrent=1e3,this.delayCurrent=0,this.lifeT=0,this.data={tint:{min:16777215,max:16777215,current:16777215},alpha:{min:1,max:1},rotate:{min:0,max:0},scaleX:{min:1,max:1},scaleY:{min:1,max:1}}},isAlive:function(){return this.lifeCurrent>0},resetPosition:function(){this.x=0,this.y=0},fire:function(t,e){var i=this.emitter;if(this.frame=i.getFrame(),!this.frame)throw new Error("Particle has no texture frame");i.emitZone&&i.emitZone.getPoint(this),this.x+=void 0===t?i.x.onEmit(this,"x"):t,this.y+=void 0===e?i.y.onEmit(this,"y"):e,this.life=i.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0;var s=i.speedX.onEmit(this,"speedX"),r=i.speedY?i.speedY.onEmit(this,"speedY"):s;if(i.radial){var o=n(i.angle.onEmit(this,"angle"));this.velocityX=Math.cos(o)*Math.abs(s),this.velocityY=Math.sin(o)*Math.abs(r)}else if(i.moveTo){var a=i.moveToX.onEmit(this,"moveToX"),h=i.moveToY?i.moveToY.onEmit(this,"moveToY"):a,l=this.life/1e3;this.velocityX=(a-this.x)/l,this.velocityY=(h-this.y)/l}else this.velocityX=s,this.velocityY=r;i.acceleration&&(this.accelerationX=i.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=i.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=i.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=i.maxVelocityY.onEmit(this,"maxVelocityY"),this.delayCurrent=i.delay.onEmit(this,"delay"),this.scaleX=i.scaleX.onEmit(this,"scaleX"),this.scaleY=i.scaleY.onEmit(this,"scaleY"),this.angle=i.rotate.onEmit(this,"rotate"),this.rotation=n(this.angle),this.bounce=i.bounce.onEmit(this,"bounce"),this.alpha=i.alpha.onEmit(this,"alpha"),this.tint=i.tint.onEmit(this,"tint")},computeVelocity:function(t,e,i,s){var n=this.velocityX,r=this.velocityY,o=this.accelerationX,a=this.accelerationY,h=this.maxVelocityX,l=this.maxVelocityY;n+=t.gravityX*i,r+=t.gravityY*i,o&&(n+=o*i),a&&(r+=a*i),n>h?n=h:n<-h&&(n=-h),r>l?r=l:r<-l&&(r=-l),this.velocityX=n,this.velocityY=r;for(var u=0;ue.right&&t.collideRight&&(this.x=e.right,this.velocityX*=i),this.ye.bottom&&t.collideBottom&&(this.y=e.bottom,this.velocityY*=i)},update:function(t,e,i){if(this.delayCurrent>0)return this.delayCurrent-=t,!1;var s=this.emitter,r=1-this.lifeCurrent/this.life;return this.lifeT=r,this.computeVelocity(s,t,e,i),this.x+=this.velocityX*e,this.y+=this.velocityY*e,s.bounds&&this.checkBounds(s),s.deathZone&&s.deathZone.willKill(this)?(this.lifeCurrent=0,!0):(this.scaleX=s.scaleX.onUpdate(this,"scaleX",r,this.scaleX),this.scaleY=s.scaleY.onUpdate(this,"scaleY",r,this.scaleY),this.angle=s.rotate.onUpdate(this,"rotate",r,this.angle),this.rotation=n(this.angle),this.alpha=s.alpha.onUpdate(this,"alpha",r,this.alpha),this.tint=s.tint.onUpdate(this,"tint",r,this.tint),this.lifeCurrent-=t,this.lifeCurrent<=0)}});t.exports=r},9216:(t,e,i)=>{var s=i(95723),n=i(56694),r=i(64937),o=i(69361),a=i(54213),h=i(93025),l=i(72632),u=i(72861),c=i(53523),d=i(19256),p=i(14909),f=i(68433),v=i(74118),g=i(17922),m=i(93736),y=i(1071),x=new n({Mixins:[r.BlendMode,r.Mask,r.ScrollFactor,r.Visible],initialize:function(t,e){this.manager=t,this.texture=t.texture,this.frames=[t.defaultFrame],this.defaultFrame=t.defaultFrame,this.configFastMap=["active","blendMode","collideBottom","collideLeft","collideRight","collideTop","deathCallback","deathCallbackScope","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxParticles","maxAliveParticles","name","on","particleBringToTop","particleClass","radial","timeScale","trackVisible","visible"],this.configOpMap=["accelerationX","accelerationY","angle","alpha","bounce","delay","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],this.name="",this.particleClass=p,this.x=new h(e,"x",0,!0),this.y=new h(e,"y",0,!0),this.radial=!0,this.gravityX=0,this.gravityY=0,this.acceleration=!1,this.accelerationX=new h(e,"accelerationX",0,!0),this.accelerationY=new h(e,"accelerationY",0,!0),this.maxVelocityX=new h(e,"maxVelocityX",1e4,!0),this.maxVelocityY=new h(e,"maxVelocityY",1e4,!0),this.speedX=new h(e,"speedX",0,!0),this.speedY=new h(e,"speedY",0,!0),this.moveTo=!1,this.moveToX=new h(e,"moveToX",null,!0),this.moveToY=new h(e,"moveToY",null,!0),this.bounce=new h(e,"bounce",0,!0),this.scaleX=new h(e,"scaleX",1),this.scaleY=new h(e,"scaleY",1),this.tint=new h(e,"tint",16777215),this.alpha=new h(e,"alpha",1),this.lifespan=new h(e,"lifespan",1e3,!0),this.angle=new h(e,"angle",{min:0,max:360},!0),this.rotate=new h(e,"rotate",0),this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.maxParticles=0,this.maxAliveParticles=0,this.quantity=new h(e,"quantity",1,!0),this.delay=new h(e,"delay",0,!0),this.frequency=0,this.on=!0,this.particleBringToTop=!0,this.timeScale=1,this.emitZone=null,this.deathZone=null,this.bounds=null,this.collideLeft=!0,this.collideRight=!0,this.collideTop=!0,this.collideBottom=!0,this.active=!0,this.visible=!0,this.blendMode=s.NORMAL,this.follow=null,this.followOffset=new m,this.trackVisible=!1,this.currentFrame=0,this.randomFrame=!0,this.frameQuantity=1,this.dead=[],this.alive=[],this._counter=0,this._frameCounter=0,e&&this.fromJSON(e)},fromJSON:function(t){if(!t)return this;var e=0,i="";for(e=0;e0&&this.getParticleCount()>=this.maxParticles||this.maxAliveParticles>0&&this.getAliveParticleCount()>=this.maxAliveParticles},onParticleEmit:function(t,e){return void 0===t?(this.emitCallback=null,this.emitCallbackScope=null):"function"==typeof t&&(this.emitCallback=t,e&&(this.emitCallbackScope=e)),this},onParticleDeath:function(t,e){return void 0===t?(this.deathCallback=null,this.deathCallbackScope=null):"function"==typeof t&&(this.deathCallback=t,e&&(this.deathCallbackScope=e)),this},killAll:function(){for(var t=this.dead,e=this.alive;e.length>0;)t.push(e.pop());return this},forEachAlive:function(t,e){for(var i=this.alive,s=i.length,n=0;n0){var u=this.deathCallback,c=this.deathCallbackScope;for(o=h-1;o>=0;o--){var d=a[o];n.splice(d.index,1),r.push(d.particle),u&&u.call(c,d.particle),d.particle.resetPosition()}}if(this.on)if(0===this.frequency)this.emitParticle();else if(this.frequency>0)for(this._counter-=e;this._counter<=0;)this.emitParticle(),this._counter+=this.frequency},depthSortCallback:function(t,e){return t.y-e.y}});t.exports=x},84622:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(89980),o=i(87811),a=i(71207),h=i(9216),l=i(72745),u=new s({Extends:r,Mixins:[n.Depth,n.Mask,n.Pipeline,n.Transform,n.Visible,l],initialize:function(t,e,i,s){if(r.call(this,t,"ParticleEmitterManager"),this.blendMode=-1,this.timeScale=1,this.texture=null,this.frame=null,this.frameNames=[],null===i||"object"!=typeof i&&!Array.isArray(i)||(s=i,i=null),this.setTexture(e,i),this.initPipeline(),this.emitters=new a(this),this.wells=new a(this),s){Array.isArray(s)||(s=[s]);for(var n=0;n0?e.defaultFrame=i[0]:(console.warn("No texture frames were set"),e.defaultFrame=this.defaultFrame),this},addEmitter:function(t){return this.emitters.add(t)},createEmitter:function(t){return this.addEmitter(new h(this,t))},removeEmitter:function(t){return this.emitters.remove(t,!0)},addGravityWell:function(t){return this.wells.add(t)},createGravityWell:function(t){return this.addGravityWell(new o(t))},emitParticle:function(t,e,i){for(var s=this.emitters.list,n=0;n{var s=i(69360),n=new s,r=new s,o=new s,a=new s;t.exports=function(t,e,i,s){var h=e.emitters.list,l=h.length;if(0!==l){var u=n.copyFrom(i.matrix),c=r,d=o,p=a;s?(p.loadIdentity(),p.multiply(s),p.translate(e.x,e.y),p.rotate(e.rotation),p.scale(e.scaleX,e.scaleY)):p.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);for(var f=t.currentContext,v=i.roundPixels,g=0;g0&&_.height>0){var C=-A.halfWidth,R=-A.halfHeight;f.globalAlpha=S,f.save(),c.setToContext(f),v&&(C=Math.round(C),R=Math.round(R)),f.imageSmoothingEnabled=!A.source.scaleMode,f.drawImage(A.source.image,_.x,_.y,_.width,_.height,C,R,_.width,_.height),f.restore()}}}f.restore()}}}}},38842:(t,e,i)=>{var s=i(99325),n=i(20494),r=i(72632),o=i(84622);s.register("particles",(function(t,e){void 0===t&&(t={});var i=n(t,"key",null),s=n(t,"frame",null),a=r(t,"emitters",null),h=new o(this.scene,i,s,a);return void 0!==e&&(t.add=e),r(t,"add",!1)?this.displayList.add(h):this.updateList.add(h),h}))},30439:(t,e,i)=>{var s=i(61286),n=i(84622);s.register("particles",(function(t,e,i){return this.displayList.add(new n(this.scene,t,e,i))}))},72745:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(58971),r=i(66545),t.exports={renderWebGL:n,renderCanvas:r}},58971:(t,e,i)=>{var s=i(69360),n=i(75512),r=new s,o=new s,a=new s,h=new s;t.exports=function(t,e,i,s){var l=e.emitters.list,u=l.length;if(0!==u){var c=t.pipelines.set(e.pipeline),d=r,p=o,f=a,v=h;s?(v.loadIdentity(),v.multiply(s),v.translate(e.x,e.y),v.rotate(e.rotation),v.scale(e.scaleX,e.scaleY)):v.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var g=i.roundPixels,m=e.defaultFrame.glTexture,y=n.getTintAppendFloatAlpha,x=c.setGameObject(e,e.defaultFrame);t.pipelines.preBatch(e);for(var T=0;T{t.exports={EmitterOp:i(93025),GravityWell:i(87811),Particle:i(14909),ParticleEmitter:i(9216),ParticleEmitterManager:i(84622),Zones:i(25962)}},69361:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e){this.source=t,this.killOnEnter=e},willKill:function(t){var e=this.source.contains(t.x,t.y);return e&&this.killOnEnter||!e&&!this.killOnEnter}});t.exports=s},54213:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s,n){void 0===s&&(s=!1),void 0===n&&(n=!0),this.source=t,this.points=[],this.quantity=e,this.stepRate=i,this.yoyo=s,this.counter=-1,this.seamless=n,this._length=0,this._direction=0,this.updateSource()},updateSource:function(){if(this.points=this.source.getPoints(this.quantity,this.stepRate),this.seamless){var t=this.points[0],e=this.points[this.points.length-1];t.x===e.x&&t.y===e.y&&this.points.pop()}var i=this._length;return this._length=this.points.length,this._lengththis._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=s},68433:(t,e,i)=>{var s=i(56694),n=i(93736),r=new s({initialize:function(t){this.source=t,this._tempVec=new n},getPoint:function(t){var e=this._tempVec;this.source.getRandomPoint(e),t.x=e.x,t.y=e.y}});t.exports=r},25962:(t,e,i)=>{t.exports={DeathZone:i(69361),EdgeZone:i(54213),RandomZone:i(68433)}},29598:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(13747),o=new s({Extends:r,Mixins:[n.PathFollower],initialize:function(t,e,i,s,n,o){r.call(this,t,i,s,n,o),this.path=e},preUpdate:function(t,e){this.anims.update(t,e),this.pathUpdate(t)}});t.exports=o},19626:(t,e,i)=>{var s=i(61286),n=i(29598);s.register("follower",(function(t,e,i,s,r){var o=new n(this.scene,t,e,i,s,r);return this.displayList.add(o),this.updateList.add(o),o}))},13171:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(89980),o=i(74853),a=i(65641),h=i(71606),l=new s({Extends:r,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Mask,n.Pipeline,n.ScrollFactor,n.Transform,n.Visible,h],initialize:function(t,e,i,s,n,h,l){void 0===s&&(s=16777215),void 0===n&&(n=128),void 0===h&&(h=1),void 0===l&&(l=.1),r.call(this,t,"PointLight"),this.initPipeline(a.POINTLIGHT_PIPELINE),this.setPosition(e,i),this.color=o(s),this.intensity=h,this.attenuation=l,this.width=2*n,this.height=2*n,this._radius=n},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this.width=2*t,this.height=2*t}},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return this._radius}},displayOriginY:{get:function(){return this._radius}}});t.exports=l},162:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(13171);n.register("pointlight",(function(t,e){void 0===t&&(t={});var i=r(t,"color",16777215),n=r(t,"radius",128),a=r(t,"intensity",1),h=r(t,"attenuation",.1),l=new o(this.scene,0,0,i,n,a,h);return void 0!==e&&(t.add=e),s(this.scene,l,t),l}))},91201:(t,e,i)=>{var s=i(61286),n=i(13171);s.register("pointlight",(function(t,e,i,s,r,o){return this.displayList.add(new n(this.scene,t,e,i,s,r,o))}))},71606:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(80590),t.exports={renderWebGL:n,renderCanvas:r}},80590:(t,e,i)=>{var s=i(73329);t.exports=function(t,e,i,n){i.addToRenderList(e);var r=t.pipelines.set(e.pipeline),o=s(e,i,n).calc,a=e.width,h=e.height,l=-e._radius,u=-e._radius,c=l+a,d=u+h,p=o.getX(0,0),f=o.getY(0,0),v=o.getX(l,u),g=o.getY(l,u),m=o.getX(l,d),y=o.getY(l,d),x=o.getX(c,d),T=o.getY(c,d),w=o.getX(c,u),b=o.getY(c,u);t.pipelines.preBatch(e),r.batchPointLight(e,i,v,g,m,y,x,T,w,b,p,f),t.pipelines.postBatch(e)}},15996:(t,e,i)=>{var s=i(95723),n=i(51052),r=i(61068),o=i(56694),a=i(64937),h=i(86459),l=i(82047),u=i(89980),c=i(72283),d=i(65641),p=i(92675),f=i(37410),v=i(75512),g=i(76583),m=new o({Extends:u,Mixins:[a.Alpha,a.BlendMode,a.ComputedSize,a.Crop,a.Depth,a.Flip,a.FX,a.GetBounds,a.Mask,a.Origin,a.Pipeline,a.ScrollFactor,a.Tint,a.Transform,a.Visible,p],initialize:function(t,e,i,s,o,a,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=32),void 0===o&&(o=32),u.call(this,t,"RenderTexture"),this.renderer=t.sys.renderer,this.textureManager=t.sys.textures,this.globalTint=16777215,this.globalAlpha=1,this.canvas=null,this.dirty=!1,this._crop=this.resetCropObject(),this.texture=null,this.frame=null,this._saved=!1,this.isSpriteTexture=!1,void 0===a?(this.canvas=r.create2D(this,s,o),this.texture=t.sys.textures.addCanvas(g(),this.canvas),this.frame=this.texture.get()):(this.texture=t.sys.textures.get(a),this.frame=this.texture.get(l),this.canvas=this.frame.source.image,this._saved=!0,this.dirty=!0,this.width=this.frame.cutWidth,this.height=this.frame.cutHeight),this.context=this.canvas.getContext("2d"),this._eraseMode=!1,this.camera=new n(0,0,s,o),this.renderTarget=null;var p=this.renderer;p?p.type===h.WEBGL?(this.drawGameObject=this.batchGameObjectWebGL,this.renderTarget=new f(p,s,o,1,0,!1),this.setFlipY(this.isSpriteTexture)):p.type===h.CANVAS&&(this.drawGameObject=this.batchGameObjectCanvas):this.drawGameObject=c,this.camera.setScene(t),this.setPosition(e,i),void 0===a&&this.setSize(s,o),this.setOrigin(0,0),this.initPipeline(d.SINGLE_PIPELINE)},setSize:function(t,e){return this.resize(t,e)},setIsSpriteTexture:function(t){return this.isSpriteTexture=t,this.setFlipY(t),this},resize:function(t,e){void 0===e&&(e=t);var i=this.frame;if(t!==this.width||e!==this.height){if("__BASE"===i.name){this.canvas.width=t,this.canvas.height=e,this.texture.width=t,this.texture.height=e;var s=this.renderTarget;s&&(s.resize(t,e),i.glTexture=s.texture,i.source.isRenderTexture=!0,i.source.isGLTexture=!0,i.source.glTexture=s.texture,i.source.glTexture.flipY=!0),this.camera.setSize(t,e),i.source.width=t,i.source.height=e,i.setSize(t,e),this.width=t,this.height=e}}else{var n=this.texture.getSourceImage();i.cutX+t>n.width&&(t=n.width-i.cutX),i.cutY+e>n.height&&(e=n.height-i.cutY),i.setSize(t,e,i.cutX,i.cutY)}this.updateDisplayOrigin();var r=this.input;return r&&!r.customHitArea&&(r.hitArea.width=t,r.hitArea.height=e),this},setGlobalTint:function(t){return this.globalTint=t,this},setGlobalAlpha:function(t){return this.globalAlpha=t,this},saveTexture:function(t){return this.textureManager.renameTexture(this.texture.key,t),this._saved=!0,this.texture},fill:function(t,e,i,s,n,r){var o=this.frame,a=this.camera,h=this.renderer;void 0===e&&(e=1),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=o.cutWidth),void 0===r&&(r=o.cutHeight);var l=t>>16&255,u=t>>8&255,c=255&t,d=this.renderTarget;if(a.preRender(),d){d.bind(!0);var p=this.pipeline;p.manager.set(p);var f=d.width,g=d.height,m=h.width/f,y=h.height/g;p.drawFillRect(i*m,s*y,n*m,r*y,v.getTintFromFloats(c/255,u/255,l/255,1),e),d.unbind(!0)}else{var x=this.context;h.setContext(x),x.fillStyle="rgba("+l+","+u+","+c+","+e+")",x.fillRect(i+o.cutX,s+o.cutY,n,r),h.setContext()}return this.dirty=!0,this},clear:function(){if(this.dirty){var t=this.renderTarget;if(t)t.clear();else{var e=this.context;e.save(),e.setTransform(1,0,0,1,0,0),e.clearRect(this.frame.cutX,this.frame.cutY,this.frame.cutWidth,this.frame.cutHeight),e.restore()}this.dirty=!1}return this},erase:function(t,e,i){return this._eraseMode=!0,this.draw(t,e,i,1,16777215),this._eraseMode=!1,this},draw:function(t,e,i,s,n){return this.beginDraw(),this.batchDraw(t,e,i,s,n),this.endDraw(),this},drawFrame:function(t,e,i,s,n,r){return this.beginDraw(),this.batchDrawFrame(t,e,i,s,n,r),this.endDraw(),this},fillFrame:function(t,e,i,s,n,r){void 0===i&&(i=0),void 0===s&&(s=0);var o=this.textureManager.getFrame(t,e);if(o){this.beginDraw();for(var a=s;a>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(n>>16)+(65280&n)+((255&n)<<16),Array.isArray(t)||(t=[t]),this.batchList(t,e,i,s,n),this},batchDrawFrame:function(t,e,i,s,n,r){void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=this.globalAlpha),r=void 0===r?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(r>>16)+(65280&r)+((255&r)<<16);var o=this.textureManager.getFrame(t,e);return o&&(this.renderTarget?this.pipeline.batchTextureFrame(o,i,s,r,n,this.camera.matrix,null):this.batchTextureFrame(o,i+this.frame.cutX,s+this.frame.cutY,n,r)),this},endDraw:function(t){void 0===t&&(t=this._eraseMode);var e=this.renderer,i=this.renderTarget;if(i){var s=e.endCapture();e.pipelines.setUtility().blitFrame(s,i,1,!1,!1,t,this.isSpriteTexture),e.resetScissor(),e.resetViewport()}else e.setContext();return this.dirty=!0,this},batchList:function(t,e,i,s,n){for(var r=0;r0&&o.height>0&&r.drawImage(a,o.x,o.y,o.width,o.height,e,i,o.width,o.height),r.restore()}},snapshotArea:function(t,e,i,s,n,r,o){return this.renderTarget?this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer,this.width,this.height,n,!1,t,e,i,s,r,o):this.renderer.snapshotCanvas(this.canvas,n,!1,t,e,i,s,r,o),this},snapshot:function(t,e,i){return this.renderTarget?this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer,this.width,this.height,t,!1,0,0,this.width,this.height,e,i):this.renderer.snapshotCanvas(this.canvas,t,!1,0,0,this.width,this.height,e,i),this},snapshotPixel:function(t,e,i){return this.renderTarget?this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer,this.width,this.height,i,!0,t,e):this.renderer.snapshotCanvas(this.canvas,i,!0,t,e),this},preDestroy:function(){this._saved||(r.remove(this.canvas),this.renderTarget&&this.renderTarget.destroy(),this.texture.destroy(),this.camera.destroy(),this.canvas=null,this.context=null,this.texture=null)}});t.exports=m},43267:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),t.batchSprite(e,e.frame,i,s)}},85692:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(15996);n.register("renderTexture",(function(t,e){void 0===t&&(t={});var i=r(t,"x",0),n=r(t,"y",0),a=r(t,"width",32),h=r(t,"height",32),l=r(t,"key",void 0),u=r(t,"frame",void 0),c=new o(this.scene,i,n,a,h,l,u);return void 0!==e&&(t.add=e),s(this.scene,c,t),c}))},29599:(t,e,i)=>{var s=i(61286),n=i(15996);s.register("renderTexture",(function(t,e,i,s,r,o){return this.displayList.add(new n(this.scene,t,e,i,s,r,o))}))},92675:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(46823),r=i(43267),t.exports={renderWebGL:n,renderCanvas:r}},46823:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i,n){i.addToRenderList(e);var r=i.alpha,o=e.renderTarget,a=o.width,h=o.height,l=s.getTintAppendFloatAlpha,u=t.pipelines.set(e.pipeline),c=u.setTexture2D(o.texture);u.batchTexture(e,o.texture,a,h,e.x,e.y,a,h,e.scaleX,e.scaleY,e.rotation,e.flipX,!e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,a,h,l(e.tintTopLeft,r*e._alphaTL),l(e.tintTopRight,r*e._alphaTR),l(e.tintBottomLeft,r*e._alphaBL),l(e.tintBottomRight,r*e._alphaBR),e.tintFill,0,0,i,n,!0,c),t.resetTextures()}},79968:(t,e,i)=>{var s=i(16569),n=i(56694),r=i(64937),o=i(89980),a=i(65641),h=i(58912),l=i(93736),u=new n({Extends:o,Mixins:[r.AlphaSingle,r.BlendMode,r.Depth,r.Flip,r.Mask,r.Pipeline,r.Size,r.Texture,r.Transform,r.Visible,r.ScrollFactor,h],initialize:function(t,e,i,n,r,h,u,c,d){void 0===n&&(n="__DEFAULT"),void 0===h&&(h=2),void 0===u&&(u=!0),o.call(this,t,"Rope"),this.anims=new s(this),this.points=h,this.vertices,this.uv,this.colors,this.alphas,this.tintFill="__DEFAULT"===n,this.dirty=!1,this.horizontal=u,this._flipX=!1,this._flipY=!1,this._perp=new l,this.debugCallback=null,this.debugGraphic=null,this.setTexture(n,r),this.setPosition(e,i),this.setSizeToFrame(),this.initPipeline(a.ROPE_PIPELINE),Array.isArray(h)&&this.resizeArrays(h.length),this.setPoints(h,c,d),this.updateVertices()},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){var i=this.anims.currentFrame;this.anims.update(t,e),this.anims.currentFrame!==i&&(this.updateUVs(),this.updateVertices())},play:function(t,e,i){return this.anims.play(t,e,i),this},setDirty:function(){return this.dirty=!0,this},setHorizontal:function(t,e,i){return void 0===t&&(t=this.points.length),this.horizontal?this:(this.horizontal=!0,this.setPoints(t,e,i))},setVertical:function(t,e,i){return void 0===t&&(t=this.points.length),this.horizontal?(this.horizontal=!1,this.setPoints(t,e,i)):this},setTintFill:function(t){return void 0===t&&(t=!1),this.tintFill=t,this},setAlphas:function(t,e){var i=this.points.length;if(i<1)return this;var s,n=this.alphas;void 0===t?t=[1]:Array.isArray(t)||void 0!==e||(t=[t]);var r=0;if(void 0!==e)for(s=0;sr&&(o=t[r]),n[r]=o,t.length>r+1&&(o=t[r+1]),n[r+1]=o}return this},setColors:function(t){var e=this.points.length;if(e<1)return this;var i,s=this.colors;void 0===t?t=[16777215]:Array.isArray(t)||(t=[t]);var n=0;if(t.length===e)for(i=0;in&&(r=t[n]),s[n]=r,t.length>n+1&&(r=t[n+1]),s[n+1]=r}return this},setPoints:function(t,e,i){if(void 0===t&&(t=2),"number"==typeof t){var s,n,r,o=t;if(o<2&&(o=2),t=[],this.horizontal)for(r=-this.frame.halfWidth,n=this.frame.width/(o-1),s=0;s{t.exports=function(){}},96027:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(10850),a=i(79968);n.register("rope",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"frame",null),h=r(t,"horizontal",!0),l=o(t,"points",void 0),u=o(t,"colors",void 0),c=o(t,"alphas",void 0),d=new a(this.scene,0,0,i,n,l,h,u,c);return void 0!==e&&(t.add=e),s(this.scene,d,t),d}))},31982:(t,e,i)=>{var s=i(79968);i(61286).register("rope",(function(t,e,i,n,r,o,a,h){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a,h))}))},58912:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(49489),r=i(44598),t.exports={renderWebGL:n,renderCanvas:r}},49489:(t,e,i)=>{var s=i(73329),n=i(75512);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline,e),a=s(e,i,r).calc,h=e.vertices,l=e.uv,u=e.colors,c=e.alphas,d=e.alpha,p=n.getTintAppendFloatAlpha,f=i.roundPixels,v=h.length,g=Math.floor(.5*v);o.flush(),t.pipelines.preBatch(e);var m=o.setGameObject(e),y=o.vertexViewF32,x=o.vertexViewU32,T=o.vertexCount*o.currentShader.vertexComponentCount-1,w=0,b=e.tintFill;e.dirty&&e.updateVertices();for(var E=e.debugCallback,S=[],A=0;A{var s=i(56694),n=i(64937),r=i(89980),o=i(72632),a=i(98611),h=i(22440),l=i(24252),u=i(69360),c=new s({Extends:r,Mixins:[n.ComputedSize,n.Depth,n.GetBounds,n.Mask,n.Origin,n.ScrollFactor,n.Transform,n.Visible,l],initialize:function(t,e,i,s,n,o,a,h){void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=128),void 0===o&&(o=128),r.call(this,t,"Shader"),this.blendMode=-1,this.shader;var l=t.sys.renderer;this.renderer=l,this.gl=l.gl,this.vertexData=new ArrayBuffer(2*Float32Array.BYTES_PER_ELEMENT*6),this.vertexBuffer=l.createVertexBuffer(this.vertexData.byteLength,this.gl.STREAM_DRAW),this.program=null,this.bytes=new Uint8Array(this.vertexData),this.vertexViewF32=new Float32Array(this.vertexData),this._tempMatrix1=new u,this._tempMatrix2=new u,this._tempMatrix3=new u,this.viewMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.projectionMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.uniforms={},this.pointer=null,this._rendererWidth=l.width,this._rendererHeight=l.height,this._textureCount=0,this.framebuffer=null,this.glTexture=null,this.renderToTexture=!1,this.texture=null,this.setPosition(i,s),this.setSize(n,o),this.setOrigin(.5,.5),this.setShader(e,a,h)},willRender:function(t){return!!this.renderToTexture||!(r.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},setRenderToTexture:function(t,e){if(void 0===e&&(e=!1),!this.renderToTexture){var i=this.width,s=this.height,n=this.renderer;this.glTexture=n.createTextureFromSource(null,i,s,0),this.glTexture.flipY=e,this.framebuffer=n.createFramebuffer(i,s,this.glTexture,!1),this._rendererWidth=i,this._rendererHeight=s,this.renderToTexture=!0,this.projOrtho(0,this.width,this.height,0),t&&(this.texture=this.scene.sys.textures.addGLTexture(t,this.glTexture,i,s))}return this.shader&&(n.pipelines.clear(),this.load(),this.flush(),n.pipelines.rebind()),this},setShader:function(t,e,i){if(void 0===e&&(e=[]),"string"==typeof t){var s=this.scene.sys.cache.shader;if(!s.has(t))return console.warn("Shader missing: "+t),this;this.shader=s.get(t)}else this.shader=t;var n=this.gl,r=this.renderer;this.program&&n.deleteProgram(this.program);var o=r.createProgram(this.shader.vertexSrc,this.shader.fragmentSrc);n.uniformMatrix4fv(n.getUniformLocation(o,"uViewMatrix"),!1,this.viewMatrix),n.uniformMatrix4fv(n.getUniformLocation(o,"uProjectionMatrix"),!1,this.projectionMatrix),n.uniform2f(n.getUniformLocation(o,"uResolution"),this.width,this.height),this.program=o;var h=new Date,l={resolution:{type:"2f",value:{x:this.width,y:this.height}},time:{type:"1f",value:0},mouse:{type:"2f",value:{x:this.width/2,y:this.height/2}},date:{type:"4fv",value:[h.getFullYear(),h.getMonth(),h.getDate(),60*h.getHours()*60+60*h.getMinutes()+h.getSeconds()]},sampleRate:{type:"1f",value:44100},iChannel0:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel1:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel2:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel3:{type:"sampler2D",value:null,textureData:{repeat:!0}}};this.shader.uniforms?this.uniforms=a(!0,{},this.shader.uniforms,l):this.uniforms=l;for(var u=0;u<4;u++)e[u]&&this.setSampler2D("iChannel"+u,e[u],u,i);return this.initUniforms(),this.projOrtho(0,this._rendererWidth,this._rendererHeight,0),this},setPointer:function(t){return this.pointer=t,this},projOrtho:function(t,e,i,s){var n=1/(t-e),r=1/(i-s),o=this.projectionMatrix;o[0]=-2*n,o[5]=-2*r,o[10]=-.001,o[12]=(t+e)*n,o[13]=(s+i)*r,o[14]=-0;var a=this.program,h=this.gl;this.renderer.setProgram(a),h.uniformMatrix4fv(h.getUniformLocation(a,"uProjectionMatrix"),!1,this.projectionMatrix),this._rendererWidth=e,this._rendererHeight=i},initUniforms:function(){var t=this.gl,e=this.renderer.glFuncMap,i=this.program;for(var s in this._textureCount=0,this.uniforms){var n=this.uniforms[s],r=n.type,o=e[r];n.uniformLocation=t.getUniformLocation(i,s),"sampler2D"!==r&&(n.glMatrix=o.matrix,n.glValueLength=o.length,n.glFunc=o.func)}},setSampler2DBuffer:function(t,e,i,s,n,r){void 0===n&&(n=0),void 0===r&&(r={});var o=this.uniforms[t];return o.value=e,r.width=i,r.height=s,o.textureData=r,this._textureCount=n,this.initSampler2D(o),this},setSampler2D:function(t,e,i,s){void 0===i&&(i=0);var n=this.scene.sys.textures;if(n.exists(e)){var r=n.getFrame(e);if(r.glTexture&&r.glTexture.isRenderTexture)return this.setSampler2DBuffer(t,r.glTexture,r.width,r.height,i,s);var o=this.uniforms[t],a=r.source;o.textureKey=e,o.source=a.image,o.value=r.glTexture,a.isGLTexture&&(s||(s={}),s.width=a.width,s.height=a.height),s&&(o.textureData=s),this._textureCount=i,this.initSampler2D(o)}return this},setUniform:function(t,e){return h(this.uniforms,t,e),this},getUniform:function(t){return o(this.uniforms,t,null)},setChannel0:function(t,e){return this.setSampler2D("iChannel0",t,0,e)},setChannel1:function(t,e){return this.setSampler2D("iChannel1",t,1,e)},setChannel2:function(t,e){return this.setSampler2D("iChannel2",t,2,e)},setChannel3:function(t,e){return this.setSampler2D("iChannel3",t,3,e)},initSampler2D:function(t){if(t.value){var e=this.gl;e.activeTexture(e.TEXTURE0+this._textureCount),e.bindTexture(e.TEXTURE_2D,t.value);var i=t.textureData;if(i&&!t.value.isRenderTexture){var s=e[o(i,"magFilter","linear").toUpperCase()],n=e[o(i,"minFilter","linear").toUpperCase()],r=e[o(i,"wrapS","repeat").toUpperCase()],a=e[o(i,"wrapT","repeat").toUpperCase()],h=e[o(i,"format","rgba").toUpperCase()];if(i.repeat&&(r=e.REPEAT,a=e.REPEAT),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!!i.flipY),i.width){var l=o(i,"width",512),u=o(i,"height",2),c=o(i,"border",0);e.texImage2D(e.TEXTURE_2D,0,h,l,u,c,h,e.UNSIGNED_BYTE,null)}else e.texImage2D(e.TEXTURE_2D,0,h,e.RGBA,e.UNSIGNED_BYTE,t.source);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,s),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,n),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,a)}this.renderer.setProgram(this.program),e.uniform1i(t.uniformLocation,this._textureCount),this._textureCount++}},syncUniforms:function(){var t,e,i,s,n,r=this.gl,o=this.uniforms,a=0;for(var h in o)i=(t=o[h]).glFunc,e=t.glValueLength,s=t.uniformLocation,null!==(n=t.value)&&(1===e?t.glMatrix?i.call(r,s,t.transpose,n):i.call(r,s,n):2===e?i.call(r,s,n.x,n.y):3===e?i.call(r,s,n.x,n.y,n.z):4===e?i.call(r,s,n.x,n.y,n.z,n.w):"sampler2D"===t.type&&(r.activeTexture(r.TEXTURE0+a),r.bindTexture(r.TEXTURE_2D,n),r.uniform1i(s,a),a++))},load:function(t){var e=this.gl,i=this.width,s=this.height,n=this.renderer,r=this.program,o=this.viewMatrix;if(!this.renderToTexture){var a=-this._displayOriginX,h=-this._displayOriginY;o[0]=t[0],o[1]=t[1],o[4]=t[2],o[5]=t[3],o[8]=t[4],o[9]=t[5],o[12]=o[0]*a+o[4]*h,o[13]=o[1]*a+o[5]*h}e.useProgram(r),e.uniformMatrix4fv(e.getUniformLocation(r,"uViewMatrix"),!1,o),e.uniform2f(e.getUniformLocation(r,"uResolution"),this.width,this.height);var l=this.uniforms,u=l.resolution;u.value.x=i,u.value.y=s,l.time.value=n.game.loop.getDuration();var c=this.pointer;if(c){var d=l.mouse,p=c.x/i,f=1-c.y/s;d.value.x=p.toFixed(2),d.value.y=f.toFixed(2)}this.syncUniforms()},flush:function(){var t=this.width,e=this.height,i=this.program,s=this.gl,n=this.vertexBuffer,r=this.renderer,o=2*Float32Array.BYTES_PER_ELEMENT;this.renderToTexture&&(r.setFramebuffer(this.framebuffer),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT)),s.bindBuffer(s.ARRAY_BUFFER,n);var a=s.getAttribLocation(i,"inPosition");-1!==a&&(s.enableVertexAttribArray(a),s.vertexAttribPointer(a,2,s.FLOAT,!1,o,0));var h=this.vertexViewF32;h[3]=e,h[4]=t,h[5]=e,h[8]=t,h[9]=e,h[10]=t;s.bufferSubData(s.ARRAY_BUFFER,0,this.bytes.subarray(0,6*o)),s.drawArrays(s.TRIANGLES,0,6),this.renderToTexture&&r.setFramebuffer(null,!1)},setAlpha:function(){},setBlendMode:function(){},preDestroy:function(){var t=this.gl;t.deleteProgram(this.program),t.deleteBuffer(this.vertexBuffer),this.renderToTexture&&(this.renderer.deleteFramebuffer(this.framebuffer),this.texture.destroy(),this.framebuffer=null,this.glTexture=null,this.texture=null)}});t.exports=c},10612:t=>{t.exports=function(){}},13908:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(27902);n.register("shader",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"x",0),a=r(t,"y",0),h=r(t,"width",128),l=r(t,"height",128),u=new o(this.scene,i,n,a,h,l);return void 0!==e&&(t.add=e),s(this.scene,u,t),u}))},51979:(t,e,i)=>{var s=i(27902);i(61286).register("shader",(function(t,e,i,n,r,o,a){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a))}))},24252:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(19782),r=i(10612),t.exports={renderWebGL:n,renderCanvas:r}},19782:(t,e,i)=>{var s=i(73329);t.exports=function(t,e,i,n){if(e.shader){if(i.addToRenderList(e),t.pipelines.clear(),e.renderToTexture)e.load(),e.flush();else{var r=s(e,i,n).calc;t.width===e._rendererWidth&&t.height===e._rendererHeight||e.projOrtho(0,t.width,t.height,0),e.load(r.matrix),e.flush()}t.pipelines.rebind()}}},19543:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i,n,r,o){for(var a=s.getTintAppendFloatAlpha(i.fillColor,i.fillAlpha*n),h=i.pathData,l=i.pathIndexes,u=0;u{t.exports=function(t,e,i,s){var n=i||e.fillColor,r=s||e.fillAlpha,o=(16711680&n)>>>16,a=(65280&n)>>>8,h=255&n;t.fillStyle="rgba("+o+","+a+","+h+","+r+")"}},17876:t=>{t.exports=function(t,e,i,s){var n=i||e.strokeColor,r=s||e.strokeAlpha,o=(16711680&n)>>>16,a=(65280&n)>>>8,h=255&n;t.strokeStyle="rgba("+o+","+a+","+h+","+r+")",t.lineWidth=e.lineWidth}},91461:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(89980),o=i(88829),a=new s({Extends:r,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.GetBounds,n.Mask,n.Origin,n.Pipeline,n.ScrollFactor,n.Transform,n.Visible],initialize:function(t,e,i){void 0===e&&(e="Shape"),r.call(this,t,e),this.geom=i,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new o,this.width=0,this.height=0,this.initPipeline()},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.isFilled=!1:(this.fillColor=t,this.fillAlpha=e,this.isFilled=!0),this},setStrokeStyle:function(t,e,i){return void 0===i&&(i=1),void 0===t?this.isStroked=!1:(this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this.isStroked=!0),this},setClosePath:function(t){return this.closePath=t,this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}}});t.exports=a},50262:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i,n,r){var o=t.strokeTint,a=s.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*i);o.TL=a,o.TR=a,o.BL=a,o.BR=a;var h=e.pathData,l=h.length-1,u=e.lineWidth,c=u/2,d=h[0]-n,p=h[1]-r;e.closePath||(l-=2);for(var f=2;f{var s=i(2213),n=i(56694),r=i(75606),o=i(11117),a=i(26673),h=i(83392),l=i(91461),u=new n({Extends:l,Mixins:[s],initialize:function(t,e,i,s,n,r,o,h,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===n&&(n=0),void 0===r&&(r=360),void 0===o&&(o=!1),l.call(this,t,"Arc",new a(0,0,s)),this._startAngle=n,this._endAngle=r,this._anticlockwise=o,this._iterations=.01,this.setPosition(e,i);var c=2*this.geom.radius;this.setSize(c,c),void 0!==h&&this.setFillStyle(h,u),this.updateDisplayOrigin(),this.updateData()},iterations:{get:function(){return this._iterations},set:function(t){this._iterations=t,this.updateData()}},radius:{get:function(){return this.geom.radius},set:function(t){this.geom.radius=t;var e=2*t;this.setSize(e,e),this.updateDisplayOrigin(),this.updateData()}},startAngle:{get:function(){return this._startAngle},set:function(t){this._startAngle=t,this.updateData()}},endAngle:{get:function(){return this._endAngle},set:function(t){this._endAngle=t,this.updateData()}},anticlockwise:{get:function(){return this._anticlockwise},set:function(t){this._anticlockwise=t,this.updateData()}},setRadius:function(t){return this.radius=t,this},setIterations:function(t){return void 0===t&&(t=.01),this.iterations=t,this},setStartAngle:function(t,e){return this._startAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},setEndAngle:function(t,e){return this._endAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},updateData:function(){var t=this._iterations,e=t,i=this.geom.radius,s=r(this._startAngle),n=r(this._endAngle),a=i,l=i;n-=s,this._anticlockwise?n<-h.PI2?n=-h.PI2:n>0&&(n=-h.PI2+n%h.PI2):n>h.PI2?n=h.PI2:n<0&&(n=h.PI2+n%h.PI2);for(var u,c=[a+Math.cos(s)*i,l+Math.sin(s)*i];e<1;)u=n*e+s,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),e+=t;return u=n+s,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),c.push(a+Math.cos(s)*i,l+Math.sin(s)*i),this.pathIndexes=o(c),this.pathData=c,this}});t.exports=u},23560:(t,e,i)=>{var s=i(75606),n=i(15608),r=i(17876),o=i(49584);t.exports=function(t,e,i,a){i.addToRenderList(e);var h=t.currentContext;if(o(t,h,e,i,a)){var l=e.radius;h.beginPath(),h.arc(l-e.originX*(2*l),l-e.originY*(2*l),l,s(e._startAngle),s(e._endAngle),e.anticlockwise),e.closePath&&h.closePath(),e.isFilled&&(n(h,e),h.fill()),e.isStroked&&(r(h,e),h.stroke()),h.restore()}}},10369:(t,e,i)=>{var s=i(28593),n=i(61286);n.register("arc",(function(t,e,i,n,r,o,a,h){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a,h))})),n.register("circle",(function(t,e,i,n,r){return this.displayList.add(new s(this.scene,t,e,i,0,360,!1,n,r))}))},2213:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(58356),r=i(23560),t.exports={renderWebGL:n,renderCanvas:r}},58356:(t,e,i)=>{var s=i(73329),n=i(19543),r=i(50262);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=s(e,i,o),l=a.calcMatrix.copyFrom(h.calc),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&n(a,l,e,d,u,c),e.isStroked&&r(a,e,d,u,c),t.pipelines.postBatch(e)}},15220:(t,e,i)=>{var s=i(56694),n=i(87203),r=i(11117),o=i(74118),a=i(91461),h=new s({Extends:a,Mixins:[n],initialize:function(t,e,i,s,n,r){void 0===e&&(e=0),void 0===i&&(i=0),a.call(this,t,"Curve",s),this._smoothness=32,this._curveBounds=new o,this.closePath=!1,this.setPosition(e,i),void 0!==n&&this.setFillStyle(n,r),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){var t=this._curveBounds,e=this._smoothness;this.geom.getBounds(t,e),this.setSize(t.width,t.height),this.updateDisplayOrigin();for(var i=[],s=this.geom.getPoints(e),n=0;n{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=e._displayOriginX+e._curveBounds.x,l=e._displayOriginY+e._curveBounds.y,u=e.pathData,c=u.length-1,d=u[0]-h,p=u[1]-l;a.beginPath(),a.moveTo(d,p),e.closePath||(c-=2);for(var f=2;f{var s=i(61286),n=i(15220);s.register("curve",(function(t,e,i,s,r){return this.displayList.add(new n(this.scene,t,e,i,s,r))}))},87203:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(82958),r=i(4024),t.exports={renderWebGL:n,renderCanvas:r}},82958:(t,e,i)=>{var s=i(19543),n=i(73329),r=i(50262);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=n(e,i,o),l=a.calcMatrix.copyFrom(h.calc),u=e._displayOriginX+e._curveBounds.x,c=e._displayOriginY+e._curveBounds.y,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&s(a,l,e,d,u,c),e.isStroked&&r(a,e,d,u,c),t.pipelines.postBatch(e)}},28591:(t,e,i)=>{var s=i(56694),n=i(11117),r=i(84171),o=i(95669),a=i(91461),h=new s({Extends:a,Mixins:[r],initialize:function(t,e,i,s,n,r,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===n&&(n=128),a.call(this,t,"Ellipse",new o(s/2,n/2,s,n)),this._smoothness=64,this.setPosition(e,i),this.width=s,this.height=n,void 0!==r&&this.setFillStyle(r,h),this.updateDisplayOrigin(),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSize:function(t,e){return this.width=t,this.height=e,this.geom.setPosition(t/2,e/2),this.geom.setSize(t,e),this.updateData()},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){for(var t=[],e=this.geom.getPoints(this._smoothness),i=0;i{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY,u=e.pathData,c=u.length-1,d=u[0]-h,p=u[1]-l;a.beginPath(),a.moveTo(d,p),e.closePath||(c-=2);for(var f=2;f{var s=i(28591);i(61286).register("ellipse",(function(t,e,i,n,r,o){return this.displayList.add(new s(this.scene,t,e,i,n,r,o))}))},84171:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(17554),r=i(55881),t.exports={renderWebGL:n,renderCanvas:r}},17554:(t,e,i)=>{var s=i(19543),n=i(73329),r=i(50262);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=n(e,i,o),l=a.calcMatrix.copyFrom(h.calc),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&s(a,l,e,d,u,c),e.isStroked&&r(a,e,d,u,c),t.pipelines.postBatch(e)}},39169:(t,e,i)=>{var s=i(56694),n=i(91461),r=i(88059),o=new s({Extends:n,Mixins:[r],initialize:function(t,e,i,s,r,o,a,h,l,u,c){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===r&&(r=128),void 0===o&&(o=32),void 0===a&&(a=32),n.call(this,t,"Grid",null),this.cellWidth=o,this.cellHeight=a,this.showCells=!0,this.outlineFillColor=0,this.outlineFillAlpha=0,this.showOutline=!0,this.showAltCells=!1,this.altFillColor,this.altFillAlpha,this.setPosition(e,i),this.setSize(s,r),this.setFillStyle(h,l),void 0!==u&&this.setOutlineStyle(u,c),this.updateDisplayOrigin()},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showCells=!1:(this.fillColor=t,this.fillAlpha=e,this.showCells=!0),this},setAltFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showAltCells=!1:(this.altFillColor=t,this.altFillAlpha=e,this.showAltCells=!0),this},setOutlineStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showOutline=!1:(this.outlineFillColor=t,this.outlineFillAlpha=e,this.showOutline=!0),this}});t.exports=o},95525:(t,e,i)=>{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=-e._displayOriginX,l=-e._displayOriginY,u=i.alpha*e.alpha,c=e.width,d=e.height,p=e.cellWidth,f=e.cellHeight,v=Math.ceil(c/p),g=Math.ceil(d/f),m=p,y=f,x=p-(v*p-c),T=f-(g*f-d),w=e.showCells,b=e.showAltCells,E=e.showOutline,S=0,A=0,_=0,C=0,R=0;if(E&&(m--,y--,x===p&&x--,T===f&&T--),w&&e.fillAlpha>0)for(s(a,e),A=0;A0)for(s(a,e,e.altFillColor,e.altFillAlpha*u),A=0;A0){for(n(a,e,e.outlineFillColor,e.outlineFillAlpha*u),S=1;S{var s=i(61286),n=i(39169);s.register("grid",(function(t,e,i,s,r,o,a,h,l,u){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a,h,l,u))}))},88059:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(50639),r=i(95525),t.exports={renderWebGL:n,renderCanvas:r}},50639:(t,e,i)=>{var s=i(73329),n=i(75512);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),a=s(e,i,r);o.calcMatrix.copyFrom(a.calc).translate(-e._displayOriginX,-e._displayOriginY);var h,l,u=i.alpha*e.alpha,c=e.width,d=e.height,p=e.cellWidth,f=e.cellHeight,v=Math.ceil(c/p),g=Math.ceil(d/f),m=p,y=f,x=p-(v*p-c),T=f-(g*f-d),w=e.showCells,b=e.showAltCells,E=e.showOutline,S=0,A=0,_=0,C=0,R=0;if(E&&(m--,y--,x===p&&x--,T===f&&T--),t.pipelines.preBatch(e),w&&e.fillAlpha>0)for(h=o.fillTint,l=n.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*u),h.TL=l,h.TR=l,h.BL=l,h.BR=l,A=0;A0)for(h=o.fillTint,l=n.getTintAppendFloatAlpha(e.altFillColor,e.altFillAlpha*u),h.TL=l,h.TR=l,h.BL=l,h.BR=l,A=0;A0){var M=o.strokeTint,P=n.getTintAppendFloatAlpha(e.outlineFillColor,e.outlineFillAlpha*u);for(M.TL=P,M.TR=P,M.BL=P,M.BR=P,S=1;S{var s=i(72296),n=i(56694),r=i(91461),o=new n({Extends:r,Mixins:[s],initialize:function(t,e,i,s,n,o,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=48),void 0===n&&(n=32),void 0===o&&(o=15658734),void 0===a&&(a=10066329),void 0===h&&(h=13421772),r.call(this,t,"IsoBox",null),this.projection=4,this.fillTop=o,this.fillLeft=a,this.fillRight=h,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isFilled=!0,this.setPosition(e,i),this.setSize(s,n),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=o},32884:(t,e,i)=>{var s=i(15608),n=i(49584);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.currentContext;if(n(t,o,e,i,r)&&e.isFilled){var a=e.width,h=e.height,l=a/2,u=a/e.projection;e.showTop&&(s(o,e,e.fillTop),o.beginPath(),o.moveTo(-l,-h),o.lineTo(0,-u-h),o.lineTo(l,-h),o.lineTo(l,-1),o.lineTo(0,u-1),o.lineTo(-l,-1),o.lineTo(-l,-h),o.fill()),e.showLeft&&(s(o,e,e.fillLeft),o.beginPath(),o.moveTo(-l,0),o.lineTo(0,u),o.lineTo(0,u-h),o.lineTo(-l,-h),o.lineTo(-l,0),o.fill()),e.showRight&&(s(o,e,e.fillRight),o.beginPath(),o.moveTo(l,0),o.lineTo(0,u),o.lineTo(0,u-h),o.lineTo(l,-h),o.lineTo(l,0),o.fill()),o.restore()}}},88154:(t,e,i)=>{var s=i(61286),n=i(4415);s.register("isobox",(function(t,e,i,s,r,o,a){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a))}))},72296:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(33101),r=i(32884),t.exports={renderWebGL:n,renderCanvas:r}},33101:(t,e,i)=>{var s=i(73329),n=i(75512);t.exports=function(t,e,i,r){i.addToRenderList(e);var o,a,h,l,u,c,d,p,f,v=t.pipelines.set(e.pipeline),g=s(e,i,r),m=v.calcMatrix.copyFrom(g.calc),y=e.width,x=e.height,T=y/2,w=y/e.projection,b=i.alpha*e.alpha;e.isFilled&&(t.pipelines.preBatch(e),e.showTop&&(o=n.getTintAppendFloatAlpha(e.fillTop,b),a=m.getX(-T,-x),h=m.getY(-T,-x),l=m.getX(0,-w-x),u=m.getY(0,-w-x),c=m.getX(T,-x),d=m.getY(T,-x),p=m.getX(0,w-x),f=m.getY(0,w-x),v.batchQuad(e,a,h,l,u,c,d,p,f,0,0,1,1,o,o,o,o,2)),e.showLeft&&(o=n.getTintAppendFloatAlpha(e.fillLeft,b),a=m.getX(-T,0),h=m.getY(-T,0),l=m.getX(0,w),u=m.getY(0,w),c=m.getX(0,w-x),d=m.getY(0,w-x),p=m.getX(-T,-x),f=m.getY(-T,-x),v.batchQuad(e,a,h,l,u,c,d,p,f,0,0,1,1,o,o,o,o,2)),e.showRight&&(o=n.getTintAppendFloatAlpha(e.fillRight,b),a=m.getX(T,0),h=m.getY(T,0),l=m.getX(0,w),u=m.getY(0,w),c=m.getX(0,w-x),d=m.getY(0,w-x),p=m.getX(T,-x),f=m.getY(T,-x),v.batchQuad(e,a,h,l,u,c,d,p,f,0,0,1,1,o,o,o,o,2)),t.pipelines.postBatch(e))}},65159:(t,e,i)=>{var s=i(56694),n=i(93387),r=i(91461),o=new s({Extends:r,Mixins:[n],initialize:function(t,e,i,s,n,o,a,h,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=48),void 0===n&&(n=32),void 0===o&&(o=!1),void 0===a&&(a=15658734),void 0===h&&(h=10066329),void 0===l&&(l=13421772),r.call(this,t,"IsoTriangle",null),this.projection=4,this.fillTop=a,this.fillLeft=h,this.fillRight=l,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isReversed=o,this.isFilled=!0,this.setPosition(e,i),this.setSize(s,n),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setReversed:function(t){return this.isReversed=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=o},9923:(t,e,i)=>{var s=i(15608),n=i(49584);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.currentContext;if(n(t,o,e,i,r)&&e.isFilled){var a=e.width,h=e.height,l=a/2,u=a/e.projection,c=e.isReversed;e.showTop&&c&&(s(o,e,e.fillTop),o.beginPath(),o.moveTo(-l,-h),o.lineTo(0,-u-h),o.lineTo(l,-h),o.lineTo(0,u-h),o.fill()),e.showLeft&&(s(o,e,e.fillLeft),o.beginPath(),c?(o.moveTo(-l,-h),o.lineTo(0,u),o.lineTo(0,u-h)):(o.moveTo(-l,0),o.lineTo(0,u),o.lineTo(0,u-h)),o.fill()),e.showRight&&(s(o,e,e.fillRight),o.beginPath(),c?(o.moveTo(l,-h),o.lineTo(0,u),o.lineTo(0,u-h)):(o.moveTo(l,0),o.lineTo(0,u),o.lineTo(0,u-h)),o.fill()),o.restore()}}},67765:(t,e,i)=>{var s=i(61286),n=i(65159);s.register("isotriangle",(function(t,e,i,s,r,o,a,h){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a,h))}))},93387:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(54946),r=i(9923),t.exports={renderWebGL:n,renderCanvas:r}},54946:(t,e,i)=>{var s=i(73329),n=i(75512);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),a=s(e,i,r),h=o.calcMatrix.copyFrom(a.calc),l=e.width,u=e.height,c=l/2,d=l/e.projection,p=e.isReversed,f=i.alpha*e.alpha;if(e.isFilled){var v,g,m,y,x,T,w;if(t.pipelines.preBatch(e),e.showTop&&p){v=n.getTintAppendFloatAlpha(e.fillTop,f),g=h.getX(-c,-u),m=h.getY(-c,-u),y=h.getX(0,-d-u),x=h.getY(0,-d-u),T=h.getX(c,-u),w=h.getY(c,-u);var b=h.getX(0,d-u),E=h.getY(0,d-u);o.batchQuad(e,g,m,y,x,T,w,b,E,0,0,1,1,v,v,v,v,2)}e.showLeft&&(v=n.getTintAppendFloatAlpha(e.fillLeft,f),p?(g=h.getX(-c,-u),m=h.getY(-c,-u),y=h.getX(0,d),x=h.getY(0,d),T=h.getX(0,d-u),w=h.getY(0,d-u)):(g=h.getX(-c,0),m=h.getY(-c,0),y=h.getX(0,d),x=h.getY(0,d),T=h.getX(0,d-u),w=h.getY(0,d-u)),o.batchTri(e,g,m,y,x,T,w,0,0,1,1,v,v,v,2)),e.showRight&&(v=n.getTintAppendFloatAlpha(e.fillRight,f),p?(g=h.getX(c,-u),m=h.getY(c,-u),y=h.getX(0,d),x=h.getY(0,d),T=h.getX(0,d-u),w=h.getY(0,d-u)):(g=h.getX(c,0),m=h.getY(c,0),y=h.getX(0,d),x=h.getY(0,d),T=h.getX(0,d-u),w=h.getY(0,d-u)),o.batchTri(e,g,m,y,x,T,w,0,0,1,1,v,v,v,2)),t.pipelines.postBatch(e)}}},579:(t,e,i)=>{var s=i(56694),n=i(91461),r=i(88829),o=i(52660),a=new s({Extends:n,Mixins:[o],initialize:function(t,e,i,s,o,a,h,l,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===o&&(o=0),void 0===a&&(a=128),void 0===h&&(h=0),n.call(this,t,"Line",new r(s,o,a,h));var c=Math.max(1,this.geom.right-this.geom.left),d=Math.max(1,this.geom.bottom-this.geom.top);this.lineWidth=1,this._startWidth=1,this._endWidth=1,this.setPosition(e,i),this.setSize(c,d),void 0!==l&&this.setStrokeStyle(1,l,u),this.updateDisplayOrigin()},setLineWidth:function(t,e){return void 0===e&&(e=t),this._startWidth=t,this._endWidth=e,this.lineWidth=t,this},setTo:function(t,e,i,s){return this.geom.setTo(t,e,i,s),this}});t.exports=a},52044:(t,e,i)=>{var s=i(17876),n=i(49584);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.currentContext;if(n(t,o,e,i,r)){var a=e._displayOriginX,h=e._displayOriginY;e.isStroked&&(s(o,e),o.beginPath(),o.moveTo(e.geom.x1-a,e.geom.y1-h),o.lineTo(e.geom.x2-a,e.geom.y2-h),o.stroke()),o.restore()}}},85665:(t,e,i)=>{var s=i(61286),n=i(579);s.register("line",(function(t,e,i,s,r,o,a,h){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a,h))}))},52660:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(46952),r=i(52044),t.exports={renderWebGL:n,renderCanvas:r}},46952:(t,e,i)=>{var s=i(73329),n=i(75512);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),a=s(e,i,r);o.calcMatrix.copyFrom(a.calc);var h=e._displayOriginX,l=e._displayOriginY,u=i.alpha*e.alpha;if(t.pipelines.preBatch(e),e.isStroked){var c=o.strokeTint,d=n.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*u);c.TL=d,c.TR=d,c.BL=d,c.BR=d;var p=e._startWidth,f=e._endWidth;o.batchLine(e.geom.x1-h,e.geom.y1-l,e.geom.x2-h,e.geom.y2-l,p,f,1,0,!1,a.sprite,a.camera)}t.pipelines.postBatch(e)}},91249:(t,e,i)=>{var s=i(70573),n=i(56694),r=i(11117),o=i(14045),a=i(8580),h=i(91461),l=i(18974),u=new n({Extends:h,Mixins:[s],initialize:function(t,e,i,s,n,r){void 0===e&&(e=0),void 0===i&&(i=0),h.call(this,t,"Polygon",new a(s));var l=o(this.geom);this.setPosition(e,i),this.setSize(l.width,l.height),void 0!==n&&this.setFillStyle(n,r),this.updateDisplayOrigin(),this.updateData()},smooth:function(t){void 0===t&&(t=1);for(var e=0;e{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY,u=e.pathData,c=u.length-1,d=u[0]-h,p=u[1]-l;a.beginPath(),a.moveTo(d,p),e.closePath||(c-=2);for(var f=2;f{var s=i(61286),n=i(91249);s.register("polygon",(function(t,e,i,s,r){return this.displayList.add(new n(this.scene,t,e,i,s,r))}))},70573:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(72841),r=i(40834),t.exports={renderWebGL:n,renderCanvas:r}},72841:(t,e,i)=>{var s=i(19543),n=i(73329),r=i(50262);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=n(e,i,o),l=a.calcMatrix.copyFrom(h.calc),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&s(a,l,e,d,u,c),e.isStroked&&r(a,e,d,u,c),t.pipelines.postBatch(e)}},517:(t,e,i)=>{var s=i(56694),n=i(74118),r=i(91461),o=i(37673),a=new s({Extends:r,Mixins:[o],initialize:function(t,e,i,s,o,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===o&&(o=128),r.call(this,t,"Rectangle",new n(0,0,s,o)),this.setPosition(e,i),this.setSize(s,o),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},setSize:function(t,e){this.width=t,this.height=e,this.geom.setSize(t,e),this.updateData(),this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),e.getLineD(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=a},4091:(t,e,i)=>{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY;e.isFilled&&(s(a,e),a.fillRect(-h,-l,e.width,e.height)),e.isStroked&&(n(a,e),a.beginPath(),a.rect(-h,-l,e.width,e.height),a.stroke()),a.restore()}}},94355:(t,e,i)=>{var s=i(61286),n=i(517);s.register("rectangle",(function(t,e,i,s,r,o){return this.displayList.add(new n(this.scene,t,e,i,s,r,o))}))},37673:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(43532),r=i(4091),t.exports={renderWebGL:n,renderCanvas:r}},43532:(t,e,i)=>{var s=i(73329),n=i(50262),r=i(75512);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=s(e,i,o);a.calcMatrix.copyFrom(h.calc);var l=e._displayOriginX,u=e._displayOriginY,c=i.alpha*e.alpha;if(t.pipelines.preBatch(e),e.isFilled){var d=a.fillTint,p=r.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*c);d.TL=p,d.TR=p,d.BL=p,d.BR=p,a.batchFillRect(-l,-u,e.width,e.height)}e.isStroked&&n(a,e,c,l,u),t.pipelines.postBatch(e)}},77843:(t,e,i)=>{var s=i(87956),n=i(56694),r=i(11117),o=i(91461),a=new n({Extends:o,Mixins:[s],initialize:function(t,e,i,s,n,r,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=5),void 0===n&&(n=32),void 0===r&&(r=64),o.call(this,t,"Star",null),this._points=s,this._innerRadius=n,this._outerRadius=r,this.setPosition(e,i),this.setSize(2*r,2*r),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},setPoints:function(t){return this._points=t,this.updateData()},setInnerRadius:function(t){return this._innerRadius=t,this.updateData()},setOuterRadius:function(t){return this._outerRadius=t,this.updateData()},points:{get:function(){return this._points},set:function(t){this._points=t,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this.updateData()}},updateData:function(){var t=[],e=this._points,i=this._innerRadius,s=this._outerRadius,n=Math.PI/2*3,o=Math.PI/e,a=s,h=s;t.push(a,h+-s);for(var l=0;l{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY,u=e.pathData,c=u.length-1,d=u[0]-h,p=u[1]-l;a.beginPath(),a.moveTo(d,p),e.closePath||(c-=2);for(var f=2;f{var s=i(77843);i(61286).register("star",(function(t,e,i,n,r,o,a){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a))}))},87956:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(12037),r=i(11401),t.exports={renderWebGL:n,renderCanvas:r}},12037:(t,e,i)=>{var s=i(19543),n=i(73329),r=i(50262);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=n(e,i,o),l=a.calcMatrix.copyFrom(h.calc),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&s(a,l,e,d,u,c),e.isStroked&&r(a,e,d,u,c),t.pipelines.postBatch(e)}},21873:(t,e,i)=>{var s=i(56694),n=i(91461),r=i(66349),o=i(70498),a=new s({Extends:n,Mixins:[o],initialize:function(t,e,i,s,o,a,h,l,u,c,d){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===o&&(o=128),void 0===a&&(a=64),void 0===h&&(h=0),void 0===l&&(l=128),void 0===u&&(u=128),n.call(this,t,"Triangle",new r(s,o,a,h,l,u));var p=this.geom.right-this.geom.left,f=this.geom.bottom-this.geom.top;this.setPosition(e,i),this.setSize(p,f),void 0!==c&&this.setFillStyle(c,d),this.updateDisplayOrigin(),this.updateData()},setTo:function(t,e,i,s,n,r){return this.geom.setTo(t,e,i,s,n,r),this.updateData()},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=a},60213:(t,e,i)=>{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY,u=e.geom.x1-h,c=e.geom.y1-l,d=e.geom.x2-h,p=e.geom.y2-l,f=e.geom.x3-h,v=e.geom.y3-l;a.beginPath(),a.moveTo(u,c),a.lineTo(d,p),a.lineTo(f,v),a.closePath(),e.isFilled&&(s(a,e),a.fill()),e.isStroked&&(n(a,e),a.stroke()),a.restore()}}},79296:(t,e,i)=>{var s=i(61286),n=i(21873);s.register("triangle",(function(t,e,i,s,r,o,a,h,l,u){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a,h,l,u))}))},70498:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(72291),r=i(60213),t.exports={renderWebGL:n,renderCanvas:r}},72291:(t,e,i)=>{var s=i(73329),n=i(50262),r=i(75512);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=s(e,i,o);a.calcMatrix.copyFrom(h.calc);var l=e._displayOriginX,u=e._displayOriginY,c=i.alpha*e.alpha;if(t.pipelines.preBatch(e),e.isFilled){var d=a.fillTint,p=r.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*c);d.TL=p,d.TR=p,d.BL=p,d.BR=p;var f=e.geom.x1-l,v=e.geom.y1-u,g=e.geom.x2-l,m=e.geom.y2-u,y=e.geom.x3-l,x=e.geom.y3-u;a.batchFillTriangle(f,v,g,m,y,x,h.sprite,h.camera)}e.isStroked&&n(a,e,c,l,u),t.pipelines.postBatch(e)}},13747:(t,e,i)=>{var s=i(16569),n=i(56694),r=i(64937),o=i(89980),a=i(20791),h=new n({Extends:o,Mixins:[r.Alpha,r.BlendMode,r.Depth,r.Flip,r.FX,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.ScrollFactor,r.Size,r.TextureCrop,r.Tint,r.Transform,r.Visible,a],initialize:function(t,e,i,n,r){o.call(this,t,"Sprite"),this._crop=this.resetCropObject(),this.anims=new s(this),this.setTexture(n,r),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline()},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){this.anims.update(t,e)},play:function(t,e){return this.anims.play(t,e)},playReverse:function(t,e){return this.anims.playReverse(t,e)},playAfterDelay:function(t,e){return this.anims.playAfterDelay(t,e)},playAfterRepeat:function(t,e){return this.anims.playAfterRepeat(t,e)},chain:function(t){return this.anims.chain(t)},stop:function(){return this.anims.stop()},stopAfterDelay:function(t){return this.anims.stopAfterDelay(t)},stopAfterRepeat:function(t){return this.anims.stopAfterRepeat(t)},stopOnFrame:function(t){return this.anims.stopOnFrame(t)},toJSON:function(){return r.ToJSON(this)},preDestroy:function(){this.anims.destroy(),this.anims=void 0}});t.exports=h},27573:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),t.batchSprite(e,e.frame,i,s)}},89219:(t,e,i)=>{var s=i(88933),n=i(32291),r=i(99325),o=i(20494),a=i(13747);r.register("sprite",(function(t,e){void 0===t&&(t={});var i=o(t,"key",null),r=o(t,"frame",null),h=new a(this.scene,0,0,i,r);return void 0!==e&&(t.add=e),s(this.scene,h,t),n(h,t),h}))},66135:(t,e,i)=>{var s=i(61286),n=i(13747);s.register("sprite",(function(t,e,i,s){var r=new n(this.scene,t,e,i,s);return this.displayList.add(r),r}))},20791:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(21034),r=i(27573),t.exports={renderWebGL:n,renderCanvas:r}},21034:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),e.pipeline.batchSprite(e,i,s)}},32979:t=>{t.exports=function(t,e,i){var s=t.canvas,n=t.context,r=t.style,o=[],a=0,h=i.length;r.maxLines>0&&r.maxLines1&&(d+=p*(h-1)),{width:a,height:d,lines:h,lineWidths:o,lineSpacing:p,lineHeight:c}}},27030:(t,e,i)=>{var s=i(61068);t.exports=function(t){var e=s.create(this),i=e.getContext("2d");t.syncFont(e,i);var n=i.measureText(t.testString);if("actualBoundingBoxAscent"in n){var r=n.actualBoundingBoxAscent,o=n.actualBoundingBoxDescent;return s.remove(e),{ascent:r,descent:o,fontSize:r+o}}var a=Math.ceil(n.width*t.baselineX),h=a,l=2*h;h=h*t.baselineY|0,e.width=a,e.height=l,i.fillStyle="#f00",i.fillRect(0,0,a,l),i.font=t._font,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(t.testString,0,h);var u={ascent:0,descent:0,fontSize:0},c=i.getImageData(0,0,a,l);if(!c)return u.ascent=h,u.descent=h+6,u.fontSize=u.ascent+u.descent,s.remove(e),u;var d,p,f=c.data,v=f.length,g=4*a,m=0,y=!1;for(d=0;dh;d--){for(p=0;p{var s=i(99584),n=i(61068),r=i(56694),o=i(64937),a=i(97081),h=i(89980),l=i(32979),u=i(10850),c=i(55638),d=i(80032),p=i(74744),f=new r({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Crop,o.Depth,o.Flip,o.FX,o.GetBounds,o.Mask,o.Origin,o.Pipeline,o.ScrollFactor,o.Tint,o.Transform,o.Visible,d],initialize:function(t,e,i,s,r){void 0===e&&(e=0),void 0===i&&(i=0),h.call(this,t,"Text"),this.renderer=t.sys.renderer,this.setPosition(e,i),this.setOrigin(0,0),this.initPipeline(),this.canvas=n.create(this),this.context=this.canvas.getContext("2d"),this.style=new p(this,r),this.autoRound=!0,this.splitRegExp=/(?:\r\n|\r|\n)/,this._text=void 0,this.padding={left:0,right:0,top:0,bottom:0},this.width=1,this.height=1,this.lineSpacing=0,this.dirty=!1,0===this.style.resolution&&(this.style.resolution=1),this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(null,this.canvas,!0),this.frame=this.texture.get(),this.frame.source.resolution=this.style.resolution,this.renderer&&this.renderer.gl&&(this.renderer.deleteTexture(this.frame.source.glTexture),this.frame.source.glTexture=null),this.initRTL(),this.setText(s),r&&r.padding&&this.setPadding(r.padding),r&&r.lineSpacing&&this.setLineSpacing(r.lineSpacing),t.sys.game.events.on(a.CONTEXT_RESTORED,this.onContextRestored,this)},initRTL:function(){this.style.rtl&&(this.canvas.dir="rtl",this.context.direction="rtl",this.canvas.style.display="none",s(this.canvas,this.scene.sys.canvas),this.originX=1)},runWordWrap:function(t){var e=this.style;if(e.wordWrapCallback){var i=e.wordWrapCallback.call(e.wordWrapCallbackScope,t,this);return Array.isArray(i)&&(i=i.join("\n")),i}return e.wordWrapWidth?e.wordWrapUseAdvanced?this.advancedWordWrap(t,this.context,this.style.wordWrapWidth):this.basicWordWrap(t,this.context,this.style.wordWrapWidth):t},advancedWordWrap:function(t,e,i){for(var s="",n=t.replace(/ +/gi," ").split(this.splitRegExp),r=n.length,o=0;ol){if(0===c){for(var v=p;v.length&&(v=v.slice(0,-1),!((f=e.measureText(v).width)<=l)););if(!v.length)throw new Error("This text's wordWrapWidth setting is less than a single character!");var g=d.substr(v.length);u[c]=g,h+=v}var m=u[c].length?c:c+1,y=u.slice(m).join(" ").replace(/[ \n]*$/gi,"");n[o+1]=y+" "+(n[o+1]||""),r=n.length;break}h+=p,l-=f}s+=h.replace(/[ \n]*$/gi,"")+"\n"}}return s=s.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(t,e,i){for(var s="",n=t.split(this.splitRegExp),r=n.length-1,o=e.measureText(" ").width,a=0;a<=r;a++){for(var h=i,l=n[a].split(" "),u=l.length-1,c=0;c<=u;c++){var d=l[c],p=e.measureText(d).width,f=p;ch&&c>0&&(s+="\n",h=i),s+=d,c0&&(d+=h.lineSpacing*v),i.rtl)c=p-c-u.left-u.right;else if("right"===i.align)c+=o-h.lineWidths[v];else if("center"===i.align)c+=(o-h.lineWidths[v])/2;else if("justify"===i.align){if(h.lineWidths[v]/h.width>=.85){var g=h.width-h.lineWidths[v],m=e.measureText(" ").width,y=a[v].trim(),x=y.split(" ");g+=(a[v].length-y.length)*m;for(var T=Math.floor(g/m),w=0;T>0;)x[w]+=" ",w=(w+1)%(x.length-1||1),--T;a[v]=x.join(" ")}}this.autoRound&&(c=Math.round(c),d=Math.round(d)),i.strokeThickness&&(this.style.syncShadow(e,i.shadowStroke),e.strokeText(a[v],c,d)),i.color&&(this.style.syncShadow(e,i.shadowFill),e.fillText(a[v],c,d))}e.restore(),this.renderer&&this.renderer.gl&&(this.frame.source.glTexture=this.renderer.canvasToTexture(t,this.frame.source.glTexture,!0),this.frame.glTexture=this.frame.source.glTexture),this.dirty=!0;var b=this.input;return b&&!b.customHitArea&&(b.hitArea.width=this.width,b.hitArea.height=this.height),this},getTextMetrics:function(){return this.style.getTextMetrics()},text:{get:function(){return this._text},set:function(t){this.setText(t)}},toJSON:function(){var t=o.ToJSON(this),e={autoRound:this.autoRound,text:this._text,style:this.style.toJSON(),padding:{left:this.padding.left,right:this.padding.right,top:this.padding.top,bottom:this.padding.bottom}};return t.data=e,t},onContextRestored:function(){this.dirty=!0},preDestroy:function(){this.style.rtl&&c(this.canvas),n.remove(this.canvas),this.texture.destroy(),this.scene.sys.game.events.off(a.CONTEXT_RESTORED,this.onContextRestored,this)}});t.exports=f},71649:t=>{t.exports=function(t,e,i,s){0!==e.width&&0!==e.height&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,s))}},75397:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(76555);n.register("text",(function(t,e){void 0===t&&(t={});var i=r(t,"text",""),n=r(t,"style",null),a=r(t,"padding",null);null!==a&&(n.padding=a);var h=new o(this.scene,0,0,i,n);return void 0!==e&&(t.add=e),s(this.scene,h,t),h.autoRound=r(t,"autoRound",!0),h.resolution=r(t,"resolution",1),h}))},94627:(t,e,i)=>{var s=i(76555);i(61286).register("text",(function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))}))},80032:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(76128),r=i(71649),t.exports={renderWebGL:n,renderCanvas:r}},74744:(t,e,i)=>{var s=i(56694),n=i(20494),r=i(10850),o=i(27030),a={fontFamily:["fontFamily","Courier"],fontSize:["fontSize","16px"],fontStyle:["fontStyle",""],backgroundColor:["backgroundColor",null],color:["color","#fff"],stroke:["stroke","#fff"],strokeThickness:["strokeThickness",0],shadowOffsetX:["shadow.offsetX",0],shadowOffsetY:["shadow.offsetY",0],shadowColor:["shadow.color","#000"],shadowBlur:["shadow.blur",0],shadowStroke:["shadow.stroke",!1],shadowFill:["shadow.fill",!1],align:["align","left"],maxLines:["maxLines",0],fixedWidth:["fixedWidth",0],fixedHeight:["fixedHeight",0],resolution:["resolution",0],rtl:["rtl",!1],testString:["testString","|MÉqgy"],baselineX:["baselineX",1.2],baselineY:["baselineY",1.4],wordWrapWidth:["wordWrap.width",null],wordWrapCallback:["wordWrap.callback",null],wordWrapCallbackScope:["wordWrap.callbackScope",null],wordWrapUseAdvanced:["wordWrap.useAdvancedWrap",!1]},h=new s({initialize:function(t,e){this.parent=t,this.fontFamily,this.fontSize,this.fontStyle,this.backgroundColor,this.color,this.stroke,this.strokeThickness,this.shadowOffsetX,this.shadowOffsetY,this.shadowColor,this.shadowBlur,this.shadowStroke,this.shadowFill,this.align,this.maxLines,this.fixedWidth,this.fixedHeight,this.resolution,this.rtl,this.testString,this.baselineX,this.baselineY,this.wordWrapWidth,this.wordWrapCallback,this.wordWrapCallbackScope,this.wordWrapUseAdvanced,this._font,this.setStyle(e,!1,!0)},setStyle:function(t,e,i){for(var s in void 0===e&&(e=!0),void 0===i&&(i=!1),t&&t.hasOwnProperty("fontSize")&&"number"==typeof t.fontSize&&(t.fontSize=t.fontSize.toString()+"px"),a){var h=i?a[s][1]:this[s];this[s]="wordWrapCallback"===s||"wordWrapCallbackScope"===s?r(t,a[s][0],h):n(t,a[s][0],h)}var l=r(t,"font",null);null!==l&&this.setFont(l,!1),this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim();var u=r(t,"fill",null);null!==u&&(this.color=u);var c=r(t,"metrics",!1);return c?this.metrics={ascent:r(c,"ascent",0),descent:r(c,"descent",0),fontSize:r(c,"fontSize",0)}:!e&&this.metrics||(this.metrics=o(this)),e?this.parent.updateText():this.parent},syncFont:function(t,e){e.font=this._font},syncStyle:function(t,e){e.textBaseline="alphabetic",e.fillStyle=this.color,e.strokeStyle=this.stroke,e.lineWidth=this.strokeThickness,e.lineCap="round",e.lineJoin="round"},syncShadow:function(t,e){e?(t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur):(t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowColor=0,t.shadowBlur=0)},update:function(t){return t&&(this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim(),this.metrics=o(this)),this.parent.updateText()},setFont:function(t,e){void 0===e&&(e=!0);var i=t,s="",n="";if("string"!=typeof t)i=r(t,"fontFamily","Courier"),s=r(t,"fontSize","16px"),n=r(t,"fontStyle","");else{var o=t.split(" "),a=0;n=o.length>2?o[a++]:"",s=o[a++]||"16px",i=o[a++]||"Courier"}return i===this.fontFamily&&s===this.fontSize&&n===this.fontStyle||(this.fontFamily=i,this.fontSize=s,this.fontStyle=n,e&&this.update(!0)),this.parent},setFontFamily:function(t){return this.fontFamily!==t&&(this.fontFamily=t,this.update(!0)),this.parent},setFontStyle:function(t){return this.fontStyle!==t&&(this.fontStyle=t,this.update(!0)),this.parent},setFontSize:function(t){return"number"==typeof t&&(t=t.toString()+"px"),this.fontSize!==t&&(this.fontSize=t,this.update(!0)),this.parent},setTestString:function(t){return this.testString=t,this.update(!0)},setFixedSize:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(!1)},setBackgroundColor:function(t){return this.backgroundColor=t,this.update(!1)},setFill:function(t){return this.color=t,this.update(!1)},setColor:function(t){return this.color=t,this.update(!1)},setResolution:function(t){return this.resolution=t,this.update(!1)},setStroke:function(t,e){return void 0===e&&(e=this.strokeThickness),void 0===t&&0!==this.strokeThickness?(this.strokeThickness=0,this.update(!0)):this.stroke===t&&this.strokeThickness===e||(this.stroke=t,this.strokeThickness=e,this.update(!0)),this.parent},setShadow:function(t,e,i,s,n,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===s&&(s=0),void 0===n&&(n=!1),void 0===r&&(r=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=i,this.shadowBlur=s,this.shadowStroke=n,this.shadowFill=r,this.update(!1)},setShadowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)},setShadowColor:function(t){return void 0===t&&(t="#000"),this.shadowColor=t,this.update(!1)},setShadowBlur:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)},setShadowStroke:function(t){return this.shadowStroke=t,this.update(!1)},setShadowFill:function(t){return this.shadowFill=t,this.update(!1)},setWordWrapWidth:function(t,e){return void 0===e&&(e=!1),this.wordWrapWidth=t,this.wordWrapUseAdvanced=e,this.update(!1)},setWordWrapCallback:function(t,e){return void 0===e&&(e=null),this.wordWrapCallback=t,this.wordWrapCallbackScope=e,this.update(!1)},setAlign:function(t){return void 0===t&&(t="left"),this.align=t,this.update(!1)},setMaxLines:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)},getTextMetrics:function(){var t=this.metrics;return{ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}},toJSON:function(){var t={};for(var e in a)t[e]=this[e];return t.metrics=this.getTextMetrics(),t},destroy:function(){this.parent=void 0}});t.exports=h},76128:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i,n){if(0!==e.width&&0!==e.height){i.addToRenderList(e);var r=e.frame,o=r.width,a=r.height,h=s.getTintAppendFloatAlpha,l=t.pipelines.set(e.pipeline,e),u=l.setTexture2D(r.glTexture,e);l.batchTexture(e,r.glTexture,o,a,e.x,e.y,o/e.style.resolution,a/e.style.resolution,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,o,a,h(e.tintTopLeft,i.alpha*e._alphaTL),h(e.tintTopRight,i.alpha*e._alphaTR),h(e.tintBottomLeft,i.alpha*e._alphaBL),h(e.tintBottomRight,i.alpha*e._alphaBR),e.tintFill,0,0,i,n,!1,u)}}},35856:(t,e,i)=>{var s=i(61068),n=i(56694),r=i(64937),o=i(97081),a=i(89980),h=i(3504),l=i(8213),u=i(9271),c=i(93736),d=new n({Extends:a,Mixins:[r.Alpha,r.BlendMode,r.ComputedSize,r.Crop,r.Depth,r.Flip,r.FX,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.ScrollFactor,r.Tint,r.Transform,r.Visible,u],initialize:function(t,e,i,n,r,l,u){var d=t.sys.renderer;a.call(this,t,"TileSprite");var p=t.sys.textures.get(l),f=p.get(u);f.source.compressionAlgorithm&&(console.warn("TileSprite cannot use compressed textures"),f=(p=t.sys.textures.get("__MISSING")).get()),n&&r?(n=Math.floor(n),r=Math.floor(r)):(n=f.width,r=f.height),this._tilePosition=new c,this._tileScale=new c(1,1),this.dirty=!1,this.renderer=d,this.canvas=s.create(this,n,r),this.context=this.canvas.getContext("2d"),this.displayTexture=p,this.displayFrame=f,this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(null,this.canvas,!0),this.frame=this.texture.get(),this.potWidth=h(f.width),this.potHeight=h(f.height),this.fillCanvas=s.create2D(this,this.potWidth,this.potHeight),this.fillContext=this.fillCanvas.getContext("2d"),this.fillPattern=null,this.setPosition(e,i),this.setSize(n,r),this.setFrame(u),this.setOriginFromFrame(),this.initPipeline(),t.sys.game.events.on(o.CONTEXT_RESTORED,this.onContextRestored,this)},setTexture:function(t,e){return this.displayTexture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t){var e=this.displayTexture.get(t);return this.potWidth=h(e.width),this.potHeight=h(e.height),this.canvas.width=0,e.cutWidth&&e.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this.displayFrame=e,this.dirty=!0,this.updateTileTexture(),this},setTilePosition:function(t,e){return void 0!==t&&(this.tilePositionX=t),void 0!==e&&(this.tilePositionY=e),this},setTileScale:function(t,e){return void 0===t&&(t=this.tileScaleX),void 0===e&&(e=t),this.tileScaleX=t,this.tileScaleY=e,this},updateTileTexture:function(){if(this.dirty&&this.renderer){var t=this.displayFrame;if(t.source.isRenderTexture||t.source.isGLTexture)return console.warn("TileSprites can only use Image or Canvas based textures"),void(this.dirty=!1);var e=this.fillContext,i=this.fillCanvas,s=this.potWidth,n=this.potHeight;this.renderer&&this.renderer.gl||(s=t.cutWidth,n=t.cutHeight),e.clearRect(0,0,s,n),i.width=s,i.height=n,e.drawImage(t.source.image,t.cutX,t.cutY,t.cutWidth,t.cutHeight,0,0,s,n),this.renderer&&this.renderer.gl?this.fillPattern=this.renderer.canvasToTexture(i,this.fillPattern):this.fillPattern=e.createPattern(i,"repeat"),this.updateCanvas(),this.dirty=!1}},updateCanvas:function(){var t=this.canvas;if(t.width===this.width&&t.height===this.height||(t.width=this.width,t.height=this.height,this.frame.setSize(this.width,this.height),this.updateDisplayOrigin(),this.dirty=!0),!this.dirty||this.renderer&&this.renderer.gl)this.dirty=!1;else{var e=this.context;this.scene.sys.game.config.antialias||l.disable(e);var i=this._tileScale.x,s=this._tileScale.y,n=this._tilePosition.x,r=this._tilePosition.y;e.clearRect(0,0,this.width,this.height),e.save(),e.scale(i,s),e.translate(-n,-r),e.fillStyle=this.fillPattern,e.fillRect(n,r,this.width/i,this.height/s),e.restore(),this.dirty=!1}},onContextRestored:function(t){if(t){var e=t.gl;this.dirty=!0,this.fillPattern=null,this.fillPattern=t.createTexture2D(0,e.LINEAR,e.LINEAR,e.REPEAT,e.REPEAT,e.RGBA,this.fillCanvas,this.potWidth,this.potHeight)}},preDestroy:function(){this.renderer&&this.renderer.gl&&this.renderer.deleteTexture(this.fillPattern),s.remove(this.canvas),s.remove(this.fillCanvas),this.fillPattern=null,this.fillContext=null,this.fillCanvas=null,this.displayTexture=null,this.displayFrame=null,this.texture.destroy(),this.renderer=null,this.scene.sys.game.events.off(o.CONTEXT_RESTORED,this.onContextRestored,this)},tilePositionX:{get:function(){return this._tilePosition.x},set:function(t){this._tilePosition.x=t,this.dirty=!0}},tilePositionY:{get:function(){return this._tilePosition.y},set:function(t){this._tilePosition.y=t,this.dirty=!0}},tileScaleX:{get:function(){return this._tileScale.x},set:function(t){this._tileScale.x=t,this.dirty=!0}},tileScaleY:{get:function(){return this._tileScale.y},set:function(t){this._tileScale.y=t,this.dirty=!0}}});t.exports=d},93305:t=>{t.exports=function(t,e,i,s){e.updateCanvas(),i.addToRenderList(e),t.batchSprite(e,e.frame,i,s)}},63950:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(35856);n.register("tileSprite",(function(t,e){void 0===t&&(t={});var i=r(t,"x",0),n=r(t,"y",0),a=r(t,"width",512),h=r(t,"height",512),l=r(t,"key",""),u=r(t,"frame",""),c=new o(this.scene,i,n,a,h,l,u);return void 0!==e&&(t.add=e),s(this.scene,c,t),c}))},20509:(t,e,i)=>{var s=i(35856);i(61286).register("tileSprite",(function(t,e,i,n,r,o){return this.displayList.add(new s(this.scene,t,e,i,n,r,o))}))},9271:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(74287),r=i(93305),t.exports={renderWebGL:n,renderCanvas:r}},74287:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i,n){e.updateCanvas();var r=e.width,o=e.height;if(0!==r&&0!==o){i.addToRenderList(e);var a=s.getTintAppendFloatAlpha,h=t.pipelines.set(e.pipeline,e),l=h.setTexture2D(e.fillPattern,e);h.batchTexture(e,e.fillPattern,e.displayFrame.width*e.tileScaleX,e.displayFrame.height*e.tileScaleY,e.x,e.y,r,o,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.originX*r,e.originY*o,0,0,r,o,a(e.tintTopLeft,i.alpha*e._alphaTL),a(e.tintTopRight,i.alpha*e._alphaTR),a(e.tintBottomLeft,i.alpha*e._alphaBL),a(e.tintBottomRight,i.alpha*e._alphaBR),e.tintFill,e.tilePositionX%e.displayFrame.width/e.displayFrame.width,e.tilePositionY%e.displayFrame.height/e.displayFrame.height,i,n,!1,l)}}},8630:(t,e,i)=>{var s=i(56694),n=i(82897),r=i(64937),o=i(56631),a=i(97081),h=i(33963),l=i(89980),u=i(76038),c=i(76583),d=i(77974),p=i(83392),f=new s({Extends:l,Mixins:[r.Alpha,r.BlendMode,r.Depth,r.Flip,r.FX,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.ScrollFactor,r.Size,r.TextureCrop,r.Tint,r.Transform,r.Visible,d],initialize:function(t,e,i,s){l.call(this,t,"Video"),this.video=null,this.videoTexture=null,this.videoTextureSource=null,this.snapshotTexture=null,this.flipY=!1,this._key=c(),this.touchLocked=!0,this.playWhenUnlocked=!1,this.retryLimit=20,this.retry=0,this.retryInterval=500,this._retryID=null,this._systemMuted=!1,this._codeMuted=!1,this._systemPaused=!1,this._codePaused=!1,this._callbacks={play:this.playHandler.bind(this),error:this.loadErrorHandler.bind(this),end:this.completeHandler.bind(this),time:this.timeUpdateHandler.bind(this),seeking:this.seekingHandler.bind(this),seeked:this.seekedHandler.bind(this)},this._crop=this.resetCropObject(),this.markers={},this._markerIn=-1,this._markerOut=p.MAX_SAFE_INTEGER,this._lastUpdate=0,this._cacheKey="",this._isSeeking=!1,this.removeVideoElementOnDestroy=!1,this.setPosition(e,i),this.initPipeline(),s&&this.changeSource(s,!1);var n=t.sys.game.events;n.on(a.PAUSE,this.globalPause,this),n.on(a.RESUME,this.globalResume,this);var r=t.sys.sound;r&&r.on(u.GLOBAL_MUTE,this.globalMute,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},play:function(t,e,i){if(this.touchLocked&&this.playWhenUnlocked||this.isPlaying())return this;var s=this.video;if(!s)return console.warn("Video not loaded"),this;void 0===t&&(t=s.loop);var n=this.scene.sys.sound;n&&n.mute&&this.setMute(!0),isNaN(e)||(this._markerIn=e),!isNaN(i)&&i>e&&(this._markerOut=i),s.loop=t;var r=this._callbacks,o=s.play();return void 0!==o?o.then(this.playPromiseSuccessHandler.bind(this)).catch(this.playPromiseErrorHandler.bind(this)):(s.addEventListener("playing",r.play,!0),s.readyState<2&&(this.retry=this.retryLimit,this._retryID=window.setTimeout(this.checkVideoProgress.bind(this),this.retryInterval))),s.addEventListener("ended",r.end,!0),s.addEventListener("timeupdate",r.time,!0),s.addEventListener("seeking",r.seeking,!0),s.addEventListener("seeked",r.seeked,!0),this},changeSource:function(t,e,i,s,n){void 0===e&&(e=!0),this.video&&this.stop();var r=this.scene.sys.cache.video.get(t);return r?(this.video=r,this._cacheKey=t,this._codePaused=r.paused,this._codeMuted=r.muted,this.videoTexture?(this.scene.sys.textures.remove(this._key),this.videoTexture=this.scene.sys.textures.create(this._key,r,r.videoWidth,r.videoHeight),this.videoTextureSource=this.videoTexture.source[0],this.videoTexture.add("__BASE",0,0,0,r.videoWidth,r.videoHeight),this.setTexture(this.videoTexture),this.setSizeToFrame(),this.updateDisplayOrigin(),this.emit(o.VIDEO_CREATED,this,r.videoWidth,r.videoHeight)):this.updateTexture(),r.currentTime=0,this._lastUpdate=0,e&&this.play(i,s,n)):this.video=null,this},addMarker:function(t,e,i){return!isNaN(e)&&e>=0&&!isNaN(i)&&(this.markers[t]=[e,i]),this},playMarker:function(t,e){var i=this.markers[t];return i&&this.play(e,i[0],i[1]),this},removeMarker:function(t){return delete this.markers[t],this},snapshot:function(t,e){return void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.snapshotArea(0,0,this.width,this.height,t,e)},snapshotArea:function(t,e,i,s,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===s&&(s=this.height),void 0===n&&(n=i),void 0===r&&(r=s);var o=this.video,a=this.snapshotTexture;return a?(a.setSize(n,r),o&&a.context.drawImage(o,t,e,i,s,0,0,n,r)):(a=this.scene.sys.textures.createCanvas(c(),n,r),this.snapshotTexture=a,o&&a.context.drawImage(o,t,e,i,s,0,0,n,r)),a.update()},saveSnapshotTexture:function(t){return this.snapshotTexture?this.scene.sys.textures.renameTexture(this.snapshotTexture.key,t):this.snapshotTexture=this.scene.sys.textures.createCanvas(t,this.width,this.height),this.snapshotTexture},loadURL:function(t,e,i,s){void 0===e&&(e="loadeddata"),void 0===i&&(i=!1),this.video&&this.stop(),this.videoTexture&&this.scene.sys.textures.remove(this._key);var n=document.createElement("video");return n.controls=!1,i&&(n.muted=!0,n.defaultMuted=!0,n.setAttribute("autoplay","autoplay")),n.setAttribute("playsinline","playsinline"),n.setAttribute("preload","auto"),void 0!==s&&n.setAttribute("crossorigin",s),n.addEventListener("error",this._callbacks.error,!0),n.src=t,n.load(),this.video=n,this},loadMediaStream:function(t,e,i){void 0===e&&(e="loadeddata"),void 0===i&&(i=!1),this.video&&this.stop(),this.videoTexture&&this.scene.sys.textures.remove(this._key);var s=document.createElement("video");s.controls=!1,i&&(s.muted=!0,s.defaultMuted=!0,s.setAttribute("autoplay","autoplay")),s.setAttribute("playsinline","playsinline"),s.setAttribute("preload","auto"),s.addEventListener("error",this._callbacks.error,!0);try{s.srcObject=t}catch(e){s.src=window.URL.createObjectURL(t)}return s.load(),this.video=s,this},playPromiseSuccessHandler:function(){this._codePaused=!1,this.touchLocked=!1,this.emit(o.VIDEO_PLAY,this),this._markerIn>-1&&(this.video.currentTime=this._markerIn)},playPromiseErrorHandler:function(t){this.scene.sys.input.once(h.POINTER_DOWN,this.unlockHandler,this),this.touchLocked=!0,this.playWhenUnlocked=!0,this.emit(o.VIDEO_ERROR,this,t)},playHandler:function(){this._codePaused=!1,this.touchLocked=!1,this.emit(o.VIDEO_PLAY,this),this.video.removeEventListener("playing",this._callbacks.play,!0)},loadErrorHandler:function(t){this.stop(),this.emit(o.VIDEO_ERROR,this,t)},unlockHandler:function(){this.touchLocked=!1,this.playWhenUnlocked=!1,this.emit(o.VIDEO_UNLOCKED,this),this._markerIn>-1&&(this.video.currentTime=this._markerIn),this.video.play(),this.emit(o.VIDEO_PLAY,this)},completeHandler:function(){this.emit(o.VIDEO_COMPLETE,this)},timeUpdateHandler:function(){this.video&&this.video.currentTime=this._markerOut&&(t.loop?(t.currentTime=this._markerIn,this.updateTexture(),this._lastUpdate=e,this.emit(o.VIDEO_LOOP,this)):(this.emit(o.VIDEO_COMPLETE,this),this.stop())))}},checkVideoProgress:function(){this.video.readyState>=2?this.updateTexture():(this.retry--,this.retry>0?this._retryID=window.setTimeout(this.checkVideoProgress.bind(this),this.retryInterval):this.emit(o.VIDEO_TIMEOUT,this))},updateTexture:function(){var t=this.video,e=t.videoWidth,i=t.videoHeight;if(this.videoTexture){var s=this.videoTextureSource;s.source!==t&&(s.source=t,s.width=e,s.height=i),s.update()}else this.videoTexture=this.scene.sys.textures.create(this._key,t,e,i),this.videoTextureSource=this.videoTexture.source[0],this.videoTexture.add("__BASE",0,0,0,e,i),this.setTexture(this.videoTexture),this.setSizeToFrame(),this.updateDisplayOrigin(),this.emit(o.VIDEO_CREATED,this,e,i)},getVideoKey:function(){return this._cacheKey},seekTo:function(t){var e=this.video;if(e){var i=e.duration;if(i!==1/0&&!isNaN(i)){var s=i*t;this.setCurrentTime(s)}}return this},getCurrentTime:function(){return this.video?this.video.currentTime:0},setCurrentTime:function(t){var e=this.video;if(e){if("string"==typeof t){var i=t[0],s=parseFloat(t.substr(1));"+"===i?t=e.currentTime+s:"-"===i&&(t=e.currentTime-s)}e.currentTime=t,this._lastUpdate=t}return this},isSeeking:function(){return this._isSeeking},seekingHandler:function(){this._isSeeking=!0,this.emit(o.VIDEO_SEEKING,this)},seekedHandler:function(){this._isSeeking=!1,this.emit(o.VIDEO_SEEKED,this),this.video&&this.updateTexture()},getProgress:function(){var t=this.video;if(t){var e=t.currentTime,i=t.duration;if(i!==1/0&&!isNaN(i))return e/i}return 0},getDuration:function(){return this.video?this.video.duration:0},setMute:function(t){void 0===t&&(t=!0),this._codeMuted=t;var e=this.video;return e&&(e.muted=!!this._systemMuted||t),this},isMuted:function(){return this._codeMuted},globalMute:function(t,e){this._systemMuted=e;var i=this.video;i&&(i.muted=!!this._codeMuted||e)},globalPause:function(){this._systemPaused=!0,this.video&&this.video.pause()},globalResume:function(){this._systemPaused=!1,this.video&&!this._codePaused&&this.video.play()},setPaused:function(t){void 0===t&&(t=!0);var e=this.video;return this._codePaused=t,e&&(t?e.paused||e.pause():t||e.paused&&!this._systemPaused&&e.play()),this},getVolume:function(){return this.video?this.video.volume:1},setVolume:function(t){return void 0===t&&(t=1),this.video&&(this.video.volume=n(t,0,1)),this},getPlaybackRate:function(){return this.video?this.video.playbackRate:1},setPlaybackRate:function(t){return this.video&&(this.video.playbackRate=t),this},getLoop:function(){return!!this.video&&this.video.loop},setLoop:function(t){return void 0===t&&(t=!0),this.video&&(this.video.loop=t),this},isPlaying:function(){return!!this.video&&!(this.video.paused||this.video.ended)},isPaused:function(){return this.video&&this.video.paused||this._codePaused||this._systemPaused},saveTexture:function(t,e){return void 0===e&&(e=!1),this.videoTexture&&this.scene.sys.textures.renameTexture(this._key,t),this._key=t,this.flipY=e,this.videoTextureSource&&this.videoTextureSource.setFlipY(e),this.videoTexture},stop:function(){var t=this.video;if(t){var e=this._callbacks;for(var i in e)t.removeEventListener(i,e[i],!0);t.pause()}return this._retryID&&window.clearTimeout(this._retryID),this.emit(o.VIDEO_STOP,this),this},removeVideoElement:function(){var t=this.video;if(t){for(t.parentNode&&t.parentNode.removeChild(t);t.hasChildNodes();)t.removeChild(t.firstChild);t.removeAttribute("autoplay"),t.removeAttribute("src"),this.video=null}},preDestroy:function(){this.stop(),this.removeVideoElementOnDestroy&&this.removeVideoElement();var t=this.scene.sys.game.events;t.off(a.PAUSE,this.globalPause,this),t.off(a.RESUME,this.globalResume,this);var e=this.scene.sys.sound;e&&e.off(u.GLOBAL_MUTE,this.globalMute,this),this._retryID&&window.clearTimeout(this._retryID)}});t.exports=f},56933:t=>{t.exports=function(t,e,i,s){e.videoTexture&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,s))}},65601:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(8630);n.register("video",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=new o(this.scene,0,0,i);return void 0!==e&&(t.add=e),s(this.scene,n,t),n}))},215:(t,e,i)=>{var s=i(8630);i(61286).register("video",(function(t,e,i){return this.displayList.add(new s(this.scene,t,e,i))}))},77974:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(83572),r=i(56933),t.exports={renderWebGL:n,renderCanvas:r}},83572:t=>{t.exports=function(t,e,i,s){e.videoTexture&&(i.addToRenderList(e),e.pipeline.batchSprite(e,i,s))}},71030:(t,e,i)=>{var s=i(95723),n=i(26673),r=i(65650),o=i(56694),a=i(64937),h=i(89980),l=i(74118),u=i(94287),c=new o({Extends:h,Mixins:[a.Depth,a.GetBounds,a.Origin,a.Transform,a.ScrollFactor,a.Visible],initialize:function(t,e,i,n,r){void 0===n&&(n=1),void 0===r&&(r=n),h.call(this,t,"Zone"),this.setPosition(e,i),this.width=n,this.height=r,this.blendMode=s.NORMAL,this.updateDisplayOrigin()},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e,i){void 0===i&&(i=!0),this.width=t,this.height=e,this.updateDisplayOrigin();var s=this.input;return i&&s&&!s.customHitArea&&(s.hitArea.width=t,s.hitArea.height=e),this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},setCircleDropZone:function(t){return this.setDropZone(new n(0,0,t),r)},setRectangleDropZone:function(t,e){return this.setDropZone(new l(0,0,t,e),u)},setDropZone:function(t,e){return this.input||this.setInteractive(t,e,!0),this},setAlpha:function(){},setBlendMode:function(){},renderCanvas:function(t,e,i){i.addToRenderList(e)},renderWebGL:function(t,e,i){i.addToRenderList(e)}});t.exports=c},24067:(t,e,i)=>{var s=i(99325),n=i(20494),r=i(71030);s.register("zone",(function(t){var e=n(t,"x",0),i=n(t,"y",0),s=n(t,"width",1),o=n(t,"height",s);return new r(this.scene,e,i,s,o)}))},34546:(t,e,i)=>{var s=i(71030);i(61286).register("zone",(function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))}))},95847:t=>{t.exports=function(t){return t.radius>0?Math.PI*t.radius*t.radius:0}},26673:(t,e,i)=>{var s=i(56694),n=i(65650),r=i(94026),o=i(62941),a=i(52394),h=i(30977),l=new s({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.type=a.CIRCLE,this.x=t,this.y=e,this._radius=i,this._diameter=2*i},contains:function(t,e){return n(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i){return this.x=t,this.y=e,this._radius=i,this._diameter=2*i,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this._diameter=2*t}},diameter:{get:function(){return this._diameter},set:function(t){this._diameter=t,this._radius=.5*t}},left:{get:function(){return this.x-this._radius},set:function(t){this.x=t+this._radius}},right:{get:function(){return this.x+this._radius},set:function(t){this.x=t-this._radius}},top:{get:function(){return this.y-this._radius},set:function(t){this.y=t+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(t){this.y=t-this._radius}}});t.exports=l},37964:t=>{t.exports=function(t){return Math.PI*t.radius*2}},72233:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){return void 0===i&&(i=new s),i.x=t.x+t.radius*Math.cos(e),i.y=t.y+t.radius*Math.sin(e),i}},61761:(t,e,i)=>{var s=i(26673);t.exports=function(t){return new s(t.x,t.y,t.radius)}},65650:t=>{t.exports=function(t,e,i){return t.radius>0&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},39187:(t,e,i)=>{var s=i(65650);t.exports=function(t,e){return s(t,e.x,e.y)}},58672:(t,e,i)=>{var s=i(65650);t.exports=function(t,e){return s(t,e.x,e.y)&&s(t,e.right,e.y)&&s(t,e.x,e.bottom)&&s(t,e.right,e.bottom)}},42997:t=>{t.exports=function(t,e){return e.setTo(t.x,t.y,t.radius)}},94894:t=>{t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.radius===e.radius}},48027:(t,e,i)=>{var s=i(74118);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.left,e.y=t.top,e.width=t.diameter,e.height=t.diameter,e}},94026:(t,e,i)=>{var s=i(72233),n=i(91806),r=i(83392),o=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new o);var a=n(e,0,r.PI2);return s(t,a,i)}},62941:(t,e,i)=>{var s=i(37964),n=i(72233),r=i(91806),o=i(83392);t.exports=function(t,e,i,a){void 0===a&&(a=[]),!e&&i>0&&(e=s(t)/i);for(var h=0;h{t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},88665:t=>{t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},30977:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){void 0===e&&(e=new s);var i=2*Math.PI*Math.random(),n=Math.random()+Math.random(),r=n>1?2-n:n,o=r*Math.cos(i),a=r*Math.sin(i);return e.x=t.x+o*t.radius,e.y=t.y+a*t.radius,e}},6112:(t,e,i)=>{var s=i(26673);s.Area=i(95847),s.Circumference=i(37964),s.CircumferencePoint=i(72233),s.Clone=i(61761),s.Contains=i(65650),s.ContainsPoint=i(39187),s.ContainsRect=i(58672),s.CopyFrom=i(42997),s.Equals=i(94894),s.GetBounds=i(48027),s.GetPoint=i(94026),s.GetPoints=i(62941),s.Offset=i(34585),s.OffsetPoint=i(88665),s.Random=i(30977),t.exports=s},52394:t=>{t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},58605:t=>{t.exports=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI}},39507:t=>{t.exports=function(t){var e=t.width/2,i=t.height/2,s=Math.pow(e-i,2)/Math.pow(e+i,2);return Math.PI*(e+i)*(1+3*s/(10+Math.sqrt(4-3*s)))}},86998:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=t.width/2,r=t.height/2;return i.x=t.x+n*Math.cos(e),i.y=t.y+r*Math.sin(e),i}},81773:(t,e,i)=>{var s=i(95669);t.exports=function(t){return new s(t.x,t.y,t.width,t.height)}},72313:t=>{t.exports=function(t,e,i){if(t.width<=0||t.height<=0)return!1;var s=(e-t.x)/t.width,n=(i-t.y)/t.height;return(s*=s)+(n*=n)<.25}},34368:(t,e,i)=>{var s=i(72313);t.exports=function(t,e){return s(t,e.x,e.y)}},71431:(t,e,i)=>{var s=i(72313);t.exports=function(t,e){return s(t,e.x,e.y)&&s(t,e.right,e.y)&&s(t,e.x,e.bottom)&&s(t,e.right,e.bottom)}},75459:t=>{t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},95669:(t,e,i)=>{var s=i(56694),n=i(72313),r=i(95340),o=i(54978),a=i(52394),h=i(72006),l=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.type=a.ELLIPSE,this.x=t,this.y=e,this.width=i,this.height=s},contains:function(t,e){return n(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setEmpty:function(){return this.width=0,this.height=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getMinorRadius:function(){return Math.min(this.width,this.height)/2},getMajorRadius:function(){return Math.max(this.width,this.height)/2},left:{get:function(){return this.x-this.width/2},set:function(t){this.x=t+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(t){this.y=t+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=l},98068:t=>{t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},72897:(t,e,i)=>{var s=i(74118);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.left,e.y=t.top,e.width=t.width,e.height=t.height,e}},95340:(t,e,i)=>{var s=i(86998),n=i(91806),r=i(83392),o=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new o);var a=n(e,0,r.PI2);return s(t,a,i)}},54978:(t,e,i)=>{var s=i(39507),n=i(86998),r=i(91806),o=i(83392);t.exports=function(t,e,i,a){void 0===a&&(a=[]),!e&&i>0&&(e=s(t)/i);for(var h=0;h{t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},36233:t=>{t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},72006:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){void 0===e&&(e=new s);var i=Math.random()*Math.PI*2,n=Math.sqrt(Math.random());return e.x=t.x+n*Math.cos(i)*t.width/2,e.y=t.y+n*Math.sin(i)*t.height/2,e}},40652:(t,e,i)=>{var s=i(95669);s.Area=i(58605),s.Circumference=i(39507),s.CircumferencePoint=i(86998),s.Clone=i(81773),s.Contains=i(72313),s.ContainsPoint=i(34368),s.ContainsRect=i(71431),s.CopyFrom=i(75459),s.Equals=i(98068),s.GetBounds=i(72897),s.GetPoint=i(95340),s.GetPoints=i(54978),s.Offset=i(77951),s.OffsetPoint=i(36233),s.Random=i(72006),t.exports=s},84068:(t,e,i)=>{var s=i(52394),n=i(98611),r={Circle:i(6112),Ellipse:i(40652),Intersects:i(7563),Line:i(28482),Mesh:i(14293),Point:i(63472),Polygon:i(44359),Rectangle:i(66658),Triangle:i(87619)};r=n(!1,r,s),t.exports=r},22184:(t,e,i)=>{var s=i(53996);t.exports=function(t,e){return s(t.x,t.y,e.x,e.y)<=t.radius+e.radius}},26535:t=>{t.exports=function(t,e){var i=e.width/2,s=e.height/2,n=Math.abs(t.x-e.x-i),r=Math.abs(t.y-e.y-s),o=i+t.radius,a=s+t.radius;if(n>o||r>a)return!1;if(n<=i||r<=s)return!0;var h=n-i,l=r-s;return h*h+l*l<=t.radius*t.radius}},71145:(t,e,i)=>{var s=i(79967),n=i(22184);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r,o,a,h,l=t.x,u=t.y,c=t.radius,d=e.x,p=e.y,f=e.radius;if(u===p)0===(a=(o=-2*p)*o-4*(r=1)*(d*d+(h=(f*f-c*c-d*d+l*l)/(2*(l-d)))*h-2*d*h+p*p-f*f))?i.push(new s(h,-o/(2*r))):a>0&&(i.push(new s(h,(-o+Math.sqrt(a))/(2*r))),i.push(new s(h,(-o-Math.sqrt(a))/(2*r))));else{var v=(l-d)/(u-p),g=(f*f-c*c-d*d+l*l-p*p+u*u)/(2*(u-p));0===(a=(o=2*u*v-2*g*v-2*l)*o-4*(r=v*v+1)*(l*l+u*u+g*g-c*c-2*u*g))?(h=-o/(2*r),i.push(new s(h,g-h*v))):a>0&&(h=(-o+Math.sqrt(a))/(2*r),i.push(new s(h,g-h*v)),h=(-o-Math.sqrt(a))/(2*r),i.push(new s(h,g-h*v)))}}return i}},62508:(t,e,i)=>{var s=i(26111),n=i(26535);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC(),h=e.getLineD();s(r,t,i),s(o,t,i),s(a,t,i),s(h,t,i)}return i}},26111:(t,e,i)=>{var s=i(79967),n=i(61472);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r,o,a=t.x1,h=t.y1,l=t.x2,u=t.y2,c=e.x,d=e.y,p=e.radius,f=l-a,v=u-h,g=a-c,m=h-d,y=f*f+v*v,x=2*(f*g+v*m),T=x*x-4*y*(g*g+m*m-p*p);if(0===T){var w=-x/(2*y);r=a+w*f,o=h+w*v,w>=0&&w<=1&&i.push(new s(r,o))}else if(T>0){var b=(-x-Math.sqrt(T))/(2*y);r=a+b*f,o=h+b*v,b>=0&&b<=1&&i.push(new s(r,o));var E=(-x+Math.sqrt(T))/(2*y);r=a+E*f,o=h+E*v,E>=0&&E<=1&&i.push(new s(r,o))}}return i}},96537:(t,e,i)=>{var s=i(70015);t.exports=function(t,e,i,n){void 0===i&&(i=!1);var r,o,a,h=t.x1,l=t.y1,u=t.x2,c=t.y2,d=e.x1,p=e.y1,f=u-h,v=c-l,g=e.x2-d,m=e.y2-p,y=f*m-v*g;if(0===y)return!1;if(i){if((o=(d+g*(r=(f*(p-l)+v*(h-d))/(g*v-m*f))-h)/f)<0||r<0||r>1)return null;a=o}else{if(o=((l-p)*f-(h-d)*v)/y,(r=((d-h)*m-(p-l)*g)/y)<0||r>1||o<0||o>1)return null;a=r}return void 0===n&&(n=new s),n.set(h+f*a,l+v*a,a)}},17647:(t,e,i)=>{var s=i(96537),n=i(88829),r=i(70015),o=new n,a=new r;t.exports=function(t,e,i,n){void 0===i&&(i=!1),void 0===n&&(n=new r);var h=!1;n.set(),a.set();for(var l=e[0],u=1;u{var s=i(70015),n=i(51729),r=i(17647),o=new s;t.exports=function(t,e,i,s){void 0===s&&(s=new n),Array.isArray(e)||(e=[e]);var a=!1;s.set(),o.set();for(var h=0;h{var s=i(79967),n=i(25227),r=i(47910);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e))for(var o=e.getLineA(),a=e.getLineB(),h=e.getLineC(),l=e.getLineD(),u=[new s,new s,new s,new s],c=[n(o,t,u[0]),n(a,t,u[1]),n(h,t,u[2]),n(l,t,u[3])],d=0;d<4;d++)c[d]&&i.push(u[d]);return i}},7449:(t,e,i)=>{var s=i(51729),n=i(68439),r=new(i(88829));function o(t,e,i,o,a){var h=Math.cos(t),l=Math.sin(t);r.setTo(e,i,e+h,i+l);var u=n(r,o,!0);u&&a.push(new s(u.x,u.y,t,u.w))}function a(t,e){return t.z-e.z}t.exports=function(t,e,i){Array.isArray(i)||(i=[i]);for(var s=[],n=[],r=0;r{var s=i(74118),n=i(90205);t.exports=function(t,e,i){return void 0===i&&(i=new s),n(t,e)&&(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y),i}},1946:(t,e,i)=>{var s=i(9569),n=i(90205);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=t.getLineA(),o=t.getLineB(),a=t.getLineC(),h=t.getLineD();s(r,e,i),s(o,e,i),s(a,e,i),s(h,e,i)}return i}},34211:(t,e,i)=>{var s=i(20370),n=i(9569);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC();n(r,t,i),n(o,t,i),n(a,t,i)}return i}},80511:(t,e,i)=>{var s=i(26111),n=i(48411);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=t.getLineA(),o=t.getLineB(),a=t.getLineC();s(r,e,i),s(o,e,i),s(a,e,i)}return i}},31343:(t,e,i)=>{var s=i(79967),n=i(86117),r=i(25227);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e))for(var o=t.getLineA(),a=t.getLineB(),h=t.getLineC(),l=[new s,new s,new s],u=[r(o,e,l[0]),r(a,e,l[1]),r(h,e,l[2])],c=0;c<3;c++)u[c]&&i.push(l[c]);return i}},70534:(t,e,i)=>{var s=i(23589),n=i(31343);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC();n(t,r,i),n(t,o,i),n(t,a,i)}return i}},61472:(t,e,i)=>{var s=i(65650),n=new(i(79967));t.exports=function(t,e,i){if(void 0===i&&(i=n),s(e,t.x1,t.y1))return i.x=t.x1,i.y=t.y1,!0;if(s(e,t.x2,t.y2))return i.x=t.x2,i.y=t.y2,!0;var r=t.x2-t.x1,o=t.y2-t.y1,a=e.x-t.x1,h=e.y-t.y1,l=r*r+o*o,u=r,c=o;if(l>0){var d=(a*r+h*o)/l;u*=d,c*=d}return i.x=t.x1+u,i.y=t.y1+c,u*u+c*c<=l&&u*r+c*o>=0&&s(e,i.x,i.y)}},25227:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=t.x1,r=t.y1,o=t.x2,a=t.y2,h=e.x1,l=e.y1,u=e.x2,c=e.y2,d=(c-l)*(o-n)-(u-h)*(a-r);if(0===d)return!1;var p=((u-h)*(r-l)-(c-l)*(n-h))/d,f=((o-n)*(r-l)-(a-r)*(n-h))/d;return p>=0&&p<=1&&f>=0&&f<=1&&(i.x=n+p*(o-n),i.y=r+p*(a-r),!0)}},47910:t=>{t.exports=function(t,e){var i=t.x1,s=t.y1,n=t.x2,r=t.y2,o=e.x,a=e.y,h=e.right,l=e.bottom,u=0;if(i>=o&&i<=h&&s>=a&&s<=l||n>=o&&n<=h&&r>=a&&r<=l)return!0;if(i=o){if((u=s+(r-s)*(o-i)/(n-i))>a&&u<=l)return!0}else if(i>h&&n<=h&&(u=s+(r-s)*(h-i)/(n-i))>=a&&u<=l)return!0;if(s=a){if((u=i+(n-i)*(a-s)/(r-s))>=o&&u<=h)return!0}else if(s>l&&r<=l&&(u=i+(n-i)*(l-s)/(r-s))>=o&&u<=h)return!0;return!1}},34426:t=>{t.exports=function(t,e,i){void 0===i&&(i=1);var s=e.x1,n=e.y1,r=e.x2,o=e.y2,a=t.x,h=t.y,l=(r-s)*(r-s)+(o-n)*(o-n);if(0===l)return!1;var u=((a-s)*(r-s)+(h-n)*(o-n))/l;if(u<0)return Math.sqrt((s-a)*(s-a)+(n-h)*(n-h))<=i;if(u>=0&&u<=1){var c=((n-h)*(r-s)-(s-a)*(o-n))/l;return Math.abs(c)*Math.sqrt(l)<=i}return Math.sqrt((r-a)*(r-a)+(o-h)*(o-h))<=i}},81414:(t,e,i)=>{var s=i(34426);t.exports=function(t,e){if(!s(t,e))return!1;var i=Math.min(e.x1,e.x2),n=Math.max(e.x1,e.x2),r=Math.min(e.y1,e.y2),o=Math.max(e.y1,e.y2);return t.x>=i&&t.x<=n&&t.y>=r&&t.y<=o}},90205:t=>{t.exports=function(t,e){return!(t.width<=0||t.height<=0||e.width<=0||e.height<=0)&&!(t.righte.right||t.y>e.bottom)}},20370:(t,e,i)=>{var s=i(25227),n=i(94287),r=i(86875),o=i(87279);t.exports=function(t,e){if(e.left>t.right||e.rightt.bottom||e.bottom0}},8786:t=>{t.exports=function(t,e,i,s,n,r){return void 0===r&&(r=0),!(e>t.right+r||it.bottom+r||n{var s=i(61472),n=i(60689);t.exports=function(t,e){return!(t.left>e.right||t.righte.bottom||t.bottom{var s=i(25227);t.exports=function(t,e){return!(!t.contains(e.x1,e.y1)&&!t.contains(e.x2,e.y2))||(!!s(t.getLineA(),e)||(!!s(t.getLineB(),e)||!!s(t.getLineC(),e)))}},23589:(t,e,i)=>{var s=i(86875),n=i(18680),r=i(25227);t.exports=function(t,e){if(t.left>e.right||t.righte.bottom||t.bottom0||(c=n(e),(d=s(t,c,!0)).length>0)}},7563:(t,e,i)=>{t.exports={CircleToCircle:i(22184),CircleToRectangle:i(26535),GetCircleToCircle:i(71145),GetCircleToRectangle:i(62508),GetLineToCircle:i(26111),GetLineToLine:i(96537),GetLineToPoints:i(17647),GetLineToPolygon:i(68439),GetLineToRectangle:i(9569),GetRaysFromPointToPolygon:i(7449),GetRectangleIntersection:i(82931),GetRectangleToRectangle:i(1946),GetRectangleToTriangle:i(34211),GetTriangleToCircle:i(80511),GetTriangleToLine:i(31343),GetTriangleToTriangle:i(70534),LineToCircle:i(61472),LineToLine:i(25227),LineToRectangle:i(47910),PointToLine:i(34426),PointToLineSegment:i(81414),RectangleToRectangle:i(90205),RectangleToTriangle:i(20370),RectangleToValues:i(8786),TriangleToCircle:i(48411),TriangleToLine:i(86117),TriangleToTriangle:i(23589)}},50599:t=>{t.exports=function(t){return Math.atan2(t.y2-t.y1,t.x2-t.x1)}},58813:t=>{t.exports=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=[]);var s=Math.round(t.x1),n=Math.round(t.y1),r=Math.round(t.x2),o=Math.round(t.y2),a=Math.abs(r-s),h=Math.abs(o-n),l=s-h&&(c-=h,s+=l),p{t.exports=function(t,e,i){var s=e-(t.x1+t.x2)/2,n=i-(t.y1+t.y2)/2;return t.x1+=s,t.y1+=n,t.x2+=s,t.y2+=n,t}},26718:(t,e,i)=>{var s=i(88829);t.exports=function(t){return new s(t.x1,t.y1,t.x2,t.y2)}},88930:t=>{t.exports=function(t,e){return e.setTo(t.x1,t.y1,t.x2,t.y2)}},90656:t=>{t.exports=function(t,e){return t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2}},30897:(t,e,i)=>{var s=i(16028);t.exports=function(t,e,i){void 0===i&&(i=e);var n=s(t),r=t.x2-t.x1,o=t.y2-t.y1;return e&&(t.x1=t.x1-r/n*e,t.y1=t.y1-o/n*e),i&&(t.x2=t.x2+r/n*i,t.y2=t.y2+o/n*i),t}},30684:(t,e,i)=>{var s=i(92951),n=i(21902),r=i(79967);t.exports=function(t,e,i,o,a){void 0===o&&(o=0),void 0===a&&(a=[]);var h,l,u=[],c=t.x1,d=t.y1,p=t.x2-c,f=t.y2-d,v=n(e,a),g=i-1;for(h=0;h0){var m=u[0],y=[m];for(h=1;h=o&&(y.push(x),m=x)}var T=u[u.length-1];return s(m,T){var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=(t.x1+t.x2)/2,e.y=(t.y1+t.y2)/2,e}},11222:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=t.x1,r=t.y1,o=t.x2,a=t.y2,h=(o-n)*(o-n)+(a-r)*(a-r);if(0===h)return i;var l=((e.x-n)*(o-n)+(e.y-r)*(a-r))/h;return i.x=n+l*(o-n),i.y=r+l*(a-r),i}},7377:(t,e,i)=>{var s=i(83392),n=i(50599),r=i(79967);t.exports=function(t,e){void 0===e&&(e=new r);var i=n(t)-s.TAU;return e.x=Math.cos(i),e.y=Math.sin(i),e}},66464:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){return void 0===i&&(i=new s),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},8570:(t,e,i)=>{var s=i(16028),n=i(79967);t.exports=function(t,e,i,r){void 0===r&&(r=[]),!e&&i>0&&(e=s(t)/i);for(var o=t.x1,a=t.y1,h=t.x2,l=t.y2,u=0;u{t.exports=function(t,e){var i=t.x1,s=t.y1,n=t.x2,r=t.y2,o=(n-i)*(n-i)+(r-s)*(r-s);if(0===o)return!1;var a=((s-e.y)*(n-i)-(i-e.x)*(r-s))/o;return Math.abs(a)*Math.sqrt(o)}},82996:t=>{t.exports=function(t){return Math.abs(t.y1-t.y2)}},16028:t=>{t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},88829:(t,e,i)=>{var s=i(56694),n=i(66464),r=i(8570),o=i(52394),a=i(74077),h=i(93736),l=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.type=o.LINE,this.x1=t,this.y1=e,this.x2=i,this.y2=s},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return r(this,t,e,i)},getRandomPoint:function(t){return a(this,t)},setTo:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.x1=t,this.y1=e,this.x2=i,this.y2=s,this},getPointA:function(t){return void 0===t&&(t=new h),t.set(this.x1,this.y1),t},getPointB:function(t){return void 0===t&&(t=new h),t.set(this.x2,this.y2),t},left:{get:function(){return Math.min(this.x1,this.x2)},set:function(t){this.x1<=this.x2?this.x1=t:this.x2=t}},right:{get:function(){return Math.max(this.x1,this.x2)},set:function(t){this.x1>this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},73273:(t,e,i)=>{var s=i(83392),n=i(1071),r=i(50599);t.exports=function(t){var e=r(t)-s.TAU;return n(e,-Math.PI,Math.PI)}},96936:(t,e,i)=>{var s=i(83392),n=i(50599);t.exports=function(t){return Math.cos(n(t)-s.TAU)}},43581:(t,e,i)=>{var s=i(83392),n=i(50599);t.exports=function(t){return Math.sin(n(t)-s.TAU)}},13990:t=>{t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t}},1298:t=>{t.exports=function(t){return-(t.x2-t.x1)/(t.y2-t.y1)}},74077:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){void 0===e&&(e=new s);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},30473:(t,e,i)=>{var s=i(50599),n=i(73273);t.exports=function(t,e){return 2*n(e)-Math.PI-s(t)}},25968:(t,e,i)=>{var s=i(1809);t.exports=function(t,e){var i=(t.x1+t.x2)/2,n=(t.y1+t.y2)/2;return s(t,i,n,e)}},24296:(t,e,i)=>{var s=i(1809);t.exports=function(t,e,i){return s(t,e.x,e.y,i)}},1809:t=>{t.exports=function(t,e,i,s){var n=Math.cos(s),r=Math.sin(s),o=t.x1-e,a=t.y1-i;return t.x1=o*n-a*r+e,t.y1=o*r+a*n+i,o=t.x2-e,a=t.y2-i,t.x2=o*n-a*r+e,t.y2=o*r+a*n+i,t}},88171:t=>{t.exports=function(t,e,i,s,n){return t.x1=e,t.y1=i,t.x2=e+Math.cos(s)*n,t.y2=i+Math.sin(s)*n,t}},82797:t=>{t.exports=function(t){return(t.y2-t.y1)/(t.x2-t.x1)}},41067:t=>{t.exports=function(t){return Math.abs(t.x1-t.x2)}},28482:(t,e,i)=>{var s=i(88829);s.Angle=i(50599),s.BresenhamPoints=i(58813),s.CenterOn=i(88513),s.Clone=i(26718),s.CopyFrom=i(88930),s.Equals=i(90656),s.Extend=i(30897),s.GetEasedPoints=i(30684),s.GetMidPoint=i(20487),s.GetNearestPoint=i(11222),s.GetNormal=i(7377),s.GetPoint=i(66464),s.GetPoints=i(8570),s.GetShortestDistance=i(65269),s.Height=i(82996),s.Length=i(16028),s.NormalAngle=i(73273),s.NormalX=i(96936),s.NormalY=i(43581),s.Offset=i(13990),s.PerpSlope=i(1298),s.Random=i(74077),s.ReflectAngle=i(30473),s.Rotate=i(25968),s.RotateAroundPoint=i(24296),s.RotateAroundXY=i(1809),s.SetToAngle=i(88171),s.Slope=i(82797),s.Width=i(41067),t.exports=s},18693:(t,e,i)=>{var s=i(56694),n=i(74118),r=i(93736);function o(t,e,i,s){var n=t-i,r=e-s,o=n*n+r*r;return Math.sqrt(o)}var a=new s({initialize:function(t,e,i){this.vertex1=t,this.vertex2=e,this.vertex3=i,this.bounds=new n,this._inCenter=new r},getInCenter:function(t){void 0===t&&(t=!0);var e,i,s,n,r,a,h=this.vertex1,l=this.vertex2,u=this.vertex3;t?(e=h.x,i=h.y,s=l.x,n=l.y,r=u.x,a=u.y):(e=h.vx,i=h.vy,s=l.vx,n=l.vy,r=u.vx,a=u.vy);var c=o(r,a,s,n),d=o(e,i,r,a),p=o(s,n,e,i),f=c+d+p;return this._inCenter.set((e*c+s*d+r*p)/f,(i*c+n*d+a*p)/f)},contains:function(t,e,i){var s=this.vertex1,n=this.vertex2,r=this.vertex3,o=s.vx,a=s.vy,h=n.vx,l=n.vy,u=r.vx,c=r.vy;if(i){var d=i.a,p=i.b,f=i.c,v=i.d,g=i.e,m=i.f;o=s.vx*d+s.vy*f+g,a=s.vx*p+s.vy*v+m,h=n.vx*d+n.vy*f+g,l=n.vx*p+n.vy*v+m,u=r.vx*d+r.vy*f+g,c=r.vx*p+r.vy*v+m}var y=u-o,x=c-a,T=h-o,w=l-a,b=t-o,E=e-a,S=y*y+x*x,A=y*T+x*w,_=y*b+x*E,C=T*T+w*w,R=T*b+w*E,M=S*C-A*A,P=0===M?0:1/M,O=(C*_-A*R)*P,L=(S*R-A*_)*P;return O>=0&&L>=0&&O+L<1},isCounterClockwise:function(t){var e=this.vertex1,i=this.vertex2,s=this.vertex3,n=(i.vx-e.vx)*(s.vy-e.vy)-(i.vy-e.vy)*(s.vx-e.vx);return t<=0?n>=0:n<0},load:function(t,e,i,s,n){return i=this.vertex1.load(t,e,i,s,n),i=this.vertex2.load(t,e,i,s,n),i=this.vertex3.load(t,e,i,s,n)},transformCoordinatesLocal:function(t,e,i,s){return this.vertex1.transformCoordinatesLocal(t,e,i,s),this.vertex2.transformCoordinatesLocal(t,e,i,s),this.vertex3.transformCoordinatesLocal(t,e,i,s),this},updateBounds:function(){var t=this.vertex1,e=this.vertex2,i=this.vertex3,s=this.bounds;return s.x=Math.min(t.vx,e.vx,i.vx),s.y=Math.min(t.vy,e.vy,i.vy),s.width=Math.max(t.vx,e.vx,i.vx)-s.x,s.height=Math.max(t.vy,e.vy,i.vy)-s.y,this},isInView:function(t,e,i,s,n,r,o,a,h,l,u){var c=this.vertex1.update(n,r,o,a,h,l,u,s),d=this.vertex2.update(n,r,o,a,h,l,u,s),p=this.vertex3.update(n,r,o,a,h,l,u,s);if(c.ta<=0&&d.ta<=0&&p.ta<=0)return!1;if(e&&!this.isCounterClockwise(i))return!1;var f=this.bounds;f.x=Math.min(c.tx,d.tx,p.tx),f.y=Math.min(c.ty,d.ty,p.ty),f.width=Math.max(c.tx,d.tx,p.tx)-f.x,f.height=Math.max(c.ty,d.ty,p.ty)-f.y;var v=t.x+t.width,g=t.y+t.height;return!(f.width<=0||f.height<=0||t.width<=0||t.height<=0)&&!(f.rightv||f.y>g)},translate:function(t,e){void 0===e&&(e=0);var i=this.vertex1,s=this.vertex2,n=this.vertex3;return i.x+=t,i.y+=e,s.x+=t,s.y+=e,n.x+=t,n.y+=e,this},x:{get:function(){return this.getInCenter().x},set:function(t){var e=this.getInCenter();this.translate(t-e.x,0)}},y:{get:function(){return this.getInCenter().y},set:function(t){var e=this.getInCenter();this.translate(0,t-e.y)}},alpha:{get:function(){var t=this.vertex1,e=this.vertex2,i=this.vertex3;return(t.alpha+e.alpha+i.alpha)/3},set:function(t){this.vertex1.alpha=t,this.vertex2.alpha=t,this.vertex3.alpha=t}},depth:{get:function(){var t=this.vertex1,e=this.vertex2,i=this.vertex3;return(t.vz+e.vz+i.vz)/3}},destroy:function(){this.vertex1=null,this.vertex2=null,this.vertex3=null}});t.exports=a},99425:(t,e,i)=>{var s=i(18693),n=i(72632),r=i(16650),o=i(70015),a=i(85769),h=new o,l=new o,u=new r;t.exports=function(t){var e=n(t,"mesh"),i=n(t,"texture",null),r=n(t,"frame"),o=n(t,"width",1),c=n(t,"height",o),d=n(t,"widthSegments",1),p=n(t,"heightSegments",d),f=n(t,"x",0),v=n(t,"y",0),g=n(t,"z",0),m=n(t,"rotateX",0),y=n(t,"rotateY",0),x=n(t,"rotateZ",0),T=n(t,"zIsUp",!0),w=n(t,"isOrtho",!!e&&e.dirtyCache[11]),b=n(t,"colors",[16777215]),E=n(t,"alphas",[1]),S=n(t,"tile",!1),A=n(t,"flipY",!1),_=n(t,"width",null),C={faces:[],verts:[]};if(h.set(f,v,g),l.set(m,y,x),u.fromRotationXYTranslation(l,h,T),!i&&e)i=e.texture;else{if(!e||"string"!=typeof i)return C;i=e.scene.sys.textures.get(i)}var R=i.get(r);!_&&w&&i&&e&&(o=R.width/e.height,c=R.height/e.height);var M,P,O=o/2,L=c/2,F=Math.floor(d),D=Math.floor(p),k=F+1,I=D+1,B=o/F,N=c/D,Y=[],U=[],X=0,z=1,G=0,W=1;R&&(X=R.u0,z=R.u1,A?(G=R.v1,W=R.v0):(G=R.v0,W=R.v1));var V=z-X,H=W-G;for(P=0;P{var s=i(18693),n=i(16650),r=i(70015),o=i(85769),a=new r,h=new r,l=new n;t.exports=function(t,e,i,n,r,u,c,d,p,f){void 0===i&&(i=1),void 0===n&&(n=0),void 0===r&&(r=0),void 0===u&&(u=0),void 0===c&&(c=0),void 0===d&&(d=0),void 0===p&&(p=0),void 0===f&&(f=!0);var v={faces:[],verts:[]},g=t.materials;a.set(n,r,u),h.set(c,d,p),l.fromRotationXYTranslation(h,a,f);for(var m=0;m{var s=i(18693),n=i(85769);t.exports=function(t,e,i,r,o,a,h){if(void 0===r&&(r=!1),void 0===a&&(a=16777215),void 0===h&&(h=1),t.length===e.length){var l,u,c,d,p,f,v,g,m,y,x,T={faces:[],vertices:[]},w=r?3:2,b=Array.isArray(a),E=Array.isArray(h);if(Array.isArray(i)&&i.length>0)for(l=0;l{var e=!0,i="untitled",s="",n="";function r(t){var e=t.indexOf("#");return e>-1?t.substring(0,e):t}function o(t){return 0===t.models.length&&t.models.push({faces:[],name:i,textureCoords:[],vertexNormals:[],vertices:[]}),s="",t.models[t.models.length-1]}function a(t,e){var n=t.length>=2?t[1]:i;e.models.push({faces:[],name:n,textureCoords:[],vertexNormals:[],vertices:[]}),s=""}function h(t){2===t.length&&(s=t[1])}function l(t,e){var i=t.length,s=i>=2?parseFloat(t[1]):0,n=i>=3?parseFloat(t[2]):0,r=i>=4?parseFloat(t[3]):0;o(e).vertices.push({x:s,y:n,z:r})}function u(t,i){var s=t.length,n=s>=2?parseFloat(t[1]):0,r=s>=3?parseFloat(t[2]):0,a=s>=4?parseFloat(t[3]):0;isNaN(n)&&(n=0),isNaN(r)&&(r=0),isNaN(a)&&(a=0),e&&(r=1-r),o(i).textureCoords.push({u:n,v:r,w:a})}function c(t,e){var i=t.length,s=i>=2?parseFloat(t[1]):0,n=i>=3?parseFloat(t[2]):0,r=i>=4?parseFloat(t[3]):0;o(e).vertexNormals.push({x:s,y:n,z:r})}function d(t,e){var i=t.length-1;if(!(i<3)){for(var r={group:s,material:n,vertices:[]},a=0;a3)){var u=0,c=0,d=0;u=parseInt(h[0],10),l>1&&""!==h[1]&&(c=parseInt(h[1],10)),l>2&&(d=parseInt(h[2],10)),0!==u&&(u<0&&(u=o(e).vertices.length+1+u),c-=1,u-=1,d-=1,r.vertices.push({textureCoordsIndex:c,vertexIndex:u,vertexNormalIndex:d}))}}o(e).faces.push(r)}}function p(t,e){t.length>=2&&e.materialLibraries.push(t[1])}function f(t){t.length>=2&&(n=t[1])}t.exports=function(t,i){void 0===i&&(i=!0),e=i;var o={materials:{},materialLibraries:[],models:[]};s="",n="";for(var v=t.split("\n"),g=0;g{var s=i(22946);t.exports=function(t){for(var e={},i=t.split("\n"),n="",r=0;r=2?Math.floor(255*a[2]):h,u=a.length>=3?Math.floor(255*a[3]):h;e[n]=s(h,l,u)}}}return e}},15313:t=>{t.exports=function(t,e,i,s){var n,r;if(void 0===i&&void 0===s){var o=t.getInCenter();n=o.x,r=o.y}var a=Math.cos(e),h=Math.sin(e),l=t.vertex1,u=t.vertex2,c=t.vertex3,d=l.x-n,p=l.y-r;l.set(d*a-p*h+n,d*h+p*a+r),d=u.x-n,p=u.y-r,u.set(d*a-p*h+n,d*h+p*a+r),d=c.x-n,p=c.y-r,c.set(d*a-p*h+n,d*h+p*a+r)}},85769:(t,e,i)=>{var s=i(56694),n=i(75512),r=i(70015),o=new s({Extends:r,initialize:function(t,e,i,s,n,o,a,h,l,u){void 0===o&&(o=16777215),void 0===a&&(a=1),void 0===h&&(h=0),void 0===l&&(l=0),void 0===u&&(u=0),r.call(this,t,e,i),this.vx=0,this.vy=0,this.vz=0,this.nx=h,this.ny=l,this.nz=u,this.u=s,this.v=n,this.color=o,this.alpha=a,this.tx=0,this.ty=0,this.ta=0},setUVs:function(t,e){return this.u=t,this.v=e,this},transformCoordinatesLocal:function(t,e,i,s){var n=this.x,r=this.y,o=this.z,a=t.val,h=n*a[0]+r*a[4]+o*a[8]+a[12],l=n*a[1]+r*a[5]+o*a[9]+a[13],u=n*a[2]+r*a[6]+o*a[10]+a[14],c=n*a[3]+r*a[7]+o*a[11]+a[15];this.vx=h/c*e,this.vy=-l/c*i,this.vz=s<=0?u/c:-u/c},update:function(t,e,i,s,n,r,o,a){var h=this.vx*t+this.vy*i+n,l=this.vx*e+this.vy*s+r;return o&&(h=Math.round(h),l=Math.round(l)),this.tx=h,this.ty=l,this.ta=this.alpha*a,this},load:function(t,e,i,s,r){return t[++i]=this.tx,t[++i]=this.ty,t[++i]=this.u,t[++i]=this.v,t[++i]=s,t[++i]=r,e[++i]=n.getTintAppendFloatAlpha(this.color,this.ta),i}});t.exports=o},14293:(t,e,i)=>{var s={Face:i(18693),GenerateGridVerts:i(99425),GenerateObjVerts:i(53267),GenerateVerts:i(67623),ParseObj:i(27291),ParseObjMaterial:i(76799),RotateFace:i(15313),Vertex:i(85769)};t.exports=s},77601:t=>{t.exports=function(t){return t.setTo(Math.ceil(t.x),Math.ceil(t.y))}},38933:(t,e,i)=>{var s=i(79967);t.exports=function(t){return new s(t.x,t.y)}},47103:t=>{t.exports=function(t,e){return e.setTo(t.x,t.y)}},13625:t=>{t.exports=function(t,e){return t.x===e.x&&t.y===e.y}},12536:t=>{t.exports=function(t){return t.setTo(Math.floor(t.x),Math.floor(t.y))}},54205:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){if(void 0===e&&(e=new s),!Array.isArray(t))throw new Error("GetCentroid points argument must be an array");var i=t.length;if(i<1)throw new Error("GetCentroid points array must not be empty");if(1===i)e.x=t[0].x,e.y=t[0].y;else{for(var n=0;n{t.exports=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)}},82712:t=>{t.exports=function(t){return t.x*t.x+t.y*t.y}},20052:(t,e,i)=>{var s=i(74118);t.exports=function(t,e){void 0===e&&(e=new s);for(var i=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY,a=0;ai&&(i=h.x),h.xr&&(r=h.y),h.y{var s=i(79967);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=new s),n.x=t.x+(e.x-t.x)*i,n.y=t.y+(e.y-t.y)*i,n}},42397:t=>{t.exports=function(t){return t.setTo(t.y,t.x)}},59464:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.setTo(-t.x,-t.y)}},79967:(t,e,i)=>{var s=i(56694),n=i(52394),r=new s({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.type=n.POINT,this.x=t,this.y=e},setTo:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this}});t.exports=r},53581:(t,e,i)=>{var s=i(79967),n=i(82712);t.exports=function(t,e,i){void 0===i&&(i=new s);var r=(t.x*e.x+t.y*e.y)/n(e);return 0!==r&&(i.x=r*e.x,i.y=r*e.y),i}},50817:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=t.x*e.x+t.y*e.y;return 0!==n&&(i.x=n*e.x,i.y=n*e.y),i}},40525:(t,e,i)=>{var s=i(50083);t.exports=function(t,e){if(0!==t.x||0!==t.y){var i=s(t);t.x/=i,t.y/=i}return t.x*=e,t.y*=e,t}},63472:(t,e,i)=>{var s=i(79967);s.Ceil=i(77601),s.Clone=i(38933),s.CopyFrom=i(47103),s.Equals=i(13625),s.Floor=i(12536),s.GetCentroid=i(54205),s.GetMagnitude=i(50083),s.GetMagnitudeSq=i(82712),s.GetRectangleFromPoints=i(20052),s.Interpolate=i(77154),s.Invert=i(42397),s.Negative=i(59464),s.Project=i(53581),s.ProjectUnit=i(50817),s.SetMagnitude=i(40525),t.exports=s},19631:(t,e,i)=>{var s=i(8580);t.exports=function(t){return new s(t.points)}},45604:t=>{t.exports=function(t,e,i){for(var s=!1,n=-1,r=t.points.length-1;++n{var s=i(45604);t.exports=function(t,e){return s(t,e.x,e.y)}},11117:t=>{"use strict";function e(t,e,r){r=r||2;var o,a,h,c,d,f,v,g=e&&e.length,m=g?e[0]*r:t.length,y=i(t,0,m,r,!0),x=[];if(!y||y.next===y.prev)return x;if(g&&(y=function(t,e,n,r){var o,a,h,c=[];for(o=0,a=e.length;o80*r){o=h=t[0],a=c=t[1];for(var T=r;Th&&(h=d),f>c&&(c=f);v=0!==(v=Math.max(h-o,c-a))?1/v:0}return n(y,x,r,o,a,v),x}function i(t,e,i,s,n){var r,o;if(n===_(t,e,i,s)>0)for(r=e;r=e;r-=s)o=E(r,t[r],t[r+1],o);return o&&m(o,o.next)&&(S(o),o=o.next),o}function s(t,e){if(!t)return t;e||(e=t);var i,s=t;do{if(i=!1,s.steiner||!m(s,s.next)&&0!==g(s.prev,s,s.next))s=s.next;else{if(S(s),(s=e=s.prev)===s.next)break;i=!0}}while(i||s!==e);return e}function n(t,e,i,l,u,c,p){if(t){!p&&c&&function(t,e,i,s){var n=t;do{null===n.z&&(n.z=d(n.x,n.y,e,i,s)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){var e,i,s,n,r,o,a,h,l=1;do{for(i=t,t=null,r=null,o=0;i;){for(o++,s=i,a=0,e=0;e0||h>0&&s;)0!==a&&(0===h||!s||i.z<=s.z)?(n=i,i=i.nextZ,a--):(n=s,s=s.nextZ,h--),r?r.nextZ=n:t=n,n.prevZ=r,r=n;i=s}r.nextZ=null,l*=2}while(o>1)}(n)}(t,l,u,c);for(var f,v,g=t;t.prev!==t.next;)if(f=t.prev,v=t.next,c?o(t,l,u,c):r(t))e.push(f.i/i),e.push(t.i/i),e.push(v.i/i),S(t),t=v.next,g=v.next;else if((t=v)===g){p?1===p?n(t=a(s(t),e,i),e,i,l,u,c,2):2===p&&h(t,e,i,l,u,c):n(s(t),e,i,l,u,c,1);break}}}function r(t){var e=t.prev,i=t,s=t.next;if(g(e,i,s)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(f(e.x,e.y,i.x,i.y,s.x,s.y,n.x,n.y)&&g(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function o(t,e,i,s){var n=t.prev,r=t,o=t.next;if(g(n,r,o)>=0)return!1;for(var a=n.xr.x?n.x>o.x?n.x:o.x:r.x>o.x?r.x:o.x,u=n.y>r.y?n.y>o.y?n.y:o.y:r.y>o.y?r.y:o.y,c=d(a,h,e,i,s),p=d(l,u,e,i,s),v=t.prevZ,m=t.nextZ;v&&v.z>=c&&m&&m.z<=p;){if(v!==t.prev&&v!==t.next&&f(n.x,n.y,r.x,r.y,o.x,o.y,v.x,v.y)&&g(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,m!==t.prev&&m!==t.next&&f(n.x,n.y,r.x,r.y,o.x,o.y,m.x,m.y)&&g(m.prev,m,m.next)>=0)return!1;m=m.nextZ}for(;v&&v.z>=c;){if(v!==t.prev&&v!==t.next&&f(n.x,n.y,r.x,r.y,o.x,o.y,v.x,v.y)&&g(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;m&&m.z<=p;){if(m!==t.prev&&m!==t.next&&f(n.x,n.y,r.x,r.y,o.x,o.y,m.x,m.y)&&g(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function a(t,e,i){var n=t;do{var r=n.prev,o=n.next.next;!m(r,o)&&y(r,n,n.next,o)&&w(r,o)&&w(o,r)&&(e.push(r.i/i),e.push(n.i/i),e.push(o.i/i),S(n),S(n.next),n=t=o),n=n.next}while(n!==t);return s(n)}function h(t,e,i,r,o,a){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&v(h,l)){var u=b(h,l);return h=s(h,h.next),u=s(u,u.next),n(h,e,i,r,o,a),void n(u,e,i,r,o,a)}l=l.next}h=h.next}while(h!==t)}function l(t,e){return t.x-e.x}function u(t,e){if(e=function(t,e){var i,s=e,n=t.x,r=t.y,o=-1/0;do{if(r<=s.y&&r>=s.next.y&&s.next.y!==s.y){var a=s.x+(r-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(a<=n&&a>o){if(o=a,a===n){if(r===s.y)return s;if(r===s.next.y)return s.next}i=s.x=s.x&&s.x>=u&&n!==s.x&&f(ri.x||s.x===i.x&&c(i,s)))&&(i=s,p=h)),s=s.next}while(s!==l);return i}(t,e),e){var i=b(e,t);s(e,e.next),s(i,i.next)}}function c(t,e){return g(t.prev,t,e.prev)<0&&g(e.next,t,t.next)<0}function d(t,e,i,s,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-s)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p(t){var e=t,i=t;do{(e.x=0&&(t-o)*(s-a)-(i-o)*(e-a)>=0&&(i-o)*(r-a)-(n-o)*(s-a)>=0}function v(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&y(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(w(t,e)&&w(e,t)&&function(t,e){var i=t,s=!1,n=(t.x+e.x)/2,r=(t.y+e.y)/2;do{i.y>r!=i.next.y>r&&i.next.y!==i.y&&n<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(s=!s),i=i.next}while(i!==t);return s}(t,e)&&(g(t.prev,t,e.prev)||g(t,e.prev,e))||m(t,e)&&g(t.prev,t,t.next)>0&&g(e.prev,e,e.next)>0)}function g(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function m(t,e){return t.x===e.x&&t.y===e.y}function y(t,e,i,s){var n=T(g(t,e,i)),r=T(g(t,e,s)),o=T(g(i,s,t)),a=T(g(i,s,e));return n!==r&&o!==a||(!(0!==n||!x(t,i,e))||(!(0!==r||!x(t,s,e))||(!(0!==o||!x(i,t,s))||!(0!==a||!x(i,e,s)))))}function x(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function T(t){return t>0?1:t<0?-1:0}function w(t,e){return g(t.prev,t,t.next)<0?g(t,e,t.next)>=0&&g(t,t.prev,e)>=0:g(t,e,t.prev)<0||g(t,t.next,e)<0}function b(t,e){var i=new A(t.i,t.x,t.y),s=new A(e.i,e.x,e.y),n=t.next,r=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,s.next=i,i.prev=s,r.next=s,s.prev=r,s}function E(t,e,i,s){var n=new A(t,e,i);return s?(n.next=s.next,n.prev=s,s.next.prev=n,s.next=n):(n.prev=n,n.next=n),n}function S(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function A(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function _(t,e,i,s){for(var n=0,r=e,o=i-s;r0&&(s+=t[n-1].length,i.holes.push(s))}return i},t.exports=e},14045:(t,e,i)=>{var s=i(74118);t.exports=function(t,e){void 0===e&&(e=new s);for(var i,n=1/0,r=1/0,o=-n,a=-r,h=0;h{t.exports=function(t,e){void 0===e&&(e=[]);for(var i=0;i{var s=i(16028),n=i(88829),r=i(5159);t.exports=function(t,e,i,o){void 0===o&&(o=[]);var a=t.points,h=r(t);!e&&i>0&&(e=h/i);for(var l=0;lc+g)){var m=v.getPoint((u-c)/g);o.push(m);break}c+=g}return o}},5159:(t,e,i)=>{var s=i(16028),n=i(88829);t.exports=function(t){for(var e=t.points,i=0,r=0;r{var s=i(56694),n=i(45604),r=i(89294),o=i(52394),a=new s({initialize:function(t){this.type=o.POLYGON,this.area=0,this.points=[],t&&this.setTo(t)},contains:function(t,e){return n(this,t,e)},setTo:function(t){if(this.area=0,this.points=[],"string"==typeof t&&(t=t.split(" ")),!Array.isArray(t))return this;for(var e,i=Number.MAX_VALUE,s=0;s{t.exports=function(t){return t.points.reverse(),t}},95874:t=>{function e(t,e,i){var s=e.x,n=e.y,r=i.x-s,o=i.y-n;if(0!==r||0!==o){var a=((t.x-s)*r+(t.y-n)*o)/(r*r+o*o);a>1?(s=i.x,n=i.y):a>0&&(s+=r*a,n+=o*a)}return(r=t.x-s)*r+(o=t.y-n)*o}function i(t,s,n,r,o){for(var a,h=r,l=s+1;lh&&(a=l,h=u)}h>r&&(a-s>1&&i(t,s,a,r,o),o.push(t[a]),n-a>1&&i(t,a,n,r,o))}function s(t,e){var s=t.length-1,n=[t[0]];return i(t,0,s,e,n),n.push(t[s]),n}t.exports=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=!1);var n=t.points;if(n.length>2){var r=e*e;i||(n=function(t,e){for(var i,s,n,r,o,a=t[0],h=[a],l=1,u=t.length;le&&(h.push(i),a=i);return a!==i&&h.push(i),h}(n,r)),t.setTo(s(n,r))}return t}},18974:t=>{var e=function(t,e){return t[0]=e[0],t[1]=e[1],t};t.exports=function(t){var i,s=[],n=t.points;for(i=0;i0&&r.push(e([0,0],s[0])),i=0;i1&&r.push(e([0,0],s[s.length-1])),t.setTo(r)}},23490:t=>{t.exports=function(t,e,i){for(var s=t.points,n=0;n{var s=i(8580);s.Clone=i(19631),s.Contains=i(45604),s.ContainsPoint=i(87289),s.Earcut=i(11117),s.GetAABB=i(14045),s.GetNumberArray=i(98286),s.GetPoints=i(89294),s.Perimeter=i(5159),s.Reverse=i(32244),s.Simplify=i(95874),s.Smooth=i(18974),s.Translate=i(23490),t.exports=s},1653:t=>{t.exports=function(t){return t.width*t.height}},33943:t=>{t.exports=function(t){return t.x=Math.ceil(t.x),t.y=Math.ceil(t.y),t}},58662:t=>{t.exports=function(t){return t.x=Math.ceil(t.x),t.y=Math.ceil(t.y),t.width=Math.ceil(t.width),t.height=Math.ceil(t.height),t}},79993:t=>{t.exports=function(t,e,i){return t.x=e-t.width/2,t.y=i-t.height/2,t}},81572:(t,e,i)=>{var s=i(74118);t.exports=function(t){return new s(t.x,t.y,t.width,t.height)}},94287:t=>{t.exports=function(t,e,i){return!(t.width<=0||t.height<=0)&&(t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i)}},28687:(t,e,i)=>{var s=i(94287);t.exports=function(t,e){return s(t,e.x,e.y)}},73222:t=>{t.exports=function(t,e){return!(e.width*e.height>t.width*t.height)&&(e.x>t.x&&e.xt.x&&e.rightt.y&&e.yt.y&&e.bottom{t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},87279:t=>{t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x,y:t.y}),e.push({x:t.right,y:t.y}),e.push({x:t.right,y:t.bottom}),e.push({x:t.x,y:t.bottom}),e}},19989:t=>{t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},92628:(t,e,i)=>{var s=i(6700);t.exports=function(t,e){var i=s(t);return i{var s=i(6700);t.exports=function(t,e){var i=s(t);return i>s(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},71356:t=>{t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t}},21687:t=>{t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height),t}},80222:(t,e,i)=>{var s=i(74118),n=i(83392);t.exports=function(t,e){if(void 0===e&&(e=new s),0===t.length)return e;for(var i,r,o,a=Number.MAX_VALUE,h=Number.MAX_VALUE,l=n.MIN_SAFE_INTEGER,u=n.MIN_SAFE_INTEGER,c=0;c{var s=i(74118);t.exports=function(t,e,i,n,r){return void 0===r&&(r=new s),r.setTo(Math.min(t,i),Math.min(e,n),Math.abs(t-i),Math.abs(e-n))}},6700:t=>{t.exports=function(t){return 0===t.height?NaN:t.width/t.height}},35242:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.centerX,e.y=t.centerY,e}},47698:(t,e,i)=>{var s=i(85876),n=i(79967);t.exports=function(t,e,i){if(void 0===i&&(i=new n),e<=0||e>=1)return i.x=t.x,i.y=t.y,i;var r=s(t)*e;return e>.5?(r-=t.width+t.height)<=t.width?(i.x=t.right-r,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(r-t.width)):r<=t.width?(i.x=t.x+r,i.y=t.y):(i.x=t.right,i.y=t.y+(r-t.width)),i}},54932:(t,e,i)=>{var s=i(47698),n=i(85876);t.exports=function(t,e,i,r){void 0===r&&(r=[]),!e&&i>0&&(e=n(t)/i);for(var o=0;o{var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.width,e.y=t.height,e}},7782:(t,e,i)=>{var s=i(79993);t.exports=function(t,e,i){var n=t.centerX,r=t.centerY;return t.setSize(t.width+2*e,t.height+2*i),s(t,n,r)}},66217:(t,e,i)=>{var s=i(74118),n=i(90205);t.exports=function(t,e,i){return void 0===i&&(i=new s),n(t,e)?(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y):i.setEmpty(),i}},40053:(t,e,i)=>{var s=i(85876),n=i(79967);t.exports=function(t,e,i,r){if(void 0===r&&(r=[]),!e&&!i)return r;e?i=Math.round(s(t)/e):e=s(t)/i;for(var o=t.x,a=t.y,h=0,l=0;l=t.right&&(h=1,a+=o-t.right,o=t.right);break;case 1:(a+=e)>=t.bottom&&(h=2,o-=a-t.bottom,a=t.bottom);break;case 2:(o-=e)<=t.left&&(h=3,a-=t.left-o,o=t.left);break;case 3:(a-=e)<=t.top&&(h=0,a=t.top)}return r}},86673:t=>{t.exports=function(t,e){for(var i=t.x,s=t.right,n=t.y,r=t.bottom,o=0;o{t.exports=function(t,e){var i=Math.min(t.x,e.x),s=Math.max(t.right,e.right);t.x=i,t.width=s-i;var n=Math.min(t.y,e.y),r=Math.max(t.bottom,e.bottom);return t.y=n,t.height=r-n,t}},44755:t=>{t.exports=function(t,e,i){var s=Math.min(t.x,e),n=Math.max(t.right,e);t.x=s,t.width=n-s;var r=Math.min(t.y,i),o=Math.max(t.bottom,i);return t.y=r,t.height=o-r,t}},74466:t=>{t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},55946:t=>{t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},97474:t=>{t.exports=function(t,e){return t.xe.x&&t.ye.y}},85876:t=>{t.exports=function(t){return 2*(t.width+t.height)}},20243:(t,e,i)=>{var s=i(79967),n=i(75606);t.exports=function(t,e,i){void 0===i&&(i=new s),e=n(e);var r=Math.sin(e),o=Math.cos(e),a=o>0?t.width/2:t.width/-2,h=r>0?t.height/2:t.height/-2;return Math.abs(a*r){var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.x+Math.random()*t.width,e.y=t.y+Math.random()*t.height,e}},97691:(t,e,i)=>{var s=i(17489),n=i(73222),r=i(79967);t.exports=function(t,e,i){if(void 0===i&&(i=new r),n(t,e))switch(s(0,3)){case 0:i.x=t.x+Math.random()*(e.right-t.x),i.y=t.y+Math.random()*(e.top-t.y);break;case 1:i.x=e.x+Math.random()*(t.right-e.x),i.y=e.bottom+Math.random()*(t.bottom-e.bottom);break;case 2:i.x=t.x+Math.random()*(e.x-t.x),i.y=e.y+Math.random()*(t.bottom-e.y);break;case 3:i.x=e.right+Math.random()*(t.right-e.right),i.y=t.y+Math.random()*(e.bottom-t.y)}return i}},74118:(t,e,i)=>{var s=i(56694),n=i(94287),r=i(47698),o=i(54932),a=i(52394),h=i(88829),l=i(30001),u=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.type=a.RECTANGLE,this.x=t,this.y=e,this.width=i,this.height=s},contains:function(t,e){return n(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.y,this.right,this.y),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.y,this.right,this.bottom),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.bottom,this.x,this.bottom),t},getLineD:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.bottom,this.x,this.y),t},left:{get:function(){return this.x},set:function(t){t>=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=u},51828:t=>{t.exports=function(t,e){return t.width===e.width&&t.height===e.height}},5691:t=>{t.exports=function(t,e,i){return void 0===i&&(i=e),t.width*=e,t.height*=i,t}},58795:(t,e,i)=>{var s=i(74118);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=Math.min(t.x,e.x),r=Math.min(t.y,e.y),o=Math.max(t.right,e.right)-n,a=Math.max(t.bottom,e.bottom)-r;return i.setTo(n,r,o,a)}},66658:(t,e,i)=>{var s=i(74118);s.Area=i(1653),s.Ceil=i(33943),s.CeilAll=i(58662),s.CenterOn=i(79993),s.Clone=i(81572),s.Contains=i(94287),s.ContainsPoint=i(28687),s.ContainsRect=i(73222),s.CopyFrom=i(29538),s.Decompose=i(87279),s.Equals=i(19989),s.FitInside=i(92628),s.FitOutside=i(85028),s.Floor=i(71356),s.FloorAll=i(21687),s.FromPoints=i(80222),s.FromXY=i(75785),s.GetAspectRatio=i(6700),s.GetCenter=i(35242),s.GetPoint=i(47698),s.GetPoints=i(54932),s.GetSize=i(31591),s.Inflate=i(7782),s.Intersection=i(66217),s.MarchingAnts=i(40053),s.MergePoints=i(86673),s.MergeRect=i(14655),s.MergeXY=i(44755),s.Offset=i(74466),s.OffsetPoint=i(55946),s.Overlaps=i(97474),s.Perimeter=i(85876),s.PerimeterPoint=i(20243),s.Random=i(30001),s.RandomOutside=i(97691),s.SameDimensions=i(51828),s.Scale=i(5691),s.Union=i(58795),t.exports=s},19108:t=>{t.exports=function(t){var e=t.x1,i=t.y1,s=t.x2,n=t.y2,r=t.x3,o=t.y3;return Math.abs(((r-e)*(n-i)-(s-e)*(o-i))/2)}},41199:(t,e,i)=>{var s=i(66349);t.exports=function(t,e,i){var n=i*(Math.sqrt(3)/2);return new s(t,e,t+i/2,e+n,t-i/2,e+n)}},88730:(t,e,i)=>{var s=i(11117),n=i(66349);t.exports=function(t,e,i,r,o){void 0===e&&(e=null),void 0===i&&(i=1),void 0===r&&(r=1),void 0===o&&(o=[]);for(var a,h,l,u,c,d,p,f,v,g=s(t,e),m=0;m{var s=i(66349);t.exports=function(t,e,i,n){return void 0===n&&(n=i),new s(t,e,t,e-n,t+i,e)}},1882:(t,e,i)=>{var s=i(56595),n=i(9640);t.exports=function(t,e,i,r){void 0===r&&(r=s);var o=r(t),a=e-o.x,h=i-o.y;return n(t,a,h)}},56595:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=(t.x1+t.x2+t.x3)/3,e.y=(t.y1+t.y2+t.y3)/3,e}},91835:(t,e,i)=>{var s=i(93736);function n(t,e,i,s){return t*s-e*i}t.exports=function(t,e){void 0===e&&(e=new s);var i=t.x3,r=t.y3,o=t.x1-i,a=t.y1-r,h=t.x2-i,l=t.y2-r,u=2*n(o,a,h,l),c=n(a,o*o+a*a,l,h*h+l*l),d=n(o,o*o+a*a,h,h*h+l*l);return e.x=i-c/u,e.y=r+d/u,e}},97073:(t,e,i)=>{var s=i(26673);t.exports=function(t,e){void 0===e&&(e=new s);var i,n,r=t.x1,o=t.y1,a=t.x2,h=t.y2,l=t.x3,u=t.y3,c=a-r,d=h-o,p=l-r,f=u-o,v=c*(r+a)+d*(o+h),g=p*(r+l)+f*(o+u),m=2*(c*(u-h)-d*(l-a));if(Math.abs(m)<1e-6){var y=Math.min(r,a,l),x=Math.min(o,h,u);i=.5*(Math.max(r,a,l)-y),n=.5*(Math.max(o,h,u)-x),e.x=y+i,e.y=x+n,e.radius=Math.sqrt(i*i+n*n)}else e.x=(f*v-d*g)/m,e.y=(c*g-p*v)/m,i=e.x-r,n=e.y-o,e.radius=Math.sqrt(i*i+n*n);return e}},75974:(t,e,i)=>{var s=i(66349);t.exports=function(t){return new s(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}},60689:t=>{t.exports=function(t,e,i){var s=t.x3-t.x1,n=t.y3-t.y1,r=t.x2-t.x1,o=t.y2-t.y1,a=e-t.x1,h=i-t.y1,l=s*s+n*n,u=s*r+n*o,c=s*a+n*h,d=r*r+o*o,p=r*a+o*h,f=l*d-u*u,v=0===f?0:1/f,g=(d*c-u*p)*v,m=(l*p-u*c)*v;return g>=0&&m>=0&&g+m<1}},86875:t=>{t.exports=function(t,e,i,s){void 0===i&&(i=!1),void 0===s&&(s=[]);for(var n,r,o,a,h,l,u=t.x3-t.x1,c=t.y3-t.y1,d=t.x2-t.x1,p=t.y2-t.y1,f=u*u+c*c,v=u*d+c*p,g=d*d+p*p,m=f*g-v*v,y=0===m?0:1/m,x=t.x1,T=t.y1,w=0;w=0&&r>=0&&n+r<1&&(s.push({x:e[w].x,y:e[w].y}),i)));w++);return s}},51532:(t,e,i)=>{var s=i(60689);t.exports=function(t,e){return s(t,e.x,e.y)}},42538:t=>{t.exports=function(t,e){return e.setTo(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}},18680:t=>{t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x1,y:t.y1}),e.push({x:t.x2,y:t.y2}),e.push({x:t.x3,y:t.y3}),e}},29977:t=>{t.exports=function(t,e){return t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2&&t.x3===e.x3&&t.y3===e.y3}},56088:(t,e,i)=>{var s=i(79967),n=i(16028);t.exports=function(t,e,i){void 0===i&&(i=new s);var r=t.getLineA(),o=t.getLineB(),a=t.getLineC();if(e<=0||e>=1)return i.x=r.x1,i.y=r.y1,i;var h=n(r),l=n(o),u=n(a),c=(h+l+u)*e,d=0;return ch+l?(d=(c-=h+l)/u,i.x=a.x1+(a.x2-a.x1)*d,i.y=a.y1+(a.y2-a.y1)*d):(d=(c-=h)/l,i.x=o.x1+(o.x2-o.x1)*d,i.y=o.y1+(o.y2-o.y1)*d),i}},24402:(t,e,i)=>{var s=i(16028),n=i(79967);t.exports=function(t,e,i,r){void 0===r&&(r=[]);var o=t.getLineA(),a=t.getLineB(),h=t.getLineC(),l=s(o),u=s(a),c=s(h),d=l+u+c;!e&&i>0&&(e=d/i);for(var p=0;pl+u?(v=(f-=l+u)/c,g.x=h.x1+(h.x2-h.x1)*v,g.y=h.y1+(h.y2-h.y1)*v):(v=(f-=l)/u,g.x=a.x1+(a.x2-a.x1)*v,g.y=a.y1+(a.y2-a.y1)*v),r.push(g)}return r}},83648:(t,e,i)=>{var s=i(79967);function n(t,e,i,s){var n=t-i,r=e-s,o=n*n+r*r;return Math.sqrt(o)}t.exports=function(t,e){void 0===e&&(e=new s);var i=t.x1,r=t.y1,o=t.x2,a=t.y2,h=t.x3,l=t.y3,u=n(h,l,o,a),c=n(i,r,h,l),d=n(o,a,i,r),p=u+c+d;return e.x=(i*u+o*c+h*d)/p,e.y=(r*u+a*c+l*d)/p,e}},9640:t=>{t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t.x3+=e,t.y3+=i,t}},95290:(t,e,i)=>{var s=i(16028);t.exports=function(t){var e=t.getLineA(),i=t.getLineB(),n=t.getLineC();return s(e)+s(i)+s(n)}},99761:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){void 0===e&&(e=new s);var i=t.x2-t.x1,n=t.y2-t.y1,r=t.x3-t.x1,o=t.y3-t.y1,a=Math.random(),h=Math.random();return a+h>=1&&(a=1-a,h=1-h),e.x=t.x1+(i*a+r*h),e.y=t.y1+(n*a+o*h),e}},21934:(t,e,i)=>{var s=i(19211),n=i(83648);t.exports=function(t,e){var i=n(t);return s(t,i.x,i.y,e)}},68454:(t,e,i)=>{var s=i(19211);t.exports=function(t,e,i){return s(t,e.x,e.y,i)}},19211:t=>{t.exports=function(t,e,i,s){var n=Math.cos(s),r=Math.sin(s),o=t.x1-e,a=t.y1-i;return t.x1=o*n-a*r+e,t.y1=o*r+a*n+i,o=t.x2-e,a=t.y2-i,t.x2=o*n-a*r+e,t.y2=o*r+a*n+i,o=t.x3-e,a=t.y3-i,t.x3=o*n-a*r+e,t.y3=o*r+a*n+i,t}},66349:(t,e,i)=>{var s=i(56694),n=i(60689),r=i(56088),o=i(24402),a=i(52394),h=i(88829),l=i(99761),u=new s({initialize:function(t,e,i,s,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=0),this.type=a.TRIANGLE,this.x1=t,this.y1=e,this.x2=i,this.y2=s,this.x3=n,this.y3=r},contains:function(t,e){return n(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,s,n,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=0),this.x1=t,this.y1=e,this.x2=i,this.y2=s,this.x3=n,this.y3=r,this},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x1,this.y1,this.x2,this.y2),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.x2,this.y2,this.x3,this.y3),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.x3,this.y3,this.x1,this.y1),t},left:{get:function(){return Math.min(this.x1,this.x2,this.x3)},set:function(t){var e=0;e=this.x1<=this.x2&&this.x1<=this.x3?this.x1-t:this.x2<=this.x1&&this.x2<=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},right:{get:function(){return Math.max(this.x1,this.x2,this.x3)},set:function(t){var e=0;e=this.x1>=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=u},87619:(t,e,i)=>{var s=i(66349);s.Area=i(19108),s.BuildEquilateral=i(41199),s.BuildFromPolygon=i(88730),s.BuildRight=i(3635),s.CenterOn=i(1882),s.Centroid=i(56595),s.CircumCenter=i(91835),s.CircumCircle=i(97073),s.Clone=i(75974),s.Contains=i(60689),s.ContainsArray=i(86875),s.ContainsPoint=i(51532),s.CopyFrom=i(42538),s.Decompose=i(18680),s.Equals=i(29977),s.GetPoint=i(56088),s.GetPoints=i(24402),s.InCenter=i(83648),s.Perimeter=i(95290),s.Offset=i(9640),s.Random=i(99761),s.Rotate=i(21934),s.RotateAroundPoint=i(68454),s.RotateAroundXY=i(19211),t.exports=s},27395:t=>{t.exports=function(t,e,i){return{gameObject:t,enabled:!0,alwaysEnabled:!1,draggable:!1,dropZone:!1,cursor:!1,target:null,camera:null,hitArea:e,hitAreaCallback:i,hitAreaDebug:null,customHitArea:!1,localX:0,localY:0,dragState:0,dragStartX:0,dragStartY:0,dragStartXGlobal:0,dragStartYGlobal:0,dragX:0,dragY:0}}},18104:t=>{t.exports=function(t,e){return function(i,s,n,r){var o=t.getPixelAlpha(s,n,r.texture.key,r.frame.name);return o&&o>=e}}},69898:(t,e,i)=>{var s=i(56694),n=i(72687),r=i(6659),o=i(33963),a=i(97081),h=i(71064),l=i(7905),u=i(40398),c=i(37579),d=i(69360),p=i(64462),f=new s({initialize:function(t,e){this.game=t,this.scaleManager,this.canvas,this.config=e,this.enabled=!0,this.events=new r,this.isOver=!0,this.defaultCursor="",this.keyboard=e.inputKeyboard?new h(this):null,this.mouse=e.inputMouse?new l(this):null,this.touch=e.inputTouch?new c(this):null,this.pointers=[],this.pointersTotal=e.inputActivePointers,e.inputTouch&&1===this.pointersTotal&&(this.pointersTotal=2);for(var i=0;i<=this.pointersTotal;i++){var s=new u(this,i);s.smoothFactor=e.inputSmoothFactor,this.pointers.push(s)}this.mousePointer=e.inputMouse?this.pointers[0]:null,this.activePointer=this.pointers[0],this.globalTopOnly=!0,this.time=0,this._tempPoint={x:0,y:0},this._tempHitTest=[],this._tempMatrix=new d,this._tempMatrix2=new d,this._tempSkip=!1,this.mousePointerContainer=[this.mousePointer],t.events.once(a.BOOT,this.boot,this)},boot:function(){var t=this.game,e=t.events;this.canvas=t.canvas,this.scaleManager=t.scale,this.events.emit(o.MANAGER_BOOT),e.on(a.PRE_RENDER,this.preRender,this),e.once(a.DESTROY,this.destroy,this)},setCanvasOver:function(t){this.isOver=!0,this.events.emit(o.GAME_OVER,t)},setCanvasOut:function(t){this.isOver=!1,this.events.emit(o.GAME_OUT,t)},preRender:function(){var t=this.game.loop.now,e=this.game.loop.delta,i=this.game.scene.getScenes(!0,!0);this.time=t,this.events.emit(o.MANAGER_UPDATE);for(var s=0;s10&&(t=10-this.pointersTotal);for(var i=0;i{var s=i(26673),n=i(65650),r=i(56694),o=i(72687),a=i(27395),h=i(18104),l=i(53996),u=i(95669),c=i(72313),d=i(33963),p=i(6659),f=i(72632),v=i(52394),g=i(63399),m=i(42911),y=i(91963),x=i(74118),T=i(94287),w=i(7599),b=i(66349),E=i(60689),S=new r({Extends:p,initialize:function(t){p.call(this),this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.manager=t.sys.game.input,this.pluginEvents=new p,this.enabled=!0,this.displayList,this.cameras,g.install(this),this.mouse=this.manager.mouse,this.topOnly=!0,this.pollRate=-1,this._pollTimer=0;var e={cancelled:!1};this._eventContainer={stopPropagation:function(){e.cancelled=!0}},this._eventData=e,this.dragDistanceThreshold=0,this.dragTimeThreshold=0,this._temp=[],this._tempZones=[],this._list=[],this._pendingInsertion=[],this._pendingRemoval=[],this._draggable=[],this._drag={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._dragState=[],this._over={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._validTypes=["onDown","onUp","onOver","onOut","onMove","onDragStart","onDrag","onDragEnd","onDragEnter","onDragLeave","onDragOver","onDrop"],this._updatedThisFrame=!1,t.sys.events.once(w.BOOT,this.boot,this),t.sys.events.on(w.START,this.start,this)},boot:function(){this.cameras=this.systems.cameras,this.displayList=this.systems.displayList,this.systems.events.once(w.DESTROY,this.destroy,this),this.pluginEvents.emit(d.BOOT)},start:function(){var t=this.systems.events;t.on(w.TRANSITION_START,this.transitionIn,this),t.on(w.TRANSITION_OUT,this.transitionOut,this),t.on(w.TRANSITION_COMPLETE,this.transitionComplete,this),t.on(w.PRE_UPDATE,this.preUpdate,this),t.once(w.SHUTDOWN,this.shutdown,this),this.manager.events.on(d.GAME_OUT,this.onGameOut,this),this.manager.events.on(d.GAME_OVER,this.onGameOver,this),this.enabled=!0,this._dragState=[0,0,0,0,0,0,0,0,0,0],this.pluginEvents.emit(d.START)},onGameOver:function(t){this.isActive()&&this.emit(d.GAME_OVER,t.timeStamp,t)},onGameOut:function(t){this.isActive()&&this.emit(d.GAME_OUT,t.timeStamp,t)},preUpdate:function(){this.pluginEvents.emit(d.PRE_UPDATE);var t=this._pendingRemoval,e=this._pendingInsertion,i=t.length,s=e.length;if(0!==i||0!==s){for(var n=this._list,r=0;r-1&&(n.splice(a,1),this.clear(o,!0))}t.length=0,this._pendingRemoval.length=0,this._list=n.concat(e.splice(0))}},isActive:function(){return this.enabled&&this.scene.sys.isActive()},updatePoll:function(t,e){if(!this.isActive())return!1;if(this.pluginEvents.emit(d.UPDATE,t,e),this._updatedThisFrame)return this._updatedThisFrame=!1,!1;var i,s=this.manager,n=s.pointers,r=s.pointersTotal;for(i=0;i0){if(this._pollTimer-=e,!(this._pollTimer<0))return!1;this._pollTimer=this.pollRate}var a=!1;for(i=0;i0&&(a=!0)}return a},update:function(t,e){if(!this.isActive())return!1;for(var i=e.length,s=!1,n=0;n0&&(s=!0)}return this._updatedThisFrame=!0,s},clear:function(t,e){void 0===e&&(e=!1),this.disable(t);var i=t.input;i&&(i.gameObject=void 0,i.target=void 0,i.hitArea=void 0,i.hitAreaCallback=void 0,i.callbackContext=void 0,t.input=null),e||this.queueForRemoval(t);var s=this._draggable.indexOf(t);return s>-1&&this._draggable.splice(s,1),t},disable:function(t){var e=t.input;e&&(e.enabled=!1,e.dragState=0);var i=this._temp,s=this._drag,n=this._over,r=this.manager,o=i.indexOf(t);o>-1&&i.splice(o,1);for(var a=0;a-1&&s[a].splice(o,1),(o=n[a].indexOf(t))>-1&&(n[a].splice(o,1),r.resetCursor(e));return this},enable:function(t,e,i,s){return void 0===s&&(s=!1),t.input?t.input.enabled=!0:this.setHitArea(t,e,i),t.input&&s&&!t.input.dropZone&&(t.input.dropZone=s),this},hitTestPointer:function(t){for(var e=this.cameras.getCamerasBelowPointer(t),i=0;i0)return t.camera=s,n}return t.camera=e[0],[]},processDownEvents:function(t){var e=0,i=this._temp,s=this._eventData,n=this._eventContainer;s.cancelled=!1;for(var r=!1,o=0;o0&&l(t.x,t.y,t.downX,t.downY)>=n||s>0&&e>=t.downTime+s)&&(i=!0),i)return this.setDragState(t,3),this.processDragStartList(t)},processDragStartList:function(t){if(3!==this.getDragState(t))return 0;for(var e=this._drag[t.id],i=0;i1&&(this.sortGameObjects(i,t),this.topOnly&&i.splice(1)),this._drag[t.id]=i,0===this.dragDistanceThreshold&&0===this.dragTimeThreshold?(this.setDragState(t,3),this.processDragStartList(t)):(this.setDragState(t,2),0))},processDragMoveEvent:function(t){if(2===this.getDragState(t)&&this.processDragThresholdEvent(t,this.manager.game.loop.now),4!==this.getDragState(t))return 0;for(var e=this._tempZones,i=this._drag[t.id],s=0;s0?(o.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,o,h),a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h)):(o.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,o,h),e[0]?(a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h)):a.target=null)}else!h&&e[0]&&(a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h));if(o.parentContainer){var u=t.worldX-a.dragStartXGlobal,c=t.worldY-a.dragStartYGlobal,p=o.getParentRotation(),f=u*Math.cos(p)+c*Math.sin(p),v=c*Math.cos(p)-u*Math.sin(p);f*=1/o.parentContainer.scaleX,v*=1/o.parentContainer.scaleY,n=f+a.dragStartX,r=v+a.dragStartY}else n=t.worldX-a.dragX,r=t.worldY-a.dragY;o.emit(d.GAMEOBJECT_DRAG,t,n,r),this.emit(d.DRAG,t,o,n,r)}return i.length},processDragUpEvent:function(t){for(var e=this._drag[t.id],i=0;i0){var r=this.manager,o=this._eventData,a=this._eventContainer;o.cancelled=!1;for(var h=!1,l=0;l0){var n=this.manager,r=this._eventData,o=this._eventContainer;r.cancelled=!1;var a=!1;this.sortGameObjects(e,t);for(var h=0;h0){for(this.sortGameObjects(n,t),e=0;e0){for(this.sortGameObjects(r,t),e=0;e-1&&this._draggable.splice(n,1)}return this},makePixelPerfect:function(t){void 0===t&&(t=1);var e=this.systems.textures;return h(e,t)},setHitArea:function(t,e,i){if(void 0===e)return this.setHitAreaFromTexture(t);Array.isArray(t)||(t=[t]);var s=!1,n=!1,r=!1,o=!1,h=!1,l=!0;if(m(e)){var u=e;e=f(u,"hitArea",null),i=f(u,"hitAreaCallback",null),s=f(u,"draggable",!1),n=f(u,"dropZone",!1),r=f(u,"cursor",!1),o=f(u,"useHandCursor",!1),h=f(u,"pixelPerfect",!1);var c=f(u,"alphaTolerance",1);h&&(e={},i=this.makePixelPerfect(c)),e&&i||(this.setHitAreaFromTexture(t),l=!1)}else"function"!=typeof e||i||(i=e,e={});for(var d=0;d{var s=i(10850),n={},r={register:function(t,e,i,s,r){n[t]={plugin:e,mapping:i,settingsKey:s,configKey:r}},getPlugin:function(t){return n[t]},install:function(t){var e=t.scene.sys,i=e.settings.input,r=e.game.config;for(var o in n){var a=n[o].plugin,h=n[o].mapping,l=n[o].settingsKey,u=n[o].configKey;s(i,l,r[u])&&(t[h]=new a(t))}},remove:function(t){n.hasOwnProperty(t)&&delete n[t]}};t.exports=r},40398:(t,e,i)=>{var s=i(90447),n=i(56694),r=i(53996),o=i(88456),a=i(44521),h=i(93736),l=i(36580),u=new n({initialize:function(t,e){this.manager=t,this.id=e,this.event,this.downElement,this.upElement,this.camera=null,this.button=0,this.buttons=0,this.position=new h,this.prevPosition=new h,this.midPoint=new h(-1,-1),this.velocity=new h,this.angle=0,this.distance=0,this.smoothFactor=0,this.motionFactor=.2,this.worldX=0,this.worldY=0,this.moveTime=0,this.downX=0,this.downY=0,this.downTime=0,this.upX=0,this.upY=0,this.upTime=0,this.primaryDown=!1,this.isDown=!1,this.wasTouch=!1,this.wasCanceled=!1,this.movementX=0,this.movementY=0,this.identifier=0,this.pointerId=null,this.active=0===e,this.locked=!1,this.deltaX=0,this.deltaY=0,this.deltaZ=0},updateWorldPoint:function(t){var e=t.getWorldPoint(this.x,this.y);return this.worldX=e.x,this.worldY=e.y,this},positionToCamera:function(t,e){return t.getWorldPoint(this.x,this.y,e)},updateMotion:function(){var t=this.position.x,e=this.position.y,i=this.midPoint.x,n=this.midPoint.y;if(t!==i||e!==n){var r=a(this.motionFactor,i,t),h=a(this.motionFactor,n,e);o(r,t,.1)&&(r=t),o(h,e,.1)&&(h=e),this.midPoint.set(r,h);var l=t-r,u=e-h;this.velocity.set(l,u),this.angle=s(r,h,t,e),this.distance=Math.sqrt(l*l+u*u)}},up:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!1,this.upX=this.x,this.upY=this.y),0===this.buttons&&(this.isDown=!1,this.upTime=t.timeStamp,this.wasTouch=!1)},down:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!0,this.downX=this.x,this.downY=this.y),l.macOS&&t.ctrlKey&&(this.buttons=2,this.primaryDown=!1),this.isDown||(this.isDown=!0,this.downTime=t.timeStamp),this.wasTouch=!1},move:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.locked&&(this.movementX=t.movementX||t.mozMovementX||t.webkitMovementX||0,this.movementY=t.movementY||t.mozMovementY||t.webkitMovementY||0),this.moveTime=t.timeStamp,this.wasTouch=!1},wheel:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.deltaX=t.deltaX,this.deltaY=t.deltaY,this.deltaZ=t.deltaZ,this.wasTouch=!1},touchstart:function(t,e){t.pointerId&&(this.pointerId=t.pointerId),this.identifier=t.identifier,this.target=t.target,this.active=!0,this.buttons=1,this.event=e,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=e.timeStamp,this.isDown=!0,this.wasTouch=!0,this.wasCanceled=!1,this.updateMotion()},touchmove:function(t,e){this.event=e,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.moveTime=e.timeStamp,this.wasTouch=!0,this.updateMotion()},touchend:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!1,this.active=!1,this.updateMotion()},touchcancel:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!0,this.active=!1},noButtonDown:function(){return 0===this.buttons},leftButtonDown:function(){return!!(1&this.buttons)},rightButtonDown:function(){return!!(2&this.buttons)},middleButtonDown:function(){return!!(4&this.buttons)},backButtonDown:function(){return!!(8&this.buttons)},forwardButtonDown:function(){return!!(16&this.buttons)},leftButtonReleased:function(){return 0===this.button&&!this.isDown},rightButtonReleased:function(){return 2===this.button&&!this.isDown},middleButtonReleased:function(){return 1===this.button&&!this.isDown},backButtonReleased:function(){return 3===this.button&&!this.isDown},forwardButtonReleased:function(){return 4===this.button&&!this.isDown},getDistance:function(){return this.isDown?r(this.downX,this.downY,this.x,this.y):r(this.downX,this.downY,this.upX,this.upY)},getDistanceX:function(){return this.isDown?Math.abs(this.downX-this.x):Math.abs(this.downX-this.upX)},getDistanceY:function(){return this.isDown?Math.abs(this.downY-this.y):Math.abs(this.downY-this.upY)},getDuration:function(){return this.isDown?this.manager.time-this.downTime:this.upTime-this.downTime},getAngle:function(){return this.isDown?s(this.downX,this.downY,this.x,this.y):s(this.downX,this.downY,this.upX,this.upY)},getInterpolatedPosition:function(t,e){void 0===t&&(t=10),void 0===e&&(e=[]);for(var i=this.prevPosition.x,s=this.prevPosition.y,n=this.position.x,r=this.position.y,o=0;o{t.exports={MOUSE_DOWN:0,MOUSE_MOVE:1,MOUSE_UP:2,TOUCH_START:3,TOUCH_MOVE:4,TOUCH_END:5,POINTER_LOCK_CHANGE:6,TOUCH_CANCEL:7,MOUSE_WHEEL:8}},14874:t=>{t.exports="boot"},54168:t=>{t.exports="destroy"},526:t=>{t.exports="dragend"},81623:t=>{t.exports="dragenter"},94472:t=>{t.exports="drag"},9304:t=>{t.exports="dragleave"},34265:t=>{t.exports="dragover"},50151:t=>{t.exports="dragstart"},98134:t=>{t.exports="drop"},56773:t=>{t.exports="gameobjectdown"},45824:t=>{t.exports="dragend"},39578:t=>{t.exports="dragenter"},72072:t=>{t.exports="drag"},82569:t=>{t.exports="dragleave"},70833:t=>{t.exports="dragover"},81442:t=>{t.exports="dragstart"},32936:t=>{t.exports="drop"},99658:t=>{t.exports="gameobjectmove"},60515:t=>{t.exports="gameobjectout"},55254:t=>{t.exports="gameobjectover"},34782:t=>{t.exports="pointerdown"},41769:t=>{t.exports="pointermove"},65588:t=>{t.exports="pointerout"},61640:t=>{t.exports="pointerover"},49342:t=>{t.exports="pointerup"},82662:t=>{t.exports="wheel"},13058:t=>{t.exports="gameobjectup"},52426:t=>{t.exports="gameobjectwheel"},78072:t=>{t.exports="gameout"},1545:t=>{t.exports="gameover"},67137:t=>{t.exports="boot"},27678:t=>{t.exports="process"},22257:t=>{t.exports="update"},90379:t=>{t.exports="pointerlockchange"},88909:t=>{t.exports="pointerdown"},36548:t=>{t.exports="pointerdownoutside"},18483:t=>{t.exports="pointermove"},22355:t=>{t.exports="pointerout"},7997:t=>{t.exports="pointerover"},66318:t=>{t.exports="pointerup"},94812:t=>{t.exports="pointerupoutside"},37310:t=>{t.exports="wheel"},24196:t=>{t.exports="preupdate"},27053:t=>{t.exports="shutdown"},29413:t=>{t.exports="start"},25165:t=>{t.exports="update"},33963:(t,e,i)=>{t.exports={BOOT:i(14874),DESTROY:i(54168),DRAG_END:i(526),DRAG_ENTER:i(81623),DRAG:i(94472),DRAG_LEAVE:i(9304),DRAG_OVER:i(34265),DRAG_START:i(50151),DROP:i(98134),GAME_OUT:i(78072),GAME_OVER:i(1545),GAMEOBJECT_DOWN:i(56773),GAMEOBJECT_DRAG_END:i(45824),GAMEOBJECT_DRAG_ENTER:i(39578),GAMEOBJECT_DRAG:i(72072),GAMEOBJECT_DRAG_LEAVE:i(82569),GAMEOBJECT_DRAG_OVER:i(70833),GAMEOBJECT_DRAG_START:i(81442),GAMEOBJECT_DROP:i(32936),GAMEOBJECT_MOVE:i(99658),GAMEOBJECT_OUT:i(60515),GAMEOBJECT_OVER:i(55254),GAMEOBJECT_POINTER_DOWN:i(34782),GAMEOBJECT_POINTER_MOVE:i(41769),GAMEOBJECT_POINTER_OUT:i(65588),GAMEOBJECT_POINTER_OVER:i(61640),GAMEOBJECT_POINTER_UP:i(49342),GAMEOBJECT_POINTER_WHEEL:i(82662),GAMEOBJECT_UP:i(13058),GAMEOBJECT_WHEEL:i(52426),MANAGER_BOOT:i(67137),MANAGER_PROCESS:i(27678),MANAGER_UPDATE:i(22257),POINTER_DOWN:i(88909),POINTER_DOWN_OUTSIDE:i(36548),POINTER_MOVE:i(18483),POINTER_OUT:i(22355),POINTER_OVER:i(7997),POINTER_UP:i(66318),POINTER_UP_OUTSIDE:i(94812),POINTER_WHEEL:i(37310),POINTERLOCK_CHANGE:i(90379),PRE_UPDATE:i(24196),SHUTDOWN:i(27053),START:i(29413),UPDATE:i(25165)}},70848:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e){this.pad=t,this.events=t.events,this.index=e,this.value=0,this.threshold=.1},update:function(t){this.value=t},getValue:function(){return Math.abs(this.value){var s=i(56694),n=i(43200),r=new s({initialize:function(t,e){this.pad=t,this.events=t.manager,this.index=e,this.value=0,this.threshold=1,this.pressed=!1},update:function(t){this.value=t;var e=this.pad,i=this.index;t>=this.threshold?this.pressed||(this.pressed=!0,this.events.emit(n.BUTTON_DOWN,e,this,t),this.pad.emit(n.GAMEPAD_BUTTON_DOWN,i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit(n.BUTTON_UP,e,this,t),this.pad.emit(n.GAMEPAD_BUTTON_UP,i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=r},75956:(t,e,i)=>{var s=i(70848),n=i(21274),r=i(56694),o=i(6659),a=i(93736),h=new r({Extends:o,initialize:function(t,e){o.call(this),this.manager=t,this.pad=e,this.id=e.id,this.index=e.index;for(var i=[],r=0;r=2&&(this.leftStick.set(r[0].getValue(),r[1].getValue()),n>=4&&this.rightStick.set(r[2].getValue(),r[3].getValue()))}},destroy:function(){var t;for(this.removeAllListeners(),this.manager=null,this.pad=null,t=0;t{var s=i(56694),n=i(6659),r=i(43200),o=i(75956),a=i(10850),h=i(63399),l=i(33963),u=new s({Extends:n,initialize:function(t){n.call(this),this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.enabled=!0,this.target,this.gamepads=[],this.queue=[],this.onGamepadHandler,this._pad1,this._pad2,this._pad3,this._pad4,t.pluginEvents.once(l.BOOT,this.boot,this),t.pluginEvents.on(l.START,this.start,this)},boot:function(){var t=this.scene.sys.game,e=this.settings.input,i=t.config;this.enabled=a(e,"gamepad",i.inputGamepad)&&t.device.input.gamepads,this.target=a(e,"gamepad.target",i.inputGamepadEventTarget),this.sceneInputPlugin.pluginEvents.once(l.DESTROY,this.destroy,this)},start:function(){this.enabled&&(this.startListeners(),this.refreshPads()),this.sceneInputPlugin.pluginEvents.once(l.SHUTDOWN,this.shutdown,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},startListeners:function(){var t=this,e=this.target,i=function(e){!e.defaultPrevented&&t.isActive()&&(t.refreshPads(),t.queue.push(e))};this.onGamepadHandler=i,e.addEventListener("gamepadconnected",i,!1),e.addEventListener("gamepaddisconnected",i,!1),this.sceneInputPlugin.pluginEvents.on(l.UPDATE,this.update,this)},stopListeners:function(){this.target.removeEventListener("gamepadconnected",this.onGamepadHandler),this.target.removeEventListener("gamepaddisconnected",this.onGamepadHandler),this.sceneInputPlugin.pluginEvents.off(l.UPDATE,this.update);for(var t=0;t{t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,SELECT:8,START:9,B:0,A:1,Y:2,X:3,LEFT_SHOULDER:4,RIGHT_SHOULDER:5}},74982:t=>{t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,SHARE:8,OPTIONS:9,PS:16,TOUCHBAR:17,X:0,CIRCLE:1,SQUARE:2,TRIANGLE:3,L1:4,R1:5,L2:6,R2:7,L3:10,R3:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}},43247:t=>{t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,MENU:16,A:0,B:1,X:2,Y:3,LB:4,RB:5,LT:6,RT:7,BACK:8,START:9,LS:10,RS:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}},4898:(t,e,i)=>{t.exports={DUALSHOCK_4:i(74982),SNES_USB:i(33171),XBOX_360:i(43247)}},17344:t=>{t.exports="down"},36635:t=>{t.exports="up"},85724:t=>{t.exports="connected"},55832:t=>{t.exports="disconnected"},772:t=>{t.exports="down"},33608:t=>{t.exports="up"},43200:(t,e,i)=>{t.exports={BUTTON_DOWN:i(17344),BUTTON_UP:i(36635),CONNECTED:i(85724),DISCONNECTED:i(55832),GAMEPAD_BUTTON_DOWN:i(772),GAMEPAD_BUTTON_UP:i(33608)}},92636:(t,e,i)=>{t.exports={Axis:i(70848),Button:i(21274),Events:i(43200),Gamepad:i(75956),GamepadPlugin:i(1379),Configs:i(4898)}},20873:(t,e,i)=>{var s=i(72687),n=i(98611),r={CreatePixelPerfectHandler:i(18104),CreateInteractiveObject:i(27395),Events:i(33963),Gamepad:i(92636),InputManager:i(69898),InputPlugin:i(12499),InputPluginCache:i(63399),Keyboard:i(28388),Mouse:i(11343),Pointer:i(40398),Touch:i(77423)};r=n(!1,r,s),t.exports=r},71064:(t,e,i)=>{var s=i(66458),n=i(56694),r=i(97081),o=i(33963),a=i(11873),h=i(72283),l=new n({initialize:function(t){this.manager=t,this.queue=[],this.preventDefault=!0,this.captures=[],this.enabled=!1,this.target,this.onKeyDown=h,this.onKeyUp=h,t.events.once(o.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputKeyboard,this.target=t.inputKeyboardEventTarget,this.addCapture(t.inputKeyboardCapture),!this.target&&window&&(this.target=window),this.enabled&&this.target&&this.startListeners(),this.manager.game.events.on(r.POST_STEP,this.postUpdate,this)},startListeners:function(){var t=this;this.onKeyDown=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.events.emit(o.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}},this.onKeyUp=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.events.emit(o.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}};var e=this.target;e&&(e.addEventListener("keydown",this.onKeyDown,!1),e.addEventListener("keyup",this.onKeyUp,!1),this.enabled=!0)},stopListeners:function(){var t=this.target;t.removeEventListener("keydown",this.onKeyDown,!1),t.removeEventListener("keyup",this.onKeyUp,!1),this.enabled=!1},postUpdate:function(){this.queue=[]},addCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},removeCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},clearCaptures:function(){this.captures=[],this.preventDefault=!1},destroy:function(){this.stopListeners(),this.clearCaptures(),this.queue=[],this.manager.game.events.off(r.POST_RENDER,this.postUpdate,this),this.target=null,this.enabled=!1,this.manager=null}});t.exports=l},89666:(t,e,i)=>{var s=i(56694),n=i(6659),r=i(94030),o=i(97081),a=i(10850),h=i(33963),l=i(63399),u=i(50165),c=i(11873),d=i(95625),p=i(48044),f=i(7599),v=i(84314),g=new s({Extends:n,initialize:function(t){n.call(this),this.game=t.systems.game,this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.manager=t.manager.keyboard,this.enabled=!0,this.keys=[],this.combos=[],this.prevCode=null,this.prevTime=0,this.prevType=null,t.pluginEvents.once(h.BOOT,this.boot,this),t.pluginEvents.on(h.START,this.start,this)},boot:function(){var t=this.settings.input;this.enabled=a(t,"keyboard",!0);var e=a(t,"keyboard.capture",null);e&&this.addCaptures(e),this.sceneInputPlugin.pluginEvents.once(h.DESTROY,this.destroy,this)},start:function(){this.sceneInputPlugin.manager.events.on(h.MANAGER_PROCESS,this.update,this),this.sceneInputPlugin.pluginEvents.once(h.SHUTDOWN,this.shutdown,this),this.game.events.on(o.BLUR,this.resetKeys,this),this.scene.sys.events.on(f.PAUSE,this.resetKeys,this),this.scene.sys.events.on(f.SLEEP,this.resetKeys,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},addCapture:function(t){return this.manager.addCapture(t),this},removeCapture:function(t){return this.manager.removeCapture(t),this},getCaptures:function(){return this.manager.captures},enableGlobalCapture:function(){return this.manager.preventDefault=!0,this},disableGlobalCapture:function(){return this.manager.preventDefault=!1,this},clearCaptures:function(){return this.manager.clearCaptures(),this},createCursorKeys:function(){return this.addKeys({up:c.UP,down:c.DOWN,left:c.LEFT,right:c.RIGHT,space:c.SPACE,shift:c.SHIFT})},addKeys:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1);var s={};if("string"==typeof t){t=t.split(",");for(var n=0;n-1?s[n]=t:s[t.keyCode]=t,e&&this.addCapture(t.keyCode),t.setEmitOnRepeat(i),t}return"string"==typeof t&&(t=c[t.toUpperCase()]),s[t]||(s[t]=new u(this,t),e&&this.addCapture(t),s[t].setEmitOnRepeat(i)),s[t]},removeKey:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var s,n=this.keys;if(t instanceof u){var r=n.indexOf(t);r>-1&&(s=this.keys[r],this.keys[r]=void 0)}else"string"==typeof t&&(t=c[t.toUpperCase()]);return n[t]&&(s=n[t],n[t]=void 0),s&&(s.plugin=null,i&&this.removeCapture(s.keyCode),e&&s.destroy()),this},removeAllKeys:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);for(var i=this.keys,s=0;st._tick)return t._tick=i,!0}return!1},update:function(){var t=this.manager.queue,e=t.length;if(this.isActive()&&0!==e)for(var i=this.keys,s=0;s{t.exports=function(t,e){return e.timeLastMatched=t.timeStamp,e.index++,e.index===e.size||(e.current=e.keyCodes[e.index],!1)}},95625:(t,e,i)=>{var s=i(56694),n=i(94030),r=i(72632),o=i(2544),a=i(88754),h=new s({initialize:function(t,e,i){if(void 0===i&&(i={}),e.length<2)return!1;this.manager=t,this.enabled=!0,this.keyCodes=[];for(var s=0;s{var s=i(60258);t.exports=function(t,e){if(e.matched)return!0;var i=!1,n=!1;if(t.keyCode===e.current)if(e.index>0&&e.maxKeyDelay>0){var r=e.timeLastMatched+e.maxKeyDelay;t.timeStamp<=r&&(n=!0,i=s(t,e))}else n=!0,i=s(t,e);return!n&&e.resetOnWrongKey&&(e.index=0,e.current=e.keyCodes[0]),i&&(e.timeLastMatched=t.timeStamp,e.matched=!0,e.timeMatched=t.timeStamp),i}},88754:t=>{t.exports=function(t){return t.current=t.keyCodes[0],t.index=0,t.timeLastMatched=0,t.matched=!1,t.timeMatched=0,t}},5044:t=>{t.exports="keydown"},40813:t=>{t.exports="keyup"},89319:t=>{t.exports="keycombomatch"},76362:t=>{t.exports="down"},78595:t=>{t.exports="keydown-"},30056:t=>{t.exports="keyup-"},81939:t=>{t.exports="up"},94030:(t,e,i)=>{t.exports={ANY_KEY_DOWN:i(5044),ANY_KEY_UP:i(40813),COMBO_MATCH:i(89319),DOWN:i(76362),KEY_DOWN:i(78595),KEY_UP:i(30056),UP:i(81939)}},28388:(t,e,i)=>{t.exports={Events:i(94030),KeyboardManager:i(71064),KeyboardPlugin:i(89666),Key:i(50165),KeyCodes:i(11873),KeyCombo:i(95625),AdvanceKeyCombo:i(60258),ProcessKeyCombo:i(2544),ResetKeyCombo:i(88754),JustDown:i(42460),JustUp:i(53162),DownDuration:i(64964),UpDuration:i(70331)}},64964:t=>{t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeDown;return t.isDown&&i{t.exports=function(t){return!!t._justDown&&(t._justDown=!1,!0)}},53162:t=>{t.exports=function(t){return!!t._justUp&&(t._justUp=!1,!0)}},50165:(t,e,i)=>{var s=i(56694),n=i(6659),r=i(94030),o=new s({Extends:n,initialize:function(t,e){n.call(this),this.plugin=t,this.keyCode=e,this.originalEvent=void 0,this.enabled=!0,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.metaKey=!1,this.location=0,this.timeDown=0,this.duration=0,this.timeUp=0,this.emitOnRepeat=!1,this.repeats=0,this._justDown=!1,this._justUp=!1,this._tick=-1},setEmitOnRepeat:function(t){return this.emitOnRepeat=t,this},onDown:function(t){this.originalEvent=t,this.enabled&&(this.altKey=t.altKey,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.metaKey=t.metaKey,this.location=t.location,this.repeats++,this.isDown?this.emitOnRepeat&&this.emit(r.DOWN,this,t):(this.isDown=!0,this.isUp=!1,this.timeDown=t.timeStamp,this.duration=0,this._justDown=!0,this._justUp=!1,this.emit(r.DOWN,this,t)))},onUp:function(t){this.originalEvent=t,this.enabled&&(this.isDown=!1,this.isUp=!0,this.timeUp=t.timeStamp,this.duration=this.timeUp-this.timeDown,this.repeats=0,this._justDown=!1,this._justUp=!0,this._tick=-1,this.emit(r.UP,this,t))},reset:function(){return this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.metaKey=!1,this.timeDown=0,this.duration=0,this.timeUp=0,this.repeats=0,this._justDown=!1,this._justUp=!1,this._tick=-1,this},getDuration:function(){return this.isDown?this.plugin.game.loop.time-this.timeDown:0},destroy:function(){this.removeAllListeners(),this.originalEvent=null,this.plugin=null}});t.exports=o},11873:t=>{t.exports={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:42,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,NUMPAD_ZERO:96,NUMPAD_ONE:97,NUMPAD_TWO:98,NUMPAD_THREE:99,NUMPAD_FOUR:100,NUMPAD_FIVE:101,NUMPAD_SIX:102,NUMPAD_SEVEN:103,NUMPAD_EIGHT:104,NUMPAD_NINE:105,NUMPAD_ADD:107,NUMPAD_SUBTRACT:109,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,SEMICOLON:186,PLUS:187,COMMA:188,MINUS:189,PERIOD:190,FORWARD_SLASH:191,BACK_SLASH:220,QUOTES:222,BACKTICK:192,OPEN_BRACKET:219,CLOSED_BRACKET:221,SEMICOLON_FIREFOX:59,COLON:58,COMMA_FIREFOX_WINDOWS:60,COMMA_FIREFOX:62,BRACKET_RIGHT_FIREFOX:174,BRACKET_LEFT_FIREFOX:175}},48044:(t,e,i)=>{var s=i(11873),n={};for(var r in s)n[s[r]]=r;t.exports=n},70331:t=>{t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeUp;return t.isUp&&i{var s=i(56694),n=i(90185),r=i(33963),o=i(72283),a=new s({initialize:function(t){this.manager=t,this.preventDefaultDown=!0,this.preventDefaultUp=!0,this.preventDefaultMove=!0,this.preventDefaultWheel=!1,this.enabled=!1,this.target,this.locked=!1,this.onMouseMove=o,this.onMouseDown=o,this.onMouseUp=o,this.onMouseDownWindow=o,this.onMouseUpWindow=o,this.onMouseOver=o,this.onMouseOut=o,this.onMouseWheel=o,this.pointerLockChange=o,this.isTop=!0,t.events.once(r.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputMouse,this.target=t.inputMouseEventTarget,this.passive=t.inputMousePassive,this.preventDefaultDown=t.inputMousePreventDefaultDown,this.preventDefaultUp=t.inputMousePreventDefaultUp,this.preventDefaultMove=t.inputMousePreventDefaultMove,this.preventDefaultWheel=t.inputMousePreventDefaultWheel,this.target?"string"==typeof this.target&&(this.target=document.getElementById(this.target)):this.target=this.manager.game.canvas,t.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return this.target.addEventListener("contextmenu",(function(t){return t.preventDefault(),!1})),this},requestPointerLock:function(){if(n.pointerLock){var t=this.target;t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock||t.webkitRequestPointerLock,t.requestPointerLock()}},releasePointerLock:function(){n.pointerLock&&(document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,document.exitPointerLock())},startListeners:function(){var t=this.target;if(t){var e=this,i=this.manager,s=i.canvas,r=window&&window.focus&&i.game.config.autoFocus;this.onMouseMove=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onMouseMove(t),e.preventDefaultMove&&t.preventDefault())},this.onMouseDown=function(t){r&&window.focus(),!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onMouseDown(t),e.preventDefaultDown&&t.target===s&&t.preventDefault())},this.onMouseDownWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==s&&i.onMouseDown(t)},this.onMouseUp=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onMouseUp(t),e.preventDefaultUp&&t.target===s&&t.preventDefault())},this.onMouseUpWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==s&&i.onMouseUp(t)},this.onMouseOver=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.setCanvasOver(t)},this.onMouseOut=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.setCanvasOut(t)},this.onMouseWheel=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.onMouseWheel(t),e.preventDefaultWheel&&t.target===s&&t.preventDefault()};var o={passive:!0};if(t.addEventListener("mousemove",this.onMouseMove),t.addEventListener("mousedown",this.onMouseDown),t.addEventListener("mouseup",this.onMouseUp),t.addEventListener("mouseover",this.onMouseOver,o),t.addEventListener("mouseout",this.onMouseOut,o),this.preventDefaultWheel?t.addEventListener("wheel",this.onMouseWheel,{passive:!1}):t.addEventListener("wheel",this.onMouseWheel,o),window&&i.game.config.inputWindowEvents)try{window.top.addEventListener("mousedown",this.onMouseDownWindow,o),window.top.addEventListener("mouseup",this.onMouseUpWindow,o)}catch(t){window.addEventListener("mousedown",this.onMouseDownWindow,o),window.addEventListener("mouseup",this.onMouseUpWindow,o),this.isTop=!1}n.pointerLock&&(this.pointerLockChange=function(t){var s=e.target;e.locked=document.pointerLockElement===s||document.mozPointerLockElement===s||document.webkitPointerLockElement===s,i.onPointerLockChange(t)},document.addEventListener("pointerlockchange",this.pointerLockChange,!0),document.addEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.addEventListener("webkitpointerlockchange",this.pointerLockChange,!0)),this.enabled=!0}},stopListeners:function(){var t=this.target;t.removeEventListener("mousemove",this.onMouseMove),t.removeEventListener("mousedown",this.onMouseDown),t.removeEventListener("mouseup",this.onMouseUp),t.removeEventListener("mouseover",this.onMouseOver),t.removeEventListener("mouseout",this.onMouseOut),window&&((t=this.isTop?window.top:window).removeEventListener("mousedown",this.onMouseDownWindow),t.removeEventListener("mouseup",this.onMouseUpWindow)),n.pointerLock&&(document.removeEventListener("pointerlockchange",this.pointerLockChange,!0),document.removeEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.removeEventListener("webkitpointerlockchange",this.pointerLockChange,!0))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});t.exports=a},11343:(t,e,i)=>{t.exports={MouseManager:i(7905)}},37579:(t,e,i)=>{var s=i(56694),n=i(33963),r=i(72283),o=new s({initialize:function(t){this.manager=t,this.capture=!0,this.enabled=!1,this.target,this.onTouchStart=r,this.onTouchStartWindow=r,this.onTouchMove=r,this.onTouchEnd=r,this.onTouchEndWindow=r,this.onTouchCancel=r,this.onTouchCancelWindow=r,this.isTop=!0,t.events.once(n.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputTouch,this.target=t.inputTouchEventTarget,this.capture=t.inputTouchCapture,this.target?"string"==typeof this.target&&(this.target=document.getElementById(this.target)):this.target=this.manager.game.canvas,t.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return this.target.addEventListener("contextmenu",(function(t){return t.preventDefault(),!1})),this},startListeners:function(){var t=this.target;if(t){var e=this,i=this.manager,s=i.canvas,n=window&&window.focus&&i.game.config.autoFocus;this.onTouchMove=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onTouchMove(t),e.capture&&t.cancelable&&t.preventDefault())},this.onTouchStart=function(t){n&&window.focus(),!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onTouchStart(t),e.capture&&t.cancelable&&t.target===s&&t.preventDefault())},this.onTouchStartWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==s&&i.onTouchStart(t)},this.onTouchEnd=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onTouchEnd(t),e.capture&&t.cancelable&&t.target===s&&t.preventDefault())},this.onTouchEndWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==s&&i.onTouchEnd(t)},this.onTouchCancel=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onTouchCancel(t),e.capture&&t.preventDefault())},this.onTouchCancelWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.onTouchCancel(t)};var r=this.capture,o={passive:!0},a={passive:!1};if(t.addEventListener("touchstart",this.onTouchStart,r?a:o),t.addEventListener("touchmove",this.onTouchMove,r?a:o),t.addEventListener("touchend",this.onTouchEnd,r?a:o),t.addEventListener("touchcancel",this.onTouchCancel,r?a:o),window&&i.game.config.inputWindowEvents)try{window.top.addEventListener("touchstart",this.onTouchStartWindow,a),window.top.addEventListener("touchend",this.onTouchEndWindow,a),window.top.addEventListener("touchcancel",this.onTouchCancelWindow,a)}catch(t){window.addEventListener("touchstart",this.onTouchStartWindow,a),window.addEventListener("touchend",this.onTouchEndWindow,a),window.addEventListener("touchcancel",this.onTouchCancelWindow,a),this.isTop=!1}this.enabled=!0}},stopListeners:function(){var t=this.target;t.removeEventListener("touchstart",this.onTouchStart),t.removeEventListener("touchmove",this.onTouchMove),t.removeEventListener("touchend",this.onTouchEnd),t.removeEventListener("touchcancel",this.onTouchCancel),window&&((t=this.isTop?window.top:window).removeEventListener("touchstart",this.onTouchStartWindow),t.removeEventListener("touchend",this.onTouchEndWindow),t.removeEventListener("touchcancel",this.onTouchCancelWindow))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});t.exports=o},77423:(t,e,i)=>{t.exports={TouchManager:i(37579)}},98035:(t,e,i)=>{var s=i(56694),n=i(12117),r=i(683),o=i(72632),a=i(30750),h=i(43531),l=i(88490),u=i(33868),c=new s({initialize:function(t,e){if(this.loader=t,this.cache=o(e,"cache",!1),this.type=o(e,"type",!1),!this.type)throw new Error("Invalid File type: "+this.type);this.key=o(e,"key",!1);var i=this.key;if(t.prefix&&""!==t.prefix&&(this.key=t.prefix+i),!this.key)throw new Error("Invalid File key: "+this.key);var s=o(e,"url");void 0===s?s=t.path+i+"."+o(e,"extension",""):"string"!=typeof s||s.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)||(s=t.path+s),this.url=s,this.src="",this.xhrSettings=u(o(e,"responseType",void 0)),o(e,"xhrSettings",!1)&&(this.xhrSettings=h(this.xhrSettings,o(e,"xhrSettings",{}))),this.xhrLoader=null,this.state="function"==typeof this.url?n.FILE_POPULATED:n.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=o(e,"config",{}),this.multiFile,this.linkFile},setLink:function(t){this.linkFile=t,t.linkFile=this},resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){this.state===n.FILE_POPULATED?this.loader.nextFile(this,!0):(this.state=n.FILE_LOADING,this.src=a(this,this.loader.baseURL),0===this.src.indexOf("data:")?console.warn("Local data URIs are not supported: "+this.key):this.xhrLoader=l(this,this.loader.xhr))},onLoad:function(t,e){var i=t.responseURL&&this.loader.localSchemes.some((function(e){return 0===t.responseURL.indexOf(e)}))&&0===e.target.status,s=!(e.target&&200!==e.target.status)||i;4===t.readyState&&t.status>=400&&t.status<=599&&(s=!1),this.state=n.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,s)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(r.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=n.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=n.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){console.error('Failed to process file: %s "%s"',this.type,this.key),this.state=n.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.data&&this.cache.add(this.key,this.data)},pendingDestroy:function(t){if(this.state!==n.FILE_PENDING_DESTROY){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit(r.FILE_COMPLETE,e,i,t),this.loader.emit(r.FILE_KEY_COMPLETE+i+"-"+e,e,i,t),this.loader.flagForRemoval(this),this.state=n.FILE_PENDING_DESTROY}},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});c.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var s=new FileReader;s.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+s.result.split(",")[1]},s.onerror=t.onerror,s.readAsDataURL(e)}},c.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=c},76846:t=>{var e={},i={install:function(t){for(var i in e)t[i]=e[i]},register:function(t,i){e[t]=i},destroy:function(){e={}}};t.exports=i},30750:t=>{t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},67285:(t,e,i)=>{var s=i(56694),n=i(12117),r=i(58403),o=i(6659),a=i(683),h=i(76846),l=i(72632),u=i(10850),c=i(91963),d=i(7599),p=i(33868),f=new s({Extends:o,initialize:function(t){o.call(this);var e=t.sys.game.config,i=t.sys.settings.loader;this.scene=t,this.systems=t.sys,this.cacheManager=t.sys.cache,this.textureManager=t.sys.textures,this.sceneManager=t.sys.game.scene,h.install(this),this.prefix="",this.path="",this.baseURL="",this.setBaseURL(l(i,"baseURL",e.loaderBaseURL)),this.setPath(l(i,"path",e.loaderPath)),this.setPrefix(l(i,"prefix",e.loaderPrefix)),this.maxParallelDownloads=l(i,"maxParallelDownloads",e.loaderMaxParallelDownloads),this.xhr=p(l(i,"responseType",e.loaderResponseType),l(i,"async",e.loaderAsync),l(i,"user",e.loaderUser),l(i,"password",e.loaderPassword),l(i,"timeout",e.loaderTimeout),l(i,"withCredentials",e.loaderWithCredentials)),this.crossOrigin=l(i,"crossOrigin",e.loaderCrossOrigin),this.imageLoadType=l(i,"imageLoadType",e.loaderImageLoadType),this.localSchemes=l(i,"localScheme",e.loaderLocalScheme),this.totalToLoad=0,this.progress=0,this.list=new r,this.inflight=new r,this.queue=new r,this._deleteQueue=new r,this.totalFailed=0,this.totalComplete=0,this.state=n.LOADER_IDLE,this.multiKeyIndex=0,t.sys.events.once(d.BOOT,this.boot,this),t.sys.events.on(d.START,this.pluginStart,this)},boot:function(){this.systems.events.once(d.DESTROY,this.destroy,this)},pluginStart:function(){this.systems.events.once(d.SHUTDOWN,this.shutdown,this)},setBaseURL:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.baseURL=t,this},setPath:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.path=t,this},setPrefix:function(t){return void 0===t&&(t=""),this.prefix=t,this},setCORS:function(t){return this.crossOrigin=t,this},addFile:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e0},isLoading:function(){return this.state===n.LOADER_LOADING||this.state===n.LOADER_PROCESSING},isReady:function(){return this.state===n.LOADER_IDLE||this.state===n.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit(a.START,this),0===this.list.size?this.loadComplete():(this.state=n.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on(d.UPDATE,this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit(a.PROGRESS,this.progress)},update:function(){this.state===n.LOADER_LOADING&&this.list.size>0&&this.inflight.size{var s=i(98611),n=i(33868);t.exports=function(t,e){var i=void 0===t?n():s({},t);if(e)for(var r in e)void 0!==e[r]&&(i[r]=e[r]);return i}},45176:(t,e,i)=>{var s=i(56694),n=i(12117),r=i(683),o=new s({initialize:function(t,e,i,s){var r=[];s.forEach((function(t){t&&r.push(t)})),this.loader=t,this.type=e,this.key=i,this.multiKeyIndex=t.multiKeyIndex++,this.files=r,this.state=n.FILE_PENDING,this.complete=!1,this.pending=r.length,this.failed=0,this.config={},this.baseURL=t.baseURL,this.path=t.path,this.prefix=t.prefix;for(var o=0;o{var s=i(43531);t.exports=function(t,e){var i=s(e,t.xhrSettings),n=new XMLHttpRequest;if(n.open("GET",t.src,i.async,i.user,i.password),n.responseType=t.xhrSettings.responseType,n.timeout=i.timeout,i.headers)for(var r in i.headers)n.setRequestHeader(r,i.headers[r]);return i.header&&i.headerValue&&n.setRequestHeader(i.header,i.headerValue),i.requestedWith&&n.setRequestHeader("X-Requested-With",i.requestedWith),i.overrideMimeType&&n.overrideMimeType(i.overrideMimeType),i.withCredentials&&(n.withCredentials=!0),n.onload=t.onLoad.bind(t,n),n.onerror=t.onError.bind(t,n),n.onprogress=t.onProgress.bind(t),n.send(),n}},33868:t=>{t.exports=function(t,e,i,s,n,r){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===s&&(s=""),void 0===n&&(n=0),void 0===r&&(r=!1),{responseType:t,async:e,user:i,password:s,timeout:n,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:r}}},12117:t=>{t.exports={LOADER_IDLE:0,LOADER_LOADING:1,LOADER_PROCESSING:2,LOADER_COMPLETE:3,LOADER_SHUTDOWN:4,LOADER_DESTROYED:5,FILE_PENDING:10,FILE_LOADING:11,FILE_LOADED:12,FILE_FAILED:13,FILE_PROCESSING:14,FILE_ERRORED:16,FILE_COMPLETE:17,FILE_DESTROYED:18,FILE_POPULATED:19,FILE_PENDING_DESTROY:20}},7398:t=>{t.exports="addfile"},52187:t=>{t.exports="complete"},36627:t=>{t.exports="filecomplete"},81925:t=>{t.exports="filecomplete-"},29774:t=>{t.exports="loaderror"},20943:t=>{t.exports="load"},74693:t=>{t.exports="fileprogress"},71176:t=>{t.exports="postprocess"},88984:t=>{t.exports="progress"},72753:t=>{t.exports="start"},683:(t,e,i)=>{t.exports={ADD:i(7398),COMPLETE:i(52187),FILE_COMPLETE:i(36627),FILE_KEY_COMPLETE:i(81925),FILE_LOAD_ERROR:i(29774),FILE_LOAD:i(20943),FILE_PROGRESS:i(74693),POST_PROCESS:i(71176),PROGRESS:i(88984),START:i(72753)}},46468:(t,e,i)=>{var s=i(56694),n=i(76846),r=i(70806),o=i(683),a=new s({Extends:r,initialize:function(t,e,i,s,n){r.call(this,t,e,i,s,n),this.type="animationJSON"},onProcess:function(){this.loader.once(o.POST_PROCESS,this.onLoadComplete,this),r.prototype.onProcess.call(this)},onLoadComplete:function(){this.loader.systems.anims.fromJSON(this.data)}});n.register("animation",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(76846),r=i(72632),o=i(42927),a=i(42911),h=i(70806),l=i(45176),u=new s({Extends:l,initialize:function(t,e,i,s,n,u){var c,d;if(a(e)){var p=e;e=r(p,"key"),c=new o(t,{key:e,url:r(p,"textureURL"),extension:r(p,"textureExtension","png"),normalMap:r(p,"normalMap"),xhrSettings:r(p,"textureXhrSettings")}),d=new h(t,{key:e,url:r(p,"atlasURL"),extension:r(p,"atlasExtension","json"),xhrSettings:r(p,"atlasXhrSettings")})}else c=new o(t,e,i,n),d=new h(t,e,s,u);c.linkFile?l.call(this,t,"atlasjson",e,[c,d,c.linkFile]):l.call(this,t,"atlasjson",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(t.key,t.data,e.data,i),e.addToCache(),this.complete=!0}}});n.register("aseprite",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var o=0;o{var s=i(56694),n=i(76846),r=i(72632),o=i(42927),a=i(42911),h=i(70806),l=i(45176),u=new s({Extends:l,initialize:function(t,e,i,s,n,u){var c,d;if(a(e)){var p=e;e=r(p,"key"),c=new o(t,{key:e,url:r(p,"textureURL"),extension:r(p,"textureExtension","png"),normalMap:r(p,"normalMap"),xhrSettings:r(p,"textureXhrSettings")}),d=new h(t,{key:e,url:r(p,"atlasURL"),extension:r(p,"atlasExtension","json"),xhrSettings:r(p,"atlasXhrSettings")})}else c=new o(t,e,i,n),d=new h(t,e,s,u);c.linkFile?l.call(this,t,"atlasjson",e,[c,d,c.linkFile]):l.call(this,t,"atlasjson",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(t.key,t.data,e.data,i),this.complete=!0}}});n.register("atlas",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var o=0;o{var s=i(56694),n=i(76846),r=i(72632),o=i(42927),a=i(42911),h=i(45176),l=i(15297),u=new s({Extends:h,initialize:function(t,e,i,s,n,u){var c,d;if(a(e)){var p=e;e=r(p,"key"),c=new o(t,{key:e,url:r(p,"textureURL"),extension:r(p,"textureExtension","png"),normalMap:r(p,"normalMap"),xhrSettings:r(p,"textureXhrSettings")}),d=new l(t,{key:e,url:r(p,"atlasURL"),extension:r(p,"atlasExtension","xml"),xhrSettings:r(p,"atlasXhrSettings")})}else c=new o(t,e,i,n),d=new l(t,e,s,u);c.linkFile?h.call(this,t,"atlasxml",e,[c,d,c.linkFile]):h.call(this,t,"atlasxml",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlasXML(t.key,t.data,e.data,i),this.complete=!0}}});n.register("atlasXML",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var o=0;o{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(30929),l=i(42911),u=new s({Extends:r,initialize:function(t,e,i,s,n){if(l(e)){var o=e;e=a(o,"key"),s=a(o,"xhrSettings"),n=a(o,"context",n)}var h={type:"audio",cache:t.cacheManager.audio,extension:i.type,responseType:"arraybuffer",key:e,url:i.url,xhrSettings:s,config:{context:n}};r.call(this,t,h)},onProcess:function(){this.state=n.FILE_PROCESSING;var t=this;this.config.context.decodeAudioData(this.xhrLoader.response,(function(e){t.data=e,t.onProcessComplete()}),(function(e){console.error("Error decoding audio: "+t.key+" - ",e?e.message:null),t.onProcessError()})),this.config.context=null}});u.create=function(t,e,i,s,n){var r=t.systems.game,o=r.config.audio,c=r.device.audio;l(e)&&(i=a(e,"url",[]),s=a(e,"config",{}));var d=u.getAudioURL(r,i);return d?c.webAudio&&!o.disableWebAudio?new u(t,e,d,n,r.sound.context):new h(t,e,d,s):null},u.getAudioURL=function(t,e){Array.isArray(e)||(e=[e]);for(var i=0;i{var s=i(67448),n=i(56694),r=i(76846),o=i(72632),a=i(42911),h=i(70806),l=i(45176),u=new n({Extends:l,initialize:function(t,e,i,n,r,u,c){if(a(e)){var d=e;e=o(d,"key"),i=o(d,"jsonURL"),n=o(d,"audioURL"),r=o(d,"audioConfig"),u=o(d,"audioXhrSettings"),c=o(d,"jsonXhrSettings")}var p;if(n){var f=s.create(t,e,n,r,u);f&&(p=new h(t,e,i,c),l.call(this,t,"audiosprite",e,[f,p]),this.config.resourceLoad=!1)}else p=new h(t,e,i,c),l.call(this,t,"audiosprite",e,[p]),this.config.resourceLoad=!0,this.config.audioConfig=r,this.config.audioXhrSettings=u},onFileComplete:function(t){if(-1!==this.files.indexOf(t)&&(this.pending--,this.config.resourceLoad&&"json"===t.type&&t.data.hasOwnProperty("resources"))){var e=t.data.resources,i=o(this.config,"audioConfig"),n=o(this.config,"audioXhrSettings"),r=s.create(this.loader,t.key,e,i,n);r&&(this.addToMultiFile(r),this.loader.addFile(r))}},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1];t.addToCache(),e.addToCache(),this.complete=!0}}});r.register("audioSprite",(function(t,e,i,s,n,r){var o,a=this.systems.game,h=a.config.audio,l=a.device.audio;if(h&&h.noAudio||!l.webAudio&&!l.audioData)return this;if(Array.isArray(t))for(var c=0;c{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s,n){var o="bin";if(h(e)){var l=e;e=a(l,"key"),i=a(l,"url"),s=a(l,"xhrSettings"),o=a(l,"extension",o),n=a(l,"dataType",n)}var u={type:"binary",cache:t.cacheManager.binary,extension:o,responseType:"arraybuffer",key:e,url:i,xhrSettings:s,config:{dataType:n}};r.call(this,t,u)},onProcess:function(){this.state=n.FILE_PROCESSING;var t=this.config.dataType;this.data=t?new t(this.xhrLoader.response):this.xhrLoader.response,this.onProcessComplete()}});o.register("binary",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(76846),r=i(72632),o=i(42927),a=i(42911),h=i(45176),l=i(31476),u=i(15297),c=new s({Extends:h,initialize:function(t,e,i,s,n,l){var c,d;if(a(e)){var p=e;e=r(p,"key"),c=new o(t,{key:e,url:r(p,"textureURL"),extension:r(p,"textureExtension","png"),normalMap:r(p,"normalMap"),xhrSettings:r(p,"textureXhrSettings")}),d=new u(t,{key:e,url:r(p,"fontDataURL"),extension:r(p,"fontDataExtension","xml"),xhrSettings:r(p,"fontDataXhrSettings")})}else c=new o(t,e,i,n),d=new u(t,e,s,l);c.linkFile?h.call(this,t,"bitmapfont",e,[c,d,c.linkFile]):h.call(this,t,"bitmapfont",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1];t.addToCache();var i=t.cache.get(t.key),s=l(e.data,t.cache.getFrame(t.key),0,0,i);this.loader.cacheManager.bitmapFont.add(t.key,{data:s,texture:t.key,frame:null}),this.complete=!0}}});n.register("bitmapFont",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var o=0;o{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s){var n="css";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),s=a(o,"xhrSettings"),n=a(o,"extension",n)}var l={type:"script",cache:!1,extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,l)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=document.createElement("style"),this.data.defer=!1,this.data.innerHTML=this.xhrLoader.responseText,document.head.appendChild(this.data),this.onProcessComplete()}});o.register("css",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(73152),n=i(40612),r=i(56694),o=i(76846),a=i(72632),h=i(42927),l=i(42911),u=i(70806),c=i(67409),d=i(30657),p=i(80802),f=i(45176),v=i(24904),g=new r({Extends:f,initialize:function(t,e,i,s){if(i.multiAtlasURL){var r=new u(t,{key:e,url:i.multiAtlasURL,xhrSettings:s,config:i});f.call(this,t,"texture",e,[r])}else{var o=i.textureURL.substr(i.textureURL.length-3);i.type||(i.type="ktx"===o.toLowerCase()?"KTX":"PVR");var a=new n(t,{key:e,url:i.textureURL,extension:o,xhrSettings:s,config:i});if(i.atlasURL){var h=new u(t,{key:e,url:i.atlasURL,xhrSettings:s,config:i});f.call(this,t,"texture",e,[a,h])}else f.call(this,t,"texture",e,[a])}this.config=i},onFileComplete:function(t){if(-1!==this.files.indexOf(t)){if(this.pending--,!this.config.multiAtlasURL)return;if("json"===t.type&&t.data.hasOwnProperty("textures")){var e=t.data.textures,i=this.config,s=this.loader,r=s.baseURL,o=s.path,h=s.prefix,l=a(i,"multiBaseURL",this.baseURL),u=a(i,"multiPath",this.path),c=a(i,"prefix",this.prefix),d=a(i,"textureXhrSettings");l&&s.setBaseURL(l),u&&s.setPath(u),c&&s.setPrefix(c);for(var p=0;p{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=i(31053),u=new s({Extends:r,initialize:function(t,e,i,s,n){var o="glsl";if(h(e)){var l=e;e=a(l,"key"),i=a(l,"url"),s=a(l,"shaderType","fragment"),n=a(l,"xhrSettings"),o=a(l,"extension",o)}else void 0===s&&(s="fragment");var u={type:"glsl",cache:t.cacheManager.shader,extension:o,responseType:"text",key:e,url:i,config:{shaderType:s},xhrSettings:n};r.call(this,t,u)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t=this.data.split("\n"),e=this.extractBlock(t,0);if(e)for(;e;){var i=this.getShaderName(e.header),s=this.getShaderType(e.header),n=this.getShaderUniforms(e.header),r=e.shader;if(this.cache.has(i)){var o=this.cache.get(i);"fragment"===s?o.fragmentSrc=r:o.vertexSrc=r,o.uniforms||(o.uniforms=n)}else"fragment"===s?this.cache.add(i,new l(i,r,"",n)):this.cache.add(i,new l(i,"",r,n));e=this.extractBlock(t,e.offset)}else"fragment"===this.config.shaderType?this.cache.add(this.key,new l(this.key,this.data)):this.cache.add(this.key,new l(this.key,"",this.data))},getShaderName:function(t){for(var e=0;e{var s=i(56694),n=i(683),r=i(98035),o=i(72632),a=i(30750),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s){if(h(e)){var n=e;e=o(n,"key"),s=o(n,"config",s)}var a={type:"audio",cache:t.cacheManager.audio,extension:i.type,key:e,url:i.url,config:s};r.call(this,t,a),this.locked="ontouchstart"in window,this.loaded=!1,this.filesLoaded=0,this.filesTotal=0},onLoad:function(){this.loaded||(this.loaded=!0,this.loader.nextFile(this,!0))},onError:function(){for(var t=0;t{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s){var n="html";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),s=a(o,"xhrSettings"),n=a(o,"extension",n)}var l={type:"text",cache:t.cacheManager.html,extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,l)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});o.register("html",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s,n,o){void 0===s&&(s=512),void 0===n&&(n=512);var l="html";if(h(e)){var u=e;e=a(u,"key"),i=a(u,"url"),o=a(u,"xhrSettings"),l=a(u,"extension",l),s=a(u,"width",s),n=a(u,"height",n)}var c={type:"html",cache:t.textureManager,extension:l,responseType:"text",key:e,url:i,xhrSettings:o,config:{width:s,height:n}};r.call(this,t,c)},onProcess:function(){this.state=n.FILE_PROCESSING;var t=this.config.width,e=this.config.height,i=[];i.push(''),i.push(''),i.push(''),i.push(this.xhrLoader.responseText),i.push(""),i.push(""),i.push("");var s=[i.join("\n")],o=this;try{var a=new window.Blob(s,{type:"image/svg+xml;charset=utf-8"})}catch(t){return o.state=n.FILE_ERRORED,void o.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){r.revokeObjectURL(o.data),o.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(o.data),o.onProcessError()},r.createObjectURL(this.data,a,"image/svg+xml")},addToCache:function(){this.cache.addImage(this.key,this.data)}});o.register("htmlTexture",(function(t,e,i,s,n){if(Array.isArray(t))for(var r=0;r{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=i(30750),u=new s({Extends:r,initialize:function t(e,i,s,n,o){var l,u="png";if(h(i)){var c=i;i=a(c,"key"),s=a(c,"url"),l=a(c,"normalMap"),n=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(c,"frameConfig")}Array.isArray(s)&&(l=s[1],s=s[0]);var d={type:"image",cache:e.textureManager,extension:u,responseType:"blob",key:i,url:s,xhrSettings:n,config:o};if(r.call(this,e,d),l){var p=new t(e,this.key,l,n,o);p.type="normalMap",this.setLink(p),e.addFile(p)}this.useImageElementLoad="HTMLImageElement"===e.imageLoadType,this.useImageElementLoad&&(this.load=this.loadImage,this.onProcess=this.onProcessImage)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){r.revokeObjectURL(t.data),t.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(t.data),t.onProcessError()},r.createObjectURL(this.data,this.xhrLoader.response,"image/png")},onProcessImage:function(){var t=this.state;this.state=n.FILE_PROCESSING,t===n.FILE_LOADED?this.onProcessComplete():this.onProcessError()},loadImage:function(){if(this.state=n.FILE_LOADING,this.src=l(this,this.loader.baseURL),0===this.src.indexOf("data:"))console.warn("Local data URIs are not supported: "+this.key);else{this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){t.state=n.FILE_LOADED,t.loader.nextFile(t,!0)},this.data.onerror=function(){t.loader.nextFile(t,!1)},this.data.src=this.src}},addToCache:function(){var t=this.linkFile;t&&t.state>=n.FILE_COMPLETE?"image"===this.type?this.cache.addImage(this.key,this.data,t.data):this.cache.addImage(t.key,t.data,this.data):t||this.cache.addImage(this.key,this.data)}});o.register("image",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(10850),l=i(42911),u=new s({Extends:r,initialize:function(t,e,i,s,o){var u="json";if(l(e)){var c=e;e=a(c,"key"),i=a(c,"url"),s=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(c,"dataKey",o)}var d={type:"json",cache:t.cacheManager.json,extension:u,responseType:"text",key:e,url:i,xhrSettings:s,config:o};r.call(this,t,d),l(i)&&(this.data=o?h(i,o):i,this.state=n.FILE_POPULATED)},onProcess:function(){if(this.state!==n.FILE_POPULATED){this.state=n.FILE_PROCESSING;try{var t=JSON.parse(this.xhrLoader.responseText)}catch(t){throw this.onProcessError(),t}var e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});o.register("json",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(76846),r=i(72632),o=i(42927),a=i(42911),h=i(70806),l=i(45176),u=new s({Extends:l,initialize:function(t,e,i,s,n,o,u){if(a(e)){var c=e;e=r(c,"key"),i=r(c,"url",!1)?r(c,"url"):r(c,"atlasURL"),o=r(c,"xhrSettings"),s=r(c,"path"),n=r(c,"baseURL"),u=r(c,"textureXhrSettings")}var d=new h(t,e,i,o);l.call(this,t,"multiatlas",e,[d]),this.config.path=s,this.config.baseURL=n,this.config.textureXhrSettings=u},onFileComplete:function(t){if(-1!==this.files.indexOf(t)&&(this.pending--,"json"===t.type&&t.data.hasOwnProperty("textures"))){var e=t.data.textures,i=this.config,s=this.loader,n=s.baseURL,a=s.path,h=s.prefix,l=r(i,"baseURL",this.baseURL),u=r(i,"path",this.path),c=r(i,"prefix",this.prefix),d=r(i,"textureXhrSettings");s.setBaseURL(l),s.setPath(u),s.setPrefix(c);for(var p=0;p{var s=i(56694),n=i(76846),r=i(72632),o=i(42911),a=i(45176),h=i(55188),l=new s({Extends:a,initialize:function(t,e,i,s){var n="js",l=[];if(o(e)){var u=e;e=r(u,"key"),i=r(u,"url"),s=r(u,"xhrSettings"),n=r(u,"extension",n)}Array.isArray(i)||(i=[i]);for(var c=0;c{var s=i(56694),n=i(76846),r=i(72632),o=i(42911),a=i(45176),h=i(27291),l=i(76799),u=i(86897),c=new s({Extends:a,initialize:function(t,e,i,s,n,h){var l,c,d=t.cacheManager.obj;if(o(e)){var p=e;e=r(p,"key"),l=new u(t,{key:e,type:"obj",cache:d,url:r(p,"url"),extension:r(p,"extension","obj"),xhrSettings:r(p,"xhrSettings"),config:{flipUV:r(p,"flipUV",n)}}),(s=r(p,"matURL"))&&(c=new u(t,{key:e,type:"mat",cache:d,url:s,extension:r(p,"matExtension","mat"),xhrSettings:r(p,"xhrSettings")}))}else l=new u(t,{key:e,url:i,type:"obj",cache:d,extension:"obj",xhrSettings:h,config:{flipUV:n}}),s&&(c=new u(t,{key:e,url:s,type:"mat",cache:d,extension:"mat",xhrSettings:h}));a.call(this,t,"obj",e,[l,c])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=h(t.data,t.config.flipUV);e&&(i.materials=l(e.data)),t.cache.add(t.key,i),this.complete=!0}}});n.register("obj",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var o=0;o{var s=i(56694),n=i(12117),r=i(76846),o=i(70806),a=new s({Extends:o,initialize:function(t,e,i,s,n){o.call(this,t,e,i,s,n),this.type="packfile"},onProcess:function(){this.state!==n.FILE_POPULATED&&(this.state=n.FILE_PROCESSING,this.data=JSON.parse(this.xhrLoader.responseText)),this.loader.addPack(this.data,this.config),this.onProcessComplete()}});r.register("pack",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s,o,l){var u="js";if(h(e)){var c=e;e=a(c,"key"),i=a(c,"url"),l=a(c,"xhrSettings"),u=a(c,"extension",u),s=a(c,"start"),o=a(c,"mapping")}var d={type:"plugin",cache:!1,extension:u,responseType:"text",key:e,url:i,xhrSettings:l,config:{start:s,mapping:o}};r.call(this,t,d),"function"==typeof i&&(this.data=i,this.state=n.FILE_POPULATED)},onProcess:function(){var t=this.loader.systems.plugins,e=this.config,i=a(e,"start",!1),s=a(e,"mapping",null);if(this.state===n.FILE_POPULATED)t.install(this.key,this.data,i,s);else{this.state=n.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data);var r=t.install(this.key,window[this.key],i,s);(i||s)&&(this.loader.systems[s]=r,this.loader.scene[s]=r)}this.onProcessComplete()}});o.register("plugin",(function(t,e,i,s,n){if(Array.isArray(t))for(var r=0;r{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s,n){var o="svg";if(h(e)){var l=e;e=a(l,"key"),i=a(l,"url"),s=a(l,"svgConfig",{}),n=a(l,"xhrSettings"),o=a(l,"extension",o)}var u={type:"svg",cache:t.textureManager,extension:o,responseType:"text",key:e,url:i,xhrSettings:n,config:{width:a(s,"width"),height:a(s,"height"),scale:a(s,"scale")}};r.call(this,t,u)},onProcess:function(){this.state=n.FILE_PROCESSING;var t=this.xhrLoader.responseText,e=[t],i=this.config.width,s=this.config.height,o=this.config.scale;t:if(i&&s||o){var a=(new DOMParser).parseFromString(t,"text/xml").getElementsByTagName("svg")[0],h=a.hasAttribute("viewBox"),l=parseFloat(a.getAttribute("width")),u=parseFloat(a.getAttribute("height"));if(!h&&l&&u)a.setAttribute("viewBox","0 0 "+l+" "+u);else if(h&&!l&&!u){var c=a.getAttribute("viewBox").split(/\s+|,/);l=c[2],u=c[3]}if(o){if(!l||!u)break t;i=l*o,s=u*o}a.setAttribute("width",i.toString()+"px"),a.setAttribute("height",s.toString()+"px"),e=[(new XMLSerializer).serializeToString(a)]}try{var d=new window.Blob(e,{type:"image/svg+xml;charset=utf-8"})}catch(t){return void this.onProcessError()}this.data=new Image,this.data.crossOrigin=this.crossOrigin;var p=this,f=!1;this.data.onload=function(){f||r.revokeObjectURL(p.data),p.onProcessComplete()},this.data.onerror=function(){f?p.onProcessError():(f=!0,r.revokeObjectURL(p.data),p.data.src="data:image/svg+xml,"+encodeURIComponent(e.join("")))},r.createObjectURL(this.data,d,"image/svg+xml")},addToCache:function(){this.cache.addImage(this.key,this.data)}});o.register("svg",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s){var n="js";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),s=a(o,"xhrSettings"),n=a(o,"extension",n)}var l={type:"text",extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,l)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t=this.data.concat("(function(){\nreturn new "+this.key+"();\n}).call(this);"),e=eval;this.loader.sceneManager.add(this.key,e(t)),this.complete=!0}});o.register("sceneFile",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s,o,l){var u="js";if(h(e)){var c=e;e=a(c,"key"),i=a(c,"url"),l=a(c,"xhrSettings"),u=a(c,"extension",u),s=a(c,"systemKey"),o=a(c,"sceneKey")}var d={type:"scenePlugin",cache:!1,extension:u,responseType:"text",key:e,url:i,xhrSettings:l,config:{systemKey:s,sceneKey:o}};r.call(this,t,d),"function"==typeof i&&(this.data=i,this.state=n.FILE_POPULATED)},onProcess:function(){var t=this.loader.systems.plugins,e=this.config,i=this.key,s=a(e,"systemKey",i),r=a(e,"sceneKey",i);this.state===n.FILE_POPULATED?t.installScenePlugin(s,this.data,r,this.loader.scene,!0):(this.state=n.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data),t.installScenePlugin(s,window[this.key],r,this.loader.scene,!0)),this.onProcessComplete()}});o.register("scenePlugin",(function(t,e,i,s,n){if(Array.isArray(t))for(var r=0;r{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s,n){var o="js";if(h(e)){var l=e;e=a(l,"key"),i=a(l,"url"),s=a(l,"type","script"),n=a(l,"xhrSettings"),o=a(l,"extension",o)}else void 0===s&&(s="script");var u={type:s,cache:!1,extension:o,responseType:"text",key:e,url:i,xhrSettings:n};r.call(this,t,u)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data),this.onProcessComplete()}});o.register("script",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(76846),r=i(42927),o=new s({Extends:r,initialize:function(t,e,i,s,n){r.call(this,t,e,i,n,s),this.type="spritesheet"},addToCache:function(){this.cache.addSpriteSheet(this.key,this.data,this.config)}});n.register("spritesheet",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s){var n="text",o="txt",l=t.cacheManager.text;if(h(e)){var u=e;e=a(u,"key"),i=a(u,"url"),s=a(u,"xhrSettings"),o=a(u,"extension",o),n=a(u,"type",n),l=a(u,"cache",l)}var c={type:n,cache:l,extension:o,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,c)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});o.register("text",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=i(93560),u=new s({Extends:r,initialize:function(t,e,i,s){var n="csv";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),s=a(o,"xhrSettings"),n=a(o,"extension",n)}var u={type:"tilemapCSV",cache:t.cacheManager.tilemap,extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,u),this.tilemapFormat=l.CSV},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t={format:this.tilemapFormat,data:this.data};this.cache.add(this.key,t)}});o.register("tilemapCSV",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(76846),r=i(70806),o=i(93560),a=new s({Extends:r,initialize:function(t,e,i,s){r.call(this,t,e,i,s),this.type="tilemapJSON",this.cache=t.cacheManager.tilemap},addToCache:function(){var t={format:o.WELTMEISTER,data:this.data};this.cache.add(this.key,t)}});n.register("tilemapImpact",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(76846),r=i(70806),o=i(93560),a=new s({Extends:r,initialize:function(t,e,i,s){r.call(this,t,e,i,s),this.type="tilemapJSON",this.cache=t.cacheManager.tilemap},addToCache:function(){var t={format:o.TILED_JSON,data:this.data};this.cache.add(this.key,t)}});n.register("tilemapTiledJSON",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(76846),r=i(72632),o=i(42927),a=i(42911),h=i(45176),l=i(86897),u=new s({Extends:h,initialize:function(t,e,i,s,n,u){var c,d;if(a(e)){var p=e;e=r(p,"key"),c=new o(t,{key:e,url:r(p,"textureURL"),extension:r(p,"textureExtension","png"),normalMap:r(p,"normalMap"),xhrSettings:r(p,"textureXhrSettings")}),d=new l(t,{key:e,url:r(p,"atlasURL"),extension:r(p,"atlasExtension","txt"),xhrSettings:r(p,"atlasXhrSettings")})}else c=new o(t,e,i,n),d=new l(t,e,s,u);c.linkFile?h.call(this,t,"unityatlas",e,[c,d,c.linkFile]):h.call(this,t,"unityatlas",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addUnityAtlas(t.key,t.data,e.data,i),this.complete=!0}}});n.register("unityAtlas",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var o=0;o{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(30750),h=i(72632),l=i(42911),u=new s({Extends:r,initialize:function(t,e,i,s,n,o,a){void 0===s&&(s="loadeddata"),void 0===n&&(n=!1),void 0===o&&(o=!1),"loadeddata"!==s&&"canplay"!==s&&"canplaythrough"!==s&&(s="loadeddata");var h={type:"video",cache:t.cacheManager.video,extension:i.type,responseType:"blob",key:e,url:i.url,xhrSettings:a,config:{loadEvent:s,asBlob:n,noAudio:o}};this.onLoadCallback=this.onVideoLoadHandler.bind(this),this.onErrorCallback=this.onVideoErrorHandler.bind(this),r.call(this,t,h)},onProcess:function(){if(this.state=n.FILE_PROCESSING,this.config.asBlob){var t=this.createVideoElement();this.data=t;var e=this;this.data.onloadeddata=function(){e.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(e.data),e.onProcessError()},r.createObjectURL(t,this.xhrLoader.response,""),t.load()}else this.onProcessComplete()},createVideoElement:function(){var t=document.createElement("video");return t.controls=!1,t.crossOrigin=this.loader.crossOrigin,this.config.noAudio&&(t.muted=!0,t.defaultMuted=!0,t.setAttribute("autoplay","autoplay")),t.setAttribute("playsinline","playsinline"),t.setAttribute("preload","auto"),t},onVideoLoadHandler:function(t){var e=t.target;e.removeEventListener(this.config.loadEvent,this.onLoadCallback,!0),e.removeEventListener("error",this.onErrorCallback,!0),this.data=e,this.resetXHR(),this.loader.nextFile(this,!0)},onVideoErrorHandler:function(t){var e=t.target;e&&(e.removeEventListener(this.config.loadEvent,this.onLoadCallback,!0),e.removeEventListener("error",this.onErrorCallback,!0)),this.resetXHR(),this.loader.nextFile(this,!1)},load:function(){var t=this.config.loadEvent;if(this.config.asBlob)r.prototype.load.call(this);else{this.percentComplete=0;var e=this.createVideoElement();e.addEventListener(t,this.onLoadCallback,!0),e.addEventListener("error",this.onErrorCallback,!0),e.src=a(this,this.loader.baseURL),e.load()}}});u.create=function(t,e,i,s,n,r,o){var a=t.systems.game;l(e)&&(i=h(e,"url",[]),s=h(e,"loadEvent","loadeddata"),n=h(e,"asBlob",!1),r=h(e,"noAudio",!1),o=h(e,"xhrSettings"),e=h(e,"key"));var c=u.getVideoURL(a,i);if(c)return new u(t,e,c,s,n,r,o)},u.getVideoURL=function(t,e){Array.isArray(e)||(e=[e]);for(var i=0;i{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=i(89200),u=new s({Extends:r,initialize:function(t,e,i,s){var n="xml";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),s=a(o,"xhrSettings"),n=a(o,"extension",n)}var l={type:"xml",cache:t.cacheManager.xml,extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,l)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=l(this.xhrLoader.responseText),this.data?this.onProcessComplete():this.onProcessError()}});o.register("xml",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{t.exports={AnimationJSONFile:i(46468),AsepriteFile:i(31648),AtlasJSONFile:i(73152),AtlasXMLFile:i(24616),AudioFile:i(67448),AudioSpriteFile:i(66109),BinaryFile:i(40612),BitmapFontFile:i(54565),CompressedTextureFile:i(47375),CSSFile:i(99898),GLSLFile:i(46568),HTML5AudioFile:i(30929),HTMLFile:i(77459),HTMLTextureFile:i(9755),ImageFile:i(42927),JSONFile:i(70806),MultiAtlasFile:i(80802),MultiScriptFile:i(39034),OBJFile:i(85527),PackFile:i(3616),PluginFile:i(12217),SceneFile:i(95171),ScenePluginFile:i(82458),ScriptFile:i(55188),SpriteSheetFile:i(33536),SVGFile:i(4474),TextFile:i(86897),TilemapCSVFile:i(58673),TilemapImpactFile:i(98896),TilemapJSONFile:i(50563),UnityAtlasFile:i(82857),VideoFile:i(22833),XMLFile:i(15297)}},95695:(t,e,i)=>{var s=i(12117),n=i(98611),r={Events:i(683),FileTypes:i(34034),File:i(98035),FileTypesManager:i(76846),GetURL:i(30750),LoaderPlugin:i(67285),MergeXHRSettings:i(43531),MultiFile:i(45176),XHRLoader:i(88490),XHRSettings:i(33868)};r=n(!1,r,s),t.exports=r},26042:t=>{t.exports=function(t){for(var e=0,i=0;i{var s=i(8034);t.exports=function(t,e){return s(t)/s(e)/s(t-e)}},17489:t=>{t.exports=function(t,e){return Math.floor(Math.random()*(e-t+1)+t)}},14976:t=>{t.exports=function(t,e,i,s,n){var r=.5*(s-e),o=.5*(n-i),a=t*t;return(2*i-2*s+r+o)*(t*a)+(-3*i+3*s-2*r-o)*a+r*t+i}},89129:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.ceil(t*s)/s}},82897:t=>{t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},75606:(t,e,i)=>{var s=i(83392);t.exports=function(t){return t*s.DEG_TO_RAD}},767:t=>{t.exports=function(t,e){return Math.abs(t-e)}},9849:(t,e,i)=>{var s=i(82897),n=i(56694),r=i(16650),o=i(72283),a=new r,h=new n({initialize:function t(e,i,s,n){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=t.DefaultOrder),this._x=e,this._y=i,this._z=s,this._order=n,this.onChangeCallback=o},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback(this)}},set:function(t,e,i,s){return void 0===s&&(s=this._order),this._x=t,this._y=e,this._z=i,this._order=s,this.onChangeCallback(this),this},copy:function(t){return this.set(t.x,t.y,t.z,t.order)},setFromQuaternion:function(t,e,i){return void 0===e&&(e=this._order),void 0===i&&(i=!1),a.fromQuat(t),this.setFromRotationMatrix(a,e,i)},setFromRotationMatrix:function(t,e,i){void 0===e&&(e=this._order),void 0===i&&(i=!1);var n=t.val,r=n[0],o=n[4],a=n[8],h=n[1],l=n[5],u=n[9],c=n[2],d=n[6],p=n[10],f=0,v=0,g=0,m=.99999;switch(e){case"XYZ":v=Math.asin(s(a,-1,1)),Math.abs(a){t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},61616:t=>{t.exports=function(t,e){return Math.random()*(e-t)+t}},60679:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.floor(t*s)/s}},91806:(t,e,i)=>{var s=i(82897);t.exports=function(t,e,i){return(i-e)*(t=s(t,0,1))+e}},79366:t=>{t.exports=function(t,e){return t/e/1e3}},43776:t=>{t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},58442:t=>{t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},42798:t=>{t.exports=function(t,e,i){return(e-t)*i+t}},61072:t=>{t.exports=function(t,e,i){return void 0===i&&(i=0),t.clone().lerp(e,i)}},5341:(t,e,i)=>{var s=new(i(56694))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new s(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=s,this},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=l*r-o*h,c=-l*n+o*a,d=h*n-r*a,p=e*u+i*c+s*d;return p?(p=1/p,t[0]=u*p,t[1]=(-l*i+s*h)*p,t[2]=(o*i-s*r)*p,t[3]=c*p,t[4]=(l*e-s*a)*p,t[5]=(-o*e+s*n)*p,t[6]=d*p,t[7]=(-h*e+i*a)*p,t[8]=(r*e-i*n)*p,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return t[0]=r*l-o*h,t[1]=s*h-i*l,t[2]=i*o-s*r,t[3]=o*a-n*l,t[4]=e*l-s*a,t[5]=s*n-e*o,t[6]=n*h-r*a,t[7]=i*a-e*h,t[8]=e*r-i*n,this},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return e*(l*r-o*h)+i*(-l*n+o*a)+s*(h*n-r*a)},multiply:function(t){var e=this.val,i=e[0],s=e[1],n=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=t.val,d=c[0],p=c[1],f=c[2],v=c[3],g=c[4],m=c[5],y=c[6],x=c[7],T=c[8];return e[0]=d*i+p*r+f*h,e[1]=d*s+p*o+f*l,e[2]=d*n+p*a+f*u,e[3]=v*i+g*r+m*h,e[4]=v*s+g*o+m*l,e[5]=v*n+g*a+m*u,e[6]=y*i+x*r+T*h,e[7]=y*s+x*o+T*l,e[8]=y*n+x*a+T*u,this},translate:function(t){var e=this.val,i=t.x,s=t.y;return e[6]=i*e[0]+s*e[3]+e[6],e[7]=i*e[1]+s*e[4]+e[7],e[8]=i*e[2]+s*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],s=e[1],n=e[2],r=e[3],o=e[4],a=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*r,e[1]=l*s+h*o,e[2]=l*n+h*a,e[3]=l*r-h*i,e[4]=l*o-h*s,e[5]=l*a-h*n,this},scale:function(t){var e=this.val,i=t.x,s=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=s*e[3],e[4]=s*e[4],e[5]=s*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,s=t.z,n=t.w,r=e+e,o=i+i,a=s+s,h=e*r,l=e*o,u=e*a,c=i*o,d=i*a,p=s*a,f=n*r,v=n*o,g=n*a,m=this.val;return m[0]=1-(c+p),m[3]=l+g,m[6]=u-v,m[1]=l-g,m[4]=1-(h+p),m[7]=d+f,m[2]=u+v,m[5]=d-f,m[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,i=this.val,s=e[0],n=e[1],r=e[2],o=e[3],a=e[4],h=e[5],l=e[6],u=e[7],c=e[8],d=e[9],p=e[10],f=e[11],v=e[12],g=e[13],m=e[14],y=e[15],x=s*h-n*a,T=s*l-r*a,w=s*u-o*a,b=n*l-r*h,E=n*u-o*h,S=r*u-o*l,A=c*g-d*v,_=c*m-p*v,C=c*y-f*v,R=d*m-p*g,M=d*y-f*g,P=p*y-f*m,O=x*P-T*M+w*R+b*C-E*_+S*A;return O?(O=1/O,i[0]=(h*P-l*M+u*R)*O,i[1]=(l*C-a*P-u*_)*O,i[2]=(a*M-h*C+u*A)*O,i[3]=(r*M-n*P-o*R)*O,i[4]=(s*P-r*C+o*_)*O,i[5]=(n*C-s*M-o*A)*O,i[6]=(g*S-m*E+y*b)*O,i[7]=(m*w-v*S-y*T)*O,i[8]=(v*E-g*w+y*x)*O,this):null}});t.exports=s},16650:(t,e,i)=>{var s=i(56694),n=i(70015),r=1e-6,o=new s({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new o(this)},set:function(t){return this.copy(t)},setValues:function(t,e,i,s,n,r,o,a,h,l,u,c,d,p,f,v){var g=this.val;return g[0]=t,g[1]=e,g[2]=i,g[3]=s,g[4]=n,g[5]=r,g[6]=o,g[7]=a,g[8]=h,g[9]=l,g[10]=u,g[11]=c,g[12]=d,g[13]=p,g[14]=f,g[15]=v,this},copy:function(t){var e=t.val;return this.setValues(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},fromArray:function(t){return this.setValues(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(t,e,i){var s=a.fromQuat(i).val,n=e.x,r=e.y,o=e.z;return this.setValues(s[0]*n,s[1]*n,s[2]*n,0,s[4]*r,s[5]*r,s[6]*r,0,s[8]*o,s[9]*o,s[10]*o,0,t.x,t.y,t.z,1)},xyz:function(t,e,i){this.identity();var s=this.val;return s[12]=t,s[13]=e,s[14]=i,this},scaling:function(t,e,i){this.zero();var s=this.val;return s[0]=t,s[5]=e,s[10]=i,s[15]=1,this},identity:function(){return this.setValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[3],n=t[6],r=t[7],o=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=n,t[11]=t[14],t[12]=s,t[13]=r,t[14]=o,this},getInverse:function(t){return this.copy(t),this.invert()},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],p=t[12],f=t[13],v=t[14],g=t[15],m=e*o-i*r,y=e*a-s*r,x=e*h-n*r,T=i*a-s*o,w=i*h-n*o,b=s*h-n*a,E=l*f-u*p,S=l*v-c*p,A=l*g-d*p,_=u*v-c*f,C=u*g-d*f,R=c*g-d*v,M=m*R-y*C+x*_+T*A-w*S+b*E;return M?(M=1/M,this.setValues((o*R-a*C+h*_)*M,(s*C-i*R-n*_)*M,(f*b-v*w+g*T)*M,(c*w-u*b-d*T)*M,(a*A-r*R-h*S)*M,(e*R-s*A+n*S)*M,(v*x-p*b-g*y)*M,(l*b-c*x+d*y)*M,(r*C-o*A+h*E)*M,(i*A-e*C-n*E)*M,(p*w-f*x+g*m)*M,(u*x-l*w-d*m)*M,(o*S-r*_-a*E)*M,(e*_-i*S+s*E)*M,(f*y-p*T-v*m)*M,(l*T-u*y+c*m)*M)):this},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],p=t[12],f=t[13],v=t[14],g=t[15];return this.setValues(o*(c*g-d*v)-u*(a*g-h*v)+f*(a*d-h*c),-(i*(c*g-d*v)-u*(s*g-n*v)+f*(s*d-n*c)),i*(a*g-h*v)-o*(s*g-n*v)+f*(s*h-n*a),-(i*(a*d-h*c)-o*(s*d-n*c)+u*(s*h-n*a)),-(r*(c*g-d*v)-l*(a*g-h*v)+p*(a*d-h*c)),e*(c*g-d*v)-l*(s*g-n*v)+p*(s*d-n*c),-(e*(a*g-h*v)-r*(s*g-n*v)+p*(s*h-n*a)),e*(a*d-h*c)-r*(s*d-n*c)+l*(s*h-n*a),r*(u*g-d*f)-l*(o*g-h*f)+p*(o*d-h*u),-(e*(u*g-d*f)-l*(i*g-n*f)+p*(i*d-n*u)),e*(o*g-h*f)-r*(i*g-n*f)+p*(i*h-n*o),-(e*(o*d-h*u)-r*(i*d-n*u)+l*(i*h-n*o)),-(r*(u*v-c*f)-l*(o*v-a*f)+p*(o*c-a*u)),e*(u*v-c*f)-l*(i*v-s*f)+p*(i*c-s*u),-(e*(o*v-a*f)-r*(i*v-s*f)+p*(i*a-s*o)),e*(o*c-a*u)-r*(i*c-s*u)+l*(i*a-s*o))},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],p=t[12],f=t[13],v=t[14],g=t[15];return(e*o-i*r)*(c*g-d*v)-(e*a-s*r)*(u*g-d*f)+(e*h-n*r)*(u*v-c*f)+(i*a-s*o)*(l*g-d*p)-(i*h-n*o)*(l*v-c*p)+(s*h-n*a)*(l*f-u*p)},multiply:function(t){var e=this.val,i=e[0],s=e[1],n=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=e[9],d=e[10],p=e[11],f=e[12],v=e[13],g=e[14],m=e[15],y=t.val,x=y[0],T=y[1],w=y[2],b=y[3];return e[0]=x*i+T*o+w*u+b*f,e[1]=x*s+T*a+w*c+b*v,e[2]=x*n+T*h+w*d+b*g,e[3]=x*r+T*l+w*p+b*m,x=y[4],T=y[5],w=y[6],b=y[7],e[4]=x*i+T*o+w*u+b*f,e[5]=x*s+T*a+w*c+b*v,e[6]=x*n+T*h+w*d+b*g,e[7]=x*r+T*l+w*p+b*m,x=y[8],T=y[9],w=y[10],b=y[11],e[8]=x*i+T*o+w*u+b*f,e[9]=x*s+T*a+w*c+b*v,e[10]=x*n+T*h+w*d+b*g,e[11]=x*r+T*l+w*p+b*m,x=y[12],T=y[13],w=y[14],b=y[15],e[12]=x*i+T*o+w*u+b*f,e[13]=x*s+T*a+w*c+b*v,e[14]=x*n+T*h+w*d+b*g,e[15]=x*r+T*l+w*p+b*m,this},multiplyLocal:function(t){var e=this.val,i=t.val;return this.setValues(e[0]*i[0]+e[1]*i[4]+e[2]*i[8]+e[3]*i[12],e[0]*i[1]+e[1]*i[5]+e[2]*i[9]+e[3]*i[13],e[0]*i[2]+e[1]*i[6]+e[2]*i[10]+e[3]*i[14],e[0]*i[3]+e[1]*i[7]+e[2]*i[11]+e[3]*i[15],e[4]*i[0]+e[5]*i[4]+e[6]*i[8]+e[7]*i[12],e[4]*i[1]+e[5]*i[5]+e[6]*i[9]+e[7]*i[13],e[4]*i[2]+e[5]*i[6]+e[6]*i[10]+e[7]*i[14],e[4]*i[3]+e[5]*i[7]+e[6]*i[11]+e[7]*i[15],e[8]*i[0]+e[9]*i[4]+e[10]*i[8]+e[11]*i[12],e[8]*i[1]+e[9]*i[5]+e[10]*i[9]+e[11]*i[13],e[8]*i[2]+e[9]*i[6]+e[10]*i[10]+e[11]*i[14],e[8]*i[3]+e[9]*i[7]+e[10]*i[11]+e[11]*i[15],e[12]*i[0]+e[13]*i[4]+e[14]*i[8]+e[15]*i[12],e[12]*i[1]+e[13]*i[5]+e[14]*i[9]+e[15]*i[13],e[12]*i[2]+e[13]*i[6]+e[14]*i[10]+e[15]*i[14],e[12]*i[3]+e[13]*i[7]+e[14]*i[11]+e[15]*i[15])},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.val,s=e.val,n=i[0],r=i[4],o=i[8],a=i[12],h=i[1],l=i[5],u=i[9],c=i[13],d=i[2],p=i[6],f=i[10],v=i[14],g=i[3],m=i[7],y=i[11],x=i[15],T=s[0],w=s[4],b=s[8],E=s[12],S=s[1],A=s[5],_=s[9],C=s[13],R=s[2],M=s[6],P=s[10],O=s[14],L=s[3],F=s[7],D=s[11],k=s[15];return this.setValues(n*T+r*S+o*R+a*L,h*T+l*S+u*R+c*L,d*T+p*S+f*R+v*L,g*T+m*S+y*R+x*L,n*w+r*A+o*M+a*F,h*w+l*A+u*M+c*F,d*w+p*A+f*M+v*F,g*w+m*A+y*M+x*F,n*b+r*_+o*P+a*D,h*b+l*_+u*P+c*D,d*b+p*_+f*P+v*D,g*b+m*_+y*P+x*D,n*E+r*C+o*O+a*k,h*E+l*C+u*O+c*k,d*E+p*C+f*O+v*k,g*E+m*C+y*O+x*k)},translate:function(t){return this.translateXYZ(t.x,t.y,t.z)},translateXYZ:function(t,e,i){var s=this.val;return s[12]=s[0]*t+s[4]*e+s[8]*i+s[12],s[13]=s[1]*t+s[5]*e+s[9]*i+s[13],s[14]=s[2]*t+s[6]*e+s[10]*i+s[14],s[15]=s[3]*t+s[7]*e+s[11]*i+s[15],this},scale:function(t){return this.scaleXYZ(t.x,t.y,t.z)},scaleXYZ:function(t,e,i){var s=this.val;return s[0]=s[0]*t,s[1]=s[1]*t,s[2]=s[2]*t,s[3]=s[3]*t,s[4]=s[4]*e,s[5]=s[5]*e,s[6]=s[6]*e,s[7]=s[7]*e,s[8]=s[8]*i,s[9]=s[9]*i,s[10]=s[10]*i,s[11]=s[11]*i,this},makeRotationAxis:function(t,e){var i=Math.cos(e),s=Math.sin(e),n=1-i,r=t.x,o=t.y,a=t.z,h=n*r,l=n*o;return this.setValues(h*r+i,h*o-s*a,h*a+s*o,0,h*o+s*a,l*o+i,l*a-s*r,0,h*a-s*o,l*a+s*r,n*a*a+i,0,0,0,0,1)},rotate:function(t,e){var i=this.val,s=e.x,n=e.y,o=e.z,a=Math.sqrt(s*s+n*n+o*o);if(Math.abs(a){t.exports=function(t,e,i){return Math.min(t+e,i)}},37394:t=>{t.exports=function(t){var e=t.length;if(0===e)return 0;t.sort((function(t,e){return t-e}));var i=Math.floor(e/2);return e%2==0?(t[i]+t[i-1])/2:t[i]}},17259:t=>{t.exports=function(t,e,i){return Math.max(t-e,i)}},61820:t=>{t.exports=function(t,e,i,s){void 0===i&&(i=e+1);var n=(t-e)/(i-e);return n>1?void 0!==s?(n=(s-t)/(s-i))<0&&(n=0):n=1:n<0&&(n=0),n}},75003:(t,e,i)=>{var s=i(56694),n=i(5341),r=i(72283),o=i(70015),a=1e-6,h=new Int8Array([1,2,0]),l=new Float32Array([0,0,0]),u=new o(1,0,0),c=new o(0,1,0),d=new o,p=new n,f=new s({initialize:function(t,e,i,s){this.onChangeCallback=r,this.set(t,e,i,s)},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback(this)}},copy:function(t){return this.set(t)},set:function(t,e,i,s,n){return void 0===n&&(n=!0),"object"==typeof t?(this._x=t.x||0,this._y=t.y||0,this._z=t.z||0,this._w=t.w||0):(this._x=t||0,this._y=e||0,this._z=i||0,this._w=s||0),n&&this.onChangeCallback(this),this},add:function(t){return this._x+=t.x,this._y+=t.y,this._z+=t.z,this._w+=t.w,this.onChangeCallback(this),this},subtract:function(t){return this._x-=t.x,this._y-=t.y,this._z-=t.z,this._w-=t.w,this.onChangeCallback(this),this},scale:function(t){return this._x*=t,this._y*=t,this._z*=t,this._w*=t,this.onChangeCallback(this),this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,n=t*t+e*e+i*i+s*s;return n>0&&(n=1/Math.sqrt(n),this._x=t*n,this._y=e*n,this._z=i*n,this._w=s*n),this.onChangeCallback(this),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,n=this.z,r=this.w;return this.set(i+e*(t.x-i),s+e*(t.y-s),n+e*(t.z-n),r+e*(t.w-r))},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(d.copy(u).cross(t).length().999999?this.set(0,0,0,1):(d.copy(t).cross(e),this._x=d.x,this._y=d.y,this._z=d.z,this._w=1+i,this.normalize())},setAxes:function(t,e,i){var s=p.val;return s[0]=e.x,s[3]=e.y,s[6]=e.z,s[1]=i.x,s[4]=i.y,s[7]=i.z,s[2]=-t.x,s[5]=-t.y,s[8]=-t.z,this.fromMat3(p).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.set(i*t.x,i*t.y,i*t.z,Math.cos(e))},multiply:function(t){var e=this.x,i=this.y,s=this.z,n=this.w,r=t.x,o=t.y,a=t.z,h=t.w;return this.set(e*h+n*r+i*a-s*o,i*h+n*o+s*r-e*a,s*h+n*a+e*o-i*r,n*h-e*r-i*o-s*a)},slerp:function(t,e){var i=this.x,s=this.y,n=this.z,r=this.w,o=t.x,h=t.y,l=t.z,u=t.w,c=i*o+s*h+n*l+r*u;c<0&&(c=-c,o=-o,h=-h,l=-l,u=-u);var d=1-e,p=e;if(1-c>a){var f=Math.acos(c),v=Math.sin(f);d=Math.sin((1-e)*f)/v,p=Math.sin(e*f)/v}return this.set(d*i+p*o,d*s+p*h,d*n+p*l,d*r+p*u)},invert:function(){var t=this.x,e=this.y,i=this.z,s=this.w,n=t*t+e*e+i*i+s*s,r=n?1/n:0;return this.set(-t*r,-e*r,-i*r,s*r)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,n=this.w,r=Math.sin(t),o=Math.cos(t);return this.set(e*o+n*r,i*o+s*r,s*o-i*r,n*o-e*r)},rotateY:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,n=this.w,r=Math.sin(t),o=Math.cos(t);return this.set(e*o-s*r,i*o+n*r,s*o+e*r,n*o-i*r)},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,n=this.w,r=Math.sin(t),o=Math.cos(t);return this.set(e*o+i*r,i*o-e*r,s*o+n*r,n*o-s*r)},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},setFromEuler:function(t,e){var i=t.x/2,s=t.y/2,n=t.z/2,r=Math.cos(i),o=Math.cos(s),a=Math.cos(n),h=Math.sin(i),l=Math.sin(s),u=Math.sin(n);switch(t.order){case"XYZ":this.set(h*o*a+r*l*u,r*l*a-h*o*u,r*o*u+h*l*a,r*o*a-h*l*u,e);break;case"YXZ":this.set(h*o*a+r*l*u,r*l*a-h*o*u,r*o*u-h*l*a,r*o*a+h*l*u,e);break;case"ZXY":this.set(h*o*a-r*l*u,r*l*a+h*o*u,r*o*u+h*l*a,r*o*a-h*l*u,e);break;case"ZYX":this.set(h*o*a-r*l*u,r*l*a+h*o*u,r*o*u-h*l*a,r*o*a+h*l*u,e);break;case"YZX":this.set(h*o*a+r*l*u,r*l*a+h*o*u,r*o*u-h*l*a,r*o*a-h*l*u,e);break;case"XZY":this.set(h*o*a-r*l*u,r*l*a-h*o*u,r*o*u+h*l*a,r*o*a+h*l*u,e)}return this},setFromRotationMatrix:function(t){var e,i=t.val,s=i[0],n=i[4],r=i[8],o=i[1],a=i[5],h=i[9],l=i[2],u=i[6],c=i[10],d=s+a+c;return d>0?(e=.5/Math.sqrt(d+1),this.set((u-h)*e,(r-l)*e,(o-n)*e,.25/e)):s>a&&s>c?(e=2*Math.sqrt(1+s-a-c),this.set(.25*e,(n+o)/e,(r+l)/e,(u-h)/e)):a>c?(e=2*Math.sqrt(1+a-s-c),this.set((n+o)/e,.25*e,(h+u)/e,(r-l)/e)):(e=2*Math.sqrt(1+c-s-a),this.set((r+l)/e,(h+u)/e,.25*e,(o-n)/e)),this},fromMat3:function(t){var e,i=t.val,s=i[0]+i[4]+i[8];if(s>0)e=Math.sqrt(s+1),this.w=.5*e,e=.5/e,this._x=(i[7]-i[5])*e,this._y=(i[2]-i[6])*e,this._z=(i[3]-i[1])*e;else{var n=0;i[4]>i[0]&&(n=1),i[8]>i[3*n+n]&&(n=2);var r=h[n],o=h[r];e=Math.sqrt(i[3*n+n]-i[3*r+r]-i[3*o+o]+1),l[n]=.5*e,e=.5/e,l[r]=(i[3*r+n]+i[3*n+r])*e,l[o]=(i[3*o+n]+i[3*n+o])*e,this._x=l[0],this._y=l[1],this._z=l[2],this._w=(i[3*o+r]-i[3*r+o])*e}return this.onChangeCallback(this),this}});t.exports=f},23701:(t,e,i)=>{var s=i(83392);t.exports=function(t){return t*s.RAD_TO_DEG}},16906:t=>{t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},52417:t=>{t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,s=2*Math.random()-1,n=Math.sqrt(1-s*s)*e;return t.x=Math.cos(i)*n,t.y=Math.sin(i)*n,t.z=s*e,t}},17915:t=>{t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},52257:t=>{t.exports=function(t,e){var i=t.x,s=t.y;return t.x=i*Math.cos(e)-s*Math.sin(e),t.y=i*Math.sin(e)+s*Math.cos(e),t}},2386:t=>{t.exports=function(t,e,i,s){var n=Math.cos(s),r=Math.sin(s),o=t.x-e,a=t.y-i;return t.x=o*n-a*r+e,t.y=o*r+a*n+i,t}},72395:t=>{t.exports=function(t,e,i,s,n){var r=s+Math.atan2(t.y-i,t.x-e);return t.x=e+n*Math.cos(r),t.y=i+n*Math.sin(r),t}},41061:t=>{t.exports=function(t,e,i,s,n){return t.x=e+n*Math.cos(s),t.y=i+n*Math.sin(s),t}},93709:(t,e,i)=>{var s=i(70015),n=i(16650),r=i(75003),o=new n,a=new r,h=new s;t.exports=function(t,e,i){return a.setAxisAngle(e,i),o.fromRotationTranslation(a,h.set(0,0,0)),t.transformMat4(o)}},67233:t=>{t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},64333:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.round(t*s)/s}},59533:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=1),void 0===i&&(i=1),void 0===s&&(s=1),s*=Math.PI/t;for(var n=[],r=[],o=0;o{t.exports=function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},87736:t=>{t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},55805:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n){void 0===n&&(n=new s);var r=0,o=0;return t>0&&t<=e*i&&(r=t>e-1?t-(o=Math.floor(t/e))*e:t),n.set(r,o)}},64462:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r,o,a,h){void 0===h&&(h=new s);var l=Math.sin(r),u=Math.cos(r),c=u*o,d=l*o,p=-l*a,f=u*a,v=1/(c*f+p*-d);return h.x=f*v*t+-p*v*e+(n*p-i*f)*v,h.y=c*v*e+-d*v*t+(-n*c+i*d)*v,h}},93736:(t,e,i)=>{var s=i(56694),n=i(88456),r=new s({initialize:function(t,e){this.x=0,this.y=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0):(void 0===e&&(e=t),this.x=t||0,this.y=e||0)},clone:function(){return new r(this.x,this.y)},copy:function(t){return this.x=t.x||0,this.y=t.y||0,this},setFromObject:function(t){return this.x=t.x||0,this.y=t.y||0,this},set:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setTo:function(t,e){return this.set(t,e)},setToPolar:function(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this},equals:function(t){return this.x===t.x&&this.y===t.y},fuzzyEquals:function(t,e){return n(this.x,t.x,e)&&n(this.y,t.y,e)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},setAngle:function(t){return this.setToPolar(t,this.length())},add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},length:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},setLength:function(t){return this.normalize().scale(t)},lengthSq:function(){var t=this.x,e=this.y;return t*t+e*e},normalize:function(){var t=this.x,e=this.y,i=t*t+e*e;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},normalizeLeftHand:function(){var t=this.x;return this.x=this.y,this.y=-1*t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this},transformMat3:function(t){var e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[3]*i+s[6],this.y=s[1]*e+s[4]*i+s[7],this},transformMat4:function(t){var e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[4]*i+s[12],this.y=s[1]*e+s[5]*i+s[13],this},reset:function(){return this.x=0,this.y=0,this},limit:function(t){var e=this.length();return e&&e>t&&this.scale(t/e),this},reflect:function(t){return t=t.clone().normalize(),this.subtract(t.scale(2*this.dot(t)))},mirror:function(t){return this.reflect(t).negate()},rotate:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e*this.x-i*this.y,i*this.x+e*this.y)},project:function(t){var e=this.dot(t)/t.dot(t);return this.copy(t).scale(e)}});r.ZERO=new r,r.RIGHT=new r(1,0),r.LEFT=new r(-1,0),r.UP=new r(0,-1),r.DOWN=new r(0,1),r.ONE=new r(1,1),t.exports=r},70015:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clone:function(){return new s(this.x,this.y,this.z)},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},crossVectors:function(t,e){var i=t.x,s=t.y,n=t.z,r=e.x,o=e.y,a=e.z;return this.x=s*a-n*o,this.y=n*r-i*a,this.z=i*o-s*r,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},setFromMatrixPosition:function(t){return this.fromArray(t.val,12)},setFromMatrixColumn:function(t,e){return this.fromArray(t.val,4*e)},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addScale:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return Math.sqrt(e*e+i*i+s*s)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return e*e+i*i+s*s},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,s=t*t+e*e+i*i;return s>0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,s=this.z,n=t.x,r=t.y,o=t.z;return this.x=i*o-s*r,this.y=s*n-e*o,this.z=e*r-i*n,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,n=this.z;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=n+e*(t.z-n),this},applyMatrix3:function(t){var e=this.x,i=this.y,s=this.z,n=t.val;return this.x=n[0]*e+n[3]*i+n[6]*s,this.y=n[1]*e+n[4]*i+n[7]*s,this.z=n[2]*e+n[5]*i+n[8]*s,this},applyMatrix4:function(t){var e=this.x,i=this.y,s=this.z,n=t.val,r=1/(n[3]*e+n[7]*i+n[11]*s+n[15]);return this.x=(n[0]*e+n[4]*i+n[8]*s+n[12])*r,this.y=(n[1]*e+n[5]*i+n[9]*s+n[13])*r,this.z=(n[2]*e+n[6]*i+n[10]*s+n[14])*r,this},transformMat3:function(t){var e=this.x,i=this.y,s=this.z,n=t.val;return this.x=e*n[0]+i*n[3]+s*n[6],this.y=e*n[1]+i*n[4]+s*n[7],this.z=e*n[2]+i*n[5]+s*n[8],this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,n=t.val;return this.x=n[0]*e+n[4]*i+n[8]*s+n[12],this.y=n[1]*e+n[5]*i+n[9]*s+n[13],this.z=n[2]*e+n[6]*i+n[10]*s+n[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,s=this.z,n=t.val,r=e*n[0]+i*n[4]+s*n[8]+n[12],o=e*n[1]+i*n[5]+s*n[9]+n[13],a=e*n[2]+i*n[6]+s*n[10]+n[14],h=e*n[3]+i*n[7]+s*n[11]+n[15];return this.x=r/h,this.y=o/h,this.z=a/h,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,n=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*s-o*i,l=a*i+o*e-n*s,u=a*s+n*i-r*e,c=-n*e-r*i-o*s;return this.x=h*a+c*-n+l*-o-u*-r,this.y=l*a+c*-r+u*-n-h*-o,this.z=u*a+c*-o+h*-r-l*-n,this},project:function(t){var e=this.x,i=this.y,s=this.z,n=t.val,r=n[0],o=n[1],a=n[2],h=n[3],l=n[4],u=n[5],c=n[6],d=n[7],p=n[8],f=n[9],v=n[10],g=n[11],m=n[12],y=n[13],x=n[14],T=1/(e*h+i*d+s*g+n[15]);return this.x=(e*r+i*l+s*p+m)*T,this.y=(e*o+i*u+s*f+y)*T,this.z=(e*a+i*c+s*v+x)*T,this},projectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unprojectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unproject:function(t,e){var i=t.x,s=t.y,n=t.z,r=t.w,o=this.x-i,a=r-this.y-1-s,h=this.z;return this.x=2*o/n-1,this.y=2*a/r-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});s.ZERO=new s,s.RIGHT=new s(1,0,0),s.LEFT=new s(-1,0,0),s.UP=new s(0,-1,0),s.DOWN=new s(0,1,0),s.FORWARD=new s(0,0,1),s.BACK=new s(0,0,-1),s.ONE=new s(1,1,1),t.exports=s},51729:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0)},clone:function(){return new s(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,s){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,n=t*t+e*e+i*i+s*s;return n>0&&(n=1/Math.sqrt(n),this.x=t*n,this.y=e*n,this.z=i*n,this.w=s*n),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,n=this.z,r=this.w;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=n+e*(t.z-n),this.w=r+e*(t.w-r),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,n=t.w-this.w||0;return Math.sqrt(e*e+i*i+s*s+n*n)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,n=t.w-this.w||0;return e*e+i*i+s*s+n*n},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,n=this.w,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*s+r[12]*n,this.y=r[1]*e+r[5]*i+r[9]*s+r[13]*n,this.z=r[2]*e+r[6]*i+r[10]*s+r[14]*n,this.w=r[3]*e+r[7]*i+r[11]*s+r[15]*n,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,n=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*s-o*i,l=a*i+o*e-n*s,u=a*s+n*i-r*e,c=-n*e-r*i-o*s;return this.x=h*a+c*-n+l*-o-u*-r,this.y=l*a+c*-r+u*-n-h*-o,this.z=u*a+c*-o+h*-r-l*-n,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});s.prototype.sub=s.prototype.subtract,s.prototype.mul=s.prototype.multiply,s.prototype.div=s.prototype.divide,s.prototype.dist=s.prototype.distance,s.prototype.distSq=s.prototype.distanceSq,s.prototype.len=s.prototype.length,s.prototype.lenSq=s.prototype.lengthSq,t.exports=s},9557:t=>{t.exports=function(t,e,i){return Math.abs(t-e)<=i}},1071:t=>{t.exports=function(t,e,i){var s=i-e;return e+((t-e)%s+s)%s}},90447:t=>{t.exports=function(t,e,i,s){return Math.atan2(s-e,i-t)}},94240:t=>{t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},84066:t=>{t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},9678:t=>{t.exports=function(t,e,i,s){return Math.atan2(i-t,s-e)}},76861:(t,e,i)=>{var s=i(83392);t.exports=function(t){return t>Math.PI&&(t-=s.PI2),Math.abs(((t+s.TAU)%s.PI2-s.PI2)%s.PI2)}},37570:t=>{t.exports=function(t){return(t%=2*Math.PI)>=0?t:t+2*Math.PI}},87597:(t,e,i)=>{var s=i(61616);t.exports=function(){return s(-Math.PI,Math.PI)}},74493:(t,e,i)=>{var s=i(61616);t.exports=function(){return s(-180,180)}},19049:(t,e,i)=>{var s=i(37570);t.exports=function(t){return s(t+Math.PI)}},90612:(t,e,i)=>{var s=i(83392);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=s.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e{t.exports=function(t,e){var i=e-t;return 0===i?0:i-360*Math.floor((i- -180)/360)}},35786:(t,e,i)=>{var s=i(1071);t.exports=function(t){return s(t,-Math.PI,Math.PI)}},62138:(t,e,i)=>{var s=i(1071);t.exports=function(t){return s(t,-180,180)}},22153:(t,e,i)=>{t.exports={Between:i(90447),BetweenPoints:i(94240),BetweenPointsY:i(84066),BetweenY:i(9678),CounterClockwise:i(76861),Normalize:i(37570),Random:i(87597),RandomDegrees:i(74493),Reverse:i(19049),RotateTo:i(90612),ShortestBetween:i(93954),Wrap:i(35786),WrapDegrees:i(62138)}},83392:t=>{var e={PI2:2*Math.PI,TAU:.5*Math.PI,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:null,MIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER||-9007199254740991,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991};t.exports=e},53996:t=>{t.exports=function(t,e,i,s){var n=t-i,r=e-s;return Math.sqrt(n*n+r*r)}},92951:t=>{t.exports=function(t,e){var i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)}},12161:t=>{t.exports=function(t,e){var i=t.x-e.x,s=t.y-e.y;return i*i+s*s}},38057:t=>{t.exports=function(t,e,i,s){return Math.max(Math.abs(t-i),Math.abs(e-s))}},33297:t=>{t.exports=function(t,e,i,s,n){return void 0===n&&(n=2),Math.sqrt(Math.pow(i-t,n)+Math.pow(s-e,n))}},90366:t=>{t.exports=function(t,e,i,s){return Math.abs(t-i)+Math.abs(e-s)}},35032:t=>{t.exports=function(t,e,i,s){var n=t-i,r=e-s;return n*n+r*r}},10130:(t,e,i)=>{t.exports={Between:i(53996),BetweenPoints:i(92951),BetweenPointsSquared:i(12161),Chebyshev:i(38057),Power:i(33297),Snake:i(90366),Squared:i(35032)}},35060:(t,e,i)=>{var s=i(25265),n=i(57428),r=i(73214),o=i(71778),a=i(36468),h=i(88258),l=i(52910),u=i(67799),c=i(74083),d=i(92284),p=i(28035),f=i(8754);t.exports={Power0:l,Power1:u.Out,Power2:o.Out,Power3:c.Out,Power4:d.Out,Linear:l,Quad:u.Out,Cubic:o.Out,Quart:c.Out,Quint:d.Out,Sine:p.Out,Expo:h.Out,Circ:r.Out,Elastic:a.Out,Back:s.Out,Bounce:n.Out,Stepped:f,"Quad.easeIn":u.In,"Cubic.easeIn":o.In,"Quart.easeIn":c.In,"Quint.easeIn":d.In,"Sine.easeIn":p.In,"Expo.easeIn":h.In,"Circ.easeIn":r.In,"Elastic.easeIn":a.In,"Back.easeIn":s.In,"Bounce.easeIn":n.In,"Quad.easeOut":u.Out,"Cubic.easeOut":o.Out,"Quart.easeOut":c.Out,"Quint.easeOut":d.Out,"Sine.easeOut":p.Out,"Expo.easeOut":h.Out,"Circ.easeOut":r.Out,"Elastic.easeOut":a.Out,"Back.easeOut":s.Out,"Bounce.easeOut":n.Out,"Quad.easeInOut":u.InOut,"Cubic.easeInOut":o.InOut,"Quart.easeInOut":c.InOut,"Quint.easeInOut":d.InOut,"Sine.easeInOut":p.InOut,"Expo.easeInOut":h.InOut,"Circ.easeInOut":r.InOut,"Elastic.easeInOut":a.InOut,"Back.easeInOut":s.InOut,"Bounce.easeInOut":n.InOut}},25860:t=>{t.exports=function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)}},45264:t=>{t.exports=function(t,e){void 0===e&&(e=1.70158);var i=1.525*e;return(t*=2)<1?t*t*((i+1)*t-i)*.5:.5*((t-=2)*t*((i+1)*t+i)+2)}},36699:t=>{t.exports=function(t,e){return void 0===e&&(e=1.70158),--t*t*((e+1)*t+e)+1}},25265:(t,e,i)=>{t.exports={In:i(25860),Out:i(36699),InOut:i(45264)}},62191:t=>{t.exports=function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}},24799:t=>{t.exports=function(t){var e=!1;return t<.5?(t=1-2*t,e=!0):t=2*t-1,t<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5}},60819:t=>{t.exports=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},57428:(t,e,i)=>{t.exports={In:i(62191),Out:i(60819),InOut:i(24799)}},86855:t=>{t.exports=function(t){return 1-Math.sqrt(1-t*t)}},7280:t=>{t.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},18058:t=>{t.exports=function(t){return Math.sqrt(1- --t*t)}},73214:(t,e,i)=>{t.exports={In:i(86855),Out:i(18058),InOut:i(7280)}},91532:t=>{t.exports=function(t){return t*t*t}},63180:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},16518:t=>{t.exports=function(t){return--t*t*t+1}},71778:(t,e,i)=>{t.exports={In:i(91532),Out:i(16518),InOut:i(63180)}},24729:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)}},50325:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)*.5+1}},84074:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-s)*(2*Math.PI)/i)+1}},36468:(t,e,i)=>{t.exports={In:i(24729),Out:i(84074),InOut:i(50325)}},95638:t=>{t.exports=function(t){return Math.pow(2,10*(t-1))-.001}},10357:t=>{t.exports=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))}},14894:t=>{t.exports=function(t){return 1-Math.pow(2,-10*t)}},88258:(t,e,i)=>{t.exports={In:i(95638),Out:i(14894),InOut:i(10357)}},33063:(t,e,i)=>{t.exports={Back:i(25265),Bounce:i(57428),Circular:i(73214),Cubic:i(71778),Elastic:i(36468),Expo:i(88258),Linear:i(52910),Quadratic:i(67799),Quartic:i(74083),Quintic:i(92284),Sine:i(28035),Stepped:i(8754)}},43927:t=>{t.exports=function(t){return t}},52910:(t,e,i)=>{t.exports=i(43927)},77471:t=>{t.exports=function(t){return t*t}},83863:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},44383:t=>{t.exports=function(t){return t*(2-t)}},67799:(t,e,i)=>{t.exports={In:i(77471),Out:i(44383),InOut:i(83863)}},48311:t=>{t.exports=function(t){return t*t*t*t}},55248:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},23135:t=>{t.exports=function(t){return 1- --t*t*t*t}},74083:(t,e,i)=>{t.exports={In:i(48311),Out:i(23135),InOut:i(55248)}},7313:t=>{t.exports=function(t){return t*t*t*t*t}},98759:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},26670:t=>{t.exports=function(t){return--t*t*t*t*t+1}},92284:(t,e,i)=>{t.exports={In:i(7313),Out:i(26670),InOut:i(98759)}},52929:t=>{t.exports=function(t){return 0===t?0:1===t?1:1-Math.cos(t*Math.PI/2)}},66333:t=>{t.exports=function(t){return 0===t?0:1===t?1:.5*(1-Math.cos(Math.PI*t))}},37255:t=>{t.exports=function(t){return 0===t?0:1===t?1:Math.sin(t*Math.PI/2)}},28035:(t,e,i)=>{t.exports={In:i(52929),Out:i(37255),InOut:i(66333)}},52770:t=>{t.exports=function(t,e){return void 0===e&&(e=1),t<=0?0:t>=1?1:1/e*(1+(e*t|0))}},8754:(t,e,i)=>{t.exports=i(52770)},17247:t=>{t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},88456:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.floor(t+e)}},41935:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t>e-i}},54726:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t{t.exports={Ceil:i(17247),Equal:i(88456),Floor:i(61824),GreaterThan:i(41935),LessThan:i(54726)}},5923:(t,e,i)=>{var s=i(83392),n=i(98611),r={Angle:i(22153),Distance:i(10130),Easing:i(33063),Fuzzy:i(52778),Interpolation:i(48528),Pow2:i(73773),Snap:i(23679),RandomDataGenerator:i(81429),Average:i(26042),Bernstein:i(22824),Between:i(17489),CatmullRom:i(14976),CeilTo:i(89129),Clamp:i(82897),DegToRad:i(75606),Difference:i(767),Euler:i(9849),Factorial:i(8034),FloatBetween:i(61616),FloorTo:i(60679),FromPercent:i(91806),GetSpeed:i(79366),IsEven:i(43776),IsEvenStrict:i(58442),Linear:i(42798),LinearXY:i(61072),MaxAdd:i(69635),Median:i(37394),MinSub:i(17259),Percent:i(61820),RadToDeg:i(23701),RandomXY:i(16906),RandomXYZ:i(52417),RandomXYZW:i(17915),Rotate:i(52257),RotateAround:i(2386),RotateAroundDistance:i(72395),RotateTo:i(41061),RoundAwayFromZero:i(67233),RoundTo:i(64333),SinCosTableGenerator:i(59533),SmootherStep:i(87736),SmoothStep:i(5514),ToXY:i(55805),TransformXY:i(64462),Within:i(9557),Wrap:i(1071),Vector2:i(93736),Vector3:i(70015),Vector4:i(51729),Matrix3:i(5341),Matrix4:i(16650),Quaternion:i(75003),RotateVec3:i(93709)};r=n(!1,r,s),t.exports=r},63210:(t,e,i)=>{var s=i(22824);t.exports=function(t,e){for(var i=0,n=t.length-1,r=0;r<=n;r++)i+=Math.pow(1-e,n-r)*Math.pow(e,r)*t[r]*s(n,r);return i}},88332:(t,e,i)=>{var s=i(14976);t.exports=function(t,e){var i=t.length-1,n=i*e,r=Math.floor(n);return t[0]===t[i]?(e<0&&(r=Math.floor(n=i*(1+e))),s(n-r,t[(r-1+i)%i],t[r],t[(r+1)%i],t[(r+2)%i])):e<0?t[0]-(s(-n,t[0],t[0],t[1],t[1])-t[0]):e>1?t[i]-(s(n-i,t[i],t[i],t[i-1],t[i-1])-t[i]):s(n-r,t[r?r-1:0],t[r],t[i{t.exports=function(t,e,i,s,n){return function(t,e){var i=1-t;return i*i*i*e}(t,e)+function(t,e){var i=1-t;return 3*i*i*t*e}(t,i)+function(t,e){return 3*(1-t)*t*t*e}(t,s)+function(t,e){return t*t*t*e}(t,n)}},47614:(t,e,i)=>{var s=i(42798);t.exports=function(t,e){var i=t.length-1,n=i*e,r=Math.floor(n);return e<0?s(t[0],t[1],n):e>1?s(t[i],t[i-1],i-n):s(t[r],t[r+1>i?i:r+1],n-r)}},16252:t=>{t.exports=function(t,e,i,s){return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,s)}},44521:(t,e,i)=>{var s=i(5514);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},45507:(t,e,i)=>{var s=i(87736);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},48528:(t,e,i)=>{t.exports={Bezier:i(63210),CatmullRom:i(88332),CubicBezier:i(34631),Linear:i(47614),QuadraticBezier:i(16252),SmoothStep:i(44521),SmootherStep:i(45507)}},3504:t=>{t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<{t.exports=function(t,e){return t>0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},2018:t=>{t.exports=function(t){return t>0&&0==(t&t-1)}},73773:(t,e,i)=>{t.exports={GetNext:i(3504),IsSize:i(28621),IsValue:i(2018)}},81429:(t,e,i)=>{var s=new(i(56694))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,i=this.n;t=t.toString();for(var s=0;s>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e0;e--){var i=Math.floor(this.frac()*(e+1)),s=t[i];t[i]=t[e],t[e]=s}return t}});t.exports=s},82127:t=>{t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),s?(i+t)/e:i+t)}},84314:t=>{t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),s?(i+t)/e:i+t)}},88462:t=>{t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),s?(i+t)/e:i+t)}},23679:(t,e,i)=>{t.exports={Ceil:i(82127),Floor:i(84314),To:i(88462)}},10654:(t,e,i)=>{i(92244);var s=i(86459),n=i(98611),r={Actions:i(83979),Animations:i(13517),BlendModes:i(95723),Cache:i(45820),Cameras:i(44143),Core:i(80293),Class:i(56694),Create:i(84106),Curves:i(73962),Data:i(1999),Display:i(24816),DOM:i(3590),Events:i(95146),Game:i(15213),GameObjects:i(48013),Geom:i(84068),Input:i(20873),Loader:i(95695),Math:i(5923),Physics:i(53954),Plugins:i(45615),Renderer:i(42069),Scale:i(86754),ScaleModes:i(27394),Scene:i(87157),Scenes:i(20436),Structs:i(20010),Textures:i(87499),Tilemaps:i(52678),Time:i(97121),Tweens:i(75193),Utils:i(22178)};r.Sound=i(56751),r=n(!1,r,s),t.exports=r,i.g.Phaser=r},62832:(t,e,i)=>{var s=i(56694),n=i(7864),r=i(1539),o=new s({Extends:r,Mixins:[n.Acceleration,n.Angular,n.Bounce,n.Debug,n.Drag,n.Enable,n.Friction,n.Gravity,n.Immovable,n.Mass,n.Pushable,n.Size,n.Velocity],initialize:function(t,e,i,s,n){r.call(this,t,e,i,s,n),this.body=null}});t.exports=o},66150:(t,e,i)=>{var s=i(56694),n=i(75606),r=i(53996),o=i(35032),a=i(99523),h=i(72632),l=i(30657),u=i(2732),c=i(15147),d=i(91963),p=i(7599),f=i(93736),v=i(85233),g=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,t.sys.events.once(p.BOOT,this.boot,this),t.sys.events.on(p.START,this.start,this)},boot:function(){this.world=new v(this.scene,this.config),this.add=new a(this.world),this.systems.events.once(p.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new v(this.scene,this.config),this.add=new a(this.world));var t=this.systems.events;h(this.config,"customUpdate",!1)||t.on(p.UPDATE,this.world.update,this.world),t.on(p.POST_UPDATE,this.world.postUpdate,this.world),t.once(p.SHUTDOWN,this.shutdown,this)},enableUpdate:function(){this.systems.events.on(p.UPDATE,this.world.update,this.world)},disableUpdate:function(){this.systems.events.off(p.UPDATE,this.world.update,this.world)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return l(h(e,"arcade",{}),h(t,"arcade",{}))},overlap:function(t,e,i,s,n){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=i),this.world.collideObjects(t,e,i,s,n,!0)},collide:function(t,e,i,s,n){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=i),this.world.collideObjects(t,e,i,s,n,!1)},collideTiles:function(t,e,i,s,n){return this.world.collideTiles(t,e,i,s,n)},overlapTiles:function(t,e,i,s,n){return this.world.overlapTiles(t,e,i,s,n)},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},accelerateTo:function(t,e,i,s,n,r){void 0===s&&(s=60);var o=Math.atan2(i-t.y,e-t.x);return t.body.acceleration.setToPolar(o,s),void 0!==n&&void 0!==r&&t.body.maxVelocity.set(n,r),o},accelerateToObject:function(t,e,i,s,n){return this.accelerateTo(t,e.x,e.y,i,s,n)},closest:function(t,e){e||(e=this.world.bodies.entries);for(var i=Number.MAX_VALUE,s=null,n=t.x,r=t.y,a=e.length,h=0;hi&&(s=l,i=c)}}return s},moveTo:function(t,e,i,s,n){void 0===s&&(s=60),void 0===n&&(n=0);var o=Math.atan2(i-t.y,e-t.x);return n>0&&(s=r(t.x,t.y,e,i)/(n/1e3)),t.body.velocity.setToPolar(o,s),o},moveToObject:function(t,e,i,s){return this.moveTo(t,e.x,e.y,i,s)},velocityFromAngle:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new f),i.setToPolar(n(t),e)},velocityFromRotation:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new f),i.setToPolar(t,e)},overlapRect:function(t,e,i,s,n,r){return c(this.world,t,e,i,s,n,r)},overlapCirc:function(t,e,i,s,n){return u(this.world,t,e,i,s,n)},shutdown:function(){if(this.world){var t=this.systems.events;t.off(p.UPDATE,this.world.update,this.world),t.off(p.POST_UPDATE,this.world.postUpdate,this.world),t.off(p.SHUTDOWN,this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null}},destroy:function(){this.shutdown(),this.scene.sys.events.off(p.START,this.start,this),this.scene=null,this.systems=null}});d.register("ArcadePhysics",g,"arcadePhysics"),t.exports=g},25084:(t,e,i)=>{var s=i(56694),n=i(7864),r=i(13747),o=new s({Extends:r,Mixins:[n.Acceleration,n.Angular,n.Bounce,n.Debug,n.Drag,n.Enable,n.Friction,n.Gravity,n.Immovable,n.Mass,n.Pushable,n.Size,n.Velocity],initialize:function(t,e,i,s,n){r.call(this,t,e,i,s,n),this.body=null}});t.exports=o},97602:(t,e,i)=>{var s=i(56694),n=i(47401),r=i(27037),o=i(23701),a=i(74118),h=i(94287),l=i(93736),u=new s({initialize:function(t,e){var i=64,s=64,r=void 0!==e;r&&e.displayWidth&&(i=e.displayWidth,s=e.displayHeight),r||(e={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0}),this.world=t,this.gameObject=r?e:void 0,this.isBody=!0,this.transform={x:e.x,y:e.y,rotation:e.angle,scaleX:e.scaleX,scaleY:e.scaleY,displayOriginX:e.displayOriginX,displayOriginY:e.displayOriginY},this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new l,this.position=new l(e.x-e.scaleX*e.displayOriginX,e.y-e.scaleY*e.displayOriginY),this.prev=this.position.clone(),this.prevFrame=this.position.clone(),this.allowRotation=!0,this.rotation=e.angle,this.preRotation=e.angle,this.width=i,this.height=s,this.sourceWidth=i,this.sourceHeight=s,e.frame&&(this.sourceWidth=e.frame.realWidth,this.sourceHeight=e.frame.realHeight),this.halfWidth=Math.abs(i/2),this.halfHeight=Math.abs(s/2),this.center=new l(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=new l,this.newVelocity=new l,this.deltaMax=new l,this.acceleration=new l,this.allowDrag=!0,this.drag=new l,this.allowGravity=!0,this.gravity=new l,this.bounce=new l,this.worldBounce=null,this.customBoundsRectangle=t.bounds,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new l(1e4,1e4),this.maxSpeed=-1,this.friction=new l(1,0),this.useDamping=!1,this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=n.FACING_NONE,this.immovable=!1,this.pushable=!0,this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.syncBounds=!1,this.physicsType=n.DYNAMIC_BODY,this._sx=e.scaleX,this._sy=e.scaleY,this._dx=0,this._dy=0,this._tx=0,this._ty=0,this._bounds=new a},updateBounds:function(){var t=this.gameObject,e=this.transform;if(t.parentContainer){var i=t.getWorldTransformMatrix(this.world._tempMatrix,this.world._tempMatrix2);e.x=i.tx,e.y=i.ty,e.rotation=o(i.rotation),e.scaleX=i.scaleX,e.scaleY=i.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY}else e.x=t.x,e.y=t.y,e.rotation=t.angle,e.scaleX=t.scaleX,e.scaleY=t.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY;var s=!1;if(this.syncBounds){var n=t.getBounds(this._bounds);this.width=n.width,this.height=n.height,s=!0}else{var r=Math.abs(e.scaleX),a=Math.abs(e.scaleY);this._sx===r&&this._sy===a||(this.width=this.sourceWidth*r,this.height=this.sourceHeight*a,this._sx=r,this._sy=a,s=!0)}s&&(this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter())},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},updateFromGameObject:function(){this.updateBounds();var t=this.transform;this.position.x=t.x+t.scaleX*(this.offset.x-t.displayOriginX),this.position.y=t.y+t.scaleY*(this.offset.y-t.displayOriginY),this.updateCenter()},resetFlags:function(t){void 0===t&&(t=!1);var e=this.wasTouching,i=this.touching,s=this.blocked;t?(e.none=!0,e.up=!1,e.down=!1,e.left=!1,e.right=!1):(e.none=i.none,e.up=i.up,e.down=i.down,e.left=i.left,e.right=i.right),i.none=!0,i.up=!1,i.down=!1,i.left=!1,i.right=!1,s.none=!0,s.up=!1,s.down=!1,s.left=!1,s.right=!1,this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1},preUpdate:function(t,e){t&&this.resetFlags(),this.gameObject&&this.updateFromGameObject(),this.rotation=this.transform.rotation,this.preRotation=this.rotation,this.moves&&(this.prev.x=this.position.x,this.prev.y=this.position.y,this.prevFrame.x=this.position.x,this.prevFrame.y=this.position.y),t&&this.update(e)},update:function(t){if(this.prev.x=this.position.x,this.prev.y=this.position.y,this.moves){this.world.updateMotion(this,t);var e=this.velocity.x,i=this.velocity.y;this.newVelocity.set(e*t,i*t),this.position.add(this.newVelocity),this.updateCenter(),this.angle=Math.atan2(i,e),this.speed=Math.sqrt(e*e+i*i),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds&&this.world.emit(r.WORLD_BOUNDS,this,this.blocked.up,this.blocked.down,this.blocked.left,this.blocked.right)}this._dx=this.position.x-this.prev.x,this._dy=this.position.y-this.prev.y},postUpdate:function(){var t=this.position.x-this.prevFrame.x,e=this.position.y-this.prevFrame.y,i=this.gameObject;if(this.moves){var s=this.deltaMax.x,r=this.deltaMax.y;0!==s&&0!==t&&(t<0&&t<-s?t=-s:t>0&&t>s&&(t=s)),0!==r&&0!==e&&(e<0&&e<-r?e=-r:e>0&&e>r&&(e=r)),i&&(i.x+=t,i.y+=e)}t<0?this.facing=n.FACING_LEFT:t>0&&(this.facing=n.FACING_RIGHT),e<0?this.facing=n.FACING_UP:e>0&&(this.facing=n.FACING_DOWN),this.allowRotation&&i&&(i.angle+=this.deltaZ()),this._tx=t,this._ty=e},setBoundsRectangle:function(t){return this.customBoundsRectangle=t||this.world.bounds,this},checkWorldBounds:function(){var t=this.position,e=this.customBoundsRectangle,i=this.world.checkCollision,s=this.worldBounce?-this.worldBounce.x:-this.bounce.x,n=this.worldBounce?-this.worldBounce.y:-this.bounce.y,r=!1;return t.xe.right&&i.right&&(t.x=e.right-this.width,this.velocity.x*=s,this.blocked.right=!0,r=!0),t.ye.bottom&&i.down&&(t.y=e.bottom-this.height,this.velocity.y*=n,this.blocked.down=!0,r=!0),r&&(this.blocked.none=!1,this.updateCenter()),r},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this},setGameObject:function(t,e){return void 0===e&&(e=!0),this.world.remove(this),this.gameObject&&this.gameObject.body&&(this.gameObject.body=null),this.gameObject=t,t.body&&(t.body=this),this.setSize(),this.world.add(this),this.enable=e,this},setSize:function(t,e,i){void 0===i&&(i=!0);var s=this.gameObject;if(s&&(!t&&s.frame&&(t=s.frame.realWidth),!e&&s.frame&&(e=s.frame.realHeight)),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&s&&s.getCenter){var n=(s.width-t)/2,r=(s.height-e)/2;this.offset.set(n,r)}return this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.isCircle=!0,this.radius=t,this.sourceWidth=2*t,this.sourceHeight=2*t,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter()):this.isCircle=!1,this},reset:function(t,e){this.stop();var i=this.gameObject;i&&(i.setPosition(t,e),this.rotation=i.angle,this.preRotation=i.angle);var s=this.position;i&&i.getTopLeft?i.getTopLeft(s):s.set(t,e),this.prev.copy(s),this.prevFrame.copy(s),i&&this.updateBounds(),this.updateCenter(),this.checkWorldBounds(),this.resetFlags(!0)},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?this.radius>0&&t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom&&(this.center.x-t)*(this.center.x-t)+(this.center.y-e)*(this.center.y-e)<=this.radius*this.radius:h(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this._dx>0?this._dx:-this._dx},deltaAbsY:function(){return this._dy>0?this._dy:-this._dy},deltaX:function(){return this._dx},deltaY:function(){return this._dy},deltaXFinal:function(){return this._tx},deltaYFinal:function(){return this._ty},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.enable=!1,this.world&&this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,s=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor),this.isCircle?t.strokeCircle(i,s,this.width/2):(this.checkCollision.up&&t.lineBetween(e.x,e.y,e.x+this.width,e.y),this.checkCollision.right&&t.lineBetween(e.x+this.width,e.y,e.x+this.width,e.y+this.height),this.checkCollision.down&&t.lineBetween(e.x,e.y+this.height,e.x+this.width,e.y+this.height),this.checkCollision.left&&t.lineBetween(e.x,e.y,e.x,e.y+this.height))),this.debugShowVelocity&&(t.lineStyle(t.defaultStrokeWidth,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,s,i+this.velocity.x/2,s+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setCollideWorldBounds:function(t,e,i,s){void 0===t&&(t=!0),this.collideWorldBounds=t;var n=void 0!==e,r=void 0!==i;return(n||r)&&(this.worldBounce||(this.worldBounce=new l),n&&(this.worldBounce.x=e),r&&(this.worldBounce.y=i)),void 0!==s&&(this.onWorldBounds=s),this},setValue:function(t,e,i){return void 0===e&&(e=t.x),void 0===i&&(i=t.y),t.set(e,i),this},setVelocity:function(t,e){return this.velocity.set(t,e),t=this.velocity.x,e=this.velocity.y,this.speed=Math.sqrt(t*t+e*e),this},setVelocityX:function(t){return this.setVelocity(t,this.velocity.y)},setVelocityY:function(t){return this.setVelocity(this.velocity.x,t)},setMaxVelocity:function(t,e){return this.maxVelocity.set(t,e),this},setMaxVelocityX:function(t){return this.maxVelocity.x=t,this},setMaxVelocityY:function(t){return this.maxVelocity.y=t,this},setMaxSpeed:function(t){return this.maxSpeed=t,this},setBounce:function(t,e){return this.bounce.set(t,e),this},setBounceX:function(t){return this.bounce.x=t,this},setBounceY:function(t){return this.bounce.y=t,this},setAcceleration:function(t,e){return this.acceleration.set(t,e),this},setAccelerationX:function(t){return this.acceleration.x=t,this},setAccelerationY:function(t){return this.acceleration.y=t,this},setAllowDrag:function(t){return void 0===t&&(t=!0),this.allowDrag=t,this},setAllowGravity:function(t){return void 0===t&&(t=!0),this.allowGravity=t,this},setAllowRotation:function(t){return void 0===t&&(t=!0),this.allowRotation=t,this},setDrag:function(t,e){return this.drag.set(t,e),this},setDamping:function(t){return this.useDamping=t,this},setDragX:function(t){return this.drag.x=t,this},setDragY:function(t){return this.drag.y=t,this},setGravity:function(t,e){return this.gravity.set(t,e),this},setGravityX:function(t){return this.gravity.x=t,this},setGravityY:function(t){return this.gravity.y=t,this},setFriction:function(t,e){return this.friction.set(t,e),this},setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setAngularVelocity:function(t){return this.angularVelocity=t,this},setAngularAcceleration:function(t){return this.angularAcceleration=t,this},setAngularDrag:function(t){return this.angularDrag=t,this},setMass:function(t){return this.mass=t,this},setImmovable:function(t){return void 0===t&&(t=!0),this.immovable=t,this},setEnable:function(t){return void 0===t&&(t=!0),this.enable=t,this},processX:function(t,e,i,s){this.x+=t,this.updateCenter(),null!==e&&(this.velocity.x=e);var n=this.blocked;i&&(n.left=!0),s&&(n.right=!0)},processY:function(t,e,i,s){this.y+=t,this.updateCenter(),null!==e&&(this.velocity.y=e);var n=this.blocked;i&&(n.up=!0),s&&(n.down=!0)},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=u},3909:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s,n,r,o){this.world=t,this.name="",this.active=!0,this.overlapOnly=e,this.object1=i,this.object2=s,this.collideCallback=n,this.processCallback=r,this.callbackContext=o},setName:function(t){return this.name=t,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});t.exports=s},99523:(t,e,i)=>{var s=i(62832),n=i(25084),r=i(97602),o=i(56694),a=i(47401),h=i(10481),l=i(66634),u=i(46346),c=new o({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},collider:function(t,e,i,s,n){return this.world.addCollider(t,e,i,s,n)},overlap:function(t,e,i,s,n){return this.world.addOverlap(t,e,i,s,n)},existing:function(t,e){var i=e?a.STATIC_BODY:a.DYNAMIC_BODY;return this.world.enableBody(t,i),t},staticImage:function(t,e,i,n){var r=new s(this.scene,t,e,i,n);return this.sys.displayList.add(r),this.world.enableBody(r,a.STATIC_BODY),r},image:function(t,e,i,n){var r=new s(this.scene,t,e,i,n);return this.sys.displayList.add(r),this.world.enableBody(r,a.DYNAMIC_BODY),r},staticSprite:function(t,e,i,s){var r=new n(this.scene,t,e,i,s);return this.sys.displayList.add(r),this.sys.updateList.add(r),this.world.enableBody(r,a.STATIC_BODY),r},sprite:function(t,e,i,s){var r=new n(this.scene,t,e,i,s);return this.sys.displayList.add(r),this.sys.updateList.add(r),this.world.enableBody(r,a.DYNAMIC_BODY),r},staticGroup:function(t,e){return this.sys.updateList.add(new u(this.world,this.world.scene,t,e))},group:function(t,e){return this.sys.updateList.add(new h(this.world,this.world.scene,t,e))},body:function(t,e,i,s){var n=new r(this.world);return n.position.set(t,e),i&&s&&n.setSize(i,s),this.world.add(n,a.DYNAMIC_BODY),n},staticBody:function(t,e,i,s){var n=new l(this.world);return n.position.set(t,e),i&&s&&n.setSize(i,s),this.world.add(n,a.STATIC_BODY),n},destroy:function(){this.world=null,this.scene=null,this.sys=null}});t.exports=c},75671:(t,e,i)=>{var s=i(47401);t.exports=function(t,e,i,n){var r=0,o=t.deltaAbsX()+e.deltaAbsX()+n;return 0===t._dx&&0===e._dx?(t.embedded=!0,e.embedded=!0):t._dx>e._dx?(r=t.right-e.x)>o&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?r=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.right=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.left=!0)):t._dxo&&!i||!1===t.checkCollision.left||!1===e.checkCollision.right?r=0:(t.touching.none=!1,t.touching.left=!0,e.touching.none=!1,e.touching.right=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.left=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.right=!0))),t.overlapX=r,e.overlapX=r,r}},66185:(t,e,i)=>{var s=i(47401);t.exports=function(t,e,i,n){var r=0,o=t.deltaAbsY()+e.deltaAbsY()+n;return 0===t._dy&&0===e._dy?(t.embedded=!0,e.embedded=!0):t._dy>e._dy?(r=t.bottom-e.y)>o&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?r=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.down=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.up=!0)):t._dyo&&!i||!1===t.checkCollision.up||!1===e.checkCollision.down?r=0:(t.touching.none=!1,t.touching.up=!0,e.touching.none=!1,e.touching.down=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.up=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.down=!0))),t.overlapY=r,e.overlapY=r,r}},10481:(t,e,i)=>{var s=i(25084),n=i(56694),r=i(47401),o=i(72632),a=i(59192),h=i(42911),l=new n({Extends:a,initialize:function(t,e,i,n){if(i||n)if(h(i))n=i,i=null,n.internalCreateCallback=this.createCallbackHandler,n.internalRemoveCallback=this.removeCallbackHandler;else if(Array.isArray(i)&&h(i[0])){n=i[0];var l=this;i.forEach((function(t){t.internalCreateCallback=l.createCallbackHandler,t.internalRemoveCallback=l.removeCallbackHandler})),i=null}else n={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};else n={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};this.world=t,n.classType=o(n,"classType",s),this.physicsType=r.DYNAMIC_BODY,this.defaults={setCollideWorldBounds:o(n,"collideWorldBounds",!1),setBoundsRectangle:o(n,"customBoundsRectangle",null),setAccelerationX:o(n,"accelerationX",0),setAccelerationY:o(n,"accelerationY",0),setAllowDrag:o(n,"allowDrag",!0),setAllowGravity:o(n,"allowGravity",!0),setAllowRotation:o(n,"allowRotation",!0),setBounceX:o(n,"bounceX",0),setBounceY:o(n,"bounceY",0),setDragX:o(n,"dragX",0),setDragY:o(n,"dragY",0),setEnable:o(n,"enable",!0),setGravityX:o(n,"gravityX",0),setGravityY:o(n,"gravityY",0),setFrictionX:o(n,"frictionX",0),setFrictionY:o(n,"frictionY",0),setMaxVelocityX:o(n,"maxVelocityX",1e4),setMaxVelocityY:o(n,"maxVelocityY",1e4),setVelocityX:o(n,"velocityX",0),setVelocityY:o(n,"velocityY",0),setAngularVelocity:o(n,"angularVelocity",0),setAngularAcceleration:o(n,"angularAcceleration",0),setAngularDrag:o(n,"angularDrag",0),setMass:o(n,"mass",1),setImmovable:o(n,"immovable",!1)},a.call(this,e,i,n),this.type="PhysicsGroup"},createCallbackHandler:function(t){t.body||this.world.enableBody(t,r.DYNAMIC_BODY);var e=t.body;for(var i in this.defaults)e[i](this.defaults[i])},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},setVelocity:function(t,e,i){void 0===i&&(i=0);for(var s=this.getChildren(),n=0;n{var e,i,s,n,r,o,a,h,l,u,c,d,p,f,v,g,m,y=function(){return u&&v&&i.blocked.right?(e.processX(-m,a,!1,!0),1):l&&g&&i.blocked.left?(e.processX(m,a,!0),1):p&&g&&e.blocked.right?(i.processX(-m,h,!1,!0),2):d&&v&&e.blocked.left?(i.processX(m,h,!0),2):0},x=function(t){if(s&&n)m*=.5,0===t||3===t?(e.processX(m,r),i.processX(-m,o)):(e.processX(-m,r),i.processX(m,o));else if(s&&!n)0===t||3===t?e.processX(m,a,!0):e.processX(-m,a,!1,!0);else if(!s&&n)0===t||3===t?i.processX(-m,h,!1,!0):i.processX(m,h,!0);else{var v=.5*m;0===t?f?(e.processX(m,0,!0),i.processX(0,null,!1,!0)):p?(e.processX(v,0,!0),i.processX(-v,0,!1,!0)):(e.processX(v,i.velocity.x,!0),i.processX(-v,null,!1,!0)):1===t?c?(e.processX(0,null,!1,!0),i.processX(m,0,!0)):u?(e.processX(-v,0,!1,!0),i.processX(v,0,!0)):(e.processX(-v,null,!1,!0),i.processX(v,e.velocity.x,!0)):2===t?f?(e.processX(-m,0,!1,!0),i.processX(0,null,!0)):d?(e.processX(-v,0,!1,!0),i.processX(v,0,!0)):(e.processX(-v,i.velocity.x,!1,!0),i.processX(v,null,!0)):3===t&&(c?(e.processX(0,null,!0),i.processX(-m,0,!1,!0)):l?(e.processX(v,0,!0),i.processX(-v,0,!1,!0)):(e.processX(v,i.velocity.y,!0),i.processX(-v,null,!1,!0)))}return!0};t.exports={BlockCheck:y,Check:function(){var t=e.velocity.x,s=i.velocity.x,n=Math.sqrt(s*s*i.mass/e.mass)*(s>0?1:-1),a=Math.sqrt(t*t*e.mass/i.mass)*(t>0?1:-1),h=.5*(n+a);return a-=h,r=h+(n-=h)*e.bounce.x,o=h+a*i.bounce.x,l&&g?x(0):d&&v?x(1):u&&v?x(2):!(!p||!g)&&x(3)},Set:function(t,r,o){i=r;var x=(e=t).velocity.x,T=i.velocity.x;return s=e.pushable,l=e._dx<0,u=e._dx>0,c=0===e._dx,v=Math.abs(e.right-i.x)<=Math.abs(i.right-e.x),a=T-x*e.bounce.x,n=i.pushable,d=i._dx<0,p=i._dx>0,f=0===i._dx,g=!v,h=x-T*i.bounce.x,m=Math.abs(o),y()},Run:x,RunImmovableBody1:function(t){1===t?i.velocity.x=0:v?i.processX(m,h,!0):i.processX(-m,h,!1,!0),e.moves&&(i.y+=(e.y-e.prev.y)*e.friction.y,i._dy=i.y-i.prev.y)},RunImmovableBody2:function(t){2===t?e.velocity.x=0:g?e.processX(m,a,!0):e.processX(-m,a,!1,!0),i.moves&&(e.y+=(i.y-i.prev.y)*i.friction.y,e._dy=e.y-e.prev.y)}}},67050:t=>{var e,i,s,n,r,o,a,h,l,u,c,d,p,f,v,g,m,y=function(){return u&&v&&i.blocked.down?(e.processY(-m,a,!1,!0),1):l&&g&&i.blocked.up?(e.processY(m,a,!0),1):p&&g&&e.blocked.down?(i.processY(-m,h,!1,!0),2):d&&v&&e.blocked.up?(i.processY(m,h,!0),2):0},x=function(t){if(s&&n)m*=.5,0===t||3===t?(e.processY(m,r),i.processY(-m,o)):(e.processY(-m,r),i.processY(m,o));else if(s&&!n)0===t||3===t?e.processY(m,a,!0):e.processY(-m,a,!1,!0);else if(!s&&n)0===t||3===t?i.processY(-m,h,!1,!0):i.processY(m,h,!0);else{var v=.5*m;0===t?f?(e.processY(m,0,!0),i.processY(0,null,!1,!0)):p?(e.processY(v,0,!0),i.processY(-v,0,!1,!0)):(e.processY(v,i.velocity.y,!0),i.processY(-v,null,!1,!0)):1===t?c?(e.processY(0,null,!1,!0),i.processY(m,0,!0)):u?(e.processY(-v,0,!1,!0),i.processY(v,0,!0)):(e.processY(-v,null,!1,!0),i.processY(v,e.velocity.y,!0)):2===t?f?(e.processY(-m,0,!1,!0),i.processY(0,null,!0)):d?(e.processY(-v,0,!1,!0),i.processY(v,0,!0)):(e.processY(-v,i.velocity.y,!1,!0),i.processY(v,null,!0)):3===t&&(c?(e.processY(0,null,!0),i.processY(-m,0,!1,!0)):l?(e.processY(v,0,!0),i.processY(-v,0,!1,!0)):(e.processY(v,i.velocity.y,!0),i.processY(-v,null,!1,!0)))}return!0};t.exports={BlockCheck:y,Check:function(){var t=e.velocity.y,s=i.velocity.y,n=Math.sqrt(s*s*i.mass/e.mass)*(s>0?1:-1),a=Math.sqrt(t*t*e.mass/i.mass)*(t>0?1:-1),h=.5*(n+a);return a-=h,r=h+(n-=h)*e.bounce.y,o=h+a*i.bounce.y,l&&g?x(0):d&&v?x(1):u&&v?x(2):!(!p||!g)&&x(3)},Set:function(t,r,o){i=r;var x=(e=t).velocity.y,T=i.velocity.y;return s=e.pushable,l=e._dy<0,u=e._dy>0,c=0===e._dy,v=Math.abs(e.bottom-i.y)<=Math.abs(i.bottom-e.y),a=T-x*e.bounce.y,n=i.pushable,d=i._dy<0,p=i._dy>0,f=0===i._dy,g=!v,h=x-T*i.bounce.y,m=Math.abs(o),y()},Run:x,RunImmovableBody1:function(t){1===t?i.velocity.y=0:v?i.processY(m,h,!0):i.processY(-m,h,!1,!0),e.moves&&(i.x+=(e.x-e.prev.x)*e.friction.x,i._dx=i.x-i.prev.x)},RunImmovableBody2:function(t){2===t?e.velocity.y=0:g?e.processY(m,a,!0):e.processY(-m,a,!1,!0),i.moves&&(e.x+=(i.x-i.prev.x)*i.friction.x,e._dx=e.x-e.prev.x)}}},61777:(t,e,i)=>{var s=i(75671),n=i(22916);t.exports=function(t,e,i,r){var o=s(t,e,i,r),a=t.immovable,h=e.immovable;if(i||0===o||a&&h||t.customSeparateX||e.customSeparateX)return 0!==o||t.embedded&&e.embedded;var l=n.Set(t,e,o);return a||h?(a?n.RunImmovableBody1(l):h&&n.RunImmovableBody2(l),!0):l>0||n.Check()}},25299:(t,e,i)=>{var s=i(66185),n=i(67050);t.exports=function(t,e,i,r){var o=s(t,e,i,r),a=t.immovable,h=e.immovable;if(i||0===o||a&&h||t.customSeparateY||e.customSeparateY)return 0!==o||t.embedded&&e.embedded;var l=n.Set(t,e,o);return a||h?(a?n.RunImmovableBody1(l):h&&n.RunImmovableBody2(l),!0):l>0||n.Check()}},66634:(t,e,i)=>{var s=i(65650),n=i(56694),r=i(47401),o=i(94287),a=i(93736),h=new n({initialize:function(t,e){var i=64,s=64,n=void 0!==e;n&&e.displayWidth&&(i=e.displayWidth,s=e.displayHeight),n||(e={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0}),this.world=t,this.gameObject=n?e:void 0,this.isBody=!0,this.debugShowBody=t.defaults.debugShowStaticBody,this.debugBodyColor=t.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new a,this.position=new a(e.x-i*e.originX,e.y-s*e.originY),this.width=i,this.height=s,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new a(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=a.ZERO,this.allowGravity=!1,this.gravity=a.ZERO,this.bounce=a.ZERO,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.mass=1,this.immovable=!0,this.pushable=!1,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.physicsType=r.STATIC_BODY,this._dx=0,this._dy=0},setGameObject:function(t,e){return t&&t!==this.gameObject&&(this.gameObject.body=null,t.body=this,this.gameObject=t),e&&this.updateFromGameObject(),this},updateFromGameObject:function(){this.world.staticTree.remove(this);var t=this.gameObject;return t.getTopLeft(this.position),this.width=t.displayWidth,this.height=t.displayHeight,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.world.staticTree.insert(this),this},setOffset:function(t,e){return void 0===e&&(e=t),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(t,e),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(t,e,i){void 0===i&&(i=!0);var s=this.gameObject;if(!t&&s.frame&&(t=s.frame.realWidth),!e&&s.frame&&(e=s.frame.realHeight),this.world.staticTree.remove(this),this.width=t,this.height=e,this.halfWidth=Math.floor(t/2),this.halfHeight=Math.floor(e/2),i&&s.getCenter){var n=s.displayWidth/2,r=s.displayHeight/2;this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(n-this.halfWidth,r-this.halfHeight),this.position.x+=this.offset.x,this.position.y+=this.offset.y}return this.updateCenter(),this.isCircle=!1,this.radius=0,this.world.staticTree.insert(this),this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=t,this.width=2*t,this.height=2*t,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(t,e){var i=this.gameObject;void 0===t&&(t=i.x),void 0===e&&(e=i.y),this.world.staticTree.remove(this),i.setPosition(t,e),i.getTopLeft(this.position),this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?s(this,t,e):o(this,t,e)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,s=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor,1),this.isCircle?t.strokeCircle(i,s,this.width/2):t.strokeRect(e.x,e.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(t){return t<=0&&(t=.1),this.mass=t,this},x:{get:function(){return this.position.x},set:function(t){this.world.staticTree.remove(this),this.position.x=t,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(t){this.world.staticTree.remove(this),this.position.y=t,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=h},46346:(t,e,i)=>{var s=i(25084),n=i(56694),r=i(47401),o=i(72632),a=i(59192),h=i(42911),l=new n({Extends:a,initialize:function(t,e,i,n){i||n?h(i)?(n=i,i=null,n.internalCreateCallback=this.createCallbackHandler,n.internalRemoveCallback=this.removeCallbackHandler,n.createMultipleCallback=this.createMultipleCallbackHandler,n.classType=o(n,"classType",s)):Array.isArray(i)&&h(i[0])?(n=i,i=null,n.forEach((function(t){t.internalCreateCallback=this.createCallbackHandler,t.internalRemoveCallback=this.removeCallbackHandler,t.createMultipleCallback=this.createMultipleCallbackHandler,t.classType=o(t,"classType",s)}))):n={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler}:n={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler,createMultipleCallback:this.createMultipleCallbackHandler,classType:s},this.world=t,this.physicsType=r.STATIC_BODY,a.call(this,e,i,n),this.type="StaticPhysicsGroup"},createCallbackHandler:function(t){t.body||this.world.enableBody(t,r.STATIC_BODY)},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},createMultipleCallbackHandler:function(){this.refresh()},refresh:function(){for(var t=this.children.entries,e=0;e{var s=i(94240),n=i(97602),r=i(82897),o=i(56694),a=i(3909),h=i(47401),l=i(53996),u=i(6659),c=i(27037),d=i(88456),p=i(41935),f=i(54726),v=i(75671),g=i(66185),m=i(44662),y=i(10850),x=i(83392),T=i(74623),w=i(25163),b=i(74118),E=i(68687),S=i(27354),A=i(61777),_=i(25299),C=i(58403),R=i(66634),M=i(28808),P=i(69360),O=i(93736),L=i(1071),F=new o({Extends:u,initialize:function(t,e){u.call(this),this.scene=t,this.bodies=new C,this.staticBodies=new C,this.pendingDestroy=new C,this.colliders=new T,this.gravity=new O(y(e,"gravity.x",0),y(e,"gravity.y",0)),this.bounds=new b(y(e,"x",0),y(e,"y",0),y(e,"width",t.sys.scale.width),y(e,"height",t.sys.scale.height)),this.checkCollision={up:y(e,"checkCollision.up",!0),down:y(e,"checkCollision.down",!0),left:y(e,"checkCollision.left",!0),right:y(e,"checkCollision.right",!0)},this.fps=y(e,"fps",60),this.fixedStep=y(e,"fixedStep",!0),this._elapsed=0,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this.stepsLastFrame=0,this.timeScale=y(e,"timeScale",1),this.OVERLAP_BIAS=y(e,"overlapBias",4),this.TILE_BIAS=y(e,"tileBias",16),this.forceX=y(e,"forceX",!1),this.isPaused=y(e,"isPaused",!1),this._total=0,this.drawDebug=y(e,"debug",!1),this.debugGraphic,this.defaults={debugShowBody:y(e,"debugShowBody",!0),debugShowStaticBody:y(e,"debugShowStaticBody",!0),debugShowVelocity:y(e,"debugShowVelocity",!0),bodyDebugColor:y(e,"debugBodyColor",16711935),staticBodyDebugColor:y(e,"debugStaticBodyColor",255),velocityDebugColor:y(e,"debugVelocityColor",65280)},this.maxEntries=y(e,"maxEntries",16),this.useTree=y(e,"useTree",!0),this.tree=new E(this.maxEntries),this.staticTree=new E(this.maxEntries),this.treeMinMax={minX:0,minY:0,maxX:0,maxY:0},this._tempMatrix=new P,this._tempMatrix2=new P,this.tileFilterOptions={isColliding:!0,isNotEmpty:!0,hasInterestingFace:!0},this.drawDebug&&this.createDebugGraphic()},enable:function(t,e){void 0===e&&(e=h.DYNAMIC_BODY),Array.isArray(t)||(t=[t]);for(var i=0;i=r;for(this.fixedStep||(n=.001*e,a=!0,this._elapsed=0),i=0;i=r;)this._elapsed-=r,this.step(n)}},step:function(t){var e,i,s=this.bodies.entries,n=s.length;for(e=0;e0){var l=this.tree,u=this.staticTree;for(s=(i=a.entries).length,t=0;t-1&&c>v&&(t.velocity.normalize().scale(v),c=v),t.speed=c},separate:function(t,e,i,s,n){if(!t.enable||!e.enable||t.checkCollision.none||e.checkCollision.none||!this.intersects(t,e))return!1;if(i&&!1===i.call(s,t.gameObject,e.gameObject))return!1;if(t.isCircle&&e.isCircle)return this.separateCircle(t,e,n);if(t.isCircle!==e.isCircle){var r=t.isCircle?e:t,o=t.isCircle?t:e,a={x:r.x,y:r.y,right:r.right,bottom:r.bottom},h=o.center;if((h.ya.bottom)&&(h.xa.right))return this.separateCircle(t,e,n)}var l=!1,u=!1;n?(l=A(t,e,n,this.OVERLAP_BIAS),u=_(t,e,n,this.OVERLAP_BIAS)):this.forceX||Math.abs(this.gravity.y+t.gravity.y)o.right&&(r=l(a.x,a.y,o.right,o.y)-a.radius):a.y>o.bottom&&(a.xo.right&&(r=l(a.x,a.y,o.right,o.bottom)-a.radius)),r*=-1}else r=t.halfWidth+e.halfWidth-l(t.center.x,t.center.y,e.center.x,e.center.y);if(t.overlapR=r,e.overlapR=r,i||0===r||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==r&&(t.onOverlap||e.onOverlap)&&this.emit(c.OVERLAP,t.gameObject,e.gameObject,t,e),0!==r;var h=t.center.x-e.center.x,u=t.center.y-e.center.y,d=Math.sqrt(Math.pow(h,2)+Math.pow(u,2)),p=(e.center.x-t.center.x)/d||0,f=(e.center.y-t.center.y)/d||0,m=2*(t.velocity.x*p+t.velocity.y*f-e.velocity.x*p-e.velocity.y*f)/(t.mass+e.mass);(t.immovable||e.immovable)&&(m*=2),t.immovable||(t.velocity.x=t.velocity.x-m/t.mass*p,t.velocity.y=t.velocity.y-m/t.mass*f),e.immovable||(e.velocity.x=e.velocity.x+m/e.mass*p,e.velocity.y=e.velocity.y+m/e.mass*f),t.immovable||e.immovable||(r/=2);var y=s(t.center,e.center),T=(r+x.EPSILON)*Math.cos(y),w=(r+x.EPSILON)*Math.sin(y);return t.immovable||(t.x-=T,t.y-=w,t.updateCenter()),e.immovable||(e.x+=T,e.y+=w,e.updateCenter()),t.velocity.x*=t.bounce.x,t.velocity.y*=t.bounce.y,e.velocity.x*=e.bounce.x,e.velocity.y*=e.bounce.y,(t.onCollide||e.onCollide)&&this.emit(c.COLLIDE,t.gameObject,e.gameObject,t,e),!0},intersects:function(t,e){return t!==e&&(t.isCircle||e.isCircle?t.isCircle?e.isCircle?l(t.center.x,t.center.y,e.center.x,e.center.y)<=t.halfWidth+e.halfWidth:this.circleBodyIntersects(t,e):this.circleBodyIntersects(e,t):!(t.right<=e.position.x||t.bottom<=e.position.y||t.position.x>=e.right||t.position.y>=e.bottom))},circleBodyIntersects:function(t,e){var i=r(t.center.x,e.left,e.right),s=r(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-s)*(t.center.y-s)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,s,n){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=i),this.collideObjects(t,e,i,s,n,!0)},collide:function(t,e,i,s,n){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=i),this.collideObjects(t,e,i,s,n,!1)},collideObjects:function(t,e,i,s,n,r){var o,a;!t.isParent||void 0!==t.physicsType&&void 0!==e&&t!==e||(t=t.children.entries),e&&e.isParent&&void 0===e.physicsType&&(e=e.children.entries);var h=Array.isArray(t),l=Array.isArray(e);if(this._total=0,h||l)if(!h&&l)for(o=0;o0},collideHandler:function(t,e,i,s,n,r){if(void 0===e&&t.isParent)return this.collideGroupVsGroup(t,t,i,s,n,r);if(!t||!e)return!1;if(t.body||t.isBody){if(e.body||e.isBody)return this.collideSpriteVsSprite(t,e,i,s,n,r);if(e.isParent)return this.collideSpriteVsGroup(t,e,i,s,n,r);if(e.isTilemap)return this.collideSpriteVsTilemapLayer(t,e,i,s,n,r)}else if(t.isParent){if(e.body||e.isBody)return this.collideSpriteVsGroup(e,t,i,s,n,r);if(e.isParent)return this.collideGroupVsGroup(t,e,i,s,n,r);if(e.isTilemap)return this.collideGroupVsTilemapLayer(t,e,i,s,n,r)}else if(t.isTilemap){if(e.body||e.isBody)return this.collideSpriteVsTilemapLayer(e,t,i,s,n,r);if(e.isParent)return this.collideGroupVsTilemapLayer(e,t,i,s,n,r)}},collideSpriteVsSprite:function(t,e,i,s,n,r){var o=t.isBody?t:t.body,a=e.isBody?e:e.body;return!(!o||!a)&&(this.separate(o,a,s,n,r)&&(i&&i.call(n,t,e),this._total++),!0)},collideSpriteVsGroup:function(t,e,i,s,n,r){var o,a,l,u=t.isBody?t:t.body;if(0!==e.length&&u&&u.enable&&!u.checkCollision.none)if(this.useTree||e.physicsType===h.STATIC_BODY){var c=this.treeMinMax;c.minX=u.left,c.minY=u.top,c.maxX=u.right,c.maxY=u.bottom;var d=e.physicsType===h.DYNAMIC_BODY?this.tree.search(c):this.staticTree.search(c);for(a=d.length,o=0;oc.baseTileWidth){var d=(c.tileWidth-c.baseTileWidth)*e.scaleX;a-=d,l+=d}c.tileHeight>c.baseTileHeight&&(u+=(c.tileHeight-c.baseTileHeight)*e.scaleY);var p=r?null:this.tileFilterOptions,f=m(a,h,l,u,p,e.scene.cameras.main,e.layer);return 0!==f.length&&this.collideSpriteVsTilesHandler(t,f,i,s,n,r,!0)},collideSpriteVsTilesHandler:function(t,e,i,s,n,r,o){for(var a,h,l=t.isBody?t:t.body,u={left:0,right:0,top:0,bottom:0},d=!1,p=0;p{t.exports={setAcceleration:function(t,e){return this.body.acceleration.set(t,e),this},setAccelerationX:function(t){return this.body.acceleration.x=t,this},setAccelerationY:function(t){return this.body.acceleration.y=t,this}}},29257:t=>{t.exports={setAngularVelocity:function(t){return this.body.angularVelocity=t,this},setAngularAcceleration:function(t){return this.body.angularAcceleration=t,this},setAngularDrag:function(t){return this.body.angularDrag=t,this}}},62122:t=>{t.exports={setBounce:function(t,e){return this.body.bounce.set(t,e),this},setBounceX:function(t){return this.body.bounce.x=t,this},setBounceY:function(t){return this.body.bounce.y=t,this},setCollideWorldBounds:function(t,e,i,s){return this.body.setCollideWorldBounds(t,e,i,s),this}}},99803:t=>{t.exports={setDebug:function(t,e,i){return this.debugShowBody=t,this.debugShowVelocity=e,this.debugBodyColor=i,this},setDebugBodyColor:function(t){return this.body.debugBodyColor=t,this},debugShowBody:{get:function(){return this.body.debugShowBody},set:function(t){this.body.debugShowBody=t}},debugShowVelocity:{get:function(){return this.body.debugShowVelocity},set:function(t){this.body.debugShowVelocity=t}},debugBodyColor:{get:function(){return this.body.debugBodyColor},set:function(t){this.body.debugBodyColor=t}}}},87145:t=>{t.exports={setDrag:function(t,e){return this.body.drag.set(t,e),this},setDragX:function(t){return this.body.drag.x=t,this},setDragY:function(t){return this.body.drag.y=t,this},setDamping:function(t){return this.body.useDamping=t,this}}},96174:t=>{var e={enableBody:function(t,e,i,s,n){return t&&this.body.reset(e,i),s&&(this.body.gameObject.active=!0),n&&(this.body.gameObject.visible=!0),this.body.enable=!0,this},disableBody:function(t,e){return void 0===t&&(t=!1),void 0===e&&(e=!1),this.body.stop(),this.body.enable=!1,t&&(this.body.gameObject.active=!1),e&&(this.body.gameObject.visible=!1),this},refreshBody:function(){return this.body.updateFromGameObject(),this}};t.exports=e},51702:t=>{t.exports={setFriction:function(t,e){return this.body.friction.set(t,e),this},setFrictionX:function(t){return this.body.friction.x=t,this},setFrictionY:function(t){return this.body.friction.y=t,this}}},25578:t=>{t.exports={setGravity:function(t,e){return this.body.gravity.set(t,e),this},setGravityX:function(t){return this.body.gravity.x=t,this},setGravityY:function(t){return this.body.gravity.y=t,this}}},72029:t=>{var e={setImmovable:function(t){return void 0===t&&(t=!0),this.body.immovable=t,this}};t.exports=e},34566:t=>{t.exports={setMass:function(t){return this.body.mass=t,this}}},2732:(t,e,i)=>{var s=i(15147),n=i(26673),r=i(22184),o=i(26535);t.exports=function(t,e,i,a,h,l){var u=s(t,e-a,i-a,2*a,2*a,h,l);if(0===u.length)return u;for(var c=new n(e,i,a),d=new n,p=[],f=0;f{t.exports=function(t,e,i,s,n,r,o){void 0===r&&(r=!0),void 0===o&&(o=!1);var a=[],h=[],l=t.treeMinMax;if(l.minX=e,l.minY=i,l.maxX=e+s,l.maxY=i+n,o&&(h=t.staticTree.search(l)),r&&t.useTree)a=t.tree.search(l);else if(r){var u=t.bodies,c={position:{x:e,y:i},left:e,top:i,right:e+s,bottom:i+n,isCircle:!1},d=t.intersects;u.iterate((function(t){d(t,c)&&a.push(t)}))}return h.concat(a)}},57527:t=>{var e={setPushable:function(t){return void 0===t&&(t=!0),this.body.pushable=t,this}};t.exports=e},77687:t=>{t.exports={setOffset:function(t,e){return this.body.setOffset(t,e),this},setSize:function(t,e,i){return this.body.setSize(t,e,i),this},setBodySize:function(t,e,i){return this.body.setSize(t,e,i),this},setCircle:function(t,e,i){return this.body.setCircle(t,e,i),this}}},66536:t=>{t.exports={setVelocity:function(t,e){return this.body.setVelocity(t,e),this},setVelocityX:function(t){return this.body.setVelocityX(t),this},setVelocityY:function(t){return this.body.setVelocityY(t),this},setMaxVelocity:function(t,e){return this.body.maxVelocity.set(t,e),this}}},7864:(t,e,i)=>{t.exports={Acceleration:i(5321),Angular:i(29257),Bounce:i(62122),Debug:i(99803),Drag:i(87145),Enable:i(96174),Friction:i(51702),Gravity:i(25578),Immovable:i(72029),Mass:i(34566),OverlapCirc:i(2732),OverlapRect:i(15147),Pushable:i(57527),Size:i(77687),Velocity:i(66536)}},47401:t=>{t.exports={DYNAMIC_BODY:0,STATIC_BODY:1,GROUP:2,TILEMAPLAYER:3,FACING_NONE:10,FACING_UP:11,FACING_DOWN:12,FACING_LEFT:13,FACING_RIGHT:14}},22346:t=>{t.exports="collide"},95092:t=>{t.exports="overlap"},15775:t=>{t.exports="pause"},74142:t=>{t.exports="resume"},22825:t=>{t.exports="tilecollide"},10851:t=>{t.exports="tileoverlap"},7543:t=>{t.exports="worldbounds"},1487:t=>{t.exports="worldstep"},27037:(t,e,i)=>{t.exports={COLLIDE:i(22346),OVERLAP:i(95092),PAUSE:i(15775),RESUME:i(74142),TILE_COLLIDE:i(22825),TILE_OVERLAP:i(10851),WORLD_BOUNDS:i(7543),WORLD_STEP:i(1487)}},39977:(t,e,i)=>{var s=i(47401),n=i(98611),r={ArcadePhysics:i(66150),Body:i(97602),Collider:i(3909),Components:i(7864),Events:i(27037),Factory:i(99523),GetOverlapX:i(75671),GetOverlapY:i(66185),SeparateX:i(61777),SeparateY:i(25299),Group:i(10481),Image:i(62832),Sprite:i(25084),StaticBody:i(66634),StaticGroup:i(46346),Tilemap:i(8413),World:i(85233)};r=n(!1,r,s),t.exports=r},25163:t=>{t.exports=function(t,e){return t.collisionCallback?!t.collisionCallback.call(t.collisionCallbackContext,e,t):!t.layer.callbacks[t.index]||!t.layer.callbacks[t.index].callback.call(t.layer.callbacks[t.index].callbackContext,e,t)}},98209:t=>{t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.left=!0):e>0&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=e,t.updateCenter(),0===t.bounce.x?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x}},72792:t=>{t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):e>0&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=e,t.updateCenter(),0===t.bounce.y?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y}},27354:(t,e,i)=>{var s=i(14405),n=i(52926),r=i(28808);t.exports=function(t,e,i,o,a,h,l){var u=o.left,c=o.top,d=o.right,p=o.bottom,f=i.faceLeft||i.faceRight,v=i.faceTop||i.faceBottom;if(l||(f=!0,v=!0),!f&&!v)return!1;var g=0,m=0,y=0,x=1;if(e.deltaAbsX()>e.deltaAbsY()?y=-1:e.deltaAbsX(){var s=i(98209);t.exports=function(t,e,i,n,r,o){var a=0,h=e.faceLeft,l=e.faceRight,u=e.collideLeft,c=e.collideRight;return o||(h=!0,l=!0,u=!0,c=!0),t.deltaX()<0&&c&&t.checkCollision.left?l&&t.x0&&u&&t.checkCollision.right&&h&&t.right>i&&(a=t.right-i)>r&&(a=0),0!==a&&(t.customSeparateX?t.overlapX=a:s(t,a)),a}},52926:(t,e,i)=>{var s=i(72792);t.exports=function(t,e,i,n,r,o){var a=0,h=e.faceTop,l=e.faceBottom,u=e.collideUp,c=e.collideDown;return o||(h=!0,l=!0,u=!0,c=!0),t.deltaY()<0&&c&&t.checkCollision.up?l&&t.y0&&u&&t.checkCollision.down&&h&&t.bottom>i&&(a=t.bottom-i)>r&&(a=0),0!==a&&(t.customSeparateY?t.overlapY=a:s(t,a)),a}},28808:t=>{t.exports=function(t,e){return!(e.right<=t.left||e.bottom<=t.top||e.position.x>=t.right||e.position.y>=t.bottom)}},8413:(t,e,i)=>{var s={ProcessTileCallbacks:i(25163),ProcessTileSeparationX:i(98209),ProcessTileSeparationY:i(72792),SeparateTile:i(27354),TileCheckX:i(14405),TileCheckY:i(52926),TileIntersectsBody:i(28808)};t.exports=s},53954:(t,e,i)=>{t.exports={Arcade:i(39977),Matter:i(45949)}},63568:(t,e,i)=>{var s=i(56694),n=i(93736),r=new s({initialize:function(){this.boundsCenter=new n,this.centerDiff=new n},parseBody:function(t){if(!(t=t.hasOwnProperty("body")?t.body:t).hasOwnProperty("bounds")||!t.hasOwnProperty("centerOfMass"))return!1;var e=this.boundsCenter,i=this.centerDiff,s=t.bounds.max.x-t.bounds.min.x,n=t.bounds.max.y-t.bounds.min.y,r=s*t.centerOfMass.x,o=n*t.centerOfMass.y;return e.set(s/2,n/2),i.set(r-e.x,o-e.y),!0},getTopLeft:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e+s.x+r.x,i+s.y+r.y)}return!1},getTopCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e+r.x,i+s.y+r.y)}return!1},getTopRight:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e-(s.x-r.x),i+s.y+r.y)}return!1},getLeftCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e+s.x+r.x,i+r.y)}return!1},getCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.centerDiff;return new n(e+s.x,i+s.y)}return!1},getRightCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e-(s.x-r.x),i+r.y)}return!1},getBottomLeft:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e+s.x+r.x,i-(s.y-r.y))}return!1},getBottomCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e+r.x,i-(s.y-r.y))}return!1},getBottomRight:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e-(s.x-r.x),i-(s.y-r.y))}return!1}});t.exports=r},18171:(t,e,i)=>{var s=i(16929);s.Body=i(84125),s.Composite=i(11299),s.World=i(72005),s.Collision=i(63454),s.Detector=i(13657),s.Pairs=i(91327),s.Pair=i(70584),s.Query=i(13390),s.Resolver=i(44272),s.Constraint=i(52838),s.Common=i(68758),s.Engine=i(45775),s.Events=i(39073),s.Sleeping=i(22806),s.Plugin=i(84474),s.Bodies=i(68516),s.Composites=i(56643),s.Axes=i(50658),s.Bounds=i(84091),s.Svg=i(92765),s.Vector=i(10438),s.Vertices=i(39745),s.World.add=s.Composite.add,s.World.remove=s.Composite.remove,s.World.addComposite=s.Composite.addComposite,s.World.addBody=s.Composite.addBody,s.World.addConstraint=s.Composite.addConstraint,s.World.clear=s.Composite.clear,t.exports=s},72653:(t,e,i)=>{var s=i(68516),n=i(56694),r=i(56643),o=i(52838),a=i(92765),h=i(3860),l=i(7030),u=i(73658),c=i(84720),d=i(10998),p=i(72829),f=i(88596),v=i(39745),g=new n({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},rectangle:function(t,e,i,n,r){var o=s.rectangle(t,e,i,n,r);return this.world.add(o),o},trapezoid:function(t,e,i,n,r,o){var a=s.trapezoid(t,e,i,n,r,o);return this.world.add(a),a},circle:function(t,e,i,n,r){var o=s.circle(t,e,i,n,r);return this.world.add(o),o},polygon:function(t,e,i,n,r){var o=s.polygon(t,e,i,n,r);return this.world.add(o),o},fromVertices:function(t,e,i,n,r,o,a){"string"==typeof i&&(i=v.fromPath(i));var h=s.fromVertices(t,e,i,n,r,o,a);return this.world.add(h),h},fromPhysicsEditor:function(t,e,i,s,n){void 0===n&&(n=!0);var r=d.parseBody(t,e,i,s);return n&&!this.world.has(r)&&this.world.add(r),r},fromSVG:function(t,e,i,n,r,o){void 0===n&&(n=1),void 0===r&&(r={}),void 0===o&&(o=!0);for(var h=i.getElementsByTagName("path"),l=[],u=0;u{var s=i(74527),n=i(72632),r=i(93736);t.exports=function(t,e,i,o){void 0===i&&(i={}),void 0===o&&(o=!0);var a=e.x,h=e.y;if(e.body={temp:!0,position:{x:a,y:h}},[s.Bounce,s.Collision,s.Force,s.Friction,s.Gravity,s.Mass,s.Sensor,s.SetBody,s.Sleep,s.Static,s.Transform,s.Velocity].forEach((function(t){for(var i in t)(s=t[i]).get&&"function"==typeof s.get||s.set&&"function"==typeof s.set?Object.defineProperty(e,i,{get:t[i].get,set:t[i].set}):Object.defineProperty(e,i,{value:t[i]});var s})),e.world=t,e._tempVec2=new r(a,h),i.hasOwnProperty("type")&&"body"===i.type)e.setExistingBody(i,o);else{var l=n(i,"shape",null);l||(l="rectangle"),i.addToWorld=o,e.setBody(l,i)}return e}},7030:(t,e,i)=>{var s=i(56694),n=i(74527),r=i(89980),o=i(72632),a=i(1539),h=i(58210),l=i(93736),u=new s({Extends:a,Mixins:[n.Bounce,n.Collision,n.Force,n.Friction,n.Gravity,n.Mass,n.Sensor,n.SetBody,n.Sleep,n.Static,n.Transform,n.Velocity,h],initialize:function(t,e,i,s,n,a){r.call(this,t.scene,"Image"),this._crop=this.resetCropObject(),this.setTexture(s,n),this.setSizeToFrame(),this.setOrigin(),this.world=t,this._tempVec2=new l(e,i);var h=o(a,"shape",null);h?this.setBody(h,a):this.setRectangle(this.width,this.height,a),this.setPosition(e,i),this.initPipeline()}});t.exports=u},50583:(t,e,i)=>{var s=i(84093),n=i(50658),r=i(68516),o=i(84125),a=i(63568),h=i(84091),l=i(56694),u=i(63454),c=i(68758),d=i(11299),p=i(56643),f=i(52838),v=i(13657),g=i(53996),m=i(72653),y=i(72632),x=i(10850),T=i(1675),w=i(80391),b=i(16929),E=i(44097),S=i(30657),A=i(70584),_=i(91327),C=i(84474),R=i(91963),M=i(13390),P=i(44272),O=i(7599),L=i(92765),F=i(10438),D=i(39745),k=i(31468);c.setDecomp(i(81084));var I=new l({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,this.bodyBounds,this.body=o,this.composite=d,this.collision=u,this.detector=v,this.pair=A,this.pairs=_,this.query=M,this.resolver=P,this.constraint=f,this.bodies=r,this.composites=p,this.axes=n,this.bounds=h,this.svg=L,this.vector=F,this.vertices=D,this.verts=D,this._tempVec2=F.create(),x(this.config,"plugins.collisionevents",!0)&&this.enableCollisionEventsPlugin(),x(this.config,"plugins.attractors",!1)&&this.enableAttractorPlugin(),x(this.config,"plugins.wrap",!1)&&this.enableWrapPlugin(),P._restingThresh=x(this.config,"restingThresh",4),P._restingThreshTangent=x(this.config,"restingThreshTangent",6),P._positionDampen=x(this.config,"positionDampen",.9),P._positionWarming=x(this.config,"positionWarming",.8),P._frictionNormalMultiplier=x(this.config,"frictionNormalMultiplier",5),t.sys.events.once(O.BOOT,this.boot,this),t.sys.events.on(O.START,this.start,this)},boot:function(){this.world=new k(this.scene,this.config),this.add=new m(this.world),this.bodyBounds=new a,this.systems.events.once(O.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new k(this.scene,this.config),this.add=new m(this.world));var t=this.systems.events;t.on(O.UPDATE,this.world.update,this.world),t.on(O.POST_UPDATE,this.world.postUpdate,this.world),t.once(O.SHUTDOWN,this.shutdown,this)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return S(y(e,"matter",{}),y(t,"matter",{}))},enableAttractorPlugin:function(){return C.register(T),C.use(b,T),this},enableWrapPlugin:function(){return C.register(E),C.use(b,E),this},enableCollisionEventsPlugin:function(){return C.register(w),C.use(b,w),this},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},set60Hz:function(){return this.world.getDelta=this.world.update60Hz,this.world.autoUpdate=!0,this},set30Hz:function(){return this.world.getDelta=this.world.update30Hz,this.world.autoUpdate=!0,this},step:function(t,e){this.world.step(t,e)},containsPoint:function(t,e,i){t=this.getMatterBodies(t);var s=F.create(e,i);return M.point(t,s).length>0},intersectPoint:function(t,e,i){i=this.getMatterBodies(i);var s=F.create(t,e),n=[];return M.point(i,s).forEach((function(t){-1===n.indexOf(t)&&n.push(t)})),n},intersectRect:function(t,e,i,s,n,r){void 0===n&&(n=!1),r=this.getMatterBodies(r);var o={min:{x:t,y:e},max:{x:t+i,y:e+s}},a=[];return M.region(r,o,n).forEach((function(t){-1===a.indexOf(t)&&a.push(t)})),a},intersectRay:function(t,e,i,s,n,r){void 0===n&&(n=1),r=this.getMatterBodies(r);for(var o=[],a=M.ray(r,F.create(t,e),F.create(i,s),n),h=0;h{var s=i(16569),n=i(56694),r=i(74527),o=i(89980),a=i(72632),h=i(58210),l=i(13747),u=i(93736),c=new n({Extends:l,Mixins:[r.Bounce,r.Collision,r.Force,r.Friction,r.Gravity,r.Mass,r.Sensor,r.SetBody,r.Sleep,r.Static,r.Transform,r.Velocity,h],initialize:function(t,e,i,n,r,h){o.call(this,t.scene,"Sprite"),this._crop=this.resetCropObject(),this.anims=new s(this),this.setTexture(n,r),this.setSizeToFrame(),this.setOrigin(),this.world=t,this._tempVec2=new u(e,i);var l=a(h,"shape",null);l?this.setBody(l,h):this.setRectangle(this.width,this.height,h),this.setPosition(e,i),this.initPipeline()}});t.exports=c},84720:(t,e,i)=>{var s=i(68516),n=i(84125),r=i(56694),o=i(74527),a=i(6659),h=i(72632),l=i(19256),u=i(39745),c=new r({Extends:a,Mixins:[o.Bounce,o.Collision,o.Friction,o.Gravity,o.Mass,o.Sensor,o.Sleep,o.Static],initialize:function(t,e,i){a.call(this),this.tile=e,this.world=t,e.physics.matterBody&&e.physics.matterBody.destroy(),e.physics.matterBody=this;var s=h(i,"body",null),n=h(i,"addToWorld",!0);if(s)this.setBody(s,n);else{var r=e.getCollisionGroup();h(r,"objects",[]).length>0?this.setFromTileCollision(i):this.setFromTileRectangle(i)}},setFromTileRectangle:function(t){void 0===t&&(t={}),l(t,"isStatic")||(t.isStatic=!0),l(t,"addToWorld")||(t.addToWorld=!0);var e=this.tile.getBounds(),i=e.x+e.width/2,n=e.y+e.height/2,r=s.rectangle(i,n,e.width,e.height,t);return this.setBody(r,t.addToWorld),this},setFromTileCollision:function(t){void 0===t&&(t={}),l(t,"isStatic")||(t.isStatic=!0),l(t,"addToWorld")||(t.addToWorld=!0);for(var e=this.tile.tilemapLayer.scaleX,i=this.tile.tilemapLayer.scaleY,r=this.tile.getLeft(),o=this.tile.getTop(),a=this.tile.getCollisionGroup(),c=h(a,"objects",[]),d=[],p=0;p1&&(t.parts=d,this.setBody(n.create(t),t.addToWorld)),this},setBody:function(t,e){return void 0===e&&(e=!0),this.body&&this.removeBody(),this.body=t,this.body.gameObject=this,e&&this.world.add(this.body),this},removeBody:function(){return this.body&&(this.world.remove(this.body),this.body.gameObject=void 0,this.body=void 0),this},destroy:function(){this.removeBody(),this.tile.physics.matterBody=void 0,this.removeAllListeners()}});t.exports=c},10998:(t,e,i)=>{var s=i(68516),n=i(84125),r=i(68758),o=i(72632),a=i(39745),h={parseBody:function(t,e,i,s){void 0===s&&(s={});for(var a=o(i,"fixtures",[]),h=[],l=0;l{var s=i(68516),n=i(84125),r={parseBody:function(t,e,i,r){var o;void 0===r&&(r={});var a=i.vertices;if(1===a.length)r.vertices=a[0],o=n.create(r),s.flagCoincidentParts(o.parts);else{for(var h=[],l=0;l{var s=i(84091),n=i(56694),r=i(11299),o=i(52838),a=i(13657),h=i(35416),l=i(33963),u=i(30657),c=i(22806),d=i(93736),p=i(39745),f=new n({initialize:function(t,e,i){void 0===i&&(i={});this.scene=t,this.world=e,this.camera=null,this.pointer=null,this.active=!0,this.position=new d,this.body=null,this.part=null,this.constraint=o.create(u(i,{label:"Pointer Constraint",pointA:{x:0,y:0},pointB:{x:0,y:0},length:.01,stiffness:.1,angularStiffness:1,collisionFilter:{category:1,mask:4294967295,group:0}})),this.world.on(h.BEFORE_UPDATE,this.update,this),t.sys.input.on(l.POINTER_DOWN,this.onDown,this),t.sys.input.on(l.POINTER_UP,this.onUp,this)},onDown:function(t){this.pointer||(this.pointer=t,this.camera=t.camera)},onUp:function(t){t===this.pointer&&(this.pointer=null)},getBody:function(t){var e=this.position,i=this.constraint;this.camera.getWorldPoint(t.x,t.y,e);for(var n=r.allBodies(this.world.localWorld),o=0;o1?1:0;n{var s=i(68516),n=i(84125),r=i(56694),o=i(68758),a=i(11299),h=i(45775),l=i(6659),u=i(35416),c=i(72632),d=i(10850),p=i(84125),f=i(39073),v=i(84720),g=i(72005),m=i(10438),y=new r({Extends:l,initialize:function(t,e){l.call(this),this.scene=t,this.engine=h.create(e),this.localWorld=this.engine.world;var i=d(e,"gravity",null);i?this.setGravity(i.x,i.y,i.scale):!1===i&&this.setGravity(0,0,0),this.walls={left:null,right:null,top:null,bottom:null},this.enabled=d(e,"enabled",!0),this.correction=d(e,"correction",1),this.getDelta=d(e,"getDelta",this.update60Hz);var s=c(e,"runner",{}),n=c(s,"fps",!1),r=c(s,"fps",60),o=c(s,"delta",1e3/r),a=c(s,"deltaMin",1e3/r),u=c(s,"deltaMax",1e3/(.5*r));n||(r=1e3/o),this.runner={fps:r,correction:c(s,"correction",1),deltaSampleSize:c(s,"deltaSampleSize",60),counterTimestamp:0,frameCounter:0,deltaHistory:[],timePrev:null,timeScalePrev:1,frameRequestId:null,isFixed:c(s,"isFixed",!1),delta:o,deltaMin:a,deltaMax:u},this.autoUpdate=d(e,"autoUpdate",!0);var p=d(e,"debug",!1);if(this.drawDebug="object"==typeof p||p,this.debugGraphic,this.debugConfig={showAxes:c(p,"showAxes",!1),showAngleIndicator:c(p,"showAngleIndicator",!1),angleColor:c(p,"angleColor",15208787),showBroadphase:c(p,"showBroadphase",!1),broadphaseColor:c(p,"broadphaseColor",16757760),showBounds:c(p,"showBounds",!1),boundsColor:c(p,"boundsColor",16777215),showVelocity:c(p,"showVelocity",!1),velocityColor:c(p,"velocityColor",44783),showCollisions:c(p,"showCollisions",!1),collisionColor:c(p,"collisionColor",16094476),showSeparations:c(p,"showSeparations",!1),separationColor:c(p,"separationColor",16753920),showBody:c(p,"showBody",!0),showStaticBody:c(p,"showStaticBody",!0),showInternalEdges:c(p,"showInternalEdges",!1),renderFill:c(p,"renderFill",!1),renderLine:c(p,"renderLine",!0),fillColor:c(p,"fillColor",1075465),fillOpacity:c(p,"fillOpacity",1),lineColor:c(p,"lineColor",2678297),lineOpacity:c(p,"lineOpacity",1),lineThickness:c(p,"lineThickness",1),staticFillColor:c(p,"staticFillColor",857979),staticLineColor:c(p,"staticLineColor",1255396),showSleeping:c(p,"showSleeping",!1),staticBodySleepOpacity:c(p,"staticBodySleepOpacity",.7),sleepFillColor:c(p,"sleepFillColor",4605510),sleepLineColor:c(p,"sleepLineColor",10066585),showSensors:c(p,"showSensors",!0),sensorFillColor:c(p,"sensorFillColor",857979),sensorLineColor:c(p,"sensorLineColor",1255396),showPositions:c(p,"showPositions",!0),positionSize:c(p,"positionSize",4),positionColor:c(p,"positionColor",14697178),showJoint:c(p,"showJoint",!0),jointColor:c(p,"jointColor",14737474),jointLineOpacity:c(p,"jointLineOpacity",1),jointLineThickness:c(p,"jointLineThickness",2),pinSize:c(p,"pinSize",4),pinColor:c(p,"pinColor",4382944),springColor:c(p,"springColor",14697184),anchorColor:c(p,"anchorColor",15724527),anchorSize:c(p,"anchorSize",4),showConvexHulls:c(p,"showConvexHulls",!1),hullColor:c(p,"hullColor",14091216)},this.drawDebug&&this.createDebugGraphic(),this.setEventsProxy(),c(e,"setBounds",!1)){var f=e.setBounds;if("boolean"==typeof f)this.setBounds();else{var v=c(f,"x",0),g=c(f,"y",0),m=c(f,"width",t.sys.scale.width),y=c(f,"height",t.sys.scale.height),x=c(f,"thickness",64),T=c(f,"left",!0),w=c(f,"right",!0),b=c(f,"top",!0),E=c(f,"bottom",!0);this.setBounds(v,g,m,y,x,T,w,b,E)}}},setCompositeRenderStyle:function(t){var e,i,s,n=t.bodies,r=t.constraints,o=t.composites;for(e=0;e0&&(i=n[0].bodyA,s=n[0].bodyB),t.emit(u.COLLISION_START,e,i,s)})),f.on(e,"collisionActive",(function(e){var i,s,n=e.pairs;n.length>0&&(i=n[0].bodyA,s=n[0].bodyB),t.emit(u.COLLISION_ACTIVE,e,i,s)})),f.on(e,"collisionEnd",(function(e){var i,s,n=e.pairs;n.length>0&&(i=n[0].bodyA,s=n[0].bodyB),t.emit(u.COLLISION_END,e,i,s)}))},setBounds:function(t,e,i,s,n,r,o,a,h){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===s&&(s=this.scene.sys.scale.height),void 0===n&&(n=64),void 0===r&&(r=!0),void 0===o&&(o=!0),void 0===a&&(a=!0),void 0===h&&(h=!0),this.updateWall(r,"left",t-n,e-n,n,s+2*n),this.updateWall(o,"right",t+i,e-n,n,s+2*n),this.updateWall(a,"top",t,e-n,i,n),this.updateWall(h,"bottom",t,e+s,i,n),this},updateWall:function(t,e,i,s,n,r){var o=this.walls[e];t?(o&&g.remove(this.localWorld,o),i+=n/2,s+=r/2,this.walls[e]=this.create(i,s,n,r,{isStatic:!0,friction:0,frictionStatic:0})):(o&&g.remove(this.localWorld,o),this.walls[e]=null)},createDebugGraphic:function(){var t=this.scene.sys.add.graphics({x:0,y:0});return t.setDepth(Number.MAX_VALUE),this.debugGraphic=t,this.drawDebug=!0,t},disableGravity:function(){return this.localWorld.gravity.x=0,this.localWorld.gravity.y=0,this.localWorld.gravity.scale=0,this},setGravity:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=1),this.localWorld.gravity.x=t,this.localWorld.gravity.y=e,void 0!==i&&(this.localWorld.gravity.scale=i),this},create:function(t,e,i,n,r){var o=s.rectangle(t,e,i,n,r);return g.add(this.localWorld,o),o},add:function(t){return g.add(this.localWorld,t),this},remove:function(t,e){Array.isArray(t)||(t=[t]);for(var i=0;is.deltaMax?s.deltaMax:e)/s.delta,s.delta=e),0!==s.timeScalePrev&&(r*=n.timeScale/s.timeScalePrev),0===n.timeScale&&(r=0),s.timeScalePrev=n.timeScale,s.correction=r,s.frameCounter+=1,t-s.counterTimestamp>=1e3&&(s.fps=s.frameCounter*((t-s.counterTimestamp)/1e3),s.counterTimestamp=t,s.frameCounter=0),h.update(i,e,r)}},step:function(t,e){h.update(this.engine,t,e)},update60Hz:function(){return 1e3/60},update30Hz:function(){return 1e3/30},has:function(t){var e=t.hasOwnProperty("body")?t.body:t;return null!==a.get(this.localWorld,e.id,e.type)},getAllBodies:function(){return a.allBodies(this.localWorld)},getAllConstraints:function(){return a.allConstraints(this.localWorld)},getAllComposites:function(){return a.allComposites(this.localWorld)},postUpdate:function(){if(this.drawDebug){var t=this.debugConfig,e=this.engine,i=this.debugGraphic,s=a.allBodies(this.localWorld);this.debugGraphic.clear(),t.showBroadphase&&e.broadphase.controller&&this.renderGrid(e.broadphase,i,t.broadphaseColor,.5),t.showBounds&&this.renderBodyBounds(s,i,t.boundsColor,.5),(t.showBody||t.showStaticBody)&&this.renderBodies(s),t.showJoint&&this.renderJoints(),(t.showAxes||t.showAngleIndicator)&&this.renderBodyAxes(s,i,t.showAxes,t.angleColor,.5),t.showVelocity&&this.renderBodyVelocity(s,i,t.velocityColor,1,2),t.showSeparations&&this.renderSeparations(e.pairs.list,i,t.separationColor),t.showCollisions&&this.renderCollisions(e.pairs.list,i,t.collisionColor)}},renderGrid:function(t,e,i,s){e.lineStyle(1,i,s);for(var n=o.keys(t.buckets),r=0;r0){var l=h[0].vertex.x,u=h[0].vertex.y;2===h.length&&(l=(h[0].vertex.x+h[1].vertex.x)/2,u=(h[0].vertex.y+h[1].vertex.y)/2),a.bodyB===a.supports[0].body||a.bodyA.isStatic?e.lineBetween(l-8*a.normal.x,u-8*a.normal.y,l,u):e.lineBetween(l+8*a.normal.x,u+8*a.normal.y,l,u)}}return this},renderBodyBounds:function(t,e,i,s){e.lineStyle(1,i,s);for(var n=0;n1?1:0;h1?1:0;a1?1:0;a1&&this.renderConvexHull(v,e,p,y)}}},renderBody:function(t,e,i,s,n,r,o,a){void 0===s&&(s=null),void 0===n&&(n=null),void 0===r&&(r=1),void 0===o&&(o=null),void 0===a&&(a=null);for(var h=this.debugConfig,l=h.sensorFillColor,u=h.sensorLineColor,c=t.parts,d=c.length,p=d>1?1:0;p1){var n=t.vertices;e.lineStyle(s,i),e.beginPath(),e.moveTo(n[0].x,n[0].y);for(var r=1;r0&&(e.fillStyle(a),e.fillCircle(u.x,u.y,h),e.fillCircle(c.x,c.y,h)),this},resetCollisionIDs:function(){return n._nextCollidingGroupId=1,n._nextNonCollidingGroupId=-1,n._nextCategory=1,this},shutdown:function(){f.off(this.engine),this.removeAllListeners(),g.clear(this.localWorld,!1),h.clear(this.engine),this.drawDebug&&this.debugGraphic.destroy()},destroy:function(){this.shutdown()}});t.exports=y},95349:t=>{t.exports={setBounce:function(t){return this.body.restitution=t,this}}},70679:t=>{var e={setCollisionCategory:function(t){return this.body.collisionFilter.category=t,this},setCollisionGroup:function(t){return this.body.collisionFilter.group=t,this},setCollidesWith:function(t){var e=0;if(Array.isArray(t))for(var i=0;i{var s=i(84125),n={applyForce:function(t){return this._tempVec2.set(this.body.position.x,this.body.position.y),s.applyForce(this.body,this._tempVec2,t),this},applyForceFrom:function(t,e){return s.applyForce(this.body,t,e),this},thrust:function(t){var e=this.body.angle;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),s.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustLeft:function(t){var e=this.body.angle-Math.PI/2;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),s.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustRight:function(t){var e=this.body.angle+Math.PI/2;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),s.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustBack:function(t){var e=this.body.angle-Math.PI;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),s.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this}};t.exports=n},74015:t=>{var e={setFriction:function(t,e,i){return this.body.friction=t,void 0!==e&&(this.body.frictionAir=e),void 0!==i&&(this.body.frictionStatic=i),this},setFrictionAir:function(t){return this.body.frictionAir=t,this},setFrictionStatic:function(t){return this.body.frictionStatic=t,this}};t.exports=e},11535:t=>{t.exports={setIgnoreGravity:function(t){return this.body.ignoreGravity=t,this}}},74497:(t,e,i)=>{var s=i(84125),n=i(93736),r={setMass:function(t){return s.setMass(this.body,t),this},setDensity:function(t){return s.setDensity(this.body,t),this},centerOfMass:{get:function(){return new n(this.body.centerOfMass.x,this.body.centerOfMass.y)}}};t.exports=r},75529:t=>{t.exports={setSensor:function(t){return this.body.isSensor=t,this},isSensor:function(){return this.body.isSensor}}},64024:(t,e,i)=>{var s=i(68516),n=i(84125),r=i(88456),o=i(72632),a=i(10998),h=i(72829),l=i(39745),u={setRectangle:function(t,e,i){return this.setBody({type:"rectangle",width:t,height:e},i)},setCircle:function(t,e){return this.setBody({type:"circle",radius:t},e)},setPolygon:function(t,e,i){return this.setBody({type:"polygon",sides:e,radius:t},i)},setTrapezoid:function(t,e,i,s){return this.setBody({type:"trapezoid",width:t,height:e,slope:i},s)},setExistingBody:function(t,e){void 0===e&&(e=!0),this.body&&this.world.remove(this.body,!0),this.body=t;for(var i=0;i{var s=i(35416),n=i(22806),r=i(39073),o={setToSleep:function(){return n.set(this.body,!0),this},setAwake:function(){return n.set(this.body,!1),this},setSleepThreshold:function(t){return void 0===t&&(t=60),this.body.sleepThreshold=t,this},setSleepEvents:function(t,e){return this.setSleepStartEvent(t),this.setSleepEndEvent(e),this},setSleepStartEvent:function(t){if(t){var e=this.world;r.on(this.body,"sleepStart",(function(t){e.emit(s.SLEEP_START,t,this)}))}else r.off(this.body,"sleepStart");return this},setSleepEndEvent:function(t){if(t){var e=this.world;r.on(this.body,"sleepEnd",(function(t){e.emit(s.SLEEP_END,t,this)}))}else r.off(this.body,"sleepEnd");return this}};t.exports=o},82884:(t,e,i)=>{var s=i(84125),n={setStatic:function(t){return s.setStatic(this.body,t),this},isStatic:function(){return this.body.isStatic}};t.exports=n},4753:(t,e,i)=>{var s=i(84125),n=i(83392),r=i(35786),o=i(62138),a={x:{get:function(){return this.body.position.x},set:function(t){this._tempVec2.set(t,this.y),s.setPosition(this.body,this._tempVec2)}},y:{get:function(){return this.body.position.y},set:function(t){this._tempVec2.set(this.x,t),s.setPosition(this.body,this._tempVec2)}},scaleX:{get:function(){return this._scaleX},set:function(t){var e=1/this._scaleX,i=1/this._scaleY;this._scaleX=t,0===this._scaleX?this.renderFlags&=-5:this.renderFlags|=4,s.scale(this.body,e,i),s.scale(this.body,t,this._scaleY)}},scaleY:{get:function(){return this._scaleY},set:function(t){var e=1/this._scaleX,i=1/this._scaleY;this._scaleY=t,0===this._scaleY?this.renderFlags&=-5:this.renderFlags|=4,s.scale(this.body,e,i),s.scale(this.body,this._scaleX,t)}},angle:{get:function(){return o(this.body.angle*n.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*n.DEG_TO_RAD}},rotation:{get:function(){return this.body.angle},set:function(t){this._rotation=r(t),s.setAngle(this.body,this._rotation)}},setPosition:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this._tempVec2.set(t,e),s.setPosition(this.body,this._tempVec2),this},setRotation:function(t){return void 0===t&&(t=0),this._rotation=r(t),s.setAngle(this.body,t),this},setFixedRotation:function(){return s.setInertia(this.body,1/0),this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,s.setAngle(this.body,this.rotation),this},setScale:function(t,e,i){void 0===t&&(t=1),void 0===e&&(e=t);var n=1/this._scaleX,r=1/this._scaleY;return this._scaleX=t,this._scaleY=e,s.scale(this.body,n,r,i),s.scale(this.body,t,e,i),this}};t.exports=a},37268:(t,e,i)=>{var s=i(84125),n={setAngularVelocity:function(t){return s.setAngularVelocity(this.body,t),this},setVelocityX:function(t){return this._tempVec2.set(t,this.body.velocity.y),s.setVelocity(this.body,this._tempVec2),this},setVelocityY:function(t){return this._tempVec2.set(this.body.velocity.x,t),s.setVelocity(this.body,this._tempVec2),this},setVelocity:function(t,e){return this._tempVec2.set(t,e),s.setVelocity(this.body,this._tempVec2),this}};t.exports=n},74527:(t,e,i)=>{t.exports={Bounce:i(95349),Collision:i(70679),Force:i(77178),Friction:i(74015),Gravity:i(11535),Mass:i(74497),Sensor:i(75529),SetBody:i(64024),Sleep:i(25106),Static:i(82884),Transform:i(4753),Velocity:i(37268)}},63201:t=>{t.exports="afteradd"},30474:t=>{t.exports="afterremove"},44822:t=>{t.exports="afterupdate"},88820:t=>{t.exports="beforeadd"},94849:t=>{t.exports="beforeremove"},6391:t=>{t.exports="beforeupdate"},96738:t=>{t.exports="collisionactive"},7916:t=>{t.exports="collisionend"},59529:t=>{t.exports="collisionstart"},10219:t=>{t.exports="dragend"},183:t=>{t.exports="drag"},39143:t=>{t.exports="dragstart"},16483:t=>{t.exports="pause"},35806:t=>{t.exports="resume"},22106:t=>{t.exports="sleepend"},5803:t=>{t.exports="sleepstart"},35416:(t,e,i)=>{t.exports={AFTER_ADD:i(63201),AFTER_REMOVE:i(30474),AFTER_UPDATE:i(44822),BEFORE_ADD:i(88820),BEFORE_REMOVE:i(94849),BEFORE_UPDATE:i(6391),COLLISION_ACTIVE:i(96738),COLLISION_END:i(7916),COLLISION_START:i(59529),DRAG_END:i(10219),DRAG:i(183),DRAG_START:i(39143),PAUSE:i(16483),RESUME:i(35806),SLEEP_END:i(22106),SLEEP_START:i(5803)}},45949:(t,e,i)=>{t.exports={BodyBounds:i(63568),Components:i(74527),Events:i(35416),Factory:i(72653),MatterGameObject:i(3860),Image:i(7030),Matter:i(18171),MatterPhysics:i(50583),PolyDecomp:i(81084),Sprite:i(73658),TileBody:i(84720),PhysicsEditorParser:i(10998),PhysicsJSONParser:i(72829),PointerConstraint:i(88596),World:i(31468)}},84125:(t,e,i)=>{var s={};t.exports=s;var n=i(39745),r=i(10438),o=i(22806),a=i(68758),h=i(84091),l=i(50658);!function(){s._inertiaScale=4,s._nextCollidingGroupId=1,s._nextNonCollidingGroupId=-1,s._nextCategory=1,s.create=function(e){var i={id:a.nextId(),type:"body",label:"Body",parts:[],plugin:{},angle:0,vertices:null,position:{x:0,y:0},force:{x:0,y:0},torque:0,positionImpulse:{x:0,y:0},constraintImpulse:{x:0,y:0,angle:0},totalContacts:0,speed:0,angularSpeed:0,velocity:{x:0,y:0},angularVelocity:0,isSensor:!1,isStatic:!1,isSleeping:!1,motion:0,sleepThreshold:60,density:.001,restitution:0,friction:.1,frictionStatic:.5,frictionAir:.01,collisionFilter:{category:1,mask:4294967295,group:0},slop:.05,timeScale:1,events:null,bounds:null,chamfer:null,circleRadius:0,positionPrev:null,anglePrev:0,parent:null,axes:null,area:0,mass:0,inverseMass:0,inertia:0,inverseInertia:0,_original:null,render:{visible:!0,opacity:1,sprite:{xOffset:0,yOffset:0},fillColor:null,fillOpacity:null,lineColor:null,lineOpacity:null,lineThickness:null},gameObject:null,scale:{x:1,y:1},centerOfMass:{x:0,y:0},centerOffset:{x:0,y:0},gravityScale:{x:1,y:1},ignoreGravity:!1,ignorePointer:!1,onCollideCallback:null,onCollideEndCallback:null,onCollideActiveCallback:null,onCollideWith:{}};!e.hasOwnProperty("position")&&e.hasOwnProperty("vertices")?e.position=n.centre(e.vertices):e.hasOwnProperty("vertices")||(i.vertices=n.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"));var s=a.extend(i,e);return t(s,e),s.setOnCollideWith=function(t,e){return e?this.onCollideWith[t.id]=e:delete this.onCollideWith[t.id],this},s},s.nextGroup=function(t){return t?s._nextNonCollidingGroupId--:s._nextCollidingGroupId++},s.nextCategory=function(){return s._nextCategory=s._nextCategory<<1,s._nextCategory};var t=function(t,e){e=e||{},s.set(t,{bounds:t.bounds||h.create(t.vertices),positionPrev:t.positionPrev||r.clone(t.position),anglePrev:t.anglePrev||t.angle,vertices:t.vertices,parts:t.parts||[t],isStatic:t.isStatic,isSleeping:t.isSleeping,parent:t.parent||t});var i=t.bounds;if(n.rotate(t.vertices,t.angle,t.position),l.rotate(t.axes,t.angle),h.update(i,t.vertices,t.velocity),s.set(t,{axes:e.axes||t.axes,area:e.area||t.area,mass:e.mass||t.mass,inertia:e.inertia||t.inertia}),1===t.parts.length){var o=t.centerOfMass,a=t.centerOffset,u=i.max.x-i.min.x,c=i.max.y-i.min.y;o.x=-(i.min.x-t.position.x)/u,o.y=-(i.min.y-t.position.y)/c,a.x=u*o.x,a.y=c*o.y}};s.set=function(t,e,i){var n;for(n in"string"==typeof e&&(n=e,(e={})[n]=i),e)if(Object.prototype.hasOwnProperty.call(e,n))switch(i=e[n],n){case"isStatic":s.setStatic(t,i);break;case"isSleeping":o.set(t,i);break;case"mass":s.setMass(t,i);break;case"density":s.setDensity(t,i);break;case"inertia":s.setInertia(t,i);break;case"vertices":s.setVertices(t,i);break;case"position":s.setPosition(t,i);break;case"angle":s.setAngle(t,i);break;case"velocity":s.setVelocity(t,i);break;case"angularVelocity":s.setAngularVelocity(t,i);break;case"parts":s.setParts(t,i);break;case"centre":s.setCentre(t,i);break;default:t[n]=i}},s.setStatic=function(t,e){for(var i=0;i0&&r.rotateAbout(o.position,i,t.position,o.position)}},s.setVelocity=function(t,e){t.positionPrev.x=t.position.x-e.x,t.positionPrev.y=t.position.y-e.y,t.velocity.x=e.x,t.velocity.y=e.y,t.speed=r.magnitude(t.velocity)},s.setAngularVelocity=function(t,e){t.anglePrev=t.angle-e,t.angularVelocity=e,t.angularSpeed=Math.abs(t.angularVelocity)},s.translate=function(t,e){s.setPosition(t,r.add(t.position,e))},s.rotate=function(t,e,i){if(i){var n=Math.cos(e),r=Math.sin(e),o=t.position.x-i.x,a=t.position.y-i.y;s.setPosition(t,{x:i.x+(o*n-a*r),y:i.y+(o*r+a*n)}),s.setAngle(t,t.angle+e)}else s.setAngle(t,t.angle+e)},s.scale=function(t,e,i,r){var o=0,a=0;r=r||t.position;for(var u=0;u0&&(o+=c.area,a+=c.inertia),c.position.x=r.x+(c.position.x-r.x)*e,c.position.y=r.y+(c.position.y-r.y)*i,h.update(c.bounds,c.vertices,t.velocity)}t.parts.length>1&&(t.area=o,t.isStatic||(s.setMass(t,t.density*o),s.setInertia(t,a))),t.circleRadius&&(e===i?t.circleRadius*=e:t.circleRadius=null)},s.update=function(t,e,i,s){var o=Math.pow(e*i*t.timeScale,2),a=1-t.frictionAir*i*t.timeScale,u=t.position.x-t.positionPrev.x,c=t.position.y-t.positionPrev.y;t.velocity.x=u*a*s+t.force.x/t.mass*o,t.velocity.y=c*a*s+t.force.y/t.mass*o,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.angularVelocity=(t.angle-t.anglePrev)*a*s+t.torque/t.inertia*o,t.anglePrev=t.angle,t.angle+=t.angularVelocity,t.speed=r.magnitude(t.velocity),t.angularSpeed=Math.abs(t.angularVelocity);for(var d=0;d0&&(p.position.x+=t.velocity.x,p.position.y+=t.velocity.y),0!==t.angularVelocity&&(n.rotate(p.vertices,t.angularVelocity,t.position),l.rotate(p.axes,t.angularVelocity),d>0&&r.rotateAbout(p.position,t.angularVelocity,t.position,p.position)),h.update(p.bounds,p.vertices,t.velocity)}},s.applyForce=function(t,e,i){t.force.x+=i.x,t.force.y+=i.y;var s=e.x-t.position.x,n=e.y-t.position.y;t.torque+=s*i.y-n*i.x},s._totalProperties=function(t){for(var e={mass:0,area:0,inertia:0,centre:{x:0,y:0}},i=1===t.parts.length?0:1;i{var s={};t.exports=s;var n=i(39073),r=i(68758),o=i(84091),a=i(84125);s.create=function(t){return r.extend({id:r.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,i,r){if(n.trigger(t,"compositeModified",t),t.isModified=e,e&&t.cache&&(t.cache.allBodies=null,t.cache.allConstraints=null,t.cache.allComposites=null),i&&t.parent&&s.setModified(t.parent,e,i,r),r)for(var o=0;o{var s={};t.exports=s;var n=i(11299);s.create=n.create,s.add=n.add,s.remove=n.remove,s.clear=n.clear,s.addComposite=n.addComposite,s.addBody=n.addBody,s.addConstraint=n.addConstraint},63454:(t,e,i)=>{var s={};t.exports=s;var n,r,o,a=i(39745),h=i(70584);n=[],r={overlap:0,axis:null},o={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:[]}},s.collides=function(t,e,i){if(s._overlapAxes(r,t.vertices,e.vertices,t.axes),r.overlap<=0)return null;if(s._overlapAxes(o,e.vertices,t.vertices,e.axes),o.overlap<=0)return null;var n,l,u=i&&i.table[h.id(t,e)];u?n=u.collision:((n=s.create(t,e)).collided=!0,n.bodyA=t.idS?S=a:aA?A=a:an?n=o:o{var e={};t.exports=e,e.create=function(t){return{vertex:t,normalImpulse:0,tangentImpulse:0}}},13657:(t,e,i)=>{var s={};t.exports=s;var n=i(68758),r=i(63454);s.create=function(t){return n.extend({bodies:[],pairs:null},t)},s.setBodies=function(t,e){t.bodies=e.slice(0)},s.clear=function(t){t.bodies=[]},s.collisions=function(t){var e,i,n=[],o=t.pairs,a=t.bodies,h=a.length,l=s.canCollide,u=r.collides;for(a.sort(s._compareBoundsX),e=0;ep)break;if(!(fC.max.y)&&(!g||!x.isStatic&&!x.isSleeping)&&l(c.collisionFilter,x.collisionFilter)){var T=x.parts.length;if(y&&1===T)(A=u(c,x,o))&&n.push(A);else for(var w=T>1?1:0,b=m>1?1:0;bC.max.x||d.max.xC.max.y||(A=u(E,_,o))&&n.push(A)}}}}return n},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}},70584:(t,e,i)=>{var s={};t.exports=s;var n=i(17319);s.create=function(t,e){var i=t.bodyA,n=t.bodyB,r={id:s.id(i,n),bodyA:i,bodyB:n,collision:t,contacts:[],activeContacts:[],separation:0,isActive:!0,confirmedActive:!0,isSensor:i.isSensor||n.isSensor,timeCreated:e,timeUpdated:e,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return s.update(r,t,e),r},s.update=function(t,e,i){var s=t.contacts,r=e.supports,o=t.activeContacts,a=e.parentA,h=e.parentB,l=a.vertices.length;t.isActive=!0,t.timeUpdated=i,t.collision=e,t.separation=e.depth,t.inverseMass=a.inverseMass+h.inverseMass,t.friction=a.frictionh.frictionStatic?a.frictionStatic:h.frictionStatic,t.restitution=a.restitution>h.restitution?a.restitution:h.restitution,t.slop=a.slop>h.slop?a.slop:h.slop,e.pair=t,o.length=0;for(var u=0;u{var s={};t.exports=s;var n=i(70584),r=i(68758);s.create=function(t){return r.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},t)},s.update=function(t,e,i){var s,r,o,a,h=t.list,l=h.length,u=t.table,c=e.length,d=t.collisionStart,p=t.collisionEnd,f=t.collisionActive;for(d.length=0,p.length=0,f.length=0,a=0;a{var s={};t.exports=s;var n=i(10438),r=i(63454),o=i(84091),a=i(68516),h=i(39745);s.collides=function(t,e){for(var i=[],s=e.length,n=t.bounds,a=r.collides,h=o.overlaps,l=0;l{var s={};t.exports=s;var n=i(39745),r=i(84091);s._restingThresh=4,s._restingThreshTangent=6,s._positionDampen=.9,s._positionWarming=.8,s._frictionNormalMultiplier=5,s.preSolvePosition=function(t){var e,i,s,n=t.length;for(e=0;ez||-Y>z?(n=Y>0?Y:-Y,(i=p.friction*(Y>0?1:-1)*a)<-n?i=-n:i>n&&(i=n)):(i=Y,n=c);var G=P*T-O*x,W=L*T-F*x,V=A/(_+v.inverseInertia*G*G+g.inverseInertia*W*W),H=(1+p.restitution)*N*V;if(i*=V,N*N>h&&N<0)R.normalImpulse=0;else{var j=R.normalImpulse;R.normalImpulse+=H,R.normalImpulse=Math.min(R.normalImpulse,0),H=R.normalImpulse-j}if(Y*Y>u)R.tangentImpulse=0;else{var K=R.tangentImpulse;R.tangentImpulse+=i,R.tangentImpulse<-n&&(R.tangentImpulse=-n),R.tangentImpulse>n&&(R.tangentImpulse=n),i=R.tangentImpulse-K}var q=x*H+w*i,Z=T*H+b*i;v.isStatic||v.isSleeping||(v.positionPrev.x+=q*v.inverseMass,v.positionPrev.y+=Z*v.inverseMass,v.anglePrev+=(P*Z-O*q)*v.inverseInertia),g.isStatic||g.isSleeping||(g.positionPrev.x-=q*g.inverseMass,g.positionPrev.y-=Z*g.inverseMass,g.anglePrev-=(L*Z-F*q)*g.inverseInertia)}}}}},52838:(t,e,i)=>{var s={};t.exports=s;var n=i(39745),r=i(10438),o=i(22806),a=i(84091),h=i(50658),l=i(68758);s._warming=.4,s._torqueDampen=1,s._minLength=1e-6,s.create=function(t){var e=t;e.bodyA&&!e.pointA&&(e.pointA={x:0,y:0}),e.bodyB&&!e.pointB&&(e.pointB={x:0,y:0});var i=e.bodyA?r.add(e.bodyA.position,e.pointA):e.pointA,s=e.bodyB?r.add(e.bodyB.position,e.pointB):e.pointB,n=r.magnitude(r.sub(i,s));e.length=void 0!==e.length?e.length:n,e.id=e.id||l.nextId(),e.label=e.label||"Constraint",e.type="constraint",e.stiffness=e.stiffness||(e.length>0?1:.7),e.damping=e.damping||0,e.angularStiffness=e.angularStiffness||0,e.angleA=e.bodyA?e.bodyA.angle:e.angleA,e.angleB=e.bodyB?e.bodyB.angle:e.angleB,e.plugin={};var o={visible:!0,type:"line",anchors:!0,lineColor:null,lineOpacity:null,lineThickness:null,pinSize:null,anchorColor:null,anchorSize:null};return 0===e.length&&e.stiffness>.1?(o.type="pin",o.anchors=!1):e.stiffness<.9&&(o.type="spring"),e.render=l.extend(o,e.render),e},s.preSolveAll=function(t){for(var e=0;e0&&(c.position.x+=l.x,c.position.y+=l.y),0!==l.angle&&(n.rotate(c.vertices,l.angle,i.position),h.rotate(c.axes,l.angle),u>0&&r.rotateAbout(c.position,l.angle,i.position,c.position)),a.update(c.bounds,c.vertices,i.velocity)}l.angle*=s._warming,l.x*=s._warming,l.y*=s._warming}}},s.pointAWorld=function(t){return{x:(t.bodyA?t.bodyA.position.x:0)+(t.pointA?t.pointA.x:0),y:(t.bodyA?t.bodyA.position.y:0)+(t.pointA?t.pointA.y:0)}},s.pointBWorld=function(t){return{x:(t.bodyB?t.bodyB.position.x:0)+(t.pointB?t.pointB.x:0),y:(t.bodyB?t.bodyB.position.y:0)+(t.pointB?t.pointB.y:0)}}},68758:(t,e,i)=>{var s={};t.exports=s,function(){s._nextId=0,s._seed=0,s._nowStartTime=+new Date,s._warnedOnce={},s._decomp=null,s.extend=function(t,e){var i,n;"boolean"==typeof e?(i=2,n=e):(i=1,n=!0);for(var r=i;r0;e--){var i=Math.floor(s.random()*(e+1)),n=t[e];t[e]=t[i],t[i]=n}return t},s.choose=function(t){return t[Math.floor(s.random()*t.length)]},s.isElement=function(t){return"undefined"!=typeof HTMLElement?t instanceof HTMLElement:!!(t&&t.nodeType&&t.nodeName)},s.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},s.isFunction=function(t){return"function"==typeof t},s.isPlainObject=function(t){return"object"==typeof t&&t.constructor===Object},s.isString=function(t){return"[object String]"===toString.call(t)},s.clamp=function(t,e,i){return ti?i:t},s.sign=function(t){return t<0?-1:1},s.now=function(){if("undefined"!=typeof window&&window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return Date.now?Date.now():new Date-s._nowStartTime},s.random=function(e,i){return i=void 0!==i?i:1,(e=void 0!==e?e:0)+t()*(i-e)};var t=function(){return s._seed=(9301*s._seed+49297)%233280,s._seed/233280};s.colorToNumber=function(t){return 3==(t=t.replace("#","")).length&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),parseInt(t,16)},s.logLevel=1,s.log=function(){console&&s.logLevel>0&&s.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},s.info=function(){console&&s.logLevel>0&&s.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},s.warn=function(){console&&s.logLevel>0&&s.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},s.warnOnce=function(){var t=Array.prototype.slice.call(arguments).join(" ");s._warnedOnce[t]||(s.warn(t),s._warnedOnce[t]=!0)},s.deprecated=function(t,e,i){t[e]=s.chain((function(){s.warnOnce("🔅 deprecated 🔅",i)}),t[e])},s.nextId=function(){return s._nextId++},s.indexOf=function(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0;i{var s={};t.exports=s;var n=i(22806),r=i(44272),o=i(13657),a=i(91327),h=i(39073),l=i(11299),u=i(52838),c=i(68758),d=i(84125);s.create=function(t){t=t||{};var e=c.extend({positionIterations:6,velocityIterations:4,constraintIterations:2,enableSleeping:!1,events:[],plugin:{},gravity:{x:0,y:1,scale:.001},timing:{timestamp:0,timeScale:1,lastDelta:0,lastElapsed:0}},t);return e.world=t.world||l.create({label:"World"}),e.pairs=t.pairs||a.create(),e.detector=t.detector||o.create(),e.grid={buckets:[]},e.world.gravity=e.gravity,e.broadphase=e.grid,e.metrics={},e},s.update=function(t,e,i){var d=c.now();e=e||1e3/60,i=i||1;var p,f=t.world,v=t.detector,g=t.pairs,m=t.timing,y=m.timestamp;m.timestamp+=e*m.timeScale,m.lastDelta=e*m.timeScale;var x={timestamp:m.timestamp};h.trigger(t,"beforeUpdate",x);var T=l.allBodies(f),w=l.allConstraints(f);for(f.isModified&&o.setBodies(v,T),f.isModified&&l.setModified(f,!1,!1,!0),t.enableSleeping&&n.update(T,m.timeScale),s._bodiesApplyGravity(T,t.gravity),s._bodiesUpdate(T,e,m.timeScale,i,f.bounds),u.preSolveAll(T),p=0;p0&&h.trigger(t,"collisionStart",{pairs:g.collisionStart}),r.preSolvePosition(g.list),p=0;p0&&h.trigger(t,"collisionActive",{pairs:g.collisionActive}),g.collisionEnd.length>0&&h.trigger(t,"collisionEnd",{pairs:g.collisionEnd}),s._bodiesClearForces(T),h.trigger(t,"afterUpdate",x),t.timing.lastElapsed=c.now()-d,t},s.merge=function(t,e){if(c.extend(t,e),e.world){t.world=e.world,s.clear(t);for(var i=l.allBodies(t.world),r=0;r{var s={};t.exports=s;var n=i(68758);s.on=function(t,e,i){for(var s,n=e.split(" "),r=0;r0){i||(i={}),s=e.split(" ");for(var l=0;l{var s={};t.exports=s;var n=i(84474),r=i(68758);s.name="matter-js",s.version="0.18.0",s.uses=[],s.used=[],s.use=function(){n.use(s,Array.prototype.slice.call(arguments))},s.before=function(t,e){return t=t.replace(/^Matter./,""),r.chainPathBefore(s,t,e)},s.after=function(t,e){return t=t.replace(/^Matter./,""),r.chainPathAfter(s,t,e)}},84474:(t,e,i)=>{var s={};t.exports=s;var n=i(68758);s._registry={},s.register=function(t){if(s.isPlugin(t)||n.warn("Plugin.register:",s.toString(t),"does not implement all required fields."),t.name in s._registry){var e=s._registry[t.name],i=s.versionParse(t.version).number,r=s.versionParse(e.version).number;i>r?(n.warn("Plugin.register:",s.toString(e),"was upgraded to",s.toString(t)),s._registry[t.name]=t):i-1},s.isFor=function(t,e){var i=t.for&&s.dependencyParse(t.for);return!t.for||e.name===i.name&&s.versionSatisfies(e.version,i.range)},s.use=function(t,e){if(t.uses=(t.uses||[]).concat(e||[]),0!==t.uses.length){for(var i=s.dependencies(t),r=n.topologicalSort(i),o=[],a=0;a0&&!h.silent&&n.info(o.join(" "))}else n.warn("Plugin.use:",s.toString(t),"does not specify any dependencies to install.")},s.dependencies=function(t,e){var i=s.dependencyParse(t),r=i.name;if(!(r in(e=e||{}))){t=s.resolve(t)||t,e[r]=n.map(t.uses||[],(function(e){s.isPlugin(e)&&s.register(e);var r=s.dependencyParse(e),o=s.resolve(e);return o&&!s.versionSatisfies(o.version,r.range)?(n.warn("Plugin.dependencies:",s.toString(o),"does not satisfy",s.toString(r),"used by",s.toString(i)+"."),o._warned=!0,t._warned=!0):o||(n.warn("Plugin.dependencies:",s.toString(e),"used by",s.toString(i),"could not be resolved."),t._warned=!0),r.name}));for(var o=0;o=|>)?\s*((\d+)\.(\d+)\.(\d+))(-[0-9A-Za-z-+]+)?$/;e.test(t)||n.warn("Plugin.versionParse:",t,"is not a valid version or range.");var i=e.exec(t),s=Number(i[4]),r=Number(i[5]),o=Number(i[6]);return{isRange:Boolean(i[1]||i[2]),version:i[3],range:t,operator:i[1]||i[2]||"",major:s,minor:r,patch:o,parts:[s,r,o],prerelease:i[7],number:1e8*s+1e4*r+o}},s.versionSatisfies=function(t,e){e=e||"*";var i=s.versionParse(e),n=s.versionParse(t);if(i.isRange){if("*"===i.operator||"*"===t)return!0;if(">"===i.operator)return n.number>i.number;if(">="===i.operator)return n.number>=i.number;if("~"===i.operator)return n.major===i.major&&n.minor===i.minor&&n.patch>=i.patch;if("^"===i.operator)return i.major>0?n.major===i.major&&n.number>=i.number:i.minor>0?n.minor===i.minor&&n.patch>=i.patch:n.patch===i.patch}return t===e||"*"===t}},22806:(t,e,i)=>{var s={};t.exports=s;var n=i(39073);s._motionWakeThreshold=.18,s._motionSleepThreshold=.08,s._minBias=.9,s.update=function(t,e){for(var i=e*e*e,n=0;n0&&r.motion=r.sleepThreshold&&s.set(r,!0)):r.sleepCounter>0&&(r.sleepCounter-=1)}else s.set(r,!1)}},s.afterCollisions=function(t,e){for(var i=e*e*e,n=0;ns._motionWakeThreshold*i&&s.set(l,!1)}}}},s.set=function(t,e){var i=t.isSleeping;e?(t.isSleeping=!0,t.sleepCounter=t.sleepThreshold,t.positionImpulse.x=0,t.positionImpulse.y=0,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.anglePrev=t.angle,t.speed=0,t.angularSpeed=0,t.motion=0,i||n.trigger(t,"sleepStart")):(t.isSleeping=!1,t.sleepCounter=0,i&&n.trigger(t,"sleepEnd"))}},68516:(t,e,i)=>{var s={};t.exports=s;var n=i(39745),r=i(68758),o=i(84125),a=i(84091),h=i(10438);s.rectangle=function(t,e,i,s,a){a=a||{};var h={label:"Rectangle Body",position:{x:t,y:e},vertices:n.fromPath("L 0 0 L "+i+" 0 L "+i+" "+s+" L 0 "+s)};if(a.chamfer){var l=a.chamfer;h.vertices=n.chamfer(h.vertices,l.radius,l.quality,l.qualityMin,l.qualityMax),delete a.chamfer}return o.create(r.extend({},h,a))},s.trapezoid=function(t,e,i,s,a,h){h=h||{};var l,u=i*(a*=.5),c=u+(1-2*a)*i,d=c+u;l=a<.5?"L 0 0 L "+u+" "+-s+" L "+c+" "+-s+" L "+d+" 0":"L 0 0 L "+c+" "+-s+" L "+d+" 0";var p={label:"Trapezoid Body",position:{x:t,y:e},vertices:n.fromPath(l)};if(h.chamfer){var f=h.chamfer;p.vertices=n.chamfer(p.vertices,f.radius,f.quality,f.qualityMin,f.qualityMax),delete h.chamfer}return o.create(r.extend({},p,h))},s.circle=function(t,e,i,n,o){n=n||{};var a={label:"Circle Body",circleRadius:i};o=o||25;var h=Math.ceil(Math.max(10,Math.min(o,i)));return h%2==1&&(h+=1),s.polygon(t,e,h,i,r.extend({},a,n))},s.polygon=function(t,e,i,a,h){if(h=h||{},i<3)return s.circle(t,e,a,h);for(var l=2*Math.PI/i,u="",c=.5*l,d=0;d0&&n.area(b)1?(p=o.create(r.extend({parts:f.slice(0)},a)),o.setPosition(p,{x:t,y:e}),p):f[0]},s.flagCoincidentParts=function(t,e){void 0===e&&(e=5);for(var i=0;i{var s={};t.exports=s;var n=i(11299),r=i(52838),o=i(68758),a=i(84125),h=i(68516),l=o.deprecated;s.stack=function(t,e,i,s,r,o,h){for(var l,u=n.create({label:"Stack"}),c=t,d=e,p=0,f=0;fv&&(v=y),a.translate(m,{x:.5*x,y:.5*y}),c=m.bounds.max.x+r,n.addBody(u,m),l=m,p+=1}else c+=r}d+=v+o,c=t}return u},s.chain=function(t,e,i,s,a,h){for(var l=t.bodies,u=1;u0)for(l=0;l0&&(d=p[l-1+(h-1)*e],n.addConstraint(t,r.create(o.extend({bodyA:d,bodyB:c},a)))),s&&ld||o<(l=d-l)||o>i-1-l))return 1===c&&a.translate(u,{x:(o+(i%2==1?1:-1))*p,y:0}),h(t+(u?o*p:0)+o*r,s,o,l,u,c)}))},s.newtonsCradle=function(t,e,i,s,o){for(var a=n.create({label:"Newtons Cradle"}),l=0;l{var s={};t.exports=s;var n=i(10438),r=i(68758);s.fromVertices=function(t){for(var e={},i=0;i{var e={};t.exports=e,e.create=function(t){var i={min:{x:0,y:0},max:{x:0,y:0}};return t&&e.update(i,t),i},e.update=function(t,e,i){t.min.x=1/0,t.max.x=-1/0,t.min.y=1/0,t.max.y=-1/0;for(var s=0;st.max.x&&(t.max.x=n.x),n.xt.max.y&&(t.max.y=n.y),n.y0?t.max.x+=i.x:t.min.x+=i.x,i.y>0?t.max.y+=i.y:t.min.y+=i.y)},e.contains=function(t,e){return e.x>=t.min.x&&e.x<=t.max.x&&e.y>=t.min.y&&e.y<=t.max.y},e.overlaps=function(t,e){return t.min.x<=e.max.x&&t.max.x>=e.min.x&&t.max.y>=e.min.y&&t.min.y<=e.max.y},e.translate=function(t,e){t.min.x+=e.x,t.max.x+=e.x,t.min.y+=e.y,t.max.y+=e.y},e.shift=function(t,e){var i=t.max.x-t.min.x,s=t.max.y-t.min.y;t.min.x=e.x,t.max.x=e.x+i,t.min.y=e.y,t.max.y=e.y+s}},92765:(t,e,i)=>{var s={};t.exports=s;i(84091);var n=i(68758);s.pathToVertices=function(t,e){"undefined"==typeof window||"SVGPathSeg"in window||n.warn("Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.");var i,r,o,a,h,l,u,c,d,p,f,v=[],g=0,m=0,y=0;e=e||15;var x=function(t,e,i){var s=i%2==1&&i>1;if(!d||t!=d.x||e!=d.y){d&&s?(p=d.x,f=d.y):(p=0,f=0);var n={x:p+t,y:f+e};!s&&d||(d=n),v.push(n),m=p+t,y=f+e}},T=function(t){var e=t.pathSegTypeAsLetter.toUpperCase();if("Z"!==e){switch(e){case"M":case"L":case"T":case"C":case"S":case"Q":m=t.x,y=t.y;break;case"H":m=t.x;break;case"V":y=t.y}x(m,y,t.pathSegType)}};for(s._svgPathToAbsolute(t),o=t.getTotalLength(),l=[],i=0;i{var e={};t.exports=e,e.create=function(t,e){return{x:t||0,y:e||0}},e.clone=function(t){return{x:t.x,y:t.y}},e.magnitude=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},e.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},e.rotate=function(t,e,i){var s=Math.cos(e),n=Math.sin(e);i||(i={});var r=t.x*s-t.y*n;return i.y=t.x*n+t.y*s,i.x=r,i},e.rotateAbout=function(t,e,i,s){var n=Math.cos(e),r=Math.sin(e);s||(s={});var o=i.x+((t.x-i.x)*n-(t.y-i.y)*r);return s.y=i.y+((t.x-i.x)*r+(t.y-i.y)*n),s.x=o,s},e.normalise=function(t){var i=e.magnitude(t);return 0===i?{x:0,y:0}:{x:t.x/i,y:t.y/i}},e.dot=function(t,e){return t.x*e.x+t.y*e.y},e.cross=function(t,e){return t.x*e.y-t.y*e.x},e.cross3=function(t,e,i){return(e.x-t.x)*(i.y-t.y)-(e.y-t.y)*(i.x-t.x)},e.add=function(t,e,i){return i||(i={}),i.x=t.x+e.x,i.y=t.y+e.y,i},e.sub=function(t,e,i){return i||(i={}),i.x=t.x-e.x,i.y=t.y-e.y,i},e.mult=function(t,e){return{x:t.x*e,y:t.y*e}},e.div=function(t,e){return{x:t.x/e,y:t.y/e}},e.perp=function(t,e){return{x:(e=!0===e?-1:1)*-t.y,y:e*t.x}},e.neg=function(t){return{x:-t.x,y:-t.y}},e.angle=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)},e._temp=[e.create(),e.create(),e.create(),e.create(),e.create(),e.create()]},39745:(t,e,i)=>{var s={};t.exports=s;var n=i(10438),r=i(68758);s.create=function(t,e){for(var i=[],s=0;s0)return!1;o=i}return!0},s.scale=function(t,e,i,r){if(1===e&&1===i)return t;var o,a;r=r||s.centre(t);for(var h=0;h=0?h-1:t.length-1],u=t[h],c=t[(h+1)%t.length],d=e[h0&&(r|=2),3===r)return!1;return 0!==r||null},s.hull=function(t){var e,i,s=[],r=[];for((t=t.slice(0)).sort((function(t,e){var i=t.x-e.x;return 0!==i?i:t.y-e.y})),i=0;i=2&&n.cross3(r[r.length-2],r[r.length-1],e)<=0;)r.pop();r.push(e)}for(i=t.length-1;i>=0;i-=1){for(e=t[i];s.length>=2&&n.cross3(s[s.length-2],s[s.length-1],e)<=0;)s.pop();s.push(e)}return s.pop(),r.pop(),s.concat(r)}},1675:(t,e,i)=>{var s=i(18171),n={name:"matter-attractors",version:"0.1.7",for:"matter-js@^0.18.0",silent:!0,install:function(t){t.after("Body.create",(function(){n.Body.init(this)})),t.before("Engine.update",(function(t){n.Engine.update(t)}))},Body:{init:function(t){t.plugin.attractors=t.plugin.attractors||[]}},Engine:{update:function(t){for(var e=s.Composite.allBodies(t.world),i=0;i0)for(var o=0;o{t.exports={name:"matter-collision-events",version:"0.1.6",for:"matter-js@^0.18.0",silent:!0,install:function(t){t.after("Engine.create",(function(){t.Events.on(this,"collisionStart",(function(e){e.pairs.map((function(e){var i=e.bodyA,s=e.bodyB;i.gameObject&&i.gameObject.emit("collide",i,s,e),s.gameObject&&s.gameObject.emit("collide",s,i,e),t.Events.trigger(i,"onCollide",{pair:e}),t.Events.trigger(s,"onCollide",{pair:e}),i.onCollideCallback&&i.onCollideCallback(e),s.onCollideCallback&&s.onCollideCallback(e),i.onCollideWith[s.id]&&i.onCollideWith[s.id](s,e),s.onCollideWith[i.id]&&s.onCollideWith[i.id](i,e)}))})),t.Events.on(this,"collisionActive",(function(e){e.pairs.map((function(e){var i=e.bodyA,s=e.bodyB;i.gameObject&&i.gameObject.emit("collideActive",i,s,e),s.gameObject&&s.gameObject.emit("collideActive",s,i,e),t.Events.trigger(i,"onCollideActive",{pair:e}),t.Events.trigger(s,"onCollideActive",{pair:e}),i.onCollideActiveCallback&&i.onCollideActiveCallback(e),s.onCollideActiveCallback&&s.onCollideActiveCallback(e)}))})),t.Events.on(this,"collisionEnd",(function(e){e.pairs.map((function(e){var i=e.bodyA,s=e.bodyB;i.gameObject&&i.gameObject.emit("collideEnd",i,s,e),s.gameObject&&s.gameObject.emit("collideEnd",s,i,e),t.Events.trigger(i,"onCollideEnd",{pair:e}),t.Events.trigger(s,"onCollideEnd",{pair:e}),i.onCollideEndCallback&&i.onCollideEndCallback(e),s.onCollideEndCallback&&s.onCollideEndCallback(e)}))}))}))}}},44097:(t,e,i)=>{var s=i(18171),n={name:"matter-wrap",version:"0.1.4",for:"matter-js@^0.18.0",silent:!0,install:function(t){t.after("Engine.update",(function(){n.Engine.update(this)}))},Engine:{update:function(t){for(var e=t.world,i=s.Composite.allBodies(e),r=s.Composite.allComposites(e),o=0;oe.max.x?i=e.min.x-t.max.x:t.max.xe.max.y?s=e.min.y-t.max.y:t.max.y{function e(t,e,i){i=i||0;var s,n,r,o,a,h,l,u=[0,0];return s=t[1][1]-t[0][1],n=t[0][0]-t[1][0],r=s*t[0][0]+n*t[0][1],o=e[1][1]-e[0][1],a=e[0][0]-e[1][0],h=o*e[0][0]+a*e[0][1],E(l=s*a-o*n,0,i)||(u[0]=(a*r-n*h)/l,u[1]=(s*h-o*r)/l),u}function i(t,e,i,s){var n=e[0]-t[0],r=e[1]-t[1],o=s[0]-i[0],a=s[1]-i[1];if(o*r-a*n==0)return!1;var h=(n*(i[1]-t[1])+r*(t[0]-i[0]))/(o*r-a*n),l=(o*(t[1]-i[1])+a*(i[0]-t[0]))/(a*n-o*r);return h>=0&&h<=1&&l>=0&&l<=1}function s(t,e,i){return(e[0]-t[0])*(i[1]-t[1])-(i[0]-t[0])*(e[1]-t[1])}function n(t,e,i){return s(t,e,i)>0}function r(t,e,i){return s(t,e,i)>=0}function o(t,e,i){return s(t,e,i)<0}function a(t,e,i){return s(t,e,i)<=0}t.exports={decomp:function(t){var e=T(t);return e.length>0?w(t,e):[t]},quickDecomp:function t(e,i,s,h,l,u,v){u=u||100,v=v||0,l=l||25,i=void 0!==i?i:[],s=s||[],h=h||[];var g=[0,0],m=[0,0],x=[0,0],T=0,w=0,E=0,S=0,A=0,_=0,C=0,R=[],M=[],P=e,O=e;if(O.length<3)return i;if(++v>u)return console.warn("quickDecomp: max level ("+u+") reached."),i;for(var L=0;LA&&(A+=e.length),S=Number.MAX_VALUE,A<_)return i;for(F=_;F<=A;++F)r(d(P,L-1),d(P,L),d(P,F))&&a(d(P,L+1),d(P,L),d(P,F))&&(E=c(d(P,L),d(P,F)))3&&s>=0;--s)u(d(t,s-1),d(t,s),d(t,s+1),e)&&(t.splice(s%t.length,1),i++);return i},removeDuplicatePoints:function(t,e){for(var i=t.length-1;i>=1;--i)for(var s=t[i],n=i-1;n>=0;--n)S(s,t[n],e)&&t.splice(i,1)},makeCCW:function(t){for(var e=0,i=t,s=1;si[e][0])&&(e=s);return!n(d(t,e-1),d(t,e),d(t,e+1))&&(function(t){for(var e=[],i=t.length,s=0;s!==i;s++)e.push(t.pop());for(s=0;s!==i;s++)t[s]=e[s]}(t),!0)}};var h=[],l=[];function u(t,e,i,n){if(n){var r=h,o=l;r[0]=e[0]-t[0],r[1]=e[1]-t[1],o[0]=i[0]-e[0],o[1]=i[1]-e[1];var a=r[0]*o[0]+r[1]*o[1],u=Math.sqrt(r[0]*r[0]+r[1]*r[1]),c=Math.sqrt(o[0]*o[0]+o[1]*o[1]);return Math.acos(a/(u*c)){var s=new(i(56694))({initialize:function(t){this.pluginManager=t,this.game=t.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=s},18360:t=>{t.exports={Global:["game","anims","cache","plugins","registry","scale","sound","textures","renderer"],CoreScene:["EventEmitter","CameraManager","GameObjectCreator","GameObjectFactory","ScenePlugin","DisplayList","UpdateList"],DefaultScene:["Clock","DataManagerPlugin","InputPlugin","Loader","TweenManager","LightsPlugin"]}},91963:t=>{var e={},i={},s={register:function(t,i,s,n){void 0===n&&(n=!1),e[t]={plugin:i,mapping:s,custom:n}},registerCustom:function(t,e,s,n){i[t]={plugin:e,mapping:s,data:n}},hasCore:function(t){return e.hasOwnProperty(t)},hasCustom:function(t){return i.hasOwnProperty(t)},getCore:function(t){return e[t]},getCustom:function(t){return i[t]},getCustomClass:function(t){return i.hasOwnProperty(t)?i[t].plugin:null},remove:function(t){e.hasOwnProperty(t)&&delete e[t]},removeCustom:function(t){i.hasOwnProperty(t)&&delete i[t]},destroyCorePlugins:function(){for(var t in e)e.hasOwnProperty(t)&&delete e[t]},destroyCustomPlugins:function(){for(var t in i)i.hasOwnProperty(t)&&delete i[t]}};t.exports=s},49274:(t,e,i)=>{var s=i(56694),n=i(97081),r=i(6659),o=i(76846),a=i(99325),h=i(61286),l=i(72632),u=i(91963),c=i(66458),d=new s({Extends:r,initialize:function(t){r.call(this),this.game=t,this.plugins=[],this.scenePlugins=[],this._pendingGlobal=[],this._pendingScene=[],t.isBooted?this.boot():t.events.once(n.BOOT,this.boot,this)},boot:function(){var t,e,i,s,r,o,a,h=this.game.config,u=h.installGlobalPlugins;for(u=u.concat(this._pendingGlobal),t=0;t{var s=i(88257),n=i(56694),r=i(7599),o=new n({Extends:s,initialize:function(t,e,i){s.call(this,e),this.scene=t,this.systems=t.sys,this.pluginKey=i,t.sys.events.once(r.BOOT,this.boot,this)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=o},45615:(t,e,i)=>{t.exports={BasePlugin:i(88257),DefaultPlugins:i(18360),PluginCache:i(91963),PluginManager:i(49274),ScenePlugin:i(39283)}},37823:()=>{Array.prototype.forEach||(Array.prototype.forEach=function(t){"use strict";if(null==this)throw new TypeError;var e=Object(this),i=e.length>>>0;if("function"!=typeof t)throw new TypeError;for(var s=arguments.length>=2?arguments[1]:void 0,n=0;n{Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)})},22782:()=>{!function(){function t(t){t&&(t.setTargetAtTime||(t.setTargetAtTime=t.setTargetValueAtTime))}window.hasOwnProperty("webkitAudioContext")&&!window.hasOwnProperty("AudioContext")&&(window.AudioContext=webkitAudioContext,AudioContext.prototype.hasOwnProperty("createGain")||(AudioContext.prototype.createGain=AudioContext.prototype.createGainNode),AudioContext.prototype.hasOwnProperty("createDelay")||(AudioContext.prototype.createDelay=AudioContext.prototype.createDelayNode),AudioContext.prototype.hasOwnProperty("createScriptProcessor")||(AudioContext.prototype.createScriptProcessor=AudioContext.prototype.createJavaScriptNode),AudioContext.prototype.hasOwnProperty("createPeriodicWave")||(AudioContext.prototype.createPeriodicWave=AudioContext.prototype.createWaveTable),AudioContext.prototype.internal_createGain=AudioContext.prototype.createGain,AudioContext.prototype.createGain=function(){var e=this.internal_createGain();return t(e.gain),e},AudioContext.prototype.internal_createDelay=AudioContext.prototype.createDelay,AudioContext.prototype.createDelay=function(e){var i=e?this.internal_createDelay(e):this.internal_createDelay();return t(i.delayTime),i},AudioContext.prototype.internal_createBufferSource=AudioContext.prototype.createBufferSource,AudioContext.prototype.createBufferSource=function(){var e=this.internal_createBufferSource();return e.start?(e.internal_start=e.start,e.start=function(t,i,s){void 0!==s?e.internal_start(t||0,i,s):e.internal_start(t||0,i||0)}):e.start=function(t,e,i){e||i?this.noteGrainOn(t||0,e,i):this.noteOn(t||0)},e.stop?(e.internal_stop=e.stop,e.stop=function(t){e.internal_stop(t||0)}):e.stop=function(t){this.noteOff(t||0)},t(e.playbackRate),e},AudioContext.prototype.internal_createDynamicsCompressor=AudioContext.prototype.createDynamicsCompressor,AudioContext.prototype.createDynamicsCompressor=function(){var e=this.internal_createDynamicsCompressor();return t(e.threshold),t(e.knee),t(e.ratio),t(e.reduction),t(e.attack),t(e.release),e},AudioContext.prototype.internal_createBiquadFilter=AudioContext.prototype.createBiquadFilter,AudioContext.prototype.createBiquadFilter=function(){var e=this.internal_createBiquadFilter();return t(e.frequency),t(e.detune),t(e.Q),t(e.gain),e},AudioContext.prototype.hasOwnProperty("createOscillator")&&(AudioContext.prototype.internal_createOscillator=AudioContext.prototype.createOscillator,AudioContext.prototype.createOscillator=function(){var e=this.internal_createOscillator();return e.start?(e.internal_start=e.start,e.start=function(t){e.internal_start(t||0)}):e.start=function(t){this.noteOn(t||0)},e.stop?(e.internal_stop=e.stop,e.stop=function(t){e.internal_stop(t||0)}):e.stop=function(t){this.noteOff(t||0)},e.setPeriodicWave||(e.setPeriodicWave=e.setWaveTable),t(e.frequency),t(e.detune),e})),window.hasOwnProperty("webkitOfflineAudioContext")&&!window.hasOwnProperty("OfflineAudioContext")&&(window.OfflineAudioContext=webkitOfflineAudioContext)}()},58909:()=>{Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)})},52273:()=>{if("function"!=typeof window.Uint32Array&&"object"!=typeof window.Uint32Array){var t=function(t){var e=new Array;window[t]=function(t){if("number"==typeof t){Array.call(this,t),this.length=t;for(var e=0;e{window.console||(window.console={},window.console.log=window.console.assert=function(){},window.console.warn=window.console.assert=function(){})},92244:(t,e,i)=>{i(37823),i(60680),i(22782),i(77844),i(58909),i(52108),i(77359),i(52273)},52108:()=>{!function(){if("performance"in window==!1&&(window.performance={}),Date.now=Date.now||function(){return(new Date).getTime()},"now"in window.performance==!1){var t=Date.now();performance.timing&&performance.timing.navigationStart&&(t=performance.timing.navigationStart),window.performance.now=function(){return Date.now()-t}}}()},77359:()=>{for(var t=Date.now(),e=["ms","moz","webkit","o"],i=0;i{t.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,ERASE:17,SOURCE_IN:18,SOURCE_OUT:19,SOURCE_ATOP:20,DESTINATION_OVER:21,DESTINATION_IN:22,DESTINATION_OUT:23,DESTINATION_ATOP:24,LIGHTER:25,COPY:26,XOR:27}},27394:t=>{t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},91135:(t,e,i)=>{var s=i(89787),n=i(61840),r=i(56694),o=i(86459),a=i(6659),h=i(81044),l=i(32834),u=i(40444),c=i(38203),d=i(69360),p=new r({Extends:a,initialize:function(t){a.call(this);var e=t.config;this.config={clearBeforeRender:e.clearBeforeRender,backgroundColor:e.backgroundColor,antialias:e.antialias,roundPixels:e.roundPixels},this.game=t,this.type=o.CANVAS,this.drawCount=0,this.width=0,this.height=0,this.gameCanvas=t.canvas;var i={alpha:t.config.transparent,desynchronized:t.config.desynchronized,willReadFrequently:!1};this.gameContext=e.context?e.context:this.gameCanvas.getContext("2d",i),this.currentContext=this.gameContext,this.antialias=t.config.antialias,this.blendModes=l(),this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this._tempMatrix1=new d,this._tempMatrix2=new d,this._tempMatrix3=new d,this.isBooted=!1,this.init()},init:function(){this.game.textures.once(c.READY,this.boot,this)},boot:function(){var t=this.game,e=t.scale.baseSize;this.width=e.width,this.height=e.height,this.isBooted=!0,t.scale.on(u.RESIZE,this.onResize,this),this.resize(e.width,e.height)},onResize:function(t,e){e.width===this.width&&e.height===this.height||this.resize(e.width,e.height)},resize:function(t,e){this.width=t,this.height=e,this.emit(h.RESIZE,t,e)},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(t){return this.currentContext.globalCompositeOperation=t,this},setContext:function(t){return this.currentContext=t||this.gameContext,this},setAlpha:function(t){return this.currentContext.globalAlpha=t,this},preRender:function(){var t=this.gameContext,e=this.config,i=this.width,s=this.height;t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),e.clearBeforeRender&&(t.clearRect(0,0,i,s),e.transparent||(t.fillStyle=e.backgroundColor.rgba,t.fillRect(0,0,i,s))),t.save(),this.drawCount=0,this.emit(h.PRE_RENDER)},render:function(t,e,i){var n=e.length;this.emit(h.RENDER,t,i);var r=i.x,o=i.y,a=i.width,l=i.height,u=i.renderToTexture?i.context:t.sys.context;u.save(),this.game.scene.customViewports&&(u.beginPath(),u.rect(r,o,a,l),u.clip()),i.emit(s.PRE_RENDER,i),this.currentContext=u;var c=i.mask;c&&c.preRenderCanvas(this,null,i._maskCamera),i.transparent||(u.fillStyle=i.backgroundColor.rgba,u.fillRect(r,o,a,l)),u.globalAlpha=i.alpha,u.globalCompositeOperation="source-over",this.drawCount+=n,i.renderToTexture&&i.emit(s.PRE_RENDER,i),i.matrix.copyToContext(u);for(var d=0;d=0?m=-(m+c):m<0&&(m=Math.abs(m)-c)),t.flipY&&(y>=0?y=-(y+d):y<0&&(y=Math.abs(y)-d))}var T=1,w=1;t.flipX&&(p||(m+=-e.realWidth+2*v),T=-1),t.flipY&&(p||(y+=-e.realHeight+2*g),w=-1),a.applyITRS(t.x,t.y,t.rotation,t.scaleX*T,t.scaleY*w),o.copyFrom(i.matrix),s?(o.multiplyWithOffset(s,-i.scrollX*t.scrollFactorX,-i.scrollY*t.scrollFactorY),a.e=t.x,a.f=t.y):(a.e-=i.scrollX*t.scrollFactorX,a.f-=i.scrollY*t.scrollFactorY),o.multiply(a),i.roundPixels&&(o.e=Math.round(o.e),o.f=Math.round(o.f)),r.save(),o.setToContext(r),r.globalCompositeOperation=this.blendModes[t.blendMode],r.globalAlpha=n,r.imageSmoothingEnabled=!e.source.scaleMode,t.mask&&t.mask.preRenderCanvas(this,t,i),c>0&&d>0&&r.drawImage(e.source.image,l,u,c,d,m,y,c/f,d/f),t.mask&&t.mask.postRenderCanvas(this,t,i),r.restore()}},destroy:function(){this.removeAllListeners(),this.game=null,this.gameCanvas=null,this.gameContext=null}});t.exports=p},6046:(t,e,i)=>{t.exports={CanvasRenderer:i(91135),GetBlendModes:i(32834),SetTransform:i(49584)}},32834:(t,e,i)=>{var s=i(95723),n=i(98581);t.exports=function(){var t=[],e=n.supportNewBlendModes,i="source-over";return t[s.NORMAL]=i,t[s.ADD]="lighter",t[s.MULTIPLY]=e?"multiply":i,t[s.SCREEN]=e?"screen":i,t[s.OVERLAY]=e?"overlay":i,t[s.DARKEN]=e?"darken":i,t[s.LIGHTEN]=e?"lighten":i,t[s.COLOR_DODGE]=e?"color-dodge":i,t[s.COLOR_BURN]=e?"color-burn":i,t[s.HARD_LIGHT]=e?"hard-light":i,t[s.SOFT_LIGHT]=e?"soft-light":i,t[s.DIFFERENCE]=e?"difference":i,t[s.EXCLUSION]=e?"exclusion":i,t[s.HUE]=e?"hue":i,t[s.SATURATION]=e?"saturation":i,t[s.COLOR]=e?"color":i,t[s.LUMINOSITY]=e?"luminosity":i,t[s.ERASE]="destination-out",t[s.SOURCE_IN]="source-in",t[s.SOURCE_OUT]="source-out",t[s.SOURCE_ATOP]="source-atop",t[s.DESTINATION_OVER]="destination-over",t[s.DESTINATION_IN]="destination-in",t[s.DESTINATION_OUT]="destination-out",t[s.DESTINATION_ATOP]="destination-atop",t[s.LIGHTER]="lighter",t[s.COPY]="copy",t[s.XOR]="xor",t}},49584:(t,e,i)=>{var s=i(73329);t.exports=function(t,e,i,n,r){var o=n.alpha*i.alpha;if(o<=0)return!1;var a=s(i,n,r).calc;return e.globalCompositeOperation=t.blendModes[i.blendMode],e.globalAlpha=o,e.save(),a.setToContext(e),e.imageSmoothingEnabled=i.frame?!i.frame.source.scaleMode:t.antialias,!0}},70936:t=>{t.exports="postrender"},99298:t=>{t.exports="prerender"},7743:t=>{t.exports="render"},99519:t=>{t.exports="resize"},81044:(t,e,i)=>{t.exports={POST_RENDER:i(70936),PRE_RENDER:i(99298),RENDER:i(7743),RESIZE:i(99519)}},42069:(t,e,i)=>{t.exports={Canvas:i(6046),Events:i(81044),Snapshot:i(95528),WebGL:i(55478)}},61840:(t,e,i)=>{var s=i(61068),n=i(27119),r=i(72632);t.exports=function(t,e){var i=r(e,"callback"),o=r(e,"type","image/png"),a=r(e,"encoder",.92),h=Math.abs(Math.round(r(e,"x",0))),l=Math.abs(Math.round(r(e,"y",0))),u=Math.floor(r(e,"width",t.width)),c=Math.floor(r(e,"height",t.height));if(r(e,"getPixel",!1)){var d=t.getContext("2d").getImageData(h,l,1,1).data;i.call(null,new n(d[0],d[1],d[2],d[3]))}else if(0!==h||0!==l||u!==t.width||c!==t.height){var p=s.createWebGL(this,u,c),f=p.getContext("2d");u>0&&c>0&&f.drawImage(t,h,l,u,c,0,0,u,c);var v=new Image;v.onerror=function(){i.call(null),s.remove(p)},v.onload=function(){i.call(null,v),s.remove(p)},v.src=p.toDataURL(o,a)}else{var g=new Image;g.onerror=function(){i.call(null)},g.onload=function(){i.call(null,g)},g.src=t.toDataURL(o,a)}}},1217:(t,e,i)=>{var s=i(61068),n=i(27119),r=i(72632);t.exports=function(t,e){var i=t,o=r(e,"callback"),a=r(e,"type","image/png"),h=r(e,"encoder",.92),l=Math.abs(Math.round(r(e,"x",0))),u=Math.abs(Math.round(r(e,"y",0))),c=r(e,"getPixel",!1),d=r(e,"isFramebuffer",!1),p=d?r(e,"bufferWidth",1):i.drawingBufferWidth,f=d?r(e,"bufferHeight",1):i.drawingBufferHeight;if(c){var v=new Uint8Array(4),g=d?u:f-u;i.readPixels(l,g,1,1,i.RGBA,i.UNSIGNED_BYTE,v),o.call(null,new n(v[0],v[1],v[2],v[3]))}else{var m=Math.floor(r(e,"width",p)),y=Math.floor(r(e,"height",f)),x=new Uint8Array(m*y*4);i.readPixels(l,f-u-y,m,y,i.RGBA,i.UNSIGNED_BYTE,x);for(var T=s.createWebGL(this,m,y),w=T.getContext("2d"),b=w.getImageData(0,0,m,y),E=b.data,S=0;S{t.exports={Canvas:i(61840),WebGL:i(1217)}},35217:(t,e,i)=>{var s=i(56694),n=i(65641),r=i(33885),o=i(72632),a=i(37410),h=i(82127),l=i(5583),u=i(66901),c=i(77310),d=i(10919),p=i(21213),f=i(51212),v=i(60848),g=new s({initialize:function(t){this.game=t.game,this.renderer=t,this.classes=new r([[n.UTILITY_PIPELINE,v],[n.MULTI_PIPELINE,c],[n.BITMAPMASK_PIPELINE,l],[n.SINGLE_PIPELINE,f],[n.ROPE_PIPELINE,p],[n.LIGHT_PIPELINE,u],[n.POINTLIGHT_PIPELINE,d]]),this.postPipelineClasses=new r,this.pipelines=new r,this.current=null,this.previous=null,this.MULTI_PIPELINE=null,this.BITMAPMASK_PIPELINE=null,this.UTILITY_PIPELINE=null,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2,this.renderTargets=[],this.maxDimension=0,this.frameInc=32,this.targetIndex=0},boot:function(t){var e=this.renderer,i=this.renderTargets;this.frameInc=Math.floor(o(t,"frameInc",32));for(var s,r,h=e.width,l=e.height,u=Math.min(h,l),c=Math.ceil(u/this.frameInc),d=1;d=0;i--){var s=e[i];s.active&&s.preBatch(t)}}},postBatch:function(t){if(t.hasPostPipeline){this.flush();for(var e=t.postPipelines,i=0;i=0;i--){var s=e[i];s.active&&s.preBatch(t)}}},postBatchCamera:function(t){if(t.hasPostPipeline){this.flush();for(var e=t.postPipelines,i=0;ithis.maxDimension)return this.targetIndex=e.length-3,e[this.targetIndex];var i=3*(h(t,this.frameInc,0,!0)-1);return this.targetIndex=i,e[i]},getSwapRenderTarget:function(){return this.renderTargets[this.targetIndex+1]},getAltSwapRenderTarget:function(){return this.renderTargets[this.targetIndex+2]},destroy:function(){this.flush(),this.classes.clear(),this.postPipelineClasses.clear(),this.pipelines.clear(),this.renderer=null,this.game=null,this.classes=null,this.postPipelineClasses=null,this.pipelines=null,this.current=null,this.previous=null}});t.exports=g},37410:(t,e,i)=>{var s=i(56694),n=i(81044),r=new s({initialize:function(t,e,i,s,n,r,o){void 0===s&&(s=1),void 0===n&&(n=0),void 0===r&&(r=!0),void 0===o&&(o=!1),this.renderer=t,this.framebuffer=null,this.texture=null,this.width=0,this.height=0,this.scale=s,this.minFilter=n,this.autoClear=r,this.autoResize=!1,this.resize(e,i),o&&this.setAutoResize(!0)},setAutoResize:function(t){return t&&!this.autoResize?(this.renderer.on(n.RESIZE,this.resize,this),this.autoResize=!0):!t&&this.autoResize&&(this.renderer.off(n.RESIZE,this.resize,this),this.autoResize=!1),this},resize:function(t,e){var i=t*this.scale,s=e*this.scale;if(i!==this.width||s!==this.height){var n=this.renderer;n.deleteFramebuffer(this.framebuffer),n.deleteTexture(this.texture),t*=this.scale,e*=this.scale,(t=Math.round(t))<=0&&(t=1),(e=Math.round(e))<=0&&(e=1),this.texture=n.createTextureFromSource(null,t,e,this.minFilter,!0),this.framebuffer=n.createFramebuffer(t,e,this.texture,!1),this.width=t,this.height=e}return this},bind:function(t,e,i){if(void 0===t&&(t=!1),t&&this.renderer.flush(),e&&i&&this.resize(e,i),this.renderer.pushFramebuffer(this.framebuffer,!1,!1,!1),t&&this.adjustViewport(),this.autoClear){var s=this.renderer.gl;s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT)}},adjustViewport:function(){var t=this.renderer.gl;t.viewport(0,0,this.width,this.height),t.disable(t.SCISSOR_TEST)},clear:function(){var t=this.renderer,e=t.gl;t.pushFramebuffer(this.framebuffer),e.disable(e.SCISSOR_TEST),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),t.popFramebuffer(),t.resetScissor()},unbind:function(t){void 0===t&&(t=!1);var e=this.renderer;return t&&e.flush(),e.popFramebuffer()},destroy:function(){var t=this.renderer;t.deleteFramebuffer(this.framebuffer),t.deleteTexture(this.texture),t.off(n.RESIZE,this.resize,this),this.renderer=null,this.framebuffer=null,this.texture=null}});t.exports=r},75512:t=>{t.exports={getTintFromFloats:function(t,e,i,s){return((255&(255*s|0))<<24|(255&(255*t|0))<<16|(255&(255*e|0))<<8|255&(255*i|0))>>>0},getTintAppendFloatAlpha:function(t,e){return((255&(255*e|0))<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255&(255*e|0))<<24|(255&(0|t))<<16|(255&(t>>8|0))<<8|255&(t>>16|0))>>>0},getFloatsFromUintRGB:function(t){return[(255&(t>>16|0))/255,(255&(t>>8|0))/255,(255&(0|t))/255]},checkShaderMax:function(t,e){var i=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);return e&&-1!==e?Math.min(i,e):i},parseFragmentShaderMaxTextures:function(t,e){if(!t)return"";for(var i="vec4 getSampler (int index, vec2 uv) {",s=0;s0&&s{var s=i(56694),n=i(28699),r=i(6659),o=i(18970),a=i(72632),h=i(16650),l=i(81044),u=i(37410),c=i(75512),d=i(71305),p=new s({Extends:r,initialize:function(t){r.call(this);var e=t.game,i=e.renderer,s=i.gl;this.name=a(t,"name","WebGLPipeline"),this.game=e,this.renderer=i,this.manager,this.gl=s,this.view=e.canvas,this.width=0,this.height=0,this.vertexCount=0,this.vertexCapacity=0,this.vertexData,this.vertexBuffer,this.topology=a(t,"topology",s.TRIANGLES),this.bytes,this.vertexViewF32,this.vertexViewU32,this.active=!0,this.currentUnit=0,this.forceZero=a(t,"forceZero",!1),this.hasBooted=!1,this.isPostFX=!1,this.isSpriteFX=!1,this.renderTargets=[],this.currentRenderTarget,this.shaders=[],this.currentShader,this.projectionMatrix,this.projectionWidth=0,this.projectionHeight=0,this.config=t,this.glReset=!1},boot:function(){var t,e=this.gl,i=this.config,s=this.renderer;this.isPostFX||(this.projectionMatrix=(new h).identity());var n=this.renderTargets,r=a(i,"renderTarget",!1);"boolean"==typeof r&&r&&(r=1);var c=s.width,d=s.height;if("number"==typeof r)for(t=0;tx&&(x=y[t].vertexSize);var T=a(i,"batchSize",s.config.batchSize);this.vertexCapacity=6*T;var w=new ArrayBuffer(this.vertexCapacity*x);this.vertexData=w,this.bytes=new Uint8Array(w),this.vertexViewF32=new Float32Array(w),this.vertexViewU32=new Uint32Array(w);var b=a(i,"vertices",null);for(b?(this.vertexViewF32.set(b),this.vertexBuffer=s.createVertexBuffer(w,e.STATIC_DRAW)):this.vertexBuffer=s.createVertexBuffer(w.byteLength,e.DYNAMIC_DRAW),this.setVertexBuffer(),t=y.length-1;t>=0;t--)y[t].rebind();this.hasBooted=!0,s.on(l.RESIZE,this.resize,this),s.on(l.PRE_RENDER,this.onPreRender,this),s.on(l.RENDER,this.onRender,this),s.on(l.POST_RENDER,this.onPostRender,this),this.emit(o.BOOT,this),this.onBoot()},onBoot:function(){},onResize:function(){},setShader:function(t,e,i){var s=this.renderer;t===this.currentShader&&s.currentProgram===this.currentShader.program||(this.flush(),s.resetTextures(),this.setVertexBuffer(i)&&!e&&(e=!0),t.bind(e,!1),this.currentShader=t);return this},getShaderByName:function(t){for(var e=this.shaders,i=0;ithis.vertexCapacity},resize:function(t,e){t===this.width&&e===this.height||this.flush(),this.width=t,this.height=e;for(var i=this.renderTargets,s=0;s=0;i--){var s=e[i].rebind();t&&s!==t||(this.currentShader=s)}return this.emit(o.REBIND,this.currentShader),this.onActive(this.currentShader),this.onRebind(),this.glReset=!1,this},setVertexBuffer:function(t){void 0===t&&(t=this.vertexBuffer);var e=this.gl;return e.getParameter(e.ARRAY_BUFFER_BINDING)!==t&&(e.bindBuffer(e.ARRAY_BUFFER,t),!0)},preBatch:function(t){return this.currentRenderTarget&&this.currentRenderTarget.bind(),this.onPreBatch(t),this},postBatch:function(t){return this.onDraw(this.currentRenderTarget),this.onPostBatch(t),this},onDraw:function(){},unbind:function(){this.currentRenderTarget&&this.currentRenderTarget.unbind()},flush:function(t){if(void 0===t&&(t=!1),this.vertexCount>0){this.emit(o.BEFORE_FLUSH,this,t),this.onBeforeFlush(t);var e=this.gl,i=this.vertexCount,s=this.currentShader.vertexSize;this.active&&(this.setVertexBuffer(),i===this.vertexCapacity?e.bufferData(e.ARRAY_BUFFER,this.vertexData,e.DYNAMIC_DRAW):e.bufferSubData(e.ARRAY_BUFFER,0,this.bytes.subarray(0,i*s)),e.drawArrays(this.topology,0,i)),this.vertexCount=0,this.emit(o.AFTER_FLUSH,this,t),this.onAfterFlush(t)}return this},onActive:function(){},onBind:function(){},onRebind:function(){},onBatch:function(){},onPreBatch:function(){},onPostBatch:function(){},onPreRender:function(){},onRender:function(){},onPostRender:function(){},onBeforeFlush:function(){},onAfterFlush:function(){},batchVert:function(t,e,i,s,n,r,o){var a=this.vertexViewF32,h=this.vertexViewU32,l=this.vertexCount*this.currentShader.vertexComponentCount-1;a[++l]=t,a[++l]=e,a[++l]=i,a[++l]=s,a[++l]=n,a[++l]=r,h[++l]=o,this.vertexCount++},batchQuad:function(t,e,i,s,n,r,o,a,h,l,u,c,d,p,f,v,g,m,y,x){void 0===x&&(x=this.currentUnit);var T=!1;return this.shouldFlush(6)&&(this.flush(),T=!0,x=this.setTexture2D(y)),this.batchVert(e,i,l,u,x,m,p),this.batchVert(s,n,l,d,x,m,v),this.batchVert(r,o,c,d,x,m,g),this.batchVert(e,i,l,u,x,m,p),this.batchVert(r,o,c,d,x,m,g),this.batchVert(a,h,c,u,x,m,f),this.onBatch(t),T},batchTri:function(t,e,i,s,n,r,o,a,h,l,u,c,d,p,f,v,g){void 0===g&&(g=this.currentUnit);var m=!1;return this.shouldFlush(3)&&(this.flush(),m=!0,g=this.setTexture2D(v)),this.batchVert(e,i,a,h,g,f,c),this.batchVert(s,n,a,u,g,f,d),this.batchVert(r,o,l,u,g,f,p),this.onBatch(t),m},drawFillRect:function(t,e,i,s,n,r,o,a){void 0===o&&(o=this.renderer.whiteTexture.glTexture),void 0===a&&(a=!0),t=Math.floor(t),e=Math.floor(e);var h=Math.floor(t+i),l=Math.floor(e+s),u=this.setTexture2D(o),d=c.getTintAppendFloatAlphaAndSwap(n,r),p=0,f=1;a&&(p=1,f=0),this.batchQuad(null,t,e,t,l,h,l,h,e,0,p,1,f,d,d,d,d,0,o,u)},setTexture2D:function(t){return void 0===t&&(t=this.renderer.whiteTexture.glTexture),this.currentUnit=this.renderer.setTexture2D(t),this.currentUnit},bindTexture:function(t,e){void 0===e&&(e=0);var i=this.gl;return i.activeTexture(i.TEXTURE0+e),i.bindTexture(i.TEXTURE_2D,t),this},bindRenderTarget:function(t,e){return this.bindTexture(t.texture,e)},setTime:function(t){return this.set1f(t,this.game.loop.getDuration()),this},setBoolean:function(t,e,i){return void 0===i&&(i=this.currentShader),i.setBoolean(t,e),this},set1f:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set1f(t,e),this},set2f:function(t,e,i,s){return void 0===s&&(s=this.currentShader),s.set2f(t,e,i),this},set3f:function(t,e,i,s,n){return void 0===n&&(n=this.currentShader),n.set3f(t,e,i,s),this},set4f:function(t,e,i,s,n,r){return void 0===r&&(r=this.currentShader),r.set4f(t,e,i,s,n),this},set1fv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set1fv(t,e),this},set2fv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set2fv(t,e),this},set3fv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set3fv(t,e),this},set4fv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set4fv(t,e),this},set1iv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set1iv(t,e),this},set2iv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set2iv(t,e),this},set3iv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set3iv(t,e),this},set4iv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set4iv(t,e),this},set1i:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set1i(t,e),this},set2i:function(t,e,i,s){return void 0===s&&(s=this.currentShader),s.set2i(t,e,i),this},set3i:function(t,e,i,s,n){return void 0===n&&(n=this.currentShader),n.set3i(t,e,i,s),this},set4i:function(t,e,i,s,n,r){return void 0===r&&(r=this.currentShader),r.set4i(t,e,i,s,n),this},setMatrix2fv:function(t,e,i,s){return void 0===s&&(s=this.currentShader),s.setMatrix2fv(t,e,i),this},setMatrix3fv:function(t,e,i,s){return void 0===s&&(s=this.currentShader),s.setMatrix3fv(t,e,i),this},setMatrix4fv:function(t,e,i,s){return void 0===s&&(s=this.currentShader),s.setMatrix4fv(t,e,i),this},destroy:function(){var t;this.emit(o.DESTROY,this);var e=this.shaders;for(t=0;t{var s=i(66458),n=i(89787),r=i(56694),o=i(86459),a=i(6659),h=i(81044),l=i(97081),u=i(28621),c=i(16650),d=i(72283),p=i(35217),f=i(37410),v=i(40444),g=i(38203),m=i(75512),y=i(1217),x=new r({Extends:a,initialize:function(t){a.call(this);var e=t.config,i={alpha:e.transparent,desynchronized:e.desynchronized,depth:!1,antialias:e.antialiasGL,premultipliedAlpha:e.premultipliedAlpha,stencil:!0,failIfMajorPerformanceCaveat:e.failIfMajorPerformanceCaveat,powerPreference:e.powerPreference,preserveDrawingBuffer:e.preserveDrawingBuffer,willReadFrequently:!1};this.config={clearBeforeRender:e.clearBeforeRender,antialias:e.antialias,backgroundColor:e.backgroundColor,contextCreation:i,roundPixels:e.roundPixels,maxTextures:e.maxTextures,maxTextureSize:e.maxTextureSize,batchSize:e.batchSize,maxLights:e.maxLights,mipmapFilter:e.mipmapFilter},this.game=t,this.type=o.WEBGL,this.pipelines=null,this.width=0,this.height=0,this.canvas=t.canvas,this.blendModes=[],this.contextLost=!1,this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92,isFramebuffer:!1,bufferWidth:0,bufferHeight:0},this.currentActiveTexture=0,this.startActiveTexture=0,this.maxTextures=0,this.textureIndexes,this.tempTextures,this.textureZero,this.normalTexture,this.currentFramebuffer=null,this.fboStack=[],this.currentProgram=null,this.currentBlendMode=1/0,this.currentScissorEnabled=!1,this.currentScissor=null,this.scissorStack=[],this.contextLostHandler=d,this.contextRestoredHandler=d,this.gl=null,this.supportedExtensions=null,this.instancedArraysExtension=null,this.vaoExtension=null,this.extensions={},this.glFormats=[],this.compression,this.drawingBufferHeight=0,this.blankTexture=null,this.whiteTexture=null,this.maskCount=0,this.maskStack=[],this.currentMask={mask:null,camera:null},this.currentCameraMask={mask:null,camera:null},this.glFuncMap=null,this.currentType="",this.newType=!1,this.nextTypeMatch=!1,this.finalType=!1,this.mipmapFilter=null,this.textureFlush=0,this.isTextureClean=!1,this.defaultScissor=[0,0,0,0],this.isBooted=!1,this.renderTarget=null,this.projectionMatrix,this.projectionWidth=0,this.projectionHeight=0,this.init(this.config)},init:function(t){var e,i=this.game,s=this.canvas,n=t.backgroundColor;if(!(e=i.config.context?i.config.context:s.getContext("webgl",t.contextCreation)||s.getContext("experimental-webgl",t.contextCreation))||e.isContextLost())throw this.contextLost=!0,new Error("WebGL unsupported");this.gl=e;var r=this;this.contextLostHandler=function(t){r.contextLost=!0,r.game.events.emit(l.CONTEXT_LOST,r),t.preventDefault()},this.contextRestoredHandler=function(){r.contextLost=!1,r.init(r.config),r.game.events.emit(l.CONTEXT_RESTORED,r)},s.addEventListener("webglcontextlost",this.contextLostHandler,!1),s.addEventListener("webglcontextrestored",this.contextRestoredHandler,!1),i.context=e;for(var a=0;a<=27;a++)this.blendModes.push({func:[e.ONE,e.ONE_MINUS_SRC_ALPHA],equation:e.FUNC_ADD});this.blendModes[1].func=[e.ONE,e.DST_ALPHA],this.blendModes[2].func=[e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA],this.blendModes[3].func=[e.ONE,e.ONE_MINUS_SRC_COLOR],this.blendModes[17]={func:[e.ZERO,e.ONE_MINUS_SRC_ALPHA],equation:e.FUNC_REVERSE_SUBTRACT},this.glFormats[0]=e.BYTE,this.glFormats[1]=e.SHORT,this.glFormats[2]=e.UNSIGNED_BYTE,this.glFormats[3]=e.UNSIGNED_SHORT,this.glFormats[4]=e.FLOAT,this.glFuncMap={mat2:{func:e.uniformMatrix2fv,length:1,matrix:!0},mat3:{func:e.uniformMatrix3fv,length:1,matrix:!0},mat4:{func:e.uniformMatrix4fv,length:1,matrix:!0},"1f":{func:e.uniform1f,length:1},"1fv":{func:e.uniform1fv,length:1},"1i":{func:e.uniform1i,length:1},"1iv":{func:e.uniform1iv,length:1},"2f":{func:e.uniform2f,length:2},"2fv":{func:e.uniform2fv,length:1},"2i":{func:e.uniform2i,length:2},"2iv":{func:e.uniform2iv,length:1},"3f":{func:e.uniform3f,length:3},"3fv":{func:e.uniform3fv,length:1},"3i":{func:e.uniform3i,length:3},"3iv":{func:e.uniform3iv,length:1},"4f":{func:e.uniform4f,length:4},"4fv":{func:e.uniform4fv,length:1},"4i":{func:e.uniform4i,length:4},"4iv":{func:e.uniform4iv,length:1}};var h=e.getSupportedExtensions();t.maxTextures&&-1!==t.maxTextures||(t.maxTextures=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),t.maxTextureSize||(t.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE)),this.compression=this.getCompressedTextures(),this.supportedExtensions=h;var u="ANGLE_instanced_arrays";this.instancedArraysExtension=h.indexOf(u)>-1?e.getExtension(u):null;var d="OES_vertex_array_object";this.vaoExtension=h.indexOf(d)>-1?e.getExtension(d):null,e.disable(e.DEPTH_TEST),e.disable(e.CULL_FACE),e.enable(e.BLEND),e.clearColor(n.redGL,n.greenGL,n.blueGL,n.alphaGL),this.mipmapFilter=e[t.mipmapFilter],this.maxTextures=m.checkShaderMax(e,t.maxTextures),this.textureIndexes=[];var f=this.tempTextures;if(Array.isArray(f))for(var v=0;a0&&s>0;if(o&&a){var h=o[0],l=o[1],u=o[2],c=o[3];a=h!==t||l!==e||u!==i||c!==s}a&&(this.flush(),r.scissor(t,n-e-s,i,s))},resetScissor:function(){var t=this.gl;t.enable(t.SCISSOR_TEST);var e=this.currentScissor;if(e){var i=e[0],s=e[1],n=e[2],r=e[3];n>0&&r>0&&t.scissor(i,this.drawingBufferHeight-s-r,n,r)}},popScissor:function(){var t=this.scissorStack;t.pop();var e=t[t.length-1];e&&this.setScissor(e[0],e[1],e[2],e[3]),this.currentScissor=e},hasActiveStencilMask:function(){var t=this.currentMask.mask,e=this.currentCameraMask.mask;return t&&t.isStencil||e&&e.isStencil},resetViewport:function(){var t=this.gl;t.viewport(0,0,this.width,this.height),this.drawingBufferHeight=t.drawingBufferHeight},setBlendMode:function(t,e){void 0===e&&(e=!1);var i=this.gl,s=this.blendModes[t];return!!(e||t!==o.BlendModes.SKIP_CHECK&&this.currentBlendMode!==t)&&(this.flush(),i.enable(i.BLEND),i.blendEquation(s.equation),s.func.length>2?i.blendFuncSeparate(s.func[0],s.func[1],s.func[2],s.func[3]):i.blendFunc(s.func[0],s.func[1]),this.currentBlendMode=t,!0)},addBlendMode:function(t,e){return this.blendModes.push({func:t,equation:e})-1},updateBlendMode:function(t,e,i){return this.blendModes[t]&&(this.blendModes[t].func=e,i&&(this.blendModes[t].equation=i)),this},removeBlendMode:function(t){return t>17&&this.blendModes[t]&&this.blendModes.splice(t,1),this},setBlankTexture:function(){this.setTexture2D(this.blankTexture.glTexture)},setTextureSource:function(t){if(this.pipelines.forceZero())return this.setTextureZero(t.glTexture,!0),0;var e=this.gl,i=this.currentActiveTexture;return t.glIndexCounter0)&&this.pipelines.setMulti().drawFillRect(e,i,s,r,m.getTintFromFloats(o.blueGL,o.greenGL,o.redGL,1),o.alphaGL)},getCurrentStencilMask:function(){var t=null,e=this.maskStack,i=this.currentCameraMask;return e.length>0?t=e[e.length-1]:i.mask&&i.mask.isStencil&&(t=i),t},postRenderCamera:function(t){var e=t.flashEffect,i=t.fadeEffect;if(e.isRunning||i.isRunning||i.isComplete){var s=this.pipelines.setMulti();e.postRenderWebGL(s,m.getTintFromFloats),i.postRenderWebGL(s,m.getTintFromFloats)}t.dirty=!1,this.popScissor(),t.mask&&(this.currentCameraMask.mask=null,t.mask.postRenderWebGL(this,t._maskCamera)),this.pipelines.postBatchCamera(t),t.emit(n.POST_RENDER,t)},preRender:function(){if(!this.contextLost){var t=this.gl;if(t.bindFramebuffer(t.FRAMEBUFFER,null),this.config.clearBeforeRender){var e=this.config.backgroundColor;t.clearColor(e.redGL,e.greenGL,e.blueGL,e.alphaGL),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT|t.STENCIL_BUFFER_BIT)}t.enable(t.SCISSOR_TEST),this.currentScissor=this.defaultScissor,this.scissorStack.length=0,this.scissorStack.push(this.currentScissor),this.game.scene.customViewports&&t.scissor(0,this.drawingBufferHeight-this.height,this.width,this.height),this.currentMask.mask=null,this.currentCameraMask.mask=null,this.maskStack.length=0,this.textureFlush=0,this.emit(h.PRE_RENDER)}},render:function(t,e,i){if(!this.contextLost){var s=e.length;if(this.emit(h.RENDER,t,i),this.preRenderCamera(i),0===s)return this.setBlendMode(o.BlendModes.NORMAL),void this.postRenderCamera(i);this.currentType="";for(var n=this.currentMask,r=0;r0&&(this.startActiveTexture++,this.currentActiveTexture=1)}},snapshot:function(t,e,i){return this.snapshotArea(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight,t,e,i)},snapshotArea:function(t,e,i,s,n,r,o){var a=this.snapshotState;return a.callback=n,a.type=r,a.encoder=o,a.getPixel=!1,a.x=t,a.y=e,a.width=Math.min(i,this.gl.drawingBufferWidth),a.height=Math.min(s,this.gl.drawingBufferHeight),this},snapshotPixel:function(t,e,i){return this.snapshotArea(t,e,1,1,i),this.snapshotState.getPixel=!0,this},snapshotFramebuffer:function(t,e,i,s,n,r,o,a,h,l,u){void 0===n&&(n=!1),void 0===r&&(r=0),void 0===o&&(o=0),void 0===a&&(a=e),void 0===h&&(h=i);var c=this.currentFramebuffer;this.snapshotArea(r,o,a,h,s,l,u);var d=this.snapshotState;return d.getPixel=n,d.isFramebuffer=!0,d.bufferWidth=e,d.bufferHeight=i,this.setFramebuffer(t),y(this.gl,d),this.setFramebuffer(c),d.callback=null,d.isFramebuffer=!1,this},canvasToTexture:function(t,e,i,s){return void 0===i&&(i=!1),void 0===s&&(s=!1),e?this.updateCanvasTexture(t,e,s):this.createCanvasTexture(t,i,s)},createCanvasTexture:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var s=this.gl,n=s.NEAREST,r=s.NEAREST,o=t.width,a=t.height,h=s.CLAMP_TO_EDGE,l=u(o,a);return!e&&l&&(h=s.REPEAT),this.config.antialias&&(n=l?this.mipmapFilter:s.LINEAR,r=s.LINEAR),this.createTexture2D(0,n,r,h,h,s.RGBA,t,o,a,!0,!1,i)},updateCanvasTexture:function(t,e,i){void 0===i&&(i=!1);var s=this.gl,n=t.width,r=t.height;if(n>0&&r>0){s.activeTexture(s.TEXTURE0);var o=s.getParameter(s.TEXTURE_BINDING_2D);s.bindTexture(s.TEXTURE_2D,e),i&&s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!0),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,s.RGBA,s.UNSIGNED_BYTE,t),e.width=n,e.height=r,o&&s.bindTexture(s.TEXTURE_2D,o)}return e},createVideoTexture:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var s=this.gl,n=s.NEAREST,r=s.NEAREST,o=t.videoWidth,a=t.videoHeight,h=s.CLAMP_TO_EDGE,l=u(o,a);return!e&&l&&(h=s.REPEAT),this.config.antialias&&(n=l?this.mipmapFilter:s.LINEAR,r=s.LINEAR),this.createTexture2D(0,n,r,h,h,s.RGBA,t,o,a,!0,!0,i)},updateVideoTexture:function(t,e,i){void 0===i&&(i=!1);var s=this.gl,n=t.videoWidth,r=t.videoHeight;if(n>0&&r>0){s.activeTexture(s.TEXTURE0);var o=s.getParameter(s.TEXTURE_BINDING_2D);s.bindTexture(s.TEXTURE_2D,e),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,i),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,s.RGBA,s.UNSIGNED_BYTE,t),e.width=n,e.height=r,o&&s.bindTexture(s.TEXTURE_2D,o)}return e},setTextureFilter:function(t,e){var i=this.gl,s=[i.LINEAR,i.NEAREST][e];i.activeTexture(i.TEXTURE0);var n=i.getParameter(i.TEXTURE_BINDING_2D);return i.bindTexture(i.TEXTURE_2D,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,s),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,s),n&&i.bindTexture(i.TEXTURE_2D,n),this},getMaxTextureSize:function(){return this.config.maxTextureSize},destroy:function(){this.canvas.removeEventListener("webglcontextlost",this.contextLostHandler,!1),this.canvas.removeEventListener("webglcontextrestored",this.contextRestoredHandler,!1);for(var t=this.gl,e=this.tempTextures,i=0;i{var s=i(56694),n=i(72632),r=i(71402),o=new s({initialize:function(t,e,i,s,n){this.pipeline=t,this.name=e,this.renderer=t.renderer,this.gl=this.renderer.gl,this.fragSrc=s,this.vertSrc=i,this.program=this.renderer.createProgram(i,s),this.attributes,this.vertexComponentCount=0,this.vertexSize=0,this.uniforms={},this.createAttributes(n),this.createUniforms()},createAttributes:function(t){var e=0,i=0,s=[];this.vertexComponentCount=0;for(var o=0;o=0?(e.enableVertexAttribArray(p),e.vertexAttribPointer(p,a,h,d,i,l),o.enabled=!0,o.location=p):-1!==p&&e.disableVertexAttribArray(p)}else u?e.vertexAttribPointer(c,a,h,d,i,l):!u&&c>-1&&(e.disableVertexAttribArray(c),o.location=-1)}return this},createUniforms:function(){var t,e,i,s=this.gl,n=this.program,r=this.uniforms,o=s.getProgramParameter(n,s.ACTIVE_UNIFORMS);for(t=0;t0&&(e=e.substr(0,h),r.hasOwnProperty(e)||null!==(i=s.getUniformLocation(n,e))&&(r[e]={name:e,location:i,value1:null,value2:null,value3:null,value4:null}))}}return this},hasUniform:function(t){return this.uniforms.hasOwnProperty(t)},resetUniform:function(t){var e=this.uniforms[t];return e&&(e.value1=null,e.value2=null,e.value3=null,e.value4=null),this},setUniform1:function(t,e,i,s){var n=this.uniforms[e];return n?((s||n.value1!==i)&&(n.value1=i,this.renderer.setProgram(this.program),t.call(this.gl,n.location,i),this.pipeline.currentShader=this),this):this},setUniform2:function(t,e,i,s,n){var r=this.uniforms[e];return r?((n||r.value1!==i||r.value2!==s)&&(r.value1=i,r.value2=s,this.renderer.setProgram(this.program),t.call(this.gl,r.location,i,s),this.pipeline.currentShader=this),this):this},setUniform3:function(t,e,i,s,n,r){var o=this.uniforms[e];return o?((r||o.value1!==i||o.value2!==s||o.value3!==n)&&(o.value1=i,o.value2=s,o.value3=n,this.renderer.setProgram(this.program),t.call(this.gl,o.location,i,s,n),this.pipeline.currentShader=this),this):this},setUniform4:function(t,e,i,s,n,r,o){var a=this.uniforms[e];return a?((o||a.value1!==i||a.value2!==s||a.value3!==n||a.value4!==r)&&(a.value1=i,a.value2=s,a.value3=n,a.value4=r,this.renderer.setProgram(this.program),t.call(this.gl,a.location,i,s,n,r),this.pipeline.currentShader=this),this):this},setBoolean:function(t,e){return this.setUniform1(this.gl.uniform1i,t,Number(e))},set1f:function(t,e){return this.setUniform1(this.gl.uniform1f,t,e)},set2f:function(t,e,i){return this.setUniform2(this.gl.uniform2f,t,e,i)},set3f:function(t,e,i,s){return this.setUniform3(this.gl.uniform3f,t,e,i,s)},set4f:function(t,e,i,s,n){return this.setUniform4(this.gl.uniform4f,t,e,i,s,n)},set1fv:function(t,e){return this.setUniform1(this.gl.uniform1fv,t,e,!0)},set2fv:function(t,e){return this.setUniform1(this.gl.uniform2fv,t,e,!0)},set3fv:function(t,e){return this.setUniform1(this.gl.uniform3fv,t,e,!0)},set4fv:function(t,e){return this.setUniform1(this.gl.uniform4fv,t,e,!0)},set1iv:function(t,e){return this.setUniform1(this.gl.uniform1iv,t,e,!0)},set2iv:function(t,e){return this.setUniform1(this.gl.uniform2iv,t,e,!0)},set3iv:function(t,e){return this.setUniform1(this.gl.uniform3iv,t,e,!0)},set4iv:function(t,e){return this.setUniform1(this.gl.uniform4iv,t,e,!0)},set1i:function(t,e){return this.setUniform1(this.gl.uniform1i,t,e)},set2i:function(t,e,i){return this.setUniform2(this.gl.uniform2i,t,e,i)},set3i:function(t,e,i,s){return this.setUniform3(this.gl.uniform3i,t,e,i,s)},set4i:function(t,e,i,s,n){return this.setUniform4(this.gl.uniform4i,t,e,i,s,n)},setMatrix2fv:function(t,e,i){return this.setUniform2(this.gl.uniformMatrix2fv,t,e,i,!0)},setMatrix3fv:function(t,e,i){return this.setUniform2(this.gl.uniformMatrix3fv,t,e,i,!0)},setMatrix4fv:function(t,e,i){return this.setUniform2(this.gl.uniformMatrix4fv,t,e,i,!0)},createProgram:function(t,e){void 0===t&&(t=this.vertSrc),void 0===e&&(e=this.fragSrc);var i=this.gl;return this.program&&i.deleteProgram(this.program),this.vertSrc=t,this.fragSrc=e,this.program=this.renderer.createProgram(t,e),this.createUniforms(),this.rebind()},destroy:function(){this.gl.deleteProgram(this.program),this.pipeline=null,this.renderer=null,this.gl=null,this.program=null,this.attributes=null,this.uniforms=null}});t.exports=o},71402:t=>{t.exports={BYTE:{enum:5120,size:1},UNSIGNED_BYTE:{enum:5121,size:1},SHORT:{enum:5122,size:2},UNSIGNED_SHORT:{enum:5123,size:2},INT:{enum:5124,size:4},UNSIGNED_INT:{enum:5125,size:4},FLOAT:{enum:5126,size:4}}},55478:(t,e,i)=>{var s=i(71402),n=i(98611),r={PipelineManager:i(35217),Pipelines:i(62253),RenderTarget:i(37410),Utils:i(75512),WebGLPipeline:i(44775),WebGLRenderer:i(11857),WebGLShader:i(71305)};r=n(!1,r,s),t.exports=r},5583:(t,e,i)=>{var s=i(56694),n=i(72632),r=i(91679),o=i(89053),a=i(71402),h=i(44775),l=new s({Extends:h,initialize:function(t){t.fragShader=n(t,"fragShader",r),t.vertShader=n(t,"vertShader",o),t.batchSize=n(t,"batchSize",1),t.vertices=n(t,"vertices",[-1,1,-1,-7,7,1]),t.attributes=n(t,"attributes",[{name:"inPosition",size:2,type:a.FLOAT}]),h.call(this,t)},boot:function(){h.prototype.boot.call(this),this.set1i("uMainSampler",0),this.set1i("uMaskSampler",1)},resize:function(t,e){h.prototype.resize.call(this,t,e),this.set2f("uResolution",t,e)},beginMask:function(t,e,i){var s=this.gl;if(t.bitmapMask&&s){var n=this.renderer;n.flush(),n.pushFramebuffer(t.mainFramebuffer),s.disable(s.STENCIL_TEST),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT),n.currentCameraMask.mask!==t&&(n.currentMask.mask=t,n.currentMask.camera=i)}},endMask:function(t,e){var i=this.gl,s=this.renderer,n=t.bitmapMask;if(n&&i){s.flush(),s.pushFramebuffer(t.maskFramebuffer),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),s.setBlendMode(0,!0),n.renderWebGL(s,n,e),s.flush(),s.popFramebuffer(),s.popFramebuffer();var r=s.getCurrentStencilMask();r?(i.enable(i.STENCIL_TEST),r.mask.applyStencil(s,r.camera,!0)):s.currentMask.mask=null,s.pipelines.set(this),i.activeTexture(i.TEXTURE1),i.bindTexture(i.TEXTURE_2D,t.maskTexture),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,t.mainTexture),this.set1i("uInvertMaskAlpha",t.invertAlpha),i.drawArrays(this.topology,0,3),s.resetTextures()}}});t.exports=l},66901:(t,e,i)=>{var s=i(56694),n=i(72632),r=i(65045),o=i(77310),a=i(93736),h=i(44775),l=10,u=new a,c=new s({Extends:o,initialize:function(t){l=t.game.renderer.config.maxLights;for(var e=n(t,"fragShader",r),i=[],s=1;s<=l;s++)i.push({name:"lights"+s,fragShader:e.replace("%LIGHT_COUNT%",s.toString())});t.shaders=i,o.call(this,t),this.inverseRotationMatrix=new Float32Array([1,0,0,0,1,0,0,0,1]),this.defaultNormalMap,this.lightsActive=!0},boot:function(){h.prototype.boot.call(this);var t=this.gl,e=t.createTexture();t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,e),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array([127,127,255,255])),this.defaultNormalMap={glTexture:e};for(var i=0;i0&&this.flush();var e=this.inverseRotationMatrix;if(t){var i=-t,s=Math.cos(i),n=Math.sin(i);e[1]=n,e[3]=-n,e[0]=e[4]=s}else e[0]=e[4]=1,e[1]=e[3]=0;this.setMatrix3fv("uInverseRotationMatrix",!1,e),this.currentNormalMapRotation=t}},setTexture2D:function(t,e){var i=this.renderer;void 0===t&&(t=i.tempTextures[0]);var s=this.getNormalMap(e);i.isNewNormalMap(t,s)&&(this.flush(),i.setTextureZero(t),i.setNormalMap(s));var n=e?e.rotation:0;return this.setNormalMapRotation(n),this.currentUnit=0,0},setGameObject:function(t,e){void 0===e&&(e=t.frame);var i=this.renderer,s=e.glTexture,n=this.getNormalMap(t);return i.isNewNormalMap()&&(this.flush(),i.setTextureZero(s),i.setNormalMap(n)),this.setNormalMapRotation(t.rotation),this.currentUnit=0,0},getNormalMap:function(t){var e;return t?t.displayTexture?e=t.displayTexture.dataSource[t.displayFrame.sourceIndex]:t.texture?e=t.texture.dataSource[t.frame.sourceIndex]:t.tileset&&(e=Array.isArray(t.tileset)?t.tileset[0].image.dataSource[0]:t.tileset.image.dataSource[0]):e=this.defaultNormalMap,e||(e=this.defaultNormalMap),e.glTexture},batchSprite:function(t,e,i){this.lightsActive&&o.prototype.batchSprite.call(this,t,e,i)},batchTexture:function(t,e,i,s,n,r,a,h,l,u,c,d,p,f,v,g,m,y,x,T,w,b,E,S,A,_,C,R,M,P,O,L){this.lightsActive&&o.prototype.batchTexture.call(this,t,e,i,s,n,r,a,h,l,u,c,d,p,f,v,g,m,y,x,T,w,b,E,S,A,_,C,R,M,P,O,L)},batchTextureFrame:function(t,e,i,s,n,r,a){this.lightsActive&&o.prototype.batchTextureFrame.call(this,t,e,i,s,n,r,a)}});c.LIGHT_COUNT=l,t.exports=c},77310:(t,e,i)=>{var s=i(56694),n=i(11117),r=i(72632),o=i(53787),a=i(15968),h=i(69360),l=i(75512),u=i(71402),c=i(44775),d=new s({Extends:c,initialize:function(t){var e=t.game.renderer,i=r(t,"fragShader",o);t.fragShader=l.parseFragmentShaderMaxTextures(i,e.maxTextures),t.vertShader=r(t,"vertShader",a),t.attributes=r(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexId"},{name:"inTintEffect"},{name:"inTint",size:4,type:u.UNSIGNED_BYTE,normalized:!0}]),c.call(this,t),this._tempMatrix1=new h,this._tempMatrix2=new h,this._tempMatrix3=new h,this.calcMatrix=new h,this.tempTriangle=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}],this.strokeTint={TL:0,TR:0,BL:0,BR:0},this.fillTint={TL:0,TR:0,BL:0,BR:0},this.currentFrame={u0:0,v0:0,u1:1,v1:1},this.firstQuad=[0,0,0,0,0],this.prevQuad=[0,0,0,0,0],this.polygonCache=[]},boot:function(){c.prototype.boot.call(this),this.currentShader.set1iv("uMainSampler",this.renderer.textureIndexes)},batchSprite:function(t,e,i){this.manager.set(this,t);var s=this._tempMatrix1,n=this._tempMatrix2,r=this._tempMatrix3,o=t.frame,a=o.glTexture,h=o.u0,u=o.v0,c=o.u1,d=o.v1,p=o.x,f=o.y,v=o.cutWidth,g=o.cutHeight,m=o.customPivot,y=t.displayOriginX,x=t.displayOriginY,T=-y+p,w=-x+f;if(t.isCropped){var b=t._crop;b.flipX===t.flipX&&b.flipY===t.flipY||o.updateCropUVs(b,t.flipX,t.flipY),h=b.u0,u=b.v0,c=b.u1,d=b.v1,v=b.width,g=b.height,T=-y+(p=b.x),w=-x+(f=b.y)}var E=1,S=1;t.flipX&&(m||(T+=-o.realWidth+2*y),E=-1),(t.flipY||o.source.isGLTexture&&!a.flipY)&&(m||(w+=-o.realHeight+2*x),S=-1),n.applyITRS(t.x,t.y,t.rotation,t.scaleX*E,t.scaleY*S),s.copyFrom(e.matrix),i?(s.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),n.e=t.x,n.f=t.y):(n.e-=e.scrollX*t.scrollFactorX,n.f-=e.scrollY*t.scrollFactorY),s.multiply(n,r);var A=T+v,_=w+g,C=e.roundPixels,R=r.getXRound(T,w,C),M=r.getXRound(T,_,C),P=r.getXRound(A,_,C),O=r.getXRound(A,w,C),L=r.getYRound(T,w,C),F=r.getYRound(T,_,C),D=r.getYRound(A,_,C),k=r.getYRound(A,w,C),I=l.getTintAppendFloatAlpha,B=e.alpha,N=I(t.tintTopLeft,B*t._alphaTL),Y=I(t.tintTopRight,B*t._alphaTR),U=I(t.tintBottomLeft,B*t._alphaBL),X=I(t.tintBottomRight,B*t._alphaBR);this.shouldFlush(6)&&this.flush();var z=this.setGameObject(t,o);this.manager.preBatch(t),this.batchQuad(t,R,L,M,F,P,D,O,k,h,u,c,d,N,Y,U,X,t.tintFill,a,z),this.manager.postBatch(t)},batchTexture:function(t,e,i,s,n,r,o,a,h,l,u,c,d,p,f,v,g,m,y,x,T,w,b,E,S,A,_,C,R,M,P,O){this.manager.set(this,t);var L=this._tempMatrix1,F=this._tempMatrix2,D=this._tempMatrix3,k=m/i+_,I=y/s+C,B=(m+x)/i+_,N=(y+T)/s+C,Y=o,U=a,X=-v,z=-g;if(t.isCropped){var G=t._crop,W=G.width,V=G.height;Y=W,U=V,o=W,a=V;var H=m=G.x,j=y=G.y;c&&(H=x-G.x-W),d&&(j=T-G.y-V),k=H/i+_,I=j/s+C,B=(H+W)/i+_,N=(j+V)/s+C,X=-v+m,z=-g+y}c&&(Y*=-1,X+=o),(d^=!P&&e.isRenderTexture?1:0)&&(U*=-1,z+=a);var K=X+Y,q=z+U;F.applyITRS(n,r,u,h,l),L.copyFrom(R.matrix),M?(L.multiplyWithOffset(M,-R.scrollX*p,-R.scrollY*f),F.e=n,F.f=r):(F.e-=R.scrollX*p,F.f-=R.scrollY*f),L.multiply(F,D);var Z=R.roundPixels,J=D.getXRound(X,z,Z),Q=D.getYRound(X,z,Z),$=D.getXRound(X,q,Z),tt=D.getYRound(X,q,Z),et=D.getXRound(K,q,Z),it=D.getYRound(K,q,Z),st=D.getXRound(K,z,Z),nt=D.getYRound(K,z,Z);void 0===O&&(O=this.renderer.setTexture2D(e)),t&&this.manager.preBatch(t),this.batchQuad(t,J,Q,$,tt,et,it,st,nt,k,I,B,N,w,b,E,S,A,e,O),t&&this.manager.postBatch(t)},batchTextureFrame:function(t,e,i,s,n,r,o){this.manager.set(this);var a=this._tempMatrix1.copyFrom(r),h=this._tempMatrix2,u=e+t.width,c=i+t.height;o?a.multiply(o,h):h=a;var d=h.getX(e,i),p=h.getY(e,i),f=h.getX(e,c),v=h.getY(e,c),g=h.getX(u,c),m=h.getY(u,c),y=h.getX(u,i),x=h.getY(u,i),T=this.renderer.setTextureSource(t.source);s=l.getTintAppendFloatAlpha(s,n),this.batchQuad(null,d,p,f,v,g,m,y,x,t.u0,t.v0,t.u1,t.v1,s,s,s,s,0,t.glTexture,T)},batchFillRect:function(t,e,i,s,n,r){this.renderer.pipelines.set(this);var o=this.calcMatrix;r&&r.multiply(n,o);var a=t+i,h=e+s,l=o.getX(t,e),u=o.getY(t,e),c=o.getX(t,h),d=o.getY(t,h),p=o.getX(a,h),f=o.getY(a,h),v=o.getX(a,e),g=o.getY(a,e),m=this.fillTint;this.batchQuad(null,l,u,c,d,p,f,v,g,0,0,1,1,m.TL,m.TR,m.BL,m.BR,2)},batchFillTriangle:function(t,e,i,s,n,r,o,a){this.renderer.pipelines.set(this);var h=this.calcMatrix;a&&a.multiply(o,h);var l=h.getX(t,e),u=h.getY(t,e),c=h.getX(i,s),d=h.getY(i,s),p=h.getX(n,r),f=h.getY(n,r),v=this.fillTint;this.batchTri(null,l,u,c,d,p,f,0,0,1,1,v.TL,v.TR,v.BL,2)},batchStrokeTriangle:function(t,e,i,s,n,r,o,a,h){var l=this.tempTriangle;l[0].x=t,l[0].y=e,l[0].width=o,l[1].x=i,l[1].y=s,l[1].width=o,l[2].x=n,l[2].y=r,l[2].width=o,l[3].x=t,l[3].y=e,l[3].width=o,this.batchStrokePath(l,o,!1,a,h)},batchFillPath:function(t,e,i){this.renderer.pipelines.set(this);var s=this.calcMatrix;i&&i.multiply(e,s);for(var r,o,a=t.length,h=this.polygonCache,l=this.fillTint.TL,u=this.fillTint.TR,c=this.fillTint.BL,d=0;d0&&U[4]?this.batchQuad(null,F,D,M,P,U[0],U[1],U[2],U[3],0,0,1,1,I,B,N,Y,2):(X[0]=F,X[1]=D,X[2]=M,X[3]=P,X[4]=1),h&&X[4]?this.batchQuad(null,C,R,O,L,X[0],X[1],X[2],X[3],0,0,1,1,I,B,N,Y,2):(U[0]=C,U[1]=R,U[2]=O,U[3]=L,U[4]=1)}}});t.exports=d},10919:(t,e,i)=>{var s=i(56694),n=i(72632),r=i(83327),o=i(54677),a=i(44775),h=new s({Extends:a,initialize:function(t){t.vertShader=n(t,"vertShader",o),t.fragShader=n(t,"fragShader",r),t.attributes=n(t,"attributes",[{name:"inPosition",size:2},{name:"inLightPosition",size:2},{name:"inLightRadius"},{name:"inLightAttenuation"},{name:"inLightColor",size:4}]),a.call(this,t)},onRender:function(t,e){this.set2f("uResolution",this.width,this.height),this.set1f("uCameraZoom",e.zoom)},batchPointLight:function(t,e,i,s,n,r,o,a,h,l,u,c){var d=t.color,p=t.intensity,f=t.radius,v=t.attenuation,g=d.r*p,m=d.g*p,y=d.b*p,x=e.alpha*t.alpha;this.shouldFlush(6)&&this.flush(),this.batchLightVert(i,s,u,c,f,v,g,m,y,x),this.batchLightVert(n,r,u,c,f,v,g,m,y,x),this.batchLightVert(o,a,u,c,f,v,g,m,y,x),this.batchLightVert(i,s,u,c,f,v,g,m,y,x),this.batchLightVert(o,a,u,c,f,v,g,m,y,x),this.batchLightVert(h,l,u,c,f,v,g,m,y,x)},batchLightVert:function(t,e,i,s,n,r,o,a,h,l){var u=this.vertexViewF32,c=this.vertexCount*this.currentShader.vertexComponentCount-1;u[++c]=t,u[++c]=e,u[++c]=i,u[++c]=s,u[++c]=n,u[++c]=r,u[++c]=o,u[++c]=a,u[++c]=h,u[++c]=l,this.vertexCount++}});t.exports=h},80486:(t,e,i)=>{var s=i(56694),n=i(65246),r=i(72632),o=i(12569),a=i(99365),h=i(44775),l=new s({Extends:h,initialize:function(t){t.renderTarget=r(t,"renderTarget",1),t.fragShader=r(t,"fragShader",o),t.vertShader=r(t,"vertShader",a),t.attributes=r(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]),t.batchSize=1,t.vertices=[-1,-1,0,0,-1,1,0,1,1,1,1,1,-1,-1,0,0,1,1,1,1,1,-1,1,0],h.call(this,t),this.isPostFX=!0,this.gameObject,this.colorMatrix=new n,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2,this.renderer.isBooted&&(this.manager=this.renderer.pipelines,this.boot())},boot:function(){h.prototype.boot.call(this);var t=this.manager.UTILITY_PIPELINE;this.fullFrame1=t.fullFrame1,this.fullFrame2=t.fullFrame2,this.halfFrame1=t.halfFrame1,this.halfFrame2=t.halfFrame2,this.set1i("uMainSampler",0)},onDraw:function(t){this.bindAndDraw(t)},copyFrame:function(t,e,i,s,n){this.manager.copyFrame(t,e,i,s,n)},copyToGame:function(t){this.manager.copyToGame(t)},drawFrame:function(t,e,i){this.manager.drawFrame(t,e,i,this.colorMatrix)},blendFrames:function(t,e,i,s,n){this.manager.blendFrames(t,e,i,s,n)},blendFramesAdditive:function(t,e,i,s,n){this.manager.blendFramesAdditive(t,e,i,s,n)},clearFrame:function(t,e){this.manager.clearFrame(t,e)},blitFrame:function(t,e,i,s,n,r){this.manager.blitFrame(t,e,i,s,n,r)},copyFrameRect:function(t,e,i,s,n,r,o,a){this.manager.copyFrameRect(t,e,i,s,n,r,o,a)},bindAndDraw:function(t,e,i,s,n){void 0===i&&(i=!0),void 0===s&&(s=!0);var r=this.gl,o=this.renderer;this.bind(n),this.set1i("uMainSampler",0),e?(r.viewport(0,0,e.width,e.height),r.bindFramebuffer(r.FRAMEBUFFER,e.framebuffer),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e.texture,0),i&&(s?r.clearColor(0,0,0,0):r.clearColor(0,0,0,1),r.clear(r.COLOR_BUFFER_BIT))):(o.popFramebuffer(!1,!1,!1),o.currentFramebuffer||r.viewport(0,0,o.width,o.height)),r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,t.texture),r.bufferData(r.ARRAY_BUFFER,this.vertexData,r.STATIC_DRAW),r.drawArrays(r.TRIANGLES,0,6),e?(r.bindTexture(r.TEXTURE_2D,null),r.bindFramebuffer(r.FRAMEBUFFER,null)):o.resetTextures()}});t.exports=l},21213:(t,e,i)=>{var s=i(56694),n=i(72632),r=i(77310),o=new s({Extends:r,initialize:function(t){t.topology=5,t.batchSize=n(t,"batchSize",256),r.call(this,t)}});t.exports=o},51212:(t,e,i)=>{var s=i(56694),n=i(72632),r=i(77310),o=i(85060),a=i(18166),h=i(44775),l=new s({Extends:r,initialize:function(t){t.fragShader=n(t,"fragShader",o),t.vertShader=n(t,"vertShader",a),t.forceZero=!0,r.call(this,t)},boot:function(){h.prototype.boot.call(this),this.set1i("uMainSampler",0)}});t.exports=l},38964:(t,e,i)=>{var s=i(95723),n=i(79993),r=i(56694),o=i(72632),a=i(77310),h=i(12569),l=i(74118),u=i(37410),c=i(85060),d=i(18166),p=i(69360),f=i(71402),v=i(44775),g=new r({Extends:v,initialize:function(t){t.attributes=o(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexId"},{name:"inTintEffect"},{name:"inTint",size:4,type:f.UNSIGNED_BYTE,normalized:!0}]);var e=o(t,"fragShader",h),i=o(t,"vertShader",d),s=o(t,"drawShader",h),n=[{name:"DrawSprite",fragShader:c,vertShader:d},{name:"CopySprite",fragShader:e,vertShader:i},{name:"DrawGame",fragShader:s,vertShader:d}],r=o(t,"shaders",[]);t.shaders=n.concat(r),t.vertShader||(t.vertShader=i),t.batchSize=1,v.call(this,t),this.isSpriteFX=!0,this._tempMatrix1=new p,this._tempMatrix2=new p,this._tempMatrix3=new p,this.drawSpriteShader,this.copyShader,this.gameShader,this.quadVertexData,this.quadVertexBuffer,this.quadVertexViewF32,this.spriteBounds=new l,this.targetBounds=new l,this.fsTarget,this.tempSprite,this.renderer.isBooted&&(this.manager=this.renderer.pipelines,this.boot())},boot:function(){v.prototype.boot.call(this);var t=this.shaders,e=this.renderer;this.drawSpriteShader=t[0],this.copyShader=t[1],this.gameShader=t[2],this.fsTarget=new u(e,e.width,e.height,1,0,!0,!0),this.renderTargets=this.manager.renderTargets.concat(this.fsTarget);var i=new ArrayBuffer(168);this.quadVertexData=i,this.quadVertexViewF32=new Float32Array(i),this.quadVertexBuffer=e.createVertexBuffer(i,this.gl.STATIC_DRAW),this.onResize(e.width,e.height),this.currentShader=this.copyShader},onResize:function(t,e){var i=this.quadVertexViewF32;i[1]=e,i[22]=e,i[14]=t,i[28]=t,i[35]=t,i[36]=e},batchSprite:function(t,e,i){a.prototype.batchSprite.call(this,t,e,i)},batchTexture:function(t,e,i,s,n,r,o,h,l,u,c,d,p,f,v,g,m,y,x,T,w,b,E,S,A,_,C,R,M,P,O,L){a.prototype.batchTexture.call(this,t,e,i,s,n,r,o,h,l,u,c,d,p,f,v,g,m,y,x,T,w,b,E,S,A,_,C,R,M,P,O,L)},batchQuad:function(t,e,i,s,r,o,a,h,l,u,c,d,p,f,v,g,m,y,x){var T=Math.min(e,s,o,h),w=Math.min(i,r,a,l),b=Math.max(e,s,o,h)-T,E=Math.max(i,r,a,l)-w,S=this.spriteBounds.setTo(T,w,b,E),A=t.fxPadding,_=b+2*A,C=E+2*A,R=Math.abs(Math.max(_,C)),M=this.manager.getRenderTarget(R),P=this.targetBounds.setTo(0,0,M.width,M.height);n(P,S.centerX,S.centerY),this.tempSprite=t;var O=this.gl,L=this.renderer;this.setShader(this.drawSpriteShader),this.set1i("uMainSampler",0),this.flipProjectionMatrix(!0),this.onDrawSprite(t,M),t.onFX(this);var F=this.fsTarget;return L.setTextureZero(x),O.viewport(0,0,L.width,L.height),O.bindFramebuffer(O.FRAMEBUFFER,F.framebuffer),O.framebufferTexture2D(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_2D,F.texture,0),O.clearColor(0,0,0,0),O.clear(O.COLOR_BUFFER_BIT),this.batchVert(e,i,u,c,0,y,f),this.batchVert(s,r,u,p,0,y,g),this.batchVert(o,a,d,p,0,y,m),this.batchVert(e,i,u,c,0,y,f),this.batchVert(o,a,d,p,0,y,m),this.batchVert(h,l,d,c,0,y,v),this.flush(),this.flipProjectionMatrix(!1),L.clearTextureZero(),O.activeTexture(O.TEXTURE0),O.bindTexture(O.TEXTURE_2D,M.texture),O.copyTexSubImage2D(O.TEXTURE_2D,0,0,0,P.x,P.y,P.width,P.height),O.bindFramebuffer(O.FRAMEBUFFER,null),O.bindTexture(O.TEXTURE_2D,null),this.onBatch(t),this.currentShader=this.copyShader,this.onDraw(M,this.manager.getSwapRenderTarget(),this.manager.getAltSwapRenderTarget()),!0},onDrawSprite:function(){},onCopySprite:function(){},copySprite:function(t,e,i,n,r,o){void 0===i&&(i=!0),void 0===n&&(n=!0),void 0===r&&(r=!1),void 0===o&&(o=this.copyShader);var a=this.gl,h=this.tempSprite;this.currentShader=o;var l=this.setVertexBuffer(this.quadVertexBuffer);if(o.bind(l,!1),this.set1i("uMainSampler",0),h.onFXCopy(this),this.onCopySprite(t,e,h),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,t.texture),t.height>e.height)a.viewport(0,0,t.width,t.height),this.setTargetUVs(t,e);else{var u=e.height-t.height;a.viewport(0,u,t.width,t.height),this.resetUVs()}if(a.bindFramebuffer(a.FRAMEBUFFER,e.framebuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,e.texture,0),i&&(a.clearColor(0,0,0,Number(!n)),a.clear(a.COLOR_BUFFER_BIT)),r){var c=this.renderer.currentBlendMode;this.renderer.setBlendMode(s.ERASE)}a.bufferData(a.ARRAY_BUFFER,this.quadVertexData,a.STATIC_DRAW),a.drawArrays(a.TRIANGLES,0,6),r&&this.renderer.setBlendMode(c),a.bindFramebuffer(a.FRAMEBUFFER,null)},blendFrames:function(t,e,i,s,n){this.manager.blendFrames(t,e,i,s,n)},blendFramesAdditive:function(t,e,i,s,n){this.manager.blendFramesAdditive(t,e,i,s,n)},drawToGame:function(t){this.currentShader=null,this.setShader(this.copyShader),this.bindAndDraw(t)},copyToGame:function(t){this.currentShader=null,this.setShader(this.gameShader),this.bindAndDraw(t)},bindAndDraw:function(t){var e=this.gl,i=this.renderer;this.set1i("uMainSampler",0),i.popFramebuffer(!1,!1,!1),i.currentFramebuffer||e.viewport(0,0,i.width,i.height),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t.texture);var s=this._tempMatrix1.loadIdentity(),n=this.targetBounds.x,r=this.targetBounds.y,o=n+t.width,a=r+t.height,h=s.getX(n,r),l=s.getX(n,a),u=s.getX(o,a),c=s.getX(o,r),d=s.getY(n,r),p=s.getY(n,a),f=s.getY(o,a),v=s.getY(o,r);this.batchVert(h,d,0,0,0,0,16777215),this.batchVert(l,p,0,1,0,0,16777215),this.batchVert(u,f,1,1,0,0,16777215),this.batchVert(h,d,0,0,0,0,16777215),this.batchVert(u,f,1,1,0,0,16777215),this.batchVert(c,v,1,0,0,0,16777215),this.flush(),i.resetTextures(),this.tempSprite=null},onDraw:function(t){this.drawToGame(t)},setUVs:function(t,e,i,s,n,r,o,a){var h=this.quadVertexViewF32;h[2]=t,h[3]=e,h[9]=i,h[10]=s,h[16]=n,h[17]=r,h[23]=t,h[24]=e,h[30]=n,h[31]=r,h[37]=o,h[38]=a},setTargetUVs:function(t,e){var i=e.height/t.height;i=i>.5?.5-(i-.5):.5-i+.5,this.setUVs(0,i,0,1+i,1,1+i,1,i)},resetUVs:function(){this.setUVs(0,0,0,1,1,1,1,0)},destroy:function(){this.gl.deleteBuffer(this.quadVertexBuffer),this._tempMatrix1.destroy(),this._tempMatrix2.destroy(),this._tempMatrix3.destroy(),this._tempMatrix1=null,this._tempMatrix1=null,this._tempMatrix1=null,this.drawSpriteShader=null,this.copyShader=null,this.gameShader=null,this.quadVertexData=null,this.quadVertexBuffer=null,this.quadVertexViewF32=null,this.fsTarget=null,this.tempSprite=null,v.prototype.destroy.call(this)}});t.exports=g},60848:(t,e,i)=>{var s=i(2529),n=i(95723),r=i(56694),o=i(65246),a=i(37486),h=i(79060),l=i(72632),u=i(98921),c=i(99365),d=i(44775),p=new r({Extends:d,initialize:function(t){t.renderTarget=l(t,"renderTarget",[{scale:1},{scale:1},{scale:.5},{scale:.5}]),t.vertShader=l(t,"vertShader",c),t.shaders=l(t,"shaders",[{name:"Copy",fragShader:h},{name:"AddBlend",fragShader:s},{name:"LinearBlend",fragShader:u},{name:"ColorMatrix",fragShader:a}]),t.attributes=l(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]),t.vertices=[-1,-1,0,0,-1,1,0,1,1,1,1,1,-1,-1,0,0,1,1,1,1,1,-1,1,0],t.batchSize=1,d.call(this,t),this.colorMatrix=new o,this.copyShader,this.addShader,this.linearShader,this.colorMatrixShader,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2},boot:function(){d.prototype.boot.call(this);var t=this.shaders,e=this.renderTargets;this.copyShader=t[0],this.addShader=t[1],this.linearShader=t[2],this.colorMatrixShader=t[3],this.fullFrame1=e[0],this.fullFrame2=e[1],this.halfFrame1=e[2],this.halfFrame2=e[3]},copyFrame:function(t,e,i,s,n){void 0===i&&(i=1),void 0===s&&(s=!0),void 0===n&&(n=!0);var r=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",i),r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,t.texture),e?(r.viewport(0,0,e.width,e.height),r.bindFramebuffer(r.FRAMEBUFFER,e.framebuffer),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e.texture,0)):r.viewport(0,0,t.width,t.height),s&&(n?r.clearColor(0,0,0,0):r.clearColor(0,0,0,1),r.clear(r.COLOR_BUFFER_BIT)),r.bufferData(r.ARRAY_BUFFER,this.vertexData,r.STATIC_DRAW),r.drawArrays(r.TRIANGLES,0,6),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindTexture(r.TEXTURE_2D,null)},blitFrame:function(t,e,i,s,r,o,a){void 0===i&&(i=1),void 0===s&&(s=!0),void 0===r&&(r=!0),void 0===o&&(o=!1),void 0===a&&(a=!1);var h=this.gl;if(this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",i),h.activeTexture(h.TEXTURE0),h.bindTexture(h.TEXTURE_2D,t.texture),t.height>e.height)h.viewport(0,0,t.width,t.height),this.setTargetUVs(t,e);else{var l=e.height-t.height;h.viewport(0,l,t.width,t.height)}if(h.bindFramebuffer(h.FRAMEBUFFER,e.framebuffer),h.framebufferTexture2D(h.FRAMEBUFFER,h.COLOR_ATTACHMENT0,h.TEXTURE_2D,e.texture,0),s&&(r?h.clearColor(0,0,0,0):h.clearColor(0,0,0,1),h.clear(h.COLOR_BUFFER_BIT)),o){var u=this.renderer.currentBlendMode;this.renderer.setBlendMode(n.ERASE)}a&&this.flipY(),h.bufferData(h.ARRAY_BUFFER,this.vertexData,h.STATIC_DRAW),h.drawArrays(h.TRIANGLES,0,6),o&&this.renderer.setBlendMode(u),h.bindFramebuffer(h.FRAMEBUFFER,null),h.bindTexture(h.TEXTURE_2D,null),this.resetUVs()},copyFrameRect:function(t,e,i,s,n,r,o,a){void 0===o&&(o=!0),void 0===a&&(a=!0);var h=this.gl;h.bindFramebuffer(h.FRAMEBUFFER,t.framebuffer),h.framebufferTexture2D(h.FRAMEBUFFER,h.COLOR_ATTACHMENT0,h.TEXTURE_2D,t.texture,0),o&&(a?h.clearColor(0,0,0,0):h.clearColor(0,0,0,1),h.clear(h.COLOR_BUFFER_BIT)),h.activeTexture(h.TEXTURE0),h.bindTexture(h.TEXTURE_2D,e.texture),h.copyTexSubImage2D(h.TEXTURE_2D,0,0,0,i,s,n,r),h.bindFramebuffer(h.FRAMEBUFFER,null),h.bindTexture(h.TEXTURE_2D,null)},copyToGame:function(t){var e=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",1),this.renderer.popFramebuffer(),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t.texture),e.bufferData(e.ARRAY_BUFFER,this.vertexData,e.STATIC_DRAW),e.drawArrays(e.TRIANGLES,0,6),this.renderer.resetTextures()},drawFrame:function(t,e,i,s){void 0===i&&(i=!0),void 0===s&&(s=this.colorMatrix);var n=this.gl;this.setShader(this.colorMatrixShader),this.set1i("uMainSampler",0),this.set1fv("uColorMatrix",s.getData()),this.set1f("uAlpha",s.alpha),n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,t.texture),e?(n.viewport(0,0,e.width,e.height),n.bindFramebuffer(n.FRAMEBUFFER,e.framebuffer),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,e.texture,0)):n.viewport(0,0,t.width,t.height),i?n.clearColor(0,0,0,0):n.clearColor(0,0,0,1),n.clear(n.COLOR_BUFFER_BIT),n.bufferData(n.ARRAY_BUFFER,this.vertexData,n.STATIC_DRAW),n.drawArrays(n.TRIANGLES,0,6),n.bindFramebuffer(n.FRAMEBUFFER,null),n.bindTexture(n.TEXTURE_2D,null)},blendFrames:function(t,e,i,s,n,r){void 0===s&&(s=1),void 0===n&&(n=!0),void 0===r&&(r=this.linearShader);var o=this.gl;this.setShader(r),this.set1i("uMainSampler1",0),this.set1i("uMainSampler2",1),this.set1f("uStrength",s),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,t.texture),o.activeTexture(o.TEXTURE1),o.bindTexture(o.TEXTURE_2D,e.texture),i?(o.bindFramebuffer(o.FRAMEBUFFER,i.framebuffer),o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,i.texture,0),o.viewport(0,0,i.width,i.height)):o.viewport(0,0,t.width,t.height),n?o.clearColor(0,0,0,0):o.clearColor(0,0,0,1),o.clear(o.COLOR_BUFFER_BIT),o.bufferData(o.ARRAY_BUFFER,this.vertexData,o.STATIC_DRAW),o.drawArrays(o.TRIANGLES,0,6),o.bindFramebuffer(o.FRAMEBUFFER,null),o.bindTexture(o.TEXTURE_2D,null)},blendFramesAdditive:function(t,e,i,s,n){this.blendFrames(t,e,i,s,n,this.addShader)},clearFrame:function(t,e){void 0===e&&(e=!0);var i=this.gl;i.viewport(0,0,t.width,t.height),i.bindFramebuffer(i.FRAMEBUFFER,t.framebuffer),e?i.clearColor(0,0,0,0):i.clearColor(0,0,0,1),i.clear(i.COLOR_BUFFER_BIT);var s=this.renderer.currentFramebuffer;i.bindFramebuffer(i.FRAMEBUFFER,s)},setUVs:function(t,e,i,s,n,r,o,a){var h=this.vertexViewF32;h[2]=t,h[3]=e,h[6]=i,h[7]=s,h[10]=n,h[11]=r,h[14]=t,h[15]=e,h[18]=n,h[19]=r,h[22]=o,h[23]=a},setTargetUVs:function(t,e){var i=e.height/t.height;i=i>.5?.5-(i-.5):.5-i+.5,this.setUVs(0,i,0,1+i,1,1+i,1,i)},flipX:function(){this.setUVs(1,0,1,1,0,1,0,0)},flipY:function(){this.setUVs(0,1,0,0,1,0,1,1)},resetUVs:function(){this.setUVs(0,0,0,1,1,1,1,0)}});t.exports=p},65641:t=>{t.exports={BITMAPMASK_PIPELINE:"BitmapMaskPipeline",LIGHT_PIPELINE:"Light2D",POINTLIGHT_PIPELINE:"PointLightPipeline",SINGLE_PIPELINE:"SinglePipeline",MULTI_PIPELINE:"MultiPipeline",ROPE_PIPELINE:"RopePipeline",GRAPHICS_PIPELINE:"GraphicsPipeline",POSTFX_PIPELINE:"PostFXPipeline",UTILITY_PIPELINE:"UtilityPipeline"}},68726:t=>{t.exports="pipelineafterflush"},67186:t=>{t.exports="pipelinebeforeflush"},22709:t=>{t.exports="pipelinebind"},74469:t=>{t.exports="pipelineboot"},93953:t=>{t.exports="pipelinedestroy"},51687:t=>{t.exports="pipelinerebind"},25034:t=>{t.exports="pipelineresize"},18970:(t,e,i)=>{t.exports={AFTER_FLUSH:i(68726),BEFORE_FLUSH:i(67186),BIND:i(22709),BOOT:i(74469),DESTROY:i(93953),REBIND:i(51687),RESIZE:i(25034)}},62253:(t,e,i)=>{var s=i(65641),n=i(98611),r={BitmapMaskPipeline:i(5583),Events:i(18970),LightPipeline:i(66901),MultiPipeline:i(77310),PointLightPipeline:i(10919),PostFXPipeline:i(80486),RopePipeline:i(21213),SinglePipeline:i(51212),SpriteFXPipeline:i(38964),UtilityPipeline:i(60848)};r=n(!1,r,s),t.exports=r},2529:t=>{t.exports=["#define SHADER_NAME PHASER_ADD_BLEND_FS","","precision mediump float;","","uniform sampler2D uMainSampler1;","uniform sampler2D uMainSampler2;","uniform float uStrength;","","varying vec2 outTexCoord;","","void main ()","{"," vec4 frame1 = texture2D(uMainSampler1, outTexCoord);"," vec4 frame2 = texture2D(uMainSampler2, outTexCoord);",""," gl_FragColor = frame1 + frame2 * uStrength;","}",""].join("\n")},91679:t=>{t.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_FS","","precision mediump float;","","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uMaskSampler;","uniform bool uInvertMaskAlpha;","","void main ()","{"," vec2 uv = gl_FragCoord.xy / uResolution;",""," vec4 mainColor = texture2D(uMainSampler, uv);"," vec4 maskColor = texture2D(uMaskSampler, uv);",""," if (!uInvertMaskAlpha)"," {"," mainColor *= maskColor.a;"," }"," else"," {"," mainColor *= (1.0 - maskColor.a);"," }",""," gl_FragColor = mainColor;","}",""].join("\n")},89053:t=>{t.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_VS","","precision mediump float;","","attribute vec2 inPosition;","","void main ()","{"," gl_Position = vec4(inPosition, 0.0, 1.0);","}",""].join("\n")},37486:t=>{t.exports=["#define SHADER_NAME PHASER_COLORMATRIX_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","uniform float uColorMatrix[20];","uniform float uAlpha;","","varying vec2 outTexCoord;","","void main ()","{"," vec4 c = texture2D(uMainSampler, outTexCoord);",""," if (uAlpha == 0.0)"," {"," gl_FragColor = c;",""," return;"," }",""," if (c.a > 0.0)"," {"," c.rgb /= c.a;"," }",""," vec4 result;",""," result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4];"," result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9];"," result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14];"," result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19];",""," vec3 rgb = mix(c.rgb, result.rgb, uAlpha);",""," rgb *= result.a;",""," gl_FragColor = vec4(rgb, result.a);","}",""].join("\n")},79060:t=>{t.exports=["#define SHADER_NAME PHASER_COPY_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","uniform float uBrightness;","","varying vec2 outTexCoord;","","void main ()","{"," gl_FragColor = texture2D(uMainSampler, outTexCoord) * uBrightness;","}",""].join("\n")},65045:t=>{t.exports=["#define SHADER_NAME PHASER_LIGHT_FS","","precision mediump float;","","struct Light","{"," vec2 position;"," vec3 color;"," float intensity;"," float radius;","};","","const int kMaxLights = %LIGHT_COUNT%;","","uniform vec4 uCamera; /* x, y, rotation, zoom */","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uNormSampler;","uniform vec3 uAmbientLightColor;","uniform Light uLights[kMaxLights];","uniform mat3 uInverseRotationMatrix;","","varying vec2 outTexCoord;","varying vec4 outTint;","","void main()","{"," vec3 finalColor = vec3(0.0, 0.0, 0.0);"," vec4 color = texture2D(uMainSampler, outTexCoord) * vec4(outTint.bgr * outTint.a, outTint.a);"," vec3 normalMap = texture2D(uNormSampler, outTexCoord).rgb;"," vec3 normal = normalize(uInverseRotationMatrix * vec3(normalMap * 2.0 - 1.0));"," vec2 res = vec2(min(uResolution.x, uResolution.y)) * uCamera.w;",""," for (int index = 0; index < kMaxLights; ++index)"," {"," Light light = uLights[index];"," vec3 lightDir = vec3((light.position.xy / res) - (gl_FragCoord.xy / res), 0.1);"," vec3 lightNormal = normalize(lightDir);"," float distToSurf = length(lightDir) * uCamera.w;"," float diffuseFactor = max(dot(normal, lightNormal), 0.0);"," float radius = (light.radius / res.x * uCamera.w) * uCamera.w;"," float attenuation = clamp(1.0 - distToSurf * distToSurf / (radius * radius), 0.0, 1.0);"," vec3 diffuse = light.color * diffuseFactor;"," finalColor += (attenuation * diffuse) * light.intensity;"," }",""," vec4 colorOutput = vec4(uAmbientLightColor + finalColor, 1.0);",""," gl_FragColor = color * vec4(colorOutput.rgb * colorOutput.a, colorOutput.a);","}",""].join("\n")},98921:t=>{t.exports=["#define SHADER_NAME PHASER_LINEAR_BLEND_FS","","precision mediump float;","","uniform sampler2D uMainSampler1;","uniform sampler2D uMainSampler2;","uniform float uStrength;","","varying vec2 outTexCoord;","","void main ()","{"," vec4 frame1 = texture2D(uMainSampler1, outTexCoord);"," vec4 frame2 = texture2D(uMainSampler2, outTexCoord);",""," gl_FragColor = mix(frame1, frame2 * uStrength, 0.5);","}",""].join("\n")},53787:t=>{t.exports=["#define SHADER_NAME PHASER_MULTI_V2_FS","#define numTextures %count%","","precision highp float;","","uniform sampler2D uMainSampler[%count%];","","varying vec2 outTexCoord;","varying float outTexId;","varying float outTintEffect;","varying vec4 outTint;","","%getSampler%","","void main ()","{"," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);",""," vec4 texture = getSampler(int(outTexId), outTexCoord);",""," // Multiply texture tint"," vec4 color = texture * texel;",""," if (outTintEffect == 1.0)"," {"," // Solid color + texture alpha"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," // Solid color, no texture"," color = texel;"," }",""," gl_FragColor = color;","}",""].join("\n")},15968:t=>{t.exports=["#define SHADER_NAME PHASER_MULTI_VS","","precision highp float;","","uniform mat4 uProjectionMatrix;","","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexId;","attribute float inTintEffect;","attribute vec4 inTint;","","varying vec2 outTexCoord;","varying float outTexId;","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);",""," outTexCoord = inTexCoord;"," outTexId = inTexId;"," outTint = inTint;"," outTintEffect = inTintEffect;","}",""].join("\n")},83327:t=>{t.exports=["#define SHADER_NAME PHASER_POINTLIGHT_FS","","precision mediump float;","","uniform vec2 uResolution;","uniform float uCameraZoom;","","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","","void main ()","{"," vec2 center = (lightPosition.xy + 1.0) * (uResolution.xy * 0.5);",""," float distToSurf = length(center - gl_FragCoord.xy);",""," float radius = 1.0 - distToSurf / (lightRadius * uCameraZoom);",""," float intensity = smoothstep(0.0, 1.0, radius * lightAttenuation);",""," vec4 color = vec4(intensity, intensity, intensity, 0.0) * lightColor;",""," gl_FragColor = vec4(color.rgb * lightColor.a, color.a);","}",""].join("\n")},54677:t=>{t.exports=["#define SHADER_NAME PHASER_POINTLIGHT_VS","","precision mediump float;","","uniform mat4 uProjectionMatrix;","","attribute vec2 inPosition;","attribute vec2 inLightPosition;","attribute vec4 inLightColor;","attribute float inLightRadius;","attribute float inLightAttenuation;","","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","","void main ()","{"," lightColor = inLightColor;"," lightRadius = inLightRadius;"," lightAttenuation = inLightAttenuation;"," lightPosition = uProjectionMatrix * vec4(inLightPosition, 1.0, 1.0);",""," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);","}",""].join("\n")},12569:t=>{t.exports=["#define SHADER_NAME PHASER_POSTFX_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","","varying vec2 outTexCoord;","","void main ()","{"," gl_FragColor = texture2D(uMainSampler, outTexCoord);","}",""].join("\n")},99365:t=>{t.exports=["#define SHADER_NAME PHASER_QUAD_VS","","precision mediump float;","","attribute vec2 inPosition;","attribute vec2 inTexCoord;","","varying vec2 outFragCoord;","varying vec2 outTexCoord;","","void main ()","{"," outFragCoord = inPosition.xy * 0.5 + 0.5;"," outTexCoord = inTexCoord;",""," gl_Position = vec4(inPosition, 0, 1);","}",""].join("\n")},85060:t=>{t.exports=["#define SHADER_NAME PHASER_SINGLE_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);",""," // Multiply texture tint"," vec4 color = texture * texel;",""," if (outTintEffect == 1.0)"," {"," // Solid color + texture alpha"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," // Solid color, no texture"," color = texel;"," }",""," gl_FragColor = color;","}",""].join("\n")},18166:t=>{t.exports=["#define SHADER_NAME PHASER_SINGLE_VS","","precision mediump float;","","uniform mat4 uProjectionMatrix;","","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexId;","attribute float inTintEffect;","attribute vec4 inTint;","","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);",""," outTexCoord = inTexCoord;"," outTint = inTint;"," outTintEffect = inTintEffect;","}",""].join("\n")},756:(t,e,i)=>{var s=i(55301),n=i(56694),r=i(6659),o=i(40444),a=i(97081),h=i(74181),l=i(2893),u=i(9229),c=i(72283),d=i(74118),p=i(90881),f=i(84314),v=i(93736),g=new n({Extends:r,initialize:function(t){r.call(this),this.game=t,this.canvas,this.canvasBounds=new d,this.parent=null,this.parentIsWindow=!1,this.parentSize=new p,this.gameSize=new p,this.baseSize=new p,this.displaySize=new p,this.scaleMode=s.SCALE_MODE.NONE,this.zoom=1,this._resetZoom=!1,this.displayScale=new v(1,1),this.autoRound=!1,this.autoCenter=s.CENTER.NO_CENTER,this.orientation=s.ORIENTATION.LANDSCAPE,this.fullscreen,this.fullscreenTarget=null,this._createdFullscreenTarget=!1,this.dirty=!1,this.resizeInterval=500,this._lastCheck=0,this._checkOrientation=!1,this.listeners={orientationChange:c,windowResize:c,fullScreenChange:c,fullScreenError:c}},preBoot:function(){this.parseConfig(this.game.config),this.game.events.once(a.BOOT,this.boot,this)},boot:function(){var t=this.game;this.canvas=t.canvas,this.fullscreen=t.device.fullscreen,this.scaleMode!==s.SCALE_MODE.RESIZE&&this.displaySize.setAspectMode(this.scaleMode),this.scaleMode===s.SCALE_MODE.NONE?this.resize(this.width,this.height):(this.getParentBounds(),this.parentSize.width>0&&this.parentSize.height>0&&this.displaySize.setParent(this.parentSize),this.refresh()),t.events.on(a.PRE_STEP,this.step,this),t.events.once(a.READY,this.refresh,this),t.events.once(a.DESTROY,this.destroy,this),this.startListeners()},parseConfig:function(t){this.getParent(t),this.getParentBounds();var e=t.width,i=t.height,n=t.scaleMode,r=t.zoom,o=t.autoRound;if("string"==typeof e){var a=this.parentSize.width;0===a&&(a=window.innerWidth);var h=parseInt(e,10)/100;e=Math.floor(a*h)}if("string"==typeof i){var l=this.parentSize.height;0===l&&(l=window.innerHeight);var c=parseInt(i,10)/100;i=Math.floor(l*c)}this.scaleMode=n,this.autoRound=o,this.autoCenter=t.autoCenter,this.resizeInterval=t.resizeInterval,o&&(e=Math.floor(e),i=Math.floor(i)),this.gameSize.setSize(e,i),r===s.ZOOM.MAX_ZOOM&&(r=this.getMaxZoom()),this.zoom=r,1!==r&&(this._resetZoom=!0),this.baseSize.setSize(e,i),o&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),t.minWidth>0&&this.displaySize.setMin(t.minWidth*r,t.minHeight*r),t.maxWidth>0&&this.displaySize.setMax(t.maxWidth*r,t.maxHeight*r),this.displaySize.setSize(e,i),this.orientation=u(e,i)},getParent:function(t){var e=t.parent;if(null!==e){if(this.parent=l(e),this.parentIsWindow=this.parent===document.body,t.expandParent&&t.scaleMode!==s.SCALE_MODE.NONE){var i=this.parent.getBoundingClientRect();(this.parentIsWindow||0===i.height)&&(document.documentElement.style.height="100%",document.body.style.height="100%",i=this.parent.getBoundingClientRect(),this.parentIsWindow||0!==i.height||(this.parent.style.overflow="hidden",this.parent.style.width="100%",this.parent.style.height="100%"))}t.fullscreenTarget&&!this.fullscreenTarget&&(this.fullscreenTarget=l(t.fullscreenTarget))}},getParentBounds:function(){if(!this.parent)return!1;var t=this.parentSize,e=this.parent.getBoundingClientRect();this.parentIsWindow&&this.game.device.os.iOS&&(e.height=h(!0));var i=e.width,s=e.height;if(t.width!==i||t.height!==s)return t.setSize(i,s),!0;if(this.canvas){var n=this.canvasBounds,r=this.canvas.getBoundingClientRect();if(r.x!==n.x||r.y!==n.y)return!0}return!1},lockOrientation:function(t){var e=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation;return!!e&&e.call(screen,t)},setParentSize:function(t,e){return this.parentSize.setSize(t,e),this.refresh()},setGameSize:function(t,e){var i=this.autoRound;i&&(t=Math.floor(t),e=Math.floor(e));var s=this.width,n=this.height;return this.gameSize.resize(t,e),this.baseSize.resize(t,e),i&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setAspectRatio(t/e),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height,this.refresh(s,n)},resize:function(t,e){var i=this.zoom,s=this.autoRound;s&&(t=Math.floor(t),e=Math.floor(e));var n=this.width,r=this.height;this.gameSize.resize(t,e),this.baseSize.resize(t,e),s&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(t*i,e*i),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height;var o=this.canvas.style,a=t*i,h=e*i;return s&&(a=Math.floor(a),h=Math.floor(h)),a===t&&h===e||(o.width=a+"px",o.height=h+"px"),this.refresh(n,r)},setZoom:function(t){return this.zoom=t,this._resetZoom=!0,this.refresh()},setMaxZoom:function(){return this.zoom=this.getMaxZoom(),this._resetZoom=!0,this.refresh()},refresh:function(t,e){void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.updateScale(),this.updateBounds(),this.updateOrientation(),this.displayScale.set(this.baseSize.width/this.canvasBounds.width,this.baseSize.height/this.canvasBounds.height);var i=this.game.domContainer;if(i){this.baseSize.setCSS(i);var s=this.canvas.style,n=i.style;n.transform="scale("+this.displaySize.width/this.baseSize.width+","+this.displaySize.height/this.baseSize.height+")",n.marginLeft=s.marginLeft,n.marginTop=s.marginTop}return this.emit(o.RESIZE,this.gameSize,this.baseSize,this.displaySize,t,e),this},updateOrientation:function(){if(this._checkOrientation){this._checkOrientation=!1;var t=u(this.width,this.height);t!==this.orientation&&(this.orientation=t,this.emit(o.ORIENTATION_CHANGE,t))}},updateScale:function(){var t,e,i=this.canvas.style,n=this.gameSize.width,r=this.gameSize.height,o=this.zoom,a=this.autoRound;this.scaleMode===s.SCALE_MODE.NONE?(this.displaySize.setSize(n*o,r*o),t=this.displaySize.width,e=this.displaySize.height,a&&(t=Math.floor(t),e=Math.floor(e)),this._resetZoom&&(i.width=t+"px",i.height=e+"px",this._resetZoom=!1)):this.scaleMode===s.SCALE_MODE.RESIZE?(this.displaySize.setSize(this.parentSize.width,this.parentSize.height),this.gameSize.setSize(this.displaySize.width,this.displaySize.height),this.baseSize.setSize(this.displaySize.width,this.displaySize.height),t=this.displaySize.width,e=this.displaySize.height,a&&(t=Math.floor(t),e=Math.floor(e)),this.canvas.width=t,this.canvas.height=e):(this.displaySize.setSize(this.parentSize.width,this.parentSize.height),t=this.displaySize.width,e=this.displaySize.height,a&&(t=Math.floor(t),e=Math.floor(e)),i.width=t+"px",i.height=e+"px"),this.getParentBounds(),this.updateCenter()},getMaxZoom:function(){var t=f(this.parentSize.width,this.gameSize.width,0,!0),e=f(this.parentSize.height,this.gameSize.height,0,!0);return Math.max(Math.min(t,e),1)},updateCenter:function(){var t=this.autoCenter;if(t!==s.CENTER.NO_CENTER){var e=this.canvas,i=e.style,n=e.getBoundingClientRect(),r=n.width,o=n.height,a=Math.floor((this.parentSize.width-r)/2),h=Math.floor((this.parentSize.height-o)/2);t===s.CENTER.CENTER_HORIZONTALLY?h=0:t===s.CENTER.CENTER_VERTICALLY&&(a=0),i.marginLeft=a+"px",i.marginTop=h+"px"}},updateBounds:function(){var t=this.canvasBounds,e=this.canvas.getBoundingClientRect();t.x=e.left+(window.pageXOffset||0)-(document.documentElement.clientLeft||0),t.y=e.top+(window.pageYOffset||0)-(document.documentElement.clientTop||0),t.width=e.width,t.height=e.height},transformX:function(t){return(t-this.canvasBounds.left)*this.displayScale.x},transformY:function(t){return(t-this.canvasBounds.top)*this.displayScale.y},startFullscreen:function(t){void 0===t&&(t={navigationUI:"hide"});var e=this.fullscreen;if(e.available){if(!e.active){var i=this.getFullscreenTarget();e.keyboard?i[e.request](Element.ALLOW_KEYBOARD_INPUT):i[e.request](t)}}else this.emit(o.FULLSCREEN_UNSUPPORTED)},fullscreenSuccessHandler:function(){this.getParentBounds(),this.refresh(),this.emit(o.ENTER_FULLSCREEN)},fullscreenErrorHandler:function(t){this.removeFullscreenTarget(),this.emit(o.FULLSCREEN_FAILED,t)},getFullscreenTarget:function(){if(!this.fullscreenTarget){var t=document.createElement("div");t.style.margin="0",t.style.padding="0",t.style.width="100%",t.style.height="100%",this.fullscreenTarget=t,this._createdFullscreenTarget=!0}this._createdFullscreenTarget&&(this.canvas.parentNode.insertBefore(this.fullscreenTarget,this.canvas),this.fullscreenTarget.appendChild(this.canvas));return this.fullscreenTarget},removeFullscreenTarget:function(){if(this._createdFullscreenTarget){var t=this.fullscreenTarget;if(t&&t.parentNode){var e=t.parentNode;e.insertBefore(this.canvas,t),e.removeChild(t)}}},stopFullscreen:function(){var t=this.fullscreen;if(!t.available)return this.emit(o.FULLSCREEN_UNSUPPORTED),!1;t.active&&document[t.cancel](),this.removeFullscreenTarget(),this.getParentBounds(),this.emit(o.LEAVE_FULLSCREEN),this.refresh()},toggleFullscreen:function(t){this.fullscreen.active?this.stopFullscreen():this.startFullscreen(t)},startListeners:function(){var t=this,e=this.listeners;if(e.orientationChange=function(){t.updateBounds(),t._checkOrientation=!0,t.dirty=!0},e.windowResize=function(){t.updateBounds(),t.dirty=!0},window.addEventListener("orientationchange",e.orientationChange,!1),window.addEventListener("resize",e.windowResize,!1),this.fullscreen.available){e.fullScreenChange=function(e){return t.onFullScreenChange(e)},e.fullScreenError=function(e){return t.onFullScreenError(e)};["webkit","moz",""].forEach((function(t){document.addEventListener(t+"fullscreenchange",e.fullScreenChange,!1),document.addEventListener(t+"fullscreenerror",e.fullScreenError,!1)})),document.addEventListener("MSFullscreenChange",e.fullScreenChange,!1),document.addEventListener("MSFullscreenError",e.fullScreenError,!1)}},onFullScreenChange:function(){document.fullscreenElement||document.webkitFullscreenElement||document.msFullscreenElement||document.mozFullScreenElement?this.fullscreenSuccessHandler():this.stopFullscreen()},onFullScreenError:function(){this.removeFullscreenTarget()},getViewPort:function(t){void 0===t&&(t=new d);var e,i,s=this.baseSize,n=this.parentSize,r=this.canvasBounds,o=this.displayScale,a=r.x>=0?0:-r.x*o.x,h=r.y>=0?0:-r.y*o.y;return e=n.width>=r.width?s.width:s.width-(r.width-n.width)*o.x,i=n.height>=r.height?s.height:s.height-(r.height-n.height)*o.y,t.setTo(a,h,e,i),t},step:function(t,e){this.parent&&(this._lastCheck+=e,(this.dirty||this._lastCheck>this.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var t=this.listeners;window.removeEventListener("orientationchange",t.orientationChange,!1),window.removeEventListener("resize",t.windowResize,!1);["webkit","moz",""].forEach((function(e){document.removeEventListener(e+"fullscreenchange",t.fullScreenChange,!1),document.removeEventListener(e+"fullscreenerror",t.fullScreenError,!1)})),document.removeEventListener("MSFullscreenChange",t.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",t.fullScreenError,!1)},destroy:function(){this.removeAllListeners(),this.stopListeners(),this.game=null,this.canvas=null,this.canvasBounds=null,this.parent=null,this.fullscreenTarget=null,this.parentSize.destroy(),this.gameSize.destroy(),this.baseSize.destroy(),this.displaySize.destroy()},isFullscreen:{get:function(){return this.fullscreen.active}},width:{get:function(){return this.gameSize.width}},height:{get:function(){return this.gameSize.height}},isPortrait:{get:function(){return this.orientation===s.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===s.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});t.exports=g},35098:t=>{t.exports={NO_CENTER:0,CENTER_BOTH:1,CENTER_HORIZONTALLY:2,CENTER_VERTICALLY:3}},53539:t=>{t.exports={LANDSCAPE:"landscape-primary",PORTRAIT:"portrait-primary"}},12637:t=>{t.exports={NONE:0,WIDTH_CONTROLS_HEIGHT:1,HEIGHT_CONTROLS_WIDTH:2,FIT:3,ENVELOP:4,RESIZE:5}},10217:t=>{t.exports={NO_ZOOM:1,ZOOM_2X:2,ZOOM_4X:4,MAX_ZOOM:-1}},55301:(t,e,i)=>{var s={CENTER:i(35098),ORIENTATION:i(53539),SCALE_MODE:i(12637),ZOOM:i(10217)};t.exports=s},82085:t=>{t.exports="enterfullscreen"},11826:t=>{t.exports="fullscreenfailed"},56691:t=>{t.exports="fullscreenunsupported"},34739:t=>{t.exports="leavefullscreen"},26681:t=>{t.exports="orientationchange"},11428:t=>{t.exports="resize"},40444:(t,e,i)=>{t.exports={ENTER_FULLSCREEN:i(82085),FULLSCREEN_FAILED:i(11826),FULLSCREEN_UNSUPPORTED:i(56691),LEAVE_FULLSCREEN:i(34739),ORIENTATION_CHANGE:i(26681),RESIZE:i(11428)}},86754:(t,e,i)=>{var s=i(98611),n=i(55301),r={Center:i(35098),Events:i(40444),Orientation:i(53539),ScaleManager:i(756),ScaleModes:i(12637),Zoom:i(10217)};r=s(!1,r,n.CENTER),r=s(!1,r,n.ORIENTATION),r=s(!1,r,n.SCALE_MODE),r=s(!1,r,n.ZOOM),t.exports=r},47736:(t,e,i)=>{var s=i(72632),n=i(40587);t.exports=function(t){var e=t.game.config.defaultPhysicsSystem,i=s(t.settings,"physics",!1);if(e||i){var r=[];if(e&&r.push(n(e+"Physics")),i)for(var o in i)o=n(o.concat("Physics")),-1===r.indexOf(o)&&r.push(o);return r}}},91088:(t,e,i)=>{var s=i(72632);t.exports=function(t){var e=t.plugins.getDefaultScenePlugins(),i=s(t.settings,"plugins",!1);return Array.isArray(i)?i:e||[]}},90415:t=>{t.exports={game:"game",renderer:"renderer",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",scale:"scale",sound:"sound",textures:"textures",events:"events",cameras:"cameras",add:"add",make:"make",scenePlugin:"scene",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",impactPhysics:"impact",matterPhysics:"matter"}},87157:(t,e,i)=>{var s=i(56694),n=i(63946),r=new s({initialize:function(t){this.sys=new n(this,t),this.game,this.anims,this.cache,this.registry,this.sound,this.textures,this.events,this.cameras,this.add,this.make,this.scene,this.children,this.lights,this.data,this.input,this.load,this.time,this.tweens,this.physics,this.matter,this.scale,this.plugins,this.renderer},update:function(){}});t.exports=r},13553:(t,e,i)=>{var s=i(56694),n=i(92980),r=i(7599),o=i(97081),a=i(10850),h=i(683),l=i(72283),u=i(87157),c=i(63946),d=new s({initialize:function(t,e){if(this.game=t,this.keys={},this.scenes=[],this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,this.customViewports=0,e){Array.isArray(e)||(e=[e]);for(var i=0;i-1&&(delete this.keys[s],this.scenes.splice(i,1),this._start.indexOf(s)>-1&&(i=this._start.indexOf(s),this._start.splice(i,1)),e.sys.destroy())}return this},bootScene:function(t){var e,i=t.sys,s=i.settings;i.sceneUpdate=l,t.init&&(t.init.call(t,s.data),s.status=n.INIT,s.isTransition&&i.events.emit(r.TRANSITION_INIT,s.transitionFrom,s.transitionDuration)),i.load&&(e=i.load).reset(),e&&t.preload?(t.preload.call(t),s.status=n.LOADING,e.once(h.COMPLETE,this.loadComplete,this),e.start()):this.create(t)},loadComplete:function(t){this.game.sound&&this.game.sound.onBlurPausedSounds&&this.game.sound.unlock(),this.create(t.scene)},payloadComplete:function(t){this.bootScene(t.scene)},update:function(t,e){this.processQueue(),this.isProcessing=!0;for(var i=this.scenes.length-1;i>=0;i--){var s=this.scenes[i].sys;s.settings.status>n.START&&s.settings.status<=n.RUNNING&&s.step(t,e)}},render:function(t){for(var e=0;e=n.LOADING&&i.settings.status=n.START&&o<=n.CREATING)return this;if(o>=n.RUNNING&&o<=n.SLEEPING)r.shutdown(),r.sceneUpdate=l,r.start(e);else if(r.sceneUpdate=l,r.start(e),r.load&&(s=r.load),s&&r.settings.hasOwnProperty("pack")&&(s.reset(),s.addPack({payload:r.settings.pack})))return r.settings.status=n.LOADING,s.once(h.COMPLETE,this.payloadComplete,this),s.start(),this;return this.bootScene(i),this},stop:function(t,e){var i=this.getScene(t);if(i&&!i.sys.isTransitioning()&&i.sys.settings.status!==n.SHUTDOWN){var s=i.sys.load;s.off(h.COMPLETE,this.loadComplete,this),s.off(h.COMPLETE,this.payloadComplete,this),i.sys.shutdown(e)}return this},switch:function(t,e){var i=this.getScene(t),s=this.getScene(e);return i&&s&&i!==s&&(this.sleep(t),this.isSleeping(e)?this.wake(e):this.start(e)),this},getAt:function(t){return this.scenes[t]},getIndex:function(t){var e=this.getScene(t);return this.scenes.indexOf(e)},bringToTop:function(t){if(this.isProcessing)this._queue.push({op:"bringToTop",keyA:t,keyB:null});else{var e=this.getIndex(t);if(-1!==e&&e0){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.unshift(i)}}return this},moveDown:function(t){if(this.isProcessing)this._queue.push({op:"moveDown",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e>0){var i=e-1,s=this.getScene(t),n=this.getAt(i);this.scenes[e]=n,this.scenes[i]=s}}return this},moveUp:function(t){if(this.isProcessing)this._queue.push({op:"moveUp",keyA:t,keyB:null});else{var e=this.getIndex(t);if(ei),0,n)}}return this},moveBelow:function(t,e){if(t===e)return this;if(this.isProcessing)this._queue.push({op:"moveBelow",keyA:t,keyB:e});else{var i=this.getIndex(t),s=this.getIndex(e);if(-1!==i&&-1!==s&&s>i){var n=this.getAt(s);this.scenes.splice(s,1),0===i?this.scenes.unshift(n):this.scenes.splice(i-(s{var s=i(82897),n=i(56694),r=i(7599),o=i(72632),a=i(91963),h=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.key=t.sys.settings.key,this.manager=t.sys.game.scene,this.transitionProgress=0,this._elapsed=0,this._target=null,this._duration=0,this._onUpdate,this._onUpdateScope,this._willSleep=!1,this._willRemove=!1,t.sys.events.once(r.BOOT,this.boot,this),t.sys.events.on(r.START,this.pluginStart,this)},boot:function(){this.systems.events.once(r.DESTROY,this.destroy,this)},pluginStart:function(){this._target=null,this.systems.events.once(r.SHUTDOWN,this.shutdown,this)},start:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",this.key),this.manager.queueOp("start",t,e),this},restart:function(t){var e=this.key;return this.manager.queueOp("stop",e),this.manager.queueOp("start",e,t),this},transition:function(t){void 0===t&&(t={});var e=o(t,"target",!1),i=this.manager.getScene(e);if(!e||!this.checkValidTransition(i))return!1;var s=o(t,"duration",1e3);this._elapsed=0,this._target=i,this._duration=s,this._willSleep=o(t,"sleep",!1),this._willRemove=o(t,"remove",!1);var n=o(t,"onUpdate",null);n&&(this._onUpdate=n,this._onUpdateScope=o(t,"onUpdateScope",this.scene));var a=o(t,"allowInput",!1);this.settings.transitionAllowInput=a;var h=i.sys.settings;return h.isTransition=!0,h.transitionFrom=this.scene,h.transitionDuration=s,h.transitionAllowInput=a,o(t,"moveAbove",!1)?this.manager.moveAbove(this.key,e):o(t,"moveBelow",!1)&&this.manager.moveBelow(this.key,e),i.sys.isSleeping()?i.sys.wake(o(t,"data")):this.manager.start(e,o(t,"data")),this.systems.events.emit(r.TRANSITION_OUT,i,s),this.systems.events.on(r.UPDATE,this.step,this),!0},checkValidTransition:function(t){return!(!t||t.sys.isActive()||t.sys.isTransitioning()||t===this.scene||this.systems.isTransitioning())},step:function(t,e){this._elapsed+=e,this.transitionProgress=s(this._elapsed/this._duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.transitionProgress),this._elapsed>=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;this.systems.events.off(r.UPDATE,this.step,this),t.events.emit(r.TRANSITION_COMPLETE,this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i,s){return this.manager.add(t,e,i,s)},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t){return t!==this.key&&this.manager.queueOp("switch",this.key,t),this},stop:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t,e),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var s=this.manager.getScene(e);return s&&s.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isPaused:function(t){return void 0===t&&(t=this.key),this.manager.isPaused(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getStatus:function(t){var e=this.manager.getScene(t);if(e)return e.sys.getStatus()},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off(r.SHUTDOWN,this.shutdown,this),t.off(r.POST_UPDATE,this.step,this),t.off(r.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});a.register("ScenePlugin",h,"scenePlugin"),t.exports=h},36765:(t,e,i)=>{var s=i(92980),n=i(10850),r=i(30657),o=i(90415),a={create:function(t){return"string"==typeof t?t={key:t}:void 0===t&&(t={}),{status:s.PENDING,key:n(t,"key",""),active:n(t,"active",!1),visible:n(t,"visible",!0),isBooted:!1,isTransition:!1,transitionFrom:null,transitionDuration:0,transitionAllowInput:!0,data:{},pack:n(t,"pack",!1),cameras:n(t,"cameras",null),map:n(t,"map",r(o,n(t,"mapAdd",{}))),physics:n(t,"physics",{}),loader:n(t,"loader",{}),plugins:n(t,"plugins",!1),input:n(t,"input",{})}}};t.exports=a},63946:(t,e,i)=>{var s=i(56694),n=i(92980),r=i(18360),o=i(7599),a=i(47736),h=i(91088),l=i(86459),u=i(72283),c=i(36765),d=new s({initialize:function(t,e){this.scene=t,this.game,this.renderer,this.config=e,this.settings=c.create(e),this.canvas,this.context,this.anims,this.cache,this.plugins,this.registry,this.scale,this.sound,this.textures,this.add,this.cameras,this.displayList,this.events,this.make,this.scenePlugin,this.updateList,this.sceneUpdate=u},init:function(t){this.settings.status=n.INIT,this.sceneUpdate=u,this.game=t,this.renderer=t.renderer,this.canvas=t.canvas,this.context=t.context;var e=t.plugins;this.plugins=e,e.addToScene(this,r.Global,[r.CoreScene,h(this),a(this)]),this.events.emit(o.BOOT,this),this.settings.isBooted=!0},step:function(t,e){var i=this.events;i.emit(o.PRE_UPDATE,t,e),i.emit(o.UPDATE,t,e),this.sceneUpdate.call(this.scene,t,e),i.emit(o.POST_UPDATE,t,e)},render:function(t){var e=this.displayList;e.depthSort(),this.events.emit(o.PRE_RENDER,t),this.cameras.render(t,e),this.events.emit(o.RENDER,t)},queueDepthSort:function(){this.displayList.queueDepthSort()},depthSort:function(){this.displayList.depthSort()},pause:function(t){var e=this.settings,i=this.getStatus();return i!==n.CREATING&&i!==n.RUNNING?console.warn("Cannot pause non-running Scene",e.key):this.settings.active&&(e.status=n.PAUSED,e.active=!1,this.events.emit(o.PAUSE,this,t)),this},resume:function(t){var e=this.events,i=this.settings;return this.settings.active||(i.status=n.RUNNING,i.active=!0,e.emit(o.RESUME,this,t)),this},sleep:function(t){var e=this.settings,i=this.getStatus();return i!==n.CREATING&&i!==n.RUNNING?console.warn("Cannot sleep non-running Scene",e.key):(e.status=n.SLEEPING,e.active=!1,e.visible=!1,this.events.emit(o.SLEEP,this,t)),this},wake:function(t){var e=this.events,i=this.settings;return i.status=n.RUNNING,i.active=!0,i.visible=!0,e.emit(o.WAKE,this,t),i.isTransition&&e.emit(o.TRANSITION_WAKE,i.transitionFrom,i.transitionDuration),this},getData:function(){return this.settings.data},getStatus:function(){return this.settings.status},isSleeping:function(){return this.settings.status===n.SLEEPING},isActive:function(){return this.settings.status===n.RUNNING},isPaused:function(){return this.settings.status===n.PAUSED},isTransitioning:function(){return this.settings.isTransition||null!==this.scenePlugin._target},isTransitionOut:function(){return null!==this.scenePlugin._target&&this.scenePlugin._duration>0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(t){return this.settings.visible=t,this},setActive:function(t,e){return t?this.resume(e):this.pause(e)},start:function(t){var e=this.events,i=this.settings;t&&(i.data=t),i.status=n.START,i.active=!0,i.visible=!0,e.emit(o.START,this),e.emit(o.READY,this,t)},shutdown:function(t){var e=this.events,i=this.settings;e.off(o.TRANSITION_INIT),e.off(o.TRANSITION_START),e.off(o.TRANSITION_COMPLETE),e.off(o.TRANSITION_OUT),i.status=n.SHUTDOWN,i.active=!1,i.visible=!1,this.renderer===l.WEBGL&&this.renderer.resetTextures(!0),e.emit(o.SHUTDOWN,this,t)},destroy:function(){var t=this.events,e=this.settings;e.status=n.DESTROYED,e.active=!1,e.visible=!1,t.emit(o.DESTROY,this),t.removeAllListeners();for(var i=["scene","game","anims","cache","plugins","registry","sound","textures","add","camera","displayList","events","make","scenePlugin","updateList"],s=0;s{t.exports={PENDING:0,INIT:1,START:2,LOADING:3,CREATING:4,RUNNING:5,PAUSED:6,SLEEPING:7,SHUTDOWN:8,DESTROYED:9}},31803:t=>{t.exports="addedtoscene"},94817:t=>{t.exports="boot"},28977:t=>{t.exports="create"},91959:t=>{t.exports="destroy"},363:t=>{t.exports="pause"},15643:t=>{t.exports="postupdate"},17058:t=>{t.exports="prerender"},77125:t=>{t.exports="preupdate"},76018:t=>{t.exports="ready"},28620:t=>{t.exports="removedfromscene"},41538:t=>{t.exports="render"},34268:t=>{t.exports="resume"},2342:t=>{t.exports="shutdown"},96541:t=>{t.exports="sleep"},74244:t=>{t.exports="start"},17046:t=>{t.exports="transitioncomplete"},13637:t=>{t.exports="transitioninit"},14733:t=>{t.exports="transitionout"},33899:t=>{t.exports="transitionstart"},52418:t=>{t.exports="transitionwake"},31735:t=>{t.exports="update"},8470:t=>{t.exports="wake"},7599:(t,e,i)=>{t.exports={ADDED_TO_SCENE:i(31803),BOOT:i(94817),CREATE:i(28977),DESTROY:i(91959),PAUSE:i(363),POST_UPDATE:i(15643),PRE_RENDER:i(17058),PRE_UPDATE:i(77125),READY:i(76018),REMOVED_FROM_SCENE:i(28620),RENDER:i(41538),RESUME:i(34268),SHUTDOWN:i(2342),SLEEP:i(96541),START:i(74244),TRANSITION_COMPLETE:i(17046),TRANSITION_INIT:i(13637),TRANSITION_OUT:i(14733),TRANSITION_START:i(33899),TRANSITION_WAKE:i(52418),UPDATE:i(31735),WAKE:i(8470)}},20436:(t,e,i)=>{var s=i(92980),n=i(98611),r={Events:i(7599),GetPhysicsPlugins:i(47736),GetScenePlugins:i(91088),SceneManager:i(13553),ScenePlugin:i(64051),Settings:i(36765),Systems:i(63946)};r=n(!1,r,s),t.exports=r},25798:(t,e,i)=>{var s=i(56694),n=i(6659),r=i(76038),o=i(98611),a=i(72283),h=new s({Extends:n,initialize:function(t,e,i){n.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=this.duration||0,this.totalDuration=this.totalDuration||0,this.config={mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0},this.currentConfig=this.config,this.config=o(this.config,i),this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(console.error("addMarker "+t.name+" already exists in Sound"),!1):(t=o(!0,{name:"",start:0,duration:this.totalDuration-(t.start||0),config:{mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0}},t),this.markers[t.name]=t,!0))},updateMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(this.markers[t.name]=o(!0,this.markers[t.name],t),!0):(console.warn("Audio Marker: "+t.name+" missing in Sound: "+this.key),!1))},removeMarker:function(t){var e=this.markers[t];return e?(this.markers[t]=null,e):null},play:function(t,e){if(void 0===t&&(t=""),"object"==typeof t&&(e=t,t=""),"string"!=typeof t)return!1;if(t){if(!this.markers[t])return console.warn("Marker: "+t+" missing in Sound: "+this.key),!1;this.currentMarker=this.markers[t],this.currentConfig=this.currentMarker.config,this.duration=this.currentMarker.duration}else this.currentMarker=null,this.currentConfig=this.config,this.duration=this.totalDuration;return this.resetConfig(),this.currentConfig=o(this.currentConfig,e),this.isPlaying=!0,this.isPaused=!1,!0},pause:function(){return!(this.isPaused||!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!0,!0)},resume:function(){return!(!this.isPaused||this.isPlaying)&&(this.isPlaying=!0,this.isPaused=!1,!0)},stop:function(){return!(!this.isPaused&&!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!1,this.resetConfig(),!0)},applyConfig:function(){this.mute=this.currentConfig.mute,this.volume=this.currentConfig.volume,this.rate=this.currentConfig.rate,this.detune=this.currentConfig.detune,this.loop=this.currentConfig.loop,this.pan=this.currentConfig.pan},resetConfig:function(){this.currentConfig.seek=0,this.currentConfig.delay=0},update:a,calculateRate:function(){var t=this.currentConfig.detune+this.manager.detune,e=Math.pow(1.0005777895065548,t);this.totalRate=this.currentConfig.rate*this.manager.rate*e},destroy:function(){this.pendingRemove||(this.emit(r.DESTROY,this),this.removeAllListeners(),this.pendingRemove=!0,this.manager=null,this.config=null,this.currentConfig=null,this.markers=null,this.currentMarker=null)}});t.exports=h},12486:(t,e,i)=>{var s=i(56694),n=i(32742),r=i(6659),o=i(76038),a=i(97081),h=i(72283),l=i(71608),u=i(51463),c=new s({Extends:r,initialize:function(t){r.call(this),this.game=t,this.jsonCache=t.cache.json,this.sounds=[],this.mute=!1,this.volume=1,this.pauseOnBlur=!0,this._rate=1,this._detune=0,this.locked=this.locked||!1,this.unlocked=!1,t.events.on(a.BLUR,this.onGameBlur,this),t.events.on(a.FOCUS,this.onGameFocus,this),t.events.on(a.PRE_STEP,this.update,this),t.events.once(a.DESTROY,this.destroy,this)},add:h,addAudioSprite:function(t,e){void 0===e&&(e={});var i=this.add(t,e);for(var s in i.spritemap=this.jsonCache.get(t).spritemap,i.spritemap)if(i.spritemap.hasOwnProperty(s)){var r=n(e),o=i.spritemap[s];r.loop=!!o.hasOwnProperty("loop")&&o.loop,i.addMarker({name:s,start:o.start,duration:o.end-o.start,config:r})}return i},get:function(t){return u(this.sounds,"key",t)},getAll:function(t){return l(this.sounds,"key",t)},play:function(t,e){var i=this.add(t);return i.once(o.COMPLETE,i.destroy,i),e?e.name?(i.addMarker(e),i.play(e.name)):i.play(e):i.play()},playAudioSprite:function(t,e,i){var s=this.addAudioSprite(t);return s.once(o.COMPLETE,s.destroy,s),s.play(e,i)},remove:function(t){var e=this.sounds.indexOf(t);return-1!==e&&(t.destroy(),this.sounds.splice(e,1),!0)},removeAll:function(){this.sounds.forEach((function(t){t.destroy()})),this.sounds.length=0},removeByKey:function(t){for(var e=0,i=this.sounds.length-1;i>=0;i--){var s=this.sounds[i];s.key===t&&(s.destroy(),this.sounds.splice(i,1),e++)}return e},pauseAll:function(){this.forEachActiveSound((function(t){t.pause()})),this.emit(o.PAUSE_ALL,this)},resumeAll:function(){this.forEachActiveSound((function(t){t.resume()})),this.emit(o.RESUME_ALL,this)},stopAll:function(){this.forEachActiveSound((function(t){t.stop()})),this.emit(o.STOP_ALL,this)},stopByKey:function(t){var e=0;return this.getAll(t).forEach((function(t){t.stop()&&e++})),e},unlock:h,onBlur:h,onFocus:h,onGameBlur:function(){this.pauseOnBlur&&this.onBlur()},onGameFocus:function(){this.pauseOnBlur&&this.onFocus()},update:function(t,e){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit(o.UNLOCKED,this));for(var i=this.sounds.length-1;i>=0;i--)this.sounds[i].pendingRemove&&this.sounds.splice(i,1);this.sounds.forEach((function(i){i.update(t,e)}))},destroy:function(){this.game.events.off(a.BLUR,this.onGameBlur,this),this.game.events.off(a.FOCUS,this.onGameFocus,this),this.game.events.off(a.PRE_STEP,this.update,this),this.removeAllListeners(),this.removeAll(),this.sounds.length=0,this.sounds=null,this.game=null},forEachActiveSound:function(t,e){var i=this;this.sounds.forEach((function(s,n){s&&!s.pendingRemove&&t.call(e||i,s,n,i.sounds)}))},setRate:function(t){return this.rate=t,this},rate:{get:function(){return this._rate},set:function(t){this._rate=t,this.forEachActiveSound((function(t){t.calculateRate()})),this.emit(o.GLOBAL_RATE,this,t)}},setDetune:function(t){return this.detune=t,this},detune:{get:function(){return this._detune},set:function(t){this._detune=t,this.forEachActiveSound((function(t){t.calculateRate()})),this.emit(o.GLOBAL_DETUNE,this,t)}}});t.exports=c},84191:(t,e,i)=>{var s=i(27622),n=i(17546),r=i(55491),o={create:function(t){var e=t.config.audio,i=t.device.audio;return e.noAudio||!i.webAudio&&!i.audioData?new n(t):i.webAudio&&!e.disableWebAudio?new r(t):new s(t)}};t.exports=o},77578:t=>{t.exports="complete"},19679:t=>{t.exports="decodedall"},56951:t=>{t.exports="decoded"},16436:t=>{t.exports="destroy"},55154:t=>{t.exports="detune"},57818:t=>{t.exports="detune"},57890:t=>{t.exports="mute"},83022:t=>{t.exports="rate"},99170:t=>{t.exports="volume"},64289:t=>{t.exports="looped"},67214:t=>{t.exports="loop"},53128:t=>{t.exports="mute"},73078:t=>{t.exports="pan"},76763:t=>{t.exports="pauseall"},88426:t=>{t.exports="pause"},13765:t=>{t.exports="play"},80291:t=>{t.exports="rate"},11124:t=>{t.exports="resumeall"},55382:t=>{t.exports="resume"},71157:t=>{t.exports="seek"},31776:t=>{t.exports="stopall"},39450:t=>{t.exports="stop"},21939:t=>{t.exports="unlocked"},33019:t=>{t.exports="volume"},76038:(t,e,i)=>{t.exports={COMPLETE:i(77578),DECODED:i(56951),DECODED_ALL:i(19679),DESTROY:i(16436),DETUNE:i(55154),GLOBAL_DETUNE:i(57818),GLOBAL_MUTE:i(57890),GLOBAL_RATE:i(83022),GLOBAL_VOLUME:i(99170),LOOP:i(67214),LOOPED:i(64289),MUTE:i(53128),PAN:i(73078),PAUSE_ALL:i(76763),PAUSE:i(88426),PLAY:i(13765),RATE:i(80291),RESUME_ALL:i(11124),RESUME:i(55382),SEEK:i(71157),STOP_ALL:i(31776),STOP:i(39450),UNLOCKED:i(21939),VOLUME:i(33019)}},34350:(t,e,i)=>{var s=i(25798),n=i(56694),r=i(76038),o=i(82897),a=new n({Extends:s,initialize:function(t,e,i){if(void 0===i&&(i={}),this.tags=t.game.cache.audio.get(e),!this.tags)throw new Error('No cached audio asset with key "'+e);this.audio=null,this.startTime=0,this.previousTime=0,this.duration=this.tags[0].duration,this.totalDuration=this.tags[0].duration,s.call(this,t,e,i)},play:function(t,e){return!this.manager.isLocked(this,"play",[t,e])&&(!!s.prototype.play.call(this,t,e)&&(!!this.pickAndPlayAudioTag()&&(this.emit(r.PLAY,this),!0)))},pause:function(){return!this.manager.isLocked(this,"pause")&&(!(this.startTime>0)&&(!!s.prototype.pause.call(this)&&(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit(r.PAUSE,this),!0)))},resume:function(){return!this.manager.isLocked(this,"resume")&&(!(this.startTime>0)&&(!!s.prototype.resume.call(this)&&(!!this.pickAndPlayAudioTag()&&(this.emit(r.RESUME,this),!0))))},stop:function(){return!this.manager.isLocked(this,"stop")&&(!!s.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit(r.STOP,this),!0))},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var t=this.currentConfig.seek,e=this.currentConfig.delay,i=(this.currentMarker?this.currentMarker.start:0)+t;return this.previousTime=i,this.audio.currentTime=i,this.applyConfig(),0===e?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+1e3*e,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var t=0;t0)this.startTime=i-this.manager.loopEndOffset?(this.audio.currentTime=e+Math.max(0,s-i),s=this.audio.currentTime):s=i)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit(r.COMPLETE,this);this.previousTime=s}},destroy:function(){s.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=o(this.currentConfig.volume*this.manager.volume,0,1))},calculateRate:function(){s.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(t){this.currentConfig.mute=t,this.manager.isLocked(this,"mute",t)||(this.updateMute(),this.emit(r.MUTE,this,t))}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.currentConfig.volume},set:function(t){this.currentConfig.volume=t,this.manager.isLocked(this,"volume",t)||(this.updateVolume(),this.emit(r.VOLUME,this,t))}},setVolume:function(t){return this.volume=t,this},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.manager.isLocked(this,r.RATE,t)||(this.calculateRate(),this.emit(r.RATE,this,t))}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.manager.isLocked(this,r.DETUNE,t)||(this.calculateRate(),this.emit(r.DETUNE,this,t))}},setDetune:function(t){return this.detune=t,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.isLocked(this,"seek",t)||this.startTime>0||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.isPlaying?(this.previousTime=t,this.audio.currentTime=t):this.isPaused&&(this.currentConfig.seek=t),this.emit(r.SEEK,this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.manager.isLocked(this,"loop",t)||(this.audio&&(this.audio.loop=t),this.emit(r.LOOP,this,t))}},setLoop:function(t){return this.loop=t,this},pan:{get:function(){return this.currentConfig.pan},set:function(t){this.currentConfig.pan=t,this.emit(r.PAN,this,t)}},setPan:function(t){return this.pan=t,this}});t.exports=a},27622:(t,e,i)=>{var s=i(12486),n=i(56694),r=i(76038),o=i(34350),a=new n({Extends:s,initialize:function(t){this.override=!0,this.audioPlayDelay=.1,this.loopEndOffset=.05,this.onBlurPausedSounds=[],this.locked="ontouchstart"in window,this.lockedActionsQueue=this.locked?[]:null,this._mute=!1,this._volume=1,s.call(this,t)},add:function(t,e){var i=new o(this,t,e);return this.sounds.push(i),i},unlock:function(){this.locked=!1;var t=this;if(this.game.cache.audio.entries.each((function(e,i){for(var s=0;s{t.exports={SoundManagerCreator:i(84191),Events:i(76038),BaseSound:i(25798),BaseSoundManager:i(12486),WebAudioSound:i(96008),WebAudioSoundManager:i(55491),HTML5AudioSound:i(34350),HTML5AudioSoundManager:i(27622),NoAudioSound:i(38662),NoAudioSoundManager:i(17546)}},38662:(t,e,i)=>{var s=i(25798),n=i(56694),r=i(6659),o=i(98611),a=i(72283),h=function(){return!1},l=function(){return null},u=function(){return this},c=new n({Extends:r,initialize:function(t,e,i){void 0===i&&(i={}),r.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=0,this.totalDuration=0,this.config=o({mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0},i),this.currentConfig=this.config,this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.seek=0,this.loop=!1,this.pan=0,this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:h,updateMarker:h,removeMarker:l,play:h,pause:h,resume:h,stop:h,setMute:u,setVolume:u,setRate:u,setDetune:u,setSeek:u,setLoop:u,setPan:u,applyConfig:l,resetConfig:l,update:a,calculateRate:l,destroy:function(){s.prototype.destroy.call(this)}});t.exports=c},17546:(t,e,i)=>{var s=i(12486),n=i(56694),r=i(6659),o=i(38662),a=i(72283),h=new n({Extends:r,initialize:function(t){r.call(this),this.game=t,this.sounds=[],this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.pauseOnBlur=!0,this.locked=!1},add:function(t,e){var i=new o(this,t,e);return this.sounds.push(i),i},addAudioSprite:function(t,e){var i=this.add(t,e);return i.spritemap={},i},get:function(t){return s.prototype.get.call(this,t)},getAll:function(t){return s.prototype.getAll.call(this,t)},play:function(t,e){return!1},playAudioSprite:function(t,e,i){return!1},remove:function(t){return s.prototype.remove.call(this,t)},removeAll:function(){return s.prototype.removeAll.call(this)},removeByKey:function(t){return s.prototype.removeByKey.call(this,t)},stopByKey:function(t){return s.prototype.stopByKey.call(this,t)},onBlur:a,onFocus:a,onGameBlur:a,onGameFocus:a,pauseAll:a,resumeAll:a,stopAll:a,update:a,setRate:a,setDetune:a,setMute:a,setVolume:a,unlock:a,forEachActiveSound:function(t,e){s.prototype.forEachActiveSound.call(this,t,e)},destroy:function(){s.prototype.destroy.call(this)}});t.exports=h},96008:(t,e,i)=>{var s=i(25798),n=i(56694),r=i(76038),o=new n({Extends:s,initialize:function(t,e,i){if(void 0===i&&(i={}),this.audioBuffer=t.game.cache.audio.get(e),!this.audioBuffer)throw new Error('Audio key "'+e+'" missing from cache');this.source=null,this.loopSource=null,this.muteNode=t.context.createGain(),this.volumeNode=t.context.createGain(),this.pannerNode=null,this.playTime=0,this.startTime=0,this.loopTime=0,this.rateUpdates=[],this.hasEnded=!1,this.hasLooped=!1,this.muteNode.connect(this.volumeNode),t.context.createStereoPanner?(this.pannerNode=t.context.createStereoPanner(),this.volumeNode.connect(this.pannerNode),this.pannerNode.connect(t.destination)):this.volumeNode.connect(t.destination),this.duration=this.audioBuffer.duration,this.totalDuration=this.audioBuffer.duration,s.call(this,t,e,i)},play:function(t,e){return!!s.prototype.play.call(this,t,e)&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource(),this.emit(r.PLAY,this),!0)},pause:function(){return!(this.manager.context.currentTime{var s=i(82329),n=i(12486),r=i(56694),o=i(76038),a=i(97081),h=i(96008),l=new r({Extends:n,initialize:function(t){this.context=this.createAudioContext(t),this.masterMuteNode=this.context.createGain(),this.masterVolumeNode=this.context.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(this.context.destination),this.destination=this.masterMuteNode,this.locked="suspended"===this.context.state&&("ontouchstart"in window||"onclick"in window),n.call(this,t),this.locked&&t.isBooted?this.unlock():t.events.once(a.BOOT,this.unlock,this)},createAudioContext:function(t){var e=t.config.audio;return e.context?(e.context.resume(),e.context):window.hasOwnProperty("AudioContext")?new AudioContext:window.hasOwnProperty("webkitAudioContext")?new window.webkitAudioContext:void 0},setAudioContext:function(t){return this.context&&this.context.close(),this.masterMuteNode&&this.masterMuteNode.disconnect(),this.masterVolumeNode&&this.masterVolumeNode.disconnect(),this.context=t,this.masterMuteNode=t.createGain(),this.masterVolumeNode=t.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(t.destination),this.destination=this.masterMuteNode,this},add:function(t,e){var i=new h(this,t,e);return this.sounds.push(i),i},decodeAudio:function(t,e){var i;i=Array.isArray(t)?t:[{key:t,data:e}];for(var n=this.game.cache.audio,r=i.length,a=0;a{var s=i(59959),n=i(56694),r=i(72283),o=i(17922),a=new n({initialize:function(t){this.parent=t,this.list=[],this.position=0,this.addCallback=r,this.removeCallback=r,this._sortKey=""},add:function(t,e){return e?s.Add(this.list,t):s.Add(this.list,t,0,this.addCallback,this)},addAt:function(t,e,i){return i?s.AddAt(this.list,t,e):s.AddAt(this.list,t,e,0,this.addCallback,this)},getAt:function(t){return this.list[t]},getIndex:function(t){return this.list.indexOf(t)},sort:function(t,e){return t?(void 0===e&&(e=function(e,i){return e[t]-i[t]}),o(this.list,e),this):this},getByName:function(t){return s.GetFirst(this.list,"name",t)},getRandom:function(t,e){return s.GetRandom(this.list,t,e)},getFirst:function(t,e,i,n){return s.GetFirst(this.list,t,e,i,n)},getAll:function(t,e,i,n){return s.GetAll(this.list,t,e,i,n)},count:function(t,e){return s.CountAllMatching(this.list,t,e)},swap:function(t,e){s.Swap(this.list,t,e)},moveTo:function(t,e){return s.MoveTo(this.list,t,e)},moveAbove:function(t,e){return s.MoveAbove(this.list,t,e)},moveBelow:function(t,e){return s.MoveBelow(this.list,t,e)},remove:function(t,e){return e?s.Remove(this.list,t):s.Remove(this.list,t,this.removeCallback,this)},removeAt:function(t,e){return e?s.RemoveAt(this.list,t):s.RemoveAt(this.list,t,this.removeCallback,this)},removeBetween:function(t,e,i){return i?s.RemoveBetween(this.list,t,e):s.RemoveBetween(this.list,t,e,this.removeCallback,this)},removeAll:function(t){for(var e=this.list.length;e--;)this.remove(this.list[e],t);return this},bringToTop:function(t){return s.BringToTop(this.list,t)},sendToBack:function(t){return s.SendToBack(this.list,t)},moveUp:function(t){return s.MoveUp(this.list,t),t},moveDown:function(t){return s.MoveDown(this.list,t),t},reverse:function(){return this.list.reverse(),this},shuffle:function(){return s.Shuffle(this.list),this},replace:function(t,e){return s.Replace(this.list,t,e)},exists:function(t){return this.list.indexOf(t)>-1},setAll:function(t,e,i,n){return s.SetAll(this.list,t,e,i,n),this},each:function(t,e){for(var i=[null],s=2;s0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}}});t.exports=a},33885:(t,e,i)=>{var s=new(i(56694))({initialize:function(t){if(this.entries={},this.size=0,Array.isArray(t))for(var e=0;e{var s=i(56694),n=i(6659),r=i(36716),o=new s({Extends:n,initialize:function(){n.call(this),this._pending=[],this._active=[],this._destroy=[],this._toProcess=0,this.checkQueue=!1},isActive:function(t){return this._active.indexOf(t)>-1},isPending:function(t){return this._toProcess>0&&this._pending.indexOf(t)>-1},isDestroying:function(t){return this._destroy.indexOf(t)>-1},add:function(t){return this.checkQueue&&(this.isActive(t)||this.isPending(t))||(this._pending.push(t),this._toProcess++),t},remove:function(t){if(this.isPending(t)){var e=this._pending,i=e.indexOf(t);-1!==i&&e.splice(i,1)}else this.isActive(t)&&(this._destroy.push(t),this._toProcess++);return t},removeAll:function(){for(var t=this._active,e=this._destroy,i=t.length;i--;)e.push(t[i]),this._toProcess++;return this},update:function(){if(0===this._toProcess)return this._active;var t,e,i=this._destroy,s=this._active;for(t=0;t{var s=i(53466);function n(t){if(!(this instanceof n))return new n(t,[".left",".top",".right",".bottom"]);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}function r(t,e,i){if(!i)return e.indexOf(t);for(var s=0;s=t.minX&&e.maxY>=t.minY}function v(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(t,e,i,n,r){for(var o,a=[e,i];a.length;)(i=a.pop())-(e=a.pop())<=n||(o=e+Math.ceil((i-e)/n/2)*n,s(t,o,e,i,r),a.push(e,o,o,i))}n.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],s=this.toBBox;if(!f(t,e))return i;for(var n,r,o,a,h=[];e;){for(n=0,r=e.children.length;n=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(n,r,e)},_split:function(t,e){var i=t[e],s=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,s);var r=this._chooseSplitIndex(i,n,s),a=v(i.children.splice(r,i.children.length-r));a.height=i.height,a.leaf=i.leaf,o(i,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(t,e){this.data=v([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var s,n,r,o,h,l,u,d,p,f,v,g,m,y;for(l=u=1/0,s=e;s<=i-e;s++)n=a(t,0,s,this.toBBox),r=a(t,s,i,this.toBBox),p=n,f=r,v=void 0,g=void 0,m=void 0,y=void 0,v=Math.max(p.minX,f.minX),g=Math.max(p.minY,f.minY),m=Math.min(p.maxX,f.maxX),y=Math.min(p.maxY,f.maxY),o=Math.max(0,m-v)*Math.max(0,y-g),h=c(n)+c(r),o=e;n--)r=t.children[n],h(u,t.leaf?o(r):r),c+=d(u);return c},_adjustParentBBoxes:function(t,e,i){for(var s=i;s>=0;s--)h(e[s],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():o(t[i],this.toBBox)},compareMinX:function(t,e){return t.left-e.left},compareMinY:function(t,e){return t.top-e.top},toBBox:function(t){return{minX:t.left,minY:t.top,maxX:t.right,maxY:t.bottom}}},t.exports=n},58403:(t,e,i)=>{var s=new(i(56694))({initialize:function(t){if(this.entries=[],Array.isArray(t))for(var e=0;e-1&&this.entries.splice(e,1),this},dump:function(){console.group("Set");for(var t=0;t-1},union:function(t){var e=new s;return t.entries.forEach((function(t){e.set(t)})),this.entries.forEach((function(t){e.set(t)})),e},intersect:function(t){var e=new s;return this.entries.forEach((function(i){t.contains(i)&&e.set(i)})),e},difference:function(t){var e=new s;return this.entries.forEach((function(i){t.contains(i)||e.set(i)})),e},size:{get:function(){return this.entries.length},set:function(t){return t{var s=i(82897),n=i(56694),r=i(84314),o=i(93736),a=new n({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===s&&(s=null),this._width=t,this._height=e,this._parent=s,this.aspectMode=i,this.aspectRatio=0===e?1:t/e,this.minWidth=0,this.minHeight=0,this.maxWidth=Number.MAX_VALUE,this.maxHeight=Number.MAX_VALUE,this.snapTo=new o},setAspectMode:function(t){return void 0===t&&(t=0),this.aspectMode=t,this.setSize(this._width,this._height)},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.snapTo.set(t,e),this.setSize(this._width,this._height)},setParent:function(t){return this._parent=t,this.setSize(this._width,this._height)},setMin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.minWidth=s(t,0,this.maxWidth),this.minHeight=s(e,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(t,e){return void 0===t&&(t=Number.MAX_VALUE),void 0===e&&(e=t),this.maxWidth=s(t,this.minWidth,Number.MAX_VALUE),this.maxHeight=s(e,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(t,e){switch(void 0===t&&(t=0),void 0===e&&(e=t),this.aspectMode){case a.NONE:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height;break;case a.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case a.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(r(e,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case a.FIT:this.constrain(t,e,!0);break;case a.ENVELOP:this.constrain(t,e,!1)}return this},setAspectRatio:function(t){return this.aspectRatio=t,this.setSize(this._width,this._height)},resize:function(t,e){return this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height,this},getNewWidth:function(t,e){return void 0===e&&(e=!0),t=s(t,this.minWidth,this.maxWidth),e&&this._parent&&t>this._parent.width&&(t=Math.max(this.minWidth,this._parent.width)),t},getNewHeight:function(t,e){return void 0===e&&(e=!0),t=s(t,this.minHeight,this.maxHeight),e&&this._parent&&t>this._parent.height&&(t=Math.max(this.minHeight,this._parent.height)),t},constrain:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=!0),t=this.getNewWidth(t),e=this.getNewHeight(e);var s=this.snapTo,n=0===e?1:t/e;return i&&this.aspectRatio>n||!i&&this.aspectRatio0&&(t=(e=r(e,s.y))*this.aspectRatio)):(i&&this.aspectRation)&&(t=(e=r(e,s.y))*this.aspectRatio,s.x>0&&(e=(t=r(t,s.x))*(1/this.aspectRatio))),this._width=t,this._height=e,this},fitTo:function(t,e){return this.constrain(t,e,!0)},envelop:function(t,e){return this.constrain(t,e,!1)},setWidth:function(t){return this.setSize(t,this._height)},setHeight:function(t){return this.setSize(this._width,t)},toString:function(){return"[{ Size (width="+this._width+" height="+this._height+" aspectRatio="+this.aspectRatio+" aspectMode="+this.aspectMode+") }]"},setCSS:function(t){t&&t.style&&(t.style.width=this._width+"px",t.style.height=this._height+"px")},copy:function(t){return t.setAspectMode(this.aspectMode),t.aspectRatio=this.aspectRatio,t.setSize(this.width,this.height)},destroy:function(){this._parent=null,this.snapTo=null},width:{get:function(){return this._width},set:function(t){this.setSize(t,this._height)}},height:{get:function(){return this._height},set:function(t){this.setSize(this._width,t)}}});a.NONE=0,a.WIDTH_CONTROLS_HEIGHT=1,a.HEIGHT_CONTROLS_WIDTH=2,a.FIT=3,a.ENVELOP=4,t.exports=a},94160:t=>{t.exports="add"},95393:t=>{t.exports="remove"},36716:(t,e,i)=>{t.exports={PROCESS_QUEUE_ADD:i(94160),PROCESS_QUEUE_REMOVE:i(95393)}},20010:(t,e,i)=>{t.exports={Events:i(36716),List:i(71207),Map:i(33885),ProcessQueue:i(74623),RTree:i(68687),Set:i(58403),Size:i(90881)}},17487:(t,e,i)=>{var s=i(56694),n=i(82897),r=i(27119),o=i(86459),a=i(28621),h=i(31673),l=new s({Extends:h,initialize:function(t,e,i,s,n){h.call(this,t,e,i,s,n),this.add("__BASE",0,0,0,s,n),this._source=this.frames.__BASE.source,this.canvas=this._source.image,this.context=this.canvas.getContext("2d"),this.width=s,this.height=n,this.imageData=this.context.getImageData(0,0,s,n),this.data=null,this.imageData&&(this.data=this.imageData.data),this.pixels=null,this.buffer,this.data&&(this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data)},update:function(){return this.imageData=this.context.getImageData(0,0,this.width,this.height),this.data=this.imageData.data,this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data,this.manager.game.config.renderType===o.WEBGL&&this.refresh(),this},draw:function(t,e,i){return this.context.drawImage(i,t,e),this.update()},drawFrame:function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=0);var n=this.manager.getFrame(t,e);if(n){var r=n.canvasData,o=n.cutWidth,a=n.cutHeight,h=n.source.resolution;return this.context.drawImage(n.source.image,r.x,r.y,o,a,i,s,o/h,a/h),this.update()}return this},setPixel:function(t,e,i,s,n,r){if(void 0===r&&(r=255),t=Math.abs(Math.floor(t)),e=Math.abs(Math.floor(e)),this.getIndex(t,e)>-1){var o=this.context.getImageData(t,e,1,1);o.data[0]=i,o.data[1]=s,o.data[2]=n,o.data[3]=r,this.context.putImageData(o,t,e)}return this},putData:function(t,e,i,s,n,r,o){return void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=t.width),void 0===o&&(o=t.height),this.context.putImageData(t,e,i,s,n,r,o),this},getData:function(t,e,i,s){return t=n(Math.floor(t),0,this.width-1),e=n(Math.floor(e),0,this.height-1),i=n(i,1,this.width-t),s=n(s,1,this.height-e),this.context.getImageData(t,e,i,s)},getPixel:function(t,e,i){i||(i=new r);var s=this.getIndex(t,e);if(s>-1){var n=this.data,o=n[s+0],a=n[s+1],h=n[s+2],l=n[s+3];i.setTo(o,a,h,l)}return i},getPixels:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===s&&(s=i),t=Math.abs(Math.round(t)),e=Math.abs(Math.round(e));for(var o=n(t,0,this.width),a=n(t+i,0,this.width),h=n(e,0,this.height),l=n(e+s,0,this.height),u=new r,c=[],d=h;d{var s=i(56694),n=i(82897),r=i(98611),o=new s({initialize:function(t,e,i,s,n,r,o){this.texture=t,this.name=e,this.source=t.source[i],this.sourceIndex=i,this.glTexture=this.source.glTexture,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0}},this.setSize(r,o,s,n)},setSize:function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=0),this.cutX=i,this.cutY=s,this.cutWidth=t,this.cutHeight=e,this.width=t,this.height=e,this.halfWidth=Math.floor(.5*t),this.halfHeight=Math.floor(.5*e),this.centerX=Math.floor(t/2),this.centerY=Math.floor(e/2);var n=this.data,r=n.cut;r.x=i,r.y=s,r.w=t,r.h=e,r.r=i+t,r.b=s+e,n.sourceSize.w=t,n.sourceSize.h=e,n.spriteSourceSize.w=t,n.spriteSourceSize.h=e,n.radius=.5*Math.sqrt(t*t+e*e);var o=n.drawImage;return o.x=i,o.y=s,o.width=t,o.height=e,this.updateUVs()},setTrim:function(t,e,i,s,n,r){var o=this.data,a=o.spriteSourceSize;return o.trim=!0,o.sourceSize.w=t,o.sourceSize.h=e,a.x=i,a.y=s,a.w=n,a.h=r,a.r=i+n,a.b=s+r,this.x=i,this.y=s,this.width=n,this.height=r,this.halfWidth=.5*n,this.halfHeight=.5*r,this.centerX=Math.floor(n/2),this.centerY=Math.floor(r/2),this.updateUVs()},setCropUVs:function(t,e,i,s,r,o,a){var h=this.cutX,l=this.cutY,u=this.cutWidth,c=this.cutHeight,d=this.realWidth,p=this.realHeight,f=h+(e=n(e,0,d)),v=l+(i=n(i,0,p)),g=s=n(s,0,d-e),m=r=n(r,0,p-i),y=this.data;if(y.trim){var x=y.spriteSourceSize,T=e+(s=n(s,0,u-e)),w=i+(r=n(r,0,c-i));if(!(x.rT||x.y>w)){var b=Math.max(x.x,e),E=Math.max(x.y,i),S=Math.min(x.r,T)-b,A=Math.min(x.b,w)-E;g=S,m=A,f=o?h+(u-(b-x.x)-S):h+(b-x.x),v=a?l+(c-(E-x.y)-A):l+(E-x.y),e=b,i=E,s=S,r=A}else f=0,v=0,g=0,m=0}else o&&(f=h+(u-e-s)),a&&(v=l+(c-i-r));var _=this.source.width,C=this.source.height;return t.u0=Math.max(0,f/_),t.v0=Math.max(0,v/C),t.u1=Math.min(1,(f+g)/_),t.v1=Math.min(1,(v+m)/C),t.x=e,t.y=i,t.cx=f,t.cy=v,t.cw=g,t.ch=m,t.width=s,t.height=r,t.flipX=o,t.flipY=a,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},setUVs:function(t,e,i,s,n,r){var o=this.data.drawImage;return o.width=t,o.height=e,this.u0=i,this.v0=s,this.u1=n,this.v1=r,this},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,s=this.cutHeight,n=this.data.drawImage;n.width=i,n.height=s;var r=this.source.width,o=this.source.height;return this.u0=t/r,this.v0=e/o,this.u1=(t+i)/r,this.v1=(e+s)/o,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new o(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=r(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.source=null,this.texture=null,this.glTexture=null,this.customData=null,this.data=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=o},31673:(t,e,i)=>{var s=i(86459),n=i(56694),r=i(82047),o=i(32547),a='Texture "%s" has no frame "%s"',h=new n({initialize:function(t,e,i,s,n){Array.isArray(i)||(i=[i]),this.manager=t,this.key=e,this.source=[],this.dataSource=[],this.frames={},this.customData={},this.firstFrame="__BASE",this.frameTotal=0;for(var r=0;r{var s=i(61068),n=i(17487),r=i(56694),o=i(27119),a=i(86459),h=i(6659),l=i(38203),u=i(97081),c=i(52780),d=i(10850),p=i(69150),f=i(31673),v=new r({Extends:h,initialize:function(t){h.call(this),this.game=t,this.name="TextureManager",this.list={},this._tempCanvas=s.create2D(this),this._tempContext=this._tempCanvas.getContext("2d",{willReadFrequently:!0}),this._pending=0,t.events.once(u.BOOT,this.boot,this)},boot:function(){this._pending=3,this.on(l.LOAD,this.updatePending,this),this.on(l.ERROR,this.updatePending,this);var t=this.game.config;this.addBase64("__DEFAULT",t.defaultImage),this.addBase64("__MISSING",t.missingImage),this.addBase64("__WHITE",t.whiteImage),this.game.events.once(u.DESTROY,this.destroy,this)},updatePending:function(){this._pending--,0===this._pending&&(this.off(l.LOAD),this.off(l.ERROR),this.emit(l.READY))},checkKey:function(t){return!this.exists(t)||(console.error("Texture key already in use: "+t),!1)},remove:function(t){if("string"==typeof t){if(!this.exists(t))return console.warn("No texture found matching key: "+t),this;t=this.get(t)}return this.list.hasOwnProperty(t.key)&&(t.destroy(),this.emit(l.REMOVE,t.key),this.emit(l.REMOVE_KEY+t.key)),this},removeKey:function(t){return this.list.hasOwnProperty(t)&&delete this.list[t],this},addBase64:function(t,e){if(this.checkKey(t)){var i=this,s=new Image;s.onerror=function(){i.emit(l.ERROR,t)},s.onload=function(){var e=i.create(t,s);p.Image(e,0),i.emit(l.ADD,t,e),i.emit(l.ADD_KEY+t,e),i.emit(l.LOAD,t,e)},s.src=e}return this},getBase64:function(t,e,i,n){void 0===i&&(i="image/png"),void 0===n&&(n=.92);var r="",o=this.getFrame(t,e);if(o&&(o.source.isRenderTexture||o.source.isGLTexture))console.warn("Cannot getBase64 from WebGL Texture");else if(o){var a=o.canvasData,h=s.create2D(this,a.width,a.height),l=h.getContext("2d");a.width>0&&a.height>0&&l.drawImage(o.source.image,a.x,a.y,a.width,a.height,0,0,a.width,a.height),r=h.toDataURL(i,n),s.remove(h)}return r},addImage:function(t,e,i){var s=null;return this.checkKey(t)&&(s=this.create(t,e),p.Image(s,0),i&&s.setDataSource(i),this.emit(l.ADD,t,s),this.emit(l.ADD_KEY+t,s)),s},addGLTexture:function(t,e,i,s){var n=null;return this.checkKey(t)&&(void 0===i&&(i=e.width),void 0===s&&(s=e.height),(n=this.create(t,e,i,s)).add("__BASE",0,0,0,i,s),this.emit(l.ADD,t,n),this.emit(l.ADD_KEY+t,n)),n},addCompressedTexture:function(t,e,i){var s=null;if(this.checkKey(t)){if((s=this.create(t,e)).add("__BASE",0,0,0,e.width,e.height),i)if(Array.isArray(i))for(var n=0;n=r.x&&t=r.y&&e=r.x&&t=r.y&&e{var s=i(61068),n=i(56694),r=i(28621),o=i(27394),a=new n({initialize:function(t,e,i,s,n){void 0===n&&(n=!1);var a=t.manager.game;this.renderer=a.renderer,this.texture=t,this.source=e,this.image=e.compressed?null:e,this.compressionAlgorithm=e.compressed?e.format:null,this.resolution=1,this.width=i||e.naturalWidth||e.videoWidth||e.width||0,this.height=s||e.naturalHeight||e.videoHeight||e.height||0,this.scaleMode=o.DEFAULT,this.isCanvas=e instanceof HTMLCanvasElement,this.isVideo=window.hasOwnProperty("HTMLVideoElement")&&e instanceof HTMLVideoElement,this.isRenderTexture="RenderTexture"===e.type,this.isGLTexture=window.hasOwnProperty("WebGLTexture")&&e instanceof WebGLTexture,this.isPowerOf2=r(this.width,this.height),this.glTexture=null,this.glIndex=0,this.glIndexCounter=-1,this.flipY=n,this.init(a)},init:function(t){var e=this.renderer;e&&(e.gl?this.isCanvas?this.glTexture=e.createCanvasTexture(this.image,!1,this.flipY):this.isVideo?this.glTexture=e.createVideoTexture(this.image,!1,this.flipY):this.isRenderTexture?(this.image=this.source.canvas,this.glTexture=e.createTextureFromSource(null,this.width,this.height,this.scaleMode)):this.isGLTexture?this.glTexture=this.source:this.compressionAlgorithm?this.glTexture=e.createTextureFromSource(this.source):this.glTexture=e.createTextureFromSource(this.image,this.width,this.height,this.scaleMode):this.isRenderTexture&&(this.image=this.source.canvas)),t.config.antialias||this.setFilter(1)},setFilter:function(t){this.renderer.gl&&this.renderer.setTextureFilter(this.glTexture,t),this.scaleMode=t},setFlipY:function(t){return void 0===t&&(t=!0),this.flipY=t,this},update:function(){var t=this.renderer.gl;t&&this.isCanvas?this.glTexture=this.renderer.updateCanvasTexture(this.image,this.glTexture,this.flipY):t&&this.isVideo&&(this.glTexture=this.renderer.updateVideoTexture(this.image,this.glTexture,this.flipY))},destroy:function(){this.glTexture&&this.renderer.deleteTexture(this.glTexture,!0),this.isCanvas&&s.remove(this.image),this.renderer=null,this.texture=null,this.source=null,this.image=null,this.glTexture=null}});t.exports=a},65154:t=>{t.exports={LINEAR:0,NEAREST:1}},49644:t=>{t.exports="addtexture"},29569:t=>{t.exports="addtexture-"},60079:t=>{t.exports="onerror"},72665:t=>{t.exports="onload"},93006:t=>{t.exports="ready"},69018:t=>{t.exports="removetexture"},85549:t=>{t.exports="removetexture-"},38203:(t,e,i)=>{t.exports={ADD:i(49644),ADD_KEY:i(29569),ERROR:i(60079),LOAD:i(72665),READY:i(93006),REMOVE:i(69018),REMOVE_KEY:i(85549)}},87499:(t,e,i)=>{var s=i(98611),n=i(65154),r={CanvasTexture:i(17487),Events:i(38203),FilterMode:n,Frame:i(82047),Parsers:i(69150),Texture:i(31673),TextureManager:i(6237),TextureSource:i(32547)};r=s(!1,r,n),t.exports=r},35082:t=>{t.exports=function(t,e,i){if(i.getElementsByTagName("TextureAtlas")){var s=t.source[e];t.add("__BASE",e,0,0,s.width,s.height);for(var n,r=i.getElementsByTagName("SubTexture"),o=0;o{t.exports=function(t,e){var i=t.source[e];return t.add("__BASE",e,0,0,i.width,i.height),t}},21560:t=>{t.exports=function(t,e){var i=t.source[e];return t.add("__BASE",e,0,0,i.width,i.height),t}},64423:(t,e,i)=>{var s=i(32742);t.exports=function(t,e,i){if(i.frames||i.textures){var n=t.source[e];t.add("__BASE",e,0,0,n.width,n.height);for(var r,o=Array.isArray(i.textures)?i.textures[e].frames:i.frames,a=0;a{var s=i(32742);t.exports=function(t,e,i){if(i.frames){var n=t.source[e];t.add("__BASE",e,0,0,n.width,n.height);var r,o=i.frames;for(var a in o)if(o.hasOwnProperty(a)){var h=o[a];if(r=t.add(a,e,h.frame.x,h.frame.y,h.frame.w,h.frame.h)){h.trimmed&&r.setTrim(h.sourceSize.w,h.sourceSize.h,h.spriteSourceSize.x,h.spriteSourceSize.y,h.spriteSourceSize.w,h.spriteSourceSize.h),h.rotated&&(r.rotated=!0,r.updateUVsInverted());var l=h.anchor||h.pivot;l&&(r.customPivot=!0,r.pivotX=l.x,r.pivotY=l.y),r.customData=s(h)}else console.warn("Invalid atlas json, frame already exists: "+a)}for(var u in i)"frames"!==u&&(Array.isArray(i[u])?t.customData[u]=i[u].slice(0):t.customData[u]=i[u]);return t}console.warn("Invalid Texture Atlas JSON Hash given, missing 'frames' Object")}},67409:t=>{t.exports=function(t){var e,i=[171,75,84,88,32,49,49,187,13,10,26,10],s=new Uint8Array(t,0,12);for(e=0;e>1),v=Math.max(1,v>>1),p+=g}return{mipmaps:d,width:h,height:l,internalFormat:a,compressed:!0,generateMipmap:!1}}console.warn("KTXParser - Only compressed formats supported")}},24904:t=>{function e(t,e,i,s,n,r,o){return void 0===o&&(o=16),Math.floor((t+i)/n)*Math.floor((e+s)/r)*o}function i(t,e){return(t=Math.max(t,16))*(e=Math.max(e,8))/4}function s(t,e){return(t=Math.max(t,8))*(e=Math.max(e,8))/2}function n(t,i){return e(t,i,3,3,4,4,8)}function r(t,i){return e(t,i,3,3,4,4)}var o={0:{sizeFunc:i,glFormat:35841},1:{sizeFunc:i,glFormat:35843},2:{sizeFunc:s,glFormat:35840},3:{sizeFunc:s,glFormat:35842},6:{sizeFunc:n,glFormat:36196},7:{sizeFunc:n,glFormat:33776},8:{sizeFunc:r,glFormat:33777},9:{sizeFunc:r,glFormat:33778},11:{sizeFunc:r,glFormat:33779},22:{sizeFunc:n,glFormat:37492},23:{sizeFunc:r,glFormat:37496},24:{sizeFunc:n,glFormat:37494},25:{sizeFunc:n,glFormat:37488},26:{sizeFunc:r,glFormat:37490},27:{sizeFunc:r,glFormat:37808},28:{sizeFunc:function(t,i){return e(t,i,4,3,5,4)},glFormat:37809},29:{sizeFunc:function(t,i){return e(t,i,4,4,5,5)},glFormat:37810},30:{sizeFunc:function(t,i){return e(t,i,5,4,6,5)},glFormat:37811},31:{sizeFunc:function(t,i){return e(t,i,5,5,6,6)},glFormat:37812},32:{sizeFunc:function(t,i){return e(t,i,7,4,8,5)},glFormat:37813},33:{sizeFunc:function(t,i){return e(t,i,7,5,8,6)},glFormat:37814},34:{sizeFunc:function(t,i){return e(t,i,7,7,8,8)},glFormat:37815},35:{sizeFunc:function(t,i){return e(t,i,9,4,10,5)},glFormat:37816},36:{sizeFunc:function(t,i){return e(t,i,9,5,10,6)},glFormat:37817},37:{sizeFunc:function(t,i){return e(t,i,9,7,10,8)},glFormat:37818},38:{sizeFunc:function(t,i){return e(t,i,9,9,10,10)},glFormat:37819},39:{sizeFunc:function(t,i){return e(t,i,11,9,12,10)},glFormat:37820},40:{sizeFunc:function(t,i){return e(t,i,11,11,12,12)},glFormat:37821}};t.exports=function(t){for(var e=new Uint32Array(t,0,13),i=e[2],s=o[i].glFormat,n=o[i].sizeFunc,r=e[11],a=e[7],h=e[6],l=52+e[12],u=new Uint8Array(t,l),c=new Array(r),d=0,p=a,f=h,v=0;v>1),f=Math.max(1,f>>1),d+=g}return{mipmaps:c,width:a,height:h,internalFormat:s,compressed:!0,generateMipmap:!1}}},6143:(t,e,i)=>{var s=i(72632);t.exports=function(t,e,i,n,r,o,a){var h=s(a,"frameWidth",null),l=s(a,"frameHeight",h);if(null===h)throw new Error("TextureManager.SpriteSheet: Invalid frameWidth given.");var u=t.source[e];t.add("__BASE",e,0,0,u.width,u.height);var c=s(a,"startFrame",0),d=s(a,"endFrame",-1),p=s(a,"margin",0),f=s(a,"spacing",0),v=Math.floor((r-p+f)/(h+f))*Math.floor((o-p+f)/(l+f));0===v&&console.warn("SpriteSheet frame dimensions will result in zero frames for texture:",t.key),(c>v||c<-v)&&(c=0),c<0&&(c=v+c),-1!==d&&(v=c+(d+1));for(var g=p,m=p,y=0,x=0,T=0;Tr&&(y=w-r),b>o&&(x=b-o),t.add(T,e,i+g,n+m,h-y,l-x),(g+=h+f)+h>r&&(g=p,m+=l+f)}return t}},20030:(t,e,i)=>{var s=i(72632);t.exports=function(t,e,i){var n=s(i,"frameWidth",null),r=s(i,"frameHeight",n);if(!n)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var o=t.source[0];t.add("__BASE",0,0,0,o.width,o.height);var a,h=s(i,"startFrame",0),l=s(i,"endFrame",-1),u=s(i,"margin",0),c=s(i,"spacing",0),d=e.cutX,p=e.cutY,f=e.cutWidth,v=e.cutHeight,g=e.realWidth,m=e.realHeight,y=Math.floor((g-u+c)/(n+c)),x=Math.floor((m-u+c)/(r+c)),T=y*x,w=e.x,b=n-w,E=n-(g-f-w),S=e.y,A=r-S,_=r-(m-v-S);(h>T||h<-T)&&(h=0),h<0&&(h=T+h),-1!==l&&(T=h+(l+1));for(var C=u,R=u,M=0,P=e.sourceIndex,O=0;O{var e=0,i=function(t,i,s,n){var r=e-n.y-n.height;t.add(s,i,n.x,r,n.width,n.height)};t.exports=function(t,s,n){var r=t.source[s];t.add("__BASE",s,0,0,r.width,r.height),e=r.height;for(var o=n.split("\n"),a=/^[ ]*(- )*(\w+)+[: ]+(.*)/,h="",l="",u={x:0,y:0,width:0,height:0},c=0;c{t.exports={AtlasXML:i(35082),Canvas:i(83332),Image:i(21560),JSONArray:i(64423),JSONHash:i(17264),KTXParser:i(67409),PVRParser:i(24904),SpriteSheet:i(6143),SpriteSheetFromAtlas:i(20030),UnityYAML:i(89187)}},93560:t=>{t.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}},97042:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s,n,r,o){(void 0===i||i<=0)&&(i=32),(void 0===s||s<=0)&&(s=32),void 0===n&&(n=0),void 0===r&&(r=0),this.name=t,this.firstgid=0|e,this.imageWidth=0|i,this.imageHeight=0|s,this.imageMargin=0|n,this.imageSpacing=0|r,this.properties=o||{},this.images=[],this.total=0},containsImageIndex:function(t){return t>=this.firstgid&&t{var s=new(i(56694))({initialize:function(t){if(this.gids=[],void 0!==t)for(var e=0;e{var s=i(93560),n=i(16586),r=i(90715),o=i(89797);t.exports=function(t,e,i,a,h,l,u,c){void 0===i&&(i=32),void 0===a&&(a=32),void 0===h&&(h=10),void 0===l&&(l=10),void 0===c&&(c=!1);var d=null;if(Array.isArray(u))d=r(void 0!==e?e:"map",s.ARRAY_2D,u,i,a,c);else if(void 0!==e){var p=t.cache.tilemap.get(e);p?d=r(e,p.format,p.data,i,a,c):console.warn("No map data found for key "+e)}return null===d&&(d=new n({tileWidth:i,tileHeight:a,width:h,height:l})),new o(t,d)}},29633:(t,e,i)=>{var s=i(12920),n=i(56694),r=i(64937),o=i(66658),a=new n({Mixins:[r.Alpha,r.Flip,r.Visible],initialize:function(t,e,i,s,n,r,o,a){this.layer=t,this.index=e,this.x=i,this.y=s,this.width=n,this.height=r,this.right,this.bottom,this.baseWidth=void 0!==o?o:n,this.baseHeight=void 0!==a?a:r,this.pixelX=0,this.pixelY=0,this.updatePixelXY(),this.properties={},this.rotation=0,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceLeft=!1,this.faceRight=!1,this.faceTop=!1,this.faceBottom=!1,this.collisionCallback=void 0,this.collisionCallbackContext=this,this.tint=16777215,this.physics={}},containsPoint:function(t,e){return!(tthis.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=t.properties,this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldXY(this.x,this.y,void 0,t).x:this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldXY(this.x,this.y,void 0,t).y:this.y*this.baseWidth-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new o),e.x=this.getLeft(t),e.y=this.getTop(t),e.width=this.getRight(t)-e.x,e.height=this.getBottom(t)-e.y,e},getCenterX:function(t){return(this.getLeft(t)+this.getRight(t))/2},getCenterY:function(t){return(this.getTop(t)+this.getBottom(t))/2},intersects:function(t,e,i,s){return!(i<=this.pixelX||s<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){(void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,s,n){(void 0===e&&(e=t),void 0===i&&(i=t),void 0===s&&(s=t),void 0===n&&(n=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=s,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=s,n)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,s){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==s&&(this.baseHeight=s),this.updatePixelXY(),this},updatePixelXY:function(){var t=this.layer.orientation;if(t===s.ORTHOGONAL)this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight;else if(t===s.ISOMETRIC)this.pixelX=(this.x-this.y)*this.baseWidth*.5,this.pixelY=(this.x+this.y)*this.baseHeight*.5;else if(t===s.STAGGERED)this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*(this.baseHeight/2);else if(t===s.HEXAGONAL){var e=this.layer.hexSideLength,i=(this.baseHeight-e)/2+e;this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*i}return this.right=this.pixelX+this.baseWidth,this.bottom=this.pixelY+this.baseHeight,this},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||void 0!==this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.layer.tilemapLayer;if(t){var e=t.gidMap[this.index];if(e)return e}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=a},89797:(t,e,i)=>{var s=i(56694),n=i(75606),r=i(93560),o=i(72632),a=i(94990),h=i(46422),l=i(12920),u=i(52257),c=i(72677),d=i(13747),p=i(29633),f=i(5047),v=i(87177),g=i(47975),m=new s({initialize:function(t,e){this.scene=t,this.tileWidth=e.tileWidth,this.tileHeight=e.tileHeight,this.width=e.width,this.height=e.height,this.orientation=e.orientation,this.renderOrder=e.renderOrder,this.format=e.format,this.version=e.version,this.properties=e.properties,this.widthInPixels=e.widthInPixels,this.heightInPixels=e.heightInPixels,this.imageCollections=e.imageCollections,this.images=e.images,this.layers=e.layers,this.tilesets=e.tilesets,this.objects=e.objects,this.currentLayerIndex=0,this.hexSideLength=e.hexSideLength;var i=this.orientation;this._convert={WorldToTileXY:f.GetWorldToTileXYFunction(i),WorldToTileX:f.GetWorldToTileXFunction(i),WorldToTileY:f.GetWorldToTileYFunction(i),TileToWorldXY:f.GetTileToWorldXYFunction(i),TileToWorldX:f.GetTileToWorldXFunction(i),TileToWorldY:f.GetTileToWorldYFunction(i)}},setRenderOrder:function(t){var e=["right-down","left-down","right-up","left-up"];return"number"==typeof t&&(t=e[t]),e.indexOf(t)>-1&&(this.renderOrder=t),this},addTilesetImage:function(t,e,i,s,n,o,a){if(void 0===t)return null;if(null==e&&(e=t),!this.scene.sys.textures.exists(e))return console.warn("Invalid Tileset Image: "+e),null;var h=this.scene.sys.textures.get(e),l=this.getTilesetIndex(t);if(null===l&&this.format===r.TILED_JSON)return console.warn("No data found for Tileset: "+t),null;var u=this.tilesets[l];return u?(u.setTileSize(i,s),u.setSpacing(n,o),u.setImage(h),u):(void 0===i&&(i=this.tileWidth),void 0===s&&(s=this.tileHeight),void 0===n&&(n=0),void 0===o&&(o=0),void 0===a&&(a=0),(u=new g(t,a,i,s,n,o)).setImage(h),this.tilesets.push(u),u)},copy:function(t,e,i,s,n,r,o,a){return null!==(a=this.getLayer(a))?(f.Copy(t,e,i,s,n,r,o,a),this):null},createBlankLayer:function(t,e,i,s,n,r,o,h){if(void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=this.width),void 0===r&&(r=this.height),void 0===o&&(o=this.tileWidth),void 0===h&&(h=this.tileHeight),null!==this.getLayerIndex(t))return console.warn("Invalid Tilemap Layer ID: "+t),null;for(var l,u=new a({name:t,tileWidth:o,tileHeight:h,width:n,height:r,orientation:this.orientation}),c=0;c-1&&this.putTileAt(e,r.x,r.y,i,r.tilemapLayer)}return s},removeTileAt:function(t,e,i,s,n){return void 0===i&&(i=!0),void 0===s&&(s=!0),null===(n=this.getLayer(n))?null:f.RemoveTileAt(t,e,i,s,n)},removeTileAtWorldXY:function(t,e,i,s,n,r){return void 0===i&&(i=!0),void 0===s&&(s=!0),null===(r=this.getLayer(r))?null:f.RemoveTileAtWorldXY(t,e,i,s,n,r)},renderDebug:function(t,e,i){return null===(i=this.getLayer(i))?null:(this.orientation===l.ORTHOGONAL&&f.RenderDebug(t,e,i),this)},renderDebugFull:function(t,e){for(var i=this.layers,s=0;s{var s=i(99325),n=i(15043);s.register("tilemap",(function(t){var e=void 0!==t?t:{};return n(this.scene,e.key,e.tileWidth,e.tileHeight,e.width,e.height,e.data,e.insertNull)}))},37940:(t,e,i)=>{var s=i(61286),n=i(15043);s.register("tilemap",(function(t,e,i,s,r,o,a){return null===t&&(t=void 0),null===e&&(e=void 0),null===i&&(i=void 0),null===s&&(s=void 0),null===r&&(r=void 0),n(this.scene,t,e,i,s,r,o,a)}))},87177:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(89980),o=i(5047),a=i(96193),h=new s({Extends:r,Mixins:[n.Alpha,n.BlendMode,n.ComputedSize,n.Depth,n.Flip,n.GetBounds,n.Mask,n.Origin,n.Pipeline,n.Transform,n.Visible,n.ScrollFactor,a],initialize:function(t,e,i,s,n,a){r.call(this,t,"TilemapLayer"),this.isTilemap=!0,this.tilemap=e,this.layerIndex=i,this.layer=e.layers[i],this.layer.tilemapLayer=this,this.tileset=[],this.tilesDrawn=0,this.tilesTotal=this.layer.width*this.layer.height,this.culledTiles=[],this.skipCull=!1,this.cullPaddingX=1,this.cullPaddingY=1,this.cullCallback=o.GetCullTilesFunction(this.layer.orientation),this._renderOrder=0,this.gidMap=[],this.setTilesets(s),this.setAlpha(this.layer.alpha),this.setPosition(n,a),this.setOrigin(0,0),this.setSize(e.tileWidth*this.layer.width,e.tileHeight*this.layer.height),this.initPipeline()},setTilesets:function(t){var e=[],i=[],s=this.tilemap;Array.isArray(t)||(t=[t]);for(var n=0;n=0&&t<4&&(this._renderOrder=t),this},calculateFacesAt:function(t,e){return o.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,s){return o.CalculateFacesWithin(t,e,i,s,this.layer),this},createFromTiles:function(t,e,i,s,n){return o.CreateFromTiles(t,e,i,s,n,this.layer)},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles,this._renderOrder)},copy:function(t,e,i,s,n,r,a){return o.Copy(t,e,i,s,n,r,a,this.layer),this},fill:function(t,e,i,s,n,r){return o.Fill(t,e,i,s,n,r,this.layer),this},filterTiles:function(t,e,i,s,n,r,a){return o.FilterTiles(t,e,i,s,n,r,a,this.layer)},findByIndex:function(t,e,i){return o.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,s,n,r,a){return o.FindTile(t,e,i,s,n,r,a,this.layer)},forEachTile:function(t,e,i,s,n,r,a){return o.ForEachTile(t,e,i,s,n,r,a,this.layer),this},setTint:function(t,e,i,s,n,r){void 0===t&&(t=16777215);return this.forEachTile((function(e){e.tint=t}),this,e,i,s,n,r)},getTileAt:function(t,e,i){return o.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,s){return o.GetTileAtWorldXY(t,e,i,s,this.layer)},getTilesWithin:function(t,e,i,s,n){return o.GetTilesWithin(t,e,i,s,n,this.layer)},getTilesWithinShape:function(t,e,i){return o.GetTilesWithinShape(t,e,i,this.layer)},getTilesWithinWorldXY:function(t,e,i,s,n,r){return o.GetTilesWithinWorldXY(t,e,i,s,n,r,this.layer)},hasTileAt:function(t,e){return o.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return o.HasTileAtWorldXY(t,e,i,this.layer)},putTileAt:function(t,e,i,s){return o.PutTileAt(t,e,i,s,this.layer)},putTileAtWorldXY:function(t,e,i,s,n){return o.PutTileAtWorldXY(t,e,i,s,n,this.layer)},putTilesAt:function(t,e,i,s){return o.PutTilesAt(t,e,i,s,this.layer),this},randomize:function(t,e,i,s,n){return o.Randomize(t,e,i,s,n,this.layer),this},removeTileAt:function(t,e,i,s){return o.RemoveTileAt(t,e,i,s,this.layer)},removeTileAtWorldXY:function(t,e,i,s,n){return o.RemoveTileAtWorldXY(t,e,i,s,n,this.layer)},renderDebug:function(t,e){return o.RenderDebug(t,e,this.layer),this},replaceByIndex:function(t,e,i,s,n,r){return o.ReplaceByIndex(t,e,i,s,n,r,this.layer),this},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},setCollision:function(t,e,i,s){return o.SetCollision(t,e,i,this.layer,s),this},setCollisionBetween:function(t,e,i,s){return o.SetCollisionBetween(t,e,i,s,this.layer),this},setCollisionByProperty:function(t,e,i){return o.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return o.SetCollisionByExclusion(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return o.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileIndexCallback:function(t,e,i){return o.SetTileIndexCallback(t,e,i,this.layer),this},setTileLocationCallback:function(t,e,i,s,n,r){return o.SetTileLocationCallback(t,e,i,s,n,r,this.layer),this},shuffle:function(t,e,i,s){return o.Shuffle(t,e,i,s,this.layer),this},swapByIndex:function(t,e,i,s,n,r){return o.SwapByIndex(t,e,i,s,n,r,this.layer),this},tileToWorldX:function(t,e){return this.tilemap.tileToWorldX(t,e,this)},tileToWorldY:function(t,e){return this.tilemap.tileToWorldY(t,e,this)},tileToWorldXY:function(t,e,i,s){return this.tilemap.tileToWorldXY(t,e,i,s,this)},weightedRandomize:function(t,e,i,s,n){return o.WeightedRandomize(e,i,s,n,t,this.layer),this},worldToTileX:function(t,e,i){return this.tilemap.worldToTileX(t,e,i,this)},worldToTileY:function(t,e,i){return this.tilemap.worldToTileY(t,e,i,this)},worldToTileXY:function(t,e,i,s,n){return this.tilemap.worldToTileXY(t,e,i,s,n,this)},destroy:function(t){void 0===t&&(t=!0),this.tilemap&&(this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),t&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.culledTiles.length=0,this.cullCallback=null,this.gidMap=[],this.tileset=[],r.prototype.destroy.call(this))}});t.exports=h},17394:(t,e,i)=>{var s=i(69360),n=new s,r=new s,o=new s;t.exports=function(t,e,i,s){var a=e.cull(i),h=a.length,l=i.alpha*e.alpha;if(!(0===h||l<=0)){var u=n,c=r,d=o;c.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),u.copyFrom(i.matrix);var p=t.currentContext,f=e.gidMap;p.save(),s?(u.multiplyWithOffset(s,-i.scrollX*e.scrollFactorX,-i.scrollY*e.scrollFactorY),c.e=e.x,c.f=e.y,u.multiply(c,d),d.copyToContext(p)):(c.e-=i.scrollX*e.scrollFactorX,c.f-=i.scrollY*e.scrollFactorY,c.copyToContext(p)),(!t.antialias||e.scaleX>1||e.scaleY>1)&&(p.imageSmoothingEnabled=!1);for(var v=0;v{var s=i(72283),n=s,r=s;n=i(51395),r=i(17394),t.exports={renderWebGL:n,renderCanvas:r}},51395:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i){var n=e.cull(i),r=n.length,o=i.alpha*e.alpha;if(!(0===r||o<=0)){var a=e.gidMap,h=t.pipelines.set(e.pipeline,e),l=s.getTintAppendFloatAlpha,u=e.scrollFactorX,c=e.scrollFactorY,d=e.x,p=e.y,f=e.scaleX,v=e.scaleY;t.pipelines.preBatch(e);for(var g=0;g{var s=i(56694),n=i(93736),r=new s({initialize:function(t,e,i,s,r,o,a,h,l){(void 0===i||i<=0)&&(i=32),(void 0===s||s<=0)&&(s=32),void 0===r&&(r=0),void 0===o&&(o=0),void 0===a&&(a={}),void 0===h&&(h={}),this.name=t,this.firstgid=e,this.tileWidth=i,this.tileHeight=s,this.tileMargin=r,this.tileSpacing=o,this.tileProperties=a,this.tileData=h,this.tileOffset=new n,void 0!==l&&this.tileOffset.set(l.x,l.y),this.image=null,this.glTexture=null,this.rows=0,this.columns=0,this.total=0,this.texCoordinates=[]},getTileProperties:function(t){return this.containsTileIndex(t)?this.tileProperties[t-this.firstgid]:null},getTileData:function(t){return this.containsTileIndex(t)?this.tileData[t-this.firstgid]:null},getTileCollisionGroup:function(t){var e=this.getTileData(t);return e&&e.objectgroup?e.objectgroup:null},containsTileIndex:function(t){return t>=this.firstgid&&t{var s=i(15494);t.exports=function(t,e,i){var n=s(t,e,!0,i),r=s(t,e-1,!0,i),o=s(t,e+1,!0,i),a=s(t-1,e,!0,i),h=s(t+1,e,!0,i),l=n&&n.collides;return l&&(n.faceTop=!0,n.faceBottom=!0,n.faceLeft=!0,n.faceRight=!0),r&&r.collides&&(l&&(n.faceTop=!1),r.faceBottom=!l),o&&o.collides&&(l&&(n.faceBottom=!1),o.faceTop=!l),a&&a.collides&&(l&&(n.faceLeft=!1),a.faceRight=!l),h&&h.collides&&(l&&(n.faceRight=!1),h.faceLeft=!l),n&&!n.collides&&n.resetFaces(),n}},60386:(t,e,i)=>{var s=i(15494),n=i(50811);t.exports=function(t,e,i,r,o){for(var a=null,h=null,l=null,u=null,c=n(t,e,i,r,null,o),d=0;d{var s=new(i(93736));t.exports=function(t,e,i,n){var r=i.tilemapLayer,o=r.cullPaddingX,a=r.cullPaddingY,h=r.tilemap.tileToWorldXY(t,e,s,n,r);return h.x>n.worldView.x+r.scaleX*i.tileWidth*(-o-.5)&&h.xn.worldView.y+r.scaleY*i.tileHeight*(-a-1)&&h.y{var s=i(50811),n=i(60386);t.exports=function(t,e,i,r,o,a,h,l){void 0===h&&(h=!0),t<0&&(t=0),e<0&&(e=0);for(var u=s(t,e,i,r,null,l),c=o-t,d=a-e,p=0;p=0&&f=0&&v{var s=i(50811),n=i(51202);t.exports=function(t,e,i,r,o,a){i||(i={}),Array.isArray(t)||(t=[t]);var h=a.tilemapLayer;r||(r=h.scene),o||(o=r.cameras.main);var l,u=s(0,0,a.width,a.height,null,a),c=[];for(l=0;l{var s=i(74118),n=i(82127),r=i(84314),o=new s;t.exports=function(t,e){var i=t.tilemapLayer.tilemap,s=t.tilemapLayer,a=Math.floor(i.tileWidth*s.scaleX),h=Math.floor(i.tileHeight*s.scaleY),l=r(e.worldView.x-s.x,a,0,!0)-s.cullPaddingX,u=n(e.worldView.right-s.x,a,0,!0)+s.cullPaddingX,c=r(e.worldView.y-s.y,h,0,!0)-s.cullPaddingY,d=n(e.worldView.bottom-s.y,h,0,!0)+s.cullPaddingY;return o.setTo(l,c,u-l,d-c)}},381:(t,e,i)=>{var s=i(71586),n=i(6987);t.exports=function(t,e,i,r){void 0===i&&(i=[]),void 0===r&&(r=0),i.length=0;var o=t.tilemapLayer,a=s(t,e);return(o.skipCull||1!==o.scrollFactorX||1!==o.scrollFactorY)&&(a.left=0,a.right=t.width,a.top=0,a.bottom=t.height),n(t,a,r,i),i}},97734:(t,e,i)=>{var s=i(50811),n=i(60386),r=i(68234);t.exports=function(t,e,i,o,a,h,l){for(var u=-1!==l.collideIndexes.indexOf(t),c=s(e,i,o,a,null,l),d=0;d{var s=i(50811);t.exports=function(t,e,i,n,r,o,a,h){return s(i,n,r,o,a,h).filter(t,e)}},37982:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=0),void 0===i&&(i=!1);var n,r,o,a=0;if(i){for(r=s.height-1;r>=0;r--)for(n=s.width-1;n>=0;n--)if((o=s.data[r][n])&&o.index===t){if(a===e)return o;a+=1}}else for(r=0;r{var s=i(50811);t.exports=function(t,e,i,n,r,o,a,h){return s(i,n,r,o,a,h).find(t,e)||null}},80916:(t,e,i)=>{var s=i(50811);t.exports=function(t,e,i,n,r,o,a,h){s(i,n,r,o,a,h).forEach(t,e)}},31493:(t,e,i)=>{var s=i(12920),n=i(381),r=i(37524),o=i(20887),a=i(72283),h=i(19242);t.exports=function(t){return t===s.ORTHOGONAL?n:t===s.HEXAGONAL?r:t===s.STAGGERED?h:t===s.ISOMETRIC?o:a}},15494:(t,e,i)=>{var s=i(62839);t.exports=function(t,e,i,n){if(void 0===i&&(i=!1),s(t,e,n)){var r=n.data[e][t]||null;return r?-1===r.index?i?r:null:r:null}return null}},24640:(t,e,i)=>{var s=i(15494),n=new(i(93736));t.exports=function(t,e,i,r,o){return o.tilemapLayer.worldToTileXY(t,e,!0,n,r),s(n.x,n.y,i,o)}},16884:(t,e,i)=>{var s=i(12920),n=i(72283),r=i(44150);t.exports=function(t){return t===s.ORTHOGONAL?r:n}},68182:(t,e,i)=>{var s=i(12920),n=i(21715),r=i(21808),o=i(72283),a=i(33388),h=i(46836);t.exports=function(t){return t===s.ORTHOGONAL?h:t===s.ISOMETRIC?r:t===s.HEXAGONAL?n:t===s.STAGGERED?a:o}},3752:(t,e,i)=>{var s=i(12920),n=i(37728),r=i(72283),o=i(84132),a=i(42477);t.exports=function(t){return t===s.ORTHOGONAL?a:t===s.HEXAGONAL?n:t===s.STAGGERED?o:r}},50811:(t,e,i)=>{var s=i(72632);t.exports=function(t,e,i,n,r,o){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=o.width),void 0===n&&(n=o.height),r||(r={});var a=s(r,"isNotEmpty",!1),h=s(r,"isColliding",!1),l=s(r,"hasInterestingFace",!1);t<0&&(i+=t,t=0),e<0&&(n+=e,e=0),t+i>o.width&&(i=Math.max(o.width-t,0)),e+n>o.height&&(n=Math.max(o.height-e,0));for(var u=[],c=e;c{var s=i(84068),n=i(50811),r=i(7563),o=i(72283),a=i(93736),h=function(t,e){return r.RectangleToTriangle(e,t)},l=new a,u=new a,c=new a;t.exports=function(t,e,i,a){if(void 0===t)return[];var d=o;t instanceof s.Circle?d=r.CircleToRectangle:t instanceof s.Rectangle?d=r.RectangleToRectangle:t instanceof s.Triangle?d=h:t instanceof s.Line&&(d=r.LineToRectangle),a.tilemapLayer.worldToTileXY(t.left,t.top,!0,u,i);var p=u.x,f=u.y;a.tilemapLayer.worldToTileXY(t.right,t.bottom,!1,c,i);var v=Math.ceil(c.x),g=Math.ceil(c.y),m=Math.max(v-p,1),y=Math.max(g-f,1),x=n(p,f,m,y,e,a),T=a.tileWidth,w=a.tileHeight;a.tilemapLayer&&(T*=a.tilemapLayer.scaleX,w*=a.tilemapLayer.scaleY);for(var b=[],E=new s.Rectangle(0,0,T,w),S=0;S{var s=i(50811),n=i(93736),r=new n,o=new n;t.exports=function(t,e,i,n,a,h,l){var u=l.tilemapLayer.tilemap._convert.WorldToTileXY;u(t,e,!0,r,h,l);var c=r.x,d=r.y;u(t+i,e+n,!1,o,h,l);var p=Math.ceil(o.x),f=Math.ceil(o.y);return s(c,d,p-c,f-d,a,l)}},29296:(t,e,i)=>{var s=i(12920),n=i(72283),r=i(806);t.exports=function(t){return t===s.ORTHOGONAL?r:n}},32688:(t,e,i)=>{var s=i(12920),n=i(11516),r=i(18750),o=i(72283),a=i(90562),h=i(45676);t.exports=function(t){return t===s.ORTHOGONAL?h:t===s.ISOMETRIC?r:t===s.HEXAGONAL?n:t===s.STAGGERED?a:o}},74326:(t,e,i)=>{var s=i(12920),n=i(44382),r=i(72283),o=i(3689),a=i(70520);t.exports=function(t){return t===s.ORTHOGONAL?a:t===s.HEXAGONAL?n:t===s.STAGGERED?o:r}},46598:(t,e,i)=>{var s=i(62839);t.exports=function(t,e,i){if(s(t,e,i)){var n=i.data[e][t];return null!==n&&n.index>-1}return!1}},28654:(t,e,i)=>{var s=i(46598),n=new(i(93736));t.exports=function(t,e,i,r){r.tilemapLayer.worldToTileXY(t,e,!0,n,i);var o=n.x,a=n.y;return s(o,a,r)}},6358:(t,e,i)=>{var s=i(82127),n=i(84314);t.exports=function(t,e){var i=t.tilemapLayer.tilemap,r=t.tilemapLayer,o=Math.floor(i.tileWidth*r.scaleX),a=Math.floor(i.tileHeight*r.scaleY),h=t.hexSideLength,l=(a-h)/2+h;return{left:n(e.worldView.x-r.x,o,0,!0)-r.cullPaddingX,right:s(e.worldView.right-r.x,o,0,!0)+r.cullPaddingX,top:n(e.worldView.y-r.y,l,0,!0)-r.cullPaddingY,bottom:s(e.worldView.bottom-r.y,l,0,!0)+r.cullPaddingY}}},37524:(t,e,i)=>{var s=i(6358),n=i(6987);t.exports=function(t,e,i,r){void 0===i&&(i=[]),void 0===r&&(r=0),i.length=0;var o=t.tilemapLayer;if(!o.skipCull&&1===o.scrollFactorX&&1===o.scrollFactorY){var a=s(t,e);n(t,a,r,i)}return i}},21715:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r){i||(i=new s);var o=r.baseTileWidth,a=r.baseTileHeight,h=r.tilemapLayer,l=0,u=0;h&&(n||(n=h.scene.cameras.main),l=h.x+n.scrollX*(1-h.scrollFactorX),o*=h.scaleX,u=h.y+n.scrollY*(1-h.scrollFactorY),a*=h.scaleY);var c=r.hexSideLength,d=l+t*o+e%2*(o/2),p=u+e*((a-c)/2+c);return i.set(d,p)}},37728:t=>{t.exports=function(t,e,i){var s=i.baseTileHeight,n=i.tilemapLayer,r=0;n&&(void 0===e&&(e=n.scene.cameras.main),r=n.y+e.scrollY*(1-n.scrollFactorY),s*=n.scaleY);var o=n.tilemap.hexSideLength;return r+t*((s-o)/2+o)}},11516:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r,o){n||(n=new s);var a=o.baseTileWidth,h=o.baseTileHeight,l=o.tilemapLayer;l&&(r||(r=l.scene.cameras.main),e-=l.y+r.scrollY*(1-l.scrollFactorY),h*=l.scaleY,t-=l.x+r.scrollX*(1-l.scrollFactorX),a*=l.scaleX);var u=o.hexSideLength,c=(h-u)/2+u,d=i?Math.floor(e/c):e/c,p=i?Math.floor((t-d%2*.5*a)/a):(t-d%2*.5*a)/a;return n.set(p,d)}},44382:t=>{t.exports=function(t,e,i,s){var n=s.baseTileHeight,r=s.tilemapLayer;r&&(i||(i=r.scene.cameras.main),t-=r.y+i.scrollY*(1-r.scrollFactorY),n*=r.scaleY);var o=s.hexSideLength,a=(n-o)/2+o;return e?Math.floor(t/a):t/a}},62839:t=>{t.exports=function(t,e,i){return t>=0&&t=0&&e{var s=i(13125);t.exports=function(t,e,i,n){void 0===i&&(i=[]),void 0===n&&(n=0),i.length=0;var r,o,a,h=t.tilemapLayer,l=t.data,u=t.width,c=t.height,d=u,p=c;if(!h.skipCull)if(0===n){for(o=0;o=0;r--)if(s(r,o,t,e)){if(!(a=l[o][r])||-1===a.index||!a.visible||0===a.alpha)continue;i.push(a)}}else if(2===n){for(o=p;o>=0;o--)for(r=0;l[o]&&r=0;o--)for(r=d;l[o]&&r>=0;r--)if(s(r,o,t,e)){if(!(a=l[o][r])||-1===a.index||!a.visible||0===a.alpha)continue;i.push(a)}return h.tilesDrawn=i.length,h.tilesTotal=u*c,i}},21808:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r){i||(i=new s);var o=r.baseTileWidth,a=r.baseTileHeight,h=r.tilemapLayer,l=0,u=0;h&&(n||(n=h.scene.cameras.main),l=h.x+n.scrollX*(1-h.scrollFactorX),o*=h.scaleX,u=h.y+n.scrollY*(1-h.scrollFactorY),a*=h.scaleY);var c=l+o/2*(t-e),d=u+(t+e)*(a/2);return i.set(c,d)}},18750:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r,o){n||(n=new s);var a=o.baseTileWidth,h=o.baseTileHeight,l=o.tilemapLayer;l&&(r||(r=l.scene.cameras.main),e-=l.y+r.scrollY*(1-l.scrollFactorY),h*=l.scaleY,t-=l.x+r.scrollX*(1-l.scrollFactorX),a*=l.scaleX);var u=i?Math.floor((t/(a/2)+e/(h/2))/2):(t/(a/2)+e/(h/2))/2,c=i?Math.floor((e/(h/2)-t/(a/2))/2):(e/(h/2)-t/(a/2))/2;return n.set(u,c)}},29003:(t,e,i)=>{var s=i(29633),n=i(62839),r=i(92839),o=i(68234),a=i(14556);t.exports=function(t,e,i,h,l){if(void 0===h&&(h=!0),!n(e,i,l))return null;var u,c=l.data[i][e],d=c&&c.collides;t instanceof s?(null===l.data[i][e]&&(l.data[i][e]=new s(l,t.index,e,i,l.tileWidth,l.tileHeight)),l.data[i][e].copy(t)):(u=t,null===l.data[i][e]?l.data[i][e]=new s(l,u,e,i,l.tileWidth,l.tileHeight):l.data[i][e].index=u);var p=l.data[i][e],f=-1!==l.collideIndexes.indexOf(p.index),v=a(l.tilemapLayer.tilemap)[u=t instanceof s?t.index:t][2],g=l.tilemapLayer.tileset[v];return p.width=g.tileWidth,p.height=g.tileHeight,o(p,f),h&&d!==p.collides&&r(e,i,l),p}},48565:(t,e,i)=>{var s=i(29003),n=new(i(93736));t.exports=function(t,e,i,r,o,a){return a.tilemapLayer.worldToTileXY(e,i,!0,n,o,a),s(t,n.x,n.y,r,a)}},56547:(t,e,i)=>{var s=i(60386),n=i(29003);t.exports=function(t,e,i,r,o){if(void 0===r&&(r=!0),!Array.isArray(t))return null;Array.isArray(t[0])||(t=[t]);for(var a=t.length,h=t[0].length,l=0;l{var s=i(50811),n=i(72861);t.exports=function(t,e,i,r,o,a){var h,l=s(t,e,i,r,{},a);if(!o)for(o=[],h=0;h{var s=i(29633),n=i(62839),r=i(92839);t.exports=function(t,e,i,o,a){if(void 0===i&&(i=!0),void 0===o&&(o=!0),!n(t,e,a))return null;var h=a.data[e][t];return h?(a.data[e][t]=i?null:new s(a,-1,t,e,a.tileWidth,a.tileHeight),o&&h&&h.collides&&r(t,e,a),h):null}},17384:(t,e,i)=>{var s=i(929),n=new(i(93736));t.exports=function(t,e,i,r,o,a){return a.tilemapLayer.worldToTileXY(t,e,!0,n,o,a),s(n.x,n.y,i,r,a)}},93763:(t,e,i)=>{var s=i(50811),n=i(95509),r=new n(105,210,231,150),o=new n(243,134,48,200),a=new n(40,39,37,150);t.exports=function(t,e,i){void 0===e&&(e={});var n=void 0!==e.tileColor?e.tileColor:r,h=void 0!==e.collidingTileColor?e.collidingTileColor:o,l=void 0!==e.faceColor?e.faceColor:a,u=s(0,0,i.width,i.height,null,i);t.translateCanvas(i.tilemapLayer.x,i.tilemapLayer.y),t.scaleCanvas(i.tilemapLayer.scaleX,i.tilemapLayer.scaleY);for(var c=0;c{var s=i(50811);t.exports=function(t,e,i,n,r,o,a){for(var h=s(i,n,r,o,null,a),l=0;l{t.exports=function(t,e,i,s){var n,r,o,a=t.data,h=t.width,l=t.height,u=t.tilemapLayer,c=Math.max(0,e.left),d=Math.min(h,e.right),p=Math.max(0,e.top),f=Math.min(l,e.bottom);if(0===i)for(r=p;r=c;n--)(o=a[r][n])&&-1!==o.index&&o.visible&&0!==o.alpha&&s.push(o);else if(2===i)for(r=f;r>=p;r--)for(n=c;a[r]&&n=p;r--)for(n=d;a[r]&&n>=c;n--)(o=a[r][n])&&-1!==o.index&&o.visible&&0!==o.alpha&&s.push(o);return u.tilesDrawn=s.length,u.tilesTotal=h*l,s}},51710:(t,e,i)=>{var s=i(68234),n=i(60386),r=i(91181);t.exports=function(t,e,i,o,a){void 0===e&&(e=!0),void 0===i&&(i=!0),void 0===a&&(a=!0),Array.isArray(t)||(t=[t]);for(var h=0;h{var s=i(68234),n=i(60386),r=i(91181);t.exports=function(t,e,i,o,a,h){if(void 0===i&&(i=!0),void 0===o&&(o=!0),void 0===h&&(h=!0),!(t>e)){for(var l=t;l<=e;l++)r(l,i,a);if(h)for(var u=0;u=t&&d.index<=e&&s(d,i)}o&&n(0,0,a.width,a.height,a)}}},33158:(t,e,i)=>{var s=i(68234),n=i(60386),r=i(91181);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var a=0;a{var s=i(68234),n=i(60386),r=i(19256);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0);for(var a=0;a{var s=i(68234),n=i(60386);t.exports=function(t,e,i){void 0===t&&(t=!0),void 0===e&&(e=!0);for(var r=0;r0&&s(a,t)}}e&&n(0,0,i.width,i.height,i)}},91181:t=>{t.exports=function(t,e,i){var s=i.collideIndexes.indexOf(t);e&&-1===s?i.collideIndexes.push(t):e||-1===s||i.collideIndexes.splice(s,1)}},68234:t=>{t.exports=function(t,e){e?t.setCollision(!0,!0,!0,!0,!1):t.resetCollision(!1)}},11628:t=>{t.exports=function(t,e,i,s){if("number"==typeof t)s.callbacks[t]=null!==e?{callback:e,callbackContext:i}:void 0;else for(var n=0,r=t.length;n{var s=i(50811);t.exports=function(t,e,i,n,r,o,a){for(var h=s(t,e,i,n,null,a),l=0;l{var s=i(50811),n=i(18592);t.exports=function(t,e,i,r,o){var a=s(t,e,i,r,null,o),h=a.map((function(t){return t.index}));n(h);for(var l=0;l{var s=i(82127),n=i(84314);t.exports=function(t,e){var i=t.tilemapLayer.tilemap,r=t.tilemapLayer,o=Math.floor(i.tileWidth*r.scaleX),a=Math.floor(i.tileHeight*r.scaleY);return{left:n(e.worldView.x-r.x,o,0,!0)-r.cullPaddingX,right:s(e.worldView.right-r.x,o,0,!0)+r.cullPaddingX,top:n(e.worldView.y-r.y,a/2,0,!0)-r.cullPaddingY,bottom:s(e.worldView.bottom-r.y,a/2,0,!0)+r.cullPaddingY}}},19242:(t,e,i)=>{var s=i(53945),n=i(6987);t.exports=function(t,e,i,r){void 0===i&&(i=[]),void 0===r&&(r=0),i.length=0;var o=t.tilemapLayer;if(!o.skipCull&&1===o.scrollFactorX&&1===o.scrollFactorY){var a=s(t,e);n(t,a,r,i)}return i}},33388:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r){i||(i=new s);var o=r.baseTileWidth,a=r.baseTileHeight,h=r.tilemapLayer,l=0,u=0;h&&(n||(n=h.scene.cameras.main),l=h.x+n.scrollX*(1-h.scrollFactorX),o*=h.scaleX,u=h.y+n.scrollY*(1-h.scrollFactorY),a*=h.scaleY);var c=l+t*o+e%2*(o/2),d=u+e*(a/2);return i.set(c,d)}},84132:t=>{t.exports=function(t,e,i){var s=i.baseTileHeight,n=i.tilemapLayer,r=0;return n&&(void 0===e&&(e=n.scene.cameras.main),r=n.y+e.scrollY*(1-n.scrollFactorY),s*=n.scaleY),r+t*(s/2)+s}},90562:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r,o){n||(n=new s);var a=o.baseTileWidth,h=o.baseTileHeight,l=o.tilemapLayer;l&&(r||(r=l.scene.cameras.main),e-=l.y+r.scrollY*(1-l.scrollFactorY),h*=l.scaleY,t-=l.x+r.scrollX*(1-l.scrollFactorX),a*=l.scaleX);var u=i?Math.floor(e/(h/2)):e/(h/2),c=i?Math.floor((t+u%2*.5*a)/a):(t+u%2*.5*a)/a;return n.set(c,u)}},3689:t=>{t.exports=function(t,e,i,s){var n=s.baseTileHeight,r=s.tilemapLayer;return r&&(i||(i=r.scene.cameras.main),t-=r.y+i.scrollY*(1-r.scrollFactorY),n*=r.scaleY),e?Math.floor(t/(n/2)):t/(n/2)}},55217:(t,e,i)=>{var s=i(50811);t.exports=function(t,e,i,n,r,o,a){for(var h=s(i,n,r,o,null,a),l=0;l{t.exports=function(t,e,i){var s=i.baseTileWidth,n=i.tilemapLayer,r=0;return n&&(e||(e=n.scene.cameras.main),r=n.x+e.scrollX*(1-n.scrollFactorX),s*=n.scaleX),r+t*s}},46836:(t,e,i)=>{var s=i(44150),n=i(42477),r=i(93736);t.exports=function(t,e,i,o,a){return i||(i=new r(0,0)),i.x=s(t,o,a),i.y=n(e,o,a),i}},42477:t=>{t.exports=function(t,e,i){var s=i.baseTileHeight,n=i.tilemapLayer,r=0;return n&&(e||(e=n.scene.cameras.main),r=n.y+e.scrollY*(1-n.scrollFactorY),s*=n.scaleY),r+t*s}},39677:(t,e,i)=>{var s=i(50811);t.exports=function(t,e,i,n,r,o){if(r){var a,h=s(t,e,i,n,null,o),l=0;for(a=0;a{t.exports=function(t,e,i,s){void 0===e&&(e=!0);var n=s.baseTileWidth,r=s.tilemapLayer;return r&&(i||(i=r.scene.cameras.main),t-=r.x+i.scrollX*(1-r.scrollFactorX),n*=r.scaleX),e?Math.floor(t/n):t/n}},45676:(t,e,i)=>{var s=i(806),n=i(70520),r=i(93736);t.exports=function(t,e,i,o,a,h){return void 0===i&&(i=!0),o||(o=new r(0,0)),o.x=s(t,i,a,h),o.y=n(e,i,a,h),o}},70520:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=!0);var n=s.baseTileHeight,r=s.tilemapLayer;return r&&(i||(i=r.scene.cameras.main),t-=r.y+i.scrollY*(1-r.scrollFactorY),n*=r.scaleY),e?Math.floor(t/n):t/n}},5047:(t,e,i)=>{t.exports={CalculateFacesAt:i(92839),CalculateFacesWithin:i(60386),CheckIsoBounds:i(13125),Copy:i(17347),CreateFromTiles:i(93604),CullBounds:i(71586),CullTiles:i(381),Fill:i(97734),FilterTiles:i(63555),FindByIndex:i(37982),FindTile:i(48297),ForEachTile:i(80916),GetCullTilesFunction:i(31493),GetTileAt:i(15494),GetTileAtWorldXY:i(24640),GetTilesWithin:i(50811),GetTilesWithinShape:i(31674),GetTilesWithinWorldXY:i(44662),GetTileToWorldXFunction:i(16884),GetTileToWorldXYFunction:i(68182),GetTileToWorldYFunction:i(3752),GetWorldToTileXFunction:i(29296),GetWorldToTileXYFunction:i(32688),GetWorldToTileYFunction:i(74326),HasTileAt:i(46598),HasTileAtWorldXY:i(28654),HexagonalCullBounds:i(6358),HexagonalCullTiles:i(37524),HexagonalTileToWorldXY:i(21715),HexagonalTileToWorldY:i(37728),HexagonalWorldToTileXY:i(11516),HexagonalWorldToTileY:i(44382),IsInLayerBounds:i(62839),IsometricCullTiles:i(20887),IsometricTileToWorldXY:i(21808),IsometricWorldToTileXY:i(18750),PutTileAt:i(29003),PutTileAtWorldXY:i(48565),PutTilesAt:i(56547),Randomize:i(91180),RemoveTileAt:i(929),RemoveTileAtWorldXY:i(17384),RenderDebug:i(93763),ReplaceByIndex:i(51202),RunCull:i(6987),SetCollision:i(51710),SetCollisionBetween:i(15216),SetCollisionByExclusion:i(33158),SetCollisionByProperty:i(4180),SetCollisionFromCollisionGroup:i(18625),SetLayerCollisionIndex:i(91181),SetTileCollision:i(68234),SetTileIndexCallback:i(11628),SetTileLocationCallback:i(72732),Shuffle:i(34397),StaggeredCullBounds:i(53945),StaggeredCullTiles:i(19242),StaggeredTileToWorldXY:i(33388),StaggeredTileToWorldY:i(84132),StaggeredWorldToTileXY:i(90562),StaggeredWorldToTileY:i(3689),SwapByIndex:i(55217),TileToWorldX:i(44150),TileToWorldXY:i(46836),TileToWorldY:i(42477),WeightedRandomize:i(39677),WorldToTileX:i(806),WorldToTileXY:i(45676),WorldToTileY:i(70520)}},12920:t=>{t.exports={ORTHOGONAL:0,ISOMETRIC:1,STAGGERED:2,HEXAGONAL:3}},84758:(t,e,i)=>{var s={ORIENTATION:i(12920)};t.exports=s},52678:(t,e,i)=>{var s=i(98611),n=i(84758),r={Components:i(5047),Parsers:i(34124),Formats:i(93560),ImageCollection:i(97042),ParseToTilemap:i(15043),Tile:i(29633),Tilemap:i(89797),TilemapCreator:i(4843),TilemapFactory:i(37940),Tileset:i(47975),TilemapLayer:i(87177),Orientation:i(12920),LayerData:i(94990),MapData:i(16586),ObjectLayer:i(15256)};r=s(!1,r,n.ORIENTATION),t.exports=r},94990:(t,e,i)=>{var s=i(56694),n=i(12920),r=i(72632),o=new s({initialize:function(t){void 0===t&&(t={}),this.name=r(t,"name","layer"),this.x=r(t,"x",0),this.y=r(t,"y",0),this.width=r(t,"width",0),this.height=r(t,"height",0),this.tileWidth=r(t,"tileWidth",0),this.tileHeight=r(t,"tileHeight",0),this.baseTileWidth=r(t,"baseTileWidth",this.tileWidth),this.baseTileHeight=r(t,"baseTileHeight",this.tileHeight),this.orientation=r(t,"orientation",n.ORTHOGONAL),this.widthInPixels=r(t,"widthInPixels",this.width*this.baseTileWidth),this.heightInPixels=r(t,"heightInPixels",this.height*this.baseTileHeight),this.alpha=r(t,"alpha",1),this.visible=r(t,"visible",!0),this.properties=r(t,"properties",[]),this.indexes=r(t,"indexes",[]),this.collideIndexes=r(t,"collideIndexes",[]),this.callbacks=r(t,"callbacks",[]),this.bodies=r(t,"bodies",[]),this.data=r(t,"data",[]),this.tilemapLayer=r(t,"tilemapLayer",null),this.hexSideLength=r(t,"hexSideLength",0)}});t.exports=o},16586:(t,e,i)=>{var s=i(56694),n=i(12920),r=i(72632),o=new s({initialize:function(t){void 0===t&&(t={}),this.name=r(t,"name","map"),this.width=r(t,"width",0),this.height=r(t,"height",0),this.infinite=r(t,"infinite",!1),this.tileWidth=r(t,"tileWidth",0),this.tileHeight=r(t,"tileHeight",0),this.widthInPixels=r(t,"widthInPixels",this.width*this.tileWidth),this.heightInPixels=r(t,"heightInPixels",this.height*this.tileHeight),this.format=r(t,"format",null),this.orientation=r(t,"orientation",n.ORTHOGONAL),this.renderOrder=r(t,"renderOrder","right-down"),this.version=r(t,"version","1"),this.properties=r(t,"properties",{}),this.layers=r(t,"layers",[]),this.images=r(t,"images",[]),this.objects=r(t,"objects",[]),this.collision=r(t,"collision",{}),this.tilesets=r(t,"tilesets",[]),this.imageCollections=r(t,"imageCollections",[]),this.tiles=r(t,"tiles",[]),this.hexSideLength=r(t,"hexSideLength",0)}});t.exports=o},15256:(t,e,i)=>{var s=i(56694),n=i(72632),r=new s({initialize:function(t){void 0===t&&(t={}),this.name=n(t,"name","object layer"),this.opacity=n(t,"opacity",1),this.properties=n(t,"properties",{}),this.propertyTypes=n(t,"propertytypes",{}),this.type=n(t,"type","objectgroup"),this.visible=n(t,"visible",!0),this.objects=n(t,"objects",[])}});t.exports=r},21394:(t,e,i)=>{var s=i(12920);t.exports=function(t){return"isometric"===(t=t.toLowerCase())?s.ISOMETRIC:"staggered"===t?s.STAGGERED:"hexagonal"===t?s.HEXAGONAL:s.ORTHOGONAL}},90715:(t,e,i)=>{var s=i(93560),n=i(84346),r=i(96097),o=i(2378),a=i(44909);t.exports=function(t,e,i,h,l,u){var c;switch(e){case s.ARRAY_2D:c=n(t,i,h,l,u);break;case s.CSV:c=r(t,i,h,l,u);break;case s.TILED_JSON:c=o(t,i,u);break;case s.WELTMEISTER:c=a(t,i,u);break;default:console.warn("Unrecognized tilemap data format: "+e),c=null}return c}},84346:(t,e,i)=>{var s=i(93560),n=i(94990),r=i(16586),o=i(29633);t.exports=function(t,e,i,a,h){for(var l=new n({tileWidth:i,tileHeight:a}),u=new r({name:t,tileWidth:i,tileHeight:a,format:s.ARRAY_2D,layers:[l]}),c=[],d=e.length,p=0,f=0;f{var s=i(93560),n=i(84346);t.exports=function(t,e,i,r,o){var a=e.trim().split("\n").map((function(t){return t.split(",")})),h=n(t,a,i,r,o);return h.format=s.CSV,h}},30951:(t,e,i)=>{var s=i(94990),n=i(29633);t.exports=function(t,e){for(var i=[],r=0;r-1?new n(a,p,c,u,o.tilesize,o.tilesize):e?null:new n(a,-1,c,u,o.tilesize,o.tilesize),h.push(d)}l.push(h),h=[]}a.data=l,i.push(a)}return i}},47488:(t,e,i)=>{var s=i(47975);t.exports=function(t){for(var e=[],i=[],n=0;n{var s=i(93560),n=i(16586),r=i(30951),o=i(47488);t.exports=function(t,e,i){if(0===e.layer.length)return console.warn("No layers found in the Weltmeister map: "+t),null;for(var a=0,h=0,l=0;la&&(a=e.layer[l].width),e.layer[l].height>h&&(h=e.layer[l].height);var u=new n({width:a,height:h,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:s.WELTMEISTER});return u.layers=r(e,i),u.tilesets=o(e),u}},24507:(t,e,i)=>{t.exports={ParseTileLayers:i(30951),ParseTilesets:i(47488),ParseWeltmeister:i(44909)}},34124:(t,e,i)=>{t.exports={FromOrientationString:i(21394),Parse:i(90715),Parse2DArray:i(84346),ParseCSV:i(96097),Impact:i(24507),Tiled:i(50044)}},48646:(t,e,i)=>{var s=i(98611);t.exports=function(t){for(var e,i,n,r,o,a=0;a{t.exports=function(t){for(var e=window.atob(t),i=e.length,s=new Array(i/4),n=0;n>>0;return s}},14556:(t,e,i)=>{var s=i(47975);t.exports=function(t){var e,i,n=[];for(e=0;e{var s=i(72632);t.exports=function(t,e,i){if(!e)return{i:0,layers:t.layers,name:"",opacity:1,visible:!0,x:0,y:0};var n=e.x+s(e,"startx",0)*t.tilewidth+s(e,"offsetx",0),r=e.y+s(e,"starty",0)*t.tileheight+s(e,"offsety",0);return{i:0,layers:e.layers,name:i.name+e.name+"/",opacity:i.opacity*e.opacity,visible:i.visible&&e.visible,x:i.x+n,y:i.y+r}}},8847:t=>{var e=2147483648,i=1073741824,s=536870912;t.exports=function(t){var n=Boolean(t&e),r=Boolean(t&i),o=Boolean(t&s);t&=536870911;var a=0,h=!1;return n&&r&&o?(a=Math.PI/2,h=!0):n&&r&&!o?(a=Math.PI,h=!1):n&&!r&&o?(a=Math.PI/2,h=!1):!n||r||o?!n&&r&&o?(a=3*Math.PI/2,h=!1):n||!r||o?n||r||!o?n||r||o||(a=0,h=!1):(a=3*Math.PI/2,h=!0):(a=Math.PI,h=!0):(a=0,h=!0),{gid:t,flippedHorizontal:n,flippedVertical:r,flippedAntiDiagonal:o,rotation:a,flipped:h}}},78339:(t,e,i)=>{var s=i(72632),n=i(92044);t.exports=function(t){for(var e=[],i=[],r=n(t);r.i0;)if(r.i>=r.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}r=i.pop()}else{var o=r.layers[r.i];if(r.i++,"imagelayer"===o.type){var a=s(o,"offsetx",0)+s(o,"startx",0),h=s(o,"offsety",0)+s(o,"starty",0);e.push({name:r.name+o.name,image:o.image,x:r.x+a+o.x,y:r.y+h+o.y,alpha:r.opacity*o.opacity,visible:r.visible&&o.visible,properties:s(o,"properties",{})})}else if("group"===o.type){var l=n(t,o,r);i.push(r),r=l}}return e}},2378:(t,e,i)=>{var s=i(48646),n=i(14556),r=i(12920),o=i(93560),a=i(21394),h=i(16586),l=i(78339),u=i(61136),c=i(95925),d=i(93392);t.exports=function(t,e,i){var p=new h({width:e.width,height:e.height,name:t,tileWidth:e.tilewidth,tileHeight:e.tileheight,orientation:a(e.orientation),format:o.TILED_JSON,version:e.version,properties:e.properties,renderOrder:e.renderorder,infinite:e.infinite});p.orientation===r.HEXAGONAL&&(p.hexSideLength=e.hexsidelength),p.layers=c(e,i),p.images=l(e);var f=d(e);return p.tilesets=f.tilesets,p.imageCollections=f.imageCollections,p.objects=u(e),p.tiles=n(p),s(p),p}},4281:(t,e,i)=>{var s=i(28820),n=i(8847),r=function(t){return{x:t.x,y:t.y}},o=["id","name","type","rotation","properties","visible","x","y","width","height"];t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0);var a=s(t,o);if(a.x+=e,a.y+=i,t.gid){var h=n(t.gid);a.gid=h.gid,a.flippedHorizontal=h.flippedHorizontal,a.flippedVertical=h.flippedVertical,a.flippedAntiDiagonal=h.flippedAntiDiagonal}else t.polyline?a.polyline=t.polyline.map(r):t.polygon?a.polygon=t.polygon.map(r):t.ellipse?a.ellipse=t.ellipse:t.text?a.text=t.text:t.point?a.point=!0:a.rectangle=!0;return a}},61136:(t,e,i)=>{var s=i(72632),n=i(4281),r=i(15256),o=i(92044);t.exports=function(t){for(var e=[],i=[],a=o(t);a.i0;)if(a.i>=a.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}a=i.pop()}else{var h=a.layers[a.i];if(a.i++,h.opacity*=a.opacity,h.visible=a.visible&&h.visible,"objectgroup"===h.type){h.name=a.name+h.name;for(var l=a.x+s(h,"startx",0)+s(h,"offsetx",0),u=a.y+s(h,"starty",0)+s(h,"offsety",0),c=[],d=0;d{var s=i(43908),n=i(12920),r=i(92044),o=i(21394),a=i(72632),h=i(94990),l=i(8847),u=i(29633);t.exports=function(t,e){for(var i=a(t,"infinite",!1),c=[],d=[],p=r(t);p.i0;)if(p.i>=p.layers.length){if(d.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}p=d.pop()}else{var f=p.layers[p.i];if(p.i++,"tilelayer"===f.type)if(f.compression)console.warn("TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '"+f.name+"'");else{if(f.encoding&&"base64"===f.encoding){if(f.chunks)for(var v=0;v0?((y=new u(g,m.gid,L,F,t.tilewidth,t.tileheight)).rotation=m.rotation,y.flipX=m.flipped,T[F][L]=y):(x=e?null:new u(g,-1,L,F,t.tilewidth,t.tileheight),T[F][L]=x),++w===_.width&&(M++,w=0)}}else{(g=new h({name:p.name+f.name,x:p.x+a(f,"offsetx",0)+f.x,y:p.y+a(f,"offsety",0)+f.y,width:f.width,height:f.height,tileWidth:t.tilewidth,tileHeight:t.tileheight,alpha:p.opacity*f.opacity,visible:p.visible&&f.visible,properties:a(f,"properties",[]),orientation:o(t.orientation)})).orientation===n.HEXAGONAL&&(g.hexSideLength=t.hexsidelength);for(var D=[],k=0,I=f.data.length;k0?((y=new u(g,m.gid,w,T.length,t.tilewidth,t.tileheight)).rotation=m.rotation,y.flipX=m.flipped,D.push(y)):(x=e?null:new u(g,-1,w,T.length,t.tilewidth,t.tileheight),D.push(x)),++w===f.width&&(T.push(D),w=0,D=[])}g.data=T,c.push(g)}else if("group"===f.type){var B=r(t,f,p);d.push(p),p=B}}return c}},93392:(t,e,i)=>{var s=i(47975),n=i(97042),r=i(4281),o=i(39642);t.exports=function(t){for(var e,i=[],a=[],h=null,l=0;l1){var d=void 0,p=void 0;if(Array.isArray(u.tiles)){d=d||{},p=p||{};for(var f=0;f{t.exports=function(t,e){for(var i=0;i0){var r,o,a,h={},l={};if(Array.isArray(s.edgecolors))for(r=0;r{t.exports={AssignTileProperties:i(48646),Base64Decode:i(43908),BuildTilesetIndex:i(14556),CreateGroupLayer:i(92044),ParseGID:i(8847),ParseImageLayers:i(78339),ParseJSONTiled:i(2378),ParseObject:i(4281),ParseObjectLayers:i(61136),ParseTileLayers:i(95925),ParseTilesets:i(93392)}},73779:(t,e,i)=>{var s=i(56694),n=i(91963),r=i(7599),o=i(57911),a=i(66458),h=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.now=0,this.timeScale=1,this.paused=!1,this._active=[],this._pendingInsertion=[],this._pendingRemoval=[],t.sys.events.once(r.BOOT,this.boot,this),t.sys.events.on(r.START,this.start,this)},boot:function(){this.now=this.systems.game.loop.time,this.systems.events.once(r.DESTROY,this.destroy,this)},start:function(){var t=this.systems.events;t.on(r.PRE_UPDATE,this.preUpdate,this),t.on(r.UPDATE,this.update,this),t.once(r.SHUTDOWN,this.shutdown,this)},addEvent:function(t){var e;return t instanceof o?(e=t,this.removeEvent(e),e.elapsed=e.startAt,e.hasDispatched=!1,e.repeatCount=-1===e.repeat||e.loop?999999999999:e.repeat):e=new o(t),this._pendingInsertion.push(e),e},delayedCall:function(t,e,i,s){return this.addEvent({delay:t,callback:e,args:i,callbackScope:s})},clearPendingEvents:function(){return this._pendingInsertion=[],this},removeEvent:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e-1&&this._active.splice(n,1),s.destroy()}for(i=0;i=s.delay)){var n=s.elapsed-s.delay;if(s.elapsed=s.delay,!s.hasDispatched&&s.callback&&(s.hasDispatched=!0,s.callback.apply(s.callbackScope,s.args)),s.repeatCount>0){if(s.repeatCount--,n>=s.delay)for(;n>=s.delay&&s.repeatCount>0;)s.callback&&s.callback.apply(s.callbackScope,s.args),n-=s.delay,s.repeatCount--;s.elapsed=n,s.hasDispatched=!1}else s.hasDispatched&&this._pendingRemoval.push(s)}}}},shutdown:function(){var t;for(t=0;t{var s=i(56694),n=i(72632),r=new s({initialize:function(t){this.delay=0,this.repeat=0,this.repeatCount=0,this.loop=!1,this.callback,this.callbackScope,this.args,this.timeScale=1,this.startAt=0,this.elapsed=0,this.paused=!1,this.hasDispatched=!1,this.reset(t)},reset:function(t){return this.delay=n(t,"delay",0),this.repeat=n(t,"repeat",0),this.loop=n(t,"loop",!1),this.callback=n(t,"callback",void 0),this.callbackScope=n(t,"callbackScope",this.callback),this.args=n(t,"args",[]),this.timeScale=n(t,"timeScale",1),this.startAt=n(t,"startAt",0),this.paused=n(t,"paused",!1),this.elapsed=this.startAt,this.hasDispatched=!1,this.repeatCount=-1===this.repeat||this.loop?999999999999:this.repeat,this},getProgress:function(){return this.elapsed/this.delay},getOverallProgress:function(){if(this.repeat>0){var t=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/t}return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return.001*this.elapsed},getRemaining:function(){return this.delay-this.elapsed},getRemainingSeconds:function(){return.001*this.getRemaining()},getOverallRemaining:function(){return this.delay*(1+this.repeatCount)-this.elapsed},getOverallRemainingSeconds:function(){return.001*this.getOverallRemaining()},remove:function(t){void 0===t&&(t=!1),this.elapsed=this.delay,this.hasDispatched=!t,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});t.exports=r},97121:(t,e,i)=>{t.exports={Clock:i(73779),TimerEvent:i(57911)}},64532:(t,e,i)=>{var s=i(66458),n=i(56694),r=i(5454),o=i(68710),a=i(91963),h=i(7599),l=i(91944),u=i(39366),c=i(68061),d=i(45641),p=i(56034),f=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.timeScale=1,this.paused=!1,this.processing=!1,this.tweens=[],this.time=0,this.startTime=0,this.nextTime=0,this.prevTime=0,this.maxLag=500,this.lagSkip=33,this.gap=1e3/240,t.sys.events.once(h.BOOT,this.boot,this),t.sys.events.on(h.START,this.start,this)},boot:function(){this.systems.events.once(h.DESTROY,this.destroy,this)},start:function(){var t=this.systems.events;t.on(h.UPDATE,this.update,this),t.once(h.SHUTDOWN,this.shutdown,this),this.timeScale=1,this.paused=!1,this.startTime=Date.now(),this.prevTime=this.startTime,this.nextTime=this.gap},create:function(t){Array.isArray(t)||(t=[t]);for(var e=[],i=0;i-1},existing:function(t){return this.has(t)||this.tweens.push(t.init()),this},addCounter:function(t){var e=o(this,t);return this.tweens.push(e.init()),e},stagger:function(t,e){return l(t,e)},setLagSmooth:function(t,e){return void 0===t&&(t=1/1e-8),void 0===e&&(e=0),this.maxLag=t,this.lagSkip=Math.min(e,this.maxLag),this},setFps:function(t){return void 0===t&&(t=240),this.gap=1e3/t,this.nextTime=1e3*this.time+this.gap,this},getDelta:function(t){var e=Date.now()-this.prevTime;e>this.maxLag&&(this.startTime+=e-this.lagSkip),this.prevTime+=e;var i=this.prevTime-this.startTime,s=i-this.nextTime,n=i-1e3*this.time;return s>0||t?(i/=1e3,this.time=i,this.nextTime+=s+(s>=this.gap?4:this.gap-s)):n=0,n},tick:function(){return this.step(!0),this},update:function(){this.paused||this.step(!1)},step:function(t){void 0===t&&(t=!1);var e=this.getDelta(t);if(0!==e){var i,s;this.processing=!0;var n=[],r=this.tweens;for(i=0;i0){for(i=0;i-1&&(s.isPendingRemove()||s.isDestroyed())&&(r.splice(a,1),s.destroy())}n.length=0}this.processing=!1}},remove:function(t){return this.processing?t.setPendingRemoveState():(s(this.tweens,t),t.setRemovedState()),this},reset:function(t){return this.existing(t),t.seek(),t.setActiveState(),this},makeActive:function(t){return this.existing(t),t.setActiveState(),this},each:function(t,e){var i,s=[null];for(i=1;i{t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},21902:(t,e,i)=>{var s=i(35060),n=i(40587);t.exports=function(t,e){var i=s.Power0;if("string"==typeof t)if(s.hasOwnProperty(t))i=s[t];else{var r="";if(t.indexOf(".")){var o=(r=t.substring(t.indexOf(".")+1)).toLowerCase();"in"===o?r="easeIn":"out"===o?r="easeOut":"inout"===o&&(r="easeInOut")}t=n(t.substring(0,t.indexOf(".")+1)+r),s.hasOwnProperty(t)&&(i=s[t])}else"function"==typeof t&&(i=t);if(!e)return i;var a=e.slice(0);return a.unshift(0),function(t){return a[0]=t,i.apply(this,a)}}},4840:(t,e,i)=>{var s=i(63210),n=i(88332),r={bezier:s,catmull:n,catmullrom:n,linear:i(47614)};t.exports=function(t){if(null===t)return null;var e=r.linear;return"string"==typeof t?r.hasOwnProperty(t)&&(e=r[t]):"function"==typeof t&&(e=t),e}},28348:t=>{t.exports=function(t,e,i){var s;t.hasOwnProperty(e)?s="function"===typeof t[e]?function(i,s,n,r,o,a){return t[e](i,s,n,r,o,a)}:function(){return t[e]}:s="function"==typeof i?i:function(){return i};return s}},92407:(t,e,i)=>{var s=i(53709);t.exports=function(t){var e,i=[];if(t.hasOwnProperty("props"))for(e in t.props)"_"!==e.substring(0,1)&&i.push({key:e,value:t.props[e]});else for(e in t)-1===s.indexOf(e)&&"_"!==e.substring(0,1)&&i.push({key:e,value:t[e]});return i}},65868:(t,e,i)=>{var s=i(10850);t.exports=function(t){var e=s(t,"targets",null);return null===e||("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e])),e}},9744:(t,e,i)=>{var s=i(17489),n=i(61616);function r(t){return!!t.getActive&&"function"==typeof t.getActive}function o(t){return!!t.getStart&&"function"==typeof t.getStart}function a(t){return!!t.getEnd&&"function"==typeof t.getEnd}var h=function(t,e){var i,l,u=function(t,e,i){return i},c=function(t,e,i){return i},d=null,p=typeof e;if("number"===p)u=function(){return e};else if(Array.isArray(e))c=function(){return e[0]},u=function(){return e[e.length-1]};else if("string"===p){var f=e.toLowerCase(),v="random"===f.substring(0,6),g="int"===f.substring(0,3);if(v||g){var m=f.indexOf("("),y=f.indexOf(")"),x=f.indexOf(",");if(!(m&&y&&x))throw new Error("invalid random() format");var T=parseFloat(f.substring(m+1,x)),w=parseFloat(f.substring(x+1,y));u=v?function(){return n(T,w)}:function(){return s(T,w)}}else{f=f[0];var b=parseFloat(e.substr(2));switch(f){case"+":u=function(t,e,i){return i+b};break;case"-":u=function(t,e,i){return i-b};break;case"*":u=function(t,e,i){return i*b};break;case"/":u=function(t,e,i){return i/b};break;default:u=function(){return parseFloat(e)}}}}else if("function"===p)u=e;else if("object"===p)if(o(l=e)||a(l)||r(l))r(e)&&(d=e.getActive),a(e)&&(u=e.getEnd),o(e)&&(c=e.getStart);else if(e.hasOwnProperty("value"))i=h(t,e.value);else{var E=e.hasOwnProperty("to"),S=e.hasOwnProperty("from"),A=e.hasOwnProperty("start");if(E&&(S||A)){if(i=h(t,e.to),A){var _=h(t,e.start);i.getActive=_.getEnd}if(S){var C=h(t,e.from);i.getStart=C.getEnd}}}return i||(i={getActive:d,getEnd:u,getStart:c}),i};t.exports=h},68710:(t,e,i)=>{var s=i(502),n=i(99730),r=i(20494),o=i(63130),a=i(21902),h=i(28348),l=i(10850),u=i(9744),c=i(72066),d=i(39366);t.exports=function(t,e,i){if(e instanceof d)return e.parent=t,e;i=void 0===i?n:c(n,i);var p=l(e,"from",0),f=l(e,"to",1),v=[{value:p}],g=l(e,"delay",i.delay),m=l(e,"easeParams",i.easeParams),y=l(e,"ease",i.ease),x=u("value",f),T=new d(t,v),w=T.add(0,"value",x.getEnd,x.getStart,x.getActive,a(l(e,"ease",y),l(e,"easeParams",m)),h(e,"delay",g),l(e,"duration",i.duration),o(e,"yoyo",i.yoyo),l(e,"hold",i.hold),l(e,"repeat",i.repeat),l(e,"repeatDelay",i.repeatDelay),!1,!1);w.start=p,w.current=p,T.completeDelay=r(e,"completeDelay",0),T.loop=Math.round(r(e,"loop",0)),T.loopDelay=Math.round(r(e,"loopDelay",0)),T.paused=o(e,"paused",!1),T.persist=o(e,"persist",!1),T.callbackScope=l(e,"callbackScope",T);for(var b=s.TYPES,E=0;E{var s=i(21902),n=i(10850),r=i(83392);t.exports=function(t,e){var i;void 0===e&&(e={});var o=n(e,"start",0),a=n(e,"ease",null),h=n(e,"grid",null),l=n(e,"from",0),u="first"===l,c="center"===l,d="last"===l,p="number"==typeof l,f=Array.isArray(t),v=f?parseFloat(t[0]):parseFloat(t),g=f?parseFloat(t[1]):0,m=Math.max(v,g);if(f&&(o+=v),h){var y=h[0],x=h[1],T=0,w=0,b=0,E=0,S=[];d?(T=y-1,w=x-1):p?(T=l%y,w=Math.floor(l/y)):c&&(T=(y-1)/2,w=(x-1)/2);for(var A=r.MIN_SAFE_INTEGER,_=0;_A&&(A=R),S[_][C]=R}}}var M=a?s(a):null;return i=h?function(t,e,i,s){var n,r=0,a=s%y,h=Math.floor(s/y);if(a>=0&&a=0&&h{var s=i(502),n=i(99730),r=i(20494),o=i(63130),a=i(21902),h=i(4840),l=i(28348),u=i(92407),c=i(65868),d=i(10850),p=i(9744),f=i(72066),v=i(39366);t.exports=function(t,e,i){if(e instanceof v)return e.parent=t,e;i=void 0===i?n:f(n,i);var g=c(e);!g&&i.targets&&(g=i.targets);for(var m=u(e),y=d(e,"delay",i.delay),x=d(e,"duration",i.duration),T=d(e,"easeParams",i.easeParams),w=d(e,"ease",i.ease),b=d(e,"hold",i.hold),E=d(e,"repeat",i.repeat),S=d(e,"repeatDelay",i.repeatDelay),A=o(e,"yoyo",i.yoyo),_=o(e,"flipX",i.flipX),C=o(e,"flipY",i.flipY),R=d(e,"interpolation",i.interpolation),M=function(t,e,i,s){if("texture"===i){var n=s,r=void 0;Array.isArray(s)?(n=s[0],r=s[1]):s.hasOwnProperty("value")&&(n=s.value,Array.isArray(s.value)&&(n=s.value[0],r=s.value[1])),t.addFrame(e,n,r,l(s,"delay",y),d(s,"duration",x),d(s,"hold",b),d(s,"repeat",E),d(s,"repeatDelay",S),o(s,"flipX",_),o(s,"flipY",C))}else{var u=p(i,s),c=h(d(s,"interpolation",R));t.add(e,i,u.getEnd,u.getStart,u.getActive,a(d(s,"ease",w),d(s,"easeParams",T)),l(s,"delay",y),d(s,"duration",x),o(s,"yoyo",A),d(s,"hold",b),d(s,"repeat",E),d(s,"repeatDelay",S),o(s,"flipX",_),o(s,"flipY",C),c,c?s:null)}},P=new v(t,g),O=0;O{var s=i(502),n=i(20494),r=i(63130),o=i(65868),a=i(10850),h=i(68061),l=i(45641);t.exports=function(t,e){if(e instanceof l)return e.parent=t,e;var i,u=new l(t);u.startDelay=a(e,"delay",0),u.completeDelay=n(e,"completeDelay",0),u.loop=Math.round(n(e,"loop",a(e,"repeat",0))),u.loopDelay=Math.round(n(e,"loopDelay",a(e,"repeatDelay",0))),u.paused=r(e,"paused",!1),u.persist=r(e,"persist",!0),u.callbackScope=a(e,"callbackScope",u);var c=s.TYPES;for(i=0;i{t.exports={GetBoolean:i(63130),GetEaseFunction:i(21902),GetInterpolationFunction:i(4840),GetNewValue:i(28348),GetProps:i(92407),GetTargets:i(65868),GetValueOp:i(9744),NumberTweenBuilder:i(68710),StaggerBuilder:i(91944),TweenBuilder:i(68061)}},5570:t=>{t.exports="active"},6383:t=>{t.exports="complete"},72582:t=>{t.exports="loop"},90281:t=>{t.exports="pause"},80803:t=>{t.exports="repeat"},13640:t=>{t.exports="resume"},10472:t=>{t.exports="start"},5379:t=>{t.exports="stop"},43449:t=>{t.exports="update"},61541:t=>{t.exports="yoyo"},54272:(t,e,i)=>{t.exports={TWEEN_ACTIVE:i(5570),TWEEN_COMPLETE:i(6383),TWEEN_LOOP:i(72582),TWEEN_PAUSE:i(90281),TWEEN_RESUME:i(13640),TWEEN_REPEAT:i(80803),TWEEN_START:i(10472),TWEEN_STOP:i(5379),TWEEN_UPDATE:i(43449),TWEEN_YOYO:i(61541)}},75193:(t,e,i)=>{var s={States:i(55303),Builders:i(79619),Events:i(54272),TweenManager:i(64532),Tween:i(39366),TweenData:i(15718)};t.exports=s},502:(t,e,i)=>{var s=i(56694),n=i(6659),r=i(54272),o=i(55303),a=new s({Extends:n,initialize:function(t){n.call(this),this.parent=t,this.data=[],this.totalData=0,this.startDelay=0,this.hasStarted=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.completeDelay=0,this.countdown=0,this.state=o.PENDING,this.paused=!1,this.callbacks={onActive:null,onComplete:null,onLoop:null,onPause:null,onRepeat:null,onResume:null,onStart:null,onStop:null,onUpdate:null,onYoyo:null},this.callbackScope,this.persist=!1},init:function(){return this.initTweenData(),this.setActiveState(),this.dispatchEvent(r.TWEEN_ACTIVE,"onActive"),this},setTimeScale:function(t){return this.timeScale=t,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return!this.paused&&this.isActive()},isPaused:function(){return this.paused},pause:function(){return this.paused||(this.paused=!0,this.dispatchEvent(r.TWEEN_PAUSE,"onPause")),this},resume:function(){return this.paused&&(this.paused=!1,this.dispatchEvent(r.TWEEN_RESUME,"onResume")),this},makeActive:function(){this.parent.makeActive(this),this.dispatchEvent(r.TWEEN_ACTIVE,"onActive")},onCompleteHandler:function(){this.setPendingRemoveState(),this.dispatchEvent(r.TWEEN_COMPLETE,"onComplete")},complete:function(t){return void 0===t&&(t=0),t?(this.setCompleteDelayState(),this.countdown=t):this.onCompleteHandler(),this},completeAfterLoop:function(t){return void 0===t&&(t=0),this.loopCounter>t&&(this.loopCounter=t),this},remove:function(){return this.parent.remove(this),this},stop:function(){return this.isRemoved()||this.isPendingRemove()||(this.dispatchEvent(r.TWEEN_STOP,"onStop"),this.setPendingRemoveState()),this},updateLoopCountdown:function(t){this.countdown-=t,this.countdown<=0&&(this.setActiveState(),this.dispatchEvent(r.TWEEN_LOOP,"onLoop"))},updateStartCountdown:function(t){return this.countdown-=t,this.countdown<=0&&(this.hasStarted=!0,this.setActiveState(),this.dispatchEvent(r.TWEEN_START,"onStart"),t=0),t},updateCompleteDelay:function(t){this.countdown-=t,this.countdown<=0&&this.onCompleteHandler()},setCallback:function(t,e,i){return void 0===i&&(i=[]),this.callbacks.hasOwnProperty(t)&&(this.callbacks[t]={func:e,params:i}),this},setPendingState:function(){this.state=o.PENDING},setActiveState:function(){this.state=o.ACTIVE},setLoopDelayState:function(){this.state=o.LOOP_DELAY},setCompleteDelayState:function(){this.state=o.COMPLETE_DELAY},setStartDelayState:function(){this.state=o.START_DELAY,this.countdown=this.startDelay,this.hasStarted=!1},setPendingRemoveState:function(){this.state=o.PENDING_REMOVE},setRemovedState:function(){this.state=o.REMOVED},setFinishedState:function(){this.state=o.FINISHED},setDestroyedState:function(){this.state=o.DESTROYED},isPending:function(){return this.state===o.PENDING},isActive:function(){return this.state===o.ACTIVE},isLoopDelayed:function(){return this.state===o.LOOP_DELAY},isCompleteDelayed:function(){return this.state===o.COMPLETE_DELAY},isStartDelayed:function(){return this.state===o.START_DELAY},isPendingRemove:function(){return this.state===o.PENDING_REMOVE},isRemoved:function(){return this.state===o.REMOVED},isFinished:function(){return this.state===o.FINISHED},isDestroyed:function(){return this.state===o.DESTROYED},destroy:function(){this.data&&this.data.forEach((function(t){t.destroy()})),this.removeAllListeners(),this.callbacks=null,this.data=null,this.parent=null,this.setDestroyedState()}});a.TYPES=["onActive","onComplete","onLoop","onPause","onRepeat","onResume","onStart","onStop","onUpdate","onYoyo"],t.exports=a},65521:(t,e,i)=>{var s=i(56694),n=i(55303),r=new s({initialize:function(t,e,i,s,n,r,o,a,h,l){this.tween=t,this.targetIndex=e,this.duration=s,this.totalDuration=0,this.delay=0,this.getDelay=i,this.yoyo=n,this.hold=r,this.repeat=o,this.repeatDelay=a,this.repeatCounter=0,this.flipX=h,this.flipY=l,this.progress=0,this.elapsed=0,this.state=0,this.isCountdown=!1},setCreatedState:function(){this.state=n.CREATED,this.isCountdown=!1},setDelayState:function(){this.state=n.DELAY,this.isCountdown=!0},setPendingRenderState:function(){this.state=n.PENDING_RENDER,this.isCountdown=!1},setPlayingForwardState:function(){this.state=n.PLAYING_FORWARD,this.isCountdown=!1},setPlayingBackwardState:function(){this.state=n.PLAYING_BACKWARD,this.isCountdown=!1},setHoldState:function(){this.state=n.HOLD_DELAY,this.isCountdown=!0},setRepeatState:function(){this.state=n.REPEAT_DELAY,this.isCountdown=!0},setCompleteState:function(){this.state=n.COMPLETE,this.isCountdown=!1},isCreated:function(){return this.state===n.CREATED},isDelayed:function(){return this.state===n.DELAY},isPendingRender:function(){return this.state===n.PENDING_RENDER},isPlayingForward:function(){return this.state===n.PLAYING_FORWARD},isPlayingBackward:function(){return this.state===n.PLAYING_BACKWARD},isHolding:function(){return this.state===n.HOLD_DELAY},isRepeating:function(){return this.state===n.REPEAT_DELAY},isComplete:function(){return this.state===n.COMPLETE},destroy:function(){this.tween=null,this.getDelay=null,this.setCompleteState()}});t.exports=r},99730:t=>{t.exports={targets:null,delay:0,duration:1e3,ease:"Power0",easeParams:null,hold:0,repeat:0,repeatDelay:0,yoyo:!1,flipX:!1,flipY:!1,persist:!1,interpolation:null}},53709:t=>{t.exports=["callbackScope","completeDelay","delay","duration","ease","easeParams","flipX","flipY","hold","interpolation","loop","loopDelay","onActive","onActiveParams","onComplete","onCompleteParams","onLoop","onLoopParams","onPause","onPauseParams","onRepeat","onRepeatParams","onResume","onResumeParams","onStart","onStartParams","onStop","onStopParams","onUpdate","onUpdateParams","onYoyo","onYoyoParams","paused","persist","props","repeat","repeatDelay","targets","yoyo"]},39366:(t,e,i)=>{var s=i(502),n=i(56694),r=i(54272),o=i(99325),a=i(61286),h=i(83392),l=i(55303),u=i(15718),c=i(96490),d=new n({Extends:s,initialize:function(t,e){s.call(this,t),this.targets=e,this.totalTargets=e.length,this.isSeeking=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.delta=0},add:function(t,e,i,s,n,r,o,a,h,l,c,d,p,f,v,g){var m=new u(this,t,e,i,s,n,r,o,a,h,l,c,d,p,f,v,g);return this.totalData=this.data.push(m),m},addFrame:function(t,e,i,s,n,r,o,a,h,l){var u=new c(this,t,e,i,s,n,r,o,a,h,l);return this.totalData=this.data.push(u),u},getValue:function(t){return void 0===t&&(t=0),this.data[t].current},hasTarget:function(t){return-1!==this.targets.indexOf(t)},updateTo:function(t,e,i){void 0===i&&(i=!1);for(var s=0;s0)this.elapsed=0,this.progress=0,this.loopCounter--,this.resetTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(r.TWEEN_LOOP,"onLoop"));else{if(!(this.completeDelay>0))return this.onCompleteHandler(),!0;this.countdown=this.completeDelay,this.setCompleteDelayState()}return!1},onCompleteHandler:function(){this.progress=1,this.totalProgress=1,s.prototype.onCompleteHandler.call(this)},play:function(){return this.isDestroyed()?(console.warn("Cannot play destroyed Tween",this),this):((this.isPendingRemove()||this.isPending())&&this.seek(),this.paused=!1,this.setActiveState(),this)},resetTweenData:function(t){for(var e=this.data,i=this.totalData,s=0;s0){this.isSeeking=!0;do{this.update(e)}while(this.totalProgress<=t);this.isSeeking=!1}return this},initTweenData:function(t){void 0===t&&(t=!1),this.reset(!0),this.duration=0,this.startDelay=h.MAX_SAFE_INTEGER;for(var e=this.data,i=0;i0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},reset:function(t){this.elapsed=0,this.progress=0,this.totalElapsed=0,this.totalProgress=0,this.loopCounter=-1===this.loop?999999999999:this.loop,t||(this.resetTweenData(!0),this.setActiveState(),this.dispatchEvent(r.TWEEN_ACTIVE,"onActive"))},update:function(t){if(this.isPendingRemove()||this.isDestroyed())return!0;if(this.isFinished()||this.paused&&!this.isSeeking)return!1;t*=this.timeScale*this.parent.timeScale,this.isLoopDelayed()?this.updateLoopCountdown(t):this.isCompleteDelayed()?this.updateCompleteDelay(t):this.hasStarted||this.isSeeking||(this.startDelay-=t,this.startDelay<=0&&(this.hasStarted=!0,this.dispatchEvent(r.TWEEN_START,"onStart"),t=0));var e=!1;if(this.isActive())for(var i=this.data,s=0;s{var s=i(66458),n=i(502),r=i(56694),o=i(54272),a=i(99325),h=i(61286),l=new r({Extends:n,initialize:function(t){n.call(this,t),this.currentTween=null,this.currentIndex=0},init:function(){return this.loopCounter=-1===this.loop?999999999999:this.loop,this.setCurrentTween(0),this.startDelay>0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this.dispatchEvent(o.TWEEN_ACTIVE,"onActive"),this},add:function(t){var e=this.parent.create(t);Array.isArray(e)||(e=[e]);for(var i=this.data,s=0;s0)this.loopCounter--,this.resetTweens(),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(o.TWEEN_LOOP,"onLoop"));else{if(!(this.completeDelay>0))return this.onCompleteHandler(),!0;this.countdown=this.completeDelay,this.setCompleteDelayState()}return!1},play:function(){return this.isDestroyed()?(console.warn("Cannot play destroyed TweenChain",this),this):((this.isPendingRemove()||this.isPending())&&this.resetTweens(),this.paused=!1,this.startDelay>0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this)},resetTweens:function(){for(var t=this.data,e=this.totalData,i=0;i{var s=i(65521),n=i(56694),r=i(54272),o=new n({Extends:s,initialize:function(t,e,i,n,r,o,a,h,l,u,c,d,p,f,v,g,m){s.call(this,t,e,h,l,u,c,d,p,f,v),this.key=i,this.getActiveValue=o,this.getEndValue=n,this.getStartValue=r,this.ease=a,this.start=0,this.previous=0,this.current=0,this.end=0,this.interpolation=g,this.interpolationData=m},init:function(t){var e=this.tween,i=e.totalTargets,s=this.targetIndex,n=e.targets[s],r=this.key;this.delay=this.getDelay(n,r,0,s,i,e),this.repeatCounter=-1===this.repeat?999999999999:this.repeat,this.setPendingRenderState();var o=this.duration+this.hold;this.yoyo&&(o+=this.duration);var a=o+this.repeatDelay;this.totalDuration=this.delay+o,-1===this.repeat?this.totalDuration+=999999999999*a:this.repeat>0&&(this.totalDuration+=a*this.repeat),this.totalDuration>e.duration&&(e.duration=this.totalDuration),this.delay0&&(this.elapsed=this.delay,this.setDelayState()),!t&&this.getActiveValue&&(n[r]=this.getActiveValue(n,r,this.start))},update:function(t){var e=this.tween,i=e.totalTargets,s=this.targetIndex,n=e.targets[s],o=this.key;if(!n)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=t,this.elapsed<=0&&(this.elapsed=0,t=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(r.TWEEN_REPEAT,"onRepeat")):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.start=this.getStartValue(n,o,n[o],s,i,e),this.end=this.getEndValue(n,o,this.start,s,i,e),this.current=this.start,n[o]=this.start,this.setPlayingForwardState(),!0;var a=this.isPlayingForward(),h=this.isPlayingBackward();if(a||h){var l=this.elapsed,u=this.duration,c=0,d=!1;(l+=t)>=u&&(c=l-u,l=u,d=!0);var p=l/u;if(this.elapsed=l,this.progress=p,this.previous=this.current,d)a?(this.current=this.end,n[o]=this.end,this.hold>0&&this.repeatCounter>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(c)):(this.current=this.start,n[o]=this.start,this.setStateFromStart(c));else{a||(p=1-p);var f=this.ease(p);this.interpolation?this.current=this.interpolation(this.interpolationData,f):this.current=this.start+(this.end-this.start)*f,n[o]=this.current}this.dispatchEvent(r.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},reset:function(t){var e=this.tween,i=e.totalTargets,s=this.targetIndex,n=e.targets[s],r=this.key;this.progress=0,this.elapsed=0,this.repeatCounter=-1===this.repeat?999999999999:this.repeat,t?(this.start=this.getStartValue(n,r,this.start,s,i,e),this.end=this.getEndValue(n,r,this.end,s,i,e),this.current=this.start,this.setPlayingForwardState()):this.setPendingRenderState(),this.delay>0&&(this.elapsed=this.delay,this.setDelayState()),this.getActiveValue&&(n[r]=this.getActiveValue(n,r,this.start))},dispatchEvent:function(t,e){var i=this.tween;if(!i.isSeeking){var s=i.targets[this.targetIndex],n=this.key,r=this.current,o=this.previoius;i.emit(t,i,n,s,r,o);var a=i.callbacks[e];a&&a.func.apply(a.scope,[i,s,n,r,o].concat(a.params))}},setStateFromEnd:function(t){this.yoyo?this.onRepeat(t,!0,!0):this.repeatCounter>0?this.onRepeat(t,!0):this.setCompleteState()},setStateFromStart:function(t){this.repeatCounter>0?this.onRepeat(t,!1):this.setCompleteState()},onRepeat:function(t,e,i){void 0===i&&(i=!1);var s=this.tween,n=s.totalTargets,o=this.targetIndex,a=s.targets[o],h=this.key;if(this.elapsed=t,this.progress=t/this.duration,this.flipX&&a.toggleFlipX(),this.flipY&&a.toggleFlipY(),(e||i)&&(this.start=this.getStartValue(a,h,this.start,o,n,s)),i)return this.setPlayingBackwardState(),void this.dispatchEvent(r.TWEEN_YOYO,"onYoyo");this.repeatCounter--,this.end=this.getEndValue(a,h,this.start,o,n,s),this.repeatDelay>0?(this.elapsed=this.repeatDelay-t,this.current=this.start,a[h]=this.current,this.setRepeatState()):(this.setPlayingForwardState(),this.dispatchEvent(r.TWEEN_REPEAT,"onRepeat"))},destroy:function(){s.prototype.destroy.call(this),this.getActiveValue=null,this.getEndValue=null,this.getStartValue=null,this.ease=null}});t.exports=o},96490:(t,e,i)=>{var s=i(65521),n=i(56694),r=i(54272),o=new n({Extends:s,initialize:function(t,e,i,n,r,o,a,h,l,u,c){s.call(this,t,e,r,o,!1,a,h,l,u,c),this.startTexture=null,this.endTexture=i,this.startFrame=null,this.endFrame=n,this.yoyo=h>0},init:function(t){var e=this.tween,i=e.totalTargets,s=this.targetIndex,n=e.targets[s];this.delay=this.getDelay(n,"texture",0,s,i,e),this.repeatCounter=-1===this.repeat?999999999999:this.repeat,this.setPendingRenderState();var r=this.duration+this.hold;this.yoyo&&(r+=this.duration);var o=r+this.repeatDelay;this.totalDuration=this.delay+r,-1===this.repeat?this.totalDuration+=999999999999*o:this.repeat>0&&(this.totalDuration+=o*this.repeat),this.totalDuration>e.duration&&(e.duration=this.totalDuration),this.delay0&&(this.elapsed=this.delay,this.setDelayState())},update:function(t){var e=this.tween,i=this.targetIndex,s=e.targets[i];if(!s)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=t,this.elapsed<=0&&(this.elapsed=0,t=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(r.TWEEN_REPEAT,"onRepeat")):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.startTexture&&s.setTexture(this.startTexture,this.startFrame),this.setPlayingForwardState(),!0;var n=this.isPlayingForward(),o=this.isPlayingBackward();if(n||o){var a=this.elapsed,h=this.duration,l=0,u=!1;(a+=t)>=h&&(l=a-h,a=h,u=!0);var c=a/h;this.elapsed=a,this.progress=c,u&&(n?(s.setTexture(this.endTexture,this.endFrame),this.hold>0&&this.repeatCounter>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(l)):(s.setTexture(this.startTexture,this.startFrame),this.setStateFromStart(l))),this.dispatchEvent(r.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},reset:function(t){this.progress=0,this.elapsed=0,this.repeatCounter=-1===this.repeat?999999999999:this.repeat,t?this.setPlayingForwardState():this.setPendingRenderState(),this.delay>0&&(this.elapsed=this.delay,this.setDelayState())},dispatchEvent:function(t,e){var i=this.tween;if(!i.isSeeking){var s=i.targets[this.targetIndex];i.emit(t,i,"texture",s);var n=i.callbacks[e];n&&n.func.apply(n.scope,[i,s,"texture"].concat(n.params))}},setStateFromEnd:function(t){this.repeatCounter>0?this.onRepeat(t,!0):this.setCompleteState()},setStateFromStart:function(t){this.repeatCounter>0?this.onRepeat(t,!1):this.setCompleteState()},onRepeat:function(t,e){void 0===e&&(e=!1);var i=this.tween,s=this.targetIndex,n=i.targets[s];if(this.elapsed=t,this.progress=t/this.duration,this.flipX&&n.toggleFlipX(),this.flipY&&n.toggleFlipY(),e)return this.setPlayingBackwardState(),void this.dispatchEvent(r.TWEEN_YOYO,"onYoyo");this.repeatCounter--,this.repeatDelay>0?(this.elapsed=this.repeatDelay-t,this.setRepeatState()):(this.setPlayingForwardState(),this.dispatchEvent(r.TWEEN_REPEAT,"onRepeat"))}});t.exports=o},55303:t=>{t.exports={CREATED:0,DELAY:2,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING:20,ACTIVE:21,LOOP_DELAY:22,COMPLETE_DELAY:23,START_DELAY:24,PENDING_REMOVE:25,REMOVED:26,FINISHED:27,DESTROYED:28}},56694:t=>{function e(t,e,i){var s=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&s.value&&"object"==typeof s.value&&(s=s.value),!(!s||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(s))&&(void 0===s.enumerable&&(s.enumerable=!0),void 0===s.configurable&&(s.configurable=!0),s)}function i(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function s(t,s,n,o){for(var a in s)if(s.hasOwnProperty(a)){var h=e(s,a,n);if(!1!==h){if(i((o||t).prototype,a)){if(r.ignoreFinals)continue;throw new Error("cannot override final property '"+a+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,a,h)}else t.prototype[a]=s[a]}}function n(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i{t.exports=function(){}},78991:t=>{t.exports=function(t,e,i,s,n){if(void 0===n&&(n=t),i>0){var r=i-t.length;if(r<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),s&&s.call(n,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.splice(o,1),o--;if(0===(o=e.length))return null;i>0&&o>r&&(e.splice(r),o=r);for(var a=0;a{t.exports=function(t,e,i,s,n,r){if(void 0===i&&(i=0),void 0===r&&(r=t),s>0){var o=s-t.length;if(o<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),n&&n.call(r,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.pop(),a--;if(0===(a=e.length))return null;s>0&&a>o&&(e.splice(o),a=o);for(var h=a-1;h>=0;h--){var l=e[h];t.splice(i,0,l),n&&n.call(r,l)}return e}},58742:t=>{t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i{var s=i(45838);t.exports=function(t,e,i,n,r){void 0===n&&(n=0),void 0===r&&(r=t.length);var o=0;if(s(t,n,r))for(var a=n;a{t.exports=function(t,e,i){var s,n=[null];for(s=3;s{var s=i(45838);t.exports=function(t,e,i,n,r){if(void 0===n&&(n=0),void 0===r&&(r=t.length),s(t,n,r)){var o,a=[null];for(o=5;o{t.exports=function(t,e,i){if(!e.length)return NaN;if(1===e.length)return e[0];var s,n,r=1;if(i){if(te.length&&(r=e.length),i?(s=e[r-1][i],(n=e[r][i])-t<=t-s?e[r]:e[r-1]):(s=e[r-1],(n=e[r])-t<=t-s?n:s)}},5454:t=>{var e=function(t,i){void 0===i&&(i=[]);for(var s=0;s{var s=i(45838);t.exports=function(t,e,i,n,r){void 0===n&&(n=0),void 0===r&&(r=t.length);var o=[];if(s(t,n,r))for(var a=n;a{var s=i(45838);t.exports=function(t,e,i,n,r){if(void 0===n&&(n=0),void 0===r&&(r=t.length),s(t,n,r))for(var o=n;o{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var s=e+Math.floor(Math.random()*i);return void 0===t[s]?null:t[s]}},24218:t=>{t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),n=t.indexOf(i);if(s<0||n<0)throw new Error("Supplied items must be elements of the same array");return s>n||(t.splice(s,1),n===t.length-1?t.push(e):t.splice(n,0,e)),t}},58258:t=>{t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),n=t.indexOf(i);if(s<0||n<0)throw new Error("Supplied items must be elements of the same array");return s{t.exports=function(t,e){var i=t.indexOf(e);if(i>0){var s=t[i-1],n=t.indexOf(s);t[i]=s,t[n]=e}return t}},68396:t=>{t.exports=function(t,e,i){var s=t.indexOf(e);if(-1===s||i<0||i>=t.length)throw new Error("Supplied index out of bounds");return s!==i&&(t.splice(s,1),t.splice(i,0,e)),e}},27555:t=>{t.exports=function(t,e){var i=t.indexOf(e);if(-1!==i&&i{t.exports=function(t,e,i,s){var n,r=[],o=!1;if((i||s)&&(o=!0,i||(i=""),s||(s="")),e=e;n--)o?r.push(i+n.toString()+s):r.push(n);else for(n=t;n<=e;n++)o?r.push(i+n.toString()+s):r.push(n);return r}},89955:(t,e,i)=>{var s=i(67233);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var n=[],r=Math.max(s((e-t)/(i||1)),0),o=0;o{function e(t,e,i){var s=t[e];t[e]=t[i],t[i]=s}function i(t,e){return te?1:0}var s=function(t,n,r,o,a){for(void 0===r&&(r=0),void 0===o&&(o=t.length-1),void 0===a&&(a=i);o>r;){if(o-r>600){var h=o-r+1,l=n-r+1,u=Math.log(h),c=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*c*(h-c)/h)*(l-h/2<0?-1:1),p=Math.max(r,Math.floor(n-l*c/h+d)),f=Math.min(o,Math.floor(n+(h-l)*c/h+d));s(t,n,p,f,a)}var v=t[n],g=r,m=o;for(e(t,r,n),a(t[o],v)>0&&e(t,r,o);g0;)m--}0===a(t[r],v)?e(t,r,m):e(t,++m,o),m<=n&&(r=m+1),n<=m&&(o=m-1)}};t.exports=s},75757:(t,e,i)=>{var s=i(10850),n=i(18592),r=function(t,e,i){for(var s=[],n=0;n{var s=i(72677);t.exports=function(t,e,i,n){var r;if(void 0===n&&(n=t),!Array.isArray(e))return-1!==(r=t.indexOf(e))?(s(t,r),i&&i.call(n,e),e):null;for(var o=e.length-1,a=[];o>=0;){var h=e[o];-1!==(r=t.indexOf(h))&&(s(t,r),a.push(h),i&&i.call(n,h)),o--}return a}},8324:(t,e,i)=>{var s=i(72677);t.exports=function(t,e,i,n){if(void 0===n&&(n=t),e<0||e>t.length-1)throw new Error("Index out of bounds");var r=s(t,e);return i&&i.call(n,r),r}},47427:(t,e,i)=>{var s=i(45838);t.exports=function(t,e,i,n,r){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===r&&(r=t),s(t,e,i)){var o=i-e,a=t.splice(e,o);if(n)for(var h=0;h{var s=i(72677);t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var n=e+Math.floor(Math.random()*i);return s(t,n)}},80402:t=>{t.exports=function(t,e,i){var s=t.indexOf(e),n=t.indexOf(i);return-1!==s&&-1===n&&(t[s]=i,!0)}},77640:t=>{t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,s=0;s{t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,s=0;s{t.exports=function(t,e,i,s){var n=t.length;if(e<0||e>n||e>=i||i>n){if(s)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},27847:t=>{t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i>0&&(t.splice(i,1),t.unshift(e)),e}},6034:(t,e,i)=>{var s=i(45838);t.exports=function(t,e,i,n,r){if(void 0===n&&(n=0),void 0===r&&(r=t.length),s(t,n,r))for(var o=n;o{t.exports=function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(Math.random()*(e+1)),s=t[e];t[e]=t[i],t[i]=s}return t}},28834:t=>{t.exports=function(t){var e=/\D/g;return t.sort((function(t,i){return parseInt(t.replace(e,""),10)-parseInt(i.replace(e,""),10)})),t}},72677:t=>{t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,s=t[e],n=e;n{function e(t,e){return String(t).localeCompare(e)}function i(t,e,i,s){var n,r,o,a,h,l=t.length,u=0,c=2*i;for(n=0;nl&&(r=l),o>l&&(o=l),a=n,h=r;;)if(a{t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),n=t.indexOf(i);if(s<0||n<0)throw new Error("Supplied items must be elements of the same array");return t[s]=i,t[n]=e,t}},59959:(t,e,i)=>{t.exports={Matrix:i(13515),Add:i(78991),AddAt:i(48522),BringToTop:i(58742),CountAllMatching:i(30164),Each:i(36337),EachInRange:i(46208),FindClosestInSorted:i(2406),Flatten:i(5454),GetAll:i(71608),GetFirst:i(51463),GetRandom:i(72861),MoveDown:i(51172),MoveTo:i(68396),MoveUp:i(27555),MoveAbove:i(24218),MoveBelow:i(58258),NumberArray:i(13401),NumberArrayStep:i(89955),QuickSelect:i(53466),Range:i(75757),Remove:i(66458),RemoveAt:i(8324),RemoveBetween:i(47427),RemoveRandomElement:i(50147),Replace:i(80402),RotateLeft:i(77640),RotateRight:i(38487),SafeRange:i(45838),SendToBack:i(27847),SetAll:i(6034),Shuffle:i(18592),SortByDigits:i(28834),SpliceOne:i(72677),StableSort:i(17922),Swap:i(96928)}},97494:t=>{t.exports=function(t){if(!Array.isArray(t)||!Array.isArray(t[0]))return!1;for(var e=t[0].length,i=1;i{var s=i(76400),n=i(97494);t.exports=function(t){var e="";if(!n(t))return e;for(var i=0;i{t.exports=function(t){return t.reverse()}},51995:t=>{t.exports=function(t){for(var e=0;e{var s=i(63515);t.exports=function(t){return s(t,180)}},42549:(t,e,i)=>{var s=i(63515);t.exports=function(t){return s(t,90)}},63515:(t,e,i)=>{var s=i(97494),n=i(78581);t.exports=function(t,e){if(void 0===e&&(e=90),!s(t))return null;if("string"!=typeof e&&(e=(e%360+360)%360),90===e||-270===e||"rotateLeft"===e)(t=n(t)).reverse();else if(-90===e||270===e||"rotateRight"===e)t.reverse(),t=n(t);else if(180===Math.abs(e)||"rotate180"===e){for(var i=0;i{var s=i(63515);t.exports=function(t){return s(t,-90)}},27365:(t,e,i)=>{var s=i(77640),n=i(38487);t.exports=function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),0!==i&&(i<0?s(t,Math.abs(i)):n(t,i)),0!==e)for(var r=0;r{t.exports=function(t){for(var e=t.length,i=t[0].length,s=new Array(i),n=0;n-1;r--)s[n][r]=t[r][n]}return s}},13515:(t,e,i)=>{t.exports={CheckMatrix:i(97494),MatrixToString:i(68428),ReverseColumns:i(59521),ReverseRows:i(51995),Rotate180:i(89011),RotateLeft:i(42549),RotateMatrix:i(63515),RotateRight:i(14305),Translate:i(27365),TransposeMatrix:i(78581)}},40581:t=>{var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";t.exports=function(t,i){for(var s=new Uint8Array(t),n=s.length,r=i?"data:"+i+";base64,":"",o=0;o>2],r+=e[(3&s[o])<<4|s[o+1]>>4],r+=e[(15&s[o+1])<<2|s[o+2]>>6],r+=e[63&s[o+2]];return n%3==2?r=r.substring(0,r.length-1)+"=":n%3==1&&(r=r.substring(0,r.length-2)+"=="),r}},82329:t=>{for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(256),s=0;s>4,u[h++]=(15&s)<<4|n>>2,u[h++]=(3&n)<<6|63&r;return l}},78417:(t,e,i)=>{t.exports={ArrayBufferToBase64:i(40581),Base64ToArrayBuffer:i(82329)}},22178:(t,e,i)=>{t.exports={Array:i(59959),Base64:i(78417),Objects:i(64615),String:i(50379),NOOP:i(72283)}},32742:t=>{t.exports=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i]=t[i].slice(0):e[i]=t[i];return e}},28699:t=>{var e=function(t){var i,s,n;if("object"!=typeof t||null===t)return t;for(n in i=Array.isArray(t)?[]:{},t)s=t[n],i[n]=e(s);return i};t.exports=e},98611:(t,e,i)=>{var s=i(42911),n=function(){var t,e,i,r,o,a,h=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof h&&(c=h,h=arguments[1]||{},l=2),u===l&&(h=this,--l);l{var s=i(5923),n=i(10850);t.exports=function(t,e,i){var r=n(t,e,null);if(null===r)return i;if(Array.isArray(r))return s.RND.pick(r);if("object"==typeof r){if(r.hasOwnProperty("randInt"))return s.RND.integerInRange(r.randInt[0],r.randInt[1]);if(r.hasOwnProperty("randFloat"))return s.RND.realInRange(r.randFloat[0],r.randFloat[1])}else if("function"==typeof r)return r(e);return r}},72632:t=>{t.exports=function(t,e,i){var s=typeof t;return t&&"number"!==s&&"string"!==s&&t.hasOwnProperty(e)&&void 0!==t[e]?t[e]:i}},94324:(t,e,i)=>{var s=i(10850),n=i(82897);t.exports=function(t,e,i,r,o){void 0===o&&(o=i);var a=s(t,e,o);return n(a,i,r)}},10850:t=>{t.exports=function(t,e,i,s){if(!t&&!s||"number"==typeof t)return i;if(t&&t.hasOwnProperty(e))return t[e];if(s&&s.hasOwnProperty(e))return s[e];if(-1!==e.indexOf(".")){for(var n=e.split("."),r=t,o=s,a=i,h=i,l=!0,u=!0,c=0;c{t.exports=function(t,e){for(var i=0;i{t.exports=function(t,e){for(var i=0;i{t.exports=function(t,e){return t.hasOwnProperty(e)}},42911:t=>{t.exports=function(t){if("object"!=typeof t||t.nodeType||t===t.window)return!1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0}},30657:(t,e,i)=>{var s=i(32742);t.exports=function(t,e){var i=s(t);for(var n in e)i.hasOwnProperty(n)||(i[n]=e[n]);return i}},72066:(t,e,i)=>{var s=i(32742);t.exports=function(t,e){var i=s(t);for(var n in e)i.hasOwnProperty(n)&&(i[n]=e[n]);return i}},28820:(t,e,i)=>{var s=i(19256);t.exports=function(t,e){for(var i={},n=0;n{t.exports=function(t,e,i){if(!t||"number"==typeof t)return!1;if(t.hasOwnProperty(e))return t[e]=i,!0;if(-1!==e.indexOf(".")){for(var s=e.split("."),n=t,r=t,o=0;o{t.exports={Clone:i(32742),DeepCopy:i(28699),Extend:i(98611),GetAdvancedValue:i(20494),GetFastValue:i(72632),GetMinMaxValue:i(94324),GetValue:i(10850),HasAll:i(87701),HasAny:i(53523),HasValue:i(19256),IsPlainObject:i(42911),Merge:i(30657),MergeRight:i(72066),Pick:i(28820),SetValue:i(22440)}},69429:t=>{t.exports=function(t,e){return t.replace(/%([0-9]+)/g,(function(t,i){return e[Number(i)-1]}))}},76400:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=0),void 0===i&&(i=" "),void 0===s&&(s=3);var n=0;if(e+1>=(t=t.toString()).length)switch(s){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var r=Math.ceil((n=e-t.length)/2);t=new Array(n-r+1).join(i)+t+new Array(r+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},76872:t=>{t.exports=function(t,e){return 0===e?t.slice(1):t.slice(0,e-1)+t.slice(e)}},8051:t=>{t.exports=function(t){return t.split("").reverse().join("")}},76583:t=>{t.exports=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))}},40587:t=>{t.exports=function(t){return t&&t[0].toUpperCase()+t.slice(1)}},50379:(t,e,i)=>{t.exports={Format:i(69429),Pad:i(76400),RemoveAt:i(76872),Reverse:i(8051),UppercaseFirst:i(40587),UUID:i(76583)}}},e={};function i(s){var n=e[s];if(void 0!==n)return n.exports;var r=e[s]={exports:{}};return t[s](r,r.exports,i),r.exports}return i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i(10654)})())); \ No newline at end of file diff --git a/dist/phaser.js b/dist/phaser.js index 54e3c4422..2cab45fe3 100644 --- a/dist/phaser.js +++ b/dist/phaser.js @@ -7,7 +7,7 @@ exports["Phaser"] = factory(); else root["Phaser"] = factory(); -})(this, function() { +})(this, () => { return /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ @@ -360,7 +360,7 @@ if (true) { /** * @author samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -409,7 +409,7 @@ module.exports = AlignTo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -451,7 +451,7 @@ module.exports = Angle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -491,7 +491,7 @@ module.exports = Call; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -550,7 +550,7 @@ module.exports = GetFirst; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -609,7 +609,7 @@ module.exports = GetLast; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -729,7 +729,7 @@ module.exports = GridAlign; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -771,7 +771,7 @@ module.exports = IncAlpha; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -813,7 +813,7 @@ module.exports = IncX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -861,7 +861,7 @@ module.exports = IncXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -903,7 +903,7 @@ module.exports = IncY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -953,7 +953,7 @@ module.exports = PlaceOnCircle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1006,7 +1006,7 @@ module.exports = PlaceOnEllipse; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1051,7 +1051,7 @@ module.exports = PlaceOnLine; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1110,7 +1110,7 @@ module.exports = PlaceOnRectangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1172,7 +1172,7 @@ module.exports = PlaceOnTriangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1217,7 +1217,7 @@ module.exports = PlayAnimation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1285,7 +1285,7 @@ module.exports = PropertyValueInc; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1353,7 +1353,7 @@ module.exports = PropertyValueSet; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1394,7 +1394,7 @@ module.exports = RandomCircle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1435,7 +1435,7 @@ module.exports = RandomEllipse; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1476,7 +1476,7 @@ module.exports = RandomLine; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1515,7 +1515,7 @@ module.exports = RandomRectangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1556,7 +1556,7 @@ module.exports = RandomTriangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1598,7 +1598,7 @@ module.exports = Rotate; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1645,7 +1645,7 @@ module.exports = RotateAround; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1695,7 +1695,7 @@ module.exports = RotateAroundDistance; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1737,7 +1737,7 @@ module.exports = ScaleX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1785,7 +1785,7 @@ module.exports = ScaleXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1827,7 +1827,7 @@ module.exports = ScaleY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1869,7 +1869,7 @@ module.exports = SetAlpha; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1910,7 +1910,7 @@ module.exports = SetBlendMode; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1952,7 +1952,7 @@ module.exports = SetDepth; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -1992,7 +1992,7 @@ module.exports = SetHitArea; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2046,7 +2046,7 @@ module.exports = SetOrigin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2088,7 +2088,7 @@ module.exports = SetRotation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2136,7 +2136,7 @@ module.exports = SetScale; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2178,7 +2178,7 @@ module.exports = SetScaleX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2220,7 +2220,7 @@ module.exports = SetScaleY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2268,7 +2268,7 @@ module.exports = SetScrollFactor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2310,7 +2310,7 @@ module.exports = SetScrollFactorX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2352,7 +2352,7 @@ module.exports = SetScrollFactorY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2392,7 +2392,7 @@ module.exports = SetTint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2431,7 +2431,7 @@ module.exports = SetVisible; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2473,7 +2473,7 @@ module.exports = SetX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2521,7 +2521,7 @@ module.exports = SetXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2563,7 +2563,7 @@ module.exports = SetY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2694,7 +2694,7 @@ module.exports = ShiftPosition; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2728,7 +2728,7 @@ module.exports = Shuffle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2787,7 +2787,7 @@ module.exports = SmoothStep; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2846,7 +2846,7 @@ module.exports = SmootherStep; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2910,7 +2910,7 @@ module.exports = Spread; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2948,7 +2948,7 @@ module.exports = ToggleVisible; /** * @author Richard Davey * @author samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -2997,7 +2997,7 @@ module.exports = WrapInRectangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -3071,7 +3071,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -3987,7 +3987,7 @@ module.exports = Animation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -4175,7 +4175,7 @@ module.exports = AnimationFrame; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -4567,10 +4567,11 @@ var AnimationManager = new Class({ * * @param {string} key - The key of the loaded Aseprite atlas. It must have been loaded prior to calling this method. * @param {string[]} [tags] - An array of Tag names. If provided, only animations found in this array will be created. + * @param {(Phaser.Animations.AnimationManager|Phaser.GameObjects.GameObject)} [target] - Create the animations on this target Sprite. If not given, they will be created globally in this Animation Manager. * * @return {Phaser.Animations.Animation[]} An array of Animation instances that were successfully created. */ - createFromAseprite: function (key, tags) + createFromAseprite: function (key, tags, target) { var output = []; @@ -4607,10 +4608,8 @@ var AnimationManager = new Class({ if (!tags || (tags && tags.indexOf(name) > -1)) { - // Get all the frames for this tag - var tempFrames = []; - var minDuration = Number.MAX_SAFE_INTEGER; - + // Get all the frames for this tag and calculate the total duration in milliseconds. + var totalDuration = 0; for (var i = from; i <= to; i++) { var frameKey = i.toString(); @@ -4619,26 +4618,18 @@ var AnimationManager = new Class({ if (frame) { var frameDuration = GetFastValue(frame, 'duration', Number.MAX_SAFE_INTEGER); - - if (frameDuration < minDuration) - { - minDuration = frameDuration; - } - - tempFrames.push({ frame: frameKey, duration: frameDuration }); + animFrames.push({ key: key, frame: frameKey, duration: frameDuration }); + totalDuration += frameDuration; } } - tempFrames.forEach(function (entry) - { - animFrames.push({ - key: key, - frame: entry.frame, - duration: (entry.duration - minDuration) - }); - }); + // Fix duration to play nice with how the next tick is calculated. + var msPerFrame = totalDuration / animFrames.length; - var totalDuration = (minDuration * animFrames.length); + animFrames.forEach(function (entry) + { + entry.duration -= msPerFrame; + }); if (direction === 'reverse') { @@ -4653,7 +4644,19 @@ var AnimationManager = new Class({ yoyo: (direction === 'pingpong') }; - var result = _this.create(createConfig); + var result; + + if (target) + { + if (target.anims) + { + result = target.anims.create(createConfig); + } + } + else + { + result = _this.create(createConfig); + } if (result) { @@ -4765,14 +4768,15 @@ var AnimationManager = new Class({ * Generates objects with string based frame names, as configured by the given {@link Phaser.Types.Animations.GenerateFrameNames}. * * It's a helper method, designed to make it easier for you to extract all of the frame names from texture atlases. + * * If you're working with a sprite sheet, see the `generateFrameNumbers` method instead. * * Example: * * If you have a texture atlases loaded called `gems` and it contains 6 frames called `ruby_0001`, `ruby_0002`, and so on, - * then you can call this method using: `this.anims.generateFrameNames('gems', { prefix: 'ruby_', end: 6, zeroPad: 4 })`. + * then you can call this method using: `this.anims.generateFrameNames('gems', { prefix: 'ruby_', start: 1, end: 6, zeroPad: 4 })`. * - * The `end` value tells it to look for 6 frames, incrementally numbered, all starting with the prefix `ruby_`. The `zeroPad` + * The `end` value tells it to select frames 1 through 6, incrementally numbered, all starting with the prefix `ruby_`. The `zeroPad` * value tells it how many zeroes pad out the numbers. To create an animation using this method, you can do: * * ```javascript @@ -4859,7 +4863,6 @@ var AnimationManager = new Class({ * If you're working with a texture atlas, see the `generateFrameNames` method instead. * * It's a helper method, designed to make it easier for you to extract frames from sprite sheets. - * If you're working with a texture atlas, see the `generateFrameNames` method instead. * * Example: * @@ -5188,7 +5191,7 @@ module.exports = AnimationManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -5660,7 +5663,7 @@ var AnimationState = new Class({ * @method Phaser.Animations.AnimationState#chain * @since 3.16.0 * - * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig|string[]|Phaser.Animations.Animation[]|Phaser.Types.Animations.PlayAnimationConfig[])} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object, or an array of them. + * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig|string[]|Phaser.Animations.Animation[]|Phaser.Types.Animations.PlayAnimationConfig[])} [key] - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object, or an array of them. * * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. */ @@ -6889,6 +6892,93 @@ var AnimationState = new Class({ return anim; }, + /** + * Create one, or more animations from a loaded Aseprite JSON file. + * + * Aseprite is a powerful animated sprite editor and pixel art tool. + * + * You can find more details at https://www.aseprite.org/ + * + * To export a compatible JSON file in Aseprite, please do the following: + * + * 1. Go to "File - Export Sprite Sheet" + * + * 2. On the **Layout** tab: + * 2a. Set the "Sheet type" to "Packed" + * 2b. Set the "Constraints" to "None" + * 2c. Check the "Merge Duplicates" checkbox + * + * 3. On the **Sprite** tab: + * 3a. Set "Layers" to "Visible layers" + * 3b. Set "Frames" to "All frames", unless you only wish to export a sub-set of tags + * + * 4. On the **Borders** tab: + * 4a. Check the "Trim Sprite" and "Trim Cells" options + * 4b. Ensure "Border Padding", "Spacing" and "Inner Padding" are all > 0 (1 is usually enough) + * + * 5. On the **Output** tab: + * 5a. Check "Output File", give your image a name and make sure you choose "png files" as the file type + * 5b. Check "JSON Data" and give your json file a name + * 5c. The JSON Data type can be either a Hash or Array, Phaser doesn't mind. + * 5d. Make sure "Tags" is checked in the Meta options + * 5e. In the "Item Filename" input box, make sure it says just "{frame}" and nothing more. + * + * 6. Click export + * + * This was tested with Aseprite 1.2.25. + * + * This will export a png and json file which you can load using the Aseprite Loader, i.e.: + * + * ```javascript + * function preload () + * { + * this.load.path = 'assets/animations/aseprite/'; + * this.load.aseprite('paladin', 'paladin.png', 'paladin.json'); + * } + * ``` + * + * Once loaded, you can call this method on a Sprite with the 'atlas' key: + * + * ```javascript + * const sprite = this.add.sprite(400, 300); + * + * sprite.anims.createFromAseprite('paladin'); + * ``` + * + * Any animations defined in the JSON will now be available to use on this Sprite and you play them + * via their Tag name. For example, if you have an animation called 'War Cry' on your Aseprite timeline, + * you can play it on the Sprite using that Tag name: + * + * ```javascript + * const sprite = this.add.sprite(400, 300); + * + * sprite.anims.createFromAseprite('paladin'); + * + * sprite.play('War Cry'); + * ``` + * + * When calling this method you can optionally provide an array of tag names, and only those animations + * will be created. For example: + * + * ```javascript + * sprite.anims.createFromAseprite('paladin', [ 'step', 'War Cry', 'Magnum Break' ]); + * ``` + * + * This will only create the 3 animations defined. Note that the tag names are case-sensitive. + * + * @method Phaser.Animations.AnimationState#createFromAseprite + * @since 3.60.0 + * + * @param {string} key - The key of the loaded Aseprite atlas. It must have been loaded prior to calling this method. + * @param {string[]} [tags] - An array of Tag names. If provided, only animations found in this array will be created. + * + * @return {Phaser.Animations.Animation[]} An array of Animation instances that were successfully created. + */ + createFromAseprite: function (key, tags) + { + return this.animationManager.createFromAseprite(key, tags, this.parent); + }, + /** * Generate an array of {@link Phaser.Types.Animations.AnimationFrame} objects from a texture key and configuration object. * @@ -7066,7 +7156,7 @@ module.exports = AnimationState; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7094,7 +7184,7 @@ module.exports = 'add'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7141,7 +7231,7 @@ module.exports = 'animationcomplete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7192,7 +7282,7 @@ module.exports = 'animationcomplete-'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7236,7 +7326,7 @@ module.exports = 'animationrepeat'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7278,7 +7368,7 @@ module.exports = 'animationrestart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7321,7 +7411,7 @@ module.exports = 'animationstart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7364,7 +7454,7 @@ module.exports = 'animationstop'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7411,7 +7501,7 @@ module.exports = 'animationupdate'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7436,7 +7526,7 @@ module.exports = 'pauseall'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7461,7 +7551,7 @@ module.exports = 'remove'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7485,7 +7575,7 @@ module.exports = 'resumeall'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7517,7 +7607,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7543,7 +7633,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7730,7 +7820,7 @@ module.exports = BaseCache; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7965,7 +8055,7 @@ module.exports = CacheManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -7991,7 +8081,7 @@ module.exports = 'add'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -8017,7 +8107,7 @@ module.exports = 'remove'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -8040,7 +8130,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -8064,7 +8154,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -10043,7 +10133,7 @@ module.exports = BaseCamera; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -10851,7 +10941,7 @@ module.exports = Camera; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -11469,7 +11559,7 @@ var CameraManager = new Class({ * @since 3.50.0 * * @param {Phaser.GameObjects.GameObject[]} children - An array of Game Objects to be checked against the camera. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera to filte the Game Objects against. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera to filter the Game Objects against. * * @return {Phaser.GameObjects.GameObject[]} A filtered list of only Game Objects within the Scene that will render against the given Camera. */ @@ -11636,7 +11726,7 @@ module.exports = CameraManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -12025,7 +12115,7 @@ module.exports = Fade; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -12388,7 +12478,7 @@ module.exports = Flash; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -13148,7 +13238,7 @@ module.exports = RotateTo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -13468,7 +13558,7 @@ module.exports = Shake; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -13762,7 +13852,7 @@ module.exports = Zoom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -13789,7 +13879,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -13813,7 +13903,7 @@ module.exports = 'cameradestroy'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -13840,7 +13930,7 @@ module.exports = 'camerafadeincomplete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -13871,7 +13961,7 @@ module.exports = 'camerafadeinstart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -13898,7 +13988,7 @@ module.exports = 'camerafadeoutcomplete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -13929,7 +14019,7 @@ module.exports = 'camerafadeoutstart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -13954,7 +14044,7 @@ module.exports = 'cameraflashcomplete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -13983,7 +14073,7 @@ module.exports = 'cameraflashstart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14012,7 +14102,7 @@ module.exports = 'followupdate'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14037,7 +14127,7 @@ module.exports = 'camerapancomplete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14065,7 +14155,7 @@ module.exports = 'camerapanstart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14092,7 +14182,7 @@ module.exports = 'postrender'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14119,7 +14209,7 @@ module.exports = 'prerender'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14144,7 +14234,7 @@ module.exports = 'camerarotatecomplete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14171,7 +14261,7 @@ module.exports = 'camerarotatestart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14196,7 +14286,7 @@ module.exports = 'camerashakecomplete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14223,7 +14313,7 @@ module.exports = 'camerashakestart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14248,7 +14338,7 @@ module.exports = 'camerazoomcomplete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14275,7 +14365,7 @@ module.exports = 'camerazoomstart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14314,7 +14404,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14340,7 +14430,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -14672,7 +14762,7 @@ module.exports = FixedKeyControl; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -15180,7 +15270,7 @@ module.exports = SmoothedKeyControl; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -15203,7 +15293,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -15230,7 +15320,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -15250,7 +15340,7 @@ var CONST = { * @type {string} * @since 3.0.0 */ - VERSION: '3.60.0-beta.3', + VERSION: '3.60.0-beta.10', BlendModes: __webpack_require__(95723), @@ -15375,7 +15465,7 @@ module.exports = CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -15421,97 +15511,79 @@ var Config = new Class({ var defaultBannerTextColor = '#ffffff'; + // Scale Manager - Anything set in here over-rides anything set in the core game config + + var scaleConfig = GetValue(config, 'scale', null); + /** * @const {(number|string)} Phaser.Core.Config#width - The width of the underlying canvas, in pixels. */ - this.width = GetValue(config, 'width', 1024); + this.width = GetValue(scaleConfig, 'width', 1024, config); /** * @const {(number|string)} Phaser.Core.Config#height - The height of the underlying canvas, in pixels. */ - this.height = GetValue(config, 'height', 768); + this.height = GetValue(scaleConfig, 'height', 768, config); /** * @const {(Phaser.Scale.ZoomType|number)} Phaser.Core.Config#zoom - The zoom factor, as used by the Scale Manager. */ - this.zoom = GetValue(config, 'zoom', 1); + this.zoom = GetValue(scaleConfig, 'zoom', 1, config); /** * @const {?*} Phaser.Core.Config#parent - A parent DOM element into which the canvas created by the renderer will be injected. */ - this.parent = GetValue(config, 'parent', undefined); + this.parent = GetValue(scaleConfig, 'parent', undefined, config); /** * @const {Phaser.Scale.ScaleModeType} Phaser.Core.Config#scaleMode - The scale mode as used by the Scale Manager. The default is zero, which is no scaling. */ - this.scaleMode = GetValue(config, 'scaleMode', 0); + this.scaleMode = GetValue(scaleConfig, (scaleConfig) ? 'mode' : 'scaleMode', 0, config); /** * @const {boolean} Phaser.Core.Config#expandParent - Is the Scale Manager allowed to adjust the CSS height property of the parent to be 100%? */ - this.expandParent = GetValue(config, 'expandParent', true); + this.expandParent = GetValue(scaleConfig, 'expandParent', true, config); /** * @const {boolean} Phaser.Core.Config#autoRound - Automatically round the display and style sizes of the canvas. This can help with performance in lower-powered devices. */ - this.autoRound = GetValue(config, 'autoRound', false); + this.autoRound = GetValue(scaleConfig, 'autoRound', false, config); /** * @const {Phaser.Scale.CenterType} Phaser.Core.Config#autoCenter - Automatically center the canvas within the parent? */ - this.autoCenter = GetValue(config, 'autoCenter', 0); + this.autoCenter = GetValue(scaleConfig, 'autoCenter', 0, config); /** * @const {number} Phaser.Core.Config#resizeInterval - How many ms should elapse before checking if the browser size has changed? */ - this.resizeInterval = GetValue(config, 'resizeInterval', 500); + this.resizeInterval = GetValue(scaleConfig, 'resizeInterval', 500, config); /** * @const {?(HTMLElement|string)} Phaser.Core.Config#fullscreenTarget - The DOM element that will be sent into full screen mode, or its `id`. If undefined Phaser will create its own div and insert the canvas into it when entering fullscreen mode. */ - this.fullscreenTarget = GetValue(config, 'fullscreenTarget', null); + this.fullscreenTarget = GetValue(scaleConfig, 'fullscreenTarget', null, config); /** * @const {number} Phaser.Core.Config#minWidth - The minimum width, in pixels, the canvas will scale down to. A value of zero means no minimum. */ - this.minWidth = GetValue(config, 'minWidth', 0); + this.minWidth = GetValue(scaleConfig, 'minWidth', 0, config); /** * @const {number} Phaser.Core.Config#maxWidth - The maximum width, in pixels, the canvas will scale up to. A value of zero means no maximum. */ - this.maxWidth = GetValue(config, 'maxWidth', 0); + this.maxWidth = GetValue(scaleConfig, 'maxWidth', 0, config); /** * @const {number} Phaser.Core.Config#minHeight - The minimum height, in pixels, the canvas will scale down to. A value of zero means no minimum. */ - this.minHeight = GetValue(config, 'minHeight', 0); + this.minHeight = GetValue(scaleConfig, 'minHeight', 0, config); /** * @const {number} Phaser.Core.Config#maxHeight - The maximum height, in pixels, the canvas will scale up to. A value of zero means no maximum. */ - this.maxHeight = GetValue(config, 'maxHeight', 0); - - // Scale Manager - Anything set in here over-rides anything set above - - var scaleConfig = GetValue(config, 'scale', null); - - if (scaleConfig) - { - this.width = GetValue(scaleConfig, 'width', this.width); - this.height = GetValue(scaleConfig, 'height', this.height); - this.zoom = GetValue(scaleConfig, 'zoom', this.zoom); - this.parent = GetValue(scaleConfig, 'parent', this.parent); - this.scaleMode = GetValue(scaleConfig, 'mode', this.scaleMode); - this.expandParent = GetValue(scaleConfig, 'expandParent', this.expandParent); - this.autoRound = GetValue(scaleConfig, 'autoRound', this.autoRound); - this.autoCenter = GetValue(scaleConfig, 'autoCenter', this.autoCenter); - this.resizeInterval = GetValue(scaleConfig, 'resizeInterval', this.resizeInterval); - this.fullscreenTarget = GetValue(scaleConfig, 'fullscreenTarget', this.fullscreenTarget); - this.minWidth = GetValue(scaleConfig, 'min.width', this.minWidth); - this.maxWidth = GetValue(scaleConfig, 'max.width', this.maxWidth); - this.minHeight = GetValue(scaleConfig, 'min.height', this.minHeight); - this.maxHeight = GetValue(scaleConfig, 'max.height', this.maxHeight); - } + this.maxHeight = GetValue(scaleConfig, 'maxHeight', 0, config); /** * @const {number} Phaser.Core.Config#renderType - Force Phaser to use a specific renderer. Can be `CONST.CANVAS`, `CONST.WEBGL`, `CONST.HEADLESS` or `CONST.AUTO` (default) @@ -15711,45 +15783,44 @@ var Config = new Class({ */ this.fps = GetValue(config, 'fps', null); - // Renderer Settings - // These can either be in a `render` object within the Config, or specified on their own + // Render Settings - Anything set in here over-rides anything set in the core game config - var renderConfig = GetValue(config, 'render', config); + var renderConfig = GetValue(config, 'render', null); /** * @const {Phaser.Types.Core.PipelineConfig} Phaser.Core.Config#pipeline - An object mapping WebGL names to WebGLPipeline classes. These should be class constructors, not instances. */ - this.pipeline = GetValue(renderConfig, 'pipeline', null); + this.pipeline = GetValue(renderConfig, 'pipeline', null, config); /** * @const {boolean} Phaser.Core.Config#antialias - When set to `true`, WebGL uses linear interpolation to draw scaled or rotated textures, giving a smooth appearance. When set to `false`, WebGL uses nearest-neighbor interpolation, giving a crisper appearance. `false` also disables antialiasing of the game canvas itself, if the browser supports it, when the game canvas is scaled. */ - this.antialias = GetValue(renderConfig, 'antialias', true); + this.antialias = GetValue(renderConfig, 'antialias', true, config); /** * @const {boolean} Phaser.Core.Config#antialiasGL - Sets the `antialias` property when the WebGL context is created. Setting this value does not impact any subsequent textures that are created, or the canvas style attributes. */ - this.antialiasGL = GetValue(renderConfig, 'antialiasGL', true); + this.antialiasGL = GetValue(renderConfig, 'antialiasGL', true, config); /** * @const {string} Phaser.Core.Config#mipmapFilter - Sets the `mipmapFilter` property when the WebGL renderer is created. */ - this.mipmapFilter = GetValue(renderConfig, 'mipmapFilter', 'LINEAR'); + this.mipmapFilter = GetValue(renderConfig, 'mipmapFilter', 'LINEAR', config); /** * @const {boolean} Phaser.Core.Config#desynchronized - When set to `true` it will create a desynchronized context for both 2D and WebGL. See https://developers.google.com/web/updates/2019/05/desynchronized for details. */ - this.desynchronized = GetValue(renderConfig, 'desynchronized', false); + this.desynchronized = GetValue(renderConfig, 'desynchronized', false, config); /** * @const {boolean} Phaser.Core.Config#roundPixels - Draw texture-based Game Objects at only whole-integer positions. Game Objects without textures, like Graphics, ignore this property. */ - this.roundPixels = GetValue(renderConfig, 'roundPixels', false); + this.roundPixels = GetValue(renderConfig, 'roundPixels', false, config); /** * @const {boolean} Phaser.Core.Config#pixelArt - Prevent pixel art from becoming blurred when scaled. It will remain crisp (tells the WebGL renderer to automatically create textures using a linear filter mode). */ - this.pixelArt = GetValue(renderConfig, 'pixelArt', this.zoom !== 1); + this.pixelArt = GetValue(renderConfig, 'pixelArt', this.zoom !== 1, config); if (this.pixelArt) { @@ -15761,47 +15832,47 @@ var Config = new Class({ /** * @const {boolean} Phaser.Core.Config#transparent - Whether the game canvas will have a transparent background. */ - this.transparent = GetValue(renderConfig, 'transparent', false); + this.transparent = GetValue(renderConfig, 'transparent', false, config); /** * @const {boolean} Phaser.Core.Config#clearBeforeRender - Whether the game canvas will be cleared between each rendering frame. You can disable this if you have a full-screen background image or game object. */ - this.clearBeforeRender = GetValue(renderConfig, 'clearBeforeRender', true); + this.clearBeforeRender = GetValue(renderConfig, 'clearBeforeRender', true, config); /** * @const {boolean} Phaser.Core.Config#preserveDrawingBuffer - If the value is true the WebGL buffers will not be cleared and will preserve their values until cleared or overwritten by the author. */ - this.preserveDrawingBuffer = GetValue(renderConfig, 'preserveDrawingBuffer', false); + this.preserveDrawingBuffer = GetValue(renderConfig, 'preserveDrawingBuffer', false, config); /** * @const {boolean} Phaser.Core.Config#premultipliedAlpha - In WebGL mode, sets the drawing buffer to contain colors with pre-multiplied alpha. */ - this.premultipliedAlpha = GetValue(renderConfig, 'premultipliedAlpha', true); + this.premultipliedAlpha = GetValue(renderConfig, 'premultipliedAlpha', true, config); /** * @const {boolean} Phaser.Core.Config#failIfMajorPerformanceCaveat - Let the browser abort creating a WebGL context if it judges performance would be unacceptable. */ - this.failIfMajorPerformanceCaveat = GetValue(renderConfig, 'failIfMajorPerformanceCaveat', false); + this.failIfMajorPerformanceCaveat = GetValue(renderConfig, 'failIfMajorPerformanceCaveat', false, config); /** * @const {string} Phaser.Core.Config#powerPreference - "high-performance", "low-power" or "default". A hint to the browser on how much device power the game might use. */ - this.powerPreference = GetValue(renderConfig, 'powerPreference', 'default'); + this.powerPreference = GetValue(renderConfig, 'powerPreference', 'default', config); /** * @const {number} Phaser.Core.Config#batchSize - The default WebGL Batch size. Represents the number of _quads_ that can be added to a single batch. */ - this.batchSize = GetValue(renderConfig, 'batchSize', 4096); + this.batchSize = GetValue(renderConfig, 'batchSize', 4096, config); /** * @const {number} Phaser.Core.Config#maxTextures - When in WebGL mode, this sets the maximum number of GPU Textures to use. The default, -1, will use all available units. The WebGL1 spec says all browsers should provide a minimum of 8. */ - this.maxTextures = GetValue(renderConfig, 'maxTextures', -1); + this.maxTextures = GetValue(renderConfig, 'maxTextures', -1, config); /** * @const {number} Phaser.Core.Config#maxLights - The maximum number of lights allowed to be visible within range of a single Camera in the LightManager. */ - this.maxLights = GetValue(renderConfig, 'maxLights', 10); + this.maxLights = GetValue(renderConfig, 'maxLights', 10, config); var bgc = GetValue(config, 'backgroundColor', 0); @@ -15849,9 +15920,7 @@ var Config = new Class({ /** * @const {number} Phaser.Core.Config#loaderMaxParallelDownloads - Maximum parallel downloads allowed for resources (Default to 32). */ - var defaultParallel = (Device.os.android) ? 6 : 32; - - this.loaderMaxParallelDownloads = GetValue(config, 'loader.maxParallelDownloads', defaultParallel); + this.loaderMaxParallelDownloads = GetValue(config, 'loader.maxParallelDownloads', (Device.os.android) ? 6 : 32); /** * @const {(string|undefined)} Phaser.Core.Config#loaderCrossOrigin - 'anonymous', 'use-credentials', or `undefined`. If you're not making cross-origin requests, leave this as `undefined`. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes}. @@ -15893,6 +15962,14 @@ var Config = new Class({ */ this.loaderImageLoadType = GetValue(config, 'loader.imageLoadType', 'XHR'); + // On iOS, Capacitor often runs on a capacitor:// protocol, meaning local files are served from capacitor:// rather than file:// + // See: https://github.com/photonstorm/phaser/issues/5685 + + /** + * @const {string[]} Phaser.Core.Config#loaderLocalScheme - An array of schemes that the Loader considers as being 'local' files. Defaults to: `[ 'file://', 'capacitor://' ]`. + */ + this.loaderLocalScheme = GetValue(config, 'loader.localScheme', [ 'file://', 'capacitor://' ]); + /* * Allows `plugins` property to either be an array, in which case it just replaces * the default plugins like previously, or a config object. @@ -15995,7 +16072,7 @@ module.exports = Config; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -16124,7 +16201,7 @@ module.exports = CreateRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -16255,7 +16332,7 @@ module.exports = DebugHeader; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -16802,6 +16879,22 @@ var Game = new Class({ this.events.emit(Events.PAUSE); }, + /** + * This will pause the entire game and emit a `PAUSE` event. + * + * All of Phaser's internal systems will be paused and the game will not re-render. + * + * Note that it does not pause any Loader requests that are currently in-flight. + * + * @method Phaser.Game#pause + * @fires Phaser.Core.Events#PAUSE + * @since 3.60.0 + */ + pause: function () + { + this.onHidden(); + }, + /** * Called automatically by the Visibility Handler. * This will resume the main loop and then emit a resume event. @@ -16818,6 +16911,20 @@ var Game = new Class({ this.events.emit(Events.RESUME); }, + /** + * This will resume the entire game and emit a `RESUME` event. + * + * All of Phaser's internal systems will be resumed and the game will start rendering again. + * + * @method Phaser.Game#resume + * @fires Phaser.Core.Events#RESUME + * @since 3.60.0 + */ + resume: function () + { + this.onVisible(); + }, + /** * Called automatically by the Visibility Handler. * This will set the main loop into a 'blurred' state, which pauses it. @@ -16959,7 +17066,7 @@ module.exports = Game; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -16974,11 +17081,11 @@ var RequestAnimationFrame = __webpack_require__(27385); * @classdesc * The core runner class that Phaser uses to handle the game loop. It can use either Request Animation Frame, * or SetTimeout, based on browser support and config settings, to create a continuous loop within the browser. - * + * * Each time the loop fires, `TimeStep.step` is called and this is then passed onto the core Game update loop, * it is the core heartbeat of your game. It will fire as often as Request Animation Frame is capable of handling * on the target device. - * + * * Note that there are lots of situations where a browser will stop updating your game. Such as if the player * switches tabs, or covers up the browser window with another application. In these cases, the 'heartbeat' * of your game will pause, and only resume when focus is returned to it by the player. There is no way to avoid @@ -17047,6 +17154,9 @@ var TimeStep = new Class({ /** * The minimum fps rate you want the Time Step to run at. * + * Setting this cannot guarantee the browser runs at this rate, it merely influences + * the internal timing values to help the Timestep know when it has gone out of sync. + * * @name Phaser.Core.TimeStep#minFps * @type {number} * @default 5 @@ -17069,7 +17179,57 @@ var TimeStep = new Class({ this.targetFps = GetValue(config, 'target', 60); /** - * The minFps value in ms. + * Enforce a frame rate limit. This forces how often the Game step will run. By default it is zero, + * which means it will run at whatever limit the browser (via RequestAnimationFrame) can handle, which + * is the optimum rate for fast-action or responsive games. + * + * However, if you are building a non-game app, like a graphics generator, or low-intensity game that doesn't + * require 60fps, then you can lower the step rate via this Game Config value: + * + * ```js + * fps: { + * limit: 30 + * } + * ``` + * + * Setting this _beyond_ the rate of RequestAnimationFrame will make no difference at all. + * + * Use it purely to _restrict_ updates in low-intensity situations only. + * + * @name Phaser.Core.TimeStep#fpsLimit + * @type {number} + * @default 0 + * @since 3.60.0 + */ + this.fpsLimit = GetValue(config, 'limit', 0); + + /** + * Is the FPS rate limited? + * + * This is set by setting the Game Config `limit` value to a value above zero. + * + * Consider this property as read-only. + * + * @name Phaser.Core.TimeStep#hasFpsLimit + * @type {boolean} + * @default false + * @since 3.60.0 + */ + this.hasFpsLimit = (this.fpsLimit > 0); + + /** + * Internal value holding the fps rate limit in ms. + * + * @name Phaser.Core.TimeStep#_limitRate + * @type {number} + * @private + * @since 3.60.0 + */ + this._limitRate = (this.hasFpsLimit) ? (1000 / this.fpsLimit) : 0; + + /** + * The minimum fps value in ms. + * * Defaults to 200ms between frames (i.e. super slow!) * * @name Phaser.Core.TimeStep#_min @@ -17080,7 +17240,8 @@ var TimeStep = new Class({ this._min = 1000 / this.minFps; /** - * The targetFps value in ms. + * The target fps value in ms. + * * Defaults to 16.66ms between frames (i.e. normal) * * @name Phaser.Core.TimeStep#_target @@ -17103,6 +17264,7 @@ var TimeStep = new Class({ /** * The time at which the next fps rate update will take place. + * * When an fps update happens, the `framesThisSecond` value is reset. * * @name Phaser.Core.TimeStep#nextFpsUpdate @@ -17125,7 +17287,7 @@ var TimeStep = new Class({ this.framesThisSecond = 0; /** - * A callback to be invoked each time the Time Step steps. + * A callback to be invoked each time the TimeStep steps. * * @name Phaser.Core.TimeStep#callback * @type {Phaser.Types.Core.TimeStepCallback} @@ -17135,7 +17297,7 @@ var TimeStep = new Class({ this.callback = NOOP; /** - * You can force the Time Step to use Set Timeout instead of Request Animation Frame by setting + * You can force the TimeStep to use SetTimeOut instead of Request Animation Frame by setting * the `forceSetTimeOut` property to `true` in the Game Configuration object. It cannot be changed at run-time. * * @name Phaser.Core.TimeStep#forceSetTimeOut @@ -17147,7 +17309,10 @@ var TimeStep = new Class({ this.forceSetTimeOut = GetValue(config, 'forceSetTimeOut', false); /** - * The time, calculated at the start of the current step, as smoothed by the delta value. + * The time, updated each step by adding the elapsed delta time to the previous value. + * + * This differs from the `TimeStep.now` value, which is the high resolution time value + * as provided by Request Animation Frame. * * @name Phaser.Core.TimeStep#time * @type {number} @@ -17157,8 +17322,9 @@ var TimeStep = new Class({ this.time = 0; /** - * The time at which the game started running. This value is adjusted if the game is then - * paused and resumes. + * The time at which the game started running. + * + * This value is adjusted if the game is then paused and resumes. * * @name Phaser.Core.TimeStep#startTime * @type {number} @@ -17168,7 +17334,9 @@ var TimeStep = new Class({ this.startTime = 0; /** - * The time, as returned by `performance.now` of the previous step. + * The time of the previous step. + * + * This is typically a high resolution timer value, as provided by Request Animation Frame. * * @name Phaser.Core.TimeStep#lastTime * @type {number} @@ -17191,6 +17359,7 @@ var TimeStep = new Class({ /** * Is the browser currently considered in focus by the Page Visibility API? + * * This value is set in the `blur` method, which is called automatically by the Game instance. * * @name Phaser.Core.TimeStep#inFocus @@ -17254,7 +17423,7 @@ var TimeStep = new Class({ /** * The maximum number of delta values that are retained in order to calculate a smoothed moving average. - * + * * This can be changed in the Game Config via the `fps.deltaHistory` property. The default is 10. * * @name Phaser.Core.TimeStep#deltaSmoothingMax @@ -17267,7 +17436,7 @@ var TimeStep = new Class({ /** * The number of frames that the cooldown is set to after the browser panics over the FPS rate, usually * as a result of switching tabs and regaining focus. - * + * * This can be changed in the Game Config via the `fps.panicMax` property. The default is 120. * * @name Phaser.Core.TimeStep#panicMax @@ -17279,7 +17448,7 @@ var TimeStep = new Class({ /** * The actual elapsed time in ms between one update and the next. - * + * * Unlike with `delta`, no smoothing, capping, or averaging is applied to this value. * So please be careful when using this value in math calculations. * @@ -17291,7 +17460,10 @@ var TimeStep = new Class({ this.rawDelta = 0; /** - * The time, as returned by `performance.now` at the very start of the current step. + * The time, set at the start of the current step. + * + * This is typically a high resolution timer value, as provided by Request Animation Frame. + * * This can differ from the `time` value in that it isn't calculated based on the delta value. * * @name Phaser.Core.TimeStep#now @@ -17303,9 +17475,9 @@ var TimeStep = new Class({ /** * Apply smoothing to the delta value used within Phasers internal calculations? - * + * * This can be changed in the Game Config via the `fps.smoothStep` property. The default is `true`. - * + * * Smoothing helps settle down the delta values after browser tab switches, or other situations * which could cause significant delta spikes or dips. By default it has been enabled in Phaser 3 * since the first version, but is now exposed under this property (and the corresponding game config @@ -17425,7 +17597,159 @@ var TimeStep = new Class({ this.callback = callback; - this.raf.start(this.step.bind(this), this.forceSetTimeOut, this._target); + var step = (this.hasFpsLimit) ? this.stepLimitFPS.bind(this) : this.step.bind(this); + + this.raf.start(step, this.forceSetTimeOut, this._target); + }, + + /** + * Takes the delta value and smooths it based on the previous frames. + * + * Called automatically as part of the step. + * + * @method Phaser.Core.TimeStep#smoothDelta + * @since 3.60.0 + * + * @param {number} delta - The delta value for this step. + * + * @return {number} The smoothed delta value. + */ + smoothDelta: function (delta) + { + var idx = this.deltaIndex; + var history = this.deltaHistory; + var max = this.deltaSmoothingMax; + + if (this._coolDown > 0 || !this.inFocus) + { + this._coolDown--; + + delta = Math.min(delta, this._target); + } + + if (delta > this._min) + { + // Probably super bad start time or browser tab context loss, + // so use the last 'sane' delta value + + delta = history[idx]; + + // Clamp delta to min (in case history has become corrupted somehow) + delta = Math.min(delta, this._min); + } + + // Smooth out the delta over the previous X frames + + // add the delta to the smoothing array + history[idx] = delta; + + // adjusts the delta history array index based on the smoothing count + // this stops the array growing beyond the size of deltaSmoothingMax + this.deltaIndex++; + + if (this.deltaIndex >= max) + { + this.deltaIndex = 0; + } + + // Loop the history array, adding the delta values together + var avg = 0; + + for (var i = 0; i < max; i++) + { + avg += history[i]; + } + + // Then divide by the array length to get the average delta + avg /= max; + + return avg; + }, + + /** + * Update the estimate of the frame rate, `fps`. Every second, the number + * of frames that occurred in that second are included in an exponential + * moving average of all frames per second, with an alpha of 0.25. This + * means that more recent seconds affect the estimated frame rate more than + * older seconds. + * + * When a browser window is NOT minimized, but is covered up (i.e. you're using + * another app which has spawned a window over the top of the browser), then it + * will start to throttle the raf callback time. It waits for a while, and then + * starts to drop the frame rate at 1 frame per second until it's down to just over 1fps. + * So if the game was running at 60fps, and the player opens a new window, then + * after 60 seconds (+ the 'buffer time') it'll be down to 1fps, so rafin'g at 1Hz. + * + * When they make the game visible again, the frame rate is increased at a rate of + * approx. 8fps, back up to 60fps (or the max it can obtain) + * + * There is no easy way to determine if this drop in frame rate is because the + * browser is throttling raf, or because the game is struggling with performance + * because you're asking it to do too much on the device. + * + * Compute the new exponential moving average with an alpha of 0.25. + * + * @method Phaser.Core.TimeStep#updateFPS + * @since 3.60.0 + * + * @param {number} time - The timestamp passed in from RequestAnimationFrame or setTimeout. + */ + updateFPS: function (time) + { + this.actualFps = 0.25 * this.framesThisSecond + 0.75 * this.actualFps; + this.nextFpsUpdate = time + 1000; + this.framesThisSecond = 0; + }, + + /** + * The main step method with an fps limiter. This is called each time the browser updates, either by Request Animation Frame, + * or by Set Timeout. It is responsible for calculating the delta values, frame totals, cool down history and more. + * You generally should never call this method directly. + * + * @method Phaser.Core.TimeStep#stepLimitFPS + * @since 3.60.0 + * + * @param {number} time - The timestamp passed in from RequestAnimationFrame or setTimeout. + */ + stepLimitFPS: function (time) + { + this.now = time; + + // delta time (time is in ms) + // Math.max because Chrome will sometimes give negative deltas + var delta = Math.max(0, time - this.lastTime); + + this.rawDelta = delta; + + // Real-world timer advance + this.time += this.rawDelta; + + if (this.smoothStep) + { + delta = this.smoothDelta(delta); + } + + // Set as the world delta value (after smoothing, if applied) + this.delta += delta; + + if (time >= this.nextFpsUpdate) + { + this.updateFPS(time); + } + + this.framesThisSecond++; + + if (this.delta >= this._limitRate) + { + this.callback(time, this.delta); + + this.delta = 0; + } + + // Shift time value over + this.lastTime = time; + + this.frame++; }, /** @@ -17435,127 +17759,38 @@ var TimeStep = new Class({ * * @method Phaser.Core.TimeStep#step * @since 3.0.0 + * + * @param {number} time - The timestamp passed in from RequestAnimationFrame or setTimeout. */ - step: function () + step: function (time) { - // Because the timestamp passed in from raf represents the beginning of the main thread frame that we’re currently in, - // not the actual time now, and as we want to compare this time value against Event timeStamps and the like, we need a - // more accurate one: - - var time = window.performance.now(); - this.now = time; - var before = time - this.lastTime; - - if (before < 0) - { - // Because, Chrome. - before = 0; - } - - this.rawDelta = before; - - var idx = this.deltaIndex; - var history = this.deltaHistory; - var max = this.deltaSmoothingMax; - // delta time (time is in ms) - var dt = before; + // Math.max because Chrome will sometimes give negative deltas + var delta = Math.max(0, time - this.lastTime); - // Delta Average - var avg = before; - - // When a browser switches tab, then comes back again, it takes around 10 frames before - // the delta time settles down so we employ a 'cooling down' period before we start - // trusting the delta values again, to avoid spikes flooding through our delta average - - if (this.smoothStep) - { - if (this._coolDown > 0 || !this.inFocus) - { - this._coolDown--; - - dt = Math.min(dt, this._target); - } - - if (dt > this._min) - { - // Probably super bad start time or browser tab context loss, - // so use the last 'sane' dt value - - dt = history[idx]; - - // Clamp delta to min (in case history has become corrupted somehow) - dt = Math.min(dt, this._min); - } - - // Smooth out the delta over the previous X frames - - // add the delta to the smoothing array - history[idx] = dt; - - // adjusts the delta history array index based on the smoothing count - // this stops the array growing beyond the size of deltaSmoothingMax - this.deltaIndex++; - - if (this.deltaIndex > max) - { - this.deltaIndex = 0; - } - - // Loop the history array, adding the delta values together - avg = 0; - - for (var i = 0; i < max; i++) - { - avg += history[i]; - } - - // Then divide by the array length to get the average delta - avg /= max; - } - - // Set as the world delta value - this.delta = avg; + this.rawDelta = delta; // Real-world timer advance this.time += this.rawDelta; - // Update the estimate of the frame rate, `fps`. Every second, the number - // of frames that occurred in that second are included in an exponential - // moving average of all frames per second, with an alpha of 0.25. This - // means that more recent seconds affect the estimated frame rate more than - // older seconds. - // - // When a browser window is NOT minimized, but is covered up (i.e. you're using - // another app which has spawned a window over the top of the browser), then it - // will start to throttle the raf callback time. It waits for a while, and then - // starts to drop the frame rate at 1 frame per second until it's down to just over 1fps. - // So if the game was running at 60fps, and the player opens a new window, then - // after 60 seconds (+ the 'buffer time') it'll be down to 1fps, so rafin'g at 1Hz. - // - // When they make the game visible again, the frame rate is increased at a rate of - // approx. 8fps, back up to 60fps (or the max it can obtain) - // - // There is no easy way to determine if this drop in frame rate is because the - // browser is throttling raf, or because the game is struggling with performance - // because you're asking it to do too much on the device. - - if (time > this.nextFpsUpdate) + if (this.smoothStep) { - // Compute the new exponential moving average with an alpha of 0.25. - this.actualFps = 0.25 * this.framesThisSecond + 0.75 * this.actualFps; - this.nextFpsUpdate = time + 1000; - this.framesThisSecond = 0; + delta = this.smoothDelta(delta); + } + + // Set as the world delta value (after smoothing, if applied) + this.delta = delta; + + if (time >= this.nextFpsUpdate) + { + this.updateFPS(time); } this.framesThisSecond++; - // Interpolation - how far between what is expected and where we are? - var interpolation = avg / this._target; - - this.callback(time, avg, interpolation); + this.callback(time, delta); // Shift time value over this.lastTime = time; @@ -17571,7 +17806,16 @@ var TimeStep = new Class({ */ tick: function () { - this.step(); + var now = window.performance.now(); + + if (this.hasFpsLimit) + { + this.stepLimitFPS(now); + } + else + { + this.step(now); + } }, /** @@ -17601,20 +17845,30 @@ var TimeStep = new Class({ */ wake: function (seamless) { + if (seamless === undefined) { seamless = false; } + + var now = window.performance.now(); + if (this.running) { return; } else if (seamless) { - this.startTime += -this.lastTime + (this.lastTime + window.performance.now()); + this.startTime += -this.lastTime + (this.lastTime + now); } - this.raf.start(this.step.bind(this), this.useRAF); + var step = (this.hasFpsLimit) ? this.stepLimitFPS.bind(this) : this.step.bind(this); + + this.raf.start(step, this.forceSetTimeOut, this._target); this.running = true; - this.step(); + this.nextFpsUpdate = now + 1000; + this.framesThisSecond = 0; + this.fpsLimitTriggered = false; + + this.tick(); }, /** @@ -17672,10 +17926,11 @@ var TimeStep = new Class({ { this.stop(); - this.callback = NOOP; + this.raf.destroy(); this.raf = null; this.game = null; + this.callback = null; } }); @@ -17690,7 +17945,7 @@ module.exports = TimeStep; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -17782,7 +18037,7 @@ module.exports = VisibilityHandler; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -17806,7 +18061,7 @@ module.exports = 'blur'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -17829,7 +18084,7 @@ module.exports = 'boot'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -17853,7 +18108,7 @@ module.exports = 'contextlost'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -17877,7 +18132,7 @@ module.exports = 'contextrestored'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -17901,7 +18156,7 @@ module.exports = 'destroy'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -17924,7 +18179,7 @@ module.exports = 'focus'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -17951,13 +18206,13 @@ module.exports = 'hidden'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Pause Event. - * + * * This event is dispatched when the Game loop enters a paused state, usually as a result of the Visibility Handler. * * @event Phaser.Core.Events#PAUSE @@ -17973,7 +18228,7 @@ module.exports = 'pause'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18000,7 +18255,7 @@ module.exports = 'postrender'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18026,7 +18281,7 @@ module.exports = 'poststep'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18052,7 +18307,7 @@ module.exports = 'prerender'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18078,13 +18333,13 @@ module.exports = 'prestep'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Ready Event. - * + * * This event is dispatched when the Phaser Game instance has finished booting, the Texture Manager is fully ready, * and all local systems are now able to start. * @@ -18101,13 +18356,13 @@ module.exports = 'ready'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Resume Event. - * + * * This event is dispatched when the game loop leaves a paused state and resumes running. * * @event Phaser.Core.Events#RESUME @@ -18123,7 +18378,7 @@ module.exports = 'resume'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18149,7 +18404,7 @@ module.exports = 'step'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18174,7 +18429,7 @@ module.exports = 'visible'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18211,7 +18466,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18238,7 +18493,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18361,7 +18616,7 @@ module.exports = GenerateTexture; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18370,7 +18625,7 @@ module.exports = GenerateTexture; */ module.exports = { - + GenerateTexture: __webpack_require__(52780), Palettes: __webpack_require__(25235) @@ -18384,7 +18639,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18423,7 +18678,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18462,7 +18717,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18501,7 +18756,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18540,7 +18795,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18579,7 +18834,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18605,7 +18860,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -18833,7 +19088,7 @@ module.exports = CubicBezierCurve; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -19451,7 +19706,7 @@ module.exports = Curve; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -20076,7 +20331,7 @@ module.exports = EllipseCurve; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -20383,7 +20638,7 @@ module.exports = LineCurve; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -20414,7 +20669,7 @@ var QuadraticBezier = new Class({ function QuadraticBezier (p0, p1, p2) { - Curve.call(this, 'QuadraticBezier'); + Curve.call(this, 'QuadraticBezierCurve'); if (Array.isArray(p0)) { @@ -20601,7 +20856,7 @@ module.exports = QuadraticBezier; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -20827,7 +21082,7 @@ module.exports = SplineCurve; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -20855,7 +21110,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -20995,7 +21250,7 @@ module.exports = MoveTo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -21464,6 +21719,35 @@ var Path = new Class({ return lengths; }, + /** + * Returns the Curve that forms the Path at the given normalized location (between 0 and 1). + * + * @method Phaser.Curves.Path#getCurveAt + * @since 3.60.0 + * + * @param {number} t - The normalized location on the Path, between 0 and 1. + * + * @return {?Phaser.Curves.Curve} The Curve that is part of this Path at a given location, or `null` if no curve was found. + */ + getCurveAt: function (t) + { + var d = t * this.getLength(); + var curveLengths = this.getCurveLengths(); + var i = 0; + + while (i < curveLengths.length) + { + if (curveLengths[i] >= d) + { + return this.curves[i]; + } + + i++; + } + + return null; + }, + /** * Returns the ending point of the Path. * @@ -21885,7 +22169,7 @@ module.exports = Path; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -22593,7 +22877,7 @@ module.exports = DataManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -22721,7 +23005,7 @@ module.exports = DataManagerPlugin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -22754,7 +23038,7 @@ module.exports = 'changedata'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -22785,7 +23069,7 @@ module.exports = 'changedata-'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -22807,7 +23091,7 @@ module.exports = 'destroy'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -22836,7 +23120,7 @@ module.exports = 'removedata'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -22865,7 +23149,7 @@ module.exports = 'setdata'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -22891,7 +23175,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -22915,7 +23199,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -22933,6 +23217,8 @@ var Browser = __webpack_require__(1350); * @property {boolean} audioData - Can this device play HTML Audio tags? * @property {boolean} dolby - Can this device play EC-3 Dolby Digital Plus files? * @property {boolean} m4a - Can this device can play m4a files. + * @property {boolean} aac - Can this device can play aac files. + * @property {boolean} flac - Can this device can play flac files. * @property {boolean} mp3 - Can this device play mp3 files? * @property {boolean} ogg - Can this device play ogg files? * @property {boolean} opus - Can this device play opus files? @@ -22942,6 +23228,8 @@ var Browser = __webpack_require__(1350); */ var Audio = { + flac: false, + aac: false, audioData: false, dolby: false, m4a: false, @@ -22966,46 +23254,39 @@ function init () Audio.webAudio = !!(window['AudioContext'] || window['webkitAudioContext']); var audioElement = document.createElement('audio'); - var result = !!audioElement.canPlayType; try { if (result) { - if (audioElement.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, '')) + var CanPlay = function (type1, type2) { - Audio.ogg = true; - } + var canPlayType1 = audioElement.canPlayType('audio/' + type1).replace(/^no$/, ''); - if (audioElement.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/, '') || audioElement.canPlayType('audio/opus;').replace(/^no$/, '')) - { - Audio.opus = true; - } + if (type2) + { + return Boolean(canPlayType1 || audioElement.canPlayType('audio/' + type2).replace(/^no$/, '')); + } + else + { + return Boolean(canPlayType1); + } + }; - if (audioElement.canPlayType('audio/mpeg;').replace(/^no$/, '')) - { - Audio.mp3 = true; - } - - // Mimetypes accepted: + // wav Mimetypes accepted: // developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements - if (audioElement.canPlayType('audio/wav').replace(/^no$/, '')) - { - Audio.wav = true; - } - if (audioElement.canPlayType('audio/x-m4a;') || audioElement.canPlayType('audio/aac;').replace(/^no$/, '')) - { - Audio.m4a = true; - } + Audio.ogg = CanPlay('ogg; codecs="vorbis"'); + Audio.opus = CanPlay('ogg; codecs="opus"', 'opus'); + Audio.mp3 = CanPlay('mpeg'); + Audio.wav = CanPlay('wav'); + Audio.m4a = CanPlay('x-m4a'); + Audio.aac = CanPlay('aac'); + Audio.flac = CanPlay('flac', 'x-flac'); + Audio.webm = CanPlay('webm; codecs="vorbis"'); - if (audioElement.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/, '')) - { - Audio.webm = true; - } - - if (audioElement.canPlayType('audio/mp4;codecs="ec-3"') !== '') + if (audioElement.canPlayType('audio/mp4; codecs="ec-3"') !== '') { if (Browser.edge) { @@ -23045,7 +23326,7 @@ module.exports = init(); /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -23156,7 +23437,7 @@ module.exports = init(); /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -23194,8 +23475,8 @@ function checkBlendMode () yellow.onload = function () { - var canvas = CanvasPool.create(yellow, 6, 1); - var context = canvas.getContext('2d'); + var canvas = CanvasPool.create2D(yellow, 6); + var context = canvas.getContext('2d', { willReadFrequently: true }); context.globalCompositeOperation = 'multiply'; @@ -23224,8 +23505,8 @@ function checkBlendMode () function checkInverseAlpha () { - var canvas = CanvasPool.create(this, 2, 1); - var context = canvas.getContext('2d'); + var canvas = CanvasPool.create2D(this, 2); + var context = canvas.getContext('2d', { willReadFrequently: true }); context.fillStyle = 'rgba(10, 20, 30, 0.5)'; @@ -23246,8 +23527,12 @@ function checkInverseAlpha () // Get those values var s2 = context.getImageData(1, 0, 1, 1); + var result = (s2.data[0] === s1.data[0] && s2.data[1] === s1.data[1] && s2.data[2] === s1.data[2] && s2.data[3] === s1.data[3]); + + CanvasPool.remove(this); + // Compare and return - return (s2.data[0] === s1.data[0] && s2.data[1] === s1.data[1] && s2.data[2] === s1.data[2] && s2.data[3] === s1.data[3]); + return result; } function init () @@ -23271,7 +23556,7 @@ module.exports = init(); /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -23469,7 +23754,7 @@ module.exports = init(); /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -23579,7 +23864,7 @@ module.exports = init(); /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -23660,7 +23945,7 @@ module.exports = init(); /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -23853,7 +24138,7 @@ module.exports = init(); /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -23871,6 +24156,7 @@ module.exports = init(); * @property {boolean} h264 - Can this device play h264 mp4 video files? * @property {boolean} hls - Can this device play hls video files? * @property {boolean} mp4 - Can this device play h264 mp4 video files? + * @property {boolean} m4v - Can this device play m4v (typically mp4) video files? * @property {boolean} ogg - Can this device play ogg video files? * @property {boolean} vp9 - Can this device play vp9 video files? * @property {boolean} webm - Can this device play webm video files? @@ -23880,6 +24166,7 @@ var Video = { h264: false, hls: false, mp4: false, + m4v: false, ogg: false, vp9: false, webm: false @@ -23895,34 +24182,40 @@ function init () var videoElement = document.createElement('video'); var result = !!videoElement.canPlayType; + var no = /^no$/; try { if (result) { - if (videoElement.canPlayType('video/ogg; codecs="theora"').replace(/^no$/, '')) + if (videoElement.canPlayType('video/ogg; codecs="theora"').replace(no, '')) { Video.ogg = true; } - if (videoElement.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/, '')) + if (videoElement.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(no, '')) { // Without QuickTime, this value will be `undefined`. github.com/Modernizr/Modernizr/issues/546 Video.h264 = true; Video.mp4 = true; } - if (videoElement.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/, '')) + if (videoElement.canPlayType('video/x-m4v').replace(no, '')) + { + Video.m4v = true; + } + + if (videoElement.canPlayType('video/webm; codecs="vp8, vorbis"').replace(no, '')) { Video.webm = true; } - if (videoElement.canPlayType('video/webm; codecs="vp9"').replace(/^no$/, '')) + if (videoElement.canPlayType('video/webm; codecs="vp9"').replace(no, '')) { Video.vp9 = true; } - if (videoElement.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/, '')) + if (videoElement.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(no, '')) { Video.hls = true; } @@ -23946,7 +24239,7 @@ module.exports = init(); /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -23994,7 +24287,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -24645,7 +24938,7 @@ module.exports = ColorMatrix; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -24748,7 +25041,7 @@ var RGB = new Class({ { var rgb = this._rgb; - return (rgb.r === red && rgb.g === green && rgb.b === blue); + return (rgb[0] === red && rgb[1] === green && rgb[2] === blue); }, /** @@ -24866,7 +25159,7 @@ module.exports = RGB; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25001,7 +25294,7 @@ module.exports = ALIGN_CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25046,7 +25339,7 @@ module.exports = BottomCenter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25091,7 +25384,7 @@ module.exports = BottomLeft; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25136,7 +25429,7 @@ module.exports = BottomRight; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25179,7 +25472,7 @@ module.exports = Center; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25224,7 +25517,7 @@ module.exports = LeftCenter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25278,7 +25571,7 @@ module.exports = QuickSet; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25323,7 +25616,7 @@ module.exports = RightCenter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25368,7 +25661,7 @@ module.exports = TopCenter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25413,7 +25706,7 @@ module.exports = TopLeft; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25458,7 +25751,7 @@ module.exports = TopRight; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25489,7 +25782,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25520,7 +25813,7 @@ module.exports = Align; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25565,7 +25858,7 @@ module.exports = BottomCenter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25610,7 +25903,7 @@ module.exports = BottomLeft; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25655,7 +25948,7 @@ module.exports = BottomRight; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25700,7 +25993,7 @@ module.exports = LeftBottom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25745,7 +26038,7 @@ module.exports = LeftCenter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25790,7 +26083,7 @@ module.exports = LeftTop; /** * @author samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25843,7 +26136,7 @@ module.exports = QuickSet; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25888,7 +26181,7 @@ module.exports = RightBottom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25933,7 +26226,7 @@ module.exports = RightCenter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -25978,7 +26271,7 @@ module.exports = RightTop; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26023,7 +26316,7 @@ module.exports = TopCenter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26068,7 +26361,7 @@ module.exports = TopLeft; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26113,7 +26406,7 @@ module.exports = TopRight; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26147,7 +26440,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26185,7 +26478,7 @@ module.exports = CenterOn; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26214,7 +26507,7 @@ module.exports = GetBottom; /** * @author samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26259,7 +26552,7 @@ module.exports = GetBounds; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26288,7 +26581,7 @@ module.exports = GetCenterX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26317,7 +26610,7 @@ module.exports = GetCenterY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26346,7 +26639,7 @@ module.exports = GetLeft; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26377,7 +26670,7 @@ module.exports = GetOffsetX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26408,7 +26701,7 @@ module.exports = GetOffsetY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26437,7 +26730,7 @@ module.exports = GetRight; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26466,7 +26759,7 @@ module.exports = GetTop; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26500,7 +26793,7 @@ module.exports = SetBottom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26536,7 +26829,7 @@ module.exports = SetCenterX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26572,7 +26865,7 @@ module.exports = SetCenterY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26606,7 +26899,7 @@ module.exports = SetLeft; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26640,7 +26933,7 @@ module.exports = SetRight; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26674,7 +26967,7 @@ module.exports = SetTop; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26711,7 +27004,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26775,7 +27068,7 @@ module.exports = CanvasInterpolation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -26790,7 +27083,7 @@ var _disableContextSmoothing = false; /** * The CanvasPool is a global static object, that allows Phaser to recycle and pool 2D Context Canvas DOM elements. - * It does not pool WebGL Contexts, because once the context options are set they cannot be modified again, + * It does not pool WebGL Contexts, because once the context options are set they cannot be modified again, * which is useless for some of the Phaser pipelines / renderer. * * This singleton is instantiated as soon as Phaser loads, before a Phaser.Game instance has even been created. @@ -27037,7 +27330,7 @@ module.exports = CanvasPool(); /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -27170,7 +27463,7 @@ module.exports = Smoothing(); /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -27206,7 +27499,7 @@ module.exports = TouchAction; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -27254,7 +27547,7 @@ module.exports = UserSelect; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -27269,7 +27562,7 @@ module.exports = { Smoothing: __webpack_require__(8213), TouchAction: __webpack_require__(59271), UserSelect: __webpack_require__(36505) - + }; @@ -27280,7 +27573,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28144,7 +28437,7 @@ module.exports = Color; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28242,7 +28535,7 @@ module.exports = ColorSpectrum; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28283,7 +28576,7 @@ module.exports = ColorToRGBA; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28314,7 +28607,7 @@ module.exports = ComponentToHex; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28345,7 +28638,7 @@ module.exports = GetColor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28377,7 +28670,7 @@ module.exports = GetColor32; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28428,14 +28721,14 @@ module.exports = HSLToColor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var HSVToRGB = __webpack_require__(24650); /** - * Get HSV color wheel values in an array which will be 360 elements in size. + * Generates an HSV color wheel which is an array of 360 Color objects, for each step of the wheel. * * @function Phaser.Display.Color.HSVColorWheel * @since 3.0.0 @@ -28443,7 +28736,7 @@ var HSVToRGB = __webpack_require__(24650); * @param {number} [s=1] - The saturation, in the range 0 - 1. * @param {number} [v=1] - The value, in the range 0 - 1. * - * @return {Phaser.Types.Display.ColorObject[]} An array containing 360 elements, where each contains a single numeric value corresponding to the color at that point in the HSV color wheel. + * @return {Phaser.Types.Display.ColorObject[]} An array containing 360 ColorObject elements, where each element contains a Color object corresponding to the color at that point in the HSV color wheel. */ var HSVColorWheel = function (s, v) { @@ -28470,7 +28763,7 @@ module.exports = HSVColorWheel; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28552,7 +28845,7 @@ module.exports = HSVToRGB; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28606,7 +28899,7 @@ module.exports = HexStringToColor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28663,7 +28956,7 @@ module.exports = HueToComponent; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28697,7 +28990,7 @@ module.exports = IntegerToColor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28746,7 +29039,7 @@ module.exports = IntegerToRGB; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28855,7 +29148,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28886,7 +29179,7 @@ module.exports = ObjectToColor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -28933,7 +29226,7 @@ module.exports = RGBStringToColor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -29014,7 +29307,7 @@ module.exports = RGBToHSV; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -29059,7 +29352,7 @@ module.exports = RGBToString; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -29096,7 +29389,7 @@ module.exports = RandomRGB; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -29153,7 +29446,7 @@ module.exports = ValueToColor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -29189,7 +29482,7 @@ module.exports = Color; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -29218,7 +29511,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -29553,7 +29846,7 @@ module.exports = BitmapMask; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -29874,7 +30167,7 @@ module.exports = GeometryMask; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -29897,7 +30190,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30024,7 +30317,7 @@ module.exports = BaseShader; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30083,7 +30376,7 @@ module.exports = AddToDOM; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30128,7 +30421,7 @@ module.exports = CreateDOMContainer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30192,7 +30485,7 @@ module.exports = DOMContentLoaded; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30218,7 +30511,7 @@ var GetInnerHeight = function (iOS) var axis = Math.abs(window.orientation); var size = { w: 0, h: 0 }; - + var ruler = document.createElement('div'); ruler.setAttribute('style', 'position: fixed; height: 100vh; width: 0; top: 0'); @@ -30252,7 +30545,7 @@ module.exports = GetInnerHeight; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30318,7 +30611,7 @@ module.exports = GetScreenOrientation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30370,7 +30663,7 @@ module.exports = GetTarget; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30428,7 +30721,7 @@ module.exports = ParseXML; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30458,7 +30751,7 @@ module.exports = RemoveFromDOM; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30468,6 +30761,7 @@ var NOOP = __webpack_require__(72283); /** * @classdesc * Abstracts away the use of RAF or setTimeOut for the core game update loop. + * * This is invoked automatically by the Phaser.Game instance. * * @class RequestAnimationFrame @@ -30500,16 +30794,6 @@ var RequestAnimationFrame = new Class({ */ this.callback = NOOP; - /** - * The most recent timestamp. Either a DOMHighResTimeStamp under RAF or `Date.now` under SetTimeout. - * - * @name Phaser.DOM.RequestAnimationFrame#tick - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.tick = 0; - /** * True if the step is using setTimeout instead of RAF. * @@ -30531,54 +30815,42 @@ var RequestAnimationFrame = new Class({ this.timeOutID = null; /** - * The previous time the step was called. + * The delay rate in ms for setTimeOut. * - * @name Phaser.DOM.RequestAnimationFrame#lastTime + * @name Phaser.DOM.RequestAnimationFrame#delay * @type {number} * @default 0 - * @since 3.0.0 + * @since 3.60.0 */ - this.lastTime = 0; - - /** - * The target FPS rate in ms. - * Only used when setTimeout is used instead of RAF. - * - * @name Phaser.DOM.RequestAnimationFrame#target - * @type {number} - * @default 0 - * @since 3.21.0 - */ - this.target = 0; + this.delay = 0; var _this = this; /** * The RAF step function. - * Updates the local tick value, invokes the callback and schedules another call to requestAnimationFrame. + * + * Invokes the callback and schedules another call to requestAnimationFrame. * * @name Phaser.DOM.RequestAnimationFrame#step * @type {FrameRequestCallback} * @since 3.0.0 + * + * @param {number} time - The timestamp passed in from RequestAnimationFrame. */ - this.step = function step () + this.step = function step (time) { - // Because we cannot trust the time passed to this callback from the browser and need it kept in sync with event times - var timestamp = window.performance.now(); + _this.callback(time); - // DOMHighResTimeStamp - _this.lastTime = _this.tick; - - _this.tick = timestamp; - - _this.callback(timestamp); - - _this.timeOutID = window.requestAnimationFrame(step); + if (_this.isRunning) + { + _this.timeOutID = window.requestAnimationFrame(step); + } }; /** * The SetTimeout step function. - * Updates the local tick value, invokes the callback and schedules another call to setTimeout. + * + * Invokes the callback and schedules another call to setTimeout. * * @name Phaser.DOM.RequestAnimationFrame#stepTimeout * @type {function} @@ -30586,17 +30858,13 @@ var RequestAnimationFrame = new Class({ */ this.stepTimeout = function stepTimeout () { - var d = Date.now(); + if (_this.isRunning) + { + // Make the next request before the callback, so that timing is maintained + _this.timeOutID = window.setTimeout(stepTimeout, _this.delay); + } - var delay = Math.min(Math.max(_this.target * 2 + _this.tick - d, 0), _this.target); - - _this.lastTime = _this.tick; - - _this.tick = d; - - _this.callback(d); - - _this.timeOutID = window.setTimeout(stepTimeout, delay); + _this.callback(window.performance.now()); }; }, @@ -30608,9 +30876,9 @@ var RequestAnimationFrame = new Class({ * * @param {FrameRequestCallback} callback - The callback to invoke each step. * @param {boolean} forceSetTimeOut - Should it use SetTimeout, even if RAF is available? - * @param {number} targetFPS - The target fps rate (in ms). Only used when setTimeout is used. + * @param {number} delay - The setTimeout delay rate in ms. */ - start: function (callback, forceSetTimeOut, targetFPS) + start: function (callback, forceSetTimeOut, delay) { if (this.isRunning) { @@ -30621,7 +30889,7 @@ var RequestAnimationFrame = new Class({ this.isSetTimeOut = forceSetTimeOut; - this.target = targetFPS; + this.delay = delay; this.isRunning = true; @@ -30673,7 +30941,7 @@ module.exports = RequestAnimationFrame; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30704,7 +30972,7 @@ module.exports = Dom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30889,7 +31157,7 @@ module.exports = EventEmitter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -30907,7 +31175,7 @@ module.exports = { EventEmitter: __webpack_require__(78491) }; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -31036,7 +31304,7 @@ module.exports = BuildGameObject; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -31134,7 +31402,7 @@ module.exports = BuildGameObjectAnimation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -31247,6 +31515,11 @@ var DisplayList = new Class({ gameObject.removeFromDisplayList(); } + if (gameObject.parentContainer) + { + gameObject.parentContainer.remove(gameObject); + } + if (!gameObject.displayList) { this.queueDepthSort(); @@ -31365,15 +31638,11 @@ var DisplayList = new Class({ { var list = this.list; - var i = list.length; - - while (i--) + while (list.length) { - list[i].destroy(true); + list[0].destroy(true); } - list.length = 0; - this.events.off(SceneEvents.SHUTDOWN, this.shutdown, this); }, @@ -31410,7 +31679,7 @@ module.exports = DisplayList; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -31914,10 +32183,7 @@ var GameObject = new Class({ */ disableInteractive: function () { - if (this.input) - { - this.input.enabled = false; - } + this.scene.sys.input.disable(this); return this; }, @@ -32024,7 +32290,9 @@ var GameObject = new Class({ */ willRender: function (camera) { - return !(GameObject.RENDER_MASK !== this.renderFlags || (this.cameraFilter !== 0 && (this.cameraFilter & camera.id))); + var listWillRender = (this.displayList && this.displayList.active) ? this.displayList.willRender(camera) : true; + + return !(!listWillRender || GameObject.RENDER_MASK !== this.renderFlags || (this.cameraFilter !== 0 && (this.cameraFilter & camera.id))); }, /** @@ -32310,7 +32578,7 @@ module.exports = GameObject; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -32514,7 +32782,7 @@ module.exports = GameObjectCreator; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -32748,7 +33016,7 @@ module.exports = GameObjectFactory; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -32820,7 +33088,7 @@ module.exports = GetCalcMatrix; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -33125,7 +33393,7 @@ module.exports = UpdateList; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -33185,7 +33453,7 @@ module.exports = BatchChar; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -33571,7 +33839,7 @@ var GetBitmapTextSize = function (src, round, updateOrigin, out) i: charIndex, char: text[i], code: charCode, - x: (glyph.xOffset + xAdvance) * scale, + x: (glyph.xOffset + x) * scale, y: (glyph.yOffset + yAdvance) * scale, w: glyph.width * scale, h: glyph.height * scale, @@ -33582,7 +33850,7 @@ var GetBitmapTextSize = function (src, round, updateOrigin, out) glyph: glyph }); - xAdvance += glyph.xAdvance + letterSpacing; + xAdvance += glyph.xAdvance + letterSpacing + ((kerningOffset !== undefined) ? kerningOffset : 0); lastGlyph = glyph; lastCharCode = charCode; currentLineWidth = gw * scale; @@ -33708,7 +33976,7 @@ module.exports = GetBitmapTextSize; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -33763,7 +34031,7 @@ module.exports = ParseFromAtlas; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -33896,7 +34164,7 @@ module.exports = ParseRetroFont; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -34058,7 +34326,7 @@ module.exports = ParseXMLBitmapFont; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -34085,7 +34353,7 @@ module.exports = RetroFont; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -34202,7 +34470,7 @@ module.exports = RETRO_FONT_CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -34233,7 +34501,8 @@ var Render = __webpack_require__(88899); * * BMFont (Windows, free): {@link http://www.angelcode.com/products/bmfont/|http://www.angelcode.com/products/bmfont/} * Glyph Designer (OS X, commercial): {@link http://www.71squared.com/en/glyphdesigner|http://www.71squared.com/en/glyphdesigner} - * Littera (Web-based, free): {@link http://kvazars.com/littera/|http://kvazars.com/littera/} + * Snow BMF (Web-based, free): {@link https://snowb.org//|https://snowb.org/} + * Littera (Flash-based, free): {@link http://kvazars.com/littera/|http://kvazars.com/littera/} * * For most use cases it is recommended to use XML. If you wish to use JSON, the formatting should be equal to the result of * converting a valid XML file through the popular X2JS library. An online tool for conversion can be found here: {@link http://codebeautify.org/xmltojson|http://codebeautify.org/xmltojson} @@ -34436,7 +34705,7 @@ module.exports = DynamicBitmapText; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -34609,7 +34878,7 @@ var DynamicBitmapTextCanvasRenderer = function (renderer, src, camera, parentMat x += lineOffsetX; - xAdvance += glyph.xAdvance + letterSpacing; + xAdvance += glyph.xAdvance + letterSpacing + ((kerningOffset !== undefined) ? kerningOffset : 0); lastGlyph = glyph; lastCharCode = charCode; @@ -34651,7 +34920,7 @@ module.exports = DynamicBitmapTextCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -34703,7 +34972,7 @@ GameObjectCreator.register('dynamicBitmapText', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -34773,12 +35042,13 @@ GameObjectFactory.register('dynamicBitmapText', function (x, y, font, text, size /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -34805,7 +35075,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -35094,7 +35364,7 @@ module.exports = DynamicBitmapTextWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -35125,7 +35395,8 @@ var Render = __webpack_require__(84557); * * BMFont (Windows, free): {@link http://www.angelcode.com/products/bmfont/|http://www.angelcode.com/products/bmfont/} * Glyph Designer (OS X, commercial): {@link http://www.71squared.com/en/glyphdesigner|http://www.71squared.com/en/glyphdesigner} - * Littera (Web-based, free): {@link http://kvazars.com/littera/|http://kvazars.com/littera/} + * Snow BMF (Web-based, free): {@link https://snowb.org//|https://snowb.org/} + * Littera (Flash-based, free): {@link http://kvazars.com/littera/|http://kvazars.com/littera/} * * For most use cases it is recommended to use XML. If you wish to use JSON, the formatting should be equal to the result of * converting a valid XML file through the popular X2JS library. An online tool for conversion can be found here: {@link http://codebeautify.org/xmltojson|http://codebeautify.org/xmltojson} @@ -36195,7 +36466,7 @@ module.exports = BitmapText; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -36341,7 +36612,7 @@ var BitmapTextCanvasRenderer = function (renderer, src, camera, parentMatrix) x += lineOffsetX; - xAdvance += glyph.xAdvance + letterSpacing; + xAdvance += glyph.xAdvance + letterSpacing + ((kerningOffset !== undefined) ? kerningOffset : 0); lastGlyph = glyph; lastCharCode = charCode; @@ -36381,7 +36652,7 @@ module.exports = BitmapTextCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -36435,7 +36706,7 @@ GameObjectCreator.register('bitmapText', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -36500,12 +36771,13 @@ GameObjectFactory.register('bitmapText', function (x, y, font, text, size, align /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -36532,7 +36804,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -36672,7 +36944,7 @@ module.exports = BitmapTextWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -36972,7 +37244,7 @@ module.exports = Blitter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -37014,7 +37286,7 @@ var BlitterCanvasRenderer = function (renderer, src, camera, parentMatrix) // Blend Mode + Scale Mode ctx.globalCompositeOperation = renderer.blendModes[src.blendMode]; - ctx.imageSmoothingEnabled = !(!renderer.antialias || src.frame.source.scaleMode); + ctx.imageSmoothingEnabled = !src.frame.source.scaleMode; var cameraScrollX = src.x - camera.scrollX * src.scrollFactorX; var cameraScrollY = src.y - camera.scrollY * src.scrollFactorY; @@ -37057,17 +37329,20 @@ var BlitterCanvasRenderer = function (renderer, src, camera, parentMatrix) dy = Math.round(dy); } - ctx.drawImage( - frame.source.image, - cd.x, - cd.y, - cd.width, - cd.height, - dx + bob.x + cameraScrollX, - dy + bob.y + cameraScrollY, - cd.width, - cd.height - ); + if (cd.width > 0 && cd.height > 0) + { + ctx.drawImage( + frame.source.image, + cd.x, + cd.y, + cd.width, + cd.height, + dx + bob.x + cameraScrollX, + dy + bob.y + cameraScrollY, + cd.width, + cd.height + ); + } } else { @@ -37083,11 +37358,14 @@ var BlitterCanvasRenderer = function (renderer, src, camera, parentMatrix) dy -= cd.height; } - ctx.save(); - ctx.translate(bob.x + cameraScrollX, bob.y + cameraScrollY); - ctx.scale(fx, fy); - ctx.drawImage(frame.source.image, cd.x, cd.y, cd.width, cd.height, dx, dy, cd.width, cd.height); - ctx.restore(); + if (cd.width > 0 && cd.height > 0) + { + ctx.save(); + ctx.translate(bob.x + cameraScrollX, bob.y + cameraScrollY); + ctx.scale(fx, fy); + ctx.drawImage(frame.source.image, cd.x, cd.y, cd.width, cd.height, dx, dy, cd.width, cd.height); + ctx.restore(); + } } } @@ -37104,7 +37382,7 @@ module.exports = BlitterCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -37155,7 +37433,7 @@ GameObjectCreator.register('blitter', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -37198,12 +37476,13 @@ GameObjectFactory.register('blitter', function (x, y, key, frame) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -37230,7 +37509,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -37372,7 +37651,7 @@ module.exports = BlitterWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -37803,7 +38082,7 @@ module.exports = Bob; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -38099,7 +38378,7 @@ module.exports = Alpha; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -38210,7 +38489,7 @@ module.exports = AlphaSingle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -38228,7 +38507,7 @@ var BlendMode = { /** * Private internal value. Holds the current blend mode. - * + * * @name Phaser.GameObjects.Components.BlendMode#_blendMode * @type {number} * @private @@ -38333,14 +38612,14 @@ module.exports = BlendMode; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Provides methods used for calculating and setting the size of a non-Frame based Game Object. * Should be applied as a mixin and not used directly. - * + * * @namespace Phaser.GameObjects.Components.ComputedSize * @since 3.0.0 */ @@ -38349,11 +38628,11 @@ var ComputedSize = { /** * The native (un-scaled) width of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayWidth` property. - * + * * @name Phaser.GameObjects.Components.ComputedSize#width * @type {number} * @since 3.0.0 @@ -38362,11 +38641,11 @@ var ComputedSize = { /** * The native (un-scaled) height of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayHeight` property. - * + * * @name Phaser.GameObjects.Components.ComputedSize#height * @type {number} * @since 3.0.0 @@ -38375,11 +38654,11 @@ var ComputedSize = { /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. - * + * * @name Phaser.GameObjects.Components.ComputedSize#displayWidth * @type {number} * @since 3.0.0 @@ -38400,11 +38679,11 @@ var ComputedSize = { /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. - * + * * @name Phaser.GameObjects.Components.ComputedSize#displayHeight * @type {number} * @since 3.0.0 @@ -38425,21 +38704,21 @@ var ComputedSize = { /** * Sets the internal size of this Game Object, as used for frame or physics body creation. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. - * + * * @method Phaser.GameObjects.Components.ComputedSize#setSize * @since 3.4.0 * * @param {number} width - The width of this Game Object. * @param {number} height - The height of this Game Object. - * + * * @return {this} This Game Object instance. */ setSize: function (width, height) @@ -38452,15 +38731,15 @@ var ComputedSize = { /** * Sets the display size of this Game Object. - * + * * Calling this will adjust the scale. - * + * * @method Phaser.GameObjects.Components.ComputedSize#setDisplaySize * @since 3.4.0 * * @param {number} width - The width of this Game Object. * @param {number} height - The height of this Game Object. - * + * * @return {this} This Game Object instance. */ setDisplaySize: function (width, height) @@ -38483,7 +38762,7 @@ module.exports = ComputedSize; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -38527,24 +38806,24 @@ var Crop = { /** * Applies a crop to a texture based Game Object, such as a Sprite or Image. - * + * * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. - * + * * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just * changes what is shown when rendered. - * + * * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. - * + * * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left * half of it, you could call `setCrop(0, 0, 400, 600)`. - * + * * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop * an area of 200x100 when applied to a Game Object that had a scale factor of 2. - * + * * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. - * + * * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. - * + * * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow * the renderer to skip several internal calculations. * @@ -38589,7 +38868,7 @@ var Crop = { * @method Phaser.GameObjects.Components.Crop#resetCropObject * @private * @since 3.12.0 - * + * * @return {object} The crop object. */ resetCropObject: function () @@ -38609,7 +38888,7 @@ module.exports = Crop; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -38635,7 +38914,7 @@ var Depth = { _depth: 0, /** - * The depth of this Game Object within the Scene. + * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. @@ -38682,7 +38961,7 @@ var Depth = { * @method Phaser.GameObjects.Components.Depth#setDepth * @since 3.0.0 * - * @param {number} value - The depth of this Game Object. + * @param {number} value - The depth of this Game Object. Ensure this value is only ever a number data-type. * * @return {this} This Game Object instance. */ @@ -38707,7 +38986,7 @@ module.exports = Depth; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -38727,7 +39006,7 @@ var FX = { * when it is being rendered by a SpriteFX Pipeline. * * Lots of FX require additional spacing added to the texture the - * Game Object uses, for example a glow or shaddow effect, and this + * Game Object uses, for example a glow or shadow effect, and this * method allows you to control how much extra padding is included * in addition to the texture size. * @@ -38743,7 +39022,7 @@ var FX = { * when it is being rendered by a SpriteFX Pipeline. * * Lots of FX require additional spacing added to the texture the - * Game Object uses, for example a glow or shaddow effect, and this + * Game Object uses, for example a glow or shadow effect, and this * method allows you to control how much extra padding is included * in addition to the texture size. * @@ -38810,14 +39089,14 @@ module.exports = FX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Provides methods used for visually flipping a Game Object. * Should be applied as a mixin and not used directly. - * + * * @namespace Phaser.GameObjects.Components.Flip * @since 3.0.0 */ @@ -38826,11 +39105,11 @@ var Flip = { /** * The horizontally flipped state of the Game Object. - * + * * A Game Object that is flipped horizontally will render inversed on the horizontal axis. * Flipping always takes place from the middle of the texture and does not impact the scale value. * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * + * * @name Phaser.GameObjects.Components.Flip#flipX * @type {boolean} * @default false @@ -38840,11 +39119,11 @@ var Flip = { /** * The vertically flipped state of the Game Object. - * + * * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) * Flipping always takes place from the middle of the texture and does not impact the scale value. * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * + * * @name Phaser.GameObjects.Components.Flip#flipY * @type {boolean} * @default false @@ -38854,14 +39133,14 @@ var Flip = { /** * Toggles the horizontal flipped state of this Game Object. - * + * * A Game Object that is flipped horizontally will render inversed on the horizontal axis. * Flipping always takes place from the middle of the texture and does not impact the scale value. * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * + * * @method Phaser.GameObjects.Components.Flip#toggleFlipX * @since 3.0.0 - * + * * @return {this} This Game Object instance. */ toggleFlipX: function () @@ -38873,10 +39152,10 @@ var Flip = { /** * Toggles the vertical flipped state of this Game Object. - * + * * @method Phaser.GameObjects.Components.Flip#toggleFlipY * @since 3.0.0 - * + * * @return {this} This Game Object instance. */ toggleFlipY: function () @@ -38888,16 +39167,16 @@ var Flip = { /** * Sets the horizontal flipped state of this Game Object. - * + * * A Game Object that is flipped horizontally will render inversed on the horizontal axis. * Flipping always takes place from the middle of the texture and does not impact the scale value. * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * + * * @method Phaser.GameObjects.Components.Flip#setFlipX * @since 3.0.0 * * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped. - * + * * @return {this} This Game Object instance. */ setFlipX: function (value) @@ -38909,12 +39188,12 @@ var Flip = { /** * Sets the vertical flipped state of this Game Object. - * + * * @method Phaser.GameObjects.Components.Flip#setFlipY * @since 3.0.0 * * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped. - * + * * @return {this} This Game Object instance. */ setFlipY: function (value) @@ -38926,17 +39205,17 @@ var Flip = { /** * Sets the horizontal and vertical flipped state of this Game Object. - * + * * A Game Object that is flipped will render inversed on the flipped axis. * Flipping always takes place from the middle of the texture and does not impact the scale value. * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * + * * @method Phaser.GameObjects.Components.Flip#setFlip * @since 3.0.0 * * @param {boolean} x - The horizontal flipped state. `false` for no flip, or `true` to be flipped. * @param {boolean} y - The horizontal flipped state. `false` for no flip, or `true` to be flipped. - * + * * @return {this} This Game Object instance. */ setFlip: function (x, y) @@ -38949,7 +39228,7 @@ var Flip = { /** * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. - * + * * @method Phaser.GameObjects.Components.Flip#resetFlip * @since 3.0.0 * @@ -38975,7 +39254,7 @@ module.exports = Flip; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -39262,7 +39541,7 @@ var GetBounds = { var TLx, TLy, TRx, TRy, BLx, BLy, BRx, BRy; - // Instead of doing a check if parent container is + // Instead of doing a check if parent container is // defined per corner we only do it once. if (this.parentContainer) { @@ -39335,7 +39614,7 @@ module.exports = GetBounds; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -39458,13 +39737,13 @@ var Mask = { * @method Phaser.GameObjects.Components.Mask#createGeometryMask * @since 3.6.2 * - * @param {Phaser.GameObjects.Graphics} [graphics] - A Graphics Game Object. The geometry within it will be used as the mask. + * @param {Phaser.GameObjects.Graphics|Phaser.GameObjects.Shape} [graphics] - A Graphics Game Object, or any kind of Shape Game Object. The geometry within it will be used as the mask. * * @return {Phaser.Display.Masks.GeometryMask} This Geometry Mask that was created. */ createGeometryMask: function (graphics) { - if (graphics === undefined && this.type === 'Graphics') + if (graphics === undefined && (this instanceof Phaser.GameObjects.Graphics || this instanceof Phaser.GameObjects.Shape)) { // eslint-disable-next-line consistent-this graphics = this; @@ -39485,7 +39764,7 @@ module.exports = Mask; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -39689,7 +39968,7 @@ module.exports = Origin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -40056,7 +40335,7 @@ var PathFollower = { if (tweenData.state === TWEEN_CONST.COMPLETE) { - this.path.getPoint(1, pathVector); + this.path.getPoint(tweenData.end, pathVector); pathDelta.add(pathVector); pathVector.add(this.pathOffset); @@ -40117,7 +40396,7 @@ module.exports = PathFollower; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -40299,7 +40578,7 @@ var Pipeline = { * If you call this method multiple times, the new pipelines will be appended to any existing * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. * - * You can optionally also sets the `pipelineData` property, if the parameter is given. + * You can optionally also set the `pipelineData` property, if the parameter is given. * * Both the pipeline and post pipelines share the pipeline data object together. * @@ -40541,7 +40820,7 @@ module.exports = Pipeline; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -40565,7 +40844,7 @@ var ScrollFactor = { * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. - * + * * Please be aware that scroll factor values other than 1 are not taken in to consideration when * calculating physics collisions. Bodies always collide based on their world position, but changing * the scroll factor is a visual adjustment to where the textures are rendered, which can offset @@ -40589,7 +40868,7 @@ var ScrollFactor = { * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. - * + * * Please be aware that scroll factor values other than 1 are not taken in to consideration when * calculating physics collisions. Bodies always collide based on their world position, but changing * the scroll factor is a visual adjustment to where the textures are rendered, which can offset @@ -40613,7 +40892,7 @@ var ScrollFactor = { * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. - * + * * Please be aware that scroll factor values other than 1 are not taken in to consideration when * calculating physics collisions. Bodies always collide based on their world position, but changing * the scroll factor is a visual adjustment to where the textures are rendered, which can offset @@ -40649,13 +40928,13 @@ module.exports = ScrollFactor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Provides methods used for getting and setting the size of a Game Object. - * + * * @namespace Phaser.GameObjects.Components.Size * @since 3.0.0 */ @@ -40664,7 +40943,7 @@ var Size = { /** * A property indicating that a Game Object has this component. - * + * * @name Phaser.GameObjects.Components.Size#_sizeComponent * @type {boolean} * @private @@ -40675,11 +40954,11 @@ var Size = { /** * The native (un-scaled) width of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayWidth` property. - * + * * @name Phaser.GameObjects.Components.Size#width * @type {number} * @since 3.0.0 @@ -40688,11 +40967,11 @@ var Size = { /** * The native (un-scaled) height of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayHeight` property. - * + * * @name Phaser.GameObjects.Components.Size#height * @type {number} * @since 3.0.0 @@ -40701,11 +40980,11 @@ var Size = { /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. - * + * * @name Phaser.GameObjects.Components.Size#displayWidth * @type {number} * @since 3.0.0 @@ -40726,11 +41005,11 @@ var Size = { /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. - * + * * @name Phaser.GameObjects.Components.Size#displayHeight * @type {number} * @since 3.0.0 @@ -40751,20 +41030,20 @@ var Size = { /** * Sets the size of this Game Object to be that of the given Frame. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. - * + * * @method Phaser.GameObjects.Components.Size#setSizeToFrame * @since 3.0.0 * * @param {Phaser.Textures.Frame} frame - The frame to base the size of this Game Object on. - * + * * @return {this} This Game Object instance. */ setSizeToFrame: function (frame) @@ -40774,26 +41053,34 @@ var Size = { this.width = frame.realWidth; this.height = frame.realHeight; + var input = this.input; + + if (input && !input.customHitArea) + { + input.hitArea.width = this.width; + input.hitArea.height = this.height; + } + return this; }, /** * Sets the internal size of this Game Object, as used for frame or physics body creation. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. - * + * * @method Phaser.GameObjects.Components.Size#setSize * @since 3.0.0 * * @param {number} width - The width of this Game Object. * @param {number} height - The height of this Game Object. - * + * * @return {this} This Game Object instance. */ setSize: function (width, height) @@ -40806,15 +41093,15 @@ var Size = { /** * Sets the display size of this Game Object. - * + * * Calling this will adjust the scale. - * + * * @method Phaser.GameObjects.Components.Size#setDisplaySize * @since 3.0.0 * * @param {number} width - The width of this Game Object. * @param {number} height - The height of this Game Object. - * + * * @return {this} This Game Object instance. */ setDisplaySize: function (width, height) @@ -40837,7 +41124,7 @@ module.exports = Size; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -40968,7 +41255,7 @@ module.exports = Texture; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -41177,7 +41464,7 @@ module.exports = TextureCrop; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -41415,7 +41702,7 @@ module.exports = Tint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -41477,7 +41764,7 @@ module.exports = ToJSON; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -41500,6 +41787,17 @@ var _FLAG = 4; // 0100 var Transform = { + /** + * A property indicating that a Game Object has this component. + * + * @name Phaser.GameObjects.Components.Transform#hasTransformComponent + * @type {boolean} + * @readonly + * @default true + * @since 3.60.0 + */ + hasTransformComponent: true, + /** * Private internal value. Holds the horizontal scale value. * @@ -42089,7 +42387,7 @@ module.exports = Transform; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -42644,16 +42942,16 @@ var TransformMatrix = new Class({ }, /** - * Transform a point using this Matrix. + * Transform a point in to the local space of this Matrix. * * @method Phaser.GameObjects.Components.TransformMatrix#transformPoint * @since 3.0.0 * * @param {number} x - The x coordinate of the point to transform. * @param {number} y - The y coordinate of the point to transform. - * @param {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} point - The Point object to store the transformed coordinates. + * @param {Phaser.Types.Math.Vector2Like} [point] - Optional Point object to store the transformed coordinates in. * - * @return {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} The Point containing the transformed coordinates. + * @return {Phaser.Types.Math.Vector2Like} The Point containing the transformed coordinates. */ transformPoint: function (x, y, point) { @@ -43110,7 +43408,7 @@ module.exports = TransformMatrix; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -43120,7 +43418,7 @@ var _FLAG = 1; // 0001 /** * Provides methods used for setting the visibility of a Game Object. * Should be applied as a mixin and not used directly. - * + * * @namespace Phaser.GameObjects.Components.Visible * @since 3.0.0 */ @@ -43129,7 +43427,7 @@ var Visible = { /** * Private internal value. Holds the visible value. - * + * * @name Phaser.GameObjects.Components.Visible#_visible * @type {boolean} * @private @@ -43140,9 +43438,9 @@ var Visible = { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. - * + * * @name Phaser.GameObjects.Components.Visible#visible * @type {boolean} * @since 3.0.0 @@ -43172,14 +43470,14 @@ var Visible = { /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * * @method Phaser.GameObjects.Components.Visible#setVisible * @since 3.0.0 * * @param {boolean} value - The visible state of the Game Object. - * + * * @return {this} This Game Object instance. */ setVisible: function (value) @@ -43200,7 +43498,7 @@ module.exports = Visible; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -43244,7 +43542,7 @@ module.exports = { /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -43692,9 +43990,11 @@ var Container = new Class({ gameObject.parentContainer.remove(gameObject); } + gameObject.parentContainer = this; + gameObject.removeFromDisplayList(); - gameObject.parentContainer = this; + gameObject.addedToScene(); } }, @@ -43709,12 +44009,14 @@ var Container = new Class({ */ removeHandler: function (gameObject) { - gameObject.off(Events.DESTROY, this.remove); + gameObject.off(Events.DESTROY, this.remove, this); if (this.exclusive) { gameObject.parentContainer = null; + gameObject.removedFromScene(); + gameObject.addToDisplayList(); } }, @@ -43741,7 +44043,8 @@ var Container = new Class({ } else { - output = new Vector2(source.x, source.y); + output.x = source.x; + output.y = source.y; } var tempMatrix = this.tempTransformMatrix; @@ -44169,14 +44472,25 @@ var Container = new Class({ */ removeAll: function (destroyChild) { - var removed = ArrayUtils.RemoveBetween(this.list, 0, this.list.length, this.removeHandler, this); + var list = this.list; if (destroyChild) { - for (var i = 0; i < removed.length; i++) + for (var i = 0; i < list.length; i++) { - removed[i].destroy(); + if (list[i] && list[i].scene) + { + list[i].off(Events.DESTROY, this.remove, this); + + list[i].destroy(); + } } + + this.list = []; + } + else + { + ArrayUtils.RemoveBetween(list, 0, list.length, this.removeHandler, this); } return this; @@ -44639,7 +44953,7 @@ module.exports = Container; /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -44748,7 +45062,7 @@ module.exports = ContainerCanvasRenderer; /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -44799,7 +45113,7 @@ GameObjectCreator.register('container', function (config, addToScene) /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -44834,12 +45148,13 @@ GameObjectFactory.register('container', function (x, y, children) /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -44867,7 +45182,7 @@ module.exports = { /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -44990,7 +45305,7 @@ var ContainerWebGLRenderer = function (renderer, container, camera, parentMatrix child.setAlpha(childAlphaTopLeft * alpha, childAlphaTopRight * alpha, childAlphaBottomLeft * alpha, childAlphaBottomRight * alpha); // Render - child.renderWebGL(renderer, child, camera, transformMatrix); + child.renderWebGL(renderer, child, camera, transformMatrix, container); // Restore original values @@ -45019,7 +45334,7 @@ module.exports = ContainerWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -45062,7 +45377,7 @@ module.exports = [ /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -46058,7 +46373,7 @@ module.exports = DOMElement; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -46186,7 +46501,7 @@ module.exports = DOMElementCSSRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -46276,12 +46591,13 @@ GameObjectFactory.register('dom', function (x, y, element, style, innerText) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -46308,7 +46624,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -46335,7 +46651,7 @@ module.exports = 'addedtoscene'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -46362,7 +46678,7 @@ module.exports = 'destroy'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -46389,27 +46705,27 @@ module.exports = 'removedfromscene'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Video Game Object Complete Event. - * + * * This event is dispatched when a Video finishes playback by reaching the end of its duration. It * is also dispatched if a video marker sequence is being played and reaches the end. - * + * * Note that not all videos can fire this event. Live streams, for example, have no fixed duration, * so never technically 'complete'. - * + * * If a video is stopped from playback, via the `Video.stop` method, it will emit the * `VIDEO_STOP` event instead of this one. - * + * * Listen for it from a Video Game Object instance using `Video.on('complete', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_COMPLETE * @since 3.20.0 - * + * * @param {Phaser.GameObjects.Video} video - The Video Game Object which completed playback. */ module.exports = 'complete'; @@ -46422,22 +46738,22 @@ module.exports = 'complete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Video Game Object Created Event. - * + * * This event is dispatched when the texture for a Video has been created. This happens * when enough of the video source has been loaded that the browser is able to render a * frame from it. - * + * * Listen for it from a Video Game Object instance using `Video.on('created', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_CREATED * @since 3.20.0 - * + * * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event. * @param {number} width - The width of the video. * @param {number} height - The height of the video. @@ -46452,20 +46768,20 @@ module.exports = 'created'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Video Game Object Error Event. - * + * * This event is dispatched when a Video tries to play a source that does not exist, or is the wrong file type. - * + * * Listen for it from a Video Game Object instance using `Video.on('error', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_ERROR * @since 3.20.0 - * + * * @param {Phaser.GameObjects.Video} video - The Video Game Object which threw the error. * @param {Event} event - The native DOM event the browser raised during playback. */ @@ -46479,27 +46795,27 @@ module.exports = 'error'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Video Game Object Loop Event. - * + * * This event is dispatched when a Video that is currently playing has looped. This only * happens if the `loop` parameter was specified, or the `setLoop` method was called, * and if the video has a fixed duration. Video streams, for example, cannot loop, as * they have no duration. - * + * * Looping is based on the result of the Video `timeupdate` event. This event is not * frame-accurate, due to the way browsers work, so please do not rely on this loop * event to be time or frame precise. - * + * * Listen for it from a Video Game Object instance using `Video.on('loop', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_LOOP * @since 3.20.0 - * + * * @param {Phaser.GameObjects.Video} video - The Video Game Object which has looped. */ module.exports = 'loop'; @@ -46512,23 +46828,23 @@ module.exports = 'loop'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Video Game Object Play Event. - * + * * This event is dispatched when a Video begins playback. For videos that do not require * interaction unlocking, this is usually as soon as the `Video.play` method is called. * However, for videos that require unlocking, it is fired once playback begins after * they've been unlocked. - * + * * Listen for it from a Video Game Object instance using `Video.on('play', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_PLAY * @since 3.20.0 - * + * * @param {Phaser.GameObjects.Video} video - The Video Game Object which started playback. */ module.exports = 'play'; @@ -46541,20 +46857,20 @@ module.exports = 'play'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Video Game Object Seeked Event. - * + * * This event is dispatched when a Video completes seeking to a new point in its timeline. - * + * * Listen for it from a Video Game Object instance using `Video.on('seeked', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_SEEKED * @since 3.20.0 - * + * * @param {Phaser.GameObjects.Video} video - The Video Game Object which completed seeking. */ module.exports = 'seeked'; @@ -46567,21 +46883,21 @@ module.exports = 'seeked'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Video Game Object Seeking Event. - * + * * This event is dispatched when a Video _begins_ seeking to a new point in its timeline. * When the seek is complete, it will dispatch the `VIDEO_SEEKED` event to conclude. - * + * * Listen for it from a Video Game Object instance using `Video.on('seeking', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_SEEKING * @since 3.20.0 - * + * * @param {Phaser.GameObjects.Video} video - The Video Game Object which started seeking. */ module.exports = 'seeking'; @@ -46594,21 +46910,21 @@ module.exports = 'seeking'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Video Game Object Stopped Event. - * + * * This event is dispatched when a Video is stopped from playback via a call to the `Video.stop` method, * either directly via game code, or indirectly as the result of changing a video source or destroying it. - * + * * Listen for it from a Video Game Object instance using `Video.on('stop', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_STOP * @since 3.20.0 - * + * * @param {Phaser.GameObjects.Video} video - The Video Game Object which stopped playback. */ module.exports = 'stop'; @@ -46621,21 +46937,21 @@ module.exports = 'stop'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Video Game Object Timeout Event. - * + * * This event is dispatched when a Video has exhausted its allocated time while trying to connect to a video * source to start playback. - * + * * Listen for it from a Video Game Object instance using `Video.on('timeout', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_TIMEOUT * @since 3.20.0 - * + * * @param {Phaser.GameObjects.Video} video - The Video Game Object which timed out. */ module.exports = 'timeout'; @@ -46648,21 +46964,21 @@ module.exports = 'timeout'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Video Game Object Unlocked Event. - * + * * This event is dispatched when a Video that was prevented from playback due to the browsers * Media Engagement Interaction policy, is unlocked by a user gesture. - * + * * Listen for it from a Video Game Object instance using `Video.on('unlocked', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_UNLOCKED * @since 3.20.0 - * + * * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event. */ module.exports = 'unlocked'; @@ -46675,7 +46991,7 @@ module.exports = 'unlocked'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -46709,7 +47025,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -46829,7 +47145,7 @@ module.exports = Extern; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -46871,12 +47187,13 @@ GameObjectFactory.register('extern', function () /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -46903,7 +47220,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -46944,7 +47261,7 @@ module.exports = ExternWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -46980,7 +47297,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -47215,7 +47532,7 @@ var Graphics = new Class({ }, /** - * Set the current line style. + * Set the current line style. Used for all 'stroke' related functions. * * @method Phaser.GameObjects.Graphics#lineStyle * @since 3.0.0 @@ -47241,7 +47558,7 @@ var Graphics = new Class({ }, /** - * Set the current fill style. + * Set the current fill style. Used for all 'fill' related functions. * * @method Phaser.GameObjects.Graphics#fillStyle * @since 3.0.0 @@ -47690,6 +48007,8 @@ var Graphics = new Class({ var tr = radius; var bl = radius; var br = radius; + + var maxRadius = Math.min(width, height) / 2; if (typeof radius !== 'number') { @@ -47698,7 +48017,12 @@ var Graphics = new Class({ bl = GetFastValue(radius, 'bl', 20); br = GetFastValue(radius, 'br', 20); } - + + tl = Math.min(tl, maxRadius); + tr = Math.min(tr, maxRadius); + bl = Math.min(bl, maxRadius); + br = Math.min(br, maxRadius); + this.beginPath(); this.moveTo(x + tl, y); this.lineTo(x + width - tr, y); @@ -48457,7 +48781,7 @@ module.exports = Graphics; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -48705,7 +49029,7 @@ module.exports = GraphicsCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -48740,7 +49064,7 @@ GameObjectCreator.register('graphics', function (config, addToScene) { this.scene.sys.displayList.add(graphics); } - + return graphics; }); @@ -48754,7 +49078,7 @@ GameObjectCreator.register('graphics', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -48794,12 +49118,13 @@ GameObjectFactory.register('graphics', function (config) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -48829,7 +49154,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -49185,7 +49510,7 @@ module.exports = GraphicsWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -49310,7 +49635,7 @@ var Group = new Class({ * The class to create new group members from. * * @name Phaser.GameObjects.Group#classType - * @type {Function} + * @type {Phaser.Types.GameObjects.Group.GroupClassTypeConstructor} * @since 3.0.0 * @default Phaser.GameObjects.Sprite */ @@ -50915,7 +51240,7 @@ module.exports = Group; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -50949,7 +51274,7 @@ GameObjectCreator.register('group', function (config) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -50964,7 +51289,7 @@ var GameObjectFactory = __webpack_require__(61286); * @method Phaser.GameObjects.GameObjectFactory#group * @since 3.0.0 * - * @param {(Phaser.GameObjects.GameObject[]|Phaser.Types.GameObjects.Group.GroupConfig|Phaser.Types.GameObjects.Group.GroupConfig[])} [children] - Game Objects to add to this Group; or the `config` argument. + * @param {(Phaser.GameObjects.GameObject[]|Phaser.Types.GameObjects.Group.GroupConfig|Phaser.Types.GameObjects.Group.GroupConfig[]|Phaser.Types.GameObjects.Group.GroupCreateConfig)} [children] - Game Objects to add to this Group; or the `config` argument. * @param {Phaser.Types.GameObjects.Group.GroupConfig|Phaser.Types.GameObjects.Group.GroupCreateConfig} [config] - A Group Configuration object. * * @return {Phaser.GameObjects.Group} The Game Object that was created. @@ -50982,7 +51307,7 @@ GameObjectFactory.register('group', function (children, config) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -51086,7 +51411,7 @@ module.exports = Image; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -51121,7 +51446,7 @@ module.exports = ImageCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -51172,7 +51497,7 @@ GameObjectCreator.register('image', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -51215,12 +51540,13 @@ GameObjectFactory.register('image', function (x, y, key, frame) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -51247,7 +51573,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -51282,7 +51608,7 @@ module.exports = ImageWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -51435,7 +51761,7 @@ module.exports = GameObjects; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -52368,8 +52694,10 @@ var Layer = new Class({ * @method Phaser.GameObjects.Layer#destroy * @fires Phaser.GameObjects.Events#DESTROY * @since 3.50.0 + * + * @param {boolean} [fromScene=false] - `True` if this Game Object is being destroyed by the Scene, `false` if not. */ - destroy: function () + destroy: function (fromScene) { // This Game Object has already been destroyed if (!this.scene || this.ignoreDestroy) @@ -52379,11 +52707,11 @@ var Layer = new Class({ this.emit(GameObjectEvents.DESTROY, this); - var i = this.list.length; + var list = this.list; - while (i--) + while (list.length) { - this.list[i].destroy(); + list[0].destroy(fromScene); } this.removeAllListeners(); @@ -52426,7 +52754,7 @@ module.exports = Layer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -52442,7 +52770,6 @@ module.exports = Layer; * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Layer} layer - The Game Object being rendered in this call. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ var LayerCanvasRenderer = function (renderer, layer, camera) { @@ -52513,7 +52840,7 @@ module.exports = LayerCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -52561,7 +52888,7 @@ GameObjectCreator.register('layer', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -52593,12 +52920,13 @@ GameObjectFactory.register('layer', function (children) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -52625,7 +52953,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -52749,7 +53077,7 @@ module.exports = LayerWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -52769,13 +53097,19 @@ var Utils = __webpack_require__(75512); * * They can also simply be used to represent a point light for your own purposes. * + * As of Phaser 3.60 this Game Object now has the Transform and Origin components. However, changing the scale, + * rotation or origin properties will not make any difference to the Light. They are simply present to allow you + * to add this Light to a Container, or enable it for Physics. + * * @class Light * @extends Phaser.Geom.Circle * @memberof Phaser.GameObjects * @constructor * @since 3.0.0 * + * @extends Phaser.GameObjects.Components.Origin * @extends Phaser.GameObjects.Components.ScrollFactor + * @extends Phaser.GameObjects.Components.Transform * @extends Phaser.GameObjects.Components.Visible * * @param {number} x - The horizontal position of the light. @@ -52791,7 +53125,9 @@ var Light = new Class({ Extends: Circle, Mixins: [ + Components.Origin, Components.ScrollFactor, + Components.Transform, Components.Visible ], @@ -52847,6 +53183,92 @@ var Light = new Class({ this.cameraFilter = 0; this.setScrollFactor(1, 1); + this.setOrigin(); + this.setDisplayOrigin(radius); + }, + + /** + * The width of this Light Game Object. This is the same as `Light.diameter`. + * + * @name Phaser.GameObjects.Light#displayWidth + * @type {number} + * @since 3.60.0 + */ + displayWidth: { + + get: function () + { + return this.diameter; + }, + + set: function (value) + { + this.diameter = value; + } + + }, + + /** + * The height of this Light Game Object. This is the same as `Light.diameter`. + * + * @name Phaser.GameObjects.Light#displayHeight + * @type {number} + * @since 3.60.0 + */ + displayHeight: { + + get: function () + { + return this.diameter; + }, + + set: function (value) + { + this.diameter = value; + } + + }, + + /** + * The width of this Light Game Object. This is the same as `Light.diameter`. + * + * @name Phaser.GameObjects.Light#width + * @type {number} + * @since 3.60.0 + */ + width: { + + get: function () + { + return this.diameter; + }, + + set: function (value) + { + this.diameter = value; + } + + }, + + /** + * The height of this Light Game Object. This is the same as `Light.diameter`. + * + * @name Phaser.GameObjects.Light#height + * @type {number} + * @since 3.60.0 + */ + height: { + + get: function () + { + return this.diameter; + }, + + set: function (value) + { + this.diameter = value; + } + }, /** @@ -52939,7 +53361,7 @@ module.exports = Light; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -53301,7 +53723,7 @@ module.exports = LightsManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -53420,7 +53842,7 @@ module.exports = LightsPlugin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -53969,10 +54391,16 @@ var Mesh = new Class({ addVerticesFromObj: function (key, scale, x, y, z, rotateX, rotateY, rotateZ, zIsUp) { var data = this.scene.sys.cache.obj.get(key); + var parsedData; if (data) { - GenerateObjVerts(data, this, scale, x, y, z, rotateX, rotateY, rotateZ, zIsUp); + parsedData = GenerateObjVerts(data, this, scale, x, y, z, rotateX, rotateY, rotateZ, zIsUp); + } + + if (!parsedData || parsedData.verts.length === 0) + { + console.warn('Mesh.addVerticesFromObj data empty:', key); } return this; @@ -54136,6 +54564,10 @@ var Mesh = new Class({ this.faces = this.faces.concat(result.faces); this.vertices = this.vertices.concat(result.vertices); } + else + { + console.warn('Mesh.addVertices data empty or invalid'); + } this.dirtyCache[9] = -1; @@ -54474,8 +54906,74 @@ var Mesh = new Class({ this.debugCallback = null; this.debugGraphic = null; - } + }, + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff on all vertices, + * which results in no visible change to the texture. + * + * @method Phaser.GameObjects.Mesh#clearTint + * @webglOnly + * @since 3.60.0 + * + * @return {this} This Game Object instance. + */ + clearTint: function () + { + return this.setTint(); + }, + + /** + * Sets an additive tint on all vertices of this Mesh Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. + * + * To remove a tint call `clearTint`. + * + * @method Phaser.GameObjects.Mesh#setTint + * @webglOnly + * @since 3.60.0 + * + * @param {number} [tint=0xffffff] - The tint being applied to all vertices of this Mesh Game Object. + * + * @return {this} This Game Object instance. + */ + setTint: function (tint) + { + if (tint === undefined) { tint = 0xffffff; } + + var vertices = this.vertices; + + for (var i = 0; i < vertices.length; i++) + { + vertices[i].color = tint; + } + + return this; + }, + + /** + * The tint value being applied to the whole of the Game Object. + * This property is a setter-only. + * + * @method Phaser.GameObjects.Mesh#tint + * @type {number} + * @webglOnly + * @since 3.60.0 + */ + tint: { + + set: function (value) + { + this.setTint(value); + } + } }); module.exports = Mesh; @@ -54488,7 +54986,7 @@ module.exports = Mesh; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -54517,7 +55015,7 @@ module.exports = MeshCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -54574,7 +55072,7 @@ GameObjectCreator.register('mesh', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -54620,12 +55118,13 @@ if (true) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -54652,7 +55151,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -54765,7 +55264,7 @@ module.exports = MeshWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -55003,6 +55502,12 @@ var EmitterOp = new Class({ this.onEmit = this.defaultEmit; this.onUpdate = this.defaultUpdate; + // `moveToX` and `moveToY` are null by default + if (value === null) + { + return; + } + if (t === 'number') { // Explicit static value: @@ -55369,7 +55874,7 @@ module.exports = EmitterOp; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -55379,9 +55884,9 @@ var GetFastValue = __webpack_require__(72632); /** * @classdesc * The GravityWell action applies a force on the particle to draw it towards, or repel it from, a single point. - * + * * The force applied is inversely proportional to the square of the distance from the particle to the point, in accordance with Newton's law of gravity. - * + * * This simulates the effect of gravity over large distances (as between planets, for example). * * @class GravityWell @@ -55589,13 +56094,12 @@ module.exports = GravityWell; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var Class = __webpack_require__(56694); var DegToRad = __webpack_require__(75606); -var DistanceBetween = __webpack_require__(53996); /** * @classdesc @@ -55929,16 +56433,10 @@ var Particle = new Class({ { var mx = emitter.moveToX.onEmit(this, 'moveToX'); var my = (emitter.moveToY) ? emitter.moveToY.onEmit(this, 'moveToY') : mx; + var lifeS = this.life / 1000; - var angle = Math.atan2(my - this.y, mx - this.x); - - var speed = DistanceBetween(this.x, this.y, mx, my) / (this.life / 1000); - - // We know how many pixels we need to move, but how fast? - // var speed = this.distanceToXY(displayObject, x, y) / (maxTime / 1000); - - this.velocityX = Math.cos(angle) * speed; - this.velocityY = Math.sin(angle) * speed; + this.velocityX = (mx - this.x) / lifeS; + this.velocityY = (my - this.y) / lifeS; } else { @@ -55958,7 +56456,7 @@ var Particle = new Class({ this.delayCurrent = emitter.delay.onEmit(this, 'delay'); this.scaleX = emitter.scaleX.onEmit(this, 'scaleX'); - this.scaleY = (emitter.scaleY) ? emitter.scaleY.onEmit(this, 'scaleY') : this.scaleX; + this.scaleY = emitter.scaleY.onEmit(this, 'scaleY'); this.angle = emitter.rotate.onEmit(this, 'rotate'); this.rotation = DegToRad(this.angle); @@ -56120,15 +56618,7 @@ var Particle = new Class({ } this.scaleX = emitter.scaleX.onUpdate(this, 'scaleX', t, this.scaleX); - - if (emitter.scaleY) - { - this.scaleY = emitter.scaleY.onUpdate(this, 'scaleY', t, this.scaleY); - } - else - { - this.scaleY = this.scaleX; - } + this.scaleY = emitter.scaleY.onUpdate(this, 'scaleY', t, this.scaleY); this.angle = emitter.rotate.onUpdate(this, 'rotate', t, this.angle); this.rotation = DegToRad(this.angle); @@ -56154,7 +56644,7 @@ module.exports = Particle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -56265,6 +56755,7 @@ var ParticleEmitter = new Class({ 'gravityX', 'gravityY', 'maxParticles', + 'maxAliveParticles', 'name', 'on', 'particleBringToTop', @@ -56321,7 +56812,7 @@ var ParticleEmitter = new Class({ * The Particle Class which will be emitted by this Emitter. * * @name Phaser.GameObjects.Particles.ParticleEmitter#particleClass - * @type {Phaser.GameObjects.Particles.Particle} + * @type {Phaser.Types.GameObjects.Particles.ParticleClassConstructor} * @default Phaser.GameObjects.Particles.Particle * @since 3.0.0 */ @@ -56457,7 +56948,10 @@ var ParticleEmitter = new Class({ this.speedY = new EmitterOp(config, 'speedY', 0, true); /** - * Whether moveToX and moveToY are nonzero. Set automatically during configuration. + * Whether moveToX and moveToY are set. Set automatically during configuration. + * + * When true the particles move toward the moveToX and moveToY coordinates and arrive at the end of their life. + * Emitter angle, speedX, and speedY are ignored. * * @name Phaser.GameObjects.Particles.ParticleEmitter#moveTo * @type {boolean} @@ -56474,7 +56968,7 @@ var ParticleEmitter = new Class({ * @default 0 * @since 3.0.0 */ - this.moveToX = new EmitterOp(config, 'moveToX', 0, true); + this.moveToX = new EmitterOp(config, 'moveToX', null, true); /** * The y-coordinate emitted particles move toward, when {@link Phaser.GameObjects.Particles.ParticleEmitter#moveTo} is true. @@ -56484,7 +56978,7 @@ var ParticleEmitter = new Class({ * @default 0 * @since 3.0.0 */ - this.moveToY = new EmitterOp(config, 'moveToY', 0, true); + this.moveToY = new EmitterOp(config, 'moveToY', null, true); /** * Whether particles will rebound when they meet the emitter bounds. @@ -56624,6 +57118,19 @@ var ParticleEmitter = new Class({ */ this.maxParticles = 0; + /** + * The maximum number of alive (and rendering) particles this emitter will update. + * When this limit is reached, a particle needs to die before another can be emitted. + * + * 0 means no limits. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#maxAliveParticles + * @type {number} + * @default 0 + * @since 3.60.0 + */ + this.maxAliveParticles = 0; + /** * How many particles are emitted each time particles are emitted (one explosion or one flow cycle). * @@ -56960,7 +57467,7 @@ var ParticleEmitter = new Class({ this.acceleration = (this.accelerationX.propertyValue !== 0 || this.accelerationY.propertyValue !== 0); - this.moveTo = (this.moveToX.propertyValue !== 0 || this.moveToY.propertyValue !== 0); + this.moveTo = (this.moveToX.propertyValue !== null && this.moveToY.propertyValue !== null); // Special 'speed' override @@ -56981,7 +57488,7 @@ var ParticleEmitter = new Class({ if (HasValue(config, 'scale')) { this.scaleX.loadConfig(config, 'scale'); - this.scaleY = null; + this.scaleY.loadConfig(config, 'scale'); } if (HasValue(config, 'callbackScope')) @@ -57066,9 +57573,10 @@ var ParticleEmitter = new Class({ output.speed = this.speedX.toJSON(); } - if (!this.scaleY) + if (this.scaleX === this.scaleY) { delete output.scaleX; + delete output.scaleY; output.scale = this.scaleX.toJSON(); } @@ -57395,7 +57903,7 @@ var ParticleEmitter = new Class({ }, /** - * Sets the scale of emitted particles. + * Sets the scale of emitted particles. This updates both the scaleX and scaleY values. * * @method Phaser.GameObjects.Particles.ParticleEmitter#setScale * @since 3.0.0 @@ -57407,7 +57915,7 @@ var ParticleEmitter = new Class({ setScale: function (value) { this.scaleX.onChange(value); - this.scaleY = null; + this.scaleY.onChange(value); return this; }, @@ -57744,7 +58252,8 @@ var ParticleEmitter = new Class({ }, /** - * Whether this emitter is at its limit (if set). + * Whether this emitter is at either its hard-cap limit (maxParticles), if set, or + * the max allowed number of 'alive' particles (maxAliveParticles). * * @method Phaser.GameObjects.Particles.ParticleEmitter#atLimit * @since 3.0.0 @@ -57753,7 +58262,12 @@ var ParticleEmitter = new Class({ */ atLimit: function () { - return (this.maxParticles > 0 && this.getParticleCount() === this.maxParticles); + if (this.maxParticles > 0 && this.getParticleCount() >= this.maxParticles) + { + return true; + } + + return (this.maxAliveParticles > 0 && this.getAliveParticleCount() >= this.maxAliveParticles); }, /** @@ -58018,9 +58532,9 @@ var ParticleEmitter = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitter#explode * @since 3.0.0 * - * @param {number} count - The amount of Particles to emit. - * @param {number} x - The x coordinate to emit the Particles from. - * @param {number} y - The y coordinate to emit the Particles from. + * @param {number} [count=this.quantity] - The number of Particles to emit. + * @param {number} [x=this.x] - The x coordinate to emit the Particles from. + * @param {number} [y=this.x] - The y coordinate to emit the Particles from. * * @return {Phaser.GameObjects.Particles.Particle} The most recently emitted Particle. */ @@ -58196,12 +58710,12 @@ var ParticleEmitter = new Class({ { this._counter -= delta; - if (this._counter <= 0) + while (this._counter <= 0) { this.emitParticle(); // counter = frequency - remained from previous delta - this._counter = (this.frequency - Math.abs(this._counter)); + this._counter += this.frequency; } } }, @@ -58234,7 +58748,7 @@ module.exports = ParticleEmitter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -58742,7 +59256,7 @@ module.exports = ParticleEmitterManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -58845,26 +59359,29 @@ var ParticleManagerCanvasRenderer = function (renderer, emitterManager, camera, var frame = particle.frame; var cd = frame.canvasData; - var x = -(frame.halfWidth); - var y = -(frame.halfHeight); - - ctx.globalAlpha = alpha; - - ctx.save(); - - calcMatrix.setToContext(ctx); - - if (roundPixels) + if (cd.width > 0 && cd.height > 0) { - x = Math.round(x); - y = Math.round(y); + var x = -(frame.halfWidth); + var y = -(frame.halfHeight); + + ctx.globalAlpha = alpha; + + ctx.save(); + + calcMatrix.setToContext(ctx); + + if (roundPixels) + { + x = Math.round(x); + y = Math.round(y); + } + + ctx.imageSmoothingEnabled = !frame.source.scaleMode; + + ctx.drawImage(frame.source.image, cd.x, cd.y, cd.width, cd.height, x, y, cd.width, cd.height); + + ctx.restore(); } - - ctx.imageSmoothingEnabled = !(!renderer.antialias || frame.source.scaleMode); - - ctx.drawImage(frame.source.image, cd.x, cd.y, cd.width, cd.height, x, y, cd.width, cd.height); - - ctx.restore(); } ctx.restore(); @@ -58881,7 +59398,7 @@ module.exports = ParticleManagerCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -58941,7 +59458,7 @@ GameObjectCreator.register('particles', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -58975,12 +59492,13 @@ GameObjectFactory.register('particles', function (key, frame, emitters) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -59007,7 +59525,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -59165,7 +59683,7 @@ module.exports = ParticleManagerWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -59192,7 +59710,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -59271,7 +59789,7 @@ module.exports = DeathZone; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -59516,7 +60034,7 @@ module.exports = EdgeZone; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -59590,7 +60108,7 @@ module.exports = RandomZone; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -59614,7 +60132,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -59697,7 +60215,7 @@ module.exports = PathFollower; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -59746,7 +60264,7 @@ GameObjectFactory.register('follower', function (path, x, y, key, frame) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -59815,7 +60333,6 @@ var PointLight = new Class({ Components.AlphaSingle, Components.BlendMode, Components.Depth, - Components.GetBounds, Components.Mask, Components.Pipeline, Components.ScrollFactor, @@ -59952,7 +60469,7 @@ module.exports = PointLight; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -60003,7 +60520,7 @@ GameObjectCreator.register('pointlight', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -60064,12 +60581,13 @@ GameObjectFactory.register('pointlight', function (x, y, color, radius, intensit /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -60091,7 +60609,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -60160,7 +60678,7 @@ module.exports = PointLightWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -60192,6 +60710,10 @@ var UUID = __webpack_require__(76583); * is a technical limitation of WebGL. To get around it, create your shape as a texture in an art package, then draw that * to the Render Texture. * + * If you are planning on using this Render Texture as a base texture for Sprite + * Game Objects, then you should call `RenderTexture.setIsSpriteTexture()` _before_ + * calling any `draw` methods, otherwise you will get inverted frames in WebGL. + * * @class RenderTexture * @extends Phaser.GameObjects.GameObject * @memberof Phaser.GameObjects @@ -60350,6 +60872,23 @@ var RenderTexture = new Class({ */ this._saved = false; + /** + * Is this Render Texture being used as the base texture for a Sprite Game Object? + * + * To enable this, call `RenderTexture.setIsSpriteTexture(true)`. + * + * You should do this _before_ drawing to this RenderTexture, so that it correctly + * inverses the frames for WebGL rendering. Not doing so will result in inverted frames. + * + * This property is used in the `endDraw` method. + * + * @name Phaser.GameObjects.RenderTexture#isSpriteTexture + * @type {boolean} + * @readonly + * @since 3.60.0 + */ + this.isSpriteTexture = false; + if (key === undefined) { this.canvas = CanvasPool.create2D(this, width, height); @@ -60430,6 +60969,8 @@ var RenderTexture = new Class({ this.drawGameObject = this.batchGameObjectWebGL; this.renderTarget = new RenderTarget(renderer, width, height, 1, 0, false); + + this.setFlipY(this.isSpriteTexture); } else if (renderer.type === CONST.CANVAS) { @@ -60466,6 +61007,27 @@ var RenderTexture = new Class({ return this.resize(width, height); }, + /** + * If you are planning on using this Render Texture as a base texture for Sprite + * Game Objects, then you should call this method with a value of `true` before + * calling drawing anything to it, otherwise you will get inverted frames in WebGL. + * + * @method Phaser.GameObjects.RenderTexture#setIsSpriteTexture + * @since 3.60.0 + * + * @param {boolean} value - Is this Render Target being used as a Sprite Texture, or not? + * + * @return {this} This Game Object instance. + */ + setIsSpriteTexture: function (value) + { + this.isSpriteTexture = value; + + this.setFlipY(value); + + return this; + }, + /** * Resizes the Render Texture to the new dimensions given. * @@ -60518,6 +61080,7 @@ var RenderTexture = new Class({ frame.source.isRenderTexture = true; frame.source.isGLTexture = true; frame.source.glTexture = renderTarget.texture; + frame.source.glTexture.flipY = true; } this.camera.setSize(width, height); @@ -60668,9 +61231,9 @@ var RenderTexture = new Class({ if (width === undefined) { width = frame.cutWidth; } if (height === undefined) { height = frame.cutHeight; } - var r = (rgb >> 16 & 0xFF) / 255; - var g = (rgb >> 8 & 0xFF) / 255; - var b = (rgb & 0xFF) / 255; + var r = (rgb >> 16 & 0xFF); + var g = (rgb >> 8 & 0xFF); + var b = (rgb & 0xFF); var renderTarget = this.renderTarget; @@ -60695,7 +61258,7 @@ var RenderTexture = new Class({ pipeline.drawFillRect( x * sx, y * sy, width * sx, height * sy, - Utils.getTintFromFloats(b, g, r, 1), + Utils.getTintFromFloats(b / 255, g / 255, r / 255, 1), alpha ); @@ -60824,7 +61387,10 @@ var RenderTexture = new Class({ * * A Texture Frame instance. * * A string. This is used to look-up a texture from the Texture Manager. * - * Note: You cannot draw a Render Texture to itself. + * Note 1: You cannot draw a Render Texture to itself. + * + * Note 2: For Game Objects that have Post FX Pipelines, the pipeline _cannot_ be + * used when drawn to this Render Texture. * * If passing in a Group or Container it will only draw children that return `true` * when their `willRender()` method is called. I.e. a Container with 10 children, @@ -60851,6 +61417,10 @@ var RenderTexture = new Class({ * try and pass them in an array in one single call, rather than making lots of * separate calls. * + * If you are planning on using this Render Texture as a base texture for Sprite + * Game Objects, then you should set `RenderTexture.isSpriteTexture = true` before + * calling this method, otherwise you will get inverted frames in WebGL. + * * @method Phaser.GameObjects.RenderTexture#draw * @since 3.2.0 * @@ -60889,11 +61459,15 @@ var RenderTexture = new Class({ * * If you need to draw a Sprite to this Render Texture, use the `draw` method instead. * + * If you are planning on using this Render Texture as a base texture for Sprite + * Game Objects, then you should set `RenderTexture.isSpriteTexture = true` before + * calling this method, otherwise you will get inverted frames in WebGL. + * * @method Phaser.GameObjects.RenderTexture#drawFrame * @since 3.12.0 * * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. - * @param {(string|number)} [frame] - The name or index of the frame within the Texture. + * @param {(string|number)} [frame] - The name or index of the frame within the Texture. Set to `null` to skip this argument if not required. * @param {number} [x=0] - The x position to draw the frame at. * @param {number} [y=0] - The y position to draw the frame at. * @param {number} [alpha] - The alpha to use. If not specified it uses the `globalAlpha` property. @@ -60910,6 +61484,65 @@ var RenderTexture = new Class({ return this; }, + /** + * Takes the given Texture Frame and draws it to this Render Texture + * as a fill pattern, i.e. in a grid-layout based on the frame dimensions. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * + * ```javascript + * var rt = this.add.renderTexture(0, 0, 800, 600); + * rt.fillFrame(key, frame); + * ``` + * + * You can optionally provide a position, alpha and tint value to apply to the frames + * before they are drawn. The position controls the offset of the first frame to be drawn + * and can be negative if required. + * + * Calling this method will cause a batch flush, so if you've got a stack of things to draw + * in a tight loop, try using the `draw` method instead. + * + * If you are planning on using this Render Texture as a base texture for Sprite + * Game Objects, then you should set `RenderTexture.isSpriteTexture = true` before + * calling this method, otherwise you will get inverted frames in WebGL. + * + * @method Phaser.GameObjects.RenderTexture#fillFrame + * @since 3.60.0 + * + * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. + * @param {(string|number)} [frame] - The name or index of the frame within the Texture. Set to `null` to skip this argument if not required. + * @param {number} [x=0] - The x position to start drawing the frames from (can be negative to offset). + * @param {number} [y=0] - The y position to start drawing the frames from (can be negative to offset). + * @param {number} [alpha] - The alpha to use. If not specified it uses the `globalAlpha` property. + * @param {number} [tint] - WebGL only. The tint color to use. If not specified it uses the `globalTint` property. + * + * @return {this} This Render Texture instance. + */ + fillFrame: function (key, frame, x, y, alpha, tint) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + + var textureFrame = this.textureManager.getFrame(key, frame); + + if (textureFrame) + { + this.beginDraw(); + + for (var sy = y; sy < this.height; sy += textureFrame.height) + { + for (var sx = x; sx < this.width; sx += textureFrame.width) + { + this.batchDrawFrame(key, frame, sx, sy, alpha, tint); + } + } + + this.endDraw(); + } + + return this; + }, + /** * Use this method if you need to batch draw a large number of Game Objects to * this Render Texture in a single go, or on a frequent basis. @@ -61202,7 +61835,7 @@ var RenderTexture = new Class({ var util = renderer.pipelines.setUtility(); - util.blitFrame(canvasTarget, renderTarget, 1, false, false, erase); + util.blitFrame(canvasTarget, renderTarget, 1, false, false, erase, this.isSpriteTexture); renderer.resetScissor(); renderer.resetViewport(); @@ -61329,6 +61962,11 @@ var RenderTexture = new Class({ } else { + if (!this._eraseMode) + { + this.renderer.setBlendMode(gameObject.blendMode); + } + gameObject.renderWebGL(this.renderer, gameObject, this.camera); } @@ -61439,7 +62077,10 @@ var RenderTexture = new Class({ matrix.setToContext(ctx); - ctx.drawImage(source, cd.x, cd.y, cd.width, cd.height, x, y, cd.width, cd.height); + if (cd.width > 0 && cd.height > 0) + { + ctx.drawImage(source, cd.x, cd.y, cd.width, cd.height, x, y, cd.width, cd.height); + } ctx.restore(); } @@ -61592,7 +62233,7 @@ module.exports = RenderTexture; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -61627,7 +62268,7 @@ module.exports = RenderTextureCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -61680,7 +62321,7 @@ GameObjectCreator.register('renderTexture', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -61691,7 +62332,7 @@ var RenderTexture = __webpack_require__(15996); * Creates a new Render Texture Game Object and adds it to the Scene. * * Note: This method will only be available if the Render Texture Game Object has been built into Phaser. - * + * * A Render Texture is a special texture that allows any number of Game Objects to be drawn to it. You can take many complex objects and * draw them all to this one texture, which can they be used as the texture for other Game Object's. It's a way to generate dynamic * textures at run-time that are WebGL friendly and don't invoke expensive GPU uploads. @@ -61705,7 +62346,7 @@ var RenderTexture = __webpack_require__(15996); * @param {number} [height=32] - The height of the Render Texture. * @property {string} [key] - The texture key to make the RenderTexture from. * @property {string} [frame] - the frame to make the RenderTexture from. - * + * * @return {Phaser.GameObjects.RenderTexture} The Game Object that was created. */ GameObjectFactory.register('renderTexture', function (x, y, width, height, key, frame) @@ -61721,12 +62362,13 @@ GameObjectFactory.register('renderTexture', function (x, y, width, height, key, /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -61753,7 +62395,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -61826,7 +62468,7 @@ module.exports = RenderTextureWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -62952,7 +63594,7 @@ module.exports = Rope; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -62981,7 +63623,7 @@ module.exports = RopeCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -63024,11 +63666,6 @@ GameObjectCreator.register('rope', function (config, addToScene) BuildGameObject(this.scene, rope, config); - if (!config.add) - { - this.updateList.add(rope); - } - return rope; }); @@ -63042,7 +63679,7 @@ GameObjectCreator.register('rope', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -63085,12 +63722,13 @@ if (true) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -63117,7 +63755,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -63232,7 +63870,7 @@ module.exports = RopeWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -64465,7 +65103,7 @@ module.exports = Shader; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -64494,7 +65132,7 @@ module.exports = ShaderCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -64548,7 +65186,7 @@ GameObjectCreator.register('shader', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -64590,12 +65228,13 @@ if (true) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -64622,7 +65261,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -64685,7 +65324,7 @@ module.exports = ShaderWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -64748,7 +65387,7 @@ module.exports = FillPathWebGL; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -64786,7 +65425,7 @@ module.exports = FillStyleCanvas; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -64825,7 +65464,7 @@ module.exports = LineStyleCanvas; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -65249,7 +65888,7 @@ module.exports = Shape; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -65323,7 +65962,7 @@ module.exports = StrokePathWebGL; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -65341,14 +65980,14 @@ var Shape = __webpack_require__(91461); * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * When it renders it displays an arc shape. You can control the start and end angles of the arc, * as well as if the angles are winding clockwise or anti-clockwise. With the default settings * it renders as a complete circle. By changing the angles you can create other arc shapes, * such as half-circles. - * + * * Arcs also have an `iterations` property and corresponding `setIterations` method. This allows * you to control how smooth the shape renders in WebGL, by controlling the number of iterations * that take place during construction. @@ -65572,7 +66211,7 @@ var Arc = new Class({ * * @method Phaser.GameObjects.Arc#setRadius * @since 3.13.0 - * + * * @param {number} value - The value to set the radius to. * * @return {this} This Game Object instance. @@ -65592,7 +66231,7 @@ var Arc = new Class({ * * @method Phaser.GameObjects.Arc#setIterations * @since 3.13.0 - * + * * @param {number} value - The value to set the iterations to. * * @return {this} This Game Object instance. @@ -65612,7 +66251,7 @@ var Arc = new Class({ * * @method Phaser.GameObjects.Arc#setStartAngle * @since 3.13.0 - * + * * @param {number} value - The value to set the starting angle to. * * @return {this} This Game Object instance. @@ -65635,7 +66274,7 @@ var Arc = new Class({ * * @method Phaser.GameObjects.Arc#setEndAngle * @since 3.13.0 - * + * * @param {number} value - The value to set the ending angle to. * * @return {this} This Game Object instance. @@ -65733,7 +66372,7 @@ module.exports = Arc; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -65811,7 +66450,7 @@ module.exports = ArcCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -65822,14 +66461,14 @@ var GameObjectFactory = __webpack_require__(61286); * Creates a new Arc Shape Game Object and adds it to the Scene. * * Note: This method will only be available if the Arc Game Object has been built into Phaser. - * + * * The Arc Shape is a Game Object that can be added to a Scene, Group or Container. You can * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * When it renders it displays an arc shape. You can control the start and end angles of the arc, * as well as if the angles are winding clockwise or anti-clockwise. With the default settings * it renders as a complete circle. By changing the angles you can create other arc shapes, @@ -65856,7 +66495,7 @@ GameObjectFactory.register('arc', function (x, y, radius, startAngle, endAngle, /** * Creates a new Circle Shape Game Object and adds it to the Scene. - * + * * A Circle is an Arc with no defined start and end angle, making it render as a complete circle. * * Note: This method will only be available if the Arc Game Object has been built into Phaser. @@ -65885,12 +66524,13 @@ GameObjectFactory.register('circle', function (x, y, radius, fillColor, fillAlph /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -65917,7 +66557,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -65979,7 +66619,7 @@ module.exports = ArcWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -65995,12 +66635,12 @@ var Shape = __webpack_require__(91461); * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * To render a Curve Shape you must first create a `Phaser.Curves.Curve` object, then pass it to * the Curve Shape in the constructor. - * + * * The Curve shape also has a `smoothness` property and corresponding `setSmoothness` method. * This allows you to control how smooth the shape renders in WebGL, by controlling the number of iterations * that take place during construction. Increase and decrease the default value for smoother, or more @@ -66102,7 +66742,7 @@ var Curve = new Class({ * * @method Phaser.GameObjects.Curve#setSmoothness * @since 3.13.0 - * + * * @param {number} value - The value to set the smoothness to. * * @return {this} This Game Object instance. @@ -66162,7 +66802,7 @@ module.exports = Curve; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -66252,7 +66892,7 @@ module.exports = CurveCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -66263,17 +66903,17 @@ var Curve = __webpack_require__(15220); * Creates a new Curve Shape Game Object and adds it to the Scene. * * Note: This method will only be available if the Curve Game Object has been built into Phaser. - * + * * The Curve Shape is a Game Object that can be added to a Scene, Group or Container. You can * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * To render a Curve Shape you must first create a `Phaser.Curves.Curve` object, then pass it to * the Curve Shape in the constructor. - * + * * The Curve shape also has a `smoothness` property and corresponding `setSmoothness` method. * This allows you to control how smooth the shape renders in WebGL, by controlling the number of iterations * that take place during construction. Increase and decrease the default value for smoother, or more @@ -66303,12 +66943,13 @@ GameObjectFactory.register('curve', function (x, y, curve, fillColor, fillAlpha) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -66335,7 +66976,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -66397,7 +67038,7 @@ module.exports = CurveWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -66413,13 +67054,13 @@ var Shape = __webpack_require__(91461); * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * When it renders it displays an ellipse shape. You can control the width and height of the ellipse. * If the width and height match it will render as a circle. If the width is less than the height, * it will look more like an egg shape. - * + * * The Ellipse shape also has a `smoothness` property and corresponding `setSmoothness` method. * This allows you to control how smooth the shape renders in WebGL, by controlling the number of iterations * that take place during construction. Increase and decrease the default value for smoother, or more @@ -66514,7 +67155,7 @@ var Ellipse = new Class({ * * @method Phaser.GameObjects.Ellipse#setSize * @since 3.13.0 - * + * * @param {number} width - The width of the ellipse. * @param {number} height - The height of the ellipse. * @@ -66537,7 +67178,7 @@ var Ellipse = new Class({ * * @method Phaser.GameObjects.Ellipse#setSmoothness * @since 3.13.0 - * + * * @param {number} value - The value to set the smoothness to. * * @return {this} This Game Object instance. @@ -66588,7 +67229,7 @@ module.exports = Ellipse; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -66675,7 +67316,7 @@ module.exports = EllipseCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -66686,18 +67327,18 @@ var GameObjectFactory = __webpack_require__(61286); * Creates a new Ellipse Shape Game Object and adds it to the Scene. * * Note: This method will only be available if the Ellipse Game Object has been built into Phaser. - * + * * The Ellipse Shape is a Game Object that can be added to a Scene, Group or Container. You can * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * When it renders it displays an ellipse shape. You can control the width and height of the ellipse. * If the width and height match it will render as a circle. If the width is less than the height, * it will look more like an egg shape. - * + * * The Ellipse shape also has a `smoothness` property and corresponding `setSmoothness` method. * This allows you to control how smooth the shape renders in WebGL, by controlling the number of iterations * that take place during construction. Increase and decrease the default value for smoother, or more @@ -66728,12 +67369,13 @@ GameObjectFactory.register('ellipse', function (x, y, width, height, fillColor, /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -66760,7 +67402,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -66822,7 +67464,7 @@ module.exports = EllipseWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -67102,7 +67744,7 @@ module.exports = Grid; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -67293,7 +67935,7 @@ module.exports = GridCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -67304,14 +67946,14 @@ var Grid = __webpack_require__(39169); * Creates a new Grid Shape Game Object and adds it to the Scene. * * Note: This method will only be available if the Grid Game Object has been built into Phaser. - * + * * The Grid Shape is a Game Object that can be added to a Scene, Group or Container. You can * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports only fill colors and cannot be stroked. - * + * * A Grid Shape allows you to display a grid in your game, where you can control the size of the * grid as well as the width and height of the grid cells. You can set a fill color for each grid * cell as well as an alternate fill color. When the alternate fill color is set then the grid @@ -67349,12 +67991,13 @@ GameObjectFactory.register('grid', function (x, y, width, height, cellWidth, cel /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -67381,7 +68024,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -67583,7 +68226,7 @@ module.exports = GridWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -67597,13 +68240,13 @@ var Shape = __webpack_require__(91461); * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports only fill colors and cannot be stroked. - * + * * An IsoBox is an 'isometric' rectangle. Each face of it has a different fill color. You can set * the color of the top, left and right faces of the rectangle respectively. You can also choose * which of the faces are rendered via the `showTop`, `showLeft` and `showRight` properties. - * + * * You cannot view an IsoBox from under-neath, however you can change the 'angle' by setting * the `projection` property. * @@ -67725,7 +68368,7 @@ var IsoBox = new Class({ * * @method Phaser.GameObjects.IsoBox#setProjection * @since 3.13.0 - * + * * @param {number} value - The value to set the projection to. * * @return {this} This Game Object instance. @@ -67743,7 +68386,7 @@ var IsoBox = new Class({ * * @method Phaser.GameObjects.IsoBox#setFaces * @since 3.13.0 - * + * * @param {boolean} [showTop=true] - Show the top-face of the iso box. * @param {boolean} [showLeft=true] - Show the left-face of the iso box. * @param {boolean} [showRight=true] - Show the right-face of the iso box. @@ -67769,7 +68412,7 @@ var IsoBox = new Class({ * * @method Phaser.GameObjects.IsoBox#setFillStyle * @since 3.13.0 - * + * * @param {number} [fillTop] - The color used to fill the top of the iso box. * @param {number} [fillLeft] - The color used to fill in the left-facing side of the iso box. * @param {number} [fillRight] - The color used to fill in the right-facing side of the iso box. @@ -67799,7 +68442,7 @@ module.exports = IsoBox; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -67902,7 +68545,7 @@ module.exports = IsoBoxCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -67913,18 +68556,18 @@ var IsoBox = __webpack_require__(4415); * Creates a new IsoBox Shape Game Object and adds it to the Scene. * * Note: This method will only be available if the IsoBox Game Object has been built into Phaser. - * + * * The IsoBox Shape is a Game Object that can be added to a Scene, Group or Container. You can * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports only fill colors and cannot be stroked. - * + * * An IsoBox is an 'isometric' rectangle. Each face of it has a different fill color. You can set * the color of the top, left and right faces of the rectangle respectively. You can also choose * which of the faces are rendered via the `showTop`, `showLeft` and `showRight` properties. - * + * * You cannot view an IsoBox from under-neath, however you can change the 'angle' by setting * the `projection` property. * @@ -67954,12 +68597,13 @@ GameObjectFactory.register('isobox', function (x, y, size, height, fillTop, fill /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -67986,7 +68630,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -68123,7 +68767,7 @@ module.exports = IsoBoxWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -68137,13 +68781,13 @@ var Shape = __webpack_require__(91461); * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports only fill colors and cannot be stroked. - * + * * An IsoTriangle is an 'isometric' triangle. Think of it like a pyramid. Each face has a different * fill color. You can set the color of the top, left and right faces of the triangle respectively * You can also choose which of the faces are rendered via the `showTop`, `showLeft` and `showRight` properties. - * + * * You cannot view an IsoTriangle from under-neath, however you can change the 'angle' by setting * the `projection` property. The `reversed` property controls if the IsoTriangle is rendered upside * down or not. @@ -68278,7 +68922,7 @@ var IsoTriangle = new Class({ * * @method Phaser.GameObjects.IsoTriangle#setProjection * @since 3.13.0 - * + * * @param {number} value - The value to set the projection to. * * @return {this} This Game Object instance. @@ -68296,7 +68940,7 @@ var IsoTriangle = new Class({ * * @method Phaser.GameObjects.IsoTriangle#setReversed * @since 3.13.0 - * + * * @param {boolean} reversed - Sets if the iso triangle will be rendered upside down or not. * * @return {this} This Game Object instance. @@ -68314,7 +68958,7 @@ var IsoTriangle = new Class({ * * @method Phaser.GameObjects.IsoTriangle#setFaces * @since 3.13.0 - * + * * @param {boolean} [showTop=true] - Show the top-face of the iso triangle (only if `reversed` is true) * @param {boolean} [showLeft=true] - Show the left-face of the iso triangle. * @param {boolean} [showRight=true] - Show the right-face of the iso triangle. @@ -68340,7 +68984,7 @@ var IsoTriangle = new Class({ * * @method Phaser.GameObjects.IsoTriangle#setFillStyle * @since 3.13.0 - * + * * @param {number} [fillTop] - The color used to fill the top of the iso triangle. * @param {number} [fillLeft] - The color used to fill in the left-facing side of the iso triangle. * @param {number} [fillRight] - The color used to fill in the right-facing side of the iso triangle. @@ -68370,7 +69014,7 @@ module.exports = IsoTriangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -68486,7 +69130,7 @@ module.exports = IsoTriangleCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -68497,18 +69141,18 @@ var IsoTriangle = __webpack_require__(65159); * Creates a new IsoTriangle Shape Game Object and adds it to the Scene. * * Note: This method will only be available if the IsoTriangle Game Object has been built into Phaser. - * + * * The IsoTriangle Shape is a Game Object that can be added to a Scene, Group or Container. You can * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports only fill colors and cannot be stroked. - * + * * An IsoTriangle is an 'isometric' triangle. Think of it like a pyramid. Each face has a different * fill color. You can set the color of the top, left and right faces of the triangle respectively * You can also choose which of the faces are rendered via the `showTop`, `showLeft` and `showRight` properties. - * + * * You cannot view an IsoTriangle from under-neath, however you can change the 'angle' by setting * the `projection` property. The `reversed` property controls if the IsoTriangle is rendered upside * down or not. @@ -68540,12 +69184,13 @@ GameObjectFactory.register('isotriangle', function (x, y, size, height, reversed /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -68572,7 +69217,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -68729,7 +69374,7 @@ module.exports = IsoTriangleWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -68897,7 +69542,7 @@ module.exports = Line; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -68956,7 +69601,7 @@ module.exports = LineCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -68967,18 +69612,18 @@ var Line = __webpack_require__(579); * Creates a new Line Shape Game Object and adds it to the Scene. * * Note: This method will only be available if the Line Game Object has been built into Phaser. - * + * * The Line Shape is a Game Object that can be added to a Scene, Group or Container. You can * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports only stroke colors and cannot be filled. - * + * * A Line Shape allows you to draw a line between two points in your game. You can control the * stroke color and thickness of the line. In WebGL only you can also specify a different * thickness for the start and end of the line, allowing you to render lines that taper-off. - * + * * If you need to draw multiple lines in a sequence you may wish to use the Polygon Shape instead. * * @method Phaser.GameObjects.GameObjectFactory#line @@ -69008,12 +69653,13 @@ GameObjectFactory.register('line', function (x, y, x1, y1, x2, y2, strokeColor, /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -69040,7 +69686,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -69118,7 +69764,7 @@ module.exports = LineWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -69136,9 +69782,9 @@ var Smooth = __webpack_require__(18974); * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * The Polygon Shape is created by providing a list of points, which are then used to create an * internal Polygon geometry object. The points can be set from a variety of formats: * @@ -69147,7 +69793,7 @@ var Smooth = __webpack_require__(18974); * - An array of objects with public x/y properties: `[obj1, obj2, ...]` * - An array of paired numbers that represent point coordinates: `[x1,y1, x2,y2, ...]` * - An array of arrays with two elements representing x/y coordinates: `[[x1, y1], [x2, y2], ...]` - * + * * By default the `x` and `y` coordinates of this Shape refer to the center of it. However, depending * on the coordinates of the points provided, the final shape may be rendered offset from its origin. * @@ -69202,7 +69848,7 @@ var Polygon = new Class({ * * @method Phaser.GameObjects.Polygon#smooth * @since 3.13.0 - * + * * @param {number} [iterations=1] - The number of times to apply the polygon smoothing. * * @return {this} This Game Object instance. @@ -69219,6 +69865,42 @@ var Polygon = new Class({ return this.updateData(); }, + /** + * Sets this Polygon to the given points. + * + * The points can be set from a variety of formats: + * + * - A string containing paired values separated by a single space: `'40 0 40 20 100 20 100 80 40 80 40 100 0 50'` + * - An array of Point objects: `[new Phaser.Point(x1, y1), ...]` + * - An array of objects with public x/y properties: `[obj1, obj2, ...]` + * - An array of paired numbers that represent point coordinates: `[x1,y1, x2,y2, ...]` + * - An array of arrays with two elements representing x/y coordinates: `[[x1, y1], [x2, y2], ...]` + * + * Calling this method will reset the size (width, height) and display origin of this Shape. + * + * It also runs both GetAABB and EarCut on the given points, so please be careful not to do this + * at a high frequency, or with too many points. + * + * @method Phaser.GameObjects.Polygon#setTo + * @since 3.60.0 + * + * @param {(string|number[]|Phaser.Types.Math.Vector2Like[])} [points] - Points defining the perimeter of this polygon. Please check function description above for the different supported formats. + * + * @return {this} This Game Object instance. + */ + setTo: function (points) + { + this.geom.setTo(points); + + var bounds = GetAABB(this.geom); + + this.setSize(bounds.width, bounds.height); + + this.updateDisplayOrigin(); + + return this.updateData(); + }, + /** * Internal method that updates the data and path values. * @@ -69258,7 +69940,7 @@ module.exports = Polygon; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -69314,7 +69996,10 @@ var PolygonCanvasRenderer = function (renderer, src, camera, parentMatrix) ctx.lineTo(px2, py2); } - ctx.closePath(); + if (src.closePath) + { + ctx.closePath(); + } if (src.isFilled) { @@ -69345,7 +70030,7 @@ module.exports = PolygonCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -69354,16 +70039,16 @@ var Polygon = __webpack_require__(91249); /** * Creates a new Polygon Shape Game Object and adds it to the Scene. - * + * * Note: This method will only be available if the Polygon Game Object has been built into Phaser. - * + * * The Polygon Shape is a Game Object that can be added to a Scene, Group or Container. You can * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * The Polygon Shape is created by providing a list of points, which are then used to create an * internal Polygon geometry object. The points can be set from a variety of formats: * @@ -69371,7 +70056,7 @@ var Polygon = __webpack_require__(91249); * - An array of objects with public x/y properties: `[obj1, obj2, ...]` * - An array of paired numbers that represent point coordinates: `[x1,y1, x2,y2, ...]` * - An array of arrays with two elements representing x/y coordinates: `[[x1, y1], [x2, y2], ...]` - * + * * By default the `x` and `y` coordinates of this Shape refer to the center of it. However, depending * on the coordinates of the points provided, the final shape may be rendered offset from its origin. * @@ -69399,12 +70084,13 @@ GameObjectFactory.register('polygon', function (x, y, points, fillColor, fillAlp /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -69431,7 +70117,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -69493,7 +70179,7 @@ module.exports = PolygonWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -69559,14 +70245,9 @@ var Rectangle = new Class({ }, /** - * Sets the internal size of this Game Object, as used for frame or physics body creation. + * Sets the internal size of this Rectangle, as used for frame or physics body creation. * - * This will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or call the - * `setDisplaySize` method, which is the same thing as changing the scale but allows you - * to do so by giving pixel values. - * - * If you have enabled this Game Object for input, changing the size will _not_ change the + * If you have assigned a custom input hit area for this Rectangle, changing the Rectangle size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * * @method Phaser.GameObjects.Rectangle#setSize @@ -69647,7 +70328,7 @@ module.exports = Rectangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -69723,7 +70404,7 @@ module.exports = RectangleCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -69734,14 +70415,14 @@ var Rectangle = __webpack_require__(517); * Creates a new Rectangle Shape Game Object and adds it to the Scene. * * Note: This method will only be available if the Rectangle Game Object has been built into Phaser. - * + * * The Rectangle Shape is a Game Object that can be added to a Scene, Group or Container. You can * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * You can change the size of the rectangle by changing the `width` and `height` properties. * * @method Phaser.GameObjects.GameObjectFactory#rectangle @@ -69769,12 +70450,13 @@ GameObjectFactory.register('rectangle', function (x, y, width, height, fillColor /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -69801,7 +70483,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -69875,7 +70557,7 @@ module.exports = RectangleWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -69890,14 +70572,14 @@ var Shape = __webpack_require__(91461); * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * As the name implies, the Star shape will display a star in your game. You can control several * aspects of it including the number of points that constitute the star. The default is 5. If * you change it to 4 it will render as a diamond. If you increase them, you'll get a more spiky * star shape. - * + * * You can also control the inner and outer radius, which is how 'long' each point of the star is. * Modify these values to create more interesting shapes. * @@ -69987,7 +70669,7 @@ var Star = new Class({ * * @method Phaser.GameObjects.Star#setPoints * @since 3.13.0 - * + * * @param {number} value - The amount of points the Star will have. * * @return {this} This Game Object instance. @@ -70005,7 +70687,7 @@ var Star = new Class({ * * @method Phaser.GameObjects.Star#setInnerRadius * @since 3.13.0 - * + * * @param {number} value - The amount to set the inner radius to. * * @return {this} This Game Object instance. @@ -70023,7 +70705,7 @@ var Star = new Class({ * * @method Phaser.GameObjects.Star#setOuterRadius * @since 3.13.0 - * + * * @param {number} value - The amount to set the outer radius to. * * @return {this} This Game Object instance. @@ -70130,7 +70812,7 @@ var Star = new Class({ // So origin 0.5 = the center of the star var x = outerRadius; var y = outerRadius; - + path.push(x, y + -outerRadius); for (var i = 0; i < points; i++) @@ -70140,7 +70822,7 @@ var Star = new Class({ rot += step; path.push(x + Math.cos(rot) * innerRadius, y + Math.sin(rot) * innerRadius); - + rot += step; } @@ -70164,7 +70846,7 @@ module.exports = Star; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -70251,7 +70933,7 @@ module.exports = StarCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -70262,19 +70944,19 @@ var GameObjectFactory = __webpack_require__(61286); * Creates a new Star Shape Game Object and adds it to the Scene. * * Note: This method will only be available if the Star Game Object has been built into Phaser. - * + * * The Star Shape is a Game Object that can be added to a Scene, Group or Container. You can * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * As the name implies, the Star shape will display a star in your game. You can control several * aspects of it including the number of points that constitute the star. The default is 5. If * you change it to 4 it will render as a diamond. If you increase them, you'll get a more spiky * star shape. - * + * * You can also control the inner and outer radius, which is how 'long' each point of the star is. * Modify these values to create more interesting shapes. * @@ -70304,12 +70986,13 @@ GameObjectFactory.register('star', function (x, y, points, innerRadius, outerRad /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -70336,7 +71019,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -70398,7 +71081,7 @@ module.exports = StarWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -70413,9 +71096,9 @@ var TriangleRender = __webpack_require__(70498); * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * The Triangle consists of 3 lines, joining up to form a triangular shape. You can control the * position of each point of these lines. The triangle is always closed and cannot have an open * face. If you require that, consider using a Polygon instead. @@ -70542,7 +71225,7 @@ module.exports = Triangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -70619,7 +71302,7 @@ module.exports = TriangleCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -70630,14 +71313,14 @@ var Triangle = __webpack_require__(21873); * Creates a new Triangle Shape Game Object and adds it to the Scene. * * Note: This method will only be available if the Triangle Game Object has been built into Phaser. - * + * * The Triangle Shape is a Game Object that can be added to a Scene, Group or Container. You can * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * The Triangle consists of 3 lines, joining up to form a triangular shape. You can control the * position of each point of these lines. The triangle is always closed and cannot have an open * face. If you require that, consider using a Polygon instead. @@ -70671,12 +71354,13 @@ GameObjectFactory.register('triangle', function (x, y, x1, y1, x2, y2, x3, y3, f /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -70703,7 +71387,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -70788,7 +71472,7 @@ module.exports = TriangleWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -71134,7 +71818,7 @@ var Sprite = new Class({ * @method Phaser.GameObjects.Sprite#chain * @since 3.50.0 * - * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig|string[]|Phaser.Animations.Animation[]|Phaser.Types.Animations.PlayAnimationConfig[])} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object, or an array of them. + * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig|string[]|Phaser.Animations.Animation[]|Phaser.Types.Animations.PlayAnimationConfig[])} [key] - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object, or an array of them. * * @return {this} This Game Object. */ @@ -71270,7 +71954,7 @@ module.exports = Sprite; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -71305,7 +71989,7 @@ module.exports = SpriteCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -71359,7 +72043,7 @@ GameObjectCreator.register('sprite', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -71406,12 +72090,13 @@ GameObjectFactory.register('sprite', function (x, y, key, frame) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -71438,7 +72123,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -71473,7 +72158,7 @@ module.exports = SpriteWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -71556,7 +72241,7 @@ module.exports = GetTextSize; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -71706,7 +72391,7 @@ module.exports = MeasureText; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -72321,6 +73006,47 @@ var Text = new Class({ return this; }, + /** + * Appends the given text to the content already being displayed by this Text object. + * + * An array of strings will be joined with `\n` line breaks. + * + * @method Phaser.GameObjects.Text#appendText + * @since 3.60.0 + * + * @param {(string|string[])} value - The string, or array of strings, to be appended to the existing content of this Text object. + * @param {boolean} [addCR=true] - Insert a carriage-return before the string value. + * + * @return {this} This Text object. + */ + appendText: function (value, addCR) + { + if (addCR === undefined) { addCR = true; } + + if (!value && value !== 0) + { + value = ''; + } + + if (Array.isArray(value)) + { + value = value.join('\n'); + } + + value = value.toString(); + + var newText = this._text.concat((addCR) ? '\n' + value : value); + + if (newText !== this._text) + { + this._text = newText; + + this.updateText(); + } + + return this; + }, + /** * Set the text style. * @@ -72922,7 +73648,7 @@ var Text = new Class({ if (style.rtl) { - linePositionX = w - linePositionX; + linePositionX = w - linePositionX - padding.left - padding.right; } else if (style.align === 'right') { @@ -73137,7 +73863,7 @@ module.exports = Text; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -73177,7 +73903,7 @@ module.exports = TextCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -73265,7 +73991,7 @@ GameObjectCreator.register('text', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -73331,12 +74057,13 @@ GameObjectFactory.register('text', function (x, y, text, style) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -73363,7 +74090,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -73721,23 +74448,6 @@ var TextStyle = new Class({ // Set to defaults + user style this.setStyle(style, false, true); - - var metrics = GetValue(style, 'metrics', false); - - // Provide optional TextMetrics in the style object to avoid the canvas look-up / scanning - // Doing this is reset if you then change the font of this TextStyle after creation - if (metrics) - { - this.metrics = { - ascent: GetValue(metrics, 'ascent', 0), - descent: GetValue(metrics, 'descent', 0), - fontSize: GetValue(metrics, 'fontSize', 0) - }; - } - else - { - this.metrics = MeasureText(this); - } }, /** @@ -73806,9 +74516,26 @@ var TextStyle = new Class({ this.color = fill; } + var metrics = GetValue(style, 'metrics', false); + + // Provide optional TextMetrics in the style object to avoid the canvas look-up / scanning + // Doing this is reset if you then change the font of this TextStyle after creation + if (metrics) + { + this.metrics = { + ascent: GetValue(metrics, 'ascent', 0), + descent: GetValue(metrics, 'descent', 0), + fontSize: GetValue(metrics, 'fontSize', 0) + }; + } + else if (updateText || !this.metrics) + { + this.metrics = MeasureText(this); + } + if (updateText) { - return this.update(true); + return this.parent.updateText(); } else { @@ -74470,7 +75197,7 @@ module.exports = TextStyle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -74542,7 +75269,7 @@ module.exports = TextWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -74646,6 +75373,13 @@ var TileSprite = new Class({ var displayTexture = scene.sys.textures.get(textureKey); var displayFrame = displayTexture.get(frameKey); + if (displayFrame.source.compressionAlgorithm) + { + console.warn('TileSprite cannot use compressed textures'); + displayTexture = scene.sys.textures.get('__MISSING'); + displayFrame = displayTexture.get(); + } + if (!width || !height) { width = displayFrame.width; @@ -75075,7 +75809,6 @@ var TileSprite = new Class({ this.dirty = true; this.fillPattern = null; this.fillPattern = renderer.createTexture2D(0, gl.LINEAR, gl.LINEAR, gl.REPEAT, gl.REPEAT, gl.RGBA, this.fillCanvas, this.potWidth, this.potHeight); - }, /** @@ -75213,7 +75946,7 @@ module.exports = TileSprite; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -75250,7 +75983,7 @@ module.exports = TileSpriteCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -75303,7 +76036,7 @@ GameObjectCreator.register('tileSprite', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -75348,12 +76081,13 @@ GameObjectFactory.register('tileSprite', function (x, y, width, height, key, fra /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -75380,7 +76114,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -75456,7 +76190,7 @@ module.exports = TileSpriteWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -75533,6 +76267,7 @@ var MATH_CONST = __webpack_require__(83392); * @extends Phaser.GameObjects.Components.BlendMode * @extends Phaser.GameObjects.Components.Depth * @extends Phaser.GameObjects.Components.Flip + * @extends Phaser.GameObjects.Components.FX * @extends Phaser.GameObjects.Components.GetBounds * @extends Phaser.GameObjects.Components.Mask * @extends Phaser.GameObjects.Components.Origin @@ -75558,6 +76293,7 @@ var Video = new Class({ Components.BlendMode, Components.Depth, Components.Flip, + Components.FX, Components.GetBounds, Components.Mask, Components.Origin, @@ -77311,7 +78047,7 @@ module.exports = Video; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -77349,7 +78085,7 @@ module.exports = VideoCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -77386,11 +78122,6 @@ GameObjectCreator.register('video', function (config, addToScene) BuildGameObject(this.scene, video, config); - if (!config.add) - { - this.updateList.add(video); - } - return video; }); @@ -77404,7 +78135,7 @@ GameObjectCreator.register('video', function (config, addToScene) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -77438,12 +78169,13 @@ GameObjectFactory.register('video', function (x, y, key) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -77470,7 +78202,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -77508,7 +78240,7 @@ module.exports = VideoWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -77830,7 +78562,7 @@ module.exports = Zone; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -77870,7 +78602,7 @@ GameObjectCreator.register('zone', function (config) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -77889,7 +78621,7 @@ var GameObjectFactory = __webpack_require__(61286); * @param {number} y - The vertical position of this Game Object in the world. * @param {number} width - The width of the Game Object. * @param {number} height - The height of the Game Object. - * + * * @return {Phaser.GameObjects.Zone} The Game Object that was created. */ GameObjectFactory.register('zone', function (x, y, width, height) @@ -77898,9 +78630,9 @@ GameObjectFactory.register('zone', function (x, y, width, height) }); // When registering a factory function 'this' refers to the GameObjectFactory context. -// +// // There are several properties available to use: -// +// // this.scene - a reference to the Scene that owns the GameObjectFactory // this.displayList - a reference to the Display List the Scene owns // this.updateList - a reference to the Update List the Scene owns @@ -77913,7 +78645,7 @@ GameObjectFactory.register('zone', function (x, y, width, height) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -77942,7 +78674,7 @@ module.exports = Area; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78318,7 +79050,7 @@ module.exports = Circle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78347,7 +79079,7 @@ module.exports = Circumference; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78387,7 +79119,7 @@ module.exports = CircumferencePoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78418,7 +79150,7 @@ module.exports = Clone; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78460,7 +79192,7 @@ module.exports = Contains; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78492,7 +79224,7 @@ module.exports = ContainsPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78529,7 +79261,7 @@ module.exports = ContainsRect; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78562,7 +79294,7 @@ module.exports = CopyFrom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78597,7 +79329,7 @@ module.exports = Equals; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78638,7 +79370,7 @@ module.exports = GetBounds; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78682,7 +79414,7 @@ module.exports = GetPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78735,7 +79467,7 @@ module.exports = GetPoints; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78771,7 +79503,7 @@ module.exports = Offset; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78806,7 +79538,7 @@ module.exports = OffsetPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78851,7 +79583,7 @@ module.exports = Random; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78883,7 +79615,7 @@ module.exports = Circle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78891,7 +79623,7 @@ var GEOM_CONST = { /** * A Circle Geometry object type. - * + * * @name Phaser.Geom.CIRCLE * @type {number} * @since 3.19.0 @@ -78900,7 +79632,7 @@ var GEOM_CONST = { /** * An Ellipse Geometry object type. - * + * * @name Phaser.Geom.ELLIPSE * @type {number} * @since 3.19.0 @@ -78909,7 +79641,7 @@ var GEOM_CONST = { /** * A Line Geometry object type. - * + * * @name Phaser.Geom.LINE * @type {number} * @since 3.19.0 @@ -78918,7 +79650,7 @@ var GEOM_CONST = { /** * A Point Geometry object type. - * + * * @name Phaser.Geom.POINT * @type {number} * @since 3.19.0 @@ -78927,7 +79659,7 @@ var GEOM_CONST = { /** * A Polygon Geometry object type. - * + * * @name Phaser.Geom.POLYGON * @type {number} * @since 3.19.0 @@ -78936,7 +79668,7 @@ var GEOM_CONST = { /** * A Rectangle Geometry object type. - * + * * @name Phaser.Geom.RECTANGLE * @type {number} * @since 3.19.0 @@ -78945,7 +79677,7 @@ var GEOM_CONST = { /** * A Triangle Geometry object type. - * + * * @name Phaser.Geom.TRIANGLE * @type {number} * @since 3.19.0 @@ -78964,7 +79696,7 @@ module.exports = GEOM_CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -78999,7 +79731,7 @@ module.exports = Area; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79032,7 +79764,7 @@ module.exports = Circumference; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79075,7 +79807,7 @@ module.exports = CircumferencePoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79106,7 +79838,7 @@ module.exports = Clone; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79149,7 +79881,7 @@ module.exports = Contains; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79181,7 +79913,7 @@ module.exports = ContainsPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79218,7 +79950,7 @@ module.exports = ContainsRect; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79251,7 +79983,7 @@ module.exports = CopyFrom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79634,7 +80366,7 @@ module.exports = Ellipse; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79670,7 +80402,7 @@ module.exports = Equals; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79711,7 +80443,7 @@ module.exports = GetBounds; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79755,7 +80487,7 @@ module.exports = GetPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79810,7 +80542,7 @@ module.exports = GetPoints; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79846,7 +80578,7 @@ module.exports = Offset; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79881,7 +80613,7 @@ module.exports = OffsetPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79923,7 +80655,7 @@ module.exports = Random; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79955,7 +80687,7 @@ module.exports = Ellipse; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -79993,7 +80725,7 @@ module.exports = Geom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80025,7 +80757,7 @@ module.exports = CircleToCircle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80081,7 +80813,7 @@ module.exports = CircleToRectangle; /** * @author Florian Vazelle * @author Geoffrey Glaive - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80176,7 +80908,7 @@ module.exports = GetCircleToCircle; /** * @author Florian Vazelle * @author Geoffrey Glaive - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80227,7 +80959,7 @@ module.exports = GetCircleToRectangle; /** * @author Florian Vazelle * @author Geoffrey Glaive - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80319,15 +81051,15 @@ module.exports = GetLineToCircle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var Vector3 = __webpack_require__(70015); /** - * Checks for intersection between the two line segments and returns the intersection point as a Vector3, - * or `null` if the lines are parallel, or do not intersect. + * Checks for intersection between the two line segments, or a ray and a line segment, + * and returns the intersection point as a Vector3, or `null` if the lines are parallel, or do not intersect. * * The `z` property of the Vector3 contains the intersection distance, which can be used to find * the closest intersecting point from a group of line segments. @@ -80335,14 +81067,17 @@ var Vector3 = __webpack_require__(70015); * @function Phaser.Geom.Intersects.GetLineToLine * @since 3.50.0 * - * @param {Phaser.Geom.Line} line1 - The first line segment to check. + * @param {Phaser.Geom.Line} line1 - The first line segment, or a ray, to check. * @param {Phaser.Geom.Line} line2 - The second line segment to check. + * @param {boolean} [isRay=false] - Is `line1` a ray or a line segment? * @param {Phaser.Math.Vector3} [out] - A Vector3 to store the intersection results in. * * @return {Phaser.Math.Vector3} A Vector3 containing the intersection results, or `null`. */ -var GetLineToLine = function (line1, line2, out) +var GetLineToLine = function (line1, line2, isRay, out) { + if (isRay === undefined) { isRay = false; } + var x1 = line1.x1; var y1 = line1.y1; var x2 = line1.x2; @@ -80370,13 +81105,35 @@ var GetLineToLine = function (line1, line2, out) return false; } - var t = ((x3 - x1) * dy2 - (y3 - y1) * dx2) / denom; - var u = ((y1 - y3) * dx1 - (x1 - x3) * dy1) / denom; + var t; + var u; + var s; - // Intersects? - if (t < 0 || t > 1 || u < 0 || u > 1) + if (isRay) { - return null; + t = (dx1 * (y3 - y1) + dy1 * (x1 - x3)) / (dx2 * dy1 - dy2 * dx1); + u = (x3 + dx2 * t - x1) / dx1; + + // Intersects? + if (u < 0 || t < 0 || t > 1) + { + return null; + } + + s = u; + } + else + { + t = ((x3 - x1) * dy2 - (y3 - y1) * dx2) / denom; + u = ((y1 - y3) * dx1 - (x1 - x3) * dy1) / denom; + + // Intersects? + if (t < 0 || t > 1 || u < 0 || u > 1) + { + return null; + } + + s = t; } if (out === undefined) @@ -80385,9 +81142,9 @@ var GetLineToLine = function (line1, line2, out) } return out.set( - x1 + dx1 * t, - y1 + dy1 * t, - t + x1 + dx1 * s, + y1 + dy1 * s, + s ); }; @@ -80401,13 +81158,13 @@ module.exports = GetLineToLine; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Vector3 = __webpack_require__(70015); var GetLineToLine = __webpack_require__(96537); var Line = __webpack_require__(88829); +var Vector3 = __webpack_require__(70015); // Temp calculation segment var segment = new Line(); @@ -80429,14 +81186,16 @@ var tempIntersect = new Vector3(); * @function Phaser.Geom.Intersects.GetLineToPoints * @since 3.50.0 * - * @param {Phaser.Geom.Line} line - The line segment to check. + * @param {Phaser.Geom.Line} line - The line segment, or ray, to check. If a ray, set the `isRay` parameter to `true`. * @param {Phaser.Math.Vector2[] | Phaser.Geom.Point[]} points - An array of points to check. + * @param {boolean} [isRay=false] - Is `line` a ray or a line segment? * @param {Phaser.Math.Vector3} [out] - A Vector3 to store the intersection results in. * * @return {Phaser.Math.Vector3} A Vector3 containing the intersection results, or `null`. */ -var GetLineToPoints = function (line, points, out) +var GetLineToPoints = function (line, points, isRay, out) { + if (isRay === undefined) { isRay = false; } if (out === undefined) { out = new Vector3(); } var closestIntersect = false; @@ -80455,7 +81214,7 @@ var GetLineToPoints = function (line, points, out) prev = current; - if (GetLineToLine(line, segment, tempIntersect)) + if (GetLineToLine(line, segment, isRay, tempIntersect)) { if (!closestIntersect || tempIntersect.z < out.z) { @@ -80479,7 +81238,7 @@ module.exports = GetLineToPoints; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80504,13 +81263,14 @@ var tempIntersect = new Vector3(); * @function Phaser.Geom.Intersects.GetLineToPolygon * @since 3.50.0 * - * @param {Phaser.Geom.Line} line - The line segment to check. + * @param {Phaser.Geom.Line} line - The line segment, or ray, to check. If a ray, set the `isRay` parameter to `true`. * @param {Phaser.Geom.Polygon | Phaser.Geom.Polygon[]} polygons - A single polygon, or array of polygons, to check. + * @param {boolean} [isRay=false] - Is `line` a ray or a line segment? * @param {Phaser.Math.Vector4} [out] - A Vector4 to store the intersection results in. * * @return {Phaser.Math.Vector4} A Vector4 containing the intersection results, or `null`. */ -var GetLineToPolygon = function (line, polygons, out) +var GetLineToPolygon = function (line, polygons, isRay, out) { if (out === undefined) { out = new Vector4(); } @@ -80527,7 +81287,7 @@ var GetLineToPolygon = function (line, polygons, out) for (var i = 0; i < polygons.length; i++) { - if (GetLineToPoints(line, polygons[i].points, tempIntersect)) + if (GetLineToPoints(line, polygons[i].points, isRay, tempIntersect)) { if (!closestIntersect || tempIntersect.z < out.z) { @@ -80552,7 +81312,7 @@ module.exports = GetLineToPolygon; /** * @author Florian Vazelle * @author Geoffrey Glaive - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80612,7 +81372,7 @@ module.exports = GetLineToRectangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80633,7 +81393,7 @@ function CheckIntersects (angle, x, y, polygons, intersects) segment.setTo(x, y, x + dx, y + dy); - var closestIntersect = GetLineToPolygon(segment, polygons); + var closestIntersect = GetLineToPolygon(segment, polygons, true); if (closestIntersect) { @@ -80715,7 +81475,7 @@ module.exports = GetRaysFromPointToPolygon; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80724,9 +81484,9 @@ var RectangleToRectangle = __webpack_require__(90205); /** * Checks if two Rectangle shapes intersect and returns the area of this intersection as Rectangle object. - * + * * If optional `output` parameter is omitted, new Rectangle object is created and returned. If there is intersection, it will contain intersection area. If there is no intersection, it wil be empty Rectangle (all values set to zero). - * + * * If Rectangle object is passed as `output` and there is intersection, then intersection area data will be loaded into it and it will be returned. If there is no intersection, it will be returned without any change. * * @function Phaser.Geom.Intersects.GetRectangleIntersection @@ -80766,7 +81526,7 @@ module.exports = GetRectangleIntersection; /** * @author Florian Vazelle * @author Geoffrey Glaive - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80818,7 +81578,7 @@ module.exports = GetRectangleToRectangle; /** * @author Florian Vazelle * @author Geoffrey Glaive - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80867,7 +81627,7 @@ module.exports = GetRectangleToTriangle; /** * @author Florian Vazelle * @author Geoffrey Glaive - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80917,7 +81677,7 @@ module.exports = GetTriangleToCircle; /** * @author Florian Vazelle * @author Geoffrey Glaive - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -80977,7 +81737,7 @@ module.exports = GetTriangleToLine; /** * @author Florian Vazelle * @author Geoffrey Glaive - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81026,7 +81786,7 @@ module.exports = GetTriangleToTriangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81090,10 +81850,10 @@ var LineToCircle = function (line, circle, nearest) nearest.x = line.x1 + px; nearest.y = line.y1 + py; - + // len2 of p var pLen2 = (px * px) + (py * py); - + return ( pLen2 <= dLen2 && ((px * dx) + (py * dy)) >= 0 && @@ -81111,7 +81871,7 @@ module.exports = LineToCircle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81188,7 +81948,7 @@ module.exports = LineToLine; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81291,13 +82051,13 @@ module.exports = LineToRectangle; /** * @author Richard Davey * @author Florian Mertens - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Checks if the a Point falls between the two end-points of a Line, based on the given line thickness. - * + * * Assumes that the line end points are circular, not square. * * @function Phaser.Geom.Intersects.PointToLine @@ -81361,7 +82121,7 @@ module.exports = PointToLine; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81403,7 +82163,7 @@ module.exports = PointToLineSegment; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81442,7 +82202,7 @@ module.exports = RectangleToRectangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81536,7 +82296,7 @@ module.exports = RectangleToTriangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81577,7 +82337,7 @@ module.exports = RectangleToValues; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81643,7 +82403,7 @@ module.exports = TriangleToCircle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81699,7 +82459,7 @@ module.exports = TriangleToLine; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81790,7 +82550,7 @@ module.exports = TriangleToTriangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81838,7 +82598,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81867,7 +82627,7 @@ module.exports = Angle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81942,7 +82702,7 @@ module.exports = BresenhamPoints; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -81983,7 +82743,7 @@ module.exports = CenterOn; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82014,7 +82774,7 @@ module.exports = Clone; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82046,7 +82806,7 @@ module.exports = CopyFrom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82081,7 +82841,7 @@ module.exports = Equals; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82140,7 +82900,7 @@ module.exports = Extend; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82261,7 +83021,7 @@ module.exports = GetEasedPoints; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82301,7 +83061,7 @@ module.exports = GetMidPoint; /** * @author Richard Davey * @author Florian Mertens - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82356,7 +83116,7 @@ module.exports = GetNearestPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82401,7 +83161,7 @@ module.exports = GetNormal; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82441,7 +83201,7 @@ module.exports = GetPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82508,7 +83268,7 @@ module.exports = GetPoints; /** * @author Richard Davey * @author Florian Mertens - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82555,7 +83315,7 @@ module.exports = GetShortestDistance; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82584,7 +83344,7 @@ module.exports = Height; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82613,7 +83373,7 @@ module.exports = Length; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82951,7 +83711,7 @@ module.exports = Line; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -82986,7 +83746,7 @@ module.exports = NormalAngle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83018,7 +83778,7 @@ module.exports = NormalX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83051,7 +83811,7 @@ module.exports = NormalY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83090,7 +83850,7 @@ module.exports = Offset; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83119,7 +83879,7 @@ module.exports = PerpSlope; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83160,7 +83920,7 @@ module.exports = Random; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83195,7 +83955,7 @@ module.exports = ReflectAngle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83232,7 +83992,7 @@ module.exports = Rotate; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83267,7 +84027,7 @@ module.exports = RotateAroundPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83316,7 +84076,7 @@ module.exports = RotateAroundXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83357,7 +84117,7 @@ module.exports = SetToAngle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83386,7 +84146,7 @@ module.exports = Slope; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83415,7 +84175,7 @@ module.exports = Width; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -83461,7 +84221,7 @@ module.exports = Line; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -84026,7 +84786,7 @@ module.exports = Face; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -84269,7 +85029,7 @@ module.exports = GenerateGridVerts; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -84414,7 +85174,7 @@ module.exports = GenerateObjVerts; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -84606,7 +85366,7 @@ module.exports = GenerateVerts; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -84923,7 +85683,7 @@ module.exports = ParseObj; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85002,7 +85762,7 @@ module.exports = ParseObjMaterial; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85068,7 +85828,7 @@ module.exports = RotateFace; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85365,7 +86125,7 @@ module.exports = Vertex; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85396,7 +86156,7 @@ module.exports = Mesh; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85427,7 +86187,7 @@ module.exports = Ceil; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85458,7 +86218,7 @@ module.exports = Clone; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85490,7 +86250,7 @@ module.exports = CopyFrom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85520,7 +86280,7 @@ module.exports = Equals; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85551,7 +86311,7 @@ module.exports = Floor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85616,7 +86376,7 @@ module.exports = GetCentroid; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85645,7 +86405,7 @@ module.exports = GetMagnitude; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85674,7 +86434,7 @@ module.exports = GetMagnitudeSq; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85745,7 +86505,7 @@ module.exports = GetRectangleFromPoints; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85787,7 +86547,7 @@ module.exports = Interpolate; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85818,7 +86578,7 @@ module.exports = Invert; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85854,7 +86614,7 @@ module.exports = Negative; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85948,7 +86708,7 @@ module.exports = Point; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -85996,7 +86756,7 @@ module.exports = Project; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -86042,7 +86802,7 @@ module.exports = ProjectUnit; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -86087,7 +86847,7 @@ module.exports = SetMagnitude; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -86119,7 +86879,7 @@ module.exports = Point; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -86150,7 +86910,7 @@ module.exports = Clone; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -86200,7 +86960,7 @@ module.exports = Contains; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -86233,7 +86993,7 @@ module.exports = ContainsPoint; "use strict"; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -86997,7 +87757,7 @@ module.exports = earcut; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87054,7 +87814,7 @@ module.exports = GetAABB; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87098,7 +87858,7 @@ module.exports = GetNumberArray; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87176,7 +87936,7 @@ module.exports = GetPoints; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87225,7 +87985,7 @@ module.exports = Perimeter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87460,7 +88220,7 @@ module.exports = Polygon; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87700,7 +88460,7 @@ module.exports = Simplify; /** * @author Richard Davey * @author Igor Ognichenko - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87711,7 +88471,7 @@ var copy = function (out, a) { out[0] = a[0]; out[1] = a[1]; - + return out; }; @@ -87739,12 +88499,12 @@ var Smooth = function (polygon) } var output = []; - + if (points.length > 0) { output.push(copy([ 0, 0 ], points[0])); } - + for (i = 0; i < points.length - 1; i++) { var p0 = points[i]; @@ -87757,12 +88517,12 @@ var Smooth = function (polygon) output.push([ 0.85 * p0x + 0.15 * p1x, 0.85 * p0y + 0.15 * p1y ]); output.push([ 0.15 * p0x + 0.85 * p1x, 0.15 * p0y + 0.85 * p1y ]); } - + if (points.length > 1) { output.push(copy([ 0, 0 ], points[points.length - 1])); } - + return polygon.setTo(output); }; @@ -87776,7 +88536,7 @@ module.exports = Smooth; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87817,7 +88577,7 @@ module.exports = Translate; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87846,7 +88606,7 @@ module.exports = Polygon; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87875,7 +88635,7 @@ module.exports = Area; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87909,7 +88669,7 @@ module.exports = Ceil; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87945,7 +88705,7 @@ module.exports = CeilAll; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -87983,7 +88743,7 @@ module.exports = CenterOn; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88014,7 +88774,7 @@ module.exports = Clone; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88050,7 +88810,7 @@ module.exports = Contains; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88082,7 +88842,7 @@ module.exports = ContainsPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88123,7 +88883,7 @@ module.exports = ContainsRect; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88155,7 +88915,7 @@ module.exports = CopyFrom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88193,7 +88953,7 @@ module.exports = Decompose; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88228,7 +88988,7 @@ module.exports = Equals; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88238,7 +88998,7 @@ var GetAspectRatio = __webpack_require__(6700); * Adjusts the target rectangle, changing its width, height and position, * so that it fits inside the area of the source rectangle, while maintaining its original * aspect ratio. - * + * * Unlike the `FitOutside` function, there may be some space inside the source area not covered. * * @function Phaser.Geom.Rectangle.FitInside @@ -88282,7 +89042,7 @@ module.exports = FitInside; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88292,7 +89052,7 @@ var GetAspectRatio = __webpack_require__(6700); * Adjusts the target rectangle, changing its width, height and position, * so that it fully covers the area of the source rectangle, while maintaining its original * aspect ratio. - * + * * Unlike the `FitInside` function, the target rectangle may extend further out than the source. * * @function Phaser.Geom.Rectangle.FitOutside @@ -88336,7 +89096,7 @@ module.exports = FitOutside; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88370,7 +89130,7 @@ module.exports = Floor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88406,7 +89166,7 @@ module.exports = FloorAll; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88493,7 +89253,7 @@ module.exports = FromPoints; /** * @author samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88537,7 +89297,7 @@ module.exports = FromXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88566,7 +89326,7 @@ module.exports = GetAspectRatio; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88605,7 +89365,7 @@ module.exports = GetCenter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88614,9 +89374,9 @@ var Point = __webpack_require__(79967); /** * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. - * + * * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. - * + * * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side. * * @function Phaser.Geom.Rectangle.GetPoint @@ -88687,7 +89447,7 @@ module.exports = GetPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88742,7 +89502,7 @@ module.exports = GetPoints; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88783,7 +89543,7 @@ module.exports = GetSize; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88826,7 +89586,7 @@ module.exports = Inflate; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88878,7 +89638,7 @@ module.exports = Intersection; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -88998,7 +89758,7 @@ module.exports = MarchingAnts; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -89048,7 +89808,7 @@ module.exports = MergePoints; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -89096,7 +89856,7 @@ module.exports = MergeRect; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -89141,7 +89901,7 @@ module.exports = MergeXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -89177,7 +89937,7 @@ module.exports = Offset; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -89212,7 +89972,7 @@ module.exports = OffsetPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -89247,7 +90007,7 @@ module.exports = Overlaps; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -89276,7 +90036,7 @@ module.exports = Perimeter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -89334,7 +90094,7 @@ module.exports = PerimeterPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -89373,7 +90133,7 @@ module.exports = Random; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -89445,7 +90205,7 @@ module.exports = RandomOutside; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -89552,9 +90312,9 @@ var Rectangle = new Class({ /** * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. - * + * * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. - * + * * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side. * * @method Phaser.Geom.Rectangle#getPoint @@ -89957,7 +90717,7 @@ module.exports = Rectangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -89987,7 +90747,7 @@ module.exports = SameDimensions; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90027,7 +90787,7 @@ module.exports = Scale; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90070,7 +90830,7 @@ module.exports = Union; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90125,7 +90885,7 @@ module.exports = Rectangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90165,7 +90925,7 @@ module.exports = Area; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90210,7 +90970,7 @@ module.exports = BuildEquilateral; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90287,7 +91047,7 @@ module.exports = BuildFromPolygon; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90337,7 +91097,7 @@ module.exports = BuildRight; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90391,7 +91151,7 @@ module.exports = CenterOn; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90436,7 +91196,7 @@ module.exports = Centroid; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90513,7 +91273,7 @@ module.exports = CircumCenter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90597,7 +91357,7 @@ module.exports = CircumCircle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90628,7 +91388,7 @@ module.exports = Clone; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90682,7 +91442,7 @@ module.exports = Contains; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90745,7 +91505,7 @@ var ContainsArray = function (triangle, points, returnFirst, out) u = ((dot11 * dot02) - (dot01 * dot12)) * inv; v = ((dot00 * dot12) - (dot01 * dot02)) * inv; - + if (u >= 0 && v >= 0 && (u + v < 1)) { out.push({ x: points[i].x, y: points[i].y }); @@ -90770,7 +91530,7 @@ module.exports = ContainsArray; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90802,7 +91562,7 @@ module.exports = ContainsPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90834,7 +91594,7 @@ module.exports = CopyFrom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90870,7 +91630,7 @@ module.exports = Decompose; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90907,7 +91667,7 @@ module.exports = Equals; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -90995,7 +91755,7 @@ module.exports = GetPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -91089,7 +91849,7 @@ module.exports = GetPoints; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -91155,7 +91915,7 @@ module.exports = InCenter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -91197,7 +91957,7 @@ module.exports = Offset; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -91233,7 +91993,7 @@ module.exports = Perimeter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -91290,7 +92050,7 @@ module.exports = Random; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -91327,7 +92087,7 @@ module.exports = Rotate; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -91362,7 +92122,7 @@ module.exports = RotateAroundPoint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -91417,7 +92177,7 @@ module.exports = RotateAroundXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -91865,7 +92625,7 @@ module.exports = Triangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -91906,13 +92666,13 @@ module.exports = Triangle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Creates a new Interactive Object. - * + * * This is called automatically by the Input Manager when you enable a Game Object for input. * * The resulting Interactive Object is mapped to the Game Object's `input` property. @@ -91978,7 +92738,7 @@ module.exports = CreateInteractiveObject; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -92015,7 +92775,7 @@ module.exports = CreatePixelPerfectHandler; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -92330,15 +93090,18 @@ var InputManager = new Class({ */ boot: function () { - this.canvas = this.game.canvas; + var game = this.game; + var events = game.events; - this.scaleManager = this.game.scale; + this.canvas = game.canvas; + + this.scaleManager = game.scale; this.events.emit(Events.MANAGER_BOOT); - this.game.events.on(GameEvents.PRE_RENDER, this.preRender, this); + events.on(GameEvents.PRE_RENDER, this.preRender, this); - this.game.events.once(GameEvents.DESTROY, this.destroy, this); + events.once(GameEvents.DESTROY, this.destroy, this); }, /** @@ -92626,11 +93389,26 @@ var InputManager = new Class({ if (pointer.active && pointer.identifier === changedTouch.identifier) { - pointer.touchmove(changedTouch, event); + var element = document.elementFromPoint(changedTouch.pageX, changedTouch.pageY); + var overCanvas = element === this.canvas; - this.activePointer = pointer; + if (!this.isOver && overCanvas) + { + this.setCanvasOver(event); + } + else if (this.isOver && !overCanvas) + { + this.setCanvasOut(event); + } - changed.push(pointer); + if (this.isOver) + { + pointer.touchmove(changedTouch, event); + + this.activePointer = pointer; + + changed.push(pointer); + } break; } @@ -93108,7 +93886,7 @@ module.exports = InputManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -93885,12 +94663,20 @@ var InputPlugin = new Class({ { if (skipQueue === undefined) { skipQueue = false; } + this.disable(gameObject); + var input = gameObject.input; // If GameObject.input already cleared from higher class - if (!input) + if (input) { - return; + input.gameObject = undefined; + input.target = undefined; + input.hitArea = undefined; + input.hitAreaCallback = undefined; + input.callbackContext = undefined; + + gameObject.input = null; } if (!skipQueue) @@ -93898,15 +94684,6 @@ var InputPlugin = new Class({ this.queueForRemoval(gameObject); } - input.gameObject = undefined; - input.target = undefined; - input.hitArea = undefined; - input.hitAreaCallback = undefined; - input.callbackContext = undefined; - - gameObject.input = null; - - // Clear from _draggable, _drag and _over var index = this._draggable.indexOf(gameObject); if (index > -1) @@ -93914,22 +94691,6 @@ var InputPlugin = new Class({ this._draggable.splice(index, 1); } - index = this._drag[0].indexOf(gameObject); - - if (index > -1) - { - this._drag[0].splice(index, 1); - } - - index = this._over[0].indexOf(gameObject); - - if (index > -1) - { - this._over[0].splice(index, 1); - - this.manager.resetCursor(input); - } - return gameObject; }, @@ -93943,10 +94704,52 @@ var InputPlugin = new Class({ * @since 3.0.0 * * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to have its input system disabled. + * + * @return {this} This Input Plugin. */ disable: function (gameObject) { - gameObject.input.enabled = false; + var input = gameObject.input; + + if (input) + { + input.enabled = false; + input.dragState = 0; + } + + // Clear from _temp, _drag and _over + var temp = this._temp; + var drag = this._drag; + var over = this._over; + var manager = this.manager; + + var index = temp.indexOf(gameObject); + + if (index > -1) + { + temp.splice(index, 1); + } + + for (var i = 0; i < manager.pointersTotal; i++) + { + index = drag[i].indexOf(gameObject); + + if (index > -1) + { + drag[i].splice(index, 1); + } + + index = over[i].indexOf(gameObject); + + if (index > -1) + { + over[i].splice(index, 1); + + manager.resetCursor(input); + } + } + + return this; }, /** @@ -95532,6 +96335,7 @@ var InputPlugin = new Class({ var offsetx = 0; var offsety = 0; + switch (shapeType) { case GEOM_CONST.CIRCLE: @@ -95568,10 +96372,11 @@ var InputPlugin = new Class({ if (debug) { debug.isFilled = false; + debug.strokeColor = color; debug.preUpdate = function () { - debug.setStrokeStyle(1 / gameObject.scale, color); + debug.setStrokeStyle(1 / gameObject.scale, debug.strokeColor); debug.setDisplayOrigin(gameObject.displayOriginX, gameObject.displayOriginY); @@ -95745,7 +96550,7 @@ var InputPlugin = new Class({ */ sortGameObjects: function (gameObjects, pointer) { - if (gameObjects.length < 2) + if (gameObjects.length < 2 || !pointer.camera) { return gameObjects; } @@ -95754,7 +96559,10 @@ var InputPlugin = new Class({ return gameObjects.sort(function (childA, childB) { - return list.indexOf(childB) - list.indexOf(childA); + var indexA = Math.max(list.indexOf(childA), 0); + var indexB = Math.max(list.indexOf(childB), 0); + + return indexB - indexA; }); }, @@ -96320,7 +97128,7 @@ module.exports = InputPlugin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -96429,7 +97237,7 @@ module.exports = InputPluginCache; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -97716,7 +98524,7 @@ module.exports = Pointer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -97724,7 +98532,7 @@ var INPUT_CONST = { /** * The mouse pointer is being held down. - * + * * @name Phaser.Input.MOUSE_DOWN * @type {number} * @since 3.10.0 @@ -97733,7 +98541,7 @@ var INPUT_CONST = { /** * The mouse pointer is being moved. - * + * * @name Phaser.Input.MOUSE_MOVE * @type {number} * @since 3.10.0 @@ -97742,7 +98550,7 @@ var INPUT_CONST = { /** * The mouse pointer is released. - * + * * @name Phaser.Input.MOUSE_UP * @type {number} * @since 3.10.0 @@ -97751,7 +98559,7 @@ var INPUT_CONST = { /** * A touch pointer has been started. - * + * * @name Phaser.Input.TOUCH_START * @type {number} * @since 3.10.0 @@ -97760,7 +98568,7 @@ var INPUT_CONST = { /** * A touch pointer has been started. - * + * * @name Phaser.Input.TOUCH_MOVE * @type {number} * @since 3.10.0 @@ -97769,7 +98577,7 @@ var INPUT_CONST = { /** * A touch pointer has been started. - * + * * @name Phaser.Input.TOUCH_END * @type {number} * @since 3.10.0 @@ -97778,7 +98586,7 @@ var INPUT_CONST = { /** * The pointer lock has changed. - * + * * @name Phaser.Input.POINTER_LOCK_CHANGE * @type {number} * @since 3.10.0 @@ -97787,7 +98595,7 @@ var INPUT_CONST = { /** * A touch pointer has been been cancelled by the browser. - * + * * @name Phaser.Input.TOUCH_CANCEL * @type {number} * @since 3.15.0 @@ -97796,7 +98604,7 @@ var INPUT_CONST = { /** * The mouse wheel changes. - * + * * @name Phaser.Input.MOUSE_WHEEL * @type {number} * @since 3.18.0 @@ -97815,13 +98623,13 @@ module.exports = INPUT_CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Input Plugin Boot Event. - * + * * This internal event is dispatched by the Input Plugin when it boots, signalling to all of its systems to create themselves. * * @event Phaser.Input.Events#BOOT @@ -97837,13 +98645,13 @@ module.exports = 'boot'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Input Plugin Destroy Event. - * + * * This internal event is dispatched by the Input Plugin when it is destroyed, signalling to all of its systems to destroy themselves. * * @event Phaser.Input.Events#DESTROY @@ -97859,22 +98667,22 @@ module.exports = 'destroy'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Drag End Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer stops dragging a Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('dragend', listener)`. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_END]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_END} event instead. * * @event Phaser.Input.Events#DRAG_END * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object that this pointer stopped dragging. */ @@ -97888,24 +98696,24 @@ module.exports = 'dragend'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Drag Enter Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer drags a Game Object into a Drag Target. - * + * * Listen to this event from within a Scene using: `this.input.on('dragenter', listener)`. - * + * * A Pointer can only drag a single Game Object at once. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_ENTER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_ENTER} event instead. * * @event Phaser.Input.Events#DRAG_ENTER * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object that this pointer is dragging. * @param {Phaser.GameObjects.GameObject} target - The drag target that this pointer has moved into. @@ -97920,24 +98728,24 @@ module.exports = 'dragenter'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Drag Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves while dragging a Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('drag', listener)`. - * + * * A Pointer can only drag a single Game Object at once. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG} event instead. * * @event Phaser.Input.Events#DRAG * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object that this pointer is dragging. * @param {number} dragX - The x coordinate where the Pointer is currently dragging the Game Object, in world space. @@ -97953,24 +98761,24 @@ module.exports = 'drag'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Drag Leave Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer drags a Game Object out of a Drag Target. - * + * * Listen to this event from within a Scene using: `this.input.on('dragleave', listener)`. - * + * * A Pointer can only drag a single Game Object at once. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_LEAVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_LEAVE} event instead. * * @event Phaser.Input.Events#DRAG_LEAVE * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object that this pointer is dragging. * @param {Phaser.GameObjects.GameObject} target - The drag target that this pointer has left. @@ -97985,27 +98793,27 @@ module.exports = 'dragleave'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Drag Over Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer drags a Game Object over a Drag Target. - * + * * When the Game Object first enters the drag target it will emit a `dragenter` event. If it then moves while within * the drag target, it will emit this event instead. - * + * * Listen to this event from within a Scene using: `this.input.on('dragover', listener)`. - * + * * A Pointer can only drag a single Game Object at once. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_OVER} event instead. * * @event Phaser.Input.Events#DRAG_OVER * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object that this pointer is dragging. * @param {Phaser.GameObjects.GameObject} target - The drag target that this pointer has moved over. @@ -98020,24 +98828,24 @@ module.exports = 'dragover'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Drag Start Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer starts to drag any Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('dragstart', listener)`. - * + * * A Pointer can only drag a single Game Object at once. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_START]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_START} event instead. * * @event Phaser.Input.Events#DRAG_START * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object that this pointer is dragging. */ @@ -98051,22 +98859,22 @@ module.exports = 'dragstart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Drop Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer drops a Game Object on a Drag Target. - * + * * Listen to this event from within a Scene using: `this.input.on('drop', listener)`. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DROP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DROP} event instead. * * @event Phaser.Input.Events#DROP * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object that this pointer was dragging. * @param {Phaser.GameObjects.GameObject} target - The Drag Target the `gameObject` has been dropped on. @@ -98081,34 +98889,34 @@ module.exports = 'drop'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Down Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is pressed down on _any_ interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('gameobjectdown', listener)`. - * + * * To receive this event, the Game Objects must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} event instead. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} * 2. [GAMEOBJECT_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DOWN} * 3. [POINTER_DOWN]{@linkcode Phaser.Input.Events#event:POINTER_DOWN} or [POINTER_DOWN_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_DOWN_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_DOWN * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the pointer was pressed down on. * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow. @@ -98123,24 +98931,24 @@ module.exports = 'gameobjectdown'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Drag End Event. - * + * * This event is dispatched by an interactive Game Object if a pointer stops dragging it. - * + * * Listen to this event from a Game Object using: `gameObject.on('dragend', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive and enabled for drag. * See [GameObject.setInteractive](Phaser.GameObjects.GameObject#setInteractive) for more details. * * @event Phaser.Input.Events#GAMEOBJECT_DRAG_END * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {number} dragX - The x coordinate where the Pointer stopped dragging the Game Object, in world space. * @param {number} dragY - The y coordinate where the Pointer stopped dragging the Game Object, in world space. @@ -98155,24 +98963,24 @@ module.exports = 'dragend'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Drag Enter Event. - * + * * This event is dispatched by an interactive Game Object if a pointer drags it into a drag target. - * + * * Listen to this event from a Game Object using: `gameObject.on('dragenter', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive and enabled for drag. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. * * @event Phaser.Input.Events#GAMEOBJECT_DRAG_ENTER * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} target - The drag target that this pointer has moved into. */ @@ -98186,24 +98994,24 @@ module.exports = 'dragenter'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Drag Event. - * + * * This event is dispatched by an interactive Game Object if a pointer moves while dragging it. - * + * * Listen to this event from a Game Object using: `gameObject.on('drag', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive and enabled for drag. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. * * @event Phaser.Input.Events#GAMEOBJECT_DRAG * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {number} dragX - The x coordinate where the Pointer is currently dragging the Game Object, in world space. * @param {number} dragY - The y coordinate where the Pointer is currently dragging the Game Object, in world space. @@ -98218,24 +99026,24 @@ module.exports = 'drag'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Drag Leave Event. - * + * * This event is dispatched by an interactive Game Object if a pointer drags it out of a drag target. - * + * * Listen to this event from a Game Object using: `gameObject.on('dragleave', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive and enabled for drag. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. * * @event Phaser.Input.Events#GAMEOBJECT_DRAG_LEAVE * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} target - The drag target that this pointer has left. */ @@ -98249,27 +99057,27 @@ module.exports = 'dragleave'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Drag Over Event. - * + * * This event is dispatched by an interactive Game Object if a pointer drags it over a drag target. - * + * * When the Game Object first enters the drag target it will emit a `dragenter` event. If it then moves while within * the drag target, it will emit this event instead. - * + * * Listen to this event from a Game Object using: `gameObject.on('dragover', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive and enabled for drag. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. * * @event Phaser.Input.Events#GAMEOBJECT_DRAG_OVER * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} target - The drag target that this pointer has moved over. */ @@ -98283,27 +99091,27 @@ module.exports = 'dragover'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Drag Start Event. - * + * * This event is dispatched by an interactive Game Object if a pointer starts to drag it. - * + * * Listen to this event from a Game Object using: `gameObject.on('dragstart', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive and enabled for drag. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * There are lots of useful drag related properties that are set within the Game Object when dragging occurs. * For example, `gameObject.input.dragStartX`, `dragStartY` and so on. * * @event Phaser.Input.Events#GAMEOBJECT_DRAG_START * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {number} dragX - The x coordinate where the Pointer is currently dragging the Game Object, in world space. * @param {number} dragY - The y coordinate where the Pointer is currently dragging the Game Object, in world space. @@ -98318,24 +99126,24 @@ module.exports = 'dragstart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Drop Event. - * + * * This event is dispatched by an interactive Game Object if a pointer drops it on a Drag Target. - * + * * Listen to this event from a Game Object using: `gameObject.on('drop', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive and enabled for drag. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. * * @event Phaser.Input.Events#GAMEOBJECT_DROP * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} target - The Drag Target the `gameObject` has been dropped on. */ @@ -98349,34 +99157,34 @@ module.exports = 'drop'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Move Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is moved across _any_ interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('gameobjectmove', listener)`. - * + * * To receive this event, the Game Objects must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_MOVE} event instead. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_MOVE} * 2. [GAMEOBJECT_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_MOVE} * 3. [POINTER_MOVE]{@linkcode Phaser.Input.Events#event:POINTER_MOVE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_MOVE * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the pointer was moved on. * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow. @@ -98391,34 +99199,37 @@ module.exports = 'gameobjectmove'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Out Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves out of _any_ interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('gameobjectout', listener)`. - * + * * To receive this event, the Game Objects must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OUT} event instead. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OUT} * 2. [GAMEOBJECT_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OUT} * 3. [POINTER_OUT]{@linkcode Phaser.Input.Events#event:POINTER_OUT} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * + * If the pointer leaves the game canvas itself, it will not trigger an this event. To handle those cases, + * please listen for the [GAME_OUT]{@linkcode Phaser.Input.Events#event:GAME_OUT} event. + * * @event Phaser.Input.Events#GAMEOBJECT_OUT * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the pointer moved out of. * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow. @@ -98433,34 +99244,34 @@ module.exports = 'gameobjectout'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Over Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves over _any_ interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('gameobjectover', listener)`. - * + * * To receive this event, the Game Objects must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OVER} event instead. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OVER} * 2. [GAMEOBJECT_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OVER} * 3. [POINTER_OVER]{@linkcode Phaser.Input.Events#event:POINTER_OVER} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_OVER * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the pointer moved over. * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow. @@ -98475,33 +99286,33 @@ module.exports = 'gameobjectover'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Pointer Down Event. - * + * * This event is dispatched by an interactive Game Object if a pointer is pressed down on it. - * + * * Listen to this event from a Game Object using: `gameObject.on('pointerdown', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} * 2. [GAMEOBJECT_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DOWN} * 3. [POINTER_DOWN]{@linkcode Phaser.Input.Events#event:POINTER_DOWN} or [POINTER_DOWN_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_DOWN_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_POINTER_DOWN * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {number} localX - The x coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. * @param {number} localY - The y coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. @@ -98517,33 +99328,33 @@ module.exports = 'pointerdown'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Pointer Move Event. - * + * * This event is dispatched by an interactive Game Object if a pointer is moved while over it. - * + * * Listen to this event from a Game Object using: `gameObject.on('pointermove', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_MOVE} * 2. [GAMEOBJECT_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_MOVE} * 3. [POINTER_MOVE]{@linkcode Phaser.Input.Events#event:POINTER_MOVE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_POINTER_MOVE * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {number} localX - The x coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. * @param {number} localY - The y coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. @@ -98559,33 +99370,36 @@ module.exports = 'pointermove'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Pointer Out Event. - * + * * This event is dispatched by an interactive Game Object if a pointer moves out of it. - * + * * Listen to this event from a Game Object using: `gameObject.on('pointerout', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OUT} * 2. [GAMEOBJECT_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OUT} * 3. [POINTER_OUT]{@linkcode Phaser.Input.Events#event:POINTER_OUT} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * + * If the pointer leaves the game canvas itself, it will not trigger an this event. To handle those cases, + * please listen for the [GAME_OUT]{@linkcode Phaser.Input.Events#event:GAME_OUT} event. + * * @event Phaser.Input.Events#GAMEOBJECT_POINTER_OUT * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow. */ @@ -98599,33 +99413,33 @@ module.exports = 'pointerout'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Pointer Over Event. - * + * * This event is dispatched by an interactive Game Object if a pointer moves over it. - * + * * Listen to this event from a Game Object using: `gameObject.on('pointerover', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OVER} * 2. [GAMEOBJECT_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OVER} * 3. [POINTER_OVER]{@linkcode Phaser.Input.Events#event:POINTER_OVER} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_POINTER_OVER * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {number} localX - The x coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. * @param {number} localY - The y coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. @@ -98641,33 +99455,33 @@ module.exports = 'pointerover'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Pointer Up Event. - * + * * This event is dispatched by an interactive Game Object if a pointer is released while over it. - * + * * Listen to this event from a Game Object using: `gameObject.on('pointerup', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} * 2. [GAMEOBJECT_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_UP} * 3. [POINTER_UP]{@linkcode Phaser.Input.Events#event:POINTER_UP} or [POINTER_UP_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_UP_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_POINTER_UP * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {number} localX - The x coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. * @param {number} localY - The y coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. @@ -98683,33 +99497,33 @@ module.exports = 'pointerup'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Pointer Wheel Event. - * + * * This event is dispatched by an interactive Game Object if a pointer has its wheel moved while over it. - * + * * Listen to this event from a Game Object using: `gameObject.on('wheel', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_WHEEL} * 2. [GAMEOBJECT_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_WHEEL} * 3. [POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:POINTER_WHEEL} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_POINTER_WHEEL * @since 3.18.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {number} deltaX - The horizontal scroll amount that occurred due to the user moving a mouse wheel or similar input device. * @param {number} deltaY - The vertical scroll amount that occurred due to the user moving a mouse wheel or similar input device. This value will typically be less than 0 if the user scrolls up and greater than zero if scrolling down. @@ -98726,34 +99540,34 @@ module.exports = 'wheel'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Up Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is released while over _any_ interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('gameobjectup', listener)`. - * + * * To receive this event, the Game Objects must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} event instead. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} * 2. [GAMEOBJECT_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_UP} * 3. [POINTER_UP]{@linkcode Phaser.Input.Events#event:POINTER_UP} or [POINTER_UP_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_UP_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_UP * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the pointer was over when released. * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow. @@ -98768,34 +99582,34 @@ module.exports = 'gameobjectup'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Game Object Wheel Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer has its wheel moved while over _any_ interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('gameobjectwheel', listener)`. - * + * * To receive this event, the Game Objects must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_WHEEL} event instead. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_WHEEL} * 2. [GAMEOBJECT_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_WHEEL} * 3. [POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:POINTER_WHEEL} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_WHEEL * @since 3.18.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the pointer was over when the wheel changed. * @param {number} deltaX - The horizontal scroll amount that occurred due to the user moving a mouse wheel or similar input device. @@ -98813,21 +99627,21 @@ module.exports = 'gameobjectwheel'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Input Plugin Game Out Event. - * + * * This event is dispatched by the Input Plugin if the active pointer leaves the game canvas and is now * outside of it, elsewhere on the web page. - * + * * Listen to this event from within a Scene using: `this.input.on('gameout', listener)`. * * @event Phaser.Input.Events#GAME_OUT * @since 3.16.1 - * + * * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. * @param {(MouseEvent|TouchEvent)} event - The DOM Event that triggered the canvas out. */ @@ -98841,21 +99655,21 @@ module.exports = 'gameout'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Input Plugin Game Over Event. - * + * * This event is dispatched by the Input Plugin if the active pointer enters the game canvas and is now * over of it, having previously been elsewhere on the web page. - * + * * Listen to this event from within a Scene using: `this.input.on('gameover', listener)`. * * @event Phaser.Input.Events#GAME_OVER * @since 3.16.1 - * + * * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. * @param {(MouseEvent|TouchEvent)} event - The DOM Event that triggered the canvas over. */ @@ -98869,13 +99683,13 @@ module.exports = 'gameover'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Input Manager Boot Event. - * + * * This internal event is dispatched by the Input Manager when it boots. * * @event Phaser.Input.Events#MANAGER_BOOT @@ -98891,19 +99705,19 @@ module.exports = 'boot'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Input Manager Process Event. - * + * * This internal event is dispatched by the Input Manager when not using the legacy queue system, * and it wants the Input Plugins to update themselves. * * @event Phaser.Input.Events#MANAGER_PROCESS * @since 3.0.0 - * + * * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. */ @@ -98917,13 +99731,13 @@ module.exports = 'process'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Input Manager Update Event. - * + * * This internal event is dispatched by the Input Manager as part of its update step. * * @event Phaser.Input.Events#MANAGER_UPDATE @@ -98939,18 +99753,18 @@ module.exports = 'update'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Input Manager Pointer Lock Change Event. - * + * * This event is dispatched by the Input Manager when it is processing a native Pointer Lock Change DOM Event. * * @event Phaser.Input.Events#POINTERLOCK_CHANGE * @since 3.0.0 - * + * * @param {Event} event - The native DOM Event. * @param {boolean} locked - The locked state of the Mouse Pointer. */ @@ -98964,29 +99778,29 @@ module.exports = 'pointerlockchange'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Down Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is pressed down anywhere. - * + * * Listen to this event from within a Scene using: `this.input.on('pointerdown', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} * 2. [GAMEOBJECT_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DOWN} * 3. [POINTER_DOWN]{@linkcode Phaser.Input.Events#event:POINTER_DOWN} or [POINTER_DOWN_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_DOWN_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#POINTER_DOWN * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject[]} currentlyOver - An array containing all interactive Game Objects that the pointer was over when the event was created. */ @@ -99000,29 +99814,29 @@ module.exports = 'pointerdown'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Down Outside Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is pressed down anywhere outside of the game canvas. - * + * * Listen to this event from within a Scene using: `this.input.on('pointerdownoutside', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} * 2. [GAMEOBJECT_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DOWN} * 3. [POINTER_DOWN]{@linkcode Phaser.Input.Events#event:POINTER_DOWN} or [POINTER_DOWN_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_DOWN_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#POINTER_DOWN_OUTSIDE * @since 3.16.1 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. */ module.exports = 'pointerdownoutside'; @@ -99035,29 +99849,29 @@ module.exports = 'pointerdownoutside'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Move Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is moved anywhere. - * + * * Listen to this event from within a Scene using: `this.input.on('pointermove', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_MOVE} * 2. [GAMEOBJECT_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_MOVE} * 3. [POINTER_MOVE]{@linkcode Phaser.Input.Events#event:POINTER_MOVE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#POINTER_MOVE * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject[]} currentlyOver - An array containing all interactive Game Objects that the pointer was over when the event was created. */ @@ -99071,29 +99885,32 @@ module.exports = 'pointermove'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Out Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves out of any interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('pointerout', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OUT} * 2. [GAMEOBJECT_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OUT} * 3. [POINTER_OUT]{@linkcode Phaser.Input.Events#event:POINTER_OUT} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * + * If the pointer leaves the game canvas itself, it will not trigger an this event. To handle those cases, + * please listen for the [GAME_OUT]{@linkcode Phaser.Input.Events#event:GAME_OUT} event. + * * @event Phaser.Input.Events#POINTER_OUT * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject[]} justOut - An array containing all interactive Game Objects that the pointer moved out of when the event was created. */ @@ -99107,29 +99924,29 @@ module.exports = 'pointerout'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Over Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves over any interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('pointerover', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OVER} * 2. [GAMEOBJECT_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OVER} * 3. [POINTER_OVER]{@linkcode Phaser.Input.Events#event:POINTER_OVER} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#POINTER_OVER * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject[]} justOver - An array containing all interactive Game Objects that the pointer moved over when the event was created. */ @@ -99143,29 +99960,29 @@ module.exports = 'pointerover'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Up Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is released anywhere. - * + * * Listen to this event from within a Scene using: `this.input.on('pointerup', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} * 2. [GAMEOBJECT_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_UP} * 3. [POINTER_UP]{@linkcode Phaser.Input.Events#event:POINTER_UP} or [POINTER_UP_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_UP_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#POINTER_UP * @since 3.0.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject[]} currentlyOver - An array containing all interactive Game Objects that the pointer was over when the event was created. */ @@ -99179,29 +99996,29 @@ module.exports = 'pointerup'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Up Outside Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is released anywhere outside of the game canvas. - * + * * Listen to this event from within a Scene using: `this.input.on('pointerupoutside', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} * 2. [GAMEOBJECT_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_UP} * 3. [POINTER_UP]{@linkcode Phaser.Input.Events#event:POINTER_UP} or [POINTER_UP_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_UP_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#POINTER_UP_OUTSIDE * @since 3.16.1 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. */ module.exports = 'pointerupoutside'; @@ -99214,29 +100031,29 @@ module.exports = 'pointerupoutside'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pointer Wheel Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer has its wheel updated. - * + * * Listen to this event from within a Scene using: `this.input.on('wheel', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_WHEEL} * 2. [GAMEOBJECT_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_WHEEL} * 3. [POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:POINTER_WHEEL} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * @event Phaser.Input.Events#POINTER_WHEEL * @since 3.18.0 - * + * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. * @param {Phaser.GameObjects.GameObject[]} currentlyOver - An array containing all interactive Game Objects that the pointer was over when the event was created. * @param {number} deltaX - The horizontal scroll amount that occurred due to the user moving a mouse wheel or similar input device. @@ -99253,13 +100070,13 @@ module.exports = 'wheel'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Input Plugin Pre-Update Event. - * + * * This internal event is dispatched by the Input Plugin at the start of its `preUpdate` method. * This hook is designed specifically for input plugins, but can also be listened to from user-land code. * @@ -99276,13 +100093,13 @@ module.exports = 'preupdate'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Input Plugin Shutdown Event. - * + * * This internal event is dispatched by the Input Plugin when it shuts down, signalling to all of its systems to shut themselves down. * * @event Phaser.Input.Events#SHUTDOWN @@ -99298,13 +100115,13 @@ module.exports = 'shutdown'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Input Plugin Start Event. - * + * * This internal event is dispatched by the Input Plugin when it has finished setting-up, * signalling to all of its internal systems to start. * @@ -99321,19 +100138,19 @@ module.exports = 'start'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Input Plugin Update Event. - * + * * This internal event is dispatched by the Input Plugin at the start of its `update` method. * This hook is designed specifically for input plugins, but can also be listened to from user-land code. * * @event Phaser.Input.Events#UPDATE * @since 3.0.0 - * + * * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. */ @@ -99347,7 +100164,7 @@ module.exports = 'update'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -99414,7 +100231,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -99540,7 +100357,7 @@ module.exports = Axis; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -99687,7 +100504,7 @@ module.exports = Button; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -100461,7 +101278,7 @@ module.exports = Gamepad; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -101108,7 +101925,7 @@ module.exports = GamepadPlugin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -101124,7 +101941,7 @@ module.exports = { /** * D-Pad up - * + * * @name Phaser.Input.Gamepad.Configs.SNES_USB.UP * @const * @type {number} @@ -101134,7 +101951,7 @@ module.exports = { /** * D-Pad down - * + * * @name Phaser.Input.Gamepad.Configs.SNES_USB.DOWN * @const * @type {number} @@ -101144,7 +101961,7 @@ module.exports = { /** * D-Pad left - * + * * @name Phaser.Input.Gamepad.Configs.SNES_USB.LEFT * @const * @type {number} @@ -101154,7 +101971,7 @@ module.exports = { /** * D-Pad right - * + * * @name Phaser.Input.Gamepad.Configs.SNES_USB.RIGHT * @const * @type {number} @@ -101164,7 +101981,7 @@ module.exports = { /** * Select button - * + * * @name Phaser.Input.Gamepad.Configs.SNES_USB.SELECT * @const * @type {number} @@ -101174,7 +101991,7 @@ module.exports = { /** * Start button - * + * * @name Phaser.Input.Gamepad.Configs.SNES_USB.START * @const * @type {number} @@ -101184,7 +102001,7 @@ module.exports = { /** * B Button (Bottom) - * + * * @name Phaser.Input.Gamepad.Configs.SNES_USB.B * @const * @type {number} @@ -101194,7 +102011,7 @@ module.exports = { /** * A Button (Right) - * + * * @name Phaser.Input.Gamepad.Configs.SNES_USB.A * @const * @type {number} @@ -101204,7 +102021,7 @@ module.exports = { /** * Y Button (Left) - * + * * @name Phaser.Input.Gamepad.Configs.SNES_USB.Y * @const * @type {number} @@ -101214,7 +102031,7 @@ module.exports = { /** * X Button (Top) - * + * * @name Phaser.Input.Gamepad.Configs.SNES_USB.X * @const * @type {number} @@ -101224,7 +102041,7 @@ module.exports = { /** * Left bumper - * + * * @name Phaser.Input.Gamepad.Configs.SNES_USB.LEFT_SHOULDER * @const * @type {number} @@ -101234,7 +102051,7 @@ module.exports = { /** * Right bumper - * + * * @name Phaser.Input.Gamepad.Configs.SNES_USB.RIGHT_SHOULDER * @const * @type {number} @@ -101252,7 +102069,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -101268,7 +102085,7 @@ module.exports = { /** * D-Pad up - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.UP * @const * @type {number} @@ -101278,7 +102095,7 @@ module.exports = { /** * D-Pad down - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.DOWN * @const * @type {number} @@ -101288,7 +102105,7 @@ module.exports = { /** * D-Pad left - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.LEFT * @const * @type {number} @@ -101298,7 +102115,7 @@ module.exports = { /** * D-Pad up - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.RIGHT * @const * @type {number} @@ -101308,7 +102125,7 @@ module.exports = { /** * Share button - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.SHARE * @const * @type {number} @@ -101318,7 +102135,7 @@ module.exports = { /** * Options button - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.OPTIONS * @const * @type {number} @@ -101328,7 +102145,7 @@ module.exports = { /** * PlayStation logo button - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.PS * @const * @type {number} @@ -101338,7 +102155,7 @@ module.exports = { /** * Touchpad click - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.TOUCHBAR * @const * @type {number} @@ -101348,7 +102165,7 @@ module.exports = { /** * Cross button (Bottom) - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.X * @const * @type {number} @@ -101358,7 +102175,7 @@ module.exports = { /** * Circle button (Right) - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.CIRCLE * @const * @type {number} @@ -101368,7 +102185,7 @@ module.exports = { /** * Square button (Left) - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.SQUARE * @const * @type {number} @@ -101378,7 +102195,7 @@ module.exports = { /** * Triangle button (Top) - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.TRIANGLE * @const * @type {number} @@ -101388,7 +102205,7 @@ module.exports = { /** * Left bumper (L1) - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.L1 * @const * @type {number} @@ -101398,7 +102215,7 @@ module.exports = { /** * Right bumper (R1) - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.R1 * @const * @type {number} @@ -101408,7 +102225,7 @@ module.exports = { /** * Left trigger (L2) - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.L2 * @const * @type {number} @@ -101418,7 +102235,7 @@ module.exports = { /** * Right trigger (R2) - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.R2 * @const * @type {number} @@ -101428,7 +102245,7 @@ module.exports = { /** * Left stick click (L3) - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.L3 * @const * @type {number} @@ -101438,7 +102255,7 @@ module.exports = { /** * Right stick click (R3) - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.R3 * @const * @type {number} @@ -101448,7 +102265,7 @@ module.exports = { /** * Left stick horizontal - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.LEFT_STICK_H * @const * @type {number} @@ -101458,7 +102275,7 @@ module.exports = { /** * Left stick vertical - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.LEFT_STICK_V * @const * @type {number} @@ -101468,7 +102285,7 @@ module.exports = { /** * Right stick horizontal - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.RIGHT_STICK_H * @const * @type {number} @@ -101478,7 +102295,7 @@ module.exports = { /** * Right stick vertical - * + * * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.RIGHT_STICK_V * @const * @type {number} @@ -101496,7 +102313,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -101511,7 +102328,7 @@ module.exports = { /** * D-Pad up - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.UP * @const * @type {number} @@ -101521,7 +102338,7 @@ module.exports = { /** * D-Pad down - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.DOWN * @const * @type {number} @@ -101531,7 +102348,7 @@ module.exports = { /** * D-Pad left - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.LEFT * @const * @type {number} @@ -101541,7 +102358,7 @@ module.exports = { /** * D-Pad right - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.RIGHT * @const * @type {number} @@ -101551,7 +102368,7 @@ module.exports = { /** * XBox menu button - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.MENU * @const * @type {number} @@ -101561,7 +102378,7 @@ module.exports = { /** * A button (Bottom) - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.A * @const * @type {number} @@ -101571,7 +102388,7 @@ module.exports = { /** * B button (Right) - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.B * @const * @type {number} @@ -101581,7 +102398,7 @@ module.exports = { /** * X button (Left) - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.X * @const * @type {number} @@ -101591,7 +102408,7 @@ module.exports = { /** * Y button (Top) - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.Y * @const * @type {number} @@ -101601,7 +102418,7 @@ module.exports = { /** * Left Bumper - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.LB * @const * @type {number} @@ -101611,7 +102428,7 @@ module.exports = { /** * Right Bumper - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.RB * @const * @type {number} @@ -101621,7 +102438,7 @@ module.exports = { /** * Left Trigger - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.LT * @const * @type {number} @@ -101631,7 +102448,7 @@ module.exports = { /** * Right Trigger - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.RT * @const * @type {number} @@ -101641,7 +102458,7 @@ module.exports = { /** * Back / Change View button - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.BACK * @const * @type {number} @@ -101651,7 +102468,7 @@ module.exports = { /** * Start button - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.START * @const * @type {number} @@ -101661,7 +102478,7 @@ module.exports = { /** * Left Stick press - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.LS * @const * @type {number} @@ -101671,7 +102488,7 @@ module.exports = { /** * Right stick press - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.RS * @const * @type {number} @@ -101681,7 +102498,7 @@ module.exports = { /** * Left Stick horizontal - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.LEFT_STICK_H * @const * @type {number} @@ -101691,7 +102508,7 @@ module.exports = { /** * Left Stick vertical - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.LEFT_STICK_V * @const * @type {number} @@ -101701,7 +102518,7 @@ module.exports = { /** * Right Stick horizontal - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.RIGHT_STICK_H * @const * @type {number} @@ -101711,7 +102528,7 @@ module.exports = { /** * Right Stick vertical - * + * * @name Phaser.Input.Gamepad.Configs.XBOX_360.RIGHT_STICK_V * @const * @type {number} @@ -101729,7 +102546,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -101753,22 +102570,22 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Gamepad Button Down Event. - * + * * This event is dispatched by the Gamepad Plugin when a button has been pressed on any active Gamepad. - * + * * Listen to this event from within a Scene using: `this.input.gamepad.on('down', listener)`. - * + * * You can also listen for a DOWN event from a Gamepad instance. See the [GAMEPAD_BUTTON_DOWN]{@linkcode Phaser.Input.Gamepad.Events#event:GAMEPAD_BUTTON_DOWN} event for details. * * @event Phaser.Input.Gamepad.Events#BUTTON_DOWN * @since 3.10.0 - * + * * @param {Phaser.Input.Gamepad} pad - A reference to the Gamepad on which the button was pressed. * @param {Phaser.Input.Gamepad.Button} button - A reference to the Button which was pressed. * @param {number} value - The value of the button at the time it was pressed. Between 0 and 1. Some Gamepads have pressure-sensitive buttons. @@ -101783,22 +102600,22 @@ module.exports = 'down'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Gamepad Button Up Event. - * + * * This event is dispatched by the Gamepad Plugin when a button has been released on any active Gamepad. - * + * * Listen to this event from within a Scene using: `this.input.gamepad.on('up', listener)`. - * + * * You can also listen for an UP event from a Gamepad instance. See the [GAMEPAD_BUTTON_UP]{@linkcode Phaser.Input.Gamepad.Events#event:GAMEPAD_BUTTON_UP} event for details. * * @event Phaser.Input.Gamepad.Events#BUTTON_UP * @since 3.10.0 - * + * * @param {Phaser.Input.Gamepad} pad - A reference to the Gamepad on which the button was released. * @param {Phaser.Input.Gamepad.Button} button - A reference to the Button which was released. * @param {number} value - The value of the button at the time it was released. Between 0 and 1. Some Gamepads have pressure-sensitive buttons. @@ -101813,17 +102630,17 @@ module.exports = 'up'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Gamepad Connected Event. - * + * * This event is dispatched by the Gamepad Plugin when a Gamepad has been connected. - * + * * Listen to this event from within a Scene using: `this.input.gamepad.once('connected', listener)`. - * + * * Note that the browser may require you to press a button on a gamepad before it will allow you to access it, * this is for security reasons. However, it may also trust the page already, in which case you won't get the * 'connected' event and instead should check `GamepadPlugin.total` to see if it thinks there are any gamepads @@ -101831,7 +102648,7 @@ module.exports = 'up'; * * @event Phaser.Input.Gamepad.Events#CONNECTED * @since 3.0.0 - * + * * @param {Phaser.Input.Gamepad} pad - A reference to the Gamepad which was connected. * @param {Event} event - The native DOM Event that triggered the connection. */ @@ -101845,20 +102662,20 @@ module.exports = 'connected'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Gamepad Disconnected Event. - * + * * This event is dispatched by the Gamepad Plugin when a Gamepad has been disconnected. - * + * * Listen to this event from within a Scene using: `this.input.gamepad.once('disconnected', listener)`. * * @event Phaser.Input.Gamepad.Events#DISCONNECTED * @since 3.0.0 - * + * * @param {Phaser.Input.Gamepad} pad - A reference to the Gamepad which was disconnected. * @param {Event} event - The native DOM Event that triggered the disconnection. */ @@ -101872,25 +102689,25 @@ module.exports = 'disconnected'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Gamepad Button Down Event. - * + * * This event is dispatched by a Gamepad instance when a button has been pressed on it. - * + * * Listen to this event from a Gamepad instance. Once way to get this is from the `pad1`, `pad2`, etc properties on the Gamepad Plugin: * `this.input.gamepad.pad1.on('down', listener)`. - * + * * Note that you will not receive any Gamepad button events until the browser considers the Gamepad as being 'connected'. - * + * * You can also listen for a DOWN event from the Gamepad Plugin. See the [BUTTON_DOWN]{@linkcode Phaser.Input.Gamepad.Events#event:BUTTON_DOWN} event for details. * * @event Phaser.Input.Gamepad.Events#GAMEPAD_BUTTON_DOWN * @since 3.10.0 - * + * * @param {number} index - The index of the button that was pressed. * @param {number} value - The value of the button at the time it was pressed. Between 0 and 1. Some Gamepads have pressure-sensitive buttons. * @param {Phaser.Input.Gamepad.Button} button - A reference to the Button which was pressed. @@ -101905,25 +102722,25 @@ module.exports = 'down'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Gamepad Button Up Event. - * + * * This event is dispatched by a Gamepad instance when a button has been released on it. - * + * * Listen to this event from a Gamepad instance. Once way to get this is from the `pad1`, `pad2`, etc properties on the Gamepad Plugin: * `this.input.gamepad.pad1.on('up', listener)`. - * + * * Note that you will not receive any Gamepad button events until the browser considers the Gamepad as being 'connected'. - * + * * You can also listen for an UP event from the Gamepad Plugin. See the [BUTTON_UP]{@linkcode Phaser.Input.Gamepad.Events#event:BUTTON_UP} event for details. * * @event Phaser.Input.Gamepad.Events#GAMEPAD_BUTTON_UP * @since 3.10.0 - * + * * @param {number} index - The index of the button that was released. * @param {number} value - The value of the button at the time it was released. Between 0 and 1. Some Gamepads have pressure-sensitive buttons. * @param {Phaser.Input.Gamepad.Button} button - A reference to the Button which was released. @@ -101938,7 +102755,7 @@ module.exports = 'up'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -101965,7 +102782,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -101980,7 +102797,7 @@ module.exports = { Events: __webpack_require__(43200), Gamepad: __webpack_require__(75956), GamepadPlugin: __webpack_require__(1379), - + Configs: __webpack_require__(4898) }; @@ -101992,7 +102809,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -102032,7 +102849,7 @@ module.exports = Input; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -102477,7 +103294,7 @@ module.exports = KeyboardManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -102526,7 +103343,8 @@ var SnapFloor = __webpack_require__(84314); * Scene to stop all input, or `this.input.keyboard.preventDefault = false` to stop a Scene halting input on another Scene. * * _Note_: Many keyboards are unable to process certain combinations of keys due to hardware limitations known as ghosting. - * See http://www.html5gamedevs.com/topic/4876-impossible-to-use-more-than-2-keyboard-input-buttons-at-the-same-time/ for more details. + * See http://www.html5gamedevs.com/topic/4876-impossible-to-use-more-than-2-keyboard-input-buttons-at-the-same-time/ for more details + * and use the site https://w3c.github.io/uievents/tools/key-event-viewer.html to test your n-key support in browser. * * Also please be aware that certain browser extensions can disable or override Phaser keyboard handling. * For example the Chrome extension vimium is known to disable Phaser from using the D key, while EverNote disables the backtick key. @@ -103024,12 +103842,14 @@ var KeyboardPlugin = new Class({ * * @param {(Phaser.Input.Keyboard.Key|string|number)} key - Either a Key object, a string, such as `A` or `SPACE`, or a key code value. * @param {boolean} [destroy=false] - Call `Key.destroy` on the removed Key object? + * @param {boolean} [removeCapture=false] - Remove this Key from being captured? Only applies if set to capture when created. * * @return {this} This KeyboardPlugin object. */ - removeKey: function (key, destroy) + removeKey: function (key, destroy, removeCapture) { if (destroy === undefined) { destroy = false; } + if (removeCapture === undefined) { removeCapture = false; } var keys = this.keys; var ref; @@ -103061,6 +103881,11 @@ var KeyboardPlugin = new Class({ { ref.plugin = null; + if (removeCapture) + { + this.removeCapture(ref.keyCode); + } + if (destroy) { ref.destroy(); @@ -103077,11 +103902,15 @@ var KeyboardPlugin = new Class({ * @since 3.24.0 * * @param {boolean} [destroy=false] - Call `Key.destroy` on each removed Key object? + * @param {boolean} [removeCapture=false] - Remove all key captures for Key objects owened by this plugin? * * @return {this} This KeyboardPlugin object. */ - removeAllKeys: function (destroy) + removeAllKeys: function (destroy, removeCapture) { + if (destroy === undefined) { destroy = false; } + if (removeCapture === undefined) { removeCapture = false; } + var keys = this.keys; for (var i = 0; i < keys.length; i++) @@ -103092,6 +103921,11 @@ var KeyboardPlugin = new Class({ { keys[i] = undefined; + if (removeCapture) + { + this.removeCapture(key.keyCode); + } + if (destroy) { key.destroy(); @@ -103423,7 +104257,7 @@ module.exports = KeyboardPlugin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -103466,7 +104300,7 @@ module.exports = AdvanceKeyCombo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -103760,7 +104594,7 @@ module.exports = KeyCombo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -103842,7 +104676,7 @@ module.exports = ProcessKeyCombo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -103878,21 +104712,21 @@ module.exports = ResetKeyCombo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Global Key Down Event. - * + * * This event is dispatched by the Keyboard Plugin when any key on the keyboard is pressed down. - * + * * Listen to this event from within a Scene using: `this.input.keyboard.on('keydown', listener)`. - * + * * You can also listen for a specific key being pressed. See [Keyboard.Events.KEY_DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:KEY_DOWN} for details. - * + * * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:DOWN} for details. - * + * * _Note_: Many keyboards are unable to process certain combinations of keys due to hardware limitations known as ghosting. * Read [this article on ghosting]{@link http://www.html5gamedevs.com/topic/4876-impossible-to-use-more-than-2-keyboard-input-buttons-at-the-same-time/} for details. * @@ -103902,7 +104736,7 @@ module.exports = ResetKeyCombo; * * @event Phaser.Input.Keyboard.Events#ANY_KEY_DOWN * @since 3.0.0 - * + * * @param {KeyboardEvent} event - The native DOM Keyboard Event. You can inspect this to learn more about the key that was pressed, any modifiers, etc. */ module.exports = 'keydown'; @@ -103915,24 +104749,24 @@ module.exports = 'keydown'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Global Key Up Event. - * + * * This event is dispatched by the Keyboard Plugin when any key on the keyboard is released. - * + * * Listen to this event from within a Scene using: `this.input.keyboard.on('keyup', listener)`. - * + * * You can also listen for a specific key being released. See [Keyboard.Events.KEY_UP]{@linkcode Phaser.Input.Keyboard.Events#event:KEY_UP} for details. - * + * * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.UP]{@linkcode Phaser.Input.Keyboard.Events#event:UP} for details. * * @event Phaser.Input.Keyboard.Events#ANY_KEY_UP * @since 3.0.0 - * + * * @param {KeyboardEvent} event - The native DOM Keyboard Event. You can inspect this to learn more about the key that was released, any modifiers, etc. */ module.exports = 'keyup'; @@ -103945,17 +104779,17 @@ module.exports = 'keyup'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Key Combo Match Event. - * + * * This event is dispatched by the Keyboard Plugin when a [Key Combo]{@link Phaser.Input.Keyboard.KeyCombo} is matched. - * + * * Listen for this event from the Key Plugin after a combo has been created: - * + * * ```javascript * this.input.keyboard.createCombo([ 38, 38, 40, 40, 37, 39, 37, 39, 66, 65, 13 ], { resetOnMatch: true }); * @@ -103966,7 +104800,7 @@ module.exports = 'keyup'; * * @event Phaser.Input.Keyboard.Events#COMBO_MATCH * @since 3.0.0 - * + * * @param {Phaser.Input.Keyboard.KeyCombo} keycombo - The Key Combo object that was matched. * @param {KeyboardEvent} event - The native DOM Keyboard Event of the final key in the combo. You can inspect this to learn more about any modifiers, etc. */ @@ -103980,28 +104814,28 @@ module.exports = 'keycombomatch'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Key Down Event. - * + * * This event is dispatched by a [Key]{@link Phaser.Input.Keyboard.Key} object when it is pressed. - * + * * Listen for this event from the Key object instance directly: - * + * * ```javascript * var spaceBar = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE); - * + * * spaceBar.on('down', listener) * ``` - * + * * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_DOWN} for details. * * @event Phaser.Input.Keyboard.Events#DOWN * @since 3.0.0 - * + * * @param {Phaser.Input.Keyboard.Key} key - The Key object that was pressed. * @param {KeyboardEvent} event - The native DOM Keyboard Event. You can inspect this to learn more about any modifiers, etc. */ @@ -104015,24 +104849,24 @@ module.exports = 'down'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Key Down Event. - * + * * This event is dispatched by the Keyboard Plugin when any key on the keyboard is pressed down. - * + * * Unlike the `ANY_KEY_DOWN` event, this one has a special dynamic event name. For example, to listen for the `A` key being pressed * use the following from within a Scene: `this.input.keyboard.on('keydown-A', listener)`. You can replace the `-A` part of the event - * name with any valid [Key Code string]{@link Phaser.Input.Keyboard.KeyCodes}. For example, this will listen for the space bar: + * name with any valid [Key Code string]{@link Phaser.Input.Keyboard.KeyCodes}. For example, this will listen for the space bar: * `this.input.keyboard.on('keydown-SPACE', listener)`. - * + * * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_DOWN} for details. - * + * * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:DOWN} for details. - * + * * _Note_: Many keyboards are unable to process certain combinations of keys due to hardware limitations known as ghosting. * Read [this article on ghosting]{@link http://www.html5gamedevs.com/topic/4876-impossible-to-use-more-than-2-keyboard-input-buttons-at-the-same-time/} for details. * @@ -104042,7 +104876,7 @@ module.exports = 'down'; * * @event Phaser.Input.Keyboard.Events#KEY_DOWN * @since 3.0.0 - * + * * @param {KeyboardEvent} event - The native DOM Keyboard Event. You can inspect this to learn more about the key that was pressed, any modifiers, etc. */ module.exports = 'keydown-'; @@ -104055,27 +104889,27 @@ module.exports = 'keydown-'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Key Up Event. - * + * * This event is dispatched by the Keyboard Plugin when any key on the keyboard is released. - * + * * Unlike the `ANY_KEY_UP` event, this one has a special dynamic event name. For example, to listen for the `A` key being released * use the following from within a Scene: `this.input.keyboard.on('keyup-A', listener)`. You can replace the `-A` part of the event - * name with any valid [Key Code string]{@link Phaser.Input.Keyboard.KeyCodes}. For example, this will listen for the space bar: + * name with any valid [Key Code string]{@link Phaser.Input.Keyboard.KeyCodes}. For example, this will listen for the space bar: * `this.input.keyboard.on('keyup-SPACE', listener)`. - * + * * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_UP]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_UP} for details. - * + * * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.UP]{@linkcode Phaser.Input.Keyboard.Events#event:UP} for details. * * @event Phaser.Input.Keyboard.Events#KEY_UP * @since 3.0.0 - * + * * @param {KeyboardEvent} event - The native DOM Keyboard Event. You can inspect this to learn more about the key that was released, any modifiers, etc. */ module.exports = 'keyup-'; @@ -104088,28 +104922,28 @@ module.exports = 'keyup-'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Key Up Event. - * + * * This event is dispatched by a [Key]{@link Phaser.Input.Keyboard.Key} object when it is released. - * + * * Listen for this event from the Key object instance directly: - * + * * ```javascript * var spaceBar = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE); - * + * * spaceBar.on('up', listener) * ``` - * + * * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_UP]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_UP} for details. * * @event Phaser.Input.Keyboard.Events#UP * @since 3.0.0 - * + * * @param {Phaser.Input.Keyboard.Key} key - The Key object that was released. * @param {KeyboardEvent} event - The native DOM Keyboard Event. You can inspect this to learn more about any modifiers, etc. */ @@ -104123,7 +104957,7 @@ module.exports = 'up'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -104151,7 +104985,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -104190,7 +105024,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -104225,15 +105059,15 @@ module.exports = DownDuration; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The justDown value allows you to test if this Key has just been pressed down or not. - * + * * When you check this value it will return `true` if the Key is down, otherwise `false`. - * + * * You can only call justDown once per key press. It will only return `true` once, until the Key is released and pressed down again. * This allows you to use it in situations where you want to check if this key is down without using an event, such as in a core game loop. * @@ -104268,15 +105102,15 @@ module.exports = JustDown; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The justUp value allows you to test if this Key has just been released or not. - * + * * When you check this value it will return `true` if the Key is up, otherwise `false`. - * + * * You can only call JustUp once per key release. It will only return `true` once, until the Key is pressed down and released again. * This allows you to use it in situations where you want to check if this key is up without using an event, such as in a core game loop. * @@ -104311,7 +105145,7 @@ module.exports = JustUp; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -104485,7 +105319,7 @@ var Key = new Class({ /** * When a key is held down should it continuously fire the `down` event each time it repeats? - * + * * By default it will emit the `down` event just once, but if you wish to receive the event * for each repeat as well, enable this property. * @@ -104545,9 +105379,9 @@ var Key = new Class({ * * @method Phaser.Input.Keyboard.Key#setEmitOnRepeat * @since 3.16.0 - * + * * @param {boolean} value - Emit `down` events on repeated key down actions, or just once? - * + * * @return {this} This Key instance. */ setEmitOnRepeat: function (value) @@ -104564,7 +105398,7 @@ var Key = new Class({ * @method Phaser.Input.Keyboard.Key#onDown * @fires Phaser.Input.Keyboard.Events#DOWN * @since 3.16.0 - * + * * @param {KeyboardEvent} event - The native DOM Keyboard event. */ onDown: function (event) @@ -104581,7 +105415,7 @@ var Key = new Class({ this.shiftKey = event.shiftKey; this.metaKey = event.metaKey; this.location = event.location; - + this.repeats++; if (!this.isDown) @@ -104608,7 +105442,7 @@ var Key = new Class({ * @method Phaser.Input.Keyboard.Key#onUp * @fires Phaser.Input.Keyboard.Events#UP * @since 3.16.0 - * + * * @param {KeyboardEvent} event - The native DOM Keyboard event. */ onUp: function (event) @@ -104619,32 +105453,32 @@ var Key = new Class({ { return; } - + this.isDown = false; this.isUp = true; this.timeUp = event.timeStamp; this.duration = this.timeUp - this.timeDown; this.repeats = 0; - + this._justDown = false; this._justUp = true; this._tick = -1; - + this.emit(Events.UP, this, event); }, /** * Resets this Key object back to its default un-pressed state. * + * As of version 3.60.0 it no longer resets the `enabled` or `preventDefault` flags. + * * @method Phaser.Input.Keyboard.Key#reset * @since 3.6.0 - * + * * @return {this} This Key instance. */ reset: function () { - this.preventDefault = true; - this.enabled = true; this.isDown = false; this.isUp = true; this.altKey = false; @@ -104664,15 +105498,15 @@ var Key = new Class({ /** * Returns the duration, in ms, that the Key has been held down for. - * + * * If the key is not currently down it will return zero. - * - * The get the duration the Key was held down for in the previous up-down cycle, + * + * To get the duration the Key was held down for in the previous up-down cycle, * use the `Key.duration` property value instead. * * @method Phaser.Input.Keyboard.Key#getDuration * @since 3.17.0 - * + * * @return {number} The duration, in ms, that the Key has been held down for if currently down. */ getDuration: function () @@ -104714,7 +105548,7 @@ module.exports = Key; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -104730,7 +105564,7 @@ var KeyCodes = { /** * The BACKSPACE key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.BACKSPACE * @type {number} * @since 3.0.0 @@ -104739,7 +105573,7 @@ var KeyCodes = { /** * The TAB key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.TAB * @type {number} * @since 3.0.0 @@ -104748,7 +105582,7 @@ var KeyCodes = { /** * The ENTER key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.ENTER * @type {number} * @since 3.0.0 @@ -104757,7 +105591,7 @@ var KeyCodes = { /** * The SHIFT key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.SHIFT * @type {number} * @since 3.0.0 @@ -104766,7 +105600,7 @@ var KeyCodes = { /** * The CTRL key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.CTRL * @type {number} * @since 3.0.0 @@ -104775,7 +105609,7 @@ var KeyCodes = { /** * The ALT key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.ALT * @type {number} * @since 3.0.0 @@ -104784,7 +105618,7 @@ var KeyCodes = { /** * The PAUSE key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.PAUSE * @type {number} * @since 3.0.0 @@ -104793,7 +105627,7 @@ var KeyCodes = { /** * The CAPS_LOCK key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.CAPS_LOCK * @type {number} * @since 3.0.0 @@ -104802,7 +105636,7 @@ var KeyCodes = { /** * The ESC key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.ESC * @type {number} * @since 3.0.0 @@ -104811,7 +105645,7 @@ var KeyCodes = { /** * The SPACE key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.SPACE * @type {number} * @since 3.0.0 @@ -104820,7 +105654,7 @@ var KeyCodes = { /** * The PAGE_UP key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.PAGE_UP * @type {number} * @since 3.0.0 @@ -104829,7 +105663,7 @@ var KeyCodes = { /** * The PAGE_DOWN key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.PAGE_DOWN * @type {number} * @since 3.0.0 @@ -104838,7 +105672,7 @@ var KeyCodes = { /** * The END key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.END * @type {number} * @since 3.0.0 @@ -104847,7 +105681,7 @@ var KeyCodes = { /** * The HOME key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.HOME * @type {number} * @since 3.0.0 @@ -104856,7 +105690,7 @@ var KeyCodes = { /** * The LEFT key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.LEFT * @type {number} * @since 3.0.0 @@ -104865,7 +105699,7 @@ var KeyCodes = { /** * The UP key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.UP * @type {number} * @since 3.0.0 @@ -104874,7 +105708,7 @@ var KeyCodes = { /** * The RIGHT key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.RIGHT * @type {number} * @since 3.0.0 @@ -104883,7 +105717,7 @@ var KeyCodes = { /** * The DOWN key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.DOWN * @type {number} * @since 3.0.0 @@ -104892,7 +105726,7 @@ var KeyCodes = { /** * The PRINT_SCREEN key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.PRINT_SCREEN * @type {number} * @since 3.0.0 @@ -104901,7 +105735,7 @@ var KeyCodes = { /** * The INSERT key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.INSERT * @type {number} * @since 3.0.0 @@ -104910,7 +105744,7 @@ var KeyCodes = { /** * The DELETE key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.DELETE * @type {number} * @since 3.0.0 @@ -104919,7 +105753,7 @@ var KeyCodes = { /** * The ZERO key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.ZERO * @type {number} * @since 3.0.0 @@ -104928,7 +105762,7 @@ var KeyCodes = { /** * The ONE key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.ONE * @type {number} * @since 3.0.0 @@ -104937,7 +105771,7 @@ var KeyCodes = { /** * The TWO key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.TWO * @type {number} * @since 3.0.0 @@ -104946,7 +105780,7 @@ var KeyCodes = { /** * The THREE key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.THREE * @type {number} * @since 3.0.0 @@ -104955,7 +105789,7 @@ var KeyCodes = { /** * The FOUR key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.FOUR * @type {number} * @since 3.0.0 @@ -104964,7 +105798,7 @@ var KeyCodes = { /** * The FIVE key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.FIVE * @type {number} * @since 3.0.0 @@ -104973,7 +105807,7 @@ var KeyCodes = { /** * The SIX key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.SIX * @type {number} * @since 3.0.0 @@ -104982,7 +105816,7 @@ var KeyCodes = { /** * The SEVEN key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.SEVEN * @type {number} * @since 3.0.0 @@ -104991,7 +105825,7 @@ var KeyCodes = { /** * The EIGHT key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.EIGHT * @type {number} * @since 3.0.0 @@ -105000,7 +105834,7 @@ var KeyCodes = { /** * The NINE key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NINE * @type {number} * @since 3.0.0 @@ -105009,7 +105843,7 @@ var KeyCodes = { /** * The NUMPAD_ZERO key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_ZERO * @type {number} * @since 3.0.0 @@ -105018,7 +105852,7 @@ var KeyCodes = { /** * The NUMPAD_ONE key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_ONE * @type {number} * @since 3.0.0 @@ -105027,7 +105861,7 @@ var KeyCodes = { /** * The NUMPAD_TWO key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_TWO * @type {number} * @since 3.0.0 @@ -105036,7 +105870,7 @@ var KeyCodes = { /** * The NUMPAD_THREE key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_THREE * @type {number} * @since 3.0.0 @@ -105045,7 +105879,7 @@ var KeyCodes = { /** * The NUMPAD_FOUR key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_FOUR * @type {number} * @since 3.0.0 @@ -105054,7 +105888,7 @@ var KeyCodes = { /** * The NUMPAD_FIVE key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_FIVE * @type {number} * @since 3.0.0 @@ -105063,7 +105897,7 @@ var KeyCodes = { /** * The NUMPAD_SIX key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_SIX * @type {number} * @since 3.0.0 @@ -105072,7 +105906,7 @@ var KeyCodes = { /** * The NUMPAD_SEVEN key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_SEVEN * @type {number} * @since 3.0.0 @@ -105081,7 +105915,7 @@ var KeyCodes = { /** * The NUMPAD_EIGHT key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_EIGHT * @type {number} * @since 3.0.0 @@ -105090,7 +105924,7 @@ var KeyCodes = { /** * The NUMPAD_NINE key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_NINE * @type {number} * @since 3.0.0 @@ -105099,7 +105933,7 @@ var KeyCodes = { /** * The Numpad Addition (+) key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_ADD * @type {number} * @since 3.21.0 @@ -105108,7 +105942,7 @@ var KeyCodes = { /** * The Numpad Subtraction (-) key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_SUBTRACT * @type {number} * @since 3.21.0 @@ -105117,7 +105951,7 @@ var KeyCodes = { /** * The A key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.A * @type {number} * @since 3.0.0 @@ -105126,7 +105960,7 @@ var KeyCodes = { /** * The B key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.B * @type {number} * @since 3.0.0 @@ -105135,7 +105969,7 @@ var KeyCodes = { /** * The C key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.C * @type {number} * @since 3.0.0 @@ -105144,7 +105978,7 @@ var KeyCodes = { /** * The D key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.D * @type {number} * @since 3.0.0 @@ -105153,7 +105987,7 @@ var KeyCodes = { /** * The E key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.E * @type {number} * @since 3.0.0 @@ -105162,7 +105996,7 @@ var KeyCodes = { /** * The F key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F * @type {number} * @since 3.0.0 @@ -105171,7 +106005,7 @@ var KeyCodes = { /** * The G key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.G * @type {number} * @since 3.0.0 @@ -105180,7 +106014,7 @@ var KeyCodes = { /** * The H key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.H * @type {number} * @since 3.0.0 @@ -105189,7 +106023,7 @@ var KeyCodes = { /** * The I key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.I * @type {number} * @since 3.0.0 @@ -105198,7 +106032,7 @@ var KeyCodes = { /** * The J key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.J * @type {number} * @since 3.0.0 @@ -105207,7 +106041,7 @@ var KeyCodes = { /** * The K key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.K * @type {number} * @since 3.0.0 @@ -105216,7 +106050,7 @@ var KeyCodes = { /** * The L key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.L * @type {number} * @since 3.0.0 @@ -105225,7 +106059,7 @@ var KeyCodes = { /** * The M key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.M * @type {number} * @since 3.0.0 @@ -105234,7 +106068,7 @@ var KeyCodes = { /** * The N key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.N * @type {number} * @since 3.0.0 @@ -105243,7 +106077,7 @@ var KeyCodes = { /** * The O key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.O * @type {number} * @since 3.0.0 @@ -105252,7 +106086,7 @@ var KeyCodes = { /** * The P key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.P * @type {number} * @since 3.0.0 @@ -105261,7 +106095,7 @@ var KeyCodes = { /** * The Q key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.Q * @type {number} * @since 3.0.0 @@ -105270,7 +106104,7 @@ var KeyCodes = { /** * The R key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.R * @type {number} * @since 3.0.0 @@ -105279,7 +106113,7 @@ var KeyCodes = { /** * The S key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.S * @type {number} * @since 3.0.0 @@ -105288,7 +106122,7 @@ var KeyCodes = { /** * The T key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.T * @type {number} * @since 3.0.0 @@ -105297,7 +106131,7 @@ var KeyCodes = { /** * The U key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.U * @type {number} * @since 3.0.0 @@ -105306,7 +106140,7 @@ var KeyCodes = { /** * The V key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.V * @type {number} * @since 3.0.0 @@ -105315,7 +106149,7 @@ var KeyCodes = { /** * The W key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.W * @type {number} * @since 3.0.0 @@ -105324,7 +106158,7 @@ var KeyCodes = { /** * The X key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.X * @type {number} * @since 3.0.0 @@ -105333,7 +106167,7 @@ var KeyCodes = { /** * The Y key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.Y * @type {number} * @since 3.0.0 @@ -105342,7 +106176,7 @@ var KeyCodes = { /** * The Z key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.Z * @type {number} * @since 3.0.0 @@ -105351,7 +106185,7 @@ var KeyCodes = { /** * The F1 key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F1 * @type {number} * @since 3.0.0 @@ -105360,7 +106194,7 @@ var KeyCodes = { /** * The F2 key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F2 * @type {number} * @since 3.0.0 @@ -105369,7 +106203,7 @@ var KeyCodes = { /** * The F3 key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F3 * @type {number} * @since 3.0.0 @@ -105378,7 +106212,7 @@ var KeyCodes = { /** * The F4 key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F4 * @type {number} * @since 3.0.0 @@ -105387,7 +106221,7 @@ var KeyCodes = { /** * The F5 key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F5 * @type {number} * @since 3.0.0 @@ -105396,7 +106230,7 @@ var KeyCodes = { /** * The F6 key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F6 * @type {number} * @since 3.0.0 @@ -105405,7 +106239,7 @@ var KeyCodes = { /** * The F7 key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F7 * @type {number} * @since 3.0.0 @@ -105414,7 +106248,7 @@ var KeyCodes = { /** * The F8 key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F8 * @type {number} * @since 3.0.0 @@ -105423,7 +106257,7 @@ var KeyCodes = { /** * The F9 key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F9 * @type {number} * @since 3.0.0 @@ -105432,7 +106266,7 @@ var KeyCodes = { /** * The F10 key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F10 * @type {number} * @since 3.0.0 @@ -105441,7 +106275,7 @@ var KeyCodes = { /** * The F11 key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F11 * @type {number} * @since 3.0.0 @@ -105450,7 +106284,7 @@ var KeyCodes = { /** * The F12 key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.F12 * @type {number} * @since 3.0.0 @@ -105459,7 +106293,7 @@ var KeyCodes = { /** * The SEMICOLON key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.SEMICOLON * @type {number} * @since 3.0.0 @@ -105468,7 +106302,7 @@ var KeyCodes = { /** * The PLUS key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.PLUS * @type {number} * @since 3.0.0 @@ -105477,7 +106311,7 @@ var KeyCodes = { /** * The COMMA key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.COMMA * @type {number} * @since 3.0.0 @@ -105486,7 +106320,7 @@ var KeyCodes = { /** * The MINUS key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.MINUS * @type {number} * @since 3.0.0 @@ -105495,7 +106329,7 @@ var KeyCodes = { /** * The PERIOD key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.PERIOD * @type {number} * @since 3.0.0 @@ -105504,7 +106338,7 @@ var KeyCodes = { /** * The FORWARD_SLASH key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.FORWARD_SLASH * @type {number} * @since 3.0.0 @@ -105513,7 +106347,7 @@ var KeyCodes = { /** * The BACK_SLASH key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.BACK_SLASH * @type {number} * @since 3.0.0 @@ -105522,7 +106356,7 @@ var KeyCodes = { /** * The QUOTES key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.QUOTES * @type {number} * @since 3.0.0 @@ -105531,7 +106365,7 @@ var KeyCodes = { /** * The BACKTICK key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.BACKTICK * @type {number} * @since 3.0.0 @@ -105540,7 +106374,7 @@ var KeyCodes = { /** * The OPEN_BRACKET key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.OPEN_BRACKET * @type {number} * @since 3.0.0 @@ -105549,7 +106383,7 @@ var KeyCodes = { /** * The CLOSED_BRACKET key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.CLOSED_BRACKET * @type {number} * @since 3.0.0 @@ -105558,7 +106392,7 @@ var KeyCodes = { /** * The SEMICOLON_FIREFOX key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.SEMICOLON_FIREFOX * @type {number} * @since 3.0.0 @@ -105567,7 +106401,7 @@ var KeyCodes = { /** * The COLON key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.COLON * @type {number} * @since 3.0.0 @@ -105576,7 +106410,7 @@ var KeyCodes = { /** * The COMMA_FIREFOX_WINDOWS key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.COMMA_FIREFOX_WINDOWS * @type {number} * @since 3.0.0 @@ -105585,7 +106419,7 @@ var KeyCodes = { /** * The COMMA_FIREFOX key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.COMMA_FIREFOX * @type {number} * @since 3.0.0 @@ -105594,7 +106428,7 @@ var KeyCodes = { /** * The BRACKET_RIGHT_FIREFOX key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.BRACKET_RIGHT_FIREFOX * @type {number} * @since 3.0.0 @@ -105603,7 +106437,7 @@ var KeyCodes = { /** * The BRACKET_LEFT_FIREFOX key. - * + * * @name Phaser.Input.Keyboard.KeyCodes.BRACKET_LEFT_FIREFOX * @type {number} * @since 3.0.0 @@ -105621,7 +106455,7 @@ module.exports = KeyCodes; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -105644,7 +106478,7 @@ module.exports = KeyMap; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -105679,7 +106513,7 @@ module.exports = UpDuration; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -105949,11 +106783,11 @@ var MouseManager = new Class({ }, /** - * Attempts to disable the context menu from appearing if you right-click on the browser. + * Attempts to disable the context menu from appearing if you right-click on the game canvas, or specified input target. * * Works by listening for the `contextmenu` event and prevent defaulting it. * - * Use this if you need to enable right-button mouse support in your game, and the browser + * Use this if you need to enable right-button mouse support in your game, and the context * menu keeps getting in the way. * * @method Phaser.Input.Mouse.MouseManager#disableContextMenu @@ -105963,7 +106797,7 @@ var MouseManager = new Class({ */ disableContextMenu: function () { - document.body.addEventListener('contextmenu', function (event) + this.target.addEventListener('contextmenu', function (event) { event.preventDefault(); return false; @@ -106246,7 +107080,7 @@ module.exports = MouseManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -106258,7 +107092,7 @@ module.exports = MouseManager; module.exports = { MouseManager: __webpack_require__(7905) - + }; /* eslint-enable */ @@ -106270,7 +107104,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -106285,9 +107119,9 @@ var NOOP = __webpack_require__(72283); /** * @classdesc * The Touch Manager is a helper class that belongs to the Input Manager. - * + * * Its role is to listen for native DOM Touch Events and then pass them onto the Input Manager for further processing. - * + * * You do not need to create this class directly, the Input Manager will create an instance of it automatically. * * @class TouchManager @@ -106414,24 +107248,18 @@ var TouchManager = new Class({ this.onTouchCancelWindow = NOOP; /** - * The Touch Over event handler function. - * Initially empty and bound in the `startListeners` method. + * Are the event listeners hooked into `window.top` or `window`? * - * @name Phaser.Input.Touch.TouchManager#onTouchOver - * @type {function} - * @since 3.16.0 - */ - this.onTouchOver = NOOP; - - /** - * The Touch Out event handler function. - * Initially empty and bound in the `startListeners` method. + * This is set during the `boot` sequence. If the browser does not have access to `window.top`, + * such as in cross-origin iframe environments, this property gets set to `false` and the events + * are hooked into `window` instead. * - * @name Phaser.Input.Touch.TouchManager#onTouchOut - * @type {function} - * @since 3.16.0 + * @name Phaser.Input.Touch.TouchManager#isTop + * @type {boolean} + * @readonly + * @since 3.60.0 */ - this.onTouchOut = NOOP; + this.isTop = true; inputManager.events.once(InputEvents.MANAGER_BOOT, this.boot, this); }, @@ -106455,6 +107283,10 @@ var TouchManager = new Class({ { this.target = this.manager.game.canvas; } + else if (typeof this.target === 'string') + { + this.target = document.getElementById(this.target); + } if (config.disableContextMenu) { @@ -106469,9 +107301,9 @@ var TouchManager = new Class({ /** * Attempts to disable the context menu from appearing if you touch-hold on the browser. - * + * * Works by listening for the `contextmenu` event and prevent defaulting it. - * + * * Use this if you need to disable the OS context menu on mobile. * * @method Phaser.Input.Touch.TouchManager#disableContextMenu @@ -106481,7 +107313,7 @@ var TouchManager = new Class({ */ disableContextMenu: function () { - document.body.addEventListener('contextmenu', function (event) + this.target.addEventListener('contextmenu', function (event) { event.preventDefault(); return false; @@ -106492,7 +107324,7 @@ var TouchManager = new Class({ /** * Starts the Touch Event listeners running as long as an input target is set. - * + * * This method is called automatically if Touch Input is enabled in the game config, * which it is by default. However, you can call it manually should you need to * delay input capturing until later in the game. @@ -106502,9 +107334,30 @@ var TouchManager = new Class({ */ startListeners: function () { + var target = this.target; + + if (!target) + { + return; + } + var _this = this; - var canvas = this.manager.canvas; - var autoFocus = (window && window.focus && this.manager.game.config.autoFocus); + var manager = this.manager; + var canvas = manager.canvas; + var autoFocus = (window && window.focus && manager.game.config.autoFocus); + + this.onTouchMove = function (event) + { + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled) + { + manager.onTouchMove(event); + + if (_this.capture && event.cancelable) + { + event.preventDefault(); + } + } + }; this.onTouchStart = function (event) { @@ -106513,10 +107366,10 @@ var TouchManager = new Class({ window.focus(); } - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled) { - _this.manager.onTouchStart(event); - + manager.onTouchStart(event); + if (_this.capture && event.cancelable && event.target === canvas) { event.preventDefault(); @@ -106526,32 +107379,19 @@ var TouchManager = new Class({ this.onTouchStartWindow = function (event) { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled && event.target !== canvas) + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled && event.target !== canvas) { // Only process the event if the target isn't the canvas - _this.manager.onTouchStart(event); - } - }; - - this.onTouchMove = function (event) - { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) - { - _this.manager.onTouchMove(event); - - if (_this.capture && event.cancelable) - { - event.preventDefault(); - } + manager.onTouchStart(event); } }; this.onTouchEnd = function (event) { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled) { - _this.manager.onTouchEnd(event); - + manager.onTouchEnd(event); + if (_this.capture && event.cancelable && event.target === canvas) { event.preventDefault(); @@ -106561,19 +107401,19 @@ var TouchManager = new Class({ this.onTouchEndWindow = function (event) { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled && event.target !== canvas) + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled && event.target !== canvas) { // Only process the event if the target isn't the canvas - _this.manager.onTouchEnd(event); + manager.onTouchEnd(event); } }; this.onTouchCancel = function (event) { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled) { - _this.manager.onTouchCancel(event); - + manager.onTouchCancel(event); + if (_this.capture) { event.preventDefault(); @@ -106583,50 +107423,37 @@ var TouchManager = new Class({ this.onTouchCancelWindow = function (event) { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled) { - _this.manager.onTouchCancel(event); + manager.onTouchCancel(event); } }; - this.onTouchOver = function (event) - { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) - { - _this.manager.setCanvasOver(event); - } - }; - - this.onTouchOut = function (event) - { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) - { - _this.manager.setCanvasOut(event); - } - }; - - var target = this.target; - - if (!target) - { - return; - } - + var capture = this.capture; var passive = { passive: true }; var nonPassive = { passive: false }; - target.addEventListener('touchstart', this.onTouchStart, (this.capture) ? nonPassive : passive); - target.addEventListener('touchmove', this.onTouchMove, (this.capture) ? nonPassive : passive); - target.addEventListener('touchend', this.onTouchEnd, (this.capture) ? nonPassive : passive); - target.addEventListener('touchcancel', this.onTouchCancel, (this.capture) ? nonPassive : passive); - target.addEventListener('touchover', this.onTouchOver, (this.capture) ? nonPassive : passive); - target.addEventListener('touchout', this.onTouchOut, (this.capture) ? nonPassive : passive); + target.addEventListener('touchstart', this.onTouchStart, (capture) ? nonPassive : passive); + target.addEventListener('touchmove', this.onTouchMove, (capture) ? nonPassive : passive); + target.addEventListener('touchend', this.onTouchEnd, (capture) ? nonPassive : passive); + target.addEventListener('touchcancel', this.onTouchCancel, (capture) ? nonPassive : passive); - if (window && this.manager.game.config.inputWindowEvents) + if (window && manager.game.config.inputWindowEvents) { - window.addEventListener('touchstart', this.onTouchStartWindow, nonPassive); - window.addEventListener('touchend', this.onTouchEndWindow, nonPassive); - window.addEventListener('touchcancel', this.onTouchCancelWindow, nonPassive); + try + { + window.top.addEventListener('touchstart', this.onTouchStartWindow, nonPassive); + window.top.addEventListener('touchend', this.onTouchEndWindow, nonPassive); + window.top.addEventListener('touchcancel', this.onTouchCancelWindow, nonPassive); + } + catch (exception) + { + window.addEventListener('touchstart', this.onTouchStartWindow, nonPassive); + window.addEventListener('touchend', this.onTouchEndWindow, nonPassive); + window.addEventListener('touchcancel', this.onTouchCancelWindow, nonPassive); + + this.isTop = false; + } } this.enabled = true; @@ -106647,13 +107474,14 @@ var TouchManager = new Class({ target.removeEventListener('touchmove', this.onTouchMove); target.removeEventListener('touchend', this.onTouchEnd); target.removeEventListener('touchcancel', this.onTouchCancel); - target.removeEventListener('touchover', this.onTouchOver); - target.removeEventListener('touchout', this.onTouchOut); if (window) { - window.removeEventListener('touchstart', this.onTouchStartWindow); - window.removeEventListener('touchend', this.onTouchEndWindow); + target = (this.isTop) ? window.top : window; + + target.removeEventListener('touchstart', this.onTouchStartWindow); + target.removeEventListener('touchend', this.onTouchEndWindow); + target.removeEventListener('touchcancel', this.onTouchCancelWindow); } }, @@ -106684,7 +107512,7 @@ module.exports = TouchManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -106696,7 +107524,7 @@ module.exports = TouchManager; module.exports = { TouchManager: __webpack_require__(37579) - + }; /* eslint-enable */ @@ -106708,7 +107536,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -106767,6 +107595,11 @@ var File = new Class({ */ this.type = GetFastValue(fileConfig, 'type', false); + if (!this.type) + { + throw new Error('Invalid File type: ' + this.type); + } + /** * Unique cache key (unique within its file type) * @@ -106783,9 +107616,9 @@ var File = new Class({ this.key = loader.prefix + loadKey; } - if (!this.type || !this.key) + if (!this.key) { - throw new Error('Invalid Loader.' + this.type + ' key'); + throw new Error('Invalid File key: ' + this.key); } var url = GetFastValue(fileConfig, 'url'); @@ -107018,10 +107851,10 @@ var File = new Class({ */ onLoad: function (xhr, event) { - // On iOS, Capacitor often runs on a capacitor:// protocol, meaning local files are served from capacitor:// rather than file:// - // See: https://github.com/photonstorm/phaser/issues/5685 - - var isLocalFile = xhr.responseURL && (xhr.responseURL.indexOf('file://') === 0 || xhr.responseURL.indexOf('capacitor://') === 0); + var isLocalFile = xhr.responseURL && this.loader.localSchemes.some(function (scheme) + { + return xhr.responseURL.indexOf(scheme) === 0; + }); var localFileOk = (isLocalFile && event.target.status === 0); @@ -107157,12 +107990,10 @@ var File = new Class({ */ addToCache: function () { - if (this.cache) + if (this.cache && this.data) { this.cache.add(this.key, this.data); } - - this.pendingDestroy(); }, /** @@ -107176,6 +108007,11 @@ var File = new Class({ */ pendingDestroy: function (data) { + if (this.state === CONST.FILE_PENDING_DESTROY) + { + return; + } + if (data === undefined) { data = this.data; } var key = this.key; @@ -107185,6 +108021,8 @@ var File = new Class({ this.loader.emit(Events.FILE_KEY_COMPLETE + type + '-' + key, key, type, data); this.loader.flagForRemoval(this); + + this.state = CONST.FILE_PENDING_DESTROY; }, /** @@ -107267,7 +108105,7 @@ module.exports = File; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -107281,13 +108119,13 @@ var FileTypesManager = { /** * Static method called when a LoaderPlugin is created. - * + * * Loops through the local types object and injects all of them as * properties into the LoaderPlugin instance. * * @method Phaser.Loader.FileTypesManager.install * @since 3.0.0 - * + * * @param {Phaser.Loader.LoaderPlugin} loader - The LoaderPlugin to install the types into. */ install: function (loader) @@ -107300,12 +108138,12 @@ var FileTypesManager = { /** * Static method called directly by the File Types. - * + * * The key is a reference to the function used to load the files via the Loader, i.e. `image`. * * @method Phaser.Loader.FileTypesManager.register * @since 3.0.0 - * + * * @param {string} key - The key that will be used as the method name in the LoaderPlugin. * @param {function} factoryFunction - The function that will be called when LoaderPlugin.key is invoked. */ @@ -107337,7 +108175,7 @@ module.exports = FileTypesManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -107379,7 +108217,7 @@ module.exports = GetURL; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -107390,6 +108228,7 @@ var EventEmitter = __webpack_require__(6659); var Events = __webpack_require__(683); var FileTypesManager = __webpack_require__(76846); var GetFastValue = __webpack_require__(72632); +var GetValue = __webpack_require__(10850); var PluginCache = __webpack_require__(91963); var SceneEvents = __webpack_require__(7599); var XHRSettings = __webpack_require__(33868); @@ -107595,6 +108434,18 @@ var LoaderPlugin = new Class({ */ this.imageLoadType = GetFastValue(sceneConfig, 'imageLoadType', gameConfig.loaderImageLoadType); + /** + * An array of all schemes that the Loader considers as being 'local'. + * + * This is populated by the `Phaser.Core.Config#loaderLocalScheme` game configuration setting and defaults to + * `[ 'file://', 'capacitor://' ]`. Additional local schemes can be added to this array as needed. + * + * @name Phaser.Loader.LoaderPlugin#localSchemes + * @type {string[]} + * @since 3.60.0 + */ + this.localSchemes = GetFastValue(sceneConfig, 'localScheme', gameConfig.loaderLocalScheme); + /** * The total number of files to load. It may not always be accurate because you may add to the Loader during the process * of loading, especially if you load a Pack File. Therefore this value can change, but in most cases remains static. @@ -107982,9 +108833,13 @@ var LoaderPlugin = new Class({ addPack: function (pack, packKey) { // if no packKey provided we'll add everything to the queue - if (packKey && pack.hasOwnProperty(packKey)) + if (typeof(packKey) === 'string') { - pack = { packKey: pack[packKey] }; + var subPack = GetValue(pack, packKey); + if (subPack) + { + pack = { packKey: subPack }; + } } var total = 0; @@ -108268,12 +109123,14 @@ var LoaderPlugin = new Class({ { // If we got here then all files the link file needs are ready to add to the cache file.multiFile.addToCache(); + file.multiFile.pendingDestroy(); } } else { // If we got here, then the file processed, so let it add itself to its cache file.addToCache(); + file.pendingDestroy(); } } @@ -108472,7 +109329,7 @@ module.exports = LoaderPlugin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -108521,11 +109378,13 @@ module.exports = MergeXHRSettings; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var Class = __webpack_require__(56694); +var CONST = __webpack_require__(12117); +var Events = __webpack_require__(683); /** * @classdesc @@ -108607,6 +109466,15 @@ var MultiFile = new Class({ */ this.files = finalFiles; + /** + * The current state of the file. One of the FILE_CONST values. + * + * @name Phaser.Loader.MultiFile#state + * @type {number} + * @since 3.60.0 + */ + this.state = CONST.FILE_PENDING; + /** * The completion status of this MultiFile. * @@ -108756,6 +109624,53 @@ var MultiFile = new Class({ // eslint-disable-next-line no-console console.error('File failed: %s "%s" (via %s "%s")', this.type, this.key, file.type, file.key); } + }, + + /** + * Called once all children of this multi file have been added to their caches and is now + * ready for deletion from the Loader. + * + * It will emit a `filecomplete` event from the LoaderPlugin. + * + * @method Phaser.Loader.MultiFile#pendingDestroy + * @fires Phaser.Loader.Events#FILE_COMPLETE + * @fires Phaser.Loader.Events#FILE_KEY_COMPLETE + * @since 3.60.0 + */ + pendingDestroy: function () + { + if (this.state === CONST.FILE_PENDING_DESTROY) + { + return; + } + + var key = this.key; + var type = this.type; + + this.loader.emit(Events.FILE_COMPLETE, key, type); + this.loader.emit(Events.FILE_KEY_COMPLETE + type + '-' + key, key, type); + + this.loader.flagForRemoval(this); + + for (var i = 0; i < this.files.length; i++) + { + this.files[i].pendingDestroy(); + } + + this.state = CONST.FILE_PENDING_DESTROY; + }, + + /** + * Destroy this Multi File and any references it holds. + * + * @method Phaser.Loader.MultiFile#destroy + * @since 3.60.0 + */ + destroy: function () + { + this.loader = null; + this.files = null; + this.config = null; } }); @@ -108770,7 +109685,7 @@ module.exports = MultiFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -108852,7 +109767,7 @@ module.exports = XHRLoader; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -108923,7 +109838,7 @@ module.exports = XHRSettings; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -108931,7 +109846,7 @@ var FILE_CONST = { /** * The Loader is idle. - * + * * @name Phaser.Loader.LOADER_IDLE * @type {number} * @since 3.0.0 @@ -108940,7 +109855,7 @@ var FILE_CONST = { /** * The Loader is actively loading. - * + * * @name Phaser.Loader.LOADER_LOADING * @type {number} * @since 3.0.0 @@ -108949,7 +109864,7 @@ var FILE_CONST = { /** * The Loader is processing files is has loaded. - * + * * @name Phaser.Loader.LOADER_PROCESSING * @type {number} * @since 3.0.0 @@ -108958,7 +109873,7 @@ var FILE_CONST = { /** * The Loader has completed loading and processing. - * + * * @name Phaser.Loader.LOADER_COMPLETE * @type {number} * @since 3.0.0 @@ -108967,7 +109882,7 @@ var FILE_CONST = { /** * The Loader is shutting down. - * + * * @name Phaser.Loader.LOADER_SHUTDOWN * @type {number} * @since 3.0.0 @@ -108976,7 +109891,7 @@ var FILE_CONST = { /** * The Loader has been destroyed. - * + * * @name Phaser.Loader.LOADER_DESTROYED * @type {number} * @since 3.0.0 @@ -108984,8 +109899,8 @@ var FILE_CONST = { LOADER_DESTROYED: 5, /** - * File is in the load queue but not yet started - * + * File is in the load queue but not yet started. + * * @name Phaser.Loader.FILE_PENDING * @type {number} * @since 3.0.0 @@ -108994,7 +109909,7 @@ var FILE_CONST = { /** * File has been started to load by the loader (onLoad called) - * + * * @name Phaser.Loader.FILE_LOADING * @type {number} * @since 3.0.0 @@ -109002,8 +109917,8 @@ var FILE_CONST = { FILE_LOADING: 11, /** - * File has loaded successfully, awaiting processing - * + * File has loaded successfully, awaiting processing. + * * @name Phaser.Loader.FILE_LOADED * @type {number} * @since 3.0.0 @@ -109011,8 +109926,8 @@ var FILE_CONST = { FILE_LOADED: 12, /** - * File failed to load - * + * File failed to load. + * * @name Phaser.Loader.FILE_FAILED * @type {number} * @since 3.0.0 @@ -109021,7 +109936,7 @@ var FILE_CONST = { /** * File is being processed (onProcess callback) - * + * * @name Phaser.Loader.FILE_PROCESSING * @type {number} * @since 3.0.0 @@ -109030,7 +109945,7 @@ var FILE_CONST = { /** * The File has errored somehow during processing. - * + * * @name Phaser.Loader.FILE_ERRORED * @type {number} * @since 3.0.0 @@ -109039,7 +109954,7 @@ var FILE_CONST = { /** * File has finished processing. - * + * * @name Phaser.Loader.FILE_COMPLETE * @type {number} * @since 3.0.0 @@ -109047,8 +109962,8 @@ var FILE_CONST = { FILE_COMPLETE: 17, /** - * File has been destroyed - * + * File has been destroyed. + * * @name Phaser.Loader.FILE_DESTROYED * @type {number} * @since 3.0.0 @@ -109056,13 +109971,22 @@ var FILE_CONST = { FILE_DESTROYED: 18, /** - * File was populated from local data and doesn't need an HTTP request - * + * File was populated from local data and doesn't need an HTTP request. + * * @name Phaser.Loader.FILE_POPULATED * @type {number} * @since 3.0.0 */ - FILE_POPULATED: 19 + FILE_POPULATED: 19, + + /** + * File is pending being destroyed. + * + * @name Phaser.Loader.FILE_PENDING_DESTROY + * @type {number} + * @since 3.60.0 + */ + FILE_PENDING_DESTROY: 20 }; @@ -109076,7 +110000,7 @@ module.exports = FILE_CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -109107,7 +110031,7 @@ module.exports = 'addfile'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -109136,25 +110060,27 @@ module.exports = 'complete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The File Load Complete Event. - * - * This event is dispatched by the Loader Plugin when any file in the queue finishes loading. - * + * + * This event is dispatched by the Loader Plugin when _any_ file in the queue finishes loading. + * * Listen to it from a Scene using: `this.load.on('filecomplete', listener)`. - * + * + * Make sure you remove this listener when you have finished, or it will continue to fire if the Scene reloads. + * * You can also listen for the completion of a specific file. See the [FILE_KEY_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_KEY_COMPLETE} event. * * @event Phaser.Loader.Events#FILE_COMPLETE * @since 3.0.0 - * + * * @param {string} key - The key of the file that just loaded and finished processing. * @param {string} type - The [file type]{@link Phaser.Loader.File#type} of the file that just loaded, i.e. `image`. - * @param {any} data - The raw data the file contained. + * @param {any} [data] - The raw data the file contained. If the file was a multi-file, like an atlas or bitmap font, this parameter will be undefined. */ module.exports = 'filecomplete'; @@ -109166,17 +110092,17 @@ module.exports = 'filecomplete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The File Load Complete Event. - * + * * This event is dispatched by the Loader Plugin when any file in the queue finishes loading. - * + * * It uses a special dynamic event name constructed from the key and type of the file. - * + * * For example, if you have loaded an `image` with a key of `monster`, you can listen for it * using the following: * @@ -109187,29 +110113,31 @@ module.exports = 'filecomplete'; * ``` * * Or, if you have loaded a texture `atlas` with a key of `Level1`: - * + * * ```javascript * this.load.on('filecomplete-atlas-Level1', function (key, type, data) { * // Your handler code * }); * ``` - * + * * Or, if you have loaded a sprite sheet with a key of `Explosion` and a prefix of `GAMEOVER`: - * + * * ```javascript * this.load.on('filecomplete-spritesheet-GAMEOVERExplosion', function (key, type, data) { * // Your handler code * }); * ``` - * + * + * Make sure you remove your listeners when you have finished, or they will continue to fire if the Scene reloads. + * * You can also listen for the generic completion of files. See the [FILE_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_COMPLETE} event. * * @event Phaser.Loader.Events#FILE_KEY_COMPLETE * @since 3.0.0 - * + * * @param {string} key - The key of the file that just loaded and finished processing. * @param {string} type - The [file type]{@link Phaser.Loader.File#type} of the file that just loaded, i.e. `image`. - * @param {any} data - The raw data the file contained. + * @param {any} [data] - The raw data the file contained. If the file was a multi-file, like an atlas or bitmap font, this parameter will be undefined. */ module.exports = 'filecomplete-'; @@ -109221,7 +110149,7 @@ module.exports = 'filecomplete-'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -109247,7 +110175,7 @@ module.exports = 'loaderror'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -109274,7 +110202,7 @@ module.exports = 'load'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -109302,7 +110230,7 @@ module.exports = 'fileprogress'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -109332,7 +110260,7 @@ module.exports = 'postprocess'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -109358,22 +110286,22 @@ module.exports = 'progress'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Loader Plugin Start Event. - * + * * This event is dispatched when the Loader starts running. At this point load progress is zero. - * + * * This event is dispatched even if there aren't any files in the load queue. - * + * * Listen to it from a Scene using: `this.load.on('start', listener)`. * * @event Phaser.Loader.Events#START * @since 3.0.0 - * + * * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. */ module.exports = 'start'; @@ -109386,7 +110314,7 @@ module.exports = 'start'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -109417,7 +110345,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -109619,7 +110547,7 @@ module.exports = AnimationJSONFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -109890,7 +110818,7 @@ module.exports = AsepriteFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -109990,8 +110918,6 @@ var AtlasJSONFile = new Class({ this.loader.textureManager.addAtlas(image.key, image.data, json.data, normalMap); - json.pendingDestroy(); - this.complete = true; } } @@ -110022,7 +110948,16 @@ var AtlasJSONFile = new Class({ * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details. * * Phaser expects the atlas data to be provided in a JSON file, using either the JSON Hash or JSON Array format. - * These files are created by software such as Texture Packer, Shoebox and Adobe Flash / Animate. + * + * These files are created by software such as: + * + * * [Texture Packer](https://www.codeandweb.com/texturepacker/tutorials/how-to-create-sprite-sheets-for-phaser3?source=photonstorm) + * * [Shoebox](https://renderhjs.net/shoebox/) + * * [Gamma Texture Packer](https://gammafp.com/tool/atlas-packer/) + * * [Adobe Flash / Animate](https://www.adobe.com/uk/products/animate.html) + * * [Free Texture Packer](http://free-tex-packer.com/) + * * [Leshy SpriteSheet Tool](https://www.leshylabs.com/apps/sstool/) + * * If you are using Texture Packer and have enabled multi-atlas support, then please use the Phaser Multi Atlas loader * instead of this one. * @@ -110140,7 +111075,7 @@ module.exports = AtlasJSONFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -110238,8 +111173,6 @@ var AtlasXMLFile = new Class({ this.loader.textureManager.addAtlasXML(image.key, image.data, xml.data, normalMap); - xml.pendingDestroy(); - this.complete = true; } } @@ -110384,7 +111317,7 @@ module.exports = AtlasXMLFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -110412,7 +111345,7 @@ var IsPlainObject = __webpack_require__(42911); * * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. * @param {(string|Phaser.Types.Loader.FileTypes.AudioFileConfig)} key - The key to use for this file, or a file configuration object. - * @param {any} [urlConfig] - The absolute or relative URL to load this file from in a config object. + * @param {Phaser.Types.Loader.FileTypes.AudioFileURLConfig} [urlConfig] - The absolute or relative URL to load this file from in a config object. * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. * @param {AudioContext} [audioContext] - The AudioContext this file will use to process itself. */ @@ -110603,7 +111536,7 @@ AudioFile.getAudioURL = function (game, urls) * @since 3.0.0 * * @param {(string|Phaser.Types.Loader.FileTypes.AudioFileConfig|Phaser.Types.Loader.FileTypes.AudioFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. - * @param {(string|string[])} [urls] - The absolute or relative URL to load the audio files from. + * @param {(string|string[]|Phaser.Types.Loader.FileTypes.AudioFileURLConfig|Phaser.Types.Loader.FileTypes.AudioFileURLConfig[])} [urls] - The absolute or relative URL to load the audio files from. * @param {any} [config] - An object containing an `instances` property for HTML5Audio. Defaults to 1. * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. * @@ -110659,7 +111592,7 @@ module.exports = AudioFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -110950,7 +111883,7 @@ FileTypesManager.register('audioSprite', function (key, jsonURL, audioURL, audio /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -111133,7 +112066,7 @@ module.exports = BinaryFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -111230,7 +112163,6 @@ var BitmapFontFile = new Class({ var xml = this.files[1]; image.addToCache(); - xml.pendingDestroy(); var texture = image.cache.get(image.key); @@ -111381,7 +112313,7 @@ module.exports = BitmapFontFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -111560,6 +112492,7 @@ var Class = __webpack_require__(56694); var FileTypesManager = __webpack_require__(76846); var GetFastValue = __webpack_require__(72632); var ImageFile = __webpack_require__(42927); +var IsPlainObject = __webpack_require__(42911); var JSONFile = __webpack_require__(70806); var KTXParser = __webpack_require__(67409); var Merge = __webpack_require__(30657); @@ -111773,11 +112706,6 @@ var CompressedTextureFile = new Class({ textureManager.addCompressedTexture(image.key, textureData, atlasData); } - - if (json) - { - json.pendingDestroy(); - } } this.complete = true; @@ -111860,11 +112788,6 @@ var CompressedTextureFile = new Class({ textureManager.addAtlasJSONArray(this.key, images, data, normalMaps); this.complete = true; - - for (i = 0; i < this.files.length; i++) - { - this.files[i].pendingDestroy(); - } } }); @@ -111924,6 +112847,22 @@ var CompressedTextureFile = new Class({ * * When loading a Multi Atlas you do not need to specify the `textureURL` property as it will be read from the JSON file. * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.texture({ + * key: 'yourPic', + * url: { + * ASTC: { type: 'PVR', textureURL: 'pic-astc-4x4.pvr' }, + * PVRTC: { type: 'PVR', textureURL: 'pic-pvrtc-4bpp-rgba.pvr' }, + * S3TC: { type: 'PVR', textureURL: 'pic-dxt5.pvr' }, + * IMG: { textureURL: 'pic.png' } + * } + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.CompressedTextureFileConfig` for more details. + * * The number of formats you provide to this function is up to you, but you should ensure you * cover the primary platforms where appropriate. * @@ -111986,71 +112925,102 @@ var CompressedTextureFile = new Class({ * @fires Phaser.Loader.LoaderPlugin#ADD * @since 3.60.0 * - * @param {string} key - The key to use for this file within the Texture Manager. - * @param {Phaser.Types.Loader.FileTypes.CompressedTextureFileConfig} urls - The compressed texture configuration object. + * @param {(string|Phaser.Types.Loader.FileTypes.CompressedTextureFileConfig|Phaser.Types.Loader.FileTypes.CompressedTextureFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {Phaser.Types.Loader.FileTypes.CompressedTextureFileConfig} [url] - The compressed texture configuration object. Not required if passing a config object as the `key` parameter. * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. * * @return {this} The Loader instance. */ -FileTypesManager.register('texture', function (key, urls, xhrSettings) +FileTypesManager.register('texture', function (key, url, xhrSettings) { - var entry = { - format: null, - type: null, - textureURL: null, - atlasURL: null, - multiAtlasURL: null, - multiPath: null, - multiBaseURL: null - }; - var renderer = this.systems.renderer; - for (var textureBaseFormat in urls) + var AddEntry = function (loader, key, urls, xhrSettings) { - if (renderer.supportsCompressedTexture(textureBaseFormat)) - { - var urlEntry = urls[textureBaseFormat]; + var entry = { + format: null, + type: null, + textureURL: undefined, + atlasURL: undefined, + multiAtlasURL: undefined, + multiPath: undefined, + multiBaseURL: undefined + }; - if (typeof urlEntry === 'string') + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + urls = GetFastValue(config, 'url'), + xhrSettings = GetFastValue(config, 'xhrSettings'); + } + + var matched = false; + + for (var textureBaseFormat in urls) + { + if (renderer.supportsCompressedTexture(textureBaseFormat)) { - entry.textureURL = urlEntry; + var urlEntry = urls[textureBaseFormat]; + + if (typeof urlEntry === 'string') + { + entry.textureURL = urlEntry; + } + else + { + entry = Merge(urlEntry, entry); + } + + entry.format = textureBaseFormat.toUpperCase(); + + matched = true; + + break; + } + } + + if (!matched) + { + console.warn('No supported compressed texture format or IMG fallback', key); + } + else if (entry.format === 'IMG') + { + var multifile; + if (entry.multiAtlasURL) + { + multifile = new MultiAtlasFile(this, key, entry.multiAtlasURL, entry.multiPath, entry.multiBaseURL, xhrSettings); + loader.addFile(multifile.files); + } + else if (entry.atlasURL) + { + multifile = new AtlasJSONFile(loader, key, entry.textureURL, entry.atlasURL, xhrSettings); + loader.addFile(multifile.files); } else { - entry = Merge(urlEntry, entry); + loader.addFile(new ImageFile(loader, key, entry.textureURL, xhrSettings)); } - - entry.format = textureBaseFormat.toUpperCase(); - - break; - } - } - - if (!entry) - { - console.warn('No supported texture format or IMG fallback', key); - } - else if (entry.format === 'IMG') - { - if (entry.multiAtlasURL) - { - this.addFile(new MultiAtlasFile(this, key, entry.multiAtlasURL, entry.multiPath, entry.multiBaseURL, xhrSettings)); - } - else if (entry.atlasURL) - { - this.addFile(new AtlasJSONFile(this, key, entry.textureURL, entry.atlasURL, xhrSettings)); } else { - this.addFile(new ImageFile(this, key, entry.textureURL, xhrSettings)); + var texture = new CompressedTextureFile(loader, key, entry, xhrSettings); + + loader.addFile(texture.files); + } + }; + + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + AddEntry(this, key[i]); } } else { - var texture = new CompressedTextureFile(this, key, entry, xhrSettings); - - this.addFile(texture.files); + AddEntry(this, key, url, xhrSettings); } return this; @@ -112066,7 +113036,7 @@ module.exports = CompressedTextureFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -112216,8 +113186,6 @@ var GLSLFile = new Class({ { this.cache.add(this.key, new Shader(this.key, '', this.data)); } - - this.pendingDestroy(); }, /** @@ -112478,7 +113446,7 @@ module.exports = GLSLFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -112494,7 +113462,7 @@ var IsPlainObject = __webpack_require__(42911); * A single Audio File suitable for loading by the Loader. * * These are created when you use the Phaser.Loader.LoaderPlugin#audio method and are not typically created directly. - * + * * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#audio. * * @class HTML5AudioFile @@ -112682,7 +113650,7 @@ module.exports = HTML5AudioFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -112858,7 +113826,7 @@ module.exports = HTMLFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -113001,9 +113969,7 @@ var HTMLTextureFile = new Class({ */ addToCache: function () { - var texture = this.cache.addImage(this.key, this.data); - - this.pendingDestroy(texture); + this.cache.addImage(this.key, this.data); } }); @@ -113117,7 +114083,7 @@ module.exports = HTMLTextureFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -113318,29 +114284,22 @@ var ImageFile = new Class({ */ addToCache: function () { - var texture; var linkFile = this.linkFile; - if (linkFile && linkFile.state === CONST.FILE_COMPLETE) + if (linkFile && linkFile.state >= CONST.FILE_COMPLETE) { if (this.type === 'image') { - texture = this.cache.addImage(this.key, this.data, linkFile.data); + this.cache.addImage(this.key, this.data, linkFile.data); } else { - texture = this.cache.addImage(linkFile.key, linkFile.data, this.data); + this.cache.addImage(linkFile.key, linkFile.data, this.data); } - - this.pendingDestroy(texture); - - linkFile.pendingDestroy(texture); } else if (!linkFile) { - texture = this.cache.addImage(this.key, this.data); - - this.pendingDestroy(texture); + this.cache.addImage(this.key, this.data); } } @@ -113469,7 +114428,7 @@ module.exports = ImageFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -113709,7 +114668,7 @@ module.exports = JSONFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -113913,11 +114872,6 @@ var MultiAtlasFile = new Class({ this.loader.textureManager.addAtlasJSONArray(this.key, images, data, normalMaps); this.complete = true; - - for (i = 0; i < this.files.length; i++) - { - this.files[i].pendingDestroy(); - } } } @@ -114043,7 +114997,7 @@ module.exports = MultiAtlasFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -114261,7 +115215,7 @@ module.exports = MultiScriptFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -114516,7 +115470,7 @@ module.exports = OBJFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -114735,7 +115689,7 @@ module.exports = PackFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -114948,7 +115902,7 @@ module.exports = PluginFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -115135,9 +116089,7 @@ var SVGFile = new Class({ */ addToCache: function () { - var texture = this.cache.addImage(this.key, this.data); - - this.pendingDestroy(texture); + this.cache.addImage(this.key, this.data); } }); @@ -115288,7 +116240,7 @@ module.exports = SVGFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -115509,7 +116461,7 @@ module.exports = SceneFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -115716,7 +116668,7 @@ module.exports = ScenePluginFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -115744,6 +116696,7 @@ var IsPlainObject = __webpack_require__(42911); * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. * @param {(string|Phaser.Types.Loader.FileTypes.ScriptFileConfig)} key - The key to use for this file, or a file configuration object. * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". + * @param {string} [type='script'] - The script type. Should be either 'script' for classic JavaScript, or 'module' if the file contains an exported module. * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. */ var ScriptFile = new Class({ @@ -115752,7 +116705,7 @@ var ScriptFile = new Class({ initialize: - function ScriptFile (loader, key, url, xhrSettings) + function ScriptFile (loader, key, url, type, xhrSettings) { var extension = 'js'; @@ -115762,12 +116715,17 @@ var ScriptFile = new Class({ key = GetFastValue(config, 'key'); url = GetFastValue(config, 'url'); + type = GetFastValue(config, 'type', 'script'); xhrSettings = GetFastValue(config, 'xhrSettings'); extension = GetFastValue(config, 'extension', extension); } + else if (type === undefined) + { + type = 'script'; + } var fileConfig = { - type: 'script', + type: type, cache: false, extension: extension, responseType: 'text', @@ -115815,6 +116773,15 @@ var ScriptFile = new Class({ * } * ``` * + * If the script file contains a module, then you should specify that using the 'type' parameter: + * + * ```javascript + * function preload () + * { + * this.load.script('aliens', 'lib/aliens.js', 'module'); + * } + * ``` + * * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, * or if it's already running, when the next free load slot becomes available. This happens automatically if you * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued @@ -115830,7 +116797,8 @@ var ScriptFile = new Class({ * ```javascript * this.load.script({ * key: 'aliens', - * url: 'lib/aliens.js' + * url: 'lib/aliens.js', + * type: 'script' // or 'module' * }); * ``` * @@ -115856,11 +116824,12 @@ var ScriptFile = new Class({ * * @param {(string|Phaser.Types.Loader.FileTypes.ScriptFileConfig|Phaser.Types.Loader.FileTypes.ScriptFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". + * @param {string} [type='script'] - The script type. Should be either 'script' for classic JavaScript, or 'module' if the file contains an exported module. * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. * * @return {this} The Loader instance. */ -FileTypesManager.register('script', function (key, url, xhrSettings) +FileTypesManager.register('script', function (key, url, type, xhrSettings) { if (Array.isArray(key)) { @@ -115872,7 +116841,7 @@ FileTypesManager.register('script', function (key, url, xhrSettings) } else { - this.addFile(new ScriptFile(this, key, url, xhrSettings)); + this.addFile(new ScriptFile(this, key, url, type, xhrSettings)); } return this; @@ -115888,7 +116857,7 @@ module.exports = ScriptFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -115901,7 +116870,7 @@ var ImageFile = __webpack_require__(42927); * A single Sprite Sheet Image File suitable for loading by the Loader. * * These are created when you use the Phaser.Loader.LoaderPlugin#spritesheet method and are not typically created directly. - * + * * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#spritesheet. * * @class SpriteSheetFile @@ -115937,9 +116906,7 @@ var SpriteSheetFile = new Class({ */ addToCache: function () { - var texture = this.cache.addSpriteSheet(this.key, this.data, this.config); - - this.pendingDestroy(texture); + this.cache.addSpriteSheet(this.key, this.data, this.config); } }); @@ -115954,7 +116921,7 @@ var SpriteSheetFile = new Class({ * what sort of file you're actually trying to load. * * You can call this method from within your Scene's `preload`, along with any other files you wish to load: - * + * * ```javascript * function preload () * { @@ -115969,7 +116936,7 @@ var SpriteSheetFile = new Class({ * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been * loaded. - * + * * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle. * If you try to load an animated gif only the first frame will be rendered. Browsers do not natively support playback * of animated gifs to Canvas elements. @@ -115980,7 +116947,7 @@ var SpriteSheetFile = new Class({ * then remove it from the Texture Manager first, before loading a new one. * * Instead of passing arguments you can pass a configuration object, such as: - * + * * ```javascript * this.load.spritesheet({ * key: 'bot', @@ -115997,7 +116964,7 @@ var SpriteSheetFile = new Class({ * See the documentation for `Phaser.Types.Loader.FileTypes.SpriteSheetFileConfig` for more details. * * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key: - * + * * ```javascript * this.load.spritesheet('bot', 'images/robot.png', { frameWidth: 32, frameHeight: 38 }); * // and later in your game ... @@ -116016,13 +116983,13 @@ var SpriteSheetFile = new Class({ * * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image, * then you can specify it by providing an array as the `url` where the second element is the normal map: - * + * * ```javascript * this.load.spritesheet('logo', [ 'images/AtariLogo.png', 'images/AtariLogo-n.png' ], { frameWidth: 256, frameHeight: 80 }); * ``` * * Or, if you are using a config object use the `normalMap` property: - * + * * ```javascript * this.load.spritesheet({ * key: 'logo', @@ -116037,7 +117004,7 @@ var SpriteSheetFile = new Class({ * * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings. * Normal maps are a WebGL only feature. - * + * * Note: The ability to load this type of file will only be available if the Sprite Sheet File type has been built into Phaser. * It is available in the default build but can be excluded from custom builds. * @@ -116080,7 +117047,7 @@ module.exports = SpriteSheetFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -116260,7 +117227,7 @@ module.exports = TextFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -116353,8 +117320,6 @@ var TilemapCSVFile = new Class({ var tiledata = { format: this.tilemapFormat, data: this.data }; this.cache.add(this.key, tiledata); - - this.pendingDestroy(tiledata); } }); @@ -116456,7 +117421,7 @@ module.exports = TilemapCSVFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -116510,8 +117475,6 @@ var TilemapImpactFile = new Class({ var tiledata = { format: TILEMAP_FORMATS.WELTMEISTER, data: this.data }; this.cache.add(this.key, tiledata); - - this.pendingDestroy(tiledata); } }); @@ -116613,7 +117576,7 @@ module.exports = TilemapImpactFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -116667,8 +117630,6 @@ var TilemapJSONFile = new Class({ var tiledata = { format: TILEMAP_FORMATS.TILED_JSON, data: this.data }; this.cache.add(this.key, tiledata); - - this.pendingDestroy(tiledata); } }); @@ -116770,7 +117731,7 @@ module.exports = TilemapJSONFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -116868,8 +117829,6 @@ var UnityAtlasFile = new Class({ this.loader.textureManager.addUnityAtlas(image.key, image.data, text.data, normalMap); - text.pendingDestroy(); - this.complete = true; } } @@ -117013,7 +117972,7 @@ module.exports = UnityAtlasFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -117041,7 +118000,7 @@ var IsPlainObject = __webpack_require__(42911); * * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. * @param {(string|Phaser.Types.Loader.FileTypes.VideoFileConfig)} key - The key to use for this file, or a file configuration object. - * @param {any} [urlConfig] - The absolute or relative URL to load this file from in a config object. + * @param {Phaser.Types.Loader.FileTypes.VideoFileURLConfig} [urlConfig] - The absolute or relative URL to load this file from in a config object. * @param {string} [loadEvent] - The load event to listen for when _not_ loading as a blob. Either 'loadeddata', 'canplay' or 'canplaythrough'. * @param {boolean} [asBlob] - Load the video as a data blob, or via the Video element? * @param {boolean} [noAudio] - Does the video have an audio track? If not you can enable auto-playing on it. @@ -117361,7 +118320,7 @@ VideoFile.getVideoURL = function (game, urls) * @since 3.20.0 * * @param {(string|Phaser.Types.Loader.FileTypes.VideoFileConfig|Phaser.Types.Loader.FileTypes.VideoFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. - * @param {(string|string[])} [urls] - The absolute or relative URL to load the video files from. + * @param {(string|string[]|Phaser.Types.Loader.FileTypes.VideoFileURLConfig|Phaser.Types.Loader.FileTypes.VideoFileURLConfig[])} [urls] - The absolute or relative URL to load the video files from. * @param {string} [loadEvent='loadeddata'] - The load event to listen for when _not_ loading as a blob. Either `loadeddata`, `canplay` or `canplaythrough`. * @param {boolean} [asBlob=false] - Load the video as a data blob, or stream it via the Video element? * @param {boolean} [noAudio=false] - Does the video have an audio track? If not you can enable auto-playing on it. @@ -117409,7 +118368,7 @@ module.exports = VideoFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -117593,7 +118552,7 @@ module.exports = XMLFile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -117647,7 +118606,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -117688,7 +118647,7 @@ module.exports = Loader; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -117724,7 +118683,7 @@ module.exports = Average; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -117756,7 +118715,7 @@ module.exports = Bernstein; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -117786,7 +118745,7 @@ module.exports = Between; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -117824,7 +118783,7 @@ module.exports = CatmullRom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -117862,7 +118821,7 @@ module.exports = CeilTo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -117893,7 +118852,7 @@ module.exports = Clamp; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -117924,7 +118883,7 @@ module.exports = DegToRad; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -117954,7 +118913,7 @@ module.exports = Difference; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -118238,7 +119197,7 @@ module.exports = Euler; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -118279,7 +119238,7 @@ module.exports = Factorial; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -118309,7 +119268,7 @@ module.exports = FloatBetween; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -118347,7 +119306,7 @@ module.exports = FloorTo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -118382,7 +119341,7 @@ module.exports = FromPercent; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -118416,7 +119375,7 @@ module.exports = GetSpeed; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -118448,7 +119407,7 @@ module.exports = IsEven; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -118478,7 +119437,7 @@ module.exports = IsEvenStrict; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -118502,6 +119461,41 @@ var Linear = function (p0, p1, t) module.exports = Linear; +/***/ }), + +/***/ 61072: +/***/ ((module) => { + +/** + * @author Greg McLean + * @copyright 2021 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Interpolates two given Vectors and returns a new Vector between them. + * + * Does not modify either of the passed Vectors. + * + * @function Phaser.Math.LinearXY + * @since 3.60.0 + * + * @param {Phaser.Math.Vector2} vector1 - Starting vector + * @param {Phaser.Math.Vector2} vector2 - Ending vector + * @param {number} [t=0] - The percentage between vector1 and vector2 to return, represented as a number between 0 and 1. + * + * @return {Phaser.Math.Vector2} The step t% of the way between vector1 and vector2. + */ +var LinearXY = function (vector1, vector2, t) +{ + if (t === undefined) { t = 0; } + + return vector1.clone().lerp(vector2, t); +}; + +module.exports = LinearXY; + + /***/ }), /***/ 5341: @@ -118509,7 +119503,7 @@ module.exports = Linear; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -119103,7 +120097,7 @@ module.exports = Matrix3; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -120897,7 +121891,7 @@ module.exports = Matrix4; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -120970,7 +121964,7 @@ module.exports = Median; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -121001,7 +121995,7 @@ module.exports = MinSub; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -121061,7 +122055,7 @@ module.exports = Percent; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122111,7 +123105,7 @@ module.exports = Quaternion; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122142,7 +123136,7 @@ module.exports = RadToDeg; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122183,7 +123177,7 @@ module.exports = RandomXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122223,7 +123217,7 @@ module.exports = RandomXYZ; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122260,7 +123254,7 @@ module.exports = RandomXYZW; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122296,7 +123290,7 @@ module.exports = Rotate; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122341,7 +123335,7 @@ module.exports = RotateAround; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122383,7 +123377,7 @@ module.exports = RotateAroundDistance; /** * @author samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122421,7 +123415,7 @@ module.exports = RotateTo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122470,7 +123464,7 @@ module.exports = RotateVec3; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122500,23 +123494,23 @@ module.exports = RoundAwayFromZero; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Round a value to the given precision. - * + * * For example: - * + * * ```javascript * RoundTo(123.456, 0) = 123 * RoundTo(123.456, 1) = 120 * RoundTo(123.456, 2) = 100 * ``` - * + * * To round the decimal, i.e. to round to precision, pass in a negative `place`: - * + * * ```javascript * RoundTo(123.456789, 0) = 123 * RoundTo(123.456789, -1) = 123.5 @@ -122553,7 +123547,7 @@ module.exports = RoundTo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122607,7 +123601,7 @@ module.exports = SinCosTableGenerator; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122655,7 +123649,7 @@ module.exports = SmoothStep; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122695,7 +123689,7 @@ module.exports = SmootherStep; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122703,9 +123697,9 @@ var Vector2 = __webpack_require__(93736); /** * Returns a Vector2 containing the x and y position of the given index in a `width` x `height` sized grid. - * + * * For example, in a 6 x 4 grid, index 16 would equal x: 4 y: 2. - * + * * If the given index is out of range an empty Vector2 is returned. * * @function Phaser.Math.ToXY @@ -122752,7 +123746,7 @@ module.exports = ToXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -122808,7 +123802,7 @@ module.exports = TransformXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -123499,6 +124493,23 @@ var Vector2 = new Class({ var sin = Math.sin(delta); return this.set(cos * this.x - sin * this.y, sin * this.x + cos * this.y); + }, + + /** + * Project this Vector onto another. + * + * @method Phaser.Math.Vector2#project + * @since 3.60.0 + * + * @param {Phaser.Math.Vector2} src - The vector to project onto. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + project: function (src) + { + var scalar = this.dot(src) / src.dot(src); + + return this.copy(src).scale(scalar); } }); @@ -123585,7 +124596,7 @@ module.exports = Vector2; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -124632,7 +125643,7 @@ module.exports = Vector3; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125174,7 +126185,7 @@ module.exports = Vector4; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125205,12 +126216,12 @@ module.exports = Within; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** - * Wrap the given `value` between `min` and `max. + * Wrap the given `value` between `min` and `max`. * * @function Phaser.Math.Wrap * @since 3.0.0 @@ -125238,7 +126249,7 @@ module.exports = Wrap; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125270,7 +126281,7 @@ module.exports = Between; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125302,7 +126313,7 @@ module.exports = BetweenPoints; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125335,7 +126346,7 @@ module.exports = BetweenPointsY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125370,7 +126381,7 @@ module.exports = BetweenY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125416,7 +126427,7 @@ module.exports = CounterClockwise; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125455,7 +126466,7 @@ module.exports = Normalize; /** * @author Richard Davey * @author @samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125485,7 +126496,7 @@ module.exports = Random; /** * @author Richard Davey * @author @samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125514,7 +126525,7 @@ module.exports = RandomDegrees; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125545,7 +126556,7 @@ module.exports = Reverse; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125613,7 +126624,7 @@ module.exports = RotateTo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125661,7 +126672,7 @@ module.exports = ShortestBetween; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125694,7 +126705,7 @@ module.exports = Wrap; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125727,7 +126738,7 @@ module.exports = WrapDegrees; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125761,7 +126772,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125769,7 +126780,7 @@ var MATH_CONST = { /** * The value of PI * 2. - * + * * @name Phaser.Math.PI2 * @type {number} * @since 3.0.0 @@ -125778,7 +126789,7 @@ var MATH_CONST = { /** * The value of PI * 0.5. - * + * * @name Phaser.Math.TAU * @type {number} * @since 3.0.0 @@ -125787,7 +126798,7 @@ var MATH_CONST = { /** * An epsilon value (1.0e-6) - * + * * @name Phaser.Math.EPSILON * @type {number} * @since 3.0.0 @@ -125796,7 +126807,7 @@ var MATH_CONST = { /** * For converting degrees to radians (PI / 180) - * + * * @name Phaser.Math.DEG_TO_RAD * @type {number} * @since 3.0.0 @@ -125805,7 +126816,7 @@ var MATH_CONST = { /** * For converting radians to degrees (180 / PI) - * + * * @name Phaser.Math.RAD_TO_DEG * @type {number} * @since 3.0.0 @@ -125815,7 +126826,7 @@ var MATH_CONST = { /** * An instance of the Random Number Generator. * This is not set until the Game boots. - * + * * @name Phaser.Math.RND * @type {Phaser.Math.RandomDataGenerator} * @since 3.0.0 @@ -125825,7 +126836,7 @@ var MATH_CONST = { /** * The minimum safe integer this browser supports. * We use a const for backward compatibility with Internet Explorer. - * + * * @name Phaser.Math.MIN_SAFE_INTEGER * @type {number} * @since 3.21.0 @@ -125835,7 +126846,7 @@ var MATH_CONST = { /** * The maximum safe integer this browser supports. * We use a const for backward compatibility with Internet Explorer. - * + * * @name Phaser.Math.MAX_SAFE_INTEGER * @type {number} * @since 3.21.0 @@ -125854,7 +126865,7 @@ module.exports = MATH_CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125889,7 +126900,7 @@ module.exports = DistanceBetween; /** * @author samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125922,7 +126933,7 @@ module.exports = DistanceBetweenPoints; /** * @author samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125955,7 +126966,7 @@ module.exports = DistanceBetweenPointsSquared; /** * @author samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -125990,7 +127001,7 @@ module.exports = ChebyshevDistance; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126025,7 +127036,7 @@ module.exports = DistancePower; /** * @author samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126060,7 +127071,7 @@ module.exports = SnakeDistance; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126095,7 +127106,7 @@ module.exports = DistanceSquared; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126123,7 +127134,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126205,7 +127216,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126237,7 +127248,7 @@ module.exports = In; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126278,7 +127289,7 @@ module.exports = InOut; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126310,7 +127321,7 @@ module.exports = Out; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126334,7 +127345,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126380,7 +127391,7 @@ module.exports = In; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126445,7 +127456,7 @@ module.exports = InOut; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126489,7 +127500,7 @@ module.exports = Out; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126513,7 +127524,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126542,7 +127553,7 @@ module.exports = In; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126578,7 +127589,7 @@ module.exports = InOut; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126607,7 +127618,7 @@ module.exports = Out; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126631,7 +127642,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126660,7 +127671,7 @@ module.exports = In; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126696,7 +127707,7 @@ module.exports = InOut; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126725,7 +127736,7 @@ module.exports = Out; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126749,7 +127760,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126805,7 +127816,7 @@ module.exports = In; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126868,7 +127879,7 @@ module.exports = InOut; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126924,7 +127935,7 @@ module.exports = Out; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126948,7 +127959,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -126977,7 +127988,7 @@ module.exports = In; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127013,7 +128024,7 @@ module.exports = InOut; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127042,7 +128053,7 @@ module.exports = Out; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127066,7 +128077,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127099,7 +128110,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127128,7 +128139,7 @@ module.exports = Linear; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127142,7 +128153,7 @@ module.exports = __webpack_require__(43927); /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127171,7 +128182,7 @@ module.exports = In; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127207,7 +128218,7 @@ module.exports = InOut; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127236,7 +128247,7 @@ module.exports = Out; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127260,7 +128271,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127289,7 +128300,7 @@ module.exports = In; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127325,7 +128336,7 @@ module.exports = InOut; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127354,7 +128365,7 @@ module.exports = Out; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127378,7 +128389,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127407,7 +128418,7 @@ module.exports = In; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127443,7 +128454,7 @@ module.exports = InOut; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127472,7 +128483,7 @@ module.exports = Out; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127496,7 +128507,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127536,7 +128547,7 @@ module.exports = In; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127576,7 +128587,7 @@ module.exports = InOut; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127616,7 +128627,7 @@ module.exports = Out; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127640,7 +128651,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127683,7 +128694,7 @@ module.exports = Stepped; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127701,7 +128712,7 @@ module.exports = __webpack_require__(52770); /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127733,7 +128744,7 @@ module.exports = Ceil; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127768,7 +128779,7 @@ module.exports = Equal; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127800,7 +128811,7 @@ module.exports = Floor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127835,7 +128846,7 @@ module.exports = GreaterThan; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127870,7 +128881,7 @@ module.exports = LessThan; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127896,7 +128907,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -127939,6 +128950,7 @@ var PhaserMath = { IsEven: __webpack_require__(43776), IsEvenStrict: __webpack_require__(58442), Linear: __webpack_require__(42798), + LinearXY: __webpack_require__(61072), MaxAdd: __webpack_require__(69635), Median: __webpack_require__(37394), MinSub: __webpack_require__(17259), @@ -127988,7 +129000,7 @@ module.exports = PhaserMath; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128028,7 +129040,7 @@ module.exports = BezierInterpolation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128086,7 +129098,7 @@ module.exports = CatmullRomInterpolation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128157,7 +129169,7 @@ module.exports = CubicBezierInterpolation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128205,7 +129217,7 @@ module.exports = LinearInterpolation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128265,7 +129277,7 @@ module.exports = QuadraticBezierInterpolation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128299,7 +129311,7 @@ module.exports = SmoothStepInterpolation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128333,7 +129345,7 @@ module.exports = SmootherStepInterpolation; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128361,7 +129373,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128392,7 +129404,7 @@ module.exports = GetPowerOfTwo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128423,7 +129435,7 @@ module.exports = IsSizePowerOfTwo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128452,7 +129464,7 @@ module.exports = IsValuePowerOfTwo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128476,7 +129488,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -128485,13 +129497,13 @@ var Class = __webpack_require__(56694); /** * @classdesc * A seeded Random Data Generator. - * + * * Access via `Phaser.Math.RND` which is an instance of this class pre-defined * by Phaser. Or, create your own instance to use as you require. - * + * * The `Math.RND` generator is seeded by the Game Config property value `seed`. * If no such config property exists, a random number is used. - * + * * If you create your own instance of this class you should provide a seed for it. * If no seed is given it will use a 'random' one based on Date.now. * @@ -128823,7 +129835,7 @@ var RandomDataGenerator = new Class({ * * @method Phaser.Math.RandomDataGenerator#pick * @since 3.0.0 - * + * * @generic T * @genericUse {T[]} - [array] * @genericUse {T} - [$return] @@ -128987,7 +129999,7 @@ module.exports = RandomDataGenerator; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -129032,7 +130044,7 @@ module.exports = SnapCeil; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -129077,7 +130089,7 @@ module.exports = SnapFloor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -129121,7 +130133,7 @@ module.exports = SnapTo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -129145,7 +130157,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -129237,7 +130249,7 @@ __webpack_require__.g.Phaser = Phaser; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -129340,7 +130352,7 @@ module.exports = ArcadeImage; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -129537,8 +130549,8 @@ var ArcadePhysics = new Class({ * * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object or array of objects to check. * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`. - * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they overlap. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [overlapCallback] - An optional callback function that is called if the objects overlap. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they overlap. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {*} [callbackContext] - The context in which to run the callbacks. * * @return {boolean} True if at least one Game Object overlaps another. @@ -129579,8 +130591,8 @@ var ArcadePhysics = new Class({ * * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object or array of objects to check. * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`. - * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {*} [callbackContext] - The context in which to run the callbacks. * * @return {boolean} True if any overlapping Game Objects were separated, otherwise false. @@ -129618,8 +130630,8 @@ var ArcadePhysics = new Class({ * * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision. * @param {Phaser.Tilemaps.Tile[]} tiles - An array of Tiles to check for collision against. - * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} [callbackContext] - The context in which to run the callbacks. * * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated. @@ -129646,8 +130658,8 @@ var ArcadePhysics = new Class({ * * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision. * @param {Phaser.Tilemaps.Tile[]} tiles - An array of Tiles to check for collision against. - * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects overlap. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects overlap. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} [callbackContext] - The context in which to run the callbacks. * * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated. @@ -130066,7 +131078,7 @@ module.exports = ArcadePhysics; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -130171,7 +131183,7 @@ module.exports = ArcadeSprite; /** * @author Richard Davey * @author Benjamin D. Richards - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -130195,7 +131207,7 @@ var Vector2 = __webpack_require__(93736); * @since 3.0.0 * * @param {Phaser.Physics.Arcade.World} world - The Arcade Physics simulation this Body belongs to. - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object this Body belongs to. + * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object this Body belongs to. As of Phaser 3.60 this is now optional. */ var Body = new Class({ @@ -130203,8 +131215,32 @@ var Body = new Class({ function Body (world, gameObject) { - var width = (gameObject.displayWidth) ? gameObject.displayWidth : 64; - var height = (gameObject.displayHeight) ? gameObject.displayHeight : 64; + var width = 64; + var height = 64; + + var dummyGameObject = { + x: 0, + y: 0, + angle: 0, + rotation: 0, + scaleX: 1, + scaleY: 1, + displayOriginX: 0, + displayOriginY: 0 + }; + + var hasGameObject = (gameObject !== undefined); + + if (hasGameObject && gameObject.displayWidth) + { + width = gameObject.displayWidth; + height = gameObject.displayHeight; + } + + if (!hasGameObject) + { + gameObject = dummyGameObject; + } /** * The Arcade Physics simulation this Body belongs to. @@ -130218,11 +131254,23 @@ var Body = new Class({ /** * The Game Object this Body belongs to. * + * As of Phaser 3.60 this is now optional and can be undefined. + * * @name Phaser.Physics.Arcade.Body#gameObject * @type {Phaser.GameObjects.GameObject} * @since 3.0.0 */ - this.gameObject = gameObject; + this.gameObject = (hasGameObject) ? gameObject : undefined; + + /** + * A quick-test flag that signifies this is a Body, used in the World collision handler. + * + * @name Phaser.Physics.Arcade.Body#isBody + * @type {boolean} + * @readonly + * @since 3.60.0 + */ + this.isBody = true; /** * Transformations applied to this Body. @@ -131194,7 +132242,10 @@ var Body = new Class({ this.resetFlags(); } - this.updateFromGameObject(); + if (this.gameObject) + { + this.updateFromGameObject(); + } this.rotation = this.transform.rotation; this.preRotation = this.rotation; @@ -131272,6 +132323,7 @@ var Body = new Class({ { var dx = this.position.x - this.prevFrame.x; var dy = this.position.y - this.prevFrame.y; + var gameObject = this.gameObject; if (this.moves) { @@ -131302,8 +132354,11 @@ var Body = new Class({ } } - this.gameObject.x += dx; - this.gameObject.y += dy; + if (gameObject) + { + gameObject.x += dx; + gameObject.y += dy; + } } if (dx < 0) @@ -131324,9 +132379,9 @@ var Body = new Class({ this.facing = CONST.FACING_DOWN; } - if (this.allowRotation) + if (this.allowRotation && gameObject) { - this.gameObject.angle += this.deltaZ(); + gameObject.angle += this.deltaZ(); } this._tx = dx; @@ -131430,6 +132485,53 @@ var Body = new Class({ return this; }, + /** + * Assign this Body to a new Game Object. + * + * Removes this body from the Physics World, assigns to the new Game Object, calls `setSize` and then + * adds this body back into the World again, setting it enabled, unless the `enable` argument is set to `false`. + * + * If this body already has a Game Object, then it will remove itself from that Game Object first. + * + * Only if the given `gameObject` has a `body` property will this Body be assigned to it. + * + * @method Phaser.Physics.Arcade.Body#setGameObject + * @since 3.60.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object this Body belongs to. + * @param {boolean} [enable=true] - Automatically enable this Body for physics. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setGameObject: function (gameObject, enable) + { + if (enable === undefined) { enable = true; } + + // Remove from the World + this.world.remove(this); + + if (this.gameObject && this.gameObject.body) + { + // Disconnect the current Game Object + this.gameObject.body = null; + } + + this.gameObject = gameObject; + + if (gameObject.body) + { + gameObject.body = this; + } + + this.setSize(); + + this.world.add(this); + + this.enable = enable; + + return this; + }, + /** * Sizes and positions this Body, as a rectangle. * Modifies the Body `offset` if `center` is true (the default). @@ -131450,14 +132552,17 @@ var Body = new Class({ var gameObject = this.gameObject; - if (!width && gameObject.frame) + if (gameObject) { - width = gameObject.frame.realWidth; - } + if (!width && gameObject.frame) + { + width = gameObject.frame.realWidth; + } - if (!height && gameObject.frame) - { - height = gameObject.frame.realHeight; + if (!height && gameObject.frame) + { + height = gameObject.frame.realHeight; + } } this.sourceWidth = width; @@ -131471,7 +132576,7 @@ var Body = new Class({ this.updateCenter(); - if (center && gameObject.getCenter) + if (center && gameObject && gameObject.getCenter) { var ox = (gameObject.width - width) / 2; var oy = (gameObject.height - height) / 2; @@ -131544,25 +132649,35 @@ var Body = new Class({ var gameObject = this.gameObject; - gameObject.setPosition(x, y); - - if (gameObject.getTopLeft) + if (gameObject) { - gameObject.getTopLeft(this.position); + gameObject.setPosition(x, y); + + this.rotation = gameObject.angle; + this.preRotation = gameObject.angle; + } + + var pos = this.position; + + if (gameObject && gameObject.getTopLeft) + { + gameObject.getTopLeft(pos); } else { - this.position.set(x, y); + pos.set(x, y); } - this.prev.copy(this.position); - this.prevFrame.copy(this.position); + this.prev.copy(pos); + this.prevFrame.copy(pos); - this.rotation = gameObject.angle; - this.preRotation = gameObject.angle; + if (gameObject) + { + this.updateBounds(); + } - this.updateBounds(); this.updateCenter(); + this.checkWorldBounds(); this.resetFlags(true); }, @@ -131926,6 +133041,16 @@ var Body = new Class({ return this; }, + setValue: function (vec2, x, y) + { + if (x === undefined) { x = vec2.x; } + if (y === undefined) { y = vec2.y; } + + vec2.set(x, y); + + return this; + }, + /** * Sets the Body's velocity. * @@ -131961,14 +133086,7 @@ var Body = new Class({ */ setVelocityX: function (value) { - this.velocity.x = value; - - var x = value; - var y = this.velocity.y; - - this.speed = Math.sqrt(x * x + y * y); - - return this; + return this.setVelocity(value, this.velocity.y); }, /** @@ -131983,14 +133101,7 @@ var Body = new Class({ */ setVelocityY: function (value) { - this.velocity.y = value; - - var x = this.velocity.x; - var y = value; - - this.speed = Math.sqrt(x * x + y * y); - - return this; + return this.setVelocity(this.velocity.x, value); }, /** @@ -132707,7 +133818,7 @@ module.exports = Body; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -132727,8 +133838,8 @@ var Class = __webpack_require__(56694); * @param {boolean} overlapOnly - Whether to check for collisions or overlap. * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object to check for collision. * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object2 - The second object to check for collision. - * @param {ArcadePhysicsCallback} collideCallback - The callback to invoke when the two objects collide. - * @param {ArcadePhysicsCallback} processCallback - The callback to invoke when the two objects collide. Must return a boolean. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} collideCallback - The callback to invoke when the two objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} processCallback - The callback to invoke when the two objects collide. Must return a boolean. * @param {any} callbackContext - The scope in which to call the callbacks. */ var Collider = new Class({ @@ -132796,7 +133907,7 @@ var Collider = new Class({ * The callback to invoke when the two objects collide. * * @name Phaser.Physics.Arcade.Collider#collideCallback - * @type {ArcadePhysicsCallback} + * @type {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} * @since 3.0.0 */ this.collideCallback = collideCallback; @@ -132805,7 +133916,7 @@ var Collider = new Class({ * If a processCallback exists it must return true or collision checking will be skipped. * * @name Phaser.Physics.Arcade.Collider#processCallback - * @type {ArcadePhysicsCallback} + * @type {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} * @since 3.0.0 */ this.processCallback = processCallback; @@ -132891,15 +134002,17 @@ module.exports = Collider; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var ArcadeImage = __webpack_require__(62832); var ArcadeSprite = __webpack_require__(25084); +var Body = __webpack_require__(97602); var Class = __webpack_require__(56694); var CONST = __webpack_require__(47401); var PhysicsGroup = __webpack_require__(10481); +var StaticBody = __webpack_require__(66634); var StaticPhysicsGroup = __webpack_require__(46346); /** @@ -132954,10 +134067,10 @@ var Factory = new Class({ * @method Phaser.Physics.Arcade.Factory#collider * @since 3.0.0 * - * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]|Phaser.GameObjects.Group|Phaser.GameObjects.Group[])} object1 - The first object to check for collision. - * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]|Phaser.GameObjects.Group|Phaser.GameObjects.Group[])} object2 - The second object to check for collision. - * @param {ArcadePhysicsCallback} [collideCallback] - The callback to invoke when the two objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - The callback to invoke when the two objects collide. Must return a boolean. + * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object to check for collision. + * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object2 - The second object to check for collision. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - The callback to invoke when the two objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - The callback to invoke when the two objects collide. Must return a boolean. * @param {*} [callbackContext] - The scope in which to call the callbacks. * * @return {Phaser.Physics.Arcade.Collider} The Collider that was created. @@ -132973,10 +134086,10 @@ var Factory = new Class({ * @method Phaser.Physics.Arcade.Factory#overlap * @since 3.0.0 * - * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]|Phaser.GameObjects.Group|Phaser.GameObjects.Group[])} object1 - The first object to check for overlap. - * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]|Phaser.GameObjects.Group|Phaser.GameObjects.Group[])} object2 - The second object to check for overlap. - * @param {ArcadePhysicsCallback} [collideCallback] - The callback to invoke when the two objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - The callback to invoke when the two objects collide. Must return a boolean. + * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object to check for overlap. + * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object2 - The second object to check for overlap. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - The callback to invoke when the two objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - The callback to invoke when the two objects collide. Must return a boolean. * @param {*} [callbackContext] - The scope in which to call the callbacks. * * @return {Phaser.Physics.Arcade.Collider} The Collider that was created. @@ -133140,6 +134253,70 @@ var Factory = new Class({ return this.sys.updateList.add(new PhysicsGroup(this.world, this.world.scene, children, config)); }, + /** + * Creates a new physics Body with the given position and size. + * + * This Body is not associated with any Game Object, but still exists within the world + * and can be tested for collision, have velocity, etc. + * + * @method Phaser.Physics.Arcade.Factory#body + * @since 3.60.0 + * + * @param {number} x - The horizontal position of this Body in the physics world. + * @param {number} y - The vertical position of this Body in the physics world. + * @param {number} [width=64] - The width of the Body in pixels. Cannot be negative or zero. + * @param {number} [height=64] - The height of the Body in pixels. Cannot be negative or zero. + * + * @return {Phaser.Physics.Arcade.Body} The Body that was created. + */ + body: function (x, y, width, height) + { + var body = new Body(this.world); + + body.position.set(x, y); + + if (width && height) + { + body.setSize(width, height); + } + + this.world.add(body, CONST.DYNAMIC_BODY); + + return body; + }, + + /** + * Creates a new static physics Body with the given position and size. + * + * This Body is not associated with any Game Object, but still exists within the world + * and can be tested for collision, etc. + * + * @method Phaser.Physics.Arcade.Factory#staticBody + * @since 3.60.0 + * + * @param {number} x - The horizontal position of this Body in the physics world. + * @param {number} y - The vertical position of this Body in the physics world. + * @param {number} [width=64] - The width of the Body in pixels. Cannot be negative or zero. + * @param {number} [height=64] - The height of the Body in pixels. Cannot be negative or zero. + * + * @return {Phaser.Physics.Arcade.Body} The Body that was created. + */ + staticBody: function (x, y, width, height) + { + var body = new StaticBody(this.world); + + body.position.set(x, y); + + if (width && height) + { + body.setSize(width, height); + } + + this.world.add(body, CONST.STATIC_BODY); + + return body; + }, + /** * Destroys this Factory. * @@ -133165,7 +134342,7 @@ module.exports = Factory; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -133274,7 +134451,7 @@ module.exports = GetOverlapX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -133383,7 +134560,7 @@ module.exports = GetOverlapY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -133486,7 +134663,7 @@ var PhysicsGroup = new Class({ * This should be either `Phaser.Physics.Arcade.Image`, `Phaser.Physics.Arcade.Sprite`, or a class extending one of those. * * @name Phaser.Physics.Arcade.Group#classType - * @type {Function} + * @type {Phaser.Types.GameObjects.Group.GroupClassTypeConstructor} * @default ArcadeSprite * @since 3.0.0 */ @@ -133680,7 +134857,7 @@ module.exports = PhysicsGroup; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -134098,7 +135275,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -134516,7 +135693,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -134588,7 +135765,7 @@ module.exports = SeparateX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -134660,7 +135837,7 @@ module.exports = SeparateY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -134687,7 +135864,7 @@ var Vector2 = __webpack_require__(93736); * @since 3.0.0 * * @param {Phaser.Physics.Arcade.World} world - The Arcade Physics simulation this Static Body belongs to. - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object this Static Body belongs to. + * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object this Body belongs to. As of Phaser 3.60 this is now optional. */ var StaticBody = new Class({ @@ -134695,8 +135872,32 @@ var StaticBody = new Class({ function StaticBody (world, gameObject) { - var width = (gameObject.displayWidth) ? gameObject.displayWidth : 64; - var height = (gameObject.displayHeight) ? gameObject.displayHeight : 64; + var width = 64; + var height = 64; + + var dummyGameObject = { + x: 0, + y: 0, + angle: 0, + rotation: 0, + scaleX: 1, + scaleY: 1, + displayOriginX: 0, + displayOriginY: 0 + }; + + var hasGameObject = (gameObject !== undefined); + + if (hasGameObject && gameObject.displayWidth) + { + width = gameObject.displayWidth; + height = gameObject.displayHeight; + } + + if (!hasGameObject) + { + gameObject = dummyGameObject; + } /** * The Arcade Physics simulation this Static Body belongs to. @@ -134710,11 +135911,24 @@ var StaticBody = new Class({ /** * The Game Object this Static Body belongs to. * + * As of Phaser 3.60 this is now optional and can be undefined. + * * @name Phaser.Physics.Arcade.StaticBody#gameObject * @type {Phaser.GameObjects.GameObject} * @since 3.0.0 */ - this.gameObject = gameObject; + this.gameObject = (hasGameObject) ? gameObject : undefined; + + + /** + * A quick-test flag that signifies this is a Body, used in the World collision handler. + * + * @name Phaser.Physics.Arcade.StaticBody#isBody + * @type {boolean} + * @readonly + * @since 3.60.0 + */ + this.isBody = true; /** * Whether the Static Body's boundary is drawn to the debug display. @@ -135673,7 +136887,7 @@ module.exports = StaticBody; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -135873,7 +137087,7 @@ module.exports = StaticPhysicsGroup; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -136272,6 +137486,15 @@ var World = new Class({ */ this._tempMatrix2 = new TransformMatrix(); + /** + * The Filtering Options passed to `GetTilesWithinWorldXY` as part of the `collideSpriteVsTilemapLayer` check. + * + * @name Phaser.Physics.Arcade.World#tileFilterOptions + * @type {Phaser.Types.Tilemaps.FilteringOptions} + * @since 3.60.0 + */ + this.tileFilterOptions = { isColliding: true, isNotEmpty: true, hasInterestingFace: true }; + if (this.drawDebug) { this.createDebugGraphic(); @@ -136380,19 +137603,22 @@ var World = new Class({ { if (bodyType === undefined) { bodyType = CONST.DYNAMIC_BODY; } - if (!object.body) + if (object.hasTransformComponent) { - if (bodyType === CONST.DYNAMIC_BODY) + if (!object.body) { - object.body = new Body(this, object); + if (bodyType === CONST.DYNAMIC_BODY) + { + object.body = new Body(this, object); + } + else if (bodyType === CONST.STATIC_BODY) + { + object.body = new StaticBody(this, object); + } } - else if (bodyType === CONST.STATIC_BODY) - { - object.body = new StaticBody(this, object); - } - } - this.add(object.body); + this.add(object.body); + } return object; }, @@ -136675,8 +137901,8 @@ var World = new Class({ * * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object to check for collision. * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object2 - The second object to check for collision. - * @param {ArcadePhysicsCallback} [collideCallback] - The callback to invoke when the two objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - The callback to invoke when the two objects collide. Must return a boolean. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - The callback to invoke when the two objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - The callback to invoke when the two objects collide. Must return a boolean. * @param {*} [callbackContext] - The scope in which to call the callbacks. * * @return {Phaser.Physics.Arcade.Collider} The Collider that was created. @@ -136710,8 +137936,8 @@ var World = new Class({ * * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object to check for overlap. * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object2 - The second object to check for overlap. - * @param {ArcadePhysicsCallback} [collideCallback] - The callback to invoke when the two objects overlap. - * @param {ArcadePhysicsCallback} [processCallback] - The callback to invoke when the two objects overlap. Must return a boolean. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - The callback to invoke when the two objects overlap. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - The callback to invoke when the two objects overlap. Must return a boolean. * @param {*} [callbackContext] - The scope in which to call the callbacks. * * @return {Phaser.Physics.Arcade.Collider} The Collider that was created. @@ -137216,17 +138442,15 @@ var World = new Class({ * * @param {Phaser.Physics.Arcade.Body} body1 - The first Body to be separated. * @param {Phaser.Physics.Arcade.Body} body2 - The second Body to be separated. - * @param {ArcadePhysicsCallback} [processCallback] - The process callback. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - The process callback. * @param {*} [callbackContext] - The context in which to invoke the callback. * @param {boolean} [overlapOnly] - If this a collide or overlap check? - * @param {boolean} [intersects] - Assert that the bodies intersect and should not be tested before separation. * * @return {boolean} True if separation occurred, otherwise false. */ - separate: function (body1, body2, processCallback, callbackContext, overlapOnly, intersects) + separate: function (body1, body2, processCallback, callbackContext, overlapOnly) { if ( - !intersects && !body1.enable || !body2.enable || body1.checkCollision.none || @@ -137553,8 +138777,8 @@ var World = new Class({ * * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object or array of objects to check. * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`. - * @param {ArcadePhysicsCallback} [overlapCallback] - An optional callback function that is called if the objects overlap. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they overlap. If this is set then `overlapCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [overlapCallback] - An optional callback function that is called if the objects overlap. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they overlap. If this is set then `overlapCallback` will only be called if this callback returns `true`. * @param {*} [callbackContext] - The context in which to run the callbacks. * * @return {boolean} True if at least one Game Object overlaps another. @@ -137596,8 +138820,8 @@ var World = new Class({ * * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object or array of objects to check. * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`. - * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} [callbackContext] - The context in which to run the callbacks. * * @return {boolean} `true` if any overlapping Game Objects were separated, otherwise `false`. @@ -137620,8 +138844,8 @@ var World = new Class({ * * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object to check for collision. * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} [object2] - The second object to check for collision. - * @param {ArcadePhysicsCallback} collideCallback - The callback to invoke when the two objects collide. - * @param {ArcadePhysicsCallback} processCallback - The callback to invoke when the two objects collide. Must return a boolean. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} collideCallback - The callback to invoke when the two objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} processCallback - The callback to invoke when the two objects collide. Must return a boolean. * @param {any} callbackContext - The scope in which to call the callbacks. * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * @@ -137713,8 +138937,8 @@ var World = new Class({ * * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object or array of objects to check. * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object2 - The second object or array of objects to check, or `undefined`. - * @param {ArcadePhysicsCallback} collideCallback - An optional callback function that is called if the objects collide. - * @param {ArcadePhysicsCallback} processCallback - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} collideCallback - An optional callback function that is called if the objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} processCallback - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} callbackContext - The context in which to run the callbacks. * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * @@ -137735,10 +138959,12 @@ var World = new Class({ return false; } - // A Body - if (object1.body) + // TODO - Convert to fast-path index for Collider + + // SPRITE + if (object1.body || object1.isBody) { - if (object2.body) + if (object2.body || object2.isBody) { return this.collideSpriteVsSprite(object1, object2, collideCallback, processCallback, callbackContext, overlapOnly); } @@ -137755,7 +138981,7 @@ var World = new Class({ // GROUPS else if (object1.isParent) { - if (object2.body) + if (object2.body || object2.isBody) { return this.collideSpriteVsGroup(object2, object1, collideCallback, processCallback, callbackContext, overlapOnly); } @@ -137772,7 +138998,7 @@ var World = new Class({ // TILEMAP LAYERS else if (object1.isTilemap) { - if (object2.body) + if (object2.body || object2.isBody) { return this.collideSpriteVsTilemapLayer(object2, object1, collideCallback, processCallback, callbackContext, overlapOnly); } @@ -137793,8 +139019,8 @@ var World = new Class({ * * @param {Phaser.GameObjects.GameObject} sprite1 - The first object to check for collision. * @param {Phaser.GameObjects.GameObject} sprite2 - The second object to check for collision. - * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} [callbackContext] - The context in which to run the callbacks. * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * @@ -137802,12 +139028,15 @@ var World = new Class({ */ collideSpriteVsSprite: function (sprite1, sprite2, collideCallback, processCallback, callbackContext, overlapOnly) { - if (!sprite1.body || !sprite2.body) + var body1 = (sprite1.isBody) ? sprite1 : sprite1.body; + var body2 = (sprite2.isBody) ? sprite2 : sprite2.body; + + if (!body1 || !body2) { return false; } - if (this.separate(sprite1.body, sprite2.body, processCallback, callbackContext, overlapOnly)) + if (this.separate(body1, body2, processCallback, callbackContext, overlapOnly)) { if (collideCallback) { @@ -137830,8 +139059,8 @@ var World = new Class({ * * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision. * @param {Phaser.GameObjects.Group} group - The second object to check for collision. - * @param {ArcadePhysicsCallback} collideCallback - The callback to invoke when the two objects collide. - * @param {ArcadePhysicsCallback} processCallback - The callback to invoke when the two objects collide. Must return a boolean. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} collideCallback - The callback to invoke when the two objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} processCallback - The callback to invoke when the two objects collide. Must return a boolean. * @param {any} callbackContext - The scope in which to call the callbacks. * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * @@ -137839,7 +139068,7 @@ var World = new Class({ */ collideSpriteVsGroup: function (sprite, group, collideCallback, processCallback, callbackContext, overlapOnly) { - var bodyA = sprite.body; + var bodyA = (sprite.isBody) ? sprite : sprite.body; if (group.length === 0 || !bodyA || !bodyA.enable || bodyA.checkCollision.none) { @@ -137875,7 +139104,7 @@ var World = new Class({ continue; } - if (this.separate(bodyA, bodyB, processCallback, callbackContext, overlapOnly, true)) + if (this.separate(bodyA, bodyB, processCallback, callbackContext, overlapOnly)) { if (collideCallback) { @@ -137925,8 +139154,8 @@ var World = new Class({ * * @param {Phaser.GameObjects.Group} group - The first object to check for collision. * @param {Phaser.Tilemaps.TilemapLayer} tilemapLayer - The second object to check for collision. - * @param {ArcadePhysicsCallback} collideCallback - An optional callback function that is called if the objects collide. - * @param {ArcadePhysicsCallback} processCallback - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} collideCallback - An optional callback function that is called if the objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} processCallback - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} callbackContext - The context in which to run the callbacks. * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * @@ -137945,7 +139174,7 @@ var World = new Class({ for (var i = 0; i < children.length; i++) { - if (children[i].body) + if (children[i].body || children[i].isBody) { if (this.collideSpriteVsTilemapLayer(children[i], tilemapLayer, collideCallback, processCallback, callbackContext, overlapOnly)) { @@ -137979,15 +139208,15 @@ var World = new Class({ * * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision. * @param {Phaser.Tilemaps.Tile[]} tiles - An array of Tiles to check for collision against. - * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} [callbackContext] - The context in which to run the callbacks. * * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated. */ collideTiles: function (sprite, tiles, collideCallback, processCallback, callbackContext) { - if (!sprite.body.enable || tiles.length === 0) + if (tiles.length === 0 || (sprite.body && !sprite.body.enable) || (sprite.isBody && !sprite.enable)) { return false; } @@ -138014,15 +139243,15 @@ var World = new Class({ * * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision. * @param {Phaser.Tilemaps.Tile[]} tiles - An array of Tiles to check for collision against. - * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects overlap. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects overlap. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} [callbackContext] - The context in which to run the callbacks. * * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated. */ overlapTiles: function (sprite, tiles, collideCallback, processCallback, callbackContext) { - if (!sprite.body.enable || tiles.length === 0) + if (tiles.length === 0 || (sprite.body && !sprite.body.enable) || (sprite.isBody && !sprite.enable)) { return false; } @@ -138043,8 +139272,8 @@ var World = new Class({ * * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision. * @param {Phaser.Tilemaps.TilemapLayer} tilemapLayer - The second object to check for collision. - * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} [callbackContext] - The context in which to run the callbacks. * @param {boolean} [overlapOnly] - Whether this is a collision or overlap check. * @@ -138052,7 +139281,7 @@ var World = new Class({ */ collideSpriteVsTilemapLayer: function (sprite, tilemapLayer, collideCallback, processCallback, callbackContext, overlapOnly) { - var body = sprite.body; + var body = (sprite.isBody) ? sprite : sprite.body; if (!body.enable || body.checkCollision.none) { @@ -138081,7 +139310,9 @@ var World = new Class({ h += yDiff; } - var mapData = GetTilesWithinWorldXY(x, y, w, h, null, tilemapLayer.scene.cameras.main, tilemapLayer.layer); + var options = (overlapOnly) ? null : this.tileFilterOptions; + + var mapData = GetTilesWithinWorldXY(x, y, w, h, options, tilemapLayer.scene.cameras.main, tilemapLayer.layer); if (mapData.length === 0) { @@ -138105,8 +139336,8 @@ var World = new Class({ * * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision. * @param {Phaser.Tilemaps.TilemapLayer} tilemapLayer - The second object to check for collision. - * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} [callbackContext] - The context in which to run the callbacks. * @param {boolean} [overlapOnly] - Whether this is a collision or overlap check. * @param {boolean} [isLayer] - Is this check coming from a TilemapLayer or an array of tiles? @@ -138115,7 +139346,7 @@ var World = new Class({ */ collideSpriteVsTilesHandler: function (sprite, tiles, collideCallback, processCallback, callbackContext, overlapOnly, isLayer) { - var body = sprite.body; + var body = (sprite.isBody) ? sprite : sprite.body; var tile; var tileWorldRect = { left: 0, right: 0, top: 0, bottom: 0 }; @@ -138181,8 +139412,8 @@ var World = new Class({ * * @param {Phaser.GameObjects.Group} group1 - The first object to check for collision. * @param {Phaser.GameObjects.Group} group2 - The second object to check for collision. - * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} [callbackContext] - The context in which to run the callbacks. * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * @@ -138296,6 +139527,12 @@ var World = new Class({ this.shutdown(); this.scene = null; + + if (this.debugGraphic) + { + this.debugGraphic.destroy(); + this.debugGraphic = null; + } } }); @@ -138310,7 +139547,7 @@ module.exports = World; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -138386,7 +139623,7 @@ module.exports = Acceleration; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -138400,7 +139637,7 @@ var Angular = { /** * Sets the angular velocity of the body. - * + * * In Arcade Physics, bodies cannot rotate. They are always axis-aligned. * However, they can have angular motion, which is passed on to the Game Object bound to the body, * causing them to visually rotate, even though the body remains axis-aligned. @@ -138421,7 +139658,7 @@ var Angular = { /** * Sets the angular acceleration of the body. - * + * * In Arcade Physics, bodies cannot rotate. They are always axis-aligned. * However, they can have angular motion, which is passed on to the Game Object bound to the body, * causing them to visually rotate, even though the body remains axis-aligned. @@ -138469,7 +139706,7 @@ module.exports = Angular; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -138483,7 +139720,7 @@ var Bounce = { /** * Sets the bounce values of this body. - * + * * Bounce is the amount of restitution, or elasticity, the body has when it collides with another object. * A value of 1 means that it will retain its full velocity after the rebound. A value of 0 means it will not rebound at all. * @@ -138538,7 +139775,7 @@ var Bounce = { /** * Sets whether this Body collides with the world boundary. - * + * * Optionally also sets the World Bounce values. If the `Body.worldBounce` is null, it's set to a new Phaser.Math.Vector2 first. * * @method Phaser.Physics.Arcade.Components.Bounce#setCollideWorldBounds @@ -138547,12 +139784,13 @@ var Bounce = { * @param {boolean} [value=true] - `true` if this body should collide with the world bounds, otherwise `false`. * @param {number} [bounceX] - If given this will be replace the `worldBounce.x` value. * @param {number} [bounceY] - If given this will be replace the `worldBounce.y` value. + * @param {boolean} [onWorldBounds] - If given this replaces the Body's `onWorldBounds` value. * * @return {this} This Game Object. */ - setCollideWorldBounds: function (value, bounceX, bounceY) + setCollideWorldBounds: function (value, bounceX, bounceY, onWorldBounds) { - this.body.setCollideWorldBounds(value, bounceX, bounceY); + this.body.setCollideWorldBounds(value, bounceX, bounceY, onWorldBounds); return this; } @@ -138569,7 +139807,7 @@ module.exports = Bounce; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -138583,7 +139821,7 @@ var Debug = { /** * Sets the debug values of this body. - * + * * Bodies will only draw their debug if debug has been enabled for Arcade Physics as a whole. * Note that there is a performance cost in drawing debug displays. It should never be used in production. * @@ -138697,7 +139935,7 @@ module.exports = Debug; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -138831,7 +140069,7 @@ module.exports = Drag; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -138956,7 +140194,7 @@ module.exports = Enable; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -139045,7 +140283,7 @@ module.exports = Friction; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -139060,7 +140298,7 @@ var Gravity = { /** * Set the X and Y values of the gravitational pull to act upon this Arcade Physics Game Object. Values can be positive or negative. Larger values result in a stronger effect. - * + * * If only one value is provided, this value will be used for both the X and Y axis. * * @method Phaser.Physics.Arcade.Components.Gravity#setGravity @@ -139124,7 +140362,7 @@ module.exports = Gravity; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -139171,7 +140409,7 @@ module.exports = Immovable; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -139367,7 +140605,7 @@ module.exports = OverlapRect; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -139416,7 +140654,7 @@ module.exports = Pushable; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -139520,7 +140758,7 @@ module.exports = Size; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -139620,7 +140858,7 @@ module.exports = Velocity; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -139656,7 +140894,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -139786,25 +141024,25 @@ module.exports = CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Arcade Physics World Collide Event. - * + * * This event is dispatched by an Arcade Physics World instance if two bodies collide _and_ at least * one of them has their [onCollide]{@link Phaser.Physics.Arcade.Body#onCollide} property set to `true`. - * + * * It provides an alternative means to handling collide events rather than using the callback approach. - * + * * Listen to it from a Scene using: `this.physics.world.on('collide', listener)`. - * + * * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. * * @event Phaser.Physics.Arcade.Events#COLLIDE * @since 3.0.0 - * + * * @param {Phaser.GameObjects.GameObject} gameObject1 - The first Game Object involved in the collision. This is the parent of `body1`. * @param {Phaser.GameObjects.GameObject} gameObject2 - The second Game Object involved in the collision. This is the parent of `body2`. * @param {Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody} body1 - The first Physics Body involved in the collision. @@ -139820,25 +141058,25 @@ module.exports = 'collide'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Arcade Physics World Overlap Event. - * + * * This event is dispatched by an Arcade Physics World instance if two bodies overlap _and_ at least * one of them has their [onOverlap]{@link Phaser.Physics.Arcade.Body#onOverlap} property set to `true`. - * + * * It provides an alternative means to handling overlap events rather than using the callback approach. - * + * * Listen to it from a Scene using: `this.physics.world.on('overlap', listener)`. - * + * * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. * * @event Phaser.Physics.Arcade.Events#OVERLAP * @since 3.0.0 - * + * * @param {Phaser.GameObjects.GameObject} gameObject1 - The first Game Object involved in the overlap. This is the parent of `body1`. * @param {Phaser.GameObjects.GameObject} gameObject2 - The second Game Object involved in the overlap. This is the parent of `body2`. * @param {Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody} body1 - The first Physics Body involved in the overlap. @@ -139854,15 +141092,15 @@ module.exports = 'overlap'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Arcade Physics World Pause Event. - * + * * This event is dispatched by an Arcade Physics World instance when it is paused. - * + * * Listen to it from a Scene using: `this.physics.world.on('pause', listener)`. * * @event Phaser.Physics.Arcade.Events#PAUSE @@ -139878,15 +141116,15 @@ module.exports = 'pause'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Arcade Physics World Resume Event. - * + * * This event is dispatched by an Arcade Physics World instance when it resumes from a paused state. - * + * * Listen to it from a Scene using: `this.physics.world.on('resume', listener)`. * * @event Phaser.Physics.Arcade.Events#RESUME @@ -139902,25 +141140,25 @@ module.exports = 'resume'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Arcade Physics Tile Collide Event. - * + * * This event is dispatched by an Arcade Physics World instance if a body collides with a Tile _and_ * has its [onCollide]{@link Phaser.Physics.Arcade.Body#onCollide} property set to `true`. - * + * * It provides an alternative means to handling collide events rather than using the callback approach. - * + * * Listen to it from a Scene using: `this.physics.world.on('tilecollide', listener)`. - * + * * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. * * @event Phaser.Physics.Arcade.Events#TILE_COLLIDE * @since 3.16.1 - * + * * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object involved in the collision. This is the parent of `body`. * @param {Phaser.Tilemaps.Tile} tile - The tile the body collided with. * @param {Phaser.Physics.Arcade.Body} body - The Arcade Physics Body of the Game Object involved in the collision. @@ -139935,25 +141173,25 @@ module.exports = 'tilecollide'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Arcade Physics Tile Overlap Event. - * + * * This event is dispatched by an Arcade Physics World instance if a body overlaps with a Tile _and_ * has its [onOverlap]{@link Phaser.Physics.Arcade.Body#onOverlap} property set to `true`. - * + * * It provides an alternative means to handling overlap events rather than using the callback approach. - * + * * Listen to it from a Scene using: `this.physics.world.on('tileoverlap', listener)`. - * + * * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. * * @event Phaser.Physics.Arcade.Events#TILE_OVERLAP * @since 3.16.1 - * + * * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object involved in the overlap. This is the parent of `body`. * @param {Phaser.Tilemaps.Tile} tile - The tile the body overlapped. * @param {Phaser.Physics.Arcade.Body} body - The Arcade Physics Body of the Game Object involved in the overlap. @@ -139968,23 +141206,23 @@ module.exports = 'tileoverlap'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Arcade Physics World Bounds Event. - * + * * This event is dispatched by an Arcade Physics World instance if a body makes contact with the world bounds _and_ * it has its [onWorldBounds]{@link Phaser.Physics.Arcade.Body#onWorldBounds} property set to `true`. - * + * * It provides an alternative means to handling collide events rather than using the callback approach. - * + * * Listen to it from a Scene using: `this.physics.world.on('worldbounds', listener)`. * * @event Phaser.Physics.Arcade.Events#WORLD_BOUNDS * @since 3.0.0 - * + * * @param {Phaser.Physics.Arcade.Body} body - The Arcade Physics Body that hit the world bounds. * @param {boolean} up - Is the Body blocked up? I.e. collided with the top of the world bounds. * @param {boolean} down - Is the Body blocked down? I.e. collided with the bottom of the world bounds. @@ -140001,7 +141239,7 @@ module.exports = 'worldbounds'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140030,7 +141268,7 @@ module.exports = 'worldstep'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140059,7 +141297,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140105,7 +141343,7 @@ module.exports = Arcade; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140147,7 +141385,7 @@ module.exports = ProcessTileCallbacks; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140196,7 +141434,7 @@ module.exports = ProcessTileSeparationX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140245,7 +141483,7 @@ module.exports = ProcessTileSeparationY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140366,7 +141604,7 @@ module.exports = SeparateTile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140457,7 +141695,7 @@ module.exports = TileCheckX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140548,7 +141786,7 @@ module.exports = TileCheckY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140585,7 +141823,7 @@ module.exports = TileIntersectsBody; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140615,7 +141853,7 @@ module.exports = Tilemap; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140642,7 +141880,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -140651,17 +141889,17 @@ var Vector2 = __webpack_require__(93736); /** * @classdesc - * + * * The Body Bounds class contains methods to help you extract the world coordinates from various points around * the bounds of a Matter Body. Because Matter bodies are positioned based on their center of mass, and not a * dimension based center, you often need to get the bounds coordinates in order to properly align them in the world. - * + * * You can access this class via the MatterPhysics class from a Scene, i.e.: - * + * * ```javascript * this.matter.bodyBounds.getTopLeft(body); * ``` - * + * * See also the `MatterPhysics.alignBody` method. * * @class BodyBounds @@ -140696,9 +141934,9 @@ var BodyBounds = new Class({ /** * Parses the given body to get the bounds diff values from it. - * + * * They're stored in this class in the temporary properties `boundsCenter` and `centerDiff`. - * + * * This method is called automatically by all other methods in this class. * * @method Phaser.Physics.Matter.BodyBounds#parseBody @@ -140734,7 +141972,7 @@ var BodyBounds = new Class({ /** * Takes a Body and returns the world coordinates of the top-left of its _bounds_. - * + * * Body bounds are updated by Matter each step and factor in scale and rotation. * This will return the world coordinate based on the bodies _current_ position and bounds. * @@ -140768,7 +142006,7 @@ var BodyBounds = new Class({ /** * Takes a Body and returns the world coordinates of the top-center of its _bounds_. - * + * * Body bounds are updated by Matter each step and factor in scale and rotation. * This will return the world coordinate based on the bodies _current_ position and bounds. * @@ -140802,7 +142040,7 @@ var BodyBounds = new Class({ /** * Takes a Body and returns the world coordinates of the top-right of its _bounds_. - * + * * Body bounds are updated by Matter each step and factor in scale and rotation. * This will return the world coordinate based on the bodies _current_ position and bounds. * @@ -140836,7 +142074,7 @@ var BodyBounds = new Class({ /** * Takes a Body and returns the world coordinates of the left-center of its _bounds_. - * + * * Body bounds are updated by Matter each step and factor in scale and rotation. * This will return the world coordinate based on the bodies _current_ position and bounds. * @@ -140870,7 +142108,7 @@ var BodyBounds = new Class({ /** * Takes a Body and returns the world coordinates of the center of its _bounds_. - * + * * Body bounds are updated by Matter each step and factor in scale and rotation. * This will return the world coordinate based on the bodies _current_ position and bounds. * @@ -140903,7 +142141,7 @@ var BodyBounds = new Class({ /** * Takes a Body and returns the world coordinates of the right-center of its _bounds_. - * + * * Body bounds are updated by Matter each step and factor in scale and rotation. * This will return the world coordinate based on the bodies _current_ position and bounds. * @@ -140937,7 +142175,7 @@ var BodyBounds = new Class({ /** * Takes a Body and returns the world coordinates of the bottom-left of its _bounds_. - * + * * Body bounds are updated by Matter each step and factor in scale and rotation. * This will return the world coordinate based on the bodies _current_ position and bounds. * @@ -140971,7 +142209,7 @@ var BodyBounds = new Class({ /** * Takes a Body and returns the world coordinates of the bottom-center of its _bounds_. - * + * * Body bounds are updated by Matter each step and factor in scale and rotation. * This will return the world coordinate based on the bodies _current_ position and bounds. * @@ -141005,7 +142243,7 @@ var BodyBounds = new Class({ /** * Takes a Body and returns the world coordinates of the bottom-right of its _bounds_. - * + * * Body bounds are updated by Matter each step and factor in scale and rotation. * This will return the world coordinate based on the bodies _current_ position and bounds. * @@ -141049,7 +142287,7 @@ module.exports = BodyBounds; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -141063,13 +142301,12 @@ Matter.Body = __webpack_require__(84125); Matter.Composite = __webpack_require__(11299); Matter.World = __webpack_require__(72005); +Matter.Collision = __webpack_require__(63454); Matter.Detector = __webpack_require__(13657); -Matter.Grid = __webpack_require__(15489); Matter.Pairs = __webpack_require__(91327); Matter.Pair = __webpack_require__(70584); Matter.Query = __webpack_require__(13390); Matter.Resolver = __webpack_require__(44272); -Matter.SAT = __webpack_require__(5756); Matter.Constraint = __webpack_require__(52838); @@ -141107,7 +142344,7 @@ module.exports = Matter; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -142038,7 +143275,7 @@ module.exports = Factory; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -142064,7 +143301,7 @@ function hasGetterOrSetter (def) /** * A Matter Game Object is a generic object that allows you to combine any Phaser Game Object, * including those you have extended or created yourself, with all of the Matter Components. - * + * * This enables you to use component methods such as `setVelocity` or `isSensor` directly from * this Game Object. * @@ -142148,7 +143385,7 @@ var MatterGameObject = function (world, gameObject, options, addToWorld) } options.addToWorld = addToWorld; - + gameObject.setBody(shape, options); } @@ -142165,7 +143402,7 @@ module.exports = MatterGameObject; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -142312,7 +143549,7 @@ module.exports = MatterImage; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -142323,6 +143560,8 @@ var Body = __webpack_require__(84125); var BodyBounds = __webpack_require__(63568); var Bounds = __webpack_require__(84091); var Class = __webpack_require__(56694); +var Collision = __webpack_require__(63454); +var Common = __webpack_require__(68758); var Composite = __webpack_require__(11299); var Composites = __webpack_require__(56643); var Constraint = __webpack_require__(52838); @@ -142331,7 +143570,6 @@ var DistanceBetween = __webpack_require__(53996); var Factory = __webpack_require__(72653); var GetFastValue = __webpack_require__(72632); var GetValue = __webpack_require__(10850); -var Grid = __webpack_require__(15489); var MatterAttractors = __webpack_require__(1675); var MatterCollisionEvents = __webpack_require__(80391); var MatterLib = __webpack_require__(16929); @@ -142343,20 +143581,21 @@ var Plugin = __webpack_require__(84474); var PluginCache = __webpack_require__(91963); var Query = __webpack_require__(13390); var Resolver = __webpack_require__(44272); -var SAT = __webpack_require__(5756); var SceneEvents = __webpack_require__(7599); var Svg = __webpack_require__(92765); var Vector = __webpack_require__(10438); var Vertices = __webpack_require__(39745); var World = __webpack_require__(31468); +Common.setDecomp(__webpack_require__(81084)); + /** * @classdesc * The Phaser Matter plugin provides the ability to use the Matter JS Physics Engine within your Phaser games. - * + * * Unlike Arcade Physics, the other physics system provided with Phaser, Matter JS is a full-body physics system. * It features: - * + * * * Rigid bodies * * Compound bodies * * Composite bodies @@ -142374,10 +143613,10 @@ var World = __webpack_require__(31468); * * Views (translate, zoom) * * Collision queries (raycasting, region tests) * * Time scaling (slow-mo, speed-up) - * + * * Configuration of Matter is handled via the Matter World Config object, which can be passed in either the * Phaser Game Config, or Phaser Scene Config. Here is a basic example: - * + * * ```js * physics: { * default: 'matter', @@ -142393,11 +143632,11 @@ var World = __webpack_require__(31468); * } * } * ``` - * + * * This class acts as an interface between a Phaser Scene and a single instance of the Matter Engine. - * + * * Use it to access the most common Matter features and helper functions. - * + * * You can find details, documentation and examples on the Matter JS website: https://brm.io/matter-js/ * * @class MatterPhysics @@ -142453,7 +143692,7 @@ var MatterPhysics = new Class({ /** * An instance of the Matter Factory. This class provides lots of functions for creating a * wide variety of physics objects and adds them automatically to the Matter World. - * + * * You can use this class to cut-down on the amount of code required in your game, however, * use of the Factory is entirely optional and should be seen as a development aid. It's * perfectly possible to create and add components to the Matter world without using it. @@ -142478,7 +143717,7 @@ var MatterPhysics = new Class({ /** * A reference to the `Matter.Body` module. - * + * * The `Matter.Body` module contains methods for creating and manipulating body models. * A `Matter.Body` is a rigid body that can be simulated by a `Matter.Engine`. * Factories for commonly used body configurations (such as rectangles, circles and other polygons) can be found in the `Bodies` module. @@ -142491,7 +143730,7 @@ var MatterPhysics = new Class({ /** * A reference to the `Matter.Composite` module. - * + * * The `Matter.Composite` module contains methods for creating and manipulating composite bodies. * A composite body is a collection of `Matter.Body`, `Matter.Constraint` and other `Matter.Composite`, therefore composites form a tree structure. * It is important to use the functions in this module to modify composites, rather than directly modifying their properties. @@ -142505,9 +143744,22 @@ var MatterPhysics = new Class({ // Collision: + /** + * A reference to the `Matter.Collision` module. + * + * The `Matter.Collision` module contains methods for detecting collisions between a given pair of bodies. + * + * For efficient detection between a list of bodies, see `Matter.Detector` and `Matter.Query`. + * + * @name Phaser.Physics.Matter.MatterPhysics#collision + * @type {MatterJS.Collision} + * @since 3.60.0 + */ + this.collision = Collision; + /** * A reference to the `Matter.Detector` module. - * + * * The `Matter.Detector` module contains methods for detecting collisions given a set of pairs. * * @name Phaser.Physics.Matter.MatterPhysics#detector @@ -142516,20 +143768,9 @@ var MatterPhysics = new Class({ */ this.detector = Detector; - /** - * A reference to the `Matter.Grid` module. - * - * The `Matter.Grid` module contains methods for creating and manipulating collision broadphase grid structures. - * - * @name Phaser.Physics.Matter.MatterPhysics#grid - * @type {MatterJS.GridFactory} - * @since 3.22.0 - */ - this.grid = Grid; - /** * A reference to the `Matter.Pair` module. - * + * * The `Matter.Pair` module contains methods for creating and manipulating collision pairs. * * @name Phaser.Physics.Matter.MatterPhysics#pair @@ -142540,7 +143781,7 @@ var MatterPhysics = new Class({ /** * A reference to the `Matter.Pairs` module. - * + * * The `Matter.Pairs` module contains methods for creating and manipulating collision pair sets. * * @name Phaser.Physics.Matter.MatterPhysics#pairs @@ -142551,7 +143792,7 @@ var MatterPhysics = new Class({ /** * A reference to the `Matter.Query` module. - * + * * The `Matter.Query` module contains methods for performing collision queries. * * @name Phaser.Physics.Matter.MatterPhysics#query @@ -142562,7 +143803,7 @@ var MatterPhysics = new Class({ /** * A reference to the `Matter.Resolver` module. - * + * * The `Matter.Resolver` module contains methods for resolving collision pairs. * * @name Phaser.Physics.Matter.MatterPhysics#resolver @@ -142571,22 +143812,11 @@ var MatterPhysics = new Class({ */ this.resolver = Resolver; - /** - * A reference to the `Matter.SAT` module. - * - * The `Matter.SAT` module contains methods for detecting collisions using the Separating Axis Theorem. - * - * @name Phaser.Physics.Matter.MatterPhysics#sat - * @type {MatterJS.SATFactory} - * @since 3.22.0 - */ - this.sat = SAT; - // Constraint /** * A reference to the `Matter.Constraint` module. - * + * * The `Matter.Constraint` module contains methods for creating and manipulating constraints. * Constraints are used for specifying that a fixed distance must be maintained between two bodies (or a body and a fixed world-space position). * The stiffness of constraints can be modified to create springs or elastic. @@ -142601,7 +143831,7 @@ var MatterPhysics = new Class({ /** * A reference to the `Matter.Bodies` module. - * + * * The `Matter.Bodies` module contains factory methods for creating rigid bodies * with commonly used body configurations (such as rectangles, circles and other polygons). * @@ -142613,7 +143843,7 @@ var MatterPhysics = new Class({ /** * A reference to the `Matter.Composites` module. - * + * * The `Matter.Composites` module contains factory methods for creating composite bodies * with commonly used configurations (such as stacks and chains). * @@ -142627,7 +143857,7 @@ var MatterPhysics = new Class({ /** * A reference to the `Matter.Axes` module. - * + * * The `Matter.Axes` module contains methods for creating and manipulating sets of axes. * * @name Phaser.Physics.Matter.MatterPhysics#axes @@ -142638,7 +143868,7 @@ var MatterPhysics = new Class({ /** * A reference to the `Matter.Bounds` module. - * + * * The `Matter.Bounds` module contains methods for creating and manipulating axis-aligned bounding boxes (AABB). * * @name Phaser.Physics.Matter.MatterPhysics#bounds @@ -142649,7 +143879,7 @@ var MatterPhysics = new Class({ /** * A reference to the `Matter.Svg` module. - * + * * The `Matter.Svg` module contains methods for converting SVG images into an array of vector points. * * To use this module you also need the SVGPathSeg polyfill: https://github.com/progers/pathseg @@ -142662,7 +143892,7 @@ var MatterPhysics = new Class({ /** * A reference to the `Matter.Vector` module. - * + * * The `Matter.Vector` module contains methods for creating and manipulating vectors. * Vectors are the basis of all the geometry related operations in the engine. * A `Matter.Vector` object is of the form `{ x: 0, y: 0 }`. @@ -142675,7 +143905,7 @@ var MatterPhysics = new Class({ /** * A reference to the `Matter.Vertices` module. - * + * * The `Matter.Vertices` module contains methods for creating and manipulating sets of vertices. * A set of vertices is an array of `Matter.Vector` with additional indexing properties inserted by `Vertices.create`. * A `Matter.Body` maintains a set of vertices to represent the shape of the object (its convex hull). @@ -142688,7 +143918,7 @@ var MatterPhysics = new Class({ /** * A reference to the `Matter.Vertices` module. - * + * * The `Matter.Vertices` module contains methods for creating and manipulating sets of vertices. * A set of vertices is an array of `Matter.Vector` with additional indexing properties inserted by `Vertices.create`. * A `Matter.Body` maintains a set of vertices to represent the shape of the object (its convex hull). @@ -142800,18 +144030,18 @@ var MatterPhysics = new Class({ /** * Enables the Matter Attractors Plugin. - * + * * The attractors plugin that makes it easy to apply continual forces on bodies. * It's possible to simulate effects such as wind, gravity and magnetism. - * + * * https://github.com/liabru/matter-attractors - * + * * This method is called automatically if `plugins.attractors` is set in the Matter World Config. * However, you can also call it directly from within your game. * * @method Phaser.Physics.Matter.MatterPhysics#enableAttractorPlugin * @since 3.0.0 - * + * * @return {this} This Matter Physics instance. */ enableAttractorPlugin: function () @@ -142824,19 +144054,19 @@ var MatterPhysics = new Class({ /** * Enables the Matter Wrap Plugin. - * + * * The coordinate wrapping plugin that automatically wraps the position of bodies such that they always stay * within the given bounds. Upon crossing a boundary the body will appear on the opposite side of the bounds, * while maintaining its velocity. - * + * * https://github.com/liabru/matter-wrap - * + * * This method is called automatically if `plugins.wrap` is set in the Matter World Config. * However, you can also call it directly from within your game. * * @method Phaser.Physics.Matter.MatterPhysics#enableWrapPlugin * @since 3.0.0 - * + * * @return {this} This Matter Physics instance. */ enableWrapPlugin: function () @@ -142849,33 +144079,33 @@ var MatterPhysics = new Class({ /** * Enables the Matter Collision Events Plugin. - * + * * Note that this plugin is enabled by default. So you should only ever need to call this * method if you have specifically disabled the plugin in your Matter World Config. * You can disable it by setting `plugins.collisionevents: false` in your Matter World Config. - * + * * This plugin triggers three new events on Matter.Body: - * + * * 1. `onCollide` * 2. `onCollideEnd` * 3. `onCollideActive` - * + * * These events correspond to the Matter.js events `collisionStart`, `collisionActive` and `collisionEnd`, respectively. * You can listen to these events via Matter.Events or they will also be emitted from the Matter World. - * + * * This plugin also extends Matter.Body with three convenience functions: - * + * * `Matter.Body.setOnCollide(callback)` * `Matter.Body.setOnCollideEnd(callback)` * `Matter.Body.setOnCollideActive(callback)` - * + * * You can register event callbacks by providing a function of type (pair: Matter.Pair) => void - * + * * https://github.com/dxu/matter-collision-events * * @method Phaser.Physics.Matter.MatterPhysics#enableCollisionEventsPlugin * @since 3.22.0 - * + * * @return {this} This Matter Physics instance. */ enableCollisionEventsPlugin: function () @@ -142888,7 +144118,7 @@ var MatterPhysics = new Class({ /** * Pauses the Matter World instance and sets `enabled` to `false`. - * + * * A paused world will not run any simulations for the duration it is paused. * * @method Phaser.Physics.Matter.MatterPhysics#pause @@ -142951,12 +144181,12 @@ var MatterPhysics = new Class({ /** * Manually advances the physics simulation by one iteration. - * + * * You can optionally pass in the `delta` and `correction` values to be used by Engine.update. * If undefined they use the Matter defaults of 60Hz and no correction. - * + * * Calling `step` directly bypasses any checks of `enabled` or `autoUpdate`. - * + * * It also ignores any custom `getDelta` functions, as you should be passing the delta * value in to this call. * @@ -142983,22 +144213,22 @@ var MatterPhysics = new Class({ /** * Checks if the vertices of the given body, or an array of bodies, contains the given point, or not. - * + * * You can pass in either a single body, or an array of bodies to be checked. This method will * return `true` if _any_ of the bodies in the array contain the point. See the `intersectPoint` method if you need * to get a list of intersecting bodies. - * + * * The point should be transformed into the Matter World coordinate system in advance. This happens by * default with Input Pointers, but if you wish to use points from another system you may need to * transform them before passing them. - * + * * @method Phaser.Physics.Matter.MatterPhysics#containsPoint * @since 3.22.0 * * @param {(Phaser.Types.Physics.Matter.MatterBody|Phaser.Types.Physics.Matter.MatterBody[])} body - The body, or an array of bodies, to check against the point. * @param {number} x - The horizontal coordinate of the point. * @param {number} y - The vertical coordinate of the point. - * + * * @return {boolean} `true` if the point is within one of the bodies given, otherwise `false`. */ containsPoint: function (body, x, y) @@ -143014,20 +144244,20 @@ var MatterPhysics = new Class({ /** * Checks the given coordinates to see if any vertices of the given bodies contain it. - * + * * If no bodies are provided it will search all bodies in the Matter World, including within Composites. - * + * * The coordinates should be transformed into the Matter World coordinate system in advance. This happens by * default with Input Pointers, but if you wish to use coordinates from another system you may need to * transform them before passing them. - * + * * @method Phaser.Physics.Matter.MatterPhysics#intersectPoint * @since 3.22.0 * * @param {number} x - The horizontal coordinate of the point. * @param {number} y - The vertical coordinate of the point. * @param {Phaser.Types.Physics.Matter.MatterBody[]} [bodies] - An array of bodies to check. If not provided it will search all bodies in the world. - * + * * @return {Phaser.Types.Physics.Matter.MatterBody[]} An array of bodies which contain the given point. */ intersectPoint: function (x, y, bodies) @@ -143055,9 +144285,9 @@ var MatterPhysics = new Class({ * Checks the given rectangular area to see if any vertices of the given bodies intersect with it. * Or, if the `outside` parameter is set to `true`, it checks to see which bodies do not * intersect with it. - * + * * If no bodies are provided it will search all bodies in the Matter World, including within Composites. - * + * * @method Phaser.Physics.Matter.MatterPhysics#intersectRect * @since 3.22.0 * @@ -143067,7 +144297,7 @@ var MatterPhysics = new Class({ * @param {number} height - The height of the area. * @param {boolean} [outside=false] - If `false` it checks for vertices inside the area, if `true` it checks for vertices outside the area. * @param {Phaser.Types.Physics.Matter.MatterBody[]} [bodies] - An array of bodies to check. If not provided it will search all bodies in the world. - * + * * @return {Phaser.Types.Physics.Matter.MatterBody[]} An array of bodies that intersect with the given area. */ intersectRect: function (x, y, width, height, outside, bodies) @@ -143098,11 +144328,11 @@ var MatterPhysics = new Class({ /** * Checks the given ray segment to see if any vertices of the given bodies intersect with it. - * + * * If no bodies are provided it will search all bodies in the Matter World. - * + * * The width of the ray can be specified via the `rayWidth` parameter. - * + * * @method Phaser.Physics.Matter.MatterPhysics#intersectRay * @since 3.22.0 * @@ -143112,13 +144342,13 @@ var MatterPhysics = new Class({ * @param {number} y2 - The vertical coordinate of the end of the ray segment. * @param {number} [rayWidth=1] - The width of the ray segment. * @param {Phaser.Types.Physics.Matter.MatterBody[]} [bodies] - An array of bodies to check. If not provided it will search all bodies in the world. - * + * * @return {Phaser.Types.Physics.Matter.MatterBody[]} An array of bodies whos vertices intersect with the ray segment. */ intersectRay: function (x1, y1, x2, y2, rayWidth, bodies) { if (rayWidth === undefined) { rayWidth = 1; } - + bodies = this.getMatterBodies(bodies); var result = []; @@ -143134,15 +144364,15 @@ var MatterPhysics = new Class({ /** * Checks the given Matter Body to see if it intersects with any of the given bodies. - * + * * If no bodies are provided it will check against all bodies in the Matter World. - * + * * @method Phaser.Physics.Matter.MatterPhysics#intersectBody * @since 3.22.0 * * @param {Phaser.Types.Physics.Matter.MatterBody} body - The target body. * @param {Phaser.Types.Physics.Matter.MatterBody[]} [bodies] - An array of bodies to check the target body against. If not provided it will search all bodies in the world. - * + * * @return {Phaser.Types.Physics.Matter.MatterBody[]} An array of bodies whos vertices intersect with target body. */ intersectBody: function (body, bodies) @@ -143171,31 +144401,31 @@ var MatterPhysics = new Class({ /** * Checks to see if the target body, or an array of target bodies, intersects with any of the given bodies. - * + * * If intersection occurs this method will return `true` and, if provided, invoke the callbacks. - * + * * If no bodies are provided for the second parameter the target will check again all bodies in the Matter World. - * + * * Note that bodies can only overlap if they are in non-colliding collision groups or categories. - * + * * If you provide a `processCallback` then the two bodies that overlap are sent to it. This callback * must return a boolean and is used to allow you to perform additional processing tests before a final * outcome is decided. If it returns `true` then the bodies are finally passed to the `overlapCallback`, if set. - * + * * If you provide an `overlapCallback` then the matching pairs of overlapping bodies will be sent to it. - * + * * Both callbacks have the following signature: `function (bodyA, bodyB, collisionInfo)` where `bodyA` is always * the target body. The `collisionInfo` object contains additional data, such as the angle and depth of penetration. - * + * * @method Phaser.Physics.Matter.MatterPhysics#overlap * @since 3.22.0 * * @param {(Phaser.Types.Physics.Matter.MatterBody|Phaser.Types.Physics.Matter.MatterBody[])} target - The target body, or array of target bodies, to check. * @param {Phaser.Types.Physics.Matter.MatterBody[]} [bodies] - The second body, or array of bodies, to check. If falsey it will check against all bodies in the world. - * @param {ArcadePhysicsCallback} [overlapCallback] - An optional callback function that is called if the bodies overlap. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two bodies if they overlap. If this is set then `overlapCallback` will only be invoked if this callback returns `true`. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [overlapCallback] - An optional callback function that is called if the bodies overlap. + * @param {Phaser.Types.Physics.Arcade.ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two bodies if they overlap. If this is set then `overlapCallback` will only be invoked if this callback returns `true`. * @param {*} [callbackContext] - The context, or scope, in which to run the callbacks. - * + * * @return {boolean} `true` if the target body intersects with _any_ of the bodies given, otherwise `false`. */ overlap: function (target, bodies, overlapCallback, processCallback, callbackContext) @@ -143247,9 +144477,9 @@ var MatterPhysics = new Class({ /** * Sets the collision filter category of all given Matter Bodies to the given value. - * + * * This number must be a power of two between 2^0 (= 1) and 2^31. - * + * * Bodies with different collision groups (see {@link #setCollisionGroup}) will only collide if their collision * categories are included in their collision masks (see {@link #setCollidesWith}). * @@ -143275,10 +144505,10 @@ var MatterPhysics = new Class({ /** * Sets the collision filter group of all given Matter Bodies to the given value. - * + * * If the group value is zero, or if two Matter Bodies have different group values, * they will collide according to the usual collision filter rules (see {@link #setCollisionCategory} and {@link #setCollisionGroup}). - * + * * If two Matter Bodies have the same positive group value, they will always collide; * if they have the same negative group value they will never collide. * @@ -143304,9 +144534,9 @@ var MatterPhysics = new Class({ /** * Sets the collision filter mask of all given Matter Bodies to the given value. - * + * * Two Matter Bodies with different collision groups will only collide if each one includes the others - * category in its mask based on a bitwise AND operation: `(categoryA & maskB) !== 0` and + * category in its mask based on a bitwise AND operation: `(categoryA & maskB) !== 0` and * `(categoryB & maskA) !== 0` are both true. * * @method Phaser.Physics.Matter.MatterPhysics#setCollidesWith @@ -143345,10 +144575,10 @@ var MatterPhysics = new Class({ /** * Takes an array and returns a new array made from all of the Matter Bodies found in the original array. - * + * * For example, passing in Matter Game Objects, such as a bunch of Matter Sprites, to this method, would * return an array containing all of their native Matter Body objects. - * + * * If the `bodies` argument is falsey, it will return all bodies in the world. * * @method Phaser.Physics.Matter.MatterPhysics#getMatterBodies @@ -143524,7 +144754,7 @@ var MatterPhysics = new Class({ /** * Applies a force to a body, from the given world position, including resulting torque. * If no angle is given, the current body angle is used. - * + * * Use very small speed values, such as 0.1, depending on the mass and required velocity. * * @method Phaser.Physics.Matter.MatterPhysics#applyForceFromPosition @@ -143562,7 +144792,7 @@ var MatterPhysics = new Class({ /** * Apply a force to a body based on the given angle and speed. * If no angle is given, the current body angle is used. - * + * * Use very small speed values, such as 0.1, depending on the mass and required velocity. * * @method Phaser.Physics.Matter.MatterPhysics#applyForceFromAngle @@ -143630,22 +144860,22 @@ var MatterPhysics = new Class({ /** * Aligns a Body, or Matter Game Object, against the given coordinates. - * + * * The alignment takes place using the body bounds, which take into consideration things * like body scale and rotation. - * + * * Although a Body has a `position` property, it is based on the center of mass for the body, * not a dimension based center. This makes aligning bodies difficult, especially if they have * rotated or scaled. This method will derive the correct position based on the body bounds and * its center of mass offset, in order to align the body with the given coordinate. - * + * * For example, if you wanted to align a body so it sat in the bottom-center of the * Scene, and the world was 800 x 600 in size: - * + * * ```javascript * this.matter.alignBody(body, 400, 600, Phaser.Display.Align.BOTTOM_CENTER); * ``` - * + * * You pass in 400 for the x coordinate, because that is the center of the world, and 600 for * the y coordinate, as that is the base of the world. * @@ -143675,7 +144905,7 @@ var MatterPhysics = new Class({ case ALIGN_CONST.TOP_CENTER: pos = this.bodyBounds.getTopCenter(body, x, y); break; - + case ALIGN_CONST.TOP_RIGHT: case ALIGN_CONST.RIGHT_TOP: pos = this.bodyBounds.getTopRight(body, x, y); @@ -143782,7 +145012,7 @@ module.exports = MatterPhysics; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -143935,7 +145165,7 @@ module.exports = MatterSprite; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -144061,7 +145291,7 @@ var MatterTileBody = new Class({ * @since 3.0.0 * * @param {Phaser.Types.Physics.Matter.MatterBodyTileOptions} [options] - Options to be used when creating the Matter body. See MatterJS.Body for a list of what Matter accepts. - * + * * @return {Phaser.Physics.Matter.TileBody} This TileBody object. */ setFromTileRectangle: function (options) @@ -144095,7 +145325,7 @@ var MatterTileBody = new Class({ * @since 3.0.0 * * @param {Phaser.Types.Physics.Matter.MatterBodyTileOptions} [options] - Options to be used when creating the Matter body. See MatterJS.Body for a list of what Matter accepts. - * + * * @return {Phaser.Physics.Matter.TileBody} This TileBody object. */ setFromTileCollision: function (options) @@ -144186,7 +145416,7 @@ var MatterTileBody = new Class({ * * @param {MatterJS.BodyType} body - The new Matter body to use. * @param {boolean} [addToWorld=true] - Whether or not to add the body to the Matter world. - * + * * @return {Phaser.Physics.Matter.TileBody} This TileBody object. */ setBody: function (body, addToWorld) @@ -144258,7 +145488,7 @@ module.exports = MatterTileBody; * @author Joachim Grill * @author Richard Davey * @copyright 2018 CodeAndWeb GmbH - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -144287,7 +145517,7 @@ var PhysicsEditorParser = { * @param {number} y - The vertical world location of the body. * @param {object} config - The body configuration and fixture (child body) definitions, as exported by PhysicsEditor. * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation. - * + * * @return {MatterJS.BodyType} A compound Matter JS Body. */ parseBody: function (x, y, config, options) @@ -144317,7 +145547,7 @@ var PhysicsEditorParser = { var body = Body.create(matterConfig); Body.setParts(body, fixtures); - + Body.setPosition(body, { x: x, y: y }); return body; @@ -144330,7 +145560,7 @@ var PhysicsEditorParser = { * @since 3.10.0 * * @param {object} fixtureConfig - The fixture object to parse. - * + * * @return {MatterJS.BodyType[]} - An array of Matter JS Bodies. */ parseFixture: function (fixtureConfig) @@ -144365,7 +145595,7 @@ var PhysicsEditorParser = { * * @param {array} vertexSets - The vertex lists to parse. * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation. - * + * * @return {MatterJS.BodyType[]} - An array of Matter JS Bodies. */ parseVertices: function (vertexSets, options) @@ -144399,7 +145629,7 @@ module.exports = PhysicsEditorParser; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -144408,29 +145638,29 @@ var Body = __webpack_require__(84125); /** * Creates a body using the supplied physics data, as provided by a JSON file. - * + * * The data file should be loaded as JSON: - * + * * ```javascript * preload () * { * this.load.json('ninjas', 'assets/ninjas.json); * } - * + * * create () * { * const ninjaShapes = this.cache.json.get('ninjas'); - * + * * this.matter.add.fromJSON(400, 300, ninjaShapes.shinobi); * } * ``` - * + * * Do not pass the entire JSON file to this method, but instead pass one of the shapes contained within it. - * + * * If you pas in an `options` object, any settings in there will override those in the config object. - * + * * The structure of the JSON file is as follows: - * + * * ```text * { * 'generator_info': // The name of the application that created the JSON data @@ -144441,7 +145671,7 @@ var Body = __webpack_require__(84125); * } * } * ``` - * + * * At the time of writing, only the Phaser Physics Tracer App exports in this format. * * @namespace Phaser.Physics.Matter.PhysicsJSONParser @@ -144459,7 +145689,7 @@ var PhysicsJSONParser = { * @param {number} y - The vertical world location of the body. * @param {object} config - The body configuration data. * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation. - * + * * @return {MatterJS.BodyType} A Matter JS Body. */ parseBody: function (x, y, config, options) @@ -144517,7 +145747,7 @@ module.exports = PhysicsJSONParser; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -144540,7 +145770,7 @@ var Vertices = __webpack_require__(39745); * and when one is pressed down it checks to see if that hit any part of any active * body in the world. If it did, and the body has input enabled, it will begin to * drag it until either released, or you stop it via the `stopDrag` method. - * + * * You can adjust the stiffness, length and other properties of the constraint via * the `options` object on creation. * @@ -144618,7 +145848,7 @@ var PointerConstraint = new Class({ /** * Is this Constraint active or not? - * + * * An active constraint will be processed each update. An inactive one will be skipped. * Use this to toggle a Pointer Constraint on and off. * @@ -144673,7 +145903,7 @@ var PointerConstraint = new Class({ /** * A Pointer has been pressed down onto the Scene. - * + * * If this Constraint doesn't have an active Pointer then a hit test is set to * run against all active bodies in the world during the _next_ call to `update`. * If a body is found, it is bound to this constraint and the drag begins. @@ -144716,7 +145946,7 @@ var PointerConstraint = new Class({ * @method Phaser.Physics.Matter.PointerConstraint#getBody * @fires Phaser.Physics.Matter.Events#DRAG_START * @since 3.16.2 - * + * * @return {boolean} `true` if a body was found and set, otherwise `false`. */ getBody: function (pointer) @@ -144831,9 +146061,9 @@ var PointerConstraint = new Class({ var pos = this.position; var constraint = this.constraint; - + this.camera.getWorldPoint(pointer.x, pointer.y, pos); - + // Drag update constraint.pointA.x = pos.x; constraint.pointA.y = pos.y; @@ -144846,7 +146076,7 @@ var PointerConstraint = new Class({ /** * Stops the Pointer Constraint from dragging the body any further. - * + * * This is called automatically if the Pointer is released while actively * dragging a body. Or, you can call it manually to release a body from a * constraint without having to first release the pointer. @@ -144906,7 +146136,7 @@ module.exports = PointerConstraint; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -144929,15 +146159,15 @@ var Vector = __webpack_require__(10438); /** * @classdesc * The Matter World class is responsible for managing one single instance of a Matter Physics World for Phaser. - * + * * Access this via `this.matter.world` from within a Scene. - * + * * This class creates a Matter JS World Composite along with the Matter JS Engine during instantiation. It also * handles delta timing, bounds, body and constraint creation and debug drawing. - * + * * If you wish to access the Matter JS World object directly, see the `localWorld` property. * If you wish to access the Matter Engine directly, see the `engine` property. - * + * * This class is an Event Emitter and will proxy _all_ Matter JS events, as they are received. * * @class World @@ -145033,13 +146263,13 @@ var World = new Class({ /** * This function is called every time the core game loop steps, which is bound to the * Request Animation Frame frequency unless otherwise modified. - * + * * The function is passed two values: `time` and `delta`, both of which come from the game step values. - * + * * It must return a number. This number is used as the delta value passed to Matter.Engine.update. - * + * * You can override this function with your own to define your own timestep. - * + * * If you need to update the Engine multiple times in a single game step then call * `World.update` as many times as required. Each call will trigger the `getDelta` function. * If you wish to have full control over when the Engine updates then see the property `autoUpdate`. @@ -145077,7 +146307,7 @@ var World = new Class({ /** * The Matter JS Runner Configuration object. - * + * * This object is populated via the Matter Configuration object's `runner` property and is * updated constantly during the game step. * @@ -145136,12 +146366,12 @@ var World = new Class({ /** * The debug configuration object. - * + * * The values stored in this object are read from the Matter World Config `debug` property. - * + * * When a new Body or Constraint is _added to the World_, they are given the values stored in this object, * unless they have their own `render` object set that will override them. - * + * * Note that while you can modify the values of properties in this object at run-time, it will not change * any of the Matter objects _already added_. It will only impact objects newly added to the world, or one * that is removed and then re-added at a later time. @@ -145252,16 +146482,16 @@ var World = new Class({ /** * Sets the debug render style for the children of the given Matter Composite. - * + * * Composites themselves do not render, but they can contain bodies, constraints and other composites that may do. * So the children of this composite are passed to the `setBodyRenderStyle`, `setCompositeRenderStyle` and * `setConstraintRenderStyle` methods accordingly. - * + * * @method Phaser.Physics.Matter.World#setCompositeRenderStyle * @since 3.22.0 * * @param {MatterJS.CompositeType} composite - The Matter Composite to set the render style on. - * + * * @return {this} This Matter World instance for method chaining. */ setCompositeRenderStyle: function (composite) @@ -145302,15 +146532,15 @@ var World = new Class({ /** * Sets the debug render style for the given Matter Body. - * + * * If you are using this on a Phaser Game Object, such as a Matter Sprite, then pass in the body property * to this method, not the Game Object itself. - * + * * If you wish to skip a parameter, so it retains its current value, pass `false` for it. - * + * * If you wish to reset the Body render colors to the defaults found in the World Debug Config, then call * this method with just the `body` parameter provided and no others. - * + * * @method Phaser.Physics.Matter.World#setBodyRenderStyle * @since 3.22.0 * @@ -145320,7 +146550,7 @@ var World = new Class({ * @param {number} [lineThickness] - The line thickness. If `null` it will use the World Debug Config value. * @param {number} [fillColor] - The fill color. If `null` it will use the World Debug Config value. * @param {number} [fillOpacity] - The fill opacity, between 0 and 1. If `null` it will use the World Debug Config value. - * + * * @return {this} This Matter World instance for method chaining. */ setBodyRenderStyle: function (body, lineColor, lineOpacity, lineThickness, fillColor, fillOpacity) @@ -145388,15 +146618,15 @@ var World = new Class({ /** * Sets the debug render style for the given Matter Constraint. - * + * * If you are using this on a Phaser Game Object, then pass in the body property * to this method, not the Game Object itself. - * + * * If you wish to skip a parameter, so it retains its current value, pass `false` for it. - * + * * If you wish to reset the Constraint render colors to the defaults found in the World Debug Config, then call * this method with just the `constraint` parameter provided and no others. - * + * * @method Phaser.Physics.Matter.World#setConstraintRenderStyle * @since 3.22.0 * @@ -145407,7 +146637,7 @@ var World = new Class({ * @param {number} [pinSize] - If this constraint is a pin, this sets the size of the pin circle. If `null` it will use the World Debug Config value. * @param {number} [anchorColor] - The color used when rendering this constraints anchors. If `null` it will use the World Debug Config value. * @param {number} [anchorSize] - The size of the anchor circle, if this constraint has anchors. If `null` it will use the World Debug Config value. - * + * * @return {this} This Matter World instance for method chaining. */ setConstraintRenderStyle: function (constraint, lineColor, lineOpacity, lineThickness, pinSize, anchorColor, anchorSize) @@ -145522,12 +146752,12 @@ var World = new Class({ MatterEvents.on(world, 'beforeAdd', function (event) { var objects = [].concat(event.object); - + for (var i = 0; i < objects.length; i++) { var obj = objects[i]; var render = obj.render; - + if (obj.type === 'body') { _this.setBodyRenderStyle(obj, render.lineColor, render.lineOpacity, render.lineThickness, render.fillColor, render.fillOpacity); @@ -145707,12 +146937,12 @@ var World = new Class({ /** * Creates a Phaser.GameObjects.Graphics object that is used to render all of the debug bodies and joints to. - * + * * This method is called automatically by the constructor, if debugging has been enabled. - * + * * The created Graphics object is automatically added to the Scene at 0x0 and given a depth of `Number.MAX_VALUE`, * so it renders above all else in the Scene. - * + * * The Graphics object is assigned to the `debugGraphic` property of this class and `drawDebug` is enabled. * * @method Phaser.Physics.Matter.World#createDebugGraphic @@ -145752,7 +146982,7 @@ var World = new Class({ /** * Sets the worlds gravity to the values given. - * + * * Gravity effects all bodies in the world, unless they have the `ignoreGravity` flag set. * * @method Phaser.Physics.Matter.World#setGravity @@ -145805,9 +147035,9 @@ var World = new Class({ /** * Adds a Matter JS object, or array of objects, to the world. - * + * * The objects should be valid Matter JS entities, such as a Body, Composite or Constraint. - * + * * Triggers `beforeAdd` and `afterAdd` events. * * @method Phaser.Physics.Matter.World#add @@ -145826,9 +147056,9 @@ var World = new Class({ /** * Removes a Matter JS object, or array of objects, from the world. - * + * * The objects should be valid Matter JS entities, such as a Body, Composite or Constraint. - * + * * Triggers `beforeRemove` and `afterRemove` events. * * @method Phaser.Physics.Matter.World#remove @@ -145860,7 +147090,7 @@ var World = new Class({ /** * Removes a Matter JS constraint, or array of constraints, from the world. - * + * * Triggers `beforeRemove` and `afterRemove` events. * * @method Phaser.Physics.Matter.World#removeConstraint @@ -145880,7 +147110,7 @@ var World = new Class({ /** * Adds `MatterTileBody` instances for all the colliding tiles within the given tilemap layer. - * + * * Set the appropriate tiles in your layer to collide before calling this method! * * @method Phaser.Physics.Matter.World#convertTilemapLayer @@ -145960,7 +147190,7 @@ var World = new Class({ /** * Pauses this Matter World instance and sets `enabled` to `false`. - * + * * A paused world will not run any simulations for the duration it is paused. * * @method Phaser.Physics.Matter.World#pause @@ -145998,16 +147228,16 @@ var World = new Class({ /** * The internal update method. This is called automatically by the parent Scene. - * + * * Moves the simulation forward in time by delta ms. Uses `World.correction` value as an optional number that * specifies the time correction factor to apply to the update. This can help improve the accuracy of the * simulation in cases where delta is changing between updates. The value of correction is defined as `delta / lastDelta`, * i.e. the percentage change of delta over the last step. Therefore the value is always 1 (no correction) when * delta is constant (or when no correction is desired, which is the default). * See the paper on Time Corrected Verlet for more information. - * + * * Triggers `beforeUpdate` and `afterUpdate` events. Triggers `collisionStart`, `collisionActive` and `collisionEnd` events. - * + * * If the World is paused, `update` is still run, but exits early and does not update the Matter Engine. * * @method Phaser.Physics.Matter.World#update @@ -146044,7 +147274,7 @@ var World = new Class({ runner.deltaHistory.push(delta); runner.deltaHistory = runner.deltaHistory.slice(-runner.deltaSampleSize); delta = Math.min.apply(null, runner.deltaHistory); - + // limit delta delta = delta < runner.deltaMin ? runner.deltaMin : delta; delta = delta > runner.deltaMax ? runner.deltaMax : delta; @@ -146085,12 +147315,12 @@ var World = new Class({ /** * Manually advances the physics simulation by one iteration. - * + * * You can optionally pass in the `delta` and `correction` values to be used by Engine.update. * If undefined they use the Matter defaults of 60Hz and no correction. - * + * * Calling `step` directly bypasses any checks of `enabled` or `autoUpdate`. - * + * * It also ignores any custom `getDelta` functions, as you should be passing the delta * value in to this call. * @@ -146146,9 +147376,9 @@ var World = new Class({ * * @method Phaser.Physics.Matter.World#has * @since 3.22.0 - * + * * @param {(MatterJS.Body|Phaser.GameObjects.GameObject)} body - The Matter Body, or Game Object, to search for within the world. - * + * * @return {MatterJS.BodyType[]} An array of all the Matter JS Bodies in this World. */ has: function (body) @@ -146163,7 +147393,7 @@ var World = new Class({ * * @method Phaser.Physics.Matter.World#getAllBodies * @since 3.22.0 - * + * * @return {MatterJS.BodyType[]} An array of all the Matter JS Bodies in this World. */ getAllBodies: function () @@ -146176,7 +147406,7 @@ var World = new Class({ * * @method Phaser.Physics.Matter.World#getAllConstraints * @since 3.22.0 - * + * * @return {MatterJS.ConstraintType[]} An array of all the Matter JS Constraints in this World. */ getAllConstraints: function () @@ -146189,7 +147419,7 @@ var World = new Class({ * * @method Phaser.Physics.Matter.World#getAllComposites * @since 3.22.0 - * + * * @return {MatterJS.CompositeType[]} An array of all the Matter JS Composites in this World. */ getAllComposites: function () @@ -146199,7 +147429,7 @@ var World = new Class({ /** * Handles the rendering of bodies and debug information to the debug Graphics object, if enabled. - * + * * This method is called automatically by the Scene after all processing has taken place. * * @method Phaser.Physics.Matter.World#postUpdate @@ -146264,20 +147494,20 @@ var World = new Class({ /** * Renders the Engine Broadphase Controller Grid to the given Graphics instance. - * + * * The debug renderer calls this method if the `showBroadphase` config value is set. - * + * * This method is used internally by the Matter Debug Renderer, but is also exposed publically should * you wish to render the Grid to your own Graphics instance. - * + * * @method Phaser.Physics.Matter.World#renderGrid * @since 3.22.0 - * + * * @param {MatterJS.Grid} grid - The Matter Grid to be rendered. * @param {Phaser.GameObjects.Graphics} graphics - The Graphics object to render to. * @param {number} lineColor - The line color. * @param {number} lineOpacity - The line opacity, between 0 and 1. - * + * * @return {this} This Matter World instance for method chaining. */ renderGrid: function (grid, graphics, lineColor, lineOpacity) @@ -146310,19 +147540,19 @@ var World = new Class({ /** * Renders the list of Pair separations to the given Graphics instance. - * + * * The debug renderer calls this method if the `showSeparations` config value is set. - * + * * This method is used internally by the Matter Debug Renderer, but is also exposed publically should * you wish to render the Grid to your own Graphics instance. - * + * * @method Phaser.Physics.Matter.World#renderSeparations * @since 3.22.0 - * + * * @param {MatterJS.Pair[]} pairs - An array of Matter Pairs to be rendered. * @param {Phaser.GameObjects.Graphics} graphics - The Graphics object to render to. * @param {number} lineColor - The line color. - * + * * @return {this} This Matter World instance for method chaining. */ renderSeparations: function (pairs, graphics, lineColor) @@ -146346,7 +147576,7 @@ var World = new Class({ var penetration = collision.penetration; var k = (!bodyA.isStatic && !bodyB.isStatic) ? 4 : 1; - + if (bodyB.isStatic) { k = 0; @@ -146379,19 +147609,19 @@ var World = new Class({ /** * Renders the list of collision points and normals to the given Graphics instance. - * + * * The debug renderer calls this method if the `showCollisions` config value is set. - * + * * This method is used internally by the Matter Debug Renderer, but is also exposed publically should * you wish to render the Grid to your own Graphics instance. - * + * * @method Phaser.Physics.Matter.World#renderCollisions * @since 3.22.0 - * + * * @param {MatterJS.Pair[]} pairs - An array of Matter Pairs to be rendered. * @param {Phaser.GameObjects.Graphics} graphics - The Graphics object to render to. * @param {number} lineColor - The line color. - * + * * @return {this} This Matter World instance for method chaining. */ renderCollisions: function (pairs, graphics, lineColor) @@ -146473,17 +147703,17 @@ var World = new Class({ /** * Renders the bounds of an array of Bodies to the given Graphics instance. - * + * * If the body is a compound body, it will render the bounds for the parent compound. - * + * * The debug renderer calls this method if the `showBounds` config value is set. - * + * * This method is used internally by the Matter Debug Renderer, but is also exposed publically should * you wish to render bounds to your own Graphics instance. * * @method Phaser.Physics.Matter.World#renderBodyBounds * @since 3.22.0 - * + * * @param {array} bodies - An array of bodies from the localWorld. * @param {Phaser.GameObjects.Graphics} graphics - The Graphics object to render to. * @param {number} lineColor - The line color. @@ -146521,7 +147751,7 @@ var World = new Class({ for (var j = parts.length > 1 ? 1 : 0; j < parts.length; j++) { var part = parts[j]; - + graphics.strokeRect( part.bounds.min.x, part.bounds.min.y, @@ -146537,15 +147767,15 @@ var World = new Class({ /** * Renders either all axes, or a single axis indicator, for an array of Bodies, to the given Graphics instance. - * + * * The debug renderer calls this method if the `showAxes` or `showAngleIndicator` config values are set. - * + * * This method is used internally by the Matter Debug Renderer, but is also exposed publically should * you wish to render bounds to your own Graphics instance. * * @method Phaser.Physics.Matter.World#renderBodyAxes * @since 3.22.0 - * + * * @param {array} bodies - An array of bodies from the localWorld. * @param {Phaser.GameObjects.Graphics} graphics - The Graphics object to render to. * @param {boolean} showAxes - If `true` it will render all body axes. If `false` it will render a single axis indicator. @@ -146576,7 +147806,7 @@ var World = new Class({ for (j = parts.length > 1 ? 1 : 0; j < parts.length; j++) { part = parts[j]; - + for (k = 0; k < part.axes.length; k++) { var axis = part.axes[k]; @@ -146595,7 +147825,7 @@ var World = new Class({ for (j = parts.length > 1 ? 1 : 0; j < parts.length; j++) { part = parts[j]; - + for (k = 0; k < part.axes.length; k++) { graphics.lineBetween( @@ -146614,15 +147844,15 @@ var World = new Class({ /** * Renders a velocity indicator for an array of Bodies, to the given Graphics instance. - * + * * The debug renderer calls this method if the `showVelocity` config value is set. - * + * * This method is used internally by the Matter Debug Renderer, but is also exposed publically should * you wish to render bounds to your own Graphics instance. * * @method Phaser.Physics.Matter.World#renderBodyVelocity * @since 3.22.0 - * + * * @param {array} bodies - An array of bodies from the localWorld. * @param {Phaser.GameObjects.Graphics} graphics - The Graphics object to render to. * @param {number} lineColor - The line color. @@ -146656,13 +147886,13 @@ var World = new Class({ /** * Renders the given array of Bodies to the debug graphics instance. - * + * * Called automatically by the `postUpdate` method. * * @method Phaser.Physics.Matter.World#renderBodies * @private * @since 3.14.0 - * + * * @param {array} bodies - An array of bodies from the localWorld. */ renderBodies: function (bodies) @@ -146746,16 +147976,16 @@ var World = new Class({ /** * Renders a single Matter Body to the given Phaser Graphics Game Object. - * + * * This method is used internally by the Matter Debug Renderer, but is also exposed publically should * you wish to render a Body to your own Graphics instance. - * + * * If you don't wish to render a line around the body, set the `lineColor` parameter to `null`. * Equally, if you don't wish to render a fill, set the `fillColor` parameter to `null`. - * + * * @method Phaser.Physics.Matter.World#renderBody * @since 3.22.0 - * + * * @param {MatterJS.BodyType} body - The Matter Body to be rendered. * @param {Phaser.GameObjects.Graphics} graphics - The Graphics object to render to. * @param {boolean} showInternalEdges - Render internal edges of the polygon? @@ -146764,7 +147994,7 @@ var World = new Class({ * @param {number} [lineThickness=1] - The line thickness. * @param {number} [fillColor] - The fill color. * @param {number} [fillOpacity] - The fill opacity, between 0 and 1. - * + * * @return {this} This Matter World instance for method chaining. */ renderBody: function (body, graphics, showInternalEdges, lineColor, lineOpacity, lineThickness, fillColor, fillOpacity) @@ -146806,7 +148036,7 @@ var World = new Class({ { graphics.fillStyle(sensorFillColor, fillOpacity * opacity); } - + if (lineColor !== null) { graphics.lineStyle(lineThickness, sensorLineColor, lineOpacity * opacity); @@ -146818,7 +148048,7 @@ var World = new Class({ { graphics.fillStyle(fillColor, fillOpacity * opacity); } - + if (lineColor !== null) { graphics.lineStyle(lineThickness, lineColor, lineOpacity * opacity); @@ -146856,7 +148086,7 @@ var World = new Class({ graphics.moveTo(vertices[nextIndex].x, vertices[nextIndex].y); } } - + graphics.closePath(); } @@ -146886,18 +148116,18 @@ var World = new Class({ /** * Renders the Convex Hull for a single Matter Body to the given Phaser Graphics Game Object. - * + * * This method is used internally by the Matter Debug Renderer, but is also exposed publically should * you wish to render a Body hull to your own Graphics instance. - * + * * @method Phaser.Physics.Matter.World#renderConvexHull * @since 3.22.0 - * + * * @param {MatterJS.BodyType} body - The Matter Body to be rendered. * @param {Phaser.GameObjects.Graphics} graphics - The Graphics object to render to. * @param {number} hullColor - The color used to render the hull. * @param {number} [lineThickness=1] - The hull line thickness. - * + * * @return {this} This Matter World instance for method chaining. */ renderConvexHull: function (body, graphics, hullColor, lineThickness) @@ -146922,7 +148152,7 @@ var World = new Class({ { graphics.lineTo(verts[v].x, verts[v].y); } - + graphics.lineTo(verts[0].x, verts[0].y); graphics.strokePath(); @@ -146933,7 +148163,7 @@ var World = new Class({ /** * Renders all of the constraints in the world (unless they are specifically set to invisible). - * + * * Called automatically by the `postUpdate` method. * * @method Phaser.Physics.Matter.World#renderJoints @@ -146944,7 +148174,7 @@ var World = new Class({ { var graphics = this.debugGraphic; - // Render constraints + // Render constraints var constraints = Composite.allConstraints(this.localWorld); for (var i = 0; i < constraints.length; i++) @@ -146964,13 +148194,13 @@ var World = new Class({ /** * Renders a single Matter Constraint, such as a Pin or a Spring, to the given Phaser Graphics Game Object. - * + * * This method is used internally by the Matter Debug Renderer, but is also exposed publically should * you wish to render a Constraint to your own Graphics instance. - * + * * @method Phaser.Physics.Matter.World#renderConstraint * @since 3.22.0 - * + * * @param {MatterJS.ConstraintType} constraint - The Matter Constraint to render. * @param {Phaser.GameObjects.Graphics} graphics - The Graphics object to render to. * @param {number} lineColor - The line color. @@ -146979,7 +148209,7 @@ var World = new Class({ * @param {number} pinSize - If this constraint is a pin, this sets the size of the pin circle. * @param {number} anchorColor - The color used when rendering this constraints anchors. Set to `null` to not render anchors. * @param {number} anchorSize - The size of the anchor circle, if this constraint has anchors and is rendering them. - * + * * @return {this} This Matter World instance for method chaining. */ renderConstraint: function (constraint, graphics, lineColor, lineOpacity, lineThickness, pinSize, anchorColor, anchorSize) @@ -147060,7 +148290,7 @@ var World = new Class({ /** * Resets the internal collision IDs that Matter.JS uses for Body collision groups. - * + * * You should call this before destroying your game if you need to restart the game * again on the same page, without first reloading the page. Or, if you wish to * consistently destroy a Scene that contains Matter.js and then run it again @@ -147127,7 +148357,7 @@ module.exports = World; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -147168,7 +148398,7 @@ module.exports = Bounce; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -147254,7 +148484,7 @@ var Collision = { /** * The callback is sent a `Phaser.Types.Physics.Matter.MatterCollisionData` object. - * + * * This does not change the bodies collision category, group or filter. Those must be set in addition * to the callback. * @@ -147274,7 +148504,7 @@ var Collision = { /** * The callback is sent a `Phaser.Types.Physics.Matter.MatterCollisionData` object. - * + * * This does not change the bodies collision category, group or filter. Those must be set in addition * to the callback. * @@ -147294,7 +148524,7 @@ var Collision = { /** * The callback is sent a `Phaser.Types.Physics.Matter.MatterCollisionData` object. - * + * * This does not change the bodies collision category, group or filter. Those must be set in addition * to the callback. * @@ -147314,7 +148544,7 @@ var Collision = { /** * The callback is sent a reference to the other body, along with a `Phaser.Types.Physics.Matter.MatterCollisionData` object. - * + * * This does not change the bodies collision category, group or filter. Those must be set in addition * to the callback. * @@ -147355,7 +148585,7 @@ module.exports = Collision; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -147410,7 +148640,7 @@ var Force = { /** * Apply thrust to the forward position of the body. - * + * * Use very small values, such as 0.1, depending on the mass and required speed. * * @method Phaser.Physics.Matter.Components.Force#thrust @@ -147433,7 +148663,7 @@ var Force = { /** * Apply thrust to the left position of the body. - * + * * Use very small values, such as 0.1, depending on the mass and required speed. * * @method Phaser.Physics.Matter.Components.Force#thrustLeft @@ -147456,7 +148686,7 @@ var Force = { /** * Apply thrust to the right position of the body. - * + * * Use very small values, such as 0.1, depending on the mass and required speed. * * @method Phaser.Physics.Matter.Components.Force#thrustRight @@ -147479,7 +148709,7 @@ var Force = { /** * Apply thrust to the back position of the body. - * + * * Use very small values, such as 0.1, depending on the mass and required speed. * * @method Phaser.Physics.Matter.Components.Force#thrustBack @@ -147512,7 +148742,7 @@ module.exports = Force; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -147603,7 +148833,7 @@ module.exports = Friction; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -147644,7 +148874,7 @@ module.exports = Gravity; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -147695,9 +148925,9 @@ var Mass = { /** * The body's center of mass. - * + * * Calling this creates a new `Vector2 each time to avoid mutation. - * + * * If you only need to read the value and won't change it, you can get it from `GameObject.body.centerOfMass`. * * @name Phaser.Physics.Matter.Components.Mass#centerOfMass @@ -147727,7 +148957,7 @@ module.exports = Mass; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -147782,7 +149012,7 @@ module.exports = Sensor; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -147804,7 +149034,7 @@ var SetBody = { /** * Set the body on a Game Object to a rectangle. - * + * * Calling this methods resets previous properties you may have set on the body, including * plugins, mass, friction, etc. So be sure to re-apply these in the options object if needed. * @@ -147824,7 +149054,7 @@ var SetBody = { /** * Set the body on a Game Object to a circle. - * + * * Calling this methods resets previous properties you may have set on the body, including * plugins, mass, friction, etc. So be sure to re-apply these in the options object if needed. * @@ -147843,7 +149073,7 @@ var SetBody = { /** * Set the body on the Game Object to a polygon shape. - * + * * Calling this methods resets previous properties you may have set on the body, including * plugins, mass, friction, etc. So be sure to re-apply these in the options object if needed. * @@ -147863,7 +149093,7 @@ var SetBody = { /** * Set the body on the Game Object to a trapezoid shape. - * + * * Calling this methods resets previous properties you may have set on the body, including * plugins, mass, friction, etc. So be sure to re-apply these in the options object if needed. * @@ -147884,7 +149114,7 @@ var SetBody = { /** * Set this Game Object to use the given existing Matter Body. - * + * * The body is first removed from the world before being added to this Game Object. * * @method Phaser.Physics.Matter.Components.SetBody#setExistingBody @@ -147956,7 +149186,7 @@ var SetBody = { /** * Set this Game Object to create and use a new Body based on the configuration object given. - * + * * Calling this method resets previous properties you may have set on the body, including * plugins, mass, friction, etc. So be sure to re-apply these in the options object if needed. * @@ -148037,7 +149267,7 @@ var SetBody = { var flagInternal = GetFastValue(config, 'flagInternal', false); var removeCollinear = GetFastValue(config, 'removeCollinear', 0.01); var minimumArea = GetFastValue(config, 'minimumArea', 10); - + body = Bodies.fromVertices(bodyX, bodyY, verts, options, flagInternal, removeCollinear, minimumArea); } } @@ -148073,7 +149303,7 @@ module.exports = SetBody; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -148232,7 +149462,7 @@ module.exports = Sleep; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -148288,7 +149518,7 @@ module.exports = Static; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -148374,7 +149604,7 @@ var Transform = { { var factorX = 1 / this._scaleX; var factorY = 1 / this._scaleY; - + this._scaleX = value; if (this._scaleX === 0) @@ -148604,7 +149834,7 @@ module.exports = Transform; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -148706,7 +149936,7 @@ module.exports = Velocity; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -148739,7 +149969,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -148753,15 +149983,15 @@ module.exports = { /** * The Matter Physics After Add Event. - * + * * This event is dispatched by a Matter Physics World instance at the end of the process when a new Body * or Constraint has just been added to the world. - * + * * Listen to it from a Scene using: `this.matter.world.on('afteradd', listener)`. * * @event Phaser.Physics.Matter.Events#AFTER_ADD * @since 3.22.0 - * + * * @param {Phaser.Physics.Matter.Events.AfterAddEvent} event - The Add Event object. */ module.exports = 'afteradd'; @@ -148774,7 +150004,7 @@ module.exports = 'afteradd'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -148788,15 +150018,15 @@ module.exports = 'afteradd'; /** * The Matter Physics After Remove Event. - * - * This event is dispatched by a Matter Physics World instance at the end of the process when a + * + * This event is dispatched by a Matter Physics World instance at the end of the process when a * Body or Constraint was removed from the world. - * + * * Listen to it from a Scene using: `this.matter.world.on('afterremove', listener)`. * * @event Phaser.Physics.Matter.Events#AFTER_REMOVE * @since 3.22.0 - * + * * @param {Phaser.Physics.Matter.Events.AfterRemoveEvent} event - The Remove Event object. */ module.exports = 'afterremove'; @@ -148809,7 +150039,7 @@ module.exports = 'afterremove'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -148823,14 +150053,14 @@ module.exports = 'afterremove'; /** * The Matter Physics After Update Event. - * + * * This event is dispatched by a Matter Physics World instance after the engine has updated and all collision events have resolved. - * + * * Listen to it from a Scene using: `this.matter.world.on('afterupdate', listener)`. * * @event Phaser.Physics.Matter.Events#AFTER_UPDATE * @since 3.0.0 - * + * * @param {Phaser.Physics.Matter.Events.AfterUpdateEvent} event - The Update Event object. */ module.exports = 'afterupdate'; @@ -148843,7 +150073,7 @@ module.exports = 'afterupdate'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -148857,15 +150087,15 @@ module.exports = 'afterupdate'; /** * The Matter Physics Before Add Event. - * + * * This event is dispatched by a Matter Physics World instance at the start of the process when a new Body * or Constraint is being added to the world. - * + * * Listen to it from a Scene using: `this.matter.world.on('beforeadd', listener)`. * * @event Phaser.Physics.Matter.Events#BEFORE_ADD * @since 3.22.0 - * + * * @param {Phaser.Physics.Matter.Events.BeforeAddEvent} event - The Add Event object. */ module.exports = 'beforeadd'; @@ -148878,7 +150108,7 @@ module.exports = 'beforeadd'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -148892,15 +150122,15 @@ module.exports = 'beforeadd'; /** * The Matter Physics Before Remove Event. - * - * This event is dispatched by a Matter Physics World instance at the start of the process when a + * + * This event is dispatched by a Matter Physics World instance at the start of the process when a * Body or Constraint is being removed from the world. - * + * * Listen to it from a Scene using: `this.matter.world.on('beforeremove', listener)`. * * @event Phaser.Physics.Matter.Events#BEFORE_REMOVE * @since 3.22.0 - * + * * @param {Phaser.Physics.Matter.Events.BeforeRemoveEvent} event - The Remove Event object. */ module.exports = 'beforeremove'; @@ -148913,7 +150143,7 @@ module.exports = 'beforeremove'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -148927,14 +150157,14 @@ module.exports = 'beforeremove'; /** * The Matter Physics Before Update Event. - * + * * This event is dispatched by a Matter Physics World instance right before all the collision processing takes place. - * + * * Listen to it from a Scene using: `this.matter.world.on('beforeupdate', listener)`. * * @event Phaser.Physics.Matter.Events#BEFORE_UPDATE * @since 3.0.0 - * + * * @param {Phaser.Physics.Matter.Events.BeforeUpdateEvent} event - The Update Event object. */ module.exports = 'beforeupdate'; @@ -148947,7 +150177,7 @@ module.exports = 'beforeupdate'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -148962,15 +150192,15 @@ module.exports = 'beforeupdate'; /** * The Matter Physics Collision Active Event. - * + * * This event is dispatched by a Matter Physics World instance after the engine has updated. * It provides a list of all pairs that are colliding in the current tick (if any). - * + * * Listen to it from a Scene using: `this.matter.world.on('collisionactive', listener)`. * * @event Phaser.Physics.Matter.Events#COLLISION_ACTIVE * @since 3.0.0 - * + * * @param {Phaser.Physics.Matter.Events.CollisionActiveEvent} event - The Collision Event object. * @param {MatterJS.BodyType} bodyA - The first body of the first colliding pair. The `event.pairs` array may contain more colliding bodies. * @param {MatterJS.BodyType} bodyB - The second body of the first colliding pair. The `event.pairs` array may contain more colliding bodies. @@ -148985,7 +150215,7 @@ module.exports = 'collisionactive'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -149000,15 +150230,15 @@ module.exports = 'collisionactive'; /** * The Matter Physics Collision End Event. - * + * * This event is dispatched by a Matter Physics World instance after the engine has updated. * It provides a list of all pairs that have finished colliding in the current tick (if any). - * + * * Listen to it from a Scene using: `this.matter.world.on('collisionend', listener)`. * * @event Phaser.Physics.Matter.Events#COLLISION_END * @since 3.0.0 - * + * * @param {Phaser.Physics.Matter.Events.CollisionEndEvent} event - The Collision Event object. * @param {MatterJS.BodyType} bodyA - The first body of the first colliding pair. The `event.pairs` array may contain more colliding bodies. * @param {MatterJS.BodyType} bodyB - The second body of the first colliding pair. The `event.pairs` array may contain more colliding bodies. @@ -149023,7 +150253,7 @@ module.exports = 'collisionend'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -149038,15 +150268,15 @@ module.exports = 'collisionend'; /** * The Matter Physics Collision Start Event. - * + * * This event is dispatched by a Matter Physics World instance after the engine has updated. * It provides a list of all pairs that have started to collide in the current tick (if any). - * + * * Listen to it from a Scene using: `this.matter.world.on('collisionstart', listener)`. * * @event Phaser.Physics.Matter.Events#COLLISION_START * @since 3.0.0 - * + * * @param {Phaser.Physics.Matter.Events.CollisionStartEvent} event - The Collision Event object. * @param {MatterJS.BodyType} bodyA - The first body of the first colliding pair. The `event.pairs` array may contain more colliding bodies. * @param {MatterJS.BodyType} bodyB - The second body of the first colliding pair. The `event.pairs` array may contain more colliding bodies. @@ -149061,21 +150291,21 @@ module.exports = 'collisionstart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Matter Physics Drag End Event. - * + * * This event is dispatched by a Matter Physics World instance when a Pointer Constraint * stops dragging a body. - * + * * Listen to it from a Scene using: `this.matter.world.on('dragend', listener)`. * * @event Phaser.Physics.Matter.Events#DRAG_END * @since 3.16.2 - * + * * @param {MatterJS.BodyType} body - The Body that has stopped being dragged. This is a Matter Body, not a Phaser Game Object. * @param {Phaser.Physics.Matter.PointerConstraint} constraint - The Pointer Constraint that was dragging the body. */ @@ -149089,21 +150319,21 @@ module.exports = 'dragend'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Matter Physics Drag Event. - * + * * This event is dispatched by a Matter Physics World instance when a Pointer Constraint * is actively dragging a body. It is emitted each time the pointer moves. - * + * * Listen to it from a Scene using: `this.matter.world.on('drag', listener)`. * * @event Phaser.Physics.Matter.Events#DRAG * @since 3.16.2 - * + * * @param {MatterJS.BodyType} body - The Body that is being dragged. This is a Matter Body, not a Phaser Game Object. * @param {Phaser.Physics.Matter.PointerConstraint} constraint - The Pointer Constraint that is dragging the body. */ @@ -149117,21 +150347,21 @@ module.exports = 'drag'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Matter Physics Drag Start Event. - * + * * This event is dispatched by a Matter Physics World instance when a Pointer Constraint * starts dragging a body. - * + * * Listen to it from a Scene using: `this.matter.world.on('dragstart', listener)`. * * @event Phaser.Physics.Matter.Events#DRAG_START * @since 3.16.2 - * + * * @param {MatterJS.BodyType} body - The Body that has started being dragged. This is a Matter Body, not a Phaser Game Object. * @param {MatterJS.BodyType} part - The part of the body that was clicked on. * @param {Phaser.Physics.Matter.PointerConstraint} constraint - The Pointer Constraint that is dragging the body. @@ -149146,15 +150376,15 @@ module.exports = 'dragstart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Matter Physics World Pause Event. - * + * * This event is dispatched by an Matter Physics World instance when it is paused. - * + * * Listen to it from a Scene using: `this.matter.world.on('pause', listener)`. * * @event Phaser.Physics.Matter.Events#PAUSE @@ -149170,15 +150400,15 @@ module.exports = 'pause'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Matter Physics World Resume Event. - * + * * This event is dispatched by an Matter Physics World instance when it resumes from a paused state. - * + * * Listen to it from a Scene using: `this.matter.world.on('resume', listener)`. * * @event Phaser.Physics.Matter.Events#RESUME @@ -149194,7 +150424,7 @@ module.exports = 'resume'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -149207,14 +150437,14 @@ module.exports = 'resume'; /** * The Matter Physics Sleep End Event. - * + * * This event is dispatched by a Matter Physics World instance when a Body stop sleeping. - * + * * Listen to it from a Scene using: `this.matter.world.on('sleepend', listener)`. * * @event Phaser.Physics.Matter.Events#SLEEP_END * @since 3.0.0 - * + * * @param {Phaser.Physics.Matter.Events.SleepEndEvent} event - The Sleep Event object. * @param {MatterJS.BodyType} body - The body that has stopped sleeping. */ @@ -149228,7 +150458,7 @@ module.exports = 'sleepend'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -149241,14 +150471,14 @@ module.exports = 'sleepend'; /** * The Matter Physics Sleep Start Event. - * + * * This event is dispatched by a Matter Physics World instance when a Body goes to sleep. - * + * * Listen to it from a Scene using: `this.matter.world.on('sleepstart', listener)`. * * @event Phaser.Physics.Matter.Events#SLEEP_START * @since 3.0.0 - * + * * @param {Phaser.Physics.Matter.Events.SleepStartEvent} event - The Sleep Event object. * @param {MatterJS.BodyType} body - The body that has gone to sleep. */ @@ -149262,7 +150492,7 @@ module.exports = 'sleepstart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -149299,7 +150529,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -149382,7 +150612,6 @@ var Axes = __webpack_require__(50658); force: { x: 0, y: 0 }, torque: 0, positionImpulse: { x: 0, y: 0 }, - previousPositionImpulse: { x: 0, y: 0 }, constraintImpulse: { x: 0, y: 0, angle: 0 }, totalContacts: 0, speed: 0, @@ -149543,13 +150772,13 @@ var Axes = __webpack_require__(50658); { var centerOfMass = body.centerOfMass; var centerOffset = body.centerOffset; - + var bodyWidth = bounds.max.x - bounds.min.x; var bodyHeight = bounds.max.y - bounds.min.y; - + centerOfMass.x = -(bounds.min.x - body.position.x) / bodyWidth; centerOfMass.y = -(bounds.min.y - body.position.y) / bodyHeight; - + centerOffset.x = bodyWidth * centerOfMass.x; centerOffset.y = bodyHeight * centerOfMass.y; } @@ -149697,7 +150926,7 @@ var Axes = __webpack_require__(50658); }; /** - * Sets the moment of inertia (i.e. second moment of area) of the body. + * Sets the moment of inertia (i.e. second moment of area) of the body. * Inverse inertia is automatically updated to reflect the change. Mass is not changed. * @method setInertia * @param {body} body @@ -149826,7 +151055,7 @@ var Axes = __webpack_require__(50658); }; /** - * Set the centre of mass of the body. + * Set the centre of mass of the body. * The `centre` is a vector in world-space unless `relative` is set, in which case it is a translation. * The centre of mass is the point the body rotates about and can be used to simulate non-uniform density. * This is equal to moving `body.position` but not the `body.vertices`. @@ -149943,7 +151172,7 @@ var Axes = __webpack_require__(50658); sin = Math.sin(rotation), dx = body.position.x - point.x, dy = body.position.y - point.y; - + Body.setPosition(body, { x: point.x + (dx * cos - dy * sin), y: point.y + (dx * sin + dy * cos) @@ -150010,7 +151239,7 @@ var Axes = __webpack_require__(50658); } // handle circles - if (body.circleRadius) { + if (body.circleRadius) { if (scaleX === scaleY) { body.circleRadius *= scaleX; } else { @@ -150059,7 +151288,7 @@ var Axes = __webpack_require__(50658); var part = body.parts[i]; Vertices.translate(part.vertices, body.velocity); - + if (i > 0) { part.position.x += body.velocity.x; part.position.y += body.velocity.y; @@ -150183,7 +151412,7 @@ var Axes = __webpack_require__(50658); */ /** - * An array of bodies that make up this body. + * An array of bodies that make up this body. * The first body in the array must always be a self reference to the current body instance. * All bodies in the `parts` array together form a single rigid compound body. * Parts are allowed to overlap, have gaps or holes or even form concave bodies. @@ -150225,7 +151454,7 @@ var Axes = __webpack_require__(50658); * [{ x: 0, y: 0 }, { x: 25, y: 50 }, { x: 50, y: 0 }] * * When passed via `Body.create`, the vertices are translated relative to `body.position` (i.e. world-space, and constantly updated by `Body.update` during simulation). - * The `Vector` objects are also augmented with additional properties required for efficient collision detection. + * The `Vector` objects are also augmented with additional properties required for efficient collision detection. * * Other properties such as `inertia` and `bounds` are automatically calculated from the passed vertices (unless provided via `options`). * Concave hulls are not currently supported. The module `Matter.Vertices` contains useful methods for working with vertices. @@ -150285,7 +151514,7 @@ var Axes = __webpack_require__(50658); */ /** - * A `Vector` that _measures_ the current velocity of the body after the last `Body.update`. It is read-only. + * A `Vector` that _measures_ the current velocity of the body after the last `Body.update`. It is read-only. * If you need to modify a body's velocity directly, you should either apply a force or simply change the body's `position` (as the engine uses position-Verlet integration). * * @readOnly @@ -150295,7 +151524,7 @@ var Axes = __webpack_require__(50658); */ /** - * A `Number` that _measures_ the current angular velocity of the body after the last `Body.update`. It is read-only. + * A `Number` that _measures_ the current angular velocity of the body after the last `Body.update`. It is read-only. * If you need to modify a body's angular velocity directly, you should apply a torque or simply change the body's `angle` (as the engine uses position-Verlet integration). * * @readOnly @@ -150393,7 +151622,7 @@ var Axes = __webpack_require__(50658); /** * A `Number` that defines the restitution (elasticity) of the body. The value is always positive and is in the range `(0, 1)`. - * A value of `0` means collisions may be perfectly inelastic and no bouncing may occur. + * A value of `0` means collisions may be perfectly inelastic and no bouncing may occur. * A value of `0.8` means the body may bounce back with approximately 80% of its kinetic energy. * Note that collision response is based on _pairs_ of bodies, and that `restitution` values are _combined_ with the following formula: * @@ -150409,7 +151638,7 @@ var Axes = __webpack_require__(50658); * A value of `0` means that the body may slide indefinitely. * A value of `1` means the body may come to a stop almost instantly after a force is applied. * - * The effects of the value may be non-linear. + * The effects of the value may be non-linear. * High values may be unstable depending on the body. * The engine uses a Coulomb friction model including static and kinetic friction. * Note that collision response is based on _pairs_ of bodies, and that `friction` values are _combined_ with the following formula: @@ -150422,7 +151651,7 @@ var Axes = __webpack_require__(50658); */ /** - * A `Number` that defines the static friction of the body (in the Coulomb friction model). + * A `Number` that defines the static friction of the body (in the Coulomb friction model). * A value of `0` means the body will never 'stick' when it is nearly stationary and only dynamic `friction` is used. * The higher the value (e.g. `10`), the more force it will take to initially get the body moving when nearly stationary. * This value is multiplied with the `friction` property to make it easier to change `friction` and maintain an appropriate amount of static friction. @@ -150433,10 +151662,10 @@ var Axes = __webpack_require__(50658); */ /** - * A `Number` that defines the air friction of the body (air resistance). + * A `Number` that defines the air friction of the body (air resistance). * A value of `0` means the body will never slow as it moves through space. * The higher the value, the faster a body slows when moving through space. - * The effects of the value are non-linear. + * The effects of the value are non-linear. * * @property frictionAir * @type number @@ -150605,13 +151834,13 @@ var Axes = __webpack_require__(50658); * @property axes * @type vector[] */ - + /** * A `Number` that _measures_ the area of the body's convex hull, calculated at creation by `Body.create`. * * @property area * @type string - * @default + * @default */ /** @@ -150672,7 +151901,7 @@ var Axes = __webpack_require__(50658); /** * A callback that is invoked when this Body starts colliding with any other Body. - * + * * You can register callbacks by providing a function of type `( pair: Matter.Pair) => void`. * * @property onCollideCallback @@ -150682,7 +151911,7 @@ var Axes = __webpack_require__(50658); /** * A callback that is invoked when this Body stops colliding with any other Body. - * + * * You can register callbacks by providing a function of type `( pair: Matter.Pair) => void`. * * @property onCollideEndCallback @@ -150692,7 +151921,7 @@ var Axes = __webpack_require__(50658); /** * A callback that is invoked for the duration that this Body is colliding with any other Body. - * + * * You can register callbacks by providing a function of type `( pair: Matter.Pair) => void`. * * @property onCollideActiveCallback @@ -150755,7 +151984,12 @@ var Body = __webpack_require__(84125); constraints: [], composites: [], label: 'Composite', - plugin: {} + plugin: {}, + cache: { + allBodies: null, + allConstraints: null, + allComposites: null + } }, options); }; @@ -150775,12 +152009,18 @@ var Body = __webpack_require__(84125); composite.isModified = isModified; + if (isModified && composite.cache) { + composite.cache.allBodies = null; + composite.cache.allConstraints = null; + composite.cache.allComposites = null; + } + if (updateParents && composite.parent) { Composite.setModified(composite.parent, isModified, updateParents, updateChildren); } if (updateChildren) { - for(var i = 0; i < composite.composites.length; i++) { + for (var i = 0; i < composite.composites.length; i++) { var childComposite = composite.composites[i]; Composite.setModified(childComposite, isModified, updateParents, updateChildren); } @@ -150788,11 +152028,11 @@ var Body = __webpack_require__(84125); }; /** - * Generic add function. Adds one or many body(s), constraint(s) or a composite(s) to the given composite. + * Generic single or multi-add function. Adds a single or an array of body(s), constraint(s) or composite(s) to the given composite. * Triggers `beforeAdd` and `afterAdd` events on the `composite`. * @method add * @param {composite} composite - * @param {} object + * @param {object|array} object A single or an array of body(s), constraint(s) or composite(s) * @return {composite} The original composite with the objects added */ Composite.add = function(composite, object) { @@ -150838,7 +152078,7 @@ var Body = __webpack_require__(84125); * Triggers `beforeRemove` and `afterRemove` events on the `composite`. * @method remove * @param {composite} composite - * @param {} object + * @param {object|array} object * @param {boolean} [deep=false] * @return {composite} The original composite with the objects removed */ @@ -150898,10 +152138,9 @@ var Body = __webpack_require__(84125); * @return {composite} The original compositeA with the composite removed */ Composite.removeComposite = function(compositeA, compositeB, deep) { - var position = compositeA.composites.indexOf(compositeB); + var position = Common.indexOf(compositeA.composites, compositeB); if (position !== -1) { Composite.removeCompositeAt(compositeA, position); - Composite.setModified(compositeA, true, true, false); } if (deep) { @@ -150951,10 +152190,9 @@ var Body = __webpack_require__(84125); * @return {composite} The original composite with the body removed */ Composite.removeBody = function(composite, body, deep) { - var position = composite.bodies.indexOf(body); + var position = Common.indexOf(composite.bodies, body); if (position !== -1) { Composite.removeBodyAt(composite, position); - Composite.setModified(composite, true, true, false); } if (deep) { @@ -151004,7 +152242,7 @@ var Body = __webpack_require__(84125); * @return {composite} The original composite with the constraint removed */ Composite.removeConstraint = function(composite, constraint, deep) { - var position = composite.constraints.indexOf(constraint); + var position = Common.indexOf(composite.constraints, constraint); if (position !== -1) { Composite.removeConstraintAt(composite, position); } @@ -151055,6 +152293,7 @@ var Body = __webpack_require__(84125); composite.constraints.length = 0; composite.composites.length = 0; + Composite.setModified(composite, true, true, false); return composite; @@ -151067,11 +152306,19 @@ var Body = __webpack_require__(84125); * @return {body[]} All the bodies */ Composite.allBodies = function(composite) { + if (composite.cache && composite.cache.allBodies) { + return composite.cache.allBodies; + } + var bodies = [].concat(composite.bodies); for (var i = 0; i < composite.composites.length; i++) bodies = bodies.concat(Composite.allBodies(composite.composites[i])); + if (composite.cache) { + composite.cache.allBodies = bodies; + } + return bodies; }; @@ -151082,11 +152329,19 @@ var Body = __webpack_require__(84125); * @return {constraint[]} All the constraints */ Composite.allConstraints = function(composite) { + if (composite.cache && composite.cache.allConstraints) { + return composite.cache.allConstraints; + } + var constraints = [].concat(composite.constraints); for (var i = 0; i < composite.composites.length; i++) constraints = constraints.concat(Composite.allConstraints(composite.composites[i])); + if (composite.cache) { + composite.cache.allConstraints = constraints; + } + return constraints; }; @@ -151097,11 +152352,19 @@ var Body = __webpack_require__(84125); * @return {composite[]} All the composites */ Composite.allComposites = function(composite) { + if (composite.cache && composite.cache.allComposites) { + return composite.cache.allComposites; + } + var composites = [].concat(composite.composites); for (var i = 0; i < composite.composites.length; i++) composites = composites.concat(Composite.allComposites(composite.composites[i])); + if (composite.cache) { + composite.cache.allComposites = composites; + } + return composites; }; @@ -151168,8 +152431,6 @@ var Body = __webpack_require__(84125); objects[i].id = Common.nextId(); } - Composite.setModified(composite, true, true, false); - return composite; }; @@ -151188,8 +152449,6 @@ var Body = __webpack_require__(84125); Body.translate(bodies[i], translation); } - Composite.setModified(composite, true, true, false); - return composite; }; @@ -151219,8 +152478,6 @@ var Body = __webpack_require__(84125); Body.rotate(body, rotation); } - Composite.setModified(composite, true, true, false); - return composite; }; @@ -151249,8 +152506,6 @@ var Body = __webpack_require__(84125); Body.scale(body, scaleX, scaleY); } - Composite.setModified(composite, true, true, false); - return composite; }; @@ -151403,6 +152658,15 @@ var Body = __webpack_require__(84125); * @type {} */ + /** + * An object used for storing cached results for performance reasons. + * This is used internally only and is automatically managed. + * + * @private + * @property cache + * @type {} + */ + })(); @@ -151412,13 +152676,15 @@ var Body = __webpack_require__(84125); /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** -* The `Matter.World` module contains methods for creating and manipulating the world composite. -* A `Matter.World` is a `Matter.Composite` body, which is a collection of `Matter.Body`, `Matter.Constraint` and other `Matter.Composite`. -* A `Matter.World` has a few additional properties including `gravity` and `bounds`. -* It is important to use the functions in the `Matter.Composite` module to modify the world composite, rather than directly modifying its properties. -* There are also a few methods here that alias those in `Matter.Composite` for easier readability. +* This module has now been replaced by `Matter.Composite`. * -* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples). +* All usage should be migrated to the equivalent functions found on `Matter.Composite`. +* For example `World.add(world, body)` now becomes `Composite.add(world, body)`. +* +* The property `world.gravity` has been moved to `engine.gravity`. +* +* For back-compatibility purposes this module will remain as a direct alias to `Matter.Composite` in the short term during migration. +* Eventually this alias module will be marked as deprecated and then later removed in a future release. * * @class World * @extends Composite @@ -151429,37 +152695,19 @@ var World = {}; module.exports = World; var Composite = __webpack_require__(11299); -var Constraint = __webpack_require__(52838); -var Common = __webpack_require__(68758); (function() { /** - * Creates a new world composite. The options parameter is an object that specifies any properties you wish to override the defaults. - * See the properties section below for detailed information on what you can pass via the `options` object. - * @method create - * @constructor - * @param {} options - * @return {world} A new world + * See above, aliases for back compatibility only */ - World.create = function(options) { - var composite = Composite.create(); - - var defaults = { - label: 'World', - gravity: { - x: 0, - y: 1, - scale: 0.001 - }, - bounds: { - min: { x: -Infinity, y: -Infinity }, - max: { x: Infinity, y: Infinity } - } - }; - - return Common.extend(composite, defaults, options); - }; + World.create = Composite.create; + World.add = Composite.add; + World.remove = Composite.remove; + World.clear = Composite.clear; + World.addComposite = Composite.addComposite; + World.addBody = Composite.addBody; + World.addConstraint = Composite.addConstraint; /* * @@ -151508,7 +152756,7 @@ var Common = __webpack_require__(68758); // World is a Composite body // see src/module/Outro.js for these aliases: - + /** * An alias for Composite.add * @method add @@ -151540,7 +152788,7 @@ var Common = __webpack_require__(68758); * @param {composite} composite * @return {world} The original world with the objects from composite added */ - + /** * An alias for Composite.addBody * @method addBody @@ -151560,92 +152808,589 @@ var Common = __webpack_require__(68758); })(); +/***/ }), + +/***/ 63454: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** +* The `Matter.Collision` module contains methods for detecting collisions between a given pair of bodies. +* +* For efficient detection between a list of bodies, see `Matter.Detector` and `Matter.Query`. +* +* See `Matter.Engine` for collision events. +* +* @class Collision +*/ + +var Collision = {}; + +module.exports = Collision; + +var Vertices = __webpack_require__(39745); +var Pair = __webpack_require__(70584); + +(function() { + var _supports = []; + + var _overlapAB = { + overlap: 0, + axis: null + }; + + var _overlapBA = { + overlap: 0, + axis: null + }; + + /** + * Creates a new collision record. + * @method create + * @param {body} bodyA The first body part represented by the collision record + * @param {body} bodyB The second body part represented by the collision record + * @return {collision} A new collision record + */ + Collision.create = function(bodyA, bodyB) { + return { + pair: null, + collided: false, + bodyA: bodyA, + bodyB: bodyB, + parentA: bodyA.parent, + parentB: bodyB.parent, + depth: 0, + normal: { x: 0, y: 0 }, + tangent: { x: 0, y: 0 }, + penetration: { x: 0, y: 0 }, + supports: [] + }; + }; + + /** + * Detect collision between two bodies. + * @method collides + * @param {body} bodyA + * @param {body} bodyB + * @param {pairs} [pairs] Optionally reuse collision records from existing pairs. + * @return {collision|null} A collision record if detected, otherwise null + */ + Collision.collides = function(bodyA, bodyB, pairs) { + Collision._overlapAxes(_overlapAB, bodyA.vertices, bodyB.vertices, bodyA.axes); + + if (_overlapAB.overlap <= 0) { + return null; + } + + Collision._overlapAxes(_overlapBA, bodyB.vertices, bodyA.vertices, bodyB.axes); + + if (_overlapBA.overlap <= 0) { + return null; + } + + // reuse collision records for gc efficiency + var pair = pairs && pairs.table[Pair.id(bodyA, bodyB)], + collision; + + if (!pair) { + collision = Collision.create(bodyA, bodyB); + collision.collided = true; + collision.bodyA = bodyA.id < bodyB.id ? bodyA : bodyB; + collision.bodyB = bodyA.id < bodyB.id ? bodyB : bodyA; + collision.parentA = collision.bodyA.parent; + collision.parentB = collision.bodyB.parent; + } else { + collision = pair.collision; + } + + bodyA = collision.bodyA; + bodyB = collision.bodyB; + + var minOverlap; + + if (_overlapAB.overlap < _overlapBA.overlap) { + minOverlap = _overlapAB; + } else { + minOverlap = _overlapBA; + } + + var normal = collision.normal, + supports = collision.supports, + minAxis = minOverlap.axis, + minAxisX = minAxis.x, + minAxisY = minAxis.y; + + // ensure normal is facing away from bodyA + if (minAxisX * (bodyB.position.x - bodyA.position.x) + minAxisY * (bodyB.position.y - bodyA.position.y) < 0) { + normal.x = minAxisX; + normal.y = minAxisY; + } else { + normal.x = -minAxisX; + normal.y = -minAxisY; + } + + collision.tangent.x = -normal.y; + collision.tangent.y = normal.x; + + collision.depth = minOverlap.overlap; + + collision.penetration.x = normal.x * collision.depth; + collision.penetration.y = normal.y * collision.depth; + + // find support points, there is always either exactly one or two + var supportsB = Collision._findSupports(bodyA, bodyB, normal, 1), + supportCount = 0; + + // find the supports from bodyB that are inside bodyA + if (Vertices.contains(bodyA.vertices, supportsB[0])) { + supports[supportCount++] = supportsB[0]; + } + + if (Vertices.contains(bodyA.vertices, supportsB[1])) { + supports[supportCount++] = supportsB[1]; + } + + // find the supports from bodyA that are inside bodyB + if (supportCount < 2) { + var supportsA = Collision._findSupports(bodyB, bodyA, normal, -1); + + if (Vertices.contains(bodyB.vertices, supportsA[0])) { + supports[supportCount++] = supportsA[0]; + } + + if (supportCount < 2 && Vertices.contains(bodyB.vertices, supportsA[1])) { + supports[supportCount++] = supportsA[1]; + } + } + + // account for the edge case of overlapping but no vertex containment + if (supportCount === 0) { + supports[supportCount++] = supportsB[0]; + } + + // update supports array size + supports.length = supportCount; + + return collision; + }; + + /** + * Find the overlap between two sets of vertices. + * @method _overlapAxes + * @private + * @param {object} result + * @param {vertices} verticesA + * @param {vertices} verticesB + * @param {axes} axes + */ + Collision._overlapAxes = function(result, verticesA, verticesB, axes) { + var verticesALength = verticesA.length, + verticesBLength = verticesB.length, + verticesAX = verticesA[0].x, + verticesAY = verticesA[0].y, + verticesBX = verticesB[0].x, + verticesBY = verticesB[0].y, + axesLength = axes.length, + overlapMin = Number.MAX_VALUE, + overlapAxisNumber = 0, + overlap, + overlapAB, + overlapBA, + dot, + i, + j; + + for (i = 0; i < axesLength; i++) { + var axis = axes[i], + axisX = axis.x, + axisY = axis.y, + minA = verticesAX * axisX + verticesAY * axisY, + minB = verticesBX * axisX + verticesBY * axisY, + maxA = minA, + maxB = minB; + + for (j = 1; j < verticesALength; j += 1) { + dot = verticesA[j].x * axisX + verticesA[j].y * axisY; + + if (dot > maxA) { + maxA = dot; + } else if (dot < minA) { + minA = dot; + } + } + + for (j = 1; j < verticesBLength; j += 1) { + dot = verticesB[j].x * axisX + verticesB[j].y * axisY; + + if (dot > maxB) { + maxB = dot; + } else if (dot < minB) { + minB = dot; + } + } + + overlapAB = maxA - minB; + overlapBA = maxB - minA; + overlap = overlapAB < overlapBA ? overlapAB : overlapBA; + + if (overlap < overlapMin) { + overlapMin = overlap; + overlapAxisNumber = i; + + if (overlap <= 0) { + // can not be intersecting + break; + } + } + } + + result.axis = axes[overlapAxisNumber]; + result.overlap = overlapMin; + }; + + /** + * Projects vertices on an axis and returns an interval. + * @method _projectToAxis + * @private + * @param {} projection + * @param {} vertices + * @param {} axis + */ + Collision._projectToAxis = function(projection, vertices, axis) { + var min = vertices[0].x * axis.x + vertices[0].y * axis.y, + max = min; + + for (var i = 1; i < vertices.length; i += 1) { + var dot = vertices[i].x * axis.x + vertices[i].y * axis.y; + + if (dot > max) { + max = dot; + } else if (dot < min) { + min = dot; + } + } + + projection.min = min; + projection.max = max; + }; + + /** + * Finds supporting vertices given two bodies along a given direction using hill-climbing. + * @method _findSupports + * @private + * @param {body} bodyA + * @param {body} bodyB + * @param {vector} normal + * @param {number} direction + * @return [vector] + */ + Collision._findSupports = function(bodyA, bodyB, normal, direction) { + var vertices = bodyB.vertices, + verticesLength = vertices.length, + bodyAPositionX = bodyA.position.x, + bodyAPositionY = bodyA.position.y, + normalX = normal.x * direction, + normalY = normal.y * direction, + nearestDistance = Number.MAX_VALUE, + vertexA, + vertexB, + vertexC, + distance, + j; + + // find deepest vertex relative to the axis + for (j = 0; j < verticesLength; j += 1) { + vertexB = vertices[j]; + distance = normalX * (bodyAPositionX - vertexB.x) + normalY * (bodyAPositionY - vertexB.y); + + // convex hill-climbing + if (distance < nearestDistance) { + nearestDistance = distance; + vertexA = vertexB; + } + } + + // measure next vertex + vertexC = vertices[(verticesLength + vertexA.index - 1) % verticesLength]; + nearestDistance = normalX * (bodyAPositionX - vertexC.x) + normalY * (bodyAPositionY - vertexC.y); + + // compare with previous vertex + vertexB = vertices[(vertexA.index + 1) % verticesLength]; + if (normalX * (bodyAPositionX - vertexB.x) + normalY * (bodyAPositionY - vertexB.y) < nearestDistance) { + _supports[0] = vertexA; + _supports[1] = vertexB; + + return _supports; + } + + _supports[0] = vertexA; + _supports[1] = vertexC; + + return _supports; + }; + + /* + * + * Properties Documentation + * + */ + + /** + * A reference to the pair using this collision record, if there is one. + * + * @property pair + * @type {pair|null} + * @default null + */ + + /** + * A flag that indicates if the bodies were colliding when the collision was last updated. + * + * @property collided + * @type boolean + * @default false + */ + + /** + * The first body part represented by the collision (see also `collision.parentA`). + * + * @property bodyA + * @type body + */ + + /** + * The second body part represented by the collision (see also `collision.parentB`). + * + * @property bodyB + * @type body + */ + + /** + * The first body represented by the collision (i.e. `collision.bodyA.parent`). + * + * @property parentA + * @type body + */ + + /** + * The second body represented by the collision (i.e. `collision.bodyB.parent`). + * + * @property parentB + * @type body + */ + + /** + * A `Number` that represents the minimum separating distance between the bodies along the collision normal. + * + * @readOnly + * @property depth + * @type number + * @default 0 + */ + + /** + * A normalised `Vector` that represents the direction between the bodies that provides the minimum separating distance. + * + * @property normal + * @type vector + * @default { x: 0, y: 0 } + */ + + /** + * A normalised `Vector` that is the tangent direction to the collision normal. + * + * @property tangent + * @type vector + * @default { x: 0, y: 0 } + */ + + /** + * A `Vector` that represents the direction and depth of the collision. + * + * @property penetration + * @type vector + * @default { x: 0, y: 0 } + */ + + /** + * An array of body vertices that represent the support points in the collision. + * These are the deepest vertices (along the collision normal) of each body that are contained by the other body's vertices. + * + * @property supports + * @type vector[] + * @default [] + */ + +})(); + + +/***/ }), + +/***/ 17319: +/***/ ((module) => { + +/** +* The `Matter.Contact` module contains methods for creating and manipulating collision contacts. +* +* @class Contact +*/ + +var Contact = {}; + +module.exports = Contact; + +(function() { + + /** + * Creates a new contact. + * @method create + * @param {vertex} vertex + * @return {contact} A new contact + */ + Contact.create = function(vertex) { + return { + vertex: vertex, + normalImpulse: 0, + tangentImpulse: 0 + }; + }; + +})(); + + /***/ }), /***/ 13657: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** -* The `Matter.Detector` module contains methods for detecting collisions given a set of pairs. +* The `Matter.Detector` module contains methods for efficiently detecting collisions between a list of bodies using a broadphase algorithm. * * @class Detector */ -// TODO: speculative contacts - var Detector = {}; module.exports = Detector; -var SAT = __webpack_require__(5756); -var Pair = __webpack_require__(70584); -var Bounds = __webpack_require__(84091); +var Common = __webpack_require__(68758); +var Collision = __webpack_require__(63454); (function() { /** - * Finds all collisions given a list of pairs. - * @method collisions - * @param {pair[]} broadphasePairs - * @param {engine} engine - * @return {array} collisions + * Creates a new collision detector. + * @method create + * @param {} options + * @return {detector} A new collision detector */ - Detector.collisions = function(broadphasePairs, engine) { + Detector.create = function(options) { + var defaults = { + bodies: [], + pairs: null + }; + + return Common.extend(defaults, options); + }; + + /** + * Sets the list of bodies in the detector. + * @method setBodies + * @param {detector} detector + * @param {body[]} bodies + */ + Detector.setBodies = function(detector, bodies) { + detector.bodies = bodies.slice(0); + }; + + /** + * Clears the detector including its list of bodies. + * @method clear + * @param {detector} detector + */ + Detector.clear = function(detector) { + detector.bodies = []; + }; + + /** + * Efficiently finds all collisions among all the bodies in `detector.bodies` using a broadphase algorithm. + * + * _Note:_ The specific ordering of collisions returned is not guaranteed between releases and may change for performance reasons. + * If a specific ordering is required then apply a sort to the resulting array. + * @method collisions + * @param {detector} detector + * @return {collision[]} collisions + */ + Detector.collisions = function(detector) { var collisions = [], - pairsTable = engine.pairs.table; + pairs = detector.pairs, + bodies = detector.bodies, + bodiesLength = bodies.length, + canCollide = Detector.canCollide, + collides = Collision.collides, + i, + j; - // @if DEBUG - var metrics = engine.metrics; - // @endif - - for (var i = 0; i < broadphasePairs.length; i++) { - var bodyA = broadphasePairs[i][0], - bodyB = broadphasePairs[i][1]; + bodies.sort(Detector._compareBoundsX); - if ((bodyA.isStatic || bodyA.isSleeping) && (bodyB.isStatic || bodyB.isSleeping)) - continue; - - if (!Detector.canCollide(bodyA.collisionFilter, bodyB.collisionFilter)) - continue; + for (i = 0; i < bodiesLength; i++) { + var bodyA = bodies[i], + boundsA = bodyA.bounds, + boundXMax = bodyA.bounds.max.x, + boundYMax = bodyA.bounds.max.y, + boundYMin = bodyA.bounds.min.y, + bodyAStatic = bodyA.isStatic || bodyA.isSleeping, + partsALength = bodyA.parts.length, + partsASingle = partsALength === 1; - // @if DEBUG - metrics.midphaseTests += 1; - // @endif + for (j = i + 1; j < bodiesLength; j++) { + var bodyB = bodies[j], + boundsB = bodyB.bounds; - // mid phase - if (Bounds.overlaps(bodyA.bounds, bodyB.bounds)) { - for (var j = bodyA.parts.length > 1 ? 1 : 0; j < bodyA.parts.length; j++) { - var partA = bodyA.parts[j]; + if (boundsB.min.x > boundXMax) { + break; + } - for (var k = bodyB.parts.length > 1 ? 1 : 0; k < bodyB.parts.length; k++) { - var partB = bodyB.parts[k]; + if (boundYMax < boundsB.min.y || boundYMin > boundsB.max.y) { + continue; + } - if ((partA === bodyA && partB === bodyB) || Bounds.overlaps(partA.bounds, partB.bounds)) { - // find a previous collision we could reuse - var pairId = Pair.id(partA, partB), - pair = pairsTable[pairId], - previousCollision; + if (bodyAStatic && (bodyB.isStatic || bodyB.isSleeping)) { + continue; + } - if (pair && pair.isActive) { - previousCollision = pair.collision; - } else { - previousCollision = null; + if (!canCollide(bodyA.collisionFilter, bodyB.collisionFilter)) { + continue; + } + + var partsBLength = bodyB.parts.length; + + if (partsASingle && partsBLength === 1) { + var collision = collides(bodyA, bodyB, pairs); + + if (collision) { + collisions.push(collision); + } + } else { + var partsAStart = partsALength > 1 ? 1 : 0, + partsBStart = partsBLength > 1 ? 1 : 0; + + for (var k = partsAStart; k < partsALength; k++) { + var partA = bodyA.parts[k], + boundsA = partA.bounds; + + for (var z = partsBStart; z < partsBLength; z++) { + var partB = bodyB.parts[z], + boundsB = partB.bounds; + + if (boundsA.min.x > boundsB.max.x || boundsA.max.x < boundsB.min.x + || boundsA.max.y < boundsB.min.y || boundsA.min.y > boundsB.max.y) { + continue; } - // narrow phase - var collision = SAT.collides(partA, partB, previousCollision); + var collision = collides(partA, partB, pairs); - // @if DEBUG - metrics.narrowphaseTests += 1; - if (collision.reused) - metrics.narrowReuseCount += 1; - // @endif - - if (collision.collided) { + if (collision) { collisions.push(collision); - // @if DEBUG - metrics.narrowDetections += 1; - // @endif } } } @@ -151671,341 +153416,48 @@ var Bounds = __webpack_require__(84091); return (filterA.mask & filterB.category) !== 0 && (filterB.mask & filterA.category) !== 0; }; -})(); - - -/***/ }), - -/***/ 15489: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -/** -* The `Matter.Grid` module contains methods for creating and manipulating collision broadphase grid structures. -* -* @class Grid -*/ - -var Grid = {}; - -module.exports = Grid; - -var Pair = __webpack_require__(70584); -var Detector = __webpack_require__(13657); -var Common = __webpack_require__(68758); - -(function() { - /** - * Creates a new grid. - * @method create - * @param {} options - * @return {grid} A new grid - */ - Grid.create = function(options) { - var defaults = { - controller: Grid, - detector: Detector.collisions, - buckets: {}, - pairs: {}, - pairsList: [], - bucketWidth: 48, - bucketHeight: 48 - }; - - return Common.extend(defaults, options); - }; - - /** - * The width of a single grid bucket. - * - * @property bucketWidth - * @type number - * @default 48 - */ - - /** - * The height of a single grid bucket. - * - * @property bucketHeight - * @type number - * @default 48 - */ - - /** - * Updates the grid. - * @method update - * @param {grid} grid - * @param {body[]} bodies - * @param {engine} engine - * @param {boolean} forceUpdate - */ - Grid.update = function(grid, bodies, engine, forceUpdate) { - var i, col, row, - world = engine.world, - buckets = grid.buckets, - bucket, - bucketId, - gridChanged = false; - - // @if DEBUG - var metrics = engine.metrics; - metrics.broadphaseTests = 0; - // @endif - - for (i = 0; i < bodies.length; i++) { - var body = bodies[i]; - - if (body.isSleeping && !forceUpdate) - continue; - - // don't update out of world bodies - if (body.bounds.max.x < world.bounds.min.x || body.bounds.min.x > world.bounds.max.x - || body.bounds.max.y < world.bounds.min.y || body.bounds.min.y > world.bounds.max.y) - continue; - - var newRegion = Grid._getRegion(grid, body); - - // if the body has changed grid region - if (!body.region || newRegion.id !== body.region.id || forceUpdate) { - - // @if DEBUG - metrics.broadphaseTests += 1; - // @endif - - if (!body.region || forceUpdate) - body.region = newRegion; - - var union = Grid._regionUnion(newRegion, body.region); - - // update grid buckets affected by region change - // iterate over the union of both regions - for (col = union.startCol; col <= union.endCol; col++) { - for (row = union.startRow; row <= union.endRow; row++) { - bucketId = Grid._getBucketId(col, row); - bucket = buckets[bucketId]; - - var isInsideNewRegion = (col >= newRegion.startCol && col <= newRegion.endCol - && row >= newRegion.startRow && row <= newRegion.endRow); - - var isInsideOldRegion = (col >= body.region.startCol && col <= body.region.endCol - && row >= body.region.startRow && row <= body.region.endRow); - - // remove from old region buckets - if (!isInsideNewRegion && isInsideOldRegion) { - if (isInsideOldRegion) { - if (bucket) - Grid._bucketRemoveBody(grid, bucket, body); - } - } - - // add to new region buckets - if (body.region === newRegion || (isInsideNewRegion && !isInsideOldRegion) || forceUpdate) { - if (!bucket) - bucket = Grid._createBucket(buckets, bucketId); - Grid._bucketAddBody(grid, bucket, body); - } - } - } - - // set the new region - body.region = newRegion; - - // flag changes so we can update pairs - gridChanged = true; - } - } - - // update pairs list only if pairs changed (i.e. a body changed region) - if (gridChanged) - grid.pairsList = Grid._createActivePairsList(grid); - }; - - /** - * Clears the grid. - * @method clear - * @param {grid} grid - */ - Grid.clear = function(grid) { - grid.buckets = {}; - grid.pairs = {}; - grid.pairsList = []; - }; - - /** - * Finds the union of two regions. - * @method _regionUnion + * The comparison function used in the broadphase algorithm. + * Returns the signed delta of the bodies bounds on the x-axis. * @private - * @param {} regionA - * @param {} regionB - * @return {} region + * @method _sortCompare + * @param {body} bodyA + * @param {body} bodyB + * @return {number} The signed delta used for sorting */ - Grid._regionUnion = function(regionA, regionB) { - var startCol = Math.min(regionA.startCol, regionB.startCol), - endCol = Math.max(regionA.endCol, regionB.endCol), - startRow = Math.min(regionA.startRow, regionB.startRow), - endRow = Math.max(regionA.endRow, regionB.endRow); - - return Grid._createRegion(startCol, endCol, startRow, endRow); + Detector._compareBoundsX = function(bodyA, bodyB) { + return bodyA.bounds.min.x - bodyB.bounds.min.x; }; + /* + * + * Properties Documentation + * + */ + /** - * Gets the region a given body falls in for a given grid. - * @method _getRegion - * @private - * @param {} grid - * @param {} body - * @return {} region + * The array of `Matter.Body` between which the detector finds collisions. + * + * _Note:_ The order of bodies in this array _is not fixed_ and will be continually managed by the detector. + * @property bodies + * @type body[] + * @default [] */ - Grid._getRegion = function(grid, body) { - var bounds = body.bounds, - startCol = Math.floor(bounds.min.x / grid.bucketWidth), - endCol = Math.floor(bounds.max.x / grid.bucketWidth), - startRow = Math.floor(bounds.min.y / grid.bucketHeight), - endRow = Math.floor(bounds.max.y / grid.bucketHeight); - - return Grid._createRegion(startCol, endCol, startRow, endRow); - }; /** - * Creates a region. - * @method _createRegion - * @private - * @param {} startCol - * @param {} endCol - * @param {} startRow - * @param {} endRow - * @return {} region + * Optional. A `Matter.Pairs` object from which previous collision objects may be reused. Intended for internal `Matter.Engine` usage. + * @property pairs + * @type {pairs|null} + * @default null */ - Grid._createRegion = function(startCol, endCol, startRow, endRow) { - return { - id: startCol + ',' + endCol + ',' + startRow + ',' + endRow, - startCol: startCol, - endCol: endCol, - startRow: startRow, - endRow: endRow - }; - }; - /** - * Gets the bucket id at the given position. - * @method _getBucketId - * @private - * @param {} column - * @param {} row - * @return {string} bucket id - */ - Grid._getBucketId = function(column, row) { - return 'C' + column + 'R' + row; - }; - - /** - * Creates a bucket. - * @method _createBucket - * @private - * @param {} buckets - * @param {} bucketId - * @return {} bucket - */ - Grid._createBucket = function(buckets, bucketId) { - var bucket = buckets[bucketId] = []; - return bucket; - }; - - /** - * Adds a body to a bucket. - * @method _bucketAddBody - * @private - * @param {} grid - * @param {} bucket - * @param {} body - */ - Grid._bucketAddBody = function(grid, bucket, body) { - // add new pairs - for (var i = 0; i < bucket.length; i++) { - var bodyB = bucket[i]; - - if (body.id === bodyB.id || (body.isStatic && bodyB.isStatic)) - continue; - - // keep track of the number of buckets the pair exists in - // important for Grid.update to work - var pairId = Pair.id(body, bodyB), - pair = grid.pairs[pairId]; - - if (pair) { - pair[2] += 1; - } else { - grid.pairs[pairId] = [body, bodyB, 1]; - } - } - - // add to bodies (after pairs, otherwise pairs with self) - bucket.push(body); - }; - - /** - * Removes a body from a bucket. - * @method _bucketRemoveBody - * @private - * @param {} grid - * @param {} bucket - * @param {} body - */ - Grid._bucketRemoveBody = function(grid, bucket, body) { - // remove from bucket - bucket.splice(bucket.indexOf(body), 1); - - // update pair counts - for (var i = 0; i < bucket.length; i++) { - // keep track of the number of buckets the pair exists in - // important for _createActivePairsList to work - var bodyB = bucket[i], - pairId = Pair.id(body, bodyB), - pair = grid.pairs[pairId]; - - if (pair) - pair[2] -= 1; - } - }; - - /** - * Generates a list of the active pairs in the grid. - * @method _createActivePairsList - * @private - * @param {} grid - * @return [] pairs - */ - Grid._createActivePairsList = function(grid) { - var pairKeys, - pair, - pairs = []; - - // grid.pairs is used as a hashmap - pairKeys = Common.keys(grid.pairs); - - // iterate over grid.pairs - for (var k = 0; k < pairKeys.length; k++) { - pair = grid.pairs[pairKeys[k]]; - - // if pair exists in at least one bucket - // it is a pair that needs further collision testing so push it - if (pair[2] > 0) { - pairs.push(pair); - } else { - delete grid.pairs[pairKeys[k]]; - } - } - - return pairs; - }; - })(); /***/ }), /***/ 70584: -/***/ ((module) => { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * The `Matter.Pair` module contains methods for creating and manipulating collision pairs. @@ -152017,6 +153469,8 @@ var Pair = {}; module.exports = Pair; +var Contact = __webpack_require__(17319); + (function() { /** @@ -152034,6 +153488,8 @@ module.exports = Pair; id: Pair.id(bodyA, bodyB), bodyA: bodyA, bodyB: bodyB, + collision: collision, + contacts: [], activeContacts: [], separation: 0, isActive: true, @@ -152041,7 +153497,6 @@ module.exports = Pair; isSensor: bodyA.isSensor || bodyB.isSensor, timeCreated: timestamp, timeUpdated: timestamp, - collision: null, inverseMass: 0, friction: 0, frictionStatic: 0, @@ -152062,35 +153517,36 @@ module.exports = Pair; * @param {number} timestamp */ Pair.update = function(pair, collision, timestamp) { + var contacts = pair.contacts, + supports = collision.supports, + activeContacts = pair.activeContacts, + parentA = collision.parentA, + parentB = collision.parentB, + parentAVerticesLength = parentA.vertices.length; + + pair.isActive = true; + pair.timeUpdated = timestamp; pair.collision = collision; + pair.separation = collision.depth; + pair.inverseMass = parentA.inverseMass + parentB.inverseMass; + pair.friction = parentA.friction < parentB.friction ? parentA.friction : parentB.friction; + pair.frictionStatic = parentA.frictionStatic > parentB.frictionStatic ? parentA.frictionStatic : parentB.frictionStatic; + pair.restitution = parentA.restitution > parentB.restitution ? parentA.restitution : parentB.restitution; + pair.slop = parentA.slop > parentB.slop ? parentA.slop : parentB.slop; - if (collision.collided) { - var supports = collision.supports, - activeContacts = pair.activeContacts, - parentA = collision.parentA, - parentB = collision.parentB; + collision.pair = pair; + activeContacts.length = 0; + + for (var i = 0; i < supports.length; i++) { + var support = supports[i], + contactId = support.body === parentA ? support.index : parentAVerticesLength + support.index, + contact = contacts[contactId]; - pair.inverseMass = parentA.inverseMass + parentB.inverseMass; - pair.friction = Math.min(parentA.friction, parentB.friction); - pair.frictionStatic = Math.max(parentA.frictionStatic, parentB.frictionStatic); - pair.restitution = Math.max(parentA.restitution, parentB.restitution); - pair.slop = Math.max(parentA.slop, parentB.slop); - - for (var i = 0; i < supports.length; i++) { - activeContacts[i] = supports[i].contact; + if (contact) { + activeContacts.push(contact); + } else { + activeContacts.push(contacts[contactId] = Contact.create(support)); } - - // optimise array size - var supportCount = supports.length; - if (supportCount < activeContacts.length) { - activeContacts.length = supportCount; - } - - pair.separation = collision.depth; - Pair.setActive(pair, true, timestamp); - } else { - if (pair.isActive === true) - Pair.setActive(pair, false, timestamp); } }; @@ -152148,8 +153604,6 @@ var Pair = __webpack_require__(70584); var Common = __webpack_require__(68758); (function() { - - Pairs._pairMaxIdleLife = 1000; /** * Creates a new pairs structure. @@ -152176,12 +153630,14 @@ var Common = __webpack_require__(68758); */ Pairs.update = function(pairs, collisions, timestamp) { var pairsList = pairs.list, + pairsListLength = pairsList.length, pairsTable = pairs.table, + collisionsLength = collisions.length, collisionStart = pairs.collisionStart, collisionEnd = pairs.collisionEnd, collisionActive = pairs.collisionActive, collision, - pairId, + pairIndex, pair, i; @@ -152190,90 +153646,61 @@ var Common = __webpack_require__(68758); collisionEnd.length = 0; collisionActive.length = 0; - for (i = 0; i < pairsList.length; i++) { + for (i = 0; i < pairsListLength; i++) { pairsList[i].confirmedActive = false; } - for (i = 0; i < collisions.length; i++) { + for (i = 0; i < collisionsLength; i++) { collision = collisions[i]; + pair = collision.pair; - if (collision.collided) { - pairId = Pair.id(collision.bodyA, collision.bodyB); - - pair = pairsTable[pairId]; - - if (pair) { - // pair already exists (but may or may not be active) - if (pair.isActive) { - // pair exists and is active - collisionActive.push(pair); - } else { - // pair exists but was inactive, so a collision has just started again - collisionStart.push(pair); - } - - // update the pair - Pair.update(pair, collision, timestamp); - pair.confirmedActive = true; + if (pair) { + // pair already exists (but may or may not be active) + if (pair.isActive) { + // pair exists and is active + collisionActive.push(pair); } else { - // pair did not exist, create a new pair - pair = Pair.create(collision, timestamp); - pairsTable[pairId] = pair; - - // push the new pair + // pair exists but was inactive, so a collision has just started again collisionStart.push(pair); - pairsList.push(pair); + } + + // update the pair + Pair.update(pair, collision, timestamp); + pair.confirmedActive = true; + } else { + // pair did not exist, create a new pair + pair = Pair.create(collision, timestamp); + pairsTable[pair.id] = pair; + + // push the new pair + collisionStart.push(pair); + pairsList.push(pair); + } + } + + // find pairs that are no longer active + var removePairIndex = []; + pairsListLength = pairsList.length; + + for (i = 0; i < pairsListLength; i++) { + pair = pairsList[i]; + + if (!pair.confirmedActive) { + Pair.setActive(pair, false, timestamp); + collisionEnd.push(pair); + + if (!pair.collision.bodyA.isSleeping && !pair.collision.bodyB.isSleeping) { + removePairIndex.push(i); } } } - // deactivate previously active pairs that are now inactive - for (i = 0; i < pairsList.length; i++) { - pair = pairsList[i]; - if (pair.isActive && !pair.confirmedActive) { - Pair.setActive(pair, false, timestamp); - collisionEnd.push(pair); - } - } - }; - - /** - * Finds and removes pairs that have been inactive for a set amount of time. - * @method removeOld - * @param {object} pairs - * @param {number} timestamp - */ - Pairs.removeOld = function(pairs, timestamp) { - var pairsList = pairs.list, - pairsTable = pairs.table, - indexesToRemove = [], - pair, - collision, - pairIndex, - i; - - for (i = 0; i < pairsList.length; i++) { - pair = pairsList[i]; - collision = pair.collision; - - // never remove sleeping pairs - if (collision.bodyA.isSleeping || collision.bodyB.isSleeping) { - pair.timeUpdated = timestamp; - continue; - } - - // if pair is inactive for too long, mark it to be removed - if (timestamp - pair.timeUpdated > Pairs._pairMaxIdleLife) { - indexesToRemove.push(i); - } - } - - // remove marked pairs - for (i = 0; i < indexesToRemove.length; i++) { - pairIndex = indexesToRemove[i] - i; + // remove inactive pairs + for (i = 0; i < removePairIndex.length; i++) { + pairIndex = removePairIndex[i] - i; pair = pairsList[pairIndex]; - delete pairsTable[pair.id]; pairsList.splice(pairIndex, 1); + delete pairsTable[pair.id]; } }; @@ -152313,7 +153740,7 @@ var Query = {}; module.exports = Query; var Vector = __webpack_require__(10438); -var SAT = __webpack_require__(5756); +var Collision = __webpack_require__(63454); var Bounds = __webpack_require__(84091); var Bodies = __webpack_require__(68516); var Vertices = __webpack_require__(39745); @@ -152325,28 +153752,34 @@ var Vertices = __webpack_require__(39745); * @method collides * @param {body} body * @param {body[]} bodies - * @return {object[]} Collisions + * @return {collision[]} Collisions */ Query.collides = function(body, bodies) { - var collisions = []; + var collisions = [], + bodiesLength = bodies.length, + bounds = body.bounds, + collides = Collision.collides, + overlaps = Bounds.overlaps; - for (var i = 0; i < bodies.length; i++) { - var bodyA = bodies[i]; + for (var i = 0; i < bodiesLength; i++) { + var bodyA = bodies[i], + partsALength = bodyA.parts.length, + partsAStart = partsALength === 1 ? 0 : 1; // Phaser addition - skip same body checks if (body === bodyA) { continue; } - - if (Bounds.overlaps(bodyA.bounds, body.bounds)) { - for (var j = bodyA.parts.length === 1 ? 0 : 1; j < bodyA.parts.length; j++) { + + if (overlaps(bodyA.bounds, bounds)) { + for (var j = partsAStart; j < partsALength; j++) { var part = bodyA.parts[j]; - if (Bounds.overlaps(part.bounds, body.bounds)) { - var collision = SAT.collides(part, body); + if (overlaps(part.bounds, bounds)) { + var collision = collides(part, body); - if (collision.collided) { + if (collision) { collisions.push(collision); break; } @@ -152365,7 +153798,7 @@ var Vertices = __webpack_require__(39745); * @param {vector} startPoint * @param {vector} endPoint * @param {number} [rayWidth] - * @return {object[]} Collisions + * @return {collision[]} Collisions */ Query.ray = function(bodies, startPoint, endPoint, rayWidth) { rayWidth = rayWidth || 1e-100; @@ -152379,7 +153812,7 @@ var Vertices = __webpack_require__(39745); for (var i = 0; i < collisions.length; i += 1) { var collision = collisions[i]; - collision.body = collision.bodyB = collision.bodyA; + collision.body = collision.bodyB = collision.bodyA; } return collisions; @@ -152418,7 +153851,7 @@ var Vertices = __webpack_require__(39745); for (var i = 0; i < bodies.length; i++) { var body = bodies[i]; - + if (Bounds.contains(body.bounds, point)) { for (var j = body.parts.length === 1 ? 0 : 1; j < body.parts.length; j++) { var part = body.parts[j]; @@ -152454,8 +153887,6 @@ var Resolver = {}; module.exports = Resolver; var Vertices = __webpack_require__(39745); -var Vector = __webpack_require__(10438); -var Common = __webpack_require__(68758); var Bounds = __webpack_require__(84091); (function() { @@ -152474,10 +153905,11 @@ var Bounds = __webpack_require__(84091); Resolver.preSolvePosition = function(pairs) { var i, pair, - activeCount; + activeCount, + pairsLength = pairs.length; // find total contacts on each body - for (i = 0; i < pairs.length; i++) { + for (i = 0; i < pairsLength; i++) { pair = pairs[i]; if (!pair.isActive) @@ -152493,36 +153925,22 @@ var Bounds = __webpack_require__(84091); * Find a solution for pair positions. * @method solvePosition * @param {pair[]} pairs - * @param {body[]} bodies * @param {number} timeScale */ - Resolver.solvePosition = function(pairs, bodies, timeScale) { + Resolver.solvePosition = function(pairs, timeScale) { var i, - normalX, - normalY, pair, collision, bodyA, bodyB, normal, - separation, - penetration, - positionImpulseA, - positionImpulseB, contactShare, - bodyBtoAX, - bodyBtoAY, positionImpulse, - impulseCoefficient = timeScale * Resolver._positionDampen; - - for (i = 0; i < bodies.length; i++) { - var body = bodies[i]; - body.previousPositionImpulse.x = body.positionImpulse.x; - body.previousPositionImpulse.y = body.positionImpulse.y; - } + positionDampen = Resolver._positionDampen, + pairsLength = pairs.length; // find impulses required to resolve penetration - for (i = 0; i < pairs.length; i++) { + for (i = 0; i < pairsLength; i++) { pair = pairs[i]; if (!pair.isActive || pair.isSensor) @@ -152533,35 +153951,37 @@ var Bounds = __webpack_require__(84091); bodyB = collision.parentB; normal = collision.normal; - positionImpulseA = bodyA.previousPositionImpulse; - positionImpulseB = bodyB.previousPositionImpulse; + // get current separation between body edges involved in collision + pair.separation = + normal.x * (bodyB.positionImpulse.x + collision.penetration.x - bodyA.positionImpulse.x) + + normal.y * (bodyB.positionImpulse.y + collision.penetration.y - bodyA.positionImpulse.y); + } + + for (i = 0; i < pairsLength; i++) { + pair = pairs[i]; - penetration = collision.penetration; - - bodyBtoAX = positionImpulseB.x - positionImpulseA.x + penetration.x; - bodyBtoAY = positionImpulseB.y - positionImpulseA.y + penetration.y; - - normalX = normal.x; - normalY = normal.y; - - separation = normalX * bodyBtoAX + normalY * bodyBtoAY; - pair.separation = separation; - - positionImpulse = (separation - pair.slop) * impulseCoefficient; + if (!pair.isActive || pair.isSensor) + continue; + + collision = pair.collision; + bodyA = collision.parentA; + bodyB = collision.parentB; + normal = collision.normal; + positionImpulse = (pair.separation - pair.slop) * timeScale; if (bodyA.isStatic || bodyB.isStatic) positionImpulse *= 2; if (!(bodyA.isStatic || bodyA.isSleeping)) { - contactShare = positionImpulse / bodyA.totalContacts; - bodyA.positionImpulse.x += normalX * contactShare; - bodyA.positionImpulse.y += normalY * contactShare; + contactShare = positionDampen / bodyA.totalContacts; + bodyA.positionImpulse.x += normal.x * positionImpulse * contactShare; + bodyA.positionImpulse.y += normal.y * positionImpulse * contactShare; } if (!(bodyB.isStatic || bodyB.isSleeping)) { - contactShare = positionImpulse / bodyB.totalContacts; - bodyB.positionImpulse.x -= normalX * contactShare; - bodyB.positionImpulse.y -= normalY * contactShare; + contactShare = positionDampen / bodyB.totalContacts; + bodyB.positionImpulse.x -= normal.x * positionImpulse * contactShare; + bodyB.positionImpulse.y -= normal.y * positionImpulse * contactShare; } } }; @@ -152572,34 +153992,43 @@ var Bounds = __webpack_require__(84091); * @param {body[]} bodies */ Resolver.postSolvePosition = function(bodies) { - for (var i = 0; i < bodies.length; i++) { - var body = bodies[i]; + var positionWarming = Resolver._positionWarming, + bodiesLength = bodies.length, + verticesTranslate = Vertices.translate, + boundsUpdate = Bounds.update; + + for (var i = 0; i < bodiesLength; i++) { + var body = bodies[i], + positionImpulse = body.positionImpulse, + positionImpulseX = positionImpulse.x, + positionImpulseY = positionImpulse.y, + velocity = body.velocity; // reset contact count body.totalContacts = 0; - if (body.positionImpulse.x !== 0 || body.positionImpulse.y !== 0) { + if (positionImpulseX !== 0 || positionImpulseY !== 0) { // update body geometry for (var j = 0; j < body.parts.length; j++) { var part = body.parts[j]; - Vertices.translate(part.vertices, body.positionImpulse); - Bounds.update(part.bounds, part.vertices, body.velocity); - part.position.x += body.positionImpulse.x; - part.position.y += body.positionImpulse.y; + verticesTranslate(part.vertices, positionImpulse); + boundsUpdate(part.bounds, part.vertices, velocity); + part.position.x += positionImpulseX; + part.position.y += positionImpulseY; } // move the body without changing velocity - body.positionPrev.x += body.positionImpulse.x; - body.positionPrev.y += body.positionImpulse.y; + body.positionPrev.x += positionImpulseX; + body.positionPrev.y += positionImpulseY; - if (Vector.dot(body.positionImpulse, body.velocity) < 0) { + if (positionImpulseX * velocity.x + positionImpulseY * velocity.y < 0) { // reset cached impulse if the body has velocity along it - body.positionImpulse.x = 0; - body.positionImpulse.y = 0; + positionImpulse.x = 0; + positionImpulse.y = 0; } else { // warm the next iteration - body.positionImpulse.x *= Resolver._positionWarming; - body.positionImpulse.y *= Resolver._positionWarming; + positionImpulse.x *= positionWarming; + positionImpulse.y *= positionWarming; } } } @@ -152611,61 +154040,53 @@ var Bounds = __webpack_require__(84091); * @param {pair[]} pairs */ Resolver.preSolveVelocity = function(pairs) { - var i, - j, - pair, - contacts, - collision, - bodyA, - bodyB, - normal, - tangent, - contact, - contactVertex, - normalImpulse, - tangentImpulse, - offset, - impulse = Vector._temp[0], - tempA = Vector._temp[1]; + var pairsLength = pairs.length, + i, + j; - for (i = 0; i < pairs.length; i++) { - pair = pairs[i]; + for (i = 0; i < pairsLength; i++) { + var pair = pairs[i]; if (!pair.isActive || pair.isSensor) continue; - contacts = pair.activeContacts; - collision = pair.collision; - bodyA = collision.parentA; - bodyB = collision.parentB; - normal = collision.normal; - tangent = collision.tangent; - + var contacts = pair.activeContacts, + contactsLength = contacts.length, + collision = pair.collision, + bodyA = collision.parentA, + bodyB = collision.parentB, + normal = collision.normal, + tangent = collision.tangent; + // resolve each contact - for (j = 0; j < contacts.length; j++) { - contact = contacts[j]; - contactVertex = contact.vertex; - normalImpulse = contact.normalImpulse; - tangentImpulse = contact.tangentImpulse; - + for (j = 0; j < contactsLength; j++) { + var contact = contacts[j], + contactVertex = contact.vertex, + normalImpulse = contact.normalImpulse, + tangentImpulse = contact.tangentImpulse; + if (normalImpulse !== 0 || tangentImpulse !== 0) { // total impulse from contact - impulse.x = (normal.x * normalImpulse) + (tangent.x * tangentImpulse); - impulse.y = (normal.y * normalImpulse) + (tangent.y * tangentImpulse); + var impulseX = normal.x * normalImpulse + tangent.x * tangentImpulse, + impulseY = normal.y * normalImpulse + tangent.y * tangentImpulse; // apply impulse from contact if (!(bodyA.isStatic || bodyA.isSleeping)) { - offset = Vector.sub(contactVertex, bodyA.position, tempA); - bodyA.positionPrev.x += impulse.x * bodyA.inverseMass; - bodyA.positionPrev.y += impulse.y * bodyA.inverseMass; - bodyA.anglePrev += Vector.cross(offset, impulse) * bodyA.inverseInertia; + bodyA.positionPrev.x += impulseX * bodyA.inverseMass; + bodyA.positionPrev.y += impulseY * bodyA.inverseMass; + bodyA.anglePrev += bodyA.inverseInertia * ( + (contactVertex.x - bodyA.position.x) * impulseY + - (contactVertex.y - bodyA.position.y) * impulseX + ); } - + if (!(bodyB.isStatic || bodyB.isSleeping)) { - offset = Vector.sub(contactVertex, bodyB.position, tempA); - bodyB.positionPrev.x -= impulse.x * bodyB.inverseMass; - bodyB.positionPrev.y -= impulse.y * bodyB.inverseMass; - bodyB.anglePrev -= Vector.cross(offset, impulse) * bodyB.inverseInertia; + bodyB.positionPrev.x -= impulseX * bodyB.inverseMass; + bodyB.positionPrev.y -= impulseY * bodyB.inverseMass; + bodyB.anglePrev -= bodyB.inverseInertia * ( + (contactVertex.x - bodyB.position.x) * impulseY + - (contactVertex.y - bodyB.position.y) * impulseX + ); } } } @@ -152680,14 +154101,17 @@ var Bounds = __webpack_require__(84091); */ Resolver.solveVelocity = function(pairs, timeScale) { var timeScaleSquared = timeScale * timeScale, - impulse = Vector._temp[0], - tempA = Vector._temp[1], - tempB = Vector._temp[2], - tempC = Vector._temp[3], - tempD = Vector._temp[4], - tempE = Vector._temp[5]; - - for (var i = 0; i < pairs.length; i++) { + restingThresh = Resolver._restingThresh * timeScaleSquared, + frictionNormalMultiplier = Resolver._frictionNormalMultiplier, + restingThreshTangent = Resolver._restingThreshTangent * timeScaleSquared, + NumberMaxValue = Number.MAX_VALUE, + pairsLength = pairs.length, + tangentImpulse, + maxFriction, + i, + j; + + for (i = 0; i < pairsLength; i++) { var pair = pairs[i]; if (!pair.isActive || pair.isSensor) @@ -152696,97 +154120,119 @@ var Bounds = __webpack_require__(84091); var collision = pair.collision, bodyA = collision.parentA, bodyB = collision.parentB, - normal = collision.normal, - tangent = collision.tangent, + bodyAVelocity = bodyA.velocity, + bodyBVelocity = bodyB.velocity, + normalX = collision.normal.x, + normalY = collision.normal.y, + tangentX = collision.tangent.x, + tangentY = collision.tangent.y, contacts = pair.activeContacts, - contactShare = 1 / contacts.length; + contactsLength = contacts.length, + contactShare = 1 / contactsLength, + inverseMassTotal = bodyA.inverseMass + bodyB.inverseMass, + friction = pair.friction * pair.frictionStatic * frictionNormalMultiplier * timeScaleSquared; // update body velocities - bodyA.velocity.x = bodyA.position.x - bodyA.positionPrev.x; - bodyA.velocity.y = bodyA.position.y - bodyA.positionPrev.y; - bodyB.velocity.x = bodyB.position.x - bodyB.positionPrev.x; - bodyB.velocity.y = bodyB.position.y - bodyB.positionPrev.y; + bodyAVelocity.x = bodyA.position.x - bodyA.positionPrev.x; + bodyAVelocity.y = bodyA.position.y - bodyA.positionPrev.y; + bodyBVelocity.x = bodyB.position.x - bodyB.positionPrev.x; + bodyBVelocity.y = bodyB.position.y - bodyB.positionPrev.y; bodyA.angularVelocity = bodyA.angle - bodyA.anglePrev; bodyB.angularVelocity = bodyB.angle - bodyB.anglePrev; // resolve each contact - for (var j = 0; j < contacts.length; j++) { + for (j = 0; j < contactsLength; j++) { var contact = contacts[j], - contactVertex = contact.vertex, - offsetA = Vector.sub(contactVertex, bodyA.position, tempA), - offsetB = Vector.sub(contactVertex, bodyB.position, tempB), - velocityPointA = Vector.add(bodyA.velocity, Vector.mult(Vector.perp(offsetA), bodyA.angularVelocity), tempC), - velocityPointB = Vector.add(bodyB.velocity, Vector.mult(Vector.perp(offsetB), bodyB.angularVelocity), tempD), - relativeVelocity = Vector.sub(velocityPointA, velocityPointB, tempE), - normalVelocity = Vector.dot(normal, relativeVelocity); + contactVertex = contact.vertex; - var tangentVelocity = Vector.dot(tangent, relativeVelocity), - tangentSpeed = Math.abs(tangentVelocity), - tangentVelocityDirection = Common.sign(tangentVelocity); + var offsetAX = contactVertex.x - bodyA.position.x, + offsetAY = contactVertex.y - bodyA.position.y, + offsetBX = contactVertex.x - bodyB.position.x, + offsetBY = contactVertex.y - bodyB.position.y; + + var velocityPointAX = bodyAVelocity.x - offsetAY * bodyA.angularVelocity, + velocityPointAY = bodyAVelocity.y + offsetAX * bodyA.angularVelocity, + velocityPointBX = bodyBVelocity.x - offsetBY * bodyB.angularVelocity, + velocityPointBY = bodyBVelocity.y + offsetBX * bodyB.angularVelocity; - // raw impulses - var normalImpulse = (1 + pair.restitution) * normalVelocity, - normalForce = Common.clamp(pair.separation + normalVelocity, 0, 1) * Resolver._frictionNormalMultiplier; + var relativeVelocityX = velocityPointAX - velocityPointBX, + relativeVelocityY = velocityPointAY - velocityPointBY; + + var normalVelocity = normalX * relativeVelocityX + normalY * relativeVelocityY, + tangentVelocity = tangentX * relativeVelocityX + tangentY * relativeVelocityY; // coulomb friction - var tangentImpulse = tangentVelocity, - maxFriction = Infinity; + var normalOverlap = pair.separation + normalVelocity; + var normalForce = Math.min(normalOverlap, 1); + normalForce = normalOverlap < 0 ? 0 : normalForce; + + var frictionLimit = normalForce * friction; - if (tangentSpeed > pair.friction * pair.frictionStatic * normalForce * timeScaleSquared) { - maxFriction = tangentSpeed; - tangentImpulse = Common.clamp( - pair.friction * tangentVelocityDirection * timeScaleSquared, - -maxFriction, maxFriction - ); + if (tangentVelocity > frictionLimit || -tangentVelocity > frictionLimit) { + maxFriction = tangentVelocity > 0 ? tangentVelocity : -tangentVelocity; + tangentImpulse = pair.friction * (tangentVelocity > 0 ? 1 : -1) * timeScaleSquared; + + if (tangentImpulse < -maxFriction) { + tangentImpulse = -maxFriction; + } else if (tangentImpulse > maxFriction) { + tangentImpulse = maxFriction; + } + } else { + tangentImpulse = tangentVelocity; + maxFriction = NumberMaxValue; } - // modify impulses accounting for mass, inertia and offset - var oAcN = Vector.cross(offsetA, normal), - oBcN = Vector.cross(offsetB, normal), - share = contactShare / (bodyA.inverseMass + bodyB.inverseMass + bodyA.inverseInertia * oAcN * oAcN + bodyB.inverseInertia * oBcN * oBcN); + // account for mass, inertia and contact offset + var oAcN = offsetAX * normalY - offsetAY * normalX, + oBcN = offsetBX * normalY - offsetBY * normalX, + share = contactShare / (inverseMassTotal + bodyA.inverseInertia * oAcN * oAcN + bodyB.inverseInertia * oBcN * oBcN); - normalImpulse *= share; + // raw impulses + var normalImpulse = (1 + pair.restitution) * normalVelocity * share; tangentImpulse *= share; // handle high velocity and resting collisions separately - if (normalVelocity < 0 && normalVelocity * normalVelocity > Resolver._restingThresh * timeScaleSquared) { + if (normalVelocity * normalVelocity > restingThresh && normalVelocity < 0) { // high normal velocity so clear cached contact normal impulse contact.normalImpulse = 0; } else { // solve resting collision constraints using Erin Catto's method (GDC08) // impulse constraint tends to 0 var contactNormalImpulse = contact.normalImpulse; - contact.normalImpulse = Math.min(contact.normalImpulse + normalImpulse, 0); + contact.normalImpulse += normalImpulse; + contact.normalImpulse = Math.min(contact.normalImpulse, 0); normalImpulse = contact.normalImpulse - contactNormalImpulse; } // handle high velocity and resting collisions separately - if (tangentVelocity * tangentVelocity > Resolver._restingThreshTangent * timeScaleSquared) { + if (tangentVelocity * tangentVelocity > restingThreshTangent) { // high tangent velocity so clear cached contact tangent impulse contact.tangentImpulse = 0; } else { // solve resting collision constraints using Erin Catto's method (GDC08) // tangent impulse tends to -tangentSpeed or +tangentSpeed var contactTangentImpulse = contact.tangentImpulse; - contact.tangentImpulse = Common.clamp(contact.tangentImpulse + tangentImpulse, -maxFriction, maxFriction); + contact.tangentImpulse += tangentImpulse; + if (contact.tangentImpulse < -maxFriction) contact.tangentImpulse = -maxFriction; + if (contact.tangentImpulse > maxFriction) contact.tangentImpulse = maxFriction; tangentImpulse = contact.tangentImpulse - contactTangentImpulse; } // total impulse from contact - impulse.x = (normal.x * normalImpulse) + (tangent.x * tangentImpulse); - impulse.y = (normal.y * normalImpulse) + (tangent.y * tangentImpulse); + var impulseX = normalX * normalImpulse + tangentX * tangentImpulse, + impulseY = normalY * normalImpulse + tangentY * tangentImpulse; // apply impulse from contact if (!(bodyA.isStatic || bodyA.isSleeping)) { - bodyA.positionPrev.x += impulse.x * bodyA.inverseMass; - bodyA.positionPrev.y += impulse.y * bodyA.inverseMass; - bodyA.anglePrev += Vector.cross(offsetA, impulse) * bodyA.inverseInertia; + bodyA.positionPrev.x += impulseX * bodyA.inverseMass; + bodyA.positionPrev.y += impulseY * bodyA.inverseMass; + bodyA.anglePrev += (offsetAX * impulseY - offsetAY * impulseX) * bodyA.inverseInertia; } if (!(bodyB.isStatic || bodyB.isSleeping)) { - bodyB.positionPrev.x -= impulse.x * bodyB.inverseMass; - bodyB.positionPrev.y -= impulse.y * bodyB.inverseMass; - bodyB.anglePrev -= Vector.cross(offsetB, impulse) * bodyB.inverseInertia; + bodyB.positionPrev.x -= impulseX * bodyB.inverseMass; + bodyB.positionPrev.y -= impulseY * bodyB.inverseMass; + bodyB.anglePrev -= (offsetBX * impulseY - offsetBY * impulseX) * bodyB.inverseInertia; } } } @@ -152795,283 +154241,6 @@ var Bounds = __webpack_require__(84091); })(); -/***/ }), - -/***/ 5756: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -/** -* The `Matter.SAT` module contains methods for detecting collisions using the Separating Axis Theorem. -* -* @class SAT -*/ - -// TODO: true circles and curves - -var SAT = {}; - -module.exports = SAT; - -var Vertices = __webpack_require__(39745); -var Vector = __webpack_require__(10438); - -(function() { - - /** - * Detect collision between two bodies using the Separating Axis Theorem. - * @method collides - * @param {body} bodyA - * @param {body} bodyB - * @param {collision} previousCollision - * @return {collision} collision - */ - SAT.collides = function(bodyA, bodyB, previousCollision) { - var overlapAB, - overlapBA, - minOverlap, - collision, - canReusePrevCol = false; - - if (previousCollision) { - // estimate total motion - var parentA = bodyA.parent, - parentB = bodyB.parent, - motion = parentA.speed * parentA.speed + parentA.angularSpeed * parentA.angularSpeed - + parentB.speed * parentB.speed + parentB.angularSpeed * parentB.angularSpeed; - - // we may be able to (partially) reuse collision result - // but only safe if collision was resting - canReusePrevCol = previousCollision && previousCollision.collided && motion < 0.2; - - // reuse collision object - collision = previousCollision; - } else { - collision = { collided: false, bodyA: bodyA, bodyB: bodyB }; - } - - if (previousCollision && canReusePrevCol) { - // if we can reuse the collision result - // we only need to test the previously found axis - var axisBodyA = collision.axisBody, - axisBodyB = axisBodyA === bodyA ? bodyB : bodyA, - axes = [axisBodyA.axes[previousCollision.axisNumber]]; - - minOverlap = SAT._overlapAxes(axisBodyA.vertices, axisBodyB.vertices, axes); - collision.reused = true; - - if (minOverlap.overlap <= 0) { - collision.collided = false; - return collision; - } - } else { - // if we can't reuse a result, perform a full SAT test - - overlapAB = SAT._overlapAxes(bodyA.vertices, bodyB.vertices, bodyA.axes); - - if (overlapAB.overlap <= 0) { - collision.collided = false; - return collision; - } - - overlapBA = SAT._overlapAxes(bodyB.vertices, bodyA.vertices, bodyB.axes); - - if (overlapBA.overlap <= 0) { - collision.collided = false; - return collision; - } - - if (overlapAB.overlap < overlapBA.overlap) { - minOverlap = overlapAB; - collision.axisBody = bodyA; - } else { - minOverlap = overlapBA; - collision.axisBody = bodyB; - } - - // important for reuse later - collision.axisNumber = minOverlap.axisNumber; - } - - collision.bodyA = bodyA.id < bodyB.id ? bodyA : bodyB; - collision.bodyB = bodyA.id < bodyB.id ? bodyB : bodyA; - collision.collided = true; - collision.depth = minOverlap.overlap; - collision.parentA = collision.bodyA.parent; - collision.parentB = collision.bodyB.parent; - - bodyA = collision.bodyA; - bodyB = collision.bodyB; - - // ensure normal is facing away from bodyA - if (Vector.dot(minOverlap.axis, Vector.sub(bodyB.position, bodyA.position)) < 0) { - collision.normal = { - x: minOverlap.axis.x, - y: minOverlap.axis.y - }; - } else { - collision.normal = { - x: -minOverlap.axis.x, - y: -minOverlap.axis.y - }; - } - - collision.tangent = Vector.perp(collision.normal); - - collision.penetration = collision.penetration || {}; - collision.penetration.x = collision.normal.x * collision.depth; - collision.penetration.y = collision.normal.y * collision.depth; - - // find support points, there is always either exactly one or two - var verticesB = SAT._findSupports(bodyA, bodyB, collision.normal), - supports = []; - - // find the supports from bodyB that are inside bodyA - if (Vertices.contains(bodyA.vertices, verticesB[0])) - supports.push(verticesB[0]); - - if (Vertices.contains(bodyA.vertices, verticesB[1])) - supports.push(verticesB[1]); - - // find the supports from bodyA that are inside bodyB - if (supports.length < 2) { - var verticesA = SAT._findSupports(bodyB, bodyA, Vector.neg(collision.normal)); - - if (Vertices.contains(bodyB.vertices, verticesA[0])) - supports.push(verticesA[0]); - - if (supports.length < 2 && Vertices.contains(bodyB.vertices, verticesA[1])) - supports.push(verticesA[1]); - } - - // account for the edge case of overlapping but no vertex containment - if (supports.length < 1) - supports = [verticesB[0]]; - - collision.supports = supports; - - return collision; - }; - - /** - * Find the overlap between two sets of vertices. - * @method _overlapAxes - * @private - * @param {} verticesA - * @param {} verticesB - * @param {} axes - * @return result - */ - SAT._overlapAxes = function(verticesA, verticesB, axes) { - var projectionA = Vector._temp[0], - projectionB = Vector._temp[1], - result = { overlap: Number.MAX_VALUE }, - overlap, - axis; - - for (var i = 0; i < axes.length; i++) { - axis = axes[i]; - - SAT._projectToAxis(projectionA, verticesA, axis); - SAT._projectToAxis(projectionB, verticesB, axis); - - overlap = Math.min(projectionA.max - projectionB.min, projectionB.max - projectionA.min); - - if (overlap <= 0) { - result.overlap = overlap; - return result; - } - - if (overlap < result.overlap) { - result.overlap = overlap; - result.axis = axis; - result.axisNumber = i; - } - } - - return result; - }; - - /** - * Projects vertices on an axis and returns an interval. - * @method _projectToAxis - * @private - * @param {} projection - * @param {} vertices - * @param {} axis - */ - SAT._projectToAxis = function(projection, vertices, axis) { - var min = Vector.dot(vertices[0], axis), - max = min; - - for (var i = 1; i < vertices.length; i += 1) { - var dot = Vector.dot(vertices[i], axis); - - if (dot > max) { - max = dot; - } else if (dot < min) { - min = dot; - } - } - - projection.min = min; - projection.max = max; - }; - - /** - * Finds supporting vertices given two bodies along a given direction using hill-climbing. - * @method _findSupports - * @private - * @param {} bodyA - * @param {} bodyB - * @param {} normal - * @return [vector] - */ - SAT._findSupports = function(bodyA, bodyB, normal) { - var nearestDistance = Number.MAX_VALUE, - vertexToBody = Vector._temp[0], - vertices = bodyB.vertices, - bodyAPosition = bodyA.position, - distance, - vertex, - vertexA, - vertexB; - - // find closest vertex on bodyB - for (var i = 0; i < vertices.length; i++) { - vertex = vertices[i]; - vertexToBody.x = vertex.x - bodyAPosition.x; - vertexToBody.y = vertex.y - bodyAPosition.y; - distance = -Vector.dot(normal, vertexToBody); - - if (distance < nearestDistance) { - nearestDistance = distance; - vertexA = vertex; - } - } - - // find next closest vertex using the two connected to it - var prevIndex = vertexA.index - 1 >= 0 ? vertexA.index - 1 : vertices.length - 1; - vertex = vertices[prevIndex]; - vertexToBody.x = vertex.x - bodyAPosition.x; - vertexToBody.y = vertex.y - bodyAPosition.y; - nearestDistance = -Vector.dot(normal, vertexToBody); - vertexB = vertex; - - var nextIndex = (vertexA.index + 1) % vertices.length; - vertex = vertices[nextIndex]; - vertexToBody.x = vertex.x - bodyAPosition.x; - vertexToBody.y = vertex.y - bodyAPosition.y; - distance = -Vector.dot(normal, vertexToBody); - if (distance < nearestDistance) { - vertexB = vertex; - } - - return [vertexA, vertexB]; - }; - -})(); - - /***/ }), /***/ 52838: @@ -153391,8 +154560,10 @@ var Common = __webpack_require__(68758); */ Constraint.pointAWorld = function(constraint) { return { - x: (constraint.bodyA ? constraint.bodyA.position.x : 0) + constraint.pointA.x, - y: (constraint.bodyA ? constraint.bodyA.position.y : 0) + constraint.pointA.y + x: (constraint.bodyA ? constraint.bodyA.position.x : 0) + + (constraint.pointA ? constraint.pointA.x : 0), + y: (constraint.bodyA ? constraint.bodyA.position.y : 0) + + (constraint.pointA ? constraint.pointA.y : 0) }; }; @@ -153404,8 +154575,10 @@ var Common = __webpack_require__(68758); */ Constraint.pointBWorld = function(constraint) { return { - x: (constraint.bodyB ? constraint.bodyB.position.x : 0) + constraint.pointB.x, - y: (constraint.bodyB ? constraint.bodyB.position.y : 0) + constraint.pointB.y + x: (constraint.bodyB ? constraint.bodyB.position.x : 0) + + (constraint.pointB ? constraint.pointB.x : 0), + y: (constraint.bodyB ? constraint.bodyB.position.y : 0) + + (constraint.pointB ? constraint.pointB.y : 0) }; }; @@ -153565,7 +154738,7 @@ var Common = __webpack_require__(68758); /***/ }), /***/ 68758: -/***/ ((module) => { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * The `Matter.Common` module contains utility functions that are common to all modules. @@ -153582,7 +154755,9 @@ module.exports = Common; Common._nextId = 0; Common._seed = 0; Common._nowStartTime = +(new Date()); - + Common._warnedOnce = {}; + Common._decomp = null; + /** * Extends the object in the first argument using the object in the second argument. * @method extend @@ -153790,7 +154965,7 @@ module.exports = Common; * @return {boolean} True if the object is a string, otherwise false */ Common.isString = function(obj) { - return Object.prototype.toString.call(obj) === '[object String]'; + return toString.call(obj) === '[object String]'; }; /** @@ -153821,9 +154996,9 @@ module.exports = Common; /** * Returns the current timestamp since the time origin (e.g. from page load). - * The result will be high-resolution including decimal places if available. + * The result is in milliseconds and will use high-resolution timing if available. * @method now - * @return {number} the current timestamp + * @return {number} the current timestamp in milliseconds */ Common.now = function() { if (typeof window !== 'undefined' && window.performance) { @@ -153834,6 +155009,10 @@ module.exports = Common; } } + if (Date.now) { + return Date.now(); + } + return (new Date()) - Common._nowStartTime; }; @@ -153927,6 +155106,35 @@ module.exports = Common; } }; + /** + * Uses `Common.warn` to log the given message one time only. + * @method warnOnce + * @param ...objs {} The objects to log. + */ + Common.warnOnce = function() { + var message = Array.prototype.slice.call(arguments).join(' '); + + if (!Common._warnedOnce[message]) { + Common.warn(message); + Common._warnedOnce[message] = true; + } + }; + + /** + * Shows a deprecated console warning when the function on the given object is called. + * The target function will be replaced with a new function that first shows the warning + * and then calls the original function. + * @method deprecated + * @param {object} obj The object or module + * @param {string} name The property name of the function on obj + * @param {string} warning The one-time message to show if the function is called + */ + Common.deprecated = function(obj, prop, warning) { + obj[prop] = Common.chain(function() { + Common.warnOnce('🔅 deprecated 🔅', warning); + }, obj[prop]); + }; + /** * Returns the next unique sequential ID. * @method nextId @@ -154104,6 +155312,44 @@ module.exports = Common; func )); }; + + /** + * Provide the [poly-decomp](https://github.com/schteppe/poly-decomp.js) library module to enable + * concave vertex decomposition support when using `Bodies.fromVertices` e.g. `Common.setDecomp(require('poly-decomp'))`. + * @method setDecomp + * @param {} decomp The [poly-decomp](https://github.com/schteppe/poly-decomp.js) library module. + */ + Common.setDecomp = function(decomp) { + Common._decomp = decomp; + }; + + /** + * Returns the [poly-decomp](https://github.com/schteppe/poly-decomp.js) library module provided through `Common.setDecomp`, + * otherwise returns the global `decomp` if set. + * @method getDecomp + * @return {} The [poly-decomp](https://github.com/schteppe/poly-decomp.js) library module if provided. + */ + Common.getDecomp = function() { + // get user provided decomp if set + var decomp = Common._decomp; + + try { + // otherwise from window global + if (!decomp && typeof window !== 'undefined') { + decomp = window.decomp; + } + + // otherwise from node global + if (!decomp && typeof __webpack_require__.g !== 'undefined') { + decomp = __webpack_require__.g.decomp; + } + } catch (e) { + // decomp not available + decomp = null; + } + + return decomp; + }; })(); @@ -154126,12 +155372,10 @@ var Engine = {}; module.exports = Engine; -var World = __webpack_require__(72005); var Sleeping = __webpack_require__(22806); var Resolver = __webpack_require__(44272); +var Detector = __webpack_require__(13657); var Pairs = __webpack_require__(91327); -var Metrics = __webpack_require__(86330); -var Grid = __webpack_require__(15489); var Events = __webpack_require__(39073); var Composite = __webpack_require__(11299); var Constraint = __webpack_require__(52838); @@ -154148,16 +155392,9 @@ var Body = __webpack_require__(84125); * @param {object} [options] * @return {engine} engine */ - Engine.create = function(element, options) { - // options may be passed as the first (and only) argument - options = Common.isElement(element) ? options : element; - element = Common.isElement(element) ? element : null; + Engine.create = function(options) { options = options || {}; - if (element || options.render) { - Common.warn('Engine.create: engine.render is deprecated (see docs)'); - } - var defaults = { positionIterations: 6, velocityIterations: 4, @@ -154165,26 +155402,31 @@ var Body = __webpack_require__(84125); enableSleeping: false, events: [], plugin: {}, + gravity: { + x: 0, + y: 1, + scale: 0.001 + }, timing: { timestamp: 0, - timeScale: 1 - }, - broadphase: { - controller: Grid + timeScale: 1, + lastDelta: 0, + lastElapsed: 0 } }; var engine = Common.extend(defaults, options); - engine.world = options.world || World.create(engine.world); - engine.pairs = Pairs.create(); - engine.broadphase = engine.broadphase.controller.create(engine.broadphase); - engine.metrics = engine.metrics || { extended: false }; - - // @if DEBUG - engine.metrics = Metrics.create(engine.metrics); - // @endif + engine.world = options.world || Composite.create({ label: 'World' }); + engine.pairs = options.pairs || Pairs.create(); + engine.detector = options.detector || Detector.create(); + // for temporary back compatibility only + engine.grid = { buckets: [] }; + engine.world.gravity = engine.gravity; + engine.broadphase = engine.grid; + engine.metrics = {}; + return engine; }; @@ -154204,17 +155446,21 @@ var Body = __webpack_require__(84125); * @param {number} [correction=1] */ Engine.update = function(engine, delta, correction) { + var startTime = Common.now(); + delta = delta || 1000 / 60; correction = correction || 1; var world = engine.world, + detector = engine.detector, + pairs = engine.pairs, timing = engine.timing, - broadphase = engine.broadphase, - broadphasePairs = [], + timestamp = timing.timestamp, i; // increment timestamp timing.timestamp += delta * timing.timeScale; + timing.lastDelta = delta * timing.timeScale; // create an event object var event = { @@ -154223,21 +155469,26 @@ var Body = __webpack_require__(84125); Events.trigger(engine, 'beforeUpdate', event); - // get lists of all bodies and constraints, no matter what composites they are in + // get all bodies and all constraints in the world var allBodies = Composite.allBodies(world), allConstraints = Composite.allConstraints(world); - // @if DEBUG - // reset metrics logging - Metrics.reset(engine.metrics); - // @endif + // update the detector bodies if they have changed + if (world.isModified) { + Detector.setBodies(detector, allBodies); + } - // if sleeping enabled, call the sleeping controller + // reset all composite modified flags + if (world.isModified) { + Composite.setModified(world, false, false, true); + } + + // update sleeping if enabled if (engine.enableSleeping) Sleeping.update(allBodies, timing.timeScale); - // applies gravity to all bodies - Engine._bodiesApplyGravity(allBodies, world.gravity); + // apply gravity to all bodies + Engine._bodiesApplyGravity(allBodies, engine.gravity); // update all body position and rotation by integration Engine._bodiesUpdate(allBodies, delta, timing.timeScale, correction, world.bounds); @@ -154249,33 +155500,12 @@ var Body = __webpack_require__(84125); } Constraint.postSolveAll(allBodies); - // broadphase pass: find potential collision pairs - if (broadphase.controller) { - // if world is dirty, we must flush the whole grid - if (world.isModified) - broadphase.controller.clear(broadphase); - - // update the grid buckets based on current bodies - broadphase.controller.update(broadphase, allBodies, engine, world.isModified); - broadphasePairs = broadphase.pairsList; - } else { - // if no broadphase set, we just pass all bodies - broadphasePairs = allBodies; - } - - // clear all composite modified flags - if (world.isModified) { - Composite.setModified(world, false, false, true); - } - - // narrowphase pass: find actual collisions, then create or update collision pairs - var collisions = broadphase.detector(broadphasePairs, engine); + // find all collisions + detector.pairs = engine.pairs; + var collisions = Detector.collisions(detector); // update collision pairs - var pairs = engine.pairs, - timestamp = timing.timestamp; Pairs.update(pairs, collisions, timestamp); - Pairs.removeOld(pairs, timestamp); // wake up bodies involved in collisions if (engine.enableSleeping) @@ -154288,7 +155518,7 @@ var Body = __webpack_require__(84125); // iteratively resolve position between collisions Resolver.preSolvePosition(pairs.list); for (i = 0; i < engine.positionIterations; i++) { - Resolver.solvePosition(pairs.list, allBodies, timing.timeScale); + Resolver.solvePosition(pairs.list, timing.timeScale); } Resolver.postSolvePosition(allBodies); @@ -154312,16 +155542,14 @@ var Body = __webpack_require__(84125); if (pairs.collisionEnd.length > 0) Events.trigger(engine, 'collisionEnd', { pairs: pairs.collisionEnd }); - // @if DEBUG - // update metrics log - Metrics.update(engine.metrics, engine); - // @endif - // clear force buffers Engine._bodiesClearForces(allBodies); Events.trigger(engine, 'afterUpdate', event); + // log the time elapsed computing this update + engine.timing.lastElapsed = Common.now() - startTime; + return engine; }; @@ -154350,21 +155578,13 @@ var Body = __webpack_require__(84125); }; /** - * Clears the engine including the world, pairs and broadphase. + * Clears the engine pairs and detector. * @method clear * @param {engine} engine */ Engine.clear = function(engine) { - var world = engine.world; - Pairs.clear(engine.pairs); - - var broadphase = engine.broadphase; - if (broadphase.controller) { - var bodies = Composite.allBodies(world); - broadphase.controller.clear(broadphase); - broadphase.controller.update(broadphase, bodies, engine, true); - } + Detector.clear(engine.detector); }; /** @@ -154434,7 +155654,8 @@ var Body = __webpack_require__(84125); }; /** - * An alias for `Runner.run`, see `Matter.Runner` for more information. + * A deprecated alias for `Runner.run`, use `Matter.Runner.run(engine)` instead and see `Matter.Runner` for more information. + * @deprecated use Matter.Runner.run(engine) instead * @method run * @param {engine} engine */ @@ -154443,53 +155664,53 @@ var Body = __webpack_require__(84125); * Fired just before an update * * @event beforeUpdate - * @param {} event An event object + * @param {object} event An event object * @param {number} event.timestamp The engine.timing.timestamp of the event - * @param {} event.source The source object of the event - * @param {} event.name The name of the event + * @param {engine} event.source The source object of the event + * @param {string} event.name The name of the event */ /** * Fired after engine update and all collision events * * @event afterUpdate - * @param {} event An event object + * @param {object} event An event object * @param {number} event.timestamp The engine.timing.timestamp of the event - * @param {} event.source The source object of the event - * @param {} event.name The name of the event + * @param {engine} event.source The source object of the event + * @param {string} event.name The name of the event */ /** * Fired after engine update, provides a list of all pairs that have started to collide in the current tick (if any) * * @event collisionStart - * @param {} event An event object - * @param {} event.pairs List of affected pairs + * @param {object} event An event object + * @param {pair[]} event.pairs List of affected pairs * @param {number} event.timestamp The engine.timing.timestamp of the event - * @param {} event.source The source object of the event - * @param {} event.name The name of the event + * @param {engine} event.source The source object of the event + * @param {string} event.name The name of the event */ /** * Fired after engine update, provides a list of all pairs that are colliding in the current tick (if any) * * @event collisionActive - * @param {} event An event object - * @param {} event.pairs List of affected pairs + * @param {object} event An event object + * @param {pair[]} event.pairs List of affected pairs * @param {number} event.timestamp The engine.timing.timestamp of the event - * @param {} event.source The source object of the event - * @param {} event.name The name of the event + * @param {engine} event.source The source object of the event + * @param {string} event.name The name of the event */ /** * Fired after engine update, provides a list of all pairs that have ended collision in the current tick (if any) * * @event collisionEnd - * @param {} event An event object - * @param {} event.pairs List of affected pairs + * @param {object} event An event object + * @param {pair[]} event.pairs List of affected pairs * @param {number} event.timestamp The engine.timing.timestamp of the event - * @param {} event.source The source object of the event - * @param {} event.name The name of the event + * @param {engine} event.source The source object of the event + * @param {string} event.name The name of the event */ /* @@ -154563,32 +155784,56 @@ var Body = __webpack_require__(84125); */ /** - * An instance of a `Render` controller. The default value is a `Matter.Render` instance created by `Engine.create`. - * One may also develop a custom renderer module based on `Matter.Render` and pass an instance of it to `Engine.create` via `options.render`. + * A `Number` that represents the total execution time elapsed during the last `Engine.update` in milliseconds. + * It is updated by timing from the start of the last `Engine.update` call until it ends. * - * A minimal custom renderer object must define at least three functions: `create`, `clear` and `world` (see `Matter.Render`). - * It is also possible to instead pass the _module_ reference via `options.render.controller` and `Engine.create` will instantiate one for you. + * This value will also include the total execution time of all event handlers directly or indirectly triggered by the engine update. * - * @property render - * @type render - * @deprecated see Demo.js for an example of creating a renderer - * @default a Matter.Render instance + * @property timing.lastElapsed + * @type number + * @default 0 */ /** - * An instance of a broadphase controller. The default value is a `Matter.Grid` instance created by `Engine.create`. + * A `Number` that represents the `delta` value used in the last engine update. * + * @property timing.lastDelta + * @type number + * @default 0 + */ + + /** + * A `Matter.Detector` instance. + * + * @property detector + * @type detector + * @default a Matter.Detector instance + */ + + /** + * A `Matter.Grid` instance. + * + * @deprecated replaced by `engine.detector` + * @property grid + * @type grid + * @default a Matter.Grid instance + */ + + /** + * Replaced by and now alias for `engine.grid`. + * + * @deprecated replaced by `engine.detector` * @property broadphase * @type grid * @default a Matter.Grid instance */ /** - * A `World` composite object that will contain all simulated bodies and constraints. + * The root `Matter.Composite` instance that will contain all bodies, constraints and other composites to be simulated by this engine. * * @property world - * @type world - * @default a Matter.World instance + * @type composite + * @default a Matter.Composite instance */ /** @@ -154598,6 +155843,37 @@ var Body = __webpack_require__(84125); * @type {} */ + /** + * The gravity to apply on all bodies in `engine.world`. + * + * @property gravity + * @type object + */ + + /** + * The gravity x component. + * + * @property gravity.x + * @type object + * @default 0 + */ + + /** + * The gravity y component. + * + * @property gravity.y + * @type object + * @default 1 + */ + + /** + * The gravity scale factor. + * + * @property gravity.scale + * @type object + * @default 0.001 + */ + })(); @@ -154754,7 +156030,7 @@ var Common = __webpack_require__(68758); * @readOnly * @type {String} */ - Matter.version = '0.14.2'; + Matter.version = '0.18.0'; /** * A list of plugin dependencies to be installed. These are normally set and installed through `Matter.use`. @@ -154813,106 +156089,6 @@ var Common = __webpack_require__(68758); })(); -/***/ }), - -/***/ 86330: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -// @if DEBUG -/** -* _Internal Class_, not generally used outside of the engine's internals. -* -*/ - -var Metrics = {}; - -module.exports = Metrics; - -var Composite = __webpack_require__(11299); -var Common = __webpack_require__(68758); - -(function() { - - /** - * Creates a new metrics. - * @method create - * @private - * @return {metrics} A new metrics - */ - Metrics.create = function(options) { - var defaults = { - extended: false, - narrowDetections: 0, - narrowphaseTests: 0, - narrowReuse: 0, - narrowReuseCount: 0, - midphaseTests: 0, - broadphaseTests: 0, - narrowEff: 0.0001, - midEff: 0.0001, - broadEff: 0.0001, - collisions: 0, - buckets: 0, - bodies: 0, - pairs: 0 - }; - - return Common.extend(defaults, false, options); - }; - - /** - * Resets metrics. - * @method reset - * @private - * @param {metrics} metrics - */ - Metrics.reset = function(metrics) { - if (metrics.extended) { - metrics.narrowDetections = 0; - metrics.narrowphaseTests = 0; - metrics.narrowReuse = 0; - metrics.narrowReuseCount = 0; - metrics.midphaseTests = 0; - metrics.broadphaseTests = 0; - metrics.narrowEff = 0; - metrics.midEff = 0; - metrics.broadEff = 0; - metrics.collisions = 0; - metrics.buckets = 0; - metrics.pairs = 0; - metrics.bodies = 0; - } - }; - - /** - * Updates metrics. - * @method update - * @private - * @param {metrics} metrics - * @param {engine} engine - */ - Metrics.update = function(metrics, engine) { - if (metrics.extended) { - var world = engine.world, - bodies = Composite.allBodies(world); - - metrics.collisions = metrics.narrowDetections; - metrics.pairs = engine.pairs.list.length; - metrics.bodies = bodies.length; - metrics.midEff = (metrics.narrowDetections / (metrics.midphaseTests || 1)).toFixed(2); - metrics.narrowEff = (metrics.narrowDetections / (metrics.narrowphaseTests || 1)).toFixed(2); - metrics.broadEff = (1 - (metrics.broadphaseTests / (bodies.length || 1))).toFixed(2); - metrics.narrowReuse = (metrics.narrowReuseCount / (metrics.narrowphaseTests || 1)).toFixed(2); - //var broadphase = engine.broadphase[engine.broadphase.current]; - //if (broadphase.instance) - // metrics.buckets = Common.keys(broadphase.instance.buckets).length; - } - }; - -})(); -// @endif - - /***/ }), /***/ 84474: @@ -154966,7 +156142,7 @@ var Common = __webpack_require__(68758); }; /** - * Resolves a dependency to a plugin object from the registry if it exists. + * Resolves a dependency to a plugin object from the registry if it exists. * The `dependency` may contain a version, but only the name matters when resolving. * @method resolve * @param dependency {string} The dependency. @@ -155160,7 +156336,7 @@ var Common = __webpack_require__(68758); */ Plugin.dependencyParse = function(dependency) { if (Common.isString(dependency)) { - var pattern = /^[\w-]+(@(\*|[\^~]?\d+\.\d+\.\d+(-[0-9A-Za-z-]+)?))?$/; + var pattern = /^[\w-]+(@(\*|[\^~]?\d+\.\d+\.\d+(-[0-9A-Za-z-+]+)?))?$/; if (!pattern.test(dependency)) { Common.warn('Plugin.dependencyParse:', dependency, 'is not a valid dependency string.'); @@ -155179,13 +156355,15 @@ var Common = __webpack_require__(68758); }; /** - * Parses a version string into its components. + * Parses a version string into its components. * Versions are strictly of the format `x.y.z` (as in [semver](http://semver.org/)). * Versions may optionally have a prerelease tag in the format `x.y.z-alpha`. * Ranges are a strict subset of [npm ranges](https://docs.npmjs.com/misc/semver#advanced-range-syntax). * Only the following range types are supported: * - Tilde ranges e.g. `~1.2.3` * - Caret ranges e.g. `^1.2.3` + * - Greater than ranges e.g. `>1.2.3` + * - Greater than or equal ranges e.g. `>=1.2.3` * - Exact version e.g. `1.2.3` * - Any version `*` * @method versionParse @@ -155193,29 +156371,28 @@ var Common = __webpack_require__(68758); * @return {object} The version range parsed into its components. */ Plugin.versionParse = function(range) { - var pattern = /^\*|[\^~]?\d+\.\d+\.\d+(-[0-9A-Za-z-]+)?$/; + var pattern = /^(\*)|(\^|~|>=|>)?\s*((\d+)\.(\d+)\.(\d+))(-[0-9A-Za-z-+]+)?$/; if (!pattern.test(range)) { Common.warn('Plugin.versionParse:', range, 'is not a valid version or range.'); } - var identifiers = range.split('-'); - range = identifiers[0]; - - var isRange = isNaN(Number(range[0])), - version = isRange ? range.substr(1) : range, - parts = Common.map(version.split('.'), function(part) { - return Number(part); - }); + var parts = pattern.exec(range); + var major = Number(parts[4]); + var minor = Number(parts[5]); + var patch = Number(parts[6]); return { - isRange: isRange, - version: version, + isRange: Boolean(parts[1] || parts[2]), + version: parts[3], range: range, - operator: isRange ? range[0] : '', - parts: parts, - prerelease: identifiers[1], - number: parts[0] * 1e8 + parts[1] * 1e4 + parts[2] + operator: parts[1] || parts[2] || '', + major: major, + minor: minor, + patch: patch, + parts: [major, minor, patch], + prerelease: parts[7], + number: major * 1e8 + minor * 1e4 + patch }; }; @@ -155231,30 +156408,36 @@ var Common = __webpack_require__(68758); Plugin.versionSatisfies = function(version, range) { range = range || '*'; - var rangeParsed = Plugin.versionParse(range), - rangeParts = rangeParsed.parts, - versionParsed = Plugin.versionParse(version), - versionParts = versionParsed.parts; + var r = Plugin.versionParse(range), + v = Plugin.versionParse(version); - if (rangeParsed.isRange) { - if (rangeParsed.operator === '*' || version === '*') { + if (r.isRange) { + if (r.operator === '*' || version === '*') { return true; } - if (rangeParsed.operator === '~') { - return versionParts[0] === rangeParts[0] && versionParts[1] === rangeParts[1] && versionParts[2] >= rangeParts[2]; + if (r.operator === '>') { + return v.number > r.number; } - if (rangeParsed.operator === '^') { - if (rangeParts[0] > 0) { - return versionParts[0] === rangeParts[0] && versionParsed.number >= rangeParsed.number; + if (r.operator === '>=') { + return v.number >= r.number; + } + + if (r.operator === '~') { + return v.major === r.major && v.minor === r.minor && v.patch >= r.patch; + } + + if (r.operator === '^') { + if (r.major > 0) { + return v.major === r.major && v.number >= r.number; } - if (rangeParts[1] > 0) { - return versionParts[1] === rangeParts[1] && versionParts[2] >= rangeParts[2]; + if (r.minor > 0) { + return v.minor === r.minor && v.patch >= r.patch; } - return versionParts[2] === rangeParts[2]; + return v.patch === r.patch; } } @@ -155406,7 +156589,7 @@ var Events = __webpack_require__(39073); /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** -* The `Matter.Bodies` module contains factory methods for creating rigid body models +* The `Matter.Bodies` module contains factory methods for creating rigid body models * with commonly used body configurations (such as rectangles, circles and other polygons). * * See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples). @@ -155425,12 +156608,11 @@ var Common = __webpack_require__(68758); var Body = __webpack_require__(84125); var Bounds = __webpack_require__(84091); var Vector = __webpack_require__(10438); -var decomp = __webpack_require__(81084); (function() { /** - * Creates a new rigid body model with a rectangle hull. + * Creates a new rigid body model with a rectangle hull. * The options parameter is an object that specifies any properties you wish to override the defaults. * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object. * @method rectangle @@ -155444,7 +156626,7 @@ var decomp = __webpack_require__(81084); Bodies.rectangle = function(x, y, width, height, options) { options = options || {}; - var rectangle = { + var rectangle = { label: 'Rectangle Body', position: { x: x, y: y }, vertices: Vertices.fromPath('L 0 0 L ' + width + ' 0 L ' + width + ' ' + height + ' L 0 ' + height) @@ -155452,16 +156634,16 @@ var decomp = __webpack_require__(81084); if (options.chamfer) { var chamfer = options.chamfer; - rectangle.vertices = Vertices.chamfer(rectangle.vertices, chamfer.radius, + rectangle.vertices = Vertices.chamfer(rectangle.vertices, chamfer.radius, chamfer.quality, chamfer.qualityMin, chamfer.qualityMax); delete options.chamfer; } return Body.create(Common.extend({}, rectangle, options)); }; - + /** - * Creates a new rigid body model with a trapezoid hull. + * Creates a new rigid body model with a trapezoid hull. * The options parameter is an object that specifies any properties you wish to override the defaults. * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object. * @method trapezoid @@ -155478,7 +156660,7 @@ var decomp = __webpack_require__(81084); slope *= 0.5; var roof = (1 - (slope * 2)) * width; - + var x1 = width * slope, x2 = x1 + roof, x3 = x2 + x1, @@ -155490,7 +156672,7 @@ var decomp = __webpack_require__(81084); verticesPath = 'L 0 0 L ' + x2 + ' ' + (-height) + ' L ' + x3 + ' 0'; } - var trapezoid = { + var trapezoid = { label: 'Trapezoid Body', position: { x: x, y: y }, vertices: Vertices.fromPath(verticesPath) @@ -155498,7 +156680,7 @@ var decomp = __webpack_require__(81084); if (options.chamfer) { var chamfer = options.chamfer; - trapezoid.vertices = Vertices.chamfer(trapezoid.vertices, chamfer.radius, + trapezoid.vertices = Vertices.chamfer(trapezoid.vertices, chamfer.radius, chamfer.quality, chamfer.qualityMin, chamfer.qualityMax); delete options.chamfer; } @@ -155507,7 +156689,7 @@ var decomp = __webpack_require__(81084); }; /** - * Creates a new rigid body model with a circle hull. + * Creates a new rigid body model with a circle hull. * The options parameter is an object that specifies any properties you wish to override the defaults. * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object. * @method circle @@ -155525,7 +156707,7 @@ var decomp = __webpack_require__(81084); label: 'Circle Body', circleRadius: radius }; - + // approximate circles with polygons until true circles implemented in SAT maxSides = maxSides || 25; var sides = Math.ceil(Math.max(10, Math.min(maxSides, radius))); @@ -155538,7 +156720,7 @@ var decomp = __webpack_require__(81084); }; /** - * Creates a new rigid body model with a regular polygon hull with the given number of sides. + * Creates a new rigid body model with a regular polygon hull with the given number of sides. * The options parameter is an object that specifies any properties you wish to override the defaults. * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object. * @method polygon @@ -155567,7 +156749,7 @@ var decomp = __webpack_require__(81084); path += 'L ' + xx.toFixed(3) + ' ' + yy.toFixed(3) + ' '; } - var polygon = { + var polygon = { label: 'Polygon Body', position: { x: x, y: y }, vertices: Vertices.fromPath(path) @@ -155575,7 +156757,7 @@ var decomp = __webpack_require__(81084); if (options.chamfer) { var chamfer = options.chamfer; - polygon.vertices = Vertices.chamfer(polygon.vertices, chamfer.radius, + polygon.vertices = Vertices.chamfer(polygon.vertices, chamfer.radius, chamfer.quality, chamfer.qualityMin, chamfer.qualityMax); delete options.chamfer; } @@ -155584,29 +156766,46 @@ var decomp = __webpack_require__(81084); }; /** - * Creates a body using the supplied vertices (or an array containing multiple sets of vertices). - * If the vertices are convex, they will pass through as supplied. - * Otherwise if the vertices are concave, they will be decomposed if [poly-decomp.js](https://github.com/schteppe/poly-decomp.js) is available. - * Note that this process is not guaranteed to support complex sets of vertices (e.g. those with holes may fail). - * By default the decomposition will discard collinear edges (to improve performance). - * It can also optionally discard any parts that have an area less than `minimumArea`. - * If the vertices can not be decomposed, the result will fall back to using the convex hull. - * The options parameter is an object that specifies any `Matter.Body` properties you wish to override the defaults. + * Utility to create a compound body based on set(s) of vertices. + * + * _Note:_ To optionally enable automatic concave vertices decomposition the [poly-decomp](https://github.com/schteppe/poly-decomp.js) + * package must be first installed and provided see `Common.setDecomp`, otherwise the convex hull of each vertex set will be used. + * + * The resulting vertices are reorientated about their centre of mass, + * and offset such that `body.position` corresponds to this point. + * + * The resulting offset may be found if needed by subtracting `body.bounds` from the original input bounds. + * To later move the centre of mass see `Body.setCentre`. + * + * Note that automatic conconcave decomposition results are not always optimal. + * For best results, simplify the input vertices as much as possible first. + * By default this function applies some addtional simplification to help. + * + * Some outputs may also require further manual processing afterwards to be robust. + * In particular some parts may need to be overlapped to avoid collision gaps. + * Thin parts and sharp points should be avoided or removed where possible. + * + * The options parameter object specifies any `Matter.Body` properties you wish to override the defaults. + * * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object. * @method fromVertices * @param {number} x * @param {number} y - * @param [[vector]] vertexSets - * @param {object} [options] - * @param {bool} [flagInternal=false] - * @param {number} [removeCollinear=0.01] - * @param {number} [minimumArea=10] + * @param {array} vertexSets One or more arrays of vertex points e.g. `[[{ x: 0, y: 0 }...], ...]`. + * @param {object} [options] The body options. + * @param {bool} [flagInternal=false] Optionally marks internal edges with `isInternal`. + * @param {number} [removeCollinear=0.01] Threshold when simplifying vertices along the same edge. + * @param {number} [minimumArea=10] Threshold when removing small parts. + * @param {number} [removeDuplicatePoints=0.01] Threshold when simplifying nearby vertices. * @return {body} */ - Bodies.fromVertices = function(x, y, vertexSets, options, flagInternal, removeCollinear, minimumArea) { - var body, + Bodies.fromVertices = function(x, y, vertexSets, options, flagInternal, removeCollinear, minimumArea, removeDuplicatePoints) { + var decomp = Common.getDecomp(), + canDecomp, + body, parts, isConvex, + isConcave, vertices, i, j, @@ -155614,16 +156813,16 @@ var decomp = __webpack_require__(81084); v, z; + // check decomp is as expected + canDecomp = Boolean(decomp && decomp.quickDecomp); + options = options || {}; parts = []; flagInternal = typeof flagInternal !== 'undefined' ? flagInternal : false; removeCollinear = typeof removeCollinear !== 'undefined' ? removeCollinear : 0.01; minimumArea = typeof minimumArea !== 'undefined' ? minimumArea : 10; - - if (!decomp) { - Common.warn('Bodies.fromVertices: poly-decomp.js required. Could not decompose vertices. Fallback to convex hull.'); - } + removeDuplicatePoints = typeof removeDuplicatePoints !== 'undefined' ? removeDuplicatePoints : 0.01; // ensure vertexSets is an array of arrays if (!Common.isArray(vertexSets[0])) { @@ -155633,8 +156832,15 @@ var decomp = __webpack_require__(81084); for (v = 0; v < vertexSets.length; v += 1) { vertices = vertexSets[v]; isConvex = Vertices.isConvex(vertices); + isConcave = !isConvex; - if (isConvex || !decomp) { + if (isConcave && !canDecomp) { + Common.warnOnce( + 'Bodies.fromVertices: Install the \'poly-decomp\' library and use Common.setDecomp or provide \'decomp\' as a global to decompose concave vertices.' + ); + } + + if (isConvex || !canDecomp) { if (isConvex) { vertices = Vertices.clockwiseSort(vertices); } else { @@ -155656,6 +156862,8 @@ var decomp = __webpack_require__(81084); decomp.makeCCW(concave); if (removeCollinear !== false) decomp.removeCollinearPoints(concave, removeCollinear); + if (removeDuplicatePoints !== false && decomp.removeDuplicatePoints) + decomp.removeDuplicatePoints(concave, removeDuplicatePoints); // use the quick decomposition algorithm (Bayazit) var decomposed = decomp.quickDecomp(concave); @@ -155690,6 +156898,7 @@ var decomp = __webpack_require__(81084); parts[i] = Body.create(Common.extend(parts[i], options)); } + // flag internal edges (coincident part edges) if (flagInternal) { Bodies.flagCoincidentParts(parts, 5); @@ -155698,6 +156907,8 @@ var decomp = __webpack_require__(81084); if (parts.length > 1) { // create the parent body to be returned, that contains generated compound parts body = Body.create(Common.extend({ parts: parts.slice(0) }, options)); + + // offset such that body.position is at the centre off mass Body.setPosition(body, { x: x, y: y }); return body; @@ -155709,7 +156920,7 @@ var decomp = __webpack_require__(81084); /** * Takes an array of Body objects and flags all internal edges (coincident parts) based on the maxDistance * value. The array is changed in-place and returned, so you can pass this function a `Body.parts` property. - * + * * @method flagCoincidentParts * @param {body[]} parts - The Body parts, or array of bodies, to flag. * @param {number} [maxDistance=5] @@ -155782,6 +156993,7 @@ var Constraint = __webpack_require__(52838); var Common = __webpack_require__(68758); var Body = __webpack_require__(84125); var Bodies = __webpack_require__(68516); +var deprecated = Common.deprecated; (function() { @@ -155968,7 +157180,8 @@ var Bodies = __webpack_require__(68516); }; /** - * Creates a composite with a Newton's Cradle setup of bodies and constraints. + * This has now moved to the [newtonsCradle example](https://github.com/liabru/matter-js/blob/master/examples/newtonsCradle.js), follow that instead as this function is deprecated here. + * @deprecated moved to newtonsCradle example * @method newtonsCradle * @param {number} xx * @param {number} yy @@ -155992,9 +157205,12 @@ var Bodies = __webpack_require__(68516); return newtonsCradle; }; + + deprecated(Composites, 'newtonsCradle', 'Composites.newtonsCradle ➤ moved to newtonsCradle example'); /** - * Creates a composite with simple car setup of bodies and constraints. + * This has now moved to the [car example](https://github.com/liabru/matter-js/blob/master/examples/car.js), follow that instead as this function is deprecated here. + * @deprecated moved to car example * @method car * @param {number} xx * @param {number} yy @@ -156060,8 +157276,12 @@ var Bodies = __webpack_require__(68516); return car; }; + deprecated(Composites, 'car', 'Composites.car ➤ moved to car example'); + /** - * Creates a simple soft body like object. + * This has now moved to the [softBody example](https://github.com/liabru/matter-js/blob/master/examples/softBody.js) + * and the [cloth example](https://github.com/liabru/matter-js/blob/master/examples/cloth.js), follow those instead as this function is deprecated here. + * @deprecated moved to softBody and cloth examples * @method softBody * @param {number} xx * @param {number} yy @@ -156090,6 +157310,7 @@ var Bodies = __webpack_require__(68516); return softBody; }; + deprecated(Composites, 'softBody', 'Composites.softBody ➤ moved to softBody and cloth examples'); })(); @@ -156819,17 +158040,9 @@ var Common = __webpack_require__(68758); y: point.y, index: i, body: body, - isInternal: false, - contact: null, - offset: null + isInternal: false }; - vertex.contact = { - vertex: vertex, - normalImpulse: 0, - tangentImpulse: 0 - }; - vertices.push(vertex); } @@ -156952,17 +158165,16 @@ var Common = __webpack_require__(68758); * @param {number} scalar */ Vertices.translate = function(vertices, vector, scalar) { - var i; - if (scalar) { - for (i = 0; i < vertices.length; i++) { - vertices[i].x += vector.x * scalar; - vertices[i].y += vector.y * scalar; - } - } else { - for (i = 0; i < vertices.length; i++) { - vertices[i].x += vector.x; - vertices[i].y += vector.y; - } + scalar = typeof scalar !== 'undefined' ? scalar : 1; + + var verticesLength = vertices.length, + translateX = vector.x * scalar, + translateY = vector.y * scalar, + i; + + for (i = 0; i < verticesLength; i++) { + vertices[i].x += translateX; + vertices[i].y += translateY; } return vertices; @@ -156980,15 +158192,21 @@ var Common = __webpack_require__(68758); return; var cos = Math.cos(angle), - sin = Math.sin(angle); + sin = Math.sin(angle), + pointX = point.x, + pointY = point.y, + verticesLength = vertices.length, + vertex, + dx, + dy, + i; - for (var i = 0; i < vertices.length; i++) { - var vertice = vertices[i], - dx = vertice.x - point.x, - dy = vertice.y - point.y; - - vertice.x = point.x + (dx * cos - dy * sin); - vertice.y = point.y + (dx * sin + dy * cos); + for (i = 0; i < verticesLength; i++) { + vertex = vertices[i]; + dx = vertex.x - pointX; + dy = vertex.y - pointY; + vertex.x = pointX + (dx * cos - dy * sin); + vertex.y = pointY + (dx * sin + dy * cos); } return vertices; @@ -157002,12 +158220,21 @@ var Common = __webpack_require__(68758); * @return {boolean} True if the vertices contains point, otherwise false */ Vertices.contains = function(vertices, point) { - for (var i = 0; i < vertices.length; i++) { - var vertice = vertices[i], - nextVertice = vertices[(i + 1) % vertices.length]; - if ((point.x - vertice.x) * (nextVertice.y - vertice.y) + (point.y - vertice.y) * (vertice.x - nextVertice.x) > 0) { + var pointX = point.x, + pointY = point.y, + verticesLength = vertices.length, + vertex = vertices[verticesLength - 1], + nextVertex; + + for (var i = 0; i < verticesLength; i++) { + nextVertex = vertices[i]; + + if ((pointX - vertex.x) * (nextVertex.y - vertex.y) + + (pointY - vertex.y) * (vertex.x - nextVertex.x) > 0) { return false; } + + vertex = nextVertex; } return true; @@ -157246,7 +158473,7 @@ var MatterAttractors = { name: 'matter-attractors', version: '0.1.7', - for: 'matter-js@^0.14.2', + for: 'matter-js@^0.18.0', silent: true, // installs the plugin where `base` is `Matter` @@ -157405,7 +158632,7 @@ var MatterCollisionEvents = { name: 'matter-collision-events', version: '0.1.6', - for: 'matter-js@^0.14.2', + for: 'matter-js@^0.18.0', silent: true, install: function (matter) @@ -157540,7 +158767,7 @@ var MatterWrap = { // plugin meta name: 'matter-wrap', // PLUGIN_NAME version: '0.1.4', // PLUGIN_VERSION - for: 'matter-js@^0.14.2', + for: 'matter-js@^0.18.0', silent: true, // no console log please // installs the plugin where `base` is `Matter` @@ -157621,8 +158848,8 @@ var MatterWrap = { Body: { /** - * Wraps the `body` position such that it always stays within the given bounds. - * Upon crossing a boundary the body will appear on the opposite side of the bounds, + * Wraps the `body` position such that it always stays within the given bounds. + * Upon crossing a boundary the body will appear on the opposite side of the bounds, * while maintaining its velocity. * This is called automatically by the plugin. * @function MatterWrap.Body.wrap @@ -157652,7 +158879,7 @@ var MatterWrap = { bounds: function(composite) { var bodies = Matter.Composite.allBodies(composite), vertices = []; - + for (var i = 0; i < bodies.length; i += 1) { var body = bodies[i]; vertices.push(body.bounds.min, body.bounds.max); @@ -157662,8 +158889,8 @@ var MatterWrap = { }, /** - * Wraps the `composite` position such that it always stays within the given bounds. - * Upon crossing a boundary the composite will appear on the opposite side of the bounds, + * Wraps the `composite` position such that it always stays within the given bounds. + * Upon crossing a boundary the composite will appear on the opposite side of the bounds, * while maintaining its velocity. * This is called automatically by the plugin. * @function MatterWrap.Composite.wrap @@ -157673,7 +158900,7 @@ var MatterWrap = { */ wrap: function(composite, bounds) { var translation = MatterWrap.Bounds.wrap( - MatterWrap.Composite.bounds(composite), + MatterWrap.Composite.bounds(composite), bounds ); @@ -157694,19 +158921,20 @@ module.exports = MatterWrap; */ /** - * This plugin adds a new property `body.plugin.wrap` to instances of `Matter.Body`. + * This plugin adds a new property `body.plugin.wrap` to instances of `Matter.Body`. * This is a `Matter.Bounds` instance that specifies the wrapping region. * @property {Matter.Bounds} body.plugin.wrap * @memberof Matter.Body */ /** - * This plugin adds a new property `composite.plugin.wrap` to instances of `Matter.Composite`. + * This plugin adds a new property `composite.plugin.wrap` to instances of `Matter.Composite`. * This is a `Matter.Bounds` instance that specifies the wrapping region. * @property {Matter.Bounds} composite.plugin.wrap * @memberof Matter.Composite */ + /***/ }), /***/ 81084: @@ -158385,7 +159613,7 @@ function points_eq(a,b,precision){ /** * @author Richard Davey -* @copyright 2020 Photon Storm Ltd. +* @copyright 2022 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} */ @@ -158516,13 +159744,13 @@ module.exports = BasePlugin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Default Plugins. - * + * * @namespace Phaser.Plugins.DefaultPlugins * @memberof Phaser.Plugins * @since 3.0.0 @@ -158619,7 +159847,7 @@ module.exports = DefaultPlugins; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -158645,7 +159873,7 @@ var PluginCache = {}; * * @method Phaser.Plugins.PluginCache.register * @since 3.8.0 - * + * * @param {string} key - A reference used to get this plugin from the plugin cache. * @param {function} plugin - The plugin to be stored. Should be the core object, not instantiated. * @param {string} mapping - If this plugin is to be injected into the Scene Systems, this is the property key map used. @@ -158664,7 +159892,7 @@ PluginCache.register = function (key, plugin, mapping, custom) * * @method Phaser.Plugins.PluginCache.registerCustom * @since 3.8.0 - * + * * @param {string} key - A reference used to get this plugin from the plugin cache. * @param {function} plugin - The plugin to be stored. Should be the core object, not instantiated. * @param {string} mapping - If this plugin is to be injected into the Scene Systems, this is the property key map used. @@ -158680,7 +159908,7 @@ PluginCache.registerCustom = function (key, plugin, mapping, data) * * @method Phaser.Plugins.PluginCache.hasCore * @since 3.8.0 - * + * * @param {string} key - The key to check for. * * @return {boolean} `true` if the key is already in use in the core cache, otherwise `false`. @@ -158695,7 +159923,7 @@ PluginCache.hasCore = function (key) * * @method Phaser.Plugins.PluginCache.hasCustom * @since 3.8.0 - * + * * @param {string} key - The key to check for. * * @return {boolean} `true` if the key is already in use in the custom cache, otherwise `false`. @@ -158710,7 +159938,7 @@ PluginCache.hasCustom = function (key) * * @method Phaser.Plugins.PluginCache.getCore * @since 3.8.0 - * + * * @param {string} key - The key of the core plugin to get. * * @return {Phaser.Types.Plugins.CorePluginContainer} The core plugin object. @@ -158725,7 +159953,7 @@ PluginCache.getCore = function (key) * * @method Phaser.Plugins.PluginCache.getCustom * @since 3.8.0 - * + * * @param {string} key - The key of the custom plugin to get. * * @return {Phaser.Types.Plugins.CustomPluginContainer} The custom plugin object. @@ -158740,7 +159968,7 @@ PluginCache.getCustom = function (key) * * @method Phaser.Plugins.PluginCache.getCustomClass * @since 3.8.0 - * + * * @param {string} key - The key of the custom plugin to get. * * @return {function} The custom plugin object. @@ -158755,7 +159983,7 @@ PluginCache.getCustomClass = function (key) * * @method Phaser.Plugins.PluginCache.remove * @since 3.8.0 - * + * * @param {string} key - The key of the core plugin to remove. */ PluginCache.remove = function (key) @@ -158771,7 +159999,7 @@ PluginCache.remove = function (key) * * @method Phaser.Plugins.PluginCache.removeCustom * @since 3.8.0 - * + * * @param {string} key - The key of the custom plugin to remove. */ PluginCache.removeCustom = function (key) @@ -158784,7 +160012,7 @@ PluginCache.removeCustom = function (key) /** * Removes all Core Plugins. - * + * * This includes all of the internal system plugins that Phaser needs, like the Input Plugin and Loader Plugin. * So be sure you only call this if you do not wish to run Phaser again. * @@ -158829,7 +160057,7 @@ module.exports = PluginCache; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -159737,7 +160965,7 @@ module.exports = PluginManager; /** * @author Richard Davey -* @copyright 2020 Photon Storm Ltd. +* @copyright 2022 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} */ @@ -159880,7 +161108,7 @@ module.exports = ScenePlugin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -159906,13 +161134,13 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Phaser Blend Modes. - * + * * @namespace Phaser.BlendModes * @since 3.0.0 */ @@ -159921,7 +161149,7 @@ module.exports = { /** * Skips the Blend Mode check in the renderer. - * + * * @name Phaser.BlendModes.SKIP_CHECK * @type {number} * @const @@ -159932,7 +161160,7 @@ module.exports = { /** * Normal blend mode. For Canvas and WebGL. * This is the default setting and draws new shapes on top of the existing canvas content. - * + * * @name Phaser.BlendModes.NORMAL * @type {number} * @const @@ -159943,7 +161171,7 @@ module.exports = { /** * Add blend mode. For Canvas and WebGL. * Where both shapes overlap the color is determined by adding color values. - * + * * @name Phaser.BlendModes.ADD * @type {number} * @const @@ -159954,7 +161182,7 @@ module.exports = { /** * Multiply blend mode. For Canvas and WebGL. * The pixels are of the top layer are multiplied with the corresponding pixel of the bottom layer. A darker picture is the result. - * + * * @name Phaser.BlendModes.MULTIPLY * @type {number} * @const @@ -159965,7 +161193,7 @@ module.exports = { /** * Screen blend mode. For Canvas and WebGL. * The pixels are inverted, multiplied, and inverted again. A lighter picture is the result (opposite of multiply) - * + * * @name Phaser.BlendModes.SCREEN * @type {number} * @const @@ -159976,7 +161204,7 @@ module.exports = { /** * Overlay blend mode. For Canvas only. * A combination of multiply and screen. Dark parts on the base layer become darker, and light parts become lighter. - * + * * @name Phaser.BlendModes.OVERLAY * @type {number} * @const @@ -159987,7 +161215,7 @@ module.exports = { /** * Darken blend mode. For Canvas only. * Retains the darkest pixels of both layers. - * + * * @name Phaser.BlendModes.DARKEN * @type {number} * @const @@ -159998,7 +161226,7 @@ module.exports = { /** * Lighten blend mode. For Canvas only. * Retains the lightest pixels of both layers. - * + * * @name Phaser.BlendModes.LIGHTEN * @type {number} * @const @@ -160009,7 +161237,7 @@ module.exports = { /** * Color Dodge blend mode. For Canvas only. * Divides the bottom layer by the inverted top layer. - * + * * @name Phaser.BlendModes.COLOR_DODGE * @type {number} * @const @@ -160020,7 +161248,7 @@ module.exports = { /** * Color Burn blend mode. For Canvas only. * Divides the inverted bottom layer by the top layer, and then inverts the result. - * + * * @name Phaser.BlendModes.COLOR_BURN * @type {number} * @const @@ -160031,7 +161259,7 @@ module.exports = { /** * Hard Light blend mode. For Canvas only. * A combination of multiply and screen like overlay, but with top and bottom layer swapped. - * + * * @name Phaser.BlendModes.HARD_LIGHT * @type {number} * @const @@ -160042,7 +161270,7 @@ module.exports = { /** * Soft Light blend mode. For Canvas only. * A softer version of hard-light. Pure black or white does not result in pure black or white. - * + * * @name Phaser.BlendModes.SOFT_LIGHT * @type {number} * @const @@ -160053,7 +161281,7 @@ module.exports = { /** * Difference blend mode. For Canvas only. * Subtracts the bottom layer from the top layer or the other way round to always get a positive value. - * + * * @name Phaser.BlendModes.DIFFERENCE * @type {number} * @const @@ -160064,7 +161292,7 @@ module.exports = { /** * Exclusion blend mode. For Canvas only. * Like difference, but with lower contrast. - * + * * @name Phaser.BlendModes.EXCLUSION * @type {number} * @const @@ -160075,7 +161303,7 @@ module.exports = { /** * Hue blend mode. For Canvas only. * Preserves the luma and chroma of the bottom layer, while adopting the hue of the top layer. - * + * * @name Phaser.BlendModes.HUE * @type {number} * @const @@ -160086,7 +161314,7 @@ module.exports = { /** * Saturation blend mode. For Canvas only. * Preserves the luma and hue of the bottom layer, while adopting the chroma of the top layer. - * + * * @name Phaser.BlendModes.SATURATION * @type {number} * @const @@ -160097,7 +161325,7 @@ module.exports = { /** * Color blend mode. For Canvas only. * Preserves the luma of the bottom layer, while adopting the hue and chroma of the top layer. - * + * * @name Phaser.BlendModes.COLOR * @type {number} * @const @@ -160108,7 +161336,7 @@ module.exports = { /** * Luminosity blend mode. For Canvas only. * Preserves the hue and chroma of the bottom layer, while adopting the luma of the top layer. - * + * * @name Phaser.BlendModes.LUMINOSITY * @type {number} * @const @@ -160118,7 +161346,7 @@ module.exports = { /** * Alpha erase blend mode. For Canvas and WebGL. - * + * * @name Phaser.BlendModes.ERASE * @type {number} * @const @@ -160129,7 +161357,7 @@ module.exports = { /** * Source-in blend mode. For Canvas only. * The new shape is drawn only where both the new shape and the destination canvas overlap. Everything else is made transparent. - * + * * @name Phaser.BlendModes.SOURCE_IN * @type {number} * @const @@ -160140,7 +161368,7 @@ module.exports = { /** * Source-out blend mode. For Canvas only. * The new shape is drawn where it doesn't overlap the existing canvas content. - * + * * @name Phaser.BlendModes.SOURCE_OUT * @type {number} * @const @@ -160151,7 +161379,7 @@ module.exports = { /** * Source-out blend mode. For Canvas only. * The new shape is only drawn where it overlaps the existing canvas content. - * + * * @name Phaser.BlendModes.SOURCE_ATOP * @type {number} * @const @@ -160162,7 +161390,7 @@ module.exports = { /** * Destination-over blend mode. For Canvas only. * New shapes are drawn behind the existing canvas content. - * + * * @name Phaser.BlendModes.DESTINATION_OVER * @type {number} * @const @@ -160173,7 +161401,7 @@ module.exports = { /** * Destination-in blend mode. For Canvas only. * The existing canvas content is kept where both the new shape and existing canvas content overlap. Everything else is made transparent. - * + * * @name Phaser.BlendModes.DESTINATION_IN * @type {number} * @const @@ -160184,7 +161412,7 @@ module.exports = { /** * Destination-out blend mode. For Canvas only. * The existing content is kept where it doesn't overlap the new shape. - * + * * @name Phaser.BlendModes.DESTINATION_OUT * @type {number} * @const @@ -160195,7 +161423,7 @@ module.exports = { /** * Destination-out blend mode. For Canvas only. * The existing canvas is only kept where it overlaps the new shape. The new shape is drawn behind the canvas content. - * + * * @name Phaser.BlendModes.DESTINATION_ATOP * @type {number} * @const @@ -160206,7 +161434,7 @@ module.exports = { /** * Lighten blend mode. For Canvas only. * Where both shapes overlap the color is determined by adding color values. - * + * * @name Phaser.BlendModes.LIGHTER * @type {number} * @const @@ -160217,7 +161445,7 @@ module.exports = { /** * Copy blend mode. For Canvas only. * Only the new shape is shown. - * + * * @name Phaser.BlendModes.COPY * @type {number} * @const @@ -160228,7 +161456,7 @@ module.exports = { /** * Xor blend mode. For Canvas only. * Shapes are made transparent where both overlap and drawn normal everywhere else. - * + * * @name Phaser.BlendModes.XOR * @type {number} * @const @@ -160246,13 +161474,13 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Phaser Scale Modes. - * + * * @namespace Phaser.ScaleModes * @since 3.0.0 */ @@ -160261,7 +161489,7 @@ var ScaleModes = { /** * Default Scale Mode (Linear). - * + * * @name Phaser.ScaleModes.DEFAULT * @type {number} * @readonly @@ -160271,7 +161499,7 @@ var ScaleModes = { /** * Linear Scale Mode. - * + * * @name Phaser.ScaleModes.LINEAR * @type {number} * @readonly @@ -160281,7 +161509,7 @@ var ScaleModes = { /** * Nearest Scale Mode. - * + * * @name Phaser.ScaleModes.NEAREST * @type {number} * @readonly @@ -160302,7 +161530,7 @@ module.exports = ScaleModes; /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -160415,7 +161643,8 @@ var CanvasRenderer = new Class({ var contextOptions = { alpha: game.config.transparent, - desynchronized: game.config.desynchronized + desynchronized: game.config.desynchronized, + willReadFrequently: false }; /** @@ -161112,14 +162341,17 @@ var CanvasRenderer = new Class({ ctx.globalAlpha = alpha; - ctx.imageSmoothingEnabled = !(!this.antialias || frame.source.scaleMode); + ctx.imageSmoothingEnabled = !frame.source.scaleMode; if (sprite.mask) { sprite.mask.preRenderCanvas(this, sprite, camera); } - ctx.drawImage(frame.source.image, frameX, frameY, frameWidth, frameHeight, x, y, frameWidth / res, frameHeight / res); + if (frameWidth > 0 && frameHeight > 0) + { + ctx.drawImage(frame.source.image, frameX, frameY, frameWidth, frameHeight, x, y, frameWidth / res, frameHeight / res); + } if (sprite.mask) { @@ -161156,7 +162388,7 @@ module.exports = CanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -161180,7 +162412,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -161245,7 +162477,7 @@ module.exports = GetBlendModes; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -161261,7 +162493,8 @@ var GetCalcMatrix = __webpack_require__(73329); * 4. Sets the alpha value of the context to be that used by the Game Object combined with the Camera. * 5. Saves the context state. * 6. Sets the final matrix values into the context via setTransform. - * 7. If Renderer.antialias, or the frame.source.scaleMode is set, then imageSmoothingEnabled is set. + * 7. If the Game Object has a texture frame, imageSmoothingEnabled is set based on frame.source.scaleMode. + * 8. If the Game Object does not have a texture frame, imageSmoothingEnabled is set based on Renderer.antialias. * * This function is only meant to be used internally. Most of the Canvas Renderer classes use it. * @@ -161298,7 +162531,7 @@ var SetTransform = function (renderer, ctx, src, camera, parentMatrix) calcMatrix.setToContext(ctx); - ctx.imageSmoothingEnabled = !(!renderer.antialias || (src.frame && src.frame.source.scaleMode)); + ctx.imageSmoothingEnabled = src.frame ? !src.frame.source.scaleMode : renderer.antialias; return true; }; @@ -161313,7 +162546,7 @@ module.exports = SetTransform; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -161336,7 +162569,7 @@ module.exports = 'postrender'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -161360,7 +162593,7 @@ module.exports = 'prerender'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -161387,7 +162620,7 @@ module.exports = 'render'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -161413,7 +162646,7 @@ module.exports = 'resize'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -161438,7 +162671,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -161467,7 +162700,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -161477,7 +162710,7 @@ var GetFastValue = __webpack_require__(72632); /** * Takes a snapshot of an area from the current frame displayed by a canvas. - * + * * This is then copied to an Image object. When this loads, the results are sent * to the callback provided in the Snapshot Configuration object. * @@ -161494,8 +162727,8 @@ var CanvasSnapshot = function (canvas, config) var encoderOptions = GetFastValue(config, 'encoder', 0.92); var x = Math.abs(Math.round(GetFastValue(config, 'x', 0))); var y = Math.abs(Math.round(GetFastValue(config, 'y', 0))); - var width = GetFastValue(config, 'width', canvas.width); - var height = GetFastValue(config, 'height', canvas.height); + var width = Math.floor(GetFastValue(config, 'width', canvas.width)); + var height = Math.floor(GetFastValue(config, 'height', canvas.height)); var getPixel = GetFastValue(config, 'getPixel', false); if (getPixel) @@ -161504,7 +162737,7 @@ var CanvasSnapshot = function (canvas, config) var imageData = context.getImageData(x, y, 1, 1); var data = imageData.data; - callback.call(null, new Color(data[0], data[1], data[2], data[3] / 255)); + callback.call(null, new Color(data[0], data[1], data[2], data[3])); } else if (x !== 0 || y !== 0 || width !== canvas.width || height !== canvas.height) { @@ -161512,10 +162745,13 @@ var CanvasSnapshot = function (canvas, config) var copyCanvas = CanvasPool.createWebGL(this, width, height); var ctx = copyCanvas.getContext('2d'); - ctx.drawImage(canvas, x, y, width, height, 0, 0, width, height); + if (width > 0 && height > 0) + { + ctx.drawImage(canvas, x, y, width, height, 0, 0, width, height); + } var image1 = new Image(); - + image1.onerror = function () { callback.call(null); @@ -161536,7 +162772,7 @@ var CanvasSnapshot = function (canvas, config) { // Full Grab var image2 = new Image(); - + image2.onerror = function () { callback.call(null); @@ -161561,7 +162797,7 @@ module.exports = CanvasSnapshot; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -161578,18 +162814,18 @@ var GetFastValue = __webpack_require__(72632); * @function Phaser.Renderer.Snapshot.WebGL * @since 3.0.0 * - * @param {HTMLCanvasElement} sourceCanvas - The canvas to take a snapshot of. + * @param {WebGLRenderingContext} sourceContext - The WebGL context to take a snapshot of. * @param {Phaser.Types.Renderer.Snapshot.SnapshotState} config - The snapshot configuration object. */ -var WebGLSnapshot = function (sourceCanvas, config) +var WebGLSnapshot = function (sourceContext, config) { - var gl = sourceCanvas.getContext('experimental-webgl'); + var gl = sourceContext; var callback = GetFastValue(config, 'callback'); var type = GetFastValue(config, 'type', 'image/png'); var encoderOptions = GetFastValue(config, 'encoder', 0.92); - var x = GetFastValue(config, 'x', 0); - var y = GetFastValue(config, 'y', 0); + var x = Math.abs(Math.round(GetFastValue(config, 'x', 0))); + var y = Math.abs(Math.round(GetFastValue(config, 'y', 0))); var getPixel = GetFastValue(config, 'getPixel', false); @@ -161606,12 +162842,12 @@ var WebGLSnapshot = function (sourceCanvas, config) gl.readPixels(x, destY, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixel); - callback.call(null, new Color(pixel[0], pixel[1], pixel[2], pixel[3] / 255)); + callback.call(null, new Color(pixel[0], pixel[1], pixel[2], pixel[3])); } else { - var width = GetFastValue(config, 'width', bufferWidth); - var height = GetFastValue(config, 'height', bufferHeight); + var width = Math.floor(GetFastValue(config, 'width', bufferWidth)); + var height = Math.floor(GetFastValue(config, 'height', bufferHeight)); var total = width * height * 4; @@ -161674,7 +162910,7 @@ module.exports = WebGLSnapshot; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -161697,7 +162933,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -161710,7 +162946,6 @@ var SnapCeil = __webpack_require__(82127); // Default Phaser 3 Pipelines var BitmapMaskPipeline = __webpack_require__(5583); -var GraphicsPipeline = __webpack_require__(67589); var LightPipeline = __webpack_require__(66901); var MultiPipeline = __webpack_require__(77310); var PointLightPipeline = __webpack_require__(10919); @@ -161726,16 +162961,15 @@ var UtilityPipeline = __webpack_require__(60848); * The `WebGLRenderer` owns a single instance of the Pipeline Manager, which you can access * via the `WebGLRenderer.pipelines` property. * - * By default, there are 8 pipelines installed into the Pipeline Manager when Phaser boots: + * By default, there are 7 pipelines installed into the Pipeline Manager when Phaser boots: * * 1. The Multi Pipeline. Responsible for all multi-texture rendering, i.e. Sprites and Tilemaps. - * 2. The Graphics Pipeline. Responsible for rendering Graphics and Shape objects. - * 3. The Rope Pipeline. Responsible for rendering the Rope Game Object. - * 4. The Light Pipeline. Responsible for rendering the Light Game Object. - * 5. The Point Light Pipeline. Responsible for rendering the Point Light Game Object. - * 6. The Single Pipeline. Responsible for rendering Game Objects that explicitly require one bound texture. - * 7. The Bitmap Mask Pipeline. Responsible for Bitmap Mask rendering. - * 8. The Utility Pipeline. Responsible for providing lots of handy texture manipulation functions. + * 2. The Rope Pipeline. Responsible for rendering the Rope Game Object. + * 3. The Light Pipeline. Responsible for rendering the Light Game Object. + * 4. The Point Light Pipeline. Responsible for rendering the Point Light Game Object. + * 5. The Single Pipeline. Responsible for rendering Game Objects that explicitly require one bound texture. + * 6. The Bitmap Mask Pipeline. Responsible for Bitmap Mask rendering. + * 7. The Utility Pipeline. Responsible for providing lots of handy texture manipulation functions. * * You can add your own custom pipeline via the `PipelineManager.add` method. Pipelines are * identified by unique string-based keys. @@ -161787,8 +163021,7 @@ var PipelineManager = new Class({ [ CONST.SINGLE_PIPELINE, SinglePipeline ], [ CONST.ROPE_PIPELINE, RopePipeline ], [ CONST.LIGHT_PIPELINE, LightPipeline ], - [ CONST.POINTLIGHT_PIPELINE, PointLightPipeline ], - [ CONST.GRAPHICS_PIPELINE, GraphicsPipeline ] + [ CONST.POINTLIGHT_PIPELINE, PointLightPipeline ] ]); /** @@ -162966,7 +164199,7 @@ module.exports = PipelineManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -163339,7 +164572,7 @@ module.exports = RenderTarget; * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> * @author Matthew Groves <@doormat> - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -163463,8 +164696,9 @@ module.exports = { }, /** - * Checks the given Fragment Shader Source for `%count%` declarations and - * replaces those with GLSL code for setting `texture = texture2D(uMainSampler[i], outTexCoord)`. + * Checks the given Fragment Shader Source for `%count%` and `%getSampler%` declarations and + * replaces those with GLSL code for setting `texture = texture2D(uMainSampler[i], outTexCoord)` + * and injecting the `getSampler` glsl function. * * @function Phaser.Renderer.WebGL.Utils.parseFragmentShaderMaxTextures * @since 3.50.0 @@ -163481,6 +164715,22 @@ module.exports = { return ''; } + var src = 'vec4 getSampler (int index, vec2 uv) {'; + + for (var i = 0; i < maxTextures; i++) + { + if (i > 0 && i < maxTextures) + { + src += '\nelse '; + } + + src += 'if (index == ' + i + ') { return texture2D(uMainSampler[' + i + '], uv); }'; + } + + src += '\nreturn vec4(0);\n}'; + + fragmentShaderSource = fragmentShaderSource.replace(/%getSampler%/gi, src); + return fragmentShaderSource.replace(/%count%/gi, maxTextures.toString()); } }; @@ -163493,7 +164743,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -165101,6 +166351,33 @@ var WebGLPipeline = new Class({ return this; }, + /** + * Sets a boolean uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setBoolean + * @since 3.60.0 + * + * @param {string} name - The name of the uniform to set. + * @param {boolean} value - The new value of the `boolean` uniform. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + setBoolean: function (name, value, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.setBoolean(name, value); + + return this; + }, + /** * Sets a 1f uniform value based on the given name on the currently set shader. * @@ -165700,7 +166977,7 @@ module.exports = WebGLPipeline; /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -165766,7 +167043,8 @@ var WebGLRenderer = new Class({ stencil: true, failIfMajorPerformanceCaveat: gameConfig.failIfMajorPerformanceCaveat, powerPreference: gameConfig.powerPreference, - preserveDrawingBuffer: gameConfig.preserveDrawingBuffer + preserveDrawingBuffer: gameConfig.preserveDrawingBuffer, + willReadFrequently: false }; /** @@ -166249,7 +167527,7 @@ var WebGLRenderer = new Class({ * * You can specify this as a string in the game config, i.e.: * - * `renderer: { mipmapFilter: 'NEAREST_MIPMAP_LINEAR' }` + * `render: { mipmapFilter: 'NEAREST_MIPMAP_LINEAR' }` * * The 6 options for WebGL1 are, in order from least to most computationally expensive: * @@ -167278,6 +168556,7 @@ var WebGLRenderer = new Class({ gl.bindTexture(gl.TEXTURE_2D, texture); this.textureZero = texture; + this.isTextureClean = false; } }, @@ -167771,7 +169050,11 @@ var WebGLRenderer = new Class({ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, wrapT); gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, pma); - gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY); + + if (flipY) + { + gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true); + } var generateMipmap = false; @@ -167871,7 +169154,7 @@ var WebGLRenderer = new Class({ 36061: 'Framebuffer Unsupported' }; - throw new Error('Framebuffer status: ' + errors[complete]); + throw new Error('Framebuffer status: ' + (errors[complete] || complete)); } framebuffer.renderTexture = renderTexture; @@ -168349,7 +169632,7 @@ var WebGLRenderer = new Class({ if (state.callback) { - WebGLSnapshot(this.canvas, state); + WebGLSnapshot(this.gl, state); state.callback = null; } @@ -168509,7 +169792,7 @@ var WebGLRenderer = new Class({ this.setFramebuffer(framebuffer); - WebGLSnapshot(this.canvas, state); + WebGLSnapshot(this.gl, state); this.setFramebuffer(currentFramebuffer); @@ -168618,7 +169901,11 @@ var WebGLRenderer = new Class({ var currentTexture = gl.getParameter(gl.TEXTURE_BINDING_2D); gl.bindTexture(gl.TEXTURE_2D, dstTexture); - gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY); + if (flipY) + { + gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true); + } + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, srcCanvas); @@ -168817,7 +170104,7 @@ module.exports = WebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -168894,6 +170181,24 @@ var WebGLShader = new Class({ */ this.gl = this.renderer.gl; + /** + * The fragment shader source code. + * + * @name Phaser.Renderer.WebGL.WebGLShader#fragSrc + * @type {string} + * @since 3.60.0 + */ + this.fragSrc = fragmentShader; + + /** + * The vertex shader source code. + * + * @name Phaser.Renderer.WebGL.WebGLShader#vertSrc + * @type {string} + * @since 3.60.0 + */ + this.vertSrc = vertexShader; + /** * The WebGLProgram created from the vertex and fragment shaders. * @@ -169458,6 +170763,28 @@ var WebGLShader = new Class({ return this; }, + /** + * Sets a boolean uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#setBoolean + * @since 3.60.0 + * + * @param {string} name - The name of the uniform to set. + * @param {boolean} value - The new value of the `boolean` uniform. + * + * @return {this} This WebGLShader instance. + */ + setBoolean: function (name, value) + { + return this.setUniform1(this.gl.uniform1i, name, Number(value)); + }, + /** * Sets a 1f uniform value based on the given name on this shader. * @@ -169891,6 +171218,51 @@ var WebGLShader = new Class({ return this.setUniform2(this.gl.uniformMatrix4fv, name, transpose, matrix, true); }, + /** + * This method will create the Shader Program on the current GL context. + * + * If a program already exists, it will be destroyed and the new one will take its place. + * + * After the program is created the uniforms will be reset and + * this shader will be rebound. + * + * This is a very expensive process and if your shader is referenced elsewhere in + * your game those references may then be lost, so be sure to use this carefully. + * + * However, if you need to update say the fragment shader source, then you can pass + * the new source into this method and it'll rebuild the program using it. If you + * don't want to change the vertex shader src, pass `undefined` as the parameter. + * + * @method Phaser.Renderer.WebGL.WebGLShader#createProgram + * @since 3.60.0 + * + * @param {string} [vertSrc] - The source code of the vertex shader. If not given, uses the source already defined in this Shader. + * @param {string} [fragSrc] - The source code of the fragment shader. If not given, uses the source already defined in this Shader. + * + * @return {this} This WebGLShader instance. + */ + createProgram: function (vertSrc, fragSrc) + { + if (vertSrc === undefined) { vertSrc = this.vertSrc; } + if (fragSrc === undefined) { fragSrc = this.fragSrc; } + + var gl = this.gl; + + if (this.program) + { + gl.deleteProgram(this.program); + } + + this.vertSrc = vertSrc; + this.fragSrc = fragSrc; + + this.program = this.renderer.createProgram(vertSrc, fragSrc); + + this.createUniforms(); + + return this.rebind(); + }, + /** * Removes all external references from this class and deletes the WebGL program from the WebGL context. * @@ -169923,7 +171295,7 @@ module.exports = WebGLShader; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -170004,7 +171376,7 @@ module.exports = WEBGL_CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -170044,7 +171416,7 @@ module.exports = WebGL; /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -170235,690 +171607,6 @@ var BitmapMaskPipeline = new Class({ module.exports = BitmapMaskPipeline; -/***/ }), - -/***/ 67589: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(56694); -var Earcut = __webpack_require__(11117); -var GetFastValue = __webpack_require__(72632); -var ShaderSourceFS = __webpack_require__(37699); -var ShaderSourceVS = __webpack_require__(28739); -var TransformMatrix = __webpack_require__(69360); -var WEBGL_CONST = __webpack_require__(71402); -var WebGLPipeline = __webpack_require__(44775); - -/** - * @classdesc - * The Graphics Pipeline is the rendering pipeline used by Phaser in WebGL when drawing - * primitive geometry objects, such as the Graphics Game Object, or the Shape Game Objects - * such as Arc, Line, Rectangle and Star. It handles the preperation and batching of related vertices. - * - * Prior to Phaser v3.50 the functions of this pipeline were merged with the `TextureTintPipeline`. - * - * The fragment shader it uses can be found in `shaders/src/Graphics.frag`. - * The vertex shader it uses can be found in `shaders/src/Graphics.vert`. - * - * The default shader attributes for this pipeline are: - * - * `inPosition` (vec2) - * `inColor` (vec4, normalized) - * - * The default shader uniforms for this pipeline are: - * - * `uProjectionMatrix` (mat4) - * - * @class GraphicsPipeline - * @extends Phaser.Renderer.WebGL.WebGLPipeline - * @memberof Phaser.Renderer.WebGL.Pipelines - * @constructor - * @since 3.50.0 - * - * @param {Phaser.Types.Renderer.WebGL.WebGLPipelineConfig} config - The configuration options for this pipeline. - */ -var GraphicsPipeline = new Class({ - - Extends: WebGLPipeline, - - initialize: - - function GraphicsPipeline (config) - { - config.fragShader = GetFastValue(config, 'fragShader', ShaderSourceFS); - config.vertShader = GetFastValue(config, 'vertShader', ShaderSourceVS); - config.attributes = GetFastValue(config, 'attributes', [ - { - name: 'inPosition', - size: 2 - }, - { - name: 'inColor', - size: 4, - type: WEBGL_CONST.UNSIGNED_BYTE, - normalized: true - } - ]); - - WebGLPipeline.call(this, config); - - /** - * A temporary Transform Matrix, re-used internally during batching by the - * Shape Game Objects. - * - * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#calcMatrix - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.50.0 - */ - this.calcMatrix = new TransformMatrix(); - - /** - * Used internally to draw stroked triangles. - * - * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#tempTriangle - * @type {array} - * @private - * @since 3.50.0 - */ - this.tempTriangle = [ - { x: 0, y: 0, width: 0 }, - { x: 0, y: 0, width: 0 }, - { x: 0, y: 0, width: 0 }, - { x: 0, y: 0, width: 0 } - ]; - - /** - * Cached stroke tint. - * - * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#strokeTint - * @type {object} - * @private - * @since 3.50.0 - */ - this.strokeTint = { TL: 0, TR: 0, BL: 0, BR: 0 }; - - /** - * Cached fill tint. - * - * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#fillTint - * @type {object} - * @private - * @since 3.50.0 - */ - this.fillTint = { TL: 0, TR: 0, BL: 0, BR: 0 }; - - /** - * Internal texture frame reference. - * - * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#currentFrame - * @type {Phaser.Textures.Frame} - * @private - * @since 3.50.0 - */ - this.currentFrame = { u0: 0, v0: 0, u1: 1, v1: 1 }; - - /** - * Internal path quad cache. - * - * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#firstQuad - * @type {number[]} - * @private - * @since 3.50.0 - */ - this.firstQuad = [ 0, 0, 0, 0, 0 ]; - - /** - * Internal path quad cache. - * - * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#prevQuad - * @type {number[]} - * @private - * @since 3.50.0 - */ - this.prevQuad = [ 0, 0, 0, 0, 0 ]; - - /** - * Used internally for triangulating a polygon. - * - * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#polygonCache - * @type {array} - * @private - * @since 3.50.0 - */ - this.polygonCache = []; - }, - - /** - * Pushes a filled rectangle into the vertex batch. - * - * Rectangle factors in the given transform matrices before adding to the batch. - * - * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchFillRect - * @since 3.50.0 - * - * @param {number} x - Horizontal top left coordinate of the rectangle. - * @param {number} y - Vertical top left coordinate of the rectangle. - * @param {number} width - Width of the rectangle. - * @param {number} height - Height of the rectangle. - * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. - */ - batchFillRect: function (x, y, width, height, currentMatrix, parentMatrix) - { - this.renderer.pipelines.set(this); - - var calcMatrix = this.calcMatrix; - - // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix - if (parentMatrix) - { - parentMatrix.multiply(currentMatrix, calcMatrix); - } - - var xw = x + width; - var yh = y + height; - - var x0 = calcMatrix.getX(x, y); - var y0 = calcMatrix.getY(x, y); - - var x1 = calcMatrix.getX(x, yh); - var y1 = calcMatrix.getY(x, yh); - - var x2 = calcMatrix.getX(xw, yh); - var y2 = calcMatrix.getY(xw, yh); - - var x3 = calcMatrix.getX(xw, y); - var y3 = calcMatrix.getY(xw, y); - - var tint = this.fillTint; - - this.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, tint.TL, tint.TR, tint.BL, tint.BR); - }, - - /** - * Pushes a filled triangle into the vertex batch. - * - * Triangle factors in the given transform matrices before adding to the batch. - * - * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchFillTriangle - * @since 3.50.0 - * - * @param {number} x0 - Point 0 x coordinate. - * @param {number} y0 - Point 0 y coordinate. - * @param {number} x1 - Point 1 x coordinate. - * @param {number} y1 - Point 1 y coordinate. - * @param {number} x2 - Point 2 x coordinate. - * @param {number} y2 - Point 2 y coordinate. - * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. - */ - batchFillTriangle: function (x0, y0, x1, y1, x2, y2, currentMatrix, parentMatrix) - { - this.renderer.pipelines.set(this); - - var calcMatrix = this.calcMatrix; - - // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix - if (parentMatrix) - { - parentMatrix.multiply(currentMatrix, calcMatrix); - } - - var tx0 = calcMatrix.getX(x0, y0); - var ty0 = calcMatrix.getY(x0, y0); - - var tx1 = calcMatrix.getX(x1, y1); - var ty1 = calcMatrix.getY(x1, y1); - - var tx2 = calcMatrix.getX(x2, y2); - var ty2 = calcMatrix.getY(x2, y2); - - var tint = this.fillTint; - - this.batchTri(tx0, ty0, tx1, ty1, tx2, ty2, tint.TL, tint.TR, tint.BL); - }, - - /** - * Pushes a stroked triangle into the vertex batch. - * - * Triangle factors in the given transform matrices before adding to the batch. - * - * The triangle is created from 3 lines and drawn using the `batchStrokePath` method. - * - * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchStrokeTriangle - * @since 3.50.0 - * - * @param {number} x0 - Point 0 x coordinate. - * @param {number} y0 - Point 0 y coordinate. - * @param {number} x1 - Point 1 x coordinate. - * @param {number} y1 - Point 1 y coordinate. - * @param {number} x2 - Point 2 x coordinate. - * @param {number} y2 - Point 2 y coordinate. - * @param {number} lineWidth - The width of the line in pixels. - * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. - */ - batchStrokeTriangle: function (x0, y0, x1, y1, x2, y2, lineWidth, currentMatrix, parentMatrix) - { - var tempTriangle = this.tempTriangle; - - tempTriangle[0].x = x0; - tempTriangle[0].y = y0; - tempTriangle[0].width = lineWidth; - - tempTriangle[1].x = x1; - tempTriangle[1].y = y1; - tempTriangle[1].width = lineWidth; - - tempTriangle[2].x = x2; - tempTriangle[2].y = y2; - tempTriangle[2].width = lineWidth; - - tempTriangle[3].x = x0; - tempTriangle[3].y = y0; - tempTriangle[3].width = lineWidth; - - this.batchStrokePath(tempTriangle, lineWidth, false, currentMatrix, parentMatrix); - }, - - /** - * Adds the given path to the vertex batch for rendering. - * - * It works by taking the array of path data and then passing it through Earcut, which - * creates a list of polygons. Each polygon is then added to the batch. - * - * The path is always automatically closed because it's filled. - * - * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchFillPath - * @since 3.50.0 - * - * @param {Phaser.Types.Math.Vector2Like[]} path - Collection of points that represent the path. - * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. - */ - batchFillPath: function (path, currentMatrix, parentMatrix) - { - this.renderer.pipelines.set(this); - - var calcMatrix = this.calcMatrix; - - // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix - if (parentMatrix) - { - parentMatrix.multiply(currentMatrix, calcMatrix); - } - - var length = path.length; - var polygonCache = this.polygonCache; - var polygonIndexArray; - var point; - - var tintTL = this.fillTint.TL; - var tintTR = this.fillTint.TR; - var tintBL = this.fillTint.BL; - - for (var pathIndex = 0; pathIndex < length; ++pathIndex) - { - point = path[pathIndex]; - polygonCache.push(point.x, point.y); - } - - polygonIndexArray = Earcut(polygonCache); - length = polygonIndexArray.length; - - for (var index = 0; index < length; index += 3) - { - var p0 = polygonIndexArray[index + 0] * 2; - var p1 = polygonIndexArray[index + 1] * 2; - var p2 = polygonIndexArray[index + 2] * 2; - - var x0 = polygonCache[p0 + 0]; - var y0 = polygonCache[p0 + 1]; - var x1 = polygonCache[p1 + 0]; - var y1 = polygonCache[p1 + 1]; - var x2 = polygonCache[p2 + 0]; - var y2 = polygonCache[p2 + 1]; - - var tx0 = calcMatrix.getX(x0, y0); - var ty0 = calcMatrix.getY(x0, y0); - - var tx1 = calcMatrix.getX(x1, y1); - var ty1 = calcMatrix.getY(x1, y1); - - var tx2 = calcMatrix.getX(x2, y2); - var ty2 = calcMatrix.getY(x2, y2); - - this.batchTri(tx0, ty0, tx1, ty1, tx2, ty2, tintTL, tintTR, tintBL); - } - - polygonCache.length = 0; - }, - - /** - * Adds the given path to the vertex batch for rendering. - * - * It works by taking the array of path data and calling `batchLine` for each section - * of the path. - * - * The path is optionally closed at the end. - * - * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchStrokePath - * @since 3.50.0 - * - * @param {Phaser.Types.Math.Vector2Like[]} path - Collection of points that represent the path. - * @param {number} lineWidth - The width of the line segments in pixels. - * @param {boolean} pathOpen - Indicates if the path should be closed or left open. - * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. - */ - batchStrokePath: function (path, lineWidth, pathOpen, currentMatrix, parentMatrix) - { - this.renderer.pipelines.set(this); - - // Reset the closePath booleans - this.prevQuad[4] = 0; - this.firstQuad[4] = 0; - - var pathLength = path.length - 1; - - for (var pathIndex = 0; pathIndex < pathLength; pathIndex++) - { - var point0 = path[pathIndex]; - var point1 = path[pathIndex + 1]; - - this.batchLine( - point0.x, - point0.y, - point1.x, - point1.y, - point0.width / 2, - point1.width / 2, - lineWidth, - pathIndex, - !pathOpen && (pathIndex === pathLength - 1), - currentMatrix, - parentMatrix - ); - } - }, - - /** - * Creates a line out of 4 quads and adds it to the vertex batch based on the given line values. - * - * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchLine - * @since 3.50.0 - * - * @param {number} ax - x coordinate of the start of the line. - * @param {number} ay - y coordinate of the start of the line. - * @param {number} bx - x coordinate of the end of the line. - * @param {number} by - y coordinate of the end of the line. - * @param {number} aLineWidth - Width of the start of the line. - * @param {number} bLineWidth - Width of the end of the line. - * @param {number} index - If this line is part of a multi-line draw, the index of the line in the draw. - * @param {boolean} closePath - Does this line close a multi-line path? - * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. - */ - batchLine: function (ax, ay, bx, by, aLineWidth, bLineWidth, lineWidth, index, closePath, currentMatrix, parentMatrix) - { - this.renderer.pipelines.set(this); - - var calcMatrix = this.calcMatrix; - - // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix - if (parentMatrix) - { - parentMatrix.multiply(currentMatrix, calcMatrix); - } - - var dx = bx - ax; - var dy = by - ay; - - var len = Math.sqrt(dx * dx + dy * dy); - var al0 = aLineWidth * (by - ay) / len; - var al1 = aLineWidth * (ax - bx) / len; - var bl0 = bLineWidth * (by - ay) / len; - var bl1 = bLineWidth * (ax - bx) / len; - - var lx0 = bx - bl0; - var ly0 = by - bl1; - var lx1 = ax - al0; - var ly1 = ay - al1; - var lx2 = bx + bl0; - var ly2 = by + bl1; - var lx3 = ax + al0; - var ly3 = ay + al1; - - // tx0 = bottom right - var brX = calcMatrix.getX(lx0, ly0); - var brY = calcMatrix.getY(lx0, ly0); - - // tx1 = bottom left - var blX = calcMatrix.getX(lx1, ly1); - var blY = calcMatrix.getY(lx1, ly1); - - // tx2 = top right - var trX = calcMatrix.getX(lx2, ly2); - var trY = calcMatrix.getY(lx2, ly2); - - // tx3 = top left - var tlX = calcMatrix.getX(lx3, ly3); - var tlY = calcMatrix.getY(lx3, ly3); - - var tint = this.strokeTint; - - var tintTL = tint.TL; - var tintTR = tint.TR; - var tintBL = tint.BL; - var tintBR = tint.BR; - - // TL, BL, BR, TR - this.batchQuad(tlX, tlY, blX, blY, brX, brY, trX, trY, tintTL, tintTR, tintBL, tintBR); - - if (lineWidth <= 2) - { - // No point doing a linejoin if the line isn't thick enough - return; - } - - var prev = this.prevQuad; - var first = this.firstQuad; - - if (index > 0 && prev[4]) - { - this.batchQuad(tlX, tlY, blX, blY, prev[0], prev[1], prev[2], prev[3], tintTL, tintTR, tintBL, tintBR); - } - else - { - first[0] = tlX; - first[1] = tlY; - first[2] = blX; - first[3] = blY; - first[4] = 1; - } - - if (closePath && first[4]) - { - // Add a join for the final path segment - this.batchQuad(brX, brY, trX, trY, first[0], first[1], first[2], first[3], tintTL, tintTR, tintBL, tintBR); - } - else - { - // Store it - - prev[0] = brX; - prev[1] = brY; - prev[2] = trX; - prev[3] = trY; - prev[4] = 1; - } - }, - - /** - * Adds a single vertex to the current vertex buffer and increments the - * `vertexCount` property by 1. - * - * This method is called directly by `batchTri` and `batchQuad`. - * - * It does not perform any batch limit checking itself, so if you need to call - * this method directly, do so in the same way that `batchQuad` does, for example. - * - * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchVert - * @since 3.50.0 - * - * @param {number} x - The vertex x position. - * @param {number} y - The vertex y position. - * @param {number} tint - The tint color value. - */ - batchVert: function (x, y, tint) - { - var vertexViewF32 = this.vertexViewF32; - var vertexViewU32 = this.vertexViewU32; - - var vertexOffset = (this.vertexCount * this.currentShader.vertexComponentCount) - 1; - - vertexViewF32[++vertexOffset] = x; - vertexViewF32[++vertexOffset] = y; - vertexViewU32[++vertexOffset] = tint; - - this.vertexCount++; - }, - - /** - * Adds the vertices data into the batch and flushes if full. - * - * Assumes 6 vertices in the following arrangement: - * - * ``` - * 0----3 - * |\ B| - * | \ | - * | \ | - * | A \| - * | \ - * 1----2 - * ``` - * - * Where tx0/ty0 = 0, tx1/ty1 = 1, tx2/ty2 = 2 and tx3/ty3 = 3 - * - * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchQuad - * @override - * @since 3.50.0 - * - * @param {number} x0 - The top-left x position. - * @param {number} y0 - The top-left y position. - * @param {number} x1 - The bottom-left x position. - * @param {number} y1 - The bottom-left y position. - * @param {number} x2 - The bottom-right x position. - * @param {number} y2 - The bottom-right y position. - * @param {number} x3 - The top-right x position. - * @param {number} y3 - The top-right y position. - * @param {number} tintTL - The top-left tint color value. - * @param {number} tintTR - The top-right tint color value. - * @param {number} tintBL - The bottom-left tint color value. - * @param {number} tintBR - The bottom-right tint color value. - * - * @return {boolean} `true` if this method caused the batch to flush, otherwise `false`. - */ - batchQuad: function (x0, y0, x1, y1, x2, y2, x3, y3, tintTL, tintTR, tintBL, tintBR) - { - var hasFlushed = false; - - if (this.shouldFlush(6)) - { - this.flush(); - - hasFlushed = true; - } - - this.batchVert(x0, y0, tintTL); - this.batchVert(x1, y1, tintBL); - this.batchVert(x2, y2, tintBR); - this.batchVert(x0, y0, tintTL); - this.batchVert(x2, y2, tintBR); - this.batchVert(x3, y3, tintTR); - - return hasFlushed; - }, - - /** - * Adds the vertices data into the batch and flushes if full. - * - * Assumes 3 vertices in the following arrangement: - * - * ``` - * 0 - * |\ - * | \ - * | \ - * | \ - * | \ - * 1-----2 - * ``` - * - * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchTri - * @override - * @since 3.50.0 - * - * @param {number} x1 - The bottom-left x position. - * @param {number} y1 - The bottom-left y position. - * @param {number} x2 - The bottom-right x position. - * @param {number} y2 - The bottom-right y position. - * @param {number} x3 - The top-right x position. - * @param {number} y3 - The top-right y position. - * @param {number} tintTL - The top-left tint color value. - * @param {number} tintTR - The top-right tint color value. - * @param {number} tintBL - The bottom-left tint color value. - * - * @return {boolean} `true` if this method caused the batch to flush, otherwise `false`. - */ - batchTri: function (x0, y0, x1, y1, x2, y2, tintTL, tintTR, tintBL) - { - var hasFlushed = false; - - if (this.shouldFlush(3)) - { - this.flush(); - - hasFlushed = true; - } - - this.batchVert(x0, y0, tintTL); - this.batchVert(x1, y1, tintTR); - this.batchVert(x2, y2, tintBL); - - return hasFlushed; - }, - - /** - * Destroys all shader instances, removes all object references and nulls all external references. - * - * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#destroy - * @since 3.50.0 - * - * @return {this} This WebGLPipeline instance. - */ - destroy: function () - { - WebGLPipeline.prototype.destroy.call(this); - - this.polygonCache = null; - - return this; - } - -}); - -module.exports = GraphicsPipeline; - - /***/ }), /***/ 66901: @@ -170927,7 +171615,7 @@ module.exports = GraphicsPipeline; /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -171454,7 +172142,7 @@ module.exports = LightPipeline; /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -171499,9 +172187,12 @@ var WebGLPipeline = __webpack_require__(44775); * * If you wish to create a custom pipeline extending from this one, you should use the string * declaration `%count%` in your fragment shader source, which is used to set the number of - * `sampler2Ds` available to the `getSampler` function. + * `sampler2Ds` available. Also add `%getSampler%` so Phaser can inject the getSampler glsl function. + * This function can be used to get the pixel vec4 from the texture: * - * This pipeline will automatically inject that code for you, should those values exist + * `vec4 texture = getSampler(int(outTexId), outTexCoord);` + * + * This pipeline will automatically inject the getSampler function for you, should the value exist * in your shader source. If you wish to handle this yourself, you can also use the * function `Utils.parseFragmentShaderMaxTextures`. * @@ -172454,7 +173145,7 @@ module.exports = MultiPipeline; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -172629,7 +173320,7 @@ module.exports = PointLightPipeline; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -173124,7 +173815,7 @@ module.exports = PostFXPipeline; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -173192,7 +173883,7 @@ module.exports = RopePipeline; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -173270,7 +173961,7 @@ module.exports = SinglePipeline; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -173678,7 +174369,7 @@ var SpriteFXPipeline = new Class({ // batchQuad will intercept the rendering // Needed for Text & TileSprite - how about others? - flipY = true; + // flipY = true; MultiPipeline.prototype.batchTexture.call(this, gameObject, texture, textureWidth, textureHeight, srcX, srcY, srcWidth, srcHeight, scaleX, scaleY, rotation, flipX, flipY, scrollFactorX, scrollFactorY, displayOriginX, displayOriginY, frameX, frameY, frameWidth, frameHeight, tintTL, tintTR, tintBL, tintBR, tintEffect, uOffset, vOffset, camera, parentTransformMatrix, skipFlip, textureUnit); }, @@ -173809,7 +174500,7 @@ var SpriteFXPipeline = new Class({ // Set this here, so we can immediately call the set uniform functions and it'll work on the correct shader this.currentShader = this.copyShader; - this.onDraw(target, this.manager.getSwapRenderTarget()); + this.onDraw(target, this.manager.getSwapRenderTarget(), this.manager.getAltSwapRenderTarget()); return true; }, @@ -174109,6 +174800,7 @@ var SpriteFXPipeline = new Class({ * * @param {Phaser.Renderer.WebGL.RenderTarget} target - The Render Target to draw to the game. * @param {Phaser.Renderer.WebGL.RenderTarget} [swapTarget] - The Swap Render Target, useful for double-buffer effects. + * @param {Phaser.Renderer.WebGL.RenderTarget} [altSwapTarget] - The Swap Render Target, useful for double-buffer effects. */ onDraw: function (target) { @@ -174243,7 +174935,7 @@ module.exports = SpriteFXPipeline; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -174582,13 +175274,15 @@ var UtilityPipeline = new Class({ * @param {boolean} [clear=true] - Clear the target before copying? * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? * @param {boolean} [eraseMode=false] - Erase source from target using ERASE Blend Mode? + * @param {boolean} [flipY=false] - Flip the UV on the Y axis before drawing? */ - blitFrame: function (source, target, brightness, clear, clearAlpha, eraseMode) + blitFrame: function (source, target, brightness, clear, clearAlpha, eraseMode, flipY) { if (brightness === undefined) { brightness = 1; } if (clear === undefined) { clear = true; } if (clearAlpha === undefined) { clearAlpha = true; } if (eraseMode === undefined) { eraseMode = false; } + if (flipY === undefined) { flipY = false; } var gl = this.gl; @@ -174637,6 +175331,11 @@ var UtilityPipeline = new Class({ this.renderer.setBlendMode(BlendModes.ERASE); } + if (flipY) + { + this.flipY(); + } + gl.bufferData(gl.ARRAY_BUFFER, this.vertexData, gl.STATIC_DRAW); gl.drawArrays(gl.TRIANGLES, 0, 6); @@ -175035,7 +175734,7 @@ module.exports = UtilityPipeline; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -175143,7 +175842,7 @@ module.exports = PIPELINE_CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -175169,7 +175868,7 @@ module.exports = 'pipelineafterflush'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -175195,7 +175894,7 @@ module.exports = 'pipelinebeforeflush'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -175220,7 +175919,7 @@ module.exports = 'pipelinebind'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -175244,7 +175943,7 @@ module.exports = 'pipelineboot'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -175268,7 +175967,7 @@ module.exports = 'pipelinedestroy'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -175293,7 +175992,7 @@ module.exports = 'pipelinerebind'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -175320,7 +176019,7 @@ module.exports = 'pipelineresize'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -175348,7 +176047,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -175363,7 +176062,6 @@ var Pipelines = { BitmapMaskPipeline: __webpack_require__(5583), Events: __webpack_require__(18970), - GraphicsPipeline: __webpack_require__(67589), LightPipeline: __webpack_require__(66901), MultiPipeline: __webpack_require__(77310), PointLightPipeline: __webpack_require__(10919), @@ -175429,20 +176127,20 @@ module.exports = [ 'void main ()', '{', ' vec2 uv = gl_FragCoord.xy / uResolution;', + '', ' vec4 mainColor = texture2D(uMainSampler, uv);', ' vec4 maskColor = texture2D(uMaskSampler, uv);', - ' float alpha = mainColor.a;', '', ' if (!uInvertMaskAlpha)', ' {', - ' alpha *= (maskColor.a);', + ' mainColor *= maskColor.a;', ' }', ' else', ' {', - ' alpha *= (1.0 - maskColor.a);', + ' mainColor *= (1.0 - maskColor.a);', ' }', '', - ' gl_FragColor = vec4(mainColor.rgb * alpha, alpha);', + ' gl_FragColor = mainColor;', '}', '' ].join('\n'); @@ -175540,53 +176238,6 @@ module.exports = [ ].join('\n'); -/***/ }), - -/***/ 37699: -/***/ ((module) => { - -module.exports = [ - '#define SHADER_NAME PHASER_GRAPHICS_FS', - '', - 'precision mediump float;', - '', - 'varying vec4 outColor;', - '', - 'void main ()', - '{', - ' gl_FragColor = vec4(outColor.bgr * outColor.a, outColor.a);', - '}', - '' -].join('\n'); - - -/***/ }), - -/***/ 28739: -/***/ ((module) => { - -module.exports = [ - '#define SHADER_NAME PHASER_GRAPHICS_VS', - '', - 'precision mediump float;', - '', - 'uniform mat4 uProjectionMatrix;', - '', - 'attribute vec2 inPosition;', - 'attribute vec4 inColor;', - '', - 'varying vec4 outColor;', - '', - 'void main ()', - '{', - ' gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);', - '', - ' outColor = inColor;', - '}', - '' -].join('\n'); - - /***/ }), /***/ 65045: @@ -175680,7 +176331,7 @@ module.exports = [ /***/ ((module) => { module.exports = [ - '#define SHADER_NAME PHASER_MULTI_FS', + '#define SHADER_NAME PHASER_MULTI_V2_FS', '#define numTextures %count%', '', 'precision highp float;', @@ -175692,19 +176343,7 @@ module.exports = [ 'varying float outTintEffect;', 'varying vec4 outTint;', '', - 'vec4 getSampler (int index, vec2 uv)', - '{', - ' for (int i = 0; i < numTextures; ++i)', - ' {', - ' if (i == index)', - ' {', - ' return texture2D(uMainSampler[i], uv);', - ' }', - ' }', - '', - ' // Return black', - ' return vec4(0);', - '}', + '%getSampler%', '', 'void main ()', '{', @@ -175971,7 +176610,7 @@ module.exports = [ /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -177457,7 +178096,7 @@ var ScaleManager = new Class({ * Get Rectange of visible area, this Rectange does NOT factor in camera scroll. * * @method Phaser.Scale.ScaleManager#getViewPort - * @since 3.56.0 + * @since 3.60.0 * * @param {Phaser.Geom.Rectangle} [out] - The Rectangle of visible area. * @@ -177728,13 +178367,13 @@ module.exports = ScaleManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Phaser Scale Manager constants for centering the game canvas. - * + * * @namespace Phaser.Scale.Center * @memberof Phaser.Scale * @since 3.16.0 @@ -177742,9 +178381,9 @@ module.exports = ScaleManager; /** * Phaser Scale Manager constants for centering the game canvas. - * + * * To find out what each mode does please see [Phaser.Scale.Center]{@link Phaser.Scale.Center}. - * + * * @typedef {Phaser.Scale.Center} Phaser.Scale.CenterType * @memberof Phaser.Scale * @since 3.16.0 @@ -177755,7 +178394,7 @@ module.exports = { /** * The game canvas is not centered within the parent by Phaser. * You can still center it yourself via CSS. - * + * * @name Phaser.Scale.Center.NO_CENTER * @type {number} * @const @@ -177766,10 +178405,10 @@ module.exports = { /** * The game canvas is centered both horizontally and vertically within the parent. * To do this, the parent has to have a bounds that can be calculated and not be empty. - * + * * Centering is achieved by setting the margin left and top properties of the * game canvas, and does not factor in any other CSS styles you may have applied. - * + * * @name Phaser.Scale.Center.CENTER_BOTH * @type {number} * @const @@ -177780,10 +178419,10 @@ module.exports = { /** * The game canvas is centered horizontally within the parent. * To do this, the parent has to have a bounds that can be calculated and not be empty. - * + * * Centering is achieved by setting the margin left and top properties of the * game canvas, and does not factor in any other CSS styles you may have applied. - * + * * @name Phaser.Scale.Center.CENTER_HORIZONTALLY * @type {number} * @const @@ -177794,10 +178433,10 @@ module.exports = { /** * The game canvas is centered both vertically within the parent. * To do this, the parent has to have a bounds that can be calculated and not be empty. - * + * * Centering is achieved by setting the margin left and top properties of the * game canvas, and does not factor in any other CSS styles you may have applied. - * + * * @name Phaser.Scale.Center.CENTER_VERTICALLY * @type {number} * @const @@ -177815,13 +178454,13 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Phaser Scale Manager constants for orientation. - * + * * @namespace Phaser.Scale.Orientation * @memberof Phaser.Scale * @since 3.16.0 @@ -177829,9 +178468,9 @@ module.exports = { /** * Phaser Scale Manager constants for orientation. - * + * * To find out what each mode does please see [Phaser.Scale.Orientation]{@link Phaser.Scale.Orientation}. - * + * * @typedef {Phaser.Scale.Orientation} Phaser.Scale.OrientationType * @memberof Phaser.Scale * @since 3.16.0 @@ -177841,7 +178480,7 @@ module.exports = { /** * A landscape orientation. - * + * * @name Phaser.Scale.Orientation.LANDSCAPE * @type {string} * @const @@ -177851,7 +178490,7 @@ module.exports = { /** * A portrait orientation. - * + * * @name Phaser.Scale.Orientation.PORTRAIT * @type {string} * @const @@ -177869,13 +178508,13 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Phaser Scale Manager constants for the different scale modes available. - * + * * @namespace Phaser.Scale.ScaleModes * @memberof Phaser.Scale * @since 3.16.0 @@ -177883,9 +178522,9 @@ module.exports = { /** * Phaser Scale Manager constants for the different scale modes available. - * + * * To find out what each mode does please see [Phaser.Scale.ScaleModes]{@link Phaser.Scale.ScaleModes}. - * + * * @typedef {Phaser.Scale.ScaleModes} Phaser.Scale.ScaleModeType * @memberof Phaser.Scale * @since 3.16.0 @@ -177897,7 +178536,7 @@ module.exports = { * No scaling happens at all. The canvas is set to the size given in the game config and Phaser doesn't change it * again from that point on. If you change the canvas size, either via CSS, or directly via code, then you need * to call the Scale Managers `resize` method to give the new dimensions, or input events will stop working. - * + * * @name Phaser.Scale.ScaleModes.NONE * @type {number} * @const @@ -177907,7 +178546,7 @@ module.exports = { /** * The height is automatically adjusted based on the width. - * + * * @name Phaser.Scale.ScaleModes.WIDTH_CONTROLS_HEIGHT * @type {number} * @const @@ -177917,7 +178556,7 @@ module.exports = { /** * The width is automatically adjusted based on the height. - * + * * @name Phaser.Scale.ScaleModes.HEIGHT_CONTROLS_WIDTH * @type {number} * @const @@ -177929,7 +178568,7 @@ module.exports = { * The width and height are automatically adjusted to fit inside the given target area, * while keeping the aspect ratio. Depending on the aspect ratio there may be some space * inside the area which is not covered. - * + * * @name Phaser.Scale.ScaleModes.FIT * @type {number} * @const @@ -177940,7 +178579,7 @@ module.exports = { /** * The width and height are automatically adjusted to make the size cover the entire target * area while keeping the aspect ratio. This may extend further out than the target size. - * + * * @name Phaser.Scale.ScaleModes.ENVELOP * @type {number} * @const @@ -177950,7 +178589,7 @@ module.exports = { /** * The Canvas is resized to fit all available _parent_ space, regardless of aspect ratio. - * + * * @name Phaser.Scale.ScaleModes.RESIZE * @type {number} * @const @@ -177968,13 +178607,13 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Phaser Scale Manager constants for zoom modes. - * + * * @namespace Phaser.Scale.Zoom * @memberof Phaser.Scale * @since 3.16.0 @@ -177982,9 +178621,9 @@ module.exports = { /** * Phaser Scale Manager constants for zoom modes. - * + * * To find out what each mode does please see [Phaser.Scale.Zoom]{@link Phaser.Scale.Zoom}. - * + * * @typedef {Phaser.Scale.Zoom} Phaser.Scale.ZoomType * @memberof Phaser.Scale * @since 3.16.0 @@ -177994,7 +178633,7 @@ module.exports = { /** * The game canvas will not be zoomed by Phaser. - * + * * @name Phaser.Scale.Zoom.NO_ZOOM * @type {number} * @const @@ -178004,7 +178643,7 @@ module.exports = { /** * The game canvas will be 2x zoomed by Phaser. - * + * * @name Phaser.Scale.Zoom.ZOOM_2X * @type {number} * @const @@ -178014,7 +178653,7 @@ module.exports = { /** * The game canvas will be 4x zoomed by Phaser. - * + * * @name Phaser.Scale.Zoom.ZOOM_4X * @type {number} * @const @@ -178025,7 +178664,7 @@ module.exports = { /** * Calculate the zoom value based on the maximum multiplied game size that will * fit into the parent, or browser window if no parent is set. - * + * * @name Phaser.Scale.Zoom.MAX_ZOOM * @type {number} * @const @@ -178043,7 +178682,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -178066,7 +178705,7 @@ module.exports = CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -178086,7 +178725,7 @@ module.exports = 'enterfullscreen'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -178106,7 +178745,7 @@ module.exports = 'fullscreenfailed'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -178126,7 +178765,7 @@ module.exports = 'fullscreenunsupported'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -178147,7 +178786,7 @@ module.exports = 'leavefullscreen'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -178171,7 +178810,7 @@ module.exports = 'orientationchange'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -178202,7 +178841,7 @@ module.exports = 'resize'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -178229,7 +178868,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -178238,22 +178877,22 @@ var CONST = __webpack_require__(55301); /** * @namespace Phaser.Scale - * + * * @borrows Phaser.Scale.Center.NO_CENTER as NO_CENTER * @borrows Phaser.Scale.Center.CENTER_BOTH as CENTER_BOTH * @borrows Phaser.Scale.Center.CENTER_HORIZONTALLY as CENTER_HORIZONTALLY * @borrows Phaser.Scale.Center.CENTER_VERTICALLY as CENTER_VERTICALLY - * + * * @borrows Phaser.Scale.Orientation.LANDSCAPE as LANDSCAPE * @borrows Phaser.Scale.Orientation.PORTRAIT as PORTRAIT - * + * * @borrows Phaser.Scale.ScaleModes.NONE as NONE * @borrows Phaser.Scale.ScaleModes.WIDTH_CONTROLS_HEIGHT as WIDTH_CONTROLS_HEIGHT * @borrows Phaser.Scale.ScaleModes.HEIGHT_CONTROLS_WIDTH as HEIGHT_CONTROLS_WIDTH * @borrows Phaser.Scale.ScaleModes.FIT as FIT * @borrows Phaser.Scale.ScaleModes.ENVELOP as ENVELOP * @borrows Phaser.Scale.ScaleModes.RESIZE as RESIZE - * + * * @borrows Phaser.Scale.Zoom.NO_ZOOM as NO_ZOOM * @borrows Phaser.Scale.Zoom.ZOOM_2X as ZOOM_2X * @borrows Phaser.Scale.Zoom.ZOOM_4X as ZOOM_4X @@ -178286,7 +178925,7 @@ module.exports = Scale; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -178349,7 +178988,7 @@ module.exports = GetPhysicsPlugins; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -178397,7 +179036,7 @@ module.exports = GetScenePlugins; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -178460,7 +179099,7 @@ module.exports = InjectionMap; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -178780,7 +179419,7 @@ module.exports = Scene; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -179292,6 +179931,13 @@ var SceneManager = new Class({ */ loadComplete: function (loader) { + // TODO - Remove. This should *not* be handled here + // Try to unlock HTML5 sounds every time any loader completes + if (this.game.sound && this.game.sound.onBlurPausedSounds) + { + this.game.sound.unlock(); + } + this.create(loader.scene); }, @@ -179898,7 +180544,9 @@ var SceneManager = new Class({ }, /** - * Starts the given Scene. + * Starts the given Scene, if it is not starting, loading, or creating. + * + * If the Scene is running, paused, or sleeping, it will be shutdown and then started. * * @method Phaser.Scenes.SceneManager#start * @since 3.0.0 @@ -179930,10 +180578,18 @@ var SceneManager = new Class({ } var sys = scene.sys; + var status = sys.settings.status; - // If the Scene is already running (perhaps they called start from a launched sub-Scene?) - // then we close it down before starting it again. - if (sys.isActive() || sys.isPaused()) + // If the scene is already started but not yet running, + // let it continue. + if (status >= CONST.START && status <= CONST.CREATING) + { + return this; + } + + // If the Scene is already running, paused, or sleeping, + // close it down before starting it again. + else if (status >= CONST.RUNNING && status <= CONST.SLEEPING) { sys.shutdown(); @@ -179941,6 +180597,9 @@ var SceneManager = new Class({ sys.start(data); } + + // If the Scene is INIT or SHUTDOWN, + // start it directly. else { sys.sceneUpdate = NOOP; @@ -179994,6 +180653,11 @@ var SceneManager = new Class({ if (scene && !scene.sys.isTransitioning() && scene.sys.settings.status !== CONST.SHUTDOWN) { + var loader = scene.sys.load; + + loader.off(LoaderEvents.COMPLETE, this.loadComplete, this); + loader.off(LoaderEvents.COMPLETE, this.payloadComplete, this); + scene.sys.shutdown(data); } @@ -180230,7 +180894,7 @@ var SceneManager = new Class({ var indexA = this.getIndex(keyA); var indexB = this.getIndex(keyB); - if (indexA !== -1 && indexB !== -1) + if (indexA !== -1 && indexB !== -1 && indexB < indexA) { var tempScene = this.getAt(indexB); @@ -180238,7 +180902,7 @@ var SceneManager = new Class({ this.scenes.splice(indexB, 1); // Add in new location - this.scenes.splice(indexA + 1, 0, tempScene); + this.scenes.splice(indexA + (indexB > indexA), 0, tempScene); } } @@ -180253,7 +180917,7 @@ var SceneManager = new Class({ * @method Phaser.Scenes.SceneManager#moveBelow * @since 3.2.0 * - * @param {(string|Phaser.Scene)} keyA - The Scene that Scene B will be moved above. + * @param {(string|Phaser.Scene)} keyA - The Scene that Scene B will be moved below. * @param {(string|Phaser.Scene)} keyB - The Scene to be moved. * * @return {this} This Scene Manager instance. @@ -180274,7 +180938,7 @@ var SceneManager = new Class({ var indexA = this.getIndex(keyA); var indexB = this.getIndex(keyB); - if (indexA !== -1 && indexB !== -1) + if (indexA !== -1 && indexB !== -1 && indexB > indexA) { var tempScene = this.getAt(indexB); @@ -180288,7 +180952,7 @@ var SceneManager = new Class({ else { // Add in new location - this.scenes.splice(indexA, 0, tempScene); + this.scenes.splice(indexA - (indexB < indexA), 0, tempScene); } } } @@ -180421,7 +181085,7 @@ module.exports = SceneManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -180623,7 +181287,7 @@ var ScenePlugin = new Class({ * @since 3.0.0 * * @param {(string|Phaser.Scene)} [key] - The Scene to start. - * @param {object} [data] - The Scene data. + * @param {object} [data] - The Scene data. If no value is given it will not overwrite any previous data that may exist. * * @return {this} This Scene Plugin instance. */ @@ -180645,7 +181309,7 @@ var ScenePlugin = new Class({ * @method Phaser.Scenes.ScenePlugin#restart * @since 3.4.0 * - * @param {object} [data] - The Scene data. + * @param {object} [data] - The Scene data. If no value is given it will not overwrite any previous data that may exist. * * @return {this} This Scene Plugin instance. */ @@ -180662,6 +181326,8 @@ var ScenePlugin = new Class({ /** * This will start a transition from the current Scene to the target Scene given. * + * The target Scene cannot be the same as the current Scene. + * * The transition will last for the duration specified in milliseconds. * * You can have the target Scene moved above or below this one in the display list. @@ -181372,6 +182038,26 @@ var ScenePlugin = new Class({ return this.manager.getScene(key); }, + /** + * Return the status of the Scene. + * + * @method Phaser.Scenes.ScenePlugin#getStatus + * @since 3.60.0 + * + * @param {(string|Phaser.Scene)} key - The Scene to get the status from. + * + * @return {number} The Scene status. This maps to the `Phaser.Scene` constants, such as `Phaser.Scene.LOADING`. + */ + getStatus: function (key) + { + var scene = this.manager.getScene(key); + + if (scene) + { + return scene.sys.getStatus(); + } + }, + /** * Retrieves the numeric index of a Scene in the Scenes list. * @@ -181442,7 +182128,7 @@ module.exports = ScenePlugin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -181539,7 +182225,7 @@ module.exports = Settings; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -181945,7 +182631,8 @@ var Systems = new Class({ /** * Pause this Scene. - * A paused Scene still renders, it just doesn't run ANY of its update handlers or systems. + * + * A paused Scene still renders, it just doesn't run any of its update handlers or systems. * * @method Phaser.Scenes.Systems#pause * @fires Phaser.Scenes.Events#PAUSE @@ -181957,16 +182644,20 @@ var Systems = new Class({ */ pause: function (data) { - var events = this.events; var settings = this.settings; + var status = this.getStatus(); - if (this.settings.active) + if (status !== CONST.CREATING && status !== CONST.RUNNING) + { + console.warn('Cannot pause non-running Scene', settings.key); + } + else if (this.settings.active) { settings.status = CONST.PAUSED; settings.active = false; - events.emit(Events.PAUSE, this, data); + this.events.emit(Events.PAUSE, this, data); } return this; @@ -182018,15 +182709,22 @@ var Systems = new Class({ */ sleep: function (data) { - var events = this.events; var settings = this.settings; + var status = this.getStatus(); - settings.status = CONST.SLEEPING; + if (status !== CONST.CREATING && status !== CONST.RUNNING) + { + console.warn('Cannot sleep non-running Scene', settings.key); + } + else + { + settings.status = CONST.SLEEPING; - settings.active = false; - settings.visible = false; + settings.active = false; + settings.visible = false; - events.emit(Events.SLEEP, this, data); + this.events.emit(Events.SLEEP, this, data); + } return this; }, @@ -182071,13 +182769,26 @@ var Systems = new Class({ * @method Phaser.Scenes.Systems#getData * @since 3.22.0 * - * @return {any} + * @return {any} The Scene Data. */ getData: function () { return this.settings.data; }, + /** + * Returns the current status of this Scene. + * + * @method Phaser.Scenes.Systems#getStatus + * @since 3.60.0 + * + * @return {number} The status of this Scene. One of the `Phaser.Scene` constants. + */ + getStatus: function () + { + return this.settings.status; + }, + /** * Is this Scene sleeping? * @@ -182325,13 +183036,13 @@ module.exports = Systems; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Scene consts. - * + * * @ignore */ @@ -182339,7 +183050,7 @@ var CONST = { /** * Scene state. - * + * * @name Phaser.Scenes.PENDING * @readonly * @type {number} @@ -182349,7 +183060,7 @@ var CONST = { /** * Scene state. - * + * * @name Phaser.Scenes.INIT * @readonly * @type {number} @@ -182359,7 +183070,7 @@ var CONST = { /** * Scene state. - * + * * @name Phaser.Scenes.START * @readonly * @type {number} @@ -182369,7 +183080,7 @@ var CONST = { /** * Scene state. - * + * * @name Phaser.Scenes.LOADING * @readonly * @type {number} @@ -182379,7 +183090,7 @@ var CONST = { /** * Scene state. - * + * * @name Phaser.Scenes.CREATING * @readonly * @type {number} @@ -182389,7 +183100,7 @@ var CONST = { /** * Scene state. - * + * * @name Phaser.Scenes.RUNNING * @readonly * @type {number} @@ -182399,7 +183110,7 @@ var CONST = { /** * Scene state. - * + * * @name Phaser.Scenes.PAUSED * @readonly * @type {number} @@ -182409,7 +183120,7 @@ var CONST = { /** * Scene state. - * + * * @name Phaser.Scenes.SLEEPING * @readonly * @type {number} @@ -182419,7 +183130,7 @@ var CONST = { /** * Scene state. - * + * * @name Phaser.Scenes.SHUTDOWN * @readonly * @type {number} @@ -182429,7 +183140,7 @@ var CONST = { /** * Scene state. - * + * * @name Phaser.Scenes.DESTROYED * @readonly * @type {number} @@ -182449,7 +183160,7 @@ module.exports = CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -182476,7 +183187,7 @@ module.exports = 'addedtoscene'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -182502,7 +183213,7 @@ module.exports = 'boot'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -182532,7 +183243,7 @@ module.exports = 'create'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -182560,7 +183271,7 @@ module.exports = 'destroy'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -182588,7 +183299,7 @@ module.exports = 'pause'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -182666,7 +183377,7 @@ module.exports = 'prerender'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -182705,7 +183416,7 @@ module.exports = 'preupdate'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -182734,7 +183445,7 @@ module.exports = 'ready'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -182761,7 +183472,7 @@ module.exports = 'removedfromscene'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -182800,7 +183511,7 @@ module.exports = 'render'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -182828,7 +183539,7 @@ module.exports = 'resume'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -182859,7 +183570,7 @@ module.exports = 'shutdown'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -182887,7 +183598,7 @@ module.exports = 'sleep'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -182913,7 +183624,7 @@ module.exports = 'start'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -182950,7 +183661,7 @@ module.exports = 'transitioncomplete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -182988,7 +183699,7 @@ module.exports = 'transitioninit'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -183023,7 +183734,7 @@ module.exports = 'transitionout'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -183064,7 +183775,7 @@ module.exports = 'transitionstart'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -183100,7 +183811,7 @@ module.exports = 'transitionwake'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -183113,7 +183824,7 @@ module.exports = 'transitionwake'; * * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} - * 3. The `Scene.update` method is called, if it exists + * 3. The `Scene.update` method is called, if it exists and the Scene is in a Running state, otherwise this is skipped. * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} @@ -183139,7 +183850,7 @@ module.exports = 'update'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -183167,7 +183878,7 @@ module.exports = 'wake'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -183210,7 +183921,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -183247,7 +183958,7 @@ module.exports = Scene; /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -183286,7 +183997,6 @@ var BaseSound = new Class({ * * @name Phaser.Sound.BaseSound#manager * @type {Phaser.Sound.BaseSoundManager} - * @private * @since 3.0.0 */ this.manager = manager; @@ -183420,7 +184130,6 @@ var BaseSound = new Class({ * * @name Phaser.Sound.BaseSound#pendingRemove * @type {boolean} - * @private * @default false * @since 3.0.0 */ @@ -183656,7 +184365,6 @@ var BaseSound = new Class({ * Method used internally for applying config values to some of the sound properties. * * @method Phaser.Sound.BaseSound#applyConfig - * @protected * @since 3.0.0 */ applyConfig: function () @@ -183673,7 +184381,6 @@ var BaseSound = new Class({ * Method used internally for resetting values of some of the config properties. * * @method Phaser.Sound.BaseSound#resetConfig - * @protected * @since 3.0.0 */ resetConfig: function () @@ -183686,8 +184393,6 @@ var BaseSound = new Class({ * Update method called automatically by sound manager on every game step. * * @method Phaser.Sound.BaseSound#update - * @override - * @protected * @since 3.0.0 * * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. @@ -183699,7 +184404,6 @@ var BaseSound = new Class({ * Method used internally to calculate total playback rate of the sound. * * @method Phaser.Sound.BaseSound#calculateRate - * @protected * @since 3.0.0 */ calculateRate: function () @@ -183726,12 +184430,12 @@ var BaseSound = new Class({ } this.emit(Events.DESTROY, this); - this.pendingRemove = true; - this.manager = null; - this.key = ''; + this.removeAllListeners(); - this.isPlaying = false; - this.isPaused = false; + + this.pendingRemove = true; + + this.manager = null; this.config = null; this.currentConfig = null; this.markers = null; @@ -183751,7 +184455,7 @@ module.exports = BaseSound; /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -183929,7 +184633,7 @@ var BaseSoundManager = new Class({ * @param {string} key - Asset key for the sound. * @param {Phaser.Types.Sound.SoundConfig} [config] - An optional config object containing default sound settings. * - * @return {(Phaser.Sound.HTML5AudioSound|Phaser.Sound.WebAudioSound)} The new audio sprite sound instance. + * @return {(Phaser.Sound.NoAudioSound|Phaser.Sound.HTML5AudioSound|Phaser.Sound.WebAudioSound)} The new audio sprite sound instance. */ addAudioSprite: function (key, config) { @@ -184083,7 +184787,6 @@ var BaseSoundManager = new Class({ return false; }, - /** * Removes all sounds from the manager, destroying the sounds. * @@ -184183,7 +184886,6 @@ var BaseSoundManager = new Class({ this.emit(Events.STOP_ALL, this); }, - /** * Stops any sounds matching the given key. * @@ -184364,7 +185066,7 @@ var BaseSoundManager = new Class({ * * @param {number} value - Global playback rate at which all the sounds will be played. * - * @return {Phaser.Sound.BaseSoundManager} This Sound Manager. + * @return {this} This Sound Manager. */ setRate: function (value) { @@ -184414,7 +185116,7 @@ var BaseSoundManager = new Class({ * * @param {number} value - The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). * - * @return {Phaser.Sound.BaseSoundManager} This Sound Manager. + * @return {this} This Sound Manager. */ setDetune: function (value) { @@ -184466,7 +185168,7 @@ module.exports = BaseSoundManager; /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -184518,17 +185220,17 @@ module.exports = SoundManagerCreator; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Complete Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they complete playback. - * + * * Listen to it from a Sound instance using `Sound.on('complete', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('complete', listener); @@ -184537,7 +185239,7 @@ module.exports = SoundManagerCreator; * * @event Phaser.Sound.Events#COMPLETE * @since 3.16.1 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. */ module.exports = 'complete'; @@ -184550,21 +185252,21 @@ module.exports = 'complete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Audio Data Decoded All Event. - * + * * This event is dispatched by the Web Audio Sound Manager as a result of calling the `decodeAudio` method, * once all files passed to the method have been decoded (or errored). - * + * * Use `Phaser.Sound.Events#DECODED` to listen for single sounds being decoded, and `DECODED_ALL` to * listen for them all completing. - * + * * Listen to it from the Sound Manager in a Scene using `this.sound.on('decodedall', listener)`, i.e.: - * + * * ```javascript * this.sound.once('decodedall', handler); * this.sound.decodeAudio([ audioFiles ]); @@ -184583,17 +185285,17 @@ module.exports = 'decodedall'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Audio Data Decoded Event. - * + * * This event is dispatched by the Web Audio Sound Manager as a result of calling the `decodeAudio` method. - * + * * Listen to it from the Sound Manager in a Scene using `this.sound.on('decoded', listener)`, i.e.: - * + * * ```javascript * this.sound.on('decoded', handler); * this.sound.decodeAudio(key, audioData); @@ -184601,7 +185303,7 @@ module.exports = 'decodedall'; * * @event Phaser.Sound.Events#DECODED * @since 3.18.0 - * + * * @param {string} key - The key of the audio file that was decoded and added to the audio cache. */ module.exports = 'decoded'; @@ -184614,18 +185316,18 @@ module.exports = 'decoded'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Destroy Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are destroyed, either * directly or via a Sound Manager. - * + * * Listen to it from a Sound instance using `Sound.on('destroy', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('destroy', listener); @@ -184634,7 +185336,7 @@ module.exports = 'decoded'; * * @event Phaser.Sound.Events#DESTROY * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. */ module.exports = 'destroy'; @@ -184647,17 +185349,17 @@ module.exports = 'destroy'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Detune Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their detune value changes. - * + * * Listen to it from a Sound instance using `Sound.on('detune', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('detune', listener); @@ -184667,7 +185369,7 @@ module.exports = 'destroy'; * * @event Phaser.Sound.Events#DETUNE * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. * @param {number} detune - The new detune value of the Sound. */ @@ -184681,22 +185383,22 @@ module.exports = 'detune'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Manager Global Detune Event. - * + * * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, * or the HTML5 Audio Manager. It is dispatched when the `detune` property of the Sound Manager is changed, which globally * adjusts the detuning of all active sounds. - * + * * Listen to it from a Scene using: `this.sound.on('rate', listener)`. * * @event Phaser.Sound.Events#GLOBAL_DETUNE * @since 3.0.0 - * + * * @param {Phaser.Sound.BaseSoundManager} soundManager - A reference to the sound manager that emitted the event. * @param {number} detune - The updated detune value. */ @@ -184710,21 +185412,21 @@ module.exports = 'detune'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Manager Global Mute Event. - * + * * This event is dispatched by the Sound Manager when its `mute` property is changed, either directly * or via the `setMute` method. This changes the mute state of all active sounds. - * + * * Listen to it from a Scene using: `this.sound.on('mute', listener)`. * * @event Phaser.Sound.Events#GLOBAL_MUTE * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSoundManager|Phaser.Sound.HTML5AudioSoundManager)} soundManager - A reference to the Sound Manager that emitted the event. * @param {boolean} mute - The mute value. `true` if the Sound Manager is now muted, otherwise `false`. */ @@ -184738,22 +185440,22 @@ module.exports = 'mute'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Manager Global Rate Event. - * + * * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, * or the HTML5 Audio Manager. It is dispatched when the `rate` property of the Sound Manager is changed, which globally * adjusts the playback rate of all active sounds. - * + * * Listen to it from a Scene using: `this.sound.on('rate', listener)`. * * @event Phaser.Sound.Events#GLOBAL_RATE * @since 3.0.0 - * + * * @param {Phaser.Sound.BaseSoundManager} soundManager - A reference to the sound manager that emitted the event. * @param {number} rate - The updated rate value. */ @@ -184767,21 +185469,21 @@ module.exports = 'rate'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Manager Global Volume Event. - * + * * This event is dispatched by the Sound Manager when its `volume` property is changed, either directly * or via the `setVolume` method. This changes the volume of all active sounds. - * + * * Listen to it from a Scene using: `this.sound.on('volume', listener)`. * * @event Phaser.Sound.Events#GLOBAL_VOLUME * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSoundManager|Phaser.Sound.HTML5AudioSoundManager)} soundManager - A reference to the sound manager that emitted the event. * @param {number} volume - The new global volume of the Sound Manager. */ @@ -184795,29 +185497,29 @@ module.exports = 'volume'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Looped Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they loop during playback. - * + * * Listen to it from a Sound instance using `Sound.on('looped', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('looped', listener); * music.setLoop(true); * music.play(); * ``` - * + * * This is not to be confused with the [LOOP]{@linkcode Phaser.Sound.Events#event:LOOP} event, which only emits when the loop state of a Sound is changed. * * @event Phaser.Sound.Events#LOOPED * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. */ module.exports = 'looped'; @@ -184830,28 +185532,28 @@ module.exports = 'looped'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Loop Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their loop state is changed. - * + * * Listen to it from a Sound instance using `Sound.on('loop', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('loop', listener); * music.setLoop(true); * ``` - * + * * This is not to be confused with the [LOOPED]{@linkcode Phaser.Sound.Events#event:LOOPED} event, which emits each time a Sound loops during playback. * * @event Phaser.Sound.Events#LOOP * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. * @param {boolean} loop - The new loop value. `true` if the Sound will loop, otherwise `false`. */ @@ -184865,17 +185567,17 @@ module.exports = 'loop'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Mute Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their mute state changes. - * + * * Listen to it from a Sound instance using `Sound.on('mute', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('mute', listener); @@ -184885,7 +185587,7 @@ module.exports = 'loop'; * * @event Phaser.Sound.Events#MUTE * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. * @param {boolean} mute - The mute value. `true` if the Sound is now muted, otherwise `false`. */ @@ -184899,7 +185601,7 @@ module.exports = 'mute'; /** * @author pi-kei - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -184933,22 +185635,22 @@ module.exports = 'pan'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Pause All Sounds Event. - * + * * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, * or the HTML5 Audio Manager. It is dispatched when the `pauseAll` method is invoked and after all current Sounds * have been paused. - * + * * Listen to it from a Scene using: `this.sound.on('pauseall', listener)`. * * @event Phaser.Sound.Events#PAUSE_ALL * @since 3.0.0 - * + * * @param {Phaser.Sound.BaseSoundManager} soundManager - A reference to the sound manager that emitted the event. */ module.exports = 'pauseall'; @@ -184961,17 +185663,17 @@ module.exports = 'pauseall'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Pause Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are paused. - * + * * Listen to it from a Sound instance using `Sound.on('pause', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('pause', listener); @@ -184981,7 +185683,7 @@ module.exports = 'pauseall'; * * @event Phaser.Sound.Events#PAUSE * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. */ module.exports = 'pause'; @@ -184994,17 +185696,17 @@ module.exports = 'pause'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Play Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are played. - * + * * Listen to it from a Sound instance using `Sound.on('play', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('play', listener); @@ -185013,7 +185715,7 @@ module.exports = 'pause'; * * @event Phaser.Sound.Events#PLAY * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. */ module.exports = 'play'; @@ -185026,17 +185728,17 @@ module.exports = 'play'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Rate Change Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their rate changes. - * + * * Listen to it from a Sound instance using `Sound.on('rate', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('rate', listener); @@ -185046,7 +185748,7 @@ module.exports = 'play'; * * @event Phaser.Sound.Events#RATE * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. * @param {number} rate - The new rate of the Sound. */ @@ -185060,22 +185762,22 @@ module.exports = 'rate'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Resume All Sounds Event. - * + * * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, * or the HTML5 Audio Manager. It is dispatched when the `resumeAll` method is invoked and after all current Sounds * have been resumed. - * + * * Listen to it from a Scene using: `this.sound.on('resumeall', listener)`. * * @event Phaser.Sound.Events#RESUME_ALL * @since 3.0.0 - * + * * @param {Phaser.Sound.BaseSoundManager} soundManager - A reference to the sound manager that emitted the event. */ module.exports = 'resumeall'; @@ -185088,17 +185790,17 @@ module.exports = 'resumeall'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Resume Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are resumed from a paused state. - * + * * Listen to it from a Sound instance using `Sound.on('resume', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('resume', listener); @@ -185109,7 +185811,7 @@ module.exports = 'resumeall'; * * @event Phaser.Sound.Events#RESUME * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. */ module.exports = 'resume'; @@ -185122,17 +185824,17 @@ module.exports = 'resume'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Seek Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are seeked to a new position. - * + * * Listen to it from a Sound instance using `Sound.on('seek', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('seek', listener); @@ -185142,7 +185844,7 @@ module.exports = 'resume'; * * @event Phaser.Sound.Events#SEEK * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. * @param {number} detune - The new detune value of the Sound. */ @@ -185156,22 +185858,22 @@ module.exports = 'seek'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Stop All Sounds Event. - * + * * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, * or the HTML5 Audio Manager. It is dispatched when the `stopAll` method is invoked and after all current Sounds * have been stopped. - * + * * Listen to it from a Scene using: `this.sound.on('stopall', listener)`. * * @event Phaser.Sound.Events#STOP_ALL * @since 3.0.0 - * + * * @param {Phaser.Sound.BaseSoundManager} soundManager - A reference to the sound manager that emitted the event. */ module.exports = 'stopall'; @@ -185184,17 +185886,17 @@ module.exports = 'stopall'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Stop Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are stopped. - * + * * Listen to it from a Sound instance using `Sound.on('stop', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('stop', listener); @@ -185204,7 +185906,7 @@ module.exports = 'stopall'; * * @event Phaser.Sound.Events#STOP * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. */ module.exports = 'stop'; @@ -185217,22 +185919,22 @@ module.exports = 'stop'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Manager Unlocked Event. - * + * * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, * or the HTML5 Audio Manager. It is dispatched during the update loop when the Sound Manager becomes unlocked. For * Web Audio this is on the first user gesture on the page. - * + * * Listen to it from a Scene using: `this.sound.on('unlocked', listener)`. * * @event Phaser.Sound.Events#UNLOCKED * @since 3.0.0 - * + * * @param {Phaser.Sound.BaseSoundManager} soundManager - A reference to the sound manager that emitted the event. */ module.exports = 'unlocked'; @@ -185245,17 +185947,17 @@ module.exports = 'unlocked'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Sound Volume Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their volume changes. - * + * * Listen to it from a Sound instance using `Sound.on('volume', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('volume', listener); @@ -185265,7 +185967,7 @@ module.exports = 'unlocked'; * * @event Phaser.Sound.Events#VOLUME * @since 3.0.0 - * + * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. * @param {number} volume - The new volume of the Sound. */ @@ -185279,7 +185981,7 @@ module.exports = 'volume'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -185325,7 +186027,7 @@ module.exports = { /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -185360,19 +186062,18 @@ var HTML5AudioSound = new Class({ /** * An array containing all HTML5 Audio tags that could be used for individual - * sound's playback. Number of instances depends on the config value passed - * to the Loader#audio method call, default is 1. + * sound playback. Number of instances depends on the config value passed + * to the `Loader#audio` method call, default is 1. * * @name Phaser.Sound.HTML5AudioSound#tags * @type {HTMLAudioElement[]} - * @private * @since 3.0.0 */ this.tags = manager.game.cache.audio.get(key); if (!this.tags) { - throw new Error('There is no audio asset with key "' + key + '" in the audio cache'); + throw new Error('No cached audio asset with key "' + key); } /** @@ -185380,7 +186081,6 @@ var HTML5AudioSound = new Class({ * * @name Phaser.Sound.HTML5AudioSound#audio * @type {HTMLAudioElement} - * @private * @default null * @since 3.0.0 */ @@ -185393,7 +186093,6 @@ var HTML5AudioSound = new Class({ * * @name Phaser.Sound.HTML5AudioSound#startTime * @type {number} - * @private * @default 0 * @since 3.0.0 */ @@ -185405,7 +186104,6 @@ var HTML5AudioSound = new Class({ * * @name Phaser.Sound.HTML5AudioSound#previousTime * @type {number} - * @private * @default 0 * @since 3.0.0 */ @@ -185558,10 +186256,9 @@ var HTML5AudioSound = new Class({ }, /** - * Used internally to do what the name says. + * This method is used internally to pick and play the next available audio tag. * * @method Phaser.Sound.HTML5AudioSound#pickAndPlayAudioTag - * @private * @since 3.0.0 * * @return {boolean} Whether the sound was assigned an audio tag successfully. @@ -185571,6 +186268,7 @@ var HTML5AudioSound = new Class({ if (!this.pickAudioTag()) { this.reset(); + return false; } @@ -185614,7 +186312,6 @@ var HTML5AudioSound = new Class({ * does nothing. * * @method Phaser.Sound.HTML5AudioSound#pickAudioTag - * @private * @since 3.0.0 * * @return {boolean} Whether the sound was assigned an audio tag successfully. @@ -185680,7 +186377,6 @@ var HTML5AudioSound = new Class({ * thrown from rejected Promise returned from play method call. * * @method Phaser.Sound.HTML5AudioSound#playCatchPromise - * @private * @since 3.0.0 */ playCatchPromise: function () @@ -185698,10 +186394,9 @@ var HTML5AudioSound = new Class({ }, /** - * Used internally to do what the name says. + * This method is used internally to stop and release the current audio tag. * * @method Phaser.Sound.HTML5AudioSound#stopAndReleaseAudioTag - * @private * @since 3.0.0 */ stopAndReleaseAudioTag: function () @@ -185722,7 +186417,6 @@ var HTML5AudioSound = new Class({ * or when hijacking audio tag from another sound. * * @method Phaser.Sound.HTML5AudioSound#reset - * @private * @since 3.0.0 */ reset: function () @@ -185735,7 +186429,6 @@ var HTML5AudioSound = new Class({ * Phaser.Sound.HTML5AudioSoundManager#pauseOnBlur is set to true. * * @method Phaser.Sound.HTML5AudioSoundManager#onBlur - * @private * @since 3.0.0 */ onBlur: function () @@ -185755,7 +186448,6 @@ var HTML5AudioSound = new Class({ * Phaser.Sound.HTML5AudioSoundManager#pauseOnBlur is set to true. * * @method Phaser.Sound.HTML5AudioSound#onFocus - * @private * @since 3.0.0 */ onFocus: function () @@ -185771,7 +186463,6 @@ var HTML5AudioSound = new Class({ * @method Phaser.Sound.HTML5AudioSound#update * @fires Phaser.Sound.Events#COMPLETE * @fires Phaser.Sound.Events#LOOPED - * @protected * @since 3.0.0 * * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. @@ -185854,10 +186545,9 @@ var HTML5AudioSound = new Class({ }, /** - * Method used internally to determine mute setting of the sound. + * This method is used internally to update the mute setting of this sound. * * @method Phaser.Sound.HTML5AudioSound#updateMute - * @private * @since 3.0.0 */ updateMute: function () @@ -185869,10 +186559,9 @@ var HTML5AudioSound = new Class({ }, /** - * Method used internally to calculate total volume of the sound. + * This method is used internally to update the volume of this sound. * * @method Phaser.Sound.HTML5AudioSound#updateVolume - * @private * @since 3.0.0 */ updateVolume: function () @@ -185884,10 +186573,9 @@ var HTML5AudioSound = new Class({ }, /** - * Method used internally to calculate total playback rate of the sound. + * This method is used internally to update the playback rate of this sound. * * @method Phaser.Sound.HTML5AudioSound#calculateRate - * @protected * @since 3.0.0 */ calculateRate: function () @@ -186300,7 +186988,7 @@ module.exports = HTML5AudioSound; /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -186770,7 +187458,7 @@ module.exports = HTML5AudioSoundManager; /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -186807,7 +187495,7 @@ module.exports = { /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -186815,6 +187503,7 @@ var BaseSound = __webpack_require__(25798); var Class = __webpack_require__(56694); var EventEmitter = __webpack_require__(6659); var Extend = __webpack_require__(98611); +var NOOP = __webpack_require__(72283); var returnFalse = function () { @@ -186841,6 +187530,7 @@ var returnThis = function () * breaking on devices that don't support any audio playback technologies. * * @class NoAudioSound + * @extends Phaser.Events.EventEmitter * @memberof Phaser.Sound * @constructor * @since 3.0.0 @@ -186861,14 +187551,89 @@ var NoAudioSound = new Class({ EventEmitter.call(this); + /** + * Local reference to the sound manager. + * + * @name Phaser.Sound.NoAudioSound#manager + * @type {Phaser.Sound.BaseSoundManager} + * @since 3.0.0 + */ this.manager = manager; + + /** + * Asset key for the sound. + * + * @name Phaser.Sound.NoAudioSound#key + * @type {string} + * @readonly + * @since 3.0.0 + */ this.key = key; + + /** + * Flag indicating if sound is currently playing. + * + * @name Phaser.Sound.NoAudioSound#isPlaying + * @type {boolean} + * @default false + * @readonly + * @since 3.0.0 + */ this.isPlaying = false; + + /** + * Flag indicating if sound is currently paused. + * + * @name Phaser.Sound.NoAudioSound#isPaused + * @type {boolean} + * @default false + * @readonly + * @since 3.0.0 + */ this.isPaused = false; + + /** + * A property that holds the value of sound's actual playback rate, + * after its rate and detune values has been combined with global + * rate and detune values. + * + * @name Phaser.Sound.NoAudioSound#totalRate + * @type {number} + * @default 1 + * @readonly + * @since 3.0.0 + */ this.totalRate = 1; + + /** + * A value representing the duration, in seconds. + * It could be total sound duration or a marker duration. + * + * @name Phaser.Sound.NoAudioSound#duration + * @type {number} + * @readonly + * @since 3.0.0 + */ this.duration = 0; + + /** + * The total duration of the sound in seconds. + * + * @name Phaser.Sound.NoAudioSound#totalDuration + * @type {number} + * @readonly + * @since 3.0.0 + */ this.totalDuration = 0; + /** + * A config object used to store default sound settings' values. + * Default values will be set by properties' setters. + * + * @name Phaser.Sound.NoAudioSound#config + * @type {Phaser.Types.Sound.SoundConfig} + * @since 3.0.0 + */ this.config = Extend({ mute: false, volume: 1, @@ -186880,16 +187645,132 @@ var NoAudioSound = new Class({ pan: 0 }, config); + /** + * Reference to the currently used config. + * It could be default config or marker config. + * + * @name Phaser.Sound.NoAudioSound#currentConfig + * @type {Phaser.Types.Sound.SoundConfig} + * @since 3.0.0 + */ this.currentConfig = this.config; + + /** + * Boolean indicating whether the sound is muted or not. + * Gets or sets the muted state of this sound. + * + * @name Phaser.Sound.NoAudioSound#mute + * @type {boolean} + * @default false + * @fires Phaser.Sound.Events#MUTE + * @since 3.0.0 + */ this.mute = false; + + /** + * Gets or sets the volume of this sound, a value between 0 (silence) and 1 (full volume). + * + * @name Phaser.Sound.NoAudioSound#volume + * @type {number} + * @default 1 + * @fires Phaser.Sound.Events#VOLUME + * @since 3.0.0 + */ this.volume = 1; + + /** + * Rate at which this Sound will be played. + * Value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed + * and 2.0 doubles the audios playback speed. + * + * @name Phaser.Sound.NoAudioSound#rate + * @type {number} + * @default 1 + * @fires Phaser.Sound.Events#RATE + * @since 3.0.0 + */ this.rate = 1; + + /** + * The detune value of this Sound, given in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29). + * The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + * + * @name Phaser.Sound.NoAudioSound#detune + * @type {number} + * @default 0 + * @fires Phaser.Sound.Events#DETUNE + * @since 3.0.0 + */ this.detune = 0; + + /** + * Property representing the position of playback for this sound, in seconds. + * Setting it to a specific value moves current playback to that position. + * The value given is clamped to the range 0 to current marker duration. + * Setting seek of a stopped sound has no effect. + * + * @name Phaser.Sound.NoAudioSound#seek + * @type {number} + * @fires Phaser.Sound.Events#SEEK + * @since 3.0.0 + */ this.seek = 0; + + /** + * Flag indicating whether or not the sound or current sound marker will loop. + * + * @name Phaser.Sound.NoAudioSound#loop + * @type {boolean} + * @default false + * @fires Phaser.Sound.Events#LOOP + * @since 3.0.0 + */ this.loop = false; + + /** + * Gets or sets the pan of this sound, a value between -1 (full left pan) and 1 (full right pan). + * + * Always returns zero on iOS / Safari as it doesn't support the stereo panner node. + * + * @name Phaser.Sound.NoAudioSound#pan + * @type {number} + * @default 0 + * @fires Phaser.Sound.Events#PAN + * @since 3.50.0 + */ this.pan = 0; + + /** + * Object containing markers definitions. + * + * @name Phaser.Sound.NoAudioSound#markers + * @type {Object.} + * @default {} + * @readonly + * @since 3.0.0 + */ this.markers = {}; + + /** + * Currently playing marker. + * 'null' if whole sound is playing. + * + * @name Phaser.Sound.NoAudioSound#currentMarker + * @type {Phaser.Types.Sound.SoundMarker} + * @default null + * @readonly + * @since 3.0.0 + */ this.currentMarker = null; + + /** + * Flag indicating if destroy method was called on this sound. + * + * @name Phaser.Sound.NoAudioSound#pendingRemove + * @type {boolean} + * @default false + * @since 3.0.0 + */ this.pendingRemove = false; }, @@ -186962,6 +187843,132 @@ var NoAudioSound = new Class({ */ stop: returnFalse, + /** + * Sets the muted state of this Sound. + * + * @method Phaser.Sound.NoAudioSound#setMute + * @since 3.4.0 + * + * @param {boolean} value - `true` to mute this sound, `false` to unmute it. + * + * @return {this} This Sound instance. + */ + setMute: returnThis, + + /** + * Sets the volume of this Sound. + * + * @method Phaser.Sound.NoAudioSound#setVolume + * @since 3.4.0 + * + * @param {number} value - The volume of the sound. + * + * @return {this} This Sound instance. + */ + setVolume: returnThis, + + /** + * Sets the playback rate of this Sound. + * + * For example, a value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed + * and 2.0 doubles the audios playback speed. + * + * @method Phaser.Sound.NoAudioSound#setRate + * @since 3.3.0 + * + * @param {number} value - The playback rate at of this Sound. + * + * @return {this} This Sound instance. + */ + setRate: returnThis, + + /** + * Sets the detune value of this Sound, given in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29). + * The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + * + * @method Phaser.Sound.NoAudioSound#setDetune + * @since 3.3.0 + * + * @param {number} value - The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + * + * @return {this} This Sound instance. + */ + setDetune: returnThis, + + /** + * Seeks to a specific point in this sound. + * + * @method Phaser.Sound.NoAudioSound#setSeek + * @since 3.4.0 + * + * @param {number} value - The point in the sound to seek to. + * + * @return {this} This Sound instance. + */ + setSeek: returnThis, + + /** + * Sets the loop state of this Sound. + * + * @method Phaser.Sound.NoAudioSound#setLoop + * @since 3.4.0 + * + * @param {boolean} value - `true` to loop this sound, `false` to not loop it. + * + * @return {this} This Sound instance. + */ + setLoop: returnThis, + + /** + * Sets the pan of this sound, a value between -1 (full left pan) and 1 (full right pan). + * + * Note: iOS / Safari doesn't support the stereo panner node. + * + * @method Phaser.Sound.NoAudioSound#setPan + * @since 3.50.0 + * + * @param {number} value - The pan of the sound. A value between -1 (full left pan) and 1 (full right pan). + * + * @return {this} This Sound instance. + */ + setPan: returnThis, + + /** + * Method used internally for applying config values to some of the sound properties. + * + * @method Phaser.Sound.NoAudioSound#applyConfig + * @since 3.0.0 + */ + applyConfig: returnNull, + + /** + * Method used internally for resetting values of some of the config properties. + * + * @method Phaser.Sound.NoAudioSound#resetConfig + * @since 3.0.0 + */ + resetConfig: returnNull, + + /** + * Update method called automatically by sound manager on every game step. + * + * @method Phaser.Sound.NoAudioSound#update + * @override + * @since 3.0.0 + * + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} delta - The delta time elapsed since the last frame. + */ + update: NOOP, + + /** + * Method used internally to calculate total playback rate of the sound. + * + * @method Phaser.Sound.NoAudioSound#calculateRate + * @since 3.0.0 + */ + calculateRate: returnNull, + /** * Destroys this sound and all associated events and marks it for removal from the sound manager. * @@ -186972,21 +187979,7 @@ var NoAudioSound = new Class({ destroy: function () { BaseSound.prototype.destroy.call(this); - }, - - setMute: returnThis, - - setVolume: returnThis, - - setRate: returnThis, - - setDetune: returnThis, - - setSeek: returnThis, - - setLoop: returnThis, - - setPan: returnThis + } }); @@ -187001,7 +187994,7 @@ module.exports = NoAudioSound; /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -187048,6 +188041,17 @@ var NoAudioSoundManager = new Class({ this.locked = false; }, + /** + * Adds a new sound into the sound manager. + * + * @method Phaser.Sound.NoAudioSoundManager#add + * @since 3.60.0 + * + * @param {string} key - Asset key for the sound. + * @param {Phaser.Types.Sound.SoundConfig} [config] - An optional config object containing default sound settings. + * + * @return {Phaser.Sound.NoAudioSound} The new sound instance. + */ add: function (key, config) { var sound = new NoAudioSound(this, key, config); @@ -187057,6 +188061,19 @@ var NoAudioSoundManager = new Class({ return sound; }, + /** + * Adds a new audio sprite sound into the sound manager. + * Audio Sprites are a combination of audio files and a JSON configuration. + * The JSON follows the format of that created by https://github.com/tonistiigi/audiosprite + * + * @method Phaser.Sound.NoAudioSoundManager#addAudioSprite + * @since 3.60.0 + * + * @param {string} key - Asset key for the sound. + * @param {Phaser.Types.Sound.SoundConfig} [config] - An optional config object containing default sound settings. + * + * @return {Phaser.Sound.NoAudioSound} The new audio sprite sound instance. + */ addAudioSprite: function (key, config) { var sound = this.add(key, config); @@ -187066,42 +188083,260 @@ var NoAudioSoundManager = new Class({ return sound; }, + /** + * Gets the first sound in the manager matching the given key, if any. + * + * @method Phaser.Sound.NoAudioSoundManager#get + * @since 3.23.0 + * + * @param {string} key - Sound asset key. + * + * @return {?Phaser.Sound.BaseSound} - The sound, or null. + */ + get: function (key) + { + return BaseSoundManager.prototype.get.call(this, key); + }, + + /** + * Gets any sounds in the manager matching the given key. + * + * @method Phaser.Sound.NoAudioSoundManager#getAll + * @since 3.23.0 + * + * @param {string} key - Sound asset key. + * + * @return {Phaser.Sound.BaseSound[]} - The sounds, or an empty array. + */ + getAll: function (key) + { + return BaseSoundManager.prototype.getAll.call(this, key); + }, + + /** + * This method does nothing but return 'false' for the No Audio Sound Manager, to maintain + * compatibility with the other Sound Managers. + * + * @method Phaser.Sound.NoAudioSoundManager#play + * @since 3.0.0 + * + * @param {string} key - Asset key for the sound. + * @param {(Phaser.Types.Sound.SoundConfig|Phaser.Types.Sound.SoundMarker)} [extra] - An optional additional object containing settings to be applied to the sound. It could be either config or marker object. + * + * @return {boolean} Always 'false' for the No Audio Sound Manager. + */ // eslint-disable-next-line no-unused-vars play: function (key, extra) { return false; }, + /** + * This method does nothing but return 'false' for the No Audio Sound Manager, to maintain + * compatibility with the other Sound Managers. + * + * @method Phaser.Sound.NoAudioSoundManager#playAudioSprite + * @since 3.0.0 + * + * @param {string} key - Asset key for the sound. + * @param {string} spriteName - The name of the sound sprite to play. + * @param {Phaser.Types.Sound.SoundConfig} [config] - An optional config object containing default sound settings. + * + * @return {boolean} Always 'false' for the No Audio Sound Manager. + */ // eslint-disable-next-line no-unused-vars playAudioSprite: function (key, spriteName, config) { return false; }, + /** + * Removes a sound from the sound manager. + * The removed sound is destroyed before removal. + * + * @method Phaser.Sound.NoAudioSoundManager#remove + * @since 3.0.0 + * + * @param {Phaser.Sound.BaseSound} sound - The sound object to remove. + * + * @return {boolean} True if the sound was removed successfully, otherwise false. + */ remove: function (sound) { return BaseSoundManager.prototype.remove.call(this, sound); }, + /** + * Removes all sounds from the manager, destroying the sounds. + * + * @method Phaser.Sound.NoAudioSoundManager#removeAll + * @since 3.23.0 + */ + removeAll: function () + { + return BaseSoundManager.prototype.removeAll.call(this); + }, + + /** + * Removes all sounds from the sound manager that have an asset key matching the given value. + * The removed sounds are destroyed before removal. + * + * @method Phaser.Sound.NoAudioSoundManager#removeByKey + * @since 3.0.0 + * + * @param {string} key - The key to match when removing sound objects. + * + * @return {number} The number of matching sound objects that were removed. + */ removeByKey: function (key) { return BaseSoundManager.prototype.removeByKey.call(this, key); }, + /** + * Stops any sounds matching the given key. + * + * @method Phaser.Sound.NoAudioSoundManager#stopByKey + * @since 3.23.0 + * + * @param {string} key - Sound asset key. + * + * @return {number} - How many sounds were stopped. + */ + stopByKey: function (key) + { + return BaseSoundManager.prototype.stopByKey.call(this, key); + }, + + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#onBlur + * @since 3.0.0 + */ + onBlur: NOOP, + + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#onFocus + * @since 3.0.0 + */ + onFocus: NOOP, + + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#onGameBlur + * @since 3.0.0 + */ + onGameBlur: NOOP, + + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#onGameFocus + * @since 3.0.0 + */ + onGameFocus: NOOP, + + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#pauseAll + * @since 3.0.0 + */ pauseAll: NOOP, + + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#resumeAll + * @since 3.0.0 + */ resumeAll: NOOP, + + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#stopAll + * @since 3.0.0 + */ stopAll: NOOP, + + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#update + * @since 3.0.0 + */ update: NOOP, + + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#setRate + * @since 3.0.0 + * + * @return {this} This Sound Manager. + */ setRate: NOOP, + + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#setDetune + * @since 3.0.0 + * + * @return {this} This Sound Manager. + */ setDetune: NOOP, + + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#setMute + * @since 3.0.0 + */ setMute: NOOP, + + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#setVolume + * @since 3.0.0 + */ setVolume: NOOP, + /** + * Empty function for the No Audio Sound Manager. + * + * @method Phaser.Sound.NoAudioSoundManager#unlock + * @since 3.0.0 + */ + unlock: NOOP, + + /** + * Method used internally for iterating only over active sounds and skipping sounds that are marked for removal. + * + * @method Phaser.Sound.NoAudioSoundManager#forEachActiveSound + * @private + * @since 3.0.0 + * + * @param {Phaser.Types.Sound.EachActiveSoundCallback} callback - Callback function. (manager: Phaser.Sound.BaseSoundManager, sound: Phaser.Sound.BaseSound, index: number, sounds: Phaser.Manager.BaseSound[]) => void + * @param {*} [scope] - Callback context. + */ forEachActiveSound: function (callbackfn, scope) { BaseSoundManager.prototype.forEachActiveSound.call(this, callbackfn, scope); }, + /** + * Destroys all the sounds in the game and all associated events. + * + * @method Phaser.Sound.NoAudioSoundManager#destroy + * @since 3.0.0 + */ destroy: function () { BaseSoundManager.prototype.destroy.call(this); @@ -187120,7 +188355,7 @@ module.exports = NoAudioSoundManager; /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -187218,11 +188453,13 @@ var WebAudioSound = new Class({ /** * The time at which the sound should have started playback from the beginning. - * Based on BaseAudioContext.currentTime value. + * + * Treat this property as read-only. + * + * Based on `BaseAudioContext.currentTime` value. * * @name Phaser.Sound.WebAudioSound#playTime * @type {number} - * @private * @default 0 * @since 3.0.0 */ @@ -187230,11 +188467,13 @@ var WebAudioSound = new Class({ /** * The time at which the sound source should have actually started playback. - * Based on BaseAudioContext.currentTime value. + * + * Treat this property as read-only. + * + * Based on `BaseAudioContext.currentTime` value. * * @name Phaser.Sound.WebAudioSound#startTime * @type {number} - * @private * @default 0 * @since 3.0.0 */ @@ -187242,11 +188481,11 @@ var WebAudioSound = new Class({ /** * The time at which the sound loop source should actually start playback. - * Based on BaseAudioContext.currentTime value. + * + * Based on `BaseAudioContext.currentTime` value. * * @name Phaser.Sound.WebAudioSound#loopTime * @type {number} - * @private * @default 0 * @since 3.0.0 */ @@ -187254,11 +188493,13 @@ var WebAudioSound = new Class({ /** * An array where we keep track of all rate updates during playback. - * Array of object types: { time: number, rate: number } + * + * Treat this property as read-only. + * + * Array of object types: `{ time: number, rate: number }` * * @name Phaser.Sound.WebAudioSound#rateUpdates * @type {array} - * @private * @default [] * @since 3.0.0 */ @@ -187451,10 +188692,9 @@ var WebAudioSound = new Class({ }, /** - * Used internally. + * This method is only used internally and it creates a looping buffer source. * * @method Phaser.Sound.WebAudioSound#createAndStartLoopBufferSource - * @private * @since 3.0.0 */ createAndStartLoopBufferSource: function () @@ -187470,10 +188710,9 @@ var WebAudioSound = new Class({ }, /** - * Used internally. + * This method is only used internally and it creates a buffer source. * * @method Phaser.Sound.WebAudioSound#createBufferSource - * @private * @since 3.0.0 * * @return {AudioBufferSourceNode} @@ -187509,10 +188748,9 @@ var WebAudioSound = new Class({ }, /** - * Used internally. + * This method is only used internally and it stops and removes a buffer source. * * @method Phaser.Sound.WebAudioSound#stopAndRemoveBufferSource - * @private * @since 3.0.0 */ stopAndRemoveBufferSource: function () @@ -187531,10 +188769,9 @@ var WebAudioSound = new Class({ }, /** - * Used internally. + * This method is only used internally and it stops and removes a looping buffer source. * * @method Phaser.Sound.WebAudioSound#stopAndRemoveLoopBufferSource - * @private * @since 3.0.0 */ stopAndRemoveLoopBufferSource: function () @@ -187553,7 +188790,6 @@ var WebAudioSound = new Class({ * Method used internally for applying config values to some of the sound properties. * * @method Phaser.Sound.WebAudioSound#applyConfig - * @protected * @since 3.0.0 */ applyConfig: function () @@ -187574,7 +188810,6 @@ var WebAudioSound = new Class({ * @method Phaser.Sound.WebAudioSound#update * @fires Phaser.Sound.Events#COMPLETE * @fires Phaser.Sound.Events#LOOPED - * @protected * @since 3.0.0 */ update: function () @@ -187617,6 +188852,11 @@ var WebAudioSound = new Class({ */ destroy: function () { + if (this.pendingRemove) + { + return; + } + BaseSound.prototype.destroy.call(this); this.audioBuffer = null; @@ -187640,7 +188880,6 @@ var WebAudioSound = new Class({ * Method used internally to calculate total playback rate of the sound. * * @method Phaser.Sound.WebAudioSound#calculateRate - * @protected * @since 3.0.0 */ calculateRate: function () @@ -187673,7 +188912,6 @@ var WebAudioSound = new Class({ * Method used internally for calculating current playback time of a playing sound. * * @method Phaser.Sound.WebAudioSound#getCurrentTime - * @private * @since 3.0.0 */ getCurrentTime: function () @@ -187704,7 +188942,6 @@ var WebAudioSound = new Class({ * at witch the loop source should start playing. * * @method Phaser.Sound.WebAudioSound#getLoopTime - * @private * @since 3.0.0 */ getLoopTime: function () @@ -188105,7 +189342,7 @@ module.exports = WebAudioSound; /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -188604,7 +189841,7 @@ module.exports = WebAudioSoundManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -189453,7 +190690,7 @@ module.exports = List; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -189829,7 +191066,7 @@ module.exports = Map; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -189928,6 +191165,60 @@ var ProcessQueue = new Class({ this.checkQueue = false; }, + /** + * Checks the given item to see if it is already active within this Process Queue. + * + * @method Phaser.Structs.ProcessQueue#isActive + * @since 3.60.0 + * + * @genericUse {T} - [item] + * @genericUse {Phaser.Structs.ProcessQueue.} - [$return] + * + * @param {*} item - The item to check. + * + * @return {boolean} `true` if the item is active, otherwise `false`. + */ + isActive: function (item) + { + return (this._active.indexOf(item) > -1); + }, + + /** + * Checks the given item to see if it is already pending addition to this Process Queue. + * + * @method Phaser.Structs.ProcessQueue#isPending + * @since 3.60.0 + * + * @genericUse {T} - [item] + * @genericUse {Phaser.Structs.ProcessQueue.} - [$return] + * + * @param {*} item - The item to check. + * + * @return {boolean} `true` if the item is pending insertion, otherwise `false`. + */ + isPending: function (item) + { + return (this._toProcess > 0 && this._pending.indexOf(item) > -1); + }, + + /** + * Checks the given item to see if it is already pending destruction from this Process Queue. + * + * @method Phaser.Structs.ProcessQueue#isDestroying + * @since 3.60.0 + * + * @genericUse {T} - [item] + * @genericUse {Phaser.Structs.ProcessQueue.} - [$return] + * + * @param {*} item - The item to check. + * + * @return {boolean} `true` if the item is pending destruction, otherwise `false`. + */ + isDestroying: function (item) + { + return (this._destroy.indexOf(item) > -1); + }, + /** * Adds a new item to the Process Queue. * @@ -189945,6 +191236,12 @@ var ProcessQueue = new Class({ */ add: function (item) { + // Don't add if already active or pending + if (this.checkQueue && (this.isActive(item) || this.isPending(item))) + { + return item; + } + this._pending.push(item); this._toProcess++; @@ -189955,7 +191252,7 @@ var ProcessQueue = new Class({ /** * Removes an item from the Process Queue. * - * The item is added to the pending destroy and fully removed in the next update. + * The item is added to the 'destroy' list and is fully removed in the next update. * * @method Phaser.Structs.ProcessQueue#remove * @since 3.0.0 @@ -189969,9 +191266,29 @@ var ProcessQueue = new Class({ */ remove: function (item) { - this._destroy.push(item); + // Check if it's in the _pending list + if (this.isPending(item)) + { + var pending = this._pending; - this._toProcess++; + var idx = pending.indexOf(item); + + if (idx !== -1) + { + // Remove directly, no need to wait for an update loop + pending.splice(idx, 1); + } + } + else if (this.isActive(item)) + { + // Item is actively running? Queue it for deletion + this._destroy.push(item); + + this._toProcess++; + } + + // If neither of the above conditions pass, then the item is either already in the destroy list, + // or isn't pending or active, so cannot be removed anyway return item; }, @@ -190134,7 +191451,7 @@ module.exports = ProcessQueue; /** * @author Vladimir Agafonkin * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -190150,7 +191467,7 @@ var quickselect = __webpack_require__(53466); * * This version of RBush uses a fixed min/max accessor structure of `[ '.left', '.top', '.right', '.bottom' ]`. * This is to avoid the eval like function creation that the original library used, which caused CSP policy violations. - * + * * rbush is forked from https://github.com/mourner/rbush by Vladimir Agafonkin * * @class RTree @@ -190738,6 +192055,7 @@ function multiSelect (arr, left, right, n, compare) module.exports = rbush; + /***/ }), /***/ 58403: @@ -190745,7 +192063,7 @@ module.exports = rbush; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -191195,7 +192513,7 @@ module.exports = Set; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -191207,7 +192525,7 @@ var Vector2 = __webpack_require__(93736); /** * @classdesc * The Size component allows you to set `width` and `height` properties and define the relationship between them. - * + * * The component can automatically maintain the aspect ratios between the two values, and clamp them * to a defined min-max range. You can also control the dominant axis. When dimensions are given to the Size component * that would cause it to exceed its min-max range, the dimensions are adjusted based on the dominant axis. @@ -191276,7 +192594,7 @@ var Size = new Class({ /** * The proportional relationship between the width and height. - * + * * This property is read-only and is updated automatically when either the `width` or `height` properties are changed, * depending on the aspect mode. * @@ -191335,9 +192653,9 @@ var Size = new Class({ /** * A Vector2 containing the horizontal and vertical snap values, which the width and height are snapped to during resizing. - * + * * By default this is disabled. - * + * * This property is read-only. To change it see the `setSnap` method. * * @name Phaser.Structs.Size#snapTo @@ -191350,19 +192668,19 @@ var Size = new Class({ /** * Sets the aspect mode of this Size component. - * + * * The aspect mode controls what happens when you modify the `width` or `height` properties, or call `setSize`. - * + * * It can be a number from 0 to 4, or a Size constant: - * + * * 0. NONE = Do not make the size fit the aspect ratio. Change the ratio when the size changes. * 1. WIDTH_CONTROLS_HEIGHT = The height is automatically adjusted based on the width. * 2. HEIGHT_CONTROLS_WIDTH = The width is automatically adjusted based on the height. * 3. FIT = The width and height are automatically adjusted to fit inside the given target area, while keeping the aspect ratio. Depending on the aspect ratio there may be some space inside the area which is not covered. * 4. ENVELOP = The width and height are automatically adjusted to make the size cover the entire target area while keeping the aspect ratio. This may extend further out than the target size. - * + * * Calling this method automatically recalculates the `width` and the `height`, if required. - * + * * @method Phaser.Structs.Size#setAspectMode * @since 3.16.0 * @@ -191383,14 +192701,14 @@ var Size = new Class({ * By setting a Snap To value when this Size component is modified its dimensions will automatically * by snapped to the nearest grid slice, using floor. For example, if you have snap value of 16, * and the width changes to 68, then it will snap down to 64 (the closest multiple of 16 when floored) - * + * * Note that snapping takes place before adjustments by the parent, or the min / max settings. If these * values are not multiples of the given snap values, then this can result in un-snapped dimensions. - * + * * Call this method with no arguments to reset the snap values. - * + * * Calling this method automatically recalculates the `width` and the `height`, if required. - * + * * @method Phaser.Structs.Size#setSnap * @since 3.16.0 * @@ -191411,18 +192729,18 @@ var Size = new Class({ /** * Sets, or clears, the parent of this Size component. - * + * * To clear the parent call this method with no arguments. - * + * * The parent influences the maximum extents to which this Size component can expand, * based on the aspect mode: - * + * * NONE - The parent clamps both the width and height. * WIDTH_CONTROLS_HEIGHT - The parent clamps just the width. * HEIGHT_CONTROLS_WIDTH - The parent clamps just the height. * FIT - The parent clamps whichever axis is required to ensure the size fits within it. * ENVELOP - The parent is used to ensure the size fully envelops the parent. - * + * * Calling this method automatically calls `setSize`. * * @method Phaser.Structs.Size#setParent @@ -191441,11 +192759,11 @@ var Size = new Class({ /** * Set the minimum width and height values this Size component will allow. - * + * * The minimum values can never be below zero, or greater than the maximum values. - * + * * Setting this will automatically adjust both the `width` and `height` properties to ensure they are within range. - * + * * Note that based on the aspect mode, and if this Size component has a parent set or not, the minimums set here * _can_ be exceed in some situations. * @@ -191470,9 +192788,9 @@ var Size = new Class({ /** * Set the maximum width and height values this Size component will allow. - * + * * Setting this will automatically adjust both the `width` and `height` properties to ensure they are within range. - * + * * Note that based on the aspect mode, and if this Size component has a parent set or not, the maximums set here * _can_ be exceed in some situations. * @@ -191497,16 +192815,16 @@ var Size = new Class({ /** * Sets the width and height of this Size component based on the aspect mode. - * + * * If the aspect mode is 'none' then calling this method will change the aspect ratio, otherwise the current * aspect ratio is honored across all other modes. - * + * * If snapTo values have been set then the given width and height are snapped first, prior to any further * adjustment via min/max values, or a parent. - * + * * If minimum and/or maximum dimensions have been specified, the values given to this method will be clamped into * that range prior to adjustment, but may still exceed them depending on the aspect mode. - * + * * If this Size component has a parent set, and the aspect mode is `fit` or `envelop`, then the given sizes will * be clamped to the range specified by the parent. * @@ -191522,7 +192840,7 @@ var Size = new Class({ { if (width === undefined) { width = 0; } if (height === undefined) { height = width; } - + switch (this.aspectMode) { case Size.NONE: @@ -191555,7 +192873,7 @@ var Size = new Class({ /** * Sets a new aspect ratio, overriding what was there previously. - * + * * It then calls `setSize` immediately using the current dimensions. * * @method Phaser.Structs.Size#setAspectRatio @@ -191574,7 +192892,7 @@ var Size = new Class({ /** * Sets a new width and height for this Size component and updates the aspect ratio based on them. - * + * * It _doesn't_ change the `aspectMode` and still factors in size limits such as the min max and parent bounds. * * @method Phaser.Structs.Size#resize @@ -191608,7 +192926,7 @@ var Size = new Class({ getNewWidth: function (value, checkParent) { if (checkParent === undefined) { checkParent = true; } - + value = Clamp(value, this.minWidth, this.maxWidth); if (checkParent && this._parent && value > this._parent.width) @@ -191646,10 +192964,10 @@ var Size = new Class({ /** * The current `width` and `height` are adjusted to fit inside the given dimensions, while keeping the aspect ratio. - * + * * If `fit` is true there may be some space inside the target area which is not covered if its aspect ratio differs. * If `fit` is false the size may extend further out than the target area if the aspect ratios differ. - * + * * If this Size component has a parent set, then the width and height passed to this method will be clamped so * it cannot exceed that of the parent. * @@ -191715,9 +193033,9 @@ var Size = new Class({ /** * The current `width` and `height` are adjusted to fit inside the given dimensions, while keeping the aspect ratio. - * + * * There may be some space inside the target area which is not covered if its aspect ratio differs. - * + * * If this Size component has a parent set, then the width and height passed to this method will be clamped so * it cannot exceed that of the parent. * @@ -191736,9 +193054,9 @@ var Size = new Class({ /** * The current `width` and `height` are adjusted so that they fully envelope the given dimensions, while keeping the aspect ratio. - * + * * The size may extend further out than the target area if the aspect ratios differ. - * + * * If this Size component has a parent set, then the values are clamped so that it never exceeds the parent * on the longest axis. * @@ -191757,7 +193075,7 @@ var Size = new Class({ /** * Sets the width of this Size component. - * + * * Depending on the aspect mode, changing the width may also update the height and aspect ratio. * * @method Phaser.Structs.Size#setWidth @@ -191774,7 +193092,7 @@ var Size = new Class({ /** * Sets the height of this Size component. - * + * * Depending on the aspect mode, changing the height may also update the width and aspect ratio. * * @method Phaser.Structs.Size#setHeight @@ -191826,7 +193144,7 @@ var Size = new Class({ * * @method Phaser.Structs.Size#copy * @since 3.16.0 - * + * * @param {Phaser.Structs.Size} destination - The Size component to copy the values to. * * @return {Phaser.Structs.Size} The updated destination Size component. @@ -191842,9 +193160,9 @@ var Size = new Class({ /** * Destroys this Size component. - * + * * This clears the local properties and any parent object, if set. - * + * * A destroyed Size component cannot be re-used. * * @method Phaser.Structs.Size#destroy @@ -191858,11 +193176,11 @@ var Size = new Class({ /** * The width of this Size component. - * + * * This value is clamped to the range specified by `minWidth` and `maxWidth`, if enabled. - * + * * A width can never be less than zero. - * + * * Changing this value will automatically update the `height` if the aspect ratio lock is enabled. * You can also use the `setWidth` and `getWidth` methods. * @@ -191886,11 +193204,11 @@ var Size = new Class({ /** * The height of this Size component. - * + * * This value is clamped to the range specified by `minHeight` and `maxHeight`, if enabled. - * + * * A height can never be less than zero. - * + * * Changing this value will automatically update the `width` if the aspect ratio lock is enabled. * You can also use the `setHeight` and `getHeight` methods. * @@ -191916,7 +193234,7 @@ var Size = new Class({ /** * Do not make the size fit the aspect ratio. Change the ratio when the size changes. - * + * * @name Phaser.Structs.Size.NONE * @constant * @type {number} @@ -191926,7 +193244,7 @@ Size.NONE = 0; /** * The height is automatically adjusted based on the width. - * + * * @name Phaser.Structs.Size.WIDTH_CONTROLS_HEIGHT * @constant * @type {number} @@ -191936,7 +193254,7 @@ Size.WIDTH_CONTROLS_HEIGHT = 1; /** * The width is automatically adjusted based on the height. - * + * * @name Phaser.Structs.Size.HEIGHT_CONTROLS_WIDTH * @constant * @type {number} @@ -191946,7 +193264,7 @@ Size.HEIGHT_CONTROLS_WIDTH = 2; /** * The width and height are automatically adjusted to fit inside the given target area, while keeping the aspect ratio. Depending on the aspect ratio there may be some space inside the area which is not covered. - * + * * @name Phaser.Structs.Size.FIT * @constant * @type {number} @@ -191956,7 +193274,7 @@ Size.FIT = 3; /** * The width and height are automatically adjusted to make the size cover the entire target area while keeping the aspect ratio. This may extend further out than the target size. - * + * * @name Phaser.Structs.Size.ENVELOP * @constant * @type {number} @@ -191974,22 +193292,22 @@ module.exports = Size; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Process Queue Add Event. - * + * * This event is dispatched by a Process Queue when a new item is successfully moved to its active list. - * + * * You will most commonly see this used by a Scene's Update List when a new Game Object has been added. - * + * * In that instance, listen to this event from within a Scene using: `this.sys.updateList.on('add', listener)`. * * @event Phaser.Structs.Events#PROCESS_QUEUE_ADD * @since 3.20.0 - * + * * @param {*} item - The item that was added to the Process Queue. */ module.exports = 'add'; @@ -192002,22 +193320,22 @@ module.exports = 'add'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Process Queue Remove Event. - * + * * This event is dispatched by a Process Queue when a new item is successfully removed from its active list. - * + * * You will most commonly see this used by a Scene's Update List when a Game Object has been removed. - * + * * In that instance, listen to this event from within a Scene using: `this.sys.updateList.on('remove', listener)`. * * @event Phaser.Structs.Events#PROCESS_QUEUE_REMOVE * @since 3.20.0 - * + * * @param {*} item - The item that was removed from the Process Queue. */ module.exports = 'remove'; @@ -192030,7 +193348,7 @@ module.exports = 'remove'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -192053,7 +193371,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -192081,7 +193399,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -192717,7 +194035,7 @@ module.exports = CanvasTexture; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -193575,7 +194893,7 @@ module.exports = Frame; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -194104,7 +195422,7 @@ module.exports = Texture; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -194192,7 +195510,7 @@ var TextureManager = new Class({ * @private * @since 3.0.0 */ - this._tempCanvas = CanvasPool.create2D(this, 1, 1); + this._tempCanvas = CanvasPool.create2D(this); /** * The context of the temporary canvas element made to save an pixel data in getPixel() and getPixelAlpha() method. @@ -194202,7 +195520,7 @@ var TextureManager = new Class({ * @private * @since 3.0.0 */ - this._tempContext = this._tempCanvas.getContext('2d'); + this._tempContext = this._tempCanvas.getContext('2d', { willReadFrequently: true }); /** * An counting value used for emitting 'ready' event after all of managers in game is loaded. @@ -194263,6 +195581,7 @@ var TextureManager = new Class({ /** * Checks the given texture key and throws a console.warn if the key is already in use, then returns false. + * * If you wish to avoid the console.warn then use `TextureManager.exists` instead. * * @method Phaser.Textures.TextureManager#checkKey @@ -194323,6 +195642,7 @@ var TextureManager = new Class({ key.destroy(); this.emit(Events.REMOVE, key.key); + this.emit(Events.REMOVE_KEY + key.key); } return this; @@ -194386,7 +195706,7 @@ var TextureManager = new Class({ Parser.Image(texture, 0); _this.emit(Events.ADD, key, texture); - + _this.emit(Events.ADD_KEY + key, texture); _this.emit(Events.LOAD, key, texture); }; @@ -194435,17 +195755,20 @@ var TextureManager = new Class({ var canvas = CanvasPool.create2D(this, cd.width, cd.height); var ctx = canvas.getContext('2d'); - ctx.drawImage( - textureFrame.source.image, - cd.x, - cd.y, - cd.width, - cd.height, - 0, - 0, - cd.width, - cd.height - ); + if (cd.width > 0 && cd.height > 0) + { + ctx.drawImage( + textureFrame.source.image, + cd.x, + cd.y, + cd.width, + cd.height, + 0, + 0, + cd.width, + cd.height + ); + } data = canvas.toDataURL(type, encoderOptions); @@ -194484,6 +195807,7 @@ var TextureManager = new Class({ } this.emit(Events.ADD, key, texture); + this.emit(Events.ADD_KEY + key, texture); } return texture; @@ -194524,6 +195848,7 @@ var TextureManager = new Class({ texture.add('__BASE', 0, 0, 0, width, height); this.emit(Events.ADD, key, texture); + this.emit(Events.ADD_KEY + key, texture); } return texture; @@ -194574,6 +195899,7 @@ var TextureManager = new Class({ } this.emit(Events.ADD, key, texture); + this.emit(Events.ADD_KEY + key, texture); } return texture; @@ -194603,6 +195929,7 @@ var TextureManager = new Class({ texture.add('__BASE', 0, 0, 0, renderTexture.width, renderTexture.height); this.emit(Events.ADD, key, texture); + this.emit(Events.ADD_KEY + key, texture); } return texture; @@ -194730,6 +196057,7 @@ var TextureManager = new Class({ this.list[key] = texture; this.emit(Events.ADD, key, texture); + this.emit(Events.ADD_KEY + key, texture); } return texture; @@ -194810,6 +196138,7 @@ var TextureManager = new Class({ } this.emit(Events.ADD, key, texture); + this.emit(Events.ADD_KEY + key, texture); } return texture; @@ -194857,6 +196186,7 @@ var TextureManager = new Class({ } this.emit(Events.ADD, key, texture); + this.emit(Events.ADD_KEY + key, texture); } return texture; @@ -194893,6 +196223,7 @@ var TextureManager = new Class({ } this.emit(Events.ADD, key, texture); + this.emit(Events.ADD_KEY + key, texture); } return texture; @@ -194929,6 +196260,7 @@ var TextureManager = new Class({ } this.emit(Events.ADD, key, texture); + this.emit(Events.ADD_KEY + key, texture); } return texture; @@ -194938,32 +196270,45 @@ var TextureManager = new Class({ * Adds a Sprite Sheet to this Texture Manager. * * In Phaser terminology a Sprite Sheet is a texture containing different frames, but each frame is the exact - * same size and cannot be trimmed or rotated. + * same size and cannot be trimmed or rotated. This is different to a Texture Atlas, created by tools such as + * Texture Packer, and more akin with the fixed-frame exports you get from apps like Aseprite or old arcade + * games. + * + * As of Phaser 3.60 you can use this method to add a sprite sheet to an existing Phaser Texture. * * @method Phaser.Textures.TextureManager#addSpriteSheet * @fires Phaser.Textures.Events#ADD * @since 3.0.0 * - * @param {string} key - The unique string-based key of the Texture. - * @param {HTMLImageElement} source - The source Image element. + * @param {string} key - The unique string-based key of the Texture. Give an empty string if you provide a Phaser Texture as the 2nd argument. + * @param {(HTMLImageElement|Phaser.Textures.Texture)} source - The source Image element, or a Phaser Texture. * @param {Phaser.Types.Textures.SpriteSheetConfig} config - The configuration object for this Sprite Sheet. * - * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use. + * @return {?Phaser.Textures.Texture} The Texture that was created or updated, or `null` if the key is already in use. */ addSpriteSheet: function (key, source, config) { var texture = null; - if (this.checkKey(key)) + if (source instanceof Texture) + { + key = texture.key; + texture = source; + } + else if (this.checkKey(key)) { texture = this.create(key, source); + } + if (texture) + { var width = texture.source[0].width; var height = texture.source[0].height; Parser.SpriteSheet(texture, 0, 0, 0, width, height, config); this.emit(Events.ADD, key, texture); + this.emit(Events.ADD_KEY + key, texture); } return texture; @@ -195017,6 +196362,7 @@ var TextureManager = new Class({ } this.emit(Events.ADD, key, texture); + this.emit(Events.ADD_KEY + key, texture); return texture; } @@ -195138,7 +196484,7 @@ var TextureManager = new Class({ /** * Returns an array with all of the keys of all Textures in this Texture Manager. - * The output array will exclude the `__DEFAULT` and `__MISSING` keys. + * The output array will exclude the `__DEFAULT`, `__MISSING`, and `__WHITE` keys. * * @method Phaser.Textures.TextureManager#getTextureKeys * @since 3.0.0 @@ -195151,7 +196497,7 @@ var TextureManager = new Class({ for (var key in this.list) { - if (key !== '__DEFAULT' && key !== '__MISSING') + if (key !== '__DEFAULT' && key !== '__MISSING' && key !== '__WHITE') { output.push(key); } @@ -195370,7 +196716,7 @@ module.exports = TextureManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -195744,7 +197090,7 @@ module.exports = TextureSource; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -195759,7 +197105,7 @@ var CONST = { /** * Linear filter type. - * + * * @name Phaser.Textures.FilterMode.LINEAR * @type {number} * @const @@ -195769,14 +197115,14 @@ var CONST = { /** * Nearest neighbor filter type. - * + * * @name Phaser.Textures.FilterMode.NEAREST * @type {number} * @const * @since 3.0.0 */ NEAREST: 1 - + }; module.exports = CONST; @@ -195789,26 +197135,52 @@ module.exports = CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Texture Add Event. - * + * * This event is dispatched by the Texture Manager when a texture is added to it. - * + * * Listen to this event from within a Scene using: `this.textures.on('addtexture', listener)`. * * @event Phaser.Textures.Events#ADD * @since 3.0.0 - * + * * @param {string} key - The key of the Texture that was added to the Texture Manager. * @param {Phaser.Textures.Texture} texture - A reference to the Texture that was added to the Texture Manager. */ module.exports = 'addtexture'; +/***/ }), + +/***/ 29569: +/***/ ((module) => { + +/** + * @author samme + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Texture Add Key Event. + * + * This event is dispatched by the Texture Manager when a texture with the given key is added to it. + * + * Listen to this event from within a Scene using: `this.textures.on('addtexture-key', listener)`. + * + * @event Phaser.Textures.Events#ADD_KEY + * @since 3.60.0 + * + * @param {Phaser.Textures.Texture} texture - A reference to the Texture that was added to the Texture Manager. + */ +module.exports = 'addtexture-'; + + /***/ }), /***/ 60079: @@ -195816,21 +197188,21 @@ module.exports = 'addtexture'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Texture Load Error Event. - * + * * This event is dispatched by the Texture Manager when a texture it requested to load failed. * This only happens when base64 encoded textures fail. All other texture types are loaded via the Loader Plugin. - * + * * Listen to this event from within a Scene using: `this.textures.on('onerror', listener)`. * * @event Phaser.Textures.Events#ERROR * @since 3.0.0 - * + * * @param {string} key - The key of the Texture that failed to load into the Texture Manager. */ module.exports = 'onerror'; @@ -195843,23 +197215,23 @@ module.exports = 'onerror'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Texture Load Event. - * + * * This event is dispatched by the Texture Manager when a texture has finished loading on it. * This only happens for base64 encoded textures. All other texture types are loaded via the Loader Plugin. - * + * * Listen to this event from within a Scene using: `this.textures.on('onload', listener)`. - * + * * This event is dispatched after the [ADD]{@linkcode Phaser.Textures.Events#event:ADD} event. * * @event Phaser.Textures.Events#LOAD * @since 3.0.0 - * + * * @param {string} key - The key of the Texture that was loaded by the Texture Manager. * @param {Phaser.Textures.Texture} texture - A reference to the Texture that was loaded by the Texture Manager. */ @@ -195873,13 +197245,13 @@ module.exports = 'onload'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * This internal event signifies that the Texture Manager is now ready and the Game can continue booting. - * + * * When a Phaser Game instance is booting for the first time, the Texture Manager has to wait on a couple of non-blocking * async events before it's fully ready to carry on. When those complete the Texture Manager emits this event via the Game * instance, which tells the Game to carry on booting. @@ -195897,28 +197269,55 @@ module.exports = 'ready'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Texture Remove Event. - * + * * This event is dispatched by the Texture Manager when a texture is removed from it. - * + * * Listen to this event from within a Scene using: `this.textures.on('removetexture', listener)`. - * + * * If you have any Game Objects still using the removed texture, they will start throwing * errors the next time they try to render. Be sure to clear all use of the texture in this event handler. * * @event Phaser.Textures.Events#REMOVE * @since 3.0.0 - * + * * @param {string} key - The key of the Texture that was removed from the Texture Manager. */ module.exports = 'removetexture'; +/***/ }), + +/***/ 85549: +/***/ ((module) => { + +/** + * @author samme + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Texture Remove Key Event. + * + * This event is dispatched by the Texture Manager when a texture with the given key is removed from it. + * + * Listen to this event from within a Scene using: `this.textures.on('removetexture-key', listener)`. + * + * If you have any Game Objects still using the removed texture, they will start throwing + * errors the next time they try to render. Be sure to clear all use of the texture in this event handler. + * + * @event Phaser.Textures.Events#REMOVE_KEY + * @since 3.60.0 + */ +module.exports = 'removetexture-'; + + /***/ }), /***/ 38203: @@ -195926,7 +197325,7 @@ module.exports = 'removetexture'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -195937,10 +197336,12 @@ module.exports = 'removetexture'; module.exports = { ADD: __webpack_require__(49644), + ADD_KEY: __webpack_require__(29569), ERROR: __webpack_require__(60079), LOAD: __webpack_require__(72665), READY: __webpack_require__(93006), - REMOVE: __webpack_require__(69018) + REMOVE: __webpack_require__(69018), + REMOVE_KEY: __webpack_require__(85549) }; @@ -195952,7 +197353,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -195965,7 +197366,7 @@ var FilterMode = __webpack_require__(65154); /** * Linear filter type. - * + * * @name Phaser.Textures.LINEAR * @type {number} * @const @@ -195974,7 +197375,7 @@ var FilterMode = __webpack_require__(65154); /** * Nearest Neighbor filter type. - * + * * @name Phaser.Textures.NEAREST * @type {number} * @const @@ -196006,7 +197407,7 @@ module.exports = Textures; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -196088,7 +197489,7 @@ module.exports = AtlasXML; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -196124,7 +197525,7 @@ module.exports = Canvas; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -196160,7 +197561,7 @@ module.exports = Image; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -196207,6 +197608,13 @@ var JSONArray = function (texture, sourceIndex, json) // The frame values are the exact coordinates to cut the frame out of the atlas from newFrame = texture.add(src.filename, sourceIndex, src.frame.x, src.frame.y, src.frame.w, src.frame.h); + if (!newFrame) + { + console.warn('Invalid atlas json, frame already exists: ' + src.filename); + + continue; + } + // These are the original (non-trimmed) sprite values if (src.trimmed) { @@ -196270,7 +197678,7 @@ module.exports = JSONArray; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -196321,6 +197729,13 @@ var JSONHash = function (texture, sourceIndex, json) // The frame values are the exact coordinates to cut the frame out of the atlas from newFrame = texture.add(key, sourceIndex, src.frame.x, src.frame.y, src.frame.w, src.frame.h); + if (!newFrame) + { + console.warn('Invalid atlas json, frame already exists: ' + key); + + continue; + } + // These are the original (non-trimmed) sprite values if (src.trimmed) { @@ -196783,7 +198198,7 @@ module.exports = PVRParser; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -196909,7 +198324,7 @@ module.exports = SpriteSheet; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -197101,7 +198516,7 @@ module.exports = SpriteSheetFromAtlas; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -197272,7 +198687,7 @@ TextureImporter: /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -197303,7 +198718,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -197315,7 +198730,7 @@ module.exports = { /** * CSV Map Type - * + * * @name Phaser.Tilemaps.Formats.CSV * @type {number} * @since 3.0.0 @@ -197324,7 +198739,7 @@ module.exports = { /** * Tiled JSON Map Type - * + * * @name Phaser.Tilemaps.Formats.TILED_JSON * @type {number} * @since 3.0.0 @@ -197333,7 +198748,7 @@ module.exports = { /** * 2D Array Map Type - * + * * @name Phaser.Tilemaps.Formats.ARRAY_2D * @type {number} * @since 3.0.0 @@ -197342,7 +198757,7 @@ module.exports = { /** * Weltmeister (Impact.js) Map Type - * + * * @name Phaser.Tilemaps.Formats.WELTMEISTER * @type {number} * @since 3.0.0 @@ -197359,7 +198774,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -197375,7 +198790,7 @@ var Class = __webpack_require__(56694); * @memberof Phaser.Tilemaps * @constructor * @since 3.0.0 - * + * * @param {string} name - The name of the image collection in the map data. * @param {number} firstgid - The first image index this image collection contains. * @param {number} [width=32] - Width of widest image (in pixels). @@ -197397,7 +198812,7 @@ var ImageCollection = new Class({ /** * The name of the Image Collection. - * + * * @name Phaser.Tilemaps.ImageCollection#name * @type {string} * @since 3.0.0 @@ -197407,7 +198822,7 @@ var ImageCollection = new Class({ /** * The Tiled firstgid value. * This is the starting index of the first image index this Image Collection contains. - * + * * @name Phaser.Tilemaps.ImageCollection#firstgid * @type {number} * @since 3.0.0 @@ -197416,7 +198831,7 @@ var ImageCollection = new Class({ /** * The width of the widest image (in pixels). - * + * * @name Phaser.Tilemaps.ImageCollection#imageWidth * @type {number} * @readonly @@ -197426,7 +198841,7 @@ var ImageCollection = new Class({ /** * The height of the tallest image (in pixels). - * + * * @name Phaser.Tilemaps.ImageCollection#imageHeight * @type {number} * @readonly @@ -197437,7 +198852,7 @@ var ImageCollection = new Class({ /** * The margin around the images in the collection (in pixels). * Use `setSpacing` to change. - * + * * @name Phaser.Tilemaps.ImageCollection#imageMarge * @type {number} * @readonly @@ -197448,7 +198863,7 @@ var ImageCollection = new Class({ /** * The spacing between each image in the collection (in pixels). * Use `setSpacing` to change. - * + * * @name Phaser.Tilemaps.ImageCollection#imageSpacing * @type {number} * @readonly @@ -197458,7 +198873,7 @@ var ImageCollection = new Class({ /** * Image Collection-specific properties that are typically defined in the Tiled editor. - * + * * @name Phaser.Tilemaps.ImageCollection#properties * @type {object} * @since 3.0.0 @@ -197467,7 +198882,7 @@ var ImageCollection = new Class({ /** * The cached images that are a part of this collection. - * + * * @name Phaser.Tilemaps.ImageCollection#images * @type {array} * @readonly @@ -197477,7 +198892,7 @@ var ImageCollection = new Class({ /** * The total number of images in the image collection. - * + * * @name Phaser.Tilemaps.ImageCollection#total * @type {number} * @readonly @@ -197491,9 +198906,9 @@ var ImageCollection = new Class({ * * @method Phaser.Tilemaps.ImageCollection#containsImageIndex * @since 3.0.0 - * + * * @param {number} imageIndex - The image index to search for. - * + * * @return {boolean} True if this Image Collection contains the given index. */ containsImageIndex: function (imageIndex) @@ -197506,7 +198921,7 @@ var ImageCollection = new Class({ * * @method Phaser.Tilemaps.ImageCollection#addImage * @since 3.0.0 - * + * * @param {number} gid - The gid of the image in the Image Collection. * @param {string} image - The the key of the image in the Image Collection and in the cache. * @@ -197766,7 +199181,7 @@ module.exports = ObjectHelper; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -197853,7 +199268,7 @@ module.exports = ParseToTilemap; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -198303,9 +199718,14 @@ var Tile = new Class({ // Tiled places tiles on a grid of baseWidth x baseHeight. The origin for a tile in grid // units is the bottom left, so the y coordinate needs to be adjusted by the difference // between the base size and this tile's size. - return tilemapLayer - ? tilemapLayer.tileToWorldY(this.y, camera) - (this.height - this.baseHeight) * tilemapLayer.scaleY - : this.y * this.baseHeight - (this.height - this.baseHeight); + if (tilemapLayer) + { + var point = tilemapLayer.tileToWorldXY(this.x, this.y, undefined, camera); + + return point.y; + } + + return this.y * this.baseWidth - (this.height - this.baseHeight); }, /** @@ -198328,7 +199748,6 @@ var Tile = new Class({ : this.getTop(camera) + this.height; }, - /** * Gets the world rectangle bounding box for the tile, factoring in the layers position, * scale and scroll. @@ -198782,7 +200201,7 @@ module.exports = Tile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -199082,36 +200501,6 @@ var Tilemap = new Class({ }; }, - /** - * @ignore - */ - createBlankDynamicLayer: function (name, tileset, x, y, width, height, tileWidth, tileHeight) - { - console.warn('createBlankDynamicLayer is deprecated. Use createBlankLayer'); - - return this.createBlankLayer(name, tileset, x, y, width, height, tileWidth, tileHeight); - }, - - /** - * @ignore - */ - createDynamicLayer: function (layerID, tileset, x, y) - { - console.warn('createDynamicLayer is deprecated. Use createLayer'); - - return this.createLayer(layerID, tileset, x, y); - }, - - /** - * @ignore - */ - createStaticLayer: function (layerID, tileset, x, y) - { - console.warn('createStaticLayer is deprecated. Use createLayer'); - - return this.createLayer(layerID, tileset, x, y); - }, - /** * Sets the rendering (draw) order of the tiles in this map. * @@ -199376,7 +200765,7 @@ var Tilemap = new Class({ if (typeof layerID === 'string') { - console.warn('Valid tilelayer names:\n\t' + this.getTileLayerNames().join(',\n\t')); + console.warn('Valid tilelayer names: %o', this.getTileLayerNames()); } return null; @@ -199384,7 +200773,7 @@ var Tilemap = new Class({ var layerData = this.layers[index]; - // Check for an associated static or dynamic tilemap layer + // Check for an associated tilemap layer if (layerData.tilemapLayer) { console.warn('Tilemap Layer ID already exists:' + layerID); @@ -201425,7 +202814,7 @@ module.exports = Tilemap; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -201440,9 +202829,9 @@ var ParseToTilemap = __webpack_require__(15043); * * @method Phaser.GameObjects.GameObjectCreator#tilemap * @since 3.0.0 - * + * * @param {Phaser.Types.Tilemaps.TilemapConfig} [config] - The config options for the Tilemap. - * + * * @return {Phaser.Tilemaps.Tilemap} */ GameObjectCreator.register('tilemap', function (config) @@ -201470,7 +202859,7 @@ GameObjectCreator.register('tilemap', function (config) /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -201503,7 +202892,7 @@ var ParseToTilemap = __webpack_require__(15043); * the tile data doesn't need to change then setting this value to `true` will help with memory * consumption. However if your map is small or you need to update the tiles dynamically, then leave * the default value set. - * + * * @return {Phaser.Tilemaps.Tilemap} */ GameObjectFactory.register('tilemap', function (key, tileWidth, tileHeight, width, height, data, insertNull) @@ -201537,7 +202926,7 @@ GameObjectFactory.register('tilemap', function (key, tileWidth, tileHeight, widt /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -201564,6 +202953,7 @@ var TilemapLayerRender = __webpack_require__(96193); * @extends Phaser.GameObjects.Components.Depth * @extends Phaser.GameObjects.Components.Flip * @extends Phaser.GameObjects.Components.GetBounds + * @extends Phaser.GameObjects.Components.Mask * @extends Phaser.GameObjects.Components.Origin * @extends Phaser.GameObjects.Components.Pipeline * @extends Phaser.GameObjects.Components.ScrollFactor @@ -201588,6 +202978,7 @@ var TilemapLayer = new Class({ Components.Depth, Components.Flip, Components.GetBounds, + Components.Mask, Components.Origin, Components.Pipeline, Components.Transform, @@ -201778,10 +203169,50 @@ var TilemapLayer = new Class({ */ this.gidMap = []; + /** + * The horizontal origin of this Tilemap Layer. + * + * @name Phaser.Tilemaps.TilemapLayer#originX + * @type {number} + * @default 0 + * @readOnly + * @since 3.0.0 + */ + + /** + * The vertical origin of this Tilemap Layer. + * + * @name Phaser.Tilemaps.TilemapLayer#originY + * @type {number} + * @default 0 + * @readOnly + * @since 3.0.0 + */ + + /** + * The horizontal display origin of this Tilemap Layer. + * + * @name Phaser.Tilemaps.TilemapLayer#displayOriginX + * @type {number} + * @default 0 + * @readOnly + * @since 3.0.0 + */ + + /** + * The vertical display origin of this Tilemap Layer. + * + * @name Phaser.Tilemaps.TilemapLayer#displayOriginY + * @type {number} + * @default 0 + * @readOnly + * @since 3.0.0 + */ + this.setTilesets(tileset); this.setAlpha(this.layer.alpha); this.setPosition(x, y); - this.setOrigin(); + this.setOrigin(0, 0); this.setSize(tilemap.tileWidth * this.layer.width, tilemap.tileHeight * this.layer.height); this.initPipeline(); @@ -202100,6 +203531,43 @@ var TilemapLayer = new Class({ return this; }, + /** + * Sets an additive tint on each Tile within the given area. + * + * The tint works by taking the pixel color values from the tileset texture, and then + * multiplying it by the color value of the tint. + * + * If no area values are given then all tiles will be tinted to the given color. + * + * To remove a tint call this method with either no parameters, or by passing white `0xffffff` as the tint color. + * + * If a tile already has a tint set then calling this method will override that. + * + * @method Phaser.Tilemaps.TilemapLayer#setTint + * @webglOnly + * @since 3.60.0 + * + * @param {number} [tint=0xffffff] - The tint color being applied to each tile within the region. Given as a hex value, i.e. `0xff0000` for red. Set to white (`0xffffff`) to reset the tint. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. + * + * @return {this} This Tilemap Layer object. + */ + setTint: function (tint, tileX, tileY, width, height, filteringOptions) + { + if (tint === undefined) { tint = 0xffffff; } + + var tintTile = function (tile) + { + tile.tint = tint; + }; + + return this.forEachTile(tintTile, this, tileX, tileY, width, height, filteringOptions); + }, + /** * Gets a tile at the given tile coordinates from the given layer. * @@ -202853,7 +204321,7 @@ module.exports = TilemapLayer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -202943,15 +204411,14 @@ var TilemapLayerCanvasRenderer = function (renderer, src, camera, parentMatrix) var image = tileset.image.getSourceImage(); var tileTexCoords = tileset.getTileTextureCoordinates(tile.index); + var tileWidth = tileset.tileWidth; + var tileHeight = tileset.tileHeight; - if (tileTexCoords === null) + if (tileTexCoords === null || tileWidth === 0 || tileHeight === 0) { continue; } - var tileWidth = tileset.tileWidth; - var tileHeight = tileset.tileHeight; - var halfWidth = tileWidth * 0.5; var halfHeight = tileHeight * 0.5; @@ -202998,12 +204465,13 @@ module.exports = TilemapLayerCanvasRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(72283); -var renderCanvas = __webpack_require__(72283); +var NOOP = __webpack_require__(72283); +var renderWebGL = NOOP; +var renderCanvas = NOOP; if (true) { @@ -203030,7 +204498,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -203147,7 +204615,7 @@ module.exports = TilemapLayerWebGLRenderer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -203568,7 +205036,7 @@ module.exports = Tileset; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -203663,7 +205131,7 @@ module.exports = CalculateFacesAt; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -203729,7 +205197,7 @@ module.exports = CalculateFacesWithin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -203776,7 +205244,7 @@ module.exports = CheckIsoBounds; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -203843,7 +205311,7 @@ module.exports = Copy; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -203931,7 +205399,7 @@ module.exports = CreateFromTiles; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -203988,7 +205456,7 @@ module.exports = CullBounds; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -204044,7 +205512,7 @@ module.exports = CullTiles; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -204098,7 +205566,7 @@ module.exports = Fill; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -204142,7 +205610,7 @@ module.exports = FilterTiles; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -204229,7 +205697,7 @@ module.exports = FindByIndex; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -204281,7 +205749,7 @@ module.exports = FindTile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -204328,7 +205796,7 @@ module.exports = ForEachTile; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -204383,7 +205851,7 @@ module.exports = GetCullTilesFunction; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -204439,7 +205907,7 @@ module.exports = GetTileAt; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -204479,7 +205947,7 @@ module.exports = GetTileAtWorldXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -204519,7 +205987,7 @@ module.exports = GetTileToWorldXFunction; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -204574,7 +206042,7 @@ module.exports = GetTileToWorldXYFunction; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -204624,7 +206092,7 @@ module.exports = GetTileToWorldYFunction; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -204724,7 +206192,7 @@ module.exports = GetTilesWithin; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -204788,7 +206256,7 @@ var GetTilesWithinShape = function (shape, filteringOptions, camera, layer) var yStart = pointStart.y; // Bottom right corner of the shapes's bounding box, rounded up to include partial tiles - layer.tilemapLayer.worldToTileXY(shape.right, shape.bottom, true, pointEnd, camera); + layer.tilemapLayer.worldToTileXY(shape.right, shape.bottom, false, pointEnd, camera); var xEnd = Math.ceil(pointEnd.x); var yEnd = Math.ceil(pointEnd.y); @@ -204840,7 +206308,7 @@ module.exports = GetTilesWithinShape; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -204895,7 +206363,7 @@ module.exports = GetTilesWithinWorldXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -204935,7 +206403,7 @@ module.exports = GetWorldToTileXFunction; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -204990,7 +206458,7 @@ module.exports = GetWorldToTileXYFunction; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -205040,7 +206508,7 @@ module.exports = GetWorldToTileYFunction; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -205083,7 +206551,7 @@ module.exports = HasTileAt; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -205126,7 +206594,7 @@ module.exports = HasTileAtWorldXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -205183,7 +206651,7 @@ module.exports = HexagonalCullBounds; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -205235,7 +206703,7 @@ module.exports = HexagonalCullTiles; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -205301,7 +206769,7 @@ module.exports = HexagonalTileToWorldXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -205350,7 +206818,7 @@ module.exports = HexagonalTileToWorldY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -205420,7 +206888,7 @@ module.exports = HexagonalWorldToTileXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -205472,7 +206940,7 @@ module.exports = HexagonalWorldToTileY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -205503,7 +206971,7 @@ module.exports = IsInLayerBounds; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -205652,7 +207120,7 @@ module.exports = IsometricCullTiles; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -205714,7 +207182,7 @@ module.exports = IsometricTileToWorldXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -205780,7 +207248,7 @@ module.exports = IsometricWorldToTileXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -205816,6 +207284,7 @@ var PutTileAt = function (tile, tileX, tileY, recalculateFaces, layer) return null; } + var index; var oldTile = layer.data[tileY][tileX]; var oldTileCollides = oldTile && oldTile.collides; @@ -205830,7 +207299,7 @@ var PutTileAt = function (tile, tileX, tileY, recalculateFaces, layer) } else { - var index = tile; + index = tile; if (layer.data[tileY][tileX] === null) { @@ -205848,7 +207317,8 @@ var PutTileAt = function (tile, tileX, tileY, recalculateFaces, layer) // Copy properties from tileset to tiles. var tiles = BuildTilesetIndex(layer.tilemapLayer.tilemap); - var index = tile instanceof Tile ? tile.index : tile; + + index = tile instanceof Tile ? tile.index : tile; var sid = tiles[index][2]; var set = layer.tilemapLayer.tileset[sid]; @@ -205877,7 +207347,7 @@ module.exports = PutTileAt; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -205921,7 +207391,7 @@ module.exports = PutTileAtWorldXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -205989,7 +207459,7 @@ module.exports = PutTilesAt; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -206048,7 +207518,7 @@ module.exports = Randomize; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -206111,7 +207581,7 @@ module.exports = RemoveTileAt; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -206153,7 +207623,7 @@ module.exports = RemoveTileAtWorldXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -206236,7 +207706,7 @@ module.exports = RenderDebug; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -206281,7 +207751,7 @@ module.exports = ReplaceByIndex; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -206408,7 +207878,7 @@ module.exports = RunCull; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -206480,7 +207950,7 @@ module.exports = SetCollision; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -206557,7 +208027,7 @@ module.exports = SetCollisionBetween; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -206619,7 +208089,7 @@ module.exports = SetCollisionByExclusion; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -206695,7 +208165,7 @@ module.exports = SetCollisionByProperty; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -206755,7 +208225,7 @@ module.exports = SetCollisionFromCollisionGroup; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -206794,7 +208264,7 @@ module.exports = SetLayerCollisionIndex; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -206830,7 +208300,7 @@ module.exports = SetTileCollision; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -206877,7 +208347,7 @@ module.exports = SetTileIndexCallback; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -206919,7 +208389,7 @@ module.exports = SetTileLocationCallback; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -206965,7 +208435,7 @@ module.exports = Shuffle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -207019,7 +208489,7 @@ module.exports = StaggeredCullBounds; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -207071,7 +208541,7 @@ module.exports = StaggeredCullTiles; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -207133,7 +208603,7 @@ module.exports = StaggeredTileToWorldXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -207178,7 +208648,7 @@ module.exports = StaggeredTileToWorldY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -207244,7 +208714,7 @@ module.exports = StaggeredWorldToTileXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -207292,7 +208762,7 @@ module.exports = StaggeredWorldToTileY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -207344,7 +208814,7 @@ module.exports = SwapByIndex; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -207389,7 +208859,7 @@ module.exports = TileToWorldX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -207433,7 +208903,7 @@ module.exports = TileToWorldXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -207478,7 +208948,7 @@ module.exports = TileToWorldY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -207562,7 +209032,7 @@ module.exports = WeightedRandomize; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -207611,7 +209081,7 @@ module.exports = WorldToTileX; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -207657,7 +209127,7 @@ module.exports = WorldToTileXY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -207706,7 +209176,7 @@ module.exports = WorldToTileY; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -207796,13 +209266,13 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Phaser Tilemap constants for orientation. - * + * * @namespace Phaser.Tilemaps.Orientation * @memberof Phaser.Tilemaps * @since 3.50.0 @@ -207810,9 +209280,9 @@ module.exports = { /** * Phaser Tilemap constants for orientation. - * + * * To find out what each mode does please see [Phaser.Tilemaps.Orientation]{@link Phaser.Tilemaps.Orientation}. - * + * * @typedef {Phaser.Tilemaps.Orientation} Phaser.Tilemaps.OrientationType * @memberof Phaser.Tilemaps * @since 3.50.0 @@ -207822,7 +209292,7 @@ module.exports = { /** * Orthogonal Tilemap orientation constant. - * + * * @name Phaser.Tilemaps.Orientation.ORTHOGONAL * @type {number} * @const @@ -207870,7 +209340,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -207890,7 +209360,7 @@ module.exports = CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -207940,7 +209410,7 @@ module.exports = Tilemaps; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -208181,7 +209651,7 @@ module.exports = LayerData; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -208418,7 +209888,7 @@ module.exports = MapData; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -208541,7 +210011,7 @@ module.exports = ObjectLayer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -208589,7 +210059,7 @@ module.exports = FromOrientationString; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -208660,7 +210130,7 @@ module.exports = Parse; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -208694,7 +210164,7 @@ var Parse2DArray = function (name, data, tileWidth, tileHeight, insertNull) tileWidth: tileWidth, tileHeight: tileHeight }); - + var mapData = new MapData({ name: name, tileWidth: tileWidth, @@ -208753,7 +210223,7 @@ module.exports = Parse2DArray; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -208802,7 +210272,7 @@ module.exports = ParseCSV; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -208889,7 +210359,7 @@ module.exports = ParseTileLayers; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -208941,7 +210411,7 @@ module.exports = ParseTilesets; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -209009,7 +210479,7 @@ module.exports = ParseWeltmeister; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -209033,7 +210503,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -209061,7 +210531,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -209135,7 +210605,7 @@ module.exports = AssignTileProperties; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -209179,7 +210649,7 @@ module.exports = Base64Decode; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -209274,7 +210744,7 @@ module.exports = BuildTilesetIndex; /** * @author Seth Berrier - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -209287,20 +210757,19 @@ var GetFastValue = __webpack_require__(72632); * @since 3.21.0 * * @param {object} json - The Tiled JSON object. - * @param {object} [currentl] - The current group layer from the Tiled JSON file. - * @param {object} [parentstate] - The state of the parent group (if any). + * @param {object} [group] - The current group layer from the Tiled JSON file. + * @param {object} [parentState] - The state of the parent group (if any). * * @return {object} A group state object with proper values for updating children layers. */ -var CreateGroupLayer = function (json, groupl, parentstate) +var CreateGroupLayer = function (json, group, parentState) { - if (!groupl) + if (!group) { // Return a default group state object return { i: 0, // Current layer array iterator layers: json.layers, // Current array of layers - // Values inherited from parent group name: '', opacity: 1, @@ -209311,18 +210780,18 @@ var CreateGroupLayer = function (json, groupl, parentstate) } // Compute group layer x, y - var layerX = groupl.x + GetFastValue(groupl, 'startx', 0) * json.tilewidth + GetFastValue(groupl, 'offsetx', 0); - var layerY = groupl.y + GetFastValue(groupl, 'starty', 0) * json.tileheight + GetFastValue(groupl, 'offsety', 0); + var layerX = group.x + GetFastValue(group, 'startx', 0) * json.tilewidth + GetFastValue(group, 'offsetx', 0); + var layerY = group.y + GetFastValue(group, 'starty', 0) * json.tileheight + GetFastValue(group, 'offsety', 0); // Compute next state inherited from group return { i: 0, - layers: groupl.layers, - name: parentstate.name + groupl.name + '/', - opacity: parentstate.opacity * groupl.opacity, - visible: parentstate.visible && groupl.visible, - x: parentstate.x + layerX, - y: parentstate.y + layerY + layers: group.layers, + name: parentState.name + group.name + '/', + opacity: parentState.opacity * group.opacity, + visible: parentState.visible && group.visible, + x: parentState.x + layerX, + y: parentState.y + layerY }; }; @@ -209336,7 +210805,7 @@ module.exports = CreateGroupLayer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -209427,7 +210896,7 @@ module.exports = ParseGID; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -209516,7 +210985,7 @@ module.exports = ParseImageLayers; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -209597,7 +211066,7 @@ module.exports = ParseJSONTiled; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -209678,7 +211147,7 @@ module.exports = ParseObject; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -209778,7 +211247,7 @@ module.exports = ParseObjectLayers; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -210049,7 +211518,7 @@ module.exports = ParseTileLayers; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -210245,7 +211714,7 @@ module.exports = ParseTilesets; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -210387,7 +211856,7 @@ module.exports = ParseWangsets; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -210419,7 +211888,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -210896,7 +212365,7 @@ module.exports = Clock; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -211262,7 +212731,7 @@ module.exports = TimerEvent; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -211278,912 +212747,6 @@ module.exports = { }; -/***/ }), - -/***/ 28860: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(56694); -var EventEmitter = __webpack_require__(6659); -var Events = __webpack_require__(54272); -var TweenBuilder = __webpack_require__(68061); -var TWEEN_CONST = __webpack_require__(55303); - -/** - * @classdesc - * A Timeline combines multiple Tweens into one. Its overall behavior is otherwise similar to a single Tween. - * - * The Timeline updates all of its Tweens simultaneously. Its methods allow you to easily build a sequence - * of Tweens (each one starting after the previous one) or run multiple Tweens at once during given parts of the Timeline. - * - * @class Timeline - * @memberof Phaser.Tweens - * @extends Phaser.Events.EventEmitter - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Tweens.TweenManager} manager - The Tween Manager which owns this Timeline. - */ -var Timeline = new Class({ - - Extends: EventEmitter, - - initialize: - - function Timeline (manager) - { - EventEmitter.call(this); - - /** - * The Tween Manager which owns this Timeline. - * - * @name Phaser.Tweens.Timeline#manager - * @type {Phaser.Tweens.TweenManager} - * @since 3.0.0 - */ - this.manager = manager; - - /** - * A constant value which allows this Timeline to be easily identified as one. - * - * @name Phaser.Tweens.Timeline#isTimeline - * @type {boolean} - * @default true - * @since 3.0.0 - */ - this.isTimeline = true; - - /** - * An array of Tween objects, each containing a unique property and target being tweened. - * - * @name Phaser.Tweens.Timeline#data - * @type {array} - * @default [] - * @since 3.0.0 - */ - this.data = []; - - /** - * The cached size of the data array. - * - * @name Phaser.Tweens.Timeline#totalData - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.totalData = 0; - - /** - * If true then duration, delay, etc values are all frame totals, rather than ms. - * - * @name Phaser.Tweens.Timeline#useFrames - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.useFrames = false; - - /** - * Scales the time applied to this Timeline. A value of 1 runs in real-time. A value of 0.5 runs 50% slower, and so on. - * Value isn't used when calculating total duration of the Timeline, it's a run-time delta adjustment only. - * - * @name Phaser.Tweens.Timeline#timeScale - * @type {number} - * @default 1 - * @since 3.0.0 - */ - this.timeScale = 1; - - /** - * Loop this Timeline? Can be -1 for an infinite loop, or an integer. - * When enabled it will play through ALL Tweens again (use Tween.repeat to loop a single tween) - * - * @name Phaser.Tweens.Timeline#loop - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.loop = 0; - - /** - * Time in ms/frames before this Timeline loops. - * - * @name Phaser.Tweens.Timeline#loopDelay - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.loopDelay = 0; - - /** - * How many loops are left to run? - * - * @name Phaser.Tweens.Timeline#loopCounter - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.loopCounter = 0; - - /** - * Time in ms/frames before the 'onComplete' event fires. This never fires if loop = true (as it never completes) - * - * @name Phaser.Tweens.Timeline#completeDelay - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.completeDelay = 0; - - /** - * Countdown timer value, as used by `loopDelay` and `completeDelay`. - * - * @name Phaser.Tweens.Timeline#countdown - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.countdown = 0; - - /** - * The current state of the Timeline. - * - * @name Phaser.Tweens.Timeline#state - * @type {number} - * @since 3.0.0 - */ - this.state = TWEEN_CONST.PENDING_ADD; - - /** - * The state of the Timeline when it was paused (used by Resume) - * - * @name Phaser.Tweens.Timeline#_pausedState - * @type {number} - * @private - * @since 3.0.0 - */ - this._pausedState = TWEEN_CONST.PENDING_ADD; - - /** - * Does the Timeline start off paused? (if so it needs to be started with Timeline.play) - * - * @name Phaser.Tweens.Timeline#paused - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.paused = false; - - /** - * Elapsed time in ms/frames of this run through of the Timeline. - * - * @name Phaser.Tweens.Timeline#elapsed - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.elapsed = 0; - - /** - * Total elapsed time in ms/frames of the entire Timeline, including looping. - * - * @name Phaser.Tweens.Timeline#totalElapsed - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.totalElapsed = 0; - - /** - * Time in ms/frames for the whole Timeline to play through once, excluding loop amounts and loop delays. - * - * @name Phaser.Tweens.Timeline#duration - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.duration = 0; - - /** - * Value between 0 and 1. The amount of progress through the Timeline, _excluding loops_. - * - * @name Phaser.Tweens.Timeline#progress - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.progress = 0; - - /** - * Time in ms/frames for all Tweens in this Timeline to complete (including looping) - * - * @name Phaser.Tweens.Timeline#totalDuration - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.totalDuration = 0; - - /** - * Value between 0 and 1. The amount through the entire Timeline, including looping. - * - * @name Phaser.Tweens.Timeline#totalProgress - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.totalProgress = 0; - - /** - * An object containing the different Tween callback functions. - * - * You can either set these in the Tween config, or by calling the `Tween.setCallback` method. - * - * `onComplete` When the Timeline finishes playback fully or `Timeline.stop` is called. Never invoked if timeline is set to repeat infinitely. - * `onLoop` When a Timeline loops. - * `onStart` When the Timeline starts playing. - * `onUpdate` When a Timeline updates a child Tween. - * `onYoyo` When a Timeline starts a yoyo. - * - * @name Phaser.Tweens.Timeline#callbacks - * @type {object} - * @since 3.0.0 - */ - this.callbacks = { - onComplete: null, - onLoop: null, - onStart: null, - onUpdate: null, - onYoyo: null - }; - - /** - * The context in which all callbacks are invoked. - * - * @name Phaser.Tweens.Timeline#callbackScope - * @type {any} - * @since 3.0.0 - */ - this.callbackScope; - }, - - /** - * Internal method that will emit a Timeline based Event and invoke the given callback. - * - * @method Phaser.Tweens.Timeline#dispatchTimelineEvent - * @since 3.19.0 - * - * @param {Phaser.Types.Tweens.Event} event - The Event to be dispatched. - * @param {function} callback - The callback to be invoked. Can be `null` or `undefined` to skip invocation. - */ - dispatchTimelineEvent: function (event, callback) - { - this.emit(event, this); - - if (callback) - { - callback.func.apply(callback.scope, callback.params); - } - }, - - /** - * Sets the value of the time scale applied to this Timeline. A value of 1 runs in real-time. - * A value of 0.5 runs 50% slower, and so on. - * - * The value isn't used when calculating total duration of the tween, it's a run-time delta adjustment only. - * - * @method Phaser.Tweens.Timeline#setTimeScale - * @since 3.0.0 - * - * @param {number} value - The time scale value to set. - * - * @return {this} This Timeline object. - */ - setTimeScale: function (value) - { - this.timeScale = value; - - return this; - }, - - /** - * Gets the value of the time scale applied to this Timeline. A value of 1 runs in real-time. - * A value of 0.5 runs 50% slower, and so on. - * - * @method Phaser.Tweens.Timeline#getTimeScale - * @since 3.0.0 - * - * @return {number} The value of the time scale applied to this Timeline. - */ - getTimeScale: function () - { - return this.timeScale; - }, - - /** - * Check whether or not the Timeline is playing. - * - * @method Phaser.Tweens.Timeline#isPlaying - * @since 3.0.0 - * - * @return {boolean} `true` if this Timeline is active, otherwise `false`. - */ - isPlaying: function () - { - return (this.state === TWEEN_CONST.ACTIVE); - }, - - /** - * Creates a new Tween, based on the given Tween Config, and adds it to this Timeline. - * - * @method Phaser.Tweens.Timeline#add - * @since 3.0.0 - * - * @param {(Phaser.Types.Tweens.TweenBuilderConfig|object)} config - The configuration object for the Tween. - * - * @return {this} This Timeline object. - */ - add: function (config) - { - return this.queue(TweenBuilder(this, config)); - }, - - /** - * Adds an existing Tween to this Timeline. - * - * @method Phaser.Tweens.Timeline#queue - * @since 3.0.0 - * - * @param {Phaser.Tweens.Tween} tween - The Tween to be added to this Timeline. - * - * @return {this} This Timeline object. - */ - queue: function (tween) - { - if (!this.isPlaying()) - { - tween.parent = this; - tween.parentIsTimeline = true; - - this.data.push(tween); - - this.totalData = this.data.length; - } - - return this; - }, - - /** - * Checks whether a Tween has an offset value. - * - * @method Phaser.Tweens.Timeline#hasOffset - * @since 3.0.0 - * - * @param {Phaser.Tweens.Tween} tween - The Tween to check. - * - * @return {boolean} `true` if the tween has a non-null offset. - */ - hasOffset: function (tween) - { - return (tween.offset !== null); - }, - - /** - * Checks whether the offset value is a number or a directive that is relative to previous tweens. - * - * @method Phaser.Tweens.Timeline#isOffsetAbsolute - * @since 3.0.0 - * - * @param {number} value - The offset value to be evaluated. - * - * @return {boolean} `true` if the result is a number, `false` if it is a directive like " -= 1000". - */ - isOffsetAbsolute: function (value) - { - return (typeof(value) === 'number'); - }, - - /** - * Checks if the offset is a relative value rather than an absolute one. - * If the value is just a number, this returns false. - * - * @method Phaser.Tweens.Timeline#isOffsetRelative - * @since 3.0.0 - * - * @param {string} value - The offset value to be evaluated. - * - * @return {boolean} `true` if the value is relative, i.e " -= 1000". If `false`, the offset is absolute. - */ - isOffsetRelative: function (value) - { - var t = typeof(value); - - if (t === 'string') - { - var op = value[0]; - - if (op === '-' || op === '+') - { - return true; - } - } - - return false; - }, - - /** - * Parses the relative offset value, returning a positive or negative number. - * - * @method Phaser.Tweens.Timeline#getRelativeOffset - * @since 3.0.0 - * - * @param {string} value - The relative offset, in the format of '-=500', for example. The first character determines whether it will be a positive or negative number. Spacing matters here. - * @param {number} base - The value to use as the offset. - * - * @return {number} The parsed offset value. - */ - getRelativeOffset: function (value, base) - { - var op = value[0]; - var num = parseFloat(value.substr(2)); - var result = base; - - switch (op) - { - case '+': - result += num; - break; - - case '-': - result -= num; - break; - } - - // Cannot ever be < 0 - return Math.max(0, result); - }, - - /** - * Calculates the total duration of the timeline. - * - * Computes all tween durations and returns the full duration of the timeline. - * - * The resulting number is stored in the timeline, not as a return value. - * - * @method Phaser.Tweens.Timeline#calcDuration - * @since 3.0.0 - */ - calcDuration: function () - { - var prevEnd = 0; - var totalDuration = 0; - var offsetDuration = 0; - - for (var i = 0; i < this.totalData; i++) - { - var tween = this.data[i]; - - tween.init(); - - if (this.hasOffset(tween)) - { - if (this.isOffsetAbsolute(tween.offset)) - { - // An actual number, so it defines the start point from the beginning of the timeline - tween.calculatedOffset = tween.offset; - - if (tween.offset === 0) - { - offsetDuration = 0; - } - } - else if (this.isOffsetRelative(tween.offset)) - { - // A relative offset (i.e. '-=1000', so starts at 'offset' ms relative to the PREVIOUS Tweens ending time) - tween.calculatedOffset = this.getRelativeOffset(tween.offset, prevEnd); - } - } - else - { - // Sequential - tween.calculatedOffset = offsetDuration; - } - - prevEnd = tween.totalDuration + tween.calculatedOffset; - - totalDuration += tween.totalDuration; - offsetDuration += tween.totalDuration; - } - - // Excludes loop values - this.duration = totalDuration; - - this.loopCounter = (this.loop === -1) ? 999999999999 : this.loop; - - if (this.loopCounter > 0) - { - this.totalDuration = this.duration + this.completeDelay + ((this.duration + this.loopDelay) * this.loopCounter); - } - else - { - this.totalDuration = this.duration + this.completeDelay; - } - }, - - /** - * Initializes the timeline, which means all Tweens get their init() called, and the total duration will be computed. - * Returns a boolean indicating whether the timeline is auto-started or not. - * - * @method Phaser.Tweens.Timeline#init - * @since 3.0.0 - * - * @return {boolean} `true` if the Timeline is started. `false` if it is paused. - */ - init: function () - { - this.calcDuration(); - - this.progress = 0; - this.totalProgress = 0; - - if (this.paused) - { - this.state = TWEEN_CONST.PAUSED; - - return false; - } - else - { - return true; - } - }, - - /** - * Resets all of the timeline's tweens back to their initial states. - * The boolean parameter indicates whether tweens that are looping should reset as well, or not. - * - * @method Phaser.Tweens.Timeline#resetTweens - * @since 3.0.0 - * - * @param {boolean} resetFromLoop - If `true`, resets all looping tweens to their initial values. - */ - resetTweens: function (resetFromLoop) - { - for (var i = 0; i < this.totalData; i++) - { - var tween = this.data[i]; - - tween.play(resetFromLoop); - } - }, - - /** - * Sets a callback for the Timeline. - * - * @method Phaser.Tweens.Timeline#setCallback - * @since 3.0.0 - * - * @param {string} type - The internal type of callback to set. - * @param {function} callback - Timeline allows multiple tweens to be linked together to create a streaming sequence. - * @param {array} [params] - The parameters to pass to the callback. - * @param {object} [scope] - The context scope of the callback. - * - * @return {this} This Timeline object. - */ - setCallback: function (type, callback, params, scope) - { - if (Timeline.TYPES.indexOf(type) !== -1) - { - this.callbacks[type] = { func: callback, scope: scope, params: [ this ].concat(params) }; - } - - return this; - }, - - /** - * Passed a Tween to the Tween Manager and requests it be made active. - * - * @method Phaser.Tweens.Timeline#makeActive - * @since 3.3.0 - * - * @param {Phaser.Tweens.Tween} tween - The tween object to make active. - * - * @return {Phaser.Tweens.TweenManager} The Timeline's Tween Manager reference. - */ - makeActive: function (tween) - { - return this.manager.makeActive(tween); - }, - - /** - * Starts playing the Timeline. - * - * @method Phaser.Tweens.Timeline#play - * @fires Phaser.Tweens.Events#TIMELINE_START - * @since 3.0.0 - */ - play: function () - { - if (this.state === TWEEN_CONST.ACTIVE) - { - return; - } - - if (this.paused) - { - this.paused = false; - - this.manager.makeActive(this); - - return; - } - else - { - this.resetTweens(false); - - this.state = TWEEN_CONST.ACTIVE; - } - - this.dispatchTimelineEvent(Events.TIMELINE_START, this.callbacks.onStart); - }, - - /** - * Updates the Timeline's `state` and fires callbacks and events. - * - * @method Phaser.Tweens.Timeline#nextState - * @fires Phaser.Tweens.Events#TIMELINE_COMPLETE - * @fires Phaser.Tweens.Events#TIMELINE_LOOP - * @since 3.0.0 - * - * @see Phaser.Tweens.Timeline#update - */ - nextState: function () - { - if (this.loopCounter > 0) - { - // Reset the elapsed time - this.elapsed = 0; - this.progress = 0; - - this.loopCounter--; - - this.resetTweens(true); - - if (this.loopDelay > 0) - { - this.countdown = this.loopDelay; - - this.state = TWEEN_CONST.LOOP_DELAY; - } - else - { - this.state = TWEEN_CONST.ACTIVE; - - this.dispatchTimelineEvent(Events.TIMELINE_LOOP, this.callbacks.onLoop); - } - } - else if (this.completeDelay > 0) - { - this.state = TWEEN_CONST.COMPLETE_DELAY; - - this.countdown = this.completeDelay; - } - else - { - this.state = TWEEN_CONST.PENDING_REMOVE; - - this.dispatchTimelineEvent(Events.TIMELINE_COMPLETE, this.callbacks.onComplete); - } - }, - - /** - * Returns 'true' if this Timeline has finished and should be removed from the Tween Manager. - * Otherwise, returns false. - * - * @method Phaser.Tweens.Timeline#update - * @fires Phaser.Tweens.Events#TIMELINE_COMPLETE - * @fires Phaser.Tweens.Events#TIMELINE_UPDATE - * @since 3.0.0 - * - * @param {number} timestamp - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. - * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. - * - * @return {boolean} Returns `true` if this Timeline has finished and should be removed from the Tween Manager. - */ - update: function (timestamp, delta) - { - if (this.state === TWEEN_CONST.PAUSED) - { - return; - } - - if (this.useFrames) - { - delta = 1 * this.manager.timeScale; - } - - delta *= this.timeScale; - - this.elapsed += delta; - this.progress = Math.min(this.elapsed / this.duration, 1); - - this.totalElapsed += delta; - this.totalProgress = Math.min(this.totalElapsed / this.totalDuration, 1); - - switch (this.state) - { - case TWEEN_CONST.ACTIVE: - - var stillRunning = this.totalData; - - for (var i = 0; i < this.totalData; i++) - { - var tween = this.data[i]; - - if (tween.update(timestamp, delta)) - { - stillRunning--; - } - } - - this.dispatchTimelineEvent(Events.TIMELINE_UPDATE, this.callbacks.onUpdate); - - // Anything still running? If not, we're done - if (stillRunning === 0) - { - this.nextState(); - } - - break; - - case TWEEN_CONST.LOOP_DELAY: - - this.countdown -= delta; - - if (this.countdown <= 0) - { - this.state = TWEEN_CONST.ACTIVE; - - this.dispatchTimelineEvent(Events.TIMELINE_LOOP, this.callbacks.onLoop); - } - - break; - - case TWEEN_CONST.COMPLETE_DELAY: - - this.countdown -= delta; - - if (this.countdown <= 0) - { - this.state = TWEEN_CONST.PENDING_REMOVE; - - this.dispatchTimelineEvent(Events.TIMELINE_COMPLETE, this.callbacks.onComplete); - } - - break; - } - - return (this.state === TWEEN_CONST.PENDING_REMOVE); - }, - - /** - * Stops the Timeline immediately, whatever stage of progress it is at and flags it for removal by the TweenManager. - * - * @method Phaser.Tweens.Timeline#stop - * @since 3.0.0 - */ - stop: function () - { - this.state = TWEEN_CONST.PENDING_REMOVE; - }, - - /** - * Pauses the Timeline, retaining its internal state. - * - * Calling this on a Timeline that is already paused has no effect and fires no event. - * - * @method Phaser.Tweens.Timeline#pause - * @fires Phaser.Tweens.Events#TIMELINE_PAUSE - * @since 3.0.0 - * - * @return {this} This Timeline object. - */ - pause: function () - { - if (this.state === TWEEN_CONST.PAUSED) - { - return; - } - - this.paused = true; - - this._pausedState = this.state; - - this.state = TWEEN_CONST.PAUSED; - - this.emit(Events.TIMELINE_PAUSE, this); - - return this; - }, - - /** - * Resumes a paused Timeline from where it was when it was paused. - * - * Calling this on a Timeline that isn't paused has no effect and fires no event. - * - * @method Phaser.Tweens.Timeline#resume - * @fires Phaser.Tweens.Events#TIMELINE_RESUME - * @since 3.0.0 - * - * @return {this} This Timeline object. - */ - resume: function () - { - if (this.state === TWEEN_CONST.PAUSED) - { - this.paused = false; - - this.state = this._pausedState; - - this.emit(Events.TIMELINE_RESUME, this); - } - - return this; - }, - - /** - * Checks if any of the Tweens in this Timeline as operating on the target object. - * - * Returns `false` if no Tweens operate on the target object. - * - * @method Phaser.Tweens.Timeline#hasTarget - * @since 3.0.0 - * - * @param {object} target - The target to check all Tweens against. - * - * @return {boolean} `true` if there is at least a single Tween that operates on the target object, otherwise `false`. - */ - hasTarget: function (target) - { - for (var i = 0; i < this.data.length; i++) - { - if (this.data[i].hasTarget(target)) - { - return true; - } - } - - return false; - }, - - /** - * Stops all the Tweens in the Timeline immediately, whatever stage of progress they are at and flags - * them for removal by the TweenManager. - * - * @method Phaser.Tweens.Timeline#destroy - * @since 3.0.0 - */ - destroy: function () - { - for (var i = 0; i < this.data.length; i++) - { - this.data[i].stop(); - } - } - -}); - -Timeline.TYPES = [ 'onStart', 'onUpdate', 'onLoop', 'onComplete', 'onYoyo' ]; - -module.exports = Timeline; - - /***/ }), /***/ 64532: @@ -212191,23 +212754,25 @@ module.exports = Timeline; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var ArrayRemove = __webpack_require__(66458); var Class = __webpack_require__(56694); +var Flatten = __webpack_require__(5454); var NumberTweenBuilder = __webpack_require__(68710); var PluginCache = __webpack_require__(91963); var SceneEvents = __webpack_require__(7599); var StaggerBuilder = __webpack_require__(91944); -var TimelineBuilder = __webpack_require__(32981); -var TWEEN_CONST = __webpack_require__(55303); +var Tween = __webpack_require__(39366); var TweenBuilder = __webpack_require__(68061); +var TweenChain = __webpack_require__(45641); +var TweenChainBuilder = __webpack_require__(56034); /** * @classdesc - * The Tween Manager is a default Scene Plugin which controls and updates Tweens and Timelines. + * The Tween Manager is a default Scene Plugin which controls and updates Tweens. * * @class TweenManager * @memberof Phaser.Tweens @@ -212253,55 +212818,111 @@ var TweenManager = new Class({ this.timeScale = 1; /** - * An array of Tweens and Timelines which will be added to the Tween Manager at the start of the frame. + * This toggles the updating state of this Tween Manager. * - * @name Phaser.Tweens.TweenManager#_add - * @type {array} - * @private - * @since 3.0.0 + * Setting `paused` to `true` (or calling the `pauseAll` method) will + * stop this Tween Manager from updating any of its tweens, including + * newly created ones. Set back to `false` to resume playback. + * + * @name Phaser.Tweens.TweenManager#paused + * @type {boolean} + * @default false + * @since 3.60.0 */ - this._add = []; + this.paused = false; /** - * An array of Tweens and Timelines pending to be later added to the Tween Manager. + * Is this Tween Manager currently processing the tweens as part of + * its 'update' loop? This is set to 'true' at the start of 'update' + * and reset to 'false' at the end of the function. Allows you to trap + * Tween Manager status during tween callbacks. * - * @name Phaser.Tweens.TweenManager#_pending - * @type {array} - * @private - * @since 3.0.0 + * @name Phaser.Tweens.TweenManager#processing + * @type {boolean} + * @default false + * @since 3.60.0 */ - this._pending = []; + this.processing = false; /** - * An array of Tweens and Timelines which are still incomplete and are actively processed by the Tween Manager. + * An array of Tweens which are actively being processed by the Tween Manager. * - * @name Phaser.Tweens.TweenManager#_active - * @type {array} - * @private - * @since 3.0.0 + * @name Phaser.Tweens.TweenManager#tweens + * @type {Phaser.Tweens.Tween[]} + * @since 3.60.0 */ - this._active = []; + this.tweens = []; /** - * An array of Tweens and Timelines which will be removed from the Tween Manager at the start of the frame. + * The time the Tween Manager was updated. * - * @name Phaser.Tweens.TweenManager#_destroy - * @type {array} - * @private - * @since 3.0.0 - */ - this._destroy = []; - - /** - * The number of Tweens and Timelines which need to be processed by the Tween Manager at the start of the frame. - * - * @name Phaser.Tweens.TweenManager#_toProcess + * @name Phaser.Tweens.TweenManager#time * @type {number} - * @private - * @default 0 - * @since 3.0.0 + * @since 3.60.0 */ - this._toProcess = 0; + this.time = 0; + + /** + * The time the Tween Manager was started. + * + * @name Phaser.Tweens.TweenManager#startTime + * @type {number} + * @since 3.60.0 + */ + this.startTime = 0; + + /** + * The time the Tween Manager should next update. + * + * @name Phaser.Tweens.TweenManager#nextTime + * @type {number} + * @since 3.60.0 + */ + this.nextTime = 0; + + /** + * The time the Tween Manager previously updated. + * + * @name Phaser.Tweens.TweenManager#prevTime + * @type {number} + * @since 3.60.0 + */ + this.prevTime = 0; + + /** + * The maximum amount of time, in milliseconds, the browser can + * lag for, before lag smoothing is applied. + * + * See the `TweenManager.setLagSmooth` method for further details. + * + * @name Phaser.Tweens.TweenManager#maxLag + * @type {number} + * @default 500 + * @since 3.60.0 + */ + this.maxLag = 500; + + /** + * The amount of time, in milliseconds, that is used to set the + * delta when lag smoothing is applied. + * + * See the `TweenManager.setLagSmooth` method for further details. + * + * @name Phaser.Tweens.TweenManager#lagSkip + * @type {number} + * @default 33 + * @since 3.60.0 + */ + this.lagSkip = 33; + + /** + * An internal value that holds the fps rate. + * + * @name Phaser.Tweens.TweenManager#gap + * @type {number} + * @since 3.60.0 + */ + this.gap = 1000 / 240; scene.sys.events.once(SceneEvents.BOOT, this.boot, this); scene.sys.events.on(SceneEvents.START, this.start, this); @@ -212333,105 +212954,242 @@ var TweenManager = new Class({ { var eventEmitter = this.systems.events; - eventEmitter.on(SceneEvents.PRE_UPDATE, this.preUpdate, this); eventEmitter.on(SceneEvents.UPDATE, this.update, this); eventEmitter.once(SceneEvents.SHUTDOWN, this.shutdown, this); this.timeScale = 1; + this.paused = false; + + this.startTime = Date.now(); + this.prevTime = this.startTime; + this.nextTime = this.gap; }, /** - * Create a Tween Timeline and return it, but do NOT add it to the active or pending Tween lists. + * Create a Tween and return it, but does not add it to this Tween Manager. * - * @method Phaser.Tweens.TweenManager#createTimeline - * @since 3.0.0 + * Please note that a Tween will not manipulate any target property that begins with an underscore. * - * @param {Phaser.Types.Tweens.TimelineBuilderConfig} [config] - The configuration object for the Timeline and its Tweens. + * In order to play this tween, you'll need to add it to a Tween Manager via + * the `TweenManager.existing` method. * - * @return {Phaser.Tweens.Timeline} The created Timeline object. - */ - createTimeline: function (config) - { - return TimelineBuilder(this, config); - }, - - /** - * Create a Tween Timeline and add it to the active Tween list. - * - * @method Phaser.Tweens.TweenManager#timeline - * @since 3.0.0 - * - * @param {Phaser.Types.Tweens.TimelineBuilderConfig} [config] - The configuration object for the Timeline and its Tweens. - * - * @return {Phaser.Tweens.Timeline} The created Timeline object. - */ - timeline: function (config) - { - var timeline = TimelineBuilder(this, config); - - if (!timeline.paused) - { - this._add.push(timeline); - - this._toProcess++; - } - - return timeline; - }, - - /** - * Create a Tween and return it, but do NOT add it to the active or pending Tween lists. + * You can optionally pass an **array** of Tween Configuration objects to this method and it will create + * one Tween per entry in the array. If an array is given, an array of tweens is returned. * * @method Phaser.Tweens.TweenManager#create * @since 3.0.0 * - * @param {Phaser.Types.Tweens.TweenBuilderConfig|object} config - The configuration object for the Tween. + * @param {Phaser.Types.Tweens.TweenBuilderConfig|Phaser.Types.Tweens.TweenBuilderConfig[]|object|object[]} config - A Tween Configuration object. Or an array of Tween Configuration objects. * - * @return {Phaser.Tweens.Tween} The created Tween object. + * @return {Phaser.Tweens.Tween|Phaser.Tweens.Tween[]} The created Tween, or an array of Tweens if an array of tween configs was provided. */ create: function (config) { - return TweenBuilder(this, config); + if (!Array.isArray(config)) + { + config = [ config ]; + } + + var result = []; + + for (var i = 0; i < config.length; i++) + { + var tween = config[i]; + + if (tween instanceof Tween || tween instanceof TweenChain) + { + // Allow them to send an array of mixed instances and configs + result.push(tween); + } + else if (Array.isArray(tween.tweens)) + { + result.push(TweenChainBuilder(this, tween)); + } + else + { + result.push(TweenBuilder(this, tween)); + } + } + + return (result.length === 1) ? result[0] : result; }, /** - * Create a Tween and add it to the active Tween list. + * Create a Tween and add it to this Tween Manager by passing a Tween Configuration object. * - * Please note that a Tween will not manipulate any property that begins with an underscore. + * Example, run from within a Scene: + * + * ```js + * const logo = this.add.image(100, 100, 'logo'); + * + * this.tweens.add({ + * targets: logo, + * x: 600, + * ease: 'Power1', + * duration: 2000 + * }); + * ``` + * + * See the `TweenBuilderConfig` for all of the options you have available. + * + * Playback will start immediately unless the tween has been configured to be paused. + * + * Please note that a Tween will not manipulate any target property that begins with an underscore. + * + * Tweens are designed to be 'fire-and-forget'. They automatically destroy themselves once playback + * is complete, to free-up memory and resources. If you wish to keep a tween after playback, i.e. to + * play it again at a later time, then you should set the `persist` property to `true` in the config. + * However, doing so means it's entirely up to _you_ to destroy the tween when you're finished with it, + * otherwise it will linger in memory forever. + * + * You can optionally pass an **array** of Tween Configuration objects to this method and it will create + * one Tween per entry in the array. If an array is given, an array of tweens is returned. + * + * If you wish to chain Tweens together for sequential playback, see the `TweenManager.chain` method. * * @method Phaser.Tweens.TweenManager#add * @since 3.0.0 * - * @param {Phaser.Types.Tweens.TweenBuilderConfig|object} config - The configuration object for the Tween. + * @param {Phaser.Types.Tweens.TweenBuilderConfig|Phaser.Types.Tweens.TweenBuilderConfig[]|object|object[]} config - A Tween Configuration object. Or an array of Tween Configuration objects. * - * @return {Phaser.Tweens.Tween} The created Tween. + * @return {Phaser.Tweens.Tween|Phaser.Tweens.Tween[]} The created Tween, or an array of Tweens if an array of tween configs was provided. */ add: function (config) { - var tween = TweenBuilder(this, config); + var tween; + var result = []; + var tweens = this.tweens; - this._add.push(tween); + if (!Array.isArray(config)) + { + config = [ config ]; + } - this._toProcess++; + for (var i = 0; i < config.length; i++) + { + tween = config[i]; - return tween; + if (tween instanceof Tween || tween instanceof TweenChain) + { + tweens.push(tween.init()); + } + else + { + if (Array.isArray(tween.tweens)) + { + tween = TweenChainBuilder(this, tween); + } + else + { + tween = TweenBuilder(this, tween); + } + + tweens.push(tween.init()); + } + + result.push(tween); + } + + return (result.length === 1) ? result[0] : result; }, /** - * Add an existing tween into the active Tween list. + * Create a sequence of Tweens, chained to one-another, and add them to this Tween Manager. + * + * The tweens are played in order, from start to finish. You can optionally set the chain + * to repeat as many times as you like. Once the chain has finished playing, or repeating if set, + * all tweens in the chain will be destroyed automatically. To override this, set the 'persists' + * argument to 'true'. + * + * Playback will start immediately unless the _first_ Tween has been configured to be paused. + * + * Please note that Tweens will not manipulate any target property that begins with an underscore. + * + * @method Phaser.Tweens.TweenManager#chain + * @since 3.60.0 + * + * @param {Phaser.Types.Tweens.TweenBuilderConfig[]|object[]} tweens - A Tween Chain configuration object, or an array of them to create multiple chains at once. + * + * @return {(Phaser.Tweens.TweenChain|Phaser.Tweens.TweenChain[])} The Tween Chain instance, or an array of them if you passed in an array of configs. + */ + chain: function (config) + { + if (!Array.isArray(config)) + { + config = [ config ]; + } + + var chain; + var result = []; + var tweens = this.tweens; + + for (var i = 0; i < config.length; i++) + { + chain = TweenChainBuilder(this, config[i]); + + tweens.push(chain.init()); + + result.push(chain); + } + + return (result.length === 1) ? result[0] : result; + }, + + /** + * Returns an array containing this Tween and all Tweens chained to it, + * in the order in which they will be played. + * + * If there are no chained Tweens an empty array is returned. + * + * @method Phaser.Tweens.TweenManager#getChainedTweens + * @since 3.60.0 + * + * @param {Phaser.Tweens.Tween} tween - The Tween to return the chain from. + * + * @return {Phaser.Tweens.Tween[]} An array of the chained tweens, or an empty array if there aren't any. + */ + getChainedTweens: function (tween) + { + return tween.getChainedTweens(); + }, + + /** + * Check to see if the given Tween instance exists within this Tween Manager. + * + * Will return `true` as long as the Tween is being processed by this Tween Manager. + * + * Will return `false` if not present, or has a state of `REMOVED` or `DESTROYED`. + * + * @method Phaser.Tweens.TweenManager#has + * @since 3.60.0 + * + * @param {Phaser.Tweens.Tween} tween - The Tween instance to check. + * + * @return {boolean} `true` if the Tween exists within this Tween Manager, otherwise `false`. + */ + has: function (tween) + { + return (this.tweens.indexOf(tween) > -1); + }, + + /** + * Add an existing Tween to this Tween Manager. + * + * Playback will start immediately unless the tween has been configured to be paused. * * @method Phaser.Tweens.TweenManager#existing * @since 3.0.0 * * @param {Phaser.Tweens.Tween} tween - The Tween to add. * - * @return {Phaser.Tweens.TweenManager} This Tween Manager object. + * @return {this} This Tween Manager instance. */ existing: function (tween) { - this._add.push(tween); - - this._toProcess++; + if (!this.has(tween)) + { + this.tweens.push(tween.init()); + } return this; }, @@ -212439,6 +213197,10 @@ var TweenManager = new Class({ /** * Create a Number Tween and add it to the active Tween list. * + * Playback will start immediately unless the tween has been configured to be paused. + * + * Please note that a Tween will not manipulate any target property that begins with an underscore. + * * @method Phaser.Tweens.TweenManager#addCounter * @since 3.0.0 * @@ -212450,9 +213212,7 @@ var TweenManager = new Class({ { var tween = NumberTweenBuilder(this, config); - this._add.push(tween); - - this._toProcess++; + this.tweens.push(tween.init()); return tween; }, @@ -212504,168 +213264,279 @@ var TweenManager = new Class({ }, /** - * Updates the Tween Manager's internal lists at the start of the frame. + * Set the limits that are used when a browser encounters lag, or delays that cause the elapsed + * time between two frames to exceed the expected amount. If this occurs, the Tween Manager will + * act as if the 'skip' amount of times has passed, in order to maintain strict tween sequencing. * - * This method will return immediately if no changes have been indicated. + * This is enabled by default with the values 500ms for the lag limit and 33ms for the skip. * - * @method Phaser.Tweens.TweenManager#preUpdate - * @since 3.0.0 + * You should not set these to low values, as it won't give time for the browser to ever + * catch-up with itself and reclaim sync. + * + * Call this method with no arguments to disable smoothing. + * + * Call it with the arguments `500` and `33` to reset to the defaults. + * + * @method Phaser.Tweens.TweenManager#setLagSmooth + * @since 3.60.0 + * + * @param {number} [limit=0] - If the browser exceeds this amount, in milliseconds, it will act as if the 'skip' amount has elapsed instead. + * @param {number} [skip=0] - The amount, in milliseconds, to use as the step delta should the browser lag beyond the 'limit'. + * + * @return {this} This Tween Manager instance. */ - preUpdate: function () + setLagSmooth: function (limit, skip) { - if (this._toProcess === 0) - { - // Quick bail - return; - } + if (limit === undefined) { limit = 1 / 1e-8; } + if (skip === undefined) { skip = 0; } - var list = this._destroy; - var active = this._active; - var pending = this._pending; - var i; - var tween; + this.maxLag = limit; + this.lagSkip = Math.min(skip, this.maxLag); - // Clear the 'destroy' list - for (i = 0; i < list.length; i++) - { - tween = list[i]; - - // Remove from the 'active' array - var idx = active.indexOf(tween); - - if (idx === -1) - { - // Not in the active array, is it in pending instead? - idx = pending.indexOf(tween); - - if (idx > -1) - { - tween.state = TWEEN_CONST.REMOVED; - pending.splice(idx, 1); - } - } - else - { - tween.state = TWEEN_CONST.REMOVED; - active.splice(idx, 1); - } - } - - list.length = 0; - - // Process the addition list - // This stops callbacks and out of sync events from populating the active array mid-way during the update - - list = this._add; - - for (i = 0; i < list.length; i++) - { - tween = list[i]; - - if (tween.state === TWEEN_CONST.PENDING_ADD) - { - // Return true if the Tween should be started right away, otherwise false - if (tween.init()) - { - tween.play(); - - this._active.push(tween); - } - else - { - this._pending.push(tween); - } - } - } - - list.length = 0; - - this._toProcess = 0; + return this; }, /** - * Updates all Tweens and Timelines of the Tween Manager. + * Limits the Tween system to run at a particular frame rate. + * + * You should not set this _above_ the frequency of the browser, + * but instead can use it to throttle the frame rate lower, should + * you need to in certain situations. + * + * @method Phaser.Tweens.TweenManager#setFps + * @since 3.60.0 + * + * @param {number} [fps=240] - The frame rate to tick at. + * + * @return {this} This Tween Manager instance. + */ + setFps: function (fps) + { + if (fps === undefined) { fps = 240; } + + this.gap = 1000 / fps; + this.nextTime = this.time * 1000 + this.gap; + + return this; + }, + + /** + * Internal method that calculates the delta value, along with the other timing values, + * and returns the new delta. + * + * You should not typically call this method directly. + * + * @method Phaser.Tweens.TweenManager#getDelta + * @since 3.60.0 + * + * @param {boolean} [tick=false] - Is this a manual tick, or an automated tick? + * + * @return {number} The new delta value. + */ + getDelta: function (tick) + { + var elapsed = Date.now() - this.prevTime; + + if (elapsed > this.maxLag) + { + this.startTime += elapsed - this.lagSkip; + } + + this.prevTime += elapsed; + + var time = this.prevTime - this.startTime; + var overlap = time - this.nextTime; + var delta = time - this.time * 1000; + + if (overlap > 0 || tick) + { + time /= 1000; + this.time = time; + this.nextTime += overlap + (overlap >= this.gap ? 4 : this.gap - overlap); + } + else + { + delta = 0; + } + + return delta; + }, + + /** + * Manually advance the Tween system by one step. + * + * This will update all Tweens even if the Tween Manager is currently + * paused. + * + * @method Phaser.Tweens.TweenManager#tick + * @since 3.60.0 + * + * @return {this} This Tween Manager instance. + */ + tick: function () + { + this.step(true); + + return this; + }, + + /** + * Internal update handler. + * + * Calls `TweenManager.step` as long as the Tween Manager has not + * been paused. * * @method Phaser.Tweens.TweenManager#update * @since 3.0.0 - * - * @param {number} timestamp - The current time in milliseconds. - * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. */ - update: function (timestamp, delta) + update: function () { - // Process active tweens - var list = this._active; + if (!this.paused) + { + this.step(false); + } + }, + + /** + * Updates all Tweens belonging to this Tween Manager. + * + * Called automatically by `update` and `tick`. + * + * @method Phaser.Tweens.TweenManager#step + * @since 3.60.0 + * + * @param {boolean} [tick=false] - Is this a manual tick, or an automated tick? + */ + step: function (tick) + { + if (tick === undefined) { tick = false; } + + var delta = this.getDelta(tick); + + if (delta === 0) + { + return; + } + + this.processing = true; + + var i; var tween; + var toDestroy = []; + var list = this.tweens; - // Scale the delta - delta *= this.timeScale; - - for (var i = 0; i < list.length; i++) + // By not caching the length we can immediately update tweens added + // this frame (such as chained tweens) + for (i = 0; i < list.length; i++) { tween = list[i]; // If Tween.update returns 'true' then it means it has completed, // so move it to the destroy list - if (tween.update(timestamp, delta)) + if (tween.update(delta)) { - this._destroy.push(tween); - this._toProcess++; + toDestroy.push(tween); } } + + // Clean-up the 'toDestroy' list + var count = toDestroy.length; + + if (count && list.length > 0) + { + for (i = 0; i < count; i++) + { + tween = toDestroy[i]; + + var idx = list.indexOf(tween); + + if (idx > -1 && (tween.isPendingRemove() || tween.isDestroyed())) + { + list.splice(idx, 1); + + tween.destroy(); + } + } + + toDestroy.length = 0; + } + + this.processing = false; }, /** - * Removes the given tween from the Tween Manager, regardless of its state (pending or active). + * Removes the given Tween from this Tween Manager, even if it hasn't started + * playback yet. If this method is called while the Tween Manager is processing + * an update loop, then the tween will be flagged for removal at the start of + * the next frame. Otherwise, it is removed immediately. + * + * The removed tween is _not_ destroyed. It is just removed from this Tween Manager. * * @method Phaser.Tweens.TweenManager#remove * @since 3.17.0 * * @param {Phaser.Tweens.Tween} tween - The Tween to be removed. * - * @return {Phaser.Tweens.TweenManager} This Tween Manager object. + * @return {this} This Tween Manager instance. */ remove: function (tween) { - ArrayRemove(this._add, tween); - ArrayRemove(this._pending, tween); - ArrayRemove(this._active, tween); - ArrayRemove(this._destroy, tween); + if (this.processing) + { + // Remove it on the next frame + tween.setPendingRemoveState(); + } + else + { + // Remove it immediately + ArrayRemove(this.tweens, tween); - tween.state = TWEEN_CONST.REMOVED; + tween.setRemovedState(); + } return this; }, /** - * Checks if a Tween or Timeline is active and adds it to the Tween Manager at the start of the frame if it isn't. + * Resets the given Tween. + * + * If the Tween does not belong to this Tween Manager, it will first be added. + * + * Then it will seek to position 0 and playback will start on the next frame. + * + * @method Phaser.Tweens.TweenManager#reset + * @since 3.60.0 + * + * @param {Phaser.Tweens.Tween} tween - The Tween to be reset. + * + * @return {this} This Tween Manager instance. + */ + reset: function (tween) + { + this.existing(tween); + + tween.seek(); + + tween.setActiveState(); + + return this; + }, + + /** + * Checks if a Tween is active and adds it to the Tween Manager at the start of the frame if it isn't. * * @method Phaser.Tweens.TweenManager#makeActive * @since 3.0.0 * * @param {Phaser.Tweens.Tween} tween - The Tween to check. * - * @return {Phaser.Tweens.TweenManager} This Tween Manager object. + * @return {this} This Tween Manager instance. */ makeActive: function (tween) { - if (this._add.indexOf(tween) !== -1 || this._active.indexOf(tween) !== -1) - { - return this; - } + this.existing(tween); - var idx = this._pending.indexOf(tween); - - if (idx !== -1) - { - this._pending.splice(idx, 1); - } - - this._add.push(tween); - - tween.state = TWEEN_CONST.PENDING_ADD; - - this._toProcess++; + tween.setActiveState(); return this; }, @@ -212679,47 +213550,89 @@ var TweenManager = new Class({ * @param {function} callback - The function to call. * @param {object} [scope] - The scope (`this` object) to call the function with. * @param {...*} [args] - The arguments to pass into the function. Its first argument will always be the Tween currently being iterated. + * + * @return {this} This Tween Manager instance. */ each: function (callback, scope) { + var i; var args = [ null ]; - for (var i = 1; i < arguments.length; i++) + for (i = 1; i < arguments.length; i++) { args.push(arguments[i]); } - for (var texture in this.list) + this.tweens.forEach(function (tween) { - args[0] = this.list[texture]; + args[0] = tween; callback.apply(scope, args); - } + }); + + return this; }, /** - * Returns an array of all active Tweens and Timelines in the Tween Manager. + * Returns an array containing references to all Tweens in this Tween Manager. * - * @method Phaser.Tweens.TweenManager#getAllTweens + * It is safe to mutate the returned array. However, acting upon any of the Tweens + * within it, will adjust those stored in this Tween Manager, as they are passed + * by reference and not cloned. + * + * If you wish to get tweens for a specific target, see `getTweensOf`. + * + * @method Phaser.Tweens.TweenManager#getTweens * @since 3.0.0 * - * @return {Phaser.Tweens.Tween[]} A new array containing references to all active Tweens and Timelines. + * @return {Phaser.Tweens.Tween[]} A new array containing references to all Tweens. */ - getAllTweens: function () + getTweens: function () + { + return this.tweens.slice(); + }, + + /** + * Returns an array of all Tweens in the Tween Manager which affect the given target, or array of targets. + * + * It's possible for this method to return tweens that are about to be removed from + * the Tween Manager. You should check the state of the returned tween before acting + * upon it. + * + * @method Phaser.Tweens.TweenManager#getTweensOf + * @since 3.0.0 + * + * @param {object|array} target - The target to look for. Provide an array to look for multiple targets. + * + * @return {Phaser.Tweens.Tween[]} A new array containing all Tweens which affect the given target(s). + */ + getTweensOf: function (target) { - var list = this._active; var output = []; + var list = this.tweens; + + target = Flatten(target); + + var targetLen = target.length; for (var i = 0; i < list.length; i++) { - output.push(list[i]); + var tween = list[i]; + + for (var t = 0; t < targetLen; t++) + { + if (tween.hasTarget(target[t])) + { + output.push(tween); + } + } } return output; }, /** - * Returns the scale of the time delta for all Tweens and Timelines owned by this Tween Manager. + * Returns the scale of the time delta for all Tweens owned by this Tween Manager. * * @method Phaser.Tweens.TweenManager#getGlobalTimeScale * @since 3.0.0 @@ -212731,183 +213644,6 @@ var TweenManager = new Class({ return this.timeScale; }, - /** - * Returns an array of all Tweens or Timelines in the Tween Manager which affect the given target or array of targets. - * - * Only the currently active tweens are tested. A tween that has completed and is - * awaiting removal will not be included in the results. - * - * If you wish to also search pending tweens, use the `includePending` flag. - * - * @method Phaser.Tweens.TweenManager#getTweensOf - * @since 3.0.0 - * - * @param {(object|array)} target - The target to look for. Provide an array to look for multiple targets. - * @param {boolean} [includePending=false] - Also check for pending tweens, not just active ones? - * - * @return {Phaser.Tweens.Tween[]} A new array containing all Tweens and Timelines which affect the given target(s). - */ - getTweensOf: function (target, includePending) - { - if (includePending === undefined) { includePending = false; } - - var list = this._active; - var tween; - var output = []; - var i; - var t; - - if (!Array.isArray(target)) - { - target = [ target ]; - } - - for (i = 0; i < list.length; i++) - { - tween = list[i]; - - for (t = 0; t < target.length; t++) - { - if (tween.hasTarget(target[t])) - { - output.push(tween); - } - } - } - - if (includePending) - { - list = this._pending; - - for (i = 0; i < list.length; i++) - { - tween = list[i]; - - for (t = 0; t < target.length; t++) - { - if (tween.hasTarget(target[t])) - { - output.push(tween); - } - } - } - } - - return output; - }, - - /** - * Checks if the given object is being affected by a playing Tween. - * - * @method Phaser.Tweens.TweenManager#isTweening - * @since 3.0.0 - * - * @param {object} target - target Phaser.Tweens.Tween object - * - * @return {boolean} returns if target tween object is active or not - */ - isTweening: function (target) - { - var list = this._active; - var tween; - - for (var i = 0; i < list.length; i++) - { - tween = list[i]; - - if (tween.hasTarget(target) && tween.isPlaying()) - { - return true; - } - } - - return false; - }, - - /** - * Stops all Tweens in this Tween Manager. They will be removed at the start of the frame. - * - * @method Phaser.Tweens.TweenManager#killAll - * @since 3.0.0 - * - * @return {Phaser.Tweens.TweenManager} This Tween Manager. - */ - killAll: function () - { - var tweens = this.getAllTweens(); - - for (var i = 0; i < tweens.length; i++) - { - tweens[i].stop(); - } - - return this; - }, - - /** - * Stops all Tweens which affect the given target or array of targets. The Tweens will be removed from the Tween Manager at the start of the frame. - * - * @see {@link #getTweensOf} - * - * @method Phaser.Tweens.TweenManager#killTweensOf - * @since 3.0.0 - * - * @param {(object|array)} target - The target to look for. Provide an array to look for multiple targets. - * - * @return {Phaser.Tweens.TweenManager} This Tween Manager. - */ - killTweensOf: function (target) - { - var tweens = this.getTweensOf(target); - - for (var i = 0; i < tweens.length; i++) - { - tweens[i].stop(); - } - - return this; - }, - - /** - * Pauses all Tweens in this Tween Manager. - * - * @method Phaser.Tweens.TweenManager#pauseAll - * @since 3.0.0 - * - * @return {Phaser.Tweens.TweenManager} This Tween Manager. - */ - pauseAll: function () - { - var list = this._active; - - for (var i = 0; i < list.length; i++) - { - list[i].pause(); - } - - return this; - }, - - /** - * Resumes all Tweens in this Tween Manager. - * - * @method Phaser.Tweens.TweenManager#resumeAll - * @since 3.0.0 - * - * @return {Phaser.Tweens.TweenManager} This Tween Manager. - */ - resumeAll: function () - { - var list = this._active; - - for (var i = 0; i < list.length; i++) - { - list[i].resume(); - } - - return this; - }, - /** * Sets a new scale of the time delta for this Tween Manager. * @@ -212918,7 +213654,7 @@ var TweenManager = new Class({ * * @param {number} value - The new scale of the time delta, where 1 is the normal speed. * - * @return {Phaser.Tweens.TweenManager} This Tween Manager. + * @return {this} This Tween Manager instance. */ setGlobalTimeScale: function (value) { @@ -212927,8 +213663,144 @@ var TweenManager = new Class({ return this; }, + /** + * Checks if the given object is being affected by a _playing_ Tween. + * + * If the Tween is paused, this method will return false. + * + * @method Phaser.Tweens.TweenManager#isTweening + * @since 3.0.0 + * + * @param {object} target - The object to check if a tween is active for it, or not. + * + * @return {boolean} Returns `true` if a tween is active on the given target, otherwise `false`. + */ + isTweening: function (target) + { + var list = this.tweens; + var tween; + + for (var i = 0; i < list.length; i++) + { + tween = list[i]; + + if (tween.isPlaying() && tween.hasTarget(target)) + { + return true; + } + } + + return false; + }, + + /** + * Destroys all Tweens in this Tween Manager. + * + * The tweens will erase all references to any targets they hold + * and be stopped immediately. + * + * If this method is called while the Tween Manager is running its + * update process, then the tweens will be removed at the start of + * the next frame. Outside of this, they are removed immediately. + * + * @method Phaser.Tweens.TweenManager#killAll + * @since 3.0.0 + * + * @return {this} This Tween Manager instance. + */ + killAll: function () + { + var tweens = (this.processing) ? this.getAllTweens() : this.tweens; + + for (var i = 0; i < tweens.length; i++) + { + tweens[i].destroy(); + } + + if (!this.processing) + { + tweens.length = 0; + } + + return this; + }, + + /** + * Stops all Tweens which affect the given target or array of targets. + * + * The tweens will erase all references to any targets they hold + * and be stopped immediately. + * + * If this method is called while the Tween Manager is running its + * update process, then the tweens will be removed at the start of + * the next frame. Outside of this, they are removed immediately. + * + * @see {@link #getTweensOf} + * + * @method Phaser.Tweens.TweenManager#killTweensOf + * @since 3.0.0 + * + * @param {(object|array)} target - The target to kill the tweens of. Provide an array to use multiple targets. + * + * @return {this} This Tween Manager instance. + */ + killTweensOf: function (target) + { + var tweens = this.getTweensOf(target); + + for (var i = 0; i < tweens.length; i++) + { + tweens[i].destroy(); + } + + return this; + }, + + /** + * Pauses this Tween Manager. No Tweens will update while paused. + * + * This includes tweens created after this method was called. + * + * See `TweenManager#resumeAll` to resume the playback. + * + * As of Phaser 3.60 you can also toggle the boolean property `TweenManager.paused`. + * + * @method Phaser.Tweens.TweenManager#pauseAll + * @since 3.0.0 + * + * @return {this} This Tween Manager instance. + */ + pauseAll: function () + { + this.paused = true; + + return this; + }, + + /** + * Resumes playback of this Tween Manager. + * + * All active Tweens will continue updating. + * + * See `TweenManager#pauseAll` to pause the playback. + * + * As of Phaser 3.60 you can also toggle the boolean property `TweenManager.paused`. + * + * @method Phaser.Tweens.TweenManager#resumeAll + * @since 3.0.0 + * + * @return {this} This Tween Manager instance. + */ + resumeAll: function () + { + this.paused = false; + + return this; + }, + /** * The Scene that owns this plugin is shutting down. + * * We need to kill and reset all internal properties as well as stop listening to Scene events. * * @method Phaser.Tweens.TweenManager#shutdown @@ -212938,16 +213810,10 @@ var TweenManager = new Class({ { this.killAll(); - this._add = []; - this._pending = []; - this._active = []; - this._destroy = []; - - this._toProcess = 0; + this.tweens = []; var eventEmitter = this.systems.events; - eventEmitter.off(SceneEvents.PRE_UPDATE, this.preUpdate, this); eventEmitter.off(SceneEvents.UPDATE, this.update, this); eventEmitter.off(SceneEvents.SHUTDOWN, this.shutdown, this); }, @@ -212983,7 +213849,7 @@ module.exports = TweenManager; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -212995,9 +213861,9 @@ module.exports = TweenManager; * * @param {object} source - The object to retrieve the value from. * @param {string} key - The key to look for in the `source` object. - * @param {*} defaultValue - The default value to return if the `key` doesn't exist or if no `source` object is provided. + * @param {boolean} defaultValue - The default value to return if the `key` doesn't exist or if no `source` object is provided. * - * @return {*} The retrieved value. + * @return {boolean} The retrieved value. */ var GetBoolean = function (source, key, defaultValue) { @@ -213025,7 +213891,7 @@ module.exports = GetBoolean; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -213034,7 +213900,7 @@ var UppercaseFirst = __webpack_require__(40587); /** * This internal function is used to return the correct ease function for a Tween. - * + * * It can take a variety of input, including an EaseMap based string, or a custom function. * * @function Phaser.Tweens.Builders.GetEaseFunction @@ -213071,23 +213937,25 @@ var GetEaseFunction = function (ease, easeParams) // quad.out = Quad.easeOut // quad.inout = Quad.easeInOut - direction = ease.substr(ease.indexOf('.') + 1); + direction = ease.substring(ease.indexOf('.') + 1); - if (direction.toLowerCase() === 'in') + var directionLower = direction.toLowerCase(); + + if (directionLower === 'in') { direction = 'easeIn'; } - else if (direction.toLowerCase() === 'out') + else if (directionLower === 'out') { direction = 'easeOut'; } - else if (direction.toLowerCase() === 'inout') + else if (directionLower === 'inout') { direction = 'easeInOut'; } } - ease = UppercaseFirst(ease.substr(0, ease.indexOf('.') + 1) + direction); + ease = UppercaseFirst(ease.substring(0, ease.indexOf('.') + 1) + direction); if (EaseMap.hasOwnProperty(ease)) { @@ -213100,10 +213968,6 @@ var GetEaseFunction = function (ease, easeParams) // Custom function easeFunction = ease; } - else if (Array.isArray(ease) && ease.length === 4) - { - // Bezier function (TODO) - } // No custom ease parameters? if (!easeParams) @@ -213128,6 +213992,74 @@ var GetEaseFunction = function (ease, easeParams) module.exports = GetEaseFunction; +/***/ }), + +/***/ 4840: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Bezier = __webpack_require__(63210); +var CatmullRom = __webpack_require__(88332); +var Linear = __webpack_require__(47614); + +var FuncMap = { + bezier: Bezier, + catmull: CatmullRom, + catmullrom: CatmullRom, + linear: Linear +}; + +/** + * This internal function is used to return the correct interpolation function for a Tween. + * + * It can take a variety of input, including a string, or a custom function. + * + * @function Phaser.Tweens.Builders.GetInterpolationFunction + * @since 3.60.0 + * + * @param {(string|function|null)} interpolation - The interpolation function to find. This can be either a string, or a custom function, or null. + * + * @return {?function} The interpolation function to use, or `null`. + */ +var GetInterpolationFunction = function (interpolation) +{ + if (interpolation === null) + { + return null; + } + + // Default interpolation function + var interpolationFunction = FuncMap.linear; + + // Prepare interpolation function + if (typeof interpolation === 'string') + { + // String based look-up + + // 1) They specified it correctly + if (FuncMap.hasOwnProperty(interpolation)) + { + interpolationFunction = FuncMap[interpolation]; + } + } + else if (typeof interpolation === 'function') + { + // Custom function + interpolationFunction = interpolation; + } + + // Return interpolation function + return interpolationFunction; +}; + +module.exports = GetInterpolationFunction; + + /***/ }), /***/ 28348: @@ -213135,7 +214067,7 @@ module.exports = GetEaseFunction; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -213150,7 +214082,7 @@ module.exports = GetEaseFunction; * @param {string} key - The property to get from the source. * @param {any} defaultValue - A default value to return should the source not have the property set. * - * @return {function} A function which when called will return the property value from the source. + * @return {function} A function which, when called, will return the property value from the source. */ var GetNewValue = function (source, key, defaultValue) { @@ -213200,7 +214132,7 @@ module.exports = GetNewValue; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -213231,7 +214163,7 @@ var GetProps = function (config) for (key in config.props) { // Skip any property that starts with an underscore - if (key.substr(0, 1) !== '_') + if (key.substring(0, 1) !== '_') { keys.push({ key: key, value: config.props[key] }); } @@ -213242,7 +214174,7 @@ var GetProps = function (config) for (key in config) { // Skip any property that is in the ReservedProps list or that starts with an underscore - if (RESERVED.indexOf(key) === -1 && key.substr(0, 1) !== '_') + if (RESERVED.indexOf(key) === -1 && key.substring(0, 1) !== '_') { keys.push({ key: key, value: config[key] }); } @@ -213262,7 +214194,7 @@ module.exports = GetProps; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -213307,63 +214239,17 @@ module.exports = GetTargets; /***/ }), -/***/ 10365: +/***/ 9744: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetValue = __webpack_require__(10850); - -/** - * Internal function used by the Timeline Builder. - * - * It returns an array of all tweens in the given timeline config. - * - * @function Phaser.Tweens.Builders.GetTweens - * @since 3.0.0 - * - * @param {Phaser.Types.Tweens.TimelineBuilderConfig} config - The configuration object for the Timeline. - * - * @return {Phaser.Tweens.Tween[]} An array of Tween instances that the Timeline will manage. - */ -var GetTweens = function (config) -{ - var tweens = GetValue(config, 'tweens', null); - - if (tweens === null) - { - return []; - } - else if (typeof tweens === 'function') - { - tweens = tweens.call(); - } - - if (!Array.isArray(tweens)) - { - tweens = [ tweens ]; - } - - return tweens; -}; - -module.exports = GetTweens; - - -/***/ }), - -/***/ 9744: -/***/ ((module) => { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ +var Between = __webpack_require__(17489); +var FloatBetween = __webpack_require__(61616); /** * @ignore @@ -213399,7 +214285,7 @@ function hasGetters (def) /** * Returns `getActive`, `getStart` and `getEnd` functions for a TweenData based on a target property and end value. - * + * * `getActive` if not null, is invoked _immediately_ as soon as the TweenData is running, and is set on the target property. * `getEnd` is invoked once any start delays have expired and returns what the value should tween to. * `getStart` is invoked when the tween reaches the end and needs to either repeat or yoyo, it returns the value to go back to. @@ -213408,11 +214294,11 @@ function hasGetters (def) * A string can be provided to specify a relative end value which consists of an operation * (`+=` to add to the current value, `-=` to subtract from the current value, `*=` to multiply the current * value, or `/=` to divide the current value) followed by its operand. - * + * * A function can be provided to allow greater control over the end value; it will receive the target * object being tweened, the name of the property being tweened, and the current value of the property - * as its arguments. - * + * as its arguments and must return a value. + * * If both the starting and the ending values need to be controlled, an object with `getStart` and `getEnd` * callbacks, which will receive the same arguments, can be provided instead. If an object with a `value` * property is provided, the property will be used as the effective value under the same rules described here. @@ -213452,53 +214338,112 @@ var GetValueOp = function (key, propertyValue) return propertyValue; }; } + else if (Array.isArray(propertyValue)) + { + // props: { + // x: [ 400, 300, 200 ], + // y: [ 10, 500, 10 ] + // } + + getStart = function () + { + return propertyValue[0]; + }; + + getEnd = function () + { + return propertyValue[propertyValue.length - 1]; + }; + } else if (t === 'string') { // props: { // x: '+=400', // y: '-=300', // z: '*=2', - // w: '/=2' + // w: '/=2', + // p: 'random(10, 100)' - random float + // p: 'int(10, 100)' - random int // } - var op = propertyValue[0]; - var num = parseFloat(propertyValue.substr(2)); + var op = propertyValue.toLowerCase(); + var isRandom = (op.substring(0, 6) === 'random'); + var isInt = (op.substring(0, 3) === 'int'); - switch (op) + if (isRandom || isInt) { - case '+': - getEnd = function (target, key, value) - { - return value + num; - }; - break; + // random(0.5, 3.45) + // int(10, 100) + var brace1 = op.indexOf('('); + var brace2 = op.indexOf(')'); + var comma = op.indexOf(','); - case '-': - getEnd = function (target, key, value) - { - return value - num; - }; - break; + if (brace1 && brace2 && comma) + { + var value1 = parseFloat(op.substring(brace1 + 1, comma)); + var value2 = parseFloat(op.substring(comma + 1, brace2)); - case '*': - getEnd = function (target, key, value) + if (isRandom) { - return value * num; - }; - break; + getEnd = function () + { + return FloatBetween(value1, value2); + }; + } + else + { + getEnd = function () + { + return Between(value1, value2); + }; + } + } + else + { + throw new Error('invalid random() format'); + } + } + else + { + op = op[0]; + var num = parseFloat(propertyValue.substr(2)); - case '/': - getEnd = function (target, key, value) - { - return value / num; - }; - break; + switch (op) + { + case '+': + getEnd = function (target, key, value) + { + return value + num; + }; + break; - default: - getEnd = function () - { - return parseFloat(propertyValue); - }; + case '-': + getEnd = function (target, key, value) + { + return value - num; + }; + break; + + case '*': + getEnd = function (target, key, value) + { + return value * num; + }; + break; + + case '/': + getEnd = function (target, key, value) + { + return value / num; + }; + break; + + default: + getEnd = function () + { + return parseFloat(propertyValue); + }; + } } } else if (t === 'function') @@ -213506,7 +214451,7 @@ var GetValueOp = function (key, propertyValue) // The same as setting just the getEnd function and no getStart // props: { - // x: function (target, key, value, targetIndex, totalTargets, tween) { return value + 50); }, + // x: function (target, key, value, targetIndex, totalTargets, tween, tweenData) { return value + 50); }, // } getEnd = propertyValue; @@ -213518,19 +214463,19 @@ var GetValueOp = function (key, propertyValue) /* x: { // Called the moment Tween is active. The returned value sets the property on the target immediately. - getActive: function (target, key, value, targetIndex, totalTargets, tween) + getActive: function (target, key, value, targetIndex, totalTargets, tween, tweenData) { return value; }, // Called at the start of the Tween. The returned value sets what the property will be at the END of the Tween. - getEnd: function (target, key, value, targetIndex, totalTargets, tween) + getEnd: function (target, key, value, targetIndex, totalTargets, tween, tweenData) { return value; }, // Called at the end of the Tween. The returned value sets what the property will be at the START of the Tween. - getStart: function (target, key, value, targetIndex, totalTargets, tween) + getStart: function (target, key, value, targetIndex, totalTargets, tween, tweenData) { return value; } @@ -213593,14 +214538,14 @@ var GetValueOp = function (key, propertyValue) if (hasStart) { var startCallbacks = GetValueOp(key, propertyValue.start); - + callbacks.getActive = startCallbacks.getEnd; } - + if (hasFrom) { var fromCallbacks = GetValueOp(key, propertyValue.from); - + callbacks.getStart = fromCallbacks.getEnd; } } @@ -213630,10 +214575,11 @@ module.exports = GetValueOp; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var BaseTween = __webpack_require__(502); var Defaults = __webpack_require__(99730); var GetAdvancedValue = __webpack_require__(20494); var GetBoolean = __webpack_require__(63130); @@ -213641,8 +214587,8 @@ var GetEaseFunction = __webpack_require__(21902); var GetNewValue = __webpack_require__(28348); var GetValue = __webpack_require__(10850); var GetValueOp = __webpack_require__(9744); +var MergeRight = __webpack_require__(72066); var Tween = __webpack_require__(39366); -var TweenData = __webpack_require__(15718); /** * Creates a new Number Tween. @@ -213650,7 +214596,7 @@ var TweenData = __webpack_require__(15718); * @function Phaser.Tweens.Builders.NumberTweenBuilder * @since 3.0.0 * - * @param {(Phaser.Tweens.TweenManager|Phaser.Tweens.Timeline)} parent - The owner of the new Tween. + * @param {Phaser.Tweens.TweenManager} parent - The owner of the new Tween. * @param {Phaser.Types.Tweens.NumberTweenBuilderConfig} config - Configuration for the new Tween. * @param {Phaser.Types.Tweens.TweenConfigDefaults} defaults - Tween configuration defaults. * @@ -213658,10 +214604,21 @@ var TweenData = __webpack_require__(15718); */ var NumberTweenBuilder = function (parent, config, defaults) { + if (config instanceof Tween) + { + config.parent = parent; + + return config; + } + if (defaults === undefined) { defaults = Defaults; } + else + { + defaults = MergeRight(Defaults, defaults); + } // var tween = this.tweens.addCounter({ // from: 100, @@ -213678,56 +214635,46 @@ var NumberTweenBuilder = function (parent, config, defaults) var targets = [ { value: from } ]; - var delay = GetNewValue(config, 'delay', defaults.delay); - var duration = GetNewValue(config, 'duration', defaults.duration); + var delay = GetValue(config, 'delay', defaults.delay); var easeParams = GetValue(config, 'easeParams', defaults.easeParams); - var ease = GetEaseFunction(GetValue(config, 'ease', defaults.ease), easeParams); - var hold = GetNewValue(config, 'hold', defaults.hold); - var repeat = GetNewValue(config, 'repeat', defaults.repeat); - var repeatDelay = GetNewValue(config, 'repeatDelay', defaults.repeatDelay); - var yoyo = GetBoolean(config, 'yoyo', defaults.yoyo); - - var data = []; + var ease = GetValue(config, 'ease', defaults.ease); var ops = GetValueOp('value', to); - var tweenData = TweenData( - targets[0], + var tween = new Tween(parent, targets); + + // TODO - Needs tidying up + easeParams being used, etc + + var tweenData = tween.add( 0, 'value', ops.getEnd, ops.getStart, ops.getActive, - ease, - delay, - duration, - yoyo, - hold, - repeat, - repeatDelay, + GetEaseFunction(GetValue(config, 'ease', ease), GetValue(config, 'easeParams', easeParams)), + GetNewValue(config, 'delay', delay), + GetValue(config, 'duration', defaults.duration), + GetBoolean(config, 'yoyo', defaults.yoyo), + GetValue(config, 'hold', defaults.hold), + GetValue(config, 'repeat', defaults.repeat), + GetValue(config, 'repeatDelay', defaults.repeatDelay), false, false ); tweenData.start = from; tweenData.current = from; - tweenData.to = to; - data.push(tweenData); - - var tween = new Tween(parent, data, targets); - - tween.offset = GetAdvancedValue(config, 'offset', null); tween.completeDelay = GetAdvancedValue(config, 'completeDelay', 0); tween.loop = Math.round(GetAdvancedValue(config, 'loop', 0)); tween.loopDelay = Math.round(GetAdvancedValue(config, 'loopDelay', 0)); tween.paused = GetBoolean(config, 'paused', false); - tween.useFrames = GetBoolean(config, 'useFrames', false); + tween.persist = GetBoolean(config, 'persist', false); // Set the Callbacks - var scope = GetValue(config, 'callbackScope', tween); + tween.callbackScope = GetValue(config, 'callbackScope', tween); - var callbacks = Tween.TYPES; + var callbacks = BaseTween.TYPES; for (var i = 0; i < callbacks.length; i++) { @@ -213737,10 +214684,9 @@ var NumberTweenBuilder = function (parent, config, defaults) if (callback) { - var callbackScope = GetValue(config, type + 'Scope', scope); var callbackParams = GetValue(config, type + 'Params', []); - tween.setCallback(type, callback, callbackParams, callbackScope); + tween.setCallback(type, callback, callbackParams); } } @@ -213757,7 +214703,7 @@ module.exports = NumberTweenBuilder; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -213767,14 +214713,14 @@ var MATH_CONST = __webpack_require__(83392); /** * Creates a Stagger function to be used by a Tween property. - * + * * The stagger function will allow you to stagger changes to the value of the property across all targets of the tween. - * + * * This is only worth using if the tween has multiple targets. - * + * * The following will stagger the delay by 100ms across all targets of the tween, causing them to scale down to 0.2 * over the duration specified: - * + * * ```javascript * this.tweens.add({ * targets: [ ... ], @@ -213784,10 +214730,10 @@ var MATH_CONST = __webpack_require__(83392); * delay: this.tweens.stagger(100) * }); * ``` - * + * * The following will stagger the delay by 500ms across all targets of the tween using a 10 x 6 grid, staggering * from the center out, using a cubic ease. - * + * * ```javascript * this.tweens.add({ * targets: [ ... ], @@ -213835,7 +214781,7 @@ var StaggerBuilder = function (value, options) if (grid) { - // Pre-calc the grid to save doing it for ever tweendata update + // Pre-calc the grid to save doing it for every TweenData update var gridWidth = grid[0]; var gridHeight = grid[1]; @@ -213895,18 +214841,18 @@ var StaggerBuilder = function (value, options) var gridSpace = 0; var toX = index % gridWidth; var toY = Math.floor(index / gridWidth); - + if (toX >= 0 && toX < gridWidth && toY >= 0 && toY < gridHeight) { gridSpace = gridValues[toY][toX]; } var output; - + if (isRange) { var diff = (value2 - value1); - + if (easeFunction) { output = ((gridSpace / gridMax) * diff) * easeFunction(gridSpace / gridMax); @@ -213934,9 +214880,9 @@ var StaggerBuilder = function (value, options) { // zero offset total--; - + var fromIndex; - + if (fromFirst) { fromIndex = index; @@ -213953,9 +214899,9 @@ var StaggerBuilder = function (value, options) { fromIndex = Math.abs(from - index); } - + var output; - + if (isRange) { var spacing; @@ -213968,7 +214914,7 @@ var StaggerBuilder = function (value, options) { spacing = ((value2 - value1) / total) * fromIndex; } - + if (easeFunction) { output = spacing * easeFunction(fromIndex / total); @@ -213986,7 +214932,7 @@ var StaggerBuilder = function (value, options) { output = fromIndex * value1; } - + return output + start; }; } @@ -213997,158 +214943,6 @@ var StaggerBuilder = function (value, options) module.exports = StaggerBuilder; -/***/ }), - -/***/ 32981: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Clone = __webpack_require__(32742); -var Defaults = __webpack_require__(99730); -var GetAdvancedValue = __webpack_require__(20494); -var GetBoolean = __webpack_require__(63130); -var GetEaseFunction = __webpack_require__(21902); -var GetNewValue = __webpack_require__(28348); -var GetTargets = __webpack_require__(65868); -var GetTweens = __webpack_require__(10365); -var GetValue = __webpack_require__(10850); -var Timeline = __webpack_require__(28860); -var TweenBuilder = __webpack_require__(68061); - -/** - * Builds a Timeline of Tweens based on a configuration object. - * - * @function Phaser.Tweens.Builders.TimelineBuilder - * @since 3.0.0 - * - * @param {Phaser.Tweens.TweenManager} manager - The Tween Manager to which the Timeline will belong. - * @param {Phaser.Types.Tweens.TimelineBuilderConfig} config - The configuration object for the Timeline. - * - * @return {Phaser.Tweens.Timeline} The created Timeline. - */ -var TimelineBuilder = function (manager, config) -{ - var timeline = new Timeline(manager); - - timeline.completeDelay = GetAdvancedValue(config, 'completeDelay', 0); - timeline.loop = Math.round(GetAdvancedValue(config, 'loop', 0)); - timeline.loopDelay = Math.round(GetAdvancedValue(config, 'loopDelay', 0)); - timeline.paused = GetBoolean(config, 'paused', false); - timeline.useFrames = GetBoolean(config, 'useFrames', false); - - // Callbacks - - var scope = GetValue(config, 'callbackScope', timeline); - var onStart = GetValue(config, 'onStart', false); - - // The Start of the Timeline - if (onStart) - { - var onStartScope = GetValue(config, 'onStartScope', scope); - var onStartParams = GetValue(config, 'onStartParams', []); - - timeline.setCallback('onStart', onStart, onStartParams, onStartScope); - } - - var onUpdate = GetValue(config, 'onUpdate', false); - - // Every time the Timeline updates (regardless which Tweens are running) - if (onUpdate) - { - var onUpdateScope = GetValue(config, 'onUpdateScope', scope); - var onUpdateParams = GetValue(config, 'onUpdateParams', []); - - timeline.setCallback('onUpdate', onUpdate, onUpdateParams, onUpdateScope); - } - - var onLoop = GetValue(config, 'onLoop', false); - - // Called when the whole Timeline loops - if (onLoop) - { - var onLoopScope = GetValue(config, 'onLoopScope', scope); - var onLoopParams = GetValue(config, 'onLoopParams', []); - - timeline.setCallback('onLoop', onLoop, onLoopParams, onLoopScope); - } - - var onYoyo = GetValue(config, 'onYoyo', false); - - // Called when a Timeline yoyos - if (onYoyo) - { - var onYoyoScope = GetValue(config, 'onYoyoScope', scope); - var onYoyoParams = GetValue(config, 'onYoyoParams', []); - - timeline.setCallback('onYoyo', onYoyo, onYoyoParams, onYoyoScope); - } - - var onComplete = GetValue(config, 'onComplete', false); - - // Called when the Timeline completes, after the completeDelay, etc. - if (onComplete) - { - var onCompleteScope = GetValue(config, 'onCompleteScope', scope); - var onCompleteParams = GetValue(config, 'onCompleteParams', []); - - timeline.setCallback('onComplete', onComplete, onCompleteParams, onCompleteScope); - } - - // Tweens - - var tweens = GetTweens(config); - - if (tweens.length === 0) - { - timeline.paused = true; - - return timeline; - } - - var defaults = Clone(Defaults); - - defaults.targets = GetTargets(config); - - // totalDuration: If specified each tween in the Timeline is given an equal portion of the totalDuration - - var totalDuration = GetAdvancedValue(config, 'totalDuration', 0); - - if (totalDuration > 0) - { - defaults.duration = Math.floor(totalDuration / tweens.length); - } - else - { - defaults.duration = GetNewValue(config, 'duration', defaults.duration); - } - - defaults.delay = GetNewValue(config, 'delay', defaults.delay); - defaults.easeParams = GetValue(config, 'easeParams', defaults.easeParams); - defaults.ease = GetEaseFunction(GetValue(config, 'ease', defaults.ease), defaults.easeParams); - defaults.hold = GetNewValue(config, 'hold', defaults.hold); - defaults.repeat = GetNewValue(config, 'repeat', defaults.repeat); - defaults.repeatDelay = GetNewValue(config, 'repeatDelay', defaults.repeatDelay); - defaults.yoyo = GetBoolean(config, 'yoyo', defaults.yoyo); - defaults.flipX = GetBoolean(config, 'flipX', defaults.flipX); - defaults.flipY = GetBoolean(config, 'flipY', defaults.flipY); - - // Create the Tweens - for (var i = 0; i < tweens.length; i++) - { - timeline.queue(TweenBuilder(timeline, tweens[i], defaults)); - } - - return timeline; -}; - -module.exports = TimelineBuilder; - - /***/ }), /***/ 68061: @@ -214156,21 +214950,23 @@ module.exports = TimelineBuilder; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var BaseTween = __webpack_require__(502); var Defaults = __webpack_require__(99730); var GetAdvancedValue = __webpack_require__(20494); var GetBoolean = __webpack_require__(63130); var GetEaseFunction = __webpack_require__(21902); +var GetInterpolationFunction = __webpack_require__(4840); var GetNewValue = __webpack_require__(28348); var GetProps = __webpack_require__(92407); var GetTargets = __webpack_require__(65868); var GetValue = __webpack_require__(10850); var GetValueOp = __webpack_require__(9744); +var MergeRight = __webpack_require__(72066); var Tween = __webpack_require__(39366); -var TweenData = __webpack_require__(15718); /** * Creates a new Tween. @@ -214178,7 +214974,7 @@ var TweenData = __webpack_require__(15718); * @function Phaser.Tweens.Builders.TweenBuilder * @since 3.0.0 * - * @param {(Phaser.Tweens.TweenManager|Phaser.Tweens.Timeline)} parent - The owner of the new Tween. + * @param {Phaser.Tweens.TweenManager} parent - The owner of the new Tween. * @param {Phaser.Types.Tweens.TweenBuilderConfig|object} config - Configuration for the new Tween. * @param {Phaser.Types.Tweens.TweenConfigDefaults} defaults - Tween configuration defaults. * @@ -214186,30 +214982,110 @@ var TweenData = __webpack_require__(15718); */ var TweenBuilder = function (parent, config, defaults) { + if (config instanceof Tween) + { + config.parent = parent; + + return config; + } + if (defaults === undefined) { defaults = Defaults; } + else + { + defaults = MergeRight(Defaults, defaults); + } // Create arrays of the Targets and the Properties - var targets = (defaults.targets) ? defaults.targets : GetTargets(config); + var targets = GetTargets(config); + + if (!targets && defaults.targets) + { + targets = defaults.targets; + } - // var props = (defaults.props) ? defaults.props : GetProps(config); var props = GetProps(config); // Default Tween values - var delay = GetNewValue(config, 'delay', defaults.delay); - var duration = GetNewValue(config, 'duration', defaults.duration); + + var delay = GetValue(config, 'delay', defaults.delay); + var duration = GetValue(config, 'duration', defaults.duration); var easeParams = GetValue(config, 'easeParams', defaults.easeParams); - var ease = GetEaseFunction(GetValue(config, 'ease', defaults.ease), easeParams); - var hold = GetNewValue(config, 'hold', defaults.hold); - var repeat = GetNewValue(config, 'repeat', defaults.repeat); - var repeatDelay = GetNewValue(config, 'repeatDelay', defaults.repeatDelay); + var ease = GetValue(config, 'ease', defaults.ease); + var hold = GetValue(config, 'hold', defaults.hold); + var repeat = GetValue(config, 'repeat', defaults.repeat); + var repeatDelay = GetValue(config, 'repeatDelay', defaults.repeatDelay); var yoyo = GetBoolean(config, 'yoyo', defaults.yoyo); var flipX = GetBoolean(config, 'flipX', defaults.flipX); var flipY = GetBoolean(config, 'flipY', defaults.flipY); + var interpolation = GetValue(config, 'interpolation', defaults.interpolation); - var data = []; + var addTarget = function (tween, targetIndex, key, value) + { + if (key === 'texture') + { + var texture = value; + var frame = undefined; + + if (Array.isArray(value)) + { + texture = value[0]; + frame = value[1]; + } + else if (value.hasOwnProperty('value')) + { + texture = value.value; + + if (Array.isArray(value.value)) + { + texture = value.value[0]; + frame = value.value[1]; + } + } + + tween.addFrame( + targetIndex, + texture, + frame, + GetNewValue(value, 'delay', delay), + GetValue(value, 'duration', duration), + GetValue(value, 'hold', hold), + GetValue(value, 'repeat', repeat), + GetValue(value, 'repeatDelay', repeatDelay), + GetBoolean(value, 'flipX', flipX), + GetBoolean(value, 'flipY', flipY) + ); + } + else + { + var ops = GetValueOp(key, value); + + var interpolationFunc = GetInterpolationFunction(GetValue(value, 'interpolation', interpolation)); + + tween.add( + targetIndex, + key, + ops.getEnd, + ops.getStart, + ops.getActive, + GetEaseFunction(GetValue(value, 'ease', ease), GetValue(value, 'easeParams', easeParams)), + GetNewValue(value, 'delay', delay), + GetValue(value, 'duration', duration), + GetBoolean(value, 'yoyo', yoyo), + GetValue(value, 'hold', hold), + GetValue(value, 'repeat', repeat), + GetValue(value, 'repeatDelay', repeatDelay), + GetBoolean(value, 'flipX', flipX), + GetBoolean(value, 'flipY', flipY), + interpolationFunc, + (interpolationFunc) ? value : null + ); + } + }; + + var tween = new Tween(parent, targets); // Loop through every property defined in the Tween, i.e.: props { x, y, alpha } for (var p = 0; p < props.length; p++) @@ -214218,44 +215094,31 @@ var TweenBuilder = function (parent, config, defaults) var value = props[p].value; // Create 1 TweenData per target, per property - for (var t = 0; t < targets.length; t++) + for (var targetIndex = 0; targetIndex < targets.length; targetIndex++) { - var ops = GetValueOp(key, value); - - var tweenData = TweenData( - targets[t], - t, - key, - ops.getEnd, - ops.getStart, - ops.getActive, - GetEaseFunction(GetValue(value, 'ease', ease), GetValue(value, 'easeParams', easeParams)), - GetNewValue(value, 'delay', delay), - GetNewValue(value, 'duration', duration), - GetBoolean(value, 'yoyo', yoyo), - GetNewValue(value, 'hold', hold), - GetNewValue(value, 'repeat', repeat), - GetNewValue(value, 'repeatDelay', repeatDelay), - GetBoolean(value, 'flipX', flipX), - GetBoolean(value, 'flipY', flipY) - ); - - data.push(tweenData); + // Special-case for scale short-cut: + if (key === 'scale' && !targets[targetIndex].hasOwnProperty('scale')) + { + addTarget(tween, targetIndex, 'scaleX', value); + addTarget(tween, targetIndex, 'scaleY', value); + } + else + { + addTarget(tween, targetIndex, key, value); + } } } - var tween = new Tween(parent, data, targets); - - tween.offset = GetAdvancedValue(config, 'offset', null); tween.completeDelay = GetAdvancedValue(config, 'completeDelay', 0); tween.loop = Math.round(GetAdvancedValue(config, 'loop', 0)); tween.loopDelay = Math.round(GetAdvancedValue(config, 'loopDelay', 0)); tween.paused = GetBoolean(config, 'paused', false); - tween.useFrames = GetBoolean(config, 'useFrames', false); + tween.persist = GetBoolean(config, 'persist', false); // Set the Callbacks - var scope = GetValue(config, 'callbackScope', tween); - var callbacks = Tween.TYPES; + tween.callbackScope = GetValue(config, 'callbackScope', tween); + + var callbacks = BaseTween.TYPES; for (var i = 0; i < callbacks.length; i++) { @@ -214265,10 +215128,9 @@ var TweenBuilder = function (parent, config, defaults) if (callback) { - var callbackScope = GetValue(config, type + 'Scope', scope); var callbackParams = GetValue(config, type + 'Params', []); - tween.setCallback(type, callback, callbackParams, callbackScope); + tween.setCallback(type, callback, callbackParams); } } @@ -214278,6 +215140,105 @@ var TweenBuilder = function (parent, config, defaults) module.exports = TweenBuilder; +/***/ }), + +/***/ 56034: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BaseTween = __webpack_require__(502); +var GetAdvancedValue = __webpack_require__(20494); +var GetBoolean = __webpack_require__(63130); +var GetTargets = __webpack_require__(65868); +var GetValue = __webpack_require__(10850); +var TweenBuilder = __webpack_require__(68061); +var TweenChain = __webpack_require__(45641); + +/** + * Creates a new Tween Chain instance. + * + * @function Phaser.Tweens.Builders.TweenChainBuilder + * @since 3.60.0 + * + * @param {Phaser.Tweens.TweenManager} parent - The owner of the new Tween. + * @param {Phaser.Types.Tweens.TweenChainBuilderConfig|object} config - Configuration for the new Tween. + * + * @return {Phaser.Tweens.TweenChain} The new Tween Chain. + */ +var TweenChainBuilder = function (parent, config) +{ + if (config instanceof TweenChain) + { + config.parent = parent; + + return config; + } + + // Default TweenChain values + + var chain = new TweenChain(parent); + + chain.startDelay = GetValue(config, 'delay', 0); + chain.completeDelay = GetAdvancedValue(config, 'completeDelay', 0); + chain.loop = Math.round(GetAdvancedValue(config, 'loop', GetValue(config, 'repeat', 0))); + chain.loopDelay = Math.round(GetAdvancedValue(config, 'loopDelay', GetValue(config, 'repeatDelay', 0))); + chain.paused = GetBoolean(config, 'paused', false); + chain.persist = GetBoolean(config, 'persist', true); + + // Set the Callbacks + chain.callbackScope = GetValue(config, 'callbackScope', chain); + + var i; + var callbacks = BaseTween.TYPES; + + for (i = 0; i < callbacks.length; i++) + { + var type = callbacks[i]; + + var callback = GetValue(config, type, false); + + if (callback) + { + var callbackParams = GetValue(config, type + 'Params', []); + + chain.setCallback(type, callback, callbackParams); + } + } + + // Add in the Tweens + var tweens = GetValue(config, 'tweens', null); + + if (Array.isArray(tweens)) + { + var chainedTweens = []; + + var targets = GetTargets(config); + var defaults = undefined; + + if (targets) + { + defaults = { targets: targets }; + } + + for (i = 0; i < tweens.length; i++) + { + chainedTweens.push(TweenBuilder(chain, tweens[i], defaults)); + } + + chain.add(chainedTweens); + } + + return chain; +}; + +module.exports = TweenChainBuilder; + + /***/ }), /***/ 79619: @@ -214285,7 +215246,7 @@ module.exports = TweenBuilder; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -214297,245 +215258,18 @@ module.exports = { GetBoolean: __webpack_require__(63130), GetEaseFunction: __webpack_require__(21902), + GetInterpolationFunction: __webpack_require__(4840), GetNewValue: __webpack_require__(28348), GetProps: __webpack_require__(92407), GetTargets: __webpack_require__(65868), - GetTweens: __webpack_require__(10365), GetValueOp: __webpack_require__(9744), NumberTweenBuilder: __webpack_require__(68710), StaggerBuilder: __webpack_require__(91944), - TimelineBuilder: __webpack_require__(32981), TweenBuilder: __webpack_require__(68061) }; -/***/ }), - -/***/ 51910: -/***/ ((module) => { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Timeline Complete Event. - * - * This event is dispatched by a Tween Timeline when it completes playback. - * - * Listen to it from a Timeline instance using `Timeline.on('complete', listener)`, i.e.: - * - * ```javascript - * var timeline = this.tweens.timeline({ - * targets: image, - * ease: 'Power1', - * duration: 3000, - * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] - * }); - * timeline.on('complete', listener); - * timeline.play(); - * ``` - * - * @event Phaser.Tweens.Events#TIMELINE_COMPLETE - * @since 3.0.0 - * - * @param {Phaser.Tweens.Timeline} timeline - A reference to the Timeline instance that emitted the event. - */ -module.exports = 'complete'; - - -/***/ }), - -/***/ 76826: -/***/ ((module) => { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Timeline Loop Event. - * - * This event is dispatched by a Tween Timeline every time it loops. - * - * Listen to it from a Timeline instance using `Timeline.on('loop', listener)`, i.e.: - * - * ```javascript - * var timeline = this.tweens.timeline({ - * targets: image, - * ease: 'Power1', - * duration: 3000, - * loop: 4, - * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] - * }); - * timeline.on('loop', listener); - * timeline.play(); - * ``` - * - * @event Phaser.Tweens.Events#TIMELINE_LOOP - * @since 3.0.0 - * - * @param {Phaser.Tweens.Timeline} timeline - A reference to the Timeline instance that emitted the event. - */ -module.exports = 'loop'; - - -/***/ }), - -/***/ 59953: -/***/ ((module) => { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Timeline Pause Event. - * - * This event is dispatched by a Tween Timeline when it is paused. - * - * Listen to it from a Timeline instance using `Timeline.on('pause', listener)`, i.e.: - * - * ```javascript - * var timeline = this.tweens.timeline({ - * targets: image, - * ease: 'Power1', - * duration: 3000, - * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] - * }); - * timeline.on('pause', listener); - * // At some point later ... - * timeline.pause(); - * ``` - * - * @event Phaser.Tweens.Events#TIMELINE_PAUSE - * @since 3.0.0 - * - * @param {Phaser.Tweens.Timeline} timeline - A reference to the Timeline instance that emitted the event. - */ -module.exports = 'pause'; - - -/***/ }), - -/***/ 92495: -/***/ ((module) => { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Timeline Resume Event. - * - * This event is dispatched by a Tween Timeline when it is resumed from a paused state. - * - * Listen to it from a Timeline instance using `Timeline.on('resume', listener)`, i.e.: - * - * ```javascript - * var timeline = this.tweens.timeline({ - * targets: image, - * ease: 'Power1', - * duration: 3000, - * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] - * }); - * timeline.on('resume', listener); - * // At some point later ... - * timeline.resume(); - * ``` - * - * @event Phaser.Tweens.Events#TIMELINE_RESUME - * @since 3.0.0 - * - * @param {Phaser.Tweens.Timeline} timeline - A reference to the Timeline instance that emitted the event. - */ -module.exports = 'resume'; - - -/***/ }), - -/***/ 55493: -/***/ ((module) => { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Timeline Start Event. - * - * This event is dispatched by a Tween Timeline when it starts. - * - * Listen to it from a Timeline instance using `Timeline.on('start', listener)`, i.e.: - * - * ```javascript - * var timeline = this.tweens.timeline({ - * targets: image, - * ease: 'Power1', - * duration: 3000, - * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] - * }); - * timeline.on('start', listener); - * timeline.play(); - * ``` - * - * @event Phaser.Tweens.Events#TIMELINE_START - * @since 3.0.0 - * - * @param {Phaser.Tweens.Timeline} timeline - A reference to the Timeline instance that emitted the event. - */ -module.exports = 'start'; - - -/***/ }), - -/***/ 48224: -/***/ ((module) => { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Timeline Update Event. - * - * This event is dispatched by a Tween Timeline every time it updates, which can happen a lot of times per second, - * so be careful about listening to this event unless you absolutely require it. - * - * Listen to it from a Timeline instance using `Timeline.on('update', listener)`, i.e.: - * - * ```javascript - * var timeline = this.tweens.timeline({ - * targets: image, - * ease: 'Power1', - * duration: 3000, - * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] - * }); - * timeline.on('update', listener); - * timeline.play(); - * ``` - * - * @event Phaser.Tweens.Events#TIMELINE_UPDATE - * @since 3.0.0 - * - * @param {Phaser.Tweens.Timeline} timeline - A reference to the Timeline instance that emitted the event. - */ -module.exports = 'update'; - - /***/ }), /***/ 5570: @@ -214543,36 +215277,40 @@ module.exports = 'update'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Tween Active Event. - * + * * This event is dispatched by a Tween when it becomes active within the Tween Manager. - * + * * An 'active' Tween is one that is now progressing, although it may not yet be updating * any target properties, due to settings such as `delay`. If you need an event for when * the Tween starts actually updating its first property, see `TWEEN_START`. - * + * * Listen to it from a Tween instance using `Tween.on('active', listener)`, i.e.: - * + * * ```javascript - * var tween = this.tweens.add({ + * var tween = this.tweens.create({ * targets: image, * x: 500, * ease: 'Power1', * duration: 3000 * }); * tween.on('active', listener); + * this.tweens.existing(tween); * ``` * + * Note that this event is usually dispatched already by the time you call `this.tweens.add()`, and is + * meant for use with `tweens.create()` and/or `tweens.existing()`. + * * @event Phaser.Tweens.Events#TWEEN_ACTIVE * @since 3.19.0 - * + * * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. - * @param {any[]} targets - An array of references to the target/s the Tween is operating on. + * @param {(any|any[])} targets - The targets of the Tween. If this Tween has multiple targets this will be an array of the targets. */ module.exports = 'active'; @@ -214584,22 +215322,22 @@ module.exports = 'active'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Tween Complete Event. - * + * * This event is dispatched by a Tween when it completes playback entirely, factoring in repeats and loops. - * + * * If the Tween has been set to loop or repeat infinitely, this event will not be dispatched * unless the `Tween.stop` method is called. - * + * * If a Tween has a `completeDelay` set, this event will fire after that delay expires. - * + * * Listen to it from a Tween instance using `Tween.on('complete', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.add({ * targets: image, @@ -214612,9 +215350,9 @@ module.exports = 'active'; * * @event Phaser.Tweens.Events#TWEEN_COMPLETE * @since 3.19.0 - * + * * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. - * @param {any[]} targets - An array of references to the target/s the Tween is operating on. + * @param {(any|any[])} targets - The targets of the Tween. If this Tween has multiple targets this will be an array of the targets. */ module.exports = 'complete'; @@ -214626,24 +215364,24 @@ module.exports = 'complete'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Tween Loop Event. - * + * * This event is dispatched by a Tween when it loops. - * + * * This event will only be dispatched if the Tween has a loop count set. - * + * * If a Tween has a `loopDelay` set, this event will fire after that delay expires. - * + * * The difference between `loop` and `repeat` is that `repeat` is a property setting, * where-as `loop` applies to the entire Tween. - * + * * Listen to it from a Tween instance using `Tween.on('loop', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.add({ * targets: image, @@ -214657,13 +215395,51 @@ module.exports = 'complete'; * * @event Phaser.Tweens.Events#TWEEN_LOOP * @since 3.19.0 - * + * * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. - * @param {any[]} targets - An array of references to the target/s the Tween is operating on. + * @param {(any|any[])} targets - The targets of the Tween. If this Tween has multiple targets this will be an array of the targets. */ module.exports = 'loop'; +/***/ }), + +/***/ 90281: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Tween Pause Event. + * + * This event is dispatched by a Tween when it is paused. + * + * Listen to it from a Tween instance using `Tween.on('pause', listener)`, i.e.: + * + * ```javascript + * var tween = this.tweens.add({ + * targets: image, + * ease: 'Power1', + * duration: 3000, + * x: 600 + * }); + * tween.on('pause', listener); + * // At some point later ... + * tween.pause(); + * ``` + * + * @event Phaser.Tweens.Events#TWEEN_PAUSE + * @since 3.60.0 + * + * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. + */ +module.exports = 'pause'; + + /***/ }), /***/ 80803: @@ -214671,24 +215447,24 @@ module.exports = 'loop'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Tween Repeat Event. - * + * * This event is dispatched by a Tween when one of the properties it is tweening repeats. - * + * * This event will only be dispatched if the Tween has a property with a repeat count set. - * + * * If a Tween has a `repeatDelay` set, this event will fire after that delay expires. - * + * * The difference between `loop` and `repeat` is that `repeat` is a property setting, * where-as `loop` applies to the entire Tween. - * + * * Listen to it from a Tween instance using `Tween.on('repeat', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.add({ * targets: image, @@ -214702,14 +215478,54 @@ module.exports = 'loop'; * * @event Phaser.Tweens.Events#TWEEN_REPEAT * @since 3.19.0 - * + * * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. - * @param {string} key - The key of the property that just repeated. - * @param {any} target - The target that the property just repeated on. + * @param {string} key - The property on the target that has just repeated, i.e. `x` or `scaleY`, or whatever property you are tweening. + * @param {any} target - The target object that was repeated. Usually a Game Object, but can be of any type. + * @param {number} current - The current value of the property being set on the target. + * @param {number} previous - The previous value of the property being set on the target. */ module.exports = 'repeat'; +/***/ }), + +/***/ 13640: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Tween Resume Event. + * + * This event is dispatched by a Tween when it is resumed from a paused state. + * + * Listen to it from a Tween instance using `Tween.on('resume', listener)`, i.e.: + * + * ```javascript + * var tween = this.tweens.add({ + * targets: image, + * ease: 'Power1', + * duration: 3000, + * x: 600 + * }); + * tween.on('resume', listener); + * // At some point later ... + * tween.resume(); + * ``` + * + * @event Phaser.Tweens.Events#TWEEN_RESUME + * @since 3.60.0 + * + * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. + */ +module.exports = 'resume'; + + /***/ }), /***/ 10472: @@ -214717,21 +215533,21 @@ module.exports = 'repeat'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Tween Start Event. - * + * * This event is dispatched by a Tween when it starts tweening its first property. - * + * * A Tween will only emit this event once, as it can only start once. - * + * * If a Tween has a `delay` set, this event will fire after that delay expires. - * + * * Listen to it from a Tween instance using `Tween.on('start', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.add({ * targets: image, @@ -214744,9 +215560,9 @@ module.exports = 'repeat'; * * @event Phaser.Tweens.Events#TWEEN_START * @since 3.19.0 - * + * * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. - * @param {any[]} targets - An array of references to the target/s the Tween is operating on. + * @param {(any|any[])} targets - The targets of the Tween. If this Tween has multiple targets this will be an array of the targets. */ module.exports = 'start'; @@ -214758,7 +215574,7 @@ module.exports = 'start'; /** * @author samme - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -214783,7 +215599,7 @@ module.exports = 'start'; * @since 3.24.0 * * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. - * @param {any[]} targets - An array of references to the target/s the Tween is operating on. + * @param {(any|any[])} targets - The targets of the Tween. If this Tween has multiple targets this will be an array of the targets. */ module.exports = 'stop'; @@ -214795,21 +215611,21 @@ module.exports = 'stop'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Tween Update Event. - * + * * This event is dispatched by a Tween every time it updates _any_ of the properties it is tweening. - * + * * A Tween that is changing 3 properties of a target will emit this event 3 times per change, once per property. - * + * * **Note:** This is a very high frequency event and may be dispatched multiple times, every single frame. - * + * * Listen to it from a Tween instance using `Tween.on('update', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.add({ * targets: image, @@ -214822,9 +215638,9 @@ module.exports = 'stop'; * * @event Phaser.Tweens.Events#TWEEN_UPDATE * @since 3.19.0 - * + * * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. - * @param {string} key - The property that was updated, i.e. `x` or `scale`. + * @param {string} key - The property on the target that has just updated, i.e. `x` or `scaleY`, or whatever property you are tweening. * @param {any} target - The target object that was updated. Usually a Game Object, but can be of any type. * @param {number} current - The current value of the property that was tweened. * @param {number} previous - The previous value of the property that was tweened, prior to this update. @@ -214839,25 +215655,25 @@ module.exports = 'update'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Tween Yoyo Event. - * + * * This event is dispatched by a Tween whenever a property it is tweening yoyos. - * + * * This event will only be dispatched if the Tween has a property with `yoyo` set. - * + * * If the Tween has a `hold` value, this event is dispatched when the hold expires. - * + * * This event is dispatched for every property, and for every target, that yoyos. * For example, if a Tween was updating 2 properties and had 10 targets, this event * would be dispatched 20 times (twice per target). So be careful how you use it! - * + * * Listen to it from a Tween instance using `Tween.on('yoyo', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.add({ * targets: image, @@ -214871,10 +215687,12 @@ module.exports = 'update'; * * @event Phaser.Tweens.Events#TWEEN_YOYO * @since 3.19.0 - * + * * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. - * @param {string} key - The property that yoyo'd, i.e. `x` or `scale`. + * @param {string} key - The property on the target that has just yoyo'd, i.e. `x` or `scaleY`, or whatever property you are tweening. * @param {any} target - The target object that was yoyo'd. Usually a Game Object, but can be of any type. + * @param {number} current - The current value of the property being set on the target. + * @param {number} previous - The previous value of the property being set on the target. */ module.exports = 'yoyo'; @@ -214886,7 +215704,7 @@ module.exports = 'yoyo'; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -214896,15 +215714,11 @@ module.exports = 'yoyo'; module.exports = { - TIMELINE_COMPLETE: __webpack_require__(51910), - TIMELINE_LOOP: __webpack_require__(76826), - TIMELINE_PAUSE: __webpack_require__(59953), - TIMELINE_RESUME: __webpack_require__(92495), - TIMELINE_START: __webpack_require__(55493), - TIMELINE_UPDATE: __webpack_require__(48224), TWEEN_ACTIVE: __webpack_require__(5570), TWEEN_COMPLETE: __webpack_require__(6383), TWEEN_LOOP: __webpack_require__(72582), + TWEEN_PAUSE: __webpack_require__(90281), + TWEEN_RESUME: __webpack_require__(13640), TWEEN_REPEAT: __webpack_require__(80803), TWEEN_START: __webpack_require__(10472), TWEEN_STOP: __webpack_require__(5379), @@ -214921,35 +215735,1389 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(55303); -var Extend = __webpack_require__(98611); - /** * @namespace Phaser.Tweens */ var Tweens = { + States: __webpack_require__(55303), + Builders: __webpack_require__(79619), Events: __webpack_require__(54272), TweenManager: __webpack_require__(64532), Tween: __webpack_require__(39366), - TweenData: __webpack_require__(15718), - Timeline: __webpack_require__(28860) + TweenData: __webpack_require__(15718) }; -// Merge in the consts -Tweens = Extend(false, Tweens, CONST); - module.exports = Tweens; +/***/ }), + +/***/ 502: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(56694); +var EventEmitter = __webpack_require__(6659); +var Events = __webpack_require__(54272); +var TWEEN_CONST = __webpack_require__(55303); + +/** + * @classdesc + * As the name implies, this is the base Tween class that both the Tween and TweenChain + * inherit from. It contains shared properties and methods common to both types of Tween. + * + * Typically you would never instantiate this class directly, although you could certainly + * use it to create your own variation of Tweens from. + * + * @class BaseTween + * @memberof Phaser.Tweens + * @extends Phaser.Events.EventEmitter + * @constructor + * @since 3.60.0 + * + * @param {(Phaser.Tweens.TweenManager|Phaser.Tweens.TweenChain)} parent - A reference to the Tween Manager, or Tween Chain, that owns this Tween. + */ +var BaseTween = new Class({ + + Extends: EventEmitter, + + initialize: + + function BaseTween (parent) + { + EventEmitter.call(this); + + /** + * A reference to the Tween Manager, or Tween Chain, that owns this Tween. + * + * @name Phaser.Tweens.BaseTween#parent + * @type {(Phaser.Tweens.TweenManager|Phaser.Tweens.TweenChain)} + * @since 3.60.0 + */ + this.parent = parent; + + /** + * The main data array. For a Tween, this contains all of the `TweenData` objects, each + * containing a unique property and target that is being tweened. + * + * For a TweenChain, this contains an array of `Tween` instances, which are being played + * through in sequence. + * + * @name Phaser.Tweens.BaseTween#data + * @type {(Phaser.Tweens.TweenData[]|Phaser.Tweens.Tween[])} + * @since 3.60.0 + */ + this.data = []; + + /** + * The cached size of the data array. + * + * @name Phaser.Tweens.BaseTween#totalData + * @type {number} + * @since 3.60.0 + */ + this.totalData = 0; + + /** + * The time in milliseconds before the 'onStart' event fires. + * + * For a Tween, this is the shortest `delay` value across all of the TweenDatas it owns. + * For a TweenChain, it is whatever delay value was given in the configuration. + * + * @name Phaser.Tweens.BaseTween#startDelay + * @type {number} + * @default 0 + * @since 3.60.0 + */ + this.startDelay = 0; + + /** + * Has this Tween started playback yet? + * + * This boolean is toggled when the Tween leaves the 'start delayed' state and begins running. + * + * @name Phaser.Tweens.BaseTween#hasStarted + * @type {boolean} + * @readonly + * @since 3.60.0 + */ + this.hasStarted = false; + + /** + * Scales the time applied to this Tween. A value of 1 runs in real-time. A value of 0.5 runs 50% slower, and so on. + * + * The value isn't used when calculating total duration of the tween, it's a run-time delta adjustment only. + * + * This value is multiplied by the `TweenManager.timeScale`. + * + * @name Phaser.Tweens.BaseTween#timeScale + * @type {number} + * @default 1 + * @since 3.60.0 + */ + this.timeScale = 1; + + /** + * The number of times this Tween will loop. + * + * Can be -1 for an infinite loop, zero for none, or a positive integer. + * + * Typically this is set in the configuration object, but can also be set directly + * as long as this Tween is paused and hasn't started playback. + * + * When enabled it will play through ALL Tweens again. + * + * Use TweenData.repeat to loop a single element. + * + * @name Phaser.Tweens.BaseTween#loop + * @type {number} + * @default 0 + * @since 3.60.0 + */ + this.loop = 0; + + /** + * The time in milliseconds before the Tween loops. + * + * Only used if `loop` is > 0. + * + * @name Phaser.Tweens.BaseTween#loopDelay + * @type {number} + * @default 0 + * @since 3.60.0 + */ + this.loopDelay = 0; + + /** + * Internal counter recording how many loops are left to run. + * + * @name Phaser.Tweens.BaseTween#loopCounter + * @type {number} + * @default 0 + * @since 3.60.0 + */ + this.loopCounter = 0; + + /** + * The time in milliseconds before the 'onComplete' event fires. + * + * This never fires if `loop = -1` as it never completes because it has been + * set to loop forever. + * + * @name Phaser.Tweens.BaseTween#completeDelay + * @type {number} + * @default 0 + * @since 3.60.0 + */ + this.completeDelay = 0; + + /** + * An internal countdown timer (used by loopDelay and completeDelay) + * + * @name Phaser.Tweens.BaseTween#countdown + * @type {number} + * @default 0 + * @since 3.60.0 + */ + this.countdown = 0; + + /** + * The current state of the Tween. + * + * @name Phaser.Tweens.BaseTween#state + * @type {Phaser.Tweens.StateType} + * @since 3.60.0 + */ + this.state = TWEEN_CONST.PENDING; + + /** + * Is the Tween currently paused? + * + * A paused Tween needs to be started with the `play` method, or resumed with the `resume` method. + * + * This property can be toggled at runtime if required. + * + * @name Phaser.Tweens.BaseTween#paused + * @type {boolean} + * @default false + * @since 3.60.0 + */ + this.paused = false; + + /** + * An object containing the different Tween callback functions. + * + * You can either set these in the Tween config, or by calling the `Tween.setCallback` method. + * + * The types available are: + * + * `onActive` - When the Tween is first created it moves to an 'active' state when added to the Tween Manager. 'Active' does not mean 'playing'. + * `onStart` - When the Tween starts playing after a delayed or paused state. This will happen at the same time as `onActive` if the tween has no delay and isn't paused. + * `onLoop` - When a Tween loops, if it has been set to do so. This happens _after_ the `loopDelay` expires, if set. + * `onComplete` - When the Tween finishes playback fully. Never invoked if the Tween is set to repeat infinitely. + * `onStop` - Invoked only if the `Tween.stop` method is called. + * `onPause` - Invoked only if the `Tween.pause` method is called. Not invoked if the Tween Manager is paused. + * `onResume` - Invoked only if the `Tween.resume` method is called. Not invoked if the Tween Manager is resumed. + * + * The following types are also available and are invoked on a `TweenData` level - that is per-object, per-property, being tweened. + * + * `onYoyo` - When a TweenData starts a yoyo. This happens _after_ the `hold` delay expires, if set. + * `onRepeat` - When a TweenData repeats playback. This happens _after_ the `repeatDelay` expires, if set. + * `onUpdate` - When a TweenData updates a property on a source target during playback. + * + * @name Phaser.Tweens.BaseTween#callbacks + * @type {Phaser.Types.Tweens.TweenCallbacks} + * @since 3.60.0 + */ + this.callbacks = { + onActive: null, + onComplete: null, + onLoop: null, + onPause: null, + onRepeat: null, + onResume: null, + onStart: null, + onStop: null, + onUpdate: null, + onYoyo: null + }; + + /** + * The scope (or context) in which all of the callbacks are invoked. + * + * This defaults to be this Tween, but you can override this property + * to set it to whatever object you require. + * + * @name Phaser.Tweens.BaseTween#callbackScope + * @type {any} + * @since 3.60.0 + */ + this.callbackScope; + + /** + * Will this Tween persist after playback? A Tween that persists will _not_ be destroyed by the + * Tween Manager, or when calling `Tween.stop`, and can be re-played as required. You can either + * set this property when creating the tween in the tween config, or set it _prior_ to playback. + * + * However, it's up to you to ensure you destroy persistent tweens when you are finished with them, + * or they will retain references you may no longer require and waste memory. + * + * By default, `Tweens` are set to _not_ persist, so they are automatically cleaned-up by + * the Tween Manager. But `TweenChains` _do_ persist by default, unless overridden in their + * config. This is because the type of situations you use a chain for is far more likely to + * need to be replayed again in the future, rather than disposed of. + * + * @name Phaser.Tweens.BaseTween#persist + * @type {boolean} + * @since 3.60.0 + */ + this.persist = false; + }, + + /** + * Prepares this Tween for playback. + * + * Called automatically by the TweenManager. Should not be called directly. + * + * @method Phaser.Tweens.BaseTween#init + * @fires Phaser.Tweens.Events#TWEEN_ACTIVE + * @since 3.60.0 + * + * @return {this} This Tween instance. + */ + init: function () + { + this.initTweenData(); + + this.setActiveState(); + + this.dispatchEvent(Events.TWEEN_ACTIVE, 'onActive'); + + return this; + }, + + /** + * Sets the value of the time scale applied to this Tween. A value of 1 runs in real-time. + * A value of 0.5 runs 50% slower, and so on. + * + * The value isn't used when calculating total duration of the tween, it's a run-time delta adjustment only. + * + * This value is multiplied by the `TweenManager.timeScale`. + * + * @method Phaser.Tweens.BaseTween#setTimeScale + * @since 3.60.0 + * + * @param {number} value - The time scale value to set. + * + * @return {this} This Tween instance. + */ + setTimeScale: function (value) + { + this.timeScale = value; + + return this; + }, + + /** + * Gets the value of the time scale applied to this Tween. A value of 1 runs in real-time. + * A value of 0.5 runs 50% slower, and so on. + * + * @method Phaser.Tweens.BaseTween#getTimeScale + * @since 3.60.0 + * + * @return {number} The value of the time scale applied to this Tween. + */ + getTimeScale: function () + { + return this.timeScale; + }, + + /** + * Checks if this Tween is currently playing. + * + * If this Tween is paused, or not active, this method will return false. + * + * @method Phaser.Tweens.BaseTween#isPlaying + * @since 3.60.0 + * + * @return {boolean} `true` if the Tween is playing, otherwise `false`. + */ + isPlaying: function () + { + return (!this.paused && this.isActive()); + }, + + /** + * Checks if the Tween is currently paused. + * + * This is the same as inspecting the `BaseTween.paused` property directly. + * + * @method Phaser.Tweens.BaseTween#isPaused + * @since 3.60.0 + * + * @return {boolean} `true` if the Tween is paused, otherwise `false`. + */ + isPaused: function () + { + return this.paused; + }, + + /** + * Pauses the Tween immediately. Use `resume` to continue playback. + * + * You can also toggle the `Tween.paused` boolean property, but doing so will not trigger the PAUSE event. + * + * @method Phaser.Tweens.BaseTween#pause + * @fires Phaser.Tweens.Events#TWEEN_PAUSE + * @since 3.60.0 + * + * @return {this} This Tween instance. + */ + pause: function () + { + if (!this.paused) + { + this.paused = true; + + this.dispatchEvent(Events.TWEEN_PAUSE, 'onPause'); + } + + return this; + }, + + /** + * Resumes the playback of a previously paused Tween. + * + * You can also toggle the `Tween.paused` boolean property, but doing so will not trigger the RESUME event. + * + * @method Phaser.Tweens.BaseTween#resume + * @fires Phaser.Tweens.Events#TWEEN_RESUME + * @since 3.60.0 + * + * @return {this} This Tween instance. + */ + resume: function () + { + if (this.paused) + { + this.paused = false; + + this.dispatchEvent(Events.TWEEN_RESUME, 'onResume'); + } + + return this; + }, + + /** + * Internal method that makes this Tween active within the TweenManager + * and emits the onActive event and callback. + * + * @method Phaser.Tweens.BaseTween#makeActive + * @fires Phaser.Tweens.Events#TWEEN_ACTIVE + * @since 3.60.0 + */ + makeActive: function () + { + this.parent.makeActive(this); + + this.dispatchEvent(Events.TWEEN_ACTIVE, 'onActive'); + }, + + /** + * Internal method that handles this tween completing and emitting the onComplete event + * and callback. + * + * @method Phaser.Tweens.BaseTween#onCompleteHandler + * @since 3.60.0 + */ + onCompleteHandler: function () + { + this.setPendingRemoveState(); + + this.dispatchEvent(Events.TWEEN_COMPLETE, 'onComplete'); + }, + + /** + * Flags the Tween as being complete, whatever stage of progress it is at. + * + * If an `onComplete` callback has been defined it will automatically invoke it, unless a `delay` + * argument is provided, in which case the Tween will delay for that period of time before calling the callback. + * + * If you don't need a delay or don't have an `onComplete` callback then call `Tween.stop` instead. + * + * @method Phaser.Tweens.BaseTween#complete + * @fires Phaser.Tweens.Events#TWEEN_COMPLETE + * @since 3.2.0 + * + * @param {number} [delay=0] - The time to wait before invoking the complete callback. If zero it will fire immediately. + * + * @return {this} This Tween instance. + */ + complete: function (delay) + { + if (delay === undefined) { delay = 0; } + + if (delay) + { + this.setCompleteDelayState(); + + this.countdown = delay; + } + else + { + this.onCompleteHandler(); + } + + return this; + }, + + /** + * Flags the Tween as being complete only once the current loop has finished. + * + * This is a useful way to stop an infinitely looping tween once a complete cycle is over, + * rather than abruptly. + * + * If you don't have a loop then call `Tween.stop` instead. + * + * @method Phaser.Tweens.BaseTween#completeAfterLoop + * @fires Phaser.Tweens.Events#TWEEN_COMPLETE + * @since 3.60.0 + * + * @param {number} [loops=0] - The number of loops that should finish before this tween completes. Zero means complete just the current loop. + * + * @return {this} This Tween instance. + */ + completeAfterLoop: function (loops) + { + if (loops === undefined) { loops = 0; } + + if (this.loopCounter > loops) + { + this.loopCounter = loops; + } + + return this; + }, + + /** + * Immediately removes this Tween from the TweenManager and all of its internal arrays, + * no matter what stage it is at. Then sets the tween state to `REMOVED`. + * + * You should dispose of your reference to this tween after calling this method, to + * free it from memory. If you no longer require it, call `Tween.destroy()` on it. + * + * @method Phaser.Tweens.BaseTween#remove + * @since 3.60.0 + * + * @return {this} This Tween instance. + */ + remove: function () + { + this.parent.remove(this); + + return this; + }, + + /** + * Stops the Tween immediately, whatever stage of progress it is at. + * + * If not a part of a Tween Chain it is also flagged for removal by the Tween Manager. + * + * If an `onStop` callback has been defined it will automatically invoke it. + * + * The Tween will be removed during the next game frame, but should be considered 'destroyed' from this point on. + * + * Typically, you cannot play a Tween that has been stopped. If you just wish to pause the tween, not destroy it, + * then call the `pause` method instead and use `resume` to continue playback. If you wish to restart the Tween, + * use the `restart` or `seek` methods. + * + * @method Phaser.Tweens.BaseTween#stop + * @fires Phaser.Tweens.Events#TWEEN_STOP + * @since 3.60.0 + * + * @return {this} This Tween instance. + */ + stop: function () + { + if (!this.isRemoved() && !this.isPendingRemove()) + { + this.dispatchEvent(Events.TWEEN_STOP, 'onStop'); + + this.setPendingRemoveState(); + } + + return this; + }, + + /** + * Internal method that handles the processing of the loop delay countdown timer and + * the dispatch of related events. Called automatically by `Tween.update`. + * + * @method Phaser.Tweens.BaseTween#updateLoopCountdown + * @since 3.60.0 + * + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + updateLoopCountdown: function (delta) + { + this.countdown -= delta; + + if (this.countdown <= 0) + { + this.setActiveState(); + + this.dispatchEvent(Events.TWEEN_LOOP, 'onLoop'); + } + }, + + /** + * Internal method that handles the processing of the start delay countdown timer and + * the dispatch of related events. Called automatically by `Tween.update`. + * + * @method Phaser.Tweens.BaseTween#updateStartCountdown + * @since 3.60.0 + * + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + updateStartCountdown: function (delta) + { + this.countdown -= delta; + + if (this.countdown <= 0) + { + this.hasStarted = true; + + this.setActiveState(); + + this.dispatchEvent(Events.TWEEN_START, 'onStart'); + + // Reset the delta so we always start progress from zero + delta = 0; + } + + return delta; + }, + + /** + * Internal method that handles the processing of the complete delay countdown timer and + * the dispatch of related events. Called automatically by `Tween.update`. + * + * @method Phaser.Tweens.BaseTween#updateCompleteDelay + * @since 3.60.0 + * + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + updateCompleteDelay: function (delta) + { + this.countdown -= delta; + + if (this.countdown <= 0) + { + this.onCompleteHandler(); + } + }, + + /** + * Sets an event based callback to be invoked during playback. + * + * Calling this method will replace a previously set callback for the given type, if any exists. + * + * The types available are: + * + * `onActive` - When the Tween is first created it moves to an 'active' state when added to the Tween Manager. 'Active' does not mean 'playing'. + * `onStart` - When the Tween starts playing after a delayed or paused state. This will happen at the same time as `onActive` if the tween has no delay and isn't paused. + * `onLoop` - When a Tween loops, if it has been set to do so. This happens _after_ the `loopDelay` expires, if set. + * `onComplete` - When the Tween finishes playback fully. Never invoked if the Tween is set to repeat infinitely. + * `onStop` - Invoked only if the `Tween.stop` method is called. + * `onPause` - Invoked only if the `Tween.pause` method is called. Not invoked if the Tween Manager is paused. + * `onResume` - Invoked only if the `Tween.resume` method is called. Not invoked if the Tween Manager is resumed. + * + * The following types are also available and are invoked on a `TweenData` level - that is per-object, per-property, being tweened. + * + * `onYoyo` - When a TweenData starts a yoyo. This happens _after_ the `hold` delay expires, if set. + * `onRepeat` - When a TweenData repeats playback. This happens _after_ the `repeatDelay` expires, if set. + * `onUpdate` - When a TweenData updates a property on a source target during playback. + * + * @method Phaser.Tweens.BaseTween#setCallback + * @since 3.60.0 + * + * @param {Phaser.Types.Tweens.TweenCallbackTypes} type - The type of callback to set. One of: `onActive`, `onComplete`, `onLoop`, `onPause`, `onRepeat`, `onResume`, `onStart`, `onStop`, `onUpdate` or `onYoyo`. + * @param {function} callback - Your callback that will be invoked. + * @param {array} [params] - The parameters to pass to the callback. Pass an empty array if you don't want to define any, but do wish to set the scope. + * + * @return {this} This Tween instance. + */ + setCallback: function (type, callback, params) + { + if (params === undefined) { params = []; } + + if (this.callbacks.hasOwnProperty(type)) + { + this.callbacks[type] = { func: callback, params: params }; + } + + return this; + }, + + /** + * Sets this Tween state to PENDING. + * + * @method Phaser.Tweens.BaseTween#setPendingState + * @since 3.60.0 + */ + setPendingState: function () + { + this.state = TWEEN_CONST.PENDING; + }, + + /** + * Sets this Tween state to ACTIVE. + * + * @method Phaser.Tweens.BaseTween#setActiveState + * @since 3.60.0 + */ + setActiveState: function () + { + this.state = TWEEN_CONST.ACTIVE; + }, + + /** + * Sets this Tween state to LOOP_DELAY. + * + * @method Phaser.Tweens.BaseTween#setLoopDelayState + * @since 3.60.0 + */ + setLoopDelayState: function () + { + this.state = TWEEN_CONST.LOOP_DELAY; + }, + + /** + * Sets this Tween state to COMPLETE_DELAY. + * + * @method Phaser.Tweens.BaseTween#setCompleteDelayState + * @since 3.60.0 + */ + setCompleteDelayState: function () + { + this.state = TWEEN_CONST.COMPLETE_DELAY; + }, + + /** + * Sets this Tween state to START_DELAY. + * + * @method Phaser.Tweens.BaseTween#setStartDelayState + * @since 3.60.0 + */ + setStartDelayState: function () + { + this.state = TWEEN_CONST.START_DELAY; + + this.countdown = this.startDelay; + + this.hasStarted = false; + }, + + /** + * Sets this Tween state to PENDING_REMOVE. + * + * @method Phaser.Tweens.BaseTween#setPendingRemoveState + * @since 3.60.0 + */ + setPendingRemoveState: function () + { + this.state = TWEEN_CONST.PENDING_REMOVE; + }, + + /** + * Sets this Tween state to REMOVED. + * + * @method Phaser.Tweens.BaseTween#setRemovedState + * @since 3.60.0 + */ + setRemovedState: function () + { + this.state = TWEEN_CONST.REMOVED; + }, + + /** + * Sets this Tween state to FINISHED. + * + * @method Phaser.Tweens.BaseTween#setFinishedState + * @since 3.60.0 + */ + setFinishedState: function () + { + this.state = TWEEN_CONST.FINISHED; + }, + + /** + * Sets this Tween state to DESTROYED. + * + * @method Phaser.Tweens.BaseTween#setDestroyedState + * @since 3.60.0 + */ + setDestroyedState: function () + { + this.state = TWEEN_CONST.DESTROYED; + }, + + /** + * Returns `true` if this Tween has a _current_ state of PENDING, otherwise `false`. + * + * @method Phaser.Tweens.BaseTween#isPending + * @since 3.60.0 + * + * @return {boolean} `true` if this Tween has a _current_ state of PENDING, otherwise `false`. + */ + isPending: function () + { + return (this.state === TWEEN_CONST.PENDING); + }, + + /** + * Returns `true` if this Tween has a _current_ state of ACTIVE, otherwise `false`. + * + * @method Phaser.Tweens.BaseTween#isActive + * @since 3.60.0 + * + * @return {boolean} `true` if this Tween has a _current_ state of ACTIVE, otherwise `false`. + */ + isActive: function () + { + return (this.state === TWEEN_CONST.ACTIVE); + }, + + /** + * Returns `true` if this Tween has a _current_ state of LOOP_DELAY, otherwise `false`. + * + * @method Phaser.Tweens.BaseTween#isLoopDelayed + * @since 3.60.0 + * + * @return {boolean} `true` if this Tween has a _current_ state of LOOP_DELAY, otherwise `false`. + */ + isLoopDelayed: function () + { + return (this.state === TWEEN_CONST.LOOP_DELAY); + }, + + /** + * Returns `true` if this Tween has a _current_ state of COMPLETE_DELAY, otherwise `false`. + * + * @method Phaser.Tweens.BaseTween#isCompleteDelayed + * @since 3.60.0 + * + * @return {boolean} `true` if this Tween has a _current_ state of COMPLETE_DELAY, otherwise `false`. + */ + isCompleteDelayed: function () + { + return (this.state === TWEEN_CONST.COMPLETE_DELAY); + }, + + /** + * Returns `true` if this Tween has a _current_ state of START_DELAY, otherwise `false`. + * + * @method Phaser.Tweens.BaseTween#isStartDelayed + * @since 3.60.0 + * + * @return {boolean} `true` if this Tween has a _current_ state of START_DELAY, otherwise `false`. + */ + isStartDelayed: function () + { + return (this.state === TWEEN_CONST.START_DELAY); + }, + + /** + * Returns `true` if this Tween has a _current_ state of PENDING_REMOVE, otherwise `false`. + * + * @method Phaser.Tweens.BaseTween#isPendingRemove + * @since 3.60.0 + * + * @return {boolean} `true` if this Tween has a _current_ state of PENDING_REMOVE, otherwise `false`. + */ + isPendingRemove: function () + { + return (this.state === TWEEN_CONST.PENDING_REMOVE); + }, + + /** + * Returns `true` if this Tween has a _current_ state of REMOVED, otherwise `false`. + * + * @method Phaser.Tweens.BaseTween#isRemoved + * @since 3.60.0 + * + * @return {boolean} `true` if this Tween has a _current_ state of REMOVED, otherwise `false`. + */ + isRemoved: function () + { + return (this.state === TWEEN_CONST.REMOVED); + }, + + /** + * Returns `true` if this Tween has a _current_ state of FINISHED, otherwise `false`. + * + * @method Phaser.Tweens.BaseTween#isFinished + * @since 3.60.0 + * + * @return {boolean} `true` if this Tween has a _current_ state of FINISHED, otherwise `false`. + */ + isFinished: function () + { + return (this.state === TWEEN_CONST.FINISHED); + }, + + /** + * Returns `true` if this Tween has a _current_ state of DESTROYED, otherwise `false`. + * + * @method Phaser.Tweens.BaseTween#isDestroyed + * @since 3.60.0 + * + * @return {boolean} `true` if this Tween has a _current_ state of DESTROYED, otherwise `false`. + */ + isDestroyed: function () + { + return (this.state === TWEEN_CONST.DESTROYED); + }, + + /** + * Handles the destroy process of this Tween, clearing out the + * Tween Data and resetting the targets. A Tween that has been + * destroyed cannot ever be played or used again. + * + * @method Phaser.Tweens.BaseTween#destroy + * @since 3.60.0 + */ + destroy: function () + { + if (this.data) + { + this.data.forEach(function (tweenData) + { + tweenData.destroy(); + }); + } + + this.removeAllListeners(); + + this.callbacks = null; + this.data = null; + this.parent = null; + + this.setDestroyedState(); + } + +}); + +BaseTween.TYPES = [ + 'onActive', + 'onComplete', + 'onLoop', + 'onPause', + 'onRepeat', + 'onResume', + 'onStart', + 'onStop', + 'onUpdate', + 'onYoyo' +]; + +module.exports = BaseTween; + + +/***/ }), + +/***/ 65521: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(56694); +var TWEEN_CONST = __webpack_require__(55303); + +/** + * @classdesc + * BaseTweenData is the class that the TweenData and TweenFrameData classes + * extend from. You should not typically instantiate this class directly, but instead + * use it to form your own tween data classes from, should you require it. + * + * Prior to Phaser 3.60 the TweenData was just an object, but was refactored to a class, + * to make it responsible for its own state and updating. + * + * @class BaseTweenData + * @memberof Phaser.Tweens + * @constructor + * @since 3.60.0 + * + * @param {Phaser.Tweens.Tween} tween - The tween this TweenData instance belongs to. + * @param {number} targetIndex - The target index within the Tween targets array. + * @param {string} key - The property of the target to tween. + * @param {Phaser.Types.Tweens.GetEndCallback} getEnd - What the property will be at the END of the Tween. + * @param {Phaser.Types.Tweens.GetStartCallback} getStart - What the property will be at the START of the Tween. + * @param {?Phaser.Types.Tweens.GetActiveCallback} getActive - If not null, is invoked _immediately_ as soon as the TweenData is running, and is set on the target property. + * @param {function} ease - The ease function this tween uses. + * @param {function} delay - Function that returns the time in ms/frames before tween will start. + * @param {number} duration - The duration of the tween in ms/frames. + * @param {boolean} yoyo - Determines whether the tween should return back to its start value after hold has expired. + * @param {number} hold - Function that returns the time in ms/frames the tween will pause before repeating or returning to its starting value if yoyo is set to true. + * @param {number} repeat - Function that returns the number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. + * @param {number} repeatDelay - Function that returns the time in ms/frames before the repeat will start. + * @param {boolean} flipX - Should toggleFlipX be called when yoyo or repeat happens? + * @param {boolean} flipY - Should toggleFlipY be called when yoyo or repeat happens? + * @param {?function} interpolation - The interpolation function to be used for arrays of data. Defaults to 'null'. + * @param {?number[]} interpolationData - The array of interpolation data to be set. Defaults to 'null'. + */ +var BaseTweenData = new Class({ + + initialize: + + function BaseTweenData (tween, targetIndex, delay, duration, yoyo, hold, repeat, repeatDelay, flipX, flipY) + { + /** + * A reference to the Tween that this TweenData instance belongs to. + * + * @name Phaser.Tweens.BaseTweenData#tween + * @type {Phaser.Tweens.Tween} + * @since 3.60.0 + */ + this.tween = tween; + + /** + * The index of the target within the Tween `targets` array. + * + * @name Phaser.Tweens.BaseTweenData#targetIndex + * @type {number} + * @since 3.60.0 + */ + this.targetIndex = targetIndex; + + /** + * The duration of the tween in milliseconds, excluding any time required + * for yoyo or repeats. + * + * @name Phaser.Tweens.BaseTweenData#duration + * @type {number} + * @since 3.60.0 + */ + this.duration = duration; + + /** + * The total calculated duration, in milliseconds, of this TweenData. + * Factoring in the duration, repeats, delays and yoyos. + * + * @name Phaser.Tweens.BaseTweenData#totalDuration + * @type {number} + * @since 3.60.0 + */ + this.totalDuration = 0; + + /** + * The time, in milliseconds, before this tween will start playing. + * + * This value is generated by the `getDelay` function. + * + * @name Phaser.Tweens.BaseTweenData#delay + * @type {number} + * @since 3.60.0 + */ + this.delay = 0; + + /** + * This function returns the value to be used for `TweenData.delay`. + * + * @name Phaser.Tweens.BaseTweenData#getDelay + * @type {function} + * @since 3.60.0 + */ + this.getDelay = delay; + + /** + * Will the Tween ease back to its starting values, after reaching the end + * and any `hold` value that may be set? + * + * @name Phaser.Tweens.BaseTweenData#yoyo + * @type {boolean} + * @since 3.60.0 + */ + this.yoyo = yoyo; + + /** + * The time, in milliseconds, before this tween will start a yoyo to repeat. + * + * @name Phaser.Tweens.BaseTweenData#hold + * @type {number} + * @since 3.60.0 + */ + this.hold = hold; + + /** + * The number of times this tween will repeat. + * + * The tween will always run once regardless of this value, + * so a repeat value of '1' will play the tween twice: I.e. the original + * play-through and then it repeats that once (1). + * + * If this value is set to -1 this tween will repeat forever. + * + * @name Phaser.Tweens.BaseTweenData#repeat + * @type {number} + * @since 3.60.0 + */ + this.repeat = repeat; + + /** + * The time, in milliseconds, before the repeat will start. + * + * @name Phaser.Tweens.BaseTweenData#repeatDelay + * @type {number} + * @since 3.60.0 + */ + this.repeatDelay = repeatDelay; + + /** + * How many repeats are left to run? + * + * @name Phaser.Tweens.BaseTweenData#repeatCounter + * @type {number} + * @since 3.60.0 + */ + this.repeatCounter = 0; + + /** + * If `true` this Tween will call `toggleFlipX` on the Tween target + * whenever it yoyo's or repeats. It will only be called if the target + * has a function matching this name, like most Phaser GameObjects do. + * + * @name Phaser.Tweens.BaseTweenData#flipX + * @type {boolean} + * @since 3.60.0 + */ + this.flipX = flipX; + + /** + * If `true` this Tween will call `toggleFlipY` on the Tween target + * whenever it yoyo's or repeats. It will only be called if the target + * has a function matching this name, like most Phaser GameObjects do. + * + * @name Phaser.Tweens.BaseTweenData#flipY + * @type {boolean} + * @since 3.60.0 + */ + this.flipY = flipY; + + /** + * A value between 0 and 1 holding the progress of this TweenData. + * + * @name Phaser.Tweens.BaseTweenData#progress + * @type {number} + * @since 3.60.0 + */ + this.progress = 0; + + /** + * The amount of time, in milliseconds, that has elapsed since this + * TweenData was made active. + * + * @name Phaser.Tweens.BaseTweenData#elapsed + * @type {number} + * @since 3.60.0 + */ + this.elapsed = 0; + + /** + * The state of this TweenData. + * + * @name Phaser.Tweens.BaseTweenData#state + * @type {Phaser.Tweens.StateType} + * @since 3.60.0 + */ + this.state = 0; + + /** + * Is this Tween Data currently waiting for a countdown to elapse, or not? + * + * @name Phaser.Tweens.BaseTweenData#isCountdown + * @type {boolean} + * @since 3.60.0 + */ + this.isCountdown = false; + }, + + /** + * Sets this TweenData state to CREATED. + * + * @method Phaser.Tweens.BaseTweenData#setCreatedState + * @since 3.60.0 + */ + setCreatedState: function () + { + this.state = TWEEN_CONST.CREATED; + this.isCountdown = false; + }, + + /** + * Sets this TweenData state to DELAY. + * + * @method Phaser.Tweens.BaseTweenData#setDelayState + * @since 3.60.0 + */ + setDelayState: function () + { + this.state = TWEEN_CONST.DELAY; + this.isCountdown = true; + }, + + /** + * Sets this TweenData state to PENDING_RENDER. + * + * @method Phaser.Tweens.BaseTweenData#setPendingRenderState + * @since 3.60.0 + */ + setPendingRenderState: function () + { + this.state = TWEEN_CONST.PENDING_RENDER; + this.isCountdown = false; + }, + + /** + * Sets this TweenData state to PLAYING_FORWARD. + * + * @method Phaser.Tweens.BaseTweenData#setPlayingForwardState + * @since 3.60.0 + */ + setPlayingForwardState: function () + { + this.state = TWEEN_CONST.PLAYING_FORWARD; + this.isCountdown = false; + }, + + /** + * Sets this TweenData state to PLAYING_BACKWARD. + * + * @method Phaser.Tweens.BaseTweenData#setPlayingBackwardState + * @since 3.60.0 + */ + setPlayingBackwardState: function () + { + this.state = TWEEN_CONST.PLAYING_BACKWARD; + this.isCountdown = false; + }, + + /** + * Sets this TweenData state to HOLD_DELAY. + * + * @method Phaser.Tweens.BaseTweenData#setHoldState + * @since 3.60.0 + */ + setHoldState: function () + { + this.state = TWEEN_CONST.HOLD_DELAY; + this.isCountdown = true; + }, + + /** + * Sets this TweenData state to REPEAT_DELAY. + * + * @method Phaser.Tweens.BaseTweenData#setRepeatState + * @since 3.60.0 + */ + setRepeatState: function () + { + this.state = TWEEN_CONST.REPEAT_DELAY; + this.isCountdown = true; + }, + + /** + * Sets this TweenData state to COMPLETE. + * + * @method Phaser.Tweens.BaseTweenData#setCompleteState + * @since 3.60.0 + */ + setCompleteState: function () + { + this.state = TWEEN_CONST.COMPLETE; + this.isCountdown = false; + }, + + /** + * Returns `true` if this TweenData has a _current_ state of CREATED, otherwise `false`. + * + * @method Phaser.Tweens.BaseTweenData#isCreated + * @since 3.60.0 + * + * @return {boolean} `true` if this TweenData has a _current_ state of CREATED, otherwise `false`. + */ + isCreated: function () + { + return (this.state === TWEEN_CONST.CREATED); + }, + + /** + * Returns `true` if this TweenData has a _current_ state of DELAY, otherwise `false`. + * + * @method Phaser.Tweens.BaseTweenData#isDelayed + * @since 3.60.0 + * + * @return {boolean} `true` if this TweenData has a _current_ state of DELAY, otherwise `false`. + */ + isDelayed: function () + { + return (this.state === TWEEN_CONST.DELAY); + }, + + /** + * Returns `true` if this TweenData has a _current_ state of PENDING_RENDER, otherwise `false`. + * + * @method Phaser.Tweens.BaseTweenData#isPendingRender + * @since 3.60.0 + * + * @return {boolean} `true` if this TweenData has a _current_ state of PENDING_RENDER, otherwise `false`. + */ + isPendingRender: function () + { + return (this.state === TWEEN_CONST.PENDING_RENDER); + }, + + /** + * Returns `true` if this TweenData has a _current_ state of PLAYING_FORWARD, otherwise `false`. + * + * @method Phaser.Tweens.BaseTweenData#isPlayingForward + * @since 3.60.0 + * + * @return {boolean} `true` if this TweenData has a _current_ state of PLAYING_FORWARD, otherwise `false`. + */ + isPlayingForward: function () + { + return (this.state === TWEEN_CONST.PLAYING_FORWARD); + }, + + /** + * Returns `true` if this TweenData has a _current_ state of PLAYING_BACKWARD, otherwise `false`. + * + * @method Phaser.Tweens.BaseTweenData#isPlayingBackward + * @since 3.60.0 + * + * @return {boolean} `true` if this TweenData has a _current_ state of PLAYING_BACKWARD, otherwise `false`. + */ + isPlayingBackward: function () + { + return (this.state === TWEEN_CONST.PLAYING_BACKWARD); + }, + + /** + * Returns `true` if this TweenData has a _current_ state of HOLD_DELAY, otherwise `false`. + * + * @method Phaser.Tweens.BaseTweenData#isHolding + * @since 3.60.0 + * + * @return {boolean} `true` if this TweenData has a _current_ state of HOLD_DELAY, otherwise `false`. + */ + isHolding: function () + { + return (this.state === TWEEN_CONST.HOLD_DELAY); + }, + + /** + * Returns `true` if this TweenData has a _current_ state of REPEAT_DELAY, otherwise `false`. + * + * @method Phaser.Tweens.BaseTweenData#isRepeating + * @since 3.60.0 + * + * @return {boolean} `true` if this TweenData has a _current_ state of REPEAT_DELAY, otherwise `false`. + */ + isRepeating: function () + { + return (this.state === TWEEN_CONST.REPEAT_DELAY); + }, + + /** + * Returns `true` if this TweenData has a _current_ state of COMPLETE, otherwise `false`. + * + * @method Phaser.Tweens.BaseTweenData#isComplete + * @since 3.60.0 + * + * @return {boolean} `true` if this TweenData has a _current_ state of COMPLETE, otherwise `false`. + */ + isComplete: function () + { + return (this.state === TWEEN_CONST.COMPLETE); + }, + + /** + * Immediately destroys this TweenData, nulling of all its references. + * + * @method Phaser.Tweens.BaseTweenData#destroy + * @since 3.60.0 + */ + destroy: function () + { + this.tween = null; + this.getDelay = null; + this.setCompleteState(); + } + +}); + +module.exports = BaseTweenData; + + /***/ }), /***/ 99730: @@ -214957,14 +217125,14 @@ module.exports = Tweens; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * @typedef {object} Phaser.Types.Tweens.TweenConfigDefaults * @since 3.0.0 - * + * * @property {(object|object[])} targets - The object, or an array of objects, to run the tween on. * @property {number} [delay=0] - The number of milliseconds to delay before the tween will start. * @property {number} [duration=1000] - The duration of the tween in milliseconds. @@ -214976,6 +217144,8 @@ module.exports = Tweens; * @property {boolean} [yoyo=false] - Should the tween complete, then reverse the values incrementally to get back to the starting tween values? The reverse tweening will also take `duration` milliseconds to complete. * @property {boolean} [flipX=false] - Horizontally flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the `flipX` property. * @property {boolean} [flipY=false] - Vertically flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the `flipY` property. + * @property {boolean} [persist=false] - Retain the tween within the Tween Manager, even after playback completes? + * @property {function} [interpolation=null] - The interpolation function to use for array-based tween values. */ var TWEEN_DEFAULTS = { @@ -214989,7 +217159,9 @@ var TWEEN_DEFAULTS = { repeatDelay: 0, yoyo: false, flipX: false, - flipY: false + flipY: false, + persist: false, + interpolation: null }; module.exports = TWEEN_DEFAULTS; @@ -215002,7 +217174,7 @@ module.exports = TWEEN_DEFAULTS; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -215014,17 +217186,15 @@ module.exports = TWEEN_DEFAULTS; // ease: The ease function used by the tween // easeParams: The parameters to go with the ease function (if any) // flipX: flip X the GameObject on tween end -// flipY: flip Y the GameObject on tween end// hold: The time the tween will pause before running a yoyo +// flipY: flip Y the GameObject on tween end // hold: The time the tween will pause before running a yoyo // loop: The time the tween will pause before starting either a yoyo or returning to the start for a repeat // loopDelay: -// offset: Used when the Tween is part of a Timeline // paused: Does the tween start in a paused state, or playing? // props: The properties being tweened by the tween // repeat: The number of times the tween will repeat itself (a value of 1 means the tween will play twice, as it repeated once) // repeatDelay: The time the tween will pause for before starting a repeat. The tween holds in the start state. // targets: The targets the tween is updating. -// useFrames: Use frames or milliseconds? // yoyo: boolean - Does the tween reverse itself (yoyo) when it reaches the end? module.exports = [ @@ -215037,39 +217207,35 @@ module.exports = [ 'flipX', 'flipY', 'hold', + 'interpolation', 'loop', 'loopDelay', - 'offset', 'onActive', 'onActiveParams', - 'onActiveScope', 'onComplete', 'onCompleteParams', - 'onCompleteScope', 'onLoop', 'onLoopParams', - 'onLoopScope', + 'onPause', + 'onPauseParams', 'onRepeat', 'onRepeatParams', - 'onRepeatScope', + 'onResume', + 'onResumeParams', 'onStart', 'onStartParams', - 'onStartScope', 'onStop', 'onStopParams', - 'onStopScope', 'onUpdate', 'onUpdateParams', - 'onUpdateScope', 'onYoyo', 'onYoyoParams', - 'onYoyoScope', 'paused', + 'persist', 'props', 'repeat', 'repeatDelay', 'targets', - 'useFrames', 'yoyo' ]; @@ -215081,17 +217247,19 @@ module.exports = [ /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var BaseTween = __webpack_require__(502); var Class = __webpack_require__(56694); -var EventEmitter = __webpack_require__(6659); var Events = __webpack_require__(54272); var GameObjectCreator = __webpack_require__(99325); var GameObjectFactory = __webpack_require__(61286); -var TWEEN_CONST = __webpack_require__(55303); var MATH_CONST = __webpack_require__(83392); +var TWEEN_CONST = __webpack_require__(55303); +var TweenData = __webpack_require__(15718); +var TweenFrameData = __webpack_require__(96490); /** * @classdesc @@ -215103,60 +217271,22 @@ var MATH_CONST = __webpack_require__(83392); * * @class Tween * @memberof Phaser.Tweens - * @extends Phaser.Events.EventEmitter + * @extends Phaser.Tweens.BaseTween * @constructor * @since 3.0.0 * - * @param {(Phaser.Tweens.TweenManager|Phaser.Tweens.Timeline)} parent - A reference to the parent of this Tween. Either the Tween Manager or a Tween Timeline instance. - * @param {Phaser.Types.Tweens.TweenDataConfig[]} data - An array of TweenData objects, each containing a unique property to be tweened. + * @param {Phaser.Tweens.TweenManager} parent - A reference to the Tween Manager that owns this Tween. * @param {array} targets - An array of targets to be tweened. */ var Tween = new Class({ - Extends: EventEmitter, + Extends: BaseTween, initialize: - function Tween (parent, data, targets) + function Tween (parent, targets) { - EventEmitter.call(this); - - /** - * A reference to the parent of this Tween. - * Either the Tween Manager or a Tween Timeline instance. - * - * @name Phaser.Tweens.Tween#parent - * @type {(Phaser.Tweens.TweenManager|Phaser.Tweens.Timeline)} - * @since 3.0.0 - */ - this.parent = parent; - - /** - * Is the parent of this Tween a Timeline? - * - * @name Phaser.Tweens.Tween#parentIsTimeline - * @type {boolean} - * @since 3.0.0 - */ - this.parentIsTimeline = parent.hasOwnProperty('isTimeline'); - - /** - * An array of TweenData objects, each containing a unique property and target being tweened. - * - * @name Phaser.Tweens.Tween#data - * @type {Phaser.Types.Tweens.TweenDataConfig[]} - * @since 3.0.0 - */ - this.data = data; - - /** - * The cached length of the data array. - * - * @name Phaser.Tweens.Tween#totalData - * @type {number} - * @since 3.0.0 - */ - this.totalData = data.length; + BaseTween.call(this, parent); /** * An array of references to the target/s this Tween is operating on. @@ -215176,80 +217306,6 @@ var Tween = new Class({ */ this.totalTargets = targets.length; - /** - * If `true` then duration, delay, etc values are all frame totals. - * - * @name Phaser.Tweens.Tween#useFrames - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.useFrames = false; - - /** - * Scales the time applied to this Tween. A value of 1 runs in real-time. A value of 0.5 runs 50% slower, and so on. - * Value isn't used when calculating total duration of the tween, it's a run-time delta adjustment only. - * - * @name Phaser.Tweens.Tween#timeScale - * @type {number} - * @default 1 - * @since 3.0.0 - */ - this.timeScale = 1; - - /** - * Loop this tween? Can be -1 for an infinite loop, or an integer. - * When enabled it will play through ALL TweenDatas again. Use TweenData.repeat to loop a single element. - * - * @name Phaser.Tweens.Tween#loop - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.loop = 0; - - /** - * Time in ms/frames before the tween loops. - * - * @name Phaser.Tweens.Tween#loopDelay - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.loopDelay = 0; - - /** - * How many loops are left to run? - * - * @name Phaser.Tweens.Tween#loopCounter - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.loopCounter = 0; - - /** - * Time in ms/frames before the 'onStart' event fires. - * This is the shortest `delay` value across all of the TweenDatas of this Tween. - * - * @name Phaser.Tweens.Tween#startDelay - * @type {number} - * @default 0 - * @since 3.19.0 - */ - this.startDelay = 0; - - /** - * Has this Tween started playback yet? - * This boolean is toggled when the Tween leaves the 'delayed' state and starts running. - * - * @name Phaser.Tweens.Tween#hasStarted - * @type {boolean} - * @readonly - * @since 3.19.0 - */ - this.hasStarted = false; - /** * Is this Tween currently seeking? * This boolean is toggled in the `Tween.seek` method. @@ -215263,81 +217319,12 @@ var Tween = new Class({ this.isSeeking = false; /** - * Time in ms/frames before the 'onComplete' event fires. This never fires if loop = -1 (as it never completes) - * - * @name Phaser.Tweens.Tween#completeDelay - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.completeDelay = 0; - - /** - * Countdown timer (used by timeline offset, loopDelay and completeDelay) - * - * @name Phaser.Tweens.Tween#countdown - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.countdown = 0; - - /** - * Set only if this Tween is part of a Timeline. - * - * @name Phaser.Tweens.Tween#offset - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.offset = 0; - - /** - * Set only if this Tween is part of a Timeline. The calculated offset amount. - * - * @name Phaser.Tweens.Tween#calculatedOffset - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.calculatedOffset = 0; - - /** - * The current state of the tween - * - * @name Phaser.Tweens.Tween#state - * @type {number} - * @since 3.0.0 - */ - this.state = TWEEN_CONST.PENDING_ADD; - - /** - * The state of the tween when it was paused (used by Resume) - * - * @name Phaser.Tweens.Tween#_pausedState - * @type {number} - * @private - * @since 3.0.0 - */ - this._pausedState = TWEEN_CONST.INIT; - - /** - * Does the Tween start off paused? (if so it needs to be started with Tween.play) - * - * @name Phaser.Tweens.Tween#paused - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.paused = false; - - /** - * Elapsed time in ms/frames of this run through the Tween. + * Elapsed time in ms/frames of this run through of the Tween. * * @name Phaser.Tweens.Tween#elapsed * @type {number} * @default 0 - * @since 3.0.0 + * @since 3.60.0 */ this.elapsed = 0; @@ -215347,7 +217334,7 @@ var Tween = new Class({ * @name Phaser.Tweens.Tween#totalElapsed * @type {number} * @default 0 - * @since 3.0.0 + * @since 3.60.0 */ this.totalElapsed = 0; @@ -215357,27 +217344,27 @@ var Tween = new Class({ * @name Phaser.Tweens.Tween#duration * @type {number} * @default 0 - * @since 3.0.0 + * @since 3.60.0 */ this.duration = 0; /** - * Value between 0 and 1. The amount through the Tween, excluding loops. + * Value between 0 and 1. The amount of progress through the Tween, excluding loops. * * @name Phaser.Tweens.Tween#progress * @type {number} * @default 0 - * @since 3.0.0 + * @since 3.60.0 */ this.progress = 0; /** - * Time in ms/frames for the Tween to complete (including looping) + * Time in ms/frames it takes for the Tween to complete a full playthrough (including looping) * * @name Phaser.Tweens.Tween#totalDuration * @type {number} * @default 0 - * @since 3.0.0 + * @since 3.60.0 */ this.totalDuration = 0; @@ -215387,46 +217374,85 @@ var Tween = new Class({ * @name Phaser.Tweens.Tween#totalProgress * @type {number} * @default 0 - * @since 3.0.0 + * @since 3.60.0 */ this.totalProgress = 0; /** - * An object containing the different Tween callback functions. + * The delta used in the current update. * - * You can either set these in the Tween config, or by calling the `Tween.setCallback` method. - * - * `onActive` When the Tween is moved from the pending to the active list in the Tween Manager, even if playback paused. - * `onStart` When the Tween starts playing after a delayed state. Will happen at the same time as `onActive` if it has no delay. - * `onYoyo` When a TweenData starts a yoyo. This happens _after_ the `hold` delay expires, if set. - * `onRepeat` When a TweenData repeats playback. This happens _after_ the `repeatDelay` expires, if set. - * `onComplete` When the Tween finishes playback fully. Never invoked if tween is set to repeat infinitely. - * `onUpdate` When a TweenData updates a property on a source target during playback. - * `onLoop` When a Tween loops. This happens _after_ the `loopDelay` expires, if set. - * - * @name Phaser.Tweens.Tween#callbacks - * @type {object} - * @since 3.0.0 + * @name Phaser.Tweens.Tween#delta + * @type {number} + * @default 0 + * @since 3.60.0 */ - this.callbacks = { - onActive: null, - onComplete: null, - onLoop: null, - onRepeat: null, - onStart: null, - onStop: null, - onUpdate: null, - onYoyo: null - }; + this.delta = 0; + }, - /** - * The context in which all callbacks are invoked. - * - * @name Phaser.Tweens.Tween#callbackScope - * @type {any} - * @since 3.0.0 - */ - this.callbackScope; + /** + * Adds a new TweenData to this Tween. Typically, this method is called + * automatically by the TweenBuilder, however you can also invoke it + * yourself. + * + * @method Phaser.Tweens.Tween#add + * @since 3.60.0 + * + * @param {number} targetIndex - The target index within the Tween targets array. + * @param {string} key - The property of the target to tween. + * @param {Phaser.Types.Tweens.GetEndCallback} getEnd - What the property will be at the END of the Tween. + * @param {Phaser.Types.Tweens.GetStartCallback} getStart - What the property will be at the START of the Tween. + * @param {?Phaser.Types.Tweens.GetActiveCallback} getActive - If not null, is invoked _immediately_ as soon as the TweenData is running, and is set on the target property. + * @param {function} ease - The ease function this tween uses. + * @param {function} delay - Function that returns the time in ms/frames before tween will start. + * @param {number} duration - The duration of the tween in ms/frames. + * @param {boolean} yoyo - Determines whether the tween should return back to its start value after hold has expired. + * @param {number} hold - Function that returns the time in ms/frames the tween will pause before repeating or returning to its starting value if yoyo is set to true. + * @param {number} repeat - Function that returns the number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. + * @param {number} repeatDelay - Function that returns the time in ms/frames before the repeat will start. + * @param {boolean} flipX - Should toggleFlipX be called when yoyo or repeat happens? + * @param {boolean} flipY - Should toggleFlipY be called when yoyo or repeat happens? + * @param {?function} interpolation - The interpolation function to be used for arrays of data. Defaults to 'null'. + * @param {?number[]} interpolationData - The array of interpolation data to be set. Defaults to 'null'. + * + * @return {Phaser.Tweens.TweenData} The TweenData instance that was added. + */ + add: function (targetIndex, key, getEnd, getStart, getActive, ease, delay, duration, yoyo, hold, repeat, repeatDelay, flipX, flipY, interpolation, interpolationData) + { + var tweenData = new TweenData(this, targetIndex, key, getEnd, getStart, getActive, ease, delay, duration, yoyo, hold, repeat, repeatDelay, flipX, flipY, interpolation, interpolationData); + + this.totalData = this.data.push(tweenData); + + return tweenData; + }, + + /** + * Adds a new TweenFrameData to this Tween. Typically, this method is called + * automatically by the TweenBuilder, however you can also invoke it + * yourself. + * + * @method Phaser.Tweens.Tween#addFrame + * @since 3.60.0 + * + * @param {number} targetIndex - The target index within the Tween targets array. + * @param {string} texture - The texture to set on the target at the end of the tween. + * @param {string|number} frame - The texture frame to set on the target at the end of the tween. + * @param {function} delay - Function that returns the time in ms/frames before tween will start. + * @param {number} duration - The duration of the tween in ms/frames. + * @param {number} hold - Function that returns the time in ms/frames the tween will pause before repeating or returning to its starting value if yoyo is set to true. + * @param {number} repeat - Function that returns the number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. + * @param {number} repeatDelay - Function that returns the time in ms/frames before the repeat will start. + * @param {boolean} flipX - Should toggleFlipX be called when yoyo or repeat happens? + * @param {boolean} flipY - Should toggleFlipY be called when yoyo or repeat happens? + * + * @return {Phaser.Tweens.TweenFrameData} The TweenFrameData instance that was added. + */ + addFrame: function (targetIndex, texture, frame, delay, duration, hold, repeat, repeatDelay, flipX, flipY) + { + var tweenData = new TweenFrameData(this, targetIndex, texture, frame, delay, duration, hold, repeat, repeatDelay, flipX, flipY); + + this.totalData = this.data.push(tweenData); + + return tweenData; }, /** @@ -215446,62 +217472,6 @@ var Tween = new Class({ return this.data[index].current; }, - /** - * Set the scale the time applied to this Tween. A value of 1 runs in real-time. A value of 0.5 runs 50% slower, and so on. - * - * @method Phaser.Tweens.Tween#setTimeScale - * @since 3.0.0 - * - * @param {number} value - The scale factor for timescale. - * - * @return {this} - This Tween instance. - */ - setTimeScale: function (value) - { - this.timeScale = value; - - return this; - }, - - /** - * Returns the scale of the time applied to this Tween. - * - * @method Phaser.Tweens.Tween#getTimeScale - * @since 3.0.0 - * - * @return {number} The timescale of this tween (between 0 and 1) - */ - getTimeScale: function () - { - return this.timeScale; - }, - - /** - * Checks if the Tween is currently active. - * - * @method Phaser.Tweens.Tween#isPlaying - * @since 3.0.0 - * - * @return {boolean} `true` if the Tween is active, otherwise `false`. - */ - isPlaying: function () - { - return (this.state === TWEEN_CONST.ACTIVE); - }, - - /** - * Checks if the Tween is currently paused. - * - * @method Phaser.Tweens.Tween#isPaused - * @since 3.0.0 - * - * @return {boolean} `true` if the Tween is paused, otherwise `false`. - */ - isPaused: function () - { - return (this.state === TWEEN_CONST.PAUSED); - }, - /** * See if this Tween is currently acting upon the given target. * @@ -215531,7 +217501,7 @@ var Tween = new Class({ * @param {*} value - The new value of the property. * @param {boolean} [startToCurrent=false] - Should this change set the start value to be the current value? * - * @return {this} - This Tween instance. + * @return {this} This Tween instance. */ updateTo: function (key, value, startToCurrent) { @@ -215556,7 +217526,12 @@ var Tween = new Class({ }, /** - * Restarts the tween from the beginning. + * Restarts the Tween from the beginning. + * + * You can only restart a Tween that is currently playing. If the Tween has already been stopped, restarting + * it will throw an error. + * + * If you wish to restart the Tween from a specific point, use the `Tween.seek` method instead. * * @method Phaser.Tweens.Tween#restart * @since 3.0.0 @@ -215565,172 +217540,32 @@ var Tween = new Class({ */ restart: function () { - // Reset these so they're ready for the next update - this.elapsed = 0; - this.progress = 0; - this.totalElapsed = 0; - this.totalProgress = 0; - - if (this.state === TWEEN_CONST.ACTIVE) + switch (this.state) { - return this.seek(0); - } - else if (this.state === TWEEN_CONST.REMOVED) - { - this.seek(0); - this.parent.makeActive(this); + case TWEEN_CONST.REMOVED: + case TWEEN_CONST.FINISHED: + this.seek(); + this.parent.makeActive(this); + break; - return this; - } - else if (this.state === TWEEN_CONST.PENDING_ADD) - { - return this; - } - else - { - return this.play(); - } - }, + case TWEEN_CONST.PENDING: + case TWEEN_CONST.PENDING_REMOVE: + this.parent.reset(this); + break; - /** - * Internal method that calculates the overall duration of the Tween. - * - * @method Phaser.Tweens.Tween#calcDuration - * @since 3.0.0 - */ - calcDuration: function () - { - var maxDuration = 0; - var minDelay = MATH_CONST.MAX_SAFE_INTEGER; + case TWEEN_CONST.DESTROYED: + console.warn('Cannot restart destroyed Tweens', this); + break; - var data = this.data; - - for (var i = 0; i < this.totalData; i++) - { - var tweenData = data[i]; - - // Set t1 (duration + hold + yoyo) - tweenData.t1 = tweenData.duration + tweenData.hold; - - if (tweenData.yoyo) - { - tweenData.t1 += tweenData.duration; - } - - // Set t2 (repeatDelay + duration + hold + yoyo) - tweenData.t2 = tweenData.t1 + tweenData.repeatDelay; - - // Total Duration - tweenData.totalDuration = tweenData.delay + tweenData.t1; - - if (tweenData.repeat === -1) - { - tweenData.totalDuration += (tweenData.t2 * 999999999999); - } - else if (tweenData.repeat > 0) - { - tweenData.totalDuration += (tweenData.t2 * tweenData.repeat); - } - - if (tweenData.totalDuration > maxDuration) - { - // Get the longest TweenData from the Tween, used to calculate the Tween TD - maxDuration = tweenData.totalDuration; - } - - if (tweenData.delay < minDelay) - { - minDelay = tweenData.delay; - } + default: + this.seek(); + break; } - // Excludes loop values + this.paused = false; + this.hasStarted = false; - // If duration has been set to 0 then we give it a super-low value so that it always - // renders at least 1 frame, but no more, without causing divided by zero errors elsewhere. - this.duration = Math.max(maxDuration, 0.001); - - this.loopCounter = (this.loop === -1) ? 999999999999 : this.loop; - - if (this.loopCounter > 0) - { - this.totalDuration = this.duration + this.completeDelay + ((this.duration + this.loopDelay) * this.loopCounter); - } - else - { - this.totalDuration = this.duration + this.completeDelay; - } - - // How long before this Tween starts playback? - this.startDelay = minDelay; - }, - - /** - * Called by TweenManager.preUpdate as part of its loop to check pending and active tweens. - * Should not be called directly. - * - * @method Phaser.Tweens.Tween#init - * @since 3.0.0 - * - * @return {boolean} Returns `true` if this Tween should be moved from the pending list to the active list by the Tween Manager. - */ - init: function () - { - // You can't have a paused Tween if it's part of a Timeline - if (this.paused && !this.parentIsTimeline) - { - this.state = TWEEN_CONST.PENDING_ADD; - this._pausedState = TWEEN_CONST.INIT; - - return false; - } - - var data = this.data; - var totalTargets = this.totalTargets; - - for (var i = 0; i < this.totalData; i++) - { - var tweenData = data[i]; - var target = tweenData.target; - var gen = tweenData.gen; - var key = tweenData.key; - var targetIndex = tweenData.index; - - // Old function signature: i, totalTargets, target - // New function signature: target, key, value, index, total, tween - - tweenData.delay = gen.delay(target, key, 0, targetIndex, totalTargets, this); - tweenData.duration = Math.max(gen.duration(target, key, 0, targetIndex, totalTargets, this), 0.001); - tweenData.hold = gen.hold(target, key, 0, targetIndex, totalTargets, this); - tweenData.repeat = gen.repeat(target, key, 0, targetIndex, totalTargets, this); - tweenData.repeatDelay = gen.repeatDelay(target, key, 0, targetIndex, totalTargets, this); - } - - this.calcDuration(); - - this.progress = 0; - this.totalProgress = 0; - this.elapsed = 0; - this.totalElapsed = 0; - - this.state = TWEEN_CONST.INIT; - - return true; - }, - - /** - * Internal method that makes this Tween active within the TweenManager - * and emits the onActive event and callback. - * - * @method Phaser.Tweens.Tween#makeActive - * @fires Phaser.Tweens.Events#TWEEN_ACTIVE - * @since 3.19.0 - */ - makeActive: function () - { - this.parent.makeActive(this); - - this.dispatchTweenEvent(Events.TWEEN_ACTIVE, this.callbacks.onActive); + return this; }, /** @@ -215740,6 +217575,8 @@ var Tween = new Class({ * @fires Phaser.Tweens.Events#TWEEN_COMPLETE * @fires Phaser.Tweens.Events#TWEEN_LOOP * @since 3.0.0 + * + * @return {boolean} `true` if this Tween has completed, otherwise `false`. */ nextState: function () { @@ -215754,51 +217591,45 @@ var Tween = new Class({ if (this.loopDelay > 0) { this.countdown = this.loopDelay; - this.state = TWEEN_CONST.LOOP_DELAY; + + this.setLoopDelayState(); } else { - this.state = TWEEN_CONST.ACTIVE; + this.setActiveState(); - this.dispatchTweenEvent(Events.TWEEN_LOOP, this.callbacks.onLoop); + this.dispatchEvent(Events.TWEEN_LOOP, 'onLoop'); } } else if (this.completeDelay > 0) { - this.state = TWEEN_CONST.COMPLETE_DELAY; - this.countdown = this.completeDelay; + + this.setCompleteDelayState(); } else { - this.state = TWEEN_CONST.PENDING_REMOVE; + this.onCompleteHandler(); - this.dispatchTweenEvent(Events.TWEEN_COMPLETE, this.callbacks.onComplete); + return true; } + + return false; }, /** - * Pauses the Tween immediately. Use `resume` to continue playback. + * Internal method that handles this tween completing and starting + * the next tween in the chain, if any. * - * @method Phaser.Tweens.Tween#pause - * @since 3.0.0 - * - * @return {this} - This Tween instance. + * @method Phaser.Tweens.Tween#onCompleteHandler + * @since 3.60.0 */ - pause: function () + onCompleteHandler: function () { - if (this.state === TWEEN_CONST.PAUSED) - { - return this; - } + this.progress = 1; + this.totalProgress = 1; - this.paused = true; - - this._pausedState = this.state; - - this.state = TWEEN_CONST.PAUSED; - - return this; + BaseTween.prototype.onCompleteHandler.call(this); }, /** @@ -215809,71 +217640,32 @@ var Tween = new Class({ * If the Tween is already playing, calling this method again will have no effect. If you wish to * restart the Tween, use `Tween.restart` instead. * - * Calling this method after the Tween has completed will start the Tween playing again from the start. + * Calling this method after the Tween has completed will start the Tween playing again from the beginning. * This is the same as calling `Tween.seek(0)` and then `Tween.play()`. * * @method Phaser.Tweens.Tween#play * @since 3.0.0 * - * @param {boolean} [resetFromTimeline=false] - Is this Tween being played as part of a Timeline? - * * @return {this} This Tween instance. */ - play: function (resetFromTimeline) + play: function () { - if (resetFromTimeline === undefined) { resetFromTimeline = false; } - - var state = this.state; - - if (state === TWEEN_CONST.INIT && !this.parentIsTimeline) + if (this.isDestroyed()) { - this.resetTweenData(false); - - this.state = TWEEN_CONST.ACTIVE; - - return this; - } - else if (state === TWEEN_CONST.ACTIVE || (state === TWEEN_CONST.PENDING_ADD && this._pausedState === TWEEN_CONST.PENDING_ADD)) - { - return this; - } - else if (!this.parentIsTimeline && (state === TWEEN_CONST.PENDING_REMOVE || state === TWEEN_CONST.REMOVED)) - { - this.seek(0); - this.parent.makeActive(this); + console.warn('Cannot play destroyed Tween', this); return this; } - if (this.parentIsTimeline) + if (this.isPendingRemove() || this.isPending()) { - this.resetTweenData(resetFromTimeline); - - if (this.calculatedOffset === 0) - { - this.state = TWEEN_CONST.ACTIVE; - } - else - { - this.countdown = this.calculatedOffset; - - this.state = TWEEN_CONST.OFFSET_DELAY; - } + // This makes the tween active as well: + this.seek(); } - else if (this.paused) - { - this.paused = false; - this.makeActive(); - } - else - { - this.resetTweenData(resetFromTimeline); + this.paused = false; - this.state = TWEEN_CONST.ACTIVE; - - this.makeActive(); - } + this.setActiveState(); return this; }, @@ -215890,74 +217682,13 @@ var Tween = new Class({ { var data = this.data; var total = this.totalData; - var totalTargets = this.totalTargets; for (var i = 0; i < total; i++) { - var tweenData = data[i]; - - var target = tweenData.target; - var key = tweenData.key; - var targetIndex = tweenData.index; - - tweenData.progress = 0; - tweenData.elapsed = 0; - - tweenData.repeatCounter = (tweenData.repeat === -1) ? 999999999999 : tweenData.repeat; - - if (resetFromLoop) - { - tweenData.start = tweenData.getStartValue(target, key, tweenData.start, targetIndex, totalTargets, this); - - tweenData.end = tweenData.getEndValue(target, key, tweenData.end, targetIndex, totalTargets, this); - - tweenData.current = tweenData.start; - - tweenData.state = TWEEN_CONST.PLAYING_FORWARD; - } - else - { - tweenData.state = TWEEN_CONST.PENDING_RENDER; - } - - if (tweenData.delay > 0) - { - tweenData.elapsed = tweenData.delay; - - tweenData.state = TWEEN_CONST.DELAY; - } - - if (tweenData.getActiveValue) - { - target[key] = tweenData.getActiveValue(tweenData.target, tweenData.key, tweenData.start); - } + data[i].reset(resetFromLoop); } }, - /** - * Resumes the playback of a previously paused Tween. - * - * @method Phaser.Tweens.Tween#resume - * @since 3.0.0 - * - * @return {this} - This Tween instance. - */ - resume: function () - { - if (this.state === TWEEN_CONST.PAUSED) - { - this.paused = false; - - this.state = this._pausedState; - } - else - { - this.play(); - } - - return this; - }, - /** * Seeks to a specific point in the Tween. * @@ -215977,222 +217708,108 @@ var Tween = new Class({ * @method Phaser.Tweens.Tween#seek * @since 3.0.0 * - * @param {number} toPosition - A value between 0 and 1 which represents the progress point to seek to. - * @param {number} [delta=16.6] - The size of each step when seeking through the Tween. A higher value completes faster but at a cost of less precision. + * @param {number} [toPosition=0] - A value between 0 and 1 which represents the progress point to seek to. + * @param {number} [delta=16.6] - The size of each step when seeking through the Tween. A higher value completes faster but at the cost of less precision. * * @return {this} This Tween instance. */ seek: function (toPosition, delta) { + if (toPosition === undefined) { toPosition = 0; } if (delta === undefined) { delta = 16.6; } - if (this.state === TWEEN_CONST.REMOVED) + if (this.isRemoved() || this.isFinished()) { this.makeActive(); } + this.initTweenData(true); + + if (toPosition > 0) + { + this.isSeeking = true; + + do + { + this.update(delta); + + } while (this.totalProgress <= toPosition); + + this.isSeeking = false; + } + + return this; + }, + + /** + * Initialises all of the Tween Data and Tween values. + * + * This is called automatically and should not typically be invoked directly. + * + * @method Phaser.Tweens.Tween#initTweenData + * @since 3.60.0 + * + * @param {boolean} [isSeek=false] - Is this being called as part of a seek, or not? + */ + initTweenData: function (isSeek) + { + if (isSeek === undefined) { isSeek = false; } + + this.reset(true); + + // These two values are set directly during TweenData.init: + this.duration = 0; + this.startDelay = MATH_CONST.MAX_SAFE_INTEGER; + + var data = this.data; + + for (var i = 0; i < this.totalData; i++) + { + data[i].init(isSeek); + } + + // Clamp duration to ensure we never divide by zero + this.duration = Math.max(this.duration, 0.01); + + if (this.loopCounter > 0) + { + this.totalDuration = this.duration + this.completeDelay + ((this.duration + this.loopDelay) * this.loopCounter); + } + else + { + this.totalDuration = this.duration + this.completeDelay; + } + }, + + /** + * Resets this Tween ready for another play-through from the parent TweenChain. + * + * This is called automatically and should not typically be invoked directly. + * + * If you wish to restart this Tween, see `Tween.restart` or `Tween.seek` instead. + * + * @method Phaser.Tweens.Tween#reset + * @since 3.60.0 + * + * @param {boolean} [skipReset=false] - Skip resetting the TweenData and Active State? + */ + reset: function (skipReset) + { this.elapsed = 0; this.progress = 0; this.totalElapsed = 0; this.totalProgress = 0; - var data = this.data; - var totalTargets = this.totalTargets; + this.loopCounter = (this.loop === -1) ? 999999999999 : this.loop; - for (var i = 0; i < this.totalData; i++) + if (!skipReset) { - var tweenData = data[i]; - var target = tweenData.target; - var gen = tweenData.gen; - var key = tweenData.key; - var targetIndex = tweenData.index; + this.resetTweenData(true); - tweenData.progress = 0; - tweenData.elapsed = 0; + this.setActiveState(); - tweenData.repeatCounter = (tweenData.repeat === -1) ? 999999999999 : tweenData.repeat; - - // Old function signature: i, totalTargets, target - // New function signature: target, key, value, index, total, tween - - tweenData.delay = gen.delay(target, key, 0, targetIndex, totalTargets, this); - tweenData.duration = Math.max(gen.duration(target, key, 0, targetIndex, totalTargets, this), 0.001); - tweenData.hold = gen.hold(target, key, 0, targetIndex, totalTargets, this); - tweenData.repeat = gen.repeat(target, key, 0, targetIndex, totalTargets, this); - tweenData.repeatDelay = gen.repeatDelay(target, key, 0, targetIndex, totalTargets, this); - - tweenData.current = tweenData.start; - tweenData.state = TWEEN_CONST.PLAYING_FORWARD; - - this.updateTweenData(this, tweenData, 0, targetIndex, totalTargets); - - if (tweenData.delay > 0) - { - tweenData.elapsed = tweenData.delay; - tweenData.state = TWEEN_CONST.DELAY; - } + this.dispatchEvent(Events.TWEEN_ACTIVE, 'onActive'); } - - this.calcDuration(); - - var wasPaused = false; - - if (this.state === TWEEN_CONST.PAUSED) - { - wasPaused = true; - - this.state = TWEEN_CONST.ACTIVE; - } - - this.isSeeking = true; - - do - { - this.update(0, delta); - - } while (this.totalProgress < toPosition); - - this.isSeeking = false; - - if (wasPaused) - { - this.state = TWEEN_CONST.PAUSED; - } - - return this; - }, - - /** - * Sets an event based callback to be invoked during playback. - * - * Calling this method will replace a previously set callback for the given type, if any exists. - * - * The types available are: - * - * `onActive` When the Tween is moved from the pending to the active list in the Tween Manager, even if playback paused. - * `onStart` When the Tween starts playing after a delayed state. Will happen at the same time as `onActive` if it has no delay. - * `onYoyo` When a TweenData starts a yoyo. This happens _after_ the `hold` delay expires, if set. - * `onRepeat` When a TweenData repeats playback. This happens _after_ the `repeatDelay` expires, if set. - * `onComplete` When the Tween finishes playback fully or `Tween.stop` is called. Never invoked if tween is set to repeat infinitely. - * `onUpdate` When a TweenData updates a property on a source target during playback. - * `onLoop` When a Tween loops. This happens _after_ the `loopDelay` expires, if set. - * - * @method Phaser.Tweens.Tween#setCallback - * @since 3.0.0 - * - * @param {string} type - Type of the callback to set. - * @param {function} callback - The function to invoke when this callback happens. - * @param {array} [params] - An array of parameters for specified callbacks types. - * @param {any} [scope] - The context the callback will be invoked in. - * - * @return {this} This Tween instance. - */ - setCallback: function (type, callback, params, scope) - { - this.callbacks[type] = { func: callback, scope: scope, params: [ this, null ].concat(params) }; - - return this; - }, - - /** - * Flags the Tween as being complete, whatever stage of progress it is at. - * - * If an onComplete callback has been defined it will automatically invoke it, unless a `delay` - * argument is provided, in which case the Tween will delay for that period of time before calling the callback. - * - * If you don't need a delay, or have an onComplete callback, then call `Tween.stop` instead. - * - * @method Phaser.Tweens.Tween#complete - * @fires Phaser.Tweens.Events#TWEEN_COMPLETE - * @since 3.2.0 - * - * @param {number} [delay=0] - The time to wait before invoking the complete callback. If zero it will fire immediately. - * - * @return {this} This Tween instance. - */ - complete: function (delay) - { - if (delay === undefined) { delay = 0; } - - if (delay) - { - this.state = TWEEN_CONST.COMPLETE_DELAY; - - this.countdown = delay; - } - else - { - this.state = TWEEN_CONST.PENDING_REMOVE; - - this.dispatchTweenEvent(Events.TWEEN_COMPLETE, this.callbacks.onComplete); - } - - return this; - }, - - /** - * Immediately removes this Tween from the TweenManager and all of its internal arrays, - * no matter what stage it as it. Then sets the tween state to `REMOVED`. - * - * You should dispose of your reference to this tween after calling this method, to - * free it from memory. - * - * @method Phaser.Tweens.Tween#remove - * @since 3.17.0 - * - * @return {this} This Tween instance. - */ - remove: function () - { - this.parent.remove(this); - - return this; - }, - - /** - * Stops the Tween immediately, whatever stage of progress it is at and flags it for removal by the TweenManager. - * - * @method Phaser.Tweens.Tween#stop - * @since 3.0.0 - * - * @param {number} [resetTo] - If you want to seek the tween, provide a value between 0 and 1. - * - * @return {this} This Tween instance. - */ - stop: function (resetTo) - { - if (this.state === TWEEN_CONST.ACTIVE) - { - if (resetTo !== undefined) - { - this.seek(resetTo); - } - } - - if (this.state !== TWEEN_CONST.REMOVED) - { - if (this.state === TWEEN_CONST.PAUSED || this.state === TWEEN_CONST.PENDING_ADD) - { - if (this.parentIsTimeline) - { - this.parent.manager._destroy.push(this); - this.parent.manager._toProcess++; - } - else - { - this.parent._destroy.push(this); - this.parent._toProcess++; - } - } - - this.dispatchTweenEvent(Events.TWEEN_STOP, this.callbacks.onStop); - - this.removeAllListeners(); - - this.state = TWEEN_CONST.PENDING_REMOVE; - } - - return this; }, /** @@ -216204,24 +217821,62 @@ var Tween = new Class({ * @fires Phaser.Tweens.Events#TWEEN_START * @since 3.0.0 * - * @param {number} timestamp - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. * * @return {boolean} Returns `true` if this Tween has finished and should be removed from the Tween Manager, otherwise returns `false`. */ - update: function (timestamp, delta) + update: function (delta) { - if (this.state === TWEEN_CONST.PAUSED) + if (this.isPendingRemove() || this.isDestroyed()) + { + return true; + } + else if (this.isFinished() || (this.paused && !this.isSeeking)) { return false; } - if (this.useFrames) + delta *= this.timeScale * this.parent.timeScale; + + if (this.isLoopDelayed()) { - delta = 1 * this.parent.timeScale; + this.updateLoopCountdown(delta); + } + else if (this.isCompleteDelayed()) + { + this.updateCompleteDelay(delta); + } + else if (!this.hasStarted && !this.isSeeking) + { + this.startDelay -= delta; + + if (this.startDelay <= 0) + { + this.hasStarted = true; + + this.dispatchEvent(Events.TWEEN_START, 'onStart'); + + // Reset the delta so we always start progress from zero + delta = 0; + } } - delta *= this.timeScale; + var stillRunning = false; + + if (this.isActive()) + { + var data = this.data; + + for (var i = 0; i < this.totalData; i++) + { + if (data[i].update(delta)) + { + stillRunning = true; + } + } + } + + this.delta = delta; this.elapsed += delta; this.progress = Math.min(this.elapsed / this.duration, 1); @@ -216229,450 +217884,67 @@ var Tween = new Class({ this.totalElapsed += delta; this.totalProgress = Math.min(this.totalElapsed / this.totalDuration, 1); - switch (this.state) + // Anything still running? If not, we're done + if (!stillRunning) { - case TWEEN_CONST.ACTIVE: - - if (!this.hasStarted && !this.isSeeking) - { - this.startDelay -= delta; - - if (this.startDelay <= 0) - { - this.hasStarted = true; - - this.dispatchTweenEvent(Events.TWEEN_START, this.callbacks.onStart); - } - } - - var stillRunning = false; - - for (var i = 0; i < this.totalData; i++) - { - var tweenData = this.data[i]; - - if (this.updateTweenData(this, tweenData, delta)) - { - stillRunning = true; - } - } - - // Anything still running? If not, we're done - if (!stillRunning) - { - this.nextState(); - } - - break; - - case TWEEN_CONST.LOOP_DELAY: - - this.countdown -= delta; - - if (this.countdown <= 0) - { - this.state = TWEEN_CONST.ACTIVE; - - this.dispatchTweenEvent(Events.TWEEN_LOOP, this.callbacks.onLoop); - } - - break; - - case TWEEN_CONST.OFFSET_DELAY: - - this.countdown -= delta; - - if (this.countdown <= 0) - { - this.state = TWEEN_CONST.ACTIVE; - } - - break; - - case TWEEN_CONST.COMPLETE_DELAY: - - this.countdown -= delta; - - if (this.countdown <= 0) - { - this.state = TWEEN_CONST.PENDING_REMOVE; - - this.dispatchTweenEvent(Events.TWEEN_COMPLETE, this.callbacks.onComplete); - } - - break; + // This calls onCompleteHandler if this tween is over + this.nextState(); } - return (this.state === TWEEN_CONST.PENDING_REMOVE); - }, + // if nextState called onCompleteHandler then we're ready to be removed, unless we persist + var remove = this.isPendingRemove(); - /** - * Internal method that will emit a TweenData based Event and invoke the given callback. - * - * @method Phaser.Tweens.Tween#dispatchTweenDataEvent - * @since 3.19.0 - * - * @param {Phaser.Types.Tweens.Event} event - The Event to be dispatched. - * @param {function} callback - The callback to be invoked. Can be `null` or `undefined` to skip invocation. - * @param {Phaser.Types.Tweens.TweenDataConfig} tweenData - The TweenData object that caused this event. - */ - dispatchTweenDataEvent: function (event, callback, tweenData) - { - if (!this.isSeeking) + if (remove && this.persist) { - this.emit(event, this, tweenData.key, tweenData.target, tweenData.current, tweenData.previous); + this.setFinishedState(); - if (callback) - { - callback.params[1] = tweenData.target; - - callback.func.apply(callback.scope, callback.params); - } + remove = false; } + + return remove; }, /** * Internal method that will emit a Tween based Event and invoke the given callback. * - * @method Phaser.Tweens.Tween#dispatchTweenEvent - * @since 3.19.0 + * @method Phaser.Tweens.Tween#dispatchEvent + * @since 3.60.0 * * @param {Phaser.Types.Tweens.Event} event - The Event to be dispatched. - * @param {function} callback - The callback to be invoked. Can be `null` or `undefined` to skip invocation. + * @param {Phaser.Types.Tweens.TweenCallbackTypes} [callback] - The name of the callback to be invoked. Can be `null` or `undefined` to skip invocation. */ - dispatchTweenEvent: function (event, callback) + dispatchEvent: function (event, callback) { if (!this.isSeeking) { this.emit(event, this, this.targets); - if (callback) - { - callback.params[1] = this.targets; + var handler = this.callbacks[callback]; - callback.func.apply(callback.scope, callback.params); + if (handler) + { + handler.func.apply(handler.scope, [ this, this.targets ].concat(handler.params)); } } }, /** - * Internal method used as part of the playback process that sets a tween to play in reverse. + * Handles the destroy process of this Tween, clearing out the + * Tween Data and resetting the targets. A Tween that has been + * destroyed cannot ever be played or used again. * - * @method Phaser.Tweens.Tween#setStateFromEnd - * @fires Phaser.Tweens.Events#TWEEN_REPEAT - * @fires Phaser.Tweens.Events#TWEEN_YOYO - * @since 3.0.0 - * - * @param {Phaser.Tweens.Tween} tween - The Tween to update. - * @param {Phaser.Types.Tweens.TweenDataConfig} tweenData - The TweenData property to update. - * @param {number} diff - Any extra time that needs to be accounted for in the elapsed and progress values. - * - * @return {number} The state of this Tween. + * @method Phaser.Tweens.Tween#destroy + * @since 3.60.0 */ - setStateFromEnd: function (tween, tweenData, diff) + destroy: function () { - if (tweenData.yoyo) - { - // We've hit the end of a Playing Forward TweenData and we have a yoyo + BaseTween.prototype.destroy.call(this); - // Account for any extra time we got from the previous frame - tweenData.elapsed = diff; - tweenData.progress = diff / tweenData.duration; - - if (tweenData.flipX) - { - tweenData.target.toggleFlipX(); - } - - if (tweenData.flipY) - { - tweenData.target.toggleFlipY(); - } - - this.dispatchTweenDataEvent(Events.TWEEN_YOYO, tween.callbacks.onYoyo, tweenData); - - tweenData.start = tweenData.getStartValue(tweenData.target, tweenData.key, tweenData.start, tweenData.index, tween.totalTargets, tween); - - return TWEEN_CONST.PLAYING_BACKWARD; - } - else if (tweenData.repeatCounter > 0) - { - // We've hit the end of a Playing Forward TweenData and we have a Repeat. - // So we're going to go right back to the start to repeat it again. - - tweenData.repeatCounter--; - - // Account for any extra time we got from the previous frame - tweenData.elapsed = diff; - tweenData.progress = diff / tweenData.duration; - - if (tweenData.flipX) - { - tweenData.target.toggleFlipX(); - } - - if (tweenData.flipY) - { - tweenData.target.toggleFlipY(); - } - - tweenData.start = tweenData.getStartValue(tweenData.target, tweenData.key, tweenData.start, tweenData.index, tween.totalTargets, tween); - - tweenData.end = tweenData.getEndValue(tweenData.target, tweenData.key, tweenData.start, tweenData.index, tween.totalTargets, tween); - - // Delay? - if (tweenData.repeatDelay > 0) - { - tweenData.elapsed = tweenData.repeatDelay - diff; - - tweenData.current = tweenData.start; - - tweenData.target[tweenData.key] = tweenData.current; - - return TWEEN_CONST.REPEAT_DELAY; - } - else - { - this.dispatchTweenDataEvent(Events.TWEEN_REPEAT, tween.callbacks.onRepeat, tweenData); - - return TWEEN_CONST.PLAYING_FORWARD; - } - } - - return TWEEN_CONST.COMPLETE; - }, - - /** - * Internal method used as part of the playback process that sets a tween to play from the start. - * - * @method Phaser.Tweens.Tween#setStateFromStart - * @fires Phaser.Tweens.Events#TWEEN_REPEAT - * @since 3.0.0 - * - * @param {Phaser.Tweens.Tween} tween - The Tween to update. - * @param {Phaser.Types.Tweens.TweenDataConfig} tweenData - The TweenData property to update. - * @param {number} diff - Any extra time that needs to be accounted for in the elapsed and progress values. - * - * @return {number} The state of this Tween. - */ - setStateFromStart: function (tween, tweenData, diff) - { - if (tweenData.repeatCounter > 0) - { - tweenData.repeatCounter--; - - // Account for any extra time we got from the previous frame - tweenData.elapsed = diff; - tweenData.progress = diff / tweenData.duration; - - if (tweenData.flipX) - { - tweenData.target.toggleFlipX(); - } - - if (tweenData.flipY) - { - tweenData.target.toggleFlipY(); - } - - tweenData.end = tweenData.getEndValue(tweenData.target, tweenData.key, tweenData.start, tweenData.index, tween.totalTargets, tween); - - // Delay? - if (tweenData.repeatDelay > 0) - { - tweenData.elapsed = tweenData.repeatDelay - diff; - - tweenData.current = tweenData.start; - - tweenData.target[tweenData.key] = tweenData.current; - - return TWEEN_CONST.REPEAT_DELAY; - } - else - { - this.dispatchTweenDataEvent(Events.TWEEN_REPEAT, tween.callbacks.onRepeat, tweenData); - - return TWEEN_CONST.PLAYING_FORWARD; - } - } - - return TWEEN_CONST.COMPLETE; - }, - - /** - * Internal method that advances the TweenData based on the time value given. - * - * @method Phaser.Tweens.Tween#updateTweenData - * @fires Phaser.Tweens.Events#TWEEN_UPDATE - * @fires Phaser.Tweens.Events#TWEEN_REPEAT - * @since 3.0.0 - * - * @param {Phaser.Tweens.Tween} tween - The Tween to update. - * @param {Phaser.Types.Tweens.TweenDataConfig} tweenData - The TweenData property to update. - * @param {number} delta - Either a value in ms, or 1 if Tween.useFrames is true. - * - * @return {boolean} True if the tween is not complete (e.g., playing), or false if the tween is complete. - */ - updateTweenData: function (tween, tweenData, delta) - { - var target = tweenData.target; - - switch (tweenData.state) - { - case TWEEN_CONST.PLAYING_FORWARD: - case TWEEN_CONST.PLAYING_BACKWARD: - - if (!target) - { - tweenData.state = TWEEN_CONST.COMPLETE; - break; - } - - var elapsed = tweenData.elapsed; - var duration = tweenData.duration; - var diff = 0; - - elapsed += delta; - - if (elapsed > duration) - { - diff = elapsed - duration; - elapsed = duration; - } - - var forward = (tweenData.state === TWEEN_CONST.PLAYING_FORWARD); - var progress = elapsed / duration; - - tweenData.elapsed = elapsed; - tweenData.progress = progress; - tweenData.previous = tweenData.current; - - if (progress === 1) - { - if (forward) - { - tweenData.current = tweenData.end; - target[tweenData.key] = tweenData.end; - - if (tweenData.hold > 0) - { - tweenData.elapsed = tweenData.hold - diff; - - tweenData.state = TWEEN_CONST.HOLD_DELAY; - } - else - { - tweenData.state = this.setStateFromEnd(tween, tweenData, diff); - } - } - else - { - tweenData.current = tweenData.start; - target[tweenData.key] = tweenData.start; - - tweenData.state = this.setStateFromStart(tween, tweenData, diff); - } - } - else - { - var v = (forward) ? tweenData.ease(progress) : tweenData.ease(1 - progress); - - tweenData.current = tweenData.start + ((tweenData.end - tweenData.start) * v); - - target[tweenData.key] = tweenData.current; - } - - this.dispatchTweenDataEvent(Events.TWEEN_UPDATE, tween.callbacks.onUpdate, tweenData); - - break; - - case TWEEN_CONST.DELAY: - - tweenData.elapsed -= delta; - - if (tweenData.elapsed <= 0) - { - tweenData.elapsed = Math.abs(tweenData.elapsed); - - tweenData.state = TWEEN_CONST.PENDING_RENDER; - } - - break; - - case TWEEN_CONST.REPEAT_DELAY: - - tweenData.elapsed -= delta; - - if (tweenData.elapsed <= 0) - { - tweenData.elapsed = Math.abs(tweenData.elapsed); - - tweenData.state = TWEEN_CONST.PLAYING_FORWARD; - - this.dispatchTweenDataEvent(Events.TWEEN_REPEAT, tween.callbacks.onRepeat, tweenData); - } - - break; - - case TWEEN_CONST.HOLD_DELAY: - - tweenData.elapsed -= delta; - - if (tweenData.elapsed <= 0) - { - tweenData.state = this.setStateFromEnd(tween, tweenData, Math.abs(tweenData.elapsed)); - } - - break; - - case TWEEN_CONST.PENDING_RENDER: - - if (target) - { - tweenData.start = tweenData.getStartValue(target, tweenData.key, target[tweenData.key], tweenData.index, tween.totalTargets, tween); - - tweenData.end = tweenData.getEndValue(target, tweenData.key, tweenData.start, tweenData.index, tween.totalTargets, tween); - - tweenData.current = tweenData.start; - - target[tweenData.key] = tweenData.start; - - tweenData.state = TWEEN_CONST.PLAYING_FORWARD; - } - else - { - tweenData.state = TWEEN_CONST.COMPLETE; - } - - break; - } - - // Return TRUE if this TweenData still playing, otherwise return FALSE - return (tweenData.state !== TWEEN_CONST.COMPLETE); + this.targets = null; } }); -// onActive = 'active' event = When the Tween is moved from the pending to the active list in the manager, even if playback delayed -// onStart = 'start' event = When the Tween starts playing from a delayed state (will happen same time as onActive if no delay) -// onStop = 'stop' event = When the Tween is stopped -// onYoyo = 'yoyo' event = When the Tween starts a yoyo -// onRepeat = 'repeat' event = When a TweenData repeats playback (if any) -// onComplete = 'complete' event = When the Tween finishes all playback (can sometimes never happen if repeat -1), also when 'stop' called -// onUpdate = 'update' event = When the Tween updates a TweenData during playback (expensive!) -// onLoop = 'loop' event = Used to loop ALL TweenDatas in a Tween - -Tween.TYPES = [ - 'onActive', - 'onComplete', - 'onLoop', - 'onRepeat', - 'onStart', - 'onStop', - 'onUpdate', - 'onYoyo' -]; - /** * Creates a new Tween object. * @@ -216690,14 +217962,6 @@ GameObjectFactory.register('tween', function (config) return this.scene.sys.tweens.add(config); }); -// When registering a factory function 'this' refers to the GameObjectFactory context. -// -// There are several properties available to use: -// -// this.scene - a reference to the Scene that owns the GameObjectFactory -// this.displayList - a reference to the Display List the Scene owns -// this.updateList - a reference to the Update List the Scene owns - /** * Creates a new Tween object and returns it. * @@ -216715,139 +217979,1706 @@ GameObjectCreator.register('tween', function (config) return this.scene.sys.tweens.create(config); }); -// When registering a factory function 'this' refers to the GameObjectCreator context. - module.exports = Tween; /***/ }), -/***/ 15718: -/***/ ((module) => { +/***/ 45641: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var ArrayRemove = __webpack_require__(66458); +var BaseTween = __webpack_require__(502); +var Class = __webpack_require__(56694); +var Events = __webpack_require__(54272); +var GameObjectCreator = __webpack_require__(99325); +var GameObjectFactory = __webpack_require__(61286); + /** - * Returns a TweenDataConfig object that describes the tween data for a unique property of a unique target. - * A single Tween consists of multiple TweenDatas, depending on how many properties are being changed by the Tween. + * @classdesc + * TODO * - * This is an internal function used by the TweenBuilder and should not be accessed directly, instead, - * Tweens should be created using the GameObjectFactory or GameObjectCreator. + * @class TweenChain + * @memberof Phaser.Tweens + * @extends Phaser.Tweens.BaseTween + * @constructor + * @since 3.60.0 * - * @function Phaser.Tweens.TweenData - * @since 3.0.0 + * @param {(Phaser.Tweens.TweenManager|Phaser.Tweens.TweenChain)} parent - A reference to the Tween Manager, or TweenChain, that owns this TweenChain. + */ +var TweenChain = new Class({ + + Extends: BaseTween, + + initialize: + + function TweenChain (parent) + { + BaseTween.call(this, parent); + + /** + * A reference to the Tween that this TweenChain is currently playing. + * + * @name Phaser.Tweens.TweenChain#currentTween + * @type {Phaser.Tweens.Tween} + * @since 3.60.0 + */ + this.currentTween = null; + + /** + * A reference to the data array index of the currently playing tween. + * + * @name Phaser.Tweens.TweenChain#currentIndex + * @type {number} + * @since 3.60.0 + */ + this.currentIndex = 0; + }, + + /** + * Prepares this TweenChain for playback. + * + * Called automatically by the TweenManager. Should not be called directly. + * + * @method Phaser.Tweens.TweenChain#init + * @fires Phaser.Tweens.Events#TWEEN_ACTIVE + * @since 3.60.0 + * + * @return {this} This TweenChain instance. + */ + init: function () + { + this.loopCounter = (this.loop === -1) ? 999999999999 : this.loop; + + this.setCurrentTween(0); + + if (this.startDelay > 0 && !this.isStartDelayed()) + { + this.setStartDelayState(); + } + else + { + this.setActiveState(); + } + + this.dispatchEvent(Events.TWEEN_ACTIVE, 'onActive'); + + return this; + }, + + /** + * Create a sequence of Tweens, chained to one-another, and add them to this Tween Manager. + * + * The tweens are played in order, from start to finish. You can optionally set the chain + * to repeat as many times as you like. Once the chain has finished playing, or repeating if set, + * all tweens in the chain will be destroyed automatically. To override this, set the 'persists' + * argument to 'true'. + * + * Playback will start immediately unless the _first_ Tween has been configured to be paused. + * + * Please note that Tweens will not manipulate any target property that begins with an underscore. + * + * @method Phaser.Tweens.TweenChain#add + * @since 3.60.0 + * + * @param {Phaser.Types.Tweens.TweenBuilderConfig[]|object[]} tweens - An array of Tween configuration objects for the Tweens in this chain. + * + * @return {this} This TweenChain instance. + */ + add: function (tweens) + { + var newTweens = this.parent.create(tweens); + + if (!Array.isArray(newTweens)) + { + newTweens = [ newTweens ]; + } + + var data = this.data; + + for (var i = 0; i < newTweens.length; i++) + { + var tween = newTweens[i]; + + tween.parent = this; + + data.push(tween.init()); + } + + this.totalData = data.length; + + return this; + }, + + /** + * Removes the given Tween from this Tween Chain. + * + * The removed tween is _not_ destroyed. It is just removed from this Tween Chain. + * + * If the given Tween is currently playing then the chain will automatically move + * to the next tween in the chain. If there are no more tweens, this chain will complete. + * + * @method Phaser.Tweens.TweenChain#remove + * @since 3.60.0 + * @override + * + * @param {Phaser.Tweens.Tween} tween - The Tween to be removed. + * + * @return {this} This Tween Chain instance. + */ + remove: function (tween) + { + // Remove it immediately + ArrayRemove(this.data, tween); + + tween.setRemovedState(); + + if (tween === this.currentTween) + { + this.nextTween(); + } + + this.totalData = this.data.length; + + return this; + }, + + /** + * See if any of the tweens in this Tween Chain is currently acting upon the given target. + * + * @method Phaser.Tweens.TweenChain#hasTarget + * @since 3.60.0 + * + * @param {object} target - The target to check against this TweenChain. + * + * @return {boolean} `true` if the given target is a target of this TweenChain, otherwise `false`. + */ + hasTarget: function (target) + { + var data = this.data; + + for (var i = 0; i < this.totalData; i++) + { + if (data[i].hasTarget(target)) + { + return true; + } + } + + return false; + }, + + /** + * Restarts the TweenChain from the beginning. + * + * If this TweenChain was configured to have a loop, or start delay, those + * are reset to their initial values as well. It will also dispatch the + * `onActive` callback and event again. + * + * @method Phaser.Tweens.TweenChain#restart + * @since 3.60.0 + * + * @return {this} This TweenChain instance. + */ + restart: function () + { + if (this.isDestroyed()) + { + console.warn('Cannot restart destroyed TweenChain', this); + + return this; + } + + if (this.isRemoved()) + { + this.parent.makeActive(this); + } + + this.resetTweens(); + + this.paused = false; + + return this.init(); + }, + + /** + * Resets the given Tween. + * + * It will seek to position 0 and playback will start on the next frame. + * + * @method Phaser.Tweens.TweenChain#reset + * @since 3.60.0 + * + * @param {Phaser.Tweens.Tween} tween - The Tween to be reset. + * + * @return {this} This TweenChain instance. + */ + reset: function (tween) + { + tween.seek(); + + tween.setActiveState(); + + return this; + }, + + /** + * Re-initiases the given Tween and sets it to the Active state. + * + * @method Phaser.Tweens.TweenChain#makeActive + * @since 3.60.0 + * @override + * + * @param {Phaser.Tweens.Tween} tween - The Tween to check. + * + * @return {this} This TweenChain instance. + */ + makeActive: function (tween) + { + tween.init(); + + tween.setActiveState(); + + return this; + }, + + /** + * Internal method that advances to the next state of the TweenChain playback. + * + * @method Phaser.Tweens.TweenChain#nextState + * @fires Phaser.Tweens.Events#TWEEN_COMPLETE + * @fires Phaser.Tweens.Events#TWEEN_LOOP + * @since 3.60.0 + * + * @return {boolean} `true` if this TweenChain has completed, otherwise `false`. + */ + nextState: function () + { + if (this.loopCounter > 0) + { + this.loopCounter--; + + this.resetTweens(); + + if (this.loopDelay > 0) + { + this.countdown = this.loopDelay; + + this.setLoopDelayState(); + } + else + { + this.setActiveState(); + + this.dispatchEvent(Events.TWEEN_LOOP, 'onLoop'); + } + } + else if (this.completeDelay > 0) + { + this.countdown = this.completeDelay; + + this.setCompleteDelayState(); + } + else + { + this.onCompleteHandler(); + + return true; + } + + return false; + }, + + /** + * Starts this TweenChain playing. + * + * You only need to call this method if you have configured this TweenChain to be paused on creation. + * + * If the TweenChain is already playing, calling this method again will have no effect. If you wish to + * restart the chain, use `TweenChain.restart` instead. + * + * Calling this method after the TweenChain has completed will start the chain playing again from the beginning. + * + * @method Phaser.Tweens.TweenChain#play + * @since 3.60.0 + * + * @return {this} This TweenChain instance. + */ + play: function () + { + if (this.isDestroyed()) + { + console.warn('Cannot play destroyed TweenChain', this); + + return this; + } + + if (this.isPendingRemove() || this.isPending()) + { + this.resetTweens(); + } + + this.paused = false; + + if (this.startDelay > 0 && !this.isStartDelayed()) + { + this.setStartDelayState(); + } + else + { + this.setActiveState(); + } + + return this; + }, + + /** + * Internal method that resets all of the Tweens and the current index pointer. + * + * @method Phaser.Tweens.TweenChain#resetTweens + * @since 3.60.0 + */ + resetTweens: function () + { + var data = this.data; + var total = this.totalData; + + for (var i = 0; i < total; i++) + { + data[i].reset(false); + } + + this.currentIndex = 0; + this.currentTween = data[0]; + }, + + /** + * Internal method that advances the TweenChain based on the time values. + * + * @method Phaser.Tweens.TweenChain#update + * @fires Phaser.Tweens.Events#TWEEN_COMPLETE + * @fires Phaser.Tweens.Events#TWEEN_LOOP + * @fires Phaser.Tweens.Events#TWEEN_START + * @since 3.60.0 + * + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + * + * @return {boolean} Returns `true` if this TweenChain has finished and should be removed from the Tween Manager, otherwise returns `false`. + */ + update: function (delta) + { + if (this.isPendingRemove() || this.isDestroyed()) + { + return true; + } + else if (this.isFinished() || this.paused) + { + return false; + } + + // The TweehChain.timeScale is applied within Tween.update, so doesn't need including here + delta *= this.parent.timeScale; + + if (this.isLoopDelayed()) + { + this.updateLoopCountdown(delta); + } + else if (this.isCompleteDelayed()) + { + this.updateCompleteDelay(delta); + } + else if (this.isStartDelayed()) + { + // Reset the delta so we always start progress from zero + delta = this.updateStartCountdown(delta); + } + + var remove = false; + + if (this.isActive() && this.currentTween) + { + if (this.currentTween.update(delta)) + { + // This tween has finshed playback, so move to the next one + if (this.nextTween()) + { + this.nextState(); + } + } + + // if nextState called onCompleteHandler then we're ready to be removed, unless we persist + remove = this.isPendingRemove(); + + if (remove && this.persist) + { + this.setFinishedState(); + + remove = false; + } + } + + return remove; + }, + + /** + * Immediately advances to the next Tween in the chain. + * + * This is typically called internally, but can be used if you need to + * advance playback for some reason. + * + * @method Phaser.Tweens.TweenChain#nextTween + * @since 3.60.0 + * + * @return {boolean} `true` if there are no more Tweens in the chain, otherwise `false`. + */ + nextTween: function () + { + this.currentIndex++; + + if (this.currentIndex === this.totalData) + { + return true; + } + else + { + this.setCurrentTween(this.currentIndex); + } + + return false; + }, + + /** + * Sets the current active Tween to the given index, based on its + * entry in the TweenChain data array. + * + * @method Phaser.Tweens.TweenChain#setCurrentTween + * @since 3.60.0 + * + * @param {number} index - The index of the Tween to be made current. + */ + setCurrentTween: function (index) + { + this.currentIndex = index; + + this.currentTween = this.data[index]; + + this.currentTween.setActiveState(); + + this.currentTween.dispatchEvent(Events.TWEEN_ACTIVE, 'onActive'); + }, + + /** + * Internal method that will emit a TweenChain based Event and invoke the given callback. + * + * @method Phaser.Tweens.TweenChain#dispatchEvent + * @since 3.60.0 + * + * @param {Phaser.Types.Tweens.Event} event - The Event to be dispatched. + * @param {Phaser.Types.Tweens.TweenCallbackTypes} [callback] - The name of the callback to be invoked. Can be `null` or `undefined` to skip invocation. + */ + dispatchEvent: function (event, callback) + { + this.emit(event, this); + + var handler = this.callbacks[callback]; + + if (handler) + { + handler.func.apply(handler.scope, [ this ].concat(handler.params)); + } + }, + + /** + * Immediately destroys this TweenChain, nulling of all its references. + * + * @method Phaser.Tweens.TweenChain#destroy + * @since 3.60.0 + */ + destroy: function () + { + BaseTween.prototype.destroy.call(this); + + this.currentTween = null; + } + +}); + +/** + * Creates a new TweenChain object and adds it to the Tween Manager. * - * @param {any} target - The target to tween. - * @param {number} index - The target index within the Tween targets array. + * Note: This method will only be available if Tweens have been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectFactory#tweenchain + * @since 3.60.0 + * + * @param {Phaser.Types.Tweens.TweenBuilderConfig|object} config - The TweenChain configuration. + * + * @return {Phaser.Tweens.TweenChain} The TweenChain that was created. + */ +GameObjectFactory.register('tweenchain', function (config) +{ + return this.scene.sys.tweens.chain(config); +}); + +/** + * Creates a new TweenChain object and returns it, without adding it to the Tween Manager. + * + * Note: This method will only be available if Tweens have been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectCreator#tweenchain + * @since 3.60.0 + * + * @param {Phaser.Types.Tweens.TweenBuilderConfig|object} config - The TweenChain configuration. + * + * @return {Phaser.Tweens.TweenChain} The TweenChain that was created. + */ +GameObjectCreator.register('tweenchain', function (config) +{ + return this.scene.sys.tweens.create(config); +}); + +module.exports = TweenChain; + + +/***/ }), + +/***/ 15718: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BaseTweenData = __webpack_require__(65521); +var Class = __webpack_require__(56694); +var Events = __webpack_require__(54272); + +/** + * @classdesc + * The TweenData is a class that contains a single target and property that is being tweened. + * + * Tweens create TweenData instances when they are created, with one TweenData instance per + * target, per property. A Tween can own multiple TweenData instances, but a TweenData only + * ever belongs to a single Tween. + * + * You should not typically create these yourself, but rather use the TweenBuilder, + * or the `Tween.add` method. + * + * Prior to Phaser 3.60 the TweenData was just an object, but was refactored to a class, + * to make it responsible for its own state and updating. + * + * @class TweenData + * @memberof Phaser.Tweens + * @extends Phaser.Tweens.BaseTweenData + * @constructor + * @since 3.60.0 + * + * @param {Phaser.Tweens.Tween} tween - The tween this TweenData instance belongs to. + * @param {number} targetIndex - The target index within the Tween targets array. * @param {string} key - The property of the target to tween. - * @param {function} getEnd - What the property will be at the END of the Tween. - * @param {function} getStart - What the property will be at the START of the Tween. - * @param {?function} getActive - If not null, is invoked _immediately_ as soon as the TweenData is running, and is set on the target property. + * @param {Phaser.Types.Tweens.GetEndCallback} getEnd - What the property will be at the END of the Tween. + * @param {Phaser.Types.Tweens.GetStartCallback} getStart - What the property will be at the START of the Tween. + * @param {?Phaser.Types.Tweens.GetActiveCallback} getActive - If not null, is invoked _immediately_ as soon as the TweenData is running, and is set on the target property. * @param {function} ease - The ease function this tween uses. - * @param {number} delay - Time in ms/frames before tween will start. - * @param {number} duration - Duration of the tween in ms/frames. + * @param {function} delay - Function that returns the time in ms/frames before tween will start. + * @param {number} duration - The duration of the tween in ms/frames. * @param {boolean} yoyo - Determines whether the tween should return back to its start value after hold has expired. - * @param {number} hold - Time in ms/frames the tween will pause before repeating or returning to its starting value if yoyo is set to true. - * @param {number} repeat - Number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. - * @param {number} repeatDelay - Time in ms/frames before the repeat will start. + * @param {number} hold - Function that returns the time in ms/frames the tween will pause before repeating or returning to its starting value if yoyo is set to true. + * @param {number} repeat - Function that returns the number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. + * @param {number} repeatDelay - Function that returns the time in ms/frames before the repeat will start. * @param {boolean} flipX - Should toggleFlipX be called when yoyo or repeat happens? * @param {boolean} flipY - Should toggleFlipY be called when yoyo or repeat happens? - * - * @return {Phaser.Types.Tweens.TweenDataConfig} The config object describing this TweenData. + * @param {?function} interpolation - The interpolation function to be used for arrays of data. Defaults to 'null'. + * @param {?number[]} interpolationData - The array of interpolation data to be set. Defaults to 'null'. */ -var TweenData = function (target, index, key, getEnd, getStart, getActive, ease, delay, duration, yoyo, hold, repeat, repeatDelay, flipX, flipY) -{ - return { +var TweenData = new Class({ - // The target to tween - target: target, + Extends: BaseTweenData, - // The index of the target within the tween targets array - index: index, + initialize: - // The property of the target to tween - key: key, + function TweenData (tween, targetIndex, key, getEnd, getStart, getActive, ease, delay, duration, yoyo, hold, repeat, repeatDelay, flipX, flipY, interpolation, interpolationData) + { + BaseTweenData.call(this, tween, targetIndex, delay, duration, yoyo, hold, repeat, repeatDelay, flipX, flipY); - // What to set the property to the moment the TweenData is invoked. - getActiveValue: getActive, + /** + * The property of the target to be tweened. + * + * @name Phaser.Tweens.TweenData#key + * @type {string} + * @since 3.60.0 + */ + this.key = key; - // The returned value sets what the property will be at the END of the Tween. - getEndValue: getEnd, + /** + * A function that returns what to set the target property to, + * the moment the TweenData is invoked. + * + * This is called when this TweenData is inititalised or reset. + * + * @name Phaser.Tweens.TweenData#getActiveValue + * @type {?Phaser.Types.Tweens.GetActiveCallback} + * @since 3.60.0 + */ + this.getActiveValue = getActive; - // The returned value sets what the property will be at the START of the Tween. - getStartValue: getStart, + /** + * A function that returns what to set the target property to + * at the end of the tween. + * + * This is called when the tween starts playing, after any initial + * start delay, or if the tween is reset, or is set to repeat. + * + * @name Phaser.Tweens.TweenData#getEndValue + * @type {Phaser.Types.Tweens.GetEndCallback} + * @since 3.60.0 + */ + this.getEndValue = getEnd; - // The ease function this tween uses. - ease: ease, + /** + * A function that returns what to set the target property to + * at the start of the tween. + * + * This is called when the tween starts playing, after any initial + * start delay, or if the tween is reset, or is set to repeat. + * + * @name Phaser.Tweens.TweenData#getStartValue + * @type {Phaser.Types.Tweens.GetStartCallback} + * @since 3.60.0 + */ + this.getStartValue = getStart; - // Duration of the tween in ms/frames, excludes time for yoyo or repeats. - duration: 0, + /** + * The ease function this Tween uses to calculate the target value. + * + * @name Phaser.Tweens.TweenData#ease + * @type {function} + * @since 3.60.0 + */ + this.ease = ease; - // The total calculated duration of this TweenData (based on duration, repeat, delay and yoyo) - totalDuration: 0, + /** + * The target's starting value, as returned by `getStartValue`. + * + * @name Phaser.Tweens.TweenData#start + * @type {number} + * @since 3.60.0 + */ + this.start = 0; - // Time in ms/frames before tween will start. - delay: 0, + /** + * The target value from the previous step. + * + * @name Phaser.Tweens.TweenData#previous + * @type {number} + * @since 3.60.0 + */ + this.previous = 0; - // Cause the tween to return back to its start value after hold has expired. - yoyo: yoyo, + /** + * The target's current value, as recorded in the most recent step. + * + * @name Phaser.Tweens.TweenData#current + * @type {number} + * @since 3.60.0 + */ + this.current = 0; - // Time in ms/frames the tween will pause before running the yoyo or starting a repeat. - hold: 0, + /** + * The target's ending value, as returned by `getEndValue`. + * + * @name Phaser.Tweens.TweenData#end + * @type {number} + * @since 3.60.0 + */ + this.end = 0; - // Number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. - repeat: 0, + /** + * The interpolation function to be used for arrays of data. + * + * @name Phaser.Tweens.TweenData#interpolation + * @type {?function} + * @default null + * @since 3.60.0 + */ + this.interpolation = interpolation; - // Time in ms/frames before the repeat will start. - repeatDelay: 0, + /** + * The array of data to interpolate, if interpolation is being used. + * + * @name Phaser.Tweens.TweenData#interpolationData + * @type {?number[]} + * @since 3.60.0 + */ + this.interpolationData = interpolationData; + }, - // Automatically call toggleFlipX when the TweenData yoyos or repeats - flipX: flipX, + /** + * Prepares this TweenData for playback. + * + * Called automatically by the parent Tween. Should not be called directly. + * + * @method Phaser.Tweens.TweenData#init + * @since 3.60.0 + * + * @param {boolean} [isSeek=false] - Is the parent Tween currently seeking? + */ + init: function (isSeek) + { + var tween = this.tween; + var totalTargets = tween.totalTargets; - // Automatically call toggleFlipY when the TweenData yoyos or repeats - flipY: flipY, + var targetIndex = this.targetIndex; + var target = tween.targets[targetIndex]; + var key = this.key; - // Between 0 and 1 showing completion of this TweenData. - progress: 0, + // Function signature: target, key, value, index, total, tween - // Delta counter. - elapsed: 0, + this.delay = this.getDelay(target, key, 0, targetIndex, totalTargets, tween); - // How many repeats are left to run? - repeatCounter: 0, + this.repeatCounter = (this.repeat === -1) ? 999999999999 : this.repeat; - // Ease Value Data: + this.setPendingRenderState(); - start: 0, - previous: 0, - current: 0, - end: 0, + // calcDuration: - // Time Durations - t1: 0, - t2: 0, + // Set t1 (duration + hold + yoyo) + var t1 = this.duration + this.hold; - // LoadValue generation functions - gen: { - delay: delay, - duration: duration, - hold: hold, - repeat: repeat, - repeatDelay: repeatDelay - }, + if (this.yoyo) + { + t1 += this.duration; + } - // TWEEN_CONST.CREATED - state: 0 - }; -}; + // Set t2 (repeatDelay + duration + hold + yoyo) + var t2 = t1 + this.repeatDelay; + + // Total Duration + this.totalDuration = this.delay + t1; + + if (this.repeat === -1) + { + this.totalDuration += (t2 * 999999999999); + } + else if (this.repeat > 0) + { + this.totalDuration += (t2 * this.repeat); + } + + if (this.totalDuration > tween.duration) + { + // Set the longest duration in the parent Tween + tween.duration = this.totalDuration; + } + + if (this.delay < tween.startDelay) + { + tween.startDelay = this.delay; + } + + // seek specific: + if (isSeek) + { + this.current = this.start; + this.progress = 0; + this.elapsed = 0; + + this.setPlayingForwardState(); + + this.update(0); + } + + if (this.delay > 0) + { + this.elapsed = this.delay; + + this.setDelayState(); + } + + if (!isSeek && this.getActiveValue) + { + target[key] = this.getActiveValue(target, key, this.start); + } + }, + + /** + * Internal method that advances this TweenData based on the delta value given. + * + * @method Phaser.Tweens.TweenData#update + * @fires Phaser.Tweens.Events#TWEEN_UPDATE + * @fires Phaser.Tweens.Events#TWEEN_REPEAT + * @since 3.60.0 + * + * @param {number} delta - The elapsed delta time in ms. + * + * @return {boolean} `true` if this TweenData is still playing, or `false` if it has finished entirely. + */ + update: function (delta) + { + var tween = this.tween; + var totalTargets = tween.totalTargets; + + var targetIndex = this.targetIndex; + var target = tween.targets[targetIndex]; + var key = this.key; + + // Bail out if we don't have a target to act upon + if (!target) + { + this.setCompleteState(); + + return false; + } + + if (this.isCountdown) + { + this.elapsed -= delta; + + if (this.elapsed <= 0) + { + this.elapsed = 0; + + delta = 0; + + if (this.isDelayed()) + { + this.setPendingRenderState(); + } + else if (this.isRepeating()) + { + this.setPlayingForwardState(); + + this.dispatchEvent(Events.TWEEN_REPEAT, 'onRepeat'); + } + else if (this.isHolding()) + { + this.setStateFromEnd(0); + } + } + } + + // All of the above have the ability to change the state, so put this in its own check + + if (this.isPendingRender()) + { + this.start = this.getStartValue(target, key, target[key], targetIndex, totalTargets, tween); + + this.end = this.getEndValue(target, key, this.start, targetIndex, totalTargets, tween); + + this.current = this.start; + + target[key] = this.start; + + this.setPlayingForwardState(); + + return true; + } + + var forward = this.isPlayingForward(); + var backward = this.isPlayingBackward(); + + if (forward || backward) + { + var elapsed = this.elapsed; + var duration = this.duration; + var diff = 0; + var complete = false; + + elapsed += delta; + + if (elapsed >= duration) + { + diff = elapsed - duration; + elapsed = duration; + complete = true; + } + + var progress = elapsed / duration; + + this.elapsed = elapsed; + this.progress = progress; + this.previous = this.current; + + if (complete) + { + if (forward) + { + this.current = this.end; + + target[key] = this.end; + + if (this.hold > 0 && this.repeatCounter > 0) + { + this.elapsed = this.hold; + + this.setHoldState(); + } + else + { + this.setStateFromEnd(diff); + } + } + else + { + this.current = this.start; + + target[key] = this.start; + + this.setStateFromStart(diff); + } + } + else + { + if (!forward) + { + progress = 1 - progress; + } + + var v = this.ease(progress); + + if (this.interpolation) + { + this.current = this.interpolation(this.interpolationData, v); + } + else + { + this.current = this.start + ((this.end - this.start) * v); + } + + target[key] = this.current; + } + + this.dispatchEvent(Events.TWEEN_UPDATE, 'onUpdate'); + } + + // Return TRUE if this TweenData still playing, otherwise FALSE + return !this.isComplete(); + }, + + /** + * Internal method that resets this Tween Data, including the progress and elapsed values. + * + * @method Phaser.Tweens.TweenData#reset + * @since 3.60.0 + * + * @param {boolean} resetFromLoop - Has this method been called as part of a loop? + */ + reset: function (resetFromLoop) + { + var tween = this.tween; + var totalTargets = tween.totalTargets; + + var targetIndex = this.targetIndex; + var target = tween.targets[targetIndex]; + var key = this.key; + + this.progress = 0; + this.elapsed = 0; + + this.repeatCounter = (this.repeat === -1) ? 999999999999 : this.repeat; + + if (resetFromLoop) + { + this.start = this.getStartValue(target, key, this.start, targetIndex, totalTargets, tween); + + this.end = this.getEndValue(target, key, this.end, targetIndex, totalTargets, tween); + + this.current = this.start; + + this.setPlayingForwardState(); + } + else + { + this.setPendingRenderState(); + } + + if (this.delay > 0) + { + this.elapsed = this.delay; + + this.setDelayState(); + } + + if (this.getActiveValue) + { + target[key] = this.getActiveValue(target, key, this.start); + } + }, + + /** + * Internal method that will emit a TweenData based Event on the + * parent Tween and also invoke the given callback, if provided. + * + * @method Phaser.Tweens.TweenData#dispatchEvent + * @since 3.60.0 + * + * @param {Phaser.Types.Tweens.Event} event - The Event to be dispatched. + * @param {Phaser.Types.Tweens.TweenCallbackTypes} [callback] - The name of the callback to be invoked. Can be `null` or `undefined` to skip invocation. + */ + dispatchEvent: function (event, callback) + { + var tween = this.tween; + + if (!tween.isSeeking) + { + var target = tween.targets[this.targetIndex]; + var key = this.key; + + var current = this.current; + var previous = this.previoius; + + tween.emit(event, tween, key, target, current, previous); + + var handler = tween.callbacks[callback]; + + if (handler) + { + handler.func.apply(handler.scope, [ tween, target, key, current, previous ].concat(handler.params)); + } + } + }, + + /** + * Internal method used as part of the playback process that checks if this + * TweenData should yoyo, repeat, or has completed. + * + * @method Phaser.Tweens.TweenData#setStateFromEnd + * @fires Phaser.Tweens.Events#TWEEN_REPEAT + * @fires Phaser.Tweens.Events#TWEEN_YOYO + * @since 3.60.0 + * + * @param {number} diff - Any extra time that needs to be accounted for in the elapsed and progress values. + */ + setStateFromEnd: function (diff) + { + if (this.yoyo) + { + this.onRepeat(diff, true, true); + } + else if (this.repeatCounter > 0) + { + this.onRepeat(diff, true); + } + else + { + this.setCompleteState(); + } + }, + + /** + * Internal method used as part of the playback process that checks if this + * TweenData should repeat or has completed. + * + * @method Phaser.Tweens.TweenData#setStateFromStart + * @fires Phaser.Tweens.Events#TWEEN_REPEAT + * @since 3.60.0 + * + * @param {number} diff - Any extra time that needs to be accounted for in the elapsed and progress values. + */ + setStateFromStart: function (diff) + { + if (this.repeatCounter > 0) + { + this.onRepeat(diff, false); + } + else + { + this.setCompleteState(); + } + }, + + /** + * Internal method that handles repeating or yoyo'ing this TweenData. + * + * Called automatically by `setStateFromStart` and `setStateFromEnd`. + * + * @method Phaser.Tweens.TweenData#onRepeat + * @fires Phaser.Tweens.Events#TWEEN_REPEAT + * @fires Phaser.Tweens.Events#TWEEN_YOYO + * @since 3.60.0 + * + * @param {number} diff - Any extra time that needs to be accounted for in the elapsed and progress values. + * @param {boolean} setStart - Set the TweenData start values? + * @param {boolean} [isYoyo=false] - Is this call a Yoyo check? + */ + onRepeat: function (diff, setStart, isYoyo) + { + if (isYoyo === undefined) { isYoyo = false; } + + var tween = this.tween; + var totalTargets = tween.totalTargets; + + var targetIndex = this.targetIndex; + var target = tween.targets[targetIndex]; + var key = this.key; + + // Account for any extra time we got from the previous frame + this.elapsed = diff; + this.progress = diff / this.duration; + + if (this.flipX) + { + target.toggleFlipX(); + } + + if (this.flipY) + { + target.toggleFlipY(); + } + + if (setStart || isYoyo) + { + this.start = this.getStartValue(target, key, this.start, targetIndex, totalTargets, tween); + } + + if (isYoyo) + { + this.setPlayingBackwardState(); + + this.dispatchEvent(Events.TWEEN_YOYO, 'onYoyo'); + + return; + } + + this.repeatCounter--; + + this.end = this.getEndValue(target, key, this.start, targetIndex, totalTargets, tween); + + // Delay? + if (this.repeatDelay > 0) + { + this.elapsed = this.repeatDelay - diff; + + this.current = this.start; + + target[key] = this.current; + + this.setRepeatState(); + } + else + { + this.setPlayingForwardState(); + + this.dispatchEvent(Events.TWEEN_REPEAT, 'onRepeat'); + } + }, + + /** + * Immediately destroys this TweenData, nulling of all its references. + * + * @method Phaser.Tweens.TweenData#destroy + * @since 3.60.0 + */ + destroy: function () + { + BaseTweenData.prototype.destroy.call(this); + + this.getActiveValue = null; + this.getEndValue = null; + this.getStartValue = null; + this.ease = null; + } + +}); module.exports = TweenData; +/***/ }), + +/***/ 96490: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BaseTweenData = __webpack_require__(65521); +var Class = __webpack_require__(56694); +var Events = __webpack_require__(54272); + +/** + * @classdesc + * The TweenFrameData is a class that contains a single target that will change the texture frame + * and the conclusion of the tween. + * + * TweenFrameData instances are typically created by the TweenBuilder automatically, when it + * detects the prescence of a 'texture' property as the key being tweened. + * + * A Tween can own multiple TweenFrameData instances, but a TweenFrameData only + * ever belongs to a single Tween. + * + * You should not typically create these yourself, but rather use the TweenBuilder, + * or the `Tween.addFrame` method. + * + * @class TweenFrameData + * @memberof Phaser.Tweens + * @extends Phaser.Tweens.BaseTweenData + * @constructor + * @since 3.60.0 + * + * @param {Phaser.Tweens.Tween} tween - The tween this TweenData instance belongs to. + * @param {number} targetIndex - The target index within the Tween targets array. + * @param {string} texture - The texture key to set at the end of this tween. + * @param {(string|number)} frame - The texture frame to set at the end of this tween. + * @param {function} delay - Function that returns the time in ms/frames before tween will start. + * @param {number} duration - The duration of the tween in ms/frames. + * @param {number} hold - Function that returns the time in ms/frames the tween will pause before repeating or returning to its starting value if yoyo is set to true. + * @param {number} repeat - Function that returns the number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. + * @param {number} repeatDelay - Function that returns the time in ms/frames before the repeat will start. + * @param {boolean} flipX - Should toggleFlipX be called when yoyo or repeat happens? + * @param {boolean} flipY - Should toggleFlipY be called when yoyo or repeat happens? + */ +var TweenFrameData = new Class({ + + Extends: BaseTweenData, + + initialize: + + function TweenFrameData (tween, targetIndex, texture, frame, delay, duration, hold, repeat, repeatDelay, flipX, flipY) + { + BaseTweenData.call(this, tween, targetIndex, delay, duration, false, hold, repeat, repeatDelay, flipX, flipY); + + /** + * The texture to be set at the start of the tween. + * + * @name Phaser.Tweens.TweenFrameData#startTexture + * @type {string} + * @since 3.60.0 + */ + this.startTexture = null; + + /** + * The texture to be set at the end of the tween. + * + * @name Phaser.Tweens.TweenFrameData#endTexture + * @type {string} + * @since 3.60.0 + */ + this.endTexture = texture; + + /** + * The frame to be set at the start of the tween. + * + * @name Phaser.Tweens.TweenFrameData#startFrame + * @type {(string|number)} + * @since 3.60.0 + */ + this.startFrame = null; + + /** + * The frame to be set at the end of the tween. + * + * @name Phaser.Tweens.TweenFrameData#endFrame + * @type {(string|number)} + * @since 3.60.0 + */ + this.endFrame = frame; + + /** + * Will the Tween ease back to its starting values, after reaching the end + * and any `hold` value that may be set? + * + * @name Phaser.Tweens.TweenFrameData#yoyo + * @type {boolean} + * @since 3.60.0 + */ + this.yoyo = (repeat > 0) ? true : false; + }, + + /** + * Prepares this TweenData for playback. + * + * Called automatically by the parent Tween. Should not be called directly. + * + * @method Phaser.Tweens.TweenFrameData#init + * @since 3.60.0 + * + * @param {boolean} [isSeek=false] - Is the parent Tween currently seeking? + */ + init: function (isSeek) + { + var tween = this.tween; + var totalTargets = tween.totalTargets; + + var targetIndex = this.targetIndex; + var target = tween.targets[targetIndex]; + + // Function signature: target, key, value, index, total, tween + + this.delay = this.getDelay(target, 'texture', 0, targetIndex, totalTargets, tween); + + this.repeatCounter = (this.repeat === -1) ? 999999999999 : this.repeat; + + this.setPendingRenderState(); + + // calcDuration: + + // Set t1 (duration + hold + yoyo) + var t1 = this.duration + this.hold; + + if (this.yoyo) + { + t1 += this.duration; + } + + // Set t2 (repeatDelay + duration + hold + yoyo) + var t2 = t1 + this.repeatDelay; + + // Total Duration + this.totalDuration = this.delay + t1; + + if (this.repeat === -1) + { + this.totalDuration += (t2 * 999999999999); + } + else if (this.repeat > 0) + { + this.totalDuration += (t2 * this.repeat); + } + + if (this.totalDuration > tween.duration) + { + // Set the longest duration in the parent Tween + tween.duration = this.totalDuration; + } + + if (this.delay < tween.startDelay) + { + tween.startDelay = this.delay; + } + + if (!this.startTexture) + { + this.startTexture = target.texture.key; + this.startFrame = target.frame.name; + } + + // seek specific: + if (isSeek) + { + this.progress = 0; + this.elapsed = 0; + + this.setPlayingForwardState(); + + this.update(0); + } + + if (this.delay > 0) + { + this.elapsed = this.delay; + + this.setDelayState(); + } + }, + + /** + * Internal method that advances this TweenData based on the delta value given. + * + * @method Phaser.Tweens.TweenFrameData#update + * @fires Phaser.Tweens.Events#TWEEN_UPDATE + * @fires Phaser.Tweens.Events#TWEEN_REPEAT + * @since 3.60.0 + * + * @param {number} delta - The elapsed delta time in ms. + * + * @return {boolean} `true` if this TweenData is still playing, or `false` if it has finished entirely. + */ + update: function (delta) + { + var tween = this.tween; + var targetIndex = this.targetIndex; + var target = tween.targets[targetIndex]; + + // Bail out if we don't have a target to act upon + if (!target) + { + this.setCompleteState(); + + return false; + } + + if (this.isCountdown) + { + this.elapsed -= delta; + + if (this.elapsed <= 0) + { + this.elapsed = 0; + + delta = 0; + + if (this.isDelayed()) + { + this.setPendingRenderState(); + } + else if (this.isRepeating()) + { + this.setPlayingForwardState(); + + this.dispatchEvent(Events.TWEEN_REPEAT, 'onRepeat'); + } + else if (this.isHolding()) + { + this.setStateFromEnd(0); + } + } + } + + // All of the above have the ability to change the state, so put this in its own check + + if (this.isPendingRender()) + { + if (this.startTexture) + { + target.setTexture(this.startTexture, this.startFrame); + } + + this.setPlayingForwardState(); + + return true; + } + + var forward = this.isPlayingForward(); + var backward = this.isPlayingBackward(); + + if (forward || backward) + { + var elapsed = this.elapsed; + var duration = this.duration; + var diff = 0; + var complete = false; + + elapsed += delta; + + if (elapsed >= duration) + { + diff = elapsed - duration; + elapsed = duration; + complete = true; + } + + var progress = elapsed / duration; + + this.elapsed = elapsed; + this.progress = progress; + + if (complete) + { + if (forward) + { + target.setTexture(this.endTexture, this.endFrame); + + if (this.hold > 0 && this.repeatCounter > 0) + { + this.elapsed = this.hold; + + this.setHoldState(); + } + else + { + this.setStateFromEnd(diff); + } + } + else + { + target.setTexture(this.startTexture, this.startFrame); + + this.setStateFromStart(diff); + } + } + + this.dispatchEvent(Events.TWEEN_UPDATE, 'onUpdate'); + } + + // Return TRUE if this TweenData still playing, otherwise FALSE + return !this.isComplete(); + }, + + /** + * Internal method that resets this Tween Data, including the progress and elapsed values. + * + * @method Phaser.Tweens.TweenFrameData#reset + * @since 3.60.0 + * + * @param {boolean} resetFromLoop - Has this method been called as part of a loop? + */ + reset: function (resetFromLoop) + { + this.progress = 0; + this.elapsed = 0; + + this.repeatCounter = (this.repeat === -1) ? 999999999999 : this.repeat; + + if (resetFromLoop) + { + this.setPlayingForwardState(); + } + else + { + this.setPendingRenderState(); + } + + if (this.delay > 0) + { + this.elapsed = this.delay; + + this.setDelayState(); + } + }, + + /** + * Internal method that will emit a TweenData based Event on the + * parent Tween and also invoke the given callback, if provided. + * + * @method Phaser.Tweens.TweenFrameData#dispatchEvent + * @since 3.60.0 + * + * @param {Phaser.Types.Tweens.Event} event - The Event to be dispatched. + * @param {Phaser.Types.Tweens.TweenCallbackTypes} [callback] - The name of the callback to be invoked. Can be `null` or `undefined` to skip invocation. + */ + dispatchEvent: function (event, callback) + { + var tween = this.tween; + + if (!tween.isSeeking) + { + var target = tween.targets[this.targetIndex]; + + tween.emit(event, tween, 'texture', target); + + var handler = tween.callbacks[callback]; + + if (handler) + { + handler.func.apply(handler.scope, [ tween, target, 'texture' ].concat(handler.params)); + } + } + }, + + /** + * Internal method used as part of the playback process that checks if this + * TweenData should yoyo, repeat, or has completed. + * + * @method Phaser.Tweens.TweenFrameData#setStateFromEnd + * @fires Phaser.Tweens.Events#TWEEN_REPEAT + * @fires Phaser.Tweens.Events#TWEEN_YOYO + * @since 3.60.0 + * + * @param {number} diff - Any extra time that needs to be accounted for in the elapsed and progress values. + */ + setStateFromEnd: function (diff) + { + if (this.repeatCounter > 0) + { + this.onRepeat(diff, true); + } + else + { + this.setCompleteState(); + } + }, + + /** + * Internal method used as part of the playback process that checks if this + * TweenData should repeat or has completed. + * + * @method Phaser.Tweens.TweenFrameData#setStateFromStart + * @fires Phaser.Tweens.Events#TWEEN_REPEAT + * @since 3.60.0 + * + * @param {number} diff - Any extra time that needs to be accounted for in the elapsed and progress values. + */ + setStateFromStart: function (diff) + { + if (this.repeatCounter > 0) + { + this.onRepeat(diff, false); + } + else + { + this.setCompleteState(); + } + }, + + /** + * Internal method that handles repeating or yoyo'ing this TweenData. + * + * Called automatically by `setStateFromStart` and `setStateFromEnd`. + * + * @method Phaser.Tweens.TweenFrameData#onRepeat + * @fires Phaser.Tweens.Events#TWEEN_REPEAT + * @fires Phaser.Tweens.Events#TWEEN_YOYO + * @since 3.60.0 + * + * @param {number} diff - Any extra time that needs to be accounted for in the elapsed and progress values. + * @param {boolean} [isYoyo=false] - Is this call a Yoyo check? + */ + onRepeat: function (diff, isYoyo) + { + if (isYoyo === undefined) { isYoyo = false; } + + var tween = this.tween; + + var targetIndex = this.targetIndex; + var target = tween.targets[targetIndex]; + + // Account for any extra time we got from the previous frame + this.elapsed = diff; + this.progress = diff / this.duration; + + if (this.flipX) + { + target.toggleFlipX(); + } + + if (this.flipY) + { + target.toggleFlipY(); + } + + if (isYoyo) + { + this.setPlayingBackwardState(); + + this.dispatchEvent(Events.TWEEN_YOYO, 'onYoyo'); + + return; + } + + this.repeatCounter--; + + // Delay? + if (this.repeatDelay > 0) + { + this.elapsed = this.repeatDelay - diff; + + this.setRepeatState(); + } + else + { + this.setPlayingForwardState(); + + this.dispatchEvent(Events.TWEEN_REPEAT, 'onRepeat'); + } + } + +}); + +module.exports = TweenFrameData; + + /***/ }), /***/ 55303: @@ -216855,98 +219686,108 @@ module.exports = TweenData; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +/** + * Phaser Tween States. + * + * @namespace Phaser.Tweens.States + * @memberof Phaser.Tweens + * @since 3.60.0 + */ + +/** + * Phaser Tween state constants. + * + * @typedef {Phaser.Tweens.States} Phaser.Tweens.StateType + * @memberof Phaser.Tweens + * @since 3.60.0 + */ + var TWEEN_CONST = { /** * TweenData state. - * - * @name Phaser.Tweens.CREATED + * + * @name Phaser.Tweens.States.CREATED * @type {number} + * @const * @since 3.0.0 */ CREATED: 0, - /** - * TweenData state. - * - * @name Phaser.Tweens.INIT - * @type {number} - * @since 3.0.0 - */ - INIT: 1, + // 1 used to be INIT prior to 3.60 /** * TweenData state. - * - * @name Phaser.Tweens.DELAY + * + * @name Phaser.Tweens.States.DELAY * @type {number} + * @const * @since 3.0.0 */ DELAY: 2, - /** - * TweenData state. - * - * @name Phaser.Tweens.OFFSET_DELAY - * @type {number} - * @since 3.0.0 - */ - OFFSET_DELAY: 3, + // 3 used to be OFFSET_DELAY prior to 3.60 /** * TweenData state. - * - * @name Phaser.Tweens.PENDING_RENDER + * + * @name Phaser.Tweens.States.PENDING_RENDER * @type {number} + * @const * @since 3.0.0 */ PENDING_RENDER: 4, /** * TweenData state. - * - * @name Phaser.Tweens.PLAYING_FORWARD + * + * @name Phaser.Tweens.States.PLAYING_FORWARD * @type {number} + * @const * @since 3.0.0 */ PLAYING_FORWARD: 5, /** * TweenData state. - * - * @name Phaser.Tweens.PLAYING_BACKWARD + * + * @name Phaser.Tweens.States.PLAYING_BACKWARD * @type {number} + * @const * @since 3.0.0 */ PLAYING_BACKWARD: 6, /** * TweenData state. - * - * @name Phaser.Tweens.HOLD_DELAY + * + * @name Phaser.Tweens.States.HOLD_DELAY * @type {number} + * @const * @since 3.0.0 */ HOLD_DELAY: 7, /** * TweenData state. - * - * @name Phaser.Tweens.REPEAT_DELAY + * + * @name Phaser.Tweens.States.REPEAT_DELAY * @type {number} + * @const * @since 3.0.0 */ REPEAT_DELAY: 8, /** * TweenData state. - * - * @name Phaser.Tweens.COMPLETE + * + * @name Phaser.Tweens.States.COMPLETE * @type {number} + * @const * @since 3.0.0 */ COMPLETE: 9, @@ -216954,67 +219795,97 @@ var TWEEN_CONST = { // Tween specific (starts from 20 to cleanly allow extra TweenData consts in the future) /** - * Tween state. - * - * @name Phaser.Tweens.PENDING_ADD + * Tween state. The Tween has been created but has not yet been added to the Tween Manager. + * + * @name Phaser.Tweens.States.PENDING * @type {number} + * @const * @since 3.0.0 */ - PENDING_ADD: 20, + PENDING: 20, /** - * Tween state. - * - * @name Phaser.Tweens.PAUSED + * Tween state. The Tween is active within the Tween Manager. This means it is either playing, + * or was playing and is currently paused, but in both cases it's still being processed by + * the Tween Manager, so is considered 'active'. + * + * @name Phaser.Tweens.States.ACTIVE * @type {number} + * @const * @since 3.0.0 */ - PAUSED: 21, + ACTIVE: 21, /** - * Tween state. - * - * @name Phaser.Tweens.LOOP_DELAY + * Tween state. The Tween is waiting for a loop countdown to elapse. + * + * @name Phaser.Tweens.States.LOOP_DELAY * @type {number} + * @const * @since 3.0.0 */ LOOP_DELAY: 22, /** - * Tween state. - * - * @name Phaser.Tweens.ACTIVE + * Tween state. The Tween is waiting for a complete delay to elapse. + * + * @name Phaser.Tweens.States.COMPLETE_DELAY * @type {number} + * @const * @since 3.0.0 */ - ACTIVE: 23, + COMPLETE_DELAY: 23, /** - * Tween state. - * - * @name Phaser.Tweens.COMPLETE_DELAY + * Tween state. The Tween is waiting for a starting delay to elapse. + * + * @name Phaser.Tweens.States.START_DELAY * @type {number} + * @const * @since 3.0.0 */ - COMPLETE_DELAY: 24, + START_DELAY: 24, /** - * Tween state. - * - * @name Phaser.Tweens.PENDING_REMOVE + * Tween state. The Tween has finished playback and is waiting to be removed from the Tween Manager. + * + * @name Phaser.Tweens.States.PENDING_REMOVE * @type {number} + * @const * @since 3.0.0 */ PENDING_REMOVE: 25, /** - * Tween state. - * - * @name Phaser.Tweens.REMOVED + * Tween state. The Tween has been removed from the Tween Manager. + * + * @name Phaser.Tweens.States.REMOVED * @type {number} + * @const * @since 3.0.0 */ - REMOVED: 26 + REMOVED: 26, + + /** + * Tween state. The Tween has finished playback but was flagged as 'persistent' during creation, + * so will not be automatically removed by the Tween Manager. + * + * @name Phaser.Tweens.States.FINISHED + * @type {number} + * @const + * @since 3.60.0 + */ + FINISHED: 27, + + /** + * Tween state. The Tween has been destroyed and can no longer be played by a Tween Manager. + * + * @name Phaser.Tweens.States.DESTROYED + * @type {number} + * @const + * @since 3.60.0 + */ + DESTROYED: 28 }; @@ -217028,7 +219899,7 @@ module.exports = TWEEN_CONST; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -217285,7 +220156,7 @@ module.exports = Class; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -217313,7 +220184,7 @@ module.exports = NOOP; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -217431,22 +220302,22 @@ module.exports = Add; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Adds the given item, or array of items, to the array starting at the index specified. - * + * * Each item must be unique within the array. - * + * * Existing elements in the array are shifted up. - * + * * The array is modified in-place and returned. - * + * * You can optionally specify a limit to the maximum size of the array. If the quantity of items being * added will take the array length over this limit, it will stop adding once the limit is reached. - * + * * You can optionally specify a callback to be invoked for each item successfully added to the array. * * @function Phaser.Utils.Array.AddAt @@ -217554,7 +220425,7 @@ module.exports = AddAt; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -217593,7 +220464,7 @@ module.exports = BringToTop; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -217646,7 +220517,7 @@ module.exports = CountAllMatching; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -217693,7 +220564,7 @@ module.exports = Each; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -217750,7 +220621,7 @@ module.exports = EachInRange; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -217828,6 +220699,50 @@ var FindClosestInSorted = function (value, array, key) module.exports = FindClosestInSorted; +/***/ }), + +/***/ 5454: +/***/ ((module) => { + +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Takes an array and flattens it, returning a shallow-copy flattened array. + * + * @function Phaser.Utils.Array.Flatten + * @since 3.60.0 + * + * @param {array} array - The array to flatten. + * @param {array} [output] - An array to hold the results in. + * + * @return {array} The flattened output array. + */ +var Flatten = function (array, output) +{ + if (output === undefined) { output = []; } + + for (var i = 0; i < array.length; i++) + { + if (Array.isArray(array[i])) + { + Flatten(array[i], output); + } + else + { + output.push(array[i]); + } + } + + return output; +}; + +module.exports = Flatten; + + /***/ }), /***/ 71608: @@ -217835,7 +220750,7 @@ module.exports = FindClosestInSorted; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -217898,7 +220813,7 @@ module.exports = GetAll; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -217958,7 +220873,7 @@ module.exports = GetFirst; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -217994,7 +220909,7 @@ module.exports = GetRandom; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -218008,7 +220923,7 @@ module.exports = GetRandom; * @param {array} array - The input array. * @param {*} item1 - The element to move above base element. * @param {*} item2 - The base element. - * + * * * @return {array} The input array. */ @@ -218059,7 +220974,7 @@ module.exports = MoveAbove; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -218073,7 +220988,7 @@ module.exports = MoveAbove; * @param {array} array - The input array. * @param {*} item1 - The element to move below base element. * @param {*} item2 - The base element. - * + * * * @return {array} The input array. */ @@ -218124,7 +221039,7 @@ module.exports = MoveBelow; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -218167,7 +221082,7 @@ module.exports = MoveDown; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -218215,7 +221130,7 @@ module.exports = MoveTo; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -218258,7 +221173,7 @@ module.exports = MoveUp; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -218352,7 +221267,7 @@ module.exports = NumberArray; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -218366,7 +221281,7 @@ var RoundAwayFromZero = __webpack_require__(67233); * * Certain values for `start` and `end` (eg. NaN/undefined/null) are currently coerced to 0; * for forward compatibility make sure to pass in actual numbers. - * + * * @example * NumberArrayStep(4); * // => [0, 1, 2, 3] @@ -218430,7 +221345,7 @@ module.exports = NumberArrayStep; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -218553,7 +221468,7 @@ module.exports = QuickSelect; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -218583,29 +221498,29 @@ var BuildChunk = function (a, b, qty) * * Range ([a,b,c], [1,2,3]) = * a1, a2, a3, b1, b2, b3, c1, c2, c3 - * + * * Range ([a,b], [1,2,3], qty = 3) = * a1, a1, a1, a2, a2, a2, a3, a3, a3, b1, b1, b1, b2, b2, b2, b3, b3, b3 - * + * * Range ([a,b,c], [1,2,3], repeat x1) = * a1, a2, a3, b1, b2, b3, c1, c2, c3, a1, a2, a3, b1, b2, b3, c1, c2, c3 - * + * * Range ([a,b], [1,2], repeat -1 = endless, max = 14) = * Maybe if max is set then repeat goes to -1 automatically? * a1, a2, b1, b2, a1, a2, b1, b2, a1, a2, b1, b2, a1, a2 (capped at 14 elements) - * + * * Range ([a], [1,2,3,4,5], random = true) = * a4, a1, a5, a2, a3 - * + * * Range ([a, b], [1,2,3], random = true) = * b3, a2, a1, b1, a3, b2 - * + * * Range ([a, b, c], [1,2,3], randomB = true) = * a3, a1, a2, b2, b3, b1, c1, c3, c2 - * + * * Range ([a], [1,2,3,4,5], yoyo = true) = * a1, a2, a3, a4, a5, a5, a4, a3, a2, a1 - * + * * Range ([a, b], [1,2,3], yoyo = true) = * a1, a2, a3, b1, b2, b3, b3, b2, b1, a3, a2, a1 * @@ -218692,7 +221607,7 @@ module.exports = Range; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -218782,7 +221697,7 @@ module.exports = Remove; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -218790,9 +221705,9 @@ var SpliceOne = __webpack_require__(72677); /** * Removes the item from the given position in the array. - * + * * The array is modified in-place. - * + * * You can optionally specify a callback to be invoked for the item if it is successfully removed from the array. * * @function Phaser.Utils.Array.RemoveAt @@ -218834,7 +221749,7 @@ module.exports = RemoveAt; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -218842,9 +221757,9 @@ var SafeRange = __webpack_require__(45838); /** * Removes the item within the given range in the array. - * + * * The array is modified in-place. - * + * * You can optionally specify a callback to be invoked for the item/s successfully removed from the array. * * @function Phaser.Utils.Array.RemoveBetween @@ -218898,7 +221813,7 @@ module.exports = RemoveBetween; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -218937,7 +221852,7 @@ module.exports = RemoveRandomElement; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -218982,7 +221897,7 @@ module.exports = Replace; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -219023,7 +221938,7 @@ module.exports = RotateLeft; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -219064,13 +221979,13 @@ module.exports = RotateRight; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Tests if the start and end indexes are a safe range for the given array. - * + * * @function Phaser.Utils.Array.SafeRange * @since 3.4.0 * @@ -219088,8 +222003,7 @@ var SafeRange = function (array, startIndex, endIndex, throwError) if (startIndex < 0 || startIndex > len || startIndex >= endIndex || - endIndex > len || - startIndex + endIndex > len) + endIndex > len) { if (throwError) { @@ -219114,7 +222028,7 @@ module.exports = SafeRange; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -219153,7 +222067,7 @@ module.exports = SendToBack; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -219209,7 +222123,7 @@ module.exports = SetAll; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -219251,7 +222165,7 @@ module.exports = Shuffle; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -219290,7 +222204,7 @@ module.exports = SortByDigits; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -219338,7 +222252,7 @@ module.exports = SpliceOne; /** * @author Richard Davey * @author Angry Bytes (and contributors) - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -219514,7 +222428,7 @@ module.exports = StableSort; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -219563,7 +222477,7 @@ module.exports = Swap; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -219582,6 +222496,7 @@ module.exports = { Each: __webpack_require__(36337), EachInRange: __webpack_require__(46208), FindClosestInSorted: __webpack_require__(2406), + Flatten: __webpack_require__(5454), GetAll: __webpack_require__(71608), GetFirst: __webpack_require__(51463), GetRandom: __webpack_require__(72861), @@ -219620,7 +222535,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -219683,7 +222598,7 @@ module.exports = CheckMatrix; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -219779,7 +222694,7 @@ module.exports = MatrixToString; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -219825,7 +222740,7 @@ module.exports = ReverseColumns; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -219876,7 +222791,7 @@ module.exports = ReverseRows; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -219924,7 +222839,7 @@ module.exports = Rotate180; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -219972,7 +222887,7 @@ module.exports = RotateLeft; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -220059,7 +222974,7 @@ module.exports = RotateMatrix; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -220107,7 +223022,7 @@ module.exports = RotateRight; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -220197,7 +223112,7 @@ module.exports = TranslateMatrix; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -220260,7 +223175,7 @@ module.exports = TransposeMatrix; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -220292,7 +223207,7 @@ module.exports = { /** * @author Niklas von Hertzen (https://github.com/niklasvh/base64-arraybuffer) * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -220300,17 +223215,17 @@ var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; /** * Converts an ArrayBuffer into a base64 string. - * + * * The resulting string can optionally be a data uri if the `mediaType` argument is provided. - * + * * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs for more details. * * @function Phaser.Utils.Base64.ArrayBufferToBase64 * @since 3.18.0 - * + * * @param {ArrayBuffer} arrayBuffer - The Array Buffer to encode. * @param {string} [mediaType] - An optional media type, i.e. `audio/ogg` or `image/jpeg`. If included the resulting string will be a data URI. - * + * * @return {string} The base64 encoded Array Buffer. */ var ArrayBufferToBase64 = function (arrayBuffer, mediaType) @@ -220336,7 +223251,7 @@ var ArrayBufferToBase64 = function (arrayBuffer, mediaType) { base64 = base64.substring(0, base64.length - 2) + '=='; } - + return base64; }; @@ -220351,7 +223266,7 @@ module.exports = ArrayBufferToBase64; /** * @author Niklas von Hertzen (https://github.com/niklasvh/base64-arraybuffer) * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -220370,9 +223285,9 @@ for (var i = 0; i < chars.length; i++) * * @function Phaser.Utils.Base64.Base64ToArrayBuffer * @since 3.18.0 - * + * * @param {string} base64 - The base64 string to be decoded. Can optionally contain a data URI header, which will be stripped out prior to decoding. - * + * * @return {ArrayBuffer} An ArrayBuffer decoded from the base64 data. */ var Base64ToArrayBuffer = function (base64) @@ -220426,7 +223341,7 @@ module.exports = Base64ToArrayBuffer; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -220449,7 +223364,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -220475,7 +223390,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -220518,7 +223433,7 @@ module.exports = Clone; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -220568,7 +223483,7 @@ module.exports = DeepCopy; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -220670,7 +223585,7 @@ module.exports = Extend; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -220681,7 +223596,7 @@ var GetValue = __webpack_require__(10850); * Retrieves a value from an object. Allows for more advanced selection options, including: * * Allowed types: - * + * * Implicit * { * x: 4 @@ -220706,7 +223621,7 @@ var GetValue = __webpack_require__(10850); * { * x: { randFloat: [min, max] } * } - * + * * * @function Phaser.Utils.Objects.GetAdvancedValue * @since 3.0.0 @@ -220758,7 +223673,7 @@ module.exports = GetAdvancedValue; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -220802,7 +223717,7 @@ module.exports = GetFastValue; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -220842,61 +223757,108 @@ module.exports = GetMinMaxValue; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -// Source object -// The key as a string, or an array of keys, i.e. 'banner', or 'banner.hideBanner' -// The default value to use if the key doesn't exist - /** - * Retrieves a value from an object. + * Retrieves a value from an object, or an alternative object, falling to a back-up default value if not found. + * + * The key is a string, which can be split based on the use of the period character. + * + * For example: + * + * ```javascript + * const source = { + * lives: 3, + * render: { + * screen: { + * width: 1024 + * } + * } + * } + * + * const lives = GetValue(source, 'lives', 1); + * const width = GetValue(source, 'render.screen.width', 800); + * const height = GetValue(source, 'render.screen.height', 600); + * ``` + * + * In the code above, `lives` will be 3 because it's defined at the top level of `source`. + * The `width` value will be 1024 because it can be found inside the `render.screen` object. + * The `height` value will be 600, the default value, because it is missing from the `render.screen` object. * * @function Phaser.Utils.Objects.GetValue * @since 3.0.0 * - * @param {object} source - The object to retrieve the value from. + * @param {object} source - The primary object to try to retrieve the value from. If not found in here, `altSource` is checked. * @param {string} key - The name of the property to retrieve from the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`) - `banner.hideBanner` would return the value of the `hideBanner` property from the object stored in the `banner` property of the `source` object. * @param {*} defaultValue - The value to return if the `key` isn't found in the `source` object. + * @param {object} [altSource] - An alternative object to retrieve the value from. If the property exists in `source` then `altSource` will not be used. * * @return {*} The value of the requested key. */ -var GetValue = function (source, key, defaultValue) +var GetValue = function (source, key, defaultValue, altSource) { - if (!source || typeof source === 'number') + if ((!source && !altSource) || typeof source === 'number') { return defaultValue; } - else if (source.hasOwnProperty(key)) + else if (source && source.hasOwnProperty(key)) { return source[key]; } + else if (altSource && altSource.hasOwnProperty(key)) + { + return altSource[key]; + } else if (key.indexOf('.') !== -1) { var keys = key.split('.'); - var parent = source; - var value = defaultValue; + var parentA = source; + var parentB = altSource; + var valueA = defaultValue; + var valueB = defaultValue; + var valueAFound = true; + var valueBFound = true; // Use for loop here so we can break early for (var i = 0; i < keys.length; i++) { - if (parent.hasOwnProperty(keys[i])) + if (parentA && parentA.hasOwnProperty(keys[i])) { - // Yes it has a key property, let's carry on down - value = parent[keys[i]]; - - parent = parent[keys[i]]; + // Yes parentA has a key property, let's carry on down + valueA = parentA[keys[i]]; + parentA = parentA[keys[i]]; } else { - // Can't go any further, so reset to default - value = defaultValue; - break; + valueAFound = false; + } + + if (parentB && parentB.hasOwnProperty(keys[i])) + { + // Yes parentB has a key property, let's carry on down + valueB = parentB[keys[i]]; + parentB = parentB[keys[i]]; + } + else + { + valueBFound = false; } } - return value; + if (valueAFound) + { + return valueA; + } + else if (valueBFound) + { + return valueB; + } + else + { + return defaultValue; + } } else { @@ -220914,7 +223876,7 @@ module.exports = GetValue; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -220952,7 +223914,7 @@ module.exports = HasAll; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -220990,7 +223952,7 @@ module.exports = HasAny; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -221020,7 +223982,7 @@ module.exports = HasValue; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -221077,7 +224039,7 @@ module.exports = IsPlainObject; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -221086,7 +224048,7 @@ var Clone = __webpack_require__(32742); /** * Creates a new Object using all values from obj1 and obj2. * If a value exists in both obj1 and obj2, the value in obj1 is used. - * + * * This is only a shallow copy. Deeply nested objects are not cloned, so be sure to only use this * function on shallow objects. * @@ -221123,7 +224085,7 @@ module.exports = Merge; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -221131,7 +224093,7 @@ var Clone = __webpack_require__(32742); /** * Creates a new Object using all values from obj1. - * + * * Then scans obj2. If a property is found in obj2 that *also* exists in obj1, the value from obj2 is used, otherwise the property is skipped. * * @function Phaser.Utils.Objects.MergeRight @@ -221167,7 +224129,7 @@ module.exports = MergeRight; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -221212,15 +224174,15 @@ module.exports = Pick; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Sets a value in an object, allowing for dot notation to control the depth of the property. - * + * * For example: - * + * * ```javascript * var data = { * world: { @@ -221230,9 +224192,9 @@ module.exports = Pick; * } * } * }; - * + * * SetValue(data, 'world.position.y', 300); - * + * * console.log(data.world.position.y); // 300 * ``` * @@ -221282,7 +224244,7 @@ var SetValue = function (source, key, value) return true; } - + return false; }; @@ -221296,7 +224258,7 @@ module.exports = SetValue; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -221332,7 +224294,7 @@ module.exports = { /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -221368,7 +224330,7 @@ module.exports = Format; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -221381,13 +224343,13 @@ module.exports = Format; * This would return: `bob---` as it has padded it out to 6 characters, using the `-` on the right. * * You can also use it to pad numbers (they are always returned as strings): - * + * * `pad(512, 6, '0', 1)` * * Would return: `000512` with the string padded to the left. * * If you don't specify a direction it'll pad to both sides: - * + * * `pad('c64', 7, '*')` * * Would return: `**c64**` @@ -221399,7 +224361,7 @@ module.exports = Format; * @param {number} [len=0] - The number of characters to be added. * @param {string} [pad=" "] - The string to pad it out with (defaults to a space). * @param {number} [dir=3] - The direction dir = 1 (left), 2 (right), 3 (both). - * + * * @return {string} The padded string. */ var Pad = function (str, len, pad, dir) @@ -221445,7 +224407,7 @@ module.exports = Pad; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -221482,7 +224444,7 @@ module.exports = RemoveAt; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -221512,13 +224474,13 @@ module.exports = Reverse; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Creates and returns an RFC4122 version 4 compliant UUID. - * + * * The string is in the form: `xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx` where each `x` is replaced with a random * hexadecimal digit from 0 to f, and `y` is replaced with a random hexadecimal digit from 8 to b. * @@ -221548,7 +224510,7 @@ module.exports = UUID; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -221586,7 +224548,7 @@ module.exports = UppercaseFirst; /** * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. + * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ diff --git a/dist/phaser.min.js b/dist/phaser.min.js index 6dd80b76d..9699c56f9 100644 --- a/dist/phaser.min.js +++ b/dist/phaser.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Phaser",[],e):"object"==typeof exports?exports.Phaser=e():t.Phaser=e()}(this,(function(){return(()=>{var t={6659:t=>{"use strict";var e=Object.prototype.hasOwnProperty,i="~";function s(){}function n(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function r(t,e,s,r,o){if("function"!=typeof s)throw new TypeError("The listener must be a function");var a=new n(s,r||t,o),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new s:delete t._events[e]}function a(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(i=!1)),a.prototype.eventNames=function(){var t,s,n=[];if(0===this._eventsCount)return n;for(s in t=this._events)e.call(t,s)&&n.push(i?s.slice(1):s);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=i?i+t:t,s=this._events[e];if(!s)return[];if(s.fn)return[s.fn];for(var n=0,r=s.length,o=new Array(r);n{var s=i(82590);t.exports=function(t,e,i,n){for(var r=t[0],o=1;o{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"angle",e,i,n,r)}},22015:t=>{t.exports=function(t,e,i){for(var s=0;s{t.exports=function(t,e,i){void 0===i&&(i=0);for(var s=i;s{t.exports=function(t,e,i){void 0===i&&(i=0);for(var s=i;s{var s=i(40327),n=i(84093),r=i(72632),o=i(72283),a=new(i(71030))({sys:{queueDepthSort:o,events:{once:o}}},0,0,1,1);t.exports=function(t,e){void 0===e&&(e={});var i=e.hasOwnProperty("width"),o=e.hasOwnProperty("height"),h=r(e,"width",-1),l=r(e,"height",-1),u=r(e,"cellWidth",1),c=r(e,"cellHeight",u),d=r(e,"position",n.TOP_LEFT),p=r(e,"x",0),f=r(e,"y",0),v=0,g=0,m=h*u,y=l*c;a.setPosition(p,f),a.setSize(u,c);for(var x=0;x{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"alpha",e,i,n,r)}},3877:(t,e,i)=>{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"x",e,i,n,r)}},71020:(t,e,i)=>{var s=i(6124);t.exports=function(t,e,i,n,r,o,a){return null==i&&(i=e),s(t,"x",e,n,o,a),s(t,"y",i,r,o,a)}},28970:(t,e,i)=>{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"y",e,i,n,r)}},82249:t=>{t.exports=function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=6.28);for(var n=i,r=(s-i)/t.length,o=0;o{t.exports=function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=6.28);for(var n=i,r=(s-i)/t.length,o=e.width/2,a=e.height/2,h=0;h{var s=i(8570);t.exports=function(t,e){for(var i=s(e,t.length),n=0;n{var s=i(40053),n=i(77640),r=i(38487);t.exports=function(t,e,i){void 0===i&&(i=0);var o=s(e,!1,t.length);i>0?n(o,i):i<0&&r(o,Math.abs(i));for(var a=0;a{var s=i(58813);t.exports=function(t,e,i){var n=s({x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2},i),r=s({x1:e.x2,y1:e.y2,x2:e.x3,y2:e.y3},i),o=s({x1:e.x3,y1:e.y3,x2:e.x1,y2:e.y1},i);n.pop(),r.pop(),o.pop();for(var a=(n=n.concat(r,o)).length/t.length,h=0,l=0;l{t.exports=function(t,e,i){for(var s=0;s{t.exports=function(t,e,i,s,n,r){var o;void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=1);var a=0,h=t.length;if(1===r)for(o=n;o=0;o--)t[o][e]+=i+a*s,a++;return t}},23646:t=>{t.exports=function(t,e,i,s,n,r){var o;void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=1);var a=0,h=t.length;if(1===r)for(o=n;o=0;o--)t[o][e]=i+a*s,a++;return t}},4392:(t,e,i)=>{var s=i(30977);t.exports=function(t,e){for(var i=0;i{var s=i(72006);t.exports=function(t,e){for(var i=0;i{var s=i(74077);t.exports=function(t,e){for(var i=0;i{var s=i(30001);t.exports=function(t,e){for(var i=0;i{var s=i(99761);t.exports=function(t,e){for(var i=0;i{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"rotation",e,i,n,r)}},87299:(t,e,i)=>{var s=i(72395),n=i(53996);t.exports=function(t,e,i){for(var r=e.x,o=e.y,a=0;a{var s=i(72395);t.exports=function(t,e,i,n){var r=e.x,o=e.y;if(0===n)return t;for(var a=0;a{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"scaleX",e,i,n,r)}},51449:(t,e,i)=>{var s=i(6124);t.exports=function(t,e,i,n,r,o,a){return null==i&&(i=e),s(t,"scaleX",e,n,o,a),s(t,"scaleY",i,r,o,a)}},64895:(t,e,i)=>{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"scaleY",e,i,n,r)}},30329:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"alpha",e,i,n,r)}},43954:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n){return s(t,"blendMode",e,0,i,n)}},70688:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"depth",e,i,n,r)}},8314:t=>{t.exports=function(t,e,i){for(var s=0;s{var s=i(23646);t.exports=function(t,e,i,n,r,o,a){return null==i&&(i=e),s(t,"originX",e,n,o,a),s(t,"originY",i,r,o,a),t.forEach((function(t){t.updateDisplayOrigin()})),t}},38767:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"rotation",e,i,n,r)}},18584:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r,o,a){return null==i&&(i=e),s(t,"scaleX",e,n,o,a),s(t,"scaleY",i,r,o,a)}},17381:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"scaleX",e,i,n,r)}},74370:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"scaleY",e,i,n,r)}},27773:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r,o,a){return null==i&&(i=e),s(t,"scrollFactorX",e,n,o,a),s(t,"scrollFactorY",i,r,o,a)}},75257:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"scrollFactorX",e,i,n,r)}},54512:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"scrollFactorY",e,i,n,r)}},69423:t=>{t.exports=function(t,e,i,s,n){for(var r=0;r{var s=i(23646);t.exports=function(t,e,i,n){return s(t,"visible",e,0,i,n)}},94833:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"x",e,i,n,r)}},14284:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r,o,a){return null==i&&(i=e),s(t,"x",e,n,o,a),s(t,"y",i,r,o,a)}},96574:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"y",e,i,n,r)}},74086:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r){var o,a,h,l,u,c;if(void 0===n&&(n=0),void 0===r&&(r=new s),t.length>1)if(0===n){var d=t.length-1;for(o=t[d].x,a=t[d].y,h=d-1;h>=0;h--)l=(c=t[h]).x,u=c.y,c.x=o,c.y=a,o=l,a=u;t[d].x=e,t[d].y=i}else{for(o=t[0].x,a=t[0].y,h=1;h{var s=i(18592);t.exports=function(t){return s(t)}},1558:(t,e,i)=>{var s=i(5514);t.exports=function(t,e,i,n,r){void 0===r&&(r=!1);var o,a=Math.abs(n-i)/t.length;if(r)for(o=0;o{var s=i(87736);t.exports=function(t,e,i,n,r){void 0===r&&(r=!1);var o,a=Math.abs(n-i)/t.length;if(r)for(o=0;o{t.exports=function(t,e,i,s,n){void 0===n&&(n=!1);var r,o=Math.abs(s-i)/t.length;if(n)for(r=0;r{t.exports=function(t){for(var e=0;e{var s=i(1071);t.exports=function(t,e,i){void 0===i&&(i=0);for(var n=0;n{t.exports={AlignTo:i(62270),Angle:i(61148),Call:i(22015),GetFirst:i(31060),GetLast:i(52367),GridAlign:i(12673),IncAlpha:i(691),IncX:i(3877),IncXY:i(71020),IncY:i(28970),PlaceOnCircle:i(82249),PlaceOnEllipse:i(30285),PlaceOnLine:i(61557),PlaceOnRectangle:i(63549),PlaceOnTriangle:i(51629),PlayAnimation:i(1045),PropertyValueInc:i(6124),PropertyValueSet:i(23646),RandomCircle:i(4392),RandomEllipse:i(94985),RandomLine:i(63305),RandomRectangle:i(90739),RandomTriangle:i(91417),Rotate:i(26182),RotateAround:i(87299),RotateAroundDistance:i(92194),ScaleX:i(30363),ScaleXY:i(51449),ScaleY:i(64895),SetAlpha:i(30329),SetBlendMode:i(43954),SetDepth:i(70688),SetHitArea:i(8314),SetOrigin:i(12894),SetRotation:i(38767),SetScale:i(18584),SetScaleX:i(17381),SetScaleY:i(74370),SetScrollFactor:i(27773),SetScrollFactorX:i(75257),SetScrollFactorY:i(54512),SetTint:i(69423),SetVisible:i(58291),SetX:i(94833),SetXY:i(14284),SetY:i(96574),ShiftPosition:i(74086),Shuffle:i(86347),SmootherStep:i(9938),SmoothStep:i(1558),Spread:i(71060),ToggleVisible:i(11207),WrapInRectangle:i(24404)}},85463:(t,e,i)=>{var s=i(82897),n=i(56694),r=i(16938),o=i(2406),a=i(71519),h=i(10850),l=i(28834),u=new n({initialize:function(t,e,i){this.manager=t,this.key=e,this.type="frame",this.frames=this.getFrames(t.textureManager,h(i,"frames",[]),h(i,"defaultTextureKey",null),h(i,"sortFrames",!0)),this.frameRate=h(i,"frameRate",null),this.duration=h(i,"duration",null),this.msPerFrame,this.skipMissedFrames=h(i,"skipMissedFrames",!0),this.delay=h(i,"delay",0),this.repeat=h(i,"repeat",0),this.repeatDelay=h(i,"repeatDelay",0),this.yoyo=h(i,"yoyo",!1),this.showOnStart=h(i,"showOnStart",!1),this.hideOnComplete=h(i,"hideOnComplete",!1),this.paused=!1,this.calculateDuration(this,this.getTotalFrames(),this.duration,this.frameRate),this.manager.on&&(this.manager.on(r.PAUSE_ALL,this.pause,this),this.manager.on(r.RESUME_ALL,this.resume,this))},getTotalFrames:function(){return this.frames.length},calculateDuration:function(t,e,i,s){null===i&&null===s?(t.frameRate=24,t.duration=24/e*1e3):i&&null===s?(t.duration=i,t.frameRate=e/(i/1e3)):(t.frameRate=s,t.duration=e/s*1e3),t.msPerFrame=1e3/t.frameRate},addFrame:function(t){return this.addFrameAt(this.frames.length,t)},addFrameAt:function(t,e){var i=this.getFrames(this.manager.textureManager,e);if(i.length>0){if(0===t)this.frames=i.concat(this.frames);else if(t===this.frames.length)this.frames=this.frames.concat(i);else{var s=this.frames.slice(0,t),n=this.frames.slice(t);this.frames=s.concat(i,n)}this.updateFrameSequence()}return this},checkFrame:function(t){return t>=0&&t0){r.isLast=!0,r.nextFrame=c[0],c[0].prevFrame=r;var y=1/(c.length-1);for(o=0;o0?t.inReverse&&t.forward?t.forward=!1:this.repeatAnimation(t):t.complete():this.updateAndGetNextTick(t,e.nextFrame)},handleYoyoFrame:function(t,e){if(e||(e=!1),t.inReverse===!e&&t.repeatCounter>0)return(0===t.repeatDelay||t.pendingRepeat)&&(t.forward=e),void this.repeatAnimation(t);if(t.inReverse===e||0!==t.repeatCounter){t.forward=e;var i=e?t.currentFrame.nextFrame:t.currentFrame.prevFrame;this.updateAndGetNextTick(t,i)}else t.complete()},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t.yoyo?this.handleYoyoFrame(t,!0):t.repeatCounter>0?(t.inReverse&&!t.forward||(t.forward=!0),this.repeatAnimation(t)):t.complete():this.updateAndGetNextTick(t,e.prevFrame)},updateAndGetNextTick:function(t,e){t.setCurrentFrame(e),this.getNextTick(t)},removeFrame:function(t){var e=this.frames.indexOf(t);return-1!==e&&this.removeFrameAt(e),this},removeFrameAt:function(t){return this.frames.splice(t,1),this.updateFrameSequence(),this},repeatAnimation:function(t){if(2===t._pendingStop){if(0===t._pendingStopValue)return t.stop();t._pendingStopValue--}t.repeatDelay>0&&!t.pendingRepeat?(t.pendingRepeat=!0,t.accumulator-=t.nextTick,t.nextTick+=t.repeatDelay):(t.repeatCounter--,t.forward?t.setCurrentFrame(t.currentFrame.nextFrame):t.setCurrentFrame(t.currentFrame.prevFrame),t.isPlaying&&(this.getNextTick(t),t.handleRepeat()))},toJSON:function(){var t={key:this.key,type:this.type,frames:[],frameRate:this.frameRate,duration:this.duration,skipMissedFrames:this.skipMissedFrames,delay:this.delay,repeat:this.repeat,repeatDelay:this.repeatDelay,yoyo:this.yoyo,showOnStart:this.showOnStart,hideOnComplete:this.hideOnComplete};return this.frames.forEach((function(e){t.frames.push(e.toJSON())})),t},updateFrameSequence:function(){for(var t,e=this.frames.length,i=1/(e-1),s=0;s1?(t.isLast=!0,t.prevFrame=this.frames[e-2],t.nextFrame=this.frames[0]):e>1&&(t.prevFrame=this.frames[s-1],t.nextFrame=this.frames[s+1]);return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.manager.off&&(this.manager.off(r.PAUSE_ALL,this.pause,this),this.manager.off(r.RESUME_ALL,this.resume,this)),this.manager.remove(this.key);for(var t=0;t{var s=new(i(56694))({initialize:function(t,e,i,s,n){void 0===n&&(n=!1),this.textureKey=t,this.textureFrame=e,this.index=i,this.frame=s,this.isFirst=!1,this.isLast=!1,this.prevFrame=null,this.nextFrame=null,this.duration=0,this.progress=0,this.isKeyFrame=n},toJSON:function(){return{key:this.textureKey,frame:this.textureFrame,duration:this.duration,keyframe:this.isKeyFrame}},destroy:function(){this.frame=void 0}});t.exports=s},90249:(t,e,i)=>{var s=i(85463),n=i(56694),r=i(33885),o=i(6659),a=i(16938),h=i(97081),l=i(72632),u=i(10850),c=i(76400),d=i(13401),p=new n({Extends:o,initialize:function(t){o.call(this),this.game=t,this.textureManager=null,this.globalTimeScale=1,this.anims=new r,this.mixes=new r,this.paused=!1,this.name="AnimationManager",t.events.once(h.BOOT,this.boot,this)},boot:function(){this.textureManager=this.game.textures,this.game.events.once(h.DESTROY,this.destroy,this)},addMix:function(t,e,i){var s=this.anims,n=this.mixes,r="string"==typeof t?t:t.key,o="string"==typeof e?e:e.key;if(s.has(r)&&s.has(o)){var a=n.get(r);a||(a={}),a[o]=i,n.set(r,a)}return this},removeMix:function(t,e){var i=this.mixes,s="string"==typeof t?t:t.key,n=i.get(s);if(n)if(e){var r="string"==typeof e?e:e.key;n.hasOwnProperty(r)&&delete n[r]}else e||i.delete(s);return this},getMix:function(t,e){var i=this.mixes,s="string"==typeof t?t:t.key,n="string"==typeof e?e:e.key,r=i.get(s);return r&&r.hasOwnProperty(n)?r[n]:0},add:function(t,e){return this.anims.has(t)?(console.warn("Animation key exists: "+t),this):(e.key=t,this.anims.set(t,e),this.emit(a.ADD_ANIMATION,t,e),this)},exists:function(t){return this.anims.has(t)},createFromAseprite:function(t,e){var i=[],s=this.game.cache.json.get(t);if(!s)return i;var n=this,r=u(s,"meta",null),o=u(s,"frames",null);r&&o&&u(r,"frameTags",[]).forEach((function(s){var r=[],a=l(s,"name",null),h=l(s,"from",0),u=l(s,"to",0),c=l(s,"direction","forward");if(a&&(!e||e&&e.indexOf(a)>-1)){for(var d=[],p=Number.MAX_SAFE_INTEGER,f=h;f<=u;f++){var v=f.toString(),g=o[v];if(g){var m=l(g,"duration",Number.MAX_SAFE_INTEGER);m{var s=i(56694),n=i(33885),r=i(72632),o=i(16938),a=i(85463),h=new s({initialize:function(t){this.parent=t,this.animationManager=t.scene.sys.anims,this.animationManager.on(o.REMOVE_ANIMATION,this.globalRemove,this),this.textureManager=this.animationManager.textureManager,this.anims=null,this.isPlaying=!1,this.hasStarted=!1,this.currentAnim=null,this.currentFrame=null,this.nextAnim=null,this.nextAnimsQueue=[],this.timeScale=1,this.frameRate=0,this.duration=0,this.msPerFrame=0,this.skipMissedFrames=!0,this.delay=0,this.repeat=0,this.repeatDelay=0,this.yoyo=!1,this.showOnStart=!1,this.hideOnComplete=!1,this.forward=!0,this.inReverse=!1,this.accumulator=0,this.nextTick=0,this.delayCounter=0,this.repeatCounter=0,this.pendingRepeat=!1,this._paused=!1,this._wasPlaying=!1,this._pendingStop=0,this._pendingStopValue},chain:function(t){var e=this.parent;if(void 0===t)return this.nextAnimsQueue.length=0,this.nextAnim=null,e;Array.isArray(t)||(t=[t]);for(var i=0;is.getTotalFrames()&&(h=0);var l=s.frames[h];0!==h||this.forward||(l=s.getLastFrame()),this.currentFrame=l}else console.warn("Missing animation: "+i);return this.parent},pause:function(t){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),void 0!==t&&this.setCurrentFrame(t),this.parent},resume:function(t){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),void 0!==t&&this.setCurrentFrame(t),this.parent},playAfterDelay:function(t,e){if(this.isPlaying){var i=this.nextAnim,s=this.nextAnimsQueue;i&&s.unshift(i),this.nextAnim=t,this._pendingStop=1,this._pendingStopValue=e}else this.delayCounter=e,this.play(t,!0);return this.parent},playAfterRepeat:function(t,e){if(void 0===e&&(e=1),this.isPlaying){var i=this.nextAnim,s=this.nextAnimsQueue;i&&s.unshift(i),-1!==this.repeatCounter&&e>this.repeatCounter&&(e=this.repeatCounter),this.nextAnim=t,this._pendingStop=2,this._pendingStopValue=e}else this.play(t);return this.parent},play:function(t,e){void 0===e&&(e=!1);var i=this.currentAnim,s=this.parent,n="string"==typeof t?t:t.key;if(e&&this.isPlaying&&i.key===n)return s;if(i&&this.isPlaying){var r=this.animationManager.getMix(i.key,t);if(r>0)return this.playAfterDelay(t,r)}return this.forward=!0,this.inReverse=!1,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t)},playReverse:function(t,e){void 0===e&&(e=!1);var i="string"==typeof t?t:t.key;return e&&this.isPlaying&&this.currentAnim.key===i?this.parent:(this.forward=!1,this.inReverse=!0,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t))},startAnimation:function(t){this.load(t);var e=this.currentAnim,i=this.parent;return e?(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat,e.getFirstTick(this),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!1,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.delayCounter+=this.delay,0===this.delayCounter&&this.handleStart(),i):i},handleStart:function(){this.showOnStart&&this.parent.setVisible(!0),this.setCurrentFrame(this.currentFrame),this.hasStarted=!0,this.emitEvents(o.ANIMATION_START)},handleRepeat:function(){this.pendingRepeat=!1,this.emitEvents(o.ANIMATION_REPEAT)},handleStop:function(){this._pendingStop=0,this.isPlaying=!1,this.emitEvents(o.ANIMATION_STOP)},handleComplete:function(){this._pendingStop=0,this.isPlaying=!1,this.hideOnComplete&&this.parent.setVisible(!1),this.emitEvents(o.ANIMATION_COMPLETE,o.ANIMATION_COMPLETE_KEY)},emitEvents:function(t,e){var i=this.currentAnim,s=this.currentFrame,n=this.parent,r=s.textureFrame;n.emit(t,i,s,n,r),e&&n.emit(e+i.key,i,s,n,r)},reverse:function(){return this.isPlaying&&(this.inReverse=!this.inReverse,this.forward=!this.forward),this.parent},getProgress:function(){var t=this.currentFrame;if(!t)return 0;var e=t.progress;return this.inReverse&&(e*=-1),e},setProgress:function(t){return this.forward||(t=1-t),this.setCurrentFrame(this.currentAnim.getFrameByProgress(t)),this.parent},setRepeat:function(t){return this.repeatCounter=-1===t?Number.MAX_VALUE:t,this.parent},globalRemove:function(t,e){void 0===e&&(e=this.currentAnim),this.isPlaying&&e.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},restart:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);var i=this.currentAnim,s=this.parent;return i?(e&&(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat),i.getFirstTick(this),this.emitEvents(o.ANIMATION_RESTART),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!t,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.setCurrentFrame(i.frames[0]),this.parent):s},complete:function(){if(this._pendingStop=0,this.isPlaying=!1,this.currentAnim&&this.handleComplete(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.length>0?this.nextAnimsQueue.shift():null,this.play(t)}return this.parent},stop:function(){if(this._pendingStop=0,this.isPlaying=!1,this.currentAnim&&this.handleStop(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.shift(),this.play(t)}return this.parent},stopAfterDelay:function(t){return this._pendingStop=1,this._pendingStopValue=t,this.parent},stopAfterRepeat:function(t){return void 0===t&&(t=1),-1!==this.repeatCounter&&t>this.repeatCounter&&(t=this.repeatCounter),this._pendingStop=2,this._pendingStopValue=t,this.parent},stopOnFrame:function(t){return this._pendingStop=3,this._pendingStopValue=t,this.parent},getTotalFrames:function(){return this.currentAnim?this.currentAnim.getTotalFrames():0},update:function(t,e){var i=this.currentAnim;if(this.isPlaying&&i&&!i.paused){if(this.accumulator+=e*this.timeScale,1===this._pendingStop&&(this._pendingStopValue-=e,this._pendingStopValue<=0))return this.stop();if(this.hasStarted){if(this.accumulator>=this.nextTick&&(this.forward?i.nextFrame(this):i.previousFrame(this),this.isPlaying&&0===this._pendingStop&&this.skipMissedFrames&&this.accumulator>this.nextTick)){var s=0;do{this.forward?i.nextFrame(this):i.previousFrame(this),s++}while(this.isPlaying&&this.accumulator>this.nextTick&&s<60)}}else this.accumulator>=this.delayCounter&&(this.accumulator-=this.delayCounter,this.handleStart())}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),t.setAlpha&&(e.alpha=t.alpha),e.setSizeToFrame(),e._originComponent&&(t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin()),this.isPlaying&&this.hasStarted&&(this.emitEvents(o.ANIMATION_UPDATE),3===this._pendingStop&&this._pendingStopValue===t&&this.stop()),e},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},get:function(t){return this.anims?this.anims.get(t):null},exists:function(t){return!!this.anims&&this.anims.has(t)},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))||(i=new a(this,e,t),this.anims||(this.anims=new n),this.anims.set(e,i))),i},generateFrameNames:function(t,e){return this.animationManager.generateFrameNames(t,e)},generateFrameNumbers:function(t,e){return this.animationManager.generateFrameNumbers(t,e)},remove:function(t){var e=this.get(t);return e&&(this.currentAnim===e&&this.stop(),this.anims.delete(t)),e},destroy:function(){this.animationManager.off(o.REMOVE_ANIMATION,this.globalRemove,this),this.anims&&this.anims.clear(),this.animationManager=null,this.parent=null,this.nextAnim=null,this.nextAnimsQueue.length=0,this.currentAnim=null,this.currentFrame=null},isPaused:{get:function(){return this._paused}}});t.exports=h},44509:t=>{t.exports="add"},84563:t=>{t.exports="animationcomplete"},61586:t=>{t.exports="animationcomplete-"},72175:t=>{t.exports="animationrepeat"},568:t=>{t.exports="animationrestart"},37690:t=>{t.exports="animationstart"},58525:t=>{t.exports="animationstop"},5243:t=>{t.exports="animationupdate"},10598:t=>{t.exports="pauseall"},4860:t=>{t.exports="remove"},31865:t=>{t.exports="resumeall"},16938:(t,e,i)=>{t.exports={ADD_ANIMATION:i(44509),ANIMATION_COMPLETE:i(84563),ANIMATION_COMPLETE_KEY:i(61586),ANIMATION_REPEAT:i(72175),ANIMATION_RESTART:i(568),ANIMATION_START:i(37690),ANIMATION_STOP:i(58525),ANIMATION_UPDATE:i(5243),PAUSE_ALL:i(10598),REMOVE_ANIMATION:i(4860),RESUME_ALL:i(31865)}},13517:(t,e,i)=>{t.exports={Animation:i(85463),AnimationFrame:i(71519),AnimationManager:i(90249),AnimationState:i(16569),Events:i(16938)}},23740:(t,e,i)=>{var s=i(56694),n=i(33885),r=i(6659),o=i(69773),a=new s({initialize:function(){this.entries=new n,this.events=new r},add:function(t,e){return this.entries.set(t,e),this.events.emit(o.ADD,this,t,e),this},has:function(t){return this.entries.has(t)},exists:function(t){return this.entries.has(t)},get:function(t){return this.entries.get(t)},remove:function(t){var e=this.get(t);return e&&(this.entries.delete(t),this.events.emit(o.REMOVE,this,t,e.data)),this},getKeys:function(){return this.entries.keys()},destroy:function(){this.entries.clear(),this.events.removeAllListeners(),this.entries=null,this.events=null}});t.exports=a},43474:(t,e,i)=>{var s=i(23740),n=i(56694),r=i(97081),o=new n({initialize:function(t){this.game=t,this.binary=new s,this.bitmapFont=new s,this.json=new s,this.physics=new s,this.shader=new s,this.audio=new s,this.video=new s,this.text=new s,this.html=new s,this.obj=new s,this.tilemap=new s,this.xml=new s,this.custom={},this.game.events.once(r.DESTROY,this.destroy,this)},addCustom:function(t){return this.custom.hasOwnProperty(t)||(this.custom[t]=new s),this.custom[t]},destroy:function(){for(var t=["binary","bitmapFont","json","physics","shader","audio","video","text","html","obj","tilemap","xml"],e=0;e{t.exports="add"},75968:t=>{t.exports="remove"},69773:(t,e,i)=>{t.exports={ADD:i(94762),REMOVE:i(75968)}},45820:(t,e,i)=>{t.exports={BaseCache:i(23740),CacheManager:i(43474),Events:i(69773)}},51052:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(75606),o=i(6659),a=i(89787),h=i(74118),l=i(69360),u=i(93222),c=i(93736),d=new s({Extends:o,Mixins:[n.Alpha,n.Visible],initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),o.call(this),this.scene,this.sceneManager,this.scaleManager,this.cameraManager,this.id=0,this.name="",this.roundPixels=!1,this.useBounds=!1,this.worldView=new h,this.dirty=!0,this._x=t,this._y=e,this._width=i,this._height=s,this._bounds=new h,this._scrollX=0,this._scrollY=0,this._zoomX=1,this._zoomY=1,this._rotation=0,this.matrix=new l,this.transparent=!0,this.backgroundColor=u("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new c(i/2,s/2),this.originX=.5,this.originY=.5,this._customViewport=!1,this.mask=null,this._maskCamera=null,this.renderList=[]},addToRenderList:function(t){this.renderList.push(t)},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this},getScroll:function(t,e,i){void 0===i&&(i=new c);var s=.5*this.width,n=.5*this.height;return i.x=t-s,i.y=e-n,this.useBounds&&(i.x=this.clampX(i.x),i.y=this.clampY(i.y)),i},centerOnX:function(t){var e=.5*this.width;return this.midPoint.x=t,this.scrollX=t-e,this.useBounds&&(this.scrollX=this.clampX(this.scrollX)),this},centerOnY:function(t){var e=.5*this.height;return this.midPoint.y=t,this.scrollY=t-e,this.useBounds&&(this.scrollY=this.clampY(this.scrollY)),this},centerOn:function(t,e){return this.centerOnX(t),this.centerOnY(e),this},centerToBounds:function(){if(this.useBounds){var t=this._bounds,e=.5*this.width,i=.5*this.height;this.midPoint.set(t.centerX,t.centerY),this.scrollX=t.centerX-e,this.scrollY=t.centerY-i}return this},centerToSize:function(){return this.scrollX=.5*this.width,this.scrollY=.5*this.height,this},cull:function(t){if(this.disableCull)return t;var e=this.matrix.matrix,i=e[0],s=e[1],n=e[2],r=e[3],o=i*r-s*n;if(!o)return t;var a=e[4],h=e[5],l=this.scrollX,u=this.scrollY,c=this.width,d=this.height,p=this.y,f=p+d,v=this.x,g=v+c,m=this.culledObjects,y=t.length;o=1/o,m.length=0;for(var x=0;xv&&E*i+S*n+ap&&E*s+S*r+hn&&(t=n),t},clampY:function(t){var e=this._bounds,i=this.displayHeight,s=e.y+(i-this.height)/2,n=Math.max(s,s+e.height-i);return tn&&(t=n),t},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(t){return void 0===t&&(t=0),this.rotation=r(t),this},setBackgroundColor:function(t){return void 0===t&&(t="rgba(0,0,0,0)"),this.backgroundColor=u(t),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(t,e,i,s,n){return void 0===n&&(n=!1),this._bounds.setTo(t,e,i,s),this.dirty=!0,this.useBounds=!0,n?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},getBounds:function(t){void 0===t&&(t=new h);var e=this._bounds;return t.setTo(e.x,e.y,e.width,e.height),t},setName:function(t){return void 0===t&&(t=""),this.name=t,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setRoundPixels:function(t){return this.roundPixels=t,this},setScene:function(t){this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=t;var e=t.sys;return this.sceneManager=e.game.scene,this.scaleManager=e.scale,this.cameraManager=e.cameras,this.updateSystem(),this},setScroll:function(t,e){return void 0===e&&(e=t),this.scrollX=t,this.scrollY=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},setViewport:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setZoom:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),0===t&&(t=.001),0===e&&(e=.001),this.zoomX=t,this.zoomY=e,this},setMask:function(t,e){return void 0===e&&(e=!0),this.mask=t,this._maskCamera=e?this.cameraManager.default:this,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},toJSON:function(){var t={name:this.name,x:this.x,y:this.y,width:this.width,height:this.height,zoom:this.zoom,rotation:this.rotation,roundPixels:this.roundPixels,scrollX:this.scrollX,scrollY:this.scrollY,backgroundColor:this.backgroundColor.rgba};return this.useBounds&&(t.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),t},update:function(){},updateSystem:function(){if(this.scaleManager){var t=0!==this._x||0!==this._y||this.scaleManager.width!==this._width||this.scaleManager.height!==this._height,e=this.sceneManager;t&&!this._customViewport?e.customViewports++:!t&&this._customViewport&&e.customViewports--,this.dirty=!0,this._customViewport=t}},destroy:function(){this.emit(a.DESTROY,this),this.removeAllListeners(),this.matrix.destroy(),this.culledObjects=[],this._customViewport&&this.sceneManager.customViewports--,this.renderList=[],this._bounds=null,this.scene=null,this.scaleManager=null,this.sceneManager=null,this.cameraManager=null},x:{get:function(){return this._x},set:function(t){this._x=t,this.updateSystem()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.updateSystem()}},width:{get:function(){return this._width},set:function(t){this._width=t,this.updateSystem()}},height:{get:function(){return this._height},set:function(t){this._height=t,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(t){this._scrollX=t,this.dirty=!0}},scrollY:{get:function(){return this._scrollY},set:function(t){this._scrollY=t,this.dirty=!0}},zoom:{get:function(){return(this._zoomX+this._zoomY)/2},set:function(t){this._zoomX=t,this._zoomY=t,this.dirty=!0}},zoomX:{get:function(){return this._zoomX},set:function(t){this._zoomX=t,this.dirty=!0}},zoomY:{get:function(){return this._zoomY},set:function(t){this._zoomY=t,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this.dirty=!0}},centerX:{get:function(){return this.x+.5*this.width}},centerY:{get:function(){return this.y+.5*this.height}},displayWidth:{get:function(){return this.width/this.zoomX}},displayHeight:{get:function(){return this.height/this.zoomY}}});t.exports=d},47751:(t,e,i)=>{var s=i(51052),n=i(79993),r=i(82897),o=i(56694),a=i(64937),h=i(53030),l=i(89787),u=i(42798),c=i(74118),d=i(93736),p=new o({Extends:s,Mixins:[a.Pipeline],initialize:function(t,e,i,n){s.call(this,t,e,i,n),this.postPipelines=[],this.pipelineData={},this.inputEnabled=!0,this.fadeEffect=new h.Fade(this),this.flashEffect=new h.Flash(this),this.shakeEffect=new h.Shake(this),this.panEffect=new h.Pan(this),this.rotateToEffect=new h.RotateTo(this),this.zoomEffect=new h.Zoom(this),this.lerp=new d(1,1),this.followOffset=new d,this.deadzone=null,this._follow=null},setDeadzone:function(t,e){if(void 0===t)this.deadzone=null;else{if(this.deadzone?(this.deadzone.width=t,this.deadzone.height=e):this.deadzone=new c(0,0,t,e),this._follow){var i=this.width/2,s=this.height/2,r=this._follow.x-this.followOffset.x,o=this._follow.y-this.followOffset.y;this.midPoint.set(r,o),this.scrollX=r-i,this.scrollY=o-s}n(this.deadzone,this.midPoint.x,this.midPoint.y)}return this},fadeIn:function(t,e,i,s,n,r){return this.fadeEffect.start(!1,t,e,i,s,!0,n,r)},fadeOut:function(t,e,i,s,n,r){return this.fadeEffect.start(!0,t,e,i,s,!0,n,r)},fadeFrom:function(t,e,i,s,n,r,o){return this.fadeEffect.start(!1,t,e,i,s,n,r,o)},fade:function(t,e,i,s,n,r,o){return this.fadeEffect.start(!0,t,e,i,s,n,r,o)},flash:function(t,e,i,s,n,r,o){return this.flashEffect.start(t,e,i,s,n,r,o)},shake:function(t,e,i,s,n){return this.shakeEffect.start(t,e,i,s,n)},pan:function(t,e,i,s,n,r,o){return this.panEffect.start(t,e,i,s,n,r,o)},rotateTo:function(t,e,i,s,n,r,o){return this.rotateToEffect.start(t,e,i,s,n,r,o)},zoomTo:function(t,e,i,s,n,r){return this.zoomEffect.start(t,e,i,s,n,r)},preRender:function(){this.renderList.length=0;var t=this.width,e=this.height,i=.5*t,s=.5*e,r=this.zoom,o=this.matrix,a=t*this.originX,h=e*this.originY,c=this._follow,d=this.deadzone,p=this.scrollX,f=this.scrollY;d&&n(d,this.midPoint.x,this.midPoint.y);var v=!1;if(c&&!this.panEffect.isRunning){var g=c.x-this.followOffset.x,m=c.y-this.followOffset.y;d?(gd.right&&(p=u(p,p+(g-d.right),this.lerp.x)),md.bottom&&(f=u(f,f+(m-d.bottom),this.lerp.y))):(p=u(p,g-a,this.lerp.x),f=u(f,m-h,this.lerp.y)),v=!0}this.useBounds&&(p=this.clampX(p),f=this.clampY(f)),this.roundPixels&&(a=Math.round(a),h=Math.round(h),p=Math.round(p),f=Math.round(f)),this.scrollX=p,this.scrollY=f;var y=p+i,x=f+s;this.midPoint.set(y,x);var T=t/r,w=e/r,b=y-T/2,E=x-w/2;this.roundPixels&&(b=Math.round(b),E=Math.round(E)),this.worldView.setTo(b,E,T,w),o.applyITRS(this.x+a,this.y+h,this.rotation,r,r),o.translate(-a,-h),this.shakeEffect.preRender(),v&&this.emit(l.FOLLOW_UPDATE,this,c)},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,s,n,o){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===s&&(s=i),void 0===n&&(n=0),void 0===o&&(o=n),this._follow=t,this.roundPixels=e,i=r(i,0,1),s=r(s,0,1),this.lerp.set(i,s),this.followOffset.set(n,o);var a=this.width/2,h=this.height/2,l=t.x-n,u=t.y-o;return this.midPoint.set(l,u),this.scrollX=l-a,this.scrollY=u-h,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.rotateToEffect.reset(),this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.rotateToEffect.update(t,e),this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.resetFX(),s.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=p},62382:(t,e,i)=>{var s=i(47751),n=i(56694),r=i(72632),o=i(91963),a=i(94287),h=i(40444),l=i(7599),u=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.roundPixels=t.sys.game.config.roundPixels,this.cameras=[],this.main,this.default,t.sys.events.once(l.BOOT,this.boot,this),t.sys.events.on(l.START,this.start,this)},boot:function(){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0],this.default=new s(0,0,t.scale.width,t.scale.height).setScene(this.scene),t.game.scale.on(h.RESIZE,this.onResize,this),this.systems.events.once(l.DESTROY,this.destroy,this)},start:function(){if(!this.main){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0]}var e=this.systems.events;e.on(l.UPDATE,this.update,this),e.once(l.SHUTDOWN,this.shutdown,this)},add:function(t,e,i,n,r,o){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===n&&(n=this.scene.sys.scale.height),void 0===r&&(r=!1),void 0===o&&(o="");var a=new s(t,e,i,n);return a.setName(o),a.setScene(this.scene),a.setRoundPixels(this.roundPixels),a.id=this.getNextID(),this.cameras.push(a),r&&(this.main=a),a},addExisting:function(t,e){return void 0===e&&(e=!1),-1===this.cameras.indexOf(t)?(t.id=this.getNextID(),t.setRoundPixels(this.roundPixels),this.cameras.push(t),e&&(this.main=t),t):null},getNextID:function(){for(var t=this.cameras,e=1,i=0;i<32;i++){for(var s=!1,n=0;n0){r.preRender();var o=this.getVisibleChildren(e.getChildren(),r);t.render(i,o,r)}}},getVisibleChildren:function(t,e){for(var i=[],s=0;s{var s=i(82897),n=i(56694),r=i(89787),o=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.isComplete=!1,this.direction=!0,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n,o,a,h){if(void 0===t&&(t=!0),void 0===e&&(e=1e3),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=0),void 0===o&&(o=!1),void 0===a&&(a=null),void 0===h&&(h=this.camera.scene),!o&&this.isRunning)return this.camera;this.isRunning=!0,this.isComplete=!1,this.duration=e,this.direction=t,this.progress=0,this.red=i,this.green=s,this.blue=n,this.alpha=t?Number.MIN_VALUE:1,this._elapsed=0,this._onUpdate=a,this._onUpdateScope=h;var l=t?r.FADE_OUT_START:r.FADE_IN_START;return this.camera.emit(l,this.camera,this,e,i,s,n),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=s(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed{var s=i(82897),n=i(56694),r=i(89787),o=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=1,this.progress=0,this._elapsed=0,this._alpha,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n,o,a){return void 0===t&&(t=250),void 0===e&&(e=255),void 0===i&&(i=255),void 0===s&&(s=255),void 0===n&&(n=!1),void 0===o&&(o=null),void 0===a&&(a=this.camera.scene),!n&&this.isRunning||(this.isRunning=!0,this.duration=t,this.progress=0,this.red=e,this.green=i,this.blue=s,this._alpha=this.alpha,this._elapsed=0,this._onUpdate=o,this._onUpdateScope=a,this.camera.emit(r.FLASH_START,this.camera,this,t,e,i,s)),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=s(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed{var s=i(82897),n=i(56694),r=i(35060),o=i(89787),a=i(93736),h=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=new a,this.current=new a,this.destination=new a,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n,a,h){void 0===i&&(i=1e3),void 0===s&&(s=r.Linear),void 0===n&&(n=!1),void 0===a&&(a=null),void 0===h&&(h=this.camera.scene);var l=this.camera;return!n&&this.isRunning||(this.isRunning=!0,this.duration=i,this.progress=0,this.source.set(l.scrollX,l.scrollY),this.destination.set(t,e),l.getScroll(t,e,this.current),"string"==typeof s&&r.hasOwnProperty(s)?this.ease=r[s]:"function"==typeof s&&(this.ease=s),this._elapsed=0,this._onUpdate=a,this._onUpdateScope=h,this.camera.emit(o.PAN_START,this.camera,this,i,t,e)),l},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=s(this._elapsed/this.duration,0,1);this.progress=i;var n=this.camera;if(this._elapsed{var s=i(82897),n=i(56694),r=i(89787),o=i(35060),a=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=0,this.current=0,this.destination=0,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope,this.clockwise=!0,this.shortestPath=!1},start:function(t,e,i,s,n,a,h){void 0===i&&(i=1e3),void 0===s&&(s=o.Linear),void 0===n&&(n=!1),void 0===a&&(a=null),void 0===h&&(h=this.camera.scene),void 0===e&&(e=!1),this.shortestPath=e;var l=t;t<0?(l=-1*t,this.clockwise=!1):this.clockwise=!0;var u=360*Math.PI/180;l-=Math.floor(l/u)*u;var c=this.camera;if(!n&&this.isRunning)return c;if(this.isRunning=!0,this.duration=i,this.progress=0,this.source=c.rotation,this.destination=l,"string"==typeof s&&o.hasOwnProperty(s)?this.ease=o[s]:"function"==typeof s&&(this.ease=s),this._elapsed=0,this._onUpdate=a,this._onUpdateScope=h,this.shortestPath){var d=0,p=0;(d=this.destination>this.source?Math.abs(this.destination-this.source):Math.abs(this.destination+u)-this.source)<(p=this.source>this.destination?Math.abs(this.source-this.destination):Math.abs(this.source+u)-this.destination)?this.clockwise=!0:d>p&&(this.clockwise=!1)}return this.camera.emit(r.ROTATE_START,this.camera,this,i,l),c},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=s(this._elapsed/this.duration,0,1);this.progress=i;var n=this.camera;if(this._elapsed=l?Math.abs(h-l):Math.abs(h+a)-l;var u=0;u=this.clockwise?n.rotation+o*r:n.rotation-o*r,n.rotation=u,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,n,i,u)}else n.rotation=this.destination,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,n,i,this.destination),this.effectComplete()}},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(r.ROTATE_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null,this.source=null,this.destination=null}});t.exports=a},3241:(t,e,i)=>{var s=i(82897),n=i(56694),r=i(89787),o=i(93736),a=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.intensity=new o,this.progress=0,this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n){return void 0===t&&(t=100),void 0===e&&(e=.05),void 0===i&&(i=!1),void 0===s&&(s=null),void 0===n&&(n=this.camera.scene),!i&&this.isRunning||(this.isRunning=!0,this.duration=t,this.progress=0,"number"==typeof e?this.intensity.set(e):this.intensity.set(e.x,e.y),this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate=s,this._onUpdateScope=n,this.camera.emit(r.SHAKE_START,this.camera,this,t,e)),this.camera},preRender:function(){this.isRunning&&this.camera.matrix.translate(this._offsetX,this._offsetY)},update:function(t,e){if(this.isRunning)if(this._elapsed+=e,this.progress=s(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed{var s=i(82897),n=i(56694),r=i(35060),o=i(89787),a=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=1,this.destination=1,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n,a){void 0===e&&(e=1e3),void 0===i&&(i=r.Linear),void 0===s&&(s=!1),void 0===n&&(n=null),void 0===a&&(a=this.camera.scene);var h=this.camera;return!s&&this.isRunning||(this.isRunning=!0,this.duration=e,this.progress=0,this.source=h.zoom,this.destination=t,"string"==typeof i&&r.hasOwnProperty(i)?this.ease=r[i]:"function"==typeof i&&(this.ease=i),this._elapsed=0,this._onUpdate=n,this._onUpdateScope=a,this.camera.emit(o.ZOOM_START,this.camera,this,e,t)),h},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=s(this._elapsed/this.duration,0,1),this._elapsed{t.exports={Fade:i(92522),Flash:i(22151),Pan:i(37551),Shake:i(3241),RotateTo:i(1771),Zoom:i(13383)}},39577:t=>{t.exports="cameradestroy"},85373:t=>{t.exports="camerafadeincomplete"},92057:t=>{t.exports="camerafadeinstart"},1903:t=>{t.exports="camerafadeoutcomplete"},96131:t=>{t.exports="camerafadeoutstart"},85409:t=>{t.exports="cameraflashcomplete"},25500:t=>{t.exports="cameraflashstart"},44071:t=>{t.exports="followupdate"},19818:t=>{t.exports="camerapancomplete"},80002:t=>{t.exports="camerapanstart"},87966:t=>{t.exports="postrender"},74217:t=>{t.exports="prerender"},34805:t=>{t.exports="camerarotatecomplete"},30408:t=>{t.exports="camerarotatestart"},49856:t=>{t.exports="camerashakecomplete"},69189:t=>{t.exports="camerashakestart"},67657:t=>{t.exports="camerazoomcomplete"},14229:t=>{t.exports="camerazoomstart"},89787:(t,e,i)=>{t.exports={DESTROY:i(39577),FADE_IN_COMPLETE:i(85373),FADE_IN_START:i(92057),FADE_OUT_COMPLETE:i(1903),FADE_OUT_START:i(96131),FLASH_COMPLETE:i(85409),FLASH_START:i(25500),FOLLOW_UPDATE:i(44071),PAN_COMPLETE:i(19818),PAN_START:i(80002),POST_RENDER:i(87966),PRE_RENDER:i(74217),ROTATE_COMPLETE:i(34805),ROTATE_START:i(30408),SHAKE_COMPLETE:i(49856),SHAKE_START:i(69189),ZOOM_COMPLETE:i(67657),ZOOM_START:i(14229)}},32356:(t,e,i)=>{t.exports={Camera:i(47751),BaseCamera:i(51052),CameraManager:i(62382),Effects:i(53030),Events:i(89787)}},84219:(t,e,i)=>{var s=i(56694),n=i(10850),r=new s({initialize:function(t){this.camera=n(t,"camera",null),this.left=n(t,"left",null),this.right=n(t,"right",null),this.up=n(t,"up",null),this.down=n(t,"down",null),this.zoomIn=n(t,"zoomIn",null),this.zoomOut=n(t,"zoomOut",null),this.zoomSpeed=n(t,"zoomSpeed",.01),this.minZoom=n(t,"minZoom",.001),this.maxZoom=n(t,"maxZoom",1e3),this.speedX=0,this.speedY=0;var e=n(t,"speed",null);"number"==typeof e?(this.speedX=e,this.speedY=e):(this.speedX=n(t,"speed.x",0),this.speedY=n(t,"speed.y",0)),this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this.up&&this.up.isDown?e.scrollY-=this.speedY*t|0:this.down&&this.down.isDown&&(e.scrollY+=this.speedY*t|0),this.left&&this.left.isDown?e.scrollX-=this.speedX*t|0:this.right&&this.right.isDown&&(e.scrollX+=this.speedX*t|0),this.zoomIn&&this.zoomIn.isDown?(e.zoom-=this.zoomSpeed,e.zoomthis.maxZoom&&(e.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},69370:(t,e,i)=>{var s=i(56694),n=i(10850),r=new s({initialize:function(t){this.camera=n(t,"camera",null),this.left=n(t,"left",null),this.right=n(t,"right",null),this.up=n(t,"up",null),this.down=n(t,"down",null),this.zoomIn=n(t,"zoomIn",null),this.zoomOut=n(t,"zoomOut",null),this.zoomSpeed=n(t,"zoomSpeed",.01),this.minZoom=n(t,"minZoom",.001),this.maxZoom=n(t,"maxZoom",1e3),this.accelX=0,this.accelY=0;var e=n(t,"acceleration",null);"number"==typeof e?(this.accelX=e,this.accelY=e):(this.accelX=n(t,"acceleration.x",0),this.accelY=n(t,"acceleration.y",0)),this.dragX=0,this.dragY=0;var i=n(t,"drag",null);"number"==typeof i?(this.dragX=i,this.dragY=i):(this.dragX=n(t,"drag.x",0),this.dragY=n(t,"drag.y",0)),this.maxSpeedX=0,this.maxSpeedY=0;var s=n(t,"maxSpeed",null);"number"==typeof s?(this.maxSpeedX=s,this.maxSpeedY=s):(this.maxSpeedX=n(t,"maxSpeed.x",0),this.maxSpeedY=n(t,"maxSpeed.y",0)),this._speedX=0,this._speedY=0,this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this._speedX>0?(this._speedX-=this.dragX*t,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*t,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*t,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*t,this._speedY>0&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoomthis.maxZoom&&(e.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},6524:(t,e,i)=>{t.exports={FixedKeyControl:i(84219),SmoothedKeyControl:i(69370)}},44143:(t,e,i)=>{t.exports={Controls:i(6524),Scene2D:i(32356)}},86459:(t,e,i)=>{var s={VERSION:"3.60.0-beta.3",BlendModes:i(95723),ScaleModes:i(27394),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=s},14033:(t,e,i)=>{var s=i(56694),n=i(86459),r=i(77290),o=i(72632),a=i(10850),h=i(42911),l=i(5923),u=i(72283),c=i(18360),d=i(93222),p=new s({initialize:function(t){void 0===t&&(t={});this.width=a(t,"width",1024),this.height=a(t,"height",768),this.zoom=a(t,"zoom",1),this.parent=a(t,"parent",void 0),this.scaleMode=a(t,"scaleMode",0),this.expandParent=a(t,"expandParent",!0),this.autoRound=a(t,"autoRound",!1),this.autoCenter=a(t,"autoCenter",0),this.resizeInterval=a(t,"resizeInterval",500),this.fullscreenTarget=a(t,"fullscreenTarget",null),this.minWidth=a(t,"minWidth",0),this.maxWidth=a(t,"maxWidth",0),this.minHeight=a(t,"minHeight",0),this.maxHeight=a(t,"maxHeight",0);var e=a(t,"scale",null);e&&(this.width=a(e,"width",this.width),this.height=a(e,"height",this.height),this.zoom=a(e,"zoom",this.zoom),this.parent=a(e,"parent",this.parent),this.scaleMode=a(e,"mode",this.scaleMode),this.expandParent=a(e,"expandParent",this.expandParent),this.autoRound=a(e,"autoRound",this.autoRound),this.autoCenter=a(e,"autoCenter",this.autoCenter),this.resizeInterval=a(e,"resizeInterval",this.resizeInterval),this.fullscreenTarget=a(e,"fullscreenTarget",this.fullscreenTarget),this.minWidth=a(e,"min.width",this.minWidth),this.maxWidth=a(e,"max.width",this.maxWidth),this.minHeight=a(e,"min.height",this.minHeight),this.maxHeight=a(e,"max.height",this.maxHeight)),this.renderType=a(t,"type",n.AUTO),this.canvas=a(t,"canvas",null),this.context=a(t,"context",null),this.canvasStyle=a(t,"canvasStyle",null),this.customEnvironment=a(t,"customEnvironment",!1),this.sceneConfig=a(t,"scene",null),this.seed=a(t,"seed",[(Date.now()*Math.random()).toString()]),l.RND=new l.RandomDataGenerator(this.seed),this.gameTitle=a(t,"title",""),this.gameURL=a(t,"url","https://phaser.io"),this.gameVersion=a(t,"version",""),this.autoFocus=a(t,"autoFocus",!0),this.domCreateContainer=a(t,"dom.createContainer",!1),this.domPointerEvents=a(t,"dom.pointerEvents","none"),this.inputKeyboard=a(t,"input.keyboard",!0),this.inputKeyboardEventTarget=a(t,"input.keyboard.target",window),this.inputKeyboardCapture=a(t,"input.keyboard.capture",[]),this.inputMouse=a(t,"input.mouse",!0),this.inputMouseEventTarget=a(t,"input.mouse.target",null),this.inputMousePreventDefaultDown=a(t,"input.mouse.preventDefaultDown",!0),this.inputMousePreventDefaultUp=a(t,"input.mouse.preventDefaultUp",!0),this.inputMousePreventDefaultMove=a(t,"input.mouse.preventDefaultMove",!0),this.inputMousePreventDefaultWheel=a(t,"input.mouse.preventDefaultWheel",!0),this.inputTouch=a(t,"input.touch",r.input.touch),this.inputTouchEventTarget=a(t,"input.touch.target",null),this.inputTouchCapture=a(t,"input.touch.capture",!0),this.inputActivePointers=a(t,"input.activePointers",1),this.inputSmoothFactor=a(t,"input.smoothFactor",0),this.inputWindowEvents=a(t,"input.windowEvents",!0),this.inputGamepad=a(t,"input.gamepad",!1),this.inputGamepadEventTarget=a(t,"input.gamepad.target",window),this.disableContextMenu=a(t,"disableContextMenu",!1),this.audio=a(t,"audio",{}),this.hideBanner=!1===a(t,"banner",null),this.hidePhaser=a(t,"banner.hidePhaser",!1),this.bannerTextColor=a(t,"banner.text","#ffffff"),this.bannerBackgroundColor=a(t,"banner.background",["#ff0000","#ffff00","#00ff00","#00ffff","#000000"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=a(t,"fps",null);var i=a(t,"render",t);this.pipeline=a(i,"pipeline",null),this.antialias=a(i,"antialias",!0),this.antialiasGL=a(i,"antialiasGL",!0),this.mipmapFilter=a(i,"mipmapFilter","LINEAR"),this.desynchronized=a(i,"desynchronized",!1),this.roundPixels=a(i,"roundPixels",!1),this.pixelArt=a(i,"pixelArt",1!==this.zoom),this.pixelArt&&(this.antialias=!1,this.antialiasGL=!1,this.roundPixels=!0),this.transparent=a(i,"transparent",!1),this.clearBeforeRender=a(i,"clearBeforeRender",!0),this.preserveDrawingBuffer=a(i,"preserveDrawingBuffer",!1),this.premultipliedAlpha=a(i,"premultipliedAlpha",!0),this.failIfMajorPerformanceCaveat=a(i,"failIfMajorPerformanceCaveat",!1),this.powerPreference=a(i,"powerPreference","default"),this.batchSize=a(i,"batchSize",4096),this.maxTextures=a(i,"maxTextures",-1),this.maxLights=a(i,"maxLights",10);var s=a(t,"backgroundColor",0);this.backgroundColor=d(s),this.transparent&&(this.backgroundColor=d(0),this.backgroundColor.alpha=0),this.preBoot=a(t,"callbacks.preBoot",u),this.postBoot=a(t,"callbacks.postBoot",u),this.physics=a(t,"physics",{}),this.defaultPhysicsSystem=a(this.physics,"default",!1),this.loaderBaseURL=a(t,"loader.baseURL",""),this.loaderPath=a(t,"loader.path","");var p=r.os.android?6:32;this.loaderMaxParallelDownloads=a(t,"loader.maxParallelDownloads",p),this.loaderCrossOrigin=a(t,"loader.crossOrigin",void 0),this.loaderResponseType=a(t,"loader.responseType",""),this.loaderAsync=a(t,"loader.async",!0),this.loaderUser=a(t,"loader.user",""),this.loaderPassword=a(t,"loader.password",""),this.loaderTimeout=a(t,"loader.timeout",0),this.loaderWithCredentials=a(t,"loader.withCredentials",!1),this.loaderImageLoadType=a(t,"loader.imageLoadType","XHR"),this.installGlobalPlugins=[],this.installScenePlugins=[];var f=a(t,"plugins",null),v=c.DefaultScene;f&&(Array.isArray(f)?this.defaultPlugins=f:h(f)&&(this.installGlobalPlugins=o(f,"global",[]),this.installScenePlugins=o(f,"scene",[]),Array.isArray(f.default)?v=f.default:Array.isArray(f.defaultMerge)&&(v=v.concat(f.defaultMerge)))),this.defaultPlugins=v;var g="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=a(t,"images.default",g+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=a(t,"images.missing",g+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),this.whiteImage=a(t,"images.white","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABdJREFUeNpi/P//PwMMMDEgAdwcgAADAJZuAwXJYZOzAAAAAElFTkSuQmCC"),window&&(window.FORCE_WEBGL?this.renderType=n.WEBGL:window.FORCE_CANVAS&&(this.renderType=n.CANVAS))}});t.exports=p},50150:(t,e,i)=>{var s=i(70616),n=i(61068),r=i(86459),o=i(90185);t.exports=function(t){var e=t.config;if((e.customEnvironment||e.canvas)&&e.renderType===r.AUTO)throw new Error("Must set explicit renderType in custom environment");if(!e.customEnvironment&&!e.canvas&&e.renderType!==r.HEADLESS)if(e.renderType===r.AUTO&&(e.renderType=o.webGL?r.WEBGL:r.CANVAS),e.renderType===r.WEBGL){if(!o.webGL)throw new Error("Cannot create WebGL context, aborting.")}else{if(e.renderType!==r.CANVAS)throw new Error("Unknown value for renderer type: "+e.renderType);if(!o.canvas)throw new Error("Cannot create Canvas context, aborting.")}e.antialias||n.disableSmoothing();var a,h,l=t.scale.baseSize,u=l.width,c=l.height;(e.canvas?(t.canvas=e.canvas,t.canvas.width=u,t.canvas.height=c):t.canvas=n.create(t,u,c,e.renderType),e.canvasStyle&&(t.canvas.style=e.canvasStyle),e.antialias||s.setCrisp(t.canvas),e.renderType!==r.HEADLESS)&&(a=i(91135),h=i(11857),e.renderType===r.WEBGL?t.renderer=new h(t):(t.renderer=new a(t),t.context=t.renderer.gameContext))}},77291:(t,e,i)=>{var s=i(86459);t.exports=function(t){var e=t.config;if(!e.hideBanner){var i="WebGL";e.renderType===s.CANVAS?i="Canvas":e.renderType===s.HEADLESS&&(i="Headless");var n,r=e.audio,o=t.device.audio;if(n=o.webAudio&&!r.disableWebAudio?"Web Audio":r.noAudio||!o.webAudio&&!o.audioData?"No Audio":"HTML5 Audio",t.device.browser.ie)window.console&&console.log("Phaser v"+s.VERSION+" / https://phaser.io");else{var a,h="",l=[h];if(Array.isArray(e.bannerBackgroundColor))e.bannerBackgroundColor.forEach((function(t){h=h.concat("%c "),l.push("background: "+t),a=t})),l[l.length-1]="color: "+e.bannerTextColor+"; background: "+a;else h=h.concat("%c "),l.push("color: "+e.bannerTextColor+"; background: "+e.bannerBackgroundColor);l.push("background: transparent"),e.gameTitle&&(h=h.concat(e.gameTitle),e.gameVersion&&(h=h.concat(" v"+e.gameVersion)),e.hidePhaser||(h=h.concat(" / ")));e.hidePhaser||(h=h.concat("Phaser v"+s.VERSION+" ("+i+" | "+n+")")),h=h.concat(" %c "+e.gameURL),l[0]=h,console.log.apply(console,l)}}}},15213:(t,e,i)=>{var s=i(99584),n=i(90249),r=i(43474),o=i(61068),a=i(56694),h=i(14033),l=i(85178),u=i(50150),c=i(81078),d=i(77291),p=i(77290),f=i(21546),v=i(6659),g=i(97081),m=i(69898),y=i(91963),x=i(49274),T=i(756),w=i(13553),b=i(38203),E=i(6237),S=i(26617),A=i(26493),_=i(84191),C=new a({initialize:function(t){this.config=new h(t),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new v,this.anims=new n(this),this.textures=new E(this),this.cache=new r(this),this.registry=new c(this),this.input=new m(this,this.config),this.scene=new w(this,this.config.sceneConfig),this.device=p,this.scale=new T(this,this.config),this.sound=null,this.sound=_.create(this),this.loop=new S(this,this.config.fps),this.plugins=new x(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,f(this.boot.bind(this))},boot:function(){y.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),u(this),l(this),d(this),s(this.canvas,this.config.parent),this.textures.once(b.READY,this.texturesReady,this),this.events.emit(g.BOOT)):console.warn("Aborting. Core Plugins missing.")},texturesReady:function(){this.events.emit(g.READY),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),A(this);var t=this.events;t.on(g.HIDDEN,this.onHidden,this),t.on(g.VISIBLE,this.onVisible,this),t.on(g.BLUR,this.onBlur,this),t.on(g.FOCUS,this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit(g.PRE_STEP,t,e),i.emit(g.STEP,t,e),this.scene.update(t,e),i.emit(g.POST_STEP,t,e);var s=this.renderer;s.preRender(),i.emit(g.PRE_RENDER,s,t,e),this.scene.render(s),s.postRender(),i.emit(g.POST_RENDER,s,t,e)},headlessStep:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit(g.PRE_STEP,t,e),i.emit(g.STEP,t,e),this.scene.update(t,e),i.emit(g.POST_STEP,t,e),i.emit(g.PRE_RENDER),i.emit(g.POST_RENDER)},onHidden:function(){this.loop.pause(),this.events.emit(g.PAUSE)},onVisible:function(){this.loop.resume(),this.events.emit(g.RESUME)},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},getFrame:function(){return this.loop.frame},getTime:function(){return this.loop.now},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.scene.destroy(),this.events.emit(g.DESTROY),this.events.removeAllListeners(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(o.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.domContainer&&this.domContainer.parentNode.removeChild(this.domContainer),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=C},26617:(t,e,i)=>{var s=i(56694),n=i(10850),r=i(72283),o=i(27385),a=new s({initialize:function(t,e){this.game=t,this.raf=new o,this.started=!1,this.running=!1,this.minFps=n(e,"min",5),this.targetFps=n(e,"target",60),this._min=1e3/this.minFps,this._target=1e3/this.targetFps,this.actualFps=this.targetFps,this.nextFpsUpdate=0,this.framesThisSecond=0,this.callback=r,this.forceSetTimeOut=n(e,"forceSetTimeOut",!1),this.time=0,this.startTime=0,this.lastTime=0,this.frame=0,this.inFocus=!0,this._pauseTime=0,this._coolDown=0,this.delta=0,this.deltaIndex=0,this.deltaHistory=[],this.deltaSmoothingMax=n(e,"deltaHistory",10),this.panicMax=n(e,"panicMax",120),this.rawDelta=0,this.now=0,this.smoothStep=n(e,"smoothStep",!0)},blur:function(){this.inFocus=!1},focus:function(){this.inFocus=!0,this.resetDelta()},pause:function(){this._pauseTime=window.performance.now()},resume:function(){this.resetDelta(),this.startTime+=this.time-this._pauseTime},resetDelta:function(){var t=window.performance.now();this.time=t,this.lastTime=t,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0;for(var e=0;e0||!this.inFocus)&&(this._coolDown--,r=Math.min(r,this._target)),r>this._min&&(r=s[i],r=Math.min(r,this._min)),s[i]=r,this.deltaIndex++,this.deltaIndex>n&&(this.deltaIndex=0),o=0;for(var a=0;athis.nextFpsUpdate&&(this.actualFps=.25*this.framesThisSecond+.75*this.actualFps,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0),this.framesThisSecond++;var h=o/this._target;this.callback(t,o,h),this.lastTime=t,this.frame++},tick:function(){this.step()},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){this.running||(t&&(this.startTime+=-this.lastTime+(this.lastTime+window.performance.now())),this.raf.start(this.step.bind(this),this.useRAF),this.running=!0,this.step())},getDuration:function(){return Math.round(this.lastTime-this.startTime)/1e3},getDurationMS:function(){return Math.round(this.lastTime-this.startTime)},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.callback=r,this.raf=null,this.game=null}});t.exports=a},26493:(t,e,i)=>{var s=i(97081);t.exports=function(t){var e,i=t.events;if(void 0!==document.hidden)e="visibilitychange";else{["webkit","moz","ms"].forEach((function(t){void 0!==document[t+"Hidden"]&&(document.hidden=function(){return document[t+"Hidden"]},e=t+"visibilitychange")}))}e&&document.addEventListener(e,(function(t){document.hidden||"pause"===t.type?i.emit(s.HIDDEN):i.emit(s.VISIBLE)}),!1),window.onblur=function(){i.emit(s.BLUR)},window.onfocus=function(){i.emit(s.FOCUS)},window.focus&&t.config.autoFocus&&window.focus()}},41651:t=>{t.exports="blur"},5520:t=>{t.exports="boot"},51673:t=>{t.exports="contextlost"},66336:t=>{t.exports="contextrestored"},25055:t=>{t.exports="destroy"},23767:t=>{t.exports="focus"},57564:t=>{t.exports="hidden"},38327:t=>{t.exports="pause"},43807:t=>{t.exports="postrender"},73652:t=>{t.exports="poststep"},780:t=>{t.exports="prerender"},13781:t=>{t.exports="prestep"},38247:t=>{t.exports="ready"},29129:t=>{t.exports="resume"},34994:t=>{t.exports="step"},98704:t=>{t.exports="visible"},97081:(t,e,i)=>{t.exports={BLUR:i(41651),BOOT:i(5520),CONTEXT_LOST:i(51673),CONTEXT_RESTORED:i(66336),DESTROY:i(25055),FOCUS:i(23767),HIDDEN:i(57564),PAUSE:i(38327),POST_RENDER:i(43807),POST_STEP:i(73652),PRE_RENDER:i(780),PRE_STEP:i(13781),READY:i(38247),RESUME:i(29129),STEP:i(34994),VISIBLE:i(98704)}},80293:(t,e,i)=>{t.exports={Config:i(14033),CreateRenderer:i(50150),DebugHeader:i(77291),Events:i(97081),TimeStep:i(26617),VisibilityHandler:i(26493)}},52780:(t,e,i)=>{var s=i(81543),n=i(61068),r=i(10850);t.exports=function(t){var e=r(t,"data",[]),i=r(t,"canvas",null),o=r(t,"palette",s),a=r(t,"pixelWidth",1),h=r(t,"pixelHeight",a),l=r(t,"resizeCanvas",!0),u=r(t,"clearCanvas",!0),c=r(t,"preRender",null),d=r(t,"postRender",null),p=Math.floor(Math.abs(e[0].length*a)),f=Math.floor(Math.abs(e.length*h));i||(i=n.create2D(this,p,f),l=!1,u=!1),l&&(i.width=p,i.height=f);var v=i.getContext("2d");u&&v.clearRect(0,0,p,f),c&&c(i,v);for(var g=0;g{t.exports={GenerateTexture:i(52780),Palettes:i(25235)}},81543:t=>{t.exports={0:"#000",1:"#9D9D9D",2:"#FFF",3:"#BE2633",4:"#E06F8B",5:"#493C2B",6:"#A46422",7:"#EB8931",8:"#F7E26B",9:"#2F484E",A:"#44891A",B:"#A3CE27",C:"#1B2632",D:"#005784",E:"#31A2F2",F:"#B2DCEF"}},75846:t=>{t.exports={0:"#000",1:"#fff",2:"#8b4131",3:"#7bbdc5",4:"#8b41ac",5:"#6aac41",6:"#3931a4",7:"#d5de73",8:"#945a20",9:"#5a4100",A:"#bd736a",B:"#525252",C:"#838383",D:"#acee8b",E:"#7b73de",F:"#acacac"}},83206:t=>{t.exports={0:"#000",1:"#2234d1",2:"#0c7e45",3:"#44aacc",4:"#8a3622",5:"#5c2e78",6:"#aa5c3d",7:"#b5b5b5",8:"#5e606e",9:"#4c81fb",A:"#6cd947",B:"#7be2f9",C:"#eb8a60",D:"#e23d69",E:"#ffd93f",F:"#fff"}},13194:t=>{t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#f5f4eb"}},50686:t=>{t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#fff"}},25235:(t,e,i)=>{t.exports={ARNE16:i(81543),C64:i(75846),CGA:i(83206),JMP:i(13194),MSX:i(50686)}},63120:(t,e,i)=>{var s=i(56694),n=i(34631),r=i(38517),o=i(93736),a=new s({Extends:r,initialize:function(t,e,i,s){r.call(this,"CubicBezierCurve"),Array.isArray(t)&&(s=new o(t[6],t[7]),i=new o(t[4],t[5]),e=new o(t[2],t[3]),t=new o(t[0],t[1])),this.p0=t,this.p1=e,this.p2=i,this.p3=s},getStartPoint:function(t){return void 0===t&&(t=new o),t.copy(this.p0)},getResolution:function(t){return t},getPoint:function(t,e){void 0===e&&(e=new o);var i=this.p0,s=this.p1,r=this.p2,a=this.p3;return e.set(n(t,i.x,s.x,r.x,a.x),n(t,i.y,s.y,r.y,a.y))},draw:function(t,e){void 0===e&&(e=32);var i=this.getPoints(e);t.beginPath(),t.moveTo(this.p0.x,this.p0.y);for(var s=1;s{var s=i(56694),n=i(80222),r=i(74118),o=i(93736),a=new s({initialize:function(t){this.type=t,this.defaultDivisions=5,this.arcLengthDivisions=100,this.cacheArcLengths=[],this.needsUpdate=!0,this.active=!0,this._tmpVec2A=new o,this._tmpVec2B=new o},draw:function(t,e){return void 0===e&&(e=32),t.strokePoints(this.getPoints(e))},getBounds:function(t,e){t||(t=new r),void 0===e&&(e=16);var i=this.getLength();e>i&&(e=i/2);var s=Math.max(1,Math.round(i/e));return n(this.getSpacedPoints(s),t)},getDistancePoints:function(t){var e=this.getLength(),i=Math.max(1,e/t);return this.getSpacedPoints(i)},getEndPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(1,t)},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],s=this.getPoint(0,this._tmpVec2A),n=0;i.push(0);for(var r=1;r<=t;r++)n+=(e=this.getPoint(r/t,this._tmpVec2B)).distance(s),i.push(n),s.copy(e);return this.cacheArcLengths=i,i},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var s=0;s<=t;s++)i.push(this.getPoint(s/t));return i},getRandomPoint:function(t){return void 0===t&&(t=new o),this.getPoint(Math.random(),t)},getSpacedPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var s=0;s<=t;s++){var n=this.getUtoTmapping(s/t,null,t);i.push(this.getPoint(n))}return i},getStartPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(0,t)},getTangent:function(t,e){void 0===e&&(e=new o);var i=1e-4,s=t-i,n=t+i;return s<0&&(s=0),n>1&&(n=1),this.getPoint(s,this._tmpVec2A),this.getPoint(n,e),e.subtract(this._tmpVec2A).normalize()},getTangentAt:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)},getTFromDistance:function(t,e){return t<=0?0:this.getUtoTmapping(0,t,e)},getUtoTmapping:function(t,e,i){var s,n=this.getLengths(i),r=0,o=n.length;s=e?Math.min(e,n[o-1]):t*n[o-1];for(var a,h=0,l=o-1;h<=l;)if((a=n[r=Math.floor(h+(l-h)/2)]-s)<0)h=r+1;else{if(!(a>0)){l=r;break}l=r-1}if(n[r=l]===s)return r/(o-1);var u=n[r];return(r+(s-u)/(n[r+1]-u))/(o-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});t.exports=a},48835:(t,e,i)=>{var s=i(56694),n=i(38517),r=i(75606),o=i(10850),a=i(23701),h=i(93736),l=new s({Extends:n,initialize:function(t,e,i,s,a,l,u,c){if("object"==typeof t){var d=t;t=o(d,"x",0),e=o(d,"y",0),i=o(d,"xRadius",0),s=o(d,"yRadius",i),a=o(d,"startAngle",0),l=o(d,"endAngle",360),u=o(d,"clockwise",!1),c=o(d,"rotation",0)}else void 0===s&&(s=i),void 0===a&&(a=0),void 0===l&&(l=360),void 0===u&&(u=!1),void 0===c&&(c=0);n.call(this,"EllipseCurve"),this.p0=new h(t,e),this._xRadius=i,this._yRadius=s,this._startAngle=r(a),this._endAngle=r(l),this._clockwise=u,this._rotation=r(c)},getStartPoint:function(t){return void 0===t&&(t=new h),this.getPoint(0,t)},getResolution:function(t){return 2*t},getPoint:function(t,e){void 0===e&&(e=new h);for(var i=2*Math.PI,s=this._endAngle-this._startAngle,n=Math.abs(s)i;)s-=i;s{var s=i(56694),n=i(38517),r=i(80222),o=i(74118),a=i(93736),h=new s({Extends:n,initialize:function(t,e){n.call(this,"LineCurve"),Array.isArray(t)&&(e=new a(t[2],t[3]),t=new a(t[0],t[1])),this.p0=t,this.p1=e,this.arcLengthDivisions=1},getBounds:function(t){return void 0===t&&(t=new o),r([this.p0,this.p1],t)},getStartPoint:function(t){return void 0===t&&(t=new a),t.copy(this.p0)},getResolution:function(t){return void 0===t&&(t=1),t},getPoint:function(t,e){return void 0===e&&(e=new a),1===t?e.copy(this.p1):(e.copy(this.p1).subtract(this.p0).scale(t).add(this.p0),e)},getPointAt:function(t,e){return this.getPoint(t,e)},getTangent:function(t,e){return void 0===e&&(e=new a),e.copy(this.p1).subtract(this.p0).normalize(),e},getUtoTmapping:function(t,e,i){var s;if(e){var n=this.getLengths(i),r=n[n.length-1];s=Math.min(e,r)/r}else s=t;return s},draw:function(t){return t.lineBetween(this.p0.x,this.p0.y,this.p1.x,this.p1.y),t},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y]}}});h.fromJSON=function(t){var e=t.points,i=new a(e[0],e[1]),s=new a(e[2],e[3]);return new h(i,s)},t.exports=h},64761:(t,e,i)=>{var s=i(56694),n=i(38517),r=i(16252),o=i(93736),a=new s({Extends:n,initialize:function(t,e,i){n.call(this,"QuadraticBezier"),Array.isArray(t)&&(i=new o(t[4],t[5]),e=new o(t[2],t[3]),t=new o(t[0],t[1])),this.p0=t,this.p1=e,this.p2=i},getStartPoint:function(t){return void 0===t&&(t=new o),t.copy(this.p0)},getResolution:function(t){return t},getPoint:function(t,e){void 0===e&&(e=new o);var i=this.p0,s=this.p1,n=this.p2;return e.set(r(t,i.x,s.x,n.x),r(t,i.y,s.y,n.y))},draw:function(t,e){void 0===e&&(e=32);var i=this.getPoints(e);t.beginPath(),t.moveTo(this.p0.x,this.p0.y);for(var s=1;s{var s=i(14976),n=i(56694),r=i(38517),o=i(93736),a=new n({Extends:r,initialize:function(t){void 0===t&&(t=[]),r.call(this,"SplineCurve"),this.points=[],this.addPoints(t)},addPoints:function(t){for(var e=0;ei.length-2?i.length-1:r+1],c=i[r>i.length-3?i.length-1:r+2];return e.set(s(a,h.x,l.x,u.x,c.x),s(a,h.y,l.y,u.y,c.y))},toJSON:function(){for(var t=[],e=0;e{t.exports={Path:i(12822),MoveTo:i(53639),CubicBezier:i(63120),Curve:i(38517),Ellipse:i(48835),Line:i(58084),QuadraticBezier:i(64761),Spline:i(11956)}},53639:(t,e,i)=>{var s=i(56694),n=i(93736),r=new s({initialize:function(t,e){this.active=!1,this.p0=new n(t,e)},getPoint:function(t,e){return void 0===e&&(e=new n),e.copy(this.p0)},getPointAt:function(t,e){return this.getPoint(t,e)},getResolution:function(){return 1},getLength:function(){return 0},toJSON:function(){return{type:"MoveTo",points:[this.p0.x,this.p0.y]}}});t.exports=r},12822:(t,e,i)=>{var s=i(56694),n=i(63120),r=i(48835),o=i(61286),a=i(58084),h=i(53639),l=i(64761),u=i(74118),c=i(11956),d=i(93736),p=i(83392),f=new s({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.name="",this.curves=[],this.cacheLengths=[],this.autoClose=!1,this.startPoint=new d,this._tmpVec2A=new d,this._tmpVec2B=new d,"object"==typeof t?this.fromJSON(t):this.startPoint.set(t,e)},add:function(t){return this.curves.push(t),this},circleTo:function(t,e,i){return void 0===e&&(e=!1),this.ellipseTo(t,t,0,360,e,i)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);return t.equals(e)||this.curves.push(new a(e,t)),this},cubicBezierTo:function(t,e,i,s,r,o){var a,h,l,u=this.getEndPoint();return t instanceof d?(a=t,h=e,l=i):(a=new d(i,s),h=new d(r,o),l=new d(t,e)),this.add(new n(u,a,h,l))},quadraticBezierTo:function(t,e,i,s){var n,r,o=this.getEndPoint();return t instanceof d?(n=t,r=e):(n=new d(i,s),r=new d(t,e)),this.add(new l(o,n,r))},draw:function(t,e){for(var i=0;i0?this.curves[this.curves.length-1].getPoint(1,t):t.copy(this.startPoint),t},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},getPoint:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),s=this.getCurveLengths(),n=0;n=i){var r=s[n]-i,o=this.curves[n],a=o.getLength(),h=0===a?0:1-r/a;return o.getPointAt(h,e)}n++}return null},getPoints:function(t){void 0===t&&(t=12);for(var e,i=[],s=0;s1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i},getRandomPoint:function(t){return void 0===t&&(t=new d),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getStartPoint:function(t){return void 0===t&&(t=new d),t.copy(this.startPoint)},getTangent:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),s=this.getCurveLengths(),n=0;n=i){var r=s[n]-i,o=this.curves[n],a=o.getLength(),h=0===a?0:1-r/a;return o.getTangentAt(h,e)}n++}return null},lineTo:function(t,e){t instanceof d?this._tmpVec2B.copy(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new a([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new c(t))},moveTo:function(t,e){return t instanceof d?this.add(new h(t.x,t.y)):this.add(new h(t,e))},toJSON:function(){for(var t=[],e=0;e{var s=i(56694),n=i(35026),r=new s({initialize:function(t,e){this.parent=t,this.events=e,e||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once(n.DESTROY,this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],s=0;s{var s=i(56694),n=i(81078),r=i(91963),o=i(7599),a=new s({Extends:n,initialize:function(t){n.call(this,t,t.sys.events),this.scene=t,this.systems=t.sys,t.sys.events.once(o.BOOT,this.boot,this),t.sys.events.on(o.START,this.start,this)},boot:function(){this.events=this.systems.events,this.events.once(o.DESTROY,this.destroy,this)},start:function(){this.events.once(o.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.systems.events.off(o.SHUTDOWN,this.shutdown,this)},destroy:function(){n.prototype.destroy.call(this),this.events.off(o.START,this.start,this),this.scene=null,this.systems=null}});r.register("DataManagerPlugin",a,"data"),t.exports=a},73569:t=>{t.exports="changedata"},15590:t=>{t.exports="changedata-"},37669:t=>{t.exports="destroy"},87090:t=>{t.exports="removedata"},90142:t=>{t.exports="setdata"},35026:(t,e,i)=>{t.exports={CHANGE_DATA:i(73569),CHANGE_DATA_KEY:i(15590),DESTROY:i(37669),REMOVE_DATA:i(87090),SET_DATA:i(90142)}},1999:(t,e,i)=>{t.exports={DataManager:i(81078),DataManagerPlugin:i(76508),Events:i(35026)}},10720:(t,e,i)=>{var s=i(1350),n={audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return n;n.audioData=!!window.Audio,n.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio"),e=!!t.canPlayType;try{if(e&&(t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,"")&&(n.ogg=!0),(t.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,"")||t.canPlayType("audio/opus;").replace(/^no$/,""))&&(n.opus=!0),t.canPlayType("audio/mpeg;").replace(/^no$/,"")&&(n.mp3=!0),t.canPlayType("audio/wav").replace(/^no$/,"")&&(n.wav=!0),(t.canPlayType("audio/x-m4a;")||t.canPlayType("audio/aac;").replace(/^no$/,""))&&(n.m4a=!0),t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")&&(n.webm=!0),""!==t.canPlayType('audio/mp4;codecs="ec-3"')))if(s.edge)n.dolby=!0;else if(s.safari&&s.safariVersion>=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var i=parseInt(RegExp.$1,10),r=parseInt(RegExp.$2,10);(10===i&&r>=11||i>10)&&(n.dolby=!0)}}catch(t){}return n}()},1350:(t,e,i)=>{var s,n=i(36580),r={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0};t.exports=(s=navigator.userAgent,/Edge\/\d+/.test(s)?r.edge=!0:/Chrome\/(\d+)/.test(s)&&!n.windowsPhone?(r.chrome=!0,r.chromeVersion=parseInt(RegExp.$1,10)):/Firefox\D+(\d+)/.test(s)?(r.firefox=!0,r.firefoxVersion=parseInt(RegExp.$1,10)):/AppleWebKit/.test(s)&&n.iOS?r.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(s)?(r.ie=!0,r.ieVersion=parseInt(RegExp.$1,10)):/Opera/.test(s)?r.opera=!0:/Safari/.test(s)&&!n.windowsPhone?r.safari=!0:/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(s)&&(r.ie=!0,r.trident=!0,r.tridentVersion=parseInt(RegExp.$1,10),r.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(s)&&(r.silk=!0),r)},98581:(t,e,i)=>{var s,n,r,o=i(61068),a={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=("function"!=typeof importScripts&&void 0!==document&&(a.supportNewBlendModes=(s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",n="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(r=new Image).onload=function(){var t=new Image;t.onload=function(){var e=o.create(t,6,1).getContext("2d");if(e.globalCompositeOperation="multiply",e.drawImage(r,0,0),e.drawImage(t,2,0),!e.getImageData(2,0,1,1))return!1;var i=e.getImageData(2,0,1,1).data;o.remove(t),a.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=s+"/wCKxvRF"+n},r.src=s+"AP804Oa6"+n,!1),a.supportInverseAlpha=function(){var t=o.create(this,2,1).getContext("2d");t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1);return i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3]}()),a)},90185:(t,e,i)=>{var s=i(36580),n=i(1350),r=i(61068),o={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){if("function"==typeof importScripts)return o;o.canvas=!!window.CanvasRenderingContext2D;try{o.localStorage=!!localStorage.getItem}catch(t){o.localStorage=!1}o.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),o.fileSystem=!!window.requestFileSystem;var t,e,i,a=!1;return o.webGL=function(){if(window.WebGLRenderingContext)try{var t=r.createWebGL(this),e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=r.create2D(this),s=i.getContext("2d").createImageData(1,1);return a=s.data instanceof Uint8ClampedArray,r.remove(t),r.remove(i),!!e}catch(t){return!1}return!1}(),o.worker=!!window.Worker,o.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,o.getUserMedia=o.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,n.firefox&&n.firefoxVersion<21&&(o.getUserMedia=!1),!s.iOS&&(n.ie||n.firefox||n.chrome)&&(o.canvasBitBltShift=!0),(n.safari||n.mobileSafari)&&(o.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(o.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(o.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),o.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==o.littleEndian&&a,o}()},33553:t=>{var e={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){if("function"==typeof importScripts)return e;var t,i="Fullscreen",s="FullScreen",n=["request"+i,"request"+s,"webkitRequest"+i,"webkitRequest"+s,"msRequest"+i,"msRequest"+s,"mozRequest"+s,"mozRequest"+i];for(t=0;t{var s=i(1350),n={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=("function"==typeof importScripts||(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(n.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(n.mspointer=!0),navigator.getGamepads&&(n.gamepads=!0),"onwheel"in window||s.ie&&"WheelEvent"in window?n.wheelEvent="wheel":"onmousewheel"in window?n.wheelEvent="mousewheel":s.firefox&&"MouseScrollEvent"in window&&(n.wheelEvent="DOMMouseScroll")),n)},36580:t=>{var e={android:!1,chromeOS:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};t.exports=function(){if("function"==typeof importScripts)return e;var t=navigator.userAgent;/Windows/.test(t)?e.windows=!0:/Mac OS/.test(t)&&!/like Mac OS/.test(t)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(e.iOS=!0,e.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),e.iOSVersion=parseInt(RegExp.$1,10)):e.macOS=!0:/Android/.test(t)?e.android=!0:/Linux/.test(t)?e.linux=!0:/iP[ao]d|iPhone/i.test(t)?(e.iOS=!0,navigator.appVersion.match(/OS (\d+)/),e.iOSVersion=parseInt(RegExp.$1,10),e.iPhone=-1!==t.toLowerCase().indexOf("iphone"),e.iPad=-1!==t.toLowerCase().indexOf("ipad")):/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?e.kindle=!0:/CrOS/.test(t)&&(e.chromeOS=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(e.android=!1,e.iOS=!1,e.macOS=!1,e.windows=!0,e.windowsPhone=!0);var i=/Silk/.test(t);return(e.windows||e.macOS||e.linux&&!i||e.chromeOS)&&(e.desktop=!0),(e.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(e.desktop=!1),navigator.standalone&&(e.webApp=!0),"function"!=typeof importScripts&&(void 0!==window.cordova&&(e.cordova=!0),void 0!==window.ejecta&&(e.ejecta=!0)),"undefined"!=typeof process&&process.versions&&process.versions.node&&(e.node=!0),e.node&&"object"==typeof process.versions&&(e.nodeWebkit=!!process.versions["node-webkit"],e.electron=!!process.versions.electron),/Crosswalk/.test(t)&&(e.crosswalk=!0),e.pixelRatio=window.devicePixelRatio||1,e}()},53861:t=>{var e={h264:!1,hls:!1,mp4:!1,ogg:!1,vp9:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return e;var t=document.createElement("video"),i=!!t.canPlayType;try{i&&(t.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,"")&&(e.ogg=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,"")&&(e.h264=!0,e.mp4=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")&&(e.webm=!0),t.canPlayType('video/webm; codecs="vp9"').replace(/^no$/,"")&&(e.vp9=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/,"")&&(e.hls=!0))}catch(t){}return e}()},77290:(t,e,i)=>{t.exports={os:i(36580),browser:i(1350),features:i(90185),input:i(95872),audio:i(10720),video:i(53861),fullscreen:i(33553),canvasFeatures:i(98581)}},65246:(t,e,i)=>{var s=new(i(56694))({initialize:function(){this._matrix=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],this.alpha=1,this._dirty=!0,this._data},set:function(t){return this._matrix=t,this._dirty=!0,this},reset:function(){var t=this._matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=1,t[13]=0,t[14]=0,t[15]=0,t[16]=0,t[17]=0,t[18]=1,t[19]=0,this._dirty=!0,this},getData:function(){if(this._dirty){var t=new Float32Array(this._matrix);t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,this._data=t,this._dirty=!1}return this._data},brightness:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t;return this.multiply([i,0,0,0,0,0,i,0,0,0,0,0,i,0,0,0,0,0,1,0],e)},saturate:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=2*t/3+1,s=-.5*(i-1);return this.multiply([i,s,s,0,0,s,i,s,0,0,s,s,i,0,0,0,0,0,1,0],e)},desaturate:function(t){return void 0===t&&(t=!1),this.saturate(-1,t)},hue:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1),t=t/180*Math.PI;var i=Math.cos(t),s=Math.sin(t),n=.213,r=.715,o=.072;return this.multiply([n+.787*i+s*-n,r+i*-r+s*-r,o+i*-o+.928*s,0,0,n+i*-n+.143*s,r+i*(1-r)+.14*s,o+i*-o+-.283*s,0,0,n+i*-n+-.787*s,r+i*-r+s*r,o+.928*i+s*o,0,0,0,0,0,1,0],e)},grayscale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=!1),this.saturate(-t,e)},blackWhite:function(t){return void 0===t&&(t=!1),this.multiply([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},contrast:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t+1,s=-.5*(i-1);return this.multiply([i,0,0,0,s,0,i,0,0,s,0,0,i,0,s,0,0,0,1,0],e)},negative:function(t){return void 0===t&&(t=!1),this.multiply([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},desaturateLuminance:function(t){return void 0===t&&(t=!1),this.multiply([.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0],t)},sepia:function(t){return void 0===t&&(t=!1),this.multiply([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},night:function(t,e){return void 0===t&&(t=.1),void 0===e&&(e=!1),this.multiply([-2*t,-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0],e)},lsd:function(t){return void 0===t&&(t=!1),this.multiply([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},brown:function(t){return void 0===t&&(t=!1),this.multiply([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},vintagePinhole:function(t){return void 0===t&&(t=!1),this.multiply([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},kodachrome:function(t){return void 0===t&&(t=!1),this.multiply([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],t)},technicolor:function(t){return void 0===t&&(t=!1),this.multiply([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],t)},polaroid:function(t){return void 0===t&&(t=!1),this.multiply([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},shiftToBGR:function(t){return void 0===t&&(t=!1),this.multiply([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},multiply:function(t,e){e||this.reset();for(var i=this._matrix,s=[],n=0;n<20;n++)s[n]=i[n];return i[0]=s[0]*t[0]+s[1]*t[5]+s[2]*t[10]+s[3]*t[15],i[1]=s[0]*t[1]+s[1]*t[6]+s[2]*t[11]+s[3]*t[16],i[2]=s[0]*t[2]+s[1]*t[7]+s[2]*t[12]+s[3]*t[17],i[3]=s[0]*t[3]+s[1]*t[8]+s[2]*t[13]+s[3]*t[18],i[4]=s[0]*t[4]+s[1]*t[9]+s[2]*t[14]+s[3]*t[19]+s[4],i[5]=s[5]*t[0]+s[6]*t[5]+s[7]*t[10]+s[8]*t[15],i[6]=s[5]*t[1]+s[6]*t[6]+s[7]*t[11]+s[8]*t[16],i[7]=s[5]*t[2]+s[6]*t[7]+s[7]*t[12]+s[8]*t[17],i[8]=s[5]*t[3]+s[6]*t[8]+s[7]*t[13]+s[8]*t[18],i[9]=s[5]*t[4]+s[6]*t[9]+s[7]*t[14]+s[8]*t[19]+s[9],i[10]=s[10]*t[0]+s[11]*t[5]+s[12]*t[10]+s[13]*t[15],i[11]=s[10]*t[1]+s[11]*t[6]+s[12]*t[11]+s[13]*t[16],i[12]=s[10]*t[2]+s[11]*t[7]+s[12]*t[12]+s[13]*t[17],i[13]=s[10]*t[3]+s[11]*t[8]+s[12]*t[13]+s[13]*t[18],i[14]=s[10]*t[4]+s[11]*t[9]+s[12]*t[14]+s[13]*t[19]+s[14],i[15]=s[15]*t[0]+s[16]*t[5]+s[17]*t[10]+s[18]*t[15],i[16]=s[15]*t[1]+s[16]*t[6]+s[17]*t[11]+s[18]*t[16],i[17]=s[15]*t[2]+s[16]*t[7]+s[17]*t[12]+s[18]*t[17],i[18]=s[15]*t[3]+s[16]*t[8]+s[17]*t[13]+s[18]*t[18],i[19]=s[15]*t[4]+s[16]*t[9]+s[17]*t[14]+s[18]*t[19]+s[19],this._dirty=!0,this}});t.exports=s},39298:(t,e,i)=>{var s=i(56694),n=i(72283),r=new s({initialize:function(t,e,i){this._rgb=[0,0,0],this.onChangeCallback=n,this.dirty=!1,this.set(t,e,i)},set:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this._rgb=[t,e,i],this.onChange(),this},equals:function(t,e,i){var s=this._rgb;return s.r===t&&s.g===e&&s.b===i},onChange:function(){this.dirty=!0;var t=this._rgb;this.onChangeCallback.call(this,t[0],t[1],t[2])},r:{get:function(){return this._rgb[0]},set:function(t){this._rgb[0]=t,this.onChange()}},g:{get:function(){return this._rgb[1]},set:function(t){this._rgb[1]=t,this.onChange()}},b:{get:function(){return this._rgb[2]},set:function(t){this._rgb[2]=t,this.onChange()}},destroy:function(){this.onChangeCallback=null}});t.exports=r},84093:t=>{t.exports={TOP_LEFT:0,TOP_CENTER:1,TOP_RIGHT:2,LEFT_TOP:3,LEFT_CENTER:4,LEFT_BOTTOM:5,CENTER:6,RIGHT_TOP:7,RIGHT_CENTER:8,RIGHT_BOTTOM:9,BOTTOM_LEFT:10,BOTTOM_CENTER:11,BOTTOM_RIGHT:12}},32058:(t,e,i)=>{var s=i(97328),n=i(59994),r=i(73174),o=i(28417);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)+a),t}},85535:(t,e,i)=>{var s=i(97328),n=i(40163),r=i(73174),o=i(74465);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)-i),r(t,s(e)+a),t}},9605:(t,e,i)=>{var s=i(97328),n=i(70271),r=i(73174),o=i(19298);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)+a),t}},22529:(t,e,i)=>{var s=i(21843),n=i(59994),r=i(29568);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),s(t,n(e)+i,r(e)+o),t}},5739:(t,e,i)=>{var s=i(29568),n=i(40163),r=i(81711),o=i(74465);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)-i),r(t,s(e)+a),t}},40327:(t,e,i)=>{var s=i(84093),n=[];n[s.BOTTOM_CENTER]=i(32058),n[s.BOTTOM_LEFT]=i(85535),n[s.BOTTOM_RIGHT]=i(9605),n[s.CENTER]=i(22529),n[s.LEFT_CENTER]=i(5739),n[s.RIGHT_CENTER]=i(27683),n[s.TOP_CENTER]=i(96439),n[s.TOP_LEFT]=i(81447),n[s.TOP_RIGHT]=i(47888),n[s.LEFT_BOTTOM]=n[s.BOTTOM_LEFT],n[s.LEFT_TOP]=n[s.TOP_LEFT],n[s.RIGHT_BOTTOM]=n[s.BOTTOM_RIGHT],n[s.RIGHT_TOP]=n[s.TOP_RIGHT];t.exports=function(t,e,i,s,r){return n[i](t,e,s,r)}},27683:(t,e,i)=>{var s=i(29568),n=i(70271),r=i(81711),o=i(19298);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)+a),t}},96439:(t,e,i)=>{var s=i(59994),n=i(47196),r=i(28417),o=i(84349);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)+i),o(t,n(e)-a),t}},81447:(t,e,i)=>{var s=i(40163),n=i(47196),r=i(74465),o=i(84349);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)-i),o(t,n(e)-a),t}},47888:(t,e,i)=>{var s=i(70271),n=i(47196),r=i(19298),o=i(84349);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)+i),o(t,n(e)-a),t}},46997:(t,e,i)=>{t.exports={BottomCenter:i(32058),BottomLeft:i(85535),BottomRight:i(9605),Center:i(22529),LeftCenter:i(5739),QuickSet:i(40327),RightCenter:i(27683),TopCenter:i(96439),TopLeft:i(81447),TopRight:i(47888)}},93545:(t,e,i)=>{var s=i(84093),n=i(98611),r={In:i(46997),To:i(86639)};r=n(!1,r,s),t.exports=r},27118:(t,e,i)=>{var s=i(97328),n=i(59994),r=i(28417),o=i(84349);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)+a),t}},84469:(t,e,i)=>{var s=i(97328),n=i(40163),r=i(74465),o=i(84349);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)-i),o(t,s(e)+a),t}},51577:(t,e,i)=>{var s=i(97328),n=i(70271),r=i(19298),o=i(84349);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)+a),t}},90271:(t,e,i)=>{var s=i(97328),n=i(40163),r=i(73174),o=i(19298);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)-i),r(t,s(e)+a),t}},30466:(t,e,i)=>{var s=i(29568),n=i(40163),r=i(81711),o=i(19298);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)-i),r(t,s(e)+a),t}},50087:(t,e,i)=>{var s=i(40163),n=i(47196),r=i(19298),o=i(84349);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)-i),o(t,n(e)-a),t}},82590:(t,e,i)=>{var s=i(84093),n=[];n[s.BOTTOM_CENTER]=i(27118),n[s.BOTTOM_LEFT]=i(84469),n[s.BOTTOM_RIGHT]=i(51577),n[s.LEFT_BOTTOM]=i(90271),n[s.LEFT_CENTER]=i(30466),n[s.LEFT_TOP]=i(50087),n[s.RIGHT_BOTTOM]=i(13555),n[s.RIGHT_CENTER]=i(99049),n[s.RIGHT_TOP]=i(67788),n[s.TOP_CENTER]=i(78170),n[s.TOP_LEFT]=i(54145),n[s.TOP_RIGHT]=i(75548);t.exports=function(t,e,i,s,r){return n[i](t,e,s,r)}},13555:(t,e,i)=>{var s=i(97328),n=i(70271),r=i(73174),o=i(74465);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)+a),t}},99049:(t,e,i)=>{var s=i(29568),n=i(70271),r=i(81711),o=i(74465);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)+a),t}},67788:(t,e,i)=>{var s=i(70271),n=i(47196),r=i(74465),o=i(84349);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)+i),o(t,n(e)-a),t}},78170:(t,e,i)=>{var s=i(59994),n=i(47196),r=i(73174),o=i(28417);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)-a),t}},54145:(t,e,i)=>{var s=i(40163),n=i(47196),r=i(73174),o=i(74465);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)-a),t}},75548:(t,e,i)=>{var s=i(70271),n=i(47196),r=i(73174),o=i(19298);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)-a),t}},86639:(t,e,i)=>{t.exports={BottomCenter:i(27118),BottomLeft:i(84469),BottomRight:i(51577),LeftBottom:i(90271),LeftCenter:i(30466),LeftTop:i(50087),QuickSet:i(82590),RightBottom:i(13555),RightCenter:i(99049),RightTop:i(67788),TopCenter:i(78170),TopLeft:i(54145),TopRight:i(75548)}},21843:(t,e,i)=>{var s=i(28417),n=i(81711);t.exports=function(t,e,i){return s(t,e),n(t,i)}},97328:t=>{t.exports=function(t){return t.y+t.height-t.height*t.originY}},7126:(t,e,i)=>{var s=i(97328),n=i(40163),r=i(70271),o=i(47196);t.exports=function(t,e){void 0===e&&(e={});var i=n(t),a=o(t);return e.x=i,e.y=a,e.width=r(t)-i,e.height=s(t)-a,e}},59994:t=>{t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},29568:t=>{t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},40163:t=>{t.exports=function(t){return t.x-t.width*t.originX}},52088:t=>{t.exports=function(t){return t.width*t.originX}},23379:t=>{t.exports=function(t){return t.height*t.originY}},70271:t=>{t.exports=function(t){return t.x+t.width-t.width*t.originX}},47196:t=>{t.exports=function(t){return t.y-t.height*t.originY}},73174:t=>{t.exports=function(t,e){return t.y=e-t.height+t.height*t.originY,t}},28417:t=>{t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},81711:t=>{t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},74465:t=>{t.exports=function(t,e){return t.x=e+t.width*t.originX,t}},19298:t=>{t.exports=function(t,e){return t.x=e-t.width+t.width*t.originX,t}},84349:t=>{t.exports=function(t,e){return t.y=e+t.height*t.originY,t}},15252:(t,e,i)=>{t.exports={CenterOn:i(21843),GetBottom:i(97328),GetBounds:i(7126),GetCenterX:i(59994),GetCenterY:i(29568),GetLeft:i(40163),GetOffsetX:i(52088),GetOffsetY:i(23379),GetRight:i(70271),GetTop:i(47196),SetBottom:i(73174),SetCenterX:i(28417),SetCenterY:i(81711),SetLeft:i(74465),SetRight:i(19298),SetTop:i(84349)}},70616:t=>{t.exports={setCrisp:function(t){return["optimizeSpeed","-moz-crisp-edges","-o-crisp-edges","-webkit-optimize-contrast","optimize-contrast","crisp-edges","pixelated"].forEach((function(e){t.style["image-rendering"]=e})),t.style.msInterpolationMode="nearest-neighbor",t},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},61068:(t,e,i)=>{var s,n,r,o=i(86459),a=i(8213),h=[],l=!1;t.exports=(r=function(){var t=0;return h.forEach((function(e){e.parent&&t++})),t},{create2D:function(t,e,i){return s(t,e,i,o.CANVAS)},create:s=function(t,e,i,s,r){var u;void 0===e&&(e=1),void 0===i&&(i=1),void 0===s&&(s=o.CANVAS),void 0===r&&(r=!1);var c=n(s);return null===c?(c={parent:t,canvas:document.createElement("canvas"),type:s},s===o.CANVAS&&h.push(c),u=c.canvas):(c.parent=t,u=c.canvas),r&&(c.parent=u),u.width=e,u.height=i,l&&s===o.CANVAS&&a.disable(u.getContext("2d")),u},createWebGL:function(t,e,i){return s(t,e,i,o.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:n=function(t){if(void 0===t&&(t=o.CANVAS),t===o.WEBGL)return null;for(var e=0;e{var e,i="";t.exports={disable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!1),t},enable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!0),t},getPrefix:e=function(t){for(var e=["i","webkitI","msI","mozI","oI"],i=0;i{t.exports=function(t,e){return void 0===e&&(e="none"),t.style.msTouchAction=e,t.style["ms-touch-action"]=e,t.style["touch-action"]=e,t}},36505:t=>{t.exports=function(t,e){void 0===e&&(e="none");return["-webkit-","-khtml-","-moz-","-ms-",""].forEach((function(i){t.style[i+"user-select"]=e})),t.style["-webkit-touch-callout"]=e,t.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",t}},23514:(t,e,i)=>{t.exports={CanvasInterpolation:i(70616),CanvasPool:i(61068),Smoothing:i(8213),TouchAction:i(59271),UserSelect:i(36505)}},27119:(t,e,i)=>{var s=i(56694),n=i(22946),r=i(5657),o=i(24650),a=i(68033),h=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=255),this.r=0,this.g=0,this.b=0,this.a=255,this._h=0,this._s=0,this._v=0,this._locked=!1,this.gl=[0,0,0,1],this._color=0,this._color32=0,this._rgba="",this.setTo(t,e,i,s)},transparent:function(){return this._locked=!0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this._locked=!1,this.update(!0)},setTo:function(t,e,i,s,n){return void 0===s&&(s=255),void 0===n&&(n=!0),this._locked=!0,this.red=t,this.green=e,this.blue=i,this.alpha=s,this._locked=!1,this.update(n)},setGLTo:function(t,e,i,s){return void 0===s&&(s=1),this._locked=!0,this.redGL=t,this.greenGL=e,this.blueGL=i,this.alphaGL=s,this._locked=!1,this.update(!0)},setFromRGB:function(t){return this._locked=!0,this.red=t.r,this.green=t.g,this.blue=t.b,t.hasOwnProperty("a")&&(this.alpha=t.a),this._locked=!1,this.update(!0)},setFromHSV:function(t,e,i){return o(t,e,i,this)},update:function(t){if(void 0===t&&(t=!1),this._locked)return this;var e=this.r,i=this.g,s=this.b,o=this.a;return this._color=n(e,i,s),this._color32=r(e,i,s,o),this._rgba="rgba("+e+","+i+","+s+","+o/255+")",t&&a(e,i,s,this),this},updateHSV:function(){var t=this.r,e=this.g,i=this.b;return a(t,e,i,this),this},clone:function(){return new h(this.r,this.g,this.b,this.a)},gray:function(t){return this.setTo(t,t,t)},random:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t)),s=Math.floor(t+Math.random()*(e-t)),n=Math.floor(t+Math.random()*(e-t));return this.setTo(i,s,n)},randomGray:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t));return this.setTo(i,i,i)},saturate:function(t){return this.s+=t/100,this},desaturate:function(t){return this.s-=t/100,this},lighten:function(t){return this.v+=t/100,this},darken:function(t){return this.v-=t/100,this},brighten:function(t){var e=this.r,i=this.g,s=this.b;return e=Math.max(0,Math.min(255,e-Math.round(-t/100*255))),i=Math.max(0,Math.min(255,i-Math.round(-t/100*255))),s=Math.max(0,Math.min(255,s-Math.round(-t/100*255))),this.setTo(e,i,s)},color:{get:function(){return this._color}},color32:{get:function(){return this._color32}},rgba:{get:function(){return this._rgba}},redGL:{get:function(){return this.gl[0]},set:function(t){this.gl[0]=Math.min(Math.abs(t),1),this.r=Math.floor(255*this.gl[0]),this.update(!0)}},greenGL:{get:function(){return this.gl[1]},set:function(t){this.gl[1]=Math.min(Math.abs(t),1),this.g=Math.floor(255*this.gl[1]),this.update(!0)}},blueGL:{get:function(){return this.gl[2]},set:function(t){this.gl[2]=Math.min(Math.abs(t),1),this.b=Math.floor(255*this.gl[2]),this.update(!0)}},alphaGL:{get:function(){return this.gl[3]},set:function(t){this.gl[3]=Math.min(Math.abs(t),1),this.a=Math.floor(255*this.gl[3]),this.update()}},red:{get:function(){return this.r},set:function(t){t=Math.floor(Math.abs(t)),this.r=Math.min(t,255),this.gl[0]=t/255,this.update(!0)}},green:{get:function(){return this.g},set:function(t){t=Math.floor(Math.abs(t)),this.g=Math.min(t,255),this.gl[1]=t/255,this.update(!0)}},blue:{get:function(){return this.b},set:function(t){t=Math.floor(Math.abs(t)),this.b=Math.min(t,255),this.gl[2]=t/255,this.update(!0)}},alpha:{get:function(){return this.a},set:function(t){t=Math.floor(Math.abs(t)),this.a=Math.min(t,255),this.gl[3]=t/255,this.update()}},h:{get:function(){return this._h},set:function(t){this._h=t,o(t,this._s,this._v,this)}},s:{get:function(){return this._s},set:function(t){this._s=t,o(this._h,t,this._v,this)}},v:{get:function(){return this._v},set:function(t){this._v=t,o(this._h,this._s,t,this)}}});t.exports=h},30245:(t,e,i)=>{var s=i(22946);t.exports=function(t){void 0===t&&(t=1024);var e,i=[],n=255,r=255,o=0,a=0;for(e=0;e<=n;e++)i.push({r:r,g:e,b:a,color:s(r,e,a)});for(o=255,e=n;e>=0;e--)i.push({r:e,g:o,b:a,color:s(e,o,a)});for(r=0,e=0;e<=n;e++,o--)i.push({r:r,g:o,b:e,color:s(r,o,e)});for(o=0,a=255,e=0;e<=n;e++,a--,r++)i.push({r:r,g:o,b:a,color:s(r,o,a)});if(1024===t)return i;var h=[],l=0,u=1024/t;for(e=0;e{t.exports=function(t){var e={r:t>>16&255,g:t>>8&255,b:255&t,a:255};return t>16777215&&(e.a=t>>>24),e}},25409:t=>{t.exports=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e}},22946:t=>{t.exports=function(t,e,i){return t<<16|e<<8|i}},5657:t=>{t.exports=function(t,e,i,s){return s<<24|t<<16|e<<8|i}},74777:(t,e,i)=>{var s=i(27119),n=i(59998);t.exports=function(t,e,i){var r=i,o=i,a=i;if(0!==e){var h=i<.5?i*(1+e):i+e-i*e,l=2*i-h;r=n(l,h,t+1/3),o=n(l,h,t),a=n(l,h,t-1/3)}return(new s).setGLTo(r,o,a,1)}},89263:(t,e,i)=>{var s=i(24650);t.exports=function(t,e){void 0===t&&(t=1),void 0===e&&(e=1);for(var i=[],n=0;n<=359;n++)i.push(s(n/359,t,e));return i}},24650:(t,e,i)=>{var s=i(22946);function n(t,e,i,s){var n=(t+6*e)%6,r=Math.min(n,4-n,1);return Math.round(255*(s-s*i*Math.max(0,r)))}t.exports=function(t,e,i,r){void 0===e&&(e=1),void 0===i&&(i=1);var o=n(5,t,e,i),a=n(3,t,e,i),h=n(1,t,e,i);return r?r.setTo?r.setTo(o,a,h,r.alpha,!1):(r.r=o,r.g=a,r.b=h,r.color=s(o,a,h),r):{r:o,g:a,b:h,color:s(o,a,h)}}},91487:(t,e,i)=>{var s=i(27119);t.exports=function(t){var e=new s;t=t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,i,s){return e+e+i+i+s+s}));var i=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(i){var n=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16);e.setTo(n,r,o)}return e}},59998:t=>{t.exports=function(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}},74853:(t,e,i)=>{var s=i(27119),n=i(15978);t.exports=function(t){var e=n(t);return new s(e.r,e.g,e.b,e.a)}},15978:t=>{t.exports=function(t){return t>16777215?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},53756:(t,e,i)=>{var s=i(42798),n=function(t,e,i,n,r,o,a,h){void 0===a&&(a=100),void 0===h&&(h=0);var l=h/a;return{r:s(t,n,l),g:s(e,r,l),b:s(i,o,l)}};t.exports={RGBWithRGB:n,ColorWithRGB:function(t,e,i,s,r,o){return void 0===r&&(r=100),void 0===o&&(o=0),n(t.r,t.g,t.b,e,i,s,r,o)},ColorWithColor:function(t,e,i,s){return void 0===i&&(i=100),void 0===s&&(s=0),n(t.r,t.g,t.b,e.r,e.g,e.b,i,s)}}},73904:(t,e,i)=>{var s=i(27119);t.exports=function(t){return new s(t.r,t.g,t.b,t.a)}},26841:(t,e,i)=>{var s=i(27119);t.exports=function(t){var e=new s,i=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(t.toLowerCase());if(i){var n=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10),a=void 0!==i[4]?parseFloat(i[4]):1;e.setTo(n,r,o,255*a)}return e}},68033:t=>{t.exports=function(t,e,i,s){void 0===s&&(s={h:0,s:0,v:0}),t/=255,e/=255,i/=255;var n=Math.min(t,e,i),r=Math.max(t,e,i),o=r-n,a=0,h=0===r?0:o/r,l=r;return r!==n&&(r===t?a=(e-i)/o+(e{var s=i(25409);t.exports=function(t,e,i,n,r){return void 0===n&&(n=255),void 0===r&&(r="#"),"#"===r?"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1,7):"0x"+s(n)+s(t)+s(e)+s(i)}},37243:(t,e,i)=>{var s=i(17489),n=i(27119);t.exports=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=255),new n(s(t,e),s(t,e),s(t,e))}},93222:(t,e,i)=>{var s=i(91487),n=i(74853),r=i(73904),o=i(26841);t.exports=function(t){switch(typeof t){case"string":return"rgb"===t.substr(0,3).toLowerCase()?o(t):s(t);case"number":return n(t);case"object":return r(t)}}},95509:(t,e,i)=>{var s=i(27119);s.ColorSpectrum=i(30245),s.ColorToRGBA=i(86672),s.ComponentToHex=i(25409),s.GetColor=i(22946),s.GetColor32=i(5657),s.HexStringToColor=i(91487),s.HSLToColor=i(74777),s.HSVColorWheel=i(89263),s.HSVToRGB=i(24650),s.HueToComponent=i(59998),s.IntegerToColor=i(74853),s.IntegerToRGB=i(15978),s.Interpolate=i(53756),s.ObjectToColor=i(73904),s.RandomRGB=i(37243),s.RGBStringToColor=i(26841),s.RGBToHSV=i(68033),s.RGBToString=i(4880),s.ValueToColor=i(93222),t.exports=s},24816:(t,e,i)=>{t.exports={Align:i(93545),BaseShader:i(31053),Bounds:i(15252),Canvas:i(23514),Color:i(95509),ColorMatrix:i(65246),Masks:i(93310),RGB:i(39298)}},76756:(t,e,i)=>{var s=i(56694),n=i(97081),r=i(81044),o=new s({initialize:function(t,e){var i=t.sys.renderer;this.renderer=i,this.bitmapMask=e,this.maskTexture=null,this.mainTexture=null,this.dirty=!0,this.mainFramebuffer=null,this.maskFramebuffer=null,this.invertAlpha=!1,this.isStencil=!1,this.scene=t,this.createMask(),t.sys.game.events.on(n.CONTEXT_RESTORED,this.createMask,this),i&&i.on(r.RESIZE,this.createMask,this)},createMask:function(){var t=this.renderer;if(t&&t.gl){this.mainTexture&&this.clearMask();var e=t.width,i=t.height,s=0==(e&e-1)&&0==(i&i-1),n=t.gl,r=s?n.REPEAT:n.CLAMP_TO_EDGE,o=n.LINEAR;this.mainTexture=t.createTexture2D(0,o,o,r,r,n.RGBA,null,e,i),this.maskTexture=t.createTexture2D(0,o,o,r,r,n.RGBA,null,e,i),this.mainFramebuffer=t.createFramebuffer(e,i,this.mainTexture,!0),this.maskFramebuffer=t.createFramebuffer(e,i,this.maskTexture,!0)}},clearMask:function(){var t=this.renderer;t&&t.gl&&this.mainTexture&&(t.deleteTexture(this.mainTexture),t.deleteTexture(this.maskTexture),t.deleteFramebuffer(this.mainFramebuffer),t.deleteFramebuffer(this.maskFramebuffer),this.mainTexture=null,this.maskTexture=null,this.mainFramebuffer=null,this.maskFramebuffer=null)},setBitmap:function(t){this.bitmapMask=t},preRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.beginMask(this,e,i)},postRenderWebGL:function(t,e){t.pipelines.BITMAPMASK_PIPELINE.endMask(this,e)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.clearMask(),this.scene.sys.game.events.off(n.CONTEXT_RESTORED,this.createMask,this),this.renderer&&this.renderer.off(r.RESIZE,this.createMask,this),this.bitmapMask=null,this.prevFramebuffer=null,this.renderer=null}});t.exports=o},63037:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e){this.geometryMask=e,this.invertAlpha=!1,this.isStencil=!0,this.level=0},setShape:function(t){return this.geometryMask=t,this},setInvertAlpha:function(t){return void 0===t&&(t=!0),this.invertAlpha=t,this},preRenderWebGL:function(t,e,i){var s=t.gl;t.flush(),0===t.maskStack.length&&(s.enable(s.STENCIL_TEST),s.clear(s.STENCIL_BUFFER_BIT),t.maskCount=0),t.currentCameraMask.mask!==this&&(t.currentMask.mask=this),t.maskStack.push({mask:this,camera:i}),this.applyStencil(t,i,!0),t.maskCount++},applyStencil:function(t,e,i){var s=t.gl,n=this.geometryMask,r=t.maskCount;s.colorMask(!1,!1,!1,!1),i?(s.stencilFunc(s.EQUAL,r,255),s.stencilOp(s.KEEP,s.KEEP,s.INCR)):(s.stencilFunc(s.EQUAL,r+1,255),s.stencilOp(s.KEEP,s.KEEP,s.DECR)),n.renderWebGL(t,n,e),t.flush(),s.colorMask(!0,!0,!0,!0),s.stencilOp(s.KEEP,s.KEEP,s.KEEP),i?this.invertAlpha?s.stencilFunc(s.NOTEQUAL,r+1,255):s.stencilFunc(s.EQUAL,r+1,255):this.invertAlpha?s.stencilFunc(s.NOTEQUAL,r,255):s.stencilFunc(s.EQUAL,r,255)},postRenderWebGL:function(t){var e=t.gl;t.maskStack.pop(),t.maskCount--,t.flush();var i=t.currentMask;if(0===t.maskStack.length)i.mask=null,e.disable(e.STENCIL_TEST);else{var s=t.maskStack[t.maskStack.length-1];s.mask.applyStencil(t,s.camera,!1),t.currentCameraMask.mask!==s.mask?(i.mask=s.mask,i.camera=s.camera):i.mask=null}},preRenderCanvas:function(t,e,i){var s=this.geometryMask;t.currentContext.save(),s.renderCanvas(t,s,i,null,null,!0),t.currentContext.clip()},postRenderCanvas:function(t){t.currentContext.restore()},destroy:function(){this.geometryMask=null}});t.exports=s},93310:(t,e,i)=>{t.exports={BitmapMask:i(76756),GeometryMask:i(63037)}},31053:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s){e&&""!==e||(e=["precision mediump float;","uniform vec2 resolution;","varying vec2 fragCoord;","void main () {"," vec2 uv = fragCoord / resolution.xy;"," gl_FragColor = vec4(uv.xyx, 1.0);","}"].join("\n")),i&&""!==i||(i=["precision mediump float;","uniform mat4 uProjectionMatrix;","uniform mat4 uViewMatrix;","uniform vec2 uResolution;","attribute vec2 inPosition;","varying vec2 fragCoord;","varying vec2 outTexCoord;","void main () {"," gl_Position = uProjectionMatrix * uViewMatrix * vec4(inPosition, 1.0, 1.0);"," fragCoord = vec2(inPosition.x, uResolution.y - inPosition.y);"," outTexCoord = vec2(inPosition.x / uResolution.x, fragCoord.y / uResolution.y);","}"].join("\n")),void 0===s&&(s=null),this.key=t,this.fragmentSrc=e,this.vertexSrc=i,this.uniforms=s}});t.exports=s},99584:t=>{t.exports=function(t,e){var i;if(e)"string"==typeof e?i=document.getElementById(e):"object"==typeof e&&1===e.nodeType&&(i=e);else if(t.parentElement||null===e)return t;return i||(i=document.body),i.appendChild(t),t}},85178:(t,e,i)=>{var s=i(99584);t.exports=function(t){var e=t.config;if(e.parent&&e.domCreateContainer){var i=document.createElement("div");i.style.cssText=["display: block;","width: "+t.scale.width+"px;","height: "+t.scale.height+"px;","padding: 0; margin: 0;","position: absolute;","overflow: hidden;","pointer-events: "+e.domPointerEvents+";","transform: scale(1);","transform-origin: left top;"].join(" "),t.domContainer=i,s(i,e.parent)}}},21546:(t,e,i)=>{var s=i(36580);t.exports=function(t){if("complete"!==document.readyState&&"interactive"!==document.readyState){var e=function(){document.removeEventListener("deviceready",e,!0),document.removeEventListener("DOMContentLoaded",e,!0),window.removeEventListener("load",e,!0),t()};document.body?s.cordova?document.addEventListener("deviceready",e,!1):(document.addEventListener("DOMContentLoaded",e,!0),window.addEventListener("load",e,!0)):window.setTimeout(e,20)}else t()}},74181:t=>{t.exports=function(t){if(!t)return window.innerHeight;var e=Math.abs(window.orientation),i={w:0,h:0},s=document.createElement("div");return s.setAttribute("style","position: fixed; height: 100vh; width: 0; top: 0"),document.documentElement.appendChild(s),i.w=90===e?s.offsetHeight:window.innerWidth,i.h=90===e?window.innerWidth:s.offsetHeight,document.documentElement.removeChild(s),s=null,90!==Math.abs(window.orientation)?i.h:i.w}},9229:(t,e,i)=>{var s=i(55301);t.exports=function(t,e){var i=window.screen,n=!!i&&(i.orientation||i.mozOrientation||i.msOrientation);return n&&"string"==typeof n.type?n.type:"string"==typeof n?n:"number"==typeof window.orientation?0===window.orientation||180===window.orientation?s.ORIENTATION.PORTRAIT:s.ORIENTATION.LANDSCAPE:window.matchMedia?window.matchMedia("(orientation: portrait)").matches?s.ORIENTATION.PORTRAIT:window.matchMedia("(orientation: landscape)").matches?s.ORIENTATION.LANDSCAPE:void 0:e>t?s.ORIENTATION.PORTRAIT:s.ORIENTATION.LANDSCAPE}},2893:t=>{t.exports=function(t){var e;return""!==t&&("string"==typeof t?e=document.getElementById(t):t&&1===t.nodeType&&(e=t)),e||(e=document.body),e}},89200:t=>{t.exports=function(t){var e="";try{if(window.DOMParser)e=(new DOMParser).parseFromString(t,"text/xml");else(e=new ActiveXObject("Microsoft.XMLDOM")).loadXML(t)}catch(t){e=null}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length?e:null}},55638:t=>{t.exports=function(t){t.parentNode&&t.parentNode.removeChild(t)}},27385:(t,e,i)=>{var s=i(56694),n=i(72283),r=new s({initialize:function(){this.isRunning=!1,this.callback=n,this.tick=0,this.isSetTimeOut=!1,this.timeOutID=null,this.lastTime=0,this.target=0;var t=this;this.step=function e(){var i=window.performance.now();t.lastTime=t.tick,t.tick=i,t.callback(i),t.timeOutID=window.requestAnimationFrame(e)},this.stepTimeout=function e(){var i=Date.now(),s=Math.min(Math.max(2*t.target+t.tick-i,0),t.target);t.lastTime=t.tick,t.tick=i,t.callback(i),t.timeOutID=window.setTimeout(e,s)}},start:function(t,e,i){this.isRunning||(this.callback=t,this.isSetTimeOut=e,this.target=i,this.isRunning=!0,this.timeOutID=e?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=n}});t.exports=r},3590:(t,e,i)=>{var s={AddToDOM:i(99584),DOMContentLoaded:i(21546),GetInnerHeight:i(74181),GetScreenOrientation:i(9229),GetTarget:i(2893),ParseXML:i(89200),RemoveFromDOM:i(55638),RequestAnimationFrame:i(27385)};t.exports=s},78491:(t,e,i)=>{var s=i(56694),n=i(6659),r=i(91963),o=new s({Extends:n,initialize:function(){n.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});r.register("EventEmitter",o,"events"),t.exports=o},95146:(t,e,i)=>{t.exports={EventEmitter:i(78491)}},88933:(t,e,i)=>{var s=i(95723),n=i(20494);t.exports=function(t,e,i){e.x=n(i,"x",0),e.y=n(i,"y",0),e.depth=n(i,"depth",0),e.flipX=n(i,"flipX",!1),e.flipY=n(i,"flipY",!1);var r=n(i,"scale",null);"number"==typeof r?e.setScale(r):null!==r&&(e.scaleX=n(r,"x",1),e.scaleY=n(r,"y",1));var o=n(i,"scrollFactor",null);"number"==typeof o?e.setScrollFactor(o):null!==o&&(e.scrollFactorX=n(o,"x",1),e.scrollFactorY=n(o,"y",1)),e.rotation=n(i,"rotation",0);var a=n(i,"angle",null);null!==a&&(e.angle=a),e.alpha=n(i,"alpha",1);var h=n(i,"origin",null);if("number"==typeof h)e.setOrigin(h);else if(null!==h){var l=n(h,"x",.5),u=n(h,"y",.5);e.setOrigin(l,u)}return e.blendMode=n(i,"blendMode",s.NORMAL),e.visible=n(i,"visible",!0),n(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},32291:(t,e,i)=>{var s=i(20494);t.exports=function(t,e){var i=s(e,"anims",null);if(null===i)return t;if("string"==typeof i)t.anims.play(i);else if("object"==typeof i){var n=t.anims,r=s(i,"key",void 0);if(r){var o=s(i,"startFrame",void 0),a=s(i,"delay",0),h=s(i,"repeat",0),l=s(i,"repeatDelay",0),u=s(i,"yoyo",!1),c=s(i,"play",!1),d=s(i,"delayedPlay",0),p={key:r,delay:a,repeat:h,repeatDelay:l,yoyo:u,startFrame:o};c?n.play(p):d>0?n.playAfterDelay(p,d):n.load(p)}}return t}},91713:(t,e,i)=>{var s=i(56694),n=i(71207),r=i(91963),o=i(56631),a=i(7599),h=i(17922),l=new s({Extends:n,initialize:function(t){n.call(this,t),this.sortChildrenFlag=!1,this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.events.once(a.BOOT,this.boot,this),this.events.on(a.START,this.start,this)},boot:function(){this.events.once(a.DESTROY,this.destroy,this)},addChildCallback:function(t){t.displayList&&t.displayList!==this&&t.removeFromDisplayList(),t.displayList||(this.queueDepthSort(),t.displayList=this,t.emit(o.ADDED_TO_SCENE,t,this.scene),this.events.emit(a.ADDED_TO_SCENE,t,this.scene))},removeChildCallback:function(t){this.queueDepthSort(),t.displayList=null,t.emit(o.REMOVED_FROM_SCENE,t,this.scene),this.events.emit(a.REMOVED_FROM_SCENE,t,this.scene)},start:function(){this.events.once(a.SHUTDOWN,this.shutdown,this)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(h(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},getChildren:function(){return this.list},shutdown:function(){for(var t=this.list,e=t.length;e--;)t[e].destroy(!0);t.length=0,this.events.off(a.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(a.START,this.start,this),this.scene=null,this.systems=null,this.events=null}});r.register("DisplayList",l,"displayList"),t.exports=l},89980:(t,e,i)=>{var s=i(56694),n=i(48129),r=i(81078),o=i(6659),a=i(56631),h=i(7599),l=new s({Extends:o,initialize:function(t,e){o.call(this),this.scene=t,this.displayList=null,this.type=e,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.on(a.ADDED_TO_SCENE,this.addedToScene,this),this.on(a.REMOVED_FROM_SCENE,this.removedFromScene,this),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new r(this)),this},setData:function(t,e){return this.data||(this.data=new r(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new r(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new r(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new r(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(){return this.input&&(this.input.enabled=!1),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return n(this)},willRender:function(t){return!(l.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return this.displayList?i.unshift(this.displayList.getIndex(t)):i.unshift(this.scene.sys.displayList.getIndex(t)),i},addToDisplayList:function(t){return void 0===t&&(t=this.scene.sys.displayList),this.displayList&&this.displayList!==t&&this.removeFromDisplayList(),t.exists(this)||(this.displayList=t,t.add(this,!0),t.queueDepthSort(),this.emit(a.ADDED_TO_SCENE,this,this.scene),t.events.emit(h.ADDED_TO_SCENE,this,this.scene)),this},addToUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.add(this),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(a.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(h.REMOVED_FROM_SCENE,this,this.scene)),this},removeFromUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.remove(this),this},destroy:function(t){this.scene&&!this.ignoreDestroy&&(void 0===t&&(t=!1),this.preDestroy&&this.preDestroy.call(this),this.emit(a.DESTROY,this,t),this.removeAllListeners(),this.postPipelines&&this.resetPostPipeline(!0),this.removeFromDisplayList(),this.removeFromUpdateList(),this.input&&(this.scene.sys.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0)}});l.RENDER_MASK=15,t.exports=l},99325:(t,e,i)=>{var s=i(56694),n=i(91963),r=i(7599),o=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(r.BOOT,this.boot,this),this.events.on(r.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(r.DESTROY,this.destroy,this)},start:function(){this.events.once(r.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.events.off(r.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});o.register=function(t,e){o.prototype.hasOwnProperty(t)||(o.prototype[t]=e)},o.remove=function(t){o.prototype.hasOwnProperty(t)&&delete o.prototype[t]},n.register("GameObjectCreator",o,"make"),t.exports=o},61286:(t,e,i)=>{var s=i(56694),n=i(91963),r=i(7599),o=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(r.BOOT,this.boot,this),this.events.on(r.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(r.DESTROY,this.destroy,this)},start:function(){this.events.once(r.SHUTDOWN,this.shutdown,this)},existing:function(t){return(t.renderCanvas||t.renderWebGL)&&this.displayList.add(t),t.preUpdate&&this.updateList.add(t),t},shutdown:function(){this.events.off(r.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});o.register=function(t,e){o.prototype.hasOwnProperty(t)||(o.prototype[t]=e)},o.remove=function(t){o.prototype.hasOwnProperty(t)&&delete o.prototype[t]},n.register("GameObjectFactory",o,"add"),t.exports=o},73329:(t,e,i)=>{var s=i(69360),n=new s,r=new s,o=new s,a={camera:n,sprite:r,calc:o};t.exports=function(t,e,i){var s=n,h=r,l=o;return h.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),s.copyFrom(e.matrix),i?(s.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),h.e=t.x,h.f=t.y):(h.e-=e.scrollX*t.scrollFactorX,h.f-=e.scrollY*t.scrollFactorY),s.multiply(h,l),a}},92034:(t,e,i)=>{var s=i(56694),n=i(74623),r=i(91963),o=i(7599),a=new s({Extends:n,initialize:function(t){n.call(this),this.checkQueue=!0,this.scene=t,this.systems=t.sys,t.sys.events.once(o.BOOT,this.boot,this),t.sys.events.on(o.START,this.start,this)},boot:function(){this.systems.events.once(o.DESTROY,this.destroy,this)},start:function(){var t=this.systems.events;t.on(o.PRE_UPDATE,this.update,this),t.on(o.UPDATE,this.sceneUpdate,this),t.once(o.SHUTDOWN,this.shutdown,this)},sceneUpdate:function(t,e){for(var i=this._active,s=i.length,n=0;n{t.exports=function(t,e,i,s,n,r,o,a,h,l,u,c,d,p,f){var v=i.x-e.displayOriginX+n,g=i.y-e.displayOriginY+r,m=v+i.w,y=g+i.h,x=o.getXRound(v,g,a),T=o.getYRound(v,g,a),w=o.getXRound(v,y,a),b=o.getYRound(v,y,a),E=o.getXRound(m,y,a),S=o.getYRound(m,y,a),A=o.getXRound(m,g,a),_=o.getYRound(m,g,a);t.batchQuad(e,x,T,w,b,E,S,A,_,s.u0,s.v0,s.u1,s.v1,h,l,u,c,d,p,f)}},82173:t=>{t.exports=function(t,e,i,s){if(void 0===i&&(i=!1),void 0===s)return s={local:{x:0,y:0,width:0,height:0},global:{x:0,y:0,width:0,height:0},lines:{shortest:0,longest:0,lengths:null,height:0},wrappedText:"",words:[],characters:[],scaleX:0,scaleY:0};var n,r,o,a,h=t.text,l=h.length,u=t.maxWidth,c=t.wordWrapCharCode,d=Number.MAX_VALUE,p=Number.MAX_VALUE,f=0,v=0,g=t.fontData.chars,m=t.fontData.lineHeight,y=t.letterSpacing,x=0,T=0,w=0,b=null,E=t._align,S=0,A=0,_=t.fontSize/t.fontData.size,C=_*t.scaleX,M=_*t.scaleY,R=null,P=0,O=[],L=Number.MAX_VALUE,F=0,D=0,k=0,I=[],B=[],N=null;if(u>0){for(n=0;nu||W-X>u?(z.push(G.i-1),G.cr?(z.push(G.i+G.word.length),X=0,U=null):U=G):G.cr&&(z.push(G.i+G.word.length),X=0,U=null)}for(n=z.length-1;n>=0;n--)r=h,o=z[n],a="\n",h=r.substr(0,o)+a+r.substr(o+1);s.wrappedText=h,l=h.length,I=[],N=null}var H=0;for(n=0;nS&&(d=S),p>A&&(p=A);var q=S+b.xAdvance,K=A+m;fF&&(F=k),kF&&(F=k),k0)for(var J=0;J{var s=i(31476);t.exports=function(t,e,i,n,r,o,a){var h=t.sys.textures.get(i),l=h.get(n),u=t.sys.cache.xml.get(r);if(l&&u){var c=s(u,l,o,a,h);return t.sys.cache.bitmapFont.add(e,{data:c,texture:i,frame:n,fromAtlas:!0}),!0}return!1}},39860:(t,e,i)=>{var s=i(10850);t.exports=function(t,e){var i=e.width,n=e.height,r=Math.floor(i/2),o=Math.floor(n/2),a=s(e,"chars","");if(""!==a){var h=s(e,"image",""),l=t.sys.textures.getFrame(h),u=l.cutX,c=l.cutY,d=l.source.width,p=l.source.height,f=s(e,"offset.x",0),v=s(e,"offset.y",0),g=s(e,"spacing.x",0),m=s(e,"spacing.y",0),y=s(e,"lineSpacing",0),x=s(e,"charsPerRow",null);null===x&&(x=d/i)>a.length&&(x=a.length);for(var T=f,w=v,b={retroFont:!0,font:h,size:i,lineHeight:n+y,chars:{}},E=0,S=0;S{function e(t,e){return parseInt(t.getAttribute(e),10)}t.exports=function(t,i,s,n,r){void 0===s&&(s=0),void 0===n&&(n=0);var o=i.cutX,a=i.cutY,h=i.source.width,l=i.source.height,u=i.sourceIndex,c={},d=t.getElementsByTagName("info")[0],p=t.getElementsByTagName("common")[0];c.font=d.getAttribute("face"),c.size=e(d,"size"),c.lineHeight=e(p,"lineHeight")+n,c.chars={};var f=t.getElementsByTagName("char"),v=void 0!==i&&i.trimmed;if(v)var g=i.height,m=i.width;for(var y=0;y{var s=i(66863),n=i(98611),r={Parse:i(39860)};r=n(!1,r,s),t.exports=r},66863:t=>{t.exports={TEXT_SET1:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},13468:(t,e,i)=>{var s=i(44616),n=i(56694),r=i(88899),o=new n({Extends:s,Mixins:[r],initialize:function(t,e,i,n,r,o,a){s.call(this,t,e,i,n,r,o,a),this.type="DynamicBitmapText",this.scrollX=0,this.scrollY=0,this.cropWidth=0,this.cropHeight=0,this.displayCallback,this.callbackData={parent:this,color:0,tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:0,charCode:0,x:0,y:0,scale:0,rotation:0,data:0}},setSize:function(t,e){return this.cropWidth=t,this.cropHeight=e,this},setDisplayCallback:function(t){return this.displayCallback=t,this},setScrollX:function(t){return this.scrollX=t,this},setScrollY:function(t){return this.scrollY=t,this}});t.exports=o},93438:(t,e,i)=>{var s=i(49584);t.exports=function(t,e,i,n){var r=e._text,o=r.length,a=t.currentContext;if(0!==o&&s(t,a,e,i,n)){i.addToRenderList(e);var h=e.fromAtlas?e.frame:e.texture.frames.__BASE,l=e.displayCallback,u=e.callbackData,c=e.fontData.chars,d=e.fontData.lineHeight,p=e._letterSpacing,f=0,v=0,g=0,m=null,y=0,x=0,T=0,w=0,b=0,E=0,S=null,A=0,_=e.frame.source.image,C=h.cutX,M=h.cutY,R=0,P=0,O=e._fontSize/e.fontData.size,L=e._align,F=0,D=0;e.getTextBounds(!1);var k=e._bounds.lines;1===L?D=(k.longest-k.lengths[0])/2:2===L&&(D=k.longest-k.lengths[0]),a.translate(-e.displayOriginX,-e.displayOriginY);var I=i.roundPixels;e.cropWidth>0&&e.cropHeight>0&&(a.beginPath(),a.rect(0,0,e.cropWidth,e.cropHeight),a.clip());for(var B=0;B{var s=i(13468),n=i(88933),r=i(99325),o=i(20494);r.register("dynamicBitmapText",(function(t,e){void 0===t&&(t={});var i=o(t,"font",""),r=o(t,"text",""),a=o(t,"size",!1),h=new s(this.scene,0,0,i,r,a);return void 0!==e&&(t.add=e),n(this.scene,h,t),h}))},94145:(t,e,i)=>{var s=i(13468);i(61286).register("dynamicBitmapText",(function(t,e,i,n,r){return this.displayList.add(new s(this.scene,t,e,i,n,r))}))},88899:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(16873),n=i(93438),t.exports={renderWebGL:s,renderCanvas:n}},16873:(t,e,i)=>{var s=i(73329),n=i(69360),r=i(75512),o=new n;t.exports=function(t,e,i,n){var a=e.text,h=a.length;if(0!==h){i.addToRenderList(e);var l=t.pipelines.set(e.pipeline,e),u=s(e,i,n),c=u.sprite,d=u.calc,p=o,f=e.cropWidth>0||e.cropHeight>0;f&&(l.flush(),t.pushScissor(d.tx,d.ty,e.cropWidth*d.scaleX,e.cropHeight*d.scaleY));var v,g,m=e.frame.glTexture,y=e.tintFill,x=r.getTintAppendFloatAlpha(e.tintTopLeft,i.alpha*e._alphaTL),T=r.getTintAppendFloatAlpha(e.tintTopRight,i.alpha*e._alphaTR),w=r.getTintAppendFloatAlpha(e.tintBottomLeft,i.alpha*e._alphaBL),b=r.getTintAppendFloatAlpha(e.tintBottomRight,i.alpha*e._alphaBR),E=l.setGameObject(e),S=0,A=0,_=0,C=0,M=e.letterSpacing,R=0,P=0,O=e.scrollX,L=e.scrollY,F=e.fontData,D=F.chars,k=F.lineHeight,I=e.fontSize/F.size,B=0,N=e._align,Y=0,U=0,X=e.getTextBounds(!1);e.maxWidth>0&&(h=(a=X.wrappedText).length);var z=e._bounds.lines;1===N?U=(z.longest-z.lengths[0])/2:2===N&&(U=z.longest-z.lengths[0]);var G=i.roundPixels,V=e.displayCallback,W=e.callbackData;t.pipelines.preBatch(e);for(var H=0;H{var s=i(56694),n=i(82897),r=i(64937),o=i(89980),a=i(82173),h=i(68298),l=i(31476),u=i(74118),c=i(84557),d=new s({Extends:o,Mixins:[r.Alpha,r.BlendMode,r.Depth,r.Mask,r.Origin,r.Pipeline,r.ScrollFactor,r.Texture,r.Tint,r.Transform,r.Visible,c],initialize:function(t,e,i,s,n,r,h){void 0===n&&(n=""),void 0===h&&(h=0),o.call(this,t,"BitmapText"),this.font=s;var l=this.scene.sys.cache.bitmapFont.get(s);l||console.warn("Invalid BitmapText key: "+s),this.fontData=l.data,this._text="",this._fontSize=r||this.fontData.size,this._letterSpacing=0,this._align=h,this._bounds=a(),this._dirty=!0,this._maxWidth=0,this.wordWrapCharCode=32,this.charColors=[],this.dropShadowX=0,this.dropShadowY=0,this.dropShadowColor=0,this.dropShadowAlpha=.5,this.fromAtlas=l.fromAtlas,this.setTexture(l.texture,l.frame),this.setPosition(e,i),this.setOrigin(0,0),this.initPipeline(),this.setText(n)},setLeftAlign:function(){return this._align=d.ALIGN_LEFT,this._dirty=!0,this},setCenterAlign:function(){return this._align=d.ALIGN_CENTER,this._dirty=!0,this},setRightAlign:function(){return this._align=d.ALIGN_RIGHT,this._dirty=!0,this},setFontSize:function(t){return this._fontSize=t,this._dirty=!0,this},setLetterSpacing:function(t){return void 0===t&&(t=0),this._letterSpacing=t,this._dirty=!0,this},setText:function(t){return t||0===t||(t=""),Array.isArray(t)&&(t=t.join("\n")),t!==this.text&&(this._text=t.toString(),this._dirty=!0,this.updateDisplayOrigin()),this},setDropShadow:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=.5),this.dropShadowX=t,this.dropShadowY=e,this.dropShadowColor=i,this.dropShadowAlpha=s,this},setCharacterTint:function(t,e,i,s,r,o,a){void 0===t&&(t=0),void 0===e&&(e=1),void 0===i&&(i=!1),void 0===s&&(s=-1),void 0===r&&(r=s,o=s,a=s);var h=this.text.length;-1===e&&(e=h),t<0&&(t=h+t),t=n(t,0,h-1);for(var l=n(t+e,t,h),u=this.charColors,c=t;c{var s=i(49584);t.exports=function(t,e,i,n){var r=e._text,o=r.length,a=t.currentContext;if(0!==o&&s(t,a,e,i,n)){i.addToRenderList(e);var h=e.fromAtlas?e.frame:e.texture.frames.__BASE,l=e.fontData.chars,u=e.fontData.lineHeight,c=e._letterSpacing,d=0,p=0,f=0,v=null,g=0,m=0,y=0,x=0,T=0,w=0,b=null,E=0,S=h.source.image,A=h.cutX,_=h.cutY,C=e._fontSize/e.fontData.size,M=e._align,R=0,P=0,O=e.getTextBounds(!1);e.maxWidth>0&&(o=(r=O.wrappedText).length);var L=e._bounds.lines;1===M?P=(L.longest-L.lengths[0])/2:2===M&&(P=L.longest-L.lengths[0]),a.translate(-e.displayOriginX,-e.displayOriginY);for(var F=i.roundPixels,D=0;D{var s=i(44616),n=i(88933),r=i(99325),o=i(20494),a=i(10850);r.register("bitmapText",(function(t,e){void 0===t&&(t={});var i=a(t,"font",""),r=o(t,"text",""),h=o(t,"size",!1),l=a(t,"align",0),u=new s(this.scene,0,0,i,r,h,l);return void 0!==e&&(t.add=e),n(this.scene,u,t),u}))},21797:(t,e,i)=>{var s=i(44616);i(61286).register("bitmapText",(function(t,e,i,n,r,o){return this.displayList.add(new s(this.scene,t,e,i,n,r,o))}))},84557:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(26372),n=i(97545),t.exports={renderWebGL:s,renderCanvas:n}},26372:(t,e,i)=>{var s=i(8810),n=i(73329),r=i(75512);t.exports=function(t,e,i,o){if(0!==e._text.length){i.addToRenderList(e);var a,h,l,u=t.pipelines.set(e.pipeline,e),c=n(e,i,o).calc,d=i.roundPixels,p=i.alpha,f=e.charColors,v=e.tintFill,g=r.getTintAppendFloatAlpha,m=g(e.tintTopLeft,p*e._alphaTL),y=g(e.tintTopRight,p*e._alphaTR),x=g(e.tintBottomLeft,p*e._alphaBL),T=g(e.tintBottomRight,p*e._alphaBR),w=e.frame.glTexture,b=u.setGameObject(e),E=e.getTextBounds(!1).characters,S=e.dropShadowX,A=e.dropShadowY,_=0!==S||0!==A;if(t.pipelines.preBatch(e),_){var C=e.dropShadowColor,M=e.dropShadowAlpha,R=g(C,p*M*e._alphaTL),P=g(C,p*M*e._alphaTR),O=g(C,p*M*e._alphaBL),L=g(C,p*M*e._alphaBR);for(a=0;a{var s=i(92246),n=i(41664),r=i(56694),o=i(64937),a=i(82047),h=i(89980),l=i(71207),u=new r({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.Depth,o.Mask,o.Pipeline,o.ScrollFactor,o.Size,o.Texture,o.Transform,o.Visible,s],initialize:function(t,e,i,s,n){h.call(this,t,"Blitter"),this.setTexture(s,n),this.setPosition(e,i),this.initPipeline(),this.children=new l,this.renderList=[],this.dirty=!1},create:function(t,e,i,s,r){void 0===s&&(s=!0),void 0===r&&(r=this.children.length),void 0===i?i=this.frame:i instanceof a||(i=this.texture.get(i));var o=new n(this,t,e,i,s);return this.children.addAt(o,r,!1),this.dirty=!0,o},createFromCallback:function(t,e,i,s){for(var n=this.createMultiple(e,i,s),r=0;r0},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(){this.children.removeAll(),this.dirty=!0},preDestroy:function(){this.children.destroy(),this.renderList=[]}});t.exports=u},33177:t=>{t.exports=function(t,e,i,s){var n=e.getRenderList();if(0!==n.length){var r=t.currentContext,o=i.alpha*e.alpha;if(0!==o){i.addToRenderList(e),r.globalCompositeOperation=t.blendModes[e.blendMode],r.imageSmoothingEnabled=!(!t.antialias||e.frame.source.scaleMode);var a=e.x-i.scrollX*e.scrollFactorX,h=e.y-i.scrollY*e.scrollFactorY;r.save(),s&&s.copyToContext(r);for(var l=i.roundPixels,u=0;u{var s=i(52816),n=i(88933),r=i(99325),o=i(20494);r.register("blitter",(function(t,e){void 0===t&&(t={});var i=o(t,"key",null),r=o(t,"frame",null),a=new s(this.scene,0,0,i,r);return void 0!==e&&(t.add=e),n(this.scene,a,t),a}))},38906:(t,e,i)=>{var s=i(52816);i(61286).register("blitter",(function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))}))},92246:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(89165),n=i(33177),t.exports={renderWebGL:s,renderCanvas:n}},89165:(t,e,i)=>{var s=i(69360),n=i(75512),r=new s;t.exports=function(t,e,i,s){var o=e.getRenderList();if(0!==o.length){var a=i.alpha*e.alpha;if(0!==a){i.addToRenderList(e);var h=t.pipelines.set(this.pipeline,e),l=i.scrollX*e.scrollFactorX,u=i.scrollY*e.scrollFactorY,c=r.copyFrom(i.matrix);s&&(c.multiplyWithOffset(s,-l,-u),l=0,u=0);var d=e.x-l,p=e.y-u,f=-1,v=i.roundPixels;t.pipelines.preBatch(e);for(var g=0;g{var s=i(56694),n=i(82047),r=new s({initialize:function(t,e,i,s,n){this.parent=t,this.x=e,this.y=i,this.frame=s,this.data={},this.tint=16777215,this._visible=n,this._alpha=1,this.flipX=!1,this.flipY=!1},setFrame:function(t){return void 0===t?this.frame=this.parent.frame:t instanceof n&&t.texture===this.parent.texture?this.frame=t:this.frame=this.parent.texture.get(t),this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this},reset:function(t,e,i){return this.x=t,this.y=e,this.flipX=!1,this.flipY=!1,this._alpha=1,this._visible=!0,this.parent.dirty=!0,i&&this.setFrame(i),this},setPosition:function(t,e){return this.x=t,this.y=e,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},setVisible:function(t){return this.visible=t,this},setAlpha:function(t){return this.alpha=t,this},setTint:function(t){return this.tint=t,this},destroy:function(){this.parent.dirty=!0,this.parent.children.remove(this),this.parent=void 0,this.frame=void 0,this.data=void 0},visible:{get:function(){return this._visible},set:function(t){this.parent.dirty|=this._visible!==t,this._visible=t}},alpha:{get:function(){return this._alpha},set:function(t){this.parent.dirty|=this._alpha>0!=t>0,this._alpha=t}}});t.exports=r},97123:(t,e,i)=>{var s=i(82897),n={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,n){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=s(t,0,1),this._alphaTR=s(e,0,1),this._alphaBL=s(i,0,1),this._alphaBR=s(n,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=s(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=s(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=s(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=s(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=n},15720:(t,e,i)=>{var s=i(82897),n={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t){return void 0===t&&(t=1),this.alpha=t,this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}}};t.exports=n},69732:(t,e,i)=>{var s=i(95723),n={_blendMode:s.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=s[t]),(t|=0)>=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=n},28284:t=>{t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},85293:t=>{var e={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,s){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,s,this.flipX,this.flipY);else{var n=t;this.frame.setCropUVs(this._crop,n.x,n.y,n.width,n.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=e},14975:t=>{var e={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.displayList&&this.displayList.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=e},88677:t=>{var e={fxPadding:0,setFXPadding:function(t){return void 0===t&&(t=0),this.fxPadding=t,this},onFXCopy:function(){},onFX:function(){}};t.exports=e},92972:t=>{t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},80693:(t,e,i)=>{var s=i(74118),n=i(2386),r=i(93736),o={prepareBoundsOutput:function(t,e){(void 0===e&&(e=!1),0!==this.rotation&&n(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getCenter:function(t){return void 0===t&&(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,t},getTopLeft:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopRight:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getLeftCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getRightCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getBottomLeft:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomRight:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBounds:function(t){var e,i,n,r,o,a,h,l;if(void 0===t&&(t=new s),this.parentContainer){var u=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(t),u.transformPoint(t.x,t.y,t),e=t.x,i=t.y,this.getTopRight(t),u.transformPoint(t.x,t.y,t),n=t.x,r=t.y,this.getBottomLeft(t),u.transformPoint(t.x,t.y,t),o=t.x,a=t.y,this.getBottomRight(t),u.transformPoint(t.x,t.y,t),h=t.x,l=t.y}else this.getTopLeft(t),e=t.x,i=t.y,this.getTopRight(t),n=t.x,r=t.y,this.getBottomLeft(t),o=t.x,a=t.y,this.getBottomRight(t),h=t.x,l=t.y;return t.x=Math.min(e,n,o,h),t.y=Math.min(i,r,a,l),t.width=Math.max(e,n,o,h)-t.x,t.height=Math.max(i,r,a,l)-t.y,t}};t.exports=o},39171:(t,e,i)=>{var s=i(76756),n=i(63037),r={mask:null,setMask:function(t){return this.mask=t,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},createBitmapMask:function(t){return void 0===t&&(this.texture||this.shader)&&(t=this),new s(this.scene,t)},createGeometryMask:function(t){return void 0===t&&"Graphics"===this.type&&(t=this),new n(this.scene,t)}};t.exports=r},28072:t=>{var e={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(t){this._displayOriginX=t,this.originX=t/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(t){this._displayOriginY=t,this.originY=t/this.height}},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this.updateDisplayOrigin()},setOriginFromFrame:function(){return this.frame&&this.frame.customPivot?(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin()):this.setOrigin()},setDisplayOrigin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displayOriginX=t,this.displayOriginY=e,this},updateDisplayOrigin:function(){return this._displayOriginX=this.originX*this.width,this._displayOriginY=this.originY*this.height,this}};t.exports=e},54211:(t,e,i)=>{var s=i(75606),n=i(63130),r=i(10850),o=i(55303),a=i(93736),h={path:null,rotateToPath:!1,pathRotationOffset:0,pathOffset:null,pathVector:null,pathDelta:null,pathTween:null,pathConfig:null,_prevDirection:o.PLAYING_FORWARD,setPath:function(t,e){void 0===e&&(e=this.pathConfig);var i=this.pathTween;return i&&i.isPlaying()&&i.stop(),this.path=t,e&&this.startFollow(e),this},setRotateToPath:function(t,e){return void 0===e&&(e=0),this.rotateToPath=t,this.pathRotationOffset=e,this},isFollowing:function(){var t=this.pathTween;return t&&t.isPlaying()},startFollow:function(t,e){void 0===t&&(t={}),void 0===e&&(e=0);var i=this.pathTween;i&&i.isPlaying()&&i.stop(),"number"==typeof t&&(t={duration:t}),t.from=r(t,"from",0),t.to=r(t,"to",1);var h=n(t,"positionOnPath",!1);this.rotateToPath=n(t,"rotateToPath",!1),this.pathRotationOffset=r(t,"rotationOffset",0);var l=r(t,"startAt",e);if(l&&(t.onStart=function(t){var e=t.data[0];e.progress=l,e.elapsed=e.duration*l;var i=e.ease(e.progress);e.current=e.start+(e.end-e.start)*i,e.target[e.key]=e.current}),this.pathOffset||(this.pathOffset=new a(this.x,this.y)),this.pathVector||(this.pathVector=new a),this.pathDelta||(this.pathDelta=new a),this.pathDelta.reset(),this.pathTween=this.scene.sys.tweens.addCounter(t),this.path.getStartPoint(this.pathOffset),h&&(this.x=this.pathOffset.x,this.y=this.pathOffset.y),this.pathOffset.x=this.x-this.pathOffset.x,this.pathOffset.y=this.y-this.pathOffset.y,this._prevDirection=o.PLAYING_FORWARD,this.rotateToPath){var u=this.path.getPoint(.1);this.rotation=Math.atan2(u.y-this.y,u.x-this.x)+s(this.pathRotationOffset)}return this.pathConfig=t,this},pauseFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.pause(),this},resumeFollow:function(){var t=this.pathTween;return t&&t.isPaused()&&t.resume(),this},stopFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.stop(),this},pathUpdate:function(){var t=this.pathTween;if(t){var e=t.data[0],i=this.pathDelta,n=this.pathVector;if(i.copy(n).negate(),e.state===o.COMPLETE)return this.path.getPoint(1,n),i.add(n),n.add(this.pathOffset),void this.setPosition(n.x,n.y);if(e.state!==o.PLAYING_FORWARD&&e.state!==o.PLAYING_BACKWARD)return;this.path.getPoint(t.getValue(),n),i.add(n),n.add(this.pathOffset);var r=this.x,a=this.y;this.setPosition(n.x,n.y);var h=this.x-r,l=this.y-a;if(0===h&&0===l)return;if(e.state!==this._prevDirection)return void(this._prevDirection=e.state);this.rotateToPath&&(this.rotation=Math.atan2(l,h)+s(this.pathRotationOffset))}}};t.exports=h},58210:(t,e,i)=>{var s=i(28699),n=i(65641),r=i(72677),o={defaultPipeline:null,pipeline:null,hasPostPipeline:!1,postPipelines:null,pipelineData:null,initPipeline:function(t){void 0===t&&(t=n.MULTI_PIPELINE);var e=this.scene.sys.renderer;if(!e)return!1;var i=e.pipelines;if(this.postPipelines=[],this.pipelineData={},i){var s=i.get(t);if(s)return this.defaultPipeline=s,this.pipeline=s,!0}return!1},setPipeline:function(t,e,i){var n=this.scene.sys.renderer;if(!n)return this;var r=n.pipelines;if(r){var o=r.get(t);o&&(this.pipeline=o),e&&(this.pipelineData=i?s(e):e)}return this},setPostPipeline:function(t,e,i){var n=this.scene.sys.renderer;if(!n)return this;var r=n.pipelines;if(r){Array.isArray(t)||(t=[t]);for(var o=0;o0,this},setPipelineData:function(t,e){var i=this.pipelineData;return void 0===e?delete i[t]:i[t]=e,this},getPostPipeline:function(t){for(var e=this.postPipelines,i=[],s=0;s=0;i--){var s=e[i];("string"==typeof t&&s.name===t||"string"!=typeof t&&s instanceof t)&&(s.destroy(),r(e,i))}return this.hasPostPipeline=this.postPipelines.length>0,this},getPipelineName:function(){return this.pipeline.name}};t.exports=o},45900:t=>{var e={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=e},31654:t=>{var e={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return Math.abs(this.scaleX*this.frame.realWidth)},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return Math.abs(this.scaleY*this.frame.realHeight)},set:function(t){this.scaleY=t/this.frame.realHeight}},setSizeToFrame:function(t){return void 0===t&&(t=this.frame),this.width=t.realWidth,this.height=t.realHeight,this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}};t.exports=e},82081:t=>{var e={texture:null,frame:null,isCropped:!1,setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};t.exports=e},21850:t=>{var e={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,s){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,s,this.flipX,this.flipY);else{var n=t;this.frame.setCropUVs(this._crop,n.x,n.y,n.width,n.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=e},58072:t=>{var e={tintTopLeft:16777215,tintTopRight:16777215,tintBottomLeft:16777215,tintBottomRight:16777215,tintFill:!1,clearTint:function(){return this.setTint(16777215),this},setTint:function(t,e,i,s){return void 0===t&&(t=16777215),void 0===e&&(e=t,i=t,s=t),this.tintTopLeft=t,this.tintTopRight=e,this.tintBottomLeft=i,this.tintBottomRight=s,this.tintFill=!1,this},setTintFill:function(t,e,i,s){return this.setTint(t,e,i,s),this.tintFill=!0,this},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){var t=16777215;return this.tintFill||this.tintTopLeft!==t||this.tintTopRight!==t||this.tintBottomLeft!==t||this.tintBottomRight!==t}}};t.exports=e},48129:t=>{t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},56584:(t,e,i)=>{var s=i(83392),n=i(69360),r=i(64462),o=i(35786),a=i(62138),h=i(93736),l={_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(t){this._scaleX=t,this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},angle:{get:function(){return a(this._rotation*s.RAD_TO_DEG)},set:function(t){this.rotation=a(t)*s.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=o(t)}},setPosition:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===s&&(s=0),this.x=t,this.y=e,this.z=i,this.w=s,this},copyPosition:function(t){return void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.z&&(this.z=t.z),void 0!==t.w&&(this.w=t.w),this},setRandomPosition:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===s&&(s=this.scene.sys.scale.height),this.x=t+Math.random()*i,this.y=e+Math.random()*s,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new n),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new n),void 0===e&&(e=new n);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);for(t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return t},getLocalPoint:function(t,e,i,s){i||(i=new h),s||(s=this.scene.sys.cameras.main);var n=s.scrollX,o=s.scrollY,a=t+n*this.scrollFactorX-n,l=e+o*this.scrollFactorY-o;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(a,l,i):r(a,l,this.x,this.y,this.rotation,this.scaleX,this.scaleY,i),this._originComponent&&(i.x+=this._displayOriginX,i.y+=this._displayOriginY),i},getParentRotation:function(){for(var t=0,e=this.parentContainer;e;)t+=e.rotation,e=e.parentContainer;return t}};t.exports=l},69360:(t,e,i)=>{var s=i(56694),n=i(83392),r=i(93736),o=new s({initialize:function(t,e,i,s,n,r){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=1),void 0===n&&(n=0),void 0===r&&(r=0),this.matrix=new Float32Array([t,e,i,s,n,r,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0}},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var t=this.matrix,e=t[0],i=t[1],s=t[2],r=t[3];return e||i?i>0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):s||r?n.TAU-(r>0?Math.acos(-s/this.scaleY):-Math.acos(s/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),s=this.matrix,n=s[0],r=s[1],o=s[2],a=s[3];return s[0]=n*i+o*e,s[1]=r*i+a*e,s[2]=n*-e+o*i,s[3]=r*-e+a*i,this},multiply:function(t,e){var i=this.matrix,s=t.matrix,n=i[0],r=i[1],o=i[2],a=i[3],h=i[4],l=i[5],u=s[0],c=s[1],d=s[2],p=s[3],f=s[4],v=s[5],g=void 0===e?this:e;return g.a=u*n+c*o,g.b=u*r+c*a,g.c=d*n+p*o,g.d=d*r+p*a,g.e=f*n+v*o+h,g.f=f*r+v*a+l,g},multiplyWithOffset:function(t,e,i){var s=this.matrix,n=t.matrix,r=s[0],o=s[1],a=s[2],h=s[3],l=e*r+i*a+s[4],u=e*o+i*h+s[5],c=n[0],d=n[1],p=n[2],f=n[3],v=n[4],g=n[5];return s[0]=c*r+d*a,s[1]=c*o+d*h,s[2]=p*r+f*a,s[3]=p*o+f*h,s[4]=v*r+g*a+l,s[5]=v*o+g*h+u,this},transform:function(t,e,i,s,n,r){var o=this.matrix,a=o[0],h=o[1],l=o[2],u=o[3],c=o[4],d=o[5];return o[0]=t*a+e*l,o[1]=t*h+e*u,o[2]=i*a+s*l,o[3]=i*h+s*u,o[4]=n*a+r*l+c,o[5]=n*h+r*u+d,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var s=this.matrix,n=s[0],r=s[1],o=s[2],a=s[3],h=s[4],l=s[5];return i.x=t*n+e*o+h,i.y=t*r+e*a+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=e*n-i*s;return t[0]=n/a,t[1]=-i/a,t[2]=-s/a,t[3]=e/a,t[4]=(s*o-n*r)/a,t[5]=-(e*o-i*r)/a,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){var e=this.matrix;return t.setTransform(e[0],e[1],e[2],e[3],e[4],e[5]),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,s,n,r){var o=this.matrix;return o[0]=t,o[1]=e,o[2]=i,o[3]=s,o[4]=n,o[5]=r,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],s=e[1],n=e[2],r=e[3],o=i*r-s*n;if(t.translateX=e[4],t.translateY=e[5],i||s){var a=Math.sqrt(i*i+s*s);t.rotation=s>0?Math.acos(i/a):-Math.acos(i/a),t.scaleX=a,t.scaleY=o/a}else if(n||r){var h=Math.sqrt(n*n+r*r);t.rotation=.5*Math.PI-(r>0?Math.acos(-n/h):-Math.acos(n/h)),t.scaleX=o/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,i,s,n){var r=this.matrix,o=Math.sin(i),a=Math.cos(i);return r[4]=t,r[5]=e,r[0]=a*s,r[1]=o*s,r[2]=-o*n,r[3]=a*n,this},applyInverse:function(t,e,i){void 0===i&&(i=new r);var s=this.matrix,n=s[0],o=s[1],a=s[2],h=s[3],l=s[4],u=s[5],c=1/(n*h+a*-o);return i.x=h*c*t+-a*c*e+(u*a-l*h)*c,i.y=n*c*e+-o*c*t+(-u*n+l*o)*c,i},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getXRound:function(t,e,i){var s=this.getX(t,e);return i&&(s=Math.round(s)),s},getYRound:function(t,e,i){var s=this.getY(t,e);return i&&(s=Math.round(s)),s},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.decomposedMatrix=null}});t.exports=o},59694:t=>{var e={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=e},64937:(t,e,i)=>{t.exports={Alpha:i(97123),AlphaSingle:i(15720),BlendMode:i(69732),ComputedSize:i(28284),Crop:i(85293),Depth:i(14975),Flip:i(92972),FX:i(88677),GetBounds:i(80693),Mask:i(39171),Origin:i(28072),PathFollower:i(54211),Pipeline:i(58210),ScrollFactor:i(45900),Size:i(31654),Texture:i(82081),TextureCrop:i(21850),Tint:i(58072),ToJSON:i(48129),Transform:i(56584),TransformMatrix:i(69360),Visible:i(59694)}},70339:(t,e,i)=>{var s=i(59959),n=i(95723),r=i(56694),o=i(64937),a=i(56631),h=i(89980),l=i(74118),u=i(98524),c=i(58795),d=i(93736),p=new r({Extends:h,Mixins:[o.AlphaSingle,o.BlendMode,o.ComputedSize,o.Depth,o.Mask,o.Pipeline,o.Transform,o.Visible,u],initialize:function(t,e,i,s){h.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new o.TransformMatrix,this.tempTransformMatrix=new o.TransformMatrix,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.initPipeline(),this.setPosition(e,i),this.clearAlpha(),this.setBlendMode(n.SKIP_CHECK),s&&this.add(s)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new l),t.setTo(this.x,this.y,0,0),this.parentContainer){var e=this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x,this.y);t.setTo(e.x,e.y,0,0)}if(this.list.length>0){var i=this.list,s=new l,n=!1;t.setEmpty();for(var r=0;r-1},setAll:function(t,e,i,n){return s.SetAll(this.list,t,e,i,n),this},each:function(t,e){var i,s=[null],n=this.list.slice(),r=n.length;for(i=2;i0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[]}});t.exports=p},13916:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e);var n=e.list;if(0!==n.length){var r=e.localTransform;s?(r.loadIdentity(),r.multiply(s),r.translate(e.x,e.y),r.rotate(e.rotation),r.scale(e.scaleX,e.scaleY)):r.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var o=-1!==e.blendMode;o||t.setBlendMode(0);var a=e._alpha,h=e.scrollFactorX,l=e.scrollFactorY;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var u=0;u{var s=i(88933),n=i(70339),r=i(99325),o=i(20494);r.register("container",(function(t,e){void 0===t&&(t={});var i=o(t,"x",0),r=o(t,"y",0),a=o(t,"children",null),h=new n(this.scene,i,r,a);return void 0!==e&&(t.add=e),s(this.scene,h,t),h}))},23400:(t,e,i)=>{var s=i(70339);i(61286).register("container",(function(t,e,i){return this.displayList.add(new s(this.scene,t,e,i))}))},98524:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(36934),n=i(13916),t.exports={renderWebGL:s,renderCanvas:n}},36934:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e);var n=e.list,r=n.length;if(0!==r){var o=e.localTransform;s?(o.loadIdentity(),o.multiply(s),o.translate(e.x,e.y),o.rotate(e.rotation),o.scale(e.scaleX,e.scaleY)):o.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),t.pipelines.preBatch(e);var a=-1!==e.blendMode;a||t.setBlendMode(0);for(var h=e.alpha,l=e.scrollFactorX,u=e.scrollFactorY,c=0;c{t.exports=["normal","multiply","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]},38943:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(11603),o=i(89980),a=i(42911),h=i(55638),l=i(7599),u=i(51729),c=new s({Extends:o,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Origin,n.ScrollFactor,n.Transform,n.Visible,r],initialize:function(t,e,i,s,n,r){o.call(this,t,"DOMElement"),this.parent=t.sys.game.domContainer,this.cache=t.sys.cache.html,this.node,this.transformOnly=!1,this.skewX=0,this.skewY=0,this.rotate3d=new u,this.rotate3dAngle="deg",this.pointerEvents="auto",this.width=0,this.height=0,this.displayWidth=0,this.displayHeight=0,this.handler=this.dispatchNativeEvent.bind(this),this.setPosition(e,i),"string"==typeof s?"#"===s[0]?this.setElement(s.substr(1),n,r):this.createElement(s,n,r):s&&this.setElement(s,n,r),t.sys.events.on(l.SLEEP,this.handleSceneEvent,this),t.sys.events.on(l.WAKE,this.handleSceneEvent,this),t.sys.events.on(l.PRE_RENDER,this.preRender,this)},handleSceneEvent:function(t){var e=this.node,i=e.style;e&&(i.display=t.settings.visible?"block":"none")},setSkew:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.skewX=t,this.skewY=e,this},setPerspective:function(t){return this.parent.style.perspective=t+"px",this},perspective:{get:function(){return parseFloat(this.parent.style.perspective)},set:function(t){this.parent.style.perspective=t+"px"}},addListener:function(t){if(this.node){t=t.split(" ");for(var e=0;e{var s=i(2452),n=i(89980),r=i(69360),o=new r,a=new r,h=new r;t.exports=function(t,e,i,r){if(e.node){var l=e.node.style,u=e.scene.sys.settings;if(!l||!u.visible||n.RENDER_MASK!==e.renderFlags||0!==e.cameraFilter&&e.cameraFilter&i.id||e.parentContainer&&!e.parentContainer.willRender())l.display="none";else{var c=e.parentContainer,d=i.alpha*e.alpha;c&&(d*=c.alpha);var p=o,f=a,v=h,g=0,m=0,y="0%",x="0%";r?(g=e.width*e.scaleX*e.originX,m=e.height*e.scaleY*e.originY,f.applyITRS(e.x-g,e.y-m,e.rotation,e.scaleX,e.scaleY),p.copyFrom(i.matrix),p.multiplyWithOffset(r,-i.scrollX*e.scrollFactorX,-i.scrollY*e.scrollFactorY),f.e=e.x-g,f.f=e.y-m,p.multiply(f,v)):(g=e.width*e.originX,m=e.height*e.originY,f.applyITRS(e.x-g,e.y-m,e.rotation,e.scaleX,e.scaleY),p.copyFrom(i.matrix),y=100*e.originX+"%",x=100*e.originY+"%",f.e-=i.scrollX*e.scrollFactorX,f.f-=i.scrollY*e.scrollFactorY,p.multiply(f,v)),e.transformOnly||(l.display="block",l.opacity=d,l.zIndex=e._depth,l.pointerEvents=e.pointerEvents,l.mixBlendMode=s[e._blendMode]),l.transform=v.getCSSMatrix()+" skew("+e.skewX+"rad, "+e.skewY+"rad) rotate3d("+e.rotate3d.x+","+e.rotate3d.y+","+e.rotate3d.z+","+e.rotate3d.w+e.rotate3dAngle+")",l.transformOrigin=y+" "+x}}}},66788:(t,e,i)=>{var s=i(38943);i(61286).register("dom",(function(t,e,i,n,r){var o=new s(this.scene,t,e,i,n,r);return this.displayList.add(o),o}))},11603:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(66070),n=i(66070),t.exports={renderWebGL:s,renderCanvas:n}},65492:t=>{t.exports="addedtoscene"},98398:t=>{t.exports="destroy"},40239:t=>{t.exports="removedfromscene"},17286:t=>{t.exports="complete"},31496:t=>{t.exports="created"},89587:t=>{t.exports="error"},96342:t=>{t.exports="loop"},49614:t=>{t.exports="play"},24418:t=>{t.exports="seeked"},87318:t=>{t.exports="seeking"},61922:t=>{t.exports="stop"},13991:t=>{t.exports="timeout"},4052:t=>{t.exports="unlocked"},56631:(t,e,i)=>{t.exports={ADDED_TO_SCENE:i(65492),DESTROY:i(98398),REMOVED_FROM_SCENE:i(40239),VIDEO_COMPLETE:i(17286),VIDEO_CREATED:i(31496),VIDEO_ERROR:i(89587),VIDEO_LOOP:i(96342),VIDEO_PLAY:i(49614),VIDEO_SEEKED:i(24418),VIDEO_SEEKING:i(87318),VIDEO_STOP:i(61922),VIDEO_TIMEOUT:i(13991),VIDEO_UNLOCKED:i(4052)}},39419:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(89980),o=i(79394),a=new s({Extends:r,Mixins:[n.Alpha,n.BlendMode,n.Depth,n.Flip,n.Origin,n.ScrollFactor,n.Size,n.Texture,n.Tint,n.Transform,n.Visible,o],initialize:function(t){r.call(this,t,"Extern")},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(){},render:function(){}});t.exports=a},96699:()=>{},41155:(t,e,i)=>{var s=i(39419);i(61286).register("extern",(function(){var t=new s(this.scene);return this.displayList.add(t),t}))},79394:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(81410),n=i(96699),t.exports={renderWebGL:s,renderCanvas:n}},81410:(t,e,i)=>{var s=i(73329);t.exports=function(t,e,i,n){t.pipelines.clear();var r=s(e,i,n).calc;e.render.call(e,t,i,r),t.pipelines.rebind()}},36266:t=>{t.exports={ARC:0,BEGIN_PATH:1,CLOSE_PATH:2,FILL_RECT:3,LINE_TO:4,MOVE_TO:5,LINE_STYLE:6,FILL_STYLE:7,FILL_PATH:8,STROKE_PATH:9,FILL_TRIANGLE:10,STROKE_TRIANGLE:11,SAVE:14,RESTORE:15,TRANSLATE:16,SCALE:17,ROTATE:18,GRADIENT_FILL_STYLE:21,GRADIENT_LINE_STYLE:22}},33182:(t,e,i)=>{var s=i(51052),n=i(56694),r=i(36266),o=i(15720),a=i(69732),h=i(14975),l=i(39171),u=i(58210),c=i(45900),d=i(56584),p=i(59694),f=i(95669),v=i(89980),g=i(72632),m=i(10850),y=i(83392),x=i(60898),T=new n({Extends:v,Mixins:[o,a,h,l,u,d,p,c,x],initialize:function(t,e){var i=m(e,"x",0),s=m(e,"y",0);v.call(this,t,"Graphics"),this.setPosition(i,s),this.initPipeline(),this.displayOriginX=0,this.displayOriginY=0,this.commandBuffer=[],this.defaultFillColor=-1,this.defaultFillAlpha=1,this.defaultStrokeWidth=1,this.defaultStrokeColor=-1,this.defaultStrokeAlpha=1,this._lineWidth=1,this.setDefaultStyles(e)},setDefaultStyles:function(t){return m(t,"lineStyle",null)&&(this.defaultStrokeWidth=m(t,"lineStyle.width",1),this.defaultStrokeColor=m(t,"lineStyle.color",16777215),this.defaultStrokeAlpha=m(t,"lineStyle.alpha",1),this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha)),m(t,"fillStyle",null)&&(this.defaultFillColor=m(t,"fillStyle.color",16777215),this.defaultFillAlpha=m(t,"fillStyle.alpha",1),this.fillStyle(this.defaultFillColor,this.defaultFillAlpha)),this},lineStyle:function(t,e,i){return void 0===i&&(i=1),this.commandBuffer.push(r.LINE_STYLE,t,e,i),this._lineWidth=t,this},fillStyle:function(t,e){return void 0===e&&(e=1),this.commandBuffer.push(r.FILL_STYLE,t,e),this},fillGradientStyle:function(t,e,i,s,n,o,a,h){return void 0===n&&(n=1),void 0===o&&(o=n),void 0===a&&(a=n),void 0===h&&(h=n),this.commandBuffer.push(r.GRADIENT_FILL_STYLE,n,o,a,h,t,e,i,s),this},lineGradientStyle:function(t,e,i,s,n,o){return void 0===o&&(o=1),this.commandBuffer.push(r.GRADIENT_LINE_STYLE,t,o,e,i,s,n),this},beginPath:function(){return this.commandBuffer.push(r.BEGIN_PATH),this},closePath:function(){return this.commandBuffer.push(r.CLOSE_PATH),this},fillPath:function(){return this.commandBuffer.push(r.FILL_PATH),this},fill:function(){return this.commandBuffer.push(r.FILL_PATH),this},strokePath:function(){return this.commandBuffer.push(r.STROKE_PATH),this},stroke:function(){return this.commandBuffer.push(r.STROKE_PATH),this},fillCircleShape:function(t){return this.fillCircle(t.x,t.y,t.radius)},strokeCircleShape:function(t){return this.strokeCircle(t.x,t.y,t.radius)},fillCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,y.PI2),this.fillPath(),this},strokeCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,y.PI2),this.strokePath(),this},fillRectShape:function(t){return this.fillRect(t.x,t.y,t.width,t.height)},strokeRectShape:function(t){return this.strokeRect(t.x,t.y,t.width,t.height)},fillRect:function(t,e,i,s){return this.commandBuffer.push(r.FILL_RECT,t,e,i,s),this},strokeRect:function(t,e,i,s){var n=this._lineWidth/2,r=t-n,o=t+n;return this.beginPath(),this.moveTo(t,e),this.lineTo(t,e+s),this.strokePath(),this.beginPath(),this.moveTo(t+i,e),this.lineTo(t+i,e+s),this.strokePath(),this.beginPath(),this.moveTo(r,e),this.lineTo(o+i,e),this.strokePath(),this.beginPath(),this.moveTo(r,e+s),this.lineTo(o+i,e+s),this.strokePath(),this},fillRoundedRect:function(t,e,i,s,n){void 0===n&&(n=20);var r=n,o=n,a=n,h=n;return"number"!=typeof n&&(r=g(n,"tl",20),o=g(n,"tr",20),a=g(n,"bl",20),h=g(n,"br",20)),this.beginPath(),this.moveTo(t+r,e),this.lineTo(t+i-o,e),this.arc(t+i-o,e+o,o,-y.TAU,0),this.lineTo(t+i,e+s-h),this.arc(t+i-h,e+s-h,h,0,y.TAU),this.lineTo(t+a,e+s),this.arc(t+a,e+s-a,a,y.TAU,Math.PI),this.lineTo(t,e+r),this.arc(t+r,e+r,r,-Math.PI,-y.TAU),this.fillPath(),this},strokeRoundedRect:function(t,e,i,s,n){void 0===n&&(n=20);var r=n,o=n,a=n,h=n;return"number"!=typeof n&&(r=g(n,"tl",20),o=g(n,"tr",20),a=g(n,"bl",20),h=g(n,"br",20)),this.beginPath(),this.moveTo(t+r,e),this.lineTo(t+i-o,e),this.moveTo(t+i-o,e),this.arc(t+i-o,e+o,o,-y.TAU,0),this.lineTo(t+i,e+s-h),this.moveTo(t+i,e+s-h),this.arc(t+i-h,e+s-h,h,0,y.TAU),this.lineTo(t+a,e+s),this.moveTo(t+a,e+s),this.arc(t+a,e+s-a,a,y.TAU,Math.PI),this.lineTo(t,e+r),this.moveTo(t,e+r),this.arc(t+r,e+r,r,-Math.PI,-y.TAU),this.strokePath(),this},fillPointShape:function(t,e){return this.fillPoint(t.x,t.y,e)},fillPoint:function(t,e,i){return!i||i<1?i=1:(t-=i/2,e-=i/2),this.commandBuffer.push(r.FILL_RECT,t,e,i,i),this},fillTriangleShape:function(t){return this.fillTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},strokeTriangleShape:function(t){return this.strokeTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},fillTriangle:function(t,e,i,s,n,o){return this.commandBuffer.push(r.FILL_TRIANGLE,t,e,i,s,n,o),this},strokeTriangle:function(t,e,i,s,n,o){return this.commandBuffer.push(r.STROKE_TRIANGLE,t,e,i,s,n,o),this},strokeLineShape:function(t){return this.lineBetween(t.x1,t.y1,t.x2,t.y2)},lineBetween:function(t,e,i,s){return this.beginPath(),this.moveTo(t,e),this.lineTo(i,s),this.strokePath(),this},lineTo:function(t,e){return this.commandBuffer.push(r.LINE_TO,t,e),this},moveTo:function(t,e){return this.commandBuffer.push(r.MOVE_TO,t,e),this},strokePoints:function(t,e,i,s){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===s&&(s=t.length),this.beginPath(),this.moveTo(t[0].x,t[0].y);for(var n=1;n-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(t,e,i){var s,n,r=this.scene.sys,o=r.game.renderer;if(void 0===e&&(e=r.scale.width),void 0===i&&(i=r.scale.height),T.TargetCamera.setScene(this.scene),T.TargetCamera.setViewport(0,0,e,i),T.TargetCamera.scrollX=this.x,T.TargetCamera.scrollY=this.y,"string"==typeof t)if(r.textures.exists(t)){var a=(s=r.textures.get(t)).getSourceImage();a instanceof HTMLCanvasElement&&(n=a.getContext("2d"))}else n=(s=r.textures.createCanvas(t,e,i)).getSourceImage().getContext("2d");else t instanceof HTMLCanvasElement&&(n=t.getContext("2d"));return n&&(this.renderCanvas(o,this,T.TargetCamera,null,n,!1),s&&s.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});T.TargetCamera=new s,t.exports=T},91543:(t,e,i)=>{var s=i(36266),n=i(49584);t.exports=function(t,e,i,r,o,a){var h=e.commandBuffer,l=h.length,u=o||t.currentContext;if(0!==l&&n(t,u,e,i,r)){i.addToRenderList(e);var c=1,d=1,p=0,f=0,v=1,g=0,m=0,y=0;u.beginPath();for(var x=0;x>>16,m=(65280&p)>>>8,y=255&p,u.strokeStyle="rgba("+g+","+m+","+y+","+c+")",u.lineWidth=v,x+=3;break;case s.FILL_STYLE:f=h[x+1],d=h[x+2],g=(16711680&f)>>>16,m=(65280&f)>>>8,y=255&f,u.fillStyle="rgba("+g+","+m+","+y+","+d+")",x+=2;break;case s.BEGIN_PATH:u.beginPath();break;case s.CLOSE_PATH:u.closePath();break;case s.FILL_PATH:a||u.fill();break;case s.STROKE_PATH:a||u.stroke();break;case s.FILL_RECT:a?u.rect(h[x+1],h[x+2],h[x+3],h[x+4]):u.fillRect(h[x+1],h[x+2],h[x+3],h[x+4]),x+=4;break;case s.FILL_TRIANGLE:u.beginPath(),u.moveTo(h[x+1],h[x+2]),u.lineTo(h[x+3],h[x+4]),u.lineTo(h[x+5],h[x+6]),u.closePath(),a||u.fill(),x+=6;break;case s.STROKE_TRIANGLE:u.beginPath(),u.moveTo(h[x+1],h[x+2]),u.lineTo(h[x+3],h[x+4]),u.lineTo(h[x+5],h[x+6]),u.closePath(),a||u.stroke(),x+=6;break;case s.LINE_TO:u.lineTo(h[x+1],h[x+2]),x+=2;break;case s.MOVE_TO:u.moveTo(h[x+1],h[x+2]),x+=2;break;case s.LINE_FX_TO:u.lineTo(h[x+1],h[x+2]),x+=5;break;case s.MOVE_FX_TO:u.moveTo(h[x+1],h[x+2]),x+=5;break;case s.SAVE:u.save();break;case s.RESTORE:u.restore();break;case s.TRANSLATE:u.translate(h[x+1],h[x+2]),x+=2;break;case s.SCALE:u.scale(h[x+1],h[x+2]),x+=2;break;case s.ROTATE:u.rotate(h[x+1]),x+=1;break;case s.GRADIENT_FILL_STYLE:x+=5;break;case s.GRADIENT_LINE_STYLE:x+=6}}u.restore()}}},41286:(t,e,i)=>{var s=i(99325),n=i(33182);s.register("graphics",(function(t,e){void 0===t&&(t={}),void 0!==e&&(t.add=e);var i=new n(this.scene,t);return t.add&&this.scene.sys.displayList.add(i),i}))},13122:(t,e,i)=>{var s=i(33182);i(61286).register("graphics",(function(t){return this.displayList.add(new s(this.scene,t))}))},60898:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(34429),n=i(91543),n=i(91543),t.exports={renderWebGL:s,renderCanvas:n}},34429:(t,e,i)=>{var s=i(36266),n=i(73329),r=i(69360),o=i(75512),a=function(t,e,i){this.x=t,this.y=e,this.width=i},h=function(t,e,i){this.points=[],this.pointsLength=1,this.points[0]=new a(t,e,i)},l=[],u=new r;t.exports=function(t,e,i,r){if(0!==e.commandBuffer.length){i.addToRenderList(e);var c=t.pipelines.set(e.pipeline,e);t.pipelines.preBatch(e);for(var d=n(e,i,r).calc,p=u.loadIdentity(),f=e.commandBuffer,v=i.alpha*e.alpha,g=1,m=c.fillTint,y=c.strokeTint,x=0,T=0,w=0,b=2*Math.PI,E=[],S=0,A=!0,_=null,C=o.getTintAppendFloatAlpha,M=0;M0&&(X=X%b-b):X>b?X=b:X<0&&(X=b+X%b),null===_&&(_=new h(B+Math.cos(U)*Y,N+Math.sin(U)*Y,g),E.push(_),I+=.01);I<1+G;)w=X*I+U,x=B+Math.cos(w)*Y,T=N+Math.sin(w)*Y,_.points.push(new a(x,T,g)),I+=.01;w=X+U,x=B+Math.cos(w)*Y,T=N+Math.sin(w)*Y,_.points.push(new a(x,T,g));break;case s.FILL_RECT:c.batchFillRect(f[++M],f[++M],f[++M],f[++M],p,d);break;case s.FILL_TRIANGLE:c.batchFillTriangle(f[++M],f[++M],f[++M],f[++M],f[++M],f[++M],p,d);break;case s.STROKE_TRIANGLE:c.batchStrokeTriangle(f[++M],f[++M],f[++M],f[++M],f[++M],f[++M],g,p,d);break;case s.LINE_TO:null!==_?_.points.push(new a(f[++M],f[++M],g)):(_=new h(f[++M],f[++M],g),E.push(_));break;case s.MOVE_TO:_=new h(f[++M],f[++M],g),E.push(_);break;case s.SAVE:l.push(p.copyToArray());break;case s.RESTORE:p.copyFromArray(l.pop());break;case s.TRANSLATE:B=f[++M],N=f[++M],p.translate(B,N);break;case s.SCALE:B=f[++M],N=f[++M],p.scale(B,N);break;case s.ROTATE:p.rotate(f[++M])}t.pipelines.postBatch(e)}}},59192:(t,e,i)=>{var s=i(83979),n=i(56694),r=i(56631),o=i(6659),a=i(71608),h=i(72632),l=i(10850),u=i(42911),c=i(75757),d=i(58403),p=i(13747),f=new n({Extends:o,initialize:function(t,e,i){o.call(this),i?e&&!Array.isArray(e)&&(e=[e]):Array.isArray(e)?u(e[0])&&(i=e,e=null):u(e)&&(i=e,e=null),this.scene=t,this.children=new d,this.isParent=!0,this.type="Group",this.classType=h(i,"classType",p),this.name=h(i,"name",""),this.active=h(i,"active",!0),this.maxSize=h(i,"maxSize",-1),this.defaultKey=h(i,"defaultKey",null),this.defaultFrame=h(i,"defaultFrame",null),this.runChildUpdate=h(i,"runChildUpdate",!1),this.createCallback=h(i,"createCallback",null),this.removeCallback=h(i,"removeCallback",null),this.createMultipleCallback=h(i,"createMultipleCallback",null),this.internalCreateCallback=h(i,"internalCreateCallback",null),this.internalRemoveCallback=h(i,"internalRemoveCallback",null),e&&this.addMultiple(e),i&&this.createMultiple(i),this.on(r.ADDED_TO_SCENE,this.addedToScene,this),this.on(r.REMOVED_FROM_SCENE,this.removedFromScene,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},create:function(t,e,i,s,n,r){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.defaultKey),void 0===s&&(s=this.defaultFrame),void 0===n&&(n=!0),void 0===r&&(r=!0),this.isFull())return null;var o=new this.classType(this.scene,t,e,i,s);return o.addToDisplayList(this.scene.sys.displayList),o.addToUpdateList(),o.visible=n,o.setActive(r),this.add(o),o},createMultiple:function(t){if(this.isFull())return[];Array.isArray(t)||(t=[t]);var e=[];if(t[0].key)for(var i=0;i=0;u--)if((l=d[u]).active===i){if(++c===e)break}else l=null;return l?("number"==typeof n&&(l.x=n),"number"==typeof r&&(l.y=r),l):s?this.create(n,r,o,a,h):null},get:function(t,e,i,s,n){return this.getFirst(!1,!0,t,e,i,s,n)},getFirstAlive:function(t,e,i,s,n,r){return this.getFirst(!0,t,e,i,s,n,r)},getFirstDead:function(t,e,i,s,n,r){return this.getFirst(!1,t,e,i,s,n,r)},playAnimation:function(t,e){return s.PlayAnimation(this.children.entries,t,e),this},isFull:function(){return-1!==this.maxSize&&this.children.size>=this.maxSize},countActive:function(t){void 0===t&&(t=!0);for(var e=0,i=0;i{var s=i(99325),n=i(59192);s.register("group",(function(t){return new n(this.scene,null,t)}))},62598:(t,e,i)=>{var s=i(59192);i(61286).register("group",(function(t,e){return this.updateList.add(new s(this.scene,t,e))}))},1539:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(89980),o=i(57322),a=new s({Extends:r,Mixins:[n.Alpha,n.BlendMode,n.Depth,n.Flip,n.FX,n.GetBounds,n.Mask,n.Origin,n.Pipeline,n.ScrollFactor,n.Size,n.TextureCrop,n.Tint,n.Transform,n.Visible,o],initialize:function(t,e,i,s,n){r.call(this,t,"Image"),this._crop=this.resetCropObject(),this.setTexture(s,n),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline()}});t.exports=a},57786:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),t.batchSprite(e,e.frame,i,s)}},83556:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(1539);n.register("image",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"frame",null),a=new o(this.scene,0,0,i,n);return void 0!==e&&(t.add=e),s(this.scene,a,t),a}))},20927:(t,e,i)=>{var s=i(1539);i(61286).register("image",(function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))}))},57322:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(59390),n=i(57786),t.exports={renderWebGL:s,renderCanvas:n}},59390:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),this.pipeline.batchSprite(e,i,s)}},48013:(t,e,i)=>{var s={Events:i(56631),DisplayList:i(91713),GameObjectCreator:i(99325),GameObjectFactory:i(61286),UpdateList:i(92034),Components:i(64937),GetCalcMatrix:i(73329),BuildGameObject:i(88933),BuildGameObjectAnimation:i(32291),GameObject:i(89980),BitmapText:i(44616),Blitter:i(52816),Bob:i(41664),Container:i(70339),DOMElement:i(38943),DynamicBitmapText:i(13468),Extern:i(39419),Graphics:i(33182),Group:i(59192),Image:i(1539),Layer:i(85305),Particles:i(27684),PathFollower:i(29598),RenderTexture:i(15996),RetroFont:i(55873),Rope:i(79968),Sprite:i(13747),Text:i(76555),GetTextSize:i(32979),MeasureText:i(27030),TextStyle:i(74744),TileSprite:i(35856),Zone:i(71030),Video:i(8630),Shape:i(91461),Arc:i(28593),Curve:i(15220),Ellipse:i(28591),Grid:i(39169),IsoBox:i(4415),IsoTriangle:i(65159),Line:i(579),Polygon:i(91249),Rectangle:i(517),Star:i(77843),Triangle:i(21873),Factories:{Blitter:i(38906),Container:i(23400),DOMElement:i(66788),DynamicBitmapText:i(94145),Extern:i(41155),Graphics:i(13122),Group:i(62598),Image:i(20927),Layer:i(17676),Particles:i(30439),PathFollower:i(19626),RenderTexture:i(29599),Rope:i(31982),Sprite:i(66135),StaticBitmapText:i(21797),Text:i(94627),TileSprite:i(20509),Zone:i(34546),Video:i(215),Arc:i(10369),Curve:i(10147),Ellipse:i(99869),Grid:i(9326),IsoBox:i(88154),IsoTriangle:i(67765),Line:i(85665),Polygon:i(88203),Rectangle:i(94355),Star:i(23962),Triangle:i(79296)},Creators:{Blitter:i(68452),Container:i(44516),DynamicBitmapText:i(67513),Graphics:i(41286),Group:i(61295),Image:i(83556),Layer:i(56378),Particles:i(38842),RenderTexture:i(85692),Rope:i(96027),Sprite:i(89219),StaticBitmapText:i(95499),Text:i(75397),TileSprite:i(63950),Zone:i(24067),Video:i(65601)}};s.Shader=i(27902),s.Mesh=i(83321),s.PointLight=i(13171),s.Factories.Shader=i(51979),s.Factories.Mesh=i(8767),s.Factories.PointLight=i(91201),s.Creators.Shader=i(13908),s.Creators.Mesh=i(41839),s.Creators.PointLight=i(162),s.Light=i(14455),s.LightsManager=i(26193),s.LightsPlugin=i(50296),t.exports=s},85305:(t,e,i)=>{var s=i(95723),n=i(56694),r=i(64937),o=i(48129),a=i(81078),h=i(6659),l=i(56631),u=i(71207),c=i(58010),d=i(7599),p=i(17922),f=new n({Extends:u,Mixins:[r.AlphaSingle,r.BlendMode,r.Depth,r.Mask,r.Pipeline,r.Visible,h,c],initialize:function(t,e){u.call(this,t),h.call(this),this.scene=t,this.displayList=null,this.type="Layer",this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.systems=t.sys,this.events=t.sys.events,this.sortChildrenFlag=!1,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.initPipeline(),this.clearAlpha(),this.setBlendMode(s.SKIP_CHECK),e&&this.add(e),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new a(this)),this},setData:function(t,e){return this.data||(this.data=new a(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new a(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new a(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new a(this)),this.data.get(t)},setInteractive:function(){return this},disableInteractive:function(){return this},removeInteractive:function(){return this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return o(this)},willRender:function(t){return!(15!==this.renderFlags||0===this.list.length||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return i.unshift(this.displayList.getIndex(t)),i},addChildCallback:function(t){t.displayList&&t.displayList!==this&&t.removeFromDisplayList(),t.displayList||(this.queueDepthSort(),t.displayList=this,t.emit(l.ADDED_TO_SCENE,t,this.scene),this.events.emit(d.ADDED_TO_SCENE,t,this.scene))},removeChildCallback:function(t){this.queueDepthSort(),t.displayList=null,t.emit(l.REMOVED_FROM_SCENE,t,this.scene),this.events.emit(d.REMOVED_FROM_SCENE,t,this.scene)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(p(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},getChildren:function(){return this.list},addToDisplayList:function(t){return void 0===t&&(t=this.scene.sys.displayList),this.displayList&&this.displayList!==t&&this.removeFromDisplayList(),t.exists(this)||(this.displayList=t,t.add(this,!0),t.queueDepthSort(),this.emit(l.ADDED_TO_SCENE,this,this.scene),t.events.emit(d.ADDED_TO_SCENE,this,this.scene)),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(l.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(d.REMOVED_FROM_SCENE,this,this.scene)),this},destroy:function(){if(this.scene&&!this.ignoreDestroy){this.emit(l.DESTROY,this);for(var t=this.list.length;t--;)this.list[t].destroy();this.removeAllListeners(),this.resetPostPipeline(!0),this.displayList&&(this.displayList.remove(this,!0),this.displayList.queueDepthSort()),this.data&&(this.data.destroy(),this.data=void 0),this.active=!1,this.visible=!1,this.list=void 0,this.scene=void 0,this.displayList=void 0,this.systems=void 0,this.events=void 0}}});t.exports=f},834:t=>{t.exports=function(t,e,i){var s=e.list;if(0!==s.length){e.depthSort();var n=-1!==e.blendMode;n||t.setBlendMode(0);var r=e._alpha;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var o=0;o{var s=i(88933),n=i(85305),r=i(99325),o=i(20494);r.register("layer",(function(t,e){void 0===t&&(t={});var i=o(t,"children",null),r=new n(this.scene,i);return void 0!==e&&(t.add=e),s(this.scene,r,t),r}))},17676:(t,e,i)=>{var s=i(85305);i(61286).register("layer",(function(t){return this.displayList.add(new s(this.scene,t))}))},58010:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(17576),n=i(834),t.exports={renderWebGL:s,renderCanvas:n}},17576:t=>{t.exports=function(t,e,i){var s=e.list,n=s.length;if(0!==n){e.depthSort(),t.pipelines.preBatch(e);var r=-1!==e.blendMode;r||t.setBlendMode(0);for(var o=e.alpha,a=0;a{var s=i(26673),n=i(56694),r=i(64937),o=i(39298),a=i(75512),h=new n({Extends:s,Mixins:[r.ScrollFactor,r.Visible],initialize:function(t,e,i,n,r,a,h){s.call(this,t,e,i),this.color=new o(n,r,a),this.intensity=h,this.renderFlags=15,this.cameraFilter=0,this.setScrollFactor(1,1)},willRender:function(t){return!(h.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},setColor:function(t){var e=a.getFloatsFromUintRGB(t);return this.color.set(e[0],e[1],e[2]),this},setIntensity:function(t){return this.intensity=t,this},setRadius:function(t){return this.radius=t,this}});h.RENDER_MASK=15,t.exports=h},26193:(t,e,i)=>{var s=i(26535),n=i(56694),r=i(53996),o=i(14455),a=i(13171),h=i(39298),l=i(72677),u=i(17922),c=i(75512),d=new n({initialize:function(){this.lights=[],this.ambientColor=new h(.1,.1,.1),this.active=!1,this.maxLights=-1,this.visibleLights=0},addPointLight:function(t,e,i,s,n,r){return this.systems.displayList.add(new a(this.scene,t,e,i,s,n,r))},enable:function(){return-1===this.maxLights&&(this.maxLights=this.systems.renderer.config.maxLights),this.active=!0,this},disable:function(){return this.active=!1,this},getLights:function(t){for(var e=this.lights,i=t.worldView,n=[],o=0;othis.maxLights&&(u(n,this.sortByDistance),n=n.slice(0,this.maxLights)),this.visibleLights=n.length,n},sortByDistance:function(t,e){return t.distance>=e.distance},setAmbientColor:function(t){var e=c.getFloatsFromUintRGB(t);return this.ambientColor.set(e[0],e[1],e[2]),this},getMaxVisibleLights:function(){return this.maxLights},getLightCount:function(){return this.lights.length},addLight:function(t,e,i,s,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=128),void 0===s&&(s=16777215),void 0===n&&(n=1);var r=c.getFloatsFromUintRGB(s),a=new o(t,e,i,r[0],r[1],r[2],n);return this.lights.push(a),a},removeLight:function(t){var e=this.lights.indexOf(t);return e>=0&&l(this.lights,e),this},shutdown:function(){this.lights.length=0},destroy:function(){this.shutdown()}});t.exports=d},50296:(t,e,i)=>{var s=i(56694),n=i(26193),r=i(91963),o=i(7599),a=new s({Extends:n,initialize:function(t){this.scene=t,this.systems=t.sys,t.sys.settings.isBooted||t.sys.events.once(o.BOOT,this.boot,this),n.call(this)},boot:function(){var t=this.systems.events;t.on(o.SHUTDOWN,this.shutdown,this),t.on(o.DESTROY,this.destroy,this)},destroy:function(){this.shutdown(),this.scene=void 0,this.systems=void 0}});r.register("LightsPlugin",a,"lights"),t.exports=a},83321:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(75606),o=i(18693),a=i(89980),h=i(67623),l=i(53267),u=i(73329),c=i(16650),d=i(23464),p=i(17922),f=i(70015),v=i(85769),g=new s({Extends:a,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Mask,n.Pipeline,n.Size,n.Texture,n.Transform,n.Visible,n.ScrollFactor,d],initialize:function(t,e,i,s,n,r,o,h,l,u,d,p){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s="__WHITE"),a.call(this,t,"Mesh"),this.faces=[],this.vertices=[],this.tintFill=!1,this.debugCallback=null,this.debugGraphic=null,this.hideCCW=!0,this.modelPosition=new f,this.modelScale=new f(1,1,1),this.modelRotation=new f,this.dirtyCache=[0,0,0,0,0,0,0,0,0,0,0,0],this.transformMatrix=new c,this.viewPosition=new f,this.viewMatrix=new c,this.projectionMatrix=new c,this.totalRendered=0,this.totalFrame=0,this.ignoreDirtyCache=!1;var v=t.sys.renderer;this.setPosition(e,i),this.setTexture(s,n),this.setSize(v.width,v.height),this.initPipeline(),this.setPerspective(v.width,v.height),r&&this.addVertices(r,o,h,l,u,d,p)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},panX:function(t){return this.viewPosition.addScale(f.LEFT,t),this.dirtyCache[10]=1,this},panY:function(t){return this.viewPosition.y+=f.DOWN.y*t,this.dirtyCache[10]=1,this},panZ:function(t){return this.viewPosition.z+=t,this.dirtyCache[10]=1,this},setPerspective:function(t,e,i,s,n){return void 0===i&&(i=45),void 0===s&&(s=.01),void 0===n&&(n=1e3),this.projectionMatrix.perspective(r(i),t/e,s,n),this.dirtyCache[10]=1,this.dirtyCache[11]=0,this},setOrtho:function(t,e,i,s){return void 0===t&&(t=this.scene.sys.renderer.getAspectRatio()),void 0===e&&(e=1),void 0===i&&(i=-1e3),void 0===s&&(s=1e3),this.projectionMatrix.ortho(-t,t,-e,e,i,s),this.dirtyCache[10]=1,this.dirtyCache[11]=1,this},clear:function(){return this.faces.forEach((function(t){t.destroy()})),this.faces=[],this.vertices=[],this},addVerticesFromObj:function(t,e,i,s,n,r,o,a,h){var u=this.scene.sys.cache.obj.get(t);return u&&l(u,this,e,i,s,n,r,o,a,h),this},sortByDepth:function(t,e){return t.depth-e.depth},depthSort:function(){return p(this.faces,this.sortByDepth),this},addVertex:function(t,e,i,s,n,r,o){var a=new v(t,e,i,s,n,r,o);return this.vertices.push(a),a},addFace:function(t,e,i){var s=new o(t,e,i);return this.faces.push(s),this.dirtyCache[9]=-1,s},addVertices:function(t,e,i,s,n,r,o){var a=h(t,e,i,s,n,r,o);return a&&(this.faces=this.faces.concat(a.faces),this.vertices=this.vertices.concat(a.vertices)),this.dirtyCache[9]=-1,this},getFaceCount:function(){return this.faces.length},getVertexCount:function(){return this.vertices.length},getFace:function(t){return this.faces[t]},getFaceAt:function(t,e,i){void 0===i&&(i=this.scene.sys.cameras.main);for(var s=u(this,i).calc,n=this.faces,r=[],o=0;o{t.exports=function(){}},41839:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(10850),a=i(83321);n.register("mesh",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"frame",null),h=o(t,"vertices",[]),l=o(t,"uvs",[]),u=o(t,"indicies",[]),c=o(t,"containsZ",!1),d=o(t,"normals",[]),p=o(t,"colors",16777215),f=o(t,"alphas",1),v=new a(this.scene,0,0,i,n,h,l,u,c,d,p,f);return void 0!==e&&(t.add=e),s(this.scene,v,t),v}))},8767:(t,e,i)=>{var s=i(83321);i(61286).register("mesh",(function(t,e,i,n,r,o,a,h,l,u,c){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a,h,l,u,c))}))},23464:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(57410),n=i(6317),t.exports={renderWebGL:s,renderCanvas:n}},57410:(t,e,i)=>{var s=i(73329);t.exports=function(t,e,i,n){var r=e.faces,o=r.length;if(0!==o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline,e),h=s(e,i,n).calc,l=a.setGameObject(e),u=a.vertexViewF32,c=a.vertexViewU32,d=a.vertexCount*a.currentShader.vertexComponentCount-1,p=e.tintFill,f=[],v=e.debugCallback,g=h.a,m=h.b,y=h.c,x=h.d,T=h.e,w=h.f,b=e.viewPosition.z,E=e.hideCCW,S=i.roundPixels,A=i.alpha*e.alpha,_=0;t.pipelines.preBatch(e);for(var C=0;C{var s=i(56694),n=i(61616),r=i(21902),o=i(72632),a=i(1071),h=new s({initialize:function(t,e,i,s){void 0===s&&(s=!1),this.propertyKey=e,this.propertyValue=i,this.defaultValue=i,this.steps=0,this.counter=0,this.start=0,this.end=0,this.ease,this.emitOnly=s,this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,this.loadConfig(t)},loadConfig:function(t,e){void 0===t&&(t={}),e&&(this.propertyKey=e),this.propertyValue=o(t,this.propertyKey,this.defaultValue),this.setMethods(),this.emitOnly&&(this.onUpdate=this.defaultUpdate)},toJSON:function(){return this.propertyValue},onChange:function(t){return this.propertyValue=t,this.setMethods()},setMethods:function(){var t=this.propertyValue,e=typeof t;if(this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,"number"===e)this.onEmit=this.staticValueEmit,this.onUpdate=this.staticValueUpdate;else if(Array.isArray(t))this.onEmit=this.randomStaticValueEmit;else if("function"===e)this.emitOnly?this.onEmit=t:this.onUpdate=t;else if("object"===e&&this.hasBoth(t,"start","end")){this.start=t.start,this.end=t.end;var i=this.has(t,"random");if(i&&(this.onEmit=this.randomRangedValueEmit),this.has(t,"steps"))this.steps=t.steps,this.counter=this.start,this.onEmit=this.steppedEmit;else{var s=this.has(t,"ease")?t.ease:"Linear";this.ease=r(s,t.easeParams),i||(this.onEmit=this.easedValueEmit),this.onUpdate=this.easeValueUpdate}}else if("object"===e&&this.hasBoth(t,"min","max"))this.start=t.min,this.end=t.max,this.onEmit=this.randomRangedValueEmit;else if("object"===e&&this.has(t,"random")){var n=t.random;Array.isArray(n)&&(this.start=n[0],this.end=n[1]),this.onEmit=this.randomRangedValueEmit}else"object"===e&&this.hasEither(t,"onEmit","onUpdate")&&(this.has(t,"onEmit")&&(this.onEmit=t.onEmit),this.has(t,"onUpdate")&&(this.onUpdate=t.onUpdate));return this},has:function(t,e){return t.hasOwnProperty(e)},hasBoth:function(t,e,i){return t.hasOwnProperty(e)&&t.hasOwnProperty(i)},hasEither:function(t,e,i){return t.hasOwnProperty(e)||t.hasOwnProperty(i)},defaultEmit:function(t,e,i){return i},defaultUpdate:function(t,e,i,s){return s},staticValueEmit:function(){return this.propertyValue},staticValueUpdate:function(){return this.propertyValue},randomStaticValueEmit:function(){var t=Math.floor(Math.random()*this.propertyValue.length);return this.propertyValue[t]},randomRangedValueEmit:function(t,e){var i=n(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i),i},steppedEmit:function(){var t=this.counter,e=this.counter+(this.end-this.start)/this.steps;return this.counter=a(e,this.start,this.end),t},easedValueEmit:function(t,e){if(t&&t.data[e]){var i=t.data[e];i.min=this.start,i.max=this.end}return this.start},easeValueUpdate:function(t,e,i){var s=t.data[e];return(s.max-s.min)*this.ease(i)+s.min}});t.exports=h},87811:(t,e,i)=>{var s=i(56694),n=i(72632),r=new s({initialize:function(t,e,i,s,r){if("object"==typeof t){var o=t;t=n(o,"x",0),e=n(o,"y",0),i=n(o,"power",0),s=n(o,"epsilon",100),r=n(o,"gravity",50)}else void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=100),void 0===r&&(r=50);this.x=t,this.y=e,this.active=!0,this._gravity=r,this._power=0,this._epsilon=0,this.power=i,this.epsilon=s},update:function(t,e){var i=this.x-t.x,s=this.y-t.y,n=i*i+s*s;if(0!==n){var r=Math.sqrt(n);n{var s=i(56694),n=i(75606),r=i(53996),o=new s({initialize:function(t){this.emitter=t,this.frame=null,this.x=0,this.y=0,this.velocityX=0,this.velocityY=0,this.accelerationX=0,this.accelerationY=0,this.maxVelocityX=1e4,this.maxVelocityY=1e4,this.bounce=0,this.scaleX=1,this.scaleY=1,this.alpha=1,this.angle=0,this.rotation=0,this.tint=16777215,this.life=1e3,this.lifeCurrent=1e3,this.delayCurrent=0,this.lifeT=0,this.data={tint:{min:16777215,max:16777215,current:16777215},alpha:{min:1,max:1},rotate:{min:0,max:0},scaleX:{min:1,max:1},scaleY:{min:1,max:1}}},isAlive:function(){return this.lifeCurrent>0},resetPosition:function(){this.x=0,this.y=0},fire:function(t,e){var i=this.emitter;if(this.frame=i.getFrame(),!this.frame)throw new Error("Particle has no texture frame");i.emitZone&&i.emitZone.getPoint(this),this.x+=void 0===t?i.x.onEmit(this,"x"):t,this.y+=void 0===e?i.y.onEmit(this,"y"):e,this.life=i.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0;var s=i.speedX.onEmit(this,"speedX"),o=i.speedY?i.speedY.onEmit(this,"speedY"):s;if(i.radial){var a=n(i.angle.onEmit(this,"angle"));this.velocityX=Math.cos(a)*Math.abs(s),this.velocityY=Math.sin(a)*Math.abs(o)}else if(i.moveTo){var h=i.moveToX.onEmit(this,"moveToX"),l=i.moveToY?i.moveToY.onEmit(this,"moveToY"):h,u=Math.atan2(l-this.y,h-this.x),c=r(this.x,this.y,h,l)/(this.life/1e3);this.velocityX=Math.cos(u)*c,this.velocityY=Math.sin(u)*c}else this.velocityX=s,this.velocityY=o;i.acceleration&&(this.accelerationX=i.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=i.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=i.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=i.maxVelocityY.onEmit(this,"maxVelocityY"),this.delayCurrent=i.delay.onEmit(this,"delay"),this.scaleX=i.scaleX.onEmit(this,"scaleX"),this.scaleY=i.scaleY?i.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=i.rotate.onEmit(this,"rotate"),this.rotation=n(this.angle),this.bounce=i.bounce.onEmit(this,"bounce"),this.alpha=i.alpha.onEmit(this,"alpha"),this.tint=i.tint.onEmit(this,"tint")},computeVelocity:function(t,e,i,s){var n=this.velocityX,r=this.velocityY,o=this.accelerationX,a=this.accelerationY,h=this.maxVelocityX,l=this.maxVelocityY;n+=t.gravityX*i,r+=t.gravityY*i,o&&(n+=o*i),a&&(r+=a*i),n>h?n=h:n<-h&&(n=-h),r>l?r=l:r<-l&&(r=-l),this.velocityX=n,this.velocityY=r;for(var u=0;ue.right&&t.collideRight&&(this.x=e.right,this.velocityX*=i),this.ye.bottom&&t.collideBottom&&(this.y=e.bottom,this.velocityY*=i)},update:function(t,e,i){if(this.delayCurrent>0)return this.delayCurrent-=t,!1;var s=this.emitter,r=1-this.lifeCurrent/this.life;return this.lifeT=r,this.computeVelocity(s,t,e,i),this.x+=this.velocityX*e,this.y+=this.velocityY*e,s.bounds&&this.checkBounds(s),s.deathZone&&s.deathZone.willKill(this)?(this.lifeCurrent=0,!0):(this.scaleX=s.scaleX.onUpdate(this,"scaleX",r,this.scaleX),s.scaleY?this.scaleY=s.scaleY.onUpdate(this,"scaleY",r,this.scaleY):this.scaleY=this.scaleX,this.angle=s.rotate.onUpdate(this,"rotate",r,this.angle),this.rotation=n(this.angle),this.alpha=s.alpha.onUpdate(this,"alpha",r,this.alpha),this.tint=s.tint.onUpdate(this,"tint",r,this.tint),this.lifeCurrent-=t,this.lifeCurrent<=0)}});t.exports=o},9216:(t,e,i)=>{var s=i(95723),n=i(56694),r=i(64937),o=i(69361),a=i(54213),h=i(93025),l=i(72632),u=i(72861),c=i(53523),d=i(19256),p=i(14909),f=i(68433),v=i(74118),g=i(17922),m=i(93736),y=i(1071),x=new n({Mixins:[r.BlendMode,r.Mask,r.ScrollFactor,r.Visible],initialize:function(t,e){this.manager=t,this.texture=t.texture,this.frames=[t.defaultFrame],this.defaultFrame=t.defaultFrame,this.configFastMap=["active","blendMode","collideBottom","collideLeft","collideRight","collideTop","deathCallback","deathCallbackScope","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxParticles","name","on","particleBringToTop","particleClass","radial","timeScale","trackVisible","visible"],this.configOpMap=["accelerationX","accelerationY","angle","alpha","bounce","delay","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],this.name="",this.particleClass=p,this.x=new h(e,"x",0,!0),this.y=new h(e,"y",0,!0),this.radial=!0,this.gravityX=0,this.gravityY=0,this.acceleration=!1,this.accelerationX=new h(e,"accelerationX",0,!0),this.accelerationY=new h(e,"accelerationY",0,!0),this.maxVelocityX=new h(e,"maxVelocityX",1e4,!0),this.maxVelocityY=new h(e,"maxVelocityY",1e4,!0),this.speedX=new h(e,"speedX",0,!0),this.speedY=new h(e,"speedY",0,!0),this.moveTo=!1,this.moveToX=new h(e,"moveToX",0,!0),this.moveToY=new h(e,"moveToY",0,!0),this.bounce=new h(e,"bounce",0,!0),this.scaleX=new h(e,"scaleX",1),this.scaleY=new h(e,"scaleY",1),this.tint=new h(e,"tint",16777215),this.alpha=new h(e,"alpha",1),this.lifespan=new h(e,"lifespan",1e3,!0),this.angle=new h(e,"angle",{min:0,max:360},!0),this.rotate=new h(e,"rotate",0),this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.maxParticles=0,this.quantity=new h(e,"quantity",1,!0),this.delay=new h(e,"delay",0,!0),this.frequency=0,this.on=!0,this.particleBringToTop=!0,this.timeScale=1,this.emitZone=null,this.deathZone=null,this.bounds=null,this.collideLeft=!0,this.collideRight=!0,this.collideTop=!0,this.collideBottom=!0,this.active=!0,this.visible=!0,this.blendMode=s.NORMAL,this.follow=null,this.followOffset=new m,this.trackVisible=!1,this.currentFrame=0,this.randomFrame=!0,this.frameQuantity=1,this.dead=[],this.alive=[],this._counter=0,this._frameCounter=0,e&&this.fromJSON(e)},fromJSON:function(t){if(!t)return this;var e=0,i="";for(e=0;e0&&this.getParticleCount()===this.maxParticles},onParticleEmit:function(t,e){return void 0===t?(this.emitCallback=null,this.emitCallbackScope=null):"function"==typeof t&&(this.emitCallback=t,e&&(this.emitCallbackScope=e)),this},onParticleDeath:function(t,e){return void 0===t?(this.deathCallback=null,this.deathCallbackScope=null):"function"==typeof t&&(this.deathCallback=t,e&&(this.deathCallbackScope=e)),this},killAll:function(){for(var t=this.dead,e=this.alive;e.length>0;)t.push(e.pop());return this},forEachAlive:function(t,e){for(var i=this.alive,s=i.length,n=0;n0){var u=this.deathCallback,c=this.deathCallbackScope;for(o=h-1;o>=0;o--){var d=a[o];n.splice(d.index,1),r.push(d.particle),u&&u.call(c,d.particle),d.particle.resetPosition()}}this.on&&(0===this.frequency?this.emitParticle():this.frequency>0&&(this._counter-=e,this._counter<=0&&(this.emitParticle(),this._counter=this.frequency-Math.abs(this._counter))))},depthSortCallback:function(t,e){return t.y-e.y}});t.exports=x},84622:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(89980),o=i(87811),a=i(71207),h=i(9216),l=i(72745),u=new s({Extends:r,Mixins:[n.Depth,n.Mask,n.Pipeline,n.Transform,n.Visible,l],initialize:function(t,e,i,s){if(r.call(this,t,"ParticleEmitterManager"),this.blendMode=-1,this.timeScale=1,this.texture=null,this.frame=null,this.frameNames=[],null===i||"object"!=typeof i&&!Array.isArray(i)||(s=i,i=null),this.setTexture(e,i),this.initPipeline(),this.emitters=new a(this),this.wells=new a(this),s){Array.isArray(s)||(s=[s]);for(var n=0;n0?e.defaultFrame=i[0]:(console.warn("No texture frames were set"),e.defaultFrame=this.defaultFrame),this},addEmitter:function(t){return this.emitters.add(t)},createEmitter:function(t){return this.addEmitter(new h(this,t))},removeEmitter:function(t){return this.emitters.remove(t,!0)},addGravityWell:function(t){return this.wells.add(t)},createGravityWell:function(t){return this.addGravityWell(new o(t))},emitParticle:function(t,e,i){for(var s=this.emitters.list,n=0;n{var s=i(69360),n=new s,r=new s,o=new s,a=new s;t.exports=function(t,e,i,s){var h=e.emitters.list,l=h.length;if(0!==l){var u=n.copyFrom(i.matrix),c=r,d=o,p=a;s?(p.loadIdentity(),p.multiply(s),p.translate(e.x,e.y),p.rotate(e.rotation),p.scale(e.scaleX,e.scaleY)):p.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);for(var f=t.currentContext,v=i.roundPixels,g=0;g{var s=i(99325),n=i(20494),r=i(72632),o=i(84622);s.register("particles",(function(t,e){void 0===t&&(t={});var i=n(t,"key",null),s=n(t,"frame",null),a=r(t,"emitters",null),h=new o(this.scene,i,s,a);return void 0!==e&&(t.add=e),r(t,"add",!1)?this.displayList.add(h):this.updateList.add(h),h}))},30439:(t,e,i)=>{var s=i(61286),n=i(84622);s.register("particles",(function(t,e,i){return this.displayList.add(new n(this.scene,t,e,i))}))},72745:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(58971),n=i(66545),t.exports={renderWebGL:s,renderCanvas:n}},58971:(t,e,i)=>{var s=i(69360),n=i(75512),r=new s,o=new s,a=new s,h=new s;t.exports=function(t,e,i,s){var l=e.emitters.list,u=l.length;if(0!==u){var c=t.pipelines.set(e.pipeline),d=r,p=o,f=a,v=h;s?(v.loadIdentity(),v.multiply(s),v.translate(e.x,e.y),v.rotate(e.rotation),v.scale(e.scaleX,e.scaleY)):v.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var g=i.roundPixels,m=e.defaultFrame.glTexture,y=n.getTintAppendFloatAlpha,x=c.setGameObject(e,e.defaultFrame);t.pipelines.preBatch(e);for(var T=0;T{t.exports={EmitterOp:i(93025),GravityWell:i(87811),Particle:i(14909),ParticleEmitter:i(9216),ParticleEmitterManager:i(84622),Zones:i(25962)}},69361:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e){this.source=t,this.killOnEnter=e},willKill:function(t){var e=this.source.contains(t.x,t.y);return e&&this.killOnEnter||!e&&!this.killOnEnter}});t.exports=s},54213:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s,n){void 0===s&&(s=!1),void 0===n&&(n=!0),this.source=t,this.points=[],this.quantity=e,this.stepRate=i,this.yoyo=s,this.counter=-1,this.seamless=n,this._length=0,this._direction=0,this.updateSource()},updateSource:function(){if(this.points=this.source.getPoints(this.quantity,this.stepRate),this.seamless){var t=this.points[0],e=this.points[this.points.length-1];t.x===e.x&&t.y===e.y&&this.points.pop()}var i=this._length;return this._length=this.points.length,this._lengththis._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=s},68433:(t,e,i)=>{var s=i(56694),n=i(93736),r=new s({initialize:function(t){this.source=t,this._tempVec=new n},getPoint:function(t){var e=this._tempVec;this.source.getRandomPoint(e),t.x=e.x,t.y=e.y}});t.exports=r},25962:(t,e,i)=>{t.exports={DeathZone:i(69361),EdgeZone:i(54213),RandomZone:i(68433)}},29598:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(13747),o=new s({Extends:r,Mixins:[n.PathFollower],initialize:function(t,e,i,s,n,o){r.call(this,t,i,s,n,o),this.path=e},preUpdate:function(t,e){this.anims.update(t,e),this.pathUpdate(t)}});t.exports=o},19626:(t,e,i)=>{var s=i(61286),n=i(29598);s.register("follower",(function(t,e,i,s,r){var o=new n(this.scene,t,e,i,s,r);return this.displayList.add(o),this.updateList.add(o),o}))},13171:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(89980),o=i(74853),a=i(65641),h=i(71606),l=new s({Extends:r,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.GetBounds,n.Mask,n.Pipeline,n.ScrollFactor,n.Transform,n.Visible,h],initialize:function(t,e,i,s,n,h,l){void 0===s&&(s=16777215),void 0===n&&(n=128),void 0===h&&(h=1),void 0===l&&(l=.1),r.call(this,t,"PointLight"),this.initPipeline(a.POINTLIGHT_PIPELINE),this.setPosition(e,i),this.color=o(s),this.intensity=h,this.attenuation=l,this.width=2*n,this.height=2*n,this._radius=n},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this.width=2*t,this.height=2*t}},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return this._radius}},displayOriginY:{get:function(){return this._radius}}});t.exports=l},162:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(13171);n.register("pointlight",(function(t,e){void 0===t&&(t={});var i=r(t,"color",16777215),n=r(t,"radius",128),a=r(t,"intensity",1),h=r(t,"attenuation",.1),l=new o(this.scene,0,0,i,n,a,h);return void 0!==e&&(t.add=e),s(this.scene,l,t),l}))},91201:(t,e,i)=>{var s=i(61286),n=i(13171);s.register("pointlight",(function(t,e,i,s,r,o){return this.displayList.add(new n(this.scene,t,e,i,s,r,o))}))},71606:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(80590),t.exports={renderWebGL:s,renderCanvas:n}},80590:(t,e,i)=>{var s=i(73329);t.exports=function(t,e,i,n){i.addToRenderList(e);var r=t.pipelines.set(e.pipeline),o=s(e,i,n).calc,a=e.width,h=e.height,l=-e._radius,u=-e._radius,c=l+a,d=u+h,p=o.getX(0,0),f=o.getY(0,0),v=o.getX(l,u),g=o.getY(l,u),m=o.getX(l,d),y=o.getY(l,d),x=o.getX(c,d),T=o.getY(c,d),w=o.getX(c,u),b=o.getY(c,u);t.pipelines.preBatch(e),r.batchPointLight(e,i,v,g,m,y,x,T,w,b,p,f),t.pipelines.postBatch(e)}},15996:(t,e,i)=>{var s=i(95723),n=i(51052),r=i(61068),o=i(56694),a=i(64937),h=i(86459),l=i(82047),u=i(89980),c=i(72283),d=i(65641),p=i(92675),f=i(37410),v=i(75512),g=i(76583),m=new o({Extends:u,Mixins:[a.Alpha,a.BlendMode,a.ComputedSize,a.Crop,a.Depth,a.Flip,a.FX,a.GetBounds,a.Mask,a.Origin,a.Pipeline,a.ScrollFactor,a.Tint,a.Transform,a.Visible,p],initialize:function(t,e,i,s,o,a,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=32),void 0===o&&(o=32),u.call(this,t,"RenderTexture"),this.renderer=t.sys.renderer,this.textureManager=t.sys.textures,this.globalTint=16777215,this.globalAlpha=1,this.canvas=null,this.dirty=!1,this._crop=this.resetCropObject(),this.texture=null,this.frame=null,this._saved=!1,void 0===a?(this.canvas=r.create2D(this,s,o),this.texture=t.sys.textures.addCanvas(g(),this.canvas),this.frame=this.texture.get()):(this.texture=t.sys.textures.get(a),this.frame=this.texture.get(l),this.canvas=this.frame.source.image,this._saved=!0,this.dirty=!0,this.width=this.frame.cutWidth,this.height=this.frame.cutHeight),this.context=this.canvas.getContext("2d"),this._eraseMode=!1,this.camera=new n(0,0,s,o),this.renderTarget=null;var p=this.renderer;p?p.type===h.WEBGL?(this.drawGameObject=this.batchGameObjectWebGL,this.renderTarget=new f(p,s,o,1,0,!1)):p.type===h.CANVAS&&(this.drawGameObject=this.batchGameObjectCanvas):this.drawGameObject=c,this.camera.setScene(t),this.setPosition(e,i),void 0===a&&this.setSize(s,o),this.setOrigin(0,0),this.initPipeline(d.SINGLE_PIPELINE)},setSize:function(t,e){return this.resize(t,e)},resize:function(t,e){void 0===e&&(e=t);var i=this.frame;if(t!==this.width||e!==this.height){if("__BASE"===i.name){this.canvas.width=t,this.canvas.height=e,this.texture.width=t,this.texture.height=e;var s=this.renderTarget;s&&(s.resize(t,e),i.glTexture=s.texture,i.source.isRenderTexture=!0,i.source.isGLTexture=!0,i.source.glTexture=s.texture),this.camera.setSize(t,e),i.source.width=t,i.source.height=e,i.setSize(t,e),this.width=t,this.height=e}}else{var n=this.texture.getSourceImage();i.cutX+t>n.width&&(t=n.width-i.cutX),i.cutY+e>n.height&&(e=n.height-i.cutY),i.setSize(t,e,i.cutX,i.cutY)}this.updateDisplayOrigin();var r=this.input;return r&&!r.customHitArea&&(r.hitArea.width=t,r.hitArea.height=e),this},setGlobalTint:function(t){return this.globalTint=t,this},setGlobalAlpha:function(t){return this.globalAlpha=t,this},saveTexture:function(t){return this.textureManager.renameTexture(this.texture.key,t),this._saved=!0,this.texture},fill:function(t,e,i,s,n,r){var o=this.frame,a=this.camera,h=this.renderer;void 0===e&&(e=1),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=o.cutWidth),void 0===r&&(r=o.cutHeight);var l=(t>>16&255)/255,u=(t>>8&255)/255,c=(255&t)/255,d=this.renderTarget;if(a.preRender(),d){d.bind(!0);var p=this.pipeline;p.manager.set(p);var f=d.width,g=d.height,m=h.width/f,y=h.height/g;p.drawFillRect(i*m,s*y,n*m,r*y,v.getTintFromFloats(c,u,l,1),e),d.unbind(!0)}else{var x=this.context;h.setContext(x),x.fillStyle="rgba("+l+","+u+","+c+","+e+")",x.fillRect(i+o.cutX,s+o.cutY,n,r),h.setContext()}return this.dirty=!0,this},clear:function(){if(this.dirty){var t=this.renderTarget;if(t)t.clear();else{var e=this.context;e.save(),e.setTransform(1,0,0,1,0,0),e.clearRect(this.frame.cutX,this.frame.cutY,this.frame.cutWidth,this.frame.cutHeight),e.restore()}this.dirty=!1}return this},erase:function(t,e,i){return this._eraseMode=!0,this.draw(t,e,i,1,16777215),this._eraseMode=!1,this},draw:function(t,e,i,s,n){return this.beginDraw(),this.batchDraw(t,e,i,s,n),this.endDraw(),this},drawFrame:function(t,e,i,s,n,r){return this.beginDraw(),this.batchDrawFrame(t,e,i,s,n,r),this.endDraw(),this},beginDraw:function(){var t=this.camera,e=this.renderer,i=this.renderTarget;return t.preRender(),i?e.beginCapture(i.width,i.height):e.setContext(this.context),this},batchDraw:function(t,e,i,s,n){return void 0===s&&(s=this.globalAlpha),n=void 0===n?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(n>>16)+(65280&n)+((255&n)<<16),Array.isArray(t)||(t=[t]),this.batchList(t,e,i,s,n),this},batchDrawFrame:function(t,e,i,s,n,r){void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=this.globalAlpha),r=void 0===r?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(r>>16)+(65280&r)+((255&r)<<16);var o=this.textureManager.getFrame(t,e);return o&&(this.renderTarget?this.pipeline.batchTextureFrame(o,i,s,r,n,this.camera.matrix,null):this.batchTextureFrame(o,i+this.frame.cutX,s+this.frame.cutY,n,r)),this},endDraw:function(t){void 0===t&&(t=this._eraseMode);var e=this.renderer,i=this.renderTarget;if(i){var s=e.endCapture();e.pipelines.setUtility().blitFrame(s,i,1,!1,!1,t),e.resetScissor(),e.resetViewport()}else e.setContext();return this.dirty=!0,this},batchList:function(t,e,i,s,n){for(var r=0;r{t.exports=function(t,e,i,s){i.addToRenderList(e),t.batchSprite(e,e.frame,i,s)}},85692:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(15996);n.register("renderTexture",(function(t,e){void 0===t&&(t={});var i=r(t,"x",0),n=r(t,"y",0),a=r(t,"width",32),h=r(t,"height",32),l=r(t,"key",void 0),u=r(t,"frame",void 0),c=new o(this.scene,i,n,a,h,l,u);return void 0!==e&&(t.add=e),s(this.scene,c,t),c}))},29599:(t,e,i)=>{var s=i(61286),n=i(15996);s.register("renderTexture",(function(t,e,i,s,r,o){return this.displayList.add(new n(this.scene,t,e,i,s,r,o))}))},92675:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(46823),n=i(43267),t.exports={renderWebGL:s,renderCanvas:n}},46823:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i,n){i.addToRenderList(e);var r=i.alpha,o=e.renderTarget,a=o.width,h=o.height,l=s.getTintAppendFloatAlpha,u=t.pipelines.set(e.pipeline),c=u.setTexture2D(o.texture);u.batchTexture(e,o.texture,a,h,e.x,e.y,a,h,e.scaleX,e.scaleY,e.rotation,e.flipX,!e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,a,h,l(e.tintTopLeft,r*e._alphaTL),l(e.tintTopRight,r*e._alphaTR),l(e.tintBottomLeft,r*e._alphaBL),l(e.tintBottomRight,r*e._alphaBR),e.tintFill,0,0,i,n,!0,c),t.resetTextures()}},79968:(t,e,i)=>{var s=i(16569),n=i(56694),r=i(64937),o=i(89980),a=i(65641),h=i(58912),l=i(93736),u=new n({Extends:o,Mixins:[r.AlphaSingle,r.BlendMode,r.Depth,r.Flip,r.Mask,r.Pipeline,r.Size,r.Texture,r.Transform,r.Visible,r.ScrollFactor,h],initialize:function(t,e,i,n,r,h,u,c,d){void 0===n&&(n="__DEFAULT"),void 0===h&&(h=2),void 0===u&&(u=!0),o.call(this,t,"Rope"),this.anims=new s(this),this.points=h,this.vertices,this.uv,this.colors,this.alphas,this.tintFill="__DEFAULT"===n,this.dirty=!1,this.horizontal=u,this._flipX=!1,this._flipY=!1,this._perp=new l,this.debugCallback=null,this.debugGraphic=null,this.setTexture(n,r),this.setPosition(e,i),this.setSizeToFrame(),this.initPipeline(a.ROPE_PIPELINE),Array.isArray(h)&&this.resizeArrays(h.length),this.setPoints(h,c,d),this.updateVertices()},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){var i=this.anims.currentFrame;this.anims.update(t,e),this.anims.currentFrame!==i&&(this.updateUVs(),this.updateVertices())},play:function(t,e,i){return this.anims.play(t,e,i),this},setDirty:function(){return this.dirty=!0,this},setHorizontal:function(t,e,i){return void 0===t&&(t=this.points.length),this.horizontal?this:(this.horizontal=!0,this.setPoints(t,e,i))},setVertical:function(t,e,i){return void 0===t&&(t=this.points.length),this.horizontal?(this.horizontal=!1,this.setPoints(t,e,i)):this},setTintFill:function(t){return void 0===t&&(t=!1),this.tintFill=t,this},setAlphas:function(t,e){var i=this.points.length;if(i<1)return this;var s,n=this.alphas;void 0===t?t=[1]:Array.isArray(t)||void 0!==e||(t=[t]);var r=0;if(void 0!==e)for(s=0;sr&&(o=t[r]),n[r]=o,t.length>r+1&&(o=t[r+1]),n[r+1]=o}return this},setColors:function(t){var e=this.points.length;if(e<1)return this;var i,s=this.colors;void 0===t?t=[16777215]:Array.isArray(t)||(t=[t]);var n=0;if(t.length===e)for(i=0;in&&(r=t[n]),s[n]=r,t.length>n+1&&(r=t[n+1]),s[n+1]=r}return this},setPoints:function(t,e,i){if(void 0===t&&(t=2),"number"==typeof t){var s,n,r,o=t;if(o<2&&(o=2),t=[],this.horizontal)for(r=-this.frame.halfWidth,n=this.frame.width/(o-1),s=0;s{t.exports=function(){}},96027:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(10850),a=i(79968);n.register("rope",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"frame",null),h=r(t,"horizontal",!0),l=o(t,"points",void 0),u=o(t,"colors",void 0),c=o(t,"alphas",void 0),d=new a(this.scene,0,0,i,n,l,h,u,c);return void 0!==e&&(t.add=e),s(this.scene,d,t),t.add||this.updateList.add(d),d}))},31982:(t,e,i)=>{var s=i(79968);i(61286).register("rope",(function(t,e,i,n,r,o,a,h){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a,h))}))},58912:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(49489),n=i(44598),t.exports={renderWebGL:s,renderCanvas:n}},49489:(t,e,i)=>{var s=i(73329),n=i(75512);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline,e),a=s(e,i,r).calc,h=e.vertices,l=e.uv,u=e.colors,c=e.alphas,d=e.alpha,p=n.getTintAppendFloatAlpha,f=i.roundPixels,v=h.length,g=Math.floor(.5*v);o.flush(),t.pipelines.preBatch(e);var m=o.setGameObject(e),y=o.vertexViewF32,x=o.vertexViewU32,T=o.vertexCount*o.currentShader.vertexComponentCount-1,w=0,b=e.tintFill;e.dirty&&e.updateVertices();for(var E=e.debugCallback,S=[],A=0;A{var s=i(56694),n=i(64937),r=i(89980),o=i(72632),a=i(98611),h=i(22440),l=i(24252),u=i(69360),c=new s({Extends:r,Mixins:[n.ComputedSize,n.Depth,n.GetBounds,n.Mask,n.Origin,n.ScrollFactor,n.Transform,n.Visible,l],initialize:function(t,e,i,s,n,o,a,h){void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=128),void 0===o&&(o=128),r.call(this,t,"Shader"),this.blendMode=-1,this.shader;var l=t.sys.renderer;this.renderer=l,this.gl=l.gl,this.vertexData=new ArrayBuffer(2*Float32Array.BYTES_PER_ELEMENT*6),this.vertexBuffer=l.createVertexBuffer(this.vertexData.byteLength,this.gl.STREAM_DRAW),this.program=null,this.bytes=new Uint8Array(this.vertexData),this.vertexViewF32=new Float32Array(this.vertexData),this._tempMatrix1=new u,this._tempMatrix2=new u,this._tempMatrix3=new u,this.viewMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.projectionMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.uniforms={},this.pointer=null,this._rendererWidth=l.width,this._rendererHeight=l.height,this._textureCount=0,this.framebuffer=null,this.glTexture=null,this.renderToTexture=!1,this.texture=null,this.setPosition(i,s),this.setSize(n,o),this.setOrigin(.5,.5),this.setShader(e,a,h)},willRender:function(t){return!!this.renderToTexture||!(r.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},setRenderToTexture:function(t,e){if(void 0===e&&(e=!1),!this.renderToTexture){var i=this.width,s=this.height,n=this.renderer;this.glTexture=n.createTextureFromSource(null,i,s,0),this.glTexture.flipY=e,this.framebuffer=n.createFramebuffer(i,s,this.glTexture,!1),this._rendererWidth=i,this._rendererHeight=s,this.renderToTexture=!0,this.projOrtho(0,this.width,this.height,0),t&&(this.texture=this.scene.sys.textures.addGLTexture(t,this.glTexture,i,s))}return this.shader&&(n.pipelines.clear(),this.load(),this.flush(),n.pipelines.rebind()),this},setShader:function(t,e,i){if(void 0===e&&(e=[]),"string"==typeof t){var s=this.scene.sys.cache.shader;if(!s.has(t))return console.warn("Shader missing: "+t),this;this.shader=s.get(t)}else this.shader=t;var n=this.gl,r=this.renderer;this.program&&n.deleteProgram(this.program);var o=r.createProgram(this.shader.vertexSrc,this.shader.fragmentSrc);n.uniformMatrix4fv(n.getUniformLocation(o,"uViewMatrix"),!1,this.viewMatrix),n.uniformMatrix4fv(n.getUniformLocation(o,"uProjectionMatrix"),!1,this.projectionMatrix),n.uniform2f(n.getUniformLocation(o,"uResolution"),this.width,this.height),this.program=o;var h=new Date,l={resolution:{type:"2f",value:{x:this.width,y:this.height}},time:{type:"1f",value:0},mouse:{type:"2f",value:{x:this.width/2,y:this.height/2}},date:{type:"4fv",value:[h.getFullYear(),h.getMonth(),h.getDate(),60*h.getHours()*60+60*h.getMinutes()+h.getSeconds()]},sampleRate:{type:"1f",value:44100},iChannel0:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel1:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel2:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel3:{type:"sampler2D",value:null,textureData:{repeat:!0}}};this.shader.uniforms?this.uniforms=a(!0,{},this.shader.uniforms,l):this.uniforms=l;for(var u=0;u<4;u++)e[u]&&this.setSampler2D("iChannel"+u,e[u],u,i);return this.initUniforms(),this.projOrtho(0,this._rendererWidth,this._rendererHeight,0),this},setPointer:function(t){return this.pointer=t,this},projOrtho:function(t,e,i,s){var n=1/(t-e),r=1/(i-s),o=this.projectionMatrix;o[0]=-2*n,o[5]=-2*r,o[10]=-.001,o[12]=(t+e)*n,o[13]=(s+i)*r,o[14]=-0;var a=this.program,h=this.gl;this.renderer.setProgram(a),h.uniformMatrix4fv(h.getUniformLocation(a,"uProjectionMatrix"),!1,this.projectionMatrix),this._rendererWidth=e,this._rendererHeight=i},initUniforms:function(){var t=this.gl,e=this.renderer.glFuncMap,i=this.program;for(var s in this._textureCount=0,this.uniforms){var n=this.uniforms[s],r=n.type,o=e[r];n.uniformLocation=t.getUniformLocation(i,s),"sampler2D"!==r&&(n.glMatrix=o.matrix,n.glValueLength=o.length,n.glFunc=o.func)}},setSampler2DBuffer:function(t,e,i,s,n,r){void 0===n&&(n=0),void 0===r&&(r={});var o=this.uniforms[t];return o.value=e,r.width=i,r.height=s,o.textureData=r,this._textureCount=n,this.initSampler2D(o),this},setSampler2D:function(t,e,i,s){void 0===i&&(i=0);var n=this.scene.sys.textures;if(n.exists(e)){var r=n.getFrame(e);if(r.glTexture&&r.glTexture.isRenderTexture)return this.setSampler2DBuffer(t,r.glTexture,r.width,r.height,i,s);var o=this.uniforms[t],a=r.source;o.textureKey=e,o.source=a.image,o.value=r.glTexture,a.isGLTexture&&(s||(s={}),s.width=a.width,s.height=a.height),s&&(o.textureData=s),this._textureCount=i,this.initSampler2D(o)}return this},setUniform:function(t,e){return h(this.uniforms,t,e),this},getUniform:function(t){return o(this.uniforms,t,null)},setChannel0:function(t,e){return this.setSampler2D("iChannel0",t,0,e)},setChannel1:function(t,e){return this.setSampler2D("iChannel1",t,1,e)},setChannel2:function(t,e){return this.setSampler2D("iChannel2",t,2,e)},setChannel3:function(t,e){return this.setSampler2D("iChannel3",t,3,e)},initSampler2D:function(t){if(t.value){var e=this.gl;e.activeTexture(e.TEXTURE0+this._textureCount),e.bindTexture(e.TEXTURE_2D,t.value);var i=t.textureData;if(i&&!t.value.isRenderTexture){var s=e[o(i,"magFilter","linear").toUpperCase()],n=e[o(i,"minFilter","linear").toUpperCase()],r=e[o(i,"wrapS","repeat").toUpperCase()],a=e[o(i,"wrapT","repeat").toUpperCase()],h=e[o(i,"format","rgba").toUpperCase()];if(i.repeat&&(r=e.REPEAT,a=e.REPEAT),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!!i.flipY),i.width){var l=o(i,"width",512),u=o(i,"height",2),c=o(i,"border",0);e.texImage2D(e.TEXTURE_2D,0,h,l,u,c,h,e.UNSIGNED_BYTE,null)}else e.texImage2D(e.TEXTURE_2D,0,h,e.RGBA,e.UNSIGNED_BYTE,t.source);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,s),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,n),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,a)}this.renderer.setProgram(this.program),e.uniform1i(t.uniformLocation,this._textureCount),this._textureCount++}},syncUniforms:function(){var t,e,i,s,n,r=this.gl,o=this.uniforms,a=0;for(var h in o)i=(t=o[h]).glFunc,e=t.glValueLength,s=t.uniformLocation,null!==(n=t.value)&&(1===e?t.glMatrix?i.call(r,s,t.transpose,n):i.call(r,s,n):2===e?i.call(r,s,n.x,n.y):3===e?i.call(r,s,n.x,n.y,n.z):4===e?i.call(r,s,n.x,n.y,n.z,n.w):"sampler2D"===t.type&&(r.activeTexture(r.TEXTURE0+a),r.bindTexture(r.TEXTURE_2D,n),r.uniform1i(s,a),a++))},load:function(t){var e=this.gl,i=this.width,s=this.height,n=this.renderer,r=this.program,o=this.viewMatrix;if(!this.renderToTexture){var a=-this._displayOriginX,h=-this._displayOriginY;o[0]=t[0],o[1]=t[1],o[4]=t[2],o[5]=t[3],o[8]=t[4],o[9]=t[5],o[12]=o[0]*a+o[4]*h,o[13]=o[1]*a+o[5]*h}e.useProgram(r),e.uniformMatrix4fv(e.getUniformLocation(r,"uViewMatrix"),!1,o),e.uniform2f(e.getUniformLocation(r,"uResolution"),this.width,this.height);var l=this.uniforms,u=l.resolution;u.value.x=i,u.value.y=s,l.time.value=n.game.loop.getDuration();var c=this.pointer;if(c){var d=l.mouse,p=c.x/i,f=1-c.y/s;d.value.x=p.toFixed(2),d.value.y=f.toFixed(2)}this.syncUniforms()},flush:function(){var t=this.width,e=this.height,i=this.program,s=this.gl,n=this.vertexBuffer,r=this.renderer,o=2*Float32Array.BYTES_PER_ELEMENT;this.renderToTexture&&(r.setFramebuffer(this.framebuffer),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT)),s.bindBuffer(s.ARRAY_BUFFER,n);var a=s.getAttribLocation(i,"inPosition");-1!==a&&(s.enableVertexAttribArray(a),s.vertexAttribPointer(a,2,s.FLOAT,!1,o,0));var h=this.vertexViewF32;h[3]=e,h[4]=t,h[5]=e,h[8]=t,h[9]=e,h[10]=t;s.bufferSubData(s.ARRAY_BUFFER,0,this.bytes.subarray(0,6*o)),s.drawArrays(s.TRIANGLES,0,6),this.renderToTexture&&r.setFramebuffer(null,!1)},setAlpha:function(){},setBlendMode:function(){},preDestroy:function(){var t=this.gl;t.deleteProgram(this.program),t.deleteBuffer(this.vertexBuffer),this.renderToTexture&&(this.renderer.deleteFramebuffer(this.framebuffer),this.texture.destroy(),this.framebuffer=null,this.glTexture=null,this.texture=null)}});t.exports=c},10612:t=>{t.exports=function(){}},13908:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(27902);n.register("shader",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"x",0),a=r(t,"y",0),h=r(t,"width",128),l=r(t,"height",128),u=new o(this.scene,i,n,a,h,l);return void 0!==e&&(t.add=e),s(this.scene,u,t),u}))},51979:(t,e,i)=>{var s=i(27902);i(61286).register("shader",(function(t,e,i,n,r,o,a){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a))}))},24252:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(19782),n=i(10612),t.exports={renderWebGL:s,renderCanvas:n}},19782:(t,e,i)=>{var s=i(73329);t.exports=function(t,e,i,n){if(e.shader){if(i.addToRenderList(e),t.pipelines.clear(),e.renderToTexture)e.load(),e.flush();else{var r=s(e,i,n).calc;t.width===e._rendererWidth&&t.height===e._rendererHeight||e.projOrtho(0,t.width,t.height,0),e.load(r.matrix),e.flush()}t.pipelines.rebind()}}},19543:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i,n,r,o){for(var a=s.getTintAppendFloatAlpha(i.fillColor,i.fillAlpha*n),h=i.pathData,l=i.pathIndexes,u=0;u{t.exports=function(t,e,i,s){var n=i||e.fillColor,r=s||e.fillAlpha,o=(16711680&n)>>>16,a=(65280&n)>>>8,h=255&n;t.fillStyle="rgba("+o+","+a+","+h+","+r+")"}},17876:t=>{t.exports=function(t,e,i,s){var n=i||e.strokeColor,r=s||e.strokeAlpha,o=(16711680&n)>>>16,a=(65280&n)>>>8,h=255&n;t.strokeStyle="rgba("+o+","+a+","+h+","+r+")",t.lineWidth=e.lineWidth}},91461:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(89980),o=i(88829),a=new s({Extends:r,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.GetBounds,n.Mask,n.Origin,n.Pipeline,n.ScrollFactor,n.Transform,n.Visible],initialize:function(t,e,i){void 0===e&&(e="Shape"),r.call(this,t,e),this.geom=i,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new o,this.width=0,this.height=0,this.initPipeline()},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.isFilled=!1:(this.fillColor=t,this.fillAlpha=e,this.isFilled=!0),this},setStrokeStyle:function(t,e,i){return void 0===i&&(i=1),void 0===t?this.isStroked=!1:(this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this.isStroked=!0),this},setClosePath:function(t){return this.closePath=t,this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}}});t.exports=a},50262:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i,n,r){var o=t.strokeTint,a=s.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*i);o.TL=a,o.TR=a,o.BL=a,o.BR=a;var h=e.pathData,l=h.length-1,u=e.lineWidth,c=u/2,d=h[0]-n,p=h[1]-r;e.closePath||(l-=2);for(var f=2;f{var s=i(2213),n=i(56694),r=i(75606),o=i(11117),a=i(26673),h=i(83392),l=i(91461),u=new n({Extends:l,Mixins:[s],initialize:function(t,e,i,s,n,r,o,h,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===n&&(n=0),void 0===r&&(r=360),void 0===o&&(o=!1),l.call(this,t,"Arc",new a(0,0,s)),this._startAngle=n,this._endAngle=r,this._anticlockwise=o,this._iterations=.01,this.setPosition(e,i);var c=2*this.geom.radius;this.setSize(c,c),void 0!==h&&this.setFillStyle(h,u),this.updateDisplayOrigin(),this.updateData()},iterations:{get:function(){return this._iterations},set:function(t){this._iterations=t,this.updateData()}},radius:{get:function(){return this.geom.radius},set:function(t){this.geom.radius=t;var e=2*t;this.setSize(e,e),this.updateDisplayOrigin(),this.updateData()}},startAngle:{get:function(){return this._startAngle},set:function(t){this._startAngle=t,this.updateData()}},endAngle:{get:function(){return this._endAngle},set:function(t){this._endAngle=t,this.updateData()}},anticlockwise:{get:function(){return this._anticlockwise},set:function(t){this._anticlockwise=t,this.updateData()}},setRadius:function(t){return this.radius=t,this},setIterations:function(t){return void 0===t&&(t=.01),this.iterations=t,this},setStartAngle:function(t,e){return this._startAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},setEndAngle:function(t,e){return this._endAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},updateData:function(){var t=this._iterations,e=t,i=this.geom.radius,s=r(this._startAngle),n=r(this._endAngle),a=i,l=i;n-=s,this._anticlockwise?n<-h.PI2?n=-h.PI2:n>0&&(n=-h.PI2+n%h.PI2):n>h.PI2?n=h.PI2:n<0&&(n=h.PI2+n%h.PI2);for(var u,c=[a+Math.cos(s)*i,l+Math.sin(s)*i];e<1;)u=n*e+s,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),e+=t;return u=n+s,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),c.push(a+Math.cos(s)*i,l+Math.sin(s)*i),this.pathIndexes=o(c),this.pathData=c,this}});t.exports=u},23560:(t,e,i)=>{var s=i(75606),n=i(15608),r=i(17876),o=i(49584);t.exports=function(t,e,i,a){i.addToRenderList(e);var h=t.currentContext;if(o(t,h,e,i,a)){var l=e.radius;h.beginPath(),h.arc(l-e.originX*(2*l),l-e.originY*(2*l),l,s(e._startAngle),s(e._endAngle),e.anticlockwise),e.closePath&&h.closePath(),e.isFilled&&(n(h,e),h.fill()),e.isStroked&&(r(h,e),h.stroke()),h.restore()}}},10369:(t,e,i)=>{var s=i(28593),n=i(61286);n.register("arc",(function(t,e,i,n,r,o,a,h){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a,h))})),n.register("circle",(function(t,e,i,n,r){return this.displayList.add(new s(this.scene,t,e,i,0,360,!1,n,r))}))},2213:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(58356),n=i(23560),t.exports={renderWebGL:s,renderCanvas:n}},58356:(t,e,i)=>{var s=i(73329),n=i(19543),r=i(50262);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=s(e,i,o),l=a.calcMatrix.copyFrom(h.calc),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&n(a,l,e,d,u,c),e.isStroked&&r(a,e,d,u,c),t.pipelines.postBatch(e)}},15220:(t,e,i)=>{var s=i(56694),n=i(87203),r=i(11117),o=i(74118),a=i(91461),h=new s({Extends:a,Mixins:[n],initialize:function(t,e,i,s,n,r){void 0===e&&(e=0),void 0===i&&(i=0),a.call(this,t,"Curve",s),this._smoothness=32,this._curveBounds=new o,this.closePath=!1,this.setPosition(e,i),void 0!==n&&this.setFillStyle(n,r),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){var t=this._curveBounds,e=this._smoothness;this.geom.getBounds(t,e),this.setSize(t.width,t.height),this.updateDisplayOrigin();for(var i=[],s=this.geom.getPoints(e),n=0;n{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=e._displayOriginX+e._curveBounds.x,l=e._displayOriginY+e._curveBounds.y,u=e.pathData,c=u.length-1,d=u[0]-h,p=u[1]-l;a.beginPath(),a.moveTo(d,p),e.closePath||(c-=2);for(var f=2;f{var s=i(61286),n=i(15220);s.register("curve",(function(t,e,i,s,r){return this.displayList.add(new n(this.scene,t,e,i,s,r))}))},87203:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(82958),n=i(4024),t.exports={renderWebGL:s,renderCanvas:n}},82958:(t,e,i)=>{var s=i(19543),n=i(73329),r=i(50262);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=n(e,i,o),l=a.calcMatrix.copyFrom(h.calc),u=e._displayOriginX+e._curveBounds.x,c=e._displayOriginY+e._curveBounds.y,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&s(a,l,e,d,u,c),e.isStroked&&r(a,e,d,u,c),t.pipelines.postBatch(e)}},28591:(t,e,i)=>{var s=i(56694),n=i(11117),r=i(84171),o=i(95669),a=i(91461),h=new s({Extends:a,Mixins:[r],initialize:function(t,e,i,s,n,r,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===n&&(n=128),a.call(this,t,"Ellipse",new o(s/2,n/2,s,n)),this._smoothness=64,this.setPosition(e,i),this.width=s,this.height=n,void 0!==r&&this.setFillStyle(r,h),this.updateDisplayOrigin(),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSize:function(t,e){return this.width=t,this.height=e,this.geom.setPosition(t/2,e/2),this.geom.setSize(t,e),this.updateData()},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){for(var t=[],e=this.geom.getPoints(this._smoothness),i=0;i{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY,u=e.pathData,c=u.length-1,d=u[0]-h,p=u[1]-l;a.beginPath(),a.moveTo(d,p),e.closePath||(c-=2);for(var f=2;f{var s=i(28591);i(61286).register("ellipse",(function(t,e,i,n,r,o){return this.displayList.add(new s(this.scene,t,e,i,n,r,o))}))},84171:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(17554),n=i(55881),t.exports={renderWebGL:s,renderCanvas:n}},17554:(t,e,i)=>{var s=i(19543),n=i(73329),r=i(50262);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=n(e,i,o),l=a.calcMatrix.copyFrom(h.calc),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&s(a,l,e,d,u,c),e.isStroked&&r(a,e,d,u,c),t.pipelines.postBatch(e)}},39169:(t,e,i)=>{var s=i(56694),n=i(91461),r=i(88059),o=new s({Extends:n,Mixins:[r],initialize:function(t,e,i,s,r,o,a,h,l,u,c){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===r&&(r=128),void 0===o&&(o=32),void 0===a&&(a=32),n.call(this,t,"Grid",null),this.cellWidth=o,this.cellHeight=a,this.showCells=!0,this.outlineFillColor=0,this.outlineFillAlpha=0,this.showOutline=!0,this.showAltCells=!1,this.altFillColor,this.altFillAlpha,this.setPosition(e,i),this.setSize(s,r),this.setFillStyle(h,l),void 0!==u&&this.setOutlineStyle(u,c),this.updateDisplayOrigin()},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showCells=!1:(this.fillColor=t,this.fillAlpha=e,this.showCells=!0),this},setAltFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showAltCells=!1:(this.altFillColor=t,this.altFillAlpha=e,this.showAltCells=!0),this},setOutlineStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showOutline=!1:(this.outlineFillColor=t,this.outlineFillAlpha=e,this.showOutline=!0),this}});t.exports=o},95525:(t,e,i)=>{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=-e._displayOriginX,l=-e._displayOriginY,u=i.alpha*e.alpha,c=e.width,d=e.height,p=e.cellWidth,f=e.cellHeight,v=Math.ceil(c/p),g=Math.ceil(d/f),m=p,y=f,x=p-(v*p-c),T=f-(g*f-d),w=e.showCells,b=e.showAltCells,E=e.showOutline,S=0,A=0,_=0,C=0,M=0;if(E&&(m--,y--,x===p&&x--,T===f&&T--),w&&e.fillAlpha>0)for(s(a,e),A=0;A0)for(s(a,e,e.altFillColor,e.altFillAlpha*u),A=0;A0){for(n(a,e,e.outlineFillColor,e.outlineFillAlpha*u),S=1;S{var s=i(61286),n=i(39169);s.register("grid",(function(t,e,i,s,r,o,a,h,l,u){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a,h,l,u))}))},88059:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(50639),n=i(95525),t.exports={renderWebGL:s,renderCanvas:n}},50639:(t,e,i)=>{var s=i(73329),n=i(75512);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),a=s(e,i,r);o.calcMatrix.copyFrom(a.calc).translate(-e._displayOriginX,-e._displayOriginY);var h,l,u=i.alpha*e.alpha,c=e.width,d=e.height,p=e.cellWidth,f=e.cellHeight,v=Math.ceil(c/p),g=Math.ceil(d/f),m=p,y=f,x=p-(v*p-c),T=f-(g*f-d),w=e.showCells,b=e.showAltCells,E=e.showOutline,S=0,A=0,_=0,C=0,M=0;if(E&&(m--,y--,x===p&&x--,T===f&&T--),t.pipelines.preBatch(e),w&&e.fillAlpha>0)for(h=o.fillTint,l=n.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*u),h.TL=l,h.TR=l,h.BL=l,h.BR=l,A=0;A0)for(h=o.fillTint,l=n.getTintAppendFloatAlpha(e.altFillColor,e.altFillAlpha*u),h.TL=l,h.TR=l,h.BL=l,h.BR=l,A=0;A0){var R=o.strokeTint,P=n.getTintAppendFloatAlpha(e.outlineFillColor,e.outlineFillAlpha*u);for(R.TL=P,R.TR=P,R.BL=P,R.BR=P,S=1;S{var s=i(72296),n=i(56694),r=i(91461),o=new n({Extends:r,Mixins:[s],initialize:function(t,e,i,s,n,o,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=48),void 0===n&&(n=32),void 0===o&&(o=15658734),void 0===a&&(a=10066329),void 0===h&&(h=13421772),r.call(this,t,"IsoBox",null),this.projection=4,this.fillTop=o,this.fillLeft=a,this.fillRight=h,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isFilled=!0,this.setPosition(e,i),this.setSize(s,n),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=o},32884:(t,e,i)=>{var s=i(15608),n=i(49584);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.currentContext;if(n(t,o,e,i,r)&&e.isFilled){var a=e.width,h=e.height,l=a/2,u=a/e.projection;e.showTop&&(s(o,e,e.fillTop),o.beginPath(),o.moveTo(-l,-h),o.lineTo(0,-u-h),o.lineTo(l,-h),o.lineTo(l,-1),o.lineTo(0,u-1),o.lineTo(-l,-1),o.lineTo(-l,-h),o.fill()),e.showLeft&&(s(o,e,e.fillLeft),o.beginPath(),o.moveTo(-l,0),o.lineTo(0,u),o.lineTo(0,u-h),o.lineTo(-l,-h),o.lineTo(-l,0),o.fill()),e.showRight&&(s(o,e,e.fillRight),o.beginPath(),o.moveTo(l,0),o.lineTo(0,u),o.lineTo(0,u-h),o.lineTo(l,-h),o.lineTo(l,0),o.fill()),o.restore()}}},88154:(t,e,i)=>{var s=i(61286),n=i(4415);s.register("isobox",(function(t,e,i,s,r,o,a){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a))}))},72296:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(33101),n=i(32884),t.exports={renderWebGL:s,renderCanvas:n}},33101:(t,e,i)=>{var s=i(73329),n=i(75512);t.exports=function(t,e,i,r){i.addToRenderList(e);var o,a,h,l,u,c,d,p,f,v=t.pipelines.set(e.pipeline),g=s(e,i,r),m=v.calcMatrix.copyFrom(g.calc),y=e.width,x=e.height,T=y/2,w=y/e.projection,b=i.alpha*e.alpha;e.isFilled&&(t.pipelines.preBatch(e),e.showTop&&(o=n.getTintAppendFloatAlpha(e.fillTop,b),a=m.getX(-T,-x),h=m.getY(-T,-x),l=m.getX(0,-w-x),u=m.getY(0,-w-x),c=m.getX(T,-x),d=m.getY(T,-x),p=m.getX(0,w-x),f=m.getY(0,w-x),v.batchQuad(e,a,h,l,u,c,d,p,f,0,0,1,1,o,o,o,o,2)),e.showLeft&&(o=n.getTintAppendFloatAlpha(e.fillLeft,b),a=m.getX(-T,0),h=m.getY(-T,0),l=m.getX(0,w),u=m.getY(0,w),c=m.getX(0,w-x),d=m.getY(0,w-x),p=m.getX(-T,-x),f=m.getY(-T,-x),v.batchQuad(e,a,h,l,u,c,d,p,f,0,0,1,1,o,o,o,o,2)),e.showRight&&(o=n.getTintAppendFloatAlpha(e.fillRight,b),a=m.getX(T,0),h=m.getY(T,0),l=m.getX(0,w),u=m.getY(0,w),c=m.getX(0,w-x),d=m.getY(0,w-x),p=m.getX(T,-x),f=m.getY(T,-x),v.batchQuad(e,a,h,l,u,c,d,p,f,0,0,1,1,o,o,o,o,2)),t.pipelines.postBatch(e))}},65159:(t,e,i)=>{var s=i(56694),n=i(93387),r=i(91461),o=new s({Extends:r,Mixins:[n],initialize:function(t,e,i,s,n,o,a,h,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=48),void 0===n&&(n=32),void 0===o&&(o=!1),void 0===a&&(a=15658734),void 0===h&&(h=10066329),void 0===l&&(l=13421772),r.call(this,t,"IsoTriangle",null),this.projection=4,this.fillTop=a,this.fillLeft=h,this.fillRight=l,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isReversed=o,this.isFilled=!0,this.setPosition(e,i),this.setSize(s,n),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setReversed:function(t){return this.isReversed=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=o},9923:(t,e,i)=>{var s=i(15608),n=i(49584);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.currentContext;if(n(t,o,e,i,r)&&e.isFilled){var a=e.width,h=e.height,l=a/2,u=a/e.projection,c=e.isReversed;e.showTop&&c&&(s(o,e,e.fillTop),o.beginPath(),o.moveTo(-l,-h),o.lineTo(0,-u-h),o.lineTo(l,-h),o.lineTo(0,u-h),o.fill()),e.showLeft&&(s(o,e,e.fillLeft),o.beginPath(),c?(o.moveTo(-l,-h),o.lineTo(0,u),o.lineTo(0,u-h)):(o.moveTo(-l,0),o.lineTo(0,u),o.lineTo(0,u-h)),o.fill()),e.showRight&&(s(o,e,e.fillRight),o.beginPath(),c?(o.moveTo(l,-h),o.lineTo(0,u),o.lineTo(0,u-h)):(o.moveTo(l,0),o.lineTo(0,u),o.lineTo(0,u-h)),o.fill()),o.restore()}}},67765:(t,e,i)=>{var s=i(61286),n=i(65159);s.register("isotriangle",(function(t,e,i,s,r,o,a,h){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a,h))}))},93387:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(54946),n=i(9923),t.exports={renderWebGL:s,renderCanvas:n}},54946:(t,e,i)=>{var s=i(73329),n=i(75512);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),a=s(e,i,r),h=o.calcMatrix.copyFrom(a.calc),l=e.width,u=e.height,c=l/2,d=l/e.projection,p=e.isReversed,f=i.alpha*e.alpha;if(e.isFilled){var v,g,m,y,x,T,w;if(t.pipelines.preBatch(e),e.showTop&&p){v=n.getTintAppendFloatAlpha(e.fillTop,f),g=h.getX(-c,-u),m=h.getY(-c,-u),y=h.getX(0,-d-u),x=h.getY(0,-d-u),T=h.getX(c,-u),w=h.getY(c,-u);var b=h.getX(0,d-u),E=h.getY(0,d-u);o.batchQuad(e,g,m,y,x,T,w,b,E,0,0,1,1,v,v,v,v,2)}e.showLeft&&(v=n.getTintAppendFloatAlpha(e.fillLeft,f),p?(g=h.getX(-c,-u),m=h.getY(-c,-u),y=h.getX(0,d),x=h.getY(0,d),T=h.getX(0,d-u),w=h.getY(0,d-u)):(g=h.getX(-c,0),m=h.getY(-c,0),y=h.getX(0,d),x=h.getY(0,d),T=h.getX(0,d-u),w=h.getY(0,d-u)),o.batchTri(e,g,m,y,x,T,w,0,0,1,1,v,v,v,2)),e.showRight&&(v=n.getTintAppendFloatAlpha(e.fillRight,f),p?(g=h.getX(c,-u),m=h.getY(c,-u),y=h.getX(0,d),x=h.getY(0,d),T=h.getX(0,d-u),w=h.getY(0,d-u)):(g=h.getX(c,0),m=h.getY(c,0),y=h.getX(0,d),x=h.getY(0,d),T=h.getX(0,d-u),w=h.getY(0,d-u)),o.batchTri(e,g,m,y,x,T,w,0,0,1,1,v,v,v,2)),t.pipelines.postBatch(e)}}},579:(t,e,i)=>{var s=i(56694),n=i(91461),r=i(88829),o=i(52660),a=new s({Extends:n,Mixins:[o],initialize:function(t,e,i,s,o,a,h,l,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===o&&(o=0),void 0===a&&(a=128),void 0===h&&(h=0),n.call(this,t,"Line",new r(s,o,a,h));var c=Math.max(1,this.geom.right-this.geom.left),d=Math.max(1,this.geom.bottom-this.geom.top);this.lineWidth=1,this._startWidth=1,this._endWidth=1,this.setPosition(e,i),this.setSize(c,d),void 0!==l&&this.setStrokeStyle(1,l,u),this.updateDisplayOrigin()},setLineWidth:function(t,e){return void 0===e&&(e=t),this._startWidth=t,this._endWidth=e,this.lineWidth=t,this},setTo:function(t,e,i,s){return this.geom.setTo(t,e,i,s),this}});t.exports=a},52044:(t,e,i)=>{var s=i(17876),n=i(49584);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.currentContext;if(n(t,o,e,i,r)){var a=e._displayOriginX,h=e._displayOriginY;e.isStroked&&(s(o,e),o.beginPath(),o.moveTo(e.geom.x1-a,e.geom.y1-h),o.lineTo(e.geom.x2-a,e.geom.y2-h),o.stroke()),o.restore()}}},85665:(t,e,i)=>{var s=i(61286),n=i(579);s.register("line",(function(t,e,i,s,r,o,a,h){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a,h))}))},52660:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(46952),n=i(52044),t.exports={renderWebGL:s,renderCanvas:n}},46952:(t,e,i)=>{var s=i(73329),n=i(75512);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),a=s(e,i,r);o.calcMatrix.copyFrom(a.calc);var h=e._displayOriginX,l=e._displayOriginY,u=i.alpha*e.alpha;if(t.pipelines.preBatch(e),e.isStroked){var c=o.strokeTint,d=n.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*u);c.TL=d,c.TR=d,c.BL=d,c.BR=d;var p=e._startWidth,f=e._endWidth;o.batchLine(e.geom.x1-h,e.geom.y1-l,e.geom.x2-h,e.geom.y2-l,p,f,1,0,!1,a.sprite,a.camera)}t.pipelines.postBatch(e)}},91249:(t,e,i)=>{var s=i(70573),n=i(56694),r=i(11117),o=i(14045),a=i(8580),h=i(91461),l=i(18974),u=new n({Extends:h,Mixins:[s],initialize:function(t,e,i,s,n,r){void 0===e&&(e=0),void 0===i&&(i=0),h.call(this,t,"Polygon",new a(s));var l=o(this.geom);this.setPosition(e,i),this.setSize(l.width,l.height),void 0!==n&&this.setFillStyle(n,r),this.updateDisplayOrigin(),this.updateData()},smooth:function(t){void 0===t&&(t=1);for(var e=0;e{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY,u=e.pathData,c=u.length-1,d=u[0]-h,p=u[1]-l;a.beginPath(),a.moveTo(d,p),e.closePath||(c-=2);for(var f=2;f{var s=i(61286),n=i(91249);s.register("polygon",(function(t,e,i,s,r){return this.displayList.add(new n(this.scene,t,e,i,s,r))}))},70573:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(72841),n=i(40834),t.exports={renderWebGL:s,renderCanvas:n}},72841:(t,e,i)=>{var s=i(19543),n=i(73329),r=i(50262);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=n(e,i,o),l=a.calcMatrix.copyFrom(h.calc),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&s(a,l,e,d,u,c),e.isStroked&&r(a,e,d,u,c),t.pipelines.postBatch(e)}},517:(t,e,i)=>{var s=i(56694),n=i(74118),r=i(91461),o=i(37673),a=new s({Extends:r,Mixins:[o],initialize:function(t,e,i,s,o,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===o&&(o=128),r.call(this,t,"Rectangle",new n(0,0,s,o)),this.setPosition(e,i),this.setSize(s,o),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},setSize:function(t,e){this.width=t,this.height=e,this.geom.setSize(t,e),this.updateData(),this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),e.getLineD(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=a},4091:(t,e,i)=>{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY;e.isFilled&&(s(a,e),a.fillRect(-h,-l,e.width,e.height)),e.isStroked&&(n(a,e),a.beginPath(),a.rect(-h,-l,e.width,e.height),a.stroke()),a.restore()}}},94355:(t,e,i)=>{var s=i(61286),n=i(517);s.register("rectangle",(function(t,e,i,s,r,o){return this.displayList.add(new n(this.scene,t,e,i,s,r,o))}))},37673:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(43532),n=i(4091),t.exports={renderWebGL:s,renderCanvas:n}},43532:(t,e,i)=>{var s=i(73329),n=i(50262),r=i(75512);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=s(e,i,o);a.calcMatrix.copyFrom(h.calc);var l=e._displayOriginX,u=e._displayOriginY,c=i.alpha*e.alpha;if(t.pipelines.preBatch(e),e.isFilled){var d=a.fillTint,p=r.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*c);d.TL=p,d.TR=p,d.BL=p,d.BR=p,a.batchFillRect(-l,-u,e.width,e.height)}e.isStroked&&n(a,e,c,l,u),t.pipelines.postBatch(e)}},77843:(t,e,i)=>{var s=i(87956),n=i(56694),r=i(11117),o=i(91461),a=new n({Extends:o,Mixins:[s],initialize:function(t,e,i,s,n,r,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=5),void 0===n&&(n=32),void 0===r&&(r=64),o.call(this,t,"Star",null),this._points=s,this._innerRadius=n,this._outerRadius=r,this.setPosition(e,i),this.setSize(2*r,2*r),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},setPoints:function(t){return this._points=t,this.updateData()},setInnerRadius:function(t){return this._innerRadius=t,this.updateData()},setOuterRadius:function(t){return this._outerRadius=t,this.updateData()},points:{get:function(){return this._points},set:function(t){this._points=t,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this.updateData()}},updateData:function(){var t=[],e=this._points,i=this._innerRadius,s=this._outerRadius,n=Math.PI/2*3,o=Math.PI/e,a=s,h=s;t.push(a,h+-s);for(var l=0;l{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY,u=e.pathData,c=u.length-1,d=u[0]-h,p=u[1]-l;a.beginPath(),a.moveTo(d,p),e.closePath||(c-=2);for(var f=2;f{var s=i(77843);i(61286).register("star",(function(t,e,i,n,r,o,a){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a))}))},87956:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(12037),n=i(11401),t.exports={renderWebGL:s,renderCanvas:n}},12037:(t,e,i)=>{var s=i(19543),n=i(73329),r=i(50262);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=n(e,i,o),l=a.calcMatrix.copyFrom(h.calc),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&s(a,l,e,d,u,c),e.isStroked&&r(a,e,d,u,c),t.pipelines.postBatch(e)}},21873:(t,e,i)=>{var s=i(56694),n=i(91461),r=i(66349),o=i(70498),a=new s({Extends:n,Mixins:[o],initialize:function(t,e,i,s,o,a,h,l,u,c,d){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===o&&(o=128),void 0===a&&(a=64),void 0===h&&(h=0),void 0===l&&(l=128),void 0===u&&(u=128),n.call(this,t,"Triangle",new r(s,o,a,h,l,u));var p=this.geom.right-this.geom.left,f=this.geom.bottom-this.geom.top;this.setPosition(e,i),this.setSize(p,f),void 0!==c&&this.setFillStyle(c,d),this.updateDisplayOrigin(),this.updateData()},setTo:function(t,e,i,s,n,r){return this.geom.setTo(t,e,i,s,n,r),this.updateData()},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=a},60213:(t,e,i)=>{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY,u=e.geom.x1-h,c=e.geom.y1-l,d=e.geom.x2-h,p=e.geom.y2-l,f=e.geom.x3-h,v=e.geom.y3-l;a.beginPath(),a.moveTo(u,c),a.lineTo(d,p),a.lineTo(f,v),a.closePath(),e.isFilled&&(s(a,e),a.fill()),e.isStroked&&(n(a,e),a.stroke()),a.restore()}}},79296:(t,e,i)=>{var s=i(61286),n=i(21873);s.register("triangle",(function(t,e,i,s,r,o,a,h,l,u){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a,h,l,u))}))},70498:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(72291),n=i(60213),t.exports={renderWebGL:s,renderCanvas:n}},72291:(t,e,i)=>{var s=i(73329),n=i(50262),r=i(75512);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=s(e,i,o);a.calcMatrix.copyFrom(h.calc);var l=e._displayOriginX,u=e._displayOriginY,c=i.alpha*e.alpha;if(t.pipelines.preBatch(e),e.isFilled){var d=a.fillTint,p=r.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*c);d.TL=p,d.TR=p,d.BL=p,d.BR=p;var f=e.geom.x1-l,v=e.geom.y1-u,g=e.geom.x2-l,m=e.geom.y2-u,y=e.geom.x3-l,x=e.geom.y3-u;a.batchFillTriangle(f,v,g,m,y,x,h.sprite,h.camera)}e.isStroked&&n(a,e,c,l,u),t.pipelines.postBatch(e)}},13747:(t,e,i)=>{var s=i(16569),n=i(56694),r=i(64937),o=i(89980),a=i(20791),h=new n({Extends:o,Mixins:[r.Alpha,r.BlendMode,r.Depth,r.Flip,r.FX,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.ScrollFactor,r.Size,r.TextureCrop,r.Tint,r.Transform,r.Visible,a],initialize:function(t,e,i,n,r){o.call(this,t,"Sprite"),this._crop=this.resetCropObject(),this.anims=new s(this),this.setTexture(n,r),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline()},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){this.anims.update(t,e)},play:function(t,e){return this.anims.play(t,e)},playReverse:function(t,e){return this.anims.playReverse(t,e)},playAfterDelay:function(t,e){return this.anims.playAfterDelay(t,e)},playAfterRepeat:function(t,e){return this.anims.playAfterRepeat(t,e)},chain:function(t){return this.anims.chain(t)},stop:function(){return this.anims.stop()},stopAfterDelay:function(t){return this.anims.stopAfterDelay(t)},stopAfterRepeat:function(t){return this.anims.stopAfterRepeat(t)},stopOnFrame:function(t){return this.anims.stopOnFrame(t)},toJSON:function(){return r.ToJSON(this)},preDestroy:function(){this.anims.destroy(),this.anims=void 0}});t.exports=h},27573:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),t.batchSprite(e,e.frame,i,s)}},89219:(t,e,i)=>{var s=i(88933),n=i(32291),r=i(99325),o=i(20494),a=i(13747);r.register("sprite",(function(t,e){void 0===t&&(t={});var i=o(t,"key",null),r=o(t,"frame",null),h=new a(this.scene,0,0,i,r);return void 0!==e&&(t.add=e),s(this.scene,h,t),n(h,t),h}))},66135:(t,e,i)=>{var s=i(61286),n=i(13747);s.register("sprite",(function(t,e,i,s){var r=new n(this.scene,t,e,i,s);return this.displayList.add(r),r}))},20791:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(21034),n=i(27573),t.exports={renderWebGL:s,renderCanvas:n}},21034:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),e.pipeline.batchSprite(e,i,s)}},32979:t=>{t.exports=function(t,e,i){var s=t.canvas,n=t.context,r=t.style,o=[],a=0,h=i.length;r.maxLines>0&&r.maxLines1&&(d+=p*(h-1)),{width:a,height:d,lines:h,lineWidths:o,lineSpacing:p,lineHeight:c}}},27030:(t,e,i)=>{var s=i(61068);t.exports=function(t){var e=s.create(this),i=e.getContext("2d");t.syncFont(e,i);var n=i.measureText(t.testString);if("actualBoundingBoxAscent"in n){var r=n.actualBoundingBoxAscent,o=n.actualBoundingBoxDescent;return s.remove(e),{ascent:r,descent:o,fontSize:r+o}}var a=Math.ceil(n.width*t.baselineX),h=a,l=2*h;h=h*t.baselineY|0,e.width=a,e.height=l,i.fillStyle="#f00",i.fillRect(0,0,a,l),i.font=t._font,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(t.testString,0,h);var u={ascent:0,descent:0,fontSize:0},c=i.getImageData(0,0,a,l);if(!c)return u.ascent=h,u.descent=h+6,u.fontSize=u.ascent+u.descent,s.remove(e),u;var d,p,f=c.data,v=f.length,g=4*a,m=0,y=!1;for(d=0;dh;d--){for(p=0;p{var s=i(99584),n=i(61068),r=i(56694),o=i(64937),a=i(97081),h=i(89980),l=i(32979),u=i(10850),c=i(55638),d=i(80032),p=i(74744),f=new r({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Crop,o.Depth,o.Flip,o.FX,o.GetBounds,o.Mask,o.Origin,o.Pipeline,o.ScrollFactor,o.Tint,o.Transform,o.Visible,d],initialize:function(t,e,i,s,r){void 0===e&&(e=0),void 0===i&&(i=0),h.call(this,t,"Text"),this.renderer=t.sys.renderer,this.setPosition(e,i),this.setOrigin(0,0),this.initPipeline(),this.canvas=n.create(this),this.context=this.canvas.getContext("2d"),this.style=new p(this,r),this.autoRound=!0,this.splitRegExp=/(?:\r\n|\r|\n)/,this._text=void 0,this.padding={left:0,right:0,top:0,bottom:0},this.width=1,this.height=1,this.lineSpacing=0,this.dirty=!1,0===this.style.resolution&&(this.style.resolution=1),this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(null,this.canvas,!0),this.frame=this.texture.get(),this.frame.source.resolution=this.style.resolution,this.renderer&&this.renderer.gl&&(this.renderer.deleteTexture(this.frame.source.glTexture),this.frame.source.glTexture=null),this.initRTL(),this.setText(s),r&&r.padding&&this.setPadding(r.padding),r&&r.lineSpacing&&this.setLineSpacing(r.lineSpacing),t.sys.game.events.on(a.CONTEXT_RESTORED,this.onContextRestored,this)},initRTL:function(){this.style.rtl&&(this.canvas.dir="rtl",this.context.direction="rtl",this.canvas.style.display="none",s(this.canvas,this.scene.sys.canvas),this.originX=1)},runWordWrap:function(t){var e=this.style;if(e.wordWrapCallback){var i=e.wordWrapCallback.call(e.wordWrapCallbackScope,t,this);return Array.isArray(i)&&(i=i.join("\n")),i}return e.wordWrapWidth?e.wordWrapUseAdvanced?this.advancedWordWrap(t,this.context,this.style.wordWrapWidth):this.basicWordWrap(t,this.context,this.style.wordWrapWidth):t},advancedWordWrap:function(t,e,i){for(var s="",n=t.replace(/ +/gi," ").split(this.splitRegExp),r=n.length,o=0;ol){if(0===c){for(var v=p;v.length&&(v=v.slice(0,-1),!((f=e.measureText(v).width)<=l)););if(!v.length)throw new Error("This text's wordWrapWidth setting is less than a single character!");var g=d.substr(v.length);u[c]=g,h+=v}var m=u[c].length?c:c+1,y=u.slice(m).join(" ").replace(/[ \n]*$/gi,"");n[o+1]=y+" "+(n[o+1]||""),r=n.length;break}h+=p,l-=f}s+=h.replace(/[ \n]*$/gi,"")+"\n"}}return s=s.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(t,e,i){for(var s="",n=t.split(this.splitRegExp),r=n.length-1,o=e.measureText(" ").width,a=0;a<=r;a++){for(var h=i,l=n[a].split(" "),u=l.length-1,c=0;c<=u;c++){var d=l[c],p=e.measureText(d).width,f=p;ch&&c>0&&(s+="\n",h=i),s+=d,c0&&(d+=h.lineSpacing*v),i.rtl)c=p-c;else if("right"===i.align)c+=o-h.lineWidths[v];else if("center"===i.align)c+=(o-h.lineWidths[v])/2;else if("justify"===i.align){if(h.lineWidths[v]/h.width>=.85){var g=h.width-h.lineWidths[v],m=e.measureText(" ").width,y=a[v].trim(),x=y.split(" ");g+=(a[v].length-y.length)*m;for(var T=Math.floor(g/m),w=0;T>0;)x[w]+=" ",w=(w+1)%(x.length-1||1),--T;a[v]=x.join(" ")}}this.autoRound&&(c=Math.round(c),d=Math.round(d)),i.strokeThickness&&(this.style.syncShadow(e,i.shadowStroke),e.strokeText(a[v],c,d)),i.color&&(this.style.syncShadow(e,i.shadowFill),e.fillText(a[v],c,d))}e.restore(),this.renderer&&this.renderer.gl&&(this.frame.source.glTexture=this.renderer.canvasToTexture(t,this.frame.source.glTexture,!0),this.frame.glTexture=this.frame.source.glTexture),this.dirty=!0;var b=this.input;return b&&!b.customHitArea&&(b.hitArea.width=this.width,b.hitArea.height=this.height),this},getTextMetrics:function(){return this.style.getTextMetrics()},text:{get:function(){return this._text},set:function(t){this.setText(t)}},toJSON:function(){var t=o.ToJSON(this),e={autoRound:this.autoRound,text:this._text,style:this.style.toJSON(),padding:{left:this.padding.left,right:this.padding.right,top:this.padding.top,bottom:this.padding.bottom}};return t.data=e,t},onContextRestored:function(){this.dirty=!0},preDestroy:function(){this.style.rtl&&c(this.canvas),n.remove(this.canvas),this.texture.destroy(),this.scene.sys.game.events.off(a.CONTEXT_RESTORED,this.onContextRestored,this)}});t.exports=f},71649:t=>{t.exports=function(t,e,i,s){0!==e.width&&0!==e.height&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,s))}},75397:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(76555);n.register("text",(function(t,e){void 0===t&&(t={});var i=r(t,"text",""),n=r(t,"style",null),a=r(t,"padding",null);null!==a&&(n.padding=a);var h=new o(this.scene,0,0,i,n);return void 0!==e&&(t.add=e),s(this.scene,h,t),h.autoRound=r(t,"autoRound",!0),h.resolution=r(t,"resolution",1),h}))},94627:(t,e,i)=>{var s=i(76555);i(61286).register("text",(function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))}))},80032:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(76128),n=i(71649),t.exports={renderWebGL:s,renderCanvas:n}},74744:(t,e,i)=>{var s=i(56694),n=i(20494),r=i(10850),o=i(27030),a={fontFamily:["fontFamily","Courier"],fontSize:["fontSize","16px"],fontStyle:["fontStyle",""],backgroundColor:["backgroundColor",null],color:["color","#fff"],stroke:["stroke","#fff"],strokeThickness:["strokeThickness",0],shadowOffsetX:["shadow.offsetX",0],shadowOffsetY:["shadow.offsetY",0],shadowColor:["shadow.color","#000"],shadowBlur:["shadow.blur",0],shadowStroke:["shadow.stroke",!1],shadowFill:["shadow.fill",!1],align:["align","left"],maxLines:["maxLines",0],fixedWidth:["fixedWidth",0],fixedHeight:["fixedHeight",0],resolution:["resolution",0],rtl:["rtl",!1],testString:["testString","|MÉqgy"],baselineX:["baselineX",1.2],baselineY:["baselineY",1.4],wordWrapWidth:["wordWrap.width",null],wordWrapCallback:["wordWrap.callback",null],wordWrapCallbackScope:["wordWrap.callbackScope",null],wordWrapUseAdvanced:["wordWrap.useAdvancedWrap",!1]},h=new s({initialize:function(t,e){this.parent=t,this.fontFamily,this.fontSize,this.fontStyle,this.backgroundColor,this.color,this.stroke,this.strokeThickness,this.shadowOffsetX,this.shadowOffsetY,this.shadowColor,this.shadowBlur,this.shadowStroke,this.shadowFill,this.align,this.maxLines,this.fixedWidth,this.fixedHeight,this.resolution,this.rtl,this.testString,this.baselineX,this.baselineY,this.wordWrapWidth,this.wordWrapCallback,this.wordWrapCallbackScope,this.wordWrapUseAdvanced,this._font,this.setStyle(e,!1,!0);var i=r(e,"metrics",!1);this.metrics=i?{ascent:r(i,"ascent",0),descent:r(i,"descent",0),fontSize:r(i,"fontSize",0)}:o(this)},setStyle:function(t,e,i){for(var s in void 0===e&&(e=!0),void 0===i&&(i=!1),t&&t.hasOwnProperty("fontSize")&&"number"==typeof t.fontSize&&(t.fontSize=t.fontSize.toString()+"px"),a){var o=i?a[s][1]:this[s];this[s]="wordWrapCallback"===s||"wordWrapCallbackScope"===s?r(t,a[s][0],o):n(t,a[s][0],o)}var h=r(t,"font",null);null!==h&&this.setFont(h,!1),this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim();var l=r(t,"fill",null);return null!==l&&(this.color=l),e?this.update(!0):this.parent},syncFont:function(t,e){e.font=this._font},syncStyle:function(t,e){e.textBaseline="alphabetic",e.fillStyle=this.color,e.strokeStyle=this.stroke,e.lineWidth=this.strokeThickness,e.lineCap="round",e.lineJoin="round"},syncShadow:function(t,e){e?(t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur):(t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowColor=0,t.shadowBlur=0)},update:function(t){return t&&(this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim(),this.metrics=o(this)),this.parent.updateText()},setFont:function(t,e){void 0===e&&(e=!0);var i=t,s="",n="";if("string"!=typeof t)i=r(t,"fontFamily","Courier"),s=r(t,"fontSize","16px"),n=r(t,"fontStyle","");else{var o=t.split(" "),a=0;n=o.length>2?o[a++]:"",s=o[a++]||"16px",i=o[a++]||"Courier"}return i===this.fontFamily&&s===this.fontSize&&n===this.fontStyle||(this.fontFamily=i,this.fontSize=s,this.fontStyle=n,e&&this.update(!0)),this.parent},setFontFamily:function(t){return this.fontFamily!==t&&(this.fontFamily=t,this.update(!0)),this.parent},setFontStyle:function(t){return this.fontStyle!==t&&(this.fontStyle=t,this.update(!0)),this.parent},setFontSize:function(t){return"number"==typeof t&&(t=t.toString()+"px"),this.fontSize!==t&&(this.fontSize=t,this.update(!0)),this.parent},setTestString:function(t){return this.testString=t,this.update(!0)},setFixedSize:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(!1)},setBackgroundColor:function(t){return this.backgroundColor=t,this.update(!1)},setFill:function(t){return this.color=t,this.update(!1)},setColor:function(t){return this.color=t,this.update(!1)},setResolution:function(t){return this.resolution=t,this.update(!1)},setStroke:function(t,e){return void 0===e&&(e=this.strokeThickness),void 0===t&&0!==this.strokeThickness?(this.strokeThickness=0,this.update(!0)):this.stroke===t&&this.strokeThickness===e||(this.stroke=t,this.strokeThickness=e,this.update(!0)),this.parent},setShadow:function(t,e,i,s,n,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===s&&(s=0),void 0===n&&(n=!1),void 0===r&&(r=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=i,this.shadowBlur=s,this.shadowStroke=n,this.shadowFill=r,this.update(!1)},setShadowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)},setShadowColor:function(t){return void 0===t&&(t="#000"),this.shadowColor=t,this.update(!1)},setShadowBlur:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)},setShadowStroke:function(t){return this.shadowStroke=t,this.update(!1)},setShadowFill:function(t){return this.shadowFill=t,this.update(!1)},setWordWrapWidth:function(t,e){return void 0===e&&(e=!1),this.wordWrapWidth=t,this.wordWrapUseAdvanced=e,this.update(!1)},setWordWrapCallback:function(t,e){return void 0===e&&(e=null),this.wordWrapCallback=t,this.wordWrapCallbackScope=e,this.update(!1)},setAlign:function(t){return void 0===t&&(t="left"),this.align=t,this.update(!1)},setMaxLines:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)},getTextMetrics:function(){var t=this.metrics;return{ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}},toJSON:function(){var t={};for(var e in a)t[e]=this[e];return t.metrics=this.getTextMetrics(),t},destroy:function(){this.parent=void 0}});t.exports=h},76128:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i,n){if(0!==e.width&&0!==e.height){i.addToRenderList(e);var r=e.frame,o=r.width,a=r.height,h=s.getTintAppendFloatAlpha,l=t.pipelines.set(e.pipeline,e),u=l.setTexture2D(r.glTexture,e);l.batchTexture(e,r.glTexture,o,a,e.x,e.y,o/e.style.resolution,a/e.style.resolution,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,o,a,h(e.tintTopLeft,i.alpha*e._alphaTL),h(e.tintTopRight,i.alpha*e._alphaTR),h(e.tintBottomLeft,i.alpha*e._alphaBL),h(e.tintBottomRight,i.alpha*e._alphaBR),e.tintFill,0,0,i,n,!1,u)}}},35856:(t,e,i)=>{var s=i(61068),n=i(56694),r=i(64937),o=i(97081),a=i(89980),h=i(3504),l=i(8213),u=i(9271),c=i(93736),d=new n({Extends:a,Mixins:[r.Alpha,r.BlendMode,r.ComputedSize,r.Crop,r.Depth,r.Flip,r.FX,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.ScrollFactor,r.Tint,r.Transform,r.Visible,u],initialize:function(t,e,i,n,r,l,u){var d=t.sys.renderer;a.call(this,t,"TileSprite");var p=t.sys.textures.get(l),f=p.get(u);n&&r?(n=Math.floor(n),r=Math.floor(r)):(n=f.width,r=f.height),this._tilePosition=new c,this._tileScale=new c(1,1),this.dirty=!1,this.renderer=d,this.canvas=s.create(this,n,r),this.context=this.canvas.getContext("2d"),this.displayTexture=p,this.displayFrame=f,this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(null,this.canvas,!0),this.frame=this.texture.get(),this.potWidth=h(f.width),this.potHeight=h(f.height),this.fillCanvas=s.create2D(this,this.potWidth,this.potHeight),this.fillContext=this.fillCanvas.getContext("2d"),this.fillPattern=null,this.setPosition(e,i),this.setSize(n,r),this.setFrame(u),this.setOriginFromFrame(),this.initPipeline(),t.sys.game.events.on(o.CONTEXT_RESTORED,this.onContextRestored,this)},setTexture:function(t,e){return this.displayTexture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t){var e=this.displayTexture.get(t);return this.potWidth=h(e.width),this.potHeight=h(e.height),this.canvas.width=0,e.cutWidth&&e.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this.displayFrame=e,this.dirty=!0,this.updateTileTexture(),this},setTilePosition:function(t,e){return void 0!==t&&(this.tilePositionX=t),void 0!==e&&(this.tilePositionY=e),this},setTileScale:function(t,e){return void 0===t&&(t=this.tileScaleX),void 0===e&&(e=t),this.tileScaleX=t,this.tileScaleY=e,this},updateTileTexture:function(){if(this.dirty&&this.renderer){var t=this.displayFrame;if(t.source.isRenderTexture||t.source.isGLTexture)return console.warn("TileSprites can only use Image or Canvas based textures"),void(this.dirty=!1);var e=this.fillContext,i=this.fillCanvas,s=this.potWidth,n=this.potHeight;this.renderer&&this.renderer.gl||(s=t.cutWidth,n=t.cutHeight),e.clearRect(0,0,s,n),i.width=s,i.height=n,e.drawImage(t.source.image,t.cutX,t.cutY,t.cutWidth,t.cutHeight,0,0,s,n),this.renderer&&this.renderer.gl?this.fillPattern=this.renderer.canvasToTexture(i,this.fillPattern):this.fillPattern=e.createPattern(i,"repeat"),this.updateCanvas(),this.dirty=!1}},updateCanvas:function(){var t=this.canvas;if(t.width===this.width&&t.height===this.height||(t.width=this.width,t.height=this.height,this.frame.setSize(this.width,this.height),this.updateDisplayOrigin(),this.dirty=!0),!this.dirty||this.renderer&&this.renderer.gl)this.dirty=!1;else{var e=this.context;this.scene.sys.game.config.antialias||l.disable(e);var i=this._tileScale.x,s=this._tileScale.y,n=this._tilePosition.x,r=this._tilePosition.y;e.clearRect(0,0,this.width,this.height),e.save(),e.scale(i,s),e.translate(-n,-r),e.fillStyle=this.fillPattern,e.fillRect(n,r,this.width/i,this.height/s),e.restore(),this.dirty=!1}},onContextRestored:function(t){if(t){var e=t.gl;this.dirty=!0,this.fillPattern=null,this.fillPattern=t.createTexture2D(0,e.LINEAR,e.LINEAR,e.REPEAT,e.REPEAT,e.RGBA,this.fillCanvas,this.potWidth,this.potHeight)}},preDestroy:function(){this.renderer&&this.renderer.gl&&this.renderer.deleteTexture(this.fillPattern),s.remove(this.canvas),s.remove(this.fillCanvas),this.fillPattern=null,this.fillContext=null,this.fillCanvas=null,this.displayTexture=null,this.displayFrame=null,this.texture.destroy(),this.renderer=null,this.scene.sys.game.events.off(o.CONTEXT_RESTORED,this.onContextRestored,this)},tilePositionX:{get:function(){return this._tilePosition.x},set:function(t){this._tilePosition.x=t,this.dirty=!0}},tilePositionY:{get:function(){return this._tilePosition.y},set:function(t){this._tilePosition.y=t,this.dirty=!0}},tileScaleX:{get:function(){return this._tileScale.x},set:function(t){this._tileScale.x=t,this.dirty=!0}},tileScaleY:{get:function(){return this._tileScale.y},set:function(t){this._tileScale.y=t,this.dirty=!0}}});t.exports=d},93305:t=>{t.exports=function(t,e,i,s){e.updateCanvas(),i.addToRenderList(e),t.batchSprite(e,e.frame,i,s)}},63950:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(35856);n.register("tileSprite",(function(t,e){void 0===t&&(t={});var i=r(t,"x",0),n=r(t,"y",0),a=r(t,"width",512),h=r(t,"height",512),l=r(t,"key",""),u=r(t,"frame",""),c=new o(this.scene,i,n,a,h,l,u);return void 0!==e&&(t.add=e),s(this.scene,c,t),c}))},20509:(t,e,i)=>{var s=i(35856);i(61286).register("tileSprite",(function(t,e,i,n,r,o){return this.displayList.add(new s(this.scene,t,e,i,n,r,o))}))},9271:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(74287),n=i(93305),t.exports={renderWebGL:s,renderCanvas:n}},74287:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i,n){e.updateCanvas();var r=e.width,o=e.height;if(0!==r&&0!==o){i.addToRenderList(e);var a=s.getTintAppendFloatAlpha,h=t.pipelines.set(e.pipeline,e),l=h.setTexture2D(e.fillPattern,e);h.batchTexture(e,e.fillPattern,e.displayFrame.width*e.tileScaleX,e.displayFrame.height*e.tileScaleY,e.x,e.y,r,o,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.originX*r,e.originY*o,0,0,r,o,a(e.tintTopLeft,i.alpha*e._alphaTL),a(e.tintTopRight,i.alpha*e._alphaTR),a(e.tintBottomLeft,i.alpha*e._alphaBL),a(e.tintBottomRight,i.alpha*e._alphaBR),e.tintFill,e.tilePositionX%e.displayFrame.width/e.displayFrame.width,e.tilePositionY%e.displayFrame.height/e.displayFrame.height,i,n,!1,l)}}},8630:(t,e,i)=>{var s=i(56694),n=i(82897),r=i(64937),o=i(56631),a=i(97081),h=i(33963),l=i(89980),u=i(76038),c=i(76583),d=i(77974),p=i(83392),f=new s({Extends:l,Mixins:[r.Alpha,r.BlendMode,r.Depth,r.Flip,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.ScrollFactor,r.Size,r.TextureCrop,r.Tint,r.Transform,r.Visible,d],initialize:function(t,e,i,s){l.call(this,t,"Video"),this.video=null,this.videoTexture=null,this.videoTextureSource=null,this.snapshotTexture=null,this.flipY=!1,this._key=c(),this.touchLocked=!0,this.playWhenUnlocked=!1,this.retryLimit=20,this.retry=0,this.retryInterval=500,this._retryID=null,this._systemMuted=!1,this._codeMuted=!1,this._systemPaused=!1,this._codePaused=!1,this._callbacks={play:this.playHandler.bind(this),error:this.loadErrorHandler.bind(this),end:this.completeHandler.bind(this),time:this.timeUpdateHandler.bind(this),seeking:this.seekingHandler.bind(this),seeked:this.seekedHandler.bind(this)},this._crop=this.resetCropObject(),this.markers={},this._markerIn=-1,this._markerOut=p.MAX_SAFE_INTEGER,this._lastUpdate=0,this._cacheKey="",this._isSeeking=!1,this.removeVideoElementOnDestroy=!1,this.setPosition(e,i),this.initPipeline(),s&&this.changeSource(s,!1);var n=t.sys.game.events;n.on(a.PAUSE,this.globalPause,this),n.on(a.RESUME,this.globalResume,this);var r=t.sys.sound;r&&r.on(u.GLOBAL_MUTE,this.globalMute,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},play:function(t,e,i){if(this.touchLocked&&this.playWhenUnlocked||this.isPlaying())return this;var s=this.video;if(!s)return console.warn("Video not loaded"),this;void 0===t&&(t=s.loop);var n=this.scene.sys.sound;n&&n.mute&&this.setMute(!0),isNaN(e)||(this._markerIn=e),!isNaN(i)&&i>e&&(this._markerOut=i),s.loop=t;var r=this._callbacks,o=s.play();return void 0!==o?o.then(this.playPromiseSuccessHandler.bind(this)).catch(this.playPromiseErrorHandler.bind(this)):(s.addEventListener("playing",r.play,!0),s.readyState<2&&(this.retry=this.retryLimit,this._retryID=window.setTimeout(this.checkVideoProgress.bind(this),this.retryInterval))),s.addEventListener("ended",r.end,!0),s.addEventListener("timeupdate",r.time,!0),s.addEventListener("seeking",r.seeking,!0),s.addEventListener("seeked",r.seeked,!0),this},changeSource:function(t,e,i,s,n){void 0===e&&(e=!0),this.video&&this.stop();var r=this.scene.sys.cache.video.get(t);return r?(this.video=r,this._cacheKey=t,this._codePaused=r.paused,this._codeMuted=r.muted,this.videoTexture?(this.scene.sys.textures.remove(this._key),this.videoTexture=this.scene.sys.textures.create(this._key,r,r.videoWidth,r.videoHeight),this.videoTextureSource=this.videoTexture.source[0],this.videoTexture.add("__BASE",0,0,0,r.videoWidth,r.videoHeight),this.setTexture(this.videoTexture),this.setSizeToFrame(),this.updateDisplayOrigin(),this.emit(o.VIDEO_CREATED,this,r.videoWidth,r.videoHeight)):this.updateTexture(),r.currentTime=0,this._lastUpdate=0,e&&this.play(i,s,n)):this.video=null,this},addMarker:function(t,e,i){return!isNaN(e)&&e>=0&&!isNaN(i)&&(this.markers[t]=[e,i]),this},playMarker:function(t,e){var i=this.markers[t];return i&&this.play(e,i[0],i[1]),this},removeMarker:function(t){return delete this.markers[t],this},snapshot:function(t,e){return void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.snapshotArea(0,0,this.width,this.height,t,e)},snapshotArea:function(t,e,i,s,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===s&&(s=this.height),void 0===n&&(n=i),void 0===r&&(r=s);var o=this.video,a=this.snapshotTexture;return a?(a.setSize(n,r),o&&a.context.drawImage(o,t,e,i,s,0,0,n,r)):(a=this.scene.sys.textures.createCanvas(c(),n,r),this.snapshotTexture=a,o&&a.context.drawImage(o,t,e,i,s,0,0,n,r)),a.update()},saveSnapshotTexture:function(t){return this.snapshotTexture?this.scene.sys.textures.renameTexture(this.snapshotTexture.key,t):this.snapshotTexture=this.scene.sys.textures.createCanvas(t,this.width,this.height),this.snapshotTexture},loadURL:function(t,e,i,s){void 0===e&&(e="loadeddata"),void 0===i&&(i=!1),this.video&&this.stop(),this.videoTexture&&this.scene.sys.textures.remove(this._key);var n=document.createElement("video");return n.controls=!1,i&&(n.muted=!0,n.defaultMuted=!0,n.setAttribute("autoplay","autoplay")),n.setAttribute("playsinline","playsinline"),n.setAttribute("preload","auto"),void 0!==s&&n.setAttribute("crossorigin",s),n.addEventListener("error",this._callbacks.error,!0),n.src=t,n.load(),this.video=n,this},loadMediaStream:function(t,e,i){void 0===e&&(e="loadeddata"),void 0===i&&(i=!1),this.video&&this.stop(),this.videoTexture&&this.scene.sys.textures.remove(this._key);var s=document.createElement("video");s.controls=!1,i&&(s.muted=!0,s.defaultMuted=!0,s.setAttribute("autoplay","autoplay")),s.setAttribute("playsinline","playsinline"),s.setAttribute("preload","auto"),s.addEventListener("error",this._callbacks.error,!0);try{s.srcObject=t}catch(e){s.src=window.URL.createObjectURL(t)}return s.load(),this.video=s,this},playPromiseSuccessHandler:function(){this._codePaused=!1,this.touchLocked=!1,this.emit(o.VIDEO_PLAY,this),this._markerIn>-1&&(this.video.currentTime=this._markerIn)},playPromiseErrorHandler:function(t){this.scene.sys.input.once(h.POINTER_DOWN,this.unlockHandler,this),this.touchLocked=!0,this.playWhenUnlocked=!0,this.emit(o.VIDEO_ERROR,this,t)},playHandler:function(){this._codePaused=!1,this.touchLocked=!1,this.emit(o.VIDEO_PLAY,this),this.video.removeEventListener("playing",this._callbacks.play,!0)},loadErrorHandler:function(t){this.stop(),this.emit(o.VIDEO_ERROR,this,t)},unlockHandler:function(){this.touchLocked=!1,this.playWhenUnlocked=!1,this.emit(o.VIDEO_UNLOCKED,this),this._markerIn>-1&&(this.video.currentTime=this._markerIn),this.video.play(),this.emit(o.VIDEO_PLAY,this)},completeHandler:function(){this.emit(o.VIDEO_COMPLETE,this)},timeUpdateHandler:function(){this.video&&this.video.currentTime=this._markerOut&&(t.loop?(t.currentTime=this._markerIn,this.updateTexture(),this._lastUpdate=e,this.emit(o.VIDEO_LOOP,this)):(this.emit(o.VIDEO_COMPLETE,this),this.stop())))}},checkVideoProgress:function(){this.video.readyState>=2?this.updateTexture():(this.retry--,this.retry>0?this._retryID=window.setTimeout(this.checkVideoProgress.bind(this),this.retryInterval):this.emit(o.VIDEO_TIMEOUT,this))},updateTexture:function(){var t=this.video,e=t.videoWidth,i=t.videoHeight;if(this.videoTexture){var s=this.videoTextureSource;s.source!==t&&(s.source=t,s.width=e,s.height=i),s.update()}else this.videoTexture=this.scene.sys.textures.create(this._key,t,e,i),this.videoTextureSource=this.videoTexture.source[0],this.videoTexture.add("__BASE",0,0,0,e,i),this.setTexture(this.videoTexture),this.setSizeToFrame(),this.updateDisplayOrigin(),this.emit(o.VIDEO_CREATED,this,e,i)},getVideoKey:function(){return this._cacheKey},seekTo:function(t){var e=this.video;if(e){var i=e.duration;if(i!==1/0&&!isNaN(i)){var s=i*t;this.setCurrentTime(s)}}return this},getCurrentTime:function(){return this.video?this.video.currentTime:0},setCurrentTime:function(t){var e=this.video;if(e){if("string"==typeof t){var i=t[0],s=parseFloat(t.substr(1));"+"===i?t=e.currentTime+s:"-"===i&&(t=e.currentTime-s)}e.currentTime=t,this._lastUpdate=t}return this},isSeeking:function(){return this._isSeeking},seekingHandler:function(){this._isSeeking=!0,this.emit(o.VIDEO_SEEKING,this)},seekedHandler:function(){this._isSeeking=!1,this.emit(o.VIDEO_SEEKED,this),this.video&&this.updateTexture()},getProgress:function(){var t=this.video;if(t){var e=t.currentTime,i=t.duration;if(i!==1/0&&!isNaN(i))return e/i}return 0},getDuration:function(){return this.video?this.video.duration:0},setMute:function(t){void 0===t&&(t=!0),this._codeMuted=t;var e=this.video;return e&&(e.muted=!!this._systemMuted||t),this},isMuted:function(){return this._codeMuted},globalMute:function(t,e){this._systemMuted=e;var i=this.video;i&&(i.muted=!!this._codeMuted||e)},globalPause:function(){this._systemPaused=!0,this.video&&this.video.pause()},globalResume:function(){this._systemPaused=!1,this.video&&!this._codePaused&&this.video.play()},setPaused:function(t){void 0===t&&(t=!0);var e=this.video;return this._codePaused=t,e&&(t?e.paused||e.pause():t||e.paused&&!this._systemPaused&&e.play()),this},getVolume:function(){return this.video?this.video.volume:1},setVolume:function(t){return void 0===t&&(t=1),this.video&&(this.video.volume=n(t,0,1)),this},getPlaybackRate:function(){return this.video?this.video.playbackRate:1},setPlaybackRate:function(t){return this.video&&(this.video.playbackRate=t),this},getLoop:function(){return!!this.video&&this.video.loop},setLoop:function(t){return void 0===t&&(t=!0),this.video&&(this.video.loop=t),this},isPlaying:function(){return!!this.video&&!(this.video.paused||this.video.ended)},isPaused:function(){return this.video&&this.video.paused||this._codePaused||this._systemPaused},saveTexture:function(t,e){return void 0===e&&(e=!1),this.videoTexture&&this.scene.sys.textures.renameTexture(this._key,t),this._key=t,this.flipY=e,this.videoTextureSource&&this.videoTextureSource.setFlipY(e),this.videoTexture},stop:function(){var t=this.video;if(t){var e=this._callbacks;for(var i in e)t.removeEventListener(i,e[i],!0);t.pause()}return this._retryID&&window.clearTimeout(this._retryID),this.emit(o.VIDEO_STOP,this),this},removeVideoElement:function(){var t=this.video;if(t){for(t.parentNode&&t.parentNode.removeChild(t);t.hasChildNodes();)t.removeChild(t.firstChild);t.removeAttribute("autoplay"),t.removeAttribute("src"),this.video=null}},preDestroy:function(){this.stop(),this.removeVideoElementOnDestroy&&this.removeVideoElement();var t=this.scene.sys.game.events;t.off(a.PAUSE,this.globalPause,this),t.off(a.RESUME,this.globalResume,this);var e=this.scene.sys.sound;e&&e.off(u.GLOBAL_MUTE,this.globalMute,this),this._retryID&&window.clearTimeout(this._retryID)}});t.exports=f},56933:t=>{t.exports=function(t,e,i,s){e.videoTexture&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,s))}},65601:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(8630);n.register("video",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=new o(this.scene,0,0,i);return void 0!==e&&(t.add=e),s(this.scene,n,t),t.add||this.updateList.add(n),n}))},215:(t,e,i)=>{var s=i(8630);i(61286).register("video",(function(t,e,i){return this.displayList.add(new s(this.scene,t,e,i))}))},77974:(t,e,i)=>{var s=i(72283),n=i(72283);s=i(83572),n=i(56933),t.exports={renderWebGL:s,renderCanvas:n}},83572:t=>{t.exports=function(t,e,i,s){e.videoTexture&&(i.addToRenderList(e),e.pipeline.batchSprite(e,i,s))}},71030:(t,e,i)=>{var s=i(95723),n=i(26673),r=i(65650),o=i(56694),a=i(64937),h=i(89980),l=i(74118),u=i(94287),c=new o({Extends:h,Mixins:[a.Depth,a.GetBounds,a.Origin,a.Transform,a.ScrollFactor,a.Visible],initialize:function(t,e,i,n,r){void 0===n&&(n=1),void 0===r&&(r=n),h.call(this,t,"Zone"),this.setPosition(e,i),this.width=n,this.height=r,this.blendMode=s.NORMAL,this.updateDisplayOrigin()},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e,i){void 0===i&&(i=!0),this.width=t,this.height=e,this.updateDisplayOrigin();var s=this.input;return i&&s&&!s.customHitArea&&(s.hitArea.width=t,s.hitArea.height=e),this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},setCircleDropZone:function(t){return this.setDropZone(new n(0,0,t),r)},setRectangleDropZone:function(t,e){return this.setDropZone(new l(0,0,t,e),u)},setDropZone:function(t,e){return this.input||this.setInteractive(t,e,!0),this},setAlpha:function(){},setBlendMode:function(){},renderCanvas:function(t,e,i){i.addToRenderList(e)},renderWebGL:function(t,e,i){i.addToRenderList(e)}});t.exports=c},24067:(t,e,i)=>{var s=i(99325),n=i(20494),r=i(71030);s.register("zone",(function(t){var e=n(t,"x",0),i=n(t,"y",0),s=n(t,"width",1),o=n(t,"height",s);return new r(this.scene,e,i,s,o)}))},34546:(t,e,i)=>{var s=i(71030);i(61286).register("zone",(function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))}))},95847:t=>{t.exports=function(t){return t.radius>0?Math.PI*t.radius*t.radius:0}},26673:(t,e,i)=>{var s=i(56694),n=i(65650),r=i(94026),o=i(62941),a=i(52394),h=i(30977),l=new s({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.type=a.CIRCLE,this.x=t,this.y=e,this._radius=i,this._diameter=2*i},contains:function(t,e){return n(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i){return this.x=t,this.y=e,this._radius=i,this._diameter=2*i,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this._diameter=2*t}},diameter:{get:function(){return this._diameter},set:function(t){this._diameter=t,this._radius=.5*t}},left:{get:function(){return this.x-this._radius},set:function(t){this.x=t+this._radius}},right:{get:function(){return this.x+this._radius},set:function(t){this.x=t-this._radius}},top:{get:function(){return this.y-this._radius},set:function(t){this.y=t+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(t){this.y=t-this._radius}}});t.exports=l},37964:t=>{t.exports=function(t){return Math.PI*t.radius*2}},72233:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){return void 0===i&&(i=new s),i.x=t.x+t.radius*Math.cos(e),i.y=t.y+t.radius*Math.sin(e),i}},61761:(t,e,i)=>{var s=i(26673);t.exports=function(t){return new s(t.x,t.y,t.radius)}},65650:t=>{t.exports=function(t,e,i){return t.radius>0&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},39187:(t,e,i)=>{var s=i(65650);t.exports=function(t,e){return s(t,e.x,e.y)}},58672:(t,e,i)=>{var s=i(65650);t.exports=function(t,e){return s(t,e.x,e.y)&&s(t,e.right,e.y)&&s(t,e.x,e.bottom)&&s(t,e.right,e.bottom)}},42997:t=>{t.exports=function(t,e){return e.setTo(t.x,t.y,t.radius)}},94894:t=>{t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.radius===e.radius}},48027:(t,e,i)=>{var s=i(74118);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.left,e.y=t.top,e.width=t.diameter,e.height=t.diameter,e}},94026:(t,e,i)=>{var s=i(72233),n=i(91806),r=i(83392),o=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new o);var a=n(e,0,r.PI2);return s(t,a,i)}},62941:(t,e,i)=>{var s=i(37964),n=i(72233),r=i(91806),o=i(83392);t.exports=function(t,e,i,a){void 0===a&&(a=[]),!e&&i>0&&(e=s(t)/i);for(var h=0;h{t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},88665:t=>{t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},30977:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){void 0===e&&(e=new s);var i=2*Math.PI*Math.random(),n=Math.random()+Math.random(),r=n>1?2-n:n,o=r*Math.cos(i),a=r*Math.sin(i);return e.x=t.x+o*t.radius,e.y=t.y+a*t.radius,e}},6112:(t,e,i)=>{var s=i(26673);s.Area=i(95847),s.Circumference=i(37964),s.CircumferencePoint=i(72233),s.Clone=i(61761),s.Contains=i(65650),s.ContainsPoint=i(39187),s.ContainsRect=i(58672),s.CopyFrom=i(42997),s.Equals=i(94894),s.GetBounds=i(48027),s.GetPoint=i(94026),s.GetPoints=i(62941),s.Offset=i(34585),s.OffsetPoint=i(88665),s.Random=i(30977),t.exports=s},52394:t=>{t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},58605:t=>{t.exports=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI}},39507:t=>{t.exports=function(t){var e=t.width/2,i=t.height/2,s=Math.pow(e-i,2)/Math.pow(e+i,2);return Math.PI*(e+i)*(1+3*s/(10+Math.sqrt(4-3*s)))}},86998:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=t.width/2,r=t.height/2;return i.x=t.x+n*Math.cos(e),i.y=t.y+r*Math.sin(e),i}},81773:(t,e,i)=>{var s=i(95669);t.exports=function(t){return new s(t.x,t.y,t.width,t.height)}},72313:t=>{t.exports=function(t,e,i){if(t.width<=0||t.height<=0)return!1;var s=(e-t.x)/t.width,n=(i-t.y)/t.height;return(s*=s)+(n*=n)<.25}},34368:(t,e,i)=>{var s=i(72313);t.exports=function(t,e){return s(t,e.x,e.y)}},71431:(t,e,i)=>{var s=i(72313);t.exports=function(t,e){return s(t,e.x,e.y)&&s(t,e.right,e.y)&&s(t,e.x,e.bottom)&&s(t,e.right,e.bottom)}},75459:t=>{t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},95669:(t,e,i)=>{var s=i(56694),n=i(72313),r=i(95340),o=i(54978),a=i(52394),h=i(72006),l=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.type=a.ELLIPSE,this.x=t,this.y=e,this.width=i,this.height=s},contains:function(t,e){return n(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setEmpty:function(){return this.width=0,this.height=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getMinorRadius:function(){return Math.min(this.width,this.height)/2},getMajorRadius:function(){return Math.max(this.width,this.height)/2},left:{get:function(){return this.x-this.width/2},set:function(t){this.x=t+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(t){this.y=t+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=l},98068:t=>{t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},72897:(t,e,i)=>{var s=i(74118);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.left,e.y=t.top,e.width=t.width,e.height=t.height,e}},95340:(t,e,i)=>{var s=i(86998),n=i(91806),r=i(83392),o=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new o);var a=n(e,0,r.PI2);return s(t,a,i)}},54978:(t,e,i)=>{var s=i(39507),n=i(86998),r=i(91806),o=i(83392);t.exports=function(t,e,i,a){void 0===a&&(a=[]),!e&&i>0&&(e=s(t)/i);for(var h=0;h{t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},36233:t=>{t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},72006:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){void 0===e&&(e=new s);var i=Math.random()*Math.PI*2,n=Math.sqrt(Math.random());return e.x=t.x+n*Math.cos(i)*t.width/2,e.y=t.y+n*Math.sin(i)*t.height/2,e}},40652:(t,e,i)=>{var s=i(95669);s.Area=i(58605),s.Circumference=i(39507),s.CircumferencePoint=i(86998),s.Clone=i(81773),s.Contains=i(72313),s.ContainsPoint=i(34368),s.ContainsRect=i(71431),s.CopyFrom=i(75459),s.Equals=i(98068),s.GetBounds=i(72897),s.GetPoint=i(95340),s.GetPoints=i(54978),s.Offset=i(77951),s.OffsetPoint=i(36233),s.Random=i(72006),t.exports=s},84068:(t,e,i)=>{var s=i(52394),n=i(98611),r={Circle:i(6112),Ellipse:i(40652),Intersects:i(7563),Line:i(28482),Mesh:i(14293),Point:i(63472),Polygon:i(44359),Rectangle:i(66658),Triangle:i(87619)};r=n(!1,r,s),t.exports=r},22184:(t,e,i)=>{var s=i(53996);t.exports=function(t,e){return s(t.x,t.y,e.x,e.y)<=t.radius+e.radius}},26535:t=>{t.exports=function(t,e){var i=e.width/2,s=e.height/2,n=Math.abs(t.x-e.x-i),r=Math.abs(t.y-e.y-s),o=i+t.radius,a=s+t.radius;if(n>o||r>a)return!1;if(n<=i||r<=s)return!0;var h=n-i,l=r-s;return h*h+l*l<=t.radius*t.radius}},71145:(t,e,i)=>{var s=i(79967),n=i(22184);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r,o,a,h,l=t.x,u=t.y,c=t.radius,d=e.x,p=e.y,f=e.radius;if(u===p)0===(a=(o=-2*p)*o-4*(r=1)*(d*d+(h=(f*f-c*c-d*d+l*l)/(2*(l-d)))*h-2*d*h+p*p-f*f))?i.push(new s(h,-o/(2*r))):a>0&&(i.push(new s(h,(-o+Math.sqrt(a))/(2*r))),i.push(new s(h,(-o-Math.sqrt(a))/(2*r))));else{var v=(l-d)/(u-p),g=(f*f-c*c-d*d+l*l-p*p+u*u)/(2*(u-p));0===(a=(o=2*u*v-2*g*v-2*l)*o-4*(r=v*v+1)*(l*l+u*u+g*g-c*c-2*u*g))?(h=-o/(2*r),i.push(new s(h,g-h*v))):a>0&&(h=(-o+Math.sqrt(a))/(2*r),i.push(new s(h,g-h*v)),h=(-o-Math.sqrt(a))/(2*r),i.push(new s(h,g-h*v)))}}return i}},62508:(t,e,i)=>{var s=i(26111),n=i(26535);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC(),h=e.getLineD();s(r,t,i),s(o,t,i),s(a,t,i),s(h,t,i)}return i}},26111:(t,e,i)=>{var s=i(79967),n=i(61472);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r,o,a=t.x1,h=t.y1,l=t.x2,u=t.y2,c=e.x,d=e.y,p=e.radius,f=l-a,v=u-h,g=a-c,m=h-d,y=f*f+v*v,x=2*(f*g+v*m),T=x*x-4*y*(g*g+m*m-p*p);if(0===T){var w=-x/(2*y);r=a+w*f,o=h+w*v,w>=0&&w<=1&&i.push(new s(r,o))}else if(T>0){var b=(-x-Math.sqrt(T))/(2*y);r=a+b*f,o=h+b*v,b>=0&&b<=1&&i.push(new s(r,o));var E=(-x+Math.sqrt(T))/(2*y);r=a+E*f,o=h+E*v,E>=0&&E<=1&&i.push(new s(r,o))}}return i}},96537:(t,e,i)=>{var s=i(70015);t.exports=function(t,e,i){var n=t.x1,r=t.y1,o=t.x2,a=t.y2,h=e.x1,l=e.y1,u=o-n,c=a-r,d=e.x2-h,p=e.y2-l,f=u*p-c*d;if(0===f)return!1;var v=((h-n)*p-(l-r)*d)/f,g=((r-l)*u-(n-h)*c)/f;return v<0||v>1||g<0||g>1?null:(void 0===i&&(i=new s),i.set(n+u*v,r+c*v,v))}},17647:(t,e,i)=>{var s=i(70015),n=i(96537),r=new(i(88829)),o=new s;t.exports=function(t,e,i){void 0===i&&(i=new s);var a=!1;i.set(),o.set();for(var h=e[0],l=1;l{var s=i(70015),n=i(51729),r=i(17647),o=new s;t.exports=function(t,e,i){void 0===i&&(i=new n),Array.isArray(e)||(e=[e]);var s=!1;i.set(),o.set();for(var a=0;a{var s=i(79967),n=i(25227),r=i(47910);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e))for(var o=e.getLineA(),a=e.getLineB(),h=e.getLineC(),l=e.getLineD(),u=[new s,new s,new s,new s],c=[n(o,t,u[0]),n(a,t,u[1]),n(h,t,u[2]),n(l,t,u[3])],d=0;d<4;d++)c[d]&&i.push(u[d]);return i}},7449:(t,e,i)=>{var s=i(51729),n=i(68439),r=new(i(88829));function o(t,e,i,o,a){var h=Math.cos(t),l=Math.sin(t);r.setTo(e,i,e+h,i+l);var u=n(r,o);u&&a.push(new s(u.x,u.y,t,u.w))}function a(t,e){return t.z-e.z}t.exports=function(t,e,i){Array.isArray(i)||(i=[i]);for(var s=[],n=[],r=0;r{var s=i(74118),n=i(90205);t.exports=function(t,e,i){return void 0===i&&(i=new s),n(t,e)&&(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y),i}},1946:(t,e,i)=>{var s=i(9569),n=i(90205);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=t.getLineA(),o=t.getLineB(),a=t.getLineC(),h=t.getLineD();s(r,e,i),s(o,e,i),s(a,e,i),s(h,e,i)}return i}},34211:(t,e,i)=>{var s=i(20370),n=i(9569);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC();n(r,t,i),n(o,t,i),n(a,t,i)}return i}},80511:(t,e,i)=>{var s=i(26111),n=i(48411);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=t.getLineA(),o=t.getLineB(),a=t.getLineC();s(r,e,i),s(o,e,i),s(a,e,i)}return i}},31343:(t,e,i)=>{var s=i(79967),n=i(86117),r=i(25227);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e))for(var o=t.getLineA(),a=t.getLineB(),h=t.getLineC(),l=[new s,new s,new s],u=[r(o,e,l[0]),r(a,e,l[1]),r(h,e,l[2])],c=0;c<3;c++)u[c]&&i.push(l[c]);return i}},70534:(t,e,i)=>{var s=i(23589),n=i(31343);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC();n(t,r,i),n(t,o,i),n(t,a,i)}return i}},61472:(t,e,i)=>{var s=i(65650),n=new(i(79967));t.exports=function(t,e,i){if(void 0===i&&(i=n),s(e,t.x1,t.y1))return i.x=t.x1,i.y=t.y1,!0;if(s(e,t.x2,t.y2))return i.x=t.x2,i.y=t.y2,!0;var r=t.x2-t.x1,o=t.y2-t.y1,a=e.x-t.x1,h=e.y-t.y1,l=r*r+o*o,u=r,c=o;if(l>0){var d=(a*r+h*o)/l;u*=d,c*=d}return i.x=t.x1+u,i.y=t.y1+c,u*u+c*c<=l&&u*r+c*o>=0&&s(e,i.x,i.y)}},25227:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=t.x1,r=t.y1,o=t.x2,a=t.y2,h=e.x1,l=e.y1,u=e.x2,c=e.y2,d=(c-l)*(o-n)-(u-h)*(a-r);if(0===d)return!1;var p=((u-h)*(r-l)-(c-l)*(n-h))/d,f=((o-n)*(r-l)-(a-r)*(n-h))/d;return p>=0&&p<=1&&f>=0&&f<=1&&(i.x=n+p*(o-n),i.y=r+p*(a-r),!0)}},47910:t=>{t.exports=function(t,e){var i=t.x1,s=t.y1,n=t.x2,r=t.y2,o=e.x,a=e.y,h=e.right,l=e.bottom,u=0;if(i>=o&&i<=h&&s>=a&&s<=l||n>=o&&n<=h&&r>=a&&r<=l)return!0;if(i=o){if((u=s+(r-s)*(o-i)/(n-i))>a&&u<=l)return!0}else if(i>h&&n<=h&&(u=s+(r-s)*(h-i)/(n-i))>=a&&u<=l)return!0;if(s=a){if((u=i+(n-i)*(a-s)/(r-s))>=o&&u<=h)return!0}else if(s>l&&r<=l&&(u=i+(n-i)*(l-s)/(r-s))>=o&&u<=h)return!0;return!1}},34426:t=>{t.exports=function(t,e,i){void 0===i&&(i=1);var s=e.x1,n=e.y1,r=e.x2,o=e.y2,a=t.x,h=t.y,l=(r-s)*(r-s)+(o-n)*(o-n);if(0===l)return!1;var u=((a-s)*(r-s)+(h-n)*(o-n))/l;if(u<0)return Math.sqrt((s-a)*(s-a)+(n-h)*(n-h))<=i;if(u>=0&&u<=1){var c=((n-h)*(r-s)-(s-a)*(o-n))/l;return Math.abs(c)*Math.sqrt(l)<=i}return Math.sqrt((r-a)*(r-a)+(o-h)*(o-h))<=i}},81414:(t,e,i)=>{var s=i(34426);t.exports=function(t,e){if(!s(t,e))return!1;var i=Math.min(e.x1,e.x2),n=Math.max(e.x1,e.x2),r=Math.min(e.y1,e.y2),o=Math.max(e.y1,e.y2);return t.x>=i&&t.x<=n&&t.y>=r&&t.y<=o}},90205:t=>{t.exports=function(t,e){return!(t.width<=0||t.height<=0||e.width<=0||e.height<=0)&&!(t.righte.right||t.y>e.bottom)}},20370:(t,e,i)=>{var s=i(25227),n=i(94287),r=i(86875),o=i(87279);t.exports=function(t,e){if(e.left>t.right||e.rightt.bottom||e.bottom0}},8786:t=>{t.exports=function(t,e,i,s,n,r){return void 0===r&&(r=0),!(e>t.right+r||it.bottom+r||n{var s=i(61472),n=i(60689);t.exports=function(t,e){return!(t.left>e.right||t.righte.bottom||t.bottom{var s=i(25227);t.exports=function(t,e){return!(!t.contains(e.x1,e.y1)&&!t.contains(e.x2,e.y2))||(!!s(t.getLineA(),e)||(!!s(t.getLineB(),e)||!!s(t.getLineC(),e)))}},23589:(t,e,i)=>{var s=i(86875),n=i(18680),r=i(25227);t.exports=function(t,e){if(t.left>e.right||t.righte.bottom||t.bottom0||(c=n(e),(d=s(t,c,!0)).length>0)}},7563:(t,e,i)=>{t.exports={CircleToCircle:i(22184),CircleToRectangle:i(26535),GetCircleToCircle:i(71145),GetCircleToRectangle:i(62508),GetLineToCircle:i(26111),GetLineToLine:i(96537),GetLineToPoints:i(17647),GetLineToPolygon:i(68439),GetLineToRectangle:i(9569),GetRaysFromPointToPolygon:i(7449),GetRectangleIntersection:i(82931),GetRectangleToRectangle:i(1946),GetRectangleToTriangle:i(34211),GetTriangleToCircle:i(80511),GetTriangleToLine:i(31343),GetTriangleToTriangle:i(70534),LineToCircle:i(61472),LineToLine:i(25227),LineToRectangle:i(47910),PointToLine:i(34426),PointToLineSegment:i(81414),RectangleToRectangle:i(90205),RectangleToTriangle:i(20370),RectangleToValues:i(8786),TriangleToCircle:i(48411),TriangleToLine:i(86117),TriangleToTriangle:i(23589)}},50599:t=>{t.exports=function(t){return Math.atan2(t.y2-t.y1,t.x2-t.x1)}},58813:t=>{t.exports=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=[]);var s=Math.round(t.x1),n=Math.round(t.y1),r=Math.round(t.x2),o=Math.round(t.y2),a=Math.abs(r-s),h=Math.abs(o-n),l=s-h&&(c-=h,s+=l),p{t.exports=function(t,e,i){var s=e-(t.x1+t.x2)/2,n=i-(t.y1+t.y2)/2;return t.x1+=s,t.y1+=n,t.x2+=s,t.y2+=n,t}},26718:(t,e,i)=>{var s=i(88829);t.exports=function(t){return new s(t.x1,t.y1,t.x2,t.y2)}},88930:t=>{t.exports=function(t,e){return e.setTo(t.x1,t.y1,t.x2,t.y2)}},90656:t=>{t.exports=function(t,e){return t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2}},30897:(t,e,i)=>{var s=i(16028);t.exports=function(t,e,i){void 0===i&&(i=e);var n=s(t),r=t.x2-t.x1,o=t.y2-t.y1;return e&&(t.x1=t.x1-r/n*e,t.y1=t.y1-o/n*e),i&&(t.x2=t.x2+r/n*i,t.y2=t.y2+o/n*i),t}},30684:(t,e,i)=>{var s=i(92951),n=i(21902),r=i(79967);t.exports=function(t,e,i,o,a){void 0===o&&(o=0),void 0===a&&(a=[]);var h,l,u=[],c=t.x1,d=t.y1,p=t.x2-c,f=t.y2-d,v=n(e,a),g=i-1;for(h=0;h0){var m=u[0],y=[m];for(h=1;h=o&&(y.push(x),m=x)}var T=u[u.length-1];return s(m,T){var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=(t.x1+t.x2)/2,e.y=(t.y1+t.y2)/2,e}},11222:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=t.x1,r=t.y1,o=t.x2,a=t.y2,h=(o-n)*(o-n)+(a-r)*(a-r);if(0===h)return i;var l=((e.x-n)*(o-n)+(e.y-r)*(a-r))/h;return i.x=n+l*(o-n),i.y=r+l*(a-r),i}},7377:(t,e,i)=>{var s=i(83392),n=i(50599),r=i(79967);t.exports=function(t,e){void 0===e&&(e=new r);var i=n(t)-s.TAU;return e.x=Math.cos(i),e.y=Math.sin(i),e}},66464:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){return void 0===i&&(i=new s),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},8570:(t,e,i)=>{var s=i(16028),n=i(79967);t.exports=function(t,e,i,r){void 0===r&&(r=[]),!e&&i>0&&(e=s(t)/i);for(var o=t.x1,a=t.y1,h=t.x2,l=t.y2,u=0;u{t.exports=function(t,e){var i=t.x1,s=t.y1,n=t.x2,r=t.y2,o=(n-i)*(n-i)+(r-s)*(r-s);if(0===o)return!1;var a=((s-e.y)*(n-i)-(i-e.x)*(r-s))/o;return Math.abs(a)*Math.sqrt(o)}},82996:t=>{t.exports=function(t){return Math.abs(t.y1-t.y2)}},16028:t=>{t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},88829:(t,e,i)=>{var s=i(56694),n=i(66464),r=i(8570),o=i(52394),a=i(74077),h=i(93736),l=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.type=o.LINE,this.x1=t,this.y1=e,this.x2=i,this.y2=s},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return r(this,t,e,i)},getRandomPoint:function(t){return a(this,t)},setTo:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.x1=t,this.y1=e,this.x2=i,this.y2=s,this},getPointA:function(t){return void 0===t&&(t=new h),t.set(this.x1,this.y1),t},getPointB:function(t){return void 0===t&&(t=new h),t.set(this.x2,this.y2),t},left:{get:function(){return Math.min(this.x1,this.x2)},set:function(t){this.x1<=this.x2?this.x1=t:this.x2=t}},right:{get:function(){return Math.max(this.x1,this.x2)},set:function(t){this.x1>this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},73273:(t,e,i)=>{var s=i(83392),n=i(1071),r=i(50599);t.exports=function(t){var e=r(t)-s.TAU;return n(e,-Math.PI,Math.PI)}},96936:(t,e,i)=>{var s=i(83392),n=i(50599);t.exports=function(t){return Math.cos(n(t)-s.TAU)}},43581:(t,e,i)=>{var s=i(83392),n=i(50599);t.exports=function(t){return Math.sin(n(t)-s.TAU)}},13990:t=>{t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t}},1298:t=>{t.exports=function(t){return-(t.x2-t.x1)/(t.y2-t.y1)}},74077:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){void 0===e&&(e=new s);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},30473:(t,e,i)=>{var s=i(50599),n=i(73273);t.exports=function(t,e){return 2*n(e)-Math.PI-s(t)}},25968:(t,e,i)=>{var s=i(1809);t.exports=function(t,e){var i=(t.x1+t.x2)/2,n=(t.y1+t.y2)/2;return s(t,i,n,e)}},24296:(t,e,i)=>{var s=i(1809);t.exports=function(t,e,i){return s(t,e.x,e.y,i)}},1809:t=>{t.exports=function(t,e,i,s){var n=Math.cos(s),r=Math.sin(s),o=t.x1-e,a=t.y1-i;return t.x1=o*n-a*r+e,t.y1=o*r+a*n+i,o=t.x2-e,a=t.y2-i,t.x2=o*n-a*r+e,t.y2=o*r+a*n+i,t}},88171:t=>{t.exports=function(t,e,i,s,n){return t.x1=e,t.y1=i,t.x2=e+Math.cos(s)*n,t.y2=i+Math.sin(s)*n,t}},82797:t=>{t.exports=function(t){return(t.y2-t.y1)/(t.x2-t.x1)}},41067:t=>{t.exports=function(t){return Math.abs(t.x1-t.x2)}},28482:(t,e,i)=>{var s=i(88829);s.Angle=i(50599),s.BresenhamPoints=i(58813),s.CenterOn=i(88513),s.Clone=i(26718),s.CopyFrom=i(88930),s.Equals=i(90656),s.Extend=i(30897),s.GetEasedPoints=i(30684),s.GetMidPoint=i(20487),s.GetNearestPoint=i(11222),s.GetNormal=i(7377),s.GetPoint=i(66464),s.GetPoints=i(8570),s.GetShortestDistance=i(65269),s.Height=i(82996),s.Length=i(16028),s.NormalAngle=i(73273),s.NormalX=i(96936),s.NormalY=i(43581),s.Offset=i(13990),s.PerpSlope=i(1298),s.Random=i(74077),s.ReflectAngle=i(30473),s.Rotate=i(25968),s.RotateAroundPoint=i(24296),s.RotateAroundXY=i(1809),s.SetToAngle=i(88171),s.Slope=i(82797),s.Width=i(41067),t.exports=s},18693:(t,e,i)=>{var s=i(56694),n=i(74118),r=i(93736);function o(t,e,i,s){var n=t-i,r=e-s,o=n*n+r*r;return Math.sqrt(o)}var a=new s({initialize:function(t,e,i){this.vertex1=t,this.vertex2=e,this.vertex3=i,this.bounds=new n,this._inCenter=new r},getInCenter:function(t){void 0===t&&(t=!0);var e,i,s,n,r,a,h=this.vertex1,l=this.vertex2,u=this.vertex3;t?(e=h.x,i=h.y,s=l.x,n=l.y,r=u.x,a=u.y):(e=h.vx,i=h.vy,s=l.vx,n=l.vy,r=u.vx,a=u.vy);var c=o(r,a,s,n),d=o(e,i,r,a),p=o(s,n,e,i),f=c+d+p;return this._inCenter.set((e*c+s*d+r*p)/f,(i*c+n*d+a*p)/f)},contains:function(t,e,i){var s=this.vertex1,n=this.vertex2,r=this.vertex3,o=s.vx,a=s.vy,h=n.vx,l=n.vy,u=r.vx,c=r.vy;if(i){var d=i.a,p=i.b,f=i.c,v=i.d,g=i.e,m=i.f;o=s.vx*d+s.vy*f+g,a=s.vx*p+s.vy*v+m,h=n.vx*d+n.vy*f+g,l=n.vx*p+n.vy*v+m,u=r.vx*d+r.vy*f+g,c=r.vx*p+r.vy*v+m}var y=u-o,x=c-a,T=h-o,w=l-a,b=t-o,E=e-a,S=y*y+x*x,A=y*T+x*w,_=y*b+x*E,C=T*T+w*w,M=T*b+w*E,R=S*C-A*A,P=0===R?0:1/R,O=(C*_-A*M)*P,L=(S*M-A*_)*P;return O>=0&&L>=0&&O+L<1},isCounterClockwise:function(t){var e=this.vertex1,i=this.vertex2,s=this.vertex3,n=(i.vx-e.vx)*(s.vy-e.vy)-(i.vy-e.vy)*(s.vx-e.vx);return t<=0?n>=0:n<0},load:function(t,e,i,s,n){return i=this.vertex1.load(t,e,i,s,n),i=this.vertex2.load(t,e,i,s,n),i=this.vertex3.load(t,e,i,s,n)},transformCoordinatesLocal:function(t,e,i,s){return this.vertex1.transformCoordinatesLocal(t,e,i,s),this.vertex2.transformCoordinatesLocal(t,e,i,s),this.vertex3.transformCoordinatesLocal(t,e,i,s),this},updateBounds:function(){var t=this.vertex1,e=this.vertex2,i=this.vertex3,s=this.bounds;return s.x=Math.min(t.vx,e.vx,i.vx),s.y=Math.min(t.vy,e.vy,i.vy),s.width=Math.max(t.vx,e.vx,i.vx)-s.x,s.height=Math.max(t.vy,e.vy,i.vy)-s.y,this},isInView:function(t,e,i,s,n,r,o,a,h,l,u){var c=this.vertex1.update(n,r,o,a,h,l,u,s),d=this.vertex2.update(n,r,o,a,h,l,u,s),p=this.vertex3.update(n,r,o,a,h,l,u,s);if(c.ta<=0&&d.ta<=0&&p.ta<=0)return!1;if(e&&!this.isCounterClockwise(i))return!1;var f=this.bounds;f.x=Math.min(c.tx,d.tx,p.tx),f.y=Math.min(c.ty,d.ty,p.ty),f.width=Math.max(c.tx,d.tx,p.tx)-f.x,f.height=Math.max(c.ty,d.ty,p.ty)-f.y;var v=t.x+t.width,g=t.y+t.height;return!(f.width<=0||f.height<=0||t.width<=0||t.height<=0)&&!(f.rightv||f.y>g)},translate:function(t,e){void 0===e&&(e=0);var i=this.vertex1,s=this.vertex2,n=this.vertex3;return i.x+=t,i.y+=e,s.x+=t,s.y+=e,n.x+=t,n.y+=e,this},x:{get:function(){return this.getInCenter().x},set:function(t){var e=this.getInCenter();this.translate(t-e.x,0)}},y:{get:function(){return this.getInCenter().y},set:function(t){var e=this.getInCenter();this.translate(0,t-e.y)}},alpha:{get:function(){var t=this.vertex1,e=this.vertex2,i=this.vertex3;return(t.alpha+e.alpha+i.alpha)/3},set:function(t){this.vertex1.alpha=t,this.vertex2.alpha=t,this.vertex3.alpha=t}},depth:{get:function(){var t=this.vertex1,e=this.vertex2,i=this.vertex3;return(t.vz+e.vz+i.vz)/3}},destroy:function(){this.vertex1=null,this.vertex2=null,this.vertex3=null}});t.exports=a},99425:(t,e,i)=>{var s=i(18693),n=i(72632),r=i(16650),o=i(70015),a=i(85769),h=new o,l=new o,u=new r;t.exports=function(t){var e=n(t,"mesh"),i=n(t,"texture",null),r=n(t,"frame"),o=n(t,"width",1),c=n(t,"height",o),d=n(t,"widthSegments",1),p=n(t,"heightSegments",d),f=n(t,"x",0),v=n(t,"y",0),g=n(t,"z",0),m=n(t,"rotateX",0),y=n(t,"rotateY",0),x=n(t,"rotateZ",0),T=n(t,"zIsUp",!0),w=n(t,"isOrtho",!!e&&e.dirtyCache[11]),b=n(t,"colors",[16777215]),E=n(t,"alphas",[1]),S=n(t,"tile",!1),A=n(t,"flipY",!1),_=n(t,"width",null),C={faces:[],verts:[]};if(h.set(f,v,g),l.set(m,y,x),u.fromRotationXYTranslation(l,h,T),!i&&e)i=e.texture;else{if(!e||"string"!=typeof i)return C;i=e.scene.sys.textures.get(i)}var M=i.get(r);!_&&w&&i&&e&&(o=M.width/e.height,c=M.height/e.height);var R,P,O=o/2,L=c/2,F=Math.floor(d),D=Math.floor(p),k=F+1,I=D+1,B=o/F,N=c/D,Y=[],U=[],X=0,z=1,G=0,V=1;M&&(X=M.u0,z=M.u1,A?(G=M.v1,V=M.v0):(G=M.v0,V=M.v1));var W=z-X,H=V-G;for(P=0;P{var s=i(18693),n=i(16650),r=i(70015),o=i(85769),a=new r,h=new r,l=new n;t.exports=function(t,e,i,n,r,u,c,d,p,f){void 0===i&&(i=1),void 0===n&&(n=0),void 0===r&&(r=0),void 0===u&&(u=0),void 0===c&&(c=0),void 0===d&&(d=0),void 0===p&&(p=0),void 0===f&&(f=!0);var v={faces:[],verts:[]},g=t.materials;a.set(n,r,u),h.set(c,d,p),l.fromRotationXYTranslation(h,a,f);for(var m=0;m{var s=i(18693),n=i(85769);t.exports=function(t,e,i,r,o,a,h){if(void 0===r&&(r=!1),void 0===a&&(a=16777215),void 0===h&&(h=1),t.length===e.length){var l,u,c,d,p,f,v,g,m,y,x,T={faces:[],vertices:[]},w=r?3:2,b=Array.isArray(a),E=Array.isArray(h);if(Array.isArray(i)&&i.length>0)for(l=0;l{var e=!0,i="untitled",s="",n="";function r(t){var e=t.indexOf("#");return e>-1?t.substring(0,e):t}function o(t){return 0===t.models.length&&t.models.push({faces:[],name:i,textureCoords:[],vertexNormals:[],vertices:[]}),s="",t.models[t.models.length-1]}function a(t,e){var n=t.length>=2?t[1]:i;e.models.push({faces:[],name:n,textureCoords:[],vertexNormals:[],vertices:[]}),s=""}function h(t){2===t.length&&(s=t[1])}function l(t,e){var i=t.length,s=i>=2?parseFloat(t[1]):0,n=i>=3?parseFloat(t[2]):0,r=i>=4?parseFloat(t[3]):0;o(e).vertices.push({x:s,y:n,z:r})}function u(t,i){var s=t.length,n=s>=2?parseFloat(t[1]):0,r=s>=3?parseFloat(t[2]):0,a=s>=4?parseFloat(t[3]):0;isNaN(n)&&(n=0),isNaN(r)&&(r=0),isNaN(a)&&(a=0),e&&(r=1-r),o(i).textureCoords.push({u:n,v:r,w:a})}function c(t,e){var i=t.length,s=i>=2?parseFloat(t[1]):0,n=i>=3?parseFloat(t[2]):0,r=i>=4?parseFloat(t[3]):0;o(e).vertexNormals.push({x:s,y:n,z:r})}function d(t,e){var i=t.length-1;if(!(i<3)){for(var r={group:s,material:n,vertices:[]},a=0;a3)){var u=0,c=0,d=0;u=parseInt(h[0],10),l>1&&""!==h[1]&&(c=parseInt(h[1],10)),l>2&&(d=parseInt(h[2],10)),0!==u&&(u<0&&(u=o(e).vertices.length+1+u),c-=1,u-=1,d-=1,r.vertices.push({textureCoordsIndex:c,vertexIndex:u,vertexNormalIndex:d}))}}o(e).faces.push(r)}}function p(t,e){t.length>=2&&e.materialLibraries.push(t[1])}function f(t){t.length>=2&&(n=t[1])}t.exports=function(t,i){void 0===i&&(i=!0),e=i;var o={materials:{},materialLibraries:[],models:[]};s="",n="";for(var v=t.split("\n"),g=0;g{var s=i(22946);t.exports=function(t){for(var e={},i=t.split("\n"),n="",r=0;r=2?Math.floor(255*a[2]):h,u=a.length>=3?Math.floor(255*a[3]):h;e[n]=s(h,l,u)}}}return e}},15313:t=>{t.exports=function(t,e,i,s){var n,r;if(void 0===i&&void 0===s){var o=t.getInCenter();n=o.x,r=o.y}var a=Math.cos(e),h=Math.sin(e),l=t.vertex1,u=t.vertex2,c=t.vertex3,d=l.x-n,p=l.y-r;l.set(d*a-p*h+n,d*h+p*a+r),d=u.x-n,p=u.y-r,u.set(d*a-p*h+n,d*h+p*a+r),d=c.x-n,p=c.y-r,c.set(d*a-p*h+n,d*h+p*a+r)}},85769:(t,e,i)=>{var s=i(56694),n=i(75512),r=i(70015),o=new s({Extends:r,initialize:function(t,e,i,s,n,o,a,h,l,u){void 0===o&&(o=16777215),void 0===a&&(a=1),void 0===h&&(h=0),void 0===l&&(l=0),void 0===u&&(u=0),r.call(this,t,e,i),this.vx=0,this.vy=0,this.vz=0,this.nx=h,this.ny=l,this.nz=u,this.u=s,this.v=n,this.color=o,this.alpha=a,this.tx=0,this.ty=0,this.ta=0},setUVs:function(t,e){return this.u=t,this.v=e,this},transformCoordinatesLocal:function(t,e,i,s){var n=this.x,r=this.y,o=this.z,a=t.val,h=n*a[0]+r*a[4]+o*a[8]+a[12],l=n*a[1]+r*a[5]+o*a[9]+a[13],u=n*a[2]+r*a[6]+o*a[10]+a[14],c=n*a[3]+r*a[7]+o*a[11]+a[15];this.vx=h/c*e,this.vy=-l/c*i,this.vz=s<=0?u/c:-u/c},update:function(t,e,i,s,n,r,o,a){var h=this.vx*t+this.vy*i+n,l=this.vx*e+this.vy*s+r;return o&&(h=Math.round(h),l=Math.round(l)),this.tx=h,this.ty=l,this.ta=this.alpha*a,this},load:function(t,e,i,s,r){return t[++i]=this.tx,t[++i]=this.ty,t[++i]=this.u,t[++i]=this.v,t[++i]=s,t[++i]=r,e[++i]=n.getTintAppendFloatAlpha(this.color,this.ta),i}});t.exports=o},14293:(t,e,i)=>{var s={Face:i(18693),GenerateGridVerts:i(99425),GenerateObjVerts:i(53267),GenerateVerts:i(67623),ParseObj:i(27291),ParseObjMaterial:i(76799),RotateFace:i(15313),Vertex:i(85769)};t.exports=s},77601:t=>{t.exports=function(t){return t.setTo(Math.ceil(t.x),Math.ceil(t.y))}},38933:(t,e,i)=>{var s=i(79967);t.exports=function(t){return new s(t.x,t.y)}},47103:t=>{t.exports=function(t,e){return e.setTo(t.x,t.y)}},13625:t=>{t.exports=function(t,e){return t.x===e.x&&t.y===e.y}},12536:t=>{t.exports=function(t){return t.setTo(Math.floor(t.x),Math.floor(t.y))}},54205:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){if(void 0===e&&(e=new s),!Array.isArray(t))throw new Error("GetCentroid points argument must be an array");var i=t.length;if(i<1)throw new Error("GetCentroid points array must not be empty");if(1===i)e.x=t[0].x,e.y=t[0].y;else{for(var n=0;n{t.exports=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)}},82712:t=>{t.exports=function(t){return t.x*t.x+t.y*t.y}},20052:(t,e,i)=>{var s=i(74118);t.exports=function(t,e){void 0===e&&(e=new s);for(var i=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY,a=0;ai&&(i=h.x),h.xr&&(r=h.y),h.y{var s=i(79967);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=new s),n.x=t.x+(e.x-t.x)*i,n.y=t.y+(e.y-t.y)*i,n}},42397:t=>{t.exports=function(t){return t.setTo(t.y,t.x)}},59464:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.setTo(-t.x,-t.y)}},79967:(t,e,i)=>{var s=i(56694),n=i(52394),r=new s({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.type=n.POINT,this.x=t,this.y=e},setTo:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this}});t.exports=r},53581:(t,e,i)=>{var s=i(79967),n=i(82712);t.exports=function(t,e,i){void 0===i&&(i=new s);var r=(t.x*e.x+t.y*e.y)/n(e);return 0!==r&&(i.x=r*e.x,i.y=r*e.y),i}},50817:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=t.x*e.x+t.y*e.y;return 0!==n&&(i.x=n*e.x,i.y=n*e.y),i}},40525:(t,e,i)=>{var s=i(50083);t.exports=function(t,e){if(0!==t.x||0!==t.y){var i=s(t);t.x/=i,t.y/=i}return t.x*=e,t.y*=e,t}},63472:(t,e,i)=>{var s=i(79967);s.Ceil=i(77601),s.Clone=i(38933),s.CopyFrom=i(47103),s.Equals=i(13625),s.Floor=i(12536),s.GetCentroid=i(54205),s.GetMagnitude=i(50083),s.GetMagnitudeSq=i(82712),s.GetRectangleFromPoints=i(20052),s.Interpolate=i(77154),s.Invert=i(42397),s.Negative=i(59464),s.Project=i(53581),s.ProjectUnit=i(50817),s.SetMagnitude=i(40525),t.exports=s},19631:(t,e,i)=>{var s=i(8580);t.exports=function(t){return new s(t.points)}},45604:t=>{t.exports=function(t,e,i){for(var s=!1,n=-1,r=t.points.length-1;++n{var s=i(45604);t.exports=function(t,e){return s(t,e.x,e.y)}},11117:t=>{"use strict";function e(t,e,r){r=r||2;var o,a,h,c,d,f,v,g=e&&e.length,m=g?e[0]*r:t.length,y=i(t,0,m,r,!0),x=[];if(!y||y.next===y.prev)return x;if(g&&(y=function(t,e,n,r){var o,a,h,c=[];for(o=0,a=e.length;o80*r){o=h=t[0],a=c=t[1];for(var T=r;Th&&(h=d),f>c&&(c=f);v=0!==(v=Math.max(h-o,c-a))?1/v:0}return n(y,x,r,o,a,v),x}function i(t,e,i,s,n){var r,o;if(n===_(t,e,i,s)>0)for(r=e;r=e;r-=s)o=E(r,t[r],t[r+1],o);return o&&m(o,o.next)&&(S(o),o=o.next),o}function s(t,e){if(!t)return t;e||(e=t);var i,s=t;do{if(i=!1,s.steiner||!m(s,s.next)&&0!==g(s.prev,s,s.next))s=s.next;else{if(S(s),(s=e=s.prev)===s.next)break;i=!0}}while(i||s!==e);return e}function n(t,e,i,l,u,c,p){if(t){!p&&c&&function(t,e,i,s){var n=t;do{null===n.z&&(n.z=d(n.x,n.y,e,i,s)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){var e,i,s,n,r,o,a,h,l=1;do{for(i=t,t=null,r=null,o=0;i;){for(o++,s=i,a=0,e=0;e0||h>0&&s;)0!==a&&(0===h||!s||i.z<=s.z)?(n=i,i=i.nextZ,a--):(n=s,s=s.nextZ,h--),r?r.nextZ=n:t=n,n.prevZ=r,r=n;i=s}r.nextZ=null,l*=2}while(o>1)}(n)}(t,l,u,c);for(var f,v,g=t;t.prev!==t.next;)if(f=t.prev,v=t.next,c?o(t,l,u,c):r(t))e.push(f.i/i),e.push(t.i/i),e.push(v.i/i),S(t),t=v.next,g=v.next;else if((t=v)===g){p?1===p?n(t=a(s(t),e,i),e,i,l,u,c,2):2===p&&h(t,e,i,l,u,c):n(s(t),e,i,l,u,c,1);break}}}function r(t){var e=t.prev,i=t,s=t.next;if(g(e,i,s)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(f(e.x,e.y,i.x,i.y,s.x,s.y,n.x,n.y)&&g(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function o(t,e,i,s){var n=t.prev,r=t,o=t.next;if(g(n,r,o)>=0)return!1;for(var a=n.xr.x?n.x>o.x?n.x:o.x:r.x>o.x?r.x:o.x,u=n.y>r.y?n.y>o.y?n.y:o.y:r.y>o.y?r.y:o.y,c=d(a,h,e,i,s),p=d(l,u,e,i,s),v=t.prevZ,m=t.nextZ;v&&v.z>=c&&m&&m.z<=p;){if(v!==t.prev&&v!==t.next&&f(n.x,n.y,r.x,r.y,o.x,o.y,v.x,v.y)&&g(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,m!==t.prev&&m!==t.next&&f(n.x,n.y,r.x,r.y,o.x,o.y,m.x,m.y)&&g(m.prev,m,m.next)>=0)return!1;m=m.nextZ}for(;v&&v.z>=c;){if(v!==t.prev&&v!==t.next&&f(n.x,n.y,r.x,r.y,o.x,o.y,v.x,v.y)&&g(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;m&&m.z<=p;){if(m!==t.prev&&m!==t.next&&f(n.x,n.y,r.x,r.y,o.x,o.y,m.x,m.y)&&g(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function a(t,e,i){var n=t;do{var r=n.prev,o=n.next.next;!m(r,o)&&y(r,n,n.next,o)&&w(r,o)&&w(o,r)&&(e.push(r.i/i),e.push(n.i/i),e.push(o.i/i),S(n),S(n.next),n=t=o),n=n.next}while(n!==t);return s(n)}function h(t,e,i,r,o,a){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&v(h,l)){var u=b(h,l);return h=s(h,h.next),u=s(u,u.next),n(h,e,i,r,o,a),void n(u,e,i,r,o,a)}l=l.next}h=h.next}while(h!==t)}function l(t,e){return t.x-e.x}function u(t,e){if(e=function(t,e){var i,s=e,n=t.x,r=t.y,o=-1/0;do{if(r<=s.y&&r>=s.next.y&&s.next.y!==s.y){var a=s.x+(r-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(a<=n&&a>o){if(o=a,a===n){if(r===s.y)return s;if(r===s.next.y)return s.next}i=s.x=s.x&&s.x>=u&&n!==s.x&&f(ri.x||s.x===i.x&&c(i,s)))&&(i=s,p=h)),s=s.next}while(s!==l);return i}(t,e),e){var i=b(e,t);s(e,e.next),s(i,i.next)}}function c(t,e){return g(t.prev,t,e.prev)<0&&g(e.next,t,t.next)<0}function d(t,e,i,s,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-s)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p(t){var e=t,i=t;do{(e.x=0&&(t-o)*(s-a)-(i-o)*(e-a)>=0&&(i-o)*(r-a)-(n-o)*(s-a)>=0}function v(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&y(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(w(t,e)&&w(e,t)&&function(t,e){var i=t,s=!1,n=(t.x+e.x)/2,r=(t.y+e.y)/2;do{i.y>r!=i.next.y>r&&i.next.y!==i.y&&n<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(s=!s),i=i.next}while(i!==t);return s}(t,e)&&(g(t.prev,t,e.prev)||g(t,e.prev,e))||m(t,e)&&g(t.prev,t,t.next)>0&&g(e.prev,e,e.next)>0)}function g(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function m(t,e){return t.x===e.x&&t.y===e.y}function y(t,e,i,s){var n=T(g(t,e,i)),r=T(g(t,e,s)),o=T(g(i,s,t)),a=T(g(i,s,e));return n!==r&&o!==a||(!(0!==n||!x(t,i,e))||(!(0!==r||!x(t,s,e))||(!(0!==o||!x(i,t,s))||!(0!==a||!x(i,e,s)))))}function x(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function T(t){return t>0?1:t<0?-1:0}function w(t,e){return g(t.prev,t,t.next)<0?g(t,e,t.next)>=0&&g(t,t.prev,e)>=0:g(t,e,t.prev)<0||g(t,t.next,e)<0}function b(t,e){var i=new A(t.i,t.x,t.y),s=new A(e.i,e.x,e.y),n=t.next,r=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,s.next=i,i.prev=s,r.next=s,s.prev=r,s}function E(t,e,i,s){var n=new A(t,e,i);return s?(n.next=s.next,n.prev=s,s.next.prev=n,s.next=n):(n.prev=n,n.next=n),n}function S(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function A(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function _(t,e,i,s){for(var n=0,r=e,o=i-s;r0&&(s+=t[n-1].length,i.holes.push(s))}return i},t.exports=e},14045:(t,e,i)=>{var s=i(74118);t.exports=function(t,e){void 0===e&&(e=new s);for(var i,n=1/0,r=1/0,o=-n,a=-r,h=0;h{t.exports=function(t,e){void 0===e&&(e=[]);for(var i=0;i{var s=i(16028),n=i(88829),r=i(5159);t.exports=function(t,e,i,o){void 0===o&&(o=[]);var a=t.points,h=r(t);!e&&i>0&&(e=h/i);for(var l=0;lc+g)){var m=v.getPoint((u-c)/g);o.push(m);break}c+=g}return o}},5159:(t,e,i)=>{var s=i(16028),n=i(88829);t.exports=function(t){for(var e=t.points,i=0,r=0;r{var s=i(56694),n=i(45604),r=i(89294),o=i(52394),a=new s({initialize:function(t){this.type=o.POLYGON,this.area=0,this.points=[],t&&this.setTo(t)},contains:function(t,e){return n(this,t,e)},setTo:function(t){if(this.area=0,this.points=[],"string"==typeof t&&(t=t.split(" ")),!Array.isArray(t))return this;for(var e,i=Number.MAX_VALUE,s=0;s{t.exports=function(t){return t.points.reverse(),t}},95874:t=>{function e(t,e,i){var s=e.x,n=e.y,r=i.x-s,o=i.y-n;if(0!==r||0!==o){var a=((t.x-s)*r+(t.y-n)*o)/(r*r+o*o);a>1?(s=i.x,n=i.y):a>0&&(s+=r*a,n+=o*a)}return(r=t.x-s)*r+(o=t.y-n)*o}function i(t,s,n,r,o){for(var a,h=r,l=s+1;lh&&(a=l,h=u)}h>r&&(a-s>1&&i(t,s,a,r,o),o.push(t[a]),n-a>1&&i(t,a,n,r,o))}function s(t,e){var s=t.length-1,n=[t[0]];return i(t,0,s,e,n),n.push(t[s]),n}t.exports=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=!1);var n=t.points;if(n.length>2){var r=e*e;i||(n=function(t,e){for(var i,s,n,r,o,a=t[0],h=[a],l=1,u=t.length;le&&(h.push(i),a=i);return a!==i&&h.push(i),h}(n,r)),t.setTo(s(n,r))}return t}},18974:t=>{var e=function(t,e){return t[0]=e[0],t[1]=e[1],t};t.exports=function(t){var i,s=[],n=t.points;for(i=0;i0&&r.push(e([0,0],s[0])),i=0;i1&&r.push(e([0,0],s[s.length-1])),t.setTo(r)}},23490:t=>{t.exports=function(t,e,i){for(var s=t.points,n=0;n{var s=i(8580);s.Clone=i(19631),s.Contains=i(45604),s.ContainsPoint=i(87289),s.Earcut=i(11117),s.GetAABB=i(14045),s.GetNumberArray=i(98286),s.GetPoints=i(89294),s.Perimeter=i(5159),s.Reverse=i(32244),s.Simplify=i(95874),s.Smooth=i(18974),s.Translate=i(23490),t.exports=s},1653:t=>{t.exports=function(t){return t.width*t.height}},33943:t=>{t.exports=function(t){return t.x=Math.ceil(t.x),t.y=Math.ceil(t.y),t}},58662:t=>{t.exports=function(t){return t.x=Math.ceil(t.x),t.y=Math.ceil(t.y),t.width=Math.ceil(t.width),t.height=Math.ceil(t.height),t}},79993:t=>{t.exports=function(t,e,i){return t.x=e-t.width/2,t.y=i-t.height/2,t}},81572:(t,e,i)=>{var s=i(74118);t.exports=function(t){return new s(t.x,t.y,t.width,t.height)}},94287:t=>{t.exports=function(t,e,i){return!(t.width<=0||t.height<=0)&&(t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i)}},28687:(t,e,i)=>{var s=i(94287);t.exports=function(t,e){return s(t,e.x,e.y)}},73222:t=>{t.exports=function(t,e){return!(e.width*e.height>t.width*t.height)&&(e.x>t.x&&e.xt.x&&e.rightt.y&&e.yt.y&&e.bottom{t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},87279:t=>{t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x,y:t.y}),e.push({x:t.right,y:t.y}),e.push({x:t.right,y:t.bottom}),e.push({x:t.x,y:t.bottom}),e}},19989:t=>{t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},92628:(t,e,i)=>{var s=i(6700);t.exports=function(t,e){var i=s(t);return i{var s=i(6700);t.exports=function(t,e){var i=s(t);return i>s(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},71356:t=>{t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t}},21687:t=>{t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height),t}},80222:(t,e,i)=>{var s=i(74118),n=i(83392);t.exports=function(t,e){if(void 0===e&&(e=new s),0===t.length)return e;for(var i,r,o,a=Number.MAX_VALUE,h=Number.MAX_VALUE,l=n.MIN_SAFE_INTEGER,u=n.MIN_SAFE_INTEGER,c=0;c{var s=i(74118);t.exports=function(t,e,i,n,r){return void 0===r&&(r=new s),r.setTo(Math.min(t,i),Math.min(e,n),Math.abs(t-i),Math.abs(e-n))}},6700:t=>{t.exports=function(t){return 0===t.height?NaN:t.width/t.height}},35242:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.centerX,e.y=t.centerY,e}},47698:(t,e,i)=>{var s=i(85876),n=i(79967);t.exports=function(t,e,i){if(void 0===i&&(i=new n),e<=0||e>=1)return i.x=t.x,i.y=t.y,i;var r=s(t)*e;return e>.5?(r-=t.width+t.height)<=t.width?(i.x=t.right-r,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(r-t.width)):r<=t.width?(i.x=t.x+r,i.y=t.y):(i.x=t.right,i.y=t.y+(r-t.width)),i}},54932:(t,e,i)=>{var s=i(47698),n=i(85876);t.exports=function(t,e,i,r){void 0===r&&(r=[]),!e&&i>0&&(e=n(t)/i);for(var o=0;o{var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.width,e.y=t.height,e}},7782:(t,e,i)=>{var s=i(79993);t.exports=function(t,e,i){var n=t.centerX,r=t.centerY;return t.setSize(t.width+2*e,t.height+2*i),s(t,n,r)}},66217:(t,e,i)=>{var s=i(74118),n=i(90205);t.exports=function(t,e,i){return void 0===i&&(i=new s),n(t,e)?(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y):i.setEmpty(),i}},40053:(t,e,i)=>{var s=i(85876),n=i(79967);t.exports=function(t,e,i,r){if(void 0===r&&(r=[]),!e&&!i)return r;e?i=Math.round(s(t)/e):e=s(t)/i;for(var o=t.x,a=t.y,h=0,l=0;l=t.right&&(h=1,a+=o-t.right,o=t.right);break;case 1:(a+=e)>=t.bottom&&(h=2,o-=a-t.bottom,a=t.bottom);break;case 2:(o-=e)<=t.left&&(h=3,a-=t.left-o,o=t.left);break;case 3:(a-=e)<=t.top&&(h=0,a=t.top)}return r}},86673:t=>{t.exports=function(t,e){for(var i=t.x,s=t.right,n=t.y,r=t.bottom,o=0;o{t.exports=function(t,e){var i=Math.min(t.x,e.x),s=Math.max(t.right,e.right);t.x=i,t.width=s-i;var n=Math.min(t.y,e.y),r=Math.max(t.bottom,e.bottom);return t.y=n,t.height=r-n,t}},44755:t=>{t.exports=function(t,e,i){var s=Math.min(t.x,e),n=Math.max(t.right,e);t.x=s,t.width=n-s;var r=Math.min(t.y,i),o=Math.max(t.bottom,i);return t.y=r,t.height=o-r,t}},74466:t=>{t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},55946:t=>{t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},97474:t=>{t.exports=function(t,e){return t.xe.x&&t.ye.y}},85876:t=>{t.exports=function(t){return 2*(t.width+t.height)}},20243:(t,e,i)=>{var s=i(79967),n=i(75606);t.exports=function(t,e,i){void 0===i&&(i=new s),e=n(e);var r=Math.sin(e),o=Math.cos(e),a=o>0?t.width/2:t.width/-2,h=r>0?t.height/2:t.height/-2;return Math.abs(a*r){var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.x+Math.random()*t.width,e.y=t.y+Math.random()*t.height,e}},97691:(t,e,i)=>{var s=i(17489),n=i(73222),r=i(79967);t.exports=function(t,e,i){if(void 0===i&&(i=new r),n(t,e))switch(s(0,3)){case 0:i.x=t.x+Math.random()*(e.right-t.x),i.y=t.y+Math.random()*(e.top-t.y);break;case 1:i.x=e.x+Math.random()*(t.right-e.x),i.y=e.bottom+Math.random()*(t.bottom-e.bottom);break;case 2:i.x=t.x+Math.random()*(e.x-t.x),i.y=e.y+Math.random()*(t.bottom-e.y);break;case 3:i.x=e.right+Math.random()*(t.right-e.right),i.y=t.y+Math.random()*(e.bottom-t.y)}return i}},74118:(t,e,i)=>{var s=i(56694),n=i(94287),r=i(47698),o=i(54932),a=i(52394),h=i(88829),l=i(30001),u=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.type=a.RECTANGLE,this.x=t,this.y=e,this.width=i,this.height=s},contains:function(t,e){return n(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.y,this.right,this.y),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.y,this.right,this.bottom),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.bottom,this.x,this.bottom),t},getLineD:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.bottom,this.x,this.y),t},left:{get:function(){return this.x},set:function(t){t>=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=u},51828:t=>{t.exports=function(t,e){return t.width===e.width&&t.height===e.height}},5691:t=>{t.exports=function(t,e,i){return void 0===i&&(i=e),t.width*=e,t.height*=i,t}},58795:(t,e,i)=>{var s=i(74118);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=Math.min(t.x,e.x),r=Math.min(t.y,e.y),o=Math.max(t.right,e.right)-n,a=Math.max(t.bottom,e.bottom)-r;return i.setTo(n,r,o,a)}},66658:(t,e,i)=>{var s=i(74118);s.Area=i(1653),s.Ceil=i(33943),s.CeilAll=i(58662),s.CenterOn=i(79993),s.Clone=i(81572),s.Contains=i(94287),s.ContainsPoint=i(28687),s.ContainsRect=i(73222),s.CopyFrom=i(29538),s.Decompose=i(87279),s.Equals=i(19989),s.FitInside=i(92628),s.FitOutside=i(85028),s.Floor=i(71356),s.FloorAll=i(21687),s.FromPoints=i(80222),s.FromXY=i(75785),s.GetAspectRatio=i(6700),s.GetCenter=i(35242),s.GetPoint=i(47698),s.GetPoints=i(54932),s.GetSize=i(31591),s.Inflate=i(7782),s.Intersection=i(66217),s.MarchingAnts=i(40053),s.MergePoints=i(86673),s.MergeRect=i(14655),s.MergeXY=i(44755),s.Offset=i(74466),s.OffsetPoint=i(55946),s.Overlaps=i(97474),s.Perimeter=i(85876),s.PerimeterPoint=i(20243),s.Random=i(30001),s.RandomOutside=i(97691),s.SameDimensions=i(51828),s.Scale=i(5691),s.Union=i(58795),t.exports=s},19108:t=>{t.exports=function(t){var e=t.x1,i=t.y1,s=t.x2,n=t.y2,r=t.x3,o=t.y3;return Math.abs(((r-e)*(n-i)-(s-e)*(o-i))/2)}},41199:(t,e,i)=>{var s=i(66349);t.exports=function(t,e,i){var n=i*(Math.sqrt(3)/2);return new s(t,e,t+i/2,e+n,t-i/2,e+n)}},88730:(t,e,i)=>{var s=i(11117),n=i(66349);t.exports=function(t,e,i,r,o){void 0===e&&(e=null),void 0===i&&(i=1),void 0===r&&(r=1),void 0===o&&(o=[]);for(var a,h,l,u,c,d,p,f,v,g=s(t,e),m=0;m{var s=i(66349);t.exports=function(t,e,i,n){return void 0===n&&(n=i),new s(t,e,t,e-n,t+i,e)}},1882:(t,e,i)=>{var s=i(56595),n=i(9640);t.exports=function(t,e,i,r){void 0===r&&(r=s);var o=r(t),a=e-o.x,h=i-o.y;return n(t,a,h)}},56595:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=(t.x1+t.x2+t.x3)/3,e.y=(t.y1+t.y2+t.y3)/3,e}},91835:(t,e,i)=>{var s=i(93736);function n(t,e,i,s){return t*s-e*i}t.exports=function(t,e){void 0===e&&(e=new s);var i=t.x3,r=t.y3,o=t.x1-i,a=t.y1-r,h=t.x2-i,l=t.y2-r,u=2*n(o,a,h,l),c=n(a,o*o+a*a,l,h*h+l*l),d=n(o,o*o+a*a,h,h*h+l*l);return e.x=i-c/u,e.y=r+d/u,e}},97073:(t,e,i)=>{var s=i(26673);t.exports=function(t,e){void 0===e&&(e=new s);var i,n,r=t.x1,o=t.y1,a=t.x2,h=t.y2,l=t.x3,u=t.y3,c=a-r,d=h-o,p=l-r,f=u-o,v=c*(r+a)+d*(o+h),g=p*(r+l)+f*(o+u),m=2*(c*(u-h)-d*(l-a));if(Math.abs(m)<1e-6){var y=Math.min(r,a,l),x=Math.min(o,h,u);i=.5*(Math.max(r,a,l)-y),n=.5*(Math.max(o,h,u)-x),e.x=y+i,e.y=x+n,e.radius=Math.sqrt(i*i+n*n)}else e.x=(f*v-d*g)/m,e.y=(c*g-p*v)/m,i=e.x-r,n=e.y-o,e.radius=Math.sqrt(i*i+n*n);return e}},75974:(t,e,i)=>{var s=i(66349);t.exports=function(t){return new s(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}},60689:t=>{t.exports=function(t,e,i){var s=t.x3-t.x1,n=t.y3-t.y1,r=t.x2-t.x1,o=t.y2-t.y1,a=e-t.x1,h=i-t.y1,l=s*s+n*n,u=s*r+n*o,c=s*a+n*h,d=r*r+o*o,p=r*a+o*h,f=l*d-u*u,v=0===f?0:1/f,g=(d*c-u*p)*v,m=(l*p-u*c)*v;return g>=0&&m>=0&&g+m<1}},86875:t=>{t.exports=function(t,e,i,s){void 0===i&&(i=!1),void 0===s&&(s=[]);for(var n,r,o,a,h,l,u=t.x3-t.x1,c=t.y3-t.y1,d=t.x2-t.x1,p=t.y2-t.y1,f=u*u+c*c,v=u*d+c*p,g=d*d+p*p,m=f*g-v*v,y=0===m?0:1/m,x=t.x1,T=t.y1,w=0;w=0&&r>=0&&n+r<1&&(s.push({x:e[w].x,y:e[w].y}),i)));w++);return s}},51532:(t,e,i)=>{var s=i(60689);t.exports=function(t,e){return s(t,e.x,e.y)}},42538:t=>{t.exports=function(t,e){return e.setTo(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}},18680:t=>{t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x1,y:t.y1}),e.push({x:t.x2,y:t.y2}),e.push({x:t.x3,y:t.y3}),e}},29977:t=>{t.exports=function(t,e){return t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2&&t.x3===e.x3&&t.y3===e.y3}},56088:(t,e,i)=>{var s=i(79967),n=i(16028);t.exports=function(t,e,i){void 0===i&&(i=new s);var r=t.getLineA(),o=t.getLineB(),a=t.getLineC();if(e<=0||e>=1)return i.x=r.x1,i.y=r.y1,i;var h=n(r),l=n(o),u=n(a),c=(h+l+u)*e,d=0;return ch+l?(d=(c-=h+l)/u,i.x=a.x1+(a.x2-a.x1)*d,i.y=a.y1+(a.y2-a.y1)*d):(d=(c-=h)/l,i.x=o.x1+(o.x2-o.x1)*d,i.y=o.y1+(o.y2-o.y1)*d),i}},24402:(t,e,i)=>{var s=i(16028),n=i(79967);t.exports=function(t,e,i,r){void 0===r&&(r=[]);var o=t.getLineA(),a=t.getLineB(),h=t.getLineC(),l=s(o),u=s(a),c=s(h),d=l+u+c;!e&&i>0&&(e=d/i);for(var p=0;pl+u?(v=(f-=l+u)/c,g.x=h.x1+(h.x2-h.x1)*v,g.y=h.y1+(h.y2-h.y1)*v):(v=(f-=l)/u,g.x=a.x1+(a.x2-a.x1)*v,g.y=a.y1+(a.y2-a.y1)*v),r.push(g)}return r}},83648:(t,e,i)=>{var s=i(79967);function n(t,e,i,s){var n=t-i,r=e-s,o=n*n+r*r;return Math.sqrt(o)}t.exports=function(t,e){void 0===e&&(e=new s);var i=t.x1,r=t.y1,o=t.x2,a=t.y2,h=t.x3,l=t.y3,u=n(h,l,o,a),c=n(i,r,h,l),d=n(o,a,i,r),p=u+c+d;return e.x=(i*u+o*c+h*d)/p,e.y=(r*u+a*c+l*d)/p,e}},9640:t=>{t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t.x3+=e,t.y3+=i,t}},95290:(t,e,i)=>{var s=i(16028);t.exports=function(t){var e=t.getLineA(),i=t.getLineB(),n=t.getLineC();return s(e)+s(i)+s(n)}},99761:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){void 0===e&&(e=new s);var i=t.x2-t.x1,n=t.y2-t.y1,r=t.x3-t.x1,o=t.y3-t.y1,a=Math.random(),h=Math.random();return a+h>=1&&(a=1-a,h=1-h),e.x=t.x1+(i*a+r*h),e.y=t.y1+(n*a+o*h),e}},21934:(t,e,i)=>{var s=i(19211),n=i(83648);t.exports=function(t,e){var i=n(t);return s(t,i.x,i.y,e)}},68454:(t,e,i)=>{var s=i(19211);t.exports=function(t,e,i){return s(t,e.x,e.y,i)}},19211:t=>{t.exports=function(t,e,i,s){var n=Math.cos(s),r=Math.sin(s),o=t.x1-e,a=t.y1-i;return t.x1=o*n-a*r+e,t.y1=o*r+a*n+i,o=t.x2-e,a=t.y2-i,t.x2=o*n-a*r+e,t.y2=o*r+a*n+i,o=t.x3-e,a=t.y3-i,t.x3=o*n-a*r+e,t.y3=o*r+a*n+i,t}},66349:(t,e,i)=>{var s=i(56694),n=i(60689),r=i(56088),o=i(24402),a=i(52394),h=i(88829),l=i(99761),u=new s({initialize:function(t,e,i,s,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=0),this.type=a.TRIANGLE,this.x1=t,this.y1=e,this.x2=i,this.y2=s,this.x3=n,this.y3=r},contains:function(t,e){return n(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,s,n,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=0),this.x1=t,this.y1=e,this.x2=i,this.y2=s,this.x3=n,this.y3=r,this},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x1,this.y1,this.x2,this.y2),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.x2,this.y2,this.x3,this.y3),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.x3,this.y3,this.x1,this.y1),t},left:{get:function(){return Math.min(this.x1,this.x2,this.x3)},set:function(t){var e=0;e=this.x1<=this.x2&&this.x1<=this.x3?this.x1-t:this.x2<=this.x1&&this.x2<=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},right:{get:function(){return Math.max(this.x1,this.x2,this.x3)},set:function(t){var e=0;e=this.x1>=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=u},87619:(t,e,i)=>{var s=i(66349);s.Area=i(19108),s.BuildEquilateral=i(41199),s.BuildFromPolygon=i(88730),s.BuildRight=i(3635),s.CenterOn=i(1882),s.Centroid=i(56595),s.CircumCenter=i(91835),s.CircumCircle=i(97073),s.Clone=i(75974),s.Contains=i(60689),s.ContainsArray=i(86875),s.ContainsPoint=i(51532),s.CopyFrom=i(42538),s.Decompose=i(18680),s.Equals=i(29977),s.GetPoint=i(56088),s.GetPoints=i(24402),s.InCenter=i(83648),s.Perimeter=i(95290),s.Offset=i(9640),s.Random=i(99761),s.Rotate=i(21934),s.RotateAroundPoint=i(68454),s.RotateAroundXY=i(19211),t.exports=s},27395:t=>{t.exports=function(t,e,i){return{gameObject:t,enabled:!0,alwaysEnabled:!1,draggable:!1,dropZone:!1,cursor:!1,target:null,camera:null,hitArea:e,hitAreaCallback:i,hitAreaDebug:null,customHitArea:!1,localX:0,localY:0,dragState:0,dragStartX:0,dragStartY:0,dragStartXGlobal:0,dragStartYGlobal:0,dragX:0,dragY:0}}},18104:t=>{t.exports=function(t,e){return function(i,s,n,r){var o=t.getPixelAlpha(s,n,r.texture.key,r.frame.name);return o&&o>=e}}},69898:(t,e,i)=>{var s=i(56694),n=i(72687),r=i(6659),o=i(33963),a=i(97081),h=i(71064),l=i(7905),u=i(40398),c=i(37579),d=i(69360),p=i(64462),f=new s({initialize:function(t,e){this.game=t,this.scaleManager,this.canvas,this.config=e,this.enabled=!0,this.events=new r,this.isOver=!0,this.defaultCursor="",this.keyboard=e.inputKeyboard?new h(this):null,this.mouse=e.inputMouse?new l(this):null,this.touch=e.inputTouch?new c(this):null,this.pointers=[],this.pointersTotal=e.inputActivePointers,e.inputTouch&&1===this.pointersTotal&&(this.pointersTotal=2);for(var i=0;i<=this.pointersTotal;i++){var s=new u(this,i);s.smoothFactor=e.inputSmoothFactor,this.pointers.push(s)}this.mousePointer=e.inputMouse?this.pointers[0]:null,this.activePointer=this.pointers[0],this.globalTopOnly=!0,this.time=0,this._tempPoint={x:0,y:0},this._tempHitTest=[],this._tempMatrix=new d,this._tempMatrix2=new d,this._tempSkip=!1,this.mousePointerContainer=[this.mousePointer],t.events.once(a.BOOT,this.boot,this)},boot:function(){this.canvas=this.game.canvas,this.scaleManager=this.game.scale,this.events.emit(o.MANAGER_BOOT),this.game.events.on(a.PRE_RENDER,this.preRender,this),this.game.events.once(a.DESTROY,this.destroy,this)},setCanvasOver:function(t){this.isOver=!0,this.events.emit(o.GAME_OVER,t)},setCanvasOut:function(t){this.isOver=!1,this.events.emit(o.GAME_OUT,t)},preRender:function(){var t=this.game.loop.now,e=this.game.loop.delta,i=this.game.scene.getScenes(!0,!0);this.time=t,this.events.emit(o.MANAGER_UPDATE);for(var s=0;s10&&(t=10-this.pointersTotal);for(var i=0;i{var s=i(26673),n=i(65650),r=i(56694),o=i(72687),a=i(27395),h=i(18104),l=i(53996),u=i(95669),c=i(72313),d=i(33963),p=i(6659),f=i(72632),v=i(52394),g=i(63399),m=i(42911),y=i(91963),x=i(74118),T=i(94287),w=i(7599),b=i(66349),E=i(60689),S=new r({Extends:p,initialize:function(t){p.call(this),this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.manager=t.sys.game.input,this.pluginEvents=new p,this.enabled=!0,this.displayList,this.cameras,g.install(this),this.mouse=this.manager.mouse,this.topOnly=!0,this.pollRate=-1,this._pollTimer=0;var e={cancelled:!1};this._eventContainer={stopPropagation:function(){e.cancelled=!0}},this._eventData=e,this.dragDistanceThreshold=0,this.dragTimeThreshold=0,this._temp=[],this._tempZones=[],this._list=[],this._pendingInsertion=[],this._pendingRemoval=[],this._draggable=[],this._drag={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._dragState=[],this._over={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._validTypes=["onDown","onUp","onOver","onOut","onMove","onDragStart","onDrag","onDragEnd","onDragEnter","onDragLeave","onDragOver","onDrop"],this._updatedThisFrame=!1,t.sys.events.once(w.BOOT,this.boot,this),t.sys.events.on(w.START,this.start,this)},boot:function(){this.cameras=this.systems.cameras,this.displayList=this.systems.displayList,this.systems.events.once(w.DESTROY,this.destroy,this),this.pluginEvents.emit(d.BOOT)},start:function(){var t=this.systems.events;t.on(w.TRANSITION_START,this.transitionIn,this),t.on(w.TRANSITION_OUT,this.transitionOut,this),t.on(w.TRANSITION_COMPLETE,this.transitionComplete,this),t.on(w.PRE_UPDATE,this.preUpdate,this),t.once(w.SHUTDOWN,this.shutdown,this),this.manager.events.on(d.GAME_OUT,this.onGameOut,this),this.manager.events.on(d.GAME_OVER,this.onGameOver,this),this.enabled=!0,this._dragState=[0,0,0,0,0,0,0,0,0,0],this.pluginEvents.emit(d.START)},onGameOver:function(t){this.isActive()&&this.emit(d.GAME_OVER,t.timeStamp,t)},onGameOut:function(t){this.isActive()&&this.emit(d.GAME_OUT,t.timeStamp,t)},preUpdate:function(){this.pluginEvents.emit(d.PRE_UPDATE);var t=this._pendingRemoval,e=this._pendingInsertion,i=t.length,s=e.length;if(0!==i||0!==s){for(var n=this._list,r=0;r-1&&(n.splice(a,1),this.clear(o,!0))}t.length=0,this._pendingRemoval.length=0,this._list=n.concat(e.splice(0))}},isActive:function(){return this.enabled&&this.scene.sys.isActive()},updatePoll:function(t,e){if(!this.isActive())return!1;if(this.pluginEvents.emit(d.UPDATE,t,e),this._updatedThisFrame)return this._updatedThisFrame=!1,!1;var i,s=this.manager,n=s.pointers,r=s.pointersTotal;for(i=0;i0){if(this._pollTimer-=e,!(this._pollTimer<0))return!1;this._pollTimer=this.pollRate}var a=!1;for(i=0;i0&&(a=!0)}return a},update:function(t,e){if(!this.isActive())return!1;for(var i=e.length,s=!1,n=0;n0&&(s=!0)}return this._updatedThisFrame=!0,s},clear:function(t,e){void 0===e&&(e=!1);var i=t.input;if(i){e||this.queueForRemoval(t),i.gameObject=void 0,i.target=void 0,i.hitArea=void 0,i.hitAreaCallback=void 0,i.callbackContext=void 0,t.input=null;var s=this._draggable.indexOf(t);return s>-1&&this._draggable.splice(s,1),(s=this._drag[0].indexOf(t))>-1&&this._drag[0].splice(s,1),(s=this._over[0].indexOf(t))>-1&&(this._over[0].splice(s,1),this.manager.resetCursor(i)),t}},disable:function(t){t.input.enabled=!1},enable:function(t,e,i,s){return void 0===s&&(s=!1),t.input?t.input.enabled=!0:this.setHitArea(t,e,i),t.input&&s&&!t.input.dropZone&&(t.input.dropZone=s),this},hitTestPointer:function(t){for(var e=this.cameras.getCamerasBelowPointer(t),i=0;i0)return t.camera=s,n}return t.camera=e[0],[]},processDownEvents:function(t){var e=0,i=this._temp,s=this._eventData,n=this._eventContainer;s.cancelled=!1;for(var r=!1,o=0;o0&&l(t.x,t.y,t.downX,t.downY)>=n||s>0&&e>=t.downTime+s)&&(i=!0),i)return this.setDragState(t,3),this.processDragStartList(t)},processDragStartList:function(t){if(3!==this.getDragState(t))return 0;for(var e=this._drag[t.id],i=0;i1&&(this.sortGameObjects(i,t),this.topOnly&&i.splice(1)),this._drag[t.id]=i,0===this.dragDistanceThreshold&&0===this.dragTimeThreshold?(this.setDragState(t,3),this.processDragStartList(t)):(this.setDragState(t,2),0))},processDragMoveEvent:function(t){if(2===this.getDragState(t)&&this.processDragThresholdEvent(t,this.manager.game.loop.now),4!==this.getDragState(t))return 0;for(var e=this._tempZones,i=this._drag[t.id],s=0;s0?(o.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,o,h),a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h)):(o.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,o,h),e[0]?(a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h)):a.target=null)}else!h&&e[0]&&(a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h));if(o.parentContainer){var u=t.worldX-a.dragStartXGlobal,c=t.worldY-a.dragStartYGlobal,p=o.getParentRotation(),f=u*Math.cos(p)+c*Math.sin(p),v=c*Math.cos(p)-u*Math.sin(p);f*=1/o.parentContainer.scaleX,v*=1/o.parentContainer.scaleY,n=f+a.dragStartX,r=v+a.dragStartY}else n=t.worldX-a.dragX,r=t.worldY-a.dragY;o.emit(d.GAMEOBJECT_DRAG,t,n,r),this.emit(d.DRAG,t,o,n,r)}return i.length},processDragUpEvent:function(t){for(var e=this._drag[t.id],i=0;i0){var r=this.manager,o=this._eventData,a=this._eventContainer;o.cancelled=!1;for(var h=!1,l=0;l0){var n=this.manager,r=this._eventData,o=this._eventContainer;r.cancelled=!1;var a=!1;this.sortGameObjects(e,t);for(var h=0;h0){for(this.sortGameObjects(n,t),e=0;e0){for(this.sortGameObjects(r,t),e=0;e-1&&this._draggable.splice(n,1)}return this},makePixelPerfect:function(t){void 0===t&&(t=1);var e=this.systems.textures;return h(e,t)},setHitArea:function(t,e,i){if(void 0===e)return this.setHitAreaFromTexture(t);Array.isArray(t)||(t=[t]);var s=!1,n=!1,r=!1,o=!1,h=!1,l=!0;if(m(e)){var u=e;e=f(u,"hitArea",null),i=f(u,"hitAreaCallback",null),s=f(u,"draggable",!1),n=f(u,"dropZone",!1),r=f(u,"cursor",!1),o=f(u,"useHandCursor",!1),h=f(u,"pixelPerfect",!1);var c=f(u,"alphaTolerance",1);h&&(e={},i=this.makePixelPerfect(c)),e&&i||(this.setHitAreaFromTexture(t),l=!1)}else"function"!=typeof e||i||(i=e,e={});for(var d=0;d{var s=i(10850),n={},r={register:function(t,e,i,s,r){n[t]={plugin:e,mapping:i,settingsKey:s,configKey:r}},getPlugin:function(t){return n[t]},install:function(t){var e=t.scene.sys,i=e.settings.input,r=e.game.config;for(var o in n){var a=n[o].plugin,h=n[o].mapping,l=n[o].settingsKey,u=n[o].configKey;s(i,l,r[u])&&(t[h]=new a(t))}},remove:function(t){n.hasOwnProperty(t)&&delete n[t]}};t.exports=r},40398:(t,e,i)=>{var s=i(90447),n=i(56694),r=i(53996),o=i(88456),a=i(44521),h=i(93736),l=i(36580),u=new n({initialize:function(t,e){this.manager=t,this.id=e,this.event,this.downElement,this.upElement,this.camera=null,this.button=0,this.buttons=0,this.position=new h,this.prevPosition=new h,this.midPoint=new h(-1,-1),this.velocity=new h,this.angle=0,this.distance=0,this.smoothFactor=0,this.motionFactor=.2,this.worldX=0,this.worldY=0,this.moveTime=0,this.downX=0,this.downY=0,this.downTime=0,this.upX=0,this.upY=0,this.upTime=0,this.primaryDown=!1,this.isDown=!1,this.wasTouch=!1,this.wasCanceled=!1,this.movementX=0,this.movementY=0,this.identifier=0,this.pointerId=null,this.active=0===e,this.locked=!1,this.deltaX=0,this.deltaY=0,this.deltaZ=0},updateWorldPoint:function(t){var e=t.getWorldPoint(this.x,this.y);return this.worldX=e.x,this.worldY=e.y,this},positionToCamera:function(t,e){return t.getWorldPoint(this.x,this.y,e)},updateMotion:function(){var t=this.position.x,e=this.position.y,i=this.midPoint.x,n=this.midPoint.y;if(t!==i||e!==n){var r=a(this.motionFactor,i,t),h=a(this.motionFactor,n,e);o(r,t,.1)&&(r=t),o(h,e,.1)&&(h=e),this.midPoint.set(r,h);var l=t-r,u=e-h;this.velocity.set(l,u),this.angle=s(r,h,t,e),this.distance=Math.sqrt(l*l+u*u)}},up:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!1,this.upX=this.x,this.upY=this.y),0===this.buttons&&(this.isDown=!1,this.upTime=t.timeStamp,this.wasTouch=!1)},down:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!0,this.downX=this.x,this.downY=this.y),l.macOS&&t.ctrlKey&&(this.buttons=2,this.primaryDown=!1),this.isDown||(this.isDown=!0,this.downTime=t.timeStamp),this.wasTouch=!1},move:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.locked&&(this.movementX=t.movementX||t.mozMovementX||t.webkitMovementX||0,this.movementY=t.movementY||t.mozMovementY||t.webkitMovementY||0),this.moveTime=t.timeStamp,this.wasTouch=!1},wheel:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.deltaX=t.deltaX,this.deltaY=t.deltaY,this.deltaZ=t.deltaZ,this.wasTouch=!1},touchstart:function(t,e){t.pointerId&&(this.pointerId=t.pointerId),this.identifier=t.identifier,this.target=t.target,this.active=!0,this.buttons=1,this.event=e,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=e.timeStamp,this.isDown=!0,this.wasTouch=!0,this.wasCanceled=!1,this.updateMotion()},touchmove:function(t,e){this.event=e,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.moveTime=e.timeStamp,this.wasTouch=!0,this.updateMotion()},touchend:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!1,this.active=!1,this.updateMotion()},touchcancel:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!0,this.active=!1},noButtonDown:function(){return 0===this.buttons},leftButtonDown:function(){return!!(1&this.buttons)},rightButtonDown:function(){return!!(2&this.buttons)},middleButtonDown:function(){return!!(4&this.buttons)},backButtonDown:function(){return!!(8&this.buttons)},forwardButtonDown:function(){return!!(16&this.buttons)},leftButtonReleased:function(){return 0===this.button&&!this.isDown},rightButtonReleased:function(){return 2===this.button&&!this.isDown},middleButtonReleased:function(){return 1===this.button&&!this.isDown},backButtonReleased:function(){return 3===this.button&&!this.isDown},forwardButtonReleased:function(){return 4===this.button&&!this.isDown},getDistance:function(){return this.isDown?r(this.downX,this.downY,this.x,this.y):r(this.downX,this.downY,this.upX,this.upY)},getDistanceX:function(){return this.isDown?Math.abs(this.downX-this.x):Math.abs(this.downX-this.upX)},getDistanceY:function(){return this.isDown?Math.abs(this.downY-this.y):Math.abs(this.downY-this.upY)},getDuration:function(){return this.isDown?this.manager.time-this.downTime:this.upTime-this.downTime},getAngle:function(){return this.isDown?s(this.downX,this.downY,this.x,this.y):s(this.downX,this.downY,this.upX,this.upY)},getInterpolatedPosition:function(t,e){void 0===t&&(t=10),void 0===e&&(e=[]);for(var i=this.prevPosition.x,s=this.prevPosition.y,n=this.position.x,r=this.position.y,o=0;o{t.exports={MOUSE_DOWN:0,MOUSE_MOVE:1,MOUSE_UP:2,TOUCH_START:3,TOUCH_MOVE:4,TOUCH_END:5,POINTER_LOCK_CHANGE:6,TOUCH_CANCEL:7,MOUSE_WHEEL:8}},14874:t=>{t.exports="boot"},54168:t=>{t.exports="destroy"},526:t=>{t.exports="dragend"},81623:t=>{t.exports="dragenter"},94472:t=>{t.exports="drag"},9304:t=>{t.exports="dragleave"},34265:t=>{t.exports="dragover"},50151:t=>{t.exports="dragstart"},98134:t=>{t.exports="drop"},56773:t=>{t.exports="gameobjectdown"},45824:t=>{t.exports="dragend"},39578:t=>{t.exports="dragenter"},72072:t=>{t.exports="drag"},82569:t=>{t.exports="dragleave"},70833:t=>{t.exports="dragover"},81442:t=>{t.exports="dragstart"},32936:t=>{t.exports="drop"},99658:t=>{t.exports="gameobjectmove"},60515:t=>{t.exports="gameobjectout"},55254:t=>{t.exports="gameobjectover"},34782:t=>{t.exports="pointerdown"},41769:t=>{t.exports="pointermove"},65588:t=>{t.exports="pointerout"},61640:t=>{t.exports="pointerover"},49342:t=>{t.exports="pointerup"},82662:t=>{t.exports="wheel"},13058:t=>{t.exports="gameobjectup"},52426:t=>{t.exports="gameobjectwheel"},78072:t=>{t.exports="gameout"},1545:t=>{t.exports="gameover"},67137:t=>{t.exports="boot"},27678:t=>{t.exports="process"},22257:t=>{t.exports="update"},90379:t=>{t.exports="pointerlockchange"},88909:t=>{t.exports="pointerdown"},36548:t=>{t.exports="pointerdownoutside"},18483:t=>{t.exports="pointermove"},22355:t=>{t.exports="pointerout"},7997:t=>{t.exports="pointerover"},66318:t=>{t.exports="pointerup"},94812:t=>{t.exports="pointerupoutside"},37310:t=>{t.exports="wheel"},24196:t=>{t.exports="preupdate"},27053:t=>{t.exports="shutdown"},29413:t=>{t.exports="start"},25165:t=>{t.exports="update"},33963:(t,e,i)=>{t.exports={BOOT:i(14874),DESTROY:i(54168),DRAG_END:i(526),DRAG_ENTER:i(81623),DRAG:i(94472),DRAG_LEAVE:i(9304),DRAG_OVER:i(34265),DRAG_START:i(50151),DROP:i(98134),GAME_OUT:i(78072),GAME_OVER:i(1545),GAMEOBJECT_DOWN:i(56773),GAMEOBJECT_DRAG_END:i(45824),GAMEOBJECT_DRAG_ENTER:i(39578),GAMEOBJECT_DRAG:i(72072),GAMEOBJECT_DRAG_LEAVE:i(82569),GAMEOBJECT_DRAG_OVER:i(70833),GAMEOBJECT_DRAG_START:i(81442),GAMEOBJECT_DROP:i(32936),GAMEOBJECT_MOVE:i(99658),GAMEOBJECT_OUT:i(60515),GAMEOBJECT_OVER:i(55254),GAMEOBJECT_POINTER_DOWN:i(34782),GAMEOBJECT_POINTER_MOVE:i(41769),GAMEOBJECT_POINTER_OUT:i(65588),GAMEOBJECT_POINTER_OVER:i(61640),GAMEOBJECT_POINTER_UP:i(49342),GAMEOBJECT_POINTER_WHEEL:i(82662),GAMEOBJECT_UP:i(13058),GAMEOBJECT_WHEEL:i(52426),MANAGER_BOOT:i(67137),MANAGER_PROCESS:i(27678),MANAGER_UPDATE:i(22257),POINTER_DOWN:i(88909),POINTER_DOWN_OUTSIDE:i(36548),POINTER_MOVE:i(18483),POINTER_OUT:i(22355),POINTER_OVER:i(7997),POINTER_UP:i(66318),POINTER_UP_OUTSIDE:i(94812),POINTER_WHEEL:i(37310),POINTERLOCK_CHANGE:i(90379),PRE_UPDATE:i(24196),SHUTDOWN:i(27053),START:i(29413),UPDATE:i(25165)}},70848:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e){this.pad=t,this.events=t.events,this.index=e,this.value=0,this.threshold=.1},update:function(t){this.value=t},getValue:function(){return Math.abs(this.value){var s=i(56694),n=i(43200),r=new s({initialize:function(t,e){this.pad=t,this.events=t.manager,this.index=e,this.value=0,this.threshold=1,this.pressed=!1},update:function(t){this.value=t;var e=this.pad,i=this.index;t>=this.threshold?this.pressed||(this.pressed=!0,this.events.emit(n.BUTTON_DOWN,e,this,t),this.pad.emit(n.GAMEPAD_BUTTON_DOWN,i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit(n.BUTTON_UP,e,this,t),this.pad.emit(n.GAMEPAD_BUTTON_UP,i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=r},75956:(t,e,i)=>{var s=i(70848),n=i(21274),r=i(56694),o=i(6659),a=i(93736),h=new r({Extends:o,initialize:function(t,e){o.call(this),this.manager=t,this.pad=e,this.id=e.id,this.index=e.index;for(var i=[],r=0;r=2&&(this.leftStick.set(r[0].getValue(),r[1].getValue()),n>=4&&this.rightStick.set(r[2].getValue(),r[3].getValue()))}},destroy:function(){var t;for(this.removeAllListeners(),this.manager=null,this.pad=null,t=0;t{var s=i(56694),n=i(6659),r=i(43200),o=i(75956),a=i(10850),h=i(63399),l=i(33963),u=new s({Extends:n,initialize:function(t){n.call(this),this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.enabled=!0,this.target,this.gamepads=[],this.queue=[],this.onGamepadHandler,this._pad1,this._pad2,this._pad3,this._pad4,t.pluginEvents.once(l.BOOT,this.boot,this),t.pluginEvents.on(l.START,this.start,this)},boot:function(){var t=this.scene.sys.game,e=this.settings.input,i=t.config;this.enabled=a(e,"gamepad",i.inputGamepad)&&t.device.input.gamepads,this.target=a(e,"gamepad.target",i.inputGamepadEventTarget),this.sceneInputPlugin.pluginEvents.once(l.DESTROY,this.destroy,this)},start:function(){this.enabled&&(this.startListeners(),this.refreshPads()),this.sceneInputPlugin.pluginEvents.once(l.SHUTDOWN,this.shutdown,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},startListeners:function(){var t=this,e=this.target,i=function(e){!e.defaultPrevented&&t.isActive()&&(t.refreshPads(),t.queue.push(e))};this.onGamepadHandler=i,e.addEventListener("gamepadconnected",i,!1),e.addEventListener("gamepaddisconnected",i,!1),this.sceneInputPlugin.pluginEvents.on(l.UPDATE,this.update,this)},stopListeners:function(){this.target.removeEventListener("gamepadconnected",this.onGamepadHandler),this.target.removeEventListener("gamepaddisconnected",this.onGamepadHandler),this.sceneInputPlugin.pluginEvents.off(l.UPDATE,this.update);for(var t=0;t{t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,SELECT:8,START:9,B:0,A:1,Y:2,X:3,LEFT_SHOULDER:4,RIGHT_SHOULDER:5}},74982:t=>{t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,SHARE:8,OPTIONS:9,PS:16,TOUCHBAR:17,X:0,CIRCLE:1,SQUARE:2,TRIANGLE:3,L1:4,R1:5,L2:6,R2:7,L3:10,R3:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}},43247:t=>{t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,MENU:16,A:0,B:1,X:2,Y:3,LB:4,RB:5,LT:6,RT:7,BACK:8,START:9,LS:10,RS:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}},4898:(t,e,i)=>{t.exports={DUALSHOCK_4:i(74982),SNES_USB:i(33171),XBOX_360:i(43247)}},17344:t=>{t.exports="down"},36635:t=>{t.exports="up"},85724:t=>{t.exports="connected"},55832:t=>{t.exports="disconnected"},772:t=>{t.exports="down"},33608:t=>{t.exports="up"},43200:(t,e,i)=>{t.exports={BUTTON_DOWN:i(17344),BUTTON_UP:i(36635),CONNECTED:i(85724),DISCONNECTED:i(55832),GAMEPAD_BUTTON_DOWN:i(772),GAMEPAD_BUTTON_UP:i(33608)}},92636:(t,e,i)=>{t.exports={Axis:i(70848),Button:i(21274),Events:i(43200),Gamepad:i(75956),GamepadPlugin:i(1379),Configs:i(4898)}},20873:(t,e,i)=>{var s=i(72687),n=i(98611),r={CreatePixelPerfectHandler:i(18104),CreateInteractiveObject:i(27395),Events:i(33963),Gamepad:i(92636),InputManager:i(69898),InputPlugin:i(12499),InputPluginCache:i(63399),Keyboard:i(28388),Mouse:i(11343),Pointer:i(40398),Touch:i(77423)};r=n(!1,r,s),t.exports=r},71064:(t,e,i)=>{var s=i(66458),n=i(56694),r=i(97081),o=i(33963),a=i(11873),h=i(72283),l=new n({initialize:function(t){this.manager=t,this.queue=[],this.preventDefault=!0,this.captures=[],this.enabled=!1,this.target,this.onKeyDown=h,this.onKeyUp=h,t.events.once(o.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputKeyboard,this.target=t.inputKeyboardEventTarget,this.addCapture(t.inputKeyboardCapture),!this.target&&window&&(this.target=window),this.enabled&&this.target&&this.startListeners(),this.manager.game.events.on(r.POST_STEP,this.postUpdate,this)},startListeners:function(){var t=this;this.onKeyDown=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.events.emit(o.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}},this.onKeyUp=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.events.emit(o.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}};var e=this.target;e&&(e.addEventListener("keydown",this.onKeyDown,!1),e.addEventListener("keyup",this.onKeyUp,!1),this.enabled=!0)},stopListeners:function(){var t=this.target;t.removeEventListener("keydown",this.onKeyDown,!1),t.removeEventListener("keyup",this.onKeyUp,!1),this.enabled=!1},postUpdate:function(){this.queue=[]},addCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},removeCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},clearCaptures:function(){this.captures=[],this.preventDefault=!1},destroy:function(){this.stopListeners(),this.clearCaptures(),this.queue=[],this.manager.game.events.off(r.POST_RENDER,this.postUpdate,this),this.target=null,this.enabled=!1,this.manager=null}});t.exports=l},89666:(t,e,i)=>{var s=i(56694),n=i(6659),r=i(94030),o=i(97081),a=i(10850),h=i(33963),l=i(63399),u=i(50165),c=i(11873),d=i(95625),p=i(48044),f=i(7599),v=i(84314),g=new s({Extends:n,initialize:function(t){n.call(this),this.game=t.systems.game,this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.manager=t.manager.keyboard,this.enabled=!0,this.keys=[],this.combos=[],this.prevCode=null,this.prevTime=0,this.prevType=null,t.pluginEvents.once(h.BOOT,this.boot,this),t.pluginEvents.on(h.START,this.start,this)},boot:function(){var t=this.settings.input;this.enabled=a(t,"keyboard",!0);var e=a(t,"keyboard.capture",null);e&&this.addCaptures(e),this.sceneInputPlugin.pluginEvents.once(h.DESTROY,this.destroy,this)},start:function(){this.sceneInputPlugin.manager.events.on(h.MANAGER_PROCESS,this.update,this),this.sceneInputPlugin.pluginEvents.once(h.SHUTDOWN,this.shutdown,this),this.game.events.on(o.BLUR,this.resetKeys,this),this.scene.sys.events.on(f.PAUSE,this.resetKeys,this),this.scene.sys.events.on(f.SLEEP,this.resetKeys,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},addCapture:function(t){return this.manager.addCapture(t),this},removeCapture:function(t){return this.manager.removeCapture(t),this},getCaptures:function(){return this.manager.captures},enableGlobalCapture:function(){return this.manager.preventDefault=!0,this},disableGlobalCapture:function(){return this.manager.preventDefault=!1,this},clearCaptures:function(){return this.manager.clearCaptures(),this},createCursorKeys:function(){return this.addKeys({up:c.UP,down:c.DOWN,left:c.LEFT,right:c.RIGHT,space:c.SPACE,shift:c.SHIFT})},addKeys:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1);var s={};if("string"==typeof t){t=t.split(",");for(var n=0;n-1?s[n]=t:s[t.keyCode]=t,e&&this.addCapture(t.keyCode),t.setEmitOnRepeat(i),t}return"string"==typeof t&&(t=c[t.toUpperCase()]),s[t]||(s[t]=new u(this,t),e&&this.addCapture(t),s[t].setEmitOnRepeat(i)),s[t]},removeKey:function(t,e){void 0===e&&(e=!1);var i,s=this.keys;if(t instanceof u){var n=s.indexOf(t);n>-1&&(i=this.keys[n],this.keys[n]=void 0)}else"string"==typeof t&&(t=c[t.toUpperCase()]);return s[t]&&(i=s[t],s[t]=void 0),i&&(i.plugin=null,e&&i.destroy()),this},removeAllKeys:function(t){for(var e=this.keys,i=0;it._tick)return t._tick=i,!0}return!1},update:function(){var t=this.manager.queue,e=t.length;if(this.isActive()&&0!==e)for(var i=this.keys,s=0;s{t.exports=function(t,e){return e.timeLastMatched=t.timeStamp,e.index++,e.index===e.size||(e.current=e.keyCodes[e.index],!1)}},95625:(t,e,i)=>{var s=i(56694),n=i(94030),r=i(72632),o=i(2544),a=i(88754),h=new s({initialize:function(t,e,i){if(void 0===i&&(i={}),e.length<2)return!1;this.manager=t,this.enabled=!0,this.keyCodes=[];for(var s=0;s{var s=i(60258);t.exports=function(t,e){if(e.matched)return!0;var i=!1,n=!1;if(t.keyCode===e.current)if(e.index>0&&e.maxKeyDelay>0){var r=e.timeLastMatched+e.maxKeyDelay;t.timeStamp<=r&&(n=!0,i=s(t,e))}else n=!0,i=s(t,e);return!n&&e.resetOnWrongKey&&(e.index=0,e.current=e.keyCodes[0]),i&&(e.timeLastMatched=t.timeStamp,e.matched=!0,e.timeMatched=t.timeStamp),i}},88754:t=>{t.exports=function(t){return t.current=t.keyCodes[0],t.index=0,t.timeLastMatched=0,t.matched=!1,t.timeMatched=0,t}},5044:t=>{t.exports="keydown"},40813:t=>{t.exports="keyup"},89319:t=>{t.exports="keycombomatch"},76362:t=>{t.exports="down"},78595:t=>{t.exports="keydown-"},30056:t=>{t.exports="keyup-"},81939:t=>{t.exports="up"},94030:(t,e,i)=>{t.exports={ANY_KEY_DOWN:i(5044),ANY_KEY_UP:i(40813),COMBO_MATCH:i(89319),DOWN:i(76362),KEY_DOWN:i(78595),KEY_UP:i(30056),UP:i(81939)}},28388:(t,e,i)=>{t.exports={Events:i(94030),KeyboardManager:i(71064),KeyboardPlugin:i(89666),Key:i(50165),KeyCodes:i(11873),KeyCombo:i(95625),AdvanceKeyCombo:i(60258),ProcessKeyCombo:i(2544),ResetKeyCombo:i(88754),JustDown:i(42460),JustUp:i(53162),DownDuration:i(64964),UpDuration:i(70331)}},64964:t=>{t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeDown;return t.isDown&&i{t.exports=function(t){return!!t._justDown&&(t._justDown=!1,!0)}},53162:t=>{t.exports=function(t){return!!t._justUp&&(t._justUp=!1,!0)}},50165:(t,e,i)=>{var s=i(56694),n=i(6659),r=i(94030),o=new s({Extends:n,initialize:function(t,e){n.call(this),this.plugin=t,this.keyCode=e,this.originalEvent=void 0,this.enabled=!0,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.metaKey=!1,this.location=0,this.timeDown=0,this.duration=0,this.timeUp=0,this.emitOnRepeat=!1,this.repeats=0,this._justDown=!1,this._justUp=!1,this._tick=-1},setEmitOnRepeat:function(t){return this.emitOnRepeat=t,this},onDown:function(t){this.originalEvent=t,this.enabled&&(this.altKey=t.altKey,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.metaKey=t.metaKey,this.location=t.location,this.repeats++,this.isDown?this.emitOnRepeat&&this.emit(r.DOWN,this,t):(this.isDown=!0,this.isUp=!1,this.timeDown=t.timeStamp,this.duration=0,this._justDown=!0,this._justUp=!1,this.emit(r.DOWN,this,t)))},onUp:function(t){this.originalEvent=t,this.enabled&&(this.isDown=!1,this.isUp=!0,this.timeUp=t.timeStamp,this.duration=this.timeUp-this.timeDown,this.repeats=0,this._justDown=!1,this._justUp=!0,this._tick=-1,this.emit(r.UP,this,t))},reset:function(){return this.preventDefault=!0,this.enabled=!0,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.metaKey=!1,this.timeDown=0,this.duration=0,this.timeUp=0,this.repeats=0,this._justDown=!1,this._justUp=!1,this._tick=-1,this},getDuration:function(){return this.isDown?this.plugin.game.loop.time-this.timeDown:0},destroy:function(){this.removeAllListeners(),this.originalEvent=null,this.plugin=null}});t.exports=o},11873:t=>{t.exports={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:42,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,NUMPAD_ZERO:96,NUMPAD_ONE:97,NUMPAD_TWO:98,NUMPAD_THREE:99,NUMPAD_FOUR:100,NUMPAD_FIVE:101,NUMPAD_SIX:102,NUMPAD_SEVEN:103,NUMPAD_EIGHT:104,NUMPAD_NINE:105,NUMPAD_ADD:107,NUMPAD_SUBTRACT:109,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,SEMICOLON:186,PLUS:187,COMMA:188,MINUS:189,PERIOD:190,FORWARD_SLASH:191,BACK_SLASH:220,QUOTES:222,BACKTICK:192,OPEN_BRACKET:219,CLOSED_BRACKET:221,SEMICOLON_FIREFOX:59,COLON:58,COMMA_FIREFOX_WINDOWS:60,COMMA_FIREFOX:62,BRACKET_RIGHT_FIREFOX:174,BRACKET_LEFT_FIREFOX:175}},48044:(t,e,i)=>{var s=i(11873),n={};for(var r in s)n[s[r]]=r;t.exports=n},70331:t=>{t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeUp;return t.isUp&&i{var s=i(56694),n=i(90185),r=i(33963),o=i(72283),a=new s({initialize:function(t){this.manager=t,this.preventDefaultDown=!0,this.preventDefaultUp=!0,this.preventDefaultMove=!0,this.preventDefaultWheel=!1,this.enabled=!1,this.target,this.locked=!1,this.onMouseMove=o,this.onMouseDown=o,this.onMouseUp=o,this.onMouseDownWindow=o,this.onMouseUpWindow=o,this.onMouseOver=o,this.onMouseOut=o,this.onMouseWheel=o,this.pointerLockChange=o,this.isTop=!0,t.events.once(r.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputMouse,this.target=t.inputMouseEventTarget,this.passive=t.inputMousePassive,this.preventDefaultDown=t.inputMousePreventDefaultDown,this.preventDefaultUp=t.inputMousePreventDefaultUp,this.preventDefaultMove=t.inputMousePreventDefaultMove,this.preventDefaultWheel=t.inputMousePreventDefaultWheel,this.target?"string"==typeof this.target&&(this.target=document.getElementById(this.target)):this.target=this.manager.game.canvas,t.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return document.body.addEventListener("contextmenu",(function(t){return t.preventDefault(),!1})),this},requestPointerLock:function(){if(n.pointerLock){var t=this.target;t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock||t.webkitRequestPointerLock,t.requestPointerLock()}},releasePointerLock:function(){n.pointerLock&&(document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,document.exitPointerLock())},startListeners:function(){var t=this.target;if(t){var e=this,i=this.manager,s=i.canvas,r=window&&window.focus&&i.game.config.autoFocus;this.onMouseMove=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onMouseMove(t),e.preventDefaultMove&&t.preventDefault())},this.onMouseDown=function(t){r&&window.focus(),!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onMouseDown(t),e.preventDefaultDown&&t.target===s&&t.preventDefault())},this.onMouseDownWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==s&&i.onMouseDown(t)},this.onMouseUp=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onMouseUp(t),e.preventDefaultUp&&t.target===s&&t.preventDefault())},this.onMouseUpWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==s&&i.onMouseUp(t)},this.onMouseOver=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.setCanvasOver(t)},this.onMouseOut=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.setCanvasOut(t)},this.onMouseWheel=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.onMouseWheel(t),e.preventDefaultWheel&&t.target===s&&t.preventDefault()};var o={passive:!0};if(t.addEventListener("mousemove",this.onMouseMove),t.addEventListener("mousedown",this.onMouseDown),t.addEventListener("mouseup",this.onMouseUp),t.addEventListener("mouseover",this.onMouseOver,o),t.addEventListener("mouseout",this.onMouseOut,o),this.preventDefaultWheel?t.addEventListener("wheel",this.onMouseWheel,{passive:!1}):t.addEventListener("wheel",this.onMouseWheel,o),window&&i.game.config.inputWindowEvents)try{window.top.addEventListener("mousedown",this.onMouseDownWindow,o),window.top.addEventListener("mouseup",this.onMouseUpWindow,o)}catch(t){window.addEventListener("mousedown",this.onMouseDownWindow,o),window.addEventListener("mouseup",this.onMouseUpWindow,o),this.isTop=!1}n.pointerLock&&(this.pointerLockChange=function(t){var s=e.target;e.locked=document.pointerLockElement===s||document.mozPointerLockElement===s||document.webkitPointerLockElement===s,i.onPointerLockChange(t)},document.addEventListener("pointerlockchange",this.pointerLockChange,!0),document.addEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.addEventListener("webkitpointerlockchange",this.pointerLockChange,!0)),this.enabled=!0}},stopListeners:function(){var t=this.target;t.removeEventListener("mousemove",this.onMouseMove),t.removeEventListener("mousedown",this.onMouseDown),t.removeEventListener("mouseup",this.onMouseUp),t.removeEventListener("mouseover",this.onMouseOver),t.removeEventListener("mouseout",this.onMouseOut),window&&((t=this.isTop?window.top:window).removeEventListener("mousedown",this.onMouseDownWindow),t.removeEventListener("mouseup",this.onMouseUpWindow)),n.pointerLock&&(document.removeEventListener("pointerlockchange",this.pointerLockChange,!0),document.removeEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.removeEventListener("webkitpointerlockchange",this.pointerLockChange,!0))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});t.exports=a},11343:(t,e,i)=>{t.exports={MouseManager:i(7905)}},37579:(t,e,i)=>{var s=i(56694),n=i(33963),r=i(72283),o=new s({initialize:function(t){this.manager=t,this.capture=!0,this.enabled=!1,this.target,this.onTouchStart=r,this.onTouchStartWindow=r,this.onTouchMove=r,this.onTouchEnd=r,this.onTouchEndWindow=r,this.onTouchCancel=r,this.onTouchCancelWindow=r,this.onTouchOver=r,this.onTouchOut=r,t.events.once(n.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputTouch,this.target=t.inputTouchEventTarget,this.capture=t.inputTouchCapture,this.target||(this.target=this.manager.game.canvas),t.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return document.body.addEventListener("contextmenu",(function(t){return t.preventDefault(),!1})),this},startListeners:function(){var t=this,e=this.manager.canvas,i=window&&window.focus&&this.manager.game.config.autoFocus;this.onTouchStart=function(s){i&&window.focus(),!s.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onTouchStart(s),t.capture&&s.cancelable&&s.target===e&&s.preventDefault())},this.onTouchStartWindow=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&i.target!==e&&t.manager.onTouchStart(i)},this.onTouchMove=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onTouchMove(e),t.capture&&e.cancelable&&e.preventDefault())},this.onTouchEnd=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onTouchEnd(i),t.capture&&i.cancelable&&i.target===e&&i.preventDefault())},this.onTouchEndWindow=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&i.target!==e&&t.manager.onTouchEnd(i)},this.onTouchCancel=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onTouchCancel(e),t.capture&&e.preventDefault())},this.onTouchCancelWindow=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.onTouchCancel(e)},this.onTouchOver=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.setCanvasOver(e)},this.onTouchOut=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.setCanvasOut(e)};var s=this.target;if(s){var n={passive:!0},r={passive:!1};s.addEventListener("touchstart",this.onTouchStart,this.capture?r:n),s.addEventListener("touchmove",this.onTouchMove,this.capture?r:n),s.addEventListener("touchend",this.onTouchEnd,this.capture?r:n),s.addEventListener("touchcancel",this.onTouchCancel,this.capture?r:n),s.addEventListener("touchover",this.onTouchOver,this.capture?r:n),s.addEventListener("touchout",this.onTouchOut,this.capture?r:n),window&&this.manager.game.config.inputWindowEvents&&(window.addEventListener("touchstart",this.onTouchStartWindow,r),window.addEventListener("touchend",this.onTouchEndWindow,r),window.addEventListener("touchcancel",this.onTouchCancelWindow,r)),this.enabled=!0}},stopListeners:function(){var t=this.target;t.removeEventListener("touchstart",this.onTouchStart),t.removeEventListener("touchmove",this.onTouchMove),t.removeEventListener("touchend",this.onTouchEnd),t.removeEventListener("touchcancel",this.onTouchCancel),t.removeEventListener("touchover",this.onTouchOver),t.removeEventListener("touchout",this.onTouchOut),window&&(window.removeEventListener("touchstart",this.onTouchStartWindow),window.removeEventListener("touchend",this.onTouchEndWindow))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});t.exports=o},77423:(t,e,i)=>{t.exports={TouchManager:i(37579)}},98035:(t,e,i)=>{var s=i(56694),n=i(12117),r=i(683),o=i(72632),a=i(30750),h=i(43531),l=i(88490),u=i(33868),c=new s({initialize:function(t,e){this.loader=t,this.cache=o(e,"cache",!1),this.type=o(e,"type",!1),this.key=o(e,"key",!1);var i=this.key;if(t.prefix&&""!==t.prefix&&(this.key=t.prefix+i),!this.type||!this.key)throw new Error("Invalid Loader."+this.type+" key");var s=o(e,"url");void 0===s?s=t.path+i+"."+o(e,"extension",""):"string"!=typeof s||s.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)||(s=t.path+s),this.url=s,this.src="",this.xhrSettings=u(o(e,"responseType",void 0)),o(e,"xhrSettings",!1)&&(this.xhrSettings=h(this.xhrSettings,o(e,"xhrSettings",{}))),this.xhrLoader=null,this.state="function"==typeof this.url?n.FILE_POPULATED:n.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=o(e,"config",{}),this.multiFile,this.linkFile},setLink:function(t){this.linkFile=t,t.linkFile=this},resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){this.state===n.FILE_POPULATED?this.loader.nextFile(this,!0):(this.state=n.FILE_LOADING,this.src=a(this,this.loader.baseURL),0===this.src.indexOf("data:")?console.warn("Local data URIs are not supported: "+this.key):this.xhrLoader=l(this,this.loader.xhr))},onLoad:function(t,e){var i=t.responseURL&&(0===t.responseURL.indexOf("file://")||0===t.responseURL.indexOf("capacitor://"))&&0===e.target.status,s=!(e.target&&200!==e.target.status)||i;4===t.readyState&&t.status>=400&&t.status<=599&&(s=!1),this.state=n.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,s)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(r.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=n.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=n.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){console.error('Failed to process file: %s "%s"',this.type,this.key),this.state=n.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.cache.add(this.key,this.data),this.pendingDestroy()},pendingDestroy:function(t){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit(r.FILE_COMPLETE,e,i,t),this.loader.emit(r.FILE_KEY_COMPLETE+i+"-"+e,e,i,t),this.loader.flagForRemoval(this)},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});c.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var s=new FileReader;s.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+s.result.split(",")[1]},s.onerror=t.onerror,s.readAsDataURL(e)}},c.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=c},76846:t=>{var e={},i={install:function(t){for(var i in e)t[i]=e[i]},register:function(t,i){e[t]=i},destroy:function(){e={}}};t.exports=i},30750:t=>{t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},67285:(t,e,i)=>{var s=i(56694),n=i(12117),r=i(58403),o=i(6659),a=i(683),h=i(76846),l=i(72632),u=i(91963),c=i(7599),d=i(33868),p=new s({Extends:o,initialize:function(t){o.call(this);var e=t.sys.game.config,i=t.sys.settings.loader;this.scene=t,this.systems=t.sys,this.cacheManager=t.sys.cache,this.textureManager=t.sys.textures,this.sceneManager=t.sys.game.scene,h.install(this),this.prefix="",this.path="",this.baseURL="",this.setBaseURL(l(i,"baseURL",e.loaderBaseURL)),this.setPath(l(i,"path",e.loaderPath)),this.setPrefix(l(i,"prefix",e.loaderPrefix)),this.maxParallelDownloads=l(i,"maxParallelDownloads",e.loaderMaxParallelDownloads),this.xhr=d(l(i,"responseType",e.loaderResponseType),l(i,"async",e.loaderAsync),l(i,"user",e.loaderUser),l(i,"password",e.loaderPassword),l(i,"timeout",e.loaderTimeout),l(i,"withCredentials",e.loaderWithCredentials)),this.crossOrigin=l(i,"crossOrigin",e.loaderCrossOrigin),this.imageLoadType=l(i,"imageLoadType",e.loaderImageLoadType),this.totalToLoad=0,this.progress=0,this.list=new r,this.inflight=new r,this.queue=new r,this._deleteQueue=new r,this.totalFailed=0,this.totalComplete=0,this.state=n.LOADER_IDLE,this.multiKeyIndex=0,t.sys.events.once(c.BOOT,this.boot,this),t.sys.events.on(c.START,this.pluginStart,this)},boot:function(){this.systems.events.once(c.DESTROY,this.destroy,this)},pluginStart:function(){this.systems.events.once(c.SHUTDOWN,this.shutdown,this)},setBaseURL:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.baseURL=t,this},setPath:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.path=t,this},setPrefix:function(t){return void 0===t&&(t=""),this.prefix=t,this},setCORS:function(t){return this.crossOrigin=t,this},addFile:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e0},isLoading:function(){return this.state===n.LOADER_LOADING||this.state===n.LOADER_PROCESSING},isReady:function(){return this.state===n.LOADER_IDLE||this.state===n.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit(a.START,this),0===this.list.size?this.loadComplete():(this.state=n.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on(c.UPDATE,this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit(a.PROGRESS,this.progress)},update:function(){this.state===n.LOADER_LOADING&&this.list.size>0&&this.inflight.size{var s=i(98611),n=i(33868);t.exports=function(t,e){var i=void 0===t?n():s({},t);if(e)for(var r in e)void 0!==e[r]&&(i[r]=e[r]);return i}},45176:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s){var n=[];s.forEach((function(t){t&&n.push(t)})),this.loader=t,this.type=e,this.key=i,this.multiKeyIndex=t.multiKeyIndex++,this.files=n,this.complete=!1,this.pending=n.length,this.failed=0,this.config={},this.baseURL=t.baseURL,this.path=t.path,this.prefix=t.prefix;for(var r=0;r{var s=i(43531);t.exports=function(t,e){var i=s(e,t.xhrSettings),n=new XMLHttpRequest;if(n.open("GET",t.src,i.async,i.user,i.password),n.responseType=t.xhrSettings.responseType,n.timeout=i.timeout,i.headers)for(var r in i.headers)n.setRequestHeader(r,i.headers[r]);return i.header&&i.headerValue&&n.setRequestHeader(i.header,i.headerValue),i.requestedWith&&n.setRequestHeader("X-Requested-With",i.requestedWith),i.overrideMimeType&&n.overrideMimeType(i.overrideMimeType),i.withCredentials&&(n.withCredentials=!0),n.onload=t.onLoad.bind(t,n),n.onerror=t.onError.bind(t,n),n.onprogress=t.onProgress.bind(t),n.send(),n}},33868:t=>{t.exports=function(t,e,i,s,n,r){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===s&&(s=""),void 0===n&&(n=0),void 0===r&&(r=!1),{responseType:t,async:e,user:i,password:s,timeout:n,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:r}}},12117:t=>{t.exports={LOADER_IDLE:0,LOADER_LOADING:1,LOADER_PROCESSING:2,LOADER_COMPLETE:3,LOADER_SHUTDOWN:4,LOADER_DESTROYED:5,FILE_PENDING:10,FILE_LOADING:11,FILE_LOADED:12,FILE_FAILED:13,FILE_PROCESSING:14,FILE_ERRORED:16,FILE_COMPLETE:17,FILE_DESTROYED:18,FILE_POPULATED:19}},7398:t=>{t.exports="addfile"},52187:t=>{t.exports="complete"},36627:t=>{t.exports="filecomplete"},81925:t=>{t.exports="filecomplete-"},29774:t=>{t.exports="loaderror"},20943:t=>{t.exports="load"},74693:t=>{t.exports="fileprogress"},71176:t=>{t.exports="postprocess"},88984:t=>{t.exports="progress"},72753:t=>{t.exports="start"},683:(t,e,i)=>{t.exports={ADD:i(7398),COMPLETE:i(52187),FILE_COMPLETE:i(36627),FILE_KEY_COMPLETE:i(81925),FILE_LOAD_ERROR:i(29774),FILE_LOAD:i(20943),FILE_PROGRESS:i(74693),POST_PROCESS:i(71176),PROGRESS:i(88984),START:i(72753)}},46468:(t,e,i)=>{var s=i(56694),n=i(76846),r=i(70806),o=i(683),a=new s({Extends:r,initialize:function(t,e,i,s,n){r.call(this,t,e,i,s,n),this.type="animationJSON"},onProcess:function(){this.loader.once(o.POST_PROCESS,this.onLoadComplete,this),r.prototype.onProcess.call(this)},onLoadComplete:function(){this.loader.systems.anims.fromJSON(this.data)}});n.register("animation",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(76846),r=i(72632),o=i(42927),a=i(42911),h=i(70806),l=i(45176),u=new s({Extends:l,initialize:function(t,e,i,s,n,u){var c,d;if(a(e)){var p=e;e=r(p,"key"),c=new o(t,{key:e,url:r(p,"textureURL"),extension:r(p,"textureExtension","png"),normalMap:r(p,"normalMap"),xhrSettings:r(p,"textureXhrSettings")}),d=new h(t,{key:e,url:r(p,"atlasURL"),extension:r(p,"atlasExtension","json"),xhrSettings:r(p,"atlasXhrSettings")})}else c=new o(t,e,i,n),d=new h(t,e,s,u);c.linkFile?l.call(this,t,"atlasjson",e,[c,d,c.linkFile]):l.call(this,t,"atlasjson",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(t.key,t.data,e.data,i),e.addToCache(),this.complete=!0}}});n.register("aseprite",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var o=0;o{var s=i(56694),n=i(76846),r=i(72632),o=i(42927),a=i(42911),h=i(70806),l=i(45176),u=new s({Extends:l,initialize:function(t,e,i,s,n,u){var c,d;if(a(e)){var p=e;e=r(p,"key"),c=new o(t,{key:e,url:r(p,"textureURL"),extension:r(p,"textureExtension","png"),normalMap:r(p,"normalMap"),xhrSettings:r(p,"textureXhrSettings")}),d=new h(t,{key:e,url:r(p,"atlasURL"),extension:r(p,"atlasExtension","json"),xhrSettings:r(p,"atlasXhrSettings")})}else c=new o(t,e,i,n),d=new h(t,e,s,u);c.linkFile?l.call(this,t,"atlasjson",e,[c,d,c.linkFile]):l.call(this,t,"atlasjson",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(t.key,t.data,e.data,i),e.pendingDestroy(),this.complete=!0}}});n.register("atlas",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var o=0;o{var s=i(56694),n=i(76846),r=i(72632),o=i(42927),a=i(42911),h=i(45176),l=i(15297),u=new s({Extends:h,initialize:function(t,e,i,s,n,u){var c,d;if(a(e)){var p=e;e=r(p,"key"),c=new o(t,{key:e,url:r(p,"textureURL"),extension:r(p,"textureExtension","png"),normalMap:r(p,"normalMap"),xhrSettings:r(p,"textureXhrSettings")}),d=new l(t,{key:e,url:r(p,"atlasURL"),extension:r(p,"atlasExtension","xml"),xhrSettings:r(p,"atlasXhrSettings")})}else c=new o(t,e,i,n),d=new l(t,e,s,u);c.linkFile?h.call(this,t,"atlasxml",e,[c,d,c.linkFile]):h.call(this,t,"atlasxml",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlasXML(t.key,t.data,e.data,i),e.pendingDestroy(),this.complete=!0}}});n.register("atlasXML",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var o=0;o{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(30929),l=i(42911),u=new s({Extends:r,initialize:function(t,e,i,s,n){if(l(e)){var o=e;e=a(o,"key"),s=a(o,"xhrSettings"),n=a(o,"context",n)}var h={type:"audio",cache:t.cacheManager.audio,extension:i.type,responseType:"arraybuffer",key:e,url:i.url,xhrSettings:s,config:{context:n}};r.call(this,t,h)},onProcess:function(){this.state=n.FILE_PROCESSING;var t=this;this.config.context.decodeAudioData(this.xhrLoader.response,(function(e){t.data=e,t.onProcessComplete()}),(function(e){console.error("Error decoding audio: "+t.key+" - ",e?e.message:null),t.onProcessError()})),this.config.context=null}});u.create=function(t,e,i,s,n){var r=t.systems.game,o=r.config.audio,c=r.device.audio;l(e)&&(i=a(e,"url",[]),s=a(e,"config",{}));var d=u.getAudioURL(r,i);return d?c.webAudio&&!o.disableWebAudio?new u(t,e,d,n,r.sound.context):new h(t,e,d,s):null},u.getAudioURL=function(t,e){Array.isArray(e)||(e=[e]);for(var i=0;i{var s=i(67448),n=i(56694),r=i(76846),o=i(72632),a=i(42911),h=i(70806),l=i(45176),u=new n({Extends:l,initialize:function(t,e,i,n,r,u,c){if(a(e)){var d=e;e=o(d,"key"),i=o(d,"jsonURL"),n=o(d,"audioURL"),r=o(d,"audioConfig"),u=o(d,"audioXhrSettings"),c=o(d,"jsonXhrSettings")}var p;if(n){var f=s.create(t,e,n,r,u);f&&(p=new h(t,e,i,c),l.call(this,t,"audiosprite",e,[f,p]),this.config.resourceLoad=!1)}else p=new h(t,e,i,c),l.call(this,t,"audiosprite",e,[p]),this.config.resourceLoad=!0,this.config.audioConfig=r,this.config.audioXhrSettings=u},onFileComplete:function(t){if(-1!==this.files.indexOf(t)&&(this.pending--,this.config.resourceLoad&&"json"===t.type&&t.data.hasOwnProperty("resources"))){var e=t.data.resources,i=o(this.config,"audioConfig"),n=o(this.config,"audioXhrSettings"),r=s.create(this.loader,t.key,e,i,n);r&&(this.addToMultiFile(r),this.loader.addFile(r))}},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1];t.addToCache(),e.addToCache(),this.complete=!0}}});r.register("audioSprite",(function(t,e,i,s,n,r){var o,a=this.systems.game,h=a.config.audio,l=a.device.audio;if(h&&h.noAudio||!l.webAudio&&!l.audioData)return this;if(Array.isArray(t))for(var c=0;c{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s,n){var o="bin";if(h(e)){var l=e;e=a(l,"key"),i=a(l,"url"),s=a(l,"xhrSettings"),o=a(l,"extension",o),n=a(l,"dataType",n)}var u={type:"binary",cache:t.cacheManager.binary,extension:o,responseType:"arraybuffer",key:e,url:i,xhrSettings:s,config:{dataType:n}};r.call(this,t,u)},onProcess:function(){this.state=n.FILE_PROCESSING;var t=this.config.dataType;this.data=t?new t(this.xhrLoader.response):this.xhrLoader.response,this.onProcessComplete()}});o.register("binary",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(76846),r=i(72632),o=i(42927),a=i(42911),h=i(45176),l=i(31476),u=i(15297),c=new s({Extends:h,initialize:function(t,e,i,s,n,l){var c,d;if(a(e)){var p=e;e=r(p,"key"),c=new o(t,{key:e,url:r(p,"textureURL"),extension:r(p,"textureExtension","png"),normalMap:r(p,"normalMap"),xhrSettings:r(p,"textureXhrSettings")}),d=new u(t,{key:e,url:r(p,"fontDataURL"),extension:r(p,"fontDataExtension","xml"),xhrSettings:r(p,"fontDataXhrSettings")})}else c=new o(t,e,i,n),d=new u(t,e,s,l);c.linkFile?h.call(this,t,"bitmapfont",e,[c,d,c.linkFile]):h.call(this,t,"bitmapfont",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1];t.addToCache(),e.pendingDestroy();var i=t.cache.get(t.key),s=l(e.data,t.cache.getFrame(t.key),0,0,i);this.loader.cacheManager.bitmapFont.add(t.key,{data:s,texture:t.key,frame:null}),this.complete=!0}}});n.register("bitmapFont",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var o=0;o{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s){var n="css";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),s=a(o,"xhrSettings"),n=a(o,"extension",n)}var l={type:"script",cache:!1,extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,l)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=document.createElement("style"),this.data.defer=!1,this.data.innerHTML=this.xhrLoader.responseText,document.head.appendChild(this.data),this.onProcessComplete()}});o.register("css",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(73152),n=i(40612),r=i(56694),o=i(76846),a=i(72632),h=i(42927),l=i(70806),u=i(67409),c=i(30657),d=i(80802),p=i(45176),f=i(24904),v=new r({Extends:p,initialize:function(t,e,i,s){if(i.multiAtlasURL){var r=new l(t,{key:e,url:i.multiAtlasURL,xhrSettings:s,config:i});p.call(this,t,"texture",e,[r])}else{var o=i.textureURL.substr(i.textureURL.length-3);i.type||(i.type="ktx"===o.toLowerCase()?"KTX":"PVR");var a=new n(t,{key:e,url:i.textureURL,extension:o,xhrSettings:s,config:i});if(i.atlasURL){var h=new l(t,{key:e,url:i.atlasURL,xhrSettings:s,config:i});p.call(this,t,"texture",e,[a,h])}else p.call(this,t,"texture",e,[a])}this.config=i},onFileComplete:function(t){if(-1!==this.files.indexOf(t)){if(this.pending--,!this.config.multiAtlasURL)return;if("json"===t.type&&t.data.hasOwnProperty("textures")){var e=t.data.textures,i=this.config,s=this.loader,r=s.baseURL,o=s.path,h=s.prefix,l=a(i,"multiBaseURL",this.baseURL),u=a(i,"multiPath",this.path),c=a(i,"prefix",this.prefix),d=a(i,"textureXhrSettings");l&&s.setBaseURL(l),u&&s.setPath(u),c&&s.setPrefix(c);for(var p=0;p{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=i(31053),u=new s({Extends:r,initialize:function(t,e,i,s,n){var o="glsl";if(h(e)){var l=e;e=a(l,"key"),i=a(l,"url"),s=a(l,"shaderType","fragment"),n=a(l,"xhrSettings"),o=a(l,"extension",o)}else void 0===s&&(s="fragment");var u={type:"glsl",cache:t.cacheManager.shader,extension:o,responseType:"text",key:e,url:i,config:{shaderType:s},xhrSettings:n};r.call(this,t,u)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t=this.data.split("\n"),e=this.extractBlock(t,0);if(e)for(;e;){var i=this.getShaderName(e.header),s=this.getShaderType(e.header),n=this.getShaderUniforms(e.header),r=e.shader;if(this.cache.has(i)){var o=this.cache.get(i);"fragment"===s?o.fragmentSrc=r:o.vertexSrc=r,o.uniforms||(o.uniforms=n)}else"fragment"===s?this.cache.add(i,new l(i,r,"",n)):this.cache.add(i,new l(i,"",r,n));e=this.extractBlock(t,e.offset)}else"fragment"===this.config.shaderType?this.cache.add(this.key,new l(this.key,this.data)):this.cache.add(this.key,new l(this.key,"",this.data));this.pendingDestroy()},getShaderName:function(t){for(var e=0;e{var s=i(56694),n=i(683),r=i(98035),o=i(72632),a=i(30750),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s){if(h(e)){var n=e;e=o(n,"key"),s=o(n,"config",s)}var a={type:"audio",cache:t.cacheManager.audio,extension:i.type,key:e,url:i.url,config:s};r.call(this,t,a),this.locked="ontouchstart"in window,this.loaded=!1,this.filesLoaded=0,this.filesTotal=0},onLoad:function(){this.loaded||(this.loaded=!0,this.loader.nextFile(this,!0))},onError:function(){for(var t=0;t{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s){var n="html";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),s=a(o,"xhrSettings"),n=a(o,"extension",n)}var l={type:"text",cache:t.cacheManager.html,extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,l)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});o.register("html",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s,n,o){void 0===s&&(s=512),void 0===n&&(n=512);var l="html";if(h(e)){var u=e;e=a(u,"key"),i=a(u,"url"),o=a(u,"xhrSettings"),l=a(u,"extension",l),s=a(u,"width",s),n=a(u,"height",n)}var c={type:"html",cache:t.textureManager,extension:l,responseType:"text",key:e,url:i,xhrSettings:o,config:{width:s,height:n}};r.call(this,t,c)},onProcess:function(){this.state=n.FILE_PROCESSING;var t=this.config.width,e=this.config.height,i=[];i.push(''),i.push(''),i.push(''),i.push(this.xhrLoader.responseText),i.push(""),i.push(""),i.push("");var s=[i.join("\n")],o=this;try{var a=new window.Blob(s,{type:"image/svg+xml;charset=utf-8"})}catch(t){return o.state=n.FILE_ERRORED,void o.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){r.revokeObjectURL(o.data),o.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(o.data),o.onProcessError()},r.createObjectURL(this.data,a,"image/svg+xml")},addToCache:function(){var t=this.cache.addImage(this.key,this.data);this.pendingDestroy(t)}});o.register("htmlTexture",(function(t,e,i,s,n){if(Array.isArray(t))for(var r=0;r{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=i(30750),u=new s({Extends:r,initialize:function t(e,i,s,n,o){var l,u="png";if(h(i)){var c=i;i=a(c,"key"),s=a(c,"url"),l=a(c,"normalMap"),n=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(c,"frameConfig")}Array.isArray(s)&&(l=s[1],s=s[0]);var d={type:"image",cache:e.textureManager,extension:u,responseType:"blob",key:i,url:s,xhrSettings:n,config:o};if(r.call(this,e,d),l){var p=new t(e,this.key,l,n,o);p.type="normalMap",this.setLink(p),e.addFile(p)}this.useImageElementLoad="HTMLImageElement"===e.imageLoadType,this.useImageElementLoad&&(this.load=this.loadImage,this.onProcess=this.onProcessImage)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){r.revokeObjectURL(t.data),t.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(t.data),t.onProcessError()},r.createObjectURL(this.data,this.xhrLoader.response,"image/png")},onProcessImage:function(){var t=this.state;this.state=n.FILE_PROCESSING,t===n.FILE_LOADED?this.onProcessComplete():this.onProcessError()},loadImage:function(){if(this.state=n.FILE_LOADING,this.src=l(this,this.loader.baseURL),0===this.src.indexOf("data:"))console.warn("Local data URIs are not supported: "+this.key);else{this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){t.state=n.FILE_LOADED,t.loader.nextFile(t,!0)},this.data.onerror=function(){t.loader.nextFile(t,!1)},this.data.src=this.src}},addToCache:function(){var t,e=this.linkFile;e&&e.state===n.FILE_COMPLETE?(t="image"===this.type?this.cache.addImage(this.key,this.data,e.data):this.cache.addImage(e.key,e.data,this.data),this.pendingDestroy(t),e.pendingDestroy(t)):e||(t=this.cache.addImage(this.key,this.data),this.pendingDestroy(t))}});o.register("image",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(10850),l=i(42911),u=new s({Extends:r,initialize:function(t,e,i,s,o){var u="json";if(l(e)){var c=e;e=a(c,"key"),i=a(c,"url"),s=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(c,"dataKey",o)}var d={type:"json",cache:t.cacheManager.json,extension:u,responseType:"text",key:e,url:i,xhrSettings:s,config:o};r.call(this,t,d),l(i)&&(this.data=o?h(i,o):i,this.state=n.FILE_POPULATED)},onProcess:function(){if(this.state!==n.FILE_POPULATED){this.state=n.FILE_PROCESSING;try{var t=JSON.parse(this.xhrLoader.responseText)}catch(t){throw this.onProcessError(),t}var e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});o.register("json",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(76846),r=i(72632),o=i(42927),a=i(42911),h=i(70806),l=i(45176),u=new s({Extends:l,initialize:function(t,e,i,s,n,o,u){if(a(e)){var c=e;e=r(c,"key"),i=r(c,"url",!1)?r(c,"url"):r(c,"atlasURL"),o=r(c,"xhrSettings"),s=r(c,"path"),n=r(c,"baseURL"),u=r(c,"textureXhrSettings")}var d=new h(t,e,i,o);l.call(this,t,"multiatlas",e,[d]),this.config.path=s,this.config.baseURL=n,this.config.textureXhrSettings=u},onFileComplete:function(t){if(-1!==this.files.indexOf(t)&&(this.pending--,"json"===t.type&&t.data.hasOwnProperty("textures"))){var e=t.data.textures,i=this.config,s=this.loader,n=s.baseURL,a=s.path,h=s.prefix,l=r(i,"baseURL",this.baseURL),u=r(i,"path",this.path),c=r(i,"prefix",this.prefix),d=r(i,"textureXhrSettings");s.setBaseURL(l),s.setPath(u),s.setPrefix(c);for(var p=0;p{var s=i(56694),n=i(76846),r=i(72632),o=i(42911),a=i(45176),h=i(55188),l=new s({Extends:a,initialize:function(t,e,i,s){var n="js",l=[];if(o(e)){var u=e;e=r(u,"key"),i=r(u,"url"),s=r(u,"xhrSettings"),n=r(u,"extension",n)}Array.isArray(i)||(i=[i]);for(var c=0;c{var s=i(56694),n=i(76846),r=i(72632),o=i(42911),a=i(45176),h=i(27291),l=i(76799),u=i(86897),c=new s({Extends:a,initialize:function(t,e,i,s,n,h){var l,c,d=t.cacheManager.obj;if(o(e)){var p=e;e=r(p,"key"),l=new u(t,{key:e,type:"obj",cache:d,url:r(p,"url"),extension:r(p,"extension","obj"),xhrSettings:r(p,"xhrSettings"),config:{flipUV:r(p,"flipUV",n)}}),(s=r(p,"matURL"))&&(c=new u(t,{key:e,type:"mat",cache:d,url:s,extension:r(p,"matExtension","mat"),xhrSettings:r(p,"xhrSettings")}))}else l=new u(t,{key:e,url:i,type:"obj",cache:d,extension:"obj",xhrSettings:h,config:{flipUV:n}}),s&&(c=new u(t,{key:e,url:s,type:"mat",cache:d,extension:"mat",xhrSettings:h}));a.call(this,t,"obj",e,[l,c])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=h(t.data,t.config.flipUV);e&&(i.materials=l(e.data)),t.cache.add(t.key,i),this.complete=!0}}});n.register("obj",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var o=0;o{var s=i(56694),n=i(12117),r=i(76846),o=i(70806),a=new s({Extends:o,initialize:function(t,e,i,s,n){o.call(this,t,e,i,s,n),this.type="packfile"},onProcess:function(){this.state!==n.FILE_POPULATED&&(this.state=n.FILE_PROCESSING,this.data=JSON.parse(this.xhrLoader.responseText)),this.loader.addPack(this.data,this.config),this.onProcessComplete()}});r.register("pack",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s,o,l){var u="js";if(h(e)){var c=e;e=a(c,"key"),i=a(c,"url"),l=a(c,"xhrSettings"),u=a(c,"extension",u),s=a(c,"start"),o=a(c,"mapping")}var d={type:"plugin",cache:!1,extension:u,responseType:"text",key:e,url:i,xhrSettings:l,config:{start:s,mapping:o}};r.call(this,t,d),"function"==typeof i&&(this.data=i,this.state=n.FILE_POPULATED)},onProcess:function(){var t=this.loader.systems.plugins,e=this.config,i=a(e,"start",!1),s=a(e,"mapping",null);if(this.state===n.FILE_POPULATED)t.install(this.key,this.data,i,s);else{this.state=n.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data);var r=t.install(this.key,window[this.key],i,s);(i||s)&&(this.loader.systems[s]=r,this.loader.scene[s]=r)}this.onProcessComplete()}});o.register("plugin",(function(t,e,i,s,n){if(Array.isArray(t))for(var r=0;r{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s,n){var o="svg";if(h(e)){var l=e;e=a(l,"key"),i=a(l,"url"),s=a(l,"svgConfig",{}),n=a(l,"xhrSettings"),o=a(l,"extension",o)}var u={type:"svg",cache:t.textureManager,extension:o,responseType:"text",key:e,url:i,xhrSettings:n,config:{width:a(s,"width"),height:a(s,"height"),scale:a(s,"scale")}};r.call(this,t,u)},onProcess:function(){this.state=n.FILE_PROCESSING;var t=this.xhrLoader.responseText,e=[t],i=this.config.width,s=this.config.height,o=this.config.scale;t:if(i&&s||o){var a=(new DOMParser).parseFromString(t,"text/xml").getElementsByTagName("svg")[0],h=a.hasAttribute("viewBox"),l=parseFloat(a.getAttribute("width")),u=parseFloat(a.getAttribute("height"));if(!h&&l&&u)a.setAttribute("viewBox","0 0 "+l+" "+u);else if(h&&!l&&!u){var c=a.getAttribute("viewBox").split(/\s+|,/);l=c[2],u=c[3]}if(o){if(!l||!u)break t;i=l*o,s=u*o}a.setAttribute("width",i.toString()+"px"),a.setAttribute("height",s.toString()+"px"),e=[(new XMLSerializer).serializeToString(a)]}try{var d=new window.Blob(e,{type:"image/svg+xml;charset=utf-8"})}catch(t){return void this.onProcessError()}this.data=new Image,this.data.crossOrigin=this.crossOrigin;var p=this,f=!1;this.data.onload=function(){f||r.revokeObjectURL(p.data),p.onProcessComplete()},this.data.onerror=function(){f?p.onProcessError():(f=!0,r.revokeObjectURL(p.data),p.data.src="data:image/svg+xml,"+encodeURIComponent(e.join("")))},r.createObjectURL(this.data,d,"image/svg+xml")},addToCache:function(){var t=this.cache.addImage(this.key,this.data);this.pendingDestroy(t)}});o.register("svg",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s){var n="js";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),s=a(o,"xhrSettings"),n=a(o,"extension",n)}var l={type:"text",extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,l)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t=this.data.concat("(function(){\nreturn new "+this.key+"();\n}).call(this);"),e=eval;this.loader.sceneManager.add(this.key,e(t)),this.complete=!0}});o.register("sceneFile",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s,o,l){var u="js";if(h(e)){var c=e;e=a(c,"key"),i=a(c,"url"),l=a(c,"xhrSettings"),u=a(c,"extension",u),s=a(c,"systemKey"),o=a(c,"sceneKey")}var d={type:"scenePlugin",cache:!1,extension:u,responseType:"text",key:e,url:i,xhrSettings:l,config:{systemKey:s,sceneKey:o}};r.call(this,t,d),"function"==typeof i&&(this.data=i,this.state=n.FILE_POPULATED)},onProcess:function(){var t=this.loader.systems.plugins,e=this.config,i=this.key,s=a(e,"systemKey",i),r=a(e,"sceneKey",i);this.state===n.FILE_POPULATED?t.installScenePlugin(s,this.data,r,this.loader.scene,!0):(this.state=n.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data),t.installScenePlugin(s,window[this.key],r,this.loader.scene,!0)),this.onProcessComplete()}});o.register("scenePlugin",(function(t,e,i,s,n){if(Array.isArray(t))for(var r=0;r{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s){var n="js";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),s=a(o,"xhrSettings"),n=a(o,"extension",n)}var l={type:"script",cache:!1,extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,l)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data),this.onProcessComplete()}});o.register("script",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(76846),r=i(42927),o=new s({Extends:r,initialize:function(t,e,i,s,n){r.call(this,t,e,i,n,s),this.type="spritesheet"},addToCache:function(){var t=this.cache.addSpriteSheet(this.key,this.data,this.config);this.pendingDestroy(t)}});n.register("spritesheet",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s){var n="text",o="txt",l=t.cacheManager.text;if(h(e)){var u=e;e=a(u,"key"),i=a(u,"url"),s=a(u,"xhrSettings"),o=a(u,"extension",o),n=a(u,"type",n),l=a(u,"cache",l)}var c={type:n,cache:l,extension:o,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,c)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});o.register("text",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=i(93560),u=new s({Extends:r,initialize:function(t,e,i,s){var n="csv";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),s=a(o,"xhrSettings"),n=a(o,"extension",n)}var u={type:"tilemapCSV",cache:t.cacheManager.tilemap,extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,u),this.tilemapFormat=l.CSV},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t={format:this.tilemapFormat,data:this.data};this.cache.add(this.key,t),this.pendingDestroy(t)}});o.register("tilemapCSV",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(76846),r=i(70806),o=i(93560),a=new s({Extends:r,initialize:function(t,e,i,s){r.call(this,t,e,i,s),this.type="tilemapJSON",this.cache=t.cacheManager.tilemap},addToCache:function(){var t={format:o.WELTMEISTER,data:this.data};this.cache.add(this.key,t),this.pendingDestroy(t)}});n.register("tilemapImpact",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(76846),r=i(70806),o=i(93560),a=new s({Extends:r,initialize:function(t,e,i,s){r.call(this,t,e,i,s),this.type="tilemapJSON",this.cache=t.cacheManager.tilemap},addToCache:function(){var t={format:o.TILED_JSON,data:this.data};this.cache.add(this.key,t),this.pendingDestroy(t)}});n.register("tilemapTiledJSON",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(76846),r=i(72632),o=i(42927),a=i(42911),h=i(45176),l=i(86897),u=new s({Extends:h,initialize:function(t,e,i,s,n,u){var c,d;if(a(e)){var p=e;e=r(p,"key"),c=new o(t,{key:e,url:r(p,"textureURL"),extension:r(p,"textureExtension","png"),normalMap:r(p,"normalMap"),xhrSettings:r(p,"textureXhrSettings")}),d=new l(t,{key:e,url:r(p,"atlasURL"),extension:r(p,"atlasExtension","txt"),xhrSettings:r(p,"atlasXhrSettings")})}else c=new o(t,e,i,n),d=new l(t,e,s,u);c.linkFile?h.call(this,t,"unityatlas",e,[c,d,c.linkFile]):h.call(this,t,"unityatlas",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addUnityAtlas(t.key,t.data,e.data,i),e.pendingDestroy(),this.complete=!0}}});n.register("unityAtlas",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var o=0;o{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(30750),h=i(72632),l=i(42911),u=new s({Extends:r,initialize:function(t,e,i,s,n,o,a){void 0===s&&(s="loadeddata"),void 0===n&&(n=!1),void 0===o&&(o=!1),"loadeddata"!==s&&"canplay"!==s&&"canplaythrough"!==s&&(s="loadeddata");var h={type:"video",cache:t.cacheManager.video,extension:i.type,responseType:"blob",key:e,url:i.url,xhrSettings:a,config:{loadEvent:s,asBlob:n,noAudio:o}};this.onLoadCallback=this.onVideoLoadHandler.bind(this),this.onErrorCallback=this.onVideoErrorHandler.bind(this),r.call(this,t,h)},onProcess:function(){if(this.state=n.FILE_PROCESSING,this.config.asBlob){var t=this.createVideoElement();this.data=t;var e=this;this.data.onloadeddata=function(){e.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(e.data),e.onProcessError()},r.createObjectURL(t,this.xhrLoader.response,""),t.load()}else this.onProcessComplete()},createVideoElement:function(){var t=document.createElement("video");return t.controls=!1,t.crossOrigin=this.loader.crossOrigin,this.config.noAudio&&(t.muted=!0,t.defaultMuted=!0,t.setAttribute("autoplay","autoplay")),t.setAttribute("playsinline","playsinline"),t.setAttribute("preload","auto"),t},onVideoLoadHandler:function(t){var e=t.target;e.removeEventListener(this.config.loadEvent,this.onLoadCallback,!0),e.removeEventListener("error",this.onErrorCallback,!0),this.data=e,this.resetXHR(),this.loader.nextFile(this,!0)},onVideoErrorHandler:function(t){var e=t.target;e&&(e.removeEventListener(this.config.loadEvent,this.onLoadCallback,!0),e.removeEventListener("error",this.onErrorCallback,!0)),this.resetXHR(),this.loader.nextFile(this,!1)},load:function(){var t=this.config.loadEvent;if(this.config.asBlob)r.prototype.load.call(this);else{this.percentComplete=0;var e=this.createVideoElement();e.addEventListener(t,this.onLoadCallback,!0),e.addEventListener("error",this.onErrorCallback,!0),e.src=a(this,this.loader.baseURL),e.load()}}});u.create=function(t,e,i,s,n,r,o){var a=t.systems.game;l(e)&&(i=h(e,"url",[]),s=h(e,"loadEvent","loadeddata"),n=h(e,"asBlob",!1),r=h(e,"noAudio",!1),o=h(e,"xhrSettings"),e=h(e,"key"));var c=u.getVideoURL(a,i);if(c)return new u(t,e,c,s,n,r,o)},u.getVideoURL=function(t,e){Array.isArray(e)||(e=[e]);for(var i=0;i{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=i(89200),u=new s({Extends:r,initialize:function(t,e,i,s){var n="xml";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),s=a(o,"xhrSettings"),n=a(o,"extension",n)}var l={type:"xml",cache:t.cacheManager.xml,extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,l)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=l(this.xhrLoader.responseText),this.data?this.onProcessComplete():this.onProcessError()}});o.register("xml",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{t.exports={AnimationJSONFile:i(46468),AsepriteFile:i(31648),AtlasJSONFile:i(73152),AtlasXMLFile:i(24616),AudioFile:i(67448),AudioSpriteFile:i(66109),BinaryFile:i(40612),BitmapFontFile:i(54565),CompressedTextureFile:i(47375),CSSFile:i(99898),GLSLFile:i(46568),HTML5AudioFile:i(30929),HTMLFile:i(77459),HTMLTextureFile:i(9755),ImageFile:i(42927),JSONFile:i(70806),MultiAtlasFile:i(80802),MultiScriptFile:i(39034),OBJFile:i(85527),PackFile:i(3616),PluginFile:i(12217),SceneFile:i(95171),ScenePluginFile:i(82458),ScriptFile:i(55188),SpriteSheetFile:i(33536),SVGFile:i(4474),TextFile:i(86897),TilemapCSVFile:i(58673),TilemapImpactFile:i(98896),TilemapJSONFile:i(50563),UnityAtlasFile:i(82857),VideoFile:i(22833),XMLFile:i(15297)}},95695:(t,e,i)=>{var s=i(12117),n=i(98611),r={Events:i(683),FileTypes:i(34034),File:i(98035),FileTypesManager:i(76846),GetURL:i(30750),LoaderPlugin:i(67285),MergeXHRSettings:i(43531),MultiFile:i(45176),XHRLoader:i(88490),XHRSettings:i(33868)};r=n(!1,r,s),t.exports=r},26042:t=>{t.exports=function(t){for(var e=0,i=0;i{var s=i(8034);t.exports=function(t,e){return s(t)/s(e)/s(t-e)}},17489:t=>{t.exports=function(t,e){return Math.floor(Math.random()*(e-t+1)+t)}},14976:t=>{t.exports=function(t,e,i,s,n){var r=.5*(s-e),o=.5*(n-i),a=t*t;return(2*i-2*s+r+o)*(t*a)+(-3*i+3*s-2*r-o)*a+r*t+i}},89129:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.ceil(t*s)/s}},82897:t=>{t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},75606:(t,e,i)=>{var s=i(83392);t.exports=function(t){return t*s.DEG_TO_RAD}},767:t=>{t.exports=function(t,e){return Math.abs(t-e)}},9849:(t,e,i)=>{var s=i(82897),n=i(56694),r=i(16650),o=i(72283),a=new r,h=new n({initialize:function t(e,i,s,n){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=t.DefaultOrder),this._x=e,this._y=i,this._z=s,this._order=n,this.onChangeCallback=o},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback(this)}},set:function(t,e,i,s){return void 0===s&&(s=this._order),this._x=t,this._y=e,this._z=i,this._order=s,this.onChangeCallback(this),this},copy:function(t){return this.set(t.x,t.y,t.z,t.order)},setFromQuaternion:function(t,e,i){return void 0===e&&(e=this._order),void 0===i&&(i=!1),a.fromQuat(t),this.setFromRotationMatrix(a,e,i)},setFromRotationMatrix:function(t,e,i){void 0===e&&(e=this._order),void 0===i&&(i=!1);var n=t.val,r=n[0],o=n[4],a=n[8],h=n[1],l=n[5],u=n[9],c=n[2],d=n[6],p=n[10],f=0,v=0,g=0,m=.99999;switch(e){case"XYZ":v=Math.asin(s(a,-1,1)),Math.abs(a){t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},61616:t=>{t.exports=function(t,e){return Math.random()*(e-t)+t}},60679:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.floor(t*s)/s}},91806:(t,e,i)=>{var s=i(82897);t.exports=function(t,e,i){return(i-e)*(t=s(t,0,1))+e}},79366:t=>{t.exports=function(t,e){return t/e/1e3}},43776:t=>{t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},58442:t=>{t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},42798:t=>{t.exports=function(t,e,i){return(e-t)*i+t}},5341:(t,e,i)=>{var s=new(i(56694))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new s(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=s,this},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=l*r-o*h,c=-l*n+o*a,d=h*n-r*a,p=e*u+i*c+s*d;return p?(p=1/p,t[0]=u*p,t[1]=(-l*i+s*h)*p,t[2]=(o*i-s*r)*p,t[3]=c*p,t[4]=(l*e-s*a)*p,t[5]=(-o*e+s*n)*p,t[6]=d*p,t[7]=(-h*e+i*a)*p,t[8]=(r*e-i*n)*p,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return t[0]=r*l-o*h,t[1]=s*h-i*l,t[2]=i*o-s*r,t[3]=o*a-n*l,t[4]=e*l-s*a,t[5]=s*n-e*o,t[6]=n*h-r*a,t[7]=i*a-e*h,t[8]=e*r-i*n,this},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return e*(l*r-o*h)+i*(-l*n+o*a)+s*(h*n-r*a)},multiply:function(t){var e=this.val,i=e[0],s=e[1],n=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=t.val,d=c[0],p=c[1],f=c[2],v=c[3],g=c[4],m=c[5],y=c[6],x=c[7],T=c[8];return e[0]=d*i+p*r+f*h,e[1]=d*s+p*o+f*l,e[2]=d*n+p*a+f*u,e[3]=v*i+g*r+m*h,e[4]=v*s+g*o+m*l,e[5]=v*n+g*a+m*u,e[6]=y*i+x*r+T*h,e[7]=y*s+x*o+T*l,e[8]=y*n+x*a+T*u,this},translate:function(t){var e=this.val,i=t.x,s=t.y;return e[6]=i*e[0]+s*e[3]+e[6],e[7]=i*e[1]+s*e[4]+e[7],e[8]=i*e[2]+s*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],s=e[1],n=e[2],r=e[3],o=e[4],a=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*r,e[1]=l*s+h*o,e[2]=l*n+h*a,e[3]=l*r-h*i,e[4]=l*o-h*s,e[5]=l*a-h*n,this},scale:function(t){var e=this.val,i=t.x,s=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=s*e[3],e[4]=s*e[4],e[5]=s*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,s=t.z,n=t.w,r=e+e,o=i+i,a=s+s,h=e*r,l=e*o,u=e*a,c=i*o,d=i*a,p=s*a,f=n*r,v=n*o,g=n*a,m=this.val;return m[0]=1-(c+p),m[3]=l+g,m[6]=u-v,m[1]=l-g,m[4]=1-(h+p),m[7]=d+f,m[2]=u+v,m[5]=d-f,m[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,i=this.val,s=e[0],n=e[1],r=e[2],o=e[3],a=e[4],h=e[5],l=e[6],u=e[7],c=e[8],d=e[9],p=e[10],f=e[11],v=e[12],g=e[13],m=e[14],y=e[15],x=s*h-n*a,T=s*l-r*a,w=s*u-o*a,b=n*l-r*h,E=n*u-o*h,S=r*u-o*l,A=c*g-d*v,_=c*m-p*v,C=c*y-f*v,M=d*m-p*g,R=d*y-f*g,P=p*y-f*m,O=x*P-T*R+w*M+b*C-E*_+S*A;return O?(O=1/O,i[0]=(h*P-l*R+u*M)*O,i[1]=(l*C-a*P-u*_)*O,i[2]=(a*R-h*C+u*A)*O,i[3]=(r*R-n*P-o*M)*O,i[4]=(s*P-r*C+o*_)*O,i[5]=(n*C-s*R-o*A)*O,i[6]=(g*S-m*E+y*b)*O,i[7]=(m*w-v*S-y*T)*O,i[8]=(v*E-g*w+y*x)*O,this):null}});t.exports=s},16650:(t,e,i)=>{var s=i(56694),n=i(70015),r=1e-6,o=new s({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new o(this)},set:function(t){return this.copy(t)},setValues:function(t,e,i,s,n,r,o,a,h,l,u,c,d,p,f,v){var g=this.val;return g[0]=t,g[1]=e,g[2]=i,g[3]=s,g[4]=n,g[5]=r,g[6]=o,g[7]=a,g[8]=h,g[9]=l,g[10]=u,g[11]=c,g[12]=d,g[13]=p,g[14]=f,g[15]=v,this},copy:function(t){var e=t.val;return this.setValues(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},fromArray:function(t){return this.setValues(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(t,e,i){var s=a.fromQuat(i).val,n=e.x,r=e.y,o=e.z;return this.setValues(s[0]*n,s[1]*n,s[2]*n,0,s[4]*r,s[5]*r,s[6]*r,0,s[8]*o,s[9]*o,s[10]*o,0,t.x,t.y,t.z,1)},xyz:function(t,e,i){this.identity();var s=this.val;return s[12]=t,s[13]=e,s[14]=i,this},scaling:function(t,e,i){this.zero();var s=this.val;return s[0]=t,s[5]=e,s[10]=i,s[15]=1,this},identity:function(){return this.setValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[3],n=t[6],r=t[7],o=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=n,t[11]=t[14],t[12]=s,t[13]=r,t[14]=o,this},getInverse:function(t){return this.copy(t),this.invert()},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],p=t[12],f=t[13],v=t[14],g=t[15],m=e*o-i*r,y=e*a-s*r,x=e*h-n*r,T=i*a-s*o,w=i*h-n*o,b=s*h-n*a,E=l*f-u*p,S=l*v-c*p,A=l*g-d*p,_=u*v-c*f,C=u*g-d*f,M=c*g-d*v,R=m*M-y*C+x*_+T*A-w*S+b*E;return R?(R=1/R,this.setValues((o*M-a*C+h*_)*R,(s*C-i*M-n*_)*R,(f*b-v*w+g*T)*R,(c*w-u*b-d*T)*R,(a*A-r*M-h*S)*R,(e*M-s*A+n*S)*R,(v*x-p*b-g*y)*R,(l*b-c*x+d*y)*R,(r*C-o*A+h*E)*R,(i*A-e*C-n*E)*R,(p*w-f*x+g*m)*R,(u*x-l*w-d*m)*R,(o*S-r*_-a*E)*R,(e*_-i*S+s*E)*R,(f*y-p*T-v*m)*R,(l*T-u*y+c*m)*R)):this},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],p=t[12],f=t[13],v=t[14],g=t[15];return this.setValues(o*(c*g-d*v)-u*(a*g-h*v)+f*(a*d-h*c),-(i*(c*g-d*v)-u*(s*g-n*v)+f*(s*d-n*c)),i*(a*g-h*v)-o*(s*g-n*v)+f*(s*h-n*a),-(i*(a*d-h*c)-o*(s*d-n*c)+u*(s*h-n*a)),-(r*(c*g-d*v)-l*(a*g-h*v)+p*(a*d-h*c)),e*(c*g-d*v)-l*(s*g-n*v)+p*(s*d-n*c),-(e*(a*g-h*v)-r*(s*g-n*v)+p*(s*h-n*a)),e*(a*d-h*c)-r*(s*d-n*c)+l*(s*h-n*a),r*(u*g-d*f)-l*(o*g-h*f)+p*(o*d-h*u),-(e*(u*g-d*f)-l*(i*g-n*f)+p*(i*d-n*u)),e*(o*g-h*f)-r*(i*g-n*f)+p*(i*h-n*o),-(e*(o*d-h*u)-r*(i*d-n*u)+l*(i*h-n*o)),-(r*(u*v-c*f)-l*(o*v-a*f)+p*(o*c-a*u)),e*(u*v-c*f)-l*(i*v-s*f)+p*(i*c-s*u),-(e*(o*v-a*f)-r*(i*v-s*f)+p*(i*a-s*o)),e*(o*c-a*u)-r*(i*c-s*u)+l*(i*a-s*o))},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],p=t[12],f=t[13],v=t[14],g=t[15];return(e*o-i*r)*(c*g-d*v)-(e*a-s*r)*(u*g-d*f)+(e*h-n*r)*(u*v-c*f)+(i*a-s*o)*(l*g-d*p)-(i*h-n*o)*(l*v-c*p)+(s*h-n*a)*(l*f-u*p)},multiply:function(t){var e=this.val,i=e[0],s=e[1],n=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=e[9],d=e[10],p=e[11],f=e[12],v=e[13],g=e[14],m=e[15],y=t.val,x=y[0],T=y[1],w=y[2],b=y[3];return e[0]=x*i+T*o+w*u+b*f,e[1]=x*s+T*a+w*c+b*v,e[2]=x*n+T*h+w*d+b*g,e[3]=x*r+T*l+w*p+b*m,x=y[4],T=y[5],w=y[6],b=y[7],e[4]=x*i+T*o+w*u+b*f,e[5]=x*s+T*a+w*c+b*v,e[6]=x*n+T*h+w*d+b*g,e[7]=x*r+T*l+w*p+b*m,x=y[8],T=y[9],w=y[10],b=y[11],e[8]=x*i+T*o+w*u+b*f,e[9]=x*s+T*a+w*c+b*v,e[10]=x*n+T*h+w*d+b*g,e[11]=x*r+T*l+w*p+b*m,x=y[12],T=y[13],w=y[14],b=y[15],e[12]=x*i+T*o+w*u+b*f,e[13]=x*s+T*a+w*c+b*v,e[14]=x*n+T*h+w*d+b*g,e[15]=x*r+T*l+w*p+b*m,this},multiplyLocal:function(t){var e=this.val,i=t.val;return this.setValues(e[0]*i[0]+e[1]*i[4]+e[2]*i[8]+e[3]*i[12],e[0]*i[1]+e[1]*i[5]+e[2]*i[9]+e[3]*i[13],e[0]*i[2]+e[1]*i[6]+e[2]*i[10]+e[3]*i[14],e[0]*i[3]+e[1]*i[7]+e[2]*i[11]+e[3]*i[15],e[4]*i[0]+e[5]*i[4]+e[6]*i[8]+e[7]*i[12],e[4]*i[1]+e[5]*i[5]+e[6]*i[9]+e[7]*i[13],e[4]*i[2]+e[5]*i[6]+e[6]*i[10]+e[7]*i[14],e[4]*i[3]+e[5]*i[7]+e[6]*i[11]+e[7]*i[15],e[8]*i[0]+e[9]*i[4]+e[10]*i[8]+e[11]*i[12],e[8]*i[1]+e[9]*i[5]+e[10]*i[9]+e[11]*i[13],e[8]*i[2]+e[9]*i[6]+e[10]*i[10]+e[11]*i[14],e[8]*i[3]+e[9]*i[7]+e[10]*i[11]+e[11]*i[15],e[12]*i[0]+e[13]*i[4]+e[14]*i[8]+e[15]*i[12],e[12]*i[1]+e[13]*i[5]+e[14]*i[9]+e[15]*i[13],e[12]*i[2]+e[13]*i[6]+e[14]*i[10]+e[15]*i[14],e[12]*i[3]+e[13]*i[7]+e[14]*i[11]+e[15]*i[15])},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.val,s=e.val,n=i[0],r=i[4],o=i[8],a=i[12],h=i[1],l=i[5],u=i[9],c=i[13],d=i[2],p=i[6],f=i[10],v=i[14],g=i[3],m=i[7],y=i[11],x=i[15],T=s[0],w=s[4],b=s[8],E=s[12],S=s[1],A=s[5],_=s[9],C=s[13],M=s[2],R=s[6],P=s[10],O=s[14],L=s[3],F=s[7],D=s[11],k=s[15];return this.setValues(n*T+r*S+o*M+a*L,h*T+l*S+u*M+c*L,d*T+p*S+f*M+v*L,g*T+m*S+y*M+x*L,n*w+r*A+o*R+a*F,h*w+l*A+u*R+c*F,d*w+p*A+f*R+v*F,g*w+m*A+y*R+x*F,n*b+r*_+o*P+a*D,h*b+l*_+u*P+c*D,d*b+p*_+f*P+v*D,g*b+m*_+y*P+x*D,n*E+r*C+o*O+a*k,h*E+l*C+u*O+c*k,d*E+p*C+f*O+v*k,g*E+m*C+y*O+x*k)},translate:function(t){return this.translateXYZ(t.x,t.y,t.z)},translateXYZ:function(t,e,i){var s=this.val;return s[12]=s[0]*t+s[4]*e+s[8]*i+s[12],s[13]=s[1]*t+s[5]*e+s[9]*i+s[13],s[14]=s[2]*t+s[6]*e+s[10]*i+s[14],s[15]=s[3]*t+s[7]*e+s[11]*i+s[15],this},scale:function(t){return this.scaleXYZ(t.x,t.y,t.z)},scaleXYZ:function(t,e,i){var s=this.val;return s[0]=s[0]*t,s[1]=s[1]*t,s[2]=s[2]*t,s[3]=s[3]*t,s[4]=s[4]*e,s[5]=s[5]*e,s[6]=s[6]*e,s[7]=s[7]*e,s[8]=s[8]*i,s[9]=s[9]*i,s[10]=s[10]*i,s[11]=s[11]*i,this},makeRotationAxis:function(t,e){var i=Math.cos(e),s=Math.sin(e),n=1-i,r=t.x,o=t.y,a=t.z,h=n*r,l=n*o;return this.setValues(h*r+i,h*o-s*a,h*a+s*o,0,h*o+s*a,l*o+i,l*a-s*r,0,h*a-s*o,l*a+s*r,n*a*a+i,0,0,0,0,1)},rotate:function(t,e){var i=this.val,s=e.x,n=e.y,o=e.z,a=Math.sqrt(s*s+n*n+o*o);if(Math.abs(a){t.exports=function(t,e,i){return Math.min(t+e,i)}},37394:t=>{t.exports=function(t){var e=t.length;if(0===e)return 0;t.sort((function(t,e){return t-e}));var i=Math.floor(e/2);return e%2==0?(t[i]+t[i-1])/2:t[i]}},17259:t=>{t.exports=function(t,e,i){return Math.max(t-e,i)}},61820:t=>{t.exports=function(t,e,i,s){void 0===i&&(i=e+1);var n=(t-e)/(i-e);return n>1?void 0!==s?(n=(s-t)/(s-i))<0&&(n=0):n=1:n<0&&(n=0),n}},75003:(t,e,i)=>{var s=i(56694),n=i(5341),r=i(72283),o=i(70015),a=1e-6,h=new Int8Array([1,2,0]),l=new Float32Array([0,0,0]),u=new o(1,0,0),c=new o(0,1,0),d=new o,p=new n,f=new s({initialize:function(t,e,i,s){this.onChangeCallback=r,this.set(t,e,i,s)},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback(this)}},copy:function(t){return this.set(t)},set:function(t,e,i,s,n){return void 0===n&&(n=!0),"object"==typeof t?(this._x=t.x||0,this._y=t.y||0,this._z=t.z||0,this._w=t.w||0):(this._x=t||0,this._y=e||0,this._z=i||0,this._w=s||0),n&&this.onChangeCallback(this),this},add:function(t){return this._x+=t.x,this._y+=t.y,this._z+=t.z,this._w+=t.w,this.onChangeCallback(this),this},subtract:function(t){return this._x-=t.x,this._y-=t.y,this._z-=t.z,this._w-=t.w,this.onChangeCallback(this),this},scale:function(t){return this._x*=t,this._y*=t,this._z*=t,this._w*=t,this.onChangeCallback(this),this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,n=t*t+e*e+i*i+s*s;return n>0&&(n=1/Math.sqrt(n),this._x=t*n,this._y=e*n,this._z=i*n,this._w=s*n),this.onChangeCallback(this),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,n=this.z,r=this.w;return this.set(i+e*(t.x-i),s+e*(t.y-s),n+e*(t.z-n),r+e*(t.w-r))},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(d.copy(u).cross(t).length().999999?this.set(0,0,0,1):(d.copy(t).cross(e),this._x=d.x,this._y=d.y,this._z=d.z,this._w=1+i,this.normalize())},setAxes:function(t,e,i){var s=p.val;return s[0]=e.x,s[3]=e.y,s[6]=e.z,s[1]=i.x,s[4]=i.y,s[7]=i.z,s[2]=-t.x,s[5]=-t.y,s[8]=-t.z,this.fromMat3(p).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.set(i*t.x,i*t.y,i*t.z,Math.cos(e))},multiply:function(t){var e=this.x,i=this.y,s=this.z,n=this.w,r=t.x,o=t.y,a=t.z,h=t.w;return this.set(e*h+n*r+i*a-s*o,i*h+n*o+s*r-e*a,s*h+n*a+e*o-i*r,n*h-e*r-i*o-s*a)},slerp:function(t,e){var i=this.x,s=this.y,n=this.z,r=this.w,o=t.x,h=t.y,l=t.z,u=t.w,c=i*o+s*h+n*l+r*u;c<0&&(c=-c,o=-o,h=-h,l=-l,u=-u);var d=1-e,p=e;if(1-c>a){var f=Math.acos(c),v=Math.sin(f);d=Math.sin((1-e)*f)/v,p=Math.sin(e*f)/v}return this.set(d*i+p*o,d*s+p*h,d*n+p*l,d*r+p*u)},invert:function(){var t=this.x,e=this.y,i=this.z,s=this.w,n=t*t+e*e+i*i+s*s,r=n?1/n:0;return this.set(-t*r,-e*r,-i*r,s*r)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,n=this.w,r=Math.sin(t),o=Math.cos(t);return this.set(e*o+n*r,i*o+s*r,s*o-i*r,n*o-e*r)},rotateY:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,n=this.w,r=Math.sin(t),o=Math.cos(t);return this.set(e*o-s*r,i*o+n*r,s*o+e*r,n*o-i*r)},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,n=this.w,r=Math.sin(t),o=Math.cos(t);return this.set(e*o+i*r,i*o-e*r,s*o+n*r,n*o-s*r)},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},setFromEuler:function(t,e){var i=t.x/2,s=t.y/2,n=t.z/2,r=Math.cos(i),o=Math.cos(s),a=Math.cos(n),h=Math.sin(i),l=Math.sin(s),u=Math.sin(n);switch(t.order){case"XYZ":this.set(h*o*a+r*l*u,r*l*a-h*o*u,r*o*u+h*l*a,r*o*a-h*l*u,e);break;case"YXZ":this.set(h*o*a+r*l*u,r*l*a-h*o*u,r*o*u-h*l*a,r*o*a+h*l*u,e);break;case"ZXY":this.set(h*o*a-r*l*u,r*l*a+h*o*u,r*o*u+h*l*a,r*o*a-h*l*u,e);break;case"ZYX":this.set(h*o*a-r*l*u,r*l*a+h*o*u,r*o*u-h*l*a,r*o*a+h*l*u,e);break;case"YZX":this.set(h*o*a+r*l*u,r*l*a+h*o*u,r*o*u-h*l*a,r*o*a-h*l*u,e);break;case"XZY":this.set(h*o*a-r*l*u,r*l*a-h*o*u,r*o*u+h*l*a,r*o*a+h*l*u,e)}return this},setFromRotationMatrix:function(t){var e,i=t.val,s=i[0],n=i[4],r=i[8],o=i[1],a=i[5],h=i[9],l=i[2],u=i[6],c=i[10],d=s+a+c;return d>0?(e=.5/Math.sqrt(d+1),this.set((u-h)*e,(r-l)*e,(o-n)*e,.25/e)):s>a&&s>c?(e=2*Math.sqrt(1+s-a-c),this.set(.25*e,(n+o)/e,(r+l)/e,(u-h)/e)):a>c?(e=2*Math.sqrt(1+a-s-c),this.set((n+o)/e,.25*e,(h+u)/e,(r-l)/e)):(e=2*Math.sqrt(1+c-s-a),this.set((r+l)/e,(h+u)/e,.25*e,(o-n)/e)),this},fromMat3:function(t){var e,i=t.val,s=i[0]+i[4]+i[8];if(s>0)e=Math.sqrt(s+1),this.w=.5*e,e=.5/e,this._x=(i[7]-i[5])*e,this._y=(i[2]-i[6])*e,this._z=(i[3]-i[1])*e;else{var n=0;i[4]>i[0]&&(n=1),i[8]>i[3*n+n]&&(n=2);var r=h[n],o=h[r];e=Math.sqrt(i[3*n+n]-i[3*r+r]-i[3*o+o]+1),l[n]=.5*e,e=.5/e,l[r]=(i[3*r+n]+i[3*n+r])*e,l[o]=(i[3*o+n]+i[3*n+o])*e,this._x=l[0],this._y=l[1],this._z=l[2],this._w=(i[3*o+r]-i[3*r+o])*e}return this.onChangeCallback(this),this}});t.exports=f},23701:(t,e,i)=>{var s=i(83392);t.exports=function(t){return t*s.RAD_TO_DEG}},16906:t=>{t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},52417:t=>{t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,s=2*Math.random()-1,n=Math.sqrt(1-s*s)*e;return t.x=Math.cos(i)*n,t.y=Math.sin(i)*n,t.z=s*e,t}},17915:t=>{t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},52257:t=>{t.exports=function(t,e){var i=t.x,s=t.y;return t.x=i*Math.cos(e)-s*Math.sin(e),t.y=i*Math.sin(e)+s*Math.cos(e),t}},2386:t=>{t.exports=function(t,e,i,s){var n=Math.cos(s),r=Math.sin(s),o=t.x-e,a=t.y-i;return t.x=o*n-a*r+e,t.y=o*r+a*n+i,t}},72395:t=>{t.exports=function(t,e,i,s,n){var r=s+Math.atan2(t.y-i,t.x-e);return t.x=e+n*Math.cos(r),t.y=i+n*Math.sin(r),t}},41061:t=>{t.exports=function(t,e,i,s,n){return t.x=e+n*Math.cos(s),t.y=i+n*Math.sin(s),t}},93709:(t,e,i)=>{var s=i(70015),n=i(16650),r=i(75003),o=new n,a=new r,h=new s;t.exports=function(t,e,i){return a.setAxisAngle(e,i),o.fromRotationTranslation(a,h.set(0,0,0)),t.transformMat4(o)}},67233:t=>{t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},64333:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.round(t*s)/s}},59533:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=1),void 0===i&&(i=1),void 0===s&&(s=1),s*=Math.PI/t;for(var n=[],r=[],o=0;o{t.exports=function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},87736:t=>{t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},55805:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n){void 0===n&&(n=new s);var r=0,o=0;return t>0&&t<=e*i&&(r=t>e-1?t-(o=Math.floor(t/e))*e:t),n.set(r,o)}},64462:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r,o,a,h){void 0===h&&(h=new s);var l=Math.sin(r),u=Math.cos(r),c=u*o,d=l*o,p=-l*a,f=u*a,v=1/(c*f+p*-d);return h.x=f*v*t+-p*v*e+(n*p-i*f)*v,h.y=c*v*e+-d*v*t+(-n*c+i*d)*v,h}},93736:(t,e,i)=>{var s=i(56694),n=i(88456),r=new s({initialize:function(t,e){this.x=0,this.y=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0):(void 0===e&&(e=t),this.x=t||0,this.y=e||0)},clone:function(){return new r(this.x,this.y)},copy:function(t){return this.x=t.x||0,this.y=t.y||0,this},setFromObject:function(t){return this.x=t.x||0,this.y=t.y||0,this},set:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setTo:function(t,e){return this.set(t,e)},setToPolar:function(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this},equals:function(t){return this.x===t.x&&this.y===t.y},fuzzyEquals:function(t,e){return n(this.x,t.x,e)&&n(this.y,t.y,e)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},setAngle:function(t){return this.setToPolar(t,this.length())},add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},length:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},setLength:function(t){return this.normalize().scale(t)},lengthSq:function(){var t=this.x,e=this.y;return t*t+e*e},normalize:function(){var t=this.x,e=this.y,i=t*t+e*e;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},normalizeLeftHand:function(){var t=this.x;return this.x=this.y,this.y=-1*t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this},transformMat3:function(t){var e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[3]*i+s[6],this.y=s[1]*e+s[4]*i+s[7],this},transformMat4:function(t){var e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[4]*i+s[12],this.y=s[1]*e+s[5]*i+s[13],this},reset:function(){return this.x=0,this.y=0,this},limit:function(t){var e=this.length();return e&&e>t&&this.scale(t/e),this},reflect:function(t){return t=t.clone().normalize(),this.subtract(t.scale(2*this.dot(t)))},mirror:function(t){return this.reflect(t).negate()},rotate:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e*this.x-i*this.y,i*this.x+e*this.y)}});r.ZERO=new r,r.RIGHT=new r(1,0),r.LEFT=new r(-1,0),r.UP=new r(0,-1),r.DOWN=new r(0,1),r.ONE=new r(1,1),t.exports=r},70015:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clone:function(){return new s(this.x,this.y,this.z)},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},crossVectors:function(t,e){var i=t.x,s=t.y,n=t.z,r=e.x,o=e.y,a=e.z;return this.x=s*a-n*o,this.y=n*r-i*a,this.z=i*o-s*r,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},setFromMatrixPosition:function(t){return this.fromArray(t.val,12)},setFromMatrixColumn:function(t,e){return this.fromArray(t.val,4*e)},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addScale:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return Math.sqrt(e*e+i*i+s*s)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return e*e+i*i+s*s},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,s=t*t+e*e+i*i;return s>0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,s=this.z,n=t.x,r=t.y,o=t.z;return this.x=i*o-s*r,this.y=s*n-e*o,this.z=e*r-i*n,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,n=this.z;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=n+e*(t.z-n),this},applyMatrix3:function(t){var e=this.x,i=this.y,s=this.z,n=t.val;return this.x=n[0]*e+n[3]*i+n[6]*s,this.y=n[1]*e+n[4]*i+n[7]*s,this.z=n[2]*e+n[5]*i+n[8]*s,this},applyMatrix4:function(t){var e=this.x,i=this.y,s=this.z,n=t.val,r=1/(n[3]*e+n[7]*i+n[11]*s+n[15]);return this.x=(n[0]*e+n[4]*i+n[8]*s+n[12])*r,this.y=(n[1]*e+n[5]*i+n[9]*s+n[13])*r,this.z=(n[2]*e+n[6]*i+n[10]*s+n[14])*r,this},transformMat3:function(t){var e=this.x,i=this.y,s=this.z,n=t.val;return this.x=e*n[0]+i*n[3]+s*n[6],this.y=e*n[1]+i*n[4]+s*n[7],this.z=e*n[2]+i*n[5]+s*n[8],this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,n=t.val;return this.x=n[0]*e+n[4]*i+n[8]*s+n[12],this.y=n[1]*e+n[5]*i+n[9]*s+n[13],this.z=n[2]*e+n[6]*i+n[10]*s+n[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,s=this.z,n=t.val,r=e*n[0]+i*n[4]+s*n[8]+n[12],o=e*n[1]+i*n[5]+s*n[9]+n[13],a=e*n[2]+i*n[6]+s*n[10]+n[14],h=e*n[3]+i*n[7]+s*n[11]+n[15];return this.x=r/h,this.y=o/h,this.z=a/h,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,n=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*s-o*i,l=a*i+o*e-n*s,u=a*s+n*i-r*e,c=-n*e-r*i-o*s;return this.x=h*a+c*-n+l*-o-u*-r,this.y=l*a+c*-r+u*-n-h*-o,this.z=u*a+c*-o+h*-r-l*-n,this},project:function(t){var e=this.x,i=this.y,s=this.z,n=t.val,r=n[0],o=n[1],a=n[2],h=n[3],l=n[4],u=n[5],c=n[6],d=n[7],p=n[8],f=n[9],v=n[10],g=n[11],m=n[12],y=n[13],x=n[14],T=1/(e*h+i*d+s*g+n[15]);return this.x=(e*r+i*l+s*p+m)*T,this.y=(e*o+i*u+s*f+y)*T,this.z=(e*a+i*c+s*v+x)*T,this},projectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unprojectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unproject:function(t,e){var i=t.x,s=t.y,n=t.z,r=t.w,o=this.x-i,a=r-this.y-1-s,h=this.z;return this.x=2*o/n-1,this.y=2*a/r-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});s.ZERO=new s,s.RIGHT=new s(1,0,0),s.LEFT=new s(-1,0,0),s.UP=new s(0,-1,0),s.DOWN=new s(0,1,0),s.FORWARD=new s(0,0,1),s.BACK=new s(0,0,-1),s.ONE=new s(1,1,1),t.exports=s},51729:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0)},clone:function(){return new s(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,s){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,n=t*t+e*e+i*i+s*s;return n>0&&(n=1/Math.sqrt(n),this.x=t*n,this.y=e*n,this.z=i*n,this.w=s*n),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,n=this.z,r=this.w;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=n+e*(t.z-n),this.w=r+e*(t.w-r),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,n=t.w-this.w||0;return Math.sqrt(e*e+i*i+s*s+n*n)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,n=t.w-this.w||0;return e*e+i*i+s*s+n*n},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,n=this.w,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*s+r[12]*n,this.y=r[1]*e+r[5]*i+r[9]*s+r[13]*n,this.z=r[2]*e+r[6]*i+r[10]*s+r[14]*n,this.w=r[3]*e+r[7]*i+r[11]*s+r[15]*n,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,n=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*s-o*i,l=a*i+o*e-n*s,u=a*s+n*i-r*e,c=-n*e-r*i-o*s;return this.x=h*a+c*-n+l*-o-u*-r,this.y=l*a+c*-r+u*-n-h*-o,this.z=u*a+c*-o+h*-r-l*-n,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});s.prototype.sub=s.prototype.subtract,s.prototype.mul=s.prototype.multiply,s.prototype.div=s.prototype.divide,s.prototype.dist=s.prototype.distance,s.prototype.distSq=s.prototype.distanceSq,s.prototype.len=s.prototype.length,s.prototype.lenSq=s.prototype.lengthSq,t.exports=s},9557:t=>{t.exports=function(t,e,i){return Math.abs(t-e)<=i}},1071:t=>{t.exports=function(t,e,i){var s=i-e;return e+((t-e)%s+s)%s}},90447:t=>{t.exports=function(t,e,i,s){return Math.atan2(s-e,i-t)}},94240:t=>{t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},84066:t=>{t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},9678:t=>{t.exports=function(t,e,i,s){return Math.atan2(i-t,s-e)}},76861:(t,e,i)=>{var s=i(83392);t.exports=function(t){return t>Math.PI&&(t-=s.PI2),Math.abs(((t+s.TAU)%s.PI2-s.PI2)%s.PI2)}},37570:t=>{t.exports=function(t){return(t%=2*Math.PI)>=0?t:t+2*Math.PI}},87597:(t,e,i)=>{var s=i(61616);t.exports=function(){return s(-Math.PI,Math.PI)}},74493:(t,e,i)=>{var s=i(61616);t.exports=function(){return s(-180,180)}},19049:(t,e,i)=>{var s=i(37570);t.exports=function(t){return s(t+Math.PI)}},90612:(t,e,i)=>{var s=i(83392);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=s.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e{t.exports=function(t,e){var i=e-t;return 0===i?0:i-360*Math.floor((i- -180)/360)}},35786:(t,e,i)=>{var s=i(1071);t.exports=function(t){return s(t,-Math.PI,Math.PI)}},62138:(t,e,i)=>{var s=i(1071);t.exports=function(t){return s(t,-180,180)}},22153:(t,e,i)=>{t.exports={Between:i(90447),BetweenPoints:i(94240),BetweenPointsY:i(84066),BetweenY:i(9678),CounterClockwise:i(76861),Normalize:i(37570),Random:i(87597),RandomDegrees:i(74493),Reverse:i(19049),RotateTo:i(90612),ShortestBetween:i(93954),Wrap:i(35786),WrapDegrees:i(62138)}},83392:t=>{var e={PI2:2*Math.PI,TAU:.5*Math.PI,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:null,MIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER||-9007199254740991,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991};t.exports=e},53996:t=>{t.exports=function(t,e,i,s){var n=t-i,r=e-s;return Math.sqrt(n*n+r*r)}},92951:t=>{t.exports=function(t,e){var i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)}},12161:t=>{t.exports=function(t,e){var i=t.x-e.x,s=t.y-e.y;return i*i+s*s}},38057:t=>{t.exports=function(t,e,i,s){return Math.max(Math.abs(t-i),Math.abs(e-s))}},33297:t=>{t.exports=function(t,e,i,s,n){return void 0===n&&(n=2),Math.sqrt(Math.pow(i-t,n)+Math.pow(s-e,n))}},90366:t=>{t.exports=function(t,e,i,s){return Math.abs(t-i)+Math.abs(e-s)}},35032:t=>{t.exports=function(t,e,i,s){var n=t-i,r=e-s;return n*n+r*r}},10130:(t,e,i)=>{t.exports={Between:i(53996),BetweenPoints:i(92951),BetweenPointsSquared:i(12161),Chebyshev:i(38057),Power:i(33297),Snake:i(90366),Squared:i(35032)}},35060:(t,e,i)=>{var s=i(25265),n=i(57428),r=i(73214),o=i(71778),a=i(36468),h=i(88258),l=i(52910),u=i(67799),c=i(74083),d=i(92284),p=i(28035),f=i(8754);t.exports={Power0:l,Power1:u.Out,Power2:o.Out,Power3:c.Out,Power4:d.Out,Linear:l,Quad:u.Out,Cubic:o.Out,Quart:c.Out,Quint:d.Out,Sine:p.Out,Expo:h.Out,Circ:r.Out,Elastic:a.Out,Back:s.Out,Bounce:n.Out,Stepped:f,"Quad.easeIn":u.In,"Cubic.easeIn":o.In,"Quart.easeIn":c.In,"Quint.easeIn":d.In,"Sine.easeIn":p.In,"Expo.easeIn":h.In,"Circ.easeIn":r.In,"Elastic.easeIn":a.In,"Back.easeIn":s.In,"Bounce.easeIn":n.In,"Quad.easeOut":u.Out,"Cubic.easeOut":o.Out,"Quart.easeOut":c.Out,"Quint.easeOut":d.Out,"Sine.easeOut":p.Out,"Expo.easeOut":h.Out,"Circ.easeOut":r.Out,"Elastic.easeOut":a.Out,"Back.easeOut":s.Out,"Bounce.easeOut":n.Out,"Quad.easeInOut":u.InOut,"Cubic.easeInOut":o.InOut,"Quart.easeInOut":c.InOut,"Quint.easeInOut":d.InOut,"Sine.easeInOut":p.InOut,"Expo.easeInOut":h.InOut,"Circ.easeInOut":r.InOut,"Elastic.easeInOut":a.InOut,"Back.easeInOut":s.InOut,"Bounce.easeInOut":n.InOut}},25860:t=>{t.exports=function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)}},45264:t=>{t.exports=function(t,e){void 0===e&&(e=1.70158);var i=1.525*e;return(t*=2)<1?t*t*((i+1)*t-i)*.5:.5*((t-=2)*t*((i+1)*t+i)+2)}},36699:t=>{t.exports=function(t,e){return void 0===e&&(e=1.70158),--t*t*((e+1)*t+e)+1}},25265:(t,e,i)=>{t.exports={In:i(25860),Out:i(36699),InOut:i(45264)}},62191:t=>{t.exports=function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}},24799:t=>{t.exports=function(t){var e=!1;return t<.5?(t=1-2*t,e=!0):t=2*t-1,t<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5}},60819:t=>{t.exports=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},57428:(t,e,i)=>{t.exports={In:i(62191),Out:i(60819),InOut:i(24799)}},86855:t=>{t.exports=function(t){return 1-Math.sqrt(1-t*t)}},7280:t=>{t.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},18058:t=>{t.exports=function(t){return Math.sqrt(1- --t*t)}},73214:(t,e,i)=>{t.exports={In:i(86855),Out:i(18058),InOut:i(7280)}},91532:t=>{t.exports=function(t){return t*t*t}},63180:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},16518:t=>{t.exports=function(t){return--t*t*t+1}},71778:(t,e,i)=>{t.exports={In:i(91532),Out:i(16518),InOut:i(63180)}},24729:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)}},50325:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)*.5+1}},84074:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-s)*(2*Math.PI)/i)+1}},36468:(t,e,i)=>{t.exports={In:i(24729),Out:i(84074),InOut:i(50325)}},95638:t=>{t.exports=function(t){return Math.pow(2,10*(t-1))-.001}},10357:t=>{t.exports=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))}},14894:t=>{t.exports=function(t){return 1-Math.pow(2,-10*t)}},88258:(t,e,i)=>{t.exports={In:i(95638),Out:i(14894),InOut:i(10357)}},33063:(t,e,i)=>{t.exports={Back:i(25265),Bounce:i(57428),Circular:i(73214),Cubic:i(71778),Elastic:i(36468),Expo:i(88258),Linear:i(52910),Quadratic:i(67799),Quartic:i(74083),Quintic:i(92284),Sine:i(28035),Stepped:i(8754)}},43927:t=>{t.exports=function(t){return t}},52910:(t,e,i)=>{t.exports=i(43927)},77471:t=>{t.exports=function(t){return t*t}},83863:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},44383:t=>{t.exports=function(t){return t*(2-t)}},67799:(t,e,i)=>{t.exports={In:i(77471),Out:i(44383),InOut:i(83863)}},48311:t=>{t.exports=function(t){return t*t*t*t}},55248:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},23135:t=>{t.exports=function(t){return 1- --t*t*t*t}},74083:(t,e,i)=>{t.exports={In:i(48311),Out:i(23135),InOut:i(55248)}},7313:t=>{t.exports=function(t){return t*t*t*t*t}},98759:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},26670:t=>{t.exports=function(t){return--t*t*t*t*t+1}},92284:(t,e,i)=>{t.exports={In:i(7313),Out:i(26670),InOut:i(98759)}},52929:t=>{t.exports=function(t){return 0===t?0:1===t?1:1-Math.cos(t*Math.PI/2)}},66333:t=>{t.exports=function(t){return 0===t?0:1===t?1:.5*(1-Math.cos(Math.PI*t))}},37255:t=>{t.exports=function(t){return 0===t?0:1===t?1:Math.sin(t*Math.PI/2)}},28035:(t,e,i)=>{t.exports={In:i(52929),Out:i(37255),InOut:i(66333)}},52770:t=>{t.exports=function(t,e){return void 0===e&&(e=1),t<=0?0:t>=1?1:1/e*(1+(e*t|0))}},8754:(t,e,i)=>{t.exports=i(52770)},17247:t=>{t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},88456:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.floor(t+e)}},41935:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t>e-i}},54726:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t{t.exports={Ceil:i(17247),Equal:i(88456),Floor:i(61824),GreaterThan:i(41935),LessThan:i(54726)}},5923:(t,e,i)=>{var s=i(83392),n=i(98611),r={Angle:i(22153),Distance:i(10130),Easing:i(33063),Fuzzy:i(52778),Interpolation:i(48528),Pow2:i(73773),Snap:i(23679),RandomDataGenerator:i(81429),Average:i(26042),Bernstein:i(22824),Between:i(17489),CatmullRom:i(14976),CeilTo:i(89129),Clamp:i(82897),DegToRad:i(75606),Difference:i(767),Euler:i(9849),Factorial:i(8034),FloatBetween:i(61616),FloorTo:i(60679),FromPercent:i(91806),GetSpeed:i(79366),IsEven:i(43776),IsEvenStrict:i(58442),Linear:i(42798),MaxAdd:i(69635),Median:i(37394),MinSub:i(17259),Percent:i(61820),RadToDeg:i(23701),RandomXY:i(16906),RandomXYZ:i(52417),RandomXYZW:i(17915),Rotate:i(52257),RotateAround:i(2386),RotateAroundDistance:i(72395),RotateTo:i(41061),RoundAwayFromZero:i(67233),RoundTo:i(64333),SinCosTableGenerator:i(59533),SmootherStep:i(87736),SmoothStep:i(5514),ToXY:i(55805),TransformXY:i(64462),Within:i(9557),Wrap:i(1071),Vector2:i(93736),Vector3:i(70015),Vector4:i(51729),Matrix3:i(5341),Matrix4:i(16650),Quaternion:i(75003),RotateVec3:i(93709)};r=n(!1,r,s),t.exports=r},63210:(t,e,i)=>{var s=i(22824);t.exports=function(t,e){for(var i=0,n=t.length-1,r=0;r<=n;r++)i+=Math.pow(1-e,n-r)*Math.pow(e,r)*t[r]*s(n,r);return i}},88332:(t,e,i)=>{var s=i(14976);t.exports=function(t,e){var i=t.length-1,n=i*e,r=Math.floor(n);return t[0]===t[i]?(e<0&&(r=Math.floor(n=i*(1+e))),s(n-r,t[(r-1+i)%i],t[r],t[(r+1)%i],t[(r+2)%i])):e<0?t[0]-(s(-n,t[0],t[0],t[1],t[1])-t[0]):e>1?t[i]-(s(n-i,t[i],t[i],t[i-1],t[i-1])-t[i]):s(n-r,t[r?r-1:0],t[r],t[i{t.exports=function(t,e,i,s,n){return function(t,e){var i=1-t;return i*i*i*e}(t,e)+function(t,e){var i=1-t;return 3*i*i*t*e}(t,i)+function(t,e){return 3*(1-t)*t*t*e}(t,s)+function(t,e){return t*t*t*e}(t,n)}},47614:(t,e,i)=>{var s=i(42798);t.exports=function(t,e){var i=t.length-1,n=i*e,r=Math.floor(n);return e<0?s(t[0],t[1],n):e>1?s(t[i],t[i-1],i-n):s(t[r],t[r+1>i?i:r+1],n-r)}},16252:t=>{t.exports=function(t,e,i,s){return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,s)}},44521:(t,e,i)=>{var s=i(5514);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},45507:(t,e,i)=>{var s=i(87736);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},48528:(t,e,i)=>{t.exports={Bezier:i(63210),CatmullRom:i(88332),CubicBezier:i(34631),Linear:i(47614),QuadraticBezier:i(16252),SmoothStep:i(44521),SmootherStep:i(45507)}},3504:t=>{t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<{t.exports=function(t,e){return t>0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},2018:t=>{t.exports=function(t){return t>0&&0==(t&t-1)}},73773:(t,e,i)=>{t.exports={GetNext:i(3504),IsSize:i(28621),IsValue:i(2018)}},81429:(t,e,i)=>{var s=new(i(56694))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,i=this.n;t=t.toString();for(var s=0;s>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e0;e--){var i=Math.floor(this.frac()*(e+1)),s=t[i];t[i]=t[e],t[e]=s}return t}});t.exports=s},82127:t=>{t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),s?(i+t)/e:i+t)}},84314:t=>{t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),s?(i+t)/e:i+t)}},88462:t=>{t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),s?(i+t)/e:i+t)}},23679:(t,e,i)=>{t.exports={Ceil:i(82127),Floor:i(84314),To:i(88462)}},92491:(t,e,i)=>{var s=i(86459),n=i(98611),r={Actions:i(83979),Animations:i(13517),BlendModes:i(95723),Cache:i(45820),Cameras:i(44143),Core:i(80293),Class:i(56694),Create:i(84106),Curves:i(73962),Data:i(1999),Display:i(24816),DOM:i(3590),Events:i(95146),Game:i(15213),GameObjects:i(48013),Geom:i(84068),Input:i(20873),Loader:i(95695),Math:i(5923),Physics:i(53954),Plugins:i(45615),Renderer:i(42069),Scale:i(86754),ScaleModes:i(27394),Scene:i(87157),Scenes:i(20436),Structs:i(20010),Textures:i(87499),Tilemaps:i(52678),Time:i(97121),Tweens:i(75193),Utils:i(22178)};r.Sound=i(56751),r=n(!1,r,s),t.exports=r,i.g.Phaser=r},62832:(t,e,i)=>{var s=i(56694),n=i(7864),r=i(1539),o=new s({Extends:r,Mixins:[n.Acceleration,n.Angular,n.Bounce,n.Debug,n.Drag,n.Enable,n.Friction,n.Gravity,n.Immovable,n.Mass,n.Pushable,n.Size,n.Velocity],initialize:function(t,e,i,s,n){r.call(this,t,e,i,s,n),this.body=null}});t.exports=o},66150:(t,e,i)=>{var s=i(56694),n=i(75606),r=i(53996),o=i(35032),a=i(99523),h=i(72632),l=i(30657),u=i(2732),c=i(15147),d=i(91963),p=i(7599),f=i(93736),v=i(85233),g=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,t.sys.events.once(p.BOOT,this.boot,this),t.sys.events.on(p.START,this.start,this)},boot:function(){this.world=new v(this.scene,this.config),this.add=new a(this.world),this.systems.events.once(p.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new v(this.scene,this.config),this.add=new a(this.world));var t=this.systems.events;h(this.config,"customUpdate",!1)||t.on(p.UPDATE,this.world.update,this.world),t.on(p.POST_UPDATE,this.world.postUpdate,this.world),t.once(p.SHUTDOWN,this.shutdown,this)},enableUpdate:function(){this.systems.events.on(p.UPDATE,this.world.update,this.world)},disableUpdate:function(){this.systems.events.off(p.UPDATE,this.world.update,this.world)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return l(h(e,"arcade",{}),h(t,"arcade",{}))},overlap:function(t,e,i,s,n){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=i),this.world.collideObjects(t,e,i,s,n,!0)},collide:function(t,e,i,s,n){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=i),this.world.collideObjects(t,e,i,s,n,!1)},collideTiles:function(t,e,i,s,n){return this.world.collideTiles(t,e,i,s,n)},overlapTiles:function(t,e,i,s,n){return this.world.overlapTiles(t,e,i,s,n)},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},accelerateTo:function(t,e,i,s,n,r){void 0===s&&(s=60);var o=Math.atan2(i-t.y,e-t.x);return t.body.acceleration.setToPolar(o,s),void 0!==n&&void 0!==r&&t.body.maxVelocity.set(n,r),o},accelerateToObject:function(t,e,i,s,n){return this.accelerateTo(t,e.x,e.y,i,s,n)},closest:function(t,e){e||(e=this.world.bodies.entries);for(var i=Number.MAX_VALUE,s=null,n=t.x,r=t.y,a=e.length,h=0;hi&&(s=l,i=c)}}return s},moveTo:function(t,e,i,s,n){void 0===s&&(s=60),void 0===n&&(n=0);var o=Math.atan2(i-t.y,e-t.x);return n>0&&(s=r(t.x,t.y,e,i)/(n/1e3)),t.body.velocity.setToPolar(o,s),o},moveToObject:function(t,e,i,s){return this.moveTo(t,e.x,e.y,i,s)},velocityFromAngle:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new f),i.setToPolar(n(t),e)},velocityFromRotation:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new f),i.setToPolar(t,e)},overlapRect:function(t,e,i,s,n,r){return c(this.world,t,e,i,s,n,r)},overlapCirc:function(t,e,i,s,n){return u(this.world,t,e,i,s,n)},shutdown:function(){if(this.world){var t=this.systems.events;t.off(p.UPDATE,this.world.update,this.world),t.off(p.POST_UPDATE,this.world.postUpdate,this.world),t.off(p.SHUTDOWN,this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null}},destroy:function(){this.shutdown(),this.scene.sys.events.off(p.START,this.start,this),this.scene=null,this.systems=null}});d.register("ArcadePhysics",g,"arcadePhysics"),t.exports=g},25084:(t,e,i)=>{var s=i(56694),n=i(7864),r=i(13747),o=new s({Extends:r,Mixins:[n.Acceleration,n.Angular,n.Bounce,n.Debug,n.Drag,n.Enable,n.Friction,n.Gravity,n.Immovable,n.Mass,n.Pushable,n.Size,n.Velocity],initialize:function(t,e,i,s,n){r.call(this,t,e,i,s,n),this.body=null}});t.exports=o},97602:(t,e,i)=>{var s=i(56694),n=i(47401),r=i(27037),o=i(23701),a=i(74118),h=i(94287),l=i(93736),u=new s({initialize:function(t,e){var i=e.displayWidth?e.displayWidth:64,s=e.displayHeight?e.displayHeight:64;this.world=t,this.gameObject=e,this.transform={x:e.x,y:e.y,rotation:e.angle,scaleX:e.scaleX,scaleY:e.scaleY,displayOriginX:e.displayOriginX,displayOriginY:e.displayOriginY},this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new l,this.position=new l(e.x-e.scaleX*e.displayOriginX,e.y-e.scaleY*e.displayOriginY),this.prev=this.position.clone(),this.prevFrame=this.position.clone(),this.allowRotation=!0,this.rotation=e.angle,this.preRotation=e.angle,this.width=i,this.height=s,this.sourceWidth=i,this.sourceHeight=s,e.frame&&(this.sourceWidth=e.frame.realWidth,this.sourceHeight=e.frame.realHeight),this.halfWidth=Math.abs(i/2),this.halfHeight=Math.abs(s/2),this.center=new l(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=new l,this.newVelocity=new l,this.deltaMax=new l,this.acceleration=new l,this.allowDrag=!0,this.drag=new l,this.allowGravity=!0,this.gravity=new l,this.bounce=new l,this.worldBounce=null,this.customBoundsRectangle=t.bounds,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new l(1e4,1e4),this.maxSpeed=-1,this.friction=new l(1,0),this.useDamping=!1,this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=n.FACING_NONE,this.immovable=!1,this.pushable=!0,this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.syncBounds=!1,this.physicsType=n.DYNAMIC_BODY,this._sx=e.scaleX,this._sy=e.scaleY,this._dx=0,this._dy=0,this._tx=0,this._ty=0,this._bounds=new a},updateBounds:function(){var t=this.gameObject,e=this.transform;if(t.parentContainer){var i=t.getWorldTransformMatrix(this.world._tempMatrix,this.world._tempMatrix2);e.x=i.tx,e.y=i.ty,e.rotation=o(i.rotation),e.scaleX=i.scaleX,e.scaleY=i.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY}else e.x=t.x,e.y=t.y,e.rotation=t.angle,e.scaleX=t.scaleX,e.scaleY=t.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY;var s=!1;if(this.syncBounds){var n=t.getBounds(this._bounds);this.width=n.width,this.height=n.height,s=!0}else{var r=Math.abs(e.scaleX),a=Math.abs(e.scaleY);this._sx===r&&this._sy===a||(this.width=this.sourceWidth*r,this.height=this.sourceHeight*a,this._sx=r,this._sy=a,s=!0)}s&&(this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter())},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},updateFromGameObject:function(){this.updateBounds();var t=this.transform;this.position.x=t.x+t.scaleX*(this.offset.x-t.displayOriginX),this.position.y=t.y+t.scaleY*(this.offset.y-t.displayOriginY),this.updateCenter()},resetFlags:function(t){void 0===t&&(t=!1);var e=this.wasTouching,i=this.touching,s=this.blocked;t?(e.none=!0,e.up=!1,e.down=!1,e.left=!1,e.right=!1):(e.none=i.none,e.up=i.up,e.down=i.down,e.left=i.left,e.right=i.right),i.none=!0,i.up=!1,i.down=!1,i.left=!1,i.right=!1,s.none=!0,s.up=!1,s.down=!1,s.left=!1,s.right=!1,this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1},preUpdate:function(t,e){t&&this.resetFlags(),this.updateFromGameObject(),this.rotation=this.transform.rotation,this.preRotation=this.rotation,this.moves&&(this.prev.x=this.position.x,this.prev.y=this.position.y,this.prevFrame.x=this.position.x,this.prevFrame.y=this.position.y),t&&this.update(e)},update:function(t){if(this.prev.x=this.position.x,this.prev.y=this.position.y,this.moves){this.world.updateMotion(this,t);var e=this.velocity.x,i=this.velocity.y;this.newVelocity.set(e*t,i*t),this.position.add(this.newVelocity),this.updateCenter(),this.angle=Math.atan2(i,e),this.speed=Math.sqrt(e*e+i*i),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds&&this.world.emit(r.WORLD_BOUNDS,this,this.blocked.up,this.blocked.down,this.blocked.left,this.blocked.right)}this._dx=this.position.x-this.prev.x,this._dy=this.position.y-this.prev.y},postUpdate:function(){var t=this.position.x-this.prevFrame.x,e=this.position.y-this.prevFrame.y;if(this.moves){var i=this.deltaMax.x,s=this.deltaMax.y;0!==i&&0!==t&&(t<0&&t<-i?t=-i:t>0&&t>i&&(t=i)),0!==s&&0!==e&&(e<0&&e<-s?e=-s:e>0&&e>s&&(e=s)),this.gameObject.x+=t,this.gameObject.y+=e}t<0?this.facing=n.FACING_LEFT:t>0&&(this.facing=n.FACING_RIGHT),e<0?this.facing=n.FACING_UP:e>0&&(this.facing=n.FACING_DOWN),this.allowRotation&&(this.gameObject.angle+=this.deltaZ()),this._tx=t,this._ty=e},setBoundsRectangle:function(t){return this.customBoundsRectangle=t||this.world.bounds,this},checkWorldBounds:function(){var t=this.position,e=this.customBoundsRectangle,i=this.world.checkCollision,s=this.worldBounce?-this.worldBounce.x:-this.bounce.x,n=this.worldBounce?-this.worldBounce.y:-this.bounce.y,r=!1;return t.xe.right&&i.right&&(t.x=e.right-this.width,this.velocity.x*=s,this.blocked.right=!0,r=!0),t.ye.bottom&&i.down&&(t.y=e.bottom-this.height,this.velocity.y*=n,this.blocked.down=!0,r=!0),r&&(this.blocked.none=!1,this.updateCenter()),r},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this},setSize:function(t,e,i){void 0===i&&(i=!0);var s=this.gameObject;if(!t&&s.frame&&(t=s.frame.realWidth),!e&&s.frame&&(e=s.frame.realHeight),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&s.getCenter){var n=(s.width-t)/2,r=(s.height-e)/2;this.offset.set(n,r)}return this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.isCircle=!0,this.radius=t,this.sourceWidth=2*t,this.sourceHeight=2*t,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter()):this.isCircle=!1,this},reset:function(t,e){this.stop();var i=this.gameObject;i.setPosition(t,e),i.getTopLeft?i.getTopLeft(this.position):this.position.set(t,e),this.prev.copy(this.position),this.prevFrame.copy(this.position),this.rotation=i.angle,this.preRotation=i.angle,this.updateBounds(),this.updateCenter(),this.resetFlags(!0)},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?this.radius>0&&t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom&&(this.center.x-t)*(this.center.x-t)+(this.center.y-e)*(this.center.y-e)<=this.radius*this.radius:h(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this._dx>0?this._dx:-this._dx},deltaAbsY:function(){return this._dy>0?this._dy:-this._dy},deltaX:function(){return this._dx},deltaY:function(){return this._dy},deltaXFinal:function(){return this._tx},deltaYFinal:function(){return this._ty},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.enable=!1,this.world&&this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,s=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor),this.isCircle?t.strokeCircle(i,s,this.width/2):(this.checkCollision.up&&t.lineBetween(e.x,e.y,e.x+this.width,e.y),this.checkCollision.right&&t.lineBetween(e.x+this.width,e.y,e.x+this.width,e.y+this.height),this.checkCollision.down&&t.lineBetween(e.x,e.y+this.height,e.x+this.width,e.y+this.height),this.checkCollision.left&&t.lineBetween(e.x,e.y,e.x,e.y+this.height))),this.debugShowVelocity&&(t.lineStyle(t.defaultStrokeWidth,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,s,i+this.velocity.x/2,s+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setCollideWorldBounds:function(t,e,i,s){void 0===t&&(t=!0),this.collideWorldBounds=t;var n=void 0!==e,r=void 0!==i;return(n||r)&&(this.worldBounce||(this.worldBounce=new l),n&&(this.worldBounce.x=e),r&&(this.worldBounce.y=i)),void 0!==s&&(this.onWorldBounds=s),this},setVelocity:function(t,e){return this.velocity.set(t,e),t=this.velocity.x,e=this.velocity.y,this.speed=Math.sqrt(t*t+e*e),this},setVelocityX:function(t){this.velocity.x=t;var e=t,i=this.velocity.y;return this.speed=Math.sqrt(e*e+i*i),this},setVelocityY:function(t){this.velocity.y=t;var e=this.velocity.x,i=t;return this.speed=Math.sqrt(e*e+i*i),this},setMaxVelocity:function(t,e){return this.maxVelocity.set(t,e),this},setMaxVelocityX:function(t){return this.maxVelocity.x=t,this},setMaxVelocityY:function(t){return this.maxVelocity.y=t,this},setMaxSpeed:function(t){return this.maxSpeed=t,this},setBounce:function(t,e){return this.bounce.set(t,e),this},setBounceX:function(t){return this.bounce.x=t,this},setBounceY:function(t){return this.bounce.y=t,this},setAcceleration:function(t,e){return this.acceleration.set(t,e),this},setAccelerationX:function(t){return this.acceleration.x=t,this},setAccelerationY:function(t){return this.acceleration.y=t,this},setAllowDrag:function(t){return void 0===t&&(t=!0),this.allowDrag=t,this},setAllowGravity:function(t){return void 0===t&&(t=!0),this.allowGravity=t,this},setAllowRotation:function(t){return void 0===t&&(t=!0),this.allowRotation=t,this},setDrag:function(t,e){return this.drag.set(t,e),this},setDamping:function(t){return this.useDamping=t,this},setDragX:function(t){return this.drag.x=t,this},setDragY:function(t){return this.drag.y=t,this},setGravity:function(t,e){return this.gravity.set(t,e),this},setGravityX:function(t){return this.gravity.x=t,this},setGravityY:function(t){return this.gravity.y=t,this},setFriction:function(t,e){return this.friction.set(t,e),this},setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setAngularVelocity:function(t){return this.angularVelocity=t,this},setAngularAcceleration:function(t){return this.angularAcceleration=t,this},setAngularDrag:function(t){return this.angularDrag=t,this},setMass:function(t){return this.mass=t,this},setImmovable:function(t){return void 0===t&&(t=!0),this.immovable=t,this},setEnable:function(t){return void 0===t&&(t=!0),this.enable=t,this},processX:function(t,e,i,s){this.x+=t,this.updateCenter(),null!==e&&(this.velocity.x=e);var n=this.blocked;i&&(n.left=!0),s&&(n.right=!0)},processY:function(t,e,i,s){this.y+=t,this.updateCenter(),null!==e&&(this.velocity.y=e);var n=this.blocked;i&&(n.up=!0),s&&(n.down=!0)},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=u},3909:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s,n,r,o){this.world=t,this.name="",this.active=!0,this.overlapOnly=e,this.object1=i,this.object2=s,this.collideCallback=n,this.processCallback=r,this.callbackContext=o},setName:function(t){return this.name=t,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});t.exports=s},99523:(t,e,i)=>{var s=i(62832),n=i(25084),r=i(56694),o=i(47401),a=i(10481),h=i(46346),l=new r({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},collider:function(t,e,i,s,n){return this.world.addCollider(t,e,i,s,n)},overlap:function(t,e,i,s,n){return this.world.addOverlap(t,e,i,s,n)},existing:function(t,e){var i=e?o.STATIC_BODY:o.DYNAMIC_BODY;return this.world.enableBody(t,i),t},staticImage:function(t,e,i,n){var r=new s(this.scene,t,e,i,n);return this.sys.displayList.add(r),this.world.enableBody(r,o.STATIC_BODY),r},image:function(t,e,i,n){var r=new s(this.scene,t,e,i,n);return this.sys.displayList.add(r),this.world.enableBody(r,o.DYNAMIC_BODY),r},staticSprite:function(t,e,i,s){var r=new n(this.scene,t,e,i,s);return this.sys.displayList.add(r),this.sys.updateList.add(r),this.world.enableBody(r,o.STATIC_BODY),r},sprite:function(t,e,i,s){var r=new n(this.scene,t,e,i,s);return this.sys.displayList.add(r),this.sys.updateList.add(r),this.world.enableBody(r,o.DYNAMIC_BODY),r},staticGroup:function(t,e){return this.sys.updateList.add(new h(this.world,this.world.scene,t,e))},group:function(t,e){return this.sys.updateList.add(new a(this.world,this.world.scene,t,e))},destroy:function(){this.world=null,this.scene=null,this.sys=null}});t.exports=l},75671:(t,e,i)=>{var s=i(47401);t.exports=function(t,e,i,n){var r=0,o=t.deltaAbsX()+e.deltaAbsX()+n;return 0===t._dx&&0===e._dx?(t.embedded=!0,e.embedded=!0):t._dx>e._dx?(r=t.right-e.x)>o&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?r=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.right=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.left=!0)):t._dxo&&!i||!1===t.checkCollision.left||!1===e.checkCollision.right?r=0:(t.touching.none=!1,t.touching.left=!0,e.touching.none=!1,e.touching.right=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.left=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.right=!0))),t.overlapX=r,e.overlapX=r,r}},66185:(t,e,i)=>{var s=i(47401);t.exports=function(t,e,i,n){var r=0,o=t.deltaAbsY()+e.deltaAbsY()+n;return 0===t._dy&&0===e._dy?(t.embedded=!0,e.embedded=!0):t._dy>e._dy?(r=t.bottom-e.y)>o&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?r=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.down=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.up=!0)):t._dyo&&!i||!1===t.checkCollision.up||!1===e.checkCollision.down?r=0:(t.touching.none=!1,t.touching.up=!0,e.touching.none=!1,e.touching.down=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.up=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.down=!0))),t.overlapY=r,e.overlapY=r,r}},10481:(t,e,i)=>{var s=i(25084),n=i(56694),r=i(47401),o=i(72632),a=i(59192),h=i(42911),l=new n({Extends:a,initialize:function(t,e,i,n){if(i||n)if(h(i))n=i,i=null,n.internalCreateCallback=this.createCallbackHandler,n.internalRemoveCallback=this.removeCallbackHandler;else if(Array.isArray(i)&&h(i[0])){n=i[0];var l=this;i.forEach((function(t){t.internalCreateCallback=l.createCallbackHandler,t.internalRemoveCallback=l.removeCallbackHandler})),i=null}else n={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};else n={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};this.world=t,n.classType=o(n,"classType",s),this.physicsType=r.DYNAMIC_BODY,this.defaults={setCollideWorldBounds:o(n,"collideWorldBounds",!1),setBoundsRectangle:o(n,"customBoundsRectangle",null),setAccelerationX:o(n,"accelerationX",0),setAccelerationY:o(n,"accelerationY",0),setAllowDrag:o(n,"allowDrag",!0),setAllowGravity:o(n,"allowGravity",!0),setAllowRotation:o(n,"allowRotation",!0),setBounceX:o(n,"bounceX",0),setBounceY:o(n,"bounceY",0),setDragX:o(n,"dragX",0),setDragY:o(n,"dragY",0),setEnable:o(n,"enable",!0),setGravityX:o(n,"gravityX",0),setGravityY:o(n,"gravityY",0),setFrictionX:o(n,"frictionX",0),setFrictionY:o(n,"frictionY",0),setMaxVelocityX:o(n,"maxVelocityX",1e4),setMaxVelocityY:o(n,"maxVelocityY",1e4),setVelocityX:o(n,"velocityX",0),setVelocityY:o(n,"velocityY",0),setAngularVelocity:o(n,"angularVelocity",0),setAngularAcceleration:o(n,"angularAcceleration",0),setAngularDrag:o(n,"angularDrag",0),setMass:o(n,"mass",1),setImmovable:o(n,"immovable",!1)},a.call(this,e,i,n),this.type="PhysicsGroup"},createCallbackHandler:function(t){t.body||this.world.enableBody(t,r.DYNAMIC_BODY);var e=t.body;for(var i in this.defaults)e[i](this.defaults[i])},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},setVelocity:function(t,e,i){void 0===i&&(i=0);for(var s=this.getChildren(),n=0;n{var e,i,s,n,r,o,a,h,l,u,c,d,p,f,v,g,m,y=function(){return u&&v&&i.blocked.right?(e.processX(-m,a,!1,!0),1):l&&g&&i.blocked.left?(e.processX(m,a,!0),1):p&&g&&e.blocked.right?(i.processX(-m,h,!1,!0),2):d&&v&&e.blocked.left?(i.processX(m,h,!0),2):0},x=function(t){if(s&&n)m*=.5,0===t||3===t?(e.processX(m,r),i.processX(-m,o)):(e.processX(-m,r),i.processX(m,o));else if(s&&!n)0===t||3===t?e.processX(m,a,!0):e.processX(-m,a,!1,!0);else if(!s&&n)0===t||3===t?i.processX(-m,h,!1,!0):i.processX(m,h,!0);else{var v=.5*m;0===t?f?(e.processX(m,0,!0),i.processX(0,null,!1,!0)):p?(e.processX(v,0,!0),i.processX(-v,0,!1,!0)):(e.processX(v,i.velocity.x,!0),i.processX(-v,null,!1,!0)):1===t?c?(e.processX(0,null,!1,!0),i.processX(m,0,!0)):u?(e.processX(-v,0,!1,!0),i.processX(v,0,!0)):(e.processX(-v,null,!1,!0),i.processX(v,e.velocity.x,!0)):2===t?f?(e.processX(-m,0,!1,!0),i.processX(0,null,!0)):d?(e.processX(-v,0,!1,!0),i.processX(v,0,!0)):(e.processX(-v,i.velocity.x,!1,!0),i.processX(v,null,!0)):3===t&&(c?(e.processX(0,null,!0),i.processX(-m,0,!1,!0)):l?(e.processX(v,0,!0),i.processX(-v,0,!1,!0)):(e.processX(v,i.velocity.y,!0),i.processX(-v,null,!1,!0)))}return!0};t.exports={BlockCheck:y,Check:function(){var t=e.velocity.x,s=i.velocity.x,n=Math.sqrt(s*s*i.mass/e.mass)*(s>0?1:-1),a=Math.sqrt(t*t*e.mass/i.mass)*(t>0?1:-1),h=.5*(n+a);return a-=h,r=h+(n-=h)*e.bounce.x,o=h+a*i.bounce.x,l&&g?x(0):d&&v?x(1):u&&v?x(2):!(!p||!g)&&x(3)},Set:function(t,r,o){i=r;var x=(e=t).velocity.x,T=i.velocity.x;return s=e.pushable,l=e._dx<0,u=e._dx>0,c=0===e._dx,v=Math.abs(e.right-i.x)<=Math.abs(i.right-e.x),a=T-x*e.bounce.x,n=i.pushable,d=i._dx<0,p=i._dx>0,f=0===i._dx,g=!v,h=x-T*i.bounce.x,m=Math.abs(o),y()},Run:x,RunImmovableBody1:function(t){1===t?i.velocity.x=0:v?i.processX(m,h,!0):i.processX(-m,h,!1,!0),e.moves&&(i.y+=(e.y-e.prev.y)*e.friction.y,i._dy=i.y-i.prev.y)},RunImmovableBody2:function(t){2===t?e.velocity.x=0:g?e.processX(m,a,!0):e.processX(-m,a,!1,!0),i.moves&&(e.y+=(i.y-i.prev.y)*i.friction.y,e._dy=e.y-e.prev.y)}}},67050:t=>{var e,i,s,n,r,o,a,h,l,u,c,d,p,f,v,g,m,y=function(){return u&&v&&i.blocked.down?(e.processY(-m,a,!1,!0),1):l&&g&&i.blocked.up?(e.processY(m,a,!0),1):p&&g&&e.blocked.down?(i.processY(-m,h,!1,!0),2):d&&v&&e.blocked.up?(i.processY(m,h,!0),2):0},x=function(t){if(s&&n)m*=.5,0===t||3===t?(e.processY(m,r),i.processY(-m,o)):(e.processY(-m,r),i.processY(m,o));else if(s&&!n)0===t||3===t?e.processY(m,a,!0):e.processY(-m,a,!1,!0);else if(!s&&n)0===t||3===t?i.processY(-m,h,!1,!0):i.processY(m,h,!0);else{var v=.5*m;0===t?f?(e.processY(m,0,!0),i.processY(0,null,!1,!0)):p?(e.processY(v,0,!0),i.processY(-v,0,!1,!0)):(e.processY(v,i.velocity.y,!0),i.processY(-v,null,!1,!0)):1===t?c?(e.processY(0,null,!1,!0),i.processY(m,0,!0)):u?(e.processY(-v,0,!1,!0),i.processY(v,0,!0)):(e.processY(-v,null,!1,!0),i.processY(v,e.velocity.y,!0)):2===t?f?(e.processY(-m,0,!1,!0),i.processY(0,null,!0)):d?(e.processY(-v,0,!1,!0),i.processY(v,0,!0)):(e.processY(-v,i.velocity.y,!1,!0),i.processY(v,null,!0)):3===t&&(c?(e.processY(0,null,!0),i.processY(-m,0,!1,!0)):l?(e.processY(v,0,!0),i.processY(-v,0,!1,!0)):(e.processY(v,i.velocity.y,!0),i.processY(-v,null,!1,!0)))}return!0};t.exports={BlockCheck:y,Check:function(){var t=e.velocity.y,s=i.velocity.y,n=Math.sqrt(s*s*i.mass/e.mass)*(s>0?1:-1),a=Math.sqrt(t*t*e.mass/i.mass)*(t>0?1:-1),h=.5*(n+a);return a-=h,r=h+(n-=h)*e.bounce.y,o=h+a*i.bounce.y,l&&g?x(0):d&&v?x(1):u&&v?x(2):!(!p||!g)&&x(3)},Set:function(t,r,o){i=r;var x=(e=t).velocity.y,T=i.velocity.y;return s=e.pushable,l=e._dy<0,u=e._dy>0,c=0===e._dy,v=Math.abs(e.bottom-i.y)<=Math.abs(i.bottom-e.y),a=T-x*e.bounce.y,n=i.pushable,d=i._dy<0,p=i._dy>0,f=0===i._dy,g=!v,h=x-T*i.bounce.y,m=Math.abs(o),y()},Run:x,RunImmovableBody1:function(t){1===t?i.velocity.y=0:v?i.processY(m,h,!0):i.processY(-m,h,!1,!0),e.moves&&(i.x+=(e.x-e.prev.x)*e.friction.x,i._dx=i.x-i.prev.x)},RunImmovableBody2:function(t){2===t?e.velocity.y=0:g?e.processY(m,a,!0):e.processY(-m,a,!1,!0),i.moves&&(e.x+=(i.x-i.prev.x)*i.friction.x,e._dx=e.x-e.prev.x)}}},61777:(t,e,i)=>{var s=i(75671),n=i(22916);t.exports=function(t,e,i,r){var o=s(t,e,i,r),a=t.immovable,h=e.immovable;if(i||0===o||a&&h||t.customSeparateX||e.customSeparateX)return 0!==o||t.embedded&&e.embedded;var l=n.Set(t,e,o);return a||h?(a?n.RunImmovableBody1(l):h&&n.RunImmovableBody2(l),!0):l>0||n.Check()}},25299:(t,e,i)=>{var s=i(66185),n=i(67050);t.exports=function(t,e,i,r){var o=s(t,e,i,r),a=t.immovable,h=e.immovable;if(i||0===o||a&&h||t.customSeparateY||e.customSeparateY)return 0!==o||t.embedded&&e.embedded;var l=n.Set(t,e,o);return a||h?(a?n.RunImmovableBody1(l):h&&n.RunImmovableBody2(l),!0):l>0||n.Check()}},66634:(t,e,i)=>{var s=i(65650),n=i(56694),r=i(47401),o=i(94287),a=i(93736),h=new n({initialize:function(t,e){var i=e.displayWidth?e.displayWidth:64,s=e.displayHeight?e.displayHeight:64;this.world=t,this.gameObject=e,this.debugShowBody=t.defaults.debugShowStaticBody,this.debugBodyColor=t.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new a,this.position=new a(e.x-i*e.originX,e.y-s*e.originY),this.width=i,this.height=s,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new a(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=a.ZERO,this.allowGravity=!1,this.gravity=a.ZERO,this.bounce=a.ZERO,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.mass=1,this.immovable=!0,this.pushable=!1,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.physicsType=r.STATIC_BODY,this._dx=0,this._dy=0},setGameObject:function(t,e){return t&&t!==this.gameObject&&(this.gameObject.body=null,t.body=this,this.gameObject=t),e&&this.updateFromGameObject(),this},updateFromGameObject:function(){this.world.staticTree.remove(this);var t=this.gameObject;return t.getTopLeft(this.position),this.width=t.displayWidth,this.height=t.displayHeight,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.world.staticTree.insert(this),this},setOffset:function(t,e){return void 0===e&&(e=t),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(t,e),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(t,e,i){void 0===i&&(i=!0);var s=this.gameObject;if(!t&&s.frame&&(t=s.frame.realWidth),!e&&s.frame&&(e=s.frame.realHeight),this.world.staticTree.remove(this),this.width=t,this.height=e,this.halfWidth=Math.floor(t/2),this.halfHeight=Math.floor(e/2),i&&s.getCenter){var n=s.displayWidth/2,r=s.displayHeight/2;this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(n-this.halfWidth,r-this.halfHeight),this.position.x+=this.offset.x,this.position.y+=this.offset.y}return this.updateCenter(),this.isCircle=!1,this.radius=0,this.world.staticTree.insert(this),this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=t,this.width=2*t,this.height=2*t,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(t,e){var i=this.gameObject;void 0===t&&(t=i.x),void 0===e&&(e=i.y),this.world.staticTree.remove(this),i.setPosition(t,e),i.getTopLeft(this.position),this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?s(this,t,e):o(this,t,e)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,s=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor,1),this.isCircle?t.strokeCircle(i,s,this.width/2):t.strokeRect(e.x,e.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(t){return t<=0&&(t=.1),this.mass=t,this},x:{get:function(){return this.position.x},set:function(t){this.world.staticTree.remove(this),this.position.x=t,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(t){this.world.staticTree.remove(this),this.position.y=t,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=h},46346:(t,e,i)=>{var s=i(25084),n=i(56694),r=i(47401),o=i(72632),a=i(59192),h=i(42911),l=new n({Extends:a,initialize:function(t,e,i,n){i||n?h(i)?(n=i,i=null,n.internalCreateCallback=this.createCallbackHandler,n.internalRemoveCallback=this.removeCallbackHandler,n.createMultipleCallback=this.createMultipleCallbackHandler,n.classType=o(n,"classType",s)):Array.isArray(i)&&h(i[0])?(n=i,i=null,n.forEach((function(t){t.internalCreateCallback=this.createCallbackHandler,t.internalRemoveCallback=this.removeCallbackHandler,t.createMultipleCallback=this.createMultipleCallbackHandler,t.classType=o(t,"classType",s)}))):n={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler}:n={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler,createMultipleCallback:this.createMultipleCallbackHandler,classType:s},this.world=t,this.physicsType=r.STATIC_BODY,a.call(this,e,i,n),this.type="StaticPhysicsGroup"},createCallbackHandler:function(t){t.body||this.world.enableBody(t,r.STATIC_BODY)},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},createMultipleCallbackHandler:function(){this.refresh()},refresh:function(){for(var t=this.children.entries,e=0;e{var s=i(94240),n=i(97602),r=i(82897),o=i(56694),a=i(3909),h=i(47401),l=i(53996),u=i(6659),c=i(27037),d=i(88456),p=i(41935),f=i(54726),v=i(75671),g=i(66185),m=i(44662),y=i(10850),x=i(83392),T=i(74623),w=i(25163),b=i(74118),E=i(68687),S=i(27354),A=i(61777),_=i(25299),C=i(58403),M=i(66634),R=i(28808),P=i(69360),O=i(93736),L=i(1071),F=new o({Extends:u,initialize:function(t,e){u.call(this),this.scene=t,this.bodies=new C,this.staticBodies=new C,this.pendingDestroy=new C,this.colliders=new T,this.gravity=new O(y(e,"gravity.x",0),y(e,"gravity.y",0)),this.bounds=new b(y(e,"x",0),y(e,"y",0),y(e,"width",t.sys.scale.width),y(e,"height",t.sys.scale.height)),this.checkCollision={up:y(e,"checkCollision.up",!0),down:y(e,"checkCollision.down",!0),left:y(e,"checkCollision.left",!0),right:y(e,"checkCollision.right",!0)},this.fps=y(e,"fps",60),this.fixedStep=y(e,"fixedStep",!0),this._elapsed=0,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this.stepsLastFrame=0,this.timeScale=y(e,"timeScale",1),this.OVERLAP_BIAS=y(e,"overlapBias",4),this.TILE_BIAS=y(e,"tileBias",16),this.forceX=y(e,"forceX",!1),this.isPaused=y(e,"isPaused",!1),this._total=0,this.drawDebug=y(e,"debug",!1),this.debugGraphic,this.defaults={debugShowBody:y(e,"debugShowBody",!0),debugShowStaticBody:y(e,"debugShowStaticBody",!0),debugShowVelocity:y(e,"debugShowVelocity",!0),bodyDebugColor:y(e,"debugBodyColor",16711935),staticBodyDebugColor:y(e,"debugStaticBodyColor",255),velocityDebugColor:y(e,"debugVelocityColor",65280)},this.maxEntries=y(e,"maxEntries",16),this.useTree=y(e,"useTree",!0),this.tree=new E(this.maxEntries),this.staticTree=new E(this.maxEntries),this.treeMinMax={minX:0,minY:0,maxX:0,maxY:0},this._tempMatrix=new P,this._tempMatrix2=new P,this.drawDebug&&this.createDebugGraphic()},enable:function(t,e){void 0===e&&(e=h.DYNAMIC_BODY),Array.isArray(t)||(t=[t]);for(var i=0;i=r;for(this.fixedStep||(n=.001*e,a=!0,this._elapsed=0),i=0;i=r;)this._elapsed-=r,this.step(n)}},step:function(t){var e,i,s=this.bodies.entries,n=s.length;for(e=0;e0){var l=this.tree,u=this.staticTree;for(s=(i=a.entries).length,t=0;t-1&&c>v&&(t.velocity.normalize().scale(v),c=v),t.speed=c},separate:function(t,e,i,s,n,r){if(!r&&!t.enable||!e.enable||t.checkCollision.none||e.checkCollision.none||!this.intersects(t,e))return!1;if(i&&!1===i.call(s,t.gameObject,e.gameObject))return!1;if(t.isCircle&&e.isCircle)return this.separateCircle(t,e,n);if(t.isCircle!==e.isCircle){var o=t.isCircle?e:t,a=t.isCircle?t:e,h={x:o.x,y:o.y,right:o.right,bottom:o.bottom},l=a.center;if((l.yh.bottom)&&(l.xh.right))return this.separateCircle(t,e,n)}var u=!1,d=!1;n?(u=A(t,e,n,this.OVERLAP_BIAS),d=_(t,e,n,this.OVERLAP_BIAS)):this.forceX||Math.abs(this.gravity.y+t.gravity.y)o.right&&(r=l(a.x,a.y,o.right,o.y)-a.radius):a.y>o.bottom&&(a.xo.right&&(r=l(a.x,a.y,o.right,o.bottom)-a.radius)),r*=-1}else r=t.halfWidth+e.halfWidth-l(t.center.x,t.center.y,e.center.x,e.center.y);if(t.overlapR=r,e.overlapR=r,i||0===r||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==r&&(t.onOverlap||e.onOverlap)&&this.emit(c.OVERLAP,t.gameObject,e.gameObject,t,e),0!==r;var h=t.center.x-e.center.x,u=t.center.y-e.center.y,d=Math.sqrt(Math.pow(h,2)+Math.pow(u,2)),p=(e.center.x-t.center.x)/d||0,f=(e.center.y-t.center.y)/d||0,m=2*(t.velocity.x*p+t.velocity.y*f-e.velocity.x*p-e.velocity.y*f)/(t.mass+e.mass);(t.immovable||e.immovable)&&(m*=2),t.immovable||(t.velocity.x=t.velocity.x-m/t.mass*p,t.velocity.y=t.velocity.y-m/t.mass*f),e.immovable||(e.velocity.x=e.velocity.x+m/e.mass*p,e.velocity.y=e.velocity.y+m/e.mass*f),t.immovable||e.immovable||(r/=2);var y=s(t.center,e.center),T=(r+x.EPSILON)*Math.cos(y),w=(r+x.EPSILON)*Math.sin(y);return t.immovable||(t.x-=T,t.y-=w,t.updateCenter()),e.immovable||(e.x+=T,e.y+=w,e.updateCenter()),t.velocity.x*=t.bounce.x,t.velocity.y*=t.bounce.y,e.velocity.x*=e.bounce.x,e.velocity.y*=e.bounce.y,(t.onCollide||e.onCollide)&&this.emit(c.COLLIDE,t.gameObject,e.gameObject,t,e),!0},intersects:function(t,e){return t!==e&&(t.isCircle||e.isCircle?t.isCircle?e.isCircle?l(t.center.x,t.center.y,e.center.x,e.center.y)<=t.halfWidth+e.halfWidth:this.circleBodyIntersects(t,e):this.circleBodyIntersects(e,t):!(t.right<=e.position.x||t.bottom<=e.position.y||t.position.x>=e.right||t.position.y>=e.bottom))},circleBodyIntersects:function(t,e){var i=r(t.center.x,e.left,e.right),s=r(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-s)*(t.center.y-s)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,s,n){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=i),this.collideObjects(t,e,i,s,n,!0)},collide:function(t,e,i,s,n){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=i),this.collideObjects(t,e,i,s,n,!1)},collideObjects:function(t,e,i,s,n,r){var o,a;!t.isParent||void 0!==t.physicsType&&void 0!==e&&t!==e||(t=t.children.entries),e&&e.isParent&&void 0===e.physicsType&&(e=e.children.entries);var h=Array.isArray(t),l=Array.isArray(e);if(this._total=0,h||l)if(!h&&l)for(o=0;o0},collideHandler:function(t,e,i,s,n,r){if(void 0===e&&t.isParent)return this.collideGroupVsGroup(t,t,i,s,n,r);if(!t||!e)return!1;if(t.body){if(e.body)return this.collideSpriteVsSprite(t,e,i,s,n,r);if(e.isParent)return this.collideSpriteVsGroup(t,e,i,s,n,r);if(e.isTilemap)return this.collideSpriteVsTilemapLayer(t,e,i,s,n,r)}else if(t.isParent){if(e.body)return this.collideSpriteVsGroup(e,t,i,s,n,r);if(e.isParent)return this.collideGroupVsGroup(t,e,i,s,n,r);if(e.isTilemap)return this.collideGroupVsTilemapLayer(t,e,i,s,n,r)}else if(t.isTilemap){if(e.body)return this.collideSpriteVsTilemapLayer(e,t,i,s,n,r);if(e.isParent)return this.collideGroupVsTilemapLayer(e,t,i,s,n,r)}},collideSpriteVsSprite:function(t,e,i,s,n,r){return!(!t.body||!e.body)&&(this.separate(t.body,e.body,s,n,r)&&(i&&i.call(n,t,e),this._total++),!0)},collideSpriteVsGroup:function(t,e,i,s,n,r){var o,a,l,u=t.body;if(0!==e.length&&u&&u.enable&&!u.checkCollision.none)if(this.useTree||e.physicsType===h.STATIC_BODY){var c=this.treeMinMax;c.minX=u.left,c.minY=u.top,c.maxX=u.right,c.maxY=u.bottom;var d=e.physicsType===h.DYNAMIC_BODY?this.tree.search(c):this.staticTree.search(c);for(a=d.length,o=0;oc.baseTileWidth){var d=(c.tileWidth-c.baseTileWidth)*e.scaleX;a-=d,l+=d}c.tileHeight>c.baseTileHeight&&(u+=(c.tileHeight-c.baseTileHeight)*e.scaleY);var p=m(a,h,l,u,null,e.scene.cameras.main,e.layer);return 0!==p.length&&this.collideSpriteVsTilesHandler(t,p,i,s,n,r,!0)},collideSpriteVsTilesHandler:function(t,e,i,s,n,r,o){for(var a,h,l=t.body,u={left:0,right:0,top:0,bottom:0},d=!1,p=0;p{t.exports={setAcceleration:function(t,e){return this.body.acceleration.set(t,e),this},setAccelerationX:function(t){return this.body.acceleration.x=t,this},setAccelerationY:function(t){return this.body.acceleration.y=t,this}}},29257:t=>{t.exports={setAngularVelocity:function(t){return this.body.angularVelocity=t,this},setAngularAcceleration:function(t){return this.body.angularAcceleration=t,this},setAngularDrag:function(t){return this.body.angularDrag=t,this}}},62122:t=>{t.exports={setBounce:function(t,e){return this.body.bounce.set(t,e),this},setBounceX:function(t){return this.body.bounce.x=t,this},setBounceY:function(t){return this.body.bounce.y=t,this},setCollideWorldBounds:function(t,e,i){return this.body.setCollideWorldBounds(t,e,i),this}}},99803:t=>{t.exports={setDebug:function(t,e,i){return this.debugShowBody=t,this.debugShowVelocity=e,this.debugBodyColor=i,this},setDebugBodyColor:function(t){return this.body.debugBodyColor=t,this},debugShowBody:{get:function(){return this.body.debugShowBody},set:function(t){this.body.debugShowBody=t}},debugShowVelocity:{get:function(){return this.body.debugShowVelocity},set:function(t){this.body.debugShowVelocity=t}},debugBodyColor:{get:function(){return this.body.debugBodyColor},set:function(t){this.body.debugBodyColor=t}}}},87145:t=>{t.exports={setDrag:function(t,e){return this.body.drag.set(t,e),this},setDragX:function(t){return this.body.drag.x=t,this},setDragY:function(t){return this.body.drag.y=t,this},setDamping:function(t){return this.body.useDamping=t,this}}},96174:t=>{var e={enableBody:function(t,e,i,s,n){return t&&this.body.reset(e,i),s&&(this.body.gameObject.active=!0),n&&(this.body.gameObject.visible=!0),this.body.enable=!0,this},disableBody:function(t,e){return void 0===t&&(t=!1),void 0===e&&(e=!1),this.body.stop(),this.body.enable=!1,t&&(this.body.gameObject.active=!1),e&&(this.body.gameObject.visible=!1),this},refreshBody:function(){return this.body.updateFromGameObject(),this}};t.exports=e},51702:t=>{t.exports={setFriction:function(t,e){return this.body.friction.set(t,e),this},setFrictionX:function(t){return this.body.friction.x=t,this},setFrictionY:function(t){return this.body.friction.y=t,this}}},25578:t=>{t.exports={setGravity:function(t,e){return this.body.gravity.set(t,e),this},setGravityX:function(t){return this.body.gravity.x=t,this},setGravityY:function(t){return this.body.gravity.y=t,this}}},72029:t=>{var e={setImmovable:function(t){return void 0===t&&(t=!0),this.body.immovable=t,this}};t.exports=e},34566:t=>{t.exports={setMass:function(t){return this.body.mass=t,this}}},2732:(t,e,i)=>{var s=i(15147),n=i(26673),r=i(22184),o=i(26535);t.exports=function(t,e,i,a,h,l){var u=s(t,e-a,i-a,2*a,2*a,h,l);if(0===u.length)return u;for(var c=new n(e,i,a),d=new n,p=[],f=0;f{t.exports=function(t,e,i,s,n,r,o){void 0===r&&(r=!0),void 0===o&&(o=!1);var a=[],h=[],l=t.treeMinMax;if(l.minX=e,l.minY=i,l.maxX=e+s,l.maxY=i+n,o&&(h=t.staticTree.search(l)),r&&t.useTree)a=t.tree.search(l);else if(r){var u=t.bodies,c={position:{x:e,y:i},left:e,top:i,right:e+s,bottom:i+n,isCircle:!1},d=t.intersects;u.iterate((function(t){d(t,c)&&a.push(t)}))}return h.concat(a)}},57527:t=>{var e={setPushable:function(t){return void 0===t&&(t=!0),this.body.pushable=t,this}};t.exports=e},77687:t=>{t.exports={setOffset:function(t,e){return this.body.setOffset(t,e),this},setSize:function(t,e,i){return this.body.setSize(t,e,i),this},setBodySize:function(t,e,i){return this.body.setSize(t,e,i),this},setCircle:function(t,e,i){return this.body.setCircle(t,e,i),this}}},66536:t=>{t.exports={setVelocity:function(t,e){return this.body.setVelocity(t,e),this},setVelocityX:function(t){return this.body.setVelocityX(t),this},setVelocityY:function(t){return this.body.setVelocityY(t),this},setMaxVelocity:function(t,e){return this.body.maxVelocity.set(t,e),this}}},7864:(t,e,i)=>{t.exports={Acceleration:i(5321),Angular:i(29257),Bounce:i(62122),Debug:i(99803),Drag:i(87145),Enable:i(96174),Friction:i(51702),Gravity:i(25578),Immovable:i(72029),Mass:i(34566),OverlapCirc:i(2732),OverlapRect:i(15147),Pushable:i(57527),Size:i(77687),Velocity:i(66536)}},47401:t=>{t.exports={DYNAMIC_BODY:0,STATIC_BODY:1,GROUP:2,TILEMAPLAYER:3,FACING_NONE:10,FACING_UP:11,FACING_DOWN:12,FACING_LEFT:13,FACING_RIGHT:14}},22346:t=>{t.exports="collide"},95092:t=>{t.exports="overlap"},15775:t=>{t.exports="pause"},74142:t=>{t.exports="resume"},22825:t=>{t.exports="tilecollide"},10851:t=>{t.exports="tileoverlap"},7543:t=>{t.exports="worldbounds"},1487:t=>{t.exports="worldstep"},27037:(t,e,i)=>{t.exports={COLLIDE:i(22346),OVERLAP:i(95092),PAUSE:i(15775),RESUME:i(74142),TILE_COLLIDE:i(22825),TILE_OVERLAP:i(10851),WORLD_BOUNDS:i(7543),WORLD_STEP:i(1487)}},39977:(t,e,i)=>{var s=i(47401),n=i(98611),r={ArcadePhysics:i(66150),Body:i(97602),Collider:i(3909),Components:i(7864),Events:i(27037),Factory:i(99523),GetOverlapX:i(75671),GetOverlapY:i(66185),SeparateX:i(61777),SeparateY:i(25299),Group:i(10481),Image:i(62832),Sprite:i(25084),StaticBody:i(66634),StaticGroup:i(46346),Tilemap:i(8413),World:i(85233)};r=n(!1,r,s),t.exports=r},25163:t=>{t.exports=function(t,e){return t.collisionCallback?!t.collisionCallback.call(t.collisionCallbackContext,e,t):!t.layer.callbacks[t.index]||!t.layer.callbacks[t.index].callback.call(t.layer.callbacks[t.index].callbackContext,e,t)}},98209:t=>{t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.left=!0):e>0&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=e,t.updateCenter(),0===t.bounce.x?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x}},72792:t=>{t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):e>0&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=e,t.updateCenter(),0===t.bounce.y?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y}},27354:(t,e,i)=>{var s=i(14405),n=i(52926),r=i(28808);t.exports=function(t,e,i,o,a,h,l){var u=o.left,c=o.top,d=o.right,p=o.bottom,f=i.faceLeft||i.faceRight,v=i.faceTop||i.faceBottom;if(l||(f=!0,v=!0),!f&&!v)return!1;var g=0,m=0,y=0,x=1;if(e.deltaAbsX()>e.deltaAbsY()?y=-1:e.deltaAbsX(){var s=i(98209);t.exports=function(t,e,i,n,r,o){var a=0,h=e.faceLeft,l=e.faceRight,u=e.collideLeft,c=e.collideRight;return o||(h=!0,l=!0,u=!0,c=!0),t.deltaX()<0&&c&&t.checkCollision.left?l&&t.x0&&u&&t.checkCollision.right&&h&&t.right>i&&(a=t.right-i)>r&&(a=0),0!==a&&(t.customSeparateX?t.overlapX=a:s(t,a)),a}},52926:(t,e,i)=>{var s=i(72792);t.exports=function(t,e,i,n,r,o){var a=0,h=e.faceTop,l=e.faceBottom,u=e.collideUp,c=e.collideDown;return o||(h=!0,l=!0,u=!0,c=!0),t.deltaY()<0&&c&&t.checkCollision.up?l&&t.y0&&u&&t.checkCollision.down&&h&&t.bottom>i&&(a=t.bottom-i)>r&&(a=0),0!==a&&(t.customSeparateY?t.overlapY=a:s(t,a)),a}},28808:t=>{t.exports=function(t,e){return!(e.right<=t.left||e.bottom<=t.top||e.position.x>=t.right||e.position.y>=t.bottom)}},8413:(t,e,i)=>{var s={ProcessTileCallbacks:i(25163),ProcessTileSeparationX:i(98209),ProcessTileSeparationY:i(72792),SeparateTile:i(27354),TileCheckX:i(14405),TileCheckY:i(52926),TileIntersectsBody:i(28808)};t.exports=s},53954:(t,e,i)=>{t.exports={Arcade:i(39977),Matter:i(45949)}},63568:(t,e,i)=>{var s=i(56694),n=i(93736),r=new s({initialize:function(){this.boundsCenter=new n,this.centerDiff=new n},parseBody:function(t){if(!(t=t.hasOwnProperty("body")?t.body:t).hasOwnProperty("bounds")||!t.hasOwnProperty("centerOfMass"))return!1;var e=this.boundsCenter,i=this.centerDiff,s=t.bounds.max.x-t.bounds.min.x,n=t.bounds.max.y-t.bounds.min.y,r=s*t.centerOfMass.x,o=n*t.centerOfMass.y;return e.set(s/2,n/2),i.set(r-e.x,o-e.y),!0},getTopLeft:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e+s.x+r.x,i+s.y+r.y)}return!1},getTopCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e+r.x,i+s.y+r.y)}return!1},getTopRight:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e-(s.x-r.x),i+s.y+r.y)}return!1},getLeftCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e+s.x+r.x,i+r.y)}return!1},getCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.centerDiff;return new n(e+s.x,i+s.y)}return!1},getRightCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e-(s.x-r.x),i+r.y)}return!1},getBottomLeft:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e+s.x+r.x,i-(s.y-r.y))}return!1},getBottomCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e+r.x,i-(s.y-r.y))}return!1},getBottomRight:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e-(s.x-r.x),i-(s.y-r.y))}return!1}});t.exports=r},18171:(t,e,i)=>{var s=i(16929);s.Body=i(84125),s.Composite=i(11299),s.World=i(72005),s.Detector=i(13657),s.Grid=i(15489),s.Pairs=i(91327),s.Pair=i(70584),s.Query=i(13390),s.Resolver=i(44272),s.SAT=i(5756),s.Constraint=i(52838),s.Common=i(68758),s.Engine=i(45775),s.Events=i(39073),s.Sleeping=i(22806),s.Plugin=i(84474),s.Bodies=i(68516),s.Composites=i(56643),s.Axes=i(50658),s.Bounds=i(84091),s.Svg=i(92765),s.Vector=i(10438),s.Vertices=i(39745),s.World.add=s.Composite.add,s.World.remove=s.Composite.remove,s.World.addComposite=s.Composite.addComposite,s.World.addBody=s.Composite.addBody,s.World.addConstraint=s.Composite.addConstraint,s.World.clear=s.Composite.clear,t.exports=s},72653:(t,e,i)=>{var s=i(68516),n=i(56694),r=i(56643),o=i(52838),a=i(92765),h=i(3860),l=i(7030),u=i(73658),c=i(84720),d=i(10998),p=i(72829),f=i(88596),v=i(39745),g=new n({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},rectangle:function(t,e,i,n,r){var o=s.rectangle(t,e,i,n,r);return this.world.add(o),o},trapezoid:function(t,e,i,n,r,o){var a=s.trapezoid(t,e,i,n,r,o);return this.world.add(a),a},circle:function(t,e,i,n,r){var o=s.circle(t,e,i,n,r);return this.world.add(o),o},polygon:function(t,e,i,n,r){var o=s.polygon(t,e,i,n,r);return this.world.add(o),o},fromVertices:function(t,e,i,n,r,o,a){"string"==typeof i&&(i=v.fromPath(i));var h=s.fromVertices(t,e,i,n,r,o,a);return this.world.add(h),h},fromPhysicsEditor:function(t,e,i,s,n){void 0===n&&(n=!0);var r=d.parseBody(t,e,i,s);return n&&!this.world.has(r)&&this.world.add(r),r},fromSVG:function(t,e,i,n,r,o){void 0===n&&(n=1),void 0===r&&(r={}),void 0===o&&(o=!0);for(var h=i.getElementsByTagName("path"),l=[],u=0;u{var s=i(74527),n=i(72632),r=i(93736);t.exports=function(t,e,i,o){void 0===i&&(i={}),void 0===o&&(o=!0);var a=e.x,h=e.y;if(e.body={temp:!0,position:{x:a,y:h}},[s.Bounce,s.Collision,s.Force,s.Friction,s.Gravity,s.Mass,s.Sensor,s.SetBody,s.Sleep,s.Static,s.Transform,s.Velocity].forEach((function(t){for(var i in t)(s=t[i]).get&&"function"==typeof s.get||s.set&&"function"==typeof s.set?Object.defineProperty(e,i,{get:t[i].get,set:t[i].set}):Object.defineProperty(e,i,{value:t[i]});var s})),e.world=t,e._tempVec2=new r(a,h),i.hasOwnProperty("type")&&"body"===i.type)e.setExistingBody(i,o);else{var l=n(i,"shape",null);l||(l="rectangle"),i.addToWorld=o,e.setBody(l,i)}return e}},7030:(t,e,i)=>{var s=i(56694),n=i(74527),r=i(89980),o=i(72632),a=i(1539),h=i(58210),l=i(93736),u=new s({Extends:a,Mixins:[n.Bounce,n.Collision,n.Force,n.Friction,n.Gravity,n.Mass,n.Sensor,n.SetBody,n.Sleep,n.Static,n.Transform,n.Velocity,h],initialize:function(t,e,i,s,n,a){r.call(this,t.scene,"Image"),this._crop=this.resetCropObject(),this.setTexture(s,n),this.setSizeToFrame(),this.setOrigin(),this.world=t,this._tempVec2=new l(e,i);var h=o(a,"shape",null);h?this.setBody(h,a):this.setRectangle(this.width,this.height,a),this.setPosition(e,i),this.initPipeline()}});t.exports=u},50583:(t,e,i)=>{var s=i(84093),n=i(50658),r=i(68516),o=i(84125),a=i(63568),h=i(84091),l=i(56694),u=i(11299),c=i(56643),d=i(52838),p=i(13657),f=i(53996),v=i(72653),g=i(72632),m=i(10850),y=i(15489),x=i(1675),T=i(80391),w=i(16929),b=i(44097),E=i(30657),S=i(70584),A=i(91327),_=i(84474),C=i(91963),M=i(13390),R=i(44272),P=i(5756),O=i(7599),L=i(92765),F=i(10438),D=i(39745),k=i(31468),I=new l({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,this.bodyBounds,this.body=o,this.composite=u,this.detector=p,this.grid=y,this.pair=S,this.pairs=A,this.query=M,this.resolver=R,this.sat=P,this.constraint=d,this.bodies=r,this.composites=c,this.axes=n,this.bounds=h,this.svg=L,this.vector=F,this.vertices=D,this.verts=D,this._tempVec2=F.create(),m(this.config,"plugins.collisionevents",!0)&&this.enableCollisionEventsPlugin(),m(this.config,"plugins.attractors",!1)&&this.enableAttractorPlugin(),m(this.config,"plugins.wrap",!1)&&this.enableWrapPlugin(),R._restingThresh=m(this.config,"restingThresh",4),R._restingThreshTangent=m(this.config,"restingThreshTangent",6),R._positionDampen=m(this.config,"positionDampen",.9),R._positionWarming=m(this.config,"positionWarming",.8),R._frictionNormalMultiplier=m(this.config,"frictionNormalMultiplier",5),t.sys.events.once(O.BOOT,this.boot,this),t.sys.events.on(O.START,this.start,this)},boot:function(){this.world=new k(this.scene,this.config),this.add=new v(this.world),this.bodyBounds=new a,this.systems.events.once(O.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new k(this.scene,this.config),this.add=new v(this.world));var t=this.systems.events;t.on(O.UPDATE,this.world.update,this.world),t.on(O.POST_UPDATE,this.world.postUpdate,this.world),t.once(O.SHUTDOWN,this.shutdown,this)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return E(g(e,"matter",{}),g(t,"matter",{}))},enableAttractorPlugin:function(){return _.register(x),_.use(w,x),this},enableWrapPlugin:function(){return _.register(b),_.use(w,b),this},enableCollisionEventsPlugin:function(){return _.register(T),_.use(w,T),this},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},set60Hz:function(){return this.world.getDelta=this.world.update60Hz,this.world.autoUpdate=!0,this},set30Hz:function(){return this.world.getDelta=this.world.update30Hz,this.world.autoUpdate=!0,this},step:function(t,e){this.world.step(t,e)},containsPoint:function(t,e,i){t=this.getMatterBodies(t);var s=F.create(e,i);return M.point(t,s).length>0},intersectPoint:function(t,e,i){i=this.getMatterBodies(i);var s=F.create(t,e),n=[];return M.point(i,s).forEach((function(t){-1===n.indexOf(t)&&n.push(t)})),n},intersectRect:function(t,e,i,s,n,r){void 0===n&&(n=!1),r=this.getMatterBodies(r);var o={min:{x:t,y:e},max:{x:t+i,y:e+s}},a=[];return M.region(r,o,n).forEach((function(t){-1===a.indexOf(t)&&a.push(t)})),a},intersectRay:function(t,e,i,s,n,r){void 0===n&&(n=1),r=this.getMatterBodies(r);for(var o=[],a=M.ray(r,F.create(t,e),F.create(i,s),n),h=0;h{var s=i(16569),n=i(56694),r=i(74527),o=i(89980),a=i(72632),h=i(58210),l=i(13747),u=i(93736),c=new n({Extends:l,Mixins:[r.Bounce,r.Collision,r.Force,r.Friction,r.Gravity,r.Mass,r.Sensor,r.SetBody,r.Sleep,r.Static,r.Transform,r.Velocity,h],initialize:function(t,e,i,n,r,h){o.call(this,t.scene,"Sprite"),this._crop=this.resetCropObject(),this.anims=new s(this),this.setTexture(n,r),this.setSizeToFrame(),this.setOrigin(),this.world=t,this._tempVec2=new u(e,i);var l=a(h,"shape",null);l?this.setBody(l,h):this.setRectangle(this.width,this.height,h),this.setPosition(e,i),this.initPipeline()}});t.exports=c},84720:(t,e,i)=>{var s=i(68516),n=i(84125),r=i(56694),o=i(74527),a=i(6659),h=i(72632),l=i(19256),u=i(39745),c=new r({Extends:a,Mixins:[o.Bounce,o.Collision,o.Friction,o.Gravity,o.Mass,o.Sensor,o.Sleep,o.Static],initialize:function(t,e,i){a.call(this),this.tile=e,this.world=t,e.physics.matterBody&&e.physics.matterBody.destroy(),e.physics.matterBody=this;var s=h(i,"body",null),n=h(i,"addToWorld",!0);if(s)this.setBody(s,n);else{var r=e.getCollisionGroup();h(r,"objects",[]).length>0?this.setFromTileCollision(i):this.setFromTileRectangle(i)}},setFromTileRectangle:function(t){void 0===t&&(t={}),l(t,"isStatic")||(t.isStatic=!0),l(t,"addToWorld")||(t.addToWorld=!0);var e=this.tile.getBounds(),i=e.x+e.width/2,n=e.y+e.height/2,r=s.rectangle(i,n,e.width,e.height,t);return this.setBody(r,t.addToWorld),this},setFromTileCollision:function(t){void 0===t&&(t={}),l(t,"isStatic")||(t.isStatic=!0),l(t,"addToWorld")||(t.addToWorld=!0);for(var e=this.tile.tilemapLayer.scaleX,i=this.tile.tilemapLayer.scaleY,r=this.tile.getLeft(),o=this.tile.getTop(),a=this.tile.getCollisionGroup(),c=h(a,"objects",[]),d=[],p=0;p1&&(t.parts=d,this.setBody(n.create(t),t.addToWorld)),this},setBody:function(t,e){return void 0===e&&(e=!0),this.body&&this.removeBody(),this.body=t,this.body.gameObject=this,e&&this.world.add(this.body),this},removeBody:function(){return this.body&&(this.world.remove(this.body),this.body.gameObject=void 0,this.body=void 0),this},destroy:function(){this.removeBody(),this.tile.physics.matterBody=void 0,this.removeAllListeners()}});t.exports=c},10998:(t,e,i)=>{var s=i(68516),n=i(84125),r=i(68758),o=i(72632),a=i(39745),h={parseBody:function(t,e,i,s){void 0===s&&(s={});for(var a=o(i,"fixtures",[]),h=[],l=0;l{var s=i(68516),n=i(84125),r={parseBody:function(t,e,i,r){var o;void 0===r&&(r={});var a=i.vertices;if(1===a.length)r.vertices=a[0],o=n.create(r),s.flagCoincidentParts(o.parts);else{for(var h=[],l=0;l{var s=i(84091),n=i(56694),r=i(11299),o=i(52838),a=i(13657),h=i(35416),l=i(33963),u=i(30657),c=i(22806),d=i(93736),p=i(39745),f=new n({initialize:function(t,e,i){void 0===i&&(i={});this.scene=t,this.world=e,this.camera=null,this.pointer=null,this.active=!0,this.position=new d,this.body=null,this.part=null,this.constraint=o.create(u(i,{label:"Pointer Constraint",pointA:{x:0,y:0},pointB:{x:0,y:0},length:.01,stiffness:.1,angularStiffness:1,collisionFilter:{category:1,mask:4294967295,group:0}})),this.world.on(h.BEFORE_UPDATE,this.update,this),t.sys.input.on(l.POINTER_DOWN,this.onDown,this),t.sys.input.on(l.POINTER_UP,this.onUp,this)},onDown:function(t){this.pointer||(this.pointer=t,this.camera=t.camera)},onUp:function(t){t===this.pointer&&(this.pointer=null)},getBody:function(t){var e=this.position,i=this.constraint;this.camera.getWorldPoint(t.x,t.y,e);for(var n=r.allBodies(this.world.localWorld),o=0;o1?1:0;n{var s=i(68516),n=i(84125),r=i(56694),o=i(68758),a=i(11299),h=i(45775),l=i(6659),u=i(35416),c=i(72632),d=i(10850),p=i(84125),f=i(39073),v=i(84720),g=i(72005),m=i(10438),y=new r({Extends:l,initialize:function(t,e){l.call(this),this.scene=t,this.engine=h.create(e),this.localWorld=this.engine.world;var i=d(e,"gravity",null);i?this.setGravity(i.x,i.y,i.scale):!1===i&&this.setGravity(0,0,0),this.walls={left:null,right:null,top:null,bottom:null},this.enabled=d(e,"enabled",!0),this.correction=d(e,"correction",1),this.getDelta=d(e,"getDelta",this.update60Hz);var s=c(e,"runner",{}),n=c(s,"fps",!1),r=c(s,"fps",60),o=c(s,"delta",1e3/r),a=c(s,"deltaMin",1e3/r),u=c(s,"deltaMax",1e3/(.5*r));n||(r=1e3/o),this.runner={fps:r,correction:c(s,"correction",1),deltaSampleSize:c(s,"deltaSampleSize",60),counterTimestamp:0,frameCounter:0,deltaHistory:[],timePrev:null,timeScalePrev:1,frameRequestId:null,isFixed:c(s,"isFixed",!1),delta:o,deltaMin:a,deltaMax:u},this.autoUpdate=d(e,"autoUpdate",!0);var p=d(e,"debug",!1);if(this.drawDebug="object"==typeof p||p,this.debugGraphic,this.debugConfig={showAxes:c(p,"showAxes",!1),showAngleIndicator:c(p,"showAngleIndicator",!1),angleColor:c(p,"angleColor",15208787),showBroadphase:c(p,"showBroadphase",!1),broadphaseColor:c(p,"broadphaseColor",16757760),showBounds:c(p,"showBounds",!1),boundsColor:c(p,"boundsColor",16777215),showVelocity:c(p,"showVelocity",!1),velocityColor:c(p,"velocityColor",44783),showCollisions:c(p,"showCollisions",!1),collisionColor:c(p,"collisionColor",16094476),showSeparations:c(p,"showSeparations",!1),separationColor:c(p,"separationColor",16753920),showBody:c(p,"showBody",!0),showStaticBody:c(p,"showStaticBody",!0),showInternalEdges:c(p,"showInternalEdges",!1),renderFill:c(p,"renderFill",!1),renderLine:c(p,"renderLine",!0),fillColor:c(p,"fillColor",1075465),fillOpacity:c(p,"fillOpacity",1),lineColor:c(p,"lineColor",2678297),lineOpacity:c(p,"lineOpacity",1),lineThickness:c(p,"lineThickness",1),staticFillColor:c(p,"staticFillColor",857979),staticLineColor:c(p,"staticLineColor",1255396),showSleeping:c(p,"showSleeping",!1),staticBodySleepOpacity:c(p,"staticBodySleepOpacity",.7),sleepFillColor:c(p,"sleepFillColor",4605510),sleepLineColor:c(p,"sleepLineColor",10066585),showSensors:c(p,"showSensors",!0),sensorFillColor:c(p,"sensorFillColor",857979),sensorLineColor:c(p,"sensorLineColor",1255396),showPositions:c(p,"showPositions",!0),positionSize:c(p,"positionSize",4),positionColor:c(p,"positionColor",14697178),showJoint:c(p,"showJoint",!0),jointColor:c(p,"jointColor",14737474),jointLineOpacity:c(p,"jointLineOpacity",1),jointLineThickness:c(p,"jointLineThickness",2),pinSize:c(p,"pinSize",4),pinColor:c(p,"pinColor",4382944),springColor:c(p,"springColor",14697184),anchorColor:c(p,"anchorColor",15724527),anchorSize:c(p,"anchorSize",4),showConvexHulls:c(p,"showConvexHulls",!1),hullColor:c(p,"hullColor",14091216)},this.drawDebug&&this.createDebugGraphic(),this.setEventsProxy(),c(e,"setBounds",!1)){var f=e.setBounds;if("boolean"==typeof f)this.setBounds();else{var v=c(f,"x",0),g=c(f,"y",0),m=c(f,"width",t.sys.scale.width),y=c(f,"height",t.sys.scale.height),x=c(f,"thickness",64),T=c(f,"left",!0),w=c(f,"right",!0),b=c(f,"top",!0),E=c(f,"bottom",!0);this.setBounds(v,g,m,y,x,T,w,b,E)}}},setCompositeRenderStyle:function(t){var e,i,s,n=t.bodies,r=t.constraints,o=t.composites;for(e=0;e0&&(i=n[0].bodyA,s=n[0].bodyB),t.emit(u.COLLISION_START,e,i,s)})),f.on(e,"collisionActive",(function(e){var i,s,n=e.pairs;n.length>0&&(i=n[0].bodyA,s=n[0].bodyB),t.emit(u.COLLISION_ACTIVE,e,i,s)})),f.on(e,"collisionEnd",(function(e){var i,s,n=e.pairs;n.length>0&&(i=n[0].bodyA,s=n[0].bodyB),t.emit(u.COLLISION_END,e,i,s)}))},setBounds:function(t,e,i,s,n,r,o,a,h){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===s&&(s=this.scene.sys.scale.height),void 0===n&&(n=64),void 0===r&&(r=!0),void 0===o&&(o=!0),void 0===a&&(a=!0),void 0===h&&(h=!0),this.updateWall(r,"left",t-n,e-n,n,s+2*n),this.updateWall(o,"right",t+i,e-n,n,s+2*n),this.updateWall(a,"top",t,e-n,i,n),this.updateWall(h,"bottom",t,e+s,i,n),this},updateWall:function(t,e,i,s,n,r){var o=this.walls[e];t?(o&&g.remove(this.localWorld,o),i+=n/2,s+=r/2,this.walls[e]=this.create(i,s,n,r,{isStatic:!0,friction:0,frictionStatic:0})):(o&&g.remove(this.localWorld,o),this.walls[e]=null)},createDebugGraphic:function(){var t=this.scene.sys.add.graphics({x:0,y:0});return t.setDepth(Number.MAX_VALUE),this.debugGraphic=t,this.drawDebug=!0,t},disableGravity:function(){return this.localWorld.gravity.x=0,this.localWorld.gravity.y=0,this.localWorld.gravity.scale=0,this},setGravity:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=1),this.localWorld.gravity.x=t,this.localWorld.gravity.y=e,void 0!==i&&(this.localWorld.gravity.scale=i),this},create:function(t,e,i,n,r){var o=s.rectangle(t,e,i,n,r);return g.add(this.localWorld,o),o},add:function(t){return g.add(this.localWorld,t),this},remove:function(t,e){Array.isArray(t)||(t=[t]);for(var i=0;is.deltaMax?s.deltaMax:e)/s.delta,s.delta=e),0!==s.timeScalePrev&&(r*=n.timeScale/s.timeScalePrev),0===n.timeScale&&(r=0),s.timeScalePrev=n.timeScale,s.correction=r,s.frameCounter+=1,t-s.counterTimestamp>=1e3&&(s.fps=s.frameCounter*((t-s.counterTimestamp)/1e3),s.counterTimestamp=t,s.frameCounter=0),h.update(i,e,r)}},step:function(t,e){h.update(this.engine,t,e)},update60Hz:function(){return 1e3/60},update30Hz:function(){return 1e3/30},has:function(t){var e=t.hasOwnProperty("body")?t.body:t;return null!==a.get(this.localWorld,e.id,e.type)},getAllBodies:function(){return a.allBodies(this.localWorld)},getAllConstraints:function(){return a.allConstraints(this.localWorld)},getAllComposites:function(){return a.allComposites(this.localWorld)},postUpdate:function(){if(this.drawDebug){var t=this.debugConfig,e=this.engine,i=this.debugGraphic,s=a.allBodies(this.localWorld);this.debugGraphic.clear(),t.showBroadphase&&e.broadphase.controller&&this.renderGrid(e.broadphase,i,t.broadphaseColor,.5),t.showBounds&&this.renderBodyBounds(s,i,t.boundsColor,.5),(t.showBody||t.showStaticBody)&&this.renderBodies(s),t.showJoint&&this.renderJoints(),(t.showAxes||t.showAngleIndicator)&&this.renderBodyAxes(s,i,t.showAxes,t.angleColor,.5),t.showVelocity&&this.renderBodyVelocity(s,i,t.velocityColor,1,2),t.showSeparations&&this.renderSeparations(e.pairs.list,i,t.separationColor),t.showCollisions&&this.renderCollisions(e.pairs.list,i,t.collisionColor)}},renderGrid:function(t,e,i,s){e.lineStyle(1,i,s);for(var n=o.keys(t.buckets),r=0;r0){var l=h[0].vertex.x,u=h[0].vertex.y;2===h.length&&(l=(h[0].vertex.x+h[1].vertex.x)/2,u=(h[0].vertex.y+h[1].vertex.y)/2),a.bodyB===a.supports[0].body||a.bodyA.isStatic?e.lineBetween(l-8*a.normal.x,u-8*a.normal.y,l,u):e.lineBetween(l+8*a.normal.x,u+8*a.normal.y,l,u)}}return this},renderBodyBounds:function(t,e,i,s){e.lineStyle(1,i,s);for(var n=0;n1?1:0;h1?1:0;a1?1:0;a1&&this.renderConvexHull(v,e,p,y)}}},renderBody:function(t,e,i,s,n,r,o,a){void 0===s&&(s=null),void 0===n&&(n=null),void 0===r&&(r=1),void 0===o&&(o=null),void 0===a&&(a=null);for(var h=this.debugConfig,l=h.sensorFillColor,u=h.sensorLineColor,c=t.parts,d=c.length,p=d>1?1:0;p1){var n=t.vertices;e.lineStyle(s,i),e.beginPath(),e.moveTo(n[0].x,n[0].y);for(var r=1;r0&&(e.fillStyle(a),e.fillCircle(u.x,u.y,h),e.fillCircle(c.x,c.y,h)),this},resetCollisionIDs:function(){return n._nextCollidingGroupId=1,n._nextNonCollidingGroupId=-1,n._nextCategory=1,this},shutdown:function(){f.off(this.engine),this.removeAllListeners(),g.clear(this.localWorld,!1),h.clear(this.engine),this.drawDebug&&this.debugGraphic.destroy()},destroy:function(){this.shutdown()}});t.exports=y},95349:t=>{t.exports={setBounce:function(t){return this.body.restitution=t,this}}},70679:t=>{var e={setCollisionCategory:function(t){return this.body.collisionFilter.category=t,this},setCollisionGroup:function(t){return this.body.collisionFilter.group=t,this},setCollidesWith:function(t){var e=0;if(Array.isArray(t))for(var i=0;i{var s=i(84125),n={applyForce:function(t){return this._tempVec2.set(this.body.position.x,this.body.position.y),s.applyForce(this.body,this._tempVec2,t),this},applyForceFrom:function(t,e){return s.applyForce(this.body,t,e),this},thrust:function(t){var e=this.body.angle;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),s.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustLeft:function(t){var e=this.body.angle-Math.PI/2;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),s.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustRight:function(t){var e=this.body.angle+Math.PI/2;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),s.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustBack:function(t){var e=this.body.angle-Math.PI;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),s.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this}};t.exports=n},74015:t=>{var e={setFriction:function(t,e,i){return this.body.friction=t,void 0!==e&&(this.body.frictionAir=e),void 0!==i&&(this.body.frictionStatic=i),this},setFrictionAir:function(t){return this.body.frictionAir=t,this},setFrictionStatic:function(t){return this.body.frictionStatic=t,this}};t.exports=e},11535:t=>{t.exports={setIgnoreGravity:function(t){return this.body.ignoreGravity=t,this}}},74497:(t,e,i)=>{var s=i(84125),n=i(93736),r={setMass:function(t){return s.setMass(this.body,t),this},setDensity:function(t){return s.setDensity(this.body,t),this},centerOfMass:{get:function(){return new n(this.body.centerOfMass.x,this.body.centerOfMass.y)}}};t.exports=r},75529:t=>{t.exports={setSensor:function(t){return this.body.isSensor=t,this},isSensor:function(){return this.body.isSensor}}},64024:(t,e,i)=>{var s=i(68516),n=i(84125),r=i(88456),o=i(72632),a=i(10998),h=i(72829),l=i(39745),u={setRectangle:function(t,e,i){return this.setBody({type:"rectangle",width:t,height:e},i)},setCircle:function(t,e){return this.setBody({type:"circle",radius:t},e)},setPolygon:function(t,e,i){return this.setBody({type:"polygon",sides:e,radius:t},i)},setTrapezoid:function(t,e,i,s){return this.setBody({type:"trapezoid",width:t,height:e,slope:i},s)},setExistingBody:function(t,e){void 0===e&&(e=!0),this.body&&this.world.remove(this.body,!0),this.body=t;for(var i=0;i{var s=i(35416),n=i(22806),r=i(39073),o={setToSleep:function(){return n.set(this.body,!0),this},setAwake:function(){return n.set(this.body,!1),this},setSleepThreshold:function(t){return void 0===t&&(t=60),this.body.sleepThreshold=t,this},setSleepEvents:function(t,e){return this.setSleepStartEvent(t),this.setSleepEndEvent(e),this},setSleepStartEvent:function(t){if(t){var e=this.world;r.on(this.body,"sleepStart",(function(t){e.emit(s.SLEEP_START,t,this)}))}else r.off(this.body,"sleepStart");return this},setSleepEndEvent:function(t){if(t){var e=this.world;r.on(this.body,"sleepEnd",(function(t){e.emit(s.SLEEP_END,t,this)}))}else r.off(this.body,"sleepEnd");return this}};t.exports=o},82884:(t,e,i)=>{var s=i(84125),n={setStatic:function(t){return s.setStatic(this.body,t),this},isStatic:function(){return this.body.isStatic}};t.exports=n},4753:(t,e,i)=>{var s=i(84125),n=i(83392),r=i(35786),o=i(62138),a={x:{get:function(){return this.body.position.x},set:function(t){this._tempVec2.set(t,this.y),s.setPosition(this.body,this._tempVec2)}},y:{get:function(){return this.body.position.y},set:function(t){this._tempVec2.set(this.x,t),s.setPosition(this.body,this._tempVec2)}},scaleX:{get:function(){return this._scaleX},set:function(t){var e=1/this._scaleX,i=1/this._scaleY;this._scaleX=t,0===this._scaleX?this.renderFlags&=-5:this.renderFlags|=4,s.scale(this.body,e,i),s.scale(this.body,t,this._scaleY)}},scaleY:{get:function(){return this._scaleY},set:function(t){var e=1/this._scaleX,i=1/this._scaleY;this._scaleY=t,0===this._scaleY?this.renderFlags&=-5:this.renderFlags|=4,s.scale(this.body,e,i),s.scale(this.body,this._scaleX,t)}},angle:{get:function(){return o(this.body.angle*n.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*n.DEG_TO_RAD}},rotation:{get:function(){return this.body.angle},set:function(t){this._rotation=r(t),s.setAngle(this.body,this._rotation)}},setPosition:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this._tempVec2.set(t,e),s.setPosition(this.body,this._tempVec2),this},setRotation:function(t){return void 0===t&&(t=0),this._rotation=r(t),s.setAngle(this.body,t),this},setFixedRotation:function(){return s.setInertia(this.body,1/0),this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,s.setAngle(this.body,this.rotation),this},setScale:function(t,e,i){void 0===t&&(t=1),void 0===e&&(e=t);var n=1/this._scaleX,r=1/this._scaleY;return this._scaleX=t,this._scaleY=e,s.scale(this.body,n,r,i),s.scale(this.body,t,e,i),this}};t.exports=a},37268:(t,e,i)=>{var s=i(84125),n={setAngularVelocity:function(t){return s.setAngularVelocity(this.body,t),this},setVelocityX:function(t){return this._tempVec2.set(t,this.body.velocity.y),s.setVelocity(this.body,this._tempVec2),this},setVelocityY:function(t){return this._tempVec2.set(this.body.velocity.x,t),s.setVelocity(this.body,this._tempVec2),this},setVelocity:function(t,e){return this._tempVec2.set(t,e),s.setVelocity(this.body,this._tempVec2),this}};t.exports=n},74527:(t,e,i)=>{t.exports={Bounce:i(95349),Collision:i(70679),Force:i(77178),Friction:i(74015),Gravity:i(11535),Mass:i(74497),Sensor:i(75529),SetBody:i(64024),Sleep:i(25106),Static:i(82884),Transform:i(4753),Velocity:i(37268)}},63201:t=>{t.exports="afteradd"},30474:t=>{t.exports="afterremove"},44822:t=>{t.exports="afterupdate"},88820:t=>{t.exports="beforeadd"},94849:t=>{t.exports="beforeremove"},6391:t=>{t.exports="beforeupdate"},96738:t=>{t.exports="collisionactive"},7916:t=>{t.exports="collisionend"},59529:t=>{t.exports="collisionstart"},10219:t=>{t.exports="dragend"},183:t=>{t.exports="drag"},39143:t=>{t.exports="dragstart"},16483:t=>{t.exports="pause"},35806:t=>{t.exports="resume"},22106:t=>{t.exports="sleepend"},5803:t=>{t.exports="sleepstart"},35416:(t,e,i)=>{t.exports={AFTER_ADD:i(63201),AFTER_REMOVE:i(30474),AFTER_UPDATE:i(44822),BEFORE_ADD:i(88820),BEFORE_REMOVE:i(94849),BEFORE_UPDATE:i(6391),COLLISION_ACTIVE:i(96738),COLLISION_END:i(7916),COLLISION_START:i(59529),DRAG_END:i(10219),DRAG:i(183),DRAG_START:i(39143),PAUSE:i(16483),RESUME:i(35806),SLEEP_END:i(22106),SLEEP_START:i(5803)}},45949:(t,e,i)=>{t.exports={BodyBounds:i(63568),Components:i(74527),Events:i(35416),Factory:i(72653),MatterGameObject:i(3860),Image:i(7030),Matter:i(18171),MatterPhysics:i(50583),PolyDecomp:i(81084),Sprite:i(73658),TileBody:i(84720),PhysicsEditorParser:i(10998),PhysicsJSONParser:i(72829),PointerConstraint:i(88596),World:i(31468)}},84125:(t,e,i)=>{var s={};t.exports=s;var n=i(39745),r=i(10438),o=i(22806),a=i(68758),h=i(84091),l=i(50658);!function(){s._inertiaScale=4,s._nextCollidingGroupId=1,s._nextNonCollidingGroupId=-1,s._nextCategory=1,s.create=function(e){var i={id:a.nextId(),type:"body",label:"Body",parts:[],plugin:{},angle:0,vertices:null,position:{x:0,y:0},force:{x:0,y:0},torque:0,positionImpulse:{x:0,y:0},previousPositionImpulse:{x:0,y:0},constraintImpulse:{x:0,y:0,angle:0},totalContacts:0,speed:0,angularSpeed:0,velocity:{x:0,y:0},angularVelocity:0,isSensor:!1,isStatic:!1,isSleeping:!1,motion:0,sleepThreshold:60,density:.001,restitution:0,friction:.1,frictionStatic:.5,frictionAir:.01,collisionFilter:{category:1,mask:4294967295,group:0},slop:.05,timeScale:1,events:null,bounds:null,chamfer:null,circleRadius:0,positionPrev:null,anglePrev:0,parent:null,axes:null,area:0,mass:0,inverseMass:0,inertia:0,inverseInertia:0,_original:null,render:{visible:!0,opacity:1,sprite:{xOffset:0,yOffset:0},fillColor:null,fillOpacity:null,lineColor:null,lineOpacity:null,lineThickness:null},gameObject:null,scale:{x:1,y:1},centerOfMass:{x:0,y:0},centerOffset:{x:0,y:0},gravityScale:{x:1,y:1},ignoreGravity:!1,ignorePointer:!1,onCollideCallback:null,onCollideEndCallback:null,onCollideActiveCallback:null,onCollideWith:{}};!e.hasOwnProperty("position")&&e.hasOwnProperty("vertices")?e.position=n.centre(e.vertices):e.hasOwnProperty("vertices")||(i.vertices=n.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"));var s=a.extend(i,e);return t(s,e),s.setOnCollideWith=function(t,e){return e?this.onCollideWith[t.id]=e:delete this.onCollideWith[t.id],this},s},s.nextGroup=function(t){return t?s._nextNonCollidingGroupId--:s._nextCollidingGroupId++},s.nextCategory=function(){return s._nextCategory=s._nextCategory<<1,s._nextCategory};var t=function(t,e){e=e||{},s.set(t,{bounds:t.bounds||h.create(t.vertices),positionPrev:t.positionPrev||r.clone(t.position),anglePrev:t.anglePrev||t.angle,vertices:t.vertices,parts:t.parts||[t],isStatic:t.isStatic,isSleeping:t.isSleeping,parent:t.parent||t});var i=t.bounds;if(n.rotate(t.vertices,t.angle,t.position),l.rotate(t.axes,t.angle),h.update(i,t.vertices,t.velocity),s.set(t,{axes:e.axes||t.axes,area:e.area||t.area,mass:e.mass||t.mass,inertia:e.inertia||t.inertia}),1===t.parts.length){var o=t.centerOfMass,a=t.centerOffset,u=i.max.x-i.min.x,c=i.max.y-i.min.y;o.x=-(i.min.x-t.position.x)/u,o.y=-(i.min.y-t.position.y)/c,a.x=u*o.x,a.y=c*o.y}};s.set=function(t,e,i){var n;for(n in"string"==typeof e&&(n=e,(e={})[n]=i),e)if(Object.prototype.hasOwnProperty.call(e,n))switch(i=e[n],n){case"isStatic":s.setStatic(t,i);break;case"isSleeping":o.set(t,i);break;case"mass":s.setMass(t,i);break;case"density":s.setDensity(t,i);break;case"inertia":s.setInertia(t,i);break;case"vertices":s.setVertices(t,i);break;case"position":s.setPosition(t,i);break;case"angle":s.setAngle(t,i);break;case"velocity":s.setVelocity(t,i);break;case"angularVelocity":s.setAngularVelocity(t,i);break;case"parts":s.setParts(t,i);break;case"centre":s.setCentre(t,i);break;default:t[n]=i}},s.setStatic=function(t,e){for(var i=0;i0&&r.rotateAbout(o.position,i,t.position,o.position)}},s.setVelocity=function(t,e){t.positionPrev.x=t.position.x-e.x,t.positionPrev.y=t.position.y-e.y,t.velocity.x=e.x,t.velocity.y=e.y,t.speed=r.magnitude(t.velocity)},s.setAngularVelocity=function(t,e){t.anglePrev=t.angle-e,t.angularVelocity=e,t.angularSpeed=Math.abs(t.angularVelocity)},s.translate=function(t,e){s.setPosition(t,r.add(t.position,e))},s.rotate=function(t,e,i){if(i){var n=Math.cos(e),r=Math.sin(e),o=t.position.x-i.x,a=t.position.y-i.y;s.setPosition(t,{x:i.x+(o*n-a*r),y:i.y+(o*r+a*n)}),s.setAngle(t,t.angle+e)}else s.setAngle(t,t.angle+e)},s.scale=function(t,e,i,r){var o=0,a=0;r=r||t.position;for(var u=0;u0&&(o+=c.area,a+=c.inertia),c.position.x=r.x+(c.position.x-r.x)*e,c.position.y=r.y+(c.position.y-r.y)*i,h.update(c.bounds,c.vertices,t.velocity)}t.parts.length>1&&(t.area=o,t.isStatic||(s.setMass(t,t.density*o),s.setInertia(t,a))),t.circleRadius&&(e===i?t.circleRadius*=e:t.circleRadius=null)},s.update=function(t,e,i,s){var o=Math.pow(e*i*t.timeScale,2),a=1-t.frictionAir*i*t.timeScale,u=t.position.x-t.positionPrev.x,c=t.position.y-t.positionPrev.y;t.velocity.x=u*a*s+t.force.x/t.mass*o,t.velocity.y=c*a*s+t.force.y/t.mass*o,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.angularVelocity=(t.angle-t.anglePrev)*a*s+t.torque/t.inertia*o,t.anglePrev=t.angle,t.angle+=t.angularVelocity,t.speed=r.magnitude(t.velocity),t.angularSpeed=Math.abs(t.angularVelocity);for(var d=0;d0&&(p.position.x+=t.velocity.x,p.position.y+=t.velocity.y),0!==t.angularVelocity&&(n.rotate(p.vertices,t.angularVelocity,t.position),l.rotate(p.axes,t.angularVelocity),d>0&&r.rotateAbout(p.position,t.angularVelocity,t.position,p.position)),h.update(p.bounds,p.vertices,t.velocity)}},s.applyForce=function(t,e,i){t.force.x+=i.x,t.force.y+=i.y;var s=e.x-t.position.x,n=e.y-t.position.y;t.torque+=s*i.y-n*i.x},s._totalProperties=function(t){for(var e={mass:0,area:0,inertia:0,centre:{x:0,y:0}},i=1===t.parts.length?0:1;i{var s={};t.exports=s;var n=i(39073),r=i(68758),o=i(84091),a=i(84125);s.create=function(t){return r.extend({id:r.nextId(),type:"composite",parent:null,isModified:!1,bodies:[],constraints:[],composites:[],label:"Composite",plugin:{}},t)},s.setModified=function(t,e,i,r){if(n.trigger(t,"compositeModified",t),t.isModified=e,i&&t.parent&&s.setModified(t.parent,e,i,r),r)for(var o=0;o{var s={};t.exports=s;var n=i(11299),r=(i(52838),i(68758));s.create=function(t){var e=n.create(),i={label:"World",gravity:{x:0,y:1,scale:.001},bounds:{min:{x:-1/0,y:-1/0},max:{x:1/0,y:1/0}}};return r.extend(e,i,t)}},13657:(t,e,i)=>{var s={};t.exports=s;var n=i(5756),r=i(70584),o=i(84091);s.collisions=function(t,e){for(var i=[],a=e.pairs.table,h=e.metrics,l=0;l1?1:0;d1?1:0;f0:0!=(t.mask&e.category)&&0!=(e.mask&t.category)}},15489:(t,e,i)=>{var s={};t.exports=s;var n=i(70584),r=i(13657),o=i(68758);s.create=function(t){var e={controller:s,detector:r.collisions,buckets:{},pairs:{},pairsList:[],bucketWidth:48,bucketHeight:48};return o.extend(e,t)},s.update=function(t,e,i,n){var r,o,a,h,l,u=i.world,c=t.buckets,d=!1,p=i.metrics;for(p.broadphaseTests=0,r=0;ru.bounds.max.x||f.bounds.max.yu.bounds.max.y)){var v=s._getRegion(t,f);if(!f.region||v.id!==f.region.id||n){p.broadphaseTests+=1,f.region&&!n||(f.region=v);var g=s._regionUnion(v,f.region);for(o=g.startCol;o<=g.endCol;o++)for(a=g.startRow;a<=g.endRow;a++){h=c[l=s._getBucketId(o,a)];var m=o>=v.startCol&&o<=v.endCol&&a>=v.startRow&&a<=v.endRow,y=o>=f.region.startCol&&o<=f.region.endCol&&a>=f.region.startRow&&a<=f.region.endRow;!m&&y&&y&&h&&s._bucketRemoveBody(t,h,f),(f.region===v||m&&!y||n)&&(h||(h=s._createBucket(c,l)),s._bucketAddBody(t,h,f))}f.region=v,d=!0}}}d&&(t.pairsList=s._createActivePairsList(t))},s.clear=function(t){t.buckets={},t.pairs={},t.pairsList=[]},s._regionUnion=function(t,e){var i=Math.min(t.startCol,e.startCol),n=Math.max(t.endCol,e.endCol),r=Math.min(t.startRow,e.startRow),o=Math.max(t.endRow,e.endRow);return s._createRegion(i,n,r,o)},s._getRegion=function(t,e){var i=e.bounds,n=Math.floor(i.min.x/t.bucketWidth),r=Math.floor(i.max.x/t.bucketWidth),o=Math.floor(i.min.y/t.bucketHeight),a=Math.floor(i.max.y/t.bucketHeight);return s._createRegion(n,r,o,a)},s._createRegion=function(t,e,i,s){return{id:t+","+e+","+i+","+s,startCol:t,endCol:e,startRow:i,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,i){for(var s=0;s0?s.push(i):delete t.pairs[e[n]];return s}},70584:t=>{var e={};t.exports=e,e.create=function(t,i){var s=t.bodyA,n=t.bodyB,r={id:e.id(s,n),bodyA:s,bodyB:n,activeContacts:[],separation:0,isActive:!0,confirmedActive:!0,isSensor:s.isSensor||n.isSensor,timeCreated:i,timeUpdated:i,collision:null,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return e.update(r,t,i),r},e.update=function(t,i,s){if(t.collision=i,i.collided){var n=i.supports,r=t.activeContacts,o=i.parentA,a=i.parentB;t.inverseMass=o.inverseMass+a.inverseMass,t.friction=Math.min(o.friction,a.friction),t.frictionStatic=Math.max(o.frictionStatic,a.frictionStatic),t.restitution=Math.max(o.restitution,a.restitution),t.slop=Math.max(o.slop,a.slop);for(var h=0;h{var s={};t.exports=s;var n=i(70584),r=i(68758);s._pairMaxIdleLife=1e3,s.create=function(t){return r.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},t)},s.update=function(t,e,i){var s,r,o,a,h=t.list,l=t.table,u=t.collisionStart,c=t.collisionEnd,d=t.collisionActive;for(u.length=0,c.length=0,d.length=0,a=0;as._pairMaxIdleLife&&l.push(o);for(o=0;o{var s={};t.exports=s;var n=i(10438),r=i(5756),o=i(84091),a=i(68516),h=i(39745);s.collides=function(t,e){for(var i=[],s=0;s{var s={};t.exports=s;var n=i(39745),r=i(10438),o=i(68758),a=i(84091);s._restingThresh=4,s._restingThreshTangent=6,s._positionDampen=.9,s._positionWarming=.8,s._frictionNormalMultiplier=5,s.preSolvePosition=function(t){var e,i,s;for(e=0;ep.friction*p.frictionStatic*D*i&&(I=O,k=o.clamp(p.friction*L*i,-I,I));var B=r.cross(S,m),N=r.cross(A,m),Y=T/(v.inverseMass+g.inverseMass+v.inverseInertia*B*B+g.inverseInertia*N*N);if(F*=Y,k*=Y,R<0&&R*R>s._restingThresh*i)b.normalImpulse=0;else{var U=b.normalImpulse;b.normalImpulse=Math.min(b.normalImpulse+F,0),F=b.normalImpulse-U}if(P*P>s._restingThreshTangent*i)b.tangentImpulse=0;else{var X=b.tangentImpulse;b.tangentImpulse=o.clamp(b.tangentImpulse+k,-I,I),k=b.tangentImpulse-X}n.x=m.x*F+y.x*k,n.y=m.y*F+y.y*k,v.isStatic||v.isSleeping||(v.positionPrev.x+=n.x*v.inverseMass,v.positionPrev.y+=n.y*v.inverseMass,v.anglePrev+=r.cross(S,n)*v.inverseInertia),g.isStatic||g.isSleeping||(g.positionPrev.x-=n.x*g.inverseMass,g.positionPrev.y-=n.y*g.inverseMass,g.anglePrev-=r.cross(A,n)*g.inverseInertia)}}}}},5756:(t,e,i)=>{var s={};t.exports=s;var n=i(39745),r=i(10438);s.collides=function(t,e,i){var o,a,h,l,u=!1;if(i){var c=t.parent,d=e.parent,p=c.speed*c.speed+c.angularSpeed*c.angularSpeed+d.speed*d.speed+d.angularSpeed*d.angularSpeed;u=i&&i.collided&&p<.2,l=i}else l={collided:!1,bodyA:t,bodyB:e};if(i&&u){var f=l.axisBody,v=f===t?e:t,g=[f.axes[i.axisNumber]];if(h=s._overlapAxes(f.vertices,v.vertices,g),l.reused=!0,h.overlap<=0)return l.collided=!1,l}else{if((o=s._overlapAxes(t.vertices,e.vertices,t.axes)).overlap<=0)return l.collided=!1,l;if((a=s._overlapAxes(e.vertices,t.vertices,e.axes)).overlap<=0)return l.collided=!1,l;o.overlapn?n=a:a=0?o.index-1:u.length-1],l.x=n.x-c.x,l.y=n.y-c.y,h=-r.dot(i,l),a=n,n=u[(o.index+1)%u.length],l.x=n.x-c.x,l.y=n.y-c.y,(s=-r.dot(i,l)){var s={};t.exports=s;var n=i(39745),r=i(10438),o=i(22806),a=i(84091),h=i(50658),l=i(68758);s._warming=.4,s._torqueDampen=1,s._minLength=1e-6,s.create=function(t){var e=t;e.bodyA&&!e.pointA&&(e.pointA={x:0,y:0}),e.bodyB&&!e.pointB&&(e.pointB={x:0,y:0});var i=e.bodyA?r.add(e.bodyA.position,e.pointA):e.pointA,s=e.bodyB?r.add(e.bodyB.position,e.pointB):e.pointB,n=r.magnitude(r.sub(i,s));e.length=void 0!==e.length?e.length:n,e.id=e.id||l.nextId(),e.label=e.label||"Constraint",e.type="constraint",e.stiffness=e.stiffness||(e.length>0?1:.7),e.damping=e.damping||0,e.angularStiffness=e.angularStiffness||0,e.angleA=e.bodyA?e.bodyA.angle:e.angleA,e.angleB=e.bodyB?e.bodyB.angle:e.angleB,e.plugin={};var o={visible:!0,type:"line",anchors:!0,lineColor:null,lineOpacity:null,lineThickness:null,pinSize:null,anchorColor:null,anchorSize:null};return 0===e.length&&e.stiffness>.1?(o.type="pin",o.anchors=!1):e.stiffness<.9&&(o.type="spring"),e.render=l.extend(o,e.render),e},s.preSolveAll=function(t){for(var e=0;e0&&(c.position.x+=l.x,c.position.y+=l.y),0!==l.angle&&(n.rotate(c.vertices,l.angle,i.position),h.rotate(c.axes,l.angle),u>0&&r.rotateAbout(c.position,l.angle,i.position,c.position)),a.update(c.bounds,c.vertices,i.velocity)}l.angle*=s._warming,l.x*=s._warming,l.y*=s._warming}}},s.pointAWorld=function(t){return{x:(t.bodyA?t.bodyA.position.x:0)+t.pointA.x,y:(t.bodyA?t.bodyA.position.y:0)+t.pointA.y}},s.pointBWorld=function(t){return{x:(t.bodyB?t.bodyB.position.x:0)+t.pointB.x,y:(t.bodyB?t.bodyB.position.y:0)+t.pointB.y}}},68758:t=>{var e={};t.exports=e,function(){e._nextId=0,e._seed=0,e._nowStartTime=+new Date,e.extend=function(t,i){var s,n;"boolean"==typeof i?(s=2,n=i):(s=1,n=!0);for(var r=s;r0;i--){var s=Math.floor(e.random()*(i+1)),n=t[i];t[i]=t[s],t[s]=n}return t},e.choose=function(t){return t[Math.floor(e.random()*t.length)]},e.isElement=function(t){return"undefined"!=typeof HTMLElement?t instanceof HTMLElement:!!(t&&t.nodeType&&t.nodeName)},e.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},e.isFunction=function(t){return"function"==typeof t},e.isPlainObject=function(t){return"object"==typeof t&&t.constructor===Object},e.isString=function(t){return"[object String]"===Object.prototype.toString.call(t)},e.clamp=function(t,e,i){return ti?i:t},e.sign=function(t){return t<0?-1:1},e.now=function(){if("undefined"!=typeof window&&window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return new Date-e._nowStartTime},e.random=function(e,i){return i=void 0!==i?i:1,(e=void 0!==e?e:0)+t()*(i-e)};var t=function(){return e._seed=(9301*e._seed+49297)%233280,e._seed/233280};e.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)},e.logLevel=1,e.log=function(){console&&e.logLevel>0&&e.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},e.info=function(){console&&e.logLevel>0&&e.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},e.warn=function(){console&&e.logLevel>0&&e.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},e.nextId=function(){return e._nextId++},e.indexOf=function(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0;i{var s={};t.exports=s;var n=i(72005),r=i(22806),o=i(44272),a=i(91327),h=i(86330),l=i(15489),u=i(39073),c=i(11299),d=i(52838),p=i(68758),f=i(84125);s.create=function(t,e){e=(e=p.isElement(t)?e:t)||{},((t=p.isElement(t)?t:null)||e.render)&&p.warn("Engine.create: engine.render is deprecated (see docs)");var i={positionIterations:6,velocityIterations:4,constraintIterations:2,enableSleeping:!1,events:[],plugin:{},timing:{timestamp:0,timeScale:1},broadphase:{controller:l}},s=p.extend(i,e);return s.world=e.world||n.create(s.world),s.pairs=a.create(),s.broadphase=s.broadphase.controller.create(s.broadphase),s.metrics=s.metrics||{extended:!1},s.metrics=h.create(s.metrics),s},s.update=function(t,e,i){e=e||1e3/60,i=i||1;var n,l=t.world,p=t.timing,f=t.broadphase,v=[];p.timestamp+=e*p.timeScale;var g={timestamp:p.timestamp};u.trigger(t,"beforeUpdate",g);var m=c.allBodies(l),y=c.allConstraints(l);for(h.reset(t.metrics),t.enableSleeping&&r.update(m,p.timeScale),s._bodiesApplyGravity(m,l.gravity),s._bodiesUpdate(m,e,p.timeScale,i,l.bounds),d.preSolveAll(m),n=0;n0&&u.trigger(t,"collisionStart",{pairs:T.collisionStart}),o.preSolvePosition(T.list),n=0;n0&&u.trigger(t,"collisionActive",{pairs:T.collisionActive}),T.collisionEnd.length>0&&u.trigger(t,"collisionEnd",{pairs:T.collisionEnd}),h.update(t.metrics,t),s._bodiesClearForces(m),u.trigger(t,"afterUpdate",g),t},s.merge=function(t,e){if(p.extend(t,e),e.world){t.world=e.world,s.clear(t);for(var i=c.allBodies(t.world),n=0;n{var s={};t.exports=s;var n=i(68758);s.on=function(t,e,i){for(var s,n=e.split(" "),r=0;r0){i||(i={}),s=e.split(" ");for(var l=0;l{var s={};t.exports=s;var n=i(84474),r=i(68758);s.name="matter-js",s.version="0.14.2",s.uses=[],s.used=[],s.use=function(){n.use(s,Array.prototype.slice.call(arguments))},s.before=function(t,e){return t=t.replace(/^Matter./,""),r.chainPathBefore(s,t,e)},s.after=function(t,e){return t=t.replace(/^Matter./,""),r.chainPathAfter(s,t,e)}},86330:(t,e,i)=>{var s={};t.exports=s;var n=i(11299),r=i(68758);s.create=function(t){return r.extend({extended:!1,narrowDetections:0,narrowphaseTests:0,narrowReuse:0,narrowReuseCount:0,midphaseTests:0,broadphaseTests:0,narrowEff:1e-4,midEff:1e-4,broadEff:1e-4,collisions:0,buckets:0,bodies:0,pairs:0},!1,t)},s.reset=function(t){t.extended&&(t.narrowDetections=0,t.narrowphaseTests=0,t.narrowReuse=0,t.narrowReuseCount=0,t.midphaseTests=0,t.broadphaseTests=0,t.narrowEff=0,t.midEff=0,t.broadEff=0,t.collisions=0,t.buckets=0,t.pairs=0,t.bodies=0)},s.update=function(t,e){if(t.extended){var i=e.world,s=n.allBodies(i);t.collisions=t.narrowDetections,t.pairs=e.pairs.list.length,t.bodies=s.length,t.midEff=(t.narrowDetections/(t.midphaseTests||1)).toFixed(2),t.narrowEff=(t.narrowDetections/(t.narrowphaseTests||1)).toFixed(2),t.broadEff=(1-t.broadphaseTests/(s.length||1)).toFixed(2),t.narrowReuse=(t.narrowReuseCount/(t.narrowphaseTests||1)).toFixed(2)}}},84474:(t,e,i)=>{var s={};t.exports=s;var n=i(68758);s._registry={},s.register=function(t){if(s.isPlugin(t)||n.warn("Plugin.register:",s.toString(t),"does not implement all required fields."),t.name in s._registry){var e=s._registry[t.name],i=s.versionParse(t.version).number,r=s.versionParse(e.version).number;i>r?(n.warn("Plugin.register:",s.toString(e),"was upgraded to",s.toString(t)),s._registry[t.name]=t):i-1},s.isFor=function(t,e){var i=t.for&&s.dependencyParse(t.for);return!t.for||e.name===i.name&&s.versionSatisfies(e.version,i.range)},s.use=function(t,e){if(t.uses=(t.uses||[]).concat(e||[]),0!==t.uses.length){for(var i=s.dependencies(t),r=n.topologicalSort(i),o=[],a=0;a0&&!h.silent&&n.info(o.join(" "))}else n.warn("Plugin.use:",s.toString(t),"does not specify any dependencies to install.")},s.dependencies=function(t,e){var i=s.dependencyParse(t),r=i.name;if(!(r in(e=e||{}))){t=s.resolve(t)||t,e[r]=n.map(t.uses||[],(function(e){s.isPlugin(e)&&s.register(e);var r=s.dependencyParse(e),o=s.resolve(e);return o&&!s.versionSatisfies(o.version,r.range)?(n.warn("Plugin.dependencies:",s.toString(o),"does not satisfy",s.toString(r),"used by",s.toString(i)+"."),o._warned=!0,t._warned=!0):o||(n.warn("Plugin.dependencies:",s.toString(e),"used by",s.toString(i),"could not be resolved."),t._warned=!0),r.name}));for(var o=0;o=n[2];if("^"===i.operator)return n[0]>0?o[0]===n[0]&&r.number>=i.number:n[1]>0?o[1]===n[1]&&o[2]>=n[2]:o[2]===n[2]}return t===e||"*"===t}},22806:(t,e,i)=>{var s={};t.exports=s;var n=i(39073);s._motionWakeThreshold=.18,s._motionSleepThreshold=.08,s._minBias=.9,s.update=function(t,e){for(var i=e*e*e,n=0;n0&&r.motion=r.sleepThreshold&&s.set(r,!0)):r.sleepCounter>0&&(r.sleepCounter-=1)}else s.set(r,!1)}},s.afterCollisions=function(t,e){for(var i=e*e*e,n=0;ns._motionWakeThreshold*i&&s.set(l,!1)}}}},s.set=function(t,e){var i=t.isSleeping;e?(t.isSleeping=!0,t.sleepCounter=t.sleepThreshold,t.positionImpulse.x=0,t.positionImpulse.y=0,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.anglePrev=t.angle,t.speed=0,t.angularSpeed=0,t.motion=0,i||n.trigger(t,"sleepStart")):(t.isSleeping=!1,t.sleepCounter=0,i&&n.trigger(t,"sleepEnd"))}},68516:(t,e,i)=>{var s={};t.exports=s;var n=i(39745),r=i(68758),o=i(84125),a=i(84091),h=i(10438),l=i(81084);s.rectangle=function(t,e,i,s,a){a=a||{};var h={label:"Rectangle Body",position:{x:t,y:e},vertices:n.fromPath("L 0 0 L "+i+" 0 L "+i+" "+s+" L 0 "+s)};if(a.chamfer){var l=a.chamfer;h.vertices=n.chamfer(h.vertices,l.radius,l.quality,l.qualityMin,l.qualityMax),delete a.chamfer}return o.create(r.extend({},h,a))},s.trapezoid=function(t,e,i,s,a,h){h=h||{};var l,u=i*(a*=.5),c=u+(1-2*a)*i,d=c+u;l=a<.5?"L 0 0 L "+u+" "+-s+" L "+c+" "+-s+" L "+d+" 0":"L 0 0 L "+c+" "+-s+" L "+d+" 0";var p={label:"Trapezoid Body",position:{x:t,y:e},vertices:n.fromPath(l)};if(h.chamfer){var f=h.chamfer;p.vertices=n.chamfer(p.vertices,f.radius,f.quality,f.qualityMin,f.qualityMax),delete h.chamfer}return o.create(r.extend({},p,h))},s.circle=function(t,e,i,n,o){n=n||{};var a={label:"Circle Body",circleRadius:i};o=o||25;var h=Math.ceil(Math.max(10,Math.min(o,i)));return h%2==1&&(h+=1),s.polygon(t,e,h,i,r.extend({},a,n))},s.polygon=function(t,e,i,a,h){if(h=h||{},i<3)return s.circle(t,e,a,h);for(var l=2*Math.PI/i,u="",c=.5*l,d=0;d0&&n.area(T)1?(d=o.create(r.extend({parts:p.slice(0)},a)),o.setPosition(d,{x:t,y:e}),d):p[0]},s.flagCoincidentParts=function(t,e){void 0===e&&(e=5);for(var i=0;i{var s={};t.exports=s;var n=i(11299),r=i(52838),o=i(68758),a=i(84125),h=i(68516);s.stack=function(t,e,i,s,r,o,h){for(var l,u=n.create({label:"Stack"}),c=t,d=e,p=0,f=0;fv&&(v=y),a.translate(m,{x:.5*x,y:.5*y}),c=m.bounds.max.x+r,n.addBody(u,m),l=m,p+=1}else c+=r}d+=v+o,c=t}return u},s.chain=function(t,e,i,s,a,h){for(var l=t.bodies,u=1;u0)for(l=0;l0&&(d=p[l-1+(h-1)*e],n.addConstraint(t,r.create(o.extend({bodyA:d,bodyB:c},a)))),s&&ld||o<(l=d-l)||o>i-1-l))return 1===c&&a.translate(u,{x:(o+(i%2==1?1:-1))*p,y:0}),h(t+(u?o*p:0)+o*r,s,o,l,u,c)}))},s.newtonsCradle=function(t,e,i,s,o){for(var a=n.create({label:"Newtons Cradle"}),l=0;l{var s={};t.exports=s;var n=i(10438),r=i(68758);s.fromVertices=function(t){for(var e={},i=0;i{var e={};t.exports=e,e.create=function(t){var i={min:{x:0,y:0},max:{x:0,y:0}};return t&&e.update(i,t),i},e.update=function(t,e,i){t.min.x=1/0,t.max.x=-1/0,t.min.y=1/0,t.max.y=-1/0;for(var s=0;st.max.x&&(t.max.x=n.x),n.xt.max.y&&(t.max.y=n.y),n.y0?t.max.x+=i.x:t.min.x+=i.x,i.y>0?t.max.y+=i.y:t.min.y+=i.y)},e.contains=function(t,e){return e.x>=t.min.x&&e.x<=t.max.x&&e.y>=t.min.y&&e.y<=t.max.y},e.overlaps=function(t,e){return t.min.x<=e.max.x&&t.max.x>=e.min.x&&t.max.y>=e.min.y&&t.min.y<=e.max.y},e.translate=function(t,e){t.min.x+=e.x,t.max.x+=e.x,t.min.y+=e.y,t.max.y+=e.y},e.shift=function(t,e){var i=t.max.x-t.min.x,s=t.max.y-t.min.y;t.min.x=e.x,t.max.x=e.x+i,t.min.y=e.y,t.max.y=e.y+s}},92765:(t,e,i)=>{var s={};t.exports=s;i(84091);var n=i(68758);s.pathToVertices=function(t,e){"undefined"==typeof window||"SVGPathSeg"in window||n.warn("Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.");var i,r,o,a,h,l,u,c,d,p,f,v=[],g=0,m=0,y=0;e=e||15;var x=function(t,e,i){var s=i%2==1&&i>1;if(!d||t!=d.x||e!=d.y){d&&s?(p=d.x,f=d.y):(p=0,f=0);var n={x:p+t,y:f+e};!s&&d||(d=n),v.push(n),m=p+t,y=f+e}},T=function(t){var e=t.pathSegTypeAsLetter.toUpperCase();if("Z"!==e){switch(e){case"M":case"L":case"T":case"C":case"S":case"Q":m=t.x,y=t.y;break;case"H":m=t.x;break;case"V":y=t.y}x(m,y,t.pathSegType)}};for(s._svgPathToAbsolute(t),o=t.getTotalLength(),l=[],i=0;i{var e={};t.exports=e,e.create=function(t,e){return{x:t||0,y:e||0}},e.clone=function(t){return{x:t.x,y:t.y}},e.magnitude=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},e.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},e.rotate=function(t,e,i){var s=Math.cos(e),n=Math.sin(e);i||(i={});var r=t.x*s-t.y*n;return i.y=t.x*n+t.y*s,i.x=r,i},e.rotateAbout=function(t,e,i,s){var n=Math.cos(e),r=Math.sin(e);s||(s={});var o=i.x+((t.x-i.x)*n-(t.y-i.y)*r);return s.y=i.y+((t.x-i.x)*r+(t.y-i.y)*n),s.x=o,s},e.normalise=function(t){var i=e.magnitude(t);return 0===i?{x:0,y:0}:{x:t.x/i,y:t.y/i}},e.dot=function(t,e){return t.x*e.x+t.y*e.y},e.cross=function(t,e){return t.x*e.y-t.y*e.x},e.cross3=function(t,e,i){return(e.x-t.x)*(i.y-t.y)-(e.y-t.y)*(i.x-t.x)},e.add=function(t,e,i){return i||(i={}),i.x=t.x+e.x,i.y=t.y+e.y,i},e.sub=function(t,e,i){return i||(i={}),i.x=t.x-e.x,i.y=t.y-e.y,i},e.mult=function(t,e){return{x:t.x*e,y:t.y*e}},e.div=function(t,e){return{x:t.x/e,y:t.y/e}},e.perp=function(t,e){return{x:(e=!0===e?-1:1)*-t.y,y:e*t.x}},e.neg=function(t){return{x:-t.x,y:-t.y}},e.angle=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)},e._temp=[e.create(),e.create(),e.create(),e.create(),e.create(),e.create()]},39745:(t,e,i)=>{var s={};t.exports=s;var n=i(10438),r=i(68758);s.create=function(t,e){for(var i=[],s=0;s0)return!1}return!0},s.scale=function(t,e,i,r){if(1===e&&1===i)return t;var o,a;r=r||s.centre(t);for(var h=0;h=0?h-1:t.length-1],u=t[h],c=t[(h+1)%t.length],d=e[h0&&(r|=2),3===r)return!1;return 0!==r||null},s.hull=function(t){var e,i,s=[],r=[];for((t=t.slice(0)).sort((function(t,e){var i=t.x-e.x;return 0!==i?i:t.y-e.y})),i=0;i=2&&n.cross3(r[r.length-2],r[r.length-1],e)<=0;)r.pop();r.push(e)}for(i=t.length-1;i>=0;i-=1){for(e=t[i];s.length>=2&&n.cross3(s[s.length-2],s[s.length-1],e)<=0;)s.pop();s.push(e)}return s.pop(),r.pop(),s.concat(r)}},1675:(t,e,i)=>{var s=i(18171),n={name:"matter-attractors",version:"0.1.7",for:"matter-js@^0.14.2",silent:!0,install:function(t){t.after("Body.create",(function(){n.Body.init(this)})),t.before("Engine.update",(function(t){n.Engine.update(t)}))},Body:{init:function(t){t.plugin.attractors=t.plugin.attractors||[]}},Engine:{update:function(t){for(var e=s.Composite.allBodies(t.world),i=0;i0)for(var o=0;o{t.exports={name:"matter-collision-events",version:"0.1.6",for:"matter-js@^0.14.2",silent:!0,install:function(t){t.after("Engine.create",(function(){t.Events.on(this,"collisionStart",(function(e){e.pairs.map((function(e){var i=e.bodyA,s=e.bodyB;i.gameObject&&i.gameObject.emit("collide",i,s,e),s.gameObject&&s.gameObject.emit("collide",s,i,e),t.Events.trigger(i,"onCollide",{pair:e}),t.Events.trigger(s,"onCollide",{pair:e}),i.onCollideCallback&&i.onCollideCallback(e),s.onCollideCallback&&s.onCollideCallback(e),i.onCollideWith[s.id]&&i.onCollideWith[s.id](s,e),s.onCollideWith[i.id]&&s.onCollideWith[i.id](i,e)}))})),t.Events.on(this,"collisionActive",(function(e){e.pairs.map((function(e){var i=e.bodyA,s=e.bodyB;i.gameObject&&i.gameObject.emit("collideActive",i,s,e),s.gameObject&&s.gameObject.emit("collideActive",s,i,e),t.Events.trigger(i,"onCollideActive",{pair:e}),t.Events.trigger(s,"onCollideActive",{pair:e}),i.onCollideActiveCallback&&i.onCollideActiveCallback(e),s.onCollideActiveCallback&&s.onCollideActiveCallback(e)}))})),t.Events.on(this,"collisionEnd",(function(e){e.pairs.map((function(e){var i=e.bodyA,s=e.bodyB;i.gameObject&&i.gameObject.emit("collideEnd",i,s,e),s.gameObject&&s.gameObject.emit("collideEnd",s,i,e),t.Events.trigger(i,"onCollideEnd",{pair:e}),t.Events.trigger(s,"onCollideEnd",{pair:e}),i.onCollideEndCallback&&i.onCollideEndCallback(e),s.onCollideEndCallback&&s.onCollideEndCallback(e)}))}))}))}}},44097:(t,e,i)=>{var s=i(18171),n={name:"matter-wrap",version:"0.1.4",for:"matter-js@^0.14.2",silent:!0,install:function(t){t.after("Engine.update",(function(){n.Engine.update(this)}))},Engine:{update:function(t){for(var e=t.world,i=s.Composite.allBodies(e),r=s.Composite.allComposites(e),o=0;oe.max.x?i=e.min.x-t.max.x:t.max.xe.max.y?s=e.min.y-t.max.y:t.max.y{function e(t,e,i){i=i||0;var s,n,r,o,a,h,l,u=[0,0];return s=t[1][1]-t[0][1],n=t[0][0]-t[1][0],r=s*t[0][0]+n*t[0][1],o=e[1][1]-e[0][1],a=e[0][0]-e[1][0],h=o*e[0][0]+a*e[0][1],E(l=s*a-o*n,0,i)||(u[0]=(a*r-n*h)/l,u[1]=(s*h-o*r)/l),u}function i(t,e,i,s){var n=e[0]-t[0],r=e[1]-t[1],o=s[0]-i[0],a=s[1]-i[1];if(o*r-a*n==0)return!1;var h=(n*(i[1]-t[1])+r*(t[0]-i[0]))/(o*r-a*n),l=(o*(t[1]-i[1])+a*(i[0]-t[0]))/(a*n-o*r);return h>=0&&h<=1&&l>=0&&l<=1}function s(t,e,i){return(e[0]-t[0])*(i[1]-t[1])-(i[0]-t[0])*(e[1]-t[1])}function n(t,e,i){return s(t,e,i)>0}function r(t,e,i){return s(t,e,i)>=0}function o(t,e,i){return s(t,e,i)<0}function a(t,e,i){return s(t,e,i)<=0}t.exports={decomp:function(t){var e=T(t);return e.length>0?w(t,e):[t]},quickDecomp:function t(e,i,s,h,l,u,v){u=u||100,v=v||0,l=l||25,i=void 0!==i?i:[],s=s||[],h=h||[];var g=[0,0],m=[0,0],x=[0,0],T=0,w=0,E=0,S=0,A=0,_=0,C=0,M=[],R=[],P=e,O=e;if(O.length<3)return i;if(++v>u)return console.warn("quickDecomp: max level ("+u+") reached."),i;for(var L=0;LA&&(A+=e.length),S=Number.MAX_VALUE,A<_)return i;for(F=_;F<=A;++F)r(d(P,L-1),d(P,L),d(P,F))&&a(d(P,L+1),d(P,L),d(P,F))&&(E=c(d(P,L),d(P,F)))3&&s>=0;--s)u(d(t,s-1),d(t,s),d(t,s+1),e)&&(t.splice(s%t.length,1),i++);return i},removeDuplicatePoints:function(t,e){for(var i=t.length-1;i>=1;--i)for(var s=t[i],n=i-1;n>=0;--n)S(s,t[n],e)&&t.splice(i,1)},makeCCW:function(t){for(var e=0,i=t,s=1;si[e][0])&&(e=s);return!n(d(t,e-1),d(t,e),d(t,e+1))&&(function(t){for(var e=[],i=t.length,s=0;s!==i;s++)e.push(t.pop());for(s=0;s!==i;s++)t[s]=e[s]}(t),!0)}};var h=[],l=[];function u(t,e,i,n){if(n){var r=h,o=l;r[0]=e[0]-t[0],r[1]=e[1]-t[1],o[0]=i[0]-e[0],o[1]=i[1]-e[1];var a=r[0]*o[0]+r[1]*o[1],u=Math.sqrt(r[0]*r[0]+r[1]*r[1]),c=Math.sqrt(o[0]*o[0]+o[1]*o[1]);return Math.acos(a/(u*c)){var s=new(i(56694))({initialize:function(t){this.pluginManager=t,this.game=t.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=s},18360:t=>{t.exports={Global:["game","anims","cache","plugins","registry","scale","sound","textures","renderer"],CoreScene:["EventEmitter","CameraManager","GameObjectCreator","GameObjectFactory","ScenePlugin","DisplayList","UpdateList"],DefaultScene:["Clock","DataManagerPlugin","InputPlugin","Loader","TweenManager","LightsPlugin"]}},91963:t=>{var e={},i={},s={register:function(t,i,s,n){void 0===n&&(n=!1),e[t]={plugin:i,mapping:s,custom:n}},registerCustom:function(t,e,s,n){i[t]={plugin:e,mapping:s,data:n}},hasCore:function(t){return e.hasOwnProperty(t)},hasCustom:function(t){return i.hasOwnProperty(t)},getCore:function(t){return e[t]},getCustom:function(t){return i[t]},getCustomClass:function(t){return i.hasOwnProperty(t)?i[t].plugin:null},remove:function(t){e.hasOwnProperty(t)&&delete e[t]},removeCustom:function(t){i.hasOwnProperty(t)&&delete i[t]},destroyCorePlugins:function(){for(var t in e)e.hasOwnProperty(t)&&delete e[t]},destroyCustomPlugins:function(){for(var t in i)i.hasOwnProperty(t)&&delete i[t]}};t.exports=s},49274:(t,e,i)=>{var s=i(56694),n=i(97081),r=i(6659),o=i(76846),a=i(99325),h=i(61286),l=i(72632),u=i(91963),c=i(66458),d=new s({Extends:r,initialize:function(t){r.call(this),this.game=t,this.plugins=[],this.scenePlugins=[],this._pendingGlobal=[],this._pendingScene=[],t.isBooted?this.boot():t.events.once(n.BOOT,this.boot,this)},boot:function(){var t,e,i,s,r,o,a,h=this.game.config,u=h.installGlobalPlugins;for(u=u.concat(this._pendingGlobal),t=0;t{var s=i(88257),n=i(56694),r=i(7599),o=new n({Extends:s,initialize:function(t,e,i){s.call(this,e),this.scene=t,this.systems=t.sys,this.pluginKey=i,t.sys.events.once(r.BOOT,this.boot,this)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=o},45615:(t,e,i)=>{t.exports={BasePlugin:i(88257),DefaultPlugins:i(18360),PluginCache:i(91963),PluginManager:i(49274),ScenePlugin:i(39283)}},95723:t=>{t.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,ERASE:17,SOURCE_IN:18,SOURCE_OUT:19,SOURCE_ATOP:20,DESTINATION_OVER:21,DESTINATION_IN:22,DESTINATION_OUT:23,DESTINATION_ATOP:24,LIGHTER:25,COPY:26,XOR:27}},27394:t=>{t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},91135:(t,e,i)=>{var s=i(89787),n=i(61840),r=i(56694),o=i(86459),a=i(6659),h=i(81044),l=i(32834),u=i(40444),c=i(38203),d=i(69360),p=new r({Extends:a,initialize:function(t){a.call(this);var e=t.config;this.config={clearBeforeRender:e.clearBeforeRender,backgroundColor:e.backgroundColor,antialias:e.antialias,roundPixels:e.roundPixels},this.game=t,this.type=o.CANVAS,this.drawCount=0,this.width=0,this.height=0,this.gameCanvas=t.canvas;var i={alpha:t.config.transparent,desynchronized:t.config.desynchronized};this.gameContext=e.context?e.context:this.gameCanvas.getContext("2d",i),this.currentContext=this.gameContext,this.antialias=t.config.antialias,this.blendModes=l(),this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this._tempMatrix1=new d,this._tempMatrix2=new d,this._tempMatrix3=new d,this.isBooted=!1,this.init()},init:function(){this.game.textures.once(c.READY,this.boot,this)},boot:function(){var t=this.game,e=t.scale.baseSize;this.width=e.width,this.height=e.height,this.isBooted=!0,t.scale.on(u.RESIZE,this.onResize,this),this.resize(e.width,e.height)},onResize:function(t,e){e.width===this.width&&e.height===this.height||this.resize(e.width,e.height)},resize:function(t,e){this.width=t,this.height=e,this.emit(h.RESIZE,t,e)},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(t){return this.currentContext.globalCompositeOperation=t,this},setContext:function(t){return this.currentContext=t||this.gameContext,this},setAlpha:function(t){return this.currentContext.globalAlpha=t,this},preRender:function(){var t=this.gameContext,e=this.config,i=this.width,s=this.height;t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),e.clearBeforeRender&&(t.clearRect(0,0,i,s),e.transparent||(t.fillStyle=e.backgroundColor.rgba,t.fillRect(0,0,i,s))),t.save(),this.drawCount=0,this.emit(h.PRE_RENDER)},render:function(t,e,i){var n=e.length;this.emit(h.RENDER,t,i);var r=i.x,o=i.y,a=i.width,l=i.height,u=i.renderToTexture?i.context:t.sys.context;u.save(),this.game.scene.customViewports&&(u.beginPath(),u.rect(r,o,a,l),u.clip()),i.emit(s.PRE_RENDER,i),this.currentContext=u;var c=i.mask;c&&c.preRenderCanvas(this,null,i._maskCamera),i.transparent||(u.fillStyle=i.backgroundColor.rgba,u.fillRect(r,o,a,l)),u.globalAlpha=i.alpha,u.globalCompositeOperation="source-over",this.drawCount+=n,i.renderToTexture&&i.emit(s.PRE_RENDER,i),i.matrix.copyToContext(u);for(var d=0;d=0?m=-(m+c):m<0&&(m=Math.abs(m)-c)),t.flipY&&(y>=0?y=-(y+d):y<0&&(y=Math.abs(y)-d))}var T=1,w=1;t.flipX&&(p||(m+=-e.realWidth+2*v),T=-1),t.flipY&&(p||(y+=-e.realHeight+2*g),w=-1),a.applyITRS(t.x,t.y,t.rotation,t.scaleX*T,t.scaleY*w),o.copyFrom(i.matrix),s?(o.multiplyWithOffset(s,-i.scrollX*t.scrollFactorX,-i.scrollY*t.scrollFactorY),a.e=t.x,a.f=t.y):(a.e-=i.scrollX*t.scrollFactorX,a.f-=i.scrollY*t.scrollFactorY),o.multiply(a),i.roundPixels&&(o.e=Math.round(o.e),o.f=Math.round(o.f)),r.save(),o.setToContext(r),r.globalCompositeOperation=this.blendModes[t.blendMode],r.globalAlpha=n,r.imageSmoothingEnabled=!(!this.antialias||e.source.scaleMode),t.mask&&t.mask.preRenderCanvas(this,t,i),r.drawImage(e.source.image,l,u,c,d,m,y,c/f,d/f),t.mask&&t.mask.postRenderCanvas(this,t,i),r.restore()}},destroy:function(){this.removeAllListeners(),this.game=null,this.gameCanvas=null,this.gameContext=null}});t.exports=p},6046:(t,e,i)=>{t.exports={CanvasRenderer:i(91135),GetBlendModes:i(32834),SetTransform:i(49584)}},32834:(t,e,i)=>{var s=i(95723),n=i(98581);t.exports=function(){var t=[],e=n.supportNewBlendModes,i="source-over";return t[s.NORMAL]=i,t[s.ADD]="lighter",t[s.MULTIPLY]=e?"multiply":i,t[s.SCREEN]=e?"screen":i,t[s.OVERLAY]=e?"overlay":i,t[s.DARKEN]=e?"darken":i,t[s.LIGHTEN]=e?"lighten":i,t[s.COLOR_DODGE]=e?"color-dodge":i,t[s.COLOR_BURN]=e?"color-burn":i,t[s.HARD_LIGHT]=e?"hard-light":i,t[s.SOFT_LIGHT]=e?"soft-light":i,t[s.DIFFERENCE]=e?"difference":i,t[s.EXCLUSION]=e?"exclusion":i,t[s.HUE]=e?"hue":i,t[s.SATURATION]=e?"saturation":i,t[s.COLOR]=e?"color":i,t[s.LUMINOSITY]=e?"luminosity":i,t[s.ERASE]="destination-out",t[s.SOURCE_IN]="source-in",t[s.SOURCE_OUT]="source-out",t[s.SOURCE_ATOP]="source-atop",t[s.DESTINATION_OVER]="destination-over",t[s.DESTINATION_IN]="destination-in",t[s.DESTINATION_OUT]="destination-out",t[s.DESTINATION_ATOP]="destination-atop",t[s.LIGHTER]="lighter",t[s.COPY]="copy",t[s.XOR]="xor",t}},49584:(t,e,i)=>{var s=i(73329);t.exports=function(t,e,i,n,r){var o=n.alpha*i.alpha;if(o<=0)return!1;var a=s(i,n,r).calc;return e.globalCompositeOperation=t.blendModes[i.blendMode],e.globalAlpha=o,e.save(),a.setToContext(e),e.imageSmoothingEnabled=!(!t.antialias||i.frame&&i.frame.source.scaleMode),!0}},70936:t=>{t.exports="postrender"},99298:t=>{t.exports="prerender"},7743:t=>{t.exports="render"},99519:t=>{t.exports="resize"},81044:(t,e,i)=>{t.exports={POST_RENDER:i(70936),PRE_RENDER:i(99298),RENDER:i(7743),RESIZE:i(99519)}},42069:(t,e,i)=>{t.exports={Canvas:i(6046),Events:i(81044),Snapshot:i(95528),WebGL:i(55478)}},61840:(t,e,i)=>{var s=i(61068),n=i(27119),r=i(72632);t.exports=function(t,e){var i=r(e,"callback"),o=r(e,"type","image/png"),a=r(e,"encoder",.92),h=Math.abs(Math.round(r(e,"x",0))),l=Math.abs(Math.round(r(e,"y",0))),u=r(e,"width",t.width),c=r(e,"height",t.height);if(r(e,"getPixel",!1)){var d=t.getContext("2d").getImageData(h,l,1,1).data;i.call(null,new n(d[0],d[1],d[2],d[3]/255))}else if(0!==h||0!==l||u!==t.width||c!==t.height){var p=s.createWebGL(this,u,c);p.getContext("2d").drawImage(t,h,l,u,c,0,0,u,c);var f=new Image;f.onerror=function(){i.call(null),s.remove(p)},f.onload=function(){i.call(null,f),s.remove(p)},f.src=p.toDataURL(o,a)}else{var v=new Image;v.onerror=function(){i.call(null)},v.onload=function(){i.call(null,v)},v.src=t.toDataURL(o,a)}}},1217:(t,e,i)=>{var s=i(61068),n=i(27119),r=i(72632);t.exports=function(t,e){var i=t.getContext("experimental-webgl"),o=r(e,"callback"),a=r(e,"type","image/png"),h=r(e,"encoder",.92),l=r(e,"x",0),u=r(e,"y",0),c=r(e,"getPixel",!1),d=r(e,"isFramebuffer",!1),p=d?r(e,"bufferWidth",1):i.drawingBufferWidth,f=d?r(e,"bufferHeight",1):i.drawingBufferHeight;if(c){var v=new Uint8Array(4),g=d?u:f-u;i.readPixels(l,g,1,1,i.RGBA,i.UNSIGNED_BYTE,v),o.call(null,new n(v[0],v[1],v[2],v[3]/255))}else{var m=r(e,"width",p),y=r(e,"height",f),x=new Uint8Array(m*y*4);i.readPixels(l,f-u-y,m,y,i.RGBA,i.UNSIGNED_BYTE,x);for(var T=s.createWebGL(this,m,y),w=T.getContext("2d"),b=w.getImageData(0,0,m,y),E=b.data,S=0;S{t.exports={Canvas:i(61840),WebGL:i(1217)}},35217:(t,e,i)=>{var s=i(56694),n=i(65641),r=i(33885),o=i(72632),a=i(37410),h=i(82127),l=i(5583),u=i(67589),c=i(66901),d=i(77310),p=i(10919),f=i(21213),v=i(51212),g=i(60848),m=new s({initialize:function(t){this.game=t.game,this.renderer=t,this.classes=new r([[n.UTILITY_PIPELINE,g],[n.MULTI_PIPELINE,d],[n.BITMAPMASK_PIPELINE,l],[n.SINGLE_PIPELINE,v],[n.ROPE_PIPELINE,f],[n.LIGHT_PIPELINE,c],[n.POINTLIGHT_PIPELINE,p],[n.GRAPHICS_PIPELINE,u]]),this.postPipelineClasses=new r,this.pipelines=new r,this.current=null,this.previous=null,this.MULTI_PIPELINE=null,this.BITMAPMASK_PIPELINE=null,this.UTILITY_PIPELINE=null,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2,this.renderTargets=[],this.maxDimension=0,this.frameInc=32,this.targetIndex=0},boot:function(t){var e=this.renderer,i=this.renderTargets;this.frameInc=Math.floor(o(t,"frameInc",32));for(var s,r,h=e.width,l=e.height,u=Math.min(h,l),c=Math.ceil(u/this.frameInc),d=1;d=0;i--){var s=e[i];s.active&&s.preBatch(t)}}},postBatch:function(t){if(t.hasPostPipeline){this.flush();for(var e=t.postPipelines,i=0;i=0;i--){var s=e[i];s.active&&s.preBatch(t)}}},postBatchCamera:function(t){if(t.hasPostPipeline){this.flush();for(var e=t.postPipelines,i=0;ithis.maxDimension)return this.targetIndex=e.length-3,e[this.targetIndex];var i=3*(h(t,this.frameInc,0,!0)-1);return this.targetIndex=i,e[i]},getSwapRenderTarget:function(){return this.renderTargets[this.targetIndex+1]},getAltSwapRenderTarget:function(){return this.renderTargets[this.targetIndex+2]},destroy:function(){this.flush(),this.classes.clear(),this.postPipelineClasses.clear(),this.pipelines.clear(),this.renderer=null,this.game=null,this.classes=null,this.postPipelineClasses=null,this.pipelines=null,this.current=null,this.previous=null}});t.exports=m},37410:(t,e,i)=>{var s=i(56694),n=i(81044),r=new s({initialize:function(t,e,i,s,n,r,o){void 0===s&&(s=1),void 0===n&&(n=0),void 0===r&&(r=!0),void 0===o&&(o=!1),this.renderer=t,this.framebuffer=null,this.texture=null,this.width=0,this.height=0,this.scale=s,this.minFilter=n,this.autoClear=r,this.autoResize=!1,this.resize(e,i),o&&this.setAutoResize(!0)},setAutoResize:function(t){return t&&!this.autoResize?(this.renderer.on(n.RESIZE,this.resize,this),this.autoResize=!0):!t&&this.autoResize&&(this.renderer.off(n.RESIZE,this.resize,this),this.autoResize=!1),this},resize:function(t,e){var i=t*this.scale,s=e*this.scale;if(i!==this.width||s!==this.height){var n=this.renderer;n.deleteFramebuffer(this.framebuffer),n.deleteTexture(this.texture),t*=this.scale,e*=this.scale,(t=Math.round(t))<=0&&(t=1),(e=Math.round(e))<=0&&(e=1),this.texture=n.createTextureFromSource(null,t,e,this.minFilter,!0),this.framebuffer=n.createFramebuffer(t,e,this.texture,!1),this.width=t,this.height=e}return this},bind:function(t,e,i){if(void 0===t&&(t=!1),t&&this.renderer.flush(),e&&i&&this.resize(e,i),this.renderer.pushFramebuffer(this.framebuffer,!1,!1,!1),t&&this.adjustViewport(),this.autoClear){var s=this.renderer.gl;s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT)}},adjustViewport:function(){var t=this.renderer.gl;t.viewport(0,0,this.width,this.height),t.disable(t.SCISSOR_TEST)},clear:function(){var t=this.renderer,e=t.gl;t.pushFramebuffer(this.framebuffer),e.disable(e.SCISSOR_TEST),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),t.popFramebuffer(),t.resetScissor()},unbind:function(t){void 0===t&&(t=!1);var e=this.renderer;return t&&e.flush(),e.popFramebuffer()},destroy:function(){var t=this.renderer;t.deleteFramebuffer(this.framebuffer),t.deleteTexture(this.texture),t.off(n.RESIZE,this.resize,this),this.renderer=null,this.framebuffer=null,this.texture=null}});t.exports=r},75512:t=>{t.exports={getTintFromFloats:function(t,e,i,s){return((255&(255*s|0))<<24|(255&(255*t|0))<<16|(255&(255*e|0))<<8|255&(255*i|0))>>>0},getTintAppendFloatAlpha:function(t,e){return((255&(255*e|0))<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255&(255*e|0))<<24|(255&(0|t))<<16|(255&(t>>8|0))<<8|255&(t>>16|0))>>>0},getFloatsFromUintRGB:function(t){return[(255&(t>>16|0))/255,(255&(t>>8|0))/255,(255&(0|t))/255]},checkShaderMax:function(t,e){var i=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);return e&&-1!==e?Math.min(i,e):i},parseFragmentShaderMaxTextures:function(t,e){return t?t.replace(/%count%/gi,e.toString()):""}}},44775:(t,e,i)=>{var s=i(56694),n=i(28699),r=i(6659),o=i(18970),a=i(72632),h=i(16650),l=i(81044),u=i(37410),c=i(75512),d=i(71305),p=new s({Extends:r,initialize:function(t){r.call(this);var e=t.game,i=e.renderer,s=i.gl;this.name=a(t,"name","WebGLPipeline"),this.game=e,this.renderer=i,this.manager,this.gl=s,this.view=e.canvas,this.width=0,this.height=0,this.vertexCount=0,this.vertexCapacity=0,this.vertexData,this.vertexBuffer,this.topology=a(t,"topology",s.TRIANGLES),this.bytes,this.vertexViewF32,this.vertexViewU32,this.active=!0,this.currentUnit=0,this.forceZero=a(t,"forceZero",!1),this.hasBooted=!1,this.isPostFX=!1,this.isSpriteFX=!1,this.renderTargets=[],this.currentRenderTarget,this.shaders=[],this.currentShader,this.projectionMatrix,this.projectionWidth=0,this.projectionHeight=0,this.config=t,this.glReset=!1},boot:function(){var t,e=this.gl,i=this.config,s=this.renderer;this.isPostFX||(this.projectionMatrix=(new h).identity());var n=this.renderTargets,r=a(i,"renderTarget",!1);"boolean"==typeof r&&r&&(r=1);var c=s.width,d=s.height;if("number"==typeof r)for(t=0;tx&&(x=y[t].vertexSize);var T=a(i,"batchSize",s.config.batchSize);this.vertexCapacity=6*T;var w=new ArrayBuffer(this.vertexCapacity*x);this.vertexData=w,this.bytes=new Uint8Array(w),this.vertexViewF32=new Float32Array(w),this.vertexViewU32=new Uint32Array(w);var b=a(i,"vertices",null);for(b?(this.vertexViewF32.set(b),this.vertexBuffer=s.createVertexBuffer(w,e.STATIC_DRAW)):this.vertexBuffer=s.createVertexBuffer(w.byteLength,e.DYNAMIC_DRAW),this.setVertexBuffer(),t=y.length-1;t>=0;t--)y[t].rebind();this.hasBooted=!0,s.on(l.RESIZE,this.resize,this),s.on(l.PRE_RENDER,this.onPreRender,this),s.on(l.RENDER,this.onRender,this),s.on(l.POST_RENDER,this.onPostRender,this),this.emit(o.BOOT,this),this.onBoot()},onBoot:function(){},onResize:function(){},setShader:function(t,e,i){var s=this.renderer;t===this.currentShader&&s.currentProgram===this.currentShader.program||(this.flush(),s.resetTextures(),this.setVertexBuffer(i)&&!e&&(e=!0),t.bind(e,!1),this.currentShader=t);return this},getShaderByName:function(t){for(var e=this.shaders,i=0;ithis.vertexCapacity},resize:function(t,e){t===this.width&&e===this.height||this.flush(),this.width=t,this.height=e;for(var i=this.renderTargets,s=0;s=0;i--){var s=e[i].rebind();t&&s!==t||(this.currentShader=s)}return this.emit(o.REBIND,this.currentShader),this.onActive(this.currentShader),this.onRebind(),this.glReset=!1,this},setVertexBuffer:function(t){void 0===t&&(t=this.vertexBuffer);var e=this.gl;return e.getParameter(e.ARRAY_BUFFER_BINDING)!==t&&(e.bindBuffer(e.ARRAY_BUFFER,t),!0)},preBatch:function(t){return this.currentRenderTarget&&this.currentRenderTarget.bind(),this.onPreBatch(t),this},postBatch:function(t){return this.onDraw(this.currentRenderTarget),this.onPostBatch(t),this},onDraw:function(){},unbind:function(){this.currentRenderTarget&&this.currentRenderTarget.unbind()},flush:function(t){if(void 0===t&&(t=!1),this.vertexCount>0){this.emit(o.BEFORE_FLUSH,this,t),this.onBeforeFlush(t);var e=this.gl,i=this.vertexCount,s=this.currentShader.vertexSize;this.active&&(this.setVertexBuffer(),i===this.vertexCapacity?e.bufferData(e.ARRAY_BUFFER,this.vertexData,e.DYNAMIC_DRAW):e.bufferSubData(e.ARRAY_BUFFER,0,this.bytes.subarray(0,i*s)),e.drawArrays(this.topology,0,i)),this.vertexCount=0,this.emit(o.AFTER_FLUSH,this,t),this.onAfterFlush(t)}return this},onActive:function(){},onBind:function(){},onRebind:function(){},onBatch:function(){},onPreBatch:function(){},onPostBatch:function(){},onPreRender:function(){},onRender:function(){},onPostRender:function(){},onBeforeFlush:function(){},onAfterFlush:function(){},batchVert:function(t,e,i,s,n,r,o){var a=this.vertexViewF32,h=this.vertexViewU32,l=this.vertexCount*this.currentShader.vertexComponentCount-1;a[++l]=t,a[++l]=e,a[++l]=i,a[++l]=s,a[++l]=n,a[++l]=r,h[++l]=o,this.vertexCount++},batchQuad:function(t,e,i,s,n,r,o,a,h,l,u,c,d,p,f,v,g,m,y,x){void 0===x&&(x=this.currentUnit);var T=!1;return this.shouldFlush(6)&&(this.flush(),T=!0,x=this.setTexture2D(y)),this.batchVert(e,i,l,u,x,m,p),this.batchVert(s,n,l,d,x,m,v),this.batchVert(r,o,c,d,x,m,g),this.batchVert(e,i,l,u,x,m,p),this.batchVert(r,o,c,d,x,m,g),this.batchVert(a,h,c,u,x,m,f),this.onBatch(t),T},batchTri:function(t,e,i,s,n,r,o,a,h,l,u,c,d,p,f,v,g){void 0===g&&(g=this.currentUnit);var m=!1;return this.shouldFlush(3)&&(this.flush(),m=!0,g=this.setTexture2D(v)),this.batchVert(e,i,a,h,g,f,c),this.batchVert(s,n,a,u,g,f,d),this.batchVert(r,o,l,u,g,f,p),this.onBatch(t),m},drawFillRect:function(t,e,i,s,n,r,o,a){void 0===o&&(o=this.renderer.whiteTexture.glTexture),void 0===a&&(a=!0),t=Math.floor(t),e=Math.floor(e);var h=Math.floor(t+i),l=Math.floor(e+s),u=this.setTexture2D(o),d=c.getTintAppendFloatAlphaAndSwap(n,r),p=0,f=1;a&&(p=1,f=0),this.batchQuad(null,t,e,t,l,h,l,h,e,0,p,1,f,d,d,d,d,0,o,u)},setTexture2D:function(t){return void 0===t&&(t=this.renderer.whiteTexture.glTexture),this.currentUnit=this.renderer.setTexture2D(t),this.currentUnit},bindTexture:function(t,e){void 0===e&&(e=0);var i=this.gl;return i.activeTexture(i.TEXTURE0+e),i.bindTexture(i.TEXTURE_2D,t),this},bindRenderTarget:function(t,e){return this.bindTexture(t.texture,e)},setTime:function(t){return this.set1f(t,this.game.loop.getDuration()),this},set1f:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set1f(t,e),this},set2f:function(t,e,i,s){return void 0===s&&(s=this.currentShader),s.set2f(t,e,i),this},set3f:function(t,e,i,s,n){return void 0===n&&(n=this.currentShader),n.set3f(t,e,i,s),this},set4f:function(t,e,i,s,n,r){return void 0===r&&(r=this.currentShader),r.set4f(t,e,i,s,n),this},set1fv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set1fv(t,e),this},set2fv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set2fv(t,e),this},set3fv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set3fv(t,e),this},set4fv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set4fv(t,e),this},set1iv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set1iv(t,e),this},set2iv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set2iv(t,e),this},set3iv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set3iv(t,e),this},set4iv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set4iv(t,e),this},set1i:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set1i(t,e),this},set2i:function(t,e,i,s){return void 0===s&&(s=this.currentShader),s.set2i(t,e,i),this},set3i:function(t,e,i,s,n){return void 0===n&&(n=this.currentShader),n.set3i(t,e,i,s),this},set4i:function(t,e,i,s,n,r){return void 0===r&&(r=this.currentShader),r.set4i(t,e,i,s,n),this},setMatrix2fv:function(t,e,i,s){return void 0===s&&(s=this.currentShader),s.setMatrix2fv(t,e,i),this},setMatrix3fv:function(t,e,i,s){return void 0===s&&(s=this.currentShader),s.setMatrix3fv(t,e,i),this},setMatrix4fv:function(t,e,i,s){return void 0===s&&(s=this.currentShader),s.setMatrix4fv(t,e,i),this},destroy:function(){var t;this.emit(o.DESTROY,this);var e=this.shaders;for(t=0;t{var s=i(66458),n=i(89787),r=i(56694),o=i(86459),a=i(6659),h=i(81044),l=i(97081),u=i(28621),c=i(16650),d=i(72283),p=i(35217),f=i(37410),v=i(40444),g=i(38203),m=i(75512),y=i(1217),x=new r({Extends:a,initialize:function(t){a.call(this);var e=t.config,i={alpha:e.transparent,desynchronized:e.desynchronized,depth:!1,antialias:e.antialiasGL,premultipliedAlpha:e.premultipliedAlpha,stencil:!0,failIfMajorPerformanceCaveat:e.failIfMajorPerformanceCaveat,powerPreference:e.powerPreference,preserveDrawingBuffer:e.preserveDrawingBuffer};this.config={clearBeforeRender:e.clearBeforeRender,antialias:e.antialias,backgroundColor:e.backgroundColor,contextCreation:i,roundPixels:e.roundPixels,maxTextures:e.maxTextures,maxTextureSize:e.maxTextureSize,batchSize:e.batchSize,maxLights:e.maxLights,mipmapFilter:e.mipmapFilter},this.game=t,this.type=o.WEBGL,this.pipelines=null,this.width=0,this.height=0,this.canvas=t.canvas,this.blendModes=[],this.contextLost=!1,this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92,isFramebuffer:!1,bufferWidth:0,bufferHeight:0},this.currentActiveTexture=0,this.startActiveTexture=0,this.maxTextures=0,this.textureIndexes,this.tempTextures,this.textureZero,this.normalTexture,this.currentFramebuffer=null,this.fboStack=[],this.currentProgram=null,this.currentBlendMode=1/0,this.currentScissorEnabled=!1,this.currentScissor=null,this.scissorStack=[],this.contextLostHandler=d,this.contextRestoredHandler=d,this.gl=null,this.supportedExtensions=null,this.instancedArraysExtension=null,this.vaoExtension=null,this.extensions={},this.glFormats=[],this.compression,this.drawingBufferHeight=0,this.blankTexture=null,this.whiteTexture=null,this.maskCount=0,this.maskStack=[],this.currentMask={mask:null,camera:null},this.currentCameraMask={mask:null,camera:null},this.glFuncMap=null,this.currentType="",this.newType=!1,this.nextTypeMatch=!1,this.finalType=!1,this.mipmapFilter=null,this.textureFlush=0,this.isTextureClean=!1,this.defaultScissor=[0,0,0,0],this.isBooted=!1,this.renderTarget=null,this.projectionMatrix,this.projectionWidth=0,this.projectionHeight=0,this.init(this.config)},init:function(t){var e,i=this.game,s=this.canvas,n=t.backgroundColor;if(!(e=i.config.context?i.config.context:s.getContext("webgl",t.contextCreation)||s.getContext("experimental-webgl",t.contextCreation))||e.isContextLost())throw this.contextLost=!0,new Error("WebGL unsupported");this.gl=e;var r=this;this.contextLostHandler=function(t){r.contextLost=!0,r.game.events.emit(l.CONTEXT_LOST,r),t.preventDefault()},this.contextRestoredHandler=function(){r.contextLost=!1,r.init(r.config),r.game.events.emit(l.CONTEXT_RESTORED,r)},s.addEventListener("webglcontextlost",this.contextLostHandler,!1),s.addEventListener("webglcontextrestored",this.contextRestoredHandler,!1),i.context=e;for(var a=0;a<=27;a++)this.blendModes.push({func:[e.ONE,e.ONE_MINUS_SRC_ALPHA],equation:e.FUNC_ADD});this.blendModes[1].func=[e.ONE,e.DST_ALPHA],this.blendModes[2].func=[e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA],this.blendModes[3].func=[e.ONE,e.ONE_MINUS_SRC_COLOR],this.blendModes[17]={func:[e.ZERO,e.ONE_MINUS_SRC_ALPHA],equation:e.FUNC_REVERSE_SUBTRACT},this.glFormats[0]=e.BYTE,this.glFormats[1]=e.SHORT,this.glFormats[2]=e.UNSIGNED_BYTE,this.glFormats[3]=e.UNSIGNED_SHORT,this.glFormats[4]=e.FLOAT,this.glFuncMap={mat2:{func:e.uniformMatrix2fv,length:1,matrix:!0},mat3:{func:e.uniformMatrix3fv,length:1,matrix:!0},mat4:{func:e.uniformMatrix4fv,length:1,matrix:!0},"1f":{func:e.uniform1f,length:1},"1fv":{func:e.uniform1fv,length:1},"1i":{func:e.uniform1i,length:1},"1iv":{func:e.uniform1iv,length:1},"2f":{func:e.uniform2f,length:2},"2fv":{func:e.uniform2fv,length:1},"2i":{func:e.uniform2i,length:2},"2iv":{func:e.uniform2iv,length:1},"3f":{func:e.uniform3f,length:3},"3fv":{func:e.uniform3fv,length:1},"3i":{func:e.uniform3i,length:3},"3iv":{func:e.uniform3iv,length:1},"4f":{func:e.uniform4f,length:4},"4fv":{func:e.uniform4fv,length:1},"4i":{func:e.uniform4i,length:4},"4iv":{func:e.uniform4iv,length:1}};var h=e.getSupportedExtensions();t.maxTextures&&-1!==t.maxTextures||(t.maxTextures=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),t.maxTextureSize||(t.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE)),this.compression=this.getCompressedTextures(),this.supportedExtensions=h;var u="ANGLE_instanced_arrays";this.instancedArraysExtension=h.indexOf(u)>-1?e.getExtension(u):null;var d="OES_vertex_array_object";this.vaoExtension=h.indexOf(d)>-1?e.getExtension(d):null,e.disable(e.DEPTH_TEST),e.disable(e.CULL_FACE),e.enable(e.BLEND),e.clearColor(n.redGL,n.greenGL,n.blueGL,n.alphaGL),this.mipmapFilter=e[t.mipmapFilter],this.maxTextures=m.checkShaderMax(e,t.maxTextures),this.textureIndexes=[];var f=this.tempTextures;if(Array.isArray(f))for(var v=0;a0&&s>0;if(o&&a){var h=o[0],l=o[1],u=o[2],c=o[3];a=h!==t||l!==e||u!==i||c!==s}a&&(this.flush(),r.scissor(t,n-e-s,i,s))},resetScissor:function(){var t=this.gl;t.enable(t.SCISSOR_TEST);var e=this.currentScissor;if(e){var i=e[0],s=e[1],n=e[2],r=e[3];n>0&&r>0&&t.scissor(i,this.drawingBufferHeight-s-r,n,r)}},popScissor:function(){var t=this.scissorStack;t.pop();var e=t[t.length-1];e&&this.setScissor(e[0],e[1],e[2],e[3]),this.currentScissor=e},hasActiveStencilMask:function(){var t=this.currentMask.mask,e=this.currentCameraMask.mask;return t&&t.isStencil||e&&e.isStencil},resetViewport:function(){var t=this.gl;t.viewport(0,0,this.width,this.height),this.drawingBufferHeight=t.drawingBufferHeight},setBlendMode:function(t,e){void 0===e&&(e=!1);var i=this.gl,s=this.blendModes[t];return!!(e||t!==o.BlendModes.SKIP_CHECK&&this.currentBlendMode!==t)&&(this.flush(),i.enable(i.BLEND),i.blendEquation(s.equation),s.func.length>2?i.blendFuncSeparate(s.func[0],s.func[1],s.func[2],s.func[3]):i.blendFunc(s.func[0],s.func[1]),this.currentBlendMode=t,!0)},addBlendMode:function(t,e){return this.blendModes.push({func:t,equation:e})-1},updateBlendMode:function(t,e,i){return this.blendModes[t]&&(this.blendModes[t].func=e,i&&(this.blendModes[t].equation=i)),this},removeBlendMode:function(t){return t>17&&this.blendModes[t]&&this.blendModes.splice(t,1),this},setBlankTexture:function(){this.setTexture2D(this.blankTexture.glTexture)},setTextureSource:function(t){if(this.pipelines.forceZero())return this.setTextureZero(t.glTexture,!0),0;var e=this.gl,i=this.currentActiveTexture;return t.glIndexCounter0)&&this.pipelines.setMulti().drawFillRect(e,i,s,r,m.getTintFromFloats(o.blueGL,o.greenGL,o.redGL,1),o.alphaGL)},getCurrentStencilMask:function(){var t=null,e=this.maskStack,i=this.currentCameraMask;return e.length>0?t=e[e.length-1]:i.mask&&i.mask.isStencil&&(t=i),t},postRenderCamera:function(t){var e=t.flashEffect,i=t.fadeEffect;if(e.isRunning||i.isRunning||i.isComplete){var s=this.pipelines.setMulti();e.postRenderWebGL(s,m.getTintFromFloats),i.postRenderWebGL(s,m.getTintFromFloats)}t.dirty=!1,this.popScissor(),t.mask&&(this.currentCameraMask.mask=null,t.mask.postRenderWebGL(this,t._maskCamera)),this.pipelines.postBatchCamera(t),t.emit(n.POST_RENDER,t)},preRender:function(){if(!this.contextLost){var t=this.gl;if(t.bindFramebuffer(t.FRAMEBUFFER,null),this.config.clearBeforeRender){var e=this.config.backgroundColor;t.clearColor(e.redGL,e.greenGL,e.blueGL,e.alphaGL),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT|t.STENCIL_BUFFER_BIT)}t.enable(t.SCISSOR_TEST),this.currentScissor=this.defaultScissor,this.scissorStack.length=0,this.scissorStack.push(this.currentScissor),this.game.scene.customViewports&&t.scissor(0,this.drawingBufferHeight-this.height,this.width,this.height),this.currentMask.mask=null,this.currentCameraMask.mask=null,this.maskStack.length=0,this.textureFlush=0,this.emit(h.PRE_RENDER)}},render:function(t,e,i){if(!this.contextLost){var s=e.length;if(this.emit(h.RENDER,t,i),this.preRenderCamera(i),0===s)return this.setBlendMode(o.BlendModes.NORMAL),void this.postRenderCamera(i);this.currentType="";for(var n=this.currentMask,r=0;r0&&(this.startActiveTexture++,this.currentActiveTexture=1)}},snapshot:function(t,e,i){return this.snapshotArea(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight,t,e,i)},snapshotArea:function(t,e,i,s,n,r,o){var a=this.snapshotState;return a.callback=n,a.type=r,a.encoder=o,a.getPixel=!1,a.x=t,a.y=e,a.width=Math.min(i,this.gl.drawingBufferWidth),a.height=Math.min(s,this.gl.drawingBufferHeight),this},snapshotPixel:function(t,e,i){return this.snapshotArea(t,e,1,1,i),this.snapshotState.getPixel=!0,this},snapshotFramebuffer:function(t,e,i,s,n,r,o,a,h,l,u){void 0===n&&(n=!1),void 0===r&&(r=0),void 0===o&&(o=0),void 0===a&&(a=e),void 0===h&&(h=i);var c=this.currentFramebuffer;this.snapshotArea(r,o,a,h,s,l,u);var d=this.snapshotState;return d.getPixel=n,d.isFramebuffer=!0,d.bufferWidth=e,d.bufferHeight=i,this.setFramebuffer(t),y(this.canvas,d),this.setFramebuffer(c),d.callback=null,d.isFramebuffer=!1,this},canvasToTexture:function(t,e,i,s){return void 0===i&&(i=!1),void 0===s&&(s=!1),e?this.updateCanvasTexture(t,e,s):this.createCanvasTexture(t,i,s)},createCanvasTexture:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var s=this.gl,n=s.NEAREST,r=s.NEAREST,o=t.width,a=t.height,h=s.CLAMP_TO_EDGE,l=u(o,a);return!e&&l&&(h=s.REPEAT),this.config.antialias&&(n=l?this.mipmapFilter:s.LINEAR,r=s.LINEAR),this.createTexture2D(0,n,r,h,h,s.RGBA,t,o,a,!0,!1,i)},updateCanvasTexture:function(t,e,i){void 0===i&&(i=!1);var s=this.gl,n=t.width,r=t.height;if(n>0&&r>0){s.activeTexture(s.TEXTURE0);var o=s.getParameter(s.TEXTURE_BINDING_2D);s.bindTexture(s.TEXTURE_2D,e),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,i),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,s.RGBA,s.UNSIGNED_BYTE,t),e.width=n,e.height=r,o&&s.bindTexture(s.TEXTURE_2D,o)}return e},createVideoTexture:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var s=this.gl,n=s.NEAREST,r=s.NEAREST,o=t.videoWidth,a=t.videoHeight,h=s.CLAMP_TO_EDGE,l=u(o,a);return!e&&l&&(h=s.REPEAT),this.config.antialias&&(n=l?this.mipmapFilter:s.LINEAR,r=s.LINEAR),this.createTexture2D(0,n,r,h,h,s.RGBA,t,o,a,!0,!0,i)},updateVideoTexture:function(t,e,i){void 0===i&&(i=!1);var s=this.gl,n=t.videoWidth,r=t.videoHeight;if(n>0&&r>0){s.activeTexture(s.TEXTURE0);var o=s.getParameter(s.TEXTURE_BINDING_2D);s.bindTexture(s.TEXTURE_2D,e),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,i),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,s.RGBA,s.UNSIGNED_BYTE,t),e.width=n,e.height=r,o&&s.bindTexture(s.TEXTURE_2D,o)}return e},setTextureFilter:function(t,e){var i=this.gl,s=[i.LINEAR,i.NEAREST][e];i.activeTexture(i.TEXTURE0);var n=i.getParameter(i.TEXTURE_BINDING_2D);return i.bindTexture(i.TEXTURE_2D,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,s),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,s),n&&i.bindTexture(i.TEXTURE_2D,n),this},getMaxTextureSize:function(){return this.config.maxTextureSize},destroy:function(){this.canvas.removeEventListener("webglcontextlost",this.contextLostHandler,!1),this.canvas.removeEventListener("webglcontextrestored",this.contextRestoredHandler,!1);for(var t=this.gl,e=this.tempTextures,i=0;i{var s=i(56694),n=i(72632),r=i(71402),o=new s({initialize:function(t,e,i,s,n){this.pipeline=t,this.name=e,this.renderer=t.renderer,this.gl=this.renderer.gl,this.program=this.renderer.createProgram(i,s),this.attributes,this.vertexComponentCount=0,this.vertexSize=0,this.uniforms={},this.createAttributes(n),this.createUniforms()},createAttributes:function(t){var e=0,i=0,s=[];this.vertexComponentCount=0;for(var o=0;o=0?(e.enableVertexAttribArray(p),e.vertexAttribPointer(p,a,h,d,i,l),o.enabled=!0,o.location=p):-1!==p&&e.disableVertexAttribArray(p)}else u?e.vertexAttribPointer(c,a,h,d,i,l):!u&&c>-1&&(e.disableVertexAttribArray(c),o.location=-1)}return this},createUniforms:function(){var t,e,i,s=this.gl,n=this.program,r=this.uniforms,o=s.getProgramParameter(n,s.ACTIVE_UNIFORMS);for(t=0;t0&&(e=e.substr(0,h),r.hasOwnProperty(e)||null!==(i=s.getUniformLocation(n,e))&&(r[e]={name:e,location:i,value1:null,value2:null,value3:null,value4:null}))}}return this},hasUniform:function(t){return this.uniforms.hasOwnProperty(t)},resetUniform:function(t){var e=this.uniforms[t];return e&&(e.value1=null,e.value2=null,e.value3=null,e.value4=null),this},setUniform1:function(t,e,i,s){var n=this.uniforms[e];return n?((s||n.value1!==i)&&(n.value1=i,this.renderer.setProgram(this.program),t.call(this.gl,n.location,i),this.pipeline.currentShader=this),this):this},setUniform2:function(t,e,i,s,n){var r=this.uniforms[e];return r?((n||r.value1!==i||r.value2!==s)&&(r.value1=i,r.value2=s,this.renderer.setProgram(this.program),t.call(this.gl,r.location,i,s),this.pipeline.currentShader=this),this):this},setUniform3:function(t,e,i,s,n,r){var o=this.uniforms[e];return o?((r||o.value1!==i||o.value2!==s||o.value3!==n)&&(o.value1=i,o.value2=s,o.value3=n,this.renderer.setProgram(this.program),t.call(this.gl,o.location,i,s,n),this.pipeline.currentShader=this),this):this},setUniform4:function(t,e,i,s,n,r,o){var a=this.uniforms[e];return a?((o||a.value1!==i||a.value2!==s||a.value3!==n||a.value4!==r)&&(a.value1=i,a.value2=s,a.value3=n,a.value4=r,this.renderer.setProgram(this.program),t.call(this.gl,a.location,i,s,n,r),this.pipeline.currentShader=this),this):this},set1f:function(t,e){return this.setUniform1(this.gl.uniform1f,t,e)},set2f:function(t,e,i){return this.setUniform2(this.gl.uniform2f,t,e,i)},set3f:function(t,e,i,s){return this.setUniform3(this.gl.uniform3f,t,e,i,s)},set4f:function(t,e,i,s,n){return this.setUniform4(this.gl.uniform4f,t,e,i,s,n)},set1fv:function(t,e){return this.setUniform1(this.gl.uniform1fv,t,e,!0)},set2fv:function(t,e){return this.setUniform1(this.gl.uniform2fv,t,e,!0)},set3fv:function(t,e){return this.setUniform1(this.gl.uniform3fv,t,e,!0)},set4fv:function(t,e){return this.setUniform1(this.gl.uniform4fv,t,e,!0)},set1iv:function(t,e){return this.setUniform1(this.gl.uniform1iv,t,e,!0)},set2iv:function(t,e){return this.setUniform1(this.gl.uniform2iv,t,e,!0)},set3iv:function(t,e){return this.setUniform1(this.gl.uniform3iv,t,e,!0)},set4iv:function(t,e){return this.setUniform1(this.gl.uniform4iv,t,e,!0)},set1i:function(t,e){return this.setUniform1(this.gl.uniform1i,t,e)},set2i:function(t,e,i){return this.setUniform2(this.gl.uniform2i,t,e,i)},set3i:function(t,e,i,s){return this.setUniform3(this.gl.uniform3i,t,e,i,s)},set4i:function(t,e,i,s,n){return this.setUniform4(this.gl.uniform4i,t,e,i,s,n)},setMatrix2fv:function(t,e,i){return this.setUniform2(this.gl.uniformMatrix2fv,t,e,i,!0)},setMatrix3fv:function(t,e,i){return this.setUniform2(this.gl.uniformMatrix3fv,t,e,i,!0)},setMatrix4fv:function(t,e,i){return this.setUniform2(this.gl.uniformMatrix4fv,t,e,i,!0)},destroy:function(){this.gl.deleteProgram(this.program),this.pipeline=null,this.renderer=null,this.gl=null,this.program=null,this.attributes=null,this.uniforms=null}});t.exports=o},71402:t=>{t.exports={BYTE:{enum:5120,size:1},UNSIGNED_BYTE:{enum:5121,size:1},SHORT:{enum:5122,size:2},UNSIGNED_SHORT:{enum:5123,size:2},INT:{enum:5124,size:4},UNSIGNED_INT:{enum:5125,size:4},FLOAT:{enum:5126,size:4}}},55478:(t,e,i)=>{var s=i(71402),n=i(98611),r={PipelineManager:i(35217),Pipelines:i(62253),RenderTarget:i(37410),Utils:i(75512),WebGLPipeline:i(44775),WebGLRenderer:i(11857),WebGLShader:i(71305)};r=n(!1,r,s),t.exports=r},5583:(t,e,i)=>{var s=i(56694),n=i(72632),r=i(91679),o=i(89053),a=i(71402),h=i(44775),l=new s({Extends:h,initialize:function(t){t.fragShader=n(t,"fragShader",r),t.vertShader=n(t,"vertShader",o),t.batchSize=n(t,"batchSize",1),t.vertices=n(t,"vertices",[-1,1,-1,-7,7,1]),t.attributes=n(t,"attributes",[{name:"inPosition",size:2,type:a.FLOAT}]),h.call(this,t)},boot:function(){h.prototype.boot.call(this),this.set1i("uMainSampler",0),this.set1i("uMaskSampler",1)},resize:function(t,e){h.prototype.resize.call(this,t,e),this.set2f("uResolution",t,e)},beginMask:function(t,e,i){var s=this.gl;if(t.bitmapMask&&s){var n=this.renderer;n.flush(),n.pushFramebuffer(t.mainFramebuffer),s.disable(s.STENCIL_TEST),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT),n.currentCameraMask.mask!==t&&(n.currentMask.mask=t,n.currentMask.camera=i)}},endMask:function(t,e){var i=this.gl,s=this.renderer,n=t.bitmapMask;if(n&&i){s.flush(),s.pushFramebuffer(t.maskFramebuffer),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),s.setBlendMode(0,!0),n.renderWebGL(s,n,e),s.flush(),s.popFramebuffer(),s.popFramebuffer();var r=s.getCurrentStencilMask();r?(i.enable(i.STENCIL_TEST),r.mask.applyStencil(s,r.camera,!0)):s.currentMask.mask=null,s.pipelines.set(this),i.activeTexture(i.TEXTURE1),i.bindTexture(i.TEXTURE_2D,t.maskTexture),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,t.mainTexture),this.set1i("uInvertMaskAlpha",t.invertAlpha),i.drawArrays(this.topology,0,3),s.resetTextures()}}});t.exports=l},67589:(t,e,i)=>{var s=i(56694),n=i(11117),r=i(72632),o=i(37699),a=i(28739),h=i(69360),l=i(71402),u=i(44775),c=new s({Extends:u,initialize:function(t){t.fragShader=r(t,"fragShader",o),t.vertShader=r(t,"vertShader",a),t.attributes=r(t,"attributes",[{name:"inPosition",size:2},{name:"inColor",size:4,type:l.UNSIGNED_BYTE,normalized:!0}]),u.call(this,t),this.calcMatrix=new h,this.tempTriangle=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}],this.strokeTint={TL:0,TR:0,BL:0,BR:0},this.fillTint={TL:0,TR:0,BL:0,BR:0},this.currentFrame={u0:0,v0:0,u1:1,v1:1},this.firstQuad=[0,0,0,0,0],this.prevQuad=[0,0,0,0,0],this.polygonCache=[]},batchFillRect:function(t,e,i,s,n,r){this.renderer.pipelines.set(this);var o=this.calcMatrix;r&&r.multiply(n,o);var a=t+i,h=e+s,l=o.getX(t,e),u=o.getY(t,e),c=o.getX(t,h),d=o.getY(t,h),p=o.getX(a,h),f=o.getY(a,h),v=o.getX(a,e),g=o.getY(a,e),m=this.fillTint;this.batchQuad(l,u,c,d,p,f,v,g,m.TL,m.TR,m.BL,m.BR)},batchFillTriangle:function(t,e,i,s,n,r,o,a){this.renderer.pipelines.set(this);var h=this.calcMatrix;a&&a.multiply(o,h);var l=h.getX(t,e),u=h.getY(t,e),c=h.getX(i,s),d=h.getY(i,s),p=h.getX(n,r),f=h.getY(n,r),v=this.fillTint;this.batchTri(l,u,c,d,p,f,v.TL,v.TR,v.BL)},batchStrokeTriangle:function(t,e,i,s,n,r,o,a,h){var l=this.tempTriangle;l[0].x=t,l[0].y=e,l[0].width=o,l[1].x=i,l[1].y=s,l[1].width=o,l[2].x=n,l[2].y=r,l[2].width=o,l[3].x=t,l[3].y=e,l[3].width=o,this.batchStrokePath(l,o,!1,a,h)},batchFillPath:function(t,e,i){this.renderer.pipelines.set(this);var s=this.calcMatrix;i&&i.multiply(e,s);for(var r,o,a=t.length,h=this.polygonCache,l=this.fillTint.TL,u=this.fillTint.TR,c=this.fillTint.BL,d=0;d0&&U[4]?this.batchQuad(F,D,R,P,U[0],U[1],U[2],U[3],I,B,N,Y):(X[0]=F,X[1]=D,X[2]=R,X[3]=P,X[4]=1),h&&X[4]?this.batchQuad(C,M,O,L,X[0],X[1],X[2],X[3],I,B,N,Y):(U[0]=C,U[1]=M,U[2]=O,U[3]=L,U[4]=1)}},batchVert:function(t,e,i){var s=this.vertexViewF32,n=this.vertexViewU32,r=this.vertexCount*this.currentShader.vertexComponentCount-1;s[++r]=t,s[++r]=e,n[++r]=i,this.vertexCount++},batchQuad:function(t,e,i,s,n,r,o,a,h,l,u,c){var d=!1;return this.shouldFlush(6)&&(this.flush(),d=!0),this.batchVert(t,e,h),this.batchVert(i,s,u),this.batchVert(n,r,c),this.batchVert(t,e,h),this.batchVert(n,r,c),this.batchVert(o,a,l),d},batchTri:function(t,e,i,s,n,r,o,a,h){var l=!1;return this.shouldFlush(3)&&(this.flush(),l=!0),this.batchVert(t,e,o),this.batchVert(i,s,a),this.batchVert(n,r,h),l},destroy:function(){return u.prototype.destroy.call(this),this.polygonCache=null,this}});t.exports=c},66901:(t,e,i)=>{var s=i(56694),n=i(72632),r=i(65045),o=i(77310),a=i(93736),h=i(44775),l=10,u=new a,c=new s({Extends:o,initialize:function(t){l=t.game.renderer.config.maxLights;for(var e=n(t,"fragShader",r),i=[],s=1;s<=l;s++)i.push({name:"lights"+s,fragShader:e.replace("%LIGHT_COUNT%",s.toString())});t.shaders=i,o.call(this,t),this.inverseRotationMatrix=new Float32Array([1,0,0,0,1,0,0,0,1]),this.defaultNormalMap,this.lightsActive=!0},boot:function(){h.prototype.boot.call(this);var t=this.gl,e=t.createTexture();t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,e),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array([127,127,255,255])),this.defaultNormalMap={glTexture:e};for(var i=0;i0&&this.flush();var e=this.inverseRotationMatrix;if(t){var i=-t,s=Math.cos(i),n=Math.sin(i);e[1]=n,e[3]=-n,e[0]=e[4]=s}else e[0]=e[4]=1,e[1]=e[3]=0;this.setMatrix3fv("uInverseRotationMatrix",!1,e),this.currentNormalMapRotation=t}},setTexture2D:function(t,e){var i=this.renderer;void 0===t&&(t=i.tempTextures[0]);var s=this.getNormalMap(e);i.isNewNormalMap(t,s)&&(this.flush(),i.setTextureZero(t),i.setNormalMap(s));var n=e?e.rotation:0;return this.setNormalMapRotation(n),this.currentUnit=0,0},setGameObject:function(t,e){void 0===e&&(e=t.frame);var i=this.renderer,s=e.glTexture,n=this.getNormalMap(t);return i.isNewNormalMap()&&(this.flush(),i.setTextureZero(s),i.setNormalMap(n)),this.setNormalMapRotation(t.rotation),this.currentUnit=0,0},getNormalMap:function(t){var e;return t?t.displayTexture?e=t.displayTexture.dataSource[t.displayFrame.sourceIndex]:t.texture?e=t.texture.dataSource[t.frame.sourceIndex]:t.tileset&&(e=Array.isArray(t.tileset)?t.tileset[0].image.dataSource[0]:t.tileset.image.dataSource[0]):e=this.defaultNormalMap,e||(e=this.defaultNormalMap),e.glTexture},batchSprite:function(t,e,i){this.lightsActive&&o.prototype.batchSprite.call(this,t,e,i)},batchTexture:function(t,e,i,s,n,r,a,h,l,u,c,d,p,f,v,g,m,y,x,T,w,b,E,S,A,_,C,M,R,P,O,L){this.lightsActive&&o.prototype.batchTexture.call(this,t,e,i,s,n,r,a,h,l,u,c,d,p,f,v,g,m,y,x,T,w,b,E,S,A,_,C,M,R,P,O,L)},batchTextureFrame:function(t,e,i,s,n,r,a){this.lightsActive&&o.prototype.batchTextureFrame.call(this,t,e,i,s,n,r,a)}});c.LIGHT_COUNT=l,t.exports=c},77310:(t,e,i)=>{var s=i(56694),n=i(11117),r=i(72632),o=i(53787),a=i(15968),h=i(69360),l=i(75512),u=i(71402),c=i(44775),d=new s({Extends:c,initialize:function(t){var e=t.game.renderer,i=r(t,"fragShader",o);t.fragShader=l.parseFragmentShaderMaxTextures(i,e.maxTextures),t.vertShader=r(t,"vertShader",a),t.attributes=r(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexId"},{name:"inTintEffect"},{name:"inTint",size:4,type:u.UNSIGNED_BYTE,normalized:!0}]),c.call(this,t),this._tempMatrix1=new h,this._tempMatrix2=new h,this._tempMatrix3=new h,this.calcMatrix=new h,this.tempTriangle=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}],this.strokeTint={TL:0,TR:0,BL:0,BR:0},this.fillTint={TL:0,TR:0,BL:0,BR:0},this.currentFrame={u0:0,v0:0,u1:1,v1:1},this.firstQuad=[0,0,0,0,0],this.prevQuad=[0,0,0,0,0],this.polygonCache=[]},boot:function(){c.prototype.boot.call(this),this.currentShader.set1iv("uMainSampler",this.renderer.textureIndexes)},batchSprite:function(t,e,i){this.manager.set(this,t);var s=this._tempMatrix1,n=this._tempMatrix2,r=this._tempMatrix3,o=t.frame,a=o.glTexture,h=o.u0,u=o.v0,c=o.u1,d=o.v1,p=o.x,f=o.y,v=o.cutWidth,g=o.cutHeight,m=o.customPivot,y=t.displayOriginX,x=t.displayOriginY,T=-y+p,w=-x+f;if(t.isCropped){var b=t._crop;b.flipX===t.flipX&&b.flipY===t.flipY||o.updateCropUVs(b,t.flipX,t.flipY),h=b.u0,u=b.v0,c=b.u1,d=b.v1,v=b.width,g=b.height,T=-y+(p=b.x),w=-x+(f=b.y)}var E=1,S=1;t.flipX&&(m||(T+=-o.realWidth+2*y),E=-1),(t.flipY||o.source.isGLTexture&&!a.flipY)&&(m||(w+=-o.realHeight+2*x),S=-1),n.applyITRS(t.x,t.y,t.rotation,t.scaleX*E,t.scaleY*S),s.copyFrom(e.matrix),i?(s.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),n.e=t.x,n.f=t.y):(n.e-=e.scrollX*t.scrollFactorX,n.f-=e.scrollY*t.scrollFactorY),s.multiply(n,r);var A=T+v,_=w+g,C=e.roundPixels,M=r.getXRound(T,w,C),R=r.getXRound(T,_,C),P=r.getXRound(A,_,C),O=r.getXRound(A,w,C),L=r.getYRound(T,w,C),F=r.getYRound(T,_,C),D=r.getYRound(A,_,C),k=r.getYRound(A,w,C),I=l.getTintAppendFloatAlpha,B=e.alpha,N=I(t.tintTopLeft,B*t._alphaTL),Y=I(t.tintTopRight,B*t._alphaTR),U=I(t.tintBottomLeft,B*t._alphaBL),X=I(t.tintBottomRight,B*t._alphaBR);this.shouldFlush(6)&&this.flush();var z=this.setGameObject(t,o);this.manager.preBatch(t),this.batchQuad(t,M,L,R,F,P,D,O,k,h,u,c,d,N,Y,U,X,t.tintFill,a,z),this.manager.postBatch(t)},batchTexture:function(t,e,i,s,n,r,o,a,h,l,u,c,d,p,f,v,g,m,y,x,T,w,b,E,S,A,_,C,M,R,P,O){this.manager.set(this,t);var L=this._tempMatrix1,F=this._tempMatrix2,D=this._tempMatrix3,k=m/i+_,I=y/s+C,B=(m+x)/i+_,N=(y+T)/s+C,Y=o,U=a,X=-v,z=-g;if(t.isCropped){var G=t._crop,V=G.width,W=G.height;Y=V,U=W,o=V,a=W;var H=m=G.x,j=y=G.y;c&&(H=x-G.x-V),d&&(j=T-G.y-W),k=H/i+_,I=j/s+C,B=(H+V)/i+_,N=(j+W)/s+C,X=-v+m,z=-g+y}c&&(Y*=-1,X+=o),(d^=!P&&e.isRenderTexture?1:0)&&(U*=-1,z+=a);var q=X+Y,K=z+U;F.applyITRS(n,r,u,h,l),L.copyFrom(M.matrix),R?(L.multiplyWithOffset(R,-M.scrollX*p,-M.scrollY*f),F.e=n,F.f=r):(F.e-=M.scrollX*p,F.f-=M.scrollY*f),L.multiply(F,D);var Z=M.roundPixels,J=D.getXRound(X,z,Z),Q=D.getYRound(X,z,Z),$=D.getXRound(X,K,Z),tt=D.getYRound(X,K,Z),et=D.getXRound(q,K,Z),it=D.getYRound(q,K,Z),st=D.getXRound(q,z,Z),nt=D.getYRound(q,z,Z);void 0===O&&(O=this.renderer.setTexture2D(e)),t&&this.manager.preBatch(t),this.batchQuad(t,J,Q,$,tt,et,it,st,nt,k,I,B,N,w,b,E,S,A,e,O),t&&this.manager.postBatch(t)},batchTextureFrame:function(t,e,i,s,n,r,o){this.manager.set(this);var a=this._tempMatrix1.copyFrom(r),h=this._tempMatrix2,u=e+t.width,c=i+t.height;o?a.multiply(o,h):h=a;var d=h.getX(e,i),p=h.getY(e,i),f=h.getX(e,c),v=h.getY(e,c),g=h.getX(u,c),m=h.getY(u,c),y=h.getX(u,i),x=h.getY(u,i),T=this.renderer.setTextureSource(t.source);s=l.getTintAppendFloatAlpha(s,n),this.batchQuad(null,d,p,f,v,g,m,y,x,t.u0,t.v0,t.u1,t.v1,s,s,s,s,0,t.glTexture,T)},batchFillRect:function(t,e,i,s,n,r){this.renderer.pipelines.set(this);var o=this.calcMatrix;r&&r.multiply(n,o);var a=t+i,h=e+s,l=o.getX(t,e),u=o.getY(t,e),c=o.getX(t,h),d=o.getY(t,h),p=o.getX(a,h),f=o.getY(a,h),v=o.getX(a,e),g=o.getY(a,e),m=this.fillTint;this.batchQuad(null,l,u,c,d,p,f,v,g,0,0,1,1,m.TL,m.TR,m.BL,m.BR,2)},batchFillTriangle:function(t,e,i,s,n,r,o,a){this.renderer.pipelines.set(this);var h=this.calcMatrix;a&&a.multiply(o,h);var l=h.getX(t,e),u=h.getY(t,e),c=h.getX(i,s),d=h.getY(i,s),p=h.getX(n,r),f=h.getY(n,r),v=this.fillTint;this.batchTri(null,l,u,c,d,p,f,0,0,1,1,v.TL,v.TR,v.BL,2)},batchStrokeTriangle:function(t,e,i,s,n,r,o,a,h){var l=this.tempTriangle;l[0].x=t,l[0].y=e,l[0].width=o,l[1].x=i,l[1].y=s,l[1].width=o,l[2].x=n,l[2].y=r,l[2].width=o,l[3].x=t,l[3].y=e,l[3].width=o,this.batchStrokePath(l,o,!1,a,h)},batchFillPath:function(t,e,i){this.renderer.pipelines.set(this);var s=this.calcMatrix;i&&i.multiply(e,s);for(var r,o,a=t.length,h=this.polygonCache,l=this.fillTint.TL,u=this.fillTint.TR,c=this.fillTint.BL,d=0;d0&&U[4]?this.batchQuad(null,F,D,R,P,U[0],U[1],U[2],U[3],0,0,1,1,I,B,N,Y,2):(X[0]=F,X[1]=D,X[2]=R,X[3]=P,X[4]=1),h&&X[4]?this.batchQuad(null,C,M,O,L,X[0],X[1],X[2],X[3],0,0,1,1,I,B,N,Y,2):(U[0]=C,U[1]=M,U[2]=O,U[3]=L,U[4]=1)}}});t.exports=d},10919:(t,e,i)=>{var s=i(56694),n=i(72632),r=i(83327),o=i(54677),a=i(44775),h=new s({Extends:a,initialize:function(t){t.vertShader=n(t,"vertShader",o),t.fragShader=n(t,"fragShader",r),t.attributes=n(t,"attributes",[{name:"inPosition",size:2},{name:"inLightPosition",size:2},{name:"inLightRadius"},{name:"inLightAttenuation"},{name:"inLightColor",size:4}]),a.call(this,t)},onRender:function(t,e){this.set2f("uResolution",this.width,this.height),this.set1f("uCameraZoom",e.zoom)},batchPointLight:function(t,e,i,s,n,r,o,a,h,l,u,c){var d=t.color,p=t.intensity,f=t.radius,v=t.attenuation,g=d.r*p,m=d.g*p,y=d.b*p,x=e.alpha*t.alpha;this.shouldFlush(6)&&this.flush(),this.batchLightVert(i,s,u,c,f,v,g,m,y,x),this.batchLightVert(n,r,u,c,f,v,g,m,y,x),this.batchLightVert(o,a,u,c,f,v,g,m,y,x),this.batchLightVert(i,s,u,c,f,v,g,m,y,x),this.batchLightVert(o,a,u,c,f,v,g,m,y,x),this.batchLightVert(h,l,u,c,f,v,g,m,y,x)},batchLightVert:function(t,e,i,s,n,r,o,a,h,l){var u=this.vertexViewF32,c=this.vertexCount*this.currentShader.vertexComponentCount-1;u[++c]=t,u[++c]=e,u[++c]=i,u[++c]=s,u[++c]=n,u[++c]=r,u[++c]=o,u[++c]=a,u[++c]=h,u[++c]=l,this.vertexCount++}});t.exports=h},80486:(t,e,i)=>{var s=i(56694),n=i(65246),r=i(72632),o=i(12569),a=i(99365),h=i(44775),l=new s({Extends:h,initialize:function(t){t.renderTarget=r(t,"renderTarget",1),t.fragShader=r(t,"fragShader",o),t.vertShader=r(t,"vertShader",a),t.attributes=r(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]),t.batchSize=1,t.vertices=[-1,-1,0,0,-1,1,0,1,1,1,1,1,-1,-1,0,0,1,1,1,1,1,-1,1,0],h.call(this,t),this.isPostFX=!0,this.gameObject,this.colorMatrix=new n,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2,this.renderer.isBooted&&(this.manager=this.renderer.pipelines,this.boot())},boot:function(){h.prototype.boot.call(this);var t=this.manager.UTILITY_PIPELINE;this.fullFrame1=t.fullFrame1,this.fullFrame2=t.fullFrame2,this.halfFrame1=t.halfFrame1,this.halfFrame2=t.halfFrame2,this.set1i("uMainSampler",0)},onDraw:function(t){this.bindAndDraw(t)},copyFrame:function(t,e,i,s,n){this.manager.copyFrame(t,e,i,s,n)},copyToGame:function(t){this.manager.copyToGame(t)},drawFrame:function(t,e,i){this.manager.drawFrame(t,e,i,this.colorMatrix)},blendFrames:function(t,e,i,s,n){this.manager.blendFrames(t,e,i,s,n)},blendFramesAdditive:function(t,e,i,s,n){this.manager.blendFramesAdditive(t,e,i,s,n)},clearFrame:function(t,e){this.manager.clearFrame(t,e)},blitFrame:function(t,e,i,s,n,r){this.manager.blitFrame(t,e,i,s,n,r)},copyFrameRect:function(t,e,i,s,n,r,o,a){this.manager.copyFrameRect(t,e,i,s,n,r,o,a)},bindAndDraw:function(t,e,i,s,n){void 0===i&&(i=!0),void 0===s&&(s=!0);var r=this.gl,o=this.renderer;this.bind(n),this.set1i("uMainSampler",0),e?(r.viewport(0,0,e.width,e.height),r.bindFramebuffer(r.FRAMEBUFFER,e.framebuffer),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e.texture,0),i&&(s?r.clearColor(0,0,0,0):r.clearColor(0,0,0,1),r.clear(r.COLOR_BUFFER_BIT))):(o.popFramebuffer(!1,!1,!1),o.currentFramebuffer||r.viewport(0,0,o.width,o.height)),r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,t.texture),r.bufferData(r.ARRAY_BUFFER,this.vertexData,r.STATIC_DRAW),r.drawArrays(r.TRIANGLES,0,6),e?(r.bindTexture(r.TEXTURE_2D,null),r.bindFramebuffer(r.FRAMEBUFFER,null)):o.resetTextures()}});t.exports=l},21213:(t,e,i)=>{var s=i(56694),n=i(72632),r=i(77310),o=new s({Extends:r,initialize:function(t){t.topology=5,t.batchSize=n(t,"batchSize",256),r.call(this,t)}});t.exports=o},51212:(t,e,i)=>{var s=i(56694),n=i(72632),r=i(77310),o=i(85060),a=i(18166),h=i(44775),l=new s({Extends:r,initialize:function(t){t.fragShader=n(t,"fragShader",o),t.vertShader=n(t,"vertShader",a),t.forceZero=!0,r.call(this,t)},boot:function(){h.prototype.boot.call(this),this.set1i("uMainSampler",0)}});t.exports=l},38964:(t,e,i)=>{var s=i(95723),n=i(79993),r=i(56694),o=i(72632),a=i(77310),h=i(12569),l=i(74118),u=i(37410),c=i(85060),d=i(18166),p=i(69360),f=i(71402),v=i(44775),g=new r({Extends:v,initialize:function(t){t.attributes=o(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexId"},{name:"inTintEffect"},{name:"inTint",size:4,type:f.UNSIGNED_BYTE,normalized:!0}]);var e=o(t,"fragShader",h),i=o(t,"vertShader",d),s=o(t,"drawShader",h),n=[{name:"DrawSprite",fragShader:c,vertShader:d},{name:"CopySprite",fragShader:e,vertShader:i},{name:"DrawGame",fragShader:s,vertShader:d}],r=o(t,"shaders",[]);t.shaders=n.concat(r),t.vertShader||(t.vertShader=i),t.batchSize=1,v.call(this,t),this.isSpriteFX=!0,this._tempMatrix1=new p,this._tempMatrix2=new p,this._tempMatrix3=new p,this.drawSpriteShader,this.copyShader,this.gameShader,this.quadVertexData,this.quadVertexBuffer,this.quadVertexViewF32,this.spriteBounds=new l,this.targetBounds=new l,this.fsTarget,this.tempSprite,this.renderer.isBooted&&(this.manager=this.renderer.pipelines,this.boot())},boot:function(){v.prototype.boot.call(this);var t=this.shaders,e=this.renderer;this.drawSpriteShader=t[0],this.copyShader=t[1],this.gameShader=t[2],this.fsTarget=new u(e,e.width,e.height,1,0,!0,!0),this.renderTargets=this.manager.renderTargets.concat(this.fsTarget);var i=new ArrayBuffer(168);this.quadVertexData=i,this.quadVertexViewF32=new Float32Array(i),this.quadVertexBuffer=e.createVertexBuffer(i,this.gl.STATIC_DRAW),this.onResize(e.width,e.height),this.currentShader=this.copyShader},onResize:function(t,e){var i=this.quadVertexViewF32;i[1]=e,i[22]=e,i[14]=t,i[28]=t,i[35]=t,i[36]=e},batchSprite:function(t,e,i){a.prototype.batchSprite.call(this,t,e,i)},batchTexture:function(t,e,i,s,n,r,o,h,l,u,c,d,p,f,v,g,m,y,x,T,w,b,E,S,A,_,C,M,R,P,O,L){a.prototype.batchTexture.call(this,t,e,i,s,n,r,o,h,l,u,c,d,true,f,v,g,m,y,x,T,w,b,E,S,A,_,C,M,R,P,O,L)},batchQuad:function(t,e,i,s,r,o,a,h,l,u,c,d,p,f,v,g,m,y,x){var T=Math.min(e,s,o,h),w=Math.min(i,r,a,l),b=Math.max(e,s,o,h)-T,E=Math.max(i,r,a,l)-w,S=this.spriteBounds.setTo(T,w,b,E),A=t.fxPadding,_=b+2*A,C=E+2*A,M=Math.abs(Math.max(_,C)),R=this.manager.getRenderTarget(M),P=this.targetBounds.setTo(0,0,R.width,R.height);n(P,S.centerX,S.centerY),this.tempSprite=t;var O=this.gl,L=this.renderer;this.setShader(this.drawSpriteShader),this.set1i("uMainSampler",0),this.flipProjectionMatrix(!0),this.onDrawSprite(t,R),t.onFX(this);var F=this.fsTarget;return L.setTextureZero(x),O.viewport(0,0,L.width,L.height),O.bindFramebuffer(O.FRAMEBUFFER,F.framebuffer),O.framebufferTexture2D(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_2D,F.texture,0),O.clearColor(0,0,0,0),O.clear(O.COLOR_BUFFER_BIT),this.batchVert(e,i,u,c,0,y,f),this.batchVert(s,r,u,p,0,y,g),this.batchVert(o,a,d,p,0,y,m),this.batchVert(e,i,u,c,0,y,f),this.batchVert(o,a,d,p,0,y,m),this.batchVert(h,l,d,c,0,y,v),this.flush(),this.flipProjectionMatrix(!1),L.clearTextureZero(),O.activeTexture(O.TEXTURE0),O.bindTexture(O.TEXTURE_2D,R.texture),O.copyTexSubImage2D(O.TEXTURE_2D,0,0,0,P.x,P.y,P.width,P.height),O.bindFramebuffer(O.FRAMEBUFFER,null),O.bindTexture(O.TEXTURE_2D,null),this.onBatch(t),this.currentShader=this.copyShader,this.onDraw(R,this.manager.getSwapRenderTarget()),!0},onDrawSprite:function(){},onCopySprite:function(){},copySprite:function(t,e,i,n,r,o){void 0===i&&(i=!0),void 0===n&&(n=!0),void 0===r&&(r=!1),void 0===o&&(o=this.copyShader);var a=this.gl,h=this.tempSprite;this.currentShader=o;var l=this.setVertexBuffer(this.quadVertexBuffer);if(o.bind(l,!1),this.set1i("uMainSampler",0),h.onFXCopy(this),this.onCopySprite(t,e,h),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,t.texture),t.height>e.height)a.viewport(0,0,t.width,t.height),this.setTargetUVs(t,e);else{var u=e.height-t.height;a.viewport(0,u,t.width,t.height),this.resetUVs()}if(a.bindFramebuffer(a.FRAMEBUFFER,e.framebuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,e.texture,0),i&&(a.clearColor(0,0,0,Number(!n)),a.clear(a.COLOR_BUFFER_BIT)),r){var c=this.renderer.currentBlendMode;this.renderer.setBlendMode(s.ERASE)}a.bufferData(a.ARRAY_BUFFER,this.quadVertexData,a.STATIC_DRAW),a.drawArrays(a.TRIANGLES,0,6),r&&this.renderer.setBlendMode(c),a.bindFramebuffer(a.FRAMEBUFFER,null)},blendFrames:function(t,e,i,s,n){this.manager.blendFrames(t,e,i,s,n)},blendFramesAdditive:function(t,e,i,s,n){this.manager.blendFramesAdditive(t,e,i,s,n)},drawToGame:function(t){this.currentShader=null,this.setShader(this.copyShader),this.bindAndDraw(t)},copyToGame:function(t){this.currentShader=null,this.setShader(this.gameShader),this.bindAndDraw(t)},bindAndDraw:function(t){var e=this.gl,i=this.renderer;this.set1i("uMainSampler",0),i.popFramebuffer(!1,!1,!1),i.currentFramebuffer||e.viewport(0,0,i.width,i.height),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t.texture);var s=this._tempMatrix1.loadIdentity(),n=this.targetBounds.x,r=this.targetBounds.y,o=n+t.width,a=r+t.height,h=s.getX(n,r),l=s.getX(n,a),u=s.getX(o,a),c=s.getX(o,r),d=s.getY(n,r),p=s.getY(n,a),f=s.getY(o,a),v=s.getY(o,r);this.batchVert(h,d,0,0,0,0,16777215),this.batchVert(l,p,0,1,0,0,16777215),this.batchVert(u,f,1,1,0,0,16777215),this.batchVert(h,d,0,0,0,0,16777215),this.batchVert(u,f,1,1,0,0,16777215),this.batchVert(c,v,1,0,0,0,16777215),this.flush(),i.resetTextures(),this.tempSprite=null},onDraw:function(t){this.drawToGame(t)},setUVs:function(t,e,i,s,n,r,o,a){var h=this.quadVertexViewF32;h[2]=t,h[3]=e,h[9]=i,h[10]=s,h[16]=n,h[17]=r,h[23]=t,h[24]=e,h[30]=n,h[31]=r,h[37]=o,h[38]=a},setTargetUVs:function(t,e){var i=e.height/t.height;i=i>.5?.5-(i-.5):.5-i+.5,this.setUVs(0,i,0,1+i,1,1+i,1,i)},resetUVs:function(){this.setUVs(0,0,0,1,1,1,1,0)},destroy:function(){this.gl.deleteBuffer(this.quadVertexBuffer),this._tempMatrix1.destroy(),this._tempMatrix2.destroy(),this._tempMatrix3.destroy(),this._tempMatrix1=null,this._tempMatrix1=null,this._tempMatrix1=null,this.drawSpriteShader=null,this.copyShader=null,this.gameShader=null,this.quadVertexData=null,this.quadVertexBuffer=null,this.quadVertexViewF32=null,this.fsTarget=null,this.tempSprite=null,v.prototype.destroy.call(this)}});t.exports=g},60848:(t,e,i)=>{var s=i(2529),n=i(95723),r=i(56694),o=i(65246),a=i(37486),h=i(79060),l=i(72632),u=i(98921),c=i(99365),d=i(44775),p=new r({Extends:d,initialize:function(t){t.renderTarget=l(t,"renderTarget",[{scale:1},{scale:1},{scale:.5},{scale:.5}]),t.vertShader=l(t,"vertShader",c),t.shaders=l(t,"shaders",[{name:"Copy",fragShader:h},{name:"AddBlend",fragShader:s},{name:"LinearBlend",fragShader:u},{name:"ColorMatrix",fragShader:a}]),t.attributes=l(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]),t.vertices=[-1,-1,0,0,-1,1,0,1,1,1,1,1,-1,-1,0,0,1,1,1,1,1,-1,1,0],t.batchSize=1,d.call(this,t),this.colorMatrix=new o,this.copyShader,this.addShader,this.linearShader,this.colorMatrixShader,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2},boot:function(){d.prototype.boot.call(this);var t=this.shaders,e=this.renderTargets;this.copyShader=t[0],this.addShader=t[1],this.linearShader=t[2],this.colorMatrixShader=t[3],this.fullFrame1=e[0],this.fullFrame2=e[1],this.halfFrame1=e[2],this.halfFrame2=e[3]},copyFrame:function(t,e,i,s,n){void 0===i&&(i=1),void 0===s&&(s=!0),void 0===n&&(n=!0);var r=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",i),r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,t.texture),e?(r.viewport(0,0,e.width,e.height),r.bindFramebuffer(r.FRAMEBUFFER,e.framebuffer),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e.texture,0)):r.viewport(0,0,t.width,t.height),s&&(n?r.clearColor(0,0,0,0):r.clearColor(0,0,0,1),r.clear(r.COLOR_BUFFER_BIT)),r.bufferData(r.ARRAY_BUFFER,this.vertexData,r.STATIC_DRAW),r.drawArrays(r.TRIANGLES,0,6),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindTexture(r.TEXTURE_2D,null)},blitFrame:function(t,e,i,s,r,o){void 0===i&&(i=1),void 0===s&&(s=!0),void 0===r&&(r=!0),void 0===o&&(o=!1);var a=this.gl;if(this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",i),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,t.texture),t.height>e.height)a.viewport(0,0,t.width,t.height),this.setTargetUVs(t,e);else{var h=e.height-t.height;a.viewport(0,h,t.width,t.height)}if(a.bindFramebuffer(a.FRAMEBUFFER,e.framebuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,e.texture,0),s&&(r?a.clearColor(0,0,0,0):a.clearColor(0,0,0,1),a.clear(a.COLOR_BUFFER_BIT)),o){var l=this.renderer.currentBlendMode;this.renderer.setBlendMode(n.ERASE)}a.bufferData(a.ARRAY_BUFFER,this.vertexData,a.STATIC_DRAW),a.drawArrays(a.TRIANGLES,0,6),o&&this.renderer.setBlendMode(l),a.bindFramebuffer(a.FRAMEBUFFER,null),a.bindTexture(a.TEXTURE_2D,null),this.resetUVs()},copyFrameRect:function(t,e,i,s,n,r,o,a){void 0===o&&(o=!0),void 0===a&&(a=!0);var h=this.gl;h.bindFramebuffer(h.FRAMEBUFFER,t.framebuffer),h.framebufferTexture2D(h.FRAMEBUFFER,h.COLOR_ATTACHMENT0,h.TEXTURE_2D,t.texture,0),o&&(a?h.clearColor(0,0,0,0):h.clearColor(0,0,0,1),h.clear(h.COLOR_BUFFER_BIT)),h.activeTexture(h.TEXTURE0),h.bindTexture(h.TEXTURE_2D,e.texture),h.copyTexSubImage2D(h.TEXTURE_2D,0,0,0,i,s,n,r),h.bindFramebuffer(h.FRAMEBUFFER,null),h.bindTexture(h.TEXTURE_2D,null)},copyToGame:function(t){var e=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",1),this.renderer.popFramebuffer(),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t.texture),e.bufferData(e.ARRAY_BUFFER,this.vertexData,e.STATIC_DRAW),e.drawArrays(e.TRIANGLES,0,6),this.renderer.resetTextures()},drawFrame:function(t,e,i,s){void 0===i&&(i=!0),void 0===s&&(s=this.colorMatrix);var n=this.gl;this.setShader(this.colorMatrixShader),this.set1i("uMainSampler",0),this.set1fv("uColorMatrix",s.getData()),this.set1f("uAlpha",s.alpha),n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,t.texture),e?(n.viewport(0,0,e.width,e.height),n.bindFramebuffer(n.FRAMEBUFFER,e.framebuffer),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,e.texture,0)):n.viewport(0,0,t.width,t.height),i?n.clearColor(0,0,0,0):n.clearColor(0,0,0,1),n.clear(n.COLOR_BUFFER_BIT),n.bufferData(n.ARRAY_BUFFER,this.vertexData,n.STATIC_DRAW),n.drawArrays(n.TRIANGLES,0,6),n.bindFramebuffer(n.FRAMEBUFFER,null),n.bindTexture(n.TEXTURE_2D,null)},blendFrames:function(t,e,i,s,n,r){void 0===s&&(s=1),void 0===n&&(n=!0),void 0===r&&(r=this.linearShader);var o=this.gl;this.setShader(r),this.set1i("uMainSampler1",0),this.set1i("uMainSampler2",1),this.set1f("uStrength",s),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,t.texture),o.activeTexture(o.TEXTURE1),o.bindTexture(o.TEXTURE_2D,e.texture),i?(o.bindFramebuffer(o.FRAMEBUFFER,i.framebuffer),o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,i.texture,0),o.viewport(0,0,i.width,i.height)):o.viewport(0,0,t.width,t.height),n?o.clearColor(0,0,0,0):o.clearColor(0,0,0,1),o.clear(o.COLOR_BUFFER_BIT),o.bufferData(o.ARRAY_BUFFER,this.vertexData,o.STATIC_DRAW),o.drawArrays(o.TRIANGLES,0,6),o.bindFramebuffer(o.FRAMEBUFFER,null),o.bindTexture(o.TEXTURE_2D,null)},blendFramesAdditive:function(t,e,i,s,n){this.blendFrames(t,e,i,s,n,this.addShader)},clearFrame:function(t,e){void 0===e&&(e=!0);var i=this.gl;i.viewport(0,0,t.width,t.height),i.bindFramebuffer(i.FRAMEBUFFER,t.framebuffer),e?i.clearColor(0,0,0,0):i.clearColor(0,0,0,1),i.clear(i.COLOR_BUFFER_BIT);var s=this.renderer.currentFramebuffer;i.bindFramebuffer(i.FRAMEBUFFER,s)},setUVs:function(t,e,i,s,n,r,o,a){var h=this.vertexViewF32;h[2]=t,h[3]=e,h[6]=i,h[7]=s,h[10]=n,h[11]=r,h[14]=t,h[15]=e,h[18]=n,h[19]=r,h[22]=o,h[23]=a},setTargetUVs:function(t,e){var i=e.height/t.height;i=i>.5?.5-(i-.5):.5-i+.5,this.setUVs(0,i,0,1+i,1,1+i,1,i)},flipX:function(){this.setUVs(1,0,1,1,0,1,0,0)},flipY:function(){this.setUVs(0,1,0,0,1,0,1,1)},resetUVs:function(){this.setUVs(0,0,0,1,1,1,1,0)}});t.exports=p},65641:t=>{t.exports={BITMAPMASK_PIPELINE:"BitmapMaskPipeline",LIGHT_PIPELINE:"Light2D",POINTLIGHT_PIPELINE:"PointLightPipeline",SINGLE_PIPELINE:"SinglePipeline",MULTI_PIPELINE:"MultiPipeline",ROPE_PIPELINE:"RopePipeline",GRAPHICS_PIPELINE:"GraphicsPipeline",POSTFX_PIPELINE:"PostFXPipeline",UTILITY_PIPELINE:"UtilityPipeline"}},68726:t=>{t.exports="pipelineafterflush"},67186:t=>{t.exports="pipelinebeforeflush"},22709:t=>{t.exports="pipelinebind"},74469:t=>{t.exports="pipelineboot"},93953:t=>{t.exports="pipelinedestroy"},51687:t=>{t.exports="pipelinerebind"},25034:t=>{t.exports="pipelineresize"},18970:(t,e,i)=>{t.exports={AFTER_FLUSH:i(68726),BEFORE_FLUSH:i(67186),BIND:i(22709),BOOT:i(74469),DESTROY:i(93953),REBIND:i(51687),RESIZE:i(25034)}},62253:(t,e,i)=>{var s=i(65641),n=i(98611),r={BitmapMaskPipeline:i(5583),Events:i(18970),GraphicsPipeline:i(67589),LightPipeline:i(66901),MultiPipeline:i(77310),PointLightPipeline:i(10919),PostFXPipeline:i(80486),RopePipeline:i(21213),SinglePipeline:i(51212),SpriteFXPipeline:i(38964),UtilityPipeline:i(60848)};r=n(!1,r,s),t.exports=r},2529:t=>{t.exports=["#define SHADER_NAME PHASER_ADD_BLEND_FS","","precision mediump float;","","uniform sampler2D uMainSampler1;","uniform sampler2D uMainSampler2;","uniform float uStrength;","","varying vec2 outTexCoord;","","void main ()","{"," vec4 frame1 = texture2D(uMainSampler1, outTexCoord);"," vec4 frame2 = texture2D(uMainSampler2, outTexCoord);",""," gl_FragColor = frame1 + frame2 * uStrength;","}",""].join("\n")},91679:t=>{t.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_FS","","precision mediump float;","","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uMaskSampler;","uniform bool uInvertMaskAlpha;","","void main ()","{"," vec2 uv = gl_FragCoord.xy / uResolution;"," vec4 mainColor = texture2D(uMainSampler, uv);"," vec4 maskColor = texture2D(uMaskSampler, uv);"," float alpha = mainColor.a;",""," if (!uInvertMaskAlpha)"," {"," alpha *= (maskColor.a);"," }"," else"," {"," alpha *= (1.0 - maskColor.a);"," }",""," gl_FragColor = vec4(mainColor.rgb * alpha, alpha);","}",""].join("\n")},89053:t=>{t.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_VS","","precision mediump float;","","attribute vec2 inPosition;","","void main ()","{"," gl_Position = vec4(inPosition, 0.0, 1.0);","}",""].join("\n")},37486:t=>{t.exports=["#define SHADER_NAME PHASER_COLORMATRIX_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","uniform float uColorMatrix[20];","uniform float uAlpha;","","varying vec2 outTexCoord;","","void main ()","{"," vec4 c = texture2D(uMainSampler, outTexCoord);",""," if (uAlpha == 0.0)"," {"," gl_FragColor = c;",""," return;"," }",""," if (c.a > 0.0)"," {"," c.rgb /= c.a;"," }",""," vec4 result;",""," result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4];"," result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9];"," result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14];"," result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19];",""," vec3 rgb = mix(c.rgb, result.rgb, uAlpha);",""," rgb *= result.a;",""," gl_FragColor = vec4(rgb, result.a);","}",""].join("\n")},79060:t=>{t.exports=["#define SHADER_NAME PHASER_COPY_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","uniform float uBrightness;","","varying vec2 outTexCoord;","","void main ()","{"," gl_FragColor = texture2D(uMainSampler, outTexCoord) * uBrightness;","}",""].join("\n")},37699:t=>{t.exports=["#define SHADER_NAME PHASER_GRAPHICS_FS","","precision mediump float;","","varying vec4 outColor;","","void main ()","{"," gl_FragColor = vec4(outColor.bgr * outColor.a, outColor.a);","}",""].join("\n")},28739:t=>{t.exports=["#define SHADER_NAME PHASER_GRAPHICS_VS","","precision mediump float;","","uniform mat4 uProjectionMatrix;","","attribute vec2 inPosition;","attribute vec4 inColor;","","varying vec4 outColor;","","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);",""," outColor = inColor;","}",""].join("\n")},65045:t=>{t.exports=["#define SHADER_NAME PHASER_LIGHT_FS","","precision mediump float;","","struct Light","{"," vec2 position;"," vec3 color;"," float intensity;"," float radius;","};","","const int kMaxLights = %LIGHT_COUNT%;","","uniform vec4 uCamera; /* x, y, rotation, zoom */","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uNormSampler;","uniform vec3 uAmbientLightColor;","uniform Light uLights[kMaxLights];","uniform mat3 uInverseRotationMatrix;","","varying vec2 outTexCoord;","varying vec4 outTint;","","void main()","{"," vec3 finalColor = vec3(0.0, 0.0, 0.0);"," vec4 color = texture2D(uMainSampler, outTexCoord) * vec4(outTint.bgr * outTint.a, outTint.a);"," vec3 normalMap = texture2D(uNormSampler, outTexCoord).rgb;"," vec3 normal = normalize(uInverseRotationMatrix * vec3(normalMap * 2.0 - 1.0));"," vec2 res = vec2(min(uResolution.x, uResolution.y)) * uCamera.w;",""," for (int index = 0; index < kMaxLights; ++index)"," {"," Light light = uLights[index];"," vec3 lightDir = vec3((light.position.xy / res) - (gl_FragCoord.xy / res), 0.1);"," vec3 lightNormal = normalize(lightDir);"," float distToSurf = length(lightDir) * uCamera.w;"," float diffuseFactor = max(dot(normal, lightNormal), 0.0);"," float radius = (light.radius / res.x * uCamera.w) * uCamera.w;"," float attenuation = clamp(1.0 - distToSurf * distToSurf / (radius * radius), 0.0, 1.0);"," vec3 diffuse = light.color * diffuseFactor;"," finalColor += (attenuation * diffuse) * light.intensity;"," }",""," vec4 colorOutput = vec4(uAmbientLightColor + finalColor, 1.0);",""," gl_FragColor = color * vec4(colorOutput.rgb * colorOutput.a, colorOutput.a);","}",""].join("\n")},98921:t=>{t.exports=["#define SHADER_NAME PHASER_LINEAR_BLEND_FS","","precision mediump float;","","uniform sampler2D uMainSampler1;","uniform sampler2D uMainSampler2;","uniform float uStrength;","","varying vec2 outTexCoord;","","void main ()","{"," vec4 frame1 = texture2D(uMainSampler1, outTexCoord);"," vec4 frame2 = texture2D(uMainSampler2, outTexCoord);",""," gl_FragColor = mix(frame1, frame2 * uStrength, 0.5);","}",""].join("\n")},53787:t=>{t.exports=["#define SHADER_NAME PHASER_MULTI_FS","#define numTextures %count%","","precision highp float;","","uniform sampler2D uMainSampler[%count%];","","varying vec2 outTexCoord;","varying float outTexId;","varying float outTintEffect;","varying vec4 outTint;","","vec4 getSampler (int index, vec2 uv)","{"," for (int i = 0; i < numTextures; ++i)"," {"," if (i == index)"," {"," return texture2D(uMainSampler[i], uv);"," }"," }",""," // Return black"," return vec4(0);","}","","void main ()","{"," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);",""," vec4 texture = getSampler(int(outTexId), outTexCoord);",""," // Multiply texture tint"," vec4 color = texture * texel;",""," if (outTintEffect == 1.0)"," {"," // Solid color + texture alpha"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," // Solid color, no texture"," color = texel;"," }",""," gl_FragColor = color;","}",""].join("\n")},15968:t=>{t.exports=["#define SHADER_NAME PHASER_MULTI_VS","","precision highp float;","","uniform mat4 uProjectionMatrix;","","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexId;","attribute float inTintEffect;","attribute vec4 inTint;","","varying vec2 outTexCoord;","varying float outTexId;","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);",""," outTexCoord = inTexCoord;"," outTexId = inTexId;"," outTint = inTint;"," outTintEffect = inTintEffect;","}",""].join("\n")},83327:t=>{t.exports=["#define SHADER_NAME PHASER_POINTLIGHT_FS","","precision mediump float;","","uniform vec2 uResolution;","uniform float uCameraZoom;","","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","","void main ()","{"," vec2 center = (lightPosition.xy + 1.0) * (uResolution.xy * 0.5);",""," float distToSurf = length(center - gl_FragCoord.xy);",""," float radius = 1.0 - distToSurf / (lightRadius * uCameraZoom);",""," float intensity = smoothstep(0.0, 1.0, radius * lightAttenuation);",""," vec4 color = vec4(intensity, intensity, intensity, 0.0) * lightColor;",""," gl_FragColor = vec4(color.rgb * lightColor.a, color.a);","}",""].join("\n")},54677:t=>{t.exports=["#define SHADER_NAME PHASER_POINTLIGHT_VS","","precision mediump float;","","uniform mat4 uProjectionMatrix;","","attribute vec2 inPosition;","attribute vec2 inLightPosition;","attribute vec4 inLightColor;","attribute float inLightRadius;","attribute float inLightAttenuation;","","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","","void main ()","{"," lightColor = inLightColor;"," lightRadius = inLightRadius;"," lightAttenuation = inLightAttenuation;"," lightPosition = uProjectionMatrix * vec4(inLightPosition, 1.0, 1.0);",""," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);","}",""].join("\n")},12569:t=>{t.exports=["#define SHADER_NAME PHASER_POSTFX_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","","varying vec2 outTexCoord;","","void main ()","{"," gl_FragColor = texture2D(uMainSampler, outTexCoord);","}",""].join("\n")},99365:t=>{t.exports=["#define SHADER_NAME PHASER_QUAD_VS","","precision mediump float;","","attribute vec2 inPosition;","attribute vec2 inTexCoord;","","varying vec2 outFragCoord;","varying vec2 outTexCoord;","","void main ()","{"," outFragCoord = inPosition.xy * 0.5 + 0.5;"," outTexCoord = inTexCoord;",""," gl_Position = vec4(inPosition, 0, 1);","}",""].join("\n")},85060:t=>{t.exports=["#define SHADER_NAME PHASER_SINGLE_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);",""," // Multiply texture tint"," vec4 color = texture * texel;",""," if (outTintEffect == 1.0)"," {"," // Solid color + texture alpha"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," // Solid color, no texture"," color = texel;"," }",""," gl_FragColor = color;","}",""].join("\n")},18166:t=>{t.exports=["#define SHADER_NAME PHASER_SINGLE_VS","","precision mediump float;","","uniform mat4 uProjectionMatrix;","","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexId;","attribute float inTintEffect;","attribute vec4 inTint;","","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);",""," outTexCoord = inTexCoord;"," outTint = inTint;"," outTintEffect = inTintEffect;","}",""].join("\n")},756:(t,e,i)=>{var s=i(55301),n=i(56694),r=i(6659),o=i(40444),a=i(97081),h=i(74181),l=i(2893),u=i(9229),c=i(72283),d=i(74118),p=i(90881),f=i(84314),v=i(93736),g=new n({Extends:r,initialize:function(t){r.call(this),this.game=t,this.canvas,this.canvasBounds=new d,this.parent=null,this.parentIsWindow=!1,this.parentSize=new p,this.gameSize=new p,this.baseSize=new p,this.displaySize=new p,this.scaleMode=s.SCALE_MODE.NONE,this.zoom=1,this._resetZoom=!1,this.displayScale=new v(1,1),this.autoRound=!1,this.autoCenter=s.CENTER.NO_CENTER,this.orientation=s.ORIENTATION.LANDSCAPE,this.fullscreen,this.fullscreenTarget=null,this._createdFullscreenTarget=!1,this.dirty=!1,this.resizeInterval=500,this._lastCheck=0,this._checkOrientation=!1,this.listeners={orientationChange:c,windowResize:c,fullScreenChange:c,fullScreenError:c}},preBoot:function(){this.parseConfig(this.game.config),this.game.events.once(a.BOOT,this.boot,this)},boot:function(){var t=this.game;this.canvas=t.canvas,this.fullscreen=t.device.fullscreen,this.scaleMode!==s.SCALE_MODE.RESIZE&&this.displaySize.setAspectMode(this.scaleMode),this.scaleMode===s.SCALE_MODE.NONE?this.resize(this.width,this.height):(this.getParentBounds(),this.parentSize.width>0&&this.parentSize.height>0&&this.displaySize.setParent(this.parentSize),this.refresh()),t.events.on(a.PRE_STEP,this.step,this),t.events.once(a.READY,this.refresh,this),t.events.once(a.DESTROY,this.destroy,this),this.startListeners()},parseConfig:function(t){this.getParent(t),this.getParentBounds();var e=t.width,i=t.height,n=t.scaleMode,r=t.zoom,o=t.autoRound;if("string"==typeof e){var a=this.parentSize.width;0===a&&(a=window.innerWidth);var h=parseInt(e,10)/100;e=Math.floor(a*h)}if("string"==typeof i){var l=this.parentSize.height;0===l&&(l=window.innerHeight);var c=parseInt(i,10)/100;i=Math.floor(l*c)}this.scaleMode=n,this.autoRound=o,this.autoCenter=t.autoCenter,this.resizeInterval=t.resizeInterval,o&&(e=Math.floor(e),i=Math.floor(i)),this.gameSize.setSize(e,i),r===s.ZOOM.MAX_ZOOM&&(r=this.getMaxZoom()),this.zoom=r,1!==r&&(this._resetZoom=!0),this.baseSize.setSize(e,i),o&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),t.minWidth>0&&this.displaySize.setMin(t.minWidth*r,t.minHeight*r),t.maxWidth>0&&this.displaySize.setMax(t.maxWidth*r,t.maxHeight*r),this.displaySize.setSize(e,i),this.orientation=u(e,i)},getParent:function(t){var e=t.parent;if(null!==e){if(this.parent=l(e),this.parentIsWindow=this.parent===document.body,t.expandParent&&t.scaleMode!==s.SCALE_MODE.NONE){var i=this.parent.getBoundingClientRect();(this.parentIsWindow||0===i.height)&&(document.documentElement.style.height="100%",document.body.style.height="100%",i=this.parent.getBoundingClientRect(),this.parentIsWindow||0!==i.height||(this.parent.style.overflow="hidden",this.parent.style.width="100%",this.parent.style.height="100%"))}t.fullscreenTarget&&!this.fullscreenTarget&&(this.fullscreenTarget=l(t.fullscreenTarget))}},getParentBounds:function(){if(!this.parent)return!1;var t=this.parentSize,e=this.parent.getBoundingClientRect();this.parentIsWindow&&this.game.device.os.iOS&&(e.height=h(!0));var i=e.width,s=e.height;if(t.width!==i||t.height!==s)return t.setSize(i,s),!0;if(this.canvas){var n=this.canvasBounds,r=this.canvas.getBoundingClientRect();if(r.x!==n.x||r.y!==n.y)return!0}return!1},lockOrientation:function(t){var e=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation;return!!e&&e.call(screen,t)},setParentSize:function(t,e){return this.parentSize.setSize(t,e),this.refresh()},setGameSize:function(t,e){var i=this.autoRound;i&&(t=Math.floor(t),e=Math.floor(e));var s=this.width,n=this.height;return this.gameSize.resize(t,e),this.baseSize.resize(t,e),i&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setAspectRatio(t/e),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height,this.refresh(s,n)},resize:function(t,e){var i=this.zoom,s=this.autoRound;s&&(t=Math.floor(t),e=Math.floor(e));var n=this.width,r=this.height;this.gameSize.resize(t,e),this.baseSize.resize(t,e),s&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(t*i,e*i),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height;var o=this.canvas.style,a=t*i,h=e*i;return s&&(a=Math.floor(a),h=Math.floor(h)),a===t&&h===e||(o.width=a+"px",o.height=h+"px"),this.refresh(n,r)},setZoom:function(t){return this.zoom=t,this._resetZoom=!0,this.refresh()},setMaxZoom:function(){return this.zoom=this.getMaxZoom(),this._resetZoom=!0,this.refresh()},refresh:function(t,e){void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.updateScale(),this.updateBounds(),this.updateOrientation(),this.displayScale.set(this.baseSize.width/this.canvasBounds.width,this.baseSize.height/this.canvasBounds.height);var i=this.game.domContainer;if(i){this.baseSize.setCSS(i);var s=this.canvas.style,n=i.style;n.transform="scale("+this.displaySize.width/this.baseSize.width+","+this.displaySize.height/this.baseSize.height+")",n.marginLeft=s.marginLeft,n.marginTop=s.marginTop}return this.emit(o.RESIZE,this.gameSize,this.baseSize,this.displaySize,t,e),this},updateOrientation:function(){if(this._checkOrientation){this._checkOrientation=!1;var t=u(this.width,this.height);t!==this.orientation&&(this.orientation=t,this.emit(o.ORIENTATION_CHANGE,t))}},updateScale:function(){var t,e,i=this.canvas.style,n=this.gameSize.width,r=this.gameSize.height,o=this.zoom,a=this.autoRound;this.scaleMode===s.SCALE_MODE.NONE?(this.displaySize.setSize(n*o,r*o),t=this.displaySize.width,e=this.displaySize.height,a&&(t=Math.floor(t),e=Math.floor(e)),this._resetZoom&&(i.width=t+"px",i.height=e+"px",this._resetZoom=!1)):this.scaleMode===s.SCALE_MODE.RESIZE?(this.displaySize.setSize(this.parentSize.width,this.parentSize.height),this.gameSize.setSize(this.displaySize.width,this.displaySize.height),this.baseSize.setSize(this.displaySize.width,this.displaySize.height),t=this.displaySize.width,e=this.displaySize.height,a&&(t=Math.floor(t),e=Math.floor(e)),this.canvas.width=t,this.canvas.height=e):(this.displaySize.setSize(this.parentSize.width,this.parentSize.height),t=this.displaySize.width,e=this.displaySize.height,a&&(t=Math.floor(t),e=Math.floor(e)),i.width=t+"px",i.height=e+"px"),this.getParentBounds(),this.updateCenter()},getMaxZoom:function(){var t=f(this.parentSize.width,this.gameSize.width,0,!0),e=f(this.parentSize.height,this.gameSize.height,0,!0);return Math.max(Math.min(t,e),1)},updateCenter:function(){var t=this.autoCenter;if(t!==s.CENTER.NO_CENTER){var e=this.canvas,i=e.style,n=e.getBoundingClientRect(),r=n.width,o=n.height,a=Math.floor((this.parentSize.width-r)/2),h=Math.floor((this.parentSize.height-o)/2);t===s.CENTER.CENTER_HORIZONTALLY?h=0:t===s.CENTER.CENTER_VERTICALLY&&(a=0),i.marginLeft=a+"px",i.marginTop=h+"px"}},updateBounds:function(){var t=this.canvasBounds,e=this.canvas.getBoundingClientRect();t.x=e.left+(window.pageXOffset||0)-(document.documentElement.clientLeft||0),t.y=e.top+(window.pageYOffset||0)-(document.documentElement.clientTop||0),t.width=e.width,t.height=e.height},transformX:function(t){return(t-this.canvasBounds.left)*this.displayScale.x},transformY:function(t){return(t-this.canvasBounds.top)*this.displayScale.y},startFullscreen:function(t){void 0===t&&(t={navigationUI:"hide"});var e=this.fullscreen;if(e.available){if(!e.active){var i=this.getFullscreenTarget();e.keyboard?i[e.request](Element.ALLOW_KEYBOARD_INPUT):i[e.request](t)}}else this.emit(o.FULLSCREEN_UNSUPPORTED)},fullscreenSuccessHandler:function(){this.getParentBounds(),this.refresh(),this.emit(o.ENTER_FULLSCREEN)},fullscreenErrorHandler:function(t){this.removeFullscreenTarget(),this.emit(o.FULLSCREEN_FAILED,t)},getFullscreenTarget:function(){if(!this.fullscreenTarget){var t=document.createElement("div");t.style.margin="0",t.style.padding="0",t.style.width="100%",t.style.height="100%",this.fullscreenTarget=t,this._createdFullscreenTarget=!0}this._createdFullscreenTarget&&(this.canvas.parentNode.insertBefore(this.fullscreenTarget,this.canvas),this.fullscreenTarget.appendChild(this.canvas));return this.fullscreenTarget},removeFullscreenTarget:function(){if(this._createdFullscreenTarget){var t=this.fullscreenTarget;if(t&&t.parentNode){var e=t.parentNode;e.insertBefore(this.canvas,t),e.removeChild(t)}}},stopFullscreen:function(){var t=this.fullscreen;if(!t.available)return this.emit(o.FULLSCREEN_UNSUPPORTED),!1;t.active&&document[t.cancel](),this.removeFullscreenTarget(),this.getParentBounds(),this.emit(o.LEAVE_FULLSCREEN),this.refresh()},toggleFullscreen:function(t){this.fullscreen.active?this.stopFullscreen():this.startFullscreen(t)},startListeners:function(){var t=this,e=this.listeners;if(e.orientationChange=function(){t.updateBounds(),t._checkOrientation=!0,t.dirty=!0},e.windowResize=function(){t.updateBounds(),t.dirty=!0},window.addEventListener("orientationchange",e.orientationChange,!1),window.addEventListener("resize",e.windowResize,!1),this.fullscreen.available){e.fullScreenChange=function(e){return t.onFullScreenChange(e)},e.fullScreenError=function(e){return t.onFullScreenError(e)};["webkit","moz",""].forEach((function(t){document.addEventListener(t+"fullscreenchange",e.fullScreenChange,!1),document.addEventListener(t+"fullscreenerror",e.fullScreenError,!1)})),document.addEventListener("MSFullscreenChange",e.fullScreenChange,!1),document.addEventListener("MSFullscreenError",e.fullScreenError,!1)}},onFullScreenChange:function(){document.fullscreenElement||document.webkitFullscreenElement||document.msFullscreenElement||document.mozFullScreenElement?this.fullscreenSuccessHandler():this.stopFullscreen()},onFullScreenError:function(){this.removeFullscreenTarget()},getViewPort:function(t){void 0===t&&(t=new d);var e,i,s=this.baseSize,n=this.parentSize,r=this.canvasBounds,o=this.displayScale,a=r.x>=0?0:-r.x*o.x,h=r.y>=0?0:-r.y*o.y;return e=n.width>=r.width?s.width:s.width-(r.width-n.width)*o.x,i=n.height>=r.height?s.height:s.height-(r.height-n.height)*o.y,t.setTo(a,h,e,i),t},step:function(t,e){this.parent&&(this._lastCheck+=e,(this.dirty||this._lastCheck>this.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var t=this.listeners;window.removeEventListener("orientationchange",t.orientationChange,!1),window.removeEventListener("resize",t.windowResize,!1);["webkit","moz",""].forEach((function(e){document.removeEventListener(e+"fullscreenchange",t.fullScreenChange,!1),document.removeEventListener(e+"fullscreenerror",t.fullScreenError,!1)})),document.removeEventListener("MSFullscreenChange",t.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",t.fullScreenError,!1)},destroy:function(){this.removeAllListeners(),this.stopListeners(),this.game=null,this.canvas=null,this.canvasBounds=null,this.parent=null,this.fullscreenTarget=null,this.parentSize.destroy(),this.gameSize.destroy(),this.baseSize.destroy(),this.displaySize.destroy()},isFullscreen:{get:function(){return this.fullscreen.active}},width:{get:function(){return this.gameSize.width}},height:{get:function(){return this.gameSize.height}},isPortrait:{get:function(){return this.orientation===s.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===s.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});t.exports=g},35098:t=>{t.exports={NO_CENTER:0,CENTER_BOTH:1,CENTER_HORIZONTALLY:2,CENTER_VERTICALLY:3}},53539:t=>{t.exports={LANDSCAPE:"landscape-primary",PORTRAIT:"portrait-primary"}},12637:t=>{t.exports={NONE:0,WIDTH_CONTROLS_HEIGHT:1,HEIGHT_CONTROLS_WIDTH:2,FIT:3,ENVELOP:4,RESIZE:5}},10217:t=>{t.exports={NO_ZOOM:1,ZOOM_2X:2,ZOOM_4X:4,MAX_ZOOM:-1}},55301:(t,e,i)=>{var s={CENTER:i(35098),ORIENTATION:i(53539),SCALE_MODE:i(12637),ZOOM:i(10217)};t.exports=s},82085:t=>{t.exports="enterfullscreen"},11826:t=>{t.exports="fullscreenfailed"},56691:t=>{t.exports="fullscreenunsupported"},34739:t=>{t.exports="leavefullscreen"},26681:t=>{t.exports="orientationchange"},11428:t=>{t.exports="resize"},40444:(t,e,i)=>{t.exports={ENTER_FULLSCREEN:i(82085),FULLSCREEN_FAILED:i(11826),FULLSCREEN_UNSUPPORTED:i(56691),LEAVE_FULLSCREEN:i(34739),ORIENTATION_CHANGE:i(26681),RESIZE:i(11428)}},86754:(t,e,i)=>{var s=i(98611),n=i(55301),r={Center:i(35098),Events:i(40444),Orientation:i(53539),ScaleManager:i(756),ScaleModes:i(12637),Zoom:i(10217)};r=s(!1,r,n.CENTER),r=s(!1,r,n.ORIENTATION),r=s(!1,r,n.SCALE_MODE),r=s(!1,r,n.ZOOM),t.exports=r},47736:(t,e,i)=>{var s=i(72632),n=i(40587);t.exports=function(t){var e=t.game.config.defaultPhysicsSystem,i=s(t.settings,"physics",!1);if(e||i){var r=[];if(e&&r.push(n(e+"Physics")),i)for(var o in i)o=n(o.concat("Physics")),-1===r.indexOf(o)&&r.push(o);return r}}},91088:(t,e,i)=>{var s=i(72632);t.exports=function(t){var e=t.plugins.getDefaultScenePlugins(),i=s(t.settings,"plugins",!1);return Array.isArray(i)?i:e||[]}},90415:t=>{t.exports={game:"game",renderer:"renderer",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",scale:"scale",sound:"sound",textures:"textures",events:"events",cameras:"cameras",add:"add",make:"make",scenePlugin:"scene",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",impactPhysics:"impact",matterPhysics:"matter"}},87157:(t,e,i)=>{var s=i(56694),n=i(63946),r=new s({initialize:function(t){this.sys=new n(this,t),this.game,this.anims,this.cache,this.registry,this.sound,this.textures,this.events,this.cameras,this.add,this.make,this.scene,this.children,this.lights,this.data,this.input,this.load,this.time,this.tweens,this.physics,this.matter,this.scale,this.plugins,this.renderer},update:function(){}});t.exports=r},13553:(t,e,i)=>{var s=i(56694),n=i(92980),r=i(7599),o=i(97081),a=i(10850),h=i(683),l=i(72283),u=i(87157),c=i(63946),d=new s({initialize:function(t,e){if(this.game=t,this.keys={},this.scenes=[],this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,this.customViewports=0,e){Array.isArray(e)||(e=[e]);for(var i=0;i-1&&(delete this.keys[s],this.scenes.splice(i,1),this._start.indexOf(s)>-1&&(i=this._start.indexOf(s),this._start.splice(i,1)),e.sys.destroy())}return this},bootScene:function(t){var e,i=t.sys,s=i.settings;i.sceneUpdate=l,t.init&&(t.init.call(t,s.data),s.status=n.INIT,s.isTransition&&i.events.emit(r.TRANSITION_INIT,s.transitionFrom,s.transitionDuration)),i.load&&(e=i.load).reset(),e&&t.preload?(t.preload.call(t),s.status=n.LOADING,e.once(h.COMPLETE,this.loadComplete,this),e.start()):this.create(t)},loadComplete:function(t){this.create(t.scene)},payloadComplete:function(t){this.bootScene(t.scene)},update:function(t,e){this.processQueue(),this.isProcessing=!0;for(var i=this.scenes.length-1;i>=0;i--){var s=this.scenes[i].sys;s.settings.status>n.START&&s.settings.status<=n.RUNNING&&s.step(t,e)}},render:function(t){for(var e=0;e=n.LOADING&&i.settings.status0){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.unshift(i)}}return this},moveDown:function(t){if(this.isProcessing)this._queue.push({op:"moveDown",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e>0){var i=e-1,s=this.getScene(t),n=this.getAt(i);this.scenes[e]=n,this.scenes[i]=s}}return this},moveUp:function(t){if(this.isProcessing)this._queue.push({op:"moveUp",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e{var s=i(82897),n=i(56694),r=i(7599),o=i(72632),a=i(91963),h=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.key=t.sys.settings.key,this.manager=t.sys.game.scene,this.transitionProgress=0,this._elapsed=0,this._target=null,this._duration=0,this._onUpdate,this._onUpdateScope,this._willSleep=!1,this._willRemove=!1,t.sys.events.once(r.BOOT,this.boot,this),t.sys.events.on(r.START,this.pluginStart,this)},boot:function(){this.systems.events.once(r.DESTROY,this.destroy,this)},pluginStart:function(){this._target=null,this.systems.events.once(r.SHUTDOWN,this.shutdown,this)},start:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",this.key),this.manager.queueOp("start",t,e),this},restart:function(t){var e=this.key;return this.manager.queueOp("stop",e),this.manager.queueOp("start",e,t),this},transition:function(t){void 0===t&&(t={});var e=o(t,"target",!1),i=this.manager.getScene(e);if(!e||!this.checkValidTransition(i))return!1;var s=o(t,"duration",1e3);this._elapsed=0,this._target=i,this._duration=s,this._willSleep=o(t,"sleep",!1),this._willRemove=o(t,"remove",!1);var n=o(t,"onUpdate",null);n&&(this._onUpdate=n,this._onUpdateScope=o(t,"onUpdateScope",this.scene));var a=o(t,"allowInput",!1);this.settings.transitionAllowInput=a;var h=i.sys.settings;return h.isTransition=!0,h.transitionFrom=this.scene,h.transitionDuration=s,h.transitionAllowInput=a,o(t,"moveAbove",!1)?this.manager.moveAbove(this.key,e):o(t,"moveBelow",!1)&&this.manager.moveBelow(this.key,e),i.sys.isSleeping()?i.sys.wake(o(t,"data")):this.manager.start(e,o(t,"data")),this.systems.events.emit(r.TRANSITION_OUT,i,s),this.systems.events.on(r.UPDATE,this.step,this),!0},checkValidTransition:function(t){return!(!t||t.sys.isActive()||t.sys.isTransitioning()||t===this.scene||this.systems.isTransitioning())},step:function(t,e){this._elapsed+=e,this.transitionProgress=s(this._elapsed/this._duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.transitionProgress),this._elapsed>=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;this.systems.events.off(r.UPDATE,this.step,this),t.events.emit(r.TRANSITION_COMPLETE,this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i,s){return this.manager.add(t,e,i,s)},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t){return t!==this.key&&this.manager.queueOp("switch",this.key,t),this},stop:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t,e),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var s=this.manager.getScene(e);return s&&s.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isPaused:function(t){return void 0===t&&(t=this.key),this.manager.isPaused(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off(r.SHUTDOWN,this.shutdown,this),t.off(r.POST_UPDATE,this.step,this),t.off(r.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});a.register("ScenePlugin",h,"scenePlugin"),t.exports=h},36765:(t,e,i)=>{var s=i(92980),n=i(10850),r=i(30657),o=i(90415),a={create:function(t){return"string"==typeof t?t={key:t}:void 0===t&&(t={}),{status:s.PENDING,key:n(t,"key",""),active:n(t,"active",!1),visible:n(t,"visible",!0),isBooted:!1,isTransition:!1,transitionFrom:null,transitionDuration:0,transitionAllowInput:!0,data:{},pack:n(t,"pack",!1),cameras:n(t,"cameras",null),map:n(t,"map",r(o,n(t,"mapAdd",{}))),physics:n(t,"physics",{}),loader:n(t,"loader",{}),plugins:n(t,"plugins",!1),input:n(t,"input",{})}}};t.exports=a},63946:(t,e,i)=>{var s=i(56694),n=i(92980),r=i(18360),o=i(7599),a=i(47736),h=i(91088),l=i(86459),u=i(72283),c=i(36765),d=new s({initialize:function(t,e){this.scene=t,this.game,this.renderer,this.config=e,this.settings=c.create(e),this.canvas,this.context,this.anims,this.cache,this.plugins,this.registry,this.scale,this.sound,this.textures,this.add,this.cameras,this.displayList,this.events,this.make,this.scenePlugin,this.updateList,this.sceneUpdate=u},init:function(t){this.settings.status=n.INIT,this.sceneUpdate=u,this.game=t,this.renderer=t.renderer,this.canvas=t.canvas,this.context=t.context;var e=t.plugins;this.plugins=e,e.addToScene(this,r.Global,[r.CoreScene,h(this),a(this)]),this.events.emit(o.BOOT,this),this.settings.isBooted=!0},step:function(t,e){var i=this.events;i.emit(o.PRE_UPDATE,t,e),i.emit(o.UPDATE,t,e),this.sceneUpdate.call(this.scene,t,e),i.emit(o.POST_UPDATE,t,e)},render:function(t){var e=this.displayList;e.depthSort(),this.events.emit(o.PRE_RENDER,t),this.cameras.render(t,e),this.events.emit(o.RENDER,t)},queueDepthSort:function(){this.displayList.queueDepthSort()},depthSort:function(){this.displayList.depthSort()},pause:function(t){var e=this.events,i=this.settings;return this.settings.active&&(i.status=n.PAUSED,i.active=!1,e.emit(o.PAUSE,this,t)),this},resume:function(t){var e=this.events,i=this.settings;return this.settings.active||(i.status=n.RUNNING,i.active=!0,e.emit(o.RESUME,this,t)),this},sleep:function(t){var e=this.events,i=this.settings;return i.status=n.SLEEPING,i.active=!1,i.visible=!1,e.emit(o.SLEEP,this,t),this},wake:function(t){var e=this.events,i=this.settings;return i.status=n.RUNNING,i.active=!0,i.visible=!0,e.emit(o.WAKE,this,t),i.isTransition&&e.emit(o.TRANSITION_WAKE,i.transitionFrom,i.transitionDuration),this},getData:function(){return this.settings.data},isSleeping:function(){return this.settings.status===n.SLEEPING},isActive:function(){return this.settings.status===n.RUNNING},isPaused:function(){return this.settings.status===n.PAUSED},isTransitioning:function(){return this.settings.isTransition||null!==this.scenePlugin._target},isTransitionOut:function(){return null!==this.scenePlugin._target&&this.scenePlugin._duration>0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(t){return this.settings.visible=t,this},setActive:function(t,e){return t?this.resume(e):this.pause(e)},start:function(t){var e=this.events,i=this.settings;t&&(i.data=t),i.status=n.START,i.active=!0,i.visible=!0,e.emit(o.START,this),e.emit(o.READY,this,t)},shutdown:function(t){var e=this.events,i=this.settings;e.off(o.TRANSITION_INIT),e.off(o.TRANSITION_START),e.off(o.TRANSITION_COMPLETE),e.off(o.TRANSITION_OUT),i.status=n.SHUTDOWN,i.active=!1,i.visible=!1,this.renderer===l.WEBGL&&this.renderer.resetTextures(!0),e.emit(o.SHUTDOWN,this,t)},destroy:function(){var t=this.events,e=this.settings;e.status=n.DESTROYED,e.active=!1,e.visible=!1,t.emit(o.DESTROY,this),t.removeAllListeners();for(var i=["scene","game","anims","cache","plugins","registry","sound","textures","add","camera","displayList","events","make","scenePlugin","updateList"],s=0;s{t.exports={PENDING:0,INIT:1,START:2,LOADING:3,CREATING:4,RUNNING:5,PAUSED:6,SLEEPING:7,SHUTDOWN:8,DESTROYED:9}},31803:t=>{t.exports="addedtoscene"},94817:t=>{t.exports="boot"},28977:t=>{t.exports="create"},91959:t=>{t.exports="destroy"},363:t=>{t.exports="pause"},15643:t=>{t.exports="postupdate"},17058:t=>{t.exports="prerender"},77125:t=>{t.exports="preupdate"},76018:t=>{t.exports="ready"},28620:t=>{t.exports="removedfromscene"},41538:t=>{t.exports="render"},34268:t=>{t.exports="resume"},2342:t=>{t.exports="shutdown"},96541:t=>{t.exports="sleep"},74244:t=>{t.exports="start"},17046:t=>{t.exports="transitioncomplete"},13637:t=>{t.exports="transitioninit"},14733:t=>{t.exports="transitionout"},33899:t=>{t.exports="transitionstart"},52418:t=>{t.exports="transitionwake"},31735:t=>{t.exports="update"},8470:t=>{t.exports="wake"},7599:(t,e,i)=>{t.exports={ADDED_TO_SCENE:i(31803),BOOT:i(94817),CREATE:i(28977),DESTROY:i(91959),PAUSE:i(363),POST_UPDATE:i(15643),PRE_RENDER:i(17058),PRE_UPDATE:i(77125),READY:i(76018),REMOVED_FROM_SCENE:i(28620),RENDER:i(41538),RESUME:i(34268),SHUTDOWN:i(2342),SLEEP:i(96541),START:i(74244),TRANSITION_COMPLETE:i(17046),TRANSITION_INIT:i(13637),TRANSITION_OUT:i(14733),TRANSITION_START:i(33899),TRANSITION_WAKE:i(52418),UPDATE:i(31735),WAKE:i(8470)}},20436:(t,e,i)=>{var s=i(92980),n=i(98611),r={Events:i(7599),GetPhysicsPlugins:i(47736),GetScenePlugins:i(91088),SceneManager:i(13553),ScenePlugin:i(64051),Settings:i(36765),Systems:i(63946)};r=n(!1,r,s),t.exports=r},25798:(t,e,i)=>{var s=i(56694),n=i(6659),r=i(76038),o=i(98611),a=i(72283),h=new s({Extends:n,initialize:function(t,e,i){n.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=this.duration||0,this.totalDuration=this.totalDuration||0,this.config={mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0},this.currentConfig=this.config,this.config=o(this.config,i),this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(console.error("addMarker "+t.name+" already exists in Sound"),!1):(t=o(!0,{name:"",start:0,duration:this.totalDuration-(t.start||0),config:{mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0}},t),this.markers[t.name]=t,!0))},updateMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(this.markers[t.name]=o(!0,this.markers[t.name],t),!0):(console.warn("Audio Marker: "+t.name+" missing in Sound: "+this.key),!1))},removeMarker:function(t){var e=this.markers[t];return e?(this.markers[t]=null,e):null},play:function(t,e){if(void 0===t&&(t=""),"object"==typeof t&&(e=t,t=""),"string"!=typeof t)return!1;if(t){if(!this.markers[t])return console.warn("Marker: "+t+" missing in Sound: "+this.key),!1;this.currentMarker=this.markers[t],this.currentConfig=this.currentMarker.config,this.duration=this.currentMarker.duration}else this.currentMarker=null,this.currentConfig=this.config,this.duration=this.totalDuration;return this.resetConfig(),this.currentConfig=o(this.currentConfig,e),this.isPlaying=!0,this.isPaused=!1,!0},pause:function(){return!(this.isPaused||!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!0,!0)},resume:function(){return!(!this.isPaused||this.isPlaying)&&(this.isPlaying=!0,this.isPaused=!1,!0)},stop:function(){return!(!this.isPaused&&!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!1,this.resetConfig(),!0)},applyConfig:function(){this.mute=this.currentConfig.mute,this.volume=this.currentConfig.volume,this.rate=this.currentConfig.rate,this.detune=this.currentConfig.detune,this.loop=this.currentConfig.loop,this.pan=this.currentConfig.pan},resetConfig:function(){this.currentConfig.seek=0,this.currentConfig.delay=0},update:a,calculateRate:function(){var t=this.currentConfig.detune+this.manager.detune,e=Math.pow(1.0005777895065548,t);this.totalRate=this.currentConfig.rate*this.manager.rate*e},destroy:function(){this.pendingRemove||(this.emit(r.DESTROY,this),this.pendingRemove=!0,this.manager=null,this.key="",this.removeAllListeners(),this.isPlaying=!1,this.isPaused=!1,this.config=null,this.currentConfig=null,this.markers=null,this.currentMarker=null)}});t.exports=h},12486:(t,e,i)=>{var s=i(56694),n=i(32742),r=i(6659),o=i(76038),a=i(97081),h=i(72283),l=i(71608),u=i(51463),c=new s({Extends:r,initialize:function(t){r.call(this),this.game=t,this.jsonCache=t.cache.json,this.sounds=[],this.mute=!1,this.volume=1,this.pauseOnBlur=!0,this._rate=1,this._detune=0,this.locked=this.locked||!1,this.unlocked=!1,t.events.on(a.BLUR,this.onGameBlur,this),t.events.on(a.FOCUS,this.onGameFocus,this),t.events.on(a.PRE_STEP,this.update,this),t.events.once(a.DESTROY,this.destroy,this)},add:h,addAudioSprite:function(t,e){void 0===e&&(e={});var i=this.add(t,e);for(var s in i.spritemap=this.jsonCache.get(t).spritemap,i.spritemap)if(i.spritemap.hasOwnProperty(s)){var r=n(e),o=i.spritemap[s];r.loop=!!o.hasOwnProperty("loop")&&o.loop,i.addMarker({name:s,start:o.start,duration:o.end-o.start,config:r})}return i},get:function(t){return u(this.sounds,"key",t)},getAll:function(t){return l(this.sounds,"key",t)},play:function(t,e){var i=this.add(t);return i.once(o.COMPLETE,i.destroy,i),e?e.name?(i.addMarker(e),i.play(e.name)):i.play(e):i.play()},playAudioSprite:function(t,e,i){var s=this.addAudioSprite(t);return s.once(o.COMPLETE,s.destroy,s),s.play(e,i)},remove:function(t){var e=this.sounds.indexOf(t);return-1!==e&&(t.destroy(),this.sounds.splice(e,1),!0)},removeAll:function(){this.sounds.forEach((function(t){t.destroy()})),this.sounds.length=0},removeByKey:function(t){for(var e=0,i=this.sounds.length-1;i>=0;i--){var s=this.sounds[i];s.key===t&&(s.destroy(),this.sounds.splice(i,1),e++)}return e},pauseAll:function(){this.forEachActiveSound((function(t){t.pause()})),this.emit(o.PAUSE_ALL,this)},resumeAll:function(){this.forEachActiveSound((function(t){t.resume()})),this.emit(o.RESUME_ALL,this)},stopAll:function(){this.forEachActiveSound((function(t){t.stop()})),this.emit(o.STOP_ALL,this)},stopByKey:function(t){var e=0;return this.getAll(t).forEach((function(t){t.stop()&&e++})),e},unlock:h,onBlur:h,onFocus:h,onGameBlur:function(){this.pauseOnBlur&&this.onBlur()},onGameFocus:function(){this.pauseOnBlur&&this.onFocus()},update:function(t,e){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit(o.UNLOCKED,this));for(var i=this.sounds.length-1;i>=0;i--)this.sounds[i].pendingRemove&&this.sounds.splice(i,1);this.sounds.forEach((function(i){i.update(t,e)}))},destroy:function(){this.game.events.off(a.BLUR,this.onGameBlur,this),this.game.events.off(a.FOCUS,this.onGameFocus,this),this.game.events.off(a.PRE_STEP,this.update,this),this.removeAllListeners(),this.removeAll(),this.sounds.length=0,this.sounds=null,this.game=null},forEachActiveSound:function(t,e){var i=this;this.sounds.forEach((function(s,n){s&&!s.pendingRemove&&t.call(e||i,s,n,i.sounds)}))},setRate:function(t){return this.rate=t,this},rate:{get:function(){return this._rate},set:function(t){this._rate=t,this.forEachActiveSound((function(t){t.calculateRate()})),this.emit(o.GLOBAL_RATE,this,t)}},setDetune:function(t){return this.detune=t,this},detune:{get:function(){return this._detune},set:function(t){this._detune=t,this.forEachActiveSound((function(t){t.calculateRate()})),this.emit(o.GLOBAL_DETUNE,this,t)}}});t.exports=c},84191:(t,e,i)=>{var s=i(27622),n=i(17546),r=i(55491),o={create:function(t){var e=t.config.audio,i=t.device.audio;return e.noAudio||!i.webAudio&&!i.audioData?new n(t):i.webAudio&&!e.disableWebAudio?new r(t):new s(t)}};t.exports=o},77578:t=>{t.exports="complete"},19679:t=>{t.exports="decodedall"},56951:t=>{t.exports="decoded"},16436:t=>{t.exports="destroy"},55154:t=>{t.exports="detune"},57818:t=>{t.exports="detune"},57890:t=>{t.exports="mute"},83022:t=>{t.exports="rate"},99170:t=>{t.exports="volume"},64289:t=>{t.exports="looped"},67214:t=>{t.exports="loop"},53128:t=>{t.exports="mute"},73078:t=>{t.exports="pan"},76763:t=>{t.exports="pauseall"},88426:t=>{t.exports="pause"},13765:t=>{t.exports="play"},80291:t=>{t.exports="rate"},11124:t=>{t.exports="resumeall"},55382:t=>{t.exports="resume"},71157:t=>{t.exports="seek"},31776:t=>{t.exports="stopall"},39450:t=>{t.exports="stop"},21939:t=>{t.exports="unlocked"},33019:t=>{t.exports="volume"},76038:(t,e,i)=>{t.exports={COMPLETE:i(77578),DECODED:i(56951),DECODED_ALL:i(19679),DESTROY:i(16436),DETUNE:i(55154),GLOBAL_DETUNE:i(57818),GLOBAL_MUTE:i(57890),GLOBAL_RATE:i(83022),GLOBAL_VOLUME:i(99170),LOOP:i(67214),LOOPED:i(64289),MUTE:i(53128),PAN:i(73078),PAUSE_ALL:i(76763),PAUSE:i(88426),PLAY:i(13765),RATE:i(80291),RESUME_ALL:i(11124),RESUME:i(55382),SEEK:i(71157),STOP_ALL:i(31776),STOP:i(39450),UNLOCKED:i(21939),VOLUME:i(33019)}},34350:(t,e,i)=>{var s=i(25798),n=i(56694),r=i(76038),o=i(82897),a=new n({Extends:s,initialize:function(t,e,i){if(void 0===i&&(i={}),this.tags=t.game.cache.audio.get(e),!this.tags)throw new Error('There is no audio asset with key "'+e+'" in the audio cache');this.audio=null,this.startTime=0,this.previousTime=0,this.duration=this.tags[0].duration,this.totalDuration=this.tags[0].duration,s.call(this,t,e,i)},play:function(t,e){return!this.manager.isLocked(this,"play",[t,e])&&(!!s.prototype.play.call(this,t,e)&&(!!this.pickAndPlayAudioTag()&&(this.emit(r.PLAY,this),!0)))},pause:function(){return!this.manager.isLocked(this,"pause")&&(!(this.startTime>0)&&(!!s.prototype.pause.call(this)&&(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit(r.PAUSE,this),!0)))},resume:function(){return!this.manager.isLocked(this,"resume")&&(!(this.startTime>0)&&(!!s.prototype.resume.call(this)&&(!!this.pickAndPlayAudioTag()&&(this.emit(r.RESUME,this),!0))))},stop:function(){return!this.manager.isLocked(this,"stop")&&(!!s.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit(r.STOP,this),!0))},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var t=this.currentConfig.seek,e=this.currentConfig.delay,i=(this.currentMarker?this.currentMarker.start:0)+t;return this.previousTime=i,this.audio.currentTime=i,this.applyConfig(),0===e?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+1e3*e,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var t=0;t0)this.startTime=i-this.manager.loopEndOffset?(this.audio.currentTime=e+Math.max(0,s-i),s=this.audio.currentTime):s=i)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit(r.COMPLETE,this);this.previousTime=s}},destroy:function(){s.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=o(this.currentConfig.volume*this.manager.volume,0,1))},calculateRate:function(){s.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(t){this.currentConfig.mute=t,this.manager.isLocked(this,"mute",t)||(this.updateMute(),this.emit(r.MUTE,this,t))}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.currentConfig.volume},set:function(t){this.currentConfig.volume=t,this.manager.isLocked(this,"volume",t)||(this.updateVolume(),this.emit(r.VOLUME,this,t))}},setVolume:function(t){return this.volume=t,this},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.manager.isLocked(this,r.RATE,t)||(this.calculateRate(),this.emit(r.RATE,this,t))}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.manager.isLocked(this,r.DETUNE,t)||(this.calculateRate(),this.emit(r.DETUNE,this,t))}},setDetune:function(t){return this.detune=t,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.isLocked(this,"seek",t)||this.startTime>0||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.isPlaying?(this.previousTime=t,this.audio.currentTime=t):this.isPaused&&(this.currentConfig.seek=t),this.emit(r.SEEK,this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.manager.isLocked(this,"loop",t)||(this.audio&&(this.audio.loop=t),this.emit(r.LOOP,this,t))}},setLoop:function(t){return this.loop=t,this},pan:{get:function(){return this.currentConfig.pan},set:function(t){this.currentConfig.pan=t,this.emit(r.PAN,this,t)}},setPan:function(t){return this.pan=t,this}});t.exports=a},27622:(t,e,i)=>{var s=i(12486),n=i(56694),r=i(76038),o=i(34350),a=new n({Extends:s,initialize:function(t){this.override=!0,this.audioPlayDelay=.1,this.loopEndOffset=.05,this.onBlurPausedSounds=[],this.locked="ontouchstart"in window,this.lockedActionsQueue=this.locked?[]:null,this._mute=!1,this._volume=1,s.call(this,t)},add:function(t,e){var i=new o(this,t,e);return this.sounds.push(i),i},unlock:function(){this.locked=!1;var t=this;if(this.game.cache.audio.entries.each((function(e,i){for(var s=0;s{t.exports={SoundManagerCreator:i(84191),Events:i(76038),BaseSound:i(25798),BaseSoundManager:i(12486),WebAudioSound:i(96008),WebAudioSoundManager:i(55491),HTML5AudioSound:i(34350),HTML5AudioSoundManager:i(27622),NoAudioSound:i(38662),NoAudioSoundManager:i(17546)}},38662:(t,e,i)=>{var s=i(25798),n=i(56694),r=i(6659),o=i(98611),a=function(){return!1},h=function(){return this},l=new n({Extends:r,initialize:function(t,e,i){void 0===i&&(i={}),r.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=0,this.totalDuration=0,this.config=o({mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0},i),this.currentConfig=this.config,this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.seek=0,this.loop=!1,this.pan=0,this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:a,updateMarker:a,removeMarker:function(){return null},play:a,pause:a,resume:a,stop:a,destroy:function(){s.prototype.destroy.call(this)},setMute:h,setVolume:h,setRate:h,setDetune:h,setSeek:h,setLoop:h,setPan:h});t.exports=l},17546:(t,e,i)=>{var s=i(12486),n=i(56694),r=i(6659),o=i(38662),a=i(72283),h=new n({Extends:r,initialize:function(t){r.call(this),this.game=t,this.sounds=[],this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.pauseOnBlur=!0,this.locked=!1},add:function(t,e){var i=new o(this,t,e);return this.sounds.push(i),i},addAudioSprite:function(t,e){var i=this.add(t,e);return i.spritemap={},i},play:function(t,e){return!1},playAudioSprite:function(t,e,i){return!1},remove:function(t){return s.prototype.remove.call(this,t)},removeByKey:function(t){return s.prototype.removeByKey.call(this,t)},pauseAll:a,resumeAll:a,stopAll:a,update:a,setRate:a,setDetune:a,setMute:a,setVolume:a,forEachActiveSound:function(t,e){s.prototype.forEachActiveSound.call(this,t,e)},destroy:function(){s.prototype.destroy.call(this)}});t.exports=h},96008:(t,e,i)=>{var s=i(25798),n=i(56694),r=i(76038),o=new n({Extends:s,initialize:function(t,e,i){if(void 0===i&&(i={}),this.audioBuffer=t.game.cache.audio.get(e),!this.audioBuffer)throw new Error('Audio key "'+e+'" missing from cache');this.source=null,this.loopSource=null,this.muteNode=t.context.createGain(),this.volumeNode=t.context.createGain(),this.pannerNode=null,this.playTime=0,this.startTime=0,this.loopTime=0,this.rateUpdates=[],this.hasEnded=!1,this.hasLooped=!1,this.muteNode.connect(this.volumeNode),t.context.createStereoPanner?(this.pannerNode=t.context.createStereoPanner(),this.volumeNode.connect(this.pannerNode),this.pannerNode.connect(t.destination)):this.volumeNode.connect(t.destination),this.duration=this.audioBuffer.duration,this.totalDuration=this.audioBuffer.duration,s.call(this,t,e,i)},play:function(t,e){return!!s.prototype.play.call(this,t,e)&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource(),this.emit(r.PLAY,this),!0)},pause:function(){return!(this.manager.context.currentTime{var s=i(82329),n=i(12486),r=i(56694),o=i(76038),a=i(97081),h=i(96008),l=new r({Extends:n,initialize:function(t){this.context=this.createAudioContext(t),this.masterMuteNode=this.context.createGain(),this.masterVolumeNode=this.context.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(this.context.destination),this.destination=this.masterMuteNode,this.locked="suspended"===this.context.state&&("ontouchstart"in window||"onclick"in window),n.call(this,t),this.locked&&t.isBooted?this.unlock():t.events.once(a.BOOT,this.unlock,this)},createAudioContext:function(t){var e=t.config.audio;return e.context?(e.context.resume(),e.context):window.hasOwnProperty("AudioContext")?new AudioContext:window.hasOwnProperty("webkitAudioContext")?new window.webkitAudioContext:void 0},setAudioContext:function(t){return this.context&&this.context.close(),this.masterMuteNode&&this.masterMuteNode.disconnect(),this.masterVolumeNode&&this.masterVolumeNode.disconnect(),this.context=t,this.masterMuteNode=t.createGain(),this.masterVolumeNode=t.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(t.destination),this.destination=this.masterMuteNode,this},add:function(t,e){var i=new h(this,t,e);return this.sounds.push(i),i},decodeAudio:function(t,e){var i;i=Array.isArray(t)?t:[{key:t,data:e}];for(var n=this.game.cache.audio,r=i.length,a=0;a{var s=i(59959),n=i(56694),r=i(72283),o=i(17922),a=new n({initialize:function(t){this.parent=t,this.list=[],this.position=0,this.addCallback=r,this.removeCallback=r,this._sortKey=""},add:function(t,e){return e?s.Add(this.list,t):s.Add(this.list,t,0,this.addCallback,this)},addAt:function(t,e,i){return i?s.AddAt(this.list,t,e):s.AddAt(this.list,t,e,0,this.addCallback,this)},getAt:function(t){return this.list[t]},getIndex:function(t){return this.list.indexOf(t)},sort:function(t,e){return t?(void 0===e&&(e=function(e,i){return e[t]-i[t]}),o(this.list,e),this):this},getByName:function(t){return s.GetFirst(this.list,"name",t)},getRandom:function(t,e){return s.GetRandom(this.list,t,e)},getFirst:function(t,e,i,n){return s.GetFirst(this.list,t,e,i,n)},getAll:function(t,e,i,n){return s.GetAll(this.list,t,e,i,n)},count:function(t,e){return s.CountAllMatching(this.list,t,e)},swap:function(t,e){s.Swap(this.list,t,e)},moveTo:function(t,e){return s.MoveTo(this.list,t,e)},moveAbove:function(t,e){return s.MoveAbove(this.list,t,e)},moveBelow:function(t,e){return s.MoveBelow(this.list,t,e)},remove:function(t,e){return e?s.Remove(this.list,t):s.Remove(this.list,t,this.removeCallback,this)},removeAt:function(t,e){return e?s.RemoveAt(this.list,t):s.RemoveAt(this.list,t,this.removeCallback,this)},removeBetween:function(t,e,i){return i?s.RemoveBetween(this.list,t,e):s.RemoveBetween(this.list,t,e,this.removeCallback,this)},removeAll:function(t){for(var e=this.list.length;e--;)this.remove(this.list[e],t);return this},bringToTop:function(t){return s.BringToTop(this.list,t)},sendToBack:function(t){return s.SendToBack(this.list,t)},moveUp:function(t){return s.MoveUp(this.list,t),t},moveDown:function(t){return s.MoveDown(this.list,t),t},reverse:function(){return this.list.reverse(),this},shuffle:function(){return s.Shuffle(this.list),this},replace:function(t,e){return s.Replace(this.list,t,e)},exists:function(t){return this.list.indexOf(t)>-1},setAll:function(t,e,i,n){return s.SetAll(this.list,t,e,i,n),this},each:function(t,e){for(var i=[null],s=2;s0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}}});t.exports=a},33885:(t,e,i)=>{var s=new(i(56694))({initialize:function(t){if(this.entries={},this.size=0,Array.isArray(t))for(var e=0;e{var s=i(56694),n=i(6659),r=i(36716),o=new s({Extends:n,initialize:function(){n.call(this),this._pending=[],this._active=[],this._destroy=[],this._toProcess=0,this.checkQueue=!1},add:function(t){return this._pending.push(t),this._toProcess++,t},remove:function(t){return this._destroy.push(t),this._toProcess++,t},removeAll:function(){for(var t=this._active,e=this._destroy,i=t.length;i--;)e.push(t[i]),this._toProcess++;return this},update:function(){if(0===this._toProcess)return this._active;var t,e,i=this._destroy,s=this._active;for(t=0;t{var s=i(53466);function n(t){if(!(this instanceof n))return new n(t,[".left",".top",".right",".bottom"]);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}function r(t,e,i){if(!i)return e.indexOf(t);for(var s=0;s=t.minX&&e.maxY>=t.minY}function v(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(t,e,i,n,r){for(var o,a=[e,i];a.length;)(i=a.pop())-(e=a.pop())<=n||(o=e+Math.ceil((i-e)/n/2)*n,s(t,o,e,i,r),a.push(e,o,o,i))}n.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],s=this.toBBox;if(!f(t,e))return i;for(var n,r,o,a,h=[];e;){for(n=0,r=e.children.length;n=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(n,r,e)},_split:function(t,e){var i=t[e],s=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,s);var r=this._chooseSplitIndex(i,n,s),a=v(i.children.splice(r,i.children.length-r));a.height=i.height,a.leaf=i.leaf,o(i,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(t,e){this.data=v([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var s,n,r,o,h,l,u,d,p,f,v,g,m,y;for(l=u=1/0,s=e;s<=i-e;s++)n=a(t,0,s,this.toBBox),r=a(t,s,i,this.toBBox),p=n,f=r,v=void 0,g=void 0,m=void 0,y=void 0,v=Math.max(p.minX,f.minX),g=Math.max(p.minY,f.minY),m=Math.min(p.maxX,f.maxX),y=Math.min(p.maxY,f.maxY),o=Math.max(0,m-v)*Math.max(0,y-g),h=c(n)+c(r),o=e;n--)r=t.children[n],h(u,t.leaf?o(r):r),c+=d(u);return c},_adjustParentBBoxes:function(t,e,i){for(var s=i;s>=0;s--)h(e[s],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():o(t[i],this.toBBox)},compareMinX:function(t,e){return t.left-e.left},compareMinY:function(t,e){return t.top-e.top},toBBox:function(t){return{minX:t.left,minY:t.top,maxX:t.right,maxY:t.bottom}}},t.exports=n},58403:(t,e,i)=>{var s=new(i(56694))({initialize:function(t){if(this.entries=[],Array.isArray(t))for(var e=0;e-1&&this.entries.splice(e,1),this},dump:function(){console.group("Set");for(var t=0;t-1},union:function(t){var e=new s;return t.entries.forEach((function(t){e.set(t)})),this.entries.forEach((function(t){e.set(t)})),e},intersect:function(t){var e=new s;return this.entries.forEach((function(i){t.contains(i)&&e.set(i)})),e},difference:function(t){var e=new s;return this.entries.forEach((function(i){t.contains(i)||e.set(i)})),e},size:{get:function(){return this.entries.length},set:function(t){return t{var s=i(82897),n=i(56694),r=i(84314),o=i(93736),a=new n({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===s&&(s=null),this._width=t,this._height=e,this._parent=s,this.aspectMode=i,this.aspectRatio=0===e?1:t/e,this.minWidth=0,this.minHeight=0,this.maxWidth=Number.MAX_VALUE,this.maxHeight=Number.MAX_VALUE,this.snapTo=new o},setAspectMode:function(t){return void 0===t&&(t=0),this.aspectMode=t,this.setSize(this._width,this._height)},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.snapTo.set(t,e),this.setSize(this._width,this._height)},setParent:function(t){return this._parent=t,this.setSize(this._width,this._height)},setMin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.minWidth=s(t,0,this.maxWidth),this.minHeight=s(e,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(t,e){return void 0===t&&(t=Number.MAX_VALUE),void 0===e&&(e=t),this.maxWidth=s(t,this.minWidth,Number.MAX_VALUE),this.maxHeight=s(e,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(t,e){switch(void 0===t&&(t=0),void 0===e&&(e=t),this.aspectMode){case a.NONE:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height;break;case a.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case a.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(r(e,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case a.FIT:this.constrain(t,e,!0);break;case a.ENVELOP:this.constrain(t,e,!1)}return this},setAspectRatio:function(t){return this.aspectRatio=t,this.setSize(this._width,this._height)},resize:function(t,e){return this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height,this},getNewWidth:function(t,e){return void 0===e&&(e=!0),t=s(t,this.minWidth,this.maxWidth),e&&this._parent&&t>this._parent.width&&(t=Math.max(this.minWidth,this._parent.width)),t},getNewHeight:function(t,e){return void 0===e&&(e=!0),t=s(t,this.minHeight,this.maxHeight),e&&this._parent&&t>this._parent.height&&(t=Math.max(this.minHeight,this._parent.height)),t},constrain:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=!0),t=this.getNewWidth(t),e=this.getNewHeight(e);var s=this.snapTo,n=0===e?1:t/e;return i&&this.aspectRatio>n||!i&&this.aspectRatio0&&(t=(e=r(e,s.y))*this.aspectRatio)):(i&&this.aspectRation)&&(t=(e=r(e,s.y))*this.aspectRatio,s.x>0&&(e=(t=r(t,s.x))*(1/this.aspectRatio))),this._width=t,this._height=e,this},fitTo:function(t,e){return this.constrain(t,e,!0)},envelop:function(t,e){return this.constrain(t,e,!1)},setWidth:function(t){return this.setSize(t,this._height)},setHeight:function(t){return this.setSize(this._width,t)},toString:function(){return"[{ Size (width="+this._width+" height="+this._height+" aspectRatio="+this.aspectRatio+" aspectMode="+this.aspectMode+") }]"},setCSS:function(t){t&&t.style&&(t.style.width=this._width+"px",t.style.height=this._height+"px")},copy:function(t){return t.setAspectMode(this.aspectMode),t.aspectRatio=this.aspectRatio,t.setSize(this.width,this.height)},destroy:function(){this._parent=null,this.snapTo=null},width:{get:function(){return this._width},set:function(t){this.setSize(t,this._height)}},height:{get:function(){return this._height},set:function(t){this.setSize(this._width,t)}}});a.NONE=0,a.WIDTH_CONTROLS_HEIGHT=1,a.HEIGHT_CONTROLS_WIDTH=2,a.FIT=3,a.ENVELOP=4,t.exports=a},94160:t=>{t.exports="add"},95393:t=>{t.exports="remove"},36716:(t,e,i)=>{t.exports={PROCESS_QUEUE_ADD:i(94160),PROCESS_QUEUE_REMOVE:i(95393)}},20010:(t,e,i)=>{t.exports={Events:i(36716),List:i(71207),Map:i(33885),ProcessQueue:i(74623),RTree:i(68687),Set:i(58403),Size:i(90881)}},17487:(t,e,i)=>{var s=i(56694),n=i(82897),r=i(27119),o=i(86459),a=i(28621),h=i(31673),l=new s({Extends:h,initialize:function(t,e,i,s,n){h.call(this,t,e,i,s,n),this.add("__BASE",0,0,0,s,n),this._source=this.frames.__BASE.source,this.canvas=this._source.image,this.context=this.canvas.getContext("2d"),this.width=s,this.height=n,this.imageData=this.context.getImageData(0,0,s,n),this.data=null,this.imageData&&(this.data=this.imageData.data),this.pixels=null,this.buffer,this.data&&(this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data)},update:function(){return this.imageData=this.context.getImageData(0,0,this.width,this.height),this.data=this.imageData.data,this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data,this.manager.game.config.renderType===o.WEBGL&&this.refresh(),this},draw:function(t,e,i){return this.context.drawImage(i,t,e),this.update()},drawFrame:function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=0);var n=this.manager.getFrame(t,e);if(n){var r=n.canvasData,o=n.cutWidth,a=n.cutHeight,h=n.source.resolution;return this.context.drawImage(n.source.image,r.x,r.y,o,a,i,s,o/h,a/h),this.update()}return this},setPixel:function(t,e,i,s,n,r){if(void 0===r&&(r=255),t=Math.abs(Math.floor(t)),e=Math.abs(Math.floor(e)),this.getIndex(t,e)>-1){var o=this.context.getImageData(t,e,1,1);o.data[0]=i,o.data[1]=s,o.data[2]=n,o.data[3]=r,this.context.putImageData(o,t,e)}return this},putData:function(t,e,i,s,n,r,o){return void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=t.width),void 0===o&&(o=t.height),this.context.putImageData(t,e,i,s,n,r,o),this},getData:function(t,e,i,s){return t=n(Math.floor(t),0,this.width-1),e=n(Math.floor(e),0,this.height-1),i=n(i,1,this.width-t),s=n(s,1,this.height-e),this.context.getImageData(t,e,i,s)},getPixel:function(t,e,i){i||(i=new r);var s=this.getIndex(t,e);if(s>-1){var n=this.data,o=n[s+0],a=n[s+1],h=n[s+2],l=n[s+3];i.setTo(o,a,h,l)}return i},getPixels:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===s&&(s=i),t=Math.abs(Math.round(t)),e=Math.abs(Math.round(e));for(var o=n(t,0,this.width),a=n(t+i,0,this.width),h=n(e,0,this.height),l=n(e+s,0,this.height),u=new r,c=[],d=h;d{var s=i(56694),n=i(82897),r=i(98611),o=new s({initialize:function(t,e,i,s,n,r,o){this.texture=t,this.name=e,this.source=t.source[i],this.sourceIndex=i,this.glTexture=this.source.glTexture,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0}},this.setSize(r,o,s,n)},setSize:function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=0),this.cutX=i,this.cutY=s,this.cutWidth=t,this.cutHeight=e,this.width=t,this.height=e,this.halfWidth=Math.floor(.5*t),this.halfHeight=Math.floor(.5*e),this.centerX=Math.floor(t/2),this.centerY=Math.floor(e/2);var n=this.data,r=n.cut;r.x=i,r.y=s,r.w=t,r.h=e,r.r=i+t,r.b=s+e,n.sourceSize.w=t,n.sourceSize.h=e,n.spriteSourceSize.w=t,n.spriteSourceSize.h=e,n.radius=.5*Math.sqrt(t*t+e*e);var o=n.drawImage;return o.x=i,o.y=s,o.width=t,o.height=e,this.updateUVs()},setTrim:function(t,e,i,s,n,r){var o=this.data,a=o.spriteSourceSize;return o.trim=!0,o.sourceSize.w=t,o.sourceSize.h=e,a.x=i,a.y=s,a.w=n,a.h=r,a.r=i+n,a.b=s+r,this.x=i,this.y=s,this.width=n,this.height=r,this.halfWidth=.5*n,this.halfHeight=.5*r,this.centerX=Math.floor(n/2),this.centerY=Math.floor(r/2),this.updateUVs()},setCropUVs:function(t,e,i,s,r,o,a){var h=this.cutX,l=this.cutY,u=this.cutWidth,c=this.cutHeight,d=this.realWidth,p=this.realHeight,f=h+(e=n(e,0,d)),v=l+(i=n(i,0,p)),g=s=n(s,0,d-e),m=r=n(r,0,p-i),y=this.data;if(y.trim){var x=y.spriteSourceSize,T=e+(s=n(s,0,u-e)),w=i+(r=n(r,0,c-i));if(!(x.rT||x.y>w)){var b=Math.max(x.x,e),E=Math.max(x.y,i),S=Math.min(x.r,T)-b,A=Math.min(x.b,w)-E;g=S,m=A,f=o?h+(u-(b-x.x)-S):h+(b-x.x),v=a?l+(c-(E-x.y)-A):l+(E-x.y),e=b,i=E,s=S,r=A}else f=0,v=0,g=0,m=0}else o&&(f=h+(u-e-s)),a&&(v=l+(c-i-r));var _=this.source.width,C=this.source.height;return t.u0=Math.max(0,f/_),t.v0=Math.max(0,v/C),t.u1=Math.min(1,(f+g)/_),t.v1=Math.min(1,(v+m)/C),t.x=e,t.y=i,t.cx=f,t.cy=v,t.cw=g,t.ch=m,t.width=s,t.height=r,t.flipX=o,t.flipY=a,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},setUVs:function(t,e,i,s,n,r){var o=this.data.drawImage;return o.width=t,o.height=e,this.u0=i,this.v0=s,this.u1=n,this.v1=r,this},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,s=this.cutHeight,n=this.data.drawImage;n.width=i,n.height=s;var r=this.source.width,o=this.source.height;return this.u0=t/r,this.v0=e/o,this.u1=(t+i)/r,this.v1=(e+s)/o,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new o(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=r(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.source=null,this.texture=null,this.glTexture=null,this.customData=null,this.data=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=o},31673:(t,e,i)=>{var s=i(86459),n=i(56694),r=i(82047),o=i(32547),a='Texture "%s" has no frame "%s"',h=new n({initialize:function(t,e,i,s,n){Array.isArray(i)||(i=[i]),this.manager=t,this.key=e,this.source=[],this.dataSource=[],this.frames={},this.customData={},this.firstFrame="__BASE",this.frameTotal=0;for(var r=0;r{var s=i(61068),n=i(17487),r=i(56694),o=i(27119),a=i(86459),h=i(6659),l=i(38203),u=i(97081),c=i(52780),d=i(10850),p=i(69150),f=i(31673),v=new r({Extends:h,initialize:function(t){h.call(this),this.game=t,this.name="TextureManager",this.list={},this._tempCanvas=s.create2D(this,1,1),this._tempContext=this._tempCanvas.getContext("2d"),this._pending=0,t.events.once(u.BOOT,this.boot,this)},boot:function(){this._pending=3,this.on(l.LOAD,this.updatePending,this),this.on(l.ERROR,this.updatePending,this);var t=this.game.config;this.addBase64("__DEFAULT",t.defaultImage),this.addBase64("__MISSING",t.missingImage),this.addBase64("__WHITE",t.whiteImage),this.game.events.once(u.DESTROY,this.destroy,this)},updatePending:function(){this._pending--,0===this._pending&&(this.off(l.LOAD),this.off(l.ERROR),this.emit(l.READY))},checkKey:function(t){return!this.exists(t)||(console.error("Texture key already in use: "+t),!1)},remove:function(t){if("string"==typeof t){if(!this.exists(t))return console.warn("No texture found matching key: "+t),this;t=this.get(t)}return this.list.hasOwnProperty(t.key)&&(t.destroy(),this.emit(l.REMOVE,t.key)),this},removeKey:function(t){return this.list.hasOwnProperty(t)&&delete this.list[t],this},addBase64:function(t,e){if(this.checkKey(t)){var i=this,s=new Image;s.onerror=function(){i.emit(l.ERROR,t)},s.onload=function(){var e=i.create(t,s);p.Image(e,0),i.emit(l.ADD,t,e),i.emit(l.LOAD,t,e)},s.src=e}return this},getBase64:function(t,e,i,n){void 0===i&&(i="image/png"),void 0===n&&(n=.92);var r="",o=this.getFrame(t,e);if(o&&(o.source.isRenderTexture||o.source.isGLTexture))console.warn("Cannot getBase64 from WebGL Texture");else if(o){var a=o.canvasData,h=s.create2D(this,a.width,a.height);h.getContext("2d").drawImage(o.source.image,a.x,a.y,a.width,a.height,0,0,a.width,a.height),r=h.toDataURL(i,n),s.remove(h)}return r},addImage:function(t,e,i){var s=null;return this.checkKey(t)&&(s=this.create(t,e),p.Image(s,0),i&&s.setDataSource(i),this.emit(l.ADD,t,s)),s},addGLTexture:function(t,e,i,s){var n=null;return this.checkKey(t)&&(void 0===i&&(i=e.width),void 0===s&&(s=e.height),(n=this.create(t,e,i,s)).add("__BASE",0,0,0,i,s),this.emit(l.ADD,t,n)),n},addCompressedTexture:function(t,e,i){var s=null;if(this.checkKey(t)){if((s=this.create(t,e)).add("__BASE",0,0,0,e.width,e.height),i)if(Array.isArray(i))for(var n=0;n=r.x&&t=r.y&&e=r.x&&t=r.y&&e{var s=i(61068),n=i(56694),r=i(28621),o=i(27394),a=new n({initialize:function(t,e,i,s,n){void 0===n&&(n=!1);var a=t.manager.game;this.renderer=a.renderer,this.texture=t,this.source=e,this.image=e.compressed?null:e,this.compressionAlgorithm=e.compressed?e.format:null,this.resolution=1,this.width=i||e.naturalWidth||e.videoWidth||e.width||0,this.height=s||e.naturalHeight||e.videoHeight||e.height||0,this.scaleMode=o.DEFAULT,this.isCanvas=e instanceof HTMLCanvasElement,this.isVideo=window.hasOwnProperty("HTMLVideoElement")&&e instanceof HTMLVideoElement,this.isRenderTexture="RenderTexture"===e.type,this.isGLTexture=window.hasOwnProperty("WebGLTexture")&&e instanceof WebGLTexture,this.isPowerOf2=r(this.width,this.height),this.glTexture=null,this.glIndex=0,this.glIndexCounter=-1,this.flipY=n,this.init(a)},init:function(t){var e=this.renderer;e&&(e.gl?this.isCanvas?this.glTexture=e.createCanvasTexture(this.image,!1,this.flipY):this.isVideo?this.glTexture=e.createVideoTexture(this.image,!1,this.flipY):this.isRenderTexture?(this.image=this.source.canvas,this.glTexture=e.createTextureFromSource(null,this.width,this.height,this.scaleMode)):this.isGLTexture?this.glTexture=this.source:this.compressionAlgorithm?this.glTexture=e.createTextureFromSource(this.source):this.glTexture=e.createTextureFromSource(this.image,this.width,this.height,this.scaleMode):this.isRenderTexture&&(this.image=this.source.canvas)),t.config.antialias||this.setFilter(1)},setFilter:function(t){this.renderer.gl&&this.renderer.setTextureFilter(this.glTexture,t),this.scaleMode=t},setFlipY:function(t){return void 0===t&&(t=!0),this.flipY=t,this},update:function(){var t=this.renderer.gl;t&&this.isCanvas?this.glTexture=this.renderer.updateCanvasTexture(this.image,this.glTexture,this.flipY):t&&this.isVideo&&(this.glTexture=this.renderer.updateVideoTexture(this.image,this.glTexture,this.flipY))},destroy:function(){this.glTexture&&this.renderer.deleteTexture(this.glTexture,!0),this.isCanvas&&s.remove(this.image),this.renderer=null,this.texture=null,this.source=null,this.image=null,this.glTexture=null}});t.exports=a},65154:t=>{t.exports={LINEAR:0,NEAREST:1}},49644:t=>{t.exports="addtexture"},60079:t=>{t.exports="onerror"},72665:t=>{t.exports="onload"},93006:t=>{t.exports="ready"},69018:t=>{t.exports="removetexture"},38203:(t,e,i)=>{t.exports={ADD:i(49644),ERROR:i(60079),LOAD:i(72665),READY:i(93006),REMOVE:i(69018)}},87499:(t,e,i)=>{var s=i(98611),n=i(65154),r={CanvasTexture:i(17487),Events:i(38203),FilterMode:n,Frame:i(82047),Parsers:i(69150),Texture:i(31673),TextureManager:i(6237),TextureSource:i(32547)};r=s(!1,r,n),t.exports=r},35082:t=>{t.exports=function(t,e,i){if(i.getElementsByTagName("TextureAtlas")){var s=t.source[e];t.add("__BASE",e,0,0,s.width,s.height);for(var n,r=i.getElementsByTagName("SubTexture"),o=0;o{t.exports=function(t,e){var i=t.source[e];return t.add("__BASE",e,0,0,i.width,i.height),t}},21560:t=>{t.exports=function(t,e){var i=t.source[e];return t.add("__BASE",e,0,0,i.width,i.height),t}},64423:(t,e,i)=>{var s=i(32742);t.exports=function(t,e,i){if(i.frames||i.textures){var n=t.source[e];t.add("__BASE",e,0,0,n.width,n.height);for(var r,o=Array.isArray(i.textures)?i.textures[e].frames:i.frames,a=0;a{var s=i(32742);t.exports=function(t,e,i){if(i.frames){var n=t.source[e];t.add("__BASE",e,0,0,n.width,n.height);var r,o=i.frames;for(var a in o)if(o.hasOwnProperty(a)){var h=o[a];r=t.add(a,e,h.frame.x,h.frame.y,h.frame.w,h.frame.h),h.trimmed&&r.setTrim(h.sourceSize.w,h.sourceSize.h,h.spriteSourceSize.x,h.spriteSourceSize.y,h.spriteSourceSize.w,h.spriteSourceSize.h),h.rotated&&(r.rotated=!0,r.updateUVsInverted());var l=h.anchor||h.pivot;l&&(r.customPivot=!0,r.pivotX=l.x,r.pivotY=l.y),r.customData=s(h)}for(var u in i)"frames"!==u&&(Array.isArray(i[u])?t.customData[u]=i[u].slice(0):t.customData[u]=i[u]);return t}console.warn("Invalid Texture Atlas JSON Hash given, missing 'frames' Object")}},67409:t=>{t.exports=function(t){var e,i=[171,75,84,88,32,49,49,187,13,10,26,10],s=new Uint8Array(t,0,12);for(e=0;e>1),v=Math.max(1,v>>1),p+=g}return{mipmaps:d,width:h,height:l,internalFormat:a,compressed:!0,generateMipmap:!1}}console.warn("KTXParser - Only compressed formats supported")}},24904:t=>{function e(t,e,i,s,n,r,o){return void 0===o&&(o=16),Math.floor((t+i)/n)*Math.floor((e+s)/r)*o}function i(t,e){return(t=Math.max(t,16))*(e=Math.max(e,8))/4}function s(t,e){return(t=Math.max(t,8))*(e=Math.max(e,8))/2}function n(t,i){return e(t,i,3,3,4,4,8)}function r(t,i){return e(t,i,3,3,4,4)}var o={0:{sizeFunc:i,glFormat:35841},1:{sizeFunc:i,glFormat:35843},2:{sizeFunc:s,glFormat:35840},3:{sizeFunc:s,glFormat:35842},6:{sizeFunc:n,glFormat:36196},7:{sizeFunc:n,glFormat:33776},8:{sizeFunc:r,glFormat:33777},9:{sizeFunc:r,glFormat:33778},11:{sizeFunc:r,glFormat:33779},22:{sizeFunc:n,glFormat:37492},23:{sizeFunc:r,glFormat:37496},24:{sizeFunc:n,glFormat:37494},25:{sizeFunc:n,glFormat:37488},26:{sizeFunc:r,glFormat:37490},27:{sizeFunc:r,glFormat:37808},28:{sizeFunc:function(t,i){return e(t,i,4,3,5,4)},glFormat:37809},29:{sizeFunc:function(t,i){return e(t,i,4,4,5,5)},glFormat:37810},30:{sizeFunc:function(t,i){return e(t,i,5,4,6,5)},glFormat:37811},31:{sizeFunc:function(t,i){return e(t,i,5,5,6,6)},glFormat:37812},32:{sizeFunc:function(t,i){return e(t,i,7,4,8,5)},glFormat:37813},33:{sizeFunc:function(t,i){return e(t,i,7,5,8,6)},glFormat:37814},34:{sizeFunc:function(t,i){return e(t,i,7,7,8,8)},glFormat:37815},35:{sizeFunc:function(t,i){return e(t,i,9,4,10,5)},glFormat:37816},36:{sizeFunc:function(t,i){return e(t,i,9,5,10,6)},glFormat:37817},37:{sizeFunc:function(t,i){return e(t,i,9,7,10,8)},glFormat:37818},38:{sizeFunc:function(t,i){return e(t,i,9,9,10,10)},glFormat:37819},39:{sizeFunc:function(t,i){return e(t,i,11,9,12,10)},glFormat:37820},40:{sizeFunc:function(t,i){return e(t,i,11,11,12,12)},glFormat:37821}};t.exports=function(t){for(var e=new Uint32Array(t,0,13),i=e[2],s=o[i].glFormat,n=o[i].sizeFunc,r=e[11],a=e[7],h=e[6],l=52+e[12],u=new Uint8Array(t,l),c=new Array(r),d=0,p=a,f=h,v=0;v>1),f=Math.max(1,f>>1),d+=g}return{mipmaps:c,width:a,height:h,internalFormat:s,compressed:!0,generateMipmap:!1}}},6143:(t,e,i)=>{var s=i(72632);t.exports=function(t,e,i,n,r,o,a){var h=s(a,"frameWidth",null),l=s(a,"frameHeight",h);if(null===h)throw new Error("TextureManager.SpriteSheet: Invalid frameWidth given.");var u=t.source[e];t.add("__BASE",e,0,0,u.width,u.height);var c=s(a,"startFrame",0),d=s(a,"endFrame",-1),p=s(a,"margin",0),f=s(a,"spacing",0),v=Math.floor((r-p+f)/(h+f))*Math.floor((o-p+f)/(l+f));0===v&&console.warn("SpriteSheet frame dimensions will result in zero frames for texture:",t.key),(c>v||c<-v)&&(c=0),c<0&&(c=v+c),-1!==d&&(v=c+(d+1));for(var g=p,m=p,y=0,x=0,T=0;Tr&&(y=w-r),b>o&&(x=b-o),t.add(T,e,i+g,n+m,h-y,l-x),(g+=h+f)+h>r&&(g=p,m+=l+f)}return t}},20030:(t,e,i)=>{var s=i(72632);t.exports=function(t,e,i){var n=s(i,"frameWidth",null),r=s(i,"frameHeight",n);if(!n)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var o=t.source[0];t.add("__BASE",0,0,0,o.width,o.height);var a,h=s(i,"startFrame",0),l=s(i,"endFrame",-1),u=s(i,"margin",0),c=s(i,"spacing",0),d=e.cutX,p=e.cutY,f=e.cutWidth,v=e.cutHeight,g=e.realWidth,m=e.realHeight,y=Math.floor((g-u+c)/(n+c)),x=Math.floor((m-u+c)/(r+c)),T=y*x,w=e.x,b=n-w,E=n-(g-f-w),S=e.y,A=r-S,_=r-(m-v-S);(h>T||h<-T)&&(h=0),h<0&&(h=T+h),-1!==l&&(T=h+(l+1));for(var C=u,M=u,R=0,P=e.sourceIndex,O=0;O{var e=0,i=function(t,i,s,n){var r=e-n.y-n.height;t.add(s,i,n.x,r,n.width,n.height)};t.exports=function(t,s,n){var r=t.source[s];t.add("__BASE",s,0,0,r.width,r.height),e=r.height;for(var o=n.split("\n"),a=/^[ ]*(- )*(\w+)+[: ]+(.*)/,h="",l="",u={x:0,y:0,width:0,height:0},c=0;c{t.exports={AtlasXML:i(35082),Canvas:i(83332),Image:i(21560),JSONArray:i(64423),JSONHash:i(17264),KTXParser:i(67409),PVRParser:i(24904),SpriteSheet:i(6143),SpriteSheetFromAtlas:i(20030),UnityYAML:i(89187)}},93560:t=>{t.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}},97042:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s,n,r,o){(void 0===i||i<=0)&&(i=32),(void 0===s||s<=0)&&(s=32),void 0===n&&(n=0),void 0===r&&(r=0),this.name=t,this.firstgid=0|e,this.imageWidth=0|i,this.imageHeight=0|s,this.imageMargin=0|n,this.imageSpacing=0|r,this.properties=o||{},this.images=[],this.total=0},containsImageIndex:function(t){return t>=this.firstgid&&t{var s=new(i(56694))({initialize:function(t){if(this.gids=[],void 0!==t)for(var e=0;e{var s=i(93560),n=i(16586),r=i(90715),o=i(89797);t.exports=function(t,e,i,a,h,l,u,c){void 0===i&&(i=32),void 0===a&&(a=32),void 0===h&&(h=10),void 0===l&&(l=10),void 0===c&&(c=!1);var d=null;if(Array.isArray(u))d=r(void 0!==e?e:"map",s.ARRAY_2D,u,i,a,c);else if(void 0!==e){var p=t.cache.tilemap.get(e);p?d=r(e,p.format,p.data,i,a,c):console.warn("No map data found for key "+e)}return null===d&&(d=new n({tileWidth:i,tileHeight:a,width:h,height:l})),new o(t,d)}},29633:(t,e,i)=>{var s=i(12920),n=i(56694),r=i(64937),o=i(66658),a=new n({Mixins:[r.Alpha,r.Flip,r.Visible],initialize:function(t,e,i,s,n,r,o,a){this.layer=t,this.index=e,this.x=i,this.y=s,this.width=n,this.height=r,this.right,this.bottom,this.baseWidth=void 0!==o?o:n,this.baseHeight=void 0!==a?a:r,this.pixelX=0,this.pixelY=0,this.updatePixelXY(),this.properties={},this.rotation=0,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceLeft=!1,this.faceRight=!1,this.faceTop=!1,this.faceBottom=!1,this.collisionCallback=void 0,this.collisionCallbackContext=this,this.tint=16777215,this.physics={}},containsPoint:function(t,e){return!(tthis.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=t.properties,this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldXY(this.x,this.y,void 0,t).x:this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldY(this.y,t)-(this.height-this.baseHeight)*e.scaleY:this.y*this.baseHeight-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new o),e.x=this.getLeft(t),e.y=this.getTop(t),e.width=this.getRight(t)-e.x,e.height=this.getBottom(t)-e.y,e},getCenterX:function(t){return(this.getLeft(t)+this.getRight(t))/2},getCenterY:function(t){return(this.getTop(t)+this.getBottom(t))/2},intersects:function(t,e,i,s){return!(i<=this.pixelX||s<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){(void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,s,n){(void 0===e&&(e=t),void 0===i&&(i=t),void 0===s&&(s=t),void 0===n&&(n=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=s,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=s,n)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,s){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==s&&(this.baseHeight=s),this.updatePixelXY(),this},updatePixelXY:function(){var t=this.layer.orientation;if(t===s.ORTHOGONAL)this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight;else if(t===s.ISOMETRIC)this.pixelX=(this.x-this.y)*this.baseWidth*.5,this.pixelY=(this.x+this.y)*this.baseHeight*.5;else if(t===s.STAGGERED)this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*(this.baseHeight/2);else if(t===s.HEXAGONAL){var e=this.layer.hexSideLength,i=(this.baseHeight-e)/2+e;this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*i}return this.right=this.pixelX+this.baseWidth,this.bottom=this.pixelY+this.baseHeight,this},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||void 0!==this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.layer.tilemapLayer;if(t){var e=t.gidMap[this.index];if(e)return e}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=a},89797:(t,e,i)=>{var s=i(56694),n=i(75606),r=i(93560),o=i(72632),a=i(94990),h=i(46422),l=i(12920),u=i(52257),c=i(72677),d=i(13747),p=i(29633),f=i(5047),v=i(87177),g=i(47975),m=new s({initialize:function(t,e){this.scene=t,this.tileWidth=e.tileWidth,this.tileHeight=e.tileHeight,this.width=e.width,this.height=e.height,this.orientation=e.orientation,this.renderOrder=e.renderOrder,this.format=e.format,this.version=e.version,this.properties=e.properties,this.widthInPixels=e.widthInPixels,this.heightInPixels=e.heightInPixels,this.imageCollections=e.imageCollections,this.images=e.images,this.layers=e.layers,this.tilesets=e.tilesets,this.objects=e.objects,this.currentLayerIndex=0,this.hexSideLength=e.hexSideLength;var i=this.orientation;this._convert={WorldToTileXY:f.GetWorldToTileXYFunction(i),WorldToTileX:f.GetWorldToTileXFunction(i),WorldToTileY:f.GetWorldToTileYFunction(i),TileToWorldXY:f.GetTileToWorldXYFunction(i),TileToWorldX:f.GetTileToWorldXFunction(i),TileToWorldY:f.GetTileToWorldYFunction(i)}},createBlankDynamicLayer:function(t,e,i,s,n,r,o,a){return console.warn("createBlankDynamicLayer is deprecated. Use createBlankLayer"),this.createBlankLayer(t,e,i,s,n,r,o,a)},createDynamicLayer:function(t,e,i,s){return console.warn("createDynamicLayer is deprecated. Use createLayer"),this.createLayer(t,e,i,s)},createStaticLayer:function(t,e,i,s){return console.warn("createStaticLayer is deprecated. Use createLayer"),this.createLayer(t,e,i,s)},setRenderOrder:function(t){var e=["right-down","left-down","right-up","left-up"];return"number"==typeof t&&(t=e[t]),e.indexOf(t)>-1&&(this.renderOrder=t),this},addTilesetImage:function(t,e,i,s,n,o,a){if(void 0===t)return null;if(null==e&&(e=t),!this.scene.sys.textures.exists(e))return console.warn("Invalid Tileset Image: "+e),null;var h=this.scene.sys.textures.get(e),l=this.getTilesetIndex(t);if(null===l&&this.format===r.TILED_JSON)return console.warn("No data found for Tileset: "+t),null;var u=this.tilesets[l];return u?(u.setTileSize(i,s),u.setSpacing(n,o),u.setImage(h),u):(void 0===i&&(i=this.tileWidth),void 0===s&&(s=this.tileHeight),void 0===n&&(n=0),void 0===o&&(o=0),void 0===a&&(a=0),(u=new g(t,a,i,s,n,o)).setImage(h),this.tilesets.push(u),u)},copy:function(t,e,i,s,n,r,o,a){return null!==(a=this.getLayer(a))?(f.Copy(t,e,i,s,n,r,o,a),this):null},createBlankLayer:function(t,e,i,s,n,r,o,h){if(void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=this.width),void 0===r&&(r=this.height),void 0===o&&(o=this.tileWidth),void 0===h&&(h=this.tileHeight),null!==this.getLayerIndex(t))return console.warn("Invalid Tilemap Layer ID: "+t),null;for(var l,u=new a({name:t,tileWidth:o,tileHeight:h,width:n,height:r,orientation:this.orientation}),c=0;c-1&&this.putTileAt(e,r.x,r.y,i,r.tilemapLayer)}return s},removeTileAt:function(t,e,i,s,n){return void 0===i&&(i=!0),void 0===s&&(s=!0),null===(n=this.getLayer(n))?null:f.RemoveTileAt(t,e,i,s,n)},removeTileAtWorldXY:function(t,e,i,s,n,r){return void 0===i&&(i=!0),void 0===s&&(s=!0),null===(r=this.getLayer(r))?null:f.RemoveTileAtWorldXY(t,e,i,s,n,r)},renderDebug:function(t,e,i){return null===(i=this.getLayer(i))?null:(this.orientation===l.ORTHOGONAL&&f.RenderDebug(t,e,i),this)},renderDebugFull:function(t,e){for(var i=this.layers,s=0;s{var s=i(99325),n=i(15043);s.register("tilemap",(function(t){var e=void 0!==t?t:{};return n(this.scene,e.key,e.tileWidth,e.tileHeight,e.width,e.height,e.data,e.insertNull)}))},37940:(t,e,i)=>{var s=i(61286),n=i(15043);s.register("tilemap",(function(t,e,i,s,r,o,a){return null===t&&(t=void 0),null===e&&(e=void 0),null===i&&(i=void 0),null===s&&(s=void 0),null===r&&(r=void 0),n(this.scene,t,e,i,s,r,o,a)}))},87177:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(89980),o=i(5047),a=i(96193),h=new s({Extends:r,Mixins:[n.Alpha,n.BlendMode,n.ComputedSize,n.Depth,n.Flip,n.GetBounds,n.Origin,n.Pipeline,n.Transform,n.Visible,n.ScrollFactor,a],initialize:function(t,e,i,s,n,a){r.call(this,t,"TilemapLayer"),this.isTilemap=!0,this.tilemap=e,this.layerIndex=i,this.layer=e.layers[i],this.layer.tilemapLayer=this,this.tileset=[],this.tilesDrawn=0,this.tilesTotal=this.layer.width*this.layer.height,this.culledTiles=[],this.skipCull=!1,this.cullPaddingX=1,this.cullPaddingY=1,this.cullCallback=o.GetCullTilesFunction(this.layer.orientation),this._renderOrder=0,this.gidMap=[],this.setTilesets(s),this.setAlpha(this.layer.alpha),this.setPosition(n,a),this.setOrigin(),this.setSize(e.tileWidth*this.layer.width,e.tileHeight*this.layer.height),this.initPipeline()},setTilesets:function(t){var e=[],i=[],s=this.tilemap;Array.isArray(t)||(t=[t]);for(var n=0;n=0&&t<4&&(this._renderOrder=t),this},calculateFacesAt:function(t,e){return o.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,s){return o.CalculateFacesWithin(t,e,i,s,this.layer),this},createFromTiles:function(t,e,i,s,n){return o.CreateFromTiles(t,e,i,s,n,this.layer)},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles,this._renderOrder)},copy:function(t,e,i,s,n,r,a){return o.Copy(t,e,i,s,n,r,a,this.layer),this},fill:function(t,e,i,s,n,r){return o.Fill(t,e,i,s,n,r,this.layer),this},filterTiles:function(t,e,i,s,n,r,a){return o.FilterTiles(t,e,i,s,n,r,a,this.layer)},findByIndex:function(t,e,i){return o.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,s,n,r,a){return o.FindTile(t,e,i,s,n,r,a,this.layer)},forEachTile:function(t,e,i,s,n,r,a){return o.ForEachTile(t,e,i,s,n,r,a,this.layer),this},getTileAt:function(t,e,i){return o.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,s){return o.GetTileAtWorldXY(t,e,i,s,this.layer)},getTilesWithin:function(t,e,i,s,n){return o.GetTilesWithin(t,e,i,s,n,this.layer)},getTilesWithinShape:function(t,e,i){return o.GetTilesWithinShape(t,e,i,this.layer)},getTilesWithinWorldXY:function(t,e,i,s,n,r){return o.GetTilesWithinWorldXY(t,e,i,s,n,r,this.layer)},hasTileAt:function(t,e){return o.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return o.HasTileAtWorldXY(t,e,i,this.layer)},putTileAt:function(t,e,i,s){return o.PutTileAt(t,e,i,s,this.layer)},putTileAtWorldXY:function(t,e,i,s,n){return o.PutTileAtWorldXY(t,e,i,s,n,this.layer)},putTilesAt:function(t,e,i,s){return o.PutTilesAt(t,e,i,s,this.layer),this},randomize:function(t,e,i,s,n){return o.Randomize(t,e,i,s,n,this.layer),this},removeTileAt:function(t,e,i,s){return o.RemoveTileAt(t,e,i,s,this.layer)},removeTileAtWorldXY:function(t,e,i,s,n){return o.RemoveTileAtWorldXY(t,e,i,s,n,this.layer)},renderDebug:function(t,e){return o.RenderDebug(t,e,this.layer),this},replaceByIndex:function(t,e,i,s,n,r){return o.ReplaceByIndex(t,e,i,s,n,r,this.layer),this},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},setCollision:function(t,e,i,s){return o.SetCollision(t,e,i,this.layer,s),this},setCollisionBetween:function(t,e,i,s){return o.SetCollisionBetween(t,e,i,s,this.layer),this},setCollisionByProperty:function(t,e,i){return o.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return o.SetCollisionByExclusion(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return o.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileIndexCallback:function(t,e,i){return o.SetTileIndexCallback(t,e,i,this.layer),this},setTileLocationCallback:function(t,e,i,s,n,r){return o.SetTileLocationCallback(t,e,i,s,n,r,this.layer),this},shuffle:function(t,e,i,s){return o.Shuffle(t,e,i,s,this.layer),this},swapByIndex:function(t,e,i,s,n,r){return o.SwapByIndex(t,e,i,s,n,r,this.layer),this},tileToWorldX:function(t,e){return this.tilemap.tileToWorldX(t,e,this)},tileToWorldY:function(t,e){return this.tilemap.tileToWorldY(t,e,this)},tileToWorldXY:function(t,e,i,s){return this.tilemap.tileToWorldXY(t,e,i,s,this)},weightedRandomize:function(t,e,i,s,n){return o.WeightedRandomize(e,i,s,n,t,this.layer),this},worldToTileX:function(t,e,i){return this.tilemap.worldToTileX(t,e,i,this)},worldToTileY:function(t,e,i){return this.tilemap.worldToTileY(t,e,i,this)},worldToTileXY:function(t,e,i,s,n){return this.tilemap.worldToTileXY(t,e,i,s,n,this)},destroy:function(t){void 0===t&&(t=!0),this.tilemap&&(this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),t&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.culledTiles.length=0,this.cullCallback=null,this.gidMap=[],this.tileset=[],r.prototype.destroy.call(this))}});t.exports=h},17394:(t,e,i)=>{var s=i(69360),n=new s,r=new s,o=new s;t.exports=function(t,e,i,s){var a=e.cull(i),h=a.length,l=i.alpha*e.alpha;if(!(0===h||l<=0)){var u=n,c=r,d=o;c.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),u.copyFrom(i.matrix);var p=t.currentContext,f=e.gidMap;p.save(),s?(u.multiplyWithOffset(s,-i.scrollX*e.scrollFactorX,-i.scrollY*e.scrollFactorY),c.e=e.x,c.f=e.y,u.multiply(c,d),d.copyToContext(p)):(c.e-=i.scrollX*e.scrollFactorX,c.f-=i.scrollY*e.scrollFactorY,c.copyToContext(p)),(!t.antialias||e.scaleX>1||e.scaleY>1)&&(p.imageSmoothingEnabled=!1);for(var v=0;v{var s=i(72283),n=i(72283);s=i(51395),n=i(17394),t.exports={renderWebGL:s,renderCanvas:n}},51395:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i){var n=e.cull(i),r=n.length,o=i.alpha*e.alpha;if(!(0===r||o<=0)){var a=e.gidMap,h=t.pipelines.set(e.pipeline,e),l=s.getTintAppendFloatAlpha,u=e.scrollFactorX,c=e.scrollFactorY,d=e.x,p=e.y,f=e.scaleX,v=e.scaleY;t.pipelines.preBatch(e);for(var g=0;g{var s=i(56694),n=i(93736),r=new s({initialize:function(t,e,i,s,r,o,a,h,l){(void 0===i||i<=0)&&(i=32),(void 0===s||s<=0)&&(s=32),void 0===r&&(r=0),void 0===o&&(o=0),void 0===a&&(a={}),void 0===h&&(h={}),this.name=t,this.firstgid=e,this.tileWidth=i,this.tileHeight=s,this.tileMargin=r,this.tileSpacing=o,this.tileProperties=a,this.tileData=h,this.tileOffset=new n,void 0!==l&&this.tileOffset.set(l.x,l.y),this.image=null,this.glTexture=null,this.rows=0,this.columns=0,this.total=0,this.texCoordinates=[]},getTileProperties:function(t){return this.containsTileIndex(t)?this.tileProperties[t-this.firstgid]:null},getTileData:function(t){return this.containsTileIndex(t)?this.tileData[t-this.firstgid]:null},getTileCollisionGroup:function(t){var e=this.getTileData(t);return e&&e.objectgroup?e.objectgroup:null},containsTileIndex:function(t){return t>=this.firstgid&&t{var s=i(15494);t.exports=function(t,e,i){var n=s(t,e,!0,i),r=s(t,e-1,!0,i),o=s(t,e+1,!0,i),a=s(t-1,e,!0,i),h=s(t+1,e,!0,i),l=n&&n.collides;return l&&(n.faceTop=!0,n.faceBottom=!0,n.faceLeft=!0,n.faceRight=!0),r&&r.collides&&(l&&(n.faceTop=!1),r.faceBottom=!l),o&&o.collides&&(l&&(n.faceBottom=!1),o.faceTop=!l),a&&a.collides&&(l&&(n.faceLeft=!1),a.faceRight=!l),h&&h.collides&&(l&&(n.faceRight=!1),h.faceLeft=!l),n&&!n.collides&&n.resetFaces(),n}},60386:(t,e,i)=>{var s=i(15494),n=i(50811);t.exports=function(t,e,i,r,o){for(var a=null,h=null,l=null,u=null,c=n(t,e,i,r,null,o),d=0;d{var s=new(i(93736));t.exports=function(t,e,i,n){var r=i.tilemapLayer,o=r.cullPaddingX,a=r.cullPaddingY,h=r.tilemap.tileToWorldXY(t,e,s,n,r);return h.x>n.worldView.x+r.scaleX*i.tileWidth*(-o-.5)&&h.xn.worldView.y+r.scaleY*i.tileHeight*(-a-1)&&h.y{var s=i(50811),n=i(60386);t.exports=function(t,e,i,r,o,a,h,l){void 0===h&&(h=!0),t<0&&(t=0),e<0&&(e=0);for(var u=s(t,e,i,r,null,l),c=o-t,d=a-e,p=0;p=0&&f=0&&v{var s=i(50811),n=i(51202);t.exports=function(t,e,i,r,o,a){i||(i={}),Array.isArray(t)||(t=[t]);var h=a.tilemapLayer;r||(r=h.scene),o||(o=r.cameras.main);var l,u=s(0,0,a.width,a.height,null,a),c=[];for(l=0;l{var s=i(74118),n=i(82127),r=i(84314),o=new s;t.exports=function(t,e){var i=t.tilemapLayer.tilemap,s=t.tilemapLayer,a=Math.floor(i.tileWidth*s.scaleX),h=Math.floor(i.tileHeight*s.scaleY),l=r(e.worldView.x-s.x,a,0,!0)-s.cullPaddingX,u=n(e.worldView.right-s.x,a,0,!0)+s.cullPaddingX,c=r(e.worldView.y-s.y,h,0,!0)-s.cullPaddingY,d=n(e.worldView.bottom-s.y,h,0,!0)+s.cullPaddingY;return o.setTo(l,c,u-l,d-c)}},381:(t,e,i)=>{var s=i(71586),n=i(6987);t.exports=function(t,e,i,r){void 0===i&&(i=[]),void 0===r&&(r=0),i.length=0;var o=t.tilemapLayer,a=s(t,e);return(o.skipCull||1!==o.scrollFactorX||1!==o.scrollFactorY)&&(a.left=0,a.right=t.width,a.top=0,a.bottom=t.height),n(t,a,r,i),i}},97734:(t,e,i)=>{var s=i(50811),n=i(60386),r=i(68234);t.exports=function(t,e,i,o,a,h,l){for(var u=-1!==l.collideIndexes.indexOf(t),c=s(e,i,o,a,null,l),d=0;d{var s=i(50811);t.exports=function(t,e,i,n,r,o,a,h){return s(i,n,r,o,a,h).filter(t,e)}},37982:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=0),void 0===i&&(i=!1);var n,r,o,a=0;if(i){for(r=s.height-1;r>=0;r--)for(n=s.width-1;n>=0;n--)if((o=s.data[r][n])&&o.index===t){if(a===e)return o;a+=1}}else for(r=0;r{var s=i(50811);t.exports=function(t,e,i,n,r,o,a,h){return s(i,n,r,o,a,h).find(t,e)||null}},80916:(t,e,i)=>{var s=i(50811);t.exports=function(t,e,i,n,r,o,a,h){s(i,n,r,o,a,h).forEach(t,e)}},31493:(t,e,i)=>{var s=i(12920),n=i(381),r=i(37524),o=i(20887),a=i(72283),h=i(19242);t.exports=function(t){return t===s.ORTHOGONAL?n:t===s.HEXAGONAL?r:t===s.STAGGERED?h:t===s.ISOMETRIC?o:a}},15494:(t,e,i)=>{var s=i(62839);t.exports=function(t,e,i,n){if(void 0===i&&(i=!1),s(t,e,n)){var r=n.data[e][t]||null;return r?-1===r.index?i?r:null:r:null}return null}},24640:(t,e,i)=>{var s=i(15494),n=new(i(93736));t.exports=function(t,e,i,r,o){return o.tilemapLayer.worldToTileXY(t,e,!0,n,r),s(n.x,n.y,i,o)}},16884:(t,e,i)=>{var s=i(12920),n=i(72283),r=i(44150);t.exports=function(t){return t===s.ORTHOGONAL?r:n}},68182:(t,e,i)=>{var s=i(12920),n=i(21715),r=i(21808),o=i(72283),a=i(33388),h=i(46836);t.exports=function(t){return t===s.ORTHOGONAL?h:t===s.ISOMETRIC?r:t===s.HEXAGONAL?n:t===s.STAGGERED?a:o}},3752:(t,e,i)=>{var s=i(12920),n=i(37728),r=i(72283),o=i(84132),a=i(42477);t.exports=function(t){return t===s.ORTHOGONAL?a:t===s.HEXAGONAL?n:t===s.STAGGERED?o:r}},50811:(t,e,i)=>{var s=i(72632);t.exports=function(t,e,i,n,r,o){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=o.width),void 0===n&&(n=o.height),r||(r={});var a=s(r,"isNotEmpty",!1),h=s(r,"isColliding",!1),l=s(r,"hasInterestingFace",!1);t<0&&(i+=t,t=0),e<0&&(n+=e,e=0),t+i>o.width&&(i=Math.max(o.width-t,0)),e+n>o.height&&(n=Math.max(o.height-e,0));for(var u=[],c=e;c{var s=i(84068),n=i(50811),r=i(7563),o=i(72283),a=i(93736),h=function(t,e){return r.RectangleToTriangle(e,t)},l=new a,u=new a,c=new a;t.exports=function(t,e,i,a){if(void 0===t)return[];var d=o;t instanceof s.Circle?d=r.CircleToRectangle:t instanceof s.Rectangle?d=r.RectangleToRectangle:t instanceof s.Triangle?d=h:t instanceof s.Line&&(d=r.LineToRectangle),a.tilemapLayer.worldToTileXY(t.left,t.top,!0,u,i);var p=u.x,f=u.y;a.tilemapLayer.worldToTileXY(t.right,t.bottom,!0,c,i);var v=Math.ceil(c.x),g=Math.ceil(c.y),m=Math.max(v-p,1),y=Math.max(g-f,1),x=n(p,f,m,y,e,a),T=a.tileWidth,w=a.tileHeight;a.tilemapLayer&&(T*=a.tilemapLayer.scaleX,w*=a.tilemapLayer.scaleY);for(var b=[],E=new s.Rectangle(0,0,T,w),S=0;S{var s=i(50811),n=i(93736),r=new n,o=new n;t.exports=function(t,e,i,n,a,h,l){var u=l.tilemapLayer.tilemap._convert.WorldToTileXY;u(t,e,!0,r,h,l);var c=r.x,d=r.y;u(t+i,e+n,!1,o,h,l);var p=Math.ceil(o.x),f=Math.ceil(o.y);return s(c,d,p-c,f-d,a,l)}},29296:(t,e,i)=>{var s=i(12920),n=i(72283),r=i(806);t.exports=function(t){return t===s.ORTHOGONAL?r:n}},32688:(t,e,i)=>{var s=i(12920),n=i(11516),r=i(18750),o=i(72283),a=i(90562),h=i(45676);t.exports=function(t){return t===s.ORTHOGONAL?h:t===s.ISOMETRIC?r:t===s.HEXAGONAL?n:t===s.STAGGERED?a:o}},74326:(t,e,i)=>{var s=i(12920),n=i(44382),r=i(72283),o=i(3689),a=i(70520);t.exports=function(t){return t===s.ORTHOGONAL?a:t===s.HEXAGONAL?n:t===s.STAGGERED?o:r}},46598:(t,e,i)=>{var s=i(62839);t.exports=function(t,e,i){if(s(t,e,i)){var n=i.data[e][t];return null!==n&&n.index>-1}return!1}},28654:(t,e,i)=>{var s=i(46598),n=new(i(93736));t.exports=function(t,e,i,r){r.tilemapLayer.worldToTileXY(t,e,!0,n,i);var o=n.x,a=n.y;return s(o,a,r)}},6358:(t,e,i)=>{var s=i(82127),n=i(84314);t.exports=function(t,e){var i=t.tilemapLayer.tilemap,r=t.tilemapLayer,o=Math.floor(i.tileWidth*r.scaleX),a=Math.floor(i.tileHeight*r.scaleY),h=t.hexSideLength,l=(a-h)/2+h;return{left:n(e.worldView.x-r.x,o,0,!0)-r.cullPaddingX,right:s(e.worldView.right-r.x,o,0,!0)+r.cullPaddingX,top:n(e.worldView.y-r.y,l,0,!0)-r.cullPaddingY,bottom:s(e.worldView.bottom-r.y,l,0,!0)+r.cullPaddingY}}},37524:(t,e,i)=>{var s=i(6358),n=i(6987);t.exports=function(t,e,i,r){void 0===i&&(i=[]),void 0===r&&(r=0),i.length=0;var o=t.tilemapLayer;if(!o.skipCull&&1===o.scrollFactorX&&1===o.scrollFactorY){var a=s(t,e);n(t,a,r,i)}return i}},21715:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r){i||(i=new s);var o=r.baseTileWidth,a=r.baseTileHeight,h=r.tilemapLayer,l=0,u=0;h&&(n||(n=h.scene.cameras.main),l=h.x+n.scrollX*(1-h.scrollFactorX),o*=h.scaleX,u=h.y+n.scrollY*(1-h.scrollFactorY),a*=h.scaleY);var c=r.hexSideLength,d=l+t*o+e%2*(o/2),p=u+e*((a-c)/2+c);return i.set(d,p)}},37728:t=>{t.exports=function(t,e,i){var s=i.baseTileHeight,n=i.tilemapLayer,r=0;n&&(void 0===e&&(e=n.scene.cameras.main),r=n.y+e.scrollY*(1-n.scrollFactorY),s*=n.scaleY);var o=n.tilemap.hexSideLength;return r+t*((s-o)/2+o)}},11516:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r,o){n||(n=new s);var a=o.baseTileWidth,h=o.baseTileHeight,l=o.tilemapLayer;l&&(r||(r=l.scene.cameras.main),e-=l.y+r.scrollY*(1-l.scrollFactorY),h*=l.scaleY,t-=l.x+r.scrollX*(1-l.scrollFactorX),a*=l.scaleX);var u=o.hexSideLength,c=(h-u)/2+u,d=i?Math.floor(e/c):e/c,p=i?Math.floor((t-d%2*.5*a)/a):(t-d%2*.5*a)/a;return n.set(p,d)}},44382:t=>{t.exports=function(t,e,i,s){var n=s.baseTileHeight,r=s.tilemapLayer;r&&(i||(i=r.scene.cameras.main),t-=r.y+i.scrollY*(1-r.scrollFactorY),n*=r.scaleY);var o=s.hexSideLength,a=(n-o)/2+o;return e?Math.floor(t/a):t/a}},62839:t=>{t.exports=function(t,e,i){return t>=0&&t=0&&e{var s=i(13125);t.exports=function(t,e,i,n){void 0===i&&(i=[]),void 0===n&&(n=0),i.length=0;var r,o,a,h=t.tilemapLayer,l=t.data,u=t.width,c=t.height,d=u,p=c;if(!h.skipCull)if(0===n){for(o=0;o=0;r--)if(s(r,o,t,e)){if(!(a=l[o][r])||-1===a.index||!a.visible||0===a.alpha)continue;i.push(a)}}else if(2===n){for(o=p;o>=0;o--)for(r=0;l[o]&&r=0;o--)for(r=d;l[o]&&r>=0;r--)if(s(r,o,t,e)){if(!(a=l[o][r])||-1===a.index||!a.visible||0===a.alpha)continue;i.push(a)}return h.tilesDrawn=i.length,h.tilesTotal=u*c,i}},21808:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r){i||(i=new s);var o=r.baseTileWidth,a=r.baseTileHeight,h=r.tilemapLayer,l=0,u=0;h&&(n||(n=h.scene.cameras.main),l=h.x+n.scrollX*(1-h.scrollFactorX),o*=h.scaleX,u=h.y+n.scrollY*(1-h.scrollFactorY),a*=h.scaleY);var c=l+o/2*(t-e),d=u+(t+e)*(a/2);return i.set(c,d)}},18750:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r,o){n||(n=new s);var a=o.baseTileWidth,h=o.baseTileHeight,l=o.tilemapLayer;l&&(r||(r=l.scene.cameras.main),e-=l.y+r.scrollY*(1-l.scrollFactorY),h*=l.scaleY,t-=l.x+r.scrollX*(1-l.scrollFactorX),a*=l.scaleX);var u=i?Math.floor((t/(a/2)+e/(h/2))/2):(t/(a/2)+e/(h/2))/2,c=i?Math.floor((e/(h/2)-t/(a/2))/2):(e/(h/2)-t/(a/2))/2;return n.set(u,c)}},29003:(t,e,i)=>{var s=i(29633),n=i(62839),r=i(92839),o=i(68234),a=i(14556);t.exports=function(t,e,i,h,l){if(void 0===h&&(h=!0),!n(e,i,l))return null;var u=l.data[i][e],c=u&&u.collides;if(t instanceof s)null===l.data[i][e]&&(l.data[i][e]=new s(l,t.index,e,i,l.tileWidth,l.tileHeight)),l.data[i][e].copy(t);else{var d=t;null===l.data[i][e]?l.data[i][e]=new s(l,d,e,i,l.tileWidth,l.tileHeight):l.data[i][e].index=d}var p=l.data[i][e],f=-1!==l.collideIndexes.indexOf(p.index),v=a(l.tilemapLayer.tilemap)[d=t instanceof s?t.index:t][2],g=l.tilemapLayer.tileset[v];return p.width=g.tileWidth,p.height=g.tileHeight,o(p,f),h&&c!==p.collides&&r(e,i,l),p}},48565:(t,e,i)=>{var s=i(29003),n=new(i(93736));t.exports=function(t,e,i,r,o,a){return a.tilemapLayer.worldToTileXY(e,i,!0,n,o,a),s(t,n.x,n.y,r,a)}},56547:(t,e,i)=>{var s=i(60386),n=i(29003);t.exports=function(t,e,i,r,o){if(void 0===r&&(r=!0),!Array.isArray(t))return null;Array.isArray(t[0])||(t=[t]);for(var a=t.length,h=t[0].length,l=0;l{var s=i(50811),n=i(72861);t.exports=function(t,e,i,r,o,a){var h,l=s(t,e,i,r,{},a);if(!o)for(o=[],h=0;h{var s=i(29633),n=i(62839),r=i(92839);t.exports=function(t,e,i,o,a){if(void 0===i&&(i=!0),void 0===o&&(o=!0),!n(t,e,a))return null;var h=a.data[e][t];return h?(a.data[e][t]=i?null:new s(a,-1,t,e,a.tileWidth,a.tileHeight),o&&h&&h.collides&&r(t,e,a),h):null}},17384:(t,e,i)=>{var s=i(929),n=new(i(93736));t.exports=function(t,e,i,r,o,a){return a.tilemapLayer.worldToTileXY(t,e,!0,n,o,a),s(n.x,n.y,i,r,a)}},93763:(t,e,i)=>{var s=i(50811),n=i(95509),r=new n(105,210,231,150),o=new n(243,134,48,200),a=new n(40,39,37,150);t.exports=function(t,e,i){void 0===e&&(e={});var n=void 0!==e.tileColor?e.tileColor:r,h=void 0!==e.collidingTileColor?e.collidingTileColor:o,l=void 0!==e.faceColor?e.faceColor:a,u=s(0,0,i.width,i.height,null,i);t.translateCanvas(i.tilemapLayer.x,i.tilemapLayer.y),t.scaleCanvas(i.tilemapLayer.scaleX,i.tilemapLayer.scaleY);for(var c=0;c{var s=i(50811);t.exports=function(t,e,i,n,r,o,a){for(var h=s(i,n,r,o,null,a),l=0;l{t.exports=function(t,e,i,s){var n,r,o,a=t.data,h=t.width,l=t.height,u=t.tilemapLayer,c=Math.max(0,e.left),d=Math.min(h,e.right),p=Math.max(0,e.top),f=Math.min(l,e.bottom);if(0===i)for(r=p;r=c;n--)(o=a[r][n])&&-1!==o.index&&o.visible&&0!==o.alpha&&s.push(o);else if(2===i)for(r=f;r>=p;r--)for(n=c;a[r]&&n=p;r--)for(n=d;a[r]&&n>=c;n--)(o=a[r][n])&&-1!==o.index&&o.visible&&0!==o.alpha&&s.push(o);return u.tilesDrawn=s.length,u.tilesTotal=h*l,s}},51710:(t,e,i)=>{var s=i(68234),n=i(60386),r=i(91181);t.exports=function(t,e,i,o,a){void 0===e&&(e=!0),void 0===i&&(i=!0),void 0===a&&(a=!0),Array.isArray(t)||(t=[t]);for(var h=0;h{var s=i(68234),n=i(60386),r=i(91181);t.exports=function(t,e,i,o,a,h){if(void 0===i&&(i=!0),void 0===o&&(o=!0),void 0===h&&(h=!0),!(t>e)){for(var l=t;l<=e;l++)r(l,i,a);if(h)for(var u=0;u=t&&d.index<=e&&s(d,i)}o&&n(0,0,a.width,a.height,a)}}},33158:(t,e,i)=>{var s=i(68234),n=i(60386),r=i(91181);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var a=0;a{var s=i(68234),n=i(60386),r=i(19256);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0);for(var a=0;a{var s=i(68234),n=i(60386);t.exports=function(t,e,i){void 0===t&&(t=!0),void 0===e&&(e=!0);for(var r=0;r0&&s(a,t)}}e&&n(0,0,i.width,i.height,i)}},91181:t=>{t.exports=function(t,e,i){var s=i.collideIndexes.indexOf(t);e&&-1===s?i.collideIndexes.push(t):e||-1===s||i.collideIndexes.splice(s,1)}},68234:t=>{t.exports=function(t,e){e?t.setCollision(!0,!0,!0,!0,!1):t.resetCollision(!1)}},11628:t=>{t.exports=function(t,e,i,s){if("number"==typeof t)s.callbacks[t]=null!==e?{callback:e,callbackContext:i}:void 0;else for(var n=0,r=t.length;n{var s=i(50811);t.exports=function(t,e,i,n,r,o,a){for(var h=s(t,e,i,n,null,a),l=0;l{var s=i(50811),n=i(18592);t.exports=function(t,e,i,r,o){var a=s(t,e,i,r,null,o),h=a.map((function(t){return t.index}));n(h);for(var l=0;l{var s=i(82127),n=i(84314);t.exports=function(t,e){var i=t.tilemapLayer.tilemap,r=t.tilemapLayer,o=Math.floor(i.tileWidth*r.scaleX),a=Math.floor(i.tileHeight*r.scaleY);return{left:n(e.worldView.x-r.x,o,0,!0)-r.cullPaddingX,right:s(e.worldView.right-r.x,o,0,!0)+r.cullPaddingX,top:n(e.worldView.y-r.y,a/2,0,!0)-r.cullPaddingY,bottom:s(e.worldView.bottom-r.y,a/2,0,!0)+r.cullPaddingY}}},19242:(t,e,i)=>{var s=i(53945),n=i(6987);t.exports=function(t,e,i,r){void 0===i&&(i=[]),void 0===r&&(r=0),i.length=0;var o=t.tilemapLayer;if(!o.skipCull&&1===o.scrollFactorX&&1===o.scrollFactorY){var a=s(t,e);n(t,a,r,i)}return i}},33388:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r){i||(i=new s);var o=r.baseTileWidth,a=r.baseTileHeight,h=r.tilemapLayer,l=0,u=0;h&&(n||(n=h.scene.cameras.main),l=h.x+n.scrollX*(1-h.scrollFactorX),o*=h.scaleX,u=h.y+n.scrollY*(1-h.scrollFactorY),a*=h.scaleY);var c=l+t*o+e%2*(o/2),d=u+e*(a/2);return i.set(c,d)}},84132:t=>{t.exports=function(t,e,i){var s=i.baseTileHeight,n=i.tilemapLayer,r=0;return n&&(void 0===e&&(e=n.scene.cameras.main),r=n.y+e.scrollY*(1-n.scrollFactorY),s*=n.scaleY),r+t*(s/2)+s}},90562:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r,o){n||(n=new s);var a=o.baseTileWidth,h=o.baseTileHeight,l=o.tilemapLayer;l&&(r||(r=l.scene.cameras.main),e-=l.y+r.scrollY*(1-l.scrollFactorY),h*=l.scaleY,t-=l.x+r.scrollX*(1-l.scrollFactorX),a*=l.scaleX);var u=i?Math.floor(e/(h/2)):e/(h/2),c=i?Math.floor((t+u%2*.5*a)/a):(t+u%2*.5*a)/a;return n.set(c,u)}},3689:t=>{t.exports=function(t,e,i,s){var n=s.baseTileHeight,r=s.tilemapLayer;return r&&(i||(i=r.scene.cameras.main),t-=r.y+i.scrollY*(1-r.scrollFactorY),n*=r.scaleY),e?Math.floor(t/(n/2)):t/(n/2)}},55217:(t,e,i)=>{var s=i(50811);t.exports=function(t,e,i,n,r,o,a){for(var h=s(i,n,r,o,null,a),l=0;l{t.exports=function(t,e,i){var s=i.baseTileWidth,n=i.tilemapLayer,r=0;return n&&(e||(e=n.scene.cameras.main),r=n.x+e.scrollX*(1-n.scrollFactorX),s*=n.scaleX),r+t*s}},46836:(t,e,i)=>{var s=i(44150),n=i(42477),r=i(93736);t.exports=function(t,e,i,o,a){return i||(i=new r(0,0)),i.x=s(t,o,a),i.y=n(e,o,a),i}},42477:t=>{t.exports=function(t,e,i){var s=i.baseTileHeight,n=i.tilemapLayer,r=0;return n&&(e||(e=n.scene.cameras.main),r=n.y+e.scrollY*(1-n.scrollFactorY),s*=n.scaleY),r+t*s}},39677:(t,e,i)=>{var s=i(50811);t.exports=function(t,e,i,n,r,o){if(r){var a,h=s(t,e,i,n,null,o),l=0;for(a=0;a{t.exports=function(t,e,i,s){void 0===e&&(e=!0);var n=s.baseTileWidth,r=s.tilemapLayer;return r&&(i||(i=r.scene.cameras.main),t-=r.x+i.scrollX*(1-r.scrollFactorX),n*=r.scaleX),e?Math.floor(t/n):t/n}},45676:(t,e,i)=>{var s=i(806),n=i(70520),r=i(93736);t.exports=function(t,e,i,o,a,h){return void 0===i&&(i=!0),o||(o=new r(0,0)),o.x=s(t,i,a,h),o.y=n(e,i,a,h),o}},70520:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=!0);var n=s.baseTileHeight,r=s.tilemapLayer;return r&&(i||(i=r.scene.cameras.main),t-=r.y+i.scrollY*(1-r.scrollFactorY),n*=r.scaleY),e?Math.floor(t/n):t/n}},5047:(t,e,i)=>{t.exports={CalculateFacesAt:i(92839),CalculateFacesWithin:i(60386),CheckIsoBounds:i(13125),Copy:i(17347),CreateFromTiles:i(93604),CullBounds:i(71586),CullTiles:i(381),Fill:i(97734),FilterTiles:i(63555),FindByIndex:i(37982),FindTile:i(48297),ForEachTile:i(80916),GetCullTilesFunction:i(31493),GetTileAt:i(15494),GetTileAtWorldXY:i(24640),GetTilesWithin:i(50811),GetTilesWithinShape:i(31674),GetTilesWithinWorldXY:i(44662),GetTileToWorldXFunction:i(16884),GetTileToWorldXYFunction:i(68182),GetTileToWorldYFunction:i(3752),GetWorldToTileXFunction:i(29296),GetWorldToTileXYFunction:i(32688),GetWorldToTileYFunction:i(74326),HasTileAt:i(46598),HasTileAtWorldXY:i(28654),HexagonalCullBounds:i(6358),HexagonalCullTiles:i(37524),HexagonalTileToWorldXY:i(21715),HexagonalTileToWorldY:i(37728),HexagonalWorldToTileXY:i(11516),HexagonalWorldToTileY:i(44382),IsInLayerBounds:i(62839),IsometricCullTiles:i(20887),IsometricTileToWorldXY:i(21808),IsometricWorldToTileXY:i(18750),PutTileAt:i(29003),PutTileAtWorldXY:i(48565),PutTilesAt:i(56547),Randomize:i(91180),RemoveTileAt:i(929),RemoveTileAtWorldXY:i(17384),RenderDebug:i(93763),ReplaceByIndex:i(51202),RunCull:i(6987),SetCollision:i(51710),SetCollisionBetween:i(15216),SetCollisionByExclusion:i(33158),SetCollisionByProperty:i(4180),SetCollisionFromCollisionGroup:i(18625),SetLayerCollisionIndex:i(91181),SetTileCollision:i(68234),SetTileIndexCallback:i(11628),SetTileLocationCallback:i(72732),Shuffle:i(34397),StaggeredCullBounds:i(53945),StaggeredCullTiles:i(19242),StaggeredTileToWorldXY:i(33388),StaggeredTileToWorldY:i(84132),StaggeredWorldToTileXY:i(90562),StaggeredWorldToTileY:i(3689),SwapByIndex:i(55217),TileToWorldX:i(44150),TileToWorldXY:i(46836),TileToWorldY:i(42477),WeightedRandomize:i(39677),WorldToTileX:i(806),WorldToTileXY:i(45676),WorldToTileY:i(70520)}},12920:t=>{t.exports={ORTHOGONAL:0,ISOMETRIC:1,STAGGERED:2,HEXAGONAL:3}},84758:(t,e,i)=>{var s={ORIENTATION:i(12920)};t.exports=s},52678:(t,e,i)=>{var s=i(98611),n=i(84758),r={Components:i(5047),Parsers:i(34124),Formats:i(93560),ImageCollection:i(97042),ParseToTilemap:i(15043),Tile:i(29633),Tilemap:i(89797),TilemapCreator:i(4843),TilemapFactory:i(37940),Tileset:i(47975),TilemapLayer:i(87177),Orientation:i(12920),LayerData:i(94990),MapData:i(16586),ObjectLayer:i(15256)};r=s(!1,r,n.ORIENTATION),t.exports=r},94990:(t,e,i)=>{var s=i(56694),n=i(12920),r=i(72632),o=new s({initialize:function(t){void 0===t&&(t={}),this.name=r(t,"name","layer"),this.x=r(t,"x",0),this.y=r(t,"y",0),this.width=r(t,"width",0),this.height=r(t,"height",0),this.tileWidth=r(t,"tileWidth",0),this.tileHeight=r(t,"tileHeight",0),this.baseTileWidth=r(t,"baseTileWidth",this.tileWidth),this.baseTileHeight=r(t,"baseTileHeight",this.tileHeight),this.orientation=r(t,"orientation",n.ORTHOGONAL),this.widthInPixels=r(t,"widthInPixels",this.width*this.baseTileWidth),this.heightInPixels=r(t,"heightInPixels",this.height*this.baseTileHeight),this.alpha=r(t,"alpha",1),this.visible=r(t,"visible",!0),this.properties=r(t,"properties",[]),this.indexes=r(t,"indexes",[]),this.collideIndexes=r(t,"collideIndexes",[]),this.callbacks=r(t,"callbacks",[]),this.bodies=r(t,"bodies",[]),this.data=r(t,"data",[]),this.tilemapLayer=r(t,"tilemapLayer",null),this.hexSideLength=r(t,"hexSideLength",0)}});t.exports=o},16586:(t,e,i)=>{var s=i(56694),n=i(12920),r=i(72632),o=new s({initialize:function(t){void 0===t&&(t={}),this.name=r(t,"name","map"),this.width=r(t,"width",0),this.height=r(t,"height",0),this.infinite=r(t,"infinite",!1),this.tileWidth=r(t,"tileWidth",0),this.tileHeight=r(t,"tileHeight",0),this.widthInPixels=r(t,"widthInPixels",this.width*this.tileWidth),this.heightInPixels=r(t,"heightInPixels",this.height*this.tileHeight),this.format=r(t,"format",null),this.orientation=r(t,"orientation",n.ORTHOGONAL),this.renderOrder=r(t,"renderOrder","right-down"),this.version=r(t,"version","1"),this.properties=r(t,"properties",{}),this.layers=r(t,"layers",[]),this.images=r(t,"images",[]),this.objects=r(t,"objects",[]),this.collision=r(t,"collision",{}),this.tilesets=r(t,"tilesets",[]),this.imageCollections=r(t,"imageCollections",[]),this.tiles=r(t,"tiles",[]),this.hexSideLength=r(t,"hexSideLength",0)}});t.exports=o},15256:(t,e,i)=>{var s=i(56694),n=i(72632),r=new s({initialize:function(t){void 0===t&&(t={}),this.name=n(t,"name","object layer"),this.opacity=n(t,"opacity",1),this.properties=n(t,"properties",{}),this.propertyTypes=n(t,"propertytypes",{}),this.type=n(t,"type","objectgroup"),this.visible=n(t,"visible",!0),this.objects=n(t,"objects",[])}});t.exports=r},21394:(t,e,i)=>{var s=i(12920);t.exports=function(t){return"isometric"===(t=t.toLowerCase())?s.ISOMETRIC:"staggered"===t?s.STAGGERED:"hexagonal"===t?s.HEXAGONAL:s.ORTHOGONAL}},90715:(t,e,i)=>{var s=i(93560),n=i(84346),r=i(96097),o=i(2378),a=i(44909);t.exports=function(t,e,i,h,l,u){var c;switch(e){case s.ARRAY_2D:c=n(t,i,h,l,u);break;case s.CSV:c=r(t,i,h,l,u);break;case s.TILED_JSON:c=o(t,i,u);break;case s.WELTMEISTER:c=a(t,i,u);break;default:console.warn("Unrecognized tilemap data format: "+e),c=null}return c}},84346:(t,e,i)=>{var s=i(93560),n=i(94990),r=i(16586),o=i(29633);t.exports=function(t,e,i,a,h){for(var l=new n({tileWidth:i,tileHeight:a}),u=new r({name:t,tileWidth:i,tileHeight:a,format:s.ARRAY_2D,layers:[l]}),c=[],d=e.length,p=0,f=0;f{var s=i(93560),n=i(84346);t.exports=function(t,e,i,r,o){var a=e.trim().split("\n").map((function(t){return t.split(",")})),h=n(t,a,i,r,o);return h.format=s.CSV,h}},30951:(t,e,i)=>{var s=i(94990),n=i(29633);t.exports=function(t,e){for(var i=[],r=0;r-1?new n(a,p,c,u,o.tilesize,o.tilesize):e?null:new n(a,-1,c,u,o.tilesize,o.tilesize),h.push(d)}l.push(h),h=[]}a.data=l,i.push(a)}return i}},47488:(t,e,i)=>{var s=i(47975);t.exports=function(t){for(var e=[],i=[],n=0;n{var s=i(93560),n=i(16586),r=i(30951),o=i(47488);t.exports=function(t,e,i){if(0===e.layer.length)return console.warn("No layers found in the Weltmeister map: "+t),null;for(var a=0,h=0,l=0;la&&(a=e.layer[l].width),e.layer[l].height>h&&(h=e.layer[l].height);var u=new n({width:a,height:h,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:s.WELTMEISTER});return u.layers=r(e,i),u.tilesets=o(e),u}},24507:(t,e,i)=>{t.exports={ParseTileLayers:i(30951),ParseTilesets:i(47488),ParseWeltmeister:i(44909)}},34124:(t,e,i)=>{t.exports={FromOrientationString:i(21394),Parse:i(90715),Parse2DArray:i(84346),ParseCSV:i(96097),Impact:i(24507),Tiled:i(50044)}},48646:(t,e,i)=>{var s=i(98611);t.exports=function(t){for(var e,i,n,r,o,a=0;a{t.exports=function(t){for(var e=window.atob(t),i=e.length,s=new Array(i/4),n=0;n>>0;return s}},14556:(t,e,i)=>{var s=i(47975);t.exports=function(t){var e,i,n=[];for(e=0;e{var s=i(72632);t.exports=function(t,e,i){if(!e)return{i:0,layers:t.layers,name:"",opacity:1,visible:!0,x:0,y:0};var n=e.x+s(e,"startx",0)*t.tilewidth+s(e,"offsetx",0),r=e.y+s(e,"starty",0)*t.tileheight+s(e,"offsety",0);return{i:0,layers:e.layers,name:i.name+e.name+"/",opacity:i.opacity*e.opacity,visible:i.visible&&e.visible,x:i.x+n,y:i.y+r}}},8847:t=>{var e=2147483648,i=1073741824,s=536870912;t.exports=function(t){var n=Boolean(t&e),r=Boolean(t&i),o=Boolean(t&s);t&=536870911;var a=0,h=!1;return n&&r&&o?(a=Math.PI/2,h=!0):n&&r&&!o?(a=Math.PI,h=!1):n&&!r&&o?(a=Math.PI/2,h=!1):!n||r||o?!n&&r&&o?(a=3*Math.PI/2,h=!1):n||!r||o?n||r||!o?n||r||o||(a=0,h=!1):(a=3*Math.PI/2,h=!0):(a=Math.PI,h=!0):(a=0,h=!0),{gid:t,flippedHorizontal:n,flippedVertical:r,flippedAntiDiagonal:o,rotation:a,flipped:h}}},78339:(t,e,i)=>{var s=i(72632),n=i(92044);t.exports=function(t){for(var e=[],i=[],r=n(t);r.i0;)if(r.i>=r.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}r=i.pop()}else{var o=r.layers[r.i];if(r.i++,"imagelayer"===o.type){var a=s(o,"offsetx",0)+s(o,"startx",0),h=s(o,"offsety",0)+s(o,"starty",0);e.push({name:r.name+o.name,image:o.image,x:r.x+a+o.x,y:r.y+h+o.y,alpha:r.opacity*o.opacity,visible:r.visible&&o.visible,properties:s(o,"properties",{})})}else if("group"===o.type){var l=n(t,o,r);i.push(r),r=l}}return e}},2378:(t,e,i)=>{var s=i(48646),n=i(14556),r=i(12920),o=i(93560),a=i(21394),h=i(16586),l=i(78339),u=i(61136),c=i(95925),d=i(93392);t.exports=function(t,e,i){var p=new h({width:e.width,height:e.height,name:t,tileWidth:e.tilewidth,tileHeight:e.tileheight,orientation:a(e.orientation),format:o.TILED_JSON,version:e.version,properties:e.properties,renderOrder:e.renderorder,infinite:e.infinite});p.orientation===r.HEXAGONAL&&(p.hexSideLength=e.hexsidelength),p.layers=c(e,i),p.images=l(e);var f=d(e);return p.tilesets=f.tilesets,p.imageCollections=f.imageCollections,p.objects=u(e),p.tiles=n(p),s(p),p}},4281:(t,e,i)=>{var s=i(28820),n=i(8847),r=function(t){return{x:t.x,y:t.y}},o=["id","name","type","rotation","properties","visible","x","y","width","height"];t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0);var a=s(t,o);if(a.x+=e,a.y+=i,t.gid){var h=n(t.gid);a.gid=h.gid,a.flippedHorizontal=h.flippedHorizontal,a.flippedVertical=h.flippedVertical,a.flippedAntiDiagonal=h.flippedAntiDiagonal}else t.polyline?a.polyline=t.polyline.map(r):t.polygon?a.polygon=t.polygon.map(r):t.ellipse?a.ellipse=t.ellipse:t.text?a.text=t.text:t.point?a.point=!0:a.rectangle=!0;return a}},61136:(t,e,i)=>{var s=i(72632),n=i(4281),r=i(15256),o=i(92044);t.exports=function(t){for(var e=[],i=[],a=o(t);a.i0;)if(a.i>=a.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}a=i.pop()}else{var h=a.layers[a.i];if(a.i++,h.opacity*=a.opacity,h.visible=a.visible&&h.visible,"objectgroup"===h.type){h.name=a.name+h.name;for(var l=a.x+s(h,"startx",0)+s(h,"offsetx",0),u=a.y+s(h,"starty",0)+s(h,"offsety",0),c=[],d=0;d{var s=i(43908),n=i(12920),r=i(92044),o=i(21394),a=i(72632),h=i(94990),l=i(8847),u=i(29633);t.exports=function(t,e){for(var i=a(t,"infinite",!1),c=[],d=[],p=r(t);p.i0;)if(p.i>=p.layers.length){if(d.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}p=d.pop()}else{var f=p.layers[p.i];if(p.i++,"tilelayer"===f.type)if(f.compression)console.warn("TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '"+f.name+"'");else{if(f.encoding&&"base64"===f.encoding){if(f.chunks)for(var v=0;v0?((y=new u(g,m.gid,L,F,t.tilewidth,t.tileheight)).rotation=m.rotation,y.flipX=m.flipped,T[F][L]=y):(x=e?null:new u(g,-1,L,F,t.tilewidth,t.tileheight),T[F][L]=x),++w===_.width&&(R++,w=0)}}else{(g=new h({name:p.name+f.name,x:p.x+a(f,"offsetx",0)+f.x,y:p.y+a(f,"offsety",0)+f.y,width:f.width,height:f.height,tileWidth:t.tilewidth,tileHeight:t.tileheight,alpha:p.opacity*f.opacity,visible:p.visible&&f.visible,properties:a(f,"properties",[]),orientation:o(t.orientation)})).orientation===n.HEXAGONAL&&(g.hexSideLength=t.hexsidelength);for(var D=[],k=0,I=f.data.length;k0?((y=new u(g,m.gid,w,T.length,t.tilewidth,t.tileheight)).rotation=m.rotation,y.flipX=m.flipped,D.push(y)):(x=e?null:new u(g,-1,w,T.length,t.tilewidth,t.tileheight),D.push(x)),++w===f.width&&(T.push(D),w=0,D=[])}g.data=T,c.push(g)}else if("group"===f.type){var B=r(t,f,p);d.push(p),p=B}}return c}},93392:(t,e,i)=>{var s=i(47975),n=i(97042),r=i(4281),o=i(39642);t.exports=function(t){for(var e,i=[],a=[],h=null,l=0;l1){var d=void 0,p=void 0;if(Array.isArray(u.tiles)){d=d||{},p=p||{};for(var f=0;f{t.exports=function(t,e){for(var i=0;i0){var r,o,a,h={},l={};if(Array.isArray(s.edgecolors))for(r=0;r{t.exports={AssignTileProperties:i(48646),Base64Decode:i(43908),BuildTilesetIndex:i(14556),CreateGroupLayer:i(92044),ParseGID:i(8847),ParseImageLayers:i(78339),ParseJSONTiled:i(2378),ParseObject:i(4281),ParseObjectLayers:i(61136),ParseTileLayers:i(95925),ParseTilesets:i(93392)}},73779:(t,e,i)=>{var s=i(56694),n=i(91963),r=i(7599),o=i(57911),a=i(66458),h=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.now=0,this.timeScale=1,this.paused=!1,this._active=[],this._pendingInsertion=[],this._pendingRemoval=[],t.sys.events.once(r.BOOT,this.boot,this),t.sys.events.on(r.START,this.start,this)},boot:function(){this.now=this.systems.game.loop.time,this.systems.events.once(r.DESTROY,this.destroy,this)},start:function(){var t=this.systems.events;t.on(r.PRE_UPDATE,this.preUpdate,this),t.on(r.UPDATE,this.update,this),t.once(r.SHUTDOWN,this.shutdown,this)},addEvent:function(t){var e;return t instanceof o?(e=t,this.removeEvent(e),e.elapsed=e.startAt,e.hasDispatched=!1,e.repeatCount=-1===e.repeat||e.loop?999999999999:e.repeat):e=new o(t),this._pendingInsertion.push(e),e},delayedCall:function(t,e,i,s){return this.addEvent({delay:t,callback:e,args:i,callbackScope:s})},clearPendingEvents:function(){return this._pendingInsertion=[],this},removeEvent:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e-1&&this._active.splice(n,1),s.destroy()}for(i=0;i=s.delay)){var n=s.elapsed-s.delay;if(s.elapsed=s.delay,!s.hasDispatched&&s.callback&&(s.hasDispatched=!0,s.callback.apply(s.callbackScope,s.args)),s.repeatCount>0){if(s.repeatCount--,n>=s.delay)for(;n>=s.delay&&s.repeatCount>0;)s.callback&&s.callback.apply(s.callbackScope,s.args),n-=s.delay,s.repeatCount--;s.elapsed=n,s.hasDispatched=!1}else s.hasDispatched&&this._pendingRemoval.push(s)}}}},shutdown:function(){var t;for(t=0;t{var s=i(56694),n=i(72632),r=new s({initialize:function(t){this.delay=0,this.repeat=0,this.repeatCount=0,this.loop=!1,this.callback,this.callbackScope,this.args,this.timeScale=1,this.startAt=0,this.elapsed=0,this.paused=!1,this.hasDispatched=!1,this.reset(t)},reset:function(t){return this.delay=n(t,"delay",0),this.repeat=n(t,"repeat",0),this.loop=n(t,"loop",!1),this.callback=n(t,"callback",void 0),this.callbackScope=n(t,"callbackScope",this.callback),this.args=n(t,"args",[]),this.timeScale=n(t,"timeScale",1),this.startAt=n(t,"startAt",0),this.paused=n(t,"paused",!1),this.elapsed=this.startAt,this.hasDispatched=!1,this.repeatCount=-1===this.repeat||this.loop?999999999999:this.repeat,this},getProgress:function(){return this.elapsed/this.delay},getOverallProgress:function(){if(this.repeat>0){var t=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/t}return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return.001*this.elapsed},getRemaining:function(){return this.delay-this.elapsed},getRemainingSeconds:function(){return.001*this.getRemaining()},getOverallRemaining:function(){return this.delay*(1+this.repeatCount)-this.elapsed},getOverallRemainingSeconds:function(){return.001*this.getOverallRemaining()},remove:function(t){void 0===t&&(t=!1),this.elapsed=this.delay,this.hasDispatched=!t,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});t.exports=r},97121:(t,e,i)=>{t.exports={Clock:i(73779),TimerEvent:i(57911)}},28860:(t,e,i)=>{var s=i(56694),n=i(6659),r=i(54272),o=i(68061),a=i(55303),h=new s({Extends:n,initialize:function(t){n.call(this),this.manager=t,this.isTimeline=!0,this.data=[],this.totalData=0,this.useFrames=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.completeDelay=0,this.countdown=0,this.state=a.PENDING_ADD,this._pausedState=a.PENDING_ADD,this.paused=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.callbacks={onComplete:null,onLoop:null,onStart:null,onUpdate:null,onYoyo:null},this.callbackScope},dispatchTimelineEvent:function(t,e){this.emit(t,this),e&&e.func.apply(e.scope,e.params)},setTimeScale:function(t){return this.timeScale=t,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return this.state===a.ACTIVE},add:function(t){return this.queue(o(this,t))},queue:function(t){return this.isPlaying()||(t.parent=this,t.parentIsTimeline=!0,this.data.push(t),this.totalData=this.data.length),this},hasOffset:function(t){return null!==t.offset},isOffsetAbsolute:function(t){return"number"==typeof t},isOffsetRelative:function(t){if("string"===typeof t){var e=t[0];if("-"===e||"+"===e)return!0}return!1},getRelativeOffset:function(t,e){var i=t[0],s=parseFloat(t.substr(2)),n=e;switch(i){case"+":n+=s;break;case"-":n-=s}return Math.max(0,n)},calcDuration:function(){for(var t=0,e=0,i=0,s=0;s0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},init:function(){return this.calcDuration(),this.progress=0,this.totalProgress=0,!this.paused||(this.state=a.PAUSED,!1)},resetTweens:function(t){for(var e=0;e0?(this.elapsed=0,this.progress=0,this.loopCounter--,this.resetTweens(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=a.LOOP_DELAY):(this.state=a.ACTIVE,this.dispatchTimelineEvent(r.TIMELINE_LOOP,this.callbacks.onLoop))):this.completeDelay>0?(this.state=a.COMPLETE_DELAY,this.countdown=this.completeDelay):(this.state=a.PENDING_REMOVE,this.dispatchTimelineEvent(r.TIMELINE_COMPLETE,this.callbacks.onComplete))},update:function(t,e){if(this.state!==a.PAUSED){switch(this.useFrames&&(e=1*this.manager.timeScale),e*=this.timeScale,this.elapsed+=e,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=e,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),this.state){case a.ACTIVE:for(var i=this.totalData,s=0;s{var s=i(66458),n=i(56694),r=i(68710),o=i(91963),a=i(7599),h=i(91944),l=i(32981),u=i(55303),c=i(68061),d=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.timeScale=1,this._add=[],this._pending=[],this._active=[],this._destroy=[],this._toProcess=0,t.sys.events.once(a.BOOT,this.boot,this),t.sys.events.on(a.START,this.start,this)},boot:function(){this.systems.events.once(a.DESTROY,this.destroy,this)},start:function(){var t=this.systems.events;t.on(a.PRE_UPDATE,this.preUpdate,this),t.on(a.UPDATE,this.update,this),t.once(a.SHUTDOWN,this.shutdown,this),this.timeScale=1},createTimeline:function(t){return l(this,t)},timeline:function(t){var e=l(this,t);return e.paused||(this._add.push(e),this._toProcess++),e},create:function(t){return c(this,t)},add:function(t){var e=c(this,t);return this._add.push(e),this._toProcess++,e},existing:function(t){return this._add.push(t),this._toProcess++,this},addCounter:function(t){var e=r(this,t);return this._add.push(e),this._toProcess++,e},stagger:function(t,e){return h(t,e)},preUpdate:function(){if(0!==this._toProcess){var t,e,i=this._destroy,s=this._active,n=this._pending;for(t=0;t-1&&(e.state=u.REMOVED,n.splice(r,1)):(e.state=u.REMOVED,s.splice(r,1))}for(i.length=0,i=this._add,t=0;t{t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},21902:(t,e,i)=>{var s=i(35060),n=i(40587);t.exports=function(t,e){var i=s.Power0;if("string"==typeof t)if(s.hasOwnProperty(t))i=s[t];else{var r="";t.indexOf(".")&&("in"===(r=t.substr(t.indexOf(".")+1)).toLowerCase()?r="easeIn":"out"===r.toLowerCase()?r="easeOut":"inout"===r.toLowerCase()&&(r="easeInOut")),t=n(t.substr(0,t.indexOf(".")+1)+r),s.hasOwnProperty(t)&&(i=s[t])}else"function"==typeof t?i=t:Array.isArray(t)&&t.length;if(!e)return i;var o=e.slice(0);return o.unshift(0),function(t){return o[0]=t,i.apply(this,o)}}},28348:t=>{t.exports=function(t,e,i){var s;t.hasOwnProperty(e)?s="function"===typeof t[e]?function(i,s,n,r,o,a){return t[e](i,s,n,r,o,a)}:function(){return t[e]}:s="function"==typeof i?i:function(){return i};return s}},92407:(t,e,i)=>{var s=i(53709);t.exports=function(t){var e,i=[];if(t.hasOwnProperty("props"))for(e in t.props)"_"!==e.substr(0,1)&&i.push({key:e,value:t.props[e]});else for(e in t)-1===s.indexOf(e)&&"_"!==e.substr(0,1)&&i.push({key:e,value:t[e]});return i}},65868:(t,e,i)=>{var s=i(10850);t.exports=function(t){var e=s(t,"targets",null);return null===e||("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e])),e}},10365:(t,e,i)=>{var s=i(10850);t.exports=function(t){var e=s(t,"tweens",null);return null===e?[]:("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e]),e)}},9744:t=>{function e(t){return!!t.getActive&&"function"==typeof t.getActive}function i(t){return!!t.getStart&&"function"==typeof t.getStart}function s(t){return!!t.getEnd&&"function"==typeof t.getEnd}var n=function(t,r){var o,a,h=function(t,e,i){return i},l=function(t,e,i){return i},u=null,c=typeof r;if("number"===c)h=function(){return r};else if("string"===c){var d=r[0],p=parseFloat(r.substr(2));switch(d){case"+":h=function(t,e,i){return i+p};break;case"-":h=function(t,e,i){return i-p};break;case"*":h=function(t,e,i){return i*p};break;case"/":h=function(t,e,i){return i/p};break;default:h=function(){return parseFloat(r)}}}else if("function"===c)h=r;else if("object"===c)if(i(a=r)||s(a)||e(a))e(r)&&(u=r.getActive),s(r)&&(h=r.getEnd),i(r)&&(l=r.getStart);else if(r.hasOwnProperty("value"))o=n(t,r.value);else{var f=r.hasOwnProperty("to"),v=r.hasOwnProperty("from"),g=r.hasOwnProperty("start");if(f&&(v||g)){if(o=n(t,r.to),g){var m=n(t,r.start);o.getActive=m.getEnd}if(v){var y=n(t,r.from);o.getStart=y.getEnd}}}return o||(o={getActive:u,getEnd:h,getStart:l}),o};t.exports=n},68710:(t,e,i)=>{var s=i(99730),n=i(20494),r=i(63130),o=i(21902),a=i(28348),h=i(10850),l=i(9744),u=i(39366),c=i(15718);t.exports=function(t,e,i){void 0===i&&(i=s);var d=h(e,"from",0),p=h(e,"to",1),f=[{value:d}],v=a(e,"delay",i.delay),g=a(e,"duration",i.duration),m=h(e,"easeParams",i.easeParams),y=o(h(e,"ease",i.ease),m),x=a(e,"hold",i.hold),T=a(e,"repeat",i.repeat),w=a(e,"repeatDelay",i.repeatDelay),b=r(e,"yoyo",i.yoyo),E=[],S=l("value",p),A=c(f[0],0,"value",S.getEnd,S.getStart,S.getActive,y,v,g,b,x,T,w,!1,!1);A.start=d,A.current=d,A.to=p,E.push(A);var _=new u(t,E,f);_.offset=n(e,"offset",null),_.completeDelay=n(e,"completeDelay",0),_.loop=Math.round(n(e,"loop",0)),_.loopDelay=Math.round(n(e,"loopDelay",0)),_.paused=r(e,"paused",!1),_.useFrames=r(e,"useFrames",!1);for(var C=h(e,"callbackScope",_),M=u.TYPES,R=0;R{var s=i(21902),n=i(10850),r=i(83392);t.exports=function(t,e){var i;void 0===e&&(e={});var o=n(e,"start",0),a=n(e,"ease",null),h=n(e,"grid",null),l=n(e,"from",0),u="first"===l,c="center"===l,d="last"===l,p="number"==typeof l,f=Array.isArray(t),v=f?parseFloat(t[0]):parseFloat(t),g=f?parseFloat(t[1]):0,m=Math.max(v,g);if(f&&(o+=v),h){var y=h[0],x=h[1],T=0,w=0,b=0,E=0,S=[];d?(T=y-1,w=x-1):p?(T=l%y,w=Math.floor(l/y)):c&&(T=(y-1)/2,w=(x-1)/2);for(var A=r.MIN_SAFE_INTEGER,_=0;_A&&(A=M),S[_][C]=M}}}var R=a?s(a):null;return i=h?function(t,e,i,s){var n,r=0,a=s%y,h=Math.floor(s/y);if(a>=0&&a=0&&h{var s=i(32742),n=i(99730),r=i(20494),o=i(63130),a=i(21902),h=i(28348),l=i(65868),u=i(10365),c=i(10850),d=i(28860),p=i(68061);t.exports=function(t,e){var i=new d(t);i.completeDelay=r(e,"completeDelay",0),i.loop=Math.round(r(e,"loop",0)),i.loopDelay=Math.round(r(e,"loopDelay",0)),i.paused=o(e,"paused",!1),i.useFrames=o(e,"useFrames",!1);var f=c(e,"callbackScope",i),v=c(e,"onStart",!1);if(v){var g=c(e,"onStartScope",f),m=c(e,"onStartParams",[]);i.setCallback("onStart",v,m,g)}var y=c(e,"onUpdate",!1);if(y){var x=c(e,"onUpdateScope",f),T=c(e,"onUpdateParams",[]);i.setCallback("onUpdate",y,T,x)}var w=c(e,"onLoop",!1);if(w){var b=c(e,"onLoopScope",f),E=c(e,"onLoopParams",[]);i.setCallback("onLoop",w,E,b)}var S=c(e,"onYoyo",!1);if(S){var A=c(e,"onYoyoScope",f),_=c(e,"onYoyoParams",[]);i.setCallback("onYoyo",S,_,A)}var C=c(e,"onComplete",!1);if(C){var M=c(e,"onCompleteScope",f),R=c(e,"onCompleteParams",[]);i.setCallback("onComplete",C,R,M)}var P=u(e);if(0===P.length)return i.paused=!0,i;var O=s(n);O.targets=l(e);var L=r(e,"totalDuration",0);O.duration=L>0?Math.floor(L/P.length):h(e,"duration",O.duration),O.delay=h(e,"delay",O.delay),O.easeParams=c(e,"easeParams",O.easeParams),O.ease=a(c(e,"ease",O.ease),O.easeParams),O.hold=h(e,"hold",O.hold),O.repeat=h(e,"repeat",O.repeat),O.repeatDelay=h(e,"repeatDelay",O.repeatDelay),O.yoyo=o(e,"yoyo",O.yoyo),O.flipX=o(e,"flipX",O.flipX),O.flipY=o(e,"flipY",O.flipY);for(var F=0;F{var s=i(99730),n=i(20494),r=i(63130),o=i(21902),a=i(28348),h=i(92407),l=i(65868),u=i(10850),c=i(9744),d=i(39366),p=i(15718);t.exports=function(t,e,i){void 0===i&&(i=s);for(var f=i.targets?i.targets:l(e),v=h(e),g=a(e,"delay",i.delay),m=a(e,"duration",i.duration),y=u(e,"easeParams",i.easeParams),x=o(u(e,"ease",i.ease),y),T=a(e,"hold",i.hold),w=a(e,"repeat",i.repeat),b=a(e,"repeatDelay",i.repeatDelay),E=r(e,"yoyo",i.yoyo),S=r(e,"flipX",i.flipX),A=r(e,"flipY",i.flipY),_=[],C=0;C{t.exports={GetBoolean:i(63130),GetEaseFunction:i(21902),GetNewValue:i(28348),GetProps:i(92407),GetTargets:i(65868),GetTweens:i(10365),GetValueOp:i(9744),NumberTweenBuilder:i(68710),StaggerBuilder:i(91944),TimelineBuilder:i(32981),TweenBuilder:i(68061)}},51910:t=>{t.exports="complete"},76826:t=>{t.exports="loop"},59953:t=>{t.exports="pause"},92495:t=>{t.exports="resume"},55493:t=>{t.exports="start"},48224:t=>{t.exports="update"},5570:t=>{t.exports="active"},6383:t=>{t.exports="complete"},72582:t=>{t.exports="loop"},80803:t=>{t.exports="repeat"},10472:t=>{t.exports="start"},5379:t=>{t.exports="stop"},43449:t=>{t.exports="update"},61541:t=>{t.exports="yoyo"},54272:(t,e,i)=>{t.exports={TIMELINE_COMPLETE:i(51910),TIMELINE_LOOP:i(76826),TIMELINE_PAUSE:i(59953),TIMELINE_RESUME:i(92495),TIMELINE_START:i(55493),TIMELINE_UPDATE:i(48224),TWEEN_ACTIVE:i(5570),TWEEN_COMPLETE:i(6383),TWEEN_LOOP:i(72582),TWEEN_REPEAT:i(80803),TWEEN_START:i(10472),TWEEN_STOP:i(5379),TWEEN_UPDATE:i(43449),TWEEN_YOYO:i(61541)}},75193:(t,e,i)=>{var s=i(55303),n=i(98611),r={Builders:i(79619),Events:i(54272),TweenManager:i(64532),Tween:i(39366),TweenData:i(15718),Timeline:i(28860)};r=n(!1,r,s),t.exports=r},99730:t=>{t.exports={targets:null,delay:0,duration:1e3,ease:"Power0",easeParams:null,hold:0,repeat:0,repeatDelay:0,yoyo:!1,flipX:!1,flipY:!1}},53709:t=>{t.exports=["callbackScope","completeDelay","delay","duration","ease","easeParams","flipX","flipY","hold","loop","loopDelay","offset","onActive","onActiveParams","onActiveScope","onComplete","onCompleteParams","onCompleteScope","onLoop","onLoopParams","onLoopScope","onRepeat","onRepeatParams","onRepeatScope","onStart","onStartParams","onStartScope","onStop","onStopParams","onStopScope","onUpdate","onUpdateParams","onUpdateScope","onYoyo","onYoyoParams","onYoyoScope","paused","props","repeat","repeatDelay","targets","useFrames","yoyo"]},39366:(t,e,i)=>{var s=i(56694),n=i(6659),r=i(54272),o=i(99325),a=i(61286),h=i(55303),l=i(83392),u=new s({Extends:n,initialize:function(t,e,i){n.call(this),this.parent=t,this.parentIsTimeline=t.hasOwnProperty("isTimeline"),this.data=e,this.totalData=e.length,this.targets=i,this.totalTargets=i.length,this.useFrames=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.startDelay=0,this.hasStarted=!1,this.isSeeking=!1,this.completeDelay=0,this.countdown=0,this.offset=0,this.calculatedOffset=0,this.state=h.PENDING_ADD,this._pausedState=h.INIT,this.paused=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.callbacks={onActive:null,onComplete:null,onLoop:null,onRepeat:null,onStart:null,onStop:null,onUpdate:null,onYoyo:null},this.callbackScope},getValue:function(t){return void 0===t&&(t=0),this.data[t].current},setTimeScale:function(t){return this.timeScale=t,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return this.state===h.ACTIVE},isPaused:function(){return this.state===h.PAUSED},hasTarget:function(t){return-1!==this.targets.indexOf(t)},updateTo:function(t,e,i){void 0===i&&(i=!1);for(var s=0;s0&&(n.totalDuration+=n.t2*n.repeat),n.totalDuration>t&&(t=n.totalDuration),n.delay0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay,this.startDelay=e},init:function(){if(this.paused&&!this.parentIsTimeline)return this.state=h.PENDING_ADD,this._pausedState=h.INIT,!1;for(var t=this.data,e=this.totalTargets,i=0;i0?(this.elapsed=0,this.progress=0,this.loopCounter--,this.resetTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=h.LOOP_DELAY):(this.state=h.ACTIVE,this.dispatchTweenEvent(r.TWEEN_LOOP,this.callbacks.onLoop))):this.completeDelay>0?(this.state=h.COMPLETE_DELAY,this.countdown=this.completeDelay):(this.state=h.PENDING_REMOVE,this.dispatchTweenEvent(r.TWEEN_COMPLETE,this.callbacks.onComplete))},pause:function(){return this.state===h.PAUSED||(this.paused=!0,this._pausedState=this.state,this.state=h.PAUSED),this},play:function(t){void 0===t&&(t=!1);var e=this.state;return e!==h.INIT||this.parentIsTimeline?e===h.ACTIVE||e===h.PENDING_ADD&&this._pausedState===h.PENDING_ADD?this:this.parentIsTimeline||e!==h.PENDING_REMOVE&&e!==h.REMOVED?(this.parentIsTimeline?(this.resetTweenData(t),0===this.calculatedOffset?this.state=h.ACTIVE:(this.countdown=this.calculatedOffset,this.state=h.OFFSET_DELAY)):this.paused?(this.paused=!1,this.makeActive()):(this.resetTweenData(t),this.state=h.ACTIVE,this.makeActive()),this):(this.seek(0),this.parent.makeActive(this),this):(this.resetTweenData(!1),this.state=h.ACTIVE,this)},resetTweenData:function(t){for(var e=this.data,i=this.totalData,s=this.totalTargets,n=0;n0&&(r.elapsed=r.delay,r.state=h.DELAY),r.getActiveValue&&(o[a]=r.getActiveValue(r.target,r.key,r.start))}},resume:function(){return this.state===h.PAUSED?(this.paused=!1,this.state=this._pausedState):this.play(),this},seek:function(t,e){void 0===e&&(e=16.6),this.state===h.REMOVED&&this.makeActive(),this.elapsed=0,this.progress=0,this.totalElapsed=0,this.totalProgress=0;for(var i=this.data,s=this.totalTargets,n=0;n0&&(r.elapsed=r.delay,r.state=h.DELAY)}this.calcDuration();var c=!1;this.state===h.PAUSED&&(c=!0,this.state=h.ACTIVE),this.isSeeking=!0;do{this.update(0,e)}while(this.totalProgress0?(e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY(),e.start=e.getStartValue(e.target,e.key,e.start,e.index,t.totalTargets,t),e.end=e.getEndValue(e.target,e.key,e.start,e.index,t.totalTargets,t),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,h.REPEAT_DELAY):(this.dispatchTweenDataEvent(r.TWEEN_REPEAT,t.callbacks.onRepeat,e),h.PLAYING_FORWARD)):h.COMPLETE},setStateFromStart:function(t,e,i){return e.repeatCounter>0?(e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY(),e.end=e.getEndValue(e.target,e.key,e.start,e.index,t.totalTargets,t),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,h.REPEAT_DELAY):(this.dispatchTweenDataEvent(r.TWEEN_REPEAT,t.callbacks.onRepeat,e),h.PLAYING_FORWARD)):h.COMPLETE},updateTweenData:function(t,e,i){var s=e.target;switch(e.state){case h.PLAYING_FORWARD:case h.PLAYING_BACKWARD:if(!s){e.state=h.COMPLETE;break}var n=e.elapsed,o=e.duration,a=0;(n+=i)>o&&(a=n-o,n=o);var l=e.state===h.PLAYING_FORWARD,u=n/o;if(e.elapsed=n,e.progress=u,e.previous=e.current,1===u)l?(e.current=e.end,s[e.key]=e.end,e.hold>0?(e.elapsed=e.hold-a,e.state=h.HOLD_DELAY):e.state=this.setStateFromEnd(t,e,a)):(e.current=e.start,s[e.key]=e.start,e.state=this.setStateFromStart(t,e,a));else{var c=l?e.ease(u):e.ease(1-u);e.current=e.start+(e.end-e.start)*c,s[e.key]=e.current}this.dispatchTweenDataEvent(r.TWEEN_UPDATE,t.callbacks.onUpdate,e);break;case h.DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=h.PENDING_RENDER);break;case h.REPEAT_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=h.PLAYING_FORWARD,this.dispatchTweenDataEvent(r.TWEEN_REPEAT,t.callbacks.onRepeat,e));break;case h.HOLD_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.state=this.setStateFromEnd(t,e,Math.abs(e.elapsed)));break;case h.PENDING_RENDER:s?(e.start=e.getStartValue(s,e.key,s[e.key],e.index,t.totalTargets,t),e.end=e.getEndValue(s,e.key,e.start,e.index,t.totalTargets,t),e.current=e.start,s[e.key]=e.start,e.state=h.PLAYING_FORWARD):e.state=h.COMPLETE}return e.state!==h.COMPLETE}});u.TYPES=["onActive","onComplete","onLoop","onRepeat","onStart","onStop","onUpdate","onYoyo"],a.register("tween",(function(t){return this.scene.sys.tweens.add(t)})),o.register("tween",(function(t){return this.scene.sys.tweens.create(t)})),t.exports=u},15718:t=>{t.exports=function(t,e,i,s,n,r,o,a,h,l,u,c,d,p,f){return{target:t,index:e,key:i,getActiveValue:r,getEndValue:s,getStartValue:n,ease:o,duration:0,totalDuration:0,delay:0,yoyo:l,hold:0,repeat:0,repeatDelay:0,flipX:p,flipY:f,progress:0,elapsed:0,repeatCounter:0,start:0,previous:0,current:0,end:0,t1:0,t2:0,gen:{delay:a,duration:h,hold:u,repeat:c,repeatDelay:d},state:0}}},55303:t=>{t.exports={CREATED:0,INIT:1,DELAY:2,OFFSET_DELAY:3,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING_ADD:20,PAUSED:21,LOOP_DELAY:22,ACTIVE:23,COMPLETE_DELAY:24,PENDING_REMOVE:25,REMOVED:26}},56694:t=>{function e(t,e,i){var s=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&s.value&&"object"==typeof s.value&&(s=s.value),!(!s||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(s))&&(void 0===s.enumerable&&(s.enumerable=!0),void 0===s.configurable&&(s.configurable=!0),s)}function i(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function s(t,s,n,o){for(var a in s)if(s.hasOwnProperty(a)){var h=e(s,a,n);if(!1!==h){if(i((o||t).prototype,a)){if(r.ignoreFinals)continue;throw new Error("cannot override final property '"+a+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,a,h)}else t.prototype[a]=s[a]}}function n(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i{t.exports=function(){}},78991:t=>{t.exports=function(t,e,i,s,n){if(void 0===n&&(n=t),i>0){var r=i-t.length;if(r<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),s&&s.call(n,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.splice(o,1),o--;if(0===(o=e.length))return null;i>0&&o>r&&(e.splice(r),o=r);for(var a=0;a{t.exports=function(t,e,i,s,n,r){if(void 0===i&&(i=0),void 0===r&&(r=t),s>0){var o=s-t.length;if(o<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),n&&n.call(r,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.pop(),a--;if(0===(a=e.length))return null;s>0&&a>o&&(e.splice(o),a=o);for(var h=a-1;h>=0;h--){var l=e[h];t.splice(i,0,l),n&&n.call(r,l)}return e}},58742:t=>{t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i{var s=i(45838);t.exports=function(t,e,i,n,r){void 0===n&&(n=0),void 0===r&&(r=t.length);var o=0;if(s(t,n,r))for(var a=n;a{t.exports=function(t,e,i){var s,n=[null];for(s=3;s{var s=i(45838);t.exports=function(t,e,i,n,r){if(void 0===n&&(n=0),void 0===r&&(r=t.length),s(t,n,r)){var o,a=[null];for(o=5;o{t.exports=function(t,e,i){if(!e.length)return NaN;if(1===e.length)return e[0];var s,n,r=1;if(i){if(te.length&&(r=e.length),i?(s=e[r-1][i],(n=e[r][i])-t<=t-s?e[r]:e[r-1]):(s=e[r-1],(n=e[r])-t<=t-s?n:s)}},71608:(t,e,i)=>{var s=i(45838);t.exports=function(t,e,i,n,r){void 0===n&&(n=0),void 0===r&&(r=t.length);var o=[];if(s(t,n,r))for(var a=n;a{var s=i(45838);t.exports=function(t,e,i,n,r){if(void 0===n&&(n=0),void 0===r&&(r=t.length),s(t,n,r))for(var o=n;o{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var s=e+Math.floor(Math.random()*i);return void 0===t[s]?null:t[s]}},24218:t=>{t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),n=t.indexOf(i);if(s<0||n<0)throw new Error("Supplied items must be elements of the same array");return s>n||(t.splice(s,1),n===t.length-1?t.push(e):t.splice(n,0,e)),t}},58258:t=>{t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),n=t.indexOf(i);if(s<0||n<0)throw new Error("Supplied items must be elements of the same array");return s{t.exports=function(t,e){var i=t.indexOf(e);if(i>0){var s=t[i-1],n=t.indexOf(s);t[i]=s,t[n]=e}return t}},68396:t=>{t.exports=function(t,e,i){var s=t.indexOf(e);if(-1===s||i<0||i>=t.length)throw new Error("Supplied index out of bounds");return s!==i&&(t.splice(s,1),t.splice(i,0,e)),e}},27555:t=>{t.exports=function(t,e){var i=t.indexOf(e);if(-1!==i&&i{t.exports=function(t,e,i,s){var n,r=[],o=!1;if((i||s)&&(o=!0,i||(i=""),s||(s="")),e=e;n--)o?r.push(i+n.toString()+s):r.push(n);else for(n=t;n<=e;n++)o?r.push(i+n.toString()+s):r.push(n);return r}},89955:(t,e,i)=>{var s=i(67233);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var n=[],r=Math.max(s((e-t)/(i||1)),0),o=0;o{function e(t,e,i){var s=t[e];t[e]=t[i],t[i]=s}function i(t,e){return te?1:0}var s=function(t,n,r,o,a){for(void 0===r&&(r=0),void 0===o&&(o=t.length-1),void 0===a&&(a=i);o>r;){if(o-r>600){var h=o-r+1,l=n-r+1,u=Math.log(h),c=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*c*(h-c)/h)*(l-h/2<0?-1:1),p=Math.max(r,Math.floor(n-l*c/h+d)),f=Math.min(o,Math.floor(n+(h-l)*c/h+d));s(t,n,p,f,a)}var v=t[n],g=r,m=o;for(e(t,r,n),a(t[o],v)>0&&e(t,r,o);g0;)m--}0===a(t[r],v)?e(t,r,m):e(t,++m,o),m<=n&&(r=m+1),n<=m&&(o=m-1)}};t.exports=s},75757:(t,e,i)=>{var s=i(10850),n=i(18592),r=function(t,e,i){for(var s=[],n=0;n{var s=i(72677);t.exports=function(t,e,i,n){var r;if(void 0===n&&(n=t),!Array.isArray(e))return-1!==(r=t.indexOf(e))?(s(t,r),i&&i.call(n,e),e):null;for(var o=e.length-1,a=[];o>=0;){var h=e[o];-1!==(r=t.indexOf(h))&&(s(t,r),a.push(h),i&&i.call(n,h)),o--}return a}},8324:(t,e,i)=>{var s=i(72677);t.exports=function(t,e,i,n){if(void 0===n&&(n=t),e<0||e>t.length-1)throw new Error("Index out of bounds");var r=s(t,e);return i&&i.call(n,r),r}},47427:(t,e,i)=>{var s=i(45838);t.exports=function(t,e,i,n,r){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===r&&(r=t),s(t,e,i)){var o=i-e,a=t.splice(e,o);if(n)for(var h=0;h{var s=i(72677);t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var n=e+Math.floor(Math.random()*i);return s(t,n)}},80402:t=>{t.exports=function(t,e,i){var s=t.indexOf(e),n=t.indexOf(i);return-1!==s&&-1===n&&(t[s]=i,!0)}},77640:t=>{t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,s=0;s{t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,s=0;s{t.exports=function(t,e,i,s){var n=t.length;if(e<0||e>n||e>=i||i>n||e+i>n){if(s)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},27847:t=>{t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i>0&&(t.splice(i,1),t.unshift(e)),e}},6034:(t,e,i)=>{var s=i(45838);t.exports=function(t,e,i,n,r){if(void 0===n&&(n=0),void 0===r&&(r=t.length),s(t,n,r))for(var o=n;o{t.exports=function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(Math.random()*(e+1)),s=t[e];t[e]=t[i],t[i]=s}return t}},28834:t=>{t.exports=function(t){var e=/\D/g;return t.sort((function(t,i){return parseInt(t.replace(e,""),10)-parseInt(i.replace(e,""),10)})),t}},72677:t=>{t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,s=t[e],n=e;n{function e(t,e){return String(t).localeCompare(e)}function i(t,e,i,s){var n,r,o,a,h,l=t.length,u=0,c=2*i;for(n=0;nl&&(r=l),o>l&&(o=l),a=n,h=r;;)if(a{t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),n=t.indexOf(i);if(s<0||n<0)throw new Error("Supplied items must be elements of the same array");return t[s]=i,t[n]=e,t}},59959:(t,e,i)=>{t.exports={Matrix:i(13515),Add:i(78991),AddAt:i(48522),BringToTop:i(58742),CountAllMatching:i(30164),Each:i(36337),EachInRange:i(46208),FindClosestInSorted:i(2406),GetAll:i(71608),GetFirst:i(51463),GetRandom:i(72861),MoveDown:i(51172),MoveTo:i(68396),MoveUp:i(27555),MoveAbove:i(24218),MoveBelow:i(58258),NumberArray:i(13401),NumberArrayStep:i(89955),QuickSelect:i(53466),Range:i(75757),Remove:i(66458),RemoveAt:i(8324),RemoveBetween:i(47427),RemoveRandomElement:i(50147),Replace:i(80402),RotateLeft:i(77640),RotateRight:i(38487),SafeRange:i(45838),SendToBack:i(27847),SetAll:i(6034),Shuffle:i(18592),SortByDigits:i(28834),SpliceOne:i(72677),StableSort:i(17922),Swap:i(96928)}},97494:t=>{t.exports=function(t){if(!Array.isArray(t)||!Array.isArray(t[0]))return!1;for(var e=t[0].length,i=1;i{var s=i(76400),n=i(97494);t.exports=function(t){var e="";if(!n(t))return e;for(var i=0;i{t.exports=function(t){return t.reverse()}},51995:t=>{t.exports=function(t){for(var e=0;e{var s=i(63515);t.exports=function(t){return s(t,180)}},42549:(t,e,i)=>{var s=i(63515);t.exports=function(t){return s(t,90)}},63515:(t,e,i)=>{var s=i(97494),n=i(78581);t.exports=function(t,e){if(void 0===e&&(e=90),!s(t))return null;if("string"!=typeof e&&(e=(e%360+360)%360),90===e||-270===e||"rotateLeft"===e)(t=n(t)).reverse();else if(-90===e||270===e||"rotateRight"===e)t.reverse(),t=n(t);else if(180===Math.abs(e)||"rotate180"===e){for(var i=0;i{var s=i(63515);t.exports=function(t){return s(t,-90)}},27365:(t,e,i)=>{var s=i(77640),n=i(38487);t.exports=function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),0!==i&&(i<0?s(t,Math.abs(i)):n(t,i)),0!==e)for(var r=0;r{t.exports=function(t){for(var e=t.length,i=t[0].length,s=new Array(i),n=0;n-1;r--)s[n][r]=t[r][n]}return s}},13515:(t,e,i)=>{t.exports={CheckMatrix:i(97494),MatrixToString:i(68428),ReverseColumns:i(59521),ReverseRows:i(51995),Rotate180:i(89011),RotateLeft:i(42549),RotateMatrix:i(63515),RotateRight:i(14305),Translate:i(27365),TransposeMatrix:i(78581)}},40581:t=>{var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";t.exports=function(t,i){for(var s=new Uint8Array(t),n=s.length,r=i?"data:"+i+";base64,":"",o=0;o>2],r+=e[(3&s[o])<<4|s[o+1]>>4],r+=e[(15&s[o+1])<<2|s[o+2]>>6],r+=e[63&s[o+2]];return n%3==2?r=r.substring(0,r.length-1)+"=":n%3==1&&(r=r.substring(0,r.length-2)+"=="),r}},82329:t=>{for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(256),s=0;s>4,u[h++]=(15&s)<<4|n>>2,u[h++]=(3&n)<<6|63&r;return l}},78417:(t,e,i)=>{t.exports={ArrayBufferToBase64:i(40581),Base64ToArrayBuffer:i(82329)}},22178:(t,e,i)=>{t.exports={Array:i(59959),Base64:i(78417),Objects:i(64615),String:i(50379),NOOP:i(72283)}},32742:t=>{t.exports=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i]=t[i].slice(0):e[i]=t[i];return e}},28699:t=>{var e=function(t){var i,s,n;if("object"!=typeof t||null===t)return t;for(n in i=Array.isArray(t)?[]:{},t)s=t[n],i[n]=e(s);return i};t.exports=e},98611:(t,e,i)=>{var s=i(42911),n=function(){var t,e,i,r,o,a,h=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof h&&(c=h,h=arguments[1]||{},l=2),u===l&&(h=this,--l);l{var s=i(5923),n=i(10850);t.exports=function(t,e,i){var r=n(t,e,null);if(null===r)return i;if(Array.isArray(r))return s.RND.pick(r);if("object"==typeof r){if(r.hasOwnProperty("randInt"))return s.RND.integerInRange(r.randInt[0],r.randInt[1]);if(r.hasOwnProperty("randFloat"))return s.RND.realInRange(r.randFloat[0],r.randFloat[1])}else if("function"==typeof r)return r(e);return r}},72632:t=>{t.exports=function(t,e,i){var s=typeof t;return t&&"number"!==s&&"string"!==s&&t.hasOwnProperty(e)&&void 0!==t[e]?t[e]:i}},94324:(t,e,i)=>{var s=i(10850),n=i(82897);t.exports=function(t,e,i,r,o){void 0===o&&(o=i);var a=s(t,e,o);return n(a,i,r)}},10850:t=>{t.exports=function(t,e,i){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return t[e];if(-1!==e.indexOf(".")){for(var s=e.split("."),n=t,r=i,o=0;o{t.exports=function(t,e){for(var i=0;i{t.exports=function(t,e){for(var i=0;i{t.exports=function(t,e){return t.hasOwnProperty(e)}},42911:t=>{t.exports=function(t){if("object"!=typeof t||t.nodeType||t===t.window)return!1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0}},30657:(t,e,i)=>{var s=i(32742);t.exports=function(t,e){var i=s(t);for(var n in e)i.hasOwnProperty(n)||(i[n]=e[n]);return i}},72066:(t,e,i)=>{var s=i(32742);t.exports=function(t,e){var i=s(t);for(var n in e)i.hasOwnProperty(n)&&(i[n]=e[n]);return i}},28820:(t,e,i)=>{var s=i(19256);t.exports=function(t,e){for(var i={},n=0;n{t.exports=function(t,e,i){if(!t||"number"==typeof t)return!1;if(t.hasOwnProperty(e))return t[e]=i,!0;if(-1!==e.indexOf(".")){for(var s=e.split("."),n=t,r=t,o=0;o{t.exports={Clone:i(32742),DeepCopy:i(28699),Extend:i(98611),GetAdvancedValue:i(20494),GetFastValue:i(72632),GetMinMaxValue:i(94324),GetValue:i(10850),HasAll:i(87701),HasAny:i(53523),HasValue:i(19256),IsPlainObject:i(42911),Merge:i(30657),MergeRight:i(72066),Pick:i(28820),SetValue:i(22440)}},69429:t=>{t.exports=function(t,e){return t.replace(/%([0-9]+)/g,(function(t,i){return e[Number(i)-1]}))}},76400:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=0),void 0===i&&(i=" "),void 0===s&&(s=3);var n=0;if(e+1>=(t=t.toString()).length)switch(s){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var r=Math.ceil((n=e-t.length)/2);t=new Array(n-r+1).join(i)+t+new Array(r+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},76872:t=>{t.exports=function(t,e){return 0===e?t.slice(1):t.slice(0,e-1)+t.slice(e)}},8051:t=>{t.exports=function(t){return t.split("").reverse().join("")}},76583:t=>{t.exports=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))}},40587:t=>{t.exports=function(t){return t&&t[0].toUpperCase()+t.slice(1)}},50379:(t,e,i)=>{t.exports={Format:i(69429),Pad:i(76400),RemoveAt:i(76872),Reverse:i(8051),UppercaseFirst:i(40587),UUID:i(76583)}}},e={};function i(s){var n=e[s];if(void 0!==n)return n.exports;var r=e[s]={exports:{}};return t[s](r,r.exports,i),r.exports}return i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i(92491)})()})); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Phaser",[],e):"object"==typeof exports?exports.Phaser=e():t.Phaser=e()}(this,(()=>(()=>{var t={6659:t=>{"use strict";var e=Object.prototype.hasOwnProperty,i="~";function s(){}function n(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function r(t,e,s,r,o){if("function"!=typeof s)throw new TypeError("The listener must be a function");var a=new n(s,r||t,o),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new s:delete t._events[e]}function a(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(i=!1)),a.prototype.eventNames=function(){var t,s,n=[];if(0===this._eventsCount)return n;for(s in t=this._events)e.call(t,s)&&n.push(i?s.slice(1):s);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=i?i+t:t,s=this._events[e];if(!s)return[];if(s.fn)return[s.fn];for(var n=0,r=s.length,o=new Array(r);n{var s=i(82590);t.exports=function(t,e,i,n){for(var r=t[0],o=1;o{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"angle",e,i,n,r)}},22015:t=>{t.exports=function(t,e,i){for(var s=0;s{t.exports=function(t,e,i){void 0===i&&(i=0);for(var s=i;s{t.exports=function(t,e,i){void 0===i&&(i=0);for(var s=i;s{var s=i(40327),n=i(84093),r=i(72632),o=i(72283),a=new(i(71030))({sys:{queueDepthSort:o,events:{once:o}}},0,0,1,1);t.exports=function(t,e){void 0===e&&(e={});var i=e.hasOwnProperty("width"),o=e.hasOwnProperty("height"),h=r(e,"width",-1),l=r(e,"height",-1),u=r(e,"cellWidth",1),c=r(e,"cellHeight",u),d=r(e,"position",n.TOP_LEFT),p=r(e,"x",0),f=r(e,"y",0),v=0,g=0,m=h*u,y=l*c;a.setPosition(p,f),a.setSize(u,c);for(var x=0;x{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"alpha",e,i,n,r)}},3877:(t,e,i)=>{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"x",e,i,n,r)}},71020:(t,e,i)=>{var s=i(6124);t.exports=function(t,e,i,n,r,o,a){return null==i&&(i=e),s(t,"x",e,n,o,a),s(t,"y",i,r,o,a)}},28970:(t,e,i)=>{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"y",e,i,n,r)}},82249:t=>{t.exports=function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=6.28);for(var n=i,r=(s-i)/t.length,o=0;o{t.exports=function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=6.28);for(var n=i,r=(s-i)/t.length,o=e.width/2,a=e.height/2,h=0;h{var s=i(8570);t.exports=function(t,e){for(var i=s(e,t.length),n=0;n{var s=i(40053),n=i(77640),r=i(38487);t.exports=function(t,e,i){void 0===i&&(i=0);var o=s(e,!1,t.length);i>0?n(o,i):i<0&&r(o,Math.abs(i));for(var a=0;a{var s=i(58813);t.exports=function(t,e,i){var n=s({x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2},i),r=s({x1:e.x2,y1:e.y2,x2:e.x3,y2:e.y3},i),o=s({x1:e.x3,y1:e.y3,x2:e.x1,y2:e.y1},i);n.pop(),r.pop(),o.pop();for(var a=(n=n.concat(r,o)).length/t.length,h=0,l=0;l{t.exports=function(t,e,i){for(var s=0;s{t.exports=function(t,e,i,s,n,r){var o;void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=1);var a=0,h=t.length;if(1===r)for(o=n;o=0;o--)t[o][e]+=i+a*s,a++;return t}},23646:t=>{t.exports=function(t,e,i,s,n,r){var o;void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=1);var a=0,h=t.length;if(1===r)for(o=n;o=0;o--)t[o][e]=i+a*s,a++;return t}},4392:(t,e,i)=>{var s=i(30977);t.exports=function(t,e){for(var i=0;i{var s=i(72006);t.exports=function(t,e){for(var i=0;i{var s=i(74077);t.exports=function(t,e){for(var i=0;i{var s=i(30001);t.exports=function(t,e){for(var i=0;i{var s=i(99761);t.exports=function(t,e){for(var i=0;i{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"rotation",e,i,n,r)}},87299:(t,e,i)=>{var s=i(72395),n=i(53996);t.exports=function(t,e,i){for(var r=e.x,o=e.y,a=0;a{var s=i(72395);t.exports=function(t,e,i,n){var r=e.x,o=e.y;if(0===n)return t;for(var a=0;a{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"scaleX",e,i,n,r)}},51449:(t,e,i)=>{var s=i(6124);t.exports=function(t,e,i,n,r,o,a){return null==i&&(i=e),s(t,"scaleX",e,n,o,a),s(t,"scaleY",i,r,o,a)}},64895:(t,e,i)=>{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"scaleY",e,i,n,r)}},30329:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"alpha",e,i,n,r)}},43954:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n){return s(t,"blendMode",e,0,i,n)}},70688:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"depth",e,i,n,r)}},8314:t=>{t.exports=function(t,e,i){for(var s=0;s{var s=i(23646);t.exports=function(t,e,i,n,r,o,a){return null==i&&(i=e),s(t,"originX",e,n,o,a),s(t,"originY",i,r,o,a),t.forEach((function(t){t.updateDisplayOrigin()})),t}},38767:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"rotation",e,i,n,r)}},18584:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r,o,a){return null==i&&(i=e),s(t,"scaleX",e,n,o,a),s(t,"scaleY",i,r,o,a)}},17381:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"scaleX",e,i,n,r)}},74370:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"scaleY",e,i,n,r)}},27773:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r,o,a){return null==i&&(i=e),s(t,"scrollFactorX",e,n,o,a),s(t,"scrollFactorY",i,r,o,a)}},75257:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"scrollFactorX",e,i,n,r)}},54512:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"scrollFactorY",e,i,n,r)}},69423:t=>{t.exports=function(t,e,i,s,n){for(var r=0;r{var s=i(23646);t.exports=function(t,e,i,n){return s(t,"visible",e,0,i,n)}},94833:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"x",e,i,n,r)}},14284:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r,o,a){return null==i&&(i=e),s(t,"x",e,n,o,a),s(t,"y",i,r,o,a)}},96574:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"y",e,i,n,r)}},74086:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r){var o,a,h,l,u,c;if(void 0===n&&(n=0),void 0===r&&(r=new s),t.length>1)if(0===n){var d=t.length-1;for(o=t[d].x,a=t[d].y,h=d-1;h>=0;h--)l=(c=t[h]).x,u=c.y,c.x=o,c.y=a,o=l,a=u;t[d].x=e,t[d].y=i}else{for(o=t[0].x,a=t[0].y,h=1;h{var s=i(18592);t.exports=function(t){return s(t)}},1558:(t,e,i)=>{var s=i(5514);t.exports=function(t,e,i,n,r){void 0===r&&(r=!1);var o,a=Math.abs(n-i)/t.length;if(r)for(o=0;o{var s=i(87736);t.exports=function(t,e,i,n,r){void 0===r&&(r=!1);var o,a=Math.abs(n-i)/t.length;if(r)for(o=0;o{t.exports=function(t,e,i,s,n){void 0===n&&(n=!1);var r,o=Math.abs(s-i)/t.length;if(n)for(r=0;r{t.exports=function(t){for(var e=0;e{var s=i(1071);t.exports=function(t,e,i){void 0===i&&(i=0);for(var n=0;n{t.exports={AlignTo:i(62270),Angle:i(61148),Call:i(22015),GetFirst:i(31060),GetLast:i(52367),GridAlign:i(12673),IncAlpha:i(691),IncX:i(3877),IncXY:i(71020),IncY:i(28970),PlaceOnCircle:i(82249),PlaceOnEllipse:i(30285),PlaceOnLine:i(61557),PlaceOnRectangle:i(63549),PlaceOnTriangle:i(51629),PlayAnimation:i(1045),PropertyValueInc:i(6124),PropertyValueSet:i(23646),RandomCircle:i(4392),RandomEllipse:i(94985),RandomLine:i(63305),RandomRectangle:i(90739),RandomTriangle:i(91417),Rotate:i(26182),RotateAround:i(87299),RotateAroundDistance:i(92194),ScaleX:i(30363),ScaleXY:i(51449),ScaleY:i(64895),SetAlpha:i(30329),SetBlendMode:i(43954),SetDepth:i(70688),SetHitArea:i(8314),SetOrigin:i(12894),SetRotation:i(38767),SetScale:i(18584),SetScaleX:i(17381),SetScaleY:i(74370),SetScrollFactor:i(27773),SetScrollFactorX:i(75257),SetScrollFactorY:i(54512),SetTint:i(69423),SetVisible:i(58291),SetX:i(94833),SetXY:i(14284),SetY:i(96574),ShiftPosition:i(74086),Shuffle:i(86347),SmootherStep:i(9938),SmoothStep:i(1558),Spread:i(71060),ToggleVisible:i(11207),WrapInRectangle:i(24404)}},85463:(t,e,i)=>{var s=i(82897),n=i(56694),r=i(16938),o=i(2406),a=i(71519),h=i(10850),l=i(28834),u=new n({initialize:function(t,e,i){this.manager=t,this.key=e,this.type="frame",this.frames=this.getFrames(t.textureManager,h(i,"frames",[]),h(i,"defaultTextureKey",null),h(i,"sortFrames",!0)),this.frameRate=h(i,"frameRate",null),this.duration=h(i,"duration",null),this.msPerFrame,this.skipMissedFrames=h(i,"skipMissedFrames",!0),this.delay=h(i,"delay",0),this.repeat=h(i,"repeat",0),this.repeatDelay=h(i,"repeatDelay",0),this.yoyo=h(i,"yoyo",!1),this.showOnStart=h(i,"showOnStart",!1),this.hideOnComplete=h(i,"hideOnComplete",!1),this.paused=!1,this.calculateDuration(this,this.getTotalFrames(),this.duration,this.frameRate),this.manager.on&&(this.manager.on(r.PAUSE_ALL,this.pause,this),this.manager.on(r.RESUME_ALL,this.resume,this))},getTotalFrames:function(){return this.frames.length},calculateDuration:function(t,e,i,s){null===i&&null===s?(t.frameRate=24,t.duration=24/e*1e3):i&&null===s?(t.duration=i,t.frameRate=e/(i/1e3)):(t.frameRate=s,t.duration=e/s*1e3),t.msPerFrame=1e3/t.frameRate},addFrame:function(t){return this.addFrameAt(this.frames.length,t)},addFrameAt:function(t,e){var i=this.getFrames(this.manager.textureManager,e);if(i.length>0){if(0===t)this.frames=i.concat(this.frames);else if(t===this.frames.length)this.frames=this.frames.concat(i);else{var s=this.frames.slice(0,t),n=this.frames.slice(t);this.frames=s.concat(i,n)}this.updateFrameSequence()}return this},checkFrame:function(t){return t>=0&&t0){r.isLast=!0,r.nextFrame=c[0],c[0].prevFrame=r;var y=1/(c.length-1);for(o=0;o0?t.inReverse&&t.forward?t.forward=!1:this.repeatAnimation(t):t.complete():this.updateAndGetNextTick(t,e.nextFrame)},handleYoyoFrame:function(t,e){if(e||(e=!1),t.inReverse===!e&&t.repeatCounter>0)return(0===t.repeatDelay||t.pendingRepeat)&&(t.forward=e),void this.repeatAnimation(t);if(t.inReverse===e||0!==t.repeatCounter){t.forward=e;var i=e?t.currentFrame.nextFrame:t.currentFrame.prevFrame;this.updateAndGetNextTick(t,i)}else t.complete()},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t.yoyo?this.handleYoyoFrame(t,!0):t.repeatCounter>0?(t.inReverse&&!t.forward||(t.forward=!0),this.repeatAnimation(t)):t.complete():this.updateAndGetNextTick(t,e.prevFrame)},updateAndGetNextTick:function(t,e){t.setCurrentFrame(e),this.getNextTick(t)},removeFrame:function(t){var e=this.frames.indexOf(t);return-1!==e&&this.removeFrameAt(e),this},removeFrameAt:function(t){return this.frames.splice(t,1),this.updateFrameSequence(),this},repeatAnimation:function(t){if(2===t._pendingStop){if(0===t._pendingStopValue)return t.stop();t._pendingStopValue--}t.repeatDelay>0&&!t.pendingRepeat?(t.pendingRepeat=!0,t.accumulator-=t.nextTick,t.nextTick+=t.repeatDelay):(t.repeatCounter--,t.forward?t.setCurrentFrame(t.currentFrame.nextFrame):t.setCurrentFrame(t.currentFrame.prevFrame),t.isPlaying&&(this.getNextTick(t),t.handleRepeat()))},toJSON:function(){var t={key:this.key,type:this.type,frames:[],frameRate:this.frameRate,duration:this.duration,skipMissedFrames:this.skipMissedFrames,delay:this.delay,repeat:this.repeat,repeatDelay:this.repeatDelay,yoyo:this.yoyo,showOnStart:this.showOnStart,hideOnComplete:this.hideOnComplete};return this.frames.forEach((function(e){t.frames.push(e.toJSON())})),t},updateFrameSequence:function(){for(var t,e=this.frames.length,i=1/(e-1),s=0;s1?(t.isLast=!0,t.prevFrame=this.frames[e-2],t.nextFrame=this.frames[0]):e>1&&(t.prevFrame=this.frames[s-1],t.nextFrame=this.frames[s+1]);return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.manager.off&&(this.manager.off(r.PAUSE_ALL,this.pause,this),this.manager.off(r.RESUME_ALL,this.resume,this)),this.manager.remove(this.key);for(var t=0;t{var s=new(i(56694))({initialize:function(t,e,i,s,n){void 0===n&&(n=!1),this.textureKey=t,this.textureFrame=e,this.index=i,this.frame=s,this.isFirst=!1,this.isLast=!1,this.prevFrame=null,this.nextFrame=null,this.duration=0,this.progress=0,this.isKeyFrame=n},toJSON:function(){return{key:this.textureKey,frame:this.textureFrame,duration:this.duration,keyframe:this.isKeyFrame}},destroy:function(){this.frame=void 0}});t.exports=s},90249:(t,e,i)=>{var s=i(85463),n=i(56694),r=i(33885),o=i(6659),a=i(16938),h=i(97081),l=i(72632),u=i(10850),c=i(76400),d=i(13401),p=new n({Extends:o,initialize:function(t){o.call(this),this.game=t,this.textureManager=null,this.globalTimeScale=1,this.anims=new r,this.mixes=new r,this.paused=!1,this.name="AnimationManager",t.events.once(h.BOOT,this.boot,this)},boot:function(){this.textureManager=this.game.textures,this.game.events.once(h.DESTROY,this.destroy,this)},addMix:function(t,e,i){var s=this.anims,n=this.mixes,r="string"==typeof t?t:t.key,o="string"==typeof e?e:e.key;if(s.has(r)&&s.has(o)){var a=n.get(r);a||(a={}),a[o]=i,n.set(r,a)}return this},removeMix:function(t,e){var i=this.mixes,s="string"==typeof t?t:t.key,n=i.get(s);if(n)if(e){var r="string"==typeof e?e:e.key;n.hasOwnProperty(r)&&delete n[r]}else e||i.delete(s);return this},getMix:function(t,e){var i=this.mixes,s="string"==typeof t?t:t.key,n="string"==typeof e?e:e.key,r=i.get(s);return r&&r.hasOwnProperty(n)?r[n]:0},add:function(t,e){return this.anims.has(t)?(console.warn("Animation key exists: "+t),this):(e.key=t,this.anims.set(t,e),this.emit(a.ADD_ANIMATION,t,e),this)},exists:function(t){return this.anims.has(t)},createFromAseprite:function(t,e,i){var s=[],n=this.game.cache.json.get(t);if(!n)return s;var r=this,o=u(n,"meta",null),a=u(n,"frames",null);o&&a&&u(o,"frameTags",[]).forEach((function(n){var o=[],h=l(n,"name",null),u=l(n,"from",0),c=l(n,"to",0),d=l(n,"direction","forward");if(h&&(!e||e&&e.indexOf(h)>-1)){for(var p=0,f=u;f<=c;f++){var v=f.toString(),g=a[v];if(g){var m=l(g,"duration",Number.MAX_SAFE_INTEGER);o.push({key:t,frame:v,duration:m}),p+=m}}var y=p/o.length;o.forEach((function(t){t.duration-=y})),"reverse"===d&&(o=o.reverse());var x,T={key:h,frames:o,duration:p,yoyo:"pingpong"===d};i?i.anims&&(x=i.anims.create(T)):x=r.create(T),x&&s.push(x)}}));return s},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))||(i=new s(this,e,t),this.anims.set(e,i),this.emit(a.ADD_ANIMATION,e,i))),i},fromJSON:function(t,e){void 0===e&&(e=!1),e&&this.anims.clear(),"string"==typeof t&&(t=JSON.parse(t));var i=[];if(t.hasOwnProperty("anims")&&Array.isArray(t.anims)){for(var s=0;s{var s=i(56694),n=i(33885),r=i(72632),o=i(16938),a=i(85463),h=new s({initialize:function(t){this.parent=t,this.animationManager=t.scene.sys.anims,this.animationManager.on(o.REMOVE_ANIMATION,this.globalRemove,this),this.textureManager=this.animationManager.textureManager,this.anims=null,this.isPlaying=!1,this.hasStarted=!1,this.currentAnim=null,this.currentFrame=null,this.nextAnim=null,this.nextAnimsQueue=[],this.timeScale=1,this.frameRate=0,this.duration=0,this.msPerFrame=0,this.skipMissedFrames=!0,this.delay=0,this.repeat=0,this.repeatDelay=0,this.yoyo=!1,this.showOnStart=!1,this.hideOnComplete=!1,this.forward=!0,this.inReverse=!1,this.accumulator=0,this.nextTick=0,this.delayCounter=0,this.repeatCounter=0,this.pendingRepeat=!1,this._paused=!1,this._wasPlaying=!1,this._pendingStop=0,this._pendingStopValue},chain:function(t){var e=this.parent;if(void 0===t)return this.nextAnimsQueue.length=0,this.nextAnim=null,e;Array.isArray(t)||(t=[t]);for(var i=0;is.getTotalFrames()&&(h=0);var l=s.frames[h];0!==h||this.forward||(l=s.getLastFrame()),this.currentFrame=l}else console.warn("Missing animation: "+i);return this.parent},pause:function(t){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),void 0!==t&&this.setCurrentFrame(t),this.parent},resume:function(t){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),void 0!==t&&this.setCurrentFrame(t),this.parent},playAfterDelay:function(t,e){if(this.isPlaying){var i=this.nextAnim,s=this.nextAnimsQueue;i&&s.unshift(i),this.nextAnim=t,this._pendingStop=1,this._pendingStopValue=e}else this.delayCounter=e,this.play(t,!0);return this.parent},playAfterRepeat:function(t,e){if(void 0===e&&(e=1),this.isPlaying){var i=this.nextAnim,s=this.nextAnimsQueue;i&&s.unshift(i),-1!==this.repeatCounter&&e>this.repeatCounter&&(e=this.repeatCounter),this.nextAnim=t,this._pendingStop=2,this._pendingStopValue=e}else this.play(t);return this.parent},play:function(t,e){void 0===e&&(e=!1);var i=this.currentAnim,s=this.parent,n="string"==typeof t?t:t.key;if(e&&this.isPlaying&&i.key===n)return s;if(i&&this.isPlaying){var r=this.animationManager.getMix(i.key,t);if(r>0)return this.playAfterDelay(t,r)}return this.forward=!0,this.inReverse=!1,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t)},playReverse:function(t,e){void 0===e&&(e=!1);var i="string"==typeof t?t:t.key;return e&&this.isPlaying&&this.currentAnim.key===i?this.parent:(this.forward=!1,this.inReverse=!0,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t))},startAnimation:function(t){this.load(t);var e=this.currentAnim,i=this.parent;return e?(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat,e.getFirstTick(this),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!1,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.delayCounter+=this.delay,0===this.delayCounter&&this.handleStart(),i):i},handleStart:function(){this.showOnStart&&this.parent.setVisible(!0),this.setCurrentFrame(this.currentFrame),this.hasStarted=!0,this.emitEvents(o.ANIMATION_START)},handleRepeat:function(){this.pendingRepeat=!1,this.emitEvents(o.ANIMATION_REPEAT)},handleStop:function(){this._pendingStop=0,this.isPlaying=!1,this.emitEvents(o.ANIMATION_STOP)},handleComplete:function(){this._pendingStop=0,this.isPlaying=!1,this.hideOnComplete&&this.parent.setVisible(!1),this.emitEvents(o.ANIMATION_COMPLETE,o.ANIMATION_COMPLETE_KEY)},emitEvents:function(t,e){var i=this.currentAnim,s=this.currentFrame,n=this.parent,r=s.textureFrame;n.emit(t,i,s,n,r),e&&n.emit(e+i.key,i,s,n,r)},reverse:function(){return this.isPlaying&&(this.inReverse=!this.inReverse,this.forward=!this.forward),this.parent},getProgress:function(){var t=this.currentFrame;if(!t)return 0;var e=t.progress;return this.inReverse&&(e*=-1),e},setProgress:function(t){return this.forward||(t=1-t),this.setCurrentFrame(this.currentAnim.getFrameByProgress(t)),this.parent},setRepeat:function(t){return this.repeatCounter=-1===t?Number.MAX_VALUE:t,this.parent},globalRemove:function(t,e){void 0===e&&(e=this.currentAnim),this.isPlaying&&e.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},restart:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);var i=this.currentAnim,s=this.parent;return i?(e&&(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat),i.getFirstTick(this),this.emitEvents(o.ANIMATION_RESTART),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!t,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.setCurrentFrame(i.frames[0]),this.parent):s},complete:function(){if(this._pendingStop=0,this.isPlaying=!1,this.currentAnim&&this.handleComplete(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.length>0?this.nextAnimsQueue.shift():null,this.play(t)}return this.parent},stop:function(){if(this._pendingStop=0,this.isPlaying=!1,this.currentAnim&&this.handleStop(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.shift(),this.play(t)}return this.parent},stopAfterDelay:function(t){return this._pendingStop=1,this._pendingStopValue=t,this.parent},stopAfterRepeat:function(t){return void 0===t&&(t=1),-1!==this.repeatCounter&&t>this.repeatCounter&&(t=this.repeatCounter),this._pendingStop=2,this._pendingStopValue=t,this.parent},stopOnFrame:function(t){return this._pendingStop=3,this._pendingStopValue=t,this.parent},getTotalFrames:function(){return this.currentAnim?this.currentAnim.getTotalFrames():0},update:function(t,e){var i=this.currentAnim;if(this.isPlaying&&i&&!i.paused){if(this.accumulator+=e*this.timeScale,1===this._pendingStop&&(this._pendingStopValue-=e,this._pendingStopValue<=0))return this.stop();if(this.hasStarted){if(this.accumulator>=this.nextTick&&(this.forward?i.nextFrame(this):i.previousFrame(this),this.isPlaying&&0===this._pendingStop&&this.skipMissedFrames&&this.accumulator>this.nextTick)){var s=0;do{this.forward?i.nextFrame(this):i.previousFrame(this),s++}while(this.isPlaying&&this.accumulator>this.nextTick&&s<60)}}else this.accumulator>=this.delayCounter&&(this.accumulator-=this.delayCounter,this.handleStart())}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),t.setAlpha&&(e.alpha=t.alpha),e.setSizeToFrame(),e._originComponent&&(t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin()),this.isPlaying&&this.hasStarted&&(this.emitEvents(o.ANIMATION_UPDATE),3===this._pendingStop&&this._pendingStopValue===t&&this.stop()),e},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},get:function(t){return this.anims?this.anims.get(t):null},exists:function(t){return!!this.anims&&this.anims.has(t)},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))||(i=new a(this,e,t),this.anims||(this.anims=new n),this.anims.set(e,i))),i},createFromAseprite:function(t,e){return this.animationManager.createFromAseprite(t,e,this.parent)},generateFrameNames:function(t,e){return this.animationManager.generateFrameNames(t,e)},generateFrameNumbers:function(t,e){return this.animationManager.generateFrameNumbers(t,e)},remove:function(t){var e=this.get(t);return e&&(this.currentAnim===e&&this.stop(),this.anims.delete(t)),e},destroy:function(){this.animationManager.off(o.REMOVE_ANIMATION,this.globalRemove,this),this.anims&&this.anims.clear(),this.animationManager=null,this.parent=null,this.nextAnim=null,this.nextAnimsQueue.length=0,this.currentAnim=null,this.currentFrame=null},isPaused:{get:function(){return this._paused}}});t.exports=h},44509:t=>{t.exports="add"},84563:t=>{t.exports="animationcomplete"},61586:t=>{t.exports="animationcomplete-"},72175:t=>{t.exports="animationrepeat"},568:t=>{t.exports="animationrestart"},37690:t=>{t.exports="animationstart"},58525:t=>{t.exports="animationstop"},5243:t=>{t.exports="animationupdate"},10598:t=>{t.exports="pauseall"},4860:t=>{t.exports="remove"},31865:t=>{t.exports="resumeall"},16938:(t,e,i)=>{t.exports={ADD_ANIMATION:i(44509),ANIMATION_COMPLETE:i(84563),ANIMATION_COMPLETE_KEY:i(61586),ANIMATION_REPEAT:i(72175),ANIMATION_RESTART:i(568),ANIMATION_START:i(37690),ANIMATION_STOP:i(58525),ANIMATION_UPDATE:i(5243),PAUSE_ALL:i(10598),REMOVE_ANIMATION:i(4860),RESUME_ALL:i(31865)}},13517:(t,e,i)=>{t.exports={Animation:i(85463),AnimationFrame:i(71519),AnimationManager:i(90249),AnimationState:i(16569),Events:i(16938)}},23740:(t,e,i)=>{var s=i(56694),n=i(33885),r=i(6659),o=i(69773),a=new s({initialize:function(){this.entries=new n,this.events=new r},add:function(t,e){return this.entries.set(t,e),this.events.emit(o.ADD,this,t,e),this},has:function(t){return this.entries.has(t)},exists:function(t){return this.entries.has(t)},get:function(t){return this.entries.get(t)},remove:function(t){var e=this.get(t);return e&&(this.entries.delete(t),this.events.emit(o.REMOVE,this,t,e.data)),this},getKeys:function(){return this.entries.keys()},destroy:function(){this.entries.clear(),this.events.removeAllListeners(),this.entries=null,this.events=null}});t.exports=a},43474:(t,e,i)=>{var s=i(23740),n=i(56694),r=i(97081),o=new n({initialize:function(t){this.game=t,this.binary=new s,this.bitmapFont=new s,this.json=new s,this.physics=new s,this.shader=new s,this.audio=new s,this.video=new s,this.text=new s,this.html=new s,this.obj=new s,this.tilemap=new s,this.xml=new s,this.custom={},this.game.events.once(r.DESTROY,this.destroy,this)},addCustom:function(t){return this.custom.hasOwnProperty(t)||(this.custom[t]=new s),this.custom[t]},destroy:function(){for(var t=["binary","bitmapFont","json","physics","shader","audio","video","text","html","obj","tilemap","xml"],e=0;e{t.exports="add"},75968:t=>{t.exports="remove"},69773:(t,e,i)=>{t.exports={ADD:i(94762),REMOVE:i(75968)}},45820:(t,e,i)=>{t.exports={BaseCache:i(23740),CacheManager:i(43474),Events:i(69773)}},51052:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(75606),o=i(6659),a=i(89787),h=i(74118),l=i(69360),u=i(93222),c=i(93736),d=new s({Extends:o,Mixins:[n.Alpha,n.Visible],initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),o.call(this),this.scene,this.sceneManager,this.scaleManager,this.cameraManager,this.id=0,this.name="",this.roundPixels=!1,this.useBounds=!1,this.worldView=new h,this.dirty=!0,this._x=t,this._y=e,this._width=i,this._height=s,this._bounds=new h,this._scrollX=0,this._scrollY=0,this._zoomX=1,this._zoomY=1,this._rotation=0,this.matrix=new l,this.transparent=!0,this.backgroundColor=u("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new c(i/2,s/2),this.originX=.5,this.originY=.5,this._customViewport=!1,this.mask=null,this._maskCamera=null,this.renderList=[]},addToRenderList:function(t){this.renderList.push(t)},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this},getScroll:function(t,e,i){void 0===i&&(i=new c);var s=.5*this.width,n=.5*this.height;return i.x=t-s,i.y=e-n,this.useBounds&&(i.x=this.clampX(i.x),i.y=this.clampY(i.y)),i},centerOnX:function(t){var e=.5*this.width;return this.midPoint.x=t,this.scrollX=t-e,this.useBounds&&(this.scrollX=this.clampX(this.scrollX)),this},centerOnY:function(t){var e=.5*this.height;return this.midPoint.y=t,this.scrollY=t-e,this.useBounds&&(this.scrollY=this.clampY(this.scrollY)),this},centerOn:function(t,e){return this.centerOnX(t),this.centerOnY(e),this},centerToBounds:function(){if(this.useBounds){var t=this._bounds,e=.5*this.width,i=.5*this.height;this.midPoint.set(t.centerX,t.centerY),this.scrollX=t.centerX-e,this.scrollY=t.centerY-i}return this},centerToSize:function(){return this.scrollX=.5*this.width,this.scrollY=.5*this.height,this},cull:function(t){if(this.disableCull)return t;var e=this.matrix.matrix,i=e[0],s=e[1],n=e[2],r=e[3],o=i*r-s*n;if(!o)return t;var a=e[4],h=e[5],l=this.scrollX,u=this.scrollY,c=this.width,d=this.height,p=this.y,f=p+d,v=this.x,g=v+c,m=this.culledObjects,y=t.length;o=1/o,m.length=0;for(var x=0;xv&&E*i+S*n+ap&&E*s+S*r+hn&&(t=n),t},clampY:function(t){var e=this._bounds,i=this.displayHeight,s=e.y+(i-this.height)/2,n=Math.max(s,s+e.height-i);return tn&&(t=n),t},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(t){return void 0===t&&(t=0),this.rotation=r(t),this},setBackgroundColor:function(t){return void 0===t&&(t="rgba(0,0,0,0)"),this.backgroundColor=u(t),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(t,e,i,s,n){return void 0===n&&(n=!1),this._bounds.setTo(t,e,i,s),this.dirty=!0,this.useBounds=!0,n?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},getBounds:function(t){void 0===t&&(t=new h);var e=this._bounds;return t.setTo(e.x,e.y,e.width,e.height),t},setName:function(t){return void 0===t&&(t=""),this.name=t,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setRoundPixels:function(t){return this.roundPixels=t,this},setScene:function(t){this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=t;var e=t.sys;return this.sceneManager=e.game.scene,this.scaleManager=e.scale,this.cameraManager=e.cameras,this.updateSystem(),this},setScroll:function(t,e){return void 0===e&&(e=t),this.scrollX=t,this.scrollY=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},setViewport:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setZoom:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),0===t&&(t=.001),0===e&&(e=.001),this.zoomX=t,this.zoomY=e,this},setMask:function(t,e){return void 0===e&&(e=!0),this.mask=t,this._maskCamera=e?this.cameraManager.default:this,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},toJSON:function(){var t={name:this.name,x:this.x,y:this.y,width:this.width,height:this.height,zoom:this.zoom,rotation:this.rotation,roundPixels:this.roundPixels,scrollX:this.scrollX,scrollY:this.scrollY,backgroundColor:this.backgroundColor.rgba};return this.useBounds&&(t.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),t},update:function(){},updateSystem:function(){if(this.scaleManager){var t=0!==this._x||0!==this._y||this.scaleManager.width!==this._width||this.scaleManager.height!==this._height,e=this.sceneManager;t&&!this._customViewport?e.customViewports++:!t&&this._customViewport&&e.customViewports--,this.dirty=!0,this._customViewport=t}},destroy:function(){this.emit(a.DESTROY,this),this.removeAllListeners(),this.matrix.destroy(),this.culledObjects=[],this._customViewport&&this.sceneManager.customViewports--,this.renderList=[],this._bounds=null,this.scene=null,this.scaleManager=null,this.sceneManager=null,this.cameraManager=null},x:{get:function(){return this._x},set:function(t){this._x=t,this.updateSystem()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.updateSystem()}},width:{get:function(){return this._width},set:function(t){this._width=t,this.updateSystem()}},height:{get:function(){return this._height},set:function(t){this._height=t,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(t){this._scrollX=t,this.dirty=!0}},scrollY:{get:function(){return this._scrollY},set:function(t){this._scrollY=t,this.dirty=!0}},zoom:{get:function(){return(this._zoomX+this._zoomY)/2},set:function(t){this._zoomX=t,this._zoomY=t,this.dirty=!0}},zoomX:{get:function(){return this._zoomX},set:function(t){this._zoomX=t,this.dirty=!0}},zoomY:{get:function(){return this._zoomY},set:function(t){this._zoomY=t,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this.dirty=!0}},centerX:{get:function(){return this.x+.5*this.width}},centerY:{get:function(){return this.y+.5*this.height}},displayWidth:{get:function(){return this.width/this.zoomX}},displayHeight:{get:function(){return this.height/this.zoomY}}});t.exports=d},47751:(t,e,i)=>{var s=i(51052),n=i(79993),r=i(82897),o=i(56694),a=i(64937),h=i(53030),l=i(89787),u=i(42798),c=i(74118),d=i(93736),p=new o({Extends:s,Mixins:[a.Pipeline],initialize:function(t,e,i,n){s.call(this,t,e,i,n),this.postPipelines=[],this.pipelineData={},this.inputEnabled=!0,this.fadeEffect=new h.Fade(this),this.flashEffect=new h.Flash(this),this.shakeEffect=new h.Shake(this),this.panEffect=new h.Pan(this),this.rotateToEffect=new h.RotateTo(this),this.zoomEffect=new h.Zoom(this),this.lerp=new d(1,1),this.followOffset=new d,this.deadzone=null,this._follow=null},setDeadzone:function(t,e){if(void 0===t)this.deadzone=null;else{if(this.deadzone?(this.deadzone.width=t,this.deadzone.height=e):this.deadzone=new c(0,0,t,e),this._follow){var i=this.width/2,s=this.height/2,r=this._follow.x-this.followOffset.x,o=this._follow.y-this.followOffset.y;this.midPoint.set(r,o),this.scrollX=r-i,this.scrollY=o-s}n(this.deadzone,this.midPoint.x,this.midPoint.y)}return this},fadeIn:function(t,e,i,s,n,r){return this.fadeEffect.start(!1,t,e,i,s,!0,n,r)},fadeOut:function(t,e,i,s,n,r){return this.fadeEffect.start(!0,t,e,i,s,!0,n,r)},fadeFrom:function(t,e,i,s,n,r,o){return this.fadeEffect.start(!1,t,e,i,s,n,r,o)},fade:function(t,e,i,s,n,r,o){return this.fadeEffect.start(!0,t,e,i,s,n,r,o)},flash:function(t,e,i,s,n,r,o){return this.flashEffect.start(t,e,i,s,n,r,o)},shake:function(t,e,i,s,n){return this.shakeEffect.start(t,e,i,s,n)},pan:function(t,e,i,s,n,r,o){return this.panEffect.start(t,e,i,s,n,r,o)},rotateTo:function(t,e,i,s,n,r,o){return this.rotateToEffect.start(t,e,i,s,n,r,o)},zoomTo:function(t,e,i,s,n,r){return this.zoomEffect.start(t,e,i,s,n,r)},preRender:function(){this.renderList.length=0;var t=this.width,e=this.height,i=.5*t,s=.5*e,r=this.zoom,o=this.matrix,a=t*this.originX,h=e*this.originY,c=this._follow,d=this.deadzone,p=this.scrollX,f=this.scrollY;d&&n(d,this.midPoint.x,this.midPoint.y);var v=!1;if(c&&!this.panEffect.isRunning){var g=c.x-this.followOffset.x,m=c.y-this.followOffset.y;d?(gd.right&&(p=u(p,p+(g-d.right),this.lerp.x)),md.bottom&&(f=u(f,f+(m-d.bottom),this.lerp.y))):(p=u(p,g-a,this.lerp.x),f=u(f,m-h,this.lerp.y)),v=!0}this.useBounds&&(p=this.clampX(p),f=this.clampY(f)),this.roundPixels&&(a=Math.round(a),h=Math.round(h),p=Math.round(p),f=Math.round(f)),this.scrollX=p,this.scrollY=f;var y=p+i,x=f+s;this.midPoint.set(y,x);var T=t/r,w=e/r,b=y-T/2,E=x-w/2;this.roundPixels&&(b=Math.round(b),E=Math.round(E)),this.worldView.setTo(b,E,T,w),o.applyITRS(this.x+a,this.y+h,this.rotation,r,r),o.translate(-a,-h),this.shakeEffect.preRender(),v&&this.emit(l.FOLLOW_UPDATE,this,c)},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,s,n,o){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===s&&(s=i),void 0===n&&(n=0),void 0===o&&(o=n),this._follow=t,this.roundPixels=e,i=r(i,0,1),s=r(s,0,1),this.lerp.set(i,s),this.followOffset.set(n,o);var a=this.width/2,h=this.height/2,l=t.x-n,u=t.y-o;return this.midPoint.set(l,u),this.scrollX=l-a,this.scrollY=u-h,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.rotateToEffect.reset(),this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.rotateToEffect.update(t,e),this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.resetFX(),s.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=p},62382:(t,e,i)=>{var s=i(47751),n=i(56694),r=i(72632),o=i(91963),a=i(94287),h=i(40444),l=i(7599),u=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.roundPixels=t.sys.game.config.roundPixels,this.cameras=[],this.main,this.default,t.sys.events.once(l.BOOT,this.boot,this),t.sys.events.on(l.START,this.start,this)},boot:function(){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0],this.default=new s(0,0,t.scale.width,t.scale.height).setScene(this.scene),t.game.scale.on(h.RESIZE,this.onResize,this),this.systems.events.once(l.DESTROY,this.destroy,this)},start:function(){if(!this.main){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0]}var e=this.systems.events;e.on(l.UPDATE,this.update,this),e.once(l.SHUTDOWN,this.shutdown,this)},add:function(t,e,i,n,r,o){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===n&&(n=this.scene.sys.scale.height),void 0===r&&(r=!1),void 0===o&&(o="");var a=new s(t,e,i,n);return a.setName(o),a.setScene(this.scene),a.setRoundPixels(this.roundPixels),a.id=this.getNextID(),this.cameras.push(a),r&&(this.main=a),a},addExisting:function(t,e){return void 0===e&&(e=!1),-1===this.cameras.indexOf(t)?(t.id=this.getNextID(),t.setRoundPixels(this.roundPixels),this.cameras.push(t),e&&(this.main=t),t):null},getNextID:function(){for(var t=this.cameras,e=1,i=0;i<32;i++){for(var s=!1,n=0;n0){r.preRender();var o=this.getVisibleChildren(e.getChildren(),r);t.render(i,o,r)}}},getVisibleChildren:function(t,e){for(var i=[],s=0;s{var s=i(82897),n=i(56694),r=i(89787),o=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.isComplete=!1,this.direction=!0,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n,o,a,h){if(void 0===t&&(t=!0),void 0===e&&(e=1e3),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=0),void 0===o&&(o=!1),void 0===a&&(a=null),void 0===h&&(h=this.camera.scene),!o&&this.isRunning)return this.camera;this.isRunning=!0,this.isComplete=!1,this.duration=e,this.direction=t,this.progress=0,this.red=i,this.green=s,this.blue=n,this.alpha=t?Number.MIN_VALUE:1,this._elapsed=0,this._onUpdate=a,this._onUpdateScope=h;var l=t?r.FADE_OUT_START:r.FADE_IN_START;return this.camera.emit(l,this.camera,this,e,i,s,n),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=s(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed{var s=i(82897),n=i(56694),r=i(89787),o=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=1,this.progress=0,this._elapsed=0,this._alpha,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n,o,a){return void 0===t&&(t=250),void 0===e&&(e=255),void 0===i&&(i=255),void 0===s&&(s=255),void 0===n&&(n=!1),void 0===o&&(o=null),void 0===a&&(a=this.camera.scene),!n&&this.isRunning||(this.isRunning=!0,this.duration=t,this.progress=0,this.red=e,this.green=i,this.blue=s,this._alpha=this.alpha,this._elapsed=0,this._onUpdate=o,this._onUpdateScope=a,this.camera.emit(r.FLASH_START,this.camera,this,t,e,i,s)),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=s(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed{var s=i(82897),n=i(56694),r=i(35060),o=i(89787),a=i(93736),h=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=new a,this.current=new a,this.destination=new a,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n,a,h){void 0===i&&(i=1e3),void 0===s&&(s=r.Linear),void 0===n&&(n=!1),void 0===a&&(a=null),void 0===h&&(h=this.camera.scene);var l=this.camera;return!n&&this.isRunning||(this.isRunning=!0,this.duration=i,this.progress=0,this.source.set(l.scrollX,l.scrollY),this.destination.set(t,e),l.getScroll(t,e,this.current),"string"==typeof s&&r.hasOwnProperty(s)?this.ease=r[s]:"function"==typeof s&&(this.ease=s),this._elapsed=0,this._onUpdate=a,this._onUpdateScope=h,this.camera.emit(o.PAN_START,this.camera,this,i,t,e)),l},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=s(this._elapsed/this.duration,0,1);this.progress=i;var n=this.camera;if(this._elapsed{var s=i(82897),n=i(56694),r=i(89787),o=i(35060),a=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=0,this.current=0,this.destination=0,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope,this.clockwise=!0,this.shortestPath=!1},start:function(t,e,i,s,n,a,h){void 0===i&&(i=1e3),void 0===s&&(s=o.Linear),void 0===n&&(n=!1),void 0===a&&(a=null),void 0===h&&(h=this.camera.scene),void 0===e&&(e=!1),this.shortestPath=e;var l=t;t<0?(l=-1*t,this.clockwise=!1):this.clockwise=!0;var u=360*Math.PI/180;l-=Math.floor(l/u)*u;var c=this.camera;if(!n&&this.isRunning)return c;if(this.isRunning=!0,this.duration=i,this.progress=0,this.source=c.rotation,this.destination=l,"string"==typeof s&&o.hasOwnProperty(s)?this.ease=o[s]:"function"==typeof s&&(this.ease=s),this._elapsed=0,this._onUpdate=a,this._onUpdateScope=h,this.shortestPath){var d=0,p=0;(d=this.destination>this.source?Math.abs(this.destination-this.source):Math.abs(this.destination+u)-this.source)<(p=this.source>this.destination?Math.abs(this.source-this.destination):Math.abs(this.source+u)-this.destination)?this.clockwise=!0:d>p&&(this.clockwise=!1)}return this.camera.emit(r.ROTATE_START,this.camera,this,i,l),c},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=s(this._elapsed/this.duration,0,1);this.progress=i;var n=this.camera;if(this._elapsed=l?Math.abs(h-l):Math.abs(h+a)-l;var u=0;u=this.clockwise?n.rotation+o*r:n.rotation-o*r,n.rotation=u,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,n,i,u)}else n.rotation=this.destination,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,n,i,this.destination),this.effectComplete()}},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(r.ROTATE_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null,this.source=null,this.destination=null}});t.exports=a},3241:(t,e,i)=>{var s=i(82897),n=i(56694),r=i(89787),o=i(93736),a=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.intensity=new o,this.progress=0,this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n){return void 0===t&&(t=100),void 0===e&&(e=.05),void 0===i&&(i=!1),void 0===s&&(s=null),void 0===n&&(n=this.camera.scene),!i&&this.isRunning||(this.isRunning=!0,this.duration=t,this.progress=0,"number"==typeof e?this.intensity.set(e):this.intensity.set(e.x,e.y),this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate=s,this._onUpdateScope=n,this.camera.emit(r.SHAKE_START,this.camera,this,t,e)),this.camera},preRender:function(){this.isRunning&&this.camera.matrix.translate(this._offsetX,this._offsetY)},update:function(t,e){if(this.isRunning)if(this._elapsed+=e,this.progress=s(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed{var s=i(82897),n=i(56694),r=i(35060),o=i(89787),a=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=1,this.destination=1,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n,a){void 0===e&&(e=1e3),void 0===i&&(i=r.Linear),void 0===s&&(s=!1),void 0===n&&(n=null),void 0===a&&(a=this.camera.scene);var h=this.camera;return!s&&this.isRunning||(this.isRunning=!0,this.duration=e,this.progress=0,this.source=h.zoom,this.destination=t,"string"==typeof i&&r.hasOwnProperty(i)?this.ease=r[i]:"function"==typeof i&&(this.ease=i),this._elapsed=0,this._onUpdate=n,this._onUpdateScope=a,this.camera.emit(o.ZOOM_START,this.camera,this,e,t)),h},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=s(this._elapsed/this.duration,0,1),this._elapsed{t.exports={Fade:i(92522),Flash:i(22151),Pan:i(37551),Shake:i(3241),RotateTo:i(1771),Zoom:i(13383)}},39577:t=>{t.exports="cameradestroy"},85373:t=>{t.exports="camerafadeincomplete"},92057:t=>{t.exports="camerafadeinstart"},1903:t=>{t.exports="camerafadeoutcomplete"},96131:t=>{t.exports="camerafadeoutstart"},85409:t=>{t.exports="cameraflashcomplete"},25500:t=>{t.exports="cameraflashstart"},44071:t=>{t.exports="followupdate"},19818:t=>{t.exports="camerapancomplete"},80002:t=>{t.exports="camerapanstart"},87966:t=>{t.exports="postrender"},74217:t=>{t.exports="prerender"},34805:t=>{t.exports="camerarotatecomplete"},30408:t=>{t.exports="camerarotatestart"},49856:t=>{t.exports="camerashakecomplete"},69189:t=>{t.exports="camerashakestart"},67657:t=>{t.exports="camerazoomcomplete"},14229:t=>{t.exports="camerazoomstart"},89787:(t,e,i)=>{t.exports={DESTROY:i(39577),FADE_IN_COMPLETE:i(85373),FADE_IN_START:i(92057),FADE_OUT_COMPLETE:i(1903),FADE_OUT_START:i(96131),FLASH_COMPLETE:i(85409),FLASH_START:i(25500),FOLLOW_UPDATE:i(44071),PAN_COMPLETE:i(19818),PAN_START:i(80002),POST_RENDER:i(87966),PRE_RENDER:i(74217),ROTATE_COMPLETE:i(34805),ROTATE_START:i(30408),SHAKE_COMPLETE:i(49856),SHAKE_START:i(69189),ZOOM_COMPLETE:i(67657),ZOOM_START:i(14229)}},32356:(t,e,i)=>{t.exports={Camera:i(47751),BaseCamera:i(51052),CameraManager:i(62382),Effects:i(53030),Events:i(89787)}},84219:(t,e,i)=>{var s=i(56694),n=i(10850),r=new s({initialize:function(t){this.camera=n(t,"camera",null),this.left=n(t,"left",null),this.right=n(t,"right",null),this.up=n(t,"up",null),this.down=n(t,"down",null),this.zoomIn=n(t,"zoomIn",null),this.zoomOut=n(t,"zoomOut",null),this.zoomSpeed=n(t,"zoomSpeed",.01),this.minZoom=n(t,"minZoom",.001),this.maxZoom=n(t,"maxZoom",1e3),this.speedX=0,this.speedY=0;var e=n(t,"speed",null);"number"==typeof e?(this.speedX=e,this.speedY=e):(this.speedX=n(t,"speed.x",0),this.speedY=n(t,"speed.y",0)),this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this.up&&this.up.isDown?e.scrollY-=this.speedY*t|0:this.down&&this.down.isDown&&(e.scrollY+=this.speedY*t|0),this.left&&this.left.isDown?e.scrollX-=this.speedX*t|0:this.right&&this.right.isDown&&(e.scrollX+=this.speedX*t|0),this.zoomIn&&this.zoomIn.isDown?(e.zoom-=this.zoomSpeed,e.zoomthis.maxZoom&&(e.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},69370:(t,e,i)=>{var s=i(56694),n=i(10850),r=new s({initialize:function(t){this.camera=n(t,"camera",null),this.left=n(t,"left",null),this.right=n(t,"right",null),this.up=n(t,"up",null),this.down=n(t,"down",null),this.zoomIn=n(t,"zoomIn",null),this.zoomOut=n(t,"zoomOut",null),this.zoomSpeed=n(t,"zoomSpeed",.01),this.minZoom=n(t,"minZoom",.001),this.maxZoom=n(t,"maxZoom",1e3),this.accelX=0,this.accelY=0;var e=n(t,"acceleration",null);"number"==typeof e?(this.accelX=e,this.accelY=e):(this.accelX=n(t,"acceleration.x",0),this.accelY=n(t,"acceleration.y",0)),this.dragX=0,this.dragY=0;var i=n(t,"drag",null);"number"==typeof i?(this.dragX=i,this.dragY=i):(this.dragX=n(t,"drag.x",0),this.dragY=n(t,"drag.y",0)),this.maxSpeedX=0,this.maxSpeedY=0;var s=n(t,"maxSpeed",null);"number"==typeof s?(this.maxSpeedX=s,this.maxSpeedY=s):(this.maxSpeedX=n(t,"maxSpeed.x",0),this.maxSpeedY=n(t,"maxSpeed.y",0)),this._speedX=0,this._speedY=0,this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this._speedX>0?(this._speedX-=this.dragX*t,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*t,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*t,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*t,this._speedY>0&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoomthis.maxZoom&&(e.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},6524:(t,e,i)=>{t.exports={FixedKeyControl:i(84219),SmoothedKeyControl:i(69370)}},44143:(t,e,i)=>{t.exports={Controls:i(6524),Scene2D:i(32356)}},86459:(t,e,i)=>{var s={VERSION:"3.60.0-beta.10",BlendModes:i(95723),ScaleModes:i(27394),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=s},14033:(t,e,i)=>{var s=i(56694),n=i(86459),r=i(77290),o=i(72632),a=i(10850),h=i(42911),l=i(5923),u=i(72283),c=i(18360),d=i(93222),p=new s({initialize:function(t){void 0===t&&(t={});var e=a(t,"scale",null);this.width=a(e,"width",1024,t),this.height=a(e,"height",768,t),this.zoom=a(e,"zoom",1,t),this.parent=a(e,"parent",void 0,t),this.scaleMode=a(e,e?"mode":"scaleMode",0,t),this.expandParent=a(e,"expandParent",!0,t),this.autoRound=a(e,"autoRound",!1,t),this.autoCenter=a(e,"autoCenter",0,t),this.resizeInterval=a(e,"resizeInterval",500,t),this.fullscreenTarget=a(e,"fullscreenTarget",null,t),this.minWidth=a(e,"minWidth",0,t),this.maxWidth=a(e,"maxWidth",0,t),this.minHeight=a(e,"minHeight",0,t),this.maxHeight=a(e,"maxHeight",0,t),this.renderType=a(t,"type",n.AUTO),this.canvas=a(t,"canvas",null),this.context=a(t,"context",null),this.canvasStyle=a(t,"canvasStyle",null),this.customEnvironment=a(t,"customEnvironment",!1),this.sceneConfig=a(t,"scene",null),this.seed=a(t,"seed",[(Date.now()*Math.random()).toString()]),l.RND=new l.RandomDataGenerator(this.seed),this.gameTitle=a(t,"title",""),this.gameURL=a(t,"url","https://phaser.io"),this.gameVersion=a(t,"version",""),this.autoFocus=a(t,"autoFocus",!0),this.domCreateContainer=a(t,"dom.createContainer",!1),this.domPointerEvents=a(t,"dom.pointerEvents","none"),this.inputKeyboard=a(t,"input.keyboard",!0),this.inputKeyboardEventTarget=a(t,"input.keyboard.target",window),this.inputKeyboardCapture=a(t,"input.keyboard.capture",[]),this.inputMouse=a(t,"input.mouse",!0),this.inputMouseEventTarget=a(t,"input.mouse.target",null),this.inputMousePreventDefaultDown=a(t,"input.mouse.preventDefaultDown",!0),this.inputMousePreventDefaultUp=a(t,"input.mouse.preventDefaultUp",!0),this.inputMousePreventDefaultMove=a(t,"input.mouse.preventDefaultMove",!0),this.inputMousePreventDefaultWheel=a(t,"input.mouse.preventDefaultWheel",!0),this.inputTouch=a(t,"input.touch",r.input.touch),this.inputTouchEventTarget=a(t,"input.touch.target",null),this.inputTouchCapture=a(t,"input.touch.capture",!0),this.inputActivePointers=a(t,"input.activePointers",1),this.inputSmoothFactor=a(t,"input.smoothFactor",0),this.inputWindowEvents=a(t,"input.windowEvents",!0),this.inputGamepad=a(t,"input.gamepad",!1),this.inputGamepadEventTarget=a(t,"input.gamepad.target",window),this.disableContextMenu=a(t,"disableContextMenu",!1),this.audio=a(t,"audio",{}),this.hideBanner=!1===a(t,"banner",null),this.hidePhaser=a(t,"banner.hidePhaser",!1),this.bannerTextColor=a(t,"banner.text","#ffffff"),this.bannerBackgroundColor=a(t,"banner.background",["#ff0000","#ffff00","#00ff00","#00ffff","#000000"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=a(t,"fps",null);var i=a(t,"render",null);this.pipeline=a(i,"pipeline",null,t),this.antialias=a(i,"antialias",!0,t),this.antialiasGL=a(i,"antialiasGL",!0,t),this.mipmapFilter=a(i,"mipmapFilter","LINEAR",t),this.desynchronized=a(i,"desynchronized",!1,t),this.roundPixels=a(i,"roundPixels",!1,t),this.pixelArt=a(i,"pixelArt",1!==this.zoom,t),this.pixelArt&&(this.antialias=!1,this.antialiasGL=!1,this.roundPixels=!0),this.transparent=a(i,"transparent",!1,t),this.clearBeforeRender=a(i,"clearBeforeRender",!0,t),this.preserveDrawingBuffer=a(i,"preserveDrawingBuffer",!1,t),this.premultipliedAlpha=a(i,"premultipliedAlpha",!0,t),this.failIfMajorPerformanceCaveat=a(i,"failIfMajorPerformanceCaveat",!1,t),this.powerPreference=a(i,"powerPreference","default",t),this.batchSize=a(i,"batchSize",4096,t),this.maxTextures=a(i,"maxTextures",-1,t),this.maxLights=a(i,"maxLights",10,t);var s=a(t,"backgroundColor",0);this.backgroundColor=d(s),this.transparent&&(this.backgroundColor=d(0),this.backgroundColor.alpha=0),this.preBoot=a(t,"callbacks.preBoot",u),this.postBoot=a(t,"callbacks.postBoot",u),this.physics=a(t,"physics",{}),this.defaultPhysicsSystem=a(this.physics,"default",!1),this.loaderBaseURL=a(t,"loader.baseURL",""),this.loaderPath=a(t,"loader.path",""),this.loaderMaxParallelDownloads=a(t,"loader.maxParallelDownloads",r.os.android?6:32),this.loaderCrossOrigin=a(t,"loader.crossOrigin",void 0),this.loaderResponseType=a(t,"loader.responseType",""),this.loaderAsync=a(t,"loader.async",!0),this.loaderUser=a(t,"loader.user",""),this.loaderPassword=a(t,"loader.password",""),this.loaderTimeout=a(t,"loader.timeout",0),this.loaderWithCredentials=a(t,"loader.withCredentials",!1),this.loaderImageLoadType=a(t,"loader.imageLoadType","XHR"),this.loaderLocalScheme=a(t,"loader.localScheme",["file://","capacitor://"]),this.installGlobalPlugins=[],this.installScenePlugins=[];var p=a(t,"plugins",null),f=c.DefaultScene;p&&(Array.isArray(p)?this.defaultPlugins=p:h(p)&&(this.installGlobalPlugins=o(p,"global",[]),this.installScenePlugins=o(p,"scene",[]),Array.isArray(p.default)?f=p.default:Array.isArray(p.defaultMerge)&&(f=f.concat(p.defaultMerge)))),this.defaultPlugins=f;var v="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=a(t,"images.default",v+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=a(t,"images.missing",v+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),this.whiteImage=a(t,"images.white","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABdJREFUeNpi/P//PwMMMDEgAdwcgAADAJZuAwXJYZOzAAAAAElFTkSuQmCC"),window&&(window.FORCE_WEBGL?this.renderType=n.WEBGL:window.FORCE_CANVAS&&(this.renderType=n.CANVAS))}});t.exports=p},50150:(t,e,i)=>{var s=i(70616),n=i(61068),r=i(86459),o=i(90185);t.exports=function(t){var e=t.config;if((e.customEnvironment||e.canvas)&&e.renderType===r.AUTO)throw new Error("Must set explicit renderType in custom environment");if(!e.customEnvironment&&!e.canvas&&e.renderType!==r.HEADLESS)if(e.renderType===r.AUTO&&(e.renderType=o.webGL?r.WEBGL:r.CANVAS),e.renderType===r.WEBGL){if(!o.webGL)throw new Error("Cannot create WebGL context, aborting.")}else{if(e.renderType!==r.CANVAS)throw new Error("Unknown value for renderer type: "+e.renderType);if(!o.canvas)throw new Error("Cannot create Canvas context, aborting.")}e.antialias||n.disableSmoothing();var a,h,l=t.scale.baseSize,u=l.width,c=l.height;(e.canvas?(t.canvas=e.canvas,t.canvas.width=u,t.canvas.height=c):t.canvas=n.create(t,u,c,e.renderType),e.canvasStyle&&(t.canvas.style=e.canvasStyle),e.antialias||s.setCrisp(t.canvas),e.renderType!==r.HEADLESS)&&(a=i(91135),h=i(11857),e.renderType===r.WEBGL?t.renderer=new h(t):(t.renderer=new a(t),t.context=t.renderer.gameContext))}},77291:(t,e,i)=>{var s=i(86459);t.exports=function(t){var e=t.config;if(!e.hideBanner){var i="WebGL";e.renderType===s.CANVAS?i="Canvas":e.renderType===s.HEADLESS&&(i="Headless");var n,r=e.audio,o=t.device.audio;if(n=o.webAudio&&!r.disableWebAudio?"Web Audio":r.noAudio||!o.webAudio&&!o.audioData?"No Audio":"HTML5 Audio",t.device.browser.ie)window.console&&console.log("Phaser v"+s.VERSION+" / https://phaser.io");else{var a,h="",l=[h];if(Array.isArray(e.bannerBackgroundColor))e.bannerBackgroundColor.forEach((function(t){h=h.concat("%c "),l.push("background: "+t),a=t})),l[l.length-1]="color: "+e.bannerTextColor+"; background: "+a;else h=h.concat("%c "),l.push("color: "+e.bannerTextColor+"; background: "+e.bannerBackgroundColor);l.push("background: transparent"),e.gameTitle&&(h=h.concat(e.gameTitle),e.gameVersion&&(h=h.concat(" v"+e.gameVersion)),e.hidePhaser||(h=h.concat(" / ")));e.hidePhaser||(h=h.concat("Phaser v"+s.VERSION+" ("+i+" | "+n+")")),h=h.concat(" %c "+e.gameURL),l[0]=h,console.log.apply(console,l)}}}},15213:(t,e,i)=>{var s=i(99584),n=i(90249),r=i(43474),o=i(61068),a=i(56694),h=i(14033),l=i(85178),u=i(50150),c=i(81078),d=i(77291),p=i(77290),f=i(21546),v=i(6659),g=i(97081),m=i(69898),y=i(91963),x=i(49274),T=i(756),w=i(13553),b=i(38203),E=i(6237),S=i(26617),A=i(26493),_=i(84191),C=new a({initialize:function(t){this.config=new h(t),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new v,this.anims=new n(this),this.textures=new E(this),this.cache=new r(this),this.registry=new c(this),this.input=new m(this,this.config),this.scene=new w(this,this.config.sceneConfig),this.device=p,this.scale=new T(this,this.config),this.sound=null,this.sound=_.create(this),this.loop=new S(this,this.config.fps),this.plugins=new x(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,f(this.boot.bind(this))},boot:function(){y.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),u(this),l(this),d(this),s(this.canvas,this.config.parent),this.textures.once(b.READY,this.texturesReady,this),this.events.emit(g.BOOT)):console.warn("Aborting. Core Plugins missing.")},texturesReady:function(){this.events.emit(g.READY),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),A(this);var t=this.events;t.on(g.HIDDEN,this.onHidden,this),t.on(g.VISIBLE,this.onVisible,this),t.on(g.BLUR,this.onBlur,this),t.on(g.FOCUS,this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit(g.PRE_STEP,t,e),i.emit(g.STEP,t,e),this.scene.update(t,e),i.emit(g.POST_STEP,t,e);var s=this.renderer;s.preRender(),i.emit(g.PRE_RENDER,s,t,e),this.scene.render(s),s.postRender(),i.emit(g.POST_RENDER,s,t,e)},headlessStep:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit(g.PRE_STEP,t,e),i.emit(g.STEP,t,e),this.scene.update(t,e),i.emit(g.POST_STEP,t,e),i.emit(g.PRE_RENDER),i.emit(g.POST_RENDER)},onHidden:function(){this.loop.pause(),this.events.emit(g.PAUSE)},pause:function(){this.onHidden()},onVisible:function(){this.loop.resume(),this.events.emit(g.RESUME)},resume:function(){this.onVisible()},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},getFrame:function(){return this.loop.frame},getTime:function(){return this.loop.now},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.scene.destroy(),this.events.emit(g.DESTROY),this.events.removeAllListeners(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(o.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.domContainer&&this.domContainer.parentNode.removeChild(this.domContainer),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=C},26617:(t,e,i)=>{var s=i(56694),n=i(10850),r=i(72283),o=i(27385),a=new s({initialize:function(t,e){this.game=t,this.raf=new o,this.started=!1,this.running=!1,this.minFps=n(e,"min",5),this.targetFps=n(e,"target",60),this.fpsLimit=n(e,"limit",0),this.hasFpsLimit=this.fpsLimit>0,this._limitRate=this.hasFpsLimit?1e3/this.fpsLimit:0,this._min=1e3/this.minFps,this._target=1e3/this.targetFps,this.actualFps=this.targetFps,this.nextFpsUpdate=0,this.framesThisSecond=0,this.callback=r,this.forceSetTimeOut=n(e,"forceSetTimeOut",!1),this.time=0,this.startTime=0,this.lastTime=0,this.frame=0,this.inFocus=!0,this._pauseTime=0,this._coolDown=0,this.delta=0,this.deltaIndex=0,this.deltaHistory=[],this.deltaSmoothingMax=n(e,"deltaHistory",10),this.panicMax=n(e,"panicMax",120),this.rawDelta=0,this.now=0,this.smoothStep=n(e,"smoothStep",!0)},blur:function(){this.inFocus=!1},focus:function(){this.inFocus=!0,this.resetDelta()},pause:function(){this._pauseTime=window.performance.now()},resume:function(){this.resetDelta(),this.startTime+=this.time-this._pauseTime},resetDelta:function(){var t=window.performance.now();this.time=t,this.lastTime=t,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0;for(var e=0;e0||!this.inFocus)&&(this._coolDown--,t=Math.min(t,this._target)),t>this._min&&(t=i[e],t=Math.min(t,this._min)),i[e]=t,this.deltaIndex++,this.deltaIndex>=s&&(this.deltaIndex=0);for(var n=0,r=0;r=this.nextFpsUpdate&&this.updateFPS(t),this.framesThisSecond++,this.delta>=this._limitRate&&(this.callback(t,this.delta),this.delta=0),this.lastTime=t,this.frame++},step:function(t){this.now=t;var e=Math.max(0,t-this.lastTime);this.rawDelta=e,this.time+=this.rawDelta,this.smoothStep&&(e=this.smoothDelta(e)),this.delta=e,t>=this.nextFpsUpdate&&this.updateFPS(t),this.framesThisSecond++,this.callback(t,e),this.lastTime=t,this.frame++},tick:function(){var t=window.performance.now();this.hasFpsLimit?this.stepLimitFPS(t):this.step(t)},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){void 0===t&&(t=!1);var e=window.performance.now();if(!this.running){t&&(this.startTime+=-this.lastTime+(this.lastTime+e));var i=this.hasFpsLimit?this.stepLimitFPS.bind(this):this.step.bind(this);this.raf.start(i,this.forceSetTimeOut,this._target),this.running=!0,this.nextFpsUpdate=e+1e3,this.framesThisSecond=0,this.fpsLimitTriggered=!1,this.tick()}},getDuration:function(){return Math.round(this.lastTime-this.startTime)/1e3},getDurationMS:function(){return Math.round(this.lastTime-this.startTime)},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.raf.destroy(),this.raf=null,this.game=null,this.callback=null}});t.exports=a},26493:(t,e,i)=>{var s=i(97081);t.exports=function(t){var e,i=t.events;if(void 0!==document.hidden)e="visibilitychange";else{["webkit","moz","ms"].forEach((function(t){void 0!==document[t+"Hidden"]&&(document.hidden=function(){return document[t+"Hidden"]},e=t+"visibilitychange")}))}e&&document.addEventListener(e,(function(t){document.hidden||"pause"===t.type?i.emit(s.HIDDEN):i.emit(s.VISIBLE)}),!1),window.onblur=function(){i.emit(s.BLUR)},window.onfocus=function(){i.emit(s.FOCUS)},window.focus&&t.config.autoFocus&&window.focus()}},41651:t=>{t.exports="blur"},5520:t=>{t.exports="boot"},51673:t=>{t.exports="contextlost"},66336:t=>{t.exports="contextrestored"},25055:t=>{t.exports="destroy"},23767:t=>{t.exports="focus"},57564:t=>{t.exports="hidden"},38327:t=>{t.exports="pause"},43807:t=>{t.exports="postrender"},73652:t=>{t.exports="poststep"},780:t=>{t.exports="prerender"},13781:t=>{t.exports="prestep"},38247:t=>{t.exports="ready"},29129:t=>{t.exports="resume"},34994:t=>{t.exports="step"},98704:t=>{t.exports="visible"},97081:(t,e,i)=>{t.exports={BLUR:i(41651),BOOT:i(5520),CONTEXT_LOST:i(51673),CONTEXT_RESTORED:i(66336),DESTROY:i(25055),FOCUS:i(23767),HIDDEN:i(57564),PAUSE:i(38327),POST_RENDER:i(43807),POST_STEP:i(73652),PRE_RENDER:i(780),PRE_STEP:i(13781),READY:i(38247),RESUME:i(29129),STEP:i(34994),VISIBLE:i(98704)}},80293:(t,e,i)=>{t.exports={Config:i(14033),CreateRenderer:i(50150),DebugHeader:i(77291),Events:i(97081),TimeStep:i(26617),VisibilityHandler:i(26493)}},52780:(t,e,i)=>{var s=i(81543),n=i(61068),r=i(10850);t.exports=function(t){var e=r(t,"data",[]),i=r(t,"canvas",null),o=r(t,"palette",s),a=r(t,"pixelWidth",1),h=r(t,"pixelHeight",a),l=r(t,"resizeCanvas",!0),u=r(t,"clearCanvas",!0),c=r(t,"preRender",null),d=r(t,"postRender",null),p=Math.floor(Math.abs(e[0].length*a)),f=Math.floor(Math.abs(e.length*h));i||(i=n.create2D(this,p,f),l=!1,u=!1),l&&(i.width=p,i.height=f);var v=i.getContext("2d");u&&v.clearRect(0,0,p,f),c&&c(i,v);for(var g=0;g{t.exports={GenerateTexture:i(52780),Palettes:i(25235)}},81543:t=>{t.exports={0:"#000",1:"#9D9D9D",2:"#FFF",3:"#BE2633",4:"#E06F8B",5:"#493C2B",6:"#A46422",7:"#EB8931",8:"#F7E26B",9:"#2F484E",A:"#44891A",B:"#A3CE27",C:"#1B2632",D:"#005784",E:"#31A2F2",F:"#B2DCEF"}},75846:t=>{t.exports={0:"#000",1:"#fff",2:"#8b4131",3:"#7bbdc5",4:"#8b41ac",5:"#6aac41",6:"#3931a4",7:"#d5de73",8:"#945a20",9:"#5a4100",A:"#bd736a",B:"#525252",C:"#838383",D:"#acee8b",E:"#7b73de",F:"#acacac"}},83206:t=>{t.exports={0:"#000",1:"#2234d1",2:"#0c7e45",3:"#44aacc",4:"#8a3622",5:"#5c2e78",6:"#aa5c3d",7:"#b5b5b5",8:"#5e606e",9:"#4c81fb",A:"#6cd947",B:"#7be2f9",C:"#eb8a60",D:"#e23d69",E:"#ffd93f",F:"#fff"}},13194:t=>{t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#f5f4eb"}},50686:t=>{t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#fff"}},25235:(t,e,i)=>{t.exports={ARNE16:i(81543),C64:i(75846),CGA:i(83206),JMP:i(13194),MSX:i(50686)}},63120:(t,e,i)=>{var s=i(56694),n=i(34631),r=i(38517),o=i(93736),a=new s({Extends:r,initialize:function(t,e,i,s){r.call(this,"CubicBezierCurve"),Array.isArray(t)&&(s=new o(t[6],t[7]),i=new o(t[4],t[5]),e=new o(t[2],t[3]),t=new o(t[0],t[1])),this.p0=t,this.p1=e,this.p2=i,this.p3=s},getStartPoint:function(t){return void 0===t&&(t=new o),t.copy(this.p0)},getResolution:function(t){return t},getPoint:function(t,e){void 0===e&&(e=new o);var i=this.p0,s=this.p1,r=this.p2,a=this.p3;return e.set(n(t,i.x,s.x,r.x,a.x),n(t,i.y,s.y,r.y,a.y))},draw:function(t,e){void 0===e&&(e=32);var i=this.getPoints(e);t.beginPath(),t.moveTo(this.p0.x,this.p0.y);for(var s=1;s{var s=i(56694),n=i(80222),r=i(74118),o=i(93736),a=new s({initialize:function(t){this.type=t,this.defaultDivisions=5,this.arcLengthDivisions=100,this.cacheArcLengths=[],this.needsUpdate=!0,this.active=!0,this._tmpVec2A=new o,this._tmpVec2B=new o},draw:function(t,e){return void 0===e&&(e=32),t.strokePoints(this.getPoints(e))},getBounds:function(t,e){t||(t=new r),void 0===e&&(e=16);var i=this.getLength();e>i&&(e=i/2);var s=Math.max(1,Math.round(i/e));return n(this.getSpacedPoints(s),t)},getDistancePoints:function(t){var e=this.getLength(),i=Math.max(1,e/t);return this.getSpacedPoints(i)},getEndPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(1,t)},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],s=this.getPoint(0,this._tmpVec2A),n=0;i.push(0);for(var r=1;r<=t;r++)n+=(e=this.getPoint(r/t,this._tmpVec2B)).distance(s),i.push(n),s.copy(e);return this.cacheArcLengths=i,i},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var s=0;s<=t;s++)i.push(this.getPoint(s/t));return i},getRandomPoint:function(t){return void 0===t&&(t=new o),this.getPoint(Math.random(),t)},getSpacedPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var s=0;s<=t;s++){var n=this.getUtoTmapping(s/t,null,t);i.push(this.getPoint(n))}return i},getStartPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(0,t)},getTangent:function(t,e){void 0===e&&(e=new o);var i=1e-4,s=t-i,n=t+i;return s<0&&(s=0),n>1&&(n=1),this.getPoint(s,this._tmpVec2A),this.getPoint(n,e),e.subtract(this._tmpVec2A).normalize()},getTangentAt:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)},getTFromDistance:function(t,e){return t<=0?0:this.getUtoTmapping(0,t,e)},getUtoTmapping:function(t,e,i){var s,n=this.getLengths(i),r=0,o=n.length;s=e?Math.min(e,n[o-1]):t*n[o-1];for(var a,h=0,l=o-1;h<=l;)if((a=n[r=Math.floor(h+(l-h)/2)]-s)<0)h=r+1;else{if(!(a>0)){l=r;break}l=r-1}if(n[r=l]===s)return r/(o-1);var u=n[r];return(r+(s-u)/(n[r+1]-u))/(o-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});t.exports=a},48835:(t,e,i)=>{var s=i(56694),n=i(38517),r=i(75606),o=i(10850),a=i(23701),h=i(93736),l=new s({Extends:n,initialize:function(t,e,i,s,a,l,u,c){if("object"==typeof t){var d=t;t=o(d,"x",0),e=o(d,"y",0),i=o(d,"xRadius",0),s=o(d,"yRadius",i),a=o(d,"startAngle",0),l=o(d,"endAngle",360),u=o(d,"clockwise",!1),c=o(d,"rotation",0)}else void 0===s&&(s=i),void 0===a&&(a=0),void 0===l&&(l=360),void 0===u&&(u=!1),void 0===c&&(c=0);n.call(this,"EllipseCurve"),this.p0=new h(t,e),this._xRadius=i,this._yRadius=s,this._startAngle=r(a),this._endAngle=r(l),this._clockwise=u,this._rotation=r(c)},getStartPoint:function(t){return void 0===t&&(t=new h),this.getPoint(0,t)},getResolution:function(t){return 2*t},getPoint:function(t,e){void 0===e&&(e=new h);for(var i=2*Math.PI,s=this._endAngle-this._startAngle,n=Math.abs(s)i;)s-=i;s{var s=i(56694),n=i(38517),r=i(80222),o=i(74118),a=i(93736),h=new s({Extends:n,initialize:function(t,e){n.call(this,"LineCurve"),Array.isArray(t)&&(e=new a(t[2],t[3]),t=new a(t[0],t[1])),this.p0=t,this.p1=e,this.arcLengthDivisions=1},getBounds:function(t){return void 0===t&&(t=new o),r([this.p0,this.p1],t)},getStartPoint:function(t){return void 0===t&&(t=new a),t.copy(this.p0)},getResolution:function(t){return void 0===t&&(t=1),t},getPoint:function(t,e){return void 0===e&&(e=new a),1===t?e.copy(this.p1):(e.copy(this.p1).subtract(this.p0).scale(t).add(this.p0),e)},getPointAt:function(t,e){return this.getPoint(t,e)},getTangent:function(t,e){return void 0===e&&(e=new a),e.copy(this.p1).subtract(this.p0).normalize(),e},getUtoTmapping:function(t,e,i){var s;if(e){var n=this.getLengths(i),r=n[n.length-1];s=Math.min(e,r)/r}else s=t;return s},draw:function(t){return t.lineBetween(this.p0.x,this.p0.y,this.p1.x,this.p1.y),t},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y]}}});h.fromJSON=function(t){var e=t.points,i=new a(e[0],e[1]),s=new a(e[2],e[3]);return new h(i,s)},t.exports=h},64761:(t,e,i)=>{var s=i(56694),n=i(38517),r=i(16252),o=i(93736),a=new s({Extends:n,initialize:function(t,e,i){n.call(this,"QuadraticBezierCurve"),Array.isArray(t)&&(i=new o(t[4],t[5]),e=new o(t[2],t[3]),t=new o(t[0],t[1])),this.p0=t,this.p1=e,this.p2=i},getStartPoint:function(t){return void 0===t&&(t=new o),t.copy(this.p0)},getResolution:function(t){return t},getPoint:function(t,e){void 0===e&&(e=new o);var i=this.p0,s=this.p1,n=this.p2;return e.set(r(t,i.x,s.x,n.x),r(t,i.y,s.y,n.y))},draw:function(t,e){void 0===e&&(e=32);var i=this.getPoints(e);t.beginPath(),t.moveTo(this.p0.x,this.p0.y);for(var s=1;s{var s=i(14976),n=i(56694),r=i(38517),o=i(93736),a=new n({Extends:r,initialize:function(t){void 0===t&&(t=[]),r.call(this,"SplineCurve"),this.points=[],this.addPoints(t)},addPoints:function(t){for(var e=0;ei.length-2?i.length-1:r+1],c=i[r>i.length-3?i.length-1:r+2];return e.set(s(a,h.x,l.x,u.x,c.x),s(a,h.y,l.y,u.y,c.y))},toJSON:function(){for(var t=[],e=0;e{t.exports={Path:i(12822),MoveTo:i(53639),CubicBezier:i(63120),Curve:i(38517),Ellipse:i(48835),Line:i(58084),QuadraticBezier:i(64761),Spline:i(11956)}},53639:(t,e,i)=>{var s=i(56694),n=i(93736),r=new s({initialize:function(t,e){this.active=!1,this.p0=new n(t,e)},getPoint:function(t,e){return void 0===e&&(e=new n),e.copy(this.p0)},getPointAt:function(t,e){return this.getPoint(t,e)},getResolution:function(){return 1},getLength:function(){return 0},toJSON:function(){return{type:"MoveTo",points:[this.p0.x,this.p0.y]}}});t.exports=r},12822:(t,e,i)=>{var s=i(56694),n=i(63120),r=i(48835),o=i(61286),a=i(58084),h=i(53639),l=i(64761),u=i(74118),c=i(11956),d=i(93736),p=i(83392),f=new s({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.name="",this.curves=[],this.cacheLengths=[],this.autoClose=!1,this.startPoint=new d,this._tmpVec2A=new d,this._tmpVec2B=new d,"object"==typeof t?this.fromJSON(t):this.startPoint.set(t,e)},add:function(t){return this.curves.push(t),this},circleTo:function(t,e,i){return void 0===e&&(e=!1),this.ellipseTo(t,t,0,360,e,i)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);return t.equals(e)||this.curves.push(new a(e,t)),this},cubicBezierTo:function(t,e,i,s,r,o){var a,h,l,u=this.getEndPoint();return t instanceof d?(a=t,h=e,l=i):(a=new d(i,s),h=new d(r,o),l=new d(t,e)),this.add(new n(u,a,h,l))},quadraticBezierTo:function(t,e,i,s){var n,r,o=this.getEndPoint();return t instanceof d?(n=t,r=e):(n=new d(i,s),r=new d(t,e)),this.add(new l(o,n,r))},draw:function(t,e){for(var i=0;i=e)return this.curves[s];s++}return null},getEndPoint:function(t){return void 0===t&&(t=new d),this.curves.length>0?this.curves[this.curves.length-1].getPoint(1,t):t.copy(this.startPoint),t},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},getPoint:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),s=this.getCurveLengths(),n=0;n=i){var r=s[n]-i,o=this.curves[n],a=o.getLength(),h=0===a?0:1-r/a;return o.getPointAt(h,e)}n++}return null},getPoints:function(t){void 0===t&&(t=12);for(var e,i=[],s=0;s1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i},getRandomPoint:function(t){return void 0===t&&(t=new d),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getStartPoint:function(t){return void 0===t&&(t=new d),t.copy(this.startPoint)},getTangent:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),s=this.getCurveLengths(),n=0;n=i){var r=s[n]-i,o=this.curves[n],a=o.getLength(),h=0===a?0:1-r/a;return o.getTangentAt(h,e)}n++}return null},lineTo:function(t,e){t instanceof d?this._tmpVec2B.copy(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new a([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new c(t))},moveTo:function(t,e){return t instanceof d?this.add(new h(t.x,t.y)):this.add(new h(t,e))},toJSON:function(){for(var t=[],e=0;e{var s=i(56694),n=i(35026),r=new s({initialize:function(t,e){this.parent=t,this.events=e,e||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once(n.DESTROY,this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],s=0;s{var s=i(56694),n=i(81078),r=i(91963),o=i(7599),a=new s({Extends:n,initialize:function(t){n.call(this,t,t.sys.events),this.scene=t,this.systems=t.sys,t.sys.events.once(o.BOOT,this.boot,this),t.sys.events.on(o.START,this.start,this)},boot:function(){this.events=this.systems.events,this.events.once(o.DESTROY,this.destroy,this)},start:function(){this.events.once(o.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.systems.events.off(o.SHUTDOWN,this.shutdown,this)},destroy:function(){n.prototype.destroy.call(this),this.events.off(o.START,this.start,this),this.scene=null,this.systems=null}});r.register("DataManagerPlugin",a,"data"),t.exports=a},73569:t=>{t.exports="changedata"},15590:t=>{t.exports="changedata-"},37669:t=>{t.exports="destroy"},87090:t=>{t.exports="removedata"},90142:t=>{t.exports="setdata"},35026:(t,e,i)=>{t.exports={CHANGE_DATA:i(73569),CHANGE_DATA_KEY:i(15590),DESTROY:i(37669),REMOVE_DATA:i(87090),SET_DATA:i(90142)}},1999:(t,e,i)=>{t.exports={DataManager:i(81078),DataManagerPlugin:i(76508),Events:i(35026)}},10720:(t,e,i)=>{var s=i(1350),n={flac:!1,aac:!1,audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return n;n.audioData=!!window.Audio,n.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio"),e=!!t.canPlayType;try{if(e){var i=function(e,i){var s=t.canPlayType("audio/"+e).replace(/^no$/,"");return i?Boolean(s||t.canPlayType("audio/"+i).replace(/^no$/,"")):Boolean(s)};if(n.ogg=i('ogg; codecs="vorbis"'),n.opus=i('ogg; codecs="opus"',"opus"),n.mp3=i("mpeg"),n.wav=i("wav"),n.m4a=i("x-m4a"),n.aac=i("aac"),n.flac=i("flac","x-flac"),n.webm=i('webm; codecs="vorbis"'),""!==t.canPlayType('audio/mp4; codecs="ec-3"'))if(s.edge)n.dolby=!0;else if(s.safari&&s.safariVersion>=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var r=parseInt(RegExp.$1,10),o=parseInt(RegExp.$2,10);(10===r&&o>=11||r>10)&&(n.dolby=!0)}}}catch(t){}return n}()},1350:(t,e,i)=>{var s,n=i(36580),r={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0};t.exports=(s=navigator.userAgent,/Edge\/\d+/.test(s)?r.edge=!0:/Chrome\/(\d+)/.test(s)&&!n.windowsPhone?(r.chrome=!0,r.chromeVersion=parseInt(RegExp.$1,10)):/Firefox\D+(\d+)/.test(s)?(r.firefox=!0,r.firefoxVersion=parseInt(RegExp.$1,10)):/AppleWebKit/.test(s)&&n.iOS?r.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(s)?(r.ie=!0,r.ieVersion=parseInt(RegExp.$1,10)):/Opera/.test(s)?r.opera=!0:/Safari/.test(s)&&!n.windowsPhone?r.safari=!0:/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(s)&&(r.ie=!0,r.trident=!0,r.tridentVersion=parseInt(RegExp.$1,10),r.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(s)&&(r.silk=!0),r)},98581:(t,e,i)=>{var s,n,r,o=i(61068),a={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=("function"!=typeof importScripts&&void 0!==document&&(a.supportNewBlendModes=(s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",n="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(r=new Image).onload=function(){var t=new Image;t.onload=function(){var e=o.create2D(t,6).getContext("2d",{willReadFrequently:!0});if(e.globalCompositeOperation="multiply",e.drawImage(r,0,0),e.drawImage(t,2,0),!e.getImageData(2,0,1,1))return!1;var i=e.getImageData(2,0,1,1).data;o.remove(t),a.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=s+"/wCKxvRF"+n},r.src=s+"AP804Oa6"+n,!1),a.supportInverseAlpha=function(){var t=o.create2D(this,2).getContext("2d",{willReadFrequently:!0});t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1),s=i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3];return o.remove(this),s}()),a)},90185:(t,e,i)=>{var s=i(36580),n=i(1350),r=i(61068),o={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){if("function"==typeof importScripts)return o;o.canvas=!!window.CanvasRenderingContext2D;try{o.localStorage=!!localStorage.getItem}catch(t){o.localStorage=!1}o.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),o.fileSystem=!!window.requestFileSystem;var t,e,i,a=!1;return o.webGL=function(){if(window.WebGLRenderingContext)try{var t=r.createWebGL(this),e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=r.create2D(this),s=i.getContext("2d").createImageData(1,1);return a=s.data instanceof Uint8ClampedArray,r.remove(t),r.remove(i),!!e}catch(t){return!1}return!1}(),o.worker=!!window.Worker,o.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,o.getUserMedia=o.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,n.firefox&&n.firefoxVersion<21&&(o.getUserMedia=!1),!s.iOS&&(n.ie||n.firefox||n.chrome)&&(o.canvasBitBltShift=!0),(n.safari||n.mobileSafari)&&(o.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(o.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(o.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),o.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==o.littleEndian&&a,o}()},33553:t=>{var e={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){if("function"==typeof importScripts)return e;var t,i="Fullscreen",s="FullScreen",n=["request"+i,"request"+s,"webkitRequest"+i,"webkitRequest"+s,"msRequest"+i,"msRequest"+s,"mozRequest"+s,"mozRequest"+i];for(t=0;t{var s=i(1350),n={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=("function"==typeof importScripts||(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(n.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(n.mspointer=!0),navigator.getGamepads&&(n.gamepads=!0),"onwheel"in window||s.ie&&"WheelEvent"in window?n.wheelEvent="wheel":"onmousewheel"in window?n.wheelEvent="mousewheel":s.firefox&&"MouseScrollEvent"in window&&(n.wheelEvent="DOMMouseScroll")),n)},36580:t=>{var e={android:!1,chromeOS:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};t.exports=function(){if("function"==typeof importScripts)return e;var t=navigator.userAgent;/Windows/.test(t)?e.windows=!0:/Mac OS/.test(t)&&!/like Mac OS/.test(t)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(e.iOS=!0,e.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),e.iOSVersion=parseInt(RegExp.$1,10)):e.macOS=!0:/Android/.test(t)?e.android=!0:/Linux/.test(t)?e.linux=!0:/iP[ao]d|iPhone/i.test(t)?(e.iOS=!0,navigator.appVersion.match(/OS (\d+)/),e.iOSVersion=parseInt(RegExp.$1,10),e.iPhone=-1!==t.toLowerCase().indexOf("iphone"),e.iPad=-1!==t.toLowerCase().indexOf("ipad")):/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?e.kindle=!0:/CrOS/.test(t)&&(e.chromeOS=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(e.android=!1,e.iOS=!1,e.macOS=!1,e.windows=!0,e.windowsPhone=!0);var i=/Silk/.test(t);return(e.windows||e.macOS||e.linux&&!i||e.chromeOS)&&(e.desktop=!0),(e.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(e.desktop=!1),navigator.standalone&&(e.webApp=!0),"function"!=typeof importScripts&&(void 0!==window.cordova&&(e.cordova=!0),void 0!==window.ejecta&&(e.ejecta=!0)),"undefined"!=typeof process&&process.versions&&process.versions.node&&(e.node=!0),e.node&&"object"==typeof process.versions&&(e.nodeWebkit=!!process.versions["node-webkit"],e.electron=!!process.versions.electron),/Crosswalk/.test(t)&&(e.crosswalk=!0),e.pixelRatio=window.devicePixelRatio||1,e}()},53861:t=>{var e={h264:!1,hls:!1,mp4:!1,m4v:!1,ogg:!1,vp9:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return e;var t=document.createElement("video"),i=!!t.canPlayType,s=/^no$/;try{i&&(t.canPlayType('video/ogg; codecs="theora"').replace(s,"")&&(e.ogg=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(s,"")&&(e.h264=!0,e.mp4=!0),t.canPlayType("video/x-m4v").replace(s,"")&&(e.m4v=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(s,"")&&(e.webm=!0),t.canPlayType('video/webm; codecs="vp9"').replace(s,"")&&(e.vp9=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(s,"")&&(e.hls=!0))}catch(t){}return e}()},77290:(t,e,i)=>{t.exports={os:i(36580),browser:i(1350),features:i(90185),input:i(95872),audio:i(10720),video:i(53861),fullscreen:i(33553),canvasFeatures:i(98581)}},65246:(t,e,i)=>{var s=new(i(56694))({initialize:function(){this._matrix=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],this.alpha=1,this._dirty=!0,this._data},set:function(t){return this._matrix=t,this._dirty=!0,this},reset:function(){var t=this._matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=1,t[13]=0,t[14]=0,t[15]=0,t[16]=0,t[17]=0,t[18]=1,t[19]=0,this._dirty=!0,this},getData:function(){if(this._dirty){var t=new Float32Array(this._matrix);t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,this._data=t,this._dirty=!1}return this._data},brightness:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t;return this.multiply([i,0,0,0,0,0,i,0,0,0,0,0,i,0,0,0,0,0,1,0],e)},saturate:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=2*t/3+1,s=-.5*(i-1);return this.multiply([i,s,s,0,0,s,i,s,0,0,s,s,i,0,0,0,0,0,1,0],e)},desaturate:function(t){return void 0===t&&(t=!1),this.saturate(-1,t)},hue:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1),t=t/180*Math.PI;var i=Math.cos(t),s=Math.sin(t),n=.213,r=.715,o=.072;return this.multiply([n+.787*i+s*-n,r+i*-r+s*-r,o+i*-o+.928*s,0,0,n+i*-n+.143*s,r+i*(1-r)+.14*s,o+i*-o+-.283*s,0,0,n+i*-n+-.787*s,r+i*-r+s*r,o+.928*i+s*o,0,0,0,0,0,1,0],e)},grayscale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=!1),this.saturate(-t,e)},blackWhite:function(t){return void 0===t&&(t=!1),this.multiply([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},contrast:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t+1,s=-.5*(i-1);return this.multiply([i,0,0,0,s,0,i,0,0,s,0,0,i,0,s,0,0,0,1,0],e)},negative:function(t){return void 0===t&&(t=!1),this.multiply([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},desaturateLuminance:function(t){return void 0===t&&(t=!1),this.multiply([.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0],t)},sepia:function(t){return void 0===t&&(t=!1),this.multiply([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},night:function(t,e){return void 0===t&&(t=.1),void 0===e&&(e=!1),this.multiply([-2*t,-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0],e)},lsd:function(t){return void 0===t&&(t=!1),this.multiply([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},brown:function(t){return void 0===t&&(t=!1),this.multiply([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},vintagePinhole:function(t){return void 0===t&&(t=!1),this.multiply([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},kodachrome:function(t){return void 0===t&&(t=!1),this.multiply([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],t)},technicolor:function(t){return void 0===t&&(t=!1),this.multiply([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],t)},polaroid:function(t){return void 0===t&&(t=!1),this.multiply([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},shiftToBGR:function(t){return void 0===t&&(t=!1),this.multiply([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},multiply:function(t,e){e||this.reset();for(var i=this._matrix,s=[],n=0;n<20;n++)s[n]=i[n];return i[0]=s[0]*t[0]+s[1]*t[5]+s[2]*t[10]+s[3]*t[15],i[1]=s[0]*t[1]+s[1]*t[6]+s[2]*t[11]+s[3]*t[16],i[2]=s[0]*t[2]+s[1]*t[7]+s[2]*t[12]+s[3]*t[17],i[3]=s[0]*t[3]+s[1]*t[8]+s[2]*t[13]+s[3]*t[18],i[4]=s[0]*t[4]+s[1]*t[9]+s[2]*t[14]+s[3]*t[19]+s[4],i[5]=s[5]*t[0]+s[6]*t[5]+s[7]*t[10]+s[8]*t[15],i[6]=s[5]*t[1]+s[6]*t[6]+s[7]*t[11]+s[8]*t[16],i[7]=s[5]*t[2]+s[6]*t[7]+s[7]*t[12]+s[8]*t[17],i[8]=s[5]*t[3]+s[6]*t[8]+s[7]*t[13]+s[8]*t[18],i[9]=s[5]*t[4]+s[6]*t[9]+s[7]*t[14]+s[8]*t[19]+s[9],i[10]=s[10]*t[0]+s[11]*t[5]+s[12]*t[10]+s[13]*t[15],i[11]=s[10]*t[1]+s[11]*t[6]+s[12]*t[11]+s[13]*t[16],i[12]=s[10]*t[2]+s[11]*t[7]+s[12]*t[12]+s[13]*t[17],i[13]=s[10]*t[3]+s[11]*t[8]+s[12]*t[13]+s[13]*t[18],i[14]=s[10]*t[4]+s[11]*t[9]+s[12]*t[14]+s[13]*t[19]+s[14],i[15]=s[15]*t[0]+s[16]*t[5]+s[17]*t[10]+s[18]*t[15],i[16]=s[15]*t[1]+s[16]*t[6]+s[17]*t[11]+s[18]*t[16],i[17]=s[15]*t[2]+s[16]*t[7]+s[17]*t[12]+s[18]*t[17],i[18]=s[15]*t[3]+s[16]*t[8]+s[17]*t[13]+s[18]*t[18],i[19]=s[15]*t[4]+s[16]*t[9]+s[17]*t[14]+s[18]*t[19]+s[19],this._dirty=!0,this}});t.exports=s},39298:(t,e,i)=>{var s=i(56694),n=i(72283),r=new s({initialize:function(t,e,i){this._rgb=[0,0,0],this.onChangeCallback=n,this.dirty=!1,this.set(t,e,i)},set:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this._rgb=[t,e,i],this.onChange(),this},equals:function(t,e,i){var s=this._rgb;return s[0]===t&&s[1]===e&&s[2]===i},onChange:function(){this.dirty=!0;var t=this._rgb;this.onChangeCallback.call(this,t[0],t[1],t[2])},r:{get:function(){return this._rgb[0]},set:function(t){this._rgb[0]=t,this.onChange()}},g:{get:function(){return this._rgb[1]},set:function(t){this._rgb[1]=t,this.onChange()}},b:{get:function(){return this._rgb[2]},set:function(t){this._rgb[2]=t,this.onChange()}},destroy:function(){this.onChangeCallback=null}});t.exports=r},84093:t=>{t.exports={TOP_LEFT:0,TOP_CENTER:1,TOP_RIGHT:2,LEFT_TOP:3,LEFT_CENTER:4,LEFT_BOTTOM:5,CENTER:6,RIGHT_TOP:7,RIGHT_CENTER:8,RIGHT_BOTTOM:9,BOTTOM_LEFT:10,BOTTOM_CENTER:11,BOTTOM_RIGHT:12}},32058:(t,e,i)=>{var s=i(97328),n=i(59994),r=i(73174),o=i(28417);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)+a),t}},85535:(t,e,i)=>{var s=i(97328),n=i(40163),r=i(73174),o=i(74465);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)-i),r(t,s(e)+a),t}},9605:(t,e,i)=>{var s=i(97328),n=i(70271),r=i(73174),o=i(19298);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)+a),t}},22529:(t,e,i)=>{var s=i(21843),n=i(59994),r=i(29568);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),s(t,n(e)+i,r(e)+o),t}},5739:(t,e,i)=>{var s=i(29568),n=i(40163),r=i(81711),o=i(74465);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)-i),r(t,s(e)+a),t}},40327:(t,e,i)=>{var s=i(84093),n=[];n[s.BOTTOM_CENTER]=i(32058),n[s.BOTTOM_LEFT]=i(85535),n[s.BOTTOM_RIGHT]=i(9605),n[s.CENTER]=i(22529),n[s.LEFT_CENTER]=i(5739),n[s.RIGHT_CENTER]=i(27683),n[s.TOP_CENTER]=i(96439),n[s.TOP_LEFT]=i(81447),n[s.TOP_RIGHT]=i(47888),n[s.LEFT_BOTTOM]=n[s.BOTTOM_LEFT],n[s.LEFT_TOP]=n[s.TOP_LEFT],n[s.RIGHT_BOTTOM]=n[s.BOTTOM_RIGHT],n[s.RIGHT_TOP]=n[s.TOP_RIGHT];t.exports=function(t,e,i,s,r){return n[i](t,e,s,r)}},27683:(t,e,i)=>{var s=i(29568),n=i(70271),r=i(81711),o=i(19298);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)+a),t}},96439:(t,e,i)=>{var s=i(59994),n=i(47196),r=i(28417),o=i(84349);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)+i),o(t,n(e)-a),t}},81447:(t,e,i)=>{var s=i(40163),n=i(47196),r=i(74465),o=i(84349);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)-i),o(t,n(e)-a),t}},47888:(t,e,i)=>{var s=i(70271),n=i(47196),r=i(19298),o=i(84349);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)+i),o(t,n(e)-a),t}},46997:(t,e,i)=>{t.exports={BottomCenter:i(32058),BottomLeft:i(85535),BottomRight:i(9605),Center:i(22529),LeftCenter:i(5739),QuickSet:i(40327),RightCenter:i(27683),TopCenter:i(96439),TopLeft:i(81447),TopRight:i(47888)}},93545:(t,e,i)=>{var s=i(84093),n=i(98611),r={In:i(46997),To:i(86639)};r=n(!1,r,s),t.exports=r},27118:(t,e,i)=>{var s=i(97328),n=i(59994),r=i(28417),o=i(84349);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)+a),t}},84469:(t,e,i)=>{var s=i(97328),n=i(40163),r=i(74465),o=i(84349);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)-i),o(t,s(e)+a),t}},51577:(t,e,i)=>{var s=i(97328),n=i(70271),r=i(19298),o=i(84349);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)+a),t}},90271:(t,e,i)=>{var s=i(97328),n=i(40163),r=i(73174),o=i(19298);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)-i),r(t,s(e)+a),t}},30466:(t,e,i)=>{var s=i(29568),n=i(40163),r=i(81711),o=i(19298);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)-i),r(t,s(e)+a),t}},50087:(t,e,i)=>{var s=i(40163),n=i(47196),r=i(19298),o=i(84349);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)-i),o(t,n(e)-a),t}},82590:(t,e,i)=>{var s=i(84093),n=[];n[s.BOTTOM_CENTER]=i(27118),n[s.BOTTOM_LEFT]=i(84469),n[s.BOTTOM_RIGHT]=i(51577),n[s.LEFT_BOTTOM]=i(90271),n[s.LEFT_CENTER]=i(30466),n[s.LEFT_TOP]=i(50087),n[s.RIGHT_BOTTOM]=i(13555),n[s.RIGHT_CENTER]=i(99049),n[s.RIGHT_TOP]=i(67788),n[s.TOP_CENTER]=i(78170),n[s.TOP_LEFT]=i(54145),n[s.TOP_RIGHT]=i(75548);t.exports=function(t,e,i,s,r){return n[i](t,e,s,r)}},13555:(t,e,i)=>{var s=i(97328),n=i(70271),r=i(73174),o=i(74465);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)+a),t}},99049:(t,e,i)=>{var s=i(29568),n=i(70271),r=i(81711),o=i(74465);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)+a),t}},67788:(t,e,i)=>{var s=i(70271),n=i(47196),r=i(74465),o=i(84349);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)+i),o(t,n(e)-a),t}},78170:(t,e,i)=>{var s=i(59994),n=i(47196),r=i(73174),o=i(28417);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)-a),t}},54145:(t,e,i)=>{var s=i(40163),n=i(47196),r=i(73174),o=i(74465);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)-a),t}},75548:(t,e,i)=>{var s=i(70271),n=i(47196),r=i(73174),o=i(19298);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)-a),t}},86639:(t,e,i)=>{t.exports={BottomCenter:i(27118),BottomLeft:i(84469),BottomRight:i(51577),LeftBottom:i(90271),LeftCenter:i(30466),LeftTop:i(50087),QuickSet:i(82590),RightBottom:i(13555),RightCenter:i(99049),RightTop:i(67788),TopCenter:i(78170),TopLeft:i(54145),TopRight:i(75548)}},21843:(t,e,i)=>{var s=i(28417),n=i(81711);t.exports=function(t,e,i){return s(t,e),n(t,i)}},97328:t=>{t.exports=function(t){return t.y+t.height-t.height*t.originY}},7126:(t,e,i)=>{var s=i(97328),n=i(40163),r=i(70271),o=i(47196);t.exports=function(t,e){void 0===e&&(e={});var i=n(t),a=o(t);return e.x=i,e.y=a,e.width=r(t)-i,e.height=s(t)-a,e}},59994:t=>{t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},29568:t=>{t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},40163:t=>{t.exports=function(t){return t.x-t.width*t.originX}},52088:t=>{t.exports=function(t){return t.width*t.originX}},23379:t=>{t.exports=function(t){return t.height*t.originY}},70271:t=>{t.exports=function(t){return t.x+t.width-t.width*t.originX}},47196:t=>{t.exports=function(t){return t.y-t.height*t.originY}},73174:t=>{t.exports=function(t,e){return t.y=e-t.height+t.height*t.originY,t}},28417:t=>{t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},81711:t=>{t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},74465:t=>{t.exports=function(t,e){return t.x=e+t.width*t.originX,t}},19298:t=>{t.exports=function(t,e){return t.x=e-t.width+t.width*t.originX,t}},84349:t=>{t.exports=function(t,e){return t.y=e+t.height*t.originY,t}},15252:(t,e,i)=>{t.exports={CenterOn:i(21843),GetBottom:i(97328),GetBounds:i(7126),GetCenterX:i(59994),GetCenterY:i(29568),GetLeft:i(40163),GetOffsetX:i(52088),GetOffsetY:i(23379),GetRight:i(70271),GetTop:i(47196),SetBottom:i(73174),SetCenterX:i(28417),SetCenterY:i(81711),SetLeft:i(74465),SetRight:i(19298),SetTop:i(84349)}},70616:t=>{t.exports={setCrisp:function(t){return["optimizeSpeed","-moz-crisp-edges","-o-crisp-edges","-webkit-optimize-contrast","optimize-contrast","crisp-edges","pixelated"].forEach((function(e){t.style["image-rendering"]=e})),t.style.msInterpolationMode="nearest-neighbor",t},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},61068:(t,e,i)=>{var s,n,r,o=i(86459),a=i(8213),h=[],l=!1;t.exports=(r=function(){var t=0;return h.forEach((function(e){e.parent&&t++})),t},{create2D:function(t,e,i){return s(t,e,i,o.CANVAS)},create:s=function(t,e,i,s,r){var u;void 0===e&&(e=1),void 0===i&&(i=1),void 0===s&&(s=o.CANVAS),void 0===r&&(r=!1);var c=n(s);return null===c?(c={parent:t,canvas:document.createElement("canvas"),type:s},s===o.CANVAS&&h.push(c),u=c.canvas):(c.parent=t,u=c.canvas),r&&(c.parent=u),u.width=e,u.height=i,l&&s===o.CANVAS&&a.disable(u.getContext("2d")),u},createWebGL:function(t,e,i){return s(t,e,i,o.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:n=function(t){if(void 0===t&&(t=o.CANVAS),t===o.WEBGL)return null;for(var e=0;e{var e,i="";t.exports={disable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!1),t},enable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!0),t},getPrefix:e=function(t){for(var e=["i","webkitI","msI","mozI","oI"],i=0;i{t.exports=function(t,e){return void 0===e&&(e="none"),t.style.msTouchAction=e,t.style["ms-touch-action"]=e,t.style["touch-action"]=e,t}},36505:t=>{t.exports=function(t,e){void 0===e&&(e="none");return["-webkit-","-khtml-","-moz-","-ms-",""].forEach((function(i){t.style[i+"user-select"]=e})),t.style["-webkit-touch-callout"]=e,t.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",t}},23514:(t,e,i)=>{t.exports={CanvasInterpolation:i(70616),CanvasPool:i(61068),Smoothing:i(8213),TouchAction:i(59271),UserSelect:i(36505)}},27119:(t,e,i)=>{var s=i(56694),n=i(22946),r=i(5657),o=i(24650),a=i(68033),h=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=255),this.r=0,this.g=0,this.b=0,this.a=255,this._h=0,this._s=0,this._v=0,this._locked=!1,this.gl=[0,0,0,1],this._color=0,this._color32=0,this._rgba="",this.setTo(t,e,i,s)},transparent:function(){return this._locked=!0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this._locked=!1,this.update(!0)},setTo:function(t,e,i,s,n){return void 0===s&&(s=255),void 0===n&&(n=!0),this._locked=!0,this.red=t,this.green=e,this.blue=i,this.alpha=s,this._locked=!1,this.update(n)},setGLTo:function(t,e,i,s){return void 0===s&&(s=1),this._locked=!0,this.redGL=t,this.greenGL=e,this.blueGL=i,this.alphaGL=s,this._locked=!1,this.update(!0)},setFromRGB:function(t){return this._locked=!0,this.red=t.r,this.green=t.g,this.blue=t.b,t.hasOwnProperty("a")&&(this.alpha=t.a),this._locked=!1,this.update(!0)},setFromHSV:function(t,e,i){return o(t,e,i,this)},update:function(t){if(void 0===t&&(t=!1),this._locked)return this;var e=this.r,i=this.g,s=this.b,o=this.a;return this._color=n(e,i,s),this._color32=r(e,i,s,o),this._rgba="rgba("+e+","+i+","+s+","+o/255+")",t&&a(e,i,s,this),this},updateHSV:function(){var t=this.r,e=this.g,i=this.b;return a(t,e,i,this),this},clone:function(){return new h(this.r,this.g,this.b,this.a)},gray:function(t){return this.setTo(t,t,t)},random:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t)),s=Math.floor(t+Math.random()*(e-t)),n=Math.floor(t+Math.random()*(e-t));return this.setTo(i,s,n)},randomGray:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t));return this.setTo(i,i,i)},saturate:function(t){return this.s+=t/100,this},desaturate:function(t){return this.s-=t/100,this},lighten:function(t){return this.v+=t/100,this},darken:function(t){return this.v-=t/100,this},brighten:function(t){var e=this.r,i=this.g,s=this.b;return e=Math.max(0,Math.min(255,e-Math.round(-t/100*255))),i=Math.max(0,Math.min(255,i-Math.round(-t/100*255))),s=Math.max(0,Math.min(255,s-Math.round(-t/100*255))),this.setTo(e,i,s)},color:{get:function(){return this._color}},color32:{get:function(){return this._color32}},rgba:{get:function(){return this._rgba}},redGL:{get:function(){return this.gl[0]},set:function(t){this.gl[0]=Math.min(Math.abs(t),1),this.r=Math.floor(255*this.gl[0]),this.update(!0)}},greenGL:{get:function(){return this.gl[1]},set:function(t){this.gl[1]=Math.min(Math.abs(t),1),this.g=Math.floor(255*this.gl[1]),this.update(!0)}},blueGL:{get:function(){return this.gl[2]},set:function(t){this.gl[2]=Math.min(Math.abs(t),1),this.b=Math.floor(255*this.gl[2]),this.update(!0)}},alphaGL:{get:function(){return this.gl[3]},set:function(t){this.gl[3]=Math.min(Math.abs(t),1),this.a=Math.floor(255*this.gl[3]),this.update()}},red:{get:function(){return this.r},set:function(t){t=Math.floor(Math.abs(t)),this.r=Math.min(t,255),this.gl[0]=t/255,this.update(!0)}},green:{get:function(){return this.g},set:function(t){t=Math.floor(Math.abs(t)),this.g=Math.min(t,255),this.gl[1]=t/255,this.update(!0)}},blue:{get:function(){return this.b},set:function(t){t=Math.floor(Math.abs(t)),this.b=Math.min(t,255),this.gl[2]=t/255,this.update(!0)}},alpha:{get:function(){return this.a},set:function(t){t=Math.floor(Math.abs(t)),this.a=Math.min(t,255),this.gl[3]=t/255,this.update()}},h:{get:function(){return this._h},set:function(t){this._h=t,o(t,this._s,this._v,this)}},s:{get:function(){return this._s},set:function(t){this._s=t,o(this._h,t,this._v,this)}},v:{get:function(){return this._v},set:function(t){this._v=t,o(this._h,this._s,t,this)}}});t.exports=h},30245:(t,e,i)=>{var s=i(22946);t.exports=function(t){void 0===t&&(t=1024);var e,i=[],n=255,r=255,o=0,a=0;for(e=0;e<=n;e++)i.push({r:r,g:e,b:a,color:s(r,e,a)});for(o=255,e=n;e>=0;e--)i.push({r:e,g:o,b:a,color:s(e,o,a)});for(r=0,e=0;e<=n;e++,o--)i.push({r:r,g:o,b:e,color:s(r,o,e)});for(o=0,a=255,e=0;e<=n;e++,a--,r++)i.push({r:r,g:o,b:a,color:s(r,o,a)});if(1024===t)return i;var h=[],l=0,u=1024/t;for(e=0;e{t.exports=function(t){var e={r:t>>16&255,g:t>>8&255,b:255&t,a:255};return t>16777215&&(e.a=t>>>24),e}},25409:t=>{t.exports=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e}},22946:t=>{t.exports=function(t,e,i){return t<<16|e<<8|i}},5657:t=>{t.exports=function(t,e,i,s){return s<<24|t<<16|e<<8|i}},74777:(t,e,i)=>{var s=i(27119),n=i(59998);t.exports=function(t,e,i){var r=i,o=i,a=i;if(0!==e){var h=i<.5?i*(1+e):i+e-i*e,l=2*i-h;r=n(l,h,t+1/3),o=n(l,h,t),a=n(l,h,t-1/3)}return(new s).setGLTo(r,o,a,1)}},89263:(t,e,i)=>{var s=i(24650);t.exports=function(t,e){void 0===t&&(t=1),void 0===e&&(e=1);for(var i=[],n=0;n<=359;n++)i.push(s(n/359,t,e));return i}},24650:(t,e,i)=>{var s=i(22946);function n(t,e,i,s){var n=(t+6*e)%6,r=Math.min(n,4-n,1);return Math.round(255*(s-s*i*Math.max(0,r)))}t.exports=function(t,e,i,r){void 0===e&&(e=1),void 0===i&&(i=1);var o=n(5,t,e,i),a=n(3,t,e,i),h=n(1,t,e,i);return r?r.setTo?r.setTo(o,a,h,r.alpha,!1):(r.r=o,r.g=a,r.b=h,r.color=s(o,a,h),r):{r:o,g:a,b:h,color:s(o,a,h)}}},91487:(t,e,i)=>{var s=i(27119);t.exports=function(t){var e=new s;t=t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,i,s){return e+e+i+i+s+s}));var i=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(i){var n=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16);e.setTo(n,r,o)}return e}},59998:t=>{t.exports=function(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}},74853:(t,e,i)=>{var s=i(27119),n=i(15978);t.exports=function(t){var e=n(t);return new s(e.r,e.g,e.b,e.a)}},15978:t=>{t.exports=function(t){return t>16777215?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},53756:(t,e,i)=>{var s=i(42798),n=function(t,e,i,n,r,o,a,h){void 0===a&&(a=100),void 0===h&&(h=0);var l=h/a;return{r:s(t,n,l),g:s(e,r,l),b:s(i,o,l)}};t.exports={RGBWithRGB:n,ColorWithRGB:function(t,e,i,s,r,o){return void 0===r&&(r=100),void 0===o&&(o=0),n(t.r,t.g,t.b,e,i,s,r,o)},ColorWithColor:function(t,e,i,s){return void 0===i&&(i=100),void 0===s&&(s=0),n(t.r,t.g,t.b,e.r,e.g,e.b,i,s)}}},73904:(t,e,i)=>{var s=i(27119);t.exports=function(t){return new s(t.r,t.g,t.b,t.a)}},26841:(t,e,i)=>{var s=i(27119);t.exports=function(t){var e=new s,i=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(t.toLowerCase());if(i){var n=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10),a=void 0!==i[4]?parseFloat(i[4]):1;e.setTo(n,r,o,255*a)}return e}},68033:t=>{t.exports=function(t,e,i,s){void 0===s&&(s={h:0,s:0,v:0}),t/=255,e/=255,i/=255;var n=Math.min(t,e,i),r=Math.max(t,e,i),o=r-n,a=0,h=0===r?0:o/r,l=r;return r!==n&&(r===t?a=(e-i)/o+(e{var s=i(25409);t.exports=function(t,e,i,n,r){return void 0===n&&(n=255),void 0===r&&(r="#"),"#"===r?"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1,7):"0x"+s(n)+s(t)+s(e)+s(i)}},37243:(t,e,i)=>{var s=i(17489),n=i(27119);t.exports=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=255),new n(s(t,e),s(t,e),s(t,e))}},93222:(t,e,i)=>{var s=i(91487),n=i(74853),r=i(73904),o=i(26841);t.exports=function(t){switch(typeof t){case"string":return"rgb"===t.substr(0,3).toLowerCase()?o(t):s(t);case"number":return n(t);case"object":return r(t)}}},95509:(t,e,i)=>{var s=i(27119);s.ColorSpectrum=i(30245),s.ColorToRGBA=i(86672),s.ComponentToHex=i(25409),s.GetColor=i(22946),s.GetColor32=i(5657),s.HexStringToColor=i(91487),s.HSLToColor=i(74777),s.HSVColorWheel=i(89263),s.HSVToRGB=i(24650),s.HueToComponent=i(59998),s.IntegerToColor=i(74853),s.IntegerToRGB=i(15978),s.Interpolate=i(53756),s.ObjectToColor=i(73904),s.RandomRGB=i(37243),s.RGBStringToColor=i(26841),s.RGBToHSV=i(68033),s.RGBToString=i(4880),s.ValueToColor=i(93222),t.exports=s},24816:(t,e,i)=>{t.exports={Align:i(93545),BaseShader:i(31053),Bounds:i(15252),Canvas:i(23514),Color:i(95509),ColorMatrix:i(65246),Masks:i(93310),RGB:i(39298)}},76756:(t,e,i)=>{var s=i(56694),n=i(97081),r=i(81044),o=new s({initialize:function(t,e){var i=t.sys.renderer;this.renderer=i,this.bitmapMask=e,this.maskTexture=null,this.mainTexture=null,this.dirty=!0,this.mainFramebuffer=null,this.maskFramebuffer=null,this.invertAlpha=!1,this.isStencil=!1,this.scene=t,this.createMask(),t.sys.game.events.on(n.CONTEXT_RESTORED,this.createMask,this),i&&i.on(r.RESIZE,this.createMask,this)},createMask:function(){var t=this.renderer;if(t&&t.gl){this.mainTexture&&this.clearMask();var e=t.width,i=t.height,s=0==(e&e-1)&&0==(i&i-1),n=t.gl,r=s?n.REPEAT:n.CLAMP_TO_EDGE,o=n.LINEAR;this.mainTexture=t.createTexture2D(0,o,o,r,r,n.RGBA,null,e,i),this.maskTexture=t.createTexture2D(0,o,o,r,r,n.RGBA,null,e,i),this.mainFramebuffer=t.createFramebuffer(e,i,this.mainTexture,!0),this.maskFramebuffer=t.createFramebuffer(e,i,this.maskTexture,!0)}},clearMask:function(){var t=this.renderer;t&&t.gl&&this.mainTexture&&(t.deleteTexture(this.mainTexture),t.deleteTexture(this.maskTexture),t.deleteFramebuffer(this.mainFramebuffer),t.deleteFramebuffer(this.maskFramebuffer),this.mainTexture=null,this.maskTexture=null,this.mainFramebuffer=null,this.maskFramebuffer=null)},setBitmap:function(t){this.bitmapMask=t},preRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.beginMask(this,e,i)},postRenderWebGL:function(t,e){t.pipelines.BITMAPMASK_PIPELINE.endMask(this,e)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.clearMask(),this.scene.sys.game.events.off(n.CONTEXT_RESTORED,this.createMask,this),this.renderer&&this.renderer.off(r.RESIZE,this.createMask,this),this.bitmapMask=null,this.prevFramebuffer=null,this.renderer=null}});t.exports=o},63037:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e){this.geometryMask=e,this.invertAlpha=!1,this.isStencil=!0,this.level=0},setShape:function(t){return this.geometryMask=t,this},setInvertAlpha:function(t){return void 0===t&&(t=!0),this.invertAlpha=t,this},preRenderWebGL:function(t,e,i){var s=t.gl;t.flush(),0===t.maskStack.length&&(s.enable(s.STENCIL_TEST),s.clear(s.STENCIL_BUFFER_BIT),t.maskCount=0),t.currentCameraMask.mask!==this&&(t.currentMask.mask=this),t.maskStack.push({mask:this,camera:i}),this.applyStencil(t,i,!0),t.maskCount++},applyStencil:function(t,e,i){var s=t.gl,n=this.geometryMask,r=t.maskCount;s.colorMask(!1,!1,!1,!1),i?(s.stencilFunc(s.EQUAL,r,255),s.stencilOp(s.KEEP,s.KEEP,s.INCR)):(s.stencilFunc(s.EQUAL,r+1,255),s.stencilOp(s.KEEP,s.KEEP,s.DECR)),n.renderWebGL(t,n,e),t.flush(),s.colorMask(!0,!0,!0,!0),s.stencilOp(s.KEEP,s.KEEP,s.KEEP),i?this.invertAlpha?s.stencilFunc(s.NOTEQUAL,r+1,255):s.stencilFunc(s.EQUAL,r+1,255):this.invertAlpha?s.stencilFunc(s.NOTEQUAL,r,255):s.stencilFunc(s.EQUAL,r,255)},postRenderWebGL:function(t){var e=t.gl;t.maskStack.pop(),t.maskCount--,t.flush();var i=t.currentMask;if(0===t.maskStack.length)i.mask=null,e.disable(e.STENCIL_TEST);else{var s=t.maskStack[t.maskStack.length-1];s.mask.applyStencil(t,s.camera,!1),t.currentCameraMask.mask!==s.mask?(i.mask=s.mask,i.camera=s.camera):i.mask=null}},preRenderCanvas:function(t,e,i){var s=this.geometryMask;t.currentContext.save(),s.renderCanvas(t,s,i,null,null,!0),t.currentContext.clip()},postRenderCanvas:function(t){t.currentContext.restore()},destroy:function(){this.geometryMask=null}});t.exports=s},93310:(t,e,i)=>{t.exports={BitmapMask:i(76756),GeometryMask:i(63037)}},31053:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s){e&&""!==e||(e=["precision mediump float;","uniform vec2 resolution;","varying vec2 fragCoord;","void main () {"," vec2 uv = fragCoord / resolution.xy;"," gl_FragColor = vec4(uv.xyx, 1.0);","}"].join("\n")),i&&""!==i||(i=["precision mediump float;","uniform mat4 uProjectionMatrix;","uniform mat4 uViewMatrix;","uniform vec2 uResolution;","attribute vec2 inPosition;","varying vec2 fragCoord;","varying vec2 outTexCoord;","void main () {"," gl_Position = uProjectionMatrix * uViewMatrix * vec4(inPosition, 1.0, 1.0);"," fragCoord = vec2(inPosition.x, uResolution.y - inPosition.y);"," outTexCoord = vec2(inPosition.x / uResolution.x, fragCoord.y / uResolution.y);","}"].join("\n")),void 0===s&&(s=null),this.key=t,this.fragmentSrc=e,this.vertexSrc=i,this.uniforms=s}});t.exports=s},99584:t=>{t.exports=function(t,e){var i;if(e)"string"==typeof e?i=document.getElementById(e):"object"==typeof e&&1===e.nodeType&&(i=e);else if(t.parentElement||null===e)return t;return i||(i=document.body),i.appendChild(t),t}},85178:(t,e,i)=>{var s=i(99584);t.exports=function(t){var e=t.config;if(e.parent&&e.domCreateContainer){var i=document.createElement("div");i.style.cssText=["display: block;","width: "+t.scale.width+"px;","height: "+t.scale.height+"px;","padding: 0; margin: 0;","position: absolute;","overflow: hidden;","pointer-events: "+e.domPointerEvents+";","transform: scale(1);","transform-origin: left top;"].join(" "),t.domContainer=i,s(i,e.parent)}}},21546:(t,e,i)=>{var s=i(36580);t.exports=function(t){if("complete"!==document.readyState&&"interactive"!==document.readyState){var e=function(){document.removeEventListener("deviceready",e,!0),document.removeEventListener("DOMContentLoaded",e,!0),window.removeEventListener("load",e,!0),t()};document.body?s.cordova?document.addEventListener("deviceready",e,!1):(document.addEventListener("DOMContentLoaded",e,!0),window.addEventListener("load",e,!0)):window.setTimeout(e,20)}else t()}},74181:t=>{t.exports=function(t){if(!t)return window.innerHeight;var e=Math.abs(window.orientation),i={w:0,h:0},s=document.createElement("div");return s.setAttribute("style","position: fixed; height: 100vh; width: 0; top: 0"),document.documentElement.appendChild(s),i.w=90===e?s.offsetHeight:window.innerWidth,i.h=90===e?window.innerWidth:s.offsetHeight,document.documentElement.removeChild(s),s=null,90!==Math.abs(window.orientation)?i.h:i.w}},9229:(t,e,i)=>{var s=i(55301);t.exports=function(t,e){var i=window.screen,n=!!i&&(i.orientation||i.mozOrientation||i.msOrientation);return n&&"string"==typeof n.type?n.type:"string"==typeof n?n:"number"==typeof window.orientation?0===window.orientation||180===window.orientation?s.ORIENTATION.PORTRAIT:s.ORIENTATION.LANDSCAPE:window.matchMedia?window.matchMedia("(orientation: portrait)").matches?s.ORIENTATION.PORTRAIT:window.matchMedia("(orientation: landscape)").matches?s.ORIENTATION.LANDSCAPE:void 0:e>t?s.ORIENTATION.PORTRAIT:s.ORIENTATION.LANDSCAPE}},2893:t=>{t.exports=function(t){var e;return""!==t&&("string"==typeof t?e=document.getElementById(t):t&&1===t.nodeType&&(e=t)),e||(e=document.body),e}},89200:t=>{t.exports=function(t){var e="";try{if(window.DOMParser)e=(new DOMParser).parseFromString(t,"text/xml");else(e=new ActiveXObject("Microsoft.XMLDOM")).loadXML(t)}catch(t){e=null}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length?e:null}},55638:t=>{t.exports=function(t){t.parentNode&&t.parentNode.removeChild(t)}},27385:(t,e,i)=>{var s=i(56694),n=i(72283),r=new s({initialize:function(){this.isRunning=!1,this.callback=n,this.isSetTimeOut=!1,this.timeOutID=null,this.delay=0;var t=this;this.step=function e(i){t.callback(i),t.isRunning&&(t.timeOutID=window.requestAnimationFrame(e))},this.stepTimeout=function e(){t.isRunning&&(t.timeOutID=window.setTimeout(e,t.delay)),t.callback(window.performance.now())}},start:function(t,e,i){this.isRunning||(this.callback=t,this.isSetTimeOut=e,this.delay=i,this.isRunning=!0,this.timeOutID=e?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=n}});t.exports=r},3590:(t,e,i)=>{var s={AddToDOM:i(99584),DOMContentLoaded:i(21546),GetInnerHeight:i(74181),GetScreenOrientation:i(9229),GetTarget:i(2893),ParseXML:i(89200),RemoveFromDOM:i(55638),RequestAnimationFrame:i(27385)};t.exports=s},78491:(t,e,i)=>{var s=i(56694),n=i(6659),r=i(91963),o=new s({Extends:n,initialize:function(){n.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});r.register("EventEmitter",o,"events"),t.exports=o},95146:(t,e,i)=>{t.exports={EventEmitter:i(78491)}},88933:(t,e,i)=>{var s=i(95723),n=i(20494);t.exports=function(t,e,i){e.x=n(i,"x",0),e.y=n(i,"y",0),e.depth=n(i,"depth",0),e.flipX=n(i,"flipX",!1),e.flipY=n(i,"flipY",!1);var r=n(i,"scale",null);"number"==typeof r?e.setScale(r):null!==r&&(e.scaleX=n(r,"x",1),e.scaleY=n(r,"y",1));var o=n(i,"scrollFactor",null);"number"==typeof o?e.setScrollFactor(o):null!==o&&(e.scrollFactorX=n(o,"x",1),e.scrollFactorY=n(o,"y",1)),e.rotation=n(i,"rotation",0);var a=n(i,"angle",null);null!==a&&(e.angle=a),e.alpha=n(i,"alpha",1);var h=n(i,"origin",null);if("number"==typeof h)e.setOrigin(h);else if(null!==h){var l=n(h,"x",.5),u=n(h,"y",.5);e.setOrigin(l,u)}return e.blendMode=n(i,"blendMode",s.NORMAL),e.visible=n(i,"visible",!0),n(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},32291:(t,e,i)=>{var s=i(20494);t.exports=function(t,e){var i=s(e,"anims",null);if(null===i)return t;if("string"==typeof i)t.anims.play(i);else if("object"==typeof i){var n=t.anims,r=s(i,"key",void 0);if(r){var o=s(i,"startFrame",void 0),a=s(i,"delay",0),h=s(i,"repeat",0),l=s(i,"repeatDelay",0),u=s(i,"yoyo",!1),c=s(i,"play",!1),d=s(i,"delayedPlay",0),p={key:r,delay:a,repeat:h,repeatDelay:l,yoyo:u,startFrame:o};c?n.play(p):d>0?n.playAfterDelay(p,d):n.load(p)}}return t}},91713:(t,e,i)=>{var s=i(56694),n=i(71207),r=i(91963),o=i(56631),a=i(7599),h=i(17922),l=new s({Extends:n,initialize:function(t){n.call(this,t),this.sortChildrenFlag=!1,this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.events.once(a.BOOT,this.boot,this),this.events.on(a.START,this.start,this)},boot:function(){this.events.once(a.DESTROY,this.destroy,this)},addChildCallback:function(t){t.displayList&&t.displayList!==this&&t.removeFromDisplayList(),t.parentContainer&&t.parentContainer.remove(t),t.displayList||(this.queueDepthSort(),t.displayList=this,t.emit(o.ADDED_TO_SCENE,t,this.scene),this.events.emit(a.ADDED_TO_SCENE,t,this.scene))},removeChildCallback:function(t){this.queueDepthSort(),t.displayList=null,t.emit(o.REMOVED_FROM_SCENE,t,this.scene),this.events.emit(a.REMOVED_FROM_SCENE,t,this.scene)},start:function(){this.events.once(a.SHUTDOWN,this.shutdown,this)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(h(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},getChildren:function(){return this.list},shutdown:function(){for(var t=this.list;t.length;)t[0].destroy(!0);this.events.off(a.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(a.START,this.start,this),this.scene=null,this.systems=null,this.events=null}});r.register("DisplayList",l,"displayList"),t.exports=l},89980:(t,e,i)=>{var s=i(56694),n=i(48129),r=i(81078),o=i(6659),a=i(56631),h=i(7599),l=new s({Extends:o,initialize:function(t,e){o.call(this),this.scene=t,this.displayList=null,this.type=e,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.on(a.ADDED_TO_SCENE,this.addedToScene,this),this.on(a.REMOVED_FROM_SCENE,this.removedFromScene,this),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new r(this)),this},setData:function(t,e){return this.data||(this.data=new r(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new r(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new r(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new r(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(){return this.scene.sys.input.disable(this),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return n(this)},willRender:function(t){return!(!(!this.displayList||!this.displayList.active||this.displayList.willRender(t))||l.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return this.displayList?i.unshift(this.displayList.getIndex(t)):i.unshift(this.scene.sys.displayList.getIndex(t)),i},addToDisplayList:function(t){return void 0===t&&(t=this.scene.sys.displayList),this.displayList&&this.displayList!==t&&this.removeFromDisplayList(),t.exists(this)||(this.displayList=t,t.add(this,!0),t.queueDepthSort(),this.emit(a.ADDED_TO_SCENE,this,this.scene),t.events.emit(h.ADDED_TO_SCENE,this,this.scene)),this},addToUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.add(this),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(a.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(h.REMOVED_FROM_SCENE,this,this.scene)),this},removeFromUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.remove(this),this},destroy:function(t){this.scene&&!this.ignoreDestroy&&(void 0===t&&(t=!1),this.preDestroy&&this.preDestroy.call(this),this.emit(a.DESTROY,this,t),this.removeAllListeners(),this.postPipelines&&this.resetPostPipeline(!0),this.removeFromDisplayList(),this.removeFromUpdateList(),this.input&&(this.scene.sys.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0)}});l.RENDER_MASK=15,t.exports=l},99325:(t,e,i)=>{var s=i(56694),n=i(91963),r=i(7599),o=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(r.BOOT,this.boot,this),this.events.on(r.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(r.DESTROY,this.destroy,this)},start:function(){this.events.once(r.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.events.off(r.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});o.register=function(t,e){o.prototype.hasOwnProperty(t)||(o.prototype[t]=e)},o.remove=function(t){o.prototype.hasOwnProperty(t)&&delete o.prototype[t]},n.register("GameObjectCreator",o,"make"),t.exports=o},61286:(t,e,i)=>{var s=i(56694),n=i(91963),r=i(7599),o=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(r.BOOT,this.boot,this),this.events.on(r.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(r.DESTROY,this.destroy,this)},start:function(){this.events.once(r.SHUTDOWN,this.shutdown,this)},existing:function(t){return(t.renderCanvas||t.renderWebGL)&&this.displayList.add(t),t.preUpdate&&this.updateList.add(t),t},shutdown:function(){this.events.off(r.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});o.register=function(t,e){o.prototype.hasOwnProperty(t)||(o.prototype[t]=e)},o.remove=function(t){o.prototype.hasOwnProperty(t)&&delete o.prototype[t]},n.register("GameObjectFactory",o,"add"),t.exports=o},73329:(t,e,i)=>{var s=i(69360),n=new s,r=new s,o=new s,a={camera:n,sprite:r,calc:o};t.exports=function(t,e,i){var s=n,h=r,l=o;return h.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),s.copyFrom(e.matrix),i?(s.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),h.e=t.x,h.f=t.y):(h.e-=e.scrollX*t.scrollFactorX,h.f-=e.scrollY*t.scrollFactorY),s.multiply(h,l),a}},92034:(t,e,i)=>{var s=i(56694),n=i(74623),r=i(91963),o=i(7599),a=new s({Extends:n,initialize:function(t){n.call(this),this.checkQueue=!0,this.scene=t,this.systems=t.sys,t.sys.events.once(o.BOOT,this.boot,this),t.sys.events.on(o.START,this.start,this)},boot:function(){this.systems.events.once(o.DESTROY,this.destroy,this)},start:function(){var t=this.systems.events;t.on(o.PRE_UPDATE,this.update,this),t.on(o.UPDATE,this.sceneUpdate,this),t.once(o.SHUTDOWN,this.shutdown,this)},sceneUpdate:function(t,e){for(var i=this._active,s=i.length,n=0;n{t.exports=function(t,e,i,s,n,r,o,a,h,l,u,c,d,p,f){var v=i.x-e.displayOriginX+n,g=i.y-e.displayOriginY+r,m=v+i.w,y=g+i.h,x=o.getXRound(v,g,a),T=o.getYRound(v,g,a),w=o.getXRound(v,y,a),b=o.getYRound(v,y,a),E=o.getXRound(m,y,a),S=o.getYRound(m,y,a),A=o.getXRound(m,g,a),_=o.getYRound(m,g,a);t.batchQuad(e,x,T,w,b,E,S,A,_,s.u0,s.v0,s.u1,s.v1,h,l,u,c,d,p,f)}},82173:t=>{t.exports=function(t,e,i,s){if(void 0===i&&(i=!1),void 0===s)return s={local:{x:0,y:0,width:0,height:0},global:{x:0,y:0,width:0,height:0},lines:{shortest:0,longest:0,lengths:null,height:0},wrappedText:"",words:[],characters:[],scaleX:0,scaleY:0};var n,r,o,a,h=t.text,l=h.length,u=t.maxWidth,c=t.wordWrapCharCode,d=Number.MAX_VALUE,p=Number.MAX_VALUE,f=0,v=0,g=t.fontData.chars,m=t.fontData.lineHeight,y=t.letterSpacing,x=0,T=0,w=0,b=null,E=t._align,S=0,A=0,_=t.fontSize/t.fontData.size,C=_*t.scaleX,R=_*t.scaleY,M=null,P=0,O=[],L=Number.MAX_VALUE,F=0,D=0,k=0,I=[],B=[],N=null;if(u>0){for(n=0;nu||V-X>u?(z.push(G.i-1),G.cr?(z.push(G.i+G.word.length),X=0,U=null):U=G):G.cr&&(z.push(G.i+G.word.length),X=0,U=null)}for(n=z.length-1;n>=0;n--)r=h,o=z[n],a="\n",h=r.substr(0,o)+a+r.substr(o+1);s.wrappedText=h,l=h.length,I=[],N=null}var H=0;for(n=0;nS&&(d=S),p>A&&(p=A);var K=S+b.xAdvance,q=A+m;fF&&(F=k),kF&&(F=k),k0)for(var J=0;J{var s=i(31476);t.exports=function(t,e,i,n,r,o,a){var h=t.sys.textures.get(i),l=h.get(n),u=t.sys.cache.xml.get(r);if(l&&u){var c=s(u,l,o,a,h);return t.sys.cache.bitmapFont.add(e,{data:c,texture:i,frame:n,fromAtlas:!0}),!0}return!1}},39860:(t,e,i)=>{var s=i(10850);t.exports=function(t,e){var i=e.width,n=e.height,r=Math.floor(i/2),o=Math.floor(n/2),a=s(e,"chars","");if(""!==a){var h=s(e,"image",""),l=t.sys.textures.getFrame(h),u=l.cutX,c=l.cutY,d=l.source.width,p=l.source.height,f=s(e,"offset.x",0),v=s(e,"offset.y",0),g=s(e,"spacing.x",0),m=s(e,"spacing.y",0),y=s(e,"lineSpacing",0),x=s(e,"charsPerRow",null);null===x&&(x=d/i)>a.length&&(x=a.length);for(var T=f,w=v,b={retroFont:!0,font:h,size:i,lineHeight:n+y,chars:{}},E=0,S=0;S{function e(t,e){return parseInt(t.getAttribute(e),10)}t.exports=function(t,i,s,n,r){void 0===s&&(s=0),void 0===n&&(n=0);var o=i.cutX,a=i.cutY,h=i.source.width,l=i.source.height,u=i.sourceIndex,c={},d=t.getElementsByTagName("info")[0],p=t.getElementsByTagName("common")[0];c.font=d.getAttribute("face"),c.size=e(d,"size"),c.lineHeight=e(p,"lineHeight")+n,c.chars={};var f=t.getElementsByTagName("char"),v=void 0!==i&&i.trimmed;if(v)var g=i.height,m=i.width;for(var y=0;y{var s=i(66863),n=i(98611),r={Parse:i(39860)};r=n(!1,r,s),t.exports=r},66863:t=>{t.exports={TEXT_SET1:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},13468:(t,e,i)=>{var s=i(44616),n=i(56694),r=i(88899),o=new n({Extends:s,Mixins:[r],initialize:function(t,e,i,n,r,o,a){s.call(this,t,e,i,n,r,o,a),this.type="DynamicBitmapText",this.scrollX=0,this.scrollY=0,this.cropWidth=0,this.cropHeight=0,this.displayCallback,this.callbackData={parent:this,color:0,tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:0,charCode:0,x:0,y:0,scale:0,rotation:0,data:0}},setSize:function(t,e){return this.cropWidth=t,this.cropHeight=e,this},setDisplayCallback:function(t){return this.displayCallback=t,this},setScrollX:function(t){return this.scrollX=t,this},setScrollY:function(t){return this.scrollY=t,this}});t.exports=o},93438:(t,e,i)=>{var s=i(49584);t.exports=function(t,e,i,n){var r=e._text,o=r.length,a=t.currentContext;if(0!==o&&s(t,a,e,i,n)){i.addToRenderList(e);var h=e.fromAtlas?e.frame:e.texture.frames.__BASE,l=e.displayCallback,u=e.callbackData,c=e.fontData.chars,d=e.fontData.lineHeight,p=e._letterSpacing,f=0,v=0,g=0,m=null,y=0,x=0,T=0,w=0,b=0,E=0,S=null,A=0,_=e.frame.source.image,C=h.cutX,R=h.cutY,M=0,P=0,O=e._fontSize/e.fontData.size,L=e._align,F=0,D=0;e.getTextBounds(!1);var k=e._bounds.lines;1===L?D=(k.longest-k.lengths[0])/2:2===L&&(D=k.longest-k.lengths[0]),a.translate(-e.displayOriginX,-e.displayOriginY);var I=i.roundPixels;e.cropWidth>0&&e.cropHeight>0&&(a.beginPath(),a.rect(0,0,e.cropWidth,e.cropHeight),a.clip());for(var B=0;B{var s=i(13468),n=i(88933),r=i(99325),o=i(20494);r.register("dynamicBitmapText",(function(t,e){void 0===t&&(t={});var i=o(t,"font",""),r=o(t,"text",""),a=o(t,"size",!1),h=new s(this.scene,0,0,i,r,a);return void 0!==e&&(t.add=e),n(this.scene,h,t),h}))},94145:(t,e,i)=>{var s=i(13468);i(61286).register("dynamicBitmapText",(function(t,e,i,n,r){return this.displayList.add(new s(this.scene,t,e,i,n,r))}))},88899:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(16873),r=i(93438),t.exports={renderWebGL:n,renderCanvas:r}},16873:(t,e,i)=>{var s=i(73329),n=i(69360),r=i(75512),o=new n;t.exports=function(t,e,i,n){var a=e.text,h=a.length;if(0!==h){i.addToRenderList(e);var l=t.pipelines.set(e.pipeline,e),u=s(e,i,n),c=u.sprite,d=u.calc,p=o,f=e.cropWidth>0||e.cropHeight>0;f&&(l.flush(),t.pushScissor(d.tx,d.ty,e.cropWidth*d.scaleX,e.cropHeight*d.scaleY));var v,g,m=e.frame.glTexture,y=e.tintFill,x=r.getTintAppendFloatAlpha(e.tintTopLeft,i.alpha*e._alphaTL),T=r.getTintAppendFloatAlpha(e.tintTopRight,i.alpha*e._alphaTR),w=r.getTintAppendFloatAlpha(e.tintBottomLeft,i.alpha*e._alphaBL),b=r.getTintAppendFloatAlpha(e.tintBottomRight,i.alpha*e._alphaBR),E=l.setGameObject(e),S=0,A=0,_=0,C=0,R=e.letterSpacing,M=0,P=0,O=e.scrollX,L=e.scrollY,F=e.fontData,D=F.chars,k=F.lineHeight,I=e.fontSize/F.size,B=0,N=e._align,Y=0,U=0,X=e.getTextBounds(!1);e.maxWidth>0&&(h=(a=X.wrappedText).length);var z=e._bounds.lines;1===N?U=(z.longest-z.lengths[0])/2:2===N&&(U=z.longest-z.lengths[0]);var G=i.roundPixels,W=e.displayCallback,V=e.callbackData;t.pipelines.preBatch(e);for(var H=0;H{var s=i(56694),n=i(82897),r=i(64937),o=i(89980),a=i(82173),h=i(68298),l=i(31476),u=i(74118),c=i(84557),d=new s({Extends:o,Mixins:[r.Alpha,r.BlendMode,r.Depth,r.Mask,r.Origin,r.Pipeline,r.ScrollFactor,r.Texture,r.Tint,r.Transform,r.Visible,c],initialize:function(t,e,i,s,n,r,h){void 0===n&&(n=""),void 0===h&&(h=0),o.call(this,t,"BitmapText"),this.font=s;var l=this.scene.sys.cache.bitmapFont.get(s);l||console.warn("Invalid BitmapText key: "+s),this.fontData=l.data,this._text="",this._fontSize=r||this.fontData.size,this._letterSpacing=0,this._align=h,this._bounds=a(),this._dirty=!0,this._maxWidth=0,this.wordWrapCharCode=32,this.charColors=[],this.dropShadowX=0,this.dropShadowY=0,this.dropShadowColor=0,this.dropShadowAlpha=.5,this.fromAtlas=l.fromAtlas,this.setTexture(l.texture,l.frame),this.setPosition(e,i),this.setOrigin(0,0),this.initPipeline(),this.setText(n)},setLeftAlign:function(){return this._align=d.ALIGN_LEFT,this._dirty=!0,this},setCenterAlign:function(){return this._align=d.ALIGN_CENTER,this._dirty=!0,this},setRightAlign:function(){return this._align=d.ALIGN_RIGHT,this._dirty=!0,this},setFontSize:function(t){return this._fontSize=t,this._dirty=!0,this},setLetterSpacing:function(t){return void 0===t&&(t=0),this._letterSpacing=t,this._dirty=!0,this},setText:function(t){return t||0===t||(t=""),Array.isArray(t)&&(t=t.join("\n")),t!==this.text&&(this._text=t.toString(),this._dirty=!0,this.updateDisplayOrigin()),this},setDropShadow:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=.5),this.dropShadowX=t,this.dropShadowY=e,this.dropShadowColor=i,this.dropShadowAlpha=s,this},setCharacterTint:function(t,e,i,s,r,o,a){void 0===t&&(t=0),void 0===e&&(e=1),void 0===i&&(i=!1),void 0===s&&(s=-1),void 0===r&&(r=s,o=s,a=s);var h=this.text.length;-1===e&&(e=h),t<0&&(t=h+t),t=n(t,0,h-1);for(var l=n(t+e,t,h),u=this.charColors,c=t;c{var s=i(49584);t.exports=function(t,e,i,n){var r=e._text,o=r.length,a=t.currentContext;if(0!==o&&s(t,a,e,i,n)){i.addToRenderList(e);var h=e.fromAtlas?e.frame:e.texture.frames.__BASE,l=e.fontData.chars,u=e.fontData.lineHeight,c=e._letterSpacing,d=0,p=0,f=0,v=null,g=0,m=0,y=0,x=0,T=0,w=0,b=null,E=0,S=h.source.image,A=h.cutX,_=h.cutY,C=e._fontSize/e.fontData.size,R=e._align,M=0,P=0,O=e.getTextBounds(!1);e.maxWidth>0&&(o=(r=O.wrappedText).length);var L=e._bounds.lines;1===R?P=(L.longest-L.lengths[0])/2:2===R&&(P=L.longest-L.lengths[0]),a.translate(-e.displayOriginX,-e.displayOriginY);for(var F=i.roundPixels,D=0;D{var s=i(44616),n=i(88933),r=i(99325),o=i(20494),a=i(10850);r.register("bitmapText",(function(t,e){void 0===t&&(t={});var i=a(t,"font",""),r=o(t,"text",""),h=o(t,"size",!1),l=a(t,"align",0),u=new s(this.scene,0,0,i,r,h,l);return void 0!==e&&(t.add=e),n(this.scene,u,t),u}))},21797:(t,e,i)=>{var s=i(44616);i(61286).register("bitmapText",(function(t,e,i,n,r,o){return this.displayList.add(new s(this.scene,t,e,i,n,r,o))}))},84557:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(26372),r=i(97545),t.exports={renderWebGL:n,renderCanvas:r}},26372:(t,e,i)=>{var s=i(8810),n=i(73329),r=i(75512);t.exports=function(t,e,i,o){if(0!==e._text.length){i.addToRenderList(e);var a,h,l,u=t.pipelines.set(e.pipeline,e),c=n(e,i,o).calc,d=i.roundPixels,p=i.alpha,f=e.charColors,v=e.tintFill,g=r.getTintAppendFloatAlpha,m=g(e.tintTopLeft,p*e._alphaTL),y=g(e.tintTopRight,p*e._alphaTR),x=g(e.tintBottomLeft,p*e._alphaBL),T=g(e.tintBottomRight,p*e._alphaBR),w=e.frame.glTexture,b=u.setGameObject(e),E=e.getTextBounds(!1).characters,S=e.dropShadowX,A=e.dropShadowY,_=0!==S||0!==A;if(t.pipelines.preBatch(e),_){var C=e.dropShadowColor,R=e.dropShadowAlpha,M=g(C,p*R*e._alphaTL),P=g(C,p*R*e._alphaTR),O=g(C,p*R*e._alphaBL),L=g(C,p*R*e._alphaBR);for(a=0;a{var s=i(92246),n=i(41664),r=i(56694),o=i(64937),a=i(82047),h=i(89980),l=i(71207),u=new r({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.Depth,o.Mask,o.Pipeline,o.ScrollFactor,o.Size,o.Texture,o.Transform,o.Visible,s],initialize:function(t,e,i,s,n){h.call(this,t,"Blitter"),this.setTexture(s,n),this.setPosition(e,i),this.initPipeline(),this.children=new l,this.renderList=[],this.dirty=!1},create:function(t,e,i,s,r){void 0===s&&(s=!0),void 0===r&&(r=this.children.length),void 0===i?i=this.frame:i instanceof a||(i=this.texture.get(i));var o=new n(this,t,e,i,s);return this.children.addAt(o,r,!1),this.dirty=!0,o},createFromCallback:function(t,e,i,s){for(var n=this.createMultiple(e,i,s),r=0;r0},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(){this.children.removeAll(),this.dirty=!0},preDestroy:function(){this.children.destroy(),this.renderList=[]}});t.exports=u},33177:t=>{t.exports=function(t,e,i,s){var n=e.getRenderList();if(0!==n.length){var r=t.currentContext,o=i.alpha*e.alpha;if(0!==o){i.addToRenderList(e),r.globalCompositeOperation=t.blendModes[e.blendMode],r.imageSmoothingEnabled=!e.frame.source.scaleMode;var a=e.x-i.scrollX*e.scrollFactorX,h=e.y-i.scrollY*e.scrollFactorY;r.save(),s&&s.copyToContext(r);for(var l=i.roundPixels,u=0;u0&&f.height>0&&(r.save(),r.translate(c.x+a,c.y+h),r.scale(m,y),r.drawImage(p.source.image,f.x,f.y,f.width,f.height,v,g,f.width,f.height),r.restore())):(l&&(v=Math.round(v),g=Math.round(g)),f.width>0&&f.height>0&&r.drawImage(p.source.image,f.x,f.y,f.width,f.height,v+c.x+a,g+c.y+h,f.width,f.height)))}r.restore()}}}},68452:(t,e,i)=>{var s=i(52816),n=i(88933),r=i(99325),o=i(20494);r.register("blitter",(function(t,e){void 0===t&&(t={});var i=o(t,"key",null),r=o(t,"frame",null),a=new s(this.scene,0,0,i,r);return void 0!==e&&(t.add=e),n(this.scene,a,t),a}))},38906:(t,e,i)=>{var s=i(52816);i(61286).register("blitter",(function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))}))},92246:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(89165),r=i(33177),t.exports={renderWebGL:n,renderCanvas:r}},89165:(t,e,i)=>{var s=i(69360),n=i(75512),r=new s;t.exports=function(t,e,i,s){var o=e.getRenderList();if(0!==o.length){var a=i.alpha*e.alpha;if(0!==a){i.addToRenderList(e);var h=t.pipelines.set(this.pipeline,e),l=i.scrollX*e.scrollFactorX,u=i.scrollY*e.scrollFactorY,c=r.copyFrom(i.matrix);s&&(c.multiplyWithOffset(s,-l,-u),l=0,u=0);var d=e.x-l,p=e.y-u,f=-1,v=i.roundPixels;t.pipelines.preBatch(e);for(var g=0;g{var s=i(56694),n=i(82047),r=new s({initialize:function(t,e,i,s,n){this.parent=t,this.x=e,this.y=i,this.frame=s,this.data={},this.tint=16777215,this._visible=n,this._alpha=1,this.flipX=!1,this.flipY=!1},setFrame:function(t){return void 0===t?this.frame=this.parent.frame:t instanceof n&&t.texture===this.parent.texture?this.frame=t:this.frame=this.parent.texture.get(t),this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this},reset:function(t,e,i){return this.x=t,this.y=e,this.flipX=!1,this.flipY=!1,this._alpha=1,this._visible=!0,this.parent.dirty=!0,i&&this.setFrame(i),this},setPosition:function(t,e){return this.x=t,this.y=e,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},setVisible:function(t){return this.visible=t,this},setAlpha:function(t){return this.alpha=t,this},setTint:function(t){return this.tint=t,this},destroy:function(){this.parent.dirty=!0,this.parent.children.remove(this),this.parent=void 0,this.frame=void 0,this.data=void 0},visible:{get:function(){return this._visible},set:function(t){this.parent.dirty|=this._visible!==t,this._visible=t}},alpha:{get:function(){return this._alpha},set:function(t){this.parent.dirty|=this._alpha>0!=t>0,this._alpha=t}}});t.exports=r},97123:(t,e,i)=>{var s=i(82897),n={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,n){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=s(t,0,1),this._alphaTR=s(e,0,1),this._alphaBL=s(i,0,1),this._alphaBR=s(n,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=s(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=s(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=s(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=s(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=n},15720:(t,e,i)=>{var s=i(82897),n={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t){return void 0===t&&(t=1),this.alpha=t,this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}}};t.exports=n},69732:(t,e,i)=>{var s=i(95723),n={_blendMode:s.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=s[t]),(t|=0)>=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=n},28284:t=>{t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},85293:t=>{var e={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,s){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,s,this.flipX,this.flipY);else{var n=t;this.frame.setCropUVs(this._crop,n.x,n.y,n.width,n.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=e},14975:t=>{var e={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.displayList&&this.displayList.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=e},88677:t=>{var e={fxPadding:0,setFXPadding:function(t){return void 0===t&&(t=0),this.fxPadding=t,this},onFXCopy:function(){},onFX:function(){}};t.exports=e},92972:t=>{t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},80693:(t,e,i)=>{var s=i(74118),n=i(2386),r=i(93736),o={prepareBoundsOutput:function(t,e){(void 0===e&&(e=!1),0!==this.rotation&&n(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getCenter:function(t){return void 0===t&&(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,t},getTopLeft:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopRight:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getLeftCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getRightCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getBottomLeft:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomRight:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBounds:function(t){var e,i,n,r,o,a,h,l;if(void 0===t&&(t=new s),this.parentContainer){var u=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(t),u.transformPoint(t.x,t.y,t),e=t.x,i=t.y,this.getTopRight(t),u.transformPoint(t.x,t.y,t),n=t.x,r=t.y,this.getBottomLeft(t),u.transformPoint(t.x,t.y,t),o=t.x,a=t.y,this.getBottomRight(t),u.transformPoint(t.x,t.y,t),h=t.x,l=t.y}else this.getTopLeft(t),e=t.x,i=t.y,this.getTopRight(t),n=t.x,r=t.y,this.getBottomLeft(t),o=t.x,a=t.y,this.getBottomRight(t),h=t.x,l=t.y;return t.x=Math.min(e,n,o,h),t.y=Math.min(i,r,a,l),t.width=Math.max(e,n,o,h)-t.x,t.height=Math.max(i,r,a,l)-t.y,t}};t.exports=o},39171:(t,e,i)=>{var s=i(76756),n=i(63037),r={mask:null,setMask:function(t){return this.mask=t,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},createBitmapMask:function(t){return void 0===t&&(this.texture||this.shader)&&(t=this),new s(this.scene,t)},createGeometryMask:function(t){return void 0===t&&(this instanceof Phaser.GameObjects.Graphics||this instanceof Phaser.GameObjects.Shape)&&(t=this),new n(this.scene,t)}};t.exports=r},28072:t=>{var e={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(t){this._displayOriginX=t,this.originX=t/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(t){this._displayOriginY=t,this.originY=t/this.height}},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this.updateDisplayOrigin()},setOriginFromFrame:function(){return this.frame&&this.frame.customPivot?(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin()):this.setOrigin()},setDisplayOrigin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displayOriginX=t,this.displayOriginY=e,this},updateDisplayOrigin:function(){return this._displayOriginX=this.originX*this.width,this._displayOriginY=this.originY*this.height,this}};t.exports=e},54211:(t,e,i)=>{var s=i(75606),n=i(63130),r=i(10850),o=i(55303),a=i(93736),h={path:null,rotateToPath:!1,pathRotationOffset:0,pathOffset:null,pathVector:null,pathDelta:null,pathTween:null,pathConfig:null,_prevDirection:o.PLAYING_FORWARD,setPath:function(t,e){void 0===e&&(e=this.pathConfig);var i=this.pathTween;return i&&i.isPlaying()&&i.stop(),this.path=t,e&&this.startFollow(e),this},setRotateToPath:function(t,e){return void 0===e&&(e=0),this.rotateToPath=t,this.pathRotationOffset=e,this},isFollowing:function(){var t=this.pathTween;return t&&t.isPlaying()},startFollow:function(t,e){void 0===t&&(t={}),void 0===e&&(e=0);var i=this.pathTween;i&&i.isPlaying()&&i.stop(),"number"==typeof t&&(t={duration:t}),t.from=r(t,"from",0),t.to=r(t,"to",1);var h=n(t,"positionOnPath",!1);this.rotateToPath=n(t,"rotateToPath",!1),this.pathRotationOffset=r(t,"rotationOffset",0);var l=r(t,"startAt",e);if(l&&(t.onStart=function(t){var e=t.data[0];e.progress=l,e.elapsed=e.duration*l;var i=e.ease(e.progress);e.current=e.start+(e.end-e.start)*i,e.target[e.key]=e.current}),this.pathOffset||(this.pathOffset=new a(this.x,this.y)),this.pathVector||(this.pathVector=new a),this.pathDelta||(this.pathDelta=new a),this.pathDelta.reset(),this.pathTween=this.scene.sys.tweens.addCounter(t),this.path.getStartPoint(this.pathOffset),h&&(this.x=this.pathOffset.x,this.y=this.pathOffset.y),this.pathOffset.x=this.x-this.pathOffset.x,this.pathOffset.y=this.y-this.pathOffset.y,this._prevDirection=o.PLAYING_FORWARD,this.rotateToPath){var u=this.path.getPoint(.1);this.rotation=Math.atan2(u.y-this.y,u.x-this.x)+s(this.pathRotationOffset)}return this.pathConfig=t,this},pauseFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.pause(),this},resumeFollow:function(){var t=this.pathTween;return t&&t.isPaused()&&t.resume(),this},stopFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.stop(),this},pathUpdate:function(){var t=this.pathTween;if(t){var e=t.data[0],i=this.pathDelta,n=this.pathVector;if(i.copy(n).negate(),e.state===o.COMPLETE)return this.path.getPoint(e.end,n),i.add(n),n.add(this.pathOffset),void this.setPosition(n.x,n.y);if(e.state!==o.PLAYING_FORWARD&&e.state!==o.PLAYING_BACKWARD)return;this.path.getPoint(t.getValue(),n),i.add(n),n.add(this.pathOffset);var r=this.x,a=this.y;this.setPosition(n.x,n.y);var h=this.x-r,l=this.y-a;if(0===h&&0===l)return;if(e.state!==this._prevDirection)return void(this._prevDirection=e.state);this.rotateToPath&&(this.rotation=Math.atan2(l,h)+s(this.pathRotationOffset))}}};t.exports=h},58210:(t,e,i)=>{var s=i(28699),n=i(65641),r=i(72677),o={defaultPipeline:null,pipeline:null,hasPostPipeline:!1,postPipelines:null,pipelineData:null,initPipeline:function(t){void 0===t&&(t=n.MULTI_PIPELINE);var e=this.scene.sys.renderer;if(!e)return!1;var i=e.pipelines;if(this.postPipelines=[],this.pipelineData={},i){var s=i.get(t);if(s)return this.defaultPipeline=s,this.pipeline=s,!0}return!1},setPipeline:function(t,e,i){var n=this.scene.sys.renderer;if(!n)return this;var r=n.pipelines;if(r){var o=r.get(t);o&&(this.pipeline=o),e&&(this.pipelineData=i?s(e):e)}return this},setPostPipeline:function(t,e,i){var n=this.scene.sys.renderer;if(!n)return this;var r=n.pipelines;if(r){Array.isArray(t)||(t=[t]);for(var o=0;o0,this},setPipelineData:function(t,e){var i=this.pipelineData;return void 0===e?delete i[t]:i[t]=e,this},getPostPipeline:function(t){for(var e=this.postPipelines,i=[],s=0;s=0;i--){var s=e[i];("string"==typeof t&&s.name===t||"string"!=typeof t&&s instanceof t)&&(s.destroy(),r(e,i))}return this.hasPostPipeline=this.postPipelines.length>0,this},getPipelineName:function(){return this.pipeline.name}};t.exports=o},45900:t=>{var e={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=e},31654:t=>{var e={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return Math.abs(this.scaleX*this.frame.realWidth)},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return Math.abs(this.scaleY*this.frame.realHeight)},set:function(t){this.scaleY=t/this.frame.realHeight}},setSizeToFrame:function(t){void 0===t&&(t=this.frame),this.width=t.realWidth,this.height=t.realHeight;var e=this.input;return e&&!e.customHitArea&&(e.hitArea.width=this.width,e.hitArea.height=this.height),this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}};t.exports=e},82081:t=>{var e={texture:null,frame:null,isCropped:!1,setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};t.exports=e},21850:t=>{var e={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,s){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,s,this.flipX,this.flipY);else{var n=t;this.frame.setCropUVs(this._crop,n.x,n.y,n.width,n.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=e},58072:t=>{var e={tintTopLeft:16777215,tintTopRight:16777215,tintBottomLeft:16777215,tintBottomRight:16777215,tintFill:!1,clearTint:function(){return this.setTint(16777215),this},setTint:function(t,e,i,s){return void 0===t&&(t=16777215),void 0===e&&(e=t,i=t,s=t),this.tintTopLeft=t,this.tintTopRight=e,this.tintBottomLeft=i,this.tintBottomRight=s,this.tintFill=!1,this},setTintFill:function(t,e,i,s){return this.setTint(t,e,i,s),this.tintFill=!0,this},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){var t=16777215;return this.tintFill||this.tintTopLeft!==t||this.tintTopRight!==t||this.tintBottomLeft!==t||this.tintBottomRight!==t}}};t.exports=e},48129:t=>{t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},56584:(t,e,i)=>{var s=i(83392),n=i(69360),r=i(64462),o=i(35786),a=i(62138),h=i(93736),l={hasTransformComponent:!0,_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(t){this._scaleX=t,this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},angle:{get:function(){return a(this._rotation*s.RAD_TO_DEG)},set:function(t){this.rotation=a(t)*s.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=o(t)}},setPosition:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===s&&(s=0),this.x=t,this.y=e,this.z=i,this.w=s,this},copyPosition:function(t){return void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.z&&(this.z=t.z),void 0!==t.w&&(this.w=t.w),this},setRandomPosition:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===s&&(s=this.scene.sys.scale.height),this.x=t+Math.random()*i,this.y=e+Math.random()*s,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new n),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new n),void 0===e&&(e=new n);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);for(t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return t},getLocalPoint:function(t,e,i,s){i||(i=new h),s||(s=this.scene.sys.cameras.main);var n=s.scrollX,o=s.scrollY,a=t+n*this.scrollFactorX-n,l=e+o*this.scrollFactorY-o;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(a,l,i):r(a,l,this.x,this.y,this.rotation,this.scaleX,this.scaleY,i),this._originComponent&&(i.x+=this._displayOriginX,i.y+=this._displayOriginY),i},getParentRotation:function(){for(var t=0,e=this.parentContainer;e;)t+=e.rotation,e=e.parentContainer;return t}};t.exports=l},69360:(t,e,i)=>{var s=i(56694),n=i(83392),r=i(93736),o=new s({initialize:function(t,e,i,s,n,r){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=1),void 0===n&&(n=0),void 0===r&&(r=0),this.matrix=new Float32Array([t,e,i,s,n,r,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0}},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var t=this.matrix,e=t[0],i=t[1],s=t[2],r=t[3];return e||i?i>0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):s||r?n.TAU-(r>0?Math.acos(-s/this.scaleY):-Math.acos(s/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),s=this.matrix,n=s[0],r=s[1],o=s[2],a=s[3];return s[0]=n*i+o*e,s[1]=r*i+a*e,s[2]=n*-e+o*i,s[3]=r*-e+a*i,this},multiply:function(t,e){var i=this.matrix,s=t.matrix,n=i[0],r=i[1],o=i[2],a=i[3],h=i[4],l=i[5],u=s[0],c=s[1],d=s[2],p=s[3],f=s[4],v=s[5],g=void 0===e?this:e;return g.a=u*n+c*o,g.b=u*r+c*a,g.c=d*n+p*o,g.d=d*r+p*a,g.e=f*n+v*o+h,g.f=f*r+v*a+l,g},multiplyWithOffset:function(t,e,i){var s=this.matrix,n=t.matrix,r=s[0],o=s[1],a=s[2],h=s[3],l=e*r+i*a+s[4],u=e*o+i*h+s[5],c=n[0],d=n[1],p=n[2],f=n[3],v=n[4],g=n[5];return s[0]=c*r+d*a,s[1]=c*o+d*h,s[2]=p*r+f*a,s[3]=p*o+f*h,s[4]=v*r+g*a+l,s[5]=v*o+g*h+u,this},transform:function(t,e,i,s,n,r){var o=this.matrix,a=o[0],h=o[1],l=o[2],u=o[3],c=o[4],d=o[5];return o[0]=t*a+e*l,o[1]=t*h+e*u,o[2]=i*a+s*l,o[3]=i*h+s*u,o[4]=n*a+r*l+c,o[5]=n*h+r*u+d,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var s=this.matrix,n=s[0],r=s[1],o=s[2],a=s[3],h=s[4],l=s[5];return i.x=t*n+e*o+h,i.y=t*r+e*a+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=e*n-i*s;return t[0]=n/a,t[1]=-i/a,t[2]=-s/a,t[3]=e/a,t[4]=(s*o-n*r)/a,t[5]=-(e*o-i*r)/a,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){var e=this.matrix;return t.setTransform(e[0],e[1],e[2],e[3],e[4],e[5]),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,s,n,r){var o=this.matrix;return o[0]=t,o[1]=e,o[2]=i,o[3]=s,o[4]=n,o[5]=r,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],s=e[1],n=e[2],r=e[3],o=i*r-s*n;if(t.translateX=e[4],t.translateY=e[5],i||s){var a=Math.sqrt(i*i+s*s);t.rotation=s>0?Math.acos(i/a):-Math.acos(i/a),t.scaleX=a,t.scaleY=o/a}else if(n||r){var h=Math.sqrt(n*n+r*r);t.rotation=.5*Math.PI-(r>0?Math.acos(-n/h):-Math.acos(n/h)),t.scaleX=o/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,i,s,n){var r=this.matrix,o=Math.sin(i),a=Math.cos(i);return r[4]=t,r[5]=e,r[0]=a*s,r[1]=o*s,r[2]=-o*n,r[3]=a*n,this},applyInverse:function(t,e,i){void 0===i&&(i=new r);var s=this.matrix,n=s[0],o=s[1],a=s[2],h=s[3],l=s[4],u=s[5],c=1/(n*h+a*-o);return i.x=h*c*t+-a*c*e+(u*a-l*h)*c,i.y=n*c*e+-o*c*t+(-u*n+l*o)*c,i},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getXRound:function(t,e,i){var s=this.getX(t,e);return i&&(s=Math.round(s)),s},getYRound:function(t,e,i){var s=this.getY(t,e);return i&&(s=Math.round(s)),s},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.decomposedMatrix=null}});t.exports=o},59694:t=>{var e={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=e},64937:(t,e,i)=>{t.exports={Alpha:i(97123),AlphaSingle:i(15720),BlendMode:i(69732),ComputedSize:i(28284),Crop:i(85293),Depth:i(14975),Flip:i(92972),FX:i(88677),GetBounds:i(80693),Mask:i(39171),Origin:i(28072),PathFollower:i(54211),Pipeline:i(58210),ScrollFactor:i(45900),Size:i(31654),Texture:i(82081),TextureCrop:i(21850),Tint:i(58072),ToJSON:i(48129),Transform:i(56584),TransformMatrix:i(69360),Visible:i(59694)}},70339:(t,e,i)=>{var s=i(59959),n=i(95723),r=i(56694),o=i(64937),a=i(56631),h=i(89980),l=i(74118),u=i(98524),c=i(58795),d=i(93736),p=new r({Extends:h,Mixins:[o.AlphaSingle,o.BlendMode,o.ComputedSize,o.Depth,o.Mask,o.Pipeline,o.Transform,o.Visible,u],initialize:function(t,e,i,s){h.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new o.TransformMatrix,this.tempTransformMatrix=new o.TransformMatrix,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.initPipeline(),this.setPosition(e,i),this.clearAlpha(),this.setBlendMode(n.SKIP_CHECK),s&&this.add(s)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new l),t.setTo(this.x,this.y,0,0),this.parentContainer){var e=this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x,this.y);t.setTo(e.x,e.y,0,0)}if(this.list.length>0){var i=this.list,s=new l,n=!1;t.setEmpty();for(var r=0;r-1},setAll:function(t,e,i,n){return s.SetAll(this.list,t,e,i,n),this},each:function(t,e){var i,s=[null],n=this.list.slice(),r=n.length;for(i=2;i0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[]}});t.exports=p},13916:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e);var n=e.list;if(0!==n.length){var r=e.localTransform;s?(r.loadIdentity(),r.multiply(s),r.translate(e.x,e.y),r.rotate(e.rotation),r.scale(e.scaleX,e.scaleY)):r.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var o=-1!==e.blendMode;o||t.setBlendMode(0);var a=e._alpha,h=e.scrollFactorX,l=e.scrollFactorY;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var u=0;u{var s=i(88933),n=i(70339),r=i(99325),o=i(20494);r.register("container",(function(t,e){void 0===t&&(t={});var i=o(t,"x",0),r=o(t,"y",0),a=o(t,"children",null),h=new n(this.scene,i,r,a);return void 0!==e&&(t.add=e),s(this.scene,h,t),h}))},23400:(t,e,i)=>{var s=i(70339);i(61286).register("container",(function(t,e,i){return this.displayList.add(new s(this.scene,t,e,i))}))},98524:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(36934),r=i(13916),t.exports={renderWebGL:n,renderCanvas:r}},36934:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e);var n=e.list,r=n.length;if(0!==r){var o=e.localTransform;s?(o.loadIdentity(),o.multiply(s),o.translate(e.x,e.y),o.rotate(e.rotation),o.scale(e.scaleX,e.scaleY)):o.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),t.pipelines.preBatch(e);var a=-1!==e.blendMode;a||t.setBlendMode(0);for(var h=e.alpha,l=e.scrollFactorX,u=e.scrollFactorY,c=0;c{t.exports=["normal","multiply","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]},38943:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(11603),o=i(89980),a=i(42911),h=i(55638),l=i(7599),u=i(51729),c=new s({Extends:o,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Origin,n.ScrollFactor,n.Transform,n.Visible,r],initialize:function(t,e,i,s,n,r){o.call(this,t,"DOMElement"),this.parent=t.sys.game.domContainer,this.cache=t.sys.cache.html,this.node,this.transformOnly=!1,this.skewX=0,this.skewY=0,this.rotate3d=new u,this.rotate3dAngle="deg",this.pointerEvents="auto",this.width=0,this.height=0,this.displayWidth=0,this.displayHeight=0,this.handler=this.dispatchNativeEvent.bind(this),this.setPosition(e,i),"string"==typeof s?"#"===s[0]?this.setElement(s.substr(1),n,r):this.createElement(s,n,r):s&&this.setElement(s,n,r),t.sys.events.on(l.SLEEP,this.handleSceneEvent,this),t.sys.events.on(l.WAKE,this.handleSceneEvent,this),t.sys.events.on(l.PRE_RENDER,this.preRender,this)},handleSceneEvent:function(t){var e=this.node,i=e.style;e&&(i.display=t.settings.visible?"block":"none")},setSkew:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.skewX=t,this.skewY=e,this},setPerspective:function(t){return this.parent.style.perspective=t+"px",this},perspective:{get:function(){return parseFloat(this.parent.style.perspective)},set:function(t){this.parent.style.perspective=t+"px"}},addListener:function(t){if(this.node){t=t.split(" ");for(var e=0;e{var s=i(2452),n=i(89980),r=i(69360),o=new r,a=new r,h=new r;t.exports=function(t,e,i,r){if(e.node){var l=e.node.style,u=e.scene.sys.settings;if(!l||!u.visible||n.RENDER_MASK!==e.renderFlags||0!==e.cameraFilter&&e.cameraFilter&i.id||e.parentContainer&&!e.parentContainer.willRender())l.display="none";else{var c=e.parentContainer,d=i.alpha*e.alpha;c&&(d*=c.alpha);var p=o,f=a,v=h,g=0,m=0,y="0%",x="0%";r?(g=e.width*e.scaleX*e.originX,m=e.height*e.scaleY*e.originY,f.applyITRS(e.x-g,e.y-m,e.rotation,e.scaleX,e.scaleY),p.copyFrom(i.matrix),p.multiplyWithOffset(r,-i.scrollX*e.scrollFactorX,-i.scrollY*e.scrollFactorY),f.e=e.x-g,f.f=e.y-m,p.multiply(f,v)):(g=e.width*e.originX,m=e.height*e.originY,f.applyITRS(e.x-g,e.y-m,e.rotation,e.scaleX,e.scaleY),p.copyFrom(i.matrix),y=100*e.originX+"%",x=100*e.originY+"%",f.e-=i.scrollX*e.scrollFactorX,f.f-=i.scrollY*e.scrollFactorY,p.multiply(f,v)),e.transformOnly||(l.display="block",l.opacity=d,l.zIndex=e._depth,l.pointerEvents=e.pointerEvents,l.mixBlendMode=s[e._blendMode]),l.transform=v.getCSSMatrix()+" skew("+e.skewX+"rad, "+e.skewY+"rad) rotate3d("+e.rotate3d.x+","+e.rotate3d.y+","+e.rotate3d.z+","+e.rotate3d.w+e.rotate3dAngle+")",l.transformOrigin=y+" "+x}}}},66788:(t,e,i)=>{var s=i(38943);i(61286).register("dom",(function(t,e,i,n,r){var o=new s(this.scene,t,e,i,n,r);return this.displayList.add(o),o}))},11603:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(66070),r=i(66070),t.exports={renderWebGL:n,renderCanvas:r}},65492:t=>{t.exports="addedtoscene"},98398:t=>{t.exports="destroy"},40239:t=>{t.exports="removedfromscene"},17286:t=>{t.exports="complete"},31496:t=>{t.exports="created"},89587:t=>{t.exports="error"},96342:t=>{t.exports="loop"},49614:t=>{t.exports="play"},24418:t=>{t.exports="seeked"},87318:t=>{t.exports="seeking"},61922:t=>{t.exports="stop"},13991:t=>{t.exports="timeout"},4052:t=>{t.exports="unlocked"},56631:(t,e,i)=>{t.exports={ADDED_TO_SCENE:i(65492),DESTROY:i(98398),REMOVED_FROM_SCENE:i(40239),VIDEO_COMPLETE:i(17286),VIDEO_CREATED:i(31496),VIDEO_ERROR:i(89587),VIDEO_LOOP:i(96342),VIDEO_PLAY:i(49614),VIDEO_SEEKED:i(24418),VIDEO_SEEKING:i(87318),VIDEO_STOP:i(61922),VIDEO_TIMEOUT:i(13991),VIDEO_UNLOCKED:i(4052)}},39419:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(89980),o=i(79394),a=new s({Extends:r,Mixins:[n.Alpha,n.BlendMode,n.Depth,n.Flip,n.Origin,n.ScrollFactor,n.Size,n.Texture,n.Tint,n.Transform,n.Visible,o],initialize:function(t){r.call(this,t,"Extern")},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(){},render:function(){}});t.exports=a},96699:()=>{},41155:(t,e,i)=>{var s=i(39419);i(61286).register("extern",(function(){var t=new s(this.scene);return this.displayList.add(t),t}))},79394:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(81410),r=i(96699),t.exports={renderWebGL:n,renderCanvas:r}},81410:(t,e,i)=>{var s=i(73329);t.exports=function(t,e,i,n){t.pipelines.clear();var r=s(e,i,n).calc;e.render.call(e,t,i,r),t.pipelines.rebind()}},36266:t=>{t.exports={ARC:0,BEGIN_PATH:1,CLOSE_PATH:2,FILL_RECT:3,LINE_TO:4,MOVE_TO:5,LINE_STYLE:6,FILL_STYLE:7,FILL_PATH:8,STROKE_PATH:9,FILL_TRIANGLE:10,STROKE_TRIANGLE:11,SAVE:14,RESTORE:15,TRANSLATE:16,SCALE:17,ROTATE:18,GRADIENT_FILL_STYLE:21,GRADIENT_LINE_STYLE:22}},33182:(t,e,i)=>{var s=i(51052),n=i(56694),r=i(36266),o=i(15720),a=i(69732),h=i(14975),l=i(39171),u=i(58210),c=i(45900),d=i(56584),p=i(59694),f=i(95669),v=i(89980),g=i(72632),m=i(10850),y=i(83392),x=i(60898),T=new n({Extends:v,Mixins:[o,a,h,l,u,d,p,c,x],initialize:function(t,e){var i=m(e,"x",0),s=m(e,"y",0);v.call(this,t,"Graphics"),this.setPosition(i,s),this.initPipeline(),this.displayOriginX=0,this.displayOriginY=0,this.commandBuffer=[],this.defaultFillColor=-1,this.defaultFillAlpha=1,this.defaultStrokeWidth=1,this.defaultStrokeColor=-1,this.defaultStrokeAlpha=1,this._lineWidth=1,this.setDefaultStyles(e)},setDefaultStyles:function(t){return m(t,"lineStyle",null)&&(this.defaultStrokeWidth=m(t,"lineStyle.width",1),this.defaultStrokeColor=m(t,"lineStyle.color",16777215),this.defaultStrokeAlpha=m(t,"lineStyle.alpha",1),this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha)),m(t,"fillStyle",null)&&(this.defaultFillColor=m(t,"fillStyle.color",16777215),this.defaultFillAlpha=m(t,"fillStyle.alpha",1),this.fillStyle(this.defaultFillColor,this.defaultFillAlpha)),this},lineStyle:function(t,e,i){return void 0===i&&(i=1),this.commandBuffer.push(r.LINE_STYLE,t,e,i),this._lineWidth=t,this},fillStyle:function(t,e){return void 0===e&&(e=1),this.commandBuffer.push(r.FILL_STYLE,t,e),this},fillGradientStyle:function(t,e,i,s,n,o,a,h){return void 0===n&&(n=1),void 0===o&&(o=n),void 0===a&&(a=n),void 0===h&&(h=n),this.commandBuffer.push(r.GRADIENT_FILL_STYLE,n,o,a,h,t,e,i,s),this},lineGradientStyle:function(t,e,i,s,n,o){return void 0===o&&(o=1),this.commandBuffer.push(r.GRADIENT_LINE_STYLE,t,o,e,i,s,n),this},beginPath:function(){return this.commandBuffer.push(r.BEGIN_PATH),this},closePath:function(){return this.commandBuffer.push(r.CLOSE_PATH),this},fillPath:function(){return this.commandBuffer.push(r.FILL_PATH),this},fill:function(){return this.commandBuffer.push(r.FILL_PATH),this},strokePath:function(){return this.commandBuffer.push(r.STROKE_PATH),this},stroke:function(){return this.commandBuffer.push(r.STROKE_PATH),this},fillCircleShape:function(t){return this.fillCircle(t.x,t.y,t.radius)},strokeCircleShape:function(t){return this.strokeCircle(t.x,t.y,t.radius)},fillCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,y.PI2),this.fillPath(),this},strokeCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,y.PI2),this.strokePath(),this},fillRectShape:function(t){return this.fillRect(t.x,t.y,t.width,t.height)},strokeRectShape:function(t){return this.strokeRect(t.x,t.y,t.width,t.height)},fillRect:function(t,e,i,s){return this.commandBuffer.push(r.FILL_RECT,t,e,i,s),this},strokeRect:function(t,e,i,s){var n=this._lineWidth/2,r=t-n,o=t+n;return this.beginPath(),this.moveTo(t,e),this.lineTo(t,e+s),this.strokePath(),this.beginPath(),this.moveTo(t+i,e),this.lineTo(t+i,e+s),this.strokePath(),this.beginPath(),this.moveTo(r,e),this.lineTo(o+i,e),this.strokePath(),this.beginPath(),this.moveTo(r,e+s),this.lineTo(o+i,e+s),this.strokePath(),this},fillRoundedRect:function(t,e,i,s,n){void 0===n&&(n=20);var r=n,o=n,a=n,h=n;return"number"!=typeof n&&(r=g(n,"tl",20),o=g(n,"tr",20),a=g(n,"bl",20),h=g(n,"br",20)),this.beginPath(),this.moveTo(t+r,e),this.lineTo(t+i-o,e),this.arc(t+i-o,e+o,o,-y.TAU,0),this.lineTo(t+i,e+s-h),this.arc(t+i-h,e+s-h,h,0,y.TAU),this.lineTo(t+a,e+s),this.arc(t+a,e+s-a,a,y.TAU,Math.PI),this.lineTo(t,e+r),this.arc(t+r,e+r,r,-Math.PI,-y.TAU),this.fillPath(),this},strokeRoundedRect:function(t,e,i,s,n){void 0===n&&(n=20);var r=n,o=n,a=n,h=n,l=Math.min(i,s)/2;return"number"!=typeof n&&(r=g(n,"tl",20),o=g(n,"tr",20),a=g(n,"bl",20),h=g(n,"br",20)),r=Math.min(r,l),o=Math.min(o,l),a=Math.min(a,l),h=Math.min(h,l),this.beginPath(),this.moveTo(t+r,e),this.lineTo(t+i-o,e),this.moveTo(t+i-o,e),this.arc(t+i-o,e+o,o,-y.TAU,0),this.lineTo(t+i,e+s-h),this.moveTo(t+i,e+s-h),this.arc(t+i-h,e+s-h,h,0,y.TAU),this.lineTo(t+a,e+s),this.moveTo(t+a,e+s),this.arc(t+a,e+s-a,a,y.TAU,Math.PI),this.lineTo(t,e+r),this.moveTo(t,e+r),this.arc(t+r,e+r,r,-Math.PI,-y.TAU),this.strokePath(),this},fillPointShape:function(t,e){return this.fillPoint(t.x,t.y,e)},fillPoint:function(t,e,i){return!i||i<1?i=1:(t-=i/2,e-=i/2),this.commandBuffer.push(r.FILL_RECT,t,e,i,i),this},fillTriangleShape:function(t){return this.fillTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},strokeTriangleShape:function(t){return this.strokeTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},fillTriangle:function(t,e,i,s,n,o){return this.commandBuffer.push(r.FILL_TRIANGLE,t,e,i,s,n,o),this},strokeTriangle:function(t,e,i,s,n,o){return this.commandBuffer.push(r.STROKE_TRIANGLE,t,e,i,s,n,o),this},strokeLineShape:function(t){return this.lineBetween(t.x1,t.y1,t.x2,t.y2)},lineBetween:function(t,e,i,s){return this.beginPath(),this.moveTo(t,e),this.lineTo(i,s),this.strokePath(),this},lineTo:function(t,e){return this.commandBuffer.push(r.LINE_TO,t,e),this},moveTo:function(t,e){return this.commandBuffer.push(r.MOVE_TO,t,e),this},strokePoints:function(t,e,i,s){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===s&&(s=t.length),this.beginPath(),this.moveTo(t[0].x,t[0].y);for(var n=1;n-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(t,e,i){var s,n,r=this.scene.sys,o=r.game.renderer;if(void 0===e&&(e=r.scale.width),void 0===i&&(i=r.scale.height),T.TargetCamera.setScene(this.scene),T.TargetCamera.setViewport(0,0,e,i),T.TargetCamera.scrollX=this.x,T.TargetCamera.scrollY=this.y,"string"==typeof t)if(r.textures.exists(t)){var a=(s=r.textures.get(t)).getSourceImage();a instanceof HTMLCanvasElement&&(n=a.getContext("2d"))}else n=(s=r.textures.createCanvas(t,e,i)).getSourceImage().getContext("2d");else t instanceof HTMLCanvasElement&&(n=t.getContext("2d"));return n&&(this.renderCanvas(o,this,T.TargetCamera,null,n,!1),s&&s.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});T.TargetCamera=new s,t.exports=T},91543:(t,e,i)=>{var s=i(36266),n=i(49584);t.exports=function(t,e,i,r,o,a){var h=e.commandBuffer,l=h.length,u=o||t.currentContext;if(0!==l&&n(t,u,e,i,r)){i.addToRenderList(e);var c=1,d=1,p=0,f=0,v=1,g=0,m=0,y=0;u.beginPath();for(var x=0;x>>16,m=(65280&p)>>>8,y=255&p,u.strokeStyle="rgba("+g+","+m+","+y+","+c+")",u.lineWidth=v,x+=3;break;case s.FILL_STYLE:f=h[x+1],d=h[x+2],g=(16711680&f)>>>16,m=(65280&f)>>>8,y=255&f,u.fillStyle="rgba("+g+","+m+","+y+","+d+")",x+=2;break;case s.BEGIN_PATH:u.beginPath();break;case s.CLOSE_PATH:u.closePath();break;case s.FILL_PATH:a||u.fill();break;case s.STROKE_PATH:a||u.stroke();break;case s.FILL_RECT:a?u.rect(h[x+1],h[x+2],h[x+3],h[x+4]):u.fillRect(h[x+1],h[x+2],h[x+3],h[x+4]),x+=4;break;case s.FILL_TRIANGLE:u.beginPath(),u.moveTo(h[x+1],h[x+2]),u.lineTo(h[x+3],h[x+4]),u.lineTo(h[x+5],h[x+6]),u.closePath(),a||u.fill(),x+=6;break;case s.STROKE_TRIANGLE:u.beginPath(),u.moveTo(h[x+1],h[x+2]),u.lineTo(h[x+3],h[x+4]),u.lineTo(h[x+5],h[x+6]),u.closePath(),a||u.stroke(),x+=6;break;case s.LINE_TO:u.lineTo(h[x+1],h[x+2]),x+=2;break;case s.MOVE_TO:u.moveTo(h[x+1],h[x+2]),x+=2;break;case s.LINE_FX_TO:u.lineTo(h[x+1],h[x+2]),x+=5;break;case s.MOVE_FX_TO:u.moveTo(h[x+1],h[x+2]),x+=5;break;case s.SAVE:u.save();break;case s.RESTORE:u.restore();break;case s.TRANSLATE:u.translate(h[x+1],h[x+2]),x+=2;break;case s.SCALE:u.scale(h[x+1],h[x+2]),x+=2;break;case s.ROTATE:u.rotate(h[x+1]),x+=1;break;case s.GRADIENT_FILL_STYLE:x+=5;break;case s.GRADIENT_LINE_STYLE:x+=6}}u.restore()}}},41286:(t,e,i)=>{var s=i(99325),n=i(33182);s.register("graphics",(function(t,e){void 0===t&&(t={}),void 0!==e&&(t.add=e);var i=new n(this.scene,t);return t.add&&this.scene.sys.displayList.add(i),i}))},13122:(t,e,i)=>{var s=i(33182);i(61286).register("graphics",(function(t){return this.displayList.add(new s(this.scene,t))}))},60898:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(34429),r=i(91543),r=i(91543),t.exports={renderWebGL:n,renderCanvas:r}},34429:(t,e,i)=>{var s=i(36266),n=i(73329),r=i(69360),o=i(75512),a=function(t,e,i){this.x=t,this.y=e,this.width=i},h=function(t,e,i){this.points=[],this.pointsLength=1,this.points[0]=new a(t,e,i)},l=[],u=new r;t.exports=function(t,e,i,r){if(0!==e.commandBuffer.length){i.addToRenderList(e);var c=t.pipelines.set(e.pipeline,e);t.pipelines.preBatch(e);for(var d=n(e,i,r).calc,p=u.loadIdentity(),f=e.commandBuffer,v=i.alpha*e.alpha,g=1,m=c.fillTint,y=c.strokeTint,x=0,T=0,w=0,b=2*Math.PI,E=[],S=0,A=!0,_=null,C=o.getTintAppendFloatAlpha,R=0;R0&&(X=X%b-b):X>b?X=b:X<0&&(X=b+X%b),null===_&&(_=new h(B+Math.cos(U)*Y,N+Math.sin(U)*Y,g),E.push(_),I+=.01);I<1+G;)w=X*I+U,x=B+Math.cos(w)*Y,T=N+Math.sin(w)*Y,_.points.push(new a(x,T,g)),I+=.01;w=X+U,x=B+Math.cos(w)*Y,T=N+Math.sin(w)*Y,_.points.push(new a(x,T,g));break;case s.FILL_RECT:c.batchFillRect(f[++R],f[++R],f[++R],f[++R],p,d);break;case s.FILL_TRIANGLE:c.batchFillTriangle(f[++R],f[++R],f[++R],f[++R],f[++R],f[++R],p,d);break;case s.STROKE_TRIANGLE:c.batchStrokeTriangle(f[++R],f[++R],f[++R],f[++R],f[++R],f[++R],g,p,d);break;case s.LINE_TO:null!==_?_.points.push(new a(f[++R],f[++R],g)):(_=new h(f[++R],f[++R],g),E.push(_));break;case s.MOVE_TO:_=new h(f[++R],f[++R],g),E.push(_);break;case s.SAVE:l.push(p.copyToArray());break;case s.RESTORE:p.copyFromArray(l.pop());break;case s.TRANSLATE:B=f[++R],N=f[++R],p.translate(B,N);break;case s.SCALE:B=f[++R],N=f[++R],p.scale(B,N);break;case s.ROTATE:p.rotate(f[++R])}t.pipelines.postBatch(e)}}},59192:(t,e,i)=>{var s=i(83979),n=i(56694),r=i(56631),o=i(6659),a=i(71608),h=i(72632),l=i(10850),u=i(42911),c=i(75757),d=i(58403),p=i(13747),f=new n({Extends:o,initialize:function(t,e,i){o.call(this),i?e&&!Array.isArray(e)&&(e=[e]):Array.isArray(e)?u(e[0])&&(i=e,e=null):u(e)&&(i=e,e=null),this.scene=t,this.children=new d,this.isParent=!0,this.type="Group",this.classType=h(i,"classType",p),this.name=h(i,"name",""),this.active=h(i,"active",!0),this.maxSize=h(i,"maxSize",-1),this.defaultKey=h(i,"defaultKey",null),this.defaultFrame=h(i,"defaultFrame",null),this.runChildUpdate=h(i,"runChildUpdate",!1),this.createCallback=h(i,"createCallback",null),this.removeCallback=h(i,"removeCallback",null),this.createMultipleCallback=h(i,"createMultipleCallback",null),this.internalCreateCallback=h(i,"internalCreateCallback",null),this.internalRemoveCallback=h(i,"internalRemoveCallback",null),e&&this.addMultiple(e),i&&this.createMultiple(i),this.on(r.ADDED_TO_SCENE,this.addedToScene,this),this.on(r.REMOVED_FROM_SCENE,this.removedFromScene,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},create:function(t,e,i,s,n,r){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.defaultKey),void 0===s&&(s=this.defaultFrame),void 0===n&&(n=!0),void 0===r&&(r=!0),this.isFull())return null;var o=new this.classType(this.scene,t,e,i,s);return o.addToDisplayList(this.scene.sys.displayList),o.addToUpdateList(),o.visible=n,o.setActive(r),this.add(o),o},createMultiple:function(t){if(this.isFull())return[];Array.isArray(t)||(t=[t]);var e=[];if(t[0].key)for(var i=0;i=0;u--)if((l=d[u]).active===i){if(++c===e)break}else l=null;return l?("number"==typeof n&&(l.x=n),"number"==typeof r&&(l.y=r),l):s?this.create(n,r,o,a,h):null},get:function(t,e,i,s,n){return this.getFirst(!1,!0,t,e,i,s,n)},getFirstAlive:function(t,e,i,s,n,r){return this.getFirst(!0,t,e,i,s,n,r)},getFirstDead:function(t,e,i,s,n,r){return this.getFirst(!1,t,e,i,s,n,r)},playAnimation:function(t,e){return s.PlayAnimation(this.children.entries,t,e),this},isFull:function(){return-1!==this.maxSize&&this.children.size>=this.maxSize},countActive:function(t){void 0===t&&(t=!0);for(var e=0,i=0;i{var s=i(99325),n=i(59192);s.register("group",(function(t){return new n(this.scene,null,t)}))},62598:(t,e,i)=>{var s=i(59192);i(61286).register("group",(function(t,e){return this.updateList.add(new s(this.scene,t,e))}))},1539:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(89980),o=i(57322),a=new s({Extends:r,Mixins:[n.Alpha,n.BlendMode,n.Depth,n.Flip,n.FX,n.GetBounds,n.Mask,n.Origin,n.Pipeline,n.ScrollFactor,n.Size,n.TextureCrop,n.Tint,n.Transform,n.Visible,o],initialize:function(t,e,i,s,n){r.call(this,t,"Image"),this._crop=this.resetCropObject(),this.setTexture(s,n),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline()}});t.exports=a},57786:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),t.batchSprite(e,e.frame,i,s)}},83556:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(1539);n.register("image",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"frame",null),a=new o(this.scene,0,0,i,n);return void 0!==e&&(t.add=e),s(this.scene,a,t),a}))},20927:(t,e,i)=>{var s=i(1539);i(61286).register("image",(function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))}))},57322:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(59390),r=i(57786),t.exports={renderWebGL:n,renderCanvas:r}},59390:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),this.pipeline.batchSprite(e,i,s)}},48013:(t,e,i)=>{var s={Events:i(56631),DisplayList:i(91713),GameObjectCreator:i(99325),GameObjectFactory:i(61286),UpdateList:i(92034),Components:i(64937),GetCalcMatrix:i(73329),BuildGameObject:i(88933),BuildGameObjectAnimation:i(32291),GameObject:i(89980),BitmapText:i(44616),Blitter:i(52816),Bob:i(41664),Container:i(70339),DOMElement:i(38943),DynamicBitmapText:i(13468),Extern:i(39419),Graphics:i(33182),Group:i(59192),Image:i(1539),Layer:i(85305),Particles:i(27684),PathFollower:i(29598),RenderTexture:i(15996),RetroFont:i(55873),Rope:i(79968),Sprite:i(13747),Text:i(76555),GetTextSize:i(32979),MeasureText:i(27030),TextStyle:i(74744),TileSprite:i(35856),Zone:i(71030),Video:i(8630),Shape:i(91461),Arc:i(28593),Curve:i(15220),Ellipse:i(28591),Grid:i(39169),IsoBox:i(4415),IsoTriangle:i(65159),Line:i(579),Polygon:i(91249),Rectangle:i(517),Star:i(77843),Triangle:i(21873),Factories:{Blitter:i(38906),Container:i(23400),DOMElement:i(66788),DynamicBitmapText:i(94145),Extern:i(41155),Graphics:i(13122),Group:i(62598),Image:i(20927),Layer:i(17676),Particles:i(30439),PathFollower:i(19626),RenderTexture:i(29599),Rope:i(31982),Sprite:i(66135),StaticBitmapText:i(21797),Text:i(94627),TileSprite:i(20509),Zone:i(34546),Video:i(215),Arc:i(10369),Curve:i(10147),Ellipse:i(99869),Grid:i(9326),IsoBox:i(88154),IsoTriangle:i(67765),Line:i(85665),Polygon:i(88203),Rectangle:i(94355),Star:i(23962),Triangle:i(79296)},Creators:{Blitter:i(68452),Container:i(44516),DynamicBitmapText:i(67513),Graphics:i(41286),Group:i(61295),Image:i(83556),Layer:i(56378),Particles:i(38842),RenderTexture:i(85692),Rope:i(96027),Sprite:i(89219),StaticBitmapText:i(95499),Text:i(75397),TileSprite:i(63950),Zone:i(24067),Video:i(65601)}};s.Shader=i(27902),s.Mesh=i(83321),s.PointLight=i(13171),s.Factories.Shader=i(51979),s.Factories.Mesh=i(8767),s.Factories.PointLight=i(91201),s.Creators.Shader=i(13908),s.Creators.Mesh=i(41839),s.Creators.PointLight=i(162),s.Light=i(14455),s.LightsManager=i(26193),s.LightsPlugin=i(50296),t.exports=s},85305:(t,e,i)=>{var s=i(95723),n=i(56694),r=i(64937),o=i(48129),a=i(81078),h=i(6659),l=i(56631),u=i(71207),c=i(58010),d=i(7599),p=i(17922),f=new n({Extends:u,Mixins:[r.AlphaSingle,r.BlendMode,r.Depth,r.Mask,r.Pipeline,r.Visible,h,c],initialize:function(t,e){u.call(this,t),h.call(this),this.scene=t,this.displayList=null,this.type="Layer",this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.systems=t.sys,this.events=t.sys.events,this.sortChildrenFlag=!1,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.initPipeline(),this.clearAlpha(),this.setBlendMode(s.SKIP_CHECK),e&&this.add(e),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new a(this)),this},setData:function(t,e){return this.data||(this.data=new a(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new a(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new a(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new a(this)),this.data.get(t)},setInteractive:function(){return this},disableInteractive:function(){return this},removeInteractive:function(){return this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return o(this)},willRender:function(t){return!(15!==this.renderFlags||0===this.list.length||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return i.unshift(this.displayList.getIndex(t)),i},addChildCallback:function(t){t.displayList&&t.displayList!==this&&t.removeFromDisplayList(),t.displayList||(this.queueDepthSort(),t.displayList=this,t.emit(l.ADDED_TO_SCENE,t,this.scene),this.events.emit(d.ADDED_TO_SCENE,t,this.scene))},removeChildCallback:function(t){this.queueDepthSort(),t.displayList=null,t.emit(l.REMOVED_FROM_SCENE,t,this.scene),this.events.emit(d.REMOVED_FROM_SCENE,t,this.scene)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(p(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},getChildren:function(){return this.list},addToDisplayList:function(t){return void 0===t&&(t=this.scene.sys.displayList),this.displayList&&this.displayList!==t&&this.removeFromDisplayList(),t.exists(this)||(this.displayList=t,t.add(this,!0),t.queueDepthSort(),this.emit(l.ADDED_TO_SCENE,this,this.scene),t.events.emit(d.ADDED_TO_SCENE,this,this.scene)),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(l.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(d.REMOVED_FROM_SCENE,this,this.scene)),this},destroy:function(t){if(this.scene&&!this.ignoreDestroy){this.emit(l.DESTROY,this);for(var e=this.list;e.length;)e[0].destroy(t);this.removeAllListeners(),this.resetPostPipeline(!0),this.displayList&&(this.displayList.remove(this,!0),this.displayList.queueDepthSort()),this.data&&(this.data.destroy(),this.data=void 0),this.active=!1,this.visible=!1,this.list=void 0,this.scene=void 0,this.displayList=void 0,this.systems=void 0,this.events=void 0}}});t.exports=f},834:t=>{t.exports=function(t,e,i){var s=e.list;if(0!==s.length){e.depthSort();var n=-1!==e.blendMode;n||t.setBlendMode(0);var r=e._alpha;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var o=0;o{var s=i(88933),n=i(85305),r=i(99325),o=i(20494);r.register("layer",(function(t,e){void 0===t&&(t={});var i=o(t,"children",null),r=new n(this.scene,i);return void 0!==e&&(t.add=e),s(this.scene,r,t),r}))},17676:(t,e,i)=>{var s=i(85305);i(61286).register("layer",(function(t){return this.displayList.add(new s(this.scene,t))}))},58010:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(17576),r=i(834),t.exports={renderWebGL:n,renderCanvas:r}},17576:t=>{t.exports=function(t,e,i){var s=e.list,n=s.length;if(0!==n){e.depthSort(),t.pipelines.preBatch(e);var r=-1!==e.blendMode;r||t.setBlendMode(0);for(var o=e.alpha,a=0;a{var s=i(26673),n=i(56694),r=i(64937),o=i(39298),a=i(75512),h=new n({Extends:s,Mixins:[r.Origin,r.ScrollFactor,r.Transform,r.Visible],initialize:function(t,e,i,n,r,a,h){s.call(this,t,e,i),this.color=new o(n,r,a),this.intensity=h,this.renderFlags=15,this.cameraFilter=0,this.setScrollFactor(1,1),this.setOrigin(),this.setDisplayOrigin(i)},displayWidth:{get:function(){return this.diameter},set:function(t){this.diameter=t}},displayHeight:{get:function(){return this.diameter},set:function(t){this.diameter=t}},width:{get:function(){return this.diameter},set:function(t){this.diameter=t}},height:{get:function(){return this.diameter},set:function(t){this.diameter=t}},willRender:function(t){return!(h.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},setColor:function(t){var e=a.getFloatsFromUintRGB(t);return this.color.set(e[0],e[1],e[2]),this},setIntensity:function(t){return this.intensity=t,this},setRadius:function(t){return this.radius=t,this}});h.RENDER_MASK=15,t.exports=h},26193:(t,e,i)=>{var s=i(26535),n=i(56694),r=i(53996),o=i(14455),a=i(13171),h=i(39298),l=i(72677),u=i(17922),c=i(75512),d=new n({initialize:function(){this.lights=[],this.ambientColor=new h(.1,.1,.1),this.active=!1,this.maxLights=-1,this.visibleLights=0},addPointLight:function(t,e,i,s,n,r){return this.systems.displayList.add(new a(this.scene,t,e,i,s,n,r))},enable:function(){return-1===this.maxLights&&(this.maxLights=this.systems.renderer.config.maxLights),this.active=!0,this},disable:function(){return this.active=!1,this},getLights:function(t){for(var e=this.lights,i=t.worldView,n=[],o=0;othis.maxLights&&(u(n,this.sortByDistance),n=n.slice(0,this.maxLights)),this.visibleLights=n.length,n},sortByDistance:function(t,e){return t.distance>=e.distance},setAmbientColor:function(t){var e=c.getFloatsFromUintRGB(t);return this.ambientColor.set(e[0],e[1],e[2]),this},getMaxVisibleLights:function(){return this.maxLights},getLightCount:function(){return this.lights.length},addLight:function(t,e,i,s,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=128),void 0===s&&(s=16777215),void 0===n&&(n=1);var r=c.getFloatsFromUintRGB(s),a=new o(t,e,i,r[0],r[1],r[2],n);return this.lights.push(a),a},removeLight:function(t){var e=this.lights.indexOf(t);return e>=0&&l(this.lights,e),this},shutdown:function(){this.lights.length=0},destroy:function(){this.shutdown()}});t.exports=d},50296:(t,e,i)=>{var s=i(56694),n=i(26193),r=i(91963),o=i(7599),a=new s({Extends:n,initialize:function(t){this.scene=t,this.systems=t.sys,t.sys.settings.isBooted||t.sys.events.once(o.BOOT,this.boot,this),n.call(this)},boot:function(){var t=this.systems.events;t.on(o.SHUTDOWN,this.shutdown,this),t.on(o.DESTROY,this.destroy,this)},destroy:function(){this.shutdown(),this.scene=void 0,this.systems=void 0}});r.register("LightsPlugin",a,"lights"),t.exports=a},83321:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(75606),o=i(18693),a=i(89980),h=i(67623),l=i(53267),u=i(73329),c=i(16650),d=i(23464),p=i(17922),f=i(70015),v=i(85769),g=new s({Extends:a,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Mask,n.Pipeline,n.Size,n.Texture,n.Transform,n.Visible,n.ScrollFactor,d],initialize:function(t,e,i,s,n,r,o,h,l,u,d,p){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s="__WHITE"),a.call(this,t,"Mesh"),this.faces=[],this.vertices=[],this.tintFill=!1,this.debugCallback=null,this.debugGraphic=null,this.hideCCW=!0,this.modelPosition=new f,this.modelScale=new f(1,1,1),this.modelRotation=new f,this.dirtyCache=[0,0,0,0,0,0,0,0,0,0,0,0],this.transformMatrix=new c,this.viewPosition=new f,this.viewMatrix=new c,this.projectionMatrix=new c,this.totalRendered=0,this.totalFrame=0,this.ignoreDirtyCache=!1;var v=t.sys.renderer;this.setPosition(e,i),this.setTexture(s,n),this.setSize(v.width,v.height),this.initPipeline(),this.setPerspective(v.width,v.height),r&&this.addVertices(r,o,h,l,u,d,p)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},panX:function(t){return this.viewPosition.addScale(f.LEFT,t),this.dirtyCache[10]=1,this},panY:function(t){return this.viewPosition.y+=f.DOWN.y*t,this.dirtyCache[10]=1,this},panZ:function(t){return this.viewPosition.z+=t,this.dirtyCache[10]=1,this},setPerspective:function(t,e,i,s,n){return void 0===i&&(i=45),void 0===s&&(s=.01),void 0===n&&(n=1e3),this.projectionMatrix.perspective(r(i),t/e,s,n),this.dirtyCache[10]=1,this.dirtyCache[11]=0,this},setOrtho:function(t,e,i,s){return void 0===t&&(t=this.scene.sys.renderer.getAspectRatio()),void 0===e&&(e=1),void 0===i&&(i=-1e3),void 0===s&&(s=1e3),this.projectionMatrix.ortho(-t,t,-e,e,i,s),this.dirtyCache[10]=1,this.dirtyCache[11]=1,this},clear:function(){return this.faces.forEach((function(t){t.destroy()})),this.faces=[],this.vertices=[],this},addVerticesFromObj:function(t,e,i,s,n,r,o,a,h){var u,c=this.scene.sys.cache.obj.get(t);return c&&(u=l(c,this,e,i,s,n,r,o,a,h)),u&&0!==u.verts.length||console.warn("Mesh.addVerticesFromObj data empty:",t),this},sortByDepth:function(t,e){return t.depth-e.depth},depthSort:function(){return p(this.faces,this.sortByDepth),this},addVertex:function(t,e,i,s,n,r,o){var a=new v(t,e,i,s,n,r,o);return this.vertices.push(a),a},addFace:function(t,e,i){var s=new o(t,e,i);return this.faces.push(s),this.dirtyCache[9]=-1,s},addVertices:function(t,e,i,s,n,r,o){var a=h(t,e,i,s,n,r,o);return a?(this.faces=this.faces.concat(a.faces),this.vertices=this.vertices.concat(a.vertices)):console.warn("Mesh.addVertices data empty or invalid"),this.dirtyCache[9]=-1,this},getFaceCount:function(){return this.faces.length},getVertexCount:function(){return this.vertices.length},getFace:function(t){return this.faces[t]},getFaceAt:function(t,e,i){void 0===i&&(i=this.scene.sys.cameras.main);for(var s=u(this,i).calc,n=this.faces,r=[],o=0;o{t.exports=function(){}},41839:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(10850),a=i(83321);n.register("mesh",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"frame",null),h=o(t,"vertices",[]),l=o(t,"uvs",[]),u=o(t,"indicies",[]),c=o(t,"containsZ",!1),d=o(t,"normals",[]),p=o(t,"colors",16777215),f=o(t,"alphas",1),v=new a(this.scene,0,0,i,n,h,l,u,c,d,p,f);return void 0!==e&&(t.add=e),s(this.scene,v,t),v}))},8767:(t,e,i)=>{var s=i(83321);i(61286).register("mesh",(function(t,e,i,n,r,o,a,h,l,u,c){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a,h,l,u,c))}))},23464:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(57410),r=i(6317),t.exports={renderWebGL:n,renderCanvas:r}},57410:(t,e,i)=>{var s=i(73329);t.exports=function(t,e,i,n){var r=e.faces,o=r.length;if(0!==o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline,e),h=s(e,i,n).calc,l=a.setGameObject(e),u=a.vertexViewF32,c=a.vertexViewU32,d=a.vertexCount*a.currentShader.vertexComponentCount-1,p=e.tintFill,f=[],v=e.debugCallback,g=h.a,m=h.b,y=h.c,x=h.d,T=h.e,w=h.f,b=e.viewPosition.z,E=e.hideCCW,S=i.roundPixels,A=i.alpha*e.alpha,_=0;t.pipelines.preBatch(e);for(var C=0;C{var s=i(56694),n=i(61616),r=i(21902),o=i(72632),a=i(1071),h=new s({initialize:function(t,e,i,s){void 0===s&&(s=!1),this.propertyKey=e,this.propertyValue=i,this.defaultValue=i,this.steps=0,this.counter=0,this.start=0,this.end=0,this.ease,this.emitOnly=s,this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,this.loadConfig(t)},loadConfig:function(t,e){void 0===t&&(t={}),e&&(this.propertyKey=e),this.propertyValue=o(t,this.propertyKey,this.defaultValue),this.setMethods(),this.emitOnly&&(this.onUpdate=this.defaultUpdate)},toJSON:function(){return this.propertyValue},onChange:function(t){return this.propertyValue=t,this.setMethods()},setMethods:function(){var t=this.propertyValue,e=typeof t;if(this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,null!==t){if("number"===e)this.onEmit=this.staticValueEmit,this.onUpdate=this.staticValueUpdate;else if(Array.isArray(t))this.onEmit=this.randomStaticValueEmit;else if("function"===e)this.emitOnly?this.onEmit=t:this.onUpdate=t;else if("object"===e&&this.hasBoth(t,"start","end")){this.start=t.start,this.end=t.end;var i=this.has(t,"random");if(i&&(this.onEmit=this.randomRangedValueEmit),this.has(t,"steps"))this.steps=t.steps,this.counter=this.start,this.onEmit=this.steppedEmit;else{var s=this.has(t,"ease")?t.ease:"Linear";this.ease=r(s,t.easeParams),i||(this.onEmit=this.easedValueEmit),this.onUpdate=this.easeValueUpdate}}else if("object"===e&&this.hasBoth(t,"min","max"))this.start=t.min,this.end=t.max,this.onEmit=this.randomRangedValueEmit;else if("object"===e&&this.has(t,"random")){var n=t.random;Array.isArray(n)&&(this.start=n[0],this.end=n[1]),this.onEmit=this.randomRangedValueEmit}else"object"===e&&this.hasEither(t,"onEmit","onUpdate")&&(this.has(t,"onEmit")&&(this.onEmit=t.onEmit),this.has(t,"onUpdate")&&(this.onUpdate=t.onUpdate));return this}},has:function(t,e){return t.hasOwnProperty(e)},hasBoth:function(t,e,i){return t.hasOwnProperty(e)&&t.hasOwnProperty(i)},hasEither:function(t,e,i){return t.hasOwnProperty(e)||t.hasOwnProperty(i)},defaultEmit:function(t,e,i){return i},defaultUpdate:function(t,e,i,s){return s},staticValueEmit:function(){return this.propertyValue},staticValueUpdate:function(){return this.propertyValue},randomStaticValueEmit:function(){var t=Math.floor(Math.random()*this.propertyValue.length);return this.propertyValue[t]},randomRangedValueEmit:function(t,e){var i=n(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i),i},steppedEmit:function(){var t=this.counter,e=this.counter+(this.end-this.start)/this.steps;return this.counter=a(e,this.start,this.end),t},easedValueEmit:function(t,e){if(t&&t.data[e]){var i=t.data[e];i.min=this.start,i.max=this.end}return this.start},easeValueUpdate:function(t,e,i){var s=t.data[e];return(s.max-s.min)*this.ease(i)+s.min}});t.exports=h},87811:(t,e,i)=>{var s=i(56694),n=i(72632),r=new s({initialize:function(t,e,i,s,r){if("object"==typeof t){var o=t;t=n(o,"x",0),e=n(o,"y",0),i=n(o,"power",0),s=n(o,"epsilon",100),r=n(o,"gravity",50)}else void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=100),void 0===r&&(r=50);this.x=t,this.y=e,this.active=!0,this._gravity=r,this._power=0,this._epsilon=0,this.power=i,this.epsilon=s},update:function(t,e){var i=this.x-t.x,s=this.y-t.y,n=i*i+s*s;if(0!==n){var r=Math.sqrt(n);n{var s=i(56694),n=i(75606),r=new s({initialize:function(t){this.emitter=t,this.frame=null,this.x=0,this.y=0,this.velocityX=0,this.velocityY=0,this.accelerationX=0,this.accelerationY=0,this.maxVelocityX=1e4,this.maxVelocityY=1e4,this.bounce=0,this.scaleX=1,this.scaleY=1,this.alpha=1,this.angle=0,this.rotation=0,this.tint=16777215,this.life=1e3,this.lifeCurrent=1e3,this.delayCurrent=0,this.lifeT=0,this.data={tint:{min:16777215,max:16777215,current:16777215},alpha:{min:1,max:1},rotate:{min:0,max:0},scaleX:{min:1,max:1},scaleY:{min:1,max:1}}},isAlive:function(){return this.lifeCurrent>0},resetPosition:function(){this.x=0,this.y=0},fire:function(t,e){var i=this.emitter;if(this.frame=i.getFrame(),!this.frame)throw new Error("Particle has no texture frame");i.emitZone&&i.emitZone.getPoint(this),this.x+=void 0===t?i.x.onEmit(this,"x"):t,this.y+=void 0===e?i.y.onEmit(this,"y"):e,this.life=i.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0;var s=i.speedX.onEmit(this,"speedX"),r=i.speedY?i.speedY.onEmit(this,"speedY"):s;if(i.radial){var o=n(i.angle.onEmit(this,"angle"));this.velocityX=Math.cos(o)*Math.abs(s),this.velocityY=Math.sin(o)*Math.abs(r)}else if(i.moveTo){var a=i.moveToX.onEmit(this,"moveToX"),h=i.moveToY?i.moveToY.onEmit(this,"moveToY"):a,l=this.life/1e3;this.velocityX=(a-this.x)/l,this.velocityY=(h-this.y)/l}else this.velocityX=s,this.velocityY=r;i.acceleration&&(this.accelerationX=i.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=i.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=i.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=i.maxVelocityY.onEmit(this,"maxVelocityY"),this.delayCurrent=i.delay.onEmit(this,"delay"),this.scaleX=i.scaleX.onEmit(this,"scaleX"),this.scaleY=i.scaleY.onEmit(this,"scaleY"),this.angle=i.rotate.onEmit(this,"rotate"),this.rotation=n(this.angle),this.bounce=i.bounce.onEmit(this,"bounce"),this.alpha=i.alpha.onEmit(this,"alpha"),this.tint=i.tint.onEmit(this,"tint")},computeVelocity:function(t,e,i,s){var n=this.velocityX,r=this.velocityY,o=this.accelerationX,a=this.accelerationY,h=this.maxVelocityX,l=this.maxVelocityY;n+=t.gravityX*i,r+=t.gravityY*i,o&&(n+=o*i),a&&(r+=a*i),n>h?n=h:n<-h&&(n=-h),r>l?r=l:r<-l&&(r=-l),this.velocityX=n,this.velocityY=r;for(var u=0;ue.right&&t.collideRight&&(this.x=e.right,this.velocityX*=i),this.ye.bottom&&t.collideBottom&&(this.y=e.bottom,this.velocityY*=i)},update:function(t,e,i){if(this.delayCurrent>0)return this.delayCurrent-=t,!1;var s=this.emitter,r=1-this.lifeCurrent/this.life;return this.lifeT=r,this.computeVelocity(s,t,e,i),this.x+=this.velocityX*e,this.y+=this.velocityY*e,s.bounds&&this.checkBounds(s),s.deathZone&&s.deathZone.willKill(this)?(this.lifeCurrent=0,!0):(this.scaleX=s.scaleX.onUpdate(this,"scaleX",r,this.scaleX),this.scaleY=s.scaleY.onUpdate(this,"scaleY",r,this.scaleY),this.angle=s.rotate.onUpdate(this,"rotate",r,this.angle),this.rotation=n(this.angle),this.alpha=s.alpha.onUpdate(this,"alpha",r,this.alpha),this.tint=s.tint.onUpdate(this,"tint",r,this.tint),this.lifeCurrent-=t,this.lifeCurrent<=0)}});t.exports=r},9216:(t,e,i)=>{var s=i(95723),n=i(56694),r=i(64937),o=i(69361),a=i(54213),h=i(93025),l=i(72632),u=i(72861),c=i(53523),d=i(19256),p=i(14909),f=i(68433),v=i(74118),g=i(17922),m=i(93736),y=i(1071),x=new n({Mixins:[r.BlendMode,r.Mask,r.ScrollFactor,r.Visible],initialize:function(t,e){this.manager=t,this.texture=t.texture,this.frames=[t.defaultFrame],this.defaultFrame=t.defaultFrame,this.configFastMap=["active","blendMode","collideBottom","collideLeft","collideRight","collideTop","deathCallback","deathCallbackScope","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxParticles","maxAliveParticles","name","on","particleBringToTop","particleClass","radial","timeScale","trackVisible","visible"],this.configOpMap=["accelerationX","accelerationY","angle","alpha","bounce","delay","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],this.name="",this.particleClass=p,this.x=new h(e,"x",0,!0),this.y=new h(e,"y",0,!0),this.radial=!0,this.gravityX=0,this.gravityY=0,this.acceleration=!1,this.accelerationX=new h(e,"accelerationX",0,!0),this.accelerationY=new h(e,"accelerationY",0,!0),this.maxVelocityX=new h(e,"maxVelocityX",1e4,!0),this.maxVelocityY=new h(e,"maxVelocityY",1e4,!0),this.speedX=new h(e,"speedX",0,!0),this.speedY=new h(e,"speedY",0,!0),this.moveTo=!1,this.moveToX=new h(e,"moveToX",null,!0),this.moveToY=new h(e,"moveToY",null,!0),this.bounce=new h(e,"bounce",0,!0),this.scaleX=new h(e,"scaleX",1),this.scaleY=new h(e,"scaleY",1),this.tint=new h(e,"tint",16777215),this.alpha=new h(e,"alpha",1),this.lifespan=new h(e,"lifespan",1e3,!0),this.angle=new h(e,"angle",{min:0,max:360},!0),this.rotate=new h(e,"rotate",0),this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.maxParticles=0,this.maxAliveParticles=0,this.quantity=new h(e,"quantity",1,!0),this.delay=new h(e,"delay",0,!0),this.frequency=0,this.on=!0,this.particleBringToTop=!0,this.timeScale=1,this.emitZone=null,this.deathZone=null,this.bounds=null,this.collideLeft=!0,this.collideRight=!0,this.collideTop=!0,this.collideBottom=!0,this.active=!0,this.visible=!0,this.blendMode=s.NORMAL,this.follow=null,this.followOffset=new m,this.trackVisible=!1,this.currentFrame=0,this.randomFrame=!0,this.frameQuantity=1,this.dead=[],this.alive=[],this._counter=0,this._frameCounter=0,e&&this.fromJSON(e)},fromJSON:function(t){if(!t)return this;var e=0,i="";for(e=0;e0&&this.getParticleCount()>=this.maxParticles||this.maxAliveParticles>0&&this.getAliveParticleCount()>=this.maxAliveParticles},onParticleEmit:function(t,e){return void 0===t?(this.emitCallback=null,this.emitCallbackScope=null):"function"==typeof t&&(this.emitCallback=t,e&&(this.emitCallbackScope=e)),this},onParticleDeath:function(t,e){return void 0===t?(this.deathCallback=null,this.deathCallbackScope=null):"function"==typeof t&&(this.deathCallback=t,e&&(this.deathCallbackScope=e)),this},killAll:function(){for(var t=this.dead,e=this.alive;e.length>0;)t.push(e.pop());return this},forEachAlive:function(t,e){for(var i=this.alive,s=i.length,n=0;n0){var u=this.deathCallback,c=this.deathCallbackScope;for(o=h-1;o>=0;o--){var d=a[o];n.splice(d.index,1),r.push(d.particle),u&&u.call(c,d.particle),d.particle.resetPosition()}}if(this.on)if(0===this.frequency)this.emitParticle();else if(this.frequency>0)for(this._counter-=e;this._counter<=0;)this.emitParticle(),this._counter+=this.frequency},depthSortCallback:function(t,e){return t.y-e.y}});t.exports=x},84622:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(89980),o=i(87811),a=i(71207),h=i(9216),l=i(72745),u=new s({Extends:r,Mixins:[n.Depth,n.Mask,n.Pipeline,n.Transform,n.Visible,l],initialize:function(t,e,i,s){if(r.call(this,t,"ParticleEmitterManager"),this.blendMode=-1,this.timeScale=1,this.texture=null,this.frame=null,this.frameNames=[],null===i||"object"!=typeof i&&!Array.isArray(i)||(s=i,i=null),this.setTexture(e,i),this.initPipeline(),this.emitters=new a(this),this.wells=new a(this),s){Array.isArray(s)||(s=[s]);for(var n=0;n0?e.defaultFrame=i[0]:(console.warn("No texture frames were set"),e.defaultFrame=this.defaultFrame),this},addEmitter:function(t){return this.emitters.add(t)},createEmitter:function(t){return this.addEmitter(new h(this,t))},removeEmitter:function(t){return this.emitters.remove(t,!0)},addGravityWell:function(t){return this.wells.add(t)},createGravityWell:function(t){return this.addGravityWell(new o(t))},emitParticle:function(t,e,i){for(var s=this.emitters.list,n=0;n{var s=i(69360),n=new s,r=new s,o=new s,a=new s;t.exports=function(t,e,i,s){var h=e.emitters.list,l=h.length;if(0!==l){var u=n.copyFrom(i.matrix),c=r,d=o,p=a;s?(p.loadIdentity(),p.multiply(s),p.translate(e.x,e.y),p.rotate(e.rotation),p.scale(e.scaleX,e.scaleY)):p.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);for(var f=t.currentContext,v=i.roundPixels,g=0;g0&&_.height>0){var C=-A.halfWidth,R=-A.halfHeight;f.globalAlpha=S,f.save(),c.setToContext(f),v&&(C=Math.round(C),R=Math.round(R)),f.imageSmoothingEnabled=!A.source.scaleMode,f.drawImage(A.source.image,_.x,_.y,_.width,_.height,C,R,_.width,_.height),f.restore()}}}f.restore()}}}}},38842:(t,e,i)=>{var s=i(99325),n=i(20494),r=i(72632),o=i(84622);s.register("particles",(function(t,e){void 0===t&&(t={});var i=n(t,"key",null),s=n(t,"frame",null),a=r(t,"emitters",null),h=new o(this.scene,i,s,a);return void 0!==e&&(t.add=e),r(t,"add",!1)?this.displayList.add(h):this.updateList.add(h),h}))},30439:(t,e,i)=>{var s=i(61286),n=i(84622);s.register("particles",(function(t,e,i){return this.displayList.add(new n(this.scene,t,e,i))}))},72745:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(58971),r=i(66545),t.exports={renderWebGL:n,renderCanvas:r}},58971:(t,e,i)=>{var s=i(69360),n=i(75512),r=new s,o=new s,a=new s,h=new s;t.exports=function(t,e,i,s){var l=e.emitters.list,u=l.length;if(0!==u){var c=t.pipelines.set(e.pipeline),d=r,p=o,f=a,v=h;s?(v.loadIdentity(),v.multiply(s),v.translate(e.x,e.y),v.rotate(e.rotation),v.scale(e.scaleX,e.scaleY)):v.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var g=i.roundPixels,m=e.defaultFrame.glTexture,y=n.getTintAppendFloatAlpha,x=c.setGameObject(e,e.defaultFrame);t.pipelines.preBatch(e);for(var T=0;T{t.exports={EmitterOp:i(93025),GravityWell:i(87811),Particle:i(14909),ParticleEmitter:i(9216),ParticleEmitterManager:i(84622),Zones:i(25962)}},69361:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e){this.source=t,this.killOnEnter=e},willKill:function(t){var e=this.source.contains(t.x,t.y);return e&&this.killOnEnter||!e&&!this.killOnEnter}});t.exports=s},54213:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s,n){void 0===s&&(s=!1),void 0===n&&(n=!0),this.source=t,this.points=[],this.quantity=e,this.stepRate=i,this.yoyo=s,this.counter=-1,this.seamless=n,this._length=0,this._direction=0,this.updateSource()},updateSource:function(){if(this.points=this.source.getPoints(this.quantity,this.stepRate),this.seamless){var t=this.points[0],e=this.points[this.points.length-1];t.x===e.x&&t.y===e.y&&this.points.pop()}var i=this._length;return this._length=this.points.length,this._lengththis._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=s},68433:(t,e,i)=>{var s=i(56694),n=i(93736),r=new s({initialize:function(t){this.source=t,this._tempVec=new n},getPoint:function(t){var e=this._tempVec;this.source.getRandomPoint(e),t.x=e.x,t.y=e.y}});t.exports=r},25962:(t,e,i)=>{t.exports={DeathZone:i(69361),EdgeZone:i(54213),RandomZone:i(68433)}},29598:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(13747),o=new s({Extends:r,Mixins:[n.PathFollower],initialize:function(t,e,i,s,n,o){r.call(this,t,i,s,n,o),this.path=e},preUpdate:function(t,e){this.anims.update(t,e),this.pathUpdate(t)}});t.exports=o},19626:(t,e,i)=>{var s=i(61286),n=i(29598);s.register("follower",(function(t,e,i,s,r){var o=new n(this.scene,t,e,i,s,r);return this.displayList.add(o),this.updateList.add(o),o}))},13171:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(89980),o=i(74853),a=i(65641),h=i(71606),l=new s({Extends:r,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Mask,n.Pipeline,n.ScrollFactor,n.Transform,n.Visible,h],initialize:function(t,e,i,s,n,h,l){void 0===s&&(s=16777215),void 0===n&&(n=128),void 0===h&&(h=1),void 0===l&&(l=.1),r.call(this,t,"PointLight"),this.initPipeline(a.POINTLIGHT_PIPELINE),this.setPosition(e,i),this.color=o(s),this.intensity=h,this.attenuation=l,this.width=2*n,this.height=2*n,this._radius=n},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this.width=2*t,this.height=2*t}},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return this._radius}},displayOriginY:{get:function(){return this._radius}}});t.exports=l},162:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(13171);n.register("pointlight",(function(t,e){void 0===t&&(t={});var i=r(t,"color",16777215),n=r(t,"radius",128),a=r(t,"intensity",1),h=r(t,"attenuation",.1),l=new o(this.scene,0,0,i,n,a,h);return void 0!==e&&(t.add=e),s(this.scene,l,t),l}))},91201:(t,e,i)=>{var s=i(61286),n=i(13171);s.register("pointlight",(function(t,e,i,s,r,o){return this.displayList.add(new n(this.scene,t,e,i,s,r,o))}))},71606:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(80590),t.exports={renderWebGL:n,renderCanvas:r}},80590:(t,e,i)=>{var s=i(73329);t.exports=function(t,e,i,n){i.addToRenderList(e);var r=t.pipelines.set(e.pipeline),o=s(e,i,n).calc,a=e.width,h=e.height,l=-e._radius,u=-e._radius,c=l+a,d=u+h,p=o.getX(0,0),f=o.getY(0,0),v=o.getX(l,u),g=o.getY(l,u),m=o.getX(l,d),y=o.getY(l,d),x=o.getX(c,d),T=o.getY(c,d),w=o.getX(c,u),b=o.getY(c,u);t.pipelines.preBatch(e),r.batchPointLight(e,i,v,g,m,y,x,T,w,b,p,f),t.pipelines.postBatch(e)}},15996:(t,e,i)=>{var s=i(95723),n=i(51052),r=i(61068),o=i(56694),a=i(64937),h=i(86459),l=i(82047),u=i(89980),c=i(72283),d=i(65641),p=i(92675),f=i(37410),v=i(75512),g=i(76583),m=new o({Extends:u,Mixins:[a.Alpha,a.BlendMode,a.ComputedSize,a.Crop,a.Depth,a.Flip,a.FX,a.GetBounds,a.Mask,a.Origin,a.Pipeline,a.ScrollFactor,a.Tint,a.Transform,a.Visible,p],initialize:function(t,e,i,s,o,a,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=32),void 0===o&&(o=32),u.call(this,t,"RenderTexture"),this.renderer=t.sys.renderer,this.textureManager=t.sys.textures,this.globalTint=16777215,this.globalAlpha=1,this.canvas=null,this.dirty=!1,this._crop=this.resetCropObject(),this.texture=null,this.frame=null,this._saved=!1,this.isSpriteTexture=!1,void 0===a?(this.canvas=r.create2D(this,s,o),this.texture=t.sys.textures.addCanvas(g(),this.canvas),this.frame=this.texture.get()):(this.texture=t.sys.textures.get(a),this.frame=this.texture.get(l),this.canvas=this.frame.source.image,this._saved=!0,this.dirty=!0,this.width=this.frame.cutWidth,this.height=this.frame.cutHeight),this.context=this.canvas.getContext("2d"),this._eraseMode=!1,this.camera=new n(0,0,s,o),this.renderTarget=null;var p=this.renderer;p?p.type===h.WEBGL?(this.drawGameObject=this.batchGameObjectWebGL,this.renderTarget=new f(p,s,o,1,0,!1),this.setFlipY(this.isSpriteTexture)):p.type===h.CANVAS&&(this.drawGameObject=this.batchGameObjectCanvas):this.drawGameObject=c,this.camera.setScene(t),this.setPosition(e,i),void 0===a&&this.setSize(s,o),this.setOrigin(0,0),this.initPipeline(d.SINGLE_PIPELINE)},setSize:function(t,e){return this.resize(t,e)},setIsSpriteTexture:function(t){return this.isSpriteTexture=t,this.setFlipY(t),this},resize:function(t,e){void 0===e&&(e=t);var i=this.frame;if(t!==this.width||e!==this.height){if("__BASE"===i.name){this.canvas.width=t,this.canvas.height=e,this.texture.width=t,this.texture.height=e;var s=this.renderTarget;s&&(s.resize(t,e),i.glTexture=s.texture,i.source.isRenderTexture=!0,i.source.isGLTexture=!0,i.source.glTexture=s.texture,i.source.glTexture.flipY=!0),this.camera.setSize(t,e),i.source.width=t,i.source.height=e,i.setSize(t,e),this.width=t,this.height=e}}else{var n=this.texture.getSourceImage();i.cutX+t>n.width&&(t=n.width-i.cutX),i.cutY+e>n.height&&(e=n.height-i.cutY),i.setSize(t,e,i.cutX,i.cutY)}this.updateDisplayOrigin();var r=this.input;return r&&!r.customHitArea&&(r.hitArea.width=t,r.hitArea.height=e),this},setGlobalTint:function(t){return this.globalTint=t,this},setGlobalAlpha:function(t){return this.globalAlpha=t,this},saveTexture:function(t){return this.textureManager.renameTexture(this.texture.key,t),this._saved=!0,this.texture},fill:function(t,e,i,s,n,r){var o=this.frame,a=this.camera,h=this.renderer;void 0===e&&(e=1),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=o.cutWidth),void 0===r&&(r=o.cutHeight);var l=t>>16&255,u=t>>8&255,c=255&t,d=this.renderTarget;if(a.preRender(),d){d.bind(!0);var p=this.pipeline;p.manager.set(p);var f=d.width,g=d.height,m=h.width/f,y=h.height/g;p.drawFillRect(i*m,s*y,n*m,r*y,v.getTintFromFloats(c/255,u/255,l/255,1),e),d.unbind(!0)}else{var x=this.context;h.setContext(x),x.fillStyle="rgba("+l+","+u+","+c+","+e+")",x.fillRect(i+o.cutX,s+o.cutY,n,r),h.setContext()}return this.dirty=!0,this},clear:function(){if(this.dirty){var t=this.renderTarget;if(t)t.clear();else{var e=this.context;e.save(),e.setTransform(1,0,0,1,0,0),e.clearRect(this.frame.cutX,this.frame.cutY,this.frame.cutWidth,this.frame.cutHeight),e.restore()}this.dirty=!1}return this},erase:function(t,e,i){return this._eraseMode=!0,this.draw(t,e,i,1,16777215),this._eraseMode=!1,this},draw:function(t,e,i,s,n){return this.beginDraw(),this.batchDraw(t,e,i,s,n),this.endDraw(),this},drawFrame:function(t,e,i,s,n,r){return this.beginDraw(),this.batchDrawFrame(t,e,i,s,n,r),this.endDraw(),this},fillFrame:function(t,e,i,s,n,r){void 0===i&&(i=0),void 0===s&&(s=0);var o=this.textureManager.getFrame(t,e);if(o){this.beginDraw();for(var a=s;a>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(n>>16)+(65280&n)+((255&n)<<16),Array.isArray(t)||(t=[t]),this.batchList(t,e,i,s,n),this},batchDrawFrame:function(t,e,i,s,n,r){void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=this.globalAlpha),r=void 0===r?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(r>>16)+(65280&r)+((255&r)<<16);var o=this.textureManager.getFrame(t,e);return o&&(this.renderTarget?this.pipeline.batchTextureFrame(o,i,s,r,n,this.camera.matrix,null):this.batchTextureFrame(o,i+this.frame.cutX,s+this.frame.cutY,n,r)),this},endDraw:function(t){void 0===t&&(t=this._eraseMode);var e=this.renderer,i=this.renderTarget;if(i){var s=e.endCapture();e.pipelines.setUtility().blitFrame(s,i,1,!1,!1,t,this.isSpriteTexture),e.resetScissor(),e.resetViewport()}else e.setContext();return this.dirty=!0,this},batchList:function(t,e,i,s,n){for(var r=0;r0&&o.height>0&&r.drawImage(a,o.x,o.y,o.width,o.height,e,i,o.width,o.height),r.restore()}},snapshotArea:function(t,e,i,s,n,r,o){return this.renderTarget?this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer,this.width,this.height,n,!1,t,e,i,s,r,o):this.renderer.snapshotCanvas(this.canvas,n,!1,t,e,i,s,r,o),this},snapshot:function(t,e,i){return this.renderTarget?this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer,this.width,this.height,t,!1,0,0,this.width,this.height,e,i):this.renderer.snapshotCanvas(this.canvas,t,!1,0,0,this.width,this.height,e,i),this},snapshotPixel:function(t,e,i){return this.renderTarget?this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer,this.width,this.height,i,!0,t,e):this.renderer.snapshotCanvas(this.canvas,i,!0,t,e),this},preDestroy:function(){this._saved||(r.remove(this.canvas),this.renderTarget&&this.renderTarget.destroy(),this.texture.destroy(),this.camera.destroy(),this.canvas=null,this.context=null,this.texture=null)}});t.exports=m},43267:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),t.batchSprite(e,e.frame,i,s)}},85692:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(15996);n.register("renderTexture",(function(t,e){void 0===t&&(t={});var i=r(t,"x",0),n=r(t,"y",0),a=r(t,"width",32),h=r(t,"height",32),l=r(t,"key",void 0),u=r(t,"frame",void 0),c=new o(this.scene,i,n,a,h,l,u);return void 0!==e&&(t.add=e),s(this.scene,c,t),c}))},29599:(t,e,i)=>{var s=i(61286),n=i(15996);s.register("renderTexture",(function(t,e,i,s,r,o){return this.displayList.add(new n(this.scene,t,e,i,s,r,o))}))},92675:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(46823),r=i(43267),t.exports={renderWebGL:n,renderCanvas:r}},46823:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i,n){i.addToRenderList(e);var r=i.alpha,o=e.renderTarget,a=o.width,h=o.height,l=s.getTintAppendFloatAlpha,u=t.pipelines.set(e.pipeline),c=u.setTexture2D(o.texture);u.batchTexture(e,o.texture,a,h,e.x,e.y,a,h,e.scaleX,e.scaleY,e.rotation,e.flipX,!e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,a,h,l(e.tintTopLeft,r*e._alphaTL),l(e.tintTopRight,r*e._alphaTR),l(e.tintBottomLeft,r*e._alphaBL),l(e.tintBottomRight,r*e._alphaBR),e.tintFill,0,0,i,n,!0,c),t.resetTextures()}},79968:(t,e,i)=>{var s=i(16569),n=i(56694),r=i(64937),o=i(89980),a=i(65641),h=i(58912),l=i(93736),u=new n({Extends:o,Mixins:[r.AlphaSingle,r.BlendMode,r.Depth,r.Flip,r.Mask,r.Pipeline,r.Size,r.Texture,r.Transform,r.Visible,r.ScrollFactor,h],initialize:function(t,e,i,n,r,h,u,c,d){void 0===n&&(n="__DEFAULT"),void 0===h&&(h=2),void 0===u&&(u=!0),o.call(this,t,"Rope"),this.anims=new s(this),this.points=h,this.vertices,this.uv,this.colors,this.alphas,this.tintFill="__DEFAULT"===n,this.dirty=!1,this.horizontal=u,this._flipX=!1,this._flipY=!1,this._perp=new l,this.debugCallback=null,this.debugGraphic=null,this.setTexture(n,r),this.setPosition(e,i),this.setSizeToFrame(),this.initPipeline(a.ROPE_PIPELINE),Array.isArray(h)&&this.resizeArrays(h.length),this.setPoints(h,c,d),this.updateVertices()},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){var i=this.anims.currentFrame;this.anims.update(t,e),this.anims.currentFrame!==i&&(this.updateUVs(),this.updateVertices())},play:function(t,e,i){return this.anims.play(t,e,i),this},setDirty:function(){return this.dirty=!0,this},setHorizontal:function(t,e,i){return void 0===t&&(t=this.points.length),this.horizontal?this:(this.horizontal=!0,this.setPoints(t,e,i))},setVertical:function(t,e,i){return void 0===t&&(t=this.points.length),this.horizontal?(this.horizontal=!1,this.setPoints(t,e,i)):this},setTintFill:function(t){return void 0===t&&(t=!1),this.tintFill=t,this},setAlphas:function(t,e){var i=this.points.length;if(i<1)return this;var s,n=this.alphas;void 0===t?t=[1]:Array.isArray(t)||void 0!==e||(t=[t]);var r=0;if(void 0!==e)for(s=0;sr&&(o=t[r]),n[r]=o,t.length>r+1&&(o=t[r+1]),n[r+1]=o}return this},setColors:function(t){var e=this.points.length;if(e<1)return this;var i,s=this.colors;void 0===t?t=[16777215]:Array.isArray(t)||(t=[t]);var n=0;if(t.length===e)for(i=0;in&&(r=t[n]),s[n]=r,t.length>n+1&&(r=t[n+1]),s[n+1]=r}return this},setPoints:function(t,e,i){if(void 0===t&&(t=2),"number"==typeof t){var s,n,r,o=t;if(o<2&&(o=2),t=[],this.horizontal)for(r=-this.frame.halfWidth,n=this.frame.width/(o-1),s=0;s{t.exports=function(){}},96027:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(10850),a=i(79968);n.register("rope",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"frame",null),h=r(t,"horizontal",!0),l=o(t,"points",void 0),u=o(t,"colors",void 0),c=o(t,"alphas",void 0),d=new a(this.scene,0,0,i,n,l,h,u,c);return void 0!==e&&(t.add=e),s(this.scene,d,t),d}))},31982:(t,e,i)=>{var s=i(79968);i(61286).register("rope",(function(t,e,i,n,r,o,a,h){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a,h))}))},58912:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(49489),r=i(44598),t.exports={renderWebGL:n,renderCanvas:r}},49489:(t,e,i)=>{var s=i(73329),n=i(75512);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline,e),a=s(e,i,r).calc,h=e.vertices,l=e.uv,u=e.colors,c=e.alphas,d=e.alpha,p=n.getTintAppendFloatAlpha,f=i.roundPixels,v=h.length,g=Math.floor(.5*v);o.flush(),t.pipelines.preBatch(e);var m=o.setGameObject(e),y=o.vertexViewF32,x=o.vertexViewU32,T=o.vertexCount*o.currentShader.vertexComponentCount-1,w=0,b=e.tintFill;e.dirty&&e.updateVertices();for(var E=e.debugCallback,S=[],A=0;A{var s=i(56694),n=i(64937),r=i(89980),o=i(72632),a=i(98611),h=i(22440),l=i(24252),u=i(69360),c=new s({Extends:r,Mixins:[n.ComputedSize,n.Depth,n.GetBounds,n.Mask,n.Origin,n.ScrollFactor,n.Transform,n.Visible,l],initialize:function(t,e,i,s,n,o,a,h){void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=128),void 0===o&&(o=128),r.call(this,t,"Shader"),this.blendMode=-1,this.shader;var l=t.sys.renderer;this.renderer=l,this.gl=l.gl,this.vertexData=new ArrayBuffer(2*Float32Array.BYTES_PER_ELEMENT*6),this.vertexBuffer=l.createVertexBuffer(this.vertexData.byteLength,this.gl.STREAM_DRAW),this.program=null,this.bytes=new Uint8Array(this.vertexData),this.vertexViewF32=new Float32Array(this.vertexData),this._tempMatrix1=new u,this._tempMatrix2=new u,this._tempMatrix3=new u,this.viewMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.projectionMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.uniforms={},this.pointer=null,this._rendererWidth=l.width,this._rendererHeight=l.height,this._textureCount=0,this.framebuffer=null,this.glTexture=null,this.renderToTexture=!1,this.texture=null,this.setPosition(i,s),this.setSize(n,o),this.setOrigin(.5,.5),this.setShader(e,a,h)},willRender:function(t){return!!this.renderToTexture||!(r.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},setRenderToTexture:function(t,e){if(void 0===e&&(e=!1),!this.renderToTexture){var i=this.width,s=this.height,n=this.renderer;this.glTexture=n.createTextureFromSource(null,i,s,0),this.glTexture.flipY=e,this.framebuffer=n.createFramebuffer(i,s,this.glTexture,!1),this._rendererWidth=i,this._rendererHeight=s,this.renderToTexture=!0,this.projOrtho(0,this.width,this.height,0),t&&(this.texture=this.scene.sys.textures.addGLTexture(t,this.glTexture,i,s))}return this.shader&&(n.pipelines.clear(),this.load(),this.flush(),n.pipelines.rebind()),this},setShader:function(t,e,i){if(void 0===e&&(e=[]),"string"==typeof t){var s=this.scene.sys.cache.shader;if(!s.has(t))return console.warn("Shader missing: "+t),this;this.shader=s.get(t)}else this.shader=t;var n=this.gl,r=this.renderer;this.program&&n.deleteProgram(this.program);var o=r.createProgram(this.shader.vertexSrc,this.shader.fragmentSrc);n.uniformMatrix4fv(n.getUniformLocation(o,"uViewMatrix"),!1,this.viewMatrix),n.uniformMatrix4fv(n.getUniformLocation(o,"uProjectionMatrix"),!1,this.projectionMatrix),n.uniform2f(n.getUniformLocation(o,"uResolution"),this.width,this.height),this.program=o;var h=new Date,l={resolution:{type:"2f",value:{x:this.width,y:this.height}},time:{type:"1f",value:0},mouse:{type:"2f",value:{x:this.width/2,y:this.height/2}},date:{type:"4fv",value:[h.getFullYear(),h.getMonth(),h.getDate(),60*h.getHours()*60+60*h.getMinutes()+h.getSeconds()]},sampleRate:{type:"1f",value:44100},iChannel0:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel1:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel2:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel3:{type:"sampler2D",value:null,textureData:{repeat:!0}}};this.shader.uniforms?this.uniforms=a(!0,{},this.shader.uniforms,l):this.uniforms=l;for(var u=0;u<4;u++)e[u]&&this.setSampler2D("iChannel"+u,e[u],u,i);return this.initUniforms(),this.projOrtho(0,this._rendererWidth,this._rendererHeight,0),this},setPointer:function(t){return this.pointer=t,this},projOrtho:function(t,e,i,s){var n=1/(t-e),r=1/(i-s),o=this.projectionMatrix;o[0]=-2*n,o[5]=-2*r,o[10]=-.001,o[12]=(t+e)*n,o[13]=(s+i)*r,o[14]=-0;var a=this.program,h=this.gl;this.renderer.setProgram(a),h.uniformMatrix4fv(h.getUniformLocation(a,"uProjectionMatrix"),!1,this.projectionMatrix),this._rendererWidth=e,this._rendererHeight=i},initUniforms:function(){var t=this.gl,e=this.renderer.glFuncMap,i=this.program;for(var s in this._textureCount=0,this.uniforms){var n=this.uniforms[s],r=n.type,o=e[r];n.uniformLocation=t.getUniformLocation(i,s),"sampler2D"!==r&&(n.glMatrix=o.matrix,n.glValueLength=o.length,n.glFunc=o.func)}},setSampler2DBuffer:function(t,e,i,s,n,r){void 0===n&&(n=0),void 0===r&&(r={});var o=this.uniforms[t];return o.value=e,r.width=i,r.height=s,o.textureData=r,this._textureCount=n,this.initSampler2D(o),this},setSampler2D:function(t,e,i,s){void 0===i&&(i=0);var n=this.scene.sys.textures;if(n.exists(e)){var r=n.getFrame(e);if(r.glTexture&&r.glTexture.isRenderTexture)return this.setSampler2DBuffer(t,r.glTexture,r.width,r.height,i,s);var o=this.uniforms[t],a=r.source;o.textureKey=e,o.source=a.image,o.value=r.glTexture,a.isGLTexture&&(s||(s={}),s.width=a.width,s.height=a.height),s&&(o.textureData=s),this._textureCount=i,this.initSampler2D(o)}return this},setUniform:function(t,e){return h(this.uniforms,t,e),this},getUniform:function(t){return o(this.uniforms,t,null)},setChannel0:function(t,e){return this.setSampler2D("iChannel0",t,0,e)},setChannel1:function(t,e){return this.setSampler2D("iChannel1",t,1,e)},setChannel2:function(t,e){return this.setSampler2D("iChannel2",t,2,e)},setChannel3:function(t,e){return this.setSampler2D("iChannel3",t,3,e)},initSampler2D:function(t){if(t.value){var e=this.gl;e.activeTexture(e.TEXTURE0+this._textureCount),e.bindTexture(e.TEXTURE_2D,t.value);var i=t.textureData;if(i&&!t.value.isRenderTexture){var s=e[o(i,"magFilter","linear").toUpperCase()],n=e[o(i,"minFilter","linear").toUpperCase()],r=e[o(i,"wrapS","repeat").toUpperCase()],a=e[o(i,"wrapT","repeat").toUpperCase()],h=e[o(i,"format","rgba").toUpperCase()];if(i.repeat&&(r=e.REPEAT,a=e.REPEAT),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!!i.flipY),i.width){var l=o(i,"width",512),u=o(i,"height",2),c=o(i,"border",0);e.texImage2D(e.TEXTURE_2D,0,h,l,u,c,h,e.UNSIGNED_BYTE,null)}else e.texImage2D(e.TEXTURE_2D,0,h,e.RGBA,e.UNSIGNED_BYTE,t.source);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,s),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,n),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,a)}this.renderer.setProgram(this.program),e.uniform1i(t.uniformLocation,this._textureCount),this._textureCount++}},syncUniforms:function(){var t,e,i,s,n,r=this.gl,o=this.uniforms,a=0;for(var h in o)i=(t=o[h]).glFunc,e=t.glValueLength,s=t.uniformLocation,null!==(n=t.value)&&(1===e?t.glMatrix?i.call(r,s,t.transpose,n):i.call(r,s,n):2===e?i.call(r,s,n.x,n.y):3===e?i.call(r,s,n.x,n.y,n.z):4===e?i.call(r,s,n.x,n.y,n.z,n.w):"sampler2D"===t.type&&(r.activeTexture(r.TEXTURE0+a),r.bindTexture(r.TEXTURE_2D,n),r.uniform1i(s,a),a++))},load:function(t){var e=this.gl,i=this.width,s=this.height,n=this.renderer,r=this.program,o=this.viewMatrix;if(!this.renderToTexture){var a=-this._displayOriginX,h=-this._displayOriginY;o[0]=t[0],o[1]=t[1],o[4]=t[2],o[5]=t[3],o[8]=t[4],o[9]=t[5],o[12]=o[0]*a+o[4]*h,o[13]=o[1]*a+o[5]*h}e.useProgram(r),e.uniformMatrix4fv(e.getUniformLocation(r,"uViewMatrix"),!1,o),e.uniform2f(e.getUniformLocation(r,"uResolution"),this.width,this.height);var l=this.uniforms,u=l.resolution;u.value.x=i,u.value.y=s,l.time.value=n.game.loop.getDuration();var c=this.pointer;if(c){var d=l.mouse,p=c.x/i,f=1-c.y/s;d.value.x=p.toFixed(2),d.value.y=f.toFixed(2)}this.syncUniforms()},flush:function(){var t=this.width,e=this.height,i=this.program,s=this.gl,n=this.vertexBuffer,r=this.renderer,o=2*Float32Array.BYTES_PER_ELEMENT;this.renderToTexture&&(r.setFramebuffer(this.framebuffer),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT)),s.bindBuffer(s.ARRAY_BUFFER,n);var a=s.getAttribLocation(i,"inPosition");-1!==a&&(s.enableVertexAttribArray(a),s.vertexAttribPointer(a,2,s.FLOAT,!1,o,0));var h=this.vertexViewF32;h[3]=e,h[4]=t,h[5]=e,h[8]=t,h[9]=e,h[10]=t;s.bufferSubData(s.ARRAY_BUFFER,0,this.bytes.subarray(0,6*o)),s.drawArrays(s.TRIANGLES,0,6),this.renderToTexture&&r.setFramebuffer(null,!1)},setAlpha:function(){},setBlendMode:function(){},preDestroy:function(){var t=this.gl;t.deleteProgram(this.program),t.deleteBuffer(this.vertexBuffer),this.renderToTexture&&(this.renderer.deleteFramebuffer(this.framebuffer),this.texture.destroy(),this.framebuffer=null,this.glTexture=null,this.texture=null)}});t.exports=c},10612:t=>{t.exports=function(){}},13908:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(27902);n.register("shader",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"x",0),a=r(t,"y",0),h=r(t,"width",128),l=r(t,"height",128),u=new o(this.scene,i,n,a,h,l);return void 0!==e&&(t.add=e),s(this.scene,u,t),u}))},51979:(t,e,i)=>{var s=i(27902);i(61286).register("shader",(function(t,e,i,n,r,o,a){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a))}))},24252:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(19782),r=i(10612),t.exports={renderWebGL:n,renderCanvas:r}},19782:(t,e,i)=>{var s=i(73329);t.exports=function(t,e,i,n){if(e.shader){if(i.addToRenderList(e),t.pipelines.clear(),e.renderToTexture)e.load(),e.flush();else{var r=s(e,i,n).calc;t.width===e._rendererWidth&&t.height===e._rendererHeight||e.projOrtho(0,t.width,t.height,0),e.load(r.matrix),e.flush()}t.pipelines.rebind()}}},19543:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i,n,r,o){for(var a=s.getTintAppendFloatAlpha(i.fillColor,i.fillAlpha*n),h=i.pathData,l=i.pathIndexes,u=0;u{t.exports=function(t,e,i,s){var n=i||e.fillColor,r=s||e.fillAlpha,o=(16711680&n)>>>16,a=(65280&n)>>>8,h=255&n;t.fillStyle="rgba("+o+","+a+","+h+","+r+")"}},17876:t=>{t.exports=function(t,e,i,s){var n=i||e.strokeColor,r=s||e.strokeAlpha,o=(16711680&n)>>>16,a=(65280&n)>>>8,h=255&n;t.strokeStyle="rgba("+o+","+a+","+h+","+r+")",t.lineWidth=e.lineWidth}},91461:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(89980),o=i(88829),a=new s({Extends:r,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.GetBounds,n.Mask,n.Origin,n.Pipeline,n.ScrollFactor,n.Transform,n.Visible],initialize:function(t,e,i){void 0===e&&(e="Shape"),r.call(this,t,e),this.geom=i,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new o,this.width=0,this.height=0,this.initPipeline()},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.isFilled=!1:(this.fillColor=t,this.fillAlpha=e,this.isFilled=!0),this},setStrokeStyle:function(t,e,i){return void 0===i&&(i=1),void 0===t?this.isStroked=!1:(this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this.isStroked=!0),this},setClosePath:function(t){return this.closePath=t,this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}}});t.exports=a},50262:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i,n,r){var o=t.strokeTint,a=s.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*i);o.TL=a,o.TR=a,o.BL=a,o.BR=a;var h=e.pathData,l=h.length-1,u=e.lineWidth,c=u/2,d=h[0]-n,p=h[1]-r;e.closePath||(l-=2);for(var f=2;f{var s=i(2213),n=i(56694),r=i(75606),o=i(11117),a=i(26673),h=i(83392),l=i(91461),u=new n({Extends:l,Mixins:[s],initialize:function(t,e,i,s,n,r,o,h,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===n&&(n=0),void 0===r&&(r=360),void 0===o&&(o=!1),l.call(this,t,"Arc",new a(0,0,s)),this._startAngle=n,this._endAngle=r,this._anticlockwise=o,this._iterations=.01,this.setPosition(e,i);var c=2*this.geom.radius;this.setSize(c,c),void 0!==h&&this.setFillStyle(h,u),this.updateDisplayOrigin(),this.updateData()},iterations:{get:function(){return this._iterations},set:function(t){this._iterations=t,this.updateData()}},radius:{get:function(){return this.geom.radius},set:function(t){this.geom.radius=t;var e=2*t;this.setSize(e,e),this.updateDisplayOrigin(),this.updateData()}},startAngle:{get:function(){return this._startAngle},set:function(t){this._startAngle=t,this.updateData()}},endAngle:{get:function(){return this._endAngle},set:function(t){this._endAngle=t,this.updateData()}},anticlockwise:{get:function(){return this._anticlockwise},set:function(t){this._anticlockwise=t,this.updateData()}},setRadius:function(t){return this.radius=t,this},setIterations:function(t){return void 0===t&&(t=.01),this.iterations=t,this},setStartAngle:function(t,e){return this._startAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},setEndAngle:function(t,e){return this._endAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},updateData:function(){var t=this._iterations,e=t,i=this.geom.radius,s=r(this._startAngle),n=r(this._endAngle),a=i,l=i;n-=s,this._anticlockwise?n<-h.PI2?n=-h.PI2:n>0&&(n=-h.PI2+n%h.PI2):n>h.PI2?n=h.PI2:n<0&&(n=h.PI2+n%h.PI2);for(var u,c=[a+Math.cos(s)*i,l+Math.sin(s)*i];e<1;)u=n*e+s,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),e+=t;return u=n+s,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),c.push(a+Math.cos(s)*i,l+Math.sin(s)*i),this.pathIndexes=o(c),this.pathData=c,this}});t.exports=u},23560:(t,e,i)=>{var s=i(75606),n=i(15608),r=i(17876),o=i(49584);t.exports=function(t,e,i,a){i.addToRenderList(e);var h=t.currentContext;if(o(t,h,e,i,a)){var l=e.radius;h.beginPath(),h.arc(l-e.originX*(2*l),l-e.originY*(2*l),l,s(e._startAngle),s(e._endAngle),e.anticlockwise),e.closePath&&h.closePath(),e.isFilled&&(n(h,e),h.fill()),e.isStroked&&(r(h,e),h.stroke()),h.restore()}}},10369:(t,e,i)=>{var s=i(28593),n=i(61286);n.register("arc",(function(t,e,i,n,r,o,a,h){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a,h))})),n.register("circle",(function(t,e,i,n,r){return this.displayList.add(new s(this.scene,t,e,i,0,360,!1,n,r))}))},2213:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(58356),r=i(23560),t.exports={renderWebGL:n,renderCanvas:r}},58356:(t,e,i)=>{var s=i(73329),n=i(19543),r=i(50262);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=s(e,i,o),l=a.calcMatrix.copyFrom(h.calc),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&n(a,l,e,d,u,c),e.isStroked&&r(a,e,d,u,c),t.pipelines.postBatch(e)}},15220:(t,e,i)=>{var s=i(56694),n=i(87203),r=i(11117),o=i(74118),a=i(91461),h=new s({Extends:a,Mixins:[n],initialize:function(t,e,i,s,n,r){void 0===e&&(e=0),void 0===i&&(i=0),a.call(this,t,"Curve",s),this._smoothness=32,this._curveBounds=new o,this.closePath=!1,this.setPosition(e,i),void 0!==n&&this.setFillStyle(n,r),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){var t=this._curveBounds,e=this._smoothness;this.geom.getBounds(t,e),this.setSize(t.width,t.height),this.updateDisplayOrigin();for(var i=[],s=this.geom.getPoints(e),n=0;n{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=e._displayOriginX+e._curveBounds.x,l=e._displayOriginY+e._curveBounds.y,u=e.pathData,c=u.length-1,d=u[0]-h,p=u[1]-l;a.beginPath(),a.moveTo(d,p),e.closePath||(c-=2);for(var f=2;f{var s=i(61286),n=i(15220);s.register("curve",(function(t,e,i,s,r){return this.displayList.add(new n(this.scene,t,e,i,s,r))}))},87203:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(82958),r=i(4024),t.exports={renderWebGL:n,renderCanvas:r}},82958:(t,e,i)=>{var s=i(19543),n=i(73329),r=i(50262);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=n(e,i,o),l=a.calcMatrix.copyFrom(h.calc),u=e._displayOriginX+e._curveBounds.x,c=e._displayOriginY+e._curveBounds.y,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&s(a,l,e,d,u,c),e.isStroked&&r(a,e,d,u,c),t.pipelines.postBatch(e)}},28591:(t,e,i)=>{var s=i(56694),n=i(11117),r=i(84171),o=i(95669),a=i(91461),h=new s({Extends:a,Mixins:[r],initialize:function(t,e,i,s,n,r,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===n&&(n=128),a.call(this,t,"Ellipse",new o(s/2,n/2,s,n)),this._smoothness=64,this.setPosition(e,i),this.width=s,this.height=n,void 0!==r&&this.setFillStyle(r,h),this.updateDisplayOrigin(),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSize:function(t,e){return this.width=t,this.height=e,this.geom.setPosition(t/2,e/2),this.geom.setSize(t,e),this.updateData()},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){for(var t=[],e=this.geom.getPoints(this._smoothness),i=0;i{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY,u=e.pathData,c=u.length-1,d=u[0]-h,p=u[1]-l;a.beginPath(),a.moveTo(d,p),e.closePath||(c-=2);for(var f=2;f{var s=i(28591);i(61286).register("ellipse",(function(t,e,i,n,r,o){return this.displayList.add(new s(this.scene,t,e,i,n,r,o))}))},84171:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(17554),r=i(55881),t.exports={renderWebGL:n,renderCanvas:r}},17554:(t,e,i)=>{var s=i(19543),n=i(73329),r=i(50262);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=n(e,i,o),l=a.calcMatrix.copyFrom(h.calc),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&s(a,l,e,d,u,c),e.isStroked&&r(a,e,d,u,c),t.pipelines.postBatch(e)}},39169:(t,e,i)=>{var s=i(56694),n=i(91461),r=i(88059),o=new s({Extends:n,Mixins:[r],initialize:function(t,e,i,s,r,o,a,h,l,u,c){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===r&&(r=128),void 0===o&&(o=32),void 0===a&&(a=32),n.call(this,t,"Grid",null),this.cellWidth=o,this.cellHeight=a,this.showCells=!0,this.outlineFillColor=0,this.outlineFillAlpha=0,this.showOutline=!0,this.showAltCells=!1,this.altFillColor,this.altFillAlpha,this.setPosition(e,i),this.setSize(s,r),this.setFillStyle(h,l),void 0!==u&&this.setOutlineStyle(u,c),this.updateDisplayOrigin()},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showCells=!1:(this.fillColor=t,this.fillAlpha=e,this.showCells=!0),this},setAltFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showAltCells=!1:(this.altFillColor=t,this.altFillAlpha=e,this.showAltCells=!0),this},setOutlineStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showOutline=!1:(this.outlineFillColor=t,this.outlineFillAlpha=e,this.showOutline=!0),this}});t.exports=o},95525:(t,e,i)=>{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=-e._displayOriginX,l=-e._displayOriginY,u=i.alpha*e.alpha,c=e.width,d=e.height,p=e.cellWidth,f=e.cellHeight,v=Math.ceil(c/p),g=Math.ceil(d/f),m=p,y=f,x=p-(v*p-c),T=f-(g*f-d),w=e.showCells,b=e.showAltCells,E=e.showOutline,S=0,A=0,_=0,C=0,R=0;if(E&&(m--,y--,x===p&&x--,T===f&&T--),w&&e.fillAlpha>0)for(s(a,e),A=0;A0)for(s(a,e,e.altFillColor,e.altFillAlpha*u),A=0;A0){for(n(a,e,e.outlineFillColor,e.outlineFillAlpha*u),S=1;S{var s=i(61286),n=i(39169);s.register("grid",(function(t,e,i,s,r,o,a,h,l,u){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a,h,l,u))}))},88059:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(50639),r=i(95525),t.exports={renderWebGL:n,renderCanvas:r}},50639:(t,e,i)=>{var s=i(73329),n=i(75512);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),a=s(e,i,r);o.calcMatrix.copyFrom(a.calc).translate(-e._displayOriginX,-e._displayOriginY);var h,l,u=i.alpha*e.alpha,c=e.width,d=e.height,p=e.cellWidth,f=e.cellHeight,v=Math.ceil(c/p),g=Math.ceil(d/f),m=p,y=f,x=p-(v*p-c),T=f-(g*f-d),w=e.showCells,b=e.showAltCells,E=e.showOutline,S=0,A=0,_=0,C=0,R=0;if(E&&(m--,y--,x===p&&x--,T===f&&T--),t.pipelines.preBatch(e),w&&e.fillAlpha>0)for(h=o.fillTint,l=n.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*u),h.TL=l,h.TR=l,h.BL=l,h.BR=l,A=0;A0)for(h=o.fillTint,l=n.getTintAppendFloatAlpha(e.altFillColor,e.altFillAlpha*u),h.TL=l,h.TR=l,h.BL=l,h.BR=l,A=0;A0){var M=o.strokeTint,P=n.getTintAppendFloatAlpha(e.outlineFillColor,e.outlineFillAlpha*u);for(M.TL=P,M.TR=P,M.BL=P,M.BR=P,S=1;S{var s=i(72296),n=i(56694),r=i(91461),o=new n({Extends:r,Mixins:[s],initialize:function(t,e,i,s,n,o,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=48),void 0===n&&(n=32),void 0===o&&(o=15658734),void 0===a&&(a=10066329),void 0===h&&(h=13421772),r.call(this,t,"IsoBox",null),this.projection=4,this.fillTop=o,this.fillLeft=a,this.fillRight=h,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isFilled=!0,this.setPosition(e,i),this.setSize(s,n),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=o},32884:(t,e,i)=>{var s=i(15608),n=i(49584);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.currentContext;if(n(t,o,e,i,r)&&e.isFilled){var a=e.width,h=e.height,l=a/2,u=a/e.projection;e.showTop&&(s(o,e,e.fillTop),o.beginPath(),o.moveTo(-l,-h),o.lineTo(0,-u-h),o.lineTo(l,-h),o.lineTo(l,-1),o.lineTo(0,u-1),o.lineTo(-l,-1),o.lineTo(-l,-h),o.fill()),e.showLeft&&(s(o,e,e.fillLeft),o.beginPath(),o.moveTo(-l,0),o.lineTo(0,u),o.lineTo(0,u-h),o.lineTo(-l,-h),o.lineTo(-l,0),o.fill()),e.showRight&&(s(o,e,e.fillRight),o.beginPath(),o.moveTo(l,0),o.lineTo(0,u),o.lineTo(0,u-h),o.lineTo(l,-h),o.lineTo(l,0),o.fill()),o.restore()}}},88154:(t,e,i)=>{var s=i(61286),n=i(4415);s.register("isobox",(function(t,e,i,s,r,o,a){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a))}))},72296:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(33101),r=i(32884),t.exports={renderWebGL:n,renderCanvas:r}},33101:(t,e,i)=>{var s=i(73329),n=i(75512);t.exports=function(t,e,i,r){i.addToRenderList(e);var o,a,h,l,u,c,d,p,f,v=t.pipelines.set(e.pipeline),g=s(e,i,r),m=v.calcMatrix.copyFrom(g.calc),y=e.width,x=e.height,T=y/2,w=y/e.projection,b=i.alpha*e.alpha;e.isFilled&&(t.pipelines.preBatch(e),e.showTop&&(o=n.getTintAppendFloatAlpha(e.fillTop,b),a=m.getX(-T,-x),h=m.getY(-T,-x),l=m.getX(0,-w-x),u=m.getY(0,-w-x),c=m.getX(T,-x),d=m.getY(T,-x),p=m.getX(0,w-x),f=m.getY(0,w-x),v.batchQuad(e,a,h,l,u,c,d,p,f,0,0,1,1,o,o,o,o,2)),e.showLeft&&(o=n.getTintAppendFloatAlpha(e.fillLeft,b),a=m.getX(-T,0),h=m.getY(-T,0),l=m.getX(0,w),u=m.getY(0,w),c=m.getX(0,w-x),d=m.getY(0,w-x),p=m.getX(-T,-x),f=m.getY(-T,-x),v.batchQuad(e,a,h,l,u,c,d,p,f,0,0,1,1,o,o,o,o,2)),e.showRight&&(o=n.getTintAppendFloatAlpha(e.fillRight,b),a=m.getX(T,0),h=m.getY(T,0),l=m.getX(0,w),u=m.getY(0,w),c=m.getX(0,w-x),d=m.getY(0,w-x),p=m.getX(T,-x),f=m.getY(T,-x),v.batchQuad(e,a,h,l,u,c,d,p,f,0,0,1,1,o,o,o,o,2)),t.pipelines.postBatch(e))}},65159:(t,e,i)=>{var s=i(56694),n=i(93387),r=i(91461),o=new s({Extends:r,Mixins:[n],initialize:function(t,e,i,s,n,o,a,h,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=48),void 0===n&&(n=32),void 0===o&&(o=!1),void 0===a&&(a=15658734),void 0===h&&(h=10066329),void 0===l&&(l=13421772),r.call(this,t,"IsoTriangle",null),this.projection=4,this.fillTop=a,this.fillLeft=h,this.fillRight=l,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isReversed=o,this.isFilled=!0,this.setPosition(e,i),this.setSize(s,n),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setReversed:function(t){return this.isReversed=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=o},9923:(t,e,i)=>{var s=i(15608),n=i(49584);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.currentContext;if(n(t,o,e,i,r)&&e.isFilled){var a=e.width,h=e.height,l=a/2,u=a/e.projection,c=e.isReversed;e.showTop&&c&&(s(o,e,e.fillTop),o.beginPath(),o.moveTo(-l,-h),o.lineTo(0,-u-h),o.lineTo(l,-h),o.lineTo(0,u-h),o.fill()),e.showLeft&&(s(o,e,e.fillLeft),o.beginPath(),c?(o.moveTo(-l,-h),o.lineTo(0,u),o.lineTo(0,u-h)):(o.moveTo(-l,0),o.lineTo(0,u),o.lineTo(0,u-h)),o.fill()),e.showRight&&(s(o,e,e.fillRight),o.beginPath(),c?(o.moveTo(l,-h),o.lineTo(0,u),o.lineTo(0,u-h)):(o.moveTo(l,0),o.lineTo(0,u),o.lineTo(0,u-h)),o.fill()),o.restore()}}},67765:(t,e,i)=>{var s=i(61286),n=i(65159);s.register("isotriangle",(function(t,e,i,s,r,o,a,h){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a,h))}))},93387:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(54946),r=i(9923),t.exports={renderWebGL:n,renderCanvas:r}},54946:(t,e,i)=>{var s=i(73329),n=i(75512);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),a=s(e,i,r),h=o.calcMatrix.copyFrom(a.calc),l=e.width,u=e.height,c=l/2,d=l/e.projection,p=e.isReversed,f=i.alpha*e.alpha;if(e.isFilled){var v,g,m,y,x,T,w;if(t.pipelines.preBatch(e),e.showTop&&p){v=n.getTintAppendFloatAlpha(e.fillTop,f),g=h.getX(-c,-u),m=h.getY(-c,-u),y=h.getX(0,-d-u),x=h.getY(0,-d-u),T=h.getX(c,-u),w=h.getY(c,-u);var b=h.getX(0,d-u),E=h.getY(0,d-u);o.batchQuad(e,g,m,y,x,T,w,b,E,0,0,1,1,v,v,v,v,2)}e.showLeft&&(v=n.getTintAppendFloatAlpha(e.fillLeft,f),p?(g=h.getX(-c,-u),m=h.getY(-c,-u),y=h.getX(0,d),x=h.getY(0,d),T=h.getX(0,d-u),w=h.getY(0,d-u)):(g=h.getX(-c,0),m=h.getY(-c,0),y=h.getX(0,d),x=h.getY(0,d),T=h.getX(0,d-u),w=h.getY(0,d-u)),o.batchTri(e,g,m,y,x,T,w,0,0,1,1,v,v,v,2)),e.showRight&&(v=n.getTintAppendFloatAlpha(e.fillRight,f),p?(g=h.getX(c,-u),m=h.getY(c,-u),y=h.getX(0,d),x=h.getY(0,d),T=h.getX(0,d-u),w=h.getY(0,d-u)):(g=h.getX(c,0),m=h.getY(c,0),y=h.getX(0,d),x=h.getY(0,d),T=h.getX(0,d-u),w=h.getY(0,d-u)),o.batchTri(e,g,m,y,x,T,w,0,0,1,1,v,v,v,2)),t.pipelines.postBatch(e)}}},579:(t,e,i)=>{var s=i(56694),n=i(91461),r=i(88829),o=i(52660),a=new s({Extends:n,Mixins:[o],initialize:function(t,e,i,s,o,a,h,l,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===o&&(o=0),void 0===a&&(a=128),void 0===h&&(h=0),n.call(this,t,"Line",new r(s,o,a,h));var c=Math.max(1,this.geom.right-this.geom.left),d=Math.max(1,this.geom.bottom-this.geom.top);this.lineWidth=1,this._startWidth=1,this._endWidth=1,this.setPosition(e,i),this.setSize(c,d),void 0!==l&&this.setStrokeStyle(1,l,u),this.updateDisplayOrigin()},setLineWidth:function(t,e){return void 0===e&&(e=t),this._startWidth=t,this._endWidth=e,this.lineWidth=t,this},setTo:function(t,e,i,s){return this.geom.setTo(t,e,i,s),this}});t.exports=a},52044:(t,e,i)=>{var s=i(17876),n=i(49584);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.currentContext;if(n(t,o,e,i,r)){var a=e._displayOriginX,h=e._displayOriginY;e.isStroked&&(s(o,e),o.beginPath(),o.moveTo(e.geom.x1-a,e.geom.y1-h),o.lineTo(e.geom.x2-a,e.geom.y2-h),o.stroke()),o.restore()}}},85665:(t,e,i)=>{var s=i(61286),n=i(579);s.register("line",(function(t,e,i,s,r,o,a,h){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a,h))}))},52660:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(46952),r=i(52044),t.exports={renderWebGL:n,renderCanvas:r}},46952:(t,e,i)=>{var s=i(73329),n=i(75512);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),a=s(e,i,r);o.calcMatrix.copyFrom(a.calc);var h=e._displayOriginX,l=e._displayOriginY,u=i.alpha*e.alpha;if(t.pipelines.preBatch(e),e.isStroked){var c=o.strokeTint,d=n.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*u);c.TL=d,c.TR=d,c.BL=d,c.BR=d;var p=e._startWidth,f=e._endWidth;o.batchLine(e.geom.x1-h,e.geom.y1-l,e.geom.x2-h,e.geom.y2-l,p,f,1,0,!1,a.sprite,a.camera)}t.pipelines.postBatch(e)}},91249:(t,e,i)=>{var s=i(70573),n=i(56694),r=i(11117),o=i(14045),a=i(8580),h=i(91461),l=i(18974),u=new n({Extends:h,Mixins:[s],initialize:function(t,e,i,s,n,r){void 0===e&&(e=0),void 0===i&&(i=0),h.call(this,t,"Polygon",new a(s));var l=o(this.geom);this.setPosition(e,i),this.setSize(l.width,l.height),void 0!==n&&this.setFillStyle(n,r),this.updateDisplayOrigin(),this.updateData()},smooth:function(t){void 0===t&&(t=1);for(var e=0;e{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY,u=e.pathData,c=u.length-1,d=u[0]-h,p=u[1]-l;a.beginPath(),a.moveTo(d,p),e.closePath||(c-=2);for(var f=2;f{var s=i(61286),n=i(91249);s.register("polygon",(function(t,e,i,s,r){return this.displayList.add(new n(this.scene,t,e,i,s,r))}))},70573:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(72841),r=i(40834),t.exports={renderWebGL:n,renderCanvas:r}},72841:(t,e,i)=>{var s=i(19543),n=i(73329),r=i(50262);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=n(e,i,o),l=a.calcMatrix.copyFrom(h.calc),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&s(a,l,e,d,u,c),e.isStroked&&r(a,e,d,u,c),t.pipelines.postBatch(e)}},517:(t,e,i)=>{var s=i(56694),n=i(74118),r=i(91461),o=i(37673),a=new s({Extends:r,Mixins:[o],initialize:function(t,e,i,s,o,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===o&&(o=128),r.call(this,t,"Rectangle",new n(0,0,s,o)),this.setPosition(e,i),this.setSize(s,o),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},setSize:function(t,e){this.width=t,this.height=e,this.geom.setSize(t,e),this.updateData(),this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),e.getLineD(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=a},4091:(t,e,i)=>{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY;e.isFilled&&(s(a,e),a.fillRect(-h,-l,e.width,e.height)),e.isStroked&&(n(a,e),a.beginPath(),a.rect(-h,-l,e.width,e.height),a.stroke()),a.restore()}}},94355:(t,e,i)=>{var s=i(61286),n=i(517);s.register("rectangle",(function(t,e,i,s,r,o){return this.displayList.add(new n(this.scene,t,e,i,s,r,o))}))},37673:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(43532),r=i(4091),t.exports={renderWebGL:n,renderCanvas:r}},43532:(t,e,i)=>{var s=i(73329),n=i(50262),r=i(75512);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=s(e,i,o);a.calcMatrix.copyFrom(h.calc);var l=e._displayOriginX,u=e._displayOriginY,c=i.alpha*e.alpha;if(t.pipelines.preBatch(e),e.isFilled){var d=a.fillTint,p=r.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*c);d.TL=p,d.TR=p,d.BL=p,d.BR=p,a.batchFillRect(-l,-u,e.width,e.height)}e.isStroked&&n(a,e,c,l,u),t.pipelines.postBatch(e)}},77843:(t,e,i)=>{var s=i(87956),n=i(56694),r=i(11117),o=i(91461),a=new n({Extends:o,Mixins:[s],initialize:function(t,e,i,s,n,r,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=5),void 0===n&&(n=32),void 0===r&&(r=64),o.call(this,t,"Star",null),this._points=s,this._innerRadius=n,this._outerRadius=r,this.setPosition(e,i),this.setSize(2*r,2*r),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},setPoints:function(t){return this._points=t,this.updateData()},setInnerRadius:function(t){return this._innerRadius=t,this.updateData()},setOuterRadius:function(t){return this._outerRadius=t,this.updateData()},points:{get:function(){return this._points},set:function(t){this._points=t,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this.updateData()}},updateData:function(){var t=[],e=this._points,i=this._innerRadius,s=this._outerRadius,n=Math.PI/2*3,o=Math.PI/e,a=s,h=s;t.push(a,h+-s);for(var l=0;l{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY,u=e.pathData,c=u.length-1,d=u[0]-h,p=u[1]-l;a.beginPath(),a.moveTo(d,p),e.closePath||(c-=2);for(var f=2;f{var s=i(77843);i(61286).register("star",(function(t,e,i,n,r,o,a){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a))}))},87956:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(12037),r=i(11401),t.exports={renderWebGL:n,renderCanvas:r}},12037:(t,e,i)=>{var s=i(19543),n=i(73329),r=i(50262);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=n(e,i,o),l=a.calcMatrix.copyFrom(h.calc),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&s(a,l,e,d,u,c),e.isStroked&&r(a,e,d,u,c),t.pipelines.postBatch(e)}},21873:(t,e,i)=>{var s=i(56694),n=i(91461),r=i(66349),o=i(70498),a=new s({Extends:n,Mixins:[o],initialize:function(t,e,i,s,o,a,h,l,u,c,d){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===o&&(o=128),void 0===a&&(a=64),void 0===h&&(h=0),void 0===l&&(l=128),void 0===u&&(u=128),n.call(this,t,"Triangle",new r(s,o,a,h,l,u));var p=this.geom.right-this.geom.left,f=this.geom.bottom-this.geom.top;this.setPosition(e,i),this.setSize(p,f),void 0!==c&&this.setFillStyle(c,d),this.updateDisplayOrigin(),this.updateData()},setTo:function(t,e,i,s,n,r){return this.geom.setTo(t,e,i,s,n,r),this.updateData()},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=a},60213:(t,e,i)=>{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY,u=e.geom.x1-h,c=e.geom.y1-l,d=e.geom.x2-h,p=e.geom.y2-l,f=e.geom.x3-h,v=e.geom.y3-l;a.beginPath(),a.moveTo(u,c),a.lineTo(d,p),a.lineTo(f,v),a.closePath(),e.isFilled&&(s(a,e),a.fill()),e.isStroked&&(n(a,e),a.stroke()),a.restore()}}},79296:(t,e,i)=>{var s=i(61286),n=i(21873);s.register("triangle",(function(t,e,i,s,r,o,a,h,l,u){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a,h,l,u))}))},70498:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(72291),r=i(60213),t.exports={renderWebGL:n,renderCanvas:r}},72291:(t,e,i)=>{var s=i(73329),n=i(50262),r=i(75512);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=s(e,i,o);a.calcMatrix.copyFrom(h.calc);var l=e._displayOriginX,u=e._displayOriginY,c=i.alpha*e.alpha;if(t.pipelines.preBatch(e),e.isFilled){var d=a.fillTint,p=r.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*c);d.TL=p,d.TR=p,d.BL=p,d.BR=p;var f=e.geom.x1-l,v=e.geom.y1-u,g=e.geom.x2-l,m=e.geom.y2-u,y=e.geom.x3-l,x=e.geom.y3-u;a.batchFillTriangle(f,v,g,m,y,x,h.sprite,h.camera)}e.isStroked&&n(a,e,c,l,u),t.pipelines.postBatch(e)}},13747:(t,e,i)=>{var s=i(16569),n=i(56694),r=i(64937),o=i(89980),a=i(20791),h=new n({Extends:o,Mixins:[r.Alpha,r.BlendMode,r.Depth,r.Flip,r.FX,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.ScrollFactor,r.Size,r.TextureCrop,r.Tint,r.Transform,r.Visible,a],initialize:function(t,e,i,n,r){o.call(this,t,"Sprite"),this._crop=this.resetCropObject(),this.anims=new s(this),this.setTexture(n,r),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline()},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){this.anims.update(t,e)},play:function(t,e){return this.anims.play(t,e)},playReverse:function(t,e){return this.anims.playReverse(t,e)},playAfterDelay:function(t,e){return this.anims.playAfterDelay(t,e)},playAfterRepeat:function(t,e){return this.anims.playAfterRepeat(t,e)},chain:function(t){return this.anims.chain(t)},stop:function(){return this.anims.stop()},stopAfterDelay:function(t){return this.anims.stopAfterDelay(t)},stopAfterRepeat:function(t){return this.anims.stopAfterRepeat(t)},stopOnFrame:function(t){return this.anims.stopOnFrame(t)},toJSON:function(){return r.ToJSON(this)},preDestroy:function(){this.anims.destroy(),this.anims=void 0}});t.exports=h},27573:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),t.batchSprite(e,e.frame,i,s)}},89219:(t,e,i)=>{var s=i(88933),n=i(32291),r=i(99325),o=i(20494),a=i(13747);r.register("sprite",(function(t,e){void 0===t&&(t={});var i=o(t,"key",null),r=o(t,"frame",null),h=new a(this.scene,0,0,i,r);return void 0!==e&&(t.add=e),s(this.scene,h,t),n(h,t),h}))},66135:(t,e,i)=>{var s=i(61286),n=i(13747);s.register("sprite",(function(t,e,i,s){var r=new n(this.scene,t,e,i,s);return this.displayList.add(r),r}))},20791:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(21034),r=i(27573),t.exports={renderWebGL:n,renderCanvas:r}},21034:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),e.pipeline.batchSprite(e,i,s)}},32979:t=>{t.exports=function(t,e,i){var s=t.canvas,n=t.context,r=t.style,o=[],a=0,h=i.length;r.maxLines>0&&r.maxLines1&&(d+=p*(h-1)),{width:a,height:d,lines:h,lineWidths:o,lineSpacing:p,lineHeight:c}}},27030:(t,e,i)=>{var s=i(61068);t.exports=function(t){var e=s.create(this),i=e.getContext("2d");t.syncFont(e,i);var n=i.measureText(t.testString);if("actualBoundingBoxAscent"in n){var r=n.actualBoundingBoxAscent,o=n.actualBoundingBoxDescent;return s.remove(e),{ascent:r,descent:o,fontSize:r+o}}var a=Math.ceil(n.width*t.baselineX),h=a,l=2*h;h=h*t.baselineY|0,e.width=a,e.height=l,i.fillStyle="#f00",i.fillRect(0,0,a,l),i.font=t._font,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(t.testString,0,h);var u={ascent:0,descent:0,fontSize:0},c=i.getImageData(0,0,a,l);if(!c)return u.ascent=h,u.descent=h+6,u.fontSize=u.ascent+u.descent,s.remove(e),u;var d,p,f=c.data,v=f.length,g=4*a,m=0,y=!1;for(d=0;dh;d--){for(p=0;p{var s=i(99584),n=i(61068),r=i(56694),o=i(64937),a=i(97081),h=i(89980),l=i(32979),u=i(10850),c=i(55638),d=i(80032),p=i(74744),f=new r({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Crop,o.Depth,o.Flip,o.FX,o.GetBounds,o.Mask,o.Origin,o.Pipeline,o.ScrollFactor,o.Tint,o.Transform,o.Visible,d],initialize:function(t,e,i,s,r){void 0===e&&(e=0),void 0===i&&(i=0),h.call(this,t,"Text"),this.renderer=t.sys.renderer,this.setPosition(e,i),this.setOrigin(0,0),this.initPipeline(),this.canvas=n.create(this),this.context=this.canvas.getContext("2d"),this.style=new p(this,r),this.autoRound=!0,this.splitRegExp=/(?:\r\n|\r|\n)/,this._text=void 0,this.padding={left:0,right:0,top:0,bottom:0},this.width=1,this.height=1,this.lineSpacing=0,this.dirty=!1,0===this.style.resolution&&(this.style.resolution=1),this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(null,this.canvas,!0),this.frame=this.texture.get(),this.frame.source.resolution=this.style.resolution,this.renderer&&this.renderer.gl&&(this.renderer.deleteTexture(this.frame.source.glTexture),this.frame.source.glTexture=null),this.initRTL(),this.setText(s),r&&r.padding&&this.setPadding(r.padding),r&&r.lineSpacing&&this.setLineSpacing(r.lineSpacing),t.sys.game.events.on(a.CONTEXT_RESTORED,this.onContextRestored,this)},initRTL:function(){this.style.rtl&&(this.canvas.dir="rtl",this.context.direction="rtl",this.canvas.style.display="none",s(this.canvas,this.scene.sys.canvas),this.originX=1)},runWordWrap:function(t){var e=this.style;if(e.wordWrapCallback){var i=e.wordWrapCallback.call(e.wordWrapCallbackScope,t,this);return Array.isArray(i)&&(i=i.join("\n")),i}return e.wordWrapWidth?e.wordWrapUseAdvanced?this.advancedWordWrap(t,this.context,this.style.wordWrapWidth):this.basicWordWrap(t,this.context,this.style.wordWrapWidth):t},advancedWordWrap:function(t,e,i){for(var s="",n=t.replace(/ +/gi," ").split(this.splitRegExp),r=n.length,o=0;ol){if(0===c){for(var v=p;v.length&&(v=v.slice(0,-1),!((f=e.measureText(v).width)<=l)););if(!v.length)throw new Error("This text's wordWrapWidth setting is less than a single character!");var g=d.substr(v.length);u[c]=g,h+=v}var m=u[c].length?c:c+1,y=u.slice(m).join(" ").replace(/[ \n]*$/gi,"");n[o+1]=y+" "+(n[o+1]||""),r=n.length;break}h+=p,l-=f}s+=h.replace(/[ \n]*$/gi,"")+"\n"}}return s=s.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(t,e,i){for(var s="",n=t.split(this.splitRegExp),r=n.length-1,o=e.measureText(" ").width,a=0;a<=r;a++){for(var h=i,l=n[a].split(" "),u=l.length-1,c=0;c<=u;c++){var d=l[c],p=e.measureText(d).width,f=p;ch&&c>0&&(s+="\n",h=i),s+=d,c0&&(d+=h.lineSpacing*v),i.rtl)c=p-c-u.left-u.right;else if("right"===i.align)c+=o-h.lineWidths[v];else if("center"===i.align)c+=(o-h.lineWidths[v])/2;else if("justify"===i.align){if(h.lineWidths[v]/h.width>=.85){var g=h.width-h.lineWidths[v],m=e.measureText(" ").width,y=a[v].trim(),x=y.split(" ");g+=(a[v].length-y.length)*m;for(var T=Math.floor(g/m),w=0;T>0;)x[w]+=" ",w=(w+1)%(x.length-1||1),--T;a[v]=x.join(" ")}}this.autoRound&&(c=Math.round(c),d=Math.round(d)),i.strokeThickness&&(this.style.syncShadow(e,i.shadowStroke),e.strokeText(a[v],c,d)),i.color&&(this.style.syncShadow(e,i.shadowFill),e.fillText(a[v],c,d))}e.restore(),this.renderer&&this.renderer.gl&&(this.frame.source.glTexture=this.renderer.canvasToTexture(t,this.frame.source.glTexture,!0),this.frame.glTexture=this.frame.source.glTexture),this.dirty=!0;var b=this.input;return b&&!b.customHitArea&&(b.hitArea.width=this.width,b.hitArea.height=this.height),this},getTextMetrics:function(){return this.style.getTextMetrics()},text:{get:function(){return this._text},set:function(t){this.setText(t)}},toJSON:function(){var t=o.ToJSON(this),e={autoRound:this.autoRound,text:this._text,style:this.style.toJSON(),padding:{left:this.padding.left,right:this.padding.right,top:this.padding.top,bottom:this.padding.bottom}};return t.data=e,t},onContextRestored:function(){this.dirty=!0},preDestroy:function(){this.style.rtl&&c(this.canvas),n.remove(this.canvas),this.texture.destroy(),this.scene.sys.game.events.off(a.CONTEXT_RESTORED,this.onContextRestored,this)}});t.exports=f},71649:t=>{t.exports=function(t,e,i,s){0!==e.width&&0!==e.height&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,s))}},75397:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(76555);n.register("text",(function(t,e){void 0===t&&(t={});var i=r(t,"text",""),n=r(t,"style",null),a=r(t,"padding",null);null!==a&&(n.padding=a);var h=new o(this.scene,0,0,i,n);return void 0!==e&&(t.add=e),s(this.scene,h,t),h.autoRound=r(t,"autoRound",!0),h.resolution=r(t,"resolution",1),h}))},94627:(t,e,i)=>{var s=i(76555);i(61286).register("text",(function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))}))},80032:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(76128),r=i(71649),t.exports={renderWebGL:n,renderCanvas:r}},74744:(t,e,i)=>{var s=i(56694),n=i(20494),r=i(10850),o=i(27030),a={fontFamily:["fontFamily","Courier"],fontSize:["fontSize","16px"],fontStyle:["fontStyle",""],backgroundColor:["backgroundColor",null],color:["color","#fff"],stroke:["stroke","#fff"],strokeThickness:["strokeThickness",0],shadowOffsetX:["shadow.offsetX",0],shadowOffsetY:["shadow.offsetY",0],shadowColor:["shadow.color","#000"],shadowBlur:["shadow.blur",0],shadowStroke:["shadow.stroke",!1],shadowFill:["shadow.fill",!1],align:["align","left"],maxLines:["maxLines",0],fixedWidth:["fixedWidth",0],fixedHeight:["fixedHeight",0],resolution:["resolution",0],rtl:["rtl",!1],testString:["testString","|MÉqgy"],baselineX:["baselineX",1.2],baselineY:["baselineY",1.4],wordWrapWidth:["wordWrap.width",null],wordWrapCallback:["wordWrap.callback",null],wordWrapCallbackScope:["wordWrap.callbackScope",null],wordWrapUseAdvanced:["wordWrap.useAdvancedWrap",!1]},h=new s({initialize:function(t,e){this.parent=t,this.fontFamily,this.fontSize,this.fontStyle,this.backgroundColor,this.color,this.stroke,this.strokeThickness,this.shadowOffsetX,this.shadowOffsetY,this.shadowColor,this.shadowBlur,this.shadowStroke,this.shadowFill,this.align,this.maxLines,this.fixedWidth,this.fixedHeight,this.resolution,this.rtl,this.testString,this.baselineX,this.baselineY,this.wordWrapWidth,this.wordWrapCallback,this.wordWrapCallbackScope,this.wordWrapUseAdvanced,this._font,this.setStyle(e,!1,!0)},setStyle:function(t,e,i){for(var s in void 0===e&&(e=!0),void 0===i&&(i=!1),t&&t.hasOwnProperty("fontSize")&&"number"==typeof t.fontSize&&(t.fontSize=t.fontSize.toString()+"px"),a){var h=i?a[s][1]:this[s];this[s]="wordWrapCallback"===s||"wordWrapCallbackScope"===s?r(t,a[s][0],h):n(t,a[s][0],h)}var l=r(t,"font",null);null!==l&&this.setFont(l,!1),this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim();var u=r(t,"fill",null);null!==u&&(this.color=u);var c=r(t,"metrics",!1);return c?this.metrics={ascent:r(c,"ascent",0),descent:r(c,"descent",0),fontSize:r(c,"fontSize",0)}:!e&&this.metrics||(this.metrics=o(this)),e?this.parent.updateText():this.parent},syncFont:function(t,e){e.font=this._font},syncStyle:function(t,e){e.textBaseline="alphabetic",e.fillStyle=this.color,e.strokeStyle=this.stroke,e.lineWidth=this.strokeThickness,e.lineCap="round",e.lineJoin="round"},syncShadow:function(t,e){e?(t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur):(t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowColor=0,t.shadowBlur=0)},update:function(t){return t&&(this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim(),this.metrics=o(this)),this.parent.updateText()},setFont:function(t,e){void 0===e&&(e=!0);var i=t,s="",n="";if("string"!=typeof t)i=r(t,"fontFamily","Courier"),s=r(t,"fontSize","16px"),n=r(t,"fontStyle","");else{var o=t.split(" "),a=0;n=o.length>2?o[a++]:"",s=o[a++]||"16px",i=o[a++]||"Courier"}return i===this.fontFamily&&s===this.fontSize&&n===this.fontStyle||(this.fontFamily=i,this.fontSize=s,this.fontStyle=n,e&&this.update(!0)),this.parent},setFontFamily:function(t){return this.fontFamily!==t&&(this.fontFamily=t,this.update(!0)),this.parent},setFontStyle:function(t){return this.fontStyle!==t&&(this.fontStyle=t,this.update(!0)),this.parent},setFontSize:function(t){return"number"==typeof t&&(t=t.toString()+"px"),this.fontSize!==t&&(this.fontSize=t,this.update(!0)),this.parent},setTestString:function(t){return this.testString=t,this.update(!0)},setFixedSize:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(!1)},setBackgroundColor:function(t){return this.backgroundColor=t,this.update(!1)},setFill:function(t){return this.color=t,this.update(!1)},setColor:function(t){return this.color=t,this.update(!1)},setResolution:function(t){return this.resolution=t,this.update(!1)},setStroke:function(t,e){return void 0===e&&(e=this.strokeThickness),void 0===t&&0!==this.strokeThickness?(this.strokeThickness=0,this.update(!0)):this.stroke===t&&this.strokeThickness===e||(this.stroke=t,this.strokeThickness=e,this.update(!0)),this.parent},setShadow:function(t,e,i,s,n,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===s&&(s=0),void 0===n&&(n=!1),void 0===r&&(r=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=i,this.shadowBlur=s,this.shadowStroke=n,this.shadowFill=r,this.update(!1)},setShadowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)},setShadowColor:function(t){return void 0===t&&(t="#000"),this.shadowColor=t,this.update(!1)},setShadowBlur:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)},setShadowStroke:function(t){return this.shadowStroke=t,this.update(!1)},setShadowFill:function(t){return this.shadowFill=t,this.update(!1)},setWordWrapWidth:function(t,e){return void 0===e&&(e=!1),this.wordWrapWidth=t,this.wordWrapUseAdvanced=e,this.update(!1)},setWordWrapCallback:function(t,e){return void 0===e&&(e=null),this.wordWrapCallback=t,this.wordWrapCallbackScope=e,this.update(!1)},setAlign:function(t){return void 0===t&&(t="left"),this.align=t,this.update(!1)},setMaxLines:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)},getTextMetrics:function(){var t=this.metrics;return{ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}},toJSON:function(){var t={};for(var e in a)t[e]=this[e];return t.metrics=this.getTextMetrics(),t},destroy:function(){this.parent=void 0}});t.exports=h},76128:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i,n){if(0!==e.width&&0!==e.height){i.addToRenderList(e);var r=e.frame,o=r.width,a=r.height,h=s.getTintAppendFloatAlpha,l=t.pipelines.set(e.pipeline,e),u=l.setTexture2D(r.glTexture,e);l.batchTexture(e,r.glTexture,o,a,e.x,e.y,o/e.style.resolution,a/e.style.resolution,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,o,a,h(e.tintTopLeft,i.alpha*e._alphaTL),h(e.tintTopRight,i.alpha*e._alphaTR),h(e.tintBottomLeft,i.alpha*e._alphaBL),h(e.tintBottomRight,i.alpha*e._alphaBR),e.tintFill,0,0,i,n,!1,u)}}},35856:(t,e,i)=>{var s=i(61068),n=i(56694),r=i(64937),o=i(97081),a=i(89980),h=i(3504),l=i(8213),u=i(9271),c=i(93736),d=new n({Extends:a,Mixins:[r.Alpha,r.BlendMode,r.ComputedSize,r.Crop,r.Depth,r.Flip,r.FX,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.ScrollFactor,r.Tint,r.Transform,r.Visible,u],initialize:function(t,e,i,n,r,l,u){var d=t.sys.renderer;a.call(this,t,"TileSprite");var p=t.sys.textures.get(l),f=p.get(u);f.source.compressionAlgorithm&&(console.warn("TileSprite cannot use compressed textures"),f=(p=t.sys.textures.get("__MISSING")).get()),n&&r?(n=Math.floor(n),r=Math.floor(r)):(n=f.width,r=f.height),this._tilePosition=new c,this._tileScale=new c(1,1),this.dirty=!1,this.renderer=d,this.canvas=s.create(this,n,r),this.context=this.canvas.getContext("2d"),this.displayTexture=p,this.displayFrame=f,this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(null,this.canvas,!0),this.frame=this.texture.get(),this.potWidth=h(f.width),this.potHeight=h(f.height),this.fillCanvas=s.create2D(this,this.potWidth,this.potHeight),this.fillContext=this.fillCanvas.getContext("2d"),this.fillPattern=null,this.setPosition(e,i),this.setSize(n,r),this.setFrame(u),this.setOriginFromFrame(),this.initPipeline(),t.sys.game.events.on(o.CONTEXT_RESTORED,this.onContextRestored,this)},setTexture:function(t,e){return this.displayTexture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t){var e=this.displayTexture.get(t);return this.potWidth=h(e.width),this.potHeight=h(e.height),this.canvas.width=0,e.cutWidth&&e.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this.displayFrame=e,this.dirty=!0,this.updateTileTexture(),this},setTilePosition:function(t,e){return void 0!==t&&(this.tilePositionX=t),void 0!==e&&(this.tilePositionY=e),this},setTileScale:function(t,e){return void 0===t&&(t=this.tileScaleX),void 0===e&&(e=t),this.tileScaleX=t,this.tileScaleY=e,this},updateTileTexture:function(){if(this.dirty&&this.renderer){var t=this.displayFrame;if(t.source.isRenderTexture||t.source.isGLTexture)return console.warn("TileSprites can only use Image or Canvas based textures"),void(this.dirty=!1);var e=this.fillContext,i=this.fillCanvas,s=this.potWidth,n=this.potHeight;this.renderer&&this.renderer.gl||(s=t.cutWidth,n=t.cutHeight),e.clearRect(0,0,s,n),i.width=s,i.height=n,e.drawImage(t.source.image,t.cutX,t.cutY,t.cutWidth,t.cutHeight,0,0,s,n),this.renderer&&this.renderer.gl?this.fillPattern=this.renderer.canvasToTexture(i,this.fillPattern):this.fillPattern=e.createPattern(i,"repeat"),this.updateCanvas(),this.dirty=!1}},updateCanvas:function(){var t=this.canvas;if(t.width===this.width&&t.height===this.height||(t.width=this.width,t.height=this.height,this.frame.setSize(this.width,this.height),this.updateDisplayOrigin(),this.dirty=!0),!this.dirty||this.renderer&&this.renderer.gl)this.dirty=!1;else{var e=this.context;this.scene.sys.game.config.antialias||l.disable(e);var i=this._tileScale.x,s=this._tileScale.y,n=this._tilePosition.x,r=this._tilePosition.y;e.clearRect(0,0,this.width,this.height),e.save(),e.scale(i,s),e.translate(-n,-r),e.fillStyle=this.fillPattern,e.fillRect(n,r,this.width/i,this.height/s),e.restore(),this.dirty=!1}},onContextRestored:function(t){if(t){var e=t.gl;this.dirty=!0,this.fillPattern=null,this.fillPattern=t.createTexture2D(0,e.LINEAR,e.LINEAR,e.REPEAT,e.REPEAT,e.RGBA,this.fillCanvas,this.potWidth,this.potHeight)}},preDestroy:function(){this.renderer&&this.renderer.gl&&this.renderer.deleteTexture(this.fillPattern),s.remove(this.canvas),s.remove(this.fillCanvas),this.fillPattern=null,this.fillContext=null,this.fillCanvas=null,this.displayTexture=null,this.displayFrame=null,this.texture.destroy(),this.renderer=null,this.scene.sys.game.events.off(o.CONTEXT_RESTORED,this.onContextRestored,this)},tilePositionX:{get:function(){return this._tilePosition.x},set:function(t){this._tilePosition.x=t,this.dirty=!0}},tilePositionY:{get:function(){return this._tilePosition.y},set:function(t){this._tilePosition.y=t,this.dirty=!0}},tileScaleX:{get:function(){return this._tileScale.x},set:function(t){this._tileScale.x=t,this.dirty=!0}},tileScaleY:{get:function(){return this._tileScale.y},set:function(t){this._tileScale.y=t,this.dirty=!0}}});t.exports=d},93305:t=>{t.exports=function(t,e,i,s){e.updateCanvas(),i.addToRenderList(e),t.batchSprite(e,e.frame,i,s)}},63950:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(35856);n.register("tileSprite",(function(t,e){void 0===t&&(t={});var i=r(t,"x",0),n=r(t,"y",0),a=r(t,"width",512),h=r(t,"height",512),l=r(t,"key",""),u=r(t,"frame",""),c=new o(this.scene,i,n,a,h,l,u);return void 0!==e&&(t.add=e),s(this.scene,c,t),c}))},20509:(t,e,i)=>{var s=i(35856);i(61286).register("tileSprite",(function(t,e,i,n,r,o){return this.displayList.add(new s(this.scene,t,e,i,n,r,o))}))},9271:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(74287),r=i(93305),t.exports={renderWebGL:n,renderCanvas:r}},74287:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i,n){e.updateCanvas();var r=e.width,o=e.height;if(0!==r&&0!==o){i.addToRenderList(e);var a=s.getTintAppendFloatAlpha,h=t.pipelines.set(e.pipeline,e),l=h.setTexture2D(e.fillPattern,e);h.batchTexture(e,e.fillPattern,e.displayFrame.width*e.tileScaleX,e.displayFrame.height*e.tileScaleY,e.x,e.y,r,o,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.originX*r,e.originY*o,0,0,r,o,a(e.tintTopLeft,i.alpha*e._alphaTL),a(e.tintTopRight,i.alpha*e._alphaTR),a(e.tintBottomLeft,i.alpha*e._alphaBL),a(e.tintBottomRight,i.alpha*e._alphaBR),e.tintFill,e.tilePositionX%e.displayFrame.width/e.displayFrame.width,e.tilePositionY%e.displayFrame.height/e.displayFrame.height,i,n,!1,l)}}},8630:(t,e,i)=>{var s=i(56694),n=i(82897),r=i(64937),o=i(56631),a=i(97081),h=i(33963),l=i(89980),u=i(76038),c=i(76583),d=i(77974),p=i(83392),f=new s({Extends:l,Mixins:[r.Alpha,r.BlendMode,r.Depth,r.Flip,r.FX,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.ScrollFactor,r.Size,r.TextureCrop,r.Tint,r.Transform,r.Visible,d],initialize:function(t,e,i,s){l.call(this,t,"Video"),this.video=null,this.videoTexture=null,this.videoTextureSource=null,this.snapshotTexture=null,this.flipY=!1,this._key=c(),this.touchLocked=!0,this.playWhenUnlocked=!1,this.retryLimit=20,this.retry=0,this.retryInterval=500,this._retryID=null,this._systemMuted=!1,this._codeMuted=!1,this._systemPaused=!1,this._codePaused=!1,this._callbacks={play:this.playHandler.bind(this),error:this.loadErrorHandler.bind(this),end:this.completeHandler.bind(this),time:this.timeUpdateHandler.bind(this),seeking:this.seekingHandler.bind(this),seeked:this.seekedHandler.bind(this)},this._crop=this.resetCropObject(),this.markers={},this._markerIn=-1,this._markerOut=p.MAX_SAFE_INTEGER,this._lastUpdate=0,this._cacheKey="",this._isSeeking=!1,this.removeVideoElementOnDestroy=!1,this.setPosition(e,i),this.initPipeline(),s&&this.changeSource(s,!1);var n=t.sys.game.events;n.on(a.PAUSE,this.globalPause,this),n.on(a.RESUME,this.globalResume,this);var r=t.sys.sound;r&&r.on(u.GLOBAL_MUTE,this.globalMute,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},play:function(t,e,i){if(this.touchLocked&&this.playWhenUnlocked||this.isPlaying())return this;var s=this.video;if(!s)return console.warn("Video not loaded"),this;void 0===t&&(t=s.loop);var n=this.scene.sys.sound;n&&n.mute&&this.setMute(!0),isNaN(e)||(this._markerIn=e),!isNaN(i)&&i>e&&(this._markerOut=i),s.loop=t;var r=this._callbacks,o=s.play();return void 0!==o?o.then(this.playPromiseSuccessHandler.bind(this)).catch(this.playPromiseErrorHandler.bind(this)):(s.addEventListener("playing",r.play,!0),s.readyState<2&&(this.retry=this.retryLimit,this._retryID=window.setTimeout(this.checkVideoProgress.bind(this),this.retryInterval))),s.addEventListener("ended",r.end,!0),s.addEventListener("timeupdate",r.time,!0),s.addEventListener("seeking",r.seeking,!0),s.addEventListener("seeked",r.seeked,!0),this},changeSource:function(t,e,i,s,n){void 0===e&&(e=!0),this.video&&this.stop();var r=this.scene.sys.cache.video.get(t);return r?(this.video=r,this._cacheKey=t,this._codePaused=r.paused,this._codeMuted=r.muted,this.videoTexture?(this.scene.sys.textures.remove(this._key),this.videoTexture=this.scene.sys.textures.create(this._key,r,r.videoWidth,r.videoHeight),this.videoTextureSource=this.videoTexture.source[0],this.videoTexture.add("__BASE",0,0,0,r.videoWidth,r.videoHeight),this.setTexture(this.videoTexture),this.setSizeToFrame(),this.updateDisplayOrigin(),this.emit(o.VIDEO_CREATED,this,r.videoWidth,r.videoHeight)):this.updateTexture(),r.currentTime=0,this._lastUpdate=0,e&&this.play(i,s,n)):this.video=null,this},addMarker:function(t,e,i){return!isNaN(e)&&e>=0&&!isNaN(i)&&(this.markers[t]=[e,i]),this},playMarker:function(t,e){var i=this.markers[t];return i&&this.play(e,i[0],i[1]),this},removeMarker:function(t){return delete this.markers[t],this},snapshot:function(t,e){return void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.snapshotArea(0,0,this.width,this.height,t,e)},snapshotArea:function(t,e,i,s,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===s&&(s=this.height),void 0===n&&(n=i),void 0===r&&(r=s);var o=this.video,a=this.snapshotTexture;return a?(a.setSize(n,r),o&&a.context.drawImage(o,t,e,i,s,0,0,n,r)):(a=this.scene.sys.textures.createCanvas(c(),n,r),this.snapshotTexture=a,o&&a.context.drawImage(o,t,e,i,s,0,0,n,r)),a.update()},saveSnapshotTexture:function(t){return this.snapshotTexture?this.scene.sys.textures.renameTexture(this.snapshotTexture.key,t):this.snapshotTexture=this.scene.sys.textures.createCanvas(t,this.width,this.height),this.snapshotTexture},loadURL:function(t,e,i,s){void 0===e&&(e="loadeddata"),void 0===i&&(i=!1),this.video&&this.stop(),this.videoTexture&&this.scene.sys.textures.remove(this._key);var n=document.createElement("video");return n.controls=!1,i&&(n.muted=!0,n.defaultMuted=!0,n.setAttribute("autoplay","autoplay")),n.setAttribute("playsinline","playsinline"),n.setAttribute("preload","auto"),void 0!==s&&n.setAttribute("crossorigin",s),n.addEventListener("error",this._callbacks.error,!0),n.src=t,n.load(),this.video=n,this},loadMediaStream:function(t,e,i){void 0===e&&(e="loadeddata"),void 0===i&&(i=!1),this.video&&this.stop(),this.videoTexture&&this.scene.sys.textures.remove(this._key);var s=document.createElement("video");s.controls=!1,i&&(s.muted=!0,s.defaultMuted=!0,s.setAttribute("autoplay","autoplay")),s.setAttribute("playsinline","playsinline"),s.setAttribute("preload","auto"),s.addEventListener("error",this._callbacks.error,!0);try{s.srcObject=t}catch(e){s.src=window.URL.createObjectURL(t)}return s.load(),this.video=s,this},playPromiseSuccessHandler:function(){this._codePaused=!1,this.touchLocked=!1,this.emit(o.VIDEO_PLAY,this),this._markerIn>-1&&(this.video.currentTime=this._markerIn)},playPromiseErrorHandler:function(t){this.scene.sys.input.once(h.POINTER_DOWN,this.unlockHandler,this),this.touchLocked=!0,this.playWhenUnlocked=!0,this.emit(o.VIDEO_ERROR,this,t)},playHandler:function(){this._codePaused=!1,this.touchLocked=!1,this.emit(o.VIDEO_PLAY,this),this.video.removeEventListener("playing",this._callbacks.play,!0)},loadErrorHandler:function(t){this.stop(),this.emit(o.VIDEO_ERROR,this,t)},unlockHandler:function(){this.touchLocked=!1,this.playWhenUnlocked=!1,this.emit(o.VIDEO_UNLOCKED,this),this._markerIn>-1&&(this.video.currentTime=this._markerIn),this.video.play(),this.emit(o.VIDEO_PLAY,this)},completeHandler:function(){this.emit(o.VIDEO_COMPLETE,this)},timeUpdateHandler:function(){this.video&&this.video.currentTime=this._markerOut&&(t.loop?(t.currentTime=this._markerIn,this.updateTexture(),this._lastUpdate=e,this.emit(o.VIDEO_LOOP,this)):(this.emit(o.VIDEO_COMPLETE,this),this.stop())))}},checkVideoProgress:function(){this.video.readyState>=2?this.updateTexture():(this.retry--,this.retry>0?this._retryID=window.setTimeout(this.checkVideoProgress.bind(this),this.retryInterval):this.emit(o.VIDEO_TIMEOUT,this))},updateTexture:function(){var t=this.video,e=t.videoWidth,i=t.videoHeight;if(this.videoTexture){var s=this.videoTextureSource;s.source!==t&&(s.source=t,s.width=e,s.height=i),s.update()}else this.videoTexture=this.scene.sys.textures.create(this._key,t,e,i),this.videoTextureSource=this.videoTexture.source[0],this.videoTexture.add("__BASE",0,0,0,e,i),this.setTexture(this.videoTexture),this.setSizeToFrame(),this.updateDisplayOrigin(),this.emit(o.VIDEO_CREATED,this,e,i)},getVideoKey:function(){return this._cacheKey},seekTo:function(t){var e=this.video;if(e){var i=e.duration;if(i!==1/0&&!isNaN(i)){var s=i*t;this.setCurrentTime(s)}}return this},getCurrentTime:function(){return this.video?this.video.currentTime:0},setCurrentTime:function(t){var e=this.video;if(e){if("string"==typeof t){var i=t[0],s=parseFloat(t.substr(1));"+"===i?t=e.currentTime+s:"-"===i&&(t=e.currentTime-s)}e.currentTime=t,this._lastUpdate=t}return this},isSeeking:function(){return this._isSeeking},seekingHandler:function(){this._isSeeking=!0,this.emit(o.VIDEO_SEEKING,this)},seekedHandler:function(){this._isSeeking=!1,this.emit(o.VIDEO_SEEKED,this),this.video&&this.updateTexture()},getProgress:function(){var t=this.video;if(t){var e=t.currentTime,i=t.duration;if(i!==1/0&&!isNaN(i))return e/i}return 0},getDuration:function(){return this.video?this.video.duration:0},setMute:function(t){void 0===t&&(t=!0),this._codeMuted=t;var e=this.video;return e&&(e.muted=!!this._systemMuted||t),this},isMuted:function(){return this._codeMuted},globalMute:function(t,e){this._systemMuted=e;var i=this.video;i&&(i.muted=!!this._codeMuted||e)},globalPause:function(){this._systemPaused=!0,this.video&&this.video.pause()},globalResume:function(){this._systemPaused=!1,this.video&&!this._codePaused&&this.video.play()},setPaused:function(t){void 0===t&&(t=!0);var e=this.video;return this._codePaused=t,e&&(t?e.paused||e.pause():t||e.paused&&!this._systemPaused&&e.play()),this},getVolume:function(){return this.video?this.video.volume:1},setVolume:function(t){return void 0===t&&(t=1),this.video&&(this.video.volume=n(t,0,1)),this},getPlaybackRate:function(){return this.video?this.video.playbackRate:1},setPlaybackRate:function(t){return this.video&&(this.video.playbackRate=t),this},getLoop:function(){return!!this.video&&this.video.loop},setLoop:function(t){return void 0===t&&(t=!0),this.video&&(this.video.loop=t),this},isPlaying:function(){return!!this.video&&!(this.video.paused||this.video.ended)},isPaused:function(){return this.video&&this.video.paused||this._codePaused||this._systemPaused},saveTexture:function(t,e){return void 0===e&&(e=!1),this.videoTexture&&this.scene.sys.textures.renameTexture(this._key,t),this._key=t,this.flipY=e,this.videoTextureSource&&this.videoTextureSource.setFlipY(e),this.videoTexture},stop:function(){var t=this.video;if(t){var e=this._callbacks;for(var i in e)t.removeEventListener(i,e[i],!0);t.pause()}return this._retryID&&window.clearTimeout(this._retryID),this.emit(o.VIDEO_STOP,this),this},removeVideoElement:function(){var t=this.video;if(t){for(t.parentNode&&t.parentNode.removeChild(t);t.hasChildNodes();)t.removeChild(t.firstChild);t.removeAttribute("autoplay"),t.removeAttribute("src"),this.video=null}},preDestroy:function(){this.stop(),this.removeVideoElementOnDestroy&&this.removeVideoElement();var t=this.scene.sys.game.events;t.off(a.PAUSE,this.globalPause,this),t.off(a.RESUME,this.globalResume,this);var e=this.scene.sys.sound;e&&e.off(u.GLOBAL_MUTE,this.globalMute,this),this._retryID&&window.clearTimeout(this._retryID)}});t.exports=f},56933:t=>{t.exports=function(t,e,i,s){e.videoTexture&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,s))}},65601:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(8630);n.register("video",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=new o(this.scene,0,0,i);return void 0!==e&&(t.add=e),s(this.scene,n,t),n}))},215:(t,e,i)=>{var s=i(8630);i(61286).register("video",(function(t,e,i){return this.displayList.add(new s(this.scene,t,e,i))}))},77974:(t,e,i)=>{var s=i(72283),n=s,r=s;n=i(83572),r=i(56933),t.exports={renderWebGL:n,renderCanvas:r}},83572:t=>{t.exports=function(t,e,i,s){e.videoTexture&&(i.addToRenderList(e),e.pipeline.batchSprite(e,i,s))}},71030:(t,e,i)=>{var s=i(95723),n=i(26673),r=i(65650),o=i(56694),a=i(64937),h=i(89980),l=i(74118),u=i(94287),c=new o({Extends:h,Mixins:[a.Depth,a.GetBounds,a.Origin,a.Transform,a.ScrollFactor,a.Visible],initialize:function(t,e,i,n,r){void 0===n&&(n=1),void 0===r&&(r=n),h.call(this,t,"Zone"),this.setPosition(e,i),this.width=n,this.height=r,this.blendMode=s.NORMAL,this.updateDisplayOrigin()},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e,i){void 0===i&&(i=!0),this.width=t,this.height=e,this.updateDisplayOrigin();var s=this.input;return i&&s&&!s.customHitArea&&(s.hitArea.width=t,s.hitArea.height=e),this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},setCircleDropZone:function(t){return this.setDropZone(new n(0,0,t),r)},setRectangleDropZone:function(t,e){return this.setDropZone(new l(0,0,t,e),u)},setDropZone:function(t,e){return this.input||this.setInteractive(t,e,!0),this},setAlpha:function(){},setBlendMode:function(){},renderCanvas:function(t,e,i){i.addToRenderList(e)},renderWebGL:function(t,e,i){i.addToRenderList(e)}});t.exports=c},24067:(t,e,i)=>{var s=i(99325),n=i(20494),r=i(71030);s.register("zone",(function(t){var e=n(t,"x",0),i=n(t,"y",0),s=n(t,"width",1),o=n(t,"height",s);return new r(this.scene,e,i,s,o)}))},34546:(t,e,i)=>{var s=i(71030);i(61286).register("zone",(function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))}))},95847:t=>{t.exports=function(t){return t.radius>0?Math.PI*t.radius*t.radius:0}},26673:(t,e,i)=>{var s=i(56694),n=i(65650),r=i(94026),o=i(62941),a=i(52394),h=i(30977),l=new s({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.type=a.CIRCLE,this.x=t,this.y=e,this._radius=i,this._diameter=2*i},contains:function(t,e){return n(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i){return this.x=t,this.y=e,this._radius=i,this._diameter=2*i,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this._diameter=2*t}},diameter:{get:function(){return this._diameter},set:function(t){this._diameter=t,this._radius=.5*t}},left:{get:function(){return this.x-this._radius},set:function(t){this.x=t+this._radius}},right:{get:function(){return this.x+this._radius},set:function(t){this.x=t-this._radius}},top:{get:function(){return this.y-this._radius},set:function(t){this.y=t+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(t){this.y=t-this._radius}}});t.exports=l},37964:t=>{t.exports=function(t){return Math.PI*t.radius*2}},72233:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){return void 0===i&&(i=new s),i.x=t.x+t.radius*Math.cos(e),i.y=t.y+t.radius*Math.sin(e),i}},61761:(t,e,i)=>{var s=i(26673);t.exports=function(t){return new s(t.x,t.y,t.radius)}},65650:t=>{t.exports=function(t,e,i){return t.radius>0&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},39187:(t,e,i)=>{var s=i(65650);t.exports=function(t,e){return s(t,e.x,e.y)}},58672:(t,e,i)=>{var s=i(65650);t.exports=function(t,e){return s(t,e.x,e.y)&&s(t,e.right,e.y)&&s(t,e.x,e.bottom)&&s(t,e.right,e.bottom)}},42997:t=>{t.exports=function(t,e){return e.setTo(t.x,t.y,t.radius)}},94894:t=>{t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.radius===e.radius}},48027:(t,e,i)=>{var s=i(74118);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.left,e.y=t.top,e.width=t.diameter,e.height=t.diameter,e}},94026:(t,e,i)=>{var s=i(72233),n=i(91806),r=i(83392),o=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new o);var a=n(e,0,r.PI2);return s(t,a,i)}},62941:(t,e,i)=>{var s=i(37964),n=i(72233),r=i(91806),o=i(83392);t.exports=function(t,e,i,a){void 0===a&&(a=[]),!e&&i>0&&(e=s(t)/i);for(var h=0;h{t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},88665:t=>{t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},30977:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){void 0===e&&(e=new s);var i=2*Math.PI*Math.random(),n=Math.random()+Math.random(),r=n>1?2-n:n,o=r*Math.cos(i),a=r*Math.sin(i);return e.x=t.x+o*t.radius,e.y=t.y+a*t.radius,e}},6112:(t,e,i)=>{var s=i(26673);s.Area=i(95847),s.Circumference=i(37964),s.CircumferencePoint=i(72233),s.Clone=i(61761),s.Contains=i(65650),s.ContainsPoint=i(39187),s.ContainsRect=i(58672),s.CopyFrom=i(42997),s.Equals=i(94894),s.GetBounds=i(48027),s.GetPoint=i(94026),s.GetPoints=i(62941),s.Offset=i(34585),s.OffsetPoint=i(88665),s.Random=i(30977),t.exports=s},52394:t=>{t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},58605:t=>{t.exports=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI}},39507:t=>{t.exports=function(t){var e=t.width/2,i=t.height/2,s=Math.pow(e-i,2)/Math.pow(e+i,2);return Math.PI*(e+i)*(1+3*s/(10+Math.sqrt(4-3*s)))}},86998:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=t.width/2,r=t.height/2;return i.x=t.x+n*Math.cos(e),i.y=t.y+r*Math.sin(e),i}},81773:(t,e,i)=>{var s=i(95669);t.exports=function(t){return new s(t.x,t.y,t.width,t.height)}},72313:t=>{t.exports=function(t,e,i){if(t.width<=0||t.height<=0)return!1;var s=(e-t.x)/t.width,n=(i-t.y)/t.height;return(s*=s)+(n*=n)<.25}},34368:(t,e,i)=>{var s=i(72313);t.exports=function(t,e){return s(t,e.x,e.y)}},71431:(t,e,i)=>{var s=i(72313);t.exports=function(t,e){return s(t,e.x,e.y)&&s(t,e.right,e.y)&&s(t,e.x,e.bottom)&&s(t,e.right,e.bottom)}},75459:t=>{t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},95669:(t,e,i)=>{var s=i(56694),n=i(72313),r=i(95340),o=i(54978),a=i(52394),h=i(72006),l=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.type=a.ELLIPSE,this.x=t,this.y=e,this.width=i,this.height=s},contains:function(t,e){return n(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setEmpty:function(){return this.width=0,this.height=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getMinorRadius:function(){return Math.min(this.width,this.height)/2},getMajorRadius:function(){return Math.max(this.width,this.height)/2},left:{get:function(){return this.x-this.width/2},set:function(t){this.x=t+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(t){this.y=t+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=l},98068:t=>{t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},72897:(t,e,i)=>{var s=i(74118);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.left,e.y=t.top,e.width=t.width,e.height=t.height,e}},95340:(t,e,i)=>{var s=i(86998),n=i(91806),r=i(83392),o=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new o);var a=n(e,0,r.PI2);return s(t,a,i)}},54978:(t,e,i)=>{var s=i(39507),n=i(86998),r=i(91806),o=i(83392);t.exports=function(t,e,i,a){void 0===a&&(a=[]),!e&&i>0&&(e=s(t)/i);for(var h=0;h{t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},36233:t=>{t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},72006:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){void 0===e&&(e=new s);var i=Math.random()*Math.PI*2,n=Math.sqrt(Math.random());return e.x=t.x+n*Math.cos(i)*t.width/2,e.y=t.y+n*Math.sin(i)*t.height/2,e}},40652:(t,e,i)=>{var s=i(95669);s.Area=i(58605),s.Circumference=i(39507),s.CircumferencePoint=i(86998),s.Clone=i(81773),s.Contains=i(72313),s.ContainsPoint=i(34368),s.ContainsRect=i(71431),s.CopyFrom=i(75459),s.Equals=i(98068),s.GetBounds=i(72897),s.GetPoint=i(95340),s.GetPoints=i(54978),s.Offset=i(77951),s.OffsetPoint=i(36233),s.Random=i(72006),t.exports=s},84068:(t,e,i)=>{var s=i(52394),n=i(98611),r={Circle:i(6112),Ellipse:i(40652),Intersects:i(7563),Line:i(28482),Mesh:i(14293),Point:i(63472),Polygon:i(44359),Rectangle:i(66658),Triangle:i(87619)};r=n(!1,r,s),t.exports=r},22184:(t,e,i)=>{var s=i(53996);t.exports=function(t,e){return s(t.x,t.y,e.x,e.y)<=t.radius+e.radius}},26535:t=>{t.exports=function(t,e){var i=e.width/2,s=e.height/2,n=Math.abs(t.x-e.x-i),r=Math.abs(t.y-e.y-s),o=i+t.radius,a=s+t.radius;if(n>o||r>a)return!1;if(n<=i||r<=s)return!0;var h=n-i,l=r-s;return h*h+l*l<=t.radius*t.radius}},71145:(t,e,i)=>{var s=i(79967),n=i(22184);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r,o,a,h,l=t.x,u=t.y,c=t.radius,d=e.x,p=e.y,f=e.radius;if(u===p)0===(a=(o=-2*p)*o-4*(r=1)*(d*d+(h=(f*f-c*c-d*d+l*l)/(2*(l-d)))*h-2*d*h+p*p-f*f))?i.push(new s(h,-o/(2*r))):a>0&&(i.push(new s(h,(-o+Math.sqrt(a))/(2*r))),i.push(new s(h,(-o-Math.sqrt(a))/(2*r))));else{var v=(l-d)/(u-p),g=(f*f-c*c-d*d+l*l-p*p+u*u)/(2*(u-p));0===(a=(o=2*u*v-2*g*v-2*l)*o-4*(r=v*v+1)*(l*l+u*u+g*g-c*c-2*u*g))?(h=-o/(2*r),i.push(new s(h,g-h*v))):a>0&&(h=(-o+Math.sqrt(a))/(2*r),i.push(new s(h,g-h*v)),h=(-o-Math.sqrt(a))/(2*r),i.push(new s(h,g-h*v)))}}return i}},62508:(t,e,i)=>{var s=i(26111),n=i(26535);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC(),h=e.getLineD();s(r,t,i),s(o,t,i),s(a,t,i),s(h,t,i)}return i}},26111:(t,e,i)=>{var s=i(79967),n=i(61472);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r,o,a=t.x1,h=t.y1,l=t.x2,u=t.y2,c=e.x,d=e.y,p=e.radius,f=l-a,v=u-h,g=a-c,m=h-d,y=f*f+v*v,x=2*(f*g+v*m),T=x*x-4*y*(g*g+m*m-p*p);if(0===T){var w=-x/(2*y);r=a+w*f,o=h+w*v,w>=0&&w<=1&&i.push(new s(r,o))}else if(T>0){var b=(-x-Math.sqrt(T))/(2*y);r=a+b*f,o=h+b*v,b>=0&&b<=1&&i.push(new s(r,o));var E=(-x+Math.sqrt(T))/(2*y);r=a+E*f,o=h+E*v,E>=0&&E<=1&&i.push(new s(r,o))}}return i}},96537:(t,e,i)=>{var s=i(70015);t.exports=function(t,e,i,n){void 0===i&&(i=!1);var r,o,a,h=t.x1,l=t.y1,u=t.x2,c=t.y2,d=e.x1,p=e.y1,f=u-h,v=c-l,g=e.x2-d,m=e.y2-p,y=f*m-v*g;if(0===y)return!1;if(i){if((o=(d+g*(r=(f*(p-l)+v*(h-d))/(g*v-m*f))-h)/f)<0||r<0||r>1)return null;a=o}else{if(o=((l-p)*f-(h-d)*v)/y,(r=((d-h)*m-(p-l)*g)/y)<0||r>1||o<0||o>1)return null;a=r}return void 0===n&&(n=new s),n.set(h+f*a,l+v*a,a)}},17647:(t,e,i)=>{var s=i(96537),n=i(88829),r=i(70015),o=new n,a=new r;t.exports=function(t,e,i,n){void 0===i&&(i=!1),void 0===n&&(n=new r);var h=!1;n.set(),a.set();for(var l=e[0],u=1;u{var s=i(70015),n=i(51729),r=i(17647),o=new s;t.exports=function(t,e,i,s){void 0===s&&(s=new n),Array.isArray(e)||(e=[e]);var a=!1;s.set(),o.set();for(var h=0;h{var s=i(79967),n=i(25227),r=i(47910);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e))for(var o=e.getLineA(),a=e.getLineB(),h=e.getLineC(),l=e.getLineD(),u=[new s,new s,new s,new s],c=[n(o,t,u[0]),n(a,t,u[1]),n(h,t,u[2]),n(l,t,u[3])],d=0;d<4;d++)c[d]&&i.push(u[d]);return i}},7449:(t,e,i)=>{var s=i(51729),n=i(68439),r=new(i(88829));function o(t,e,i,o,a){var h=Math.cos(t),l=Math.sin(t);r.setTo(e,i,e+h,i+l);var u=n(r,o,!0);u&&a.push(new s(u.x,u.y,t,u.w))}function a(t,e){return t.z-e.z}t.exports=function(t,e,i){Array.isArray(i)||(i=[i]);for(var s=[],n=[],r=0;r{var s=i(74118),n=i(90205);t.exports=function(t,e,i){return void 0===i&&(i=new s),n(t,e)&&(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y),i}},1946:(t,e,i)=>{var s=i(9569),n=i(90205);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=t.getLineA(),o=t.getLineB(),a=t.getLineC(),h=t.getLineD();s(r,e,i),s(o,e,i),s(a,e,i),s(h,e,i)}return i}},34211:(t,e,i)=>{var s=i(20370),n=i(9569);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC();n(r,t,i),n(o,t,i),n(a,t,i)}return i}},80511:(t,e,i)=>{var s=i(26111),n=i(48411);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=t.getLineA(),o=t.getLineB(),a=t.getLineC();s(r,e,i),s(o,e,i),s(a,e,i)}return i}},31343:(t,e,i)=>{var s=i(79967),n=i(86117),r=i(25227);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e))for(var o=t.getLineA(),a=t.getLineB(),h=t.getLineC(),l=[new s,new s,new s],u=[r(o,e,l[0]),r(a,e,l[1]),r(h,e,l[2])],c=0;c<3;c++)u[c]&&i.push(l[c]);return i}},70534:(t,e,i)=>{var s=i(23589),n=i(31343);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC();n(t,r,i),n(t,o,i),n(t,a,i)}return i}},61472:(t,e,i)=>{var s=i(65650),n=new(i(79967));t.exports=function(t,e,i){if(void 0===i&&(i=n),s(e,t.x1,t.y1))return i.x=t.x1,i.y=t.y1,!0;if(s(e,t.x2,t.y2))return i.x=t.x2,i.y=t.y2,!0;var r=t.x2-t.x1,o=t.y2-t.y1,a=e.x-t.x1,h=e.y-t.y1,l=r*r+o*o,u=r,c=o;if(l>0){var d=(a*r+h*o)/l;u*=d,c*=d}return i.x=t.x1+u,i.y=t.y1+c,u*u+c*c<=l&&u*r+c*o>=0&&s(e,i.x,i.y)}},25227:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=t.x1,r=t.y1,o=t.x2,a=t.y2,h=e.x1,l=e.y1,u=e.x2,c=e.y2,d=(c-l)*(o-n)-(u-h)*(a-r);if(0===d)return!1;var p=((u-h)*(r-l)-(c-l)*(n-h))/d,f=((o-n)*(r-l)-(a-r)*(n-h))/d;return p>=0&&p<=1&&f>=0&&f<=1&&(i.x=n+p*(o-n),i.y=r+p*(a-r),!0)}},47910:t=>{t.exports=function(t,e){var i=t.x1,s=t.y1,n=t.x2,r=t.y2,o=e.x,a=e.y,h=e.right,l=e.bottom,u=0;if(i>=o&&i<=h&&s>=a&&s<=l||n>=o&&n<=h&&r>=a&&r<=l)return!0;if(i=o){if((u=s+(r-s)*(o-i)/(n-i))>a&&u<=l)return!0}else if(i>h&&n<=h&&(u=s+(r-s)*(h-i)/(n-i))>=a&&u<=l)return!0;if(s=a){if((u=i+(n-i)*(a-s)/(r-s))>=o&&u<=h)return!0}else if(s>l&&r<=l&&(u=i+(n-i)*(l-s)/(r-s))>=o&&u<=h)return!0;return!1}},34426:t=>{t.exports=function(t,e,i){void 0===i&&(i=1);var s=e.x1,n=e.y1,r=e.x2,o=e.y2,a=t.x,h=t.y,l=(r-s)*(r-s)+(o-n)*(o-n);if(0===l)return!1;var u=((a-s)*(r-s)+(h-n)*(o-n))/l;if(u<0)return Math.sqrt((s-a)*(s-a)+(n-h)*(n-h))<=i;if(u>=0&&u<=1){var c=((n-h)*(r-s)-(s-a)*(o-n))/l;return Math.abs(c)*Math.sqrt(l)<=i}return Math.sqrt((r-a)*(r-a)+(o-h)*(o-h))<=i}},81414:(t,e,i)=>{var s=i(34426);t.exports=function(t,e){if(!s(t,e))return!1;var i=Math.min(e.x1,e.x2),n=Math.max(e.x1,e.x2),r=Math.min(e.y1,e.y2),o=Math.max(e.y1,e.y2);return t.x>=i&&t.x<=n&&t.y>=r&&t.y<=o}},90205:t=>{t.exports=function(t,e){return!(t.width<=0||t.height<=0||e.width<=0||e.height<=0)&&!(t.righte.right||t.y>e.bottom)}},20370:(t,e,i)=>{var s=i(25227),n=i(94287),r=i(86875),o=i(87279);t.exports=function(t,e){if(e.left>t.right||e.rightt.bottom||e.bottom0}},8786:t=>{t.exports=function(t,e,i,s,n,r){return void 0===r&&(r=0),!(e>t.right+r||it.bottom+r||n{var s=i(61472),n=i(60689);t.exports=function(t,e){return!(t.left>e.right||t.righte.bottom||t.bottom{var s=i(25227);t.exports=function(t,e){return!(!t.contains(e.x1,e.y1)&&!t.contains(e.x2,e.y2))||(!!s(t.getLineA(),e)||(!!s(t.getLineB(),e)||!!s(t.getLineC(),e)))}},23589:(t,e,i)=>{var s=i(86875),n=i(18680),r=i(25227);t.exports=function(t,e){if(t.left>e.right||t.righte.bottom||t.bottom0||(c=n(e),(d=s(t,c,!0)).length>0)}},7563:(t,e,i)=>{t.exports={CircleToCircle:i(22184),CircleToRectangle:i(26535),GetCircleToCircle:i(71145),GetCircleToRectangle:i(62508),GetLineToCircle:i(26111),GetLineToLine:i(96537),GetLineToPoints:i(17647),GetLineToPolygon:i(68439),GetLineToRectangle:i(9569),GetRaysFromPointToPolygon:i(7449),GetRectangleIntersection:i(82931),GetRectangleToRectangle:i(1946),GetRectangleToTriangle:i(34211),GetTriangleToCircle:i(80511),GetTriangleToLine:i(31343),GetTriangleToTriangle:i(70534),LineToCircle:i(61472),LineToLine:i(25227),LineToRectangle:i(47910),PointToLine:i(34426),PointToLineSegment:i(81414),RectangleToRectangle:i(90205),RectangleToTriangle:i(20370),RectangleToValues:i(8786),TriangleToCircle:i(48411),TriangleToLine:i(86117),TriangleToTriangle:i(23589)}},50599:t=>{t.exports=function(t){return Math.atan2(t.y2-t.y1,t.x2-t.x1)}},58813:t=>{t.exports=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=[]);var s=Math.round(t.x1),n=Math.round(t.y1),r=Math.round(t.x2),o=Math.round(t.y2),a=Math.abs(r-s),h=Math.abs(o-n),l=s-h&&(c-=h,s+=l),p{t.exports=function(t,e,i){var s=e-(t.x1+t.x2)/2,n=i-(t.y1+t.y2)/2;return t.x1+=s,t.y1+=n,t.x2+=s,t.y2+=n,t}},26718:(t,e,i)=>{var s=i(88829);t.exports=function(t){return new s(t.x1,t.y1,t.x2,t.y2)}},88930:t=>{t.exports=function(t,e){return e.setTo(t.x1,t.y1,t.x2,t.y2)}},90656:t=>{t.exports=function(t,e){return t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2}},30897:(t,e,i)=>{var s=i(16028);t.exports=function(t,e,i){void 0===i&&(i=e);var n=s(t),r=t.x2-t.x1,o=t.y2-t.y1;return e&&(t.x1=t.x1-r/n*e,t.y1=t.y1-o/n*e),i&&(t.x2=t.x2+r/n*i,t.y2=t.y2+o/n*i),t}},30684:(t,e,i)=>{var s=i(92951),n=i(21902),r=i(79967);t.exports=function(t,e,i,o,a){void 0===o&&(o=0),void 0===a&&(a=[]);var h,l,u=[],c=t.x1,d=t.y1,p=t.x2-c,f=t.y2-d,v=n(e,a),g=i-1;for(h=0;h0){var m=u[0],y=[m];for(h=1;h=o&&(y.push(x),m=x)}var T=u[u.length-1];return s(m,T){var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=(t.x1+t.x2)/2,e.y=(t.y1+t.y2)/2,e}},11222:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=t.x1,r=t.y1,o=t.x2,a=t.y2,h=(o-n)*(o-n)+(a-r)*(a-r);if(0===h)return i;var l=((e.x-n)*(o-n)+(e.y-r)*(a-r))/h;return i.x=n+l*(o-n),i.y=r+l*(a-r),i}},7377:(t,e,i)=>{var s=i(83392),n=i(50599),r=i(79967);t.exports=function(t,e){void 0===e&&(e=new r);var i=n(t)-s.TAU;return e.x=Math.cos(i),e.y=Math.sin(i),e}},66464:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){return void 0===i&&(i=new s),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},8570:(t,e,i)=>{var s=i(16028),n=i(79967);t.exports=function(t,e,i,r){void 0===r&&(r=[]),!e&&i>0&&(e=s(t)/i);for(var o=t.x1,a=t.y1,h=t.x2,l=t.y2,u=0;u{t.exports=function(t,e){var i=t.x1,s=t.y1,n=t.x2,r=t.y2,o=(n-i)*(n-i)+(r-s)*(r-s);if(0===o)return!1;var a=((s-e.y)*(n-i)-(i-e.x)*(r-s))/o;return Math.abs(a)*Math.sqrt(o)}},82996:t=>{t.exports=function(t){return Math.abs(t.y1-t.y2)}},16028:t=>{t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},88829:(t,e,i)=>{var s=i(56694),n=i(66464),r=i(8570),o=i(52394),a=i(74077),h=i(93736),l=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.type=o.LINE,this.x1=t,this.y1=e,this.x2=i,this.y2=s},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return r(this,t,e,i)},getRandomPoint:function(t){return a(this,t)},setTo:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.x1=t,this.y1=e,this.x2=i,this.y2=s,this},getPointA:function(t){return void 0===t&&(t=new h),t.set(this.x1,this.y1),t},getPointB:function(t){return void 0===t&&(t=new h),t.set(this.x2,this.y2),t},left:{get:function(){return Math.min(this.x1,this.x2)},set:function(t){this.x1<=this.x2?this.x1=t:this.x2=t}},right:{get:function(){return Math.max(this.x1,this.x2)},set:function(t){this.x1>this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},73273:(t,e,i)=>{var s=i(83392),n=i(1071),r=i(50599);t.exports=function(t){var e=r(t)-s.TAU;return n(e,-Math.PI,Math.PI)}},96936:(t,e,i)=>{var s=i(83392),n=i(50599);t.exports=function(t){return Math.cos(n(t)-s.TAU)}},43581:(t,e,i)=>{var s=i(83392),n=i(50599);t.exports=function(t){return Math.sin(n(t)-s.TAU)}},13990:t=>{t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t}},1298:t=>{t.exports=function(t){return-(t.x2-t.x1)/(t.y2-t.y1)}},74077:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){void 0===e&&(e=new s);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},30473:(t,e,i)=>{var s=i(50599),n=i(73273);t.exports=function(t,e){return 2*n(e)-Math.PI-s(t)}},25968:(t,e,i)=>{var s=i(1809);t.exports=function(t,e){var i=(t.x1+t.x2)/2,n=(t.y1+t.y2)/2;return s(t,i,n,e)}},24296:(t,e,i)=>{var s=i(1809);t.exports=function(t,e,i){return s(t,e.x,e.y,i)}},1809:t=>{t.exports=function(t,e,i,s){var n=Math.cos(s),r=Math.sin(s),o=t.x1-e,a=t.y1-i;return t.x1=o*n-a*r+e,t.y1=o*r+a*n+i,o=t.x2-e,a=t.y2-i,t.x2=o*n-a*r+e,t.y2=o*r+a*n+i,t}},88171:t=>{t.exports=function(t,e,i,s,n){return t.x1=e,t.y1=i,t.x2=e+Math.cos(s)*n,t.y2=i+Math.sin(s)*n,t}},82797:t=>{t.exports=function(t){return(t.y2-t.y1)/(t.x2-t.x1)}},41067:t=>{t.exports=function(t){return Math.abs(t.x1-t.x2)}},28482:(t,e,i)=>{var s=i(88829);s.Angle=i(50599),s.BresenhamPoints=i(58813),s.CenterOn=i(88513),s.Clone=i(26718),s.CopyFrom=i(88930),s.Equals=i(90656),s.Extend=i(30897),s.GetEasedPoints=i(30684),s.GetMidPoint=i(20487),s.GetNearestPoint=i(11222),s.GetNormal=i(7377),s.GetPoint=i(66464),s.GetPoints=i(8570),s.GetShortestDistance=i(65269),s.Height=i(82996),s.Length=i(16028),s.NormalAngle=i(73273),s.NormalX=i(96936),s.NormalY=i(43581),s.Offset=i(13990),s.PerpSlope=i(1298),s.Random=i(74077),s.ReflectAngle=i(30473),s.Rotate=i(25968),s.RotateAroundPoint=i(24296),s.RotateAroundXY=i(1809),s.SetToAngle=i(88171),s.Slope=i(82797),s.Width=i(41067),t.exports=s},18693:(t,e,i)=>{var s=i(56694),n=i(74118),r=i(93736);function o(t,e,i,s){var n=t-i,r=e-s,o=n*n+r*r;return Math.sqrt(o)}var a=new s({initialize:function(t,e,i){this.vertex1=t,this.vertex2=e,this.vertex3=i,this.bounds=new n,this._inCenter=new r},getInCenter:function(t){void 0===t&&(t=!0);var e,i,s,n,r,a,h=this.vertex1,l=this.vertex2,u=this.vertex3;t?(e=h.x,i=h.y,s=l.x,n=l.y,r=u.x,a=u.y):(e=h.vx,i=h.vy,s=l.vx,n=l.vy,r=u.vx,a=u.vy);var c=o(r,a,s,n),d=o(e,i,r,a),p=o(s,n,e,i),f=c+d+p;return this._inCenter.set((e*c+s*d+r*p)/f,(i*c+n*d+a*p)/f)},contains:function(t,e,i){var s=this.vertex1,n=this.vertex2,r=this.vertex3,o=s.vx,a=s.vy,h=n.vx,l=n.vy,u=r.vx,c=r.vy;if(i){var d=i.a,p=i.b,f=i.c,v=i.d,g=i.e,m=i.f;o=s.vx*d+s.vy*f+g,a=s.vx*p+s.vy*v+m,h=n.vx*d+n.vy*f+g,l=n.vx*p+n.vy*v+m,u=r.vx*d+r.vy*f+g,c=r.vx*p+r.vy*v+m}var y=u-o,x=c-a,T=h-o,w=l-a,b=t-o,E=e-a,S=y*y+x*x,A=y*T+x*w,_=y*b+x*E,C=T*T+w*w,R=T*b+w*E,M=S*C-A*A,P=0===M?0:1/M,O=(C*_-A*R)*P,L=(S*R-A*_)*P;return O>=0&&L>=0&&O+L<1},isCounterClockwise:function(t){var e=this.vertex1,i=this.vertex2,s=this.vertex3,n=(i.vx-e.vx)*(s.vy-e.vy)-(i.vy-e.vy)*(s.vx-e.vx);return t<=0?n>=0:n<0},load:function(t,e,i,s,n){return i=this.vertex1.load(t,e,i,s,n),i=this.vertex2.load(t,e,i,s,n),i=this.vertex3.load(t,e,i,s,n)},transformCoordinatesLocal:function(t,e,i,s){return this.vertex1.transformCoordinatesLocal(t,e,i,s),this.vertex2.transformCoordinatesLocal(t,e,i,s),this.vertex3.transformCoordinatesLocal(t,e,i,s),this},updateBounds:function(){var t=this.vertex1,e=this.vertex2,i=this.vertex3,s=this.bounds;return s.x=Math.min(t.vx,e.vx,i.vx),s.y=Math.min(t.vy,e.vy,i.vy),s.width=Math.max(t.vx,e.vx,i.vx)-s.x,s.height=Math.max(t.vy,e.vy,i.vy)-s.y,this},isInView:function(t,e,i,s,n,r,o,a,h,l,u){var c=this.vertex1.update(n,r,o,a,h,l,u,s),d=this.vertex2.update(n,r,o,a,h,l,u,s),p=this.vertex3.update(n,r,o,a,h,l,u,s);if(c.ta<=0&&d.ta<=0&&p.ta<=0)return!1;if(e&&!this.isCounterClockwise(i))return!1;var f=this.bounds;f.x=Math.min(c.tx,d.tx,p.tx),f.y=Math.min(c.ty,d.ty,p.ty),f.width=Math.max(c.tx,d.tx,p.tx)-f.x,f.height=Math.max(c.ty,d.ty,p.ty)-f.y;var v=t.x+t.width,g=t.y+t.height;return!(f.width<=0||f.height<=0||t.width<=0||t.height<=0)&&!(f.rightv||f.y>g)},translate:function(t,e){void 0===e&&(e=0);var i=this.vertex1,s=this.vertex2,n=this.vertex3;return i.x+=t,i.y+=e,s.x+=t,s.y+=e,n.x+=t,n.y+=e,this},x:{get:function(){return this.getInCenter().x},set:function(t){var e=this.getInCenter();this.translate(t-e.x,0)}},y:{get:function(){return this.getInCenter().y},set:function(t){var e=this.getInCenter();this.translate(0,t-e.y)}},alpha:{get:function(){var t=this.vertex1,e=this.vertex2,i=this.vertex3;return(t.alpha+e.alpha+i.alpha)/3},set:function(t){this.vertex1.alpha=t,this.vertex2.alpha=t,this.vertex3.alpha=t}},depth:{get:function(){var t=this.vertex1,e=this.vertex2,i=this.vertex3;return(t.vz+e.vz+i.vz)/3}},destroy:function(){this.vertex1=null,this.vertex2=null,this.vertex3=null}});t.exports=a},99425:(t,e,i)=>{var s=i(18693),n=i(72632),r=i(16650),o=i(70015),a=i(85769),h=new o,l=new o,u=new r;t.exports=function(t){var e=n(t,"mesh"),i=n(t,"texture",null),r=n(t,"frame"),o=n(t,"width",1),c=n(t,"height",o),d=n(t,"widthSegments",1),p=n(t,"heightSegments",d),f=n(t,"x",0),v=n(t,"y",0),g=n(t,"z",0),m=n(t,"rotateX",0),y=n(t,"rotateY",0),x=n(t,"rotateZ",0),T=n(t,"zIsUp",!0),w=n(t,"isOrtho",!!e&&e.dirtyCache[11]),b=n(t,"colors",[16777215]),E=n(t,"alphas",[1]),S=n(t,"tile",!1),A=n(t,"flipY",!1),_=n(t,"width",null),C={faces:[],verts:[]};if(h.set(f,v,g),l.set(m,y,x),u.fromRotationXYTranslation(l,h,T),!i&&e)i=e.texture;else{if(!e||"string"!=typeof i)return C;i=e.scene.sys.textures.get(i)}var R=i.get(r);!_&&w&&i&&e&&(o=R.width/e.height,c=R.height/e.height);var M,P,O=o/2,L=c/2,F=Math.floor(d),D=Math.floor(p),k=F+1,I=D+1,B=o/F,N=c/D,Y=[],U=[],X=0,z=1,G=0,W=1;R&&(X=R.u0,z=R.u1,A?(G=R.v1,W=R.v0):(G=R.v0,W=R.v1));var V=z-X,H=W-G;for(P=0;P{var s=i(18693),n=i(16650),r=i(70015),o=i(85769),a=new r,h=new r,l=new n;t.exports=function(t,e,i,n,r,u,c,d,p,f){void 0===i&&(i=1),void 0===n&&(n=0),void 0===r&&(r=0),void 0===u&&(u=0),void 0===c&&(c=0),void 0===d&&(d=0),void 0===p&&(p=0),void 0===f&&(f=!0);var v={faces:[],verts:[]},g=t.materials;a.set(n,r,u),h.set(c,d,p),l.fromRotationXYTranslation(h,a,f);for(var m=0;m{var s=i(18693),n=i(85769);t.exports=function(t,e,i,r,o,a,h){if(void 0===r&&(r=!1),void 0===a&&(a=16777215),void 0===h&&(h=1),t.length===e.length){var l,u,c,d,p,f,v,g,m,y,x,T={faces:[],vertices:[]},w=r?3:2,b=Array.isArray(a),E=Array.isArray(h);if(Array.isArray(i)&&i.length>0)for(l=0;l{var e=!0,i="untitled",s="",n="";function r(t){var e=t.indexOf("#");return e>-1?t.substring(0,e):t}function o(t){return 0===t.models.length&&t.models.push({faces:[],name:i,textureCoords:[],vertexNormals:[],vertices:[]}),s="",t.models[t.models.length-1]}function a(t,e){var n=t.length>=2?t[1]:i;e.models.push({faces:[],name:n,textureCoords:[],vertexNormals:[],vertices:[]}),s=""}function h(t){2===t.length&&(s=t[1])}function l(t,e){var i=t.length,s=i>=2?parseFloat(t[1]):0,n=i>=3?parseFloat(t[2]):0,r=i>=4?parseFloat(t[3]):0;o(e).vertices.push({x:s,y:n,z:r})}function u(t,i){var s=t.length,n=s>=2?parseFloat(t[1]):0,r=s>=3?parseFloat(t[2]):0,a=s>=4?parseFloat(t[3]):0;isNaN(n)&&(n=0),isNaN(r)&&(r=0),isNaN(a)&&(a=0),e&&(r=1-r),o(i).textureCoords.push({u:n,v:r,w:a})}function c(t,e){var i=t.length,s=i>=2?parseFloat(t[1]):0,n=i>=3?parseFloat(t[2]):0,r=i>=4?parseFloat(t[3]):0;o(e).vertexNormals.push({x:s,y:n,z:r})}function d(t,e){var i=t.length-1;if(!(i<3)){for(var r={group:s,material:n,vertices:[]},a=0;a3)){var u=0,c=0,d=0;u=parseInt(h[0],10),l>1&&""!==h[1]&&(c=parseInt(h[1],10)),l>2&&(d=parseInt(h[2],10)),0!==u&&(u<0&&(u=o(e).vertices.length+1+u),c-=1,u-=1,d-=1,r.vertices.push({textureCoordsIndex:c,vertexIndex:u,vertexNormalIndex:d}))}}o(e).faces.push(r)}}function p(t,e){t.length>=2&&e.materialLibraries.push(t[1])}function f(t){t.length>=2&&(n=t[1])}t.exports=function(t,i){void 0===i&&(i=!0),e=i;var o={materials:{},materialLibraries:[],models:[]};s="",n="";for(var v=t.split("\n"),g=0;g{var s=i(22946);t.exports=function(t){for(var e={},i=t.split("\n"),n="",r=0;r=2?Math.floor(255*a[2]):h,u=a.length>=3?Math.floor(255*a[3]):h;e[n]=s(h,l,u)}}}return e}},15313:t=>{t.exports=function(t,e,i,s){var n,r;if(void 0===i&&void 0===s){var o=t.getInCenter();n=o.x,r=o.y}var a=Math.cos(e),h=Math.sin(e),l=t.vertex1,u=t.vertex2,c=t.vertex3,d=l.x-n,p=l.y-r;l.set(d*a-p*h+n,d*h+p*a+r),d=u.x-n,p=u.y-r,u.set(d*a-p*h+n,d*h+p*a+r),d=c.x-n,p=c.y-r,c.set(d*a-p*h+n,d*h+p*a+r)}},85769:(t,e,i)=>{var s=i(56694),n=i(75512),r=i(70015),o=new s({Extends:r,initialize:function(t,e,i,s,n,o,a,h,l,u){void 0===o&&(o=16777215),void 0===a&&(a=1),void 0===h&&(h=0),void 0===l&&(l=0),void 0===u&&(u=0),r.call(this,t,e,i),this.vx=0,this.vy=0,this.vz=0,this.nx=h,this.ny=l,this.nz=u,this.u=s,this.v=n,this.color=o,this.alpha=a,this.tx=0,this.ty=0,this.ta=0},setUVs:function(t,e){return this.u=t,this.v=e,this},transformCoordinatesLocal:function(t,e,i,s){var n=this.x,r=this.y,o=this.z,a=t.val,h=n*a[0]+r*a[4]+o*a[8]+a[12],l=n*a[1]+r*a[5]+o*a[9]+a[13],u=n*a[2]+r*a[6]+o*a[10]+a[14],c=n*a[3]+r*a[7]+o*a[11]+a[15];this.vx=h/c*e,this.vy=-l/c*i,this.vz=s<=0?u/c:-u/c},update:function(t,e,i,s,n,r,o,a){var h=this.vx*t+this.vy*i+n,l=this.vx*e+this.vy*s+r;return o&&(h=Math.round(h),l=Math.round(l)),this.tx=h,this.ty=l,this.ta=this.alpha*a,this},load:function(t,e,i,s,r){return t[++i]=this.tx,t[++i]=this.ty,t[++i]=this.u,t[++i]=this.v,t[++i]=s,t[++i]=r,e[++i]=n.getTintAppendFloatAlpha(this.color,this.ta),i}});t.exports=o},14293:(t,e,i)=>{var s={Face:i(18693),GenerateGridVerts:i(99425),GenerateObjVerts:i(53267),GenerateVerts:i(67623),ParseObj:i(27291),ParseObjMaterial:i(76799),RotateFace:i(15313),Vertex:i(85769)};t.exports=s},77601:t=>{t.exports=function(t){return t.setTo(Math.ceil(t.x),Math.ceil(t.y))}},38933:(t,e,i)=>{var s=i(79967);t.exports=function(t){return new s(t.x,t.y)}},47103:t=>{t.exports=function(t,e){return e.setTo(t.x,t.y)}},13625:t=>{t.exports=function(t,e){return t.x===e.x&&t.y===e.y}},12536:t=>{t.exports=function(t){return t.setTo(Math.floor(t.x),Math.floor(t.y))}},54205:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){if(void 0===e&&(e=new s),!Array.isArray(t))throw new Error("GetCentroid points argument must be an array");var i=t.length;if(i<1)throw new Error("GetCentroid points array must not be empty");if(1===i)e.x=t[0].x,e.y=t[0].y;else{for(var n=0;n{t.exports=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)}},82712:t=>{t.exports=function(t){return t.x*t.x+t.y*t.y}},20052:(t,e,i)=>{var s=i(74118);t.exports=function(t,e){void 0===e&&(e=new s);for(var i=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY,a=0;ai&&(i=h.x),h.xr&&(r=h.y),h.y{var s=i(79967);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=new s),n.x=t.x+(e.x-t.x)*i,n.y=t.y+(e.y-t.y)*i,n}},42397:t=>{t.exports=function(t){return t.setTo(t.y,t.x)}},59464:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.setTo(-t.x,-t.y)}},79967:(t,e,i)=>{var s=i(56694),n=i(52394),r=new s({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.type=n.POINT,this.x=t,this.y=e},setTo:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this}});t.exports=r},53581:(t,e,i)=>{var s=i(79967),n=i(82712);t.exports=function(t,e,i){void 0===i&&(i=new s);var r=(t.x*e.x+t.y*e.y)/n(e);return 0!==r&&(i.x=r*e.x,i.y=r*e.y),i}},50817:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=t.x*e.x+t.y*e.y;return 0!==n&&(i.x=n*e.x,i.y=n*e.y),i}},40525:(t,e,i)=>{var s=i(50083);t.exports=function(t,e){if(0!==t.x||0!==t.y){var i=s(t);t.x/=i,t.y/=i}return t.x*=e,t.y*=e,t}},63472:(t,e,i)=>{var s=i(79967);s.Ceil=i(77601),s.Clone=i(38933),s.CopyFrom=i(47103),s.Equals=i(13625),s.Floor=i(12536),s.GetCentroid=i(54205),s.GetMagnitude=i(50083),s.GetMagnitudeSq=i(82712),s.GetRectangleFromPoints=i(20052),s.Interpolate=i(77154),s.Invert=i(42397),s.Negative=i(59464),s.Project=i(53581),s.ProjectUnit=i(50817),s.SetMagnitude=i(40525),t.exports=s},19631:(t,e,i)=>{var s=i(8580);t.exports=function(t){return new s(t.points)}},45604:t=>{t.exports=function(t,e,i){for(var s=!1,n=-1,r=t.points.length-1;++n{var s=i(45604);t.exports=function(t,e){return s(t,e.x,e.y)}},11117:t=>{"use strict";function e(t,e,r){r=r||2;var o,a,h,c,d,f,v,g=e&&e.length,m=g?e[0]*r:t.length,y=i(t,0,m,r,!0),x=[];if(!y||y.next===y.prev)return x;if(g&&(y=function(t,e,n,r){var o,a,h,c=[];for(o=0,a=e.length;o80*r){o=h=t[0],a=c=t[1];for(var T=r;Th&&(h=d),f>c&&(c=f);v=0!==(v=Math.max(h-o,c-a))?1/v:0}return n(y,x,r,o,a,v),x}function i(t,e,i,s,n){var r,o;if(n===_(t,e,i,s)>0)for(r=e;r=e;r-=s)o=E(r,t[r],t[r+1],o);return o&&m(o,o.next)&&(S(o),o=o.next),o}function s(t,e){if(!t)return t;e||(e=t);var i,s=t;do{if(i=!1,s.steiner||!m(s,s.next)&&0!==g(s.prev,s,s.next))s=s.next;else{if(S(s),(s=e=s.prev)===s.next)break;i=!0}}while(i||s!==e);return e}function n(t,e,i,l,u,c,p){if(t){!p&&c&&function(t,e,i,s){var n=t;do{null===n.z&&(n.z=d(n.x,n.y,e,i,s)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){var e,i,s,n,r,o,a,h,l=1;do{for(i=t,t=null,r=null,o=0;i;){for(o++,s=i,a=0,e=0;e0||h>0&&s;)0!==a&&(0===h||!s||i.z<=s.z)?(n=i,i=i.nextZ,a--):(n=s,s=s.nextZ,h--),r?r.nextZ=n:t=n,n.prevZ=r,r=n;i=s}r.nextZ=null,l*=2}while(o>1)}(n)}(t,l,u,c);for(var f,v,g=t;t.prev!==t.next;)if(f=t.prev,v=t.next,c?o(t,l,u,c):r(t))e.push(f.i/i),e.push(t.i/i),e.push(v.i/i),S(t),t=v.next,g=v.next;else if((t=v)===g){p?1===p?n(t=a(s(t),e,i),e,i,l,u,c,2):2===p&&h(t,e,i,l,u,c):n(s(t),e,i,l,u,c,1);break}}}function r(t){var e=t.prev,i=t,s=t.next;if(g(e,i,s)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(f(e.x,e.y,i.x,i.y,s.x,s.y,n.x,n.y)&&g(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function o(t,e,i,s){var n=t.prev,r=t,o=t.next;if(g(n,r,o)>=0)return!1;for(var a=n.xr.x?n.x>o.x?n.x:o.x:r.x>o.x?r.x:o.x,u=n.y>r.y?n.y>o.y?n.y:o.y:r.y>o.y?r.y:o.y,c=d(a,h,e,i,s),p=d(l,u,e,i,s),v=t.prevZ,m=t.nextZ;v&&v.z>=c&&m&&m.z<=p;){if(v!==t.prev&&v!==t.next&&f(n.x,n.y,r.x,r.y,o.x,o.y,v.x,v.y)&&g(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,m!==t.prev&&m!==t.next&&f(n.x,n.y,r.x,r.y,o.x,o.y,m.x,m.y)&&g(m.prev,m,m.next)>=0)return!1;m=m.nextZ}for(;v&&v.z>=c;){if(v!==t.prev&&v!==t.next&&f(n.x,n.y,r.x,r.y,o.x,o.y,v.x,v.y)&&g(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;m&&m.z<=p;){if(m!==t.prev&&m!==t.next&&f(n.x,n.y,r.x,r.y,o.x,o.y,m.x,m.y)&&g(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function a(t,e,i){var n=t;do{var r=n.prev,o=n.next.next;!m(r,o)&&y(r,n,n.next,o)&&w(r,o)&&w(o,r)&&(e.push(r.i/i),e.push(n.i/i),e.push(o.i/i),S(n),S(n.next),n=t=o),n=n.next}while(n!==t);return s(n)}function h(t,e,i,r,o,a){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&v(h,l)){var u=b(h,l);return h=s(h,h.next),u=s(u,u.next),n(h,e,i,r,o,a),void n(u,e,i,r,o,a)}l=l.next}h=h.next}while(h!==t)}function l(t,e){return t.x-e.x}function u(t,e){if(e=function(t,e){var i,s=e,n=t.x,r=t.y,o=-1/0;do{if(r<=s.y&&r>=s.next.y&&s.next.y!==s.y){var a=s.x+(r-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(a<=n&&a>o){if(o=a,a===n){if(r===s.y)return s;if(r===s.next.y)return s.next}i=s.x=s.x&&s.x>=u&&n!==s.x&&f(ri.x||s.x===i.x&&c(i,s)))&&(i=s,p=h)),s=s.next}while(s!==l);return i}(t,e),e){var i=b(e,t);s(e,e.next),s(i,i.next)}}function c(t,e){return g(t.prev,t,e.prev)<0&&g(e.next,t,t.next)<0}function d(t,e,i,s,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-s)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p(t){var e=t,i=t;do{(e.x=0&&(t-o)*(s-a)-(i-o)*(e-a)>=0&&(i-o)*(r-a)-(n-o)*(s-a)>=0}function v(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&y(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(w(t,e)&&w(e,t)&&function(t,e){var i=t,s=!1,n=(t.x+e.x)/2,r=(t.y+e.y)/2;do{i.y>r!=i.next.y>r&&i.next.y!==i.y&&n<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(s=!s),i=i.next}while(i!==t);return s}(t,e)&&(g(t.prev,t,e.prev)||g(t,e.prev,e))||m(t,e)&&g(t.prev,t,t.next)>0&&g(e.prev,e,e.next)>0)}function g(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function m(t,e){return t.x===e.x&&t.y===e.y}function y(t,e,i,s){var n=T(g(t,e,i)),r=T(g(t,e,s)),o=T(g(i,s,t)),a=T(g(i,s,e));return n!==r&&o!==a||(!(0!==n||!x(t,i,e))||(!(0!==r||!x(t,s,e))||(!(0!==o||!x(i,t,s))||!(0!==a||!x(i,e,s)))))}function x(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function T(t){return t>0?1:t<0?-1:0}function w(t,e){return g(t.prev,t,t.next)<0?g(t,e,t.next)>=0&&g(t,t.prev,e)>=0:g(t,e,t.prev)<0||g(t,t.next,e)<0}function b(t,e){var i=new A(t.i,t.x,t.y),s=new A(e.i,e.x,e.y),n=t.next,r=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,s.next=i,i.prev=s,r.next=s,s.prev=r,s}function E(t,e,i,s){var n=new A(t,e,i);return s?(n.next=s.next,n.prev=s,s.next.prev=n,s.next=n):(n.prev=n,n.next=n),n}function S(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function A(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function _(t,e,i,s){for(var n=0,r=e,o=i-s;r0&&(s+=t[n-1].length,i.holes.push(s))}return i},t.exports=e},14045:(t,e,i)=>{var s=i(74118);t.exports=function(t,e){void 0===e&&(e=new s);for(var i,n=1/0,r=1/0,o=-n,a=-r,h=0;h{t.exports=function(t,e){void 0===e&&(e=[]);for(var i=0;i{var s=i(16028),n=i(88829),r=i(5159);t.exports=function(t,e,i,o){void 0===o&&(o=[]);var a=t.points,h=r(t);!e&&i>0&&(e=h/i);for(var l=0;lc+g)){var m=v.getPoint((u-c)/g);o.push(m);break}c+=g}return o}},5159:(t,e,i)=>{var s=i(16028),n=i(88829);t.exports=function(t){for(var e=t.points,i=0,r=0;r{var s=i(56694),n=i(45604),r=i(89294),o=i(52394),a=new s({initialize:function(t){this.type=o.POLYGON,this.area=0,this.points=[],t&&this.setTo(t)},contains:function(t,e){return n(this,t,e)},setTo:function(t){if(this.area=0,this.points=[],"string"==typeof t&&(t=t.split(" ")),!Array.isArray(t))return this;for(var e,i=Number.MAX_VALUE,s=0;s{t.exports=function(t){return t.points.reverse(),t}},95874:t=>{function e(t,e,i){var s=e.x,n=e.y,r=i.x-s,o=i.y-n;if(0!==r||0!==o){var a=((t.x-s)*r+(t.y-n)*o)/(r*r+o*o);a>1?(s=i.x,n=i.y):a>0&&(s+=r*a,n+=o*a)}return(r=t.x-s)*r+(o=t.y-n)*o}function i(t,s,n,r,o){for(var a,h=r,l=s+1;lh&&(a=l,h=u)}h>r&&(a-s>1&&i(t,s,a,r,o),o.push(t[a]),n-a>1&&i(t,a,n,r,o))}function s(t,e){var s=t.length-1,n=[t[0]];return i(t,0,s,e,n),n.push(t[s]),n}t.exports=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=!1);var n=t.points;if(n.length>2){var r=e*e;i||(n=function(t,e){for(var i,s,n,r,o,a=t[0],h=[a],l=1,u=t.length;le&&(h.push(i),a=i);return a!==i&&h.push(i),h}(n,r)),t.setTo(s(n,r))}return t}},18974:t=>{var e=function(t,e){return t[0]=e[0],t[1]=e[1],t};t.exports=function(t){var i,s=[],n=t.points;for(i=0;i0&&r.push(e([0,0],s[0])),i=0;i1&&r.push(e([0,0],s[s.length-1])),t.setTo(r)}},23490:t=>{t.exports=function(t,e,i){for(var s=t.points,n=0;n{var s=i(8580);s.Clone=i(19631),s.Contains=i(45604),s.ContainsPoint=i(87289),s.Earcut=i(11117),s.GetAABB=i(14045),s.GetNumberArray=i(98286),s.GetPoints=i(89294),s.Perimeter=i(5159),s.Reverse=i(32244),s.Simplify=i(95874),s.Smooth=i(18974),s.Translate=i(23490),t.exports=s},1653:t=>{t.exports=function(t){return t.width*t.height}},33943:t=>{t.exports=function(t){return t.x=Math.ceil(t.x),t.y=Math.ceil(t.y),t}},58662:t=>{t.exports=function(t){return t.x=Math.ceil(t.x),t.y=Math.ceil(t.y),t.width=Math.ceil(t.width),t.height=Math.ceil(t.height),t}},79993:t=>{t.exports=function(t,e,i){return t.x=e-t.width/2,t.y=i-t.height/2,t}},81572:(t,e,i)=>{var s=i(74118);t.exports=function(t){return new s(t.x,t.y,t.width,t.height)}},94287:t=>{t.exports=function(t,e,i){return!(t.width<=0||t.height<=0)&&(t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i)}},28687:(t,e,i)=>{var s=i(94287);t.exports=function(t,e){return s(t,e.x,e.y)}},73222:t=>{t.exports=function(t,e){return!(e.width*e.height>t.width*t.height)&&(e.x>t.x&&e.xt.x&&e.rightt.y&&e.yt.y&&e.bottom{t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},87279:t=>{t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x,y:t.y}),e.push({x:t.right,y:t.y}),e.push({x:t.right,y:t.bottom}),e.push({x:t.x,y:t.bottom}),e}},19989:t=>{t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},92628:(t,e,i)=>{var s=i(6700);t.exports=function(t,e){var i=s(t);return i{var s=i(6700);t.exports=function(t,e){var i=s(t);return i>s(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},71356:t=>{t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t}},21687:t=>{t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height),t}},80222:(t,e,i)=>{var s=i(74118),n=i(83392);t.exports=function(t,e){if(void 0===e&&(e=new s),0===t.length)return e;for(var i,r,o,a=Number.MAX_VALUE,h=Number.MAX_VALUE,l=n.MIN_SAFE_INTEGER,u=n.MIN_SAFE_INTEGER,c=0;c{var s=i(74118);t.exports=function(t,e,i,n,r){return void 0===r&&(r=new s),r.setTo(Math.min(t,i),Math.min(e,n),Math.abs(t-i),Math.abs(e-n))}},6700:t=>{t.exports=function(t){return 0===t.height?NaN:t.width/t.height}},35242:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.centerX,e.y=t.centerY,e}},47698:(t,e,i)=>{var s=i(85876),n=i(79967);t.exports=function(t,e,i){if(void 0===i&&(i=new n),e<=0||e>=1)return i.x=t.x,i.y=t.y,i;var r=s(t)*e;return e>.5?(r-=t.width+t.height)<=t.width?(i.x=t.right-r,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(r-t.width)):r<=t.width?(i.x=t.x+r,i.y=t.y):(i.x=t.right,i.y=t.y+(r-t.width)),i}},54932:(t,e,i)=>{var s=i(47698),n=i(85876);t.exports=function(t,e,i,r){void 0===r&&(r=[]),!e&&i>0&&(e=n(t)/i);for(var o=0;o{var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.width,e.y=t.height,e}},7782:(t,e,i)=>{var s=i(79993);t.exports=function(t,e,i){var n=t.centerX,r=t.centerY;return t.setSize(t.width+2*e,t.height+2*i),s(t,n,r)}},66217:(t,e,i)=>{var s=i(74118),n=i(90205);t.exports=function(t,e,i){return void 0===i&&(i=new s),n(t,e)?(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y):i.setEmpty(),i}},40053:(t,e,i)=>{var s=i(85876),n=i(79967);t.exports=function(t,e,i,r){if(void 0===r&&(r=[]),!e&&!i)return r;e?i=Math.round(s(t)/e):e=s(t)/i;for(var o=t.x,a=t.y,h=0,l=0;l=t.right&&(h=1,a+=o-t.right,o=t.right);break;case 1:(a+=e)>=t.bottom&&(h=2,o-=a-t.bottom,a=t.bottom);break;case 2:(o-=e)<=t.left&&(h=3,a-=t.left-o,o=t.left);break;case 3:(a-=e)<=t.top&&(h=0,a=t.top)}return r}},86673:t=>{t.exports=function(t,e){for(var i=t.x,s=t.right,n=t.y,r=t.bottom,o=0;o{t.exports=function(t,e){var i=Math.min(t.x,e.x),s=Math.max(t.right,e.right);t.x=i,t.width=s-i;var n=Math.min(t.y,e.y),r=Math.max(t.bottom,e.bottom);return t.y=n,t.height=r-n,t}},44755:t=>{t.exports=function(t,e,i){var s=Math.min(t.x,e),n=Math.max(t.right,e);t.x=s,t.width=n-s;var r=Math.min(t.y,i),o=Math.max(t.bottom,i);return t.y=r,t.height=o-r,t}},74466:t=>{t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},55946:t=>{t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},97474:t=>{t.exports=function(t,e){return t.xe.x&&t.ye.y}},85876:t=>{t.exports=function(t){return 2*(t.width+t.height)}},20243:(t,e,i)=>{var s=i(79967),n=i(75606);t.exports=function(t,e,i){void 0===i&&(i=new s),e=n(e);var r=Math.sin(e),o=Math.cos(e),a=o>0?t.width/2:t.width/-2,h=r>0?t.height/2:t.height/-2;return Math.abs(a*r){var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.x+Math.random()*t.width,e.y=t.y+Math.random()*t.height,e}},97691:(t,e,i)=>{var s=i(17489),n=i(73222),r=i(79967);t.exports=function(t,e,i){if(void 0===i&&(i=new r),n(t,e))switch(s(0,3)){case 0:i.x=t.x+Math.random()*(e.right-t.x),i.y=t.y+Math.random()*(e.top-t.y);break;case 1:i.x=e.x+Math.random()*(t.right-e.x),i.y=e.bottom+Math.random()*(t.bottom-e.bottom);break;case 2:i.x=t.x+Math.random()*(e.x-t.x),i.y=e.y+Math.random()*(t.bottom-e.y);break;case 3:i.x=e.right+Math.random()*(t.right-e.right),i.y=t.y+Math.random()*(e.bottom-t.y)}return i}},74118:(t,e,i)=>{var s=i(56694),n=i(94287),r=i(47698),o=i(54932),a=i(52394),h=i(88829),l=i(30001),u=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.type=a.RECTANGLE,this.x=t,this.y=e,this.width=i,this.height=s},contains:function(t,e){return n(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.y,this.right,this.y),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.y,this.right,this.bottom),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.bottom,this.x,this.bottom),t},getLineD:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.bottom,this.x,this.y),t},left:{get:function(){return this.x},set:function(t){t>=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=u},51828:t=>{t.exports=function(t,e){return t.width===e.width&&t.height===e.height}},5691:t=>{t.exports=function(t,e,i){return void 0===i&&(i=e),t.width*=e,t.height*=i,t}},58795:(t,e,i)=>{var s=i(74118);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=Math.min(t.x,e.x),r=Math.min(t.y,e.y),o=Math.max(t.right,e.right)-n,a=Math.max(t.bottom,e.bottom)-r;return i.setTo(n,r,o,a)}},66658:(t,e,i)=>{var s=i(74118);s.Area=i(1653),s.Ceil=i(33943),s.CeilAll=i(58662),s.CenterOn=i(79993),s.Clone=i(81572),s.Contains=i(94287),s.ContainsPoint=i(28687),s.ContainsRect=i(73222),s.CopyFrom=i(29538),s.Decompose=i(87279),s.Equals=i(19989),s.FitInside=i(92628),s.FitOutside=i(85028),s.Floor=i(71356),s.FloorAll=i(21687),s.FromPoints=i(80222),s.FromXY=i(75785),s.GetAspectRatio=i(6700),s.GetCenter=i(35242),s.GetPoint=i(47698),s.GetPoints=i(54932),s.GetSize=i(31591),s.Inflate=i(7782),s.Intersection=i(66217),s.MarchingAnts=i(40053),s.MergePoints=i(86673),s.MergeRect=i(14655),s.MergeXY=i(44755),s.Offset=i(74466),s.OffsetPoint=i(55946),s.Overlaps=i(97474),s.Perimeter=i(85876),s.PerimeterPoint=i(20243),s.Random=i(30001),s.RandomOutside=i(97691),s.SameDimensions=i(51828),s.Scale=i(5691),s.Union=i(58795),t.exports=s},19108:t=>{t.exports=function(t){var e=t.x1,i=t.y1,s=t.x2,n=t.y2,r=t.x3,o=t.y3;return Math.abs(((r-e)*(n-i)-(s-e)*(o-i))/2)}},41199:(t,e,i)=>{var s=i(66349);t.exports=function(t,e,i){var n=i*(Math.sqrt(3)/2);return new s(t,e,t+i/2,e+n,t-i/2,e+n)}},88730:(t,e,i)=>{var s=i(11117),n=i(66349);t.exports=function(t,e,i,r,o){void 0===e&&(e=null),void 0===i&&(i=1),void 0===r&&(r=1),void 0===o&&(o=[]);for(var a,h,l,u,c,d,p,f,v,g=s(t,e),m=0;m{var s=i(66349);t.exports=function(t,e,i,n){return void 0===n&&(n=i),new s(t,e,t,e-n,t+i,e)}},1882:(t,e,i)=>{var s=i(56595),n=i(9640);t.exports=function(t,e,i,r){void 0===r&&(r=s);var o=r(t),a=e-o.x,h=i-o.y;return n(t,a,h)}},56595:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=(t.x1+t.x2+t.x3)/3,e.y=(t.y1+t.y2+t.y3)/3,e}},91835:(t,e,i)=>{var s=i(93736);function n(t,e,i,s){return t*s-e*i}t.exports=function(t,e){void 0===e&&(e=new s);var i=t.x3,r=t.y3,o=t.x1-i,a=t.y1-r,h=t.x2-i,l=t.y2-r,u=2*n(o,a,h,l),c=n(a,o*o+a*a,l,h*h+l*l),d=n(o,o*o+a*a,h,h*h+l*l);return e.x=i-c/u,e.y=r+d/u,e}},97073:(t,e,i)=>{var s=i(26673);t.exports=function(t,e){void 0===e&&(e=new s);var i,n,r=t.x1,o=t.y1,a=t.x2,h=t.y2,l=t.x3,u=t.y3,c=a-r,d=h-o,p=l-r,f=u-o,v=c*(r+a)+d*(o+h),g=p*(r+l)+f*(o+u),m=2*(c*(u-h)-d*(l-a));if(Math.abs(m)<1e-6){var y=Math.min(r,a,l),x=Math.min(o,h,u);i=.5*(Math.max(r,a,l)-y),n=.5*(Math.max(o,h,u)-x),e.x=y+i,e.y=x+n,e.radius=Math.sqrt(i*i+n*n)}else e.x=(f*v-d*g)/m,e.y=(c*g-p*v)/m,i=e.x-r,n=e.y-o,e.radius=Math.sqrt(i*i+n*n);return e}},75974:(t,e,i)=>{var s=i(66349);t.exports=function(t){return new s(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}},60689:t=>{t.exports=function(t,e,i){var s=t.x3-t.x1,n=t.y3-t.y1,r=t.x2-t.x1,o=t.y2-t.y1,a=e-t.x1,h=i-t.y1,l=s*s+n*n,u=s*r+n*o,c=s*a+n*h,d=r*r+o*o,p=r*a+o*h,f=l*d-u*u,v=0===f?0:1/f,g=(d*c-u*p)*v,m=(l*p-u*c)*v;return g>=0&&m>=0&&g+m<1}},86875:t=>{t.exports=function(t,e,i,s){void 0===i&&(i=!1),void 0===s&&(s=[]);for(var n,r,o,a,h,l,u=t.x3-t.x1,c=t.y3-t.y1,d=t.x2-t.x1,p=t.y2-t.y1,f=u*u+c*c,v=u*d+c*p,g=d*d+p*p,m=f*g-v*v,y=0===m?0:1/m,x=t.x1,T=t.y1,w=0;w=0&&r>=0&&n+r<1&&(s.push({x:e[w].x,y:e[w].y}),i)));w++);return s}},51532:(t,e,i)=>{var s=i(60689);t.exports=function(t,e){return s(t,e.x,e.y)}},42538:t=>{t.exports=function(t,e){return e.setTo(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}},18680:t=>{t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x1,y:t.y1}),e.push({x:t.x2,y:t.y2}),e.push({x:t.x3,y:t.y3}),e}},29977:t=>{t.exports=function(t,e){return t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2&&t.x3===e.x3&&t.y3===e.y3}},56088:(t,e,i)=>{var s=i(79967),n=i(16028);t.exports=function(t,e,i){void 0===i&&(i=new s);var r=t.getLineA(),o=t.getLineB(),a=t.getLineC();if(e<=0||e>=1)return i.x=r.x1,i.y=r.y1,i;var h=n(r),l=n(o),u=n(a),c=(h+l+u)*e,d=0;return ch+l?(d=(c-=h+l)/u,i.x=a.x1+(a.x2-a.x1)*d,i.y=a.y1+(a.y2-a.y1)*d):(d=(c-=h)/l,i.x=o.x1+(o.x2-o.x1)*d,i.y=o.y1+(o.y2-o.y1)*d),i}},24402:(t,e,i)=>{var s=i(16028),n=i(79967);t.exports=function(t,e,i,r){void 0===r&&(r=[]);var o=t.getLineA(),a=t.getLineB(),h=t.getLineC(),l=s(o),u=s(a),c=s(h),d=l+u+c;!e&&i>0&&(e=d/i);for(var p=0;pl+u?(v=(f-=l+u)/c,g.x=h.x1+(h.x2-h.x1)*v,g.y=h.y1+(h.y2-h.y1)*v):(v=(f-=l)/u,g.x=a.x1+(a.x2-a.x1)*v,g.y=a.y1+(a.y2-a.y1)*v),r.push(g)}return r}},83648:(t,e,i)=>{var s=i(79967);function n(t,e,i,s){var n=t-i,r=e-s,o=n*n+r*r;return Math.sqrt(o)}t.exports=function(t,e){void 0===e&&(e=new s);var i=t.x1,r=t.y1,o=t.x2,a=t.y2,h=t.x3,l=t.y3,u=n(h,l,o,a),c=n(i,r,h,l),d=n(o,a,i,r),p=u+c+d;return e.x=(i*u+o*c+h*d)/p,e.y=(r*u+a*c+l*d)/p,e}},9640:t=>{t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t.x3+=e,t.y3+=i,t}},95290:(t,e,i)=>{var s=i(16028);t.exports=function(t){var e=t.getLineA(),i=t.getLineB(),n=t.getLineC();return s(e)+s(i)+s(n)}},99761:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){void 0===e&&(e=new s);var i=t.x2-t.x1,n=t.y2-t.y1,r=t.x3-t.x1,o=t.y3-t.y1,a=Math.random(),h=Math.random();return a+h>=1&&(a=1-a,h=1-h),e.x=t.x1+(i*a+r*h),e.y=t.y1+(n*a+o*h),e}},21934:(t,e,i)=>{var s=i(19211),n=i(83648);t.exports=function(t,e){var i=n(t);return s(t,i.x,i.y,e)}},68454:(t,e,i)=>{var s=i(19211);t.exports=function(t,e,i){return s(t,e.x,e.y,i)}},19211:t=>{t.exports=function(t,e,i,s){var n=Math.cos(s),r=Math.sin(s),o=t.x1-e,a=t.y1-i;return t.x1=o*n-a*r+e,t.y1=o*r+a*n+i,o=t.x2-e,a=t.y2-i,t.x2=o*n-a*r+e,t.y2=o*r+a*n+i,o=t.x3-e,a=t.y3-i,t.x3=o*n-a*r+e,t.y3=o*r+a*n+i,t}},66349:(t,e,i)=>{var s=i(56694),n=i(60689),r=i(56088),o=i(24402),a=i(52394),h=i(88829),l=i(99761),u=new s({initialize:function(t,e,i,s,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=0),this.type=a.TRIANGLE,this.x1=t,this.y1=e,this.x2=i,this.y2=s,this.x3=n,this.y3=r},contains:function(t,e){return n(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,s,n,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=0),this.x1=t,this.y1=e,this.x2=i,this.y2=s,this.x3=n,this.y3=r,this},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x1,this.y1,this.x2,this.y2),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.x2,this.y2,this.x3,this.y3),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.x3,this.y3,this.x1,this.y1),t},left:{get:function(){return Math.min(this.x1,this.x2,this.x3)},set:function(t){var e=0;e=this.x1<=this.x2&&this.x1<=this.x3?this.x1-t:this.x2<=this.x1&&this.x2<=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},right:{get:function(){return Math.max(this.x1,this.x2,this.x3)},set:function(t){var e=0;e=this.x1>=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=u},87619:(t,e,i)=>{var s=i(66349);s.Area=i(19108),s.BuildEquilateral=i(41199),s.BuildFromPolygon=i(88730),s.BuildRight=i(3635),s.CenterOn=i(1882),s.Centroid=i(56595),s.CircumCenter=i(91835),s.CircumCircle=i(97073),s.Clone=i(75974),s.Contains=i(60689),s.ContainsArray=i(86875),s.ContainsPoint=i(51532),s.CopyFrom=i(42538),s.Decompose=i(18680),s.Equals=i(29977),s.GetPoint=i(56088),s.GetPoints=i(24402),s.InCenter=i(83648),s.Perimeter=i(95290),s.Offset=i(9640),s.Random=i(99761),s.Rotate=i(21934),s.RotateAroundPoint=i(68454),s.RotateAroundXY=i(19211),t.exports=s},27395:t=>{t.exports=function(t,e,i){return{gameObject:t,enabled:!0,alwaysEnabled:!1,draggable:!1,dropZone:!1,cursor:!1,target:null,camera:null,hitArea:e,hitAreaCallback:i,hitAreaDebug:null,customHitArea:!1,localX:0,localY:0,dragState:0,dragStartX:0,dragStartY:0,dragStartXGlobal:0,dragStartYGlobal:0,dragX:0,dragY:0}}},18104:t=>{t.exports=function(t,e){return function(i,s,n,r){var o=t.getPixelAlpha(s,n,r.texture.key,r.frame.name);return o&&o>=e}}},69898:(t,e,i)=>{var s=i(56694),n=i(72687),r=i(6659),o=i(33963),a=i(97081),h=i(71064),l=i(7905),u=i(40398),c=i(37579),d=i(69360),p=i(64462),f=new s({initialize:function(t,e){this.game=t,this.scaleManager,this.canvas,this.config=e,this.enabled=!0,this.events=new r,this.isOver=!0,this.defaultCursor="",this.keyboard=e.inputKeyboard?new h(this):null,this.mouse=e.inputMouse?new l(this):null,this.touch=e.inputTouch?new c(this):null,this.pointers=[],this.pointersTotal=e.inputActivePointers,e.inputTouch&&1===this.pointersTotal&&(this.pointersTotal=2);for(var i=0;i<=this.pointersTotal;i++){var s=new u(this,i);s.smoothFactor=e.inputSmoothFactor,this.pointers.push(s)}this.mousePointer=e.inputMouse?this.pointers[0]:null,this.activePointer=this.pointers[0],this.globalTopOnly=!0,this.time=0,this._tempPoint={x:0,y:0},this._tempHitTest=[],this._tempMatrix=new d,this._tempMatrix2=new d,this._tempSkip=!1,this.mousePointerContainer=[this.mousePointer],t.events.once(a.BOOT,this.boot,this)},boot:function(){var t=this.game,e=t.events;this.canvas=t.canvas,this.scaleManager=t.scale,this.events.emit(o.MANAGER_BOOT),e.on(a.PRE_RENDER,this.preRender,this),e.once(a.DESTROY,this.destroy,this)},setCanvasOver:function(t){this.isOver=!0,this.events.emit(o.GAME_OVER,t)},setCanvasOut:function(t){this.isOver=!1,this.events.emit(o.GAME_OUT,t)},preRender:function(){var t=this.game.loop.now,e=this.game.loop.delta,i=this.game.scene.getScenes(!0,!0);this.time=t,this.events.emit(o.MANAGER_UPDATE);for(var s=0;s10&&(t=10-this.pointersTotal);for(var i=0;i{var s=i(26673),n=i(65650),r=i(56694),o=i(72687),a=i(27395),h=i(18104),l=i(53996),u=i(95669),c=i(72313),d=i(33963),p=i(6659),f=i(72632),v=i(52394),g=i(63399),m=i(42911),y=i(91963),x=i(74118),T=i(94287),w=i(7599),b=i(66349),E=i(60689),S=new r({Extends:p,initialize:function(t){p.call(this),this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.manager=t.sys.game.input,this.pluginEvents=new p,this.enabled=!0,this.displayList,this.cameras,g.install(this),this.mouse=this.manager.mouse,this.topOnly=!0,this.pollRate=-1,this._pollTimer=0;var e={cancelled:!1};this._eventContainer={stopPropagation:function(){e.cancelled=!0}},this._eventData=e,this.dragDistanceThreshold=0,this.dragTimeThreshold=0,this._temp=[],this._tempZones=[],this._list=[],this._pendingInsertion=[],this._pendingRemoval=[],this._draggable=[],this._drag={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._dragState=[],this._over={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._validTypes=["onDown","onUp","onOver","onOut","onMove","onDragStart","onDrag","onDragEnd","onDragEnter","onDragLeave","onDragOver","onDrop"],this._updatedThisFrame=!1,t.sys.events.once(w.BOOT,this.boot,this),t.sys.events.on(w.START,this.start,this)},boot:function(){this.cameras=this.systems.cameras,this.displayList=this.systems.displayList,this.systems.events.once(w.DESTROY,this.destroy,this),this.pluginEvents.emit(d.BOOT)},start:function(){var t=this.systems.events;t.on(w.TRANSITION_START,this.transitionIn,this),t.on(w.TRANSITION_OUT,this.transitionOut,this),t.on(w.TRANSITION_COMPLETE,this.transitionComplete,this),t.on(w.PRE_UPDATE,this.preUpdate,this),t.once(w.SHUTDOWN,this.shutdown,this),this.manager.events.on(d.GAME_OUT,this.onGameOut,this),this.manager.events.on(d.GAME_OVER,this.onGameOver,this),this.enabled=!0,this._dragState=[0,0,0,0,0,0,0,0,0,0],this.pluginEvents.emit(d.START)},onGameOver:function(t){this.isActive()&&this.emit(d.GAME_OVER,t.timeStamp,t)},onGameOut:function(t){this.isActive()&&this.emit(d.GAME_OUT,t.timeStamp,t)},preUpdate:function(){this.pluginEvents.emit(d.PRE_UPDATE);var t=this._pendingRemoval,e=this._pendingInsertion,i=t.length,s=e.length;if(0!==i||0!==s){for(var n=this._list,r=0;r-1&&(n.splice(a,1),this.clear(o,!0))}t.length=0,this._pendingRemoval.length=0,this._list=n.concat(e.splice(0))}},isActive:function(){return this.enabled&&this.scene.sys.isActive()},updatePoll:function(t,e){if(!this.isActive())return!1;if(this.pluginEvents.emit(d.UPDATE,t,e),this._updatedThisFrame)return this._updatedThisFrame=!1,!1;var i,s=this.manager,n=s.pointers,r=s.pointersTotal;for(i=0;i0){if(this._pollTimer-=e,!(this._pollTimer<0))return!1;this._pollTimer=this.pollRate}var a=!1;for(i=0;i0&&(a=!0)}return a},update:function(t,e){if(!this.isActive())return!1;for(var i=e.length,s=!1,n=0;n0&&(s=!0)}return this._updatedThisFrame=!0,s},clear:function(t,e){void 0===e&&(e=!1),this.disable(t);var i=t.input;i&&(i.gameObject=void 0,i.target=void 0,i.hitArea=void 0,i.hitAreaCallback=void 0,i.callbackContext=void 0,t.input=null),e||this.queueForRemoval(t);var s=this._draggable.indexOf(t);return s>-1&&this._draggable.splice(s,1),t},disable:function(t){var e=t.input;e&&(e.enabled=!1,e.dragState=0);var i=this._temp,s=this._drag,n=this._over,r=this.manager,o=i.indexOf(t);o>-1&&i.splice(o,1);for(var a=0;a-1&&s[a].splice(o,1),(o=n[a].indexOf(t))>-1&&(n[a].splice(o,1),r.resetCursor(e));return this},enable:function(t,e,i,s){return void 0===s&&(s=!1),t.input?t.input.enabled=!0:this.setHitArea(t,e,i),t.input&&s&&!t.input.dropZone&&(t.input.dropZone=s),this},hitTestPointer:function(t){for(var e=this.cameras.getCamerasBelowPointer(t),i=0;i0)return t.camera=s,n}return t.camera=e[0],[]},processDownEvents:function(t){var e=0,i=this._temp,s=this._eventData,n=this._eventContainer;s.cancelled=!1;for(var r=!1,o=0;o0&&l(t.x,t.y,t.downX,t.downY)>=n||s>0&&e>=t.downTime+s)&&(i=!0),i)return this.setDragState(t,3),this.processDragStartList(t)},processDragStartList:function(t){if(3!==this.getDragState(t))return 0;for(var e=this._drag[t.id],i=0;i1&&(this.sortGameObjects(i,t),this.topOnly&&i.splice(1)),this._drag[t.id]=i,0===this.dragDistanceThreshold&&0===this.dragTimeThreshold?(this.setDragState(t,3),this.processDragStartList(t)):(this.setDragState(t,2),0))},processDragMoveEvent:function(t){if(2===this.getDragState(t)&&this.processDragThresholdEvent(t,this.manager.game.loop.now),4!==this.getDragState(t))return 0;for(var e=this._tempZones,i=this._drag[t.id],s=0;s0?(o.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,o,h),a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h)):(o.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,o,h),e[0]?(a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h)):a.target=null)}else!h&&e[0]&&(a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h));if(o.parentContainer){var u=t.worldX-a.dragStartXGlobal,c=t.worldY-a.dragStartYGlobal,p=o.getParentRotation(),f=u*Math.cos(p)+c*Math.sin(p),v=c*Math.cos(p)-u*Math.sin(p);f*=1/o.parentContainer.scaleX,v*=1/o.parentContainer.scaleY,n=f+a.dragStartX,r=v+a.dragStartY}else n=t.worldX-a.dragX,r=t.worldY-a.dragY;o.emit(d.GAMEOBJECT_DRAG,t,n,r),this.emit(d.DRAG,t,o,n,r)}return i.length},processDragUpEvent:function(t){for(var e=this._drag[t.id],i=0;i0){var r=this.manager,o=this._eventData,a=this._eventContainer;o.cancelled=!1;for(var h=!1,l=0;l0){var n=this.manager,r=this._eventData,o=this._eventContainer;r.cancelled=!1;var a=!1;this.sortGameObjects(e,t);for(var h=0;h0){for(this.sortGameObjects(n,t),e=0;e0){for(this.sortGameObjects(r,t),e=0;e-1&&this._draggable.splice(n,1)}return this},makePixelPerfect:function(t){void 0===t&&(t=1);var e=this.systems.textures;return h(e,t)},setHitArea:function(t,e,i){if(void 0===e)return this.setHitAreaFromTexture(t);Array.isArray(t)||(t=[t]);var s=!1,n=!1,r=!1,o=!1,h=!1,l=!0;if(m(e)){var u=e;e=f(u,"hitArea",null),i=f(u,"hitAreaCallback",null),s=f(u,"draggable",!1),n=f(u,"dropZone",!1),r=f(u,"cursor",!1),o=f(u,"useHandCursor",!1),h=f(u,"pixelPerfect",!1);var c=f(u,"alphaTolerance",1);h&&(e={},i=this.makePixelPerfect(c)),e&&i||(this.setHitAreaFromTexture(t),l=!1)}else"function"!=typeof e||i||(i=e,e={});for(var d=0;d{var s=i(10850),n={},r={register:function(t,e,i,s,r){n[t]={plugin:e,mapping:i,settingsKey:s,configKey:r}},getPlugin:function(t){return n[t]},install:function(t){var e=t.scene.sys,i=e.settings.input,r=e.game.config;for(var o in n){var a=n[o].plugin,h=n[o].mapping,l=n[o].settingsKey,u=n[o].configKey;s(i,l,r[u])&&(t[h]=new a(t))}},remove:function(t){n.hasOwnProperty(t)&&delete n[t]}};t.exports=r},40398:(t,e,i)=>{var s=i(90447),n=i(56694),r=i(53996),o=i(88456),a=i(44521),h=i(93736),l=i(36580),u=new n({initialize:function(t,e){this.manager=t,this.id=e,this.event,this.downElement,this.upElement,this.camera=null,this.button=0,this.buttons=0,this.position=new h,this.prevPosition=new h,this.midPoint=new h(-1,-1),this.velocity=new h,this.angle=0,this.distance=0,this.smoothFactor=0,this.motionFactor=.2,this.worldX=0,this.worldY=0,this.moveTime=0,this.downX=0,this.downY=0,this.downTime=0,this.upX=0,this.upY=0,this.upTime=0,this.primaryDown=!1,this.isDown=!1,this.wasTouch=!1,this.wasCanceled=!1,this.movementX=0,this.movementY=0,this.identifier=0,this.pointerId=null,this.active=0===e,this.locked=!1,this.deltaX=0,this.deltaY=0,this.deltaZ=0},updateWorldPoint:function(t){var e=t.getWorldPoint(this.x,this.y);return this.worldX=e.x,this.worldY=e.y,this},positionToCamera:function(t,e){return t.getWorldPoint(this.x,this.y,e)},updateMotion:function(){var t=this.position.x,e=this.position.y,i=this.midPoint.x,n=this.midPoint.y;if(t!==i||e!==n){var r=a(this.motionFactor,i,t),h=a(this.motionFactor,n,e);o(r,t,.1)&&(r=t),o(h,e,.1)&&(h=e),this.midPoint.set(r,h);var l=t-r,u=e-h;this.velocity.set(l,u),this.angle=s(r,h,t,e),this.distance=Math.sqrt(l*l+u*u)}},up:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!1,this.upX=this.x,this.upY=this.y),0===this.buttons&&(this.isDown=!1,this.upTime=t.timeStamp,this.wasTouch=!1)},down:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!0,this.downX=this.x,this.downY=this.y),l.macOS&&t.ctrlKey&&(this.buttons=2,this.primaryDown=!1),this.isDown||(this.isDown=!0,this.downTime=t.timeStamp),this.wasTouch=!1},move:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.locked&&(this.movementX=t.movementX||t.mozMovementX||t.webkitMovementX||0,this.movementY=t.movementY||t.mozMovementY||t.webkitMovementY||0),this.moveTime=t.timeStamp,this.wasTouch=!1},wheel:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.deltaX=t.deltaX,this.deltaY=t.deltaY,this.deltaZ=t.deltaZ,this.wasTouch=!1},touchstart:function(t,e){t.pointerId&&(this.pointerId=t.pointerId),this.identifier=t.identifier,this.target=t.target,this.active=!0,this.buttons=1,this.event=e,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=e.timeStamp,this.isDown=!0,this.wasTouch=!0,this.wasCanceled=!1,this.updateMotion()},touchmove:function(t,e){this.event=e,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.moveTime=e.timeStamp,this.wasTouch=!0,this.updateMotion()},touchend:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!1,this.active=!1,this.updateMotion()},touchcancel:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!0,this.active=!1},noButtonDown:function(){return 0===this.buttons},leftButtonDown:function(){return!!(1&this.buttons)},rightButtonDown:function(){return!!(2&this.buttons)},middleButtonDown:function(){return!!(4&this.buttons)},backButtonDown:function(){return!!(8&this.buttons)},forwardButtonDown:function(){return!!(16&this.buttons)},leftButtonReleased:function(){return 0===this.button&&!this.isDown},rightButtonReleased:function(){return 2===this.button&&!this.isDown},middleButtonReleased:function(){return 1===this.button&&!this.isDown},backButtonReleased:function(){return 3===this.button&&!this.isDown},forwardButtonReleased:function(){return 4===this.button&&!this.isDown},getDistance:function(){return this.isDown?r(this.downX,this.downY,this.x,this.y):r(this.downX,this.downY,this.upX,this.upY)},getDistanceX:function(){return this.isDown?Math.abs(this.downX-this.x):Math.abs(this.downX-this.upX)},getDistanceY:function(){return this.isDown?Math.abs(this.downY-this.y):Math.abs(this.downY-this.upY)},getDuration:function(){return this.isDown?this.manager.time-this.downTime:this.upTime-this.downTime},getAngle:function(){return this.isDown?s(this.downX,this.downY,this.x,this.y):s(this.downX,this.downY,this.upX,this.upY)},getInterpolatedPosition:function(t,e){void 0===t&&(t=10),void 0===e&&(e=[]);for(var i=this.prevPosition.x,s=this.prevPosition.y,n=this.position.x,r=this.position.y,o=0;o{t.exports={MOUSE_DOWN:0,MOUSE_MOVE:1,MOUSE_UP:2,TOUCH_START:3,TOUCH_MOVE:4,TOUCH_END:5,POINTER_LOCK_CHANGE:6,TOUCH_CANCEL:7,MOUSE_WHEEL:8}},14874:t=>{t.exports="boot"},54168:t=>{t.exports="destroy"},526:t=>{t.exports="dragend"},81623:t=>{t.exports="dragenter"},94472:t=>{t.exports="drag"},9304:t=>{t.exports="dragleave"},34265:t=>{t.exports="dragover"},50151:t=>{t.exports="dragstart"},98134:t=>{t.exports="drop"},56773:t=>{t.exports="gameobjectdown"},45824:t=>{t.exports="dragend"},39578:t=>{t.exports="dragenter"},72072:t=>{t.exports="drag"},82569:t=>{t.exports="dragleave"},70833:t=>{t.exports="dragover"},81442:t=>{t.exports="dragstart"},32936:t=>{t.exports="drop"},99658:t=>{t.exports="gameobjectmove"},60515:t=>{t.exports="gameobjectout"},55254:t=>{t.exports="gameobjectover"},34782:t=>{t.exports="pointerdown"},41769:t=>{t.exports="pointermove"},65588:t=>{t.exports="pointerout"},61640:t=>{t.exports="pointerover"},49342:t=>{t.exports="pointerup"},82662:t=>{t.exports="wheel"},13058:t=>{t.exports="gameobjectup"},52426:t=>{t.exports="gameobjectwheel"},78072:t=>{t.exports="gameout"},1545:t=>{t.exports="gameover"},67137:t=>{t.exports="boot"},27678:t=>{t.exports="process"},22257:t=>{t.exports="update"},90379:t=>{t.exports="pointerlockchange"},88909:t=>{t.exports="pointerdown"},36548:t=>{t.exports="pointerdownoutside"},18483:t=>{t.exports="pointermove"},22355:t=>{t.exports="pointerout"},7997:t=>{t.exports="pointerover"},66318:t=>{t.exports="pointerup"},94812:t=>{t.exports="pointerupoutside"},37310:t=>{t.exports="wheel"},24196:t=>{t.exports="preupdate"},27053:t=>{t.exports="shutdown"},29413:t=>{t.exports="start"},25165:t=>{t.exports="update"},33963:(t,e,i)=>{t.exports={BOOT:i(14874),DESTROY:i(54168),DRAG_END:i(526),DRAG_ENTER:i(81623),DRAG:i(94472),DRAG_LEAVE:i(9304),DRAG_OVER:i(34265),DRAG_START:i(50151),DROP:i(98134),GAME_OUT:i(78072),GAME_OVER:i(1545),GAMEOBJECT_DOWN:i(56773),GAMEOBJECT_DRAG_END:i(45824),GAMEOBJECT_DRAG_ENTER:i(39578),GAMEOBJECT_DRAG:i(72072),GAMEOBJECT_DRAG_LEAVE:i(82569),GAMEOBJECT_DRAG_OVER:i(70833),GAMEOBJECT_DRAG_START:i(81442),GAMEOBJECT_DROP:i(32936),GAMEOBJECT_MOVE:i(99658),GAMEOBJECT_OUT:i(60515),GAMEOBJECT_OVER:i(55254),GAMEOBJECT_POINTER_DOWN:i(34782),GAMEOBJECT_POINTER_MOVE:i(41769),GAMEOBJECT_POINTER_OUT:i(65588),GAMEOBJECT_POINTER_OVER:i(61640),GAMEOBJECT_POINTER_UP:i(49342),GAMEOBJECT_POINTER_WHEEL:i(82662),GAMEOBJECT_UP:i(13058),GAMEOBJECT_WHEEL:i(52426),MANAGER_BOOT:i(67137),MANAGER_PROCESS:i(27678),MANAGER_UPDATE:i(22257),POINTER_DOWN:i(88909),POINTER_DOWN_OUTSIDE:i(36548),POINTER_MOVE:i(18483),POINTER_OUT:i(22355),POINTER_OVER:i(7997),POINTER_UP:i(66318),POINTER_UP_OUTSIDE:i(94812),POINTER_WHEEL:i(37310),POINTERLOCK_CHANGE:i(90379),PRE_UPDATE:i(24196),SHUTDOWN:i(27053),START:i(29413),UPDATE:i(25165)}},70848:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e){this.pad=t,this.events=t.events,this.index=e,this.value=0,this.threshold=.1},update:function(t){this.value=t},getValue:function(){return Math.abs(this.value){var s=i(56694),n=i(43200),r=new s({initialize:function(t,e){this.pad=t,this.events=t.manager,this.index=e,this.value=0,this.threshold=1,this.pressed=!1},update:function(t){this.value=t;var e=this.pad,i=this.index;t>=this.threshold?this.pressed||(this.pressed=!0,this.events.emit(n.BUTTON_DOWN,e,this,t),this.pad.emit(n.GAMEPAD_BUTTON_DOWN,i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit(n.BUTTON_UP,e,this,t),this.pad.emit(n.GAMEPAD_BUTTON_UP,i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=r},75956:(t,e,i)=>{var s=i(70848),n=i(21274),r=i(56694),o=i(6659),a=i(93736),h=new r({Extends:o,initialize:function(t,e){o.call(this),this.manager=t,this.pad=e,this.id=e.id,this.index=e.index;for(var i=[],r=0;r=2&&(this.leftStick.set(r[0].getValue(),r[1].getValue()),n>=4&&this.rightStick.set(r[2].getValue(),r[3].getValue()))}},destroy:function(){var t;for(this.removeAllListeners(),this.manager=null,this.pad=null,t=0;t{var s=i(56694),n=i(6659),r=i(43200),o=i(75956),a=i(10850),h=i(63399),l=i(33963),u=new s({Extends:n,initialize:function(t){n.call(this),this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.enabled=!0,this.target,this.gamepads=[],this.queue=[],this.onGamepadHandler,this._pad1,this._pad2,this._pad3,this._pad4,t.pluginEvents.once(l.BOOT,this.boot,this),t.pluginEvents.on(l.START,this.start,this)},boot:function(){var t=this.scene.sys.game,e=this.settings.input,i=t.config;this.enabled=a(e,"gamepad",i.inputGamepad)&&t.device.input.gamepads,this.target=a(e,"gamepad.target",i.inputGamepadEventTarget),this.sceneInputPlugin.pluginEvents.once(l.DESTROY,this.destroy,this)},start:function(){this.enabled&&(this.startListeners(),this.refreshPads()),this.sceneInputPlugin.pluginEvents.once(l.SHUTDOWN,this.shutdown,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},startListeners:function(){var t=this,e=this.target,i=function(e){!e.defaultPrevented&&t.isActive()&&(t.refreshPads(),t.queue.push(e))};this.onGamepadHandler=i,e.addEventListener("gamepadconnected",i,!1),e.addEventListener("gamepaddisconnected",i,!1),this.sceneInputPlugin.pluginEvents.on(l.UPDATE,this.update,this)},stopListeners:function(){this.target.removeEventListener("gamepadconnected",this.onGamepadHandler),this.target.removeEventListener("gamepaddisconnected",this.onGamepadHandler),this.sceneInputPlugin.pluginEvents.off(l.UPDATE,this.update);for(var t=0;t{t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,SELECT:8,START:9,B:0,A:1,Y:2,X:3,LEFT_SHOULDER:4,RIGHT_SHOULDER:5}},74982:t=>{t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,SHARE:8,OPTIONS:9,PS:16,TOUCHBAR:17,X:0,CIRCLE:1,SQUARE:2,TRIANGLE:3,L1:4,R1:5,L2:6,R2:7,L3:10,R3:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}},43247:t=>{t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,MENU:16,A:0,B:1,X:2,Y:3,LB:4,RB:5,LT:6,RT:7,BACK:8,START:9,LS:10,RS:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}},4898:(t,e,i)=>{t.exports={DUALSHOCK_4:i(74982),SNES_USB:i(33171),XBOX_360:i(43247)}},17344:t=>{t.exports="down"},36635:t=>{t.exports="up"},85724:t=>{t.exports="connected"},55832:t=>{t.exports="disconnected"},772:t=>{t.exports="down"},33608:t=>{t.exports="up"},43200:(t,e,i)=>{t.exports={BUTTON_DOWN:i(17344),BUTTON_UP:i(36635),CONNECTED:i(85724),DISCONNECTED:i(55832),GAMEPAD_BUTTON_DOWN:i(772),GAMEPAD_BUTTON_UP:i(33608)}},92636:(t,e,i)=>{t.exports={Axis:i(70848),Button:i(21274),Events:i(43200),Gamepad:i(75956),GamepadPlugin:i(1379),Configs:i(4898)}},20873:(t,e,i)=>{var s=i(72687),n=i(98611),r={CreatePixelPerfectHandler:i(18104),CreateInteractiveObject:i(27395),Events:i(33963),Gamepad:i(92636),InputManager:i(69898),InputPlugin:i(12499),InputPluginCache:i(63399),Keyboard:i(28388),Mouse:i(11343),Pointer:i(40398),Touch:i(77423)};r=n(!1,r,s),t.exports=r},71064:(t,e,i)=>{var s=i(66458),n=i(56694),r=i(97081),o=i(33963),a=i(11873),h=i(72283),l=new n({initialize:function(t){this.manager=t,this.queue=[],this.preventDefault=!0,this.captures=[],this.enabled=!1,this.target,this.onKeyDown=h,this.onKeyUp=h,t.events.once(o.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputKeyboard,this.target=t.inputKeyboardEventTarget,this.addCapture(t.inputKeyboardCapture),!this.target&&window&&(this.target=window),this.enabled&&this.target&&this.startListeners(),this.manager.game.events.on(r.POST_STEP,this.postUpdate,this)},startListeners:function(){var t=this;this.onKeyDown=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.events.emit(o.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}},this.onKeyUp=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.events.emit(o.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}};var e=this.target;e&&(e.addEventListener("keydown",this.onKeyDown,!1),e.addEventListener("keyup",this.onKeyUp,!1),this.enabled=!0)},stopListeners:function(){var t=this.target;t.removeEventListener("keydown",this.onKeyDown,!1),t.removeEventListener("keyup",this.onKeyUp,!1),this.enabled=!1},postUpdate:function(){this.queue=[]},addCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},removeCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},clearCaptures:function(){this.captures=[],this.preventDefault=!1},destroy:function(){this.stopListeners(),this.clearCaptures(),this.queue=[],this.manager.game.events.off(r.POST_RENDER,this.postUpdate,this),this.target=null,this.enabled=!1,this.manager=null}});t.exports=l},89666:(t,e,i)=>{var s=i(56694),n=i(6659),r=i(94030),o=i(97081),a=i(10850),h=i(33963),l=i(63399),u=i(50165),c=i(11873),d=i(95625),p=i(48044),f=i(7599),v=i(84314),g=new s({Extends:n,initialize:function(t){n.call(this),this.game=t.systems.game,this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.manager=t.manager.keyboard,this.enabled=!0,this.keys=[],this.combos=[],this.prevCode=null,this.prevTime=0,this.prevType=null,t.pluginEvents.once(h.BOOT,this.boot,this),t.pluginEvents.on(h.START,this.start,this)},boot:function(){var t=this.settings.input;this.enabled=a(t,"keyboard",!0);var e=a(t,"keyboard.capture",null);e&&this.addCaptures(e),this.sceneInputPlugin.pluginEvents.once(h.DESTROY,this.destroy,this)},start:function(){this.sceneInputPlugin.manager.events.on(h.MANAGER_PROCESS,this.update,this),this.sceneInputPlugin.pluginEvents.once(h.SHUTDOWN,this.shutdown,this),this.game.events.on(o.BLUR,this.resetKeys,this),this.scene.sys.events.on(f.PAUSE,this.resetKeys,this),this.scene.sys.events.on(f.SLEEP,this.resetKeys,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},addCapture:function(t){return this.manager.addCapture(t),this},removeCapture:function(t){return this.manager.removeCapture(t),this},getCaptures:function(){return this.manager.captures},enableGlobalCapture:function(){return this.manager.preventDefault=!0,this},disableGlobalCapture:function(){return this.manager.preventDefault=!1,this},clearCaptures:function(){return this.manager.clearCaptures(),this},createCursorKeys:function(){return this.addKeys({up:c.UP,down:c.DOWN,left:c.LEFT,right:c.RIGHT,space:c.SPACE,shift:c.SHIFT})},addKeys:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1);var s={};if("string"==typeof t){t=t.split(",");for(var n=0;n-1?s[n]=t:s[t.keyCode]=t,e&&this.addCapture(t.keyCode),t.setEmitOnRepeat(i),t}return"string"==typeof t&&(t=c[t.toUpperCase()]),s[t]||(s[t]=new u(this,t),e&&this.addCapture(t),s[t].setEmitOnRepeat(i)),s[t]},removeKey:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var s,n=this.keys;if(t instanceof u){var r=n.indexOf(t);r>-1&&(s=this.keys[r],this.keys[r]=void 0)}else"string"==typeof t&&(t=c[t.toUpperCase()]);return n[t]&&(s=n[t],n[t]=void 0),s&&(s.plugin=null,i&&this.removeCapture(s.keyCode),e&&s.destroy()),this},removeAllKeys:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);for(var i=this.keys,s=0;st._tick)return t._tick=i,!0}return!1},update:function(){var t=this.manager.queue,e=t.length;if(this.isActive()&&0!==e)for(var i=this.keys,s=0;s{t.exports=function(t,e){return e.timeLastMatched=t.timeStamp,e.index++,e.index===e.size||(e.current=e.keyCodes[e.index],!1)}},95625:(t,e,i)=>{var s=i(56694),n=i(94030),r=i(72632),o=i(2544),a=i(88754),h=new s({initialize:function(t,e,i){if(void 0===i&&(i={}),e.length<2)return!1;this.manager=t,this.enabled=!0,this.keyCodes=[];for(var s=0;s{var s=i(60258);t.exports=function(t,e){if(e.matched)return!0;var i=!1,n=!1;if(t.keyCode===e.current)if(e.index>0&&e.maxKeyDelay>0){var r=e.timeLastMatched+e.maxKeyDelay;t.timeStamp<=r&&(n=!0,i=s(t,e))}else n=!0,i=s(t,e);return!n&&e.resetOnWrongKey&&(e.index=0,e.current=e.keyCodes[0]),i&&(e.timeLastMatched=t.timeStamp,e.matched=!0,e.timeMatched=t.timeStamp),i}},88754:t=>{t.exports=function(t){return t.current=t.keyCodes[0],t.index=0,t.timeLastMatched=0,t.matched=!1,t.timeMatched=0,t}},5044:t=>{t.exports="keydown"},40813:t=>{t.exports="keyup"},89319:t=>{t.exports="keycombomatch"},76362:t=>{t.exports="down"},78595:t=>{t.exports="keydown-"},30056:t=>{t.exports="keyup-"},81939:t=>{t.exports="up"},94030:(t,e,i)=>{t.exports={ANY_KEY_DOWN:i(5044),ANY_KEY_UP:i(40813),COMBO_MATCH:i(89319),DOWN:i(76362),KEY_DOWN:i(78595),KEY_UP:i(30056),UP:i(81939)}},28388:(t,e,i)=>{t.exports={Events:i(94030),KeyboardManager:i(71064),KeyboardPlugin:i(89666),Key:i(50165),KeyCodes:i(11873),KeyCombo:i(95625),AdvanceKeyCombo:i(60258),ProcessKeyCombo:i(2544),ResetKeyCombo:i(88754),JustDown:i(42460),JustUp:i(53162),DownDuration:i(64964),UpDuration:i(70331)}},64964:t=>{t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeDown;return t.isDown&&i{t.exports=function(t){return!!t._justDown&&(t._justDown=!1,!0)}},53162:t=>{t.exports=function(t){return!!t._justUp&&(t._justUp=!1,!0)}},50165:(t,e,i)=>{var s=i(56694),n=i(6659),r=i(94030),o=new s({Extends:n,initialize:function(t,e){n.call(this),this.plugin=t,this.keyCode=e,this.originalEvent=void 0,this.enabled=!0,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.metaKey=!1,this.location=0,this.timeDown=0,this.duration=0,this.timeUp=0,this.emitOnRepeat=!1,this.repeats=0,this._justDown=!1,this._justUp=!1,this._tick=-1},setEmitOnRepeat:function(t){return this.emitOnRepeat=t,this},onDown:function(t){this.originalEvent=t,this.enabled&&(this.altKey=t.altKey,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.metaKey=t.metaKey,this.location=t.location,this.repeats++,this.isDown?this.emitOnRepeat&&this.emit(r.DOWN,this,t):(this.isDown=!0,this.isUp=!1,this.timeDown=t.timeStamp,this.duration=0,this._justDown=!0,this._justUp=!1,this.emit(r.DOWN,this,t)))},onUp:function(t){this.originalEvent=t,this.enabled&&(this.isDown=!1,this.isUp=!0,this.timeUp=t.timeStamp,this.duration=this.timeUp-this.timeDown,this.repeats=0,this._justDown=!1,this._justUp=!0,this._tick=-1,this.emit(r.UP,this,t))},reset:function(){return this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.metaKey=!1,this.timeDown=0,this.duration=0,this.timeUp=0,this.repeats=0,this._justDown=!1,this._justUp=!1,this._tick=-1,this},getDuration:function(){return this.isDown?this.plugin.game.loop.time-this.timeDown:0},destroy:function(){this.removeAllListeners(),this.originalEvent=null,this.plugin=null}});t.exports=o},11873:t=>{t.exports={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:42,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,NUMPAD_ZERO:96,NUMPAD_ONE:97,NUMPAD_TWO:98,NUMPAD_THREE:99,NUMPAD_FOUR:100,NUMPAD_FIVE:101,NUMPAD_SIX:102,NUMPAD_SEVEN:103,NUMPAD_EIGHT:104,NUMPAD_NINE:105,NUMPAD_ADD:107,NUMPAD_SUBTRACT:109,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,SEMICOLON:186,PLUS:187,COMMA:188,MINUS:189,PERIOD:190,FORWARD_SLASH:191,BACK_SLASH:220,QUOTES:222,BACKTICK:192,OPEN_BRACKET:219,CLOSED_BRACKET:221,SEMICOLON_FIREFOX:59,COLON:58,COMMA_FIREFOX_WINDOWS:60,COMMA_FIREFOX:62,BRACKET_RIGHT_FIREFOX:174,BRACKET_LEFT_FIREFOX:175}},48044:(t,e,i)=>{var s=i(11873),n={};for(var r in s)n[s[r]]=r;t.exports=n},70331:t=>{t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeUp;return t.isUp&&i{var s=i(56694),n=i(90185),r=i(33963),o=i(72283),a=new s({initialize:function(t){this.manager=t,this.preventDefaultDown=!0,this.preventDefaultUp=!0,this.preventDefaultMove=!0,this.preventDefaultWheel=!1,this.enabled=!1,this.target,this.locked=!1,this.onMouseMove=o,this.onMouseDown=o,this.onMouseUp=o,this.onMouseDownWindow=o,this.onMouseUpWindow=o,this.onMouseOver=o,this.onMouseOut=o,this.onMouseWheel=o,this.pointerLockChange=o,this.isTop=!0,t.events.once(r.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputMouse,this.target=t.inputMouseEventTarget,this.passive=t.inputMousePassive,this.preventDefaultDown=t.inputMousePreventDefaultDown,this.preventDefaultUp=t.inputMousePreventDefaultUp,this.preventDefaultMove=t.inputMousePreventDefaultMove,this.preventDefaultWheel=t.inputMousePreventDefaultWheel,this.target?"string"==typeof this.target&&(this.target=document.getElementById(this.target)):this.target=this.manager.game.canvas,t.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return this.target.addEventListener("contextmenu",(function(t){return t.preventDefault(),!1})),this},requestPointerLock:function(){if(n.pointerLock){var t=this.target;t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock||t.webkitRequestPointerLock,t.requestPointerLock()}},releasePointerLock:function(){n.pointerLock&&(document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,document.exitPointerLock())},startListeners:function(){var t=this.target;if(t){var e=this,i=this.manager,s=i.canvas,r=window&&window.focus&&i.game.config.autoFocus;this.onMouseMove=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onMouseMove(t),e.preventDefaultMove&&t.preventDefault())},this.onMouseDown=function(t){r&&window.focus(),!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onMouseDown(t),e.preventDefaultDown&&t.target===s&&t.preventDefault())},this.onMouseDownWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==s&&i.onMouseDown(t)},this.onMouseUp=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onMouseUp(t),e.preventDefaultUp&&t.target===s&&t.preventDefault())},this.onMouseUpWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==s&&i.onMouseUp(t)},this.onMouseOver=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.setCanvasOver(t)},this.onMouseOut=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.setCanvasOut(t)},this.onMouseWheel=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.onMouseWheel(t),e.preventDefaultWheel&&t.target===s&&t.preventDefault()};var o={passive:!0};if(t.addEventListener("mousemove",this.onMouseMove),t.addEventListener("mousedown",this.onMouseDown),t.addEventListener("mouseup",this.onMouseUp),t.addEventListener("mouseover",this.onMouseOver,o),t.addEventListener("mouseout",this.onMouseOut,o),this.preventDefaultWheel?t.addEventListener("wheel",this.onMouseWheel,{passive:!1}):t.addEventListener("wheel",this.onMouseWheel,o),window&&i.game.config.inputWindowEvents)try{window.top.addEventListener("mousedown",this.onMouseDownWindow,o),window.top.addEventListener("mouseup",this.onMouseUpWindow,o)}catch(t){window.addEventListener("mousedown",this.onMouseDownWindow,o),window.addEventListener("mouseup",this.onMouseUpWindow,o),this.isTop=!1}n.pointerLock&&(this.pointerLockChange=function(t){var s=e.target;e.locked=document.pointerLockElement===s||document.mozPointerLockElement===s||document.webkitPointerLockElement===s,i.onPointerLockChange(t)},document.addEventListener("pointerlockchange",this.pointerLockChange,!0),document.addEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.addEventListener("webkitpointerlockchange",this.pointerLockChange,!0)),this.enabled=!0}},stopListeners:function(){var t=this.target;t.removeEventListener("mousemove",this.onMouseMove),t.removeEventListener("mousedown",this.onMouseDown),t.removeEventListener("mouseup",this.onMouseUp),t.removeEventListener("mouseover",this.onMouseOver),t.removeEventListener("mouseout",this.onMouseOut),window&&((t=this.isTop?window.top:window).removeEventListener("mousedown",this.onMouseDownWindow),t.removeEventListener("mouseup",this.onMouseUpWindow)),n.pointerLock&&(document.removeEventListener("pointerlockchange",this.pointerLockChange,!0),document.removeEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.removeEventListener("webkitpointerlockchange",this.pointerLockChange,!0))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});t.exports=a},11343:(t,e,i)=>{t.exports={MouseManager:i(7905)}},37579:(t,e,i)=>{var s=i(56694),n=i(33963),r=i(72283),o=new s({initialize:function(t){this.manager=t,this.capture=!0,this.enabled=!1,this.target,this.onTouchStart=r,this.onTouchStartWindow=r,this.onTouchMove=r,this.onTouchEnd=r,this.onTouchEndWindow=r,this.onTouchCancel=r,this.onTouchCancelWindow=r,this.isTop=!0,t.events.once(n.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputTouch,this.target=t.inputTouchEventTarget,this.capture=t.inputTouchCapture,this.target?"string"==typeof this.target&&(this.target=document.getElementById(this.target)):this.target=this.manager.game.canvas,t.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return this.target.addEventListener("contextmenu",(function(t){return t.preventDefault(),!1})),this},startListeners:function(){var t=this.target;if(t){var e=this,i=this.manager,s=i.canvas,n=window&&window.focus&&i.game.config.autoFocus;this.onTouchMove=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onTouchMove(t),e.capture&&t.cancelable&&t.preventDefault())},this.onTouchStart=function(t){n&&window.focus(),!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onTouchStart(t),e.capture&&t.cancelable&&t.target===s&&t.preventDefault())},this.onTouchStartWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==s&&i.onTouchStart(t)},this.onTouchEnd=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onTouchEnd(t),e.capture&&t.cancelable&&t.target===s&&t.preventDefault())},this.onTouchEndWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==s&&i.onTouchEnd(t)},this.onTouchCancel=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onTouchCancel(t),e.capture&&t.preventDefault())},this.onTouchCancelWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.onTouchCancel(t)};var r=this.capture,o={passive:!0},a={passive:!1};if(t.addEventListener("touchstart",this.onTouchStart,r?a:o),t.addEventListener("touchmove",this.onTouchMove,r?a:o),t.addEventListener("touchend",this.onTouchEnd,r?a:o),t.addEventListener("touchcancel",this.onTouchCancel,r?a:o),window&&i.game.config.inputWindowEvents)try{window.top.addEventListener("touchstart",this.onTouchStartWindow,a),window.top.addEventListener("touchend",this.onTouchEndWindow,a),window.top.addEventListener("touchcancel",this.onTouchCancelWindow,a)}catch(t){window.addEventListener("touchstart",this.onTouchStartWindow,a),window.addEventListener("touchend",this.onTouchEndWindow,a),window.addEventListener("touchcancel",this.onTouchCancelWindow,a),this.isTop=!1}this.enabled=!0}},stopListeners:function(){var t=this.target;t.removeEventListener("touchstart",this.onTouchStart),t.removeEventListener("touchmove",this.onTouchMove),t.removeEventListener("touchend",this.onTouchEnd),t.removeEventListener("touchcancel",this.onTouchCancel),window&&((t=this.isTop?window.top:window).removeEventListener("touchstart",this.onTouchStartWindow),t.removeEventListener("touchend",this.onTouchEndWindow),t.removeEventListener("touchcancel",this.onTouchCancelWindow))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});t.exports=o},77423:(t,e,i)=>{t.exports={TouchManager:i(37579)}},98035:(t,e,i)=>{var s=i(56694),n=i(12117),r=i(683),o=i(72632),a=i(30750),h=i(43531),l=i(88490),u=i(33868),c=new s({initialize:function(t,e){if(this.loader=t,this.cache=o(e,"cache",!1),this.type=o(e,"type",!1),!this.type)throw new Error("Invalid File type: "+this.type);this.key=o(e,"key",!1);var i=this.key;if(t.prefix&&""!==t.prefix&&(this.key=t.prefix+i),!this.key)throw new Error("Invalid File key: "+this.key);var s=o(e,"url");void 0===s?s=t.path+i+"."+o(e,"extension",""):"string"!=typeof s||s.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)||(s=t.path+s),this.url=s,this.src="",this.xhrSettings=u(o(e,"responseType",void 0)),o(e,"xhrSettings",!1)&&(this.xhrSettings=h(this.xhrSettings,o(e,"xhrSettings",{}))),this.xhrLoader=null,this.state="function"==typeof this.url?n.FILE_POPULATED:n.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=o(e,"config",{}),this.multiFile,this.linkFile},setLink:function(t){this.linkFile=t,t.linkFile=this},resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){this.state===n.FILE_POPULATED?this.loader.nextFile(this,!0):(this.state=n.FILE_LOADING,this.src=a(this,this.loader.baseURL),0===this.src.indexOf("data:")?console.warn("Local data URIs are not supported: "+this.key):this.xhrLoader=l(this,this.loader.xhr))},onLoad:function(t,e){var i=t.responseURL&&this.loader.localSchemes.some((function(e){return 0===t.responseURL.indexOf(e)}))&&0===e.target.status,s=!(e.target&&200!==e.target.status)||i;4===t.readyState&&t.status>=400&&t.status<=599&&(s=!1),this.state=n.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,s)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(r.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=n.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=n.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){console.error('Failed to process file: %s "%s"',this.type,this.key),this.state=n.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.data&&this.cache.add(this.key,this.data)},pendingDestroy:function(t){if(this.state!==n.FILE_PENDING_DESTROY){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit(r.FILE_COMPLETE,e,i,t),this.loader.emit(r.FILE_KEY_COMPLETE+i+"-"+e,e,i,t),this.loader.flagForRemoval(this),this.state=n.FILE_PENDING_DESTROY}},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});c.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var s=new FileReader;s.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+s.result.split(",")[1]},s.onerror=t.onerror,s.readAsDataURL(e)}},c.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=c},76846:t=>{var e={},i={install:function(t){for(var i in e)t[i]=e[i]},register:function(t,i){e[t]=i},destroy:function(){e={}}};t.exports=i},30750:t=>{t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},67285:(t,e,i)=>{var s=i(56694),n=i(12117),r=i(58403),o=i(6659),a=i(683),h=i(76846),l=i(72632),u=i(10850),c=i(91963),d=i(7599),p=i(33868),f=new s({Extends:o,initialize:function(t){o.call(this);var e=t.sys.game.config,i=t.sys.settings.loader;this.scene=t,this.systems=t.sys,this.cacheManager=t.sys.cache,this.textureManager=t.sys.textures,this.sceneManager=t.sys.game.scene,h.install(this),this.prefix="",this.path="",this.baseURL="",this.setBaseURL(l(i,"baseURL",e.loaderBaseURL)),this.setPath(l(i,"path",e.loaderPath)),this.setPrefix(l(i,"prefix",e.loaderPrefix)),this.maxParallelDownloads=l(i,"maxParallelDownloads",e.loaderMaxParallelDownloads),this.xhr=p(l(i,"responseType",e.loaderResponseType),l(i,"async",e.loaderAsync),l(i,"user",e.loaderUser),l(i,"password",e.loaderPassword),l(i,"timeout",e.loaderTimeout),l(i,"withCredentials",e.loaderWithCredentials)),this.crossOrigin=l(i,"crossOrigin",e.loaderCrossOrigin),this.imageLoadType=l(i,"imageLoadType",e.loaderImageLoadType),this.localSchemes=l(i,"localScheme",e.loaderLocalScheme),this.totalToLoad=0,this.progress=0,this.list=new r,this.inflight=new r,this.queue=new r,this._deleteQueue=new r,this.totalFailed=0,this.totalComplete=0,this.state=n.LOADER_IDLE,this.multiKeyIndex=0,t.sys.events.once(d.BOOT,this.boot,this),t.sys.events.on(d.START,this.pluginStart,this)},boot:function(){this.systems.events.once(d.DESTROY,this.destroy,this)},pluginStart:function(){this.systems.events.once(d.SHUTDOWN,this.shutdown,this)},setBaseURL:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.baseURL=t,this},setPath:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.path=t,this},setPrefix:function(t){return void 0===t&&(t=""),this.prefix=t,this},setCORS:function(t){return this.crossOrigin=t,this},addFile:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e0},isLoading:function(){return this.state===n.LOADER_LOADING||this.state===n.LOADER_PROCESSING},isReady:function(){return this.state===n.LOADER_IDLE||this.state===n.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit(a.START,this),0===this.list.size?this.loadComplete():(this.state=n.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on(d.UPDATE,this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit(a.PROGRESS,this.progress)},update:function(){this.state===n.LOADER_LOADING&&this.list.size>0&&this.inflight.size{var s=i(98611),n=i(33868);t.exports=function(t,e){var i=void 0===t?n():s({},t);if(e)for(var r in e)void 0!==e[r]&&(i[r]=e[r]);return i}},45176:(t,e,i)=>{var s=i(56694),n=i(12117),r=i(683),o=new s({initialize:function(t,e,i,s){var r=[];s.forEach((function(t){t&&r.push(t)})),this.loader=t,this.type=e,this.key=i,this.multiKeyIndex=t.multiKeyIndex++,this.files=r,this.state=n.FILE_PENDING,this.complete=!1,this.pending=r.length,this.failed=0,this.config={},this.baseURL=t.baseURL,this.path=t.path,this.prefix=t.prefix;for(var o=0;o{var s=i(43531);t.exports=function(t,e){var i=s(e,t.xhrSettings),n=new XMLHttpRequest;if(n.open("GET",t.src,i.async,i.user,i.password),n.responseType=t.xhrSettings.responseType,n.timeout=i.timeout,i.headers)for(var r in i.headers)n.setRequestHeader(r,i.headers[r]);return i.header&&i.headerValue&&n.setRequestHeader(i.header,i.headerValue),i.requestedWith&&n.setRequestHeader("X-Requested-With",i.requestedWith),i.overrideMimeType&&n.overrideMimeType(i.overrideMimeType),i.withCredentials&&(n.withCredentials=!0),n.onload=t.onLoad.bind(t,n),n.onerror=t.onError.bind(t,n),n.onprogress=t.onProgress.bind(t),n.send(),n}},33868:t=>{t.exports=function(t,e,i,s,n,r){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===s&&(s=""),void 0===n&&(n=0),void 0===r&&(r=!1),{responseType:t,async:e,user:i,password:s,timeout:n,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:r}}},12117:t=>{t.exports={LOADER_IDLE:0,LOADER_LOADING:1,LOADER_PROCESSING:2,LOADER_COMPLETE:3,LOADER_SHUTDOWN:4,LOADER_DESTROYED:5,FILE_PENDING:10,FILE_LOADING:11,FILE_LOADED:12,FILE_FAILED:13,FILE_PROCESSING:14,FILE_ERRORED:16,FILE_COMPLETE:17,FILE_DESTROYED:18,FILE_POPULATED:19,FILE_PENDING_DESTROY:20}},7398:t=>{t.exports="addfile"},52187:t=>{t.exports="complete"},36627:t=>{t.exports="filecomplete"},81925:t=>{t.exports="filecomplete-"},29774:t=>{t.exports="loaderror"},20943:t=>{t.exports="load"},74693:t=>{t.exports="fileprogress"},71176:t=>{t.exports="postprocess"},88984:t=>{t.exports="progress"},72753:t=>{t.exports="start"},683:(t,e,i)=>{t.exports={ADD:i(7398),COMPLETE:i(52187),FILE_COMPLETE:i(36627),FILE_KEY_COMPLETE:i(81925),FILE_LOAD_ERROR:i(29774),FILE_LOAD:i(20943),FILE_PROGRESS:i(74693),POST_PROCESS:i(71176),PROGRESS:i(88984),START:i(72753)}},46468:(t,e,i)=>{var s=i(56694),n=i(76846),r=i(70806),o=i(683),a=new s({Extends:r,initialize:function(t,e,i,s,n){r.call(this,t,e,i,s,n),this.type="animationJSON"},onProcess:function(){this.loader.once(o.POST_PROCESS,this.onLoadComplete,this),r.prototype.onProcess.call(this)},onLoadComplete:function(){this.loader.systems.anims.fromJSON(this.data)}});n.register("animation",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(76846),r=i(72632),o=i(42927),a=i(42911),h=i(70806),l=i(45176),u=new s({Extends:l,initialize:function(t,e,i,s,n,u){var c,d;if(a(e)){var p=e;e=r(p,"key"),c=new o(t,{key:e,url:r(p,"textureURL"),extension:r(p,"textureExtension","png"),normalMap:r(p,"normalMap"),xhrSettings:r(p,"textureXhrSettings")}),d=new h(t,{key:e,url:r(p,"atlasURL"),extension:r(p,"atlasExtension","json"),xhrSettings:r(p,"atlasXhrSettings")})}else c=new o(t,e,i,n),d=new h(t,e,s,u);c.linkFile?l.call(this,t,"atlasjson",e,[c,d,c.linkFile]):l.call(this,t,"atlasjson",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(t.key,t.data,e.data,i),e.addToCache(),this.complete=!0}}});n.register("aseprite",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var o=0;o{var s=i(56694),n=i(76846),r=i(72632),o=i(42927),a=i(42911),h=i(70806),l=i(45176),u=new s({Extends:l,initialize:function(t,e,i,s,n,u){var c,d;if(a(e)){var p=e;e=r(p,"key"),c=new o(t,{key:e,url:r(p,"textureURL"),extension:r(p,"textureExtension","png"),normalMap:r(p,"normalMap"),xhrSettings:r(p,"textureXhrSettings")}),d=new h(t,{key:e,url:r(p,"atlasURL"),extension:r(p,"atlasExtension","json"),xhrSettings:r(p,"atlasXhrSettings")})}else c=new o(t,e,i,n),d=new h(t,e,s,u);c.linkFile?l.call(this,t,"atlasjson",e,[c,d,c.linkFile]):l.call(this,t,"atlasjson",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(t.key,t.data,e.data,i),this.complete=!0}}});n.register("atlas",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var o=0;o{var s=i(56694),n=i(76846),r=i(72632),o=i(42927),a=i(42911),h=i(45176),l=i(15297),u=new s({Extends:h,initialize:function(t,e,i,s,n,u){var c,d;if(a(e)){var p=e;e=r(p,"key"),c=new o(t,{key:e,url:r(p,"textureURL"),extension:r(p,"textureExtension","png"),normalMap:r(p,"normalMap"),xhrSettings:r(p,"textureXhrSettings")}),d=new l(t,{key:e,url:r(p,"atlasURL"),extension:r(p,"atlasExtension","xml"),xhrSettings:r(p,"atlasXhrSettings")})}else c=new o(t,e,i,n),d=new l(t,e,s,u);c.linkFile?h.call(this,t,"atlasxml",e,[c,d,c.linkFile]):h.call(this,t,"atlasxml",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlasXML(t.key,t.data,e.data,i),this.complete=!0}}});n.register("atlasXML",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var o=0;o{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(30929),l=i(42911),u=new s({Extends:r,initialize:function(t,e,i,s,n){if(l(e)){var o=e;e=a(o,"key"),s=a(o,"xhrSettings"),n=a(o,"context",n)}var h={type:"audio",cache:t.cacheManager.audio,extension:i.type,responseType:"arraybuffer",key:e,url:i.url,xhrSettings:s,config:{context:n}};r.call(this,t,h)},onProcess:function(){this.state=n.FILE_PROCESSING;var t=this;this.config.context.decodeAudioData(this.xhrLoader.response,(function(e){t.data=e,t.onProcessComplete()}),(function(e){console.error("Error decoding audio: "+t.key+" - ",e?e.message:null),t.onProcessError()})),this.config.context=null}});u.create=function(t,e,i,s,n){var r=t.systems.game,o=r.config.audio,c=r.device.audio;l(e)&&(i=a(e,"url",[]),s=a(e,"config",{}));var d=u.getAudioURL(r,i);return d?c.webAudio&&!o.disableWebAudio?new u(t,e,d,n,r.sound.context):new h(t,e,d,s):null},u.getAudioURL=function(t,e){Array.isArray(e)||(e=[e]);for(var i=0;i{var s=i(67448),n=i(56694),r=i(76846),o=i(72632),a=i(42911),h=i(70806),l=i(45176),u=new n({Extends:l,initialize:function(t,e,i,n,r,u,c){if(a(e)){var d=e;e=o(d,"key"),i=o(d,"jsonURL"),n=o(d,"audioURL"),r=o(d,"audioConfig"),u=o(d,"audioXhrSettings"),c=o(d,"jsonXhrSettings")}var p;if(n){var f=s.create(t,e,n,r,u);f&&(p=new h(t,e,i,c),l.call(this,t,"audiosprite",e,[f,p]),this.config.resourceLoad=!1)}else p=new h(t,e,i,c),l.call(this,t,"audiosprite",e,[p]),this.config.resourceLoad=!0,this.config.audioConfig=r,this.config.audioXhrSettings=u},onFileComplete:function(t){if(-1!==this.files.indexOf(t)&&(this.pending--,this.config.resourceLoad&&"json"===t.type&&t.data.hasOwnProperty("resources"))){var e=t.data.resources,i=o(this.config,"audioConfig"),n=o(this.config,"audioXhrSettings"),r=s.create(this.loader,t.key,e,i,n);r&&(this.addToMultiFile(r),this.loader.addFile(r))}},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1];t.addToCache(),e.addToCache(),this.complete=!0}}});r.register("audioSprite",(function(t,e,i,s,n,r){var o,a=this.systems.game,h=a.config.audio,l=a.device.audio;if(h&&h.noAudio||!l.webAudio&&!l.audioData)return this;if(Array.isArray(t))for(var c=0;c{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s,n){var o="bin";if(h(e)){var l=e;e=a(l,"key"),i=a(l,"url"),s=a(l,"xhrSettings"),o=a(l,"extension",o),n=a(l,"dataType",n)}var u={type:"binary",cache:t.cacheManager.binary,extension:o,responseType:"arraybuffer",key:e,url:i,xhrSettings:s,config:{dataType:n}};r.call(this,t,u)},onProcess:function(){this.state=n.FILE_PROCESSING;var t=this.config.dataType;this.data=t?new t(this.xhrLoader.response):this.xhrLoader.response,this.onProcessComplete()}});o.register("binary",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(76846),r=i(72632),o=i(42927),a=i(42911),h=i(45176),l=i(31476),u=i(15297),c=new s({Extends:h,initialize:function(t,e,i,s,n,l){var c,d;if(a(e)){var p=e;e=r(p,"key"),c=new o(t,{key:e,url:r(p,"textureURL"),extension:r(p,"textureExtension","png"),normalMap:r(p,"normalMap"),xhrSettings:r(p,"textureXhrSettings")}),d=new u(t,{key:e,url:r(p,"fontDataURL"),extension:r(p,"fontDataExtension","xml"),xhrSettings:r(p,"fontDataXhrSettings")})}else c=new o(t,e,i,n),d=new u(t,e,s,l);c.linkFile?h.call(this,t,"bitmapfont",e,[c,d,c.linkFile]):h.call(this,t,"bitmapfont",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1];t.addToCache();var i=t.cache.get(t.key),s=l(e.data,t.cache.getFrame(t.key),0,0,i);this.loader.cacheManager.bitmapFont.add(t.key,{data:s,texture:t.key,frame:null}),this.complete=!0}}});n.register("bitmapFont",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var o=0;o{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s){var n="css";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),s=a(o,"xhrSettings"),n=a(o,"extension",n)}var l={type:"script",cache:!1,extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,l)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=document.createElement("style"),this.data.defer=!1,this.data.innerHTML=this.xhrLoader.responseText,document.head.appendChild(this.data),this.onProcessComplete()}});o.register("css",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(73152),n=i(40612),r=i(56694),o=i(76846),a=i(72632),h=i(42927),l=i(42911),u=i(70806),c=i(67409),d=i(30657),p=i(80802),f=i(45176),v=i(24904),g=new r({Extends:f,initialize:function(t,e,i,s){if(i.multiAtlasURL){var r=new u(t,{key:e,url:i.multiAtlasURL,xhrSettings:s,config:i});f.call(this,t,"texture",e,[r])}else{var o=i.textureURL.substr(i.textureURL.length-3);i.type||(i.type="ktx"===o.toLowerCase()?"KTX":"PVR");var a=new n(t,{key:e,url:i.textureURL,extension:o,xhrSettings:s,config:i});if(i.atlasURL){var h=new u(t,{key:e,url:i.atlasURL,xhrSettings:s,config:i});f.call(this,t,"texture",e,[a,h])}else f.call(this,t,"texture",e,[a])}this.config=i},onFileComplete:function(t){if(-1!==this.files.indexOf(t)){if(this.pending--,!this.config.multiAtlasURL)return;if("json"===t.type&&t.data.hasOwnProperty("textures")){var e=t.data.textures,i=this.config,s=this.loader,r=s.baseURL,o=s.path,h=s.prefix,l=a(i,"multiBaseURL",this.baseURL),u=a(i,"multiPath",this.path),c=a(i,"prefix",this.prefix),d=a(i,"textureXhrSettings");l&&s.setBaseURL(l),u&&s.setPath(u),c&&s.setPrefix(c);for(var p=0;p{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=i(31053),u=new s({Extends:r,initialize:function(t,e,i,s,n){var o="glsl";if(h(e)){var l=e;e=a(l,"key"),i=a(l,"url"),s=a(l,"shaderType","fragment"),n=a(l,"xhrSettings"),o=a(l,"extension",o)}else void 0===s&&(s="fragment");var u={type:"glsl",cache:t.cacheManager.shader,extension:o,responseType:"text",key:e,url:i,config:{shaderType:s},xhrSettings:n};r.call(this,t,u)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t=this.data.split("\n"),e=this.extractBlock(t,0);if(e)for(;e;){var i=this.getShaderName(e.header),s=this.getShaderType(e.header),n=this.getShaderUniforms(e.header),r=e.shader;if(this.cache.has(i)){var o=this.cache.get(i);"fragment"===s?o.fragmentSrc=r:o.vertexSrc=r,o.uniforms||(o.uniforms=n)}else"fragment"===s?this.cache.add(i,new l(i,r,"",n)):this.cache.add(i,new l(i,"",r,n));e=this.extractBlock(t,e.offset)}else"fragment"===this.config.shaderType?this.cache.add(this.key,new l(this.key,this.data)):this.cache.add(this.key,new l(this.key,"",this.data))},getShaderName:function(t){for(var e=0;e{var s=i(56694),n=i(683),r=i(98035),o=i(72632),a=i(30750),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s){if(h(e)){var n=e;e=o(n,"key"),s=o(n,"config",s)}var a={type:"audio",cache:t.cacheManager.audio,extension:i.type,key:e,url:i.url,config:s};r.call(this,t,a),this.locked="ontouchstart"in window,this.loaded=!1,this.filesLoaded=0,this.filesTotal=0},onLoad:function(){this.loaded||(this.loaded=!0,this.loader.nextFile(this,!0))},onError:function(){for(var t=0;t{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s){var n="html";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),s=a(o,"xhrSettings"),n=a(o,"extension",n)}var l={type:"text",cache:t.cacheManager.html,extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,l)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});o.register("html",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s,n,o){void 0===s&&(s=512),void 0===n&&(n=512);var l="html";if(h(e)){var u=e;e=a(u,"key"),i=a(u,"url"),o=a(u,"xhrSettings"),l=a(u,"extension",l),s=a(u,"width",s),n=a(u,"height",n)}var c={type:"html",cache:t.textureManager,extension:l,responseType:"text",key:e,url:i,xhrSettings:o,config:{width:s,height:n}};r.call(this,t,c)},onProcess:function(){this.state=n.FILE_PROCESSING;var t=this.config.width,e=this.config.height,i=[];i.push(''),i.push(''),i.push(''),i.push(this.xhrLoader.responseText),i.push(""),i.push(""),i.push("");var s=[i.join("\n")],o=this;try{var a=new window.Blob(s,{type:"image/svg+xml;charset=utf-8"})}catch(t){return o.state=n.FILE_ERRORED,void o.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){r.revokeObjectURL(o.data),o.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(o.data),o.onProcessError()},r.createObjectURL(this.data,a,"image/svg+xml")},addToCache:function(){this.cache.addImage(this.key,this.data)}});o.register("htmlTexture",(function(t,e,i,s,n){if(Array.isArray(t))for(var r=0;r{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=i(30750),u=new s({Extends:r,initialize:function t(e,i,s,n,o){var l,u="png";if(h(i)){var c=i;i=a(c,"key"),s=a(c,"url"),l=a(c,"normalMap"),n=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(c,"frameConfig")}Array.isArray(s)&&(l=s[1],s=s[0]);var d={type:"image",cache:e.textureManager,extension:u,responseType:"blob",key:i,url:s,xhrSettings:n,config:o};if(r.call(this,e,d),l){var p=new t(e,this.key,l,n,o);p.type="normalMap",this.setLink(p),e.addFile(p)}this.useImageElementLoad="HTMLImageElement"===e.imageLoadType,this.useImageElementLoad&&(this.load=this.loadImage,this.onProcess=this.onProcessImage)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){r.revokeObjectURL(t.data),t.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(t.data),t.onProcessError()},r.createObjectURL(this.data,this.xhrLoader.response,"image/png")},onProcessImage:function(){var t=this.state;this.state=n.FILE_PROCESSING,t===n.FILE_LOADED?this.onProcessComplete():this.onProcessError()},loadImage:function(){if(this.state=n.FILE_LOADING,this.src=l(this,this.loader.baseURL),0===this.src.indexOf("data:"))console.warn("Local data URIs are not supported: "+this.key);else{this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){t.state=n.FILE_LOADED,t.loader.nextFile(t,!0)},this.data.onerror=function(){t.loader.nextFile(t,!1)},this.data.src=this.src}},addToCache:function(){var t=this.linkFile;t&&t.state>=n.FILE_COMPLETE?"image"===this.type?this.cache.addImage(this.key,this.data,t.data):this.cache.addImage(t.key,t.data,this.data):t||this.cache.addImage(this.key,this.data)}});o.register("image",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(10850),l=i(42911),u=new s({Extends:r,initialize:function(t,e,i,s,o){var u="json";if(l(e)){var c=e;e=a(c,"key"),i=a(c,"url"),s=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(c,"dataKey",o)}var d={type:"json",cache:t.cacheManager.json,extension:u,responseType:"text",key:e,url:i,xhrSettings:s,config:o};r.call(this,t,d),l(i)&&(this.data=o?h(i,o):i,this.state=n.FILE_POPULATED)},onProcess:function(){if(this.state!==n.FILE_POPULATED){this.state=n.FILE_PROCESSING;try{var t=JSON.parse(this.xhrLoader.responseText)}catch(t){throw this.onProcessError(),t}var e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});o.register("json",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(76846),r=i(72632),o=i(42927),a=i(42911),h=i(70806),l=i(45176),u=new s({Extends:l,initialize:function(t,e,i,s,n,o,u){if(a(e)){var c=e;e=r(c,"key"),i=r(c,"url",!1)?r(c,"url"):r(c,"atlasURL"),o=r(c,"xhrSettings"),s=r(c,"path"),n=r(c,"baseURL"),u=r(c,"textureXhrSettings")}var d=new h(t,e,i,o);l.call(this,t,"multiatlas",e,[d]),this.config.path=s,this.config.baseURL=n,this.config.textureXhrSettings=u},onFileComplete:function(t){if(-1!==this.files.indexOf(t)&&(this.pending--,"json"===t.type&&t.data.hasOwnProperty("textures"))){var e=t.data.textures,i=this.config,s=this.loader,n=s.baseURL,a=s.path,h=s.prefix,l=r(i,"baseURL",this.baseURL),u=r(i,"path",this.path),c=r(i,"prefix",this.prefix),d=r(i,"textureXhrSettings");s.setBaseURL(l),s.setPath(u),s.setPrefix(c);for(var p=0;p{var s=i(56694),n=i(76846),r=i(72632),o=i(42911),a=i(45176),h=i(55188),l=new s({Extends:a,initialize:function(t,e,i,s){var n="js",l=[];if(o(e)){var u=e;e=r(u,"key"),i=r(u,"url"),s=r(u,"xhrSettings"),n=r(u,"extension",n)}Array.isArray(i)||(i=[i]);for(var c=0;c{var s=i(56694),n=i(76846),r=i(72632),o=i(42911),a=i(45176),h=i(27291),l=i(76799),u=i(86897),c=new s({Extends:a,initialize:function(t,e,i,s,n,h){var l,c,d=t.cacheManager.obj;if(o(e)){var p=e;e=r(p,"key"),l=new u(t,{key:e,type:"obj",cache:d,url:r(p,"url"),extension:r(p,"extension","obj"),xhrSettings:r(p,"xhrSettings"),config:{flipUV:r(p,"flipUV",n)}}),(s=r(p,"matURL"))&&(c=new u(t,{key:e,type:"mat",cache:d,url:s,extension:r(p,"matExtension","mat"),xhrSettings:r(p,"xhrSettings")}))}else l=new u(t,{key:e,url:i,type:"obj",cache:d,extension:"obj",xhrSettings:h,config:{flipUV:n}}),s&&(c=new u(t,{key:e,url:s,type:"mat",cache:d,extension:"mat",xhrSettings:h}));a.call(this,t,"obj",e,[l,c])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=h(t.data,t.config.flipUV);e&&(i.materials=l(e.data)),t.cache.add(t.key,i),this.complete=!0}}});n.register("obj",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var o=0;o{var s=i(56694),n=i(12117),r=i(76846),o=i(70806),a=new s({Extends:o,initialize:function(t,e,i,s,n){o.call(this,t,e,i,s,n),this.type="packfile"},onProcess:function(){this.state!==n.FILE_POPULATED&&(this.state=n.FILE_PROCESSING,this.data=JSON.parse(this.xhrLoader.responseText)),this.loader.addPack(this.data,this.config),this.onProcessComplete()}});r.register("pack",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s,o,l){var u="js";if(h(e)){var c=e;e=a(c,"key"),i=a(c,"url"),l=a(c,"xhrSettings"),u=a(c,"extension",u),s=a(c,"start"),o=a(c,"mapping")}var d={type:"plugin",cache:!1,extension:u,responseType:"text",key:e,url:i,xhrSettings:l,config:{start:s,mapping:o}};r.call(this,t,d),"function"==typeof i&&(this.data=i,this.state=n.FILE_POPULATED)},onProcess:function(){var t=this.loader.systems.plugins,e=this.config,i=a(e,"start",!1),s=a(e,"mapping",null);if(this.state===n.FILE_POPULATED)t.install(this.key,this.data,i,s);else{this.state=n.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data);var r=t.install(this.key,window[this.key],i,s);(i||s)&&(this.loader.systems[s]=r,this.loader.scene[s]=r)}this.onProcessComplete()}});o.register("plugin",(function(t,e,i,s,n){if(Array.isArray(t))for(var r=0;r{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s,n){var o="svg";if(h(e)){var l=e;e=a(l,"key"),i=a(l,"url"),s=a(l,"svgConfig",{}),n=a(l,"xhrSettings"),o=a(l,"extension",o)}var u={type:"svg",cache:t.textureManager,extension:o,responseType:"text",key:e,url:i,xhrSettings:n,config:{width:a(s,"width"),height:a(s,"height"),scale:a(s,"scale")}};r.call(this,t,u)},onProcess:function(){this.state=n.FILE_PROCESSING;var t=this.xhrLoader.responseText,e=[t],i=this.config.width,s=this.config.height,o=this.config.scale;t:if(i&&s||o){var a=(new DOMParser).parseFromString(t,"text/xml").getElementsByTagName("svg")[0],h=a.hasAttribute("viewBox"),l=parseFloat(a.getAttribute("width")),u=parseFloat(a.getAttribute("height"));if(!h&&l&&u)a.setAttribute("viewBox","0 0 "+l+" "+u);else if(h&&!l&&!u){var c=a.getAttribute("viewBox").split(/\s+|,/);l=c[2],u=c[3]}if(o){if(!l||!u)break t;i=l*o,s=u*o}a.setAttribute("width",i.toString()+"px"),a.setAttribute("height",s.toString()+"px"),e=[(new XMLSerializer).serializeToString(a)]}try{var d=new window.Blob(e,{type:"image/svg+xml;charset=utf-8"})}catch(t){return void this.onProcessError()}this.data=new Image,this.data.crossOrigin=this.crossOrigin;var p=this,f=!1;this.data.onload=function(){f||r.revokeObjectURL(p.data),p.onProcessComplete()},this.data.onerror=function(){f?p.onProcessError():(f=!0,r.revokeObjectURL(p.data),p.data.src="data:image/svg+xml,"+encodeURIComponent(e.join("")))},r.createObjectURL(this.data,d,"image/svg+xml")},addToCache:function(){this.cache.addImage(this.key,this.data)}});o.register("svg",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s){var n="js";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),s=a(o,"xhrSettings"),n=a(o,"extension",n)}var l={type:"text",extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,l)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t=this.data.concat("(function(){\nreturn new "+this.key+"();\n}).call(this);"),e=eval;this.loader.sceneManager.add(this.key,e(t)),this.complete=!0}});o.register("sceneFile",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s,o,l){var u="js";if(h(e)){var c=e;e=a(c,"key"),i=a(c,"url"),l=a(c,"xhrSettings"),u=a(c,"extension",u),s=a(c,"systemKey"),o=a(c,"sceneKey")}var d={type:"scenePlugin",cache:!1,extension:u,responseType:"text",key:e,url:i,xhrSettings:l,config:{systemKey:s,sceneKey:o}};r.call(this,t,d),"function"==typeof i&&(this.data=i,this.state=n.FILE_POPULATED)},onProcess:function(){var t=this.loader.systems.plugins,e=this.config,i=this.key,s=a(e,"systemKey",i),r=a(e,"sceneKey",i);this.state===n.FILE_POPULATED?t.installScenePlugin(s,this.data,r,this.loader.scene,!0):(this.state=n.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data),t.installScenePlugin(s,window[this.key],r,this.loader.scene,!0)),this.onProcessComplete()}});o.register("scenePlugin",(function(t,e,i,s,n){if(Array.isArray(t))for(var r=0;r{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s,n){var o="js";if(h(e)){var l=e;e=a(l,"key"),i=a(l,"url"),s=a(l,"type","script"),n=a(l,"xhrSettings"),o=a(l,"extension",o)}else void 0===s&&(s="script");var u={type:s,cache:!1,extension:o,responseType:"text",key:e,url:i,xhrSettings:n};r.call(this,t,u)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data),this.onProcessComplete()}});o.register("script",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(76846),r=i(42927),o=new s({Extends:r,initialize:function(t,e,i,s,n){r.call(this,t,e,i,n,s),this.type="spritesheet"},addToCache:function(){this.cache.addSpriteSheet(this.key,this.data,this.config)}});n.register("spritesheet",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s){var n="text",o="txt",l=t.cacheManager.text;if(h(e)){var u=e;e=a(u,"key"),i=a(u,"url"),s=a(u,"xhrSettings"),o=a(u,"extension",o),n=a(u,"type",n),l=a(u,"cache",l)}var c={type:n,cache:l,extension:o,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,c)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});o.register("text",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=i(93560),u=new s({Extends:r,initialize:function(t,e,i,s){var n="csv";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),s=a(o,"xhrSettings"),n=a(o,"extension",n)}var u={type:"tilemapCSV",cache:t.cacheManager.tilemap,extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,u),this.tilemapFormat=l.CSV},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t={format:this.tilemapFormat,data:this.data};this.cache.add(this.key,t)}});o.register("tilemapCSV",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(76846),r=i(70806),o=i(93560),a=new s({Extends:r,initialize:function(t,e,i,s){r.call(this,t,e,i,s),this.type="tilemapJSON",this.cache=t.cacheManager.tilemap},addToCache:function(){var t={format:o.WELTMEISTER,data:this.data};this.cache.add(this.key,t)}});n.register("tilemapImpact",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(76846),r=i(70806),o=i(93560),a=new s({Extends:r,initialize:function(t,e,i,s){r.call(this,t,e,i,s),this.type="tilemapJSON",this.cache=t.cacheManager.tilemap},addToCache:function(){var t={format:o.TILED_JSON,data:this.data};this.cache.add(this.key,t)}});n.register("tilemapTiledJSON",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(76846),r=i(72632),o=i(42927),a=i(42911),h=i(45176),l=i(86897),u=new s({Extends:h,initialize:function(t,e,i,s,n,u){var c,d;if(a(e)){var p=e;e=r(p,"key"),c=new o(t,{key:e,url:r(p,"textureURL"),extension:r(p,"textureExtension","png"),normalMap:r(p,"normalMap"),xhrSettings:r(p,"textureXhrSettings")}),d=new l(t,{key:e,url:r(p,"atlasURL"),extension:r(p,"atlasExtension","txt"),xhrSettings:r(p,"atlasXhrSettings")})}else c=new o(t,e,i,n),d=new l(t,e,s,u);c.linkFile?h.call(this,t,"unityatlas",e,[c,d,c.linkFile]):h.call(this,t,"unityatlas",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addUnityAtlas(t.key,t.data,e.data,i),this.complete=!0}}});n.register("unityAtlas",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var o=0;o{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(30750),h=i(72632),l=i(42911),u=new s({Extends:r,initialize:function(t,e,i,s,n,o,a){void 0===s&&(s="loadeddata"),void 0===n&&(n=!1),void 0===o&&(o=!1),"loadeddata"!==s&&"canplay"!==s&&"canplaythrough"!==s&&(s="loadeddata");var h={type:"video",cache:t.cacheManager.video,extension:i.type,responseType:"blob",key:e,url:i.url,xhrSettings:a,config:{loadEvent:s,asBlob:n,noAudio:o}};this.onLoadCallback=this.onVideoLoadHandler.bind(this),this.onErrorCallback=this.onVideoErrorHandler.bind(this),r.call(this,t,h)},onProcess:function(){if(this.state=n.FILE_PROCESSING,this.config.asBlob){var t=this.createVideoElement();this.data=t;var e=this;this.data.onloadeddata=function(){e.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(e.data),e.onProcessError()},r.createObjectURL(t,this.xhrLoader.response,""),t.load()}else this.onProcessComplete()},createVideoElement:function(){var t=document.createElement("video");return t.controls=!1,t.crossOrigin=this.loader.crossOrigin,this.config.noAudio&&(t.muted=!0,t.defaultMuted=!0,t.setAttribute("autoplay","autoplay")),t.setAttribute("playsinline","playsinline"),t.setAttribute("preload","auto"),t},onVideoLoadHandler:function(t){var e=t.target;e.removeEventListener(this.config.loadEvent,this.onLoadCallback,!0),e.removeEventListener("error",this.onErrorCallback,!0),this.data=e,this.resetXHR(),this.loader.nextFile(this,!0)},onVideoErrorHandler:function(t){var e=t.target;e&&(e.removeEventListener(this.config.loadEvent,this.onLoadCallback,!0),e.removeEventListener("error",this.onErrorCallback,!0)),this.resetXHR(),this.loader.nextFile(this,!1)},load:function(){var t=this.config.loadEvent;if(this.config.asBlob)r.prototype.load.call(this);else{this.percentComplete=0;var e=this.createVideoElement();e.addEventListener(t,this.onLoadCallback,!0),e.addEventListener("error",this.onErrorCallback,!0),e.src=a(this,this.loader.baseURL),e.load()}}});u.create=function(t,e,i,s,n,r,o){var a=t.systems.game;l(e)&&(i=h(e,"url",[]),s=h(e,"loadEvent","loadeddata"),n=h(e,"asBlob",!1),r=h(e,"noAudio",!1),o=h(e,"xhrSettings"),e=h(e,"key"));var c=u.getVideoURL(a,i);if(c)return new u(t,e,c,s,n,r,o)},u.getVideoURL=function(t,e){Array.isArray(e)||(e=[e]);for(var i=0;i{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=i(89200),u=new s({Extends:r,initialize:function(t,e,i,s){var n="xml";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),s=a(o,"xhrSettings"),n=a(o,"extension",n)}var l={type:"xml",cache:t.cacheManager.xml,extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,l)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=l(this.xhrLoader.responseText),this.data?this.onProcessComplete():this.onProcessError()}});o.register("xml",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{t.exports={AnimationJSONFile:i(46468),AsepriteFile:i(31648),AtlasJSONFile:i(73152),AtlasXMLFile:i(24616),AudioFile:i(67448),AudioSpriteFile:i(66109),BinaryFile:i(40612),BitmapFontFile:i(54565),CompressedTextureFile:i(47375),CSSFile:i(99898),GLSLFile:i(46568),HTML5AudioFile:i(30929),HTMLFile:i(77459),HTMLTextureFile:i(9755),ImageFile:i(42927),JSONFile:i(70806),MultiAtlasFile:i(80802),MultiScriptFile:i(39034),OBJFile:i(85527),PackFile:i(3616),PluginFile:i(12217),SceneFile:i(95171),ScenePluginFile:i(82458),ScriptFile:i(55188),SpriteSheetFile:i(33536),SVGFile:i(4474),TextFile:i(86897),TilemapCSVFile:i(58673),TilemapImpactFile:i(98896),TilemapJSONFile:i(50563),UnityAtlasFile:i(82857),VideoFile:i(22833),XMLFile:i(15297)}},95695:(t,e,i)=>{var s=i(12117),n=i(98611),r={Events:i(683),FileTypes:i(34034),File:i(98035),FileTypesManager:i(76846),GetURL:i(30750),LoaderPlugin:i(67285),MergeXHRSettings:i(43531),MultiFile:i(45176),XHRLoader:i(88490),XHRSettings:i(33868)};r=n(!1,r,s),t.exports=r},26042:t=>{t.exports=function(t){for(var e=0,i=0;i{var s=i(8034);t.exports=function(t,e){return s(t)/s(e)/s(t-e)}},17489:t=>{t.exports=function(t,e){return Math.floor(Math.random()*(e-t+1)+t)}},14976:t=>{t.exports=function(t,e,i,s,n){var r=.5*(s-e),o=.5*(n-i),a=t*t;return(2*i-2*s+r+o)*(t*a)+(-3*i+3*s-2*r-o)*a+r*t+i}},89129:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.ceil(t*s)/s}},82897:t=>{t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},75606:(t,e,i)=>{var s=i(83392);t.exports=function(t){return t*s.DEG_TO_RAD}},767:t=>{t.exports=function(t,e){return Math.abs(t-e)}},9849:(t,e,i)=>{var s=i(82897),n=i(56694),r=i(16650),o=i(72283),a=new r,h=new n({initialize:function t(e,i,s,n){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=t.DefaultOrder),this._x=e,this._y=i,this._z=s,this._order=n,this.onChangeCallback=o},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback(this)}},set:function(t,e,i,s){return void 0===s&&(s=this._order),this._x=t,this._y=e,this._z=i,this._order=s,this.onChangeCallback(this),this},copy:function(t){return this.set(t.x,t.y,t.z,t.order)},setFromQuaternion:function(t,e,i){return void 0===e&&(e=this._order),void 0===i&&(i=!1),a.fromQuat(t),this.setFromRotationMatrix(a,e,i)},setFromRotationMatrix:function(t,e,i){void 0===e&&(e=this._order),void 0===i&&(i=!1);var n=t.val,r=n[0],o=n[4],a=n[8],h=n[1],l=n[5],u=n[9],c=n[2],d=n[6],p=n[10],f=0,v=0,g=0,m=.99999;switch(e){case"XYZ":v=Math.asin(s(a,-1,1)),Math.abs(a){t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},61616:t=>{t.exports=function(t,e){return Math.random()*(e-t)+t}},60679:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.floor(t*s)/s}},91806:(t,e,i)=>{var s=i(82897);t.exports=function(t,e,i){return(i-e)*(t=s(t,0,1))+e}},79366:t=>{t.exports=function(t,e){return t/e/1e3}},43776:t=>{t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},58442:t=>{t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},42798:t=>{t.exports=function(t,e,i){return(e-t)*i+t}},61072:t=>{t.exports=function(t,e,i){return void 0===i&&(i=0),t.clone().lerp(e,i)}},5341:(t,e,i)=>{var s=new(i(56694))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new s(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=s,this},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=l*r-o*h,c=-l*n+o*a,d=h*n-r*a,p=e*u+i*c+s*d;return p?(p=1/p,t[0]=u*p,t[1]=(-l*i+s*h)*p,t[2]=(o*i-s*r)*p,t[3]=c*p,t[4]=(l*e-s*a)*p,t[5]=(-o*e+s*n)*p,t[6]=d*p,t[7]=(-h*e+i*a)*p,t[8]=(r*e-i*n)*p,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return t[0]=r*l-o*h,t[1]=s*h-i*l,t[2]=i*o-s*r,t[3]=o*a-n*l,t[4]=e*l-s*a,t[5]=s*n-e*o,t[6]=n*h-r*a,t[7]=i*a-e*h,t[8]=e*r-i*n,this},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return e*(l*r-o*h)+i*(-l*n+o*a)+s*(h*n-r*a)},multiply:function(t){var e=this.val,i=e[0],s=e[1],n=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=t.val,d=c[0],p=c[1],f=c[2],v=c[3],g=c[4],m=c[5],y=c[6],x=c[7],T=c[8];return e[0]=d*i+p*r+f*h,e[1]=d*s+p*o+f*l,e[2]=d*n+p*a+f*u,e[3]=v*i+g*r+m*h,e[4]=v*s+g*o+m*l,e[5]=v*n+g*a+m*u,e[6]=y*i+x*r+T*h,e[7]=y*s+x*o+T*l,e[8]=y*n+x*a+T*u,this},translate:function(t){var e=this.val,i=t.x,s=t.y;return e[6]=i*e[0]+s*e[3]+e[6],e[7]=i*e[1]+s*e[4]+e[7],e[8]=i*e[2]+s*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],s=e[1],n=e[2],r=e[3],o=e[4],a=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*r,e[1]=l*s+h*o,e[2]=l*n+h*a,e[3]=l*r-h*i,e[4]=l*o-h*s,e[5]=l*a-h*n,this},scale:function(t){var e=this.val,i=t.x,s=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=s*e[3],e[4]=s*e[4],e[5]=s*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,s=t.z,n=t.w,r=e+e,o=i+i,a=s+s,h=e*r,l=e*o,u=e*a,c=i*o,d=i*a,p=s*a,f=n*r,v=n*o,g=n*a,m=this.val;return m[0]=1-(c+p),m[3]=l+g,m[6]=u-v,m[1]=l-g,m[4]=1-(h+p),m[7]=d+f,m[2]=u+v,m[5]=d-f,m[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,i=this.val,s=e[0],n=e[1],r=e[2],o=e[3],a=e[4],h=e[5],l=e[6],u=e[7],c=e[8],d=e[9],p=e[10],f=e[11],v=e[12],g=e[13],m=e[14],y=e[15],x=s*h-n*a,T=s*l-r*a,w=s*u-o*a,b=n*l-r*h,E=n*u-o*h,S=r*u-o*l,A=c*g-d*v,_=c*m-p*v,C=c*y-f*v,R=d*m-p*g,M=d*y-f*g,P=p*y-f*m,O=x*P-T*M+w*R+b*C-E*_+S*A;return O?(O=1/O,i[0]=(h*P-l*M+u*R)*O,i[1]=(l*C-a*P-u*_)*O,i[2]=(a*M-h*C+u*A)*O,i[3]=(r*M-n*P-o*R)*O,i[4]=(s*P-r*C+o*_)*O,i[5]=(n*C-s*M-o*A)*O,i[6]=(g*S-m*E+y*b)*O,i[7]=(m*w-v*S-y*T)*O,i[8]=(v*E-g*w+y*x)*O,this):null}});t.exports=s},16650:(t,e,i)=>{var s=i(56694),n=i(70015),r=1e-6,o=new s({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new o(this)},set:function(t){return this.copy(t)},setValues:function(t,e,i,s,n,r,o,a,h,l,u,c,d,p,f,v){var g=this.val;return g[0]=t,g[1]=e,g[2]=i,g[3]=s,g[4]=n,g[5]=r,g[6]=o,g[7]=a,g[8]=h,g[9]=l,g[10]=u,g[11]=c,g[12]=d,g[13]=p,g[14]=f,g[15]=v,this},copy:function(t){var e=t.val;return this.setValues(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},fromArray:function(t){return this.setValues(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(t,e,i){var s=a.fromQuat(i).val,n=e.x,r=e.y,o=e.z;return this.setValues(s[0]*n,s[1]*n,s[2]*n,0,s[4]*r,s[5]*r,s[6]*r,0,s[8]*o,s[9]*o,s[10]*o,0,t.x,t.y,t.z,1)},xyz:function(t,e,i){this.identity();var s=this.val;return s[12]=t,s[13]=e,s[14]=i,this},scaling:function(t,e,i){this.zero();var s=this.val;return s[0]=t,s[5]=e,s[10]=i,s[15]=1,this},identity:function(){return this.setValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[3],n=t[6],r=t[7],o=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=n,t[11]=t[14],t[12]=s,t[13]=r,t[14]=o,this},getInverse:function(t){return this.copy(t),this.invert()},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],p=t[12],f=t[13],v=t[14],g=t[15],m=e*o-i*r,y=e*a-s*r,x=e*h-n*r,T=i*a-s*o,w=i*h-n*o,b=s*h-n*a,E=l*f-u*p,S=l*v-c*p,A=l*g-d*p,_=u*v-c*f,C=u*g-d*f,R=c*g-d*v,M=m*R-y*C+x*_+T*A-w*S+b*E;return M?(M=1/M,this.setValues((o*R-a*C+h*_)*M,(s*C-i*R-n*_)*M,(f*b-v*w+g*T)*M,(c*w-u*b-d*T)*M,(a*A-r*R-h*S)*M,(e*R-s*A+n*S)*M,(v*x-p*b-g*y)*M,(l*b-c*x+d*y)*M,(r*C-o*A+h*E)*M,(i*A-e*C-n*E)*M,(p*w-f*x+g*m)*M,(u*x-l*w-d*m)*M,(o*S-r*_-a*E)*M,(e*_-i*S+s*E)*M,(f*y-p*T-v*m)*M,(l*T-u*y+c*m)*M)):this},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],p=t[12],f=t[13],v=t[14],g=t[15];return this.setValues(o*(c*g-d*v)-u*(a*g-h*v)+f*(a*d-h*c),-(i*(c*g-d*v)-u*(s*g-n*v)+f*(s*d-n*c)),i*(a*g-h*v)-o*(s*g-n*v)+f*(s*h-n*a),-(i*(a*d-h*c)-o*(s*d-n*c)+u*(s*h-n*a)),-(r*(c*g-d*v)-l*(a*g-h*v)+p*(a*d-h*c)),e*(c*g-d*v)-l*(s*g-n*v)+p*(s*d-n*c),-(e*(a*g-h*v)-r*(s*g-n*v)+p*(s*h-n*a)),e*(a*d-h*c)-r*(s*d-n*c)+l*(s*h-n*a),r*(u*g-d*f)-l*(o*g-h*f)+p*(o*d-h*u),-(e*(u*g-d*f)-l*(i*g-n*f)+p*(i*d-n*u)),e*(o*g-h*f)-r*(i*g-n*f)+p*(i*h-n*o),-(e*(o*d-h*u)-r*(i*d-n*u)+l*(i*h-n*o)),-(r*(u*v-c*f)-l*(o*v-a*f)+p*(o*c-a*u)),e*(u*v-c*f)-l*(i*v-s*f)+p*(i*c-s*u),-(e*(o*v-a*f)-r*(i*v-s*f)+p*(i*a-s*o)),e*(o*c-a*u)-r*(i*c-s*u)+l*(i*a-s*o))},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],p=t[12],f=t[13],v=t[14],g=t[15];return(e*o-i*r)*(c*g-d*v)-(e*a-s*r)*(u*g-d*f)+(e*h-n*r)*(u*v-c*f)+(i*a-s*o)*(l*g-d*p)-(i*h-n*o)*(l*v-c*p)+(s*h-n*a)*(l*f-u*p)},multiply:function(t){var e=this.val,i=e[0],s=e[1],n=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=e[9],d=e[10],p=e[11],f=e[12],v=e[13],g=e[14],m=e[15],y=t.val,x=y[0],T=y[1],w=y[2],b=y[3];return e[0]=x*i+T*o+w*u+b*f,e[1]=x*s+T*a+w*c+b*v,e[2]=x*n+T*h+w*d+b*g,e[3]=x*r+T*l+w*p+b*m,x=y[4],T=y[5],w=y[6],b=y[7],e[4]=x*i+T*o+w*u+b*f,e[5]=x*s+T*a+w*c+b*v,e[6]=x*n+T*h+w*d+b*g,e[7]=x*r+T*l+w*p+b*m,x=y[8],T=y[9],w=y[10],b=y[11],e[8]=x*i+T*o+w*u+b*f,e[9]=x*s+T*a+w*c+b*v,e[10]=x*n+T*h+w*d+b*g,e[11]=x*r+T*l+w*p+b*m,x=y[12],T=y[13],w=y[14],b=y[15],e[12]=x*i+T*o+w*u+b*f,e[13]=x*s+T*a+w*c+b*v,e[14]=x*n+T*h+w*d+b*g,e[15]=x*r+T*l+w*p+b*m,this},multiplyLocal:function(t){var e=this.val,i=t.val;return this.setValues(e[0]*i[0]+e[1]*i[4]+e[2]*i[8]+e[3]*i[12],e[0]*i[1]+e[1]*i[5]+e[2]*i[9]+e[3]*i[13],e[0]*i[2]+e[1]*i[6]+e[2]*i[10]+e[3]*i[14],e[0]*i[3]+e[1]*i[7]+e[2]*i[11]+e[3]*i[15],e[4]*i[0]+e[5]*i[4]+e[6]*i[8]+e[7]*i[12],e[4]*i[1]+e[5]*i[5]+e[6]*i[9]+e[7]*i[13],e[4]*i[2]+e[5]*i[6]+e[6]*i[10]+e[7]*i[14],e[4]*i[3]+e[5]*i[7]+e[6]*i[11]+e[7]*i[15],e[8]*i[0]+e[9]*i[4]+e[10]*i[8]+e[11]*i[12],e[8]*i[1]+e[9]*i[5]+e[10]*i[9]+e[11]*i[13],e[8]*i[2]+e[9]*i[6]+e[10]*i[10]+e[11]*i[14],e[8]*i[3]+e[9]*i[7]+e[10]*i[11]+e[11]*i[15],e[12]*i[0]+e[13]*i[4]+e[14]*i[8]+e[15]*i[12],e[12]*i[1]+e[13]*i[5]+e[14]*i[9]+e[15]*i[13],e[12]*i[2]+e[13]*i[6]+e[14]*i[10]+e[15]*i[14],e[12]*i[3]+e[13]*i[7]+e[14]*i[11]+e[15]*i[15])},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.val,s=e.val,n=i[0],r=i[4],o=i[8],a=i[12],h=i[1],l=i[5],u=i[9],c=i[13],d=i[2],p=i[6],f=i[10],v=i[14],g=i[3],m=i[7],y=i[11],x=i[15],T=s[0],w=s[4],b=s[8],E=s[12],S=s[1],A=s[5],_=s[9],C=s[13],R=s[2],M=s[6],P=s[10],O=s[14],L=s[3],F=s[7],D=s[11],k=s[15];return this.setValues(n*T+r*S+o*R+a*L,h*T+l*S+u*R+c*L,d*T+p*S+f*R+v*L,g*T+m*S+y*R+x*L,n*w+r*A+o*M+a*F,h*w+l*A+u*M+c*F,d*w+p*A+f*M+v*F,g*w+m*A+y*M+x*F,n*b+r*_+o*P+a*D,h*b+l*_+u*P+c*D,d*b+p*_+f*P+v*D,g*b+m*_+y*P+x*D,n*E+r*C+o*O+a*k,h*E+l*C+u*O+c*k,d*E+p*C+f*O+v*k,g*E+m*C+y*O+x*k)},translate:function(t){return this.translateXYZ(t.x,t.y,t.z)},translateXYZ:function(t,e,i){var s=this.val;return s[12]=s[0]*t+s[4]*e+s[8]*i+s[12],s[13]=s[1]*t+s[5]*e+s[9]*i+s[13],s[14]=s[2]*t+s[6]*e+s[10]*i+s[14],s[15]=s[3]*t+s[7]*e+s[11]*i+s[15],this},scale:function(t){return this.scaleXYZ(t.x,t.y,t.z)},scaleXYZ:function(t,e,i){var s=this.val;return s[0]=s[0]*t,s[1]=s[1]*t,s[2]=s[2]*t,s[3]=s[3]*t,s[4]=s[4]*e,s[5]=s[5]*e,s[6]=s[6]*e,s[7]=s[7]*e,s[8]=s[8]*i,s[9]=s[9]*i,s[10]=s[10]*i,s[11]=s[11]*i,this},makeRotationAxis:function(t,e){var i=Math.cos(e),s=Math.sin(e),n=1-i,r=t.x,o=t.y,a=t.z,h=n*r,l=n*o;return this.setValues(h*r+i,h*o-s*a,h*a+s*o,0,h*o+s*a,l*o+i,l*a-s*r,0,h*a-s*o,l*a+s*r,n*a*a+i,0,0,0,0,1)},rotate:function(t,e){var i=this.val,s=e.x,n=e.y,o=e.z,a=Math.sqrt(s*s+n*n+o*o);if(Math.abs(a){t.exports=function(t,e,i){return Math.min(t+e,i)}},37394:t=>{t.exports=function(t){var e=t.length;if(0===e)return 0;t.sort((function(t,e){return t-e}));var i=Math.floor(e/2);return e%2==0?(t[i]+t[i-1])/2:t[i]}},17259:t=>{t.exports=function(t,e,i){return Math.max(t-e,i)}},61820:t=>{t.exports=function(t,e,i,s){void 0===i&&(i=e+1);var n=(t-e)/(i-e);return n>1?void 0!==s?(n=(s-t)/(s-i))<0&&(n=0):n=1:n<0&&(n=0),n}},75003:(t,e,i)=>{var s=i(56694),n=i(5341),r=i(72283),o=i(70015),a=1e-6,h=new Int8Array([1,2,0]),l=new Float32Array([0,0,0]),u=new o(1,0,0),c=new o(0,1,0),d=new o,p=new n,f=new s({initialize:function(t,e,i,s){this.onChangeCallback=r,this.set(t,e,i,s)},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback(this)}},copy:function(t){return this.set(t)},set:function(t,e,i,s,n){return void 0===n&&(n=!0),"object"==typeof t?(this._x=t.x||0,this._y=t.y||0,this._z=t.z||0,this._w=t.w||0):(this._x=t||0,this._y=e||0,this._z=i||0,this._w=s||0),n&&this.onChangeCallback(this),this},add:function(t){return this._x+=t.x,this._y+=t.y,this._z+=t.z,this._w+=t.w,this.onChangeCallback(this),this},subtract:function(t){return this._x-=t.x,this._y-=t.y,this._z-=t.z,this._w-=t.w,this.onChangeCallback(this),this},scale:function(t){return this._x*=t,this._y*=t,this._z*=t,this._w*=t,this.onChangeCallback(this),this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,n=t*t+e*e+i*i+s*s;return n>0&&(n=1/Math.sqrt(n),this._x=t*n,this._y=e*n,this._z=i*n,this._w=s*n),this.onChangeCallback(this),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,n=this.z,r=this.w;return this.set(i+e*(t.x-i),s+e*(t.y-s),n+e*(t.z-n),r+e*(t.w-r))},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(d.copy(u).cross(t).length().999999?this.set(0,0,0,1):(d.copy(t).cross(e),this._x=d.x,this._y=d.y,this._z=d.z,this._w=1+i,this.normalize())},setAxes:function(t,e,i){var s=p.val;return s[0]=e.x,s[3]=e.y,s[6]=e.z,s[1]=i.x,s[4]=i.y,s[7]=i.z,s[2]=-t.x,s[5]=-t.y,s[8]=-t.z,this.fromMat3(p).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.set(i*t.x,i*t.y,i*t.z,Math.cos(e))},multiply:function(t){var e=this.x,i=this.y,s=this.z,n=this.w,r=t.x,o=t.y,a=t.z,h=t.w;return this.set(e*h+n*r+i*a-s*o,i*h+n*o+s*r-e*a,s*h+n*a+e*o-i*r,n*h-e*r-i*o-s*a)},slerp:function(t,e){var i=this.x,s=this.y,n=this.z,r=this.w,o=t.x,h=t.y,l=t.z,u=t.w,c=i*o+s*h+n*l+r*u;c<0&&(c=-c,o=-o,h=-h,l=-l,u=-u);var d=1-e,p=e;if(1-c>a){var f=Math.acos(c),v=Math.sin(f);d=Math.sin((1-e)*f)/v,p=Math.sin(e*f)/v}return this.set(d*i+p*o,d*s+p*h,d*n+p*l,d*r+p*u)},invert:function(){var t=this.x,e=this.y,i=this.z,s=this.w,n=t*t+e*e+i*i+s*s,r=n?1/n:0;return this.set(-t*r,-e*r,-i*r,s*r)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,n=this.w,r=Math.sin(t),o=Math.cos(t);return this.set(e*o+n*r,i*o+s*r,s*o-i*r,n*o-e*r)},rotateY:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,n=this.w,r=Math.sin(t),o=Math.cos(t);return this.set(e*o-s*r,i*o+n*r,s*o+e*r,n*o-i*r)},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,n=this.w,r=Math.sin(t),o=Math.cos(t);return this.set(e*o+i*r,i*o-e*r,s*o+n*r,n*o-s*r)},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},setFromEuler:function(t,e){var i=t.x/2,s=t.y/2,n=t.z/2,r=Math.cos(i),o=Math.cos(s),a=Math.cos(n),h=Math.sin(i),l=Math.sin(s),u=Math.sin(n);switch(t.order){case"XYZ":this.set(h*o*a+r*l*u,r*l*a-h*o*u,r*o*u+h*l*a,r*o*a-h*l*u,e);break;case"YXZ":this.set(h*o*a+r*l*u,r*l*a-h*o*u,r*o*u-h*l*a,r*o*a+h*l*u,e);break;case"ZXY":this.set(h*o*a-r*l*u,r*l*a+h*o*u,r*o*u+h*l*a,r*o*a-h*l*u,e);break;case"ZYX":this.set(h*o*a-r*l*u,r*l*a+h*o*u,r*o*u-h*l*a,r*o*a+h*l*u,e);break;case"YZX":this.set(h*o*a+r*l*u,r*l*a+h*o*u,r*o*u-h*l*a,r*o*a-h*l*u,e);break;case"XZY":this.set(h*o*a-r*l*u,r*l*a-h*o*u,r*o*u+h*l*a,r*o*a+h*l*u,e)}return this},setFromRotationMatrix:function(t){var e,i=t.val,s=i[0],n=i[4],r=i[8],o=i[1],a=i[5],h=i[9],l=i[2],u=i[6],c=i[10],d=s+a+c;return d>0?(e=.5/Math.sqrt(d+1),this.set((u-h)*e,(r-l)*e,(o-n)*e,.25/e)):s>a&&s>c?(e=2*Math.sqrt(1+s-a-c),this.set(.25*e,(n+o)/e,(r+l)/e,(u-h)/e)):a>c?(e=2*Math.sqrt(1+a-s-c),this.set((n+o)/e,.25*e,(h+u)/e,(r-l)/e)):(e=2*Math.sqrt(1+c-s-a),this.set((r+l)/e,(h+u)/e,.25*e,(o-n)/e)),this},fromMat3:function(t){var e,i=t.val,s=i[0]+i[4]+i[8];if(s>0)e=Math.sqrt(s+1),this.w=.5*e,e=.5/e,this._x=(i[7]-i[5])*e,this._y=(i[2]-i[6])*e,this._z=(i[3]-i[1])*e;else{var n=0;i[4]>i[0]&&(n=1),i[8]>i[3*n+n]&&(n=2);var r=h[n],o=h[r];e=Math.sqrt(i[3*n+n]-i[3*r+r]-i[3*o+o]+1),l[n]=.5*e,e=.5/e,l[r]=(i[3*r+n]+i[3*n+r])*e,l[o]=(i[3*o+n]+i[3*n+o])*e,this._x=l[0],this._y=l[1],this._z=l[2],this._w=(i[3*o+r]-i[3*r+o])*e}return this.onChangeCallback(this),this}});t.exports=f},23701:(t,e,i)=>{var s=i(83392);t.exports=function(t){return t*s.RAD_TO_DEG}},16906:t=>{t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},52417:t=>{t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,s=2*Math.random()-1,n=Math.sqrt(1-s*s)*e;return t.x=Math.cos(i)*n,t.y=Math.sin(i)*n,t.z=s*e,t}},17915:t=>{t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},52257:t=>{t.exports=function(t,e){var i=t.x,s=t.y;return t.x=i*Math.cos(e)-s*Math.sin(e),t.y=i*Math.sin(e)+s*Math.cos(e),t}},2386:t=>{t.exports=function(t,e,i,s){var n=Math.cos(s),r=Math.sin(s),o=t.x-e,a=t.y-i;return t.x=o*n-a*r+e,t.y=o*r+a*n+i,t}},72395:t=>{t.exports=function(t,e,i,s,n){var r=s+Math.atan2(t.y-i,t.x-e);return t.x=e+n*Math.cos(r),t.y=i+n*Math.sin(r),t}},41061:t=>{t.exports=function(t,e,i,s,n){return t.x=e+n*Math.cos(s),t.y=i+n*Math.sin(s),t}},93709:(t,e,i)=>{var s=i(70015),n=i(16650),r=i(75003),o=new n,a=new r,h=new s;t.exports=function(t,e,i){return a.setAxisAngle(e,i),o.fromRotationTranslation(a,h.set(0,0,0)),t.transformMat4(o)}},67233:t=>{t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},64333:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.round(t*s)/s}},59533:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=1),void 0===i&&(i=1),void 0===s&&(s=1),s*=Math.PI/t;for(var n=[],r=[],o=0;o{t.exports=function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},87736:t=>{t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},55805:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n){void 0===n&&(n=new s);var r=0,o=0;return t>0&&t<=e*i&&(r=t>e-1?t-(o=Math.floor(t/e))*e:t),n.set(r,o)}},64462:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r,o,a,h){void 0===h&&(h=new s);var l=Math.sin(r),u=Math.cos(r),c=u*o,d=l*o,p=-l*a,f=u*a,v=1/(c*f+p*-d);return h.x=f*v*t+-p*v*e+(n*p-i*f)*v,h.y=c*v*e+-d*v*t+(-n*c+i*d)*v,h}},93736:(t,e,i)=>{var s=i(56694),n=i(88456),r=new s({initialize:function(t,e){this.x=0,this.y=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0):(void 0===e&&(e=t),this.x=t||0,this.y=e||0)},clone:function(){return new r(this.x,this.y)},copy:function(t){return this.x=t.x||0,this.y=t.y||0,this},setFromObject:function(t){return this.x=t.x||0,this.y=t.y||0,this},set:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setTo:function(t,e){return this.set(t,e)},setToPolar:function(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this},equals:function(t){return this.x===t.x&&this.y===t.y},fuzzyEquals:function(t,e){return n(this.x,t.x,e)&&n(this.y,t.y,e)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},setAngle:function(t){return this.setToPolar(t,this.length())},add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},length:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},setLength:function(t){return this.normalize().scale(t)},lengthSq:function(){var t=this.x,e=this.y;return t*t+e*e},normalize:function(){var t=this.x,e=this.y,i=t*t+e*e;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},normalizeLeftHand:function(){var t=this.x;return this.x=this.y,this.y=-1*t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this},transformMat3:function(t){var e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[3]*i+s[6],this.y=s[1]*e+s[4]*i+s[7],this},transformMat4:function(t){var e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[4]*i+s[12],this.y=s[1]*e+s[5]*i+s[13],this},reset:function(){return this.x=0,this.y=0,this},limit:function(t){var e=this.length();return e&&e>t&&this.scale(t/e),this},reflect:function(t){return t=t.clone().normalize(),this.subtract(t.scale(2*this.dot(t)))},mirror:function(t){return this.reflect(t).negate()},rotate:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e*this.x-i*this.y,i*this.x+e*this.y)},project:function(t){var e=this.dot(t)/t.dot(t);return this.copy(t).scale(e)}});r.ZERO=new r,r.RIGHT=new r(1,0),r.LEFT=new r(-1,0),r.UP=new r(0,-1),r.DOWN=new r(0,1),r.ONE=new r(1,1),t.exports=r},70015:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clone:function(){return new s(this.x,this.y,this.z)},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},crossVectors:function(t,e){var i=t.x,s=t.y,n=t.z,r=e.x,o=e.y,a=e.z;return this.x=s*a-n*o,this.y=n*r-i*a,this.z=i*o-s*r,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},setFromMatrixPosition:function(t){return this.fromArray(t.val,12)},setFromMatrixColumn:function(t,e){return this.fromArray(t.val,4*e)},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addScale:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return Math.sqrt(e*e+i*i+s*s)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return e*e+i*i+s*s},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,s=t*t+e*e+i*i;return s>0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,s=this.z,n=t.x,r=t.y,o=t.z;return this.x=i*o-s*r,this.y=s*n-e*o,this.z=e*r-i*n,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,n=this.z;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=n+e*(t.z-n),this},applyMatrix3:function(t){var e=this.x,i=this.y,s=this.z,n=t.val;return this.x=n[0]*e+n[3]*i+n[6]*s,this.y=n[1]*e+n[4]*i+n[7]*s,this.z=n[2]*e+n[5]*i+n[8]*s,this},applyMatrix4:function(t){var e=this.x,i=this.y,s=this.z,n=t.val,r=1/(n[3]*e+n[7]*i+n[11]*s+n[15]);return this.x=(n[0]*e+n[4]*i+n[8]*s+n[12])*r,this.y=(n[1]*e+n[5]*i+n[9]*s+n[13])*r,this.z=(n[2]*e+n[6]*i+n[10]*s+n[14])*r,this},transformMat3:function(t){var e=this.x,i=this.y,s=this.z,n=t.val;return this.x=e*n[0]+i*n[3]+s*n[6],this.y=e*n[1]+i*n[4]+s*n[7],this.z=e*n[2]+i*n[5]+s*n[8],this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,n=t.val;return this.x=n[0]*e+n[4]*i+n[8]*s+n[12],this.y=n[1]*e+n[5]*i+n[9]*s+n[13],this.z=n[2]*e+n[6]*i+n[10]*s+n[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,s=this.z,n=t.val,r=e*n[0]+i*n[4]+s*n[8]+n[12],o=e*n[1]+i*n[5]+s*n[9]+n[13],a=e*n[2]+i*n[6]+s*n[10]+n[14],h=e*n[3]+i*n[7]+s*n[11]+n[15];return this.x=r/h,this.y=o/h,this.z=a/h,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,n=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*s-o*i,l=a*i+o*e-n*s,u=a*s+n*i-r*e,c=-n*e-r*i-o*s;return this.x=h*a+c*-n+l*-o-u*-r,this.y=l*a+c*-r+u*-n-h*-o,this.z=u*a+c*-o+h*-r-l*-n,this},project:function(t){var e=this.x,i=this.y,s=this.z,n=t.val,r=n[0],o=n[1],a=n[2],h=n[3],l=n[4],u=n[5],c=n[6],d=n[7],p=n[8],f=n[9],v=n[10],g=n[11],m=n[12],y=n[13],x=n[14],T=1/(e*h+i*d+s*g+n[15]);return this.x=(e*r+i*l+s*p+m)*T,this.y=(e*o+i*u+s*f+y)*T,this.z=(e*a+i*c+s*v+x)*T,this},projectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unprojectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unproject:function(t,e){var i=t.x,s=t.y,n=t.z,r=t.w,o=this.x-i,a=r-this.y-1-s,h=this.z;return this.x=2*o/n-1,this.y=2*a/r-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});s.ZERO=new s,s.RIGHT=new s(1,0,0),s.LEFT=new s(-1,0,0),s.UP=new s(0,-1,0),s.DOWN=new s(0,1,0),s.FORWARD=new s(0,0,1),s.BACK=new s(0,0,-1),s.ONE=new s(1,1,1),t.exports=s},51729:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0)},clone:function(){return new s(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,s){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,n=t*t+e*e+i*i+s*s;return n>0&&(n=1/Math.sqrt(n),this.x=t*n,this.y=e*n,this.z=i*n,this.w=s*n),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,n=this.z,r=this.w;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=n+e*(t.z-n),this.w=r+e*(t.w-r),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,n=t.w-this.w||0;return Math.sqrt(e*e+i*i+s*s+n*n)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,n=t.w-this.w||0;return e*e+i*i+s*s+n*n},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,n=this.w,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*s+r[12]*n,this.y=r[1]*e+r[5]*i+r[9]*s+r[13]*n,this.z=r[2]*e+r[6]*i+r[10]*s+r[14]*n,this.w=r[3]*e+r[7]*i+r[11]*s+r[15]*n,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,n=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*s-o*i,l=a*i+o*e-n*s,u=a*s+n*i-r*e,c=-n*e-r*i-o*s;return this.x=h*a+c*-n+l*-o-u*-r,this.y=l*a+c*-r+u*-n-h*-o,this.z=u*a+c*-o+h*-r-l*-n,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});s.prototype.sub=s.prototype.subtract,s.prototype.mul=s.prototype.multiply,s.prototype.div=s.prototype.divide,s.prototype.dist=s.prototype.distance,s.prototype.distSq=s.prototype.distanceSq,s.prototype.len=s.prototype.length,s.prototype.lenSq=s.prototype.lengthSq,t.exports=s},9557:t=>{t.exports=function(t,e,i){return Math.abs(t-e)<=i}},1071:t=>{t.exports=function(t,e,i){var s=i-e;return e+((t-e)%s+s)%s}},90447:t=>{t.exports=function(t,e,i,s){return Math.atan2(s-e,i-t)}},94240:t=>{t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},84066:t=>{t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},9678:t=>{t.exports=function(t,e,i,s){return Math.atan2(i-t,s-e)}},76861:(t,e,i)=>{var s=i(83392);t.exports=function(t){return t>Math.PI&&(t-=s.PI2),Math.abs(((t+s.TAU)%s.PI2-s.PI2)%s.PI2)}},37570:t=>{t.exports=function(t){return(t%=2*Math.PI)>=0?t:t+2*Math.PI}},87597:(t,e,i)=>{var s=i(61616);t.exports=function(){return s(-Math.PI,Math.PI)}},74493:(t,e,i)=>{var s=i(61616);t.exports=function(){return s(-180,180)}},19049:(t,e,i)=>{var s=i(37570);t.exports=function(t){return s(t+Math.PI)}},90612:(t,e,i)=>{var s=i(83392);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=s.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e{t.exports=function(t,e){var i=e-t;return 0===i?0:i-360*Math.floor((i- -180)/360)}},35786:(t,e,i)=>{var s=i(1071);t.exports=function(t){return s(t,-Math.PI,Math.PI)}},62138:(t,e,i)=>{var s=i(1071);t.exports=function(t){return s(t,-180,180)}},22153:(t,e,i)=>{t.exports={Between:i(90447),BetweenPoints:i(94240),BetweenPointsY:i(84066),BetweenY:i(9678),CounterClockwise:i(76861),Normalize:i(37570),Random:i(87597),RandomDegrees:i(74493),Reverse:i(19049),RotateTo:i(90612),ShortestBetween:i(93954),Wrap:i(35786),WrapDegrees:i(62138)}},83392:t=>{var e={PI2:2*Math.PI,TAU:.5*Math.PI,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:null,MIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER||-9007199254740991,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991};t.exports=e},53996:t=>{t.exports=function(t,e,i,s){var n=t-i,r=e-s;return Math.sqrt(n*n+r*r)}},92951:t=>{t.exports=function(t,e){var i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)}},12161:t=>{t.exports=function(t,e){var i=t.x-e.x,s=t.y-e.y;return i*i+s*s}},38057:t=>{t.exports=function(t,e,i,s){return Math.max(Math.abs(t-i),Math.abs(e-s))}},33297:t=>{t.exports=function(t,e,i,s,n){return void 0===n&&(n=2),Math.sqrt(Math.pow(i-t,n)+Math.pow(s-e,n))}},90366:t=>{t.exports=function(t,e,i,s){return Math.abs(t-i)+Math.abs(e-s)}},35032:t=>{t.exports=function(t,e,i,s){var n=t-i,r=e-s;return n*n+r*r}},10130:(t,e,i)=>{t.exports={Between:i(53996),BetweenPoints:i(92951),BetweenPointsSquared:i(12161),Chebyshev:i(38057),Power:i(33297),Snake:i(90366),Squared:i(35032)}},35060:(t,e,i)=>{var s=i(25265),n=i(57428),r=i(73214),o=i(71778),a=i(36468),h=i(88258),l=i(52910),u=i(67799),c=i(74083),d=i(92284),p=i(28035),f=i(8754);t.exports={Power0:l,Power1:u.Out,Power2:o.Out,Power3:c.Out,Power4:d.Out,Linear:l,Quad:u.Out,Cubic:o.Out,Quart:c.Out,Quint:d.Out,Sine:p.Out,Expo:h.Out,Circ:r.Out,Elastic:a.Out,Back:s.Out,Bounce:n.Out,Stepped:f,"Quad.easeIn":u.In,"Cubic.easeIn":o.In,"Quart.easeIn":c.In,"Quint.easeIn":d.In,"Sine.easeIn":p.In,"Expo.easeIn":h.In,"Circ.easeIn":r.In,"Elastic.easeIn":a.In,"Back.easeIn":s.In,"Bounce.easeIn":n.In,"Quad.easeOut":u.Out,"Cubic.easeOut":o.Out,"Quart.easeOut":c.Out,"Quint.easeOut":d.Out,"Sine.easeOut":p.Out,"Expo.easeOut":h.Out,"Circ.easeOut":r.Out,"Elastic.easeOut":a.Out,"Back.easeOut":s.Out,"Bounce.easeOut":n.Out,"Quad.easeInOut":u.InOut,"Cubic.easeInOut":o.InOut,"Quart.easeInOut":c.InOut,"Quint.easeInOut":d.InOut,"Sine.easeInOut":p.InOut,"Expo.easeInOut":h.InOut,"Circ.easeInOut":r.InOut,"Elastic.easeInOut":a.InOut,"Back.easeInOut":s.InOut,"Bounce.easeInOut":n.InOut}},25860:t=>{t.exports=function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)}},45264:t=>{t.exports=function(t,e){void 0===e&&(e=1.70158);var i=1.525*e;return(t*=2)<1?t*t*((i+1)*t-i)*.5:.5*((t-=2)*t*((i+1)*t+i)+2)}},36699:t=>{t.exports=function(t,e){return void 0===e&&(e=1.70158),--t*t*((e+1)*t+e)+1}},25265:(t,e,i)=>{t.exports={In:i(25860),Out:i(36699),InOut:i(45264)}},62191:t=>{t.exports=function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}},24799:t=>{t.exports=function(t){var e=!1;return t<.5?(t=1-2*t,e=!0):t=2*t-1,t<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5}},60819:t=>{t.exports=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},57428:(t,e,i)=>{t.exports={In:i(62191),Out:i(60819),InOut:i(24799)}},86855:t=>{t.exports=function(t){return 1-Math.sqrt(1-t*t)}},7280:t=>{t.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},18058:t=>{t.exports=function(t){return Math.sqrt(1- --t*t)}},73214:(t,e,i)=>{t.exports={In:i(86855),Out:i(18058),InOut:i(7280)}},91532:t=>{t.exports=function(t){return t*t*t}},63180:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},16518:t=>{t.exports=function(t){return--t*t*t+1}},71778:(t,e,i)=>{t.exports={In:i(91532),Out:i(16518),InOut:i(63180)}},24729:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)}},50325:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)*.5+1}},84074:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-s)*(2*Math.PI)/i)+1}},36468:(t,e,i)=>{t.exports={In:i(24729),Out:i(84074),InOut:i(50325)}},95638:t=>{t.exports=function(t){return Math.pow(2,10*(t-1))-.001}},10357:t=>{t.exports=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))}},14894:t=>{t.exports=function(t){return 1-Math.pow(2,-10*t)}},88258:(t,e,i)=>{t.exports={In:i(95638),Out:i(14894),InOut:i(10357)}},33063:(t,e,i)=>{t.exports={Back:i(25265),Bounce:i(57428),Circular:i(73214),Cubic:i(71778),Elastic:i(36468),Expo:i(88258),Linear:i(52910),Quadratic:i(67799),Quartic:i(74083),Quintic:i(92284),Sine:i(28035),Stepped:i(8754)}},43927:t=>{t.exports=function(t){return t}},52910:(t,e,i)=>{t.exports=i(43927)},77471:t=>{t.exports=function(t){return t*t}},83863:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},44383:t=>{t.exports=function(t){return t*(2-t)}},67799:(t,e,i)=>{t.exports={In:i(77471),Out:i(44383),InOut:i(83863)}},48311:t=>{t.exports=function(t){return t*t*t*t}},55248:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},23135:t=>{t.exports=function(t){return 1- --t*t*t*t}},74083:(t,e,i)=>{t.exports={In:i(48311),Out:i(23135),InOut:i(55248)}},7313:t=>{t.exports=function(t){return t*t*t*t*t}},98759:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},26670:t=>{t.exports=function(t){return--t*t*t*t*t+1}},92284:(t,e,i)=>{t.exports={In:i(7313),Out:i(26670),InOut:i(98759)}},52929:t=>{t.exports=function(t){return 0===t?0:1===t?1:1-Math.cos(t*Math.PI/2)}},66333:t=>{t.exports=function(t){return 0===t?0:1===t?1:.5*(1-Math.cos(Math.PI*t))}},37255:t=>{t.exports=function(t){return 0===t?0:1===t?1:Math.sin(t*Math.PI/2)}},28035:(t,e,i)=>{t.exports={In:i(52929),Out:i(37255),InOut:i(66333)}},52770:t=>{t.exports=function(t,e){return void 0===e&&(e=1),t<=0?0:t>=1?1:1/e*(1+(e*t|0))}},8754:(t,e,i)=>{t.exports=i(52770)},17247:t=>{t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},88456:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.floor(t+e)}},41935:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t>e-i}},54726:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t{t.exports={Ceil:i(17247),Equal:i(88456),Floor:i(61824),GreaterThan:i(41935),LessThan:i(54726)}},5923:(t,e,i)=>{var s=i(83392),n=i(98611),r={Angle:i(22153),Distance:i(10130),Easing:i(33063),Fuzzy:i(52778),Interpolation:i(48528),Pow2:i(73773),Snap:i(23679),RandomDataGenerator:i(81429),Average:i(26042),Bernstein:i(22824),Between:i(17489),CatmullRom:i(14976),CeilTo:i(89129),Clamp:i(82897),DegToRad:i(75606),Difference:i(767),Euler:i(9849),Factorial:i(8034),FloatBetween:i(61616),FloorTo:i(60679),FromPercent:i(91806),GetSpeed:i(79366),IsEven:i(43776),IsEvenStrict:i(58442),Linear:i(42798),LinearXY:i(61072),MaxAdd:i(69635),Median:i(37394),MinSub:i(17259),Percent:i(61820),RadToDeg:i(23701),RandomXY:i(16906),RandomXYZ:i(52417),RandomXYZW:i(17915),Rotate:i(52257),RotateAround:i(2386),RotateAroundDistance:i(72395),RotateTo:i(41061),RoundAwayFromZero:i(67233),RoundTo:i(64333),SinCosTableGenerator:i(59533),SmootherStep:i(87736),SmoothStep:i(5514),ToXY:i(55805),TransformXY:i(64462),Within:i(9557),Wrap:i(1071),Vector2:i(93736),Vector3:i(70015),Vector4:i(51729),Matrix3:i(5341),Matrix4:i(16650),Quaternion:i(75003),RotateVec3:i(93709)};r=n(!1,r,s),t.exports=r},63210:(t,e,i)=>{var s=i(22824);t.exports=function(t,e){for(var i=0,n=t.length-1,r=0;r<=n;r++)i+=Math.pow(1-e,n-r)*Math.pow(e,r)*t[r]*s(n,r);return i}},88332:(t,e,i)=>{var s=i(14976);t.exports=function(t,e){var i=t.length-1,n=i*e,r=Math.floor(n);return t[0]===t[i]?(e<0&&(r=Math.floor(n=i*(1+e))),s(n-r,t[(r-1+i)%i],t[r],t[(r+1)%i],t[(r+2)%i])):e<0?t[0]-(s(-n,t[0],t[0],t[1],t[1])-t[0]):e>1?t[i]-(s(n-i,t[i],t[i],t[i-1],t[i-1])-t[i]):s(n-r,t[r?r-1:0],t[r],t[i{t.exports=function(t,e,i,s,n){return function(t,e){var i=1-t;return i*i*i*e}(t,e)+function(t,e){var i=1-t;return 3*i*i*t*e}(t,i)+function(t,e){return 3*(1-t)*t*t*e}(t,s)+function(t,e){return t*t*t*e}(t,n)}},47614:(t,e,i)=>{var s=i(42798);t.exports=function(t,e){var i=t.length-1,n=i*e,r=Math.floor(n);return e<0?s(t[0],t[1],n):e>1?s(t[i],t[i-1],i-n):s(t[r],t[r+1>i?i:r+1],n-r)}},16252:t=>{t.exports=function(t,e,i,s){return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,s)}},44521:(t,e,i)=>{var s=i(5514);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},45507:(t,e,i)=>{var s=i(87736);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},48528:(t,e,i)=>{t.exports={Bezier:i(63210),CatmullRom:i(88332),CubicBezier:i(34631),Linear:i(47614),QuadraticBezier:i(16252),SmoothStep:i(44521),SmootherStep:i(45507)}},3504:t=>{t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<{t.exports=function(t,e){return t>0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},2018:t=>{t.exports=function(t){return t>0&&0==(t&t-1)}},73773:(t,e,i)=>{t.exports={GetNext:i(3504),IsSize:i(28621),IsValue:i(2018)}},81429:(t,e,i)=>{var s=new(i(56694))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,i=this.n;t=t.toString();for(var s=0;s>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e0;e--){var i=Math.floor(this.frac()*(e+1)),s=t[i];t[i]=t[e],t[e]=s}return t}});t.exports=s},82127:t=>{t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),s?(i+t)/e:i+t)}},84314:t=>{t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),s?(i+t)/e:i+t)}},88462:t=>{t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),s?(i+t)/e:i+t)}},23679:(t,e,i)=>{t.exports={Ceil:i(82127),Floor:i(84314),To:i(88462)}},92491:(t,e,i)=>{var s=i(86459),n=i(98611),r={Actions:i(83979),Animations:i(13517),BlendModes:i(95723),Cache:i(45820),Cameras:i(44143),Core:i(80293),Class:i(56694),Create:i(84106),Curves:i(73962),Data:i(1999),Display:i(24816),DOM:i(3590),Events:i(95146),Game:i(15213),GameObjects:i(48013),Geom:i(84068),Input:i(20873),Loader:i(95695),Math:i(5923),Physics:i(53954),Plugins:i(45615),Renderer:i(42069),Scale:i(86754),ScaleModes:i(27394),Scene:i(87157),Scenes:i(20436),Structs:i(20010),Textures:i(87499),Tilemaps:i(52678),Time:i(97121),Tweens:i(75193),Utils:i(22178)};r.Sound=i(56751),r=n(!1,r,s),t.exports=r,i.g.Phaser=r},62832:(t,e,i)=>{var s=i(56694),n=i(7864),r=i(1539),o=new s({Extends:r,Mixins:[n.Acceleration,n.Angular,n.Bounce,n.Debug,n.Drag,n.Enable,n.Friction,n.Gravity,n.Immovable,n.Mass,n.Pushable,n.Size,n.Velocity],initialize:function(t,e,i,s,n){r.call(this,t,e,i,s,n),this.body=null}});t.exports=o},66150:(t,e,i)=>{var s=i(56694),n=i(75606),r=i(53996),o=i(35032),a=i(99523),h=i(72632),l=i(30657),u=i(2732),c=i(15147),d=i(91963),p=i(7599),f=i(93736),v=i(85233),g=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,t.sys.events.once(p.BOOT,this.boot,this),t.sys.events.on(p.START,this.start,this)},boot:function(){this.world=new v(this.scene,this.config),this.add=new a(this.world),this.systems.events.once(p.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new v(this.scene,this.config),this.add=new a(this.world));var t=this.systems.events;h(this.config,"customUpdate",!1)||t.on(p.UPDATE,this.world.update,this.world),t.on(p.POST_UPDATE,this.world.postUpdate,this.world),t.once(p.SHUTDOWN,this.shutdown,this)},enableUpdate:function(){this.systems.events.on(p.UPDATE,this.world.update,this.world)},disableUpdate:function(){this.systems.events.off(p.UPDATE,this.world.update,this.world)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return l(h(e,"arcade",{}),h(t,"arcade",{}))},overlap:function(t,e,i,s,n){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=i),this.world.collideObjects(t,e,i,s,n,!0)},collide:function(t,e,i,s,n){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=i),this.world.collideObjects(t,e,i,s,n,!1)},collideTiles:function(t,e,i,s,n){return this.world.collideTiles(t,e,i,s,n)},overlapTiles:function(t,e,i,s,n){return this.world.overlapTiles(t,e,i,s,n)},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},accelerateTo:function(t,e,i,s,n,r){void 0===s&&(s=60);var o=Math.atan2(i-t.y,e-t.x);return t.body.acceleration.setToPolar(o,s),void 0!==n&&void 0!==r&&t.body.maxVelocity.set(n,r),o},accelerateToObject:function(t,e,i,s,n){return this.accelerateTo(t,e.x,e.y,i,s,n)},closest:function(t,e){e||(e=this.world.bodies.entries);for(var i=Number.MAX_VALUE,s=null,n=t.x,r=t.y,a=e.length,h=0;hi&&(s=l,i=c)}}return s},moveTo:function(t,e,i,s,n){void 0===s&&(s=60),void 0===n&&(n=0);var o=Math.atan2(i-t.y,e-t.x);return n>0&&(s=r(t.x,t.y,e,i)/(n/1e3)),t.body.velocity.setToPolar(o,s),o},moveToObject:function(t,e,i,s){return this.moveTo(t,e.x,e.y,i,s)},velocityFromAngle:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new f),i.setToPolar(n(t),e)},velocityFromRotation:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new f),i.setToPolar(t,e)},overlapRect:function(t,e,i,s,n,r){return c(this.world,t,e,i,s,n,r)},overlapCirc:function(t,e,i,s,n){return u(this.world,t,e,i,s,n)},shutdown:function(){if(this.world){var t=this.systems.events;t.off(p.UPDATE,this.world.update,this.world),t.off(p.POST_UPDATE,this.world.postUpdate,this.world),t.off(p.SHUTDOWN,this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null}},destroy:function(){this.shutdown(),this.scene.sys.events.off(p.START,this.start,this),this.scene=null,this.systems=null}});d.register("ArcadePhysics",g,"arcadePhysics"),t.exports=g},25084:(t,e,i)=>{var s=i(56694),n=i(7864),r=i(13747),o=new s({Extends:r,Mixins:[n.Acceleration,n.Angular,n.Bounce,n.Debug,n.Drag,n.Enable,n.Friction,n.Gravity,n.Immovable,n.Mass,n.Pushable,n.Size,n.Velocity],initialize:function(t,e,i,s,n){r.call(this,t,e,i,s,n),this.body=null}});t.exports=o},97602:(t,e,i)=>{var s=i(56694),n=i(47401),r=i(27037),o=i(23701),a=i(74118),h=i(94287),l=i(93736),u=new s({initialize:function(t,e){var i=64,s=64,r=void 0!==e;r&&e.displayWidth&&(i=e.displayWidth,s=e.displayHeight),r||(e={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0}),this.world=t,this.gameObject=r?e:void 0,this.isBody=!0,this.transform={x:e.x,y:e.y,rotation:e.angle,scaleX:e.scaleX,scaleY:e.scaleY,displayOriginX:e.displayOriginX,displayOriginY:e.displayOriginY},this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new l,this.position=new l(e.x-e.scaleX*e.displayOriginX,e.y-e.scaleY*e.displayOriginY),this.prev=this.position.clone(),this.prevFrame=this.position.clone(),this.allowRotation=!0,this.rotation=e.angle,this.preRotation=e.angle,this.width=i,this.height=s,this.sourceWidth=i,this.sourceHeight=s,e.frame&&(this.sourceWidth=e.frame.realWidth,this.sourceHeight=e.frame.realHeight),this.halfWidth=Math.abs(i/2),this.halfHeight=Math.abs(s/2),this.center=new l(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=new l,this.newVelocity=new l,this.deltaMax=new l,this.acceleration=new l,this.allowDrag=!0,this.drag=new l,this.allowGravity=!0,this.gravity=new l,this.bounce=new l,this.worldBounce=null,this.customBoundsRectangle=t.bounds,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new l(1e4,1e4),this.maxSpeed=-1,this.friction=new l(1,0),this.useDamping=!1,this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=n.FACING_NONE,this.immovable=!1,this.pushable=!0,this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.syncBounds=!1,this.physicsType=n.DYNAMIC_BODY,this._sx=e.scaleX,this._sy=e.scaleY,this._dx=0,this._dy=0,this._tx=0,this._ty=0,this._bounds=new a},updateBounds:function(){var t=this.gameObject,e=this.transform;if(t.parentContainer){var i=t.getWorldTransformMatrix(this.world._tempMatrix,this.world._tempMatrix2);e.x=i.tx,e.y=i.ty,e.rotation=o(i.rotation),e.scaleX=i.scaleX,e.scaleY=i.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY}else e.x=t.x,e.y=t.y,e.rotation=t.angle,e.scaleX=t.scaleX,e.scaleY=t.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY;var s=!1;if(this.syncBounds){var n=t.getBounds(this._bounds);this.width=n.width,this.height=n.height,s=!0}else{var r=Math.abs(e.scaleX),a=Math.abs(e.scaleY);this._sx===r&&this._sy===a||(this.width=this.sourceWidth*r,this.height=this.sourceHeight*a,this._sx=r,this._sy=a,s=!0)}s&&(this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter())},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},updateFromGameObject:function(){this.updateBounds();var t=this.transform;this.position.x=t.x+t.scaleX*(this.offset.x-t.displayOriginX),this.position.y=t.y+t.scaleY*(this.offset.y-t.displayOriginY),this.updateCenter()},resetFlags:function(t){void 0===t&&(t=!1);var e=this.wasTouching,i=this.touching,s=this.blocked;t?(e.none=!0,e.up=!1,e.down=!1,e.left=!1,e.right=!1):(e.none=i.none,e.up=i.up,e.down=i.down,e.left=i.left,e.right=i.right),i.none=!0,i.up=!1,i.down=!1,i.left=!1,i.right=!1,s.none=!0,s.up=!1,s.down=!1,s.left=!1,s.right=!1,this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1},preUpdate:function(t,e){t&&this.resetFlags(),this.gameObject&&this.updateFromGameObject(),this.rotation=this.transform.rotation,this.preRotation=this.rotation,this.moves&&(this.prev.x=this.position.x,this.prev.y=this.position.y,this.prevFrame.x=this.position.x,this.prevFrame.y=this.position.y),t&&this.update(e)},update:function(t){if(this.prev.x=this.position.x,this.prev.y=this.position.y,this.moves){this.world.updateMotion(this,t);var e=this.velocity.x,i=this.velocity.y;this.newVelocity.set(e*t,i*t),this.position.add(this.newVelocity),this.updateCenter(),this.angle=Math.atan2(i,e),this.speed=Math.sqrt(e*e+i*i),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds&&this.world.emit(r.WORLD_BOUNDS,this,this.blocked.up,this.blocked.down,this.blocked.left,this.blocked.right)}this._dx=this.position.x-this.prev.x,this._dy=this.position.y-this.prev.y},postUpdate:function(){var t=this.position.x-this.prevFrame.x,e=this.position.y-this.prevFrame.y,i=this.gameObject;if(this.moves){var s=this.deltaMax.x,r=this.deltaMax.y;0!==s&&0!==t&&(t<0&&t<-s?t=-s:t>0&&t>s&&(t=s)),0!==r&&0!==e&&(e<0&&e<-r?e=-r:e>0&&e>r&&(e=r)),i&&(i.x+=t,i.y+=e)}t<0?this.facing=n.FACING_LEFT:t>0&&(this.facing=n.FACING_RIGHT),e<0?this.facing=n.FACING_UP:e>0&&(this.facing=n.FACING_DOWN),this.allowRotation&&i&&(i.angle+=this.deltaZ()),this._tx=t,this._ty=e},setBoundsRectangle:function(t){return this.customBoundsRectangle=t||this.world.bounds,this},checkWorldBounds:function(){var t=this.position,e=this.customBoundsRectangle,i=this.world.checkCollision,s=this.worldBounce?-this.worldBounce.x:-this.bounce.x,n=this.worldBounce?-this.worldBounce.y:-this.bounce.y,r=!1;return t.xe.right&&i.right&&(t.x=e.right-this.width,this.velocity.x*=s,this.blocked.right=!0,r=!0),t.ye.bottom&&i.down&&(t.y=e.bottom-this.height,this.velocity.y*=n,this.blocked.down=!0,r=!0),r&&(this.blocked.none=!1,this.updateCenter()),r},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this},setGameObject:function(t,e){return void 0===e&&(e=!0),this.world.remove(this),this.gameObject&&this.gameObject.body&&(this.gameObject.body=null),this.gameObject=t,t.body&&(t.body=this),this.setSize(),this.world.add(this),this.enable=e,this},setSize:function(t,e,i){void 0===i&&(i=!0);var s=this.gameObject;if(s&&(!t&&s.frame&&(t=s.frame.realWidth),!e&&s.frame&&(e=s.frame.realHeight)),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&s&&s.getCenter){var n=(s.width-t)/2,r=(s.height-e)/2;this.offset.set(n,r)}return this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.isCircle=!0,this.radius=t,this.sourceWidth=2*t,this.sourceHeight=2*t,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter()):this.isCircle=!1,this},reset:function(t,e){this.stop();var i=this.gameObject;i&&(i.setPosition(t,e),this.rotation=i.angle,this.preRotation=i.angle);var s=this.position;i&&i.getTopLeft?i.getTopLeft(s):s.set(t,e),this.prev.copy(s),this.prevFrame.copy(s),i&&this.updateBounds(),this.updateCenter(),this.checkWorldBounds(),this.resetFlags(!0)},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?this.radius>0&&t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom&&(this.center.x-t)*(this.center.x-t)+(this.center.y-e)*(this.center.y-e)<=this.radius*this.radius:h(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this._dx>0?this._dx:-this._dx},deltaAbsY:function(){return this._dy>0?this._dy:-this._dy},deltaX:function(){return this._dx},deltaY:function(){return this._dy},deltaXFinal:function(){return this._tx},deltaYFinal:function(){return this._ty},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.enable=!1,this.world&&this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,s=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor),this.isCircle?t.strokeCircle(i,s,this.width/2):(this.checkCollision.up&&t.lineBetween(e.x,e.y,e.x+this.width,e.y),this.checkCollision.right&&t.lineBetween(e.x+this.width,e.y,e.x+this.width,e.y+this.height),this.checkCollision.down&&t.lineBetween(e.x,e.y+this.height,e.x+this.width,e.y+this.height),this.checkCollision.left&&t.lineBetween(e.x,e.y,e.x,e.y+this.height))),this.debugShowVelocity&&(t.lineStyle(t.defaultStrokeWidth,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,s,i+this.velocity.x/2,s+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setCollideWorldBounds:function(t,e,i,s){void 0===t&&(t=!0),this.collideWorldBounds=t;var n=void 0!==e,r=void 0!==i;return(n||r)&&(this.worldBounce||(this.worldBounce=new l),n&&(this.worldBounce.x=e),r&&(this.worldBounce.y=i)),void 0!==s&&(this.onWorldBounds=s),this},setValue:function(t,e,i){return void 0===e&&(e=t.x),void 0===i&&(i=t.y),t.set(e,i),this},setVelocity:function(t,e){return this.velocity.set(t,e),t=this.velocity.x,e=this.velocity.y,this.speed=Math.sqrt(t*t+e*e),this},setVelocityX:function(t){return this.setVelocity(t,this.velocity.y)},setVelocityY:function(t){return this.setVelocity(this.velocity.x,t)},setMaxVelocity:function(t,e){return this.maxVelocity.set(t,e),this},setMaxVelocityX:function(t){return this.maxVelocity.x=t,this},setMaxVelocityY:function(t){return this.maxVelocity.y=t,this},setMaxSpeed:function(t){return this.maxSpeed=t,this},setBounce:function(t,e){return this.bounce.set(t,e),this},setBounceX:function(t){return this.bounce.x=t,this},setBounceY:function(t){return this.bounce.y=t,this},setAcceleration:function(t,e){return this.acceleration.set(t,e),this},setAccelerationX:function(t){return this.acceleration.x=t,this},setAccelerationY:function(t){return this.acceleration.y=t,this},setAllowDrag:function(t){return void 0===t&&(t=!0),this.allowDrag=t,this},setAllowGravity:function(t){return void 0===t&&(t=!0),this.allowGravity=t,this},setAllowRotation:function(t){return void 0===t&&(t=!0),this.allowRotation=t,this},setDrag:function(t,e){return this.drag.set(t,e),this},setDamping:function(t){return this.useDamping=t,this},setDragX:function(t){return this.drag.x=t,this},setDragY:function(t){return this.drag.y=t,this},setGravity:function(t,e){return this.gravity.set(t,e),this},setGravityX:function(t){return this.gravity.x=t,this},setGravityY:function(t){return this.gravity.y=t,this},setFriction:function(t,e){return this.friction.set(t,e),this},setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setAngularVelocity:function(t){return this.angularVelocity=t,this},setAngularAcceleration:function(t){return this.angularAcceleration=t,this},setAngularDrag:function(t){return this.angularDrag=t,this},setMass:function(t){return this.mass=t,this},setImmovable:function(t){return void 0===t&&(t=!0),this.immovable=t,this},setEnable:function(t){return void 0===t&&(t=!0),this.enable=t,this},processX:function(t,e,i,s){this.x+=t,this.updateCenter(),null!==e&&(this.velocity.x=e);var n=this.blocked;i&&(n.left=!0),s&&(n.right=!0)},processY:function(t,e,i,s){this.y+=t,this.updateCenter(),null!==e&&(this.velocity.y=e);var n=this.blocked;i&&(n.up=!0),s&&(n.down=!0)},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=u},3909:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s,n,r,o){this.world=t,this.name="",this.active=!0,this.overlapOnly=e,this.object1=i,this.object2=s,this.collideCallback=n,this.processCallback=r,this.callbackContext=o},setName:function(t){return this.name=t,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});t.exports=s},99523:(t,e,i)=>{var s=i(62832),n=i(25084),r=i(97602),o=i(56694),a=i(47401),h=i(10481),l=i(66634),u=i(46346),c=new o({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},collider:function(t,e,i,s,n){return this.world.addCollider(t,e,i,s,n)},overlap:function(t,e,i,s,n){return this.world.addOverlap(t,e,i,s,n)},existing:function(t,e){var i=e?a.STATIC_BODY:a.DYNAMIC_BODY;return this.world.enableBody(t,i),t},staticImage:function(t,e,i,n){var r=new s(this.scene,t,e,i,n);return this.sys.displayList.add(r),this.world.enableBody(r,a.STATIC_BODY),r},image:function(t,e,i,n){var r=new s(this.scene,t,e,i,n);return this.sys.displayList.add(r),this.world.enableBody(r,a.DYNAMIC_BODY),r},staticSprite:function(t,e,i,s){var r=new n(this.scene,t,e,i,s);return this.sys.displayList.add(r),this.sys.updateList.add(r),this.world.enableBody(r,a.STATIC_BODY),r},sprite:function(t,e,i,s){var r=new n(this.scene,t,e,i,s);return this.sys.displayList.add(r),this.sys.updateList.add(r),this.world.enableBody(r,a.DYNAMIC_BODY),r},staticGroup:function(t,e){return this.sys.updateList.add(new u(this.world,this.world.scene,t,e))},group:function(t,e){return this.sys.updateList.add(new h(this.world,this.world.scene,t,e))},body:function(t,e,i,s){var n=new r(this.world);return n.position.set(t,e),i&&s&&n.setSize(i,s),this.world.add(n,a.DYNAMIC_BODY),n},staticBody:function(t,e,i,s){var n=new l(this.world);return n.position.set(t,e),i&&s&&n.setSize(i,s),this.world.add(n,a.STATIC_BODY),n},destroy:function(){this.world=null,this.scene=null,this.sys=null}});t.exports=c},75671:(t,e,i)=>{var s=i(47401);t.exports=function(t,e,i,n){var r=0,o=t.deltaAbsX()+e.deltaAbsX()+n;return 0===t._dx&&0===e._dx?(t.embedded=!0,e.embedded=!0):t._dx>e._dx?(r=t.right-e.x)>o&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?r=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.right=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.left=!0)):t._dxo&&!i||!1===t.checkCollision.left||!1===e.checkCollision.right?r=0:(t.touching.none=!1,t.touching.left=!0,e.touching.none=!1,e.touching.right=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.left=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.right=!0))),t.overlapX=r,e.overlapX=r,r}},66185:(t,e,i)=>{var s=i(47401);t.exports=function(t,e,i,n){var r=0,o=t.deltaAbsY()+e.deltaAbsY()+n;return 0===t._dy&&0===e._dy?(t.embedded=!0,e.embedded=!0):t._dy>e._dy?(r=t.bottom-e.y)>o&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?r=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.down=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.up=!0)):t._dyo&&!i||!1===t.checkCollision.up||!1===e.checkCollision.down?r=0:(t.touching.none=!1,t.touching.up=!0,e.touching.none=!1,e.touching.down=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.up=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.down=!0))),t.overlapY=r,e.overlapY=r,r}},10481:(t,e,i)=>{var s=i(25084),n=i(56694),r=i(47401),o=i(72632),a=i(59192),h=i(42911),l=new n({Extends:a,initialize:function(t,e,i,n){if(i||n)if(h(i))n=i,i=null,n.internalCreateCallback=this.createCallbackHandler,n.internalRemoveCallback=this.removeCallbackHandler;else if(Array.isArray(i)&&h(i[0])){n=i[0];var l=this;i.forEach((function(t){t.internalCreateCallback=l.createCallbackHandler,t.internalRemoveCallback=l.removeCallbackHandler})),i=null}else n={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};else n={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};this.world=t,n.classType=o(n,"classType",s),this.physicsType=r.DYNAMIC_BODY,this.defaults={setCollideWorldBounds:o(n,"collideWorldBounds",!1),setBoundsRectangle:o(n,"customBoundsRectangle",null),setAccelerationX:o(n,"accelerationX",0),setAccelerationY:o(n,"accelerationY",0),setAllowDrag:o(n,"allowDrag",!0),setAllowGravity:o(n,"allowGravity",!0),setAllowRotation:o(n,"allowRotation",!0),setBounceX:o(n,"bounceX",0),setBounceY:o(n,"bounceY",0),setDragX:o(n,"dragX",0),setDragY:o(n,"dragY",0),setEnable:o(n,"enable",!0),setGravityX:o(n,"gravityX",0),setGravityY:o(n,"gravityY",0),setFrictionX:o(n,"frictionX",0),setFrictionY:o(n,"frictionY",0),setMaxVelocityX:o(n,"maxVelocityX",1e4),setMaxVelocityY:o(n,"maxVelocityY",1e4),setVelocityX:o(n,"velocityX",0),setVelocityY:o(n,"velocityY",0),setAngularVelocity:o(n,"angularVelocity",0),setAngularAcceleration:o(n,"angularAcceleration",0),setAngularDrag:o(n,"angularDrag",0),setMass:o(n,"mass",1),setImmovable:o(n,"immovable",!1)},a.call(this,e,i,n),this.type="PhysicsGroup"},createCallbackHandler:function(t){t.body||this.world.enableBody(t,r.DYNAMIC_BODY);var e=t.body;for(var i in this.defaults)e[i](this.defaults[i])},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},setVelocity:function(t,e,i){void 0===i&&(i=0);for(var s=this.getChildren(),n=0;n{var e,i,s,n,r,o,a,h,l,u,c,d,p,f,v,g,m,y=function(){return u&&v&&i.blocked.right?(e.processX(-m,a,!1,!0),1):l&&g&&i.blocked.left?(e.processX(m,a,!0),1):p&&g&&e.blocked.right?(i.processX(-m,h,!1,!0),2):d&&v&&e.blocked.left?(i.processX(m,h,!0),2):0},x=function(t){if(s&&n)m*=.5,0===t||3===t?(e.processX(m,r),i.processX(-m,o)):(e.processX(-m,r),i.processX(m,o));else if(s&&!n)0===t||3===t?e.processX(m,a,!0):e.processX(-m,a,!1,!0);else if(!s&&n)0===t||3===t?i.processX(-m,h,!1,!0):i.processX(m,h,!0);else{var v=.5*m;0===t?f?(e.processX(m,0,!0),i.processX(0,null,!1,!0)):p?(e.processX(v,0,!0),i.processX(-v,0,!1,!0)):(e.processX(v,i.velocity.x,!0),i.processX(-v,null,!1,!0)):1===t?c?(e.processX(0,null,!1,!0),i.processX(m,0,!0)):u?(e.processX(-v,0,!1,!0),i.processX(v,0,!0)):(e.processX(-v,null,!1,!0),i.processX(v,e.velocity.x,!0)):2===t?f?(e.processX(-m,0,!1,!0),i.processX(0,null,!0)):d?(e.processX(-v,0,!1,!0),i.processX(v,0,!0)):(e.processX(-v,i.velocity.x,!1,!0),i.processX(v,null,!0)):3===t&&(c?(e.processX(0,null,!0),i.processX(-m,0,!1,!0)):l?(e.processX(v,0,!0),i.processX(-v,0,!1,!0)):(e.processX(v,i.velocity.y,!0),i.processX(-v,null,!1,!0)))}return!0};t.exports={BlockCheck:y,Check:function(){var t=e.velocity.x,s=i.velocity.x,n=Math.sqrt(s*s*i.mass/e.mass)*(s>0?1:-1),a=Math.sqrt(t*t*e.mass/i.mass)*(t>0?1:-1),h=.5*(n+a);return a-=h,r=h+(n-=h)*e.bounce.x,o=h+a*i.bounce.x,l&&g?x(0):d&&v?x(1):u&&v?x(2):!(!p||!g)&&x(3)},Set:function(t,r,o){i=r;var x=(e=t).velocity.x,T=i.velocity.x;return s=e.pushable,l=e._dx<0,u=e._dx>0,c=0===e._dx,v=Math.abs(e.right-i.x)<=Math.abs(i.right-e.x),a=T-x*e.bounce.x,n=i.pushable,d=i._dx<0,p=i._dx>0,f=0===i._dx,g=!v,h=x-T*i.bounce.x,m=Math.abs(o),y()},Run:x,RunImmovableBody1:function(t){1===t?i.velocity.x=0:v?i.processX(m,h,!0):i.processX(-m,h,!1,!0),e.moves&&(i.y+=(e.y-e.prev.y)*e.friction.y,i._dy=i.y-i.prev.y)},RunImmovableBody2:function(t){2===t?e.velocity.x=0:g?e.processX(m,a,!0):e.processX(-m,a,!1,!0),i.moves&&(e.y+=(i.y-i.prev.y)*i.friction.y,e._dy=e.y-e.prev.y)}}},67050:t=>{var e,i,s,n,r,o,a,h,l,u,c,d,p,f,v,g,m,y=function(){return u&&v&&i.blocked.down?(e.processY(-m,a,!1,!0),1):l&&g&&i.blocked.up?(e.processY(m,a,!0),1):p&&g&&e.blocked.down?(i.processY(-m,h,!1,!0),2):d&&v&&e.blocked.up?(i.processY(m,h,!0),2):0},x=function(t){if(s&&n)m*=.5,0===t||3===t?(e.processY(m,r),i.processY(-m,o)):(e.processY(-m,r),i.processY(m,o));else if(s&&!n)0===t||3===t?e.processY(m,a,!0):e.processY(-m,a,!1,!0);else if(!s&&n)0===t||3===t?i.processY(-m,h,!1,!0):i.processY(m,h,!0);else{var v=.5*m;0===t?f?(e.processY(m,0,!0),i.processY(0,null,!1,!0)):p?(e.processY(v,0,!0),i.processY(-v,0,!1,!0)):(e.processY(v,i.velocity.y,!0),i.processY(-v,null,!1,!0)):1===t?c?(e.processY(0,null,!1,!0),i.processY(m,0,!0)):u?(e.processY(-v,0,!1,!0),i.processY(v,0,!0)):(e.processY(-v,null,!1,!0),i.processY(v,e.velocity.y,!0)):2===t?f?(e.processY(-m,0,!1,!0),i.processY(0,null,!0)):d?(e.processY(-v,0,!1,!0),i.processY(v,0,!0)):(e.processY(-v,i.velocity.y,!1,!0),i.processY(v,null,!0)):3===t&&(c?(e.processY(0,null,!0),i.processY(-m,0,!1,!0)):l?(e.processY(v,0,!0),i.processY(-v,0,!1,!0)):(e.processY(v,i.velocity.y,!0),i.processY(-v,null,!1,!0)))}return!0};t.exports={BlockCheck:y,Check:function(){var t=e.velocity.y,s=i.velocity.y,n=Math.sqrt(s*s*i.mass/e.mass)*(s>0?1:-1),a=Math.sqrt(t*t*e.mass/i.mass)*(t>0?1:-1),h=.5*(n+a);return a-=h,r=h+(n-=h)*e.bounce.y,o=h+a*i.bounce.y,l&&g?x(0):d&&v?x(1):u&&v?x(2):!(!p||!g)&&x(3)},Set:function(t,r,o){i=r;var x=(e=t).velocity.y,T=i.velocity.y;return s=e.pushable,l=e._dy<0,u=e._dy>0,c=0===e._dy,v=Math.abs(e.bottom-i.y)<=Math.abs(i.bottom-e.y),a=T-x*e.bounce.y,n=i.pushable,d=i._dy<0,p=i._dy>0,f=0===i._dy,g=!v,h=x-T*i.bounce.y,m=Math.abs(o),y()},Run:x,RunImmovableBody1:function(t){1===t?i.velocity.y=0:v?i.processY(m,h,!0):i.processY(-m,h,!1,!0),e.moves&&(i.x+=(e.x-e.prev.x)*e.friction.x,i._dx=i.x-i.prev.x)},RunImmovableBody2:function(t){2===t?e.velocity.y=0:g?e.processY(m,a,!0):e.processY(-m,a,!1,!0),i.moves&&(e.x+=(i.x-i.prev.x)*i.friction.x,e._dx=e.x-e.prev.x)}}},61777:(t,e,i)=>{var s=i(75671),n=i(22916);t.exports=function(t,e,i,r){var o=s(t,e,i,r),a=t.immovable,h=e.immovable;if(i||0===o||a&&h||t.customSeparateX||e.customSeparateX)return 0!==o||t.embedded&&e.embedded;var l=n.Set(t,e,o);return a||h?(a?n.RunImmovableBody1(l):h&&n.RunImmovableBody2(l),!0):l>0||n.Check()}},25299:(t,e,i)=>{var s=i(66185),n=i(67050);t.exports=function(t,e,i,r){var o=s(t,e,i,r),a=t.immovable,h=e.immovable;if(i||0===o||a&&h||t.customSeparateY||e.customSeparateY)return 0!==o||t.embedded&&e.embedded;var l=n.Set(t,e,o);return a||h?(a?n.RunImmovableBody1(l):h&&n.RunImmovableBody2(l),!0):l>0||n.Check()}},66634:(t,e,i)=>{var s=i(65650),n=i(56694),r=i(47401),o=i(94287),a=i(93736),h=new n({initialize:function(t,e){var i=64,s=64,n=void 0!==e;n&&e.displayWidth&&(i=e.displayWidth,s=e.displayHeight),n||(e={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0}),this.world=t,this.gameObject=n?e:void 0,this.isBody=!0,this.debugShowBody=t.defaults.debugShowStaticBody,this.debugBodyColor=t.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new a,this.position=new a(e.x-i*e.originX,e.y-s*e.originY),this.width=i,this.height=s,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new a(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=a.ZERO,this.allowGravity=!1,this.gravity=a.ZERO,this.bounce=a.ZERO,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.mass=1,this.immovable=!0,this.pushable=!1,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.physicsType=r.STATIC_BODY,this._dx=0,this._dy=0},setGameObject:function(t,e){return t&&t!==this.gameObject&&(this.gameObject.body=null,t.body=this,this.gameObject=t),e&&this.updateFromGameObject(),this},updateFromGameObject:function(){this.world.staticTree.remove(this);var t=this.gameObject;return t.getTopLeft(this.position),this.width=t.displayWidth,this.height=t.displayHeight,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.world.staticTree.insert(this),this},setOffset:function(t,e){return void 0===e&&(e=t),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(t,e),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(t,e,i){void 0===i&&(i=!0);var s=this.gameObject;if(!t&&s.frame&&(t=s.frame.realWidth),!e&&s.frame&&(e=s.frame.realHeight),this.world.staticTree.remove(this),this.width=t,this.height=e,this.halfWidth=Math.floor(t/2),this.halfHeight=Math.floor(e/2),i&&s.getCenter){var n=s.displayWidth/2,r=s.displayHeight/2;this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(n-this.halfWidth,r-this.halfHeight),this.position.x+=this.offset.x,this.position.y+=this.offset.y}return this.updateCenter(),this.isCircle=!1,this.radius=0,this.world.staticTree.insert(this),this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=t,this.width=2*t,this.height=2*t,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(t,e){var i=this.gameObject;void 0===t&&(t=i.x),void 0===e&&(e=i.y),this.world.staticTree.remove(this),i.setPosition(t,e),i.getTopLeft(this.position),this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?s(this,t,e):o(this,t,e)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,s=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor,1),this.isCircle?t.strokeCircle(i,s,this.width/2):t.strokeRect(e.x,e.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(t){return t<=0&&(t=.1),this.mass=t,this},x:{get:function(){return this.position.x},set:function(t){this.world.staticTree.remove(this),this.position.x=t,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(t){this.world.staticTree.remove(this),this.position.y=t,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=h},46346:(t,e,i)=>{var s=i(25084),n=i(56694),r=i(47401),o=i(72632),a=i(59192),h=i(42911),l=new n({Extends:a,initialize:function(t,e,i,n){i||n?h(i)?(n=i,i=null,n.internalCreateCallback=this.createCallbackHandler,n.internalRemoveCallback=this.removeCallbackHandler,n.createMultipleCallback=this.createMultipleCallbackHandler,n.classType=o(n,"classType",s)):Array.isArray(i)&&h(i[0])?(n=i,i=null,n.forEach((function(t){t.internalCreateCallback=this.createCallbackHandler,t.internalRemoveCallback=this.removeCallbackHandler,t.createMultipleCallback=this.createMultipleCallbackHandler,t.classType=o(t,"classType",s)}))):n={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler}:n={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler,createMultipleCallback:this.createMultipleCallbackHandler,classType:s},this.world=t,this.physicsType=r.STATIC_BODY,a.call(this,e,i,n),this.type="StaticPhysicsGroup"},createCallbackHandler:function(t){t.body||this.world.enableBody(t,r.STATIC_BODY)},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},createMultipleCallbackHandler:function(){this.refresh()},refresh:function(){for(var t=this.children.entries,e=0;e{var s=i(94240),n=i(97602),r=i(82897),o=i(56694),a=i(3909),h=i(47401),l=i(53996),u=i(6659),c=i(27037),d=i(88456),p=i(41935),f=i(54726),v=i(75671),g=i(66185),m=i(44662),y=i(10850),x=i(83392),T=i(74623),w=i(25163),b=i(74118),E=i(68687),S=i(27354),A=i(61777),_=i(25299),C=i(58403),R=i(66634),M=i(28808),P=i(69360),O=i(93736),L=i(1071),F=new o({Extends:u,initialize:function(t,e){u.call(this),this.scene=t,this.bodies=new C,this.staticBodies=new C,this.pendingDestroy=new C,this.colliders=new T,this.gravity=new O(y(e,"gravity.x",0),y(e,"gravity.y",0)),this.bounds=new b(y(e,"x",0),y(e,"y",0),y(e,"width",t.sys.scale.width),y(e,"height",t.sys.scale.height)),this.checkCollision={up:y(e,"checkCollision.up",!0),down:y(e,"checkCollision.down",!0),left:y(e,"checkCollision.left",!0),right:y(e,"checkCollision.right",!0)},this.fps=y(e,"fps",60),this.fixedStep=y(e,"fixedStep",!0),this._elapsed=0,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this.stepsLastFrame=0,this.timeScale=y(e,"timeScale",1),this.OVERLAP_BIAS=y(e,"overlapBias",4),this.TILE_BIAS=y(e,"tileBias",16),this.forceX=y(e,"forceX",!1),this.isPaused=y(e,"isPaused",!1),this._total=0,this.drawDebug=y(e,"debug",!1),this.debugGraphic,this.defaults={debugShowBody:y(e,"debugShowBody",!0),debugShowStaticBody:y(e,"debugShowStaticBody",!0),debugShowVelocity:y(e,"debugShowVelocity",!0),bodyDebugColor:y(e,"debugBodyColor",16711935),staticBodyDebugColor:y(e,"debugStaticBodyColor",255),velocityDebugColor:y(e,"debugVelocityColor",65280)},this.maxEntries=y(e,"maxEntries",16),this.useTree=y(e,"useTree",!0),this.tree=new E(this.maxEntries),this.staticTree=new E(this.maxEntries),this.treeMinMax={minX:0,minY:0,maxX:0,maxY:0},this._tempMatrix=new P,this._tempMatrix2=new P,this.tileFilterOptions={isColliding:!0,isNotEmpty:!0,hasInterestingFace:!0},this.drawDebug&&this.createDebugGraphic()},enable:function(t,e){void 0===e&&(e=h.DYNAMIC_BODY),Array.isArray(t)||(t=[t]);for(var i=0;i=r;for(this.fixedStep||(n=.001*e,a=!0,this._elapsed=0),i=0;i=r;)this._elapsed-=r,this.step(n)}},step:function(t){var e,i,s=this.bodies.entries,n=s.length;for(e=0;e0){var l=this.tree,u=this.staticTree;for(s=(i=a.entries).length,t=0;t-1&&c>v&&(t.velocity.normalize().scale(v),c=v),t.speed=c},separate:function(t,e,i,s,n){if(!t.enable||!e.enable||t.checkCollision.none||e.checkCollision.none||!this.intersects(t,e))return!1;if(i&&!1===i.call(s,t.gameObject,e.gameObject))return!1;if(t.isCircle&&e.isCircle)return this.separateCircle(t,e,n);if(t.isCircle!==e.isCircle){var r=t.isCircle?e:t,o=t.isCircle?t:e,a={x:r.x,y:r.y,right:r.right,bottom:r.bottom},h=o.center;if((h.ya.bottom)&&(h.xa.right))return this.separateCircle(t,e,n)}var l=!1,u=!1;n?(l=A(t,e,n,this.OVERLAP_BIAS),u=_(t,e,n,this.OVERLAP_BIAS)):this.forceX||Math.abs(this.gravity.y+t.gravity.y)o.right&&(r=l(a.x,a.y,o.right,o.y)-a.radius):a.y>o.bottom&&(a.xo.right&&(r=l(a.x,a.y,o.right,o.bottom)-a.radius)),r*=-1}else r=t.halfWidth+e.halfWidth-l(t.center.x,t.center.y,e.center.x,e.center.y);if(t.overlapR=r,e.overlapR=r,i||0===r||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==r&&(t.onOverlap||e.onOverlap)&&this.emit(c.OVERLAP,t.gameObject,e.gameObject,t,e),0!==r;var h=t.center.x-e.center.x,u=t.center.y-e.center.y,d=Math.sqrt(Math.pow(h,2)+Math.pow(u,2)),p=(e.center.x-t.center.x)/d||0,f=(e.center.y-t.center.y)/d||0,m=2*(t.velocity.x*p+t.velocity.y*f-e.velocity.x*p-e.velocity.y*f)/(t.mass+e.mass);(t.immovable||e.immovable)&&(m*=2),t.immovable||(t.velocity.x=t.velocity.x-m/t.mass*p,t.velocity.y=t.velocity.y-m/t.mass*f),e.immovable||(e.velocity.x=e.velocity.x+m/e.mass*p,e.velocity.y=e.velocity.y+m/e.mass*f),t.immovable||e.immovable||(r/=2);var y=s(t.center,e.center),T=(r+x.EPSILON)*Math.cos(y),w=(r+x.EPSILON)*Math.sin(y);return t.immovable||(t.x-=T,t.y-=w,t.updateCenter()),e.immovable||(e.x+=T,e.y+=w,e.updateCenter()),t.velocity.x*=t.bounce.x,t.velocity.y*=t.bounce.y,e.velocity.x*=e.bounce.x,e.velocity.y*=e.bounce.y,(t.onCollide||e.onCollide)&&this.emit(c.COLLIDE,t.gameObject,e.gameObject,t,e),!0},intersects:function(t,e){return t!==e&&(t.isCircle||e.isCircle?t.isCircle?e.isCircle?l(t.center.x,t.center.y,e.center.x,e.center.y)<=t.halfWidth+e.halfWidth:this.circleBodyIntersects(t,e):this.circleBodyIntersects(e,t):!(t.right<=e.position.x||t.bottom<=e.position.y||t.position.x>=e.right||t.position.y>=e.bottom))},circleBodyIntersects:function(t,e){var i=r(t.center.x,e.left,e.right),s=r(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-s)*(t.center.y-s)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,s,n){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=i),this.collideObjects(t,e,i,s,n,!0)},collide:function(t,e,i,s,n){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=i),this.collideObjects(t,e,i,s,n,!1)},collideObjects:function(t,e,i,s,n,r){var o,a;!t.isParent||void 0!==t.physicsType&&void 0!==e&&t!==e||(t=t.children.entries),e&&e.isParent&&void 0===e.physicsType&&(e=e.children.entries);var h=Array.isArray(t),l=Array.isArray(e);if(this._total=0,h||l)if(!h&&l)for(o=0;o0},collideHandler:function(t,e,i,s,n,r){if(void 0===e&&t.isParent)return this.collideGroupVsGroup(t,t,i,s,n,r);if(!t||!e)return!1;if(t.body||t.isBody){if(e.body||e.isBody)return this.collideSpriteVsSprite(t,e,i,s,n,r);if(e.isParent)return this.collideSpriteVsGroup(t,e,i,s,n,r);if(e.isTilemap)return this.collideSpriteVsTilemapLayer(t,e,i,s,n,r)}else if(t.isParent){if(e.body||e.isBody)return this.collideSpriteVsGroup(e,t,i,s,n,r);if(e.isParent)return this.collideGroupVsGroup(t,e,i,s,n,r);if(e.isTilemap)return this.collideGroupVsTilemapLayer(t,e,i,s,n,r)}else if(t.isTilemap){if(e.body||e.isBody)return this.collideSpriteVsTilemapLayer(e,t,i,s,n,r);if(e.isParent)return this.collideGroupVsTilemapLayer(e,t,i,s,n,r)}},collideSpriteVsSprite:function(t,e,i,s,n,r){var o=t.isBody?t:t.body,a=e.isBody?e:e.body;return!(!o||!a)&&(this.separate(o,a,s,n,r)&&(i&&i.call(n,t,e),this._total++),!0)},collideSpriteVsGroup:function(t,e,i,s,n,r){var o,a,l,u=t.isBody?t:t.body;if(0!==e.length&&u&&u.enable&&!u.checkCollision.none)if(this.useTree||e.physicsType===h.STATIC_BODY){var c=this.treeMinMax;c.minX=u.left,c.minY=u.top,c.maxX=u.right,c.maxY=u.bottom;var d=e.physicsType===h.DYNAMIC_BODY?this.tree.search(c):this.staticTree.search(c);for(a=d.length,o=0;oc.baseTileWidth){var d=(c.tileWidth-c.baseTileWidth)*e.scaleX;a-=d,l+=d}c.tileHeight>c.baseTileHeight&&(u+=(c.tileHeight-c.baseTileHeight)*e.scaleY);var p=r?null:this.tileFilterOptions,f=m(a,h,l,u,p,e.scene.cameras.main,e.layer);return 0!==f.length&&this.collideSpriteVsTilesHandler(t,f,i,s,n,r,!0)},collideSpriteVsTilesHandler:function(t,e,i,s,n,r,o){for(var a,h,l=t.isBody?t:t.body,u={left:0,right:0,top:0,bottom:0},d=!1,p=0;p{t.exports={setAcceleration:function(t,e){return this.body.acceleration.set(t,e),this},setAccelerationX:function(t){return this.body.acceleration.x=t,this},setAccelerationY:function(t){return this.body.acceleration.y=t,this}}},29257:t=>{t.exports={setAngularVelocity:function(t){return this.body.angularVelocity=t,this},setAngularAcceleration:function(t){return this.body.angularAcceleration=t,this},setAngularDrag:function(t){return this.body.angularDrag=t,this}}},62122:t=>{t.exports={setBounce:function(t,e){return this.body.bounce.set(t,e),this},setBounceX:function(t){return this.body.bounce.x=t,this},setBounceY:function(t){return this.body.bounce.y=t,this},setCollideWorldBounds:function(t,e,i,s){return this.body.setCollideWorldBounds(t,e,i,s),this}}},99803:t=>{t.exports={setDebug:function(t,e,i){return this.debugShowBody=t,this.debugShowVelocity=e,this.debugBodyColor=i,this},setDebugBodyColor:function(t){return this.body.debugBodyColor=t,this},debugShowBody:{get:function(){return this.body.debugShowBody},set:function(t){this.body.debugShowBody=t}},debugShowVelocity:{get:function(){return this.body.debugShowVelocity},set:function(t){this.body.debugShowVelocity=t}},debugBodyColor:{get:function(){return this.body.debugBodyColor},set:function(t){this.body.debugBodyColor=t}}}},87145:t=>{t.exports={setDrag:function(t,e){return this.body.drag.set(t,e),this},setDragX:function(t){return this.body.drag.x=t,this},setDragY:function(t){return this.body.drag.y=t,this},setDamping:function(t){return this.body.useDamping=t,this}}},96174:t=>{var e={enableBody:function(t,e,i,s,n){return t&&this.body.reset(e,i),s&&(this.body.gameObject.active=!0),n&&(this.body.gameObject.visible=!0),this.body.enable=!0,this},disableBody:function(t,e){return void 0===t&&(t=!1),void 0===e&&(e=!1),this.body.stop(),this.body.enable=!1,t&&(this.body.gameObject.active=!1),e&&(this.body.gameObject.visible=!1),this},refreshBody:function(){return this.body.updateFromGameObject(),this}};t.exports=e},51702:t=>{t.exports={setFriction:function(t,e){return this.body.friction.set(t,e),this},setFrictionX:function(t){return this.body.friction.x=t,this},setFrictionY:function(t){return this.body.friction.y=t,this}}},25578:t=>{t.exports={setGravity:function(t,e){return this.body.gravity.set(t,e),this},setGravityX:function(t){return this.body.gravity.x=t,this},setGravityY:function(t){return this.body.gravity.y=t,this}}},72029:t=>{var e={setImmovable:function(t){return void 0===t&&(t=!0),this.body.immovable=t,this}};t.exports=e},34566:t=>{t.exports={setMass:function(t){return this.body.mass=t,this}}},2732:(t,e,i)=>{var s=i(15147),n=i(26673),r=i(22184),o=i(26535);t.exports=function(t,e,i,a,h,l){var u=s(t,e-a,i-a,2*a,2*a,h,l);if(0===u.length)return u;for(var c=new n(e,i,a),d=new n,p=[],f=0;f{t.exports=function(t,e,i,s,n,r,o){void 0===r&&(r=!0),void 0===o&&(o=!1);var a=[],h=[],l=t.treeMinMax;if(l.minX=e,l.minY=i,l.maxX=e+s,l.maxY=i+n,o&&(h=t.staticTree.search(l)),r&&t.useTree)a=t.tree.search(l);else if(r){var u=t.bodies,c={position:{x:e,y:i},left:e,top:i,right:e+s,bottom:i+n,isCircle:!1},d=t.intersects;u.iterate((function(t){d(t,c)&&a.push(t)}))}return h.concat(a)}},57527:t=>{var e={setPushable:function(t){return void 0===t&&(t=!0),this.body.pushable=t,this}};t.exports=e},77687:t=>{t.exports={setOffset:function(t,e){return this.body.setOffset(t,e),this},setSize:function(t,e,i){return this.body.setSize(t,e,i),this},setBodySize:function(t,e,i){return this.body.setSize(t,e,i),this},setCircle:function(t,e,i){return this.body.setCircle(t,e,i),this}}},66536:t=>{t.exports={setVelocity:function(t,e){return this.body.setVelocity(t,e),this},setVelocityX:function(t){return this.body.setVelocityX(t),this},setVelocityY:function(t){return this.body.setVelocityY(t),this},setMaxVelocity:function(t,e){return this.body.maxVelocity.set(t,e),this}}},7864:(t,e,i)=>{t.exports={Acceleration:i(5321),Angular:i(29257),Bounce:i(62122),Debug:i(99803),Drag:i(87145),Enable:i(96174),Friction:i(51702),Gravity:i(25578),Immovable:i(72029),Mass:i(34566),OverlapCirc:i(2732),OverlapRect:i(15147),Pushable:i(57527),Size:i(77687),Velocity:i(66536)}},47401:t=>{t.exports={DYNAMIC_BODY:0,STATIC_BODY:1,GROUP:2,TILEMAPLAYER:3,FACING_NONE:10,FACING_UP:11,FACING_DOWN:12,FACING_LEFT:13,FACING_RIGHT:14}},22346:t=>{t.exports="collide"},95092:t=>{t.exports="overlap"},15775:t=>{t.exports="pause"},74142:t=>{t.exports="resume"},22825:t=>{t.exports="tilecollide"},10851:t=>{t.exports="tileoverlap"},7543:t=>{t.exports="worldbounds"},1487:t=>{t.exports="worldstep"},27037:(t,e,i)=>{t.exports={COLLIDE:i(22346),OVERLAP:i(95092),PAUSE:i(15775),RESUME:i(74142),TILE_COLLIDE:i(22825),TILE_OVERLAP:i(10851),WORLD_BOUNDS:i(7543),WORLD_STEP:i(1487)}},39977:(t,e,i)=>{var s=i(47401),n=i(98611),r={ArcadePhysics:i(66150),Body:i(97602),Collider:i(3909),Components:i(7864),Events:i(27037),Factory:i(99523),GetOverlapX:i(75671),GetOverlapY:i(66185),SeparateX:i(61777),SeparateY:i(25299),Group:i(10481),Image:i(62832),Sprite:i(25084),StaticBody:i(66634),StaticGroup:i(46346),Tilemap:i(8413),World:i(85233)};r=n(!1,r,s),t.exports=r},25163:t=>{t.exports=function(t,e){return t.collisionCallback?!t.collisionCallback.call(t.collisionCallbackContext,e,t):!t.layer.callbacks[t.index]||!t.layer.callbacks[t.index].callback.call(t.layer.callbacks[t.index].callbackContext,e,t)}},98209:t=>{t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.left=!0):e>0&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=e,t.updateCenter(),0===t.bounce.x?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x}},72792:t=>{t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):e>0&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=e,t.updateCenter(),0===t.bounce.y?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y}},27354:(t,e,i)=>{var s=i(14405),n=i(52926),r=i(28808);t.exports=function(t,e,i,o,a,h,l){var u=o.left,c=o.top,d=o.right,p=o.bottom,f=i.faceLeft||i.faceRight,v=i.faceTop||i.faceBottom;if(l||(f=!0,v=!0),!f&&!v)return!1;var g=0,m=0,y=0,x=1;if(e.deltaAbsX()>e.deltaAbsY()?y=-1:e.deltaAbsX(){var s=i(98209);t.exports=function(t,e,i,n,r,o){var a=0,h=e.faceLeft,l=e.faceRight,u=e.collideLeft,c=e.collideRight;return o||(h=!0,l=!0,u=!0,c=!0),t.deltaX()<0&&c&&t.checkCollision.left?l&&t.x0&&u&&t.checkCollision.right&&h&&t.right>i&&(a=t.right-i)>r&&(a=0),0!==a&&(t.customSeparateX?t.overlapX=a:s(t,a)),a}},52926:(t,e,i)=>{var s=i(72792);t.exports=function(t,e,i,n,r,o){var a=0,h=e.faceTop,l=e.faceBottom,u=e.collideUp,c=e.collideDown;return o||(h=!0,l=!0,u=!0,c=!0),t.deltaY()<0&&c&&t.checkCollision.up?l&&t.y0&&u&&t.checkCollision.down&&h&&t.bottom>i&&(a=t.bottom-i)>r&&(a=0),0!==a&&(t.customSeparateY?t.overlapY=a:s(t,a)),a}},28808:t=>{t.exports=function(t,e){return!(e.right<=t.left||e.bottom<=t.top||e.position.x>=t.right||e.position.y>=t.bottom)}},8413:(t,e,i)=>{var s={ProcessTileCallbacks:i(25163),ProcessTileSeparationX:i(98209),ProcessTileSeparationY:i(72792),SeparateTile:i(27354),TileCheckX:i(14405),TileCheckY:i(52926),TileIntersectsBody:i(28808)};t.exports=s},53954:(t,e,i)=>{t.exports={Arcade:i(39977),Matter:i(45949)}},63568:(t,e,i)=>{var s=i(56694),n=i(93736),r=new s({initialize:function(){this.boundsCenter=new n,this.centerDiff=new n},parseBody:function(t){if(!(t=t.hasOwnProperty("body")?t.body:t).hasOwnProperty("bounds")||!t.hasOwnProperty("centerOfMass"))return!1;var e=this.boundsCenter,i=this.centerDiff,s=t.bounds.max.x-t.bounds.min.x,n=t.bounds.max.y-t.bounds.min.y,r=s*t.centerOfMass.x,o=n*t.centerOfMass.y;return e.set(s/2,n/2),i.set(r-e.x,o-e.y),!0},getTopLeft:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e+s.x+r.x,i+s.y+r.y)}return!1},getTopCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e+r.x,i+s.y+r.y)}return!1},getTopRight:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e-(s.x-r.x),i+s.y+r.y)}return!1},getLeftCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e+s.x+r.x,i+r.y)}return!1},getCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.centerDiff;return new n(e+s.x,i+s.y)}return!1},getRightCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e-(s.x-r.x),i+r.y)}return!1},getBottomLeft:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e+s.x+r.x,i-(s.y-r.y))}return!1},getBottomCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e+r.x,i-(s.y-r.y))}return!1},getBottomRight:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e-(s.x-r.x),i-(s.y-r.y))}return!1}});t.exports=r},18171:(t,e,i)=>{var s=i(16929);s.Body=i(84125),s.Composite=i(11299),s.World=i(72005),s.Collision=i(63454),s.Detector=i(13657),s.Pairs=i(91327),s.Pair=i(70584),s.Query=i(13390),s.Resolver=i(44272),s.Constraint=i(52838),s.Common=i(68758),s.Engine=i(45775),s.Events=i(39073),s.Sleeping=i(22806),s.Plugin=i(84474),s.Bodies=i(68516),s.Composites=i(56643),s.Axes=i(50658),s.Bounds=i(84091),s.Svg=i(92765),s.Vector=i(10438),s.Vertices=i(39745),s.World.add=s.Composite.add,s.World.remove=s.Composite.remove,s.World.addComposite=s.Composite.addComposite,s.World.addBody=s.Composite.addBody,s.World.addConstraint=s.Composite.addConstraint,s.World.clear=s.Composite.clear,t.exports=s},72653:(t,e,i)=>{var s=i(68516),n=i(56694),r=i(56643),o=i(52838),a=i(92765),h=i(3860),l=i(7030),u=i(73658),c=i(84720),d=i(10998),p=i(72829),f=i(88596),v=i(39745),g=new n({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},rectangle:function(t,e,i,n,r){var o=s.rectangle(t,e,i,n,r);return this.world.add(o),o},trapezoid:function(t,e,i,n,r,o){var a=s.trapezoid(t,e,i,n,r,o);return this.world.add(a),a},circle:function(t,e,i,n,r){var o=s.circle(t,e,i,n,r);return this.world.add(o),o},polygon:function(t,e,i,n,r){var o=s.polygon(t,e,i,n,r);return this.world.add(o),o},fromVertices:function(t,e,i,n,r,o,a){"string"==typeof i&&(i=v.fromPath(i));var h=s.fromVertices(t,e,i,n,r,o,a);return this.world.add(h),h},fromPhysicsEditor:function(t,e,i,s,n){void 0===n&&(n=!0);var r=d.parseBody(t,e,i,s);return n&&!this.world.has(r)&&this.world.add(r),r},fromSVG:function(t,e,i,n,r,o){void 0===n&&(n=1),void 0===r&&(r={}),void 0===o&&(o=!0);for(var h=i.getElementsByTagName("path"),l=[],u=0;u{var s=i(74527),n=i(72632),r=i(93736);t.exports=function(t,e,i,o){void 0===i&&(i={}),void 0===o&&(o=!0);var a=e.x,h=e.y;if(e.body={temp:!0,position:{x:a,y:h}},[s.Bounce,s.Collision,s.Force,s.Friction,s.Gravity,s.Mass,s.Sensor,s.SetBody,s.Sleep,s.Static,s.Transform,s.Velocity].forEach((function(t){for(var i in t)(s=t[i]).get&&"function"==typeof s.get||s.set&&"function"==typeof s.set?Object.defineProperty(e,i,{get:t[i].get,set:t[i].set}):Object.defineProperty(e,i,{value:t[i]});var s})),e.world=t,e._tempVec2=new r(a,h),i.hasOwnProperty("type")&&"body"===i.type)e.setExistingBody(i,o);else{var l=n(i,"shape",null);l||(l="rectangle"),i.addToWorld=o,e.setBody(l,i)}return e}},7030:(t,e,i)=>{var s=i(56694),n=i(74527),r=i(89980),o=i(72632),a=i(1539),h=i(58210),l=i(93736),u=new s({Extends:a,Mixins:[n.Bounce,n.Collision,n.Force,n.Friction,n.Gravity,n.Mass,n.Sensor,n.SetBody,n.Sleep,n.Static,n.Transform,n.Velocity,h],initialize:function(t,e,i,s,n,a){r.call(this,t.scene,"Image"),this._crop=this.resetCropObject(),this.setTexture(s,n),this.setSizeToFrame(),this.setOrigin(),this.world=t,this._tempVec2=new l(e,i);var h=o(a,"shape",null);h?this.setBody(h,a):this.setRectangle(this.width,this.height,a),this.setPosition(e,i),this.initPipeline()}});t.exports=u},50583:(t,e,i)=>{var s=i(84093),n=i(50658),r=i(68516),o=i(84125),a=i(63568),h=i(84091),l=i(56694),u=i(63454),c=i(68758),d=i(11299),p=i(56643),f=i(52838),v=i(13657),g=i(53996),m=i(72653),y=i(72632),x=i(10850),T=i(1675),w=i(80391),b=i(16929),E=i(44097),S=i(30657),A=i(70584),_=i(91327),C=i(84474),R=i(91963),M=i(13390),P=i(44272),O=i(7599),L=i(92765),F=i(10438),D=i(39745),k=i(31468);c.setDecomp(i(81084));var I=new l({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,this.bodyBounds,this.body=o,this.composite=d,this.collision=u,this.detector=v,this.pair=A,this.pairs=_,this.query=M,this.resolver=P,this.constraint=f,this.bodies=r,this.composites=p,this.axes=n,this.bounds=h,this.svg=L,this.vector=F,this.vertices=D,this.verts=D,this._tempVec2=F.create(),x(this.config,"plugins.collisionevents",!0)&&this.enableCollisionEventsPlugin(),x(this.config,"plugins.attractors",!1)&&this.enableAttractorPlugin(),x(this.config,"plugins.wrap",!1)&&this.enableWrapPlugin(),P._restingThresh=x(this.config,"restingThresh",4),P._restingThreshTangent=x(this.config,"restingThreshTangent",6),P._positionDampen=x(this.config,"positionDampen",.9),P._positionWarming=x(this.config,"positionWarming",.8),P._frictionNormalMultiplier=x(this.config,"frictionNormalMultiplier",5),t.sys.events.once(O.BOOT,this.boot,this),t.sys.events.on(O.START,this.start,this)},boot:function(){this.world=new k(this.scene,this.config),this.add=new m(this.world),this.bodyBounds=new a,this.systems.events.once(O.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new k(this.scene,this.config),this.add=new m(this.world));var t=this.systems.events;t.on(O.UPDATE,this.world.update,this.world),t.on(O.POST_UPDATE,this.world.postUpdate,this.world),t.once(O.SHUTDOWN,this.shutdown,this)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return S(y(e,"matter",{}),y(t,"matter",{}))},enableAttractorPlugin:function(){return C.register(T),C.use(b,T),this},enableWrapPlugin:function(){return C.register(E),C.use(b,E),this},enableCollisionEventsPlugin:function(){return C.register(w),C.use(b,w),this},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},set60Hz:function(){return this.world.getDelta=this.world.update60Hz,this.world.autoUpdate=!0,this},set30Hz:function(){return this.world.getDelta=this.world.update30Hz,this.world.autoUpdate=!0,this},step:function(t,e){this.world.step(t,e)},containsPoint:function(t,e,i){t=this.getMatterBodies(t);var s=F.create(e,i);return M.point(t,s).length>0},intersectPoint:function(t,e,i){i=this.getMatterBodies(i);var s=F.create(t,e),n=[];return M.point(i,s).forEach((function(t){-1===n.indexOf(t)&&n.push(t)})),n},intersectRect:function(t,e,i,s,n,r){void 0===n&&(n=!1),r=this.getMatterBodies(r);var o={min:{x:t,y:e},max:{x:t+i,y:e+s}},a=[];return M.region(r,o,n).forEach((function(t){-1===a.indexOf(t)&&a.push(t)})),a},intersectRay:function(t,e,i,s,n,r){void 0===n&&(n=1),r=this.getMatterBodies(r);for(var o=[],a=M.ray(r,F.create(t,e),F.create(i,s),n),h=0;h{var s=i(16569),n=i(56694),r=i(74527),o=i(89980),a=i(72632),h=i(58210),l=i(13747),u=i(93736),c=new n({Extends:l,Mixins:[r.Bounce,r.Collision,r.Force,r.Friction,r.Gravity,r.Mass,r.Sensor,r.SetBody,r.Sleep,r.Static,r.Transform,r.Velocity,h],initialize:function(t,e,i,n,r,h){o.call(this,t.scene,"Sprite"),this._crop=this.resetCropObject(),this.anims=new s(this),this.setTexture(n,r),this.setSizeToFrame(),this.setOrigin(),this.world=t,this._tempVec2=new u(e,i);var l=a(h,"shape",null);l?this.setBody(l,h):this.setRectangle(this.width,this.height,h),this.setPosition(e,i),this.initPipeline()}});t.exports=c},84720:(t,e,i)=>{var s=i(68516),n=i(84125),r=i(56694),o=i(74527),a=i(6659),h=i(72632),l=i(19256),u=i(39745),c=new r({Extends:a,Mixins:[o.Bounce,o.Collision,o.Friction,o.Gravity,o.Mass,o.Sensor,o.Sleep,o.Static],initialize:function(t,e,i){a.call(this),this.tile=e,this.world=t,e.physics.matterBody&&e.physics.matterBody.destroy(),e.physics.matterBody=this;var s=h(i,"body",null),n=h(i,"addToWorld",!0);if(s)this.setBody(s,n);else{var r=e.getCollisionGroup();h(r,"objects",[]).length>0?this.setFromTileCollision(i):this.setFromTileRectangle(i)}},setFromTileRectangle:function(t){void 0===t&&(t={}),l(t,"isStatic")||(t.isStatic=!0),l(t,"addToWorld")||(t.addToWorld=!0);var e=this.tile.getBounds(),i=e.x+e.width/2,n=e.y+e.height/2,r=s.rectangle(i,n,e.width,e.height,t);return this.setBody(r,t.addToWorld),this},setFromTileCollision:function(t){void 0===t&&(t={}),l(t,"isStatic")||(t.isStatic=!0),l(t,"addToWorld")||(t.addToWorld=!0);for(var e=this.tile.tilemapLayer.scaleX,i=this.tile.tilemapLayer.scaleY,r=this.tile.getLeft(),o=this.tile.getTop(),a=this.tile.getCollisionGroup(),c=h(a,"objects",[]),d=[],p=0;p1&&(t.parts=d,this.setBody(n.create(t),t.addToWorld)),this},setBody:function(t,e){return void 0===e&&(e=!0),this.body&&this.removeBody(),this.body=t,this.body.gameObject=this,e&&this.world.add(this.body),this},removeBody:function(){return this.body&&(this.world.remove(this.body),this.body.gameObject=void 0,this.body=void 0),this},destroy:function(){this.removeBody(),this.tile.physics.matterBody=void 0,this.removeAllListeners()}});t.exports=c},10998:(t,e,i)=>{var s=i(68516),n=i(84125),r=i(68758),o=i(72632),a=i(39745),h={parseBody:function(t,e,i,s){void 0===s&&(s={});for(var a=o(i,"fixtures",[]),h=[],l=0;l{var s=i(68516),n=i(84125),r={parseBody:function(t,e,i,r){var o;void 0===r&&(r={});var a=i.vertices;if(1===a.length)r.vertices=a[0],o=n.create(r),s.flagCoincidentParts(o.parts);else{for(var h=[],l=0;l{var s=i(84091),n=i(56694),r=i(11299),o=i(52838),a=i(13657),h=i(35416),l=i(33963),u=i(30657),c=i(22806),d=i(93736),p=i(39745),f=new n({initialize:function(t,e,i){void 0===i&&(i={});this.scene=t,this.world=e,this.camera=null,this.pointer=null,this.active=!0,this.position=new d,this.body=null,this.part=null,this.constraint=o.create(u(i,{label:"Pointer Constraint",pointA:{x:0,y:0},pointB:{x:0,y:0},length:.01,stiffness:.1,angularStiffness:1,collisionFilter:{category:1,mask:4294967295,group:0}})),this.world.on(h.BEFORE_UPDATE,this.update,this),t.sys.input.on(l.POINTER_DOWN,this.onDown,this),t.sys.input.on(l.POINTER_UP,this.onUp,this)},onDown:function(t){this.pointer||(this.pointer=t,this.camera=t.camera)},onUp:function(t){t===this.pointer&&(this.pointer=null)},getBody:function(t){var e=this.position,i=this.constraint;this.camera.getWorldPoint(t.x,t.y,e);for(var n=r.allBodies(this.world.localWorld),o=0;o1?1:0;n{var s=i(68516),n=i(84125),r=i(56694),o=i(68758),a=i(11299),h=i(45775),l=i(6659),u=i(35416),c=i(72632),d=i(10850),p=i(84125),f=i(39073),v=i(84720),g=i(72005),m=i(10438),y=new r({Extends:l,initialize:function(t,e){l.call(this),this.scene=t,this.engine=h.create(e),this.localWorld=this.engine.world;var i=d(e,"gravity",null);i?this.setGravity(i.x,i.y,i.scale):!1===i&&this.setGravity(0,0,0),this.walls={left:null,right:null,top:null,bottom:null},this.enabled=d(e,"enabled",!0),this.correction=d(e,"correction",1),this.getDelta=d(e,"getDelta",this.update60Hz);var s=c(e,"runner",{}),n=c(s,"fps",!1),r=c(s,"fps",60),o=c(s,"delta",1e3/r),a=c(s,"deltaMin",1e3/r),u=c(s,"deltaMax",1e3/(.5*r));n||(r=1e3/o),this.runner={fps:r,correction:c(s,"correction",1),deltaSampleSize:c(s,"deltaSampleSize",60),counterTimestamp:0,frameCounter:0,deltaHistory:[],timePrev:null,timeScalePrev:1,frameRequestId:null,isFixed:c(s,"isFixed",!1),delta:o,deltaMin:a,deltaMax:u},this.autoUpdate=d(e,"autoUpdate",!0);var p=d(e,"debug",!1);if(this.drawDebug="object"==typeof p||p,this.debugGraphic,this.debugConfig={showAxes:c(p,"showAxes",!1),showAngleIndicator:c(p,"showAngleIndicator",!1),angleColor:c(p,"angleColor",15208787),showBroadphase:c(p,"showBroadphase",!1),broadphaseColor:c(p,"broadphaseColor",16757760),showBounds:c(p,"showBounds",!1),boundsColor:c(p,"boundsColor",16777215),showVelocity:c(p,"showVelocity",!1),velocityColor:c(p,"velocityColor",44783),showCollisions:c(p,"showCollisions",!1),collisionColor:c(p,"collisionColor",16094476),showSeparations:c(p,"showSeparations",!1),separationColor:c(p,"separationColor",16753920),showBody:c(p,"showBody",!0),showStaticBody:c(p,"showStaticBody",!0),showInternalEdges:c(p,"showInternalEdges",!1),renderFill:c(p,"renderFill",!1),renderLine:c(p,"renderLine",!0),fillColor:c(p,"fillColor",1075465),fillOpacity:c(p,"fillOpacity",1),lineColor:c(p,"lineColor",2678297),lineOpacity:c(p,"lineOpacity",1),lineThickness:c(p,"lineThickness",1),staticFillColor:c(p,"staticFillColor",857979),staticLineColor:c(p,"staticLineColor",1255396),showSleeping:c(p,"showSleeping",!1),staticBodySleepOpacity:c(p,"staticBodySleepOpacity",.7),sleepFillColor:c(p,"sleepFillColor",4605510),sleepLineColor:c(p,"sleepLineColor",10066585),showSensors:c(p,"showSensors",!0),sensorFillColor:c(p,"sensorFillColor",857979),sensorLineColor:c(p,"sensorLineColor",1255396),showPositions:c(p,"showPositions",!0),positionSize:c(p,"positionSize",4),positionColor:c(p,"positionColor",14697178),showJoint:c(p,"showJoint",!0),jointColor:c(p,"jointColor",14737474),jointLineOpacity:c(p,"jointLineOpacity",1),jointLineThickness:c(p,"jointLineThickness",2),pinSize:c(p,"pinSize",4),pinColor:c(p,"pinColor",4382944),springColor:c(p,"springColor",14697184),anchorColor:c(p,"anchorColor",15724527),anchorSize:c(p,"anchorSize",4),showConvexHulls:c(p,"showConvexHulls",!1),hullColor:c(p,"hullColor",14091216)},this.drawDebug&&this.createDebugGraphic(),this.setEventsProxy(),c(e,"setBounds",!1)){var f=e.setBounds;if("boolean"==typeof f)this.setBounds();else{var v=c(f,"x",0),g=c(f,"y",0),m=c(f,"width",t.sys.scale.width),y=c(f,"height",t.sys.scale.height),x=c(f,"thickness",64),T=c(f,"left",!0),w=c(f,"right",!0),b=c(f,"top",!0),E=c(f,"bottom",!0);this.setBounds(v,g,m,y,x,T,w,b,E)}}},setCompositeRenderStyle:function(t){var e,i,s,n=t.bodies,r=t.constraints,o=t.composites;for(e=0;e0&&(i=n[0].bodyA,s=n[0].bodyB),t.emit(u.COLLISION_START,e,i,s)})),f.on(e,"collisionActive",(function(e){var i,s,n=e.pairs;n.length>0&&(i=n[0].bodyA,s=n[0].bodyB),t.emit(u.COLLISION_ACTIVE,e,i,s)})),f.on(e,"collisionEnd",(function(e){var i,s,n=e.pairs;n.length>0&&(i=n[0].bodyA,s=n[0].bodyB),t.emit(u.COLLISION_END,e,i,s)}))},setBounds:function(t,e,i,s,n,r,o,a,h){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===s&&(s=this.scene.sys.scale.height),void 0===n&&(n=64),void 0===r&&(r=!0),void 0===o&&(o=!0),void 0===a&&(a=!0),void 0===h&&(h=!0),this.updateWall(r,"left",t-n,e-n,n,s+2*n),this.updateWall(o,"right",t+i,e-n,n,s+2*n),this.updateWall(a,"top",t,e-n,i,n),this.updateWall(h,"bottom",t,e+s,i,n),this},updateWall:function(t,e,i,s,n,r){var o=this.walls[e];t?(o&&g.remove(this.localWorld,o),i+=n/2,s+=r/2,this.walls[e]=this.create(i,s,n,r,{isStatic:!0,friction:0,frictionStatic:0})):(o&&g.remove(this.localWorld,o),this.walls[e]=null)},createDebugGraphic:function(){var t=this.scene.sys.add.graphics({x:0,y:0});return t.setDepth(Number.MAX_VALUE),this.debugGraphic=t,this.drawDebug=!0,t},disableGravity:function(){return this.localWorld.gravity.x=0,this.localWorld.gravity.y=0,this.localWorld.gravity.scale=0,this},setGravity:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=1),this.localWorld.gravity.x=t,this.localWorld.gravity.y=e,void 0!==i&&(this.localWorld.gravity.scale=i),this},create:function(t,e,i,n,r){var o=s.rectangle(t,e,i,n,r);return g.add(this.localWorld,o),o},add:function(t){return g.add(this.localWorld,t),this},remove:function(t,e){Array.isArray(t)||(t=[t]);for(var i=0;is.deltaMax?s.deltaMax:e)/s.delta,s.delta=e),0!==s.timeScalePrev&&(r*=n.timeScale/s.timeScalePrev),0===n.timeScale&&(r=0),s.timeScalePrev=n.timeScale,s.correction=r,s.frameCounter+=1,t-s.counterTimestamp>=1e3&&(s.fps=s.frameCounter*((t-s.counterTimestamp)/1e3),s.counterTimestamp=t,s.frameCounter=0),h.update(i,e,r)}},step:function(t,e){h.update(this.engine,t,e)},update60Hz:function(){return 1e3/60},update30Hz:function(){return 1e3/30},has:function(t){var e=t.hasOwnProperty("body")?t.body:t;return null!==a.get(this.localWorld,e.id,e.type)},getAllBodies:function(){return a.allBodies(this.localWorld)},getAllConstraints:function(){return a.allConstraints(this.localWorld)},getAllComposites:function(){return a.allComposites(this.localWorld)},postUpdate:function(){if(this.drawDebug){var t=this.debugConfig,e=this.engine,i=this.debugGraphic,s=a.allBodies(this.localWorld);this.debugGraphic.clear(),t.showBroadphase&&e.broadphase.controller&&this.renderGrid(e.broadphase,i,t.broadphaseColor,.5),t.showBounds&&this.renderBodyBounds(s,i,t.boundsColor,.5),(t.showBody||t.showStaticBody)&&this.renderBodies(s),t.showJoint&&this.renderJoints(),(t.showAxes||t.showAngleIndicator)&&this.renderBodyAxes(s,i,t.showAxes,t.angleColor,.5),t.showVelocity&&this.renderBodyVelocity(s,i,t.velocityColor,1,2),t.showSeparations&&this.renderSeparations(e.pairs.list,i,t.separationColor),t.showCollisions&&this.renderCollisions(e.pairs.list,i,t.collisionColor)}},renderGrid:function(t,e,i,s){e.lineStyle(1,i,s);for(var n=o.keys(t.buckets),r=0;r0){var l=h[0].vertex.x,u=h[0].vertex.y;2===h.length&&(l=(h[0].vertex.x+h[1].vertex.x)/2,u=(h[0].vertex.y+h[1].vertex.y)/2),a.bodyB===a.supports[0].body||a.bodyA.isStatic?e.lineBetween(l-8*a.normal.x,u-8*a.normal.y,l,u):e.lineBetween(l+8*a.normal.x,u+8*a.normal.y,l,u)}}return this},renderBodyBounds:function(t,e,i,s){e.lineStyle(1,i,s);for(var n=0;n1?1:0;h1?1:0;a1?1:0;a1&&this.renderConvexHull(v,e,p,y)}}},renderBody:function(t,e,i,s,n,r,o,a){void 0===s&&(s=null),void 0===n&&(n=null),void 0===r&&(r=1),void 0===o&&(o=null),void 0===a&&(a=null);for(var h=this.debugConfig,l=h.sensorFillColor,u=h.sensorLineColor,c=t.parts,d=c.length,p=d>1?1:0;p1){var n=t.vertices;e.lineStyle(s,i),e.beginPath(),e.moveTo(n[0].x,n[0].y);for(var r=1;r0&&(e.fillStyle(a),e.fillCircle(u.x,u.y,h),e.fillCircle(c.x,c.y,h)),this},resetCollisionIDs:function(){return n._nextCollidingGroupId=1,n._nextNonCollidingGroupId=-1,n._nextCategory=1,this},shutdown:function(){f.off(this.engine),this.removeAllListeners(),g.clear(this.localWorld,!1),h.clear(this.engine),this.drawDebug&&this.debugGraphic.destroy()},destroy:function(){this.shutdown()}});t.exports=y},95349:t=>{t.exports={setBounce:function(t){return this.body.restitution=t,this}}},70679:t=>{var e={setCollisionCategory:function(t){return this.body.collisionFilter.category=t,this},setCollisionGroup:function(t){return this.body.collisionFilter.group=t,this},setCollidesWith:function(t){var e=0;if(Array.isArray(t))for(var i=0;i{var s=i(84125),n={applyForce:function(t){return this._tempVec2.set(this.body.position.x,this.body.position.y),s.applyForce(this.body,this._tempVec2,t),this},applyForceFrom:function(t,e){return s.applyForce(this.body,t,e),this},thrust:function(t){var e=this.body.angle;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),s.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustLeft:function(t){var e=this.body.angle-Math.PI/2;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),s.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustRight:function(t){var e=this.body.angle+Math.PI/2;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),s.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustBack:function(t){var e=this.body.angle-Math.PI;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),s.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this}};t.exports=n},74015:t=>{var e={setFriction:function(t,e,i){return this.body.friction=t,void 0!==e&&(this.body.frictionAir=e),void 0!==i&&(this.body.frictionStatic=i),this},setFrictionAir:function(t){return this.body.frictionAir=t,this},setFrictionStatic:function(t){return this.body.frictionStatic=t,this}};t.exports=e},11535:t=>{t.exports={setIgnoreGravity:function(t){return this.body.ignoreGravity=t,this}}},74497:(t,e,i)=>{var s=i(84125),n=i(93736),r={setMass:function(t){return s.setMass(this.body,t),this},setDensity:function(t){return s.setDensity(this.body,t),this},centerOfMass:{get:function(){return new n(this.body.centerOfMass.x,this.body.centerOfMass.y)}}};t.exports=r},75529:t=>{t.exports={setSensor:function(t){return this.body.isSensor=t,this},isSensor:function(){return this.body.isSensor}}},64024:(t,e,i)=>{var s=i(68516),n=i(84125),r=i(88456),o=i(72632),a=i(10998),h=i(72829),l=i(39745),u={setRectangle:function(t,e,i){return this.setBody({type:"rectangle",width:t,height:e},i)},setCircle:function(t,e){return this.setBody({type:"circle",radius:t},e)},setPolygon:function(t,e,i){return this.setBody({type:"polygon",sides:e,radius:t},i)},setTrapezoid:function(t,e,i,s){return this.setBody({type:"trapezoid",width:t,height:e,slope:i},s)},setExistingBody:function(t,e){void 0===e&&(e=!0),this.body&&this.world.remove(this.body,!0),this.body=t;for(var i=0;i{var s=i(35416),n=i(22806),r=i(39073),o={setToSleep:function(){return n.set(this.body,!0),this},setAwake:function(){return n.set(this.body,!1),this},setSleepThreshold:function(t){return void 0===t&&(t=60),this.body.sleepThreshold=t,this},setSleepEvents:function(t,e){return this.setSleepStartEvent(t),this.setSleepEndEvent(e),this},setSleepStartEvent:function(t){if(t){var e=this.world;r.on(this.body,"sleepStart",(function(t){e.emit(s.SLEEP_START,t,this)}))}else r.off(this.body,"sleepStart");return this},setSleepEndEvent:function(t){if(t){var e=this.world;r.on(this.body,"sleepEnd",(function(t){e.emit(s.SLEEP_END,t,this)}))}else r.off(this.body,"sleepEnd");return this}};t.exports=o},82884:(t,e,i)=>{var s=i(84125),n={setStatic:function(t){return s.setStatic(this.body,t),this},isStatic:function(){return this.body.isStatic}};t.exports=n},4753:(t,e,i)=>{var s=i(84125),n=i(83392),r=i(35786),o=i(62138),a={x:{get:function(){return this.body.position.x},set:function(t){this._tempVec2.set(t,this.y),s.setPosition(this.body,this._tempVec2)}},y:{get:function(){return this.body.position.y},set:function(t){this._tempVec2.set(this.x,t),s.setPosition(this.body,this._tempVec2)}},scaleX:{get:function(){return this._scaleX},set:function(t){var e=1/this._scaleX,i=1/this._scaleY;this._scaleX=t,0===this._scaleX?this.renderFlags&=-5:this.renderFlags|=4,s.scale(this.body,e,i),s.scale(this.body,t,this._scaleY)}},scaleY:{get:function(){return this._scaleY},set:function(t){var e=1/this._scaleX,i=1/this._scaleY;this._scaleY=t,0===this._scaleY?this.renderFlags&=-5:this.renderFlags|=4,s.scale(this.body,e,i),s.scale(this.body,this._scaleX,t)}},angle:{get:function(){return o(this.body.angle*n.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*n.DEG_TO_RAD}},rotation:{get:function(){return this.body.angle},set:function(t){this._rotation=r(t),s.setAngle(this.body,this._rotation)}},setPosition:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this._tempVec2.set(t,e),s.setPosition(this.body,this._tempVec2),this},setRotation:function(t){return void 0===t&&(t=0),this._rotation=r(t),s.setAngle(this.body,t),this},setFixedRotation:function(){return s.setInertia(this.body,1/0),this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,s.setAngle(this.body,this.rotation),this},setScale:function(t,e,i){void 0===t&&(t=1),void 0===e&&(e=t);var n=1/this._scaleX,r=1/this._scaleY;return this._scaleX=t,this._scaleY=e,s.scale(this.body,n,r,i),s.scale(this.body,t,e,i),this}};t.exports=a},37268:(t,e,i)=>{var s=i(84125),n={setAngularVelocity:function(t){return s.setAngularVelocity(this.body,t),this},setVelocityX:function(t){return this._tempVec2.set(t,this.body.velocity.y),s.setVelocity(this.body,this._tempVec2),this},setVelocityY:function(t){return this._tempVec2.set(this.body.velocity.x,t),s.setVelocity(this.body,this._tempVec2),this},setVelocity:function(t,e){return this._tempVec2.set(t,e),s.setVelocity(this.body,this._tempVec2),this}};t.exports=n},74527:(t,e,i)=>{t.exports={Bounce:i(95349),Collision:i(70679),Force:i(77178),Friction:i(74015),Gravity:i(11535),Mass:i(74497),Sensor:i(75529),SetBody:i(64024),Sleep:i(25106),Static:i(82884),Transform:i(4753),Velocity:i(37268)}},63201:t=>{t.exports="afteradd"},30474:t=>{t.exports="afterremove"},44822:t=>{t.exports="afterupdate"},88820:t=>{t.exports="beforeadd"},94849:t=>{t.exports="beforeremove"},6391:t=>{t.exports="beforeupdate"},96738:t=>{t.exports="collisionactive"},7916:t=>{t.exports="collisionend"},59529:t=>{t.exports="collisionstart"},10219:t=>{t.exports="dragend"},183:t=>{t.exports="drag"},39143:t=>{t.exports="dragstart"},16483:t=>{t.exports="pause"},35806:t=>{t.exports="resume"},22106:t=>{t.exports="sleepend"},5803:t=>{t.exports="sleepstart"},35416:(t,e,i)=>{t.exports={AFTER_ADD:i(63201),AFTER_REMOVE:i(30474),AFTER_UPDATE:i(44822),BEFORE_ADD:i(88820),BEFORE_REMOVE:i(94849),BEFORE_UPDATE:i(6391),COLLISION_ACTIVE:i(96738),COLLISION_END:i(7916),COLLISION_START:i(59529),DRAG_END:i(10219),DRAG:i(183),DRAG_START:i(39143),PAUSE:i(16483),RESUME:i(35806),SLEEP_END:i(22106),SLEEP_START:i(5803)}},45949:(t,e,i)=>{t.exports={BodyBounds:i(63568),Components:i(74527),Events:i(35416),Factory:i(72653),MatterGameObject:i(3860),Image:i(7030),Matter:i(18171),MatterPhysics:i(50583),PolyDecomp:i(81084),Sprite:i(73658),TileBody:i(84720),PhysicsEditorParser:i(10998),PhysicsJSONParser:i(72829),PointerConstraint:i(88596),World:i(31468)}},84125:(t,e,i)=>{var s={};t.exports=s;var n=i(39745),r=i(10438),o=i(22806),a=i(68758),h=i(84091),l=i(50658);!function(){s._inertiaScale=4,s._nextCollidingGroupId=1,s._nextNonCollidingGroupId=-1,s._nextCategory=1,s.create=function(e){var i={id:a.nextId(),type:"body",label:"Body",parts:[],plugin:{},angle:0,vertices:null,position:{x:0,y:0},force:{x:0,y:0},torque:0,positionImpulse:{x:0,y:0},constraintImpulse:{x:0,y:0,angle:0},totalContacts:0,speed:0,angularSpeed:0,velocity:{x:0,y:0},angularVelocity:0,isSensor:!1,isStatic:!1,isSleeping:!1,motion:0,sleepThreshold:60,density:.001,restitution:0,friction:.1,frictionStatic:.5,frictionAir:.01,collisionFilter:{category:1,mask:4294967295,group:0},slop:.05,timeScale:1,events:null,bounds:null,chamfer:null,circleRadius:0,positionPrev:null,anglePrev:0,parent:null,axes:null,area:0,mass:0,inverseMass:0,inertia:0,inverseInertia:0,_original:null,render:{visible:!0,opacity:1,sprite:{xOffset:0,yOffset:0},fillColor:null,fillOpacity:null,lineColor:null,lineOpacity:null,lineThickness:null},gameObject:null,scale:{x:1,y:1},centerOfMass:{x:0,y:0},centerOffset:{x:0,y:0},gravityScale:{x:1,y:1},ignoreGravity:!1,ignorePointer:!1,onCollideCallback:null,onCollideEndCallback:null,onCollideActiveCallback:null,onCollideWith:{}};!e.hasOwnProperty("position")&&e.hasOwnProperty("vertices")?e.position=n.centre(e.vertices):e.hasOwnProperty("vertices")||(i.vertices=n.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"));var s=a.extend(i,e);return t(s,e),s.setOnCollideWith=function(t,e){return e?this.onCollideWith[t.id]=e:delete this.onCollideWith[t.id],this},s},s.nextGroup=function(t){return t?s._nextNonCollidingGroupId--:s._nextCollidingGroupId++},s.nextCategory=function(){return s._nextCategory=s._nextCategory<<1,s._nextCategory};var t=function(t,e){e=e||{},s.set(t,{bounds:t.bounds||h.create(t.vertices),positionPrev:t.positionPrev||r.clone(t.position),anglePrev:t.anglePrev||t.angle,vertices:t.vertices,parts:t.parts||[t],isStatic:t.isStatic,isSleeping:t.isSleeping,parent:t.parent||t});var i=t.bounds;if(n.rotate(t.vertices,t.angle,t.position),l.rotate(t.axes,t.angle),h.update(i,t.vertices,t.velocity),s.set(t,{axes:e.axes||t.axes,area:e.area||t.area,mass:e.mass||t.mass,inertia:e.inertia||t.inertia}),1===t.parts.length){var o=t.centerOfMass,a=t.centerOffset,u=i.max.x-i.min.x,c=i.max.y-i.min.y;o.x=-(i.min.x-t.position.x)/u,o.y=-(i.min.y-t.position.y)/c,a.x=u*o.x,a.y=c*o.y}};s.set=function(t,e,i){var n;for(n in"string"==typeof e&&(n=e,(e={})[n]=i),e)if(Object.prototype.hasOwnProperty.call(e,n))switch(i=e[n],n){case"isStatic":s.setStatic(t,i);break;case"isSleeping":o.set(t,i);break;case"mass":s.setMass(t,i);break;case"density":s.setDensity(t,i);break;case"inertia":s.setInertia(t,i);break;case"vertices":s.setVertices(t,i);break;case"position":s.setPosition(t,i);break;case"angle":s.setAngle(t,i);break;case"velocity":s.setVelocity(t,i);break;case"angularVelocity":s.setAngularVelocity(t,i);break;case"parts":s.setParts(t,i);break;case"centre":s.setCentre(t,i);break;default:t[n]=i}},s.setStatic=function(t,e){for(var i=0;i0&&r.rotateAbout(o.position,i,t.position,o.position)}},s.setVelocity=function(t,e){t.positionPrev.x=t.position.x-e.x,t.positionPrev.y=t.position.y-e.y,t.velocity.x=e.x,t.velocity.y=e.y,t.speed=r.magnitude(t.velocity)},s.setAngularVelocity=function(t,e){t.anglePrev=t.angle-e,t.angularVelocity=e,t.angularSpeed=Math.abs(t.angularVelocity)},s.translate=function(t,e){s.setPosition(t,r.add(t.position,e))},s.rotate=function(t,e,i){if(i){var n=Math.cos(e),r=Math.sin(e),o=t.position.x-i.x,a=t.position.y-i.y;s.setPosition(t,{x:i.x+(o*n-a*r),y:i.y+(o*r+a*n)}),s.setAngle(t,t.angle+e)}else s.setAngle(t,t.angle+e)},s.scale=function(t,e,i,r){var o=0,a=0;r=r||t.position;for(var u=0;u0&&(o+=c.area,a+=c.inertia),c.position.x=r.x+(c.position.x-r.x)*e,c.position.y=r.y+(c.position.y-r.y)*i,h.update(c.bounds,c.vertices,t.velocity)}t.parts.length>1&&(t.area=o,t.isStatic||(s.setMass(t,t.density*o),s.setInertia(t,a))),t.circleRadius&&(e===i?t.circleRadius*=e:t.circleRadius=null)},s.update=function(t,e,i,s){var o=Math.pow(e*i*t.timeScale,2),a=1-t.frictionAir*i*t.timeScale,u=t.position.x-t.positionPrev.x,c=t.position.y-t.positionPrev.y;t.velocity.x=u*a*s+t.force.x/t.mass*o,t.velocity.y=c*a*s+t.force.y/t.mass*o,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.angularVelocity=(t.angle-t.anglePrev)*a*s+t.torque/t.inertia*o,t.anglePrev=t.angle,t.angle+=t.angularVelocity,t.speed=r.magnitude(t.velocity),t.angularSpeed=Math.abs(t.angularVelocity);for(var d=0;d0&&(p.position.x+=t.velocity.x,p.position.y+=t.velocity.y),0!==t.angularVelocity&&(n.rotate(p.vertices,t.angularVelocity,t.position),l.rotate(p.axes,t.angularVelocity),d>0&&r.rotateAbout(p.position,t.angularVelocity,t.position,p.position)),h.update(p.bounds,p.vertices,t.velocity)}},s.applyForce=function(t,e,i){t.force.x+=i.x,t.force.y+=i.y;var s=e.x-t.position.x,n=e.y-t.position.y;t.torque+=s*i.y-n*i.x},s._totalProperties=function(t){for(var e={mass:0,area:0,inertia:0,centre:{x:0,y:0}},i=1===t.parts.length?0:1;i{var s={};t.exports=s;var n=i(39073),r=i(68758),o=i(84091),a=i(84125);s.create=function(t){return r.extend({id:r.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,i,r){if(n.trigger(t,"compositeModified",t),t.isModified=e,e&&t.cache&&(t.cache.allBodies=null,t.cache.allConstraints=null,t.cache.allComposites=null),i&&t.parent&&s.setModified(t.parent,e,i,r),r)for(var o=0;o{var s={};t.exports=s;var n=i(11299);s.create=n.create,s.add=n.add,s.remove=n.remove,s.clear=n.clear,s.addComposite=n.addComposite,s.addBody=n.addBody,s.addConstraint=n.addConstraint},63454:(t,e,i)=>{var s={};t.exports=s;var n,r,o,a=i(39745),h=i(70584);n=[],r={overlap:0,axis:null},o={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:[]}},s.collides=function(t,e,i){if(s._overlapAxes(r,t.vertices,e.vertices,t.axes),r.overlap<=0)return null;if(s._overlapAxes(o,e.vertices,t.vertices,e.axes),o.overlap<=0)return null;var n,l,u=i&&i.table[h.id(t,e)];u?n=u.collision:((n=s.create(t,e)).collided=!0,n.bodyA=t.idS?S=a:aA?A=a:an?n=o:o{var e={};t.exports=e,e.create=function(t){return{vertex:t,normalImpulse:0,tangentImpulse:0}}},13657:(t,e,i)=>{var s={};t.exports=s;var n=i(68758),r=i(63454);s.create=function(t){return n.extend({bodies:[],pairs:null},t)},s.setBodies=function(t,e){t.bodies=e.slice(0)},s.clear=function(t){t.bodies=[]},s.collisions=function(t){var e,i,n=[],o=t.pairs,a=t.bodies,h=a.length,l=s.canCollide,u=r.collides;for(a.sort(s._compareBoundsX),e=0;ep)break;if(!(fC.max.y)&&(!g||!x.isStatic&&!x.isSleeping)&&l(c.collisionFilter,x.collisionFilter)){var T=x.parts.length;if(y&&1===T)(A=u(c,x,o))&&n.push(A);else for(var w=T>1?1:0,b=m>1?1:0;bC.max.x||d.max.xC.max.y||(A=u(E,_,o))&&n.push(A)}}}}return n},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}},70584:(t,e,i)=>{var s={};t.exports=s;var n=i(17319);s.create=function(t,e){var i=t.bodyA,n=t.bodyB,r={id:s.id(i,n),bodyA:i,bodyB:n,collision:t,contacts:[],activeContacts:[],separation:0,isActive:!0,confirmedActive:!0,isSensor:i.isSensor||n.isSensor,timeCreated:e,timeUpdated:e,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return s.update(r,t,e),r},s.update=function(t,e,i){var s=t.contacts,r=e.supports,o=t.activeContacts,a=e.parentA,h=e.parentB,l=a.vertices.length;t.isActive=!0,t.timeUpdated=i,t.collision=e,t.separation=e.depth,t.inverseMass=a.inverseMass+h.inverseMass,t.friction=a.frictionh.frictionStatic?a.frictionStatic:h.frictionStatic,t.restitution=a.restitution>h.restitution?a.restitution:h.restitution,t.slop=a.slop>h.slop?a.slop:h.slop,e.pair=t,o.length=0;for(var u=0;u{var s={};t.exports=s;var n=i(70584),r=i(68758);s.create=function(t){return r.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},t)},s.update=function(t,e,i){var s,r,o,a,h=t.list,l=h.length,u=t.table,c=e.length,d=t.collisionStart,p=t.collisionEnd,f=t.collisionActive;for(d.length=0,p.length=0,f.length=0,a=0;a{var s={};t.exports=s;var n=i(10438),r=i(63454),o=i(84091),a=i(68516),h=i(39745);s.collides=function(t,e){for(var i=[],s=e.length,n=t.bounds,a=r.collides,h=o.overlaps,l=0;l{var s={};t.exports=s;var n=i(39745),r=i(84091);s._restingThresh=4,s._restingThreshTangent=6,s._positionDampen=.9,s._positionWarming=.8,s._frictionNormalMultiplier=5,s.preSolvePosition=function(t){var e,i,s,n=t.length;for(e=0;ez||-Y>z?(n=Y>0?Y:-Y,(i=p.friction*(Y>0?1:-1)*a)<-n?i=-n:i>n&&(i=n)):(i=Y,n=c);var G=P*T-O*x,W=L*T-F*x,V=A/(_+v.inverseInertia*G*G+g.inverseInertia*W*W),H=(1+p.restitution)*N*V;if(i*=V,N*N>h&&N<0)R.normalImpulse=0;else{var j=R.normalImpulse;R.normalImpulse+=H,R.normalImpulse=Math.min(R.normalImpulse,0),H=R.normalImpulse-j}if(Y*Y>u)R.tangentImpulse=0;else{var K=R.tangentImpulse;R.tangentImpulse+=i,R.tangentImpulse<-n&&(R.tangentImpulse=-n),R.tangentImpulse>n&&(R.tangentImpulse=n),i=R.tangentImpulse-K}var q=x*H+w*i,Z=T*H+b*i;v.isStatic||v.isSleeping||(v.positionPrev.x+=q*v.inverseMass,v.positionPrev.y+=Z*v.inverseMass,v.anglePrev+=(P*Z-O*q)*v.inverseInertia),g.isStatic||g.isSleeping||(g.positionPrev.x-=q*g.inverseMass,g.positionPrev.y-=Z*g.inverseMass,g.anglePrev-=(L*Z-F*q)*g.inverseInertia)}}}}},52838:(t,e,i)=>{var s={};t.exports=s;var n=i(39745),r=i(10438),o=i(22806),a=i(84091),h=i(50658),l=i(68758);s._warming=.4,s._torqueDampen=1,s._minLength=1e-6,s.create=function(t){var e=t;e.bodyA&&!e.pointA&&(e.pointA={x:0,y:0}),e.bodyB&&!e.pointB&&(e.pointB={x:0,y:0});var i=e.bodyA?r.add(e.bodyA.position,e.pointA):e.pointA,s=e.bodyB?r.add(e.bodyB.position,e.pointB):e.pointB,n=r.magnitude(r.sub(i,s));e.length=void 0!==e.length?e.length:n,e.id=e.id||l.nextId(),e.label=e.label||"Constraint",e.type="constraint",e.stiffness=e.stiffness||(e.length>0?1:.7),e.damping=e.damping||0,e.angularStiffness=e.angularStiffness||0,e.angleA=e.bodyA?e.bodyA.angle:e.angleA,e.angleB=e.bodyB?e.bodyB.angle:e.angleB,e.plugin={};var o={visible:!0,type:"line",anchors:!0,lineColor:null,lineOpacity:null,lineThickness:null,pinSize:null,anchorColor:null,anchorSize:null};return 0===e.length&&e.stiffness>.1?(o.type="pin",o.anchors=!1):e.stiffness<.9&&(o.type="spring"),e.render=l.extend(o,e.render),e},s.preSolveAll=function(t){for(var e=0;e0&&(c.position.x+=l.x,c.position.y+=l.y),0!==l.angle&&(n.rotate(c.vertices,l.angle,i.position),h.rotate(c.axes,l.angle),u>0&&r.rotateAbout(c.position,l.angle,i.position,c.position)),a.update(c.bounds,c.vertices,i.velocity)}l.angle*=s._warming,l.x*=s._warming,l.y*=s._warming}}},s.pointAWorld=function(t){return{x:(t.bodyA?t.bodyA.position.x:0)+(t.pointA?t.pointA.x:0),y:(t.bodyA?t.bodyA.position.y:0)+(t.pointA?t.pointA.y:0)}},s.pointBWorld=function(t){return{x:(t.bodyB?t.bodyB.position.x:0)+(t.pointB?t.pointB.x:0),y:(t.bodyB?t.bodyB.position.y:0)+(t.pointB?t.pointB.y:0)}}},68758:(t,e,i)=>{var s={};t.exports=s,function(){s._nextId=0,s._seed=0,s._nowStartTime=+new Date,s._warnedOnce={},s._decomp=null,s.extend=function(t,e){var i,n;"boolean"==typeof e?(i=2,n=e):(i=1,n=!0);for(var r=i;r0;e--){var i=Math.floor(s.random()*(e+1)),n=t[e];t[e]=t[i],t[i]=n}return t},s.choose=function(t){return t[Math.floor(s.random()*t.length)]},s.isElement=function(t){return"undefined"!=typeof HTMLElement?t instanceof HTMLElement:!!(t&&t.nodeType&&t.nodeName)},s.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},s.isFunction=function(t){return"function"==typeof t},s.isPlainObject=function(t){return"object"==typeof t&&t.constructor===Object},s.isString=function(t){return"[object String]"===toString.call(t)},s.clamp=function(t,e,i){return ti?i:t},s.sign=function(t){return t<0?-1:1},s.now=function(){if("undefined"!=typeof window&&window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return Date.now?Date.now():new Date-s._nowStartTime},s.random=function(e,i){return i=void 0!==i?i:1,(e=void 0!==e?e:0)+t()*(i-e)};var t=function(){return s._seed=(9301*s._seed+49297)%233280,s._seed/233280};s.colorToNumber=function(t){return 3==(t=t.replace("#","")).length&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),parseInt(t,16)},s.logLevel=1,s.log=function(){console&&s.logLevel>0&&s.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},s.info=function(){console&&s.logLevel>0&&s.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},s.warn=function(){console&&s.logLevel>0&&s.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},s.warnOnce=function(){var t=Array.prototype.slice.call(arguments).join(" ");s._warnedOnce[t]||(s.warn(t),s._warnedOnce[t]=!0)},s.deprecated=function(t,e,i){t[e]=s.chain((function(){s.warnOnce("🔅 deprecated 🔅",i)}),t[e])},s.nextId=function(){return s._nextId++},s.indexOf=function(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0;i{var s={};t.exports=s;var n=i(22806),r=i(44272),o=i(13657),a=i(91327),h=i(39073),l=i(11299),u=i(52838),c=i(68758),d=i(84125);s.create=function(t){t=t||{};var e=c.extend({positionIterations:6,velocityIterations:4,constraintIterations:2,enableSleeping:!1,events:[],plugin:{},gravity:{x:0,y:1,scale:.001},timing:{timestamp:0,timeScale:1,lastDelta:0,lastElapsed:0}},t);return e.world=t.world||l.create({label:"World"}),e.pairs=t.pairs||a.create(),e.detector=t.detector||o.create(),e.grid={buckets:[]},e.world.gravity=e.gravity,e.broadphase=e.grid,e.metrics={},e},s.update=function(t,e,i){var d=c.now();e=e||1e3/60,i=i||1;var p,f=t.world,v=t.detector,g=t.pairs,m=t.timing,y=m.timestamp;m.timestamp+=e*m.timeScale,m.lastDelta=e*m.timeScale;var x={timestamp:m.timestamp};h.trigger(t,"beforeUpdate",x);var T=l.allBodies(f),w=l.allConstraints(f);for(f.isModified&&o.setBodies(v,T),f.isModified&&l.setModified(f,!1,!1,!0),t.enableSleeping&&n.update(T,m.timeScale),s._bodiesApplyGravity(T,t.gravity),s._bodiesUpdate(T,e,m.timeScale,i,f.bounds),u.preSolveAll(T),p=0;p0&&h.trigger(t,"collisionStart",{pairs:g.collisionStart}),r.preSolvePosition(g.list),p=0;p0&&h.trigger(t,"collisionActive",{pairs:g.collisionActive}),g.collisionEnd.length>0&&h.trigger(t,"collisionEnd",{pairs:g.collisionEnd}),s._bodiesClearForces(T),h.trigger(t,"afterUpdate",x),t.timing.lastElapsed=c.now()-d,t},s.merge=function(t,e){if(c.extend(t,e),e.world){t.world=e.world,s.clear(t);for(var i=l.allBodies(t.world),r=0;r{var s={};t.exports=s;var n=i(68758);s.on=function(t,e,i){for(var s,n=e.split(" "),r=0;r0){i||(i={}),s=e.split(" ");for(var l=0;l{var s={};t.exports=s;var n=i(84474),r=i(68758);s.name="matter-js",s.version="0.18.0",s.uses=[],s.used=[],s.use=function(){n.use(s,Array.prototype.slice.call(arguments))},s.before=function(t,e){return t=t.replace(/^Matter./,""),r.chainPathBefore(s,t,e)},s.after=function(t,e){return t=t.replace(/^Matter./,""),r.chainPathAfter(s,t,e)}},84474:(t,e,i)=>{var s={};t.exports=s;var n=i(68758);s._registry={},s.register=function(t){if(s.isPlugin(t)||n.warn("Plugin.register:",s.toString(t),"does not implement all required fields."),t.name in s._registry){var e=s._registry[t.name],i=s.versionParse(t.version).number,r=s.versionParse(e.version).number;i>r?(n.warn("Plugin.register:",s.toString(e),"was upgraded to",s.toString(t)),s._registry[t.name]=t):i-1},s.isFor=function(t,e){var i=t.for&&s.dependencyParse(t.for);return!t.for||e.name===i.name&&s.versionSatisfies(e.version,i.range)},s.use=function(t,e){if(t.uses=(t.uses||[]).concat(e||[]),0!==t.uses.length){for(var i=s.dependencies(t),r=n.topologicalSort(i),o=[],a=0;a0&&!h.silent&&n.info(o.join(" "))}else n.warn("Plugin.use:",s.toString(t),"does not specify any dependencies to install.")},s.dependencies=function(t,e){var i=s.dependencyParse(t),r=i.name;if(!(r in(e=e||{}))){t=s.resolve(t)||t,e[r]=n.map(t.uses||[],(function(e){s.isPlugin(e)&&s.register(e);var r=s.dependencyParse(e),o=s.resolve(e);return o&&!s.versionSatisfies(o.version,r.range)?(n.warn("Plugin.dependencies:",s.toString(o),"does not satisfy",s.toString(r),"used by",s.toString(i)+"."),o._warned=!0,t._warned=!0):o||(n.warn("Plugin.dependencies:",s.toString(e),"used by",s.toString(i),"could not be resolved."),t._warned=!0),r.name}));for(var o=0;o=|>)?\s*((\d+)\.(\d+)\.(\d+))(-[0-9A-Za-z-+]+)?$/;e.test(t)||n.warn("Plugin.versionParse:",t,"is not a valid version or range.");var i=e.exec(t),s=Number(i[4]),r=Number(i[5]),o=Number(i[6]);return{isRange:Boolean(i[1]||i[2]),version:i[3],range:t,operator:i[1]||i[2]||"",major:s,minor:r,patch:o,parts:[s,r,o],prerelease:i[7],number:1e8*s+1e4*r+o}},s.versionSatisfies=function(t,e){e=e||"*";var i=s.versionParse(e),n=s.versionParse(t);if(i.isRange){if("*"===i.operator||"*"===t)return!0;if(">"===i.operator)return n.number>i.number;if(">="===i.operator)return n.number>=i.number;if("~"===i.operator)return n.major===i.major&&n.minor===i.minor&&n.patch>=i.patch;if("^"===i.operator)return i.major>0?n.major===i.major&&n.number>=i.number:i.minor>0?n.minor===i.minor&&n.patch>=i.patch:n.patch===i.patch}return t===e||"*"===t}},22806:(t,e,i)=>{var s={};t.exports=s;var n=i(39073);s._motionWakeThreshold=.18,s._motionSleepThreshold=.08,s._minBias=.9,s.update=function(t,e){for(var i=e*e*e,n=0;n0&&r.motion=r.sleepThreshold&&s.set(r,!0)):r.sleepCounter>0&&(r.sleepCounter-=1)}else s.set(r,!1)}},s.afterCollisions=function(t,e){for(var i=e*e*e,n=0;ns._motionWakeThreshold*i&&s.set(l,!1)}}}},s.set=function(t,e){var i=t.isSleeping;e?(t.isSleeping=!0,t.sleepCounter=t.sleepThreshold,t.positionImpulse.x=0,t.positionImpulse.y=0,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.anglePrev=t.angle,t.speed=0,t.angularSpeed=0,t.motion=0,i||n.trigger(t,"sleepStart")):(t.isSleeping=!1,t.sleepCounter=0,i&&n.trigger(t,"sleepEnd"))}},68516:(t,e,i)=>{var s={};t.exports=s;var n=i(39745),r=i(68758),o=i(84125),a=i(84091),h=i(10438);s.rectangle=function(t,e,i,s,a){a=a||{};var h={label:"Rectangle Body",position:{x:t,y:e},vertices:n.fromPath("L 0 0 L "+i+" 0 L "+i+" "+s+" L 0 "+s)};if(a.chamfer){var l=a.chamfer;h.vertices=n.chamfer(h.vertices,l.radius,l.quality,l.qualityMin,l.qualityMax),delete a.chamfer}return o.create(r.extend({},h,a))},s.trapezoid=function(t,e,i,s,a,h){h=h||{};var l,u=i*(a*=.5),c=u+(1-2*a)*i,d=c+u;l=a<.5?"L 0 0 L "+u+" "+-s+" L "+c+" "+-s+" L "+d+" 0":"L 0 0 L "+c+" "+-s+" L "+d+" 0";var p={label:"Trapezoid Body",position:{x:t,y:e},vertices:n.fromPath(l)};if(h.chamfer){var f=h.chamfer;p.vertices=n.chamfer(p.vertices,f.radius,f.quality,f.qualityMin,f.qualityMax),delete h.chamfer}return o.create(r.extend({},p,h))},s.circle=function(t,e,i,n,o){n=n||{};var a={label:"Circle Body",circleRadius:i};o=o||25;var h=Math.ceil(Math.max(10,Math.min(o,i)));return h%2==1&&(h+=1),s.polygon(t,e,h,i,r.extend({},a,n))},s.polygon=function(t,e,i,a,h){if(h=h||{},i<3)return s.circle(t,e,a,h);for(var l=2*Math.PI/i,u="",c=.5*l,d=0;d0&&n.area(b)1?(p=o.create(r.extend({parts:f.slice(0)},a)),o.setPosition(p,{x:t,y:e}),p):f[0]},s.flagCoincidentParts=function(t,e){void 0===e&&(e=5);for(var i=0;i{var s={};t.exports=s;var n=i(11299),r=i(52838),o=i(68758),a=i(84125),h=i(68516),l=o.deprecated;s.stack=function(t,e,i,s,r,o,h){for(var l,u=n.create({label:"Stack"}),c=t,d=e,p=0,f=0;fv&&(v=y),a.translate(m,{x:.5*x,y:.5*y}),c=m.bounds.max.x+r,n.addBody(u,m),l=m,p+=1}else c+=r}d+=v+o,c=t}return u},s.chain=function(t,e,i,s,a,h){for(var l=t.bodies,u=1;u0)for(l=0;l0&&(d=p[l-1+(h-1)*e],n.addConstraint(t,r.create(o.extend({bodyA:d,bodyB:c},a)))),s&&ld||o<(l=d-l)||o>i-1-l))return 1===c&&a.translate(u,{x:(o+(i%2==1?1:-1))*p,y:0}),h(t+(u?o*p:0)+o*r,s,o,l,u,c)}))},s.newtonsCradle=function(t,e,i,s,o){for(var a=n.create({label:"Newtons Cradle"}),l=0;l{var s={};t.exports=s;var n=i(10438),r=i(68758);s.fromVertices=function(t){for(var e={},i=0;i{var e={};t.exports=e,e.create=function(t){var i={min:{x:0,y:0},max:{x:0,y:0}};return t&&e.update(i,t),i},e.update=function(t,e,i){t.min.x=1/0,t.max.x=-1/0,t.min.y=1/0,t.max.y=-1/0;for(var s=0;st.max.x&&(t.max.x=n.x),n.xt.max.y&&(t.max.y=n.y),n.y0?t.max.x+=i.x:t.min.x+=i.x,i.y>0?t.max.y+=i.y:t.min.y+=i.y)},e.contains=function(t,e){return e.x>=t.min.x&&e.x<=t.max.x&&e.y>=t.min.y&&e.y<=t.max.y},e.overlaps=function(t,e){return t.min.x<=e.max.x&&t.max.x>=e.min.x&&t.max.y>=e.min.y&&t.min.y<=e.max.y},e.translate=function(t,e){t.min.x+=e.x,t.max.x+=e.x,t.min.y+=e.y,t.max.y+=e.y},e.shift=function(t,e){var i=t.max.x-t.min.x,s=t.max.y-t.min.y;t.min.x=e.x,t.max.x=e.x+i,t.min.y=e.y,t.max.y=e.y+s}},92765:(t,e,i)=>{var s={};t.exports=s;i(84091);var n=i(68758);s.pathToVertices=function(t,e){"undefined"==typeof window||"SVGPathSeg"in window||n.warn("Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.");var i,r,o,a,h,l,u,c,d,p,f,v=[],g=0,m=0,y=0;e=e||15;var x=function(t,e,i){var s=i%2==1&&i>1;if(!d||t!=d.x||e!=d.y){d&&s?(p=d.x,f=d.y):(p=0,f=0);var n={x:p+t,y:f+e};!s&&d||(d=n),v.push(n),m=p+t,y=f+e}},T=function(t){var e=t.pathSegTypeAsLetter.toUpperCase();if("Z"!==e){switch(e){case"M":case"L":case"T":case"C":case"S":case"Q":m=t.x,y=t.y;break;case"H":m=t.x;break;case"V":y=t.y}x(m,y,t.pathSegType)}};for(s._svgPathToAbsolute(t),o=t.getTotalLength(),l=[],i=0;i{var e={};t.exports=e,e.create=function(t,e){return{x:t||0,y:e||0}},e.clone=function(t){return{x:t.x,y:t.y}},e.magnitude=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},e.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},e.rotate=function(t,e,i){var s=Math.cos(e),n=Math.sin(e);i||(i={});var r=t.x*s-t.y*n;return i.y=t.x*n+t.y*s,i.x=r,i},e.rotateAbout=function(t,e,i,s){var n=Math.cos(e),r=Math.sin(e);s||(s={});var o=i.x+((t.x-i.x)*n-(t.y-i.y)*r);return s.y=i.y+((t.x-i.x)*r+(t.y-i.y)*n),s.x=o,s},e.normalise=function(t){var i=e.magnitude(t);return 0===i?{x:0,y:0}:{x:t.x/i,y:t.y/i}},e.dot=function(t,e){return t.x*e.x+t.y*e.y},e.cross=function(t,e){return t.x*e.y-t.y*e.x},e.cross3=function(t,e,i){return(e.x-t.x)*(i.y-t.y)-(e.y-t.y)*(i.x-t.x)},e.add=function(t,e,i){return i||(i={}),i.x=t.x+e.x,i.y=t.y+e.y,i},e.sub=function(t,e,i){return i||(i={}),i.x=t.x-e.x,i.y=t.y-e.y,i},e.mult=function(t,e){return{x:t.x*e,y:t.y*e}},e.div=function(t,e){return{x:t.x/e,y:t.y/e}},e.perp=function(t,e){return{x:(e=!0===e?-1:1)*-t.y,y:e*t.x}},e.neg=function(t){return{x:-t.x,y:-t.y}},e.angle=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)},e._temp=[e.create(),e.create(),e.create(),e.create(),e.create(),e.create()]},39745:(t,e,i)=>{var s={};t.exports=s;var n=i(10438),r=i(68758);s.create=function(t,e){for(var i=[],s=0;s0)return!1;o=i}return!0},s.scale=function(t,e,i,r){if(1===e&&1===i)return t;var o,a;r=r||s.centre(t);for(var h=0;h=0?h-1:t.length-1],u=t[h],c=t[(h+1)%t.length],d=e[h0&&(r|=2),3===r)return!1;return 0!==r||null},s.hull=function(t){var e,i,s=[],r=[];for((t=t.slice(0)).sort((function(t,e){var i=t.x-e.x;return 0!==i?i:t.y-e.y})),i=0;i=2&&n.cross3(r[r.length-2],r[r.length-1],e)<=0;)r.pop();r.push(e)}for(i=t.length-1;i>=0;i-=1){for(e=t[i];s.length>=2&&n.cross3(s[s.length-2],s[s.length-1],e)<=0;)s.pop();s.push(e)}return s.pop(),r.pop(),s.concat(r)}},1675:(t,e,i)=>{var s=i(18171),n={name:"matter-attractors",version:"0.1.7",for:"matter-js@^0.18.0",silent:!0,install:function(t){t.after("Body.create",(function(){n.Body.init(this)})),t.before("Engine.update",(function(t){n.Engine.update(t)}))},Body:{init:function(t){t.plugin.attractors=t.plugin.attractors||[]}},Engine:{update:function(t){for(var e=s.Composite.allBodies(t.world),i=0;i0)for(var o=0;o{t.exports={name:"matter-collision-events",version:"0.1.6",for:"matter-js@^0.18.0",silent:!0,install:function(t){t.after("Engine.create",(function(){t.Events.on(this,"collisionStart",(function(e){e.pairs.map((function(e){var i=e.bodyA,s=e.bodyB;i.gameObject&&i.gameObject.emit("collide",i,s,e),s.gameObject&&s.gameObject.emit("collide",s,i,e),t.Events.trigger(i,"onCollide",{pair:e}),t.Events.trigger(s,"onCollide",{pair:e}),i.onCollideCallback&&i.onCollideCallback(e),s.onCollideCallback&&s.onCollideCallback(e),i.onCollideWith[s.id]&&i.onCollideWith[s.id](s,e),s.onCollideWith[i.id]&&s.onCollideWith[i.id](i,e)}))})),t.Events.on(this,"collisionActive",(function(e){e.pairs.map((function(e){var i=e.bodyA,s=e.bodyB;i.gameObject&&i.gameObject.emit("collideActive",i,s,e),s.gameObject&&s.gameObject.emit("collideActive",s,i,e),t.Events.trigger(i,"onCollideActive",{pair:e}),t.Events.trigger(s,"onCollideActive",{pair:e}),i.onCollideActiveCallback&&i.onCollideActiveCallback(e),s.onCollideActiveCallback&&s.onCollideActiveCallback(e)}))})),t.Events.on(this,"collisionEnd",(function(e){e.pairs.map((function(e){var i=e.bodyA,s=e.bodyB;i.gameObject&&i.gameObject.emit("collideEnd",i,s,e),s.gameObject&&s.gameObject.emit("collideEnd",s,i,e),t.Events.trigger(i,"onCollideEnd",{pair:e}),t.Events.trigger(s,"onCollideEnd",{pair:e}),i.onCollideEndCallback&&i.onCollideEndCallback(e),s.onCollideEndCallback&&s.onCollideEndCallback(e)}))}))}))}}},44097:(t,e,i)=>{var s=i(18171),n={name:"matter-wrap",version:"0.1.4",for:"matter-js@^0.18.0",silent:!0,install:function(t){t.after("Engine.update",(function(){n.Engine.update(this)}))},Engine:{update:function(t){for(var e=t.world,i=s.Composite.allBodies(e),r=s.Composite.allComposites(e),o=0;oe.max.x?i=e.min.x-t.max.x:t.max.xe.max.y?s=e.min.y-t.max.y:t.max.y{function e(t,e,i){i=i||0;var s,n,r,o,a,h,l,u=[0,0];return s=t[1][1]-t[0][1],n=t[0][0]-t[1][0],r=s*t[0][0]+n*t[0][1],o=e[1][1]-e[0][1],a=e[0][0]-e[1][0],h=o*e[0][0]+a*e[0][1],E(l=s*a-o*n,0,i)||(u[0]=(a*r-n*h)/l,u[1]=(s*h-o*r)/l),u}function i(t,e,i,s){var n=e[0]-t[0],r=e[1]-t[1],o=s[0]-i[0],a=s[1]-i[1];if(o*r-a*n==0)return!1;var h=(n*(i[1]-t[1])+r*(t[0]-i[0]))/(o*r-a*n),l=(o*(t[1]-i[1])+a*(i[0]-t[0]))/(a*n-o*r);return h>=0&&h<=1&&l>=0&&l<=1}function s(t,e,i){return(e[0]-t[0])*(i[1]-t[1])-(i[0]-t[0])*(e[1]-t[1])}function n(t,e,i){return s(t,e,i)>0}function r(t,e,i){return s(t,e,i)>=0}function o(t,e,i){return s(t,e,i)<0}function a(t,e,i){return s(t,e,i)<=0}t.exports={decomp:function(t){var e=T(t);return e.length>0?w(t,e):[t]},quickDecomp:function t(e,i,s,h,l,u,v){u=u||100,v=v||0,l=l||25,i=void 0!==i?i:[],s=s||[],h=h||[];var g=[0,0],m=[0,0],x=[0,0],T=0,w=0,E=0,S=0,A=0,_=0,C=0,R=[],M=[],P=e,O=e;if(O.length<3)return i;if(++v>u)return console.warn("quickDecomp: max level ("+u+") reached."),i;for(var L=0;LA&&(A+=e.length),S=Number.MAX_VALUE,A<_)return i;for(F=_;F<=A;++F)r(d(P,L-1),d(P,L),d(P,F))&&a(d(P,L+1),d(P,L),d(P,F))&&(E=c(d(P,L),d(P,F)))3&&s>=0;--s)u(d(t,s-1),d(t,s),d(t,s+1),e)&&(t.splice(s%t.length,1),i++);return i},removeDuplicatePoints:function(t,e){for(var i=t.length-1;i>=1;--i)for(var s=t[i],n=i-1;n>=0;--n)S(s,t[n],e)&&t.splice(i,1)},makeCCW:function(t){for(var e=0,i=t,s=1;si[e][0])&&(e=s);return!n(d(t,e-1),d(t,e),d(t,e+1))&&(function(t){for(var e=[],i=t.length,s=0;s!==i;s++)e.push(t.pop());for(s=0;s!==i;s++)t[s]=e[s]}(t),!0)}};var h=[],l=[];function u(t,e,i,n){if(n){var r=h,o=l;r[0]=e[0]-t[0],r[1]=e[1]-t[1],o[0]=i[0]-e[0],o[1]=i[1]-e[1];var a=r[0]*o[0]+r[1]*o[1],u=Math.sqrt(r[0]*r[0]+r[1]*r[1]),c=Math.sqrt(o[0]*o[0]+o[1]*o[1]);return Math.acos(a/(u*c)){var s=new(i(56694))({initialize:function(t){this.pluginManager=t,this.game=t.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=s},18360:t=>{t.exports={Global:["game","anims","cache","plugins","registry","scale","sound","textures","renderer"],CoreScene:["EventEmitter","CameraManager","GameObjectCreator","GameObjectFactory","ScenePlugin","DisplayList","UpdateList"],DefaultScene:["Clock","DataManagerPlugin","InputPlugin","Loader","TweenManager","LightsPlugin"]}},91963:t=>{var e={},i={},s={register:function(t,i,s,n){void 0===n&&(n=!1),e[t]={plugin:i,mapping:s,custom:n}},registerCustom:function(t,e,s,n){i[t]={plugin:e,mapping:s,data:n}},hasCore:function(t){return e.hasOwnProperty(t)},hasCustom:function(t){return i.hasOwnProperty(t)},getCore:function(t){return e[t]},getCustom:function(t){return i[t]},getCustomClass:function(t){return i.hasOwnProperty(t)?i[t].plugin:null},remove:function(t){e.hasOwnProperty(t)&&delete e[t]},removeCustom:function(t){i.hasOwnProperty(t)&&delete i[t]},destroyCorePlugins:function(){for(var t in e)e.hasOwnProperty(t)&&delete e[t]},destroyCustomPlugins:function(){for(var t in i)i.hasOwnProperty(t)&&delete i[t]}};t.exports=s},49274:(t,e,i)=>{var s=i(56694),n=i(97081),r=i(6659),o=i(76846),a=i(99325),h=i(61286),l=i(72632),u=i(91963),c=i(66458),d=new s({Extends:r,initialize:function(t){r.call(this),this.game=t,this.plugins=[],this.scenePlugins=[],this._pendingGlobal=[],this._pendingScene=[],t.isBooted?this.boot():t.events.once(n.BOOT,this.boot,this)},boot:function(){var t,e,i,s,r,o,a,h=this.game.config,u=h.installGlobalPlugins;for(u=u.concat(this._pendingGlobal),t=0;t{var s=i(88257),n=i(56694),r=i(7599),o=new n({Extends:s,initialize:function(t,e,i){s.call(this,e),this.scene=t,this.systems=t.sys,this.pluginKey=i,t.sys.events.once(r.BOOT,this.boot,this)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=o},45615:(t,e,i)=>{t.exports={BasePlugin:i(88257),DefaultPlugins:i(18360),PluginCache:i(91963),PluginManager:i(49274),ScenePlugin:i(39283)}},95723:t=>{t.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,ERASE:17,SOURCE_IN:18,SOURCE_OUT:19,SOURCE_ATOP:20,DESTINATION_OVER:21,DESTINATION_IN:22,DESTINATION_OUT:23,DESTINATION_ATOP:24,LIGHTER:25,COPY:26,XOR:27}},27394:t=>{t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},91135:(t,e,i)=>{var s=i(89787),n=i(61840),r=i(56694),o=i(86459),a=i(6659),h=i(81044),l=i(32834),u=i(40444),c=i(38203),d=i(69360),p=new r({Extends:a,initialize:function(t){a.call(this);var e=t.config;this.config={clearBeforeRender:e.clearBeforeRender,backgroundColor:e.backgroundColor,antialias:e.antialias,roundPixels:e.roundPixels},this.game=t,this.type=o.CANVAS,this.drawCount=0,this.width=0,this.height=0,this.gameCanvas=t.canvas;var i={alpha:t.config.transparent,desynchronized:t.config.desynchronized,willReadFrequently:!1};this.gameContext=e.context?e.context:this.gameCanvas.getContext("2d",i),this.currentContext=this.gameContext,this.antialias=t.config.antialias,this.blendModes=l(),this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this._tempMatrix1=new d,this._tempMatrix2=new d,this._tempMatrix3=new d,this.isBooted=!1,this.init()},init:function(){this.game.textures.once(c.READY,this.boot,this)},boot:function(){var t=this.game,e=t.scale.baseSize;this.width=e.width,this.height=e.height,this.isBooted=!0,t.scale.on(u.RESIZE,this.onResize,this),this.resize(e.width,e.height)},onResize:function(t,e){e.width===this.width&&e.height===this.height||this.resize(e.width,e.height)},resize:function(t,e){this.width=t,this.height=e,this.emit(h.RESIZE,t,e)},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(t){return this.currentContext.globalCompositeOperation=t,this},setContext:function(t){return this.currentContext=t||this.gameContext,this},setAlpha:function(t){return this.currentContext.globalAlpha=t,this},preRender:function(){var t=this.gameContext,e=this.config,i=this.width,s=this.height;t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),e.clearBeforeRender&&(t.clearRect(0,0,i,s),e.transparent||(t.fillStyle=e.backgroundColor.rgba,t.fillRect(0,0,i,s))),t.save(),this.drawCount=0,this.emit(h.PRE_RENDER)},render:function(t,e,i){var n=e.length;this.emit(h.RENDER,t,i);var r=i.x,o=i.y,a=i.width,l=i.height,u=i.renderToTexture?i.context:t.sys.context;u.save(),this.game.scene.customViewports&&(u.beginPath(),u.rect(r,o,a,l),u.clip()),i.emit(s.PRE_RENDER,i),this.currentContext=u;var c=i.mask;c&&c.preRenderCanvas(this,null,i._maskCamera),i.transparent||(u.fillStyle=i.backgroundColor.rgba,u.fillRect(r,o,a,l)),u.globalAlpha=i.alpha,u.globalCompositeOperation="source-over",this.drawCount+=n,i.renderToTexture&&i.emit(s.PRE_RENDER,i),i.matrix.copyToContext(u);for(var d=0;d=0?m=-(m+c):m<0&&(m=Math.abs(m)-c)),t.flipY&&(y>=0?y=-(y+d):y<0&&(y=Math.abs(y)-d))}var T=1,w=1;t.flipX&&(p||(m+=-e.realWidth+2*v),T=-1),t.flipY&&(p||(y+=-e.realHeight+2*g),w=-1),a.applyITRS(t.x,t.y,t.rotation,t.scaleX*T,t.scaleY*w),o.copyFrom(i.matrix),s?(o.multiplyWithOffset(s,-i.scrollX*t.scrollFactorX,-i.scrollY*t.scrollFactorY),a.e=t.x,a.f=t.y):(a.e-=i.scrollX*t.scrollFactorX,a.f-=i.scrollY*t.scrollFactorY),o.multiply(a),i.roundPixels&&(o.e=Math.round(o.e),o.f=Math.round(o.f)),r.save(),o.setToContext(r),r.globalCompositeOperation=this.blendModes[t.blendMode],r.globalAlpha=n,r.imageSmoothingEnabled=!e.source.scaleMode,t.mask&&t.mask.preRenderCanvas(this,t,i),c>0&&d>0&&r.drawImage(e.source.image,l,u,c,d,m,y,c/f,d/f),t.mask&&t.mask.postRenderCanvas(this,t,i),r.restore()}},destroy:function(){this.removeAllListeners(),this.game=null,this.gameCanvas=null,this.gameContext=null}});t.exports=p},6046:(t,e,i)=>{t.exports={CanvasRenderer:i(91135),GetBlendModes:i(32834),SetTransform:i(49584)}},32834:(t,e,i)=>{var s=i(95723),n=i(98581);t.exports=function(){var t=[],e=n.supportNewBlendModes,i="source-over";return t[s.NORMAL]=i,t[s.ADD]="lighter",t[s.MULTIPLY]=e?"multiply":i,t[s.SCREEN]=e?"screen":i,t[s.OVERLAY]=e?"overlay":i,t[s.DARKEN]=e?"darken":i,t[s.LIGHTEN]=e?"lighten":i,t[s.COLOR_DODGE]=e?"color-dodge":i,t[s.COLOR_BURN]=e?"color-burn":i,t[s.HARD_LIGHT]=e?"hard-light":i,t[s.SOFT_LIGHT]=e?"soft-light":i,t[s.DIFFERENCE]=e?"difference":i,t[s.EXCLUSION]=e?"exclusion":i,t[s.HUE]=e?"hue":i,t[s.SATURATION]=e?"saturation":i,t[s.COLOR]=e?"color":i,t[s.LUMINOSITY]=e?"luminosity":i,t[s.ERASE]="destination-out",t[s.SOURCE_IN]="source-in",t[s.SOURCE_OUT]="source-out",t[s.SOURCE_ATOP]="source-atop",t[s.DESTINATION_OVER]="destination-over",t[s.DESTINATION_IN]="destination-in",t[s.DESTINATION_OUT]="destination-out",t[s.DESTINATION_ATOP]="destination-atop",t[s.LIGHTER]="lighter",t[s.COPY]="copy",t[s.XOR]="xor",t}},49584:(t,e,i)=>{var s=i(73329);t.exports=function(t,e,i,n,r){var o=n.alpha*i.alpha;if(o<=0)return!1;var a=s(i,n,r).calc;return e.globalCompositeOperation=t.blendModes[i.blendMode],e.globalAlpha=o,e.save(),a.setToContext(e),e.imageSmoothingEnabled=i.frame?!i.frame.source.scaleMode:t.antialias,!0}},70936:t=>{t.exports="postrender"},99298:t=>{t.exports="prerender"},7743:t=>{t.exports="render"},99519:t=>{t.exports="resize"},81044:(t,e,i)=>{t.exports={POST_RENDER:i(70936),PRE_RENDER:i(99298),RENDER:i(7743),RESIZE:i(99519)}},42069:(t,e,i)=>{t.exports={Canvas:i(6046),Events:i(81044),Snapshot:i(95528),WebGL:i(55478)}},61840:(t,e,i)=>{var s=i(61068),n=i(27119),r=i(72632);t.exports=function(t,e){var i=r(e,"callback"),o=r(e,"type","image/png"),a=r(e,"encoder",.92),h=Math.abs(Math.round(r(e,"x",0))),l=Math.abs(Math.round(r(e,"y",0))),u=Math.floor(r(e,"width",t.width)),c=Math.floor(r(e,"height",t.height));if(r(e,"getPixel",!1)){var d=t.getContext("2d").getImageData(h,l,1,1).data;i.call(null,new n(d[0],d[1],d[2],d[3]))}else if(0!==h||0!==l||u!==t.width||c!==t.height){var p=s.createWebGL(this,u,c),f=p.getContext("2d");u>0&&c>0&&f.drawImage(t,h,l,u,c,0,0,u,c);var v=new Image;v.onerror=function(){i.call(null),s.remove(p)},v.onload=function(){i.call(null,v),s.remove(p)},v.src=p.toDataURL(o,a)}else{var g=new Image;g.onerror=function(){i.call(null)},g.onload=function(){i.call(null,g)},g.src=t.toDataURL(o,a)}}},1217:(t,e,i)=>{var s=i(61068),n=i(27119),r=i(72632);t.exports=function(t,e){var i=t,o=r(e,"callback"),a=r(e,"type","image/png"),h=r(e,"encoder",.92),l=Math.abs(Math.round(r(e,"x",0))),u=Math.abs(Math.round(r(e,"y",0))),c=r(e,"getPixel",!1),d=r(e,"isFramebuffer",!1),p=d?r(e,"bufferWidth",1):i.drawingBufferWidth,f=d?r(e,"bufferHeight",1):i.drawingBufferHeight;if(c){var v=new Uint8Array(4),g=d?u:f-u;i.readPixels(l,g,1,1,i.RGBA,i.UNSIGNED_BYTE,v),o.call(null,new n(v[0],v[1],v[2],v[3]))}else{var m=Math.floor(r(e,"width",p)),y=Math.floor(r(e,"height",f)),x=new Uint8Array(m*y*4);i.readPixels(l,f-u-y,m,y,i.RGBA,i.UNSIGNED_BYTE,x);for(var T=s.createWebGL(this,m,y),w=T.getContext("2d"),b=w.getImageData(0,0,m,y),E=b.data,S=0;S{t.exports={Canvas:i(61840),WebGL:i(1217)}},35217:(t,e,i)=>{var s=i(56694),n=i(65641),r=i(33885),o=i(72632),a=i(37410),h=i(82127),l=i(5583),u=i(66901),c=i(77310),d=i(10919),p=i(21213),f=i(51212),v=i(60848),g=new s({initialize:function(t){this.game=t.game,this.renderer=t,this.classes=new r([[n.UTILITY_PIPELINE,v],[n.MULTI_PIPELINE,c],[n.BITMAPMASK_PIPELINE,l],[n.SINGLE_PIPELINE,f],[n.ROPE_PIPELINE,p],[n.LIGHT_PIPELINE,u],[n.POINTLIGHT_PIPELINE,d]]),this.postPipelineClasses=new r,this.pipelines=new r,this.current=null,this.previous=null,this.MULTI_PIPELINE=null,this.BITMAPMASK_PIPELINE=null,this.UTILITY_PIPELINE=null,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2,this.renderTargets=[],this.maxDimension=0,this.frameInc=32,this.targetIndex=0},boot:function(t){var e=this.renderer,i=this.renderTargets;this.frameInc=Math.floor(o(t,"frameInc",32));for(var s,r,h=e.width,l=e.height,u=Math.min(h,l),c=Math.ceil(u/this.frameInc),d=1;d=0;i--){var s=e[i];s.active&&s.preBatch(t)}}},postBatch:function(t){if(t.hasPostPipeline){this.flush();for(var e=t.postPipelines,i=0;i=0;i--){var s=e[i];s.active&&s.preBatch(t)}}},postBatchCamera:function(t){if(t.hasPostPipeline){this.flush();for(var e=t.postPipelines,i=0;ithis.maxDimension)return this.targetIndex=e.length-3,e[this.targetIndex];var i=3*(h(t,this.frameInc,0,!0)-1);return this.targetIndex=i,e[i]},getSwapRenderTarget:function(){return this.renderTargets[this.targetIndex+1]},getAltSwapRenderTarget:function(){return this.renderTargets[this.targetIndex+2]},destroy:function(){this.flush(),this.classes.clear(),this.postPipelineClasses.clear(),this.pipelines.clear(),this.renderer=null,this.game=null,this.classes=null,this.postPipelineClasses=null,this.pipelines=null,this.current=null,this.previous=null}});t.exports=g},37410:(t,e,i)=>{var s=i(56694),n=i(81044),r=new s({initialize:function(t,e,i,s,n,r,o){void 0===s&&(s=1),void 0===n&&(n=0),void 0===r&&(r=!0),void 0===o&&(o=!1),this.renderer=t,this.framebuffer=null,this.texture=null,this.width=0,this.height=0,this.scale=s,this.minFilter=n,this.autoClear=r,this.autoResize=!1,this.resize(e,i),o&&this.setAutoResize(!0)},setAutoResize:function(t){return t&&!this.autoResize?(this.renderer.on(n.RESIZE,this.resize,this),this.autoResize=!0):!t&&this.autoResize&&(this.renderer.off(n.RESIZE,this.resize,this),this.autoResize=!1),this},resize:function(t,e){var i=t*this.scale,s=e*this.scale;if(i!==this.width||s!==this.height){var n=this.renderer;n.deleteFramebuffer(this.framebuffer),n.deleteTexture(this.texture),t*=this.scale,e*=this.scale,(t=Math.round(t))<=0&&(t=1),(e=Math.round(e))<=0&&(e=1),this.texture=n.createTextureFromSource(null,t,e,this.minFilter,!0),this.framebuffer=n.createFramebuffer(t,e,this.texture,!1),this.width=t,this.height=e}return this},bind:function(t,e,i){if(void 0===t&&(t=!1),t&&this.renderer.flush(),e&&i&&this.resize(e,i),this.renderer.pushFramebuffer(this.framebuffer,!1,!1,!1),t&&this.adjustViewport(),this.autoClear){var s=this.renderer.gl;s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT)}},adjustViewport:function(){var t=this.renderer.gl;t.viewport(0,0,this.width,this.height),t.disable(t.SCISSOR_TEST)},clear:function(){var t=this.renderer,e=t.gl;t.pushFramebuffer(this.framebuffer),e.disable(e.SCISSOR_TEST),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),t.popFramebuffer(),t.resetScissor()},unbind:function(t){void 0===t&&(t=!1);var e=this.renderer;return t&&e.flush(),e.popFramebuffer()},destroy:function(){var t=this.renderer;t.deleteFramebuffer(this.framebuffer),t.deleteTexture(this.texture),t.off(n.RESIZE,this.resize,this),this.renderer=null,this.framebuffer=null,this.texture=null}});t.exports=r},75512:t=>{t.exports={getTintFromFloats:function(t,e,i,s){return((255&(255*s|0))<<24|(255&(255*t|0))<<16|(255&(255*e|0))<<8|255&(255*i|0))>>>0},getTintAppendFloatAlpha:function(t,e){return((255&(255*e|0))<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255&(255*e|0))<<24|(255&(0|t))<<16|(255&(t>>8|0))<<8|255&(t>>16|0))>>>0},getFloatsFromUintRGB:function(t){return[(255&(t>>16|0))/255,(255&(t>>8|0))/255,(255&(0|t))/255]},checkShaderMax:function(t,e){var i=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);return e&&-1!==e?Math.min(i,e):i},parseFragmentShaderMaxTextures:function(t,e){if(!t)return"";for(var i="vec4 getSampler (int index, vec2 uv) {",s=0;s0&&s{var s=i(56694),n=i(28699),r=i(6659),o=i(18970),a=i(72632),h=i(16650),l=i(81044),u=i(37410),c=i(75512),d=i(71305),p=new s({Extends:r,initialize:function(t){r.call(this);var e=t.game,i=e.renderer,s=i.gl;this.name=a(t,"name","WebGLPipeline"),this.game=e,this.renderer=i,this.manager,this.gl=s,this.view=e.canvas,this.width=0,this.height=0,this.vertexCount=0,this.vertexCapacity=0,this.vertexData,this.vertexBuffer,this.topology=a(t,"topology",s.TRIANGLES),this.bytes,this.vertexViewF32,this.vertexViewU32,this.active=!0,this.currentUnit=0,this.forceZero=a(t,"forceZero",!1),this.hasBooted=!1,this.isPostFX=!1,this.isSpriteFX=!1,this.renderTargets=[],this.currentRenderTarget,this.shaders=[],this.currentShader,this.projectionMatrix,this.projectionWidth=0,this.projectionHeight=0,this.config=t,this.glReset=!1},boot:function(){var t,e=this.gl,i=this.config,s=this.renderer;this.isPostFX||(this.projectionMatrix=(new h).identity());var n=this.renderTargets,r=a(i,"renderTarget",!1);"boolean"==typeof r&&r&&(r=1);var c=s.width,d=s.height;if("number"==typeof r)for(t=0;tx&&(x=y[t].vertexSize);var T=a(i,"batchSize",s.config.batchSize);this.vertexCapacity=6*T;var w=new ArrayBuffer(this.vertexCapacity*x);this.vertexData=w,this.bytes=new Uint8Array(w),this.vertexViewF32=new Float32Array(w),this.vertexViewU32=new Uint32Array(w);var b=a(i,"vertices",null);for(b?(this.vertexViewF32.set(b),this.vertexBuffer=s.createVertexBuffer(w,e.STATIC_DRAW)):this.vertexBuffer=s.createVertexBuffer(w.byteLength,e.DYNAMIC_DRAW),this.setVertexBuffer(),t=y.length-1;t>=0;t--)y[t].rebind();this.hasBooted=!0,s.on(l.RESIZE,this.resize,this),s.on(l.PRE_RENDER,this.onPreRender,this),s.on(l.RENDER,this.onRender,this),s.on(l.POST_RENDER,this.onPostRender,this),this.emit(o.BOOT,this),this.onBoot()},onBoot:function(){},onResize:function(){},setShader:function(t,e,i){var s=this.renderer;t===this.currentShader&&s.currentProgram===this.currentShader.program||(this.flush(),s.resetTextures(),this.setVertexBuffer(i)&&!e&&(e=!0),t.bind(e,!1),this.currentShader=t);return this},getShaderByName:function(t){for(var e=this.shaders,i=0;ithis.vertexCapacity},resize:function(t,e){t===this.width&&e===this.height||this.flush(),this.width=t,this.height=e;for(var i=this.renderTargets,s=0;s=0;i--){var s=e[i].rebind();t&&s!==t||(this.currentShader=s)}return this.emit(o.REBIND,this.currentShader),this.onActive(this.currentShader),this.onRebind(),this.glReset=!1,this},setVertexBuffer:function(t){void 0===t&&(t=this.vertexBuffer);var e=this.gl;return e.getParameter(e.ARRAY_BUFFER_BINDING)!==t&&(e.bindBuffer(e.ARRAY_BUFFER,t),!0)},preBatch:function(t){return this.currentRenderTarget&&this.currentRenderTarget.bind(),this.onPreBatch(t),this},postBatch:function(t){return this.onDraw(this.currentRenderTarget),this.onPostBatch(t),this},onDraw:function(){},unbind:function(){this.currentRenderTarget&&this.currentRenderTarget.unbind()},flush:function(t){if(void 0===t&&(t=!1),this.vertexCount>0){this.emit(o.BEFORE_FLUSH,this,t),this.onBeforeFlush(t);var e=this.gl,i=this.vertexCount,s=this.currentShader.vertexSize;this.active&&(this.setVertexBuffer(),i===this.vertexCapacity?e.bufferData(e.ARRAY_BUFFER,this.vertexData,e.DYNAMIC_DRAW):e.bufferSubData(e.ARRAY_BUFFER,0,this.bytes.subarray(0,i*s)),e.drawArrays(this.topology,0,i)),this.vertexCount=0,this.emit(o.AFTER_FLUSH,this,t),this.onAfterFlush(t)}return this},onActive:function(){},onBind:function(){},onRebind:function(){},onBatch:function(){},onPreBatch:function(){},onPostBatch:function(){},onPreRender:function(){},onRender:function(){},onPostRender:function(){},onBeforeFlush:function(){},onAfterFlush:function(){},batchVert:function(t,e,i,s,n,r,o){var a=this.vertexViewF32,h=this.vertexViewU32,l=this.vertexCount*this.currentShader.vertexComponentCount-1;a[++l]=t,a[++l]=e,a[++l]=i,a[++l]=s,a[++l]=n,a[++l]=r,h[++l]=o,this.vertexCount++},batchQuad:function(t,e,i,s,n,r,o,a,h,l,u,c,d,p,f,v,g,m,y,x){void 0===x&&(x=this.currentUnit);var T=!1;return this.shouldFlush(6)&&(this.flush(),T=!0,x=this.setTexture2D(y)),this.batchVert(e,i,l,u,x,m,p),this.batchVert(s,n,l,d,x,m,v),this.batchVert(r,o,c,d,x,m,g),this.batchVert(e,i,l,u,x,m,p),this.batchVert(r,o,c,d,x,m,g),this.batchVert(a,h,c,u,x,m,f),this.onBatch(t),T},batchTri:function(t,e,i,s,n,r,o,a,h,l,u,c,d,p,f,v,g){void 0===g&&(g=this.currentUnit);var m=!1;return this.shouldFlush(3)&&(this.flush(),m=!0,g=this.setTexture2D(v)),this.batchVert(e,i,a,h,g,f,c),this.batchVert(s,n,a,u,g,f,d),this.batchVert(r,o,l,u,g,f,p),this.onBatch(t),m},drawFillRect:function(t,e,i,s,n,r,o,a){void 0===o&&(o=this.renderer.whiteTexture.glTexture),void 0===a&&(a=!0),t=Math.floor(t),e=Math.floor(e);var h=Math.floor(t+i),l=Math.floor(e+s),u=this.setTexture2D(o),d=c.getTintAppendFloatAlphaAndSwap(n,r),p=0,f=1;a&&(p=1,f=0),this.batchQuad(null,t,e,t,l,h,l,h,e,0,p,1,f,d,d,d,d,0,o,u)},setTexture2D:function(t){return void 0===t&&(t=this.renderer.whiteTexture.glTexture),this.currentUnit=this.renderer.setTexture2D(t),this.currentUnit},bindTexture:function(t,e){void 0===e&&(e=0);var i=this.gl;return i.activeTexture(i.TEXTURE0+e),i.bindTexture(i.TEXTURE_2D,t),this},bindRenderTarget:function(t,e){return this.bindTexture(t.texture,e)},setTime:function(t){return this.set1f(t,this.game.loop.getDuration()),this},setBoolean:function(t,e,i){return void 0===i&&(i=this.currentShader),i.setBoolean(t,e),this},set1f:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set1f(t,e),this},set2f:function(t,e,i,s){return void 0===s&&(s=this.currentShader),s.set2f(t,e,i),this},set3f:function(t,e,i,s,n){return void 0===n&&(n=this.currentShader),n.set3f(t,e,i,s),this},set4f:function(t,e,i,s,n,r){return void 0===r&&(r=this.currentShader),r.set4f(t,e,i,s,n),this},set1fv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set1fv(t,e),this},set2fv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set2fv(t,e),this},set3fv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set3fv(t,e),this},set4fv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set4fv(t,e),this},set1iv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set1iv(t,e),this},set2iv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set2iv(t,e),this},set3iv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set3iv(t,e),this},set4iv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set4iv(t,e),this},set1i:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set1i(t,e),this},set2i:function(t,e,i,s){return void 0===s&&(s=this.currentShader),s.set2i(t,e,i),this},set3i:function(t,e,i,s,n){return void 0===n&&(n=this.currentShader),n.set3i(t,e,i,s),this},set4i:function(t,e,i,s,n,r){return void 0===r&&(r=this.currentShader),r.set4i(t,e,i,s,n),this},setMatrix2fv:function(t,e,i,s){return void 0===s&&(s=this.currentShader),s.setMatrix2fv(t,e,i),this},setMatrix3fv:function(t,e,i,s){return void 0===s&&(s=this.currentShader),s.setMatrix3fv(t,e,i),this},setMatrix4fv:function(t,e,i,s){return void 0===s&&(s=this.currentShader),s.setMatrix4fv(t,e,i),this},destroy:function(){var t;this.emit(o.DESTROY,this);var e=this.shaders;for(t=0;t{var s=i(66458),n=i(89787),r=i(56694),o=i(86459),a=i(6659),h=i(81044),l=i(97081),u=i(28621),c=i(16650),d=i(72283),p=i(35217),f=i(37410),v=i(40444),g=i(38203),m=i(75512),y=i(1217),x=new r({Extends:a,initialize:function(t){a.call(this);var e=t.config,i={alpha:e.transparent,desynchronized:e.desynchronized,depth:!1,antialias:e.antialiasGL,premultipliedAlpha:e.premultipliedAlpha,stencil:!0,failIfMajorPerformanceCaveat:e.failIfMajorPerformanceCaveat,powerPreference:e.powerPreference,preserveDrawingBuffer:e.preserveDrawingBuffer,willReadFrequently:!1};this.config={clearBeforeRender:e.clearBeforeRender,antialias:e.antialias,backgroundColor:e.backgroundColor,contextCreation:i,roundPixels:e.roundPixels,maxTextures:e.maxTextures,maxTextureSize:e.maxTextureSize,batchSize:e.batchSize,maxLights:e.maxLights,mipmapFilter:e.mipmapFilter},this.game=t,this.type=o.WEBGL,this.pipelines=null,this.width=0,this.height=0,this.canvas=t.canvas,this.blendModes=[],this.contextLost=!1,this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92,isFramebuffer:!1,bufferWidth:0,bufferHeight:0},this.currentActiveTexture=0,this.startActiveTexture=0,this.maxTextures=0,this.textureIndexes,this.tempTextures,this.textureZero,this.normalTexture,this.currentFramebuffer=null,this.fboStack=[],this.currentProgram=null,this.currentBlendMode=1/0,this.currentScissorEnabled=!1,this.currentScissor=null,this.scissorStack=[],this.contextLostHandler=d,this.contextRestoredHandler=d,this.gl=null,this.supportedExtensions=null,this.instancedArraysExtension=null,this.vaoExtension=null,this.extensions={},this.glFormats=[],this.compression,this.drawingBufferHeight=0,this.blankTexture=null,this.whiteTexture=null,this.maskCount=0,this.maskStack=[],this.currentMask={mask:null,camera:null},this.currentCameraMask={mask:null,camera:null},this.glFuncMap=null,this.currentType="",this.newType=!1,this.nextTypeMatch=!1,this.finalType=!1,this.mipmapFilter=null,this.textureFlush=0,this.isTextureClean=!1,this.defaultScissor=[0,0,0,0],this.isBooted=!1,this.renderTarget=null,this.projectionMatrix,this.projectionWidth=0,this.projectionHeight=0,this.init(this.config)},init:function(t){var e,i=this.game,s=this.canvas,n=t.backgroundColor;if(!(e=i.config.context?i.config.context:s.getContext("webgl",t.contextCreation)||s.getContext("experimental-webgl",t.contextCreation))||e.isContextLost())throw this.contextLost=!0,new Error("WebGL unsupported");this.gl=e;var r=this;this.contextLostHandler=function(t){r.contextLost=!0,r.game.events.emit(l.CONTEXT_LOST,r),t.preventDefault()},this.contextRestoredHandler=function(){r.contextLost=!1,r.init(r.config),r.game.events.emit(l.CONTEXT_RESTORED,r)},s.addEventListener("webglcontextlost",this.contextLostHandler,!1),s.addEventListener("webglcontextrestored",this.contextRestoredHandler,!1),i.context=e;for(var a=0;a<=27;a++)this.blendModes.push({func:[e.ONE,e.ONE_MINUS_SRC_ALPHA],equation:e.FUNC_ADD});this.blendModes[1].func=[e.ONE,e.DST_ALPHA],this.blendModes[2].func=[e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA],this.blendModes[3].func=[e.ONE,e.ONE_MINUS_SRC_COLOR],this.blendModes[17]={func:[e.ZERO,e.ONE_MINUS_SRC_ALPHA],equation:e.FUNC_REVERSE_SUBTRACT},this.glFormats[0]=e.BYTE,this.glFormats[1]=e.SHORT,this.glFormats[2]=e.UNSIGNED_BYTE,this.glFormats[3]=e.UNSIGNED_SHORT,this.glFormats[4]=e.FLOAT,this.glFuncMap={mat2:{func:e.uniformMatrix2fv,length:1,matrix:!0},mat3:{func:e.uniformMatrix3fv,length:1,matrix:!0},mat4:{func:e.uniformMatrix4fv,length:1,matrix:!0},"1f":{func:e.uniform1f,length:1},"1fv":{func:e.uniform1fv,length:1},"1i":{func:e.uniform1i,length:1},"1iv":{func:e.uniform1iv,length:1},"2f":{func:e.uniform2f,length:2},"2fv":{func:e.uniform2fv,length:1},"2i":{func:e.uniform2i,length:2},"2iv":{func:e.uniform2iv,length:1},"3f":{func:e.uniform3f,length:3},"3fv":{func:e.uniform3fv,length:1},"3i":{func:e.uniform3i,length:3},"3iv":{func:e.uniform3iv,length:1},"4f":{func:e.uniform4f,length:4},"4fv":{func:e.uniform4fv,length:1},"4i":{func:e.uniform4i,length:4},"4iv":{func:e.uniform4iv,length:1}};var h=e.getSupportedExtensions();t.maxTextures&&-1!==t.maxTextures||(t.maxTextures=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),t.maxTextureSize||(t.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE)),this.compression=this.getCompressedTextures(),this.supportedExtensions=h;var u="ANGLE_instanced_arrays";this.instancedArraysExtension=h.indexOf(u)>-1?e.getExtension(u):null;var d="OES_vertex_array_object";this.vaoExtension=h.indexOf(d)>-1?e.getExtension(d):null,e.disable(e.DEPTH_TEST),e.disable(e.CULL_FACE),e.enable(e.BLEND),e.clearColor(n.redGL,n.greenGL,n.blueGL,n.alphaGL),this.mipmapFilter=e[t.mipmapFilter],this.maxTextures=m.checkShaderMax(e,t.maxTextures),this.textureIndexes=[];var f=this.tempTextures;if(Array.isArray(f))for(var v=0;a0&&s>0;if(o&&a){var h=o[0],l=o[1],u=o[2],c=o[3];a=h!==t||l!==e||u!==i||c!==s}a&&(this.flush(),r.scissor(t,n-e-s,i,s))},resetScissor:function(){var t=this.gl;t.enable(t.SCISSOR_TEST);var e=this.currentScissor;if(e){var i=e[0],s=e[1],n=e[2],r=e[3];n>0&&r>0&&t.scissor(i,this.drawingBufferHeight-s-r,n,r)}},popScissor:function(){var t=this.scissorStack;t.pop();var e=t[t.length-1];e&&this.setScissor(e[0],e[1],e[2],e[3]),this.currentScissor=e},hasActiveStencilMask:function(){var t=this.currentMask.mask,e=this.currentCameraMask.mask;return t&&t.isStencil||e&&e.isStencil},resetViewport:function(){var t=this.gl;t.viewport(0,0,this.width,this.height),this.drawingBufferHeight=t.drawingBufferHeight},setBlendMode:function(t,e){void 0===e&&(e=!1);var i=this.gl,s=this.blendModes[t];return!!(e||t!==o.BlendModes.SKIP_CHECK&&this.currentBlendMode!==t)&&(this.flush(),i.enable(i.BLEND),i.blendEquation(s.equation),s.func.length>2?i.blendFuncSeparate(s.func[0],s.func[1],s.func[2],s.func[3]):i.blendFunc(s.func[0],s.func[1]),this.currentBlendMode=t,!0)},addBlendMode:function(t,e){return this.blendModes.push({func:t,equation:e})-1},updateBlendMode:function(t,e,i){return this.blendModes[t]&&(this.blendModes[t].func=e,i&&(this.blendModes[t].equation=i)),this},removeBlendMode:function(t){return t>17&&this.blendModes[t]&&this.blendModes.splice(t,1),this},setBlankTexture:function(){this.setTexture2D(this.blankTexture.glTexture)},setTextureSource:function(t){if(this.pipelines.forceZero())return this.setTextureZero(t.glTexture,!0),0;var e=this.gl,i=this.currentActiveTexture;return t.glIndexCounter0)&&this.pipelines.setMulti().drawFillRect(e,i,s,r,m.getTintFromFloats(o.blueGL,o.greenGL,o.redGL,1),o.alphaGL)},getCurrentStencilMask:function(){var t=null,e=this.maskStack,i=this.currentCameraMask;return e.length>0?t=e[e.length-1]:i.mask&&i.mask.isStencil&&(t=i),t},postRenderCamera:function(t){var e=t.flashEffect,i=t.fadeEffect;if(e.isRunning||i.isRunning||i.isComplete){var s=this.pipelines.setMulti();e.postRenderWebGL(s,m.getTintFromFloats),i.postRenderWebGL(s,m.getTintFromFloats)}t.dirty=!1,this.popScissor(),t.mask&&(this.currentCameraMask.mask=null,t.mask.postRenderWebGL(this,t._maskCamera)),this.pipelines.postBatchCamera(t),t.emit(n.POST_RENDER,t)},preRender:function(){if(!this.contextLost){var t=this.gl;if(t.bindFramebuffer(t.FRAMEBUFFER,null),this.config.clearBeforeRender){var e=this.config.backgroundColor;t.clearColor(e.redGL,e.greenGL,e.blueGL,e.alphaGL),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT|t.STENCIL_BUFFER_BIT)}t.enable(t.SCISSOR_TEST),this.currentScissor=this.defaultScissor,this.scissorStack.length=0,this.scissorStack.push(this.currentScissor),this.game.scene.customViewports&&t.scissor(0,this.drawingBufferHeight-this.height,this.width,this.height),this.currentMask.mask=null,this.currentCameraMask.mask=null,this.maskStack.length=0,this.textureFlush=0,this.emit(h.PRE_RENDER)}},render:function(t,e,i){if(!this.contextLost){var s=e.length;if(this.emit(h.RENDER,t,i),this.preRenderCamera(i),0===s)return this.setBlendMode(o.BlendModes.NORMAL),void this.postRenderCamera(i);this.currentType="";for(var n=this.currentMask,r=0;r0&&(this.startActiveTexture++,this.currentActiveTexture=1)}},snapshot:function(t,e,i){return this.snapshotArea(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight,t,e,i)},snapshotArea:function(t,e,i,s,n,r,o){var a=this.snapshotState;return a.callback=n,a.type=r,a.encoder=o,a.getPixel=!1,a.x=t,a.y=e,a.width=Math.min(i,this.gl.drawingBufferWidth),a.height=Math.min(s,this.gl.drawingBufferHeight),this},snapshotPixel:function(t,e,i){return this.snapshotArea(t,e,1,1,i),this.snapshotState.getPixel=!0,this},snapshotFramebuffer:function(t,e,i,s,n,r,o,a,h,l,u){void 0===n&&(n=!1),void 0===r&&(r=0),void 0===o&&(o=0),void 0===a&&(a=e),void 0===h&&(h=i);var c=this.currentFramebuffer;this.snapshotArea(r,o,a,h,s,l,u);var d=this.snapshotState;return d.getPixel=n,d.isFramebuffer=!0,d.bufferWidth=e,d.bufferHeight=i,this.setFramebuffer(t),y(this.gl,d),this.setFramebuffer(c),d.callback=null,d.isFramebuffer=!1,this},canvasToTexture:function(t,e,i,s){return void 0===i&&(i=!1),void 0===s&&(s=!1),e?this.updateCanvasTexture(t,e,s):this.createCanvasTexture(t,i,s)},createCanvasTexture:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var s=this.gl,n=s.NEAREST,r=s.NEAREST,o=t.width,a=t.height,h=s.CLAMP_TO_EDGE,l=u(o,a);return!e&&l&&(h=s.REPEAT),this.config.antialias&&(n=l?this.mipmapFilter:s.LINEAR,r=s.LINEAR),this.createTexture2D(0,n,r,h,h,s.RGBA,t,o,a,!0,!1,i)},updateCanvasTexture:function(t,e,i){void 0===i&&(i=!1);var s=this.gl,n=t.width,r=t.height;if(n>0&&r>0){s.activeTexture(s.TEXTURE0);var o=s.getParameter(s.TEXTURE_BINDING_2D);s.bindTexture(s.TEXTURE_2D,e),i&&s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!0),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,s.RGBA,s.UNSIGNED_BYTE,t),e.width=n,e.height=r,o&&s.bindTexture(s.TEXTURE_2D,o)}return e},createVideoTexture:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var s=this.gl,n=s.NEAREST,r=s.NEAREST,o=t.videoWidth,a=t.videoHeight,h=s.CLAMP_TO_EDGE,l=u(o,a);return!e&&l&&(h=s.REPEAT),this.config.antialias&&(n=l?this.mipmapFilter:s.LINEAR,r=s.LINEAR),this.createTexture2D(0,n,r,h,h,s.RGBA,t,o,a,!0,!0,i)},updateVideoTexture:function(t,e,i){void 0===i&&(i=!1);var s=this.gl,n=t.videoWidth,r=t.videoHeight;if(n>0&&r>0){s.activeTexture(s.TEXTURE0);var o=s.getParameter(s.TEXTURE_BINDING_2D);s.bindTexture(s.TEXTURE_2D,e),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,i),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,s.RGBA,s.UNSIGNED_BYTE,t),e.width=n,e.height=r,o&&s.bindTexture(s.TEXTURE_2D,o)}return e},setTextureFilter:function(t,e){var i=this.gl,s=[i.LINEAR,i.NEAREST][e];i.activeTexture(i.TEXTURE0);var n=i.getParameter(i.TEXTURE_BINDING_2D);return i.bindTexture(i.TEXTURE_2D,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,s),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,s),n&&i.bindTexture(i.TEXTURE_2D,n),this},getMaxTextureSize:function(){return this.config.maxTextureSize},destroy:function(){this.canvas.removeEventListener("webglcontextlost",this.contextLostHandler,!1),this.canvas.removeEventListener("webglcontextrestored",this.contextRestoredHandler,!1);for(var t=this.gl,e=this.tempTextures,i=0;i{var s=i(56694),n=i(72632),r=i(71402),o=new s({initialize:function(t,e,i,s,n){this.pipeline=t,this.name=e,this.renderer=t.renderer,this.gl=this.renderer.gl,this.fragSrc=s,this.vertSrc=i,this.program=this.renderer.createProgram(i,s),this.attributes,this.vertexComponentCount=0,this.vertexSize=0,this.uniforms={},this.createAttributes(n),this.createUniforms()},createAttributes:function(t){var e=0,i=0,s=[];this.vertexComponentCount=0;for(var o=0;o=0?(e.enableVertexAttribArray(p),e.vertexAttribPointer(p,a,h,d,i,l),o.enabled=!0,o.location=p):-1!==p&&e.disableVertexAttribArray(p)}else u?e.vertexAttribPointer(c,a,h,d,i,l):!u&&c>-1&&(e.disableVertexAttribArray(c),o.location=-1)}return this},createUniforms:function(){var t,e,i,s=this.gl,n=this.program,r=this.uniforms,o=s.getProgramParameter(n,s.ACTIVE_UNIFORMS);for(t=0;t0&&(e=e.substr(0,h),r.hasOwnProperty(e)||null!==(i=s.getUniformLocation(n,e))&&(r[e]={name:e,location:i,value1:null,value2:null,value3:null,value4:null}))}}return this},hasUniform:function(t){return this.uniforms.hasOwnProperty(t)},resetUniform:function(t){var e=this.uniforms[t];return e&&(e.value1=null,e.value2=null,e.value3=null,e.value4=null),this},setUniform1:function(t,e,i,s){var n=this.uniforms[e];return n?((s||n.value1!==i)&&(n.value1=i,this.renderer.setProgram(this.program),t.call(this.gl,n.location,i),this.pipeline.currentShader=this),this):this},setUniform2:function(t,e,i,s,n){var r=this.uniforms[e];return r?((n||r.value1!==i||r.value2!==s)&&(r.value1=i,r.value2=s,this.renderer.setProgram(this.program),t.call(this.gl,r.location,i,s),this.pipeline.currentShader=this),this):this},setUniform3:function(t,e,i,s,n,r){var o=this.uniforms[e];return o?((r||o.value1!==i||o.value2!==s||o.value3!==n)&&(o.value1=i,o.value2=s,o.value3=n,this.renderer.setProgram(this.program),t.call(this.gl,o.location,i,s,n),this.pipeline.currentShader=this),this):this},setUniform4:function(t,e,i,s,n,r,o){var a=this.uniforms[e];return a?((o||a.value1!==i||a.value2!==s||a.value3!==n||a.value4!==r)&&(a.value1=i,a.value2=s,a.value3=n,a.value4=r,this.renderer.setProgram(this.program),t.call(this.gl,a.location,i,s,n,r),this.pipeline.currentShader=this),this):this},setBoolean:function(t,e){return this.setUniform1(this.gl.uniform1i,t,Number(e))},set1f:function(t,e){return this.setUniform1(this.gl.uniform1f,t,e)},set2f:function(t,e,i){return this.setUniform2(this.gl.uniform2f,t,e,i)},set3f:function(t,e,i,s){return this.setUniform3(this.gl.uniform3f,t,e,i,s)},set4f:function(t,e,i,s,n){return this.setUniform4(this.gl.uniform4f,t,e,i,s,n)},set1fv:function(t,e){return this.setUniform1(this.gl.uniform1fv,t,e,!0)},set2fv:function(t,e){return this.setUniform1(this.gl.uniform2fv,t,e,!0)},set3fv:function(t,e){return this.setUniform1(this.gl.uniform3fv,t,e,!0)},set4fv:function(t,e){return this.setUniform1(this.gl.uniform4fv,t,e,!0)},set1iv:function(t,e){return this.setUniform1(this.gl.uniform1iv,t,e,!0)},set2iv:function(t,e){return this.setUniform1(this.gl.uniform2iv,t,e,!0)},set3iv:function(t,e){return this.setUniform1(this.gl.uniform3iv,t,e,!0)},set4iv:function(t,e){return this.setUniform1(this.gl.uniform4iv,t,e,!0)},set1i:function(t,e){return this.setUniform1(this.gl.uniform1i,t,e)},set2i:function(t,e,i){return this.setUniform2(this.gl.uniform2i,t,e,i)},set3i:function(t,e,i,s){return this.setUniform3(this.gl.uniform3i,t,e,i,s)},set4i:function(t,e,i,s,n){return this.setUniform4(this.gl.uniform4i,t,e,i,s,n)},setMatrix2fv:function(t,e,i){return this.setUniform2(this.gl.uniformMatrix2fv,t,e,i,!0)},setMatrix3fv:function(t,e,i){return this.setUniform2(this.gl.uniformMatrix3fv,t,e,i,!0)},setMatrix4fv:function(t,e,i){return this.setUniform2(this.gl.uniformMatrix4fv,t,e,i,!0)},createProgram:function(t,e){void 0===t&&(t=this.vertSrc),void 0===e&&(e=this.fragSrc);var i=this.gl;return this.program&&i.deleteProgram(this.program),this.vertSrc=t,this.fragSrc=e,this.program=this.renderer.createProgram(t,e),this.createUniforms(),this.rebind()},destroy:function(){this.gl.deleteProgram(this.program),this.pipeline=null,this.renderer=null,this.gl=null,this.program=null,this.attributes=null,this.uniforms=null}});t.exports=o},71402:t=>{t.exports={BYTE:{enum:5120,size:1},UNSIGNED_BYTE:{enum:5121,size:1},SHORT:{enum:5122,size:2},UNSIGNED_SHORT:{enum:5123,size:2},INT:{enum:5124,size:4},UNSIGNED_INT:{enum:5125,size:4},FLOAT:{enum:5126,size:4}}},55478:(t,e,i)=>{var s=i(71402),n=i(98611),r={PipelineManager:i(35217),Pipelines:i(62253),RenderTarget:i(37410),Utils:i(75512),WebGLPipeline:i(44775),WebGLRenderer:i(11857),WebGLShader:i(71305)};r=n(!1,r,s),t.exports=r},5583:(t,e,i)=>{var s=i(56694),n=i(72632),r=i(91679),o=i(89053),a=i(71402),h=i(44775),l=new s({Extends:h,initialize:function(t){t.fragShader=n(t,"fragShader",r),t.vertShader=n(t,"vertShader",o),t.batchSize=n(t,"batchSize",1),t.vertices=n(t,"vertices",[-1,1,-1,-7,7,1]),t.attributes=n(t,"attributes",[{name:"inPosition",size:2,type:a.FLOAT}]),h.call(this,t)},boot:function(){h.prototype.boot.call(this),this.set1i("uMainSampler",0),this.set1i("uMaskSampler",1)},resize:function(t,e){h.prototype.resize.call(this,t,e),this.set2f("uResolution",t,e)},beginMask:function(t,e,i){var s=this.gl;if(t.bitmapMask&&s){var n=this.renderer;n.flush(),n.pushFramebuffer(t.mainFramebuffer),s.disable(s.STENCIL_TEST),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT),n.currentCameraMask.mask!==t&&(n.currentMask.mask=t,n.currentMask.camera=i)}},endMask:function(t,e){var i=this.gl,s=this.renderer,n=t.bitmapMask;if(n&&i){s.flush(),s.pushFramebuffer(t.maskFramebuffer),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),s.setBlendMode(0,!0),n.renderWebGL(s,n,e),s.flush(),s.popFramebuffer(),s.popFramebuffer();var r=s.getCurrentStencilMask();r?(i.enable(i.STENCIL_TEST),r.mask.applyStencil(s,r.camera,!0)):s.currentMask.mask=null,s.pipelines.set(this),i.activeTexture(i.TEXTURE1),i.bindTexture(i.TEXTURE_2D,t.maskTexture),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,t.mainTexture),this.set1i("uInvertMaskAlpha",t.invertAlpha),i.drawArrays(this.topology,0,3),s.resetTextures()}}});t.exports=l},66901:(t,e,i)=>{var s=i(56694),n=i(72632),r=i(65045),o=i(77310),a=i(93736),h=i(44775),l=10,u=new a,c=new s({Extends:o,initialize:function(t){l=t.game.renderer.config.maxLights;for(var e=n(t,"fragShader",r),i=[],s=1;s<=l;s++)i.push({name:"lights"+s,fragShader:e.replace("%LIGHT_COUNT%",s.toString())});t.shaders=i,o.call(this,t),this.inverseRotationMatrix=new Float32Array([1,0,0,0,1,0,0,0,1]),this.defaultNormalMap,this.lightsActive=!0},boot:function(){h.prototype.boot.call(this);var t=this.gl,e=t.createTexture();t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,e),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array([127,127,255,255])),this.defaultNormalMap={glTexture:e};for(var i=0;i0&&this.flush();var e=this.inverseRotationMatrix;if(t){var i=-t,s=Math.cos(i),n=Math.sin(i);e[1]=n,e[3]=-n,e[0]=e[4]=s}else e[0]=e[4]=1,e[1]=e[3]=0;this.setMatrix3fv("uInverseRotationMatrix",!1,e),this.currentNormalMapRotation=t}},setTexture2D:function(t,e){var i=this.renderer;void 0===t&&(t=i.tempTextures[0]);var s=this.getNormalMap(e);i.isNewNormalMap(t,s)&&(this.flush(),i.setTextureZero(t),i.setNormalMap(s));var n=e?e.rotation:0;return this.setNormalMapRotation(n),this.currentUnit=0,0},setGameObject:function(t,e){void 0===e&&(e=t.frame);var i=this.renderer,s=e.glTexture,n=this.getNormalMap(t);return i.isNewNormalMap()&&(this.flush(),i.setTextureZero(s),i.setNormalMap(n)),this.setNormalMapRotation(t.rotation),this.currentUnit=0,0},getNormalMap:function(t){var e;return t?t.displayTexture?e=t.displayTexture.dataSource[t.displayFrame.sourceIndex]:t.texture?e=t.texture.dataSource[t.frame.sourceIndex]:t.tileset&&(e=Array.isArray(t.tileset)?t.tileset[0].image.dataSource[0]:t.tileset.image.dataSource[0]):e=this.defaultNormalMap,e||(e=this.defaultNormalMap),e.glTexture},batchSprite:function(t,e,i){this.lightsActive&&o.prototype.batchSprite.call(this,t,e,i)},batchTexture:function(t,e,i,s,n,r,a,h,l,u,c,d,p,f,v,g,m,y,x,T,w,b,E,S,A,_,C,R,M,P,O,L){this.lightsActive&&o.prototype.batchTexture.call(this,t,e,i,s,n,r,a,h,l,u,c,d,p,f,v,g,m,y,x,T,w,b,E,S,A,_,C,R,M,P,O,L)},batchTextureFrame:function(t,e,i,s,n,r,a){this.lightsActive&&o.prototype.batchTextureFrame.call(this,t,e,i,s,n,r,a)}});c.LIGHT_COUNT=l,t.exports=c},77310:(t,e,i)=>{var s=i(56694),n=i(11117),r=i(72632),o=i(53787),a=i(15968),h=i(69360),l=i(75512),u=i(71402),c=i(44775),d=new s({Extends:c,initialize:function(t){var e=t.game.renderer,i=r(t,"fragShader",o);t.fragShader=l.parseFragmentShaderMaxTextures(i,e.maxTextures),t.vertShader=r(t,"vertShader",a),t.attributes=r(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexId"},{name:"inTintEffect"},{name:"inTint",size:4,type:u.UNSIGNED_BYTE,normalized:!0}]),c.call(this,t),this._tempMatrix1=new h,this._tempMatrix2=new h,this._tempMatrix3=new h,this.calcMatrix=new h,this.tempTriangle=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}],this.strokeTint={TL:0,TR:0,BL:0,BR:0},this.fillTint={TL:0,TR:0,BL:0,BR:0},this.currentFrame={u0:0,v0:0,u1:1,v1:1},this.firstQuad=[0,0,0,0,0],this.prevQuad=[0,0,0,0,0],this.polygonCache=[]},boot:function(){c.prototype.boot.call(this),this.currentShader.set1iv("uMainSampler",this.renderer.textureIndexes)},batchSprite:function(t,e,i){this.manager.set(this,t);var s=this._tempMatrix1,n=this._tempMatrix2,r=this._tempMatrix3,o=t.frame,a=o.glTexture,h=o.u0,u=o.v0,c=o.u1,d=o.v1,p=o.x,f=o.y,v=o.cutWidth,g=o.cutHeight,m=o.customPivot,y=t.displayOriginX,x=t.displayOriginY,T=-y+p,w=-x+f;if(t.isCropped){var b=t._crop;b.flipX===t.flipX&&b.flipY===t.flipY||o.updateCropUVs(b,t.flipX,t.flipY),h=b.u0,u=b.v0,c=b.u1,d=b.v1,v=b.width,g=b.height,T=-y+(p=b.x),w=-x+(f=b.y)}var E=1,S=1;t.flipX&&(m||(T+=-o.realWidth+2*y),E=-1),(t.flipY||o.source.isGLTexture&&!a.flipY)&&(m||(w+=-o.realHeight+2*x),S=-1),n.applyITRS(t.x,t.y,t.rotation,t.scaleX*E,t.scaleY*S),s.copyFrom(e.matrix),i?(s.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),n.e=t.x,n.f=t.y):(n.e-=e.scrollX*t.scrollFactorX,n.f-=e.scrollY*t.scrollFactorY),s.multiply(n,r);var A=T+v,_=w+g,C=e.roundPixels,R=r.getXRound(T,w,C),M=r.getXRound(T,_,C),P=r.getXRound(A,_,C),O=r.getXRound(A,w,C),L=r.getYRound(T,w,C),F=r.getYRound(T,_,C),D=r.getYRound(A,_,C),k=r.getYRound(A,w,C),I=l.getTintAppendFloatAlpha,B=e.alpha,N=I(t.tintTopLeft,B*t._alphaTL),Y=I(t.tintTopRight,B*t._alphaTR),U=I(t.tintBottomLeft,B*t._alphaBL),X=I(t.tintBottomRight,B*t._alphaBR);this.shouldFlush(6)&&this.flush();var z=this.setGameObject(t,o);this.manager.preBatch(t),this.batchQuad(t,R,L,M,F,P,D,O,k,h,u,c,d,N,Y,U,X,t.tintFill,a,z),this.manager.postBatch(t)},batchTexture:function(t,e,i,s,n,r,o,a,h,l,u,c,d,p,f,v,g,m,y,x,T,w,b,E,S,A,_,C,R,M,P,O){this.manager.set(this,t);var L=this._tempMatrix1,F=this._tempMatrix2,D=this._tempMatrix3,k=m/i+_,I=y/s+C,B=(m+x)/i+_,N=(y+T)/s+C,Y=o,U=a,X=-v,z=-g;if(t.isCropped){var G=t._crop,W=G.width,V=G.height;Y=W,U=V,o=W,a=V;var H=m=G.x,j=y=G.y;c&&(H=x-G.x-W),d&&(j=T-G.y-V),k=H/i+_,I=j/s+C,B=(H+W)/i+_,N=(j+V)/s+C,X=-v+m,z=-g+y}c&&(Y*=-1,X+=o),(d^=!P&&e.isRenderTexture?1:0)&&(U*=-1,z+=a);var K=X+Y,q=z+U;F.applyITRS(n,r,u,h,l),L.copyFrom(R.matrix),M?(L.multiplyWithOffset(M,-R.scrollX*p,-R.scrollY*f),F.e=n,F.f=r):(F.e-=R.scrollX*p,F.f-=R.scrollY*f),L.multiply(F,D);var Z=R.roundPixels,J=D.getXRound(X,z,Z),Q=D.getYRound(X,z,Z),$=D.getXRound(X,q,Z),tt=D.getYRound(X,q,Z),et=D.getXRound(K,q,Z),it=D.getYRound(K,q,Z),st=D.getXRound(K,z,Z),nt=D.getYRound(K,z,Z);void 0===O&&(O=this.renderer.setTexture2D(e)),t&&this.manager.preBatch(t),this.batchQuad(t,J,Q,$,tt,et,it,st,nt,k,I,B,N,w,b,E,S,A,e,O),t&&this.manager.postBatch(t)},batchTextureFrame:function(t,e,i,s,n,r,o){this.manager.set(this);var a=this._tempMatrix1.copyFrom(r),h=this._tempMatrix2,u=e+t.width,c=i+t.height;o?a.multiply(o,h):h=a;var d=h.getX(e,i),p=h.getY(e,i),f=h.getX(e,c),v=h.getY(e,c),g=h.getX(u,c),m=h.getY(u,c),y=h.getX(u,i),x=h.getY(u,i),T=this.renderer.setTextureSource(t.source);s=l.getTintAppendFloatAlpha(s,n),this.batchQuad(null,d,p,f,v,g,m,y,x,t.u0,t.v0,t.u1,t.v1,s,s,s,s,0,t.glTexture,T)},batchFillRect:function(t,e,i,s,n,r){this.renderer.pipelines.set(this);var o=this.calcMatrix;r&&r.multiply(n,o);var a=t+i,h=e+s,l=o.getX(t,e),u=o.getY(t,e),c=o.getX(t,h),d=o.getY(t,h),p=o.getX(a,h),f=o.getY(a,h),v=o.getX(a,e),g=o.getY(a,e),m=this.fillTint;this.batchQuad(null,l,u,c,d,p,f,v,g,0,0,1,1,m.TL,m.TR,m.BL,m.BR,2)},batchFillTriangle:function(t,e,i,s,n,r,o,a){this.renderer.pipelines.set(this);var h=this.calcMatrix;a&&a.multiply(o,h);var l=h.getX(t,e),u=h.getY(t,e),c=h.getX(i,s),d=h.getY(i,s),p=h.getX(n,r),f=h.getY(n,r),v=this.fillTint;this.batchTri(null,l,u,c,d,p,f,0,0,1,1,v.TL,v.TR,v.BL,2)},batchStrokeTriangle:function(t,e,i,s,n,r,o,a,h){var l=this.tempTriangle;l[0].x=t,l[0].y=e,l[0].width=o,l[1].x=i,l[1].y=s,l[1].width=o,l[2].x=n,l[2].y=r,l[2].width=o,l[3].x=t,l[3].y=e,l[3].width=o,this.batchStrokePath(l,o,!1,a,h)},batchFillPath:function(t,e,i){this.renderer.pipelines.set(this);var s=this.calcMatrix;i&&i.multiply(e,s);for(var r,o,a=t.length,h=this.polygonCache,l=this.fillTint.TL,u=this.fillTint.TR,c=this.fillTint.BL,d=0;d0&&U[4]?this.batchQuad(null,F,D,M,P,U[0],U[1],U[2],U[3],0,0,1,1,I,B,N,Y,2):(X[0]=F,X[1]=D,X[2]=M,X[3]=P,X[4]=1),h&&X[4]?this.batchQuad(null,C,R,O,L,X[0],X[1],X[2],X[3],0,0,1,1,I,B,N,Y,2):(U[0]=C,U[1]=R,U[2]=O,U[3]=L,U[4]=1)}}});t.exports=d},10919:(t,e,i)=>{var s=i(56694),n=i(72632),r=i(83327),o=i(54677),a=i(44775),h=new s({Extends:a,initialize:function(t){t.vertShader=n(t,"vertShader",o),t.fragShader=n(t,"fragShader",r),t.attributes=n(t,"attributes",[{name:"inPosition",size:2},{name:"inLightPosition",size:2},{name:"inLightRadius"},{name:"inLightAttenuation"},{name:"inLightColor",size:4}]),a.call(this,t)},onRender:function(t,e){this.set2f("uResolution",this.width,this.height),this.set1f("uCameraZoom",e.zoom)},batchPointLight:function(t,e,i,s,n,r,o,a,h,l,u,c){var d=t.color,p=t.intensity,f=t.radius,v=t.attenuation,g=d.r*p,m=d.g*p,y=d.b*p,x=e.alpha*t.alpha;this.shouldFlush(6)&&this.flush(),this.batchLightVert(i,s,u,c,f,v,g,m,y,x),this.batchLightVert(n,r,u,c,f,v,g,m,y,x),this.batchLightVert(o,a,u,c,f,v,g,m,y,x),this.batchLightVert(i,s,u,c,f,v,g,m,y,x),this.batchLightVert(o,a,u,c,f,v,g,m,y,x),this.batchLightVert(h,l,u,c,f,v,g,m,y,x)},batchLightVert:function(t,e,i,s,n,r,o,a,h,l){var u=this.vertexViewF32,c=this.vertexCount*this.currentShader.vertexComponentCount-1;u[++c]=t,u[++c]=e,u[++c]=i,u[++c]=s,u[++c]=n,u[++c]=r,u[++c]=o,u[++c]=a,u[++c]=h,u[++c]=l,this.vertexCount++}});t.exports=h},80486:(t,e,i)=>{var s=i(56694),n=i(65246),r=i(72632),o=i(12569),a=i(99365),h=i(44775),l=new s({Extends:h,initialize:function(t){t.renderTarget=r(t,"renderTarget",1),t.fragShader=r(t,"fragShader",o),t.vertShader=r(t,"vertShader",a),t.attributes=r(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]),t.batchSize=1,t.vertices=[-1,-1,0,0,-1,1,0,1,1,1,1,1,-1,-1,0,0,1,1,1,1,1,-1,1,0],h.call(this,t),this.isPostFX=!0,this.gameObject,this.colorMatrix=new n,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2,this.renderer.isBooted&&(this.manager=this.renderer.pipelines,this.boot())},boot:function(){h.prototype.boot.call(this);var t=this.manager.UTILITY_PIPELINE;this.fullFrame1=t.fullFrame1,this.fullFrame2=t.fullFrame2,this.halfFrame1=t.halfFrame1,this.halfFrame2=t.halfFrame2,this.set1i("uMainSampler",0)},onDraw:function(t){this.bindAndDraw(t)},copyFrame:function(t,e,i,s,n){this.manager.copyFrame(t,e,i,s,n)},copyToGame:function(t){this.manager.copyToGame(t)},drawFrame:function(t,e,i){this.manager.drawFrame(t,e,i,this.colorMatrix)},blendFrames:function(t,e,i,s,n){this.manager.blendFrames(t,e,i,s,n)},blendFramesAdditive:function(t,e,i,s,n){this.manager.blendFramesAdditive(t,e,i,s,n)},clearFrame:function(t,e){this.manager.clearFrame(t,e)},blitFrame:function(t,e,i,s,n,r){this.manager.blitFrame(t,e,i,s,n,r)},copyFrameRect:function(t,e,i,s,n,r,o,a){this.manager.copyFrameRect(t,e,i,s,n,r,o,a)},bindAndDraw:function(t,e,i,s,n){void 0===i&&(i=!0),void 0===s&&(s=!0);var r=this.gl,o=this.renderer;this.bind(n),this.set1i("uMainSampler",0),e?(r.viewport(0,0,e.width,e.height),r.bindFramebuffer(r.FRAMEBUFFER,e.framebuffer),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e.texture,0),i&&(s?r.clearColor(0,0,0,0):r.clearColor(0,0,0,1),r.clear(r.COLOR_BUFFER_BIT))):(o.popFramebuffer(!1,!1,!1),o.currentFramebuffer||r.viewport(0,0,o.width,o.height)),r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,t.texture),r.bufferData(r.ARRAY_BUFFER,this.vertexData,r.STATIC_DRAW),r.drawArrays(r.TRIANGLES,0,6),e?(r.bindTexture(r.TEXTURE_2D,null),r.bindFramebuffer(r.FRAMEBUFFER,null)):o.resetTextures()}});t.exports=l},21213:(t,e,i)=>{var s=i(56694),n=i(72632),r=i(77310),o=new s({Extends:r,initialize:function(t){t.topology=5,t.batchSize=n(t,"batchSize",256),r.call(this,t)}});t.exports=o},51212:(t,e,i)=>{var s=i(56694),n=i(72632),r=i(77310),o=i(85060),a=i(18166),h=i(44775),l=new s({Extends:r,initialize:function(t){t.fragShader=n(t,"fragShader",o),t.vertShader=n(t,"vertShader",a),t.forceZero=!0,r.call(this,t)},boot:function(){h.prototype.boot.call(this),this.set1i("uMainSampler",0)}});t.exports=l},38964:(t,e,i)=>{var s=i(95723),n=i(79993),r=i(56694),o=i(72632),a=i(77310),h=i(12569),l=i(74118),u=i(37410),c=i(85060),d=i(18166),p=i(69360),f=i(71402),v=i(44775),g=new r({Extends:v,initialize:function(t){t.attributes=o(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexId"},{name:"inTintEffect"},{name:"inTint",size:4,type:f.UNSIGNED_BYTE,normalized:!0}]);var e=o(t,"fragShader",h),i=o(t,"vertShader",d),s=o(t,"drawShader",h),n=[{name:"DrawSprite",fragShader:c,vertShader:d},{name:"CopySprite",fragShader:e,vertShader:i},{name:"DrawGame",fragShader:s,vertShader:d}],r=o(t,"shaders",[]);t.shaders=n.concat(r),t.vertShader||(t.vertShader=i),t.batchSize=1,v.call(this,t),this.isSpriteFX=!0,this._tempMatrix1=new p,this._tempMatrix2=new p,this._tempMatrix3=new p,this.drawSpriteShader,this.copyShader,this.gameShader,this.quadVertexData,this.quadVertexBuffer,this.quadVertexViewF32,this.spriteBounds=new l,this.targetBounds=new l,this.fsTarget,this.tempSprite,this.renderer.isBooted&&(this.manager=this.renderer.pipelines,this.boot())},boot:function(){v.prototype.boot.call(this);var t=this.shaders,e=this.renderer;this.drawSpriteShader=t[0],this.copyShader=t[1],this.gameShader=t[2],this.fsTarget=new u(e,e.width,e.height,1,0,!0,!0),this.renderTargets=this.manager.renderTargets.concat(this.fsTarget);var i=new ArrayBuffer(168);this.quadVertexData=i,this.quadVertexViewF32=new Float32Array(i),this.quadVertexBuffer=e.createVertexBuffer(i,this.gl.STATIC_DRAW),this.onResize(e.width,e.height),this.currentShader=this.copyShader},onResize:function(t,e){var i=this.quadVertexViewF32;i[1]=e,i[22]=e,i[14]=t,i[28]=t,i[35]=t,i[36]=e},batchSprite:function(t,e,i){a.prototype.batchSprite.call(this,t,e,i)},batchTexture:function(t,e,i,s,n,r,o,h,l,u,c,d,p,f,v,g,m,y,x,T,w,b,E,S,A,_,C,R,M,P,O,L){a.prototype.batchTexture.call(this,t,e,i,s,n,r,o,h,l,u,c,d,p,f,v,g,m,y,x,T,w,b,E,S,A,_,C,R,M,P,O,L)},batchQuad:function(t,e,i,s,r,o,a,h,l,u,c,d,p,f,v,g,m,y,x){var T=Math.min(e,s,o,h),w=Math.min(i,r,a,l),b=Math.max(e,s,o,h)-T,E=Math.max(i,r,a,l)-w,S=this.spriteBounds.setTo(T,w,b,E),A=t.fxPadding,_=b+2*A,C=E+2*A,R=Math.abs(Math.max(_,C)),M=this.manager.getRenderTarget(R),P=this.targetBounds.setTo(0,0,M.width,M.height);n(P,S.centerX,S.centerY),this.tempSprite=t;var O=this.gl,L=this.renderer;this.setShader(this.drawSpriteShader),this.set1i("uMainSampler",0),this.flipProjectionMatrix(!0),this.onDrawSprite(t,M),t.onFX(this);var F=this.fsTarget;return L.setTextureZero(x),O.viewport(0,0,L.width,L.height),O.bindFramebuffer(O.FRAMEBUFFER,F.framebuffer),O.framebufferTexture2D(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_2D,F.texture,0),O.clearColor(0,0,0,0),O.clear(O.COLOR_BUFFER_BIT),this.batchVert(e,i,u,c,0,y,f),this.batchVert(s,r,u,p,0,y,g),this.batchVert(o,a,d,p,0,y,m),this.batchVert(e,i,u,c,0,y,f),this.batchVert(o,a,d,p,0,y,m),this.batchVert(h,l,d,c,0,y,v),this.flush(),this.flipProjectionMatrix(!1),L.clearTextureZero(),O.activeTexture(O.TEXTURE0),O.bindTexture(O.TEXTURE_2D,M.texture),O.copyTexSubImage2D(O.TEXTURE_2D,0,0,0,P.x,P.y,P.width,P.height),O.bindFramebuffer(O.FRAMEBUFFER,null),O.bindTexture(O.TEXTURE_2D,null),this.onBatch(t),this.currentShader=this.copyShader,this.onDraw(M,this.manager.getSwapRenderTarget(),this.manager.getAltSwapRenderTarget()),!0},onDrawSprite:function(){},onCopySprite:function(){},copySprite:function(t,e,i,n,r,o){void 0===i&&(i=!0),void 0===n&&(n=!0),void 0===r&&(r=!1),void 0===o&&(o=this.copyShader);var a=this.gl,h=this.tempSprite;this.currentShader=o;var l=this.setVertexBuffer(this.quadVertexBuffer);if(o.bind(l,!1),this.set1i("uMainSampler",0),h.onFXCopy(this),this.onCopySprite(t,e,h),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,t.texture),t.height>e.height)a.viewport(0,0,t.width,t.height),this.setTargetUVs(t,e);else{var u=e.height-t.height;a.viewport(0,u,t.width,t.height),this.resetUVs()}if(a.bindFramebuffer(a.FRAMEBUFFER,e.framebuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,e.texture,0),i&&(a.clearColor(0,0,0,Number(!n)),a.clear(a.COLOR_BUFFER_BIT)),r){var c=this.renderer.currentBlendMode;this.renderer.setBlendMode(s.ERASE)}a.bufferData(a.ARRAY_BUFFER,this.quadVertexData,a.STATIC_DRAW),a.drawArrays(a.TRIANGLES,0,6),r&&this.renderer.setBlendMode(c),a.bindFramebuffer(a.FRAMEBUFFER,null)},blendFrames:function(t,e,i,s,n){this.manager.blendFrames(t,e,i,s,n)},blendFramesAdditive:function(t,e,i,s,n){this.manager.blendFramesAdditive(t,e,i,s,n)},drawToGame:function(t){this.currentShader=null,this.setShader(this.copyShader),this.bindAndDraw(t)},copyToGame:function(t){this.currentShader=null,this.setShader(this.gameShader),this.bindAndDraw(t)},bindAndDraw:function(t){var e=this.gl,i=this.renderer;this.set1i("uMainSampler",0),i.popFramebuffer(!1,!1,!1),i.currentFramebuffer||e.viewport(0,0,i.width,i.height),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t.texture);var s=this._tempMatrix1.loadIdentity(),n=this.targetBounds.x,r=this.targetBounds.y,o=n+t.width,a=r+t.height,h=s.getX(n,r),l=s.getX(n,a),u=s.getX(o,a),c=s.getX(o,r),d=s.getY(n,r),p=s.getY(n,a),f=s.getY(o,a),v=s.getY(o,r);this.batchVert(h,d,0,0,0,0,16777215),this.batchVert(l,p,0,1,0,0,16777215),this.batchVert(u,f,1,1,0,0,16777215),this.batchVert(h,d,0,0,0,0,16777215),this.batchVert(u,f,1,1,0,0,16777215),this.batchVert(c,v,1,0,0,0,16777215),this.flush(),i.resetTextures(),this.tempSprite=null},onDraw:function(t){this.drawToGame(t)},setUVs:function(t,e,i,s,n,r,o,a){var h=this.quadVertexViewF32;h[2]=t,h[3]=e,h[9]=i,h[10]=s,h[16]=n,h[17]=r,h[23]=t,h[24]=e,h[30]=n,h[31]=r,h[37]=o,h[38]=a},setTargetUVs:function(t,e){var i=e.height/t.height;i=i>.5?.5-(i-.5):.5-i+.5,this.setUVs(0,i,0,1+i,1,1+i,1,i)},resetUVs:function(){this.setUVs(0,0,0,1,1,1,1,0)},destroy:function(){this.gl.deleteBuffer(this.quadVertexBuffer),this._tempMatrix1.destroy(),this._tempMatrix2.destroy(),this._tempMatrix3.destroy(),this._tempMatrix1=null,this._tempMatrix1=null,this._tempMatrix1=null,this.drawSpriteShader=null,this.copyShader=null,this.gameShader=null,this.quadVertexData=null,this.quadVertexBuffer=null,this.quadVertexViewF32=null,this.fsTarget=null,this.tempSprite=null,v.prototype.destroy.call(this)}});t.exports=g},60848:(t,e,i)=>{var s=i(2529),n=i(95723),r=i(56694),o=i(65246),a=i(37486),h=i(79060),l=i(72632),u=i(98921),c=i(99365),d=i(44775),p=new r({Extends:d,initialize:function(t){t.renderTarget=l(t,"renderTarget",[{scale:1},{scale:1},{scale:.5},{scale:.5}]),t.vertShader=l(t,"vertShader",c),t.shaders=l(t,"shaders",[{name:"Copy",fragShader:h},{name:"AddBlend",fragShader:s},{name:"LinearBlend",fragShader:u},{name:"ColorMatrix",fragShader:a}]),t.attributes=l(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]),t.vertices=[-1,-1,0,0,-1,1,0,1,1,1,1,1,-1,-1,0,0,1,1,1,1,1,-1,1,0],t.batchSize=1,d.call(this,t),this.colorMatrix=new o,this.copyShader,this.addShader,this.linearShader,this.colorMatrixShader,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2},boot:function(){d.prototype.boot.call(this);var t=this.shaders,e=this.renderTargets;this.copyShader=t[0],this.addShader=t[1],this.linearShader=t[2],this.colorMatrixShader=t[3],this.fullFrame1=e[0],this.fullFrame2=e[1],this.halfFrame1=e[2],this.halfFrame2=e[3]},copyFrame:function(t,e,i,s,n){void 0===i&&(i=1),void 0===s&&(s=!0),void 0===n&&(n=!0);var r=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",i),r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,t.texture),e?(r.viewport(0,0,e.width,e.height),r.bindFramebuffer(r.FRAMEBUFFER,e.framebuffer),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e.texture,0)):r.viewport(0,0,t.width,t.height),s&&(n?r.clearColor(0,0,0,0):r.clearColor(0,0,0,1),r.clear(r.COLOR_BUFFER_BIT)),r.bufferData(r.ARRAY_BUFFER,this.vertexData,r.STATIC_DRAW),r.drawArrays(r.TRIANGLES,0,6),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindTexture(r.TEXTURE_2D,null)},blitFrame:function(t,e,i,s,r,o,a){void 0===i&&(i=1),void 0===s&&(s=!0),void 0===r&&(r=!0),void 0===o&&(o=!1),void 0===a&&(a=!1);var h=this.gl;if(this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",i),h.activeTexture(h.TEXTURE0),h.bindTexture(h.TEXTURE_2D,t.texture),t.height>e.height)h.viewport(0,0,t.width,t.height),this.setTargetUVs(t,e);else{var l=e.height-t.height;h.viewport(0,l,t.width,t.height)}if(h.bindFramebuffer(h.FRAMEBUFFER,e.framebuffer),h.framebufferTexture2D(h.FRAMEBUFFER,h.COLOR_ATTACHMENT0,h.TEXTURE_2D,e.texture,0),s&&(r?h.clearColor(0,0,0,0):h.clearColor(0,0,0,1),h.clear(h.COLOR_BUFFER_BIT)),o){var u=this.renderer.currentBlendMode;this.renderer.setBlendMode(n.ERASE)}a&&this.flipY(),h.bufferData(h.ARRAY_BUFFER,this.vertexData,h.STATIC_DRAW),h.drawArrays(h.TRIANGLES,0,6),o&&this.renderer.setBlendMode(u),h.bindFramebuffer(h.FRAMEBUFFER,null),h.bindTexture(h.TEXTURE_2D,null),this.resetUVs()},copyFrameRect:function(t,e,i,s,n,r,o,a){void 0===o&&(o=!0),void 0===a&&(a=!0);var h=this.gl;h.bindFramebuffer(h.FRAMEBUFFER,t.framebuffer),h.framebufferTexture2D(h.FRAMEBUFFER,h.COLOR_ATTACHMENT0,h.TEXTURE_2D,t.texture,0),o&&(a?h.clearColor(0,0,0,0):h.clearColor(0,0,0,1),h.clear(h.COLOR_BUFFER_BIT)),h.activeTexture(h.TEXTURE0),h.bindTexture(h.TEXTURE_2D,e.texture),h.copyTexSubImage2D(h.TEXTURE_2D,0,0,0,i,s,n,r),h.bindFramebuffer(h.FRAMEBUFFER,null),h.bindTexture(h.TEXTURE_2D,null)},copyToGame:function(t){var e=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",1),this.renderer.popFramebuffer(),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t.texture),e.bufferData(e.ARRAY_BUFFER,this.vertexData,e.STATIC_DRAW),e.drawArrays(e.TRIANGLES,0,6),this.renderer.resetTextures()},drawFrame:function(t,e,i,s){void 0===i&&(i=!0),void 0===s&&(s=this.colorMatrix);var n=this.gl;this.setShader(this.colorMatrixShader),this.set1i("uMainSampler",0),this.set1fv("uColorMatrix",s.getData()),this.set1f("uAlpha",s.alpha),n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,t.texture),e?(n.viewport(0,0,e.width,e.height),n.bindFramebuffer(n.FRAMEBUFFER,e.framebuffer),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,e.texture,0)):n.viewport(0,0,t.width,t.height),i?n.clearColor(0,0,0,0):n.clearColor(0,0,0,1),n.clear(n.COLOR_BUFFER_BIT),n.bufferData(n.ARRAY_BUFFER,this.vertexData,n.STATIC_DRAW),n.drawArrays(n.TRIANGLES,0,6),n.bindFramebuffer(n.FRAMEBUFFER,null),n.bindTexture(n.TEXTURE_2D,null)},blendFrames:function(t,e,i,s,n,r){void 0===s&&(s=1),void 0===n&&(n=!0),void 0===r&&(r=this.linearShader);var o=this.gl;this.setShader(r),this.set1i("uMainSampler1",0),this.set1i("uMainSampler2",1),this.set1f("uStrength",s),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,t.texture),o.activeTexture(o.TEXTURE1),o.bindTexture(o.TEXTURE_2D,e.texture),i?(o.bindFramebuffer(o.FRAMEBUFFER,i.framebuffer),o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,i.texture,0),o.viewport(0,0,i.width,i.height)):o.viewport(0,0,t.width,t.height),n?o.clearColor(0,0,0,0):o.clearColor(0,0,0,1),o.clear(o.COLOR_BUFFER_BIT),o.bufferData(o.ARRAY_BUFFER,this.vertexData,o.STATIC_DRAW),o.drawArrays(o.TRIANGLES,0,6),o.bindFramebuffer(o.FRAMEBUFFER,null),o.bindTexture(o.TEXTURE_2D,null)},blendFramesAdditive:function(t,e,i,s,n){this.blendFrames(t,e,i,s,n,this.addShader)},clearFrame:function(t,e){void 0===e&&(e=!0);var i=this.gl;i.viewport(0,0,t.width,t.height),i.bindFramebuffer(i.FRAMEBUFFER,t.framebuffer),e?i.clearColor(0,0,0,0):i.clearColor(0,0,0,1),i.clear(i.COLOR_BUFFER_BIT);var s=this.renderer.currentFramebuffer;i.bindFramebuffer(i.FRAMEBUFFER,s)},setUVs:function(t,e,i,s,n,r,o,a){var h=this.vertexViewF32;h[2]=t,h[3]=e,h[6]=i,h[7]=s,h[10]=n,h[11]=r,h[14]=t,h[15]=e,h[18]=n,h[19]=r,h[22]=o,h[23]=a},setTargetUVs:function(t,e){var i=e.height/t.height;i=i>.5?.5-(i-.5):.5-i+.5,this.setUVs(0,i,0,1+i,1,1+i,1,i)},flipX:function(){this.setUVs(1,0,1,1,0,1,0,0)},flipY:function(){this.setUVs(0,1,0,0,1,0,1,1)},resetUVs:function(){this.setUVs(0,0,0,1,1,1,1,0)}});t.exports=p},65641:t=>{t.exports={BITMAPMASK_PIPELINE:"BitmapMaskPipeline",LIGHT_PIPELINE:"Light2D",POINTLIGHT_PIPELINE:"PointLightPipeline",SINGLE_PIPELINE:"SinglePipeline",MULTI_PIPELINE:"MultiPipeline",ROPE_PIPELINE:"RopePipeline",GRAPHICS_PIPELINE:"GraphicsPipeline",POSTFX_PIPELINE:"PostFXPipeline",UTILITY_PIPELINE:"UtilityPipeline"}},68726:t=>{t.exports="pipelineafterflush"},67186:t=>{t.exports="pipelinebeforeflush"},22709:t=>{t.exports="pipelinebind"},74469:t=>{t.exports="pipelineboot"},93953:t=>{t.exports="pipelinedestroy"},51687:t=>{t.exports="pipelinerebind"},25034:t=>{t.exports="pipelineresize"},18970:(t,e,i)=>{t.exports={AFTER_FLUSH:i(68726),BEFORE_FLUSH:i(67186),BIND:i(22709),BOOT:i(74469),DESTROY:i(93953),REBIND:i(51687),RESIZE:i(25034)}},62253:(t,e,i)=>{var s=i(65641),n=i(98611),r={BitmapMaskPipeline:i(5583),Events:i(18970),LightPipeline:i(66901),MultiPipeline:i(77310),PointLightPipeline:i(10919),PostFXPipeline:i(80486),RopePipeline:i(21213),SinglePipeline:i(51212),SpriteFXPipeline:i(38964),UtilityPipeline:i(60848)};r=n(!1,r,s),t.exports=r},2529:t=>{t.exports=["#define SHADER_NAME PHASER_ADD_BLEND_FS","","precision mediump float;","","uniform sampler2D uMainSampler1;","uniform sampler2D uMainSampler2;","uniform float uStrength;","","varying vec2 outTexCoord;","","void main ()","{"," vec4 frame1 = texture2D(uMainSampler1, outTexCoord);"," vec4 frame2 = texture2D(uMainSampler2, outTexCoord);",""," gl_FragColor = frame1 + frame2 * uStrength;","}",""].join("\n")},91679:t=>{t.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_FS","","precision mediump float;","","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uMaskSampler;","uniform bool uInvertMaskAlpha;","","void main ()","{"," vec2 uv = gl_FragCoord.xy / uResolution;",""," vec4 mainColor = texture2D(uMainSampler, uv);"," vec4 maskColor = texture2D(uMaskSampler, uv);",""," if (!uInvertMaskAlpha)"," {"," mainColor *= maskColor.a;"," }"," else"," {"," mainColor *= (1.0 - maskColor.a);"," }",""," gl_FragColor = mainColor;","}",""].join("\n")},89053:t=>{t.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_VS","","precision mediump float;","","attribute vec2 inPosition;","","void main ()","{"," gl_Position = vec4(inPosition, 0.0, 1.0);","}",""].join("\n")},37486:t=>{t.exports=["#define SHADER_NAME PHASER_COLORMATRIX_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","uniform float uColorMatrix[20];","uniform float uAlpha;","","varying vec2 outTexCoord;","","void main ()","{"," vec4 c = texture2D(uMainSampler, outTexCoord);",""," if (uAlpha == 0.0)"," {"," gl_FragColor = c;",""," return;"," }",""," if (c.a > 0.0)"," {"," c.rgb /= c.a;"," }",""," vec4 result;",""," result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4];"," result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9];"," result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14];"," result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19];",""," vec3 rgb = mix(c.rgb, result.rgb, uAlpha);",""," rgb *= result.a;",""," gl_FragColor = vec4(rgb, result.a);","}",""].join("\n")},79060:t=>{t.exports=["#define SHADER_NAME PHASER_COPY_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","uniform float uBrightness;","","varying vec2 outTexCoord;","","void main ()","{"," gl_FragColor = texture2D(uMainSampler, outTexCoord) * uBrightness;","}",""].join("\n")},65045:t=>{t.exports=["#define SHADER_NAME PHASER_LIGHT_FS","","precision mediump float;","","struct Light","{"," vec2 position;"," vec3 color;"," float intensity;"," float radius;","};","","const int kMaxLights = %LIGHT_COUNT%;","","uniform vec4 uCamera; /* x, y, rotation, zoom */","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uNormSampler;","uniform vec3 uAmbientLightColor;","uniform Light uLights[kMaxLights];","uniform mat3 uInverseRotationMatrix;","","varying vec2 outTexCoord;","varying vec4 outTint;","","void main()","{"," vec3 finalColor = vec3(0.0, 0.0, 0.0);"," vec4 color = texture2D(uMainSampler, outTexCoord) * vec4(outTint.bgr * outTint.a, outTint.a);"," vec3 normalMap = texture2D(uNormSampler, outTexCoord).rgb;"," vec3 normal = normalize(uInverseRotationMatrix * vec3(normalMap * 2.0 - 1.0));"," vec2 res = vec2(min(uResolution.x, uResolution.y)) * uCamera.w;",""," for (int index = 0; index < kMaxLights; ++index)"," {"," Light light = uLights[index];"," vec3 lightDir = vec3((light.position.xy / res) - (gl_FragCoord.xy / res), 0.1);"," vec3 lightNormal = normalize(lightDir);"," float distToSurf = length(lightDir) * uCamera.w;"," float diffuseFactor = max(dot(normal, lightNormal), 0.0);"," float radius = (light.radius / res.x * uCamera.w) * uCamera.w;"," float attenuation = clamp(1.0 - distToSurf * distToSurf / (radius * radius), 0.0, 1.0);"," vec3 diffuse = light.color * diffuseFactor;"," finalColor += (attenuation * diffuse) * light.intensity;"," }",""," vec4 colorOutput = vec4(uAmbientLightColor + finalColor, 1.0);",""," gl_FragColor = color * vec4(colorOutput.rgb * colorOutput.a, colorOutput.a);","}",""].join("\n")},98921:t=>{t.exports=["#define SHADER_NAME PHASER_LINEAR_BLEND_FS","","precision mediump float;","","uniform sampler2D uMainSampler1;","uniform sampler2D uMainSampler2;","uniform float uStrength;","","varying vec2 outTexCoord;","","void main ()","{"," vec4 frame1 = texture2D(uMainSampler1, outTexCoord);"," vec4 frame2 = texture2D(uMainSampler2, outTexCoord);",""," gl_FragColor = mix(frame1, frame2 * uStrength, 0.5);","}",""].join("\n")},53787:t=>{t.exports=["#define SHADER_NAME PHASER_MULTI_V2_FS","#define numTextures %count%","","precision highp float;","","uniform sampler2D uMainSampler[%count%];","","varying vec2 outTexCoord;","varying float outTexId;","varying float outTintEffect;","varying vec4 outTint;","","%getSampler%","","void main ()","{"," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);",""," vec4 texture = getSampler(int(outTexId), outTexCoord);",""," // Multiply texture tint"," vec4 color = texture * texel;",""," if (outTintEffect == 1.0)"," {"," // Solid color + texture alpha"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," // Solid color, no texture"," color = texel;"," }",""," gl_FragColor = color;","}",""].join("\n")},15968:t=>{t.exports=["#define SHADER_NAME PHASER_MULTI_VS","","precision highp float;","","uniform mat4 uProjectionMatrix;","","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexId;","attribute float inTintEffect;","attribute vec4 inTint;","","varying vec2 outTexCoord;","varying float outTexId;","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);",""," outTexCoord = inTexCoord;"," outTexId = inTexId;"," outTint = inTint;"," outTintEffect = inTintEffect;","}",""].join("\n")},83327:t=>{t.exports=["#define SHADER_NAME PHASER_POINTLIGHT_FS","","precision mediump float;","","uniform vec2 uResolution;","uniform float uCameraZoom;","","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","","void main ()","{"," vec2 center = (lightPosition.xy + 1.0) * (uResolution.xy * 0.5);",""," float distToSurf = length(center - gl_FragCoord.xy);",""," float radius = 1.0 - distToSurf / (lightRadius * uCameraZoom);",""," float intensity = smoothstep(0.0, 1.0, radius * lightAttenuation);",""," vec4 color = vec4(intensity, intensity, intensity, 0.0) * lightColor;",""," gl_FragColor = vec4(color.rgb * lightColor.a, color.a);","}",""].join("\n")},54677:t=>{t.exports=["#define SHADER_NAME PHASER_POINTLIGHT_VS","","precision mediump float;","","uniform mat4 uProjectionMatrix;","","attribute vec2 inPosition;","attribute vec2 inLightPosition;","attribute vec4 inLightColor;","attribute float inLightRadius;","attribute float inLightAttenuation;","","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","","void main ()","{"," lightColor = inLightColor;"," lightRadius = inLightRadius;"," lightAttenuation = inLightAttenuation;"," lightPosition = uProjectionMatrix * vec4(inLightPosition, 1.0, 1.0);",""," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);","}",""].join("\n")},12569:t=>{t.exports=["#define SHADER_NAME PHASER_POSTFX_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","","varying vec2 outTexCoord;","","void main ()","{"," gl_FragColor = texture2D(uMainSampler, outTexCoord);","}",""].join("\n")},99365:t=>{t.exports=["#define SHADER_NAME PHASER_QUAD_VS","","precision mediump float;","","attribute vec2 inPosition;","attribute vec2 inTexCoord;","","varying vec2 outFragCoord;","varying vec2 outTexCoord;","","void main ()","{"," outFragCoord = inPosition.xy * 0.5 + 0.5;"," outTexCoord = inTexCoord;",""," gl_Position = vec4(inPosition, 0, 1);","}",""].join("\n")},85060:t=>{t.exports=["#define SHADER_NAME PHASER_SINGLE_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);",""," // Multiply texture tint"," vec4 color = texture * texel;",""," if (outTintEffect == 1.0)"," {"," // Solid color + texture alpha"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," // Solid color, no texture"," color = texel;"," }",""," gl_FragColor = color;","}",""].join("\n")},18166:t=>{t.exports=["#define SHADER_NAME PHASER_SINGLE_VS","","precision mediump float;","","uniform mat4 uProjectionMatrix;","","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexId;","attribute float inTintEffect;","attribute vec4 inTint;","","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);",""," outTexCoord = inTexCoord;"," outTint = inTint;"," outTintEffect = inTintEffect;","}",""].join("\n")},756:(t,e,i)=>{var s=i(55301),n=i(56694),r=i(6659),o=i(40444),a=i(97081),h=i(74181),l=i(2893),u=i(9229),c=i(72283),d=i(74118),p=i(90881),f=i(84314),v=i(93736),g=new n({Extends:r,initialize:function(t){r.call(this),this.game=t,this.canvas,this.canvasBounds=new d,this.parent=null,this.parentIsWindow=!1,this.parentSize=new p,this.gameSize=new p,this.baseSize=new p,this.displaySize=new p,this.scaleMode=s.SCALE_MODE.NONE,this.zoom=1,this._resetZoom=!1,this.displayScale=new v(1,1),this.autoRound=!1,this.autoCenter=s.CENTER.NO_CENTER,this.orientation=s.ORIENTATION.LANDSCAPE,this.fullscreen,this.fullscreenTarget=null,this._createdFullscreenTarget=!1,this.dirty=!1,this.resizeInterval=500,this._lastCheck=0,this._checkOrientation=!1,this.listeners={orientationChange:c,windowResize:c,fullScreenChange:c,fullScreenError:c}},preBoot:function(){this.parseConfig(this.game.config),this.game.events.once(a.BOOT,this.boot,this)},boot:function(){var t=this.game;this.canvas=t.canvas,this.fullscreen=t.device.fullscreen,this.scaleMode!==s.SCALE_MODE.RESIZE&&this.displaySize.setAspectMode(this.scaleMode),this.scaleMode===s.SCALE_MODE.NONE?this.resize(this.width,this.height):(this.getParentBounds(),this.parentSize.width>0&&this.parentSize.height>0&&this.displaySize.setParent(this.parentSize),this.refresh()),t.events.on(a.PRE_STEP,this.step,this),t.events.once(a.READY,this.refresh,this),t.events.once(a.DESTROY,this.destroy,this),this.startListeners()},parseConfig:function(t){this.getParent(t),this.getParentBounds();var e=t.width,i=t.height,n=t.scaleMode,r=t.zoom,o=t.autoRound;if("string"==typeof e){var a=this.parentSize.width;0===a&&(a=window.innerWidth);var h=parseInt(e,10)/100;e=Math.floor(a*h)}if("string"==typeof i){var l=this.parentSize.height;0===l&&(l=window.innerHeight);var c=parseInt(i,10)/100;i=Math.floor(l*c)}this.scaleMode=n,this.autoRound=o,this.autoCenter=t.autoCenter,this.resizeInterval=t.resizeInterval,o&&(e=Math.floor(e),i=Math.floor(i)),this.gameSize.setSize(e,i),r===s.ZOOM.MAX_ZOOM&&(r=this.getMaxZoom()),this.zoom=r,1!==r&&(this._resetZoom=!0),this.baseSize.setSize(e,i),o&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),t.minWidth>0&&this.displaySize.setMin(t.minWidth*r,t.minHeight*r),t.maxWidth>0&&this.displaySize.setMax(t.maxWidth*r,t.maxHeight*r),this.displaySize.setSize(e,i),this.orientation=u(e,i)},getParent:function(t){var e=t.parent;if(null!==e){if(this.parent=l(e),this.parentIsWindow=this.parent===document.body,t.expandParent&&t.scaleMode!==s.SCALE_MODE.NONE){var i=this.parent.getBoundingClientRect();(this.parentIsWindow||0===i.height)&&(document.documentElement.style.height="100%",document.body.style.height="100%",i=this.parent.getBoundingClientRect(),this.parentIsWindow||0!==i.height||(this.parent.style.overflow="hidden",this.parent.style.width="100%",this.parent.style.height="100%"))}t.fullscreenTarget&&!this.fullscreenTarget&&(this.fullscreenTarget=l(t.fullscreenTarget))}},getParentBounds:function(){if(!this.parent)return!1;var t=this.parentSize,e=this.parent.getBoundingClientRect();this.parentIsWindow&&this.game.device.os.iOS&&(e.height=h(!0));var i=e.width,s=e.height;if(t.width!==i||t.height!==s)return t.setSize(i,s),!0;if(this.canvas){var n=this.canvasBounds,r=this.canvas.getBoundingClientRect();if(r.x!==n.x||r.y!==n.y)return!0}return!1},lockOrientation:function(t){var e=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation;return!!e&&e.call(screen,t)},setParentSize:function(t,e){return this.parentSize.setSize(t,e),this.refresh()},setGameSize:function(t,e){var i=this.autoRound;i&&(t=Math.floor(t),e=Math.floor(e));var s=this.width,n=this.height;return this.gameSize.resize(t,e),this.baseSize.resize(t,e),i&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setAspectRatio(t/e),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height,this.refresh(s,n)},resize:function(t,e){var i=this.zoom,s=this.autoRound;s&&(t=Math.floor(t),e=Math.floor(e));var n=this.width,r=this.height;this.gameSize.resize(t,e),this.baseSize.resize(t,e),s&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(t*i,e*i),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height;var o=this.canvas.style,a=t*i,h=e*i;return s&&(a=Math.floor(a),h=Math.floor(h)),a===t&&h===e||(o.width=a+"px",o.height=h+"px"),this.refresh(n,r)},setZoom:function(t){return this.zoom=t,this._resetZoom=!0,this.refresh()},setMaxZoom:function(){return this.zoom=this.getMaxZoom(),this._resetZoom=!0,this.refresh()},refresh:function(t,e){void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.updateScale(),this.updateBounds(),this.updateOrientation(),this.displayScale.set(this.baseSize.width/this.canvasBounds.width,this.baseSize.height/this.canvasBounds.height);var i=this.game.domContainer;if(i){this.baseSize.setCSS(i);var s=this.canvas.style,n=i.style;n.transform="scale("+this.displaySize.width/this.baseSize.width+","+this.displaySize.height/this.baseSize.height+")",n.marginLeft=s.marginLeft,n.marginTop=s.marginTop}return this.emit(o.RESIZE,this.gameSize,this.baseSize,this.displaySize,t,e),this},updateOrientation:function(){if(this._checkOrientation){this._checkOrientation=!1;var t=u(this.width,this.height);t!==this.orientation&&(this.orientation=t,this.emit(o.ORIENTATION_CHANGE,t))}},updateScale:function(){var t,e,i=this.canvas.style,n=this.gameSize.width,r=this.gameSize.height,o=this.zoom,a=this.autoRound;this.scaleMode===s.SCALE_MODE.NONE?(this.displaySize.setSize(n*o,r*o),t=this.displaySize.width,e=this.displaySize.height,a&&(t=Math.floor(t),e=Math.floor(e)),this._resetZoom&&(i.width=t+"px",i.height=e+"px",this._resetZoom=!1)):this.scaleMode===s.SCALE_MODE.RESIZE?(this.displaySize.setSize(this.parentSize.width,this.parentSize.height),this.gameSize.setSize(this.displaySize.width,this.displaySize.height),this.baseSize.setSize(this.displaySize.width,this.displaySize.height),t=this.displaySize.width,e=this.displaySize.height,a&&(t=Math.floor(t),e=Math.floor(e)),this.canvas.width=t,this.canvas.height=e):(this.displaySize.setSize(this.parentSize.width,this.parentSize.height),t=this.displaySize.width,e=this.displaySize.height,a&&(t=Math.floor(t),e=Math.floor(e)),i.width=t+"px",i.height=e+"px"),this.getParentBounds(),this.updateCenter()},getMaxZoom:function(){var t=f(this.parentSize.width,this.gameSize.width,0,!0),e=f(this.parentSize.height,this.gameSize.height,0,!0);return Math.max(Math.min(t,e),1)},updateCenter:function(){var t=this.autoCenter;if(t!==s.CENTER.NO_CENTER){var e=this.canvas,i=e.style,n=e.getBoundingClientRect(),r=n.width,o=n.height,a=Math.floor((this.parentSize.width-r)/2),h=Math.floor((this.parentSize.height-o)/2);t===s.CENTER.CENTER_HORIZONTALLY?h=0:t===s.CENTER.CENTER_VERTICALLY&&(a=0),i.marginLeft=a+"px",i.marginTop=h+"px"}},updateBounds:function(){var t=this.canvasBounds,e=this.canvas.getBoundingClientRect();t.x=e.left+(window.pageXOffset||0)-(document.documentElement.clientLeft||0),t.y=e.top+(window.pageYOffset||0)-(document.documentElement.clientTop||0),t.width=e.width,t.height=e.height},transformX:function(t){return(t-this.canvasBounds.left)*this.displayScale.x},transformY:function(t){return(t-this.canvasBounds.top)*this.displayScale.y},startFullscreen:function(t){void 0===t&&(t={navigationUI:"hide"});var e=this.fullscreen;if(e.available){if(!e.active){var i=this.getFullscreenTarget();e.keyboard?i[e.request](Element.ALLOW_KEYBOARD_INPUT):i[e.request](t)}}else this.emit(o.FULLSCREEN_UNSUPPORTED)},fullscreenSuccessHandler:function(){this.getParentBounds(),this.refresh(),this.emit(o.ENTER_FULLSCREEN)},fullscreenErrorHandler:function(t){this.removeFullscreenTarget(),this.emit(o.FULLSCREEN_FAILED,t)},getFullscreenTarget:function(){if(!this.fullscreenTarget){var t=document.createElement("div");t.style.margin="0",t.style.padding="0",t.style.width="100%",t.style.height="100%",this.fullscreenTarget=t,this._createdFullscreenTarget=!0}this._createdFullscreenTarget&&(this.canvas.parentNode.insertBefore(this.fullscreenTarget,this.canvas),this.fullscreenTarget.appendChild(this.canvas));return this.fullscreenTarget},removeFullscreenTarget:function(){if(this._createdFullscreenTarget){var t=this.fullscreenTarget;if(t&&t.parentNode){var e=t.parentNode;e.insertBefore(this.canvas,t),e.removeChild(t)}}},stopFullscreen:function(){var t=this.fullscreen;if(!t.available)return this.emit(o.FULLSCREEN_UNSUPPORTED),!1;t.active&&document[t.cancel](),this.removeFullscreenTarget(),this.getParentBounds(),this.emit(o.LEAVE_FULLSCREEN),this.refresh()},toggleFullscreen:function(t){this.fullscreen.active?this.stopFullscreen():this.startFullscreen(t)},startListeners:function(){var t=this,e=this.listeners;if(e.orientationChange=function(){t.updateBounds(),t._checkOrientation=!0,t.dirty=!0},e.windowResize=function(){t.updateBounds(),t.dirty=!0},window.addEventListener("orientationchange",e.orientationChange,!1),window.addEventListener("resize",e.windowResize,!1),this.fullscreen.available){e.fullScreenChange=function(e){return t.onFullScreenChange(e)},e.fullScreenError=function(e){return t.onFullScreenError(e)};["webkit","moz",""].forEach((function(t){document.addEventListener(t+"fullscreenchange",e.fullScreenChange,!1),document.addEventListener(t+"fullscreenerror",e.fullScreenError,!1)})),document.addEventListener("MSFullscreenChange",e.fullScreenChange,!1),document.addEventListener("MSFullscreenError",e.fullScreenError,!1)}},onFullScreenChange:function(){document.fullscreenElement||document.webkitFullscreenElement||document.msFullscreenElement||document.mozFullScreenElement?this.fullscreenSuccessHandler():this.stopFullscreen()},onFullScreenError:function(){this.removeFullscreenTarget()},getViewPort:function(t){void 0===t&&(t=new d);var e,i,s=this.baseSize,n=this.parentSize,r=this.canvasBounds,o=this.displayScale,a=r.x>=0?0:-r.x*o.x,h=r.y>=0?0:-r.y*o.y;return e=n.width>=r.width?s.width:s.width-(r.width-n.width)*o.x,i=n.height>=r.height?s.height:s.height-(r.height-n.height)*o.y,t.setTo(a,h,e,i),t},step:function(t,e){this.parent&&(this._lastCheck+=e,(this.dirty||this._lastCheck>this.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var t=this.listeners;window.removeEventListener("orientationchange",t.orientationChange,!1),window.removeEventListener("resize",t.windowResize,!1);["webkit","moz",""].forEach((function(e){document.removeEventListener(e+"fullscreenchange",t.fullScreenChange,!1),document.removeEventListener(e+"fullscreenerror",t.fullScreenError,!1)})),document.removeEventListener("MSFullscreenChange",t.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",t.fullScreenError,!1)},destroy:function(){this.removeAllListeners(),this.stopListeners(),this.game=null,this.canvas=null,this.canvasBounds=null,this.parent=null,this.fullscreenTarget=null,this.parentSize.destroy(),this.gameSize.destroy(),this.baseSize.destroy(),this.displaySize.destroy()},isFullscreen:{get:function(){return this.fullscreen.active}},width:{get:function(){return this.gameSize.width}},height:{get:function(){return this.gameSize.height}},isPortrait:{get:function(){return this.orientation===s.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===s.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});t.exports=g},35098:t=>{t.exports={NO_CENTER:0,CENTER_BOTH:1,CENTER_HORIZONTALLY:2,CENTER_VERTICALLY:3}},53539:t=>{t.exports={LANDSCAPE:"landscape-primary",PORTRAIT:"portrait-primary"}},12637:t=>{t.exports={NONE:0,WIDTH_CONTROLS_HEIGHT:1,HEIGHT_CONTROLS_WIDTH:2,FIT:3,ENVELOP:4,RESIZE:5}},10217:t=>{t.exports={NO_ZOOM:1,ZOOM_2X:2,ZOOM_4X:4,MAX_ZOOM:-1}},55301:(t,e,i)=>{var s={CENTER:i(35098),ORIENTATION:i(53539),SCALE_MODE:i(12637),ZOOM:i(10217)};t.exports=s},82085:t=>{t.exports="enterfullscreen"},11826:t=>{t.exports="fullscreenfailed"},56691:t=>{t.exports="fullscreenunsupported"},34739:t=>{t.exports="leavefullscreen"},26681:t=>{t.exports="orientationchange"},11428:t=>{t.exports="resize"},40444:(t,e,i)=>{t.exports={ENTER_FULLSCREEN:i(82085),FULLSCREEN_FAILED:i(11826),FULLSCREEN_UNSUPPORTED:i(56691),LEAVE_FULLSCREEN:i(34739),ORIENTATION_CHANGE:i(26681),RESIZE:i(11428)}},86754:(t,e,i)=>{var s=i(98611),n=i(55301),r={Center:i(35098),Events:i(40444),Orientation:i(53539),ScaleManager:i(756),ScaleModes:i(12637),Zoom:i(10217)};r=s(!1,r,n.CENTER),r=s(!1,r,n.ORIENTATION),r=s(!1,r,n.SCALE_MODE),r=s(!1,r,n.ZOOM),t.exports=r},47736:(t,e,i)=>{var s=i(72632),n=i(40587);t.exports=function(t){var e=t.game.config.defaultPhysicsSystem,i=s(t.settings,"physics",!1);if(e||i){var r=[];if(e&&r.push(n(e+"Physics")),i)for(var o in i)o=n(o.concat("Physics")),-1===r.indexOf(o)&&r.push(o);return r}}},91088:(t,e,i)=>{var s=i(72632);t.exports=function(t){var e=t.plugins.getDefaultScenePlugins(),i=s(t.settings,"plugins",!1);return Array.isArray(i)?i:e||[]}},90415:t=>{t.exports={game:"game",renderer:"renderer",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",scale:"scale",sound:"sound",textures:"textures",events:"events",cameras:"cameras",add:"add",make:"make",scenePlugin:"scene",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",impactPhysics:"impact",matterPhysics:"matter"}},87157:(t,e,i)=>{var s=i(56694),n=i(63946),r=new s({initialize:function(t){this.sys=new n(this,t),this.game,this.anims,this.cache,this.registry,this.sound,this.textures,this.events,this.cameras,this.add,this.make,this.scene,this.children,this.lights,this.data,this.input,this.load,this.time,this.tweens,this.physics,this.matter,this.scale,this.plugins,this.renderer},update:function(){}});t.exports=r},13553:(t,e,i)=>{var s=i(56694),n=i(92980),r=i(7599),o=i(97081),a=i(10850),h=i(683),l=i(72283),u=i(87157),c=i(63946),d=new s({initialize:function(t,e){if(this.game=t,this.keys={},this.scenes=[],this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,this.customViewports=0,e){Array.isArray(e)||(e=[e]);for(var i=0;i-1&&(delete this.keys[s],this.scenes.splice(i,1),this._start.indexOf(s)>-1&&(i=this._start.indexOf(s),this._start.splice(i,1)),e.sys.destroy())}return this},bootScene:function(t){var e,i=t.sys,s=i.settings;i.sceneUpdate=l,t.init&&(t.init.call(t,s.data),s.status=n.INIT,s.isTransition&&i.events.emit(r.TRANSITION_INIT,s.transitionFrom,s.transitionDuration)),i.load&&(e=i.load).reset(),e&&t.preload?(t.preload.call(t),s.status=n.LOADING,e.once(h.COMPLETE,this.loadComplete,this),e.start()):this.create(t)},loadComplete:function(t){this.game.sound&&this.game.sound.onBlurPausedSounds&&this.game.sound.unlock(),this.create(t.scene)},payloadComplete:function(t){this.bootScene(t.scene)},update:function(t,e){this.processQueue(),this.isProcessing=!0;for(var i=this.scenes.length-1;i>=0;i--){var s=this.scenes[i].sys;s.settings.status>n.START&&s.settings.status<=n.RUNNING&&s.step(t,e)}},render:function(t){for(var e=0;e=n.LOADING&&i.settings.status=n.START&&o<=n.CREATING)return this;if(o>=n.RUNNING&&o<=n.SLEEPING)r.shutdown(),r.sceneUpdate=l,r.start(e);else if(r.sceneUpdate=l,r.start(e),r.load&&(s=r.load),s&&r.settings.hasOwnProperty("pack")&&(s.reset(),s.addPack({payload:r.settings.pack})))return r.settings.status=n.LOADING,s.once(h.COMPLETE,this.payloadComplete,this),s.start(),this;return this.bootScene(i),this},stop:function(t,e){var i=this.getScene(t);if(i&&!i.sys.isTransitioning()&&i.sys.settings.status!==n.SHUTDOWN){var s=i.sys.load;s.off(h.COMPLETE,this.loadComplete,this),s.off(h.COMPLETE,this.payloadComplete,this),i.sys.shutdown(e)}return this},switch:function(t,e){var i=this.getScene(t),s=this.getScene(e);return i&&s&&i!==s&&(this.sleep(t),this.isSleeping(e)?this.wake(e):this.start(e)),this},getAt:function(t){return this.scenes[t]},getIndex:function(t){var e=this.getScene(t);return this.scenes.indexOf(e)},bringToTop:function(t){if(this.isProcessing)this._queue.push({op:"bringToTop",keyA:t,keyB:null});else{var e=this.getIndex(t);if(-1!==e&&e0){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.unshift(i)}}return this},moveDown:function(t){if(this.isProcessing)this._queue.push({op:"moveDown",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e>0){var i=e-1,s=this.getScene(t),n=this.getAt(i);this.scenes[e]=n,this.scenes[i]=s}}return this},moveUp:function(t){if(this.isProcessing)this._queue.push({op:"moveUp",keyA:t,keyB:null});else{var e=this.getIndex(t);if(ei),0,n)}}return this},moveBelow:function(t,e){if(t===e)return this;if(this.isProcessing)this._queue.push({op:"moveBelow",keyA:t,keyB:e});else{var i=this.getIndex(t),s=this.getIndex(e);if(-1!==i&&-1!==s&&s>i){var n=this.getAt(s);this.scenes.splice(s,1),0===i?this.scenes.unshift(n):this.scenes.splice(i-(s{var s=i(82897),n=i(56694),r=i(7599),o=i(72632),a=i(91963),h=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.key=t.sys.settings.key,this.manager=t.sys.game.scene,this.transitionProgress=0,this._elapsed=0,this._target=null,this._duration=0,this._onUpdate,this._onUpdateScope,this._willSleep=!1,this._willRemove=!1,t.sys.events.once(r.BOOT,this.boot,this),t.sys.events.on(r.START,this.pluginStart,this)},boot:function(){this.systems.events.once(r.DESTROY,this.destroy,this)},pluginStart:function(){this._target=null,this.systems.events.once(r.SHUTDOWN,this.shutdown,this)},start:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",this.key),this.manager.queueOp("start",t,e),this},restart:function(t){var e=this.key;return this.manager.queueOp("stop",e),this.manager.queueOp("start",e,t),this},transition:function(t){void 0===t&&(t={});var e=o(t,"target",!1),i=this.manager.getScene(e);if(!e||!this.checkValidTransition(i))return!1;var s=o(t,"duration",1e3);this._elapsed=0,this._target=i,this._duration=s,this._willSleep=o(t,"sleep",!1),this._willRemove=o(t,"remove",!1);var n=o(t,"onUpdate",null);n&&(this._onUpdate=n,this._onUpdateScope=o(t,"onUpdateScope",this.scene));var a=o(t,"allowInput",!1);this.settings.transitionAllowInput=a;var h=i.sys.settings;return h.isTransition=!0,h.transitionFrom=this.scene,h.transitionDuration=s,h.transitionAllowInput=a,o(t,"moveAbove",!1)?this.manager.moveAbove(this.key,e):o(t,"moveBelow",!1)&&this.manager.moveBelow(this.key,e),i.sys.isSleeping()?i.sys.wake(o(t,"data")):this.manager.start(e,o(t,"data")),this.systems.events.emit(r.TRANSITION_OUT,i,s),this.systems.events.on(r.UPDATE,this.step,this),!0},checkValidTransition:function(t){return!(!t||t.sys.isActive()||t.sys.isTransitioning()||t===this.scene||this.systems.isTransitioning())},step:function(t,e){this._elapsed+=e,this.transitionProgress=s(this._elapsed/this._duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.transitionProgress),this._elapsed>=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;this.systems.events.off(r.UPDATE,this.step,this),t.events.emit(r.TRANSITION_COMPLETE,this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i,s){return this.manager.add(t,e,i,s)},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t){return t!==this.key&&this.manager.queueOp("switch",this.key,t),this},stop:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t,e),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var s=this.manager.getScene(e);return s&&s.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isPaused:function(t){return void 0===t&&(t=this.key),this.manager.isPaused(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getStatus:function(t){var e=this.manager.getScene(t);if(e)return e.sys.getStatus()},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off(r.SHUTDOWN,this.shutdown,this),t.off(r.POST_UPDATE,this.step,this),t.off(r.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});a.register("ScenePlugin",h,"scenePlugin"),t.exports=h},36765:(t,e,i)=>{var s=i(92980),n=i(10850),r=i(30657),o=i(90415),a={create:function(t){return"string"==typeof t?t={key:t}:void 0===t&&(t={}),{status:s.PENDING,key:n(t,"key",""),active:n(t,"active",!1),visible:n(t,"visible",!0),isBooted:!1,isTransition:!1,transitionFrom:null,transitionDuration:0,transitionAllowInput:!0,data:{},pack:n(t,"pack",!1),cameras:n(t,"cameras",null),map:n(t,"map",r(o,n(t,"mapAdd",{}))),physics:n(t,"physics",{}),loader:n(t,"loader",{}),plugins:n(t,"plugins",!1),input:n(t,"input",{})}}};t.exports=a},63946:(t,e,i)=>{var s=i(56694),n=i(92980),r=i(18360),o=i(7599),a=i(47736),h=i(91088),l=i(86459),u=i(72283),c=i(36765),d=new s({initialize:function(t,e){this.scene=t,this.game,this.renderer,this.config=e,this.settings=c.create(e),this.canvas,this.context,this.anims,this.cache,this.plugins,this.registry,this.scale,this.sound,this.textures,this.add,this.cameras,this.displayList,this.events,this.make,this.scenePlugin,this.updateList,this.sceneUpdate=u},init:function(t){this.settings.status=n.INIT,this.sceneUpdate=u,this.game=t,this.renderer=t.renderer,this.canvas=t.canvas,this.context=t.context;var e=t.plugins;this.plugins=e,e.addToScene(this,r.Global,[r.CoreScene,h(this),a(this)]),this.events.emit(o.BOOT,this),this.settings.isBooted=!0},step:function(t,e){var i=this.events;i.emit(o.PRE_UPDATE,t,e),i.emit(o.UPDATE,t,e),this.sceneUpdate.call(this.scene,t,e),i.emit(o.POST_UPDATE,t,e)},render:function(t){var e=this.displayList;e.depthSort(),this.events.emit(o.PRE_RENDER,t),this.cameras.render(t,e),this.events.emit(o.RENDER,t)},queueDepthSort:function(){this.displayList.queueDepthSort()},depthSort:function(){this.displayList.depthSort()},pause:function(t){var e=this.settings,i=this.getStatus();return i!==n.CREATING&&i!==n.RUNNING?console.warn("Cannot pause non-running Scene",e.key):this.settings.active&&(e.status=n.PAUSED,e.active=!1,this.events.emit(o.PAUSE,this,t)),this},resume:function(t){var e=this.events,i=this.settings;return this.settings.active||(i.status=n.RUNNING,i.active=!0,e.emit(o.RESUME,this,t)),this},sleep:function(t){var e=this.settings,i=this.getStatus();return i!==n.CREATING&&i!==n.RUNNING?console.warn("Cannot sleep non-running Scene",e.key):(e.status=n.SLEEPING,e.active=!1,e.visible=!1,this.events.emit(o.SLEEP,this,t)),this},wake:function(t){var e=this.events,i=this.settings;return i.status=n.RUNNING,i.active=!0,i.visible=!0,e.emit(o.WAKE,this,t),i.isTransition&&e.emit(o.TRANSITION_WAKE,i.transitionFrom,i.transitionDuration),this},getData:function(){return this.settings.data},getStatus:function(){return this.settings.status},isSleeping:function(){return this.settings.status===n.SLEEPING},isActive:function(){return this.settings.status===n.RUNNING},isPaused:function(){return this.settings.status===n.PAUSED},isTransitioning:function(){return this.settings.isTransition||null!==this.scenePlugin._target},isTransitionOut:function(){return null!==this.scenePlugin._target&&this.scenePlugin._duration>0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(t){return this.settings.visible=t,this},setActive:function(t,e){return t?this.resume(e):this.pause(e)},start:function(t){var e=this.events,i=this.settings;t&&(i.data=t),i.status=n.START,i.active=!0,i.visible=!0,e.emit(o.START,this),e.emit(o.READY,this,t)},shutdown:function(t){var e=this.events,i=this.settings;e.off(o.TRANSITION_INIT),e.off(o.TRANSITION_START),e.off(o.TRANSITION_COMPLETE),e.off(o.TRANSITION_OUT),i.status=n.SHUTDOWN,i.active=!1,i.visible=!1,this.renderer===l.WEBGL&&this.renderer.resetTextures(!0),e.emit(o.SHUTDOWN,this,t)},destroy:function(){var t=this.events,e=this.settings;e.status=n.DESTROYED,e.active=!1,e.visible=!1,t.emit(o.DESTROY,this),t.removeAllListeners();for(var i=["scene","game","anims","cache","plugins","registry","sound","textures","add","camera","displayList","events","make","scenePlugin","updateList"],s=0;s{t.exports={PENDING:0,INIT:1,START:2,LOADING:3,CREATING:4,RUNNING:5,PAUSED:6,SLEEPING:7,SHUTDOWN:8,DESTROYED:9}},31803:t=>{t.exports="addedtoscene"},94817:t=>{t.exports="boot"},28977:t=>{t.exports="create"},91959:t=>{t.exports="destroy"},363:t=>{t.exports="pause"},15643:t=>{t.exports="postupdate"},17058:t=>{t.exports="prerender"},77125:t=>{t.exports="preupdate"},76018:t=>{t.exports="ready"},28620:t=>{t.exports="removedfromscene"},41538:t=>{t.exports="render"},34268:t=>{t.exports="resume"},2342:t=>{t.exports="shutdown"},96541:t=>{t.exports="sleep"},74244:t=>{t.exports="start"},17046:t=>{t.exports="transitioncomplete"},13637:t=>{t.exports="transitioninit"},14733:t=>{t.exports="transitionout"},33899:t=>{t.exports="transitionstart"},52418:t=>{t.exports="transitionwake"},31735:t=>{t.exports="update"},8470:t=>{t.exports="wake"},7599:(t,e,i)=>{t.exports={ADDED_TO_SCENE:i(31803),BOOT:i(94817),CREATE:i(28977),DESTROY:i(91959),PAUSE:i(363),POST_UPDATE:i(15643),PRE_RENDER:i(17058),PRE_UPDATE:i(77125),READY:i(76018),REMOVED_FROM_SCENE:i(28620),RENDER:i(41538),RESUME:i(34268),SHUTDOWN:i(2342),SLEEP:i(96541),START:i(74244),TRANSITION_COMPLETE:i(17046),TRANSITION_INIT:i(13637),TRANSITION_OUT:i(14733),TRANSITION_START:i(33899),TRANSITION_WAKE:i(52418),UPDATE:i(31735),WAKE:i(8470)}},20436:(t,e,i)=>{var s=i(92980),n=i(98611),r={Events:i(7599),GetPhysicsPlugins:i(47736),GetScenePlugins:i(91088),SceneManager:i(13553),ScenePlugin:i(64051),Settings:i(36765),Systems:i(63946)};r=n(!1,r,s),t.exports=r},25798:(t,e,i)=>{var s=i(56694),n=i(6659),r=i(76038),o=i(98611),a=i(72283),h=new s({Extends:n,initialize:function(t,e,i){n.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=this.duration||0,this.totalDuration=this.totalDuration||0,this.config={mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0},this.currentConfig=this.config,this.config=o(this.config,i),this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(console.error("addMarker "+t.name+" already exists in Sound"),!1):(t=o(!0,{name:"",start:0,duration:this.totalDuration-(t.start||0),config:{mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0}},t),this.markers[t.name]=t,!0))},updateMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(this.markers[t.name]=o(!0,this.markers[t.name],t),!0):(console.warn("Audio Marker: "+t.name+" missing in Sound: "+this.key),!1))},removeMarker:function(t){var e=this.markers[t];return e?(this.markers[t]=null,e):null},play:function(t,e){if(void 0===t&&(t=""),"object"==typeof t&&(e=t,t=""),"string"!=typeof t)return!1;if(t){if(!this.markers[t])return console.warn("Marker: "+t+" missing in Sound: "+this.key),!1;this.currentMarker=this.markers[t],this.currentConfig=this.currentMarker.config,this.duration=this.currentMarker.duration}else this.currentMarker=null,this.currentConfig=this.config,this.duration=this.totalDuration;return this.resetConfig(),this.currentConfig=o(this.currentConfig,e),this.isPlaying=!0,this.isPaused=!1,!0},pause:function(){return!(this.isPaused||!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!0,!0)},resume:function(){return!(!this.isPaused||this.isPlaying)&&(this.isPlaying=!0,this.isPaused=!1,!0)},stop:function(){return!(!this.isPaused&&!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!1,this.resetConfig(),!0)},applyConfig:function(){this.mute=this.currentConfig.mute,this.volume=this.currentConfig.volume,this.rate=this.currentConfig.rate,this.detune=this.currentConfig.detune,this.loop=this.currentConfig.loop,this.pan=this.currentConfig.pan},resetConfig:function(){this.currentConfig.seek=0,this.currentConfig.delay=0},update:a,calculateRate:function(){var t=this.currentConfig.detune+this.manager.detune,e=Math.pow(1.0005777895065548,t);this.totalRate=this.currentConfig.rate*this.manager.rate*e},destroy:function(){this.pendingRemove||(this.emit(r.DESTROY,this),this.removeAllListeners(),this.pendingRemove=!0,this.manager=null,this.config=null,this.currentConfig=null,this.markers=null,this.currentMarker=null)}});t.exports=h},12486:(t,e,i)=>{var s=i(56694),n=i(32742),r=i(6659),o=i(76038),a=i(97081),h=i(72283),l=i(71608),u=i(51463),c=new s({Extends:r,initialize:function(t){r.call(this),this.game=t,this.jsonCache=t.cache.json,this.sounds=[],this.mute=!1,this.volume=1,this.pauseOnBlur=!0,this._rate=1,this._detune=0,this.locked=this.locked||!1,this.unlocked=!1,t.events.on(a.BLUR,this.onGameBlur,this),t.events.on(a.FOCUS,this.onGameFocus,this),t.events.on(a.PRE_STEP,this.update,this),t.events.once(a.DESTROY,this.destroy,this)},add:h,addAudioSprite:function(t,e){void 0===e&&(e={});var i=this.add(t,e);for(var s in i.spritemap=this.jsonCache.get(t).spritemap,i.spritemap)if(i.spritemap.hasOwnProperty(s)){var r=n(e),o=i.spritemap[s];r.loop=!!o.hasOwnProperty("loop")&&o.loop,i.addMarker({name:s,start:o.start,duration:o.end-o.start,config:r})}return i},get:function(t){return u(this.sounds,"key",t)},getAll:function(t){return l(this.sounds,"key",t)},play:function(t,e){var i=this.add(t);return i.once(o.COMPLETE,i.destroy,i),e?e.name?(i.addMarker(e),i.play(e.name)):i.play(e):i.play()},playAudioSprite:function(t,e,i){var s=this.addAudioSprite(t);return s.once(o.COMPLETE,s.destroy,s),s.play(e,i)},remove:function(t){var e=this.sounds.indexOf(t);return-1!==e&&(t.destroy(),this.sounds.splice(e,1),!0)},removeAll:function(){this.sounds.forEach((function(t){t.destroy()})),this.sounds.length=0},removeByKey:function(t){for(var e=0,i=this.sounds.length-1;i>=0;i--){var s=this.sounds[i];s.key===t&&(s.destroy(),this.sounds.splice(i,1),e++)}return e},pauseAll:function(){this.forEachActiveSound((function(t){t.pause()})),this.emit(o.PAUSE_ALL,this)},resumeAll:function(){this.forEachActiveSound((function(t){t.resume()})),this.emit(o.RESUME_ALL,this)},stopAll:function(){this.forEachActiveSound((function(t){t.stop()})),this.emit(o.STOP_ALL,this)},stopByKey:function(t){var e=0;return this.getAll(t).forEach((function(t){t.stop()&&e++})),e},unlock:h,onBlur:h,onFocus:h,onGameBlur:function(){this.pauseOnBlur&&this.onBlur()},onGameFocus:function(){this.pauseOnBlur&&this.onFocus()},update:function(t,e){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit(o.UNLOCKED,this));for(var i=this.sounds.length-1;i>=0;i--)this.sounds[i].pendingRemove&&this.sounds.splice(i,1);this.sounds.forEach((function(i){i.update(t,e)}))},destroy:function(){this.game.events.off(a.BLUR,this.onGameBlur,this),this.game.events.off(a.FOCUS,this.onGameFocus,this),this.game.events.off(a.PRE_STEP,this.update,this),this.removeAllListeners(),this.removeAll(),this.sounds.length=0,this.sounds=null,this.game=null},forEachActiveSound:function(t,e){var i=this;this.sounds.forEach((function(s,n){s&&!s.pendingRemove&&t.call(e||i,s,n,i.sounds)}))},setRate:function(t){return this.rate=t,this},rate:{get:function(){return this._rate},set:function(t){this._rate=t,this.forEachActiveSound((function(t){t.calculateRate()})),this.emit(o.GLOBAL_RATE,this,t)}},setDetune:function(t){return this.detune=t,this},detune:{get:function(){return this._detune},set:function(t){this._detune=t,this.forEachActiveSound((function(t){t.calculateRate()})),this.emit(o.GLOBAL_DETUNE,this,t)}}});t.exports=c},84191:(t,e,i)=>{var s=i(27622),n=i(17546),r=i(55491),o={create:function(t){var e=t.config.audio,i=t.device.audio;return e.noAudio||!i.webAudio&&!i.audioData?new n(t):i.webAudio&&!e.disableWebAudio?new r(t):new s(t)}};t.exports=o},77578:t=>{t.exports="complete"},19679:t=>{t.exports="decodedall"},56951:t=>{t.exports="decoded"},16436:t=>{t.exports="destroy"},55154:t=>{t.exports="detune"},57818:t=>{t.exports="detune"},57890:t=>{t.exports="mute"},83022:t=>{t.exports="rate"},99170:t=>{t.exports="volume"},64289:t=>{t.exports="looped"},67214:t=>{t.exports="loop"},53128:t=>{t.exports="mute"},73078:t=>{t.exports="pan"},76763:t=>{t.exports="pauseall"},88426:t=>{t.exports="pause"},13765:t=>{t.exports="play"},80291:t=>{t.exports="rate"},11124:t=>{t.exports="resumeall"},55382:t=>{t.exports="resume"},71157:t=>{t.exports="seek"},31776:t=>{t.exports="stopall"},39450:t=>{t.exports="stop"},21939:t=>{t.exports="unlocked"},33019:t=>{t.exports="volume"},76038:(t,e,i)=>{t.exports={COMPLETE:i(77578),DECODED:i(56951),DECODED_ALL:i(19679),DESTROY:i(16436),DETUNE:i(55154),GLOBAL_DETUNE:i(57818),GLOBAL_MUTE:i(57890),GLOBAL_RATE:i(83022),GLOBAL_VOLUME:i(99170),LOOP:i(67214),LOOPED:i(64289),MUTE:i(53128),PAN:i(73078),PAUSE_ALL:i(76763),PAUSE:i(88426),PLAY:i(13765),RATE:i(80291),RESUME_ALL:i(11124),RESUME:i(55382),SEEK:i(71157),STOP_ALL:i(31776),STOP:i(39450),UNLOCKED:i(21939),VOLUME:i(33019)}},34350:(t,e,i)=>{var s=i(25798),n=i(56694),r=i(76038),o=i(82897),a=new n({Extends:s,initialize:function(t,e,i){if(void 0===i&&(i={}),this.tags=t.game.cache.audio.get(e),!this.tags)throw new Error('No cached audio asset with key "'+e);this.audio=null,this.startTime=0,this.previousTime=0,this.duration=this.tags[0].duration,this.totalDuration=this.tags[0].duration,s.call(this,t,e,i)},play:function(t,e){return!this.manager.isLocked(this,"play",[t,e])&&(!!s.prototype.play.call(this,t,e)&&(!!this.pickAndPlayAudioTag()&&(this.emit(r.PLAY,this),!0)))},pause:function(){return!this.manager.isLocked(this,"pause")&&(!(this.startTime>0)&&(!!s.prototype.pause.call(this)&&(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit(r.PAUSE,this),!0)))},resume:function(){return!this.manager.isLocked(this,"resume")&&(!(this.startTime>0)&&(!!s.prototype.resume.call(this)&&(!!this.pickAndPlayAudioTag()&&(this.emit(r.RESUME,this),!0))))},stop:function(){return!this.manager.isLocked(this,"stop")&&(!!s.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit(r.STOP,this),!0))},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var t=this.currentConfig.seek,e=this.currentConfig.delay,i=(this.currentMarker?this.currentMarker.start:0)+t;return this.previousTime=i,this.audio.currentTime=i,this.applyConfig(),0===e?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+1e3*e,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var t=0;t0)this.startTime=i-this.manager.loopEndOffset?(this.audio.currentTime=e+Math.max(0,s-i),s=this.audio.currentTime):s=i)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit(r.COMPLETE,this);this.previousTime=s}},destroy:function(){s.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=o(this.currentConfig.volume*this.manager.volume,0,1))},calculateRate:function(){s.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(t){this.currentConfig.mute=t,this.manager.isLocked(this,"mute",t)||(this.updateMute(),this.emit(r.MUTE,this,t))}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.currentConfig.volume},set:function(t){this.currentConfig.volume=t,this.manager.isLocked(this,"volume",t)||(this.updateVolume(),this.emit(r.VOLUME,this,t))}},setVolume:function(t){return this.volume=t,this},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.manager.isLocked(this,r.RATE,t)||(this.calculateRate(),this.emit(r.RATE,this,t))}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.manager.isLocked(this,r.DETUNE,t)||(this.calculateRate(),this.emit(r.DETUNE,this,t))}},setDetune:function(t){return this.detune=t,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.isLocked(this,"seek",t)||this.startTime>0||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.isPlaying?(this.previousTime=t,this.audio.currentTime=t):this.isPaused&&(this.currentConfig.seek=t),this.emit(r.SEEK,this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.manager.isLocked(this,"loop",t)||(this.audio&&(this.audio.loop=t),this.emit(r.LOOP,this,t))}},setLoop:function(t){return this.loop=t,this},pan:{get:function(){return this.currentConfig.pan},set:function(t){this.currentConfig.pan=t,this.emit(r.PAN,this,t)}},setPan:function(t){return this.pan=t,this}});t.exports=a},27622:(t,e,i)=>{var s=i(12486),n=i(56694),r=i(76038),o=i(34350),a=new n({Extends:s,initialize:function(t){this.override=!0,this.audioPlayDelay=.1,this.loopEndOffset=.05,this.onBlurPausedSounds=[],this.locked="ontouchstart"in window,this.lockedActionsQueue=this.locked?[]:null,this._mute=!1,this._volume=1,s.call(this,t)},add:function(t,e){var i=new o(this,t,e);return this.sounds.push(i),i},unlock:function(){this.locked=!1;var t=this;if(this.game.cache.audio.entries.each((function(e,i){for(var s=0;s{t.exports={SoundManagerCreator:i(84191),Events:i(76038),BaseSound:i(25798),BaseSoundManager:i(12486),WebAudioSound:i(96008),WebAudioSoundManager:i(55491),HTML5AudioSound:i(34350),HTML5AudioSoundManager:i(27622),NoAudioSound:i(38662),NoAudioSoundManager:i(17546)}},38662:(t,e,i)=>{var s=i(25798),n=i(56694),r=i(6659),o=i(98611),a=i(72283),h=function(){return!1},l=function(){return null},u=function(){return this},c=new n({Extends:r,initialize:function(t,e,i){void 0===i&&(i={}),r.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=0,this.totalDuration=0,this.config=o({mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0},i),this.currentConfig=this.config,this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.seek=0,this.loop=!1,this.pan=0,this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:h,updateMarker:h,removeMarker:l,play:h,pause:h,resume:h,stop:h,setMute:u,setVolume:u,setRate:u,setDetune:u,setSeek:u,setLoop:u,setPan:u,applyConfig:l,resetConfig:l,update:a,calculateRate:l,destroy:function(){s.prototype.destroy.call(this)}});t.exports=c},17546:(t,e,i)=>{var s=i(12486),n=i(56694),r=i(6659),o=i(38662),a=i(72283),h=new n({Extends:r,initialize:function(t){r.call(this),this.game=t,this.sounds=[],this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.pauseOnBlur=!0,this.locked=!1},add:function(t,e){var i=new o(this,t,e);return this.sounds.push(i),i},addAudioSprite:function(t,e){var i=this.add(t,e);return i.spritemap={},i},get:function(t){return s.prototype.get.call(this,t)},getAll:function(t){return s.prototype.getAll.call(this,t)},play:function(t,e){return!1},playAudioSprite:function(t,e,i){return!1},remove:function(t){return s.prototype.remove.call(this,t)},removeAll:function(){return s.prototype.removeAll.call(this)},removeByKey:function(t){return s.prototype.removeByKey.call(this,t)},stopByKey:function(t){return s.prototype.stopByKey.call(this,t)},onBlur:a,onFocus:a,onGameBlur:a,onGameFocus:a,pauseAll:a,resumeAll:a,stopAll:a,update:a,setRate:a,setDetune:a,setMute:a,setVolume:a,unlock:a,forEachActiveSound:function(t,e){s.prototype.forEachActiveSound.call(this,t,e)},destroy:function(){s.prototype.destroy.call(this)}});t.exports=h},96008:(t,e,i)=>{var s=i(25798),n=i(56694),r=i(76038),o=new n({Extends:s,initialize:function(t,e,i){if(void 0===i&&(i={}),this.audioBuffer=t.game.cache.audio.get(e),!this.audioBuffer)throw new Error('Audio key "'+e+'" missing from cache');this.source=null,this.loopSource=null,this.muteNode=t.context.createGain(),this.volumeNode=t.context.createGain(),this.pannerNode=null,this.playTime=0,this.startTime=0,this.loopTime=0,this.rateUpdates=[],this.hasEnded=!1,this.hasLooped=!1,this.muteNode.connect(this.volumeNode),t.context.createStereoPanner?(this.pannerNode=t.context.createStereoPanner(),this.volumeNode.connect(this.pannerNode),this.pannerNode.connect(t.destination)):this.volumeNode.connect(t.destination),this.duration=this.audioBuffer.duration,this.totalDuration=this.audioBuffer.duration,s.call(this,t,e,i)},play:function(t,e){return!!s.prototype.play.call(this,t,e)&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource(),this.emit(r.PLAY,this),!0)},pause:function(){return!(this.manager.context.currentTime{var s=i(82329),n=i(12486),r=i(56694),o=i(76038),a=i(97081),h=i(96008),l=new r({Extends:n,initialize:function(t){this.context=this.createAudioContext(t),this.masterMuteNode=this.context.createGain(),this.masterVolumeNode=this.context.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(this.context.destination),this.destination=this.masterMuteNode,this.locked="suspended"===this.context.state&&("ontouchstart"in window||"onclick"in window),n.call(this,t),this.locked&&t.isBooted?this.unlock():t.events.once(a.BOOT,this.unlock,this)},createAudioContext:function(t){var e=t.config.audio;return e.context?(e.context.resume(),e.context):window.hasOwnProperty("AudioContext")?new AudioContext:window.hasOwnProperty("webkitAudioContext")?new window.webkitAudioContext:void 0},setAudioContext:function(t){return this.context&&this.context.close(),this.masterMuteNode&&this.masterMuteNode.disconnect(),this.masterVolumeNode&&this.masterVolumeNode.disconnect(),this.context=t,this.masterMuteNode=t.createGain(),this.masterVolumeNode=t.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(t.destination),this.destination=this.masterMuteNode,this},add:function(t,e){var i=new h(this,t,e);return this.sounds.push(i),i},decodeAudio:function(t,e){var i;i=Array.isArray(t)?t:[{key:t,data:e}];for(var n=this.game.cache.audio,r=i.length,a=0;a{var s=i(59959),n=i(56694),r=i(72283),o=i(17922),a=new n({initialize:function(t){this.parent=t,this.list=[],this.position=0,this.addCallback=r,this.removeCallback=r,this._sortKey=""},add:function(t,e){return e?s.Add(this.list,t):s.Add(this.list,t,0,this.addCallback,this)},addAt:function(t,e,i){return i?s.AddAt(this.list,t,e):s.AddAt(this.list,t,e,0,this.addCallback,this)},getAt:function(t){return this.list[t]},getIndex:function(t){return this.list.indexOf(t)},sort:function(t,e){return t?(void 0===e&&(e=function(e,i){return e[t]-i[t]}),o(this.list,e),this):this},getByName:function(t){return s.GetFirst(this.list,"name",t)},getRandom:function(t,e){return s.GetRandom(this.list,t,e)},getFirst:function(t,e,i,n){return s.GetFirst(this.list,t,e,i,n)},getAll:function(t,e,i,n){return s.GetAll(this.list,t,e,i,n)},count:function(t,e){return s.CountAllMatching(this.list,t,e)},swap:function(t,e){s.Swap(this.list,t,e)},moveTo:function(t,e){return s.MoveTo(this.list,t,e)},moveAbove:function(t,e){return s.MoveAbove(this.list,t,e)},moveBelow:function(t,e){return s.MoveBelow(this.list,t,e)},remove:function(t,e){return e?s.Remove(this.list,t):s.Remove(this.list,t,this.removeCallback,this)},removeAt:function(t,e){return e?s.RemoveAt(this.list,t):s.RemoveAt(this.list,t,this.removeCallback,this)},removeBetween:function(t,e,i){return i?s.RemoveBetween(this.list,t,e):s.RemoveBetween(this.list,t,e,this.removeCallback,this)},removeAll:function(t){for(var e=this.list.length;e--;)this.remove(this.list[e],t);return this},bringToTop:function(t){return s.BringToTop(this.list,t)},sendToBack:function(t){return s.SendToBack(this.list,t)},moveUp:function(t){return s.MoveUp(this.list,t),t},moveDown:function(t){return s.MoveDown(this.list,t),t},reverse:function(){return this.list.reverse(),this},shuffle:function(){return s.Shuffle(this.list),this},replace:function(t,e){return s.Replace(this.list,t,e)},exists:function(t){return this.list.indexOf(t)>-1},setAll:function(t,e,i,n){return s.SetAll(this.list,t,e,i,n),this},each:function(t,e){for(var i=[null],s=2;s0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}}});t.exports=a},33885:(t,e,i)=>{var s=new(i(56694))({initialize:function(t){if(this.entries={},this.size=0,Array.isArray(t))for(var e=0;e{var s=i(56694),n=i(6659),r=i(36716),o=new s({Extends:n,initialize:function(){n.call(this),this._pending=[],this._active=[],this._destroy=[],this._toProcess=0,this.checkQueue=!1},isActive:function(t){return this._active.indexOf(t)>-1},isPending:function(t){return this._toProcess>0&&this._pending.indexOf(t)>-1},isDestroying:function(t){return this._destroy.indexOf(t)>-1},add:function(t){return this.checkQueue&&(this.isActive(t)||this.isPending(t))||(this._pending.push(t),this._toProcess++),t},remove:function(t){if(this.isPending(t)){var e=this._pending,i=e.indexOf(t);-1!==i&&e.splice(i,1)}else this.isActive(t)&&(this._destroy.push(t),this._toProcess++);return t},removeAll:function(){for(var t=this._active,e=this._destroy,i=t.length;i--;)e.push(t[i]),this._toProcess++;return this},update:function(){if(0===this._toProcess)return this._active;var t,e,i=this._destroy,s=this._active;for(t=0;t{var s=i(53466);function n(t){if(!(this instanceof n))return new n(t,[".left",".top",".right",".bottom"]);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}function r(t,e,i){if(!i)return e.indexOf(t);for(var s=0;s=t.minX&&e.maxY>=t.minY}function v(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(t,e,i,n,r){for(var o,a=[e,i];a.length;)(i=a.pop())-(e=a.pop())<=n||(o=e+Math.ceil((i-e)/n/2)*n,s(t,o,e,i,r),a.push(e,o,o,i))}n.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],s=this.toBBox;if(!f(t,e))return i;for(var n,r,o,a,h=[];e;){for(n=0,r=e.children.length;n=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(n,r,e)},_split:function(t,e){var i=t[e],s=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,s);var r=this._chooseSplitIndex(i,n,s),a=v(i.children.splice(r,i.children.length-r));a.height=i.height,a.leaf=i.leaf,o(i,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(t,e){this.data=v([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var s,n,r,o,h,l,u,d,p,f,v,g,m,y;for(l=u=1/0,s=e;s<=i-e;s++)n=a(t,0,s,this.toBBox),r=a(t,s,i,this.toBBox),p=n,f=r,v=void 0,g=void 0,m=void 0,y=void 0,v=Math.max(p.minX,f.minX),g=Math.max(p.minY,f.minY),m=Math.min(p.maxX,f.maxX),y=Math.min(p.maxY,f.maxY),o=Math.max(0,m-v)*Math.max(0,y-g),h=c(n)+c(r),o=e;n--)r=t.children[n],h(u,t.leaf?o(r):r),c+=d(u);return c},_adjustParentBBoxes:function(t,e,i){for(var s=i;s>=0;s--)h(e[s],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():o(t[i],this.toBBox)},compareMinX:function(t,e){return t.left-e.left},compareMinY:function(t,e){return t.top-e.top},toBBox:function(t){return{minX:t.left,minY:t.top,maxX:t.right,maxY:t.bottom}}},t.exports=n},58403:(t,e,i)=>{var s=new(i(56694))({initialize:function(t){if(this.entries=[],Array.isArray(t))for(var e=0;e-1&&this.entries.splice(e,1),this},dump:function(){console.group("Set");for(var t=0;t-1},union:function(t){var e=new s;return t.entries.forEach((function(t){e.set(t)})),this.entries.forEach((function(t){e.set(t)})),e},intersect:function(t){var e=new s;return this.entries.forEach((function(i){t.contains(i)&&e.set(i)})),e},difference:function(t){var e=new s;return this.entries.forEach((function(i){t.contains(i)||e.set(i)})),e},size:{get:function(){return this.entries.length},set:function(t){return t{var s=i(82897),n=i(56694),r=i(84314),o=i(93736),a=new n({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===s&&(s=null),this._width=t,this._height=e,this._parent=s,this.aspectMode=i,this.aspectRatio=0===e?1:t/e,this.minWidth=0,this.minHeight=0,this.maxWidth=Number.MAX_VALUE,this.maxHeight=Number.MAX_VALUE,this.snapTo=new o},setAspectMode:function(t){return void 0===t&&(t=0),this.aspectMode=t,this.setSize(this._width,this._height)},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.snapTo.set(t,e),this.setSize(this._width,this._height)},setParent:function(t){return this._parent=t,this.setSize(this._width,this._height)},setMin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.minWidth=s(t,0,this.maxWidth),this.minHeight=s(e,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(t,e){return void 0===t&&(t=Number.MAX_VALUE),void 0===e&&(e=t),this.maxWidth=s(t,this.minWidth,Number.MAX_VALUE),this.maxHeight=s(e,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(t,e){switch(void 0===t&&(t=0),void 0===e&&(e=t),this.aspectMode){case a.NONE:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height;break;case a.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case a.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(r(e,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case a.FIT:this.constrain(t,e,!0);break;case a.ENVELOP:this.constrain(t,e,!1)}return this},setAspectRatio:function(t){return this.aspectRatio=t,this.setSize(this._width,this._height)},resize:function(t,e){return this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height,this},getNewWidth:function(t,e){return void 0===e&&(e=!0),t=s(t,this.minWidth,this.maxWidth),e&&this._parent&&t>this._parent.width&&(t=Math.max(this.minWidth,this._parent.width)),t},getNewHeight:function(t,e){return void 0===e&&(e=!0),t=s(t,this.minHeight,this.maxHeight),e&&this._parent&&t>this._parent.height&&(t=Math.max(this.minHeight,this._parent.height)),t},constrain:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=!0),t=this.getNewWidth(t),e=this.getNewHeight(e);var s=this.snapTo,n=0===e?1:t/e;return i&&this.aspectRatio>n||!i&&this.aspectRatio0&&(t=(e=r(e,s.y))*this.aspectRatio)):(i&&this.aspectRation)&&(t=(e=r(e,s.y))*this.aspectRatio,s.x>0&&(e=(t=r(t,s.x))*(1/this.aspectRatio))),this._width=t,this._height=e,this},fitTo:function(t,e){return this.constrain(t,e,!0)},envelop:function(t,e){return this.constrain(t,e,!1)},setWidth:function(t){return this.setSize(t,this._height)},setHeight:function(t){return this.setSize(this._width,t)},toString:function(){return"[{ Size (width="+this._width+" height="+this._height+" aspectRatio="+this.aspectRatio+" aspectMode="+this.aspectMode+") }]"},setCSS:function(t){t&&t.style&&(t.style.width=this._width+"px",t.style.height=this._height+"px")},copy:function(t){return t.setAspectMode(this.aspectMode),t.aspectRatio=this.aspectRatio,t.setSize(this.width,this.height)},destroy:function(){this._parent=null,this.snapTo=null},width:{get:function(){return this._width},set:function(t){this.setSize(t,this._height)}},height:{get:function(){return this._height},set:function(t){this.setSize(this._width,t)}}});a.NONE=0,a.WIDTH_CONTROLS_HEIGHT=1,a.HEIGHT_CONTROLS_WIDTH=2,a.FIT=3,a.ENVELOP=4,t.exports=a},94160:t=>{t.exports="add"},95393:t=>{t.exports="remove"},36716:(t,e,i)=>{t.exports={PROCESS_QUEUE_ADD:i(94160),PROCESS_QUEUE_REMOVE:i(95393)}},20010:(t,e,i)=>{t.exports={Events:i(36716),List:i(71207),Map:i(33885),ProcessQueue:i(74623),RTree:i(68687),Set:i(58403),Size:i(90881)}},17487:(t,e,i)=>{var s=i(56694),n=i(82897),r=i(27119),o=i(86459),a=i(28621),h=i(31673),l=new s({Extends:h,initialize:function(t,e,i,s,n){h.call(this,t,e,i,s,n),this.add("__BASE",0,0,0,s,n),this._source=this.frames.__BASE.source,this.canvas=this._source.image,this.context=this.canvas.getContext("2d"),this.width=s,this.height=n,this.imageData=this.context.getImageData(0,0,s,n),this.data=null,this.imageData&&(this.data=this.imageData.data),this.pixels=null,this.buffer,this.data&&(this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data)},update:function(){return this.imageData=this.context.getImageData(0,0,this.width,this.height),this.data=this.imageData.data,this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data,this.manager.game.config.renderType===o.WEBGL&&this.refresh(),this},draw:function(t,e,i){return this.context.drawImage(i,t,e),this.update()},drawFrame:function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=0);var n=this.manager.getFrame(t,e);if(n){var r=n.canvasData,o=n.cutWidth,a=n.cutHeight,h=n.source.resolution;return this.context.drawImage(n.source.image,r.x,r.y,o,a,i,s,o/h,a/h),this.update()}return this},setPixel:function(t,e,i,s,n,r){if(void 0===r&&(r=255),t=Math.abs(Math.floor(t)),e=Math.abs(Math.floor(e)),this.getIndex(t,e)>-1){var o=this.context.getImageData(t,e,1,1);o.data[0]=i,o.data[1]=s,o.data[2]=n,o.data[3]=r,this.context.putImageData(o,t,e)}return this},putData:function(t,e,i,s,n,r,o){return void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=t.width),void 0===o&&(o=t.height),this.context.putImageData(t,e,i,s,n,r,o),this},getData:function(t,e,i,s){return t=n(Math.floor(t),0,this.width-1),e=n(Math.floor(e),0,this.height-1),i=n(i,1,this.width-t),s=n(s,1,this.height-e),this.context.getImageData(t,e,i,s)},getPixel:function(t,e,i){i||(i=new r);var s=this.getIndex(t,e);if(s>-1){var n=this.data,o=n[s+0],a=n[s+1],h=n[s+2],l=n[s+3];i.setTo(o,a,h,l)}return i},getPixels:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===s&&(s=i),t=Math.abs(Math.round(t)),e=Math.abs(Math.round(e));for(var o=n(t,0,this.width),a=n(t+i,0,this.width),h=n(e,0,this.height),l=n(e+s,0,this.height),u=new r,c=[],d=h;d{var s=i(56694),n=i(82897),r=i(98611),o=new s({initialize:function(t,e,i,s,n,r,o){this.texture=t,this.name=e,this.source=t.source[i],this.sourceIndex=i,this.glTexture=this.source.glTexture,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0}},this.setSize(r,o,s,n)},setSize:function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=0),this.cutX=i,this.cutY=s,this.cutWidth=t,this.cutHeight=e,this.width=t,this.height=e,this.halfWidth=Math.floor(.5*t),this.halfHeight=Math.floor(.5*e),this.centerX=Math.floor(t/2),this.centerY=Math.floor(e/2);var n=this.data,r=n.cut;r.x=i,r.y=s,r.w=t,r.h=e,r.r=i+t,r.b=s+e,n.sourceSize.w=t,n.sourceSize.h=e,n.spriteSourceSize.w=t,n.spriteSourceSize.h=e,n.radius=.5*Math.sqrt(t*t+e*e);var o=n.drawImage;return o.x=i,o.y=s,o.width=t,o.height=e,this.updateUVs()},setTrim:function(t,e,i,s,n,r){var o=this.data,a=o.spriteSourceSize;return o.trim=!0,o.sourceSize.w=t,o.sourceSize.h=e,a.x=i,a.y=s,a.w=n,a.h=r,a.r=i+n,a.b=s+r,this.x=i,this.y=s,this.width=n,this.height=r,this.halfWidth=.5*n,this.halfHeight=.5*r,this.centerX=Math.floor(n/2),this.centerY=Math.floor(r/2),this.updateUVs()},setCropUVs:function(t,e,i,s,r,o,a){var h=this.cutX,l=this.cutY,u=this.cutWidth,c=this.cutHeight,d=this.realWidth,p=this.realHeight,f=h+(e=n(e,0,d)),v=l+(i=n(i,0,p)),g=s=n(s,0,d-e),m=r=n(r,0,p-i),y=this.data;if(y.trim){var x=y.spriteSourceSize,T=e+(s=n(s,0,u-e)),w=i+(r=n(r,0,c-i));if(!(x.rT||x.y>w)){var b=Math.max(x.x,e),E=Math.max(x.y,i),S=Math.min(x.r,T)-b,A=Math.min(x.b,w)-E;g=S,m=A,f=o?h+(u-(b-x.x)-S):h+(b-x.x),v=a?l+(c-(E-x.y)-A):l+(E-x.y),e=b,i=E,s=S,r=A}else f=0,v=0,g=0,m=0}else o&&(f=h+(u-e-s)),a&&(v=l+(c-i-r));var _=this.source.width,C=this.source.height;return t.u0=Math.max(0,f/_),t.v0=Math.max(0,v/C),t.u1=Math.min(1,(f+g)/_),t.v1=Math.min(1,(v+m)/C),t.x=e,t.y=i,t.cx=f,t.cy=v,t.cw=g,t.ch=m,t.width=s,t.height=r,t.flipX=o,t.flipY=a,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},setUVs:function(t,e,i,s,n,r){var o=this.data.drawImage;return o.width=t,o.height=e,this.u0=i,this.v0=s,this.u1=n,this.v1=r,this},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,s=this.cutHeight,n=this.data.drawImage;n.width=i,n.height=s;var r=this.source.width,o=this.source.height;return this.u0=t/r,this.v0=e/o,this.u1=(t+i)/r,this.v1=(e+s)/o,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new o(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=r(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.source=null,this.texture=null,this.glTexture=null,this.customData=null,this.data=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=o},31673:(t,e,i)=>{var s=i(86459),n=i(56694),r=i(82047),o=i(32547),a='Texture "%s" has no frame "%s"',h=new n({initialize:function(t,e,i,s,n){Array.isArray(i)||(i=[i]),this.manager=t,this.key=e,this.source=[],this.dataSource=[],this.frames={},this.customData={},this.firstFrame="__BASE",this.frameTotal=0;for(var r=0;r{var s=i(61068),n=i(17487),r=i(56694),o=i(27119),a=i(86459),h=i(6659),l=i(38203),u=i(97081),c=i(52780),d=i(10850),p=i(69150),f=i(31673),v=new r({Extends:h,initialize:function(t){h.call(this),this.game=t,this.name="TextureManager",this.list={},this._tempCanvas=s.create2D(this),this._tempContext=this._tempCanvas.getContext("2d",{willReadFrequently:!0}),this._pending=0,t.events.once(u.BOOT,this.boot,this)},boot:function(){this._pending=3,this.on(l.LOAD,this.updatePending,this),this.on(l.ERROR,this.updatePending,this);var t=this.game.config;this.addBase64("__DEFAULT",t.defaultImage),this.addBase64("__MISSING",t.missingImage),this.addBase64("__WHITE",t.whiteImage),this.game.events.once(u.DESTROY,this.destroy,this)},updatePending:function(){this._pending--,0===this._pending&&(this.off(l.LOAD),this.off(l.ERROR),this.emit(l.READY))},checkKey:function(t){return!this.exists(t)||(console.error("Texture key already in use: "+t),!1)},remove:function(t){if("string"==typeof t){if(!this.exists(t))return console.warn("No texture found matching key: "+t),this;t=this.get(t)}return this.list.hasOwnProperty(t.key)&&(t.destroy(),this.emit(l.REMOVE,t.key),this.emit(l.REMOVE_KEY+t.key)),this},removeKey:function(t){return this.list.hasOwnProperty(t)&&delete this.list[t],this},addBase64:function(t,e){if(this.checkKey(t)){var i=this,s=new Image;s.onerror=function(){i.emit(l.ERROR,t)},s.onload=function(){var e=i.create(t,s);p.Image(e,0),i.emit(l.ADD,t,e),i.emit(l.ADD_KEY+t,e),i.emit(l.LOAD,t,e)},s.src=e}return this},getBase64:function(t,e,i,n){void 0===i&&(i="image/png"),void 0===n&&(n=.92);var r="",o=this.getFrame(t,e);if(o&&(o.source.isRenderTexture||o.source.isGLTexture))console.warn("Cannot getBase64 from WebGL Texture");else if(o){var a=o.canvasData,h=s.create2D(this,a.width,a.height),l=h.getContext("2d");a.width>0&&a.height>0&&l.drawImage(o.source.image,a.x,a.y,a.width,a.height,0,0,a.width,a.height),r=h.toDataURL(i,n),s.remove(h)}return r},addImage:function(t,e,i){var s=null;return this.checkKey(t)&&(s=this.create(t,e),p.Image(s,0),i&&s.setDataSource(i),this.emit(l.ADD,t,s),this.emit(l.ADD_KEY+t,s)),s},addGLTexture:function(t,e,i,s){var n=null;return this.checkKey(t)&&(void 0===i&&(i=e.width),void 0===s&&(s=e.height),(n=this.create(t,e,i,s)).add("__BASE",0,0,0,i,s),this.emit(l.ADD,t,n),this.emit(l.ADD_KEY+t,n)),n},addCompressedTexture:function(t,e,i){var s=null;if(this.checkKey(t)){if((s=this.create(t,e)).add("__BASE",0,0,0,e.width,e.height),i)if(Array.isArray(i))for(var n=0;n=r.x&&t=r.y&&e=r.x&&t=r.y&&e{var s=i(61068),n=i(56694),r=i(28621),o=i(27394),a=new n({initialize:function(t,e,i,s,n){void 0===n&&(n=!1);var a=t.manager.game;this.renderer=a.renderer,this.texture=t,this.source=e,this.image=e.compressed?null:e,this.compressionAlgorithm=e.compressed?e.format:null,this.resolution=1,this.width=i||e.naturalWidth||e.videoWidth||e.width||0,this.height=s||e.naturalHeight||e.videoHeight||e.height||0,this.scaleMode=o.DEFAULT,this.isCanvas=e instanceof HTMLCanvasElement,this.isVideo=window.hasOwnProperty("HTMLVideoElement")&&e instanceof HTMLVideoElement,this.isRenderTexture="RenderTexture"===e.type,this.isGLTexture=window.hasOwnProperty("WebGLTexture")&&e instanceof WebGLTexture,this.isPowerOf2=r(this.width,this.height),this.glTexture=null,this.glIndex=0,this.glIndexCounter=-1,this.flipY=n,this.init(a)},init:function(t){var e=this.renderer;e&&(e.gl?this.isCanvas?this.glTexture=e.createCanvasTexture(this.image,!1,this.flipY):this.isVideo?this.glTexture=e.createVideoTexture(this.image,!1,this.flipY):this.isRenderTexture?(this.image=this.source.canvas,this.glTexture=e.createTextureFromSource(null,this.width,this.height,this.scaleMode)):this.isGLTexture?this.glTexture=this.source:this.compressionAlgorithm?this.glTexture=e.createTextureFromSource(this.source):this.glTexture=e.createTextureFromSource(this.image,this.width,this.height,this.scaleMode):this.isRenderTexture&&(this.image=this.source.canvas)),t.config.antialias||this.setFilter(1)},setFilter:function(t){this.renderer.gl&&this.renderer.setTextureFilter(this.glTexture,t),this.scaleMode=t},setFlipY:function(t){return void 0===t&&(t=!0),this.flipY=t,this},update:function(){var t=this.renderer.gl;t&&this.isCanvas?this.glTexture=this.renderer.updateCanvasTexture(this.image,this.glTexture,this.flipY):t&&this.isVideo&&(this.glTexture=this.renderer.updateVideoTexture(this.image,this.glTexture,this.flipY))},destroy:function(){this.glTexture&&this.renderer.deleteTexture(this.glTexture,!0),this.isCanvas&&s.remove(this.image),this.renderer=null,this.texture=null,this.source=null,this.image=null,this.glTexture=null}});t.exports=a},65154:t=>{t.exports={LINEAR:0,NEAREST:1}},49644:t=>{t.exports="addtexture"},29569:t=>{t.exports="addtexture-"},60079:t=>{t.exports="onerror"},72665:t=>{t.exports="onload"},93006:t=>{t.exports="ready"},69018:t=>{t.exports="removetexture"},85549:t=>{t.exports="removetexture-"},38203:(t,e,i)=>{t.exports={ADD:i(49644),ADD_KEY:i(29569),ERROR:i(60079),LOAD:i(72665),READY:i(93006),REMOVE:i(69018),REMOVE_KEY:i(85549)}},87499:(t,e,i)=>{var s=i(98611),n=i(65154),r={CanvasTexture:i(17487),Events:i(38203),FilterMode:n,Frame:i(82047),Parsers:i(69150),Texture:i(31673),TextureManager:i(6237),TextureSource:i(32547)};r=s(!1,r,n),t.exports=r},35082:t=>{t.exports=function(t,e,i){if(i.getElementsByTagName("TextureAtlas")){var s=t.source[e];t.add("__BASE",e,0,0,s.width,s.height);for(var n,r=i.getElementsByTagName("SubTexture"),o=0;o{t.exports=function(t,e){var i=t.source[e];return t.add("__BASE",e,0,0,i.width,i.height),t}},21560:t=>{t.exports=function(t,e){var i=t.source[e];return t.add("__BASE",e,0,0,i.width,i.height),t}},64423:(t,e,i)=>{var s=i(32742);t.exports=function(t,e,i){if(i.frames||i.textures){var n=t.source[e];t.add("__BASE",e,0,0,n.width,n.height);for(var r,o=Array.isArray(i.textures)?i.textures[e].frames:i.frames,a=0;a{var s=i(32742);t.exports=function(t,e,i){if(i.frames){var n=t.source[e];t.add("__BASE",e,0,0,n.width,n.height);var r,o=i.frames;for(var a in o)if(o.hasOwnProperty(a)){var h=o[a];if(r=t.add(a,e,h.frame.x,h.frame.y,h.frame.w,h.frame.h)){h.trimmed&&r.setTrim(h.sourceSize.w,h.sourceSize.h,h.spriteSourceSize.x,h.spriteSourceSize.y,h.spriteSourceSize.w,h.spriteSourceSize.h),h.rotated&&(r.rotated=!0,r.updateUVsInverted());var l=h.anchor||h.pivot;l&&(r.customPivot=!0,r.pivotX=l.x,r.pivotY=l.y),r.customData=s(h)}else console.warn("Invalid atlas json, frame already exists: "+a)}for(var u in i)"frames"!==u&&(Array.isArray(i[u])?t.customData[u]=i[u].slice(0):t.customData[u]=i[u]);return t}console.warn("Invalid Texture Atlas JSON Hash given, missing 'frames' Object")}},67409:t=>{t.exports=function(t){var e,i=[171,75,84,88,32,49,49,187,13,10,26,10],s=new Uint8Array(t,0,12);for(e=0;e>1),v=Math.max(1,v>>1),p+=g}return{mipmaps:d,width:h,height:l,internalFormat:a,compressed:!0,generateMipmap:!1}}console.warn("KTXParser - Only compressed formats supported")}},24904:t=>{function e(t,e,i,s,n,r,o){return void 0===o&&(o=16),Math.floor((t+i)/n)*Math.floor((e+s)/r)*o}function i(t,e){return(t=Math.max(t,16))*(e=Math.max(e,8))/4}function s(t,e){return(t=Math.max(t,8))*(e=Math.max(e,8))/2}function n(t,i){return e(t,i,3,3,4,4,8)}function r(t,i){return e(t,i,3,3,4,4)}var o={0:{sizeFunc:i,glFormat:35841},1:{sizeFunc:i,glFormat:35843},2:{sizeFunc:s,glFormat:35840},3:{sizeFunc:s,glFormat:35842},6:{sizeFunc:n,glFormat:36196},7:{sizeFunc:n,glFormat:33776},8:{sizeFunc:r,glFormat:33777},9:{sizeFunc:r,glFormat:33778},11:{sizeFunc:r,glFormat:33779},22:{sizeFunc:n,glFormat:37492},23:{sizeFunc:r,glFormat:37496},24:{sizeFunc:n,glFormat:37494},25:{sizeFunc:n,glFormat:37488},26:{sizeFunc:r,glFormat:37490},27:{sizeFunc:r,glFormat:37808},28:{sizeFunc:function(t,i){return e(t,i,4,3,5,4)},glFormat:37809},29:{sizeFunc:function(t,i){return e(t,i,4,4,5,5)},glFormat:37810},30:{sizeFunc:function(t,i){return e(t,i,5,4,6,5)},glFormat:37811},31:{sizeFunc:function(t,i){return e(t,i,5,5,6,6)},glFormat:37812},32:{sizeFunc:function(t,i){return e(t,i,7,4,8,5)},glFormat:37813},33:{sizeFunc:function(t,i){return e(t,i,7,5,8,6)},glFormat:37814},34:{sizeFunc:function(t,i){return e(t,i,7,7,8,8)},glFormat:37815},35:{sizeFunc:function(t,i){return e(t,i,9,4,10,5)},glFormat:37816},36:{sizeFunc:function(t,i){return e(t,i,9,5,10,6)},glFormat:37817},37:{sizeFunc:function(t,i){return e(t,i,9,7,10,8)},glFormat:37818},38:{sizeFunc:function(t,i){return e(t,i,9,9,10,10)},glFormat:37819},39:{sizeFunc:function(t,i){return e(t,i,11,9,12,10)},glFormat:37820},40:{sizeFunc:function(t,i){return e(t,i,11,11,12,12)},glFormat:37821}};t.exports=function(t){for(var e=new Uint32Array(t,0,13),i=e[2],s=o[i].glFormat,n=o[i].sizeFunc,r=e[11],a=e[7],h=e[6],l=52+e[12],u=new Uint8Array(t,l),c=new Array(r),d=0,p=a,f=h,v=0;v>1),f=Math.max(1,f>>1),d+=g}return{mipmaps:c,width:a,height:h,internalFormat:s,compressed:!0,generateMipmap:!1}}},6143:(t,e,i)=>{var s=i(72632);t.exports=function(t,e,i,n,r,o,a){var h=s(a,"frameWidth",null),l=s(a,"frameHeight",h);if(null===h)throw new Error("TextureManager.SpriteSheet: Invalid frameWidth given.");var u=t.source[e];t.add("__BASE",e,0,0,u.width,u.height);var c=s(a,"startFrame",0),d=s(a,"endFrame",-1),p=s(a,"margin",0),f=s(a,"spacing",0),v=Math.floor((r-p+f)/(h+f))*Math.floor((o-p+f)/(l+f));0===v&&console.warn("SpriteSheet frame dimensions will result in zero frames for texture:",t.key),(c>v||c<-v)&&(c=0),c<0&&(c=v+c),-1!==d&&(v=c+(d+1));for(var g=p,m=p,y=0,x=0,T=0;Tr&&(y=w-r),b>o&&(x=b-o),t.add(T,e,i+g,n+m,h-y,l-x),(g+=h+f)+h>r&&(g=p,m+=l+f)}return t}},20030:(t,e,i)=>{var s=i(72632);t.exports=function(t,e,i){var n=s(i,"frameWidth",null),r=s(i,"frameHeight",n);if(!n)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var o=t.source[0];t.add("__BASE",0,0,0,o.width,o.height);var a,h=s(i,"startFrame",0),l=s(i,"endFrame",-1),u=s(i,"margin",0),c=s(i,"spacing",0),d=e.cutX,p=e.cutY,f=e.cutWidth,v=e.cutHeight,g=e.realWidth,m=e.realHeight,y=Math.floor((g-u+c)/(n+c)),x=Math.floor((m-u+c)/(r+c)),T=y*x,w=e.x,b=n-w,E=n-(g-f-w),S=e.y,A=r-S,_=r-(m-v-S);(h>T||h<-T)&&(h=0),h<0&&(h=T+h),-1!==l&&(T=h+(l+1));for(var C=u,R=u,M=0,P=e.sourceIndex,O=0;O{var e=0,i=function(t,i,s,n){var r=e-n.y-n.height;t.add(s,i,n.x,r,n.width,n.height)};t.exports=function(t,s,n){var r=t.source[s];t.add("__BASE",s,0,0,r.width,r.height),e=r.height;for(var o=n.split("\n"),a=/^[ ]*(- )*(\w+)+[: ]+(.*)/,h="",l="",u={x:0,y:0,width:0,height:0},c=0;c{t.exports={AtlasXML:i(35082),Canvas:i(83332),Image:i(21560),JSONArray:i(64423),JSONHash:i(17264),KTXParser:i(67409),PVRParser:i(24904),SpriteSheet:i(6143),SpriteSheetFromAtlas:i(20030),UnityYAML:i(89187)}},93560:t=>{t.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}},97042:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s,n,r,o){(void 0===i||i<=0)&&(i=32),(void 0===s||s<=0)&&(s=32),void 0===n&&(n=0),void 0===r&&(r=0),this.name=t,this.firstgid=0|e,this.imageWidth=0|i,this.imageHeight=0|s,this.imageMargin=0|n,this.imageSpacing=0|r,this.properties=o||{},this.images=[],this.total=0},containsImageIndex:function(t){return t>=this.firstgid&&t{var s=new(i(56694))({initialize:function(t){if(this.gids=[],void 0!==t)for(var e=0;e{var s=i(93560),n=i(16586),r=i(90715),o=i(89797);t.exports=function(t,e,i,a,h,l,u,c){void 0===i&&(i=32),void 0===a&&(a=32),void 0===h&&(h=10),void 0===l&&(l=10),void 0===c&&(c=!1);var d=null;if(Array.isArray(u))d=r(void 0!==e?e:"map",s.ARRAY_2D,u,i,a,c);else if(void 0!==e){var p=t.cache.tilemap.get(e);p?d=r(e,p.format,p.data,i,a,c):console.warn("No map data found for key "+e)}return null===d&&(d=new n({tileWidth:i,tileHeight:a,width:h,height:l})),new o(t,d)}},29633:(t,e,i)=>{var s=i(12920),n=i(56694),r=i(64937),o=i(66658),a=new n({Mixins:[r.Alpha,r.Flip,r.Visible],initialize:function(t,e,i,s,n,r,o,a){this.layer=t,this.index=e,this.x=i,this.y=s,this.width=n,this.height=r,this.right,this.bottom,this.baseWidth=void 0!==o?o:n,this.baseHeight=void 0!==a?a:r,this.pixelX=0,this.pixelY=0,this.updatePixelXY(),this.properties={},this.rotation=0,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceLeft=!1,this.faceRight=!1,this.faceTop=!1,this.faceBottom=!1,this.collisionCallback=void 0,this.collisionCallbackContext=this,this.tint=16777215,this.physics={}},containsPoint:function(t,e){return!(tthis.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=t.properties,this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldXY(this.x,this.y,void 0,t).x:this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldXY(this.x,this.y,void 0,t).y:this.y*this.baseWidth-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new o),e.x=this.getLeft(t),e.y=this.getTop(t),e.width=this.getRight(t)-e.x,e.height=this.getBottom(t)-e.y,e},getCenterX:function(t){return(this.getLeft(t)+this.getRight(t))/2},getCenterY:function(t){return(this.getTop(t)+this.getBottom(t))/2},intersects:function(t,e,i,s){return!(i<=this.pixelX||s<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){(void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,s,n){(void 0===e&&(e=t),void 0===i&&(i=t),void 0===s&&(s=t),void 0===n&&(n=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=s,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=s,n)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,s){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==s&&(this.baseHeight=s),this.updatePixelXY(),this},updatePixelXY:function(){var t=this.layer.orientation;if(t===s.ORTHOGONAL)this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight;else if(t===s.ISOMETRIC)this.pixelX=(this.x-this.y)*this.baseWidth*.5,this.pixelY=(this.x+this.y)*this.baseHeight*.5;else if(t===s.STAGGERED)this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*(this.baseHeight/2);else if(t===s.HEXAGONAL){var e=this.layer.hexSideLength,i=(this.baseHeight-e)/2+e;this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*i}return this.right=this.pixelX+this.baseWidth,this.bottom=this.pixelY+this.baseHeight,this},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||void 0!==this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.layer.tilemapLayer;if(t){var e=t.gidMap[this.index];if(e)return e}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=a},89797:(t,e,i)=>{var s=i(56694),n=i(75606),r=i(93560),o=i(72632),a=i(94990),h=i(46422),l=i(12920),u=i(52257),c=i(72677),d=i(13747),p=i(29633),f=i(5047),v=i(87177),g=i(47975),m=new s({initialize:function(t,e){this.scene=t,this.tileWidth=e.tileWidth,this.tileHeight=e.tileHeight,this.width=e.width,this.height=e.height,this.orientation=e.orientation,this.renderOrder=e.renderOrder,this.format=e.format,this.version=e.version,this.properties=e.properties,this.widthInPixels=e.widthInPixels,this.heightInPixels=e.heightInPixels,this.imageCollections=e.imageCollections,this.images=e.images,this.layers=e.layers,this.tilesets=e.tilesets,this.objects=e.objects,this.currentLayerIndex=0,this.hexSideLength=e.hexSideLength;var i=this.orientation;this._convert={WorldToTileXY:f.GetWorldToTileXYFunction(i),WorldToTileX:f.GetWorldToTileXFunction(i),WorldToTileY:f.GetWorldToTileYFunction(i),TileToWorldXY:f.GetTileToWorldXYFunction(i),TileToWorldX:f.GetTileToWorldXFunction(i),TileToWorldY:f.GetTileToWorldYFunction(i)}},setRenderOrder:function(t){var e=["right-down","left-down","right-up","left-up"];return"number"==typeof t&&(t=e[t]),e.indexOf(t)>-1&&(this.renderOrder=t),this},addTilesetImage:function(t,e,i,s,n,o,a){if(void 0===t)return null;if(null==e&&(e=t),!this.scene.sys.textures.exists(e))return console.warn("Invalid Tileset Image: "+e),null;var h=this.scene.sys.textures.get(e),l=this.getTilesetIndex(t);if(null===l&&this.format===r.TILED_JSON)return console.warn("No data found for Tileset: "+t),null;var u=this.tilesets[l];return u?(u.setTileSize(i,s),u.setSpacing(n,o),u.setImage(h),u):(void 0===i&&(i=this.tileWidth),void 0===s&&(s=this.tileHeight),void 0===n&&(n=0),void 0===o&&(o=0),void 0===a&&(a=0),(u=new g(t,a,i,s,n,o)).setImage(h),this.tilesets.push(u),u)},copy:function(t,e,i,s,n,r,o,a){return null!==(a=this.getLayer(a))?(f.Copy(t,e,i,s,n,r,o,a),this):null},createBlankLayer:function(t,e,i,s,n,r,o,h){if(void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=this.width),void 0===r&&(r=this.height),void 0===o&&(o=this.tileWidth),void 0===h&&(h=this.tileHeight),null!==this.getLayerIndex(t))return console.warn("Invalid Tilemap Layer ID: "+t),null;for(var l,u=new a({name:t,tileWidth:o,tileHeight:h,width:n,height:r,orientation:this.orientation}),c=0;c-1&&this.putTileAt(e,r.x,r.y,i,r.tilemapLayer)}return s},removeTileAt:function(t,e,i,s,n){return void 0===i&&(i=!0),void 0===s&&(s=!0),null===(n=this.getLayer(n))?null:f.RemoveTileAt(t,e,i,s,n)},removeTileAtWorldXY:function(t,e,i,s,n,r){return void 0===i&&(i=!0),void 0===s&&(s=!0),null===(r=this.getLayer(r))?null:f.RemoveTileAtWorldXY(t,e,i,s,n,r)},renderDebug:function(t,e,i){return null===(i=this.getLayer(i))?null:(this.orientation===l.ORTHOGONAL&&f.RenderDebug(t,e,i),this)},renderDebugFull:function(t,e){for(var i=this.layers,s=0;s{var s=i(99325),n=i(15043);s.register("tilemap",(function(t){var e=void 0!==t?t:{};return n(this.scene,e.key,e.tileWidth,e.tileHeight,e.width,e.height,e.data,e.insertNull)}))},37940:(t,e,i)=>{var s=i(61286),n=i(15043);s.register("tilemap",(function(t,e,i,s,r,o,a){return null===t&&(t=void 0),null===e&&(e=void 0),null===i&&(i=void 0),null===s&&(s=void 0),null===r&&(r=void 0),n(this.scene,t,e,i,s,r,o,a)}))},87177:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(89980),o=i(5047),a=i(96193),h=new s({Extends:r,Mixins:[n.Alpha,n.BlendMode,n.ComputedSize,n.Depth,n.Flip,n.GetBounds,n.Mask,n.Origin,n.Pipeline,n.Transform,n.Visible,n.ScrollFactor,a],initialize:function(t,e,i,s,n,a){r.call(this,t,"TilemapLayer"),this.isTilemap=!0,this.tilemap=e,this.layerIndex=i,this.layer=e.layers[i],this.layer.tilemapLayer=this,this.tileset=[],this.tilesDrawn=0,this.tilesTotal=this.layer.width*this.layer.height,this.culledTiles=[],this.skipCull=!1,this.cullPaddingX=1,this.cullPaddingY=1,this.cullCallback=o.GetCullTilesFunction(this.layer.orientation),this._renderOrder=0,this.gidMap=[],this.setTilesets(s),this.setAlpha(this.layer.alpha),this.setPosition(n,a),this.setOrigin(0,0),this.setSize(e.tileWidth*this.layer.width,e.tileHeight*this.layer.height),this.initPipeline()},setTilesets:function(t){var e=[],i=[],s=this.tilemap;Array.isArray(t)||(t=[t]);for(var n=0;n=0&&t<4&&(this._renderOrder=t),this},calculateFacesAt:function(t,e){return o.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,s){return o.CalculateFacesWithin(t,e,i,s,this.layer),this},createFromTiles:function(t,e,i,s,n){return o.CreateFromTiles(t,e,i,s,n,this.layer)},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles,this._renderOrder)},copy:function(t,e,i,s,n,r,a){return o.Copy(t,e,i,s,n,r,a,this.layer),this},fill:function(t,e,i,s,n,r){return o.Fill(t,e,i,s,n,r,this.layer),this},filterTiles:function(t,e,i,s,n,r,a){return o.FilterTiles(t,e,i,s,n,r,a,this.layer)},findByIndex:function(t,e,i){return o.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,s,n,r,a){return o.FindTile(t,e,i,s,n,r,a,this.layer)},forEachTile:function(t,e,i,s,n,r,a){return o.ForEachTile(t,e,i,s,n,r,a,this.layer),this},setTint:function(t,e,i,s,n,r){void 0===t&&(t=16777215);return this.forEachTile((function(e){e.tint=t}),this,e,i,s,n,r)},getTileAt:function(t,e,i){return o.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,s){return o.GetTileAtWorldXY(t,e,i,s,this.layer)},getTilesWithin:function(t,e,i,s,n){return o.GetTilesWithin(t,e,i,s,n,this.layer)},getTilesWithinShape:function(t,e,i){return o.GetTilesWithinShape(t,e,i,this.layer)},getTilesWithinWorldXY:function(t,e,i,s,n,r){return o.GetTilesWithinWorldXY(t,e,i,s,n,r,this.layer)},hasTileAt:function(t,e){return o.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return o.HasTileAtWorldXY(t,e,i,this.layer)},putTileAt:function(t,e,i,s){return o.PutTileAt(t,e,i,s,this.layer)},putTileAtWorldXY:function(t,e,i,s,n){return o.PutTileAtWorldXY(t,e,i,s,n,this.layer)},putTilesAt:function(t,e,i,s){return o.PutTilesAt(t,e,i,s,this.layer),this},randomize:function(t,e,i,s,n){return o.Randomize(t,e,i,s,n,this.layer),this},removeTileAt:function(t,e,i,s){return o.RemoveTileAt(t,e,i,s,this.layer)},removeTileAtWorldXY:function(t,e,i,s,n){return o.RemoveTileAtWorldXY(t,e,i,s,n,this.layer)},renderDebug:function(t,e){return o.RenderDebug(t,e,this.layer),this},replaceByIndex:function(t,e,i,s,n,r){return o.ReplaceByIndex(t,e,i,s,n,r,this.layer),this},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},setCollision:function(t,e,i,s){return o.SetCollision(t,e,i,this.layer,s),this},setCollisionBetween:function(t,e,i,s){return o.SetCollisionBetween(t,e,i,s,this.layer),this},setCollisionByProperty:function(t,e,i){return o.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return o.SetCollisionByExclusion(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return o.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileIndexCallback:function(t,e,i){return o.SetTileIndexCallback(t,e,i,this.layer),this},setTileLocationCallback:function(t,e,i,s,n,r){return o.SetTileLocationCallback(t,e,i,s,n,r,this.layer),this},shuffle:function(t,e,i,s){return o.Shuffle(t,e,i,s,this.layer),this},swapByIndex:function(t,e,i,s,n,r){return o.SwapByIndex(t,e,i,s,n,r,this.layer),this},tileToWorldX:function(t,e){return this.tilemap.tileToWorldX(t,e,this)},tileToWorldY:function(t,e){return this.tilemap.tileToWorldY(t,e,this)},tileToWorldXY:function(t,e,i,s){return this.tilemap.tileToWorldXY(t,e,i,s,this)},weightedRandomize:function(t,e,i,s,n){return o.WeightedRandomize(e,i,s,n,t,this.layer),this},worldToTileX:function(t,e,i){return this.tilemap.worldToTileX(t,e,i,this)},worldToTileY:function(t,e,i){return this.tilemap.worldToTileY(t,e,i,this)},worldToTileXY:function(t,e,i,s,n){return this.tilemap.worldToTileXY(t,e,i,s,n,this)},destroy:function(t){void 0===t&&(t=!0),this.tilemap&&(this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),t&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.culledTiles.length=0,this.cullCallback=null,this.gidMap=[],this.tileset=[],r.prototype.destroy.call(this))}});t.exports=h},17394:(t,e,i)=>{var s=i(69360),n=new s,r=new s,o=new s;t.exports=function(t,e,i,s){var a=e.cull(i),h=a.length,l=i.alpha*e.alpha;if(!(0===h||l<=0)){var u=n,c=r,d=o;c.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),u.copyFrom(i.matrix);var p=t.currentContext,f=e.gidMap;p.save(),s?(u.multiplyWithOffset(s,-i.scrollX*e.scrollFactorX,-i.scrollY*e.scrollFactorY),c.e=e.x,c.f=e.y,u.multiply(c,d),d.copyToContext(p)):(c.e-=i.scrollX*e.scrollFactorX,c.f-=i.scrollY*e.scrollFactorY,c.copyToContext(p)),(!t.antialias||e.scaleX>1||e.scaleY>1)&&(p.imageSmoothingEnabled=!1);for(var v=0;v{var s=i(72283),n=s,r=s;n=i(51395),r=i(17394),t.exports={renderWebGL:n,renderCanvas:r}},51395:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i){var n=e.cull(i),r=n.length,o=i.alpha*e.alpha;if(!(0===r||o<=0)){var a=e.gidMap,h=t.pipelines.set(e.pipeline,e),l=s.getTintAppendFloatAlpha,u=e.scrollFactorX,c=e.scrollFactorY,d=e.x,p=e.y,f=e.scaleX,v=e.scaleY;t.pipelines.preBatch(e);for(var g=0;g{var s=i(56694),n=i(93736),r=new s({initialize:function(t,e,i,s,r,o,a,h,l){(void 0===i||i<=0)&&(i=32),(void 0===s||s<=0)&&(s=32),void 0===r&&(r=0),void 0===o&&(o=0),void 0===a&&(a={}),void 0===h&&(h={}),this.name=t,this.firstgid=e,this.tileWidth=i,this.tileHeight=s,this.tileMargin=r,this.tileSpacing=o,this.tileProperties=a,this.tileData=h,this.tileOffset=new n,void 0!==l&&this.tileOffset.set(l.x,l.y),this.image=null,this.glTexture=null,this.rows=0,this.columns=0,this.total=0,this.texCoordinates=[]},getTileProperties:function(t){return this.containsTileIndex(t)?this.tileProperties[t-this.firstgid]:null},getTileData:function(t){return this.containsTileIndex(t)?this.tileData[t-this.firstgid]:null},getTileCollisionGroup:function(t){var e=this.getTileData(t);return e&&e.objectgroup?e.objectgroup:null},containsTileIndex:function(t){return t>=this.firstgid&&t{var s=i(15494);t.exports=function(t,e,i){var n=s(t,e,!0,i),r=s(t,e-1,!0,i),o=s(t,e+1,!0,i),a=s(t-1,e,!0,i),h=s(t+1,e,!0,i),l=n&&n.collides;return l&&(n.faceTop=!0,n.faceBottom=!0,n.faceLeft=!0,n.faceRight=!0),r&&r.collides&&(l&&(n.faceTop=!1),r.faceBottom=!l),o&&o.collides&&(l&&(n.faceBottom=!1),o.faceTop=!l),a&&a.collides&&(l&&(n.faceLeft=!1),a.faceRight=!l),h&&h.collides&&(l&&(n.faceRight=!1),h.faceLeft=!l),n&&!n.collides&&n.resetFaces(),n}},60386:(t,e,i)=>{var s=i(15494),n=i(50811);t.exports=function(t,e,i,r,o){for(var a=null,h=null,l=null,u=null,c=n(t,e,i,r,null,o),d=0;d{var s=new(i(93736));t.exports=function(t,e,i,n){var r=i.tilemapLayer,o=r.cullPaddingX,a=r.cullPaddingY,h=r.tilemap.tileToWorldXY(t,e,s,n,r);return h.x>n.worldView.x+r.scaleX*i.tileWidth*(-o-.5)&&h.xn.worldView.y+r.scaleY*i.tileHeight*(-a-1)&&h.y{var s=i(50811),n=i(60386);t.exports=function(t,e,i,r,o,a,h,l){void 0===h&&(h=!0),t<0&&(t=0),e<0&&(e=0);for(var u=s(t,e,i,r,null,l),c=o-t,d=a-e,p=0;p=0&&f=0&&v{var s=i(50811),n=i(51202);t.exports=function(t,e,i,r,o,a){i||(i={}),Array.isArray(t)||(t=[t]);var h=a.tilemapLayer;r||(r=h.scene),o||(o=r.cameras.main);var l,u=s(0,0,a.width,a.height,null,a),c=[];for(l=0;l{var s=i(74118),n=i(82127),r=i(84314),o=new s;t.exports=function(t,e){var i=t.tilemapLayer.tilemap,s=t.tilemapLayer,a=Math.floor(i.tileWidth*s.scaleX),h=Math.floor(i.tileHeight*s.scaleY),l=r(e.worldView.x-s.x,a,0,!0)-s.cullPaddingX,u=n(e.worldView.right-s.x,a,0,!0)+s.cullPaddingX,c=r(e.worldView.y-s.y,h,0,!0)-s.cullPaddingY,d=n(e.worldView.bottom-s.y,h,0,!0)+s.cullPaddingY;return o.setTo(l,c,u-l,d-c)}},381:(t,e,i)=>{var s=i(71586),n=i(6987);t.exports=function(t,e,i,r){void 0===i&&(i=[]),void 0===r&&(r=0),i.length=0;var o=t.tilemapLayer,a=s(t,e);return(o.skipCull||1!==o.scrollFactorX||1!==o.scrollFactorY)&&(a.left=0,a.right=t.width,a.top=0,a.bottom=t.height),n(t,a,r,i),i}},97734:(t,e,i)=>{var s=i(50811),n=i(60386),r=i(68234);t.exports=function(t,e,i,o,a,h,l){for(var u=-1!==l.collideIndexes.indexOf(t),c=s(e,i,o,a,null,l),d=0;d{var s=i(50811);t.exports=function(t,e,i,n,r,o,a,h){return s(i,n,r,o,a,h).filter(t,e)}},37982:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=0),void 0===i&&(i=!1);var n,r,o,a=0;if(i){for(r=s.height-1;r>=0;r--)for(n=s.width-1;n>=0;n--)if((o=s.data[r][n])&&o.index===t){if(a===e)return o;a+=1}}else for(r=0;r{var s=i(50811);t.exports=function(t,e,i,n,r,o,a,h){return s(i,n,r,o,a,h).find(t,e)||null}},80916:(t,e,i)=>{var s=i(50811);t.exports=function(t,e,i,n,r,o,a,h){s(i,n,r,o,a,h).forEach(t,e)}},31493:(t,e,i)=>{var s=i(12920),n=i(381),r=i(37524),o=i(20887),a=i(72283),h=i(19242);t.exports=function(t){return t===s.ORTHOGONAL?n:t===s.HEXAGONAL?r:t===s.STAGGERED?h:t===s.ISOMETRIC?o:a}},15494:(t,e,i)=>{var s=i(62839);t.exports=function(t,e,i,n){if(void 0===i&&(i=!1),s(t,e,n)){var r=n.data[e][t]||null;return r?-1===r.index?i?r:null:r:null}return null}},24640:(t,e,i)=>{var s=i(15494),n=new(i(93736));t.exports=function(t,e,i,r,o){return o.tilemapLayer.worldToTileXY(t,e,!0,n,r),s(n.x,n.y,i,o)}},16884:(t,e,i)=>{var s=i(12920),n=i(72283),r=i(44150);t.exports=function(t){return t===s.ORTHOGONAL?r:n}},68182:(t,e,i)=>{var s=i(12920),n=i(21715),r=i(21808),o=i(72283),a=i(33388),h=i(46836);t.exports=function(t){return t===s.ORTHOGONAL?h:t===s.ISOMETRIC?r:t===s.HEXAGONAL?n:t===s.STAGGERED?a:o}},3752:(t,e,i)=>{var s=i(12920),n=i(37728),r=i(72283),o=i(84132),a=i(42477);t.exports=function(t){return t===s.ORTHOGONAL?a:t===s.HEXAGONAL?n:t===s.STAGGERED?o:r}},50811:(t,e,i)=>{var s=i(72632);t.exports=function(t,e,i,n,r,o){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=o.width),void 0===n&&(n=o.height),r||(r={});var a=s(r,"isNotEmpty",!1),h=s(r,"isColliding",!1),l=s(r,"hasInterestingFace",!1);t<0&&(i+=t,t=0),e<0&&(n+=e,e=0),t+i>o.width&&(i=Math.max(o.width-t,0)),e+n>o.height&&(n=Math.max(o.height-e,0));for(var u=[],c=e;c{var s=i(84068),n=i(50811),r=i(7563),o=i(72283),a=i(93736),h=function(t,e){return r.RectangleToTriangle(e,t)},l=new a,u=new a,c=new a;t.exports=function(t,e,i,a){if(void 0===t)return[];var d=o;t instanceof s.Circle?d=r.CircleToRectangle:t instanceof s.Rectangle?d=r.RectangleToRectangle:t instanceof s.Triangle?d=h:t instanceof s.Line&&(d=r.LineToRectangle),a.tilemapLayer.worldToTileXY(t.left,t.top,!0,u,i);var p=u.x,f=u.y;a.tilemapLayer.worldToTileXY(t.right,t.bottom,!1,c,i);var v=Math.ceil(c.x),g=Math.ceil(c.y),m=Math.max(v-p,1),y=Math.max(g-f,1),x=n(p,f,m,y,e,a),T=a.tileWidth,w=a.tileHeight;a.tilemapLayer&&(T*=a.tilemapLayer.scaleX,w*=a.tilemapLayer.scaleY);for(var b=[],E=new s.Rectangle(0,0,T,w),S=0;S{var s=i(50811),n=i(93736),r=new n,o=new n;t.exports=function(t,e,i,n,a,h,l){var u=l.tilemapLayer.tilemap._convert.WorldToTileXY;u(t,e,!0,r,h,l);var c=r.x,d=r.y;u(t+i,e+n,!1,o,h,l);var p=Math.ceil(o.x),f=Math.ceil(o.y);return s(c,d,p-c,f-d,a,l)}},29296:(t,e,i)=>{var s=i(12920),n=i(72283),r=i(806);t.exports=function(t){return t===s.ORTHOGONAL?r:n}},32688:(t,e,i)=>{var s=i(12920),n=i(11516),r=i(18750),o=i(72283),a=i(90562),h=i(45676);t.exports=function(t){return t===s.ORTHOGONAL?h:t===s.ISOMETRIC?r:t===s.HEXAGONAL?n:t===s.STAGGERED?a:o}},74326:(t,e,i)=>{var s=i(12920),n=i(44382),r=i(72283),o=i(3689),a=i(70520);t.exports=function(t){return t===s.ORTHOGONAL?a:t===s.HEXAGONAL?n:t===s.STAGGERED?o:r}},46598:(t,e,i)=>{var s=i(62839);t.exports=function(t,e,i){if(s(t,e,i)){var n=i.data[e][t];return null!==n&&n.index>-1}return!1}},28654:(t,e,i)=>{var s=i(46598),n=new(i(93736));t.exports=function(t,e,i,r){r.tilemapLayer.worldToTileXY(t,e,!0,n,i);var o=n.x,a=n.y;return s(o,a,r)}},6358:(t,e,i)=>{var s=i(82127),n=i(84314);t.exports=function(t,e){var i=t.tilemapLayer.tilemap,r=t.tilemapLayer,o=Math.floor(i.tileWidth*r.scaleX),a=Math.floor(i.tileHeight*r.scaleY),h=t.hexSideLength,l=(a-h)/2+h;return{left:n(e.worldView.x-r.x,o,0,!0)-r.cullPaddingX,right:s(e.worldView.right-r.x,o,0,!0)+r.cullPaddingX,top:n(e.worldView.y-r.y,l,0,!0)-r.cullPaddingY,bottom:s(e.worldView.bottom-r.y,l,0,!0)+r.cullPaddingY}}},37524:(t,e,i)=>{var s=i(6358),n=i(6987);t.exports=function(t,e,i,r){void 0===i&&(i=[]),void 0===r&&(r=0),i.length=0;var o=t.tilemapLayer;if(!o.skipCull&&1===o.scrollFactorX&&1===o.scrollFactorY){var a=s(t,e);n(t,a,r,i)}return i}},21715:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r){i||(i=new s);var o=r.baseTileWidth,a=r.baseTileHeight,h=r.tilemapLayer,l=0,u=0;h&&(n||(n=h.scene.cameras.main),l=h.x+n.scrollX*(1-h.scrollFactorX),o*=h.scaleX,u=h.y+n.scrollY*(1-h.scrollFactorY),a*=h.scaleY);var c=r.hexSideLength,d=l+t*o+e%2*(o/2),p=u+e*((a-c)/2+c);return i.set(d,p)}},37728:t=>{t.exports=function(t,e,i){var s=i.baseTileHeight,n=i.tilemapLayer,r=0;n&&(void 0===e&&(e=n.scene.cameras.main),r=n.y+e.scrollY*(1-n.scrollFactorY),s*=n.scaleY);var o=n.tilemap.hexSideLength;return r+t*((s-o)/2+o)}},11516:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r,o){n||(n=new s);var a=o.baseTileWidth,h=o.baseTileHeight,l=o.tilemapLayer;l&&(r||(r=l.scene.cameras.main),e-=l.y+r.scrollY*(1-l.scrollFactorY),h*=l.scaleY,t-=l.x+r.scrollX*(1-l.scrollFactorX),a*=l.scaleX);var u=o.hexSideLength,c=(h-u)/2+u,d=i?Math.floor(e/c):e/c,p=i?Math.floor((t-d%2*.5*a)/a):(t-d%2*.5*a)/a;return n.set(p,d)}},44382:t=>{t.exports=function(t,e,i,s){var n=s.baseTileHeight,r=s.tilemapLayer;r&&(i||(i=r.scene.cameras.main),t-=r.y+i.scrollY*(1-r.scrollFactorY),n*=r.scaleY);var o=s.hexSideLength,a=(n-o)/2+o;return e?Math.floor(t/a):t/a}},62839:t=>{t.exports=function(t,e,i){return t>=0&&t=0&&e{var s=i(13125);t.exports=function(t,e,i,n){void 0===i&&(i=[]),void 0===n&&(n=0),i.length=0;var r,o,a,h=t.tilemapLayer,l=t.data,u=t.width,c=t.height,d=u,p=c;if(!h.skipCull)if(0===n){for(o=0;o=0;r--)if(s(r,o,t,e)){if(!(a=l[o][r])||-1===a.index||!a.visible||0===a.alpha)continue;i.push(a)}}else if(2===n){for(o=p;o>=0;o--)for(r=0;l[o]&&r=0;o--)for(r=d;l[o]&&r>=0;r--)if(s(r,o,t,e)){if(!(a=l[o][r])||-1===a.index||!a.visible||0===a.alpha)continue;i.push(a)}return h.tilesDrawn=i.length,h.tilesTotal=u*c,i}},21808:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r){i||(i=new s);var o=r.baseTileWidth,a=r.baseTileHeight,h=r.tilemapLayer,l=0,u=0;h&&(n||(n=h.scene.cameras.main),l=h.x+n.scrollX*(1-h.scrollFactorX),o*=h.scaleX,u=h.y+n.scrollY*(1-h.scrollFactorY),a*=h.scaleY);var c=l+o/2*(t-e),d=u+(t+e)*(a/2);return i.set(c,d)}},18750:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r,o){n||(n=new s);var a=o.baseTileWidth,h=o.baseTileHeight,l=o.tilemapLayer;l&&(r||(r=l.scene.cameras.main),e-=l.y+r.scrollY*(1-l.scrollFactorY),h*=l.scaleY,t-=l.x+r.scrollX*(1-l.scrollFactorX),a*=l.scaleX);var u=i?Math.floor((t/(a/2)+e/(h/2))/2):(t/(a/2)+e/(h/2))/2,c=i?Math.floor((e/(h/2)-t/(a/2))/2):(e/(h/2)-t/(a/2))/2;return n.set(u,c)}},29003:(t,e,i)=>{var s=i(29633),n=i(62839),r=i(92839),o=i(68234),a=i(14556);t.exports=function(t,e,i,h,l){if(void 0===h&&(h=!0),!n(e,i,l))return null;var u,c=l.data[i][e],d=c&&c.collides;t instanceof s?(null===l.data[i][e]&&(l.data[i][e]=new s(l,t.index,e,i,l.tileWidth,l.tileHeight)),l.data[i][e].copy(t)):(u=t,null===l.data[i][e]?l.data[i][e]=new s(l,u,e,i,l.tileWidth,l.tileHeight):l.data[i][e].index=u);var p=l.data[i][e],f=-1!==l.collideIndexes.indexOf(p.index),v=a(l.tilemapLayer.tilemap)[u=t instanceof s?t.index:t][2],g=l.tilemapLayer.tileset[v];return p.width=g.tileWidth,p.height=g.tileHeight,o(p,f),h&&d!==p.collides&&r(e,i,l),p}},48565:(t,e,i)=>{var s=i(29003),n=new(i(93736));t.exports=function(t,e,i,r,o,a){return a.tilemapLayer.worldToTileXY(e,i,!0,n,o,a),s(t,n.x,n.y,r,a)}},56547:(t,e,i)=>{var s=i(60386),n=i(29003);t.exports=function(t,e,i,r,o){if(void 0===r&&(r=!0),!Array.isArray(t))return null;Array.isArray(t[0])||(t=[t]);for(var a=t.length,h=t[0].length,l=0;l{var s=i(50811),n=i(72861);t.exports=function(t,e,i,r,o,a){var h,l=s(t,e,i,r,{},a);if(!o)for(o=[],h=0;h{var s=i(29633),n=i(62839),r=i(92839);t.exports=function(t,e,i,o,a){if(void 0===i&&(i=!0),void 0===o&&(o=!0),!n(t,e,a))return null;var h=a.data[e][t];return h?(a.data[e][t]=i?null:new s(a,-1,t,e,a.tileWidth,a.tileHeight),o&&h&&h.collides&&r(t,e,a),h):null}},17384:(t,e,i)=>{var s=i(929),n=new(i(93736));t.exports=function(t,e,i,r,o,a){return a.tilemapLayer.worldToTileXY(t,e,!0,n,o,a),s(n.x,n.y,i,r,a)}},93763:(t,e,i)=>{var s=i(50811),n=i(95509),r=new n(105,210,231,150),o=new n(243,134,48,200),a=new n(40,39,37,150);t.exports=function(t,e,i){void 0===e&&(e={});var n=void 0!==e.tileColor?e.tileColor:r,h=void 0!==e.collidingTileColor?e.collidingTileColor:o,l=void 0!==e.faceColor?e.faceColor:a,u=s(0,0,i.width,i.height,null,i);t.translateCanvas(i.tilemapLayer.x,i.tilemapLayer.y),t.scaleCanvas(i.tilemapLayer.scaleX,i.tilemapLayer.scaleY);for(var c=0;c{var s=i(50811);t.exports=function(t,e,i,n,r,o,a){for(var h=s(i,n,r,o,null,a),l=0;l{t.exports=function(t,e,i,s){var n,r,o,a=t.data,h=t.width,l=t.height,u=t.tilemapLayer,c=Math.max(0,e.left),d=Math.min(h,e.right),p=Math.max(0,e.top),f=Math.min(l,e.bottom);if(0===i)for(r=p;r=c;n--)(o=a[r][n])&&-1!==o.index&&o.visible&&0!==o.alpha&&s.push(o);else if(2===i)for(r=f;r>=p;r--)for(n=c;a[r]&&n=p;r--)for(n=d;a[r]&&n>=c;n--)(o=a[r][n])&&-1!==o.index&&o.visible&&0!==o.alpha&&s.push(o);return u.tilesDrawn=s.length,u.tilesTotal=h*l,s}},51710:(t,e,i)=>{var s=i(68234),n=i(60386),r=i(91181);t.exports=function(t,e,i,o,a){void 0===e&&(e=!0),void 0===i&&(i=!0),void 0===a&&(a=!0),Array.isArray(t)||(t=[t]);for(var h=0;h{var s=i(68234),n=i(60386),r=i(91181);t.exports=function(t,e,i,o,a,h){if(void 0===i&&(i=!0),void 0===o&&(o=!0),void 0===h&&(h=!0),!(t>e)){for(var l=t;l<=e;l++)r(l,i,a);if(h)for(var u=0;u=t&&d.index<=e&&s(d,i)}o&&n(0,0,a.width,a.height,a)}}},33158:(t,e,i)=>{var s=i(68234),n=i(60386),r=i(91181);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var a=0;a{var s=i(68234),n=i(60386),r=i(19256);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0);for(var a=0;a{var s=i(68234),n=i(60386);t.exports=function(t,e,i){void 0===t&&(t=!0),void 0===e&&(e=!0);for(var r=0;r0&&s(a,t)}}e&&n(0,0,i.width,i.height,i)}},91181:t=>{t.exports=function(t,e,i){var s=i.collideIndexes.indexOf(t);e&&-1===s?i.collideIndexes.push(t):e||-1===s||i.collideIndexes.splice(s,1)}},68234:t=>{t.exports=function(t,e){e?t.setCollision(!0,!0,!0,!0,!1):t.resetCollision(!1)}},11628:t=>{t.exports=function(t,e,i,s){if("number"==typeof t)s.callbacks[t]=null!==e?{callback:e,callbackContext:i}:void 0;else for(var n=0,r=t.length;n{var s=i(50811);t.exports=function(t,e,i,n,r,o,a){for(var h=s(t,e,i,n,null,a),l=0;l{var s=i(50811),n=i(18592);t.exports=function(t,e,i,r,o){var a=s(t,e,i,r,null,o),h=a.map((function(t){return t.index}));n(h);for(var l=0;l{var s=i(82127),n=i(84314);t.exports=function(t,e){var i=t.tilemapLayer.tilemap,r=t.tilemapLayer,o=Math.floor(i.tileWidth*r.scaleX),a=Math.floor(i.tileHeight*r.scaleY);return{left:n(e.worldView.x-r.x,o,0,!0)-r.cullPaddingX,right:s(e.worldView.right-r.x,o,0,!0)+r.cullPaddingX,top:n(e.worldView.y-r.y,a/2,0,!0)-r.cullPaddingY,bottom:s(e.worldView.bottom-r.y,a/2,0,!0)+r.cullPaddingY}}},19242:(t,e,i)=>{var s=i(53945),n=i(6987);t.exports=function(t,e,i,r){void 0===i&&(i=[]),void 0===r&&(r=0),i.length=0;var o=t.tilemapLayer;if(!o.skipCull&&1===o.scrollFactorX&&1===o.scrollFactorY){var a=s(t,e);n(t,a,r,i)}return i}},33388:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r){i||(i=new s);var o=r.baseTileWidth,a=r.baseTileHeight,h=r.tilemapLayer,l=0,u=0;h&&(n||(n=h.scene.cameras.main),l=h.x+n.scrollX*(1-h.scrollFactorX),o*=h.scaleX,u=h.y+n.scrollY*(1-h.scrollFactorY),a*=h.scaleY);var c=l+t*o+e%2*(o/2),d=u+e*(a/2);return i.set(c,d)}},84132:t=>{t.exports=function(t,e,i){var s=i.baseTileHeight,n=i.tilemapLayer,r=0;return n&&(void 0===e&&(e=n.scene.cameras.main),r=n.y+e.scrollY*(1-n.scrollFactorY),s*=n.scaleY),r+t*(s/2)+s}},90562:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r,o){n||(n=new s);var a=o.baseTileWidth,h=o.baseTileHeight,l=o.tilemapLayer;l&&(r||(r=l.scene.cameras.main),e-=l.y+r.scrollY*(1-l.scrollFactorY),h*=l.scaleY,t-=l.x+r.scrollX*(1-l.scrollFactorX),a*=l.scaleX);var u=i?Math.floor(e/(h/2)):e/(h/2),c=i?Math.floor((t+u%2*.5*a)/a):(t+u%2*.5*a)/a;return n.set(c,u)}},3689:t=>{t.exports=function(t,e,i,s){var n=s.baseTileHeight,r=s.tilemapLayer;return r&&(i||(i=r.scene.cameras.main),t-=r.y+i.scrollY*(1-r.scrollFactorY),n*=r.scaleY),e?Math.floor(t/(n/2)):t/(n/2)}},55217:(t,e,i)=>{var s=i(50811);t.exports=function(t,e,i,n,r,o,a){for(var h=s(i,n,r,o,null,a),l=0;l{t.exports=function(t,e,i){var s=i.baseTileWidth,n=i.tilemapLayer,r=0;return n&&(e||(e=n.scene.cameras.main),r=n.x+e.scrollX*(1-n.scrollFactorX),s*=n.scaleX),r+t*s}},46836:(t,e,i)=>{var s=i(44150),n=i(42477),r=i(93736);t.exports=function(t,e,i,o,a){return i||(i=new r(0,0)),i.x=s(t,o,a),i.y=n(e,o,a),i}},42477:t=>{t.exports=function(t,e,i){var s=i.baseTileHeight,n=i.tilemapLayer,r=0;return n&&(e||(e=n.scene.cameras.main),r=n.y+e.scrollY*(1-n.scrollFactorY),s*=n.scaleY),r+t*s}},39677:(t,e,i)=>{var s=i(50811);t.exports=function(t,e,i,n,r,o){if(r){var a,h=s(t,e,i,n,null,o),l=0;for(a=0;a{t.exports=function(t,e,i,s){void 0===e&&(e=!0);var n=s.baseTileWidth,r=s.tilemapLayer;return r&&(i||(i=r.scene.cameras.main),t-=r.x+i.scrollX*(1-r.scrollFactorX),n*=r.scaleX),e?Math.floor(t/n):t/n}},45676:(t,e,i)=>{var s=i(806),n=i(70520),r=i(93736);t.exports=function(t,e,i,o,a,h){return void 0===i&&(i=!0),o||(o=new r(0,0)),o.x=s(t,i,a,h),o.y=n(e,i,a,h),o}},70520:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=!0);var n=s.baseTileHeight,r=s.tilemapLayer;return r&&(i||(i=r.scene.cameras.main),t-=r.y+i.scrollY*(1-r.scrollFactorY),n*=r.scaleY),e?Math.floor(t/n):t/n}},5047:(t,e,i)=>{t.exports={CalculateFacesAt:i(92839),CalculateFacesWithin:i(60386),CheckIsoBounds:i(13125),Copy:i(17347),CreateFromTiles:i(93604),CullBounds:i(71586),CullTiles:i(381),Fill:i(97734),FilterTiles:i(63555),FindByIndex:i(37982),FindTile:i(48297),ForEachTile:i(80916),GetCullTilesFunction:i(31493),GetTileAt:i(15494),GetTileAtWorldXY:i(24640),GetTilesWithin:i(50811),GetTilesWithinShape:i(31674),GetTilesWithinWorldXY:i(44662),GetTileToWorldXFunction:i(16884),GetTileToWorldXYFunction:i(68182),GetTileToWorldYFunction:i(3752),GetWorldToTileXFunction:i(29296),GetWorldToTileXYFunction:i(32688),GetWorldToTileYFunction:i(74326),HasTileAt:i(46598),HasTileAtWorldXY:i(28654),HexagonalCullBounds:i(6358),HexagonalCullTiles:i(37524),HexagonalTileToWorldXY:i(21715),HexagonalTileToWorldY:i(37728),HexagonalWorldToTileXY:i(11516),HexagonalWorldToTileY:i(44382),IsInLayerBounds:i(62839),IsometricCullTiles:i(20887),IsometricTileToWorldXY:i(21808),IsometricWorldToTileXY:i(18750),PutTileAt:i(29003),PutTileAtWorldXY:i(48565),PutTilesAt:i(56547),Randomize:i(91180),RemoveTileAt:i(929),RemoveTileAtWorldXY:i(17384),RenderDebug:i(93763),ReplaceByIndex:i(51202),RunCull:i(6987),SetCollision:i(51710),SetCollisionBetween:i(15216),SetCollisionByExclusion:i(33158),SetCollisionByProperty:i(4180),SetCollisionFromCollisionGroup:i(18625),SetLayerCollisionIndex:i(91181),SetTileCollision:i(68234),SetTileIndexCallback:i(11628),SetTileLocationCallback:i(72732),Shuffle:i(34397),StaggeredCullBounds:i(53945),StaggeredCullTiles:i(19242),StaggeredTileToWorldXY:i(33388),StaggeredTileToWorldY:i(84132),StaggeredWorldToTileXY:i(90562),StaggeredWorldToTileY:i(3689),SwapByIndex:i(55217),TileToWorldX:i(44150),TileToWorldXY:i(46836),TileToWorldY:i(42477),WeightedRandomize:i(39677),WorldToTileX:i(806),WorldToTileXY:i(45676),WorldToTileY:i(70520)}},12920:t=>{t.exports={ORTHOGONAL:0,ISOMETRIC:1,STAGGERED:2,HEXAGONAL:3}},84758:(t,e,i)=>{var s={ORIENTATION:i(12920)};t.exports=s},52678:(t,e,i)=>{var s=i(98611),n=i(84758),r={Components:i(5047),Parsers:i(34124),Formats:i(93560),ImageCollection:i(97042),ParseToTilemap:i(15043),Tile:i(29633),Tilemap:i(89797),TilemapCreator:i(4843),TilemapFactory:i(37940),Tileset:i(47975),TilemapLayer:i(87177),Orientation:i(12920),LayerData:i(94990),MapData:i(16586),ObjectLayer:i(15256)};r=s(!1,r,n.ORIENTATION),t.exports=r},94990:(t,e,i)=>{var s=i(56694),n=i(12920),r=i(72632),o=new s({initialize:function(t){void 0===t&&(t={}),this.name=r(t,"name","layer"),this.x=r(t,"x",0),this.y=r(t,"y",0),this.width=r(t,"width",0),this.height=r(t,"height",0),this.tileWidth=r(t,"tileWidth",0),this.tileHeight=r(t,"tileHeight",0),this.baseTileWidth=r(t,"baseTileWidth",this.tileWidth),this.baseTileHeight=r(t,"baseTileHeight",this.tileHeight),this.orientation=r(t,"orientation",n.ORTHOGONAL),this.widthInPixels=r(t,"widthInPixels",this.width*this.baseTileWidth),this.heightInPixels=r(t,"heightInPixels",this.height*this.baseTileHeight),this.alpha=r(t,"alpha",1),this.visible=r(t,"visible",!0),this.properties=r(t,"properties",[]),this.indexes=r(t,"indexes",[]),this.collideIndexes=r(t,"collideIndexes",[]),this.callbacks=r(t,"callbacks",[]),this.bodies=r(t,"bodies",[]),this.data=r(t,"data",[]),this.tilemapLayer=r(t,"tilemapLayer",null),this.hexSideLength=r(t,"hexSideLength",0)}});t.exports=o},16586:(t,e,i)=>{var s=i(56694),n=i(12920),r=i(72632),o=new s({initialize:function(t){void 0===t&&(t={}),this.name=r(t,"name","map"),this.width=r(t,"width",0),this.height=r(t,"height",0),this.infinite=r(t,"infinite",!1),this.tileWidth=r(t,"tileWidth",0),this.tileHeight=r(t,"tileHeight",0),this.widthInPixels=r(t,"widthInPixels",this.width*this.tileWidth),this.heightInPixels=r(t,"heightInPixels",this.height*this.tileHeight),this.format=r(t,"format",null),this.orientation=r(t,"orientation",n.ORTHOGONAL),this.renderOrder=r(t,"renderOrder","right-down"),this.version=r(t,"version","1"),this.properties=r(t,"properties",{}),this.layers=r(t,"layers",[]),this.images=r(t,"images",[]),this.objects=r(t,"objects",[]),this.collision=r(t,"collision",{}),this.tilesets=r(t,"tilesets",[]),this.imageCollections=r(t,"imageCollections",[]),this.tiles=r(t,"tiles",[]),this.hexSideLength=r(t,"hexSideLength",0)}});t.exports=o},15256:(t,e,i)=>{var s=i(56694),n=i(72632),r=new s({initialize:function(t){void 0===t&&(t={}),this.name=n(t,"name","object layer"),this.opacity=n(t,"opacity",1),this.properties=n(t,"properties",{}),this.propertyTypes=n(t,"propertytypes",{}),this.type=n(t,"type","objectgroup"),this.visible=n(t,"visible",!0),this.objects=n(t,"objects",[])}});t.exports=r},21394:(t,e,i)=>{var s=i(12920);t.exports=function(t){return"isometric"===(t=t.toLowerCase())?s.ISOMETRIC:"staggered"===t?s.STAGGERED:"hexagonal"===t?s.HEXAGONAL:s.ORTHOGONAL}},90715:(t,e,i)=>{var s=i(93560),n=i(84346),r=i(96097),o=i(2378),a=i(44909);t.exports=function(t,e,i,h,l,u){var c;switch(e){case s.ARRAY_2D:c=n(t,i,h,l,u);break;case s.CSV:c=r(t,i,h,l,u);break;case s.TILED_JSON:c=o(t,i,u);break;case s.WELTMEISTER:c=a(t,i,u);break;default:console.warn("Unrecognized tilemap data format: "+e),c=null}return c}},84346:(t,e,i)=>{var s=i(93560),n=i(94990),r=i(16586),o=i(29633);t.exports=function(t,e,i,a,h){for(var l=new n({tileWidth:i,tileHeight:a}),u=new r({name:t,tileWidth:i,tileHeight:a,format:s.ARRAY_2D,layers:[l]}),c=[],d=e.length,p=0,f=0;f{var s=i(93560),n=i(84346);t.exports=function(t,e,i,r,o){var a=e.trim().split("\n").map((function(t){return t.split(",")})),h=n(t,a,i,r,o);return h.format=s.CSV,h}},30951:(t,e,i)=>{var s=i(94990),n=i(29633);t.exports=function(t,e){for(var i=[],r=0;r-1?new n(a,p,c,u,o.tilesize,o.tilesize):e?null:new n(a,-1,c,u,o.tilesize,o.tilesize),h.push(d)}l.push(h),h=[]}a.data=l,i.push(a)}return i}},47488:(t,e,i)=>{var s=i(47975);t.exports=function(t){for(var e=[],i=[],n=0;n{var s=i(93560),n=i(16586),r=i(30951),o=i(47488);t.exports=function(t,e,i){if(0===e.layer.length)return console.warn("No layers found in the Weltmeister map: "+t),null;for(var a=0,h=0,l=0;la&&(a=e.layer[l].width),e.layer[l].height>h&&(h=e.layer[l].height);var u=new n({width:a,height:h,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:s.WELTMEISTER});return u.layers=r(e,i),u.tilesets=o(e),u}},24507:(t,e,i)=>{t.exports={ParseTileLayers:i(30951),ParseTilesets:i(47488),ParseWeltmeister:i(44909)}},34124:(t,e,i)=>{t.exports={FromOrientationString:i(21394),Parse:i(90715),Parse2DArray:i(84346),ParseCSV:i(96097),Impact:i(24507),Tiled:i(50044)}},48646:(t,e,i)=>{var s=i(98611);t.exports=function(t){for(var e,i,n,r,o,a=0;a{t.exports=function(t){for(var e=window.atob(t),i=e.length,s=new Array(i/4),n=0;n>>0;return s}},14556:(t,e,i)=>{var s=i(47975);t.exports=function(t){var e,i,n=[];for(e=0;e{var s=i(72632);t.exports=function(t,e,i){if(!e)return{i:0,layers:t.layers,name:"",opacity:1,visible:!0,x:0,y:0};var n=e.x+s(e,"startx",0)*t.tilewidth+s(e,"offsetx",0),r=e.y+s(e,"starty",0)*t.tileheight+s(e,"offsety",0);return{i:0,layers:e.layers,name:i.name+e.name+"/",opacity:i.opacity*e.opacity,visible:i.visible&&e.visible,x:i.x+n,y:i.y+r}}},8847:t=>{var e=2147483648,i=1073741824,s=536870912;t.exports=function(t){var n=Boolean(t&e),r=Boolean(t&i),o=Boolean(t&s);t&=536870911;var a=0,h=!1;return n&&r&&o?(a=Math.PI/2,h=!0):n&&r&&!o?(a=Math.PI,h=!1):n&&!r&&o?(a=Math.PI/2,h=!1):!n||r||o?!n&&r&&o?(a=3*Math.PI/2,h=!1):n||!r||o?n||r||!o?n||r||o||(a=0,h=!1):(a=3*Math.PI/2,h=!0):(a=Math.PI,h=!0):(a=0,h=!0),{gid:t,flippedHorizontal:n,flippedVertical:r,flippedAntiDiagonal:o,rotation:a,flipped:h}}},78339:(t,e,i)=>{var s=i(72632),n=i(92044);t.exports=function(t){for(var e=[],i=[],r=n(t);r.i0;)if(r.i>=r.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}r=i.pop()}else{var o=r.layers[r.i];if(r.i++,"imagelayer"===o.type){var a=s(o,"offsetx",0)+s(o,"startx",0),h=s(o,"offsety",0)+s(o,"starty",0);e.push({name:r.name+o.name,image:o.image,x:r.x+a+o.x,y:r.y+h+o.y,alpha:r.opacity*o.opacity,visible:r.visible&&o.visible,properties:s(o,"properties",{})})}else if("group"===o.type){var l=n(t,o,r);i.push(r),r=l}}return e}},2378:(t,e,i)=>{var s=i(48646),n=i(14556),r=i(12920),o=i(93560),a=i(21394),h=i(16586),l=i(78339),u=i(61136),c=i(95925),d=i(93392);t.exports=function(t,e,i){var p=new h({width:e.width,height:e.height,name:t,tileWidth:e.tilewidth,tileHeight:e.tileheight,orientation:a(e.orientation),format:o.TILED_JSON,version:e.version,properties:e.properties,renderOrder:e.renderorder,infinite:e.infinite});p.orientation===r.HEXAGONAL&&(p.hexSideLength=e.hexsidelength),p.layers=c(e,i),p.images=l(e);var f=d(e);return p.tilesets=f.tilesets,p.imageCollections=f.imageCollections,p.objects=u(e),p.tiles=n(p),s(p),p}},4281:(t,e,i)=>{var s=i(28820),n=i(8847),r=function(t){return{x:t.x,y:t.y}},o=["id","name","type","rotation","properties","visible","x","y","width","height"];t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0);var a=s(t,o);if(a.x+=e,a.y+=i,t.gid){var h=n(t.gid);a.gid=h.gid,a.flippedHorizontal=h.flippedHorizontal,a.flippedVertical=h.flippedVertical,a.flippedAntiDiagonal=h.flippedAntiDiagonal}else t.polyline?a.polyline=t.polyline.map(r):t.polygon?a.polygon=t.polygon.map(r):t.ellipse?a.ellipse=t.ellipse:t.text?a.text=t.text:t.point?a.point=!0:a.rectangle=!0;return a}},61136:(t,e,i)=>{var s=i(72632),n=i(4281),r=i(15256),o=i(92044);t.exports=function(t){for(var e=[],i=[],a=o(t);a.i0;)if(a.i>=a.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}a=i.pop()}else{var h=a.layers[a.i];if(a.i++,h.opacity*=a.opacity,h.visible=a.visible&&h.visible,"objectgroup"===h.type){h.name=a.name+h.name;for(var l=a.x+s(h,"startx",0)+s(h,"offsetx",0),u=a.y+s(h,"starty",0)+s(h,"offsety",0),c=[],d=0;d{var s=i(43908),n=i(12920),r=i(92044),o=i(21394),a=i(72632),h=i(94990),l=i(8847),u=i(29633);t.exports=function(t,e){for(var i=a(t,"infinite",!1),c=[],d=[],p=r(t);p.i0;)if(p.i>=p.layers.length){if(d.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}p=d.pop()}else{var f=p.layers[p.i];if(p.i++,"tilelayer"===f.type)if(f.compression)console.warn("TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '"+f.name+"'");else{if(f.encoding&&"base64"===f.encoding){if(f.chunks)for(var v=0;v0?((y=new u(g,m.gid,L,F,t.tilewidth,t.tileheight)).rotation=m.rotation,y.flipX=m.flipped,T[F][L]=y):(x=e?null:new u(g,-1,L,F,t.tilewidth,t.tileheight),T[F][L]=x),++w===_.width&&(M++,w=0)}}else{(g=new h({name:p.name+f.name,x:p.x+a(f,"offsetx",0)+f.x,y:p.y+a(f,"offsety",0)+f.y,width:f.width,height:f.height,tileWidth:t.tilewidth,tileHeight:t.tileheight,alpha:p.opacity*f.opacity,visible:p.visible&&f.visible,properties:a(f,"properties",[]),orientation:o(t.orientation)})).orientation===n.HEXAGONAL&&(g.hexSideLength=t.hexsidelength);for(var D=[],k=0,I=f.data.length;k0?((y=new u(g,m.gid,w,T.length,t.tilewidth,t.tileheight)).rotation=m.rotation,y.flipX=m.flipped,D.push(y)):(x=e?null:new u(g,-1,w,T.length,t.tilewidth,t.tileheight),D.push(x)),++w===f.width&&(T.push(D),w=0,D=[])}g.data=T,c.push(g)}else if("group"===f.type){var B=r(t,f,p);d.push(p),p=B}}return c}},93392:(t,e,i)=>{var s=i(47975),n=i(97042),r=i(4281),o=i(39642);t.exports=function(t){for(var e,i=[],a=[],h=null,l=0;l1){var d=void 0,p=void 0;if(Array.isArray(u.tiles)){d=d||{},p=p||{};for(var f=0;f{t.exports=function(t,e){for(var i=0;i0){var r,o,a,h={},l={};if(Array.isArray(s.edgecolors))for(r=0;r{t.exports={AssignTileProperties:i(48646),Base64Decode:i(43908),BuildTilesetIndex:i(14556),CreateGroupLayer:i(92044),ParseGID:i(8847),ParseImageLayers:i(78339),ParseJSONTiled:i(2378),ParseObject:i(4281),ParseObjectLayers:i(61136),ParseTileLayers:i(95925),ParseTilesets:i(93392)}},73779:(t,e,i)=>{var s=i(56694),n=i(91963),r=i(7599),o=i(57911),a=i(66458),h=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.now=0,this.timeScale=1,this.paused=!1,this._active=[],this._pendingInsertion=[],this._pendingRemoval=[],t.sys.events.once(r.BOOT,this.boot,this),t.sys.events.on(r.START,this.start,this)},boot:function(){this.now=this.systems.game.loop.time,this.systems.events.once(r.DESTROY,this.destroy,this)},start:function(){var t=this.systems.events;t.on(r.PRE_UPDATE,this.preUpdate,this),t.on(r.UPDATE,this.update,this),t.once(r.SHUTDOWN,this.shutdown,this)},addEvent:function(t){var e;return t instanceof o?(e=t,this.removeEvent(e),e.elapsed=e.startAt,e.hasDispatched=!1,e.repeatCount=-1===e.repeat||e.loop?999999999999:e.repeat):e=new o(t),this._pendingInsertion.push(e),e},delayedCall:function(t,e,i,s){return this.addEvent({delay:t,callback:e,args:i,callbackScope:s})},clearPendingEvents:function(){return this._pendingInsertion=[],this},removeEvent:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e-1&&this._active.splice(n,1),s.destroy()}for(i=0;i=s.delay)){var n=s.elapsed-s.delay;if(s.elapsed=s.delay,!s.hasDispatched&&s.callback&&(s.hasDispatched=!0,s.callback.apply(s.callbackScope,s.args)),s.repeatCount>0){if(s.repeatCount--,n>=s.delay)for(;n>=s.delay&&s.repeatCount>0;)s.callback&&s.callback.apply(s.callbackScope,s.args),n-=s.delay,s.repeatCount--;s.elapsed=n,s.hasDispatched=!1}else s.hasDispatched&&this._pendingRemoval.push(s)}}}},shutdown:function(){var t;for(t=0;t{var s=i(56694),n=i(72632),r=new s({initialize:function(t){this.delay=0,this.repeat=0,this.repeatCount=0,this.loop=!1,this.callback,this.callbackScope,this.args,this.timeScale=1,this.startAt=0,this.elapsed=0,this.paused=!1,this.hasDispatched=!1,this.reset(t)},reset:function(t){return this.delay=n(t,"delay",0),this.repeat=n(t,"repeat",0),this.loop=n(t,"loop",!1),this.callback=n(t,"callback",void 0),this.callbackScope=n(t,"callbackScope",this.callback),this.args=n(t,"args",[]),this.timeScale=n(t,"timeScale",1),this.startAt=n(t,"startAt",0),this.paused=n(t,"paused",!1),this.elapsed=this.startAt,this.hasDispatched=!1,this.repeatCount=-1===this.repeat||this.loop?999999999999:this.repeat,this},getProgress:function(){return this.elapsed/this.delay},getOverallProgress:function(){if(this.repeat>0){var t=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/t}return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return.001*this.elapsed},getRemaining:function(){return this.delay-this.elapsed},getRemainingSeconds:function(){return.001*this.getRemaining()},getOverallRemaining:function(){return this.delay*(1+this.repeatCount)-this.elapsed},getOverallRemainingSeconds:function(){return.001*this.getOverallRemaining()},remove:function(t){void 0===t&&(t=!1),this.elapsed=this.delay,this.hasDispatched=!t,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});t.exports=r},97121:(t,e,i)=>{t.exports={Clock:i(73779),TimerEvent:i(57911)}},64532:(t,e,i)=>{var s=i(66458),n=i(56694),r=i(5454),o=i(68710),a=i(91963),h=i(7599),l=i(91944),u=i(39366),c=i(68061),d=i(45641),p=i(56034),f=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.timeScale=1,this.paused=!1,this.processing=!1,this.tweens=[],this.time=0,this.startTime=0,this.nextTime=0,this.prevTime=0,this.maxLag=500,this.lagSkip=33,this.gap=1e3/240,t.sys.events.once(h.BOOT,this.boot,this),t.sys.events.on(h.START,this.start,this)},boot:function(){this.systems.events.once(h.DESTROY,this.destroy,this)},start:function(){var t=this.systems.events;t.on(h.UPDATE,this.update,this),t.once(h.SHUTDOWN,this.shutdown,this),this.timeScale=1,this.paused=!1,this.startTime=Date.now(),this.prevTime=this.startTime,this.nextTime=this.gap},create:function(t){Array.isArray(t)||(t=[t]);for(var e=[],i=0;i-1},existing:function(t){return this.has(t)||this.tweens.push(t.init()),this},addCounter:function(t){var e=o(this,t);return this.tweens.push(e.init()),e},stagger:function(t,e){return l(t,e)},setLagSmooth:function(t,e){return void 0===t&&(t=1/1e-8),void 0===e&&(e=0),this.maxLag=t,this.lagSkip=Math.min(e,this.maxLag),this},setFps:function(t){return void 0===t&&(t=240),this.gap=1e3/t,this.nextTime=1e3*this.time+this.gap,this},getDelta:function(t){var e=Date.now()-this.prevTime;e>this.maxLag&&(this.startTime+=e-this.lagSkip),this.prevTime+=e;var i=this.prevTime-this.startTime,s=i-this.nextTime,n=i-1e3*this.time;return s>0||t?(i/=1e3,this.time=i,this.nextTime+=s+(s>=this.gap?4:this.gap-s)):n=0,n},tick:function(){return this.step(!0),this},update:function(){this.paused||this.step(!1)},step:function(t){void 0===t&&(t=!1);var e=this.getDelta(t);if(0!==e){var i,s;this.processing=!0;var n=[],r=this.tweens;for(i=0;i0){for(i=0;i-1&&(s.isPendingRemove()||s.isDestroyed())&&(r.splice(a,1),s.destroy())}n.length=0}this.processing=!1}},remove:function(t){return this.processing?t.setPendingRemoveState():(s(this.tweens,t),t.setRemovedState()),this},reset:function(t){return this.existing(t),t.seek(),t.setActiveState(),this},makeActive:function(t){return this.existing(t),t.setActiveState(),this},each:function(t,e){var i,s=[null];for(i=1;i{t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},21902:(t,e,i)=>{var s=i(35060),n=i(40587);t.exports=function(t,e){var i=s.Power0;if("string"==typeof t)if(s.hasOwnProperty(t))i=s[t];else{var r="";if(t.indexOf(".")){var o=(r=t.substring(t.indexOf(".")+1)).toLowerCase();"in"===o?r="easeIn":"out"===o?r="easeOut":"inout"===o&&(r="easeInOut")}t=n(t.substring(0,t.indexOf(".")+1)+r),s.hasOwnProperty(t)&&(i=s[t])}else"function"==typeof t&&(i=t);if(!e)return i;var a=e.slice(0);return a.unshift(0),function(t){return a[0]=t,i.apply(this,a)}}},4840:(t,e,i)=>{var s=i(63210),n=i(88332),r={bezier:s,catmull:n,catmullrom:n,linear:i(47614)};t.exports=function(t){if(null===t)return null;var e=r.linear;return"string"==typeof t?r.hasOwnProperty(t)&&(e=r[t]):"function"==typeof t&&(e=t),e}},28348:t=>{t.exports=function(t,e,i){var s;t.hasOwnProperty(e)?s="function"===typeof t[e]?function(i,s,n,r,o,a){return t[e](i,s,n,r,o,a)}:function(){return t[e]}:s="function"==typeof i?i:function(){return i};return s}},92407:(t,e,i)=>{var s=i(53709);t.exports=function(t){var e,i=[];if(t.hasOwnProperty("props"))for(e in t.props)"_"!==e.substring(0,1)&&i.push({key:e,value:t.props[e]});else for(e in t)-1===s.indexOf(e)&&"_"!==e.substring(0,1)&&i.push({key:e,value:t[e]});return i}},65868:(t,e,i)=>{var s=i(10850);t.exports=function(t){var e=s(t,"targets",null);return null===e||("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e])),e}},9744:(t,e,i)=>{var s=i(17489),n=i(61616);function r(t){return!!t.getActive&&"function"==typeof t.getActive}function o(t){return!!t.getStart&&"function"==typeof t.getStart}function a(t){return!!t.getEnd&&"function"==typeof t.getEnd}var h=function(t,e){var i,l,u=function(t,e,i){return i},c=function(t,e,i){return i},d=null,p=typeof e;if("number"===p)u=function(){return e};else if(Array.isArray(e))c=function(){return e[0]},u=function(){return e[e.length-1]};else if("string"===p){var f=e.toLowerCase(),v="random"===f.substring(0,6),g="int"===f.substring(0,3);if(v||g){var m=f.indexOf("("),y=f.indexOf(")"),x=f.indexOf(",");if(!(m&&y&&x))throw new Error("invalid random() format");var T=parseFloat(f.substring(m+1,x)),w=parseFloat(f.substring(x+1,y));u=v?function(){return n(T,w)}:function(){return s(T,w)}}else{f=f[0];var b=parseFloat(e.substr(2));switch(f){case"+":u=function(t,e,i){return i+b};break;case"-":u=function(t,e,i){return i-b};break;case"*":u=function(t,e,i){return i*b};break;case"/":u=function(t,e,i){return i/b};break;default:u=function(){return parseFloat(e)}}}}else if("function"===p)u=e;else if("object"===p)if(o(l=e)||a(l)||r(l))r(e)&&(d=e.getActive),a(e)&&(u=e.getEnd),o(e)&&(c=e.getStart);else if(e.hasOwnProperty("value"))i=h(t,e.value);else{var E=e.hasOwnProperty("to"),S=e.hasOwnProperty("from"),A=e.hasOwnProperty("start");if(E&&(S||A)){if(i=h(t,e.to),A){var _=h(t,e.start);i.getActive=_.getEnd}if(S){var C=h(t,e.from);i.getStart=C.getEnd}}}return i||(i={getActive:d,getEnd:u,getStart:c}),i};t.exports=h},68710:(t,e,i)=>{var s=i(502),n=i(99730),r=i(20494),o=i(63130),a=i(21902),h=i(28348),l=i(10850),u=i(9744),c=i(72066),d=i(39366);t.exports=function(t,e,i){if(e instanceof d)return e.parent=t,e;i=void 0===i?n:c(n,i);var p=l(e,"from",0),f=l(e,"to",1),v=[{value:p}],g=l(e,"delay",i.delay),m=l(e,"easeParams",i.easeParams),y=l(e,"ease",i.ease),x=u("value",f),T=new d(t,v),w=T.add(0,"value",x.getEnd,x.getStart,x.getActive,a(l(e,"ease",y),l(e,"easeParams",m)),h(e,"delay",g),l(e,"duration",i.duration),o(e,"yoyo",i.yoyo),l(e,"hold",i.hold),l(e,"repeat",i.repeat),l(e,"repeatDelay",i.repeatDelay),!1,!1);w.start=p,w.current=p,T.completeDelay=r(e,"completeDelay",0),T.loop=Math.round(r(e,"loop",0)),T.loopDelay=Math.round(r(e,"loopDelay",0)),T.paused=o(e,"paused",!1),T.persist=o(e,"persist",!1),T.callbackScope=l(e,"callbackScope",T);for(var b=s.TYPES,E=0;E{var s=i(21902),n=i(10850),r=i(83392);t.exports=function(t,e){var i;void 0===e&&(e={});var o=n(e,"start",0),a=n(e,"ease",null),h=n(e,"grid",null),l=n(e,"from",0),u="first"===l,c="center"===l,d="last"===l,p="number"==typeof l,f=Array.isArray(t),v=f?parseFloat(t[0]):parseFloat(t),g=f?parseFloat(t[1]):0,m=Math.max(v,g);if(f&&(o+=v),h){var y=h[0],x=h[1],T=0,w=0,b=0,E=0,S=[];d?(T=y-1,w=x-1):p?(T=l%y,w=Math.floor(l/y)):c&&(T=(y-1)/2,w=(x-1)/2);for(var A=r.MIN_SAFE_INTEGER,_=0;_A&&(A=R),S[_][C]=R}}}var M=a?s(a):null;return i=h?function(t,e,i,s){var n,r=0,a=s%y,h=Math.floor(s/y);if(a>=0&&a=0&&h{var s=i(502),n=i(99730),r=i(20494),o=i(63130),a=i(21902),h=i(4840),l=i(28348),u=i(92407),c=i(65868),d=i(10850),p=i(9744),f=i(72066),v=i(39366);t.exports=function(t,e,i){if(e instanceof v)return e.parent=t,e;i=void 0===i?n:f(n,i);var g=c(e);!g&&i.targets&&(g=i.targets);for(var m=u(e),y=d(e,"delay",i.delay),x=d(e,"duration",i.duration),T=d(e,"easeParams",i.easeParams),w=d(e,"ease",i.ease),b=d(e,"hold",i.hold),E=d(e,"repeat",i.repeat),S=d(e,"repeatDelay",i.repeatDelay),A=o(e,"yoyo",i.yoyo),_=o(e,"flipX",i.flipX),C=o(e,"flipY",i.flipY),R=d(e,"interpolation",i.interpolation),M=function(t,e,i,s){if("texture"===i){var n=s,r=void 0;Array.isArray(s)?(n=s[0],r=s[1]):s.hasOwnProperty("value")&&(n=s.value,Array.isArray(s.value)&&(n=s.value[0],r=s.value[1])),t.addFrame(e,n,r,l(s,"delay",y),d(s,"duration",x),d(s,"hold",b),d(s,"repeat",E),d(s,"repeatDelay",S),o(s,"flipX",_),o(s,"flipY",C))}else{var u=p(i,s),c=h(d(s,"interpolation",R));t.add(e,i,u.getEnd,u.getStart,u.getActive,a(d(s,"ease",w),d(s,"easeParams",T)),l(s,"delay",y),d(s,"duration",x),o(s,"yoyo",A),d(s,"hold",b),d(s,"repeat",E),d(s,"repeatDelay",S),o(s,"flipX",_),o(s,"flipY",C),c,c?s:null)}},P=new v(t,g),O=0;O{var s=i(502),n=i(20494),r=i(63130),o=i(65868),a=i(10850),h=i(68061),l=i(45641);t.exports=function(t,e){if(e instanceof l)return e.parent=t,e;var i,u=new l(t);u.startDelay=a(e,"delay",0),u.completeDelay=n(e,"completeDelay",0),u.loop=Math.round(n(e,"loop",a(e,"repeat",0))),u.loopDelay=Math.round(n(e,"loopDelay",a(e,"repeatDelay",0))),u.paused=r(e,"paused",!1),u.persist=r(e,"persist",!0),u.callbackScope=a(e,"callbackScope",u);var c=s.TYPES;for(i=0;i{t.exports={GetBoolean:i(63130),GetEaseFunction:i(21902),GetInterpolationFunction:i(4840),GetNewValue:i(28348),GetProps:i(92407),GetTargets:i(65868),GetValueOp:i(9744),NumberTweenBuilder:i(68710),StaggerBuilder:i(91944),TweenBuilder:i(68061)}},5570:t=>{t.exports="active"},6383:t=>{t.exports="complete"},72582:t=>{t.exports="loop"},90281:t=>{t.exports="pause"},80803:t=>{t.exports="repeat"},13640:t=>{t.exports="resume"},10472:t=>{t.exports="start"},5379:t=>{t.exports="stop"},43449:t=>{t.exports="update"},61541:t=>{t.exports="yoyo"},54272:(t,e,i)=>{t.exports={TWEEN_ACTIVE:i(5570),TWEEN_COMPLETE:i(6383),TWEEN_LOOP:i(72582),TWEEN_PAUSE:i(90281),TWEEN_RESUME:i(13640),TWEEN_REPEAT:i(80803),TWEEN_START:i(10472),TWEEN_STOP:i(5379),TWEEN_UPDATE:i(43449),TWEEN_YOYO:i(61541)}},75193:(t,e,i)=>{var s={States:i(55303),Builders:i(79619),Events:i(54272),TweenManager:i(64532),Tween:i(39366),TweenData:i(15718)};t.exports=s},502:(t,e,i)=>{var s=i(56694),n=i(6659),r=i(54272),o=i(55303),a=new s({Extends:n,initialize:function(t){n.call(this),this.parent=t,this.data=[],this.totalData=0,this.startDelay=0,this.hasStarted=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.completeDelay=0,this.countdown=0,this.state=o.PENDING,this.paused=!1,this.callbacks={onActive:null,onComplete:null,onLoop:null,onPause:null,onRepeat:null,onResume:null,onStart:null,onStop:null,onUpdate:null,onYoyo:null},this.callbackScope,this.persist=!1},init:function(){return this.initTweenData(),this.setActiveState(),this.dispatchEvent(r.TWEEN_ACTIVE,"onActive"),this},setTimeScale:function(t){return this.timeScale=t,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return!this.paused&&this.isActive()},isPaused:function(){return this.paused},pause:function(){return this.paused||(this.paused=!0,this.dispatchEvent(r.TWEEN_PAUSE,"onPause")),this},resume:function(){return this.paused&&(this.paused=!1,this.dispatchEvent(r.TWEEN_RESUME,"onResume")),this},makeActive:function(){this.parent.makeActive(this),this.dispatchEvent(r.TWEEN_ACTIVE,"onActive")},onCompleteHandler:function(){this.setPendingRemoveState(),this.dispatchEvent(r.TWEEN_COMPLETE,"onComplete")},complete:function(t){return void 0===t&&(t=0),t?(this.setCompleteDelayState(),this.countdown=t):this.onCompleteHandler(),this},completeAfterLoop:function(t){return void 0===t&&(t=0),this.loopCounter>t&&(this.loopCounter=t),this},remove:function(){return this.parent.remove(this),this},stop:function(){return this.isRemoved()||this.isPendingRemove()||(this.dispatchEvent(r.TWEEN_STOP,"onStop"),this.setPendingRemoveState()),this},updateLoopCountdown:function(t){this.countdown-=t,this.countdown<=0&&(this.setActiveState(),this.dispatchEvent(r.TWEEN_LOOP,"onLoop"))},updateStartCountdown:function(t){return this.countdown-=t,this.countdown<=0&&(this.hasStarted=!0,this.setActiveState(),this.dispatchEvent(r.TWEEN_START,"onStart"),t=0),t},updateCompleteDelay:function(t){this.countdown-=t,this.countdown<=0&&this.onCompleteHandler()},setCallback:function(t,e,i){return void 0===i&&(i=[]),this.callbacks.hasOwnProperty(t)&&(this.callbacks[t]={func:e,params:i}),this},setPendingState:function(){this.state=o.PENDING},setActiveState:function(){this.state=o.ACTIVE},setLoopDelayState:function(){this.state=o.LOOP_DELAY},setCompleteDelayState:function(){this.state=o.COMPLETE_DELAY},setStartDelayState:function(){this.state=o.START_DELAY,this.countdown=this.startDelay,this.hasStarted=!1},setPendingRemoveState:function(){this.state=o.PENDING_REMOVE},setRemovedState:function(){this.state=o.REMOVED},setFinishedState:function(){this.state=o.FINISHED},setDestroyedState:function(){this.state=o.DESTROYED},isPending:function(){return this.state===o.PENDING},isActive:function(){return this.state===o.ACTIVE},isLoopDelayed:function(){return this.state===o.LOOP_DELAY},isCompleteDelayed:function(){return this.state===o.COMPLETE_DELAY},isStartDelayed:function(){return this.state===o.START_DELAY},isPendingRemove:function(){return this.state===o.PENDING_REMOVE},isRemoved:function(){return this.state===o.REMOVED},isFinished:function(){return this.state===o.FINISHED},isDestroyed:function(){return this.state===o.DESTROYED},destroy:function(){this.data&&this.data.forEach((function(t){t.destroy()})),this.removeAllListeners(),this.callbacks=null,this.data=null,this.parent=null,this.setDestroyedState()}});a.TYPES=["onActive","onComplete","onLoop","onPause","onRepeat","onResume","onStart","onStop","onUpdate","onYoyo"],t.exports=a},65521:(t,e,i)=>{var s=i(56694),n=i(55303),r=new s({initialize:function(t,e,i,s,n,r,o,a,h,l){this.tween=t,this.targetIndex=e,this.duration=s,this.totalDuration=0,this.delay=0,this.getDelay=i,this.yoyo=n,this.hold=r,this.repeat=o,this.repeatDelay=a,this.repeatCounter=0,this.flipX=h,this.flipY=l,this.progress=0,this.elapsed=0,this.state=0,this.isCountdown=!1},setCreatedState:function(){this.state=n.CREATED,this.isCountdown=!1},setDelayState:function(){this.state=n.DELAY,this.isCountdown=!0},setPendingRenderState:function(){this.state=n.PENDING_RENDER,this.isCountdown=!1},setPlayingForwardState:function(){this.state=n.PLAYING_FORWARD,this.isCountdown=!1},setPlayingBackwardState:function(){this.state=n.PLAYING_BACKWARD,this.isCountdown=!1},setHoldState:function(){this.state=n.HOLD_DELAY,this.isCountdown=!0},setRepeatState:function(){this.state=n.REPEAT_DELAY,this.isCountdown=!0},setCompleteState:function(){this.state=n.COMPLETE,this.isCountdown=!1},isCreated:function(){return this.state===n.CREATED},isDelayed:function(){return this.state===n.DELAY},isPendingRender:function(){return this.state===n.PENDING_RENDER},isPlayingForward:function(){return this.state===n.PLAYING_FORWARD},isPlayingBackward:function(){return this.state===n.PLAYING_BACKWARD},isHolding:function(){return this.state===n.HOLD_DELAY},isRepeating:function(){return this.state===n.REPEAT_DELAY},isComplete:function(){return this.state===n.COMPLETE},destroy:function(){this.tween=null,this.getDelay=null,this.setCompleteState()}});t.exports=r},99730:t=>{t.exports={targets:null,delay:0,duration:1e3,ease:"Power0",easeParams:null,hold:0,repeat:0,repeatDelay:0,yoyo:!1,flipX:!1,flipY:!1,persist:!1,interpolation:null}},53709:t=>{t.exports=["callbackScope","completeDelay","delay","duration","ease","easeParams","flipX","flipY","hold","interpolation","loop","loopDelay","onActive","onActiveParams","onComplete","onCompleteParams","onLoop","onLoopParams","onPause","onPauseParams","onRepeat","onRepeatParams","onResume","onResumeParams","onStart","onStartParams","onStop","onStopParams","onUpdate","onUpdateParams","onYoyo","onYoyoParams","paused","persist","props","repeat","repeatDelay","targets","yoyo"]},39366:(t,e,i)=>{var s=i(502),n=i(56694),r=i(54272),o=i(99325),a=i(61286),h=i(83392),l=i(55303),u=i(15718),c=i(96490),d=new n({Extends:s,initialize:function(t,e){s.call(this,t),this.targets=e,this.totalTargets=e.length,this.isSeeking=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.delta=0},add:function(t,e,i,s,n,r,o,a,h,l,c,d,p,f,v,g){var m=new u(this,t,e,i,s,n,r,o,a,h,l,c,d,p,f,v,g);return this.totalData=this.data.push(m),m},addFrame:function(t,e,i,s,n,r,o,a,h,l){var u=new c(this,t,e,i,s,n,r,o,a,h,l);return this.totalData=this.data.push(u),u},getValue:function(t){return void 0===t&&(t=0),this.data[t].current},hasTarget:function(t){return-1!==this.targets.indexOf(t)},updateTo:function(t,e,i){void 0===i&&(i=!1);for(var s=0;s0)this.elapsed=0,this.progress=0,this.loopCounter--,this.resetTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(r.TWEEN_LOOP,"onLoop"));else{if(!(this.completeDelay>0))return this.onCompleteHandler(),!0;this.countdown=this.completeDelay,this.setCompleteDelayState()}return!1},onCompleteHandler:function(){this.progress=1,this.totalProgress=1,s.prototype.onCompleteHandler.call(this)},play:function(){return this.isDestroyed()?(console.warn("Cannot play destroyed Tween",this),this):((this.isPendingRemove()||this.isPending())&&this.seek(),this.paused=!1,this.setActiveState(),this)},resetTweenData:function(t){for(var e=this.data,i=this.totalData,s=0;s0){this.isSeeking=!0;do{this.update(e)}while(this.totalProgress<=t);this.isSeeking=!1}return this},initTweenData:function(t){void 0===t&&(t=!1),this.reset(!0),this.duration=0,this.startDelay=h.MAX_SAFE_INTEGER;for(var e=this.data,i=0;i0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},reset:function(t){this.elapsed=0,this.progress=0,this.totalElapsed=0,this.totalProgress=0,this.loopCounter=-1===this.loop?999999999999:this.loop,t||(this.resetTweenData(!0),this.setActiveState(),this.dispatchEvent(r.TWEEN_ACTIVE,"onActive"))},update:function(t){if(this.isPendingRemove()||this.isDestroyed())return!0;if(this.isFinished()||this.paused&&!this.isSeeking)return!1;t*=this.timeScale*this.parent.timeScale,this.isLoopDelayed()?this.updateLoopCountdown(t):this.isCompleteDelayed()?this.updateCompleteDelay(t):this.hasStarted||this.isSeeking||(this.startDelay-=t,this.startDelay<=0&&(this.hasStarted=!0,this.dispatchEvent(r.TWEEN_START,"onStart"),t=0));var e=!1;if(this.isActive())for(var i=this.data,s=0;s{var s=i(66458),n=i(502),r=i(56694),o=i(54272),a=i(99325),h=i(61286),l=new r({Extends:n,initialize:function(t){n.call(this,t),this.currentTween=null,this.currentIndex=0},init:function(){return this.loopCounter=-1===this.loop?999999999999:this.loop,this.setCurrentTween(0),this.startDelay>0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this.dispatchEvent(o.TWEEN_ACTIVE,"onActive"),this},add:function(t){var e=this.parent.create(t);Array.isArray(e)||(e=[e]);for(var i=this.data,s=0;s0)this.loopCounter--,this.resetTweens(),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(o.TWEEN_LOOP,"onLoop"));else{if(!(this.completeDelay>0))return this.onCompleteHandler(),!0;this.countdown=this.completeDelay,this.setCompleteDelayState()}return!1},play:function(){return this.isDestroyed()?(console.warn("Cannot play destroyed TweenChain",this),this):((this.isPendingRemove()||this.isPending())&&this.resetTweens(),this.paused=!1,this.startDelay>0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this)},resetTweens:function(){for(var t=this.data,e=this.totalData,i=0;i{var s=i(65521),n=i(56694),r=i(54272),o=new n({Extends:s,initialize:function(t,e,i,n,r,o,a,h,l,u,c,d,p,f,v,g,m){s.call(this,t,e,h,l,u,c,d,p,f,v),this.key=i,this.getActiveValue=o,this.getEndValue=n,this.getStartValue=r,this.ease=a,this.start=0,this.previous=0,this.current=0,this.end=0,this.interpolation=g,this.interpolationData=m},init:function(t){var e=this.tween,i=e.totalTargets,s=this.targetIndex,n=e.targets[s],r=this.key;this.delay=this.getDelay(n,r,0,s,i,e),this.repeatCounter=-1===this.repeat?999999999999:this.repeat,this.setPendingRenderState();var o=this.duration+this.hold;this.yoyo&&(o+=this.duration);var a=o+this.repeatDelay;this.totalDuration=this.delay+o,-1===this.repeat?this.totalDuration+=999999999999*a:this.repeat>0&&(this.totalDuration+=a*this.repeat),this.totalDuration>e.duration&&(e.duration=this.totalDuration),this.delay0&&(this.elapsed=this.delay,this.setDelayState()),!t&&this.getActiveValue&&(n[r]=this.getActiveValue(n,r,this.start))},update:function(t){var e=this.tween,i=e.totalTargets,s=this.targetIndex,n=e.targets[s],o=this.key;if(!n)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=t,this.elapsed<=0&&(this.elapsed=0,t=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(r.TWEEN_REPEAT,"onRepeat")):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.start=this.getStartValue(n,o,n[o],s,i,e),this.end=this.getEndValue(n,o,this.start,s,i,e),this.current=this.start,n[o]=this.start,this.setPlayingForwardState(),!0;var a=this.isPlayingForward(),h=this.isPlayingBackward();if(a||h){var l=this.elapsed,u=this.duration,c=0,d=!1;(l+=t)>=u&&(c=l-u,l=u,d=!0);var p=l/u;if(this.elapsed=l,this.progress=p,this.previous=this.current,d)a?(this.current=this.end,n[o]=this.end,this.hold>0&&this.repeatCounter>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(c)):(this.current=this.start,n[o]=this.start,this.setStateFromStart(c));else{a||(p=1-p);var f=this.ease(p);this.interpolation?this.current=this.interpolation(this.interpolationData,f):this.current=this.start+(this.end-this.start)*f,n[o]=this.current}this.dispatchEvent(r.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},reset:function(t){var e=this.tween,i=e.totalTargets,s=this.targetIndex,n=e.targets[s],r=this.key;this.progress=0,this.elapsed=0,this.repeatCounter=-1===this.repeat?999999999999:this.repeat,t?(this.start=this.getStartValue(n,r,this.start,s,i,e),this.end=this.getEndValue(n,r,this.end,s,i,e),this.current=this.start,this.setPlayingForwardState()):this.setPendingRenderState(),this.delay>0&&(this.elapsed=this.delay,this.setDelayState()),this.getActiveValue&&(n[r]=this.getActiveValue(n,r,this.start))},dispatchEvent:function(t,e){var i=this.tween;if(!i.isSeeking){var s=i.targets[this.targetIndex],n=this.key,r=this.current,o=this.previoius;i.emit(t,i,n,s,r,o);var a=i.callbacks[e];a&&a.func.apply(a.scope,[i,s,n,r,o].concat(a.params))}},setStateFromEnd:function(t){this.yoyo?this.onRepeat(t,!0,!0):this.repeatCounter>0?this.onRepeat(t,!0):this.setCompleteState()},setStateFromStart:function(t){this.repeatCounter>0?this.onRepeat(t,!1):this.setCompleteState()},onRepeat:function(t,e,i){void 0===i&&(i=!1);var s=this.tween,n=s.totalTargets,o=this.targetIndex,a=s.targets[o],h=this.key;if(this.elapsed=t,this.progress=t/this.duration,this.flipX&&a.toggleFlipX(),this.flipY&&a.toggleFlipY(),(e||i)&&(this.start=this.getStartValue(a,h,this.start,o,n,s)),i)return this.setPlayingBackwardState(),void this.dispatchEvent(r.TWEEN_YOYO,"onYoyo");this.repeatCounter--,this.end=this.getEndValue(a,h,this.start,o,n,s),this.repeatDelay>0?(this.elapsed=this.repeatDelay-t,this.current=this.start,a[h]=this.current,this.setRepeatState()):(this.setPlayingForwardState(),this.dispatchEvent(r.TWEEN_REPEAT,"onRepeat"))},destroy:function(){s.prototype.destroy.call(this),this.getActiveValue=null,this.getEndValue=null,this.getStartValue=null,this.ease=null}});t.exports=o},96490:(t,e,i)=>{var s=i(65521),n=i(56694),r=i(54272),o=new n({Extends:s,initialize:function(t,e,i,n,r,o,a,h,l,u,c){s.call(this,t,e,r,o,!1,a,h,l,u,c),this.startTexture=null,this.endTexture=i,this.startFrame=null,this.endFrame=n,this.yoyo=h>0},init:function(t){var e=this.tween,i=e.totalTargets,s=this.targetIndex,n=e.targets[s];this.delay=this.getDelay(n,"texture",0,s,i,e),this.repeatCounter=-1===this.repeat?999999999999:this.repeat,this.setPendingRenderState();var r=this.duration+this.hold;this.yoyo&&(r+=this.duration);var o=r+this.repeatDelay;this.totalDuration=this.delay+r,-1===this.repeat?this.totalDuration+=999999999999*o:this.repeat>0&&(this.totalDuration+=o*this.repeat),this.totalDuration>e.duration&&(e.duration=this.totalDuration),this.delay0&&(this.elapsed=this.delay,this.setDelayState())},update:function(t){var e=this.tween,i=this.targetIndex,s=e.targets[i];if(!s)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=t,this.elapsed<=0&&(this.elapsed=0,t=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(r.TWEEN_REPEAT,"onRepeat")):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.startTexture&&s.setTexture(this.startTexture,this.startFrame),this.setPlayingForwardState(),!0;var n=this.isPlayingForward(),o=this.isPlayingBackward();if(n||o){var a=this.elapsed,h=this.duration,l=0,u=!1;(a+=t)>=h&&(l=a-h,a=h,u=!0);var c=a/h;this.elapsed=a,this.progress=c,u&&(n?(s.setTexture(this.endTexture,this.endFrame),this.hold>0&&this.repeatCounter>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(l)):(s.setTexture(this.startTexture,this.startFrame),this.setStateFromStart(l))),this.dispatchEvent(r.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},reset:function(t){this.progress=0,this.elapsed=0,this.repeatCounter=-1===this.repeat?999999999999:this.repeat,t?this.setPlayingForwardState():this.setPendingRenderState(),this.delay>0&&(this.elapsed=this.delay,this.setDelayState())},dispatchEvent:function(t,e){var i=this.tween;if(!i.isSeeking){var s=i.targets[this.targetIndex];i.emit(t,i,"texture",s);var n=i.callbacks[e];n&&n.func.apply(n.scope,[i,s,"texture"].concat(n.params))}},setStateFromEnd:function(t){this.repeatCounter>0?this.onRepeat(t,!0):this.setCompleteState()},setStateFromStart:function(t){this.repeatCounter>0?this.onRepeat(t,!1):this.setCompleteState()},onRepeat:function(t,e){void 0===e&&(e=!1);var i=this.tween,s=this.targetIndex,n=i.targets[s];if(this.elapsed=t,this.progress=t/this.duration,this.flipX&&n.toggleFlipX(),this.flipY&&n.toggleFlipY(),e)return this.setPlayingBackwardState(),void this.dispatchEvent(r.TWEEN_YOYO,"onYoyo");this.repeatCounter--,this.repeatDelay>0?(this.elapsed=this.repeatDelay-t,this.setRepeatState()):(this.setPlayingForwardState(),this.dispatchEvent(r.TWEEN_REPEAT,"onRepeat"))}});t.exports=o},55303:t=>{t.exports={CREATED:0,DELAY:2,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING:20,ACTIVE:21,LOOP_DELAY:22,COMPLETE_DELAY:23,START_DELAY:24,PENDING_REMOVE:25,REMOVED:26,FINISHED:27,DESTROYED:28}},56694:t=>{function e(t,e,i){var s=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&s.value&&"object"==typeof s.value&&(s=s.value),!(!s||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(s))&&(void 0===s.enumerable&&(s.enumerable=!0),void 0===s.configurable&&(s.configurable=!0),s)}function i(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function s(t,s,n,o){for(var a in s)if(s.hasOwnProperty(a)){var h=e(s,a,n);if(!1!==h){if(i((o||t).prototype,a)){if(r.ignoreFinals)continue;throw new Error("cannot override final property '"+a+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,a,h)}else t.prototype[a]=s[a]}}function n(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i{t.exports=function(){}},78991:t=>{t.exports=function(t,e,i,s,n){if(void 0===n&&(n=t),i>0){var r=i-t.length;if(r<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),s&&s.call(n,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.splice(o,1),o--;if(0===(o=e.length))return null;i>0&&o>r&&(e.splice(r),o=r);for(var a=0;a{t.exports=function(t,e,i,s,n,r){if(void 0===i&&(i=0),void 0===r&&(r=t),s>0){var o=s-t.length;if(o<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),n&&n.call(r,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.pop(),a--;if(0===(a=e.length))return null;s>0&&a>o&&(e.splice(o),a=o);for(var h=a-1;h>=0;h--){var l=e[h];t.splice(i,0,l),n&&n.call(r,l)}return e}},58742:t=>{t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i{var s=i(45838);t.exports=function(t,e,i,n,r){void 0===n&&(n=0),void 0===r&&(r=t.length);var o=0;if(s(t,n,r))for(var a=n;a{t.exports=function(t,e,i){var s,n=[null];for(s=3;s{var s=i(45838);t.exports=function(t,e,i,n,r){if(void 0===n&&(n=0),void 0===r&&(r=t.length),s(t,n,r)){var o,a=[null];for(o=5;o{t.exports=function(t,e,i){if(!e.length)return NaN;if(1===e.length)return e[0];var s,n,r=1;if(i){if(te.length&&(r=e.length),i?(s=e[r-1][i],(n=e[r][i])-t<=t-s?e[r]:e[r-1]):(s=e[r-1],(n=e[r])-t<=t-s?n:s)}},5454:t=>{var e=function(t,i){void 0===i&&(i=[]);for(var s=0;s{var s=i(45838);t.exports=function(t,e,i,n,r){void 0===n&&(n=0),void 0===r&&(r=t.length);var o=[];if(s(t,n,r))for(var a=n;a{var s=i(45838);t.exports=function(t,e,i,n,r){if(void 0===n&&(n=0),void 0===r&&(r=t.length),s(t,n,r))for(var o=n;o{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var s=e+Math.floor(Math.random()*i);return void 0===t[s]?null:t[s]}},24218:t=>{t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),n=t.indexOf(i);if(s<0||n<0)throw new Error("Supplied items must be elements of the same array");return s>n||(t.splice(s,1),n===t.length-1?t.push(e):t.splice(n,0,e)),t}},58258:t=>{t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),n=t.indexOf(i);if(s<0||n<0)throw new Error("Supplied items must be elements of the same array");return s{t.exports=function(t,e){var i=t.indexOf(e);if(i>0){var s=t[i-1],n=t.indexOf(s);t[i]=s,t[n]=e}return t}},68396:t=>{t.exports=function(t,e,i){var s=t.indexOf(e);if(-1===s||i<0||i>=t.length)throw new Error("Supplied index out of bounds");return s!==i&&(t.splice(s,1),t.splice(i,0,e)),e}},27555:t=>{t.exports=function(t,e){var i=t.indexOf(e);if(-1!==i&&i{t.exports=function(t,e,i,s){var n,r=[],o=!1;if((i||s)&&(o=!0,i||(i=""),s||(s="")),e=e;n--)o?r.push(i+n.toString()+s):r.push(n);else for(n=t;n<=e;n++)o?r.push(i+n.toString()+s):r.push(n);return r}},89955:(t,e,i)=>{var s=i(67233);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var n=[],r=Math.max(s((e-t)/(i||1)),0),o=0;o{function e(t,e,i){var s=t[e];t[e]=t[i],t[i]=s}function i(t,e){return te?1:0}var s=function(t,n,r,o,a){for(void 0===r&&(r=0),void 0===o&&(o=t.length-1),void 0===a&&(a=i);o>r;){if(o-r>600){var h=o-r+1,l=n-r+1,u=Math.log(h),c=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*c*(h-c)/h)*(l-h/2<0?-1:1),p=Math.max(r,Math.floor(n-l*c/h+d)),f=Math.min(o,Math.floor(n+(h-l)*c/h+d));s(t,n,p,f,a)}var v=t[n],g=r,m=o;for(e(t,r,n),a(t[o],v)>0&&e(t,r,o);g0;)m--}0===a(t[r],v)?e(t,r,m):e(t,++m,o),m<=n&&(r=m+1),n<=m&&(o=m-1)}};t.exports=s},75757:(t,e,i)=>{var s=i(10850),n=i(18592),r=function(t,e,i){for(var s=[],n=0;n{var s=i(72677);t.exports=function(t,e,i,n){var r;if(void 0===n&&(n=t),!Array.isArray(e))return-1!==(r=t.indexOf(e))?(s(t,r),i&&i.call(n,e),e):null;for(var o=e.length-1,a=[];o>=0;){var h=e[o];-1!==(r=t.indexOf(h))&&(s(t,r),a.push(h),i&&i.call(n,h)),o--}return a}},8324:(t,e,i)=>{var s=i(72677);t.exports=function(t,e,i,n){if(void 0===n&&(n=t),e<0||e>t.length-1)throw new Error("Index out of bounds");var r=s(t,e);return i&&i.call(n,r),r}},47427:(t,e,i)=>{var s=i(45838);t.exports=function(t,e,i,n,r){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===r&&(r=t),s(t,e,i)){var o=i-e,a=t.splice(e,o);if(n)for(var h=0;h{var s=i(72677);t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var n=e+Math.floor(Math.random()*i);return s(t,n)}},80402:t=>{t.exports=function(t,e,i){var s=t.indexOf(e),n=t.indexOf(i);return-1!==s&&-1===n&&(t[s]=i,!0)}},77640:t=>{t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,s=0;s{t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,s=0;s{t.exports=function(t,e,i,s){var n=t.length;if(e<0||e>n||e>=i||i>n){if(s)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},27847:t=>{t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i>0&&(t.splice(i,1),t.unshift(e)),e}},6034:(t,e,i)=>{var s=i(45838);t.exports=function(t,e,i,n,r){if(void 0===n&&(n=0),void 0===r&&(r=t.length),s(t,n,r))for(var o=n;o{t.exports=function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(Math.random()*(e+1)),s=t[e];t[e]=t[i],t[i]=s}return t}},28834:t=>{t.exports=function(t){var e=/\D/g;return t.sort((function(t,i){return parseInt(t.replace(e,""),10)-parseInt(i.replace(e,""),10)})),t}},72677:t=>{t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,s=t[e],n=e;n{function e(t,e){return String(t).localeCompare(e)}function i(t,e,i,s){var n,r,o,a,h,l=t.length,u=0,c=2*i;for(n=0;nl&&(r=l),o>l&&(o=l),a=n,h=r;;)if(a{t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),n=t.indexOf(i);if(s<0||n<0)throw new Error("Supplied items must be elements of the same array");return t[s]=i,t[n]=e,t}},59959:(t,e,i)=>{t.exports={Matrix:i(13515),Add:i(78991),AddAt:i(48522),BringToTop:i(58742),CountAllMatching:i(30164),Each:i(36337),EachInRange:i(46208),FindClosestInSorted:i(2406),Flatten:i(5454),GetAll:i(71608),GetFirst:i(51463),GetRandom:i(72861),MoveDown:i(51172),MoveTo:i(68396),MoveUp:i(27555),MoveAbove:i(24218),MoveBelow:i(58258),NumberArray:i(13401),NumberArrayStep:i(89955),QuickSelect:i(53466),Range:i(75757),Remove:i(66458),RemoveAt:i(8324),RemoveBetween:i(47427),RemoveRandomElement:i(50147),Replace:i(80402),RotateLeft:i(77640),RotateRight:i(38487),SafeRange:i(45838),SendToBack:i(27847),SetAll:i(6034),Shuffle:i(18592),SortByDigits:i(28834),SpliceOne:i(72677),StableSort:i(17922),Swap:i(96928)}},97494:t=>{t.exports=function(t){if(!Array.isArray(t)||!Array.isArray(t[0]))return!1;for(var e=t[0].length,i=1;i{var s=i(76400),n=i(97494);t.exports=function(t){var e="";if(!n(t))return e;for(var i=0;i{t.exports=function(t){return t.reverse()}},51995:t=>{t.exports=function(t){for(var e=0;e{var s=i(63515);t.exports=function(t){return s(t,180)}},42549:(t,e,i)=>{var s=i(63515);t.exports=function(t){return s(t,90)}},63515:(t,e,i)=>{var s=i(97494),n=i(78581);t.exports=function(t,e){if(void 0===e&&(e=90),!s(t))return null;if("string"!=typeof e&&(e=(e%360+360)%360),90===e||-270===e||"rotateLeft"===e)(t=n(t)).reverse();else if(-90===e||270===e||"rotateRight"===e)t.reverse(),t=n(t);else if(180===Math.abs(e)||"rotate180"===e){for(var i=0;i{var s=i(63515);t.exports=function(t){return s(t,-90)}},27365:(t,e,i)=>{var s=i(77640),n=i(38487);t.exports=function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),0!==i&&(i<0?s(t,Math.abs(i)):n(t,i)),0!==e)for(var r=0;r{t.exports=function(t){for(var e=t.length,i=t[0].length,s=new Array(i),n=0;n-1;r--)s[n][r]=t[r][n]}return s}},13515:(t,e,i)=>{t.exports={CheckMatrix:i(97494),MatrixToString:i(68428),ReverseColumns:i(59521),ReverseRows:i(51995),Rotate180:i(89011),RotateLeft:i(42549),RotateMatrix:i(63515),RotateRight:i(14305),Translate:i(27365),TransposeMatrix:i(78581)}},40581:t=>{var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";t.exports=function(t,i){for(var s=new Uint8Array(t),n=s.length,r=i?"data:"+i+";base64,":"",o=0;o>2],r+=e[(3&s[o])<<4|s[o+1]>>4],r+=e[(15&s[o+1])<<2|s[o+2]>>6],r+=e[63&s[o+2]];return n%3==2?r=r.substring(0,r.length-1)+"=":n%3==1&&(r=r.substring(0,r.length-2)+"=="),r}},82329:t=>{for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(256),s=0;s>4,u[h++]=(15&s)<<4|n>>2,u[h++]=(3&n)<<6|63&r;return l}},78417:(t,e,i)=>{t.exports={ArrayBufferToBase64:i(40581),Base64ToArrayBuffer:i(82329)}},22178:(t,e,i)=>{t.exports={Array:i(59959),Base64:i(78417),Objects:i(64615),String:i(50379),NOOP:i(72283)}},32742:t=>{t.exports=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i]=t[i].slice(0):e[i]=t[i];return e}},28699:t=>{var e=function(t){var i,s,n;if("object"!=typeof t||null===t)return t;for(n in i=Array.isArray(t)?[]:{},t)s=t[n],i[n]=e(s);return i};t.exports=e},98611:(t,e,i)=>{var s=i(42911),n=function(){var t,e,i,r,o,a,h=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof h&&(c=h,h=arguments[1]||{},l=2),u===l&&(h=this,--l);l{var s=i(5923),n=i(10850);t.exports=function(t,e,i){var r=n(t,e,null);if(null===r)return i;if(Array.isArray(r))return s.RND.pick(r);if("object"==typeof r){if(r.hasOwnProperty("randInt"))return s.RND.integerInRange(r.randInt[0],r.randInt[1]);if(r.hasOwnProperty("randFloat"))return s.RND.realInRange(r.randFloat[0],r.randFloat[1])}else if("function"==typeof r)return r(e);return r}},72632:t=>{t.exports=function(t,e,i){var s=typeof t;return t&&"number"!==s&&"string"!==s&&t.hasOwnProperty(e)&&void 0!==t[e]?t[e]:i}},94324:(t,e,i)=>{var s=i(10850),n=i(82897);t.exports=function(t,e,i,r,o){void 0===o&&(o=i);var a=s(t,e,o);return n(a,i,r)}},10850:t=>{t.exports=function(t,e,i,s){if(!t&&!s||"number"==typeof t)return i;if(t&&t.hasOwnProperty(e))return t[e];if(s&&s.hasOwnProperty(e))return s[e];if(-1!==e.indexOf(".")){for(var n=e.split("."),r=t,o=s,a=i,h=i,l=!0,u=!0,c=0;c{t.exports=function(t,e){for(var i=0;i{t.exports=function(t,e){for(var i=0;i{t.exports=function(t,e){return t.hasOwnProperty(e)}},42911:t=>{t.exports=function(t){if("object"!=typeof t||t.nodeType||t===t.window)return!1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0}},30657:(t,e,i)=>{var s=i(32742);t.exports=function(t,e){var i=s(t);for(var n in e)i.hasOwnProperty(n)||(i[n]=e[n]);return i}},72066:(t,e,i)=>{var s=i(32742);t.exports=function(t,e){var i=s(t);for(var n in e)i.hasOwnProperty(n)&&(i[n]=e[n]);return i}},28820:(t,e,i)=>{var s=i(19256);t.exports=function(t,e){for(var i={},n=0;n{t.exports=function(t,e,i){if(!t||"number"==typeof t)return!1;if(t.hasOwnProperty(e))return t[e]=i,!0;if(-1!==e.indexOf(".")){for(var s=e.split("."),n=t,r=t,o=0;o{t.exports={Clone:i(32742),DeepCopy:i(28699),Extend:i(98611),GetAdvancedValue:i(20494),GetFastValue:i(72632),GetMinMaxValue:i(94324),GetValue:i(10850),HasAll:i(87701),HasAny:i(53523),HasValue:i(19256),IsPlainObject:i(42911),Merge:i(30657),MergeRight:i(72066),Pick:i(28820),SetValue:i(22440)}},69429:t=>{t.exports=function(t,e){return t.replace(/%([0-9]+)/g,(function(t,i){return e[Number(i)-1]}))}},76400:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=0),void 0===i&&(i=" "),void 0===s&&(s=3);var n=0;if(e+1>=(t=t.toString()).length)switch(s){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var r=Math.ceil((n=e-t.length)/2);t=new Array(n-r+1).join(i)+t+new Array(r+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},76872:t=>{t.exports=function(t,e){return 0===e?t.slice(1):t.slice(0,e-1)+t.slice(e)}},8051:t=>{t.exports=function(t){return t.split("").reverse().join("")}},76583:t=>{t.exports=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))}},40587:t=>{t.exports=function(t){return t&&t[0].toUpperCase()+t.slice(1)}},50379:(t,e,i)=>{t.exports={Format:i(69429),Pad:i(76400),RemoveAt:i(76872),Reverse:i(8051),UppercaseFirst:i(40587),UUID:i(76583)}}},e={};function i(s){var n=e[s];if(void 0!==n)return n.exports;var r=e[s]={exports:{}};return t[s](r,r.exports,i),r.exports}return i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i(92491)})())); \ No newline at end of file diff --git a/types/phaser.d.ts b/types/phaser.d.ts index 46086023c..a4b06b7d1 100644 --- a/types/phaser.d.ts +++ b/types/phaser.d.ts @@ -631,18 +631,6 @@ declare namespace Phaser { */ function Shuffle(items: G): G; - /** - * Smootherstep is a sigmoid-like interpolation and clamping function. - * - * The function depends on three parameters, the input x, the "left edge" and the "right edge", with the left edge being assumed smaller than the right edge. The function receives a real number x as an argument and returns 0 if x is less than or equal to the left edge, 1 if x is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, between 0 and 1 otherwise. The slope of the smoothstep function is zero at both edges. This is convenient for creating a sequence of transitions using smoothstep to interpolate each segment as an alternative to using more sophisticated or expensive interpolation techniques. - * @param items An array of Game Objects. The contents of this array are updated by this Action. - * @param property The property of the Game Object to interpolate. - * @param min The minimum interpolation value. - * @param max The maximum interpolation value. - * @param inc Should the values be incremented? `true` or set (`false`) Default false. - */ - function SmootherStep(items: G, property: string, min: number, max: number, inc?: boolean): G; - /** * Smoothstep is a sigmoid-like interpolation and clamping function. * @@ -655,6 +643,18 @@ declare namespace Phaser { */ function SmoothStep(items: G, property: string, min: number, max: number, inc?: boolean): G; + /** + * Smootherstep is a sigmoid-like interpolation and clamping function. + * + * The function depends on three parameters, the input x, the "left edge" and the "right edge", with the left edge being assumed smaller than the right edge. The function receives a real number x as an argument and returns 0 if x is less than or equal to the left edge, 1 if x is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, between 0 and 1 otherwise. The slope of the smoothstep function is zero at both edges. This is convenient for creating a sequence of transitions using smoothstep to interpolate each segment as an alternative to using more sophisticated or expensive interpolation techniques. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param property The property of the Game Object to interpolate. + * @param min The minimum interpolation value. + * @param max The maximum interpolation value. + * @param inc Should the values be incremented? `true` or set (`false`) Default false. + */ + function SmootherStep(items: G, property: string, min: number, max: number, inc?: boolean): G; + /** * Takes an array of Game Objects and then modifies their `property` so the value equals, or is incremented, by the * calculated spread value. @@ -5813,148 +5813,6 @@ declare namespace Phaser { */ function DebugHeader(game: Phaser.Game): void; - namespace Events { - /** - * The Game Blur Event. - * - * This event is dispatched by the Game Visibility Handler when the window in which the Game instance is embedded - * enters a blurred state. The blur event is raised when the window loses focus. This can happen if a user swaps - * tab, or if they simply remove focus from the browser to another app. - */ - const BLUR: any; - - /** - * The Game Boot Event. - * - * This event is dispatched when the Phaser Game instance has finished booting, but before it is ready to start running. - * The global systems use this event to know when to set themselves up, dispatching their own `ready` events as required. - */ - const BOOT: any; - - /** - * The Game Context Lost Event. - * - * This event is dispatched by the Game if the WebGL Renderer it is using encounters a WebGL Context Lost event from the browser. - * - * The partner event is `CONTEXT_RESTORED`. - */ - const CONTEXT_LOST: any; - - /** - * The Game Context Restored Event. - * - * This event is dispatched by the Game if the WebGL Renderer it is using encounters a WebGL Context Restored event from the browser. - * - * The partner event is `CONTEXT_LOST`. - */ - const CONTEXT_RESTORED: any; - - /** - * The Game Destroy Event. - * - * This event is dispatched when the game instance has been told to destroy itself. - * Lots of internal systems listen to this event in order to clear themselves out. - * Custom plugins and game code should also do the same. - */ - const DESTROY: any; - - /** - * The Game Focus Event. - * - * This event is dispatched by the Game Visibility Handler when the window in which the Game instance is embedded - * enters a focused state. The focus event is raised when the window re-gains focus, having previously lost it. - */ - const FOCUS: any; - - /** - * The Game Hidden Event. - * - * This event is dispatched by the Game Visibility Handler when the document in which the Game instance is embedded - * enters a hidden state. Only browsers that support the Visibility API will cause this event to be emitted. - * - * In most modern browsers, when the document enters a hidden state, the Request Animation Frame and setTimeout, which - * control the main game loop, will automatically pause. There is no way to stop this from happening. It is something - * your game should account for in its own code, should the pause be an issue (i.e. for multiplayer games) - */ - const HIDDEN: any; - - /** - * The Game Pause Event. - * - * This event is dispatched when the Game loop enters a paused state, usually as a result of the Visibility Handler. - */ - const PAUSE: any; - - /** - * The Game Post-Render Event. - * - * This event is dispatched right at the end of the render process. - * - * Every Scene will have rendered and been drawn to the canvas by the time this event is fired. - * Use it for any last minute post-processing before the next game step begins. - */ - const POST_RENDER: any; - - /** - * The Game Post-Step Event. - * - * This event is dispatched after the Scene Manager has updated. - * Hook into it from plugins or systems that need to do things before the render starts. - */ - const POST_STEP: any; - - /** - * The Game Pre-Render Event. - * - * This event is dispatched immediately before any of the Scenes have started to render. - * - * The renderer will already have been initialized this frame, clearing itself and preparing to receive the Scenes for rendering, but it won't have actually drawn anything yet. - */ - const PRE_RENDER: any; - - /** - * The Game Pre-Step Event. - * - * This event is dispatched before the main Game Step starts. By this point in the game cycle none of the Scene updates have yet happened. - * Hook into it from plugins or systems that need to update before the Scene Manager does. - */ - const PRE_STEP: any; - - /** - * The Game Ready Event. - * - * This event is dispatched when the Phaser Game instance has finished booting, the Texture Manager is fully ready, - * and all local systems are now able to start. - */ - const READY: any; - - /** - * The Game Resume Event. - * - * This event is dispatched when the game loop leaves a paused state and resumes running. - */ - const RESUME: any; - - /** - * The Game Step Event. - * - * This event is dispatched after the Game Pre-Step and before the Scene Manager steps. - * Hook into it from plugins or systems that need to update before the Scene Manager does, but after the core Systems have. - */ - const STEP: any; - - /** - * The Game Visible Event. - * - * This event is dispatched by the Game Visibility Handler when the document in which the Game instance is embedded - * enters a visible state, previously having been hidden. - * - * Only browsers that support the Visibility API will cause this event to be emitted. - */ - const VISIBLE: any; - - } - /** * The core runner class that Phaser uses to handle the game loop. It can use either Request Animation Frame, * or SetTimeout, based on browser support and config settings, to create a continuous loop within the browser. @@ -6298,6 +6156,148 @@ declare namespace Phaser { */ function VisibilityHandler(game: Phaser.Game): void; + namespace Events { + /** + * The Game Blur Event. + * + * This event is dispatched by the Game Visibility Handler when the window in which the Game instance is embedded + * enters a blurred state. The blur event is raised when the window loses focus. This can happen if a user swaps + * tab, or if they simply remove focus from the browser to another app. + */ + const BLUR: any; + + /** + * The Game Boot Event. + * + * This event is dispatched when the Phaser Game instance has finished booting, but before it is ready to start running. + * The global systems use this event to know when to set themselves up, dispatching their own `ready` events as required. + */ + const BOOT: any; + + /** + * The Game Context Lost Event. + * + * This event is dispatched by the Game if the WebGL Renderer it is using encounters a WebGL Context Lost event from the browser. + * + * The partner event is `CONTEXT_RESTORED`. + */ + const CONTEXT_LOST: any; + + /** + * The Game Context Restored Event. + * + * This event is dispatched by the Game if the WebGL Renderer it is using encounters a WebGL Context Restored event from the browser. + * + * The partner event is `CONTEXT_LOST`. + */ + const CONTEXT_RESTORED: any; + + /** + * The Game Destroy Event. + * + * This event is dispatched when the game instance has been told to destroy itself. + * Lots of internal systems listen to this event in order to clear themselves out. + * Custom plugins and game code should also do the same. + */ + const DESTROY: any; + + /** + * The Game Focus Event. + * + * This event is dispatched by the Game Visibility Handler when the window in which the Game instance is embedded + * enters a focused state. The focus event is raised when the window re-gains focus, having previously lost it. + */ + const FOCUS: any; + + /** + * The Game Hidden Event. + * + * This event is dispatched by the Game Visibility Handler when the document in which the Game instance is embedded + * enters a hidden state. Only browsers that support the Visibility API will cause this event to be emitted. + * + * In most modern browsers, when the document enters a hidden state, the Request Animation Frame and setTimeout, which + * control the main game loop, will automatically pause. There is no way to stop this from happening. It is something + * your game should account for in its own code, should the pause be an issue (i.e. for multiplayer games) + */ + const HIDDEN: any; + + /** + * The Game Pause Event. + * + * This event is dispatched when the Game loop enters a paused state, usually as a result of the Visibility Handler. + */ + const PAUSE: any; + + /** + * The Game Post-Render Event. + * + * This event is dispatched right at the end of the render process. + * + * Every Scene will have rendered and been drawn to the canvas by the time this event is fired. + * Use it for any last minute post-processing before the next game step begins. + */ + const POST_RENDER: any; + + /** + * The Game Post-Step Event. + * + * This event is dispatched after the Scene Manager has updated. + * Hook into it from plugins or systems that need to do things before the render starts. + */ + const POST_STEP: any; + + /** + * The Game Pre-Render Event. + * + * This event is dispatched immediately before any of the Scenes have started to render. + * + * The renderer will already have been initialized this frame, clearing itself and preparing to receive the Scenes for rendering, but it won't have actually drawn anything yet. + */ + const PRE_RENDER: any; + + /** + * The Game Pre-Step Event. + * + * This event is dispatched before the main Game Step starts. By this point in the game cycle none of the Scene updates have yet happened. + * Hook into it from plugins or systems that need to update before the Scene Manager does. + */ + const PRE_STEP: any; + + /** + * The Game Ready Event. + * + * This event is dispatched when the Phaser Game instance has finished booting, the Texture Manager is fully ready, + * and all local systems are now able to start. + */ + const READY: any; + + /** + * The Game Resume Event. + * + * This event is dispatched when the game loop leaves a paused state and resumes running. + */ + const RESUME: any; + + /** + * The Game Step Event. + * + * This event is dispatched after the Game Pre-Step and before the Scene Manager steps. + * Hook into it from plugins or systems that need to update before the Scene Manager does, but after the core Systems have. + */ + const STEP: any; + + /** + * The Game Visible Event. + * + * This event is dispatched by the Game Visibility Handler when the document in which the Game instance is embedded + * enters a visible state, previously having been hidden. + * + * Only browsers that support the Visibility API will cause this event to be emitted. + */ + const VISIBLE: any; + + } + } namespace Create { @@ -6862,6 +6862,135 @@ declare namespace Phaser { } + /** + * A quadratic Bézier curve constructed from two control points. + */ + class QuadraticBezier extends Phaser.Curves.Curve { + /** + * + * @param p0 Start point, or an array of point pairs. + * @param p1 Control Point 1. + * @param p2 Control Point 2. + */ + constructor(p0: Phaser.Math.Vector2 | number[], p1: Phaser.Math.Vector2, p2: Phaser.Math.Vector2); + + /** + * The start point. + */ + p0: Phaser.Math.Vector2; + + /** + * The first control point. + */ + p1: Phaser.Math.Vector2; + + /** + * The second control point. + */ + p2: Phaser.Math.Vector2; + + /** + * Gets the starting point on the curve. + * @param out A Vector2 object to store the result in. If not given will be created. + */ + getStartPoint(out?: O): O; + + /** + * Get the resolution of the curve. + * @param divisions Optional divisions value. + */ + getResolution(divisions: number): number; + + /** + * Get point at relative position in curve according to length. + * @param t The position along the curve to return. Where 0 is the start and 1 is the end. + * @param out A Vector2 object to store the result in. If not given will be created. + */ + getPoint(t: number, out?: O): O; + + /** + * Draws this curve on the given Graphics object. + * + * The curve is drawn using `Graphics.strokePoints` so will be drawn at whatever the present Graphics stroke color is. + * The Graphics object is not cleared before the draw, so the curve will appear on-top of anything else already rendered to it. + * @param graphics `Graphics` object to draw onto. + * @param pointsTotal Number of points to be used for drawing the curve. Higher numbers result in smoother curve but require more processing. Default 32. + */ + draw(graphics: G, pointsTotal?: number): G; + + /** + * Converts the curve into a JSON compatible object. + */ + toJSON(): Phaser.Types.Curves.JSONCurve; + + /** + * Creates a curve from a JSON object, e. g. created by `toJSON`. + * @param data The JSON object containing this curve data. + */ + static fromJSON(data: Phaser.Types.Curves.JSONCurve): Phaser.Curves.QuadraticBezier; + + } + + /** + * Create a smooth 2d spline curve from a series of points. + */ + class Spline extends Phaser.Curves.Curve { + /** + * + * @param points The points that configure the curve. + */ + constructor(points?: Phaser.Math.Vector2[] | number[] | number[][]); + + /** + * The Vector2 points that configure the curve. + */ + points: Phaser.Math.Vector2[]; + + /** + * Add a list of points to the current list of Vector2 points of the curve. + * @param points The points that configure the curve. + */ + addPoints(points: Phaser.Math.Vector2[] | number[] | number[][]): this; + + /** + * Add a point to the current list of Vector2 points of the curve. + * @param x The x coordinate of this curve + * @param y The y coordinate of this curve + */ + addPoint(x: number, y: number): Phaser.Math.Vector2; + + /** + * Gets the starting point on the curve. + * @param out A Vector2 object to store the result in. If not given will be created. + */ + getStartPoint(out?: O): O; + + /** + * Get the resolution of the curve. + * @param divisions Optional divisions value. + */ + getResolution(divisions: number): number; + + /** + * Get point at relative position in curve according to length. + * @param t The position along the curve to return. Where 0 is the start and 1 is the end. + * @param out A Vector2 object to store the result in. If not given will be created. + */ + getPoint(t: number, out?: O): O; + + /** + * Exports a JSON object containing this curve data. + */ + toJSON(): Phaser.Types.Curves.JSONCurve; + + /** + * Imports a JSON object containing this curve data. + * @param data The JSON object containing this curve data. + */ + static fromJSON(data: Phaser.Types.Curves.JSONCurve): Phaser.Curves.Spline; + + } + /** * A MoveTo Curve is a very simple curve consisting of only a single point. * Its intended use is to move the ending point in a Path. @@ -7147,135 +7276,6 @@ declare namespace Phaser { } - /** - * A quadratic Bézier curve constructed from two control points. - */ - class QuadraticBezier extends Phaser.Curves.Curve { - /** - * - * @param p0 Start point, or an array of point pairs. - * @param p1 Control Point 1. - * @param p2 Control Point 2. - */ - constructor(p0: Phaser.Math.Vector2 | number[], p1: Phaser.Math.Vector2, p2: Phaser.Math.Vector2); - - /** - * The start point. - */ - p0: Phaser.Math.Vector2; - - /** - * The first control point. - */ - p1: Phaser.Math.Vector2; - - /** - * The second control point. - */ - p2: Phaser.Math.Vector2; - - /** - * Gets the starting point on the curve. - * @param out A Vector2 object to store the result in. If not given will be created. - */ - getStartPoint(out?: O): O; - - /** - * Get the resolution of the curve. - * @param divisions Optional divisions value. - */ - getResolution(divisions: number): number; - - /** - * Get point at relative position in curve according to length. - * @param t The position along the curve to return. Where 0 is the start and 1 is the end. - * @param out A Vector2 object to store the result in. If not given will be created. - */ - getPoint(t: number, out?: O): O; - - /** - * Draws this curve on the given Graphics object. - * - * The curve is drawn using `Graphics.strokePoints` so will be drawn at whatever the present Graphics stroke color is. - * The Graphics object is not cleared before the draw, so the curve will appear on-top of anything else already rendered to it. - * @param graphics `Graphics` object to draw onto. - * @param pointsTotal Number of points to be used for drawing the curve. Higher numbers result in smoother curve but require more processing. Default 32. - */ - draw(graphics: G, pointsTotal?: number): G; - - /** - * Converts the curve into a JSON compatible object. - */ - toJSON(): Phaser.Types.Curves.JSONCurve; - - /** - * Creates a curve from a JSON object, e. g. created by `toJSON`. - * @param data The JSON object containing this curve data. - */ - static fromJSON(data: Phaser.Types.Curves.JSONCurve): Phaser.Curves.QuadraticBezier; - - } - - /** - * Create a smooth 2d spline curve from a series of points. - */ - class Spline extends Phaser.Curves.Curve { - /** - * - * @param points The points that configure the curve. - */ - constructor(points?: Phaser.Math.Vector2[] | number[] | number[][]); - - /** - * The Vector2 points that configure the curve. - */ - points: Phaser.Math.Vector2[]; - - /** - * Add a list of points to the current list of Vector2 points of the curve. - * @param points The points that configure the curve. - */ - addPoints(points: Phaser.Math.Vector2[] | number[] | number[][]): this; - - /** - * Add a point to the current list of Vector2 points of the curve. - * @param x The x coordinate of this curve - * @param y The y coordinate of this curve - */ - addPoint(x: number, y: number): Phaser.Math.Vector2; - - /** - * Gets the starting point on the curve. - * @param out A Vector2 object to store the result in. If not given will be created. - */ - getStartPoint(out?: O): O; - - /** - * Get the resolution of the curve. - * @param divisions Optional divisions value. - */ - getResolution(divisions: number): number; - - /** - * Get point at relative position in curve according to length. - * @param t The position along the curve to return. Where 0 is the start and 1 is the end. - * @param out A Vector2 object to store the result in. If not given will be created. - */ - getPoint(t: number, out?: O): O; - - /** - * Exports a JSON object containing this curve data. - */ - toJSON(): Phaser.Types.Curves.JSONCurve; - - /** - * Imports a JSON object containing this curve data. - * @param data The JSON object containing this curve data. - */ - static fromJSON(data: Phaser.Types.Curves.JSONCurve): Phaser.Curves.Spline; - - } - } namespace Data { @@ -7995,6 +7995,241 @@ declare namespace Phaser { }; namespace Display { + /** + * The ColorMatrix class creates a 5x4 matrix that can be used in shaders and graphics + * operations. It provides methods required to modify the color values, such as adjusting + * the brightness, setting a sepia tone, hue rotation and more. + * + * Use the method `getData` to return a Float32Array containing the current color values. + */ + class ColorMatrix { + /** + * The value that determines how much of the original color is used + * when mixing the colors. A value between 0 (all original) and 1 (all final) + */ + alpha: number; + + /** + * Sets this ColorMatrix from the given array of color values. + * @param value The ColorMatrix values to set. + */ + set(value: number[]): this; + + /** + * Resets the ColorMatrix. + */ + reset(): this; + + /** + * Gets the ColorMatrix as a Float32Array. + * + * Can be used directly as a 1fv shader uniform value. + */ + getData(): Float32Array; + + /** + * Changes the brightness of this ColorMatrix by the given amount. + * @param value The amount of brightness to apply to this ColorMatrix. Between 0 (black) and 1. Default 0. + * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. + */ + brightness(value?: number, multiply?: boolean): this; + + /** + * Changes the saturation of this ColorMatrix by the given amount. + * @param value The amount of saturation to apply to this ColorMatrix. Default 0. + * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. + */ + saturate(value?: number, multiply?: boolean): this; + + /** + * Desaturates this ColorMatrix (removes color from it). + * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. + */ + saturation(multiply?: boolean): this; + + /** + * Rotates the hues of this ColorMatrix by the value given. + * @param rotation The amount of hue rotation to apply to this ColorMatrix, in degrees. Default 0. + * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. + */ + hue(rotation?: number, multiply?: boolean): this; + + /** + * Sets this ColorMatrix to be grayscale. + * @param value The grayscale scale (0 is black). Default 1. + * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. + */ + grayscale(value?: number, multiply?: boolean): this; + + /** + * Sets this ColorMatrix to be black and white. + * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. + */ + blackWhite(multiply?: boolean): this; + + /** + * Change the contrast of this ColorMatrix by the amount given. + * @param value The amount of contrast to apply to this ColorMatrix. Default 0. + * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. + */ + contrast(value?: number, multiply?: boolean): this; + + /** + * Converts this ColorMatrix to have negative values. + * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. + */ + negative(multiply?: boolean): this; + + /** + * Apply a desaturated luminance to this ColorMatrix. + * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. + */ + desaturateLuminance(multiply?: boolean): this; + + /** + * Applies a sepia tone to this ColorMatrix. + * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. + */ + sepia(multiply?: boolean): this; + + /** + * Applies a night vision tone to this ColorMatrix. + * @param intensity The intensity of this effect. Default 0.1. + * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. + */ + night(intensity?: number, multiply?: boolean): this; + + /** + * Applies a trippy color tone to this ColorMatrix. + * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. + */ + lsd(multiply?: boolean): this; + + /** + * Applies a brown tone to this ColorMatrix. + * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. + */ + brown(multiply?: boolean): this; + + /** + * Applies a vintage pinhole color effect to this ColorMatrix. + * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. + */ + vintagePinhole(multiply?: boolean): this; + + /** + * Applies a kodachrome color effect to this ColorMatrix. + * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. + */ + kodachrome(multiply?: boolean): this; + + /** + * Applies a technicolor color effect to this ColorMatrix. + * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. + */ + technicolor(multiply?: boolean): this; + + /** + * Applies a polaroid color effect to this ColorMatrix. + * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. + */ + polaroid(multiply?: boolean): this; + + /** + * Shifts the values of this ColorMatrix into BGR order. + * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. + */ + shiftToBGR(multiply?: boolean): this; + + /** + * Multiplies the two given matrices. + * @param a The 5x4 array to multiply with ColorMatrix._matrix. + */ + multiply(a: number[]): this; + + } + + /** + * The RGB class holds a single color value and allows for easy modification and reading of it, + * with optional on-change callback notification and a dirty flag. + */ + class RGB { + /** + * + * @param red The red color value. A number between 0 and 1. Default 0. + * @param green The green color value. A number between 0 and 1. Default 0. + * @param blue The blue color value. A number between 0 and 1. Default 0. + */ + constructor(red?: number, green?: number, blue?: number); + + /** + * This callback will be invoked each time one of the RGB color values change. + * + * The callback is sent the new color values as the parameters. + */ + onChangeCallback: Function; + + /** + * Is this color dirty? + */ + dirty: boolean; + + /** + * Sets the red, green and blue values of this RGB object, flags it as being + * dirty and then invokes the `onChangeCallback`, if set. + * @param red The red color value. A number between 0 and 1. Default 0. + * @param green The green color value. A number between 0 and 1. Default 0. + * @param blue The blue color value. A number between 0 and 1. Default 0. + */ + set(red?: number, green?: number, blue?: number): this; + + /** + * Compares the given rgb parameters with those in this object and returns + * a boolean `true` value if they are equal, otherwise it returns `false`. + * @param red The red value to compare with this object. + * @param green The green value to compare with this object. + * @param blue The blue value to compare with this object. + */ + equals(red: number, green: number, blue: number): boolean; + + /** + * Internal on change handler. Sets this object as being dirty and + * then invokes the `onChangeCallback`, if set, passing in the + * new RGB values. + */ + onChange(): void; + + /** + * The red color value. Between 0 and 1. + * + * Changing this property will flag this RGB object as being dirty + * and invoke the `onChangeCallback` , if set. + */ + r: number; + + /** + * The green color value. Between 0 and 1. + * + * Changing this property will flag this RGB object as being dirty + * and invoke the `onChangeCallback` , if set. + */ + g: number; + + /** + * The blue color value. Between 0 and 1. + * + * Changing this property will flag this RGB object as being dirty + * and invoke the `onChangeCallback` , if set. + */ + b: number; + + /** + * Nulls any external references this object contains. + */ + destroy(): void; + + } + namespace Align { /** * A constant representing a top-left alignment or position. @@ -8796,16 +9031,6 @@ declare namespace Phaser { */ static GetColor32(red: number, green: number, blue: number, alpha: number): number; - /** - * Converts a hex string into a Phaser Color object. - * - * The hex string can supplied as `'#0033ff'` or the short-hand format of `'#03f'`; it can begin with an optional "#" or "0x", or be unprefixed. - * - * An alpha channel is _not_ supported. - * @param hex The hex color value to convert, such as `#0033ff` or the short-hand format: `#03f`. - */ - static HexStringToColor(hex: string): Phaser.Display.Color; - /** * Converts HSL (hue, saturation and lightness) values to a Phaser Color object. * @param h The hue value in the range 0 to 1. @@ -8834,6 +9059,16 @@ declare namespace Phaser { */ static HSVToRGB(h: number, s: number, v: number, out?: Phaser.Types.Display.ColorObject | Phaser.Display.Color): Phaser.Types.Display.ColorObject | Phaser.Display.Color; + /** + * Converts a hex string into a Phaser Color object. + * + * The hex string can supplied as `'#0033ff'` or the short-hand format of `'#03f'`; it can begin with an optional "#" or "0x", or be unprefixed. + * + * An alpha channel is _not_ supported. + * @param hex The hex color value to convert, such as `#0033ff` or the short-hand format: `#03f`. + */ + static HexStringToColor(hex: string): Phaser.Display.Color; + /** * Converts a hue to an RGB color. * Based on code by Michael Jackson (https://github.com/mjijackson) @@ -8860,14 +9095,6 @@ declare namespace Phaser { */ static ObjectToColor(input: Phaser.Types.Display.InputColorObject): Phaser.Display.Color; - /** - * Creates a new Color object where the r, g, and b values have been set to random values - * based on the given min max values. - * @param min The minimum value to set the random range from (between 0 and 255) Default 0. - * @param max The maximum value to set the random range from (between 0 and 255) Default 255. - */ - static RandomRGB(min?: number, max?: number): Phaser.Display.Color; - /** * Converts a CSS 'web' string into a Phaser Color object. * @@ -8898,6 +9125,14 @@ declare namespace Phaser { */ static RGBToString(r: number, g: number, b: number, a?: number, prefix?: string): string; + /** + * Creates a new Color object where the r, g, and b values have been set to random values + * based on the given min max values. + * @param min The minimum value to set the random range from (between 0 and 255) Default 0. + * @param max The maximum value to set the random range from (between 0 and 255) Default 255. + */ + static RandomRGB(min?: number, max?: number): Phaser.Display.Color; + /** * Converts the given source color value into an instance of a Color class. * The value can be either a string, prefixed with `rgb` or a hex string, a number or an Object. @@ -8907,160 +9142,6 @@ declare namespace Phaser { } - /** - * The ColorMatrix class creates a 5x4 matrix that can be used in shaders and graphics - * operations. It provides methods required to modify the color values, such as adjusting - * the brightness, setting a sepia tone, hue rotation and more. - * - * Use the method `getData` to return a Float32Array containing the current color values. - */ - class ColorMatrix { - /** - * The value that determines how much of the original color is used - * when mixing the colors. A value between 0 (all original) and 1 (all final) - */ - alpha: number; - - /** - * Sets this ColorMatrix from the given array of color values. - * @param value The ColorMatrix values to set. - */ - set(value: number[]): this; - - /** - * Resets the ColorMatrix. - */ - reset(): this; - - /** - * Gets the ColorMatrix as a Float32Array. - * - * Can be used directly as a 1fv shader uniform value. - */ - getData(): Float32Array; - - /** - * Changes the brightness of this ColorMatrix by the given amount. - * @param value The amount of brightness to apply to this ColorMatrix. Between 0 (black) and 1. Default 0. - * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. - */ - brightness(value?: number, multiply?: boolean): this; - - /** - * Changes the saturation of this ColorMatrix by the given amount. - * @param value The amount of saturation to apply to this ColorMatrix. Default 0. - * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. - */ - saturate(value?: number, multiply?: boolean): this; - - /** - * Desaturates this ColorMatrix (removes color from it). - * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. - */ - saturation(multiply?: boolean): this; - - /** - * Rotates the hues of this ColorMatrix by the value given. - * @param rotation The amount of hue rotation to apply to this ColorMatrix, in degrees. Default 0. - * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. - */ - hue(rotation?: number, multiply?: boolean): this; - - /** - * Sets this ColorMatrix to be grayscale. - * @param value The grayscale scale (0 is black). Default 1. - * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. - */ - grayscale(value?: number, multiply?: boolean): this; - - /** - * Sets this ColorMatrix to be black and white. - * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. - */ - blackWhite(multiply?: boolean): this; - - /** - * Change the contrast of this ColorMatrix by the amount given. - * @param value The amount of contrast to apply to this ColorMatrix. Default 0. - * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. - */ - contrast(value?: number, multiply?: boolean): this; - - /** - * Converts this ColorMatrix to have negative values. - * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. - */ - negative(multiply?: boolean): this; - - /** - * Apply a desaturated luminance to this ColorMatrix. - * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. - */ - desaturateLuminance(multiply?: boolean): this; - - /** - * Applies a sepia tone to this ColorMatrix. - * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. - */ - sepia(multiply?: boolean): this; - - /** - * Applies a night vision tone to this ColorMatrix. - * @param intensity The intensity of this effect. Default 0.1. - * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. - */ - night(intensity?: number, multiply?: boolean): this; - - /** - * Applies a trippy color tone to this ColorMatrix. - * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. - */ - lsd(multiply?: boolean): this; - - /** - * Applies a brown tone to this ColorMatrix. - * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. - */ - brown(multiply?: boolean): this; - - /** - * Applies a vintage pinhole color effect to this ColorMatrix. - * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. - */ - vintagePinhole(multiply?: boolean): this; - - /** - * Applies a kodachrome color effect to this ColorMatrix. - * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. - */ - kodachrome(multiply?: boolean): this; - - /** - * Applies a technicolor color effect to this ColorMatrix. - * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. - */ - technicolor(multiply?: boolean): this; - - /** - * Applies a polaroid color effect to this ColorMatrix. - * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. - */ - polaroid(multiply?: boolean): this; - - /** - * Shifts the values of this ColorMatrix into BGR order. - * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. - */ - shiftToBGR(multiply?: boolean): this; - - /** - * Multiplies the two given matrices. - * @param a The 5x4 array to multiply with ColorMatrix._matrix. - */ - multiply(a: number[]): this; - - } - namespace Masks { /** * A Bitmap Mask combines the alpha (opacity) of a masked pixel with the alpha of another pixel. @@ -9322,87 +9403,6 @@ declare namespace Phaser { } - /** - * The RGB class holds a single color value and allows for easy modification and reading of it, - * with optional on-change callback notification and a dirty flag. - */ - class RGB { - /** - * - * @param red The red color value. A number between 0 and 1. Default 0. - * @param green The green color value. A number between 0 and 1. Default 0. - * @param blue The blue color value. A number between 0 and 1. Default 0. - */ - constructor(red?: number, green?: number, blue?: number); - - /** - * This callback will be invoked each time one of the RGB color values change. - * - * The callback is sent the new color values as the parameters. - */ - onChangeCallback: Function; - - /** - * Is this color dirty? - */ - dirty: boolean; - - /** - * Sets the red, green and blue values of this RGB object, flags it as being - * dirty and then invokes the `onChangeCallback`, if set. - * @param red The red color value. A number between 0 and 1. Default 0. - * @param green The green color value. A number between 0 and 1. Default 0. - * @param blue The blue color value. A number between 0 and 1. Default 0. - */ - set(red?: number, green?: number, blue?: number): this; - - /** - * Compares the given rgb parameters with those in this object and returns - * a boolean `true` value if they are equal, otherwise it returns `false`. - * @param red The red value to compare with this object. - * @param green The green value to compare with this object. - * @param blue The blue value to compare with this object. - */ - equals(red: number, green: number, blue: number): boolean; - - /** - * Internal on change handler. Sets this object as being dirty and - * then invokes the `onChangeCallback`, if set, passing in the - * new RGB values. - */ - onChange(): void; - - /** - * The red color value. Between 0 and 1. - * - * Changing this property will flag this RGB object as being dirty - * and invoke the `onChangeCallback` , if set. - */ - r: number; - - /** - * The green color value. Between 0 and 1. - * - * Changing this property will flag this RGB object as being dirty - * and invoke the `onChangeCallback` , if set. - */ - g: number; - - /** - * The blue color value. Between 0 and 1. - * - * Changing this property will flag this RGB object as being dirty - * and invoke the `onChangeCallback` , if set. - */ - b: number; - - /** - * Nulls any external references this object contains. - */ - destroy(): void; - - } - /** * A BaseShader is a small resource class that contains the data required for a WebGL Shader to be created. * @@ -9664,6 +9664,1721 @@ declare namespace Phaser { } namespace GameObjects { + /** + * Builds a Game Object using the provided configuration object. + * @param scene A reference to the Scene. + * @param gameObject The initial GameObject. + * @param config The config to build the GameObject with. + */ + function BuildGameObject(scene: Phaser.Scene, gameObject: Phaser.GameObjects.GameObject, config: Phaser.Types.GameObjects.GameObjectConfig): Phaser.GameObjects.GameObject; + + /** + * Adds an Animation component to a Sprite and populates it based on the given config. + * @param sprite The sprite to add an Animation component to. + * @param config The animation config. + */ + function BuildGameObjectAnimation(sprite: Phaser.GameObjects.Sprite, config: object): Phaser.GameObjects.Sprite; + + /** + * The Display List plugin. + * + * Display Lists belong to a Scene and maintain the list of Game Objects to render every frame. + * + * Some of these Game Objects may also be part of the Scene's [Update List]{@link Phaser.GameObjects.UpdateList}, for updating. + */ + class DisplayList extends Phaser.Structs.List { + /** + * + * @param scene The Scene that this Display List belongs to. + */ + constructor(scene: Phaser.Scene); + + /** + * The flag the determines whether Game Objects should be sorted when `depthSort()` is called. + */ + sortChildrenFlag: boolean; + + /** + * The Scene that this Display List belongs to. + */ + scene: Phaser.Scene; + + /** + * The Scene's Systems. + */ + systems: Phaser.Scenes.Systems; + + /** + * The Scene's Event Emitter. + */ + events: Phaser.Events.EventEmitter; + + /** + * Force a sort of the display list on the next call to depthSort. + */ + queueDepthSort(): void; + + /** + * Immediately sorts the display list if the flag is set. + */ + depthSort(): void; + + /** + * Compare the depth of two Game Objects. + * @param childA The first Game Object. + * @param childB The second Game Object. + */ + sortByDepth(childA: Phaser.GameObjects.GameObject, childB: Phaser.GameObjects.GameObject): number; + + /** + * Returns an array which contains all objects currently on the Display List. + * This is a reference to the main list array, not a copy of it, so be careful not to modify it. + */ + getChildren(): Phaser.GameObjects.GameObject[]; + + } + + /** + * The base class that all Game Objects extend. + * You don't create GameObjects directly and they cannot be added to the display list. + * Instead, use them as the base for your own custom classes. + */ + class GameObject extends Phaser.Events.EventEmitter { + /** + * + * @param scene The Scene to which this Game Object belongs. + * @param type A textual representation of the type of Game Object, i.e. `sprite`. + */ + constructor(scene: Phaser.Scene, type: string); + + /** + * A reference to the Scene to which this Game Object belongs. + * + * Game Objects can only belong to one Scene. + * + * You should consider this property as being read-only. You cannot move a + * Game Object to another Scene by simply changing it. + */ + scene: Phaser.Scene; + + /** + * Holds a reference to the Display List that contains this Game Object. + * + * This is set automatically when this Game Object is added to a Scene or Layer. + * + * You should treat this property as being read-only. + */ + displayList: Phaser.GameObjects.DisplayList | Phaser.GameObjects.Layer; + + /** + * A textual representation of this Game Object, i.e. `sprite`. + * Used internally by Phaser but is available for your own custom classes to populate. + */ + type: string; + + /** + * The current state of this Game Object. + * + * Phaser itself will never modify this value, although plugins may do so. + * + * Use this property to track the state of a Game Object during its lifetime. For example, it could change from + * a state of 'moving', to 'attacking', to 'dead'. The state value should be an integer (ideally mapped to a constant + * in your game code), or a string. These are recommended to keep it light and simple, with fast comparisons. + * If you need to store complex data about your Game Object, look at using the Data Component instead. + */ + state: number | string; + + /** + * The parent Container of this Game Object, if it has one. + */ + parentContainer: Phaser.GameObjects.Container; + + /** + * The name of this Game Object. + * Empty by default and never populated by Phaser, this is left for developers to use. + */ + name: string; + + /** + * The active state of this Game Object. + * A Game Object with an active state of `true` is processed by the Scenes UpdateList, if added to it. + * An active object is one which is having its logic and internal systems updated. + */ + active: boolean; + + /** + * The Tab Index of the Game Object. + * Reserved for future use by plugins and the Input Manager. + */ + tabIndex: number; + + /** + * A Data Manager. + * It allows you to store, query and get key/value paired information specific to this Game Object. + * `null` by default. Automatically created if you use `getData` or `setData` or `setDataEnabled`. + */ + data: Phaser.Data.DataManager; + + /** + * The flags that are compared against `RENDER_MASK` to determine if this Game Object will render or not. + * The bits are 0001 | 0010 | 0100 | 1000 set by the components Visible, Alpha, Transform and Texture respectively. + * If those components are not used by your custom class then you can use this bitmask as you wish. + */ + renderFlags: number; + + /** + * A bitmask that controls if this Game Object is drawn by a Camera or not. + * Not usually set directly, instead call `Camera.ignore`, however you can + * set this property directly using the Camera.id property: + */ + cameraFilter: number; + + /** + * If this Game Object is enabled for input then this property will contain an InteractiveObject instance. + * Not usually set directly. Instead call `GameObject.setInteractive()`. + */ + input: Phaser.Types.Input.InteractiveObject | null; + + /** + * If this Game Object is enabled for Arcade or Matter Physics then this property will contain a reference to a Physics Body. + */ + body: Phaser.Physics.Arcade.Body | Phaser.Physics.Arcade.StaticBody | MatterJS.BodyType | null; + + /** + * This Game Object will ignore all calls made to its destroy method if this flag is set to `true`. + * This includes calls that may come from a Group, Container or the Scene itself. + * While it allows you to persist a Game Object across Scenes, please understand you are entirely + * responsible for managing references to and from this Game Object. + */ + ignoreDestroy: boolean; + + /** + * Sets the `active` property of this Game Object and returns this Game Object for further chaining. + * A Game Object with its `active` property set to `true` will be updated by the Scenes UpdateList. + * @param value True if this Game Object should be set as active, false if not. + */ + setActive(value: boolean): this; + + /** + * Sets the `name` property of this Game Object and returns this Game Object for further chaining. + * The `name` property is not populated by Phaser and is presented for your own use. + * @param value The name to be given to this Game Object. + */ + setName(value: string): this; + + /** + * Sets the current state of this Game Object. + * + * Phaser itself will never modify the State of a Game Object, although plugins may do so. + * + * For example, a Game Object could change from a state of 'moving', to 'attacking', to 'dead'. + * The state value should typically be an integer (ideally mapped to a constant + * in your game code), but could also be a string. It is recommended to keep it light and simple. + * If you need to store complex data about your Game Object, look at using the Data Component instead. + * @param value The state of the Game Object. + */ + setState(value: number | string): this; + + /** + * Adds a Data Manager component to this Game Object. + */ + setDataEnabled(): this; + + /** + * Allows you to store a key value pair within this Game Objects Data Manager. + * + * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled + * before setting the value. + * + * If the key doesn't already exist in the Data Manager then it is created. + * + * ```javascript + * sprite.setData('name', 'Red Gem Stone'); + * ``` + * + * You can also pass in an object of key value pairs as the first argument: + * + * ```javascript + * sprite.setData({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 }); + * ``` + * + * To get a value back again you can call `getData`: + * + * ```javascript + * sprite.getData('gold'); + * ``` + * + * Or you can access the value directly via the `values` property, where it works like any other variable: + * + * ```javascript + * sprite.data.values.gold += 50; + * ``` + * + * When the value is first set, a `setdata` event is emitted from this Game Object. + * + * If the key already exists, a `changedata` event is emitted instead, along an event named after the key. + * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`. + * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter. + * + * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings. + * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. + * @param key The key to set the value for. Or an object of key value pairs. If an object the `data` argument is ignored. + * @param data The value to set for the given key. If an object is provided as the key this argument is ignored. + */ + setData(key: string | object, data?: any): this; + + /** + * Increase a value for the given key within this Game Objects Data Manager. If the key doesn't already exist in the Data Manager then it is increased from 0. + * + * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled + * before setting the value. + * + * If the key doesn't already exist in the Data Manager then it is created. + * + * When the value is first set, a `setdata` event is emitted from this Game Object. + * @param key The key to increase the value for. + * @param data The value to increase for the given key. + */ + incData(key: string | object, data?: any): this; + + /** + * Toggle a boolean value for the given key within this Game Objects Data Manager. If the key doesn't already exist in the Data Manager then it is toggled from false. + * + * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled + * before setting the value. + * + * If the key doesn't already exist in the Data Manager then it is created. + * + * When the value is first set, a `setdata` event is emitted from this Game Object. + * @param key The key to toggle the value for. + */ + toggleData(key: string | object): this; + + /** + * Retrieves the value for the given key in this Game Objects Data Manager, or undefined if it doesn't exist. + * + * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either: + * + * ```javascript + * sprite.getData('gold'); + * ``` + * + * Or access the value directly: + * + * ```javascript + * sprite.data.values.gold; + * ``` + * + * You can also pass in an array of keys, in which case an array of values will be returned: + * + * ```javascript + * sprite.getData([ 'gold', 'armor', 'health' ]); + * ``` + * + * This approach is useful for destructuring arrays in ES6. + * @param key The key of the value to retrieve, or an array of keys. + */ + getData(key: string | string[]): any; + + /** + * Pass this Game Object to the Input Manager to enable it for Input. + * + * Input works by using hit areas, these are nearly always geometric shapes, such as rectangles or circles, that act as the hit area + * for the Game Object. However, you can provide your own hit area shape and callback, should you wish to handle some more advanced + * input detection. + * + * If no arguments are provided it will try and create a rectangle hit area based on the texture frame the Game Object is using. If + * this isn't a texture-bound object, such as a Graphics or BitmapText object, this will fail, and you'll need to provide a specific + * shape for it to use. + * + * You can also provide an Input Configuration Object as the only argument to this method. + * @param hitArea Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not given it will try to create a Rectangle based on the texture frame. + * @param callback The callback that determines if the pointer is within the Hit Area shape or not. If you provide a shape you must also provide a callback. + * @param dropZone Should this Game Object be treated as a drop zone target? Default false. + */ + setInteractive(hitArea?: Phaser.Types.Input.InputConfiguration | any, callback?: Phaser.Types.Input.HitAreaCallback, dropZone?: boolean): this; + + /** + * If this Game Object has previously been enabled for input, this will disable it. + * + * An object that is disabled for input stops processing or being considered for + * input events, but can be turned back on again at any time by simply calling + * `setInteractive()` with no arguments provided. + * + * If want to completely remove interaction from this Game Object then use `removeInteractive` instead. + */ + disableInteractive(): this; + + /** + * If this Game Object has previously been enabled for input, this will queue it + * for removal, causing it to no longer be interactive. The removal happens on + * the next game step, it is not immediate. + * + * The Interactive Object that was assigned to this Game Object will be destroyed, + * removed from the Input Manager and cleared from this Game Object. + * + * If you wish to re-enable this Game Object at a later date you will need to + * re-create its InteractiveObject by calling `setInteractive` again. + * + * If you wish to only temporarily stop an object from receiving input then use + * `disableInteractive` instead, as that toggles the interactive state, where-as + * this erases it completely. + * + * If you wish to resize a hit area, don't remove and then set it as being + * interactive. Instead, access the hitarea object directly and resize the shape + * being used. I.e.: `sprite.input.hitArea.setSize(width, height)` (assuming the + * shape is a Rectangle, which it is by default.) + */ + removeInteractive(): this; + + /** + * This callback is invoked when this Game Object is added to a Scene. + * + * Can be overriden by custom Game Objects, but be aware of some Game Objects that + * will use this, such as Sprites, to add themselves into the Update List. + * + * You can also listen for the `ADDED_TO_SCENE` event from this Game Object. + */ + addedToScene(): void; + + /** + * This callback is invoked when this Game Object is removed from a Scene. + * + * Can be overriden by custom Game Objects, but be aware of some Game Objects that + * will use this, such as Sprites, to removed themselves from the Update List. + * + * You can also listen for the `REMOVED_FROM_SCENE` event from this Game Object. + */ + removedFromScene(): void; + + /** + * To be overridden by custom GameObjects. Allows base objects to be used in a Pool. + * @param args args + */ + update(...args: any[]): void; + + /** + * Returns a JSON representation of the Game Object. + */ + toJSON(): Phaser.Types.GameObjects.JSONGameObject; + + /** + * Compares the renderMask with the renderFlags to see if this Game Object will render or not. + * Also checks the Game Object against the given Cameras exclusion list. + * @param camera The Camera to check against this Game Object. + */ + willRender(camera: Phaser.Cameras.Scene2D.Camera): boolean; + + /** + * Returns an array containing the display list index of either this Game Object, or if it has one, + * its parent Container. It then iterates up through all of the parent containers until it hits the + * root of the display list (which is index 0 in the returned array). + * + * Used internally by the InputPlugin but also useful if you wish to find out the display depth of + * this Game Object and all of its ancestors. + */ + getIndexList(): number[]; + + /** + * Adds this Game Object to the given Display List. + * + * If no Display List is specified, it will default to the Display List owned by the Scene to which + * this Game Object belongs. + * + * A Game Object can only exist on one Display List at any given time, but may move freely between them. + * + * If this Game Object is already on another Display List when this method is called, it will first + * be removed from it, before being added to the new list. + * + * You can query which list it is on by looking at the `Phaser.GameObjects.GameObject#displayList` property. + * + * If a Game Object isn't on any display list, it will not be rendered. If you just wish to temporarly + * disable it from rendering, consider using the `setVisible` method, instead. + * @param displayList The Display List to add to. Defaults to the Scene Display List. + */ + addToDisplayList(displayList?: Phaser.GameObjects.DisplayList | Phaser.GameObjects.Layer): this; + + /** + * Adds this Game Object to the Update List belonging to the Scene. + * + * When a Game Object is added to the Update List it will have its `preUpdate` method called + * every game frame. This method is passed two parameters: `delta` and `time`. + * + * If you wish to run your own logic within `preUpdate` then you should always call + * `preUpdate.super(delta, time)` within it, or it may fail to process required operations, + * such as Sprite animations. + */ + addToUpdateList(): this; + + /** + * Removes this Game Object from the Display List it is currently on. + * + * A Game Object can only exist on one Display List at any given time, but may move freely removed + * and added back at a later stage. + * + * You can query which list it is on by looking at the `Phaser.GameObjects.GameObject#displayList` property. + * + * If a Game Object isn't on any Display List, it will not be rendered. If you just wish to temporarly + * disable it from rendering, consider using the `setVisible` method, instead. + */ + removeFromDisplayList(): this; + + /** + * Removes this Game Object from the Scene's Update List. + * + * When a Game Object is on the Update List, it will have its `preUpdate` method called + * every game frame. Calling this method will remove it from the list, preventing this. + * + * Removing a Game Object from the Update List will stop most internal functions working. + * For example, removing a Sprite from the Update List will prevent it from being able to + * run animations. + */ + removeFromUpdateList(): this; + + /** + * Destroys this Game Object removing it from the Display List and Update List and + * severing all ties to parent resources. + * + * Also removes itself from the Input Manager and Physics Manager if previously enabled. + * + * Use this to remove a Game Object from your game if you don't ever plan to use it again. + * As long as no reference to it exists within your own code it should become free for + * garbage collection by the browser. + * + * If you just want to temporarily disable an object then look at using the + * Game Object Pool instead of destroying it, as destroyed objects cannot be resurrected. + * @param fromScene `True` if this Game Object is being destroyed by the Scene, `false` if not. Default false. + */ + destroy(fromScene?: boolean): void; + + /** + * The bitmask that `GameObject.renderFlags` is compared against to determine if the Game Object will render or not. + */ + static readonly RENDER_MASK: number; + + } + + /** + * The Game Object Creator is a Scene plugin that allows you to quickly create many common + * types of Game Objects and return them. Unlike the Game Object Factory, they are not automatically + * added to the Scene. + * + * Game Objects directly register themselves with the Creator and inject their own creation + * methods into the class. + */ + class GameObjectCreator { + /** + * + * @param scene The Scene to which this Game Object Factory belongs. + */ + constructor(scene: Phaser.Scene); + + /** + * The Scene to which this Game Object Creator belongs. + */ + protected scene: Phaser.Scene; + + /** + * A reference to the Scene.Systems. + */ + protected systems: Phaser.Scenes.Systems; + + /** + * A reference to the Scene Event Emitter. + */ + protected events: Phaser.Events.EventEmitter; + + /** + * A reference to the Scene Display List. + */ + protected displayList: Phaser.GameObjects.DisplayList; + + /** + * A reference to the Scene Update List. + */ + protected updateList: Phaser.GameObjects.UpdateList; + + /** + * Static method called directly by the Game Object creator functions. + * With this method you can register a custom GameObject factory in the GameObjectCreator, + * providing a name (`factoryType`) and the constructor (`factoryFunction`) in order + * to be called when you invoke Phaser.Scene.make[ factoryType ] method. + * @param factoryType The key of the factory that you will use to call to Phaser.Scene.make[ factoryType ] method. + * @param factoryFunction The constructor function to be called when you invoke to the Phaser.Scene.make method. + */ + static register(factoryType: string, factoryFunction: Function): void; + + /** + * Static method called directly by the Game Object Creator functions. + * + * With this method you can remove a custom Game Object Creator that has been previously + * registered in the Game Object Creator. Pass in its `factoryType` in order to remove it. + * @param factoryType The key of the factory that you want to remove from the GameObjectCreator. + */ + static remove(factoryType: string): void; + + /** + * Creates a new Dynamic Bitmap Text Game Object and returns it. + * + * Note: This method will only be available if the Dynamic Bitmap Text Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + dynamicBitmapText(config: Phaser.Types.GameObjects.BitmapText.BitmapTextConfig, addToScene?: boolean): Phaser.GameObjects.DynamicBitmapText; + + /** + * Creates a new Bitmap Text Game Object and returns it. + * + * Note: This method will only be available if the Bitmap Text Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + bitmapText(config: Phaser.Types.GameObjects.BitmapText.BitmapTextConfig, addToScene?: boolean): Phaser.GameObjects.BitmapText; + + /** + * Creates a new Blitter Game Object and returns it. + * + * Note: This method will only be available if the Blitter Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + blitter(config: Phaser.Types.GameObjects.Sprite.SpriteConfig, addToScene?: boolean): Phaser.GameObjects.Blitter; + + /** + * Creates a new Container Game Object and returns it. + * + * Note: This method will only be available if the Container Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + container(config: Phaser.Types.GameObjects.Container.ContainerConfig, addToScene?: boolean): Phaser.GameObjects.Container; + + /** + * Creates a new Graphics Game Object and returns it. + * + * Note: This method will only be available if the Graphics Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + graphics(config: Phaser.Types.GameObjects.Graphics.Options, addToScene?: boolean): Phaser.GameObjects.Graphics; + + /** + * Creates a new Group Game Object and returns it. + * + * Note: This method will only be available if the Group Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + */ + group(config: Phaser.Types.GameObjects.Group.GroupConfig | Phaser.Types.GameObjects.Group.GroupCreateConfig): Phaser.GameObjects.Group; + + /** + * Creates a new Image Game Object and returns it. + * + * Note: This method will only be available if the Image Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + image(config: Phaser.Types.GameObjects.Sprite.SpriteConfig, addToScene?: boolean): Phaser.GameObjects.Image; + + /** + * Creates a new Layer Game Object and returns it. + * + * Note: This method will only be available if the Layer Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + layer(config: Phaser.Types.GameObjects.Sprite.SpriteConfig, addToScene?: boolean): Phaser.GameObjects.Layer; + + /** + * Creates a new Mesh Game Object and returns it. + * + * Note: This method will only be available if the Mesh Game Object and WebGL support have been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + mesh(config: Phaser.Types.GameObjects.Mesh.MeshConfig, addToScene?: boolean): Phaser.GameObjects.Mesh; + + /** + * Creates a new Particle Emitter Manager Game Object and returns it. + * + * Note: This method will only be available if the Particles Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + particles(config: Phaser.Types.GameObjects.Particles.ParticleEmitterManagerConfig, addToScene?: boolean): Phaser.GameObjects.Particles.ParticleEmitterManager; + + /** + * Creates a new Point Light Game Object and returns it. + * + * Note: This method will only be available if the Point Light Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + pointlight(config: object, addToScene?: boolean): Phaser.GameObjects.PointLight; + + /** + * Creates a new Render Texture Game Object and returns it. + * + * Note: This method will only be available if the Render Texture Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + renderTexture(config: Phaser.Types.GameObjects.RenderTexture.RenderTextureConfig, addToScene?: boolean): Phaser.GameObjects.RenderTexture; + + /** + * Creates a new Rope Game Object and returns it. + * + * Note: This method will only be available if the Rope Game Object and WebGL support have been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + rope(config: Phaser.Types.GameObjects.Rope.RopeConfig, addToScene?: boolean): Phaser.GameObjects.Rope; + + /** + * Creates a new Shader Game Object and returns it. + * + * Note: This method will only be available if the Shader Game Object and WebGL support have been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + shader(config: Phaser.Types.GameObjects.Shader.ShaderConfig, addToScene?: boolean): Phaser.GameObjects.Shader; + + /** + * Creates a new Sprite Game Object and returns it. + * + * Note: This method will only be available if the Sprite Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + sprite(config: Phaser.Types.GameObjects.Sprite.SpriteConfig, addToScene?: boolean): Phaser.GameObjects.Sprite; + + /** + * Creates a new Text Game Object and returns it. + * + * Note: This method will only be available if the Text Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + text(config: Phaser.Types.GameObjects.Text.TextConfig, addToScene?: boolean): Phaser.GameObjects.Text; + + /** + * Creates a new TileSprite Game Object and returns it. + * + * Note: This method will only be available if the TileSprite Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + tileSprite(config: Phaser.Types.GameObjects.TileSprite.TileSpriteConfig, addToScene?: boolean): Phaser.GameObjects.TileSprite; + + /** + * Creates a new Video Game Object and returns it. + * + * Note: This method will only be available if the Video Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + video(config: Phaser.Types.GameObjects.Video.VideoConfig, addToScene?: boolean): Phaser.GameObjects.Video; + + /** + * Creates a new Zone Game Object and returns it. + * + * Note: This method will only be available if the Zone Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + */ + zone(config: Phaser.Types.GameObjects.Zone.ZoneConfig): Phaser.GameObjects.Zone; + + /** + * Creates a Tilemap from the given key or data, or creates a blank Tilemap if no key/data provided. + * When loading from CSV or a 2D array, you should specify the tileWidth & tileHeight. When parsing + * from a map from Tiled, the tileWidth, tileHeight, width & height will be pulled from the map + * data. For an empty map, you should specify tileWidth, tileHeight, width & height. + * @param config The config options for the Tilemap. + */ + tilemap(config?: Phaser.Types.Tilemaps.TilemapConfig): Phaser.Tilemaps.Tilemap; + + /** + * Creates a new Tween object and returns it. + * + * Note: This method will only be available if Tweens have been built into Phaser. + * @param config The Tween configuration. + */ + tween(config: Phaser.Types.Tweens.TweenBuilderConfig | object): Phaser.Tweens.Tween; + + /** + * Creates a new TweenChain object and returns it, without adding it to the Tween Manager. + * + * Note: This method will only be available if Tweens have been built into Phaser. + * @param config The TweenChain configuration. + */ + tweenchain(config: Phaser.Types.Tweens.TweenBuilderConfig | object): Phaser.Tweens.TweenChain; + + } + + /** + * The Game Object Factory is a Scene plugin that allows you to quickly create many common + * types of Game Objects and have them automatically registered with the Scene. + * + * Game Objects directly register themselves with the Factory and inject their own creation + * methods into the class. + */ + class GameObjectFactory { + /** + * + * @param scene The Scene to which this Game Object Factory belongs. + */ + constructor(scene: Phaser.Scene); + + /** + * Creates a new Path Object. + * @param x The horizontal position of this Path. + * @param y The vertical position of this Path. + */ + path(x: number, y: number): Phaser.Curves.Path; + + /** + * The Scene to which this Game Object Factory belongs. + */ + protected scene: Phaser.Scene; + + /** + * A reference to the Scene.Systems. + */ + protected systems: Phaser.Scenes.Systems; + + /** + * A reference to the Scene Event Emitter. + */ + protected events: Phaser.Events.EventEmitter; + + /** + * A reference to the Scene Display List. + */ + protected displayList: Phaser.GameObjects.DisplayList; + + /** + * A reference to the Scene Update List. + */ + protected updateList: Phaser.GameObjects.UpdateList; + + /** + * Adds an existing Game Object to this Scene. + * + * If the Game Object renders, it will be added to the Display List. + * If it has a `preUpdate` method, it will be added to the Update List. + * @param child The child to be added to this Scene. + */ + existing(child: G): G; + + /** + * Static method called directly by the Game Object factory functions. + * With this method you can register a custom GameObject factory in the GameObjectFactory, + * providing a name (`factoryType`) and the constructor (`factoryFunction`) in order + * to be called when you call to Phaser.Scene.add[ factoryType ] method. + * @param factoryType The key of the factory that you will use to call to Phaser.Scene.add[ factoryType ] method. + * @param factoryFunction The constructor function to be called when you invoke to the Phaser.Scene.add method. + */ + static register(factoryType: string, factoryFunction: Function): void; + + /** + * Static method called directly by the Game Object factory functions. + * With this method you can remove a custom GameObject factory registered in the GameObjectFactory, + * providing a its `factoryType`. + * @param factoryType The key of the factory that you want to remove from the GameObjectFactory. + */ + static remove(factoryType: string): void; + + /** + * Creates a new Dynamic Bitmap Text Game Object and adds it to the Scene. + * + * BitmapText objects work by taking a texture file and an XML or JSON file that describes the font structure. + * + * During rendering for each letter of the text is rendered to the display, proportionally spaced out and aligned to + * match the font structure. + * + * Dynamic Bitmap Text objects are different from Static Bitmap Text in that they invoke a callback for each + * letter being rendered during the render pass. This callback allows you to manipulate the properties of + * each letter being rendered, such as its position, scale or tint, allowing you to create interesting effects + * like jiggling text, which can't be done with Static text. This means that Dynamic Text takes more processing + * time, so only use them if you require the callback ability they have. + * + * BitmapText objects are less flexible than Text objects, in that they have less features such as shadows, fills and the ability + * to use Web Fonts, however you trade this flexibility for rendering speed. You can also create visually compelling BitmapTexts by + * processing the font texture in an image editor, applying fills and any other effects required. + * + * To create multi-line text insert \r, \n or \r\n escape codes into the text string. + * + * To create a BitmapText data files you need a 3rd party app such as: + * + * BMFont (Windows, free): http://www.angelcode.com/products/bmfont/ + * Glyph Designer (OS X, commercial): http://www.71squared.com/en/glyphdesigner + * Littera (Web-based, free): http://kvazars.com/littera/ + * + * For most use cases it is recommended to use XML. If you wish to use JSON, the formatting should be equal to the result of + * converting a valid XML file through the popular X2JS library. An online tool for conversion can be found here: http://codebeautify.org/xmltojson + * + * Note: This method will only be available if the Dynamic Bitmap Text Game Object has been built into Phaser. + * @param x The x position of the Game Object. + * @param y The y position of the Game Object. + * @param font The key of the font to use from the BitmapFont cache. + * @param text The string, or array of strings, to be set as the content of this Bitmap Text. + * @param size The font size to set. + */ + dynamicBitmapText(x: number, y: number, font: string, text?: string | string[], size?: number): Phaser.GameObjects.DynamicBitmapText; + + /** + * Creates a new Bitmap Text Game Object and adds it to the Scene. + * + * BitmapText objects work by taking a texture file and an XML or JSON file that describes the font structure. + * + * During rendering for each letter of the text is rendered to the display, proportionally spaced out and aligned to + * match the font structure. + * + * BitmapText objects are less flexible than Text objects, in that they have less features such as shadows, fills and the ability + * to use Web Fonts, however you trade this flexibility for rendering speed. You can also create visually compelling BitmapTexts by + * processing the font texture in an image editor, applying fills and any other effects required. + * + * To create multi-line text insert \r, \n or \r\n escape codes into the text string. + * + * To create a BitmapText data files you need a 3rd party app such as: + * + * BMFont (Windows, free): http://www.angelcode.com/products/bmfont/ + * Glyph Designer (OS X, commercial): http://www.71squared.com/en/glyphdesigner + * Littera (Web-based, free): http://kvazars.com/littera/ + * + * For most use cases it is recommended to use XML. If you wish to use JSON, the formatting should be equal to the result of + * converting a valid XML file through the popular X2JS library. An online tool for conversion can be found here: http://codebeautify.org/xmltojson + * + * Note: This method will only be available if the Bitmap Text Game Object has been built into Phaser. + * @param x The x position of the Game Object. + * @param y The y position of the Game Object. + * @param font The key of the font to use from the BitmapFont cache. + * @param text The string, or array of strings, to be set as the content of this Bitmap Text. + * @param size The font size to set. + * @param align The alignment of the text in a multi-line BitmapText object. Default 0. + */ + bitmapText(x: number, y: number, font: string, text?: string | string[], size?: number, align?: number): Phaser.GameObjects.BitmapText; + + /** + * Creates a new Blitter Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Blitter Game Object has been built into Phaser. + * @param x The x position of the Game Object. + * @param y The y position of the Game Object. + * @param key The key of the Texture the Blitter object will use. + * @param frame The default Frame children of the Blitter will use. + */ + blitter(x: number, y: number, key: string, frame?: string | number): Phaser.GameObjects.Blitter; + + /** + * Creates a new Container Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Container Game Object has been built into Phaser. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param children An optional array of Game Objects to add to this Container. + */ + container(x?: number, y?: number, children?: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[]): Phaser.GameObjects.Container; + + /** + * DOM Element Game Objects are a way to control and manipulate HTML Elements over the top of your game. + * + * In order for DOM Elements to display you have to enable them by adding the following to your game + * configuration object: + * + * ```javascript + * dom { + * createContainer: true + * } + * ``` + * + * When this is added, Phaser will automatically create a DOM Container div that is positioned over the top + * of the game canvas. This div is sized to match the canvas, and if the canvas size changes, as a result of + * settings within the Scale Manager, the dom container is resized accordingly. + * + * You can create a DOM Element by either passing in DOMStrings, or by passing in a reference to an existing + * Element that you wish to be placed under the control of Phaser. For example: + * + * ```javascript + * this.add.dom(x, y, 'div', 'background-color: lime; width: 220px; height: 100px; font: 48px Arial', 'Phaser'); + * ``` + * + * The above code will insert a div element into the DOM Container at the given x/y coordinate. The DOMString in + * the 4th argument sets the initial CSS style of the div and the final argument is the inner text. In this case, + * it will create a lime colored div that is 220px by 100px in size with the text Phaser in it, in an Arial font. + * + * You should nearly always, without exception, use explicitly sized HTML Elements, in order to fully control + * alignment and positioning of the elements next to regular game content. + * + * Rather than specify the CSS and HTML directly you can use the `load.html` File Loader to load it into the + * cache and then use the `createFromCache` method instead. You can also use `createFromHTML` and various other + * methods available in this class to help construct your elements. + * + * Once the element has been created you can then control it like you would any other Game Object. You can set its + * position, scale, rotation, alpha and other properties. It will move as the main Scene Camera moves and be clipped + * at the edge of the canvas. It's important to remember some limitations of DOM Elements: The obvious one is that + * they appear above or below your game canvas. You cannot blend them into the display list, meaning you cannot have + * a DOM Element, then a Sprite, then another DOM Element behind it. + * + * They also cannot be enabled for input. To do that, you have to use the `addListener` method to add native event + * listeners directly. The final limitation is to do with cameras. The DOM Container is sized to match the game canvas + * entirely and clipped accordingly. DOM Elements respect camera scrolling and scrollFactor settings, but if you + * change the size of the camera so it no longer matches the size of the canvas, they won't be clipped accordingly. + * + * Also, all DOM Elements are inserted into the same DOM Container, regardless of which Scene they are created in. + * + * DOM Elements are a powerful way to align native HTML with your Phaser Game Objects. For example, you can insert + * a login form for a multiplayer game directly into your title screen. Or a text input box for a highscore table. + * Or a banner ad from a 3rd party service. Or perhaps you'd like to use them for high resolution text display and + * UI. The choice is up to you, just remember that you're dealing with standard HTML and CSS floating over the top + * of your game, and should treat it accordingly. + * + * Note: This method will only be available if the DOM Element Game Object has been built into Phaser. + * @param x The horizontal position of this DOM Element in the world. + * @param y The vertical position of this DOM Element in the world. + * @param element An existing DOM element, or a string. If a string starting with a # it will do a `getElementById` look-up on the string (minus the hash). Without a hash, it represents the type of element to create, i.e. 'div'. + * @param style If a string, will be set directly as the elements `style` property value. If a plain object, will be iterated and the values transferred. In both cases the values replacing whatever CSS styles may have been previously set. + * @param innerText If given, will be set directly as the elements `innerText` property value, replacing whatever was there before. + */ + dom(x: number, y: number, element?: HTMLElement | string, style?: string | any, innerText?: string): Phaser.GameObjects.DOMElement; + + /** + * Creates a new Extern Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Extern Game Object has been built into Phaser. + */ + extern(): Phaser.GameObjects.Extern; + + /** + * Creates a new Graphics Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Graphics Game Object has been built into Phaser. + * @param config The Graphics configuration. + */ + graphics(config?: Phaser.Types.GameObjects.Graphics.Options): Phaser.GameObjects.Graphics; + + /** + * Creates a new Group Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Group Game Object has been built into Phaser. + * @param children Game Objects to add to this Group; or the `config` argument. + * @param config A Group Configuration object. + */ + group(children?: Phaser.GameObjects.GameObject[] | Phaser.Types.GameObjects.Group.GroupConfig | Phaser.Types.GameObjects.Group.GroupConfig[] | Phaser.Types.GameObjects.Group.GroupCreateConfig, config?: Phaser.Types.GameObjects.Group.GroupConfig | Phaser.Types.GameObjects.Group.GroupCreateConfig): Phaser.GameObjects.Group; + + /** + * Creates a new Image Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Image Game Object has been built into Phaser. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + image(x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | number): Phaser.GameObjects.Image; + + /** + * Creates a new Layer Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Layer Game Object has been built into Phaser. + * @param children An optional array of Game Objects to add to this Layer. + */ + layer(children?: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[]): Phaser.GameObjects.Layer; + + /** + * Creates a new Mesh Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Mesh Game Object and WebGL support have been built into Phaser. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + * @param vertices The vertices array. Either `xy` pairs, or `xyz` if the `containsZ` parameter is `true`. + * @param uvs The UVs pairs array. + * @param indicies Optional vertex indicies array. If you don't have one, pass `null` or an empty array. + * @param containsZ Does the vertices data include a `z` component? Default false. + * @param normals Optional vertex normals array. If you don't have one, pass `null` or an empty array. + * @param colors An array of colors, one per vertex, or a single color value applied to all vertices. Default 0xffffff. + * @param alphas An array of alpha values, one per vertex, or a single alpha value applied to all vertices. Default 1. + */ + mesh(x?: number, y?: number, texture?: string | Phaser.Textures.Texture, frame?: string | number, vertices?: number[], uvs?: number[], indicies?: number[], containsZ?: boolean, normals?: number[], colors?: number | number[], alphas?: number | number[]): Phaser.GameObjects.Mesh; + + /** + * Creates a new Particle Emitter Manager Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Particles Game Object has been built into Phaser. + * @param texture The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + * @param emitters Configuration settings for one or more emitters to create. + */ + particles(texture: string | Phaser.Textures.Texture, frame?: string | number | object, emitters?: Phaser.Types.GameObjects.Particles.ParticleEmitterConfig | Phaser.Types.GameObjects.Particles.ParticleEmitterConfig[]): Phaser.GameObjects.Particles.ParticleEmitterManager; + + /** + * Creates a new PathFollower Game Object and adds it to the Scene. + * + * Note: This method will only be available if the PathFollower Game Object has been built into Phaser. + * @param path The Path this PathFollower is connected to. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + follower(path: Phaser.Curves.Path, x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | number): Phaser.GameObjects.PathFollower; + + /** + * Creates a new Point Light Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Point Light Game Object has been built into Phaser. + * + * The Point Light Game Object provides a way to add a point light effect into your game, + * without the expensive shader processing requirements of the traditional Light Game Object. + * + * The difference is that the Point Light renders using a custom shader, designed to give the + * impression of a point light source, of variable radius, intensity and color, in your game. + * However, unlike the Light Game Object, it does not impact any other Game Objects, or use their + * normal maps for calcuations. This makes them extremely fast to render compared to Lights + * and perfect for special effects, such as flickering torches or muzzle flashes. + * + * For maximum performance you should batch Point Light Game Objects together. This means + * ensuring they follow each other consecutively on the display list. Ideally, use a Layer + * Game Object and then add just Point Lights to it, so that it can batch together the rendering + * of the lights. You don't _have_ to do this, and if you've only a handful of Point Lights in + * your game then it's perfectly safe to mix them into the dislay list as normal. However, if + * you're using a large number of them, please consider how they are mixed into the display list. + * + * The renderer will automatically cull Point Lights. Those with a radius that does not intersect + * with the Camera will be skipped in the rendering list. This happens automatically and the + * culled state is refreshed every frame, for every camera. + * + * The origin of a Point Light is always 0.5 and it cannot be changed. + * + * Point Lights are a WebGL only feature and do not have a Canvas counterpart. + * @param x The horizontal position of this Point Light in the world. + * @param y The vertical position of this Point Light in the world. + * @param color The color of the Point Light, given as a hex value. Default 0xffffff. + * @param radius The radius of the Point Light. Default 128. + * @param intensity The intensity, or color blend, of the Point Light. Default 1. + * @param attenuation The attenuation of the Point Light. This is the reduction of light from the center point. Default 0.1. + */ + pointlight(x: number, y: number, color?: number, radius?: number, intensity?: number, attenuation?: number): Phaser.GameObjects.PointLight; + + /** + * Creates a new Render Texture Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Render Texture Game Object has been built into Phaser. + * + * A Render Texture is a special texture that allows any number of Game Objects to be drawn to it. You can take many complex objects and + * draw them all to this one texture, which can they be used as the texture for other Game Object's. It's a way to generate dynamic + * textures at run-time that are WebGL friendly and don't invoke expensive GPU uploads. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param width The width of the Render Texture. Default 32. + * @param height The height of the Render Texture. Default 32. + */ + renderTexture(x: number, y: number, width?: number, height?: number): Phaser.GameObjects.RenderTexture; + + /** + * Creates a new Rope Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Rope Game Object and WebGL support have been built into Phaser. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + * @param points An array containing the vertices data for this Rope. If none is provided a simple quad is created. See `setPoints` to set this post-creation. + * @param horizontal Should the vertices of this Rope be aligned horizontally (`true`), or vertically (`false`)? Default true. + * @param colors An optional array containing the color data for this Rope. You should provide one color value per pair of vertices. + * @param alphas An optional array containing the alpha data for this Rope. You should provide one alpha value per pair of vertices. + */ + rope(x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | number, points?: Phaser.Types.Math.Vector2Like[], horizontal?: boolean, colors?: number[], alphas?: number[]): Phaser.GameObjects.Rope; + + /** + * Creates a new Shader Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Shader Game Object and WebGL support have been built into Phaser. + * @param key The key of the shader to use from the shader cache, or a BaseShader instance. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param width The width of the Game Object. Default 128. + * @param height The height of the Game Object. Default 128. + * @param textures Optional array of texture keys to bind to the iChannel0...3 uniforms. The textures must already exist in the Texture Manager. + * @param textureData Optional additional texture data. + */ + shader(key: string | Phaser.Display.BaseShader, x?: number, y?: number, width?: number, height?: number, textures?: string[], textureData?: object): Phaser.GameObjects.Shader; + + /** + * Creates a new Arc Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Arc Game Object has been built into Phaser. + * + * The Arc Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * When it renders it displays an arc shape. You can control the start and end angles of the arc, + * as well as if the angles are winding clockwise or anti-clockwise. With the default settings + * it renders as a complete circle. By changing the angles you can create other arc shapes, + * such as half-circles. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param radius The radius of the arc. Default 128. + * @param startAngle The start angle of the arc, in degrees. Default 0. + * @param endAngle The end angle of the arc, in degrees. Default 360. + * @param anticlockwise The winding order of the start and end angles. Default false. + * @param fillColor The color the arc will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the arc will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + arc(x?: number, y?: number, radius?: number, startAngle?: number, endAngle?: number, anticlockwise?: boolean, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Arc; + + /** + * Creates a new Circle Shape Game Object and adds it to the Scene. + * + * A Circle is an Arc with no defined start and end angle, making it render as a complete circle. + * + * Note: This method will only be available if the Arc Game Object has been built into Phaser. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param radius The radius of the circle. Default 128. + * @param fillColor The color the circle will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the circle will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + circle(x?: number, y?: number, radius?: number, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Arc; + + /** + * Creates a new Curve Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Curve Game Object has been built into Phaser. + * + * The Curve Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * To render a Curve Shape you must first create a `Phaser.Curves.Curve` object, then pass it to + * the Curve Shape in the constructor. + * + * The Curve shape also has a `smoothness` property and corresponding `setSmoothness` method. + * This allows you to control how smooth the shape renders in WebGL, by controlling the number of iterations + * that take place during construction. Increase and decrease the default value for smoother, or more + * jagged, shapes. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param curve The Curve object to use to create the Shape. + * @param fillColor The color the curve will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the curve will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + curve(x?: number, y?: number, curve?: Phaser.Curves.Curve, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Curve; + + /** + * Creates a new Ellipse Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Ellipse Game Object has been built into Phaser. + * + * The Ellipse Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * When it renders it displays an ellipse shape. You can control the width and height of the ellipse. + * If the width and height match it will render as a circle. If the width is less than the height, + * it will look more like an egg shape. + * + * The Ellipse shape also has a `smoothness` property and corresponding `setSmoothness` method. + * This allows you to control how smooth the shape renders in WebGL, by controlling the number of iterations + * that take place during construction. Increase and decrease the default value for smoother, or more + * jagged, shapes. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param width The width of the ellipse. An ellipse with equal width and height renders as a circle. Default 128. + * @param height The height of the ellipse. An ellipse with equal width and height renders as a circle. Default 128. + * @param fillColor The color the ellipse will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the ellipse will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + ellipse(x?: number, y?: number, width?: number, height?: number, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Ellipse; + + /** + * Creates a new Grid Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Grid Game Object has been built into Phaser. + * + * The Grid Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports only fill colors and cannot be stroked. + * + * A Grid Shape allows you to display a grid in your game, where you can control the size of the + * grid as well as the width and height of the grid cells. You can set a fill color for each grid + * cell as well as an alternate fill color. When the alternate fill color is set then the grid + * cells will alternate the fill colors as they render, creating a chess-board effect. You can + * also optionally have an outline fill color. If set, this draws lines between the grid cells + * in the given color. If you specify an outline color with an alpha of zero, then it will draw + * the cells spaced out, but without the lines between them. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param width The width of the grid. Default 128. + * @param height The height of the grid. Default 128. + * @param cellWidth The width of one cell in the grid. Default 32. + * @param cellHeight The height of one cell in the grid. Default 32. + * @param fillColor The color the grid cells will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the grid cells will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + * @param outlineFillColor The color of the lines between the grid cells. + * @param outlineFillAlpha The alpha of the lines between the grid cells. + */ + grid(x?: number, y?: number, width?: number, height?: number, cellWidth?: number, cellHeight?: number, fillColor?: number, fillAlpha?: number, outlineFillColor?: number, outlineFillAlpha?: number): Phaser.GameObjects.Grid; + + /** + * Creates a new IsoBox Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the IsoBox Game Object has been built into Phaser. + * + * The IsoBox Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports only fill colors and cannot be stroked. + * + * An IsoBox is an 'isometric' rectangle. Each face of it has a different fill color. You can set + * the color of the top, left and right faces of the rectangle respectively. You can also choose + * which of the faces are rendered via the `showTop`, `showLeft` and `showRight` properties. + * + * You cannot view an IsoBox from under-neath, however you can change the 'angle' by setting + * the `projection` property. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param size The width of the iso box in pixels. The left and right faces will be exactly half this value. Default 48. + * @param height The height of the iso box. The left and right faces will be this tall. The overall height of the isobox will be this value plus half the `size` value. Default 32. + * @param fillTop The fill color of the top face of the iso box. Default 0xeeeeee. + * @param fillLeft The fill color of the left face of the iso box. Default 0x999999. + * @param fillRight The fill color of the right face of the iso box. Default 0xcccccc. + */ + isobox(x?: number, y?: number, size?: number, height?: number, fillTop?: number, fillLeft?: number, fillRight?: number): Phaser.GameObjects.IsoBox; + + /** + * Creates a new IsoTriangle Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the IsoTriangle Game Object has been built into Phaser. + * + * The IsoTriangle Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports only fill colors and cannot be stroked. + * + * An IsoTriangle is an 'isometric' triangle. Think of it like a pyramid. Each face has a different + * fill color. You can set the color of the top, left and right faces of the triangle respectively + * You can also choose which of the faces are rendered via the `showTop`, `showLeft` and `showRight` properties. + * + * You cannot view an IsoTriangle from under-neath, however you can change the 'angle' by setting + * the `projection` property. The `reversed` property controls if the IsoTriangle is rendered upside + * down or not. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param size The width of the iso triangle in pixels. The left and right faces will be exactly half this value. Default 48. + * @param height The height of the iso triangle. The left and right faces will be this tall. The overall height of the iso triangle will be this value plus half the `size` value. Default 32. + * @param reversed Is the iso triangle upside down? Default false. + * @param fillTop The fill color of the top face of the iso triangle. Default 0xeeeeee. + * @param fillLeft The fill color of the left face of the iso triangle. Default 0x999999. + * @param fillRight The fill color of the right face of the iso triangle. Default 0xcccccc. + */ + isotriangle(x?: number, y?: number, size?: number, height?: number, reversed?: boolean, fillTop?: number, fillLeft?: number, fillRight?: number): Phaser.GameObjects.IsoTriangle; + + /** + * Creates a new Line Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Line Game Object has been built into Phaser. + * + * The Line Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports only stroke colors and cannot be filled. + * + * A Line Shape allows you to draw a line between two points in your game. You can control the + * stroke color and thickness of the line. In WebGL only you can also specify a different + * thickness for the start and end of the line, allowing you to render lines that taper-off. + * + * If you need to draw multiple lines in a sequence you may wish to use the Polygon Shape instead. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param x1 The horizontal position of the start of the line. Default 0. + * @param y1 The vertical position of the start of the line. Default 0. + * @param x2 The horizontal position of the end of the line. Default 128. + * @param y2 The vertical position of the end of the line. Default 0. + * @param strokeColor The color the line will be drawn in, i.e. 0xff0000 for red. + * @param strokeAlpha The alpha the line will be drawn in. You can also set the alpha of the overall Shape using its `alpha` property. + */ + line(x?: number, y?: number, x1?: number, y1?: number, x2?: number, y2?: number, strokeColor?: number, strokeAlpha?: number): Phaser.GameObjects.Line; + + /** + * Creates a new Polygon Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Polygon Game Object has been built into Phaser. + * + * The Polygon Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * The Polygon Shape is created by providing a list of points, which are then used to create an + * internal Polygon geometry object. The points can be set from a variety of formats: + * + * - An array of Point or Vector2 objects: `[new Phaser.Math.Vector2(x1, y1), ...]` + * - An array of objects with public x/y properties: `[obj1, obj2, ...]` + * - An array of paired numbers that represent point coordinates: `[x1,y1, x2,y2, ...]` + * - An array of arrays with two elements representing x/y coordinates: `[[x1, y1], [x2, y2], ...]` + * + * By default the `x` and `y` coordinates of this Shape refer to the center of it. However, depending + * on the coordinates of the points provided, the final shape may be rendered offset from its origin. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param points The points that make up the polygon. + * @param fillColor The color the polygon will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the polygon will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + polygon(x?: number, y?: number, points?: any, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Polygon; + + /** + * Creates a new Rectangle Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Rectangle Game Object has been built into Phaser. + * + * The Rectangle Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * You can change the size of the rectangle by changing the `width` and `height` properties. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param width The width of the rectangle. Default 128. + * @param height The height of the rectangle. Default 128. + * @param fillColor The color the rectangle will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the rectangle will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + rectangle(x?: number, y?: number, width?: number, height?: number, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Rectangle; + + /** + * Creates a new Star Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Star Game Object has been built into Phaser. + * + * The Star Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * As the name implies, the Star shape will display a star in your game. You can control several + * aspects of it including the number of points that constitute the star. The default is 5. If + * you change it to 4 it will render as a diamond. If you increase them, you'll get a more spiky + * star shape. + * + * You can also control the inner and outer radius, which is how 'long' each point of the star is. + * Modify these values to create more interesting shapes. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param points The number of points on the star. Default 5. + * @param innerRadius The inner radius of the star. Default 32. + * @param outerRadius The outer radius of the star. Default 64. + * @param fillColor The color the star will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the star will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + star(x?: number, y?: number, points?: number, innerRadius?: number, outerRadius?: number, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Star; + + /** + * Creates a new Triangle Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Triangle Game Object has been built into Phaser. + * + * The Triangle Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * The Triangle consists of 3 lines, joining up to form a triangular shape. You can control the + * position of each point of these lines. The triangle is always closed and cannot have an open + * face. If you require that, consider using a Polygon instead. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param x1 The horizontal position of the first point in the triangle. Default 0. + * @param y1 The vertical position of the first point in the triangle. Default 128. + * @param x2 The horizontal position of the second point in the triangle. Default 64. + * @param y2 The vertical position of the second point in the triangle. Default 0. + * @param x3 The horizontal position of the third point in the triangle. Default 128. + * @param y3 The vertical position of the third point in the triangle. Default 128. + * @param fillColor The color the triangle will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the triangle will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + triangle(x?: number, y?: number, x1?: number, y1?: number, x2?: number, y2?: number, x3?: number, y3?: number, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Triangle; + + /** + * Creates a new Sprite Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Sprite Game Object has been built into Phaser. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + sprite(x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | number): Phaser.GameObjects.Sprite; + + /** + * Creates a new Text Game Object and adds it to the Scene. + * + * A Text Game Object. + * + * Text objects work by creating their own internal hidden Canvas and then renders text to it using + * the standard Canvas `fillText` API. It then creates a texture from this canvas which is rendered + * to your game during the render pass. + * + * Because it uses the Canvas API you can take advantage of all the features this offers, such as + * applying gradient fills to the text, or strokes, shadows and more. You can also use custom fonts + * loaded externally, such as Google or TypeKit Web fonts. + * + * You can only display fonts that are currently loaded and available to the browser: therefore fonts must + * be pre-loaded. Phaser does not do ths for you, so you will require the use of a 3rd party font loader, + * or have the fonts ready available in the CSS on the page in which your Phaser game resides. + * + * See {@link http://www.jordanm.co.uk/tinytype this compatibility table} for the available default fonts + * across mobile browsers. + * + * A note on performance: Every time the contents of a Text object changes, i.e. changing the text being + * displayed, or the style of the text, it needs to remake the Text canvas, and if on WebGL, re-upload the + * new texture to the GPU. This can be an expensive operation if used often, or with large quantities of + * Text objects in your game. If you run into performance issues you would be better off using Bitmap Text + * instead, as it benefits from batching and avoids expensive Canvas API calls. + * + * Note: This method will only be available if the Text Game Object has been built into Phaser. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param text The text this Text object will display. + * @param style The Text style configuration object. + */ + text(x: number, y: number, text: string | string[], style?: Phaser.Types.GameObjects.Text.TextStyle): Phaser.GameObjects.Text; + + /** + * Creates a new TileSprite Game Object and adds it to the Scene. + * + * Note: This method will only be available if the TileSprite Game Object has been built into Phaser. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param width The width of the Game Object. If zero it will use the size of the texture frame. + * @param height The height of the Game Object. If zero it will use the size of the texture frame. + * @param texture The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + tileSprite(x: number, y: number, width: number, height: number, texture: string | Phaser.Textures.Texture, frame?: string | number): Phaser.GameObjects.TileSprite; + + /** + * Creates a new Video Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Video Game Object has been built into Phaser. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param key Optional key of the Video this Game Object will play, as stored in the Video Cache. + */ + video(x: number, y: number, key?: string): Phaser.GameObjects.Video; + + /** + * Creates a new Zone Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Zone Game Object has been built into Phaser. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param width The width of the Game Object. + * @param height The height of the Game Object. + */ + zone(x: number, y: number, width: number, height: number): Phaser.GameObjects.Zone; + + /** + * Creates a Tilemap from the given key or data, or creates a blank Tilemap if no key/data provided. + * When loading from CSV or a 2D array, you should specify the tileWidth & tileHeight. When parsing + * from a map from Tiled, the tileWidth, tileHeight, width & height will be pulled from the map + * data. For an empty map, you should specify tileWidth, tileHeight, width & height. + * @param key The key in the Phaser cache that corresponds to the loaded tilemap data. + * @param tileWidth The width of a tile in pixels. Pass in `null` to leave as the + * default. Default 32. + * @param tileHeight The height of a tile in pixels. Pass in `null` to leave as the + * default. Default 32. + * @param width The width of the map in tiles. Pass in `null` to leave as the + * default. Default 10. + * @param height The height of the map in tiles. Pass in `null` to leave as the + * default. Default 10. + * @param data Instead of loading from the cache, you can also load directly from + * a 2D array of tile indexes. Pass in `null` for no data. + * @param insertNull Controls how empty tiles, tiles with an index of -1, in the + * map data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty + * location will get a Tile object with an index of -1. If you've a large sparsely populated map and + * the tile data doesn't need to change then setting this value to `true` will help with memory + * consumption. However if your map is small or you need to update the tiles dynamically, then leave + * the default value set. Default false. + */ + tilemap(key?: string, tileWidth?: number, tileHeight?: number, width?: number, height?: number, data?: number[][], insertNull?: boolean): Phaser.Tilemaps.Tilemap; + + /** + * Creates a new Tween object. + * + * Note: This method will only be available if Tweens have been built into Phaser. + * @param config The Tween configuration. + */ + tween(config: Phaser.Types.Tweens.TweenBuilderConfig | object): Phaser.Tweens.Tween; + + /** + * Creates a new TweenChain object and adds it to the Tween Manager. + * + * Note: This method will only be available if Tweens have been built into Phaser. + * @param config The TweenChain configuration. + */ + tweenchain(config: Phaser.Types.Tweens.TweenBuilderConfig | object): Phaser.Tweens.TweenChain; + + } + + /** + * Calculates the Transform Matrix of the given Game Object and Camera, factoring in + * the parent matrix if provided. + * + * Note that the object this results contains _references_ to the Transform Matrices, + * not new instances of them. Therefore, you should use their values immediately, or + * copy them to your own matrix, as they will be replaced as soon as another Game + * Object is rendered. + * @param src The Game Object to calculate the transform matrix for. + * @param camera The camera being used to render the Game Object. + * @param parentMatrix The transform matrix of the parent container, if any. + */ + function GetCalcMatrix(src: Phaser.GameObjects.GameObject, camera: Phaser.Cameras.Scene2D.Camera, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.Types.GameObjects.GetCalcMatrixResults; + + /** + * The Update List plugin. + * + * Update Lists belong to a Scene and maintain the list Game Objects to be updated every frame. + * + * Some or all of these Game Objects may also be part of the Scene's [Display List]{@link Phaser.GameObjects.DisplayList}, for Rendering. + */ + class UpdateList extends Phaser.Structs.ProcessQueue { + /** + * + * @param scene The Scene that the Update List belongs to. + */ + constructor(scene: Phaser.Scene); + + /** + * The Scene that the Update List belongs to. + */ + scene: Phaser.Scene; + + /** + * The Scene's Systems. + */ + systems: Phaser.Scenes.Systems; + + /** + * The update step. + * + * Pre-updates every active Game Object in the list. + * @param time The current timestamp. + * @param delta The delta time elapsed since the last frame. + */ + sceneUpdate(time: number, delta: number): void; + + /** + * The Scene that owns this plugin is shutting down. + * + * We need to kill and reset all internal properties as well as stop listening to Scene events. + */ + shutdown(): void; + + /** + * The Scene that owns this plugin is being destroyed. + * + * We need to shutdown and then kill off all external references. + */ + destroy(): void; + + } + + namespace RetroFont { + /** + * Parses a Retro Font configuration object so you can pass it to the BitmapText constructor + * and create a BitmapText object using a fixed-width retro font. + * @param scene A reference to the Phaser Scene. + * @param config The font configuration object. + */ + function Parse(scene: Phaser.Scene, config: Phaser.Types.GameObjects.BitmapText.RetroFontConfig): Phaser.Types.GameObjects.BitmapText.BitmapFontData; + + /** + * Text Set 1 = !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ + */ + var TEXT_SET1: string; + + /** + * Text Set 2 = !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ + */ + var TEXT_SET2: string; + + /** + * Text Set 3 = ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 + */ + var TEXT_SET3: string; + + /** + * Text Set 4 = ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789 + */ + var TEXT_SET4: string; + + /** + * Text Set 5 = ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789 + */ + var TEXT_SET5: string; + + /** + * Text Set 6 = ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789"(),-.' + */ + var TEXT_SET6: string; + + /** + * Text Set 7 = AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW")28FLRX-'39 + */ + var TEXT_SET7: string; + + /** + * Text Set 8 = 0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ + */ + var TEXT_SET8: string; + + /** + * Text Set 9 = ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'"?! + */ + var TEXT_SET9: string; + + /** + * Text Set 10 = ABCDEFGHIJKLMNOPQRSTUVWXYZ + */ + var TEXT_SET10: string; + + /** + * Text Set 11 = ABCDEFGHIJKLMNOPQRSTUVWXYZ.,"-+!?()':;0123456789 + */ + var TEXT_SET11: string; + + } + /** * BitmapText objects work by taking a texture file and an XML or JSON file that describes the font structure. * @@ -10520,72 +12235,6 @@ declare namespace Phaser { } - namespace RetroFont { - /** - * Text Set 1 = !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ - */ - var TEXT_SET1: string; - - /** - * Text Set 2 = !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ - */ - var TEXT_SET2: string; - - /** - * Text Set 3 = ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 - */ - var TEXT_SET3: string; - - /** - * Text Set 4 = ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789 - */ - var TEXT_SET4: string; - - /** - * Text Set 5 = ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789 - */ - var TEXT_SET5: string; - - /** - * Text Set 6 = ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789"(),-.' - */ - var TEXT_SET6: string; - - /** - * Text Set 7 = AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW")28FLRX-'39 - */ - var TEXT_SET7: string; - - /** - * Text Set 8 = 0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ - */ - var TEXT_SET8: string; - - /** - * Text Set 9 = ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'"?! - */ - var TEXT_SET9: string; - - /** - * Text Set 10 = ABCDEFGHIJKLMNOPQRSTUVWXYZ - */ - var TEXT_SET10: string; - - /** - * Text Set 11 = ABCDEFGHIJKLMNOPQRSTUVWXYZ.,"-+!?()':;0123456789 - */ - var TEXT_SET11: string; - - /** - * Parses a Retro Font configuration object so you can pass it to the BitmapText constructor - * and create a BitmapText object using a fixed-width retro font. - * @param scene A reference to the Phaser Scene. - * @param config The font configuration object. - */ - function Parse(scene: Phaser.Scene, config: Phaser.Types.GameObjects.BitmapText.RetroFontConfig): Phaser.Types.GameObjects.BitmapText.BitmapFontData; - - } - /** * BitmapText objects work by taking a texture file and an XML or JSON file that describes the font structure. * @@ -12656,21 +14305,6 @@ declare namespace Phaser { } - /** - * Builds a Game Object using the provided configuration object. - * @param scene A reference to the Scene. - * @param gameObject The initial GameObject. - * @param config The config to build the GameObject with. - */ - function BuildGameObject(scene: Phaser.Scene, gameObject: Phaser.GameObjects.GameObject, config: Phaser.Types.GameObjects.GameObjectConfig): Phaser.GameObjects.GameObject; - - /** - * Adds an Animation component to a Sprite and populates it based on the given config. - * @param sprite The sprite to add an Animation component to. - * @param config The animation config. - */ - function BuildGameObjectAnimation(sprite: Phaser.GameObjects.Sprite, config: object): Phaser.GameObjects.Sprite; - namespace Components { /** * Provides methods used for setting the alpha properties of a Game Object. @@ -12941,6 +14575,52 @@ declare namespace Phaser { setDepth(value: number): this; } + /** + * Provides methods used for setting the FX values of a Game Object. + * Should be applied as a mixin and not used directly. + */ + interface FX { + /** + * The amount of extra padding to be applied to this Game Object + * when it is being rendered by a SpriteFX Pipeline. + * + * Lots of FX require additional spacing added to the texture the + * Game Object uses, for example a glow or shadow effect, and this + * method allows you to control how much extra padding is included + * in addition to the texture size. + */ + fxPadding: number; + /** + * Sets the amount of extra padding to be applied to this Game Object + * when it is being rendered by a SpriteFX Pipeline. + * + * Lots of FX require additional spacing added to the texture the + * Game Object uses, for example a glow or shadow effect, and this + * method allows you to control how much extra padding is included + * in addition to the texture size. + * @param padding The amount of padding to add to the texture. Default 0. + */ + setFXPadding(padding?: number): this; + /** + * This callback is invoked when this Game Object is copied by a SpriteFX Pipeline. + * + * This happens when the pipeline uses its `copySprite` method. + * + * It's invoked prior to the copy, allowing you to set shader uniforms, etc on the pipeline. + * @param pipeline The SpriteFX Pipeline that invoked this callback. + */ + onFXCopy(pipeline: Phaser.Renderer.WebGL.Pipelines.SpriteFXPipeline): void; + /** + * This callback is invoked when this Game Object is rendered by a SpriteFX Pipeline. + * + * This happens when the pipeline uses its `drawSprite` method. + * + * It's invoked prior to the draw, allowing you to set shader uniforms, etc on the pipeline. + * @param pipeline The SpriteFX Pipeline that invoked this callback. + */ + onFX(pipeline: Phaser.Renderer.WebGL.Pipelines.SpriteFXPipeline): void; + } + /** * Provides methods used for visually flipping a Game Object. * Should be applied as a mixin and not used directly. @@ -13004,52 +14684,6 @@ declare namespace Phaser { resetFlip(): this; } - /** - * Provides methods used for setting the FX values of a Game Object. - * Should be applied as a mixin and not used directly. - */ - interface FX { - /** - * The amount of extra padding to be applied to this Game Object - * when it is being rendered by a SpriteFX Pipeline. - * - * Lots of FX require additional spacing added to the texture the - * Game Object uses, for example a glow or shadow effect, and this - * method allows you to control how much extra padding is included - * in addition to the texture size. - */ - fxPadding: number; - /** - * Sets the amount of extra padding to be applied to this Game Object - * when it is being rendered by a SpriteFX Pipeline. - * - * Lots of FX require additional spacing added to the texture the - * Game Object uses, for example a glow or shadow effect, and this - * method allows you to control how much extra padding is included - * in addition to the texture size. - * @param padding The amount of padding to add to the texture. Default 0. - */ - setFXPadding(padding?: number): this; - /** - * This callback is invoked when this Game Object is copied by a SpriteFX Pipeline. - * - * This happens when the pipeline uses its `copySprite` method. - * - * It's invoked prior to the copy, allowing you to set shader uniforms, etc on the pipeline. - * @param pipeline The SpriteFX Pipeline that invoked this callback. - */ - onFXCopy(pipeline: Phaser.Renderer.WebGL.Pipelines.SpriteFXPipeline): void; - /** - * This callback is invoked when this Game Object is rendered by a SpriteFX Pipeline. - * - * This happens when the pipeline uses its `drawSprite` method. - * - * It's invoked prior to the draw, allowing you to set shader uniforms, etc on the pipeline. - * @param pipeline The SpriteFX Pipeline that invoked this callback. - */ - onFX(pipeline: Phaser.Renderer.WebGL.Pipelines.SpriteFXPipeline): void; - } - /** * Provides methods used for obtaining the bounds of a Game Object. * Should be applied as a mixin and not used directly. @@ -15308,65 +16942,6 @@ declare namespace Phaser { } - /** - * The Display List plugin. - * - * Display Lists belong to a Scene and maintain the list of Game Objects to render every frame. - * - * Some of these Game Objects may also be part of the Scene's [Update List]{@link Phaser.GameObjects.UpdateList}, for updating. - */ - class DisplayList extends Phaser.Structs.List { - /** - * - * @param scene The Scene that this Display List belongs to. - */ - constructor(scene: Phaser.Scene); - - /** - * The flag the determines whether Game Objects should be sorted when `depthSort()` is called. - */ - sortChildrenFlag: boolean; - - /** - * The Scene that this Display List belongs to. - */ - scene: Phaser.Scene; - - /** - * The Scene's Systems. - */ - systems: Phaser.Scenes.Systems; - - /** - * The Scene's Event Emitter. - */ - events: Phaser.Events.EventEmitter; - - /** - * Force a sort of the display list on the next call to depthSort. - */ - queueDepthSort(): void; - - /** - * Immediately sorts the display list if the flag is set. - */ - depthSort(): void; - - /** - * Compare the depth of two Game Objects. - * @param childA The first Game Object. - * @param childB The second Game Object. - */ - sortByDepth(childA: Phaser.GameObjects.GameObject, childB: Phaser.GameObjects.GameObject): number; - - /** - * Returns an array which contains all objects currently on the Display List. - * This is a reference to the main list array, not a copy of it, so be careful not to modify it. - */ - getChildren(): Phaser.GameObjects.GameObject[]; - - } - /** * DOM Element Game Objects are a way to control and manipulate HTML Elements over the top of your game. * @@ -17103,1532 +18678,6 @@ declare namespace Phaser { } - /** - * The base class that all Game Objects extend. - * You don't create GameObjects directly and they cannot be added to the display list. - * Instead, use them as the base for your own custom classes. - */ - class GameObject extends Phaser.Events.EventEmitter { - /** - * - * @param scene The Scene to which this Game Object belongs. - * @param type A textual representation of the type of Game Object, i.e. `sprite`. - */ - constructor(scene: Phaser.Scene, type: string); - - /** - * A reference to the Scene to which this Game Object belongs. - * - * Game Objects can only belong to one Scene. - * - * You should consider this property as being read-only. You cannot move a - * Game Object to another Scene by simply changing it. - */ - scene: Phaser.Scene; - - /** - * Holds a reference to the Display List that contains this Game Object. - * - * This is set automatically when this Game Object is added to a Scene or Layer. - * - * You should treat this property as being read-only. - */ - displayList: Phaser.GameObjects.DisplayList | Phaser.GameObjects.Layer; - - /** - * A textual representation of this Game Object, i.e. `sprite`. - * Used internally by Phaser but is available for your own custom classes to populate. - */ - type: string; - - /** - * The current state of this Game Object. - * - * Phaser itself will never modify this value, although plugins may do so. - * - * Use this property to track the state of a Game Object during its lifetime. For example, it could change from - * a state of 'moving', to 'attacking', to 'dead'. The state value should be an integer (ideally mapped to a constant - * in your game code), or a string. These are recommended to keep it light and simple, with fast comparisons. - * If you need to store complex data about your Game Object, look at using the Data Component instead. - */ - state: number | string; - - /** - * The parent Container of this Game Object, if it has one. - */ - parentContainer: Phaser.GameObjects.Container; - - /** - * The name of this Game Object. - * Empty by default and never populated by Phaser, this is left for developers to use. - */ - name: string; - - /** - * The active state of this Game Object. - * A Game Object with an active state of `true` is processed by the Scenes UpdateList, if added to it. - * An active object is one which is having its logic and internal systems updated. - */ - active: boolean; - - /** - * The Tab Index of the Game Object. - * Reserved for future use by plugins and the Input Manager. - */ - tabIndex: number; - - /** - * A Data Manager. - * It allows you to store, query and get key/value paired information specific to this Game Object. - * `null` by default. Automatically created if you use `getData` or `setData` or `setDataEnabled`. - */ - data: Phaser.Data.DataManager; - - /** - * The flags that are compared against `RENDER_MASK` to determine if this Game Object will render or not. - * The bits are 0001 | 0010 | 0100 | 1000 set by the components Visible, Alpha, Transform and Texture respectively. - * If those components are not used by your custom class then you can use this bitmask as you wish. - */ - renderFlags: number; - - /** - * A bitmask that controls if this Game Object is drawn by a Camera or not. - * Not usually set directly, instead call `Camera.ignore`, however you can - * set this property directly using the Camera.id property: - */ - cameraFilter: number; - - /** - * If this Game Object is enabled for input then this property will contain an InteractiveObject instance. - * Not usually set directly. Instead call `GameObject.setInteractive()`. - */ - input: Phaser.Types.Input.InteractiveObject | null; - - /** - * If this Game Object is enabled for Arcade or Matter Physics then this property will contain a reference to a Physics Body. - */ - body: Phaser.Physics.Arcade.Body | Phaser.Physics.Arcade.StaticBody | MatterJS.BodyType | null; - - /** - * This Game Object will ignore all calls made to its destroy method if this flag is set to `true`. - * This includes calls that may come from a Group, Container or the Scene itself. - * While it allows you to persist a Game Object across Scenes, please understand you are entirely - * responsible for managing references to and from this Game Object. - */ - ignoreDestroy: boolean; - - /** - * Sets the `active` property of this Game Object and returns this Game Object for further chaining. - * A Game Object with its `active` property set to `true` will be updated by the Scenes UpdateList. - * @param value True if this Game Object should be set as active, false if not. - */ - setActive(value: boolean): this; - - /** - * Sets the `name` property of this Game Object and returns this Game Object for further chaining. - * The `name` property is not populated by Phaser and is presented for your own use. - * @param value The name to be given to this Game Object. - */ - setName(value: string): this; - - /** - * Sets the current state of this Game Object. - * - * Phaser itself will never modify the State of a Game Object, although plugins may do so. - * - * For example, a Game Object could change from a state of 'moving', to 'attacking', to 'dead'. - * The state value should typically be an integer (ideally mapped to a constant - * in your game code), but could also be a string. It is recommended to keep it light and simple. - * If you need to store complex data about your Game Object, look at using the Data Component instead. - * @param value The state of the Game Object. - */ - setState(value: number | string): this; - - /** - * Adds a Data Manager component to this Game Object. - */ - setDataEnabled(): this; - - /** - * Allows you to store a key value pair within this Game Objects Data Manager. - * - * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled - * before setting the value. - * - * If the key doesn't already exist in the Data Manager then it is created. - * - * ```javascript - * sprite.setData('name', 'Red Gem Stone'); - * ``` - * - * You can also pass in an object of key value pairs as the first argument: - * - * ```javascript - * sprite.setData({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 }); - * ``` - * - * To get a value back again you can call `getData`: - * - * ```javascript - * sprite.getData('gold'); - * ``` - * - * Or you can access the value directly via the `values` property, where it works like any other variable: - * - * ```javascript - * sprite.data.values.gold += 50; - * ``` - * - * When the value is first set, a `setdata` event is emitted from this Game Object. - * - * If the key already exists, a `changedata` event is emitted instead, along an event named after the key. - * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`. - * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter. - * - * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings. - * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. - * @param key The key to set the value for. Or an object of key value pairs. If an object the `data` argument is ignored. - * @param data The value to set for the given key. If an object is provided as the key this argument is ignored. - */ - setData(key: string | object, data?: any): this; - - /** - * Increase a value for the given key within this Game Objects Data Manager. If the key doesn't already exist in the Data Manager then it is increased from 0. - * - * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled - * before setting the value. - * - * If the key doesn't already exist in the Data Manager then it is created. - * - * When the value is first set, a `setdata` event is emitted from this Game Object. - * @param key The key to increase the value for. - * @param data The value to increase for the given key. - */ - incData(key: string | object, data?: any): this; - - /** - * Toggle a boolean value for the given key within this Game Objects Data Manager. If the key doesn't already exist in the Data Manager then it is toggled from false. - * - * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled - * before setting the value. - * - * If the key doesn't already exist in the Data Manager then it is created. - * - * When the value is first set, a `setdata` event is emitted from this Game Object. - * @param key The key to toggle the value for. - */ - toggleData(key: string | object): this; - - /** - * Retrieves the value for the given key in this Game Objects Data Manager, or undefined if it doesn't exist. - * - * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either: - * - * ```javascript - * sprite.getData('gold'); - * ``` - * - * Or access the value directly: - * - * ```javascript - * sprite.data.values.gold; - * ``` - * - * You can also pass in an array of keys, in which case an array of values will be returned: - * - * ```javascript - * sprite.getData([ 'gold', 'armor', 'health' ]); - * ``` - * - * This approach is useful for destructuring arrays in ES6. - * @param key The key of the value to retrieve, or an array of keys. - */ - getData(key: string | string[]): any; - - /** - * Pass this Game Object to the Input Manager to enable it for Input. - * - * Input works by using hit areas, these are nearly always geometric shapes, such as rectangles or circles, that act as the hit area - * for the Game Object. However, you can provide your own hit area shape and callback, should you wish to handle some more advanced - * input detection. - * - * If no arguments are provided it will try and create a rectangle hit area based on the texture frame the Game Object is using. If - * this isn't a texture-bound object, such as a Graphics or BitmapText object, this will fail, and you'll need to provide a specific - * shape for it to use. - * - * You can also provide an Input Configuration Object as the only argument to this method. - * @param hitArea Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not given it will try to create a Rectangle based on the texture frame. - * @param callback The callback that determines if the pointer is within the Hit Area shape or not. If you provide a shape you must also provide a callback. - * @param dropZone Should this Game Object be treated as a drop zone target? Default false. - */ - setInteractive(hitArea?: Phaser.Types.Input.InputConfiguration | any, callback?: Phaser.Types.Input.HitAreaCallback, dropZone?: boolean): this; - - /** - * If this Game Object has previously been enabled for input, this will disable it. - * - * An object that is disabled for input stops processing or being considered for - * input events, but can be turned back on again at any time by simply calling - * `setInteractive()` with no arguments provided. - * - * If want to completely remove interaction from this Game Object then use `removeInteractive` instead. - */ - disableInteractive(): this; - - /** - * If this Game Object has previously been enabled for input, this will queue it - * for removal, causing it to no longer be interactive. The removal happens on - * the next game step, it is not immediate. - * - * The Interactive Object that was assigned to this Game Object will be destroyed, - * removed from the Input Manager and cleared from this Game Object. - * - * If you wish to re-enable this Game Object at a later date you will need to - * re-create its InteractiveObject by calling `setInteractive` again. - * - * If you wish to only temporarily stop an object from receiving input then use - * `disableInteractive` instead, as that toggles the interactive state, where-as - * this erases it completely. - * - * If you wish to resize a hit area, don't remove and then set it as being - * interactive. Instead, access the hitarea object directly and resize the shape - * being used. I.e.: `sprite.input.hitArea.setSize(width, height)` (assuming the - * shape is a Rectangle, which it is by default.) - */ - removeInteractive(): this; - - /** - * This callback is invoked when this Game Object is added to a Scene. - * - * Can be overriden by custom Game Objects, but be aware of some Game Objects that - * will use this, such as Sprites, to add themselves into the Update List. - * - * You can also listen for the `ADDED_TO_SCENE` event from this Game Object. - */ - addedToScene(): void; - - /** - * This callback is invoked when this Game Object is removed from a Scene. - * - * Can be overriden by custom Game Objects, but be aware of some Game Objects that - * will use this, such as Sprites, to removed themselves from the Update List. - * - * You can also listen for the `REMOVED_FROM_SCENE` event from this Game Object. - */ - removedFromScene(): void; - - /** - * To be overridden by custom GameObjects. Allows base objects to be used in a Pool. - * @param args args - */ - update(...args: any[]): void; - - /** - * Returns a JSON representation of the Game Object. - */ - toJSON(): Phaser.Types.GameObjects.JSONGameObject; - - /** - * Compares the renderMask with the renderFlags to see if this Game Object will render or not. - * Also checks the Game Object against the given Cameras exclusion list. - * @param camera The Camera to check against this Game Object. - */ - willRender(camera: Phaser.Cameras.Scene2D.Camera): boolean; - - /** - * Returns an array containing the display list index of either this Game Object, or if it has one, - * its parent Container. It then iterates up through all of the parent containers until it hits the - * root of the display list (which is index 0 in the returned array). - * - * Used internally by the InputPlugin but also useful if you wish to find out the display depth of - * this Game Object and all of its ancestors. - */ - getIndexList(): number[]; - - /** - * Adds this Game Object to the given Display List. - * - * If no Display List is specified, it will default to the Display List owned by the Scene to which - * this Game Object belongs. - * - * A Game Object can only exist on one Display List at any given time, but may move freely between them. - * - * If this Game Object is already on another Display List when this method is called, it will first - * be removed from it, before being added to the new list. - * - * You can query which list it is on by looking at the `Phaser.GameObjects.GameObject#displayList` property. - * - * If a Game Object isn't on any display list, it will not be rendered. If you just wish to temporarly - * disable it from rendering, consider using the `setVisible` method, instead. - * @param displayList The Display List to add to. Defaults to the Scene Display List. - */ - addToDisplayList(displayList?: Phaser.GameObjects.DisplayList | Phaser.GameObjects.Layer): this; - - /** - * Adds this Game Object to the Update List belonging to the Scene. - * - * When a Game Object is added to the Update List it will have its `preUpdate` method called - * every game frame. This method is passed two parameters: `delta` and `time`. - * - * If you wish to run your own logic within `preUpdate` then you should always call - * `preUpdate.super(delta, time)` within it, or it may fail to process required operations, - * such as Sprite animations. - */ - addToUpdateList(): this; - - /** - * Removes this Game Object from the Display List it is currently on. - * - * A Game Object can only exist on one Display List at any given time, but may move freely removed - * and added back at a later stage. - * - * You can query which list it is on by looking at the `Phaser.GameObjects.GameObject#displayList` property. - * - * If a Game Object isn't on any Display List, it will not be rendered. If you just wish to temporarly - * disable it from rendering, consider using the `setVisible` method, instead. - */ - removeFromDisplayList(): this; - - /** - * Removes this Game Object from the Scene's Update List. - * - * When a Game Object is on the Update List, it will have its `preUpdate` method called - * every game frame. Calling this method will remove it from the list, preventing this. - * - * Removing a Game Object from the Update List will stop most internal functions working. - * For example, removing a Sprite from the Update List will prevent it from being able to - * run animations. - */ - removeFromUpdateList(): this; - - /** - * Destroys this Game Object removing it from the Display List and Update List and - * severing all ties to parent resources. - * - * Also removes itself from the Input Manager and Physics Manager if previously enabled. - * - * Use this to remove a Game Object from your game if you don't ever plan to use it again. - * As long as no reference to it exists within your own code it should become free for - * garbage collection by the browser. - * - * If you just want to temporarily disable an object then look at using the - * Game Object Pool instead of destroying it, as destroyed objects cannot be resurrected. - * @param fromScene `True` if this Game Object is being destroyed by the Scene, `false` if not. Default false. - */ - destroy(fromScene?: boolean): void; - - /** - * The bitmask that `GameObject.renderFlags` is compared against to determine if the Game Object will render or not. - */ - static readonly RENDER_MASK: number; - - } - - /** - * The Game Object Creator is a Scene plugin that allows you to quickly create many common - * types of Game Objects and return them. Unlike the Game Object Factory, they are not automatically - * added to the Scene. - * - * Game Objects directly register themselves with the Creator and inject their own creation - * methods into the class. - */ - class GameObjectCreator { - /** - * - * @param scene The Scene to which this Game Object Factory belongs. - */ - constructor(scene: Phaser.Scene); - - /** - * Creates a new Dynamic Bitmap Text Game Object and returns it. - * - * Note: This method will only be available if the Dynamic Bitmap Text Game Object has been built into Phaser. - * @param config The configuration object this Game Object will use to create itself. - * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. - */ - dynamicBitmapText(config: Phaser.Types.GameObjects.BitmapText.BitmapTextConfig, addToScene?: boolean): Phaser.GameObjects.DynamicBitmapText; - - /** - * Creates a new Bitmap Text Game Object and returns it. - * - * Note: This method will only be available if the Bitmap Text Game Object has been built into Phaser. - * @param config The configuration object this Game Object will use to create itself. - * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. - */ - bitmapText(config: Phaser.Types.GameObjects.BitmapText.BitmapTextConfig, addToScene?: boolean): Phaser.GameObjects.BitmapText; - - /** - * Creates a new Blitter Game Object and returns it. - * - * Note: This method will only be available if the Blitter Game Object has been built into Phaser. - * @param config The configuration object this Game Object will use to create itself. - * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. - */ - blitter(config: Phaser.Types.GameObjects.Sprite.SpriteConfig, addToScene?: boolean): Phaser.GameObjects.Blitter; - - /** - * Creates a new Container Game Object and returns it. - * - * Note: This method will only be available if the Container Game Object has been built into Phaser. - * @param config The configuration object this Game Object will use to create itself. - * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. - */ - container(config: Phaser.Types.GameObjects.Container.ContainerConfig, addToScene?: boolean): Phaser.GameObjects.Container; - - /** - * The Scene to which this Game Object Creator belongs. - */ - protected scene: Phaser.Scene; - - /** - * A reference to the Scene.Systems. - */ - protected systems: Phaser.Scenes.Systems; - - /** - * A reference to the Scene Event Emitter. - */ - protected events: Phaser.Events.EventEmitter; - - /** - * A reference to the Scene Display List. - */ - protected displayList: Phaser.GameObjects.DisplayList; - - /** - * A reference to the Scene Update List. - */ - protected updateList: Phaser.GameObjects.UpdateList; - - /** - * Static method called directly by the Game Object creator functions. - * With this method you can register a custom GameObject factory in the GameObjectCreator, - * providing a name (`factoryType`) and the constructor (`factoryFunction`) in order - * to be called when you invoke Phaser.Scene.make[ factoryType ] method. - * @param factoryType The key of the factory that you will use to call to Phaser.Scene.make[ factoryType ] method. - * @param factoryFunction The constructor function to be called when you invoke to the Phaser.Scene.make method. - */ - static register(factoryType: string, factoryFunction: Function): void; - - /** - * Static method called directly by the Game Object Creator functions. - * - * With this method you can remove a custom Game Object Creator that has been previously - * registered in the Game Object Creator. Pass in its `factoryType` in order to remove it. - * @param factoryType The key of the factory that you want to remove from the GameObjectCreator. - */ - static remove(factoryType: string): void; - - /** - * Creates a new Graphics Game Object and returns it. - * - * Note: This method will only be available if the Graphics Game Object has been built into Phaser. - * @param config The configuration object this Game Object will use to create itself. - * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. - */ - graphics(config: Phaser.Types.GameObjects.Graphics.Options, addToScene?: boolean): Phaser.GameObjects.Graphics; - - /** - * Creates a new Group Game Object and returns it. - * - * Note: This method will only be available if the Group Game Object has been built into Phaser. - * @param config The configuration object this Game Object will use to create itself. - */ - group(config: Phaser.Types.GameObjects.Group.GroupConfig | Phaser.Types.GameObjects.Group.GroupCreateConfig): Phaser.GameObjects.Group; - - /** - * Creates a new Image Game Object and returns it. - * - * Note: This method will only be available if the Image Game Object has been built into Phaser. - * @param config The configuration object this Game Object will use to create itself. - * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. - */ - image(config: Phaser.Types.GameObjects.Sprite.SpriteConfig, addToScene?: boolean): Phaser.GameObjects.Image; - - /** - * Creates a new Layer Game Object and returns it. - * - * Note: This method will only be available if the Layer Game Object has been built into Phaser. - * @param config The configuration object this Game Object will use to create itself. - * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. - */ - layer(config: Phaser.Types.GameObjects.Sprite.SpriteConfig, addToScene?: boolean): Phaser.GameObjects.Layer; - - /** - * Creates a new Mesh Game Object and returns it. - * - * Note: This method will only be available if the Mesh Game Object and WebGL support have been built into Phaser. - * @param config The configuration object this Game Object will use to create itself. - * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. - */ - mesh(config: Phaser.Types.GameObjects.Mesh.MeshConfig, addToScene?: boolean): Phaser.GameObjects.Mesh; - - /** - * Creates a new Particle Emitter Manager Game Object and returns it. - * - * Note: This method will only be available if the Particles Game Object has been built into Phaser. - * @param config The configuration object this Game Object will use to create itself. - * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. - */ - particles(config: Phaser.Types.GameObjects.Particles.ParticleEmitterManagerConfig, addToScene?: boolean): Phaser.GameObjects.Particles.ParticleEmitterManager; - - /** - * Creates a new Point Light Game Object and returns it. - * - * Note: This method will only be available if the Point Light Game Object has been built into Phaser. - * @param config The configuration object this Game Object will use to create itself. - * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. - */ - pointlight(config: object, addToScene?: boolean): Phaser.GameObjects.PointLight; - - /** - * Creates a new Render Texture Game Object and returns it. - * - * Note: This method will only be available if the Render Texture Game Object has been built into Phaser. - * @param config The configuration object this Game Object will use to create itself. - * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. - */ - renderTexture(config: Phaser.Types.GameObjects.RenderTexture.RenderTextureConfig, addToScene?: boolean): Phaser.GameObjects.RenderTexture; - - /** - * Creates a new Rope Game Object and returns it. - * - * Note: This method will only be available if the Rope Game Object and WebGL support have been built into Phaser. - * @param config The configuration object this Game Object will use to create itself. - * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. - */ - rope(config: Phaser.Types.GameObjects.Rope.RopeConfig, addToScene?: boolean): Phaser.GameObjects.Rope; - - /** - * Creates a new Shader Game Object and returns it. - * - * Note: This method will only be available if the Shader Game Object and WebGL support have been built into Phaser. - * @param config The configuration object this Game Object will use to create itself. - * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. - */ - shader(config: Phaser.Types.GameObjects.Shader.ShaderConfig, addToScene?: boolean): Phaser.GameObjects.Shader; - - /** - * Creates a new Sprite Game Object and returns it. - * - * Note: This method will only be available if the Sprite Game Object has been built into Phaser. - * @param config The configuration object this Game Object will use to create itself. - * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. - */ - sprite(config: Phaser.Types.GameObjects.Sprite.SpriteConfig, addToScene?: boolean): Phaser.GameObjects.Sprite; - - /** - * Creates a new Text Game Object and returns it. - * - * Note: This method will only be available if the Text Game Object has been built into Phaser. - * @param config The configuration object this Game Object will use to create itself. - * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. - */ - text(config: Phaser.Types.GameObjects.Text.TextConfig, addToScene?: boolean): Phaser.GameObjects.Text; - - /** - * Creates a new TileSprite Game Object and returns it. - * - * Note: This method will only be available if the TileSprite Game Object has been built into Phaser. - * @param config The configuration object this Game Object will use to create itself. - * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. - */ - tileSprite(config: Phaser.Types.GameObjects.TileSprite.TileSpriteConfig, addToScene?: boolean): Phaser.GameObjects.TileSprite; - - /** - * Creates a new Video Game Object and returns it. - * - * Note: This method will only be available if the Video Game Object has been built into Phaser. - * @param config The configuration object this Game Object will use to create itself. - * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. - */ - video(config: Phaser.Types.GameObjects.Video.VideoConfig, addToScene?: boolean): Phaser.GameObjects.Video; - - /** - * Creates a new Zone Game Object and returns it. - * - * Note: This method will only be available if the Zone Game Object has been built into Phaser. - * @param config The configuration object this Game Object will use to create itself. - */ - zone(config: Phaser.Types.GameObjects.Zone.ZoneConfig): Phaser.GameObjects.Zone; - - /** - * Creates a Tilemap from the given key or data, or creates a blank Tilemap if no key/data provided. - * When loading from CSV or a 2D array, you should specify the tileWidth & tileHeight. When parsing - * from a map from Tiled, the tileWidth, tileHeight, width & height will be pulled from the map - * data. For an empty map, you should specify tileWidth, tileHeight, width & height. - * @param config The config options for the Tilemap. - */ - tilemap(config?: Phaser.Types.Tilemaps.TilemapConfig): Phaser.Tilemaps.Tilemap; - - /** - * Creates a new Tween object and returns it. - * - * Note: This method will only be available if Tweens have been built into Phaser. - * @param config The Tween configuration. - */ - tween(config: Phaser.Types.Tweens.TweenBuilderConfig | object): Phaser.Tweens.Tween; - - /** - * Creates a new TweenChain object and returns it, without adding it to the Tween Manager. - * - * Note: This method will only be available if Tweens have been built into Phaser. - * @param config The TweenChain configuration. - */ - tweenchain(config: Phaser.Types.Tweens.TweenBuilderConfig | object): Phaser.Tweens.TweenChain; - - } - - /** - * The Game Object Factory is a Scene plugin that allows you to quickly create many common - * types of Game Objects and have them automatically registered with the Scene. - * - * Game Objects directly register themselves with the Factory and inject their own creation - * methods into the class. - */ - class GameObjectFactory { - /** - * - * @param scene The Scene to which this Game Object Factory belongs. - */ - constructor(scene: Phaser.Scene); - - /** - * Creates a new Path Object. - * @param x The horizontal position of this Path. - * @param y The vertical position of this Path. - */ - path(x: number, y: number): Phaser.Curves.Path; - - /** - * Creates a new Dynamic Bitmap Text Game Object and adds it to the Scene. - * - * BitmapText objects work by taking a texture file and an XML or JSON file that describes the font structure. - * - * During rendering for each letter of the text is rendered to the display, proportionally spaced out and aligned to - * match the font structure. - * - * Dynamic Bitmap Text objects are different from Static Bitmap Text in that they invoke a callback for each - * letter being rendered during the render pass. This callback allows you to manipulate the properties of - * each letter being rendered, such as its position, scale or tint, allowing you to create interesting effects - * like jiggling text, which can't be done with Static text. This means that Dynamic Text takes more processing - * time, so only use them if you require the callback ability they have. - * - * BitmapText objects are less flexible than Text objects, in that they have less features such as shadows, fills and the ability - * to use Web Fonts, however you trade this flexibility for rendering speed. You can also create visually compelling BitmapTexts by - * processing the font texture in an image editor, applying fills and any other effects required. - * - * To create multi-line text insert \r, \n or \r\n escape codes into the text string. - * - * To create a BitmapText data files you need a 3rd party app such as: - * - * BMFont (Windows, free): http://www.angelcode.com/products/bmfont/ - * Glyph Designer (OS X, commercial): http://www.71squared.com/en/glyphdesigner - * Littera (Web-based, free): http://kvazars.com/littera/ - * - * For most use cases it is recommended to use XML. If you wish to use JSON, the formatting should be equal to the result of - * converting a valid XML file through the popular X2JS library. An online tool for conversion can be found here: http://codebeautify.org/xmltojson - * - * Note: This method will only be available if the Dynamic Bitmap Text Game Object has been built into Phaser. - * @param x The x position of the Game Object. - * @param y The y position of the Game Object. - * @param font The key of the font to use from the BitmapFont cache. - * @param text The string, or array of strings, to be set as the content of this Bitmap Text. - * @param size The font size to set. - */ - dynamicBitmapText(x: number, y: number, font: string, text?: string | string[], size?: number): Phaser.GameObjects.DynamicBitmapText; - - /** - * Creates a new Bitmap Text Game Object and adds it to the Scene. - * - * BitmapText objects work by taking a texture file and an XML or JSON file that describes the font structure. - * - * During rendering for each letter of the text is rendered to the display, proportionally spaced out and aligned to - * match the font structure. - * - * BitmapText objects are less flexible than Text objects, in that they have less features such as shadows, fills and the ability - * to use Web Fonts, however you trade this flexibility for rendering speed. You can also create visually compelling BitmapTexts by - * processing the font texture in an image editor, applying fills and any other effects required. - * - * To create multi-line text insert \r, \n or \r\n escape codes into the text string. - * - * To create a BitmapText data files you need a 3rd party app such as: - * - * BMFont (Windows, free): http://www.angelcode.com/products/bmfont/ - * Glyph Designer (OS X, commercial): http://www.71squared.com/en/glyphdesigner - * Littera (Web-based, free): http://kvazars.com/littera/ - * - * For most use cases it is recommended to use XML. If you wish to use JSON, the formatting should be equal to the result of - * converting a valid XML file through the popular X2JS library. An online tool for conversion can be found here: http://codebeautify.org/xmltojson - * - * Note: This method will only be available if the Bitmap Text Game Object has been built into Phaser. - * @param x The x position of the Game Object. - * @param y The y position of the Game Object. - * @param font The key of the font to use from the BitmapFont cache. - * @param text The string, or array of strings, to be set as the content of this Bitmap Text. - * @param size The font size to set. - * @param align The alignment of the text in a multi-line BitmapText object. Default 0. - */ - bitmapText(x: number, y: number, font: string, text?: string | string[], size?: number, align?: number): Phaser.GameObjects.BitmapText; - - /** - * Creates a new Blitter Game Object and adds it to the Scene. - * - * Note: This method will only be available if the Blitter Game Object has been built into Phaser. - * @param x The x position of the Game Object. - * @param y The y position of the Game Object. - * @param key The key of the Texture the Blitter object will use. - * @param frame The default Frame children of the Blitter will use. - */ - blitter(x: number, y: number, key: string, frame?: string | number): Phaser.GameObjects.Blitter; - - /** - * Creates a new Container Game Object and adds it to the Scene. - * - * Note: This method will only be available if the Container Game Object has been built into Phaser. - * @param x The horizontal position of this Game Object in the world. Default 0. - * @param y The vertical position of this Game Object in the world. Default 0. - * @param children An optional array of Game Objects to add to this Container. - */ - container(x?: number, y?: number, children?: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[]): Phaser.GameObjects.Container; - - /** - * DOM Element Game Objects are a way to control and manipulate HTML Elements over the top of your game. - * - * In order for DOM Elements to display you have to enable them by adding the following to your game - * configuration object: - * - * ```javascript - * dom { - * createContainer: true - * } - * ``` - * - * When this is added, Phaser will automatically create a DOM Container div that is positioned over the top - * of the game canvas. This div is sized to match the canvas, and if the canvas size changes, as a result of - * settings within the Scale Manager, the dom container is resized accordingly. - * - * You can create a DOM Element by either passing in DOMStrings, or by passing in a reference to an existing - * Element that you wish to be placed under the control of Phaser. For example: - * - * ```javascript - * this.add.dom(x, y, 'div', 'background-color: lime; width: 220px; height: 100px; font: 48px Arial', 'Phaser'); - * ``` - * - * The above code will insert a div element into the DOM Container at the given x/y coordinate. The DOMString in - * the 4th argument sets the initial CSS style of the div and the final argument is the inner text. In this case, - * it will create a lime colored div that is 220px by 100px in size with the text Phaser in it, in an Arial font. - * - * You should nearly always, without exception, use explicitly sized HTML Elements, in order to fully control - * alignment and positioning of the elements next to regular game content. - * - * Rather than specify the CSS and HTML directly you can use the `load.html` File Loader to load it into the - * cache and then use the `createFromCache` method instead. You can also use `createFromHTML` and various other - * methods available in this class to help construct your elements. - * - * Once the element has been created you can then control it like you would any other Game Object. You can set its - * position, scale, rotation, alpha and other properties. It will move as the main Scene Camera moves and be clipped - * at the edge of the canvas. It's important to remember some limitations of DOM Elements: The obvious one is that - * they appear above or below your game canvas. You cannot blend them into the display list, meaning you cannot have - * a DOM Element, then a Sprite, then another DOM Element behind it. - * - * They also cannot be enabled for input. To do that, you have to use the `addListener` method to add native event - * listeners directly. The final limitation is to do with cameras. The DOM Container is sized to match the game canvas - * entirely and clipped accordingly. DOM Elements respect camera scrolling and scrollFactor settings, but if you - * change the size of the camera so it no longer matches the size of the canvas, they won't be clipped accordingly. - * - * Also, all DOM Elements are inserted into the same DOM Container, regardless of which Scene they are created in. - * - * DOM Elements are a powerful way to align native HTML with your Phaser Game Objects. For example, you can insert - * a login form for a multiplayer game directly into your title screen. Or a text input box for a highscore table. - * Or a banner ad from a 3rd party service. Or perhaps you'd like to use them for high resolution text display and - * UI. The choice is up to you, just remember that you're dealing with standard HTML and CSS floating over the top - * of your game, and should treat it accordingly. - * - * Note: This method will only be available if the DOM Element Game Object has been built into Phaser. - * @param x The horizontal position of this DOM Element in the world. - * @param y The vertical position of this DOM Element in the world. - * @param element An existing DOM element, or a string. If a string starting with a # it will do a `getElementById` look-up on the string (minus the hash). Without a hash, it represents the type of element to create, i.e. 'div'. - * @param style If a string, will be set directly as the elements `style` property value. If a plain object, will be iterated and the values transferred. In both cases the values replacing whatever CSS styles may have been previously set. - * @param innerText If given, will be set directly as the elements `innerText` property value, replacing whatever was there before. - */ - dom(x: number, y: number, element?: HTMLElement | string, style?: string | any, innerText?: string): Phaser.GameObjects.DOMElement; - - /** - * Creates a new Extern Game Object and adds it to the Scene. - * - * Note: This method will only be available if the Extern Game Object has been built into Phaser. - */ - extern(): Phaser.GameObjects.Extern; - - /** - * The Scene to which this Game Object Factory belongs. - */ - protected scene: Phaser.Scene; - - /** - * A reference to the Scene.Systems. - */ - protected systems: Phaser.Scenes.Systems; - - /** - * A reference to the Scene Event Emitter. - */ - protected events: Phaser.Events.EventEmitter; - - /** - * A reference to the Scene Display List. - */ - protected displayList: Phaser.GameObjects.DisplayList; - - /** - * A reference to the Scene Update List. - */ - protected updateList: Phaser.GameObjects.UpdateList; - - /** - * Adds an existing Game Object to this Scene. - * - * If the Game Object renders, it will be added to the Display List. - * If it has a `preUpdate` method, it will be added to the Update List. - * @param child The child to be added to this Scene. - */ - existing(child: G): G; - - /** - * Static method called directly by the Game Object factory functions. - * With this method you can register a custom GameObject factory in the GameObjectFactory, - * providing a name (`factoryType`) and the constructor (`factoryFunction`) in order - * to be called when you call to Phaser.Scene.add[ factoryType ] method. - * @param factoryType The key of the factory that you will use to call to Phaser.Scene.add[ factoryType ] method. - * @param factoryFunction The constructor function to be called when you invoke to the Phaser.Scene.add method. - */ - static register(factoryType: string, factoryFunction: Function): void; - - /** - * Static method called directly by the Game Object factory functions. - * With this method you can remove a custom GameObject factory registered in the GameObjectFactory, - * providing a its `factoryType`. - * @param factoryType The key of the factory that you want to remove from the GameObjectFactory. - */ - static remove(factoryType: string): void; - - /** - * Creates a new Graphics Game Object and adds it to the Scene. - * - * Note: This method will only be available if the Graphics Game Object has been built into Phaser. - * @param config The Graphics configuration. - */ - graphics(config?: Phaser.Types.GameObjects.Graphics.Options): Phaser.GameObjects.Graphics; - - /** - * Creates a new Group Game Object and adds it to the Scene. - * - * Note: This method will only be available if the Group Game Object has been built into Phaser. - * @param children Game Objects to add to this Group; or the `config` argument. - * @param config A Group Configuration object. - */ - group(children?: Phaser.GameObjects.GameObject[] | Phaser.Types.GameObjects.Group.GroupConfig | Phaser.Types.GameObjects.Group.GroupConfig[] | Phaser.Types.GameObjects.Group.GroupCreateConfig, config?: Phaser.Types.GameObjects.Group.GroupConfig | Phaser.Types.GameObjects.Group.GroupCreateConfig): Phaser.GameObjects.Group; - - /** - * Creates a new Image Game Object and adds it to the Scene. - * - * Note: This method will only be available if the Image Game Object has been built into Phaser. - * @param x The horizontal position of this Game Object in the world. - * @param y The vertical position of this Game Object in the world. - * @param texture The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param frame An optional frame from the Texture this Game Object is rendering with. - */ - image(x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | number): Phaser.GameObjects.Image; - - /** - * Creates a new Layer Game Object and adds it to the Scene. - * - * Note: This method will only be available if the Layer Game Object has been built into Phaser. - * @param children An optional array of Game Objects to add to this Layer. - */ - layer(children?: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[]): Phaser.GameObjects.Layer; - - /** - * Creates a new Mesh Game Object and adds it to the Scene. - * - * Note: This method will only be available if the Mesh Game Object and WebGL support have been built into Phaser. - * @param x The horizontal position of this Game Object in the world. - * @param y The vertical position of this Game Object in the world. - * @param texture The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param frame An optional frame from the Texture this Game Object is rendering with. - * @param vertices The vertices array. Either `xy` pairs, or `xyz` if the `containsZ` parameter is `true`. - * @param uvs The UVs pairs array. - * @param indicies Optional vertex indicies array. If you don't have one, pass `null` or an empty array. - * @param containsZ Does the vertices data include a `z` component? Default false. - * @param normals Optional vertex normals array. If you don't have one, pass `null` or an empty array. - * @param colors An array of colors, one per vertex, or a single color value applied to all vertices. Default 0xffffff. - * @param alphas An array of alpha values, one per vertex, or a single alpha value applied to all vertices. Default 1. - */ - mesh(x?: number, y?: number, texture?: string | Phaser.Textures.Texture, frame?: string | number, vertices?: number[], uvs?: number[], indicies?: number[], containsZ?: boolean, normals?: number[], colors?: number | number[], alphas?: number | number[]): Phaser.GameObjects.Mesh; - - /** - * Creates a new Particle Emitter Manager Game Object and adds it to the Scene. - * - * Note: This method will only be available if the Particles Game Object has been built into Phaser. - * @param texture The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param frame An optional frame from the Texture this Game Object is rendering with. - * @param emitters Configuration settings for one or more emitters to create. - */ - particles(texture: string | Phaser.Textures.Texture, frame?: string | number | object, emitters?: Phaser.Types.GameObjects.Particles.ParticleEmitterConfig | Phaser.Types.GameObjects.Particles.ParticleEmitterConfig[]): Phaser.GameObjects.Particles.ParticleEmitterManager; - - /** - * Creates a new PathFollower Game Object and adds it to the Scene. - * - * Note: This method will only be available if the PathFollower Game Object has been built into Phaser. - * @param path The Path this PathFollower is connected to. - * @param x The horizontal position of this Game Object in the world. - * @param y The vertical position of this Game Object in the world. - * @param texture The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param frame An optional frame from the Texture this Game Object is rendering with. - */ - follower(path: Phaser.Curves.Path, x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | number): Phaser.GameObjects.PathFollower; - - /** - * Creates a new Point Light Game Object and adds it to the Scene. - * - * Note: This method will only be available if the Point Light Game Object has been built into Phaser. - * - * The Point Light Game Object provides a way to add a point light effect into your game, - * without the expensive shader processing requirements of the traditional Light Game Object. - * - * The difference is that the Point Light renders using a custom shader, designed to give the - * impression of a point light source, of variable radius, intensity and color, in your game. - * However, unlike the Light Game Object, it does not impact any other Game Objects, or use their - * normal maps for calcuations. This makes them extremely fast to render compared to Lights - * and perfect for special effects, such as flickering torches or muzzle flashes. - * - * For maximum performance you should batch Point Light Game Objects together. This means - * ensuring they follow each other consecutively on the display list. Ideally, use a Layer - * Game Object and then add just Point Lights to it, so that it can batch together the rendering - * of the lights. You don't _have_ to do this, and if you've only a handful of Point Lights in - * your game then it's perfectly safe to mix them into the dislay list as normal. However, if - * you're using a large number of them, please consider how they are mixed into the display list. - * - * The renderer will automatically cull Point Lights. Those with a radius that does not intersect - * with the Camera will be skipped in the rendering list. This happens automatically and the - * culled state is refreshed every frame, for every camera. - * - * The origin of a Point Light is always 0.5 and it cannot be changed. - * - * Point Lights are a WebGL only feature and do not have a Canvas counterpart. - * @param x The horizontal position of this Point Light in the world. - * @param y The vertical position of this Point Light in the world. - * @param color The color of the Point Light, given as a hex value. Default 0xffffff. - * @param radius The radius of the Point Light. Default 128. - * @param intensity The intensity, or color blend, of the Point Light. Default 1. - * @param attenuation The attenuation of the Point Light. This is the reduction of light from the center point. Default 0.1. - */ - pointlight(x: number, y: number, color?: number, radius?: number, intensity?: number, attenuation?: number): Phaser.GameObjects.PointLight; - - /** - * Creates a new Render Texture Game Object and adds it to the Scene. - * - * Note: This method will only be available if the Render Texture Game Object has been built into Phaser. - * - * A Render Texture is a special texture that allows any number of Game Objects to be drawn to it. You can take many complex objects and - * draw them all to this one texture, which can they be used as the texture for other Game Object's. It's a way to generate dynamic - * textures at run-time that are WebGL friendly and don't invoke expensive GPU uploads. - * @param x The horizontal position of this Game Object in the world. - * @param y The vertical position of this Game Object in the world. - * @param width The width of the Render Texture. Default 32. - * @param height The height of the Render Texture. Default 32. - */ - renderTexture(x: number, y: number, width?: number, height?: number): Phaser.GameObjects.RenderTexture; - - /** - * Creates a new Rope Game Object and adds it to the Scene. - * - * Note: This method will only be available if the Rope Game Object and WebGL support have been built into Phaser. - * @param x The horizontal position of this Game Object in the world. - * @param y The vertical position of this Game Object in the world. - * @param texture The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param frame An optional frame from the Texture this Game Object is rendering with. - * @param points An array containing the vertices data for this Rope. If none is provided a simple quad is created. See `setPoints` to set this post-creation. - * @param horizontal Should the vertices of this Rope be aligned horizontally (`true`), or vertically (`false`)? Default true. - * @param colors An optional array containing the color data for this Rope. You should provide one color value per pair of vertices. - * @param alphas An optional array containing the alpha data for this Rope. You should provide one alpha value per pair of vertices. - */ - rope(x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | number, points?: Phaser.Types.Math.Vector2Like[], horizontal?: boolean, colors?: number[], alphas?: number[]): Phaser.GameObjects.Rope; - - /** - * Creates a new Shader Game Object and adds it to the Scene. - * - * Note: This method will only be available if the Shader Game Object and WebGL support have been built into Phaser. - * @param key The key of the shader to use from the shader cache, or a BaseShader instance. - * @param x The horizontal position of this Game Object in the world. Default 0. - * @param y The vertical position of this Game Object in the world. Default 0. - * @param width The width of the Game Object. Default 128. - * @param height The height of the Game Object. Default 128. - * @param textures Optional array of texture keys to bind to the iChannel0...3 uniforms. The textures must already exist in the Texture Manager. - * @param textureData Optional additional texture data. - */ - shader(key: string | Phaser.Display.BaseShader, x?: number, y?: number, width?: number, height?: number, textures?: string[], textureData?: object): Phaser.GameObjects.Shader; - - /** - * Creates a new Arc Shape Game Object and adds it to the Scene. - * - * Note: This method will only be available if the Arc Game Object has been built into Phaser. - * - * The Arc Shape is a Game Object that can be added to a Scene, Group or Container. You can - * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling - * it for input or physics. It provides a quick and easy way for you to render this shape in your - * game without using a texture, while still taking advantage of being fully batched in WebGL. - * - * This shape supports both fill and stroke colors. - * - * When it renders it displays an arc shape. You can control the start and end angles of the arc, - * as well as if the angles are winding clockwise or anti-clockwise. With the default settings - * it renders as a complete circle. By changing the angles you can create other arc shapes, - * such as half-circles. - * @param x The horizontal position of this Game Object in the world. Default 0. - * @param y The vertical position of this Game Object in the world. Default 0. - * @param radius The radius of the arc. Default 128. - * @param startAngle The start angle of the arc, in degrees. Default 0. - * @param endAngle The end angle of the arc, in degrees. Default 360. - * @param anticlockwise The winding order of the start and end angles. Default false. - * @param fillColor The color the arc will be filled with, i.e. 0xff0000 for red. - * @param fillAlpha The alpha the arc will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. - */ - arc(x?: number, y?: number, radius?: number, startAngle?: number, endAngle?: number, anticlockwise?: boolean, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Arc; - - /** - * Creates a new Circle Shape Game Object and adds it to the Scene. - * - * A Circle is an Arc with no defined start and end angle, making it render as a complete circle. - * - * Note: This method will only be available if the Arc Game Object has been built into Phaser. - * @param x The horizontal position of this Game Object in the world. Default 0. - * @param y The vertical position of this Game Object in the world. Default 0. - * @param radius The radius of the circle. Default 128. - * @param fillColor The color the circle will be filled with, i.e. 0xff0000 for red. - * @param fillAlpha The alpha the circle will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. - */ - circle(x?: number, y?: number, radius?: number, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Arc; - - /** - * Creates a new Curve Shape Game Object and adds it to the Scene. - * - * Note: This method will only be available if the Curve Game Object has been built into Phaser. - * - * The Curve Shape is a Game Object that can be added to a Scene, Group or Container. You can - * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling - * it for input or physics. It provides a quick and easy way for you to render this shape in your - * game without using a texture, while still taking advantage of being fully batched in WebGL. - * - * This shape supports both fill and stroke colors. - * - * To render a Curve Shape you must first create a `Phaser.Curves.Curve` object, then pass it to - * the Curve Shape in the constructor. - * - * The Curve shape also has a `smoothness` property and corresponding `setSmoothness` method. - * This allows you to control how smooth the shape renders in WebGL, by controlling the number of iterations - * that take place during construction. Increase and decrease the default value for smoother, or more - * jagged, shapes. - * @param x The horizontal position of this Game Object in the world. Default 0. - * @param y The vertical position of this Game Object in the world. Default 0. - * @param curve The Curve object to use to create the Shape. - * @param fillColor The color the curve will be filled with, i.e. 0xff0000 for red. - * @param fillAlpha The alpha the curve will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. - */ - curve(x?: number, y?: number, curve?: Phaser.Curves.Curve, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Curve; - - /** - * Creates a new Ellipse Shape Game Object and adds it to the Scene. - * - * Note: This method will only be available if the Ellipse Game Object has been built into Phaser. - * - * The Ellipse Shape is a Game Object that can be added to a Scene, Group or Container. You can - * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling - * it for input or physics. It provides a quick and easy way for you to render this shape in your - * game without using a texture, while still taking advantage of being fully batched in WebGL. - * - * This shape supports both fill and stroke colors. - * - * When it renders it displays an ellipse shape. You can control the width and height of the ellipse. - * If the width and height match it will render as a circle. If the width is less than the height, - * it will look more like an egg shape. - * - * The Ellipse shape also has a `smoothness` property and corresponding `setSmoothness` method. - * This allows you to control how smooth the shape renders in WebGL, by controlling the number of iterations - * that take place during construction. Increase and decrease the default value for smoother, or more - * jagged, shapes. - * @param x The horizontal position of this Game Object in the world. Default 0. - * @param y The vertical position of this Game Object in the world. Default 0. - * @param width The width of the ellipse. An ellipse with equal width and height renders as a circle. Default 128. - * @param height The height of the ellipse. An ellipse with equal width and height renders as a circle. Default 128. - * @param fillColor The color the ellipse will be filled with, i.e. 0xff0000 for red. - * @param fillAlpha The alpha the ellipse will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. - */ - ellipse(x?: number, y?: number, width?: number, height?: number, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Ellipse; - - /** - * Creates a new Grid Shape Game Object and adds it to the Scene. - * - * Note: This method will only be available if the Grid Game Object has been built into Phaser. - * - * The Grid Shape is a Game Object that can be added to a Scene, Group or Container. You can - * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling - * it for input or physics. It provides a quick and easy way for you to render this shape in your - * game without using a texture, while still taking advantage of being fully batched in WebGL. - * - * This shape supports only fill colors and cannot be stroked. - * - * A Grid Shape allows you to display a grid in your game, where you can control the size of the - * grid as well as the width and height of the grid cells. You can set a fill color for each grid - * cell as well as an alternate fill color. When the alternate fill color is set then the grid - * cells will alternate the fill colors as they render, creating a chess-board effect. You can - * also optionally have an outline fill color. If set, this draws lines between the grid cells - * in the given color. If you specify an outline color with an alpha of zero, then it will draw - * the cells spaced out, but without the lines between them. - * @param x The horizontal position of this Game Object in the world. Default 0. - * @param y The vertical position of this Game Object in the world. Default 0. - * @param width The width of the grid. Default 128. - * @param height The height of the grid. Default 128. - * @param cellWidth The width of one cell in the grid. Default 32. - * @param cellHeight The height of one cell in the grid. Default 32. - * @param fillColor The color the grid cells will be filled with, i.e. 0xff0000 for red. - * @param fillAlpha The alpha the grid cells will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. - * @param outlineFillColor The color of the lines between the grid cells. - * @param outlineFillAlpha The alpha of the lines between the grid cells. - */ - grid(x?: number, y?: number, width?: number, height?: number, cellWidth?: number, cellHeight?: number, fillColor?: number, fillAlpha?: number, outlineFillColor?: number, outlineFillAlpha?: number): Phaser.GameObjects.Grid; - - /** - * Creates a new IsoBox Shape Game Object and adds it to the Scene. - * - * Note: This method will only be available if the IsoBox Game Object has been built into Phaser. - * - * The IsoBox Shape is a Game Object that can be added to a Scene, Group or Container. You can - * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling - * it for input or physics. It provides a quick and easy way for you to render this shape in your - * game without using a texture, while still taking advantage of being fully batched in WebGL. - * - * This shape supports only fill colors and cannot be stroked. - * - * An IsoBox is an 'isometric' rectangle. Each face of it has a different fill color. You can set - * the color of the top, left and right faces of the rectangle respectively. You can also choose - * which of the faces are rendered via the `showTop`, `showLeft` and `showRight` properties. - * - * You cannot view an IsoBox from under-neath, however you can change the 'angle' by setting - * the `projection` property. - * @param x The horizontal position of this Game Object in the world. Default 0. - * @param y The vertical position of this Game Object in the world. Default 0. - * @param size The width of the iso box in pixels. The left and right faces will be exactly half this value. Default 48. - * @param height The height of the iso box. The left and right faces will be this tall. The overall height of the isobox will be this value plus half the `size` value. Default 32. - * @param fillTop The fill color of the top face of the iso box. Default 0xeeeeee. - * @param fillLeft The fill color of the left face of the iso box. Default 0x999999. - * @param fillRight The fill color of the right face of the iso box. Default 0xcccccc. - */ - isobox(x?: number, y?: number, size?: number, height?: number, fillTop?: number, fillLeft?: number, fillRight?: number): Phaser.GameObjects.IsoBox; - - /** - * Creates a new IsoTriangle Shape Game Object and adds it to the Scene. - * - * Note: This method will only be available if the IsoTriangle Game Object has been built into Phaser. - * - * The IsoTriangle Shape is a Game Object that can be added to a Scene, Group or Container. You can - * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling - * it for input or physics. It provides a quick and easy way for you to render this shape in your - * game without using a texture, while still taking advantage of being fully batched in WebGL. - * - * This shape supports only fill colors and cannot be stroked. - * - * An IsoTriangle is an 'isometric' triangle. Think of it like a pyramid. Each face has a different - * fill color. You can set the color of the top, left and right faces of the triangle respectively - * You can also choose which of the faces are rendered via the `showTop`, `showLeft` and `showRight` properties. - * - * You cannot view an IsoTriangle from under-neath, however you can change the 'angle' by setting - * the `projection` property. The `reversed` property controls if the IsoTriangle is rendered upside - * down or not. - * @param x The horizontal position of this Game Object in the world. Default 0. - * @param y The vertical position of this Game Object in the world. Default 0. - * @param size The width of the iso triangle in pixels. The left and right faces will be exactly half this value. Default 48. - * @param height The height of the iso triangle. The left and right faces will be this tall. The overall height of the iso triangle will be this value plus half the `size` value. Default 32. - * @param reversed Is the iso triangle upside down? Default false. - * @param fillTop The fill color of the top face of the iso triangle. Default 0xeeeeee. - * @param fillLeft The fill color of the left face of the iso triangle. Default 0x999999. - * @param fillRight The fill color of the right face of the iso triangle. Default 0xcccccc. - */ - isotriangle(x?: number, y?: number, size?: number, height?: number, reversed?: boolean, fillTop?: number, fillLeft?: number, fillRight?: number): Phaser.GameObjects.IsoTriangle; - - /** - * Creates a new Line Shape Game Object and adds it to the Scene. - * - * Note: This method will only be available if the Line Game Object has been built into Phaser. - * - * The Line Shape is a Game Object that can be added to a Scene, Group or Container. You can - * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling - * it for input or physics. It provides a quick and easy way for you to render this shape in your - * game without using a texture, while still taking advantage of being fully batched in WebGL. - * - * This shape supports only stroke colors and cannot be filled. - * - * A Line Shape allows you to draw a line between two points in your game. You can control the - * stroke color and thickness of the line. In WebGL only you can also specify a different - * thickness for the start and end of the line, allowing you to render lines that taper-off. - * - * If you need to draw multiple lines in a sequence you may wish to use the Polygon Shape instead. - * @param x The horizontal position of this Game Object in the world. Default 0. - * @param y The vertical position of this Game Object in the world. Default 0. - * @param x1 The horizontal position of the start of the line. Default 0. - * @param y1 The vertical position of the start of the line. Default 0. - * @param x2 The horizontal position of the end of the line. Default 128. - * @param y2 The vertical position of the end of the line. Default 0. - * @param strokeColor The color the line will be drawn in, i.e. 0xff0000 for red. - * @param strokeAlpha The alpha the line will be drawn in. You can also set the alpha of the overall Shape using its `alpha` property. - */ - line(x?: number, y?: number, x1?: number, y1?: number, x2?: number, y2?: number, strokeColor?: number, strokeAlpha?: number): Phaser.GameObjects.Line; - - /** - * Creates a new Polygon Shape Game Object and adds it to the Scene. - * - * Note: This method will only be available if the Polygon Game Object has been built into Phaser. - * - * The Polygon Shape is a Game Object that can be added to a Scene, Group or Container. You can - * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling - * it for input or physics. It provides a quick and easy way for you to render this shape in your - * game without using a texture, while still taking advantage of being fully batched in WebGL. - * - * This shape supports both fill and stroke colors. - * - * The Polygon Shape is created by providing a list of points, which are then used to create an - * internal Polygon geometry object. The points can be set from a variety of formats: - * - * - An array of Point or Vector2 objects: `[new Phaser.Math.Vector2(x1, y1), ...]` - * - An array of objects with public x/y properties: `[obj1, obj2, ...]` - * - An array of paired numbers that represent point coordinates: `[x1,y1, x2,y2, ...]` - * - An array of arrays with two elements representing x/y coordinates: `[[x1, y1], [x2, y2], ...]` - * - * By default the `x` and `y` coordinates of this Shape refer to the center of it. However, depending - * on the coordinates of the points provided, the final shape may be rendered offset from its origin. - * @param x The horizontal position of this Game Object in the world. Default 0. - * @param y The vertical position of this Game Object in the world. Default 0. - * @param points The points that make up the polygon. - * @param fillColor The color the polygon will be filled with, i.e. 0xff0000 for red. - * @param fillAlpha The alpha the polygon will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. - */ - polygon(x?: number, y?: number, points?: any, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Polygon; - - /** - * Creates a new Rectangle Shape Game Object and adds it to the Scene. - * - * Note: This method will only be available if the Rectangle Game Object has been built into Phaser. - * - * The Rectangle Shape is a Game Object that can be added to a Scene, Group or Container. You can - * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling - * it for input or physics. It provides a quick and easy way for you to render this shape in your - * game without using a texture, while still taking advantage of being fully batched in WebGL. - * - * This shape supports both fill and stroke colors. - * - * You can change the size of the rectangle by changing the `width` and `height` properties. - * @param x The horizontal position of this Game Object in the world. Default 0. - * @param y The vertical position of this Game Object in the world. Default 0. - * @param width The width of the rectangle. Default 128. - * @param height The height of the rectangle. Default 128. - * @param fillColor The color the rectangle will be filled with, i.e. 0xff0000 for red. - * @param fillAlpha The alpha the rectangle will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. - */ - rectangle(x?: number, y?: number, width?: number, height?: number, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Rectangle; - - /** - * Creates a new Star Shape Game Object and adds it to the Scene. - * - * Note: This method will only be available if the Star Game Object has been built into Phaser. - * - * The Star Shape is a Game Object that can be added to a Scene, Group or Container. You can - * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling - * it for input or physics. It provides a quick and easy way for you to render this shape in your - * game without using a texture, while still taking advantage of being fully batched in WebGL. - * - * This shape supports both fill and stroke colors. - * - * As the name implies, the Star shape will display a star in your game. You can control several - * aspects of it including the number of points that constitute the star. The default is 5. If - * you change it to 4 it will render as a diamond. If you increase them, you'll get a more spiky - * star shape. - * - * You can also control the inner and outer radius, which is how 'long' each point of the star is. - * Modify these values to create more interesting shapes. - * @param x The horizontal position of this Game Object in the world. Default 0. - * @param y The vertical position of this Game Object in the world. Default 0. - * @param points The number of points on the star. Default 5. - * @param innerRadius The inner radius of the star. Default 32. - * @param outerRadius The outer radius of the star. Default 64. - * @param fillColor The color the star will be filled with, i.e. 0xff0000 for red. - * @param fillAlpha The alpha the star will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. - */ - star(x?: number, y?: number, points?: number, innerRadius?: number, outerRadius?: number, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Star; - - /** - * Creates a new Triangle Shape Game Object and adds it to the Scene. - * - * Note: This method will only be available if the Triangle Game Object has been built into Phaser. - * - * The Triangle Shape is a Game Object that can be added to a Scene, Group or Container. You can - * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling - * it for input or physics. It provides a quick and easy way for you to render this shape in your - * game without using a texture, while still taking advantage of being fully batched in WebGL. - * - * This shape supports both fill and stroke colors. - * - * The Triangle consists of 3 lines, joining up to form a triangular shape. You can control the - * position of each point of these lines. The triangle is always closed and cannot have an open - * face. If you require that, consider using a Polygon instead. - * @param x The horizontal position of this Game Object in the world. Default 0. - * @param y The vertical position of this Game Object in the world. Default 0. - * @param x1 The horizontal position of the first point in the triangle. Default 0. - * @param y1 The vertical position of the first point in the triangle. Default 128. - * @param x2 The horizontal position of the second point in the triangle. Default 64. - * @param y2 The vertical position of the second point in the triangle. Default 0. - * @param x3 The horizontal position of the third point in the triangle. Default 128. - * @param y3 The vertical position of the third point in the triangle. Default 128. - * @param fillColor The color the triangle will be filled with, i.e. 0xff0000 for red. - * @param fillAlpha The alpha the triangle will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. - */ - triangle(x?: number, y?: number, x1?: number, y1?: number, x2?: number, y2?: number, x3?: number, y3?: number, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Triangle; - - /** - * Creates a new Sprite Game Object and adds it to the Scene. - * - * Note: This method will only be available if the Sprite Game Object has been built into Phaser. - * @param x The horizontal position of this Game Object in the world. - * @param y The vertical position of this Game Object in the world. - * @param texture The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param frame An optional frame from the Texture this Game Object is rendering with. - */ - sprite(x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | number): Phaser.GameObjects.Sprite; - - /** - * Creates a new Text Game Object and adds it to the Scene. - * - * A Text Game Object. - * - * Text objects work by creating their own internal hidden Canvas and then renders text to it using - * the standard Canvas `fillText` API. It then creates a texture from this canvas which is rendered - * to your game during the render pass. - * - * Because it uses the Canvas API you can take advantage of all the features this offers, such as - * applying gradient fills to the text, or strokes, shadows and more. You can also use custom fonts - * loaded externally, such as Google or TypeKit Web fonts. - * - * You can only display fonts that are currently loaded and available to the browser: therefore fonts must - * be pre-loaded. Phaser does not do ths for you, so you will require the use of a 3rd party font loader, - * or have the fonts ready available in the CSS on the page in which your Phaser game resides. - * - * See {@link http://www.jordanm.co.uk/tinytype this compatibility table} for the available default fonts - * across mobile browsers. - * - * A note on performance: Every time the contents of a Text object changes, i.e. changing the text being - * displayed, or the style of the text, it needs to remake the Text canvas, and if on WebGL, re-upload the - * new texture to the GPU. This can be an expensive operation if used often, or with large quantities of - * Text objects in your game. If you run into performance issues you would be better off using Bitmap Text - * instead, as it benefits from batching and avoids expensive Canvas API calls. - * - * Note: This method will only be available if the Text Game Object has been built into Phaser. - * @param x The horizontal position of this Game Object in the world. - * @param y The vertical position of this Game Object in the world. - * @param text The text this Text object will display. - * @param style The Text style configuration object. - */ - text(x: number, y: number, text: string | string[], style?: Phaser.Types.GameObjects.Text.TextStyle): Phaser.GameObjects.Text; - - /** - * Creates a new TileSprite Game Object and adds it to the Scene. - * - * Note: This method will only be available if the TileSprite Game Object has been built into Phaser. - * @param x The horizontal position of this Game Object in the world. - * @param y The vertical position of this Game Object in the world. - * @param width The width of the Game Object. If zero it will use the size of the texture frame. - * @param height The height of the Game Object. If zero it will use the size of the texture frame. - * @param texture The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param frame An optional frame from the Texture this Game Object is rendering with. - */ - tileSprite(x: number, y: number, width: number, height: number, texture: string | Phaser.Textures.Texture, frame?: string | number): Phaser.GameObjects.TileSprite; - - /** - * Creates a new Video Game Object and adds it to the Scene. - * - * Note: This method will only be available if the Video Game Object has been built into Phaser. - * @param x The horizontal position of this Game Object in the world. - * @param y The vertical position of this Game Object in the world. - * @param key Optional key of the Video this Game Object will play, as stored in the Video Cache. - */ - video(x: number, y: number, key?: string): Phaser.GameObjects.Video; - - /** - * Creates a new Zone Game Object and adds it to the Scene. - * - * Note: This method will only be available if the Zone Game Object has been built into Phaser. - * @param x The horizontal position of this Game Object in the world. - * @param y The vertical position of this Game Object in the world. - * @param width The width of the Game Object. - * @param height The height of the Game Object. - */ - zone(x: number, y: number, width: number, height: number): Phaser.GameObjects.Zone; - - /** - * Creates a Tilemap from the given key or data, or creates a blank Tilemap if no key/data provided. - * When loading from CSV or a 2D array, you should specify the tileWidth & tileHeight. When parsing - * from a map from Tiled, the tileWidth, tileHeight, width & height will be pulled from the map - * data. For an empty map, you should specify tileWidth, tileHeight, width & height. - * @param key The key in the Phaser cache that corresponds to the loaded tilemap data. - * @param tileWidth The width of a tile in pixels. Pass in `null` to leave as the - * default. Default 32. - * @param tileHeight The height of a tile in pixels. Pass in `null` to leave as the - * default. Default 32. - * @param width The width of the map in tiles. Pass in `null` to leave as the - * default. Default 10. - * @param height The height of the map in tiles. Pass in `null` to leave as the - * default. Default 10. - * @param data Instead of loading from the cache, you can also load directly from - * a 2D array of tile indexes. Pass in `null` for no data. - * @param insertNull Controls how empty tiles, tiles with an index of -1, in the - * map data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty - * location will get a Tile object with an index of -1. If you've a large sparsely populated map and - * the tile data doesn't need to change then setting this value to `true` will help with memory - * consumption. However if your map is small or you need to update the tiles dynamically, then leave - * the default value set. Default false. - */ - tilemap(key?: string, tileWidth?: number, tileHeight?: number, width?: number, height?: number, data?: number[][], insertNull?: boolean): Phaser.Tilemaps.Tilemap; - - /** - * Creates a new Tween object. - * - * Note: This method will only be available if Tweens have been built into Phaser. - * @param config The Tween configuration. - */ - tween(config: Phaser.Types.Tweens.TweenBuilderConfig | object): Phaser.Tweens.Tween; - - /** - * Creates a new TweenChain object and adds it to the Tween Manager. - * - * Note: This method will only be available if Tweens have been built into Phaser. - * @param config The TweenChain configuration. - */ - tweenchain(config: Phaser.Types.Tweens.TweenBuilderConfig | object): Phaser.Tweens.TweenChain; - - } - - /** - * Calculates the Transform Matrix of the given Game Object and Camera, factoring in - * the parent matrix if provided. - * - * Note that the object this results contains _references_ to the Transform Matrices, - * not new instances of them. Therefore, you should use their values immediately, or - * copy them to your own matrix, as they will be replaced as soon as another Game - * Object is rendered. - * @param src The Game Object to calculate the transform matrix for. - * @param camera The camera being used to render the Game Object. - * @param parentMatrix The transform matrix of the parent container, if any. - */ - function GetCalcMatrix(src: Phaser.GameObjects.GameObject, camera: Phaser.Cameras.Scene2D.Camera, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.Types.GameObjects.GetCalcMatrixResults; - /** * A Graphics object is a way to draw primitive shapes to your game. Primitives include forms of geometry, such as * Rectangles, Circles, and Polygons. They also include lines, arcs and curves. When you initially create a Graphics @@ -31096,6 +31145,830 @@ declare namespace Phaser { } + /** + * The Shape Game Object is a base class for the various different shapes, such as the Arc, Star or Polygon. + * You cannot add a Shape directly to your Scene, it is meant as a base for your own custom Shape classes. + */ + class Shape extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param type The internal type of the Shape. + * @param data The data of the source shape geometry, if any. + */ + constructor(scene: Phaser.Scene, type?: string, data?: any); + + /** + * The source Shape data. Typically a geometry object. + * You should not manipulate this directly. + */ + readonly geom: any; + + /** + * Holds the polygon path data for filled rendering. + */ + readonly pathData: number[]; + + /** + * Holds the earcut polygon path index data for filled rendering. + */ + readonly pathIndexes: number[]; + + /** + * The fill color used by this Shape. + */ + fillColor: number; + + /** + * The fill alpha value used by this Shape. + */ + fillAlpha: number; + + /** + * The stroke color used by this Shape. + */ + strokeColor: number; + + /** + * The stroke alpha value used by this Shape. + */ + strokeAlpha: number; + + /** + * The stroke line width used by this Shape. + */ + lineWidth: number; + + /** + * Controls if this Shape is filled or not. + * Note that some Shapes do not support being filled (such as Line shapes) + */ + isFilled: boolean; + + /** + * Controls if this Shape is stroked or not. + * Note that some Shapes do not support being stroked (such as Iso Box shapes) + */ + isStroked: boolean; + + /** + * Controls if this Shape path is closed during rendering when stroked. + * Note that some Shapes are always closed when stroked (such as Ellipse shapes) + */ + closePath: boolean; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * Sets the fill color and alpha for this Shape. + * + * If you wish for the Shape to not be filled then call this method with no arguments, or just set `isFilled` to `false`. + * + * Note that some Shapes do not support fill colors, such as the Line shape. + * + * This call can be chained. + * @param color The color used to fill this shape. If not provided the Shape will not be filled. + * @param alpha The alpha value used when filling this shape, if a fill color is given. Default 1. + */ + setFillStyle(color?: number, alpha?: number): this; + + /** + * Sets the stroke color and alpha for this Shape. + * + * If you wish for the Shape to not be stroked then call this method with no arguments, or just set `isStroked` to `false`. + * + * Note that some Shapes do not support being stroked, such as the Iso Box shape. + * + * This call can be chained. + * @param lineWidth The width of line to stroke with. If not provided or undefined the Shape will not be stroked. + * @param color The color used to stroke this shape. If not provided the Shape will not be stroked. + * @param alpha The alpha value used when stroking this shape, if a stroke color is given. Default 1. + */ + setStrokeStyle(lineWidth?: number, color?: number, alpha?: number): this; + + /** + * Sets if this Shape path is closed during rendering when stroked. + * Note that some Shapes are always closed when stroked (such as Ellipse shapes) + * + * This call can be chained. + * @param value Set to `true` if the Shape should be closed when stroked, otherwise `false`. + */ + setClosePath(value: boolean): this; + + /** + * Sets the display size of this Shape. + * + * Calling this will adjust the scale. + * @param width The display width of this Shape. + * @param height The display height of this Shape. + */ + setDisplaySize(width: number, height: number): this; + + /** + * Internal destroy handler, called as part of the destroy process. + */ + protected preDestroy(): void; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * @param value The alpha value applied across the whole Game Object. Default 1. + */ + setAlpha(value?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The default depth is zero. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The default depth is zero. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. + */ + setDepth(value: number): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object, or any kind of Shape Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics | Phaser.GameObjects.Shape): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Does this Game Object have any Post Pipelines set? + */ + hasPostPipeline: boolean; + + /** + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. + */ + postPipelines: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also set the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a type of Post Pipeline instances from this Game Object, based on the given name, and destroys them. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * A property indicating that a Game Object has this component. + */ + readonly hasTransformComponent: boolean; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * + * Note: The z position does not control the rendering order of 2D Game Objects. Use + * {@link Phaser.GameObjects.Components.Depth#depth} instead. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left + * and -90 is up. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: number; + + /** + * The angle of this Game Object in radians. + * + * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left + * and -PI/2 is up. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * + * Note: The z position does not control the rendering order of 2D Game Objects. Use + * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + /** * The Arc Shape is a Game Object that can be added to a Scene, Group or Container. You can * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling @@ -37738,830 +38611,6 @@ declare namespace Phaser { } - /** - * The Shape Game Object is a base class for the various different shapes, such as the Arc, Star or Polygon. - * You cannot add a Shape directly to your Scene, it is meant as a base for your own custom Shape classes. - */ - class Shape extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { - /** - * - * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. - * @param type The internal type of the Shape. - * @param data The data of the source shape geometry, if any. - */ - constructor(scene: Phaser.Scene, type?: string, data?: any); - - /** - * The source Shape data. Typically a geometry object. - * You should not manipulate this directly. - */ - readonly geom: any; - - /** - * Holds the polygon path data for filled rendering. - */ - readonly pathData: number[]; - - /** - * Holds the earcut polygon path index data for filled rendering. - */ - readonly pathIndexes: number[]; - - /** - * The fill color used by this Shape. - */ - fillColor: number; - - /** - * The fill alpha value used by this Shape. - */ - fillAlpha: number; - - /** - * The stroke color used by this Shape. - */ - strokeColor: number; - - /** - * The stroke alpha value used by this Shape. - */ - strokeAlpha: number; - - /** - * The stroke line width used by this Shape. - */ - lineWidth: number; - - /** - * Controls if this Shape is filled or not. - * Note that some Shapes do not support being filled (such as Line shapes) - */ - isFilled: boolean; - - /** - * Controls if this Shape is stroked or not. - * Note that some Shapes do not support being stroked (such as Iso Box shapes) - */ - isStroked: boolean; - - /** - * Controls if this Shape path is closed during rendering when stroked. - * Note that some Shapes are always closed when stroked (such as Ellipse shapes) - */ - closePath: boolean; - - /** - * The native (un-scaled) width of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayWidth` property. - */ - width: number; - - /** - * The native (un-scaled) height of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayHeight` property. - */ - height: number; - - /** - * Sets the fill color and alpha for this Shape. - * - * If you wish for the Shape to not be filled then call this method with no arguments, or just set `isFilled` to `false`. - * - * Note that some Shapes do not support fill colors, such as the Line shape. - * - * This call can be chained. - * @param color The color used to fill this shape. If not provided the Shape will not be filled. - * @param alpha The alpha value used when filling this shape, if a fill color is given. Default 1. - */ - setFillStyle(color?: number, alpha?: number): this; - - /** - * Sets the stroke color and alpha for this Shape. - * - * If you wish for the Shape to not be stroked then call this method with no arguments, or just set `isStroked` to `false`. - * - * Note that some Shapes do not support being stroked, such as the Iso Box shape. - * - * This call can be chained. - * @param lineWidth The width of line to stroke with. If not provided or undefined the Shape will not be stroked. - * @param color The color used to stroke this shape. If not provided the Shape will not be stroked. - * @param alpha The alpha value used when stroking this shape, if a stroke color is given. Default 1. - */ - setStrokeStyle(lineWidth?: number, color?: number, alpha?: number): this; - - /** - * Sets if this Shape path is closed during rendering when stroked. - * Note that some Shapes are always closed when stroked (such as Ellipse shapes) - * - * This call can be chained. - * @param value Set to `true` if the Shape should be closed when stroked, otherwise `false`. - */ - setClosePath(value: boolean): this; - - /** - * Sets the display size of this Shape. - * - * Calling this will adjust the scale. - * @param width The display width of this Shape. - * @param height The display height of this Shape. - */ - setDisplaySize(width: number, height: number): this; - - /** - * Internal destroy handler, called as part of the destroy process. - */ - protected preDestroy(): void; - - /** - * The displayed width of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - */ - displayWidth: number; - - /** - * The displayed height of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - */ - displayHeight: number; - - /** - * Clears all alpha values associated with this Game Object. - * - * Immediately sets the alpha levels back to 1 (fully opaque). - */ - clearAlpha(): this; - - /** - * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. - * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * @param value The alpha value applied across the whole Game Object. Default 1. - */ - setAlpha(value?: number): this; - - /** - * The alpha value of the Game Object. - * - * This is a global value, impacting the entire Game Object, not just a region of it. - */ - alpha: number; - - /** - * Sets the Blend Mode being used by this Game Object. - * - * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * - * Under WebGL only the following Blend Modes are available: - * - * * ADD - * * MULTIPLY - * * SCREEN - * * ERASE - * - * Canvas has more available depending on browser support. - * - * You can also create your own custom Blend Modes in WebGL. - * - * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending - * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these - * reasons try to be careful about the construction of your Scene and the frequency of which blend modes - * are used. - */ - blendMode: Phaser.BlendModes | string; - - /** - * Sets the Blend Mode being used by this Game Object. - * - * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * - * Under WebGL only the following Blend Modes are available: - * - * * ADD - * * MULTIPLY - * * SCREEN - * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * - * Canvas has more available depending on browser support. - * - * You can also create your own custom Blend Modes in WebGL. - * - * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending - * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these - * reasons try to be careful about the construction of your Scene and the frequency in which blend modes - * are used. - * @param value The BlendMode value. Either a string or a CONST. - */ - setBlendMode(value: string | Phaser.BlendModes): this; - - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * The depth of this Game Object within the Scene. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - */ - setDepth(value: number): this; - - /** - * Gets the center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * @param output An object to store the values in. If not provided a new Vector2 will be created. - */ - getCenter(output?: O): O; - - /** - * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - */ - getTopLeft(output?: O, includeParent?: boolean): O; - - /** - * Gets the top-center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - */ - getTopCenter(output?: O, includeParent?: boolean): O; - - /** - * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - */ - getTopRight(output?: O, includeParent?: boolean): O; - - /** - * Gets the left-center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - */ - getLeftCenter(output?: O, includeParent?: boolean): O; - - /** - * Gets the right-center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - */ - getRightCenter(output?: O, includeParent?: boolean): O; - - /** - * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - */ - getBottomLeft(output?: O, includeParent?: boolean): O; - - /** - * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - */ - getBottomCenter(output?: O, includeParent?: boolean): O; - - /** - * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - */ - getBottomRight(output?: O, includeParent?: boolean): O; - - /** - * Gets the bounds of this Game Object, regardless of origin. - * The values are stored and returned in a Rectangle, or Rectangle-like, object. - * @param output An object to store the values in. If not provided a new Rectangle will be created. - */ - getBounds(output?: O): O; - - /** - * The Mask this Game Object is using during render. - */ - mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; - - /** - * Sets the mask that this Game Object will use to render with. - * - * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. - * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. - * - * If a mask is already set on this Game Object it will be immediately replaced. - * - * Masks are positioned in global space and are not relative to the Game Object to which they - * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * - * Masks have no impact on physics or input detection. They are purely a rendering component - * that allows you to limit what is visible during the render pass. - * @param mask The mask this Game Object will use when rendering. - */ - setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; - - /** - * Clears the mask that this Game Object was using. - * @param destroyMask Destroy the mask before clearing it? Default false. - */ - clearMask(destroyMask?: boolean): this; - - /** - * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, - * including this one. - * - * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. - * - * To create the mask you need to pass in a reference to a renderable Game Object. - * A renderable Game Object is one that uses a texture to render with, such as an - * Image, Sprite, Render Texture or BitmapText. - * - * If you do not provide a renderable object, and this Game Object has a texture, - * it will use itself as the object. This means you can call this method to create - * a Bitmap Mask from any renderable Game Object. - * @param renderable A renderable Game Object that uses a texture, such as a Sprite. - */ - createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; - - /** - * Creates and returns a Geometry Mask. This mask can be used by any Game Object, - * including this one. - * - * To create the mask you need to pass in a reference to a Graphics Game Object. - * - * If you do not provide a graphics object, and this Game Object is an instance - * of a Graphics object, then it will use itself to create the mask. - * - * This means you can call this method to create a Geometry Mask from any Graphics Game Object. - * @param graphics A Graphics Game Object, or any kind of Shape Game Object. The geometry within it will be used as the mask. - */ - createGeometryMask(graphics?: Phaser.GameObjects.Graphics | Phaser.GameObjects.Shape): Phaser.Display.Masks.GeometryMask; - - /** - * The horizontal origin of this Game Object. - * The origin maps the relationship between the size and position of the Game Object. - * The default value is 0.5, meaning all Game Objects are positioned based on their center. - * Setting the value to 0 means the position now relates to the left of the Game Object. - */ - originX: number; - - /** - * The vertical origin of this Game Object. - * The origin maps the relationship between the size and position of the Game Object. - * The default value is 0.5, meaning all Game Objects are positioned based on their center. - * Setting the value to 0 means the position now relates to the top of the Game Object. - */ - originY: number; - - /** - * The horizontal display origin of this Game Object. - * The origin is a normalized value between 0 and 1. - * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. - */ - displayOriginX: number; - - /** - * The vertical display origin of this Game Object. - * The origin is a normalized value between 0 and 1. - * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. - */ - displayOriginY: number; - - /** - * Sets the origin of this Game Object. - * - * The values are given in the range 0 to 1. - * @param x The horizontal origin value. Default 0.5. - * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. - */ - setOrigin(x?: number, y?: number): this; - - /** - * Sets the origin of this Game Object based on the Pivot values in its Frame. - */ - setOriginFromFrame(): this; - - /** - * Sets the display origin of this Game Object. - * The difference between this and setting the origin is that you can use pixel values for setting the display origin. - * @param x The horizontal display origin value. Default 0. - * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. - */ - setDisplayOrigin(x?: number, y?: number): this; - - /** - * Updates the Display Origin cached values internally stored on this Game Object. - * You don't usually call this directly, but it is exposed for edge-cases where you may. - */ - updateDisplayOrigin(): this; - - /** - * The initial WebGL pipeline of this Game Object. - * - * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. - */ - defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; - - /** - * The current WebGL pipeline of this Game Object. - */ - pipeline: Phaser.Renderer.WebGL.WebGLPipeline; - - /** - * Does this Game Object have any Post Pipelines set? - */ - hasPostPipeline: boolean; - - /** - * The WebGL Post FX Pipelines this Game Object uses for post-render effects. - * - * The pipelines are processed in the order in which they appear in this array. - * - * If you modify this array directly, be sure to set the - * `hasPostPipeline` property accordingly. - */ - postPipelines: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; - - /** - * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. - */ - pipelineData: object; - - /** - * Sets the initial WebGL Pipeline of this Game Object. - * - * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. - * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. - */ - initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; - - /** - * Sets the main WebGL Pipeline of this Game Object. - * - * Also sets the `pipelineData` property, if the parameter is given. - * - * Both the pipeline and post pipelines share the same pipeline data object. - * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. - * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. - * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. - */ - setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; - - /** - * Sets one, or more, Post Pipelines on this Game Object. - * - * Post Pipelines are invoked after this Game Object has rendered to its target and - * are commonly used for post-fx. - * - * The post pipelines are appended to the `postPipelines` array belonging to this - * Game Object. When the renderer processes this Game Object, it iterates through the post - * pipelines in the order in which they appear in the array. If you are stacking together - * multiple effects, be aware that the order is important. - * - * If you call this method multiple times, the new pipelines will be appended to any existing - * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. - * - * You can optionally also set the `pipelineData` property, if the parameter is given. - * - * Both the pipeline and post pipelines share the pipeline data object together. - * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. - * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. - * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. - */ - setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; - - /** - * Adds an entry to the `pipelineData` object belonging to this Game Object. - * - * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. - * - * If `value` is undefined, and `key` exists, `key` is removed from the data object. - * - * Both the pipeline and post pipelines share the pipeline data object together. - * @param key The key of the pipeline data to set, update, or delete. - * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. - */ - setPipelineData(key: string, value?: any): this; - - /** - * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. - * @param pipeline The string-based name of the pipeline, or a pipeline class. - */ - getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; - - /** - * Resets the WebGL Pipeline of this Game Object back to the default it was created with. - * @param resetPostPipelines Reset all of the post pipelines? Default false. - * @param resetData Reset the `pipelineData` object to being an empty object? Default false. - */ - resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; - - /** - * Resets the WebGL Post Pipelines of this Game Object. It does this by calling - * the `destroy` method on each post pipeline and then clearing the local array. - * @param resetData Reset the `pipelineData` object to being an empty object? Default false. - */ - resetPostPipeline(resetData?: boolean): void; - - /** - * Removes a type of Post Pipeline instances from this Game Object, based on the given name, and destroys them. - * - * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. - * @param pipeline The string-based name of the pipeline, or a pipeline class. - */ - removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; - - /** - * Gets the name of the WebGL Pipeline this Game Object is currently using. - */ - getPipelineName(): string; - - /** - * The horizontal scroll factor of this Game Object. - * - * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * - * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. - * It does not change the Game Objects actual position values. - * - * A value of 1 means it will move exactly in sync with a camera. - * A value of 0 means it will not move at all, even if the camera moves. - * Other values control the degree to which the camera movement is mapped to this Game Object. - * - * Please be aware that scroll factor values other than 1 are not taken in to consideration when - * calculating physics collisions. Bodies always collide based on their world position, but changing - * the scroll factor is a visual adjustment to where the textures are rendered, which can offset - * them from physics bodies if not accounted for in your code. - */ - scrollFactorX: number; - - /** - * The vertical scroll factor of this Game Object. - * - * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * - * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. - * It does not change the Game Objects actual position values. - * - * A value of 1 means it will move exactly in sync with a camera. - * A value of 0 means it will not move at all, even if the camera moves. - * Other values control the degree to which the camera movement is mapped to this Game Object. - * - * Please be aware that scroll factor values other than 1 are not taken in to consideration when - * calculating physics collisions. Bodies always collide based on their world position, but changing - * the scroll factor is a visual adjustment to where the textures are rendered, which can offset - * them from physics bodies if not accounted for in your code. - */ - scrollFactorY: number; - - /** - * Sets the scroll factor of this Game Object. - * - * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * - * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. - * It does not change the Game Objects actual position values. - * - * A value of 1 means it will move exactly in sync with a camera. - * A value of 0 means it will not move at all, even if the camera moves. - * Other values control the degree to which the camera movement is mapped to this Game Object. - * - * Please be aware that scroll factor values other than 1 are not taken in to consideration when - * calculating physics collisions. Bodies always collide based on their world position, but changing - * the scroll factor is a visual adjustment to where the textures are rendered, which can offset - * them from physics bodies if not accounted for in your code. - * @param x The horizontal scroll factor of this Game Object. - * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. - */ - setScrollFactor(x: number, y?: number): this; - - /** - * A property indicating that a Game Object has this component. - */ - readonly hasTransformComponent: boolean; - - /** - * The x position of this Game Object. - */ - x: number; - - /** - * The y position of this Game Object. - */ - y: number; - - /** - * The z position of this Game Object. - * - * Note: The z position does not control the rendering order of 2D Game Objects. Use - * {@link Phaser.GameObjects.Components.Depth#depth} instead. - */ - z: number; - - /** - * The w position of this Game Object. - */ - w: number; - - /** - * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object - * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * - * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this - * isn't the case, use the `scaleX` or `scaleY` properties instead. - */ - scale: number; - - /** - * The horizontal scale of this Game Object. - */ - scaleX: number; - - /** - * The vertical scale of this Game Object. - */ - scaleY: number; - - /** - * The angle of this Game Object as expressed in degrees. - * - * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left - * and -90 is up. - * - * If you prefer to work in radians, see the `rotation` property instead. - */ - angle: number; - - /** - * The angle of this Game Object in radians. - * - * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left - * and -PI/2 is up. - * - * If you prefer to work in degrees, see the `angle` property instead. - */ - rotation: number; - - /** - * Sets the position of this Game Object. - * @param x The x position of this Game Object. Default 0. - * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. - * @param z The z position of this Game Object. Default 0. - * @param w The w position of this Game Object. Default 0. - */ - setPosition(x?: number, y?: number, z?: number, w?: number): this; - - /** - * Copies an object's coordinates to this Game Object's position. - * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. - */ - copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; - - /** - * Sets the position of this Game Object to be a random position within the confines of - * the given area. - * - * If no area is specified a random position between 0 x 0 and the game width x height is used instead. - * - * The position does not factor in the size of this Game Object, meaning that only the origin is - * guaranteed to be within the area. - * @param x The x position of the top-left of the random area. Default 0. - * @param y The y position of the top-left of the random area. Default 0. - * @param width The width of the random area. - * @param height The height of the random area. - */ - setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; - - /** - * Sets the rotation of this Game Object. - * @param radians The rotation of this Game Object, in radians. Default 0. - */ - setRotation(radians?: number): this; - - /** - * Sets the angle of this Game Object. - * @param degrees The rotation of this Game Object, in degrees. Default 0. - */ - setAngle(degrees?: number): this; - - /** - * Sets the scale of this Game Object. - * @param x The horizontal scale of this Game Object. - * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. - */ - setScale(x: number, y?: number): this; - - /** - * Sets the x position of this Game Object. - * @param value The x position of this Game Object. Default 0. - */ - setX(value?: number): this; - - /** - * Sets the y position of this Game Object. - * @param value The y position of this Game Object. Default 0. - */ - setY(value?: number): this; - - /** - * Sets the z position of this Game Object. - * - * Note: The z position does not control the rendering order of 2D Game Objects. Use - * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. - * @param value The z position of this Game Object. Default 0. - */ - setZ(value?: number): this; - - /** - * Sets the w position of this Game Object. - * @param value The w position of this Game Object. Default 0. - */ - setW(value?: number): this; - - /** - * Gets the local transform matrix for this Game Object. - * @param tempMatrix The matrix to populate with the values from this Game Object. - */ - getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; - - /** - * Gets the world transform matrix for this Game Object, factoring in any parent Containers. - * @param tempMatrix The matrix to populate with the values from this Game Object. - * @param parentMatrix A temporary matrix to hold parent values during the calculations. - */ - getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; - - /** - * Takes the given `x` and `y` coordinates and converts them into local space for this - * Game Object, taking into account parent and local transforms, and the Display Origin. - * - * The returned Vector2 contains the translated point in its properties. - * - * A Camera needs to be provided in order to handle modified scroll factors. If no - * camera is specified, it will use the `main` camera from the Scene to which this - * Game Object belongs. - * @param x The x position to translate. - * @param y The y position to translate. - * @param point A Vector2, or point-like object, to store the results in. - * @param camera The Camera which is being tested against. If not given will use the Scene default camera. - */ - getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; - - /** - * Gets the sum total rotation of all of this Game Objects parent Containers. - * - * The returned value is in radians and will be zero if this Game Object has no parent container. - */ - getParentRotation(): number; - - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - */ - setVisible(value: boolean): this; - - } - /** * The Star Shape is a Game Object that can be added to a Scene, Group or Container. You can * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling @@ -44279,55 +44328,6 @@ declare namespace Phaser { } - /** - * The Update List plugin. - * - * Update Lists belong to a Scene and maintain the list Game Objects to be updated every frame. - * - * Some or all of these Game Objects may also be part of the Scene's [Display List]{@link Phaser.GameObjects.DisplayList}, for Rendering. - */ - class UpdateList extends Phaser.Structs.ProcessQueue { - /** - * - * @param scene The Scene that the Update List belongs to. - */ - constructor(scene: Phaser.Scene); - - /** - * The Scene that the Update List belongs to. - */ - scene: Phaser.Scene; - - /** - * The Scene's Systems. - */ - systems: Phaser.Scenes.Systems; - - /** - * The update step. - * - * Pre-updates every active Game Object in the list. - * @param time The current timestamp. - * @param delta The delta time elapsed since the last frame. - */ - sceneUpdate(time: number, delta: number): void; - - /** - * The Scene that owns this plugin is shutting down. - * - * We need to kill and reset all internal properties as well as stop listening to Scene events. - */ - shutdown(): void; - - /** - * The Scene that owns this plugin is being destroyed. - * - * We need to shutdown and then kill off all external references. - */ - destroy(): void; - - } - /** * A Video Game Object. * @@ -49158,6 +49158,1343 @@ declare namespace Phaser { } namespace Input { + /** + * Creates a new Interactive Object. + * + * This is called automatically by the Input Manager when you enable a Game Object for input. + * + * The resulting Interactive Object is mapped to the Game Object's `input` property. + * @param gameObject The Game Object to which this Interactive Object is bound. + * @param hitArea The hit area for this Interactive Object. Typically a geometry shape, like a Rectangle or Circle. + * @param hitAreaCallback The 'contains' check callback that the hit area shape will use for all hit tests. + */ + function CreateInteractiveObject(gameObject: Phaser.GameObjects.GameObject, hitArea: any, hitAreaCallback: Phaser.Types.Input.HitAreaCallback): Phaser.Types.Input.InteractiveObject; + + /** + * Creates a new Pixel Perfect Handler function. + * + * Access via `InputPlugin.makePixelPerfect` rather than calling it directly. + * @param textureManager A reference to the Texture Manager. + * @param alphaTolerance The alpha level that the pixel should be above to be included as a successful interaction. + */ + function CreatePixelPerfectHandler(textureManager: Phaser.Textures.TextureManager, alphaTolerance: number): Function; + + /** + * The Input Manager is responsible for handling the pointer related systems in a single Phaser Game instance. + * + * Based on the Game Config it will create handlers for mouse and touch support. + * + * Keyboard and Gamepad are plugins, handled directly by the InputPlugin class. + * + * It then manages the events, pointer creation and general hit test related operations. + * + * You rarely need to interact with the Input Manager directly, and as such, all of its properties and methods + * should be considered private. Instead, you should use the Input Plugin, which is a Scene level system, responsible + * for dealing with all input events for a Scene. + */ + class InputManager { + /** + * + * @param game The Game instance that owns the Input Manager. + * @param config The Input Configuration object, as set in the Game Config. + */ + constructor(game: Phaser.Game, config: object); + + /** + * The Game instance that owns the Input Manager. + * A Game only maintains on instance of the Input Manager at any time. + */ + readonly game: Phaser.Game; + + /** + * A reference to the global Game Scale Manager. + * Used for all bounds checks and pointer scaling. + */ + scaleManager: Phaser.Scale.ScaleManager; + + /** + * The Canvas that is used for all DOM event input listeners. + */ + canvas: HTMLCanvasElement; + + /** + * The Game Configuration object, as set during the game boot. + */ + config: Phaser.Core.Config; + + /** + * If set, the Input Manager will run its update loop every frame. + */ + enabled: boolean; + + /** + * The Event Emitter instance that the Input Manager uses to emit events from. + */ + events: Phaser.Events.EventEmitter; + + /** + * Are any mouse or touch pointers currently over the game canvas? + * This is updated automatically by the canvas over and out handlers. + */ + readonly isOver: boolean; + + /** + * The default CSS cursor to be used when interacting with your game. + * + * See the `setDefaultCursor` method for more details. + */ + defaultCursor: string; + + /** + * A reference to the Keyboard Manager class, if enabled via the `input.keyboard` Game Config property. + */ + keyboard: Phaser.Input.Keyboard.KeyboardManager | null; + + /** + * A reference to the Mouse Manager class, if enabled via the `input.mouse` Game Config property. + */ + mouse: Phaser.Input.Mouse.MouseManager | null; + + /** + * A reference to the Touch Manager class, if enabled via the `input.touch` Game Config property. + */ + touch: Phaser.Input.Touch.TouchManager; + + /** + * An array of Pointers that have been added to the game. + * The first entry is reserved for the Mouse Pointer, the rest are Touch Pointers. + * + * By default there is 1 touch pointer enabled. If you need more use the `addPointer` method to start them, + * or set the `input.activePointers` property in the Game Config. + */ + pointers: Phaser.Input.Pointer[]; + + /** + * The number of touch objects activated and being processed each update. + * + * You can change this by either calling `addPointer` at run-time, or by + * setting the `input.activePointers` property in the Game Config. + */ + readonly pointersTotal: number; + + /** + * The mouse has its own unique Pointer object, which you can reference directly if making a _desktop specific game_. + * If you are supporting both desktop and touch devices then do not use this property, instead use `activePointer` + * which will always map to the most recently interacted pointer. + */ + mousePointer: Phaser.Input.Pointer | null; + + /** + * The most recently active Pointer object. + * + * If you've only 1 Pointer in your game then this will accurately be either the first finger touched, or the mouse. + * + * If your game doesn't need to support multi-touch then you can safely use this property in all of your game + * code and it will adapt to be either the mouse or the touch, based on device. + */ + activePointer: Phaser.Input.Pointer; + + /** + * If the top-most Scene in the Scene List receives an input it will stop input from + * propagating any lower down the scene list, i.e. if you have a UI Scene at the top + * and click something on it, that click will not then be passed down to any other + * Scene below. Disable this to have input events passed through all Scenes, all the time. + */ + globalTopOnly: boolean; + + /** + * The time this Input Manager was last updated. + * This value is populated by the Game Step each frame. + */ + readonly time: number; + + /** + * The Boot handler is called by Phaser.Game when it first starts up. + * The renderer is available by now. + */ + protected boot(): void; + + /** + * Tells the Input system to set a custom cursor. + * + * This cursor will be the default cursor used when interacting with the game canvas. + * + * If an Interactive Object also sets a custom cursor, this is the cursor that is reset after its use. + * + * Any valid CSS cursor value is allowed, including paths to image files, i.e.: + * + * ```javascript + * this.input.setDefaultCursor('url(assets/cursors/sword.cur), pointer'); + * ``` + * + * Please read about the differences between browsers when it comes to the file formats and sizes they support: + * + * https://developer.mozilla.org/en-US/docs/Web/CSS/cursor + * https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_User_Interface/Using_URL_values_for_the_cursor_property + * + * It's up to you to pick a suitable cursor format that works across the range of browsers you need to support. + * @param cursor The CSS to be used when setting the default cursor. + */ + setDefaultCursor(cursor: string): void; + + /** + * Adds new Pointer objects to the Input Manager. + * + * By default Phaser creates 2 pointer objects: `mousePointer` and `pointer1`. + * + * You can create more either by calling this method, or by setting the `input.activePointers` property + * in the Game Config, up to a maximum of 10 pointers. + * + * The first 10 pointers are available via the `InputPlugin.pointerX` properties, once they have been added + * via this method. + * @param quantity The number of new Pointers to create. A maximum of 10 is allowed in total. Default 1. + */ + addPointer(quantity?: number): Phaser.Input.Pointer[]; + + /** + * Internal method that gets a list of all the active Input Plugins in the game + * and updates each of them in turn, in reverse order (top to bottom), to allow + * for DOM top-level event handling simulation. + * @param type The type of event to process. + * @param pointers An array of Pointers on which the event occurred. + */ + updateInputPlugins(type: number, pointers: Phaser.Input.Pointer[]): void; + + /** + * Performs a hit test using the given Pointer and camera, against an array of interactive Game Objects. + * + * The Game Objects are culled against the camera, and then the coordinates are translated into the local camera space + * and used to determine if they fall within the remaining Game Objects hit areas or not. + * + * If nothing is matched an empty array is returned. + * + * This method is called automatically by InputPlugin.hitTestPointer and doesn't usually need to be invoked directly. + * @param pointer The Pointer to test against. + * @param gameObjects An array of interactive Game Objects to check. + * @param camera The Camera which is being tested against. + * @param output An array to store the results in. If not given, a new empty array is created. + */ + hitTest(pointer: Phaser.Input.Pointer, gameObjects: any[], camera: Phaser.Cameras.Scene2D.Camera, output?: any[]): any[]; + + /** + * Checks if the given x and y coordinate are within the hit area of the Game Object. + * + * This method assumes that the coordinate values have already been translated into the space of the Game Object. + * + * If the coordinates are within the hit area they are set into the Game Objects Input `localX` and `localY` properties. + * @param gameObject The interactive Game Object to check against. + * @param x The translated x coordinate for the hit test. + * @param y The translated y coordinate for the hit test. + */ + pointWithinHitArea(gameObject: Phaser.GameObjects.GameObject, x: number, y: number): boolean; + + /** + * Checks if the given x and y coordinate are within the hit area of the Interactive Object. + * + * This method assumes that the coordinate values have already been translated into the space of the Interactive Object. + * + * If the coordinates are within the hit area they are set into the Interactive Objects Input `localX` and `localY` properties. + * @param object The Interactive Object to check against. + * @param x The translated x coordinate for the hit test. + * @param y The translated y coordinate for the hit test. + */ + pointWithinInteractiveObject(object: Phaser.Types.Input.InteractiveObject, x: number, y: number): boolean; + + /** + * Transforms the pageX and pageY values of a Pointer into the scaled coordinate space of the Input Manager. + * @param pointer The Pointer to transform the values for. + * @param pageX The Page X value. + * @param pageY The Page Y value. + * @param wasMove Are we transforming the Pointer from a move event, or an up / down event? + */ + transformPointer(pointer: Phaser.Input.Pointer, pageX: number, pageY: number, wasMove: boolean): void; + + /** + * Destroys the Input Manager and all of its systems. + * + * There is no way to recover from doing this. + */ + destroy(): void; + + } + + /** + * The Input Plugin belongs to a Scene and handles all input related events and operations for it. + * + * You can access it from within a Scene using `this.input`. + * + * It emits events directly. For example, you can do: + * + * ```javascript + * this.input.on('pointerdown', callback, context); + * ``` + * + * To listen for a pointer down event anywhere on the game canvas. + * + * Game Objects can be enabled for input by calling their `setInteractive` method. After which they + * will directly emit input events: + * + * ```javascript + * var sprite = this.add.sprite(x, y, texture); + * sprite.setInteractive(); + * sprite.on('pointerdown', callback, context); + * ``` + * + * There are lots of game configuration options available relating to input. + * See the [Input Config object]{@linkcode Phaser.Types.Core.InputConfig} for more details, including how to deal with Phaser + * listening for input events outside of the canvas, how to set a default number of pointers, input + * capture settings and more. + * + * Please also see the Input examples and tutorials for further information. + * + * **Incorrect input coordinates with Angular** + * + * If you are using Phaser within Angular, and use nglf or the router, to make the component in which the Phaser game resides + * change state (i.e. appear or disappear) then you'll need to notify the Scale Manager about this, as Angular will mess with + * the DOM in a way in which Phaser can't detect directly. Call `this.scale.updateBounds()` as part of your game init in order + * to refresh the canvas DOM bounds values, which Phaser uses for input point position calculations. + */ + class InputPlugin extends Phaser.Events.EventEmitter { + /** + * + * @param scene A reference to the Scene that this Input Plugin is responsible for. + */ + constructor(scene: Phaser.Scene); + + /** + * A reference to the Scene that this Input Plugin is responsible for. + */ + scene: Phaser.Scene; + + /** + * A reference to the Scene Systems class. + */ + systems: Phaser.Scenes.Systems; + + /** + * A reference to the Scene Systems Settings. + */ + settings: Phaser.Types.Scenes.SettingsObject; + + /** + * A reference to the Game Input Manager. + */ + manager: Phaser.Input.InputManager; + + /** + * If `true` this Input Plugin will process DOM input events. + */ + enabled: boolean; + + /** + * A reference to the Scene Display List. This property is set during the `boot` method. + */ + displayList: Phaser.GameObjects.DisplayList; + + /** + * A reference to the Scene Cameras Manager. This property is set during the `boot` method. + */ + cameras: Phaser.Cameras.Scene2D.CameraManager; + + /** + * A reference to the Mouse Manager. + * + * This property is only set if Mouse support has been enabled in your Game Configuration file. + * + * If you just wish to get access to the mouse pointer, use the `mousePointer` property instead. + */ + mouse: Phaser.Input.Mouse.MouseManager | null; + + /** + * When set to `true` (the default) the Input Plugin will emulate DOM behavior by only emitting events from + * the top-most Game Objects in the Display List. + * + * If set to `false` it will emit events from all Game Objects below a Pointer, not just the top one. + */ + topOnly: boolean; + + /** + * How often should the Pointers be checked? + * + * The value is a time, given in ms, and is the time that must have elapsed between game steps before + * the Pointers will be polled again. When a pointer is polled it runs a hit test to see which Game + * Objects are currently below it, or being interacted with it. + * + * Pointers will *always* be checked if they have been moved by the user, or press or released. + * + * This property only controls how often they will be polled if they have not been updated. + * You should set this if you want to have Game Objects constantly check against the pointers, even + * if the pointer didn't itself move. + * + * Set to 0 to poll constantly. Set to -1 to only poll on user movement. + */ + pollRate: number; + + /** + * The distance, in pixels, a pointer has to move while being held down, before it thinks it is being dragged. + */ + dragDistanceThreshold: number; + + /** + * The amount of time, in ms, a pointer has to be held down before it thinks it is dragging. + * + * The default polling rate is to poll only on move so once the time threshold is reached the + * drag event will not start until you move the mouse. If you want it to start immediately + * when the time threshold is reached, you must increase the polling rate by calling + * [setPollAlways]{@linkcode Phaser.Input.InputPlugin#setPollAlways} or + * [setPollRate]{@linkcode Phaser.Input.InputPlugin#setPollRate}. + */ + dragTimeThreshold: number; + + /** + * Checks to see if both this plugin and the Scene to which it belongs is active. + */ + isActive(): boolean; + + /** + * This is called automatically by the Input Manager. + * It emits events for plugins to listen to and also handles polling updates, if enabled. + * @param time The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + updatePoll(time: number, delta: number): boolean; + + /** + * Clears a Game Object so it no longer has an Interactive Object associated with it. + * The Game Object is then queued for removal from the Input Plugin on the next update. + * @param gameObject The Game Object that will have its Interactive Object removed. + * @param skipQueue Skip adding this Game Object into the removal queue? Default false. + */ + clear(gameObject: Phaser.GameObjects.GameObject, skipQueue?: boolean): Phaser.GameObjects.GameObject; + + /** + * Disables Input on a single Game Object. + * + * An input disabled Game Object still retains its Interactive Object component and can be re-enabled + * at any time, by passing it to `InputPlugin.enable`. + * @param gameObject The Game Object to have its input system disabled. + */ + disable(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Enable a Game Object for interaction. + * + * If the Game Object already has an Interactive Object component, it is enabled and returned. + * + * Otherwise, a new Interactive Object component is created and assigned to the Game Object's `input` property. + * + * Input works by using hit areas, these are nearly always geometric shapes, such as rectangles or circles, that act as the hit area + * for the Game Object. However, you can provide your own hit area shape and callback, should you wish to handle some more advanced + * input detection. + * + * If no arguments are provided it will try and create a rectangle hit area based on the texture frame the Game Object is using. If + * this isn't a texture-bound object, such as a Graphics or BitmapText object, this will fail, and you'll need to provide a specific + * shape for it to use. + * + * You can also provide an Input Configuration Object as the only argument to this method. + * @param gameObject The Game Object to be enabled for input. + * @param hitArea Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used. + * @param hitAreaCallback The 'contains' function to invoke to check if the pointer is within the hit area. + * @param dropZone Is this Game Object a drop zone or not? Default false. + */ + enable(gameObject: Phaser.GameObjects.GameObject, hitArea?: Phaser.Types.Input.InputConfiguration | any, hitAreaCallback?: Phaser.Types.Input.HitAreaCallback, dropZone?: boolean): this; + + /** + * Takes the given Pointer and performs a hit test against it, to see which interactive Game Objects + * it is currently above. + * + * The hit test is performed against which-ever Camera the Pointer is over. If it is over multiple + * cameras, it starts checking the camera at the top of the camera list, and if nothing is found, iterates down the list. + * @param pointer The Pointer to check against the Game Objects. + */ + hitTestPointer(pointer: Phaser.Input.Pointer): Phaser.GameObjects.GameObject[]; + + /** + * Returns the drag state of the given Pointer for this Input Plugin. + * + * The state will be one of the following: + * + * 0 = Not dragging anything + * 1 = Primary button down and objects below, so collect a draglist + * 2 = Pointer being checked if meets drag criteria + * 3 = Pointer meets criteria, notify the draglist + * 4 = Pointer actively dragging the draglist and has moved + * 5 = Pointer actively dragging but has been released, notify draglist + * @param pointer The Pointer to get the drag state for. + */ + getDragState(pointer: Phaser.Input.Pointer): number; + + /** + * Sets the drag state of the given Pointer for this Input Plugin. + * + * The state must be one of the following values: + * + * 0 = Not dragging anything + * 1 = Primary button down and objects below, so collect a draglist + * 2 = Pointer being checked if meets drag criteria + * 3 = Pointer meets criteria, notify the draglist + * 4 = Pointer actively dragging the draglist and has moved + * 5 = Pointer actively dragging but has been released, notify draglist + * @param pointer The Pointer to set the drag state for. + * @param state The drag state value. An integer between 0 and 5. + */ + setDragState(pointer: Phaser.Input.Pointer, state: number): void; + + /** + * Sets the draggable state of the given array of Game Objects. + * + * They can either be set to be draggable, or can have their draggable state removed by passing `false`. + * + * A Game Object will not fire drag events unless it has been specifically enabled for drag. + * @param gameObjects An array of Game Objects to change the draggable state on. + * @param value Set to `true` if the Game Objects should be made draggable, `false` if they should be unset. Default true. + */ + setDraggable(gameObjects: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], value?: boolean): this; + + /** + * Creates a function that can be passed to `setInteractive`, `enable` or `setHitArea` that will handle + * pixel-perfect input detection on an Image or Sprite based Game Object, or any custom class that extends them. + * + * The following will create a sprite that is clickable on any pixel that has an alpha value >= 1. + * + * ```javascript + * this.add.sprite(x, y, key).setInteractive(this.input.makePixelPerfect()); + * ``` + * + * The following will create a sprite that is clickable on any pixel that has an alpha value >= 150. + * + * ```javascript + * this.add.sprite(x, y, key).setInteractive(this.input.makePixelPerfect(150)); + * ``` + * + * Once you have made an Interactive Object pixel perfect it impacts all input related events for it: down, up, + * dragstart, drag, etc. + * + * As a pointer interacts with the Game Object it will constantly poll the texture, extracting a single pixel from + * the given coordinates and checking its color values. This is an expensive process, so should only be enabled on + * Game Objects that really need it. + * + * You cannot make non-texture based Game Objects pixel perfect. So this will not work on Graphics, BitmapText, + * Render Textures, Text, Tilemaps, Containers or Particles. + * @param alphaTolerance The alpha level that the pixel should be above to be included as a successful interaction. Default 1. + */ + makePixelPerfect(alphaTolerance?: number): Function; + + /** + * Sets the hit area for the given array of Game Objects. + * + * A hit area is typically one of the geometric shapes Phaser provides, such as a `Phaser.Geom.Rectangle` + * or `Phaser.Geom.Circle`. However, it can be any object as long as it works with the provided callback. + * + * If no hit area is provided a Rectangle is created based on the size of the Game Object, if possible + * to calculate. + * + * The hit area callback is the function that takes an `x` and `y` coordinate and returns a boolean if + * those values fall within the area of the shape or not. All of the Phaser geometry objects provide this, + * such as `Phaser.Geom.Rectangle.Contains`. + * @param gameObjects An array of Game Objects to set the hit area on. + * @param hitArea Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used. + * @param hitAreaCallback The 'contains' function to invoke to check if the pointer is within the hit area. + */ + setHitArea(gameObjects: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], hitArea?: Phaser.Types.Input.InputConfiguration | any, hitAreaCallback?: Phaser.Types.Input.HitAreaCallback): this; + + /** + * Sets the hit area for an array of Game Objects to be a `Phaser.Geom.Circle` shape, using + * the given coordinates and radius to control its position and size. + * @param gameObjects An array of Game Objects to set as having a circle hit area. + * @param x The center of the circle. + * @param y The center of the circle. + * @param radius The radius of the circle. + * @param callback The hit area callback. If undefined it uses Circle.Contains. + */ + setHitAreaCircle(gameObjects: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], x: number, y: number, radius: number, callback?: Phaser.Types.Input.HitAreaCallback): this; + + /** + * Sets the hit area for an array of Game Objects to be a `Phaser.Geom.Ellipse` shape, using + * the given coordinates and dimensions to control its position and size. + * @param gameObjects An array of Game Objects to set as having an ellipse hit area. + * @param x The center of the ellipse. + * @param y The center of the ellipse. + * @param width The width of the ellipse. + * @param height The height of the ellipse. + * @param callback The hit area callback. If undefined it uses Ellipse.Contains. + */ + setHitAreaEllipse(gameObjects: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], x: number, y: number, width: number, height: number, callback?: Phaser.Types.Input.HitAreaCallback): this; + + /** + * Sets the hit area for an array of Game Objects to be a `Phaser.Geom.Rectangle` shape, using + * the Game Objects texture frame to define the position and size of the hit area. + * @param gameObjects An array of Game Objects to set as having an ellipse hit area. + * @param callback The hit area callback. If undefined it uses Rectangle.Contains. + */ + setHitAreaFromTexture(gameObjects: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], callback?: Phaser.Types.Input.HitAreaCallback): this; + + /** + * Sets the hit area for an array of Game Objects to be a `Phaser.Geom.Rectangle` shape, using + * the given coordinates and dimensions to control its position and size. + * @param gameObjects An array of Game Objects to set as having a rectangular hit area. + * @param x The top-left of the rectangle. + * @param y The top-left of the rectangle. + * @param width The width of the rectangle. + * @param height The height of the rectangle. + * @param callback The hit area callback. If undefined it uses Rectangle.Contains. + */ + setHitAreaRectangle(gameObjects: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], x: number, y: number, width: number, height: number, callback?: Phaser.Types.Input.HitAreaCallback): this; + + /** + * Sets the hit area for an array of Game Objects to be a `Phaser.Geom.Triangle` shape, using + * the given coordinates to control the position of its points. + * @param gameObjects An array of Game Objects to set as having a triangular hit area. + * @param x1 The x coordinate of the first point of the triangle. + * @param y1 The y coordinate of the first point of the triangle. + * @param x2 The x coordinate of the second point of the triangle. + * @param y2 The y coordinate of the second point of the triangle. + * @param x3 The x coordinate of the third point of the triangle. + * @param y3 The y coordinate of the third point of the triangle. + * @param callback The hit area callback. If undefined it uses Triangle.Contains. + */ + setHitAreaTriangle(gameObjects: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, callback?: Phaser.Types.Input.HitAreaCallback): this; + + /** + * Creates an Input Debug Shape for the given Game Object. + * + * The Game Object must have _already_ been enabled for input prior to calling this method. + * + * This is intended to assist you during development and debugging. + * + * Debug Shapes can only be created for Game Objects that are using standard Phaser Geometry for input, + * including: Circle, Ellipse, Line, Polygon, Rectangle and Triangle. + * + * Game Objects that are using their automatic hit areas are using Rectangles by default, so will also work. + * + * The Debug Shape is created and added to the display list and is then kept in sync with the Game Object + * it is connected with. Should you need to modify it yourself, such as to hide it, you can access it via + * the Game Object property: `GameObject.input.hitAreaDebug`. + * + * Calling this method on a Game Object that already has a Debug Shape will first destroy the old shape, + * before creating a new one. If you wish to remove the Debug Shape entirely, you should call the + * method `InputPlugin.removeDebug`. + * + * Note that the debug shape will only show the outline of the input area. If the input test is using a + * pixel perfect check, for example, then this is not displayed. If you are using a custom shape, that + * doesn't extend one of the base Phaser Geometry objects, as your hit area, then this method will not + * work. + * @param gameObject The Game Object to create the input debug shape for. + * @param color The outline color of the debug shape. Default 0x00ff00. + */ + enableDebug(gameObject: Phaser.GameObjects.GameObject, color?: number): this; + + /** + * Removes an Input Debug Shape from the given Game Object. + * + * The shape is destroyed immediately and the `hitAreaDebug` property is set to `null`. + * @param gameObject The Game Object to remove the input debug shape from. + */ + removeDebug(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Sets the Pointers to always poll. + * + * When a pointer is polled it runs a hit test to see which Game Objects are currently below it, + * or being interacted with it, regardless if the Pointer has actually moved or not. + * + * You should enable this if you want objects in your game to fire over / out events, and the objects + * are constantly moving, but the pointer may not have. Polling every frame has additional computation + * costs, especially if there are a large number of interactive objects in your game. + */ + setPollAlways(): this; + + /** + * Sets the Pointers to only poll when they are moved or updated. + * + * When a pointer is polled it runs a hit test to see which Game Objects are currently below it, + * or being interacted with it. + */ + setPollOnMove(): this; + + /** + * Sets the poll rate value. This is the amount of time that should have elapsed before a pointer + * will be polled again. See the `setPollAlways` and `setPollOnMove` methods. + * @param value The amount of time, in ms, that should elapsed before re-polling the pointers. + */ + setPollRate(value: number): this; + + /** + * When set to `true` the global Input Manager will emulate DOM behavior by only emitting events from + * the top-most Scene in the Scene List. By default, if a Scene receives an input event it will then stop the event + * from flowing down to any Scenes below it in the Scene list. To disable this behavior call this method with `false`. + * @param value Set to `true` to stop processing input events on the Scene that receives it, or `false` to let the event continue down the Scene list. + */ + setGlobalTopOnly(value: boolean): this; + + /** + * When set to `true` this Input Plugin will emulate DOM behavior by only emitting events from + * the top-most Game Objects in the Display List. + * + * If set to `false` it will emit events from all Game Objects below a Pointer, not just the top one. + * @param value `true` to only include the top-most Game Object, or `false` to include all Game Objects in a hit test. + */ + setTopOnly(value: boolean): this; + + /** + * Given an array of Game Objects and a Pointer, sort the array and return it, + * so that the objects are in render order with the lowest at the bottom. + * @param gameObjects An array of Game Objects to be sorted. + * @param pointer The Pointer to check against the Game Objects. + */ + sortGameObjects(gameObjects: Phaser.GameObjects.GameObject[], pointer: Phaser.Input.Pointer): Phaser.GameObjects.GameObject[]; + + /** + * Given an array of Drop Zone Game Objects, sort the array and return it, + * so that the objects are in depth index order with the lowest at the bottom. + * @param gameObjects An array of Game Objects to be sorted. + */ + sortDropZones(gameObjects: Phaser.GameObjects.GameObject[]): Phaser.GameObjects.GameObject[]; + + /** + * This method should be called from within an input event handler, such as `pointerdown`. + * + * When called, it stops the Input Manager from allowing _this specific event_ to be processed by any other Scene + * not yet handled in the scene list. + */ + stopPropagation(): this; + + /** + * Adds new Pointer objects to the Input Manager. + * + * By default Phaser creates 2 pointer objects: `mousePointer` and `pointer1`. + * + * You can create more either by calling this method, or by setting the `input.activePointers` property + * in the Game Config, up to a maximum of 10 pointers. + * + * The first 10 pointers are available via the `InputPlugin.pointerX` properties, once they have been added + * via this method. + * @param quantity The number of new Pointers to create. A maximum of 10 is allowed in total. Default 1. + */ + addPointer(quantity?: number): Phaser.Input.Pointer[]; + + /** + * Tells the Input system to set a custom cursor. + * + * This cursor will be the default cursor used when interacting with the game canvas. + * + * If an Interactive Object also sets a custom cursor, this is the cursor that is reset after its use. + * + * Any valid CSS cursor value is allowed, including paths to image files, i.e.: + * + * ```javascript + * this.input.setDefaultCursor('url(assets/cursors/sword.cur), pointer'); + * ``` + * + * Please read about the differences between browsers when it comes to the file formats and sizes they support: + * + * https://developer.mozilla.org/en-US/docs/Web/CSS/cursor + * https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_User_Interface/Using_URL_values_for_the_cursor_property + * + * It's up to you to pick a suitable cursor format that works across the range of browsers you need to support. + * @param cursor The CSS to be used when setting the default cursor. + */ + setDefaultCursor(cursor: string): this; + + /** + * The x coordinates of the ActivePointer based on the first camera in the camera list. + * This is only safe to use if your game has just 1 non-transformed camera and doesn't use multi-touch. + */ + readonly x: number; + + /** + * The y coordinates of the ActivePointer based on the first camera in the camera list. + * This is only safe to use if your game has just 1 non-transformed camera and doesn't use multi-touch. + */ + readonly y: number; + + /** + * Are any mouse or touch pointers currently over the game canvas? + */ + readonly isOver: boolean; + + /** + * The mouse has its own unique Pointer object, which you can reference directly if making a _desktop specific game_. + * If you are supporting both desktop and touch devices then do not use this property, instead use `activePointer` + * which will always map to the most recently interacted pointer. + */ + readonly mousePointer: Phaser.Input.Pointer; + + /** + * The current active input Pointer. + */ + readonly activePointer: Phaser.Input.Pointer; + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + */ + readonly pointer1: Phaser.Input.Pointer; + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + */ + readonly pointer2: Phaser.Input.Pointer; + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + */ + readonly pointer3: Phaser.Input.Pointer; + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + */ + readonly pointer4: Phaser.Input.Pointer; + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + */ + readonly pointer5: Phaser.Input.Pointer; + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + */ + readonly pointer6: Phaser.Input.Pointer; + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + */ + readonly pointer7: Phaser.Input.Pointer; + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + */ + readonly pointer8: Phaser.Input.Pointer; + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + */ + readonly pointer9: Phaser.Input.Pointer; + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + */ + readonly pointer10: Phaser.Input.Pointer; + + /** + * An instance of the Gamepad Plugin class, if enabled via the `input.gamepad` Scene or Game Config property. + * Use this to create access Gamepads connected to the browser and respond to gamepad buttons. + */ + gamepad: Phaser.Input.Gamepad.GamepadPlugin | null; + + /** + * An instance of the Keyboard Plugin class, if enabled via the `input.keyboard` Scene or Game Config property. + * Use this to create Key objects and listen for keyboard specific events. + */ + keyboard: Phaser.Input.Keyboard.KeyboardPlugin | null; + + } + + namespace InputPluginCache { + /** + * Static method called directly by the Core internal Plugins. + * Key is a reference used to get the plugin from the plugins object (i.e. InputPlugin) + * Plugin is the object to instantiate to create the plugin + * Mapping is what the plugin is injected into the Scene.Systems as (i.e. input) + * @param key A reference used to get this plugin from the plugin cache. + * @param plugin The plugin to be stored. Should be the core object, not instantiated. + * @param mapping If this plugin is to be injected into the Input Plugin, this is the property key used. + * @param settingsKey The key in the Scene Settings to check to see if this plugin should install or not. + * @param configKey The key in the Game Config to check to see if this plugin should install or not. + */ + function register(key: string, plugin: Function, mapping: string, settingsKey: string, configKey: string): void; + + /** + * Returns the input plugin object from the cache based on the given key. + * @param key The key of the input plugin to get. + */ + function getPlugin(key: string): Phaser.Types.Input.InputPluginContainer; + + /** + * Installs all of the registered Input Plugins into the given target. + * @param target The target InputPlugin to install the plugins into. + */ + function install(target: Phaser.Input.InputPlugin): void; + + /** + * Removes an input plugin based on the given key. + * @param key The key of the input plugin to remove. + */ + function remove(key: string): void; + + } + + /** + * A Pointer object encapsulates both mouse and touch input within Phaser. + * + * By default, Phaser will create 2 pointers for your game to use. If you require more, i.e. for a multi-touch + * game, then use the `InputPlugin.addPointer` method to do so, rather than instantiating this class directly, + * otherwise it won't be managed by the input system. + * + * You can reference the current active pointer via `InputPlugin.activePointer`. You can also use the properties + * `InputPlugin.pointer1` through to `pointer10`, for each pointer you have enabled in your game. + * + * The properties of this object are set by the Input Plugin during processing. This object is then sent in all + * input related events that the Input Plugin emits, so you can reference properties from it directly in your + * callbacks. + */ + class Pointer { + /** + * + * @param manager A reference to the Input Manager. + * @param id The internal ID of this Pointer. + */ + constructor(manager: Phaser.Input.InputManager, id: number); + + /** + * A reference to the Input Manager. + */ + manager: Phaser.Input.InputManager; + + /** + * The internal ID of this Pointer. + */ + readonly id: number; + + /** + * The most recent native DOM Event this Pointer has processed. + */ + event: TouchEvent | MouseEvent | WheelEvent; + + /** + * The DOM element the Pointer was pressed down on, taken from the DOM event. + * In a default set-up this will be the Canvas that Phaser is rendering to, or the Window element. + */ + readonly downElement: any; + + /** + * The DOM element the Pointer was released on, taken from the DOM event. + * In a default set-up this will be the Canvas that Phaser is rendering to, or the Window element. + */ + readonly upElement: any; + + /** + * The camera the Pointer interacted with during its last update. + * + * A Pointer can only ever interact with one camera at once, which will be the top-most camera + * in the list should multiple cameras be positioned on-top of each other. + */ + camera: Phaser.Cameras.Scene2D.Camera; + + /** + * A read-only property that indicates which button was pressed, or released, on the pointer + * during the most recent event. It is only set during `up` and `down` events. + * + * On Touch devices the value is always 0. + * + * Users may change the configuration of buttons on their pointing device so that if an event's button property + * is zero, it may not have been caused by the button that is physically left–most on the pointing device; + * however, it should behave as if the left button was clicked in the standard button layout. + */ + readonly button: number; + + /** + * 0: No button or un-initialized + * 1: Left button + * 2: Right button + * 4: Wheel button or middle button + * 8: 4th button (typically the "Browser Back" button) + * 16: 5th button (typically the "Browser Forward" button) + * + * For a mouse configured for left-handed use, the button actions are reversed. + * In this case, the values are read from right to left. + */ + buttons: number; + + /** + * The position of the Pointer in screen space. + */ + readonly position: Phaser.Math.Vector2; + + /** + * The previous position of the Pointer in screen space. + * + * The old x and y values are stored in here during the InputManager.transformPointer call. + * + * Use the properties `velocity`, `angle` and `distance` to create your own gesture recognition. + */ + readonly prevPosition: Phaser.Math.Vector2; + + /** + * The current velocity of the Pointer, based on its current and previous positions. + * + * This value is smoothed out each frame, according to the `motionFactor` property. + * + * This property is updated whenever the Pointer moves, regardless of any button states. In other words, + * it changes based on movement alone - a button doesn't have to be pressed first. + */ + readonly velocity: Phaser.Math.Vector2; + + /** + * The current angle the Pointer is moving, in radians, based on its previous and current position. + * + * The angle is based on the old position facing to the current position. + * + * This property is updated whenever the Pointer moves, regardless of any button states. In other words, + * it changes based on movement alone - a button doesn't have to be pressed first. + */ + readonly angle: number; + + /** + * The distance the Pointer has moved, based on its previous and current position. + * + * This value is smoothed out each frame, according to the `motionFactor` property. + * + * This property is updated whenever the Pointer moves, regardless of any button states. In other words, + * it changes based on movement alone - a button doesn't have to be pressed first. + * + * If you need the total distance travelled since the primary buttons was pressed down, + * then use the `Pointer.getDistance` method. + */ + readonly distance: number; + + /** + * The smoothing factor to apply to the Pointer position. + * + * Due to their nature, pointer positions are inherently noisy. While this is fine for lots of games, if you need cleaner positions + * then you can set this value to apply an automatic smoothing to the positions as they are recorded. + * + * The default value of zero means 'no smoothing'. + * Set to a small value, such as 0.2, to apply an average level of smoothing between positions. You can do this by changing this + * value directly, or by setting the `input.smoothFactor` property in the Game Config. + * + * Positions are only smoothed when the pointer moves. If the primary button on this Pointer enters an Up or Down state, then the position + * is always precise, and not smoothed. + */ + smoothFactor: number; + + /** + * The factor applied to the motion smoothing each frame. + * + * This value is passed to the Smooth Step Interpolation that is used to calculate the velocity, + * angle and distance of the Pointer. It's applied every frame, until the midPoint reaches the current + * position of the Pointer. 0.2 provides a good average but can be increased if you need a + * quicker update and are working in a high performance environment. Never set this value to + * zero. + */ + motionFactor: number; + + /** + * The x position of this Pointer, translated into the coordinate space of the most recent Camera it interacted with. + * + * If you wish to use this value _outside_ of an input event handler then you should update it first by calling + * the `Pointer.updateWorldPoint` method. + */ + worldX: number; + + /** + * The y position of this Pointer, translated into the coordinate space of the most recent Camera it interacted with. + * + * If you wish to use this value _outside_ of an input event handler then you should update it first by calling + * the `Pointer.updateWorldPoint` method. + */ + worldY: number; + + /** + * Time when this Pointer was most recently moved (regardless of the state of its buttons, if any) + */ + moveTime: number; + + /** + * X coordinate of the Pointer when Button 1 (left button), or Touch, was pressed, used for dragging objects. + */ + downX: number; + + /** + * Y coordinate of the Pointer when Button 1 (left button), or Touch, was pressed, used for dragging objects. + */ + downY: number; + + /** + * The Event timestamp when the first button, or Touch input, was pressed. Used for dragging objects. + */ + downTime: number; + + /** + * X coordinate of the Pointer when Button 1 (left button), or Touch, was released, used for dragging objects. + */ + upX: number; + + /** + * Y coordinate of the Pointer when Button 1 (left button), or Touch, was released, used for dragging objects. + */ + upY: number; + + /** + * The Event timestamp when the final button, or Touch input, was released. Used for dragging objects. + */ + upTime: number; + + /** + * Is the primary button down? (usually button 0, the left mouse button) + */ + primaryDown: boolean; + + /** + * Is _any_ button on this pointer considered as being down? + */ + isDown: boolean; + + /** + * Did the previous input event come from a Touch input (true) or Mouse? (false) + */ + wasTouch: boolean; + + /** + * Did this Pointer get canceled by a touchcancel event? + * + * Note: "canceled" is the American-English spelling of "cancelled". Please don't submit PRs correcting it! + */ + wasCanceled: boolean; + + /** + * If the mouse is locked, the horizontal relative movement of the Pointer in pixels since last frame. + */ + movementX: number; + + /** + * If the mouse is locked, the vertical relative movement of the Pointer in pixels since last frame. + */ + movementY: number; + + /** + * The identifier property of the Pointer as set by the DOM event when this Pointer is started. + */ + identifier: number; + + /** + * The pointerId property of the Pointer as set by the DOM event when this Pointer is started. + * The browser can and will recycle this value. + */ + pointerId: number; + + /** + * An active Pointer is one that is currently pressed down on the display. + * A Mouse is always considered as active. + */ + active: boolean; + + /** + * Is this pointer Pointer Locked? + * + * Only a mouse pointer can be locked and it only becomes locked when requested via + * the browsers Pointer Lock API. + * + * You can request this by calling the `this.input.mouse.requestPointerLock()` method from + * a `pointerdown` or `pointerup` event handler. + */ + readonly locked: boolean; + + /** + * The horizontal scroll amount that occurred due to the user moving a mouse wheel or similar input device. + */ + deltaX: number; + + /** + * The vertical scroll amount that occurred due to the user moving a mouse wheel or similar input device. + * This value will typically be less than 0 if the user scrolls up and greater than zero if scrolling down. + */ + deltaY: number; + + /** + * The z-axis scroll amount that occurred due to the user moving a mouse wheel or similar input device. + */ + deltaZ: number; + + /** + * Takes a Camera and updates this Pointer's `worldX` and `worldY` values so they are + * the result of a translation through the given Camera. + * + * Note that the values will be automatically replaced the moment the Pointer is + * updated by an input event, such as a mouse move, so should be used immediately. + * @param camera The Camera which is being tested against. + */ + updateWorldPoint(camera: Phaser.Cameras.Scene2D.Camera): this; + + /** + * Takes a Camera and returns a Vector2 containing the translated position of this Pointer + * within that Camera. This can be used to convert this Pointers position into camera space. + * @param camera The Camera to use for the translation. + * @param output A Vector2-like object in which to store the translated position. + */ + positionToCamera(camera: Phaser.Cameras.Scene2D.Camera, output?: Phaser.Math.Vector2 | object): Phaser.Math.Vector2 | object; + + /** + * Checks to see if any buttons are being held down on this Pointer. + */ + noButtonDown(): boolean; + + /** + * Checks to see if the left button is being held down on this Pointer. + */ + leftButtonDown(): boolean; + + /** + * Checks to see if the right button is being held down on this Pointer. + */ + rightButtonDown(): boolean; + + /** + * Checks to see if the middle button is being held down on this Pointer. + */ + middleButtonDown(): boolean; + + /** + * Checks to see if the back button is being held down on this Pointer. + */ + backButtonDown(): boolean; + + /** + * Checks to see if the forward button is being held down on this Pointer. + */ + forwardButtonDown(): boolean; + + /** + * Checks to see if the left button was just released on this Pointer. + */ + leftButtonReleased(): boolean; + + /** + * Checks to see if the right button was just released on this Pointer. + */ + rightButtonReleased(): boolean; + + /** + * Checks to see if the middle button was just released on this Pointer. + */ + middleButtonReleased(): boolean; + + /** + * Checks to see if the back button was just released on this Pointer. + */ + backButtonReleased(): boolean; + + /** + * Checks to see if the forward button was just released on this Pointer. + */ + forwardButtonReleased(): boolean; + + /** + * If the Pointer has a button pressed down at the time this method is called, it will return the + * distance between the Pointer's `downX` and `downY` values and the current position. + * + * If no button is held down, it will return the last recorded distance, based on where + * the Pointer was when the button was released. + * + * If you wish to get the distance being travelled currently, based on the velocity of the Pointer, + * then see the `Pointer.distance` property. + */ + getDistance(): number; + + /** + * If the Pointer has a button pressed down at the time this method is called, it will return the + * horizontal distance between the Pointer's `downX` and `downY` values and the current position. + * + * If no button is held down, it will return the last recorded horizontal distance, based on where + * the Pointer was when the button was released. + */ + getDistanceX(): number; + + /** + * If the Pointer has a button pressed down at the time this method is called, it will return the + * vertical distance between the Pointer's `downX` and `downY` values and the current position. + * + * If no button is held down, it will return the last recorded vertical distance, based on where + * the Pointer was when the button was released. + */ + getDistanceY(): number; + + /** + * If the Pointer has a button pressed down at the time this method is called, it will return the + * duration since the button was pressed down. + * + * If no button is held down, it will return the last recorded duration, based on the time + * the last button on the Pointer was released. + */ + getDuration(): number; + + /** + * If the Pointer has a button pressed down at the time this method is called, it will return the + * angle between the Pointer's `downX` and `downY` values and the current position. + * + * If no button is held down, it will return the last recorded angle, based on where + * the Pointer was when the button was released. + * + * The angle is based on the old position facing to the current position. + * + * If you wish to get the current angle, based on the velocity of the Pointer, then + * see the `Pointer.angle` property. + */ + getAngle(): number; + + /** + * Takes the previous and current Pointer positions and then generates an array of interpolated values between + * the two. The array will be populated up to the size of the `steps` argument. + * + * ```javaScript + * var points = pointer.getInterpolatedPosition(4); + * + * // points[0] = { x: 0, y: 0 } + * // points[1] = { x: 2, y: 1 } + * // points[2] = { x: 3, y: 2 } + * // points[3] = { x: 6, y: 3 } + * ``` + * + * Use this if you need to get smoothed values between the previous and current pointer positions. DOM pointer + * events can often fire faster than the main browser loop, and this will help you avoid janky movement + * especially if you have an object following a Pointer. + * + * Note that if you provide an output array it will only be populated up to the number of steps provided. + * It will not clear any previous data that may have existed beyond the range of the steps count. + * + * Internally it uses the Smooth Step interpolation calculation. + * @param steps The number of interpolation steps to use. Default 10. + * @param out An array to store the results in. If not provided a new one will be created. + */ + getInterpolatedPosition(steps?: number, out?: any[]): any[]; + + /** + * Destroys this Pointer instance and resets its external references. + */ + destroy(): void; + + /** + * The x position of this Pointer. + * The value is in screen space. + * See `worldX` to get a camera converted position. + */ + x: number; + + /** + * The y position of this Pointer. + * The value is in screen space. + * See `worldY` to get a camera converted position. + */ + y: number; + + /** + * Time when this Pointer was most recently updated by a DOM Event. + * This comes directly from the `event.timeStamp` property. + * If no event has yet taken place, it will return zero. + */ + readonly time: number; + + } + /** * The mouse pointer is being held down. */ @@ -49203,27 +50540,6 @@ declare namespace Phaser { */ var MOUSE_WHEEL: number; - /** - * Creates a new Interactive Object. - * - * This is called automatically by the Input Manager when you enable a Game Object for input. - * - * The resulting Interactive Object is mapped to the Game Object's `input` property. - * @param gameObject The Game Object to which this Interactive Object is bound. - * @param hitArea The hit area for this Interactive Object. Typically a geometry shape, like a Rectangle or Circle. - * @param hitAreaCallback The 'contains' check callback that the hit area shape will use for all hit tests. - */ - function CreateInteractiveObject(gameObject: Phaser.GameObjects.GameObject, hitArea: any, hitAreaCallback: Phaser.Types.Input.HitAreaCallback): Phaser.Types.Input.InteractiveObject; - - /** - * Creates a new Pixel Perfect Handler function. - * - * Access via `InputPlugin.makePixelPerfect` rather than calling it directly. - * @param textureManager A reference to the Texture Manager. - * @param alphaTolerance The alpha level that the pixel should be above to be included as a successful interaction. - */ - function CreatePixelPerfectHandler(textureManager: Phaser.Textures.TextureManager, alphaTolerance: number): Function; - namespace Events { /** * The Input Plugin Boot Event. @@ -50032,6 +51348,377 @@ declare namespace Phaser { } + /** + * A single Gamepad. + * + * These are created, updated and managed by the Gamepad Plugin. + */ + class Gamepad extends Phaser.Events.EventEmitter { + /** + * + * @param manager A reference to the Gamepad Plugin. + * @param pad The Gamepad object, as extracted from GamepadEvent. + */ + constructor(manager: Phaser.Input.Gamepad.GamepadPlugin, pad: Phaser.Types.Input.Gamepad.Pad); + + /** + * A reference to the Gamepad Plugin. + */ + manager: Phaser.Input.Gamepad.GamepadPlugin; + + /** + * A reference to the native Gamepad object that is connected to the browser. + */ + pad: any; + + /** + * A string containing some information about the controller. + * + * This is not strictly specified, but in Firefox it will contain three pieces of information + * separated by dashes (-): two 4-digit hexadecimal strings containing the USB vendor and + * product id of the controller, and the name of the controller as provided by the driver. + * In Chrome it will contain the name of the controller as provided by the driver, + * followed by vendor and product 4-digit hexadecimal strings. + */ + id: string; + + /** + * An integer that is unique for each Gamepad currently connected to the system. + * This can be used to distinguish multiple controllers. + * Note that disconnecting a device and then connecting a new device may reuse the previous index. + */ + index: number; + + /** + * An array of Gamepad Button objects, corresponding to the different buttons available on the Gamepad. + */ + buttons: Phaser.Input.Gamepad.Button[]; + + /** + * An array of Gamepad Axis objects, corresponding to the different axes available on the Gamepad, if any. + */ + axes: Phaser.Input.Gamepad.Axis[]; + + /** + * The Gamepad's Haptic Actuator (Vibration / Rumble support). + * This is highly experimental and only set if both present on the device, + * and exposed by both the hardware and browser. + */ + vibration: GamepadHapticActuator; + + /** + * A Vector2 containing the most recent values from the Gamepad's left axis stick. + * This is updated automatically as part of the Gamepad.update cycle. + * The H Axis is mapped to the `Vector2.x` property, and the V Axis to the `Vector2.y` property. + * The values are based on the Axis thresholds. + * If the Gamepad does not have a left axis stick, the values will always be zero. + */ + leftStick: Phaser.Math.Vector2; + + /** + * A Vector2 containing the most recent values from the Gamepad's right axis stick. + * This is updated automatically as part of the Gamepad.update cycle. + * The H Axis is mapped to the `Vector2.x` property, and the V Axis to the `Vector2.y` property. + * The values are based on the Axis thresholds. + * If the Gamepad does not have a right axis stick, the values will always be zero. + */ + rightStick: Phaser.Math.Vector2; + + /** + * Gets the total number of axis this Gamepad claims to support. + */ + getAxisTotal(): number; + + /** + * Gets the value of an axis based on the given index. + * The index must be valid within the range of axes supported by this Gamepad. + * The return value will be a float between 0 and 1. + * @param index The index of the axes to get the value for. + */ + getAxisValue(index: number): number; + + /** + * Sets the threshold value of all axis on this Gamepad. + * The value is a float between 0 and 1 and is the amount below which the axis is considered as not having been moved. + * @param value A value between 0 and 1. + */ + setAxisThreshold(value: number): void; + + /** + * Gets the total number of buttons this Gamepad claims to have. + */ + getButtonTotal(): number; + + /** + * Gets the value of a button based on the given index. + * The index must be valid within the range of buttons supported by this Gamepad. + * + * The return value will be either 0 or 1 for an analogue button, or a float between 0 and 1 + * for a pressure-sensitive digital button, such as the shoulder buttons on a Dual Shock. + * @param index The index of the button to get the value for. + */ + getButtonValue(index: number): number; + + /** + * Returns if the button is pressed down or not. + * The index must be valid within the range of buttons supported by this Gamepad. + * @param index The index of the button to get the value for. + */ + isButtonDown(index: number): boolean; + + /** + * Destroys this Gamepad instance, its buttons and axes, and releases external references it holds. + */ + destroy(): void; + + /** + * Is this Gamepad currently connected or not? + */ + connected: boolean; + + /** + * A timestamp containing the most recent time this Gamepad was updated. + */ + timestamp: number; + + /** + * Is the Gamepad's Left button being pressed? + * If the Gamepad doesn't have this button it will always return false. + * This is the d-pad left button under standard Gamepad mapping. + */ + left: boolean; + + /** + * Is the Gamepad's Right button being pressed? + * If the Gamepad doesn't have this button it will always return false. + * This is the d-pad right button under standard Gamepad mapping. + */ + right: boolean; + + /** + * Is the Gamepad's Up button being pressed? + * If the Gamepad doesn't have this button it will always return false. + * This is the d-pad up button under standard Gamepad mapping. + */ + up: boolean; + + /** + * Is the Gamepad's Down button being pressed? + * If the Gamepad doesn't have this button it will always return false. + * This is the d-pad down button under standard Gamepad mapping. + */ + down: boolean; + + /** + * Is the Gamepad's bottom button in the right button cluster being pressed? + * If the Gamepad doesn't have this button it will always return false. + * On a Dual Shock controller it's the X button. + * On an XBox controller it's the A button. + */ + A: boolean; + + /** + * Is the Gamepad's top button in the right button cluster being pressed? + * If the Gamepad doesn't have this button it will always return false. + * On a Dual Shock controller it's the Triangle button. + * On an XBox controller it's the Y button. + */ + Y: boolean; + + /** + * Is the Gamepad's left button in the right button cluster being pressed? + * If the Gamepad doesn't have this button it will always return false. + * On a Dual Shock controller it's the Square button. + * On an XBox controller it's the X button. + */ + X: boolean; + + /** + * Is the Gamepad's right button in the right button cluster being pressed? + * If the Gamepad doesn't have this button it will always return false. + * On a Dual Shock controller it's the Circle button. + * On an XBox controller it's the B button. + */ + B: boolean; + + /** + * Returns the value of the Gamepad's top left shoulder button. + * If the Gamepad doesn't have this button it will always return zero. + * The value is a float between 0 and 1, corresponding to how depressed the button is. + * On a Dual Shock controller it's the L1 button. + * On an XBox controller it's the LB button. + */ + L1: number; + + /** + * Returns the value of the Gamepad's bottom left shoulder button. + * If the Gamepad doesn't have this button it will always return zero. + * The value is a float between 0 and 1, corresponding to how depressed the button is. + * On a Dual Shock controller it's the L2 button. + * On an XBox controller it's the LT button. + */ + L2: number; + + /** + * Returns the value of the Gamepad's top right shoulder button. + * If the Gamepad doesn't have this button it will always return zero. + * The value is a float between 0 and 1, corresponding to how depressed the button is. + * On a Dual Shock controller it's the R1 button. + * On an XBox controller it's the RB button. + */ + R1: number; + + /** + * Returns the value of the Gamepad's bottom right shoulder button. + * If the Gamepad doesn't have this button it will always return zero. + * The value is a float between 0 and 1, corresponding to how depressed the button is. + * On a Dual Shock controller it's the R2 button. + * On an XBox controller it's the RT button. + */ + R2: number; + + } + + /** + * The Gamepad Plugin is an input plugin that belongs to the Scene-owned Input system. + * + * Its role is to listen for native DOM Gamepad Events and then process them. + * + * You do not need to create this class directly, the Input system will create an instance of it automatically. + * + * You can access it from within a Scene using `this.input.gamepad`. + * + * To listen for a gamepad being connected: + * + * ```javascript + * this.input.gamepad.once('connected', function (pad) { + * // 'pad' is a reference to the gamepad that was just connected + * }); + * ``` + * + * Note that the browser may require you to press a button on a gamepad before it will allow you to access it, + * this is for security reasons. However, it may also trust the page already, in which case you won't get the + * 'connected' event and instead should check `GamepadPlugin.total` to see if it thinks there are any gamepads + * already connected. + * + * Once you have received the connected event, or polled the gamepads and found them enabled, you can access + * them via the built-in properties `GamepadPlugin.pad1` to `pad4`, for up to 4 game pads. With a reference + * to the gamepads you can poll its buttons and axis sticks. See the properties and methods available on + * the `Gamepad` class for more details. + * + * As of September 2020 Chrome, and likely other browsers, will soon start to require that games requesting + * access to the Gamepad API are running under SSL. They will actively block API access if they are not. + * + * For more information about Gamepad support in browsers see the following resources: + * + * https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API + * https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API/Using_the_Gamepad_API + * https://www.smashingmagazine.com/2015/11/gamepad-api-in-web-games/ + * http://html5gamepad.com/ + */ + class GamepadPlugin extends Phaser.Events.EventEmitter { + /** + * + * @param sceneInputPlugin A reference to the Scene Input Plugin that the KeyboardPlugin belongs to. + */ + constructor(sceneInputPlugin: Phaser.Input.InputPlugin); + + /** + * A reference to the Scene that this Input Plugin is responsible for. + */ + scene: Phaser.Scene; + + /** + * A reference to the Scene Systems Settings. + */ + settings: Phaser.Types.Scenes.SettingsObject; + + /** + * A reference to the Scene Input Plugin that created this Keyboard Plugin. + */ + sceneInputPlugin: Phaser.Input.InputPlugin; + + /** + * A boolean that controls if the Gamepad Manager is enabled or not. + * Can be toggled on the fly. + */ + enabled: boolean; + + /** + * The Gamepad Event target, as defined in the Game Config. + * Typically the browser window, but can be any interactive DOM element. + */ + target: any; + + /** + * An array of the connected Gamepads. + */ + gamepads: Phaser.Input.Gamepad.Gamepad[]; + + /** + * Checks to see if both this plugin and the Scene to which it belongs is active. + */ + isActive(): boolean; + + /** + * Disconnects all current Gamepads. + */ + disconnectAll(): void; + + /** + * Returns an array of all currently connected Gamepads. + */ + getAll(): Phaser.Input.Gamepad.Gamepad[]; + + /** + * Looks-up a single Gamepad based on the given index value. + * @param index The index of the Gamepad to get. + */ + getPad(index: number): Phaser.Input.Gamepad.Gamepad; + + /** + * The total number of connected game pads. + */ + total: number; + + /** + * A reference to the first connected Gamepad. + * + * This will be undefined if either no pads are connected, or the browser + * has not yet issued a gamepadconnect, which can happen even if a Gamepad + * is plugged in, but hasn't yet had any buttons pressed on it. + */ + pad1: Phaser.Input.Gamepad.Gamepad; + + /** + * A reference to the second connected Gamepad. + * + * This will be undefined if either no pads are connected, or the browser + * has not yet issued a gamepadconnect, which can happen even if a Gamepad + * is plugged in, but hasn't yet had any buttons pressed on it. + */ + pad2: Phaser.Input.Gamepad.Gamepad; + + /** + * A reference to the third connected Gamepad. + * + * This will be undefined if either no pads are connected, or the browser + * has not yet issued a gamepadconnect, which can happen even if a Gamepad + * is plugged in, but hasn't yet had any buttons pressed on it. + */ + pad3: Phaser.Input.Gamepad.Gamepad; + + /** + * A reference to the fourth connected Gamepad. + * + * This will be undefined if either no pads are connected, or the browser + * has not yet issued a gamepadconnect, which can happen even if a Gamepad + * is plugged in, but hasn't yet had any buttons pressed on it. + */ + pad4: Phaser.Input.Gamepad.Gamepad; + + } + namespace Configs { /** * Tatar SNES USB Controller Gamepad Configuration. @@ -50406,1473 +52093,9 @@ declare namespace Phaser { } - /** - * A single Gamepad. - * - * These are created, updated and managed by the Gamepad Plugin. - */ - class Gamepad extends Phaser.Events.EventEmitter { - /** - * - * @param manager A reference to the Gamepad Plugin. - * @param pad The Gamepad object, as extracted from GamepadEvent. - */ - constructor(manager: Phaser.Input.Gamepad.GamepadPlugin, pad: Phaser.Types.Input.Gamepad.Pad); - - /** - * A reference to the Gamepad Plugin. - */ - manager: Phaser.Input.Gamepad.GamepadPlugin; - - /** - * A reference to the native Gamepad object that is connected to the browser. - */ - pad: any; - - /** - * A string containing some information about the controller. - * - * This is not strictly specified, but in Firefox it will contain three pieces of information - * separated by dashes (-): two 4-digit hexadecimal strings containing the USB vendor and - * product id of the controller, and the name of the controller as provided by the driver. - * In Chrome it will contain the name of the controller as provided by the driver, - * followed by vendor and product 4-digit hexadecimal strings. - */ - id: string; - - /** - * An integer that is unique for each Gamepad currently connected to the system. - * This can be used to distinguish multiple controllers. - * Note that disconnecting a device and then connecting a new device may reuse the previous index. - */ - index: number; - - /** - * An array of Gamepad Button objects, corresponding to the different buttons available on the Gamepad. - */ - buttons: Phaser.Input.Gamepad.Button[]; - - /** - * An array of Gamepad Axis objects, corresponding to the different axes available on the Gamepad, if any. - */ - axes: Phaser.Input.Gamepad.Axis[]; - - /** - * The Gamepad's Haptic Actuator (Vibration / Rumble support). - * This is highly experimental and only set if both present on the device, - * and exposed by both the hardware and browser. - */ - vibration: GamepadHapticActuator; - - /** - * A Vector2 containing the most recent values from the Gamepad's left axis stick. - * This is updated automatically as part of the Gamepad.update cycle. - * The H Axis is mapped to the `Vector2.x` property, and the V Axis to the `Vector2.y` property. - * The values are based on the Axis thresholds. - * If the Gamepad does not have a left axis stick, the values will always be zero. - */ - leftStick: Phaser.Math.Vector2; - - /** - * A Vector2 containing the most recent values from the Gamepad's right axis stick. - * This is updated automatically as part of the Gamepad.update cycle. - * The H Axis is mapped to the `Vector2.x` property, and the V Axis to the `Vector2.y` property. - * The values are based on the Axis thresholds. - * If the Gamepad does not have a right axis stick, the values will always be zero. - */ - rightStick: Phaser.Math.Vector2; - - /** - * Gets the total number of axis this Gamepad claims to support. - */ - getAxisTotal(): number; - - /** - * Gets the value of an axis based on the given index. - * The index must be valid within the range of axes supported by this Gamepad. - * The return value will be a float between 0 and 1. - * @param index The index of the axes to get the value for. - */ - getAxisValue(index: number): number; - - /** - * Sets the threshold value of all axis on this Gamepad. - * The value is a float between 0 and 1 and is the amount below which the axis is considered as not having been moved. - * @param value A value between 0 and 1. - */ - setAxisThreshold(value: number): void; - - /** - * Gets the total number of buttons this Gamepad claims to have. - */ - getButtonTotal(): number; - - /** - * Gets the value of a button based on the given index. - * The index must be valid within the range of buttons supported by this Gamepad. - * - * The return value will be either 0 or 1 for an analogue button, or a float between 0 and 1 - * for a pressure-sensitive digital button, such as the shoulder buttons on a Dual Shock. - * @param index The index of the button to get the value for. - */ - getButtonValue(index: number): number; - - /** - * Returns if the button is pressed down or not. - * The index must be valid within the range of buttons supported by this Gamepad. - * @param index The index of the button to get the value for. - */ - isButtonDown(index: number): boolean; - - /** - * Destroys this Gamepad instance, its buttons and axes, and releases external references it holds. - */ - destroy(): void; - - /** - * Is this Gamepad currently connected or not? - */ - connected: boolean; - - /** - * A timestamp containing the most recent time this Gamepad was updated. - */ - timestamp: number; - - /** - * Is the Gamepad's Left button being pressed? - * If the Gamepad doesn't have this button it will always return false. - * This is the d-pad left button under standard Gamepad mapping. - */ - left: boolean; - - /** - * Is the Gamepad's Right button being pressed? - * If the Gamepad doesn't have this button it will always return false. - * This is the d-pad right button under standard Gamepad mapping. - */ - right: boolean; - - /** - * Is the Gamepad's Up button being pressed? - * If the Gamepad doesn't have this button it will always return false. - * This is the d-pad up button under standard Gamepad mapping. - */ - up: boolean; - - /** - * Is the Gamepad's Down button being pressed? - * If the Gamepad doesn't have this button it will always return false. - * This is the d-pad down button under standard Gamepad mapping. - */ - down: boolean; - - /** - * Is the Gamepad's bottom button in the right button cluster being pressed? - * If the Gamepad doesn't have this button it will always return false. - * On a Dual Shock controller it's the X button. - * On an XBox controller it's the A button. - */ - A: boolean; - - /** - * Is the Gamepad's top button in the right button cluster being pressed? - * If the Gamepad doesn't have this button it will always return false. - * On a Dual Shock controller it's the Triangle button. - * On an XBox controller it's the Y button. - */ - Y: boolean; - - /** - * Is the Gamepad's left button in the right button cluster being pressed? - * If the Gamepad doesn't have this button it will always return false. - * On a Dual Shock controller it's the Square button. - * On an XBox controller it's the X button. - */ - X: boolean; - - /** - * Is the Gamepad's right button in the right button cluster being pressed? - * If the Gamepad doesn't have this button it will always return false. - * On a Dual Shock controller it's the Circle button. - * On an XBox controller it's the B button. - */ - B: boolean; - - /** - * Returns the value of the Gamepad's top left shoulder button. - * If the Gamepad doesn't have this button it will always return zero. - * The value is a float between 0 and 1, corresponding to how depressed the button is. - * On a Dual Shock controller it's the L1 button. - * On an XBox controller it's the LB button. - */ - L1: number; - - /** - * Returns the value of the Gamepad's bottom left shoulder button. - * If the Gamepad doesn't have this button it will always return zero. - * The value is a float between 0 and 1, corresponding to how depressed the button is. - * On a Dual Shock controller it's the L2 button. - * On an XBox controller it's the LT button. - */ - L2: number; - - /** - * Returns the value of the Gamepad's top right shoulder button. - * If the Gamepad doesn't have this button it will always return zero. - * The value is a float between 0 and 1, corresponding to how depressed the button is. - * On a Dual Shock controller it's the R1 button. - * On an XBox controller it's the RB button. - */ - R1: number; - - /** - * Returns the value of the Gamepad's bottom right shoulder button. - * If the Gamepad doesn't have this button it will always return zero. - * The value is a float between 0 and 1, corresponding to how depressed the button is. - * On a Dual Shock controller it's the R2 button. - * On an XBox controller it's the RT button. - */ - R2: number; - - } - - /** - * The Gamepad Plugin is an input plugin that belongs to the Scene-owned Input system. - * - * Its role is to listen for native DOM Gamepad Events and then process them. - * - * You do not need to create this class directly, the Input system will create an instance of it automatically. - * - * You can access it from within a Scene using `this.input.gamepad`. - * - * To listen for a gamepad being connected: - * - * ```javascript - * this.input.gamepad.once('connected', function (pad) { - * // 'pad' is a reference to the gamepad that was just connected - * }); - * ``` - * - * Note that the browser may require you to press a button on a gamepad before it will allow you to access it, - * this is for security reasons. However, it may also trust the page already, in which case you won't get the - * 'connected' event and instead should check `GamepadPlugin.total` to see if it thinks there are any gamepads - * already connected. - * - * Once you have received the connected event, or polled the gamepads and found them enabled, you can access - * them via the built-in properties `GamepadPlugin.pad1` to `pad4`, for up to 4 game pads. With a reference - * to the gamepads you can poll its buttons and axis sticks. See the properties and methods available on - * the `Gamepad` class for more details. - * - * As of September 2020 Chrome, and likely other browsers, will soon start to require that games requesting - * access to the Gamepad API are running under SSL. They will actively block API access if they are not. - * - * For more information about Gamepad support in browsers see the following resources: - * - * https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API - * https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API/Using_the_Gamepad_API - * https://www.smashingmagazine.com/2015/11/gamepad-api-in-web-games/ - * http://html5gamepad.com/ - */ - class GamepadPlugin extends Phaser.Events.EventEmitter { - /** - * - * @param sceneInputPlugin A reference to the Scene Input Plugin that the KeyboardPlugin belongs to. - */ - constructor(sceneInputPlugin: Phaser.Input.InputPlugin); - - /** - * A reference to the Scene that this Input Plugin is responsible for. - */ - scene: Phaser.Scene; - - /** - * A reference to the Scene Systems Settings. - */ - settings: Phaser.Types.Scenes.SettingsObject; - - /** - * A reference to the Scene Input Plugin that created this Keyboard Plugin. - */ - sceneInputPlugin: Phaser.Input.InputPlugin; - - /** - * A boolean that controls if the Gamepad Manager is enabled or not. - * Can be toggled on the fly. - */ - enabled: boolean; - - /** - * The Gamepad Event target, as defined in the Game Config. - * Typically the browser window, but can be any interactive DOM element. - */ - target: any; - - /** - * An array of the connected Gamepads. - */ - gamepads: Phaser.Input.Gamepad.Gamepad[]; - - /** - * Checks to see if both this plugin and the Scene to which it belongs is active. - */ - isActive(): boolean; - - /** - * Disconnects all current Gamepads. - */ - disconnectAll(): void; - - /** - * Returns an array of all currently connected Gamepads. - */ - getAll(): Phaser.Input.Gamepad.Gamepad[]; - - /** - * Looks-up a single Gamepad based on the given index value. - * @param index The index of the Gamepad to get. - */ - getPad(index: number): Phaser.Input.Gamepad.Gamepad; - - /** - * The total number of connected game pads. - */ - total: number; - - /** - * A reference to the first connected Gamepad. - * - * This will be undefined if either no pads are connected, or the browser - * has not yet issued a gamepadconnect, which can happen even if a Gamepad - * is plugged in, but hasn't yet had any buttons pressed on it. - */ - pad1: Phaser.Input.Gamepad.Gamepad; - - /** - * A reference to the second connected Gamepad. - * - * This will be undefined if either no pads are connected, or the browser - * has not yet issued a gamepadconnect, which can happen even if a Gamepad - * is plugged in, but hasn't yet had any buttons pressed on it. - */ - pad2: Phaser.Input.Gamepad.Gamepad; - - /** - * A reference to the third connected Gamepad. - * - * This will be undefined if either no pads are connected, or the browser - * has not yet issued a gamepadconnect, which can happen even if a Gamepad - * is plugged in, but hasn't yet had any buttons pressed on it. - */ - pad3: Phaser.Input.Gamepad.Gamepad; - - /** - * A reference to the fourth connected Gamepad. - * - * This will be undefined if either no pads are connected, or the browser - * has not yet issued a gamepadconnect, which can happen even if a Gamepad - * is plugged in, but hasn't yet had any buttons pressed on it. - */ - pad4: Phaser.Input.Gamepad.Gamepad; - - } - - } - - /** - * The Input Manager is responsible for handling the pointer related systems in a single Phaser Game instance. - * - * Based on the Game Config it will create handlers for mouse and touch support. - * - * Keyboard and Gamepad are plugins, handled directly by the InputPlugin class. - * - * It then manages the events, pointer creation and general hit test related operations. - * - * You rarely need to interact with the Input Manager directly, and as such, all of its properties and methods - * should be considered private. Instead, you should use the Input Plugin, which is a Scene level system, responsible - * for dealing with all input events for a Scene. - */ - class InputManager { - /** - * - * @param game The Game instance that owns the Input Manager. - * @param config The Input Configuration object, as set in the Game Config. - */ - constructor(game: Phaser.Game, config: object); - - /** - * The Game instance that owns the Input Manager. - * A Game only maintains on instance of the Input Manager at any time. - */ - readonly game: Phaser.Game; - - /** - * A reference to the global Game Scale Manager. - * Used for all bounds checks and pointer scaling. - */ - scaleManager: Phaser.Scale.ScaleManager; - - /** - * The Canvas that is used for all DOM event input listeners. - */ - canvas: HTMLCanvasElement; - - /** - * The Game Configuration object, as set during the game boot. - */ - config: Phaser.Core.Config; - - /** - * If set, the Input Manager will run its update loop every frame. - */ - enabled: boolean; - - /** - * The Event Emitter instance that the Input Manager uses to emit events from. - */ - events: Phaser.Events.EventEmitter; - - /** - * Are any mouse or touch pointers currently over the game canvas? - * This is updated automatically by the canvas over and out handlers. - */ - readonly isOver: boolean; - - /** - * The default CSS cursor to be used when interacting with your game. - * - * See the `setDefaultCursor` method for more details. - */ - defaultCursor: string; - - /** - * A reference to the Keyboard Manager class, if enabled via the `input.keyboard` Game Config property. - */ - keyboard: Phaser.Input.Keyboard.KeyboardManager | null; - - /** - * A reference to the Mouse Manager class, if enabled via the `input.mouse` Game Config property. - */ - mouse: Phaser.Input.Mouse.MouseManager | null; - - /** - * A reference to the Touch Manager class, if enabled via the `input.touch` Game Config property. - */ - touch: Phaser.Input.Touch.TouchManager; - - /** - * An array of Pointers that have been added to the game. - * The first entry is reserved for the Mouse Pointer, the rest are Touch Pointers. - * - * By default there is 1 touch pointer enabled. If you need more use the `addPointer` method to start them, - * or set the `input.activePointers` property in the Game Config. - */ - pointers: Phaser.Input.Pointer[]; - - /** - * The number of touch objects activated and being processed each update. - * - * You can change this by either calling `addPointer` at run-time, or by - * setting the `input.activePointers` property in the Game Config. - */ - readonly pointersTotal: number; - - /** - * The mouse has its own unique Pointer object, which you can reference directly if making a _desktop specific game_. - * If you are supporting both desktop and touch devices then do not use this property, instead use `activePointer` - * which will always map to the most recently interacted pointer. - */ - mousePointer: Phaser.Input.Pointer | null; - - /** - * The most recently active Pointer object. - * - * If you've only 1 Pointer in your game then this will accurately be either the first finger touched, or the mouse. - * - * If your game doesn't need to support multi-touch then you can safely use this property in all of your game - * code and it will adapt to be either the mouse or the touch, based on device. - */ - activePointer: Phaser.Input.Pointer; - - /** - * If the top-most Scene in the Scene List receives an input it will stop input from - * propagating any lower down the scene list, i.e. if you have a UI Scene at the top - * and click something on it, that click will not then be passed down to any other - * Scene below. Disable this to have input events passed through all Scenes, all the time. - */ - globalTopOnly: boolean; - - /** - * The time this Input Manager was last updated. - * This value is populated by the Game Step each frame. - */ - readonly time: number; - - /** - * The Boot handler is called by Phaser.Game when it first starts up. - * The renderer is available by now. - */ - protected boot(): void; - - /** - * Tells the Input system to set a custom cursor. - * - * This cursor will be the default cursor used when interacting with the game canvas. - * - * If an Interactive Object also sets a custom cursor, this is the cursor that is reset after its use. - * - * Any valid CSS cursor value is allowed, including paths to image files, i.e.: - * - * ```javascript - * this.input.setDefaultCursor('url(assets/cursors/sword.cur), pointer'); - * ``` - * - * Please read about the differences between browsers when it comes to the file formats and sizes they support: - * - * https://developer.mozilla.org/en-US/docs/Web/CSS/cursor - * https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_User_Interface/Using_URL_values_for_the_cursor_property - * - * It's up to you to pick a suitable cursor format that works across the range of browsers you need to support. - * @param cursor The CSS to be used when setting the default cursor. - */ - setDefaultCursor(cursor: string): void; - - /** - * Adds new Pointer objects to the Input Manager. - * - * By default Phaser creates 2 pointer objects: `mousePointer` and `pointer1`. - * - * You can create more either by calling this method, or by setting the `input.activePointers` property - * in the Game Config, up to a maximum of 10 pointers. - * - * The first 10 pointers are available via the `InputPlugin.pointerX` properties, once they have been added - * via this method. - * @param quantity The number of new Pointers to create. A maximum of 10 is allowed in total. Default 1. - */ - addPointer(quantity?: number): Phaser.Input.Pointer[]; - - /** - * Internal method that gets a list of all the active Input Plugins in the game - * and updates each of them in turn, in reverse order (top to bottom), to allow - * for DOM top-level event handling simulation. - * @param type The type of event to process. - * @param pointers An array of Pointers on which the event occurred. - */ - updateInputPlugins(type: number, pointers: Phaser.Input.Pointer[]): void; - - /** - * Performs a hit test using the given Pointer and camera, against an array of interactive Game Objects. - * - * The Game Objects are culled against the camera, and then the coordinates are translated into the local camera space - * and used to determine if they fall within the remaining Game Objects hit areas or not. - * - * If nothing is matched an empty array is returned. - * - * This method is called automatically by InputPlugin.hitTestPointer and doesn't usually need to be invoked directly. - * @param pointer The Pointer to test against. - * @param gameObjects An array of interactive Game Objects to check. - * @param camera The Camera which is being tested against. - * @param output An array to store the results in. If not given, a new empty array is created. - */ - hitTest(pointer: Phaser.Input.Pointer, gameObjects: any[], camera: Phaser.Cameras.Scene2D.Camera, output?: any[]): any[]; - - /** - * Checks if the given x and y coordinate are within the hit area of the Game Object. - * - * This method assumes that the coordinate values have already been translated into the space of the Game Object. - * - * If the coordinates are within the hit area they are set into the Game Objects Input `localX` and `localY` properties. - * @param gameObject The interactive Game Object to check against. - * @param x The translated x coordinate for the hit test. - * @param y The translated y coordinate for the hit test. - */ - pointWithinHitArea(gameObject: Phaser.GameObjects.GameObject, x: number, y: number): boolean; - - /** - * Checks if the given x and y coordinate are within the hit area of the Interactive Object. - * - * This method assumes that the coordinate values have already been translated into the space of the Interactive Object. - * - * If the coordinates are within the hit area they are set into the Interactive Objects Input `localX` and `localY` properties. - * @param object The Interactive Object to check against. - * @param x The translated x coordinate for the hit test. - * @param y The translated y coordinate for the hit test. - */ - pointWithinInteractiveObject(object: Phaser.Types.Input.InteractiveObject, x: number, y: number): boolean; - - /** - * Transforms the pageX and pageY values of a Pointer into the scaled coordinate space of the Input Manager. - * @param pointer The Pointer to transform the values for. - * @param pageX The Page X value. - * @param pageY The Page Y value. - * @param wasMove Are we transforming the Pointer from a move event, or an up / down event? - */ - transformPointer(pointer: Phaser.Input.Pointer, pageX: number, pageY: number, wasMove: boolean): void; - - /** - * Destroys the Input Manager and all of its systems. - * - * There is no way to recover from doing this. - */ - destroy(): void; - - } - - /** - * The Input Plugin belongs to a Scene and handles all input related events and operations for it. - * - * You can access it from within a Scene using `this.input`. - * - * It emits events directly. For example, you can do: - * - * ```javascript - * this.input.on('pointerdown', callback, context); - * ``` - * - * To listen for a pointer down event anywhere on the game canvas. - * - * Game Objects can be enabled for input by calling their `setInteractive` method. After which they - * will directly emit input events: - * - * ```javascript - * var sprite = this.add.sprite(x, y, texture); - * sprite.setInteractive(); - * sprite.on('pointerdown', callback, context); - * ``` - * - * There are lots of game configuration options available relating to input. - * See the [Input Config object]{@linkcode Phaser.Types.Core.InputConfig} for more details, including how to deal with Phaser - * listening for input events outside of the canvas, how to set a default number of pointers, input - * capture settings and more. - * - * Please also see the Input examples and tutorials for further information. - * - * **Incorrect input coordinates with Angular** - * - * If you are using Phaser within Angular, and use nglf or the router, to make the component in which the Phaser game resides - * change state (i.e. appear or disappear) then you'll need to notify the Scale Manager about this, as Angular will mess with - * the DOM in a way in which Phaser can't detect directly. Call `this.scale.updateBounds()` as part of your game init in order - * to refresh the canvas DOM bounds values, which Phaser uses for input point position calculations. - */ - class InputPlugin extends Phaser.Events.EventEmitter { - /** - * - * @param scene A reference to the Scene that this Input Plugin is responsible for. - */ - constructor(scene: Phaser.Scene); - - /** - * An instance of the Gamepad Plugin class, if enabled via the `input.gamepad` Scene or Game Config property. - * Use this to create access Gamepads connected to the browser and respond to gamepad buttons. - */ - gamepad: Phaser.Input.Gamepad.GamepadPlugin | null; - - /** - * A reference to the Scene that this Input Plugin is responsible for. - */ - scene: Phaser.Scene; - - /** - * A reference to the Scene Systems class. - */ - systems: Phaser.Scenes.Systems; - - /** - * A reference to the Scene Systems Settings. - */ - settings: Phaser.Types.Scenes.SettingsObject; - - /** - * A reference to the Game Input Manager. - */ - manager: Phaser.Input.InputManager; - - /** - * If `true` this Input Plugin will process DOM input events. - */ - enabled: boolean; - - /** - * A reference to the Scene Display List. This property is set during the `boot` method. - */ - displayList: Phaser.GameObjects.DisplayList; - - /** - * A reference to the Scene Cameras Manager. This property is set during the `boot` method. - */ - cameras: Phaser.Cameras.Scene2D.CameraManager; - - /** - * A reference to the Mouse Manager. - * - * This property is only set if Mouse support has been enabled in your Game Configuration file. - * - * If you just wish to get access to the mouse pointer, use the `mousePointer` property instead. - */ - mouse: Phaser.Input.Mouse.MouseManager | null; - - /** - * When set to `true` (the default) the Input Plugin will emulate DOM behavior by only emitting events from - * the top-most Game Objects in the Display List. - * - * If set to `false` it will emit events from all Game Objects below a Pointer, not just the top one. - */ - topOnly: boolean; - - /** - * How often should the Pointers be checked? - * - * The value is a time, given in ms, and is the time that must have elapsed between game steps before - * the Pointers will be polled again. When a pointer is polled it runs a hit test to see which Game - * Objects are currently below it, or being interacted with it. - * - * Pointers will *always* be checked if they have been moved by the user, or press or released. - * - * This property only controls how often they will be polled if they have not been updated. - * You should set this if you want to have Game Objects constantly check against the pointers, even - * if the pointer didn't itself move. - * - * Set to 0 to poll constantly. Set to -1 to only poll on user movement. - */ - pollRate: number; - - /** - * The distance, in pixels, a pointer has to move while being held down, before it thinks it is being dragged. - */ - dragDistanceThreshold: number; - - /** - * The amount of time, in ms, a pointer has to be held down before it thinks it is dragging. - * - * The default polling rate is to poll only on move so once the time threshold is reached the - * drag event will not start until you move the mouse. If you want it to start immediately - * when the time threshold is reached, you must increase the polling rate by calling - * [setPollAlways]{@linkcode Phaser.Input.InputPlugin#setPollAlways} or - * [setPollRate]{@linkcode Phaser.Input.InputPlugin#setPollRate}. - */ - dragTimeThreshold: number; - - /** - * Checks to see if both this plugin and the Scene to which it belongs is active. - */ - isActive(): boolean; - - /** - * This is called automatically by the Input Manager. - * It emits events for plugins to listen to and also handles polling updates, if enabled. - * @param time The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. - * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. - */ - updatePoll(time: number, delta: number): boolean; - - /** - * Clears a Game Object so it no longer has an Interactive Object associated with it. - * The Game Object is then queued for removal from the Input Plugin on the next update. - * @param gameObject The Game Object that will have its Interactive Object removed. - * @param skipQueue Skip adding this Game Object into the removal queue? Default false. - */ - clear(gameObject: Phaser.GameObjects.GameObject, skipQueue?: boolean): Phaser.GameObjects.GameObject; - - /** - * Disables Input on a single Game Object. - * - * An input disabled Game Object still retains its Interactive Object component and can be re-enabled - * at any time, by passing it to `InputPlugin.enable`. - * @param gameObject The Game Object to have its input system disabled. - */ - disable(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Enable a Game Object for interaction. - * - * If the Game Object already has an Interactive Object component, it is enabled and returned. - * - * Otherwise, a new Interactive Object component is created and assigned to the Game Object's `input` property. - * - * Input works by using hit areas, these are nearly always geometric shapes, such as rectangles or circles, that act as the hit area - * for the Game Object. However, you can provide your own hit area shape and callback, should you wish to handle some more advanced - * input detection. - * - * If no arguments are provided it will try and create a rectangle hit area based on the texture frame the Game Object is using. If - * this isn't a texture-bound object, such as a Graphics or BitmapText object, this will fail, and you'll need to provide a specific - * shape for it to use. - * - * You can also provide an Input Configuration Object as the only argument to this method. - * @param gameObject The Game Object to be enabled for input. - * @param hitArea Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used. - * @param hitAreaCallback The 'contains' function to invoke to check if the pointer is within the hit area. - * @param dropZone Is this Game Object a drop zone or not? Default false. - */ - enable(gameObject: Phaser.GameObjects.GameObject, hitArea?: Phaser.Types.Input.InputConfiguration | any, hitAreaCallback?: Phaser.Types.Input.HitAreaCallback, dropZone?: boolean): this; - - /** - * Takes the given Pointer and performs a hit test against it, to see which interactive Game Objects - * it is currently above. - * - * The hit test is performed against which-ever Camera the Pointer is over. If it is over multiple - * cameras, it starts checking the camera at the top of the camera list, and if nothing is found, iterates down the list. - * @param pointer The Pointer to check against the Game Objects. - */ - hitTestPointer(pointer: Phaser.Input.Pointer): Phaser.GameObjects.GameObject[]; - - /** - * Returns the drag state of the given Pointer for this Input Plugin. - * - * The state will be one of the following: - * - * 0 = Not dragging anything - * 1 = Primary button down and objects below, so collect a draglist - * 2 = Pointer being checked if meets drag criteria - * 3 = Pointer meets criteria, notify the draglist - * 4 = Pointer actively dragging the draglist and has moved - * 5 = Pointer actively dragging but has been released, notify draglist - * @param pointer The Pointer to get the drag state for. - */ - getDragState(pointer: Phaser.Input.Pointer): number; - - /** - * Sets the drag state of the given Pointer for this Input Plugin. - * - * The state must be one of the following values: - * - * 0 = Not dragging anything - * 1 = Primary button down and objects below, so collect a draglist - * 2 = Pointer being checked if meets drag criteria - * 3 = Pointer meets criteria, notify the draglist - * 4 = Pointer actively dragging the draglist and has moved - * 5 = Pointer actively dragging but has been released, notify draglist - * @param pointer The Pointer to set the drag state for. - * @param state The drag state value. An integer between 0 and 5. - */ - setDragState(pointer: Phaser.Input.Pointer, state: number): void; - - /** - * Sets the draggable state of the given array of Game Objects. - * - * They can either be set to be draggable, or can have their draggable state removed by passing `false`. - * - * A Game Object will not fire drag events unless it has been specifically enabled for drag. - * @param gameObjects An array of Game Objects to change the draggable state on. - * @param value Set to `true` if the Game Objects should be made draggable, `false` if they should be unset. Default true. - */ - setDraggable(gameObjects: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], value?: boolean): this; - - /** - * Creates a function that can be passed to `setInteractive`, `enable` or `setHitArea` that will handle - * pixel-perfect input detection on an Image or Sprite based Game Object, or any custom class that extends them. - * - * The following will create a sprite that is clickable on any pixel that has an alpha value >= 1. - * - * ```javascript - * this.add.sprite(x, y, key).setInteractive(this.input.makePixelPerfect()); - * ``` - * - * The following will create a sprite that is clickable on any pixel that has an alpha value >= 150. - * - * ```javascript - * this.add.sprite(x, y, key).setInteractive(this.input.makePixelPerfect(150)); - * ``` - * - * Once you have made an Interactive Object pixel perfect it impacts all input related events for it: down, up, - * dragstart, drag, etc. - * - * As a pointer interacts with the Game Object it will constantly poll the texture, extracting a single pixel from - * the given coordinates and checking its color values. This is an expensive process, so should only be enabled on - * Game Objects that really need it. - * - * You cannot make non-texture based Game Objects pixel perfect. So this will not work on Graphics, BitmapText, - * Render Textures, Text, Tilemaps, Containers or Particles. - * @param alphaTolerance The alpha level that the pixel should be above to be included as a successful interaction. Default 1. - */ - makePixelPerfect(alphaTolerance?: number): Function; - - /** - * Sets the hit area for the given array of Game Objects. - * - * A hit area is typically one of the geometric shapes Phaser provides, such as a `Phaser.Geom.Rectangle` - * or `Phaser.Geom.Circle`. However, it can be any object as long as it works with the provided callback. - * - * If no hit area is provided a Rectangle is created based on the size of the Game Object, if possible - * to calculate. - * - * The hit area callback is the function that takes an `x` and `y` coordinate and returns a boolean if - * those values fall within the area of the shape or not. All of the Phaser geometry objects provide this, - * such as `Phaser.Geom.Rectangle.Contains`. - * @param gameObjects An array of Game Objects to set the hit area on. - * @param hitArea Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used. - * @param hitAreaCallback The 'contains' function to invoke to check if the pointer is within the hit area. - */ - setHitArea(gameObjects: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], hitArea?: Phaser.Types.Input.InputConfiguration | any, hitAreaCallback?: Phaser.Types.Input.HitAreaCallback): this; - - /** - * Sets the hit area for an array of Game Objects to be a `Phaser.Geom.Circle` shape, using - * the given coordinates and radius to control its position and size. - * @param gameObjects An array of Game Objects to set as having a circle hit area. - * @param x The center of the circle. - * @param y The center of the circle. - * @param radius The radius of the circle. - * @param callback The hit area callback. If undefined it uses Circle.Contains. - */ - setHitAreaCircle(gameObjects: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], x: number, y: number, radius: number, callback?: Phaser.Types.Input.HitAreaCallback): this; - - /** - * Sets the hit area for an array of Game Objects to be a `Phaser.Geom.Ellipse` shape, using - * the given coordinates and dimensions to control its position and size. - * @param gameObjects An array of Game Objects to set as having an ellipse hit area. - * @param x The center of the ellipse. - * @param y The center of the ellipse. - * @param width The width of the ellipse. - * @param height The height of the ellipse. - * @param callback The hit area callback. If undefined it uses Ellipse.Contains. - */ - setHitAreaEllipse(gameObjects: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], x: number, y: number, width: number, height: number, callback?: Phaser.Types.Input.HitAreaCallback): this; - - /** - * Sets the hit area for an array of Game Objects to be a `Phaser.Geom.Rectangle` shape, using - * the Game Objects texture frame to define the position and size of the hit area. - * @param gameObjects An array of Game Objects to set as having an ellipse hit area. - * @param callback The hit area callback. If undefined it uses Rectangle.Contains. - */ - setHitAreaFromTexture(gameObjects: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], callback?: Phaser.Types.Input.HitAreaCallback): this; - - /** - * Sets the hit area for an array of Game Objects to be a `Phaser.Geom.Rectangle` shape, using - * the given coordinates and dimensions to control its position and size. - * @param gameObjects An array of Game Objects to set as having a rectangular hit area. - * @param x The top-left of the rectangle. - * @param y The top-left of the rectangle. - * @param width The width of the rectangle. - * @param height The height of the rectangle. - * @param callback The hit area callback. If undefined it uses Rectangle.Contains. - */ - setHitAreaRectangle(gameObjects: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], x: number, y: number, width: number, height: number, callback?: Phaser.Types.Input.HitAreaCallback): this; - - /** - * Sets the hit area for an array of Game Objects to be a `Phaser.Geom.Triangle` shape, using - * the given coordinates to control the position of its points. - * @param gameObjects An array of Game Objects to set as having a triangular hit area. - * @param x1 The x coordinate of the first point of the triangle. - * @param y1 The y coordinate of the first point of the triangle. - * @param x2 The x coordinate of the second point of the triangle. - * @param y2 The y coordinate of the second point of the triangle. - * @param x3 The x coordinate of the third point of the triangle. - * @param y3 The y coordinate of the third point of the triangle. - * @param callback The hit area callback. If undefined it uses Triangle.Contains. - */ - setHitAreaTriangle(gameObjects: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, callback?: Phaser.Types.Input.HitAreaCallback): this; - - /** - * Creates an Input Debug Shape for the given Game Object. - * - * The Game Object must have _already_ been enabled for input prior to calling this method. - * - * This is intended to assist you during development and debugging. - * - * Debug Shapes can only be created for Game Objects that are using standard Phaser Geometry for input, - * including: Circle, Ellipse, Line, Polygon, Rectangle and Triangle. - * - * Game Objects that are using their automatic hit areas are using Rectangles by default, so will also work. - * - * The Debug Shape is created and added to the display list and is then kept in sync with the Game Object - * it is connected with. Should you need to modify it yourself, such as to hide it, you can access it via - * the Game Object property: `GameObject.input.hitAreaDebug`. - * - * Calling this method on a Game Object that already has a Debug Shape will first destroy the old shape, - * before creating a new one. If you wish to remove the Debug Shape entirely, you should call the - * method `InputPlugin.removeDebug`. - * - * Note that the debug shape will only show the outline of the input area. If the input test is using a - * pixel perfect check, for example, then this is not displayed. If you are using a custom shape, that - * doesn't extend one of the base Phaser Geometry objects, as your hit area, then this method will not - * work. - * @param gameObject The Game Object to create the input debug shape for. - * @param color The outline color of the debug shape. Default 0x00ff00. - */ - enableDebug(gameObject: Phaser.GameObjects.GameObject, color?: number): this; - - /** - * Removes an Input Debug Shape from the given Game Object. - * - * The shape is destroyed immediately and the `hitAreaDebug` property is set to `null`. - * @param gameObject The Game Object to remove the input debug shape from. - */ - removeDebug(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Sets the Pointers to always poll. - * - * When a pointer is polled it runs a hit test to see which Game Objects are currently below it, - * or being interacted with it, regardless if the Pointer has actually moved or not. - * - * You should enable this if you want objects in your game to fire over / out events, and the objects - * are constantly moving, but the pointer may not have. Polling every frame has additional computation - * costs, especially if there are a large number of interactive objects in your game. - */ - setPollAlways(): this; - - /** - * Sets the Pointers to only poll when they are moved or updated. - * - * When a pointer is polled it runs a hit test to see which Game Objects are currently below it, - * or being interacted with it. - */ - setPollOnMove(): this; - - /** - * Sets the poll rate value. This is the amount of time that should have elapsed before a pointer - * will be polled again. See the `setPollAlways` and `setPollOnMove` methods. - * @param value The amount of time, in ms, that should elapsed before re-polling the pointers. - */ - setPollRate(value: number): this; - - /** - * When set to `true` the global Input Manager will emulate DOM behavior by only emitting events from - * the top-most Scene in the Scene List. By default, if a Scene receives an input event it will then stop the event - * from flowing down to any Scenes below it in the Scene list. To disable this behavior call this method with `false`. - * @param value Set to `true` to stop processing input events on the Scene that receives it, or `false` to let the event continue down the Scene list. - */ - setGlobalTopOnly(value: boolean): this; - - /** - * When set to `true` this Input Plugin will emulate DOM behavior by only emitting events from - * the top-most Game Objects in the Display List. - * - * If set to `false` it will emit events from all Game Objects below a Pointer, not just the top one. - * @param value `true` to only include the top-most Game Object, or `false` to include all Game Objects in a hit test. - */ - setTopOnly(value: boolean): this; - - /** - * Given an array of Game Objects and a Pointer, sort the array and return it, - * so that the objects are in render order with the lowest at the bottom. - * @param gameObjects An array of Game Objects to be sorted. - * @param pointer The Pointer to check against the Game Objects. - */ - sortGameObjects(gameObjects: Phaser.GameObjects.GameObject[], pointer: Phaser.Input.Pointer): Phaser.GameObjects.GameObject[]; - - /** - * Given an array of Drop Zone Game Objects, sort the array and return it, - * so that the objects are in depth index order with the lowest at the bottom. - * @param gameObjects An array of Game Objects to be sorted. - */ - sortDropZones(gameObjects: Phaser.GameObjects.GameObject[]): Phaser.GameObjects.GameObject[]; - - /** - * This method should be called from within an input event handler, such as `pointerdown`. - * - * When called, it stops the Input Manager from allowing _this specific event_ to be processed by any other Scene - * not yet handled in the scene list. - */ - stopPropagation(): this; - - /** - * Adds new Pointer objects to the Input Manager. - * - * By default Phaser creates 2 pointer objects: `mousePointer` and `pointer1`. - * - * You can create more either by calling this method, or by setting the `input.activePointers` property - * in the Game Config, up to a maximum of 10 pointers. - * - * The first 10 pointers are available via the `InputPlugin.pointerX` properties, once they have been added - * via this method. - * @param quantity The number of new Pointers to create. A maximum of 10 is allowed in total. Default 1. - */ - addPointer(quantity?: number): Phaser.Input.Pointer[]; - - /** - * Tells the Input system to set a custom cursor. - * - * This cursor will be the default cursor used when interacting with the game canvas. - * - * If an Interactive Object also sets a custom cursor, this is the cursor that is reset after its use. - * - * Any valid CSS cursor value is allowed, including paths to image files, i.e.: - * - * ```javascript - * this.input.setDefaultCursor('url(assets/cursors/sword.cur), pointer'); - * ``` - * - * Please read about the differences between browsers when it comes to the file formats and sizes they support: - * - * https://developer.mozilla.org/en-US/docs/Web/CSS/cursor - * https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_User_Interface/Using_URL_values_for_the_cursor_property - * - * It's up to you to pick a suitable cursor format that works across the range of browsers you need to support. - * @param cursor The CSS to be used when setting the default cursor. - */ - setDefaultCursor(cursor: string): this; - - /** - * The x coordinates of the ActivePointer based on the first camera in the camera list. - * This is only safe to use if your game has just 1 non-transformed camera and doesn't use multi-touch. - */ - readonly x: number; - - /** - * The y coordinates of the ActivePointer based on the first camera in the camera list. - * This is only safe to use if your game has just 1 non-transformed camera and doesn't use multi-touch. - */ - readonly y: number; - - /** - * Are any mouse or touch pointers currently over the game canvas? - */ - readonly isOver: boolean; - - /** - * The mouse has its own unique Pointer object, which you can reference directly if making a _desktop specific game_. - * If you are supporting both desktop and touch devices then do not use this property, instead use `activePointer` - * which will always map to the most recently interacted pointer. - */ - readonly mousePointer: Phaser.Input.Pointer; - - /** - * The current active input Pointer. - */ - readonly activePointer: Phaser.Input.Pointer; - - /** - * A touch-based Pointer object. - * This will be `undefined` by default unless you add a new Pointer using `addPointer`. - */ - readonly pointer1: Phaser.Input.Pointer; - - /** - * A touch-based Pointer object. - * This will be `undefined` by default unless you add a new Pointer using `addPointer`. - */ - readonly pointer2: Phaser.Input.Pointer; - - /** - * A touch-based Pointer object. - * This will be `undefined` by default unless you add a new Pointer using `addPointer`. - */ - readonly pointer3: Phaser.Input.Pointer; - - /** - * A touch-based Pointer object. - * This will be `undefined` by default unless you add a new Pointer using `addPointer`. - */ - readonly pointer4: Phaser.Input.Pointer; - - /** - * A touch-based Pointer object. - * This will be `undefined` by default unless you add a new Pointer using `addPointer`. - */ - readonly pointer5: Phaser.Input.Pointer; - - /** - * A touch-based Pointer object. - * This will be `undefined` by default unless you add a new Pointer using `addPointer`. - */ - readonly pointer6: Phaser.Input.Pointer; - - /** - * A touch-based Pointer object. - * This will be `undefined` by default unless you add a new Pointer using `addPointer`. - */ - readonly pointer7: Phaser.Input.Pointer; - - /** - * A touch-based Pointer object. - * This will be `undefined` by default unless you add a new Pointer using `addPointer`. - */ - readonly pointer8: Phaser.Input.Pointer; - - /** - * A touch-based Pointer object. - * This will be `undefined` by default unless you add a new Pointer using `addPointer`. - */ - readonly pointer9: Phaser.Input.Pointer; - - /** - * A touch-based Pointer object. - * This will be `undefined` by default unless you add a new Pointer using `addPointer`. - */ - readonly pointer10: Phaser.Input.Pointer; - - /** - * An instance of the Keyboard Plugin class, if enabled via the `input.keyboard` Scene or Game Config property. - * Use this to create Key objects and listen for keyboard specific events. - */ - keyboard: Phaser.Input.Keyboard.KeyboardPlugin | null; - - } - - namespace InputPluginCache { - /** - * Static method called directly by the Core internal Plugins. - * Key is a reference used to get the plugin from the plugins object (i.e. InputPlugin) - * Plugin is the object to instantiate to create the plugin - * Mapping is what the plugin is injected into the Scene.Systems as (i.e. input) - * @param key A reference used to get this plugin from the plugin cache. - * @param plugin The plugin to be stored. Should be the core object, not instantiated. - * @param mapping If this plugin is to be injected into the Input Plugin, this is the property key used. - * @param settingsKey The key in the Scene Settings to check to see if this plugin should install or not. - * @param configKey The key in the Game Config to check to see if this plugin should install or not. - */ - function register(key: string, plugin: Function, mapping: string, settingsKey: string, configKey: string): void; - - /** - * Returns the input plugin object from the cache based on the given key. - * @param key The key of the input plugin to get. - */ - function getPlugin(key: string): Phaser.Types.Input.InputPluginContainer; - - /** - * Installs all of the registered Input Plugins into the given target. - * @param target The target InputPlugin to install the plugins into. - */ - function install(target: Phaser.Input.InputPlugin): void; - - /** - * Removes an input plugin based on the given key. - * @param key The key of the input plugin to remove. - */ - function remove(key: string): void; - } namespace Keyboard { - /** - * A KeyCombo will listen for a specific string of keys from the Keyboard, and when it receives them - * it will emit a `keycombomatch` event from the Keyboard Manager. - * - * The keys to be listened for can be defined as: - * - * A string (i.e. 'ATARI') - * An array of either integers (key codes) or strings, or a mixture of both - * An array of objects (such as Key objects) with a public 'keyCode' property - * - * For example, to listen for the Konami code (up, up, down, down, left, right, left, right, b, a, enter) - * you could pass the following array of key codes: - * - * ```javascript - * this.input.keyboard.createCombo([ 38, 38, 40, 40, 37, 39, 37, 39, 66, 65, 13 ], { resetOnMatch: true }); - * - * this.input.keyboard.on('keycombomatch', function (event) { - * console.log('Konami Code entered!'); - * }); - * ``` - * - * Or, to listen for the user entering the word PHASER: - * - * ```javascript - * this.input.keyboard.createCombo('PHASER'); - * ``` - */ - class KeyCombo { - /** - * - * @param keyboardPlugin A reference to the Keyboard Plugin. - * @param keys The keys that comprise this combo. - * @param config A Key Combo configuration object. - */ - constructor(keyboardPlugin: Phaser.Input.Keyboard.KeyboardPlugin, keys: string | number[] | object[], config?: Phaser.Types.Input.Keyboard.KeyComboConfig); - - /** - * A reference to the Keyboard Manager - */ - manager: Phaser.Input.Keyboard.KeyboardPlugin; - - /** - * A flag that controls if this Key Combo is actively processing keys or not. - */ - enabled: boolean; - - /** - * An array of the keycodes that comprise this combo. - */ - keyCodes: any[]; - - /** - * The current keyCode the combo is waiting for. - */ - current: number; - - /** - * The current index of the key being waited for in the 'keys' string. - */ - index: number; - - /** - * The length of this combo (in keycodes) - */ - size: number; - - /** - * The time the previous key in the combo was matched. - */ - timeLastMatched: number; - - /** - * Has this Key Combo been matched yet? - */ - matched: boolean; - - /** - * The time the entire combo was matched. - */ - timeMatched: number; - - /** - * If they press the wrong key do we reset the combo? - */ - resetOnWrongKey: boolean; - - /** - * The max delay in ms between each key press. Above this the combo is reset. 0 means disabled. - */ - maxKeyDelay: number; - - /** - * If previously matched and they press the first key of the combo again, will it reset? - */ - resetOnMatch: boolean; - - /** - * If the combo matches, will it delete itself? - */ - deleteOnMatch: boolean; - - /** - * How far complete is this combo? A value between 0 and 1. - */ - readonly progress: number; - - /** - * Destroys this Key Combo and all of its references. - */ - destroy(): void; - - } - - namespace Events { - /** - * The Global Key Down Event. - * - * This event is dispatched by the Keyboard Plugin when any key on the keyboard is pressed down. - * - * Listen to this event from within a Scene using: `this.input.keyboard.on('keydown', listener)`. - * - * You can also listen for a specific key being pressed. See [Keyboard.Events.KEY_DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:KEY_DOWN} for details. - * - * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:DOWN} for details. - * - * _Note_: Many keyboards are unable to process certain combinations of keys due to hardware limitations known as ghosting. - * Read [this article on ghosting]{@link http://www.html5gamedevs.com/topic/4876-impossible-to-use-more-than-2-keyboard-input-buttons-at-the-same-time/} for details. - * - * Also, please be aware that some browser extensions can disable or override Phaser keyboard handling. - * For example, the Chrome extension vimium is known to disable Phaser from using the D key, while EverNote disables the backtick key. - * There are others. So, please check your extensions if you find you have specific keys that don't work. - */ - const ANY_KEY_DOWN: any; - - /** - * The Global Key Up Event. - * - * This event is dispatched by the Keyboard Plugin when any key on the keyboard is released. - * - * Listen to this event from within a Scene using: `this.input.keyboard.on('keyup', listener)`. - * - * You can also listen for a specific key being released. See [Keyboard.Events.KEY_UP]{@linkcode Phaser.Input.Keyboard.Events#event:KEY_UP} for details. - * - * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.UP]{@linkcode Phaser.Input.Keyboard.Events#event:UP} for details. - */ - const ANY_KEY_UP: any; - - /** - * The Key Combo Match Event. - * - * This event is dispatched by the Keyboard Plugin when a [Key Combo]{@link Phaser.Input.Keyboard.KeyCombo} is matched. - * - * Listen for this event from the Key Plugin after a combo has been created: - * - * ```javascript - * this.input.keyboard.createCombo([ 38, 38, 40, 40, 37, 39, 37, 39, 66, 65, 13 ], { resetOnMatch: true }); - * - * this.input.keyboard.on('keycombomatch', function (event) { - * console.log('Konami Code entered!'); - * }); - * ``` - */ - const COMBO_MATCH: any; - - /** - * The Key Down Event. - * - * This event is dispatched by a [Key]{@link Phaser.Input.Keyboard.Key} object when it is pressed. - * - * Listen for this event from the Key object instance directly: - * - * ```javascript - * var spaceBar = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE); - * - * spaceBar.on('down', listener) - * ``` - * - * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_DOWN} for details. - */ - const DOWN: any; - - /** - * The Key Down Event. - * - * This event is dispatched by the Keyboard Plugin when any key on the keyboard is pressed down. - * - * Unlike the `ANY_KEY_DOWN` event, this one has a special dynamic event name. For example, to listen for the `A` key being pressed - * use the following from within a Scene: `this.input.keyboard.on('keydown-A', listener)`. You can replace the `-A` part of the event - * name with any valid [Key Code string]{@link Phaser.Input.Keyboard.KeyCodes}. For example, this will listen for the space bar: - * `this.input.keyboard.on('keydown-SPACE', listener)`. - * - * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_DOWN} for details. - * - * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:DOWN} for details. - * - * _Note_: Many keyboards are unable to process certain combinations of keys due to hardware limitations known as ghosting. - * Read [this article on ghosting]{@link http://www.html5gamedevs.com/topic/4876-impossible-to-use-more-than-2-keyboard-input-buttons-at-the-same-time/} for details. - * - * Also, please be aware that some browser extensions can disable or override Phaser keyboard handling. - * For example, the Chrome extension vimium is known to disable Phaser from using the D key, while EverNote disables the backtick key. - * There are others. So, please check your extensions if you find you have specific keys that don't work. - */ - const KEY_DOWN: any; - - /** - * The Key Up Event. - * - * This event is dispatched by the Keyboard Plugin when any key on the keyboard is released. - * - * Unlike the `ANY_KEY_UP` event, this one has a special dynamic event name. For example, to listen for the `A` key being released - * use the following from within a Scene: `this.input.keyboard.on('keyup-A', listener)`. You can replace the `-A` part of the event - * name with any valid [Key Code string]{@link Phaser.Input.Keyboard.KeyCodes}. For example, this will listen for the space bar: - * `this.input.keyboard.on('keyup-SPACE', listener)`. - * - * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_UP]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_UP} for details. - * - * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.UP]{@linkcode Phaser.Input.Keyboard.Events#event:UP} for details. - */ - const KEY_UP: any; - - /** - * The Key Up Event. - * - * This event is dispatched by a [Key]{@link Phaser.Input.Keyboard.Key} object when it is released. - * - * Listen for this event from the Key object instance directly: - * - * ```javascript - * var spaceBar = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE); - * - * spaceBar.on('up', listener) - * ``` - * - * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_UP]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_UP} for details. - */ - const UP: any; - - } - /** * The Keyboard Manager is a helper class that belongs to the global Input Manager. * @@ -52349,6 +52572,245 @@ declare namespace Phaser { } + /** + * A KeyCombo will listen for a specific string of keys from the Keyboard, and when it receives them + * it will emit a `keycombomatch` event from the Keyboard Manager. + * + * The keys to be listened for can be defined as: + * + * A string (i.e. 'ATARI') + * An array of either integers (key codes) or strings, or a mixture of both + * An array of objects (such as Key objects) with a public 'keyCode' property + * + * For example, to listen for the Konami code (up, up, down, down, left, right, left, right, b, a, enter) + * you could pass the following array of key codes: + * + * ```javascript + * this.input.keyboard.createCombo([ 38, 38, 40, 40, 37, 39, 37, 39, 66, 65, 13 ], { resetOnMatch: true }); + * + * this.input.keyboard.on('keycombomatch', function (event) { + * console.log('Konami Code entered!'); + * }); + * ``` + * + * Or, to listen for the user entering the word PHASER: + * + * ```javascript + * this.input.keyboard.createCombo('PHASER'); + * ``` + */ + class KeyCombo { + /** + * + * @param keyboardPlugin A reference to the Keyboard Plugin. + * @param keys The keys that comprise this combo. + * @param config A Key Combo configuration object. + */ + constructor(keyboardPlugin: Phaser.Input.Keyboard.KeyboardPlugin, keys: string | number[] | object[], config?: Phaser.Types.Input.Keyboard.KeyComboConfig); + + /** + * A reference to the Keyboard Manager + */ + manager: Phaser.Input.Keyboard.KeyboardPlugin; + + /** + * A flag that controls if this Key Combo is actively processing keys or not. + */ + enabled: boolean; + + /** + * An array of the keycodes that comprise this combo. + */ + keyCodes: any[]; + + /** + * The current keyCode the combo is waiting for. + */ + current: number; + + /** + * The current index of the key being waited for in the 'keys' string. + */ + index: number; + + /** + * The length of this combo (in keycodes) + */ + size: number; + + /** + * The time the previous key in the combo was matched. + */ + timeLastMatched: number; + + /** + * Has this Key Combo been matched yet? + */ + matched: boolean; + + /** + * The time the entire combo was matched. + */ + timeMatched: number; + + /** + * If they press the wrong key do we reset the combo? + */ + resetOnWrongKey: boolean; + + /** + * The max delay in ms between each key press. Above this the combo is reset. 0 means disabled. + */ + maxKeyDelay: number; + + /** + * If previously matched and they press the first key of the combo again, will it reset? + */ + resetOnMatch: boolean; + + /** + * If the combo matches, will it delete itself? + */ + deleteOnMatch: boolean; + + /** + * How far complete is this combo? A value between 0 and 1. + */ + readonly progress: number; + + /** + * Destroys this Key Combo and all of its references. + */ + destroy(): void; + + } + + namespace Events { + /** + * The Global Key Down Event. + * + * This event is dispatched by the Keyboard Plugin when any key on the keyboard is pressed down. + * + * Listen to this event from within a Scene using: `this.input.keyboard.on('keydown', listener)`. + * + * You can also listen for a specific key being pressed. See [Keyboard.Events.KEY_DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:KEY_DOWN} for details. + * + * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:DOWN} for details. + * + * _Note_: Many keyboards are unable to process certain combinations of keys due to hardware limitations known as ghosting. + * Read [this article on ghosting]{@link http://www.html5gamedevs.com/topic/4876-impossible-to-use-more-than-2-keyboard-input-buttons-at-the-same-time/} for details. + * + * Also, please be aware that some browser extensions can disable or override Phaser keyboard handling. + * For example, the Chrome extension vimium is known to disable Phaser from using the D key, while EverNote disables the backtick key. + * There are others. So, please check your extensions if you find you have specific keys that don't work. + */ + const ANY_KEY_DOWN: any; + + /** + * The Global Key Up Event. + * + * This event is dispatched by the Keyboard Plugin when any key on the keyboard is released. + * + * Listen to this event from within a Scene using: `this.input.keyboard.on('keyup', listener)`. + * + * You can also listen for a specific key being released. See [Keyboard.Events.KEY_UP]{@linkcode Phaser.Input.Keyboard.Events#event:KEY_UP} for details. + * + * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.UP]{@linkcode Phaser.Input.Keyboard.Events#event:UP} for details. + */ + const ANY_KEY_UP: any; + + /** + * The Key Combo Match Event. + * + * This event is dispatched by the Keyboard Plugin when a [Key Combo]{@link Phaser.Input.Keyboard.KeyCombo} is matched. + * + * Listen for this event from the Key Plugin after a combo has been created: + * + * ```javascript + * this.input.keyboard.createCombo([ 38, 38, 40, 40, 37, 39, 37, 39, 66, 65, 13 ], { resetOnMatch: true }); + * + * this.input.keyboard.on('keycombomatch', function (event) { + * console.log('Konami Code entered!'); + * }); + * ``` + */ + const COMBO_MATCH: any; + + /** + * The Key Down Event. + * + * This event is dispatched by a [Key]{@link Phaser.Input.Keyboard.Key} object when it is pressed. + * + * Listen for this event from the Key object instance directly: + * + * ```javascript + * var spaceBar = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE); + * + * spaceBar.on('down', listener) + * ``` + * + * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_DOWN} for details. + */ + const DOWN: any; + + /** + * The Key Down Event. + * + * This event is dispatched by the Keyboard Plugin when any key on the keyboard is pressed down. + * + * Unlike the `ANY_KEY_DOWN` event, this one has a special dynamic event name. For example, to listen for the `A` key being pressed + * use the following from within a Scene: `this.input.keyboard.on('keydown-A', listener)`. You can replace the `-A` part of the event + * name with any valid [Key Code string]{@link Phaser.Input.Keyboard.KeyCodes}. For example, this will listen for the space bar: + * `this.input.keyboard.on('keydown-SPACE', listener)`. + * + * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_DOWN} for details. + * + * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:DOWN} for details. + * + * _Note_: Many keyboards are unable to process certain combinations of keys due to hardware limitations known as ghosting. + * Read [this article on ghosting]{@link http://www.html5gamedevs.com/topic/4876-impossible-to-use-more-than-2-keyboard-input-buttons-at-the-same-time/} for details. + * + * Also, please be aware that some browser extensions can disable or override Phaser keyboard handling. + * For example, the Chrome extension vimium is known to disable Phaser from using the D key, while EverNote disables the backtick key. + * There are others. So, please check your extensions if you find you have specific keys that don't work. + */ + const KEY_DOWN: any; + + /** + * The Key Up Event. + * + * This event is dispatched by the Keyboard Plugin when any key on the keyboard is released. + * + * Unlike the `ANY_KEY_UP` event, this one has a special dynamic event name. For example, to listen for the `A` key being released + * use the following from within a Scene: `this.input.keyboard.on('keyup-A', listener)`. You can replace the `-A` part of the event + * name with any valid [Key Code string]{@link Phaser.Input.Keyboard.KeyCodes}. For example, this will listen for the space bar: + * `this.input.keyboard.on('keyup-SPACE', listener)`. + * + * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_UP]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_UP} for details. + * + * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.UP]{@linkcode Phaser.Input.Keyboard.Events#event:UP} for details. + */ + const KEY_UP: any; + + /** + * The Key Up Event. + * + * This event is dispatched by a [Key]{@link Phaser.Input.Keyboard.Key} object when it is released. + * + * Listen for this event from the Key object instance directly: + * + * ```javascript + * var spaceBar = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE); + * + * spaceBar.on('up', listener) + * ``` + * + * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_UP]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_UP} for details. + */ + const UP: any; + + } + /** * Returns `true` if the Key was pressed down within the `duration` value given, based on the current * game clock time. Or `false` if it either isn't down, or was pressed down longer ago than the given duration. @@ -53215,468 +53677,6 @@ declare namespace Phaser { } - /** - * A Pointer object encapsulates both mouse and touch input within Phaser. - * - * By default, Phaser will create 2 pointers for your game to use. If you require more, i.e. for a multi-touch - * game, then use the `InputPlugin.addPointer` method to do so, rather than instantiating this class directly, - * otherwise it won't be managed by the input system. - * - * You can reference the current active pointer via `InputPlugin.activePointer`. You can also use the properties - * `InputPlugin.pointer1` through to `pointer10`, for each pointer you have enabled in your game. - * - * The properties of this object are set by the Input Plugin during processing. This object is then sent in all - * input related events that the Input Plugin emits, so you can reference properties from it directly in your - * callbacks. - */ - class Pointer { - /** - * - * @param manager A reference to the Input Manager. - * @param id The internal ID of this Pointer. - */ - constructor(manager: Phaser.Input.InputManager, id: number); - - /** - * A reference to the Input Manager. - */ - manager: Phaser.Input.InputManager; - - /** - * The internal ID of this Pointer. - */ - readonly id: number; - - /** - * The most recent native DOM Event this Pointer has processed. - */ - event: TouchEvent | MouseEvent | WheelEvent; - - /** - * The DOM element the Pointer was pressed down on, taken from the DOM event. - * In a default set-up this will be the Canvas that Phaser is rendering to, or the Window element. - */ - readonly downElement: any; - - /** - * The DOM element the Pointer was released on, taken from the DOM event. - * In a default set-up this will be the Canvas that Phaser is rendering to, or the Window element. - */ - readonly upElement: any; - - /** - * The camera the Pointer interacted with during its last update. - * - * A Pointer can only ever interact with one camera at once, which will be the top-most camera - * in the list should multiple cameras be positioned on-top of each other. - */ - camera: Phaser.Cameras.Scene2D.Camera; - - /** - * A read-only property that indicates which button was pressed, or released, on the pointer - * during the most recent event. It is only set during `up` and `down` events. - * - * On Touch devices the value is always 0. - * - * Users may change the configuration of buttons on their pointing device so that if an event's button property - * is zero, it may not have been caused by the button that is physically left–most on the pointing device; - * however, it should behave as if the left button was clicked in the standard button layout. - */ - readonly button: number; - - /** - * 0: No button or un-initialized - * 1: Left button - * 2: Right button - * 4: Wheel button or middle button - * 8: 4th button (typically the "Browser Back" button) - * 16: 5th button (typically the "Browser Forward" button) - * - * For a mouse configured for left-handed use, the button actions are reversed. - * In this case, the values are read from right to left. - */ - buttons: number; - - /** - * The position of the Pointer in screen space. - */ - readonly position: Phaser.Math.Vector2; - - /** - * The previous position of the Pointer in screen space. - * - * The old x and y values are stored in here during the InputManager.transformPointer call. - * - * Use the properties `velocity`, `angle` and `distance` to create your own gesture recognition. - */ - readonly prevPosition: Phaser.Math.Vector2; - - /** - * The current velocity of the Pointer, based on its current and previous positions. - * - * This value is smoothed out each frame, according to the `motionFactor` property. - * - * This property is updated whenever the Pointer moves, regardless of any button states. In other words, - * it changes based on movement alone - a button doesn't have to be pressed first. - */ - readonly velocity: Phaser.Math.Vector2; - - /** - * The current angle the Pointer is moving, in radians, based on its previous and current position. - * - * The angle is based on the old position facing to the current position. - * - * This property is updated whenever the Pointer moves, regardless of any button states. In other words, - * it changes based on movement alone - a button doesn't have to be pressed first. - */ - readonly angle: number; - - /** - * The distance the Pointer has moved, based on its previous and current position. - * - * This value is smoothed out each frame, according to the `motionFactor` property. - * - * This property is updated whenever the Pointer moves, regardless of any button states. In other words, - * it changes based on movement alone - a button doesn't have to be pressed first. - * - * If you need the total distance travelled since the primary buttons was pressed down, - * then use the `Pointer.getDistance` method. - */ - readonly distance: number; - - /** - * The smoothing factor to apply to the Pointer position. - * - * Due to their nature, pointer positions are inherently noisy. While this is fine for lots of games, if you need cleaner positions - * then you can set this value to apply an automatic smoothing to the positions as they are recorded. - * - * The default value of zero means 'no smoothing'. - * Set to a small value, such as 0.2, to apply an average level of smoothing between positions. You can do this by changing this - * value directly, or by setting the `input.smoothFactor` property in the Game Config. - * - * Positions are only smoothed when the pointer moves. If the primary button on this Pointer enters an Up or Down state, then the position - * is always precise, and not smoothed. - */ - smoothFactor: number; - - /** - * The factor applied to the motion smoothing each frame. - * - * This value is passed to the Smooth Step Interpolation that is used to calculate the velocity, - * angle and distance of the Pointer. It's applied every frame, until the midPoint reaches the current - * position of the Pointer. 0.2 provides a good average but can be increased if you need a - * quicker update and are working in a high performance environment. Never set this value to - * zero. - */ - motionFactor: number; - - /** - * The x position of this Pointer, translated into the coordinate space of the most recent Camera it interacted with. - * - * If you wish to use this value _outside_ of an input event handler then you should update it first by calling - * the `Pointer.updateWorldPoint` method. - */ - worldX: number; - - /** - * The y position of this Pointer, translated into the coordinate space of the most recent Camera it interacted with. - * - * If you wish to use this value _outside_ of an input event handler then you should update it first by calling - * the `Pointer.updateWorldPoint` method. - */ - worldY: number; - - /** - * Time when this Pointer was most recently moved (regardless of the state of its buttons, if any) - */ - moveTime: number; - - /** - * X coordinate of the Pointer when Button 1 (left button), or Touch, was pressed, used for dragging objects. - */ - downX: number; - - /** - * Y coordinate of the Pointer when Button 1 (left button), or Touch, was pressed, used for dragging objects. - */ - downY: number; - - /** - * The Event timestamp when the first button, or Touch input, was pressed. Used for dragging objects. - */ - downTime: number; - - /** - * X coordinate of the Pointer when Button 1 (left button), or Touch, was released, used for dragging objects. - */ - upX: number; - - /** - * Y coordinate of the Pointer when Button 1 (left button), or Touch, was released, used for dragging objects. - */ - upY: number; - - /** - * The Event timestamp when the final button, or Touch input, was released. Used for dragging objects. - */ - upTime: number; - - /** - * Is the primary button down? (usually button 0, the left mouse button) - */ - primaryDown: boolean; - - /** - * Is _any_ button on this pointer considered as being down? - */ - isDown: boolean; - - /** - * Did the previous input event come from a Touch input (true) or Mouse? (false) - */ - wasTouch: boolean; - - /** - * Did this Pointer get canceled by a touchcancel event? - * - * Note: "canceled" is the American-English spelling of "cancelled". Please don't submit PRs correcting it! - */ - wasCanceled: boolean; - - /** - * If the mouse is locked, the horizontal relative movement of the Pointer in pixels since last frame. - */ - movementX: number; - - /** - * If the mouse is locked, the vertical relative movement of the Pointer in pixels since last frame. - */ - movementY: number; - - /** - * The identifier property of the Pointer as set by the DOM event when this Pointer is started. - */ - identifier: number; - - /** - * The pointerId property of the Pointer as set by the DOM event when this Pointer is started. - * The browser can and will recycle this value. - */ - pointerId: number; - - /** - * An active Pointer is one that is currently pressed down on the display. - * A Mouse is always considered as active. - */ - active: boolean; - - /** - * Is this pointer Pointer Locked? - * - * Only a mouse pointer can be locked and it only becomes locked when requested via - * the browsers Pointer Lock API. - * - * You can request this by calling the `this.input.mouse.requestPointerLock()` method from - * a `pointerdown` or `pointerup` event handler. - */ - readonly locked: boolean; - - /** - * The horizontal scroll amount that occurred due to the user moving a mouse wheel or similar input device. - */ - deltaX: number; - - /** - * The vertical scroll amount that occurred due to the user moving a mouse wheel or similar input device. - * This value will typically be less than 0 if the user scrolls up and greater than zero if scrolling down. - */ - deltaY: number; - - /** - * The z-axis scroll amount that occurred due to the user moving a mouse wheel or similar input device. - */ - deltaZ: number; - - /** - * Takes a Camera and updates this Pointer's `worldX` and `worldY` values so they are - * the result of a translation through the given Camera. - * - * Note that the values will be automatically replaced the moment the Pointer is - * updated by an input event, such as a mouse move, so should be used immediately. - * @param camera The Camera which is being tested against. - */ - updateWorldPoint(camera: Phaser.Cameras.Scene2D.Camera): this; - - /** - * Takes a Camera and returns a Vector2 containing the translated position of this Pointer - * within that Camera. This can be used to convert this Pointers position into camera space. - * @param camera The Camera to use for the translation. - * @param output A Vector2-like object in which to store the translated position. - */ - positionToCamera(camera: Phaser.Cameras.Scene2D.Camera, output?: Phaser.Math.Vector2 | object): Phaser.Math.Vector2 | object; - - /** - * Checks to see if any buttons are being held down on this Pointer. - */ - noButtonDown(): boolean; - - /** - * Checks to see if the left button is being held down on this Pointer. - */ - leftButtonDown(): boolean; - - /** - * Checks to see if the right button is being held down on this Pointer. - */ - rightButtonDown(): boolean; - - /** - * Checks to see if the middle button is being held down on this Pointer. - */ - middleButtonDown(): boolean; - - /** - * Checks to see if the back button is being held down on this Pointer. - */ - backButtonDown(): boolean; - - /** - * Checks to see if the forward button is being held down on this Pointer. - */ - forwardButtonDown(): boolean; - - /** - * Checks to see if the left button was just released on this Pointer. - */ - leftButtonReleased(): boolean; - - /** - * Checks to see if the right button was just released on this Pointer. - */ - rightButtonReleased(): boolean; - - /** - * Checks to see if the middle button was just released on this Pointer. - */ - middleButtonReleased(): boolean; - - /** - * Checks to see if the back button was just released on this Pointer. - */ - backButtonReleased(): boolean; - - /** - * Checks to see if the forward button was just released on this Pointer. - */ - forwardButtonReleased(): boolean; - - /** - * If the Pointer has a button pressed down at the time this method is called, it will return the - * distance between the Pointer's `downX` and `downY` values and the current position. - * - * If no button is held down, it will return the last recorded distance, based on where - * the Pointer was when the button was released. - * - * If you wish to get the distance being travelled currently, based on the velocity of the Pointer, - * then see the `Pointer.distance` property. - */ - getDistance(): number; - - /** - * If the Pointer has a button pressed down at the time this method is called, it will return the - * horizontal distance between the Pointer's `downX` and `downY` values and the current position. - * - * If no button is held down, it will return the last recorded horizontal distance, based on where - * the Pointer was when the button was released. - */ - getDistanceX(): number; - - /** - * If the Pointer has a button pressed down at the time this method is called, it will return the - * vertical distance between the Pointer's `downX` and `downY` values and the current position. - * - * If no button is held down, it will return the last recorded vertical distance, based on where - * the Pointer was when the button was released. - */ - getDistanceY(): number; - - /** - * If the Pointer has a button pressed down at the time this method is called, it will return the - * duration since the button was pressed down. - * - * If no button is held down, it will return the last recorded duration, based on the time - * the last button on the Pointer was released. - */ - getDuration(): number; - - /** - * If the Pointer has a button pressed down at the time this method is called, it will return the - * angle between the Pointer's `downX` and `downY` values and the current position. - * - * If no button is held down, it will return the last recorded angle, based on where - * the Pointer was when the button was released. - * - * The angle is based on the old position facing to the current position. - * - * If you wish to get the current angle, based on the velocity of the Pointer, then - * see the `Pointer.angle` property. - */ - getAngle(): number; - - /** - * Takes the previous and current Pointer positions and then generates an array of interpolated values between - * the two. The array will be populated up to the size of the `steps` argument. - * - * ```javaScript - * var points = pointer.getInterpolatedPosition(4); - * - * // points[0] = { x: 0, y: 0 } - * // points[1] = { x: 2, y: 1 } - * // points[2] = { x: 3, y: 2 } - * // points[3] = { x: 6, y: 3 } - * ``` - * - * Use this if you need to get smoothed values between the previous and current pointer positions. DOM pointer - * events can often fire faster than the main browser loop, and this will help you avoid janky movement - * especially if you have an object following a Pointer. - * - * Note that if you provide an output array it will only be populated up to the number of steps provided. - * It will not clear any previous data that may have existed beyond the range of the steps count. - * - * Internally it uses the Smooth Step interpolation calculation. - * @param steps The number of interpolation steps to use. Default 10. - * @param out An array to store the results in. If not provided a new one will be created. - */ - getInterpolatedPosition(steps?: number, out?: any[]): any[]; - - /** - * Destroys this Pointer instance and resets its external references. - */ - destroy(): void; - - /** - * The x position of this Pointer. - * The value is in screen space. - * See `worldX` to get a camera converted position. - */ - x: number; - - /** - * The y position of this Pointer. - * The value is in screen space. - * See `worldY` to get a camera converted position. - */ - y: number; - - /** - * Time when this Pointer was most recently updated by a DOM Event. - * This comes directly from the `event.timeStamp` property. - * If no event has yet taken place, it will return zero. - */ - readonly time: number; - - } - namespace Touch { /** * The Touch Manager is a helper class that belongs to the Input Manager. @@ -53801,223 +53801,6 @@ declare namespace Phaser { } namespace Loader { - /** - * The Loader is idle. - */ - var LOADER_IDLE: number; - - /** - * The Loader is actively loading. - */ - var LOADER_LOADING: number; - - /** - * The Loader is processing files is has loaded. - */ - var LOADER_PROCESSING: number; - - /** - * The Loader has completed loading and processing. - */ - var LOADER_COMPLETE: number; - - /** - * The Loader is shutting down. - */ - var LOADER_SHUTDOWN: number; - - /** - * The Loader has been destroyed. - */ - var LOADER_DESTROYED: number; - - /** - * File is in the load queue but not yet started. - */ - var FILE_PENDING: number; - - /** - * File has been started to load by the loader (onLoad called) - */ - var FILE_LOADING: number; - - /** - * File has loaded successfully, awaiting processing. - */ - var FILE_LOADED: number; - - /** - * File failed to load. - */ - var FILE_FAILED: number; - - /** - * File is being processed (onProcess callback) - */ - var FILE_PROCESSING: number; - - /** - * The File has errored somehow during processing. - */ - var FILE_ERRORED: number; - - /** - * File has finished processing. - */ - var FILE_COMPLETE: number; - - /** - * File has been destroyed. - */ - var FILE_DESTROYED: number; - - /** - * File was populated from local data and doesn't need an HTTP request. - */ - var FILE_POPULATED: number; - - /** - * File is pending being destroyed. - */ - var FILE_PENDING_DESTROY: number; - - namespace Events { - /** - * The Loader Plugin Add File Event. - * - * This event is dispatched when a new file is successfully added to the Loader and placed into the load queue. - * - * Listen to it from a Scene using: `this.load.on('addfile', listener)`. - * - * If you add lots of files to a Loader from a `preload` method, it will dispatch this event for each one of them. - */ - const ADD: any; - - /** - * The Loader Plugin Complete Event. - * - * This event is dispatched when the Loader has fully processed everything in the load queue. - * By this point every loaded file will now be in its associated cache and ready for use. - * - * Listen to it from a Scene using: `this.load.on('complete', listener)`. - */ - const COMPLETE: any; - - /** - * The File Load Complete Event. - * - * This event is dispatched by the Loader Plugin when _any_ file in the queue finishes loading. - * - * Listen to it from a Scene using: `this.load.on('filecomplete', listener)`. - * - * Make sure you remove this listener when you have finished, or it will continue to fire if the Scene reloads. - * - * You can also listen for the completion of a specific file. See the [FILE_KEY_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_KEY_COMPLETE} event. - */ - const FILE_COMPLETE: any; - - /** - * The File Load Complete Event. - * - * This event is dispatched by the Loader Plugin when any file in the queue finishes loading. - * - * It uses a special dynamic event name constructed from the key and type of the file. - * - * For example, if you have loaded an `image` with a key of `monster`, you can listen for it - * using the following: - * - * ```javascript - * this.load.on('filecomplete-image-monster', function (key, type, data) { - * // Your handler code - * }); - * ``` - * - * Or, if you have loaded a texture `atlas` with a key of `Level1`: - * - * ```javascript - * this.load.on('filecomplete-atlas-Level1', function (key, type, data) { - * // Your handler code - * }); - * ``` - * - * Or, if you have loaded a sprite sheet with a key of `Explosion` and a prefix of `GAMEOVER`: - * - * ```javascript - * this.load.on('filecomplete-spritesheet-GAMEOVERExplosion', function (key, type, data) { - * // Your handler code - * }); - * ``` - * - * Make sure you remove your listeners when you have finished, or they will continue to fire if the Scene reloads. - * - * You can also listen for the generic completion of files. See the [FILE_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_COMPLETE} event. - */ - const FILE_KEY_COMPLETE: any; - - /** - * The File Load Error Event. - * - * This event is dispatched by the Loader Plugin when a file fails to load. - * - * Listen to it from a Scene using: `this.load.on('loaderror', listener)`. - */ - const FILE_LOAD_ERROR: any; - - /** - * The File Load Event. - * - * This event is dispatched by the Loader Plugin when a file finishes loading, - * but _before_ it is processed and added to the internal Phaser caches. - * - * Listen to it from a Scene using: `this.load.on('load', listener)`. - */ - const FILE_LOAD: any; - - /** - * The File Load Progress Event. - * - * This event is dispatched by the Loader Plugin during the load of a file, if the browser receives a DOM ProgressEvent and - * the `lengthComputable` event property is true. Depending on the size of the file and browser in use, this may, or may not happen. - * - * Listen to it from a Scene using: `this.load.on('fileprogress', listener)`. - */ - const FILE_PROGRESS: any; - - /** - * The Loader Plugin Post Process Event. - * - * This event is dispatched by the Loader Plugin when the Loader has finished loading everything in the load queue. - * It is dispatched before the internal lists are cleared and each File is destroyed. - * - * Use this hook to perform any last minute processing of files that can only happen once the - * Loader has completed, but prior to it emitting the `complete` event. - * - * Listen to it from a Scene using: `this.load.on('postprocess', listener)`. - */ - const POST_PROCESS: any; - - /** - * The Loader Plugin Progress Event. - * - * This event is dispatched when the Loader updates its load progress, typically as a result of a file having completed loading. - * - * Listen to it from a Scene using: `this.load.on('progress', listener)`. - */ - const PROGRESS: any; - - /** - * The Loader Plugin Start Event. - * - * This event is dispatched when the Loader starts running. At this point load progress is zero. - * - * This event is dispatched even if there aren't any files in the load queue. - * - * Listen to it from a Scene using: `this.load.on('start', listener)`. - */ - const START: any; - - } - /** * The base File class used by all File Types that the Loader can support. * You shouldn't create an instance of a File directly, but should extend it with your own class, setting a custom type and processing methods. @@ -54225,961 +54008,6 @@ declare namespace Phaser { } - namespace FileTypes { - /** - * A single Animation JSON File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#animation method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#animation. - */ - class AnimationJSONFile extends Phaser.Loader.File { - /** - * - * @param loader A reference to the Loader that is responsible for this file. - * @param key The key to use for this file, or a file configuration object. - * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". - * @param xhrSettings Extra XHR Settings specifically for this file. - * @param dataKey When the JSON file loads only this property will be stored in the Cache. - */ - constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.JSONFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject, dataKey?: string); - - /** - * Called automatically by Loader.nextFile. - * This method controls what extra work this File does with its loaded data. - */ - onProcess(): void; - - /** - * Called at the end of the load process, after the Loader has finished all files in its queue. - */ - onLoadComplete(): void; - - } - - /** - * A single JSON based Texture Atlas File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#atlas method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#atlas. - * - * https://www.codeandweb.com/texturepacker/tutorials/how-to-create-sprite-sheets-for-phaser3?source=photonstorm - */ - class AsepriteFile extends Phaser.Loader.MultiFile { - /** - * - * @param loader A reference to the Loader that is responsible for this file. - * @param key The key to use for this file, or a file configuration object. - * @param textureURL The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". - * @param atlasURL The absolute or relative URL to load the texture atlas json data file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". Or, a well formed JSON object. - * @param textureXhrSettings An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. - * @param atlasXhrSettings An XHR Settings configuration object for the atlas json file. Used in replacement of the Loaders default XHR Settings. - */ - constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.AsepriteFileConfig, textureURL?: string | string[], atlasURL?: object | string, textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject); - - /** - * Adds this file to its target cache upon successful loading and processing. - */ - addToCache(): void; - - } - - /** - * A single JSON based Texture Atlas File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#atlas method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#atlas. - * - * https://www.codeandweb.com/texturepacker/tutorials/how-to-create-sprite-sheets-for-phaser3?source=photonstorm - */ - class AtlasJSONFile extends Phaser.Loader.MultiFile { - /** - * - * @param loader A reference to the Loader that is responsible for this file. - * @param key The key to use for this file, or a file configuration object. - * @param textureURL The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". - * @param atlasURL The absolute or relative URL to load the texture atlas json data file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". Or, a well formed JSON object. - * @param textureXhrSettings An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. - * @param atlasXhrSettings An XHR Settings configuration object for the atlas json file. Used in replacement of the Loaders default XHR Settings. - */ - constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.AtlasJSONFileConfig, textureURL?: string | string[], atlasURL?: object | string, textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject); - - /** - * Adds this file to its target cache upon successful loading and processing. - */ - addToCache(): void; - - } - - /** - * A single XML based Texture Atlas File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#atlasXML method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#atlasXML. - */ - class AtlasXMLFile extends Phaser.Loader.MultiFile { - /** - * - * @param loader A reference to the Loader that is responsible for this file. - * @param key The key to use for this file, or a file configuration object. - * @param textureURL The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". - * @param atlasURL The absolute or relative URL to load the texture atlas xml data file from. If undefined or `null` it will be set to `.xml`, i.e. if `key` was "alien" then the URL will be "alien.xml". - * @param textureXhrSettings An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. - * @param atlasXhrSettings An XHR Settings configuration object for the atlas xml file. Used in replacement of the Loaders default XHR Settings. - */ - constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.AtlasXMLFileConfig, textureURL?: string | string[], atlasURL?: string, textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject); - - /** - * Adds this file to its target cache upon successful loading and processing. - */ - addToCache(): void; - - } - - /** - * A single Audio File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#audio method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#audio. - */ - class AudioFile extends Phaser.Loader.File { - /** - * - * @param loader A reference to the Loader that is responsible for this file. - * @param key The key to use for this file, or a file configuration object. - * @param urlConfig The absolute or relative URL to load this file from in a config object. - * @param xhrSettings Extra XHR Settings specifically for this file. - * @param audioContext The AudioContext this file will use to process itself. - */ - constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.AudioFileConfig, urlConfig?: Phaser.Types.Loader.FileTypes.AudioFileURLConfig, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject, audioContext?: AudioContext); - - /** - * Called automatically by Loader.nextFile. - * This method controls what extra work this File does with its loaded data. - */ - onProcess(): void; - - } - - /** - * An Audio Sprite File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#audioSprite method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#audioSprite. - */ - class AudioSpriteFile extends Phaser.Loader.MultiFile { - /** - * - * @param loader A reference to the Loader that is responsible for this file. - * @param key The key to use for this file, or a file configuration object. - * @param jsonURL The absolute or relative URL to load the json file from. Or a well formed JSON object to use instead. - * @param audioURL The absolute or relative URL to load the audio file from. If empty it will be obtained by parsing the JSON file. - * @param audioConfig The audio configuration options. - * @param audioXhrSettings An XHR Settings configuration object for the audio file. Used in replacement of the Loaders default XHR Settings. - * @param jsonXhrSettings An XHR Settings configuration object for the json file. Used in replacement of the Loaders default XHR Settings. - */ - constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.AudioSpriteFileConfig, jsonURL: string, audioURL?: Object, audioConfig?: any, audioXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, jsonXhrSettings?: Phaser.Types.Loader.XHRSettingsObject); - - /** - * Called by each File when it finishes loading. - * @param file The File that has completed processing. - */ - onFileComplete(file: Phaser.Loader.File): void; - - /** - * Adds this file to its target cache upon successful loading and processing. - */ - addToCache(): void; - - } - - /** - * A single Binary File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#binary method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#binary. - */ - class BinaryFile extends Phaser.Loader.File { - /** - * - * @param loader A reference to the Loader that is responsible for this file. - * @param key The key to use for this file, or a file configuration object. - * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.bin`, i.e. if `key` was "alien" then the URL will be "alien.bin". - * @param xhrSettings Extra XHR Settings specifically for this file. - * @param dataType Optional type to cast the binary file to once loaded. For example, `Uint8Array`. - */ - constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.BinaryFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject, dataType?: any); - - /** - * Called automatically by Loader.nextFile. - * This method controls what extra work this File does with its loaded data. - */ - onProcess(): void; - - } - - /** - * A single Bitmap Font based File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#bitmapFont method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#bitmapFont. - */ - class BitmapFontFile extends Phaser.Loader.MultiFile { - /** - * - * @param loader A reference to the Loader that is responsible for this file. - * @param key The key to use for this file, or a file configuration object. - * @param textureURL The absolute or relative URL to load the font image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". - * @param fontDataURL The absolute or relative URL to load the font xml data file from. If undefined or `null` it will be set to `.xml`, i.e. if `key` was "alien" then the URL will be "alien.xml". - * @param textureXhrSettings An XHR Settings configuration object for the font image file. Used in replacement of the Loaders default XHR Settings. - * @param fontDataXhrSettings An XHR Settings configuration object for the font data xml file. Used in replacement of the Loaders default XHR Settings. - */ - constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.BitmapFontFileConfig, textureURL?: string | string[], fontDataURL?: string, textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, fontDataXhrSettings?: Phaser.Types.Loader.XHRSettingsObject); - - /** - * Adds this file to its target cache upon successful loading and processing. - */ - addToCache(): void; - - } - - /** - * A Compressed Texture File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#texture method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#texture. - */ - class CompressedTextureFile extends Phaser.Loader.MultiFile { - /** - * - * @param loader A reference to the Loader that is responsible for this file. - * @param key The key to use for this file. - * @param entry The compressed texture file entry to load. - * @param xhrSettings Extra XHR Settings specifically for this file. - */ - constructor(loader: Phaser.Loader.LoaderPlugin, key: string, entry: Phaser.Types.Loader.FileTypes.CompressedTextureFileEntry, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); - - /** - * Called by each File when it finishes loading. - * @param file The File that has completed processing. - */ - onFileComplete(file: Phaser.Loader.File): void; - - /** - * Adds this file to its target cache upon successful loading and processing. - */ - addToCache(): void; - - /** - * Adds all of the multi-file entties to their target caches upon successful loading and processing. - */ - addMultiToCache(): void; - - } - - /** - * A single CSS File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#css method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#css. - */ - class CSSFile extends Phaser.Loader.File { - /** - * - * @param loader A reference to the Loader that is responsible for this file. - * @param key The key to use for this file, or a file configuration object. - * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". - * @param xhrSettings Extra XHR Settings specifically for this file. - */ - constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.CSSFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); - - /** - * Called automatically by Loader.nextFile. - * This method controls what extra work this File does with its loaded data. - */ - onProcess(): void; - - } - - /** - * A single GLSL File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#glsl method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#glsl. - */ - class GLSLFile extends Phaser.Loader.File { - /** - * - * @param loader A reference to the Loader that is responsible for this file. - * @param key The key to use for this file, or a file configuration object. - * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". - * @param shaderType The type of shader. Either `fragment` for a fragment shader, or `vertex` for a vertex shader. This is ignored if you load a shader bundle. Default 'fragment'. - * @param xhrSettings Extra XHR Settings specifically for this file. - */ - constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.GLSLFileConfig, url?: string, shaderType?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); - - /** - * Called automatically by Loader.nextFile. - * This method controls what extra work this File does with its loaded data. - */ - onProcess(): void; - - /** - * Adds this file to its target cache upon successful loading and processing. - */ - addToCache(): void; - - /** - * Returns the name of the shader from the header block. - * @param headerSource The header data. - */ - getShaderName(headerSource: string[]): string; - - /** - * Returns the type of the shader from the header block. - * @param headerSource The header data. - */ - getShaderType(headerSource: string[]): string; - - /** - * Returns the shader uniforms from the header block. - * @param headerSource The header data. - */ - getShaderUniforms(headerSource: string[]): any; - - } - - /** - * A single Audio File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#audio method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#audio. - */ - class HTML5AudioFile extends Phaser.Loader.File { - /** - * - * @param loader A reference to the Loader that is responsible for this file. - * @param key The key to use for this file, or a file configuration object. - * @param urlConfig The absolute or relative URL to load this file from. - * @param xhrSettings Extra XHR Settings specifically for this file. - */ - constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.AudioFileConfig, urlConfig?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); - - /** - * Called when the file finishes loading. - */ - onLoad(): void; - - /** - * Called if the file errors while loading. - */ - onError(): void; - - /** - * Called during the file load progress. Is sent a DOM ProgressEvent. - */ - onProgress(): void; - - /** - * Called by the Loader, starts the actual file downloading. - * During the load the methods onLoad, onError and onProgress are called, based on the XHR events. - * You shouldn't normally call this method directly, it's meant to be invoked by the Loader. - */ - load(): void; - - } - - /** - * A single HTML File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#html method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#html. - */ - class HTMLFile extends Phaser.Loader.File { - /** - * - * @param loader A reference to the Loader that is responsible for this file. - * @param key The key to use for this file, or a file configuration object. - * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.html`, i.e. if `key` was "alien" then the URL will be "alien.html". - * @param xhrSettings Extra XHR Settings specifically for this file. - */ - constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.HTMLFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); - - /** - * Called automatically by Loader.nextFile. - * This method controls what extra work this File does with its loaded data. - */ - onProcess(): void; - - } - - /** - * A single HTML File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#htmlTexture method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#htmlTexture. - */ - class HTMLTextureFile extends Phaser.Loader.File { - /** - * - * @param loader A reference to the Loader that is responsible for this file. - * @param key The key to use for this file, or a file configuration object. - * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". - * @param width The width of the texture the HTML will be rendered to. - * @param height The height of the texture the HTML will be rendered to. - * @param xhrSettings Extra XHR Settings specifically for this file. - */ - constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig, url?: string, width?: number, height?: number, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); - - /** - * Called automatically by Loader.nextFile. - * This method controls what extra work this File does with its loaded data. - */ - onProcess(): void; - - /** - * Adds this file to its target cache upon successful loading and processing. - */ - addToCache(): void; - - } - - /** - * A single Image File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#image method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#image. - */ - class ImageFile extends Phaser.Loader.File { - /** - * - * @param loader A reference to the Loader that is responsible for this file. - * @param key The key to use for this file, or a file configuration object. - * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". - * @param xhrSettings Extra XHR Settings specifically for this file. - * @param frameConfig The frame configuration object. Only provided for, and used by, Sprite Sheets. - */ - constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.ImageFileConfig, url?: string | string[], xhrSettings?: Phaser.Types.Loader.XHRSettingsObject, frameConfig?: Phaser.Types.Loader.FileTypes.ImageFrameConfig); - - /** - * Called automatically by Loader.nextFile. - * This method controls what extra work this File does with its loaded data. - */ - onProcess(): void; - - /** - * Adds this file to its target cache upon successful loading and processing. - */ - addToCache(): void; - - } - - /** - * A single JSON File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#json method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#json. - */ - class JSONFile extends Phaser.Loader.File { - /** - * - * @param loader A reference to the Loader that is responsible for this file. - * @param key The key to use for this file, or a file configuration object. - * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". Or, can be a fully formed JSON Object. - * @param xhrSettings Extra XHR Settings specifically for this file. - * @param dataKey When the JSON file loads only this property will be stored in the Cache. - */ - constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.JSONFileConfig, url?: object | string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject, dataKey?: string); - - /** - * Called automatically by Loader.nextFile. - * This method controls what extra work this File does with its loaded data. - */ - onProcess(): void; - - } - - /** - * A single Multi Texture Atlas File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#multiatlas method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#multiatlas. - */ - class MultiAtlasFile extends Phaser.Loader.MultiFile { - /** - * - * @param loader A reference to the Loader that is responsible for this file. - * @param key The key of the file. Must be unique within both the Loader and the Texture Manager. Or a config object. - * @param atlasURL The absolute or relative URL to load the multi atlas json file from. - * @param path Optional path to use when loading the textures defined in the atlas data. - * @param baseURL Optional Base URL to use when loading the textures defined in the atlas data. - * @param atlasXhrSettings Extra XHR Settings specifically for the atlas json file. - * @param textureXhrSettings Extra XHR Settings specifically for the texture files. - */ - constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.MultiAtlasFileConfig, atlasURL?: string, path?: string, baseURL?: string, atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject); - - /** - * Called by each File when it finishes loading. - * @param file The File that has completed processing. - */ - onFileComplete(file: Phaser.Loader.File): void; - - /** - * Adds this file to its target cache upon successful loading and processing. - */ - addToCache(): void; - - } - - /** - * A Multi Script File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#scripts method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#scripts. - */ - class MultiScriptFile extends Phaser.Loader.MultiFile { - /** - * - * @param loader A reference to the Loader that is responsible for this file. - * @param key The key to use for this file, or a file configuration object. - * @param url An array of absolute or relative URLs to load the script files from. They are processed in the order given in the array. - * @param xhrSettings An XHR Settings configuration object for the script files. Used in replacement of the Loaders default XHR Settings. - */ - constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.MultiScriptFileConfig, url?: string[], xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); - - /** - * Adds this file to its target cache upon successful loading and processing. - */ - addToCache(): void; - - } - - /** - * A single Wavefront OBJ File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#obj method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#obj. - */ - class OBJFile extends Phaser.Loader.MultiFile { - /** - * - * @param loader A reference to the Loader that is responsible for this file. - * @param key The key to use for this file, or a file configuration object. - * @param objURL The absolute or relative URL to load the obj file from. If undefined or `null` it will be set to `.obj`, i.e. if `key` was "alien" then the URL will be "alien.obj". - * @param matURL The absolute or relative URL to load the material file from. If undefined or `null` it will be set to `.mat`, i.e. if `key` was "alien" then the URL will be "alien.mat". - * @param flipUV Flip the UV coordinates stored in the model data? - * @param xhrSettings Extra XHR Settings specifically for these files. - */ - constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.OBJFileConfig, objURL?: string, matURL?: string, flipUV?: boolean, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); - - /** - * Adds this file to its target cache upon successful loading and processing. - */ - addToCache(): void; - - } - - /** - * A single JSON Pack File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#pack method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#pack. - */ - class PackFile extends Phaser.Loader.File { - /** - * - * @param loader A reference to the Loader that is responsible for this file. - * @param key The key to use for this file, or a file configuration object. - * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". - * @param xhrSettings Extra XHR Settings specifically for this file. - * @param dataKey When the JSON file loads only this property will be stored in the Cache. - */ - constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.PackFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject, dataKey?: string); - - /** - * Called automatically by Loader.nextFile. - * This method controls what extra work this File does with its loaded data. - */ - onProcess(): void; - - } - - /** - * A single Plugin Script File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#plugin method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#plugin. - */ - class PluginFile extends Phaser.Loader.File { - /** - * - * @param loader A reference to the Loader that is responsible for this file. - * @param key The key to use for this file, or a file configuration object. - * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". - * @param start Automatically start the plugin after loading? Default false. - * @param mapping If this plugin is to be injected into the Scene, this is the property key used. - * @param xhrSettings Extra XHR Settings specifically for this file. - */ - constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.PluginFileConfig, url?: string, start?: boolean, mapping?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); - - /** - * Called automatically by Loader.nextFile. - * This method controls what extra work this File does with its loaded data. - */ - onProcess(): void; - - } - - /** - * An external Scene JavaScript File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#sceneFile method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#sceneFile. - */ - class SceneFile extends Phaser.Loader.File { - /** - * - * @param loader A reference to the Loader that is responsible for this file. - * @param key The key to use for this file, or a file configuration object. - * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". - * @param xhrSettings Extra XHR Settings specifically for this file. - */ - constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.SceneFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); - - /** - * Called automatically by Loader.nextFile. - * This method controls what extra work this File does with its loaded data. - */ - onProcess(): void; - - /** - * Adds this file to its target cache upon successful loading and processing. - */ - addToCache(): void; - - } - - /** - * A single Scene Plugin Script File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#scenePlugin method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#scenePlugin. - */ - class ScenePluginFile extends Phaser.Loader.File { - /** - * - * @param loader A reference to the Loader that is responsible for this file. - * @param key The key to use for this file, or a file configuration object. - * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". - * @param systemKey If this plugin is to be added to Scene.Systems, this is the property key for it. - * @param sceneKey If this plugin is to be added to the Scene, this is the property key for it. - * @param xhrSettings Extra XHR Settings specifically for this file. - */ - constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.ScenePluginFileConfig, url?: string, systemKey?: string, sceneKey?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); - - /** - * Called automatically by Loader.nextFile. - * This method controls what extra work this File does with its loaded data. - */ - onProcess(): void; - - } - - /** - * A single Script File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#script method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#script. - */ - class ScriptFile extends Phaser.Loader.File { - /** - * - * @param loader A reference to the Loader that is responsible for this file. - * @param key The key to use for this file, or a file configuration object. - * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". - * @param type The script type. Should be either 'script' for classic JavaScript, or 'module' if the file contains an exported module. Default 'script'. - * @param xhrSettings Extra XHR Settings specifically for this file. - */ - constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.ScriptFileConfig, url?: string, type?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); - - /** - * Called automatically by Loader.nextFile. - * This method controls what extra work this File does with its loaded data. - */ - onProcess(): void; - - } - - /** - * A single Sprite Sheet Image File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#spritesheet method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#spritesheet. - */ - class SpriteSheetFile extends Phaser.Loader.File { - /** - * - * @param loader A reference to the Loader that is responsible for this file. - * @param key The key to use for this file, or a file configuration object. - * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". - * @param frameConfig The frame configuration object. - * @param xhrSettings Extra XHR Settings specifically for this file. - */ - constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.SpriteSheetFileConfig, url?: string | string[], frameConfig?: Phaser.Types.Loader.FileTypes.ImageFrameConfig, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); - - /** - * Adds this file to its target cache upon successful loading and processing. - */ - addToCache(): void; - - } - - /** - * A single SVG File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#svg method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#svg. - */ - class SVGFile extends Phaser.Loader.File { - /** - * - * @param loader A reference to the Loader that is responsible for this file. - * @param key The key to use for this file, or a file configuration object. - * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.svg`, i.e. if `key` was "alien" then the URL will be "alien.svg". - * @param svgConfig The svg size configuration object. - * @param xhrSettings Extra XHR Settings specifically for this file. - */ - constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.SVGFileConfig, url?: string, svgConfig?: Phaser.Types.Loader.FileTypes.SVGSizeConfig, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); - - /** - * Called automatically by Loader.nextFile. - * This method controls what extra work this File does with its loaded data. - */ - onProcess(): void; - - /** - * Adds this file to its target cache upon successful loading and processing. - */ - addToCache(): void; - - } - - /** - * A single Text File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#text method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#text. - */ - class TextFile extends Phaser.Loader.File { - /** - * - * @param loader A reference to the Loader that is responsible for this file. - * @param key The key to use for this file, or a file configuration object. - * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". - * @param xhrSettings Extra XHR Settings specifically for this file. - */ - constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.TextFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); - - /** - * Called automatically by Loader.nextFile. - * This method controls what extra work this File does with its loaded data. - */ - onProcess(): void; - - } - - /** - * A single Tilemap CSV File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#tilemapCSV method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#tilemapCSV. - */ - class TilemapCSVFile extends Phaser.Loader.File { - /** - * - * @param loader A reference to the Loader that is responsible for this file. - * @param key The key to use for this file, or a file configuration object. - * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.csv`, i.e. if `key` was "alien" then the URL will be "alien.csv". - * @param xhrSettings Extra XHR Settings specifically for this file. - */ - constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.TilemapCSVFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); - - /** - * Called automatically by Loader.nextFile. - * This method controls what extra work this File does with its loaded data. - */ - onProcess(): void; - - /** - * Adds this file to its target cache upon successful loading and processing. - */ - addToCache(): void; - - } - - /** - * A single Impact.js Tilemap JSON File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#tilemapImpact method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#tilemapImpact. - */ - class TilemapImpactFile extends Phaser.Loader.File { - /** - * - * @param loader A reference to the Loader that is responsible for this file. - * @param key The key to use for this file, or a file configuration object. - * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". - * @param xhrSettings Extra XHR Settings specifically for this file. - */ - constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.TilemapImpactFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); - - /** - * Adds this file to its target cache upon successful loading and processing. - */ - addToCache(): void; - - } - - /** - * A single Tiled Tilemap JSON File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#tilemapTiledJSON method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#tilemapTiledJSON. - */ - class TilemapJSONFile extends Phaser.Loader.File { - /** - * - * @param loader A reference to the Loader that is responsible for this file. - * @param key The key to use for this file, or a file configuration object. - * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". Or, a well formed JSON object. - * @param xhrSettings Extra XHR Settings specifically for this file. - */ - constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.TilemapJSONFileConfig, url?: object | string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); - - /** - * Adds this file to its target cache upon successful loading and processing. - */ - addToCache(): void; - - } - - /** - * A single text file based Unity Texture Atlas File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#unityAtlas method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#unityAtlas. - */ - class UnityAtlasFile extends Phaser.Loader.MultiFile { - /** - * - * @param loader A reference to the Loader that is responsible for this file. - * @param key The key to use for this file, or a file configuration object. - * @param textureURL The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". - * @param atlasURL The absolute or relative URL to load the texture atlas data file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". - * @param textureXhrSettings An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. - * @param atlasXhrSettings An XHR Settings configuration object for the atlas data file. Used in replacement of the Loaders default XHR Settings. - */ - constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.UnityAtlasFileConfig, textureURL?: string | string[], atlasURL?: string, textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject); - - /** - * Adds this file to its target cache upon successful loading and processing. - */ - addToCache(): void; - - } - - /** - * A single Video File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#video method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#video. - */ - class VideoFile extends Phaser.Loader.File { - /** - * - * @param loader A reference to the Loader that is responsible for this file. - * @param key The key to use for this file, or a file configuration object. - * @param urlConfig The absolute or relative URL to load this file from in a config object. - * @param loadEvent The load event to listen for when _not_ loading as a blob. Either 'loadeddata', 'canplay' or 'canplaythrough'. - * @param asBlob Load the video as a data blob, or via the Video element? - * @param noAudio Does the video have an audio track? If not you can enable auto-playing on it. - * @param xhrSettings Extra XHR Settings specifically for this file. - */ - constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.VideoFileConfig, urlConfig?: Phaser.Types.Loader.FileTypes.VideoFileURLConfig, loadEvent?: string, asBlob?: boolean, noAudio?: boolean, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); - - /** - * Called automatically by Loader.nextFile. - * This method controls what extra work this File does with its loaded data. - */ - onProcess(): void; - - /** - * Called by the Loader, starts the actual file downloading. - * During the load the methods onLoad, onError and onProgress are called, based on the XHR events. - * You shouldn't normally call this method directly, it's meant to be invoked by the Loader. - */ - load(): void; - - } - - /** - * A single XML File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#xml method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#xml. - */ - class XMLFile extends Phaser.Loader.File { - /** - * - * @param loader A reference to the Loader that is responsible for this file. - * @param key The key to use for this file, or a file configuration object. - * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.xml`, i.e. if `key` was "alien" then the URL will be "alien.xml". - * @param xhrSettings Extra XHR Settings specifically for this file. - */ - constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.XMLFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); - - /** - * Called automatically by Loader.nextFile. - * This method controls what extra work this File does with its loaded data. - */ - onProcess(): void; - - } - - } - namespace FileTypesManager { /** * Static method called when a LoaderPlugin is created. @@ -55245,6 +54073,348 @@ declare namespace Phaser { */ constructor(scene: Phaser.Scene); + /** + * The Scene which owns this Loader instance. + */ + scene: Phaser.Scene; + + /** + * A reference to the Scene Systems. + */ + systems: Phaser.Scenes.Systems; + + /** + * A reference to the global Cache Manager. + */ + cacheManager: Phaser.Cache.CacheManager; + + /** + * A reference to the global Texture Manager. + */ + textureManager: Phaser.Textures.TextureManager; + + /** + * A reference to the global Scene Manager. + */ + protected sceneManager: Phaser.Scenes.SceneManager; + + /** + * An optional prefix that is automatically prepended to the start of every file key. + * If prefix was `MENU.` and you load an image with the key 'Background' the resulting key would be `MENU.Background`. + * You can set this directly, or call `Loader.setPrefix()`. It will then affect every file added to the Loader + * from that point on. It does _not_ change any file already in the load queue. + */ + prefix: string; + + /** + * The value of `path`, if set, is placed before any _relative_ file path given. For example: + * + * ```javascript + * this.load.path = "images/sprites/"; + * this.load.image("ball", "ball.png"); + * this.load.image("tree", "level1/oaktree.png"); + * this.load.image("boom", "http://server.com/explode.png"); + * ``` + * + * Would load the `ball` file from `images/sprites/ball.png` and the tree from + * `images/sprites/level1/oaktree.png` but the file `boom` would load from the URL + * given as it's an absolute URL. + * + * Please note that the path is added before the filename but *after* the baseURL (if set.) + * + * If you set this property directly then it _must_ end with a "/". Alternatively, call `setPath()` and it'll do it for you. + */ + path: string; + + /** + * If you want to append a URL before the path of any asset you can set this here. + * + * Useful if allowing the asset base url to be configured outside of the game code. + * + * If you set this property directly then it _must_ end with a "/". Alternatively, call `setBaseURL()` and it'll do it for you. + */ + baseURL: string; + + /** + * The number of concurrent / parallel resources to try and fetch at once. + * + * Old browsers limit 6 requests per domain; modern ones, especially those with HTTP/2 don't limit it at all. + * + * The default is 32 but you can change this in your Game Config, or by changing this property before the Loader starts. + */ + maxParallelDownloads: number; + + /** + * xhr specific global settings (can be overridden on a per-file basis) + */ + xhr: Phaser.Types.Loader.XHRSettingsObject; + + /** + * The crossOrigin value applied to loaded images. Very often this needs to be set to 'anonymous'. + */ + crossOrigin: string; + + /** + * Optional load type for image files. `XHR` is the default. Set to `HTMLImageElement` to load images using the Image tag instead. + */ + imageLoadType: string; + + /** + * An array of all schemes that the Loader considers as being 'local'. + * + * This is populated by the `Phaser.Core.Config#loaderLocalScheme` game configuration setting and defaults to + * `[ 'file://', 'capacitor://' ]`. Additional local schemes can be added to this array as needed. + */ + localSchemes: string[]; + + /** + * The total number of files to load. It may not always be accurate because you may add to the Loader during the process + * of loading, especially if you load a Pack File. Therefore this value can change, but in most cases remains static. + */ + totalToLoad: number; + + /** + * The progress of the current load queue, as a float value between 0 and 1. + * This is updated automatically as files complete loading. + * Note that it is possible for this value to go down again if you add content to the current load queue during a load. + */ + progress: number; + + /** + * Files are placed in this Set when they're added to the Loader via `addFile`. + * + * They are moved to the `inflight` Set when they start loading, and assuming a successful + * load, to the `queue` Set for further processing. + * + * By the end of the load process this Set will be empty. + */ + list: Phaser.Structs.Set; + + /** + * Files are stored in this Set while they're in the process of being loaded. + * + * Upon a successful load they are moved to the `queue` Set. + * + * By the end of the load process this Set will be empty. + */ + inflight: Phaser.Structs.Set; + + /** + * Files are stored in this Set while they're being processed. + * + * If the process is successful they are moved to their final destination, which could be + * a Cache or the Texture Manager. + * + * At the end of the load process this Set will be empty. + */ + queue: Phaser.Structs.Set; + + /** + * The total number of files that failed to load during the most recent load. + * This value is reset when you call `Loader.start`. + */ + totalFailed: number; + + /** + * The total number of files that successfully loaded during the most recent load. + * This value is reset when you call `Loader.start`. + */ + totalComplete: number; + + /** + * The current state of the Loader. + */ + readonly state: number; + + /** + * If you want to append a URL before the path of any asset you can set this here. + * + * Useful if allowing the asset base url to be configured outside of the game code. + * + * Once a base URL is set it will affect every file loaded by the Loader from that point on. It does _not_ change any + * file _already_ being loaded. To reset it, call this method with no arguments. + * @param url The URL to use. Leave empty to reset. + */ + setBaseURL(url?: string): this; + + /** + * The value of `path`, if set, is placed before any _relative_ file path given. For example: + * + * ```javascript + * this.load.setPath("images/sprites/"); + * this.load.image("ball", "ball.png"); + * this.load.image("tree", "level1/oaktree.png"); + * this.load.image("boom", "http://server.com/explode.png"); + * ``` + * + * Would load the `ball` file from `images/sprites/ball.png` and the tree from + * `images/sprites/level1/oaktree.png` but the file `boom` would load from the URL + * given as it's an absolute URL. + * + * Please note that the path is added before the filename but *after* the baseURL (if set.) + * + * Once a path is set it will then affect every file added to the Loader from that point on. It does _not_ change any + * file _already_ in the load queue. To reset it, call this method with no arguments. + * @param path The path to use. Leave empty to reset. + */ + setPath(path?: string): this; + + /** + * An optional prefix that is automatically prepended to the start of every file key. + * + * If prefix was `MENU.` and you load an image with the key 'Background' the resulting key would be `MENU.Background`. + * + * Once a prefix is set it will then affect every file added to the Loader from that point on. It does _not_ change any + * file _already_ in the load queue. To reset it, call this method with no arguments. + * @param prefix The prefix to use. Leave empty to reset. + */ + setPrefix(prefix?: string): this; + + /** + * Sets the Cross Origin Resource Sharing value used when loading files. + * + * Files can override this value on a per-file basis by specifying an alternative `crossOrigin` value in their file config. + * + * Once CORs is set it will then affect every file loaded by the Loader from that point on, as long as they don't have + * their own CORs setting. To reset it, call this method with no arguments. + * + * For more details about CORs see https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS + * @param crossOrigin The value to use for the `crossOrigin` property in the load request. + */ + setCORS(crossOrigin?: string): this; + + /** + * Adds a file, or array of files, into the load queue. + * + * The file must be an instance of `Phaser.Loader.File`, or a class that extends it. The Loader will check that the key + * used by the file won't conflict with any other key either in the loader, the inflight queue or the target cache. + * If allowed it will then add the file into the pending list, read for the load to start. Or, if the load has already + * started, ready for the next batch of files to be pulled from the list to the inflight queue. + * + * You should not normally call this method directly, but rather use one of the Loader methods like `image` or `atlas`, + * however you can call this as long as the file given to it is well formed. + * @param file The file, or array of files, to be added to the load queue. + */ + addFile(file: Phaser.Loader.File | Phaser.Loader.File[]): void; + + /** + * Checks the key and type of the given file to see if it will conflict with anything already + * in a Cache, the Texture Manager, or the list or inflight queues. + * @param file The file to check the key of. + */ + keyExists(file: Phaser.Loader.File): boolean; + + /** + * Takes a well formed, fully parsed pack file object and adds its entries into the load queue. Usually you do not call + * this method directly, but instead use `Loader.pack` and supply a path to a JSON file that holds the + * pack data. However, if you've got the data prepared you can pass it to this method. + * + * You can also provide an optional key. If you do then it will only add the entries from that part of the pack into + * to the load queue. If not specified it will add all entries it finds. For more details about the pack file format + * see the `LoaderPlugin.pack` method. + * @param pack The Pack File data to be parsed and each entry of it to added to the load queue. + * @param packKey An optional key to use from the pack file data. + */ + addPack(pack: any, packKey?: string): boolean; + + /** + * Is the Loader actively loading, or processing loaded files? + */ + isLoading(): boolean; + + /** + * Is the Loader ready to start a new load? + */ + isReady(): boolean; + + /** + * Starts the Loader running. This will reset the progress and totals and then emit a `start` event. + * If there is nothing in the queue the Loader will immediately complete, otherwise it will start + * loading the first batch of files. + * + * The Loader is started automatically if the queue is populated within your Scenes `preload` method. + * + * However, outside of this, you need to call this method to start it. + * + * If the Loader is already running this method will simply return. + */ + start(): void; + + /** + * Called automatically during the load process. + * It updates the `progress` value and then emits a progress event, which you can use to + * display a loading bar in your game. + */ + updateProgress(): void; + + /** + * Called automatically during the load process. + */ + update(): void; + + /** + * An internal method called automatically by the XHRLoader belong to a File. + * + * This method will remove the given file from the inflight Set and update the load progress. + * If the file was successful its `onProcess` method is called, otherwise it is added to the delete queue. + * @param file The File that just finished loading, or errored during load. + * @param success `true` if the file loaded successfully, otherwise `false`. + */ + nextFile(file: Phaser.Loader.File, success: boolean): void; + + /** + * An internal method that is called automatically by the File when it has finished processing. + * + * If the process was successful, and the File isn't part of a MultiFile, its `addToCache` method is called. + * + * It this then removed from the queue. If there are no more files to load `loadComplete` is called. + * @param file The file that has finished processing. + */ + fileProcessComplete(file: Phaser.Loader.File): void; + + /** + * Called at the end when the load queue is exhausted and all files have either loaded or errored. + * By this point every loaded file will now be in its associated cache and ready for use. + * + * Also clears down the Sets, puts progress to 1 and clears the deletion queue. + */ + loadComplete(): void; + + /** + * Adds a File into the pending-deletion queue. + * @param file The File to be queued for deletion when the Loader completes. + */ + flagForRemoval(file: Phaser.Loader.File): void; + + /** + * Converts the given JSON data into a file that the browser then prompts you to download so you can save it locally. + * + * The data must be well formed JSON and ready-parsed, not a JavaScript object. + * @param data The JSON data, ready parsed. + * @param filename The name to save the JSON file as. Default file.json. + */ + saveJSON(data: any, filename?: string): this; + + /** + * Causes the browser to save the given data as a file to its default Downloads folder. + * + * Creates a DOM level anchor link, assigns it as being a `download` anchor, sets the href + * to be an ObjectURL based on the given data, and then invokes a click event. + * @param data The data to be saved. Will be passed through URL.createObjectURL. + * @param filename The filename to save the file as. Default file.json. + * @param filetype The file type to use when saving the file. Defaults to JSON. Default application/json. + */ + save(data: any, filename?: string, filetype?: string): this; + + /** + * Resets the Loader. + * + * This will clear all lists and reset the base URL, path and prefix. + * + * Warning: If the Loader is currently downloading files, or has files in its queue, they will be aborted. + */ + reset(): void; + /** * Adds an Animation JSON Data file, or array of Animation JSON files, to the current load queue. * @@ -55969,6 +55139,57 @@ declare namespace Phaser { */ bitmapFont(key: string | Phaser.Types.Loader.FileTypes.BitmapFontFileConfig | Phaser.Types.Loader.FileTypes.BitmapFontFileConfig[], textureURL?: string | string[], fontDataURL?: string, textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, fontDataXhrSettings?: Phaser.Types.Loader.XHRSettingsObject): this; + /** + * Adds a CSS file, or array of CSS files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.css('headers', 'styles/headers.css'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String and not already in-use by another file in the Loader. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.css({ + * key: 'headers', + * url: 'styles/headers.css' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.CSSFileConfig` for more details. + * + * Once the file has finished loading it will automatically be converted into a style DOM element + * via `document.createElement('style')`. It will have its `defer` property set to false and then the + * resulting element will be appended to `document.head`. The CSS styles are then applied to the current document. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.css". It will always add `.css` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the CSS File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.css`, i.e. if `key` was "alien" then the URL will be "alien.css". + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + css(key: string | Phaser.Types.Loader.FileTypes.CSSFileConfig | Phaser.Types.Loader.FileTypes.CSSFileConfig[], url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): this; + /** * Adds a Compressed Texture file to the current load queue. This feature is WebGL only. * @@ -56103,57 +55324,6 @@ declare namespace Phaser { */ texture(key: string | Phaser.Types.Loader.FileTypes.CompressedTextureFileConfig | Phaser.Types.Loader.FileTypes.CompressedTextureFileConfig[], url?: Phaser.Types.Loader.FileTypes.CompressedTextureFileConfig, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): this; - /** - * Adds a CSS file, or array of CSS files, to the current load queue. - * - * You can call this method from within your Scene's `preload`, along with any other files you wish to load: - * - * ```javascript - * function preload () - * { - * this.load.css('headers', 'styles/headers.css'); - * } - * ``` - * - * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, - * or if it's already running, when the next free load slot becomes available. This happens automatically if you - * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued - * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. - * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the - * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been - * loaded. - * - * The key must be a unique String and not already in-use by another file in the Loader. - * - * Instead of passing arguments you can pass a configuration object, such as: - * - * ```javascript - * this.load.css({ - * key: 'headers', - * url: 'styles/headers.css' - * }); - * ``` - * - * See the documentation for `Phaser.Types.Loader.FileTypes.CSSFileConfig` for more details. - * - * Once the file has finished loading it will automatically be converted into a style DOM element - * via `document.createElement('style')`. It will have its `defer` property set to false and then the - * resulting element will be appended to `document.head`. The CSS styles are then applied to the current document. - * - * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. - * - * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" - * and no URL is given then the Loader will set the URL to be "alien.css". It will always add `.css` as the extension, although - * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. - * - * Note: The ability to load this type of file will only be available if the CSS File type has been built into Phaser. - * It is available in the default build but can be excluded from custom builds. - * @param key The key to use for this file, or a file configuration object, or array of them. - * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.css`, i.e. if `key` was "alien" then the URL will be "alien.css". - * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. - */ - css(key: string | Phaser.Types.Loader.FileTypes.CSSFileConfig | Phaser.Types.Loader.FileTypes.CSSFileConfig[], url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): this; - /** * Adds a GLSL file, or array of GLSL files, to the current load queue. * In Phaser 3 GLSL files are just plain Text files at the current moment in time. @@ -56923,6 +56093,118 @@ declare namespace Phaser { */ plugin(key: string | Phaser.Types.Loader.FileTypes.PluginFileConfig | Phaser.Types.Loader.FileTypes.PluginFileConfig[], url?: string | Function, start?: boolean, mapping?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): this; + /** + * Adds an SVG File, or array of SVG Files, to the current load queue. When the files are loaded they + * will be rendered to bitmap textures and stored in the Texture Manager. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.svg('morty', 'images/Morty.svg'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Texture Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.svg({ + * key: 'morty', + * url: 'images/Morty.svg' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.SVGFileConfig` for more details. + * + * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key: + * + * ```javascript + * this.load.svg('morty', 'images/Morty.svg'); + * // and later in your game ... + * this.add.image(x, y, 'morty'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use to retrieve the image from the Texture Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.html". It will always add `.html` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * You can optionally pass an SVG Resize Configuration object when you load an SVG file. By default the SVG will be rendered to a texture + * at the same size defined in the SVG file attributes. However, this isn't always desirable. You may wish to resize the SVG (either down + * or up) to improve texture clarity, or reduce texture memory consumption. You can either specify an exact width and height to resize + * the SVG to: + * + * ```javascript + * function preload () + * { + * this.load.svg('morty', 'images/Morty.svg', { width: 300, height: 600 }); + * } + * ``` + * + * Or when using a configuration object: + * + * ```javascript + * this.load.svg({ + * key: 'morty', + * url: 'images/Morty.svg', + * svgConfig: { + * width: 300, + * height: 600 + * } + * }); + * ``` + * + * Alternatively, you can just provide a scale factor instead: + * + * ```javascript + * function preload () + * { + * this.load.svg('morty', 'images/Morty.svg', { scale: 2.5 }); + * } + * ``` + * + * Or when using a configuration object: + * + * ```javascript + * this.load.svg({ + * key: 'morty', + * url: 'images/Morty.svg', + * svgConfig: { + * scale: 2.5 + * } + * }); + * ``` + * + * If scale, width and height values are all given, the scale has priority and the width and height values are ignored. + * + * Note: The ability to load this type of file will only be available if the SVG File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.svg`, i.e. if `key` was "alien" then the URL will be "alien.svg". + * @param svgConfig The svg size configuration object. + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + svg(key: string | Phaser.Types.Loader.FileTypes.SVGFileConfig | Phaser.Types.Loader.FileTypes.SVGFileConfig[], url?: string, svgConfig?: Phaser.Types.Loader.FileTypes.SVGSizeConfig, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): this; + /** * Adds an external Scene file, or array of Scene files, to the current load queue. * @@ -57233,118 +56515,6 @@ declare namespace Phaser { */ spritesheet(key: string | Phaser.Types.Loader.FileTypes.SpriteSheetFileConfig | Phaser.Types.Loader.FileTypes.SpriteSheetFileConfig[], url?: string, frameConfig?: Phaser.Types.Loader.FileTypes.ImageFrameConfig, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): this; - /** - * Adds an SVG File, or array of SVG Files, to the current load queue. When the files are loaded they - * will be rendered to bitmap textures and stored in the Texture Manager. - * - * You can call this method from within your Scene's `preload`, along with any other files you wish to load: - * - * ```javascript - * function preload () - * { - * this.load.svg('morty', 'images/Morty.svg'); - * } - * ``` - * - * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, - * or if it's already running, when the next free load slot becomes available. This happens automatically if you - * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued - * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. - * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the - * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been - * loaded. - * - * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. - * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. - * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file - * then remove it from the Texture Manager first, before loading a new one. - * - * Instead of passing arguments you can pass a configuration object, such as: - * - * ```javascript - * this.load.svg({ - * key: 'morty', - * url: 'images/Morty.svg' - * }); - * ``` - * - * See the documentation for `Phaser.Types.Loader.FileTypes.SVGFileConfig` for more details. - * - * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key: - * - * ```javascript - * this.load.svg('morty', 'images/Morty.svg'); - * // and later in your game ... - * this.add.image(x, y, 'morty'); - * ``` - * - * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files - * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and - * this is what you would use to retrieve the image from the Texture Manager. - * - * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. - * - * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" - * and no URL is given then the Loader will set the URL to be "alien.html". It will always add `.html` as the extension, although - * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. - * - * You can optionally pass an SVG Resize Configuration object when you load an SVG file. By default the SVG will be rendered to a texture - * at the same size defined in the SVG file attributes. However, this isn't always desirable. You may wish to resize the SVG (either down - * or up) to improve texture clarity, or reduce texture memory consumption. You can either specify an exact width and height to resize - * the SVG to: - * - * ```javascript - * function preload () - * { - * this.load.svg('morty', 'images/Morty.svg', { width: 300, height: 600 }); - * } - * ``` - * - * Or when using a configuration object: - * - * ```javascript - * this.load.svg({ - * key: 'morty', - * url: 'images/Morty.svg', - * svgConfig: { - * width: 300, - * height: 600 - * } - * }); - * ``` - * - * Alternatively, you can just provide a scale factor instead: - * - * ```javascript - * function preload () - * { - * this.load.svg('morty', 'images/Morty.svg', { scale: 2.5 }); - * } - * ``` - * - * Or when using a configuration object: - * - * ```javascript - * this.load.svg({ - * key: 'morty', - * url: 'images/Morty.svg', - * svgConfig: { - * scale: 2.5 - * } - * }); - * ``` - * - * If scale, width and height values are all given, the scale has priority and the width and height values are ignored. - * - * Note: The ability to load this type of file will only be available if the SVG File type has been built into Phaser. - * It is available in the default build but can be excluded from custom builds. - * @param key The key to use for this file, or a file configuration object, or array of them. - * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.svg`, i.e. if `key` was "alien" then the URL will be "alien.svg". - * @param svgConfig The svg size configuration object. - * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. - */ - svg(key: string | Phaser.Types.Loader.FileTypes.SVGFileConfig | Phaser.Types.Loader.FileTypes.SVGFileConfig[], url?: string, svgConfig?: Phaser.Types.Loader.FileTypes.SVGSizeConfig, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): this; - /** * Adds a Text file, or array of Text files, to the current load queue. * @@ -57814,348 +56984,6 @@ declare namespace Phaser { */ xml(key: string | Phaser.Types.Loader.FileTypes.XMLFileConfig | Phaser.Types.Loader.FileTypes.XMLFileConfig[], url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): this; - /** - * The Scene which owns this Loader instance. - */ - scene: Phaser.Scene; - - /** - * A reference to the Scene Systems. - */ - systems: Phaser.Scenes.Systems; - - /** - * A reference to the global Cache Manager. - */ - cacheManager: Phaser.Cache.CacheManager; - - /** - * A reference to the global Texture Manager. - */ - textureManager: Phaser.Textures.TextureManager; - - /** - * A reference to the global Scene Manager. - */ - protected sceneManager: Phaser.Scenes.SceneManager; - - /** - * An optional prefix that is automatically prepended to the start of every file key. - * If prefix was `MENU.` and you load an image with the key 'Background' the resulting key would be `MENU.Background`. - * You can set this directly, or call `Loader.setPrefix()`. It will then affect every file added to the Loader - * from that point on. It does _not_ change any file already in the load queue. - */ - prefix: string; - - /** - * The value of `path`, if set, is placed before any _relative_ file path given. For example: - * - * ```javascript - * this.load.path = "images/sprites/"; - * this.load.image("ball", "ball.png"); - * this.load.image("tree", "level1/oaktree.png"); - * this.load.image("boom", "http://server.com/explode.png"); - * ``` - * - * Would load the `ball` file from `images/sprites/ball.png` and the tree from - * `images/sprites/level1/oaktree.png` but the file `boom` would load from the URL - * given as it's an absolute URL. - * - * Please note that the path is added before the filename but *after* the baseURL (if set.) - * - * If you set this property directly then it _must_ end with a "/". Alternatively, call `setPath()` and it'll do it for you. - */ - path: string; - - /** - * If you want to append a URL before the path of any asset you can set this here. - * - * Useful if allowing the asset base url to be configured outside of the game code. - * - * If you set this property directly then it _must_ end with a "/". Alternatively, call `setBaseURL()` and it'll do it for you. - */ - baseURL: string; - - /** - * The number of concurrent / parallel resources to try and fetch at once. - * - * Old browsers limit 6 requests per domain; modern ones, especially those with HTTP/2 don't limit it at all. - * - * The default is 32 but you can change this in your Game Config, or by changing this property before the Loader starts. - */ - maxParallelDownloads: number; - - /** - * xhr specific global settings (can be overridden on a per-file basis) - */ - xhr: Phaser.Types.Loader.XHRSettingsObject; - - /** - * The crossOrigin value applied to loaded images. Very often this needs to be set to 'anonymous'. - */ - crossOrigin: string; - - /** - * Optional load type for image files. `XHR` is the default. Set to `HTMLImageElement` to load images using the Image tag instead. - */ - imageLoadType: string; - - /** - * An array of all schemes that the Loader considers as being 'local'. - * - * This is populated by the `Phaser.Core.Config#loaderLocalScheme` game configuration setting and defaults to - * `[ 'file://', 'capacitor://' ]`. Additional local schemes can be added to this array as needed. - */ - localSchemes: string[]; - - /** - * The total number of files to load. It may not always be accurate because you may add to the Loader during the process - * of loading, especially if you load a Pack File. Therefore this value can change, but in most cases remains static. - */ - totalToLoad: number; - - /** - * The progress of the current load queue, as a float value between 0 and 1. - * This is updated automatically as files complete loading. - * Note that it is possible for this value to go down again if you add content to the current load queue during a load. - */ - progress: number; - - /** - * Files are placed in this Set when they're added to the Loader via `addFile`. - * - * They are moved to the `inflight` Set when they start loading, and assuming a successful - * load, to the `queue` Set for further processing. - * - * By the end of the load process this Set will be empty. - */ - list: Phaser.Structs.Set; - - /** - * Files are stored in this Set while they're in the process of being loaded. - * - * Upon a successful load they are moved to the `queue` Set. - * - * By the end of the load process this Set will be empty. - */ - inflight: Phaser.Structs.Set; - - /** - * Files are stored in this Set while they're being processed. - * - * If the process is successful they are moved to their final destination, which could be - * a Cache or the Texture Manager. - * - * At the end of the load process this Set will be empty. - */ - queue: Phaser.Structs.Set; - - /** - * The total number of files that failed to load during the most recent load. - * This value is reset when you call `Loader.start`. - */ - totalFailed: number; - - /** - * The total number of files that successfully loaded during the most recent load. - * This value is reset when you call `Loader.start`. - */ - totalComplete: number; - - /** - * The current state of the Loader. - */ - readonly state: number; - - /** - * If you want to append a URL before the path of any asset you can set this here. - * - * Useful if allowing the asset base url to be configured outside of the game code. - * - * Once a base URL is set it will affect every file loaded by the Loader from that point on. It does _not_ change any - * file _already_ being loaded. To reset it, call this method with no arguments. - * @param url The URL to use. Leave empty to reset. - */ - setBaseURL(url?: string): this; - - /** - * The value of `path`, if set, is placed before any _relative_ file path given. For example: - * - * ```javascript - * this.load.setPath("images/sprites/"); - * this.load.image("ball", "ball.png"); - * this.load.image("tree", "level1/oaktree.png"); - * this.load.image("boom", "http://server.com/explode.png"); - * ``` - * - * Would load the `ball` file from `images/sprites/ball.png` and the tree from - * `images/sprites/level1/oaktree.png` but the file `boom` would load from the URL - * given as it's an absolute URL. - * - * Please note that the path is added before the filename but *after* the baseURL (if set.) - * - * Once a path is set it will then affect every file added to the Loader from that point on. It does _not_ change any - * file _already_ in the load queue. To reset it, call this method with no arguments. - * @param path The path to use. Leave empty to reset. - */ - setPath(path?: string): this; - - /** - * An optional prefix that is automatically prepended to the start of every file key. - * - * If prefix was `MENU.` and you load an image with the key 'Background' the resulting key would be `MENU.Background`. - * - * Once a prefix is set it will then affect every file added to the Loader from that point on. It does _not_ change any - * file _already_ in the load queue. To reset it, call this method with no arguments. - * @param prefix The prefix to use. Leave empty to reset. - */ - setPrefix(prefix?: string): this; - - /** - * Sets the Cross Origin Resource Sharing value used when loading files. - * - * Files can override this value on a per-file basis by specifying an alternative `crossOrigin` value in their file config. - * - * Once CORs is set it will then affect every file loaded by the Loader from that point on, as long as they don't have - * their own CORs setting. To reset it, call this method with no arguments. - * - * For more details about CORs see https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS - * @param crossOrigin The value to use for the `crossOrigin` property in the load request. - */ - setCORS(crossOrigin?: string): this; - - /** - * Adds a file, or array of files, into the load queue. - * - * The file must be an instance of `Phaser.Loader.File`, or a class that extends it. The Loader will check that the key - * used by the file won't conflict with any other key either in the loader, the inflight queue or the target cache. - * If allowed it will then add the file into the pending list, read for the load to start. Or, if the load has already - * started, ready for the next batch of files to be pulled from the list to the inflight queue. - * - * You should not normally call this method directly, but rather use one of the Loader methods like `image` or `atlas`, - * however you can call this as long as the file given to it is well formed. - * @param file The file, or array of files, to be added to the load queue. - */ - addFile(file: Phaser.Loader.File | Phaser.Loader.File[]): void; - - /** - * Checks the key and type of the given file to see if it will conflict with anything already - * in a Cache, the Texture Manager, or the list or inflight queues. - * @param file The file to check the key of. - */ - keyExists(file: Phaser.Loader.File): boolean; - - /** - * Takes a well formed, fully parsed pack file object and adds its entries into the load queue. Usually you do not call - * this method directly, but instead use `Loader.pack` and supply a path to a JSON file that holds the - * pack data. However, if you've got the data prepared you can pass it to this method. - * - * You can also provide an optional key. If you do then it will only add the entries from that part of the pack into - * to the load queue. If not specified it will add all entries it finds. For more details about the pack file format - * see the `LoaderPlugin.pack` method. - * @param pack The Pack File data to be parsed and each entry of it to added to the load queue. - * @param packKey An optional key to use from the pack file data. - */ - addPack(pack: any, packKey?: string): boolean; - - /** - * Is the Loader actively loading, or processing loaded files? - */ - isLoading(): boolean; - - /** - * Is the Loader ready to start a new load? - */ - isReady(): boolean; - - /** - * Starts the Loader running. This will reset the progress and totals and then emit a `start` event. - * If there is nothing in the queue the Loader will immediately complete, otherwise it will start - * loading the first batch of files. - * - * The Loader is started automatically if the queue is populated within your Scenes `preload` method. - * - * However, outside of this, you need to call this method to start it. - * - * If the Loader is already running this method will simply return. - */ - start(): void; - - /** - * Called automatically during the load process. - * It updates the `progress` value and then emits a progress event, which you can use to - * display a loading bar in your game. - */ - updateProgress(): void; - - /** - * Called automatically during the load process. - */ - update(): void; - - /** - * An internal method called automatically by the XHRLoader belong to a File. - * - * This method will remove the given file from the inflight Set and update the load progress. - * If the file was successful its `onProcess` method is called, otherwise it is added to the delete queue. - * @param file The File that just finished loading, or errored during load. - * @param success `true` if the file loaded successfully, otherwise `false`. - */ - nextFile(file: Phaser.Loader.File, success: boolean): void; - - /** - * An internal method that is called automatically by the File when it has finished processing. - * - * If the process was successful, and the File isn't part of a MultiFile, its `addToCache` method is called. - * - * It this then removed from the queue. If there are no more files to load `loadComplete` is called. - * @param file The file that has finished processing. - */ - fileProcessComplete(file: Phaser.Loader.File): void; - - /** - * Called at the end when the load queue is exhausted and all files have either loaded or errored. - * By this point every loaded file will now be in its associated cache and ready for use. - * - * Also clears down the Sets, puts progress to 1 and clears the deletion queue. - */ - loadComplete(): void; - - /** - * Adds a File into the pending-deletion queue. - * @param file The File to be queued for deletion when the Loader completes. - */ - flagForRemoval(file: Phaser.Loader.File): void; - - /** - * Converts the given JSON data into a file that the browser then prompts you to download so you can save it locally. - * - * The data must be well formed JSON and ready-parsed, not a JavaScript object. - * @param data The JSON data, ready parsed. - * @param filename The name to save the JSON file as. Default file.json. - */ - saveJSON(data: any, filename?: string): this; - - /** - * Causes the browser to save the given data as a file to its default Downloads folder. - * - * Creates a DOM level anchor link, assigns it as being a `download` anchor, sets the href - * to be an ObjectURL based on the given data, and then invokes a click event. - * @param data The data to be saved. Will be passed through URL.createObjectURL. - * @param filename The filename to save the file as. Default file.json. - * @param filetype The file type to use when saving the file. Defaults to JSON. Default application/json. - */ - save(data: any, filename?: string, filetype?: string): this; - - /** - * Resets the Loader. - * - * This will clear all lists and reset the base URL, path and prefix. - * - * Warning: If the Loader is currently downloading files, or has files in its queue, they will be aborted. - */ - reset(): void; - } /** @@ -58305,129 +57133,1181 @@ declare namespace Phaser { */ function XHRSettings(responseType?: XMLHttpRequestResponseType, async?: boolean, user?: string, password?: string, timeout?: number, withCredentials?: boolean): Phaser.Types.Loader.XHRSettingsObject; - } + /** + * The Loader is idle. + */ + var LOADER_IDLE: number; - namespace Math { - namespace Angle { - /** - * Find the angle of a segment from (x1, y1) -> (x2, y2). - * @param x1 The x coordinate of the first point. - * @param y1 The y coordinate of the first point. - * @param x2 The x coordinate of the second point. - * @param y2 The y coordinate of the second point. - */ - function Between(x1: number, y1: number, x2: number, y2: number): number; + /** + * The Loader is actively loading. + */ + var LOADER_LOADING: number; + /** + * The Loader is processing files is has loaded. + */ + var LOADER_PROCESSING: number; + + /** + * The Loader has completed loading and processing. + */ + var LOADER_COMPLETE: number; + + /** + * The Loader is shutting down. + */ + var LOADER_SHUTDOWN: number; + + /** + * The Loader has been destroyed. + */ + var LOADER_DESTROYED: number; + + /** + * File is in the load queue but not yet started. + */ + var FILE_PENDING: number; + + /** + * File has been started to load by the loader (onLoad called) + */ + var FILE_LOADING: number; + + /** + * File has loaded successfully, awaiting processing. + */ + var FILE_LOADED: number; + + /** + * File failed to load. + */ + var FILE_FAILED: number; + + /** + * File is being processed (onProcess callback) + */ + var FILE_PROCESSING: number; + + /** + * The File has errored somehow during processing. + */ + var FILE_ERRORED: number; + + /** + * File has finished processing. + */ + var FILE_COMPLETE: number; + + /** + * File has been destroyed. + */ + var FILE_DESTROYED: number; + + /** + * File was populated from local data and doesn't need an HTTP request. + */ + var FILE_POPULATED: number; + + /** + * File is pending being destroyed. + */ + var FILE_PENDING_DESTROY: number; + + namespace Events { /** - * Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y). + * The Loader Plugin Add File Event. * - * Calculates the angle of the vector from the first point to the second point. - * @param point1 The first point. - * @param point2 The second point. + * This event is dispatched when a new file is successfully added to the Loader and placed into the load queue. + * + * Listen to it from a Scene using: `this.load.on('addfile', listener)`. + * + * If you add lots of files to a Loader from a `preload` method, it will dispatch this event for each one of them. */ - function BetweenPoints(point1: Phaser.Types.Math.Vector2Like, point2: Phaser.Types.Math.Vector2Like): number; + const ADD: any; /** - * Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y). + * The Loader Plugin Complete Event. * - * The difference between this method and {@link Phaser.Math.Angle.BetweenPoints} is that this assumes the y coordinate - * travels down the screen. - * @param point1 The first point. - * @param point2 The second point. + * This event is dispatched when the Loader has fully processed everything in the load queue. + * By this point every loaded file will now be in its associated cache and ready for use. + * + * Listen to it from a Scene using: `this.load.on('complete', listener)`. */ - function BetweenPointsY(point1: Phaser.Types.Math.Vector2Like, point2: Phaser.Types.Math.Vector2Like): number; + const COMPLETE: any; /** - * Find the angle of a segment from (x1, y1) -> (x2, y2). + * The File Load Complete Event. * - * The difference between this method and {@link Phaser.Math.Angle.Between} is that this assumes the y coordinate - * travels down the screen. - * @param x1 The x coordinate of the first point. - * @param y1 The y coordinate of the first point. - * @param x2 The x coordinate of the second point. - * @param y2 The y coordinate of the second point. + * This event is dispatched by the Loader Plugin when _any_ file in the queue finishes loading. + * + * Listen to it from a Scene using: `this.load.on('filecomplete', listener)`. + * + * Make sure you remove this listener when you have finished, or it will continue to fire if the Scene reloads. + * + * You can also listen for the completion of a specific file. See the [FILE_KEY_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_KEY_COMPLETE} event. */ - function BetweenY(x1: number, y1: number, x2: number, y2: number): number; + const FILE_COMPLETE: any; /** - * Takes an angle in Phasers default clockwise format and converts it so that - * 0 is North, 90 is West, 180 is South and 270 is East, - * therefore running counter-clockwise instead of clockwise. + * The File Load Complete Event. * - * You can pass in the angle from a Game Object using: + * This event is dispatched by the Loader Plugin when any file in the queue finishes loading. + * + * It uses a special dynamic event name constructed from the key and type of the file. + * + * For example, if you have loaded an `image` with a key of `monster`, you can listen for it + * using the following: * * ```javascript - * var converted = CounterClockwise(gameobject.rotation); + * this.load.on('filecomplete-image-monster', function (key, type, data) { + * // Your handler code + * }); * ``` * - * All values for this function are in radians. - * @param angle The angle to convert, in radians. - */ - function CounterClockwise(angle: number): number; - - /** - * Normalize an angle to the [0, 2pi] range. - * @param angle The angle to normalize, in radians. - */ - function Normalize(angle: number): number; - - /** - * Returns a random angle in the range [-pi, pi]. - */ - function Random(): number; - - /** - * Returns a random angle in the range [-180, 180]. - */ - function RandomDegrees(): number; - - /** - * Reverse the given angle. - * @param angle The angle to reverse, in radians. - */ - function Reverse(angle: number): number; - - /** - * Rotates `currentAngle` towards `targetAngle`, taking the shortest rotation distance. The `lerp` argument is the amount to rotate by in this call. - * @param currentAngle The current angle, in radians. - * @param targetAngle The target angle to rotate to, in radians. - * @param lerp The lerp value to add to the current angle. Default 0.05. - */ - function RotateTo(currentAngle: number, targetAngle: number, lerp?: number): number; - - /** - * Gets the shortest angle between `angle1` and `angle2`. + * Or, if you have loaded a texture `atlas` with a key of `Level1`: * - * Both angles must be in the range -180 to 180, which is the same clamped - * range that `sprite.angle` uses, so you can pass in two sprite angles to - * this method and get the shortest angle back between the two of them. + * ```javascript + * this.load.on('filecomplete-atlas-Level1', function (key, type, data) { + * // Your handler code + * }); + * ``` * - * The angle returned will be in the same range. If the returned angle is - * greater than 0 then it's a counter-clockwise rotation, if < 0 then it's - * a clockwise rotation. - * @param angle1 The first angle in the range -180 to 180. - * @param angle2 The second angle in the range -180 to 180. + * Or, if you have loaded a sprite sheet with a key of `Explosion` and a prefix of `GAMEOVER`: + * + * ```javascript + * this.load.on('filecomplete-spritesheet-GAMEOVERExplosion', function (key, type, data) { + * // Your handler code + * }); + * ``` + * + * Make sure you remove your listeners when you have finished, or they will continue to fire if the Scene reloads. + * + * You can also listen for the generic completion of files. See the [FILE_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_COMPLETE} event. */ - function ShortestBetween(angle1: number, angle2: number): number; + const FILE_KEY_COMPLETE: any; /** - * Wrap an angle. + * The File Load Error Event. * - * Wraps the angle to a value in the range of -PI to PI. - * @param angle The angle to wrap, in radians. + * This event is dispatched by the Loader Plugin when a file fails to load. + * + * Listen to it from a Scene using: `this.load.on('loaderror', listener)`. */ - function Wrap(angle: number): number; + const FILE_LOAD_ERROR: any; /** - * Wrap an angle in degrees. + * The File Load Event. * - * Wraps the angle to a value in the range of -180 to 180. - * @param angle The angle to wrap, in degrees. + * This event is dispatched by the Loader Plugin when a file finishes loading, + * but _before_ it is processed and added to the internal Phaser caches. + * + * Listen to it from a Scene using: `this.load.on('load', listener)`. */ - function WrapDegrees(angle: number): number; + const FILE_LOAD: any; + + /** + * The File Load Progress Event. + * + * This event is dispatched by the Loader Plugin during the load of a file, if the browser receives a DOM ProgressEvent and + * the `lengthComputable` event property is true. Depending on the size of the file and browser in use, this may, or may not happen. + * + * Listen to it from a Scene using: `this.load.on('fileprogress', listener)`. + */ + const FILE_PROGRESS: any; + + /** + * The Loader Plugin Post Process Event. + * + * This event is dispatched by the Loader Plugin when the Loader has finished loading everything in the load queue. + * It is dispatched before the internal lists are cleared and each File is destroyed. + * + * Use this hook to perform any last minute processing of files that can only happen once the + * Loader has completed, but prior to it emitting the `complete` event. + * + * Listen to it from a Scene using: `this.load.on('postprocess', listener)`. + */ + const POST_PROCESS: any; + + /** + * The Loader Plugin Progress Event. + * + * This event is dispatched when the Loader updates its load progress, typically as a result of a file having completed loading. + * + * Listen to it from a Scene using: `this.load.on('progress', listener)`. + */ + const PROGRESS: any; + + /** + * The Loader Plugin Start Event. + * + * This event is dispatched when the Loader starts running. At this point load progress is zero. + * + * This event is dispatched even if there aren't any files in the load queue. + * + * Listen to it from a Scene using: `this.load.on('start', listener)`. + */ + const START: any; } + namespace FileTypes { + /** + * A single Animation JSON File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#animation method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#animation. + */ + class AnimationJSONFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param xhrSettings Extra XHR Settings specifically for this file. + * @param dataKey When the JSON file loads only this property will be stored in the Cache. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.JSONFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject, dataKey?: string); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + /** + * Called at the end of the load process, after the Loader has finished all files in its queue. + */ + onLoadComplete(): void; + + } + + /** + * A single JSON based Texture Atlas File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#atlas method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#atlas. + * + * https://www.codeandweb.com/texturepacker/tutorials/how-to-create-sprite-sheets-for-phaser3?source=photonstorm + */ + class AsepriteFile extends Phaser.Loader.MultiFile { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param textureURL The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param atlasURL The absolute or relative URL to load the texture atlas json data file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". Or, a well formed JSON object. + * @param textureXhrSettings An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. + * @param atlasXhrSettings An XHR Settings configuration object for the atlas json file. Used in replacement of the Loaders default XHR Settings. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.AsepriteFileConfig, textureURL?: string | string[], atlasURL?: object | string, textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single JSON based Texture Atlas File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#atlas method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#atlas. + * + * https://www.codeandweb.com/texturepacker/tutorials/how-to-create-sprite-sheets-for-phaser3?source=photonstorm + */ + class AtlasJSONFile extends Phaser.Loader.MultiFile { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param textureURL The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param atlasURL The absolute or relative URL to load the texture atlas json data file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". Or, a well formed JSON object. + * @param textureXhrSettings An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. + * @param atlasXhrSettings An XHR Settings configuration object for the atlas json file. Used in replacement of the Loaders default XHR Settings. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.AtlasJSONFileConfig, textureURL?: string | string[], atlasURL?: object | string, textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single XML based Texture Atlas File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#atlasXML method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#atlasXML. + */ + class AtlasXMLFile extends Phaser.Loader.MultiFile { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param textureURL The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param atlasURL The absolute or relative URL to load the texture atlas xml data file from. If undefined or `null` it will be set to `.xml`, i.e. if `key` was "alien" then the URL will be "alien.xml". + * @param textureXhrSettings An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. + * @param atlasXhrSettings An XHR Settings configuration object for the atlas xml file. Used in replacement of the Loaders default XHR Settings. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.AtlasXMLFileConfig, textureURL?: string | string[], atlasURL?: string, textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single Audio File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#audio method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#audio. + */ + class AudioFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param urlConfig The absolute or relative URL to load this file from in a config object. + * @param xhrSettings Extra XHR Settings specifically for this file. + * @param audioContext The AudioContext this file will use to process itself. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.AudioFileConfig, urlConfig?: Phaser.Types.Loader.FileTypes.AudioFileURLConfig, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject, audioContext?: AudioContext); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + } + + /** + * An Audio Sprite File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#audioSprite method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#audioSprite. + */ + class AudioSpriteFile extends Phaser.Loader.MultiFile { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param jsonURL The absolute or relative URL to load the json file from. Or a well formed JSON object to use instead. + * @param audioURL The absolute or relative URL to load the audio file from. If empty it will be obtained by parsing the JSON file. + * @param audioConfig The audio configuration options. + * @param audioXhrSettings An XHR Settings configuration object for the audio file. Used in replacement of the Loaders default XHR Settings. + * @param jsonXhrSettings An XHR Settings configuration object for the json file. Used in replacement of the Loaders default XHR Settings. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.AudioSpriteFileConfig, jsonURL: string, audioURL?: Object, audioConfig?: any, audioXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, jsonXhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called by each File when it finishes loading. + * @param file The File that has completed processing. + */ + onFileComplete(file: Phaser.Loader.File): void; + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single Binary File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#binary method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#binary. + */ + class BinaryFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.bin`, i.e. if `key` was "alien" then the URL will be "alien.bin". + * @param xhrSettings Extra XHR Settings specifically for this file. + * @param dataType Optional type to cast the binary file to once loaded. For example, `Uint8Array`. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.BinaryFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject, dataType?: any); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + } + + /** + * A single Bitmap Font based File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#bitmapFont method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#bitmapFont. + */ + class BitmapFontFile extends Phaser.Loader.MultiFile { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param textureURL The absolute or relative URL to load the font image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param fontDataURL The absolute or relative URL to load the font xml data file from. If undefined or `null` it will be set to `.xml`, i.e. if `key` was "alien" then the URL will be "alien.xml". + * @param textureXhrSettings An XHR Settings configuration object for the font image file. Used in replacement of the Loaders default XHR Settings. + * @param fontDataXhrSettings An XHR Settings configuration object for the font data xml file. Used in replacement of the Loaders default XHR Settings. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.BitmapFontFileConfig, textureURL?: string | string[], fontDataURL?: string, textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, fontDataXhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single CSS File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#css method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#css. + */ + class CSSFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.CSSFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + } + + /** + * A Compressed Texture File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#texture method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#texture. + */ + class CompressedTextureFile extends Phaser.Loader.MultiFile { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file. + * @param entry The compressed texture file entry to load. + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string, entry: Phaser.Types.Loader.FileTypes.CompressedTextureFileEntry, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called by each File when it finishes loading. + * @param file The File that has completed processing. + */ + onFileComplete(file: Phaser.Loader.File): void; + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + /** + * Adds all of the multi-file entties to their target caches upon successful loading and processing. + */ + addMultiToCache(): void; + + } + + /** + * A single GLSL File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#glsl method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#glsl. + */ + class GLSLFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". + * @param shaderType The type of shader. Either `fragment` for a fragment shader, or `vertex` for a vertex shader. This is ignored if you load a shader bundle. Default 'fragment'. + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.GLSLFileConfig, url?: string, shaderType?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + /** + * Returns the name of the shader from the header block. + * @param headerSource The header data. + */ + getShaderName(headerSource: string[]): string; + + /** + * Returns the type of the shader from the header block. + * @param headerSource The header data. + */ + getShaderType(headerSource: string[]): string; + + /** + * Returns the shader uniforms from the header block. + * @param headerSource The header data. + */ + getShaderUniforms(headerSource: string[]): any; + + } + + /** + * A single Audio File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#audio method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#audio. + */ + class HTML5AudioFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param urlConfig The absolute or relative URL to load this file from. + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.AudioFileConfig, urlConfig?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called when the file finishes loading. + */ + onLoad(): void; + + /** + * Called if the file errors while loading. + */ + onError(): void; + + /** + * Called during the file load progress. Is sent a DOM ProgressEvent. + */ + onProgress(): void; + + /** + * Called by the Loader, starts the actual file downloading. + * During the load the methods onLoad, onError and onProgress are called, based on the XHR events. + * You shouldn't normally call this method directly, it's meant to be invoked by the Loader. + */ + load(): void; + + } + + /** + * A single HTML File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#html method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#html. + */ + class HTMLFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.html`, i.e. if `key` was "alien" then the URL will be "alien.html". + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.HTMLFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + } + + /** + * A single HTML File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#htmlTexture method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#htmlTexture. + */ + class HTMLTextureFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param width The width of the texture the HTML will be rendered to. + * @param height The height of the texture the HTML will be rendered to. + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig, url?: string, width?: number, height?: number, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single Image File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#image method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#image. + */ + class ImageFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param xhrSettings Extra XHR Settings specifically for this file. + * @param frameConfig The frame configuration object. Only provided for, and used by, Sprite Sheets. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.ImageFileConfig, url?: string | string[], xhrSettings?: Phaser.Types.Loader.XHRSettingsObject, frameConfig?: Phaser.Types.Loader.FileTypes.ImageFrameConfig); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single JSON File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#json method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#json. + */ + class JSONFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". Or, can be a fully formed JSON Object. + * @param xhrSettings Extra XHR Settings specifically for this file. + * @param dataKey When the JSON file loads only this property will be stored in the Cache. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.JSONFileConfig, url?: object | string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject, dataKey?: string); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + } + + /** + * A single Multi Texture Atlas File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#multiatlas method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#multiatlas. + */ + class MultiAtlasFile extends Phaser.Loader.MultiFile { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key of the file. Must be unique within both the Loader and the Texture Manager. Or a config object. + * @param atlasURL The absolute or relative URL to load the multi atlas json file from. + * @param path Optional path to use when loading the textures defined in the atlas data. + * @param baseURL Optional Base URL to use when loading the textures defined in the atlas data. + * @param atlasXhrSettings Extra XHR Settings specifically for the atlas json file. + * @param textureXhrSettings Extra XHR Settings specifically for the texture files. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.MultiAtlasFileConfig, atlasURL?: string, path?: string, baseURL?: string, atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called by each File when it finishes loading. + * @param file The File that has completed processing. + */ + onFileComplete(file: Phaser.Loader.File): void; + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A Multi Script File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#scripts method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#scripts. + */ + class MultiScriptFile extends Phaser.Loader.MultiFile { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url An array of absolute or relative URLs to load the script files from. They are processed in the order given in the array. + * @param xhrSettings An XHR Settings configuration object for the script files. Used in replacement of the Loaders default XHR Settings. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.MultiScriptFileConfig, url?: string[], xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single Wavefront OBJ File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#obj method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#obj. + */ + class OBJFile extends Phaser.Loader.MultiFile { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param objURL The absolute or relative URL to load the obj file from. If undefined or `null` it will be set to `.obj`, i.e. if `key` was "alien" then the URL will be "alien.obj". + * @param matURL The absolute or relative URL to load the material file from. If undefined or `null` it will be set to `.mat`, i.e. if `key` was "alien" then the URL will be "alien.mat". + * @param flipUV Flip the UV coordinates stored in the model data? + * @param xhrSettings Extra XHR Settings specifically for these files. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.OBJFileConfig, objURL?: string, matURL?: string, flipUV?: boolean, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single JSON Pack File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#pack method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#pack. + */ + class PackFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param xhrSettings Extra XHR Settings specifically for this file. + * @param dataKey When the JSON file loads only this property will be stored in the Cache. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.PackFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject, dataKey?: string); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + } + + /** + * A single Plugin Script File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#plugin method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#plugin. + */ + class PluginFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". + * @param start Automatically start the plugin after loading? Default false. + * @param mapping If this plugin is to be injected into the Scene, this is the property key used. + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.PluginFileConfig, url?: string, start?: boolean, mapping?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + } + + /** + * A single SVG File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#svg method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#svg. + */ + class SVGFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.svg`, i.e. if `key` was "alien" then the URL will be "alien.svg". + * @param svgConfig The svg size configuration object. + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.SVGFileConfig, url?: string, svgConfig?: Phaser.Types.Loader.FileTypes.SVGSizeConfig, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * An external Scene JavaScript File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#sceneFile method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#sceneFile. + */ + class SceneFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.SceneFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single Scene Plugin Script File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#scenePlugin method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#scenePlugin. + */ + class ScenePluginFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". + * @param systemKey If this plugin is to be added to Scene.Systems, this is the property key for it. + * @param sceneKey If this plugin is to be added to the Scene, this is the property key for it. + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.ScenePluginFileConfig, url?: string, systemKey?: string, sceneKey?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + } + + /** + * A single Script File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#script method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#script. + */ + class ScriptFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". + * @param type The script type. Should be either 'script' for classic JavaScript, or 'module' if the file contains an exported module. Default 'script'. + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.ScriptFileConfig, url?: string, type?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + } + + /** + * A single Sprite Sheet Image File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#spritesheet method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#spritesheet. + */ + class SpriteSheetFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param frameConfig The frame configuration object. + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.SpriteSheetFileConfig, url?: string | string[], frameConfig?: Phaser.Types.Loader.FileTypes.ImageFrameConfig, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single Text File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#text method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#text. + */ + class TextFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.TextFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + } + + /** + * A single Tilemap CSV File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#tilemapCSV method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#tilemapCSV. + */ + class TilemapCSVFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.csv`, i.e. if `key` was "alien" then the URL will be "alien.csv". + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.TilemapCSVFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single Impact.js Tilemap JSON File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#tilemapImpact method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#tilemapImpact. + */ + class TilemapImpactFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.TilemapImpactFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single Tiled Tilemap JSON File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#tilemapTiledJSON method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#tilemapTiledJSON. + */ + class TilemapJSONFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". Or, a well formed JSON object. + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.TilemapJSONFileConfig, url?: object | string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single text file based Unity Texture Atlas File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#unityAtlas method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#unityAtlas. + */ + class UnityAtlasFile extends Phaser.Loader.MultiFile { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param textureURL The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param atlasURL The absolute or relative URL to load the texture atlas data file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". + * @param textureXhrSettings An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. + * @param atlasXhrSettings An XHR Settings configuration object for the atlas data file. Used in replacement of the Loaders default XHR Settings. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.UnityAtlasFileConfig, textureURL?: string | string[], atlasURL?: string, textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single Video File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#video method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#video. + */ + class VideoFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param urlConfig The absolute or relative URL to load this file from in a config object. + * @param loadEvent The load event to listen for when _not_ loading as a blob. Either 'loadeddata', 'canplay' or 'canplaythrough'. + * @param asBlob Load the video as a data blob, or via the Video element? + * @param noAudio Does the video have an audio track? If not you can enable auto-playing on it. + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.VideoFileConfig, urlConfig?: Phaser.Types.Loader.FileTypes.VideoFileURLConfig, loadEvent?: string, asBlob?: boolean, noAudio?: boolean, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + /** + * Called by the Loader, starts the actual file downloading. + * During the load the methods onLoad, onError and onProgress are called, based on the XHR events. + * You shouldn't normally call this method directly, it's meant to be invoked by the Loader. + */ + load(): void; + + } + + /** + * A single XML File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#xml method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#xml. + */ + class XMLFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.xml`, i.e. if `key` was "alien" then the URL will be "alien.xml". + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.XMLFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + } + + } + + } + + namespace Math { /** * Calculate the mean average of the given values. * @param values The values to average. @@ -58476,49 +58356,6 @@ declare namespace Phaser { */ function Clamp(value: number, min: number, max: number): number; - /** - * The value of PI * 2. - */ - var PI2: number; - - /** - * The value of PI * 0.5. - */ - var TAU: number; - - /** - * An epsilon value (1.0e-6) - */ - var EPSILON: number; - - /** - * For converting degrees to radians (PI / 180) - */ - var DEG_TO_RAD: number; - - /** - * For converting radians to degrees (180 / PI) - */ - var RAD_TO_DEG: number; - - /** - * An instance of the Random Number Generator. - * This is not set until the Game boots. - */ - var RND: Phaser.Math.RandomDataGenerator; - - /** - * The minimum safe integer this browser supports. - * We use a const for backward compatibility with Internet Explorer. - */ - var MIN_SAFE_INTEGER: number; - - /** - * The maximum safe integer this browser supports. - * We use a const for backward compatibility with Internet Explorer. - */ - var MAX_SAFE_INTEGER: number; - /** * Convert the given angle from degrees, to the equivalent angle in radians. * @param degrees The angle (in degrees) to convert to radians. @@ -58532,313 +58369,6 @@ declare namespace Phaser { */ function Difference(a: number, b: number): number; - namespace Distance { - /** - * Calculate the distance between two sets of coordinates (points). - * @param x1 The x coordinate of the first point. - * @param y1 The y coordinate of the first point. - * @param x2 The x coordinate of the second point. - * @param y2 The y coordinate of the second point. - */ - function Between(x1: number, y1: number, x2: number, y2: number): number; - - /** - * Calculate the distance between two points. - * @param a The first point. - * @param b The second point. - */ - function BetweenPoints(a: Phaser.Types.Math.Vector2Like, b: Phaser.Types.Math.Vector2Like): number; - - /** - * Calculate the squared distance between two points. - * @param a The first point. - * @param b The second point. - */ - function BetweenPointsSquared(a: Phaser.Types.Math.Vector2Like, b: Phaser.Types.Math.Vector2Like): number; - - /** - * Calculate the Chebyshev distance between two sets of coordinates (points). - * - * Chebyshev distance (or chessboard distance) is the maximum of the horizontal and vertical distances. - * It's the effective distance when movement can be horizontal, vertical, or diagonal. - * @param x1 The x coordinate of the first point. - * @param y1 The y coordinate of the first point. - * @param x2 The x coordinate of the second point. - * @param y2 The y coordinate of the second point. - */ - function Chebyshev(x1: number, y1: number, x2: number, y2: number): number; - - /** - * Calculate the distance between two sets of coordinates (points) to the power of `pow`. - * @param x1 The x coordinate of the first point. - * @param y1 The y coordinate of the first point. - * @param x2 The x coordinate of the second point. - * @param y2 The y coordinate of the second point. - * @param pow The exponent. - */ - function Power(x1: number, y1: number, x2: number, y2: number, pow: number): number; - - /** - * Calculate the snake distance between two sets of coordinates (points). - * - * Snake distance (rectilinear distance, Manhattan distance) is the sum of the horizontal and vertical distances. - * It's the effective distance when movement is allowed only horizontally or vertically (but not both). - * @param x1 The x coordinate of the first point. - * @param y1 The y coordinate of the first point. - * @param x2 The x coordinate of the second point. - * @param y2 The y coordinate of the second point. - */ - function Snake(x1: number, y1: number, x2: number, y2: number): number; - - /** - * Calculate the distance between two sets of coordinates (points), squared. - * @param x1 The x coordinate of the first point. - * @param y1 The y coordinate of the first point. - * @param x2 The x coordinate of the second point. - * @param y2 The y coordinate of the second point. - */ - function Squared(x1: number, y1: number, x2: number, y2: number): number; - - } - - namespace Easing { - namespace Back { - /** - * Back ease-in. - * @param v The value to be tweened. - * @param overshoot The overshoot amount. Default 1.70158. - */ - function In(v: number, overshoot?: number): number; - - /** - * Back ease-in/out. - * @param v The value to be tweened. - * @param overshoot The overshoot amount. Default 1.70158. - */ - function InOut(v: number, overshoot?: number): number; - - /** - * Back ease-out. - * @param v The value to be tweened. - * @param overshoot The overshoot amount. Default 1.70158. - */ - function Out(v: number, overshoot?: number): number; - - } - - namespace Bounce { - /** - * Bounce ease-in. - * @param v The value to be tweened. - */ - function In(v: number): number; - - /** - * Bounce ease-in/out. - * @param v The value to be tweened. - */ - function InOut(v: number): number; - - /** - * Bounce ease-out. - * @param v The value to be tweened. - */ - function Out(v: number): number; - - } - - namespace Circular { - /** - * Circular ease-in. - * @param v The value to be tweened. - */ - function In(v: number): number; - - /** - * Circular ease-in/out. - * @param v The value to be tweened. - */ - function InOut(v: number): number; - - /** - * Circular ease-out. - * @param v The value to be tweened. - */ - function Out(v: number): number; - - } - - namespace Cubic { - /** - * Cubic ease-in. - * @param v The value to be tweened. - */ - function In(v: number): number; - - /** - * Cubic ease-in/out. - * @param v The value to be tweened. - */ - function InOut(v: number): number; - - /** - * Cubic ease-out. - * @param v The value to be tweened. - */ - function Out(v: number): number; - - } - - namespace Elastic { - /** - * Elastic ease-in. - * @param v The value to be tweened. - * @param amplitude The amplitude of the elastic ease. Default 0.1. - * @param period Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles. Default 0.1. - */ - function In(v: number, amplitude?: number, period?: number): number; - - /** - * Elastic ease-in/out. - * @param v The value to be tweened. - * @param amplitude The amplitude of the elastic ease. Default 0.1. - * @param period Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles. Default 0.1. - */ - function InOut(v: number, amplitude?: number, period?: number): number; - - /** - * Elastic ease-out. - * @param v The value to be tweened. - * @param amplitude The amplitude of the elastic ease. Default 0.1. - * @param period Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles. Default 0.1. - */ - function Out(v: number, amplitude?: number, period?: number): number; - - } - - namespace Expo { - /** - * Exponential ease-in. - * @param v The value to be tweened. - */ - function In(v: number): number; - - /** - * Exponential ease-in/out. - * @param v The value to be tweened. - */ - function InOut(v: number): number; - - /** - * Exponential ease-out. - * @param v The value to be tweened. - */ - function Out(v: number): number; - - } - - /** - * Linear easing (no variation). - * @param v The value to be tweened. - */ - function Linear(v: number): number; - - namespace Quadratic { - /** - * Quadratic ease-in. - * @param v The value to be tweened. - */ - function In(v: number): number; - - /** - * Quadratic ease-in/out. - * @param v The value to be tweened. - */ - function InOut(v: number): number; - - /** - * Quadratic ease-out. - * @param v The value to be tweened. - */ - function Out(v: number): number; - - } - - namespace Quartic { - /** - * Quartic ease-in. - * @param v The value to be tweened. - */ - function In(v: number): number; - - /** - * Quartic ease-in/out. - * @param v The value to be tweened. - */ - function InOut(v: number): number; - - /** - * Quartic ease-out. - * @param v The value to be tweened. - */ - function Out(v: number): number; - - } - - namespace Quintic { - /** - * Quintic ease-in. - * @param v The value to be tweened. - */ - function In(v: number): number; - - /** - * Quintic ease-in/out. - * @param v The value to be tweened. - */ - function InOut(v: number): number; - - /** - * Quintic ease-out. - * @param v The value to be tweened. - */ - function Out(v: number): number; - - } - - namespace Sine { - /** - * Sinusoidal ease-in. - * @param v The value to be tweened. - */ - function In(v: number): number; - - /** - * Sinusoidal ease-in/out. - * @param v The value to be tweened. - */ - function InOut(v: number): number; - - /** - * Sinusoidal ease-out. - * @param v The value to be tweened. - */ - function Out(v: number): number; - - } - - namespace Stepped { - } - - /** - * Stepped easing. - * @param v The value to be tweened. - * @param steps The number of steps in the ease. Default 1. - */ - function Stepped(v: number, steps?: number): number; - - } - class Euler { /** * @@ -58881,53 +58411,6 @@ declare namespace Phaser { */ function FromPercent(percent: number, min: number, max?: number): number; - namespace Fuzzy { - /** - * Calculate the fuzzy ceiling of the given value. - * @param value The value. - * @param epsilon The epsilon. Default 0.0001. - */ - function Ceil(value: number, epsilon?: number): number; - - /** - * Check whether the given values are fuzzily equal. - * - * Two numbers are fuzzily equal if their difference is less than `epsilon`. - * @param a The first value. - * @param b The second value. - * @param epsilon The epsilon. Default 0.0001. - */ - function Equal(a: number, b: number, epsilon?: number): boolean; - - /** - * Calculate the fuzzy floor of the given value. - * @param value The value. - * @param epsilon The epsilon. Default 0.0001. - */ - function Floor(value: number, epsilon?: number): number; - - /** - * Check whether `a` is fuzzily greater than `b`. - * - * `a` is fuzzily greater than `b` if it is more than `b - epsilon`. - * @param a The first value. - * @param b The second value. - * @param epsilon The epsilon. Default 0.0001. - */ - function GreaterThan(a: number, b: number, epsilon?: number): boolean; - - /** - * Check whether `a` is fuzzily less than `b`. - * - * `a` is fuzzily less than `b` if it is less than `b + epsilon`. - * @param a The first value. - * @param b The second value. - * @param epsilon The epsilon. Default 0.0001. - */ - function LessThan(a: number, b: number, epsilon?: number): boolean; - - } - /** * Calculate a per-ms speed from a distance and time (given in seconds). * @param distance The distance. @@ -58935,67 +58418,6 @@ declare namespace Phaser { */ function GetSpeed(distance: number, time: number): number; - namespace Interpolation { - /** - * A bezier interpolation method. - * @param v The input array of values to interpolate between. - * @param k The percentage of interpolation, between 0 and 1. - */ - function Bezier(v: number[], k: number): number; - - /** - * A Catmull-Rom interpolation method. - * @param v The input array of values to interpolate between. - * @param k The percentage of interpolation, between 0 and 1. - */ - function CatmullRom(v: number[], k: number): number; - - /** - * A cubic bezier interpolation method. - * - * https://medium.com/@adrian_cooney/bezier-interpolation-13b68563313a - * @param t The percentage of interpolation, between 0 and 1. - * @param p0 The start point. - * @param p1 The first control point. - * @param p2 The second control point. - * @param p3 The end point. - */ - function CubicBezier(t: number, p0: number, p1: number, p2: number, p3: number): number; - - /** - * A linear interpolation method. - * @param v The input array of values to interpolate between. - * @param k The percentage of interpolation, between 0 and 1. - */ - function Linear(v: number[], k: number): number; - - /** - * A quadratic bezier interpolation method. - * @param t The percentage of interpolation, between 0 and 1. - * @param p0 The start point. - * @param p1 The control point. - * @param p2 The end point. - */ - function QuadraticBezier(t: number, p0: number, p1: number, p2: number): number; - - /** - * A Smoother Step interpolation method. - * @param t The percentage of interpolation, between 0 and 1. - * @param min The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. - * @param max The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. - */ - function SmootherStep(t: number, min: number, max: number): number; - - /** - * A Smooth Step interpolation method. - * @param t The percentage of interpolation, between 0 and 1. - * @param min The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. - * @param max The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. - */ - function SmoothStep(t: number, min: number, max: number): number; - - } - /** * Check if a given value is an even number. * @param value The number to perform the check with. @@ -59494,29 +58916,6 @@ declare namespace Phaser { */ function Percent(value: number, min: number, max?: number, upperMax?: number): number; - namespace Pow2 { - /** - * Returns the nearest power of 2 to the given `value`. - * @param value The value. - */ - function GetNext(value: number): number; - - /** - * Checks if the given `width` and `height` are a power of two. - * Useful for checking texture dimensions. - * @param width The width. - * @param height The height. - */ - function IsSize(width: number, height: number): boolean; - - /** - * Tests the value and returns `true` if it is a power of two. - * @param value The value to check if it's a power of two. - */ - function IsValue(value: number): boolean; - - } - /** * A quaternion. */ @@ -59722,149 +59121,6 @@ declare namespace Phaser { */ function RadToDeg(radians: number): number; - /** - * A seeded Random Data Generator. - * - * Access via `Phaser.Math.RND` which is an instance of this class pre-defined - * by Phaser. Or, create your own instance to use as you require. - * - * The `Math.RND` generator is seeded by the Game Config property value `seed`. - * If no such config property exists, a random number is used. - * - * If you create your own instance of this class you should provide a seed for it. - * If no seed is given it will use a 'random' one based on Date.now. - */ - class RandomDataGenerator { - /** - * - * @param seeds The seeds to use for the random number generator. - */ - constructor(seeds?: string | string[]); - - /** - * Signs to choose from. - */ - signs: number[]; - - /** - * Initialize the state of the random data generator. - * @param seeds The seeds to initialize the random data generator with. - */ - init(seeds: string | string[]): void; - - /** - * Reset the seed of the random data generator. - * - * _Note_: the seed array is only processed up to the first `undefined` (or `null`) value, should such be present. - * @param seeds The array of seeds: the `toString()` of each value is used. - */ - sow(seeds: string[]): void; - - /** - * Returns a random integer between 0 and 2^32. - */ - integer(): number; - - /** - * Returns a random real number between 0 and 1. - */ - frac(): number; - - /** - * Returns a random real number between 0 and 2^32. - */ - real(): number; - - /** - * Returns a random integer between and including min and max. - * @param min The minimum value in the range. - * @param max The maximum value in the range. - */ - integerInRange(min: number, max: number): number; - - /** - * Returns a random integer between and including min and max. - * This method is an alias for RandomDataGenerator.integerInRange. - * @param min The minimum value in the range. - * @param max The maximum value in the range. - */ - between(min: number, max: number): number; - - /** - * Returns a random real number between min and max. - * @param min The minimum value in the range. - * @param max The maximum value in the range. - */ - realInRange(min: number, max: number): number; - - /** - * Returns a random real number between -1 and 1. - */ - normal(): number; - - /** - * Returns a valid RFC4122 version4 ID hex string from https://gist.github.com/1308368 - */ - uuid(): string; - - /** - * Returns a random element from within the given array. - * @param array The array to pick a random element from. - */ - pick(array: T[]): T; - - /** - * Returns a sign to be used with multiplication operator. - */ - sign(): number; - - /** - * Returns a random element from within the given array, favoring the earlier entries. - * @param array The array to pick a random element from. - */ - weightedPick(array: T[]): T; - - /** - * Returns a random timestamp between min and max, or between the beginning of 2000 and the end of 2020 if min and max aren't specified. - * @param min The minimum value in the range. - * @param max The maximum value in the range. - */ - timestamp(min: number, max: number): number; - - /** - * Returns a random angle between -180 and 180. - */ - angle(): number; - - /** - * Returns a random rotation in radians, between -3.141 and 3.141 - */ - rotation(): number; - - /** - * Gets or Sets the state of the generator. This allows you to retain the values - * that the generator is using between games, i.e. in a game save file. - * - * To seed this generator with a previously saved state you can pass it as the - * `seed` value in your game config, or call this method directly after Phaser has booted. - * - * Call this method with no parameters to return the current state. - * - * If providing a state it should match the same format that this method - * returns, which is a string with a header `!rnd` followed by the `c`, - * `s0`, `s1` and `s2` values respectively, each comma-delimited. - * @param state Generator state to be set. - */ - state(state?: string): string; - - /** - * Shuffles the given array, using the current seed. - * @param array The array to be shuffled. - */ - shuffle(array?: T[]): T[]; - - } - /** * Compute a random unit vector. * @@ -59981,6 +59237,18 @@ declare namespace Phaser { */ function SinCosTableGenerator(length: number, sinAmp?: number, cosAmp?: number, frequency?: number): Phaser.Types.Math.SinCosTable; + /** + * Calculate a smooth interpolation percentage of `x` between `min` and `max`. + * + * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge, + * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, + * between 0 and 1 otherwise. + * @param x The input value. + * @param min The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. + * @param max The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. + */ + function SmoothStep(x: number, min: number, max: number): number; + /** * Calculate a smoother interpolation percentage of `x` between `min` and `max`. * @@ -59995,56 +59263,6 @@ declare namespace Phaser { */ function SmootherStep(x: number, min: number, max: number): number; - /** - * Calculate a smooth interpolation percentage of `x` between `min` and `max`. - * - * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge, - * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, - * between 0 and 1 otherwise. - * @param x The input value. - * @param min The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. - * @param max The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. - */ - function SmoothStep(x: number, min: number, max: number): number; - - namespace Snap { - /** - * Snap a value to nearest grid slice, using ceil. - * - * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `15`. - * As will `14` snap to `15`... but `16` will snap to `20`. - * @param value The value to snap. - * @param gap The interval gap of the grid. - * @param start Optional starting offset for gap. Default 0. - * @param divide If `true` it will divide the snapped value by the gap before returning. Default false. - */ - function Ceil(value: number, gap: number, start?: number, divide?: boolean): number; - - /** - * Snap a value to nearest grid slice, using floor. - * - * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `10`. - * As will `14` snap to `10`... but `16` will snap to `15`. - * @param value The value to snap. - * @param gap The interval gap of the grid. - * @param start Optional starting offset for gap. Default 0. - * @param divide If `true` it will divide the snapped value by the gap before returning. Default false. - */ - function Floor(value: number, gap: number, start?: number, divide?: boolean): number; - - /** - * Snap a value to nearest grid slice, using rounding. - * - * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `10` whereas `14` will snap to `15`. - * @param value The value to snap. - * @param gap The interval gap of the grid. - * @param start Optional starting offset for gap. Default 0. - * @param divide If `true` it will divide the snapped value by the gap before returning. Default false. - */ - function To(value: number, gap: number, start?: number, divide?: boolean): number; - - } - /** * Returns a Vector2 containing the x and y position of the given index in a `width` x `height` sized grid. * @@ -60884,6 +60102,788 @@ declare namespace Phaser { */ function Wrap(value: number, min: number, max: number): number; + namespace Angle { + /** + * Find the angle of a segment from (x1, y1) -> (x2, y2). + * @param x1 The x coordinate of the first point. + * @param y1 The y coordinate of the first point. + * @param x2 The x coordinate of the second point. + * @param y2 The y coordinate of the second point. + */ + function Between(x1: number, y1: number, x2: number, y2: number): number; + + /** + * Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y). + * + * Calculates the angle of the vector from the first point to the second point. + * @param point1 The first point. + * @param point2 The second point. + */ + function BetweenPoints(point1: Phaser.Types.Math.Vector2Like, point2: Phaser.Types.Math.Vector2Like): number; + + /** + * Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y). + * + * The difference between this method and {@link Phaser.Math.Angle.BetweenPoints} is that this assumes the y coordinate + * travels down the screen. + * @param point1 The first point. + * @param point2 The second point. + */ + function BetweenPointsY(point1: Phaser.Types.Math.Vector2Like, point2: Phaser.Types.Math.Vector2Like): number; + + /** + * Find the angle of a segment from (x1, y1) -> (x2, y2). + * + * The difference between this method and {@link Phaser.Math.Angle.Between} is that this assumes the y coordinate + * travels down the screen. + * @param x1 The x coordinate of the first point. + * @param y1 The y coordinate of the first point. + * @param x2 The x coordinate of the second point. + * @param y2 The y coordinate of the second point. + */ + function BetweenY(x1: number, y1: number, x2: number, y2: number): number; + + /** + * Takes an angle in Phasers default clockwise format and converts it so that + * 0 is North, 90 is West, 180 is South and 270 is East, + * therefore running counter-clockwise instead of clockwise. + * + * You can pass in the angle from a Game Object using: + * + * ```javascript + * var converted = CounterClockwise(gameobject.rotation); + * ``` + * + * All values for this function are in radians. + * @param angle The angle to convert, in radians. + */ + function CounterClockwise(angle: number): number; + + /** + * Normalize an angle to the [0, 2pi] range. + * @param angle The angle to normalize, in radians. + */ + function Normalize(angle: number): number; + + /** + * Returns a random angle in the range [-pi, pi]. + */ + function Random(): number; + + /** + * Returns a random angle in the range [-180, 180]. + */ + function RandomDegrees(): number; + + /** + * Reverse the given angle. + * @param angle The angle to reverse, in radians. + */ + function Reverse(angle: number): number; + + /** + * Rotates `currentAngle` towards `targetAngle`, taking the shortest rotation distance. The `lerp` argument is the amount to rotate by in this call. + * @param currentAngle The current angle, in radians. + * @param targetAngle The target angle to rotate to, in radians. + * @param lerp The lerp value to add to the current angle. Default 0.05. + */ + function RotateTo(currentAngle: number, targetAngle: number, lerp?: number): number; + + /** + * Gets the shortest angle between `angle1` and `angle2`. + * + * Both angles must be in the range -180 to 180, which is the same clamped + * range that `sprite.angle` uses, so you can pass in two sprite angles to + * this method and get the shortest angle back between the two of them. + * + * The angle returned will be in the same range. If the returned angle is + * greater than 0 then it's a counter-clockwise rotation, if < 0 then it's + * a clockwise rotation. + * @param angle1 The first angle in the range -180 to 180. + * @param angle2 The second angle in the range -180 to 180. + */ + function ShortestBetween(angle1: number, angle2: number): number; + + /** + * Wrap an angle. + * + * Wraps the angle to a value in the range of -PI to PI. + * @param angle The angle to wrap, in radians. + */ + function Wrap(angle: number): number; + + /** + * Wrap an angle in degrees. + * + * Wraps the angle to a value in the range of -180 to 180. + * @param angle The angle to wrap, in degrees. + */ + function WrapDegrees(angle: number): number; + + } + + /** + * The value of PI * 2. + */ + var PI2: number; + + /** + * The value of PI * 0.5. + */ + var TAU: number; + + /** + * An epsilon value (1.0e-6) + */ + var EPSILON: number; + + /** + * For converting degrees to radians (PI / 180) + */ + var DEG_TO_RAD: number; + + /** + * For converting radians to degrees (180 / PI) + */ + var RAD_TO_DEG: number; + + /** + * An instance of the Random Number Generator. + * This is not set until the Game boots. + */ + var RND: Phaser.Math.RandomDataGenerator; + + /** + * The minimum safe integer this browser supports. + * We use a const for backward compatibility with Internet Explorer. + */ + var MIN_SAFE_INTEGER: number; + + /** + * The maximum safe integer this browser supports. + * We use a const for backward compatibility with Internet Explorer. + */ + var MAX_SAFE_INTEGER: number; + + namespace Distance { + /** + * Calculate the distance between two sets of coordinates (points). + * @param x1 The x coordinate of the first point. + * @param y1 The y coordinate of the first point. + * @param x2 The x coordinate of the second point. + * @param y2 The y coordinate of the second point. + */ + function Between(x1: number, y1: number, x2: number, y2: number): number; + + /** + * Calculate the distance between two points. + * @param a The first point. + * @param b The second point. + */ + function BetweenPoints(a: Phaser.Types.Math.Vector2Like, b: Phaser.Types.Math.Vector2Like): number; + + /** + * Calculate the squared distance between two points. + * @param a The first point. + * @param b The second point. + */ + function BetweenPointsSquared(a: Phaser.Types.Math.Vector2Like, b: Phaser.Types.Math.Vector2Like): number; + + /** + * Calculate the Chebyshev distance between two sets of coordinates (points). + * + * Chebyshev distance (or chessboard distance) is the maximum of the horizontal and vertical distances. + * It's the effective distance when movement can be horizontal, vertical, or diagonal. + * @param x1 The x coordinate of the first point. + * @param y1 The y coordinate of the first point. + * @param x2 The x coordinate of the second point. + * @param y2 The y coordinate of the second point. + */ + function Chebyshev(x1: number, y1: number, x2: number, y2: number): number; + + /** + * Calculate the distance between two sets of coordinates (points) to the power of `pow`. + * @param x1 The x coordinate of the first point. + * @param y1 The y coordinate of the first point. + * @param x2 The x coordinate of the second point. + * @param y2 The y coordinate of the second point. + * @param pow The exponent. + */ + function Power(x1: number, y1: number, x2: number, y2: number, pow: number): number; + + /** + * Calculate the snake distance between two sets of coordinates (points). + * + * Snake distance (rectilinear distance, Manhattan distance) is the sum of the horizontal and vertical distances. + * It's the effective distance when movement is allowed only horizontally or vertically (but not both). + * @param x1 The x coordinate of the first point. + * @param y1 The y coordinate of the first point. + * @param x2 The x coordinate of the second point. + * @param y2 The y coordinate of the second point. + */ + function Snake(x1: number, y1: number, x2: number, y2: number): number; + + /** + * Calculate the distance between two sets of coordinates (points), squared. + * @param x1 The x coordinate of the first point. + * @param y1 The y coordinate of the first point. + * @param x2 The x coordinate of the second point. + * @param y2 The y coordinate of the second point. + */ + function Squared(x1: number, y1: number, x2: number, y2: number): number; + + } + + namespace Easing { + namespace Back { + /** + * Back ease-in. + * @param v The value to be tweened. + * @param overshoot The overshoot amount. Default 1.70158. + */ + function In(v: number, overshoot?: number): number; + + /** + * Back ease-in/out. + * @param v The value to be tweened. + * @param overshoot The overshoot amount. Default 1.70158. + */ + function InOut(v: number, overshoot?: number): number; + + /** + * Back ease-out. + * @param v The value to be tweened. + * @param overshoot The overshoot amount. Default 1.70158. + */ + function Out(v: number, overshoot?: number): number; + + } + + namespace Bounce { + /** + * Bounce ease-in. + * @param v The value to be tweened. + */ + function In(v: number): number; + + /** + * Bounce ease-in/out. + * @param v The value to be tweened. + */ + function InOut(v: number): number; + + /** + * Bounce ease-out. + * @param v The value to be tweened. + */ + function Out(v: number): number; + + } + + namespace Circular { + /** + * Circular ease-in. + * @param v The value to be tweened. + */ + function In(v: number): number; + + /** + * Circular ease-in/out. + * @param v The value to be tweened. + */ + function InOut(v: number): number; + + /** + * Circular ease-out. + * @param v The value to be tweened. + */ + function Out(v: number): number; + + } + + namespace Cubic { + /** + * Cubic ease-in. + * @param v The value to be tweened. + */ + function In(v: number): number; + + /** + * Cubic ease-in/out. + * @param v The value to be tweened. + */ + function InOut(v: number): number; + + /** + * Cubic ease-out. + * @param v The value to be tweened. + */ + function Out(v: number): number; + + } + + namespace Elastic { + /** + * Elastic ease-in. + * @param v The value to be tweened. + * @param amplitude The amplitude of the elastic ease. Default 0.1. + * @param period Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles. Default 0.1. + */ + function In(v: number, amplitude?: number, period?: number): number; + + /** + * Elastic ease-in/out. + * @param v The value to be tweened. + * @param amplitude The amplitude of the elastic ease. Default 0.1. + * @param period Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles. Default 0.1. + */ + function InOut(v: number, amplitude?: number, period?: number): number; + + /** + * Elastic ease-out. + * @param v The value to be tweened. + * @param amplitude The amplitude of the elastic ease. Default 0.1. + * @param period Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles. Default 0.1. + */ + function Out(v: number, amplitude?: number, period?: number): number; + + } + + namespace Expo { + /** + * Exponential ease-in. + * @param v The value to be tweened. + */ + function In(v: number): number; + + /** + * Exponential ease-in/out. + * @param v The value to be tweened. + */ + function InOut(v: number): number; + + /** + * Exponential ease-out. + * @param v The value to be tweened. + */ + function Out(v: number): number; + + } + + /** + * Linear easing (no variation). + * @param v The value to be tweened. + */ + function Linear(v: number): number; + + namespace Quadratic { + /** + * Quadratic ease-in. + * @param v The value to be tweened. + */ + function In(v: number): number; + + /** + * Quadratic ease-in/out. + * @param v The value to be tweened. + */ + function InOut(v: number): number; + + /** + * Quadratic ease-out. + * @param v The value to be tweened. + */ + function Out(v: number): number; + + } + + namespace Quartic { + /** + * Quartic ease-in. + * @param v The value to be tweened. + */ + function In(v: number): number; + + /** + * Quartic ease-in/out. + * @param v The value to be tweened. + */ + function InOut(v: number): number; + + /** + * Quartic ease-out. + * @param v The value to be tweened. + */ + function Out(v: number): number; + + } + + namespace Quintic { + /** + * Quintic ease-in. + * @param v The value to be tweened. + */ + function In(v: number): number; + + /** + * Quintic ease-in/out. + * @param v The value to be tweened. + */ + function InOut(v: number): number; + + /** + * Quintic ease-out. + * @param v The value to be tweened. + */ + function Out(v: number): number; + + } + + namespace Sine { + /** + * Sinusoidal ease-in. + * @param v The value to be tweened. + */ + function In(v: number): number; + + /** + * Sinusoidal ease-in/out. + * @param v The value to be tweened. + */ + function InOut(v: number): number; + + /** + * Sinusoidal ease-out. + * @param v The value to be tweened. + */ + function Out(v: number): number; + + } + + /** + * Stepped easing. + * @param v The value to be tweened. + * @param steps The number of steps in the ease. Default 1. + */ + function Stepped(v: number, steps?: number): number; + + namespace Stepped { + } + + } + + namespace Fuzzy { + /** + * Calculate the fuzzy ceiling of the given value. + * @param value The value. + * @param epsilon The epsilon. Default 0.0001. + */ + function Ceil(value: number, epsilon?: number): number; + + /** + * Check whether the given values are fuzzily equal. + * + * Two numbers are fuzzily equal if their difference is less than `epsilon`. + * @param a The first value. + * @param b The second value. + * @param epsilon The epsilon. Default 0.0001. + */ + function Equal(a: number, b: number, epsilon?: number): boolean; + + /** + * Calculate the fuzzy floor of the given value. + * @param value The value. + * @param epsilon The epsilon. Default 0.0001. + */ + function Floor(value: number, epsilon?: number): number; + + /** + * Check whether `a` is fuzzily greater than `b`. + * + * `a` is fuzzily greater than `b` if it is more than `b - epsilon`. + * @param a The first value. + * @param b The second value. + * @param epsilon The epsilon. Default 0.0001. + */ + function GreaterThan(a: number, b: number, epsilon?: number): boolean; + + /** + * Check whether `a` is fuzzily less than `b`. + * + * `a` is fuzzily less than `b` if it is less than `b + epsilon`. + * @param a The first value. + * @param b The second value. + * @param epsilon The epsilon. Default 0.0001. + */ + function LessThan(a: number, b: number, epsilon?: number): boolean; + + } + + namespace Interpolation { + /** + * A bezier interpolation method. + * @param v The input array of values to interpolate between. + * @param k The percentage of interpolation, between 0 and 1. + */ + function Bezier(v: number[], k: number): number; + + /** + * A Catmull-Rom interpolation method. + * @param v The input array of values to interpolate between. + * @param k The percentage of interpolation, between 0 and 1. + */ + function CatmullRom(v: number[], k: number): number; + + /** + * A cubic bezier interpolation method. + * + * https://medium.com/@adrian_cooney/bezier-interpolation-13b68563313a + * @param t The percentage of interpolation, between 0 and 1. + * @param p0 The start point. + * @param p1 The first control point. + * @param p2 The second control point. + * @param p3 The end point. + */ + function CubicBezier(t: number, p0: number, p1: number, p2: number, p3: number): number; + + /** + * A linear interpolation method. + * @param v The input array of values to interpolate between. + * @param k The percentage of interpolation, between 0 and 1. + */ + function Linear(v: number[], k: number): number; + + /** + * A quadratic bezier interpolation method. + * @param t The percentage of interpolation, between 0 and 1. + * @param p0 The start point. + * @param p1 The control point. + * @param p2 The end point. + */ + function QuadraticBezier(t: number, p0: number, p1: number, p2: number): number; + + /** + * A Smooth Step interpolation method. + * @param t The percentage of interpolation, between 0 and 1. + * @param min The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. + * @param max The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. + */ + function SmoothStep(t: number, min: number, max: number): number; + + /** + * A Smoother Step interpolation method. + * @param t The percentage of interpolation, between 0 and 1. + * @param min The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. + * @param max The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. + */ + function SmootherStep(t: number, min: number, max: number): number; + + } + + namespace Pow2 { + /** + * Returns the nearest power of 2 to the given `value`. + * @param value The value. + */ + function GetNext(value: number): number; + + /** + * Checks if the given `width` and `height` are a power of two. + * Useful for checking texture dimensions. + * @param width The width. + * @param height The height. + */ + function IsSize(width: number, height: number): boolean; + + /** + * Tests the value and returns `true` if it is a power of two. + * @param value The value to check if it's a power of two. + */ + function IsValue(value: number): boolean; + + } + + /** + * A seeded Random Data Generator. + * + * Access via `Phaser.Math.RND` which is an instance of this class pre-defined + * by Phaser. Or, create your own instance to use as you require. + * + * The `Math.RND` generator is seeded by the Game Config property value `seed`. + * If no such config property exists, a random number is used. + * + * If you create your own instance of this class you should provide a seed for it. + * If no seed is given it will use a 'random' one based on Date.now. + */ + class RandomDataGenerator { + /** + * + * @param seeds The seeds to use for the random number generator. + */ + constructor(seeds?: string | string[]); + + /** + * Signs to choose from. + */ + signs: number[]; + + /** + * Initialize the state of the random data generator. + * @param seeds The seeds to initialize the random data generator with. + */ + init(seeds: string | string[]): void; + + /** + * Reset the seed of the random data generator. + * + * _Note_: the seed array is only processed up to the first `undefined` (or `null`) value, should such be present. + * @param seeds The array of seeds: the `toString()` of each value is used. + */ + sow(seeds: string[]): void; + + /** + * Returns a random integer between 0 and 2^32. + */ + integer(): number; + + /** + * Returns a random real number between 0 and 1. + */ + frac(): number; + + /** + * Returns a random real number between 0 and 2^32. + */ + real(): number; + + /** + * Returns a random integer between and including min and max. + * @param min The minimum value in the range. + * @param max The maximum value in the range. + */ + integerInRange(min: number, max: number): number; + + /** + * Returns a random integer between and including min and max. + * This method is an alias for RandomDataGenerator.integerInRange. + * @param min The minimum value in the range. + * @param max The maximum value in the range. + */ + between(min: number, max: number): number; + + /** + * Returns a random real number between min and max. + * @param min The minimum value in the range. + * @param max The maximum value in the range. + */ + realInRange(min: number, max: number): number; + + /** + * Returns a random real number between -1 and 1. + */ + normal(): number; + + /** + * Returns a valid RFC4122 version4 ID hex string from https://gist.github.com/1308368 + */ + uuid(): string; + + /** + * Returns a random element from within the given array. + * @param array The array to pick a random element from. + */ + pick(array: T[]): T; + + /** + * Returns a sign to be used with multiplication operator. + */ + sign(): number; + + /** + * Returns a random element from within the given array, favoring the earlier entries. + * @param array The array to pick a random element from. + */ + weightedPick(array: T[]): T; + + /** + * Returns a random timestamp between min and max, or between the beginning of 2000 and the end of 2020 if min and max aren't specified. + * @param min The minimum value in the range. + * @param max The maximum value in the range. + */ + timestamp(min: number, max: number): number; + + /** + * Returns a random angle between -180 and 180. + */ + angle(): number; + + /** + * Returns a random rotation in radians, between -3.141 and 3.141 + */ + rotation(): number; + + /** + * Gets or Sets the state of the generator. This allows you to retain the values + * that the generator is using between games, i.e. in a game save file. + * + * To seed this generator with a previously saved state you can pass it as the + * `seed` value in your game config, or call this method directly after Phaser has booted. + * + * Call this method with no parameters to return the current state. + * + * If providing a state it should match the same format that this method + * returns, which is a string with a header `!rnd` followed by the `c`, + * `s0`, `s1` and `s2` values respectively, each comma-delimited. + * @param state Generator state to be set. + */ + state(state?: string): string; + + /** + * Shuffles the given array, using the current seed. + * @param array The array to be shuffled. + */ + shuffle(array?: T[]): T[]; + + } + + namespace Snap { + /** + * Snap a value to nearest grid slice, using ceil. + * + * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `15`. + * As will `14` snap to `15`... but `16` will snap to `20`. + * @param value The value to snap. + * @param gap The interval gap of the grid. + * @param start Optional starting offset for gap. Default 0. + * @param divide If `true` it will divide the snapped value by the gap before returning. Default false. + */ + function Ceil(value: number, gap: number, start?: number, divide?: boolean): number; + + /** + * Snap a value to nearest grid slice, using floor. + * + * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `10`. + * As will `14` snap to `10`... but `16` will snap to `15`. + * @param value The value to snap. + * @param gap The interval gap of the grid. + * @param start Optional starting offset for gap. Default 0. + * @param divide If `true` it will divide the snapped value by the gap before returning. Default false. + */ + function Floor(value: number, gap: number, start?: number, divide?: boolean): number; + + /** + * Snap a value to nearest grid slice, using rounding. + * + * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `10` whereas `14` will snap to `15`. + * @param value The value to snap. + * @param gap The interval gap of the grid. + * @param start Optional starting offset for gap. Default 0. + * @param divide If `true` it will divide the snapped value by the gap before returning. Default false. + */ + function To(value: number, gap: number, start?: number, divide?: boolean): number; + + } + } /** @@ -64552,8 +64552,6 @@ declare namespace Phaser { shift: Phaser.Input.Keyboard.Key; }; - type KeyboardKeydownCallback = (event: KeyboardEvent)=>void; - type KeyComboConfig = { /** * If they press the wrong key do we reset the combo? @@ -64573,6 +64571,8 @@ declare namespace Phaser { deleteOnMatch?: boolean; }; + type KeyboardKeydownCallback = (event: KeyboardEvent)=>void; + } /** @@ -64950,6 +64950,25 @@ declare namespace Phaser { fontDataXhrSettings?: Phaser.Types.Loader.XHRSettingsObject; }; + type CSSFileConfig = { + /** + * The key of the file. Must be unique within the Loader. + */ + key: string; + /** + * The absolute or relative URL to load the file from. + */ + url?: string; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + type CompressedTextureFileEntry = { /** * The texture compression base format that the browser must support in order to load this file. Can be any of: 'ETC', 'ETC1', 'ATC', 'ASTC', 'BPTC', 'RGTC', 'PVRTC', 'S3TC', 'S3TCSRGB' or the fallback format of 'IMG'. @@ -65024,25 +65043,6 @@ declare namespace Phaser { IMG?: Phaser.Types.Loader.FileTypes.CompressedTextureFileEntry | string; }; - type CSSFileConfig = { - /** - * The key of the file. Must be unique within the Loader. - */ - key: string; - /** - * The absolute or relative URL to load the file from. - */ - url?: string; - /** - * The default file extension to use if no url is provided. - */ - extension?: string; - /** - * Extra XHR Settings specifically for this file. - */ - xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; - }; - type GLSLFileConfig = { /** * The key of the file. Must be unique within both the Loader and the Text Cache. @@ -65347,6 +65347,44 @@ declare namespace Phaser { xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; }; + type SVGFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Texture Manager. + */ + key: string; + /** + * The absolute or relative URL to load the file from. + */ + url?: string; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + /** + * The svg size configuration object. + */ + svgConfig?: Phaser.Types.Loader.FileTypes.SVGSizeConfig; + }; + + type SVGSizeConfig = { + /** + * An optional width. The SVG will be resized to this size before being rendered to a texture. + */ + width?: number; + /** + * An optional height. The SVG will be resized to this size before being rendered to a texture. + */ + height?: number; + /** + * An optional scale. If given it overrides the width / height properties. The SVG is scaled by the scale factor before being rendered to a texture. + */ + scale?: number; + }; + type SceneFileConfig = { /** * The key of the file. Must be unique within both the Loader and the Text Cache. @@ -65443,44 +65481,6 @@ declare namespace Phaser { xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; }; - type SVGFileConfig = { - /** - * The key of the file. Must be unique within both the Loader and the Texture Manager. - */ - key: string; - /** - * The absolute or relative URL to load the file from. - */ - url?: string; - /** - * The default file extension to use if no url is provided. - */ - extension?: string; - /** - * Extra XHR Settings specifically for this file. - */ - xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; - /** - * The svg size configuration object. - */ - svgConfig?: Phaser.Types.Loader.FileTypes.SVGSizeConfig; - }; - - type SVGSizeConfig = { - /** - * An optional width. The SVG will be resized to this size before being rendered to a texture. - */ - width?: number; - /** - * An optional height. The SVG will be resized to this size before being rendered to a texture. - */ - height?: number; - /** - * An optional scale. If given it overrides the width / height properties. The SVG is scaled by the scale factor before being rendered to a texture. - */ - scale?: number; - }; - type TextFileConfig = { /** * The key of the file. Must be unique within both the Loader and the Text Cache. @@ -68825,6 +68825,8 @@ declare namespace Phaser { interpolation?: string | Function; }; + type TweenCallbackTypes = 'onActive' | 'onComplete' | 'onLoop' | 'onPause' | 'onRepeat' | 'onResume' | 'onStart' | 'onStop' | 'onUpdate' | 'onYoyo'; + type TweenCallbacks = { /** * A function to call when the tween becomes active within the Tween Manager. @@ -68868,8 +68870,6 @@ declare namespace Phaser { onYoyo?: Phaser.Types.Tweens.TweenOnYoyoCallback; }; - type TweenCallbackTypes = 'onActive' | 'onComplete' | 'onLoop' | 'onPause' | 'onRepeat' | 'onResume' | 'onStart' | 'onStop' | 'onUpdate' | 'onYoyo'; - type TweenChainBuilderConfig = { /** * The object, or an array of objects, to run the tween on. @@ -73374,562 +73374,6 @@ declare namespace Phaser { } - namespace Components { - /** - * Provides methods used for setting the acceleration properties of an Arcade Physics Body. - */ - interface Acceleration { - /** - * Sets the body's horizontal and vertical acceleration. If the vertical acceleration value is not provided, the vertical acceleration is set to the same value as the horizontal acceleration. - * @param x The horizontal acceleration - * @param y The vertical acceleration Default x. - */ - setAcceleration(x: number, y?: number): this; - /** - * Sets the body's horizontal acceleration. - * @param value The horizontal acceleration - */ - setAccelerationX(value: number): this; - /** - * Sets the body's vertical acceleration. - * @param value The vertical acceleration - */ - setAccelerationY(value: number): this; - } - - /** - * Provides methods used for setting the angular acceleration properties of an Arcade Physics Body. - */ - interface Angular { - /** - * Sets the angular velocity of the body. - * - * In Arcade Physics, bodies cannot rotate. They are always axis-aligned. - * However, they can have angular motion, which is passed on to the Game Object bound to the body, - * causing them to visually rotate, even though the body remains axis-aligned. - * @param value The amount of angular velocity. - */ - setAngularVelocity(value: number): this; - /** - * Sets the angular acceleration of the body. - * - * In Arcade Physics, bodies cannot rotate. They are always axis-aligned. - * However, they can have angular motion, which is passed on to the Game Object bound to the body, - * causing them to visually rotate, even though the body remains axis-aligned. - * @param value The amount of angular acceleration. - */ - setAngularAcceleration(value: number): this; - /** - * Sets the angular drag of the body. Drag is applied to the current velocity, providing a form of deceleration. - * @param value The amount of drag. - */ - setAngularDrag(value: number): this; - } - - /** - * Provides methods used for setting the bounce properties of an Arcade Physics Body. - */ - interface Bounce { - /** - * Sets the bounce values of this body. - * - * Bounce is the amount of restitution, or elasticity, the body has when it collides with another object. - * A value of 1 means that it will retain its full velocity after the rebound. A value of 0 means it will not rebound at all. - * @param x The amount of horizontal bounce to apply on collision. A float, typically between 0 and 1. - * @param y The amount of vertical bounce to apply on collision. A float, typically between 0 and 1. Default x. - */ - setBounce(x: number, y?: number): this; - /** - * Sets the horizontal bounce value for this body. - * @param value The amount of horizontal bounce to apply on collision. A float, typically between 0 and 1. - */ - setBounceX(value: number): this; - /** - * Sets the vertical bounce value for this body. - * @param value The amount of vertical bounce to apply on collision. A float, typically between 0 and 1. - */ - setBounceY(value: number): this; - /** - * Sets whether this Body collides with the world boundary. - * - * Optionally also sets the World Bounce values. If the `Body.worldBounce` is null, it's set to a new Phaser.Math.Vector2 first. - * @param value `true` if this body should collide with the world bounds, otherwise `false`. Default true. - * @param bounceX If given this will be replace the `worldBounce.x` value. - * @param bounceY If given this will be replace the `worldBounce.y` value. - * @param onWorldBounds If given this replaces the Body's `onWorldBounds` value. - */ - setCollideWorldBounds(value?: boolean, bounceX?: number, bounceY?: number, onWorldBounds?: boolean): this; - } - - /** - * Provides methods used for setting the debug properties of an Arcade Physics Body. - */ - interface Debug { - /** - * Sets the debug values of this body. - * - * Bodies will only draw their debug if debug has been enabled for Arcade Physics as a whole. - * Note that there is a performance cost in drawing debug displays. It should never be used in production. - * @param showBody Set to `true` to have this body render its outline to the debug display. - * @param showVelocity Set to `true` to have this body render a velocity marker to the debug display. - * @param bodyColor The color of the body outline when rendered to the debug display. - */ - setDebug(showBody: boolean, showVelocity: boolean, bodyColor: number): this; - /** - * Sets the color of the body outline when it renders to the debug display. - * @param value The color of the body outline when rendered to the debug display. - */ - setDebugBodyColor(value: number): this; - /** - * Set to `true` to have this body render its outline to the debug display. - */ - debugShowBody: boolean; - /** - * Set to `true` to have this body render a velocity marker to the debug display. - */ - debugShowVelocity: boolean; - /** - * The color of the body outline when it renders to the debug display. - */ - debugBodyColor: number; - } - - /** - * Provides methods used for setting the drag properties of an Arcade Physics Body. - */ - interface Drag { - /** - * Sets the body's horizontal and vertical drag. If the vertical drag value is not provided, the vertical drag is set to the same value as the horizontal drag. - * - * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. - * It is the absolute loss of velocity due to movement, in pixels per second squared. - * The x and y components are applied separately. - * - * When `useDamping` is true, this is 1 minus the damping factor. - * A value of 1 means the Body loses no velocity. - * A value of 0.95 means the Body loses 5% of its velocity per step. - * A value of 0.5 means the Body loses 50% of its velocity per step. - * - * Drag is applied only when `acceleration` is zero. - * @param x The amount of horizontal drag to apply. - * @param y The amount of vertical drag to apply. Default x. - */ - setDrag(x: number, y?: number): this; - /** - * Sets the body's horizontal drag. - * - * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. - * It is the absolute loss of velocity due to movement, in pixels per second squared. - * The x and y components are applied separately. - * - * When `useDamping` is true, this is 1 minus the damping factor. - * A value of 1 means the Body loses no velocity. - * A value of 0.95 means the Body loses 5% of its velocity per step. - * A value of 0.5 means the Body loses 50% of its velocity per step. - * - * Drag is applied only when `acceleration` is zero. - * @param value The amount of horizontal drag to apply. - */ - setDragX(value: number): this; - /** - * Sets the body's vertical drag. - * - * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. - * It is the absolute loss of velocity due to movement, in pixels per second squared. - * The x and y components are applied separately. - * - * When `useDamping` is true, this is 1 minus the damping factor. - * A value of 1 means the Body loses no velocity. - * A value of 0.95 means the Body loses 5% of its velocity per step. - * A value of 0.5 means the Body loses 50% of its velocity per step. - * - * Drag is applied only when `acceleration` is zero. - * @param value The amount of vertical drag to apply. - */ - setDragY(value: number): this; - /** - * If this Body is using `drag` for deceleration this function controls how the drag is applied. - * If set to `true` drag will use a damping effect rather than a linear approach. If you are - * creating a game where the Body moves freely at any angle (i.e. like the way the ship moves in - * the game Asteroids) then you will get a far smoother and more visually correct deceleration - * by using damping, avoiding the axis-drift that is prone with linear deceleration. - * - * If you enable this property then you should use far smaller `drag` values than with linear, as - * they are used as a multiplier on the velocity. Values such as 0.95 will give a nice slow - * deceleration, where-as smaller values, such as 0.5 will stop an object almost immediately. - * @param value `true` to use damping for deceleration, or `false` to use linear deceleration. - */ - setDamping(value: boolean): this; - } - - /** - * Provides methods used for setting the enable properties of an Arcade Physics Body. - */ - interface Enable { - /** - * Enables this Game Object's Body. - * @param reset Also reset the Body and place it at (x, y). - * @param x The horizontal position to place the Game Object and Body. - * @param y The horizontal position to place the Game Object and Body. - * @param enableGameObject Also activate this Game Object. - * @param showGameObject Also show this Game Object. - */ - enableBody(reset: boolean, x: number, y: number, enableGameObject: boolean, showGameObject: boolean): this; - /** - * Stops and disables this Game Object's Body. - * @param disableGameObject Also deactivate this Game Object. Default false. - * @param hideGameObject Also hide this Game Object. Default false. - */ - disableBody(disableGameObject?: boolean, hideGameObject?: boolean): this; - /** - * Syncs the Body's position and size with its parent Game Object. - * You don't need to call this for Dynamic Bodies, as it happens automatically. - * But for Static bodies it's a useful way of modifying the position of a Static Body - * in the Physics World, based on its Game Object. - */ - refreshBody(): this; - } - - /** - * Methods for setting the friction of an Arcade Physics Body. - * - * In Arcade Physics, friction is a special case of motion transfer from an "immovable" body to a riding body. - */ - interface Friction { - /** - * Sets the friction of this game object's physics body. - * In Arcade Physics, friction is a special case of motion transfer from an "immovable" body to a riding body. - * @param x The amount of horizontal friction to apply, [0, 1]. - * @param y The amount of vertical friction to apply, [0, 1]. Default x. - */ - setFriction(x: number, y?: number): this; - /** - * Sets the horizontal friction of this game object's physics body. - * This can move a riding body horizontally when it collides with this one on the vertical axis. - * @param x The amount of friction to apply, [0, 1]. - */ - setFrictionX(x: number): this; - /** - * Sets the vertical friction of this game object's physics body. - * This can move a riding body vertically when it collides with this one on the horizontal axis. - * @param y The amount of friction to apply, [0, 1]. - */ - setFrictionY(y: number): this; - } - - /** - * Provides methods for setting the gravity properties of an Arcade Physics Game Object. - * Should be applied as a mixin and not used directly. - */ - interface Gravity { - /** - * Set the X and Y values of the gravitational pull to act upon this Arcade Physics Game Object. Values can be positive or negative. Larger values result in a stronger effect. - * - * If only one value is provided, this value will be used for both the X and Y axis. - * @param x The gravitational force to be applied to the X-axis. - * @param y The gravitational force to be applied to the Y-axis. If this is not specified, the X value will be used. Default x. - */ - setGravity(x: number, y?: number): this; - /** - * Set the gravitational force to be applied to the X axis. Value can be positive or negative. Larger values result in a stronger effect. - * @param x The gravitational force to be applied to the X-axis. - */ - setGravityX(x: number): this; - /** - * Set the gravitational force to be applied to the Y axis. Value can be positive or negative. Larger values result in a stronger effect. - * @param y The gravitational force to be applied to the Y-axis. - */ - setGravityY(y: number): this; - } - - /** - * Provides methods used for setting the immovable properties of an Arcade Physics Body. - */ - interface Immovable { - /** - * Sets if this Body can be separated during collisions with other bodies. - * - * When a body is immovable it means it won't move at all, not even to separate it from collision - * overlap. If you just wish to prevent a body from being knocked around by other bodies, see - * the `setPushable` method instead. - * @param value Sets if this body will be separated during collisions with other bodies. Default true. - */ - setImmovable(value?: boolean): this; - } - - /** - * Provides methods used for setting the mass properties of an Arcade Physics Body. - */ - interface Mass { - /** - * Sets the mass of the physics body - * @param value New value for the mass of the body. - */ - setMass(value: number): this; - } - - /** - * This method will search the given circular area and return an array of all physics bodies that - * overlap with it. It can return either Dynamic, Static bodies or a mixture of both. - * - * A body only has to intersect with the search area to be considered, it doesn't have to be fully - * contained within it. - * - * If Arcade Physics is set to use the RTree (which it is by default) then the search is rather fast, - * otherwise the search is O(N) for Dynamic Bodies. - */ - interface OverlapCirc { - } - - /** - * This method will search the given rectangular area and return an array of all physics bodies that - * overlap with it. It can return either Dynamic, Static bodies or a mixture of both. - * - * A body only has to intersect with the search area to be considered, it doesn't have to be fully - * contained within it. - * - * If Arcade Physics is set to use the RTree (which it is by default) then the search for is extremely fast, - * otherwise the search is O(N) for Dynamic Bodies. - */ - interface OverlapRect { - } - - /** - * Provides methods used for setting the pushable property of an Arcade Physics Body. - */ - interface Pushable { - /** - * Sets if this Body can be pushed by another Body. - * - * A body that cannot be pushed will reflect back all of the velocity it is given to the - * colliding body. If that body is also not pushable, then the separation will be split - * between them evenly. - * - * If you want your body to never move or seperate at all, see the `setImmovable` method. - * @param value Sets if this body can be pushed by collisions with another Body. Default true. - */ - setPushable(value?: boolean): this; - } - - /** - * Provides methods for setting the size of an Arcade Physics Game Object. - * Should be applied as a mixin and not used directly. - */ - interface Size { - /** - * Sets the body offset. This allows you to adjust the difference between the center of the body - * and the x and y coordinates of the parent Game Object. - * @param x The amount to offset the body from the parent Game Object along the x-axis. - * @param y The amount to offset the body from the parent Game Object along the y-axis. Defaults to the value given for the x-axis. Default x. - */ - setOffset(x: number, y?: number): this; - /** - * **DEPRECATED**: Please use `setBodySize` instead. - * - * Sets the size of this physics body. Setting the size does not adjust the dimensions of the parent Game Object. - * @param width The new width of the physics body, in pixels. - * @param height The new height of the physics body, in pixels. - * @param center Should the body be re-positioned so its center aligns with the parent Game Object? Default true. - */ - setSize(width: number, height: number, center?: boolean): this; - /** - * Sets the size of this physics body. Setting the size does not adjust the dimensions of the parent Game Object. - * @param width The new width of the physics body, in pixels. - * @param height The new height of the physics body, in pixels. - * @param center Should the body be re-positioned so its center aligns with the parent Game Object? Default true. - */ - setBodySize(width: number, height: number, center?: boolean): this; - /** - * Sets this physics body to use a circle for collision instead of a rectangle. - * @param radius The radius of the physics body, in pixels. - * @param offsetX The amount to offset the body from the parent Game Object along the x-axis. - * @param offsetY The amount to offset the body from the parent Game Object along the y-axis. - */ - setCircle(radius: number, offsetX?: number, offsetY?: number): this; - } - - /** - * Provides methods for modifying the velocity of an Arcade Physics body. - * - * Should be applied as a mixin and not used directly. - */ - interface Velocity { - /** - * Sets the velocity of the Body. - * @param x The horizontal velocity of the body. Positive values move the body to the right, while negative values move it to the left. - * @param y The vertical velocity of the body. Positive values move the body down, while negative values move it up. Default x. - */ - setVelocity(x: number, y?: number): this; - /** - * Sets the horizontal component of the body's velocity. - * - * Positive values move the body to the right, while negative values move it to the left. - * @param x The new horizontal velocity. - */ - setVelocityX(x: number): this; - /** - * Sets the vertical component of the body's velocity. - * - * Positive values move the body down, while negative values move it up. - * @param y The new vertical velocity of the body. - */ - setVelocityY(y: number): this; - /** - * Sets the maximum velocity of the body. - * @param x The new maximum horizontal velocity. - * @param y The new maximum vertical velocity. Default x. - */ - setMaxVelocity(x: number, y?: number): this; - } - - } - - /** - * Dynamic Body. - */ - var DYNAMIC_BODY: number; - - /** - * Static Body. - */ - var STATIC_BODY: number; - - /** - * Arcade Physics Group containing Dynamic Bodies. - */ - var GROUP: number; - - /** - * A Tilemap Layer. - */ - var TILEMAPLAYER: number; - - /** - * Facing no direction (initial value). - */ - var FACING_NONE: number; - - /** - * Facing up. - */ - var FACING_UP: number; - - /** - * Facing down. - */ - var FACING_DOWN: number; - - /** - * Facing left. - */ - var FACING_LEFT: number; - - /** - * Facing right. - */ - var FACING_RIGHT: number; - - namespace Events { - /** - * The Arcade Physics World Collide Event. - * - * This event is dispatched by an Arcade Physics World instance if two bodies collide _and_ at least - * one of them has their [onCollide]{@link Phaser.Physics.Arcade.Body#onCollide} property set to `true`. - * - * It provides an alternative means to handling collide events rather than using the callback approach. - * - * Listen to it from a Scene using: `this.physics.world.on('collide', listener)`. - * - * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. - */ - const COLLIDE: any; - - /** - * The Arcade Physics World Overlap Event. - * - * This event is dispatched by an Arcade Physics World instance if two bodies overlap _and_ at least - * one of them has their [onOverlap]{@link Phaser.Physics.Arcade.Body#onOverlap} property set to `true`. - * - * It provides an alternative means to handling overlap events rather than using the callback approach. - * - * Listen to it from a Scene using: `this.physics.world.on('overlap', listener)`. - * - * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. - */ - const OVERLAP: any; - - /** - * The Arcade Physics World Pause Event. - * - * This event is dispatched by an Arcade Physics World instance when it is paused. - * - * Listen to it from a Scene using: `this.physics.world.on('pause', listener)`. - */ - const PAUSE: any; - - /** - * The Arcade Physics World Resume Event. - * - * This event is dispatched by an Arcade Physics World instance when it resumes from a paused state. - * - * Listen to it from a Scene using: `this.physics.world.on('resume', listener)`. - */ - const RESUME: any; - - /** - * The Arcade Physics Tile Collide Event. - * - * This event is dispatched by an Arcade Physics World instance if a body collides with a Tile _and_ - * has its [onCollide]{@link Phaser.Physics.Arcade.Body#onCollide} property set to `true`. - * - * It provides an alternative means to handling collide events rather than using the callback approach. - * - * Listen to it from a Scene using: `this.physics.world.on('tilecollide', listener)`. - * - * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. - */ - const TILE_COLLIDE: any; - - /** - * The Arcade Physics Tile Overlap Event. - * - * This event is dispatched by an Arcade Physics World instance if a body overlaps with a Tile _and_ - * has its [onOverlap]{@link Phaser.Physics.Arcade.Body#onOverlap} property set to `true`. - * - * It provides an alternative means to handling overlap events rather than using the callback approach. - * - * Listen to it from a Scene using: `this.physics.world.on('tileoverlap', listener)`. - * - * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. - */ - const TILE_OVERLAP: any; - - /** - * The Arcade Physics World Bounds Event. - * - * This event is dispatched by an Arcade Physics World instance if a body makes contact with the world bounds _and_ - * it has its [onWorldBounds]{@link Phaser.Physics.Arcade.Body#onWorldBounds} property set to `true`. - * - * It provides an alternative means to handling collide events rather than using the callback approach. - * - * Listen to it from a Scene using: `this.physics.world.on('worldbounds', listener)`. - */ - const WORLD_BOUNDS: any; - - /** - * The Arcade Physics World Step Event. - * - * This event is dispatched by an Arcade Physics World instance whenever a physics step is run. - * It is emitted _after_ the bodies and colliders have been updated. - * - * In high framerate settings this can be multiple times per game frame. - * - * Listen to it from a Scene using: `this.physics.world.on('worldstep', listener)`. - */ - const WORLD_STEP: any; - - } - /** * The Arcade Physics Factory allows you to easily create Arcade Physics enabled Game Objects. * Objects that are created by this Factory are automatically added to the physics world. @@ -74644,73 +74088,6 @@ declare namespace Phaser { } - namespace Tilemap { - /** - * A function to process the collision callbacks between a single tile and an Arcade Physics enabled Game Object. - * @param tile The Tile to process. - * @param sprite The Game Object to process with the Tile. - */ - function ProcessTileCallbacks(tile: Phaser.Tilemaps.Tile, sprite: Phaser.GameObjects.Sprite): boolean; - - /** - * Internal function to process the separation of a physics body from a tile. - * @param body The Body object to separate. - * @param x The x separation amount. - */ - function ProcessTileSeparationX(body: Phaser.Physics.Arcade.Body, x: number): void; - - /** - * Internal function to process the separation of a physics body from a tile. - * @param body The Body object to separate. - * @param y The y separation amount. - */ - function ProcessTileSeparationY(body: Phaser.Physics.Arcade.Body, y: number): void; - - /** - * The core separation function to separate a physics body and a tile. - * @param i The index of the tile within the map data. - * @param body The Body object to separate. - * @param tile The tile to collide against. - * @param tileWorldRect A rectangle-like object defining the dimensions of the tile. - * @param tilemapLayer The tilemapLayer to collide against. - * @param tileBias The tile bias value. Populated by the `World.TILE_BIAS` constant. - * @param isLayer Is this check coming from a TilemapLayer or an array of tiles? - */ - function SeparateTile(i: number, body: Phaser.Physics.Arcade.Body, tile: Phaser.Tilemaps.Tile, tileWorldRect: Phaser.Geom.Rectangle, tilemapLayer: Phaser.Tilemaps.TilemapLayer, tileBias: number, isLayer: boolean): boolean; - - /** - * Check the body against the given tile on the X axis. - * Used internally by the SeparateTile function. - * @param body The Body object to separate. - * @param tile The tile to check. - * @param tileLeft The left position of the tile within the tile world. - * @param tileRight The right position of the tile within the tile world. - * @param tileBias The tile bias value. Populated by the `World.TILE_BIAS` constant. - * @param isLayer Is this check coming from a TilemapLayer or an array of tiles? - */ - function TileCheckX(body: Phaser.Physics.Arcade.Body, tile: Phaser.Tilemaps.Tile, tileLeft: number, tileRight: number, tileBias: number, isLayer: boolean): number; - - /** - * Check the body against the given tile on the Y axis. - * Used internally by the SeparateTile function. - * @param body The Body object to separate. - * @param tile The tile to check. - * @param tileTop The top position of the tile within the tile world. - * @param tileBottom The bottom position of the tile within the tile world. - * @param tileBias The tile bias value. Populated by the `World.TILE_BIAS` constant. - * @param isLayer Is this check coming from a TilemapLayer or an array of tiles? - */ - function TileCheckY(body: Phaser.Physics.Arcade.Body, tile: Phaser.Tilemaps.Tile, tileTop: number, tileBottom: number, tileBias: number, isLayer: boolean): number; - - /** - * Checks for intersection between the given tile rectangle-like object and an Arcade Physics body. - * @param tileWorldRect A rectangle object that defines the tile placement in the world. - * @param body The body to check for intersection against. - */ - function TileIntersectsBody(tileWorldRect: Object, body: Phaser.Physics.Arcade.Body): boolean; - - } - /** * The Arcade Physics World. * @@ -75299,6 +74676,629 @@ declare namespace Phaser { } + namespace Components { + /** + * Provides methods used for setting the acceleration properties of an Arcade Physics Body. + */ + interface Acceleration { + /** + * Sets the body's horizontal and vertical acceleration. If the vertical acceleration value is not provided, the vertical acceleration is set to the same value as the horizontal acceleration. + * @param x The horizontal acceleration + * @param y The vertical acceleration Default x. + */ + setAcceleration(x: number, y?: number): this; + /** + * Sets the body's horizontal acceleration. + * @param value The horizontal acceleration + */ + setAccelerationX(value: number): this; + /** + * Sets the body's vertical acceleration. + * @param value The vertical acceleration + */ + setAccelerationY(value: number): this; + } + + /** + * Provides methods used for setting the angular acceleration properties of an Arcade Physics Body. + */ + interface Angular { + /** + * Sets the angular velocity of the body. + * + * In Arcade Physics, bodies cannot rotate. They are always axis-aligned. + * However, they can have angular motion, which is passed on to the Game Object bound to the body, + * causing them to visually rotate, even though the body remains axis-aligned. + * @param value The amount of angular velocity. + */ + setAngularVelocity(value: number): this; + /** + * Sets the angular acceleration of the body. + * + * In Arcade Physics, bodies cannot rotate. They are always axis-aligned. + * However, they can have angular motion, which is passed on to the Game Object bound to the body, + * causing them to visually rotate, even though the body remains axis-aligned. + * @param value The amount of angular acceleration. + */ + setAngularAcceleration(value: number): this; + /** + * Sets the angular drag of the body. Drag is applied to the current velocity, providing a form of deceleration. + * @param value The amount of drag. + */ + setAngularDrag(value: number): this; + } + + /** + * Provides methods used for setting the bounce properties of an Arcade Physics Body. + */ + interface Bounce { + /** + * Sets the bounce values of this body. + * + * Bounce is the amount of restitution, or elasticity, the body has when it collides with another object. + * A value of 1 means that it will retain its full velocity after the rebound. A value of 0 means it will not rebound at all. + * @param x The amount of horizontal bounce to apply on collision. A float, typically between 0 and 1. + * @param y The amount of vertical bounce to apply on collision. A float, typically between 0 and 1. Default x. + */ + setBounce(x: number, y?: number): this; + /** + * Sets the horizontal bounce value for this body. + * @param value The amount of horizontal bounce to apply on collision. A float, typically between 0 and 1. + */ + setBounceX(value: number): this; + /** + * Sets the vertical bounce value for this body. + * @param value The amount of vertical bounce to apply on collision. A float, typically between 0 and 1. + */ + setBounceY(value: number): this; + /** + * Sets whether this Body collides with the world boundary. + * + * Optionally also sets the World Bounce values. If the `Body.worldBounce` is null, it's set to a new Phaser.Math.Vector2 first. + * @param value `true` if this body should collide with the world bounds, otherwise `false`. Default true. + * @param bounceX If given this will be replace the `worldBounce.x` value. + * @param bounceY If given this will be replace the `worldBounce.y` value. + * @param onWorldBounds If given this replaces the Body's `onWorldBounds` value. + */ + setCollideWorldBounds(value?: boolean, bounceX?: number, bounceY?: number, onWorldBounds?: boolean): this; + } + + /** + * Provides methods used for setting the debug properties of an Arcade Physics Body. + */ + interface Debug { + /** + * Sets the debug values of this body. + * + * Bodies will only draw their debug if debug has been enabled for Arcade Physics as a whole. + * Note that there is a performance cost in drawing debug displays. It should never be used in production. + * @param showBody Set to `true` to have this body render its outline to the debug display. + * @param showVelocity Set to `true` to have this body render a velocity marker to the debug display. + * @param bodyColor The color of the body outline when rendered to the debug display. + */ + setDebug(showBody: boolean, showVelocity: boolean, bodyColor: number): this; + /** + * Sets the color of the body outline when it renders to the debug display. + * @param value The color of the body outline when rendered to the debug display. + */ + setDebugBodyColor(value: number): this; + /** + * Set to `true` to have this body render its outline to the debug display. + */ + debugShowBody: boolean; + /** + * Set to `true` to have this body render a velocity marker to the debug display. + */ + debugShowVelocity: boolean; + /** + * The color of the body outline when it renders to the debug display. + */ + debugBodyColor: number; + } + + /** + * Provides methods used for setting the drag properties of an Arcade Physics Body. + */ + interface Drag { + /** + * Sets the body's horizontal and vertical drag. If the vertical drag value is not provided, the vertical drag is set to the same value as the horizontal drag. + * + * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. + * It is the absolute loss of velocity due to movement, in pixels per second squared. + * The x and y components are applied separately. + * + * When `useDamping` is true, this is 1 minus the damping factor. + * A value of 1 means the Body loses no velocity. + * A value of 0.95 means the Body loses 5% of its velocity per step. + * A value of 0.5 means the Body loses 50% of its velocity per step. + * + * Drag is applied only when `acceleration` is zero. + * @param x The amount of horizontal drag to apply. + * @param y The amount of vertical drag to apply. Default x. + */ + setDrag(x: number, y?: number): this; + /** + * Sets the body's horizontal drag. + * + * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. + * It is the absolute loss of velocity due to movement, in pixels per second squared. + * The x and y components are applied separately. + * + * When `useDamping` is true, this is 1 minus the damping factor. + * A value of 1 means the Body loses no velocity. + * A value of 0.95 means the Body loses 5% of its velocity per step. + * A value of 0.5 means the Body loses 50% of its velocity per step. + * + * Drag is applied only when `acceleration` is zero. + * @param value The amount of horizontal drag to apply. + */ + setDragX(value: number): this; + /** + * Sets the body's vertical drag. + * + * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. + * It is the absolute loss of velocity due to movement, in pixels per second squared. + * The x and y components are applied separately. + * + * When `useDamping` is true, this is 1 minus the damping factor. + * A value of 1 means the Body loses no velocity. + * A value of 0.95 means the Body loses 5% of its velocity per step. + * A value of 0.5 means the Body loses 50% of its velocity per step. + * + * Drag is applied only when `acceleration` is zero. + * @param value The amount of vertical drag to apply. + */ + setDragY(value: number): this; + /** + * If this Body is using `drag` for deceleration this function controls how the drag is applied. + * If set to `true` drag will use a damping effect rather than a linear approach. If you are + * creating a game where the Body moves freely at any angle (i.e. like the way the ship moves in + * the game Asteroids) then you will get a far smoother and more visually correct deceleration + * by using damping, avoiding the axis-drift that is prone with linear deceleration. + * + * If you enable this property then you should use far smaller `drag` values than with linear, as + * they are used as a multiplier on the velocity. Values such as 0.95 will give a nice slow + * deceleration, where-as smaller values, such as 0.5 will stop an object almost immediately. + * @param value `true` to use damping for deceleration, or `false` to use linear deceleration. + */ + setDamping(value: boolean): this; + } + + /** + * Provides methods used for setting the enable properties of an Arcade Physics Body. + */ + interface Enable { + /** + * Enables this Game Object's Body. + * @param reset Also reset the Body and place it at (x, y). + * @param x The horizontal position to place the Game Object and Body. + * @param y The horizontal position to place the Game Object and Body. + * @param enableGameObject Also activate this Game Object. + * @param showGameObject Also show this Game Object. + */ + enableBody(reset: boolean, x: number, y: number, enableGameObject: boolean, showGameObject: boolean): this; + /** + * Stops and disables this Game Object's Body. + * @param disableGameObject Also deactivate this Game Object. Default false. + * @param hideGameObject Also hide this Game Object. Default false. + */ + disableBody(disableGameObject?: boolean, hideGameObject?: boolean): this; + /** + * Syncs the Body's position and size with its parent Game Object. + * You don't need to call this for Dynamic Bodies, as it happens automatically. + * But for Static bodies it's a useful way of modifying the position of a Static Body + * in the Physics World, based on its Game Object. + */ + refreshBody(): this; + } + + /** + * Methods for setting the friction of an Arcade Physics Body. + * + * In Arcade Physics, friction is a special case of motion transfer from an "immovable" body to a riding body. + */ + interface Friction { + /** + * Sets the friction of this game object's physics body. + * In Arcade Physics, friction is a special case of motion transfer from an "immovable" body to a riding body. + * @param x The amount of horizontal friction to apply, [0, 1]. + * @param y The amount of vertical friction to apply, [0, 1]. Default x. + */ + setFriction(x: number, y?: number): this; + /** + * Sets the horizontal friction of this game object's physics body. + * This can move a riding body horizontally when it collides with this one on the vertical axis. + * @param x The amount of friction to apply, [0, 1]. + */ + setFrictionX(x: number): this; + /** + * Sets the vertical friction of this game object's physics body. + * This can move a riding body vertically when it collides with this one on the horizontal axis. + * @param y The amount of friction to apply, [0, 1]. + */ + setFrictionY(y: number): this; + } + + /** + * Provides methods for setting the gravity properties of an Arcade Physics Game Object. + * Should be applied as a mixin and not used directly. + */ + interface Gravity { + /** + * Set the X and Y values of the gravitational pull to act upon this Arcade Physics Game Object. Values can be positive or negative. Larger values result in a stronger effect. + * + * If only one value is provided, this value will be used for both the X and Y axis. + * @param x The gravitational force to be applied to the X-axis. + * @param y The gravitational force to be applied to the Y-axis. If this is not specified, the X value will be used. Default x. + */ + setGravity(x: number, y?: number): this; + /** + * Set the gravitational force to be applied to the X axis. Value can be positive or negative. Larger values result in a stronger effect. + * @param x The gravitational force to be applied to the X-axis. + */ + setGravityX(x: number): this; + /** + * Set the gravitational force to be applied to the Y axis. Value can be positive or negative. Larger values result in a stronger effect. + * @param y The gravitational force to be applied to the Y-axis. + */ + setGravityY(y: number): this; + } + + /** + * Provides methods used for setting the immovable properties of an Arcade Physics Body. + */ + interface Immovable { + /** + * Sets if this Body can be separated during collisions with other bodies. + * + * When a body is immovable it means it won't move at all, not even to separate it from collision + * overlap. If you just wish to prevent a body from being knocked around by other bodies, see + * the `setPushable` method instead. + * @param value Sets if this body will be separated during collisions with other bodies. Default true. + */ + setImmovable(value?: boolean): this; + } + + /** + * Provides methods used for setting the mass properties of an Arcade Physics Body. + */ + interface Mass { + /** + * Sets the mass of the physics body + * @param value New value for the mass of the body. + */ + setMass(value: number): this; + } + + /** + * This method will search the given circular area and return an array of all physics bodies that + * overlap with it. It can return either Dynamic, Static bodies or a mixture of both. + * + * A body only has to intersect with the search area to be considered, it doesn't have to be fully + * contained within it. + * + * If Arcade Physics is set to use the RTree (which it is by default) then the search is rather fast, + * otherwise the search is O(N) for Dynamic Bodies. + */ + interface OverlapCirc { + } + + /** + * This method will search the given rectangular area and return an array of all physics bodies that + * overlap with it. It can return either Dynamic, Static bodies or a mixture of both. + * + * A body only has to intersect with the search area to be considered, it doesn't have to be fully + * contained within it. + * + * If Arcade Physics is set to use the RTree (which it is by default) then the search for is extremely fast, + * otherwise the search is O(N) for Dynamic Bodies. + */ + interface OverlapRect { + } + + /** + * Provides methods used for setting the pushable property of an Arcade Physics Body. + */ + interface Pushable { + /** + * Sets if this Body can be pushed by another Body. + * + * A body that cannot be pushed will reflect back all of the velocity it is given to the + * colliding body. If that body is also not pushable, then the separation will be split + * between them evenly. + * + * If you want your body to never move or seperate at all, see the `setImmovable` method. + * @param value Sets if this body can be pushed by collisions with another Body. Default true. + */ + setPushable(value?: boolean): this; + } + + /** + * Provides methods for setting the size of an Arcade Physics Game Object. + * Should be applied as a mixin and not used directly. + */ + interface Size { + /** + * Sets the body offset. This allows you to adjust the difference between the center of the body + * and the x and y coordinates of the parent Game Object. + * @param x The amount to offset the body from the parent Game Object along the x-axis. + * @param y The amount to offset the body from the parent Game Object along the y-axis. Defaults to the value given for the x-axis. Default x. + */ + setOffset(x: number, y?: number): this; + /** + * **DEPRECATED**: Please use `setBodySize` instead. + * + * Sets the size of this physics body. Setting the size does not adjust the dimensions of the parent Game Object. + * @param width The new width of the physics body, in pixels. + * @param height The new height of the physics body, in pixels. + * @param center Should the body be re-positioned so its center aligns with the parent Game Object? Default true. + */ + setSize(width: number, height: number, center?: boolean): this; + /** + * Sets the size of this physics body. Setting the size does not adjust the dimensions of the parent Game Object. + * @param width The new width of the physics body, in pixels. + * @param height The new height of the physics body, in pixels. + * @param center Should the body be re-positioned so its center aligns with the parent Game Object? Default true. + */ + setBodySize(width: number, height: number, center?: boolean): this; + /** + * Sets this physics body to use a circle for collision instead of a rectangle. + * @param radius The radius of the physics body, in pixels. + * @param offsetX The amount to offset the body from the parent Game Object along the x-axis. + * @param offsetY The amount to offset the body from the parent Game Object along the y-axis. + */ + setCircle(radius: number, offsetX?: number, offsetY?: number): this; + } + + /** + * Provides methods for modifying the velocity of an Arcade Physics body. + * + * Should be applied as a mixin and not used directly. + */ + interface Velocity { + /** + * Sets the velocity of the Body. + * @param x The horizontal velocity of the body. Positive values move the body to the right, while negative values move it to the left. + * @param y The vertical velocity of the body. Positive values move the body down, while negative values move it up. Default x. + */ + setVelocity(x: number, y?: number): this; + /** + * Sets the horizontal component of the body's velocity. + * + * Positive values move the body to the right, while negative values move it to the left. + * @param x The new horizontal velocity. + */ + setVelocityX(x: number): this; + /** + * Sets the vertical component of the body's velocity. + * + * Positive values move the body down, while negative values move it up. + * @param y The new vertical velocity of the body. + */ + setVelocityY(y: number): this; + /** + * Sets the maximum velocity of the body. + * @param x The new maximum horizontal velocity. + * @param y The new maximum vertical velocity. Default x. + */ + setMaxVelocity(x: number, y?: number): this; + } + + } + + /** + * Dynamic Body. + */ + var DYNAMIC_BODY: number; + + /** + * Static Body. + */ + var STATIC_BODY: number; + + /** + * Arcade Physics Group containing Dynamic Bodies. + */ + var GROUP: number; + + /** + * A Tilemap Layer. + */ + var TILEMAPLAYER: number; + + /** + * Facing no direction (initial value). + */ + var FACING_NONE: number; + + /** + * Facing up. + */ + var FACING_UP: number; + + /** + * Facing down. + */ + var FACING_DOWN: number; + + /** + * Facing left. + */ + var FACING_LEFT: number; + + /** + * Facing right. + */ + var FACING_RIGHT: number; + + namespace Events { + /** + * The Arcade Physics World Collide Event. + * + * This event is dispatched by an Arcade Physics World instance if two bodies collide _and_ at least + * one of them has their [onCollide]{@link Phaser.Physics.Arcade.Body#onCollide} property set to `true`. + * + * It provides an alternative means to handling collide events rather than using the callback approach. + * + * Listen to it from a Scene using: `this.physics.world.on('collide', listener)`. + * + * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. + */ + const COLLIDE: any; + + /** + * The Arcade Physics World Overlap Event. + * + * This event is dispatched by an Arcade Physics World instance if two bodies overlap _and_ at least + * one of them has their [onOverlap]{@link Phaser.Physics.Arcade.Body#onOverlap} property set to `true`. + * + * It provides an alternative means to handling overlap events rather than using the callback approach. + * + * Listen to it from a Scene using: `this.physics.world.on('overlap', listener)`. + * + * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. + */ + const OVERLAP: any; + + /** + * The Arcade Physics World Pause Event. + * + * This event is dispatched by an Arcade Physics World instance when it is paused. + * + * Listen to it from a Scene using: `this.physics.world.on('pause', listener)`. + */ + const PAUSE: any; + + /** + * The Arcade Physics World Resume Event. + * + * This event is dispatched by an Arcade Physics World instance when it resumes from a paused state. + * + * Listen to it from a Scene using: `this.physics.world.on('resume', listener)`. + */ + const RESUME: any; + + /** + * The Arcade Physics Tile Collide Event. + * + * This event is dispatched by an Arcade Physics World instance if a body collides with a Tile _and_ + * has its [onCollide]{@link Phaser.Physics.Arcade.Body#onCollide} property set to `true`. + * + * It provides an alternative means to handling collide events rather than using the callback approach. + * + * Listen to it from a Scene using: `this.physics.world.on('tilecollide', listener)`. + * + * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. + */ + const TILE_COLLIDE: any; + + /** + * The Arcade Physics Tile Overlap Event. + * + * This event is dispatched by an Arcade Physics World instance if a body overlaps with a Tile _and_ + * has its [onOverlap]{@link Phaser.Physics.Arcade.Body#onOverlap} property set to `true`. + * + * It provides an alternative means to handling overlap events rather than using the callback approach. + * + * Listen to it from a Scene using: `this.physics.world.on('tileoverlap', listener)`. + * + * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. + */ + const TILE_OVERLAP: any; + + /** + * The Arcade Physics World Bounds Event. + * + * This event is dispatched by an Arcade Physics World instance if a body makes contact with the world bounds _and_ + * it has its [onWorldBounds]{@link Phaser.Physics.Arcade.Body#onWorldBounds} property set to `true`. + * + * It provides an alternative means to handling collide events rather than using the callback approach. + * + * Listen to it from a Scene using: `this.physics.world.on('worldbounds', listener)`. + */ + const WORLD_BOUNDS: any; + + /** + * The Arcade Physics World Step Event. + * + * This event is dispatched by an Arcade Physics World instance whenever a physics step is run. + * It is emitted _after_ the bodies and colliders have been updated. + * + * In high framerate settings this can be multiple times per game frame. + * + * Listen to it from a Scene using: `this.physics.world.on('worldstep', listener)`. + */ + const WORLD_STEP: any; + + } + + namespace Tilemap { + /** + * A function to process the collision callbacks between a single tile and an Arcade Physics enabled Game Object. + * @param tile The Tile to process. + * @param sprite The Game Object to process with the Tile. + */ + function ProcessTileCallbacks(tile: Phaser.Tilemaps.Tile, sprite: Phaser.GameObjects.Sprite): boolean; + + /** + * Internal function to process the separation of a physics body from a tile. + * @param body The Body object to separate. + * @param x The x separation amount. + */ + function ProcessTileSeparationX(body: Phaser.Physics.Arcade.Body, x: number): void; + + /** + * Internal function to process the separation of a physics body from a tile. + * @param body The Body object to separate. + * @param y The y separation amount. + */ + function ProcessTileSeparationY(body: Phaser.Physics.Arcade.Body, y: number): void; + + /** + * The core separation function to separate a physics body and a tile. + * @param i The index of the tile within the map data. + * @param body The Body object to separate. + * @param tile The tile to collide against. + * @param tileWorldRect A rectangle-like object defining the dimensions of the tile. + * @param tilemapLayer The tilemapLayer to collide against. + * @param tileBias The tile bias value. Populated by the `World.TILE_BIAS` constant. + * @param isLayer Is this check coming from a TilemapLayer or an array of tiles? + */ + function SeparateTile(i: number, body: Phaser.Physics.Arcade.Body, tile: Phaser.Tilemaps.Tile, tileWorldRect: Phaser.Geom.Rectangle, tilemapLayer: Phaser.Tilemaps.TilemapLayer, tileBias: number, isLayer: boolean): boolean; + + /** + * Check the body against the given tile on the X axis. + * Used internally by the SeparateTile function. + * @param body The Body object to separate. + * @param tile The tile to check. + * @param tileLeft The left position of the tile within the tile world. + * @param tileRight The right position of the tile within the tile world. + * @param tileBias The tile bias value. Populated by the `World.TILE_BIAS` constant. + * @param isLayer Is this check coming from a TilemapLayer or an array of tiles? + */ + function TileCheckX(body: Phaser.Physics.Arcade.Body, tile: Phaser.Tilemaps.Tile, tileLeft: number, tileRight: number, tileBias: number, isLayer: boolean): number; + + /** + * Check the body against the given tile on the Y axis. + * Used internally by the SeparateTile function. + * @param body The Body object to separate. + * @param tile The tile to check. + * @param tileTop The top position of the tile within the tile world. + * @param tileBottom The bottom position of the tile within the tile world. + * @param tileBias The tile bias value. Populated by the `World.TILE_BIAS` constant. + * @param isLayer Is this check coming from a TilemapLayer or an array of tiles? + */ + function TileCheckY(body: Phaser.Physics.Arcade.Body, tile: Phaser.Tilemaps.Tile, tileTop: number, tileBottom: number, tileBias: number, isLayer: boolean): number; + + /** + * Checks for intersection between the given tile rectangle-like object and an Arcade Physics body. + * @param tileWorldRect A rectangle object that defines the tile placement in the world. + * @param body The body to check for intersection against. + */ + function TileIntersectsBody(tileWorldRect: Object, body: Phaser.Physics.Arcade.Body): boolean; + + } + } namespace Matter { @@ -75437,743 +75437,9 @@ declare namespace Phaser { } - namespace Components { - /** - * A component to set restitution on objects. - */ - interface Bounce { - /** - * Sets the restitution on the physics object. - * @param value A Number that defines the restitution (elasticity) of the body. The value is always positive and is in the range (0, 1). A value of 0 means collisions may be perfectly inelastic and no bouncing may occur. A value of 0.8 means the body may bounce back with approximately 80% of its kinetic energy. Note that collision response is based on pairs of bodies, and that restitution values are combined with the following formula: `Math.max(bodyA.restitution, bodyB.restitution)` - */ - setBounce(value: number): Phaser.GameObjects.GameObject; - } - - /** - * Contains methods for changing the collision filter of a Matter Body. Should be used as a mixin and not called directly. - */ - interface Collision { - /** - * Sets the collision category of this Game Object's Matter Body. This number must be a power of two between 2^0 (= 1) and 2^31. - * Two bodies with different collision groups (see {@link #setCollisionGroup}) will only collide if their collision - * categories are included in their collision masks (see {@link #setCollidesWith}). - * @param value Unique category bitfield. - */ - setCollisionCategory(value: number): Phaser.GameObjects.GameObject; - /** - * Sets the collision group of this Game Object's Matter Body. If this is zero or two Matter Bodies have different values, - * they will collide according to the usual rules (see {@link #setCollisionCategory} and {@link #setCollisionGroup}). - * If two Matter Bodies have the same positive value, they will always collide; if they have the same negative value, - * they will never collide. - * @param value Unique group index. - */ - setCollisionGroup(value: number): Phaser.GameObjects.GameObject; - /** - * Sets the collision mask for this Game Object's Matter Body. Two Matter Bodies with different collision groups will only - * collide if each one includes the other's category in its mask based on a bitwise AND, i.e. `(categoryA & maskB) !== 0` - * and `(categoryB & maskA) !== 0` are both true. - * @param categories A unique category bitfield, or an array of them. - */ - setCollidesWith(categories: number | number[]): Phaser.GameObjects.GameObject; - /** - * The callback is sent a `Phaser.Types.Physics.Matter.MatterCollisionData` object. - * - * This does not change the bodies collision category, group or filter. Those must be set in addition - * to the callback. - * @param callback The callback to invoke when this body starts colliding with another. - */ - setOnCollide(callback: Function): Phaser.GameObjects.GameObject; - /** - * The callback is sent a `Phaser.Types.Physics.Matter.MatterCollisionData` object. - * - * This does not change the bodies collision category, group or filter. Those must be set in addition - * to the callback. - * @param callback The callback to invoke when this body stops colliding with another. - */ - setOnCollideEnd(callback: Function): Phaser.GameObjects.GameObject; - /** - * The callback is sent a `Phaser.Types.Physics.Matter.MatterCollisionData` object. - * - * This does not change the bodies collision category, group or filter. Those must be set in addition - * to the callback. - * @param callback The callback to invoke for the duration of this body colliding with another. - */ - setOnCollideActive(callback: Function): Phaser.GameObjects.GameObject; - /** - * The callback is sent a reference to the other body, along with a `Phaser.Types.Physics.Matter.MatterCollisionData` object. - * - * This does not change the bodies collision category, group or filter. Those must be set in addition - * to the callback. - * @param body The body, or an array of bodies, to test for collisions with. - * @param callback The callback to invoke when this body collides with the given body or bodies. - */ - setOnCollideWith(body: MatterJS.Body | MatterJS.Body[], callback: Function): Phaser.GameObjects.GameObject; - } - - /** - * A component to apply force to Matter.js bodies. - */ - interface Force { - /** - * Applies a force to a body. - * @param force A Vector that specifies the force to apply. - */ - applyForce(force: Phaser.Math.Vector2): Phaser.GameObjects.GameObject; - /** - * Applies a force to a body from a given position. - * @param position The position in which the force comes from. - * @param force A Vector that specifies the force to apply. - */ - applyForceFrom(position: Phaser.Math.Vector2, force: Phaser.Math.Vector2): Phaser.GameObjects.GameObject; - /** - * Apply thrust to the forward position of the body. - * - * Use very small values, such as 0.1, depending on the mass and required speed. - * @param speed A speed value to be applied to a directional force. - */ - thrust(speed: number): Phaser.GameObjects.GameObject; - /** - * Apply thrust to the left position of the body. - * - * Use very small values, such as 0.1, depending on the mass and required speed. - * @param speed A speed value to be applied to a directional force. - */ - thrustLeft(speed: number): Phaser.GameObjects.GameObject; - /** - * Apply thrust to the right position of the body. - * - * Use very small values, such as 0.1, depending on the mass and required speed. - * @param speed A speed value to be applied to a directional force. - */ - thrustRight(speed: number): Phaser.GameObjects.GameObject; - /** - * Apply thrust to the back position of the body. - * - * Use very small values, such as 0.1, depending on the mass and required speed. - * @param speed A speed value to be applied to a directional force. - */ - thrustBack(speed: number): Phaser.GameObjects.GameObject; - } - - /** - * Contains methods for changing the friction of a Game Object's Matter Body. Should be used a mixin, not called directly. - */ - interface Friction { - /** - * Sets new friction values for this Game Object's Matter Body. - * @param value The new friction of the body, between 0 and 1, where 0 allows the Body to slide indefinitely, while 1 allows it to stop almost immediately after a force is applied. - * @param air If provided, the new air resistance of the Body. The higher the value, the faster the Body will slow as it moves through space. 0 means the body has no air resistance. - * @param fstatic If provided, the new static friction of the Body. The higher the value (e.g. 10), the more force it will take to initially get the Body moving when it is nearly stationary. 0 means the body will never "stick" when it is nearly stationary. - */ - setFriction(value: number, air?: number, fstatic?: number): Phaser.GameObjects.GameObject; - /** - * Sets a new air resistance for this Game Object's Matter Body. - * A value of 0 means the Body will never slow as it moves through space. - * The higher the value, the faster a Body slows when moving through space. - * @param value The new air resistance for the Body. - */ - setFrictionAir(value: number): Phaser.GameObjects.GameObject; - /** - * Sets a new static friction for this Game Object's Matter Body. - * A value of 0 means the Body will never "stick" when it is nearly stationary. - * The higher the value (e.g. 10), the more force it will take to initially get the Body moving when it is nearly stationary. - * @param value The new static friction for the Body. - */ - setFrictionStatic(value: number): Phaser.GameObjects.GameObject; - } - - /** - * A component to manipulate world gravity for Matter.js bodies. - */ - interface Gravity { - /** - * A togglable function for ignoring world gravity in real-time on the current body. - * @param value Set to true to ignore the effect of world gravity, or false to not ignore it. - */ - setIgnoreGravity(value: boolean): Phaser.GameObjects.GameObject; - } - - /** - * Allows accessing the mass, density, and center of mass of a Matter-enabled Game Object. Should be used as a mixin and not directly. - */ - interface Mass { - /** - * Sets the mass of the Game Object's Matter Body. - * @param value The new mass of the body. - */ - setMass(value: number): Phaser.GameObjects.GameObject; - /** - * Sets density of the body. - * @param value The new density of the body. - */ - setDensity(value: number): Phaser.GameObjects.GameObject; - /** - * The body's center of mass. - * - * Calling this creates a new `Vector2 each time to avoid mutation. - * - * If you only need to read the value and won't change it, you can get it from `GameObject.body.centerOfMass`. - */ - readonly centerOfMass: Phaser.Math.Vector2; - } - - /** - * Enables a Matter-enabled Game Object to be a sensor. Should be used as a mixin and not directly. - */ - interface Sensor { - /** - * Set the body belonging to this Game Object to be a sensor. - * Sensors trigger collision events, but don't react with colliding body physically. - * @param value `true` to set the body as a sensor, or `false` to disable it. - */ - setSensor(value: boolean): Phaser.GameObjects.GameObject; - /** - * Is the body belonging to this Game Object a sensor or not? - */ - isSensor(): boolean; - } - - /** - * Enables a Matter-enabled Game Object to set its Body. Should be used as a mixin and not directly. - */ - interface SetBody { - /** - * Set the body on a Game Object to a rectangle. - * - * Calling this methods resets previous properties you may have set on the body, including - * plugins, mass, friction, etc. So be sure to re-apply these in the options object if needed. - * @param width Width of the rectangle. - * @param height Height of the rectangle. - * @param options An optional Body configuration object that is used to set initial Body properties on creation. - */ - setRectangle(width: number, height: number, options?: Phaser.Types.Physics.Matter.MatterBodyConfig): Phaser.GameObjects.GameObject; - /** - * Set the body on a Game Object to a circle. - * - * Calling this methods resets previous properties you may have set on the body, including - * plugins, mass, friction, etc. So be sure to re-apply these in the options object if needed. - * @param radius The radius of the circle. - * @param options An optional Body configuration object that is used to set initial Body properties on creation. - */ - setCircle(radius: number, options?: Phaser.Types.Physics.Matter.MatterBodyConfig): Phaser.GameObjects.GameObject; - /** - * Set the body on the Game Object to a polygon shape. - * - * Calling this methods resets previous properties you may have set on the body, including - * plugins, mass, friction, etc. So be sure to re-apply these in the options object if needed. - * @param radius The "radius" of the polygon, i.e. the distance from its center to any vertex. This is also the radius of its circumcircle. - * @param sides The number of sides the polygon will have. - * @param options An optional Body configuration object that is used to set initial Body properties on creation. - */ - setPolygon(radius: number, sides: number, options?: Phaser.Types.Physics.Matter.MatterBodyConfig): Phaser.GameObjects.GameObject; - /** - * Set the body on the Game Object to a trapezoid shape. - * - * Calling this methods resets previous properties you may have set on the body, including - * plugins, mass, friction, etc. So be sure to re-apply these in the options object if needed. - * @param width The width of the trapezoid Body. - * @param height The height of the trapezoid Body. - * @param slope The slope of the trapezoid. 0 creates a rectangle, while 1 creates a triangle. Positive values make the top side shorter, while negative values make the bottom side shorter. - * @param options An optional Body configuration object that is used to set initial Body properties on creation. - */ - setTrapezoid(width: number, height: number, slope: number, options?: Phaser.Types.Physics.Matter.MatterBodyConfig): Phaser.GameObjects.GameObject; - /** - * Set this Game Object to use the given existing Matter Body. - * - * The body is first removed from the world before being added to this Game Object. - * @param body The Body this Game Object should use. - * @param addToWorld Should the body be immediately added to the World? Default true. - */ - setExistingBody(body: MatterJS.BodyType, addToWorld?: boolean): Phaser.GameObjects.GameObject; - /** - * Set this Game Object to create and use a new Body based on the configuration object given. - * - * Calling this method resets previous properties you may have set on the body, including - * plugins, mass, friction, etc. So be sure to re-apply these in the options object if needed. - * @param config Either a string, such as `circle`, or a Matter Set Body Configuration object. - * @param options An optional Body configuration object that is used to set initial Body properties on creation. - */ - setBody(config: string | Phaser.Types.Physics.Matter.MatterSetBodyConfig, options?: Phaser.Types.Physics.Matter.MatterBodyConfig): Phaser.GameObjects.GameObject; - } - - /** - * Enables a Matter-enabled Game Object to be able to go to sleep. Should be used as a mixin and not directly. - */ - interface Sleep { - /** - * Sets this Body to sleep. - */ - setToSleep(): this; - /** - * Wakes this Body if asleep. - */ - setAwake(): this; - /** - * Sets the number of updates in which this body must have near-zero velocity before it is set as sleeping (if sleeping is enabled by the engine). - * @param value A `Number` that defines the number of updates in which this body must have near-zero velocity before it is set as sleeping. Default 60. - */ - setSleepThreshold(value?: number): this; - /** - * Enable sleep and wake events for this body. - * - * By default when a body goes to sleep, or wakes up, it will not emit any events. - * - * The events are emitted by the Matter World instance and can be listened to via - * the `SLEEP_START` and `SLEEP_END` events. - * @param start `true` if you want the sleep start event to be emitted for this body. - * @param end `true` if you want the sleep end event to be emitted for this body. - */ - setSleepEvents(start: boolean, end: boolean): this; - /** - * Enables or disables the Sleep Start event for this body. - * @param value `true` to enable the sleep event, or `false` to disable it. - */ - setSleepStartEvent(value: boolean): this; - /** - * Enables or disables the Sleep End event for this body. - * @param value `true` to enable the sleep event, or `false` to disable it. - */ - setSleepEndEvent(value: boolean): this; - } - - /** - * Provides methods used for getting and setting the static state of a physics body. - */ - interface Static { - /** - * Changes the physics body to be either static `true` or dynamic `false`. - * @param value `true` to set the body as being static, or `false` to make it dynamic. - */ - setStatic(value: boolean): Phaser.GameObjects.GameObject; - /** - * Returns `true` if the body is static, otherwise `false` for a dynamic body. - */ - isStatic(): boolean; - } - - /** - * Provides methods used for getting and setting the position, scale and rotation of a Game Object. - */ - interface Transform { - /** - * The x position of this Game Object. - */ - x: number; - /** - * The y position of this Game Object. - */ - y: number; - /** - * The horizontal scale of this Game Object. - */ - scaleX: number; - /** - * The vertical scale of this Game Object. - */ - scaleY: number; - /** - * Use `angle` to set or get rotation of the physics body associated to this GameObject. - * Unlike rotation, when using set the value can be in degrees, which will be converted to radians internally. - */ - angle: number; - /** - * Use `rotation` to set or get the rotation of the physics body associated with this GameObject. - * The value when set must be in radians. - */ - rotation: number; - /** - * Sets the position of the physics body along x and y axes. - * Both the parameters to this function are optional and if not passed any they default to 0. - * Velocity, angle, force etc. are unchanged. - * @param x The horizontal position of the body. Default 0. - * @param y The vertical position of the body. Default x. - */ - setPosition(x?: number, y?: number): this; - /** - * Immediately sets the angle of the Body. - * Angular velocity, position, force etc. are unchanged. - * @param radians The angle of the body, in radians. Default 0. - */ - setRotation(radians?: number): this; - /** - * Setting fixed rotation sets the Body inertia to Infinity, which stops it - * from being able to rotate when forces are applied to it. - */ - setFixedRotation(): this; - /** - * Immediately sets the angle of the Body. - * Angular velocity, position, force etc. are unchanged. - * @param degrees The angle to set, in degrees. Default 0. - */ - setAngle(degrees?: number): this; - /** - * Sets the scale of this Game Object. - * @param x The horizontal scale of this Game Object. Default 1. - * @param y The vertical scale of this Game Object. If not set it will use the x value. Default x. - * @param point The point (Vector2) from which scaling will occur. - */ - setScale(x?: number, y?: number, point?: Phaser.Math.Vector2): this; - } - - /** - * Contains methods for changing the velocity of a Matter Body. Should be used as a mixin and not called directly. - */ - interface Velocity { - /** - * Sets the angular velocity of the body instantly. - * Position, angle, force etc. are unchanged. - * @param value The angular velocity. - */ - setAngularVelocity(value: number): Phaser.GameObjects.GameObject; - /** - * Sets the horizontal velocity of the physics body. - * @param x The horizontal velocity value. - */ - setVelocityX(x: number): Phaser.GameObjects.GameObject; - /** - * Sets vertical velocity of the physics body. - * @param y The vertical velocity value. - */ - setVelocityY(y: number): Phaser.GameObjects.GameObject; - /** - * Sets both the horizontal and vertical velocity of the physics body. - * @param x The horizontal velocity value. - * @param y The vertical velocity value, it can be either positive or negative. If not given, it will be the same as the `x` value. Default x. - */ - setVelocity(x: number, y?: number): Phaser.GameObjects.GameObject; - } - - } - namespace Matter { } - namespace Events { - type AfterAddEvent = { - /** - * An array of the object(s) that have been added. May be a single body, constraint, composite or a mixture of these. - */ - object: any[]; - /** - * The source object of the event. - */ - source: any; - /** - * The name of the event. - */ - name: string; - }; - - /** - * The Matter Physics After Add Event. - * - * This event is dispatched by a Matter Physics World instance at the end of the process when a new Body - * or Constraint has just been added to the world. - * - * Listen to it from a Scene using: `this.matter.world.on('afteradd', listener)`. - */ - const AFTER_ADD: any; - - type AfterRemoveEvent = { - /** - * An array of the object(s) that were removed. May be a single body, constraint, composite or a mixture of these. - */ - object: any[]; - /** - * The source object of the event. - */ - source: any; - /** - * The name of the event. - */ - name: string; - }; - - /** - * The Matter Physics After Remove Event. - * - * This event is dispatched by a Matter Physics World instance at the end of the process when a - * Body or Constraint was removed from the world. - * - * Listen to it from a Scene using: `this.matter.world.on('afterremove', listener)`. - */ - const AFTER_REMOVE: any; - - type AfterUpdateEvent = { - /** - * The Matter Engine `timing.timestamp` value for the event. - */ - timestamp: number; - /** - * The source object of the event. - */ - source: any; - /** - * The name of the event. - */ - name: string; - }; - - /** - * The Matter Physics After Update Event. - * - * This event is dispatched by a Matter Physics World instance after the engine has updated and all collision events have resolved. - * - * Listen to it from a Scene using: `this.matter.world.on('afterupdate', listener)`. - */ - const AFTER_UPDATE: any; - - type BeforeAddEvent = { - /** - * An array of the object(s) to be added. May be a single body, constraint, composite or a mixture of these. - */ - object: any[]; - /** - * The source object of the event. - */ - source: any; - /** - * The name of the event. - */ - name: string; - }; - - /** - * The Matter Physics Before Add Event. - * - * This event is dispatched by a Matter Physics World instance at the start of the process when a new Body - * or Constraint is being added to the world. - * - * Listen to it from a Scene using: `this.matter.world.on('beforeadd', listener)`. - */ - const BEFORE_ADD: any; - - type BeforeRemoveEvent = { - /** - * An array of the object(s) to be removed. May be a single body, constraint, composite or a mixture of these. - */ - object: any[]; - /** - * The source object of the event. - */ - source: any; - /** - * The name of the event. - */ - name: string; - }; - - /** - * The Matter Physics Before Remove Event. - * - * This event is dispatched by a Matter Physics World instance at the start of the process when a - * Body or Constraint is being removed from the world. - * - * Listen to it from a Scene using: `this.matter.world.on('beforeremove', listener)`. - */ - const BEFORE_REMOVE: any; - - type BeforeUpdateEvent = { - /** - * The Matter Engine `timing.timestamp` value for the event. - */ - timestamp: number; - /** - * The source object of the event. - */ - source: any; - /** - * The name of the event. - */ - name: string; - }; - - /** - * The Matter Physics Before Update Event. - * - * This event is dispatched by a Matter Physics World instance right before all the collision processing takes place. - * - * Listen to it from a Scene using: `this.matter.world.on('beforeupdate', listener)`. - */ - const BEFORE_UPDATE: any; - - type CollisionActiveEvent = { - /** - * A list of all affected pairs in the collision. - */ - pairs: Phaser.Types.Physics.Matter.MatterCollisionData[]; - /** - * The Matter Engine `timing.timestamp` value for the event. - */ - timestamp: number; - /** - * The source object of the event. - */ - source: any; - /** - * The name of the event. - */ - name: string; - }; - - /** - * The Matter Physics Collision Active Event. - * - * This event is dispatched by a Matter Physics World instance after the engine has updated. - * It provides a list of all pairs that are colliding in the current tick (if any). - * - * Listen to it from a Scene using: `this.matter.world.on('collisionactive', listener)`. - */ - const COLLISION_ACTIVE: any; - - type CollisionEndEvent = { - /** - * A list of all affected pairs in the collision. - */ - pairs: Phaser.Types.Physics.Matter.MatterCollisionData[]; - /** - * The Matter Engine `timing.timestamp` value for the event. - */ - timestamp: number; - /** - * The source object of the event. - */ - source: any; - /** - * The name of the event. - */ - name: string; - }; - - /** - * The Matter Physics Collision End Event. - * - * This event is dispatched by a Matter Physics World instance after the engine has updated. - * It provides a list of all pairs that have finished colliding in the current tick (if any). - * - * Listen to it from a Scene using: `this.matter.world.on('collisionend', listener)`. - */ - const COLLISION_END: any; - - type CollisionStartEvent = { - /** - * A list of all affected pairs in the collision. - */ - pairs: Phaser.Types.Physics.Matter.MatterCollisionData[]; - /** - * The Matter Engine `timing.timestamp` value for the event. - */ - timestamp: number; - /** - * The source object of the event. - */ - source: any; - /** - * The name of the event. - */ - name: string; - }; - - /** - * The Matter Physics Collision Start Event. - * - * This event is dispatched by a Matter Physics World instance after the engine has updated. - * It provides a list of all pairs that have started to collide in the current tick (if any). - * - * Listen to it from a Scene using: `this.matter.world.on('collisionstart', listener)`. - */ - const COLLISION_START: any; - - /** - * The Matter Physics Drag End Event. - * - * This event is dispatched by a Matter Physics World instance when a Pointer Constraint - * stops dragging a body. - * - * Listen to it from a Scene using: `this.matter.world.on('dragend', listener)`. - */ - const DRAG_END: any; - - /** - * The Matter Physics Drag Event. - * - * This event is dispatched by a Matter Physics World instance when a Pointer Constraint - * is actively dragging a body. It is emitted each time the pointer moves. - * - * Listen to it from a Scene using: `this.matter.world.on('drag', listener)`. - */ - const DRAG: any; - - /** - * The Matter Physics Drag Start Event. - * - * This event is dispatched by a Matter Physics World instance when a Pointer Constraint - * starts dragging a body. - * - * Listen to it from a Scene using: `this.matter.world.on('dragstart', listener)`. - */ - const DRAG_START: any; - - /** - * The Matter Physics World Pause Event. - * - * This event is dispatched by an Matter Physics World instance when it is paused. - * - * Listen to it from a Scene using: `this.matter.world.on('pause', listener)`. - */ - const PAUSE: any; - - /** - * The Matter Physics World Resume Event. - * - * This event is dispatched by an Matter Physics World instance when it resumes from a paused state. - * - * Listen to it from a Scene using: `this.matter.world.on('resume', listener)`. - */ - const RESUME: any; - - type SleepEndEvent = { - /** - * The source object of the event. - */ - source: any; - /** - * The name of the event. - */ - name: string; - }; - - /** - * The Matter Physics Sleep End Event. - * - * This event is dispatched by a Matter Physics World instance when a Body stop sleeping. - * - * Listen to it from a Scene using: `this.matter.world.on('sleepend', listener)`. - */ - const SLEEP_END: any; - - type SleepStartEvent = { - /** - * The source object of the event. - */ - source: any; - /** - * The name of the event. - */ - name: string; - }; - - /** - * The Matter Physics Sleep Start Event. - * - * This event is dispatched by a Matter Physics World instance when a Body goes to sleep. - * - * Listen to it from a Scene using: `this.matter.world.on('sleepstart', listener)`. - */ - const SLEEP_START: any; - - } - /** * The Matter Factory is responsible for quickly creating a variety of different types of * bodies, constraints and Game Objects and adding them into the physics world. @@ -81043,6 +80309,740 @@ declare namespace Phaser { } + namespace Components { + /** + * A component to set restitution on objects. + */ + interface Bounce { + /** + * Sets the restitution on the physics object. + * @param value A Number that defines the restitution (elasticity) of the body. The value is always positive and is in the range (0, 1). A value of 0 means collisions may be perfectly inelastic and no bouncing may occur. A value of 0.8 means the body may bounce back with approximately 80% of its kinetic energy. Note that collision response is based on pairs of bodies, and that restitution values are combined with the following formula: `Math.max(bodyA.restitution, bodyB.restitution)` + */ + setBounce(value: number): Phaser.GameObjects.GameObject; + } + + /** + * Contains methods for changing the collision filter of a Matter Body. Should be used as a mixin and not called directly. + */ + interface Collision { + /** + * Sets the collision category of this Game Object's Matter Body. This number must be a power of two between 2^0 (= 1) and 2^31. + * Two bodies with different collision groups (see {@link #setCollisionGroup}) will only collide if their collision + * categories are included in their collision masks (see {@link #setCollidesWith}). + * @param value Unique category bitfield. + */ + setCollisionCategory(value: number): Phaser.GameObjects.GameObject; + /** + * Sets the collision group of this Game Object's Matter Body. If this is zero or two Matter Bodies have different values, + * they will collide according to the usual rules (see {@link #setCollisionCategory} and {@link #setCollisionGroup}). + * If two Matter Bodies have the same positive value, they will always collide; if they have the same negative value, + * they will never collide. + * @param value Unique group index. + */ + setCollisionGroup(value: number): Phaser.GameObjects.GameObject; + /** + * Sets the collision mask for this Game Object's Matter Body. Two Matter Bodies with different collision groups will only + * collide if each one includes the other's category in its mask based on a bitwise AND, i.e. `(categoryA & maskB) !== 0` + * and `(categoryB & maskA) !== 0` are both true. + * @param categories A unique category bitfield, or an array of them. + */ + setCollidesWith(categories: number | number[]): Phaser.GameObjects.GameObject; + /** + * The callback is sent a `Phaser.Types.Physics.Matter.MatterCollisionData` object. + * + * This does not change the bodies collision category, group or filter. Those must be set in addition + * to the callback. + * @param callback The callback to invoke when this body starts colliding with another. + */ + setOnCollide(callback: Function): Phaser.GameObjects.GameObject; + /** + * The callback is sent a `Phaser.Types.Physics.Matter.MatterCollisionData` object. + * + * This does not change the bodies collision category, group or filter. Those must be set in addition + * to the callback. + * @param callback The callback to invoke when this body stops colliding with another. + */ + setOnCollideEnd(callback: Function): Phaser.GameObjects.GameObject; + /** + * The callback is sent a `Phaser.Types.Physics.Matter.MatterCollisionData` object. + * + * This does not change the bodies collision category, group or filter. Those must be set in addition + * to the callback. + * @param callback The callback to invoke for the duration of this body colliding with another. + */ + setOnCollideActive(callback: Function): Phaser.GameObjects.GameObject; + /** + * The callback is sent a reference to the other body, along with a `Phaser.Types.Physics.Matter.MatterCollisionData` object. + * + * This does not change the bodies collision category, group or filter. Those must be set in addition + * to the callback. + * @param body The body, or an array of bodies, to test for collisions with. + * @param callback The callback to invoke when this body collides with the given body or bodies. + */ + setOnCollideWith(body: MatterJS.Body | MatterJS.Body[], callback: Function): Phaser.GameObjects.GameObject; + } + + /** + * A component to apply force to Matter.js bodies. + */ + interface Force { + /** + * Applies a force to a body. + * @param force A Vector that specifies the force to apply. + */ + applyForce(force: Phaser.Math.Vector2): Phaser.GameObjects.GameObject; + /** + * Applies a force to a body from a given position. + * @param position The position in which the force comes from. + * @param force A Vector that specifies the force to apply. + */ + applyForceFrom(position: Phaser.Math.Vector2, force: Phaser.Math.Vector2): Phaser.GameObjects.GameObject; + /** + * Apply thrust to the forward position of the body. + * + * Use very small values, such as 0.1, depending on the mass and required speed. + * @param speed A speed value to be applied to a directional force. + */ + thrust(speed: number): Phaser.GameObjects.GameObject; + /** + * Apply thrust to the left position of the body. + * + * Use very small values, such as 0.1, depending on the mass and required speed. + * @param speed A speed value to be applied to a directional force. + */ + thrustLeft(speed: number): Phaser.GameObjects.GameObject; + /** + * Apply thrust to the right position of the body. + * + * Use very small values, such as 0.1, depending on the mass and required speed. + * @param speed A speed value to be applied to a directional force. + */ + thrustRight(speed: number): Phaser.GameObjects.GameObject; + /** + * Apply thrust to the back position of the body. + * + * Use very small values, such as 0.1, depending on the mass and required speed. + * @param speed A speed value to be applied to a directional force. + */ + thrustBack(speed: number): Phaser.GameObjects.GameObject; + } + + /** + * Contains methods for changing the friction of a Game Object's Matter Body. Should be used a mixin, not called directly. + */ + interface Friction { + /** + * Sets new friction values for this Game Object's Matter Body. + * @param value The new friction of the body, between 0 and 1, where 0 allows the Body to slide indefinitely, while 1 allows it to stop almost immediately after a force is applied. + * @param air If provided, the new air resistance of the Body. The higher the value, the faster the Body will slow as it moves through space. 0 means the body has no air resistance. + * @param fstatic If provided, the new static friction of the Body. The higher the value (e.g. 10), the more force it will take to initially get the Body moving when it is nearly stationary. 0 means the body will never "stick" when it is nearly stationary. + */ + setFriction(value: number, air?: number, fstatic?: number): Phaser.GameObjects.GameObject; + /** + * Sets a new air resistance for this Game Object's Matter Body. + * A value of 0 means the Body will never slow as it moves through space. + * The higher the value, the faster a Body slows when moving through space. + * @param value The new air resistance for the Body. + */ + setFrictionAir(value: number): Phaser.GameObjects.GameObject; + /** + * Sets a new static friction for this Game Object's Matter Body. + * A value of 0 means the Body will never "stick" when it is nearly stationary. + * The higher the value (e.g. 10), the more force it will take to initially get the Body moving when it is nearly stationary. + * @param value The new static friction for the Body. + */ + setFrictionStatic(value: number): Phaser.GameObjects.GameObject; + } + + /** + * A component to manipulate world gravity for Matter.js bodies. + */ + interface Gravity { + /** + * A togglable function for ignoring world gravity in real-time on the current body. + * @param value Set to true to ignore the effect of world gravity, or false to not ignore it. + */ + setIgnoreGravity(value: boolean): Phaser.GameObjects.GameObject; + } + + /** + * Allows accessing the mass, density, and center of mass of a Matter-enabled Game Object. Should be used as a mixin and not directly. + */ + interface Mass { + /** + * Sets the mass of the Game Object's Matter Body. + * @param value The new mass of the body. + */ + setMass(value: number): Phaser.GameObjects.GameObject; + /** + * Sets density of the body. + * @param value The new density of the body. + */ + setDensity(value: number): Phaser.GameObjects.GameObject; + /** + * The body's center of mass. + * + * Calling this creates a new `Vector2 each time to avoid mutation. + * + * If you only need to read the value and won't change it, you can get it from `GameObject.body.centerOfMass`. + */ + readonly centerOfMass: Phaser.Math.Vector2; + } + + /** + * Enables a Matter-enabled Game Object to be a sensor. Should be used as a mixin and not directly. + */ + interface Sensor { + /** + * Set the body belonging to this Game Object to be a sensor. + * Sensors trigger collision events, but don't react with colliding body physically. + * @param value `true` to set the body as a sensor, or `false` to disable it. + */ + setSensor(value: boolean): Phaser.GameObjects.GameObject; + /** + * Is the body belonging to this Game Object a sensor or not? + */ + isSensor(): boolean; + } + + /** + * Enables a Matter-enabled Game Object to set its Body. Should be used as a mixin and not directly. + */ + interface SetBody { + /** + * Set the body on a Game Object to a rectangle. + * + * Calling this methods resets previous properties you may have set on the body, including + * plugins, mass, friction, etc. So be sure to re-apply these in the options object if needed. + * @param width Width of the rectangle. + * @param height Height of the rectangle. + * @param options An optional Body configuration object that is used to set initial Body properties on creation. + */ + setRectangle(width: number, height: number, options?: Phaser.Types.Physics.Matter.MatterBodyConfig): Phaser.GameObjects.GameObject; + /** + * Set the body on a Game Object to a circle. + * + * Calling this methods resets previous properties you may have set on the body, including + * plugins, mass, friction, etc. So be sure to re-apply these in the options object if needed. + * @param radius The radius of the circle. + * @param options An optional Body configuration object that is used to set initial Body properties on creation. + */ + setCircle(radius: number, options?: Phaser.Types.Physics.Matter.MatterBodyConfig): Phaser.GameObjects.GameObject; + /** + * Set the body on the Game Object to a polygon shape. + * + * Calling this methods resets previous properties you may have set on the body, including + * plugins, mass, friction, etc. So be sure to re-apply these in the options object if needed. + * @param radius The "radius" of the polygon, i.e. the distance from its center to any vertex. This is also the radius of its circumcircle. + * @param sides The number of sides the polygon will have. + * @param options An optional Body configuration object that is used to set initial Body properties on creation. + */ + setPolygon(radius: number, sides: number, options?: Phaser.Types.Physics.Matter.MatterBodyConfig): Phaser.GameObjects.GameObject; + /** + * Set the body on the Game Object to a trapezoid shape. + * + * Calling this methods resets previous properties you may have set on the body, including + * plugins, mass, friction, etc. So be sure to re-apply these in the options object if needed. + * @param width The width of the trapezoid Body. + * @param height The height of the trapezoid Body. + * @param slope The slope of the trapezoid. 0 creates a rectangle, while 1 creates a triangle. Positive values make the top side shorter, while negative values make the bottom side shorter. + * @param options An optional Body configuration object that is used to set initial Body properties on creation. + */ + setTrapezoid(width: number, height: number, slope: number, options?: Phaser.Types.Physics.Matter.MatterBodyConfig): Phaser.GameObjects.GameObject; + /** + * Set this Game Object to use the given existing Matter Body. + * + * The body is first removed from the world before being added to this Game Object. + * @param body The Body this Game Object should use. + * @param addToWorld Should the body be immediately added to the World? Default true. + */ + setExistingBody(body: MatterJS.BodyType, addToWorld?: boolean): Phaser.GameObjects.GameObject; + /** + * Set this Game Object to create and use a new Body based on the configuration object given. + * + * Calling this method resets previous properties you may have set on the body, including + * plugins, mass, friction, etc. So be sure to re-apply these in the options object if needed. + * @param config Either a string, such as `circle`, or a Matter Set Body Configuration object. + * @param options An optional Body configuration object that is used to set initial Body properties on creation. + */ + setBody(config: string | Phaser.Types.Physics.Matter.MatterSetBodyConfig, options?: Phaser.Types.Physics.Matter.MatterBodyConfig): Phaser.GameObjects.GameObject; + } + + /** + * Enables a Matter-enabled Game Object to be able to go to sleep. Should be used as a mixin and not directly. + */ + interface Sleep { + /** + * Sets this Body to sleep. + */ + setToSleep(): this; + /** + * Wakes this Body if asleep. + */ + setAwake(): this; + /** + * Sets the number of updates in which this body must have near-zero velocity before it is set as sleeping (if sleeping is enabled by the engine). + * @param value A `Number` that defines the number of updates in which this body must have near-zero velocity before it is set as sleeping. Default 60. + */ + setSleepThreshold(value?: number): this; + /** + * Enable sleep and wake events for this body. + * + * By default when a body goes to sleep, or wakes up, it will not emit any events. + * + * The events are emitted by the Matter World instance and can be listened to via + * the `SLEEP_START` and `SLEEP_END` events. + * @param start `true` if you want the sleep start event to be emitted for this body. + * @param end `true` if you want the sleep end event to be emitted for this body. + */ + setSleepEvents(start: boolean, end: boolean): this; + /** + * Enables or disables the Sleep Start event for this body. + * @param value `true` to enable the sleep event, or `false` to disable it. + */ + setSleepStartEvent(value: boolean): this; + /** + * Enables or disables the Sleep End event for this body. + * @param value `true` to enable the sleep event, or `false` to disable it. + */ + setSleepEndEvent(value: boolean): this; + } + + /** + * Provides methods used for getting and setting the static state of a physics body. + */ + interface Static { + /** + * Changes the physics body to be either static `true` or dynamic `false`. + * @param value `true` to set the body as being static, or `false` to make it dynamic. + */ + setStatic(value: boolean): Phaser.GameObjects.GameObject; + /** + * Returns `true` if the body is static, otherwise `false` for a dynamic body. + */ + isStatic(): boolean; + } + + /** + * Provides methods used for getting and setting the position, scale and rotation of a Game Object. + */ + interface Transform { + /** + * The x position of this Game Object. + */ + x: number; + /** + * The y position of this Game Object. + */ + y: number; + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + /** + * Use `angle` to set or get rotation of the physics body associated to this GameObject. + * Unlike rotation, when using set the value can be in degrees, which will be converted to radians internally. + */ + angle: number; + /** + * Use `rotation` to set or get the rotation of the physics body associated with this GameObject. + * The value when set must be in radians. + */ + rotation: number; + /** + * Sets the position of the physics body along x and y axes. + * Both the parameters to this function are optional and if not passed any they default to 0. + * Velocity, angle, force etc. are unchanged. + * @param x The horizontal position of the body. Default 0. + * @param y The vertical position of the body. Default x. + */ + setPosition(x?: number, y?: number): this; + /** + * Immediately sets the angle of the Body. + * Angular velocity, position, force etc. are unchanged. + * @param radians The angle of the body, in radians. Default 0. + */ + setRotation(radians?: number): this; + /** + * Setting fixed rotation sets the Body inertia to Infinity, which stops it + * from being able to rotate when forces are applied to it. + */ + setFixedRotation(): this; + /** + * Immediately sets the angle of the Body. + * Angular velocity, position, force etc. are unchanged. + * @param degrees The angle to set, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. Default 1. + * @param y The vertical scale of this Game Object. If not set it will use the x value. Default x. + * @param point The point (Vector2) from which scaling will occur. + */ + setScale(x?: number, y?: number, point?: Phaser.Math.Vector2): this; + } + + /** + * Contains methods for changing the velocity of a Matter Body. Should be used as a mixin and not called directly. + */ + interface Velocity { + /** + * Sets the angular velocity of the body instantly. + * Position, angle, force etc. are unchanged. + * @param value The angular velocity. + */ + setAngularVelocity(value: number): Phaser.GameObjects.GameObject; + /** + * Sets the horizontal velocity of the physics body. + * @param x The horizontal velocity value. + */ + setVelocityX(x: number): Phaser.GameObjects.GameObject; + /** + * Sets vertical velocity of the physics body. + * @param y The vertical velocity value. + */ + setVelocityY(y: number): Phaser.GameObjects.GameObject; + /** + * Sets both the horizontal and vertical velocity of the physics body. + * @param x The horizontal velocity value. + * @param y The vertical velocity value, it can be either positive or negative. If not given, it will be the same as the `x` value. Default x. + */ + setVelocity(x: number, y?: number): Phaser.GameObjects.GameObject; + } + + } + + namespace Events { + type AfterAddEvent = { + /** + * An array of the object(s) that have been added. May be a single body, constraint, composite or a mixture of these. + */ + object: any[]; + /** + * The source object of the event. + */ + source: any; + /** + * The name of the event. + */ + name: string; + }; + + /** + * The Matter Physics After Add Event. + * + * This event is dispatched by a Matter Physics World instance at the end of the process when a new Body + * or Constraint has just been added to the world. + * + * Listen to it from a Scene using: `this.matter.world.on('afteradd', listener)`. + */ + const AFTER_ADD: any; + + type AfterRemoveEvent = { + /** + * An array of the object(s) that were removed. May be a single body, constraint, composite or a mixture of these. + */ + object: any[]; + /** + * The source object of the event. + */ + source: any; + /** + * The name of the event. + */ + name: string; + }; + + /** + * The Matter Physics After Remove Event. + * + * This event is dispatched by a Matter Physics World instance at the end of the process when a + * Body or Constraint was removed from the world. + * + * Listen to it from a Scene using: `this.matter.world.on('afterremove', listener)`. + */ + const AFTER_REMOVE: any; + + type AfterUpdateEvent = { + /** + * The Matter Engine `timing.timestamp` value for the event. + */ + timestamp: number; + /** + * The source object of the event. + */ + source: any; + /** + * The name of the event. + */ + name: string; + }; + + /** + * The Matter Physics After Update Event. + * + * This event is dispatched by a Matter Physics World instance after the engine has updated and all collision events have resolved. + * + * Listen to it from a Scene using: `this.matter.world.on('afterupdate', listener)`. + */ + const AFTER_UPDATE: any; + + type BeforeAddEvent = { + /** + * An array of the object(s) to be added. May be a single body, constraint, composite or a mixture of these. + */ + object: any[]; + /** + * The source object of the event. + */ + source: any; + /** + * The name of the event. + */ + name: string; + }; + + /** + * The Matter Physics Before Add Event. + * + * This event is dispatched by a Matter Physics World instance at the start of the process when a new Body + * or Constraint is being added to the world. + * + * Listen to it from a Scene using: `this.matter.world.on('beforeadd', listener)`. + */ + const BEFORE_ADD: any; + + type BeforeRemoveEvent = { + /** + * An array of the object(s) to be removed. May be a single body, constraint, composite or a mixture of these. + */ + object: any[]; + /** + * The source object of the event. + */ + source: any; + /** + * The name of the event. + */ + name: string; + }; + + /** + * The Matter Physics Before Remove Event. + * + * This event is dispatched by a Matter Physics World instance at the start of the process when a + * Body or Constraint is being removed from the world. + * + * Listen to it from a Scene using: `this.matter.world.on('beforeremove', listener)`. + */ + const BEFORE_REMOVE: any; + + type BeforeUpdateEvent = { + /** + * The Matter Engine `timing.timestamp` value for the event. + */ + timestamp: number; + /** + * The source object of the event. + */ + source: any; + /** + * The name of the event. + */ + name: string; + }; + + /** + * The Matter Physics Before Update Event. + * + * This event is dispatched by a Matter Physics World instance right before all the collision processing takes place. + * + * Listen to it from a Scene using: `this.matter.world.on('beforeupdate', listener)`. + */ + const BEFORE_UPDATE: any; + + type CollisionActiveEvent = { + /** + * A list of all affected pairs in the collision. + */ + pairs: Phaser.Types.Physics.Matter.MatterCollisionData[]; + /** + * The Matter Engine `timing.timestamp` value for the event. + */ + timestamp: number; + /** + * The source object of the event. + */ + source: any; + /** + * The name of the event. + */ + name: string; + }; + + /** + * The Matter Physics Collision Active Event. + * + * This event is dispatched by a Matter Physics World instance after the engine has updated. + * It provides a list of all pairs that are colliding in the current tick (if any). + * + * Listen to it from a Scene using: `this.matter.world.on('collisionactive', listener)`. + */ + const COLLISION_ACTIVE: any; + + type CollisionEndEvent = { + /** + * A list of all affected pairs in the collision. + */ + pairs: Phaser.Types.Physics.Matter.MatterCollisionData[]; + /** + * The Matter Engine `timing.timestamp` value for the event. + */ + timestamp: number; + /** + * The source object of the event. + */ + source: any; + /** + * The name of the event. + */ + name: string; + }; + + /** + * The Matter Physics Collision End Event. + * + * This event is dispatched by a Matter Physics World instance after the engine has updated. + * It provides a list of all pairs that have finished colliding in the current tick (if any). + * + * Listen to it from a Scene using: `this.matter.world.on('collisionend', listener)`. + */ + const COLLISION_END: any; + + type CollisionStartEvent = { + /** + * A list of all affected pairs in the collision. + */ + pairs: Phaser.Types.Physics.Matter.MatterCollisionData[]; + /** + * The Matter Engine `timing.timestamp` value for the event. + */ + timestamp: number; + /** + * The source object of the event. + */ + source: any; + /** + * The name of the event. + */ + name: string; + }; + + /** + * The Matter Physics Collision Start Event. + * + * This event is dispatched by a Matter Physics World instance after the engine has updated. + * It provides a list of all pairs that have started to collide in the current tick (if any). + * + * Listen to it from a Scene using: `this.matter.world.on('collisionstart', listener)`. + */ + const COLLISION_START: any; + + /** + * The Matter Physics Drag End Event. + * + * This event is dispatched by a Matter Physics World instance when a Pointer Constraint + * stops dragging a body. + * + * Listen to it from a Scene using: `this.matter.world.on('dragend', listener)`. + */ + const DRAG_END: any; + + /** + * The Matter Physics Drag Event. + * + * This event is dispatched by a Matter Physics World instance when a Pointer Constraint + * is actively dragging a body. It is emitted each time the pointer moves. + * + * Listen to it from a Scene using: `this.matter.world.on('drag', listener)`. + */ + const DRAG: any; + + /** + * The Matter Physics Drag Start Event. + * + * This event is dispatched by a Matter Physics World instance when a Pointer Constraint + * starts dragging a body. + * + * Listen to it from a Scene using: `this.matter.world.on('dragstart', listener)`. + */ + const DRAG_START: any; + + /** + * The Matter Physics World Pause Event. + * + * This event is dispatched by an Matter Physics World instance when it is paused. + * + * Listen to it from a Scene using: `this.matter.world.on('pause', listener)`. + */ + const PAUSE: any; + + /** + * The Matter Physics World Resume Event. + * + * This event is dispatched by an Matter Physics World instance when it resumes from a paused state. + * + * Listen to it from a Scene using: `this.matter.world.on('resume', listener)`. + */ + const RESUME: any; + + type SleepEndEvent = { + /** + * The source object of the event. + */ + source: any; + /** + * The name of the event. + */ + name: string; + }; + + /** + * The Matter Physics Sleep End Event. + * + * This event is dispatched by a Matter Physics World instance when a Body stop sleeping. + * + * Listen to it from a Scene using: `this.matter.world.on('sleepend', listener)`. + */ + const SLEEP_END: any; + + type SleepStartEvent = { + /** + * The source object of the event. + */ + source: any; + /** + * The name of the event. + */ + name: string; + }; + + /** + * The Matter Physics Sleep Start Event. + * + * This event is dispatched by a Matter Physics World instance when a Body goes to sleep. + * + * Listen to it from a Scene using: `this.matter.world.on('sleepstart', listener)`. + */ + const SLEEP_START: any; + + } + } } @@ -81745,6 +81745,24 @@ declare namespace Phaser { XOR, } + /** + * Phaser Scale Modes. + */ + enum ScaleModes { + /** + * Default Scale Mode (Linear). + */ + DEFAULT, + /** + * Linear Scale Mode. + */ + LINEAR, + /** + * Nearest Scale Mode. + */ + NEAREST, + } + namespace Renderer { namespace Canvas { /** @@ -82078,41 +82096,6 @@ declare namespace Phaser { } namespace WebGL { - /** - * 8-bit twos complement signed integer. - */ - var BYTE: Phaser.Types.Renderer.WebGL.WebGLConst; - - /** - * 8-bit twos complement unsigned integer. - */ - var UNSIGNED_BYTE: Phaser.Types.Renderer.WebGL.WebGLConst; - - /** - * 16-bit twos complement signed integer. - */ - var SHORT: Phaser.Types.Renderer.WebGL.WebGLConst; - - /** - * 16-bit twos complement unsigned integer. - */ - var UNSIGNED_SHORT: Phaser.Types.Renderer.WebGL.WebGLConst; - - /** - * 32-bit twos complement signed integer. - */ - var INT: Phaser.Types.Renderer.WebGL.WebGLConst; - - /** - * 32-bit twos complement unsigned integer. - */ - var UNSIGNED_INT: Phaser.Types.Renderer.WebGL.WebGLConst; - - /** - * 32-bit IEEE floating point number. - */ - var FLOAT: Phaser.Types.Renderer.WebGL.WebGLConst; - /** * The Pipeline Manager is responsible for the creation, activation, running and destruction * of WebGL Pipelines and Post FX Pipelines in Phaser 3. @@ -82619,1494 +82602,6 @@ declare namespace Phaser { } - namespace Pipelines { - /** - * The Bitmap Mask Pipeline handles all of the bitmap mask rendering in WebGL for applying - * alpha masks to Game Objects. It works by sampling two texture on the fragment shader and - * using the fragments alpha to clip the region. - * - * The fragment shader it uses can be found in `shaders/src/BitmapMask.frag`. - * The vertex shader it uses can be found in `shaders/src/BitmapMask.vert`. - * - * The default shader attributes for this pipeline are: - * - * `inPosition` (vec2, offset 0) - * - * The default shader uniforms for this pipeline are: - * - * `uResolution` (vec2) - * `uMainSampler` (sampler2D) - * `uMaskSampler` (sampler2D) - * `uInvertMaskAlpha` (bool) - */ - class BitmapMaskPipeline extends Phaser.Renderer.WebGL.WebGLPipeline { - /** - * - * @param config The configuration options for this pipeline. - */ - constructor(config: Phaser.Types.Renderer.WebGL.WebGLPipelineConfig); - - /** - * Binds necessary resources and renders the mask to a separated framebuffer. - * The framebuffer for the masked object is also bound for further use. - * @param mask GameObject used as mask. - * @param maskedObject GameObject masked by the mask GameObject. - * @param camera The camera rendering the current mask. - */ - beginMask(mask: Phaser.GameObjects.GameObject, maskedObject: Phaser.GameObjects.GameObject, camera: Phaser.Cameras.Scene2D.Camera): void; - - /** - * The masked game objects framebuffer is unbound and its texture - * is bound together with the mask texture and the mask shader and - * a draw call with a single quad is processed. Here is where the - * masking effect is applied. - * @param mask GameObject used as a mask. - */ - endMask(mask: Phaser.GameObjects.GameObject): void; - - } - - /** - * The Bitmap Mask Pipeline. - */ - const BITMAPMASK_PIPELINE: string; - - /** - * The Light 2D Pipeline. - */ - const LIGHT_PIPELINE: string; - - /** - * The Point Light Pipeline. - */ - const POINTLIGHT_PIPELINE: string; - - /** - * The Single Texture Pipeline. - */ - const SINGLE_PIPELINE: string; - - /** - * The Multi Texture Pipeline. - */ - const MULTI_PIPELINE: string; - - /** - * The Rope Pipeline. - */ - const ROPE_PIPELINE: string; - - /** - * The Graphics and Shapes Pipeline. - */ - const GRAPHICS_PIPELINE: string; - - /** - * The Post FX Pipeline. - */ - const POSTFX_PIPELINE: string; - - /** - * The Utility Pipeline. - */ - const UTILITY_PIPELINE: string; - - namespace Events { - /** - * The WebGLPipeline After Flush Event. - * - * This event is dispatched by a WebGLPipeline right after it has issued a drawArrays command - * and cleared its vertex count. - */ - const AFTER_FLUSH: any; - - /** - * The WebGLPipeline Before Flush Event. - * - * This event is dispatched by a WebGLPipeline right before it is about to - * flush and issue a bufferData and drawArrays command. - */ - const BEFORE_FLUSH: any; - - /** - * The WebGLPipeline Bind Event. - * - * This event is dispatched by a WebGLPipeline when it is bound by the Pipeline Manager. - */ - const BIND: any; - - /** - * The WebGLPipeline Boot Event. - * - * This event is dispatched by a WebGLPipeline when it has completed its `boot` phase. - */ - const BOOT: any; - - /** - * The WebGLPipeline Destroy Event. - * - * This event is dispatched by a WebGLPipeline when it is starting its destroy process. - */ - const DESTROY: any; - - /** - * The WebGLPipeline ReBind Event. - * - * This event is dispatched by a WebGLPipeline when it is re-bound by the Pipeline Manager. - */ - const REBIND: any; - - /** - * The WebGLPipeline Resize Event. - * - * This event is dispatched by a WebGLPipeline when it is resized, usually as a result - * of the Renderer resizing. - */ - const RESIZE: any; - - } - - /** - * The Light Pipeline is an extension of the Multi Pipeline and uses a custom shader - * designed to handle forward diffused rendering of 2D lights in a Scene. - * - * The shader works in tandem with Light Game Objects, and optionally texture normal maps, - * to provide an ambient illumination effect. - * - * If you wish to provide your own shader, you can use the `%LIGHT_COUNT%` declaration in the source, - * and it will be automatically replaced at run-time with the total number of configured lights. - * - * The maximum number of lights can be set in the Render Config `maxLights` property and defaults to 10. - * - * Prior to Phaser v3.50 this pipeline was called the `ForwardDiffuseLightPipeline`. - * - * The fragment shader it uses can be found in `shaders/src/Light.frag`. - * The vertex shader it uses can be found in `shaders/src/Multi.vert`. - * - * The default shader attributes for this pipeline are: - * - * `inPosition` (vec2, offset 0) - * `inTexCoord` (vec2, offset 8) - * `inTexId` (float, offset 16) - * `inTintEffect` (float, offset 20) - * `inTint` (vec4, offset 24, normalized) - * - * The default shader uniforms for this pipeline are those from the Multi Pipeline, plus: - * - * `uMainSampler` (sampler2D) - * `uNormSampler` (sampler2D) - * `uCamera` (vec4) - * `uResolution` (vec2) - * `uAmbientLightColor` (vec3) - * `uInverseRotationMatrix` (mat3) - * `uLights` (Light struct) - */ - class LightPipeline extends Phaser.Renderer.WebGL.Pipelines.MultiPipeline { - /** - * - * @param config The configuration options for this pipeline. - */ - constructor(config: Phaser.Types.Renderer.WebGL.WebGLPipelineConfig); - - /** - * Stores a default normal map, which is an object with a `glTexture` property that - * maps to a 1x1 texture of the color #7f7fff created in the `boot` method. - */ - defaultNormalMap: object; - - /** - * A boolean that is set automatically during `onRender` that determines - * if the Scene LightManager is active, or not. - */ - readonly lightsActive: boolean; - - /** - * Called when the Game has fully booted and the Renderer has finished setting up. - * - * By this stage all Game level systems are now in place and you can perform any final - * tasks that the pipeline may need that relied on game systems such as the Texture Manager. - */ - boot(): void; - - /** - * Rotates the normal map vectors inversely by the given angle. - * Only works in 2D space. - * @param rotation The angle of rotation in radians. - */ - setNormalMapRotation(rotation: number): void; - - /** - * Returns the normal map WebGLTexture from the given Game Object. - * If the Game Object doesn't have one, it returns the default normal map from this pipeline instead. - * @param gameObject The Game Object to get the normal map from. - */ - getNormalMap(gameObject?: Phaser.GameObjects.GameObject): WebGLTexture; - - /** - * Takes a Sprite Game Object, or any object that extends it, and adds it to the batch. - * @param gameObject The texture based Game Object to add to the batch. - * @param camera The Camera to use for the rendering transform. - * @param parentTransformMatrix The transform matrix of the parent container, if set. - */ - batchSprite(gameObject: Phaser.GameObjects.Image | Phaser.GameObjects.Sprite, camera: Phaser.Cameras.Scene2D.Camera, parentTransformMatrix?: Phaser.GameObjects.Components.TransformMatrix): void; - - /** - * Generic function for batching a textured quad using argument values instead of a Game Object. - * @param gameObject Source GameObject. - * @param texture Raw WebGLTexture associated with the quad. - * @param textureWidth Real texture width. - * @param textureHeight Real texture height. - * @param srcX X coordinate of the quad. - * @param srcY Y coordinate of the quad. - * @param srcWidth Width of the quad. - * @param srcHeight Height of the quad. - * @param scaleX X component of scale. - * @param scaleY Y component of scale. - * @param rotation Rotation of the quad. - * @param flipX Indicates if the quad is horizontally flipped. - * @param flipY Indicates if the quad is vertically flipped. - * @param scrollFactorX By which factor is the quad affected by the camera horizontal scroll. - * @param scrollFactorY By which factor is the quad effected by the camera vertical scroll. - * @param displayOriginX Horizontal origin in pixels. - * @param displayOriginY Vertical origin in pixels. - * @param frameX X coordinate of the texture frame. - * @param frameY Y coordinate of the texture frame. - * @param frameWidth Width of the texture frame. - * @param frameHeight Height of the texture frame. - * @param tintTL Tint for top left. - * @param tintTR Tint for top right. - * @param tintBL Tint for bottom left. - * @param tintBR Tint for bottom right. - * @param tintEffect The tint effect. - * @param uOffset Horizontal offset on texture coordinate. - * @param vOffset Vertical offset on texture coordinate. - * @param camera Current used camera. - * @param parentTransformMatrix Parent container. - * @param skipFlip Skip the renderTexture check. Default false. - * @param textureUnit Use the currently bound texture unit? - */ - batchTexture(gameObject: Phaser.GameObjects.GameObject, texture: WebGLTexture, textureWidth: number, textureHeight: number, srcX: number, srcY: number, srcWidth: number, srcHeight: number, scaleX: number, scaleY: number, rotation: number, flipX: boolean, flipY: boolean, scrollFactorX: number, scrollFactorY: number, displayOriginX: number, displayOriginY: number, frameX: number, frameY: number, frameWidth: number, frameHeight: number, tintTL: number, tintTR: number, tintBL: number, tintBR: number, tintEffect: number, uOffset: number, vOffset: number, camera: Phaser.Cameras.Scene2D.Camera, parentTransformMatrix: Phaser.GameObjects.Components.TransformMatrix, skipFlip?: boolean, textureUnit?: number): void; - - /** - * Adds a Texture Frame into the batch for rendering. - * @param frame The Texture Frame to be rendered. - * @param x The horizontal position to render the texture at. - * @param y The vertical position to render the texture at. - * @param tint The tint color. - * @param alpha The alpha value. - * @param transformMatrix The Transform Matrix to use for the texture. - * @param parentTransformMatrix A parent Transform Matrix. - */ - batchTextureFrame(frame: Phaser.Textures.Frame, x: number, y: number, tint: number, alpha: number, transformMatrix: Phaser.GameObjects.Components.TransformMatrix, parentTransformMatrix?: Phaser.GameObjects.Components.TransformMatrix): void; - - } - - /** - * The Multi Pipeline is the core 2D texture rendering pipeline used by Phaser in WebGL. - * Virtually all Game Objects use this pipeline by default, including Sprites, Graphics - * and Tilemaps. It handles the batching of quads and tris, as well as methods for - * drawing and batching geometry data. - * - * Prior to Phaser v3.50 this pipeline was called the `TextureTintPipeline`. - * - * In previous versions of Phaser only one single texture unit was supported at any one time. - * The Multi Pipeline is an evolution of the old Texture Tint Pipeline, updated to support - * multi-textures for increased performance. - * - * The fragment shader it uses can be found in `shaders/src/Multi.frag`. - * The vertex shader it uses can be found in `shaders/src/Multi.vert`. - * - * The default shader attributes for this pipeline are: - * - * `inPosition` (vec2, offset 0) - * `inTexCoord` (vec2, offset 8) - * `inTexId` (float, offset 16) - * `inTintEffect` (float, offset 20) - * `inTint` (vec4, offset 24, normalized) - * - * The default shader uniforms for this pipeline are: - * - * `uProjectionMatrix` (mat4) - * `uMainSampler` (sampler2D array) - * - * If you wish to create a custom pipeline extending from this one, you should use the string - * declaration `%count%` in your fragment shader source, which is used to set the number of - * `sampler2Ds` available. Also add `%getSampler%` so Phaser can inject the getSampler glsl function. - * This function can be used to get the pixel vec4 from the texture: - * - * `vec4 texture = getSampler(int(outTexId), outTexCoord);` - * - * This pipeline will automatically inject the getSampler function for you, should the value exist - * in your shader source. If you wish to handle this yourself, you can also use the - * function `Utils.parseFragmentShaderMaxTextures`. - * - * If you wish to create a pipeline that works from a single texture, or that doesn't have - * internal texture iteration, please see the `SinglePipeline` instead. - */ - class MultiPipeline extends Phaser.Renderer.WebGL.WebGLPipeline { - /** - * - * @param config The configuration options for this pipeline. - */ - constructor(config: Phaser.Types.Renderer.WebGL.WebGLPipelineConfig); - - /** - * A temporary Transform Matrix, re-used internally during batching by the - * Shape Game Objects. - */ - calcMatrix: Phaser.GameObjects.Components.TransformMatrix; - - /** - * Called every time the pipeline is bound by the renderer. - * Sets the shader program, vertex buffer and other resources. - * Should only be called when changing pipeline. - */ - bind(): this; - - /** - * Takes a Sprite Game Object, or any object that extends it, and adds it to the batch. - * @param gameObject The texture based Game Object to add to the batch. - * @param camera The Camera to use for the rendering transform. - * @param parentTransformMatrix The transform matrix of the parent container, if set. - */ - batchSprite(gameObject: Phaser.GameObjects.Image | Phaser.GameObjects.Sprite, camera: Phaser.Cameras.Scene2D.Camera, parentTransformMatrix?: Phaser.GameObjects.Components.TransformMatrix): void; - - /** - * Generic function for batching a textured quad using argument values instead of a Game Object. - * @param gameObject Source GameObject. - * @param texture Raw WebGLTexture associated with the quad. - * @param textureWidth Real texture width. - * @param textureHeight Real texture height. - * @param srcX X coordinate of the quad. - * @param srcY Y coordinate of the quad. - * @param srcWidth Width of the quad. - * @param srcHeight Height of the quad. - * @param scaleX X component of scale. - * @param scaleY Y component of scale. - * @param rotation Rotation of the quad. - * @param flipX Indicates if the quad is horizontally flipped. - * @param flipY Indicates if the quad is vertically flipped. - * @param scrollFactorX By which factor is the quad affected by the camera horizontal scroll. - * @param scrollFactorY By which factor is the quad effected by the camera vertical scroll. - * @param displayOriginX Horizontal origin in pixels. - * @param displayOriginY Vertical origin in pixels. - * @param frameX X coordinate of the texture frame. - * @param frameY Y coordinate of the texture frame. - * @param frameWidth Width of the texture frame. - * @param frameHeight Height of the texture frame. - * @param tintTL Tint for top left. - * @param tintTR Tint for top right. - * @param tintBL Tint for bottom left. - * @param tintBR Tint for bottom right. - * @param tintEffect The tint effect. - * @param uOffset Horizontal offset on texture coordinate. - * @param vOffset Vertical offset on texture coordinate. - * @param camera Current used camera. - * @param parentTransformMatrix Parent container. - * @param skipFlip Skip the renderTexture check. Default false. - * @param textureUnit Use the currently bound texture unit? - */ - batchTexture(gameObject: Phaser.GameObjects.GameObject, texture: WebGLTexture, textureWidth: number, textureHeight: number, srcX: number, srcY: number, srcWidth: number, srcHeight: number, scaleX: number, scaleY: number, rotation: number, flipX: boolean, flipY: boolean, scrollFactorX: number, scrollFactorY: number, displayOriginX: number, displayOriginY: number, frameX: number, frameY: number, frameWidth: number, frameHeight: number, tintTL: number, tintTR: number, tintBL: number, tintBR: number, tintEffect: number, uOffset: number, vOffset: number, camera: Phaser.Cameras.Scene2D.Camera, parentTransformMatrix: Phaser.GameObjects.Components.TransformMatrix, skipFlip?: boolean, textureUnit?: number): void; - - /** - * Adds a Texture Frame into the batch for rendering. - * @param frame The Texture Frame to be rendered. - * @param x The horizontal position to render the texture at. - * @param y The vertical position to render the texture at. - * @param tint The tint color. - * @param alpha The alpha value. - * @param transformMatrix The Transform Matrix to use for the texture. - * @param parentTransformMatrix A parent Transform Matrix. - */ - batchTextureFrame(frame: Phaser.Textures.Frame, x: number, y: number, tint: number, alpha: number, transformMatrix: Phaser.GameObjects.Components.TransformMatrix, parentTransformMatrix?: Phaser.GameObjects.Components.TransformMatrix): void; - - /** - * Pushes a filled rectangle into the vertex batch. - * - * Rectangle factors in the given transform matrices before adding to the batch. - * @param x Horizontal top left coordinate of the rectangle. - * @param y Vertical top left coordinate of the rectangle. - * @param width Width of the rectangle. - * @param height Height of the rectangle. - * @param currentMatrix The current transform. - * @param parentMatrix The parent transform. - */ - batchFillRect(x: number, y: number, width: number, height: number, currentMatrix: Phaser.GameObjects.Components.TransformMatrix, parentMatrix: Phaser.GameObjects.Components.TransformMatrix): void; - - /** - * Pushes a filled triangle into the vertex batch. - * - * Triangle factors in the given transform matrices before adding to the batch. - * @param x0 Point 0 x coordinate. - * @param y0 Point 0 y coordinate. - * @param x1 Point 1 x coordinate. - * @param y1 Point 1 y coordinate. - * @param x2 Point 2 x coordinate. - * @param y2 Point 2 y coordinate. - * @param currentMatrix The current transform. - * @param parentMatrix The parent transform. - */ - batchFillTriangle(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, currentMatrix: Phaser.GameObjects.Components.TransformMatrix, parentMatrix: Phaser.GameObjects.Components.TransformMatrix): void; - - /** - * Pushes a stroked triangle into the vertex batch. - * - * Triangle factors in the given transform matrices before adding to the batch. - * - * The triangle is created from 3 lines and drawn using the `batchStrokePath` method. - * @param x0 Point 0 x coordinate. - * @param y0 Point 0 y coordinate. - * @param x1 Point 1 x coordinate. - * @param y1 Point 1 y coordinate. - * @param x2 Point 2 x coordinate. - * @param y2 Point 2 y coordinate. - * @param lineWidth The width of the line in pixels. - * @param currentMatrix The current transform. - * @param parentMatrix The parent transform. - */ - batchStrokeTriangle(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, lineWidth: number, currentMatrix: Phaser.GameObjects.Components.TransformMatrix, parentMatrix: Phaser.GameObjects.Components.TransformMatrix): void; - - /** - * Adds the given path to the vertex batch for rendering. - * - * It works by taking the array of path data and then passing it through Earcut, which - * creates a list of polygons. Each polygon is then added to the batch. - * - * The path is always automatically closed because it's filled. - * @param path Collection of points that represent the path. - * @param currentMatrix The current transform. - * @param parentMatrix The parent transform. - */ - batchFillPath(path: Phaser.Types.Math.Vector2Like[], currentMatrix: Phaser.GameObjects.Components.TransformMatrix, parentMatrix: Phaser.GameObjects.Components.TransformMatrix): void; - - /** - * Adds the given path to the vertex batch for rendering. - * - * It works by taking the array of path data and calling `batchLine` for each section - * of the path. - * - * The path is optionally closed at the end. - * @param path Collection of points that represent the path. - * @param lineWidth The width of the line segments in pixels. - * @param pathOpen Indicates if the path should be closed or left open. - * @param currentMatrix The current transform. - * @param parentMatrix The parent transform. - */ - batchStrokePath(path: Phaser.Types.Math.Vector2Like[], lineWidth: number, pathOpen: boolean, currentMatrix: Phaser.GameObjects.Components.TransformMatrix, parentMatrix: Phaser.GameObjects.Components.TransformMatrix): void; - - /** - * Creates a line out of 4 quads and adds it to the vertex batch based on the given line values. - * @param ax x coordinate of the start of the line. - * @param ay y coordinate of the start of the line. - * @param bx x coordinate of the end of the line. - * @param by y coordinate of the end of the line. - * @param aLineWidth Width of the start of the line. - * @param bLineWidth Width of the end of the line. - * @param index If this line is part of a multi-line draw, the index of the line in the draw. - * @param closePath Does this line close a multi-line path? - * @param currentMatrix The current transform. - * @param parentMatrix The parent transform. - */ - batchLine(ax: number, ay: number, bx: number, by: number, aLineWidth: number, bLineWidth: number, index: number, closePath: boolean, currentMatrix: Phaser.GameObjects.Components.TransformMatrix, parentMatrix: Phaser.GameObjects.Components.TransformMatrix): void; - - } - - /** - * The Point Light Pipeline handles rendering the Point Light Game Objects in WebGL. - * - * The fragment shader it uses can be found in `shaders/src/PointLight.frag`. - * The vertex shader it uses can be found in `shaders/src/PointLight.vert`. - * - * The default shader attributes for this pipeline are: - * - * `inPosition` (vec2) - * `inLightPosition` (vec2) - * `inLightRadius` (float) - * `inLightAttenuation` (float) - * `inLightColor` (vec4) - * - * The default shader uniforms for this pipeline are: - * - * `uProjectionMatrix` (mat4) - * `uResolution` (vec2) - * `uCameraZoom` (sampler2D) - */ - class PointLightPipeline extends Phaser.Renderer.WebGL.WebGLPipeline { - /** - * - * @param config The configuration options for this pipeline. - */ - constructor(config: Phaser.Types.Renderer.WebGL.WebGLPipelineConfig); - - /** - * Adds a Point Light Game Object to the batch, flushing if required. - * @param light The Point Light Game Object. - * @param camera The camera rendering the Point Light. - * @param x0 The top-left x position. - * @param y0 The top-left y position. - * @param x1 The bottom-left x position. - * @param y1 The bottom-left y position. - * @param x2 The bottom-right x position. - * @param y2 The bottom-right y position. - * @param x3 The top-right x position. - * @param y3 The top-right y position. - * @param lightX The horizontal center of the light. - * @param lightY The vertical center of the light. - */ - batchPointLight(light: Phaser.GameObjects.PointLight, camera: Phaser.Cameras.Scene2D.Camera, x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, lightX: number, lightY: number): void; - - /** - * Adds a single Point Light vertex to the current vertex buffer and increments the - * `vertexCount` property by 1. - * - * This method is called directly by `batchPointLight`. - * @param x The vertex x position. - * @param y The vertex y position. - * @param lightX The horizontal center of the light. - * @param lightY The vertical center of the light. - * @param radius The radius of the light. - * @param attenuation The attenuation of the light. - * @param r The red color channel of the light. - * @param g The green color channel of the light. - * @param b The blue color channel of the light. - * @param a The alpha color channel of the light. - */ - batchLightVert(x: number, y: number, lightX: number, lightY: number, radius: number, attenuation: number, r: number, g: number, b: number, a: number): void; - - } - - /** - * The Post FX Pipeline is a special kind of pipeline specifically for handling post - * processing effects. Where-as a standard Pipeline allows you to control the process - * of rendering Game Objects by configuring the shaders and attributes used to draw them, - * a Post FX Pipeline is designed to allow you to apply processing _after_ the Game Object/s - * have been rendered. Typical examples of post processing effects are bloom filters, - * blurs, light effects and color manipulation. - * - * The pipeline works by creating a tiny vertex buffer with just one single hard-coded quad - * in it. Game Objects can have a Post Pipeline set on them. Those objects are then rendered - * using their standard pipeline, but are redirected to the Render Targets owned by the - * post pipeline, which can then apply their own shaders and effects, before passing them - * back to the main renderer. - * - * Please see the Phaser 3 examples for further details on this extensive subject. - * - * The default fragment shader it uses can be found in `shaders/src/PostFX.frag`. - * The default vertex shader it uses can be found in `shaders/src/Quad.vert`. - * - * The default shader attributes for this pipeline are: - * - * `inPosition` (vec2, offset 0) - * `inTexCoord` (vec2, offset 8) - * - * The vertices array layout is: - * - * -1, 1 B----C 1, 1 - * 0, 1 | /| 1, 1 - * | / | - * | / | - * |/ | - * -1, -1 A----D 1, -1 - * 0, 0 1, 0 - * - * A = -1, -1 (pos) and 0, 0 (uv) - * B = -1, 1 (pos) and 0, 1 (uv) - * C = 1, 1 (pos) and 1, 1 (uv) - * D = 1, -1 (pos) and 1, 0 (uv) - * - * First tri: A, B, C - * Second tri: A, C, D - * - * Array index: - * - * 0 = Tri 1 - Vert A - x pos - * 1 = Tri 1 - Vert A - y pos - * 2 = Tri 1 - Vert A - uv u - * 3 = Tri 1 - Vert A - uv v - * - * 4 = Tri 1 - Vert B - x pos - * 5 = Tri 1 - Vert B - y pos - * 6 = Tri 1 - Vert B - uv u - * 7 = Tri 1 - Vert B - uv v - * - * 8 = Tri 1 - Vert C - x pos - * 9 = Tri 1 - Vert C - y pos - * 10 = Tri 1 - Vert C - uv u - * 11 = Tri 1 - Vert C - uv v - * - * 12 = Tri 2 - Vert A - x pos - * 13 = Tri 2 - Vert A - y pos - * 14 = Tri 2 - Vert A - uv u - * 15 = Tri 2 - Vert A - uv v - * - * 16 = Tri 2 - Vert C - x pos - * 17 = Tri 2 - Vert C - y pos - * 18 = Tri 2 - Vert C - uv u - * 19 = Tri 2 - Vert C - uv v - * - * 20 = Tri 2 - Vert D - x pos - * 21 = Tri 2 - Vert D - y pos - * 22 = Tri 2 - Vert D - uv u - * 23 = Tri 2 - Vert D - uv v - */ - class PostFXPipeline extends Phaser.Renderer.WebGL.WebGLPipeline { - /** - * - * @param config The configuration options for this pipeline. - */ - constructor(config: Phaser.Types.Renderer.WebGL.WebGLPipelineConfig); - - /** - * If this post-pipeline belongs to a Game Object or Camera, this contains a reference to it. - */ - gameObject: Phaser.GameObjects.GameObject; - - /** - * A Color Matrix instance belonging to this pipeline. - * - * Used during calls to the `drawFrame` method. - */ - colorMatrix: Phaser.Display.ColorMatrix; - - /** - * A reference to the Full Frame 1 Render Target that belongs to the - * Utility Pipeline. This property is set during the `boot` method. - * - * This Render Target is the full size of the renderer. - * - * You can use this directly in Post FX Pipelines for multi-target effects. - * However, be aware that these targets are shared between all post fx pipelines. - */ - fullFrame1: Phaser.Renderer.WebGL.RenderTarget; - - /** - * A reference to the Full Frame 2 Render Target that belongs to the - * Utility Pipeline. This property is set during the `boot` method. - * - * This Render Target is the full size of the renderer. - * - * You can use this directly in Post FX Pipelines for multi-target effects. - * However, be aware that these targets are shared between all post fx pipelines. - */ - fullFrame2: Phaser.Renderer.WebGL.RenderTarget; - - /** - * A reference to the Half Frame 1 Render Target that belongs to the - * Utility Pipeline. This property is set during the `boot` method. - * - * This Render Target is half the size of the renderer. - * - * You can use this directly in Post FX Pipelines for multi-target effects. - * However, be aware that these targets are shared between all post fx pipelines. - */ - halfFrame1: Phaser.Renderer.WebGL.RenderTarget; - - /** - * A reference to the Half Frame 2 Render Target that belongs to the - * Utility Pipeline. This property is set during the `boot` method. - * - * This Render Target is half the size of the renderer. - * - * You can use this directly in Post FX Pipelines for multi-target effects. - * However, be aware that these targets are shared between all post fx pipelines. - */ - halfFrame2: Phaser.Renderer.WebGL.RenderTarget; - - /** - * Copy the `source` Render Target to the `target` Render Target. - * - * You can optionally set the brightness factor of the copy. - * - * The difference between this method and `drawFrame` is that this method - * uses a faster copy shader, where only the brightness can be modified. - * If you need color level manipulation, see `drawFrame` instead. - * @param source The source Render Target. - * @param target The target Render Target. - * @param brightness The brightness value applied to the frame copy. Default 1. - * @param clear Clear the target before copying? Default true. - * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. - */ - copyFrame(source: Phaser.Renderer.WebGL.RenderTarget, target?: Phaser.Renderer.WebGL.RenderTarget, brightness?: number, clear?: boolean, clearAlpha?: boolean): void; - - /** - * Pops the framebuffer from the renderers FBO stack and sets that as the active target, - * then draws the `source` Render Target to it. It then resets the renderer textures. - * - * This should be done when you need to draw the _final_ results of a pipeline to the game - * canvas, or the next framebuffer in line on the FBO stack. You should only call this once - * in the `onDraw` handler and it should be the final thing called. Be careful not to call - * this if you need to actually use the pipeline shader, instead of the copy shader. In - * those cases, use the `bindAndDraw` method. - * @param source The Render Target to draw from. - */ - copyToGame(source: Phaser.Renderer.WebGL.RenderTarget): void; - - /** - * Copy the `source` Render Target to the `target` Render Target, using the - * given Color Matrix. - * - * The difference between this method and `copyFrame` is that this method - * uses a color matrix shader, where you have full control over the luminance - * values used during the copy. If you don't need this, you can use the faster - * `copyFrame` method instead. - * @param source The source Render Target. - * @param target The target Render Target. - * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. - */ - drawFrame(source: Phaser.Renderer.WebGL.RenderTarget, target?: Phaser.Renderer.WebGL.RenderTarget, clearAlpha?: boolean): void; - - /** - * Draws the `source1` and `source2` Render Targets to the `target` Render Target - * using a linear blend effect, which is controlled by the `strength` parameter. - * @param source1 The first source Render Target. - * @param source2 The second source Render Target. - * @param target The target Render Target. - * @param strength The strength of the blend. Default 1. - * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. - */ - blendFrames(source1: Phaser.Renderer.WebGL.RenderTarget, source2: Phaser.Renderer.WebGL.RenderTarget, target?: Phaser.Renderer.WebGL.RenderTarget, strength?: number, clearAlpha?: boolean): void; - - /** - * Draws the `source1` and `source2` Render Targets to the `target` Render Target - * using an additive blend effect, which is controlled by the `strength` parameter. - * @param source1 The first source Render Target. - * @param source2 The second source Render Target. - * @param target The target Render Target. - * @param strength The strength of the blend. Default 1. - * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. - */ - blendFramesAdditive(source1: Phaser.Renderer.WebGL.RenderTarget, source2: Phaser.Renderer.WebGL.RenderTarget, target?: Phaser.Renderer.WebGL.RenderTarget, strength?: number, clearAlpha?: boolean): void; - - /** - * Clears the given Render Target. - * @param target The Render Target to clear. - * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. - */ - clearFrame(target: Phaser.Renderer.WebGL.RenderTarget, clearAlpha?: boolean): void; - - /** - * Copy the `source` Render Target to the `target` Render Target. - * - * The difference with this copy is that no resizing takes place. If the `source` - * Render Target is larger than the `target` then only a portion the same size as - * the `target` dimensions is copied across. - * - * You can optionally set the brightness factor of the copy. - * @param source The source Render Target. - * @param target The target Render Target. - * @param brightness The brightness value applied to the frame copy. Default 1. - * @param clear Clear the target before copying? Default true. - * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. - * @param eraseMode Erase source from target using ERASE Blend Mode? Default false. - */ - blitFrame(source: Phaser.Renderer.WebGL.RenderTarget, target: Phaser.Renderer.WebGL.RenderTarget, brightness?: number, clear?: boolean, clearAlpha?: boolean, eraseMode?: boolean): void; - - /** - * Binds the `source` Render Target and then copies a section of it to the `target` Render Target. - * - * This method is extremely fast because it uses `gl.copyTexSubImage2D` and doesn't - * require the use of any shaders. Remember the coordinates are given in standard WebGL format, - * where x and y specify the lower-left corner of the section, not the top-left. Also, the - * copy entirely replaces the contents of the target texture, no 'merging' or 'blending' takes - * place. - * @param source The source Render Target. - * @param target The target Render Target. - * @param x The x coordinate of the lower left corner where to start copying. - * @param y The y coordinate of the lower left corner where to start copying. - * @param width The width of the texture. - * @param height The height of the texture. - * @param clear Clear the target before copying? Default true. - * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. - */ - copyFrameRect(source: Phaser.Renderer.WebGL.RenderTarget, target: Phaser.Renderer.WebGL.RenderTarget, x: number, y: number, width: number, height: number, clear?: boolean, clearAlpha?: boolean): void; - - /** - * Binds this pipeline and draws the `source` Render Target to the `target` Render Target. - * - * If no `target` is specified, it will pop the framebuffer from the Renderers FBO stack - * and use that instead, which should be done when you need to draw the final results of - * this pipeline to the game canvas. - * - * You can optionally set the shader to be used for the draw here, if this is a multi-shader - * pipeline. By default `currentShader` will be used. If you need to set a shader but not - * a target, just pass `null` as the `target` parameter. - * @param source The Render Target to draw from. - * @param target The Render Target to draw to. If not set, it will pop the fbo from the stack. - * @param clear Clear the target before copying? Only used if `target` parameter is set. Default true. - * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. - * @param currentShader The shader to use during the draw. - */ - bindAndDraw(source: Phaser.Renderer.WebGL.RenderTarget, target?: Phaser.Renderer.WebGL.RenderTarget, clear?: boolean, clearAlpha?: boolean, currentShader?: Phaser.Renderer.WebGL.WebGLShader): void; - - } - - /** - * The Rope Pipeline is a variation of the Multi Pipeline that uses a `TRIANGLE_STRIP` for - * its topology, instead of TRIANGLES. This is primarily used by the Rope Game Object, - * or anything that extends it. - * - * Prior to Phaser v3.50 this pipeline was called the `TextureTintStripPipeline`. - * - * The fragment shader it uses can be found in `shaders/src/Multi.frag`. - * The vertex shader it uses can be found in `shaders/src/Multi.vert`. - * - * The default shader attributes for this pipeline are: - * - * `inPosition` (vec2, offset 0) - * `inTexCoord` (vec2, offset 8) - * `inTexId` (float, offset 16) - * `inTintEffect` (float, offset 20) - * `inTint` (vec4, offset 24, normalized) - * - * The default shader uniforms for this pipeline are: - * - * `uProjectionMatrix` (mat4) - * `uMainSampler` (sampler2D array) - * - * The pipeline is structurally identical to the Multi Pipeline and should be treated as such. - */ - class RopePipeline extends Phaser.Renderer.WebGL.Pipelines.MultiPipeline { - /** - * - * @param config The configuration options for this pipeline. - */ - constructor(config: Phaser.Types.Renderer.WebGL.WebGLPipelineConfig); - - } - - /** - * The Single Pipeline is a special version of the Multi Pipeline that only ever - * uses one texture, bound to texture unit zero. Although not as efficient as the - * Multi Pipeline, it provides an easier way to create custom pipelines that only require - * a single bound texture. - * - * Prior to Phaser v3.50 this pipeline didn't exist, but could be compared to the old `TextureTintPipeline`. - * - * The fragment shader it uses can be found in `shaders/src/Single.frag`. - * The vertex shader it uses can be found in `shaders/src/Single.vert`. - * - * The default shader attributes for this pipeline are: - * - * `inPosition` (vec2, offset 0) - * `inTexCoord` (vec2, offset 8) - * `inTexId` (float, offset 16) - this value is always zero in the Single Pipeline - * `inTintEffect` (float, offset 20) - * `inTint` (vec4, offset 24, normalized) - * - * The default shader uniforms for this pipeline are: - * - * `uProjectionMatrix` (mat4) - * `uMainSampler` (sampler2D) - */ - class SinglePipeline extends Phaser.Renderer.WebGL.Pipelines.MultiPipeline { - /** - * - * @param config The configuration options for this pipeline. - */ - constructor(config: Phaser.Types.Renderer.WebGL.WebGLPipelineConfig); - - } - - /** - * The SpriteFX Pipeline is a special kind of pipeline designed specifically for applying - * special effects to Sprites. Where-as the Post FX Pipeline applies an effect _after_ the - * object has been rendered, the Sprite FX Pipeline allows you to control the rendering of - * the object itself - passing it off to its own texture where multi-buffer compositing - * can take place. - * - * You can only use the SpriteFX Pipeline on the following types of Game Objects, or those - * that extend from them: - * - * Sprite - * Image - * Text - * TileSprite - * RenderTexture - * - * // TODO - Explain about the fbos and functions - */ - class SpriteFXPipeline extends Phaser.Renderer.WebGL.WebGLPipeline { - /** - * - * @param config The configuration options for this pipeline. - */ - constructor(config: Phaser.Types.Renderer.WebGL.WebGLPipelineConfig); - - /** - * A reference to the Draw Sprite Shader belonging to this Pipeline. - * - * This shader is used when the sprite is drawn to this fbo (or to the game if drawToFrame is false) - * - * This property is set during the `boot` method. - */ - drawSpriteShader: Phaser.Renderer.WebGL.WebGLShader; - - /** - * A reference to the Copy Shader belonging to this Pipeline. - * - * This shader is used when you call the `copySprite` method. - * - * This property is set during the `boot` method. - */ - copyShader: Phaser.Renderer.WebGL.WebGLShader; - - /** - * A reference to the Game Draw Shader belonging to this Pipeline. - * - * This shader draws the fbo to the game. - * - * This property is set during the `boot` method. - */ - gameShader: Phaser.Renderer.WebGL.WebGLShader; - - /** - * Raw byte buffer of vertices used specifically during the copySprite method. - */ - readonly quadVertexData: ArrayBuffer; - - /** - * The WebGLBuffer that holds the quadVertexData. - */ - readonly quadVertexBuffer: WebGLBuffer; - - /** - * Float32 view of the quad array buffer. - */ - quadVertexViewF32: Float32Array; - - /** - * The full-screen Render Target that the sprite is first drawn to. - */ - fsTarget: Phaser.Renderer.WebGL.RenderTarget; - - /** - * Handles the resizing of the quad vertex data. - * @param width The new width of the quad. - * @param height The new height of the quad. - */ - onResize(width: number, height: number): void; - - /** - * Takes a Sprite Game Object, or any object that extends it, and renders it via this pipeline. - * - * this method is a proxy for the MultiPipeline method of the same name. The actual rendering - * is redirected through to the `batchQuad` method in this pipeline. - * @param gameObject The texture based Game Object to add to the batch. - * @param camera The Camera to use for the rendering transform. - * @param parentTransformMatrix The transform matrix of the parent container, if set. - */ - batchSprite(gameObject: Phaser.GameObjects.Image | Phaser.GameObjects.Sprite, camera: Phaser.Cameras.Scene2D.Camera, parentTransformMatrix?: Phaser.GameObjects.Components.TransformMatrix): void; - - /** - * Generic function for batching a textured quad using argument values instead of a Game Object. - * @param gameObject Source GameObject. - * @param texture Raw WebGLTexture associated with the quad. - * @param textureWidth Real texture width. - * @param textureHeight Real texture height. - * @param srcX X coordinate of the quad. - * @param srcY Y coordinate of the quad. - * @param srcWidth Width of the quad. - * @param srcHeight Height of the quad. - * @param scaleX X component of scale. - * @param scaleY Y component of scale. - * @param rotation Rotation of the quad. - * @param flipX Indicates if the quad is horizontally flipped. - * @param flipY Indicates if the quad is vertically flipped. - * @param scrollFactorX By which factor is the quad affected by the camera horizontal scroll. - * @param scrollFactorY By which factor is the quad effected by the camera vertical scroll. - * @param displayOriginX Horizontal origin in pixels. - * @param displayOriginY Vertical origin in pixels. - * @param frameX X coordinate of the texture frame. - * @param frameY Y coordinate of the texture frame. - * @param frameWidth Width of the texture frame. - * @param frameHeight Height of the texture frame. - * @param tintTL Tint for top left. - * @param tintTR Tint for top right. - * @param tintBL Tint for bottom left. - * @param tintBR Tint for bottom right. - * @param tintEffect The tint effect. - * @param uOffset Horizontal offset on texture coordinate. - * @param vOffset Vertical offset on texture coordinate. - * @param camera Current used camera. - * @param parentTransformMatrix Parent container. - * @param skipFlip Skip the renderTexture check. Default false. - * @param textureUnit Use the currently bound texture unit? - */ - batchTexture(gameObject: Phaser.GameObjects.GameObject, texture: WebGLTexture, textureWidth: number, textureHeight: number, srcX: number, srcY: number, srcWidth: number, srcHeight: number, scaleX: number, scaleY: number, rotation: number, flipX: boolean, flipY: boolean, scrollFactorX: number, scrollFactorY: number, displayOriginX: number, displayOriginY: number, frameX: number, frameY: number, frameWidth: number, frameHeight: number, tintTL: number, tintTR: number, tintBL: number, tintBR: number, tintEffect: number, uOffset: number, vOffset: number, camera: Phaser.Cameras.Scene2D.Camera, parentTransformMatrix: Phaser.GameObjects.Components.TransformMatrix, skipFlip?: boolean, textureUnit?: number): void; - - /** - * Adds the vertices data into the batch and flushes if full. - * - * Assumes 6 vertices in the following arrangement: - * - * ``` - * 0----3 - * |\ B| - * | \ | - * | \ | - * | A \| - * | \ - * 1----2 - * ``` - * - * Where x0 / y0 = 0, x1 / y1 = 1, x2 / y2 = 2 and x3 / y3 = 3 - * @param gameObject The Game Object, if any, drawing this quad. - * @param x0 The top-left x position. - * @param y0 The top-left y position. - * @param x1 The bottom-left x position. - * @param y1 The bottom-left y position. - * @param x2 The bottom-right x position. - * @param y2 The bottom-right y position. - * @param x3 The top-right x position. - * @param y3 The top-right y position. - * @param u0 UV u0 value. - * @param v0 UV v0 value. - * @param u1 UV u1 value. - * @param v1 UV v1 value. - * @param tintTL The top-left tint color value. - * @param tintTR The top-right tint color value. - * @param tintBL The bottom-left tint color value. - * @param tintBR The bottom-right tint color value. - * @param tintEffect The tint effect for the shader to use. - * @param texture WebGLTexture that will be assigned to the current batch if a flush occurs. - */ - batchQuad(gameObject: Phaser.GameObjects.GameObject | null, x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, u0: number, v0: number, u1: number, v1: number, tintTL: number, tintTR: number, tintBL: number, tintBR: number, tintEffect: number | boolean, texture?: WebGLTexture): boolean; - - /** - * This callback is invoked when a sprite is drawn by this pipeline. - * - * It will fire after the shader has been set, but before the sprite has been drawn, - * so use it to set any additional uniforms you may need. - * - * Note: Manipulating the Sprite during this callback will _not_ change how it is drawn to the Render Target. - * @param gameObject The Sprite being drawn. - * @param target The Render Target the Sprite will be drawn to. - */ - onDrawSprite(gameObject: Phaser.GameObjects.Sprite, target: Phaser.Renderer.WebGL.RenderTarget): void; - - /** - * This callback is invoked when you call the `copySprite` method. - * - * It will fire after the shader has been set, but before the source target has been copied, - * so use it to set any additional uniforms you may need. - * - * Note: Manipulating the Sprite during this callback will _not_ change the Render Targets. - * @param source The source Render Target being copied from. - * @param target The target Render Target that will be copied to. - * @param gameObject The Sprite being copied. - */ - onCopySprite(source: Phaser.Renderer.WebGL.RenderTarget, target: Phaser.Renderer.WebGL.RenderTarget, gameObject: Phaser.GameObjects.Sprite): void; - - /** - * Copy the `source` Render Target to the `target` Render Target. - * - * No target resizing takes place. If the `source` Render Target is larger than the `target`, - * then only a portion the same size as the `target` dimensions is copied across. - * - * Calling this method will invoke the `onCopySprite` handler and will also call - * the `onFXCopy` callback on the Sprite. Both of these happen prior to the copy, allowing you - * to use them to set shader uniforms and other values. - * @param source The source Render Target being copied from. - * @param target The target Render Target that will be copied to. - * @param gameObject The Sprite being copied. - * @param clear Clear the target before copying? Default true. - * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. - * @param eraseMode Erase source from target using ERASE Blend Mode? Default false. - * @param shader The shader to use to copy the target. Defaults to the `copyShader`. - */ - copySprite(source: Phaser.Renderer.WebGL.RenderTarget, target: Phaser.Renderer.WebGL.RenderTarget, gameObject: Phaser.GameObjects.Sprite, clear?: boolean, clearAlpha?: boolean, eraseMode?: boolean, shader?: Phaser.Renderer.WebGL.WebGLShader): void; - - /** - * Draws the `source1` and `source2` Render Targets to the `target` Render Target - * using a linear blend effect, which is controlled by the `strength` parameter. - * @param source1 The first source Render Target. - * @param source2 The second source Render Target. - * @param target The target Render Target. - * @param strength The strength of the blend. Default 1. - * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. - */ - blendFrames(source1: Phaser.Renderer.WebGL.RenderTarget, source2: Phaser.Renderer.WebGL.RenderTarget, target?: Phaser.Renderer.WebGL.RenderTarget, strength?: number, clearAlpha?: boolean): void; - - /** - * Draws the `source1` and `source2` Render Targets to the `target` Render Target - * using an additive blend effect, which is controlled by the `strength` parameter. - * @param source1 The first source Render Target. - * @param source2 The second source Render Target. - * @param target The target Render Target. - * @param strength The strength of the blend. Default 1. - * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. - */ - blendFramesAdditive(source1: Phaser.Renderer.WebGL.RenderTarget, source2: Phaser.Renderer.WebGL.RenderTarget, target?: Phaser.Renderer.WebGL.RenderTarget, strength?: number, clearAlpha?: boolean): void; - - /** - * This method will copy the given Render Target to the game canvas using the `copyShader`. - * - * This applies the results of the copy shader during the draw. - * - * If you wish to copy the target without any effects see the `copyToGame` method instead. - * - * This method should be the final thing called in your pipeline. - * @param source The Render Target to draw to the game. - */ - drawToGame(source: Phaser.Renderer.WebGL.RenderTarget): void; - - /** - * This method will copy the given Render Target to the game canvas using the `gameShader`. - * - * Unless you've changed it, the `gameShader` copies the target without modifying it, just - * ensuring it is placed in the correct location on the canvas. - * - * If you wish to draw the target with and apply the fragment shader at the same time, - * see the `drawToGame` method instead. - * - * This method should be the final thing called in your pipeline. - * @param source The Render Target to copy to the game. - */ - copyToGame(source: Phaser.Renderer.WebGL.RenderTarget): void; - - /** - * This method is called by `drawToGame` and `copyToGame`. It takes the source Render Target - * and copies it back to the game canvas, or the next frame buffer in the stack, and should - * be considered the very last thing this pipeline does. - * - * You don't normally need to call this method, or override it, however it is left public - * should you wish to do so. - * - * Note that it does _not_ set a shader. You should do this yourself if invoking this. - * @param source The Render Target to draw to the game. - */ - bindAndDraw(source: Phaser.Renderer.WebGL.RenderTarget): void; - - /** - * This method is called every time the `batchSprite` method is called and is passed a - * reference to the current render target. - * - * If you override this method, then it should make sure it calls either the - * `drawToGame` or `copyToGame` methods as the final thing it does. However, you can do as - * much additional processing as you like prior to this. - * @param target The Render Target to draw to the game. - * @param swapTarget The Swap Render Target, useful for double-buffer effects. - * @param altSwapTarget The Swap Render Target, useful for double-buffer effects. - */ - onDraw(target: Phaser.Renderer.WebGL.RenderTarget, swapTarget?: Phaser.Renderer.WebGL.RenderTarget, altSwapTarget?: Phaser.Renderer.WebGL.RenderTarget): void; - - /** - * Set the UV values for the 6 vertices that make up the quad used by the copy shader. - * - * Be sure to call `resetUVs` once you have finished manipulating the UV coordinates. - * @param uA The u value of vertex A. - * @param vA The v value of vertex A. - * @param uB The u value of vertex B. - * @param vB The v value of vertex B. - * @param uC The u value of vertex C. - * @param vC The v value of vertex C. - * @param uD The u value of vertex D. - * @param vD The v value of vertex D. - */ - setUVs(uA: number, vA: number, uB: number, vB: number, uC: number, vC: number, uD: number, vD: number): void; - - /** - * Sets the vertex UV coordinates of the quad used by the copy shaders - * so that they correctly adjust the texture coordinates for a blit frame effect. - * - * Be sure to call `resetUVs` once you have finished manipulating the UV coordinates. - * @param source The source Render Target. - * @param target The target Render Target. - */ - setTargetUVs(source: Phaser.Renderer.WebGL.RenderTarget, target: Phaser.Renderer.WebGL.RenderTarget): void; - - /** - * Resets the quad vertice UV values to their default settings. - * - * The quad is used by the copy shader in this pipeline. - */ - resetUVs(): void; - - /** - * Destroys all shader instances, removes all object references and nulls all external references. - */ - destroy(): this; - - } - - /** - * The Utility Pipeline is a special-use pipeline that belongs to the Pipeline Manager. - * - * It provides 4 shaders and handy associated methods: - * - * 1) Copy Shader. A fast texture to texture copy shader with optional brightness setting. - * 2) Additive Blend Mode Shader. Blends two textures using an additive blend mode. - * 3) Linear Blend Mode Shader. Blends two textures using a linear blend mode. - * 4) Color Matrix Copy Shader. Draws a texture to a target using a Color Matrix. - * - * You do not extend this pipeline, but instead get a reference to it from the Pipeline - * Manager via the `setUtility` method. You can also access methods such as `copyFrame` - * directly from the Pipeline Manager. - * - * This pipeline provides methods for manipulating framebuffer backed textures, such as - * copying or blending one texture to another, copying a portion of a texture, additively - * blending two textures, flipping textures and more. - * - * The default shader attributes for this pipeline are: - * - * `inPosition` (vec2, offset 0) - * `inTexCoord` (vec2, offset 8) - * - * This pipeline has a hard-coded batch size of 1 and a hard coded set of vertices. - */ - class UtilityPipeline extends Phaser.Renderer.WebGL.WebGLPipeline { - /** - * - * @param config The configuration options for this pipeline. - */ - constructor(config: Phaser.Types.Renderer.WebGL.WebGLPipelineConfig); - - /** - * A default Color Matrix, used by the Color Matrix Shader when one - * isn't provided. - */ - colorMatrix: Phaser.Display.ColorMatrix; - - /** - * A reference to the Copy Shader belonging to this Utility Pipeline. - * - * This property is set during the `boot` method. - */ - copyShader: Phaser.Renderer.WebGL.WebGLShader; - - /** - * A reference to the Additive Blend Shader belonging to this Utility Pipeline. - * - * This property is set during the `boot` method. - */ - addShader: Phaser.Renderer.WebGL.WebGLShader; - - /** - * A reference to the Linear Blend Shader belonging to this Utility Pipeline. - * - * This property is set during the `boot` method. - */ - linearShader: Phaser.Renderer.WebGL.WebGLShader; - - /** - * A reference to the Color Matrix Shader belonging to this Utility Pipeline. - * - * This property is set during the `boot` method. - */ - colorMatrixShader: Phaser.Renderer.WebGL.WebGLShader; - - /** - * A reference to the Full Frame 1 Render Target. - * - * This property is set during the `boot` method. - * - * This Render Target is the full size of the renderer. - * - * You can use this directly in Post FX Pipelines for multi-target effects. - * However, be aware that these targets are shared between all post fx pipelines. - */ - fullFrame1: Phaser.Renderer.WebGL.RenderTarget; - - /** - * A reference to the Full Frame 2 Render Target. - * - * This property is set during the `boot` method. - * - * This Render Target is the full size of the renderer. - * - * You can use this directly in Post FX Pipelines for multi-target effects. - * However, be aware that these targets are shared between all post fx pipelines. - */ - fullFrame2: Phaser.Renderer.WebGL.RenderTarget; - - /** - * A reference to the Half Frame 1 Render Target. - * - * This property is set during the `boot` method. - * - * This Render Target is half the size of the renderer. - * - * You can use this directly in Post FX Pipelines for multi-target effects. - * However, be aware that these targets are shared between all post fx pipelines. - */ - halfFrame1: Phaser.Renderer.WebGL.RenderTarget; - - /** - * A reference to the Half Frame 2 Render Target. - * - * This property is set during the `boot` method. - * - * This Render Target is half the size of the renderer. - * - * You can use this directly in Post FX Pipelines for multi-target effects. - * However, be aware that these targets are shared between all post fx pipelines. - */ - halfFrame2: Phaser.Renderer.WebGL.RenderTarget; - - /** - * Copy the `source` Render Target to the `target` Render Target. - * - * You can optionally set the brightness factor of the copy. - * - * The difference between this method and `drawFrame` is that this method - * uses a faster copy shader, where only the brightness can be modified. - * If you need color level manipulation, see `drawFrame` instead. - * @param source The source Render Target. - * @param target The target Render Target. - * @param brightness The brightness value applied to the frame copy. Default 1. - * @param clear Clear the target before copying? Default true. - * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. - */ - copyFrame(source: Phaser.Renderer.WebGL.RenderTarget, target?: Phaser.Renderer.WebGL.RenderTarget, brightness?: number, clear?: boolean, clearAlpha?: boolean): void; - - /** - * Copy the `source` Render Target to the `target` Render Target. - * - * The difference with this copy is that no resizing takes place. If the `source` - * Render Target is larger than the `target` then only a portion the same size as - * the `target` dimensions is copied across. - * - * You can optionally set the brightness factor of the copy. - * @param source The source Render Target. - * @param target The target Render Target. - * @param brightness The brightness value applied to the frame copy. Default 1. - * @param clear Clear the target before copying? Default true. - * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. - * @param eraseMode Erase source from target using ERASE Blend Mode? Default false. - * @param flipY Flip the UV on the Y axis before drawing? Default false. - */ - blitFrame(source: Phaser.Renderer.WebGL.RenderTarget, target: Phaser.Renderer.WebGL.RenderTarget, brightness?: number, clear?: boolean, clearAlpha?: boolean, eraseMode?: boolean, flipY?: boolean): void; - - /** - * Binds the `source` Render Target and then copies a section of it to the `target` Render Target. - * - * This method is extremely fast because it uses `gl.copyTexSubImage2D` and doesn't - * require the use of any shaders. Remember the coordinates are given in standard WebGL format, - * where x and y specify the lower-left corner of the section, not the top-left. Also, the - * copy entirely replaces the contents of the target texture, no 'merging' or 'blending' takes - * place. - * @param source The source Render Target. - * @param target The target Render Target. - * @param x The x coordinate of the lower left corner where to start copying. - * @param y The y coordinate of the lower left corner where to start copying. - * @param width The width of the texture. - * @param height The height of the texture. - * @param clear Clear the target before copying? Default true. - * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. - */ - copyFrameRect(source: Phaser.Renderer.WebGL.RenderTarget, target: Phaser.Renderer.WebGL.RenderTarget, x: number, y: number, width: number, height: number, clear?: boolean, clearAlpha?: boolean): void; - - /** - * Pops the framebuffer from the renderers FBO stack and sets that as the active target, - * then draws the `source` Render Target to it. It then resets the renderer textures. - * - * This should be done when you need to draw the _final_ results of a pipeline to the game - * canvas, or the next framebuffer in line on the FBO stack. You should only call this once - * in the `onDraw` handler and it should be the final thing called. Be careful not to call - * this if you need to actually use the pipeline shader, instead of the copy shader. In - * those cases, use the `bindAndDraw` method. - * @param source The Render Target to draw from. - */ - copyToGame(source: Phaser.Renderer.WebGL.RenderTarget): void; - - /** - * Copy the `source` Render Target to the `target` Render Target, using the - * given Color Matrix. - * - * The difference between this method and `copyFrame` is that this method - * uses a color matrix shader, where you have full control over the luminance - * values used during the copy. If you don't need this, you can use the faster - * `copyFrame` method instead. - * @param source The source Render Target. - * @param target The target Render Target. - * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. - * @param colorMatrix The Color Matrix to use when performing the draw. - */ - drawFrame(source: Phaser.Renderer.WebGL.RenderTarget, target?: Phaser.Renderer.WebGL.RenderTarget, clearAlpha?: boolean, colorMatrix?: Phaser.Display.ColorMatrix): void; - - /** - * Draws the `source1` and `source2` Render Targets to the `target` Render Target - * using a linear blend effect, which is controlled by the `strength` parameter. - * @param source1 The first source Render Target. - * @param source2 The second source Render Target. - * @param target The target Render Target. - * @param strength The strength of the blend. Default 1. - * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. - * @param blendShader The shader to use during the blend copy. - */ - blendFrames(source1: Phaser.Renderer.WebGL.RenderTarget, source2: Phaser.Renderer.WebGL.RenderTarget, target?: Phaser.Renderer.WebGL.RenderTarget, strength?: number, clearAlpha?: boolean, blendShader?: Phaser.Renderer.WebGL.WebGLShader): void; - - /** - * Draws the `source1` and `source2` Render Targets to the `target` Render Target - * using an additive blend effect, which is controlled by the `strength` parameter. - * @param source1 The first source Render Target. - * @param source2 The second source Render Target. - * @param target The target Render Target. - * @param strength The strength of the blend. Default 1. - * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. - */ - blendFramesAdditive(source1: Phaser.Renderer.WebGL.RenderTarget, source2: Phaser.Renderer.WebGL.RenderTarget, target?: Phaser.Renderer.WebGL.RenderTarget, strength?: number, clearAlpha?: boolean): void; - - /** - * Clears the given Render Target. - * @param target The Render Target to clear. - * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. - */ - clearFrame(target: Phaser.Renderer.WebGL.RenderTarget, clearAlpha?: boolean): void; - - /** - * Set the UV values for the 6 vertices that make up the quad used by the shaders - * in the Utility Pipeline. - * - * Be sure to call `resetUVs` once you have finished manipulating the UV coordinates. - * @param uA The u value of vertex A. - * @param vA The v value of vertex A. - * @param uB The u value of vertex B. - * @param vB The v value of vertex B. - * @param uC The u value of vertex C. - * @param vC The v value of vertex C. - * @param uD The u value of vertex D. - * @param vD The v value of vertex D. - */ - setUVs(uA: number, vA: number, uB: number, vB: number, uC: number, vC: number, uD: number, vD: number): void; - - /** - * Sets the vertex UV coordinates of the quad used by the shaders in the Utility Pipeline - * so that they correctly adjust the texture coordinates for a blit frame effect. - * - * Be sure to call `resetUVs` once you have finished manipulating the UV coordinates. - * @param source The source Render Target. - * @param target The target Render Target. - */ - setTargetUVs(source: Phaser.Renderer.WebGL.RenderTarget, target: Phaser.Renderer.WebGL.RenderTarget): void; - - /** - * Horizontally flips the UV coordinates of the quad used by the shaders in this - * Utility Pipeline. - * - * Be sure to call `resetUVs` once you have finished manipulating the UV coordinates. - */ - flipX(): void; - - /** - * Vertically flips the UV coordinates of the quad used by the shaders in this - * Utility Pipeline. - * - * Be sure to call `resetUVs` once you have finished manipulating the UV coordinates. - */ - flipY(): void; - - /** - * Resets the quad vertice UV values to their default settings. - * - * The quad is used by all shaders of the Utility Pipeline. - */ - resetUVs(): void; - - } - - } - /** * A Render Target encapsulates a WebGL framebuffer and the WebGL Texture that displays it. * @@ -86687,205 +85182,1534 @@ declare namespace Phaser { } + /** + * 8-bit twos complement signed integer. + */ + var BYTE: Phaser.Types.Renderer.WebGL.WebGLConst; + + /** + * 8-bit twos complement unsigned integer. + */ + var UNSIGNED_BYTE: Phaser.Types.Renderer.WebGL.WebGLConst; + + /** + * 16-bit twos complement signed integer. + */ + var SHORT: Phaser.Types.Renderer.WebGL.WebGLConst; + + /** + * 16-bit twos complement unsigned integer. + */ + var UNSIGNED_SHORT: Phaser.Types.Renderer.WebGL.WebGLConst; + + /** + * 32-bit twos complement signed integer. + */ + var INT: Phaser.Types.Renderer.WebGL.WebGLConst; + + /** + * 32-bit twos complement unsigned integer. + */ + var UNSIGNED_INT: Phaser.Types.Renderer.WebGL.WebGLConst; + + /** + * 32-bit IEEE floating point number. + */ + var FLOAT: Phaser.Types.Renderer.WebGL.WebGLConst; + + namespace Pipelines { + /** + * The Bitmap Mask Pipeline handles all of the bitmap mask rendering in WebGL for applying + * alpha masks to Game Objects. It works by sampling two texture on the fragment shader and + * using the fragments alpha to clip the region. + * + * The fragment shader it uses can be found in `shaders/src/BitmapMask.frag`. + * The vertex shader it uses can be found in `shaders/src/BitmapMask.vert`. + * + * The default shader attributes for this pipeline are: + * + * `inPosition` (vec2, offset 0) + * + * The default shader uniforms for this pipeline are: + * + * `uResolution` (vec2) + * `uMainSampler` (sampler2D) + * `uMaskSampler` (sampler2D) + * `uInvertMaskAlpha` (bool) + */ + class BitmapMaskPipeline extends Phaser.Renderer.WebGL.WebGLPipeline { + /** + * + * @param config The configuration options for this pipeline. + */ + constructor(config: Phaser.Types.Renderer.WebGL.WebGLPipelineConfig); + + /** + * Binds necessary resources and renders the mask to a separated framebuffer. + * The framebuffer for the masked object is also bound for further use. + * @param mask GameObject used as mask. + * @param maskedObject GameObject masked by the mask GameObject. + * @param camera The camera rendering the current mask. + */ + beginMask(mask: Phaser.GameObjects.GameObject, maskedObject: Phaser.GameObjects.GameObject, camera: Phaser.Cameras.Scene2D.Camera): void; + + /** + * The masked game objects framebuffer is unbound and its texture + * is bound together with the mask texture and the mask shader and + * a draw call with a single quad is processed. Here is where the + * masking effect is applied. + * @param mask GameObject used as a mask. + */ + endMask(mask: Phaser.GameObjects.GameObject): void; + + } + + /** + * The Light Pipeline is an extension of the Multi Pipeline and uses a custom shader + * designed to handle forward diffused rendering of 2D lights in a Scene. + * + * The shader works in tandem with Light Game Objects, and optionally texture normal maps, + * to provide an ambient illumination effect. + * + * If you wish to provide your own shader, you can use the `%LIGHT_COUNT%` declaration in the source, + * and it will be automatically replaced at run-time with the total number of configured lights. + * + * The maximum number of lights can be set in the Render Config `maxLights` property and defaults to 10. + * + * Prior to Phaser v3.50 this pipeline was called the `ForwardDiffuseLightPipeline`. + * + * The fragment shader it uses can be found in `shaders/src/Light.frag`. + * The vertex shader it uses can be found in `shaders/src/Multi.vert`. + * + * The default shader attributes for this pipeline are: + * + * `inPosition` (vec2, offset 0) + * `inTexCoord` (vec2, offset 8) + * `inTexId` (float, offset 16) + * `inTintEffect` (float, offset 20) + * `inTint` (vec4, offset 24, normalized) + * + * The default shader uniforms for this pipeline are those from the Multi Pipeline, plus: + * + * `uMainSampler` (sampler2D) + * `uNormSampler` (sampler2D) + * `uCamera` (vec4) + * `uResolution` (vec2) + * `uAmbientLightColor` (vec3) + * `uInverseRotationMatrix` (mat3) + * `uLights` (Light struct) + */ + class LightPipeline extends Phaser.Renderer.WebGL.Pipelines.MultiPipeline { + /** + * + * @param config The configuration options for this pipeline. + */ + constructor(config: Phaser.Types.Renderer.WebGL.WebGLPipelineConfig); + + /** + * Stores a default normal map, which is an object with a `glTexture` property that + * maps to a 1x1 texture of the color #7f7fff created in the `boot` method. + */ + defaultNormalMap: object; + + /** + * A boolean that is set automatically during `onRender` that determines + * if the Scene LightManager is active, or not. + */ + readonly lightsActive: boolean; + + /** + * Called when the Game has fully booted and the Renderer has finished setting up. + * + * By this stage all Game level systems are now in place and you can perform any final + * tasks that the pipeline may need that relied on game systems such as the Texture Manager. + */ + boot(): void; + + /** + * Rotates the normal map vectors inversely by the given angle. + * Only works in 2D space. + * @param rotation The angle of rotation in radians. + */ + setNormalMapRotation(rotation: number): void; + + /** + * Returns the normal map WebGLTexture from the given Game Object. + * If the Game Object doesn't have one, it returns the default normal map from this pipeline instead. + * @param gameObject The Game Object to get the normal map from. + */ + getNormalMap(gameObject?: Phaser.GameObjects.GameObject): WebGLTexture; + + /** + * Takes a Sprite Game Object, or any object that extends it, and adds it to the batch. + * @param gameObject The texture based Game Object to add to the batch. + * @param camera The Camera to use for the rendering transform. + * @param parentTransformMatrix The transform matrix of the parent container, if set. + */ + batchSprite(gameObject: Phaser.GameObjects.Image | Phaser.GameObjects.Sprite, camera: Phaser.Cameras.Scene2D.Camera, parentTransformMatrix?: Phaser.GameObjects.Components.TransformMatrix): void; + + /** + * Generic function for batching a textured quad using argument values instead of a Game Object. + * @param gameObject Source GameObject. + * @param texture Raw WebGLTexture associated with the quad. + * @param textureWidth Real texture width. + * @param textureHeight Real texture height. + * @param srcX X coordinate of the quad. + * @param srcY Y coordinate of the quad. + * @param srcWidth Width of the quad. + * @param srcHeight Height of the quad. + * @param scaleX X component of scale. + * @param scaleY Y component of scale. + * @param rotation Rotation of the quad. + * @param flipX Indicates if the quad is horizontally flipped. + * @param flipY Indicates if the quad is vertically flipped. + * @param scrollFactorX By which factor is the quad affected by the camera horizontal scroll. + * @param scrollFactorY By which factor is the quad effected by the camera vertical scroll. + * @param displayOriginX Horizontal origin in pixels. + * @param displayOriginY Vertical origin in pixels. + * @param frameX X coordinate of the texture frame. + * @param frameY Y coordinate of the texture frame. + * @param frameWidth Width of the texture frame. + * @param frameHeight Height of the texture frame. + * @param tintTL Tint for top left. + * @param tintTR Tint for top right. + * @param tintBL Tint for bottom left. + * @param tintBR Tint for bottom right. + * @param tintEffect The tint effect. + * @param uOffset Horizontal offset on texture coordinate. + * @param vOffset Vertical offset on texture coordinate. + * @param camera Current used camera. + * @param parentTransformMatrix Parent container. + * @param skipFlip Skip the renderTexture check. Default false. + * @param textureUnit Use the currently bound texture unit? + */ + batchTexture(gameObject: Phaser.GameObjects.GameObject, texture: WebGLTexture, textureWidth: number, textureHeight: number, srcX: number, srcY: number, srcWidth: number, srcHeight: number, scaleX: number, scaleY: number, rotation: number, flipX: boolean, flipY: boolean, scrollFactorX: number, scrollFactorY: number, displayOriginX: number, displayOriginY: number, frameX: number, frameY: number, frameWidth: number, frameHeight: number, tintTL: number, tintTR: number, tintBL: number, tintBR: number, tintEffect: number, uOffset: number, vOffset: number, camera: Phaser.Cameras.Scene2D.Camera, parentTransformMatrix: Phaser.GameObjects.Components.TransformMatrix, skipFlip?: boolean, textureUnit?: number): void; + + /** + * Adds a Texture Frame into the batch for rendering. + * @param frame The Texture Frame to be rendered. + * @param x The horizontal position to render the texture at. + * @param y The vertical position to render the texture at. + * @param tint The tint color. + * @param alpha The alpha value. + * @param transformMatrix The Transform Matrix to use for the texture. + * @param parentTransformMatrix A parent Transform Matrix. + */ + batchTextureFrame(frame: Phaser.Textures.Frame, x: number, y: number, tint: number, alpha: number, transformMatrix: Phaser.GameObjects.Components.TransformMatrix, parentTransformMatrix?: Phaser.GameObjects.Components.TransformMatrix): void; + + } + + /** + * The Multi Pipeline is the core 2D texture rendering pipeline used by Phaser in WebGL. + * Virtually all Game Objects use this pipeline by default, including Sprites, Graphics + * and Tilemaps. It handles the batching of quads and tris, as well as methods for + * drawing and batching geometry data. + * + * Prior to Phaser v3.50 this pipeline was called the `TextureTintPipeline`. + * + * In previous versions of Phaser only one single texture unit was supported at any one time. + * The Multi Pipeline is an evolution of the old Texture Tint Pipeline, updated to support + * multi-textures for increased performance. + * + * The fragment shader it uses can be found in `shaders/src/Multi.frag`. + * The vertex shader it uses can be found in `shaders/src/Multi.vert`. + * + * The default shader attributes for this pipeline are: + * + * `inPosition` (vec2, offset 0) + * `inTexCoord` (vec2, offset 8) + * `inTexId` (float, offset 16) + * `inTintEffect` (float, offset 20) + * `inTint` (vec4, offset 24, normalized) + * + * The default shader uniforms for this pipeline are: + * + * `uProjectionMatrix` (mat4) + * `uMainSampler` (sampler2D array) + * + * If you wish to create a custom pipeline extending from this one, you should use the string + * declaration `%count%` in your fragment shader source, which is used to set the number of + * `sampler2Ds` available. Also add `%getSampler%` so Phaser can inject the getSampler glsl function. + * This function can be used to get the pixel vec4 from the texture: + * + * `vec4 texture = getSampler(int(outTexId), outTexCoord);` + * + * This pipeline will automatically inject the getSampler function for you, should the value exist + * in your shader source. If you wish to handle this yourself, you can also use the + * function `Utils.parseFragmentShaderMaxTextures`. + * + * If you wish to create a pipeline that works from a single texture, or that doesn't have + * internal texture iteration, please see the `SinglePipeline` instead. + */ + class MultiPipeline extends Phaser.Renderer.WebGL.WebGLPipeline { + /** + * + * @param config The configuration options for this pipeline. + */ + constructor(config: Phaser.Types.Renderer.WebGL.WebGLPipelineConfig); + + /** + * A temporary Transform Matrix, re-used internally during batching by the + * Shape Game Objects. + */ + calcMatrix: Phaser.GameObjects.Components.TransformMatrix; + + /** + * Called every time the pipeline is bound by the renderer. + * Sets the shader program, vertex buffer and other resources. + * Should only be called when changing pipeline. + */ + bind(): this; + + /** + * Takes a Sprite Game Object, or any object that extends it, and adds it to the batch. + * @param gameObject The texture based Game Object to add to the batch. + * @param camera The Camera to use for the rendering transform. + * @param parentTransformMatrix The transform matrix of the parent container, if set. + */ + batchSprite(gameObject: Phaser.GameObjects.Image | Phaser.GameObjects.Sprite, camera: Phaser.Cameras.Scene2D.Camera, parentTransformMatrix?: Phaser.GameObjects.Components.TransformMatrix): void; + + /** + * Generic function for batching a textured quad using argument values instead of a Game Object. + * @param gameObject Source GameObject. + * @param texture Raw WebGLTexture associated with the quad. + * @param textureWidth Real texture width. + * @param textureHeight Real texture height. + * @param srcX X coordinate of the quad. + * @param srcY Y coordinate of the quad. + * @param srcWidth Width of the quad. + * @param srcHeight Height of the quad. + * @param scaleX X component of scale. + * @param scaleY Y component of scale. + * @param rotation Rotation of the quad. + * @param flipX Indicates if the quad is horizontally flipped. + * @param flipY Indicates if the quad is vertically flipped. + * @param scrollFactorX By which factor is the quad affected by the camera horizontal scroll. + * @param scrollFactorY By which factor is the quad effected by the camera vertical scroll. + * @param displayOriginX Horizontal origin in pixels. + * @param displayOriginY Vertical origin in pixels. + * @param frameX X coordinate of the texture frame. + * @param frameY Y coordinate of the texture frame. + * @param frameWidth Width of the texture frame. + * @param frameHeight Height of the texture frame. + * @param tintTL Tint for top left. + * @param tintTR Tint for top right. + * @param tintBL Tint for bottom left. + * @param tintBR Tint for bottom right. + * @param tintEffect The tint effect. + * @param uOffset Horizontal offset on texture coordinate. + * @param vOffset Vertical offset on texture coordinate. + * @param camera Current used camera. + * @param parentTransformMatrix Parent container. + * @param skipFlip Skip the renderTexture check. Default false. + * @param textureUnit Use the currently bound texture unit? + */ + batchTexture(gameObject: Phaser.GameObjects.GameObject, texture: WebGLTexture, textureWidth: number, textureHeight: number, srcX: number, srcY: number, srcWidth: number, srcHeight: number, scaleX: number, scaleY: number, rotation: number, flipX: boolean, flipY: boolean, scrollFactorX: number, scrollFactorY: number, displayOriginX: number, displayOriginY: number, frameX: number, frameY: number, frameWidth: number, frameHeight: number, tintTL: number, tintTR: number, tintBL: number, tintBR: number, tintEffect: number, uOffset: number, vOffset: number, camera: Phaser.Cameras.Scene2D.Camera, parentTransformMatrix: Phaser.GameObjects.Components.TransformMatrix, skipFlip?: boolean, textureUnit?: number): void; + + /** + * Adds a Texture Frame into the batch for rendering. + * @param frame The Texture Frame to be rendered. + * @param x The horizontal position to render the texture at. + * @param y The vertical position to render the texture at. + * @param tint The tint color. + * @param alpha The alpha value. + * @param transformMatrix The Transform Matrix to use for the texture. + * @param parentTransformMatrix A parent Transform Matrix. + */ + batchTextureFrame(frame: Phaser.Textures.Frame, x: number, y: number, tint: number, alpha: number, transformMatrix: Phaser.GameObjects.Components.TransformMatrix, parentTransformMatrix?: Phaser.GameObjects.Components.TransformMatrix): void; + + /** + * Pushes a filled rectangle into the vertex batch. + * + * Rectangle factors in the given transform matrices before adding to the batch. + * @param x Horizontal top left coordinate of the rectangle. + * @param y Vertical top left coordinate of the rectangle. + * @param width Width of the rectangle. + * @param height Height of the rectangle. + * @param currentMatrix The current transform. + * @param parentMatrix The parent transform. + */ + batchFillRect(x: number, y: number, width: number, height: number, currentMatrix: Phaser.GameObjects.Components.TransformMatrix, parentMatrix: Phaser.GameObjects.Components.TransformMatrix): void; + + /** + * Pushes a filled triangle into the vertex batch. + * + * Triangle factors in the given transform matrices before adding to the batch. + * @param x0 Point 0 x coordinate. + * @param y0 Point 0 y coordinate. + * @param x1 Point 1 x coordinate. + * @param y1 Point 1 y coordinate. + * @param x2 Point 2 x coordinate. + * @param y2 Point 2 y coordinate. + * @param currentMatrix The current transform. + * @param parentMatrix The parent transform. + */ + batchFillTriangle(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, currentMatrix: Phaser.GameObjects.Components.TransformMatrix, parentMatrix: Phaser.GameObjects.Components.TransformMatrix): void; + + /** + * Pushes a stroked triangle into the vertex batch. + * + * Triangle factors in the given transform matrices before adding to the batch. + * + * The triangle is created from 3 lines and drawn using the `batchStrokePath` method. + * @param x0 Point 0 x coordinate. + * @param y0 Point 0 y coordinate. + * @param x1 Point 1 x coordinate. + * @param y1 Point 1 y coordinate. + * @param x2 Point 2 x coordinate. + * @param y2 Point 2 y coordinate. + * @param lineWidth The width of the line in pixels. + * @param currentMatrix The current transform. + * @param parentMatrix The parent transform. + */ + batchStrokeTriangle(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, lineWidth: number, currentMatrix: Phaser.GameObjects.Components.TransformMatrix, parentMatrix: Phaser.GameObjects.Components.TransformMatrix): void; + + /** + * Adds the given path to the vertex batch for rendering. + * + * It works by taking the array of path data and then passing it through Earcut, which + * creates a list of polygons. Each polygon is then added to the batch. + * + * The path is always automatically closed because it's filled. + * @param path Collection of points that represent the path. + * @param currentMatrix The current transform. + * @param parentMatrix The parent transform. + */ + batchFillPath(path: Phaser.Types.Math.Vector2Like[], currentMatrix: Phaser.GameObjects.Components.TransformMatrix, parentMatrix: Phaser.GameObjects.Components.TransformMatrix): void; + + /** + * Adds the given path to the vertex batch for rendering. + * + * It works by taking the array of path data and calling `batchLine` for each section + * of the path. + * + * The path is optionally closed at the end. + * @param path Collection of points that represent the path. + * @param lineWidth The width of the line segments in pixels. + * @param pathOpen Indicates if the path should be closed or left open. + * @param currentMatrix The current transform. + * @param parentMatrix The parent transform. + */ + batchStrokePath(path: Phaser.Types.Math.Vector2Like[], lineWidth: number, pathOpen: boolean, currentMatrix: Phaser.GameObjects.Components.TransformMatrix, parentMatrix: Phaser.GameObjects.Components.TransformMatrix): void; + + /** + * Creates a line out of 4 quads and adds it to the vertex batch based on the given line values. + * @param ax x coordinate of the start of the line. + * @param ay y coordinate of the start of the line. + * @param bx x coordinate of the end of the line. + * @param by y coordinate of the end of the line. + * @param aLineWidth Width of the start of the line. + * @param bLineWidth Width of the end of the line. + * @param index If this line is part of a multi-line draw, the index of the line in the draw. + * @param closePath Does this line close a multi-line path? + * @param currentMatrix The current transform. + * @param parentMatrix The parent transform. + */ + batchLine(ax: number, ay: number, bx: number, by: number, aLineWidth: number, bLineWidth: number, index: number, closePath: boolean, currentMatrix: Phaser.GameObjects.Components.TransformMatrix, parentMatrix: Phaser.GameObjects.Components.TransformMatrix): void; + + } + + /** + * The Point Light Pipeline handles rendering the Point Light Game Objects in WebGL. + * + * The fragment shader it uses can be found in `shaders/src/PointLight.frag`. + * The vertex shader it uses can be found in `shaders/src/PointLight.vert`. + * + * The default shader attributes for this pipeline are: + * + * `inPosition` (vec2) + * `inLightPosition` (vec2) + * `inLightRadius` (float) + * `inLightAttenuation` (float) + * `inLightColor` (vec4) + * + * The default shader uniforms for this pipeline are: + * + * `uProjectionMatrix` (mat4) + * `uResolution` (vec2) + * `uCameraZoom` (sampler2D) + */ + class PointLightPipeline extends Phaser.Renderer.WebGL.WebGLPipeline { + /** + * + * @param config The configuration options for this pipeline. + */ + constructor(config: Phaser.Types.Renderer.WebGL.WebGLPipelineConfig); + + /** + * Adds a Point Light Game Object to the batch, flushing if required. + * @param light The Point Light Game Object. + * @param camera The camera rendering the Point Light. + * @param x0 The top-left x position. + * @param y0 The top-left y position. + * @param x1 The bottom-left x position. + * @param y1 The bottom-left y position. + * @param x2 The bottom-right x position. + * @param y2 The bottom-right y position. + * @param x3 The top-right x position. + * @param y3 The top-right y position. + * @param lightX The horizontal center of the light. + * @param lightY The vertical center of the light. + */ + batchPointLight(light: Phaser.GameObjects.PointLight, camera: Phaser.Cameras.Scene2D.Camera, x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, lightX: number, lightY: number): void; + + /** + * Adds a single Point Light vertex to the current vertex buffer and increments the + * `vertexCount` property by 1. + * + * This method is called directly by `batchPointLight`. + * @param x The vertex x position. + * @param y The vertex y position. + * @param lightX The horizontal center of the light. + * @param lightY The vertical center of the light. + * @param radius The radius of the light. + * @param attenuation The attenuation of the light. + * @param r The red color channel of the light. + * @param g The green color channel of the light. + * @param b The blue color channel of the light. + * @param a The alpha color channel of the light. + */ + batchLightVert(x: number, y: number, lightX: number, lightY: number, radius: number, attenuation: number, r: number, g: number, b: number, a: number): void; + + } + + /** + * The Post FX Pipeline is a special kind of pipeline specifically for handling post + * processing effects. Where-as a standard Pipeline allows you to control the process + * of rendering Game Objects by configuring the shaders and attributes used to draw them, + * a Post FX Pipeline is designed to allow you to apply processing _after_ the Game Object/s + * have been rendered. Typical examples of post processing effects are bloom filters, + * blurs, light effects and color manipulation. + * + * The pipeline works by creating a tiny vertex buffer with just one single hard-coded quad + * in it. Game Objects can have a Post Pipeline set on them. Those objects are then rendered + * using their standard pipeline, but are redirected to the Render Targets owned by the + * post pipeline, which can then apply their own shaders and effects, before passing them + * back to the main renderer. + * + * Please see the Phaser 3 examples for further details on this extensive subject. + * + * The default fragment shader it uses can be found in `shaders/src/PostFX.frag`. + * The default vertex shader it uses can be found in `shaders/src/Quad.vert`. + * + * The default shader attributes for this pipeline are: + * + * `inPosition` (vec2, offset 0) + * `inTexCoord` (vec2, offset 8) + * + * The vertices array layout is: + * + * -1, 1 B----C 1, 1 + * 0, 1 | /| 1, 1 + * | / | + * | / | + * |/ | + * -1, -1 A----D 1, -1 + * 0, 0 1, 0 + * + * A = -1, -1 (pos) and 0, 0 (uv) + * B = -1, 1 (pos) and 0, 1 (uv) + * C = 1, 1 (pos) and 1, 1 (uv) + * D = 1, -1 (pos) and 1, 0 (uv) + * + * First tri: A, B, C + * Second tri: A, C, D + * + * Array index: + * + * 0 = Tri 1 - Vert A - x pos + * 1 = Tri 1 - Vert A - y pos + * 2 = Tri 1 - Vert A - uv u + * 3 = Tri 1 - Vert A - uv v + * + * 4 = Tri 1 - Vert B - x pos + * 5 = Tri 1 - Vert B - y pos + * 6 = Tri 1 - Vert B - uv u + * 7 = Tri 1 - Vert B - uv v + * + * 8 = Tri 1 - Vert C - x pos + * 9 = Tri 1 - Vert C - y pos + * 10 = Tri 1 - Vert C - uv u + * 11 = Tri 1 - Vert C - uv v + * + * 12 = Tri 2 - Vert A - x pos + * 13 = Tri 2 - Vert A - y pos + * 14 = Tri 2 - Vert A - uv u + * 15 = Tri 2 - Vert A - uv v + * + * 16 = Tri 2 - Vert C - x pos + * 17 = Tri 2 - Vert C - y pos + * 18 = Tri 2 - Vert C - uv u + * 19 = Tri 2 - Vert C - uv v + * + * 20 = Tri 2 - Vert D - x pos + * 21 = Tri 2 - Vert D - y pos + * 22 = Tri 2 - Vert D - uv u + * 23 = Tri 2 - Vert D - uv v + */ + class PostFXPipeline extends Phaser.Renderer.WebGL.WebGLPipeline { + /** + * + * @param config The configuration options for this pipeline. + */ + constructor(config: Phaser.Types.Renderer.WebGL.WebGLPipelineConfig); + + /** + * If this post-pipeline belongs to a Game Object or Camera, this contains a reference to it. + */ + gameObject: Phaser.GameObjects.GameObject; + + /** + * A Color Matrix instance belonging to this pipeline. + * + * Used during calls to the `drawFrame` method. + */ + colorMatrix: Phaser.Display.ColorMatrix; + + /** + * A reference to the Full Frame 1 Render Target that belongs to the + * Utility Pipeline. This property is set during the `boot` method. + * + * This Render Target is the full size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + */ + fullFrame1: Phaser.Renderer.WebGL.RenderTarget; + + /** + * A reference to the Full Frame 2 Render Target that belongs to the + * Utility Pipeline. This property is set during the `boot` method. + * + * This Render Target is the full size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + */ + fullFrame2: Phaser.Renderer.WebGL.RenderTarget; + + /** + * A reference to the Half Frame 1 Render Target that belongs to the + * Utility Pipeline. This property is set during the `boot` method. + * + * This Render Target is half the size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + */ + halfFrame1: Phaser.Renderer.WebGL.RenderTarget; + + /** + * A reference to the Half Frame 2 Render Target that belongs to the + * Utility Pipeline. This property is set during the `boot` method. + * + * This Render Target is half the size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + */ + halfFrame2: Phaser.Renderer.WebGL.RenderTarget; + + /** + * Copy the `source` Render Target to the `target` Render Target. + * + * You can optionally set the brightness factor of the copy. + * + * The difference between this method and `drawFrame` is that this method + * uses a faster copy shader, where only the brightness can be modified. + * If you need color level manipulation, see `drawFrame` instead. + * @param source The source Render Target. + * @param target The target Render Target. + * @param brightness The brightness value applied to the frame copy. Default 1. + * @param clear Clear the target before copying? Default true. + * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. + */ + copyFrame(source: Phaser.Renderer.WebGL.RenderTarget, target?: Phaser.Renderer.WebGL.RenderTarget, brightness?: number, clear?: boolean, clearAlpha?: boolean): void; + + /** + * Pops the framebuffer from the renderers FBO stack and sets that as the active target, + * then draws the `source` Render Target to it. It then resets the renderer textures. + * + * This should be done when you need to draw the _final_ results of a pipeline to the game + * canvas, or the next framebuffer in line on the FBO stack. You should only call this once + * in the `onDraw` handler and it should be the final thing called. Be careful not to call + * this if you need to actually use the pipeline shader, instead of the copy shader. In + * those cases, use the `bindAndDraw` method. + * @param source The Render Target to draw from. + */ + copyToGame(source: Phaser.Renderer.WebGL.RenderTarget): void; + + /** + * Copy the `source` Render Target to the `target` Render Target, using the + * given Color Matrix. + * + * The difference between this method and `copyFrame` is that this method + * uses a color matrix shader, where you have full control over the luminance + * values used during the copy. If you don't need this, you can use the faster + * `copyFrame` method instead. + * @param source The source Render Target. + * @param target The target Render Target. + * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. + */ + drawFrame(source: Phaser.Renderer.WebGL.RenderTarget, target?: Phaser.Renderer.WebGL.RenderTarget, clearAlpha?: boolean): void; + + /** + * Draws the `source1` and `source2` Render Targets to the `target` Render Target + * using a linear blend effect, which is controlled by the `strength` parameter. + * @param source1 The first source Render Target. + * @param source2 The second source Render Target. + * @param target The target Render Target. + * @param strength The strength of the blend. Default 1. + * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. + */ + blendFrames(source1: Phaser.Renderer.WebGL.RenderTarget, source2: Phaser.Renderer.WebGL.RenderTarget, target?: Phaser.Renderer.WebGL.RenderTarget, strength?: number, clearAlpha?: boolean): void; + + /** + * Draws the `source1` and `source2` Render Targets to the `target` Render Target + * using an additive blend effect, which is controlled by the `strength` parameter. + * @param source1 The first source Render Target. + * @param source2 The second source Render Target. + * @param target The target Render Target. + * @param strength The strength of the blend. Default 1. + * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. + */ + blendFramesAdditive(source1: Phaser.Renderer.WebGL.RenderTarget, source2: Phaser.Renderer.WebGL.RenderTarget, target?: Phaser.Renderer.WebGL.RenderTarget, strength?: number, clearAlpha?: boolean): void; + + /** + * Clears the given Render Target. + * @param target The Render Target to clear. + * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. + */ + clearFrame(target: Phaser.Renderer.WebGL.RenderTarget, clearAlpha?: boolean): void; + + /** + * Copy the `source` Render Target to the `target` Render Target. + * + * The difference with this copy is that no resizing takes place. If the `source` + * Render Target is larger than the `target` then only a portion the same size as + * the `target` dimensions is copied across. + * + * You can optionally set the brightness factor of the copy. + * @param source The source Render Target. + * @param target The target Render Target. + * @param brightness The brightness value applied to the frame copy. Default 1. + * @param clear Clear the target before copying? Default true. + * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. + * @param eraseMode Erase source from target using ERASE Blend Mode? Default false. + */ + blitFrame(source: Phaser.Renderer.WebGL.RenderTarget, target: Phaser.Renderer.WebGL.RenderTarget, brightness?: number, clear?: boolean, clearAlpha?: boolean, eraseMode?: boolean): void; + + /** + * Binds the `source` Render Target and then copies a section of it to the `target` Render Target. + * + * This method is extremely fast because it uses `gl.copyTexSubImage2D` and doesn't + * require the use of any shaders. Remember the coordinates are given in standard WebGL format, + * where x and y specify the lower-left corner of the section, not the top-left. Also, the + * copy entirely replaces the contents of the target texture, no 'merging' or 'blending' takes + * place. + * @param source The source Render Target. + * @param target The target Render Target. + * @param x The x coordinate of the lower left corner where to start copying. + * @param y The y coordinate of the lower left corner where to start copying. + * @param width The width of the texture. + * @param height The height of the texture. + * @param clear Clear the target before copying? Default true. + * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. + */ + copyFrameRect(source: Phaser.Renderer.WebGL.RenderTarget, target: Phaser.Renderer.WebGL.RenderTarget, x: number, y: number, width: number, height: number, clear?: boolean, clearAlpha?: boolean): void; + + /** + * Binds this pipeline and draws the `source` Render Target to the `target` Render Target. + * + * If no `target` is specified, it will pop the framebuffer from the Renderers FBO stack + * and use that instead, which should be done when you need to draw the final results of + * this pipeline to the game canvas. + * + * You can optionally set the shader to be used for the draw here, if this is a multi-shader + * pipeline. By default `currentShader` will be used. If you need to set a shader but not + * a target, just pass `null` as the `target` parameter. + * @param source The Render Target to draw from. + * @param target The Render Target to draw to. If not set, it will pop the fbo from the stack. + * @param clear Clear the target before copying? Only used if `target` parameter is set. Default true. + * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. + * @param currentShader The shader to use during the draw. + */ + bindAndDraw(source: Phaser.Renderer.WebGL.RenderTarget, target?: Phaser.Renderer.WebGL.RenderTarget, clear?: boolean, clearAlpha?: boolean, currentShader?: Phaser.Renderer.WebGL.WebGLShader): void; + + } + + /** + * The Rope Pipeline is a variation of the Multi Pipeline that uses a `TRIANGLE_STRIP` for + * its topology, instead of TRIANGLES. This is primarily used by the Rope Game Object, + * or anything that extends it. + * + * Prior to Phaser v3.50 this pipeline was called the `TextureTintStripPipeline`. + * + * The fragment shader it uses can be found in `shaders/src/Multi.frag`. + * The vertex shader it uses can be found in `shaders/src/Multi.vert`. + * + * The default shader attributes for this pipeline are: + * + * `inPosition` (vec2, offset 0) + * `inTexCoord` (vec2, offset 8) + * `inTexId` (float, offset 16) + * `inTintEffect` (float, offset 20) + * `inTint` (vec4, offset 24, normalized) + * + * The default shader uniforms for this pipeline are: + * + * `uProjectionMatrix` (mat4) + * `uMainSampler` (sampler2D array) + * + * The pipeline is structurally identical to the Multi Pipeline and should be treated as such. + */ + class RopePipeline extends Phaser.Renderer.WebGL.Pipelines.MultiPipeline { + /** + * + * @param config The configuration options for this pipeline. + */ + constructor(config: Phaser.Types.Renderer.WebGL.WebGLPipelineConfig); + + } + + /** + * The Single Pipeline is a special version of the Multi Pipeline that only ever + * uses one texture, bound to texture unit zero. Although not as efficient as the + * Multi Pipeline, it provides an easier way to create custom pipelines that only require + * a single bound texture. + * + * Prior to Phaser v3.50 this pipeline didn't exist, but could be compared to the old `TextureTintPipeline`. + * + * The fragment shader it uses can be found in `shaders/src/Single.frag`. + * The vertex shader it uses can be found in `shaders/src/Single.vert`. + * + * The default shader attributes for this pipeline are: + * + * `inPosition` (vec2, offset 0) + * `inTexCoord` (vec2, offset 8) + * `inTexId` (float, offset 16) - this value is always zero in the Single Pipeline + * `inTintEffect` (float, offset 20) + * `inTint` (vec4, offset 24, normalized) + * + * The default shader uniforms for this pipeline are: + * + * `uProjectionMatrix` (mat4) + * `uMainSampler` (sampler2D) + */ + class SinglePipeline extends Phaser.Renderer.WebGL.Pipelines.MultiPipeline { + /** + * + * @param config The configuration options for this pipeline. + */ + constructor(config: Phaser.Types.Renderer.WebGL.WebGLPipelineConfig); + + } + + /** + * The SpriteFX Pipeline is a special kind of pipeline designed specifically for applying + * special effects to Sprites. Where-as the Post FX Pipeline applies an effect _after_ the + * object has been rendered, the Sprite FX Pipeline allows you to control the rendering of + * the object itself - passing it off to its own texture where multi-buffer compositing + * can take place. + * + * You can only use the SpriteFX Pipeline on the following types of Game Objects, or those + * that extend from them: + * + * Sprite + * Image + * Text + * TileSprite + * RenderTexture + * + * // TODO - Explain about the fbos and functions + */ + class SpriteFXPipeline extends Phaser.Renderer.WebGL.WebGLPipeline { + /** + * + * @param config The configuration options for this pipeline. + */ + constructor(config: Phaser.Types.Renderer.WebGL.WebGLPipelineConfig); + + /** + * A reference to the Draw Sprite Shader belonging to this Pipeline. + * + * This shader is used when the sprite is drawn to this fbo (or to the game if drawToFrame is false) + * + * This property is set during the `boot` method. + */ + drawSpriteShader: Phaser.Renderer.WebGL.WebGLShader; + + /** + * A reference to the Copy Shader belonging to this Pipeline. + * + * This shader is used when you call the `copySprite` method. + * + * This property is set during the `boot` method. + */ + copyShader: Phaser.Renderer.WebGL.WebGLShader; + + /** + * A reference to the Game Draw Shader belonging to this Pipeline. + * + * This shader draws the fbo to the game. + * + * This property is set during the `boot` method. + */ + gameShader: Phaser.Renderer.WebGL.WebGLShader; + + /** + * Raw byte buffer of vertices used specifically during the copySprite method. + */ + readonly quadVertexData: ArrayBuffer; + + /** + * The WebGLBuffer that holds the quadVertexData. + */ + readonly quadVertexBuffer: WebGLBuffer; + + /** + * Float32 view of the quad array buffer. + */ + quadVertexViewF32: Float32Array; + + /** + * The full-screen Render Target that the sprite is first drawn to. + */ + fsTarget: Phaser.Renderer.WebGL.RenderTarget; + + /** + * Handles the resizing of the quad vertex data. + * @param width The new width of the quad. + * @param height The new height of the quad. + */ + onResize(width: number, height: number): void; + + /** + * Takes a Sprite Game Object, or any object that extends it, and renders it via this pipeline. + * + * this method is a proxy for the MultiPipeline method of the same name. The actual rendering + * is redirected through to the `batchQuad` method in this pipeline. + * @param gameObject The texture based Game Object to add to the batch. + * @param camera The Camera to use for the rendering transform. + * @param parentTransformMatrix The transform matrix of the parent container, if set. + */ + batchSprite(gameObject: Phaser.GameObjects.Image | Phaser.GameObjects.Sprite, camera: Phaser.Cameras.Scene2D.Camera, parentTransformMatrix?: Phaser.GameObjects.Components.TransformMatrix): void; + + /** + * Generic function for batching a textured quad using argument values instead of a Game Object. + * @param gameObject Source GameObject. + * @param texture Raw WebGLTexture associated with the quad. + * @param textureWidth Real texture width. + * @param textureHeight Real texture height. + * @param srcX X coordinate of the quad. + * @param srcY Y coordinate of the quad. + * @param srcWidth Width of the quad. + * @param srcHeight Height of the quad. + * @param scaleX X component of scale. + * @param scaleY Y component of scale. + * @param rotation Rotation of the quad. + * @param flipX Indicates if the quad is horizontally flipped. + * @param flipY Indicates if the quad is vertically flipped. + * @param scrollFactorX By which factor is the quad affected by the camera horizontal scroll. + * @param scrollFactorY By which factor is the quad effected by the camera vertical scroll. + * @param displayOriginX Horizontal origin in pixels. + * @param displayOriginY Vertical origin in pixels. + * @param frameX X coordinate of the texture frame. + * @param frameY Y coordinate of the texture frame. + * @param frameWidth Width of the texture frame. + * @param frameHeight Height of the texture frame. + * @param tintTL Tint for top left. + * @param tintTR Tint for top right. + * @param tintBL Tint for bottom left. + * @param tintBR Tint for bottom right. + * @param tintEffect The tint effect. + * @param uOffset Horizontal offset on texture coordinate. + * @param vOffset Vertical offset on texture coordinate. + * @param camera Current used camera. + * @param parentTransformMatrix Parent container. + * @param skipFlip Skip the renderTexture check. Default false. + * @param textureUnit Use the currently bound texture unit? + */ + batchTexture(gameObject: Phaser.GameObjects.GameObject, texture: WebGLTexture, textureWidth: number, textureHeight: number, srcX: number, srcY: number, srcWidth: number, srcHeight: number, scaleX: number, scaleY: number, rotation: number, flipX: boolean, flipY: boolean, scrollFactorX: number, scrollFactorY: number, displayOriginX: number, displayOriginY: number, frameX: number, frameY: number, frameWidth: number, frameHeight: number, tintTL: number, tintTR: number, tintBL: number, tintBR: number, tintEffect: number, uOffset: number, vOffset: number, camera: Phaser.Cameras.Scene2D.Camera, parentTransformMatrix: Phaser.GameObjects.Components.TransformMatrix, skipFlip?: boolean, textureUnit?: number): void; + + /** + * Adds the vertices data into the batch and flushes if full. + * + * Assumes 6 vertices in the following arrangement: + * + * ``` + * 0----3 + * |\ B| + * | \ | + * | \ | + * | A \| + * | \ + * 1----2 + * ``` + * + * Where x0 / y0 = 0, x1 / y1 = 1, x2 / y2 = 2 and x3 / y3 = 3 + * @param gameObject The Game Object, if any, drawing this quad. + * @param x0 The top-left x position. + * @param y0 The top-left y position. + * @param x1 The bottom-left x position. + * @param y1 The bottom-left y position. + * @param x2 The bottom-right x position. + * @param y2 The bottom-right y position. + * @param x3 The top-right x position. + * @param y3 The top-right y position. + * @param u0 UV u0 value. + * @param v0 UV v0 value. + * @param u1 UV u1 value. + * @param v1 UV v1 value. + * @param tintTL The top-left tint color value. + * @param tintTR The top-right tint color value. + * @param tintBL The bottom-left tint color value. + * @param tintBR The bottom-right tint color value. + * @param tintEffect The tint effect for the shader to use. + * @param texture WebGLTexture that will be assigned to the current batch if a flush occurs. + */ + batchQuad(gameObject: Phaser.GameObjects.GameObject | null, x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, u0: number, v0: number, u1: number, v1: number, tintTL: number, tintTR: number, tintBL: number, tintBR: number, tintEffect: number | boolean, texture?: WebGLTexture): boolean; + + /** + * This callback is invoked when a sprite is drawn by this pipeline. + * + * It will fire after the shader has been set, but before the sprite has been drawn, + * so use it to set any additional uniforms you may need. + * + * Note: Manipulating the Sprite during this callback will _not_ change how it is drawn to the Render Target. + * @param gameObject The Sprite being drawn. + * @param target The Render Target the Sprite will be drawn to. + */ + onDrawSprite(gameObject: Phaser.GameObjects.Sprite, target: Phaser.Renderer.WebGL.RenderTarget): void; + + /** + * This callback is invoked when you call the `copySprite` method. + * + * It will fire after the shader has been set, but before the source target has been copied, + * so use it to set any additional uniforms you may need. + * + * Note: Manipulating the Sprite during this callback will _not_ change the Render Targets. + * @param source The source Render Target being copied from. + * @param target The target Render Target that will be copied to. + * @param gameObject The Sprite being copied. + */ + onCopySprite(source: Phaser.Renderer.WebGL.RenderTarget, target: Phaser.Renderer.WebGL.RenderTarget, gameObject: Phaser.GameObjects.Sprite): void; + + /** + * Copy the `source` Render Target to the `target` Render Target. + * + * No target resizing takes place. If the `source` Render Target is larger than the `target`, + * then only a portion the same size as the `target` dimensions is copied across. + * + * Calling this method will invoke the `onCopySprite` handler and will also call + * the `onFXCopy` callback on the Sprite. Both of these happen prior to the copy, allowing you + * to use them to set shader uniforms and other values. + * @param source The source Render Target being copied from. + * @param target The target Render Target that will be copied to. + * @param gameObject The Sprite being copied. + * @param clear Clear the target before copying? Default true. + * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. + * @param eraseMode Erase source from target using ERASE Blend Mode? Default false. + * @param shader The shader to use to copy the target. Defaults to the `copyShader`. + */ + copySprite(source: Phaser.Renderer.WebGL.RenderTarget, target: Phaser.Renderer.WebGL.RenderTarget, gameObject: Phaser.GameObjects.Sprite, clear?: boolean, clearAlpha?: boolean, eraseMode?: boolean, shader?: Phaser.Renderer.WebGL.WebGLShader): void; + + /** + * Draws the `source1` and `source2` Render Targets to the `target` Render Target + * using a linear blend effect, which is controlled by the `strength` parameter. + * @param source1 The first source Render Target. + * @param source2 The second source Render Target. + * @param target The target Render Target. + * @param strength The strength of the blend. Default 1. + * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. + */ + blendFrames(source1: Phaser.Renderer.WebGL.RenderTarget, source2: Phaser.Renderer.WebGL.RenderTarget, target?: Phaser.Renderer.WebGL.RenderTarget, strength?: number, clearAlpha?: boolean): void; + + /** + * Draws the `source1` and `source2` Render Targets to the `target` Render Target + * using an additive blend effect, which is controlled by the `strength` parameter. + * @param source1 The first source Render Target. + * @param source2 The second source Render Target. + * @param target The target Render Target. + * @param strength The strength of the blend. Default 1. + * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. + */ + blendFramesAdditive(source1: Phaser.Renderer.WebGL.RenderTarget, source2: Phaser.Renderer.WebGL.RenderTarget, target?: Phaser.Renderer.WebGL.RenderTarget, strength?: number, clearAlpha?: boolean): void; + + /** + * This method will copy the given Render Target to the game canvas using the `copyShader`. + * + * This applies the results of the copy shader during the draw. + * + * If you wish to copy the target without any effects see the `copyToGame` method instead. + * + * This method should be the final thing called in your pipeline. + * @param source The Render Target to draw to the game. + */ + drawToGame(source: Phaser.Renderer.WebGL.RenderTarget): void; + + /** + * This method will copy the given Render Target to the game canvas using the `gameShader`. + * + * Unless you've changed it, the `gameShader` copies the target without modifying it, just + * ensuring it is placed in the correct location on the canvas. + * + * If you wish to draw the target with and apply the fragment shader at the same time, + * see the `drawToGame` method instead. + * + * This method should be the final thing called in your pipeline. + * @param source The Render Target to copy to the game. + */ + copyToGame(source: Phaser.Renderer.WebGL.RenderTarget): void; + + /** + * This method is called by `drawToGame` and `copyToGame`. It takes the source Render Target + * and copies it back to the game canvas, or the next frame buffer in the stack, and should + * be considered the very last thing this pipeline does. + * + * You don't normally need to call this method, or override it, however it is left public + * should you wish to do so. + * + * Note that it does _not_ set a shader. You should do this yourself if invoking this. + * @param source The Render Target to draw to the game. + */ + bindAndDraw(source: Phaser.Renderer.WebGL.RenderTarget): void; + + /** + * This method is called every time the `batchSprite` method is called and is passed a + * reference to the current render target. + * + * If you override this method, then it should make sure it calls either the + * `drawToGame` or `copyToGame` methods as the final thing it does. However, you can do as + * much additional processing as you like prior to this. + * @param target The Render Target to draw to the game. + * @param swapTarget The Swap Render Target, useful for double-buffer effects. + * @param altSwapTarget The Swap Render Target, useful for double-buffer effects. + */ + onDraw(target: Phaser.Renderer.WebGL.RenderTarget, swapTarget?: Phaser.Renderer.WebGL.RenderTarget, altSwapTarget?: Phaser.Renderer.WebGL.RenderTarget): void; + + /** + * Set the UV values for the 6 vertices that make up the quad used by the copy shader. + * + * Be sure to call `resetUVs` once you have finished manipulating the UV coordinates. + * @param uA The u value of vertex A. + * @param vA The v value of vertex A. + * @param uB The u value of vertex B. + * @param vB The v value of vertex B. + * @param uC The u value of vertex C. + * @param vC The v value of vertex C. + * @param uD The u value of vertex D. + * @param vD The v value of vertex D. + */ + setUVs(uA: number, vA: number, uB: number, vB: number, uC: number, vC: number, uD: number, vD: number): void; + + /** + * Sets the vertex UV coordinates of the quad used by the copy shaders + * so that they correctly adjust the texture coordinates for a blit frame effect. + * + * Be sure to call `resetUVs` once you have finished manipulating the UV coordinates. + * @param source The source Render Target. + * @param target The target Render Target. + */ + setTargetUVs(source: Phaser.Renderer.WebGL.RenderTarget, target: Phaser.Renderer.WebGL.RenderTarget): void; + + /** + * Resets the quad vertice UV values to their default settings. + * + * The quad is used by the copy shader in this pipeline. + */ + resetUVs(): void; + + /** + * Destroys all shader instances, removes all object references and nulls all external references. + */ + destroy(): this; + + } + + /** + * The Utility Pipeline is a special-use pipeline that belongs to the Pipeline Manager. + * + * It provides 4 shaders and handy associated methods: + * + * 1) Copy Shader. A fast texture to texture copy shader with optional brightness setting. + * 2) Additive Blend Mode Shader. Blends two textures using an additive blend mode. + * 3) Linear Blend Mode Shader. Blends two textures using a linear blend mode. + * 4) Color Matrix Copy Shader. Draws a texture to a target using a Color Matrix. + * + * You do not extend this pipeline, but instead get a reference to it from the Pipeline + * Manager via the `setUtility` method. You can also access methods such as `copyFrame` + * directly from the Pipeline Manager. + * + * This pipeline provides methods for manipulating framebuffer backed textures, such as + * copying or blending one texture to another, copying a portion of a texture, additively + * blending two textures, flipping textures and more. + * + * The default shader attributes for this pipeline are: + * + * `inPosition` (vec2, offset 0) + * `inTexCoord` (vec2, offset 8) + * + * This pipeline has a hard-coded batch size of 1 and a hard coded set of vertices. + */ + class UtilityPipeline extends Phaser.Renderer.WebGL.WebGLPipeline { + /** + * + * @param config The configuration options for this pipeline. + */ + constructor(config: Phaser.Types.Renderer.WebGL.WebGLPipelineConfig); + + /** + * A default Color Matrix, used by the Color Matrix Shader when one + * isn't provided. + */ + colorMatrix: Phaser.Display.ColorMatrix; + + /** + * A reference to the Copy Shader belonging to this Utility Pipeline. + * + * This property is set during the `boot` method. + */ + copyShader: Phaser.Renderer.WebGL.WebGLShader; + + /** + * A reference to the Additive Blend Shader belonging to this Utility Pipeline. + * + * This property is set during the `boot` method. + */ + addShader: Phaser.Renderer.WebGL.WebGLShader; + + /** + * A reference to the Linear Blend Shader belonging to this Utility Pipeline. + * + * This property is set during the `boot` method. + */ + linearShader: Phaser.Renderer.WebGL.WebGLShader; + + /** + * A reference to the Color Matrix Shader belonging to this Utility Pipeline. + * + * This property is set during the `boot` method. + */ + colorMatrixShader: Phaser.Renderer.WebGL.WebGLShader; + + /** + * A reference to the Full Frame 1 Render Target. + * + * This property is set during the `boot` method. + * + * This Render Target is the full size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + */ + fullFrame1: Phaser.Renderer.WebGL.RenderTarget; + + /** + * A reference to the Full Frame 2 Render Target. + * + * This property is set during the `boot` method. + * + * This Render Target is the full size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + */ + fullFrame2: Phaser.Renderer.WebGL.RenderTarget; + + /** + * A reference to the Half Frame 1 Render Target. + * + * This property is set during the `boot` method. + * + * This Render Target is half the size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + */ + halfFrame1: Phaser.Renderer.WebGL.RenderTarget; + + /** + * A reference to the Half Frame 2 Render Target. + * + * This property is set during the `boot` method. + * + * This Render Target is half the size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + */ + halfFrame2: Phaser.Renderer.WebGL.RenderTarget; + + /** + * Copy the `source` Render Target to the `target` Render Target. + * + * You can optionally set the brightness factor of the copy. + * + * The difference between this method and `drawFrame` is that this method + * uses a faster copy shader, where only the brightness can be modified. + * If you need color level manipulation, see `drawFrame` instead. + * @param source The source Render Target. + * @param target The target Render Target. + * @param brightness The brightness value applied to the frame copy. Default 1. + * @param clear Clear the target before copying? Default true. + * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. + */ + copyFrame(source: Phaser.Renderer.WebGL.RenderTarget, target?: Phaser.Renderer.WebGL.RenderTarget, brightness?: number, clear?: boolean, clearAlpha?: boolean): void; + + /** + * Copy the `source` Render Target to the `target` Render Target. + * + * The difference with this copy is that no resizing takes place. If the `source` + * Render Target is larger than the `target` then only a portion the same size as + * the `target` dimensions is copied across. + * + * You can optionally set the brightness factor of the copy. + * @param source The source Render Target. + * @param target The target Render Target. + * @param brightness The brightness value applied to the frame copy. Default 1. + * @param clear Clear the target before copying? Default true. + * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. + * @param eraseMode Erase source from target using ERASE Blend Mode? Default false. + * @param flipY Flip the UV on the Y axis before drawing? Default false. + */ + blitFrame(source: Phaser.Renderer.WebGL.RenderTarget, target: Phaser.Renderer.WebGL.RenderTarget, brightness?: number, clear?: boolean, clearAlpha?: boolean, eraseMode?: boolean, flipY?: boolean): void; + + /** + * Binds the `source` Render Target and then copies a section of it to the `target` Render Target. + * + * This method is extremely fast because it uses `gl.copyTexSubImage2D` and doesn't + * require the use of any shaders. Remember the coordinates are given in standard WebGL format, + * where x and y specify the lower-left corner of the section, not the top-left. Also, the + * copy entirely replaces the contents of the target texture, no 'merging' or 'blending' takes + * place. + * @param source The source Render Target. + * @param target The target Render Target. + * @param x The x coordinate of the lower left corner where to start copying. + * @param y The y coordinate of the lower left corner where to start copying. + * @param width The width of the texture. + * @param height The height of the texture. + * @param clear Clear the target before copying? Default true. + * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. + */ + copyFrameRect(source: Phaser.Renderer.WebGL.RenderTarget, target: Phaser.Renderer.WebGL.RenderTarget, x: number, y: number, width: number, height: number, clear?: boolean, clearAlpha?: boolean): void; + + /** + * Pops the framebuffer from the renderers FBO stack and sets that as the active target, + * then draws the `source` Render Target to it. It then resets the renderer textures. + * + * This should be done when you need to draw the _final_ results of a pipeline to the game + * canvas, or the next framebuffer in line on the FBO stack. You should only call this once + * in the `onDraw` handler and it should be the final thing called. Be careful not to call + * this if you need to actually use the pipeline shader, instead of the copy shader. In + * those cases, use the `bindAndDraw` method. + * @param source The Render Target to draw from. + */ + copyToGame(source: Phaser.Renderer.WebGL.RenderTarget): void; + + /** + * Copy the `source` Render Target to the `target` Render Target, using the + * given Color Matrix. + * + * The difference between this method and `copyFrame` is that this method + * uses a color matrix shader, where you have full control over the luminance + * values used during the copy. If you don't need this, you can use the faster + * `copyFrame` method instead. + * @param source The source Render Target. + * @param target The target Render Target. + * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. + * @param colorMatrix The Color Matrix to use when performing the draw. + */ + drawFrame(source: Phaser.Renderer.WebGL.RenderTarget, target?: Phaser.Renderer.WebGL.RenderTarget, clearAlpha?: boolean, colorMatrix?: Phaser.Display.ColorMatrix): void; + + /** + * Draws the `source1` and `source2` Render Targets to the `target` Render Target + * using a linear blend effect, which is controlled by the `strength` parameter. + * @param source1 The first source Render Target. + * @param source2 The second source Render Target. + * @param target The target Render Target. + * @param strength The strength of the blend. Default 1. + * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. + * @param blendShader The shader to use during the blend copy. + */ + blendFrames(source1: Phaser.Renderer.WebGL.RenderTarget, source2: Phaser.Renderer.WebGL.RenderTarget, target?: Phaser.Renderer.WebGL.RenderTarget, strength?: number, clearAlpha?: boolean, blendShader?: Phaser.Renderer.WebGL.WebGLShader): void; + + /** + * Draws the `source1` and `source2` Render Targets to the `target` Render Target + * using an additive blend effect, which is controlled by the `strength` parameter. + * @param source1 The first source Render Target. + * @param source2 The second source Render Target. + * @param target The target Render Target. + * @param strength The strength of the blend. Default 1. + * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. + */ + blendFramesAdditive(source1: Phaser.Renderer.WebGL.RenderTarget, source2: Phaser.Renderer.WebGL.RenderTarget, target?: Phaser.Renderer.WebGL.RenderTarget, strength?: number, clearAlpha?: boolean): void; + + /** + * Clears the given Render Target. + * @param target The Render Target to clear. + * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. + */ + clearFrame(target: Phaser.Renderer.WebGL.RenderTarget, clearAlpha?: boolean): void; + + /** + * Set the UV values for the 6 vertices that make up the quad used by the shaders + * in the Utility Pipeline. + * + * Be sure to call `resetUVs` once you have finished manipulating the UV coordinates. + * @param uA The u value of vertex A. + * @param vA The v value of vertex A. + * @param uB The u value of vertex B. + * @param vB The v value of vertex B. + * @param uC The u value of vertex C. + * @param vC The v value of vertex C. + * @param uD The u value of vertex D. + * @param vD The v value of vertex D. + */ + setUVs(uA: number, vA: number, uB: number, vB: number, uC: number, vC: number, uD: number, vD: number): void; + + /** + * Sets the vertex UV coordinates of the quad used by the shaders in the Utility Pipeline + * so that they correctly adjust the texture coordinates for a blit frame effect. + * + * Be sure to call `resetUVs` once you have finished manipulating the UV coordinates. + * @param source The source Render Target. + * @param target The target Render Target. + */ + setTargetUVs(source: Phaser.Renderer.WebGL.RenderTarget, target: Phaser.Renderer.WebGL.RenderTarget): void; + + /** + * Horizontally flips the UV coordinates of the quad used by the shaders in this + * Utility Pipeline. + * + * Be sure to call `resetUVs` once you have finished manipulating the UV coordinates. + */ + flipX(): void; + + /** + * Vertically flips the UV coordinates of the quad used by the shaders in this + * Utility Pipeline. + * + * Be sure to call `resetUVs` once you have finished manipulating the UV coordinates. + */ + flipY(): void; + + /** + * Resets the quad vertice UV values to their default settings. + * + * The quad is used by all shaders of the Utility Pipeline. + */ + resetUVs(): void; + + } + + /** + * The Bitmap Mask Pipeline. + */ + const BITMAPMASK_PIPELINE: string; + + /** + * The Light 2D Pipeline. + */ + const LIGHT_PIPELINE: string; + + /** + * The Point Light Pipeline. + */ + const POINTLIGHT_PIPELINE: string; + + /** + * The Single Texture Pipeline. + */ + const SINGLE_PIPELINE: string; + + /** + * The Multi Texture Pipeline. + */ + const MULTI_PIPELINE: string; + + /** + * The Rope Pipeline. + */ + const ROPE_PIPELINE: string; + + /** + * The Graphics and Shapes Pipeline. + */ + const GRAPHICS_PIPELINE: string; + + /** + * The Post FX Pipeline. + */ + const POSTFX_PIPELINE: string; + + /** + * The Utility Pipeline. + */ + const UTILITY_PIPELINE: string; + + namespace Events { + /** + * The WebGLPipeline After Flush Event. + * + * This event is dispatched by a WebGLPipeline right after it has issued a drawArrays command + * and cleared its vertex count. + */ + const AFTER_FLUSH: any; + + /** + * The WebGLPipeline Before Flush Event. + * + * This event is dispatched by a WebGLPipeline right before it is about to + * flush and issue a bufferData and drawArrays command. + */ + const BEFORE_FLUSH: any; + + /** + * The WebGLPipeline Bind Event. + * + * This event is dispatched by a WebGLPipeline when it is bound by the Pipeline Manager. + */ + const BIND: any; + + /** + * The WebGLPipeline Boot Event. + * + * This event is dispatched by a WebGLPipeline when it has completed its `boot` phase. + */ + const BOOT: any; + + /** + * The WebGLPipeline Destroy Event. + * + * This event is dispatched by a WebGLPipeline when it is starting its destroy process. + */ + const DESTROY: any; + + /** + * The WebGLPipeline ReBind Event. + * + * This event is dispatched by a WebGLPipeline when it is re-bound by the Pipeline Manager. + */ + const REBIND: any; + + /** + * The WebGLPipeline Resize Event. + * + * This event is dispatched by a WebGLPipeline when it is resized, usually as a result + * of the Renderer resizing. + */ + const RESIZE: any; + + } + + } + } } - /** - * Phaser Scale Modes. - */ - enum ScaleModes { - /** - * Default Scale Mode (Linear). - */ - DEFAULT, - /** - * Linear Scale Mode. - */ - LINEAR, - /** - * Nearest Scale Mode. - */ - NEAREST, - } - namespace Scale { - /** - * Phaser Scale Manager constants for centering the game canvas. - */ - enum Center { - /** - * The game canvas is not centered within the parent by Phaser. - * You can still center it yourself via CSS. - */ - NO_CENTER, - /** - * The game canvas is centered both horizontally and vertically within the parent. - * To do this, the parent has to have a bounds that can be calculated and not be empty. - * - * Centering is achieved by setting the margin left and top properties of the - * game canvas, and does not factor in any other CSS styles you may have applied. - */ - CENTER_BOTH, - /** - * The game canvas is centered horizontally within the parent. - * To do this, the parent has to have a bounds that can be calculated and not be empty. - * - * Centering is achieved by setting the margin left and top properties of the - * game canvas, and does not factor in any other CSS styles you may have applied. - */ - CENTER_HORIZONTALLY, - /** - * The game canvas is centered both vertically within the parent. - * To do this, the parent has to have a bounds that can be calculated and not be empty. - * - * Centering is achieved by setting the margin left and top properties of the - * game canvas, and does not factor in any other CSS styles you may have applied. - */ - CENTER_VERTICALLY, - } - - /** - * Phaser Scale Manager constants for centering the game canvas. - * - * To find out what each mode does please see [Phaser.Scale.Center]{@link Phaser.Scale.Center}. - */ - type CenterType = Phaser.Scale.Center; - - /** - * Phaser Scale Manager constants for orientation. - */ - enum Orientation { - /** - * A landscape orientation. - */ - LANDSCAPE, - /** - * A portrait orientation. - */ - PORTRAIT, - } - - /** - * Phaser Scale Manager constants for orientation. - * - * To find out what each mode does please see [Phaser.Scale.Orientation]{@link Phaser.Scale.Orientation}. - */ - type OrientationType = Phaser.Scale.Orientation; - - /** - * Phaser Scale Manager constants for the different scale modes available. - */ - enum ScaleModes { - /** - * No scaling happens at all. The canvas is set to the size given in the game config and Phaser doesn't change it - * again from that point on. If you change the canvas size, either via CSS, or directly via code, then you need - * to call the Scale Managers `resize` method to give the new dimensions, or input events will stop working. - */ - NONE, - /** - * The height is automatically adjusted based on the width. - */ - WIDTH_CONTROLS_HEIGHT, - /** - * The width is automatically adjusted based on the height. - */ - HEIGHT_CONTROLS_WIDTH, - /** - * The width and height are automatically adjusted to fit inside the given target area, - * while keeping the aspect ratio. Depending on the aspect ratio there may be some space - * inside the area which is not covered. - */ - FIT, - /** - * The width and height are automatically adjusted to make the size cover the entire target - * area while keeping the aspect ratio. This may extend further out than the target size. - */ - ENVELOP, - /** - * The Canvas is resized to fit all available _parent_ space, regardless of aspect ratio. - */ - RESIZE, - } - - /** - * Phaser Scale Manager constants for the different scale modes available. - * - * To find out what each mode does please see [Phaser.Scale.ScaleModes]{@link Phaser.Scale.ScaleModes}. - */ - type ScaleModeType = Phaser.Scale.ScaleModes; - - /** - * Phaser Scale Manager constants for zoom modes. - */ - enum Zoom { - /** - * The game canvas will not be zoomed by Phaser. - */ - NO_ZOOM, - /** - * The game canvas will be 2x zoomed by Phaser. - */ - ZOOM_2X, - /** - * The game canvas will be 4x zoomed by Phaser. - */ - ZOOM_4X, - /** - * Calculate the zoom value based on the maximum multiplied game size that will - * fit into the parent, or browser window if no parent is set. - */ - MAX_ZOOM, - } - - /** - * Phaser Scale Manager constants for zoom modes. - * - * To find out what each mode does please see [Phaser.Scale.Zoom]{@link Phaser.Scale.Zoom}. - */ - type ZoomType = Phaser.Scale.Zoom; - - namespace Events { - /** - * The Scale Manager has successfully entered fullscreen mode. - */ - const ENTER_FULLSCREEN: any; - - /** - * The Scale Manager tried to enter fullscreen mode but failed. - */ - const FULLSCREEN_FAILED: any; - - /** - * The Scale Manager tried to enter fullscreen mode, but it is unsupported by the browser. - */ - const FULLSCREEN_UNSUPPORTED: any; - - /** - * The Scale Manager was in fullscreen mode, but has since left, either directly via game code, - * or via a user gestured, such as pressing the ESC key. - */ - const LEAVE_FULLSCREEN: any; - - /** - * The Scale Manager Orientation Change Event. - * - * This event is dispatched whenever the Scale Manager detects an orientation change event from the browser. - */ - const ORIENTATION_CHANGE: any; - - /** - * The Scale Manager Resize Event. - * - * This event is dispatched whenever the Scale Manager detects a resize event from the browser. - * It sends three parameters to the callback, each of them being Size components. You can read - * the `width`, `height`, `aspectRatio` and other properties of these components to help with - * scaling your own game content. - */ - const RESIZE: any; - - } - /** * The Scale Manager handles the scaling, resizing and alignment of the game canvas. * @@ -87423,6 +87247,182 @@ declare namespace Phaser { } + /** + * Phaser Scale Manager constants for centering the game canvas. + */ + enum Center { + /** + * The game canvas is not centered within the parent by Phaser. + * You can still center it yourself via CSS. + */ + NO_CENTER, + /** + * The game canvas is centered both horizontally and vertically within the parent. + * To do this, the parent has to have a bounds that can be calculated and not be empty. + * + * Centering is achieved by setting the margin left and top properties of the + * game canvas, and does not factor in any other CSS styles you may have applied. + */ + CENTER_BOTH, + /** + * The game canvas is centered horizontally within the parent. + * To do this, the parent has to have a bounds that can be calculated and not be empty. + * + * Centering is achieved by setting the margin left and top properties of the + * game canvas, and does not factor in any other CSS styles you may have applied. + */ + CENTER_HORIZONTALLY, + /** + * The game canvas is centered both vertically within the parent. + * To do this, the parent has to have a bounds that can be calculated and not be empty. + * + * Centering is achieved by setting the margin left and top properties of the + * game canvas, and does not factor in any other CSS styles you may have applied. + */ + CENTER_VERTICALLY, + } + + /** + * Phaser Scale Manager constants for centering the game canvas. + * + * To find out what each mode does please see [Phaser.Scale.Center]{@link Phaser.Scale.Center}. + */ + type CenterType = Phaser.Scale.Center; + + /** + * Phaser Scale Manager constants for orientation. + */ + enum Orientation { + /** + * A landscape orientation. + */ + LANDSCAPE, + /** + * A portrait orientation. + */ + PORTRAIT, + } + + /** + * Phaser Scale Manager constants for orientation. + * + * To find out what each mode does please see [Phaser.Scale.Orientation]{@link Phaser.Scale.Orientation}. + */ + type OrientationType = Phaser.Scale.Orientation; + + /** + * Phaser Scale Manager constants for the different scale modes available. + */ + enum ScaleModes { + /** + * No scaling happens at all. The canvas is set to the size given in the game config and Phaser doesn't change it + * again from that point on. If you change the canvas size, either via CSS, or directly via code, then you need + * to call the Scale Managers `resize` method to give the new dimensions, or input events will stop working. + */ + NONE, + /** + * The height is automatically adjusted based on the width. + */ + WIDTH_CONTROLS_HEIGHT, + /** + * The width is automatically adjusted based on the height. + */ + HEIGHT_CONTROLS_WIDTH, + /** + * The width and height are automatically adjusted to fit inside the given target area, + * while keeping the aspect ratio. Depending on the aspect ratio there may be some space + * inside the area which is not covered. + */ + FIT, + /** + * The width and height are automatically adjusted to make the size cover the entire target + * area while keeping the aspect ratio. This may extend further out than the target size. + */ + ENVELOP, + /** + * The Canvas is resized to fit all available _parent_ space, regardless of aspect ratio. + */ + RESIZE, + } + + /** + * Phaser Scale Manager constants for the different scale modes available. + * + * To find out what each mode does please see [Phaser.Scale.ScaleModes]{@link Phaser.Scale.ScaleModes}. + */ + type ScaleModeType = Phaser.Scale.ScaleModes; + + /** + * Phaser Scale Manager constants for zoom modes. + */ + enum Zoom { + /** + * The game canvas will not be zoomed by Phaser. + */ + NO_ZOOM, + /** + * The game canvas will be 2x zoomed by Phaser. + */ + ZOOM_2X, + /** + * The game canvas will be 4x zoomed by Phaser. + */ + ZOOM_4X, + /** + * Calculate the zoom value based on the maximum multiplied game size that will + * fit into the parent, or browser window if no parent is set. + */ + MAX_ZOOM, + } + + /** + * Phaser Scale Manager constants for zoom modes. + * + * To find out what each mode does please see [Phaser.Scale.Zoom]{@link Phaser.Scale.Zoom}. + */ + type ZoomType = Phaser.Scale.Zoom; + + namespace Events { + /** + * The Scale Manager has successfully entered fullscreen mode. + */ + const ENTER_FULLSCREEN: any; + + /** + * The Scale Manager tried to enter fullscreen mode but failed. + */ + const FULLSCREEN_FAILED: any; + + /** + * The Scale Manager tried to enter fullscreen mode, but it is unsupported by the browser. + */ + const FULLSCREEN_UNSUPPORTED: any; + + /** + * The Scale Manager was in fullscreen mode, but has since left, either directly via game code, + * or via a user gestured, such as pressing the ESC key. + */ + const LEAVE_FULLSCREEN: any; + + /** + * The Scale Manager Orientation Change Event. + * + * This event is dispatched whenever the Scale Manager detects an orientation change event from the browser. + */ + const ORIENTATION_CHANGE: any; + + /** + * The Scale Manager Resize Event. + * + * This event is dispatched whenever the Scale Manager detects a resize event from the browser. + * It sends three parameters to the callback, each of them being Size components. You can read + * the `width`, `height`, `aspectRatio` and other properties of these components to help with + * scaling your own game content. + */ + const RESIZE: any; + + } + /** * The game canvas is not centered within the parent by Phaser. * You can still center it yourself via CSS. @@ -87524,386 +87524,204 @@ declare namespace Phaser { } + /** + * A base Phaser.Scene class which can be extended for your own use. + * + * You can also define the optional methods {@link Phaser.Types.Scenes.SceneInitCallback init()}, {@link Phaser.Types.Scenes.ScenePreloadCallback preload()}, and {@link Phaser.Types.Scenes.SceneCreateCallback create()}. + */ + class Scene { + /** + * + * @param config The scene key or scene specific configuration settings. + */ + constructor(config?: string | Phaser.Types.Scenes.SettingsConfig); + + /** + * The Scene Systems. You must never overwrite this property, or all hell will break lose. + */ + sys: Phaser.Scenes.Systems; + + /** + * A reference to the Phaser.Game instance. + * + * This property will only be available if defined in the Scene Injection Map. + */ + game: Phaser.Game; + + /** + * A reference to the global Animation Manager. + * + * This property will only be available if defined in the Scene Injection Map. + */ + anims: Phaser.Animations.AnimationManager; + + /** + * A reference to the global Cache. + * + * This property will only be available if defined in the Scene Injection Map. + */ + cache: Phaser.Cache.CacheManager; + + /** + * A reference to the global Data Manager. + * + * This property will only be available if defined in the Scene Injection Map. + */ + registry: Phaser.Data.DataManager; + + /** + * A reference to the Sound Manager. + * + * This property will only be available if defined in the Scene Injection Map and the plugin is installed. + */ + sound: Phaser.Sound.NoAudioSoundManager | Phaser.Sound.HTML5AudioSoundManager | Phaser.Sound.WebAudioSoundManager; + + /** + * A reference to the Texture Manager. + * + * This property will only be available if defined in the Scene Injection Map. + */ + textures: Phaser.Textures.TextureManager; + + /** + * A Scene specific Event Emitter. + * + * This property will only be available if defined in the Scene Injection Map. + */ + events: Phaser.Events.EventEmitter; + + /** + * The Scene Camera Manager. + * + * This property will only be available if defined in the Scene Injection Map. + */ + cameras: Phaser.Cameras.Scene2D.CameraManager; + + /** + * The Scene Game Object Factory. + * + * This property will only be available if defined in the Scene Injection Map. + */ + add: Phaser.GameObjects.GameObjectFactory; + + /** + * The Scene Game Object Creator. + * + * This property will only be available if defined in the Scene Injection Map. + */ + make: Phaser.GameObjects.GameObjectCreator; + + /** + * A reference to the Scene Manager Plugin. + * + * This property will only be available if defined in the Scene Injection Map. + */ + scene: Phaser.Scenes.ScenePlugin; + + /** + * The Game Object Display List belonging to this Scene. + * + * This property will only be available if defined in the Scene Injection Map. + */ + children: Phaser.GameObjects.DisplayList; + + /** + * The Scene Lights Manager Plugin. + * + * This property will only be available if defined in the Scene Injection Map and the plugin is installed. + */ + lights: Phaser.GameObjects.LightsManager; + + /** + * A Scene specific Data Manager Plugin. + * + * See the `registry` property for the global Data Manager. + * + * This property will only be available if defined in the Scene Injection Map and the plugin is installed. + */ + data: Phaser.Data.DataManager; + + /** + * The Scene Input Manager Plugin. + * + * This property will only be available if defined in the Scene Injection Map and the plugin is installed. + */ + input: Phaser.Input.InputPlugin; + + /** + * The Scene Loader Plugin. + * + * This property will only be available if defined in the Scene Injection Map and the plugin is installed. + */ + load: Phaser.Loader.LoaderPlugin; + + /** + * The Scene Time and Clock Plugin. + * + * This property will only be available if defined in the Scene Injection Map and the plugin is installed. + */ + time: Phaser.Time.Clock; + + /** + * The Scene Tween Manager Plugin. + * + * This property will only be available if defined in the Scene Injection Map and the plugin is installed. + */ + tweens: Phaser.Tweens.TweenManager; + + /** + * The Scene Arcade Physics Plugin. + * + * This property will only be available if defined in the Scene Injection Map, the plugin is installed and configured. + */ + physics: Phaser.Physics.Arcade.ArcadePhysics; + + /** + * The Scene Matter Physics Plugin. + * + * This property will only be available if defined in the Scene Injection Map, the plugin is installed and configured. + */ + matter: Phaser.Physics.Matter.MatterPhysics; + + /** + * The Facebook Instant Games Plugin. + * + * This property will only be available if defined in the Scene Injection Map, the plugin is installed and configured. + */ + facebook: Phaser.FacebookInstantGamesPlugin; + + /** + * A reference to the global Scale Manager. + * + * This property will only be available if defined in the Scene Injection Map. + */ + scale: Phaser.Scale.ScaleManager; + + /** + * A reference to the global Plugin Manager. + * + * The Plugin Manager is a global system that allows plugins to register themselves with it, and can then install + * those plugins into Scenes as required. + */ + plugins: Phaser.Plugins.PluginManager; + + /** + * A reference to the renderer instance Phaser is using, either Canvas Renderer or WebGL Renderer. + */ + renderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer; + + /** + * This method should be overridden by your own Scenes. + * + * This method is called once per game step while the scene is running. + * @param time The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + update(time: number, delta: number): void; + + } + namespace Scenes { - /** - * Scene state. - */ - var PENDING: number; - - /** - * Scene state. - */ - var INIT: number; - - /** - * Scene state. - */ - var START: number; - - /** - * Scene state. - */ - var LOADING: number; - - /** - * Scene state. - */ - var CREATING: number; - - /** - * Scene state. - */ - var RUNNING: number; - - /** - * Scene state. - */ - var PAUSED: number; - - /** - * Scene state. - */ - var SLEEPING: number; - - /** - * Scene state. - */ - var SHUTDOWN: number; - - /** - * Scene state. - */ - var DESTROYED: number; - - namespace Events { - /** - * The Game Object Added to Scene Event. - * - * This event is dispatched when a Game Object is added to a Scene. - * - * Listen for it from a Scene using `this.events.on('addedtoscene', listener)`. - */ - const ADDED_TO_SCENE: any; - - /** - * The Scene Systems Boot Event. - * - * This event is dispatched by a Scene during the Scene Systems boot process. Primarily used by Scene Plugins. - * - * Listen to it from a Scene using `this.events.on('boot', listener)`. - */ - const BOOT: any; - - /** - * The Scene Create Event. - * - * This event is dispatched by a Scene after it has been created by the Scene Manager. - * - * If a Scene has a `create` method then this event is emitted _after_ that has run. - * - * If there is a transition, this event will be fired after the `TRANSITION_START` event. - * - * Listen to it from a Scene using `this.events.on('create', listener)`. - */ - const CREATE: any; - - /** - * The Scene Systems Destroy Event. - * - * This event is dispatched by a Scene during the Scene Systems destroy process. - * - * Listen to it from a Scene using `this.events.on('destroy', listener)`. - * - * You should destroy any resources that may be in use by your Scene in this event handler. - */ - const DESTROY: any; - - /** - * The Scene Systems Pause Event. - * - * This event is dispatched by a Scene when it is paused, either directly via the `pause` method, or as an - * action from another Scene. - * - * Listen to it from a Scene using `this.events.on('pause', listener)`. - */ - const PAUSE: any; - - /** - * The Scene Systems Post Update Event. - * - * This event is dispatched by a Scene during the main game loop step. - * - * The event flow for a single step of a Scene is as follows: - * - * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} - * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} - * 3. The `Scene.update` method is called, if it exists - * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} - * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} - * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} - * - * Listen to it from a Scene using `this.events.on('postupdate', listener)`. - * - * A Scene will only run its step if it is active. - */ - const POST_UPDATE: any; - - /** - * The Scene Systems Pre-Render Event. - * - * This event is dispatched by a Scene during the main game loop step. - * - * The event flow for a single step of a Scene is as follows: - * - * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} - * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} - * 3. The `Scene.update` method is called, if it exists - * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} - * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} - * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} - * - * Listen to this event from a Scene using `this.events.on('prerender', listener)`. - * - * A Scene will only render if it is visible. - * - * This event is dispatched after the Scene Display List is sorted and before the Scene is rendered. - */ - const PRE_RENDER: any; - - /** - * The Scene Systems Pre Update Event. - * - * This event is dispatched by a Scene during the main game loop step. - * - * The event flow for a single step of a Scene is as follows: - * - * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} - * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} - * 3. The `Scene.update` method is called, if it exists - * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} - * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} - * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} - * - * Listen to it from a Scene using `this.events.on('preupdate', listener)`. - * - * A Scene will only run its step if it is active. - */ - const PRE_UPDATE: any; - - /** - * The Scene Systems Ready Event. - * - * This event is dispatched by a Scene during the Scene Systems start process. - * By this point in the process the Scene is now fully active and rendering. - * This event is meant for your game code to use, as all plugins have responded to the earlier 'start' event. - * - * Listen to it from a Scene using `this.events.on('ready', listener)`. - */ - const READY: any; - - /** - * The Game Object Removed from Scene Event. - * - * This event is dispatched when a Game Object is removed from a Scene. - * - * Listen for it from a Scene using `this.events.on('removedfromscene', listener)`. - */ - const REMOVED_FROM_SCENE: any; - - /** - * The Scene Systems Render Event. - * - * This event is dispatched by a Scene during the main game loop step. - * - * The event flow for a single step of a Scene is as follows: - * - * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} - * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} - * 3. The `Scene.update` method is called, if it exists - * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} - * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} - * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} - * - * Listen to it from a Scene using `this.events.on('render', listener)`. - * - * A Scene will only render if it is visible. - * - * By the time this event is dispatched, the Scene will have already been rendered. - */ - const RENDER: any; - - /** - * The Scene Systems Resume Event. - * - * This event is dispatched by a Scene when it is resumed from a paused state, either directly via the `resume` method, - * or as an action from another Scene. - * - * Listen to it from a Scene using `this.events.on('resume', listener)`. - */ - const RESUME: any; - - /** - * The Scene Systems Shutdown Event. - * - * This event is dispatched by a Scene during the Scene Systems shutdown process. - * - * Listen to it from a Scene using `this.events.on('shutdown', listener)`. - * - * You should free-up any resources that may be in use by your Scene in this event handler, on the understanding - * that the Scene may, at any time, become active again. A shutdown Scene is not 'destroyed', it's simply not - * currently active. Use the [DESTROY]{@linkcode Phaser.Scenes.Events#event:DESTROY} event to completely clear resources. - */ - const SHUTDOWN: any; - - /** - * The Scene Systems Sleep Event. - * - * This event is dispatched by a Scene when it is sent to sleep, either directly via the `sleep` method, - * or as an action from another Scene. - * - * Listen to it from a Scene using `this.events.on('sleep', listener)`. - */ - const SLEEP: any; - - /** - * The Scene Systems Start Event. - * - * This event is dispatched by a Scene during the Scene Systems start process. Primarily used by Scene Plugins. - * - * Listen to it from a Scene using `this.events.on('start', listener)`. - */ - const START: any; - - /** - * The Scene Transition Complete Event. - * - * This event is dispatched by the Target Scene of a transition. - * - * It happens when the transition process has completed. This occurs when the duration timer equals or exceeds the duration - * of the transition. - * - * Listen to it from a Scene using `this.events.on('transitioncomplete', listener)`. - * - * The Scene Transition event flow is as follows: - * - * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. - * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. - * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... - * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. - * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. - */ - const TRANSITION_COMPLETE: any; - - /** - * The Scene Transition Init Event. - * - * This event is dispatched by the Target Scene of a transition. - * - * It happens immediately after the `Scene.init` method is called. If the Scene does not have an `init` method, - * this event is not dispatched. - * - * Listen to it from a Scene using `this.events.on('transitioninit', listener)`. - * - * The Scene Transition event flow is as follows: - * - * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. - * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. - * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... - * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. - * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. - */ - const TRANSITION_INIT: any; - - /** - * The Scene Transition Out Event. - * - * This event is dispatched by a Scene when it initiates a transition to another Scene. - * - * Listen to it from a Scene using `this.events.on('transitionout', listener)`. - * - * The Scene Transition event flow is as follows: - * - * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. - * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. - * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... - * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. - * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. - */ - const TRANSITION_OUT: any; - - /** - * The Scene Transition Start Event. - * - * This event is dispatched by the Target Scene of a transition, only if that Scene was not asleep. - * - * It happens immediately after the `Scene.create` method is called. If the Scene does not have a `create` method, - * this event is dispatched anyway. - * - * If the Target Scene was sleeping then the [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} event is - * dispatched instead of this event. - * - * Listen to it from a Scene using `this.events.on('transitionstart', listener)`. - * - * The Scene Transition event flow is as follows: - * - * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. - * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. - * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... - * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. - * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. - */ - const TRANSITION_START: any; - - /** - * The Scene Transition Wake Event. - * - * This event is dispatched by the Target Scene of a transition, only if that Scene was asleep before - * the transition began. If the Scene was not asleep the [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} event is dispatched instead. - * - * Listen to it from a Scene using `this.events.on('transitionwake', listener)`. - * - * The Scene Transition event flow is as follows: - * - * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. - * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. - * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... - * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. - * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. - */ - const TRANSITION_WAKE: any; - - /** - * The Scene Systems Update Event. - * - * This event is dispatched by a Scene during the main game loop step. - * - * The event flow for a single step of a Scene is as follows: - * - * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} - * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} - * 3. The `Scene.update` method is called, if it exists and the Scene is in a Running state, otherwise this is skipped. - * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} - * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} - * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} - * - * Listen to it from a Scene using `this.events.on('update', listener)`. - * - * A Scene will only run its step if it is active. - */ - const UPDATE: any; - - /** - * The Scene Systems Wake Event. - * - * This event is dispatched by a Scene when it is woken from sleep, either directly via the `wake` method, - * or as an action from another Scene. - * - * Listen to it from a Scene using `this.events.on('wake', listener)`. - */ - const WAKE: any; - - } - /** * Builds an array of which physics plugins should be activated for the given Scene. * @param sys The scene system to get the physics systems of. @@ -88847,202 +88665,384 @@ declare namespace Phaser { } - } - - /** - * A base Phaser.Scene class which can be extended for your own use. - * - * You can also define the optional methods {@link Phaser.Types.Scenes.SceneInitCallback init()}, {@link Phaser.Types.Scenes.ScenePreloadCallback preload()}, and {@link Phaser.Types.Scenes.SceneCreateCallback create()}. - */ - class Scene { /** - * - * @param config The scene key or scene specific configuration settings. + * Scene state. */ - constructor(config?: string | Phaser.Types.Scenes.SettingsConfig); + var PENDING: number; /** - * The Scene Systems. You must never overwrite this property, or all hell will break lose. + * Scene state. */ - sys: Phaser.Scenes.Systems; + var INIT: number; /** - * A reference to the Phaser.Game instance. - * - * This property will only be available if defined in the Scene Injection Map. + * Scene state. */ - game: Phaser.Game; + var START: number; /** - * A reference to the global Animation Manager. - * - * This property will only be available if defined in the Scene Injection Map. + * Scene state. */ - anims: Phaser.Animations.AnimationManager; + var LOADING: number; /** - * A reference to the global Cache. - * - * This property will only be available if defined in the Scene Injection Map. + * Scene state. */ - cache: Phaser.Cache.CacheManager; + var CREATING: number; /** - * A reference to the global Data Manager. - * - * This property will only be available if defined in the Scene Injection Map. + * Scene state. */ - registry: Phaser.Data.DataManager; + var RUNNING: number; /** - * A reference to the Sound Manager. - * - * This property will only be available if defined in the Scene Injection Map and the plugin is installed. + * Scene state. */ - sound: Phaser.Sound.NoAudioSoundManager | Phaser.Sound.HTML5AudioSoundManager | Phaser.Sound.WebAudioSoundManager; + var PAUSED: number; /** - * A reference to the Texture Manager. - * - * This property will only be available if defined in the Scene Injection Map. + * Scene state. */ - textures: Phaser.Textures.TextureManager; + var SLEEPING: number; /** - * A Scene specific Event Emitter. - * - * This property will only be available if defined in the Scene Injection Map. + * Scene state. */ - events: Phaser.Events.EventEmitter; + var SHUTDOWN: number; /** - * The Scene Camera Manager. - * - * This property will only be available if defined in the Scene Injection Map. + * Scene state. */ - cameras: Phaser.Cameras.Scene2D.CameraManager; + var DESTROYED: number; - /** - * The Scene Game Object Factory. - * - * This property will only be available if defined in the Scene Injection Map. - */ - add: Phaser.GameObjects.GameObjectFactory; + namespace Events { + /** + * The Game Object Added to Scene Event. + * + * This event is dispatched when a Game Object is added to a Scene. + * + * Listen for it from a Scene using `this.events.on('addedtoscene', listener)`. + */ + const ADDED_TO_SCENE: any; - /** - * The Scene Game Object Creator. - * - * This property will only be available if defined in the Scene Injection Map. - */ - make: Phaser.GameObjects.GameObjectCreator; + /** + * The Scene Systems Boot Event. + * + * This event is dispatched by a Scene during the Scene Systems boot process. Primarily used by Scene Plugins. + * + * Listen to it from a Scene using `this.events.on('boot', listener)`. + */ + const BOOT: any; - /** - * A reference to the Scene Manager Plugin. - * - * This property will only be available if defined in the Scene Injection Map. - */ - scene: Phaser.Scenes.ScenePlugin; + /** + * The Scene Create Event. + * + * This event is dispatched by a Scene after it has been created by the Scene Manager. + * + * If a Scene has a `create` method then this event is emitted _after_ that has run. + * + * If there is a transition, this event will be fired after the `TRANSITION_START` event. + * + * Listen to it from a Scene using `this.events.on('create', listener)`. + */ + const CREATE: any; - /** - * The Game Object Display List belonging to this Scene. - * - * This property will only be available if defined in the Scene Injection Map. - */ - children: Phaser.GameObjects.DisplayList; + /** + * The Scene Systems Destroy Event. + * + * This event is dispatched by a Scene during the Scene Systems destroy process. + * + * Listen to it from a Scene using `this.events.on('destroy', listener)`. + * + * You should destroy any resources that may be in use by your Scene in this event handler. + */ + const DESTROY: any; - /** - * The Scene Lights Manager Plugin. - * - * This property will only be available if defined in the Scene Injection Map and the plugin is installed. - */ - lights: Phaser.GameObjects.LightsManager; + /** + * The Scene Systems Pause Event. + * + * This event is dispatched by a Scene when it is paused, either directly via the `pause` method, or as an + * action from another Scene. + * + * Listen to it from a Scene using `this.events.on('pause', listener)`. + */ + const PAUSE: any; - /** - * A Scene specific Data Manager Plugin. - * - * See the `registry` property for the global Data Manager. - * - * This property will only be available if defined in the Scene Injection Map and the plugin is installed. - */ - data: Phaser.Data.DataManager; + /** + * The Scene Systems Post Update Event. + * + * This event is dispatched by a Scene during the main game loop step. + * + * The event flow for a single step of a Scene is as follows: + * + * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} + * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} + * 3. The `Scene.update` method is called, if it exists + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} + * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.events.on('postupdate', listener)`. + * + * A Scene will only run its step if it is active. + */ + const POST_UPDATE: any; - /** - * The Scene Input Manager Plugin. - * - * This property will only be available if defined in the Scene Injection Map and the plugin is installed. - */ - input: Phaser.Input.InputPlugin; + /** + * The Scene Systems Pre-Render Event. + * + * This event is dispatched by a Scene during the main game loop step. + * + * The event flow for a single step of a Scene is as follows: + * + * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} + * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} + * 3. The `Scene.update` method is called, if it exists + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} + * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to this event from a Scene using `this.events.on('prerender', listener)`. + * + * A Scene will only render if it is visible. + * + * This event is dispatched after the Scene Display List is sorted and before the Scene is rendered. + */ + const PRE_RENDER: any; - /** - * The Scene Loader Plugin. - * - * This property will only be available if defined in the Scene Injection Map and the plugin is installed. - */ - load: Phaser.Loader.LoaderPlugin; + /** + * The Scene Systems Pre Update Event. + * + * This event is dispatched by a Scene during the main game loop step. + * + * The event flow for a single step of a Scene is as follows: + * + * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} + * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} + * 3. The `Scene.update` method is called, if it exists + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} + * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.events.on('preupdate', listener)`. + * + * A Scene will only run its step if it is active. + */ + const PRE_UPDATE: any; - /** - * The Scene Time and Clock Plugin. - * - * This property will only be available if defined in the Scene Injection Map and the plugin is installed. - */ - time: Phaser.Time.Clock; + /** + * The Scene Systems Ready Event. + * + * This event is dispatched by a Scene during the Scene Systems start process. + * By this point in the process the Scene is now fully active and rendering. + * This event is meant for your game code to use, as all plugins have responded to the earlier 'start' event. + * + * Listen to it from a Scene using `this.events.on('ready', listener)`. + */ + const READY: any; - /** - * The Scene Tween Manager Plugin. - * - * This property will only be available if defined in the Scene Injection Map and the plugin is installed. - */ - tweens: Phaser.Tweens.TweenManager; + /** + * The Game Object Removed from Scene Event. + * + * This event is dispatched when a Game Object is removed from a Scene. + * + * Listen for it from a Scene using `this.events.on('removedfromscene', listener)`. + */ + const REMOVED_FROM_SCENE: any; - /** - * The Scene Arcade Physics Plugin. - * - * This property will only be available if defined in the Scene Injection Map, the plugin is installed and configured. - */ - physics: Phaser.Physics.Arcade.ArcadePhysics; + /** + * The Scene Systems Render Event. + * + * This event is dispatched by a Scene during the main game loop step. + * + * The event flow for a single step of a Scene is as follows: + * + * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} + * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} + * 3. The `Scene.update` method is called, if it exists + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} + * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.events.on('render', listener)`. + * + * A Scene will only render if it is visible. + * + * By the time this event is dispatched, the Scene will have already been rendered. + */ + const RENDER: any; - /** - * The Scene Matter Physics Plugin. - * - * This property will only be available if defined in the Scene Injection Map, the plugin is installed and configured. - */ - matter: Phaser.Physics.Matter.MatterPhysics; + /** + * The Scene Systems Resume Event. + * + * This event is dispatched by a Scene when it is resumed from a paused state, either directly via the `resume` method, + * or as an action from another Scene. + * + * Listen to it from a Scene using `this.events.on('resume', listener)`. + */ + const RESUME: any; - /** - * The Facebook Instant Games Plugin. - * - * This property will only be available if defined in the Scene Injection Map, the plugin is installed and configured. - */ - facebook: Phaser.FacebookInstantGamesPlugin; + /** + * The Scene Systems Shutdown Event. + * + * This event is dispatched by a Scene during the Scene Systems shutdown process. + * + * Listen to it from a Scene using `this.events.on('shutdown', listener)`. + * + * You should free-up any resources that may be in use by your Scene in this event handler, on the understanding + * that the Scene may, at any time, become active again. A shutdown Scene is not 'destroyed', it's simply not + * currently active. Use the [DESTROY]{@linkcode Phaser.Scenes.Events#event:DESTROY} event to completely clear resources. + */ + const SHUTDOWN: any; - /** - * A reference to the global Scale Manager. - * - * This property will only be available if defined in the Scene Injection Map. - */ - scale: Phaser.Scale.ScaleManager; + /** + * The Scene Systems Sleep Event. + * + * This event is dispatched by a Scene when it is sent to sleep, either directly via the `sleep` method, + * or as an action from another Scene. + * + * Listen to it from a Scene using `this.events.on('sleep', listener)`. + */ + const SLEEP: any; - /** - * A reference to the global Plugin Manager. - * - * The Plugin Manager is a global system that allows plugins to register themselves with it, and can then install - * those plugins into Scenes as required. - */ - plugins: Phaser.Plugins.PluginManager; + /** + * The Scene Systems Start Event. + * + * This event is dispatched by a Scene during the Scene Systems start process. Primarily used by Scene Plugins. + * + * Listen to it from a Scene using `this.events.on('start', listener)`. + */ + const START: any; - /** - * A reference to the renderer instance Phaser is using, either Canvas Renderer or WebGL Renderer. - */ - renderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer; + /** + * The Scene Transition Complete Event. + * + * This event is dispatched by the Target Scene of a transition. + * + * It happens when the transition process has completed. This occurs when the duration timer equals or exceeds the duration + * of the transition. + * + * Listen to it from a Scene using `this.events.on('transitioncomplete', listener)`. + * + * The Scene Transition event flow is as follows: + * + * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. + * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. + * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... + * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. + * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. + */ + const TRANSITION_COMPLETE: any; - /** - * This method should be overridden by your own Scenes. - * - * This method is called once per game step while the scene is running. - * @param time The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. - * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. - */ - update(time: number, delta: number): void; + /** + * The Scene Transition Init Event. + * + * This event is dispatched by the Target Scene of a transition. + * + * It happens immediately after the `Scene.init` method is called. If the Scene does not have an `init` method, + * this event is not dispatched. + * + * Listen to it from a Scene using `this.events.on('transitioninit', listener)`. + * + * The Scene Transition event flow is as follows: + * + * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. + * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. + * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... + * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. + * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. + */ + const TRANSITION_INIT: any; + + /** + * The Scene Transition Out Event. + * + * This event is dispatched by a Scene when it initiates a transition to another Scene. + * + * Listen to it from a Scene using `this.events.on('transitionout', listener)`. + * + * The Scene Transition event flow is as follows: + * + * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. + * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. + * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... + * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. + * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. + */ + const TRANSITION_OUT: any; + + /** + * The Scene Transition Start Event. + * + * This event is dispatched by the Target Scene of a transition, only if that Scene was not asleep. + * + * It happens immediately after the `Scene.create` method is called. If the Scene does not have a `create` method, + * this event is dispatched anyway. + * + * If the Target Scene was sleeping then the [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} event is + * dispatched instead of this event. + * + * Listen to it from a Scene using `this.events.on('transitionstart', listener)`. + * + * The Scene Transition event flow is as follows: + * + * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. + * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. + * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... + * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. + * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. + */ + const TRANSITION_START: any; + + /** + * The Scene Transition Wake Event. + * + * This event is dispatched by the Target Scene of a transition, only if that Scene was asleep before + * the transition began. If the Scene was not asleep the [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} event is dispatched instead. + * + * Listen to it from a Scene using `this.events.on('transitionwake', listener)`. + * + * The Scene Transition event flow is as follows: + * + * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. + * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. + * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... + * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. + * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. + */ + const TRANSITION_WAKE: any; + + /** + * The Scene Systems Update Event. + * + * This event is dispatched by a Scene during the main game loop step. + * + * The event flow for a single step of a Scene is as follows: + * + * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} + * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} + * 3. The `Scene.update` method is called, if it exists and the Scene is in a Running state, otherwise this is skipped. + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [PRE_RENDER]{@linkcode Phaser.Scenes.Events#event:PRE_RENDER} + * 6. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.events.on('update', listener)`. + * + * A Scene will only run its step if it is active. + */ + const UPDATE: any; + + /** + * The Scene Systems Wake Event. + * + * This event is dispatched by a Scene when it is woken from sleep, either directly via the `wake` method, + * or as an action from another Scene. + * + * Listen to it from a Scene using `this.events.on('wake', listener)`. + */ + const WAKE: any; + + } } @@ -89059,6 +89059,11 @@ declare namespace Phaser { */ constructor(manager: Phaser.Sound.BaseSoundManager, key: string, config?: Phaser.Types.Sound.SoundConfig); + /** + * Local reference to the sound manager. + */ + manager: Phaser.Sound.BaseSoundManager; + /** * Asset key for the sound. */ @@ -89103,6 +89108,11 @@ declare namespace Phaser { */ readonly currentMarker: Phaser.Types.Sound.SoundMarker; + /** + * Flag indicating if destroy method was called on this sound. + */ + pendingRemove: boolean; + /** * Adds a marker into the current sound. A marker is represented by name, start time, duration, and optionally config object. * This allows you to bundle multiple sounds together into a single audio file and use markers to jump between them for playback. @@ -89149,24 +89159,24 @@ declare namespace Phaser { /** * Method used internally for applying config values to some of the sound properties. */ - protected applyConfig(): void; + applyConfig(): void; /** * Method used internally for resetting values of some of the config properties. */ - protected resetConfig(): void; + resetConfig(): void; /** * Update method called automatically by sound manager on every game step. * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param delta The delta time elapsed since the last frame. */ - protected update(time: number, delta: number): void; + update(time: number, delta: number): void; /** * Method used internally to calculate total playback rate of the sound. */ - protected calculateRate(): void; + calculateRate(): void; /** * Destroys this sound and all associated events and marks it for removal from the sound manager. @@ -89232,7 +89242,7 @@ declare namespace Phaser { * @param key Asset key for the sound. * @param config An optional config object containing default sound settings. */ - addAudioSprite(key: string, config?: Phaser.Types.Sound.SoundConfig): Phaser.Sound.HTML5AudioSound | Phaser.Sound.WebAudioSound; + addAudioSprite(key: string, config?: Phaser.Types.Sound.SoundConfig): Phaser.Sound.NoAudioSound | Phaser.Sound.HTML5AudioSound | Phaser.Sound.WebAudioSound; /** * Gets the first sound in the manager matching the given key, if any. @@ -89345,7 +89355,7 @@ declare namespace Phaser { * and 2.0 doubles the audios playback speed. * @param value Global playback rate at which all the sounds will be played. */ - setRate(value: number): Phaser.Sound.BaseSoundManager; + setRate(value: number): this; /** * Global playback rate at which all the sounds will be played. @@ -89359,7 +89369,7 @@ declare namespace Phaser { * The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). * @param value The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). */ - setDetune(value: number): Phaser.Sound.BaseSoundManager; + setDetune(value: number): this; /** * Global detuning of all sounds in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29). @@ -89369,6 +89379,14 @@ declare namespace Phaser { } + /** + * Creates a Web Audio, HTML5 Audio or No Audio Sound Manager based on config and device settings. + * + * Be aware of https://developers.google.com/web/updates/2017/09/autoplay-policy-changes + * @param game Reference to the current game instance. + */ + function SoundManagerCreator(game: Phaser.Game): Phaser.Sound.HTML5AudioSoundManager | Phaser.Sound.WebAudioSoundManager | Phaser.Sound.NoAudioSoundManager; + namespace Events { /** * The Sound Complete Event. @@ -89728,6 +89746,31 @@ declare namespace Phaser { */ constructor(manager: Phaser.Sound.HTML5AudioSoundManager, key: string, config?: Phaser.Types.Sound.SoundConfig); + /** + * An array containing all HTML5 Audio tags that could be used for individual + * sound playback. Number of instances depends on the config value passed + * to the `Loader#audio` method call, default is 1. + */ + tags: HTMLAudioElement[]; + + /** + * Reference to an HTML5 Audio tag used for playing sound. + */ + audio: HTMLAudioElement; + + /** + * Timestamp as generated by the Request Animation Frame or SetTimeout + * representing the time at which the delayed sound playback should start. + * Set to 0 if sound playback is not delayed. + */ + startTime: number; + + /** + * Audio tag's playback position recorded on previous + * update method call. Set to 0 if sound is not playing. + */ + previousTime: number; + /** * Play this sound, or a marked section of it. * It always plays the sound from the start. If you want to start playback from a specific time @@ -89752,11 +89795,48 @@ declare namespace Phaser { */ stop(): boolean; + /** + * This method is used internally to pick and play the next available audio tag. + */ + pickAndPlayAudioTag(): boolean; + + /** + * This method performs the audio tag pooling logic. It first looks for + * unused audio tag to assign to this sound object. If there are no unused + * audio tags, based on HTML5AudioSoundManager#override property value, it + * looks for sound with most advanced playback and hijacks its audio tag or + * does nothing. + */ + pickAudioTag(): boolean; + + /** + * Method used for playing audio tag and catching possible exceptions + * thrown from rejected Promise returned from play method call. + */ + playCatchPromise(): void; + + /** + * This method is used internally to stop and release the current audio tag. + */ + stopAndReleaseAudioTag(): void; + + /** + * Method used internally to reset sound state, usually when stopping sound + * or when hijacking audio tag from another sound. + */ + reset(): void; + + /** + * Method used internally by sound manager for resuming sound if + * Phaser.Sound.HTML5AudioSoundManager#pauseOnBlur is set to true. + */ + onFocus(): void; + /** * Update method called automatically by sound manager on every game step. * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. */ - protected update(time: number): void; + update(time: number): void; /** * Calls Phaser.Sound.BaseSound#destroy method @@ -89765,9 +89845,19 @@ declare namespace Phaser { destroy(): void; /** - * Method used internally to calculate total playback rate of the sound. + * This method is used internally to update the mute setting of this sound. */ - protected calculateRate(): void; + updateMute(): void; + + /** + * This method is used internally to update the volume of this sound. + */ + updateVolume(): void; + + /** + * This method is used internally to update the playback rate of this sound. + */ + calculateRate(): void; /** * Boolean indicating whether the sound is muted or not. @@ -89873,6 +89963,12 @@ declare namespace Phaser { */ constructor(game: Phaser.Game); + /** + * Method used internally by sound manager for pausing sound if + * Phaser.Sound.HTML5AudioSoundManager#pauseOnBlur is set to true. + */ + onBlur(): void; + /** * Flag indicating whether if there are no idle instances of HTML5 Audio tag, * for any particular sound, if one of the used tags should be hijacked and used @@ -89914,12 +90010,6 @@ declare namespace Phaser { */ unlock(): void; - /** - * Method used internally for pausing sound manager if - * Phaser.Sound.HTML5AudioSoundManager#pauseOnBlur is set to true. - */ - protected onBlur(): void; - /** * Method used internally for resuming sound manager if * Phaser.Sound.HTML5AudioSoundManager#pauseOnBlur is set to true. @@ -89968,7 +90058,7 @@ declare namespace Phaser { * minimal functionality and prevents Phaser projects that use audio from * breaking on devices that don't support any audio playback technologies. */ - class NoAudioSound { + class NoAudioSound extends Phaser.Events.EventEmitter { /** * * @param manager Reference to the current sound manager instance. @@ -89977,6 +90067,116 @@ declare namespace Phaser { */ constructor(manager: Phaser.Sound.NoAudioSoundManager, key: string, config?: Phaser.Types.Sound.SoundConfig); + /** + * Local reference to the sound manager. + */ + manager: Phaser.Sound.BaseSoundManager; + + /** + * Asset key for the sound. + */ + readonly key: string; + + /** + * Flag indicating if sound is currently playing. + */ + readonly isPlaying: boolean; + + /** + * Flag indicating if sound is currently paused. + */ + readonly isPaused: boolean; + + /** + * A property that holds the value of sound's actual playback rate, + * after its rate and detune values has been combined with global + * rate and detune values. + */ + readonly totalRate: number; + + /** + * A value representing the duration, in seconds. + * It could be total sound duration or a marker duration. + */ + readonly duration: number; + + /** + * The total duration of the sound in seconds. + */ + readonly totalDuration: number; + + /** + * A config object used to store default sound settings' values. + * Default values will be set by properties' setters. + */ + config: Phaser.Types.Sound.SoundConfig; + + /** + * Reference to the currently used config. + * It could be default config or marker config. + */ + currentConfig: Phaser.Types.Sound.SoundConfig; + + /** + * Boolean indicating whether the sound is muted or not. + * Gets or sets the muted state of this sound. + */ + mute: boolean; + + /** + * Gets or sets the volume of this sound, a value between 0 (silence) and 1 (full volume). + */ + volume: number; + + /** + * Rate at which this Sound will be played. + * Value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed + * and 2.0 doubles the audios playback speed. + */ + rate: number; + + /** + * The detune value of this Sound, given in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29). + * The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + */ + detune: number; + + /** + * Property representing the position of playback for this sound, in seconds. + * Setting it to a specific value moves current playback to that position. + * The value given is clamped to the range 0 to current marker duration. + * Setting seek of a stopped sound has no effect. + */ + seek: number; + + /** + * Flag indicating whether or not the sound or current sound marker will loop. + */ + loop: boolean; + + /** + * Gets or sets the pan of this sound, a value between -1 (full left pan) and 1 (full right pan). + * + * Always returns zero on iOS / Safari as it doesn't support the stereo panner node. + */ + pan: number; + + /** + * Object containing markers definitions. + */ + readonly markers: {[key: string]: Phaser.Types.Sound.SoundMarker}; + + /** + * Currently playing marker. + * 'null' if whole sound is playing. + */ + readonly currentMarker: Phaser.Types.Sound.SoundMarker; + + /** + * Flag indicating if destroy method was called on this sound. + */ + pendingRemove: boolean; + /** * * @param marker Marker object. @@ -90014,6 +90214,76 @@ declare namespace Phaser { */ stop(): boolean; + /** + * Sets the muted state of this Sound. + * @param value `true` to mute this sound, `false` to unmute it. + */ + setMute(value: boolean): this; + + /** + * Sets the volume of this Sound. + * @param value The volume of the sound. + */ + setVolume(value: number): this; + + /** + * Sets the playback rate of this Sound. + * + * For example, a value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed + * and 2.0 doubles the audios playback speed. + * @param value The playback rate at of this Sound. + */ + setRate(value: number): this; + + /** + * Sets the detune value of this Sound, given in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29). + * The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + * @param value The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + */ + setDetune(value: number): this; + + /** + * Seeks to a specific point in this sound. + * @param value The point in the sound to seek to. + */ + setSeek(value: number): this; + + /** + * Sets the loop state of this Sound. + * @param value `true` to loop this sound, `false` to not loop it. + */ + setLoop(value: boolean): this; + + /** + * Sets the pan of this sound, a value between -1 (full left pan) and 1 (full right pan). + * + * Note: iOS / Safari doesn't support the stereo panner node. + * @param value The pan of the sound. A value between -1 (full left pan) and 1 (full right pan). + */ + setPan(value: number): this; + + /** + * Method used internally for applying config values to some of the sound properties. + */ + applyConfig(): void; + + /** + * Method used internally for resetting values of some of the config properties. + */ + resetConfig(): void; + + /** + * Update method called automatically by sound manager on every game step. + * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param delta The delta time elapsed since the last frame. + */ + update(time: number, delta: number): void; + + /** + * Method used internally to calculate total playback rate of the sound. + */ + calculateRate(): void; + /** * Destroys this sound and all associated events and marks it for removal from the sound manager. */ @@ -90149,12 +90419,12 @@ declare namespace Phaser { /** * Empty function for the No Audio Sound Manager. */ - setRate(): void; + setRate(): this; /** * Empty function for the No Audio Sound Manager. */ - setDetune(): void; + setDetune(): this; /** * Empty function for the No Audio Sound Manager. @@ -90178,14 +90448,6 @@ declare namespace Phaser { } - /** - * Creates a Web Audio, HTML5 Audio or No Audio Sound Manager based on config and device settings. - * - * Be aware of https://developers.google.com/web/updates/2017/09/autoplay-policy-changes - * @param game Reference to the current game instance. - */ - function SoundManagerCreator(game: Phaser.Game): Phaser.Sound.HTML5AudioSoundManager | Phaser.Sound.WebAudioSoundManager | Phaser.Sound.NoAudioSoundManager; - /** * Web Audio API implementation of the sound. */ @@ -90231,6 +90493,40 @@ declare namespace Phaser { */ pannerNode: StereoPannerNode; + /** + * The time at which the sound should have started playback from the beginning. + * + * Treat this property as read-only. + * + * Based on `BaseAudioContext.currentTime` value. + */ + playTime: number; + + /** + * The time at which the sound source should have actually started playback. + * + * Treat this property as read-only. + * + * Based on `BaseAudioContext.currentTime` value. + */ + startTime: number; + + /** + * The time at which the sound loop source should actually start playback. + * + * Based on `BaseAudioContext.currentTime` value. + */ + loopTime: number; + + /** + * An array where we keep track of all rate updates during playback. + * + * Treat this property as read-only. + * + * Array of object types: `{ time: number, rate: number }` + */ + rateUpdates: any[]; + /** * Used for keeping track when sound source playback has ended * so its state can be updated accordingly. @@ -90268,15 +90564,35 @@ declare namespace Phaser { */ stop(): boolean; + /** + * This method is only used internally and it creates a looping buffer source. + */ + createAndStartLoopBufferSource(): void; + + /** + * This method is only used internally and it creates a buffer source. + */ + createBufferSource(): AudioBufferSourceNode; + + /** + * This method is only used internally and it stops and removes a buffer source. + */ + stopAndRemoveBufferSource(): void; + + /** + * This method is only used internally and it stops and removes a looping buffer source. + */ + stopAndRemoveLoopBufferSource(): void; + /** * Method used internally for applying config values to some of the sound properties. */ - protected applyConfig(): void; + applyConfig(): void; /** * Update method called automatically by sound manager on every game step. */ - protected update(): void; + update(): void; /** * Calls Phaser.Sound.BaseSound#destroy method @@ -90287,7 +90603,18 @@ declare namespace Phaser { /** * Method used internally to calculate total playback rate of the sound. */ - protected calculateRate(): void; + calculateRate(): void; + + /** + * Method used internally for calculating current playback time of a playing sound. + */ + getCurrentTime(): void; + + /** + * Method used internally for calculating the time + * at witch the loop source should start playing. + */ + getLoopTime(): void; /** * Rate at which this Sound will be played. @@ -90516,31 +90843,6 @@ declare namespace Phaser { } namespace Structs { - namespace Events { - /** - * The Process Queue Add Event. - * - * This event is dispatched by a Process Queue when a new item is successfully moved to its active list. - * - * You will most commonly see this used by a Scene's Update List when a new Game Object has been added. - * - * In that instance, listen to this event from within a Scene using: `this.sys.updateList.on('add', listener)`. - */ - const PROCESS_QUEUE_ADD: any; - - /** - * The Process Queue Remove Event. - * - * This event is dispatched by a Process Queue when a new item is successfully removed from its active list. - * - * You will most commonly see this used by a Scene's Update List when a Game Object has been removed. - * - * In that instance, listen to this event from within a Scene using: `this.sys.updateList.on('remove', listener)`. - */ - const PROCESS_QUEUE_REMOVE: any; - - } - /** * List is a generic implementation of an ordered list which contains utility methods for retrieving, manipulating, and iterating items. */ @@ -91470,6 +91772,31 @@ declare namespace Phaser { } + namespace Events { + /** + * The Process Queue Add Event. + * + * This event is dispatched by a Process Queue when a new item is successfully moved to its active list. + * + * You will most commonly see this used by a Scene's Update List when a new Game Object has been added. + * + * In that instance, listen to this event from within a Scene using: `this.sys.updateList.on('add', listener)`. + */ + const PROCESS_QUEUE_ADD: any; + + /** + * The Process Queue Remove Event. + * + * This event is dispatched by a Process Queue when a new item is successfully removed from its active list. + * + * You will most commonly see this used by a Scene's Update List when a Game Object has been removed. + * + * In that instance, listen to this event from within a Scene using: `this.sys.updateList.on('remove', listener)`. + */ + const PROCESS_QUEUE_REMOVE: any; + + } + } namespace Textures { @@ -91689,96 +92016,6 @@ declare namespace Phaser { } - /** - * Filter Types. - */ - enum FilterMode { - /** - * Linear filter type. - */ - LINEAR, - /** - * Nearest neighbor filter type. - */ - NEAREST, - } - - namespace Events { - /** - * The Texture Add Event. - * - * This event is dispatched by the Texture Manager when a texture is added to it. - * - * Listen to this event from within a Scene using: `this.textures.on('addtexture', listener)`. - */ - const ADD: any; - - /** - * The Texture Add Key Event. - * - * This event is dispatched by the Texture Manager when a texture with the given key is added to it. - * - * Listen to this event from within a Scene using: `this.textures.on('addtexture-key', listener)`. - */ - const ADD_KEY: any; - - /** - * The Texture Load Error Event. - * - * This event is dispatched by the Texture Manager when a texture it requested to load failed. - * This only happens when base64 encoded textures fail. All other texture types are loaded via the Loader Plugin. - * - * Listen to this event from within a Scene using: `this.textures.on('onerror', listener)`. - */ - const ERROR: any; - - /** - * The Texture Load Event. - * - * This event is dispatched by the Texture Manager when a texture has finished loading on it. - * This only happens for base64 encoded textures. All other texture types are loaded via the Loader Plugin. - * - * Listen to this event from within a Scene using: `this.textures.on('onload', listener)`. - * - * This event is dispatched after the [ADD]{@linkcode Phaser.Textures.Events#event:ADD} event. - */ - const LOAD: any; - - /** - * This internal event signifies that the Texture Manager is now ready and the Game can continue booting. - * - * When a Phaser Game instance is booting for the first time, the Texture Manager has to wait on a couple of non-blocking - * async events before it's fully ready to carry on. When those complete the Texture Manager emits this event via the Game - * instance, which tells the Game to carry on booting. - */ - const READY: any; - - /** - * The Texture Remove Event. - * - * This event is dispatched by the Texture Manager when a texture is removed from it. - * - * Listen to this event from within a Scene using: `this.textures.on('removetexture', listener)`. - * - * If you have any Game Objects still using the removed texture, they will start throwing - * errors the next time they try to render. Be sure to clear all use of the texture in this event handler. - */ - const REMOVE: any; - - /** - * The Texture Remove Key Event. - * - * This event is dispatched by the Texture Manager when a texture with the given key is removed from it. - * - * Listen to this event from within a Scene using: `this.textures.on('removetexture-key', listener)`. - * - * If you have any Game Objects still using the removed texture, they will start throwing - * errors the next time they try to render. Be sure to clear all use of the texture in this event handler. - */ - const REMOVE_KEY: any; - - } - /** * A Frame is a section of a Texture. */ @@ -92051,31 +92288,6 @@ declare namespace Phaser { } - /** - * Linear filter type. - */ - const LINEAR: number; - - /** - * Nearest Neighbor filter type. - */ - const NEAREST: number; - - namespace Parsers { - /** - * Parses a KTX format Compressed Texture file and generates texture data suitable for WebGL from it. - * @param data The data object created by the Compressed Texture File Loader. - */ - function KTXParser(data: ArrayBuffer): Phaser.Types.Textures.CompressedTextureData; - - /** - * Parses a PVR format Compressed Texture file and generates texture data suitable for WebGL from it. - * @param data The data object created by the Compressed Texture File Loader. - */ - function PVRParser(data: ArrayBuffer): Phaser.Types.Textures.CompressedTextureData; - - } - /** * A Texture consists of a source, usually an Image from the Cache, and a collection of Frames. * The Frames represent the different areas of the Texture. For example a texture atlas @@ -92784,802 +92996,124 @@ declare namespace Phaser { } + /** + * Filter Types. + */ + enum FilterMode { + /** + * Linear filter type. + */ + LINEAR, + /** + * Nearest neighbor filter type. + */ + NEAREST, + } + + namespace Events { + /** + * The Texture Add Event. + * + * This event is dispatched by the Texture Manager when a texture is added to it. + * + * Listen to this event from within a Scene using: `this.textures.on('addtexture', listener)`. + */ + const ADD: any; + + /** + * The Texture Add Key Event. + * + * This event is dispatched by the Texture Manager when a texture with the given key is added to it. + * + * Listen to this event from within a Scene using: `this.textures.on('addtexture-key', listener)`. + */ + const ADD_KEY: any; + + /** + * The Texture Load Error Event. + * + * This event is dispatched by the Texture Manager when a texture it requested to load failed. + * This only happens when base64 encoded textures fail. All other texture types are loaded via the Loader Plugin. + * + * Listen to this event from within a Scene using: `this.textures.on('onerror', listener)`. + */ + const ERROR: any; + + /** + * The Texture Load Event. + * + * This event is dispatched by the Texture Manager when a texture has finished loading on it. + * This only happens for base64 encoded textures. All other texture types are loaded via the Loader Plugin. + * + * Listen to this event from within a Scene using: `this.textures.on('onload', listener)`. + * + * This event is dispatched after the [ADD]{@linkcode Phaser.Textures.Events#event:ADD} event. + */ + const LOAD: any; + + /** + * This internal event signifies that the Texture Manager is now ready and the Game can continue booting. + * + * When a Phaser Game instance is booting for the first time, the Texture Manager has to wait on a couple of non-blocking + * async events before it's fully ready to carry on. When those complete the Texture Manager emits this event via the Game + * instance, which tells the Game to carry on booting. + */ + const READY: any; + + /** + * The Texture Remove Event. + * + * This event is dispatched by the Texture Manager when a texture is removed from it. + * + * Listen to this event from within a Scene using: `this.textures.on('removetexture', listener)`. + * + * If you have any Game Objects still using the removed texture, they will start throwing + * errors the next time they try to render. Be sure to clear all use of the texture in this event handler. + */ + const REMOVE: any; + + /** + * The Texture Remove Key Event. + * + * This event is dispatched by the Texture Manager when a texture with the given key is removed from it. + * + * Listen to this event from within a Scene using: `this.textures.on('removetexture-key', listener)`. + * + * If you have any Game Objects still using the removed texture, they will start throwing + * errors the next time they try to render. Be sure to clear all use of the texture in this event handler. + */ + const REMOVE_KEY: any; + + } + + /** + * Linear filter type. + */ + const LINEAR: number; + + /** + * Nearest Neighbor filter type. + */ + const NEAREST: number; + + namespace Parsers { + /** + * Parses a KTX format Compressed Texture file and generates texture data suitable for WebGL from it. + * @param data The data object created by the Compressed Texture File Loader. + */ + function KTXParser(data: ArrayBuffer): Phaser.Types.Textures.CompressedTextureData; + + /** + * Parses a PVR format Compressed Texture file and generates texture data suitable for WebGL from it. + * @param data The data object created by the Compressed Texture File Loader. + */ + function PVRParser(data: ArrayBuffer): Phaser.Types.Textures.CompressedTextureData; + + } + } namespace Tilemaps { - namespace Components { - /** - * Calculates interesting faces at the given tile coordinates of the specified layer. Interesting - * faces are used internally for optimizing collisions against tiles. This method is mostly used - * internally to optimize recalculating faces when only one tile has been changed. - * @param tileX The x coordinate. - * @param tileY The y coordinate. - * @param layer The Tilemap Layer to act upon. - */ - function CalculateFacesAt(tileX: number, tileY: number, layer: Phaser.Tilemaps.LayerData): void; - - /** - * Calculates interesting faces within the rectangular area specified (in tile coordinates) of the - * layer. Interesting faces are used internally for optimizing collisions against tiles. This method - * is mostly used internally. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. - * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. - * @param width How many tiles wide from the `tileX` index the area will be. - * @param height How many tiles tall from the `tileY` index the area will be. - * @param layer The Tilemap Layer to act upon. - */ - function CalculateFacesWithin(tileX: number, tileY: number, width: number, height: number, layer: Phaser.Tilemaps.LayerData): void; - - /** - * Checks if the given tile coordinate is within the isometric layer bounds, or not. - * @param tileX The x coordinate, in tiles, not pixels. - * @param tileY The y coordinate, in tiles, not pixels. - * @param layer The Tilemap Layer to check against. - * @param camera The Camera to run the cull check against. - */ - function CheckIsoBounds(tileX: number, tileY: number, layer: Phaser.Tilemaps.LayerData, camera?: Phaser.Cameras.Scene2D.Camera): boolean; - - /** - * Copies the tiles in the source rectangular area to a new destination (all specified in tile - * coordinates) within the layer. This copies all tile properties & recalculates collision - * information in the destination region. - * @param srcTileX The x coordinate of the area to copy from, in tiles, not pixels. - * @param srcTileY The y coordinate of the area to copy from, in tiles, not pixels. - * @param width The width of the area to copy, in tiles, not pixels. - * @param height The height of the area to copy, in tiles, not pixels. - * @param destTileX The x coordinate of the area to copy to, in tiles, not pixels. - * @param destTileY The y coordinate of the area to copy to, in tiles, not pixels. - * @param recalculateFaces `true` if the faces data should be recalculated. - * @param layer The Tilemap Layer to act upon. - */ - function Copy(srcTileX: number, srcTileY: number, width: number, height: number, destTileX: number, destTileY: number, recalculateFaces: boolean, layer: Phaser.Tilemaps.LayerData): void; - - /** - * Creates a Sprite for every object matching the given tile indexes in the layer. You can - * optionally specify if each tile will be replaced with a new tile after the Sprite has been - * created. This is useful if you want to lay down special tiles in a level that are converted to - * Sprites, but want to replace the tile itself with a floor tile or similar once converted. - * @param indexes The tile index, or array of indexes, to create Sprites from. - * @param replacements The tile index, or array of indexes, to change a converted tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a one-to-one mapping with the indexes array. - * @param spriteConfig The config object to pass into the Sprite creator (i.e. scene.make.sprite). - * @param scene The Scene to create the Sprites within. - * @param camera The Camera to use when determining the world XY - * @param layer The Tilemap Layer to act upon. - */ - function CreateFromTiles(indexes: number | number[], replacements: number | number[], spriteConfig: Phaser.Types.GameObjects.Sprite.SpriteConfig, scene: Phaser.Scene, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.GameObjects.Sprite[]; - - /** - * Returns the bounds in the given orthogonal layer that are within the cameras viewport. - * This is used internally by the cull tiles function. - * @param layer The Tilemap Layer to act upon. - * @param camera The Camera to run the cull check against. - */ - function CullBounds(layer: Phaser.Tilemaps.LayerData, camera: Phaser.Cameras.Scene2D.Camera): Phaser.Geom.Rectangle; - - /** - * Returns the tiles in the given layer that are within the cameras viewport. This is used internally. - * @param layer The Tilemap Layer to act upon. - * @param camera The Camera to run the cull check against. - * @param outputArray An optional array to store the Tile objects within. - * @param renderOrder The rendering order constant. Default 0. - */ - function CullTiles(layer: Phaser.Tilemaps.LayerData, camera: Phaser.Cameras.Scene2D.Camera, outputArray?: any[], renderOrder?: number): Phaser.Tilemaps.Tile[]; - - /** - * Sets the tiles in the given rectangular area (in tile coordinates) of the layer with the - * specified index. Tiles will be set to collide if the given index is a colliding index. - * Collision information in the region will be recalculated. - * @param index The tile index to fill the area with. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. - * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. - * @param width How many tiles wide from the `tileX` index the area will be. - * @param height How many tiles tall from the `tileY` index the area will be. - * @param recalculateFaces `true` if the faces data should be recalculated. - * @param layer The tile layer to use. If not given the current layer is used. - */ - function Fill(index: number, tileX: number, tileY: number, width: number, height: number, recalculateFaces: boolean, layer: Phaser.Tilemaps.LayerData): void; - - /** - * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given - * filter callback function. Any tiles that pass the filter test (i.e. where the callback returns - * true) will returned as a new array. Similar to Array.prototype.Filter in vanilla JS. - * @param callback The callback. Each tile in the given area will be passed to this - * callback as the first and only parameter. The callback should return true for tiles that pass the - * filter. - * @param context The context under which the callback should be run. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param width How many tiles wide from the `tileX` index the area will be. - * @param height How many tiles tall from the `tileY` index the area will be. - * @param filteringOptions Optional filters to apply when getting the tiles. - * @param layer The Tilemap Layer to act upon. - */ - function FilterTiles(callback: Function, context: object, tileX: number, tileY: number, width: number, height: number, filteringOptions: Phaser.Types.Tilemaps.FilteringOptions, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile[]; - - /** - * Searches the entire map layer for the first tile matching the given index, then returns that Tile - * object. If no match is found, it returns null. The search starts from the top-left tile and - * continues horizontally until it hits the end of the row, then it drops down to the next column. - * If the reverse boolean is true, it scans starting from the bottom-right corner traveling up to - * the top-left. - * @param index The tile index value to search for. - * @param skip The number of times to skip a matching tile before returning. - * @param reverse If true it will scan the layer in reverse, starting at the bottom-right. Otherwise it scans from the top-left. - * @param layer The Tilemap Layer to act upon. - */ - function FindByIndex(index: number, skip: number, reverse: boolean, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile | null; - - /** - * Find the first tile in the given rectangular area (in tile coordinates) of the layer that - * satisfies the provided testing function. I.e. finds the first tile for which `callback` returns - * true. Similar to Array.prototype.find in vanilla JS. - * @param callback The callback. Each tile in the given area will be passed to this callback as the first and only parameter. - * @param context The context under which the callback should be run. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param width How many tiles wide from the `tileX` index the area will be. - * @param height How many tiles tall from the `tileY` index the area will be. - * @param filteringOptions Optional filters to apply when getting the tiles. - * @param layer The Tilemap Layer to act upon. - */ - function FindTile(callback: FindTileCallback, context: object, tileX: number, tileY: number, width: number, height: number, filteringOptions: Phaser.Types.Tilemaps.FilteringOptions, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile | null; - - /** - * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given - * callback. Similar to Array.prototype.forEach in vanilla JS. - * @param callback The callback. Each tile in the given area will be passed to this callback as the first and only parameter. - * @param context The context under which the callback should be run. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param width How many tiles wide from the `tileX` index the area will be. - * @param height How many tiles tall from the `tileY` index the area will be. - * @param filteringOptions Optional filters to apply when getting the tiles. - * @param layer The Tilemap Layer to act upon. - */ - function ForEachTile(callback: EachTileCallback, context: object, tileX: number, tileY: number, width: number, height: number, filteringOptions: Phaser.Types.Tilemaps.FilteringOptions, layer: Phaser.Tilemaps.LayerData): void; - - /** - * Gets the correct function to use to cull tiles, based on the map orientation. - * @param orientation The Tilemap orientation constant. - */ - function GetCullTilesFunction(orientation: number): Function; - - /** - * Gets a tile at the given tile coordinates from the given layer. - * @param tileX X position to get the tile from (given in tile units, not pixels). - * @param tileY Y position to get the tile from (given in tile units, not pixels). - * @param nonNull If true getTile won't return null for empty tiles, but a Tile object with an index of -1. - * @param layer The Tilemap Layer to act upon. - */ - function GetTileAt(tileX: number, tileY: number, nonNull: boolean, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile; - - /** - * Gets a tile at the given world coordinates from the given layer. - * @param worldX X position to get the tile from (given in pixels) - * @param worldY Y position to get the tile from (given in pixels) - * @param nonNull If true, function won't return null for empty tiles, but a Tile object with an index of -1. - * @param camera The Camera to use when calculating the tile index from the world values. - * @param layer The Tilemap Layer to act upon. - */ - function GetTileAtWorldXY(worldX: number, worldY: number, nonNull: boolean, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile; - - /** - * Gets the tiles in the given rectangular area (in tile coordinates) of the layer. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. - * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. - * @param width How many tiles wide from the `tileX` index the area will be. - * @param height How many tiles tall from the `tileY` index the area will be. - * @param filteringOptions Optional filters to apply when getting the tiles. - * @param layer The Tilemap Layer to act upon. - */ - function GetTilesWithin(tileX: number, tileY: number, width: number, height: number, filteringOptions: Phaser.Types.Tilemaps.FilteringOptions, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile[]; - - /** - * Gets the tiles that overlap with the given shape in the given layer. The shape must be a Circle, - * Line, Rectangle or Triangle. The shape should be in world coordinates. - * @param shape A shape in world (pixel) coordinates - * @param filteringOptions Optional filters to apply when getting the tiles. - * @param camera The Camera to use when calculating the tile index from the world values. - * @param layer The Tilemap Layer to act upon. - */ - function GetTilesWithinShape(shape: Phaser.Geom.Circle | Phaser.Geom.Line | Phaser.Geom.Rectangle | Phaser.Geom.Triangle, filteringOptions: Phaser.Types.Tilemaps.FilteringOptions, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile[]; - - /** - * Gets the tiles in the given rectangular area (in world coordinates) of the layer. - * @param worldX The world x coordinate for the top-left of the area. - * @param worldY The world y coordinate for the top-left of the area. - * @param width The width of the area. - * @param height The height of the area. - * @param filteringOptions Optional filters to apply when getting the tiles. - * @param camera The Camera to use when factoring in which tiles to return. - * @param layer The Tilemap Layer to act upon. - */ - function GetTilesWithinWorldXY(worldX: number, worldY: number, width: number, height: number, filteringOptions: Phaser.Types.Tilemaps.FilteringOptions, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile[]; - - /** - * Gets the correct function to use to translate tiles, based on the map orientation. - * @param orientation The Tilemap orientation constant. - */ - function GetTileToWorldXFunction(orientation: number): Function; - - /** - * Gets the correct function to use to translate tiles, based on the map orientation. - * @param orientation The Tilemap orientation constant. - */ - function GetTileToWorldXYFunction(orientation: number): Function; - - /** - * Gets the correct function to use to translate tiles, based on the map orientation. - * @param orientation The Tilemap orientation constant. - */ - function GetTileToWorldYFunction(orientation: number): Function; - - /** - * Gets the correct function to use to translate tiles, based on the map orientation. - * @param orientation The Tilemap orientation constant. - */ - function GetWorldToTileXFunction(orientation: number): Function; - - /** - * Gets the correct function to use to translate tiles, based on the map orientation. - * @param orientation The Tilemap orientation constant. - */ - function GetWorldToTileXYFunction(orientation: number): Function; - - /** - * Gets the correct function to use to translate tiles, based on the map orientation. - * @param orientation The Tilemap orientation constant. - */ - function GetWorldToTileYFunction(orientation: number): Function; - - /** - * Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns - * false if there is no tile or if the tile at that location has an index of -1. - * @param tileX X position to get the tile from (given in tile units, not pixels). - * @param tileY Y position to get the tile from (given in tile units, not pixels). - * @param layer The Tilemap Layer to act upon. - */ - function HasTileAt(tileX: number, tileY: number, layer: Phaser.Tilemaps.LayerData): boolean | null; - - /** - * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns - * false if there is no tile or if the tile at that location has an index of -1. - * @param worldX The X coordinate of the world position. - * @param worldY The Y coordinate of the world position. - * @param camera The Camera to use when factoring in which tiles to return. - * @param layer The Tilemap Layer to act upon. - */ - function HasTileAtWorldXY(worldX: number, worldY: number, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): boolean | null; - - /** - * Returns the bounds in the given layer that are within the camera's viewport. - * This is used internally by the cull tiles function. - * @param layer The Tilemap Layer to act upon. - * @param camera The Camera to run the cull check against. - */ - function HexagonalCullBounds(layer: Phaser.Tilemaps.LayerData, camera: Phaser.Cameras.Scene2D.Camera): object; - - /** - * Returns the tiles in the given layer that are within the cameras viewport. This is used internally. - * @param layer The Tilemap Layer to act upon. - * @param camera The Camera to run the cull check against. - * @param outputArray An optional array to store the Tile objects within. - * @param renderOrder The rendering order constant. Default 0. - */ - function HexagonalCullTiles(layer: Phaser.Tilemaps.LayerData, camera: Phaser.Cameras.Scene2D.Camera, outputArray?: any[], renderOrder?: number): Phaser.Tilemaps.Tile[]; - - /** - * Converts from hexagonal tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the - * layer's position, scale and scroll. This will return a new Vector2 object or update the given - * `point` object. - * @param tileX The x coordinate, in tiles, not pixels. - * @param tileY The y coordinate, in tiles, not pixels. - * @param point A Vector2 to store the coordinates in. If not given a new Vector2 is created. - * @param camera The Camera to use when calculating the tile index from the world values. - * @param layer The Tilemap Layer to act upon. - */ - function HexagonalTileToWorldXY(tileX: number, tileY: number, point: Phaser.Math.Vector2, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Math.Vector2; - - /** - * Converts from hexagonal tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the - * layer's position, scale and scroll. - * @param tileY The y coordinate, in tiles, not pixels. - * @param camera The Camera to use when calculating the tile index from the world values. - * @param layer The Tilemap Layer to act upon. - */ - function HexagonalTileToWorldY(tileY: number, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): number; - - /** - * Converts from world XY coordinates (pixels) to hexagonal tile XY coordinates (tile units), factoring in the - * layer's position, scale and scroll. This will return a new Vector2 object or update the given - * `point` object. - * @param worldX The x coordinate to be converted, in pixels, not tiles. - * @param worldY The y coordinate to be converted, in pixels, not tiles. - * @param snapToFloor Whether or not to round the tile coordinates down to the nearest integer. - * @param point A Vector2 to store the coordinates in. If not given a new Vector2 is created. - * @param camera The Camera to use when calculating the tile index from the world values. - * @param layer The Tilemap Layer to act upon. - */ - function HexagonalWorldToTileXY(worldX: number, worldY: number, snapToFloor: boolean, point: Phaser.Math.Vector2, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Math.Vector2; - - /** - * Converts from world Y coordinates (pixels) to hexagonal tile Y coordinates (tile units), factoring in the - * layers position, scale and scroll. - * @param worldY The y coordinate to be converted, in pixels, not tiles. - * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. - * @param camera The Camera to use when calculating the tile index from the world values. - * @param layer The Tilemap Layer to act upon. - */ - function HexagonalWorldToTileY(worldY: number, snapToFloor: boolean, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): number; - - /** - * Checks if the given tile coordinates are within the bounds of the layer. - * @param tileX The x coordinate, in tiles, not pixels. - * @param tileY The y coordinate, in tiles, not pixels. - * @param layer The Tilemap Layer to act upon. - */ - function IsInLayerBounds(tileX: number, tileY: number, layer: Phaser.Tilemaps.LayerData): boolean; - - /** - * Returns the tiles in the given layer that are within the cameras viewport. This is used internally. - * @param layer The Tilemap Layer to act upon. - * @param camera The Camera to run the cull check against. - * @param outputArray An optional array to store the Tile objects within. - * @param renderOrder The rendering order constant. Default 0. - */ - function IsometricCullTiles(layer: Phaser.Tilemaps.LayerData, camera: Phaser.Cameras.Scene2D.Camera, outputArray?: any[], renderOrder?: number): Phaser.Tilemaps.Tile[]; - - /** - * Converts from isometric tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the - * layer's position, scale and scroll. This will return a new Vector2 object or update the given - * `point` object. - * @param tileX The x coordinate, in tiles, not pixels. - * @param tileY The y coordinate, in tiles, not pixels. - * @param point A Vector2 to store the coordinates in. If not given a new Vector2 is created. - * @param camera The Camera to use when calculating the tile index from the world values. - * @param layer The Tilemap Layer to act upon. - */ - function IsometricTileToWorldXY(tileX: number, tileY: number, point: Phaser.Math.Vector2, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Math.Vector2; - - /** - * Converts from world XY coordinates (pixels) to isometric tile XY coordinates (tile units), factoring in the - * layer's position, scale and scroll. This will return a new Vector2 object or update the given - * `point` object. - * @param worldX The x coordinate to be converted, in pixels, not tiles. - * @param worldY The y coordinate to be converted, in pixels, not tiles. - * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. - * @param point A Vector2 to store the coordinates in. If not given a new Vector2 is created. - * @param camera The Camera to use when calculating the tile index from the world values. - * @param layer The Tilemap Layer to act upon. - */ - function IsometricWorldToTileXY(worldX: number, worldY: number, snapToFloor: boolean, point: Phaser.Math.Vector2, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Math.Vector2; - - /** - * Puts a tile at the given tile coordinates in the specified layer. You can pass in either an index - * or a Tile object. If you pass in a Tile, all attributes will be copied over to the specified - * location. If you pass in an index, only the index at the specified location will be changed. - * Collision information will be recalculated at the specified location. - * @param tile The index of this tile to set or a Tile object. - * @param tileX The x coordinate, in tiles, not pixels. - * @param tileY The y coordinate, in tiles, not pixels. - * @param recalculateFaces `true` if the faces data should be recalculated. - * @param layer The Tilemap Layer to act upon. - */ - function PutTileAt(tile: number | Phaser.Tilemaps.Tile, tileX: number, tileY: number, recalculateFaces: boolean, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile; - - /** - * Puts a tile at the given world coordinates (pixels) in the specified layer. You can pass in either - * an index or a Tile object. If you pass in a Tile, all attributes will be copied over to the - * specified location. If you pass in an index, only the index at the specified location will be - * changed. Collision information will be recalculated at the specified location. - * @param tile The index of this tile to set or a Tile object. - * @param worldX The x coordinate, in pixels. - * @param worldY The y coordinate, in pixels. - * @param recalculateFaces `true` if the faces data should be recalculated. - * @param camera The Camera to use when calculating the tile index from the world values. - * @param layer The Tilemap Layer to act upon. - */ - function PutTileAtWorldXY(tile: number | Phaser.Tilemaps.Tile, worldX: number, worldY: number, recalculateFaces: boolean, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile; - - /** - * Puts an array of tiles or a 2D array of tiles at the given tile coordinates in the specified - * layer. The array can be composed of either tile indexes or Tile objects. If you pass in a Tile, - * all attributes will be copied over to the specified location. If you pass in an index, only the - * index at the specified location will be changed. Collision information will be recalculated - * within the region tiles were changed. - * @param tile A row (array) or grid (2D array) of Tiles or tile indexes to place. - * @param tileX The x coordinate, in tiles, not pixels. - * @param tileY The y coordinate, in tiles, not pixels. - * @param recalculateFaces `true` if the faces data should be recalculated. - * @param layer The Tilemap Layer to act upon. - */ - function PutTilesAt(tile: number[] | number[][] | Phaser.Tilemaps.Tile[] | Phaser.Tilemaps.Tile[][], tileX: number, tileY: number, recalculateFaces: boolean, layer: Phaser.Tilemaps.LayerData): void; - - /** - * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the - * specified layer. Each tile will receive a new index. If an array of indexes is passed in, then - * those will be used for randomly assigning new tile indexes. If an array is not provided, the - * indexes found within the region (excluding -1) will be used for randomly assigning new tile - * indexes. This method only modifies tile indexes and does not change collision information. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. - * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. - * @param width How many tiles wide from the `tileX` index the area will be. - * @param height How many tiles tall from the `tileY` index the area will be. - * @param indexes An array of indexes to randomly draw from during randomization. - * @param layer The Tilemap Layer to act upon. - */ - function Randomize(tileX: number, tileY: number, width: number, height: number, indexes: number[], layer: Phaser.Tilemaps.LayerData): void; - - /** - * Removes the tile at the given tile coordinates in the specified layer and updates the layer's - * collision information. - * @param tileX The x coordinate. - * @param tileY The y coordinate. - * @param replaceWithNull If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. - * @param recalculateFaces `true` if the faces data should be recalculated. - * @param layer The Tilemap Layer to act upon. - */ - function RemoveTileAt(tileX: number, tileY: number, replaceWithNull: boolean, recalculateFaces: boolean, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile; - - /** - * Removes the tile at the given world coordinates in the specified layer and updates the layer's - * collision information. - * @param worldX The x coordinate, in pixels. - * @param worldY The y coordinate, in pixels. - * @param replaceWithNull If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. - * @param recalculateFaces `true` if the faces data should be recalculated. - * @param camera The Camera to use when calculating the tile index from the world values. - * @param layer The Tilemap Layer to act upon. - */ - function RemoveTileAtWorldXY(worldX: number, worldY: number, replaceWithNull: boolean, recalculateFaces: boolean, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile; - - /** - * Draws a debug representation of the layer to the given Graphics. This is helpful when you want to - * get a quick idea of which of your tiles are colliding and which have interesting faces. The tiles - * are drawn starting at (0, 0) in the Graphics, allowing you to place the debug representation - * wherever you want on the screen. - * @param graphics The target Graphics object to draw upon. - * @param styleConfig An object specifying the colors to use for the debug drawing. - * @param layer The Tilemap Layer to act upon. - */ - function RenderDebug(graphics: Phaser.GameObjects.Graphics, styleConfig: Phaser.Types.Tilemaps.DebugStyleOptions, layer: Phaser.Tilemaps.LayerData): void; - - /** - * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching - * `findIndex` and updates their index to match `newIndex`. This only modifies the index and does - * not change collision information. - * @param findIndex The index of the tile to search for. - * @param newIndex The index of the tile to replace it with. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. - * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. - * @param width How many tiles wide from the `tileX` index the area will be. - * @param height How many tiles tall from the `tileY` index the area will be. - * @param layer The Tilemap Layer to act upon. - */ - function ReplaceByIndex(findIndex: number, newIndex: number, tileX: number, tileY: number, width: number, height: number, layer: Phaser.Tilemaps.LayerData): void; - - /** - * Returns the tiles in the given layer that are within the cameras viewport. This is used internally. - * @param layer The Tilemap Layer to act upon. - * @param bounds An object containing the `left`, `right`, `top` and `bottom` bounds. - * @param renderOrder The rendering order constant. - * @param outputArray The array to store the Tile objects within. - */ - function RunCull(layer: Phaser.Tilemaps.LayerData, bounds: object, renderOrder: number, outputArray: any[]): Phaser.Tilemaps.Tile[]; - - /** - * Sets collision on the given tile or tiles within a layer by index. You can pass in either a - * single numeric index or an array of indexes: [2, 3, 15, 20]. The `collides` parameter controls if - * collision will be enabled (true) or disabled (false). - * @param indexes Either a single tile index, or an array of tile indexes. - * @param collides If true it will enable collision. If false it will clear collision. - * @param recalculateFaces Whether or not to recalculate the tile faces after the update. - * @param layer The Tilemap Layer to act upon. - * @param updateLayer If true, updates the current tiles on the layer. Set to false if no tiles have been placed for significant performance boost. Default true. - */ - function SetCollision(indexes: number | any[], collides: boolean, recalculateFaces: boolean, layer: Phaser.Tilemaps.LayerData, updateLayer?: boolean): void; - - /** - * Sets collision on a range of tiles in a layer whose index is between the specified `start` and - * `stop` (inclusive). Calling this with a start value of 10 and a stop value of 14 would set - * collision for tiles 10, 11, 12, 13 and 14. The `collides` parameter controls if collision will be - * enabled (true) or disabled (false). - * @param start The first index of the tile to be set for collision. - * @param stop The last index of the tile to be set for collision. - * @param collides If true it will enable collision. If false it will clear collision. - * @param recalculateFaces Whether or not to recalculate the tile faces after the update. - * @param layer The Tilemap Layer to act upon. - * @param updateLayer If true, updates the current tiles on the layer. Set to false if no tiles have been placed for significant performance boost. Default true. - */ - function SetCollisionBetween(start: number, stop: number, collides: boolean, recalculateFaces: boolean, layer: Phaser.Tilemaps.LayerData, updateLayer?: boolean): void; - - /** - * Sets collision on all tiles in the given layer, except for tiles that have an index specified in - * the given array. The `collides` parameter controls if collision will be enabled (true) or - * disabled (false). Tile indexes not currently in the layer are not affected. - * @param indexes An array of the tile indexes to not be counted for collision. - * @param collides If true it will enable collision. If false it will clear collision. - * @param recalculateFaces Whether or not to recalculate the tile faces after the update. - * @param layer The Tilemap Layer to act upon. - */ - function SetCollisionByExclusion(indexes: number[], collides: boolean, recalculateFaces: boolean, layer: Phaser.Tilemaps.LayerData): void; - - /** - * Sets collision on the tiles within a layer by checking tile properties. If a tile has a property - * that matches the given properties object, its collision flag will be set. The `collides` - * parameter controls if collision will be enabled (true) or disabled (false). Passing in - * `{ collides: true }` would update the collision flag on any tiles with a "collides" property that - * has a value of true. Any tile that doesn't have "collides" set to true will be ignored. You can - * also use an array of values, e.g. `{ types: ["stone", "lava", "sand" ] }`. If a tile has a - * "types" property that matches any of those values, its collision flag will be updated. - * @param properties An object with tile properties and corresponding values that should be checked. - * @param collides If true it will enable collision. If false it will clear collision. - * @param recalculateFaces Whether or not to recalculate the tile faces after the update. - * @param layer The Tilemap Layer to act upon. - */ - function SetCollisionByProperty(properties: object, collides: boolean, recalculateFaces: boolean, layer: Phaser.Tilemaps.LayerData): void; - - /** - * Sets collision on the tiles within a layer by checking each tile's collision group data - * (typically defined in Tiled within the tileset collision editor). If any objects are found within - * a tile's collision group, the tile's colliding information will be set. The `collides` parameter - * controls if collision will be enabled (true) or disabled (false). - * @param collides If true it will enable collision. If false it will clear collision. - * @param recalculateFaces Whether or not to recalculate the tile faces after the update. - * @param layer The Tilemap Layer to act upon. - */ - function SetCollisionFromCollisionGroup(collides: boolean, recalculateFaces: boolean, layer: Phaser.Tilemaps.LayerData): void; - - /** - * Internally used method to keep track of the tile indexes that collide within a layer. This - * updates LayerData.collideIndexes to either contain or not contain the given `tileIndex`. - * @param tileIndex The tile index to set the collision boolean for. - * @param collides Should the tile index collide or not? - * @param layer The Tilemap Layer to act upon. - */ - function SetLayerCollisionIndex(tileIndex: number, collides: boolean, layer: Phaser.Tilemaps.LayerData): void; - - /** - * Internally used method to set the colliding state of a tile. This does not recalculate - * interesting faces. - * @param tile The Tile to set the collision on. - * @param collides Should the tile index collide or not? Default true. - */ - function SetTileCollision(tile: Phaser.Tilemaps.Tile, collides?: boolean): void; - - /** - * Sets a global collision callback for the given tile index within the layer. This will affect all - * tiles on this layer that have the same index. If a callback is already set for the tile index it - * will be replaced. Set the callback to null to remove it. If you want to set a callback for a tile - * at a specific location on the map then see setTileLocationCallback. - * @param indexes Either a single tile index, or an array of tile indexes to have a collision callback set for. - * @param callback The callback that will be invoked when the tile is collided with. - * @param callbackContext The context under which the callback is called. - * @param layer The Tilemap Layer to act upon. - */ - function SetTileIndexCallback(indexes: number | any[], callback: Function, callbackContext: object, layer: Phaser.Tilemaps.LayerData): void; - - /** - * Sets a collision callback for the given rectangular area (in tile coordinates) within the layer. - * If a callback is already set for the tile index it will be replaced. Set the callback to null to - * remove it. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. - * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. - * @param width How many tiles wide from the `tileX` index the area will be. - * @param height How many tiles tall from the `tileY` index the area will be. - * @param callback The callback that will be invoked when the tile is collided with. - * @param callbackContext The context under which the callback is called. - * @param layer The Tilemap Layer to act upon. - */ - function SetTileLocationCallback(tileX: number, tileY: number, width: number, height: number, callback: Function, callbackContext: object, layer: Phaser.Tilemaps.LayerData): void; - - /** - * Shuffles the tiles in a rectangular region (specified in tile coordinates) within the given - * layer. It will only randomize the tiles in that area, so if they're all the same nothing will - * appear to have changed! This method only modifies tile indexes and does not change collision - * information. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. - * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. - * @param width How many tiles wide from the `tileX` index the area will be. - * @param height How many tiles tall from the `tileY` index the area will be. - * @param layer The Tilemap Layer to act upon. - */ - function Shuffle(tileX: number, tileY: number, width: number, height: number, layer: Phaser.Tilemaps.LayerData): void; - - /** - * Returns the bounds in the given layer that are within the camera's viewport. - * This is used internally by the cull tiles function. - * @param layer The Tilemap Layer to act upon. - * @param camera The Camera to run the cull check against. - */ - function StaggeredCullBounds(layer: Phaser.Tilemaps.LayerData, camera: Phaser.Cameras.Scene2D.Camera): object; - - /** - * Returns the tiles in the given layer that are within the cameras viewport. This is used internally. - * @param layer The Tilemap Layer to act upon. - * @param camera The Camera to run the cull check against. - * @param outputArray An optional array to store the Tile objects within. - * @param renderOrder The rendering order constant. Default 0. - */ - function StaggeredCullTiles(layer: Phaser.Tilemaps.LayerData, camera: Phaser.Cameras.Scene2D.Camera, outputArray?: any[], renderOrder?: number): Phaser.Tilemaps.Tile[]; - - /** - * Converts from staggered tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the - * layer's position, scale and scroll. This will return a new Vector2 object or update the given - * `point` object. - * @param tileX The x coordinate, in tiles, not pixels. - * @param tileY The y coordinate, in tiles, not pixels. - * @param point A Vector2 to store the coordinates in. If not given a new Vector2 is created. - * @param camera The Camera to use when calculating the tile index from the world values. - * @param layer The Tilemap Layer to act upon. - */ - function StaggeredTileToWorldXY(tileX: number, tileY: number, point: Phaser.Math.Vector2, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Math.Vector2; - - /** - * Converts from staggered tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the - * layers position, scale and scroll. - * @param tileY The y coordinate, in tiles, not pixels. - * @param camera The Camera to use when calculating the tile index from the world values. - * @param layer The Tilemap Layer to act upon. - */ - function StaggeredTileToWorldY(tileY: number, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): number; - - /** - * Converts from world XY coordinates (pixels) to staggered tile XY coordinates (tile units), factoring in the - * layer's position, scale and scroll. This will return a new Vector2 object or update the given - * `point` object. - * @param worldX The x coordinate to be converted, in pixels, not tiles. - * @param worldY The y coordinate to be converted, in pixels, not tiles. - * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. - * @param point A Vector2 to store the coordinates in. If not given a new Vector2 is created. - * @param camera The Camera to use when calculating the tile index from the world values. - * @param layer The Tilemap Layer to act upon. - */ - function StaggeredWorldToTileXY(worldX: number, worldY: number, snapToFloor: boolean, point: Phaser.Math.Vector2, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Math.Vector2; - - /** - * Converts from world Y coordinates (pixels) to staggered tile Y coordinates (tile units), factoring in the - * layers position, scale and scroll. - * @param worldY The y coordinate to be converted, in pixels, not tiles. - * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. - * @param camera The Camera to use when calculating the tile index from the world values. - * @param layer The Tilemap Layer to act upon. - */ - function StaggeredWorldToTileY(worldY: number, snapToFloor: boolean, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): number; - - /** - * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching - * `indexA` and swaps then with `indexB`. This only modifies the index and does not change collision - * information. - * @param tileA First tile index. - * @param tileB Second tile index. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. - * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. - * @param width How many tiles wide from the `tileX` index the area will be. - * @param height How many tiles tall from the `tileY` index the area will be. - * @param layer The Tilemap Layer to act upon. - */ - function SwapByIndex(tileA: number, tileB: number, tileX: number, tileY: number, width: number, height: number, layer: Phaser.Tilemaps.LayerData): void; - - /** - * Converts from tile X coordinates (tile units) to world X coordinates (pixels), factoring in the - * layer's position, scale and scroll. - * @param tileX The x coordinate, in tiles, not pixels. - * @param camera The Camera to use when calculating the tile index from the world values. - * @param layer The Tilemap Layer to act upon. - */ - function TileToWorldX(tileX: number, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): number; - - /** - * Converts from tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the - * layer's position, scale and scroll. This will return a new Vector2 object or update the given - * `point` object. - * @param tileX The x coordinate, in tiles, not pixels. - * @param tileY The y coordinate, in tiles, not pixels. - * @param point A Vector2 to store the coordinates in. If not given a new Vector2 is created. - * @param camera The Camera to use when calculating the tile index from the world values. - * @param layer The Tilemap Layer to act upon. - */ - function TileToWorldXY(tileX: number, tileY: number, point: Phaser.Math.Vector2, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Math.Vector2; - - /** - * Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the - * layer's position, scale and scroll. - * @param tileY The y coordinate, in tiles, not pixels. - * @param camera The Camera to use when calculating the tile index from the world values. - * @param layer The Tilemap Layer to act upon. - */ - function TileToWorldY(tileY: number, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): number; - - /** - * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the - * specified layer. Each tile will receive a new index. New indexes are drawn from the given - * weightedIndexes array. An example weighted array: - * - * [ - * { index: 6, weight: 4 }, // Probability of index 6 is 4 / 8 - * { index: 7, weight: 2 }, // Probability of index 7 would be 2 / 8 - * { index: 8, weight: 1.5 }, // Probability of index 8 would be 1.5 / 8 - * { index: 26, weight: 0.5 } // Probability of index 27 would be 0.5 / 8 - * ] - * - * The probability of any index being choose is (the index's weight) / (sum of all weights). This - * method only modifies tile indexes and does not change collision information. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. - * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. - * @param width How many tiles wide from the `tileX` index the area will be. - * @param height How many tiles tall from the `tileY` index the area will be. - * @param weightedIndexes An array of objects to randomly draw from during - * randomization. They should be in the form: { index: 0, weight: 4 } or - * { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. - * @param layer The Tilemap Layer to act upon. - */ - function WeightedRandomize(tileX: number, tileY: number, width: number, height: number, weightedIndexes: object[], layer: Phaser.Tilemaps.LayerData): void; - - /** - * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the - * layer's position, scale and scroll. - * @param worldX The x coordinate to be converted, in pixels, not tiles. - * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. - * @param camera The Camera to use when calculating the tile index from the world values. - * @param layer The Tilemap Layer to act upon. - */ - function WorldToTileX(worldX: number, snapToFloor: boolean, camera: Phaser.Cameras.Scene2D.Camera | undefined, layer: Phaser.Tilemaps.LayerData): number; - - /** - * Converts from world XY coordinates (pixels) to tile XY coordinates (tile units), factoring in the - * layer's position, scale and scroll. This will return a new Vector2 object or update the given - * `point` object. - * @param worldX The x coordinate to be converted, in pixels, not tiles. - * @param worldY The y coordinate to be converted, in pixels, not tiles. - * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. - * @param point A Vector2 to store the coordinates in. If not given a new Vector2 is created. - * @param camera The Camera to use when calculating the tile index from the world values. - * @param layer The Tilemap Layer to act upon. - */ - function WorldToTileXY(worldX: number, worldY: number, snapToFloor: boolean, point: Phaser.Math.Vector2, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Math.Vector2; - - /** - * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the - * layer's position, scale and scroll. - * @param worldY The y coordinate to be converted, in pixels, not tiles. - * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. - * @param camera The Camera to use when calculating the tile index from the world values. - * @param layer The Tilemap Layer to act upon. - */ - function WorldToTileY(worldY: number, snapToFloor: boolean, camera: Phaser.Cameras.Scene2D.Camera | undefined, layer: Phaser.Tilemaps.LayerData): number; - - } - - /** - * Phaser Tilemap constants for orientation. - */ - enum Orientation { - /** - * Orthogonal Tilemap orientation constant. - */ - ORTHOGONAL, - /** - * Isometric Tilemap orientation constant. - */ - ISOMETRIC, - /** - * Staggered Tilemap orientation constant. - */ - STAGGERED, - /** - * Hexagonal Tilemap orientation constant. - */ - HEXAGONAL, - } - - /** - * Phaser Tilemap constants for orientation. - * - * To find out what each mode does please see [Phaser.Tilemaps.Orientation]{@link Phaser.Tilemaps.Orientation}. - */ - type OrientationType = Phaser.Tilemaps.Orientation; - namespace Formats { /** * CSV Map Type @@ -93684,324 +93218,6 @@ declare namespace Phaser { } - /** - * A class for representing data about about a layer in a map. Maps are parsed from CSV, Tiled, - * etc. into this format. Tilemap and TilemapLayer objects have a reference - * to this data and use it to look up and perform operations on tiles. - */ - class LayerData { - /** - * - * @param config The Layer Data configuration object. - */ - constructor(config?: Phaser.Types.Tilemaps.LayerDataConfig); - - /** - * The name of the layer, if specified in Tiled. - */ - name: string; - - /** - * The x offset of where to draw from the top left. - */ - x: number; - - /** - * The y offset of where to draw from the top left. - */ - y: number; - - /** - * The width of the layer in tiles. - */ - width: number; - - /** - * The height of the layer in tiles. - */ - height: number; - - /** - * The pixel width of the tiles. - */ - tileWidth: number; - - /** - * The pixel height of the tiles. - */ - tileHeight: number; - - /** - * The base tile width. - */ - baseTileWidth: number; - - /** - * The base tile height. - */ - baseTileHeight: number; - - /** - * The layers orientation, necessary to be able to determine a tiles pixelX and pixelY as well as the layers width and height. - */ - orientation: Phaser.Tilemaps.OrientationType; - - /** - * The width in pixels of the entire layer. - */ - widthInPixels: number; - - /** - * The height in pixels of the entire layer. - */ - heightInPixels: number; - - /** - * The alpha value of the layer. - */ - alpha: number; - - /** - * Is the layer visible or not? - */ - visible: boolean; - - /** - * Layer specific properties (can be specified in Tiled) - */ - properties: object[]; - - /** - * Tile ID index map. - */ - indexes: any[]; - - /** - * Tile Collision ID index map. - */ - collideIndexes: any[]; - - /** - * An array of callbacks. - */ - callbacks: any[]; - - /** - * An array of physics bodies. - */ - bodies: any[]; - - /** - * An array of the tile data indexes. - */ - data: Phaser.Tilemaps.Tile[][]; - - /** - * A reference to the Tilemap layer that owns this data. - */ - tilemapLayer: Phaser.Tilemaps.TilemapLayer; - - /** - * The length of the horizontal sides of the hexagon. - * Only used for hexagonal orientation Tilemaps. - */ - hexSideLength: number; - - } - - /** - * A class for representing data about a map. Maps are parsed from CSV, Tiled, etc. into this - * format. A Tilemap object get a copy of this data and then unpacks the needed properties into - * itself. - */ - class MapData { - /** - * - * @param config The Map configuration object. - */ - constructor(config?: Phaser.Types.Tilemaps.MapDataConfig); - - /** - * The key in the Phaser cache that corresponds to the loaded tilemap data. - */ - name: string; - - /** - * The width of the entire tilemap. - */ - width: number; - - /** - * The height of the entire tilemap. - */ - height: number; - - /** - * If the map is infinite or not. - */ - infinite: boolean; - - /** - * The width of the tiles. - */ - tileWidth: number; - - /** - * The height of the tiles. - */ - tileHeight: number; - - /** - * The width in pixels of the entire tilemap. - */ - widthInPixels: number; - - /** - * The height in pixels of the entire tilemap. - */ - heightInPixels: number; - - /** - * The format of the map data. - */ - format: number; - - /** - * The orientation of the map data (i.e. orthogonal, isometric, hexagonal), default 'orthogonal'. - */ - orientation: Phaser.Tilemaps.OrientationType; - - /** - * Determines the draw order of tilemap. Default is right-down - * - * 0, or 'right-down' - * 1, or 'left-down' - * 2, or 'right-up' - * 3, or 'left-up' - */ - renderOrder: string; - - /** - * The version of the map data (as specified in Tiled). - */ - version: string; - - /** - * Map specific properties (can be specified in Tiled) - */ - properties: object; - - /** - * An array with all the layers configured to the MapData. - */ - layers: Phaser.Tilemaps.LayerData[] | Phaser.Tilemaps.ObjectLayer; - - /** - * An array of Tiled Image Layers. - */ - images: any[]; - - /** - * An object of Tiled Object Layers. - */ - objects: Phaser.Types.Tilemaps.ObjectLayerConfig[]; - - /** - * An object of collision data. Must be created as physics object or will return undefined. - */ - collision: object; - - /** - * An array of Tilesets. - */ - tilesets: Phaser.Tilemaps.Tileset[]; - - /** - * The collection of images the map uses(specified in Tiled) - */ - imageCollections: any[]; - - /** - * An array of tile instances. - */ - tiles: any[]; - - /** - * The length of the horizontal sides of the hexagon. - * Only used for hexagonal orientation Tilemaps. - */ - hexSideLength: number; - - } - - /** - * A class for representing a Tiled object layer in a map. This mirrors the structure of a Tiled - * object layer, except: - * - "x" & "y" properties are ignored since these cannot be changed in Tiled. - * - "offsetx" & "offsety" are applied to the individual object coordinates directly, so they - * are ignored as well. - * - "draworder" is ignored. - */ - class ObjectLayer { - /** - * - * @param config The data for the layer from the Tiled JSON object. - */ - constructor(config?: Phaser.Types.Tilemaps.ObjectLayerConfig); - - /** - * The name of the Object Layer. - */ - name: string; - - /** - * The opacity of the layer, between 0 and 1. - */ - opacity: number; - - /** - * The custom properties defined on the Object Layer, keyed by their name. - */ - properties: object; - - /** - * The type of each custom property defined on the Object Layer, keyed by its name. - */ - propertyTypes: object; - - /** - * The type of the layer, which should be `objectgroup`. - */ - type: string; - - /** - * Whether the layer is shown (`true`) or hidden (`false`). - */ - visible: boolean; - - /** - * An array of all objects on this Object Layer. - * - * Each Tiled object corresponds to a JavaScript object in this array. It has an `id` (unique), - * `name` (as assigned in Tiled), `type` (as assigned in Tiled), `rotation` (in clockwise degrees), - * `properties` (if any), `visible` state (`true` if visible, `false` otherwise), - * `x` and `y` coordinates (in pixels, relative to the tilemap), and a `width` and `height` (in pixels). - * - * An object tile has a `gid` property (GID of the represented tile), a `flippedHorizontal` property, - * a `flippedVertical` property, and `flippedAntiDiagonal` property. - * The {@link http://docs.mapeditor.org/en/latest/reference/tmx-map-format/|Tiled documentation} contains - * information on flipping and rotation. - * - * Polylines have a `polyline` property, which is an array of objects corresponding to points, - * where each point has an `x` property and a `y` property. Polygons have an identically structured - * array in their `polygon` property. Text objects have a `text` property with the text's properties. - * - * Rectangles and ellipses have a `rectangle` or `ellipse` property set to `true`. - */ - objects: Phaser.Types.Tilemaps.TiledObject[]; - - } - /** * The ObjectHelper helps tie objects with `gids` into the tileset * that sits behind them. @@ -94051,195 +93267,6 @@ declare namespace Phaser { } - namespace Parsers { - /** - * Get the Tilemap orientation from the given string. - * @param orientation The orientation type as a string. - */ - function FromOrientationString(orientation?: string): Phaser.Tilemaps.OrientationType; - - namespace Impact { - /** - * Parses all tilemap layers in an Impact JSON object into new LayerData objects. - * @param json The Impact JSON object. - * @param insertNull Controls how empty tiles, tiles with an index of -1, in the map - * data are handled (see {@link Phaser.Tilemaps.Parsers.Tiled.ParseJSONTiled}). - */ - function ParseTileLayers(json: object, insertNull: boolean): Phaser.Tilemaps.LayerData[]; - - /** - * Tilesets and Image Collections - * @param json The Impact JSON data. - */ - function ParseTilesets(json: object): any[]; - - /** - * Parses a Weltmeister JSON object into a new MapData object. - * @param name The name of the tilemap, used to set the name on the MapData. - * @param json The Weltmeister JSON object. - * @param insertNull Controls how empty tiles, tiles with an index of -1, in the map - * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty - * location will get a Tile object with an index of -1. If you've a large sparsely populated map and - * the tile data doesn't need to change then setting this value to `true` will help with memory - * consumption. However if your map is small or you need to update the tiles dynamically, then leave - * the default value set. - */ - function ParseWeltmeister(name: string, json: object, insertNull: boolean): Phaser.Tilemaps.MapData | null; - - } - - /** - * Parses raw data of a given Tilemap format into a new MapData object. If no recognized data format - * is found, returns `null`. When loading from CSV or a 2D array, you should specify the tileWidth & - * tileHeight. When parsing from a map from Tiled, the tileWidth & tileHeight will be pulled from - * the map data. - * @param name The name of the tilemap, used to set the name on the MapData. - * @param mapFormat See ../Formats.js. - * @param data 2D array, CSV string or Tiled JSON object. - * @param tileWidth The width of a tile in pixels. Required for 2D array and CSV, but - * ignored for Tiled JSON. - * @param tileHeight The height of a tile in pixels. Required for 2D array and CSV, but - * ignored for Tiled JSON. - * @param insertNull Controls how empty tiles, tiles with an index of -1, in the map - * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty - * location will get a Tile object with an index of -1. If you've a large sparsely populated map and - * the tile data doesn't need to change then setting this value to `true` will help with memory - * consumption. However if your map is small or you need to update the tiles dynamically, then leave - * the default value set. - */ - function Parse(name: string, mapFormat: number, data: number[][] | string | object, tileWidth: number, tileHeight: number, insertNull: boolean): Phaser.Tilemaps.MapData; - - /** - * Parses a 2D array of tile indexes into a new MapData object with a single layer. - * @param name The name of the tilemap, used to set the name on the MapData. - * @param data 2D array, CSV string or Tiled JSON object. - * @param tileWidth The width of a tile in pixels. - * @param tileHeight The height of a tile in pixels. - * @param insertNull Controls how empty tiles, tiles with an index of -1, in the map - * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty - * location will get a Tile object with an index of -1. If you've a large sparsely populated map and - * the tile data doesn't need to change then setting this value to `true` will help with memory - * consumption. However if your map is small or you need to update the tiles dynamically, then leave - * the default value set. - */ - function Parse2DArray(name: string, data: number[][], tileWidth: number, tileHeight: number, insertNull: boolean): Phaser.Tilemaps.MapData; - - /** - * Parses a CSV string of tile indexes into a new MapData object with a single layer. - * @param name The name of the tilemap, used to set the name on the MapData. - * @param data CSV string of tile indexes. - * @param tileWidth The width of a tile in pixels. - * @param tileHeight The height of a tile in pixels. - * @param insertNull Controls how empty tiles, tiles with an index of -1, in the map - * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty - * location will get a Tile object with an index of -1. If you've a large sparsely populated map and - * the tile data doesn't need to change then setting this value to `true` will help with memory - * consumption. However if your map is small or you need to update the tiles dynamically, then leave - * the default value set. - */ - function ParseCSV(name: string, data: string, tileWidth: number, tileHeight: number, insertNull: boolean): Phaser.Tilemaps.MapData; - - namespace Tiled { - /** - * Copy properties from tileset to tiles. - * @param mapData The Map Data object. - */ - function AssignTileProperties(mapData: Phaser.Tilemaps.MapData): void; - - /** - * Decode base-64 encoded data, for example as exported by Tiled. - * @param data Base-64 encoded data to decode. - */ - function Base64Decode(data: object): any[]; - - /** - * Master list of tiles -> x, y, index in tileset. - * @param mapData The Map Data object. - */ - function BuildTilesetIndex(mapData: Phaser.Tilemaps.MapData): any[]; - - /** - * Parse a Tiled group layer and create a state object for inheriting. - * @param json The Tiled JSON object. - * @param group The current group layer from the Tiled JSON file. - * @param parentState The state of the parent group (if any). - */ - function CreateGroupLayer(json: object, group?: object, parentState?: object): object; - - /** - * See Tiled documentation on tile flipping: - * http://docs.mapeditor.org/en/latest/reference/tmx-map-format/ - * @param gid A Tiled GID. - */ - function ParseGID(gid: number): Phaser.Types.Tilemaps.GIDData; - - /** - * Parses a Tiled JSON object into an array of objects with details about the image layers. - * @param json The Tiled JSON object. - */ - function ParseImageLayers(json: object): any[]; - - /** - * Parses a Tiled JSON object into a new MapData object. - * @param name The name of the tilemap, used to set the name on the MapData. - * @param json The Tiled JSON object. - * @param insertNull Controls how empty tiles, tiles with an index of -1, in the map - * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty - * location will get a Tile object with an index of -1. If you've a large sparsely populated map and - * the tile data doesn't need to change then setting this value to `true` will help with memory - * consumption. However if your map is small or you need to update the tiles dynamically, then leave - * the default value set. - */ - function ParseJSONTiled(name: string, json: object, insertNull: boolean): Phaser.Tilemaps.MapData | null; - - /** - * Convert a Tiled object to an internal parsed object normalising and copying properties over, while applying optional x and y offsets. The parsed object will always have the properties `id`, `name`, `type`, `rotation`, `properties`, `visible`, `x`, `y`, `width` and `height`. Other properties will be added according to the object type (such as text, polyline, gid etc.) - * @param tiledObject Tiled object to convert to an internal parsed object normalising and copying properties over. - * @param offsetX Optional additional offset to apply to the object's x property. Defaults to 0. Default 0. - * @param offsetY Optional additional offset to apply to the object's y property. Defaults to 0. Default 0. - */ - function ParseObject(tiledObject: object, offsetX?: number, offsetY?: number): object; - - /** - * Parses a Tiled JSON object into an array of ObjectLayer objects. - * @param json The Tiled JSON object. - */ - function ParseObjectLayers(json: object): any[]; - - /** - * Parses all tilemap layers in a Tiled JSON object into new LayerData objects. - * @param json The Tiled JSON object. - * @param insertNull Controls how empty tiles, tiles with an index of -1, in the map - * data are handled (see {@link Phaser.Tilemaps.Parsers.Tiled.ParseJSONTiled}). - */ - function ParseTileLayers(json: object, insertNull: boolean): Phaser.Tilemaps.LayerData[]; - - /** - * Tilesets and Image Collections. - * @param json The Tiled JSON data. - */ - function ParseTilesets(json: object): object; - - /** - * Parses out the Wangset information from Tiled 1.1.5+ map data, if present. - * - * Since a given tile can be in more than one wangset, the resulting properties - * are nested. `tile.data.wangid[someWangsetName]` will return the array-based wang id in - * this implementation. - * - * Note that we're not guaranteed that there will be any 'normal' tiles if the only - * thing in the tilset are wangtile definitions, so this has to be parsed separately. - * - * See https://doc.mapeditor.org/en/latest/manual/using-wang-tiles/ for more information. - * @param wangsets The array of wangset objects (parsed from JSON) - * @param datas The field into which to put wangset data from Tiled. - */ - function ParseWangsets(wangsets: object[], datas: object): object; - - } - - } - /** * Create a Tilemap from the given key or data. If neither is given, make a blank Tilemap. When * loading from CSV or a 2D array, you should specify the tileWidth & tileHeight. When parsing from @@ -97460,6 +96487,1306 @@ declare namespace Phaser { } + namespace Components { + /** + * Calculates interesting faces at the given tile coordinates of the specified layer. Interesting + * faces are used internally for optimizing collisions against tiles. This method is mostly used + * internally to optimize recalculating faces when only one tile has been changed. + * @param tileX The x coordinate. + * @param tileY The y coordinate. + * @param layer The Tilemap Layer to act upon. + */ + function CalculateFacesAt(tileX: number, tileY: number, layer: Phaser.Tilemaps.LayerData): void; + + /** + * Calculates interesting faces within the rectangular area specified (in tile coordinates) of the + * layer. Interesting faces are used internally for optimizing collisions against tiles. This method + * is mostly used internally. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. + * @param layer The Tilemap Layer to act upon. + */ + function CalculateFacesWithin(tileX: number, tileY: number, width: number, height: number, layer: Phaser.Tilemaps.LayerData): void; + + /** + * Checks if the given tile coordinate is within the isometric layer bounds, or not. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param layer The Tilemap Layer to check against. + * @param camera The Camera to run the cull check against. + */ + function CheckIsoBounds(tileX: number, tileY: number, layer: Phaser.Tilemaps.LayerData, camera?: Phaser.Cameras.Scene2D.Camera): boolean; + + /** + * Copies the tiles in the source rectangular area to a new destination (all specified in tile + * coordinates) within the layer. This copies all tile properties & recalculates collision + * information in the destination region. + * @param srcTileX The x coordinate of the area to copy from, in tiles, not pixels. + * @param srcTileY The y coordinate of the area to copy from, in tiles, not pixels. + * @param width The width of the area to copy, in tiles, not pixels. + * @param height The height of the area to copy, in tiles, not pixels. + * @param destTileX The x coordinate of the area to copy to, in tiles, not pixels. + * @param destTileY The y coordinate of the area to copy to, in tiles, not pixels. + * @param recalculateFaces `true` if the faces data should be recalculated. + * @param layer The Tilemap Layer to act upon. + */ + function Copy(srcTileX: number, srcTileY: number, width: number, height: number, destTileX: number, destTileY: number, recalculateFaces: boolean, layer: Phaser.Tilemaps.LayerData): void; + + /** + * Creates a Sprite for every object matching the given tile indexes in the layer. You can + * optionally specify if each tile will be replaced with a new tile after the Sprite has been + * created. This is useful if you want to lay down special tiles in a level that are converted to + * Sprites, but want to replace the tile itself with a floor tile or similar once converted. + * @param indexes The tile index, or array of indexes, to create Sprites from. + * @param replacements The tile index, or array of indexes, to change a converted tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a one-to-one mapping with the indexes array. + * @param spriteConfig The config object to pass into the Sprite creator (i.e. scene.make.sprite). + * @param scene The Scene to create the Sprites within. + * @param camera The Camera to use when determining the world XY + * @param layer The Tilemap Layer to act upon. + */ + function CreateFromTiles(indexes: number | number[], replacements: number | number[], spriteConfig: Phaser.Types.GameObjects.Sprite.SpriteConfig, scene: Phaser.Scene, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.GameObjects.Sprite[]; + + /** + * Returns the bounds in the given orthogonal layer that are within the cameras viewport. + * This is used internally by the cull tiles function. + * @param layer The Tilemap Layer to act upon. + * @param camera The Camera to run the cull check against. + */ + function CullBounds(layer: Phaser.Tilemaps.LayerData, camera: Phaser.Cameras.Scene2D.Camera): Phaser.Geom.Rectangle; + + /** + * Returns the tiles in the given layer that are within the cameras viewport. This is used internally. + * @param layer The Tilemap Layer to act upon. + * @param camera The Camera to run the cull check against. + * @param outputArray An optional array to store the Tile objects within. + * @param renderOrder The rendering order constant. Default 0. + */ + function CullTiles(layer: Phaser.Tilemaps.LayerData, camera: Phaser.Cameras.Scene2D.Camera, outputArray?: any[], renderOrder?: number): Phaser.Tilemaps.Tile[]; + + /** + * Sets the tiles in the given rectangular area (in tile coordinates) of the layer with the + * specified index. Tiles will be set to collide if the given index is a colliding index. + * Collision information in the region will be recalculated. + * @param index The tile index to fill the area with. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. + * @param recalculateFaces `true` if the faces data should be recalculated. + * @param layer The tile layer to use. If not given the current layer is used. + */ + function Fill(index: number, tileX: number, tileY: number, width: number, height: number, recalculateFaces: boolean, layer: Phaser.Tilemaps.LayerData): void; + + /** + * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given + * filter callback function. Any tiles that pass the filter test (i.e. where the callback returns + * true) will returned as a new array. Similar to Array.prototype.Filter in vanilla JS. + * @param callback The callback. Each tile in the given area will be passed to this + * callback as the first and only parameter. The callback should return true for tiles that pass the + * filter. + * @param context The context under which the callback should be run. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. + * @param filteringOptions Optional filters to apply when getting the tiles. + * @param layer The Tilemap Layer to act upon. + */ + function FilterTiles(callback: Function, context: object, tileX: number, tileY: number, width: number, height: number, filteringOptions: Phaser.Types.Tilemaps.FilteringOptions, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile[]; + + /** + * Searches the entire map layer for the first tile matching the given index, then returns that Tile + * object. If no match is found, it returns null. The search starts from the top-left tile and + * continues horizontally until it hits the end of the row, then it drops down to the next column. + * If the reverse boolean is true, it scans starting from the bottom-right corner traveling up to + * the top-left. + * @param index The tile index value to search for. + * @param skip The number of times to skip a matching tile before returning. + * @param reverse If true it will scan the layer in reverse, starting at the bottom-right. Otherwise it scans from the top-left. + * @param layer The Tilemap Layer to act upon. + */ + function FindByIndex(index: number, skip: number, reverse: boolean, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile | null; + + /** + * Find the first tile in the given rectangular area (in tile coordinates) of the layer that + * satisfies the provided testing function. I.e. finds the first tile for which `callback` returns + * true. Similar to Array.prototype.find in vanilla JS. + * @param callback The callback. Each tile in the given area will be passed to this callback as the first and only parameter. + * @param context The context under which the callback should be run. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. + * @param filteringOptions Optional filters to apply when getting the tiles. + * @param layer The Tilemap Layer to act upon. + */ + function FindTile(callback: FindTileCallback, context: object, tileX: number, tileY: number, width: number, height: number, filteringOptions: Phaser.Types.Tilemaps.FilteringOptions, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile | null; + + /** + * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given + * callback. Similar to Array.prototype.forEach in vanilla JS. + * @param callback The callback. Each tile in the given area will be passed to this callback as the first and only parameter. + * @param context The context under which the callback should be run. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. + * @param filteringOptions Optional filters to apply when getting the tiles. + * @param layer The Tilemap Layer to act upon. + */ + function ForEachTile(callback: EachTileCallback, context: object, tileX: number, tileY: number, width: number, height: number, filteringOptions: Phaser.Types.Tilemaps.FilteringOptions, layer: Phaser.Tilemaps.LayerData): void; + + /** + * Gets the correct function to use to cull tiles, based on the map orientation. + * @param orientation The Tilemap orientation constant. + */ + function GetCullTilesFunction(orientation: number): Function; + + /** + * Gets a tile at the given tile coordinates from the given layer. + * @param tileX X position to get the tile from (given in tile units, not pixels). + * @param tileY Y position to get the tile from (given in tile units, not pixels). + * @param nonNull If true getTile won't return null for empty tiles, but a Tile object with an index of -1. + * @param layer The Tilemap Layer to act upon. + */ + function GetTileAt(tileX: number, tileY: number, nonNull: boolean, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile; + + /** + * Gets a tile at the given world coordinates from the given layer. + * @param worldX X position to get the tile from (given in pixels) + * @param worldY Y position to get the tile from (given in pixels) + * @param nonNull If true, function won't return null for empty tiles, but a Tile object with an index of -1. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. + */ + function GetTileAtWorldXY(worldX: number, worldY: number, nonNull: boolean, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile; + + /** + * Gets the correct function to use to translate tiles, based on the map orientation. + * @param orientation The Tilemap orientation constant. + */ + function GetTileToWorldXFunction(orientation: number): Function; + + /** + * Gets the correct function to use to translate tiles, based on the map orientation. + * @param orientation The Tilemap orientation constant. + */ + function GetTileToWorldXYFunction(orientation: number): Function; + + /** + * Gets the correct function to use to translate tiles, based on the map orientation. + * @param orientation The Tilemap orientation constant. + */ + function GetTileToWorldYFunction(orientation: number): Function; + + /** + * Gets the tiles in the given rectangular area (in tile coordinates) of the layer. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. + * @param filteringOptions Optional filters to apply when getting the tiles. + * @param layer The Tilemap Layer to act upon. + */ + function GetTilesWithin(tileX: number, tileY: number, width: number, height: number, filteringOptions: Phaser.Types.Tilemaps.FilteringOptions, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile[]; + + /** + * Gets the tiles that overlap with the given shape in the given layer. The shape must be a Circle, + * Line, Rectangle or Triangle. The shape should be in world coordinates. + * @param shape A shape in world (pixel) coordinates + * @param filteringOptions Optional filters to apply when getting the tiles. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. + */ + function GetTilesWithinShape(shape: Phaser.Geom.Circle | Phaser.Geom.Line | Phaser.Geom.Rectangle | Phaser.Geom.Triangle, filteringOptions: Phaser.Types.Tilemaps.FilteringOptions, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile[]; + + /** + * Gets the tiles in the given rectangular area (in world coordinates) of the layer. + * @param worldX The world x coordinate for the top-left of the area. + * @param worldY The world y coordinate for the top-left of the area. + * @param width The width of the area. + * @param height The height of the area. + * @param filteringOptions Optional filters to apply when getting the tiles. + * @param camera The Camera to use when factoring in which tiles to return. + * @param layer The Tilemap Layer to act upon. + */ + function GetTilesWithinWorldXY(worldX: number, worldY: number, width: number, height: number, filteringOptions: Phaser.Types.Tilemaps.FilteringOptions, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile[]; + + /** + * Gets the correct function to use to translate tiles, based on the map orientation. + * @param orientation The Tilemap orientation constant. + */ + function GetWorldToTileXFunction(orientation: number): Function; + + /** + * Gets the correct function to use to translate tiles, based on the map orientation. + * @param orientation The Tilemap orientation constant. + */ + function GetWorldToTileXYFunction(orientation: number): Function; + + /** + * Gets the correct function to use to translate tiles, based on the map orientation. + * @param orientation The Tilemap orientation constant. + */ + function GetWorldToTileYFunction(orientation: number): Function; + + /** + * Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns + * false if there is no tile or if the tile at that location has an index of -1. + * @param tileX X position to get the tile from (given in tile units, not pixels). + * @param tileY Y position to get the tile from (given in tile units, not pixels). + * @param layer The Tilemap Layer to act upon. + */ + function HasTileAt(tileX: number, tileY: number, layer: Phaser.Tilemaps.LayerData): boolean | null; + + /** + * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns + * false if there is no tile or if the tile at that location has an index of -1. + * @param worldX The X coordinate of the world position. + * @param worldY The Y coordinate of the world position. + * @param camera The Camera to use when factoring in which tiles to return. + * @param layer The Tilemap Layer to act upon. + */ + function HasTileAtWorldXY(worldX: number, worldY: number, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): boolean | null; + + /** + * Returns the bounds in the given layer that are within the camera's viewport. + * This is used internally by the cull tiles function. + * @param layer The Tilemap Layer to act upon. + * @param camera The Camera to run the cull check against. + */ + function HexagonalCullBounds(layer: Phaser.Tilemaps.LayerData, camera: Phaser.Cameras.Scene2D.Camera): object; + + /** + * Returns the tiles in the given layer that are within the cameras viewport. This is used internally. + * @param layer The Tilemap Layer to act upon. + * @param camera The Camera to run the cull check against. + * @param outputArray An optional array to store the Tile objects within. + * @param renderOrder The rendering order constant. Default 0. + */ + function HexagonalCullTiles(layer: Phaser.Tilemaps.LayerData, camera: Phaser.Cameras.Scene2D.Camera, outputArray?: any[], renderOrder?: number): Phaser.Tilemaps.Tile[]; + + /** + * Converts from hexagonal tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param point A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. + */ + function HexagonalTileToWorldXY(tileX: number, tileY: number, point: Phaser.Math.Vector2, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Math.Vector2; + + /** + * Converts from hexagonal tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the + * layer's position, scale and scroll. + * @param tileY The y coordinate, in tiles, not pixels. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. + */ + function HexagonalTileToWorldY(tileY: number, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): number; + + /** + * Converts from world XY coordinates (pixels) to hexagonal tile XY coordinates (tile units), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * @param worldX The x coordinate to be converted, in pixels, not tiles. + * @param worldY The y coordinate to be converted, in pixels, not tiles. + * @param snapToFloor Whether or not to round the tile coordinates down to the nearest integer. + * @param point A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. + */ + function HexagonalWorldToTileXY(worldX: number, worldY: number, snapToFloor: boolean, point: Phaser.Math.Vector2, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Math.Vector2; + + /** + * Converts from world Y coordinates (pixels) to hexagonal tile Y coordinates (tile units), factoring in the + * layers position, scale and scroll. + * @param worldY The y coordinate to be converted, in pixels, not tiles. + * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. + */ + function HexagonalWorldToTileY(worldY: number, snapToFloor: boolean, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): number; + + /** + * Checks if the given tile coordinates are within the bounds of the layer. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param layer The Tilemap Layer to act upon. + */ + function IsInLayerBounds(tileX: number, tileY: number, layer: Phaser.Tilemaps.LayerData): boolean; + + /** + * Returns the tiles in the given layer that are within the cameras viewport. This is used internally. + * @param layer The Tilemap Layer to act upon. + * @param camera The Camera to run the cull check against. + * @param outputArray An optional array to store the Tile objects within. + * @param renderOrder The rendering order constant. Default 0. + */ + function IsometricCullTiles(layer: Phaser.Tilemaps.LayerData, camera: Phaser.Cameras.Scene2D.Camera, outputArray?: any[], renderOrder?: number): Phaser.Tilemaps.Tile[]; + + /** + * Converts from isometric tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param point A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. + */ + function IsometricTileToWorldXY(tileX: number, tileY: number, point: Phaser.Math.Vector2, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Math.Vector2; + + /** + * Converts from world XY coordinates (pixels) to isometric tile XY coordinates (tile units), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * @param worldX The x coordinate to be converted, in pixels, not tiles. + * @param worldY The y coordinate to be converted, in pixels, not tiles. + * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. + * @param point A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. + */ + function IsometricWorldToTileXY(worldX: number, worldY: number, snapToFloor: boolean, point: Phaser.Math.Vector2, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Math.Vector2; + + /** + * Puts a tile at the given tile coordinates in the specified layer. You can pass in either an index + * or a Tile object. If you pass in a Tile, all attributes will be copied over to the specified + * location. If you pass in an index, only the index at the specified location will be changed. + * Collision information will be recalculated at the specified location. + * @param tile The index of this tile to set or a Tile object. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param recalculateFaces `true` if the faces data should be recalculated. + * @param layer The Tilemap Layer to act upon. + */ + function PutTileAt(tile: number | Phaser.Tilemaps.Tile, tileX: number, tileY: number, recalculateFaces: boolean, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile; + + /** + * Puts a tile at the given world coordinates (pixels) in the specified layer. You can pass in either + * an index or a Tile object. If you pass in a Tile, all attributes will be copied over to the + * specified location. If you pass in an index, only the index at the specified location will be + * changed. Collision information will be recalculated at the specified location. + * @param tile The index of this tile to set or a Tile object. + * @param worldX The x coordinate, in pixels. + * @param worldY The y coordinate, in pixels. + * @param recalculateFaces `true` if the faces data should be recalculated. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. + */ + function PutTileAtWorldXY(tile: number | Phaser.Tilemaps.Tile, worldX: number, worldY: number, recalculateFaces: boolean, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile; + + /** + * Puts an array of tiles or a 2D array of tiles at the given tile coordinates in the specified + * layer. The array can be composed of either tile indexes or Tile objects. If you pass in a Tile, + * all attributes will be copied over to the specified location. If you pass in an index, only the + * index at the specified location will be changed. Collision information will be recalculated + * within the region tiles were changed. + * @param tile A row (array) or grid (2D array) of Tiles or tile indexes to place. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param recalculateFaces `true` if the faces data should be recalculated. + * @param layer The Tilemap Layer to act upon. + */ + function PutTilesAt(tile: number[] | number[][] | Phaser.Tilemaps.Tile[] | Phaser.Tilemaps.Tile[][], tileX: number, tileY: number, recalculateFaces: boolean, layer: Phaser.Tilemaps.LayerData): void; + + /** + * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the + * specified layer. Each tile will receive a new index. If an array of indexes is passed in, then + * those will be used for randomly assigning new tile indexes. If an array is not provided, the + * indexes found within the region (excluding -1) will be used for randomly assigning new tile + * indexes. This method only modifies tile indexes and does not change collision information. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. + * @param indexes An array of indexes to randomly draw from during randomization. + * @param layer The Tilemap Layer to act upon. + */ + function Randomize(tileX: number, tileY: number, width: number, height: number, indexes: number[], layer: Phaser.Tilemaps.LayerData): void; + + /** + * Removes the tile at the given tile coordinates in the specified layer and updates the layer's + * collision information. + * @param tileX The x coordinate. + * @param tileY The y coordinate. + * @param replaceWithNull If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param recalculateFaces `true` if the faces data should be recalculated. + * @param layer The Tilemap Layer to act upon. + */ + function RemoveTileAt(tileX: number, tileY: number, replaceWithNull: boolean, recalculateFaces: boolean, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile; + + /** + * Removes the tile at the given world coordinates in the specified layer and updates the layer's + * collision information. + * @param worldX The x coordinate, in pixels. + * @param worldY The y coordinate, in pixels. + * @param replaceWithNull If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param recalculateFaces `true` if the faces data should be recalculated. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. + */ + function RemoveTileAtWorldXY(worldX: number, worldY: number, replaceWithNull: boolean, recalculateFaces: boolean, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile; + + /** + * Draws a debug representation of the layer to the given Graphics. This is helpful when you want to + * get a quick idea of which of your tiles are colliding and which have interesting faces. The tiles + * are drawn starting at (0, 0) in the Graphics, allowing you to place the debug representation + * wherever you want on the screen. + * @param graphics The target Graphics object to draw upon. + * @param styleConfig An object specifying the colors to use for the debug drawing. + * @param layer The Tilemap Layer to act upon. + */ + function RenderDebug(graphics: Phaser.GameObjects.Graphics, styleConfig: Phaser.Types.Tilemaps.DebugStyleOptions, layer: Phaser.Tilemaps.LayerData): void; + + /** + * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching + * `findIndex` and updates their index to match `newIndex`. This only modifies the index and does + * not change collision information. + * @param findIndex The index of the tile to search for. + * @param newIndex The index of the tile to replace it with. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. + * @param layer The Tilemap Layer to act upon. + */ + function ReplaceByIndex(findIndex: number, newIndex: number, tileX: number, tileY: number, width: number, height: number, layer: Phaser.Tilemaps.LayerData): void; + + /** + * Returns the tiles in the given layer that are within the cameras viewport. This is used internally. + * @param layer The Tilemap Layer to act upon. + * @param bounds An object containing the `left`, `right`, `top` and `bottom` bounds. + * @param renderOrder The rendering order constant. + * @param outputArray The array to store the Tile objects within. + */ + function RunCull(layer: Phaser.Tilemaps.LayerData, bounds: object, renderOrder: number, outputArray: any[]): Phaser.Tilemaps.Tile[]; + + /** + * Sets collision on the given tile or tiles within a layer by index. You can pass in either a + * single numeric index or an array of indexes: [2, 3, 15, 20]. The `collides` parameter controls if + * collision will be enabled (true) or disabled (false). + * @param indexes Either a single tile index, or an array of tile indexes. + * @param collides If true it will enable collision. If false it will clear collision. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. + * @param layer The Tilemap Layer to act upon. + * @param updateLayer If true, updates the current tiles on the layer. Set to false if no tiles have been placed for significant performance boost. Default true. + */ + function SetCollision(indexes: number | any[], collides: boolean, recalculateFaces: boolean, layer: Phaser.Tilemaps.LayerData, updateLayer?: boolean): void; + + /** + * Sets collision on a range of tiles in a layer whose index is between the specified `start` and + * `stop` (inclusive). Calling this with a start value of 10 and a stop value of 14 would set + * collision for tiles 10, 11, 12, 13 and 14. The `collides` parameter controls if collision will be + * enabled (true) or disabled (false). + * @param start The first index of the tile to be set for collision. + * @param stop The last index of the tile to be set for collision. + * @param collides If true it will enable collision. If false it will clear collision. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. + * @param layer The Tilemap Layer to act upon. + * @param updateLayer If true, updates the current tiles on the layer. Set to false if no tiles have been placed for significant performance boost. Default true. + */ + function SetCollisionBetween(start: number, stop: number, collides: boolean, recalculateFaces: boolean, layer: Phaser.Tilemaps.LayerData, updateLayer?: boolean): void; + + /** + * Sets collision on all tiles in the given layer, except for tiles that have an index specified in + * the given array. The `collides` parameter controls if collision will be enabled (true) or + * disabled (false). Tile indexes not currently in the layer are not affected. + * @param indexes An array of the tile indexes to not be counted for collision. + * @param collides If true it will enable collision. If false it will clear collision. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. + * @param layer The Tilemap Layer to act upon. + */ + function SetCollisionByExclusion(indexes: number[], collides: boolean, recalculateFaces: boolean, layer: Phaser.Tilemaps.LayerData): void; + + /** + * Sets collision on the tiles within a layer by checking tile properties. If a tile has a property + * that matches the given properties object, its collision flag will be set. The `collides` + * parameter controls if collision will be enabled (true) or disabled (false). Passing in + * `{ collides: true }` would update the collision flag on any tiles with a "collides" property that + * has a value of true. Any tile that doesn't have "collides" set to true will be ignored. You can + * also use an array of values, e.g. `{ types: ["stone", "lava", "sand" ] }`. If a tile has a + * "types" property that matches any of those values, its collision flag will be updated. + * @param properties An object with tile properties and corresponding values that should be checked. + * @param collides If true it will enable collision. If false it will clear collision. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. + * @param layer The Tilemap Layer to act upon. + */ + function SetCollisionByProperty(properties: object, collides: boolean, recalculateFaces: boolean, layer: Phaser.Tilemaps.LayerData): void; + + /** + * Sets collision on the tiles within a layer by checking each tile's collision group data + * (typically defined in Tiled within the tileset collision editor). If any objects are found within + * a tile's collision group, the tile's colliding information will be set. The `collides` parameter + * controls if collision will be enabled (true) or disabled (false). + * @param collides If true it will enable collision. If false it will clear collision. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. + * @param layer The Tilemap Layer to act upon. + */ + function SetCollisionFromCollisionGroup(collides: boolean, recalculateFaces: boolean, layer: Phaser.Tilemaps.LayerData): void; + + /** + * Internally used method to keep track of the tile indexes that collide within a layer. This + * updates LayerData.collideIndexes to either contain or not contain the given `tileIndex`. + * @param tileIndex The tile index to set the collision boolean for. + * @param collides Should the tile index collide or not? + * @param layer The Tilemap Layer to act upon. + */ + function SetLayerCollisionIndex(tileIndex: number, collides: boolean, layer: Phaser.Tilemaps.LayerData): void; + + /** + * Internally used method to set the colliding state of a tile. This does not recalculate + * interesting faces. + * @param tile The Tile to set the collision on. + * @param collides Should the tile index collide or not? Default true. + */ + function SetTileCollision(tile: Phaser.Tilemaps.Tile, collides?: boolean): void; + + /** + * Sets a global collision callback for the given tile index within the layer. This will affect all + * tiles on this layer that have the same index. If a callback is already set for the tile index it + * will be replaced. Set the callback to null to remove it. If you want to set a callback for a tile + * at a specific location on the map then see setTileLocationCallback. + * @param indexes Either a single tile index, or an array of tile indexes to have a collision callback set for. + * @param callback The callback that will be invoked when the tile is collided with. + * @param callbackContext The context under which the callback is called. + * @param layer The Tilemap Layer to act upon. + */ + function SetTileIndexCallback(indexes: number | any[], callback: Function, callbackContext: object, layer: Phaser.Tilemaps.LayerData): void; + + /** + * Sets a collision callback for the given rectangular area (in tile coordinates) within the layer. + * If a callback is already set for the tile index it will be replaced. Set the callback to null to + * remove it. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. + * @param callback The callback that will be invoked when the tile is collided with. + * @param callbackContext The context under which the callback is called. + * @param layer The Tilemap Layer to act upon. + */ + function SetTileLocationCallback(tileX: number, tileY: number, width: number, height: number, callback: Function, callbackContext: object, layer: Phaser.Tilemaps.LayerData): void; + + /** + * Shuffles the tiles in a rectangular region (specified in tile coordinates) within the given + * layer. It will only randomize the tiles in that area, so if they're all the same nothing will + * appear to have changed! This method only modifies tile indexes and does not change collision + * information. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. + * @param layer The Tilemap Layer to act upon. + */ + function Shuffle(tileX: number, tileY: number, width: number, height: number, layer: Phaser.Tilemaps.LayerData): void; + + /** + * Returns the bounds in the given layer that are within the camera's viewport. + * This is used internally by the cull tiles function. + * @param layer The Tilemap Layer to act upon. + * @param camera The Camera to run the cull check against. + */ + function StaggeredCullBounds(layer: Phaser.Tilemaps.LayerData, camera: Phaser.Cameras.Scene2D.Camera): object; + + /** + * Returns the tiles in the given layer that are within the cameras viewport. This is used internally. + * @param layer The Tilemap Layer to act upon. + * @param camera The Camera to run the cull check against. + * @param outputArray An optional array to store the Tile objects within. + * @param renderOrder The rendering order constant. Default 0. + */ + function StaggeredCullTiles(layer: Phaser.Tilemaps.LayerData, camera: Phaser.Cameras.Scene2D.Camera, outputArray?: any[], renderOrder?: number): Phaser.Tilemaps.Tile[]; + + /** + * Converts from staggered tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param point A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. + */ + function StaggeredTileToWorldXY(tileX: number, tileY: number, point: Phaser.Math.Vector2, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Math.Vector2; + + /** + * Converts from staggered tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the + * layers position, scale and scroll. + * @param tileY The y coordinate, in tiles, not pixels. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. + */ + function StaggeredTileToWorldY(tileY: number, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): number; + + /** + * Converts from world XY coordinates (pixels) to staggered tile XY coordinates (tile units), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * @param worldX The x coordinate to be converted, in pixels, not tiles. + * @param worldY The y coordinate to be converted, in pixels, not tiles. + * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. + * @param point A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. + */ + function StaggeredWorldToTileXY(worldX: number, worldY: number, snapToFloor: boolean, point: Phaser.Math.Vector2, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Math.Vector2; + + /** + * Converts from world Y coordinates (pixels) to staggered tile Y coordinates (tile units), factoring in the + * layers position, scale and scroll. + * @param worldY The y coordinate to be converted, in pixels, not tiles. + * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. + */ + function StaggeredWorldToTileY(worldY: number, snapToFloor: boolean, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): number; + + /** + * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching + * `indexA` and swaps then with `indexB`. This only modifies the index and does not change collision + * information. + * @param tileA First tile index. + * @param tileB Second tile index. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. + * @param layer The Tilemap Layer to act upon. + */ + function SwapByIndex(tileA: number, tileB: number, tileX: number, tileY: number, width: number, height: number, layer: Phaser.Tilemaps.LayerData): void; + + /** + * Converts from tile X coordinates (tile units) to world X coordinates (pixels), factoring in the + * layer's position, scale and scroll. + * @param tileX The x coordinate, in tiles, not pixels. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. + */ + function TileToWorldX(tileX: number, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): number; + + /** + * Converts from tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param point A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. + */ + function TileToWorldXY(tileX: number, tileY: number, point: Phaser.Math.Vector2, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Math.Vector2; + + /** + * Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the + * layer's position, scale and scroll. + * @param tileY The y coordinate, in tiles, not pixels. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. + */ + function TileToWorldY(tileY: number, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): number; + + /** + * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the + * specified layer. Each tile will receive a new index. New indexes are drawn from the given + * weightedIndexes array. An example weighted array: + * + * [ + * { index: 6, weight: 4 }, // Probability of index 6 is 4 / 8 + * { index: 7, weight: 2 }, // Probability of index 7 would be 2 / 8 + * { index: 8, weight: 1.5 }, // Probability of index 8 would be 1.5 / 8 + * { index: 26, weight: 0.5 } // Probability of index 27 would be 0.5 / 8 + * ] + * + * The probability of any index being choose is (the index's weight) / (sum of all weights). This + * method only modifies tile indexes and does not change collision information. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. + * @param weightedIndexes An array of objects to randomly draw from during + * randomization. They should be in the form: { index: 0, weight: 4 } or + * { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. + * @param layer The Tilemap Layer to act upon. + */ + function WeightedRandomize(tileX: number, tileY: number, width: number, height: number, weightedIndexes: object[], layer: Phaser.Tilemaps.LayerData): void; + + /** + * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the + * layer's position, scale and scroll. + * @param worldX The x coordinate to be converted, in pixels, not tiles. + * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. + */ + function WorldToTileX(worldX: number, snapToFloor: boolean, camera: Phaser.Cameras.Scene2D.Camera | undefined, layer: Phaser.Tilemaps.LayerData): number; + + /** + * Converts from world XY coordinates (pixels) to tile XY coordinates (tile units), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * @param worldX The x coordinate to be converted, in pixels, not tiles. + * @param worldY The y coordinate to be converted, in pixels, not tiles. + * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. + * @param point A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. + */ + function WorldToTileXY(worldX: number, worldY: number, snapToFloor: boolean, point: Phaser.Math.Vector2, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Math.Vector2; + + /** + * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the + * layer's position, scale and scroll. + * @param worldY The y coordinate to be converted, in pixels, not tiles. + * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. + */ + function WorldToTileY(worldY: number, snapToFloor: boolean, camera: Phaser.Cameras.Scene2D.Camera | undefined, layer: Phaser.Tilemaps.LayerData): number; + + } + + /** + * Phaser Tilemap constants for orientation. + */ + enum Orientation { + /** + * Orthogonal Tilemap orientation constant. + */ + ORTHOGONAL, + /** + * Isometric Tilemap orientation constant. + */ + ISOMETRIC, + /** + * Staggered Tilemap orientation constant. + */ + STAGGERED, + /** + * Hexagonal Tilemap orientation constant. + */ + HEXAGONAL, + } + + /** + * Phaser Tilemap constants for orientation. + * + * To find out what each mode does please see [Phaser.Tilemaps.Orientation]{@link Phaser.Tilemaps.Orientation}. + */ + type OrientationType = Phaser.Tilemaps.Orientation; + + /** + * A class for representing data about about a layer in a map. Maps are parsed from CSV, Tiled, + * etc. into this format. Tilemap and TilemapLayer objects have a reference + * to this data and use it to look up and perform operations on tiles. + */ + class LayerData { + /** + * + * @param config The Layer Data configuration object. + */ + constructor(config?: Phaser.Types.Tilemaps.LayerDataConfig); + + /** + * The name of the layer, if specified in Tiled. + */ + name: string; + + /** + * The x offset of where to draw from the top left. + */ + x: number; + + /** + * The y offset of where to draw from the top left. + */ + y: number; + + /** + * The width of the layer in tiles. + */ + width: number; + + /** + * The height of the layer in tiles. + */ + height: number; + + /** + * The pixel width of the tiles. + */ + tileWidth: number; + + /** + * The pixel height of the tiles. + */ + tileHeight: number; + + /** + * The base tile width. + */ + baseTileWidth: number; + + /** + * The base tile height. + */ + baseTileHeight: number; + + /** + * The layers orientation, necessary to be able to determine a tiles pixelX and pixelY as well as the layers width and height. + */ + orientation: Phaser.Tilemaps.OrientationType; + + /** + * The width in pixels of the entire layer. + */ + widthInPixels: number; + + /** + * The height in pixels of the entire layer. + */ + heightInPixels: number; + + /** + * The alpha value of the layer. + */ + alpha: number; + + /** + * Is the layer visible or not? + */ + visible: boolean; + + /** + * Layer specific properties (can be specified in Tiled) + */ + properties: object[]; + + /** + * Tile ID index map. + */ + indexes: any[]; + + /** + * Tile Collision ID index map. + */ + collideIndexes: any[]; + + /** + * An array of callbacks. + */ + callbacks: any[]; + + /** + * An array of physics bodies. + */ + bodies: any[]; + + /** + * An array of the tile data indexes. + */ + data: Phaser.Tilemaps.Tile[][]; + + /** + * A reference to the Tilemap layer that owns this data. + */ + tilemapLayer: Phaser.Tilemaps.TilemapLayer; + + /** + * The length of the horizontal sides of the hexagon. + * Only used for hexagonal orientation Tilemaps. + */ + hexSideLength: number; + + } + + /** + * A class for representing data about a map. Maps are parsed from CSV, Tiled, etc. into this + * format. A Tilemap object get a copy of this data and then unpacks the needed properties into + * itself. + */ + class MapData { + /** + * + * @param config The Map configuration object. + */ + constructor(config?: Phaser.Types.Tilemaps.MapDataConfig); + + /** + * The key in the Phaser cache that corresponds to the loaded tilemap data. + */ + name: string; + + /** + * The width of the entire tilemap. + */ + width: number; + + /** + * The height of the entire tilemap. + */ + height: number; + + /** + * If the map is infinite or not. + */ + infinite: boolean; + + /** + * The width of the tiles. + */ + tileWidth: number; + + /** + * The height of the tiles. + */ + tileHeight: number; + + /** + * The width in pixels of the entire tilemap. + */ + widthInPixels: number; + + /** + * The height in pixels of the entire tilemap. + */ + heightInPixels: number; + + /** + * The format of the map data. + */ + format: number; + + /** + * The orientation of the map data (i.e. orthogonal, isometric, hexagonal), default 'orthogonal'. + */ + orientation: Phaser.Tilemaps.OrientationType; + + /** + * Determines the draw order of tilemap. Default is right-down + * + * 0, or 'right-down' + * 1, or 'left-down' + * 2, or 'right-up' + * 3, or 'left-up' + */ + renderOrder: string; + + /** + * The version of the map data (as specified in Tiled). + */ + version: string; + + /** + * Map specific properties (can be specified in Tiled) + */ + properties: object; + + /** + * An array with all the layers configured to the MapData. + */ + layers: Phaser.Tilemaps.LayerData[] | Phaser.Tilemaps.ObjectLayer; + + /** + * An array of Tiled Image Layers. + */ + images: any[]; + + /** + * An object of Tiled Object Layers. + */ + objects: Phaser.Types.Tilemaps.ObjectLayerConfig[]; + + /** + * An object of collision data. Must be created as physics object or will return undefined. + */ + collision: object; + + /** + * An array of Tilesets. + */ + tilesets: Phaser.Tilemaps.Tileset[]; + + /** + * The collection of images the map uses(specified in Tiled) + */ + imageCollections: any[]; + + /** + * An array of tile instances. + */ + tiles: any[]; + + /** + * The length of the horizontal sides of the hexagon. + * Only used for hexagonal orientation Tilemaps. + */ + hexSideLength: number; + + } + + /** + * A class for representing a Tiled object layer in a map. This mirrors the structure of a Tiled + * object layer, except: + * - "x" & "y" properties are ignored since these cannot be changed in Tiled. + * - "offsetx" & "offsety" are applied to the individual object coordinates directly, so they + * are ignored as well. + * - "draworder" is ignored. + */ + class ObjectLayer { + /** + * + * @param config The data for the layer from the Tiled JSON object. + */ + constructor(config?: Phaser.Types.Tilemaps.ObjectLayerConfig); + + /** + * The name of the Object Layer. + */ + name: string; + + /** + * The opacity of the layer, between 0 and 1. + */ + opacity: number; + + /** + * The custom properties defined on the Object Layer, keyed by their name. + */ + properties: object; + + /** + * The type of each custom property defined on the Object Layer, keyed by its name. + */ + propertyTypes: object; + + /** + * The type of the layer, which should be `objectgroup`. + */ + type: string; + + /** + * Whether the layer is shown (`true`) or hidden (`false`). + */ + visible: boolean; + + /** + * An array of all objects on this Object Layer. + * + * Each Tiled object corresponds to a JavaScript object in this array. It has an `id` (unique), + * `name` (as assigned in Tiled), `type` (as assigned in Tiled), `rotation` (in clockwise degrees), + * `properties` (if any), `visible` state (`true` if visible, `false` otherwise), + * `x` and `y` coordinates (in pixels, relative to the tilemap), and a `width` and `height` (in pixels). + * + * An object tile has a `gid` property (GID of the represented tile), a `flippedHorizontal` property, + * a `flippedVertical` property, and `flippedAntiDiagonal` property. + * The {@link http://docs.mapeditor.org/en/latest/reference/tmx-map-format/|Tiled documentation} contains + * information on flipping and rotation. + * + * Polylines have a `polyline` property, which is an array of objects corresponding to points, + * where each point has an `x` property and a `y` property. Polygons have an identically structured + * array in their `polygon` property. Text objects have a `text` property with the text's properties. + * + * Rectangles and ellipses have a `rectangle` or `ellipse` property set to `true`. + */ + objects: Phaser.Types.Tilemaps.TiledObject[]; + + } + + namespace Parsers { + /** + * Get the Tilemap orientation from the given string. + * @param orientation The orientation type as a string. + */ + function FromOrientationString(orientation?: string): Phaser.Tilemaps.OrientationType; + + /** + * Parses raw data of a given Tilemap format into a new MapData object. If no recognized data format + * is found, returns `null`. When loading from CSV or a 2D array, you should specify the tileWidth & + * tileHeight. When parsing from a map from Tiled, the tileWidth & tileHeight will be pulled from + * the map data. + * @param name The name of the tilemap, used to set the name on the MapData. + * @param mapFormat See ../Formats.js. + * @param data 2D array, CSV string or Tiled JSON object. + * @param tileWidth The width of a tile in pixels. Required for 2D array and CSV, but + * ignored for Tiled JSON. + * @param tileHeight The height of a tile in pixels. Required for 2D array and CSV, but + * ignored for Tiled JSON. + * @param insertNull Controls how empty tiles, tiles with an index of -1, in the map + * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty + * location will get a Tile object with an index of -1. If you've a large sparsely populated map and + * the tile data doesn't need to change then setting this value to `true` will help with memory + * consumption. However if your map is small or you need to update the tiles dynamically, then leave + * the default value set. + */ + function Parse(name: string, mapFormat: number, data: number[][] | string | object, tileWidth: number, tileHeight: number, insertNull: boolean): Phaser.Tilemaps.MapData; + + /** + * Parses a 2D array of tile indexes into a new MapData object with a single layer. + * @param name The name of the tilemap, used to set the name on the MapData. + * @param data 2D array, CSV string or Tiled JSON object. + * @param tileWidth The width of a tile in pixels. + * @param tileHeight The height of a tile in pixels. + * @param insertNull Controls how empty tiles, tiles with an index of -1, in the map + * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty + * location will get a Tile object with an index of -1. If you've a large sparsely populated map and + * the tile data doesn't need to change then setting this value to `true` will help with memory + * consumption. However if your map is small or you need to update the tiles dynamically, then leave + * the default value set. + */ + function Parse2DArray(name: string, data: number[][], tileWidth: number, tileHeight: number, insertNull: boolean): Phaser.Tilemaps.MapData; + + /** + * Parses a CSV string of tile indexes into a new MapData object with a single layer. + * @param name The name of the tilemap, used to set the name on the MapData. + * @param data CSV string of tile indexes. + * @param tileWidth The width of a tile in pixels. + * @param tileHeight The height of a tile in pixels. + * @param insertNull Controls how empty tiles, tiles with an index of -1, in the map + * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty + * location will get a Tile object with an index of -1. If you've a large sparsely populated map and + * the tile data doesn't need to change then setting this value to `true` will help with memory + * consumption. However if your map is small or you need to update the tiles dynamically, then leave + * the default value set. + */ + function ParseCSV(name: string, data: string, tileWidth: number, tileHeight: number, insertNull: boolean): Phaser.Tilemaps.MapData; + + namespace Impact { + /** + * Parses all tilemap layers in an Impact JSON object into new LayerData objects. + * @param json The Impact JSON object. + * @param insertNull Controls how empty tiles, tiles with an index of -1, in the map + * data are handled (see {@link Phaser.Tilemaps.Parsers.Tiled.ParseJSONTiled}). + */ + function ParseTileLayers(json: object, insertNull: boolean): Phaser.Tilemaps.LayerData[]; + + /** + * Tilesets and Image Collections + * @param json The Impact JSON data. + */ + function ParseTilesets(json: object): any[]; + + /** + * Parses a Weltmeister JSON object into a new MapData object. + * @param name The name of the tilemap, used to set the name on the MapData. + * @param json The Weltmeister JSON object. + * @param insertNull Controls how empty tiles, tiles with an index of -1, in the map + * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty + * location will get a Tile object with an index of -1. If you've a large sparsely populated map and + * the tile data doesn't need to change then setting this value to `true` will help with memory + * consumption. However if your map is small or you need to update the tiles dynamically, then leave + * the default value set. + */ + function ParseWeltmeister(name: string, json: object, insertNull: boolean): Phaser.Tilemaps.MapData | null; + + } + + namespace Tiled { + /** + * Copy properties from tileset to tiles. + * @param mapData The Map Data object. + */ + function AssignTileProperties(mapData: Phaser.Tilemaps.MapData): void; + + /** + * Decode base-64 encoded data, for example as exported by Tiled. + * @param data Base-64 encoded data to decode. + */ + function Base64Decode(data: object): any[]; + + /** + * Master list of tiles -> x, y, index in tileset. + * @param mapData The Map Data object. + */ + function BuildTilesetIndex(mapData: Phaser.Tilemaps.MapData): any[]; + + /** + * Parse a Tiled group layer and create a state object for inheriting. + * @param json The Tiled JSON object. + * @param group The current group layer from the Tiled JSON file. + * @param parentState The state of the parent group (if any). + */ + function CreateGroupLayer(json: object, group?: object, parentState?: object): object; + + /** + * See Tiled documentation on tile flipping: + * http://docs.mapeditor.org/en/latest/reference/tmx-map-format/ + * @param gid A Tiled GID. + */ + function ParseGID(gid: number): Phaser.Types.Tilemaps.GIDData; + + /** + * Parses a Tiled JSON object into an array of objects with details about the image layers. + * @param json The Tiled JSON object. + */ + function ParseImageLayers(json: object): any[]; + + /** + * Parses a Tiled JSON object into a new MapData object. + * @param name The name of the tilemap, used to set the name on the MapData. + * @param json The Tiled JSON object. + * @param insertNull Controls how empty tiles, tiles with an index of -1, in the map + * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty + * location will get a Tile object with an index of -1. If you've a large sparsely populated map and + * the tile data doesn't need to change then setting this value to `true` will help with memory + * consumption. However if your map is small or you need to update the tiles dynamically, then leave + * the default value set. + */ + function ParseJSONTiled(name: string, json: object, insertNull: boolean): Phaser.Tilemaps.MapData | null; + + /** + * Convert a Tiled object to an internal parsed object normalising and copying properties over, while applying optional x and y offsets. The parsed object will always have the properties `id`, `name`, `type`, `rotation`, `properties`, `visible`, `x`, `y`, `width` and `height`. Other properties will be added according to the object type (such as text, polyline, gid etc.) + * @param tiledObject Tiled object to convert to an internal parsed object normalising and copying properties over. + * @param offsetX Optional additional offset to apply to the object's x property. Defaults to 0. Default 0. + * @param offsetY Optional additional offset to apply to the object's y property. Defaults to 0. Default 0. + */ + function ParseObject(tiledObject: object, offsetX?: number, offsetY?: number): object; + + /** + * Parses a Tiled JSON object into an array of ObjectLayer objects. + * @param json The Tiled JSON object. + */ + function ParseObjectLayers(json: object): any[]; + + /** + * Parses all tilemap layers in a Tiled JSON object into new LayerData objects. + * @param json The Tiled JSON object. + * @param insertNull Controls how empty tiles, tiles with an index of -1, in the map + * data are handled (see {@link Phaser.Tilemaps.Parsers.Tiled.ParseJSONTiled}). + */ + function ParseTileLayers(json: object, insertNull: boolean): Phaser.Tilemaps.LayerData[]; + + /** + * Tilesets and Image Collections. + * @param json The Tiled JSON data. + */ + function ParseTilesets(json: object): object; + + /** + * Parses out the Wangset information from Tiled 1.1.5+ map data, if present. + * + * Since a given tile can be in more than one wangset, the resulting properties + * are nested. `tile.data.wangid[someWangsetName]` will return the array-based wang id in + * this implementation. + * + * Note that we're not guaranteed that there will be any 'normal' tiles if the only + * thing in the tilset are wangtile definitions, so this has to be parsed separately. + * + * See https://doc.mapeditor.org/en/latest/manual/using-wang-tiles/ for more information. + * @param wangsets The array of wangset objects (parsed from JSON) + * @param datas The field into which to put wangset data from Tiled. + */ + function ParseWangsets(wangsets: object[], datas: object): object; + + } + + } + /** * Orthogonal Tilemap orientation constant. */ @@ -97733,6 +98060,435 @@ declare namespace Phaser { } namespace Tweens { + /** + * The Tween Manager is a default Scene Plugin which controls and updates Tweens. + */ + class TweenManager { + /** + * + * @param scene The Scene which owns this Tween Manager. + */ + constructor(scene: Phaser.Scene); + + /** + * The Scene which owns this Tween Manager. + */ + scene: Phaser.Scene; + + /** + * The Systems object of the Scene which owns this Tween Manager. + */ + systems: Phaser.Scenes.Systems; + + /** + * The time scale of the Tween Manager. + * + * This value scales the time delta between two frames, thus influencing the speed of time for all Tweens owned by this Tween Manager. + */ + timeScale: number; + + /** + * This toggles the updating state of this Tween Manager. + * + * Setting `paused` to `true` (or calling the `pauseAll` method) will + * stop this Tween Manager from updating any of its tweens, including + * newly created ones. Set back to `false` to resume playback. + */ + paused: boolean; + + /** + * Is this Tween Manager currently processing the tweens as part of + * its 'update' loop? This is set to 'true' at the start of 'update' + * and reset to 'false' at the end of the function. Allows you to trap + * Tween Manager status during tween callbacks. + */ + processing: boolean; + + /** + * An array of Tweens which are actively being processed by the Tween Manager. + */ + tweens: Phaser.Tweens.Tween[]; + + /** + * The time the Tween Manager was updated. + */ + time: number; + + /** + * The time the Tween Manager was started. + */ + startTime: number; + + /** + * The time the Tween Manager should next update. + */ + nextTime: number; + + /** + * The time the Tween Manager previously updated. + */ + prevTime: number; + + /** + * The maximum amount of time, in milliseconds, the browser can + * lag for, before lag smoothing is applied. + * + * See the `TweenManager.setLagSmooth` method for further details. + */ + maxLag: number; + + /** + * The amount of time, in milliseconds, that is used to set the + * delta when lag smoothing is applied. + * + * See the `TweenManager.setLagSmooth` method for further details. + */ + lagSkip: number; + + /** + * An internal value that holds the fps rate. + */ + gap: number; + + /** + * Create a Tween and return it, but does not add it to this Tween Manager. + * + * Please note that a Tween will not manipulate any target property that begins with an underscore. + * + * In order to play this tween, you'll need to add it to a Tween Manager via + * the `TweenManager.existing` method. + * + * You can optionally pass an **array** of Tween Configuration objects to this method and it will create + * one Tween per entry in the array. If an array is given, an array of tweens is returned. + * @param config A Tween Configuration object. Or an array of Tween Configuration objects. + */ + create(config: Phaser.Types.Tweens.TweenBuilderConfig | Phaser.Types.Tweens.TweenBuilderConfig[] | object | object[]): Phaser.Tweens.Tween | Phaser.Tweens.Tween[]; + + /** + * Create a Tween and add it to this Tween Manager by passing a Tween Configuration object. + * + * Example, run from within a Scene: + * + * ```js + * const logo = this.add.image(100, 100, 'logo'); + * + * this.tweens.add({ + * targets: logo, + * x: 600, + * ease: 'Power1', + * duration: 2000 + * }); + * ``` + * + * See the `TweenBuilderConfig` for all of the options you have available. + * + * Playback will start immediately unless the tween has been configured to be paused. + * + * Please note that a Tween will not manipulate any target property that begins with an underscore. + * + * Tweens are designed to be 'fire-and-forget'. They automatically destroy themselves once playback + * is complete, to free-up memory and resources. If you wish to keep a tween after playback, i.e. to + * play it again at a later time, then you should set the `persist` property to `true` in the config. + * However, doing so means it's entirely up to _you_ to destroy the tween when you're finished with it, + * otherwise it will linger in memory forever. + * + * You can optionally pass an **array** of Tween Configuration objects to this method and it will create + * one Tween per entry in the array. If an array is given, an array of tweens is returned. + * + * If you wish to chain Tweens together for sequential playback, see the `TweenManager.chain` method. + * @param config A Tween Configuration object. Or an array of Tween Configuration objects. + */ + add(config: Phaser.Types.Tweens.TweenBuilderConfig | Phaser.Types.Tweens.TweenBuilderConfig[] | object | object[]): Phaser.Tweens.Tween | Phaser.Tweens.Tween[]; + + /** + * Create a sequence of Tweens, chained to one-another, and add them to this Tween Manager. + * + * The tweens are played in order, from start to finish. You can optionally set the chain + * to repeat as many times as you like. Once the chain has finished playing, or repeating if set, + * all tweens in the chain will be destroyed automatically. To override this, set the 'persists' + * argument to 'true'. + * + * Playback will start immediately unless the _first_ Tween has been configured to be paused. + * + * Please note that Tweens will not manipulate any target property that begins with an underscore. + * @param tweens A Tween Chain configuration object, or an array of them to create multiple chains at once. + */ + chain(tweens: Phaser.Types.Tweens.TweenBuilderConfig[] | object[]): Phaser.Tweens.TweenChain | Phaser.Tweens.TweenChain[]; + + /** + * Returns an array containing this Tween and all Tweens chained to it, + * in the order in which they will be played. + * + * If there are no chained Tweens an empty array is returned. + * @param tween The Tween to return the chain from. + */ + getChainedTweens(tween: Phaser.Tweens.Tween): Phaser.Tweens.Tween[]; + + /** + * Check to see if the given Tween instance exists within this Tween Manager. + * + * Will return `true` as long as the Tween is being processed by this Tween Manager. + * + * Will return `false` if not present, or has a state of `REMOVED` or `DESTROYED`. + * @param tween The Tween instance to check. + */ + has(tween: Phaser.Tweens.Tween): boolean; + + /** + * Add an existing Tween to this Tween Manager. + * + * Playback will start immediately unless the tween has been configured to be paused. + * @param tween The Tween to add. + */ + existing(tween: Phaser.Tweens.Tween): this; + + /** + * Create a Number Tween and add it to the active Tween list. + * + * Playback will start immediately unless the tween has been configured to be paused. + * + * Please note that a Tween will not manipulate any target property that begins with an underscore. + * @param config The configuration object for the Number Tween. + */ + addCounter(config: Phaser.Types.Tweens.NumberTweenBuilderConfig): Phaser.Tweens.Tween; + + /** + * Creates a Stagger function to be used by a Tween property. + * + * The stagger function will allow you to stagger changes to the value of the property across all targets of the tween. + * + * This is only worth using if the tween has multiple targets. + * + * The following will stagger the delay by 100ms across all targets of the tween, causing them to scale down to 0.2 + * over the duration specified: + * + * ```javascript + * this.tweens.add({ + * targets: [ ... ], + * scale: 0.2, + * ease: 'linear', + * duration: 1000, + * delay: this.tweens.stagger(100) + * }); + * ``` + * + * The following will stagger the delay by 500ms across all targets of the tween using a 10 x 6 grid, staggering + * from the center out, using a cubic ease. + * + * ```javascript + * this.tweens.add({ + * targets: [ ... ], + * scale: 0.2, + * ease: 'linear', + * duration: 1000, + * delay: this.tweens.stagger(500, { grid: [ 10, 6 ], from: 'center', ease: 'cubic.out' }) + * }); + * ``` + * @param value The amount to stagger by, or an array containing two elements representing the min and max values to stagger between. + * @param config The configuration object for the Stagger function. + */ + stagger(value: number | number[], config: Phaser.Types.Tweens.StaggerConfig): Function; + + /** + * Set the limits that are used when a browser encounters lag, or delays that cause the elapsed + * time between two frames to exceed the expected amount. If this occurs, the Tween Manager will + * act as if the 'skip' amount of times has passed, in order to maintain strict tween sequencing. + * + * This is enabled by default with the values 500ms for the lag limit and 33ms for the skip. + * + * You should not set these to low values, as it won't give time for the browser to ever + * catch-up with itself and reclaim sync. + * + * Call this method with no arguments to disable smoothing. + * + * Call it with the arguments `500` and `33` to reset to the defaults. + * @param limit If the browser exceeds this amount, in milliseconds, it will act as if the 'skip' amount has elapsed instead. Default 0. + * @param skip The amount, in milliseconds, to use as the step delta should the browser lag beyond the 'limit'. Default 0. + */ + setLagSmooth(limit?: number, skip?: number): this; + + /** + * Limits the Tween system to run at a particular frame rate. + * + * You should not set this _above_ the frequency of the browser, + * but instead can use it to throttle the frame rate lower, should + * you need to in certain situations. + * @param fps The frame rate to tick at. Default 240. + */ + setFps(fps?: number): this; + + /** + * Internal method that calculates the delta value, along with the other timing values, + * and returns the new delta. + * + * You should not typically call this method directly. + * @param tick Is this a manual tick, or an automated tick? Default false. + */ + getDelta(tick?: boolean): number; + + /** + * Manually advance the Tween system by one step. + * + * This will update all Tweens even if the Tween Manager is currently + * paused. + */ + tick(): this; + + /** + * Internal update handler. + * + * Calls `TweenManager.step` as long as the Tween Manager has not + * been paused. + */ + update(): void; + + /** + * Updates all Tweens belonging to this Tween Manager. + * + * Called automatically by `update` and `tick`. + * @param tick Is this a manual tick, or an automated tick? Default false. + */ + step(tick?: boolean): void; + + /** + * Removes the given Tween from this Tween Manager, even if it hasn't started + * playback yet. If this method is called while the Tween Manager is processing + * an update loop, then the tween will be flagged for removal at the start of + * the next frame. Otherwise, it is removed immediately. + * + * The removed tween is _not_ destroyed. It is just removed from this Tween Manager. + * @param tween The Tween to be removed. + */ + remove(tween: Phaser.Tweens.Tween): this; + + /** + * Resets the given Tween. + * + * If the Tween does not belong to this Tween Manager, it will first be added. + * + * Then it will seek to position 0 and playback will start on the next frame. + * @param tween The Tween to be reset. + */ + reset(tween: Phaser.Tweens.Tween): this; + + /** + * Checks if a Tween is active and adds it to the Tween Manager at the start of the frame if it isn't. + * @param tween The Tween to check. + */ + makeActive(tween: Phaser.Tweens.Tween): this; + + /** + * Passes all Tweens to the given callback. + * @param callback The function to call. + * @param scope The scope (`this` object) to call the function with. + * @param args The arguments to pass into the function. Its first argument will always be the Tween currently being iterated. + */ + each(callback: Function, scope?: object, ...args: any[]): this; + + /** + * Returns an array containing references to all Tweens in this Tween Manager. + * + * It is safe to mutate the returned array. However, acting upon any of the Tweens + * within it, will adjust those stored in this Tween Manager, as they are passed + * by reference and not cloned. + * + * If you wish to get tweens for a specific target, see `getTweensOf`. + */ + getTweens(): Phaser.Tweens.Tween[]; + + /** + * Returns an array of all Tweens in the Tween Manager which affect the given target, or array of targets. + * + * It's possible for this method to return tweens that are about to be removed from + * the Tween Manager. You should check the state of the returned tween before acting + * upon it. + * @param target The target to look for. Provide an array to look for multiple targets. + */ + getTweensOf(target: object | any[]): Phaser.Tweens.Tween[]; + + /** + * Returns the scale of the time delta for all Tweens owned by this Tween Manager. + */ + getGlobalTimeScale(): number; + + /** + * Sets a new scale of the time delta for this Tween Manager. + * + * The time delta is the time elapsed between two consecutive frames and influences the speed of time for this Tween Manager and all Tweens it owns. Values higher than 1 increase the speed of time, while values smaller than 1 decrease it. A value of 0 freezes time and is effectively equivalent to pausing all Tweens. + * @param value The new scale of the time delta, where 1 is the normal speed. + */ + setGlobalTimeScale(value: number): this; + + /** + * Checks if the given object is being affected by a _playing_ Tween. + * + * If the Tween is paused, this method will return false. + * @param target The object to check if a tween is active for it, or not. + */ + isTweening(target: object): boolean; + + /** + * Destroys all Tweens in this Tween Manager. + * + * The tweens will erase all references to any targets they hold + * and be stopped immediately. + * + * If this method is called while the Tween Manager is running its + * update process, then the tweens will be removed at the start of + * the next frame. Outside of this, they are removed immediately. + */ + killAll(): this; + + /** + * Stops all Tweens which affect the given target or array of targets. + * + * The tweens will erase all references to any targets they hold + * and be stopped immediately. + * + * If this method is called while the Tween Manager is running its + * update process, then the tweens will be removed at the start of + * the next frame. Outside of this, they are removed immediately. + * @param target The target to kill the tweens of. Provide an array to use multiple targets. + */ + killTweensOf(target: object | any[]): this; + + /** + * Pauses this Tween Manager. No Tweens will update while paused. + * + * This includes tweens created after this method was called. + * + * See `TweenManager#resumeAll` to resume the playback. + * + * As of Phaser 3.60 you can also toggle the boolean property `TweenManager.paused`. + */ + pauseAll(): this; + + /** + * Resumes playback of this Tween Manager. + * + * All active Tweens will continue updating. + * + * See `TweenManager#pauseAll` to pause the playback. + * + * As of Phaser 3.60 you can also toggle the boolean property `TweenManager.paused`. + */ + resumeAll(): this; + + /** + * The Scene that owns this plugin is shutting down. + * + * We need to kill and reset all internal properties as well as stop listening to Scene events. + */ + shutdown(): void; + + /** + * The Scene that owns this plugin is being destroyed. + * We need to shutdown and then kill off all external references. + */ + destroy(): void; + + } + namespace Builders { /** * Retrieves the value of the given key from an object. @@ -98745,105 +99501,6 @@ declare namespace Phaser { } - /** - * Phaser Tween States. - */ - namespace States { - /** - * TweenData state. - */ - const CREATED: number; - - /** - * TweenData state. - */ - const DELAY: number; - - /** - * TweenData state. - */ - const PENDING_RENDER: number; - - /** - * TweenData state. - */ - const PLAYING_FORWARD: number; - - /** - * TweenData state. - */ - const PLAYING_BACKWARD: number; - - /** - * TweenData state. - */ - const HOLD_DELAY: number; - - /** - * TweenData state. - */ - const REPEAT_DELAY: number; - - /** - * TweenData state. - */ - const COMPLETE: number; - - /** - * Tween state. The Tween has been created but has not yet been added to the Tween Manager. - */ - const PENDING: number; - - /** - * Tween state. The Tween is active within the Tween Manager. This means it is either playing, - * or was playing and is currently paused, but in both cases it's still being processed by - * the Tween Manager, so is considered 'active'. - */ - const ACTIVE: number; - - /** - * Tween state. The Tween is waiting for a loop countdown to elapse. - */ - const LOOP_DELAY: number; - - /** - * Tween state. The Tween is waiting for a complete delay to elapse. - */ - const COMPLETE_DELAY: number; - - /** - * Tween state. The Tween is waiting for a starting delay to elapse. - */ - const START_DELAY: number; - - /** - * Tween state. The Tween has finished playback and is waiting to be removed from the Tween Manager. - */ - const PENDING_REMOVE: number; - - /** - * Tween state. The Tween has been removed from the Tween Manager. - */ - const REMOVED: number; - - /** - * Tween state. The Tween has finished playback but was flagged as 'persistent' during creation, - * so will not be automatically removed by the Tween Manager. - */ - const FINISHED: number; - - /** - * Tween state. The Tween has been destroyed and can no longer be played by a Tween Manager. - */ - const DESTROYED: number; - - } - - /** - * Phaser Tween state constants. - */ - type StateType = Phaser.Tweens.States; - /** * A Tween is able to manipulate the properties of one or more objects to any given value, based * on a duration and type of ease. They are rarely instantiated directly and instead should be @@ -99468,437 +100125,98 @@ declare namespace Phaser { } /** - * The Tween Manager is a default Scene Plugin which controls and updates Tweens. + * Phaser Tween States. */ - class TweenManager { + enum States { /** - * - * @param scene The Scene which owns this Tween Manager. + * TweenData state. */ - constructor(scene: Phaser.Scene); - + CREATED, /** - * The Scene which owns this Tween Manager. + * TweenData state. */ - scene: Phaser.Scene; - + DELAY, /** - * The Systems object of the Scene which owns this Tween Manager. + * TweenData state. */ - systems: Phaser.Scenes.Systems; - + PENDING_RENDER, /** - * The time scale of the Tween Manager. - * - * This value scales the time delta between two frames, thus influencing the speed of time for all Tweens owned by this Tween Manager. + * TweenData state. */ - timeScale: number; - + PLAYING_FORWARD, /** - * This toggles the updating state of this Tween Manager. - * - * Setting `paused` to `true` (or calling the `pauseAll` method) will - * stop this Tween Manager from updating any of its tweens, including - * newly created ones. Set back to `false` to resume playback. + * TweenData state. */ - paused: boolean; - + PLAYING_BACKWARD, /** - * Is this Tween Manager currently processing the tweens as part of - * its 'update' loop? This is set to 'true' at the start of 'update' - * and reset to 'false' at the end of the function. Allows you to trap - * Tween Manager status during tween callbacks. + * TweenData state. */ - processing: boolean; - + HOLD_DELAY, /** - * An array of Tweens which are actively being processed by the Tween Manager. + * TweenData state. */ - tweens: Phaser.Tweens.Tween[]; - + REPEAT_DELAY, /** - * The time the Tween Manager was updated. + * TweenData state. */ - time: number; - + COMPLETE, /** - * The time the Tween Manager was started. + * Tween state. The Tween has been created but has not yet been added to the Tween Manager. */ - startTime: number; - + PENDING, /** - * The time the Tween Manager should next update. + * Tween state. The Tween is active within the Tween Manager. This means it is either playing, + * or was playing and is currently paused, but in both cases it's still being processed by + * the Tween Manager, so is considered 'active'. */ - nextTime: number; - + ACTIVE, /** - * The time the Tween Manager previously updated. + * Tween state. The Tween is waiting for a loop countdown to elapse. */ - prevTime: number; - + LOOP_DELAY, /** - * The maximum amount of time, in milliseconds, the browser can - * lag for, before lag smoothing is applied. - * - * See the `TweenManager.setLagSmooth` method for further details. + * Tween state. The Tween is waiting for a complete delay to elapse. */ - maxLag: number; - + COMPLETE_DELAY, /** - * The amount of time, in milliseconds, that is used to set the - * delta when lag smoothing is applied. - * - * See the `TweenManager.setLagSmooth` method for further details. + * Tween state. The Tween is waiting for a starting delay to elapse. */ - lagSkip: number; - + START_DELAY, /** - * An internal value that holds the fps rate. + * Tween state. The Tween has finished playback and is waiting to be removed from the Tween Manager. */ - gap: number; - + PENDING_REMOVE, /** - * Create a Tween and return it, but does not add it to this Tween Manager. - * - * Please note that a Tween will not manipulate any target property that begins with an underscore. - * - * In order to play this tween, you'll need to add it to a Tween Manager via - * the `TweenManager.existing` method. - * - * You can optionally pass an **array** of Tween Configuration objects to this method and it will create - * one Tween per entry in the array. If an array is given, an array of tweens is returned. - * @param config A Tween Configuration object. Or an array of Tween Configuration objects. + * Tween state. The Tween has been removed from the Tween Manager. */ - create(config: Phaser.Types.Tweens.TweenBuilderConfig | Phaser.Types.Tweens.TweenBuilderConfig[] | object | object[]): Phaser.Tweens.Tween | Phaser.Tweens.Tween[]; - + REMOVED, /** - * Create a Tween and add it to this Tween Manager by passing a Tween Configuration object. - * - * Example, run from within a Scene: - * - * ```js - * const logo = this.add.image(100, 100, 'logo'); - * - * this.tweens.add({ - * targets: logo, - * x: 600, - * ease: 'Power1', - * duration: 2000 - * }); - * ``` - * - * See the `TweenBuilderConfig` for all of the options you have available. - * - * Playback will start immediately unless the tween has been configured to be paused. - * - * Please note that a Tween will not manipulate any target property that begins with an underscore. - * - * Tweens are designed to be 'fire-and-forget'. They automatically destroy themselves once playback - * is complete, to free-up memory and resources. If you wish to keep a tween after playback, i.e. to - * play it again at a later time, then you should set the `persist` property to `true` in the config. - * However, doing so means it's entirely up to _you_ to destroy the tween when you're finished with it, - * otherwise it will linger in memory forever. - * - * You can optionally pass an **array** of Tween Configuration objects to this method and it will create - * one Tween per entry in the array. If an array is given, an array of tweens is returned. - * - * If you wish to chain Tweens together for sequential playback, see the `TweenManager.chain` method. - * @param config A Tween Configuration object. Or an array of Tween Configuration objects. + * Tween state. The Tween has finished playback but was flagged as 'persistent' during creation, + * so will not be automatically removed by the Tween Manager. */ - add(config: Phaser.Types.Tweens.TweenBuilderConfig | Phaser.Types.Tweens.TweenBuilderConfig[] | object | object[]): Phaser.Tweens.Tween | Phaser.Tweens.Tween[]; - + FINISHED, /** - * Create a sequence of Tweens, chained to one-another, and add them to this Tween Manager. - * - * The tweens are played in order, from start to finish. You can optionally set the chain - * to repeat as many times as you like. Once the chain has finished playing, or repeating if set, - * all tweens in the chain will be destroyed automatically. To override this, set the 'persists' - * argument to 'true'. - * - * Playback will start immediately unless the _first_ Tween has been configured to be paused. - * - * Please note that Tweens will not manipulate any target property that begins with an underscore. - * @param tweens A Tween Chain configuration object, or an array of them to create multiple chains at once. + * Tween state. The Tween has been destroyed and can no longer be played by a Tween Manager. */ - chain(tweens: Phaser.Types.Tweens.TweenBuilderConfig[] | object[]): Phaser.Tweens.TweenChain | Phaser.Tweens.TweenChain[]; - - /** - * Returns an array containing this Tween and all Tweens chained to it, - * in the order in which they will be played. - * - * If there are no chained Tweens an empty array is returned. - * @param tween The Tween to return the chain from. - */ - getChainedTweens(tween: Phaser.Tweens.Tween): Phaser.Tweens.Tween[]; - - /** - * Check to see if the given Tween instance exists within this Tween Manager. - * - * Will return `true` as long as the Tween is being processed by this Tween Manager. - * - * Will return `false` if not present, or has a state of `REMOVED` or `DESTROYED`. - * @param tween The Tween instance to check. - */ - has(tween: Phaser.Tweens.Tween): boolean; - - /** - * Add an existing Tween to this Tween Manager. - * - * Playback will start immediately unless the tween has been configured to be paused. - * @param tween The Tween to add. - */ - existing(tween: Phaser.Tweens.Tween): this; - - /** - * Create a Number Tween and add it to the active Tween list. - * - * Playback will start immediately unless the tween has been configured to be paused. - * - * Please note that a Tween will not manipulate any target property that begins with an underscore. - * @param config The configuration object for the Number Tween. - */ - addCounter(config: Phaser.Types.Tweens.NumberTweenBuilderConfig): Phaser.Tweens.Tween; - - /** - * Creates a Stagger function to be used by a Tween property. - * - * The stagger function will allow you to stagger changes to the value of the property across all targets of the tween. - * - * This is only worth using if the tween has multiple targets. - * - * The following will stagger the delay by 100ms across all targets of the tween, causing them to scale down to 0.2 - * over the duration specified: - * - * ```javascript - * this.tweens.add({ - * targets: [ ... ], - * scale: 0.2, - * ease: 'linear', - * duration: 1000, - * delay: this.tweens.stagger(100) - * }); - * ``` - * - * The following will stagger the delay by 500ms across all targets of the tween using a 10 x 6 grid, staggering - * from the center out, using a cubic ease. - * - * ```javascript - * this.tweens.add({ - * targets: [ ... ], - * scale: 0.2, - * ease: 'linear', - * duration: 1000, - * delay: this.tweens.stagger(500, { grid: [ 10, 6 ], from: 'center', ease: 'cubic.out' }) - * }); - * ``` - * @param value The amount to stagger by, or an array containing two elements representing the min and max values to stagger between. - * @param config The configuration object for the Stagger function. - */ - stagger(value: number | number[], config: Phaser.Types.Tweens.StaggerConfig): Function; - - /** - * Set the limits that are used when a browser encounters lag, or delays that cause the elapsed - * time between two frames to exceed the expected amount. If this occurs, the Tween Manager will - * act as if the 'skip' amount of times has passed, in order to maintain strict tween sequencing. - * - * This is enabled by default with the values 500ms for the lag limit and 33ms for the skip. - * - * You should not set these to low values, as it won't give time for the browser to ever - * catch-up with itself and reclaim sync. - * - * Call this method with no arguments to disable smoothing. - * - * Call it with the arguments `500` and `33` to reset to the defaults. - * @param limit If the browser exceeds this amount, in milliseconds, it will act as if the 'skip' amount has elapsed instead. Default 0. - * @param skip The amount, in milliseconds, to use as the step delta should the browser lag beyond the 'limit'. Default 0. - */ - setLagSmooth(limit?: number, skip?: number): this; - - /** - * Limits the Tween system to run at a particular frame rate. - * - * You should not set this _above_ the frequency of the browser, - * but instead can use it to throttle the frame rate lower, should - * you need to in certain situations. - * @param fps The frame rate to tick at. Default 240. - */ - setFps(fps?: number): this; - - /** - * Internal method that calculates the delta value, along with the other timing values, - * and returns the new delta. - * - * You should not typically call this method directly. - * @param tick Is this a manual tick, or an automated tick? Default false. - */ - getDelta(tick?: boolean): number; - - /** - * Manually advance the Tween system by one step. - * - * This will update all Tweens even if the Tween Manager is currently - * paused. - */ - tick(): this; - - /** - * Internal update handler. - * - * Calls `TweenManager.step` as long as the Tween Manager has not - * been paused. - */ - update(): void; - - /** - * Updates all Tweens belonging to this Tween Manager. - * - * Called automatically by `update` and `tick`. - * @param tick Is this a manual tick, or an automated tick? Default false. - */ - step(tick?: boolean): void; - - /** - * Removes the given Tween from this Tween Manager, even if it hasn't started - * playback yet. If this method is called while the Tween Manager is processing - * an update loop, then the tween will be flagged for removal at the start of - * the next frame. Otherwise, it is removed immediately. - * - * The removed tween is _not_ destroyed. It is just removed from this Tween Manager. - * @param tween The Tween to be removed. - */ - remove(tween: Phaser.Tweens.Tween): this; - - /** - * Resets the given Tween. - * - * If the Tween does not belong to this Tween Manager, it will first be added. - * - * Then it will seek to position 0 and playback will start on the next frame. - * @param tween The Tween to be reset. - */ - reset(tween: Phaser.Tweens.Tween): this; - - /** - * Checks if a Tween is active and adds it to the Tween Manager at the start of the frame if it isn't. - * @param tween The Tween to check. - */ - makeActive(tween: Phaser.Tweens.Tween): this; - - /** - * Passes all Tweens to the given callback. - * @param callback The function to call. - * @param scope The scope (`this` object) to call the function with. - * @param args The arguments to pass into the function. Its first argument will always be the Tween currently being iterated. - */ - each(callback: Function, scope?: object, ...args: any[]): this; - - /** - * Returns an array containing references to all Tweens in this Tween Manager. - * - * It is safe to mutate the returned array. However, acting upon any of the Tweens - * within it, will adjust those stored in this Tween Manager, as they are passed - * by reference and not cloned. - * - * If you wish to get tweens for a specific target, see `getTweensOf`. - */ - getTweens(): Phaser.Tweens.Tween[]; - - /** - * Returns an array of all Tweens in the Tween Manager which affect the given target, or array of targets. - * - * It's possible for this method to return tweens that are about to be removed from - * the Tween Manager. You should check the state of the returned tween before acting - * upon it. - * @param target The target to look for. Provide an array to look for multiple targets. - */ - getTweensOf(target: object | any[]): Phaser.Tweens.Tween[]; - - /** - * Returns the scale of the time delta for all Tweens owned by this Tween Manager. - */ - getGlobalTimeScale(): number; - - /** - * Sets a new scale of the time delta for this Tween Manager. - * - * The time delta is the time elapsed between two consecutive frames and influences the speed of time for this Tween Manager and all Tweens it owns. Values higher than 1 increase the speed of time, while values smaller than 1 decrease it. A value of 0 freezes time and is effectively equivalent to pausing all Tweens. - * @param value The new scale of the time delta, where 1 is the normal speed. - */ - setGlobalTimeScale(value: number): this; - - /** - * Checks if the given object is being affected by a _playing_ Tween. - * - * If the Tween is paused, this method will return false. - * @param target The object to check if a tween is active for it, or not. - */ - isTweening(target: object): boolean; - - /** - * Destroys all Tweens in this Tween Manager. - * - * The tweens will erase all references to any targets they hold - * and be stopped immediately. - * - * If this method is called while the Tween Manager is running its - * update process, then the tweens will be removed at the start of - * the next frame. Outside of this, they are removed immediately. - */ - killAll(): this; - - /** - * Stops all Tweens which affect the given target or array of targets. - * - * The tweens will erase all references to any targets they hold - * and be stopped immediately. - * - * If this method is called while the Tween Manager is running its - * update process, then the tweens will be removed at the start of - * the next frame. Outside of this, they are removed immediately. - * @param target The target to kill the tweens of. Provide an array to use multiple targets. - */ - killTweensOf(target: object | any[]): this; - - /** - * Pauses this Tween Manager. No Tweens will update while paused. - * - * This includes tweens created after this method was called. - * - * See `TweenManager#resumeAll` to resume the playback. - * - * As of Phaser 3.60 you can also toggle the boolean property `TweenManager.paused`. - */ - pauseAll(): this; - - /** - * Resumes playback of this Tween Manager. - * - * All active Tweens will continue updating. - * - * See `TweenManager#pauseAll` to pause the playback. - * - * As of Phaser 3.60 you can also toggle the boolean property `TweenManager.paused`. - */ - resumeAll(): this; - - /** - * The Scene that owns this plugin is shutting down. - * - * We need to kill and reset all internal properties as well as stop listening to Scene events. - */ - shutdown(): void; - - /** - * The Scene that owns this plugin is being destroyed. - * We need to shutdown and then kill off all external references. - */ - destroy(): void; - + DESTROYED, } + /** + * Phaser Tween state constants. + */ + type StateType = Phaser.Tweens.States; + } namespace Utils { + /** + * A NOOP (No Operation) callback function. + * + * Used internally by Phaser when it's more expensive to determine if a callback exists + * than it is to just invoke an empty function. + */ + function NOOP(): void; + namespace Array { /** * Adds the given item, or array of items, to the array. @@ -100040,220 +100358,6 @@ declare namespace Phaser { */ function GetRandom(array: any[], startIndex?: number, length?: number): any; - namespace Matrix { - /** - * Checks if an array can be used as a matrix. - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * @param matrix The array to check. - */ - function CheckMatrix(matrix?: T[][]): boolean; - - /** - * Generates a string (which you can pass to console.log) from the given Array Matrix. - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. There must be at least two rows. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * @param matrix A 2-dimensional array. - */ - function MatrixToString(matrix?: T[][]): string; - - /** - * Reverses the columns in the given Array Matrix. - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. There must be at least two rows. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * @param matrix The array matrix to reverse the columns for. - */ - function ReverseColumns(matrix?: T[][]): T[][]; - - /** - * Reverses the rows in the given Array Matrix. - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. There must be at least two rows. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * @param matrix The array matrix to reverse the rows for. - */ - function ReverseRows(matrix?: T[][]): T[][]; - - /** - * Rotates the array matrix 180 degrees. - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. There must be at least two rows. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * @param matrix The array to rotate. - */ - function Rotate180(matrix?: T[][]): T[][]; - - /** - * Rotates the array matrix to the left (or 90 degrees) - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. There must be at least two rows. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * @param matrix The array to rotate. - */ - function RotateLeft(matrix?: T[][]): T[][]; - - /** - * Rotates the array matrix based on the given rotation value. - * - * The value can be given in degrees: 90, -90, 270, -270 or 180, - * or a string command: `rotateLeft`, `rotateRight` or `rotate180`. - * - * Based on the routine from {@link http://jsfiddle.net/MrPolywhirl/NH42z/}. - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. There must be at least two rows. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * @param matrix The array to rotate. - * @param direction The amount to rotate the matrix by. Default 90. - */ - function RotateMatrix(matrix?: T[][], direction?: number | string): T[][]; - - /** - * Rotates the array matrix to the left (or -90 degrees) - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. There must be at least two rows. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * @param matrix The array to rotate. - */ - function RotateRight(matrix?: T[][]): T[][]; - - /** - * Translates the given Array Matrix by shifting each column and row the - * amount specified. - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. There must be at least two rows. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * @param matrix The array matrix to translate. - * @param x The amount to horizontally translate the matrix by. Default 0. - * @param y The amount to vertically translate the matrix by. Default 0. - */ - function Translate(matrix?: T[][], x?: number, y?: number): T[][]; - - /** - * Transposes the elements of the given matrix (array of arrays). - * - * The transpose of a matrix is a new matrix whose rows are the columns of the original. - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) - * have the same length. There must be at least two rows. This is an example matrix: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * @param array The array matrix to transpose. - */ - function TransposeMatrix(array?: T[][]): T[][]; - - } - /** * Moves the given array element above another one in the array. * The array is modified in-place. @@ -100539,6 +100643,220 @@ declare namespace Phaser { */ function Swap(array: any[], item1: any, item2: any): any[]; + namespace Matrix { + /** + * Checks if an array can be used as a matrix. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * @param matrix The array to check. + */ + function CheckMatrix(matrix?: T[][]): boolean; + + /** + * Generates a string (which you can pass to console.log) from the given Array Matrix. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * @param matrix A 2-dimensional array. + */ + function MatrixToString(matrix?: T[][]): string; + + /** + * Reverses the columns in the given Array Matrix. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * @param matrix The array matrix to reverse the columns for. + */ + function ReverseColumns(matrix?: T[][]): T[][]; + + /** + * Reverses the rows in the given Array Matrix. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * @param matrix The array matrix to reverse the rows for. + */ + function ReverseRows(matrix?: T[][]): T[][]; + + /** + * Rotates the array matrix 180 degrees. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * @param matrix The array to rotate. + */ + function Rotate180(matrix?: T[][]): T[][]; + + /** + * Rotates the array matrix to the left (or 90 degrees) + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * @param matrix The array to rotate. + */ + function RotateLeft(matrix?: T[][]): T[][]; + + /** + * Rotates the array matrix based on the given rotation value. + * + * The value can be given in degrees: 90, -90, 270, -270 or 180, + * or a string command: `rotateLeft`, `rotateRight` or `rotate180`. + * + * Based on the routine from {@link http://jsfiddle.net/MrPolywhirl/NH42z/}. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * @param matrix The array to rotate. + * @param direction The amount to rotate the matrix by. Default 90. + */ + function RotateMatrix(matrix?: T[][], direction?: number | string): T[][]; + + /** + * Rotates the array matrix to the left (or -90 degrees) + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * @param matrix The array to rotate. + */ + function RotateRight(matrix?: T[][]): T[][]; + + /** + * Translates the given Array Matrix by shifting each column and row the + * amount specified. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * @param matrix The array matrix to translate. + * @param x The amount to horizontally translate the matrix by. Default 0. + * @param y The amount to vertically translate the matrix by. Default 0. + */ + function Translate(matrix?: T[][], x?: number, y?: number): T[][]; + + /** + * Transposes the elements of the given matrix (array of arrays). + * + * The transpose of a matrix is a new matrix whose rows are the columns of the original. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * @param array The array matrix to transpose. + */ + function TransposeMatrix(array?: T[][]): T[][]; + + } + } namespace Base64 { @@ -100561,14 +100879,6 @@ declare namespace Phaser { } - /** - * A NOOP (No Operation) callback function. - * - * Used internally by Phaser when it's more expensive to determine if a callback exists - * than it is to just invoke an empty function. - */ - function NOOP(): void; - namespace Objects { /** * Shallow Object Clone. Will not clone nested objects. @@ -100807,12 +101117,6 @@ declare namespace Phaser { */ function Reverse(string: string): string; - /** - * Capitalizes the first letter of a string if there is one. - * @param str The string to capitalize. - */ - function UppercaseFirst(str: string): string; - /** * Creates and returns an RFC4122 version 4 compliant UUID. * @@ -100821,6 +101125,12 @@ declare namespace Phaser { */ function UUID(): string; + /** + * Capitalizes the first letter of a string if there is one. + * @param str The string to capitalize. + */ + function UppercaseFirst(str: string): string; + } } @@ -101728,14 +102038,14 @@ declare type EachSetCallback = (entry: E, index: number)=>boolean | null; declare type EachTextureCallback = (texture: Phaser.Textures.Texture, ...args: any[])=>void; -declare type FindTileCallback = (value: Phaser.Tilemaps.Tile, index: number, array: Phaser.Tilemaps.Tile[])=>boolean; - -declare type EachTileCallback = (value: Phaser.Tilemaps.Tile, index: number, array: Phaser.Tilemaps.Tile[])=>void; - declare type TilemapFilterCallback = (value: Phaser.GameObjects.GameObject, index: number, array: Phaser.GameObjects.GameObject[])=>Phaser.GameObjects.GameObject; declare type TilemapFindCallback = (value: Phaser.GameObjects.GameObject, index: number, array: Phaser.GameObjects.GameObject[])=>boolean; +declare type FindTileCallback = (value: Phaser.Tilemaps.Tile, index: number, array: Phaser.Tilemaps.Tile[])=>boolean; + +declare type EachTileCallback = (value: Phaser.Tilemaps.Tile, index: number, array: Phaser.Tilemaps.Tile[])=>void; + /** * Phaser.Class */